[gtkmm/remove-gdk-point] Remove Gdk::Point and update Gdk docs




commit ced762ff24b6563b0c234c9adb2cdbd4a57e2df4
Author: Andreas Persson <andreasp56 outlook com>
Date:   Sun Nov 1 09:43:44 2020 +0100

    Remove Gdk::Point and update Gdk docs
    
    Remove Gdk::Point as GdkPoint was removed from gtk. Update some Gdk
    class documentation with updates from gtk.

 gdk/src/frameclock.hg |  6 ++---
 gdk/src/popup.hg      |  6 ++++-
 gdk/src/rgba.hg       |  4 +--
 gdk/src/surface.hg    | 13 ++++++++--
 gdk/src/toplevel.hg   |  6 +++++
 gdk/src/types.ccg     | 63 --------------------------------------------
 gdk/src/types.hg      | 72 ---------------------------------------------------
 7 files changed, 27 insertions(+), 143 deletions(-)
---
diff --git a/gdk/src/frameclock.hg b/gdk/src/frameclock.hg
index 9c147d5c..70b93b9d 100644
--- a/gdk/src/frameclock.hg
+++ b/gdk/src/frameclock.hg
@@ -26,10 +26,10 @@ extern "C" typedef struct _GdkFrameClock GdkFrameClock;
 
 namespace Gdk
 {
-/** Frame clock syncs painting to a window or display.
+/** Synchronizes painting to a surface.
  *
- * A %Gdk::FrameClock tells the application when to update and repaint a
- * window. This may be synced to the vertical refresh rate of the
+ * A %Gdk::FrameClock tells the application when to update and repaint
+ * a surface. This may be synced to the vertical refresh rate of the
  * monitor, for example. Even when the frame clock uses a simple timer
  * rather than a hardware-based vertical sync, the frame clock helps
  * because it ensures everything paints at the same time (reducing the
diff --git a/gdk/src/popup.hg b/gdk/src/popup.hg
index 6fd27636..0f4fbade 100644
--- a/gdk/src/popup.hg
+++ b/gdk/src/popup.hg
@@ -36,8 +36,12 @@ namespace Gdk
 /** Interface for popup surfaces.
  *
  * A %Gdk::Popup is a surface that is attached to another surface,
- * and is positioned relative to it.
+ * called its property_parent(), and is positioned relative to it.
  *
+ * %Gdk::Popups are typically used to implement menus and similar popups.
+ * They can be modal, which is indicated by the property_autohide() property.
+ *
+ * @see Gdk::Toplevel, Gdk::Surface
  * @newin{3,98}
  */
 class GDKMM_API Popup : public Glib::Interface
diff --git a/gdk/src/rgba.hg b/gdk/src/rgba.hg
index b4c71655..94a9aa86 100644
--- a/gdk/src/rgba.hg
+++ b/gdk/src/rgba.hg
@@ -26,8 +26,8 @@ _DEFS(gdkmm,gdk)
 namespace Gdk
 {
 
-/** An RGBA Color.
- * The RGBA class is a convenient way to pass rgba colors around.
+/** An %RGBA color.
+ * The %RGBA class is a convenient way to pass colors around.
  * It's based on cairo's way to deal with (possibly translucent) colors and mirrors its behavior.
  * All values are in the range from 0.0 to 1.0 inclusive.
  * So the color (0.0, 0.0, 0.0, 0.0) represents transparent black and (1.0, 1.0, 1.0, 1.0) is opaque white.
diff --git a/gdk/src/surface.hg b/gdk/src/surface.hg
index 326c678e..76a6e290 100644
--- a/gdk/src/surface.hg
+++ b/gdk/src/surface.hg
@@ -44,8 +44,17 @@ class GDKMM_API Monitor;
 /** Onscreen display areas in the target window system.
  *
  * A %Gdk::Surface is a (usually) rectangular region on the screen.
- * It's a low-level object, used to implement high-level objects such
- * as Gtk::Window on the GTK level.
+ * It's a low-level object, used to implement high-level objects
+ * It’s a low-level object, used to implement high-level objects
+ * such as Gtk::Window or Gtk::Dialog in GTK.
+ *
+ * The surfaces you see in practice are either Gdk::Toplevel or
+ * Gdk::Popup, and those interfaces provide much of the required
+ * API to interact with these surfaces. Other, more specialized
+ * surface types exist, but you will rarely interact with them
+ * directly.
+ *
+ * @see Gdk::Toplevel, Gdk::Popup
  */
 class GDKMM_API Surface : public Glib::Object
 {
diff --git a/gdk/src/toplevel.hg b/gdk/src/toplevel.hg
index 8ba5aa1a..6e8106cc 100644
--- a/gdk/src/toplevel.hg
+++ b/gdk/src/toplevel.hg
@@ -45,6 +45,12 @@ _WRAP_ENUM(FullscreenMode, GdkFullscreenMode,
  *
  * A %Gdk::Toplevel is a freestanding toplevel surface.
  *
+ * The %Gdk::Toplevel interface provides useful APIs for
+ * interacting with the windowing system, such as controlling
+ * maximization and size of the surface, setting icons and
+ * transient parents for dialogs.
+ *
+ * @see Gdk::Surface, Gdk::Popup
  * @newin{3,98}
  */
 class GDKMM_API Toplevel : public Glib::Interface
diff --git a/gdk/src/types.ccg b/gdk/src/types.ccg
index a75ccd65..5d2dae51 100644
--- a/gdk/src/types.ccg
+++ b/gdk/src/types.ccg
@@ -14,66 +14,3 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
-
-namespace Gdk
-{
-
-Point::Point()
-{
-  gobject_.x = 0;
-  gobject_.y = 0;
-}
-
-Point::Point(int x, int y)
-{
-  gobject_.x = x;
-  gobject_.y = y;
-}
-
-Point::Point(const Point& other) noexcept
-: gobject_(other.gobject_)
-{
-}
-
-Point& Point::operator=(const Point& other) noexcept
-{
-  gobject_ = other.gobject_;
-
-  return *this;
-}
-
-Point::Point(Point&& other) noexcept
-: gobject_(std::move(other.gobject_))
-{
-}
-
-Point& Point::operator=(Point&& other) noexcept
-{
-  gobject_ = std::move(other.gobject_);
-
-  return *this;
-}
-
-bool Point::equal(const Gdk::Point& rhs) const
-{
-  return (gobject_.x == rhs.gobject_.x) && (gobject_.y == rhs.gobject_.y);
-}
-
-} // namespace Gdk
-
-
-namespace Glib
-{
-
-Gdk::Point& wrap(GdkPoint* object)
-{
-  return *reinterpret_cast<Gdk::Point*>(object);
-}
-
-const Gdk::Point& wrap(const GdkPoint* object)
-{
-  return *reinterpret_cast<const Gdk::Point*>(object);
-}
-
-} // namespace Glib
-
diff --git a/gdk/src/types.hg b/gdk/src/types.hg
index 4d83995f..149f1c3a 100644
--- a/gdk/src/types.hg
+++ b/gdk/src/types.hg
@@ -34,78 +34,6 @@ enum { ERROR = GTKMM_MACRO_DEFINITION_ERROR };
 namespace Gdk
 {
 
-class GDKMM_API Window;
-
 _WRAP_ENUM(ModifierType, GdkModifierType, decl_prefix GDKMM_API)
 
-/** This is a simple structure containing an x and y coordinate of a point.
- */
-class GDKMM_API Point
-{
-  _CLASS_GENERIC(Point, GdkPoint)
-
-public:
-  Point();
-  Point(int x, int y);
-
-  Point(const Point& other) noexcept;
-  Point& operator=(const Point& other) noexcept;
-
-  Point(Point&& other) noexcept;
-  Point& operator=(Point&& other) noexcept;
-
-  void set_x(int x) { gobject_.x = x; }
-  void set_y(int y) { gobject_.y = y; }
-
-  int get_x() const { return gobject_.x; }
-  int get_y() const { return gobject_.y; }
-
-  bool equal(const Gdk::Point& rhs) const;
-
-  /// Provides access to the underlying C GObject.
-  GdkPoint*       gobj()       { return &gobject_; }
-  /// Provides access to the underlying C GObject.
-  const GdkPoint* gobj() const { return &gobject_; }
-
-protected:
-  GdkPoint gobject_;
-};
-
-/** @relates Gdk::Point */
-inline bool operator==(const Point& lhs, const Point& rhs)
-  { return lhs.equal(rhs); }
-
-/** @relates Gdk::Point */
-inline bool operator!=(const Point& lhs, const Point& rhs)
-  { return !lhs.equal(rhs); }
-
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
-struct PointTraits
-{
-  typedef Gdk::Point     CppType;
-  typedef GdkPoint       CType;
-  typedef GdkPoint       CTypeNonConst;
-
-  static CType   to_c_type      (CType c_obj)            { return c_obj; }
-  static void    release_c_type (CType)                  {}
-  static CType   to_c_type      (const CppType& cpp_obj) { return *(cpp_obj.gobj ()); }
-  static CppType to_cpp_type    (CType c_obj)            { return CppType (c_obj.x, c_obj.y); }
-};
-#endif //DOXYGEN_SHOULD_SKIP_THIS
-
 } // namespace Gdk
-
-
-namespace Glib
-{
-
-/** @relates Gdk::Point */
-GDKMM_API
-Gdk::Point& wrap(GdkPoint* object);
-
-/** @relates Gdk::Point */
-GDKMM_API
-const Gdk::Point& wrap(const GdkPoint* object);
-
-} // namespace Glib
-


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]