1 /* -*- Mode: C; c-basic-offset: 4 -*-
2 * pyglib - Python bindings for GLib toolkit.
3 * Copyright (C) 1998-2003 James Henstridge
4 * 2004-2008 Johan Dahlin
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
27 #include <pyglib-python-compat.h>
31 typedef void (*PyGLibThreadsEnabledFunc) (void);
32 typedef void (*PyGLibThreadBlockFunc) (void);
34 #ifdef DISABLE_THREADING
35 # define pyglib_gil_state_ensure() PyGILState_LOCKED
36 # define pyglib_gil_state_release(state) state
38 # define pyglib_gil_state_ensure PyGILState_Ensure
39 # define pyglib_gil_state_release PyGILState_Release
42 GOptionGroup * pyglib_option_group_transfer_group(PyObject *self);
44 /* Private: for gobject <-> glib interaction only. */
45 PyObject* _pyglib_generic_ptr_richcompare(void* a, void *b, int op);
46 PyObject* _pyglib_generic_long_richcompare(long a, long b, int op);
49 #define PYGLIB_REGISTER_TYPE(d, type, name) \
51 type.tp_alloc = PyType_GenericAlloc; \
53 type.tp_new = PyType_GenericNew; \
54 if (PyType_Ready(&type)) \
56 PyDict_SetItemString(d, name, (PyObject *)&type);
58 gboolean _pyglib_handler_marshal(gpointer user_data);
59 void _pyglib_destroy_notify(gpointer user_data);
61 extern PyObject *pyglib__glib_module_create (void);
65 #endif /* __PYGLIB_H__ */