mirror of
https://github.com/brl/mutter.git
synced 2025-02-21 07:24:09 +00:00
ui: Remove text_height from the public theme interface
It wasn't being used
This commit is contained in:
parent
ecac8c9d09
commit
5823c5e0f5
@ -50,7 +50,6 @@ struct _MetaPreview
|
|||||||
MetaFrameFlags flags;
|
MetaFrameFlags flags;
|
||||||
|
|
||||||
PangoLayout *layout;
|
PangoLayout *layout;
|
||||||
int text_height;
|
|
||||||
|
|
||||||
MetaFrameBorders borders;
|
MetaFrameBorders borders;
|
||||||
guint borders_cached : 1;
|
guint borders_cached : 1;
|
||||||
|
@ -183,8 +183,6 @@ prefs_changed_callback (MetaPreference pref,
|
|||||||
static void
|
static void
|
||||||
meta_frames_init (MetaFrames *frames)
|
meta_frames_init (MetaFrames *frames)
|
||||||
{
|
{
|
||||||
frames->text_heights = g_hash_table_new (NULL, NULL);
|
|
||||||
|
|
||||||
frames->frames = g_hash_table_new (unsigned_long_hash, unsigned_long_equal);
|
frames->frames = g_hash_table_new (unsigned_long_hash, unsigned_long_equal);
|
||||||
|
|
||||||
frames->expose_delay_count = 0;
|
frames->expose_delay_count = 0;
|
||||||
@ -238,8 +236,6 @@ meta_frames_finalize (GObject *object)
|
|||||||
|
|
||||||
meta_prefs_remove_listener (prefs_changed_callback, frames);
|
meta_prefs_remove_listener (prefs_changed_callback, frames);
|
||||||
|
|
||||||
g_hash_table_destroy (frames->text_heights);
|
|
||||||
|
|
||||||
g_assert (g_hash_table_size (frames->frames) == 0);
|
g_assert (g_hash_table_size (frames->frames) == 0);
|
||||||
g_hash_table_destroy (frames->frames);
|
g_hash_table_destroy (frames->frames);
|
||||||
|
|
||||||
@ -344,7 +340,6 @@ meta_frames_calc_geometry (MetaFrames *frames,
|
|||||||
meta_theme_calc_geometry (frame->tv->theme,
|
meta_theme_calc_geometry (frame->tv->theme,
|
||||||
frame->tv->style_context,
|
frame->tv->style_context,
|
||||||
type,
|
type,
|
||||||
frame->text_height,
|
|
||||||
flags,
|
flags,
|
||||||
width, height,
|
width, height,
|
||||||
&button_layout,
|
&button_layout,
|
||||||
@ -404,7 +399,6 @@ meta_frames_manage_window (MetaFrames *frames,
|
|||||||
|
|
||||||
frame->xwindow = xwindow;
|
frame->xwindow = xwindow;
|
||||||
frame->layout = NULL;
|
frame->layout = NULL;
|
||||||
frame->text_height = -1;
|
|
||||||
frame->title = NULL;
|
frame->title = NULL;
|
||||||
frame->expose_delayed = FALSE;
|
frame->expose_delayed = FALSE;
|
||||||
frame->shape_applied = FALSE;
|
frame->shape_applied = FALSE;
|
||||||
@ -514,7 +508,6 @@ meta_frames_get_borders (MetaFrames *frames,
|
|||||||
meta_theme_get_frame_borders (frame->tv->theme,
|
meta_theme_get_frame_borders (frame->tv->theme,
|
||||||
frame->tv->style_context,
|
frame->tv->style_context,
|
||||||
type,
|
type,
|
||||||
frame->text_height,
|
|
||||||
flags,
|
flags,
|
||||||
borders);
|
borders);
|
||||||
}
|
}
|
||||||
@ -1456,7 +1449,7 @@ subtract_client_area (cairo_region_t *region,
|
|||||||
META_CORE_GET_END);
|
META_CORE_GET_END);
|
||||||
meta_theme_get_frame_borders (frame->tv->theme,
|
meta_theme_get_frame_borders (frame->tv->theme,
|
||||||
frame->tv->style_context,
|
frame->tv->style_context,
|
||||||
type, frame->text_height, flags,
|
type, flags,
|
||||||
&borders);
|
&borders);
|
||||||
|
|
||||||
area.x = borders.total.left;
|
area.x = borders.total.left;
|
||||||
@ -1638,7 +1631,6 @@ meta_frames_paint (MetaFrames *frames,
|
|||||||
flags,
|
flags,
|
||||||
w, h,
|
w, h,
|
||||||
frame->layout,
|
frame->layout,
|
||||||
frame->text_height,
|
|
||||||
&button_layout,
|
&button_layout,
|
||||||
button_states,
|
button_states,
|
||||||
mini_icon, icon);
|
mini_icon, icon);
|
||||||
|
@ -77,7 +77,6 @@ struct _MetaUIFrame
|
|||||||
GdkWindow *window;
|
GdkWindow *window;
|
||||||
MetaThemeVariant *tv;
|
MetaThemeVariant *tv;
|
||||||
PangoLayout *layout;
|
PangoLayout *layout;
|
||||||
int text_height;
|
|
||||||
char *title; /* NULL once we have a layout */
|
char *title; /* NULL once we have a layout */
|
||||||
guint expose_delayed : 1;
|
guint expose_delayed : 1;
|
||||||
guint shape_applied : 1;
|
guint shape_applied : 1;
|
||||||
@ -89,8 +88,6 @@ struct _MetaUIFrame
|
|||||||
struct _MetaFrames
|
struct _MetaFrames
|
||||||
{
|
{
|
||||||
GtkWindow parent_instance;
|
GtkWindow parent_instance;
|
||||||
|
|
||||||
GHashTable *text_heights;
|
|
||||||
|
|
||||||
GHashTable *frames;
|
GHashTable *frames;
|
||||||
MetaUIFrame *last_motion_frame;
|
MetaUIFrame *last_motion_frame;
|
||||||
|
@ -146,10 +146,6 @@ ensure_info (MetaPreview *preview)
|
|||||||
|
|
||||||
font_desc = meta_gtk_widget_get_font_desc (widget, scale, NULL);
|
font_desc = meta_gtk_widget_get_font_desc (widget, scale, NULL);
|
||||||
|
|
||||||
preview->text_height =
|
|
||||||
meta_pango_font_desc_get_text_height (font_desc,
|
|
||||||
gtk_widget_get_pango_context (widget));
|
|
||||||
|
|
||||||
attrs = pango_attr_list_new ();
|
attrs = pango_attr_list_new ();
|
||||||
|
|
||||||
attr = pango_attr_size_new (pango_font_description_get_size (font_desc));
|
attr = pango_attr_size_new (pango_font_description_get_size (font_desc));
|
||||||
@ -171,7 +167,6 @@ ensure_info (MetaPreview *preview)
|
|||||||
meta_theme_get_frame_borders (preview->theme,
|
meta_theme_get_frame_borders (preview->theme,
|
||||||
meta_theme_get_variant (preview->theme, NULL)->style_context,
|
meta_theme_get_variant (preview->theme, NULL)->style_context,
|
||||||
preview->type,
|
preview->type,
|
||||||
preview->text_height,
|
|
||||||
preview->flags,
|
preview->flags,
|
||||||
&preview->borders);
|
&preview->borders);
|
||||||
else
|
else
|
||||||
@ -219,7 +214,6 @@ meta_preview_draw (GtkWidget *widget,
|
|||||||
preview->flags,
|
preview->flags,
|
||||||
client_width, client_height,
|
client_width, client_height,
|
||||||
preview->layout,
|
preview->layout,
|
||||||
preview->text_height,
|
|
||||||
&preview->button_layout,
|
&preview->button_layout,
|
||||||
button_states,
|
button_states,
|
||||||
meta_preview_get_mini_icon (),
|
meta_preview_get_mini_icon (),
|
||||||
|
@ -1023,7 +1023,6 @@ void meta_theme_draw_frame (MetaTheme *theme,
|
|||||||
int client_width,
|
int client_width,
|
||||||
int client_height,
|
int client_height,
|
||||||
PangoLayout *title_layout,
|
PangoLayout *title_layout,
|
||||||
int text_height,
|
|
||||||
const MetaButtonLayout *button_layout,
|
const MetaButtonLayout *button_layout,
|
||||||
MetaButtonState button_states[META_BUTTON_TYPE_LAST],
|
MetaButtonState button_states[META_BUTTON_TYPE_LAST],
|
||||||
GdkPixbuf *mini_icon,
|
GdkPixbuf *mini_icon,
|
||||||
@ -1037,7 +1036,6 @@ void meta_theme_draw_frame_with_style (MetaTheme *theme,
|
|||||||
int client_width,
|
int client_width,
|
||||||
int client_height,
|
int client_height,
|
||||||
PangoLayout *title_layout,
|
PangoLayout *title_layout,
|
||||||
int text_height,
|
|
||||||
const MetaButtonLayout *button_layout,
|
const MetaButtonLayout *button_layout,
|
||||||
MetaButtonState button_states[META_BUTTON_TYPE_LAST],
|
MetaButtonState button_states[META_BUTTON_TYPE_LAST],
|
||||||
GdkPixbuf *mini_icon,
|
GdkPixbuf *mini_icon,
|
||||||
@ -1046,14 +1044,12 @@ void meta_theme_draw_frame_with_style (MetaTheme *theme,
|
|||||||
void meta_theme_get_frame_borders (MetaTheme *theme,
|
void meta_theme_get_frame_borders (MetaTheme *theme,
|
||||||
GtkStyleContext *style_context,
|
GtkStyleContext *style_context,
|
||||||
MetaFrameType type,
|
MetaFrameType type,
|
||||||
int text_height,
|
|
||||||
MetaFrameFlags flags,
|
MetaFrameFlags flags,
|
||||||
MetaFrameBorders *borders);
|
MetaFrameBorders *borders);
|
||||||
|
|
||||||
void meta_theme_calc_geometry (MetaTheme *theme,
|
void meta_theme_calc_geometry (MetaTheme *theme,
|
||||||
GtkStyleContext *ctx,
|
GtkStyleContext *ctx,
|
||||||
MetaFrameType type,
|
MetaFrameType type,
|
||||||
int text_height,
|
|
||||||
MetaFrameFlags flags,
|
MetaFrameFlags flags,
|
||||||
int client_width,
|
int client_width,
|
||||||
int client_height,
|
int client_height,
|
||||||
@ -1113,8 +1109,6 @@ gboolean meta_theme_replace_constants (MetaTheme *theme,
|
|||||||
PangoFontDescription* meta_gtk_widget_get_font_desc (GtkWidget *widget,
|
PangoFontDescription* meta_gtk_widget_get_font_desc (GtkWidget *widget,
|
||||||
double scale,
|
double scale,
|
||||||
const PangoFontDescription *override);
|
const PangoFontDescription *override);
|
||||||
int meta_pango_font_desc_get_text_height (const PangoFontDescription *font_desc,
|
|
||||||
PangoContext *context);
|
|
||||||
|
|
||||||
|
|
||||||
/* Enum converters */
|
/* Enum converters */
|
||||||
|
@ -924,18 +924,6 @@ get_flags (GtkWidget *widget)
|
|||||||
META_FRAME_ALLOWS_MOVE;
|
META_FRAME_ALLOWS_MOVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
|
||||||
get_text_height (GtkWidget *widget)
|
|
||||||
{
|
|
||||||
GtkStyleContext *style;
|
|
||||||
const PangoFontDescription *font_desc;
|
|
||||||
|
|
||||||
style = gtk_widget_get_style_context (widget);
|
|
||||||
font_desc = gtk_style_context_get_font (style, 0);
|
|
||||||
return meta_pango_font_desc_get_text_height (font_desc,
|
|
||||||
gtk_widget_get_pango_context (widget));
|
|
||||||
}
|
|
||||||
|
|
||||||
static PangoLayout*
|
static PangoLayout*
|
||||||
create_title_layout (GtkWidget *widget)
|
create_title_layout (GtkWidget *widget)
|
||||||
{
|
{
|
||||||
@ -977,7 +965,6 @@ run_theme_benchmark (void)
|
|||||||
meta_theme_get_frame_borders (global_theme,
|
meta_theme_get_frame_borders (global_theme,
|
||||||
meta_theme_get_variant (global_theme, NULL)->style_context,
|
meta_theme_get_variant (global_theme, NULL)->style_context,
|
||||||
META_FRAME_TYPE_NORMAL,
|
META_FRAME_TYPE_NORMAL,
|
||||||
get_text_height (widget),
|
|
||||||
get_flags (widget),
|
get_flags (widget),
|
||||||
&borders);
|
&borders);
|
||||||
|
|
||||||
@ -1026,7 +1013,6 @@ run_theme_benchmark (void)
|
|||||||
get_flags (widget),
|
get_flags (widget),
|
||||||
client_width, client_height,
|
client_width, client_height,
|
||||||
layout,
|
layout,
|
||||||
get_text_height (widget),
|
|
||||||
&button_layout,
|
&button_layout,
|
||||||
button_states,
|
button_states,
|
||||||
meta_preview_get_mini_icon (),
|
meta_preview_get_mini_icon (),
|
||||||
|
@ -301,7 +301,6 @@ get_style_flags (MetaFrameFlags flags)
|
|||||||
static void
|
static void
|
||||||
meta_frame_layout_get_borders (const MetaFrameLayout *layout,
|
meta_frame_layout_get_borders (const MetaFrameLayout *layout,
|
||||||
GtkStyleContext *style_context,
|
GtkStyleContext *style_context,
|
||||||
int text_height,
|
|
||||||
MetaFrameFlags flags,
|
MetaFrameFlags flags,
|
||||||
MetaFrameType type,
|
MetaFrameType type,
|
||||||
MetaFrameBorders *borders)
|
MetaFrameBorders *borders)
|
||||||
@ -317,9 +316,6 @@ meta_frame_layout_get_borders (const MetaFrameLayout *layout,
|
|||||||
|
|
||||||
g_return_if_fail (layout != NULL);
|
g_return_if_fail (layout != NULL);
|
||||||
|
|
||||||
if (!layout->has_title)
|
|
||||||
text_height = 0;
|
|
||||||
|
|
||||||
gtk_style_context_get_border (style_context,
|
gtk_style_context_get_border (style_context,
|
||||||
get_style_flags (flags),
|
get_style_flags (flags),
|
||||||
&borders->visible);
|
&borders->visible);
|
||||||
@ -519,7 +515,6 @@ strip_button (MetaButtonSpace *func_rects[MAX_BUTTONS_PER_CORNER],
|
|||||||
static void
|
static void
|
||||||
meta_frame_layout_calc_geometry (const MetaFrameLayout *layout,
|
meta_frame_layout_calc_geometry (const MetaFrameLayout *layout,
|
||||||
GtkStyleContext *ctx,
|
GtkStyleContext *ctx,
|
||||||
int text_height,
|
|
||||||
MetaFrameFlags flags,
|
MetaFrameFlags flags,
|
||||||
int client_width,
|
int client_width,
|
||||||
int client_height,
|
int client_height,
|
||||||
@ -547,8 +542,7 @@ meta_frame_layout_calc_geometry (const MetaFrameLayout *layout,
|
|||||||
|
|
||||||
MetaFrameBorders borders;
|
MetaFrameBorders borders;
|
||||||
|
|
||||||
meta_frame_layout_get_borders (layout, ctx, text_height,
|
meta_frame_layout_get_borders (layout, ctx, flags, type,
|
||||||
flags, type,
|
|
||||||
&borders);
|
&borders);
|
||||||
|
|
||||||
fgeom->borders = borders;
|
fgeom->borders = borders;
|
||||||
@ -4137,7 +4131,6 @@ meta_frame_style_draw_with_style (MetaFrameStyle *style,
|
|||||||
int client_width,
|
int client_width,
|
||||||
int client_height,
|
int client_height,
|
||||||
PangoLayout *title_layout,
|
PangoLayout *title_layout,
|
||||||
int text_height,
|
|
||||||
MetaButtonState button_states[META_BUTTON_TYPE_LAST],
|
MetaButtonState button_states[META_BUTTON_TYPE_LAST],
|
||||||
GdkPixbuf *mini_icon,
|
GdkPixbuf *mini_icon,
|
||||||
GdkPixbuf *icon)
|
GdkPixbuf *icon)
|
||||||
@ -4761,8 +4754,6 @@ meta_theme_new (void)
|
|||||||
theme->quark_mini_icon_height = g_quark_from_static_string ("mini_icon_height");
|
theme->quark_mini_icon_height = g_quark_from_static_string ("mini_icon_height");
|
||||||
theme->quark_icon_width = g_quark_from_static_string ("icon_width");
|
theme->quark_icon_width = g_quark_from_static_string ("icon_width");
|
||||||
theme->quark_icon_height = g_quark_from_static_string ("icon_height");
|
theme->quark_icon_height = g_quark_from_static_string ("icon_height");
|
||||||
theme->quark_title_width = g_quark_from_static_string ("title_width");
|
|
||||||
theme->quark_title_height = g_quark_from_static_string ("title_height");
|
|
||||||
theme->quark_frame_x_center = g_quark_from_static_string ("frame_x_center");
|
theme->quark_frame_x_center = g_quark_from_static_string ("frame_x_center");
|
||||||
theme->quark_frame_y_center = g_quark_from_static_string ("frame_y_center");
|
theme->quark_frame_y_center = g_quark_from_static_string ("frame_y_center");
|
||||||
return theme;
|
return theme;
|
||||||
@ -5059,7 +5050,6 @@ meta_theme_draw_frame_with_style (MetaTheme *theme,
|
|||||||
int client_width,
|
int client_width,
|
||||||
int client_height,
|
int client_height,
|
||||||
PangoLayout *title_layout,
|
PangoLayout *title_layout,
|
||||||
int text_height,
|
|
||||||
const MetaButtonLayout *button_layout,
|
const MetaButtonLayout *button_layout,
|
||||||
MetaButtonState button_states[META_BUTTON_TYPE_LAST],
|
MetaButtonState button_states[META_BUTTON_TYPE_LAST],
|
||||||
GdkPixbuf *mini_icon,
|
GdkPixbuf *mini_icon,
|
||||||
@ -5078,7 +5068,6 @@ meta_theme_draw_frame_with_style (MetaTheme *theme,
|
|||||||
|
|
||||||
meta_frame_layout_calc_geometry (style->layout,
|
meta_frame_layout_calc_geometry (style->layout,
|
||||||
style_gtk,
|
style_gtk,
|
||||||
text_height,
|
|
||||||
flags,
|
flags,
|
||||||
client_width, client_height,
|
client_width, client_height,
|
||||||
button_layout,
|
button_layout,
|
||||||
@ -5093,7 +5082,6 @@ meta_theme_draw_frame_with_style (MetaTheme *theme,
|
|||||||
&fgeom,
|
&fgeom,
|
||||||
client_width, client_height,
|
client_width, client_height,
|
||||||
title_layout,
|
title_layout,
|
||||||
text_height,
|
|
||||||
button_states,
|
button_states,
|
||||||
mini_icon, icon);
|
mini_icon, icon);
|
||||||
}
|
}
|
||||||
@ -5107,7 +5095,6 @@ meta_theme_draw_frame (MetaTheme *theme,
|
|||||||
int client_width,
|
int client_width,
|
||||||
int client_height,
|
int client_height,
|
||||||
PangoLayout *title_layout,
|
PangoLayout *title_layout,
|
||||||
int text_height,
|
|
||||||
const MetaButtonLayout *button_layout,
|
const MetaButtonLayout *button_layout,
|
||||||
MetaButtonState button_states[META_BUTTON_TYPE_LAST],
|
MetaButtonState button_states[META_BUTTON_TYPE_LAST],
|
||||||
GdkPixbuf *mini_icon,
|
GdkPixbuf *mini_icon,
|
||||||
@ -5116,7 +5103,7 @@ meta_theme_draw_frame (MetaTheme *theme,
|
|||||||
meta_theme_draw_frame_with_style (theme, gtk_widget_get_style_context (widget),
|
meta_theme_draw_frame_with_style (theme, gtk_widget_get_style_context (widget),
|
||||||
cr, type,flags,
|
cr, type,flags,
|
||||||
client_width, client_height,
|
client_width, client_height,
|
||||||
title_layout, text_height,
|
title_layout,
|
||||||
button_layout, button_states,
|
button_layout, button_states,
|
||||||
mini_icon, icon);
|
mini_icon, icon);
|
||||||
}
|
}
|
||||||
@ -5125,7 +5112,6 @@ void
|
|||||||
meta_theme_get_frame_borders (MetaTheme *theme,
|
meta_theme_get_frame_borders (MetaTheme *theme,
|
||||||
GtkStyleContext *style_context,
|
GtkStyleContext *style_context,
|
||||||
MetaFrameType type,
|
MetaFrameType type,
|
||||||
int text_height,
|
|
||||||
MetaFrameFlags flags,
|
MetaFrameFlags flags,
|
||||||
MetaFrameBorders *borders)
|
MetaFrameBorders *borders)
|
||||||
{
|
{
|
||||||
@ -5143,7 +5129,6 @@ meta_theme_get_frame_borders (MetaTheme *theme,
|
|||||||
|
|
||||||
meta_frame_layout_get_borders (style->layout,
|
meta_frame_layout_get_borders (style->layout,
|
||||||
style_context,
|
style_context,
|
||||||
text_height,
|
|
||||||
flags, type,
|
flags, type,
|
||||||
borders);
|
borders);
|
||||||
}
|
}
|
||||||
@ -5152,7 +5137,6 @@ void
|
|||||||
meta_theme_calc_geometry (MetaTheme *theme,
|
meta_theme_calc_geometry (MetaTheme *theme,
|
||||||
GtkStyleContext *ctx,
|
GtkStyleContext *ctx,
|
||||||
MetaFrameType type,
|
MetaFrameType type,
|
||||||
int text_height,
|
|
||||||
MetaFrameFlags flags,
|
MetaFrameFlags flags,
|
||||||
int client_width,
|
int client_width,
|
||||||
int client_height,
|
int client_height,
|
||||||
@ -5171,7 +5155,6 @@ meta_theme_calc_geometry (MetaTheme *theme,
|
|||||||
|
|
||||||
meta_frame_layout_calc_geometry (style->layout,
|
meta_frame_layout_calc_geometry (style->layout,
|
||||||
ctx,
|
ctx,
|
||||||
text_height,
|
|
||||||
flags,
|
flags,
|
||||||
client_width, client_height,
|
client_width, client_height,
|
||||||
button_layout,
|
button_layout,
|
||||||
@ -5470,34 +5453,6 @@ meta_gtk_widget_get_font_desc (GtkWidget *widget,
|
|||||||
return font_desc;
|
return font_desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* meta_pango_font_desc_get_text_height:
|
|
||||||
* @font_desc: the font
|
|
||||||
* @context: the context of the font
|
|
||||||
*
|
|
||||||
* Returns the height of the letters in a particular font.
|
|
||||||
*
|
|
||||||
* Returns: the height of the letters
|
|
||||||
*/
|
|
||||||
int
|
|
||||||
meta_pango_font_desc_get_text_height (const PangoFontDescription *font_desc,
|
|
||||||
PangoContext *context)
|
|
||||||
{
|
|
||||||
PangoFontMetrics *metrics;
|
|
||||||
PangoLanguage *lang;
|
|
||||||
int retval;
|
|
||||||
|
|
||||||
lang = pango_context_get_language (context);
|
|
||||||
metrics = pango_context_get_metrics (context, font_desc, lang);
|
|
||||||
|
|
||||||
retval = PANGO_PIXELS (pango_font_metrics_get_ascent (metrics) +
|
|
||||||
pango_font_metrics_get_descent (metrics));
|
|
||||||
|
|
||||||
pango_font_metrics_unref (metrics);
|
|
||||||
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
MetaGtkColorComponent
|
MetaGtkColorComponent
|
||||||
meta_color_component_from_string (const char *str)
|
meta_color_component_from_string (const char *str)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user