marco 1.29.1
Window manager
Loading...
Searching...
No Matches
theme.c File Reference
View source

Making Marco look pretty. More...

#include <config.h>
#include <glib/gi18n-lib.h>
#include "prefs.h"
#include "theme.h"
#include "theme-parser.h"
#include "util.h"
#include "gradient.h"
#include <gtk/gtk.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
Include dependency graph for theme.c:

Data Structures

struct  PosExpr
 Type and value of an expression in a parsed sequence. More...
 

Macros

#define __USE_XOPEN
 
#define GDK_COLOR_RGBA(color)
 
#define GDK_COLOR_RGB(color)
 
#define DEBUG_FILL_STRUCT(s)   memset ((s), 0xef, sizeof (*(s)))
 
#define CLAMP_UCHAR(v)   ((guchar) (CLAMP (((int)v), (int)0, (int)255)))
 
#define INTENSITY(r, g, b)   ((r) * 0.30 + (g) * 0.59 + (b) * 0.11)
 
#define CHECK_GEOMETRY_VALUE(vname)   if (!validate_geometry_value (layout->vname, #vname, error)) return FALSE
 
#define CHECK_GEOMETRY_BORDER(bname)   if (!validate_geometry_border (&layout->bname, #bname, error)) return FALSE
 
#define LIGHTNESS_MULT   1.3
 
#define DARKNESS_MULT   0.7
 
#define IS_VARIABLE_CHAR(c)   (g_ascii_isalpha ((c)) || (c) == '_')
 Whether a variable can validly appear as part of the name of a variable.
 
#define MAX_EXPRS   32
 

Enumerations

enum  PosExprType { POS_EXPR_INT , POS_EXPR_DOUBLE , POS_EXPR_OPERATOR }
 The type of a PosExpr: either integer, double, or an operation. More...
 

Functions

static void gtk_style_shade (GdkRGBA *a, GdkRGBA *b, gdouble k)
 Takes a colour "a", scales the lightness and saturation by a certain amount, and sets "b" to the resulting colour.
 
static void rgb_to_hls (gdouble *r, gdouble *g, gdouble *b)
 Converts a red/green/blue triplet to a hue/lightness/saturation triplet.
 
static void hls_to_rgb (gdouble *h, gdouble *l, gdouble *s)
 Converts a hue/lightness/saturation triplet to a red/green/blue triplet.
 
static cairo_surface_t * scale_surface (cairo_surface_t *surface, gdouble old_width, gdouble old_height, gdouble new_width, gdouble new_height, gboolean vertical_stripes, gboolean horizontal_stripes)
 
static cairo_surface_t * get_surface_from_pixbuf (GdkPixbuf *pixbuf, MetaImageFillType fill_type, gdouble width, gdouble height, gboolean vertical_stripes, gboolean horizontal_stripes)
 
static GdkPixbuf * colorize_pixbuf (GdkPixbuf *orig, GdkRGBA *new_color)
 
static void color_composite (const GdkRGBA *bg, const GdkRGBA *fg, double alpha, GdkRGBA *color)
 
static void init_border (GtkBorder *border)
 Sets all the fields of a border to dummy values.
 
MetaFrameLayout * meta_frame_layout_new (void)
 Creates a new, empty MetaFrameLayout.
 
static gboolean validate_border (const GtkBorder *border, const char **bad)
 
static gboolean validate_geometry_value (int val, const char *name, GError **error)
 Ensures that the theme supplied a particular dimension.
 
static gboolean validate_geometry_border (const GtkBorder *border, const char *name, GError **error)
 
gboolean meta_frame_layout_validate (const MetaFrameLayout *layout, GError **error)
 
MetaFrameLayout * meta_frame_layout_copy (const MetaFrameLayout *src)
 
void meta_frame_layout_ref (MetaFrameLayout *layout)
 
void meta_frame_layout_unref (MetaFrameLayout *layout)
 
void meta_frame_layout_get_borders (const MetaFrameLayout *layout, int text_height, MetaFrameFlags flags, MetaFrameType type, MetaFrameBorders *borders)
 
static MetaButtonType map_button_function_to_type (MetaButtonFunction function)
 
static MetaButtonSpace * rect_for_function (MetaFrameGeometry *fgeom, MetaFrameFlags flags, MetaButtonFunction function, MetaTheme *theme)
 
static gboolean strip_button (MetaButtonSpace *func_rects[MAX_BUTTONS_PER_CORNER], GdkRectangle *bg_rects[MAX_BUTTONS_PER_CORNER], int *n_rects, MetaButtonSpace *to_strip)
 
void meta_frame_layout_calc_geometry (const MetaFrameLayout *layout, int text_height, MetaFrameFlags flags, int client_width, int client_height, const MetaButtonLayout *button_layout, MetaFrameGeometry *fgeom, MetaTheme *theme)
 
MetaGradientSpec * meta_gradient_spec_new (MetaGradientType type)
 
static cairo_pattern_t * create_cairo_pattern_from_gradient_spec (const MetaGradientSpec *spec, const MetaAlphaGradientSpec *alpha_spec, GtkStyleContext *context)
 
static void free_color_spec (gpointer spec, gpointer user_data)
 
void meta_gradient_spec_free (MetaGradientSpec *spec)
 
void meta_gradient_spec_render (const MetaGradientSpec *spec, const MetaAlphaGradientSpec *alpha_spec, cairo_t *cr, GtkStyleContext *context, gint x, gint y, gint width, gint height)
 
gboolean meta_gradient_spec_validate (MetaGradientSpec *spec, GError **error)
 
MetaAlphaGradientSpec * meta_alpha_gradient_spec_new (MetaGradientType type, int n_alphas)
 
void meta_alpha_gradient_spec_free (MetaAlphaGradientSpec *spec)
 
cairo_pattern_t * meta_alpha_gradient_spec_get_mask (const MetaAlphaGradientSpec *spec)
 
MetaColorSpec * meta_color_spec_new (MetaColorSpecType type)
 
void meta_color_spec_free (MetaColorSpec *spec)
 
MetaColorSpec * meta_color_spec_new_from_string (const char *str, GError **err)
 
MetaColorSpec * meta_color_spec_new_gtk (MetaGtkColorComponent component, GtkStateFlags state)
 
static void get_background_color_real (GtkStyleContext *context, GtkStateFlags state, GdkRGBA *color)
 
static void get_background_color (GtkStyleContext *context, GtkStateFlags state, GdkRGBA *color)
 
void meta_gtk_style_get_light_color (GtkStyleContext *style, GtkStateFlags state, GdkRGBA *color)
 
void meta_gtk_style_get_dark_color (GtkStyleContext *style, GtkStateFlags state, GdkRGBA *color)
 
static void meta_set_color_from_style (GdkRGBA *color, GtkStyleContext *context, GtkStateFlags state, MetaGtkColorComponent component)
 
static void meta_set_custom_color_from_style (GdkRGBA *color, GtkStyleContext *context, char *color_name, MetaColorSpec *fallback)
 
void meta_color_spec_render (MetaColorSpec *spec, GtkStyleContext *style, GdkRGBA *color)
 
static const char * op_name (PosOperatorType type)
 Represents an operation as a string.
 
static PosOperatorType op_from_string (const char *p, int *len)
 Parses a string and returns an operation.
 
static void free_tokens (PosToken *tokens, int n_tokens)
 Frees an array of tokens.
 
static gboolean parse_number (const char *p, const char **end_return, PosToken *next, GError **err)
 Tokenises a number in an expression.
 
static gboolean pos_tokenize (const char *expr, PosToken **tokens_p, int *n_tokens_p, GError **err)
 Tokenises an expression.
 
static gboolean do_operation (PosExpr *a, PosExpr *b, PosOperatorType op, GError **err)
 
static gboolean do_operations (PosExpr *exprs, int *n_exprs, int precedence, GError **err)
 
static gboolean pos_eval_get_variable (PosToken *t, int *result, const MetaPositionExprEnv *env, GError **err)
 There is a predefined set of variables which can appear in an expression.
 
static gboolean pos_eval_helper (PosToken *tokens, int n_tokens, const MetaPositionExprEnv *env, PosExpr *result, GError **err)
 Evaluates a sequence of tokens within a particular environment context, and returns the current value.
 
static gboolean pos_eval (MetaDrawSpec *spec, const MetaPositionExprEnv *env, int *val_p, GError **err)
 Evaluates an expression.
 
gboolean meta_parse_position_expression (MetaDrawSpec *spec, const MetaPositionExprEnv *env, int *x_return, int *y_return, GError **err)
 
gboolean meta_parse_size_expression (MetaDrawSpec *spec, const MetaPositionExprEnv *env, int *val_return, GError **err)
 
gboolean meta_theme_replace_constants (MetaTheme *theme, PosToken *tokens, int n_tokens, GError **err)
 
static int parse_x_position_unchecked (MetaDrawSpec *spec, const MetaPositionExprEnv *env)
 
static int parse_y_position_unchecked (MetaDrawSpec *spec, const MetaPositionExprEnv *env)
 
static int parse_size_unchecked (MetaDrawSpec *spec, MetaPositionExprEnv *env)
 
void meta_draw_spec_free (MetaDrawSpec *spec)
 
MetaDrawSpec * meta_draw_spec_new (MetaTheme *theme, const char *expr, GError **error)
 
MetaDrawOp * meta_draw_op_new (MetaDrawType type)
 
void meta_draw_op_free (MetaDrawOp *op)
 
static GdkPixbuf * apply_alpha (GdkPixbuf *pixbuf, MetaAlphaGradientSpec *spec, gboolean force_copy)
 
static GdkPixbuf * pixbuf_tile (GdkPixbuf *tile, int width, int height)
 
static GdkPixbuf * replicate_rows (GdkPixbuf *src, int src_x, int src_y, int width, int height)
 
static GdkPixbuf * replicate_cols (GdkPixbuf *src, int src_x, int src_y, int width, int height)
 
static GdkPixbuf * scale_and_alpha_pixbuf (GdkPixbuf *src, MetaAlphaGradientSpec *alpha_spec, MetaImageFillType fill_type, int width, int height, gboolean vertical_stripes, gboolean horizontal_stripes)
 
static GdkPixbuf * draw_op_as_pixbuf (const MetaDrawOp *op, GtkStyleContext *style, const MetaDrawInfo *info, int width, int height)
 
static cairo_surface_t * draw_op_as_surface (const MetaDrawOp *op, GtkStyleContext *style, const MetaDrawInfo *info, gdouble width, gdouble height)
 
static void fill_env (MetaPositionExprEnv *env, const MetaDrawInfo *info, MetaRectangle logical_region)
 
static void meta_draw_op_draw_with_env (const MetaDrawOp *op, GtkStyleContext *style_gtk, cairo_t *cr, const MetaDrawInfo *info, MetaRectangle rect, MetaPositionExprEnv *env)
 
void meta_draw_op_draw_with_style (const MetaDrawOp *op, GtkStyleContext *style_gtk, cairo_t *cr, const MetaDrawInfo *info, MetaRectangle logical_region)
 
void meta_draw_op_draw (const MetaDrawOp *op, GtkWidget *widget, cairo_t *cr, const MetaDrawInfo *info, MetaRectangle logical_region)
 
MetaDrawOpList * meta_draw_op_list_new (int n_preallocs)
 
void meta_draw_op_list_ref (MetaDrawOpList *op_list)
 
void meta_draw_op_list_unref (MetaDrawOpList *op_list)
 
void meta_draw_op_list_draw_with_style (const MetaDrawOpList *op_list, GtkStyleContext *style_gtk, cairo_t *cr, const MetaDrawInfo *info, MetaRectangle rect)
 
void meta_draw_op_list_draw (const MetaDrawOpList *op_list, GtkWidget *widget, cairo_t *cr, const MetaDrawInfo *info, MetaRectangle rect)
 
void meta_draw_op_list_append (MetaDrawOpList *op_list, MetaDrawOp *op)
 
gboolean meta_draw_op_list_validate (MetaDrawOpList *op_list, GError **error)
 
gboolean meta_draw_op_list_contains (MetaDrawOpList *op_list, MetaDrawOpList *child)
 
MetaFrameStyle * meta_frame_style_new (MetaFrameStyle *parent)
 Constructor for a MetaFrameStyle.
 
void meta_frame_style_ref (MetaFrameStyle *style)
 Increases the reference count of a frame style.
 
static void free_button_ops (MetaDrawOpList *op_lists[META_BUTTON_TYPE_LAST][META_BUTTON_STATE_LAST])
 
void meta_frame_style_unref (MetaFrameStyle *style)
 
static MetaButtonState map_button_state (MetaButtonType button_type, const MetaFrameGeometry *fgeom, int middle_bg_offset, MetaButtonState button_states[META_BUTTON_TYPE_LAST])
 
static MetaDrawOpList * get_button (MetaFrameStyle *style, MetaButtonType type, MetaButtonState state)
 
gboolean meta_frame_style_validate (MetaFrameStyle *style, guint current_theme_version, GError **error)
 
static void get_button_rect (MetaButtonType type, const MetaFrameGeometry *fgeom, int middle_background_offset, GdkRectangle *rect)
 
void meta_frame_style_draw_with_style (MetaFrameStyle *style, GtkStyleContext *style_gtk, cairo_t *cr, const MetaFrameGeometry *fgeom, int client_width, int client_height, PangoLayout *title_layout, int text_height, MetaButtonState button_states[META_BUTTON_TYPE_LAST], GdkPixbuf *mini_icon, GdkPixbuf *icon)
 
void meta_frame_style_draw (MetaFrameStyle *style, GtkWidget *widget, cairo_t *cr, const MetaFrameGeometry *fgeom, int client_width, int client_height, PangoLayout *title_layout, int text_height, MetaButtonState button_states[META_BUTTON_TYPE_LAST], GdkPixbuf *mini_icon, GdkPixbuf *icon)
 
MetaFrameStyleSet * meta_frame_style_set_new (MetaFrameStyleSet *parent)
 
static void free_focus_styles (MetaFrameStyle *focus_styles[META_FRAME_FOCUS_LAST])
 
void meta_frame_style_set_ref (MetaFrameStyleSet *style_set)
 
void meta_frame_style_set_unref (MetaFrameStyleSet *style_set)
 
static MetaFrameStyle * get_style (MetaFrameStyleSet *style_set, MetaFrameState state, MetaFrameResize resize, MetaFrameFocus focus)
 
static gboolean check_state (MetaFrameStyleSet *style_set, MetaFrameState state, GError **error)
 
gboolean meta_frame_style_set_validate (MetaFrameStyleSet *style_set, GError **error)
 
MetaTheme * meta_theme_get_current (void)
 
void meta_theme_set_current (const char *name, gboolean force_reload)
 
MetaTheme * meta_theme_new (void)
 
void meta_theme_free (MetaTheme *theme)
 
gboolean meta_theme_validate (MetaTheme *theme, GError **error)
 
GdkPixbuf * meta_theme_load_image (MetaTheme *theme, const char *filename, guint size_of_theme_icons, GError **error)
 
static MetaFrameStyle * theme_get_style (MetaTheme *theme, MetaFrameType type, MetaFrameFlags flags)
 
MetaFrameStyle * meta_theme_get_frame_style (MetaTheme *theme, MetaFrameType type, MetaFrameFlags flags)
 
double meta_theme_get_title_scale (MetaTheme *theme, MetaFrameType type, MetaFrameFlags flags)
 
void meta_theme_draw_frame (MetaTheme *theme, GtkStyleContext *style_gtk, cairo_t *cr, MetaFrameType type, MetaFrameFlags flags, int client_width, int client_height, PangoLayout *title_layout, int text_height, const MetaButtonLayout *button_layout, MetaButtonState button_states[META_BUTTON_TYPE_LAST], GdkPixbuf *mini_icon, GdkPixbuf *icon)
 
void meta_theme_draw_frame_by_name (MetaTheme *theme, GtkWidget *widget, cairo_t *cr, const gchar *style_name, MetaFrameFlags flags, int client_width, int client_height, PangoLayout *title_layout, int text_height, const MetaButtonLayout *button_layout, MetaButtonState button_states[META_BUTTON_TYPE_LAST], GdkPixbuf *mini_icon, GdkPixbuf *icon)
 
void meta_theme_get_frame_borders (MetaTheme *theme, MetaFrameType type, int text_height, MetaFrameFlags flags, MetaFrameBorders *borders)
 
void meta_theme_calc_geometry (MetaTheme *theme, MetaFrameType type, int text_height, MetaFrameFlags flags, int client_width, int client_height, const MetaButtonLayout *button_layout, MetaFrameGeometry *fgeom)
 
MetaFrameLayout * meta_theme_lookup_layout (MetaTheme *theme, const char *name)
 
void meta_theme_insert_layout (MetaTheme *theme, const char *name, MetaFrameLayout *layout)
 
MetaDrawOpList * meta_theme_lookup_draw_op_list (MetaTheme *theme, const char *name)
 
void meta_theme_insert_draw_op_list (MetaTheme *theme, const char *name, MetaDrawOpList *op_list)
 
MetaFrameStyle * meta_theme_lookup_style (MetaTheme *theme, const char *name)
 
void meta_theme_insert_style (MetaTheme *theme, const char *name, MetaFrameStyle *style)
 
MetaFrameStyleSet * meta_theme_lookup_style_set (MetaTheme *theme, const char *name)
 
void meta_theme_insert_style_set (MetaTheme *theme, const char *name, MetaFrameStyleSet *style_set)
 
static gboolean first_uppercase (const char *str)
 
gboolean meta_theme_define_int_constant (MetaTheme *theme, const char *name, int value, GError **error)
 
gboolean meta_theme_lookup_int_constant (MetaTheme *theme, const char *name, int *value)
 
gboolean meta_theme_define_float_constant (MetaTheme *theme, const char *name, double value, GError **error)
 
gboolean meta_theme_lookup_float_constant (MetaTheme *theme, const char *name, double *value)
 
gboolean meta_theme_define_color_constant (MetaTheme *theme, const char *name, const char *value, GError **error)
 
gboolean meta_theme_lookup_color_constant (MetaTheme *theme, const char *name, char **value)
 Looks up a colour constant.
 
PangoFontDescription * meta_gtk_widget_get_font_desc (GtkWidget *widget, double scale, const PangoFontDescription *override)
 
int meta_pango_font_desc_get_text_height (const PangoFontDescription *font_desc, PangoContext *context)
 Returns the height of the letters in a particular font.
 
MetaGtkColorComponent meta_color_component_from_string (const char *str)
 
const char * meta_color_component_to_string (MetaGtkColorComponent component)
 
MetaButtonState meta_button_state_from_string (const char *str)
 
const char * meta_button_state_to_string (MetaButtonState state)
 
MetaButtonType meta_button_type_from_string (const char *str, MetaTheme *theme)
 
const char * meta_button_type_to_string (MetaButtonType type)
 
MetaFramePiece meta_frame_piece_from_string (const char *str)
 
const char * meta_frame_piece_to_string (MetaFramePiece piece)
 
MetaFrameState meta_frame_state_from_string (const char *str)
 
const char * meta_frame_state_to_string (MetaFrameState state)
 
MetaFrameResize meta_frame_resize_from_string (const char *str)
 
const char * meta_frame_resize_to_string (MetaFrameResize resize)
 
MetaFrameFocus meta_frame_focus_from_string (const char *str)
 
const char * meta_frame_focus_to_string (MetaFrameFocus focus)
 
MetaFrameType meta_frame_type_from_string (const char *str)
 
const char * meta_frame_type_to_string (MetaFrameType type)
 
MetaGradientType meta_gradient_type_from_string (const char *str)
 
const char * meta_gradient_type_to_string (MetaGradientType type)
 
GtkStateFlags meta_gtk_state_from_string (const char *str)
 
GtkShadowType meta_gtk_shadow_from_string (const char *str)
 
const char * meta_gtk_shadow_to_string (GtkShadowType shadow)
 
GtkArrowType meta_gtk_arrow_from_string (const char *str)
 
const char * meta_gtk_arrow_to_string (GtkArrowType arrow)
 
MetaImageFillType meta_image_fill_type_from_string (const char *str)
 Returns a fill_type from a string.
 
const char * meta_image_fill_type_to_string (MetaImageFillType fill_type)
 Returns a string representation of a fill_type.
 
guint meta_theme_earliest_version_with_button (MetaButtonType type)
 Returns the earliest version of the theme format which required support for a particular button.
 

Variables

static MetaTheme * meta_current_theme = NULL
 The current theme.
 

Detailed Description

Making Marco look pretty.

The window decorations drawn by Marco are described by files on disk known internally as "themes" (externally as "window border themes" on http://art.gnome.org/themes/marco/ or "Marco themes"). This file contains most of the code necessary to support themes; it does not contain the XML parser, which is in theme-parser.c.

Bug:
This is a big file with lots of different subsystems, which might be better split out into separate files.

Macro Definition Documentation

◆ __USE_XOPEN

#define __USE_XOPEN

◆ CHECK_GEOMETRY_BORDER

#define CHECK_GEOMETRY_BORDER (   bname)    if (!validate_geometry_border (&layout->bname, #bname, error)) return FALSE

◆ CHECK_GEOMETRY_VALUE

#define CHECK_GEOMETRY_VALUE (   vname)    if (!validate_geometry_value (layout->vname, #vname, error)) return FALSE

◆ CLAMP_UCHAR

#define CLAMP_UCHAR (   v)    ((guchar) (CLAMP (((int)v), (int)0, (int)255)))

◆ DARKNESS_MULT

#define DARKNESS_MULT   0.7

◆ DEBUG_FILL_STRUCT

#define DEBUG_FILL_STRUCT (   s)    memset ((s), 0xef, sizeof (*(s)))

◆ GDK_COLOR_RGB

#define GDK_COLOR_RGB (   color)
Value:
((guint32) (((int)((color).red * 255) << 16) | \
((int)((color).green * 255) << 8) | \
((int)((color).blue * 255))))

◆ GDK_COLOR_RGBA

#define GDK_COLOR_RGBA (   color)
Value:
((guint32) (0xff | \
((int)((color).red * 255) << 24) | \
((int)((color).green * 255) << 16) | \
((int)((color).blue * 255) << 8)))

◆ INTENSITY

#define INTENSITY (   r,
  g,
  b 
)    ((r) * 0.30 + (g) * 0.59 + (b) * 0.11)

◆ IS_VARIABLE_CHAR

#define IS_VARIABLE_CHAR (   c)    (g_ascii_isalpha ((c)) || (c) == '_')

Whether a variable can validly appear as part of the name of a variable.

◆ LIGHTNESS_MULT

#define LIGHTNESS_MULT   1.3

◆ MAX_EXPRS

#define MAX_EXPRS   32

Function Documentation

◆ apply_alpha()

static GdkPixbuf * apply_alpha ( GdkPixbuf *  pixbuf,
MetaAlphaGradientSpec *  spec,
gboolean  force_copy 
)
static

References _MetaAlphaGradientSpec::alphas, FALSE, meta_gradient_add_alpha(), _MetaAlphaGradientSpec::n_alphas, NULL, and _MetaAlphaGradientSpec::type.

Referenced by scale_and_alpha_pixbuf().

Here is the call graph for this function:

◆ check_state()

static gboolean check_state ( MetaFrameStyleSet *  style_set,
MetaFrameState  state,
GError **  error 
)
static

References _, FALSE, get_style(), META_FRAME_FOCUS_LAST, meta_frame_focus_to_string(), META_FRAME_RESIZE_NONE, meta_frame_resize_to_string(), meta_frame_state_to_string(), META_THEME_ERROR, META_THEME_ERROR_FAILED, NULL, and TRUE.

Referenced by meta_frame_style_set_validate().

Here is the call graph for this function:

◆ color_composite()

static void color_composite ( const GdkRGBA *  bg,
const GdkRGBA *  fg,
double  alpha,
GdkRGBA *  color 
)
static

Referenced by meta_color_spec_render().

◆ colorize_pixbuf()

static GdkPixbuf * colorize_pixbuf ( GdkPixbuf *  orig,
GdkRGBA *  new_color 
)
static

References CLAMP_UCHAR, INTENSITY, and NULL.

Referenced by draw_op_as_pixbuf(), and draw_op_as_surface().

◆ create_cairo_pattern_from_gradient_spec()

static cairo_pattern_t * create_cairo_pattern_from_gradient_spec ( const MetaGradientSpec *  spec,
const MetaAlphaGradientSpec *  alpha_spec,
GtkStyleContext *  context 
)
static

References _MetaAlphaGradientSpec::alphas, _MetaGradientSpec::color_specs, meta_color_spec_render(), META_GRADIENT_DIAGONAL, META_GRADIENT_HORIZONTAL, META_GRADIENT_VERTICAL, _MetaAlphaGradientSpec::n_alphas, NULL, and _MetaGradientSpec::type.

Referenced by meta_gradient_spec_render().

Here is the call graph for this function:

◆ do_operation()

◆ do_operations()

static gboolean do_operations ( PosExpr *  exprs,
int *  n_exprs,
int  precedence,
GError **  err 
)
static

References _, PosExpr::d, do_operation(), FALSE, META_THEME_ERROR, META_THEME_ERROR_FAILED, op_name(), PosExpr::operator, POS_EXPR_OPERATOR, POS_OP_ADD, POS_OP_DIVIDE, POS_OP_MAX, POS_OP_MIN, POS_OP_MOD, POS_OP_MULTIPLY, POS_OP_SUBTRACT, and TRUE.

Referenced by pos_eval_helper().

Here is the call graph for this function:

◆ draw_op_as_pixbuf()

◆ draw_op_as_surface()

◆ fill_env()

◆ first_uppercase()

static gboolean first_uppercase ( const char *  str)
static

◆ free_button_ops()

static void free_button_ops ( MetaDrawOpList *  op_lists[META_BUTTON_TYPE_LAST][META_BUTTON_STATE_LAST])
static

References META_BUTTON_STATE_LAST, META_BUTTON_TYPE_LAST, and meta_draw_op_list_unref().

Referenced by meta_frame_style_unref().

Here is the call graph for this function:

◆ free_color_spec()

static void free_color_spec ( gpointer  spec,
gpointer  user_data 
)
static

References meta_color_spec_free().

Referenced by meta_gradient_spec_free().

Here is the call graph for this function:

◆ free_focus_styles()

static void free_focus_styles ( MetaFrameStyle *  focus_styles[META_FRAME_FOCUS_LAST])
static

References META_FRAME_FOCUS_LAST, and meta_frame_style_unref().

Referenced by meta_frame_style_set_unref().

Here is the call graph for this function:

◆ free_tokens()

static void free_tokens ( PosToken *  tokens,
int  n_tokens 
)
static

Frees an array of tokens.

All the tokens and their associated memory will be freed.

Parameters
tokensan array of tokens to be freed
n_tokenshow many tokens are in the array.

References PosToken::name, POS_TOKEN_VARIABLE, and PosToken::v.

Referenced by meta_draw_spec_free(), and pos_tokenize().

◆ get_background_color()

static void get_background_color ( GtkStyleContext *  context,
GtkStateFlags  state,
GdkRGBA *  color 
)
static

References get_background_color_real().

Referenced by meta_gtk_style_get_dark_color(), meta_gtk_style_get_light_color(), and meta_set_color_from_style().

Here is the call graph for this function:

◆ get_background_color_real()

static void get_background_color_real ( GtkStyleContext *  context,
GtkStateFlags  state,
GdkRGBA *  color 
)
static

References NULL.

Referenced by get_background_color().

◆ get_button()

◆ get_button_rect()

static void get_button_rect ( MetaButtonType  type,
const MetaFrameGeometry *  fgeom,
int  middle_background_offset,
GdkRectangle *  rect 
)
static

◆ get_style()

◆ get_surface_from_pixbuf()

static cairo_surface_t * get_surface_from_pixbuf ( GdkPixbuf *  pixbuf,
MetaImageFillType  fill_type,
gdouble  width,
gdouble  height,
gboolean  vertical_stripes,
gboolean  horizontal_stripes 
)
static

References META_IMAGE_FILL_TILE, NULL, and scale_surface().

Referenced by draw_op_as_surface().

Here is the call graph for this function:

◆ gtk_style_shade()

static void gtk_style_shade ( GdkRGBA *  a,
GdkRGBA *  b,
gdouble  k 
)
static

Takes a colour "a", scales the lightness and saturation by a certain amount, and sets "b" to the resulting colour.

gtkstyle.c cut-and-pastage.

Parameters
athe starting colour
b[out] the resulting colour
kamount to scale lightness and saturation by

References hls_to_rgb(), and rgb_to_hls().

Referenced by meta_color_spec_render(), meta_gtk_style_get_dark_color(), and meta_gtk_style_get_light_color().

Here is the call graph for this function:

◆ hls_to_rgb()

static void hls_to_rgb ( gdouble *  h,
gdouble *  l,
gdouble *  s 
)
static

Converts a hue/lightness/saturation triplet to a red/green/blue triplet.

Parameters
hon input, hue; on output, red
lon input, lightness; on output, green
son input, saturation; on output, blue

Referenced by gtk_style_shade().

◆ init_border()

static void init_border ( GtkBorder *  border)
static

Sets all the fields of a border to dummy values.

Parameters
borderThe border whose fields should be reset.

Referenced by meta_frame_layout_new().

◆ map_button_function_to_type()

◆ map_button_state()

◆ meta_alpha_gradient_spec_free()

void meta_alpha_gradient_spec_free ( MetaAlphaGradientSpec *  spec)

◆ meta_alpha_gradient_spec_get_mask()

cairo_pattern_t * meta_alpha_gradient_spec_get_mask ( const MetaAlphaGradientSpec *  spec)

◆ meta_alpha_gradient_spec_new()

MetaAlphaGradientSpec * meta_alpha_gradient_spec_new ( MetaGradientType  type,
int  n_alphas 
)

◆ meta_button_state_from_string()

MetaButtonState meta_button_state_from_string ( const char *  str)

◆ meta_button_state_to_string()

const char * meta_button_state_to_string ( MetaButtonState  state)

◆ meta_button_type_from_string()

◆ meta_button_type_to_string()

◆ meta_color_component_from_string()

◆ meta_color_component_to_string()

◆ meta_color_spec_free()

◆ meta_color_spec_new()

◆ meta_color_spec_new_from_string()

◆ meta_color_spec_new_gtk()

MetaColorSpec * meta_color_spec_new_gtk ( MetaGtkColorComponent  component,
GtkStateFlags  state 
)

References _MetaColorSpec::component, _MetaColorSpec::data, _MetaColorSpec::gtk, META_COLOR_SPEC_GTK, meta_color_spec_new(), and _MetaColorSpec::state.

Here is the call graph for this function:

◆ meta_color_spec_render()

◆ meta_draw_op_draw()

void meta_draw_op_draw ( const MetaDrawOp *  op,
GtkWidget *  widget,
cairo_t *  cr,
const MetaDrawInfo *  info,
MetaRectangle  logical_region 
)

References meta_draw_op_draw_with_style().

Here is the call graph for this function:

◆ meta_draw_op_draw_with_env()

static void meta_draw_op_draw_with_env ( const MetaDrawOp *  op,
GtkStyleContext *  style_gtk,
cairo_t *  cr,
const MetaDrawInfo *  info,
MetaRectangle  rect,
MetaPositionExprEnv *  env 
)
static

References _MetaDrawOp::alpha_spec, _MetaAlphaGradientSpec::alphas, _MetaDrawOp::arc, _MetaDrawOp::arrow, _MetaDrawOp::color_spec, _MetaDrawOp::dash_off_length, _MetaDrawOp::dash_on_length, _MetaDrawOp::data, draw_op_as_pixbuf(), draw_op_as_surface(), _MetaDrawOp::ellipsize_width, _MetaDrawOp::extent_angle, _MetaDrawOp::filled, _MetaDrawOp::gradient, _MetaDrawOp::gradient_spec, _MetaDrawOp::gtk_arrow, _MetaDrawOp::gtk_box, _MetaDrawOp::gtk_vline, _MetaRectangle::height, _MetaDrawOp::height, _MetaDrawOp::icon, _MetaDrawOp::image, _MetaDrawOp::line, meta_alpha_gradient_spec_get_mask(), meta_color_spec_render(), META_DRAW_ARC, META_DRAW_CLIP, META_DRAW_GRADIENT, META_DRAW_GTK_ARROW, META_DRAW_GTK_BOX, META_DRAW_GTK_VLINE, META_DRAW_ICON, META_DRAW_IMAGE, META_DRAW_LINE, META_DRAW_OP_LIST, meta_draw_op_list_draw_with_style(), META_DRAW_RECTANGLE, META_DRAW_TILE, META_DRAW_TINT, META_DRAW_TITLE, meta_gradient_spec_render(), _MetaAlphaGradientSpec::n_alphas, _MetaPositionExprEnv::object_height, _MetaPositionExprEnv::object_width, _MetaDrawOp::op_list, parse_size_unchecked(), parse_x_position_unchecked(), parse_y_position_unchecked(), _MetaDrawOp::pixbuf, _MetaPositionExprEnv::rect, _MetaDrawOp::rectangle, _MetaPositionExprEnv::right_width, _MetaDrawOp::start_angle, _MetaDrawOp::state, _MetaDrawOp::tile, _MetaDrawOp::tile_height, _MetaDrawOp::tile_width, _MetaDrawOp::tile_xoffset, _MetaDrawOp::tile_yoffset, _MetaDrawOp::tint, _MetaDrawOp::title, _MetaPositionExprEnv::title_height, _MetaDrawInfo::title_layout, _MetaPositionExprEnv::title_width, _MetaDrawOp::type, _MetaRectangle::width, _MetaDrawOp::width, _MetaRectangle::x, _MetaDrawOp::x, _MetaDrawOp::x1, _MetaDrawOp::x2, _MetaRectangle::y, _MetaDrawOp::y, _MetaDrawOp::y1, and _MetaDrawOp::y2.

Referenced by meta_draw_op_draw_with_style(), and meta_draw_op_list_draw_with_style().

Here is the call graph for this function:

◆ meta_draw_op_draw_with_style()

void meta_draw_op_draw_with_style ( const MetaDrawOp *  op,
GtkStyleContext *  style_gtk,
cairo_t *  cr,
const MetaDrawInfo *  info,
MetaRectangle  logical_region 
)

References fill_env(), and meta_draw_op_draw_with_env().

Referenced by meta_draw_op_draw().

Here is the call graph for this function:

◆ meta_draw_op_free()

◆ meta_draw_op_list_append()

void meta_draw_op_list_append ( MetaDrawOpList *  op_list,
MetaDrawOp *  op 
)

◆ meta_draw_op_list_contains()

gboolean meta_draw_op_list_contains ( MetaDrawOpList *  op_list,
MetaDrawOpList *  child 
)

References _MetaDrawOp::data, FALSE, META_DRAW_OP_LIST, meta_draw_op_list_contains(), META_DRAW_TILE, _MetaDrawOpList::n_ops, _MetaDrawOp::op_list, _MetaDrawOpList::ops, _MetaDrawOp::tile, TRUE, and _MetaDrawOp::type.

Referenced by meta_draw_op_list_contains(), and parse_draw_op_element().

Here is the call graph for this function:

◆ meta_draw_op_list_draw()

void meta_draw_op_list_draw ( const MetaDrawOpList *  op_list,
GtkWidget *  widget,
cairo_t *  cr,
const MetaDrawInfo *  info,
MetaRectangle  rect 
)

References meta_draw_op_list_draw_with_style().

Here is the call graph for this function:

◆ meta_draw_op_list_draw_with_style()

void meta_draw_op_list_draw_with_style ( const MetaDrawOpList *  op_list,
GtkStyleContext *  style_gtk,
cairo_t *  cr,
const MetaDrawInfo *  info,
MetaRectangle  rect 
)

◆ meta_draw_op_list_new()

◆ meta_draw_op_list_ref()

void meta_draw_op_list_ref ( MetaDrawOpList *  op_list)

◆ meta_draw_op_list_unref()

void meta_draw_op_list_unref ( MetaDrawOpList *  op_list)

References DEBUG_FILL_STRUCT, meta_draw_op_free(), _MetaDrawOpList::n_ops, NULL, _MetaDrawOpList::ops, and _MetaDrawOpList::refcount.

Referenced by end_element_handler(), free_button_ops(), meta_draw_op_free(), meta_frame_style_unref(), meta_theme_new(), and parse_info_free().

Here is the call graph for this function:

◆ meta_draw_op_list_validate()

gboolean meta_draw_op_list_validate ( MetaDrawOpList *  op_list,
GError **  error 
)

References FALSE, NULL, and TRUE.

Referenced by end_element_handler().

◆ meta_draw_op_new()

◆ meta_draw_spec_free()

void meta_draw_spec_free ( MetaDrawSpec *  spec)

References free_tokens(), _MetaDrawSpec::n_tokens, and _MetaDrawSpec::tokens.

Referenced by meta_draw_op_free(), and meta_draw_spec_new().

Here is the call graph for this function:

◆ meta_draw_spec_new()

MetaDrawSpec * meta_draw_spec_new ( MetaTheme *  theme,
const char *  expr,
GError **  error 
)

References _MetaDrawSpec::constant, meta_draw_spec_free(), meta_theme_replace_constants(), _MetaDrawSpec::n_tokens, NULL, pos_eval(), pos_tokenize(), _MetaDrawSpec::tokens, and _MetaDrawSpec::value.

Referenced by parse_draw_op_element().

Here is the call graph for this function:

◆ meta_frame_focus_from_string()

MetaFrameFocus meta_frame_focus_from_string ( const char *  str)

◆ meta_frame_focus_to_string()

const char * meta_frame_focus_to_string ( MetaFrameFocus  focus)

◆ meta_frame_layout_calc_geometry()

void meta_frame_layout_calc_geometry ( const MetaFrameLayout *  layout,
int  text_height,
MetaFrameFlags  flags,
int  client_width,
int  client_height,
const MetaButtonLayout *  button_layout,
MetaFrameGeometry *  fgeom,
MetaTheme *  theme 
)

References _MetaFrameGeometry::above_rect, ADDRESS_OF_BUTTON_RECTS, _MetaFrameGeometry::appmenu_rect, _MetaFrameGeometry::borders, _MetaFrameLayout::bottom_left_corner_rounded_radius, _MetaFrameGeometry::bottom_left_corner_rounded_radius, _MetaFrameLayout::bottom_right_corner_rounded_radius, _MetaFrameGeometry::bottom_right_corner_rounded_radius, _MetaFrameGeometry::bottom_titlebar_edge, _MetaFrameLayout::button_aspect, _MetaFrameLayout::button_border, _MetaFrameLayout::button_height, button_layout, _MetaFrameGeometry::button_layout, _MetaFrameLayout::button_sizing, _MetaFrameLayout::button_width, _MetaButtonSpace::clickable, _MetaFrameGeometry::close_rect, FALSE, _MetaFrameGeometry::height, _MetaFrameLayout::hide_buttons, _MetaFrameBorders::invisible, _MetaButtonLayout::left_buttons, _MetaButtonLayout::left_buttons_has_spacer, _MetaFrameGeometry::left_left_background, _MetaFrameGeometry::left_middle_backgrounds, _MetaFrameGeometry::left_right_background, _MetaFrameGeometry::left_single_background, _MetaFrameLayout::left_titlebar_edge, _MetaFrameGeometry::left_titlebar_edge, _MetaFrameLayout::left_width, LENGTH_OF_BUTTON_RECTS, MAX_BUTTONS_PER_CORNER, _MetaFrameGeometry::max_rect, _MetaFrameGeometry::menu_rect, meta_bug(), META_BUTTON_FUNCTION_LAST, META_BUTTON_SIZING_ASPECT, META_BUTTON_SIZING_FIXED, META_BUTTON_SIZING_LAST, meta_frame_layout_get_borders(), META_FRAME_MAXIMIZED, META_FRAME_SHADED, META_FRAME_TILED_LEFT, META_FRAME_TILED_RIGHT, META_FRAME_TYPE_NORMAL, _MetaFrameGeometry::min_rect, _MetaFrameGeometry::n_left_buttons, _MetaFrameGeometry::n_right_buttons, NULL, rect_for_function(), _MetaButtonLayout::right_buttons, _MetaButtonLayout::right_buttons_has_spacer, _MetaFrameGeometry::right_left_background, _MetaFrameGeometry::right_middle_backgrounds, _MetaFrameGeometry::right_right_background, _MetaFrameGeometry::right_single_background, _MetaFrameLayout::right_titlebar_edge, _MetaFrameGeometry::right_titlebar_edge, _MetaFrameLayout::right_width, _MetaFrameGeometry::shade_rect, _MetaFrameGeometry::stick_rect, strip_button(), _MetaFrameLayout::title_border, _MetaFrameGeometry::title_rect, _MetaFrameLayout::top_left_corner_rounded_radius, _MetaFrameGeometry::top_left_corner_rounded_radius, _MetaFrameLayout::top_right_corner_rounded_radius, _MetaFrameGeometry::top_right_corner_rounded_radius, _MetaFrameGeometry::top_titlebar_edge, _MetaFrameBorders::total, _MetaFrameBorders::visible, _MetaButtonSpace::visible, and _MetaFrameGeometry::width.

Referenced by meta_theme_calc_geometry(), meta_theme_draw_frame(), and meta_theme_draw_frame_by_name().

Here is the call graph for this function:

◆ meta_frame_layout_copy()

MetaFrameLayout * meta_frame_layout_copy ( const MetaFrameLayout *  src)

◆ meta_frame_layout_get_borders()

◆ meta_frame_layout_new()

◆ meta_frame_layout_ref()

void meta_frame_layout_ref ( MetaFrameLayout *  layout)

◆ meta_frame_layout_unref()

◆ meta_frame_layout_validate()

◆ meta_frame_piece_from_string()

◆ meta_frame_piece_to_string()

◆ meta_frame_resize_from_string()

◆ meta_frame_resize_to_string()

◆ meta_frame_state_from_string()

◆ meta_frame_state_to_string()

◆ meta_frame_style_draw()

void meta_frame_style_draw ( MetaFrameStyle *  style,
GtkWidget *  widget,
cairo_t *  cr,
const MetaFrameGeometry *  fgeom,
int  client_width,
int  client_height,
PangoLayout *  title_layout,
int  text_height,
MetaButtonState  button_states[META_BUTTON_TYPE_LAST],
GdkPixbuf *  mini_icon,
GdkPixbuf *  icon 
)

References meta_frame_style_draw_with_style().

Referenced by meta_theme_draw_frame_by_name().

Here is the call graph for this function:

◆ meta_frame_style_draw_with_style()

void meta_frame_style_draw_with_style ( MetaFrameStyle *  style,
GtkStyleContext *  style_gtk,
cairo_t *  cr,
const MetaFrameGeometry *  fgeom,
int  client_width,
int  client_height,
PangoLayout *  title_layout,
int  text_height,
MetaButtonState  button_states[META_BUTTON_TYPE_LAST],
GdkPixbuf *  mini_icon,
GdkPixbuf *  icon 
)

◆ meta_frame_style_new()

MetaFrameStyle * meta_frame_style_new ( MetaFrameStyle *  parent)

Constructor for a MetaFrameStyle.

Parameters
parentThe parent style. Data not filled in here will be looked for in the parent style, and in its parent style, and so on.
Returns
The newly-constructed style.

References meta_frame_style_ref(), _MetaFrameStyle::parent, _MetaFrameStyle::refcount, and _MetaFrameStyle::window_background_alpha.

Referenced by parse_toplevel_element().

Here is the call graph for this function:

◆ meta_frame_style_ref()

void meta_frame_style_ref ( MetaFrameStyle *  style)

Increases the reference count of a frame style.

If the style is NULL, this is a no-op.

Parameters
styleThe style.

References NULL, and _MetaFrameStyle::refcount.

Referenced by meta_frame_style_new(), meta_theme_insert_style(), and parse_style_set_element().

◆ meta_frame_style_set_new()

MetaFrameStyleSet * meta_frame_style_set_new ( MetaFrameStyleSet *  parent)

References meta_frame_style_set_ref(), _MetaFrameStyleSet::parent, and _MetaFrameStyleSet::refcount.

Referenced by parse_toplevel_element().

Here is the call graph for this function:

◆ meta_frame_style_set_ref()

void meta_frame_style_set_ref ( MetaFrameStyleSet *  style_set)

◆ meta_frame_style_set_unref()

◆ meta_frame_style_set_validate()

gboolean meta_frame_style_set_validate ( MetaFrameStyleSet *  style_set,
GError **  error 
)

◆ meta_frame_style_unref()

◆ meta_frame_style_validate()

gboolean meta_frame_style_validate ( MetaFrameStyle *  style,
guint  current_theme_version,
GError **  error 
)

References _, FALSE, get_button(), _MetaFrameStyle::layout, META_BUTTON_STATE_LAST, meta_button_state_to_string(), META_BUTTON_TYPE_CLOSE, META_BUTTON_TYPE_LAST, meta_button_type_to_string(), meta_theme_earliest_version_with_button(), META_THEME_ERROR, META_THEME_ERROR_FAILED, NULL, and TRUE.

Referenced by end_element_handler().

Here is the call graph for this function:

◆ meta_frame_type_from_string()

◆ meta_frame_type_to_string()

◆ meta_gradient_spec_free()

void meta_gradient_spec_free ( MetaGradientSpec *  spec)

References _MetaGradientSpec::color_specs, DEBUG_FILL_STRUCT, free_color_spec(), and NULL.

Referenced by meta_draw_op_free().

Here is the call graph for this function:

◆ meta_gradient_spec_new()

MetaGradientSpec * meta_gradient_spec_new ( MetaGradientType  type)

◆ meta_gradient_spec_render()

void meta_gradient_spec_render ( const MetaGradientSpec *  spec,
const MetaAlphaGradientSpec *  alpha_spec,
cairo_t *  cr,
GtkStyleContext *  context,
gint  x,
gint  y,
gint  width,
gint  height 
)

References create_cairo_pattern_from_gradient_spec(), and NULL.

Referenced by meta_draw_op_draw_with_env().

Here is the call graph for this function:

◆ meta_gradient_spec_validate()

gboolean meta_gradient_spec_validate ( MetaGradientSpec *  spec,
GError **  error 
)

◆ meta_gradient_type_from_string()

MetaGradientType meta_gradient_type_from_string ( const char *  str)

◆ meta_gradient_type_to_string()

const char * meta_gradient_type_to_string ( MetaGradientType  type)

◆ meta_gtk_arrow_from_string()

GtkArrowType meta_gtk_arrow_from_string ( const char *  str)

Referenced by parse_draw_op_element().

◆ meta_gtk_arrow_to_string()

const char * meta_gtk_arrow_to_string ( GtkArrowType  arrow)

◆ meta_gtk_shadow_from_string()

GtkShadowType meta_gtk_shadow_from_string ( const char *  str)

Referenced by parse_draw_op_element().

◆ meta_gtk_shadow_to_string()

const char * meta_gtk_shadow_to_string ( GtkShadowType  shadow)

◆ meta_gtk_state_from_string()

GtkStateFlags meta_gtk_state_from_string ( const char *  str)

◆ meta_gtk_style_get_dark_color()

void meta_gtk_style_get_dark_color ( GtkStyleContext *  style,
GtkStateFlags  state,
GdkRGBA *  color 
)

References DARKNESS_MULT, get_background_color(), and gtk_style_shade().

Referenced by meta_select_image_draw(), meta_select_workspace_draw(), meta_set_color_from_style(), and wnck_draw_workspace().

Here is the call graph for this function:

◆ meta_gtk_style_get_light_color()

void meta_gtk_style_get_light_color ( GtkStyleContext *  style,
GtkStateFlags  state,
GdkRGBA *  color 
)

References get_background_color(), gtk_style_shade(), and LIGHTNESS_MULT.

Referenced by draw_window(), meta_select_image_draw(), meta_select_workspace_draw(), and meta_set_color_from_style().

Here is the call graph for this function:

◆ meta_gtk_widget_get_font_desc()

PangoFontDescription * meta_gtk_widget_get_font_desc ( GtkWidget *  widget,
double  scale,
const PangoFontDescription *  override 
)

References NULL, and TRUE.

Referenced by ensure_info(), and meta_frames_ensure_layout().

◆ meta_image_fill_type_from_string()

MetaImageFillType meta_image_fill_type_from_string ( const char *  str)

Returns a fill_type from a string.

The inverse of meta_image_fill_type_to_string().

Parameters
stra string representing a fill_type
Returns
the fill_type, or -1 if it represents no fill_type.

References META_IMAGE_FILL_SCALE, and META_IMAGE_FILL_TILE.

Referenced by parse_draw_op_element().

◆ meta_image_fill_type_to_string()

const char * meta_image_fill_type_to_string ( MetaImageFillType  fill_type)

Returns a string representation of a fill_type.

The inverse of meta_image_fill_type_from_string().

Parameters
fill_typethe fill type
Returns
a string representing that type

References META_IMAGE_FILL_SCALE, and META_IMAGE_FILL_TILE.

◆ meta_pango_font_desc_get_text_height()

int meta_pango_font_desc_get_text_height ( const PangoFontDescription *  font_desc,
PangoContext *  context 
)

Returns the height of the letters in a particular font.

Parameters
font_descthe font
contextthe context of the font
Returns
the height of the letters

Referenced by ensure_info(), get_text_height(), meta_frames_ensure_layout(), and meta_ui_theme_get_frame_borders().

◆ meta_parse_position_expression()

gboolean meta_parse_position_expression ( MetaDrawSpec *  spec,
const MetaPositionExprEnv *  env,
int *  x_return,
int *  y_return,
GError **  err 
)

References _MetaDrawSpec::constant, FALSE, NULL, pos_eval(), _MetaPositionExprEnv::rect, TRUE, _MetaDrawSpec::value, _MetaRectangle::x, and _MetaRectangle::y.

Referenced by parse_x_position_unchecked(), and parse_y_position_unchecked().

Here is the call graph for this function:

◆ meta_parse_size_expression()

gboolean meta_parse_size_expression ( MetaDrawSpec *  spec,
const MetaPositionExprEnv *  env,
int *  val_return,
GError **  err 
)

References _MetaDrawSpec::constant, FALSE, NULL, pos_eval(), TRUE, and _MetaDrawSpec::value.

Referenced by parse_size_unchecked().

Here is the call graph for this function:

◆ meta_set_color_from_style()

static void meta_set_color_from_style ( GdkRGBA *  color,
GtkStyleContext *  context,
GtkStateFlags  state,
MetaGtkColorComponent  component 
)
static

◆ meta_set_custom_color_from_style()

static void meta_set_custom_color_from_style ( GdkRGBA *  color,
GtkStyleContext *  context,
char *  color_name,
MetaColorSpec *  fallback 
)
static

References meta_color_spec_render().

Referenced by meta_color_spec_render().

Here is the call graph for this function:

◆ meta_theme_calc_geometry()

void meta_theme_calc_geometry ( MetaTheme *  theme,
MetaFrameType  type,
int  text_height,
MetaFrameFlags  flags,
int  client_width,
int  client_height,
const MetaButtonLayout *  button_layout,
MetaFrameGeometry *  fgeom 
)

References button_layout, _MetaFrameStyle::layout, meta_frame_layout_calc_geometry(), META_FRAME_TYPE_LAST, NULL, and theme_get_style().

Referenced by meta_frames_calc_geometry().

Here is the call graph for this function:

◆ meta_theme_define_color_constant()

gboolean meta_theme_define_color_constant ( MetaTheme *  theme,
const char *  name,
const char *  value,
GError **  error 
)

References _, _MetaTheme::color_constants, FALSE, first_uppercase(), META_THEME_ERROR, META_THEME_ERROR_FAILED, NULL, and TRUE.

Referenced by parse_toplevel_element().

Here is the call graph for this function:

◆ meta_theme_define_float_constant()

gboolean meta_theme_define_float_constant ( MetaTheme *  theme,
const char *  name,
double  value,
GError **  error 
)

References _, FALSE, first_uppercase(), _MetaTheme::float_constants, META_THEME_ERROR, META_THEME_ERROR_FAILED, NULL, and TRUE.

Referenced by parse_toplevel_element().

Here is the call graph for this function:

◆ meta_theme_define_int_constant()

gboolean meta_theme_define_int_constant ( MetaTheme *  theme,
const char *  name,
int  value,
GError **  error 
)

References _, FALSE, first_uppercase(), _MetaTheme::integer_constants, META_THEME_ERROR, META_THEME_ERROR_FAILED, NULL, and TRUE.

Referenced by parse_toplevel_element().

Here is the call graph for this function:

◆ meta_theme_draw_frame()

void meta_theme_draw_frame ( MetaTheme *  theme,
GtkStyleContext *  style_gtk,
cairo_t *  cr,
MetaFrameType  type,
MetaFrameFlags  flags,
int  client_width,
int  client_height,
PangoLayout *  title_layout,
int  text_height,
const MetaButtonLayout *  button_layout,
MetaButtonState  button_states[META_BUTTON_TYPE_LAST],
GdkPixbuf *  mini_icon,
GdkPixbuf *  icon 
)

References button_layout, _MetaFrameStyle::layout, meta_frame_layout_calc_geometry(), meta_frame_style_draw_with_style(), META_FRAME_TYPE_LAST, NULL, and theme_get_style().

Referenced by meta_frames_paint_to_drawable(), meta_preview_draw(), and run_theme_benchmark().

Here is the call graph for this function:

◆ meta_theme_draw_frame_by_name()

void meta_theme_draw_frame_by_name ( MetaTheme *  theme,
GtkWidget *  widget,
cairo_t *  cr,
const gchar *  style_name,
MetaFrameFlags  flags,
int  client_width,
int  client_height,
PangoLayout *  title_layout,
int  text_height,
const MetaButtonLayout *  button_layout,
MetaButtonState  button_states[META_BUTTON_TYPE_LAST],
GdkPixbuf *  mini_icon,
GdkPixbuf *  icon 
)

References button_layout, _MetaFrameStyle::layout, meta_frame_layout_calc_geometry(), meta_frame_style_draw(), meta_theme_lookup_style(), and NULL.

Here is the call graph for this function:

◆ meta_theme_earliest_version_with_button()

guint meta_theme_earliest_version_with_button ( MetaButtonType  type)

Returns the earliest version of the theme format which required support for a particular button.

(For example, "shade" first appeared in v2, and "close" in v1.)

Parameters
typethe button type
Returns
the number of the theme format

References META_BUTTON_TYPE_ABOVE, META_BUTTON_TYPE_APPMENU, META_BUTTON_TYPE_CLOSE, META_BUTTON_TYPE_LEFT_LEFT_BACKGROUND, META_BUTTON_TYPE_LEFT_MIDDLE_BACKGROUND, META_BUTTON_TYPE_LEFT_RIGHT_BACKGROUND, META_BUTTON_TYPE_LEFT_SINGLE_BACKGROUND, META_BUTTON_TYPE_MAXIMIZE, META_BUTTON_TYPE_MENU, META_BUTTON_TYPE_MINIMIZE, META_BUTTON_TYPE_RIGHT_LEFT_BACKGROUND, META_BUTTON_TYPE_RIGHT_MIDDLE_BACKGROUND, META_BUTTON_TYPE_RIGHT_RIGHT_BACKGROUND, META_BUTTON_TYPE_RIGHT_SINGLE_BACKGROUND, META_BUTTON_TYPE_SHADE, META_BUTTON_TYPE_STICK, META_BUTTON_TYPE_UNABOVE, META_BUTTON_TYPE_UNSHADE, META_BUTTON_TYPE_UNSTICK, and meta_warning().

Referenced by meta_frame_style_validate(), and parse_style_element().

Here is the call graph for this function:

◆ meta_theme_free()

◆ meta_theme_get_current()

◆ meta_theme_get_frame_borders()

void meta_theme_get_frame_borders ( MetaTheme *  theme,
MetaFrameType  type,
int  text_height,
MetaFrameFlags  flags,
MetaFrameBorders *  borders 
)

References _MetaFrameStyle::layout, meta_frame_borders_clear(), meta_frame_layout_get_borders(), META_FRAME_TYPE_LAST, NULL, and theme_get_style().

Referenced by ensure_info(), meta_ui_frame_get_borders(), meta_ui_theme_get_frame_borders(), populate_cache(), run_theme_benchmark(), and subtract_client_area().

Here is the call graph for this function:

◆ meta_theme_get_frame_style()

MetaFrameStyle * meta_theme_get_frame_style ( MetaTheme *  theme,
MetaFrameType  type,
MetaFrameFlags  flags 
)

References META_FRAME_TYPE_LAST, NULL, and theme_get_style().

Referenced by meta_frames_ensure_layout(), and meta_preview_get_clip_region().

Here is the call graph for this function:

◆ meta_theme_get_title_scale()

double meta_theme_get_title_scale ( MetaTheme *  theme,
MetaFrameType  type,
MetaFrameFlags  flags 
)

References _MetaFrameStyle::layout, META_FRAME_TYPE_LAST, NULL, theme_get_style(), and _MetaFrameLayout::title_scale.

Referenced by ensure_info(), and meta_frames_ensure_layout().

Here is the call graph for this function:

◆ meta_theme_insert_draw_op_list()

void meta_theme_insert_draw_op_list ( MetaTheme *  theme,
const char *  name,
MetaDrawOpList *  op_list 
)

References _MetaTheme::draw_op_lists_by_name, and meta_draw_op_list_ref().

Referenced by parse_toplevel_element().

Here is the call graph for this function:

◆ meta_theme_insert_layout()

void meta_theme_insert_layout ( MetaTheme *  theme,
const char *  name,
MetaFrameLayout *  layout 
)

References _MetaTheme::layouts_by_name, and meta_frame_layout_ref().

Referenced by parse_toplevel_element().

Here is the call graph for this function:

◆ meta_theme_insert_style()

void meta_theme_insert_style ( MetaTheme *  theme,
const char *  name,
MetaFrameStyle *  style 
)

References meta_frame_style_ref(), and _MetaTheme::styles_by_name.

Referenced by parse_toplevel_element().

Here is the call graph for this function:

◆ meta_theme_insert_style_set()

void meta_theme_insert_style_set ( MetaTheme *  theme,
const char *  name,
MetaFrameStyleSet *  style_set 
)

References meta_frame_style_set_ref(), and _MetaTheme::style_sets_by_name.

Referenced by parse_toplevel_element().

Here is the call graph for this function:

◆ meta_theme_load_image()

GdkPixbuf * meta_theme_load_image ( MetaTheme *  theme,
const char *  filename,
guint  size_of_theme_icons,
GError **  error 
)

◆ meta_theme_lookup_color_constant()

gboolean meta_theme_lookup_color_constant ( MetaTheme *  theme,
const char *  name,
char **  value 
)

Looks up a colour constant.

Parameters
themethe theme containing the constant
namethe name of the constant
value[out] the string representation of the colour, or NULL if it doesn't exist
Returns
TRUE if it exists, FALSE otherwise

References _MetaTheme::color_constants, FALSE, NULL, and TRUE.

Referenced by parse_color().

◆ meta_theme_lookup_draw_op_list()

MetaDrawOpList * meta_theme_lookup_draw_op_list ( MetaTheme *  theme,
const char *  name 
)

◆ meta_theme_lookup_float_constant()

gboolean meta_theme_lookup_float_constant ( MetaTheme *  theme,
const char *  name,
double *  value 
)

◆ meta_theme_lookup_int_constant()

gboolean meta_theme_lookup_int_constant ( MetaTheme *  theme,
const char *  name,
int *  value 
)

◆ meta_theme_lookup_layout()

MetaFrameLayout * meta_theme_lookup_layout ( MetaTheme *  theme,
const char *  name 
)

◆ meta_theme_lookup_style()

MetaFrameStyle * meta_theme_lookup_style ( MetaTheme *  theme,
const char *  name 
)

◆ meta_theme_lookup_style_set()

MetaFrameStyleSet * meta_theme_lookup_style_set ( MetaTheme *  theme,
const char *  name 
)

◆ meta_theme_new()

◆ meta_theme_replace_constants()

gboolean meta_theme_replace_constants ( MetaTheme *  theme,
PosToken *  tokens,
int  n_tokens,
GError **  err 
)

References PosToken::d, FALSE, PosToken::i, meta_theme_lookup_float_constant(), meta_theme_lookup_int_constant(), PosToken::name, PosToken::name_quark, POS_TOKEN_DOUBLE, POS_TOKEN_INT, POS_TOKEN_VARIABLE, TRUE, PosToken::type, PosToken::v, and PosToken::val.

Referenced by meta_draw_spec_new().

Here is the call graph for this function:

◆ meta_theme_set_current()

void meta_theme_set_current ( const char *  name,
gboolean  force_reload 
)

References _, meta_current_theme, META_DEBUG_THEMES, meta_theme_free(), meta_theme_load(), meta_warning(), _MetaTheme::name, and NULL.

Referenced by meta_ui_set_current_theme().

Here is the call graph for this function:

◆ meta_theme_validate()

gboolean meta_theme_validate ( MetaTheme *  theme,
GError **  error 
)

References _, _MetaTheme::author, _MetaTheme::copyright, _MetaTheme::date, _MetaTheme::description, FALSE, META_FRAME_TYPE_ATTACHED, META_FRAME_TYPE_LAST, meta_frame_type_to_string(), META_THEME_ERROR, META_THEME_ERROR_FAILED, _MetaTheme::name, NULL, _MetaTheme::readable_name, _MetaTheme::style_sets_by_type, and TRUE.

Referenced by end_element_handler().

Here is the call graph for this function:

◆ op_from_string()

static PosOperatorType op_from_string ( const char *  p,
int *  len 
)
static

Parses a string and returns an operation.

Parameters
pa pointer into a string representing an operation; part of an expression somewhere, so not null-terminated
lenset to the length of the string found. Set to 0 if none is.
Returns
the operation found. If none was, returns POS_OP_NONE.

References POS_OP_ADD, POS_OP_DIVIDE, POS_OP_MAX, POS_OP_MIN, POS_OP_MOD, POS_OP_MULTIPLY, POS_OP_NONE, and POS_OP_SUBTRACT.

Referenced by pos_tokenize().

◆ op_name()

static const char * op_name ( PosOperatorType  type)
static

Represents an operation as a string.

Parameters
typean operation, such as addition
Returns
a string, such as "+"

References POS_OP_ADD, POS_OP_DIVIDE, POS_OP_MAX, POS_OP_MIN, POS_OP_MOD, POS_OP_MULTIPLY, POS_OP_NONE, and POS_OP_SUBTRACT.

Referenced by do_operations().

◆ parse_size_unchecked()

static int parse_size_unchecked ( MetaDrawSpec *  spec,
MetaPositionExprEnv *  env 
)
static

References _, meta_parse_size_expression(), meta_warning(), and NULL.

Referenced by meta_draw_op_draw_with_env(), and meta_draw_op_list_draw_with_style().

Here is the call graph for this function:

◆ parse_x_position_unchecked()

static int parse_x_position_unchecked ( MetaDrawSpec *  spec,
const MetaPositionExprEnv *  env 
)
static

References _, meta_parse_position_expression(), meta_warning(), and NULL.

Referenced by meta_draw_op_draw_with_env(), and meta_draw_op_list_draw_with_style().

Here is the call graph for this function:

◆ parse_y_position_unchecked()

static int parse_y_position_unchecked ( MetaDrawSpec *  spec,
const MetaPositionExprEnv *  env 
)
static

References _, meta_parse_position_expression(), meta_warning(), and NULL.

Referenced by meta_draw_op_draw_with_env(), and meta_draw_op_list_draw_with_style().

Here is the call graph for this function:

◆ pixbuf_tile()

static GdkPixbuf * pixbuf_tile ( GdkPixbuf *  tile,
int  width,
int  height 
)
static

Referenced by scale_and_alpha_pixbuf().

◆ rect_for_function()

◆ replicate_cols()

static GdkPixbuf * replicate_cols ( GdkPixbuf *  src,
int  src_x,
int  src_y,
int  width,
int  height 
)
static

Referenced by scale_and_alpha_pixbuf().

◆ replicate_rows()

static GdkPixbuf * replicate_rows ( GdkPixbuf *  src,
int  src_x,
int  src_y,
int  width,
int  height 
)
static

Referenced by scale_and_alpha_pixbuf().

◆ rgb_to_hls()

static void rgb_to_hls ( gdouble *  r,
gdouble *  g,
gdouble *  b 
)
static

Converts a red/green/blue triplet to a hue/lightness/saturation triplet.

Parameters
ron input, red; on output, hue
gon input, green; on output, lightness
bon input, blue; on output, saturation

Referenced by gtk_style_shade().

◆ scale_and_alpha_pixbuf()

static GdkPixbuf * scale_and_alpha_pixbuf ( GdkPixbuf *  src,
MetaAlphaGradientSpec *  alpha_spec,
MetaImageFillType  fill_type,
int  width,
int  height,
gboolean  vertical_stripes,
gboolean  horizontal_stripes 
)
static

References apply_alpha(), META_IMAGE_FILL_TILE, NULL, pixbuf_tile(), replicate_cols(), and replicate_rows().

Referenced by draw_op_as_pixbuf().

Here is the call graph for this function:

◆ scale_surface()

static cairo_surface_t * scale_surface ( cairo_surface_t *  surface,
gdouble  old_width,
gdouble  old_height,
gdouble  new_width,
gdouble  new_height,
gboolean  vertical_stripes,
gboolean  horizontal_stripes 
)
static

Referenced by get_surface_from_pixbuf().

◆ strip_button()

static gboolean strip_button ( MetaButtonSpace *  func_rects[MAX_BUTTONS_PER_CORNER],
GdkRectangle *  bg_rects[MAX_BUTTONS_PER_CORNER],
int *  n_rects,
MetaButtonSpace *  to_strip 
)
static

References FALSE, NULL, and TRUE.

Referenced by meta_frame_layout_calc_geometry().

◆ theme_get_style()

◆ validate_border()

static gboolean validate_border ( const GtkBorder *  border,
const char **  bad 
)
static

References _, and NULL.

Referenced by validate_geometry_border().

◆ validate_geometry_border()

static gboolean validate_geometry_border ( const GtkBorder *  border,
const char *  name,
GError **  error 
)
static

References _, FALSE, META_THEME_ERROR, META_THEME_ERROR_FRAME_GEOMETRY, TRUE, and validate_border().

Here is the call graph for this function:

◆ validate_geometry_value()

static gboolean validate_geometry_value ( int  val,
const char *  name,
GError **  error 
)
static

Ensures that the theme supplied a particular dimension.

When a MetaFrameLayout is created, all its integer fields are set to -1 by meta_frame_layout_new(). After an instance of this type should have been initialised, this function checks that a given field is not still at -1. It is never called directly, but rather via the CHECK_GEOMETRY_VALUE and CHECK_GEOMETRY_BORDER macros.

Parameters
valThe value to check
nameThe name to use in the error message
[out]errorSet to an error if val was not initialised

References _, FALSE, META_THEME_ERROR, META_THEME_ERROR_FRAME_GEOMETRY, and TRUE.

Variable Documentation

◆ meta_current_theme

MetaTheme* meta_current_theme = NULL
static

The current theme.

(Themes are singleton.)

Referenced by fill_env(), meta_theme_get_current(), and meta_theme_set_current().