summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2002-05-14 22:15:01 +0000
committerDana Jansens <danakj@orodu.net>2002-05-14 22:15:01 +0000
commitf75083669f65aadd6b32f8ed25880ca362296a2f (patch)
treee8d89e13cad90e909a254589f25322aa6099ea83 /src
parent527864614bbbadcfd5f454e7dd1781d343881e7d (diff)
new version of bsetroot ported from blackbox cvs
Diffstat (limited to 'src')
-rw-r--r--src/BaseDisplay.cc6
-rw-r--r--src/BaseDisplay.h152
-rw-r--r--src/Image.h2
-rw-r--r--src/openbox.cc4
4 files changed, 81 insertions, 83 deletions
diff --git a/src/BaseDisplay.cc b/src/BaseDisplay.cc
index 81d3c5c7..01e1b332 100644
--- a/src/BaseDisplay.cc
+++ b/src/BaseDisplay.cc
@@ -338,8 +338,8 @@ BaseDisplay::BaseDisplay(const char *app_name, char *dpy_name) {
XSetErrorHandler((XErrorHandler) handleXErrors);
screenInfoList.reserve(ScreenCount(display));
- for (int i = 0; i < number_of_screens; i++)
- screenInfoList.push_back(new ScreenInfo(*this, i));
+ for (unsigned int s = 0; s < number_of_screens; s++)
+ screenInfoList.push_back(new ScreenInfo(*this, s));
#ifndef NOCLOBBER
NumLockMask = ScrollLockMask = 0;
@@ -512,8 +512,6 @@ void BaseDisplay::grab(void) {
void BaseDisplay::ungrab(void) {
if (! --server_grabs)
XUngrabServer(display);
-
- if (server_grabs < 0) server_grabs = 0;
}
diff --git a/src/BaseDisplay.h b/src/BaseDisplay.h
index cf1a7ae6..3e092cfb 100644
--- a/src/BaseDisplay.h
+++ b/src/BaseDisplay.h
@@ -137,7 +137,7 @@ private:
TimerList timerList;
char *display_name, *application_name;
- int number_of_screens, server_grabs, colors_per_channel;
+ unsigned int number_of_screens, server_grabs, colors_per_channel;
protected:
@@ -150,128 +150,128 @@ protected:
public:
BaseDisplay(const char *, char * = 0);
- virtual ~BaseDisplay(void);
+ virtual ~BaseDisplay();
- inline const Atom &getWMChangeStateAtom(void) const
+ inline const Atom &getWMChangeStateAtom() const
{ return xa_wm_change_state; }
- inline const Atom &getWMStateAtom(void) const
+ inline const Atom &getWMStateAtom() const
{ return xa_wm_state; }
- inline const Atom &getWMDeleteAtom(void) const
+ inline const Atom &getWMDeleteAtom() const
{ return xa_wm_delete_window; }
- inline const Atom &getWMProtocolsAtom(void) const
+ inline const Atom &getWMProtocolsAtom() const
{ return xa_wm_protocols; }
- inline const Atom &getWMTakeFocusAtom(void) const
+ inline const Atom &getWMTakeFocusAtom() const
{ return xa_wm_take_focus; }
- inline const Atom &getWMColormapAtom(void) const
+ inline const Atom &getWMColormapAtom() const
{ return xa_wm_colormap_windows; }
- inline const Atom &getMotifWMHintsAtom(void) const
+ inline const Atom &getMotifWMHintsAtom() const
{ return motif_wm_hints; }
// this atom is for normal app->WM hints about decorations, stacking,
// starting workspace etc...
- inline const Atom &getOpenboxHintsAtom(void) const
+ inline const Atom &getOpenboxHintsAtom() const
{ return openbox_hints;}
// these atoms are for normal app->WM interaction beyond the scope of the
// ICCCM...
- inline const Atom &getOpenboxAttributesAtom(void) const
+ inline const Atom &getOpenboxAttributesAtom() const
{ return openbox_attributes; }
- inline const Atom &getOpenboxChangeAttributesAtom(void) const
+ inline const Atom &getOpenboxChangeAttributesAtom() const
{ return openbox_change_attributes; }
// these atoms are for window->WM interaction, with more control and
// information on window "structure"... common examples are
// notifying apps when windows are raised/lowered... when the user changes
// workspaces... i.e. "pager talk"
- inline const Atom &getOpenboxStructureMessagesAtom(void) const
+ inline const Atom &getOpenboxStructureMessagesAtom() const
{ return openbox_structure_messages; }
// *Notify* portions of the NETStructureMessages protocol
- inline const Atom &getOpenboxNotifyStartupAtom(void) const
+ inline const Atom &getOpenboxNotifyStartupAtom() const
{ return openbox_notify_startup; }
- inline const Atom &getOpenboxNotifyWindowAddAtom(void) const
+ inline const Atom &getOpenboxNotifyWindowAddAtom() const
{ return openbox_notify_window_add; }
- inline const Atom &getOpenboxNotifyWindowDelAtom(void) const
+ inline const Atom &getOpenboxNotifyWindowDelAtom() const
{ return openbox_notify_window_del; }
- inline const Atom &getOpenboxNotifyWindowFocusAtom(void) const
+ inline const Atom &getOpenboxNotifyWindowFocusAtom() const
{ return openbox_notify_window_focus; }
- inline const Atom &getOpenboxNotifyCurrentWorkspaceAtom(void) const
+ inline const Atom &getOpenboxNotifyCurrentWorkspaceAtom() const
{ return openbox_notify_current_workspace; }
- inline const Atom &getOpenboxNotifyWorkspaceCountAtom(void) const
+ inline const Atom &getOpenboxNotifyWorkspaceCountAtom() const
{ return openbox_notify_workspace_count; }
- inline const Atom &getOpenboxNotifyWindowRaiseAtom(void) const
+ inline const Atom &getOpenboxNotifyWindowRaiseAtom() const
{ return openbox_notify_window_raise; }
- inline const Atom &getOpenboxNotifyWindowLowerAtom(void) const
+ inline const Atom &getOpenboxNotifyWindowLowerAtom() const
{ return openbox_notify_window_lower; }
// atoms to change that request changes to the desktop environment during
// runtime... these messages can be sent by any client... as the sending
// client window id is not included in the ClientMessage event...
- inline const Atom &getOpenboxChangeWorkspaceAtom(void) const
+ inline const Atom &getOpenboxChangeWorkspaceAtom() const
{ return openbox_change_workspace; }
- inline const Atom &getOpenboxChangeWindowFocusAtom(void) const
+ inline const Atom &getOpenboxChangeWindowFocusAtom() const
{ return openbox_change_window_focus; }
- inline const Atom &getOpenboxCycleWindowFocusAtom(void) const
+ inline const Atom &getOpenboxCycleWindowFocusAtom() const
{ return openbox_cycle_window_focus; }
#ifdef NEWWMSPEC
// root window properties
- inline const Atom &getNETSupportedAtom(void) const
+ inline const Atom &getNETSupportedAtom() const
{ return net_supported; }
- inline const Atom &getNETClientListAtom(void) const
+ inline const Atom &getNETClientListAtom() const
{ return net_client_list; }
- inline const Atom &getNETClientListStackingAtom(void) const
+ inline const Atom &getNETClientListStackingAtom() const
{ return net_client_list_stacking; }
- inline const Atom &getNETNumberOfDesktopsAtom(void) const
+ inline const Atom &getNETNumberOfDesktopsAtom() const
{ return net_number_of_desktops; }
- inline const Atom &getNETDesktopGeometryAtom(void) const
+ inline const Atom &getNETDesktopGeometryAtom() const
{ return net_desktop_geometry; }
- inline const Atom &getNETDesktopViewportAtom(void) const
+ inline const Atom &getNETDesktopViewportAtom() const
{ return net_desktop_viewport; }
- inline const Atom &getNETCurrentDesktopAtom(void) const
+ inline const Atom &getNETCurrentDesktopAtom() const
{ return net_current_desktop; }
- inline const Atom &getNETDesktopNamesAtom(void) const
+ inline const Atom &getNETDesktopNamesAtom() const
{ return net_desktop_names; }
- inline const Atom &getNETActiveWindowAtom(void) const
+ inline const Atom &getNETActiveWindowAtom() const
{ return net_active_window; }
- inline const Atom &getNETWorkareaAtom(void) const
+ inline const Atom &getNETWorkareaAtom() const
{ return net_workarea; }
- inline const Atom &getNETSupportingWMCheckAtom(void) const
+ inline const Atom &getNETSupportingWMCheckAtom() const
{ return net_supporting_wm_check; }
- inline const Atom &getNETVirtualRootsAtom(void) const
+ inline const Atom &getNETVirtualRootsAtom() const
{ return net_virtual_roots; }
// root window messages
- inline const Atom &getNETCloseWindowAtom(void) const
+ inline const Atom &getNETCloseWindowAtom() const
{ return net_close_window; }
- inline const Atom &getNETWMMoveResizeAtom(void) const
+ inline const Atom &getNETWMMoveResizeAtom() const
{ return net_wm_moveresize; }
// application window properties
- inline const Atom &getNETPropertiesAtom(void) const
+ inline const Atom &getNETPropertiesAtom() const
{ return net_properties; }
- inline const Atom &getNETWMNameAtom(void) const
+ inline const Atom &getNETWMNameAtom() const
{ return net_wm_name; }
- inline const Atom &getNETWMDesktopAtom(void) const
+ inline const Atom &getNETWMDesktopAtom() const
{ return net_wm_desktop; }
- inline const Atom &getNETWMWindowTypeAtom(void) const
+ inline const Atom &getNETWMWindowTypeAtom() const
{ return net_wm_window_type; }
- inline const Atom &getNETWMStateAtom(void) const
+ inline const Atom &getNETWMStateAtom() const
{ return net_wm_state; }
- inline const Atom &getNETWMStrutAtom(void) const
+ inline const Atom &getNETWMStrutAtom() const
{ return net_wm_strut; }
- inline const Atom &getNETWMIconGeometryAtom(void) const
+ inline const Atom &getNETWMIconGeometryAtom() const
{ return net_wm_icon_geometry; }
- inline const Atom &getNETWMIconAtom(void) const
+ inline const Atom &getNETWMIconAtom() const
{ return net_wm_icon; }
- inline const Atom &getNETWMPidAtom(void) const
+ inline const Atom &getNETWMPidAtom() const
{ return net_wm_pid; }
- inline const Atom &getNETWMHandledIconsAtom(void) const
+ inline const Atom &getNETWMHandledIconsAtom() const
{ return net_wm_handled_icons; }
// application protocols
- inline const Atom &getNETWMPingAtom(void) const
+ inline const Atom &getNETWMPingAtom() const
{ return net_wm_ping; }
#endif // NEWWMSPEC
@@ -281,40 +281,40 @@ public:
return screenInfoList[s];
}
- inline const Bool &hasShapeExtensions(void) const
+ inline const Bool &hasShapeExtensions() const
{ return shape.extensions; }
- inline const Bool &doShutdown(void) const
+ inline const Bool &doShutdown() const
{ return _shutdown; }
- inline const Bool &isStartup(void) const
+ inline const Bool &isStartup() const
{ return _startup; }
- inline const Cursor &getSessionCursor(void) const
+ inline const Cursor &getSessionCursor() const
{ return cursor.session; }
- inline const Cursor &getMoveCursor(void) const
+ inline const Cursor &getMoveCursor() const
{ return cursor.move; }
- inline const Cursor &getLowerLeftAngleCursor(void) const
+ inline const Cursor &getLowerLeftAngleCursor() const
{ return cursor.ll_angle; }
- inline const Cursor &getLowerRightAngleCursor(void) const
+ inline const Cursor &getLowerRightAngleCursor() const
{ return cursor.lr_angle; }
- inline const Cursor &getUpperLeftAngleCursor(void) const
+ inline const Cursor &getUpperLeftAngleCursor() const
{ return cursor.ul_angle; }
- inline const Cursor &getUpperRightAngleCursor(void) const
+ inline const Cursor &getUpperRightAngleCursor() const
{ return cursor.ur_angle; }
- inline Display *getXDisplay(void) { return display; }
+ inline Display *getXDisplay() { return display; }
- inline const char *getXDisplayName(void) const
+ inline const char *getXDisplayName() const
{ return (const char *) display_name; }
- inline const char *getApplicationName(void) const
+ inline const char *getApplicationName() const
{ return (const char *) application_name; }
- inline const int &getNumberOfScreens(void) const
+ inline const unsigned int getNumberOfScreens() const
{ return number_of_screens; }
- inline const int &getShapeEventBase(void) const
+ inline const int &getShapeEventBase() const
{ return shape.event_basep; }
- inline void shutdown(void) { _shutdown = True; }
- inline void run(void) { _startup = _shutdown = False; }
+ inline void shutdown() { _shutdown = True; }
+ inline void run() { _startup = _shutdown = False; }
const Bool validateWindow(Window);
@@ -323,9 +323,9 @@ public:
void ungrabButton(unsigned int button, unsigned int modifiers,
Window grab_window) const;
- void grab(void);
- void ungrab(void);
- void eventLoop(void);
+ void grab();
+ void ungrab();
+ void eventLoop();
void addTimer(BTimer *);
void removeTimer(BTimer *);
@@ -349,17 +349,17 @@ private:
public:
ScreenInfo(BaseDisplay &, int);
- inline BaseDisplay &getBaseDisplay(void) { return basedisplay; }
+ inline BaseDisplay &getBaseDisplay() { return basedisplay; }
- inline Visual *getVisual(void) { return visual; }
- inline const Window &getRootWindow(void) const { return root_window; }
- inline const Colormap &getColormap(void) const { return colormap; }
+ inline Visual *getVisual() const { return visual; }
+ inline const Window &getRootWindow() const { return root_window; }
+ inline const Colormap &getColormap() const { return colormap; }
- inline const int &getDepth(void) const { return depth; }
- inline const int &getScreenNumber(void) const { return screen_number; }
+ inline const int &getDepth() const { return depth; }
+ inline const int &getScreenNumber() const { return screen_number; }
-// inline const unsigned int &getWidth(void) const { return width; }
-// inline const unsigned int &getHeight(void) const { return height; }
+// inline const unsigned int &getWidth() const { return width; }
+// inline const unsigned int &getHeight() const { return height; }
inline const Size &size() const { return m_size; }
};
diff --git a/src/Image.h b/src/Image.h
index 5a542c16..e342128b 100644
--- a/src/Image.h
+++ b/src/Image.h
@@ -208,7 +208,7 @@ public:
inline const Window &getDrawable(void) const { return window; }
- inline Visual *getVisual(void) { return screeninfo.getVisual(); }
+ inline Visual *getVisual(void) const { return screeninfo.getVisual(); }
inline const int &getBitsPerPixel(void) const { return bits_per_pixel; }
inline const int &getDepth(void) const { return screen_depth; }
diff --git a/src/openbox.cc b/src/openbox.cc
index 8ef1e07c..50d17f31 100644
--- a/src/openbox.cc
+++ b/src/openbox.cc
@@ -196,8 +196,8 @@ Openbox::Openbox(int m_argc, char **m_argv, char *dpy_name, char *rc)
openbox_pid = XInternAtom(getXDisplay(), "_BLACKBOX_PID", False);
#endif // HAVE_GETPID
- for (int i = 0; i < getNumberOfScreens(); i++) {
- BScreen *screen = new BScreen(*this, i, config);
+ for (unsigned int s = 0; s < getNumberOfScreens(); s++) {
+ BScreen *screen = new BScreen(*this, s, config);
if (! screen->isScreenManaged()) {
delete screen;