added XAtom class, and it all now compiles.

This commit is contained in:
Dana Jansens 2002-05-23 14:53:06 +00:00
parent 83347770a6
commit a85c9a7c6e
6 changed files with 404 additions and 405 deletions

View file

@ -121,11 +121,11 @@ static int handleXErrors(Display *d, XErrorEvent *e) {
// signal handler to allow for proper and gentle shutdown
#ifndef HAVE_SIGACTION
static RETSIGTYPE signalhandler(int sig) {
static RETSIGTYPE signalhandler(int sig)
#else // HAVE_SIGACTION
static void signalhandler(int sig) {
static void signalhandler(int sig)
#endif // HAVE_SIGACTION
{
static int re_enter = 0;
switch (sig) {
@ -492,6 +492,7 @@ static RETSIGTYPE signalhandler(int sig) {
}
}
}
}
const Bool BaseDisplay::validateWindow(Window window) {
@ -539,13 +540,6 @@ static RETSIGTYPE signalhandler(int sig) {
timerList.remove(timer);
}
<<<<<<< BaseDisplay.cc
=======
void BaseDisplay::removeTimer(BTimer *timer) {
ASSERT(timer != (BTimer *) 0);
timerList.remove(timer);
}
>>>>>>> 1.13.4.1
/*
* Grabs a button, but also grabs the button in every possible combination with

View file

@ -30,7 +30,7 @@ CPPFLAGS= @CPPFLAGS@ @SHAPE@ @SLIT@ @INTERLACE@ @ORDEREDPSEUDO@ \
bin_PROGRAMS= openbox
openbox_SOURCES= BaseDisplay.cc Basemenu.cc Clientmenu.cc Configmenu.cc Geometry.cc Iconmenu.cc Image.cc Netizen.cc Resource.cc Rootmenu.cc Screen.cc Slit.cc Timer.cc Toolbar.cc Window.cc Windowmenu.cc Workspace.cc Workspacemenu.cc XAtom.cc XDisplay.cc XScreen.cc openbox.cc bsd-snprintf.c i18n.cc main.cc
openbox_SOURCES= BaseDisplay.cc Basemenu.cc Clientmenu.cc Configmenu.cc Geometry.cc Iconmenu.cc Image.cc Netizen.cc Resource.cc Rootmenu.cc Screen.cc Slit.cc Timer.cc Toolbar.cc Window.cc Windowmenu.cc Workspace.cc Workspacemenu.cc XAtom.cc openbox.cc bsd-snprintf.c i18n.cc main.cc
MAINTAINERCLEANFILES= Makefile.in
@ -82,9 +82,7 @@ Toolbar.o: Toolbar.cc i18n.h openbox.h BaseDisplay.h \
Timer.h Image.h Window.h Iconmenu.h Basemenu.h Windowmenu.h Slit.h \
Clientmenu.h Workspace.h Rootmenu.h Screen.h Configmenu.h \
Netizen.h Workspacemenu.h Toolbar.h Resource.h Geometry.h
XAtom.o: XAtom.cc XAtom.h XDisplay.h XScreen.h Geometry.h Util.h
XDisplay.o: XDisplay.cc XDisplay.h XAtom.h XScreen.h Geometry.h Util.h
XScreen.o: XScreen.cc XScreen.h Geometry.h XDisplay.h XAtom.h
XAtom.o: XAtom.cc XAtom.h Geometry.h Util.h
Window.o: Window.cc i18n.h openbox.h BaseDisplay.h \
Timer.h Image.h Window.h Iconmenu.h Basemenu.h Windowmenu.h Slit.h \
Screen.h Configmenu.h Netizen.h Rootmenu.h Workspace.h \

View file

@ -20,12 +20,12 @@
// DEALINGS IN THE SOFTWARE.
#include "XAtom.h"
#include "XDisplay.h"
#include "XScreen.h"
#include "openbox.h"
#include "Screen.h"
#include "Util.h"
XAtom::XAtom(const XDisplay *display) {
_display = display->_display;
XAtom::XAtom(Openbox &ob) {
_display = ob.getXDisplay();
#ifdef HAVE_GETPID
openbox_pid = getAtom("_BLACKBOX_PID");
@ -86,8 +86,8 @@ XAtom::XAtom(const XDisplay *display) {
net_wm_ping = getAtom("_NET_WM_PING");
for (int s = 0, c = display->screenCount(); s < c; ++s)
setSupported(display->screen(s));
for (unsigned int s = 0, c = ob.managedScreenCount(); s < c; ++s)
setSupported( static_cast<ScreenInfo*>(ob.getScreen(s)) );
}
@ -115,9 +115,9 @@ Atom XAtom::getAtom(const char *name) const {
/*
* Sets which atoms are supported for NETWM, by Openbox, on the root window.
*/
void XAtom::setSupported(const XScreen *screen) {
void XAtom::setSupported(const ScreenInfo *screen) {
// create the netwm support window
Window w = XCreateSimpleWindow(_display, screen->rootWindow(),
Window w = XCreateSimpleWindow(_display, screen->getRootWindow(),
0, 0, 1, 1, 0, 0, 0);
ASSERT(w != None);
_support_windows.push_back(w);

View file

@ -28,8 +28,8 @@
#include <X11/Xatom.h>
#include <vector>
class XDisplay;
class XScreen;
class Openbox;
class ScreenInfo;
class XAtom {
typedef std::vector<Window> SupportWindows;
@ -102,7 +102,7 @@ class XAtom {
net_wm_ping;
Atom getAtom(const char *name) const;
void setSupported(const XScreen *screen);
void setSupported(const ScreenInfo *screen);
void setValue(Window win, Atom atom, Atom type, unsigned char *data,
int size, int nelements, bool append) const;
@ -114,7 +114,7 @@ class XAtom {
XAtom& operator=(const XAtom&);
public:
XAtom(const XDisplay *display);
XAtom(Openbox &ob);
virtual ~XAtom();
void setCardValue(Window win, Atom atom, long value) const; // 32-bit CARDINAL

View file

@ -223,7 +223,7 @@ Openbox::Openbox(int m_argc, char **m_argv, char *dpy_name, char *rc,
"Openbox::Openbox: no managable screens found, aborting.\n"));
::exit(3);
}
current_screen = screenList.front();
current_screen = screenList[0];
// save current settings and default values
save();

View file

@ -47,6 +47,7 @@
#include <map>
#include <list>
#include <vector>
//forward declaration
class BScreen;
@ -115,7 +116,7 @@ private:
typedef std::list<MenuTimestamp*> MenuTimestampList;
MenuTimestampList menuTimestamps;
typedef std::list<BScreen*> ScreenList;
typedef std::vector<BScreen*> ScreenList;
ScreenList screenList;
BScreen *current_screen;
@ -158,8 +159,14 @@ public:
OpenboxWindow *focusedWindow();
void focusWindow(OpenboxWindow *w);
BScreen *getScreen(int);
inline BScreen *getScreen(unsigned int s) {
ASSERT(s < screenList.size());
return screenList[s];
}
BScreen *searchScreen(Window);
inline unsigned int managedScreenCount() const {
return screenList.size();
}
inline Resource &getConfig() {
return config;