OBDisplay = self;
// Get information on all the screens which are available.
- self->screenInfoList = PyList_New(ScreenCount(self->display));
+ self->screenInfoList = (PyListObject*)PyList_New(ScreenCount(self->display));
for (i = 0; i < ScreenCount(self->display); ++i)
- PyList_SetItem(self->screenInfoList, i, OtkScreenInfo_New(i));
+ PyList_SetItem((PyObject*)self->screenInfoList, i, OtkScreenInfo_New(i));
Py_INCREF(OBDisplay); // make sure it stays around!!
}
OtkScreenInfo *OtkDisplay_ScreenInfo(OtkDisplay *self, int num)
{
- PyObject *py = PyList_GetItem(self->screenInfoList, num);
+ PyObject *py = PyList_GetItem((PyObject*)self->screenInfoList, num);
return (OtkScreenInfo*) py;
}
self->screen = num;
self->root_window = RootWindow(OBDisplay->display, self->screen);
- self->rect = OtkRect_New(0, 0,
- WidthOfScreen(ScreenOfDisplay(OBDisplay->display,
- self->screen)),
- HeightOfScreen(ScreenOfDisplay(OBDisplay->display,
- self->screen)));
+ self->rect = (OtkRect*)
+ OtkRect_New(0, 0, WidthOfScreen(ScreenOfDisplay(OBDisplay->display,
+ self->screen)),
+ HeightOfScreen(ScreenOfDisplay(OBDisplay->display,
+ self->screen)));
/*
If the default depth is at least 8 we will use that,
}
// get the default display string and strip the screen number
- self->display_string =
+ self->display_string = (PyStringObject*)
PyString_FromFormat("DISPLAY=%s",DisplayString(OBDisplay->display));
- dstr = PyString_AsString(self->display_string);
+ dstr = PyString_AsString((PyObject*)self->display_string);
dstr2 = strrchr(dstr, '.');
if (dstr2) {
PyObject *str;
- _PyString_Resize(&self->display_string, dstr2 - dstr);
+ _PyString_Resize((PyObject**)&self->display_string, dstr2 - dstr);
str = PyString_FromFormat(".%d", self->screen);
- PyString_Concat(&self->display_string, str);
+ PyString_Concat((PyObject**)&self->display_string, str);
}
#ifdef XINERAMA
return PyInt_FromLong(self->screen);
}
-static PyObject *otkscreeninfo_getrect(OtkScreenInfo* self, PyObject* args)
+static OtkRect *otkscreeninfo_getrect(OtkScreenInfo* self, PyObject* args)
{
if (!PyArg_ParseTuple(args, ":getRect"))
return NULL;
extern PyTypeObject OtkScreenInfo_Type;
+struct OtkRect;
+
typedef struct OtkScreenInfo {
int screen;
Window root_window;
Visual *visual;
Colormap colormap;
- PyObject *display_string; // PyStringObject
- PyObject *rect; // OtkRect
+ PyStringObject *display_string;
+ struct OtkRect *rect; // OtkRect
#ifdef XINERAMA
PyObject *xinerama_areas; // PyListObject[OtkRect]
Bool xinerama_active;