X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=src%2FScreen.h;h=24baba1f1dd8d963f09a8ed860500b3c15508d0b;hb=ae093dba2fb97124bb4af3eaf4070b46f07dfd74;hp=3d03f53cecc2eb32c68cb708f3594dddaa0be68f;hpb=66c879bd5c0c9f668096f620007388ef347becd0;p=chaz%2Fopenbox diff --git a/src/Screen.h b/src/Screen.h index 3d03f53c..24baba1f 100644 --- a/src/Screen.h +++ b/src/Screen.h @@ -40,7 +40,6 @@ #include "BaseDisplay.h" #include "Configmenu.h" #include "Iconmenu.h" -#include "LinkedList.h" #include "Netizen.h" #include "Rootmenu.h" #include "Timer.h" @@ -52,6 +51,10 @@ #endif // SLIT #include "Image.h" #include "Resource.h" +#include "Util.h" + +#include +#include // forward declaration class BScreen; @@ -109,9 +112,12 @@ private: Iconmenu *iconmenu; Rootmenu *rootmenu; - LinkedList *rootmenuList; - LinkedList *netizenList; - LinkedList *iconList; + typedef std::list menuList; + menuList rootmenuList; + typedef std::list netList; + netList netizenList; + typedef std::list winList; + winList iconList; // winList is declared in Workspace.h #ifdef SLIT Slit *slit; @@ -124,31 +130,31 @@ private: unsigned int geom_w, geom_h; unsigned long event_mask; - LinkedList *workspaceNames; - LinkedList *workspacesList; + typedef std::vector wkspNameList; + wkspNameList workspaceNames; + typedef std::vector wkspList; + wkspList workspacesList; struct resource { WindowStyle wstyle; ToolbarStyle tstyle; MenuStyle mstyle; - Bool sloppy_focus, auto_raise, - auto_edge_balance, image_dither, ordered_dither, opaque_move, full_max, - focus_new, focus_last; - bool hide_toolbar; + bool sloppy_focus, auto_raise, auto_edge_balance, focus_last, + ordered_dither, opaque_move, hide_toolbar, full_max, focus_new; BColor border_color; Resource styleconfig; - int workspaces, toolbar_placement, toolbar_width_percent, placement_policy, - edge_snap_threshold, row_direction, col_direction; + int workspaces, placement_policy, edge_snap_threshold, row_direction, + col_direction; unsigned int handle_width, bevel_width, frame_width, border_width; - unsigned int zones; // number of zones to be used when alt-resizing a window + int zones; // number of zones to be used when alt-resizing a window #ifdef HAVE_STRFTIME char *strftime_format; #else // !HAVE_STRFTIME - Bool clock24hour; + bool clock24hour; int date_format; #endif // HAVE_STRFTIME @@ -175,21 +181,7 @@ public: BScreen(Openbox &, int, Resource &); ~BScreen(); - inline const Bool &isSloppyFocus() const - { return resource.sloppy_focus; } - inline const Bool &isRootColormapInstalled() const - { return root_colormap_installed; } - inline const Bool &doAutoRaise() const { return resource.auto_raise; } inline const Bool &isScreenManaged() const { return managed; } - inline const Bool &doImageDither() const - { return resource.image_dither; } - inline const Bool &doOrderedDither() const - { return resource.ordered_dither; } - inline const Bool &doOpaqueMove() const { return resource.opaque_move; } - inline const Bool &doFullMax() const { return resource.full_max; } - inline const Bool &doFocusNew() const { return resource.focus_new; } - inline const Bool &doFocusLast() const { return resource.focus_last; } - inline const GC &getOpGC() const { return opGC; } inline Openbox &getOpenbox() { return openbox; } @@ -201,16 +193,19 @@ public: inline Slit *getSlit() { return slit; } #endif // SLIT - inline int getWindowZones() const - { return resource.zones; } - inline void saveWindowZones(int z) { resource.zones = z; } - inline Toolbar *getToolbar() { return toolbar; } - inline Workspace *getWorkspace(int w) { return workspacesList->find(w); } + Rect availableArea() const; + + inline Workspace *getWorkspace(unsigned int w) { + ASSERT(w < workspacesList.size()); + return workspacesList[w]; + } inline Workspace *getCurrentWorkspace() { return current_workspace; } inline Workspacemenu *getWorkspacemenu() { return workspacemenu; } + + inline void iconUpdate() { iconmenu->update(); } inline const unsigned int &getHandleWidth() const { return resource.handle_width; } @@ -223,53 +218,65 @@ public: inline const int getCurrentWorkspaceID() { return current_workspace->getWorkspaceID(); } - inline const int getWorkspaceCount() { return workspacesList->count(); } - inline const int getIconCount() { return iconList->count(); } - inline const int &getNumberOfWorkspaces() const - { return resource.workspaces; } - inline const int &getPlacementPolicy() const - { return resource.placement_policy; } - inline const int &getEdgeSnapThreshold() const - { return resource.edge_snap_threshold; } - inline const int &getRowPlacementDirection() const - { return resource.row_direction; } - inline const int &getColPlacementDirection() const - { return resource.col_direction; } - - inline void saveRootCommand(const char *cmd) { - if (resource.root_command != NULL) - delete [] resource.root_command; - if (cmd != NULL) - resource.root_command = bstrdup(cmd); - else - resource.root_command = NULL; - } - inline const char *getRootCommand() const - { return resource.root_command; } - + inline const int getWorkspaceCount() { return workspacesList.size(); } + inline const int getIconCount() { return iconList.size(); } + + inline const Bool &isRootColormapInstalled() const + { return root_colormap_installed; } inline void setRootColormapInstalled(Bool r) { root_colormap_installed = r; } - inline void saveSloppyFocus(Bool s) { resource.sloppy_focus = s; } - inline void saveAutoRaise(Bool a) { resource.auto_raise = a; } - inline void saveWorkspaces(int w) { resource.workspaces = w; } - inline void savePlacementPolicy(int p) { resource.placement_policy = p; } - inline void saveRowPlacementDirection(int d) { resource.row_direction = d; } - inline void saveColPlacementDirection(int d) { resource.col_direction = d; } - inline void saveEdgeSnapThreshold(int t) - { resource.edge_snap_threshold = t; } - inline void saveImageDither(Bool d) { resource.image_dither = d; } - inline void saveOpaqueMove(Bool o) { resource.opaque_move = o; } - inline void saveFullMax(Bool f) { resource.full_max = f; } - inline void saveFocusNew(Bool f) { resource.focus_new = f; } - inline void saveFocusLast(Bool f) { resource.focus_last = f; } - inline void iconUpdate() { iconmenu->update(); } + + inline bool sloppyFocus() const { return resource.sloppy_focus; } + void setSloppyFocus(bool s); + + inline bool autoRaise() const { return resource.auto_raise; } + void setAutoRaise(bool a); + + inline bool imageDither() const { return image_control->doDither(); } + void setImageDither(bool d, bool reconfig = true); + + inline bool orderedDither() const { return resource.ordered_dither; } + + inline bool opaqueMove() const { return resource.opaque_move; } + void setOpaqueMove(bool o); + + inline bool fullMax() const { return resource.full_max; } + void setFullMax(bool f); + + inline bool focusNew() const { return resource.focus_new; } + void setFocusNew(bool f); + + inline bool focusLast() const { return resource.focus_last; } + void setFocusLast(bool f); + + inline int getWindowZones() const { return resource.zones; } + void setWindowZones(int z); + + inline int workspaceCount() const { return resource.workspaces; } + void setWorkspaceCount(int w); + + inline int placementPolicy() const { return resource.placement_policy; } + void setPlacementPolicy(int p); + + inline int edgeSnapThreshold() const { return resource.edge_snap_threshold; } + void setEdgeSnapThreshold(int t); + + inline int rowPlacementDirection() const { return resource.row_direction; } + void setRowPlacementDirection(int d); + + inline int colPlacementDirection() const { return resource.col_direction; } + void setColPlacementDirection(int d); + + inline char *rootCommand() const { return resource.root_command; } + inline void setRootCommand(const char *cmd); + #ifdef HAVE_STRFTIME - inline char *getStrftimeFormat() { return resource.strftime_format; } - void saveStrftimeFormat(const char *); + inline char *strftimeFormat() { return resource.strftime_format; } + void setStrftimeFormat(const char *); #else // !HAVE_STRFTIME - inline int getDateFormat() { return resource.date_format; } - inline void saveDateFormat(int f) { resource.date_format = f; } - inline Bool isClock24Hour() { return resource.clock24hour; } - inline void saveClock24Hour(Bool c) { resource.clock24hour = c; } + inline int dateFormat() { return resource.date_format; } + void setDateFormat(int f); + inline bool clock24Hour() { return resource.clock24hour; } + void setClock24Hour(Bool c); #endif // HAVE_STRFTIME inline bool hideToolbar() const { return resource.hide_toolbar; } @@ -286,11 +293,12 @@ public: void removeWorkspaceNames(); void addWorkspaceName(const char *); + void saveWorkspaceNames(); void addNetizen(Netizen *); void removeNetizen(Window); void addIcon(OpenboxWindow *); void removeIcon(OpenboxWindow *); - char* getNameOfWorkspace(int); + const char *getNameOfWorkspace(int); void changeWorkspaceID(int); void raiseWindows(Window *, int); void reassociateWindow(OpenboxWindow *, int, Bool); @@ -299,6 +307,7 @@ public: void raiseFocus(); void reconfigure(); void load(); + void save(); void rereadMenu(); void shutdown(); void showPosition(int, int); @@ -314,7 +323,8 @@ public: void updateNetizenWindowLower(Window); enum { RowSmartPlacement = 1, ColSmartPlacement, CascadePlacement, - BestFitPlacement, LeftRight, RightLeft, TopBottom, BottomTop }; + BestFitPlacement, UnderMousePlacement, ClickMousePlacement, + LeftRight, RightLeft, TopBottom, BottomTop }; enum { LeftJustify = 1, RightJustify, CenterJustify }; enum { RoundBullet = 1, TriangleBullet, SquareBullet, NoBullet }; enum { Restart = 1, RestartOther, Exit, Shutdown, Execute, Reconfigure,