Manager.h

Index

      
      #ifndef _MANAGER_H_
      #define _MANAGER_H_
      
      #include "General.h"
      #include "listmacro.h"
      
      class Client ;
      declarePList(ClientList, Client);
  10  
      
      class WindowManager  {
      public:
          WindowManager(int argc, char **argv);
          ~WindowManager();
      
          void fatal(const char *);
      
          // for call from Client and within:
  20  
          Client *windowToClient(Window, Boolean create = False);
          Client *activeClient() { return m_activeClient; }
          Boolean raiseTransients(Client *); // true if raised any
          Time timestamp(Boolean reset);
          void clearFocus();
      
          void setActiveClient(Client *const c) { m_activeClient = c; }
      
          void addToHiddenList(Client *);
  30      void removeFromHiddenList(Client *);
          void skipInRevert(Client *, Client *);
      
          Display *display() { return m_display; }
          Window root() { return m_root; }
          int screen() { return m_screenNumber; }
      
          enum RootCursor  {
              NormalCursor, DeleteCursor, DownCursor, RightCursor, DownrightCursor
          };
  40  
      #ifdef CONFIG_USE_WINDOW_GROUPS
          void withdrawGroup(Window groupParent, Client *omit,
                             Boolean changeState = True);
          void hideGroup(Window groupParent, Client *omit);
          void unhideGroup(Window groupParent, Client *omit, Boolean map);
          void killGroup(Window groupParent, Client *omit);
      #endif
      
          void installCursor(RootCursor);
  50      void installCursorOnWindow(RootCursor, Window);
          void installColormap(Colormap);
          unsigned long allocateColour(char *, char *);
      
          void considerFocusChange(Client *, Window, Time timestamp);
          void stopConsideringFocus();
      
          // shouldn't really be public
          int attemptGrab(Window, Window, int, int);
          int attemptGrabKey(Window, int);
  60      void releaseGrab(XButtonEvent *);
          void releaseGrabKeyMode(XButtonEvent *);
          void releaseGrabKeyMode(XKeyEvent *);
          void spawn(char *, char *);
      
          int channel() { return m_currentChannel; }
          void setSignalled() { m_looping = False; } // ...
      
          ClientList &clients() { return m_clients; }
          ClientList &hiddenClients() { return m_hiddenClients; }
  70  
          void hoistToTop(Client *);
          void hoistToBottom(Client *);
          void removeFromOrderedList(Client *);
          Boolean isTop(Client *);
      
          // for exposures during client grab, and window map/unmap/destroy
          // during menu display:
          void dispatchEvent(XEvent *);
      
  80  private:
          int loop();
          void release();
      
          Display *m_display;
          int m_screenNumber;
      
          Window m_root;
      
          Colormap m_defaultColormap;
  90      int m_minimumColormaps;
      
          Cursor m_cursor;
          Cursor m_xCursor;
          Cursor m_vCursor;
          Cursor m_hCursor;
          Cursor m_vhCursor;
          
          char *m_terminal;
          char *m_shell;
 100  
          ClientList m_clients;
          ClientList m_hiddenClients;
          ClientList m_orderedClients;
          Client *m_activeClient;
      
          int m_shapeEvent;
          int m_currentTime;
      
          int m_channels;
 110      int m_currentChannel;       // from 1 to ...
          void flipChannel(Boolean statusOnly, Boolean flipDown,
                           Boolean quickFlip, Client *push); // bleah!
          void instateChannel();
          void createNewChannel();
          void checkChannel(int);
          Time m_channelChangeTime;
          Window m_channelWindow;
      
          Boolean m_looping;
 120      int m_returnCode;
      
          static Boolean m_initialising;
          static int errorHandler(Display *, XErrorEvent *);
          static void sigHandler();
          static int m_signalled;
      
          void initialiseScreen();
          void scanInitialWindows();
      
 130      void circulate(Boolean activeFirst);
      
          Boolean m_focusChanging;    // checking times for focus change
          Client *m_focusCandidate;
          Window  m_focusCandidateWindow;
          Time    m_focusTimestamp;   // time of last crossing event
          Boolean m_focusPointerMoved;
          Boolean m_focusPointerNowStill;
          void checkDelaysForFocus();
      
 140  #ifdef CONFIG_USE_SESSION_MANAGER
          int m_smFD;
          IceConn m_smIceConnection;
          SmcConn m_smConnection;
          char *m_oldSessionId;
          char *m_newSessionId;
          char *m_sessionProgram;
      
          static void smWatchFD(IceConn c, IcePointer, Bool, IcePointer *);
          static void smSaveYourself(SmcConn, SmPointer, int, Bool, int, Bool);
 150      static void smSaveYourself2(SmcConn, SmPointer);
          static void smShutdownCancelled(SmcConn, SmPointer);
          static void smSaveComplete(SmcConn, SmPointer);
          static void smDie(SmcConn, SmPointer);
      
          void initialiseSession(char *sessionProgram, char *oldSessionId);
          void setSessionProperties();
      #endif
      
          void nextEvent(XEvent *);   // return
 160  
          void eventButton(XButtonEvent *);
          void eventKeyRelease(XKeyEvent *);
          void eventMapRequest(XMapRequestEvent *);
          void eventConfigureRequest(XConfigureRequestEvent *);
          void eventUnmap(XUnmapEvent *);
          void eventCreate(XCreateWindowEvent *);
          void eventDestroy(XDestroyWindowEvent *);
          void eventClient(XClientMessageEvent *);
          void eventColormap(XColormapEvent *);
 170      void eventProperty(XPropertyEvent *);
          void eventEnter(XCrossingEvent *);
          void eventReparent(XReparentEvent *);
          void eventFocusIn(XFocusInEvent *);
          void eventExposure(XExposeEvent *);
      
          Boolean m_altPressed;
          void eventKeyPress(XKeyEvent *);
      };
      
 180  #endif
      
      

Index

  • Client Class declaration
  • WindowManager Class declaration
  • WindowManager (constructor)
  • WindowManager (destructor)
  • fatal (prototype) returns void
  • activeClient (function) returns Client *
  • raiseTransients (prototype) returns Boolean
  • timestamp (prototype) returns Time
  • clearFocus (prototype) returns void
  • setActiveClient (function) returns void
  • addToHiddenList (prototype) returns void
  • removeFromHiddenList (prototype) returns void
  • skipInRevert (prototype) returns void
  • display (function) returns Display *
  • root (function) returns Window
  • screen (function) returns int
  • RootCursor (Enumeration)
  • withdrawGroup (prototype) returns void
  • hideGroup (prototype) returns void
  • unhideGroup (prototype) returns void
  • killGroup (prototype) returns void
  • installCursor (prototype) returns void
  • installCursorOnWindow (prototype) returns void
  • installColormap (prototype) returns void
  • considerFocusChange (prototype) returns void
  • stopConsideringFocus (prototype) returns void
  • attemptGrabKey (prototype) returns int
  • releaseGrab (prototype) returns void
  • releaseGrabKeyMode (prototype) returns void
  • releaseGrabKeyMode (prototype) returns void
  • spawn (prototype) returns void
  • channel (function) returns int
  • setSignalled (function) returns void
  • hoistToTop (prototype) returns void
  • hoistToBottom (prototype) returns void
  • removeFromOrderedList (prototype) returns void
  • isTop (prototype) returns Boolean
  • loop (prototype) returns int
  • release (prototype) returns void
  • flipChannel (prototype) returns void
  • instateChannel (prototype) returns void
  • createNewChannel (prototype) returns void
  • checkChannel (prototype) returns void
  • errorHandler (prototype) returns static int
  • sigHandler (prototype) returns static void
  • initialiseScreen (prototype) returns void
  • scanInitialWindows (prototype) returns void
  • circulate (prototype) returns void
  • checkDelaysForFocus (prototype) returns void
  • smWatchFD (prototype) returns static void
  • smSaveYourself (prototype) returns static void
  • smSaveYourself2 (prototype) returns static void
  • smShutdownCancelled (prototype) returns static void
  • smSaveComplete (prototype) returns static void
  • smDie (prototype) returns static void
  • initialiseSession (prototype) returns void
  • setSessionProperties (prototype) returns void
  • nextEvent (prototype) returns void
  • eventButton (prototype) returns void
  • eventKeyRelease (prototype) returns void
  • eventMapRequest (prototype) returns void
  • eventConfigureRequest (prototype) returns void
  • eventUnmap (prototype) returns void
  • eventCreate (prototype) returns void
  • eventDestroy (prototype) returns void
  • eventClient (prototype) returns void
  • eventColormap (prototype) returns void
  • eventProperty (prototype) returns void
  • eventEnter (prototype) returns void
  • eventReparent (prototype) returns void
  • eventFocusIn (prototype) returns void
  • eventExposure (prototype) returns void
  • eventKeyPress (prototype) returns void