/usr/lib/gdesklets/display/Plug.py is in gdesklets 0.36.1-7.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | from main import UNSET_COORD
import gtk
#
# Container class for displays that are pluggable into other applications.
#
class Plug(gtk.Plug):
def __init__(self):
# window size for detecting resizing
self.__window_size = (0, 0)
self.__shape = None
gtk.Plug.__init__(self, 0L)
self.set_size_request(-1, -1)
self.set_default_size(10, 10)
# set up event handlers
self.add_events(gtk.gdk.BUTTON_PRESS_MASK |
gtk.gdk.BUTTON_RELEASE_MASK)
#
# Returns the XEMBED ID for embedding this plug into other applications.
#
def get_xembed_id(self):
return self.get_id()
def close(self):
self.destroy()
def set_position(self, x, y):
# we happily ignore this
pass
def set_size(self, width, height):
self.resize(width, height)
def set_window_flags(self, value):
# we happily ignore this
pass
def set_shape(self, mask):
if (self.__window_pos == (UNSET_COORD, UNSET_COORD)):
self.__shape = mask
else:
self.shape_combine_mask(mask, 0, 0)
|