1 #ifndef _PYGTK_PRIVATE_H_
2 #define _PYGTK_PRIVATE_H_
3 
4 #ifdef HAVE_CONFIG_H
5 #include "config.h"
6 #endif
7 
8 #define PYCAIRO_VERSION_HEX ((PYCAIRO_MAJOR_VERSION<<24)|(PYCAIRO_MINOR_VERSION<<16)|(PYCAIRO_MICRO_VERSION<<8))
9 
10 #ifdef _PYGTK_H_
11 #error "don't include pygtk.h and pygtk-private.h together"
12 #endif
13 
14 #define _INSIDE_PYGTK_
15 #include "pygtk.h"
16 #undef WITH_THREAD
17 
18 /* type objects */
19 extern PyTypeObject PyGdkAtom_Type;
20 
21 /* check the type of a PyObject */
22 #define PyGdkAtom_Check(v) ((v)->ob_type == &PyGdkAtom_Type)
23 
24 /* constructors for PyObject wrappers ... */
25 PyObject *PyGdkAtom_New(GdkAtom atom);
26 
27 void pygtk_handler_marshal(gpointer a, PyObject *func, int nargs,GtkArg *args);
28 void pygtk_input_marshal(gpointer a, PyObject *func, int nargs, GtkArg *args);
29 
30 /* private */
31 PyObject    *pygtk_tree_path_to_pyobject(GtkTreePath *path);
32 GtkTreePath *pygtk_tree_path_from_pyobject(PyObject *object);
33 gboolean     pygdk_rectangle_from_pyobject(PyObject *object,
34 					   GdkRectangle *rectangle);
35 
36 GdkAtom pygdk_atom_from_pyobject(PyObject *object);
37 GdkAtom *pygdk_atom_vector_from_sequence(PyObject *sequence, gint *num);
38 PyObject *pygtk_target_list_to_list(GtkTargetList *targets);
39 GtkTargetList *pygtk_target_list_from_sequence(PyObject *py_targets);
40 
41 typedef struct {
42     PyObject *func, *data;
43 } PyGtkCustomNotify;
44 
45 void pygtk_custom_destroy_notify(gpointer user_data);
46 
47 /* helper object for the style helper */
48 typedef struct {
49     PyObject_HEAD
50     GtkStyle *style; /* parent style */
51     enum {STYLE_COLOUR_ARRAY, STYLE_GC_ARRAY, STYLE_PIXMAP_ARRAY} type;
52     gpointer array;
53 } PyGtkStyleHelper_Object;
54 
55 /* helper object for the rc-style helper */
56 typedef struct {
57     PyObject_HEAD
58     GtkRcStyle *rc_style; /* parent style */
59     enum {RC_STYLE_COLOUR_ARRAY, RC_STYLE_STRING_ARRAY} type;
60     gpointer array;
61     GtkRcFlags is_set_flag; /* ignored for RC_STYLE_STRING_ARRAY */
62 } PyGtkRcStyleHelper_Object;
63 
64 PyObject *_pygtk_style_helper_new(GtkStyle *style, int type, gpointer array);
65 PyObject *_pygtk_rc_style_helper_new(GtkRcStyle *rc_style, int type, gpointer array,
66                                      GtkRcFlags is_set_flag);
67 
68 PyObject *_pygtk_tree_model_row_new(GtkTreeModel *model, GtkTreeIter *iter);
69 PyObject *_pygtk_tree_model_row_iter_new(GtkTreeModel *model,
70 					 GtkTreeIter *parent_iter);
71 int       _pygtk_tree_model_set_row(GtkTreeModel *model, GtkTreeIter *iter,
72 				    PyObject *items);
73 int       _pygtk_tree_model_remove_row(GtkTreeModel *model, GtkTreeIter *iter);
74 
75 /* A boxed type for GdkRegion until one gets into gtk+ itself. */
76 #ifdef GDK_TYPE_REGION
77 #define PYGDK_TYPE_REGION  GDK_TYPE_REGION
78 #else
79 GType pygdk_region_get_type (void) G_GNUC_CONST;
80 
81 #define PYGDK_TYPE_REGION (pygdk_region_get_type ())
82 #endif /* GDK_TYPE_REGION */
83 
84 void pygtk_boxed_unref_shared(PyObject *boxed);
85 
86 #endif
87