/** @girskip * Adds a GLib main loop timeout callback that will be removed when unloading the plugin, * preventing it to run after the plugin has been unloaded (which may lead to a segfault). * * @param plugin Must be @ref geany_plugin. * @param interval The time between calls to the function, in seconds. * @param function The function to call after the given timeout. * @param data The user data passed to the function. * @return the ID of the event source (you generally won't need it, or better use * g_timeout_add_seconds() directly if you want to manage this event source manually). * * @see g_timeout_add_seconds() * @since 0.21, plugin API 205. */ GEANY_API_SYMBOL guint plugin_timeout_add_seconds(GeanyPlugin *plugin, guint interval, GSourceFunc function, gpointer data) { return plugin_source_add(plugin, g_timeout_source_new_seconds(interval), function, data); }
/** @girskip * Adds a GLib main loop IDLE callback that will be removed when unloading the plugin, preventing * it to run after the plugin has been unloaded (which may lead to a segfault). * * @param plugin Must be @ref geany_plugin. * @param function The function to call in IDLE time. * @param data The user data passed to the function. * @return the ID of the event source (you generally won't need it, or better use g_idle_add() * directly if you want to manage this event source manually). * * @see g_idle_add() * @since 0.21, plugin API 205. */ GEANY_API_SYMBOL guint plugin_idle_add(GeanyPlugin *plugin, GSourceFunc function, gpointer data) { return plugin_source_add(plugin, g_idle_source_new(), function, data); }
/** Adds a GLib main loop timeout callback that will be removed when unloading the plugin, * preventing it to run after the plugin has been unloaded (which may lead to a segfault). * * @param plugin Must be @ref geany_plugin. * @param interval The time between calls to the function, in milliseconds. * @param function The function to call after the given timeout. * @param data The user data passed to the function. * @return the ID of the event source (you generally won't need it, or better use g_timeout_add() * directly if you want to manage this event source manually). * * @see g_timeout_add() * @since 0.21, plugin API 205. */ guint plugin_timeout_add(GeanyPlugin *plugin, guint interval, GSourceFunc function, gpointer data) { return plugin_source_add(plugin, g_timeout_source_new(interval), function, data); }