| 107 * @return The GtkFrame containing the toolbar and imhtml. |
107 * @return The GtkFrame containing the toolbar and imhtml. |
| 108 */ |
108 */ |
| 109 GtkWidget *pidgin_create_imhtml(gboolean editable, GtkWidget **imhtml_ret, GtkWidget **toolbar_ret, GtkWidget **sw_ret); |
109 GtkWidget *pidgin_create_imhtml(gboolean editable, GtkWidget **imhtml_ret, GtkWidget **toolbar_ret, GtkWidget **sw_ret); |
| 110 |
110 |
| 111 /** |
111 /** |
| |
112 * Create an GtkWebView widget and associated GtkIMHtmlToolbar widget. This |
| |
113 * function puts both widgets in a nice GtkFrame. They're separated by an |
| |
114 * attractive GtkSeparator. |
| |
115 * TODO WEBKIT: editable isn't supported yet |
| |
116 * |
| |
117 * @param editable @c TRUE if this webview should be editable. If this is |
| |
118 * @c FALSE, then the toolbar will NOT be created. If this webview |
| |
119 * should be read-only at first, but may become editable later, then |
| |
120 * pass in @c TRUE here and then manually call gtk_webview_set_editable() |
| |
121 * later. |
| |
122 * @param webview_ret A pointer to a pointer to a GtkWidget. This pointer |
| |
123 * will be set to the webview when this function exits. |
| |
124 * @param toolbar_ret A pointer to a pointer to a GtkWidget. If editable is |
| |
125 * TRUE then this will be set to the toolbar when this function exits. |
| |
126 * Otherwise this will be set to @c NULL. |
| |
127 * @param sw_ret This will be filled with a pointer to the scrolled window |
| |
128 * widget which contains the webview. |
| |
129 * |
| |
130 * @return The GtkFrame containing the toolbar and webview. |
| |
131 */ |
| |
132 GtkWidget *pidgin_create_webview(gboolean editable, GtkWidget **webview_ret, GtkWidget **toolbar_ret, GtkWidget **sw_ret); |
| |
133 |
| |
134 /** |
| 112 * Creates a small button |
135 * Creates a small button |
| 113 * |
136 * |
| 114 * @param image A button image. |
137 * @param image A button image. |
| 115 * |
138 * |
| 116 * @return A GtkButton created from the image. |
139 * @return A GtkButton created from the image. |
| 117 * @since 2.7.0 |
|
| 118 */ |
140 */ |
| 119 GtkWidget *pidgin_create_small_button(GtkWidget *image); |
141 GtkWidget *pidgin_create_small_button(GtkWidget *image); |
| 120 |
142 |
| 121 /** |
143 /** |
| 122 * Creates a new window |
144 * Creates a new window |
| 123 * |
145 * |
| 124 * @param title The window title, or @c NULL |
146 * @param title The window title, or @c NULL |
| 125 * @param border_width The window's desired border width |
147 * @param border_width The window's desired border width |
| 126 * @param role A string indicating what the window is responsible for doing, or @c NULL |
148 * @param role A string indicating what the window is responsible for doing, or @c NULL |
| 127 * @param resizable Whether the window should be resizable (@c TRUE) or not (@c FALSE) |
149 * @param resizable Whether the window should be resizable (@c TRUE) or not (@c FALSE) |
| 128 * |
|
| 129 * @since 2.1.0 |
|
| 130 */ |
150 */ |
| 131 GtkWidget *pidgin_create_window(const char *title, guint border_width, const char *role, gboolean resizable); |
151 GtkWidget *pidgin_create_window(const char *title, guint border_width, const char *role, gboolean resizable); |
| 132 |
152 |
| 133 /** |
153 /** |
| 134 * Creates a new dialog window |
154 * Creates a new dialog window |
| 135 * |
155 * |
| 136 * @param title The window title, or @c NULL |
156 * @param title The window title, or @c NULL |
| 137 * @param border_width The window's desired border width |
157 * @param border_width The window's desired border width |
| 138 * @param role A string indicating what the window is responsible for doing, or @c NULL |
158 * @param role A string indicating what the window is responsible for doing, or @c NULL |
| 139 * @param resizable Whether the window should be resizable (@c TRUE) or not (@c FALSE) |
159 * @param resizable Whether the window should be resizable (@c TRUE) or not (@c FALSE) |
| 140 * |
|
| 141 * @since 2.4.0 |
|
| 142 */ |
160 */ |
| 143 GtkWidget *pidgin_create_dialog(const char *title, guint border_width, const char *role, gboolean resizable); |
161 GtkWidget *pidgin_create_dialog(const char *title, guint border_width, const char *role, gboolean resizable); |
| 144 |
162 |
| 145 /** |
163 /** |
| 146 * Retrieves the main content box (vbox) from a pidgin dialog window |
164 * Retrieves the main content box (vbox) from a pidgin dialog window |
| 147 * |
165 * |
| 148 * @param dialog The dialog window |
166 * @param dialog The dialog window |
| 149 * @param homogeneous TRUE if all children are to be given equal space allotments. |
167 * @param homogeneous TRUE if all children are to be given equal space allotments. |
| 150 * @param spacing the number of pixels to place by default between children |
168 * @param spacing the number of pixels to place by default between children |
| 151 * |
|
| 152 * @since 2.4.0 |
|
| 153 */ |
169 */ |
| 154 GtkWidget *pidgin_dialog_get_vbox_with_properties(GtkDialog *dialog, gboolean homogeneous, gint spacing); |
170 GtkWidget *pidgin_dialog_get_vbox_with_properties(GtkDialog *dialog, gboolean homogeneous, gint spacing); |
| 155 |
171 |
| 156 /** |
172 /** |
| 157 * Retrieves the main content box (vbox) from a pidgin dialog window |
173 * Retrieves the main content box (vbox) from a pidgin dialog window |
| 158 * |
174 * |
| 159 * @param dialog The dialog window |
175 * @param dialog The dialog window |
| 160 * |
|
| 161 * @since 2.4.0 |
|
| 162 */ |
176 */ |
| 163 GtkWidget *pidgin_dialog_get_vbox(GtkDialog *dialog); |
177 GtkWidget *pidgin_dialog_get_vbox(GtkDialog *dialog); |
| 164 |
178 |
| 165 /** |
179 /** |
| 166 * Add a button to a dialog created by #pidgin_create_dialog. |
180 * Add a button to a dialog created by #pidgin_create_dialog. |
| 169 * @param label The stock-id or the label for the button |
183 * @param label The stock-id or the label for the button |
| 170 * @param callback The callback function for the button |
184 * @param callback The callback function for the button |
| 171 * @param callbackdata The user data for the callback function |
185 * @param callbackdata The user data for the callback function |
| 172 * |
186 * |
| 173 * @return The created button. |
187 * @return The created button. |
| 174 * @since 2.4.0 |
|
| 175 */ |
188 */ |
| 176 GtkWidget *pidgin_dialog_add_button(GtkDialog *dialog, const char *label, |
189 GtkWidget *pidgin_dialog_add_button(GtkDialog *dialog, const char *label, |
| 177 GCallback callback, gpointer callbackdata); |
190 GCallback callback, gpointer callbackdata); |
| 178 |
191 |
| 179 /** |
192 /** |
| 180 * Retrieves the action area (button box) from a pidgin dialog window |
193 * Retrieves the action area (button box) from a pidgin dialog window |
| 181 * |
194 * |
| 182 * @param dialog The dialog window |
195 * @param dialog The dialog window |
| 183 * |
|
| 184 * @since 2.4.0 |
|
| 185 */ |
196 */ |
| 186 GtkWidget *pidgin_dialog_get_action_area(GtkDialog *dialog); |
197 GtkWidget *pidgin_dialog_get_action_area(GtkDialog *dialog); |
| 187 |
198 |
| 188 /** |
199 /** |
| 189 * Toggles the sensitivity of a widget. |
200 * Toggles the sensitivity of a widget. |
| 382 * @return Returns @c TRUE if the autocompletion entry is filtered. |
393 * @return Returns @c TRUE if the autocompletion entry is filtered. |
| 383 */ |
394 */ |
| 384 gboolean pidgin_screenname_autocomplete_default_filter(const PidginBuddyCompletionEntry *completion_entry, gpointer all_accounts); |
395 gboolean pidgin_screenname_autocomplete_default_filter(const PidginBuddyCompletionEntry *completion_entry, gpointer all_accounts); |
| 385 |
396 |
| 386 /** |
397 /** |
| 387 * Add autocompletion of screenames to an entry. |
|
| 388 * |
|
| 389 * @deprecated |
|
| 390 * For new code, use the equivalent: |
|
| 391 * #pidgin_setup_screenname_autocomplete_with_filter(@a entry, @a optmenu, |
|
| 392 * #pidgin_screenname_autocomplete_default_filter, <tt>GINT_TO_POINTER(@a |
|
| 393 * all)</tt>) |
|
| 394 * |
|
| 395 * @param entry The GtkEntry on which to setup autocomplete. |
|
| 396 * @param optmenu A menu for accounts, returned by |
|
| 397 * pidgin_account_option_menu_new(). If @a optmenu is not @c |
|
| 398 * NULL, it'll be updated when a username is chosen from the |
|
| 399 * autocomplete list. |
|
| 400 * @param all Whether to include usernames from disconnected accounts. |
|
| 401 */ |
|
| 402 void pidgin_setup_screenname_autocomplete(GtkWidget *entry, GtkWidget *optmenu, gboolean all); |
|
| 403 |
|
| 404 /** |
|
| 405 * Check if the given path is a directory or not. If it is, then modify |
|
| 406 * the given GtkFileSelection dialog so that it displays the given path. |
|
| 407 * If the given path is not a directory, then do nothing. |
|
| 408 * |
|
| 409 * @param path The path entered in the file selection window by the user. |
|
| 410 * @param filesel The file selection window. |
|
| 411 * |
|
| 412 * @return TRUE if given path is a directory, FALSE otherwise. |
|
| 413 * @deprecated Pidgin no longer uses GtkFileSelection internally. It has also |
|
| 414 * been deprecated by GTK+. Use GtkFileChooser instead and ignore |
|
| 415 * this function. |
|
| 416 */ |
|
| 417 gboolean pidgin_check_if_dir(const char *path, GtkFileSelection *filesel); |
|
| 418 |
|
| 419 /** |
|
| 420 * Sets up GtkSpell for the given GtkTextView, reporting errors |
398 * Sets up GtkSpell for the given GtkTextView, reporting errors |
| 421 * if encountered. |
399 * if encountered. |
| 422 * |
400 * |
| 423 * This does nothing if Pidgin is not compiled with GtkSpell support. |
401 * This does nothing if Pidgin is not compiled with GtkSpell support. |
| 424 * |
402 * |
| 446 /** |
424 /** |
| 447 * Get information about a user. Show immediate feedback. |
425 * Get information about a user. Show immediate feedback. |
| 448 * |
426 * |
| 449 * @param conn The connection to get information from. |
427 * @param conn The connection to get information from. |
| 450 * @param name The user to get information about. |
428 * @param name The user to get information about. |
| 451 * |
|
| 452 * @since 2.1.0 |
|
| 453 */ |
429 */ |
| 454 void pidgin_retrieve_user_info(PurpleConnection *conn, const char *name); |
430 void pidgin_retrieve_user_info(PurpleConnection *conn, const char *name); |
| 455 |
431 |
| 456 /** |
432 /** |
| 457 * Get information about a user in a chat. Show immediate feedback. |
433 * Get information about a user in a chat. Show immediate feedback. |
| 458 * |
434 * |
| 459 * @param conn The connection to get information from. |
435 * @param conn The connection to get information from. |
| 460 * @param name The user to get information about. |
436 * @param name The user to get information about. |
| 461 * @param chatid The chat id. |
437 * @param chatid The chat id. |
| 462 * |
|
| 463 * @since 2.1.0 |
|
| 464 */ |
438 */ |
| 465 void pidgin_retrieve_user_info_in_chat(PurpleConnection *conn, const char *name, int chatid); |
439 void pidgin_retrieve_user_info_in_chat(PurpleConnection *conn, const char *name, int chatid); |
| 466 |
440 |
| 467 /** |
441 /** |
| 468 * Parses an application/x-im-contact MIME message and returns the |
442 * Parses an application/x-im-contact MIME message and returns the |
| 658 * @param len If not @c NULL, the length of the returned data will be set here. |
624 * @param len If not @c NULL, the length of the returned data will be set here. |
| 659 * |
625 * |
| 660 * @return The converted image data, or @c NULL if an error occurred. |
626 * @return The converted image data, or @c NULL if an error occurred. |
| 661 */ |
627 */ |
| 662 gpointer pidgin_convert_buddy_icon(PurplePlugin *plugin, const char *path, size_t *len); |
628 gpointer pidgin_convert_buddy_icon(PurplePlugin *plugin, const char *path, size_t *len); |
| 663 |
|
| 664 #if !(defined PIDGIN_DISABLE_DEPRECATED) || (defined _PIDGIN_GTKUTILS_C_) |
|
| 665 /** |
|
| 666 * Set or unset a custom buddyicon for a user. |
|
| 667 * |
|
| 668 * @param account The account the user belongs to. |
|
| 669 * @param who The name of the user. |
|
| 670 * @param filename The path of the custom icon. If this is @c NULL, then any |
|
| 671 * previously set custom buddy icon for the user is removed. |
|
| 672 * @deprecated See purple_buddy_icons_node_set_custom_icon_from_file() |
|
| 673 */ |
|
| 674 void pidgin_set_custom_buddy_icon(PurpleAccount *account, const char *who, const char *filename); |
|
| 675 #endif |
|
| 676 |
629 |
| 677 /** |
630 /** |
| 678 * Converts "->" and "<-" in strings to Unicode arrow characters, for use in referencing |
631 * Converts "->" and "<-" in strings to Unicode arrow characters, for use in referencing |
| 679 * menu items. |
632 * menu items. |
| 680 * |
633 * |
| 779 * @param default_item Initial contents of GtkEntry |
732 * @param default_item Initial contents of GtkEntry |
| 780 * @param items GList containing strings to add to GtkComboBox |
733 * @param items GList containing strings to add to GtkComboBox |
| 781 * |
734 * |
| 782 * @return A newly created text GtkComboBox containing a GtkEntry |
735 * @return A newly created text GtkComboBox containing a GtkEntry |
| 783 * child. |
736 * child. |
| 784 * |
|
| 785 * @since 2.2.0 |
|
| 786 */ |
737 */ |
| 787 GtkWidget *pidgin_text_combo_box_entry_new(const char *default_item, GList *items); |
738 GtkWidget *pidgin_text_combo_box_entry_new(const char *default_item, GList *items); |
| 788 |
739 |
| 789 /** |
740 /** |
| 790 * Retrieve the text from the entry of the simple text GtkComboBoxEntry equivalent |
741 * Retrieve the text from the entry of the simple text GtkComboBoxEntry equivalent |
| 791 * |
742 * |
| 792 * @param widget The simple text GtkComboBoxEntry equivalent widget |
743 * @param widget The simple text GtkComboBoxEntry equivalent widget |
| 793 * |
744 * |
| 794 * @return The text in the widget's entry. It must not be freed |
745 * @return The text in the widget's entry. It must not be freed |
| 795 * |
|
| 796 * @since 2.2.0 |
|
| 797 */ |
746 */ |
| 798 const char *pidgin_text_combo_box_entry_get_text(GtkWidget *widget); |
747 const char *pidgin_text_combo_box_entry_get_text(GtkWidget *widget); |
| 799 |
748 |
| 800 /** |
749 /** |
| 801 * Set the text in the entry of the simple text GtkComboBoxEntry equivalent |
750 * Set the text in the entry of the simple text GtkComboBoxEntry equivalent |
| 802 * |
751 * |
| 803 * @param widget The simple text GtkComboBoxEntry equivalent widget |
752 * @param widget The simple text GtkComboBoxEntry equivalent widget |
| 804 * @param text The text to set |
753 * @param text The text to set |
| 805 * |
|
| 806 * @since 2.2.0 |
|
| 807 */ |
754 */ |
| 808 void pidgin_text_combo_box_entry_set_text(GtkWidget *widget, const char *text); |
755 void pidgin_text_combo_box_entry_set_text(GtkWidget *widget, const char *text); |
| 809 |
756 |
| 810 /** |
757 /** |
| 811 * Automatically make a window transient to a suitable parent window. |
758 * Automatically make a window transient to a suitable parent window. |
| 812 * |
759 * |
| 813 * @param window The window to make transient. |
760 * @param window The window to make transient. |
| 814 * |
761 * |
| 815 * @return Whether the window was made transient or not. |
762 * @return Whether the window was made transient or not. |
| 816 * |
|
| 817 * @since 2.4.0 |
|
| 818 */ |
763 */ |
| 819 gboolean pidgin_auto_parent_window(GtkWidget *window); |
764 gboolean pidgin_auto_parent_window(GtkWidget *window); |
| 820 |
765 |
| 821 /** |
766 /** |
| 822 * Add a labelled widget to a GtkVBox |
767 * Add a labelled widget to a GtkVBox |
| 827 * @param widget The GtkWidget to add. |
772 * @param widget The GtkWidget to add. |
| 828 * @param expand Whether to expand the widget horizontally. |
773 * @param expand Whether to expand the widget horizontally. |
| 829 * @param p_label Place to store a pointer to the GtkLabel, or @c NULL if you don't care. |
774 * @param p_label Place to store a pointer to the GtkLabel, or @c NULL if you don't care. |
| 830 * |
775 * |
| 831 * @return A GtkHBox already added to the GtkVBox containing the GtkLabel and the GtkWidget. |
776 * @return A GtkHBox already added to the GtkVBox containing the GtkLabel and the GtkWidget. |
| 832 * @since 2.4.0 |
|
| 833 */ |
777 */ |
| 834 GtkWidget *pidgin_add_widget_to_vbox(GtkBox *vbox, const char *widget_label, GtkSizeGroup *sg, GtkWidget *widget, gboolean expand, GtkWidget **p_label); |
778 GtkWidget *pidgin_add_widget_to_vbox(GtkBox *vbox, const char *widget_label, GtkSizeGroup *sg, GtkWidget *widget, gboolean expand, GtkWidget **p_label); |
| 835 |
779 |
| 836 /** |
780 /** |
| 837 * Create a GdkPixbuf from a chunk of image data. |
781 * Create a GdkPixbuf from a chunk of image data. |
| 852 * @param buf The raw binary image data. |
794 * @param buf The raw binary image data. |
| 853 * @param count The length of buf in bytes. |
795 * @param count The length of buf in bytes. |
| 854 * |
796 * |
| 855 * @return A GdkPixbufAnimation created from the image data, or NULL if |
797 * @return A GdkPixbufAnimation created from the image data, or NULL if |
| 856 * there was an error parsing the data. |
798 * there was an error parsing the data. |
| 857 * |
|
| 858 * @since 2.9.0 |
|
| 859 */ |
799 */ |
| 860 GdkPixbufAnimation *pidgin_pixbuf_anim_from_data(const guchar *buf, gsize count); |
800 GdkPixbufAnimation *pidgin_pixbuf_anim_from_data(const guchar *buf, gsize count); |
| 861 |
801 |
| 862 /** |
802 /** |
| 863 * Create a GdkPixbuf from a PurpleStoredImage. |
803 * Create a GdkPixbuf from a PurpleStoredImage. |
| 864 * |
804 * |
| 865 * @param image A PurpleStoredImage. |
805 * @param image A PurpleStoredImage. |
| 866 * |
806 * |
| 867 * @return A GdkPixbuf created from the stored image. |
807 * @return A GdkPixbuf created from the stored image. |
| 868 * |
|
| 869 * @since 2.5.0 |
|
| 870 */ |
808 */ |
| 871 GdkPixbuf *pidgin_pixbuf_from_imgstore(PurpleStoredImage *image); |
809 GdkPixbuf *pidgin_pixbuf_from_imgstore(PurpleStoredImage *image); |
| 872 |
810 |
| 873 /** |
811 /** |
| 874 * Helper function that calls gdk_pixbuf_new_from_file() and checks both |
812 * Helper function that calls gdk_pixbuf_new_from_file() and checks both |
| 943 * @param height The height the image should have or -1 to not constrain the height |
877 * @param height The height the image should have or -1 to not constrain the height |
| 944 * @param preserve_aspect_ratio TRUE to preserve the image's aspect ratio |
878 * @param preserve_aspect_ratio TRUE to preserve the image's aspect ratio |
| 945 * |
879 * |
| 946 * @return The GdkPixbuf if successful. Otherwise NULL is returned and |
880 * @return The GdkPixbuf if successful. Otherwise NULL is returned and |
| 947 * a warning is logged. |
881 * a warning is logged. |
| 948 * |
|
| 949 * @since 2.9.0 |
|
| 950 */ |
882 */ |
| 951 GdkPixbuf *pidgin_pixbuf_new_from_file_at_scale(const char *filename, int width, int height, gboolean preserve_aspect_ratio); |
883 GdkPixbuf *pidgin_pixbuf_new_from_file_at_scale(const char *filename, int width, int height, gboolean preserve_aspect_ratio); |
| 952 |
884 |
| 953 /** |
885 /** |
| 954 * Add scrollbars to a widget |
886 * Add scrollbars to a widget |
| 955 * @param widget The child widget |
887 * @param child The child widget |
| 956 * @hscrollbar_policy Horizontal scrolling policy |
888 * @param hscrollbar_policy Horizontal scrolling policy |
| 957 * @vscrollbar_policy Vertical scrolling policy |
889 * @param vscrollbar_policy Vertical scrolling policy |
| 958 * @shadow Shadow type |
890 * @param shadow_type Shadow type |
| 959 * @width Desired widget width, or -1 for default |
891 * @param width Desired widget width, or -1 for default |
| 960 * @height Desired widget height, or -1 for default |
892 * @param height Desired widget height, or -1 for default |
| 961 * |
|
| 962 * @since 2.8.0 |
|
| 963 */ |
893 */ |
| 964 GtkWidget *pidgin_make_scrollable(GtkWidget *child, GtkPolicyType hscrollbar_policy, GtkPolicyType vscrollbar_policy, GtkShadowType shadow_type, int width, int height); |
894 GtkWidget *pidgin_make_scrollable(GtkWidget *child, GtkPolicyType hscrollbar_policy, GtkPolicyType vscrollbar_policy, GtkShadowType shadow_type, int width, int height); |
| 965 |
895 |
| 966 /** |
896 /** |
| 967 * Initialize some utility functions. |
897 * Initialize some utility functions. |
| 968 * |
|
| 969 * @since 2.6.0 |
|
| 970 */ |
898 */ |
| 971 void pidgin_utils_init(void); |
899 void pidgin_utils_init(void); |
| 972 |
900 |
| 973 /** |
901 /** |
| 974 * Uninitialize some utility functions. |
902 * Uninitialize some utility functions. |
| 975 * |
|
| 976 * @since 2.6.0 |
|
| 977 */ |
903 */ |
| 978 void pidgin_utils_uninit(void); |
904 void pidgin_utils_uninit(void); |
| 979 |
905 |
| 980 #endif /* _PIDGINUTILS_H_ */ |
906 #endif /* _PIDGINUTILS_H_ */ |
| 981 |
907 |