st-handler-api.h
来自「linux下网络收音机的源码」· C头文件 代码 · 共 734 行 · 第 1/2 页
H
734 行
* @err: a location to store errors. * * Specifies the type of function to bind to * #ST_HANDLER_EVENT_STREAM_RECORD. * * The function will be called when the user records @stream, and * should perform the action needed to record @stream. * * Return value: the function should return %FALSE if there was an * error, or if the task was cancelled by the user. Additionally, if * there was an error, @err must be set. **/typedef gboolean (*STStreamRecordCallback) (STStream *stream, gpointer data, GError **err);/** * STStreamBrowseCallback: * @stream: a stream. * @data: data passed to st_handler_bind(). * @err: a location to store errors. * * Specifies the type of function to bind to * #ST_HANDLER_EVENT_STREAM_BROWSE. * * The function will be called when the user browses the web page of * @stream, and should perform the action needed to browse the web * page of @stream. * * Return value: the function should return %FALSE if there was an * error, or if the task was cancelled by the user. Additionally, if * there was an error, @err must be set. **/typedef gboolean (*STStreamBrowseCallback) (STStream *stream, gpointer data, GError **err);/** * STThreadBeginCallback: * @data: data passed to st_handler_bind(). * * Specifies the type of function to bind to * #ST_HANDLER_EVENT_THREAD_BEGIN. * * The function will be called after a new thread of execution has * been spawned. * * Return value: the returned value will be passed to * STThreadEndCallback() when the thread is about to exit. **/typedef gpointer (*STThreadBeginCallback) (gpointer data);/** * STThreadEndCallback: * @thread_data: data returned by STThreadBeginCallback(). * @data: data passed to st_handler_bind(). * * Specifies the type of function to bind to * #ST_HANDLER_EVENT_THREAD_END. * * The function will be called when a thread of execution is about to * exit. **/typedef void (*STThreadEndCallback) (gpointer thread_data, gpointer data);/** * STStreamTuneInMultipleCallback: * @streams: a list of #STStream streams. * @data: data passed to st_handler_bind(). * @err: a location to store errors. * * Specifies the type of function to bind to * #ST_HANDLER_EVENT_STREAM_TUNE_IN_MULTIPLE. * * The function will be called when the user tunes into @streams, and * should perform the action needed to tune into @streams. * * Return value: the function should return %FALSE if there was an * error, or if the task was cancelled by the user. Additionally, if * there was an error, @err must be set. **/typedef gboolean (*STStreamTuneInMultipleCallback)(GSList *streams, gpointer data, GError **err);/** * STStreamStockFieldGetCallback: * @stream: a stream. * @stock_field: a stock field to get the value of. * @value: a value (initialized to the type of @stock_field) to store * the stock field value in. * @data: data passed to st_handler_bind(). * * Specifies the type of function to bind to * #ST_HANDLER_EVENT_STREAM_STOCK_FIELD_GET. * * The function will be called when streamtuner needs to get the value * of a stream stock field. **/typedef void (*STStreamStockFieldGetCallback) (STStream *stream, STHandlerStockField stock_field, GValue *value, gpointer data);/** * STHandlerPreferencesWidgetNewCallback: * @data: data passed to st_handler_bind(). * * Specifies the type of function to bind to * #ST_HANDLER_EVENT_PREFERENCES_WIDGET_NEW. * * If a function is bound to the * #ST_HANDLER_EVENT_PREFERENCES_WIDGET_NEW event, a page containing * the returned widget will be available in the streamtuner * preferences. * * Return value: the function should return a new #GtkWidget. **/typedef GtkWidget* (*STHandlerPreferencesWidgetNewCallback) (gpointer data);GType st_handler_get_type (void);STHandler *st_handler_new (const char *name);STHandler *st_handler_new_from_plugin (STPlugin *plugin);void st_handler_set_label (STHandler *handler, const char *label);void st_handler_set_description (STHandler *handler, const char *description);void st_handler_set_home (STHandler *handler, const char *home);void st_handler_set_icon_from_pixbuf (STHandler *handler, GdkPixbuf *pixbuf);void st_handler_set_stock_categories (STHandler *handler, GNode *categories);void st_handler_set_flags (STHandler *handler, STHandlerFlags flags);void st_handler_set_stream_version (STHandler *handler, int version);void st_handler_add_field (STHandler *handler, STHandlerField *field);void st_handler_bind (STHandler *handler, STHandlerEvent event, gpointer cb, gpointer data);void st_handler_notice (STHandler *handler, const char *format, ...) G_GNUC_PRINTF(2, 3);void st_handler_config_register (STHandler *handler, GParamSpec *pspec);GParamSpec *st_handler_config_lookup (STHandler *handler, const char *key);/** * STHandlerConfigForeachCallback: * @pspec: the param spec of the configuration key. * @value: the value of the configuration key. * @data: data passed to st_handler_config_foreach(). * * Specifies the type of function to pass to * st_handler_config_foreach(). The function will be called for each * key/value pair in the handler configuration database. **/typedef void (*STHandlerConfigForeachCallback) (GParamSpec *pspec, const GValue *value, gpointer data);void st_handler_config_foreach (STHandler *handler, STHandlerConfigForeachCallback cb, gpointer data);void st_handler_config_get_value (STHandler *handler, const char *key, GValue *value);void st_handler_config_set_value (STHandler *handler, const char *key, const GValue *value);/** * st_handler_config_get_boolean: * @handler: a handler. * @key: a G_TYPE_BOOLEAN configuration key previously registered with * st_handler_config_register(). * * Gets a boolean configuration value. * * Return value: the value of @key. **/gboolean st_handler_config_get_boolean (STHandler *handler, const char *key);/** * st_handler_config_set_boolean: * @handler: a handler. * @key: a G_TYPE_BOOLEAN configuration key previously registered with * st_handler_config_register(). * @value: the value to set. * * Sets a boolean configuration value. **/void st_handler_config_set_boolean (STHandler *handler, const char *key, gboolean value);/** * st_handler_config_get_int: * @handler: a handler. * @key: a G_TYPE_INT configuration key previously registered with * st_handler_config_register(). * * Gets a signed integer configuration value. * * Return value: the value of @key. **/int st_handler_config_get_int (STHandler *handler, const char *key);/** * st_handler_config_set_int: * @handler: a handler. * @key: a G_TYPE_INT configuration key previously registered with * st_handler_config_register(). * @value: the value to set. * * Sets a signed integer configuration value. **/void st_handler_config_set_int (STHandler *handler, const char *key, int value);/** * st_handler_config_get_uint: * @handler: a handler. * @key: a G_TYPE_UINT configuration key previously registered with * st_handler_config_register(). * * Gets an unsigned integer configuration value. * * Return value: the value of @key. **/unsigned int st_handler_config_get_uint (STHandler *handler, const char *key);/** * st_handler_config_set_uint: * @handler: a handler. * @key: a G_TYPE_UINT configuration key previously registered with * st_handler_config_register(). * @value: the value to set. * * Sets an unsigned integer configuration value. **/void st_handler_config_set_uint (STHandler *handler, const char *key, unsigned int value);/** * st_handler_config_get_double: * @handler: a handler. * @key: a G_TYPE_DOUBLE configuration key previously registered with * st_handler_config_register(). * * Gets a double configuration value. * * Return value: the value of @key. **/double st_handler_config_get_double (STHandler *handler, const char *key);/** * st_handler_config_set_double: * @handler: a handler. * @key: a G_TYPE_DOUBLE configuration key previously registered with * st_handler_config_register(). * @value: the value to set. * * Sets a double configuration value. **/void st_handler_config_set_double (STHandler *handler, const char *key, double value);/** * st_handler_config_get_string: * @handler: a handler. * @key: a G_TYPE_STRING configuration key previously registered with * st_handler_config_register(). * * Gets a string configuration value. * * Return value: the value of @key. The value should be freed when no * longer needed. **/char *st_handler_config_get_string (STHandler *handler, const char *key);/** * st_handler_config_set_string: * @handler: a handler. * @key: a G_TYPE_STRING configuration key previously registered with * st_handler_config_register(). * @value: the value to set. * * Sets a string configuration value. **/void st_handler_config_set_string (STHandler *handler, const char *key, const char *value);/** * st_handler_config_get_value_array: * @handler: a handler. * @key: a G_TYPE_VALUE_ARRAY configuration key previously registered * with st_handler_config_register(). * * Gets a value array configuration value. * * Return value: the value of @key. The value should be freed with * g_value_array_free() when no longer needed. **/GValueArray *st_handler_config_get_value_array (STHandler *handler, const char *key);/** * st_handler_config_set_value_array: * @handler: a handler. * @key: a G_TYPE_VALUE_ARRAY configuration key previously registered * with st_handler_config_register(). * @value: the value to set. * * Sets a value array configuration value. **/void st_handler_config_set_value_array (STHandler *handler, const char *key, const GValueArray *value);#ifndef ST_DISABLE_DEPRECATEDvoid st_handler_set_copyright (STHandler *handler, const char *copyright);void st_handler_set_info (STHandler *handler, const char *label, const char *copyright);void st_handler_set_icon (STHandler *handler, int size, const guint8 *data);void st_handler_set_icon_from_inline (STHandler *handler, int size, const guint8 *data);gboolean st_handler_set_icon_from_file (STHandler *handler, const char *filename, GError **err);#define ST_HANDLER_EVENT_REFRESH ST_HANDLER_EVENT_RELOAD#define ST_HANDLER_EVENT_REFRESH_MULTIPLE ST_HANDLER_EVENT_RELOAD_MULTIPLE#define N_ST_HANDLER_EVENTS ST_HANDLER_N_EVENTStypedef STHandlerReloadCallback STHandlerRefreshCallback;typedef STHandlerReloadMultipleCallback STHandlerRefreshMultipleCallback;#endif /* ! ST_DISABLE_DEPRECATED */G_END_DECLS#endif /* _ST_HANDLER_API_H */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?