diff options
author | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2016-08-16 21:30:27 +0300 |
---|---|---|
committer | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2016-08-16 21:30:27 +0300 |
commit | 435058ef576b86b89ac23715b21495cdaf601288 (patch) | |
tree | d967c18438a82eef7a24496b3bd5df4e06a796a9 /libmetacity/meta-theme-impl.c | |
parent | 5318cdbf7e16a454f3b685f5ddd5a36a1d072772 (diff) | |
download | metacity-435058ef576b86b89ac23715b21495cdaf601288.tar.gz |
libmetacity: use callback function to get button state
Diffstat (limited to 'libmetacity/meta-theme-impl.c')
-rw-r--r-- | libmetacity/meta-theme-impl.c | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/libmetacity/meta-theme-impl.c b/libmetacity/meta-theme-impl.c index f5583baf..773392c2 100644 --- a/libmetacity/meta-theme-impl.c +++ b/libmetacity/meta-theme-impl.c @@ -132,6 +132,64 @@ meta_theme_impl_get_style_set (MetaThemeImpl *impl, } void +get_button_rect_for_function (MetaButtonFunction function, + const MetaFrameGeometry *fgeom, + GdkRectangle *rect) +{ + switch (function) + { + case META_BUTTON_FUNCTION_CLOSE: + *rect = fgeom->close_rect.visible; + break; + + case META_BUTTON_FUNCTION_SHADE: + *rect = fgeom->shade_rect.visible; + break; + + case META_BUTTON_FUNCTION_UNSHADE: + *rect = fgeom->unshade_rect.visible; + break; + + case META_BUTTON_FUNCTION_ABOVE: + *rect = fgeom->above_rect.visible; + break; + + case META_BUTTON_FUNCTION_UNABOVE: + *rect = fgeom->unabove_rect.visible; + break; + + case META_BUTTON_FUNCTION_STICK: + *rect = fgeom->stick_rect.visible; + break; + + case META_BUTTON_FUNCTION_UNSTICK: + *rect = fgeom->unstick_rect.visible; + break; + + case META_BUTTON_FUNCTION_MAXIMIZE: + *rect = fgeom->max_rect.visible; + break; + + case META_BUTTON_FUNCTION_MINIMIZE: + *rect = fgeom->min_rect.visible; + break; + + case META_BUTTON_FUNCTION_MENU: + *rect = fgeom->menu_rect.visible; + break; + + case META_BUTTON_FUNCTION_APPMENU: + *rect = fgeom->appmenu_rect.visible; + break; + + case META_BUTTON_FUNCTION_LAST: + default: + g_assert_not_reached (); + break; + } +} + +void scale_border (GtkBorder *border, double factor) { |