comparison pidgin/gtkutils.h @ 32667:e2a1510da13d

propagate from branch 'im.pidgin.pidgin' (head 5da91575f92c8c13d7a85eef338ec6da55e6fb26) to branch 'im.pidgin.cpw.qulogic.gtk3' (head 53d36fd22e482079303664b9f3e13fa2a4b6f9b2)
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Mon, 22 Aug 2011 21:27:03 +0000
parents 79a8ed88de20 58e0e310ef2e
children
comparison
equal deleted inserted replaced
32666:974722699032 32667:e2a1510da13d
382 * @return Returns @c TRUE if the autocompletion entry is filtered. 382 * @return Returns @c TRUE if the autocompletion entry is filtered.
383 */ 383 */
384 gboolean pidgin_screenname_autocomplete_default_filter(const PidginBuddyCompletionEntry *completion_entry, gpointer all_accounts); 384 gboolean pidgin_screenname_autocomplete_default_filter(const PidginBuddyCompletionEntry *completion_entry, gpointer all_accounts);
385 385
386 /** 386 /**
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 * Sets up GtkSpell for the given GtkTextView, reporting errors 387 * Sets up GtkSpell for the given GtkTextView, reporting errors
406 * if encountered. 388 * if encountered.
407 * 389 *
408 * This does nothing if Pidgin is not compiled with GtkSpell support. 390 * This does nothing if Pidgin is not compiled with GtkSpell support.
409 * 391 *
643 * @param len If not @c NULL, the length of the returned data will be set here. 625 * @param len If not @c NULL, the length of the returned data will be set here.
644 * 626 *
645 * @return The converted image data, or @c NULL if an error occurred. 627 * @return The converted image data, or @c NULL if an error occurred.
646 */ 628 */
647 gpointer pidgin_convert_buddy_icon(PurplePlugin *plugin, const char *path, size_t *len); 629 gpointer pidgin_convert_buddy_icon(PurplePlugin *plugin, const char *path, size_t *len);
648
649 #if !(defined PIDGIN_DISABLE_DEPRECATED) || (defined _PIDGIN_GTKUTILS_C_)
650 /**
651 * Set or unset a custom buddyicon for a user.
652 *
653 * @param account The account the user belongs to.
654 * @param who The name of the user.
655 * @param filename The path of the custom icon. If this is @c NULL, then any
656 * previously set custom buddy icon for the user is removed.
657 * @deprecated See purple_buddy_icons_node_set_custom_icon_from_file()
658 */
659 void pidgin_set_custom_buddy_icon(PurpleAccount *account, const char *who, const char *filename);
660 #endif
661 630
662 /** 631 /**
663 * Converts "->" and "<-" in strings to Unicode arrow characters, for use in referencing 632 * Converts "->" and "<-" in strings to Unicode arrow characters, for use in referencing
664 * menu items. 633 * menu items.
665 * 634 *
817 * @since 2.4.0 786 * @since 2.4.0
818 */ 787 */
819 GtkWidget *pidgin_add_widget_to_vbox(GtkBox *vbox, const char *widget_label, GtkSizeGroup *sg, GtkWidget *widget, gboolean expand, GtkWidget **p_label); 788 GtkWidget *pidgin_add_widget_to_vbox(GtkBox *vbox, const char *widget_label, GtkSizeGroup *sg, GtkWidget *widget, gboolean expand, GtkWidget **p_label);
820 789
821 /** 790 /**
791 * Create a GdkPixbuf from a chunk of image data.
792 *
793 * @param buf The raw binary image data.
794 * @param count The length of buf in bytes.
795 *
796 * @return A GdkPixbuf created from the image data, or NULL if
797 * there was an error parsing the data.
798 *
799 * @since 2.9.0
800 */
801 GdkPixbuf *pidgin_pixbuf_from_data(const guchar *buf, gsize count);
802
803 /**
804 * Create a GdkPixbufAnimation from a chunk of image data.
805 *
806 * @param buf The raw binary image data.
807 * @param count The length of buf in bytes.
808 *
809 * @return A GdkPixbufAnimation created from the image data, or NULL if
810 * there was an error parsing the data.
811 *
812 * @since 2.9.0
813 */
814 GdkPixbufAnimation *pidgin_pixbuf_anim_from_data(const guchar *buf, gsize count);
815
816 /**
822 * Create a GdkPixbuf from a PurpleStoredImage. 817 * Create a GdkPixbuf from a PurpleStoredImage.
823 * 818 *
824 * @param image A PurpleStoredImage. 819 * @param image A PurpleStoredImage.
825 * 820 *
826 * @return A GdkPixbuf created from the stored image. 821 * @return A GdkPixbuf created from the stored image.
827 * 822 *
828 * @since 2.5.0 823 * @since 2.5.0
829 */ 824 */
830 GdkPixbuf *pidgin_pixbuf_from_imgstore(PurpleStoredImage *image); 825 GdkPixbuf *pidgin_pixbuf_from_imgstore(PurpleStoredImage *image);
826
827 /**
828 * Helper function that calls gdk_pixbuf_new_from_file() and checks both
829 * the return code and the GError and returns NULL if either one failed.
830 *
831 * The gdk-pixbuf documentation implies that it is sufficient to check
832 * the return value of gdk_pixbuf_new_from_file() to determine
833 * whether the image was able to be loaded. However, this is not the case
834 * with gdk-pixbuf 2.23.3 and probably many earlier versions. In some
835 * cases a GdkPixbuf object is returned that will cause some operations
836 * (like gdk_pixbuf_scale_simple()) to rapidly consume memory in an
837 * infinite loop.
838 *
839 * This function shouldn't be necessary once Pidgin requires a version of
840 * gdk-pixbuf where the aforementioned bug is fixed. However, it might be
841 * nice to keep this function around for the debug message that it logs.
842 *
843 * @param filename Name of file to load, in the GLib file name encoding
844 *
845 * @return The GdkPixbuf if successful. Otherwise NULL is returned and
846 * a warning is logged.
847 *
848 * @since 2.9.0
849 */
850 GdkPixbuf *pidgin_pixbuf_new_from_file(const char *filename);
851
852 /**
853 * Helper function that calls gdk_pixbuf_new_from_file_at_size() and checks
854 * both the return code and the GError and returns NULL if either one failed.
855 *
856 * The gdk-pixbuf documentation implies that it is sufficient to check
857 * the return value of gdk_pixbuf_new_from_file_at_size() to determine
858 * whether the image was able to be loaded. However, this is not the case
859 * with gdk-pixbuf 2.23.3 and probably many earlier versions. In some
860 * cases a GdkPixbuf object is returned that will cause some operations
861 * (like gdk_pixbuf_scale_simple()) to rapidly consume memory in an
862 * infinite loop.
863 *
864 * This function shouldn't be necessary once Pidgin requires a version of
865 * gdk-pixbuf where the aforementioned bug is fixed. However, it might be
866 * nice to keep this function around for the debug message that it logs.
867 *
868 * @param filename Name of file to load, in the GLib file name encoding
869 * @param width The width the image should have or -1 to not constrain the width
870 * @param height The height the image should have or -1 to not constrain the height
871 *
872 * @return The GdkPixbuf if successful. Otherwise NULL is returned and
873 * a warning is logged.
874 *
875 * @since 2.9.0
876 */
877 GdkPixbuf *pidgin_pixbuf_new_from_file_at_size(const char *filename, int width, int height);
878
879 /**
880 * Helper function that calls gdk_pixbuf_new_from_file_at_scale() and checks
881 * both the return code and the GError and returns NULL if either one failed.
882 *
883 * The gdk-pixbuf documentation implies that it is sufficient to check
884 * the return value of gdk_pixbuf_new_from_file_at_scale() to determine
885 * whether the image was able to be loaded. However, this is not the case
886 * with gdk-pixbuf 2.23.3 and probably many earlier versions. In some
887 * cases a GdkPixbuf object is returned that will cause some operations
888 * (like gdk_pixbuf_scale_simple()) to rapidly consume memory in an
889 * infinite loop.
890 *
891 * This function shouldn't be necessary once Pidgin requires a version of
892 * gdk-pixbuf where the aforementioned bug is fixed. However, it might be
893 * nice to keep this function around for the debug message that it logs.
894 *
895 * @param filename Name of file to load, in the GLib file name encoding
896 * @param width The width the image should have or -1 to not constrain the width
897 * @param height The height the image should have or -1 to not constrain the height
898 * @param preserve_aspect_ratio TRUE to preserve the image's aspect ratio
899 *
900 * @return The GdkPixbuf if successful. Otherwise NULL is returned and
901 * a warning is logged.
902 *
903 * @since 2.9.0
904 */
905 GdkPixbuf *pidgin_pixbuf_new_from_file_at_scale(const char *filename, int width, int height, gboolean preserve_aspect_ratio);
831 906
832 /** 907 /**
833 * Add scrollbars to a widget 908 * Add scrollbars to a widget
834 * @param widget The child widget 909 * @param widget The child widget
835 * @hscrollbar_policy Horizontal scrolling policy 910 * @hscrollbar_policy Horizontal scrolling policy