X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Fpython.hh;h=6acc538b6db4d2f4471637bd9f9f5f1290687cfb;hb=781495e2eafd9dfe5592a2f5cefb905743208175;hp=3fd6baa9490193dc9c9ea9f2c467b09d56aa18ac;hpb=889cb8880dceb6a7d4c50b0bd6f10214b081a856;p=chaz%2Fopenbox diff --git a/src/python.hh b/src/python.hh index 3fd6baa9..6acc538b 100644 --- a/src/python.hh +++ b/src/python.hh @@ -14,7 +14,6 @@ extern "C" { #include -#include } #include @@ -30,6 +29,7 @@ struct MouseContext { Titlebar, Handle, Window, + IconButton, MaximizeButton, CloseButton, IconifyButton, @@ -37,7 +37,7 @@ struct MouseContext { Grip, Root, MenuItem -#if ! (defined(DOXYGEN_IGNORE) || defined(SWIG)) +#ifndef DOXYGEN_IGNORE , NUM_MOUSE_CONTEXT #endif }; @@ -50,7 +50,7 @@ struct MouseAction { Click, DoubleClick, Motion -#if ! (defined(DOXYGEN_IGNORE) || defined(SWIG)) +#ifndef DOXYGEN_IGNORE , NUM_MOUSE_ACTION #endif }; @@ -60,7 +60,7 @@ struct KeyContext { enum KC { Menu, All -#if ! (defined(DOXYGEN_IGNORE) || defined(SWIG)) +#ifndef DOXYGEN_IGNORE , NUM_KEY_CONTEXT #endif }; @@ -70,7 +70,7 @@ struct KeyAction { enum KA { Press, Release -#if ! (defined(DOXYGEN_IGNORE) || defined(SWIG)) +#ifndef DOXYGEN_IGNORE , NUM_KEY_ACTION #endif }; @@ -120,8 +120,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 }; }; @@ -222,46 +222,15 @@ 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); - -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 *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 *mgrab(int screen); -PyObject *mungrab(); - -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); +//! Returns 0 for success, 1 for failing to open the file, 2 for an exception +int python_exec(const std::string &path); }