aboutsummaryrefslogtreecommitdiff
path: root/src/fluxbox.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/fluxbox.cc')
-rw-r--r--src/fluxbox.cc48
1 files changed, 25 insertions, 23 deletions
diff --git a/src/fluxbox.cc b/src/fluxbox.cc
index f9c3b6d..60faf2a 100644
--- a/src/fluxbox.cc
+++ b/src/fluxbox.cc
@@ -32,16 +32,6 @@
32# include "../config.h" 32# include "../config.h"
33#endif // HAVE_CONFIG_H 33#endif // HAVE_CONFIG_H
34 34
35#include <X11/Xlib.h>
36#include <X11/Xutil.h>
37#include <X11/Xresource.h>
38#include <X11/Xatom.h>
39#include <X11/keysym.h>
40
41#ifdef SHAPE
42#include <X11/extensions/shape.h>
43#endif // SHAPE
44
45#include "i18n.hh" 35#include "i18n.hh"
46#include "fluxbox.hh" 36#include "fluxbox.hh"
47#include "Basemenu.hh" 37#include "Basemenu.hh"
@@ -57,6 +47,18 @@
57#include "Window.hh" 47#include "Window.hh"
58#include "Workspace.hh" 48#include "Workspace.hh"
59#include "Workspacemenu.hh" 49#include "Workspacemenu.hh"
50#include "StringUtil.hh"
51
52#include <X11/Xlib.h>
53#include <X11/Xutil.h>
54#include <X11/Xresource.h>
55#include <X11/Xatom.h>
56#include <X11/keysym.h>
57
58#ifdef SHAPE
59#include <X11/extensions/shape.h>
60#endif // SHAPE
61
60 62
61#ifdef HAVE_STDIO_H 63#ifdef HAVE_STDIO_H
62# include <stdio.h> 64# include <stdio.h>
@@ -1699,7 +1701,7 @@ char *Fluxbox::getRcFilename() {
1699 snprintf(dbfile, dbfile_size, "%s/.%s/%s", homedir, RC_PATH, RC_INIT_FILE); 1701 snprintf(dbfile, dbfile_size, "%s/.%s/%s", homedir, RC_PATH, RC_INIT_FILE);
1700 1702
1701 } else 1703 } else
1702 dbfile = Misc::strdup(rc_file); 1704 dbfile = StringUtil::strdup(rc_file);
1703 1705
1704 return dbfile; 1706 return dbfile;
1705} 1707}
@@ -1731,9 +1733,9 @@ void Fluxbox::load_rc(void) {
1731 if (XrmGetResource(database, "session.menuFile", "Session.MenuFile", 1733 if (XrmGetResource(database, "session.menuFile", "Session.MenuFile",
1732 &value_type, &value)) { 1734 &value_type, &value)) {
1733 1735
1734 resource.menu_file = Misc::expandFilename(value.addr); // expand ~ to $HOME 1736 resource.menu_file = StringUtil::expandFilename(value.addr); // expand ~ to $HOME
1735 } else 1737 } else
1736 resource.menu_file = Misc::strdup(DEFAULTMENU); 1738 resource.menu_file = StringUtil::strdup(DEFAULTMENU);
1737 1739
1738 if (resource.titlebar_file) { 1740 if (resource.titlebar_file) {
1739 delete resource.titlebar_file; 1741 delete resource.titlebar_file;
@@ -1743,9 +1745,9 @@ void Fluxbox::load_rc(void) {
1743 //get titlebar filename 1745 //get titlebar filename
1744 if (XrmGetResource(database, "session.titlebarFile", "Session.TitlebarFile", 1746 if (XrmGetResource(database, "session.titlebarFile", "Session.TitlebarFile",
1745 &value_type, &value)) { 1747 &value_type, &value)) {
1746 resource.titlebar_file = Misc::expandFilename(value.addr); //expand ~ to home 1748 resource.titlebar_file = StringUtil::expandFilename(value.addr); //expand ~ to home
1747 } else 1749 } else
1748 resource.titlebar_file = Misc::strdup(DEFAULTTITLEBAR); 1750 resource.titlebar_file = StringUtil::strdup(DEFAULTTITLEBAR);
1749 1751
1750 //if already allocated memory for keys_file destroy it 1752 //if already allocated memory for keys_file destroy it
1751 if (resource.keys_file) { 1753 if (resource.keys_file) {
@@ -1756,9 +1758,9 @@ void Fluxbox::load_rc(void) {
1756 //get keys filename 1758 //get keys filename
1757 if (XrmGetResource(database, "session.keyFile", "Session.keyFile", 1759 if (XrmGetResource(database, "session.keyFile", "Session.keyFile",
1758 &value_type, &value)) { 1760 &value_type, &value)) {
1759 resource.keys_file = Misc::expandFilename(value.addr); //expand ~ to home 1761 resource.keys_file = StringUtil::expandFilename(value.addr); //expand ~ to home
1760 } else 1762 } else
1761 resource.keys_file = Misc::strdup(DEFAULTKEYSFILE); 1763 resource.keys_file = StringUtil::strdup(DEFAULTKEYSFILE);
1762 1764
1763 1765
1764 if (XrmGetResource(database, "session.iconbar", "Session.Iconbar", 1766 if (XrmGetResource(database, "session.iconbar", "Session.Iconbar",
@@ -1797,9 +1799,9 @@ void Fluxbox::load_rc(void) {
1797 1799
1798 if (XrmGetResource(database, "session.styleFile", "Session.StyleFile", 1800 if (XrmGetResource(database, "session.styleFile", "Session.StyleFile",
1799 &value_type, &value)) 1801 &value_type, &value))
1800 resource.style_file = Misc::expandFilename(value.addr); 1802 resource.style_file = StringUtil::expandFilename(value.addr);
1801 else 1803 else
1802 resource.style_file = Misc::strdup(DEFAULTSTYLE); 1804 resource.style_file = StringUtil::strdup(DEFAULTSTYLE);
1803 1805
1804 if (resource.root_cmd) { 1806 if (resource.root_cmd) {
1805 delete [] resource.root_cmd; 1807 delete [] resource.root_cmd;
@@ -1807,7 +1809,7 @@ void Fluxbox::load_rc(void) {
1807 } 1809 }
1808 1810
1809 if (XrmGetResource(database, "session.rootCommand", "Session.RootCommand", &value_type, &value)) 1811 if (XrmGetResource(database, "session.rootCommand", "Session.RootCommand", &value_type, &value))
1810 resource.root_cmd = Misc::expandFilename(value.addr); 1812 resource.root_cmd = StringUtil::expandFilename(value.addr);
1811 else 1813 else
1812 resource.root_cmd = 0; 1814 resource.root_cmd = 0;
1813 1815
@@ -2058,7 +2060,7 @@ void Fluxbox::load_rc(BScreen *screen) {
2058 sprintf(class_lookup, "Session.Screen%d.WorkspaceNames", screen_number); 2060 sprintf(class_lookup, "Session.Screen%d.WorkspaceNames", screen_number);
2059 if (XrmGetResource(database, name_lookup, class_lookup, &value_type, 2061 if (XrmGetResource(database, name_lookup, class_lookup, &value_type,
2060 &value)) { 2062 &value)) {
2061 char *search = Misc::strdup(value.addr); 2063 char *search = StringUtil::strdup(value.addr);
2062 2064
2063 int i; 2065 int i;
2064 for (i = 0; i < screen->getNumberOfWorkspaces(); i++) { 2066 for (i = 0; i < screen->getNumberOfWorkspaces(); i++) {
@@ -2504,7 +2506,7 @@ void Fluxbox::saveStyleFilename(const char *filename) {
2504 if (resource.style_file) 2506 if (resource.style_file)
2505 delete [] resource.style_file; 2507 delete [] resource.style_file;
2506 2508
2507 resource.style_file = Misc::strdup(filename); 2509 resource.style_file = StringUtil::strdup(filename);
2508} 2510}
2509 2511
2510 2512
@@ -2521,7 +2523,7 @@ void Fluxbox::saveMenuFilename(const char *filename) {
2521 if (! stat(filename, &buf)) { 2523 if (! stat(filename, &buf)) {
2522 MenuTimestamp *ts = new MenuTimestamp; 2524 MenuTimestamp *ts = new MenuTimestamp;
2523 2525
2524 ts->filename = Misc::strdup(filename); 2526 ts->filename = StringUtil::strdup(filename);
2525 ts->timestamp = buf.st_ctime; 2527 ts->timestamp = buf.st_ctime;
2526 2528
2527 menuTimestamps->insert(ts); 2529 menuTimestamps->insert(ts);