diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Screen.cc | 19 | ||||
-rw-r--r-- | src/Screen.hh | 40 |
2 files changed, 24 insertions, 35 deletions
diff --git a/src/Screen.cc b/src/Screen.cc index 96165af..6c9cc60 100644 --- a/src/Screen.cc +++ b/src/Screen.cc | |||
@@ -22,7 +22,7 @@ | |||
22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
23 | // DEALINGS IN THE SOFTWARE. | 23 | // DEALINGS IN THE SOFTWARE. |
24 | 24 | ||
25 | // $Id: Screen.cc,v 1.50 2002/05/08 14:24:57 fluxgen Exp $ | 25 | // $Id: Screen.cc,v 1.51 2002/05/17 11:02:30 fluxgen Exp $ |
26 | 26 | ||
27 | //use GNU extensions | 27 | //use GNU extensions |
28 | #ifndef _GNU_SOURCE | 28 | #ifndef _GNU_SOURCE |
@@ -258,10 +258,6 @@ resource(rm, screenname, altscreenname) | |||
258 | 258 | ||
259 | rootmenu = 0; | 259 | rootmenu = 0; |
260 | 260 | ||
261 | #ifdef HAVE_STRFTIME | ||
262 | resource.strftime_format = 0; | ||
263 | #endif // HAVE_STRFTIME | ||
264 | |||
265 | #ifdef HAVE_GETPID | 261 | #ifdef HAVE_GETPID |
266 | pid_t bpid = getpid(); | 262 | pid_t bpid = getpid(); |
267 | 263 | ||
@@ -513,11 +509,6 @@ BScreen::~BScreen(void) { | |||
513 | netizenList.end(), | 509 | netizenList.end(), |
514 | delete_obj<Netizen>); | 510 | delete_obj<Netizen>); |
515 | 511 | ||
516 | #ifdef HAVE_STRFTIME | ||
517 | if (resource.strftime_format) | ||
518 | delete [] resource.strftime_format; | ||
519 | #endif // HAVE_STRFTIME | ||
520 | |||
521 | delete rootmenu; | 512 | delete rootmenu; |
522 | delete workspacemenu; | 513 | delete workspacemenu; |
523 | delete iconmenu; | 514 | delete iconmenu; |
@@ -1055,11 +1046,9 @@ void BScreen::raiseWindows(Window *workspace_stack, int num) { | |||
1055 | } | 1046 | } |
1056 | 1047 | ||
1057 | #ifdef HAVE_STRFTIME | 1048 | #ifdef HAVE_STRFTIME |
1058 | void BScreen::saveStrftimeFormat(char *format) { | 1049 | void BScreen::saveStrftimeFormat(const char *format) { |
1059 | if (resource.strftime_format) | 1050 | //make sure std::string don't get 0 string |
1060 | delete [] resource.strftime_format; | 1051 | resource.strftime_format = (format ? format : ""); |
1061 | |||
1062 | resource.strftime_format = StringUtil::strdup(format); | ||
1063 | } | 1052 | } |
1064 | #endif // HAVE_STRFTIME | 1053 | #endif // HAVE_STRFTIME |
1065 | 1054 | ||
diff --git a/src/Screen.hh b/src/Screen.hh index 55d8c8b..a402c87 100644 --- a/src/Screen.hh +++ b/src/Screen.hh | |||
@@ -22,7 +22,7 @@ | |||
22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
23 | // DEALINGS IN THE SOFTWARE. | 23 | // DEALINGS IN THE SOFTWARE. |
24 | 24 | ||
25 | // $Id: Screen.hh,v 1.33 2002/05/08 14:25:40 fluxgen Exp $ | 25 | // $Id: Screen.hh,v 1.34 2002/05/17 11:02:30 fluxgen Exp $ |
26 | 26 | ||
27 | #ifndef SCREEN_HH | 27 | #ifndef SCREEN_HH |
28 | #define SCREEN_HH | 28 | #define SCREEN_HH |
@@ -95,17 +95,17 @@ public: | |||
95 | inline Rootmenu *getRootmenu(void) { return rootmenu; } | 95 | inline Rootmenu *getRootmenu(void) { return rootmenu; } |
96 | inline std::string &getRootCommand(void) { return *resource.rootcommand; } | 96 | inline std::string &getRootCommand(void) { return *resource.rootcommand; } |
97 | #ifdef SLIT | 97 | #ifdef SLIT |
98 | inline const bool isSlitOnTop(void) const { return resource.slit_on_top; } | 98 | inline bool isSlitOnTop(void) const { return resource.slit_on_top; } |
99 | inline const bool doSlitAutoHide(void) const { return resource.slit_auto_hide; } | 99 | inline bool doSlitAutoHide(void) const { return resource.slit_auto_hide; } |
100 | inline Slit *getSlit(void) { return slit; } | 100 | inline Slit *getSlit(void) { return slit; } |
101 | inline const int getSlitPlacement(void) const { return resource.slit_placement; } | 101 | inline int getSlitPlacement(void) const { return resource.slit_placement; } |
102 | inline const int getSlitDirection(void) const { return resource.slit_direction; } | 102 | inline int getSlitDirection(void) const { return resource.slit_direction; } |
103 | inline void saveSlitPlacement(int p) { resource.slit_placement = p; } | 103 | inline void saveSlitPlacement(int p) { resource.slit_placement = p; } |
104 | inline void saveSlitDirection(int d) { resource.slit_direction = d; } | 104 | inline void saveSlitDirection(int d) { resource.slit_direction = d; } |
105 | inline void saveSlitOnTop(bool t) { resource.slit_on_top = t; } | 105 | inline void saveSlitOnTop(bool t) { resource.slit_on_top = t; } |
106 | inline void saveSlitAutoHide(bool t) { resource.slit_auto_hide = t; } | 106 | inline void saveSlitAutoHide(bool t) { resource.slit_auto_hide = t; } |
107 | #ifdef XINERAMA | 107 | #ifdef XINERAMA |
108 | inline const unsigned int getSlitOnHead(void) const { return resource.slit_on_head; } | 108 | inline unsigned int getSlitOnHead(void) const { return resource.slit_on_head; } |
109 | inline void saveSlitOnHead(unsigned int h) { resource.slit_on_head = h; } | 109 | inline void saveSlitOnHead(unsigned int h) { resource.slit_on_head = h; } |
110 | #endif // XINERAMA | 110 | #endif // XINERAMA |
111 | 111 | ||
@@ -118,22 +118,22 @@ public: | |||
118 | 118 | ||
119 | inline Workspacemenu *getWorkspacemenu(void) { return workspacemenu; } | 119 | inline Workspacemenu *getWorkspacemenu(void) { return workspacemenu; } |
120 | 120 | ||
121 | inline const unsigned int getHandleWidth(void) const { return theme->getHandleWidth(); } | 121 | inline unsigned int getHandleWidth(void) const { return theme->getHandleWidth(); } |
122 | inline const unsigned int getBevelWidth(void) const { return theme->getBevelWidth(); } | 122 | inline unsigned int getBevelWidth(void) const { return theme->getBevelWidth(); } |
123 | inline const unsigned int getFrameWidth(void) const { return theme->getFrameWidth(); } | 123 | inline unsigned int getFrameWidth(void) const { return theme->getFrameWidth(); } |
124 | inline const unsigned int getBorderWidth(void) const { return theme->getBorderWidth(); } | 124 | inline unsigned int getBorderWidth(void) const { return theme->getBorderWidth(); } |
125 | inline const unsigned int getBorderWidth2x(void) const { return theme->getBorderWidth()*2; } | 125 | inline unsigned int getBorderWidth2x(void) const { return theme->getBorderWidth()*2; } |
126 | inline const unsigned int getCurrentWorkspaceID() const { return current_workspace->workspaceID(); } | 126 | inline unsigned int getCurrentWorkspaceID() const { return current_workspace->workspaceID(); } |
127 | 127 | ||
128 | typedef std::vector<FluxboxWindow *> Icons; | 128 | typedef std::vector<FluxboxWindow *> Icons; |
129 | inline const unsigned int getCount(void) const { return workspacesList.size(); } | 129 | inline unsigned int getCount(void) const { return workspacesList.size(); } |
130 | inline const unsigned int getIconCount(void) const { return iconList.size(); } | 130 | inline unsigned int getIconCount(void) const { return iconList.size(); } |
131 | inline Icons &getIconList(void) { return iconList; } | 131 | inline Icons &getIconList(void) { return iconList; } |
132 | 132 | ||
133 | inline const int getNumberOfWorkspaces(void) { return *resource.workspaces; } | 133 | inline int getNumberOfWorkspaces(void) { return *resource.workspaces; } |
134 | inline const Toolbar::Placement getToolbarPlacement(void) { return *resource.toolbar_placement; } | 134 | inline const Toolbar::Placement getToolbarPlacement(void) { return *resource.toolbar_placement; } |
135 | #ifdef XINERAMA | 135 | #ifdef XINERAMA |
136 | inline const int getToolbarOnHead(void) { return *resource.toolbar_on_head; } | 136 | inline int getToolbarOnHead(void) { return *resource.toolbar_on_head; } |
137 | #endif // XINERAMA | 137 | #endif // XINERAMA |
138 | inline int getToolbarWidthPercent(void) { return *resource.toolbar_width_percent; } | 138 | inline int getToolbarWidthPercent(void) { return *resource.toolbar_width_percent; } |
139 | inline int getPlacementPolicy(void) const { return resource.placement_policy; } | 139 | inline int getPlacementPolicy(void) const { return resource.placement_policy; } |
@@ -182,12 +182,12 @@ public: | |||
182 | 182 | ||
183 | 183 | ||
184 | #ifdef HAVE_STRFTIME | 184 | #ifdef HAVE_STRFTIME |
185 | inline char *getStrftimeFormat(void) { return resource.strftime_format; } | 185 | inline const char *getStrftimeFormat(void) { return resource.strftime_format.c_str(); } |
186 | void saveStrftimeFormat(char *); | 186 | void saveStrftimeFormat(const char *format); |
187 | #else // !HAVE_STRFTIME | 187 | #else // !HAVE_STRFTIME |
188 | inline int getDateFormat(void) { return resource.date_format; } | 188 | inline int getDateFormat(void) { return resource.date_format; } |
189 | inline void saveDateFormat(int f) { resource.date_format = f; } | 189 | inline void saveDateFormat(int f) { resource.date_format = f; } |
190 | inline Bool isClock24Hour(void) { return resource.clock24hour; } | 190 | inline bool isClock24Hour(void) { return resource.clock24hour; } |
191 | inline void saveClock24Hour(Bool c) { resource.clock24hour = c; } | 191 | inline void saveClock24Hour(Bool c) { resource.clock24hour = c; } |
192 | #endif // HAVE_STRFTIME | 192 | #endif // HAVE_STRFTIME |
193 | 193 | ||
@@ -329,7 +329,7 @@ private: | |||
329 | 329 | ||
330 | 330 | ||
331 | #ifdef HAVE_STRFTIME | 331 | #ifdef HAVE_STRFTIME |
332 | char *strftime_format; | 332 | std::string strftime_format; |
333 | #else // !HAVE_STRFTIME | 333 | #else // !HAVE_STRFTIME |
334 | Bool clock24hour; | 334 | Bool clock24hour; |
335 | int date_format; | 335 | int date_format; |