Package xtwm.plugins

Class ScreensaverPlugin

    • Field Detail

      • unlocked

        protected boolean unlocked
        If true, the user entered the password, or there is no password.
      • passwordPanel

        protected TPanel passwordPanel
        The password panel.
      • passwordField

        protected TField passwordField
        The password field.
    • Constructor Detail

      • ScreensaverPlugin

        protected ScreensaverPlugin​(TWidget parent)
        Constructor for subclasses.
        Parameters:
        parent - parent widget
    • Method Detail

      • onKeypress

        public void onKeypress​(TKeypressEvent keypress)
        Handle keystrokes.
        Overrides:
        onKeypress in class TWidget
        Parameters:
        keypress - keystroke event
      • isLoadOnStartup

        public final boolean isLoadOnStartup()
        See if this plugin will load on startup.
        Overrides:
        isLoadOnStartup in class PluginWidget
        Returns:
        true if this plugin will load on startup
      • setLoadOnStartup

        public final void setLoadOnStartup​(boolean loadOnStartup)
        Set plugin load on startup.
        Overrides:
        setLoadOnStartup in class PluginWidget
        Parameters:
        loadOnStartup - if true, this plugin will load on startup
      • isOnAllDesktops

        public final boolean isOnAllDesktops()
        Whether or not this plugin should be on all desktops when loaded as a widget at startup.
        Overrides:
        isOnAllDesktops in class PluginWidget
        Returns:
        true if this plugin should be on all desktops
      • getPreferredWidth

        public int getPreferredWidth()
        Get the desired width when rendering this plugin.
        Specified by:
        getPreferredWidth in class PluginWidget
        Returns:
        the width
      • getPreferredHeight

        public int getPreferredHeight()
        Get the desired height when rendering this plugin.
        Specified by:
        getPreferredHeight in class PluginWidget
        Returns:
        the height
      • isResizable

        public boolean isResizable()
        Check if widget should be in a resizable window.
        Overrides:
        isResizable in class PluginWidget
        Returns:
        true if the widget should be resizable when in a window
      • getWindow

        public TWindow getWindow​(XTWMApplication application)
        Get the window that will be used for this plugin when isWindowed() is true. The plugin will be reparented inside this window.
        Overrides:
        getWindow in class PluginWidget
        Parameters:
        application - the application
        Returns:
        the window
      • startScreensaver

        public abstract void startScreensaver​(Screen screen)
        This method is called when the screensaver is activated.
        Parameters:
        screen - a snapshot of the screen "under" the screensaver.
      • endScreensaver

        public abstract void endScreensaver()
        This method is called when the screensaver ends.
      • checkPassword

        public void checkPassword()
        Called to flag the screensaver to ask for a password.
      • isUnlocked

        public boolean isUnlocked()
        Called to see if the password was entered OK.
        Returns:
        true if the user entered the password successfully