summaryrefslogtreecommitdiff
path: root/src/theme.h
diff options
context:
space:
mode:
authorHavoc Pennington <hp@pobox.com>2002-01-19 03:50:03 +0000
committerHavoc Pennington <hp@src.gnome.org>2002-01-19 03:50:03 +0000
commit19d2e8c7e1df6fcf12e5e5dcfe36430627eb8cc2 (patch)
tree171f1da8bc2407db50d53475f95241ad0d932021 /src/theme.h
parent3194faaa9cbe39f37e664470c40054d6621b2fd0 (diff)
downloadmetacity-19d2e8c7e1df6fcf12e5e5dcfe36430627eb8cc2.tar.gz
metacity-19d2e8c7e1df6fcf12e5e5dcfe36430627eb8cc2.tar.bz2
give priority to keeping NW corner onscreen rather than SE, if we need to
2002-01-18 Havoc Pennington <hp@pobox.com> * src/window.c (constrain_position): give priority to keeping NW corner onscreen rather than SE, if we need to shift the window to fit inside constraints * src/frames.c (meta_frames_get_geometry): don't depend on the current window size * src/theme.c: move geometry stuff in here, to be calculated as part of the theme * src/core.c (meta_core_get_client_size): new function to replace meta_core_get_frame_size() so we don't have weird cycles in the geometry calculation
Diffstat (limited to 'src/theme.h')
-rw-r--r--src/theme.h76
1 files changed, 74 insertions, 2 deletions
diff --git a/src/theme.h b/src/theme.h
index b14142a..1cb73f0 100644
--- a/src/theme.h
+++ b/src/theme.h
@@ -22,8 +22,8 @@
#ifndef META_THEME_H
#define META_THEME_H
-#include "frames.h"
#include "gradient.h"
+#include "common.h"
#include <gtk/gtkrc.h>
typedef struct _MetaFrameStyle MetaFrameStyle;
@@ -31,6 +31,67 @@ typedef struct _MetaFrameStyleSet MetaFrameStyleSet;
typedef struct _MetaTextureSpec MetaTextureSpec;
typedef struct _MetaGradientSpec MetaGradientSpec;
typedef struct _MetaColorSpec MetaColorSpec;
+typedef struct _MetaFrameLayout MetaFrameLayout;
+typedef struct _MetaFrameGeometry MetaFrameGeometry;
+
+/* Parameters used to calculate the geometry of the frame */
+struct _MetaFrameLayout
+{
+ /* Size of left/right/bottom sides */
+ int left_width;
+ int right_width;
+ int bottom_height;
+
+ /* Border of blue title region */
+ GtkBorder title_border;
+
+ /* Border inside title region, around title */
+ GtkBorder text_border;
+
+ /* padding on either side of spacer */
+ int spacer_padding;
+
+ /* Size of spacer */
+ int spacer_width;
+ int spacer_height;
+
+ /* indent of buttons from edges of frame */
+ int right_inset;
+ int left_inset;
+
+ /* Size of buttons */
+ int button_width;
+ int button_height;
+
+ /* Space around buttons */
+ GtkBorder button_border;
+
+ /* Space inside button which is clickable but doesn't draw the
+ * button icon
+ */
+ GtkBorder inner_button_border;
+};
+
+
+/* Calculated actual geometry of the frame */
+struct _MetaFrameGeometry
+{
+ int left_width;
+ int right_width;
+ int top_height;
+ int bottom_height;
+
+ int width;
+ int height;
+
+ GdkRectangle close_rect;
+ GdkRectangle max_rect;
+ GdkRectangle min_rect;
+ GdkRectangle spacer_rect;
+ GdkRectangle menu_rect;
+ GdkRectangle title_rect;
+};
+
typedef enum
{
@@ -184,7 +245,8 @@ struct _MetaFrameStyle
{
MetaTextureSpec *button_icons[META_BUTTON_TYPE_LAST][META_BUTTON_STATE_LAST];
MetaTextureSpec *button_backgrounds[META_BUTTON_TYPE_LAST][META_BUTTON_STATE_LAST];
- MetaTextureSpec *pieces[META_FRAME_PIECE_LAST];
+ MetaTextureSpec *pieces[META_FRAME_PIECE_LAST];
+ MetaFrameLayout *layout;
};
typedef enum
@@ -195,6 +257,16 @@ typedef enum
META_TEXTURE_DRAW_SCALED_BOTH
} MetaTextureDrawMode;
+MetaFrameLayout* meta_frame_layout_new (void);
+void meta_frame_layout_free (MetaFrameLayout *layout);
+void meta_frame_layout_calc_geometry (const MetaFrameLayout *layout,
+ GtkWidget *widget,
+ int text_height,
+ MetaFrameFlags flags,
+ int client_width,
+ int client_height,
+ MetaFrameGeometry *fgeom);
+
MetaColorSpec* meta_color_spec_new (MetaColorSpecType type);
void meta_color_spec_free (MetaColorSpec *spec);
void meta_color_spec_render (MetaColorSpec *spec,