gnome-shell/src/st/st-theme-context.h
Owen W. Taylor 276d9a9302 Import stylesheet code from hippo-canvas
Import:

  HippoCanvasTheme      => StTheme
  HippoCanvasThemeImage => StThemeImage
  HippoCanvasStyle      => StThemeNode

StThemeContext is a new class managing the theme for a stage and
global properties like resolution.

test-theme.c is a newly written test program to do verification of the
style matching and property handling rules.

Various changes are made in the import:

 - Comprehensive reindentation
 - guint32 pixels replaced with ClutterColor
 - General pseudo-class support added
 - Old-fashioned (non-bordered) background image support added, though
   with no support for repeat, etc.
 - Bug fixes for problems revealed by test program

https://bugzilla.gnome.org/show_bug.cgi?id=595990
2009-10-01 14:41:18 -04:00

51 lines
2.5 KiB
C

/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
#ifndef __ST_THEME_CONTEXT_H__
#define __ST_THEME_CONTEXT_H__
#include <clutter/clutter.h>
#include <pango/pango.h>
#include "st-theme-node.h"
G_BEGIN_DECLS
/**
* SECTION:StThemeContext
* @short_description: holds global information about a tree of styled objects
*
* #StThemeContext is responsible for managing information global to a tree of styled objects,
* such as the set of stylesheets or the default font. In normal usage, a #StThemeContext
* is bound to a #ClutterStage; a singleton #StThemeContext can be obtained for a #ClutterStage
* by using st_theme_context_get_for_stage().
*/
typedef struct _StThemeContextClass StThemeContextClass;
#define ST_TYPE_THEME_CONTEXT (st_theme_context_get_type ())
#define ST_THEME_CONTEXT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), ST_TYPE_THEME_CONTEXT, StThemeContext))
#define ST_THEME_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ST_TYPE_THEME_CONTEXT, StThemeContextClass))
#define ST_IS_THEME_CONTEXT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), ST_TYPE_THEME_CONTEXT))
#define ST_IS_THEME_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ST_TYPE_THEME_CONTEXT))
#define ST_THEME_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ST_TYPE_THEME_CONTEXT, StThemeContextClass))
GType st_theme_context_get_type (void) G_GNUC_CONST;
StThemeContext *st_theme_context_new (void);
StThemeContext *st_theme_context_get_for_stage (ClutterStage *stage);
void st_theme_context_set_theme (StThemeContext *context,
StTheme *theme);
StTheme * st_theme_context_get_theme (StThemeContext *context);
void st_theme_context_set_resolution (StThemeContext *context,
gdouble resolution);
double st_theme_context_get_resolution (StThemeContext *context);
void st_theme_context_set_font (StThemeContext *context,
const PangoFontDescription *font);
const PangoFontDescription *st_theme_context_get_font (StThemeContext *context);
StThemeNode * st_theme_context_get_root_node (StThemeContext *context);
G_END_DECLS
#endif /* __ST_THEME_CONTEXT_H__ */