| 135 * Creates a small button |
135 * Creates a small button |
| 136 * |
136 * |
| 137 * @param image A button image. |
137 * @param image A button image. |
| 138 * |
138 * |
| 139 * @return A GtkButton created from the image. |
139 * @return A GtkButton created from the image. |
| 140 * @since 2.7.0 |
|
| 141 */ |
140 */ |
| 142 GtkWidget *pidgin_create_small_button(GtkWidget *image); |
141 GtkWidget *pidgin_create_small_button(GtkWidget *image); |
| 143 |
142 |
| 144 /** |
143 /** |
| 145 * Creates a new window |
144 * Creates a new window |
| 146 * |
145 * |
| 147 * @param title The window title, or @c NULL |
146 * @param title The window title, or @c NULL |
| 148 * @param border_width The window's desired border width |
147 * @param border_width The window's desired border width |
| 149 * @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 |
| 150 * @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) |
| 151 * |
|
| 152 * @since 2.1.0 |
|
| 153 */ |
150 */ |
| 154 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); |
| 155 |
152 |
| 156 /** |
153 /** |
| 157 * Creates a new dialog window |
154 * Creates a new dialog window |
| 158 * |
155 * |
| 159 * @param title The window title, or @c NULL |
156 * @param title The window title, or @c NULL |
| 160 * @param border_width The window's desired border width |
157 * @param border_width The window's desired border width |
| 161 * @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 |
| 162 * @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) |
| 163 * |
|
| 164 * @since 2.4.0 |
|
| 165 */ |
160 */ |
| 166 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); |
| 167 |
162 |
| 168 /** |
163 /** |
| 169 * Retrieves the main content box (vbox) from a pidgin dialog window |
164 * Retrieves the main content box (vbox) from a pidgin dialog window |
| 170 * |
165 * |
| 171 * @param dialog The dialog window |
166 * @param dialog The dialog window |
| 172 * @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. |
| 173 * @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 |
| 174 * |
|
| 175 * @since 2.4.0 |
|
| 176 */ |
169 */ |
| 177 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); |
| 178 |
171 |
| 179 /** |
172 /** |
| 180 * Retrieves the main content box (vbox) from a pidgin dialog window |
173 * Retrieves the main content box (vbox) from a pidgin dialog window |
| 181 * |
174 * |
| 182 * @param dialog The dialog window |
175 * @param dialog The dialog window |
| 183 * |
|
| 184 * @since 2.4.0 |
|
| 185 */ |
176 */ |
| 186 GtkWidget *pidgin_dialog_get_vbox(GtkDialog *dialog); |
177 GtkWidget *pidgin_dialog_get_vbox(GtkDialog *dialog); |
| 187 |
178 |
| 188 /** |
179 /** |
| 189 * Add a button to a dialog created by #pidgin_create_dialog. |
180 * Add a button to a dialog created by #pidgin_create_dialog. |
| 192 * @param label The stock-id or the label for the button |
183 * @param label The stock-id or the label for the button |
| 193 * @param callback The callback function for the button |
184 * @param callback The callback function for the button |
| 194 * @param callbackdata The user data for the callback function |
185 * @param callbackdata The user data for the callback function |
| 195 * |
186 * |
| 196 * @return The created button. |
187 * @return The created button. |
| 197 * @since 2.4.0 |
|
| 198 */ |
188 */ |
| 199 GtkWidget *pidgin_dialog_add_button(GtkDialog *dialog, const char *label, |
189 GtkWidget *pidgin_dialog_add_button(GtkDialog *dialog, const char *label, |
| 200 GCallback callback, gpointer callbackdata); |
190 GCallback callback, gpointer callbackdata); |
| 201 |
191 |
| 202 /** |
192 /** |
| 203 * Retrieves the action area (button box) from a pidgin dialog window |
193 * Retrieves the action area (button box) from a pidgin dialog window |
| 204 * |
194 * |
| 205 * @param dialog The dialog window |
195 * @param dialog The dialog window |
| 206 * |
|
| 207 * @since 2.4.0 |
|
| 208 */ |
196 */ |
| 209 GtkWidget *pidgin_dialog_get_action_area(GtkDialog *dialog); |
197 GtkWidget *pidgin_dialog_get_action_area(GtkDialog *dialog); |
| 210 |
198 |
| 211 /** |
199 /** |
| 212 * Toggles the sensitivity of a widget. |
200 * Toggles the sensitivity of a widget. |
| 436 /** |
424 /** |
| 437 * Get information about a user. Show immediate feedback. |
425 * Get information about a user. Show immediate feedback. |
| 438 * |
426 * |
| 439 * @param conn The connection to get information from. |
427 * @param conn The connection to get information from. |
| 440 * @param name The user to get information about. |
428 * @param name The user to get information about. |
| 441 * |
|
| 442 * @since 2.1.0 |
|
| 443 */ |
429 */ |
| 444 void pidgin_retrieve_user_info(PurpleConnection *conn, const char *name); |
430 void pidgin_retrieve_user_info(PurpleConnection *conn, const char *name); |
| 445 |
431 |
| 446 /** |
432 /** |
| 447 * Get information about a user in a chat. Show immediate feedback. |
433 * Get information about a user in a chat. Show immediate feedback. |
| 448 * |
434 * |
| 449 * @param conn The connection to get information from. |
435 * @param conn The connection to get information from. |
| 450 * @param name The user to get information about. |
436 * @param name The user to get information about. |
| 451 * @param chatid The chat id. |
437 * @param chatid The chat id. |
| 452 * |
|
| 453 * @since 2.1.0 |
|
| 454 */ |
438 */ |
| 455 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); |
| 456 |
440 |
| 457 /** |
441 /** |
| 458 * Parses an application/x-im-contact MIME message and returns the |
442 * Parses an application/x-im-contact MIME message and returns the |
| 503 * where the menu shall be drawn. This is an output parameter. |
485 * where the menu shall be drawn. This is an output parameter. |
| 504 * @param y Address of the gint representing the vertical position |
486 * @param y Address of the gint representing the vertical position |
| 505 * where the menu shall be drawn. This is an output parameter. |
487 * where the menu shall be drawn. This is an output parameter. |
| 506 * @param push_in This is an output parameter? |
488 * @param push_in This is an output parameter? |
| 507 * @param data Not used by this particular position function. |
489 * @param data Not used by this particular position function. |
| 508 * |
|
| 509 * @since 2.1.0 |
|
| 510 */ |
490 */ |
| 511 void pidgin_menu_position_func_helper(GtkMenu *menu, gint *x, gint *y, |
491 void pidgin_menu_position_func_helper(GtkMenu *menu, gint *x, gint *y, |
| 512 gboolean *push_in, gpointer data); |
492 gboolean *push_in, gpointer data); |
| 513 |
493 |
| 514 /** |
494 /** |
| 576 * Returns an appropriate stock-id for a status primitive. |
556 * Returns an appropriate stock-id for a status primitive. |
| 577 * |
557 * |
| 578 * @param prim The status primitive |
558 * @param prim The status primitive |
| 579 * |
559 * |
| 580 * @return The stock-id |
560 * @return The stock-id |
| 581 * |
|
| 582 * @since 2.6.0 |
|
| 583 */ |
561 */ |
| 584 const char *pidgin_stock_id_from_status_primitive(PurpleStatusPrimitive prim); |
562 const char *pidgin_stock_id_from_status_primitive(PurpleStatusPrimitive prim); |
| 585 |
563 |
| 586 /** |
564 /** |
| 587 * Returns an appropriate stock-id for a PurplePresence. |
565 * Returns an appropriate stock-id for a PurplePresence. |
| 588 * |
566 * |
| 589 * @param presence The presence. |
567 * @param presence The presence. |
| 590 * |
568 * |
| 591 * @return The stock-id |
569 * @return The stock-id |
| 592 * |
|
| 593 * @since 2.6.0 |
|
| 594 */ |
570 */ |
| 595 const char *pidgin_stock_id_from_presence(PurplePresence *presence); |
571 const char *pidgin_stock_id_from_presence(PurplePresence *presence); |
| 596 |
572 |
| 597 /** |
573 /** |
| 598 * Append a PurpleMenuAction to a menu. |
574 * Append a PurpleMenuAction to a menu. |
| 756 * @param default_item Initial contents of GtkEntry |
732 * @param default_item Initial contents of GtkEntry |
| 757 * @param items GList containing strings to add to GtkComboBox |
733 * @param items GList containing strings to add to GtkComboBox |
| 758 * |
734 * |
| 759 * @return A newly created text GtkComboBox containing a GtkEntry |
735 * @return A newly created text GtkComboBox containing a GtkEntry |
| 760 * child. |
736 * child. |
| 761 * |
|
| 762 * @since 2.2.0 |
|
| 763 */ |
737 */ |
| 764 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); |
| 765 |
739 |
| 766 /** |
740 /** |
| 767 * 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 |
| 768 * |
742 * |
| 769 * @param widget The simple text GtkComboBoxEntry equivalent widget |
743 * @param widget The simple text GtkComboBoxEntry equivalent widget |
| 770 * |
744 * |
| 771 * @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 |
| 772 * |
|
| 773 * @since 2.2.0 |
|
| 774 */ |
746 */ |
| 775 const char *pidgin_text_combo_box_entry_get_text(GtkWidget *widget); |
747 const char *pidgin_text_combo_box_entry_get_text(GtkWidget *widget); |
| 776 |
748 |
| 777 /** |
749 /** |
| 778 * 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 |
| 779 * |
751 * |
| 780 * @param widget The simple text GtkComboBoxEntry equivalent widget |
752 * @param widget The simple text GtkComboBoxEntry equivalent widget |
| 781 * @param text The text to set |
753 * @param text The text to set |
| 782 * |
|
| 783 * @since 2.2.0 |
|
| 784 */ |
754 */ |
| 785 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); |
| 786 |
756 |
| 787 /** |
757 /** |
| 788 * Automatically make a window transient to a suitable parent window. |
758 * Automatically make a window transient to a suitable parent window. |
| 789 * |
759 * |
| 790 * @param window The window to make transient. |
760 * @param window The window to make transient. |
| 791 * |
761 * |
| 792 * @return Whether the window was made transient or not. |
762 * @return Whether the window was made transient or not. |
| 793 * |
|
| 794 * @since 2.4.0 |
|
| 795 */ |
763 */ |
| 796 gboolean pidgin_auto_parent_window(GtkWidget *window); |
764 gboolean pidgin_auto_parent_window(GtkWidget *window); |
| 797 |
765 |
| 798 /** |
766 /** |
| 799 * Add a labelled widget to a GtkVBox |
767 * Add a labelled widget to a GtkVBox |
| 804 * @param widget The GtkWidget to add. |
772 * @param widget The GtkWidget to add. |
| 805 * @param expand Whether to expand the widget horizontally. |
773 * @param expand Whether to expand the widget horizontally. |
| 806 * @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. |
| 807 * |
775 * |
| 808 * @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. |
| 809 * @since 2.4.0 |
|
| 810 */ |
777 */ |
| 811 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); |
| 812 |
779 |
| 813 /** |
780 /** |
| 814 * Create a GdkPixbuf from a chunk of image data. |
781 * Create a GdkPixbuf from a chunk of image data. |
| 816 * @param buf The raw binary image data. |
783 * @param buf The raw binary image data. |
| 817 * @param count The length of buf in bytes. |
784 * @param count The length of buf in bytes. |
| 818 * |
785 * |
| 819 * @return A GdkPixbuf created from the image data, or NULL if |
786 * @return A GdkPixbuf created from the image data, or NULL if |
| 820 * there was an error parsing the data. |
787 * there was an error parsing the data. |
| 821 * |
|
| 822 * @since 2.9.0 |
|
| 823 */ |
788 */ |
| 824 GdkPixbuf *pidgin_pixbuf_from_data(const guchar *buf, gsize count); |
789 GdkPixbuf *pidgin_pixbuf_from_data(const guchar *buf, gsize count); |
| 825 |
790 |
| 826 /** |
791 /** |
| 827 * Create a GdkPixbufAnimation from a chunk of image data. |
792 * Create a GdkPixbufAnimation from a chunk of image data. |
| 829 * @param buf The raw binary image data. |
794 * @param buf The raw binary image data. |
| 830 * @param count The length of buf in bytes. |
795 * @param count The length of buf in bytes. |
| 831 * |
796 * |
| 832 * @return A GdkPixbufAnimation created from the image data, or NULL if |
797 * @return A GdkPixbufAnimation created from the image data, or NULL if |
| 833 * there was an error parsing the data. |
798 * there was an error parsing the data. |
| 834 * |
|
| 835 * @since 2.9.0 |
|
| 836 */ |
799 */ |
| 837 GdkPixbufAnimation *pidgin_pixbuf_anim_from_data(const guchar *buf, gsize count); |
800 GdkPixbufAnimation *pidgin_pixbuf_anim_from_data(const guchar *buf, gsize count); |
| 838 |
801 |
| 839 /** |
802 /** |
| 840 * Create a GdkPixbuf from a PurpleStoredImage. |
803 * Create a GdkPixbuf from a PurpleStoredImage. |
| 841 * |
804 * |
| 842 * @param image A PurpleStoredImage. |
805 * @param image A PurpleStoredImage. |
| 843 * |
806 * |
| 844 * @return A GdkPixbuf created from the stored image. |
807 * @return A GdkPixbuf created from the stored image. |
| 845 * |
|
| 846 * @since 2.5.0 |
|
| 847 */ |
808 */ |
| 848 GdkPixbuf *pidgin_pixbuf_from_imgstore(PurpleStoredImage *image); |
809 GdkPixbuf *pidgin_pixbuf_from_imgstore(PurpleStoredImage *image); |
| 849 |
810 |
| 850 /** |
811 /** |
| 851 * 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 |
| 892 * @param width The width the image should have or -1 to not constrain the width |
851 * @param width The width the image should have or -1 to not constrain the width |
| 893 * @param height The height the image should have or -1 to not constrain the height |
852 * @param height The height the image should have or -1 to not constrain the height |
| 894 * |
853 * |
| 895 * @return The GdkPixbuf if successful. Otherwise NULL is returned and |
854 * @return The GdkPixbuf if successful. Otherwise NULL is returned and |
| 896 * a warning is logged. |
855 * a warning is logged. |
| 897 * |
|
| 898 * @since 2.9.0 |
|
| 899 */ |
856 */ |
| 900 GdkPixbuf *pidgin_pixbuf_new_from_file_at_size(const char *filename, int width, int height); |
857 GdkPixbuf *pidgin_pixbuf_new_from_file_at_size(const char *filename, int width, int height); |
| 901 |
858 |
| 902 /** |
859 /** |
| 903 * Helper function that calls gdk_pixbuf_new_from_file_at_scale() and checks |
860 * Helper function that calls gdk_pixbuf_new_from_file_at_scale() and checks |
| 920 * @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 |
| 921 * @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 |
| 922 * |
879 * |
| 923 * @return The GdkPixbuf if successful. Otherwise NULL is returned and |
880 * @return The GdkPixbuf if successful. Otherwise NULL is returned and |
| 924 * a warning is logged. |
881 * a warning is logged. |
| 925 * |
|
| 926 * @since 2.9.0 |
|
| 927 */ |
882 */ |
| 928 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); |
| 929 |
884 |
| 930 /** |
885 /** |
| 931 * Add scrollbars to a widget |
886 * Add scrollbars to a widget |
| 933 * @param hscrollbar_policy Horizontal scrolling policy |
888 * @param hscrollbar_policy Horizontal scrolling policy |
| 934 * @param vscrollbar_policy Vertical scrolling policy |
889 * @param vscrollbar_policy Vertical scrolling policy |
| 935 * @param shadow_type Shadow type |
890 * @param shadow_type Shadow type |
| 936 * @param width Desired widget width, or -1 for default |
891 * @param width Desired widget width, or -1 for default |
| 937 * @param height Desired widget height, or -1 for default |
892 * @param height Desired widget height, or -1 for default |
| 938 * |
|
| 939 * @since 2.8.0 |
|
| 940 */ |
893 */ |
| 941 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); |
| 942 |
895 |
| 943 /** |
896 /** |
| 944 * Initialize some utility functions. |
897 * Initialize some utility functions. |
| 945 * |
|
| 946 * @since 2.6.0 |
|
| 947 */ |
898 */ |
| 948 void pidgin_utils_init(void); |
899 void pidgin_utils_init(void); |
| 949 |
900 |
| 950 /** |
901 /** |
| 951 * Uninitialize some utility functions. |
902 * Uninitialize some utility functions. |
| 952 * |
|
| 953 * @since 2.6.0 |
|
| 954 */ |
903 */ |
| 955 void pidgin_utils_uninit(void); |
904 void pidgin_utils_uninit(void); |
| 956 |
905 |
| 957 #endif /* _PIDGINUTILS_H_ */ |
906 #endif /* _PIDGINUTILS_H_ */ |
| 958 |
907 |