[metacity] theme: move MetaFrameGeometry to libmetacity



commit 2d03fef33dc111db16224f9460013116d0ff4eb1
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Wed Feb 3 21:23:26 2016 +0200

    theme: move MetaFrameGeometry to libmetacity

 libmetacity/meta-theme.h |   77 ++++++++++++++++++++++++++++++++++++++++++++
 src/ui/theme.h           |   80 ----------------------------------------------
 2 files changed, 77 insertions(+), 80 deletions(-)
---
diff --git a/libmetacity/meta-theme.h b/libmetacity/meta-theme.h
index 4e74907..bf57192 100644
--- a/libmetacity/meta-theme.h
+++ b/libmetacity/meta-theme.h
@@ -20,11 +20,16 @@
 #define META_THEME_H
 
 #include <gtk/gtk.h>
+#include <libmetacity/meta-button-enums.h>
+#include <libmetacity/meta-button-layout.h>
+#include <libmetacity/meta-frame-borders.h>
 #include <libmetacity/meta-frame-enums.h>
 #include <libmetacity/meta-style-info.h>
 
 G_BEGIN_DECLS
 
+typedef struct _MetaButtonSpace MetaButtonSpace;
+typedef struct _MetaFrameGeometry MetaFrameGeometry;
 typedef struct _MetaFrameStyleSet MetaFrameStyleSet;
 
 #define META_TYPE_THEME meta_theme_get_type ()
@@ -75,6 +80,78 @@ typedef enum
   META_THEME_TYPE_METACITY,
 } MetaThemeType;
 
+/**
+ * The computed size of a button (really just a way of tying its
+ * visible and clickable areas together).
+ * The reason for two different rectangles here is Fitts' law & maximized
+ * windows; see bug #97703 for more details.
+ */
+struct _MetaButtonSpace
+{
+  /** The screen area where the button's image is drawn */
+  GdkRectangle visible;
+  /** The screen area where the button can be activated by clicking */
+  GdkRectangle clickable;
+};
+
+/**
+ * Calculated actual geometry of the frame
+ */
+struct _MetaFrameGeometry
+{
+  MetaFrameBorders borders;
+  int              top_height;
+
+  int width;
+  int height;
+
+  GdkRectangle title_rect;
+
+  int left_titlebar_edge;
+  int right_titlebar_edge;
+  int top_titlebar_edge;
+  int bottom_titlebar_edge;
+
+  /* used for a memset hack */
+#define ADDRESS_OF_BUTTON_RECTS(fgeom) (((char*)(fgeom)) + G_STRUCT_OFFSET (MetaFrameGeometry, close_rect))
+#define LENGTH_OF_BUTTON_RECTS (G_STRUCT_OFFSET (MetaFrameGeometry, right_single_background) + sizeof 
(GdkRectangle) - G_STRUCT_OFFSET (MetaFrameGeometry, close_rect))
+
+  /* The button rects (if changed adjust memset hack) */
+  MetaButtonSpace close_rect;
+  MetaButtonSpace max_rect;
+  MetaButtonSpace min_rect;
+  MetaButtonSpace menu_rect;
+  MetaButtonSpace appmenu_rect;
+  MetaButtonSpace shade_rect;
+  MetaButtonSpace above_rect;
+  MetaButtonSpace stick_rect;
+  MetaButtonSpace unshade_rect;
+  MetaButtonSpace unabove_rect;
+  MetaButtonSpace unstick_rect;
+
+#define MAX_MIDDLE_BACKGROUNDS (META_BUTTON_FUNCTION_LAST - 2)
+  GdkRectangle left_left_background;
+  GdkRectangle left_middle_backgrounds[MAX_MIDDLE_BACKGROUNDS];
+  GdkRectangle left_right_background;
+  GdkRectangle left_single_background;
+  GdkRectangle right_left_background;
+  GdkRectangle right_middle_backgrounds[MAX_MIDDLE_BACKGROUNDS];
+  GdkRectangle right_right_background;
+  GdkRectangle right_single_background;
+  /* End of button rects (if changed adjust memset hack) */
+
+  /* Saved button layout */
+  MetaButtonLayout button_layout;
+  int n_left_buttons;
+  int n_right_buttons;
+
+  /* Round corners */
+  guint top_left_corner_rounded_radius;
+  guint top_right_corner_rounded_radius;
+  guint bottom_left_corner_rounded_radius;
+  guint bottom_right_corner_rounded_radius;
+};
+
 GQuark                      meta_theme_error_quark       (void);
 
 MetaTheme                  *meta_theme_new               (MetaThemeType                type);
diff --git a/src/ui/theme.h b/src/ui/theme.h
index 2b30d63..0e844d5 100644
--- a/src/ui/theme.h
+++ b/src/ui/theme.h
@@ -23,87 +23,7 @@
 #define THEME_H
 
 #include <gtk/gtk.h>
-#include <libmetacity/meta-button-enums.h>
-#include <libmetacity/meta-button-layout.h>
-#include <libmetacity/meta-frame-borders.h>
-#include <libmetacity/meta-frame-enums.h>
 #include <libmetacity/meta-theme.h>
-#include <libmetacity/meta-style-info.h>
-
-typedef struct _MetaButtonSpace MetaButtonSpace;
-typedef struct _MetaFrameGeometry MetaFrameGeometry;
-
-/**
- * The computed size of a button (really just a way of tying its
- * visible and clickable areas together).
- * The reason for two different rectangles here is Fitts' law & maximized
- * windows; see bug #97703 for more details.
- */
-struct _MetaButtonSpace
-{
-  /** The screen area where the button's image is drawn */
-  GdkRectangle visible;
-  /** The screen area where the button can be activated by clicking */
-  GdkRectangle clickable;
-};
-
-/**
- * Calculated actual geometry of the frame
- */
-struct _MetaFrameGeometry
-{
-  MetaFrameBorders borders;
-  int              top_height;
-
-  int width;
-  int height;
-
-  GdkRectangle title_rect;
-
-  int left_titlebar_edge;
-  int right_titlebar_edge;
-  int top_titlebar_edge;
-  int bottom_titlebar_edge;
-
-  /* used for a memset hack */
-#define ADDRESS_OF_BUTTON_RECTS(fgeom) (((char*)(fgeom)) + G_STRUCT_OFFSET (MetaFrameGeometry, close_rect))
-#define LENGTH_OF_BUTTON_RECTS (G_STRUCT_OFFSET (MetaFrameGeometry, right_single_background) + sizeof 
(GdkRectangle) - G_STRUCT_OFFSET (MetaFrameGeometry, close_rect))
-
-  /* The button rects (if changed adjust memset hack) */
-  MetaButtonSpace close_rect;
-  MetaButtonSpace max_rect;
-  MetaButtonSpace min_rect;
-  MetaButtonSpace menu_rect;
-  MetaButtonSpace appmenu_rect;
-  MetaButtonSpace shade_rect;
-  MetaButtonSpace above_rect;
-  MetaButtonSpace stick_rect;
-  MetaButtonSpace unshade_rect;
-  MetaButtonSpace unabove_rect;
-  MetaButtonSpace unstick_rect;
-
-#define MAX_MIDDLE_BACKGROUNDS (META_BUTTON_FUNCTION_LAST - 2)
-  GdkRectangle left_left_background;
-  GdkRectangle left_middle_backgrounds[MAX_MIDDLE_BACKGROUNDS];
-  GdkRectangle left_right_background;
-  GdkRectangle left_single_background;
-  GdkRectangle right_left_background;
-  GdkRectangle right_middle_backgrounds[MAX_MIDDLE_BACKGROUNDS];
-  GdkRectangle right_right_background;
-  GdkRectangle right_single_background;
-  /* End of button rects (if changed adjust memset hack) */
-
-  /* Saved button layout */
-  MetaButtonLayout button_layout;
-  int n_left_buttons;
-  int n_right_buttons;
-
-  /* Round corners */
-  guint top_left_corner_rounded_radius;
-  guint top_right_corner_rounded_radius;
-  guint bottom_left_corner_rounded_radius;
-  guint bottom_right_corner_rounded_radius;
-};
 
 MetaTheme* meta_theme_get_current (void);
 void       meta_theme_set_current (const char                 *name,


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