From: Dana Jansens Date: Sat, 21 Dec 2002 00:46:25 +0000 (+0000) Subject: color and gccache etc are like, half done X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=79ce13073b82b5144b114fc388d0be53835957a8;p=chaz%2Fopenbox color and gccache etc are like, half done --- diff --git a/otk_c/Makefile b/otk_c/Makefile index 9a93825d..960308c6 100644 --- a/otk_c/Makefile +++ b/otk_c/Makefile @@ -3,8 +3,8 @@ exec_prefix=$(prefix) libdir=$(exec_prefix)/lib targets = libotk.so libotk.a -sources = display.c screeninfo.c rect.c -headers = display.h screeninfo.h rect.h +sources = display.c screeninfo.c rect.c gccache.c +headers = display.h screeninfo.h rect.h gccache.h CFLAGS+=-I/usr/gwar/include/python2.2 diff --git a/otk_c/display.c b/otk_c/display.c index 85965210..47b1191f 100644 --- a/otk_c/display.c +++ b/otk_c/display.c @@ -143,6 +143,11 @@ void OtkDisplay_Ungrab(OtkDisplay *self) XUngrabServer(self->display); } +OtkScreenInfo *OtkDisplay_ScreenInfo(OtkDisplay *self, int num) +{ + PyObject *py = PyList_GetItem(self->screenInfoList, num); + return (OtkScreenInfo*) py; +} static PyObject *otkdisplay_grab(OtkDisplay* self, PyObject* args) @@ -174,7 +179,7 @@ static PyMethodDef get_methods[] = { static void otkdisplay_dealloc(PyObject* self) { XCloseDisplay(((OtkDisplay*) self)->display); - PyObject_Del(((OtkDisplay*) self)->screenInfoList); + Py_DECREF(((OtkDisplay*) self)->screenInfoList); PyObject_Del(self); } diff --git a/otk_c/display.h b/otk_c/display.h index 87574b76..a59d8482 100644 --- a/otk_c/display.h +++ b/otk_c/display.h @@ -61,4 +61,7 @@ void OtkDisplay_Grab(OtkDisplay *self); //! Ungrabs the display void OtkDisplay_Ungrab(OtkDisplay *self); +//! Get the screen info for a specific screen +struct OtkScreenInfo *OtkDisplay_ScreenInfo(OtkDisplay *self, int num); + #endif // __display_h diff --git a/otk_c/screeninfo.c b/otk_c/screeninfo.c index 0153d7f7..fb0de498 100644 --- a/otk_c/screeninfo.c +++ b/otk_c/screeninfo.c @@ -162,10 +162,10 @@ static PyMethodDef get_methods[] = { static void otkscreeninfo_dealloc(PyObject* self) { - PyObject_Del(((OtkScreenInfo*) self)->display_string); - PyObject_Del(((OtkScreenInfo*) self)->rect); + Py_DECREF(((OtkScreenInfo*) self)->display_string); + Py_DECREF(((OtkScreenInfo*) self)->rect); #ifdef XINERAMA - PyObject_Del(((OtkScreenInfo*) self)->xinerama_areas); + Py_DECREF(((OtkScreenInfo*) self)->xinerama_areas); #endif PyObject_Del(self); }