pidgin 2.14.14dev
eventloop.h
Go to the documentation of this file.
1
6/* purple
7 *
8 * Purple is the legal property of its developers, whose names are too numerous
9 * to list here. Please refer to the COPYRIGHT file distributed with this
10 * source distribution.
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
25 */
26#ifndef _PURPLE_EVENTLOOP_H_
27#define _PURPLE_EVENTLOOP_H_
28
29#include <glib.h>
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
38typedef enum
39{
41 PURPLE_INPUT_WRITE = 1 << 1
44
50typedef void (*PurpleInputFunction)(gpointer, gint, PurpleInputCondition);
51
54
61{
85 guint (*timeout_add)(guint interval, GSourceFunc function, gpointer data);
86
95 gboolean (*timeout_remove)(guint handle);
96
112 guint (*input_add)(int fd, PurpleInputCondition cond,
113 PurpleInputFunction func, gpointer user_data);
114
121 gboolean (*input_remove)(guint handle);
122
123
134 int (*input_get_error)(int fd, int *error);
135
150 guint (*timeout_add_seconds)(guint interval, GSourceFunc function,
151 gpointer data);
152
153 void (*_purple_reserved2)(void);
154 void (*_purple_reserved3)(void);
155 void (*_purple_reserved4)(void);
156};
157
158/**************************************************************************/
160/**************************************************************************/
178guint purple_timeout_add(guint interval, GSourceFunc function, gpointer data);
179
198guint purple_timeout_add_seconds(guint interval, GSourceFunc function, gpointer data);
199
207gboolean purple_timeout_remove(guint handle);
208
221 PurpleInputFunction func, gpointer user_data);
222
229gboolean purple_input_remove(guint handle);
230
245int
246purple_input_get_error(int fd, int *error);
247
248
252/**************************************************************************/
254/**************************************************************************/
262
269
272#ifdef __cplusplus
273}
274#endif
275
276#endif /* _PURPLE_EVENTLOOP_H_ */
PurpleEventLoopUiOps * purple_eventloop_get_ui_ops(void)
Returns the UI operations structure used for accounts.
guint purple_timeout_add_seconds(guint interval, GSourceFunc function, gpointer data)
Creates a callback timer.
void purple_eventloop_set_ui_ops(PurpleEventLoopUiOps *ops)
Sets the UI operations structure to be used for accounts.
gboolean purple_timeout_remove(guint handle)
Removes a timeout handler.
void(* PurpleInputFunction)(gpointer, gint, PurpleInputCondition)
The type of callbacks to handle events on file descriptors, as passed to purple_input_add().
Definition: eventloop.h:50
int purple_input_get_error(int fd, int *error)
Get the current error status for an input.
guint purple_timeout_add(guint interval, GSourceFunc function, gpointer data)
Creates a callback timer.
PurpleInputCondition
An input condition.
Definition: eventloop.h:39
@ PURPLE_INPUT_WRITE
A write condition.
Definition: eventloop.h:41
@ PURPLE_INPUT_READ
A read condition.
Definition: eventloop.h:40
guint purple_input_add(int fd, PurpleInputCondition cond, PurpleInputFunction func, gpointer user_data)
Adds an input handler.
gboolean purple_input_remove(guint handle)
Removes an input handler.
An abstraction of an application's mainloop; libpurple will use this to watch file descriptors and sc...
Definition: eventloop.h:61
guint(* timeout_add_seconds)(guint interval, GSourceFunc function, gpointer data)
If implemented, should create a callback timer with an interval measured in seconds.
Definition: eventloop.h:150
int(* input_get_error)(int fd, int *error)
If implemented, should get the current error status for an input.
Definition: eventloop.h:134
gboolean(* timeout_remove)(guint handle)
Should remove a callback timer.
Definition: eventloop.h:95
guint(* timeout_add)(guint interval, GSourceFunc function, gpointer data)
Should create a callback timer with an interval measured in milliseconds.
Definition: eventloop.h:85
gboolean(* input_remove)(guint handle)
Should remove an input handler.
Definition: eventloop.h:121
guint(* input_add)(int fd, PurpleInputCondition cond, PurpleInputFunction func, gpointer user_data)
Should add an input handler.
Definition: eventloop.h:112