comparison libpurple/eventloop.h @ 20453:69febfa6d307

propagate from branch 'im.pidgin.pidgin' (head d3e5a5add3f39caa08b46c83177328e51c2d961a) to branch 'im.pidgin.cpw.khc.msnp14' (head a8f6c999b039b4097aa70cd8d2597f3127615435)
author Carlos Silva <typ0@pidgin.im>
date Sat, 16 Jun 2007 04:00:32 +0000
parents 58e82c3b697e
children 44b4e8bd759b
comparison
equal deleted inserted replaced
20452:5c34a0a3c362 20453:69febfa6d307
46 typedef struct _PurpleEventLoopUiOps PurpleEventLoopUiOps; 46 typedef struct _PurpleEventLoopUiOps PurpleEventLoopUiOps;
47 47
48 struct _PurpleEventLoopUiOps 48 struct _PurpleEventLoopUiOps
49 { 49 {
50 /** 50 /**
51 * Creates a callback timer. 51 * Creates a callback timer with an interval measured in milliseconds.
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 /**
79 * or event loop needs to customize determination of socket error status. 79 * or event loop needs to customize determination of socket error status.
80 * @see purple_input_get_error, getsockopt 80 * @see purple_input_get_error, getsockopt
81 */ 81 */
82 int (*input_get_error)(int fd, int *error); 82 int (*input_get_error)(int fd, int *error);
83 83
84 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
85 void (*_purple_reserved2)(void); 98 void (*_purple_reserved2)(void);
86 void (*_purple_reserved3)(void); 99 void (*_purple_reserved3)(void);
87 void (*_purple_reserved4)(void); 100 void (*_purple_reserved4)(void);
88 }; 101 };
89 102
91 /** @name Event Loop API */ 104 /** @name Event Loop API */
92 /**************************************************************************/ 105 /**************************************************************************/
93 /*@{*/ 106 /*@{*/
94 /** 107 /**
95 * Creates a callback timer. 108 * Creates a callback timer.
109 *
96 * The timer will repeat until the function returns @c FALSE. The 110 * The timer will repeat until the function returns @c FALSE. The
97 * 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 *
98 * @param interval The time between calls of the function, in 116 * @param interval The time between calls of the function, in
99 * milliseconds. 117 * milliseconds.
100 * @param function The function to call. 118 * @param function The function to call.
101 * @param data data to pass to @a function. 119 * @param data data to pass to @a function.
102 * @return A handle to the timer which can be passed to 120 * @return A handle to the timer which can be passed to
103 * purple_timeout_remove to remove the timer. 121 * purple_timeout_remove to remove the timer.
104 */ 122 */
105 guint purple_timeout_add(guint interval, GSourceFunc function, gpointer data); 123 guint purple_timeout_add(guint interval, GSourceFunc function, gpointer data);
106 124
107 /** 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_seconds(guint interval, GSourceFunc function, gpointer data);
142
143 /**
108 * Removes a timeout handler. 144 * Removes a timeout handler.
109 * 145 *
110 * @param handle The handle, as returned by purple_timeout_add. 146 * @param handle The handle, as returned by purple_timeout_add.
111 * 147 *
112 * @return Something. 148 * @return Something.