From e1e2225ca831192fc5ec5a28a5c2ff7b9f779ec4 Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Mon, 5 Mar 2012 23:42:25 +0000 Subject: Clean up our fork of Gtk::Ruler a bit (bzr r11049) --- src/ui/widget/ruler.cpp | 15 +++ src/ui/widget/ruler.h | 314 +----------------------------------------------- 2 files changed, 19 insertions(+), 310 deletions(-) (limited to 'src/ui') diff --git a/src/ui/widget/ruler.cpp b/src/ui/widget/ruler.cpp index 0f734938e..ecbd641a7 100644 --- a/src/ui/widget/ruler.cpp +++ b/src/ui/widget/ruler.cpp @@ -34,6 +34,21 @@ #include "sp-namedview.h" #include "verbs.h" +namespace Gtk { +namespace Deprecated { +void Ruler::set_range(double lower, double upper, double position, double max_size) +{ +gtk_deprecated_ruler_set_range(gobj(), lower, upper, position, max_size); +} + +void Ruler::get_range(double& lower, double& upper, double& position, double& max_size) +{ +gtk_deprecated_ruler_get_range(gobj(), &(lower), &(upper), &(position), &(max_size)); +} +}// namespace Deprecated +}// namespace Gtk + + namespace Inkscape { namespace UI { namespace Widget { diff --git a/src/ui/widget/ruler.h b/src/ui/widget/ruler.h index e29b8f8a4..d63c585a8 100644 --- a/src/ui/widget/ruler.h +++ b/src/ui/widget/ruler.h @@ -19,135 +19,40 @@ namespace Glib { class ustring; } -#ifndef DOXYGEN_SHOULD_SKIP_THIS typedef struct _GtkDeprecatedRuler GtkDeprecatedRuler; -typedef struct _GtkDeprecatedRulerClass GtkDeprecatedRulerClass; typedef struct _GtkDeprecatedVRuler GtkDeprecatedVRuler; -typedef struct _GtkDeprecatedVRulerClass GtkDeprecatedVRulerClass; typedef struct _GtkDeprecatedHRuler GtkDeprecatedHRuler; -typedef struct _GtkDeprecatedHRulerClass GtkDeprecatedHRulerClass; -#endif /* DOXYGEN_SHOULD_SKIP_THIS */ -// This is an import of the now-deprecated Gtk::Ruler class. - +// This is an import of the now-deprecated Gtk::Ruler API. namespace Gtk { namespace Deprecated { -class Ruler_Class; -class VRuler_Class; -class HRuler_Class; /** Base class for horizontal or vertical rulers. * * This is an abstract base for Gtk::HRuler and * Gtk::VRuler. Users should only instantiate those types. */ - class Ruler : public Widget { - public: -#ifndef DOXYGEN_SHOULD_SKIP_THIS - typedef Ruler CppObjectType; - typedef Ruler_Class CppClassType; - typedef GtkDeprecatedRuler BaseObjectType; - typedef GtkDeprecatedRulerClass BaseClassType; -#endif /* DOXYGEN_SHOULD_SKIP_THIS */ - +public: virtual ~Ruler(); -#ifndef DOXYGEN_SHOULD_SKIP_THIS - -private: - friend class Ruler_Class; - static CppClassType ruler_class_; - - // noncopyable - Ruler(const Ruler&); - Ruler& operator=(const Ruler&); - protected: explicit Ruler(const Glib::ConstructParams& construct_params); explicit Ruler(GtkDeprecatedRuler* castitem); -#endif /* DOXYGEN_SHOULD_SKIP_THIS */ - public: -#ifndef DOXYGEN_SHOULD_SKIP_THIS - static GType get_type() G_GNUC_CONST; - - - static GType get_base_type() G_GNUC_CONST; -#endif - ///Provides access to the underlying C GtkObject. GtkDeprecatedRuler* gobj() { return reinterpret_cast(gobject_); } ///Provides access to the underlying C GtkObject. const GtkDeprecatedRuler* gobj() const { return reinterpret_cast(gobject_); } - -public: - //C++ methods used to invoke GTK+ virtual functions: - -protected: - //GTK+ Virtual Functions (override these to change behaviour): - - //Default Signal Handlers:: - - -private: - - protected: Ruler(); public: - - - /** Sets the desired metric of the ruler. The possible choices are: - *
  • Gtk::PIXELS - *
  • Gtk::INCHES - *
  • Gtk::CENTIMETERS - *
The default metric is Gtk::PIXELS. - */ - void set_metric(MetricType metric = PIXELS); - - - /** Gets the units used for a Gtk::Ruler. See set_metric(). - * @return The units currently used for @a ruler - * - * @a Deprecated: 2.24: Gtk::Ruler has been removed from GTK 3 for being - * unmaintained and too specialized. There is no replacement. - */ - MetricType get_metric() const; - -#ifndef GTKMM_DISABLE_DEPRECATED - - /** Gets the units used for a Gtk::Ruler. See set_metric(). - * @deprecated Use the const version - * @return The units currently used for @a ruler - * - * @a Deprecated: 2.24: Gtk::Ruler has been removed from GTK 3 for being - * unmaintained and too specialized. There is no replacement. - */ - MetricType get_metric(); -#endif // GTKMM_DISABLE_DEPRECATED - - -#ifndef GTKMM_DISABLE_DEPRECATED - -//TODO: Remove these when we can break ABI: - - /** @deprecated Use get_range() instead. - */ - double get_range_lower() const; - - /** @deprecated Use get_range() instead. - */ - double get_range_upper() const; - #endif // GTKMM_DISABLE_DEPRECATED - - /** sets the range of the ruler. * upper and lower arguments denote the extents of the Ruler. * max_size is the largest number displayed by the ruler. @@ -159,8 +64,6 @@ public: /** Retrieves values indicating the range and current position of a Gtk::Ruler. * See set_range(). * - * @a Deprecated: 2.24: Gtk::Ruler has been removed from GTK 3 for being - * unmaintained and too specialized. There is no replacement. * @param lower Location to store lower limit of the ruler, or 0. * @param upper Location to store upper limit of the ruler, or 0. * @param position Location to store the current position of the mark on the ruler, or 0. @@ -168,123 +71,6 @@ public: * the space to leave for the text, or 0. */ void get_range(double& lower, double& upper, double& position, double& max_size); - - - /** draw tick marks on the ruler - */ - void draw_ticks(); - - - /** draw a position indicator on the ruler - */ - void draw_pos(); - - virtual void draw_ticks_vfunc(); - - virtual void draw_pos_vfunc(); - - - #ifdef GLIBMM_PROPERTIES_ENABLED -/** Lower limit of ruler. - * - * You rarely need to use properties because there are get_ and set_ methods for almost all of them. - * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when - * the value of the property changes. - */ - Glib::PropertyProxy property_lower() ; -#endif //#GLIBMM_PROPERTIES_ENABLED - -#ifdef GLIBMM_PROPERTIES_ENABLED -/** Lower limit of ruler. - * - * You rarely need to use properties because there are get_ and set_ methods for almost all of them. - * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when - * the value of the property changes. - */ - Glib::PropertyProxy_ReadOnly property_lower() const; -#endif //#GLIBMM_PROPERTIES_ENABLED - - #ifdef GLIBMM_PROPERTIES_ENABLED -/** Upper limit of ruler. - * - * You rarely need to use properties because there are get_ and set_ methods for almost all of them. - * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when - * the value of the property changes. - */ - Glib::PropertyProxy property_upper() ; -#endif //#GLIBMM_PROPERTIES_ENABLED - -#ifdef GLIBMM_PROPERTIES_ENABLED -/** Upper limit of ruler. - * - * You rarely need to use properties because there are get_ and set_ methods for almost all of them. - * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when - * the value of the property changes. - */ - Glib::PropertyProxy_ReadOnly property_upper() const; -#endif //#GLIBMM_PROPERTIES_ENABLED - - #ifdef GLIBMM_PROPERTIES_ENABLED -/** Position of mark on the ruler. - * - * You rarely need to use properties because there are get_ and set_ methods for almost all of them. - * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when - * the value of the property changes. - */ - Glib::PropertyProxy property_position() ; -#endif //#GLIBMM_PROPERTIES_ENABLED - -#ifdef GLIBMM_PROPERTIES_ENABLED -/** Position of mark on the ruler. - * - * You rarely need to use properties because there are get_ and set_ methods for almost all of them. - * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when - * the value of the property changes. - */ - Glib::PropertyProxy_ReadOnly property_position() const; -#endif //#GLIBMM_PROPERTIES_ENABLED - - #ifdef GLIBMM_PROPERTIES_ENABLED -/** Maximum size of the ruler. - * - * You rarely need to use properties because there are get_ and set_ methods for almost all of them. - * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when - * the value of the property changes. - */ - Glib::PropertyProxy property_max_size() ; -#endif //#GLIBMM_PROPERTIES_ENABLED - -#ifdef GLIBMM_PROPERTIES_ENABLED -/** Maximum size of the ruler. - * - * You rarely need to use properties because there are get_ and set_ methods for almost all of them. - * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when - * the value of the property changes. - */ - Glib::PropertyProxy_ReadOnly property_max_size() const; -#endif //#GLIBMM_PROPERTIES_ENABLED - - #ifdef GLIBMM_PROPERTIES_ENABLED -/** The metric used for the ruler. - * - * You rarely need to use properties because there are get_ and set_ methods for almost all of them. - * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when - * the value of the property changes. - */ - Glib::PropertyProxy property_metric() ; -#endif //#GLIBMM_PROPERTIES_ENABLED - -#ifdef GLIBMM_PROPERTIES_ENABLED -/** The metric used for the ruler. - * - * You rarely need to use properties because there are get_ and set_ methods for almost all of them. - * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when - * the value of the property changes. - */ - Glib::PropertyProxy_ReadOnly property_metric() const; -#endif //#GLIBMM_PROPERTIES_ENABLED - - }; @@ -292,129 +78,37 @@ public: class VRuler : public Ruler { public: -#ifndef DOXYGEN_SHOULD_SKIP_THIS - typedef VRuler CppObjectType; - typedef VRuler_Class CppClassType; - typedef GtkDeprecatedVRuler BaseObjectType; - typedef GtkDeprecatedVRulerClass BaseClassType; -#endif /* DOXYGEN_SHOULD_SKIP_THIS */ - virtual ~VRuler(); -#ifndef DOXYGEN_SHOULD_SKIP_THIS - -private: - friend class VRuler_Class; - static CppClassType vruler_class_; - - // noncopyable - VRuler(const VRuler&); - VRuler& operator=(const VRuler&); - -protected: - explicit VRuler(const Glib::ConstructParams& construct_params); - explicit VRuler(GtkDeprecatedVRuler* castitem); - -#endif /* DOXYGEN_SHOULD_SKIP_THIS */ - public: -#ifndef DOXYGEN_SHOULD_SKIP_THIS - static GType get_type() G_GNUC_CONST; - - - static GType get_base_type() G_GNUC_CONST; -#endif - ///Provides access to the underlying C GtkObject. GtkDeprecatedVRuler* gobj() { return reinterpret_cast(gobject_); } ///Provides access to the underlying C GtkObject. const GtkDeprecatedVRuler* gobj() const { return reinterpret_cast(gobject_); } - -public: - //C++ methods used to invoke GTK+ virtual functions: - -protected: - //GTK+ Virtual Functions (override these to change behaviour): - - //Default Signal Handlers:: - - -private: - - public: VRuler(); - - }; //class VRuler /** Horizontal Ruler */ class HRuler : public Ruler { public: -#ifndef DOXYGEN_SHOULD_SKIP_THIS - typedef HRuler CppObjectType; - typedef HRuler_Class CppClassType; - typedef GtkDeprecatedHRuler BaseObjectType; - typedef GtkDeprecatedHRulerClass BaseClassType; -#endif /* DOXYGEN_SHOULD_SKIP_THIS */ - virtual ~HRuler(); -#ifndef DOXYGEN_SHOULD_SKIP_THIS - -private: - friend class HRuler_Class; - static CppClassType hruler_class_; - - // noncopyable - HRuler(const HRuler&); - HRuler& operator=(const HRuler&); - -protected: - explicit HRuler(const Glib::ConstructParams& construct_params); - explicit HRuler(GtkDeprecatedHRuler* castitem); - -#endif /* DOXYGEN_SHOULD_SKIP_THIS */ - public: -#ifndef DOXYGEN_SHOULD_SKIP_THIS - static GType get_type() G_GNUC_CONST; - - - static GType get_base_type() G_GNUC_CONST; -#endif - ///Provides access to the underlying C GtkObject. GtkDeprecatedHRuler* gobj() { return reinterpret_cast(gobject_); } ///Provides access to the underlying C GtkObject. const GtkDeprecatedHRuler* gobj() const { return reinterpret_cast(gobject_); } - - -public: - //C++ methods used to invoke GTK+ virtual functions: - -protected: - //GTK+ Virtual Functions (override these to change behaviour): - - //Default Signal Handlers:: - - -private: - public: HRuler(); - - }; // class HRuler - - -} -} +} // namespace Deprecated +} // namespace Gtk -- cgit v1.2.3