GFC Logo GFC Title Logo
Reference Manual
Main Page  |  Namespace List  |  Alphabetical List  |  Class List  |  File List

icontheme.hh

Go to the documentation of this file.
00001 /* GFC-UI: GTK+ Foundation Classes (User Interface Library) 00002 * Copyright (C) 2004 The GFC Development Team. 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU Library General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Library General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 */ 00018 00023 00024 #ifndef GFC_GTK_ICON_THEME_HH 00025 #define GFC_GTK_ICON_THEME_HH 00026 00027 #ifndef GFC_G_BOXED_HH 00028 #include <gfc/glib/boxed.hh> 00029 #endif 00030 00031 #ifndef GFC_G_OBJECT_HH 00032 #include <gfc/glib/object.hh> 00033 #endif 00034 00035 #ifndef __GTK_ICON_THEME_H__ 00036 #include <gtk/gtkicontheme.h> 00037 #endif 00038 00039 #ifndef _CPP_VECTOR 00040 #include <vector> 00041 #endif 00042 00043 namespace GFC { 00044 00045 namespace G { 00046 class Error; 00047 } 00048 00049 namespace Gdk { 00050 class Pixbuf; 00051 class Point; 00052 class Rectangle; 00053 class Screen; 00054 } 00055 00056 namespace Gtk { 00057 00060 00061 enum IconLookupFlags 00062 { 00063 ICON_LOOKUP_NO_SVG = GTK_ICON_LOOKUP_NO_SVG, 00066 00067 ICON_LOOKUP_FORCE_SVG = GTK_ICON_LOOKUP_FORCE_SVG, 00069 00070 ICON_LOOKUP_USE_BUILTIN = GTK_ICON_LOOKUP_USE_BUILTIN 00074 }; 00075 00077 00078 typedef unsigned int IconLookupFlagsField; 00079 00082 00083 enum IconThemeError 00084 { 00085 ICON_THEME_NOT_FOUND = GTK_ICON_THEME_NOT_FOUND, 00086 ICON_THEME_FAILED = GTK_ICON_THEME_FAILED 00087 }; 00088 00094 00095 class IconInfo : public G::Boxed 00096 { 00097 public: 00100 00101 explicit IconInfo(GtkIconInfo *icon_info); 00107 00108 IconInfo(GtkIconInfo *icon_info, bool copy); 00116 00117 IconInfo(const IconInfo& src); 00119 00120 ~IconInfo(); 00122 00123 IconInfo& operator=(const IconInfo& src); 00125 00129 00130 GtkIconInfo* gtk_icon_info() const; 00132 00133 operator GtkIconInfo* () const; 00135 00136 int get_base_size() const; 00144 00145 String get_filename() const; 00152 00153 Gdk::Pixbuf* get_builtin_pixbuf() const; 00159 00160 bool get_embedded_rect(Gdk::Rectangle& rectangle) const; 00168 00169 std::vector<Gdk::Point> get_attach_points() const; 00175 00176 bool has_attach_points() const; 00179 00180 String get_display_name() const; 00186 00190 00191 Pointer<Gdk::Pixbuf> load_icon(G::Error *error = 0); 00195 00204 00205 void set_raw_coordinates(bool raw_coordinates); 00220 00222 }; 00223 00281 00282 class IconTheme : public G::Object 00283 { 00284 friend class G::Object; 00285 00286 IconTheme(const IconTheme&); 00287 IconTheme& operator=(const IconTheme&); 00288 00289 protected: 00292 00293 explicit IconTheme(GtkIconTheme *icon_theme, bool owns_reference = true); 00300 00304 00305 typedef G::Signal<void> ChangedSignalType; 00306 typedef G::SignalProxy<TypeInstance, ChangedSignalType> ChangedSignalProxy; 00307 static const ChangedSignalType changed_signal; 00312 00314 00315 public: 00318 00319 IconTheme(); 00323 00324 virtual ~IconTheme(); 00326 00328 00329 static IconTheme* get_for_screen(const Gdk::Screen *screen = 0); 00344 00345 static void add_builtin_icon(const char *icon_name, int size, Gdk::Pixbuf& pixbuf); 00346 static void add_builtin_icon(const String& icon_name, int size, Gdk::Pixbuf& pixbuf); 00363 00366 00367 GtkIconTheme* gtk_icon_theme() const; 00369 00370 operator GtkIconTheme* () const; 00372 00373 std::vector<String> get_search_path() const; 00376 00377 String get_example_icon_name() const; 00381 00382 bool has_icon(const char *icon_name) const; 00383 bool has_icon(const String& icon_name) const; 00387 00391 00392 void set_screen(Gdk::Screen *screen); 00398 00399 void set_search_path(const std::vector<String>& path); 00413 00414 void append_search_path(const char *path); 00415 void append_search_path(const String& path); 00418 00419 void prepend_search_path(const char *path); 00420 void prepend_search_path(const String& path); 00423 00424 void set_custom_theme(const char *theme_name); 00425 void set_custom_theme(const String& theme_name); 00432 00433 Pointer<IconInfo> lookup_icon(const char *icon_name, int size, IconLookupFlagsField flags); 00434 Pointer<IconInfo> lookup_icon(const String& icon_name, int size, IconLookupFlagsField flags); 00444 00445 Pointer<Gdk::Pixbuf> load_icon(const char *icon_name, int size, IconLookupFlagsField flags, G::Error *error = 0); 00446 Pointer<Gdk::Pixbuf> load_icon(const String& icon_name, int size, IconLookupFlagsField flags, G::Error *error = 0); 00460 00461 std::vector<String> list_icons(const char *context = 0); 00462 std::vector<String> list_icons(const String& context); 00470 00471 bool rescan_if_needed(); 00475 00479 00480 const ChangedSignalProxy sig_changed(); 00483 00485 }; 00486 00487 } // namespace Gtk 00488 00489 } // namespace GFC 00490 00491 #include <gfc/gtk/inline/icontheme.inl> 00492 00493 #endif // GFC_GTK_ICON_THEME_HH 00494

Generated on Tue Aug 24 00:34:31 2004 for GFC-UI by doxygen 1.3.8