diff options
author | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2016-08-17 17:29:05 +0300 |
---|---|---|
committer | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2016-08-17 17:29:05 +0300 |
commit | defee6ef4b6a5a04cd35601a03bff65acf7e1ede (patch) | |
tree | cf8ab107f5ff99e7e81cd218d1af8cc5c81f5bac | |
parent | eee199e3b7ce87cbd08b4b6e4c9c55c804c6ff5f (diff) | |
download | metacity-defee6ef4b6a5a04cd35601a03bff65acf7e1ede.tar.gz |
libmetacity: don't expose MetaButtonLayout
-rw-r--r-- | libmetacity/Makefile.am | 3 | ||||
-rw-r--r-- | libmetacity/meta-button-layout-private.h (renamed from libmetacity/meta-button-layout.h) | 10 | ||||
-rw-r--r-- | libmetacity/meta-button-layout.c | 2 | ||||
-rw-r--r-- | libmetacity/meta-theme-gtk.c | 2 | ||||
-rw-r--r-- | libmetacity/meta-theme-impl-private.h | 3 | ||||
-rw-r--r-- | libmetacity/meta-theme-metacity.c | 19 | ||||
-rw-r--r-- | libmetacity/meta-theme.c | 3 | ||||
-rw-r--r-- | libmetacity/meta-theme.h | 2 |
8 files changed, 23 insertions, 21 deletions
diff --git a/libmetacity/Makefile.am b/libmetacity/Makefile.am index ed252d54..426cb8c3 100644 --- a/libmetacity/Makefile.am +++ b/libmetacity/Makefile.am @@ -5,7 +5,7 @@ lib_LTLIBRARIES = libmetacity.la libmetacity_la_SOURCES = \ meta-button-enums.h \ meta-button-layout.c \ - meta-button-layout.h \ + meta-button-layout-private.h \ meta-button-private.h \ meta-color.c \ meta-color.h \ @@ -70,7 +70,6 @@ libmetacity_la_LIBADD = \ libmetacity_includedir = $(includedir)/metacity/libmetacity libmetacity_include_HEADERS = \ meta-button-enums.h \ - meta-button-layout.h \ meta-color.h \ meta-enum-types.h \ meta-frame-borders.h \ diff --git a/libmetacity/meta-button-layout.h b/libmetacity/meta-button-layout-private.h index d6b06956..31341a57 100644 --- a/libmetacity/meta-button-layout.h +++ b/libmetacity/meta-button-layout-private.h @@ -16,10 +16,10 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef META_BUTTON_LAYOUT_H -#define META_BUTTON_LAYOUT_H +#ifndef META_BUTTON_LAYOUT_PRIVATE_H +#define META_BUTTON_LAYOUT_PRIVATE_H -#include <libmetacity/meta-button-enums.h> +#include "meta-button-enums.h" G_BEGIN_DECLS @@ -27,11 +27,11 @@ typedef struct { /* buttons in the group on the left side */ MetaButtonType left_buttons[META_BUTTON_TYPE_LAST]; - gboolean left_buttons_has_spacer[META_BUTTON_TYPE_LAST]; + gboolean left_buttons_has_spacer[META_BUTTON_TYPE_LAST]; /* buttons in the group on the right side */ MetaButtonType right_buttons[META_BUTTON_TYPE_LAST]; - gboolean right_buttons_has_spacer[META_BUTTON_TYPE_LAST]; + gboolean right_buttons_has_spacer[META_BUTTON_TYPE_LAST]; } MetaButtonLayout; MetaButtonLayout meta_button_layout_new (const gchar *str, diff --git a/libmetacity/meta-button-layout.c b/libmetacity/meta-button-layout.c index 80be75f3..239d9492 100644 --- a/libmetacity/meta-button-layout.c +++ b/libmetacity/meta-button-layout.c @@ -18,7 +18,7 @@ #include "config.h" -#include "meta-button-layout.h" +#include "meta-button-layout-private.h" static MetaButtonType meta_button_type_from_string (const gchar *str) diff --git a/libmetacity/meta-theme-gtk.c b/libmetacity/meta-theme-gtk.c index a61b862c..0b374c74 100644 --- a/libmetacity/meta-theme-gtk.c +++ b/libmetacity/meta-theme-gtk.c @@ -589,7 +589,6 @@ meta_theme_gtk_calc_geometry (MetaThemeImpl *impl, } /* Save the button layout */ - fgeom->button_layout = *button_layout; fgeom->n_left_buttons = n_left; fgeom->n_right_buttons = n_right; @@ -741,6 +740,7 @@ meta_theme_gtk_draw_frame (MetaThemeImpl *impl, const MetaFrameGeometry *fgeom, PangoLayout *title_layout, MetaFrameFlags flags, + const MetaButtonLayout *button_layout, MetaButtonState button_states[META_BUTTON_TYPE_LAST], GdkPixbuf *mini_icon, GdkPixbuf *icon) diff --git a/libmetacity/meta-theme-impl-private.h b/libmetacity/meta-theme-impl-private.h index 77b679e9..58d4afc9 100644 --- a/libmetacity/meta-theme-impl-private.h +++ b/libmetacity/meta-theme-impl-private.h @@ -18,7 +18,7 @@ #ifndef META_THEME_IMPL_PRIVATE_H #define META_THEME_IMPL_PRIVATE_H -#include "meta-button-layout.h" +#include "meta-button-layout-private.h" #include "meta-frame-borders.h" #include "meta-frame-enums.h" #include "meta-frame-style-private.h" @@ -67,6 +67,7 @@ struct _MetaThemeImplClass const MetaFrameGeometry *fgeom, PangoLayout *title_layout, MetaFrameFlags flags, + const MetaButtonLayout *button_layout, MetaButtonState button_states[META_BUTTON_TYPE_LAST], GdkPixbuf *mini_icon, GdkPixbuf *icon); diff --git a/libmetacity/meta-theme-metacity.c b/libmetacity/meta-theme-metacity.c index df65b7e1..554e541c 100644 --- a/libmetacity/meta-theme-metacity.c +++ b/libmetacity/meta-theme-metacity.c @@ -5090,7 +5090,6 @@ meta_theme_metacity_calc_geometry (MetaThemeImpl *impl, } /* Save the button layout */ - fgeom->button_layout = *button_layout; fgeom->n_left_buttons = n_left; fgeom->n_right_buttons = n_right; @@ -5382,6 +5381,7 @@ static MetaButtonState map_button_state (MetaButtonFunction button_function, const MetaFrameGeometry *fgeom, gint middle_bg_offset, + const MetaButtonLayout *button_layout, MetaButtonState button_states[META_BUTTON_TYPE_LAST]) { MetaButtonType type = META_BUTTON_TYPE_LAST; @@ -5427,28 +5427,28 @@ map_button_state (MetaButtonFunction button_function, case META_BUTTON_FUNCTION_RIGHT_LEFT_BACKGROUND: case META_BUTTON_FUNCTION_RIGHT_SINGLE_BACKGROUND: if (fgeom->n_right_buttons > 0) - type = fgeom->button_layout.right_buttons[0]; + type = button_layout->right_buttons[0]; break; case META_BUTTON_FUNCTION_RIGHT_RIGHT_BACKGROUND: if (fgeom->n_right_buttons > 0) - type = fgeom->button_layout.right_buttons[fgeom->n_right_buttons - 1]; + type = button_layout->right_buttons[fgeom->n_right_buttons - 1]; break; case META_BUTTON_FUNCTION_RIGHT_MIDDLE_BACKGROUND: if (middle_bg_offset + 1 < fgeom->n_right_buttons) - type = fgeom->button_layout.right_buttons[middle_bg_offset + 1]; + type = button_layout->right_buttons[middle_bg_offset + 1]; break; case META_BUTTON_FUNCTION_LEFT_LEFT_BACKGROUND: case META_BUTTON_FUNCTION_LEFT_SINGLE_BACKGROUND: if (fgeom->n_left_buttons > 0) - type = fgeom->button_layout.left_buttons[0]; + type = button_layout->left_buttons[0]; break; case META_BUTTON_FUNCTION_LEFT_RIGHT_BACKGROUND: if (fgeom->n_left_buttons > 0) - type = fgeom->button_layout.left_buttons[fgeom->n_left_buttons - 1]; + type = button_layout->left_buttons[fgeom->n_left_buttons - 1]; break; case META_BUTTON_FUNCTION_LEFT_MIDDLE_BACKGROUND: if (middle_bg_offset + 1 < fgeom->n_left_buttons) - type = fgeom->button_layout.left_buttons[middle_bg_offset + 1]; + type = button_layout->left_buttons[middle_bg_offset + 1]; break; case META_BUTTON_FUNCTION_LAST: break; @@ -5470,6 +5470,7 @@ meta_theme_metacity_draw_frame (MetaThemeImpl *impl, const MetaFrameGeometry *fgeom, PangoLayout *title_layout, MetaFrameFlags flags, + const MetaButtonLayout *button_layout, MetaButtonState button_states[META_BUTTON_TYPE_LAST], GdkPixbuf *mini_icon, GdkPixbuf *icon) @@ -5703,7 +5704,9 @@ meta_theme_metacity_draw_frame (MetaThemeImpl *impl, rect.width = tmp_rect.width / scale; rect.height = tmp_rect.height / scale; - button_state = map_button_state (j, fgeom, middle_bg_offset, button_states); + button_state = map_button_state (j, fgeom, middle_bg_offset, + button_layout, button_states); + op_list = meta_frame_style_get_button (style, j, button_state); if (op_list) diff --git a/libmetacity/meta-theme.c b/libmetacity/meta-theme.c index cd0f85e9..46996611 100644 --- a/libmetacity/meta-theme.c +++ b/libmetacity/meta-theme.c @@ -703,7 +703,8 @@ meta_theme_draw_frame (MetaTheme *theme, } impl_class->draw_frame (theme->impl, style, style_info, cr, &fgeom, - title_layout, flags, button_states, mini_icon, icon); + title_layout, flags, &theme->button_layout, + button_states, mini_icon, icon); g_object_unref (title_layout); } diff --git a/libmetacity/meta-theme.h b/libmetacity/meta-theme.h index 565f9655..9229051b 100644 --- a/libmetacity/meta-theme.h +++ b/libmetacity/meta-theme.h @@ -21,7 +21,6 @@ #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> @@ -137,7 +136,6 @@ struct _MetaFrameGeometry /* End of button rects (if changed adjust memset hack) */ /* Saved button layout */ - MetaButtonLayout button_layout; int n_left_buttons; int n_right_buttons; |