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

cellrenderer.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 00023 00024 #ifndef GFC_GTK_CELL_RENDERER_HH 00025 #define GFC_GTK_CELL_RENDERER_HH 00026 00027 #ifndef GFC_GTK_OBJECT_HH 00028 #include <gfc/gtk/object.hh> 00029 #endif 00030 00031 #ifndef GFC_GTK_ENUMS_HH 00032 #include <gfc/gtk/enums.hh> 00033 #endif 00034 00035 #ifndef GFC_G_PROPERTY_HH 00036 #include <gfc/glib/property.hh> 00037 #endif 00038 00039 #ifndef __GTK_CELL_RENDERER_H__ 00040 #include <gtk/gtkcellrenderer.h> 00041 #endif 00042 00043 namespace GFC { 00044 00045 namespace Gdk { 00046 class Color; 00047 class Event; 00048 class Rectangle; 00049 class Window; 00050 } 00051 00052 namespace Gtk { 00053 00054 class CellEditable; 00055 class Widget; 00056 00059 00060 enum CellRendererState 00061 { 00062 CELL_RENDERER_SELECTED = GTK_CELL_RENDERER_SELECTED, 00063 CELL_RENDERER_PRELIT = GTK_CELL_RENDERER_PRELIT, 00064 CELL_RENDERER_INSENSITIVE = GTK_CELL_RENDERER_INSENSITIVE, 00065 CELL_RENDERER_SORTED = GTK_CELL_RENDERER_SORTED, 00066 CELL_RENDERER_FOCUSED = GTK_CELL_RENDERER_FOCUSED 00067 }; 00068 00070 00071 typedef unsigned int CellRendererStateField; 00072 00075 00076 enum CellRendererMode 00077 { 00078 INERT = GTK_CELL_RENDERER_MODE_INERT, 00079 ACTIVATABLE = GTK_CELL_RENDERER_MODE_ACTIVATABLE, 00080 EDITABLE = GTK_CELL_RENDERER_MODE_EDITABLE 00081 }; 00082 00096 00097 class CellRenderer : public Object 00098 { 00099 friend class G::Object; 00100 00101 CellRenderer(const CellRenderer&); 00102 CellRenderer& operator=(const CellRenderer&); 00103 00104 protected: 00107 00108 explicit CellRenderer(GtkCellRenderer *cell, bool owns_reference = false); 00115 00119 00120 void editing_canceled(); 00125 00129 00130 typedef G::Property<CellRendererMode, int> ModePropertyType; 00131 typedef G::PropertyProxy<G::Object, ModePropertyType> ModePropertyProxy; 00132 static const ModePropertyType mode_property; 00134 00135 typedef G::Property<bool> VisiblePropertyType; 00136 typedef G::PropertyProxy<G::Object, VisiblePropertyType> VisiblePropertyProxy; 00137 static const VisiblePropertyType visible_property; 00139 00140 typedef G::Property<float> XAlignPropertyType; 00141 typedef G::PropertyProxy<G::Object, XAlignPropertyType> XAlignPropertyProxy; 00142 static const XAlignPropertyType xalign_property; 00144 00145 typedef G::Property<float> YAlignPropertyType; 00146 typedef G::PropertyProxy<G::Object, YAlignPropertyType> YAlignPropertyProxy; 00147 static const YAlignPropertyType yalign_property; 00149 00150 typedef G::Property<unsigned int> XPadPropertyType; 00151 typedef G::PropertyProxy<G::Object, XPadPropertyType> XPadPropertyProxy; 00152 static const XPadPropertyType xpad_property; 00154 00155 typedef G::Property<unsigned int> YPadPropertyType; 00156 typedef G::PropertyProxy<G::Object, YPadPropertyType> YPadPropertyProxy; 00157 static const YPadPropertyType ypad_property; 00159 00160 typedef G::Property<int> WidthPropertyType; 00161 typedef G::PropertyProxy<G::Object, WidthPropertyType> WidthPropertyProxy; 00162 static const WidthPropertyType width_property; 00164 00165 typedef G::Property<int> HeightPropertyType; 00166 typedef G::PropertyProxy<G::Object, HeightPropertyType> HeightPropertyProxy; 00167 static const HeightPropertyType height_property; 00169 00170 typedef G::Property<bool> IsExpanderPropertyType; 00171 typedef G::PropertyProxy<G::Object, IsExpanderPropertyType> IsExpanderPropertyProxy; 00172 static const IsExpanderPropertyType is_expander_property; 00174 00175 typedef G::Property<bool> IsExpandedPropertyType; 00176 typedef G::PropertyProxy<G::Object, IsExpandedPropertyType> IsExpandedPropertyProxy; 00177 static const IsExpandedPropertyType is_expanded_property; 00179 00180 typedef G::WritableProperty<String> CellBackgroundPropertyType; 00181 typedef G::PropertyProxy<G::Object, CellBackgroundPropertyType> CellBackgroundPropertyProxy; 00182 static const CellBackgroundPropertyType cell_background_property; 00184 00185 typedef G::Property<Pointer<Gdk::Color> > CellBackgroundGdkPropertyType; 00186 typedef G::PropertyProxy<G::Object, CellBackgroundGdkPropertyType> CellBackgroundGdkPropertyProxy; 00187 static const CellBackgroundGdkPropertyType cell_background_gdk_property; 00189 00190 typedef G::Property<bool> CellBackgroundSetPropertyType; 00191 typedef G::PropertyProxy<G::Object, CellBackgroundSetPropertyType> CellBackgroundSetPropertyProxy; 00192 static const CellBackgroundSetPropertyType cell_background_set_property; 00194 00198 00199 typedef G::Signal<void> EditingCanceledSignalType; 00200 typedef G::SignalProxy<TypeInstance, EditingCanceledSignalType> EditingCanceledSignalProxy; 00201 static const EditingCanceledSignalType editing_canceled_signal; 00206 00208 00209 public: 00212 00213 virtual ~CellRenderer(); 00215 00219 00220 GtkCellRenderer* gtk_cell_renderer() const; 00222 00223 operator GtkCellRenderer* () const; 00225 00226 void get_fixed_size(int *width, int *height) const; 00230 00231 void get_size(const Widget& widget, const Gdk::Rectangle *cell_area, 00232 int *x_offset, int *y_offset, int *width, int *height) const; 00246 00250 00251 void render(Gdk::Window& window, Widget& widget, const Gdk::Rectangle *background_area, 00252 const Gdk::Rectangle *cell_area, const Gdk::Rectangle *expose_area, 00253 CellRendererStateField flags); 00268 00269 bool activate(const Gdk::Event *event, Widget *widget, const String& path, 00270 const Gdk::Rectangle *background_area, const Gdk::Rectangle *cell_area, 00271 CellRendererStateField flags); 00284 00285 Pointer<CellEditable> start_editing(const Gdk::Event *event, Widget *widget, const String& path, 00286 const Gdk::Rectangle *background_area, const Gdk::Rectangle *cell_area, 00287 CellRendererStateField flags); 00297 00298 void set_fixed_size(int width, int height); 00302 00306 00307 const ModePropertyProxy prop_mode(); 00309 00310 const VisiblePropertyProxy prop_visible(); 00312 00313 const XAlignPropertyProxy prop_xalign(); 00315 00316 const YAlignPropertyProxy prop_yalign(); 00318 00319 const XPadPropertyProxy prop_xpad(); 00321 00322 const YPadPropertyProxy prop_ypad(); 00324 00325 const WidthPropertyProxy prop_width(); 00327 00328 const HeightPropertyProxy prop_height(); 00330 00331 const IsExpanderPropertyProxy prop_is_expander(); 00333 00334 const IsExpandedPropertyProxy prop_is_expanded(); 00336 00337 const CellBackgroundPropertyProxy prop_cell_background(); 00339 00340 const CellBackgroundGdkPropertyProxy prop_cell_background_gdk(); 00342 00343 const CellBackgroundSetPropertyProxy prop_cell_background_set(); 00345 00349 00350 const EditingCanceledSignalProxy sig_editing_canceled(); 00353 00355 }; 00356 00357 } // namespace Gtk 00358 00359 } // namespace GFC 00360 00361 #include <gfc/gtk/inline/cellrenderer.inl> 00362 00363 #endif // GFC_GTK_CELL_RENDERER_HH 00364

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