25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 
 
 

199 satır
8.8 KiB

  1. /* GtkIconTheme - a loader for icon themes
  2. * gtk-icon-loader.h Copyright (C) 2002, 2003 Red Hat, Inc.
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with this library; if not, write to the
  16. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  17. * Boston, MA 02111-1307, USA.
  18. */
  19. #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
  20. #error "Only <gtk/gtk.h> can be included directly."
  21. #endif
  22. #ifndef __GTK_ICON_THEME_H__
  23. #define __GTK_ICON_THEME_H__
  24. #include <gdk-pixbuf/gdk-pixbuf.h>
  25. #include <gdk/gdk.h>
  26. G_BEGIN_DECLS
  27. #define GTK_TYPE_ICON_INFO (gtk_icon_info_get_type ())
  28. #define GTK_TYPE_ICON_THEME (gtk_icon_theme_get_type ())
  29. #define GTK_ICON_THEME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_ICON_THEME, GtkIconTheme))
  30. #define GTK_ICON_THEME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_ICON_THEME, GtkIconThemeClass))
  31. #define GTK_IS_ICON_THEME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_ICON_THEME))
  32. #define GTK_IS_ICON_THEME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ICON_THEME))
  33. #define GTK_ICON_THEME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ICON_THEME, GtkIconThemeClass))
  34. typedef struct _GtkIconInfo GtkIconInfo;
  35. typedef struct _GtkIconTheme GtkIconTheme;
  36. typedef struct _GtkIconThemeClass GtkIconThemeClass;
  37. typedef struct _GtkIconThemePrivate GtkIconThemePrivate;
  38. struct _GtkIconTheme
  39. {
  40. /*< private >*/
  41. GObject parent_instance;
  42. GtkIconThemePrivate *GSEAL (priv);
  43. };
  44. struct _GtkIconThemeClass
  45. {
  46. GObjectClass parent_class;
  47. void (* changed) (GtkIconTheme *icon_theme);
  48. };
  49. /**
  50. * GtkIconLookupFlags:
  51. * @GTK_ICON_LOOKUP_NO_SVG: Never return SVG icons, even if gdk-pixbuf
  52. * supports them. Cannot be used together with %GTK_ICON_LOOKUP_FORCE_SVG.
  53. * @GTK_ICON_LOOKUP_FORCE_SVG: Return SVG icons, even if gdk-pixbuf
  54. * doesn't support them.
  55. * Cannot be used together with %GTK_ICON_LOOKUP_NO_SVG.
  56. * @GTK_ICON_LOOKUP_USE_BUILTIN: When passed to
  57. * gtk_icon_theme_lookup_icon() includes builtin icons
  58. * as well as files. For a builtin icon, gtk_icon_info_get_filename()
  59. * returns %NULL and you need to call gtk_icon_info_get_builtin_pixbuf().
  60. * @GTK_ICON_LOOKUP_GENERIC_FALLBACK: Try to shorten icon name at '-'
  61. * characters before looking at inherited themes. For more general
  62. * fallback, see gtk_icon_theme_choose_icon(). Since 2.12.
  63. * @GTK_ICON_LOOKUP_FORCE_SIZE: Always return the icon scaled to the
  64. * requested size. Since 2.14.
  65. *
  66. * Used to specify options for gtk_icon_theme_lookup_icon()
  67. **/
  68. typedef enum
  69. {
  70. GTK_ICON_LOOKUP_NO_SVG = 1 << 0,
  71. GTK_ICON_LOOKUP_FORCE_SVG = 1 << 1,
  72. GTK_ICON_LOOKUP_USE_BUILTIN = 1 << 2,
  73. GTK_ICON_LOOKUP_GENERIC_FALLBACK = 1 << 3,
  74. GTK_ICON_LOOKUP_FORCE_SIZE = 1 << 4
  75. } GtkIconLookupFlags;
  76. #define GTK_ICON_THEME_ERROR gtk_icon_theme_error_quark ()
  77. /**
  78. * GtkIconThemeError:
  79. * @GTK_ICON_THEME_NOT_FOUND: The icon specified does not exist in the theme
  80. * @GTK_ICON_THEME_FAILED: An unspecified error occurred.
  81. *
  82. * Error codes for GtkIconTheme operations.
  83. **/
  84. typedef enum {
  85. GTK_ICON_THEME_NOT_FOUND,
  86. GTK_ICON_THEME_FAILED
  87. } GtkIconThemeError;
  88. GQuark gtk_icon_theme_error_quark (void);
  89. #ifdef G_OS_WIN32
  90. /* Reserve old name for DLL ABI backward compatibility */
  91. #define gtk_icon_theme_set_search_path gtk_icon_theme_set_search_path_utf8
  92. #define gtk_icon_theme_get_search_path gtk_icon_theme_get_search_path_utf8
  93. #define gtk_icon_theme_append_search_path gtk_icon_theme_append_search_path_utf8
  94. #define gtk_icon_theme_prepend_search_path gtk_icon_theme_prepend_search_path_utf8
  95. #define gtk_icon_info_get_filename gtk_icon_info_get_filename_utf8
  96. #endif
  97. GType gtk_icon_theme_get_type (void) G_GNUC_CONST;
  98. GtkIconTheme *gtk_icon_theme_new (void);
  99. GtkIconTheme *gtk_icon_theme_get_default (void);
  100. GtkIconTheme *gtk_icon_theme_get_for_screen (GdkScreen *screen);
  101. void gtk_icon_theme_set_screen (GtkIconTheme *icon_theme,
  102. GdkScreen *screen);
  103. void gtk_icon_theme_set_search_path (GtkIconTheme *icon_theme,
  104. const gchar *path[],
  105. gint n_elements);
  106. void gtk_icon_theme_get_search_path (GtkIconTheme *icon_theme,
  107. gchar **path[],
  108. gint *n_elements);
  109. void gtk_icon_theme_append_search_path (GtkIconTheme *icon_theme,
  110. const gchar *path);
  111. void gtk_icon_theme_prepend_search_path (GtkIconTheme *icon_theme,
  112. const gchar *path);
  113. void gtk_icon_theme_set_custom_theme (GtkIconTheme *icon_theme,
  114. const gchar *theme_name);
  115. gboolean gtk_icon_theme_has_icon (GtkIconTheme *icon_theme,
  116. const gchar *icon_name);
  117. gint *gtk_icon_theme_get_icon_sizes (GtkIconTheme *icon_theme,
  118. const gchar *icon_name);
  119. GtkIconInfo * gtk_icon_theme_lookup_icon (GtkIconTheme *icon_theme,
  120. const gchar *icon_name,
  121. gint size,
  122. GtkIconLookupFlags flags);
  123. GtkIconInfo * gtk_icon_theme_choose_icon (GtkIconTheme *icon_theme,
  124. const gchar *icon_names[],
  125. gint size,
  126. GtkIconLookupFlags flags);
  127. GdkPixbuf * gtk_icon_theme_load_icon (GtkIconTheme *icon_theme,
  128. const gchar *icon_name,
  129. gint size,
  130. GtkIconLookupFlags flags,
  131. GError **error);
  132. GtkIconInfo * gtk_icon_theme_lookup_by_gicon (GtkIconTheme *icon_theme,
  133. GIcon *icon,
  134. gint size,
  135. GtkIconLookupFlags flags);
  136. GList * gtk_icon_theme_list_icons (GtkIconTheme *icon_theme,
  137. const gchar *context);
  138. GList * gtk_icon_theme_list_contexts (GtkIconTheme *icon_theme);
  139. char * gtk_icon_theme_get_example_icon_name (GtkIconTheme *icon_theme);
  140. gboolean gtk_icon_theme_rescan_if_needed (GtkIconTheme *icon_theme);
  141. void gtk_icon_theme_add_builtin_icon (const gchar *icon_name,
  142. gint size,
  143. GdkPixbuf *pixbuf);
  144. GType gtk_icon_info_get_type (void) G_GNUC_CONST;
  145. GtkIconInfo * gtk_icon_info_copy (GtkIconInfo *icon_info);
  146. void gtk_icon_info_free (GtkIconInfo *icon_info);
  147. GtkIconInfo * gtk_icon_info_new_for_pixbuf (GtkIconTheme *icon_theme,
  148. GdkPixbuf *pixbuf);
  149. gint gtk_icon_info_get_base_size (GtkIconInfo *icon_info);
  150. G_CONST_RETURN gchar *gtk_icon_info_get_filename (GtkIconInfo *icon_info);
  151. GdkPixbuf * gtk_icon_info_get_builtin_pixbuf (GtkIconInfo *icon_info);
  152. GdkPixbuf * gtk_icon_info_load_icon (GtkIconInfo *icon_info,
  153. GError **error);
  154. void gtk_icon_info_set_raw_coordinates (GtkIconInfo *icon_info,
  155. gboolean raw_coordinates);
  156. gboolean gtk_icon_info_get_embedded_rect (GtkIconInfo *icon_info,
  157. GdkRectangle *rectangle);
  158. gboolean gtk_icon_info_get_attach_points (GtkIconInfo *icon_info,
  159. GdkPoint **points,
  160. gint *n_points);
  161. G_CONST_RETURN gchar *gtk_icon_info_get_display_name (GtkIconInfo *icon_info);
  162. /* Non-public methods */
  163. void _gtk_icon_theme_check_reload (GdkDisplay *display);
  164. void _gtk_icon_theme_ensure_builtin_cache (void);
  165. G_END_DECLS
  166. #endif /* __GTK_ICON_THEME_H__ */