marco 1.29.1
Window manager
Loading...
Searching...
No Matches
theme-viewer.c File Reference
View source
#include <config.h>
#include <glib/gi18n.h>
#include "util.h"
#include "theme.h"
#include "theme-parser.h"
#include "preview-widget.h"
#include <gtk/gtk.h>
#include <time.h>
#include <stdlib.h>
#include <string.h>
Include dependency graph for theme-viewer.c:

Macros

#define BUTTON_LAYOUT_COMBINATIONS   (MAX_BUTTONS_PER_CORNER + 1 + 1)
 
#define ITERATIONS   100
 

Enumerations

enum  { FONT_SIZE_SMALL , FONT_SIZE_NORMAL , FONT_SIZE_LARGE , FONT_SIZE_LAST }
 

Functions

static void run_theme_benchmark (void)
 
static GtkWidget * create_toolbar (void)
 
static GtkWidget * normal_contents (void)
 
static void update_spacings (GtkWidget *vbox, GtkWidget *action_area)
 
static GtkWidget * dialog_contents (void)
 
static GtkWidget * utility_contents (void)
 
static GtkWidget * menu_contents (void)
 
static void override_background_color (GtkWidget *widget, GdkRGBA *rgba)
 
static GtkWidget * border_only_contents (void)
 
static GtkWidget * get_window_contents (MetaFrameType type, const char **title)
 
static MetaFrameFlags get_window_flags (MetaFrameType type)
 
static void override_font (GtkWidget *widget, const gchar *font)
 
static GtkWidget * preview_collection (int font_size, const PangoFontDescription *base_desc)
 
static void init_layouts (void)
 
static GtkWidget * previews_of_button_layouts (void)
 
static GtkWidget * benchmark_summary (void)
 
int main (int argc, char **argv)
 
static MetaFrameFlags get_flags (GtkWidget *widget)
 
static int get_text_height (GtkWidget *widget)
 
static PangoLayout * create_title_layout (GtkWidget *widget)
 

Variables

static MetaTheme * global_theme = NULL
 
static GtkWidget * previews [META_FRAME_TYPE_LAST *FONT_SIZE_LAST+BUTTON_LAYOUT_COMBINATIONS] = { NULL, }
 
static double milliseconds_to_draw_frame = 0.0
 
static const gchar * xml
 
static GActionEntry theme_viewer_entries []
 
static MetaButtonLayout different_layouts [BUTTON_LAYOUT_COMBINATIONS]
 

Macro Definition Documentation

◆ BUTTON_LAYOUT_COMBINATIONS

#define BUTTON_LAYOUT_COMBINATIONS   (MAX_BUTTONS_PER_CORNER + 1 + 1)

◆ ITERATIONS

#define ITERATIONS   100

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
FONT_SIZE_SMALL 
FONT_SIZE_NORMAL 
FONT_SIZE_LARGE 
FONT_SIZE_LAST 

Function Documentation

◆ benchmark_summary()

static GtkWidget * benchmark_summary ( void  )
static

References _, label, and milliseconds_to_draw_frame.

Referenced by main().

◆ border_only_contents()

static GtkWidget * border_only_contents ( void  )
static

References _, FALSE, and override_background_color().

Referenced by get_window_contents().

Here is the call graph for this function:

◆ create_title_layout()

static PangoLayout * create_title_layout ( GtkWidget *  widget)
static

References _.

Referenced by run_theme_benchmark().

◆ create_toolbar()

static GtkWidget * create_toolbar ( void  )
static

References item, and NULL.

Referenced by normal_contents().

◆ dialog_contents()

static GtkWidget * dialog_contents ( void  )
static

References _, FALSE, label, TRUE, and update_spacings().

Referenced by get_window_contents().

Here is the call graph for this function:

◆ get_flags()

◆ get_text_height()

static int get_text_height ( GtkWidget *  widget)
static

References meta_pango_font_desc_get_text_height(), and NULL.

Referenced by run_theme_benchmark().

Here is the call graph for this function:

◆ get_window_contents()

static GtkWidget * get_window_contents ( MetaFrameType  type,
const char **  title 
)
static

References _, border_only_contents(), dialog_contents(), menu_contents(), META_FRAME_TYPE_ATTACHED, META_FRAME_TYPE_BORDER, META_FRAME_TYPE_DIALOG, META_FRAME_TYPE_LAST, META_FRAME_TYPE_MENU, META_FRAME_TYPE_MODAL_DIALOG, META_FRAME_TYPE_NORMAL, META_FRAME_TYPE_UTILITY, normal_contents(), NULL, and utility_contents().

Referenced by preview_collection().

Here is the call graph for this function:

◆ get_window_flags()

◆ init_layouts()

◆ main()

int main ( int  argc,
char **  argv 
)

References _, benchmark_summary(), FONT_SIZE_LARGE, FONT_SIZE_NORMAL, FONT_SIZE_SMALL, global_theme, meta_set_debugging(), meta_set_verbose(), meta_theme_load(), _MetaTheme::name, NULL, preview_collection(), previews, previews_of_button_layouts(), _MetaTheme::readable_name, run_theme_benchmark(), and TRUE.

Here is the call graph for this function:

◆ menu_contents()

static GtkWidget * menu_contents ( void  )
static

References _, FALSE, and NULL.

Referenced by get_window_contents().

◆ normal_contents()

static GtkWidget * normal_contents ( void  )
static

References create_toolbar(), NULL, TRUE, and xml.

Referenced by get_window_contents().

Here is the call graph for this function:

◆ override_background_color()

static void override_background_color ( GtkWidget *  widget,
GdkRGBA *  rgba 
)
static

◆ override_font()

static void override_font ( GtkWidget *  widget,
const gchar *  font 
)
static

References NULL.

Referenced by preview_collection().

◆ preview_collection()

static GtkWidget * preview_collection ( int  font_size,
const PangoFontDescription *  base_desc 
)
static

◆ previews_of_button_layouts()

static GtkWidget * previews_of_button_layouts ( void  )
static

References _, BUTTON_LAYOUT_COMBINATIONS, different_layouts, FALSE, FONT_SIZE_LAST, global_theme, init_layouts(), META_FRAME_TYPE_LAST, META_PREVIEW, meta_preview_new(), meta_preview_set_button_layout(), meta_preview_set_theme(), meta_preview_set_title(), NULL, override_background_color(), previews, and TRUE.

Referenced by main().

Here is the call graph for this function:

◆ run_theme_benchmark()

◆ update_spacings()

static void update_spacings ( GtkWidget *  vbox,
GtkWidget *  action_area 
)
static

Referenced by dialog_contents().

◆ utility_contents()

static GtkWidget * utility_contents ( void  )
static

References TRUE.

Referenced by get_window_contents().

Variable Documentation

◆ different_layouts

◆ global_theme

◆ milliseconds_to_draw_frame

double milliseconds_to_draw_frame = 0.0
static

◆ previews

◆ theme_viewer_entries

GActionEntry theme_viewer_entries[]
static
Initial value:
=
{
{ "dialog1", NULL, NULL, NULL, NULL, {} },
{ "dialog2", NULL, NULL, NULL, NULL, {} },
{ "utility", NULL, NULL, NULL, NULL, {} },
{ "splashscreen", NULL, NULL, NULL, NULL, {} },
{ "top-dock", NULL, NULL, NULL, NULL, {} },
{ "bottom-dock", NULL, NULL, NULL, NULL, {} },
{ "left-dock", NULL, NULL, NULL, NULL, {} },
{ "right-dock", NULL, NULL, NULL, NULL, {} },
{ "all-docks", NULL, NULL, NULL, NULL, {} },
{ "desktop", NULL, NULL, NULL, NULL, {} },
{ "new", NULL, NULL, NULL, NULL, {} },
{ "open", NULL, NULL, NULL, NULL, {} },
{ "quit", NULL, NULL, NULL, NULL, {} }
}
#define NULL
Definition async-getprop.c:44

Referenced by preview_collection().

◆ xml

const gchar* xml
static

Referenced by normal_contents().