| 1 |
/* -*- Mode: C; c-basic-offset: 4 -*- |
| 2 |
* vim: tabstop=4 shiftwidth=4 expandtab |
| 3 |
* |
| 4 |
* Copyright (C) 2009 Simon van der Linden <[email protected]> |
| 5 |
* Copyright (C) 2010 Tomeu Vizoso <[email protected]> |
| 6 |
* Copyright (C) 2012 Bastian Winkler <[email protected]> |
| 7 |
* |
| 8 |
* This library is free software; you can redistribute it and/or |
| 9 |
* modify it under the terms of the GNU Lesser General Public |
| 10 |
* License as published by the Free Software Foundation; either |
| 11 |
* version 2.1 of the License, or (at your option) any later version. |
| 12 |
* |
| 13 |
* This library is distributed in the hope that it will be useful, |
| 14 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 16 |
* Lesser General Public License for more details. |
| 17 |
* |
| 18 |
* You should have received a copy of the GNU Lesser General Public |
| 19 |
* License along with this library; if not, write to the Free Software |
| 20 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 |
| 21 |
* USA |
| 22 |
*/ |
| 23 |
|
| 24 |
#ifndef __PYGI_FUNDAMENTAL_H__ |
| 25 |
#define __PYGI_FUNDAMENTAL_H__ |
| 26 |
|
| 27 |
#include <girepository/girepository.h> |
| 28 |
|
| 29 |
#include "pygpointer.h" |
| 30 |
#include "pygi-type.h" |
| 31 |
|
| 32 |
G_BEGIN_DECLS |
| 33 |
|
| 34 |
extern PyTypeObject PyGIFundamental_Type; |
| 35 |
|
| 36 |
typedef struct { |
| 37 |
PyObject_HEAD |
| 38 |
PyObject *weaklist; |
| 39 |
gpointer instance; |
| 40 |
GType gtype; |
| 41 |
GIObjectInfoRefFunction ref_func; |
| 42 |
GIObjectInfoUnrefFunction unref_func; |
| 43 |
} PyGIFundamental; |
| 44 |
|
| 45 |
|
| 46 |
PyObject *pygi_fundamental_new (gpointer instance); |
| 47 |
|
| 48 |
void pygi_fundamental_ref (PyGIFundamental *self); |
| 49 |
void pygi_fundamental_unref (PyGIFundamental *self); |
| 50 |
|
| 51 |
GTypeInstance *pygi_fundamental_get (PyObject *self); |
| 52 |
|
| 53 |
int pygi_fundamental_register_types (PyObject *m); |
| 54 |
|
| 55 |
#define pygi_check_fundamental(info) \ |
| 56 |
(GI_IS_OBJECT_INFO (info) \ |
| 57 |
&& gi_object_info_get_fundamental ((GIObjectInfo *)(info))) |
| 58 |
|
| 59 |
GTypeInstance *pygi_fundamental_from_value (const GValue *value); |
| 60 |
|
| 61 |
gboolean pygi_fundamental_set_value (GValue *value, GTypeInstance *instance); |
| 62 |
|
| 63 |
#endif /* __PYGI_FUNDAMENTAL_H__ */ |