view finch/libgnt/pygnt/gnt.override @ 18718:1ad1a4e8dfea

Add function to get the screen size.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sun, 29 Jul 2007 16:45:29 +0000
parents d3542cffbb42
children 7389b597a812
line wrap: on
line source

%%
headers
#include <Python.h>
#include "pygobject.h"
#include "gnt.h"
#include "gntbindable.h"
#include "gntwidget.h"
#include "gntbox.h"
#include "gntbutton.h"
#include "gntcheckbox.h"
#include "gntcolors.h"
#include "gntcombobox.h"
#include "gntentry.h"
#include "gntfilesel.h"
#include "gntkeys.h"
#include "gntlabel.h"
#include "gntline.h"
#include "gntmenu.h"
#include "gntmenuitem.h"
#include "gntmenuitemcheck.h"
#include "gntslider.h"
#include "gntstyle.h"
#include "gnttextview.h"
#include "gnttree.h"
#include "gntutils.h"
#include "gntwindow.h"
#include "gntwm.h"
#include "gntws.h"
#include "common.h"
%%
include
 gntfilesel.override
 gnttree.override
%%
modulename gnt
%%
import gobject.GObject as PyGObject_Type
%%
ignore-glob
	*_get_gtype
%%
define set_flag
static PyObject *
_wrap_set_flag(PyGObject *self, PyObject *args, PyObject *kwargs)
{
	static char *kwlist[] = {"flags", NULL};
	PyGObject *widget;
	int flags;

	if (!PyArg_ParseTuple(args, "O!i:gnt.set_flag", &PyGntWidget_Type, &widget,
				&flags)) {
		return NULL;
	}

	GNT_WIDGET_SET_FLAGS(widget->obj, flags);

	Py_INCREF(Py_None);
	return Py_None;
}
%%
define unset_flag
static PyObject *
_wrap_unset_flag(PyGObject *self, PyObject *args, PyObject *kwargs)
{
	static char *kwlist[] = {"flags", NULL};
	PyGObject *widget;
	int flags;

	if (!PyArg_ParseTuple(args, "O!i:gnt.unset_flag", &PyGntWidget_Type, &widget,
				&flags)) {
		return NULL;
	}

	GNT_WIDGET_UNSET_FLAGS(widget->obj, flags);

	Py_INCREF(Py_None);
	return Py_None;
}
%%
define screen_size noargs
static PyObject *
_wrap_screen_size(PyObject *self)
{
	PyObject *list = PyList_New(0);

	if (list == NULL)
		return NULL;

	PyList_Append(list, PyInt_FromLong((long)getmaxx(stdscr)));
	PyList_Append(list, PyInt_FromLong((long)getmaxy(stdscr)));

	return list;
}