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

colorselection.hh

Go to the documentation of this file.
00001 /* GFC-UI: GTK+ Foundation Classes (User Interface Library) 00002 * Copyright (C) 2002-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 00026 00027 #ifndef GFC_GTK_COLOR_SELECTION_HH 00028 #define GFC_GTK_COLOR_SELECTION_HH 00029 00030 #ifndef GFC_GTK_VBOX_HH 00031 #include <gfc/gtk/box.hh> 00032 #endif 00033 00034 #ifndef GFC_GTK_DIALOG_HH 00035 #include <gfc/gtk/dialog.hh> 00036 #endif 00037 00038 #ifndef __GTK_COLOR_SELECTION_H__ 00039 #include <gtk/gtkcolorsel.h> 00040 #endif 00041 00042 #ifndef __GTK_COLOR_SELECTION_DIALOG_H__ 00043 #include <gtk/gtkcolorseldialog.h> 00044 #endif 00045 00046 namespace GFC { 00047 00048 namespace Gdk { 00049 class Color; 00050 } 00051 00052 namespace Gtk { 00053 00054 class Button; 00055 00063 00064 class ColorSelection : public VBox 00065 { 00066 friend class G::Object; 00067 00068 ColorSelection(const ColorSelection&); 00069 ColorSelection& operator=(const ColorSelection&); 00070 00071 protected: 00074 00075 explicit ColorSelection(GtkColorSelection *color_selection, bool owns_reference = false); 00082 00086 00087 typedef G::Signal<void> ColorChangedSignalType; 00088 typedef G::SignalProxy<TypeInstance, ColorChangedSignalType> ColorChangedSignalProxy; 00089 static const ColorChangedSignalType color_changed_signal; 00094 00096 00097 public: 00100 00101 ColorSelection(); 00103 00104 virtual ~ColorSelection(); 00106 00110 00111 GtkColorSelection* gtk_color_selection() const; 00113 00114 operator GtkColorSelection* () const; 00116 00117 bool get_has_opacity_control() const; 00119 00120 bool get_has_palette() const; 00122 00123 Gdk::Color get_current_color() const; 00125 00126 unsigned short get_current_alpha() const; 00128 00129 Gdk::Color get_previous_color() const; 00131 00132 unsigned short get_previous_alpha() const; 00134 00135 bool is_adjusting() const; 00138 00140 00141 static bool palette_from_string(const String& str, std::vector<Pointer<Gdk::Color> >& colors); 00147 00148 static String palette_to_string(const std::vector<Pointer<Gdk::Color> >& colors); 00152 00155 00156 void set_has_opacity_control(bool has_opacity); 00160 00161 void set_has_palette(bool has_palette); 00164 00165 void set_current_color(const Gdk::Color& color); 00170 00171 void set_current_alpha(unsigned short alpha); 00176 00177 void set_previous_color(const Gdk::Color& color); 00184 00185 void set_previous_alpha(unsigned short alpha); 00191 00195 00196 const ColorChangedSignalProxy sig_color_changed(); 00199 00201 }; 00202 00208 00209 class ColorSelectionDialog : public Dialog 00210 { 00211 friend class G::Object; 00212 00213 ColorSelectionDialog(const ColorSelectionDialog&); 00214 ColorSelectionDialog& operator=(const ColorSelectionDialog&); 00215 00216 protected: 00219 00220 explicit ColorSelectionDialog(GtkColorSelectionDialog *color_selection_dialog, bool owns_reference = false); 00227 00229 00230 public: 00233 00234 ColorSelectionDialog(); 00236 00237 explicit ColorSelectionDialog(const char *title); 00238 explicit ColorSelectionDialog(const String& title); 00241 00242 virtual ~ColorSelectionDialog(); 00244 00248 00249 GtkColorSelectionDialog* gtk_color_selection_dialog() const; 00251 00252 operator GtkColorSelectionDialog* () const; 00254 00255 ColorSelection* colorsel() const; 00259 00260 Button* ok_button() const; 00262 00263 Button* cancel_button() const; 00265 00266 Button* help_button() const; 00268 00270 }; 00271 00272 } // namespace Gtk 00273 00274 } // namespace GFC 00275 00276 #include <gfc/gtk/inline/colorselection.inl> 00277 00278 #endif // GFC_GTK_COLOR_SELECTION_HH 00279

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