Example #1
0
    def __init__(self, 
                 enable_resize=False, 
                 shadow_radius=6, 
                 window_type=gtk.WINDOW_TOPLEVEL, 
                 shadow_visible=True,
                 shape_frame_function=None,
                 expose_frame_function=None,
                 expose_background_function=None,
                 ):
        '''
        Initialise the Window class.

        @param enable_resize: If True, the window will be set resizable. By default, it's False.
        @param shadow_radius: The radius of the shadow. By default, it's 6.
        @param window_type: A flag of type gtk.WindowType, which indicates the type of the window. By default, it's gtk.WINDOW_TOPLEVEL.
        @param shadow_visible: If True, the shadow is visible. By default, it's True, just disable when your program not allow manipulate colormap, such as mplayer. 
        @param shape_frame_function: The function to define the shape of frame.
        @param expose_frame_function: The function to render frame.
        '''
        # Init.
        WindowBase.__init__(self, window_type)
        self.shadow_radius = shadow_radius
        self.enable_resize = enable_resize
        self.shadow_visible = shadow_visible
        self.shape_frame_function = shape_frame_function
        self.expose_frame_function = expose_frame_function
        self.expose_background_function = expose_background_function
        self.set_colormap(gtk.gdk.Screen().get_rgba_colormap())
        self.background_color = (0, 0, 0, 0)
        
        self.init()
Example #2
0
    def __init__(self,
                 enable_resize=False,
                 shadow_radius=6,
                 window_type=gtk.WINDOW_TOPLEVEL):
        '''
        Initialise the Window class.

        @param enable_resize: If True, the window will be set resizable. By default, it's False.
        @param shadow_radius: The radius of the shadow.
        @param window_type: A flag of type gtk._gtk.WindowType, which indicates the type of the window. By default, it's gtk.WINDOW_TOPLEVEL.
        '''
        # Init.
        WindowBase.__init__(self, window_type)
        self.shadow_radius = shadow_radius
        self.enable_resize = enable_resize
        self.background_color = (0, 0, 0, 0)
        # FIXME: Because mplayer don't allowed window redirect colormap to screen.
        # We build shadow window to emulate it, but shadow's visual effect
        # is not good enough, so we disable shadow temporary for future fixed.
        self.shadow_visible = False
        if enable_shadow(self) and self.shadow_visible:
            self.window_shadow.set_colormap(
                gtk.gdk.Screen().get_rgba_colormap())

        self.init()
Example #3
0
    def __init__(
        self,
        enable_resize=False,
        shadow_radius=6,
        window_type=gtk.WINDOW_TOPLEVEL,
        shadow_visible=True,
        shape_frame_function=None,
        expose_frame_function=None,
        expose_background_function=None,
        expose_shadow_function=None,
        frame_radius=2,
    ):
        '''
        Initialise the Window class.

        @param enable_resize: If True, the window will be set resizable. By default, it's False.
        @param shadow_radius: The radius of the shadow. By default, it's 6.
        @param window_type: A flag of type gtk.WindowType, which indicates the type of the window. By default, it's gtk.WINDOW_TOPLEVEL.
        @param shadow_visible: If True, the shadow is visible. By default, it's True, just disable when your program not allow manipulate colormap, such as mplayer.
        @param shape_frame_function: The function to define the shape of frame.
        @param expose_frame_function: The function to render frame.
        '''
        # Init.
        WindowBase.__init__(self, window_type)
        self.shadow_radius = shadow_radius
        self.enable_resize = enable_resize
        self.shadow_visible = shadow_visible
        self.shape_frame_function = shape_frame_function
        self.expose_frame_function = expose_frame_function
        self.expose_background_function = expose_background_function
        self.expose_shadow_function = expose_shadow_function
        self.set_colormap(gtk.gdk.Screen().get_rgba_colormap())
        self.background_color = (0, 0, 0, 0)
        self.frame_radius = frame_radius

        self.init()
Example #4
0
    def __init__(self, 
                 enable_resize=False, 
                 shadow_radius=6, 
                 window_type=gtk.WINDOW_TOPLEVEL):
        """
        Initialise the Window class.

        @param enable_resize: If True, the window will be set resizable. By default, it's False.
        @param shadow_radius: The radius of the shadow.
        @param window_type: A flag of type gtk._gtk.WindowType, which indicates the type of the window. By default, it's gtk.WINDOW_TOPLEVEL.
        """
        # Init.
        WindowBase.__init__(self, window_type)
        self.shadow_radius = shadow_radius
        self.enable_resize = enable_resize
        self.background_color = (0, 0, 0, 0)
        # FIXME: Because mplayer don't allowed window redirect colormap to screen.
        # We build shadow window to emulate it, but shadow's visual effect 
        # is not good enough, so we disable shadow temporary for future fixed.
        self.shadow_visible = False
        if enable_shadow(self) and self.shadow_visible:    
            self.window_shadow.set_colormap(gtk.gdk.Screen().get_rgba_colormap())
        
        self.init()