See http://www.python.org
]))
AC_CHECK_LIB([python2.2], [Py_Initialize],
- PYTHON_LDFLAGS="-lpython2.2 -Xlinker -export-dynamic",
+ PYTHON_LDFLAGS="-lpython2.2",
+dnl -Xlinker -export-dynamic",
AC_MSG_ERROR([Openbox requires the use of Python 2.2. This is its secret special formula for extreme sexiness.
See http://www.python.org
]))
+PYTHON_CFLAGS="-I/usr/include/python2.2 -I/usr/gwar/include/python2.2"
+AC_SUBST([PYTHON_CFLAGS])
AC_SUBST([PYTHON_LDFLAGS])
+dnl Check for guile
+GUILE_FLAGS
+
dnl Check for X headers and libraries
AC_PATH_X
AC_PATH_XTRA
DEFAULT_MENU=$(pkgdatadir)/menu
DEFAULT_STYLE=$(pkgdatadir)/styles/mbdtex
-CPPFLAGS=$(XFT_CFLAGS) @CPPFLAGS@ \
+CPPFLAGS=$(XFT_CFLAGS) $(GUILE_CFLAGS) $(PYTHON_CFLAGS) @CPPFLAGS@ \
-DDEFAULTMENU=\"$(DEFAULT_MENU)\" \
-DDEFAULTSTYLE=\"$(DEFAULT_STYLE)\" \
-DLOCALEDIR=\"$(localedir)\"
-LIBS=$(XFT_LIBS) $(PYTHON_LDFLAGS) @LIBS@
+LIBS=$(XFT_LIBS) $(GUILE_LDFLAGS) $(PYTHON_LDFLAGS) @LIBS@
INCLUDES= -I../otk
openbox3_SOURCES= actions.cc client.cc frame.cc openbox.cc screen.cc \
main.cc rootwindow.cc backgroundwidget.cc labelwidget.cc \
- buttonwidget.cc python.cc
+ buttonwidget.cc openbox_wrap.cc
+# guile.cc
MAINTAINERCLEANFILES= Makefile.in
distclean-local:
rm -f *\~ *.orig *.rej .\#*
+openbox.i: openbox.hh screen.hh client.hh
+ touch openbox.i
+
+openbox_wrap.cc: openbox.i
+ swig -python -c++ -nodefault -module openbox -o openbox_wrap.cc openbox.i
+# swig -guile -c++ -nodefault -o openbox_wrap.cc openbox.i
+
# local dependencies
class OBFrame;
+//! The MWM Hints as retrieved from the window property
+/*!
+ This structure only contains 3 elements, even though the Motif 2.0
+ structure contains 5. We only use the first 3, so that is all gets defined.
+*/
+struct MwmHints {
+ //! The number of elements in the OBClient::MwmHints struct
+ static const unsigned int elements = 3;
+ unsigned long flags; //!< A bitmask of OBClient::MwmFlags values
+ unsigned long functions; //!< A bitmask of OBClient::MwmFunctions values
+ unsigned long decorations;//!< A bitmask of OBClient::MwmDecorations values
+};
+
+
//! Maintains the state of a client window.
/*!
OBClient maintains the state of a client window. The state consists of the
//! Holds a bitmask of OBClient::Decoration values
typedef unsigned char DecorationFlags;
- //! The MWM Hints as retrieved from the window property
- /*!
- This structure only contains 3 elements, even though the Motif 2.0
- structure contains 5. We only use the first 3, so that is all gets defined.
- */
- typedef struct MwmHints {
- //! The number of elements in the OBClient::MwmHints struct
- static const unsigned int elements = 3;
- unsigned long flags; //!< A bitmask of OBClient::MwmFlags values
- unsigned long functions; //!< A bitmask of OBClient::MwmFunctions values
- unsigned long decorations;//!< A bitmask of OBClient::MwmDecorations values
- };
-
//! Possible actions that can be made with the _NET_WM_STATE client message
enum StateAction { State_Remove = 0, //!< _NET_WM_STATE_REMOVE
State_Add, //!< _NET_WM_STATE_ADD
// XXX: updateTransientFor();
public:
+#ifndef SWIG
//! Constructs a new OBClient object around a specified window id
/*!
@param window The window id that the OBClient class should handle
OBClient(int screen, Window window);
//! Destroys the OBClient object
virtual ~OBClient();
+#endif
//! Returns the screen on which the clien resides
inline int screen() const { return _screen; }
# include <locale.h>
#endif // HAVE_LOCALE_H
+#include <guile/gh.h>
+
#include "gettext.h"
}
#include "blackbox.hh"
#include "openbox.hh"
-int main(int argc, char **argv) {
- // initialize the locale
- setlocale(LC_ALL, "");
- bindtextdomain(PACKAGE, LOCALEDIR);
- textdomain(PACKAGE);
-
+void main_prog(int argc, char **argv) {
ob::Openbox openbox(argc, argv);
//ob::Blackbox blackbox(argc, argv, 0);
//Blackbox blackbox(argv, session_display, rc_file);
openbox.eventLoop();
+}
+
+int main(int argc, char **argv) {
+ // initialize the locale
+ setlocale(LC_ALL, "");
+ bindtextdomain(PACKAGE, LOCALEDIR);
+ textdomain(PACKAGE);
- return(0);
+ // start up guile
+ //gh_enter(argc, argv, main_prog);
+ main_prog(argc, argv);
}
-// -*- mode: C++; indent-tabs-mode: nil; -*-
+// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
#ifdef HAVE_CONFIG_H
# include "../config.h"
#include "client.hh"
#include "screen.hh"
#include "actions.hh"
-#include "python.hh"
#include "otk/property.hh"
#include "otk/display.hh"
#include "otk/assassin.hh"
# include <sys/select.h>
#endif // HAVE_SYS_SELECT_H
-#include <python2.2/Python.h>
+//#include <guile/gh.h>
+
+#include <Python.h>
+
+// The initializer in openbox_wrap.cc
+extern void init_openbox(void);
#include "gettext.h"
#define _(str) gettext(str)
::exit(1);
}
- // initialize the python interface
+ /*
+ // make our guile interfaces exist
+ SWIG_init();
+
+ // run the guile of d3th
+ FILE *rcpyfd = fopen("/home/natas/.openbox/user.scm", "r");
+ if (!rcpyfd) {
+ printf("failed to load guile script /home/natas/.openbox/user.scm\n");
+ } else {
+ fclose(rcpyfd);
+ gh_load("/home/natas/.openbox/user.scm");
+ }
+ */
+
Py_SetProgramName(argv[0]);
Py_Initialize();
- initopenbox(); // initialize the static 'openbox' module
+ //initopenbox(); // initialize the static 'openbox' module
+ init_openbox();
FILE *rcpyfd = fopen("/home/natas/.openbox/user.py", "r");
if (!rcpyfd) {
printf("failed to load python file /home/natas/.openbox/user.py\n");
PyRun_SimpleFile(rcpyfd, "/home/natas/.openbox/user.py");
fclose(rcpyfd);
}
+
_state = State_Normal; // done starting
}
-// -*- mode: C++; indent-tabs-mode: nil; -*-
+// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
#ifndef __openbox_hh
#define __openbox_hh
class OBClient;
class OBActions;
+//! Mouse cursors used throughout Openbox
+struct Cursors {
+ Cursor session; //!< The default mouse cursor
+ Cursor move; //!< For moving a window
+ Cursor ll_angle; //!< For resizing the bottom left corner of a window
+ Cursor lr_angle; //!< For resizing the bottom right corner of a window
+ Cursor ul_angle; //!< For resizing the top left corner of a window
+ Cursor ur_angle; //!< For resizing the right corner of a window
+};
+
+
//! The main class for the Openbox window manager
/*!
Only a single instance of the Openbox class may be used in the application. A
State_Exiting //!< The window manager is exiting (being destroyed)
};
- //! Mouse cursors used throughout Openbox
- struct Cursors {
- Cursor session; //!< The default mouse cursor
- Cursor move; //!< For moving a window
- Cursor ll_angle; //!< For resizing the bottom left corner of a window
- Cursor lr_angle; //!< For resizing the bottom right corner of a window
- Cursor ul_angle; //!< For resizing the top left corner of a window
- Cursor ur_angle; //!< For resizing the right corner of a window
- };
-
//! A map for looking up a specific client class from the window id
typedef std::map<Window, OBClient *> ClientMap;
static void signalHandler(int signal);
public:
+#ifndef SWIG
//! Openbox constructor.
/*!
\param argc Number of command line arguments, as received in main()
Openbox(int argc, char **argv);
//! Openbox destructor.
virtual ~Openbox();
+#endif
//! Returns the state of the window manager (starting, exiting, etc)
inline RunState state() const { return _state; }
//! Returns the mouse cursors used throughout Openbox
inline const Cursors &cursors() const { return _cursors; }
+#ifndef SWIG
//! The main function of the Openbox class
/*!
This function should be called after instantiating the Openbox class.
The Openbox::shutdown method will cause this function to exit.
*/
void eventLoop();
+#endif
//! Adds an OBClient to the client list for lookups
void addClient(Window window, OBClient *client);
--- /dev/null
+// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
+
+%module openbox
+
+%{
+#ifdef HAVE_CONFIG_H
+# include "../config.h"
+#endif
+
+#include "openbox.hh"
+#include "screen.hh"
+#include "client.hh"
+%}
+
+%immutable ob::Openbox::instance;
+
+%include "openbox.hh"
+%include "screen.hh"
+%include "client.hh"
+
+
+%include stl.i
+%include std_list.i
+
+%{
+class OBClient;
+%}
+%template(ClientList) std::list<OBClient*>;
void setWorkArea();
public:
+#ifndef SWIG
//! Constructs a new OBScreen object
OBScreen(int screen, const otk::Configuration &config);
//! Destroys the OBScreen object
virtual ~OBScreen();
+#endif
//! Returns if the screen was successfully managed
/*!
//! Returns the style in use on the screen
inline const otk::Style *style() const { return &_style; }
+ inline ClientList clients() { return _clients; }
//! Adds a window's strut to the screen's list of reserved spaces
void addStrut(otk::Strut *strut);