style.h
Go to the documentation of this file.00001
00002
00003 #ifndef _GOOCANVASMM_STYLE_H
00004 #define _GOOCANVASMM_STYLE_H
00005
00006
00007 #include <glibmm.h>
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include <glibmm/object.h>
00028 #include <cairomm/context.h>
00029 #include <cairomm/refptr.h>
00030
00031 #include <goocanvasstyle.h>
00032
00033
00034 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00035 typedef struct _GooCanvasStyle GooCanvasStyle;
00036 typedef struct _GooCanvasStyleClass GooCanvasStyleClass;
00037 #endif
00038
00039
00040 namespace Goocanvas
00041 { class Style_Class; }
00042 namespace Goocanvas
00043 {
00044
00045
00046 class Style : public Glib::Object
00047 {
00048
00049 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00050
00051 public:
00052 typedef Style CppObjectType;
00053 typedef Style_Class CppClassType;
00054 typedef GooCanvasStyle BaseObjectType;
00055 typedef GooCanvasStyleClass BaseClassType;
00056
00057 private: friend class Style_Class;
00058 static CppClassType style_class_;
00059
00060 private:
00061
00062 Style(const Style&);
00063 Style& operator=(const Style&);
00064
00065 protected:
00066 explicit Style(const Glib::ConstructParams& construct_params);
00067 explicit Style(GooCanvasStyle* castitem);
00068
00069 #endif
00070
00071 public:
00072 virtual ~Style();
00073
00074 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00075 static GType get_type() G_GNUC_CONST;
00076 static GType get_base_type() G_GNUC_CONST;
00077 #endif
00078
00080 GooCanvasStyle* gobj() { return reinterpret_cast<GooCanvasStyle*>(gobject_); }
00081
00083 const GooCanvasStyle* gobj() const { return reinterpret_cast<GooCanvasStyle*>(gobject_); }
00084
00086 GooCanvasStyle* gobj_copy();
00087
00088 private:
00089
00090 protected:
00091 Style();
00092
00093 public:
00094
00095 static Glib::RefPtr<Style> create();
00096
00097
00098 template<typename PropertyType>
00099 void get_property(GQuark property_id, PropertyType& value) const;
00100
00101
00102 template<typename PropertyType>
00103 void set_property(GQuark property_id, const PropertyType& value);
00104
00105
00110 Glib::RefPtr<Style> copy() const;
00111
00115 Glib::RefPtr<Style> get_parent() const;
00116
00120 void set_parent(const Glib::RefPtr<Style>& style);
00121
00127 bool set_stroke_options(const Cairo::RefPtr<Cairo::Context>& context);
00128
00134 bool set_fill_options(const Cairo::RefPtr<Cairo::Context>& context);
00135
00136
00137 public:
00138
00139 public:
00140
00141 #ifdef GLIBMM_VFUNCS_ENABLED
00142 #endif //GLIBMM_VFUNCS_ENABLED
00143
00144 protected:
00145
00146 #ifdef GLIBMM_VFUNCS_ENABLED
00147 #endif //GLIBMM_VFUNCS_ENABLED
00148
00149
00150 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00151 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00152
00153
00154 };
00155
00156 template<typename PropertyType> inline
00157 void Style::get_property(GQuark property_id, PropertyType& value) const
00158 {
00159 Glib::Value<PropertyType> property_value(goo_canvas_style_get_property(const_cast<GooCanvasStyle*>(gobj()), property_id));
00160 value = property_value.get();
00161 }
00162
00163 template<typename PropertyType> inline
00164 void Style::set_property(GQuark property_id, const PropertyType& value)
00165 {
00166 Glib::Value<PropertyType> property_value;
00167 property_value.init(Glib::Value<PropertyType>::value_type());
00168 property_value.set(value);
00169 goo_canvas_style_set_property(gobj(), property_id, property_value.gobj());
00170 }
00171
00172 }
00173
00174
00175 namespace Glib
00176 {
00185 Glib::RefPtr<Goocanvas::Style> wrap(GooCanvasStyle* object, bool take_copy = false);
00186 }
00187
00188
00189 #endif
00190