pygobject r880 - in trunk: . gobject
- From: johan svn gnome org
- To: svn-commits-list gnome org
- Subject: pygobject r880 - in trunk: . gobject
- Date: Sun, 27 Jul 2008 09:00:06 +0000 (UTC)
Author: johan
Date: Sun Jul 27 09:00:06 2008
New Revision: 880
URL: http://svn.gnome.org/viewvc/pygobject?rev=880&view=rev
Log:
2008-07-27 Johan Dahlin <johan gnome org>
* gobject/Makefile.am:
* gobject/gobjectmodule.c (init_gobject):
* gobject/pygboxed.c (pygobject_boxed_register_types):
* gobject/pygboxed.h:
* gobject/pygenum.c (pygobject_enum_register_types):
* gobject/pygenum.h:
* gobject/pygflags.c (pygobject_flags_register_types):
* gobject/pygflags.h:
* gobject/pygpointer.c (pygobject_pointer_register_types):
* gobject/pygpointer.h:
Split out quark and type registration to the respective
implementation source files, add headers.
Added:
trunk/gobject/pygboxed.h
trunk/gobject/pygenum.h
trunk/gobject/pygflags.h
trunk/gobject/pygpointer.h
Modified:
trunk/ChangeLog
trunk/gobject/Makefile.am
trunk/gobject/gobjectmodule.c
trunk/gobject/pygboxed.c
trunk/gobject/pygenum.c
trunk/gobject/pygflags.c
trunk/gobject/pygpointer.c
Modified: trunk/gobject/Makefile.am
==============================================================================
--- trunk/gobject/Makefile.am (original)
+++ trunk/gobject/Makefile.am Sun Jul 27 09:00:06 2008
@@ -45,8 +45,11 @@
_gobject_la_SOURCES = \
gobjectmodule.c \
pygboxed.c \
+ pygboxed.h \
pygenum.c \
+ pygenum.h \
pygflags.c \
+ pygflags.h \
pyginterface.c \
pyginterface.h \
pygobject.c \
@@ -55,6 +58,7 @@
pygparamspec.c \
pygparamspec.h \
pygpointer.c \
+ pygpointer.h \
pygtype.c \
pygtype.h
_gobject_la_DEPENDENCIES = constants.py
Modified: trunk/gobject/gobjectmodule.c
==============================================================================
--- trunk/gobject/gobjectmodule.c (original)
+++ trunk/gobject/gobjectmodule.c Sun Jul 27 09:00:06 2008
@@ -28,8 +28,12 @@
#include <pyglib.h>
#include <pythread.h>
#include "pygobject-private.h"
+#include "pygboxed.h"
+#include "pygenum.h"
+#include "pygflags.h"
#include "pyginterface.h"
#include "pygparamspec.h"
+#include "pygpointer.h"
#include "pygtype.h"
#ifdef HAVE_FFI_H
@@ -43,12 +47,6 @@
static GHashTable *log_handlers = NULL;
static gboolean log_handlers_disabled = FALSE;
-GQuark pygboxed_type_key;
-GQuark pygboxed_marshal_key;
-GQuark pygenum_class_key;
-GQuark pygflags_class_key;
-GQuark pygpointer_class_key;
-
static void pyg_flags_add_constants(PyObject *module, GType flags_type,
const gchar *strip_prefix);
@@ -2553,6 +2551,7 @@
add_warning_redirection("GThread", warning);
}
+
DL_EXPORT(void)
init_gobject(void)
{
@@ -2564,12 +2563,6 @@
g_type_init();
pyglib_init();
- pygboxed_type_key = g_quark_from_static_string("PyGBoxed::class");
- pygboxed_marshal_key = g_quark_from_static_string("PyGBoxed::marshal");
- pygenum_class_key = g_quark_from_static_string("PyGEnum::class");
- pygflags_class_key = g_quark_from_static_string("PyGFlags::class");
- pygpointer_class_key = g_quark_from_static_string("PyGPointer::class");
-
pygobject_register_api(d);
pygobject_register_constants(m);
pygobject_register_features(d);
@@ -2579,14 +2572,11 @@
pygobject_object_register_types(d);
pygobject_interface_register_types(d);
pygobject_paramspec_register_types(d);
+ pygobject_boxed_register_types(d);
+ pygobject_pointer_register_types(d);
+ pygobject_enum_register_types(d);
+ pygobject_flags_register_types(d);
- PYGOBJECT_REGISTER_GTYPE(d, PyGBoxed_Type, "GBoxed", G_TYPE_BOXED);
- PYGOBJECT_REGISTER_GTYPE(d, PyGPointer_Type, "GPointer", G_TYPE_POINTER);
- PyGEnum_Type.tp_base = &PyInt_Type;
- PYGOBJECT_REGISTER_GTYPE(d, PyGEnum_Type, "GEnum", G_TYPE_ENUM);
- PyGFlags_Type.tp_base = &PyInt_Type;
- PYGOBJECT_REGISTER_GTYPE(d, PyGFlags_Type, "GFlags", G_TYPE_FLAGS);
-
/* signal registration recognizes this special accumulator 'constant' */
_pyg_signal_accumulator_true_handled_func = \
PyDict_GetItemString(d, "signal_accumulator_true_handled");
Modified: trunk/gobject/pygboxed.c
==============================================================================
--- trunk/gobject/pygboxed.c (original)
+++ trunk/gobject/pygboxed.c Sun Jul 27 09:00:06 2008
@@ -26,6 +26,10 @@
#include <pyglib.h>
#include "pygobject-private.h"
+#include "pygboxed.h"
+
+GQuark pygboxed_type_key;
+GQuark pygboxed_marshal_key;
static void
pyg_boxed_dealloc(PyGBoxed *self)
@@ -243,3 +247,12 @@
return (PyObject *)self;
}
+void
+pygobject_boxed_register_types(PyObject *d)
+{
+ pygboxed_type_key = g_quark_from_static_string("PyGBoxed::class");
+ pygboxed_marshal_key = g_quark_from_static_string("PyGBoxed::marshal");
+
+ PYGOBJECT_REGISTER_GTYPE(d, PyGBoxed_Type, "GBoxed", G_TYPE_BOXED);
+
+}
Added: trunk/gobject/pygboxed.h
==============================================================================
--- (empty file)
+++ trunk/gobject/pygboxed.h Sun Jul 27 09:00:06 2008
@@ -0,0 +1,27 @@
+/* -*- Mode: C; c-basic-offset: 4 -*-
+ * pygtk- Python bindings for the GTK toolkit.
+ * Copyright (C) 1998-2003 James Henstridge
+ * 2004-2008 Johan Dahlin
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ * USA
+ */
+
+#ifndef __PYGOBJECT_BOXED_H__
+#define __PYGOBJECT_BOXED_H__
+
+void pygobject_boxed_register_types(PyObject *d);
+
+#endif /* __PYGOBJECT_BOXED_H__ */
Modified: trunk/gobject/pygenum.c
==============================================================================
--- trunk/gobject/pygenum.c (original)
+++ trunk/gobject/pygenum.c Sun Jul 27 09:00:06 2008
@@ -28,6 +28,8 @@
#include <pyglib.h>
#include "pygobject-private.h"
+GQuark pygenum_class_key;
+
static PyObject *
pyg_enum_richcompare(PyGEnum *self, PyObject *other, int op)
{
@@ -360,3 +362,12 @@
pyg_enum_new, /* tp_new */
};
+void
+pygobject_enum_register_types(PyObject *d)
+{
+ pygenum_class_key = g_quark_from_static_string("PyGEnum::class");
+
+ PyGEnum_Type.tp_base = &PyInt_Type;
+ PYGOBJECT_REGISTER_GTYPE(d, PyGEnum_Type, "GEnum", G_TYPE_ENUM);
+
+}
Added: trunk/gobject/pygenum.h
==============================================================================
--- (empty file)
+++ trunk/gobject/pygenum.h Sun Jul 27 09:00:06 2008
@@ -0,0 +1,27 @@
+/* -*- Mode: C; c-basic-offset: 4 -*-
+ * pygtk- Python bindings for the GTK toolkit.
+ * Copyright (C) 1998-2003 James Henstridge
+ * 2004-2008 Johan Dahlin
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ * USA
+ */
+
+#ifndef __PYGOBJECT_ENUM_H__
+#define __PYGOBJECT_ENUM_H__
+
+void pygobject_enum_register_types(PyObject *d);
+
+#endif /* __PYGOBJECT_ENUM_H__ */
Modified: trunk/gobject/pygflags.c
==============================================================================
--- trunk/gobject/pygflags.c (original)
+++ trunk/gobject/pygflags.c Sun Jul 27 09:00:06 2008
@@ -27,6 +27,9 @@
#include <pyglib.h>
#include "pygobject-private.h"
+#include "pygflags.h"
+
+GQuark pygflags_class_key;
#define GET_INT_VALUE(x) (((PyIntObject*)x)->ob_ival)
@@ -497,3 +500,12 @@
0, /* tp_alloc */
pyg_flags_new, /* tp_new */
};
+
+void
+pygobject_flags_register_types(PyObject *d)
+{
+ pygflags_class_key = g_quark_from_static_string("PyGFlags::class");
+
+ PyGFlags_Type.tp_base = &PyInt_Type;
+ PYGOBJECT_REGISTER_GTYPE(d, PyGFlags_Type, "GFlags", G_TYPE_FLAGS);
+}
Added: trunk/gobject/pygflags.h
==============================================================================
--- (empty file)
+++ trunk/gobject/pygflags.h Sun Jul 27 09:00:06 2008
@@ -0,0 +1,27 @@
+/* -*- Mode: C; c-basic-offset: 4 -*-
+ * pygtk- Python bindings for the GTK toolkit.
+ * Copyright (C) 1998-2003 James Henstridge
+ * 2004-2008 Johan Dahlin
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ * USA
+ */
+
+#ifndef __PYGOBJECT_FLAGS_H__
+#define __PYGOBJECT_FLAGS_H__
+
+void pygobject_flags_register_types(PyObject *d);
+
+#endif /* __PYGOBJECT_FLAGS_H__ */
Modified: trunk/gobject/pygpointer.c
==============================================================================
--- trunk/gobject/pygpointer.c (original)
+++ trunk/gobject/pygpointer.c Sun Jul 27 09:00:06 2008
@@ -26,6 +26,9 @@
#include <pyglib.h>
#include "pygobject-private.h"
+#include "pygpointer.h"
+
+GQuark pygpointer_class_key;
static void
pyg_pointer_dealloc(PyGPointer *self)
@@ -209,3 +212,12 @@
return (PyObject *)self;
}
+
+void
+pygobject_pointer_register_types(PyObject *d)
+{
+ pygpointer_class_key = g_quark_from_static_string("PyGPointer::class");
+
+ PYGOBJECT_REGISTER_GTYPE(d, PyGPointer_Type, "GPointer", G_TYPE_POINTER);
+
+}
Added: trunk/gobject/pygpointer.h
==============================================================================
--- (empty file)
+++ trunk/gobject/pygpointer.h Sun Jul 27 09:00:06 2008
@@ -0,0 +1,27 @@
+/* -*- Mode: C; c-basic-offset: 4 -*-
+ * pygtk- Python bindings for the GTK toolkit.
+ * Copyright (C) 1998-2003 James Henstridge
+ * 2004-2008 Johan Dahlin
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ * USA
+ */
+
+#ifndef __PYGOBJECT_POINTER_H__
+#define __PYGOBJECT_POINTER_H__
+
+void pygobject_pointer_register_types(PyObject *d);
+
+#endif /* __PYGOBJECT_POINTER_H__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]