pidgin/gtkutils.h

branch
soc.2013.gobjectification.plugins
changeset 37021
04c99b24db84
parent 37017
8e2b68c79fa1
child 37023
d9bcdc9a91e6
equal deleted inserted replaced
37020:03730619fbac 37021:04c99b24db84
89 /** 89 /**
90 * Create an GtkWebView widget and associated GtkWebViewToolbar widget. This 90 * Create an GtkWebView widget and associated GtkWebViewToolbar widget. This
91 * function puts both widgets in a nice GtkFrame. They're separated by an 91 * function puts both widgets in a nice GtkFrame. They're separated by an
92 * attractive GtkSeparator. 92 * attractive GtkSeparator.
93 * 93 *
94 * @editable: @c TRUE if this webview should be editable. If this is 94 * @editable: %TRUE if this webview should be editable. If this is
95 * @c FALSE, then the toolbar will NOT be created. If this webview 95 * %FALSE, then the toolbar will NOT be created. If this webview
96 * should be read-only at first, but may become editable later, then 96 * should be read-only at first, but may become editable later, then
97 * pass in @c TRUE here and then manually call gtk_webview_set_editable() 97 * pass in %TRUE here and then manually call gtk_webview_set_editable()
98 * later. 98 * later.
99 * @webview_ret: A pointer to a pointer to a GtkWidget. This pointer 99 * @webview_ret: A pointer to a pointer to a GtkWidget. This pointer
100 * will be set to the webview when this function exits. 100 * will be set to the webview when this function exits.
101 * @sw_ret: This will be filled with a pointer to the scrolled window 101 * @sw_ret: This will be filled with a pointer to the scrolled window
102 * widget which contains the webview. 102 * widget which contains the webview.
115 GtkWidget *pidgin_create_small_button(GtkWidget *image); 115 GtkWidget *pidgin_create_small_button(GtkWidget *image);
116 116
117 /** 117 /**
118 * Creates a new window 118 * Creates a new window
119 * 119 *
120 * @title: The window title, or @c NULL 120 * @title: The window title, or %NULL
121 * @border_width: The window's desired border width 121 * @border_width: The window's desired border width
122 * @role: A string indicating what the window is responsible for doing, or @c NULL 122 * @role: A string indicating what the window is responsible for doing, or %NULL
123 * @resizable: Whether the window should be resizable (@c TRUE) or not (@c FALSE) 123 * @resizable: Whether the window should be resizable (%TRUE) or not (%FALSE)
124 */ 124 */
125 GtkWidget *pidgin_create_window(const char *title, guint border_width, const char *role, gboolean resizable); 125 GtkWidget *pidgin_create_window(const char *title, guint border_width, const char *role, gboolean resizable);
126 126
127 /** 127 /**
128 * Creates a new dialog window 128 * Creates a new dialog window
129 * 129 *
130 * @title: The window title, or @c NULL 130 * @title: The window title, or %NULL
131 * @border_width: The window's desired border width 131 * @border_width: The window's desired border width
132 * @role: A string indicating what the window is responsible for doing, or @c NULL 132 * @role: A string indicating what the window is responsible for doing, or %NULL
133 * @resizable: Whether the window should be resizable (@c TRUE) or not (@c FALSE) 133 * @resizable: Whether the window should be resizable (%TRUE) or not (%FALSE)
134 */ 134 */
135 GtkWidget *pidgin_create_dialog(const char *title, guint border_width, const char *role, gboolean resizable); 135 GtkWidget *pidgin_create_dialog(const char *title, guint border_width, const char *role, gboolean resizable);
136 136
137 /** 137 /**
138 * Retrieves the main content box (vbox) from a pidgin dialog window 138 * Retrieves the main content box (vbox) from a pidgin dialog window
171 GtkWidget *pidgin_dialog_get_action_area(GtkDialog *dialog); 171 GtkWidget *pidgin_dialog_get_action_area(GtkDialog *dialog);
172 172
173 /** 173 /**
174 * Toggles the sensitivity of a widget. 174 * Toggles the sensitivity of a widget.
175 * 175 *
176 * @widget: @c NULL. Used for signal handlers. 176 * @widget: %NULL. Used for signal handlers.
177 * @to_toggle: The widget to toggle. 177 * @to_toggle: The widget to toggle.
178 */ 178 */
179 void pidgin_toggle_sensitive(GtkWidget *widget, GtkWidget *to_toggle); 179 void pidgin_toggle_sensitive(GtkWidget *widget, GtkWidget *to_toggle);
180 180
181 /** 181 /**
189 void pidgin_set_sensitive_if_input(GtkWidget *entry, GtkWidget *dialog); 189 void pidgin_set_sensitive_if_input(GtkWidget *entry, GtkWidget *dialog);
190 190
191 /** 191 /**
192 * Toggles the sensitivity of all widgets in a pointer array. 192 * Toggles the sensitivity of all widgets in a pointer array.
193 * 193 *
194 * @param w @c NULL. Used for signal handlers. 194 * @param w %NULL. Used for signal handlers.
195 * @data: The array containing the widgets to toggle. 195 * @data: The array containing the widgets to toggle.
196 */ 196 */
197 void pidgin_toggle_sensitive_array(GtkWidget *w, GPtrArray *data); 197 void pidgin_toggle_sensitive_array(GtkWidget *w, GPtrArray *data);
198 198
199 /** 199 /**
200 * Toggles the visibility of a widget. 200 * Toggles the visibility of a widget.
201 * 201 *
202 * @widget: @c NULL. Used for signal handlers. 202 * @widget: %NULL. Used for signal handlers.
203 * @to_toggle: The widget to toggle. 203 * @to_toggle: The widget to toggle.
204 */ 204 */
205 void pidgin_toggle_showhide(GtkWidget *widget, GtkWidget *to_toggle); 205 void pidgin_toggle_showhide(GtkWidget *widget, GtkWidget *to_toggle);
206 206
207 /** 207 /**
241 * Creates a menu item. 241 * Creates a menu item.
242 * 242 *
243 * @menu: The menu to which to append the menu item. 243 * @menu: The menu to which to append the menu item.
244 * @str: The title for the menu item. 244 * @str: The title for the menu item.
245 * @icon: An icon to place to the left of the menu item, 245 * @icon: An icon to place to the left of the menu item,
246 * or @c NULL for no icon. 246 * or %NULL for no icon.
247 * @cb: A function to call when the menu item is activated. 247 * @cb: A function to call when the menu item is activated.
248 * @data: Data to pass to the signal function. 248 * @data: Data to pass to the signal function.
249 * @accel_key: Something. 249 * @accel_key: Something.
250 * @accel_mods: Something. 250 * @accel_mods: Something.
251 * @mod: Something. 251 * @mod: Something.
348 /** 348 /**
349 * Add autocompletion of screenames to an entry, supporting a filtering function. 349 * Add autocompletion of screenames to an entry, supporting a filtering function.
350 * 350 *
351 * @entry: The GtkEntry on which to setup autocomplete. 351 * @entry: The GtkEntry on which to setup autocomplete.
352 * @optmenu: A menu for accounts, returned by pidgin_account_option_menu_new(). 352 * @optmenu: A menu for accounts, returned by pidgin_account_option_menu_new().
353 * If @a optmenu is not @c NULL, it'll be updated when a username is chosen 353 * If @a optmenu is not %NULL, it'll be updated when a username is chosen
354 * from the autocomplete list. 354 * from the autocomplete list.
355 * @filter_func: A function for checking if an autocomplete entry 355 * @filter_func: A function for checking if an autocomplete entry
356 * should be shown. This can be @c NULL. 356 * should be shown. This can be %NULL.
357 * @user_data: The data to be passed to the filter_func function. 357 * @user_data: The data to be passed to the filter_func function.
358 */ 358 */
359 void pidgin_setup_screenname_autocomplete(GtkWidget *entry, GtkWidget *optmenu, PidginFilterBuddyCompletionEntryFunc filter_func, gpointer user_data); 359 void pidgin_setup_screenname_autocomplete(GtkWidget *entry, GtkWidget *optmenu, PidginFilterBuddyCompletionEntryFunc filter_func, gpointer user_data);
360 360
361 /** 361 /**
362 * The default filter function for username autocomplete. 362 * The default filter function for username autocomplete.
363 * 363 *
364 * @completion_entry: The completion entry to filter. 364 * @completion_entry: The completion entry to filter.
365 * @all_accounts: If this is @c FALSE, only the autocompletion entries 365 * @all_accounts: If this is %FALSE, only the autocompletion entries
366 * which belong to an online account will be filtered. 366 * which belong to an online account will be filtered.
367 * Returns: Returns @c TRUE if the autocompletion entry is filtered. 367 * Returns: Returns %TRUE if the autocompletion entry is filtered.
368 */ 368 */
369 gboolean pidgin_screenname_autocomplete_default_filter(const PidginBuddyCompletionEntry *completion_entry, gpointer all_accounts); 369 gboolean pidgin_screenname_autocomplete_default_filter(const PidginBuddyCompletionEntry *completion_entry, gpointer all_accounts);
370 370
371 /** 371 /**
372 * Sets up GtkSpell for the given GtkTextView, reporting errors 372 * Sets up GtkSpell for the given GtkTextView, reporting errors
560 * Sets the mouse pointer for a GtkWidget. 560 * Sets the mouse pointer for a GtkWidget.
561 * 561 *
562 * After setting the cursor, the display is flushed, so the change will 562 * After setting the cursor, the display is flushed, so the change will
563 * take effect immediately. 563 * take effect immediately.
564 * 564 *
565 * If the window for @a widget is @c NULL, this function simply returns. 565 * If the window for @a widget is %NULL, this function simply returns.
566 * 566 *
567 * @widget: The widget for which to set the mouse pointer 567 * @widget: The widget for which to set the mouse pointer
568 * @cursor_type: The type of cursor to set 568 * @cursor_type: The type of cursor to set
569 */ 569 */
570 void pidgin_set_cursor(GtkWidget *widget, GdkCursorType cursor_type); 570 void pidgin_set_cursor(GtkWidget *widget, GdkCursorType cursor_type);
571 571
572 /** 572 /**
573 * Sets the mouse point for a GtkWidget back to that of its parent window. 573 * Sets the mouse point for a GtkWidget back to that of its parent window.
574 * 574 *
575 * If @a widget is @c NULL, this function simply returns. 575 * If @a widget is %NULL, this function simply returns.
576 * 576 *
577 * If the window for @a widget is @c NULL, this function simply returns. 577 * If the window for @a widget is %NULL, this function simply returns.
578 * 578 *
579 * @note The display is not flushed from this function. 579 * Note: The display is not flushed from this function.
580 */ 580 */
581 void pidgin_clear_cursor(GtkWidget *widget); 581 void pidgin_clear_cursor(GtkWidget *widget);
582 582
583 /** 583 /**
584 * Creates a File Selection widget for choosing a buddy icon 584 * Creates a File Selection widget for choosing a buddy icon
593 /** 593 /**
594 * Converts a buddy icon to the required size and format 594 * Converts a buddy icon to the required size and format
595 * 595 *
596 * @protocol: The protocol to convert the icon 596 * @protocol: The protocol to convert the icon
597 * @path: The path of a file to convert 597 * @path: The path of a file to convert
598 * @len: If not @c NULL, the length of the returned data will be set here. 598 * @len: If not %NULL, the length of the returned data will be set here.
599 * 599 *
600 * Returns: The converted image data, or @c NULL if an error occurred. 600 * Returns: The converted image data, or %NULL if an error occurred.
601 */ 601 */
602 gpointer pidgin_convert_buddy_icon(PurpleProtocol *protocol, const char *path, size_t *len); 602 gpointer pidgin_convert_buddy_icon(PurpleProtocol *protocol, const char *path, size_t *len);
603 603
604 /** 604 /**
605 * Converts "->" and "<-" in strings to Unicode arrow characters, for use in referencing 605 * Converts "->" and "<-" in strings to Unicode arrow characters, for use in referencing
618 /** 618 /**
619 * Creates a #PidginMiniDialog, tied to a #PurpleConnection, suitable for 619 * Creates a #PidginMiniDialog, tied to a #PurpleConnection, suitable for
620 * embedding in the buddy list scrollbook with pidgin_blist_add_alert(). 620 * embedding in the buddy list scrollbook with pidgin_blist_add_alert().
621 * 621 *
622 * @handle: The #PurpleConnection to which this mini-dialog 622 * @handle: The #PurpleConnection to which this mini-dialog
623 * refers, or @c NULL if it does not refer to a 623 * refers, or %NULL if it does not refer to a
624 * connection. If @a handle is supplied, the mini-dialog 624 * connection. If @a handle is supplied, the mini-dialog
625 * will be automatically removed and destroyed when the 625 * will be automatically removed and destroyed when the
626 * connection signs off. 626 * connection signs off.
627 * @stock_id: The ID of a stock image to use in the mini dialog. 627 * @stock_id: The ID of a stock image to use in the mini dialog.
628 * @primary: The primary text 628 * @primary: The primary text
629 * @secondary: The secondary text, or @c NULL for no description. 629 * @secondary: The secondary text, or %NULL for no description.
630 * @user_data: Data to pass to the callbacks 630 * @user_data: Data to pass to the callbacks
631 * @...: a <tt>NULL</tt>-terminated list of button labels 631 * @...: a <tt>NULL</tt>-terminated list of button labels
632 * (<tt>char *</tt>) and callbacks 632 * (<tt>char *</tt>) and callbacks
633 * (#PidginUtilMiniDialogCallback). @a user_data will be 633 * (#PidginUtilMiniDialogCallback). @a user_data will be
634 * passed as the first argument. (Callbacks may lack a 634 * passed as the first argument. (Callbacks may lack a
635 * second argument, or be @c NULL to take no action when 635 * second argument, or be %NULL to take no action when
636 * the corresponding button is pressed.) When a button is 636 * the corresponding button is pressed.) When a button is
637 * pressed, the callback (if any) will be called; when 637 * pressed, the callback (if any) will be called; when
638 * the callback returns the dialog will be destroyed. 638 * the callback returns the dialog will be destroyed.
639 * Returns: A #PidginMiniDialog, suitable for passing to 639 * Returns: A #PidginMiniDialog, suitable for passing to
640 * pidgin_blist_add_alert(). 640 * pidgin_blist_add_alert().
739 739
740 /** 740 /**
741 * Add a labelled widget to a GtkVBox 741 * Add a labelled widget to a GtkVBox
742 * 742 *
743 * @vbox: The GtkVBox to add the widget to. 743 * @vbox: The GtkVBox to add the widget to.
744 * @widget_label: The label to give the widget, can be @c NULL. 744 * @widget_label: The label to give the widget, can be %NULL.
745 * @sg: The GtkSizeGroup to add the label to, can be @c NULL. 745 * @sg: The GtkSizeGroup to add the label to, can be %NULL.
746 * @widget: The GtkWidget to add. 746 * @widget: The GtkWidget to add.
747 * @expand: Whether to expand the widget horizontally. 747 * @expand: Whether to expand the widget horizontally.
748 * @p_label: Place to store a pointer to the GtkLabel, or @c NULL if you don't care. 748 * @p_label: Place to store a pointer to the GtkLabel, or %NULL if you don't care.
749 * 749 *
750 * Returns: A GtkHBox already added to the GtkVBox containing the GtkLabel and the GtkWidget. 750 * Returns: A GtkHBox already added to the GtkVBox containing the GtkLabel and the GtkWidget.
751 */ 751 */
752 GtkWidget *pidgin_add_widget_to_vbox(GtkBox *vbox, const char *widget_label, GtkSizeGroup *sg, GtkWidget *widget, gboolean expand, GtkWidget **p_label); 752 GtkWidget *pidgin_add_widget_to_vbox(GtkBox *vbox, const char *widget_label, GtkSizeGroup *sg, GtkWidget *widget, gboolean expand, GtkWidget **p_label);
753 753

mercurial