Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 
 

190 lignes
8.8 KiB

  1. /* GTK - The GIMP Toolkit
  2. * Copyright (C) 2000 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. /*
  20. * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
  21. * file for a list of people on the GTK+ Team. See the ChangeLog
  22. * files for a list of changes. These files are distributed with
  23. * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
  24. */
  25. #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
  26. #error "Only <gtk/gtk.h> can be included directly."
  27. #endif
  28. #ifndef __GTK_ICON_FACTORY_H__
  29. #define __GTK_ICON_FACTORY_H__
  30. #include <gdk/gdk.h>
  31. #include <gtk/gtkrc.h>
  32. G_BEGIN_DECLS
  33. typedef struct _GtkIconFactoryClass GtkIconFactoryClass;
  34. #define GTK_TYPE_ICON_FACTORY (gtk_icon_factory_get_type ())
  35. #define GTK_ICON_FACTORY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GTK_TYPE_ICON_FACTORY, GtkIconFactory))
  36. #define GTK_ICON_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_ICON_FACTORY, GtkIconFactoryClass))
  37. #define GTK_IS_ICON_FACTORY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GTK_TYPE_ICON_FACTORY))
  38. #define GTK_IS_ICON_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ICON_FACTORY))
  39. #define GTK_ICON_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ICON_FACTORY, GtkIconFactoryClass))
  40. #define GTK_TYPE_ICON_SET (gtk_icon_set_get_type ())
  41. #define GTK_TYPE_ICON_SOURCE (gtk_icon_source_get_type ())
  42. struct _GtkIconFactory
  43. {
  44. GObject parent_instance;
  45. GHashTable *GSEAL (icons);
  46. };
  47. struct _GtkIconFactoryClass
  48. {
  49. GObjectClass parent_class;
  50. /* Padding for future expansion */
  51. void (*_gtk_reserved1) (void);
  52. void (*_gtk_reserved2) (void);
  53. void (*_gtk_reserved3) (void);
  54. void (*_gtk_reserved4) (void);
  55. };
  56. #ifdef G_OS_WIN32
  57. /* Reserve old names for DLL ABI backward compatibility */
  58. #define gtk_icon_source_set_filename gtk_icon_source_set_filename_utf8
  59. #define gtk_icon_source_get_filename gtk_icon_source_get_filename_utf8
  60. #endif
  61. GType gtk_icon_factory_get_type (void) G_GNUC_CONST;
  62. GtkIconFactory* gtk_icon_factory_new (void);
  63. void gtk_icon_factory_add (GtkIconFactory *factory,
  64. const gchar *stock_id,
  65. GtkIconSet *icon_set);
  66. GtkIconSet* gtk_icon_factory_lookup (GtkIconFactory *factory,
  67. const gchar *stock_id);
  68. /* Manage the default icon factory stack */
  69. void gtk_icon_factory_add_default (GtkIconFactory *factory);
  70. void gtk_icon_factory_remove_default (GtkIconFactory *factory);
  71. GtkIconSet* gtk_icon_factory_lookup_default (const gchar *stock_id);
  72. /* Get preferred real size from registered semantic size. Note that
  73. * themes SHOULD use this size, but they aren't required to; for size
  74. * requests and such, you should get the actual pixbuf from the icon
  75. * set and see what size was rendered.
  76. *
  77. * This function is intended for people who are scaling icons,
  78. * rather than for people who are displaying already-scaled icons.
  79. * That is, if you are displaying an icon, you should get the
  80. * size from the rendered pixbuf, not from here.
  81. */
  82. #ifndef GDK_MULTIHEAD_SAFE
  83. gboolean gtk_icon_size_lookup (GtkIconSize size,
  84. gint *width,
  85. gint *height);
  86. #endif /* GDK_MULTIHEAD_SAFE */
  87. gboolean gtk_icon_size_lookup_for_settings (GtkSettings *settings,
  88. GtkIconSize size,
  89. gint *width,
  90. gint *height);
  91. GtkIconSize gtk_icon_size_register (const gchar *name,
  92. gint width,
  93. gint height);
  94. void gtk_icon_size_register_alias (const gchar *alias,
  95. GtkIconSize target);
  96. GtkIconSize gtk_icon_size_from_name (const gchar *name);
  97. G_CONST_RETURN gchar* gtk_icon_size_get_name (GtkIconSize size);
  98. /* Icon sets */
  99. GType gtk_icon_set_get_type (void) G_GNUC_CONST;
  100. GtkIconSet* gtk_icon_set_new (void);
  101. GtkIconSet* gtk_icon_set_new_from_pixbuf (GdkPixbuf *pixbuf);
  102. GtkIconSet* gtk_icon_set_ref (GtkIconSet *icon_set);
  103. void gtk_icon_set_unref (GtkIconSet *icon_set);
  104. GtkIconSet* gtk_icon_set_copy (GtkIconSet *icon_set);
  105. /* Get one of the icon variants in the set, creating the variant if
  106. * necessary.
  107. */
  108. GdkPixbuf* gtk_icon_set_render_icon (GtkIconSet *icon_set,
  109. GtkStyle *style,
  110. GtkTextDirection direction,
  111. GtkStateType state,
  112. GtkIconSize size,
  113. GtkWidget *widget,
  114. const char *detail);
  115. void gtk_icon_set_add_source (GtkIconSet *icon_set,
  116. const GtkIconSource *source);
  117. void gtk_icon_set_get_sizes (GtkIconSet *icon_set,
  118. GtkIconSize **sizes,
  119. gint *n_sizes);
  120. GType gtk_icon_source_get_type (void) G_GNUC_CONST;
  121. GtkIconSource* gtk_icon_source_new (void);
  122. GtkIconSource* gtk_icon_source_copy (const GtkIconSource *source);
  123. void gtk_icon_source_free (GtkIconSource *source);
  124. void gtk_icon_source_set_filename (GtkIconSource *source,
  125. const gchar *filename);
  126. void gtk_icon_source_set_icon_name (GtkIconSource *source,
  127. const gchar *icon_name);
  128. void gtk_icon_source_set_pixbuf (GtkIconSource *source,
  129. GdkPixbuf *pixbuf);
  130. G_CONST_RETURN gchar* gtk_icon_source_get_filename (const GtkIconSource *source);
  131. G_CONST_RETURN gchar* gtk_icon_source_get_icon_name (const GtkIconSource *source);
  132. GdkPixbuf* gtk_icon_source_get_pixbuf (const GtkIconSource *source);
  133. void gtk_icon_source_set_direction_wildcarded (GtkIconSource *source,
  134. gboolean setting);
  135. void gtk_icon_source_set_state_wildcarded (GtkIconSource *source,
  136. gboolean setting);
  137. void gtk_icon_source_set_size_wildcarded (GtkIconSource *source,
  138. gboolean setting);
  139. gboolean gtk_icon_source_get_size_wildcarded (const GtkIconSource *source);
  140. gboolean gtk_icon_source_get_state_wildcarded (const GtkIconSource *source);
  141. gboolean gtk_icon_source_get_direction_wildcarded (const GtkIconSource *source);
  142. void gtk_icon_source_set_direction (GtkIconSource *source,
  143. GtkTextDirection direction);
  144. void gtk_icon_source_set_state (GtkIconSource *source,
  145. GtkStateType state);
  146. void gtk_icon_source_set_size (GtkIconSource *source,
  147. GtkIconSize size);
  148. GtkTextDirection gtk_icon_source_get_direction (const GtkIconSource *source);
  149. GtkStateType gtk_icon_source_get_state (const GtkIconSource *source);
  150. GtkIconSize gtk_icon_source_get_size (const GtkIconSource *source);
  151. /* ignore this */
  152. void _gtk_icon_set_invalidate_caches (void);
  153. GList* _gtk_icon_factory_list_ids (void);
  154. void _gtk_icon_factory_ensure_default_icons (void);
  155. G_END_DECLS
  156. #endif /* __GTK_ICON_FACTORY_H__ */