# DBus-C++

## Desktop Communication Bus System

libdbus-c-- Documentation 0.9.0

- Files
- Data Structures
- Globals
- Main Page

glib-integration.h
Go to the documentation of this file.
1/*
2 *
3 * D-Bus++ - C++ bindings for D-Bus
4 *
5 * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com>
6 *
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 */
23
24
25#ifndef __DBUSXX_GLIB_INTEGRATION_H
26#define __DBUSXX_GLIB_INTEGRATION_H
27
28#include <glib.h>
29
30#include "api.h"
31#include "dispatcher.h"
32
33 namespace DBus
34{
35
36 namespace Glib
37{
38
39 class BusDispatcher;
40
41 class DXXAPI BusTimeout : public Timeout
42{
43 private:
44
45 BusTimeout(Timeout::Internal *, GMainContext *, int);
46
47 ~BusTimeout();
48
49 void toggle();
50
51 static gboolean timeout_handler(gpointer);
52
53 void _enable();
54
55 void _disable();
56
57 private:
58
59 GMainContext *_ctx;
60 int _priority;
61 GSource *_source;
62
63 friend class BusDispatcher;
64};
65
66 class DXXAPI BusWatch : public Watch
67{
68 private:
69
70 BusWatch(Watch::Internal *, GMainContext *, int);
71
72 ~BusWatch();
73
74 void toggle();
75
76 static gboolean watch_handler(gpointer);
77
78 void _enable();
79
80 void _disable();
81
82 private:
83
84 GMainContext *_ctx;
85 int _priority;
86 GSource *_source;
87
88 friend class BusDispatcher;
89};
90
91 class DXXAPI BusDispatcher : public Dispatcher
92{
93 public:
94
95 BusDispatcher();
96 ~BusDispatcher();
97
98 void attach(GMainContext *);
99
100 void enter() {}
101
102 void leave() {}
103
104 Timeout *add_timeout(Timeout::Internal *);
105
106 void rem_timeout(Timeout *);
107
108 Watch *add_watch(Watch::Internal *);
109
110 void rem_watch(Watch *);
111
112 void set_priority(int priority);
113
114 private:
115
116 GMainContext *_ctx;
117 int _priority;
118 GSource *_source;
119};
120
121} /* namespace Glib */
122
123} /* namespace DBus */
124
125#endif//__DBUSXX_GLIB_INTEGRATION_H
api.h
DXXAPI
#define DXXAPI
Definition api.h:36
DBus::Dispatcher
Definition dispatcher.h:152
DBus::Glib::BusDispatcher
Definition glib-integration.h:92
DBus::Glib::BusDispatcher::_source
GSource * _source
Definition glib-integration.h:118
DBus::Glib::BusDispatcher::attach
void attach(GMainContext *)
Definition glib-integration.cpp:265
DBus::Glib::BusDispatcher::enter
void enter()
Definition glib-integration.h:100
DBus::Glib::BusDispatcher::_priority
int _priority
Definition glib-integration.h:117
DBus::Glib::BusDispatcher::_ctx
GMainContext * _ctx
Definition glib-integration.h:116
DBus::Glib::BusDispatcher::leave
void leave()
Definition glib-integration.h:102
DBus::Glib::BusDispatcher::BusDispatcher
BusDispatcher()
Definition glib-integration.cpp:245
DBus::Glib::BusTimeout::_disable
void _disable()
Definition glib-integration.cpp:73
DBus::Glib::BusTimeout::_source
GSource * _source
Definition glib-integration.h:61
DBus::Glib::BusTimeout::_enable
void _enable()
Definition glib-integration.cpp:62
DBus::Glib::BusTimeout::timeout_handler
static gboolean timeout_handler(gpointer)
Definition glib-integration.cpp:53
DBus::Glib::BusTimeout::toggle
void toggle()
Definition glib-integration.cpp:45
DBus::Glib::BusTimeout::_ctx
GMainContext * _ctx
Definition glib-integration.h:59
DBus::Glib::BusTimeout::BusTimeout
BusTimeout(Timeout::Internal *, GMainContext *, int)
Definition glib-integration.cpp:33
DBus::Glib::BusTimeout::BusDispatcher
friend class BusDispatcher
Definition glib-integration.h:63
DBus::Glib::BusTimeout::_priority
int _priority
Definition glib-integration.h:60
DBus::Glib::BusWatch::_priority
int _priority
Definition glib-integration.h:85
DBus::Glib::BusWatch::_source
GSource * _source
Definition glib-integration.h:86
DBus::Glib::BusWatch::_disable
void _disable()
Definition glib-integration.cpp:190
DBus::Glib::BusWatch::_ctx
GMainContext * _ctx
Definition glib-integration.h:84
DBus::Glib::BusWatch::BusWatch
BusWatch(Watch::Internal *, GMainContext *, int)
Definition glib-integration.cpp:120
DBus::Glib::BusWatch::toggle
void toggle()
Definition glib-integration.cpp:132
DBus::Glib::BusWatch::_enable
void _enable()
Definition glib-integration.cpp:161
DBus::Glib::BusWatch::BusDispatcher
friend class BusDispatcher
Definition glib-integration.h:88
DBus::Glib::BusWatch::watch_handler
static gboolean watch_handler(gpointer)
Definition glib-integration.cpp:140
DBus::Timeout
Definition dispatcher.h:36
DBus::Timeout::Timeout
Timeout(Internal *i)
DBus::Watch
Definition dispatcher.h:87
DBus::Watch::Watch
Watch(Internal *i)
dispatcher.h
DBus::Glib
Definition glib-integration.h:37
DBus
Definition connection_p.h:42