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/>.
29 typedef void (*PyGLibThreadsEnabledFunc) (void);
30 typedef void (*PyGLibThreadBlockFunc) (void);
32 #ifdef DISABLE_THREADING
33 # define pyglib_gil_state_ensure() PyGILState_LOCKED
34 # define pyglib_gil_state_release(state) state
36 # define pyglib_gil_state_ensure PyGILState_Ensure
37 # define pyglib_gil_state_release PyGILState_Release
40 GOptionGroup * pyglib_option_group_transfer_group(PyObject *self);
42 /* Private: for gobject <-> glib interaction only. */
43 PyObject* _pyglib_generic_ptr_richcompare(void* a, void *b, int op);
44 PyObject* _pyglib_generic_long_richcompare(long a, long b, int op);
47 #define PYGLIB_REGISTER_TYPE(d, type, name) \
49 type.tp_alloc = PyType_GenericAlloc; \
51 type.tp_new = PyType_GenericNew; \
52 if (PyType_Ready(&type)) \
54 PyDict_SetItemString(d, name, (PyObject *)&type);
59 #endif /* __PYGLIB_H__ */