]> Dogcows Code - chaz/openbox/blobdiff - src/python.hh
add 'grab_server' for grabbing .. the .. server!
[chaz/openbox] / src / python.hh
index 42b9726f50081ca752721f8fab64545bb42b3c69..c1655503fafc25dc37dffa20c5577e4d23d97f71 100644 (file)
 
 extern "C" {
 #include <X11/Xlib.h>
-#include <Python.h>
 }
 
 #include <string>
 #include <vector>
 
+
 namespace ob {
 
 class Client;
@@ -30,6 +30,7 @@ struct MouseContext {
     Titlebar,
     Handle,
     Window,
+    IconButton,
     MaximizeButton,
     CloseButton,
     IconifyButton,
@@ -37,7 +38,7 @@ struct MouseContext {
     Grip,
     Root,
     MenuItem
-#if ! (defined(DOXYGEN_IGNORE) || defined(SWIG))
+#ifndef DOXYGEN_IGNORE
     , NUM_MOUSE_CONTEXT
 #endif
   };
@@ -46,10 +47,11 @@ struct MouseContext {
 struct MouseAction {
   enum MA {
     Press,
+    Release,
     Click,
     DoubleClick,
     Motion
-#if ! (defined(DOXYGEN_IGNORE) || defined(SWIG))
+#ifndef DOXYGEN_IGNORE
     , NUM_MOUSE_ACTION
 #endif
   };
@@ -59,7 +61,7 @@ struct KeyContext {
   enum KC {
     Menu,
     All
-#if ! (defined(DOXYGEN_IGNORE) || defined(SWIG))
+#ifndef DOXYGEN_IGNORE
     , NUM_KEY_CONTEXT
 #endif
   };
@@ -69,7 +71,7 @@ struct KeyAction {
   enum KA {
     Press,
     Release
-#if ! (defined(DOXYGEN_IGNORE) || defined(SWIG))
+#ifndef DOXYGEN_IGNORE
     , NUM_KEY_ACTION
 #endif
   };
@@ -80,7 +82,7 @@ struct EventAction {
     EnterWindow,        //!< Occurs when the mouse enters a window
     LeaveWindow,        //!< Occurs when the mouse leaves a window
     //! Occurs while a window is being managed. The handler should call
-    //! Client::move to the window
+    //! Client::move on the window
     PlaceWindow,
     //! Occurs while a window is being managed, just before the window is
     //! displayed
@@ -119,8 +121,8 @@ struct EventAction {
       The Client::urgent method can be used to get the status.
     */
     UrgentWindow
-#if ! (defined(DOXYGEN_IGNORE) || defined(SWIG))
-    , NUM_EVENTS
+#ifndef DOXYGEN_IGNORE
+    , NUM_EVENT_ACTION
 #endif
   };
 };
@@ -221,44 +223,20 @@ public:
   }
 };
 
-#ifndef SWIG
+// The void*'s will be used to hold the native language's function pointer
+typedef void (*MouseCallback)(MouseData*, void*);
+typedef void (*KeyCallback)(KeyData*, void*);
+typedef void (*EventCallback)(EventData*, void*);
 
 void python_init(char *argv0);
 void python_destroy();
-bool python_exec(const std::string &path);
+//! Returns 0 for success, 1 for failing to open the file, 2 for an exception
+int python_exec(const std::string &path);
 
 bool python_get_long(const char *name, long *value);
 bool python_get_string(const char *name, otk::ustring *value);
 bool python_get_stringlist(const char *name, std::vector<otk::ustring> *value);
 
-/***********************************************
- * These are found in openbox.i, not python.cc *
- ***********************************************/
-void python_callback(PyObject *func, MouseData *data);
-void python_callback(PyObject *func, EventData *data);
-void python_callback(PyObject *func, KeyData *data);
-
-#endif // SWIG
-
-PyObject *mbind(const std::string &button, ob::MouseContext::MC context,
-                ob::MouseAction::MA action, PyObject *func);
-
-PyObject *kbind(PyObject *keylist, ob::KeyContext::KC context, PyObject *func);
-
-PyObject *kgrab(int screen, PyObject *func);
-PyObject *kungrab();
-
-PyObject *ebind(ob::EventAction::EA action, PyObject *func);
-
-void set_reset_key(const std::string &key);
-
-PyObject *send_client_msg(Window target, Atom type, Window about,
-                          long data, long data1 = 0, long data2 = 0,
-                          long data3 = 0, long data4 = 0);
-
-
-void execute(const std::string &bin, int screen=0);
-
 }
 
 
This page took 0.026473 seconds and 4 git commands to generate.