Skip to content

Instantly share code, notes, and snippets.

@jamesaxl
jamesaxl / pygtk-cairo-opaque-xshape-window-from-png.py
Created April 18, 2012 11:04 — forked from skriticos/pygtk-cairo-opaque-xshape-window-from-png.py
Transparent, irregular edge splash screen with pyGTK and XShape.
""" Transparent, irregular edge splash screen with pyGTK and XShape.
Takes a png image with transparent section, creates a window with pyGTK, puts this image in
there with cairo and then trims the edges with X11 XShape clipping extension.
This file demonstrates a python script which loads a png image of size 800x650 and name base.png
Then it creates a GTK+/Cairo window with opaque settings from the png file and the transparent
portions cut out with a mask. Basic, but works and looks great.
Note: this is a proof of concept file. It works, but it is by no means production ready.
"""
protected Object Session { get; set;}
public PasteBin(){
#if SOUP_SHARP
Session = new Soup.Session ();
#else
Session = new System.Net.WebClient();
#endif
}
#if SOUP_SHARP
protected Soup.Session Session { get; set;}
#else
protected System.Net.WebClient Session { get; set;}
#endif
public PasteBin(){
#if SOUP_SHARP
Session = new Soup.Session ();
#else
var values = new System.Collections.Specialized.NameValueCollection();
values["code"] = content;
values["lexer"] = language;
values["expiry"] = expiry;
System.Net.ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
Session.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
var message = Session.UploadValues("https://bpaste.net/", "POST", values);
var url = System.Text.Encoding.Default.GetString(message);
using System;
namespace PasteSharp
{
public abstract class PasteBin
{
public virtual void SendContentRequest(string content, string language, string expiry) {}
public virtual SendContentRequest(string content, string nick, string channel ,string summary)
public string GetUrlRequest { get; protected set;}
public string GetCententRequest { get; protected set;}
<?xml version="1.0" encoding="utf-8"?>
<opml version="1.0">
<head>
<dateCreated>Mon, 26 Nov 2018 19:40:22 +0000</dateCreated>
<title>Tiny Tiny RSS Feed Export</title>
</head>
<body>
<outline text="Android">
<outline type="rss" text="Android and Me" xmlUrl="http://feeds.feedburner.com/androidandme" htmlUrl="https://androidandme.com"/>
</outline>