dbus.bus: In watch_name_owner, only watch the desired name!
[dbus-python-phuang.git] / _dbus_bindings / types-internal.h
blob28e934fde675f5ee10acf729457e43c843e93daa
1 /* D-Bus types: implementation internals
3 * Copyright (C) 2006, 2007 Collabora Ltd.
5 * Licensed under the Academic Free License version 2.1
7 * This library is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as published by
9 * the Free Software Foundation; either version 2.1 of the License, or
10 * (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #include <Python.h>
24 #include <stdint.h>
26 #include "dbus_bindings-internal.h"
28 #ifndef DBUS_BINDINGS_TYPES_INTERNAL_H
29 #define DBUS_BINDINGS_TYPES_INTERNAL_H
31 extern PyTypeObject DBusPyIntBase_Type;
32 DEFINE_CHECK(DBusPyIntBase)
34 typedef struct {
35 PyIntObject base;
36 long variant_level;
37 } DBusPyIntBase;
39 extern PyTypeObject DBusPyLongBase_Type;
40 DEFINE_CHECK(DBusPyLongBase)
42 extern PyTypeObject DBusPyFloatBase_Type;
43 DEFINE_CHECK(DBusPyFloatBase)
45 typedef struct {
46 PyFloatObject base;
47 long variant_level;
48 } DBusPyFloatBase;
50 typedef struct {
51 PyUnicodeObject unicode;
52 long variant_level;
53 } DBusPyString;
55 extern PyTypeObject DBusPyStrBase_Type;
56 DEFINE_CHECK(DBusPyStrBase)
58 dbus_int16_t dbus_py_int16_range_check(PyObject *);
59 dbus_uint16_t dbus_py_uint16_range_check(PyObject *);
60 dbus_int32_t dbus_py_int32_range_check(PyObject *);
61 dbus_uint32_t dbus_py_uint32_range_check(PyObject *);
63 #if defined(DBUS_HAVE_INT64) && defined(HAVE_LONG_LONG)
64 # define DBUS_PYTHON_64_BIT_WORKS 1
65 dbus_int64_t dbus_py_int64_range_check(PyObject *);
66 dbus_uint64_t dbus_py_uint64_range_check(PyObject *);
67 #else
68 # undef DBUS_PYTHON_64_BIT_WORKS
69 #endif /* defined(DBUS_HAVE_INT64) && defined(HAVE_LONG_LONG) */
71 extern PyObject *dbus_py_variant_level_const;
72 extern PyObject *dbus_py_signature_const;
73 extern PyObject *dbus_py__dbus_object_path__const;
75 typedef struct {
76 PyListObject super;
77 PyObject *signature;
78 long variant_level;
79 } DBusPyArray;
81 typedef struct {
82 PyDictObject super;
83 PyObject *signature;
84 long variant_level;
85 } DBusPyDict;
87 PyObject *dbus_py_variant_level_getattro(PyObject *obj, PyObject *name);
88 dbus_bool_t dbus_py_variant_level_set(PyObject *obj, long variant_level);
89 void dbus_py_variant_level_clear(PyObject *obj);
90 long dbus_py_variant_level_get(PyObject *obj);
92 #endif