Mercurial > pidgin.yaz
comparison libpurple/eventloop.h @ 18008:f22986db6e70
Wire everything up and document it.
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Sun, 20 May 2007 13:56:28 +0000 |
parents | f2d8658b3a86 |
children | 58e82c3b697e |
comparison
equal
deleted
inserted
replaced
18007:a8b4444f2515 | 18008:f22986db6e70 |
---|---|
52 * @see g_timeout_add, purple_timeout_add | 52 * @see g_timeout_add, purple_timeout_add |
53 **/ | 53 **/ |
54 guint (*timeout_add)(guint interval, GSourceFunc function, gpointer data); | 54 guint (*timeout_add)(guint interval, GSourceFunc function, gpointer data); |
55 | 55 |
56 /** | 56 /** |
57 * Creates a callback timer with an interval measured in seconds. | |
58 * @see g_timeout_add_seconds, purple_timeout_add_seconds | |
59 **/ | |
60 guint (*timeout_add_seconds)(guint interval, GSourceFunc function, gpointer data); | |
61 | |
62 /** | |
63 * Removes a callback timer. | 57 * Removes a callback timer. |
64 * @see purple_timeout_remove, g_source_remove | 58 * @see purple_timeout_remove, g_source_remove |
65 */ | 59 */ |
66 gboolean (*timeout_remove)(guint handle); | 60 gboolean (*timeout_remove)(guint handle); |
67 | 61 |
85 * or event loop needs to customize determination of socket error status. | 79 * or event loop needs to customize determination of socket error status. |
86 * @see purple_input_get_error, getsockopt | 80 * @see purple_input_get_error, getsockopt |
87 */ | 81 */ |
88 int (*input_get_error)(int fd, int *error); | 82 int (*input_get_error)(int fd, int *error); |
89 | 83 |
90 void (*_purple_reserved1)(void); | 84 /** |
85 * Creates a callback timer with an interval measured in seconds. | |
86 * | |
87 * This allows UIs to group timers for better power efficiency. For | |
88 * this reason, @a interval may be rounded by up to a second. | |
89 * | |
90 * Implementation of this UI op is optional. If it's not implemented, | |
91 * calls to purple_timeout_add_seconds() will be serviced by the | |
92 * timeout_add UI op. | |
93 * | |
94 * @see g_timeout_add_seconds, purple_timeout_add_seconds() | |
95 **/ | |
96 guint (*timeout_add_seconds)(guint interval, GSourceFunc function, gpointer data); | |
97 | |
91 void (*_purple_reserved2)(void); | 98 void (*_purple_reserved2)(void); |
92 void (*_purple_reserved3)(void); | 99 void (*_purple_reserved3)(void); |
93 void (*_purple_reserved4)(void); | 100 void (*_purple_reserved4)(void); |
94 }; | 101 }; |
95 | 102 |
97 /** @name Event Loop API */ | 104 /** @name Event Loop API */ |
98 /**************************************************************************/ | 105 /**************************************************************************/ |
99 /*@{*/ | 106 /*@{*/ |
100 /** | 107 /** |
101 * Creates a callback timer. | 108 * Creates a callback timer. |
109 * | |
102 * The timer will repeat until the function returns @c FALSE. The | 110 * The timer will repeat until the function returns @c FALSE. The |
103 * first call will be at the end of the first interval. | 111 * first call will be at the end of the first interval. |
112 * | |
113 * If the timer is in a multiple of seconds, use purple_timeout_add_seconds() | |
114 * instead as it allows UIs to group timers for power efficiency. | |
115 * | |
104 * @param interval The time between calls of the function, in | 116 * @param interval The time between calls of the function, in |
105 * milliseconds. | 117 * milliseconds. |
106 * @param function The function to call. | 118 * @param function The function to call. |
107 * @param data data to pass to @a function. | 119 * @param data data to pass to @a function. |
108 * @return A handle to the timer which can be passed to | 120 * @return A handle to the timer which can be passed to |
109 * purple_timeout_remove to remove the timer. | 121 * purple_timeout_remove to remove the timer. |
110 */ | 122 */ |
111 guint purple_timeout_add(guint interval, GSourceFunc function, gpointer data); | 123 guint purple_timeout_add(guint interval, GSourceFunc function, gpointer data); |
112 | 124 |
113 /** | 125 /** |
126 * Creates a callback timer. | |
127 * | |
128 * The timer will repeat until the function returns @c FALSE. The | |
129 * first call will be at the end of the first interval. | |
130 * | |
131 * This function allows UIs to group timers for better power efficiency. For | |
132 * this reason, @a interval may be rounded by up to a second. | |
133 * | |
134 * @param interval The time between calls of the function, in | |
135 * seconds. | |
136 * @param function The function to call. | |
137 * @param data data to pass to @a function. | |
138 * @return A handle to the timer which can be passed to | |
139 * purple_timeout_remove to remove the timer. | |
140 */ | |
141 guint purple_timeout_add(guint interval, GSourceFunc function, gpointer data); | |
142 | |
143 /** | |
114 * Removes a timeout handler. | 144 * Removes a timeout handler. |
115 * | 145 * |
116 * @param handle The handle, as returned by purple_timeout_add. | 146 * @param handle The handle, as returned by purple_timeout_add. |
117 * | 147 * |
118 * @return Something. | 148 * @return Something. |