Root/gui_style.h

Source at commit 8a1a3103964533b0d517a29312ddeabdab1d6271 created 4 years 9 months ago.
By Werner Almesberger, inst.c (find_point_vec): correct indentation
1/*
2 * gui_style.h - GUI, style definitions
3 *
4 * Written 2009-2011 by Werner Almesberger
5 * Copyright 2009-2011 by Werner Almesberger
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 */
12
13
14#ifndef GUI_STYLE_H
15#define GUI_STYLE_H
16
17#include <gtk/gtk.h>
18
19#include "inst.h"
20
21
22/* ----- screen distances, etc. -------------------------------------------- */
23
24
25#define CANVAS_CLEARANCE 10
26
27#define ZOOM_STOP_BORDER 50 /* stop zoom if we have at least a 50
28                       pixel border */
29
30#define VEC_ARROW_LEN 10
31#define VEC_ARROW_ANGLE 20
32#define VEC_EYE_R 5
33
34#define PAD_FONT "Sans Bold 24"
35#define PAD_BORDER 2
36
37#define MEAS_FONT "Sans 8"
38#define MEAS_BASELINE_OFFSET 0.1
39#define MEAS_ARROW_LEN 9
40#define MEAS_ARROW_ANGLE 30
41
42#define FRAME_FONT "Sans 8"
43#define FRAME_BASELINE_OFFSET 0.1
44#define FRAME_SHORT_X 100
45#define FRAME_SHORT_Y 20
46#define FRAME_CLEARANCE 5
47#define FRAME_EYE_R1 3
48#define FRAME_EYE_R2 5
49
50#define ITEM_LIST_FONT "Liberation Mono 8"
51//#define ITEM_LIST_FONT "Courier Bold 8"
52
53#define SELECT_R 6 /* pixels within which we select */
54
55#define DRAG_MIN_R 5
56
57#define MIN_FONT_SCALE 0.20 /* don't scale fonts below this */
58
59#define MM_FORMAT_FIXED "%8.3f" /* -NNN.NNN */
60#define MIL_FORMAT_FIXED "%7.1f" /* -NNNN.N */
61#define MM_FORMAT_SHORT "%.4g"
62#define MIL_FORMAT_SHORT "%.4g"
63
64#define DEFAULT_FRAME_AREA_WIDTH 250
65#define DEFAULT_FRAME_AREA_HEIGHT 100
66#define FRAME_AREA_MISC_WIDTH 24 /* pane, scroll bar, slack */
67
68
69/* ----- assorted colors --------------------------------------------------- */
70
71
72#define COLOR_EDIT_ASIS "#ffffff"
73#define COLOR_EDIT_GOOD "#a0ffa0"
74#define COLOR_EDIT_BAD "#ffa0a0"
75
76#define COLOR_EDITING "#ff00ff"
77
78#define COLOR_PART_NAME "#ffa050"
79#define COLOR_PART_NAME_EDITING COLOR_EDITING
80
81#define COLOR_FRAME_UNSELECTED "#c0c0c0"
82#define COLOR_FRAME_SELECTED "#fff0a0"
83#define COLOR_FRAME_EDITING COLOR_EDITING
84
85#define COLOR_VAR_PASSIVE COLOR_FRAME_UNSELECTED
86#define COLOR_VAR_EDITING COLOR_EDITING
87#define COLOR_EXPR_PASSIVE "#f0f0ff"
88#define COLOR_EXPR_EDITING COLOR_EDITING
89#define COLOR_CHOICE_UNSELECTED COLOR_EXPR_PASSIVE
90#define COLOR_CHOICE_SELECTED "#a0a0ff"
91#define COLOR_ROW_UNSELECTED COLOR_CHOICE_UNSELECTED
92#define COLOR_ROW_SELECTED COLOR_CHOICE_SELECTED
93
94#define COLOR_VAR_TABLE_SEP "black"
95
96#define COLOR_TOOL_UNSELECTED "#dcdad5"
97#define COLOR_TOOL_SELECTED "red"
98
99#define COLOR_ITEM_NORMAL "#dcdad5"
100#define COLOR_ITEM_SELECTED COLOR_FRAME_SELECTED
101#define COLOR_ITEM_ERROR "red"
102
103#define COLOR_SELECTOR "white"
104
105
106/* ----- canvas drawing styles --------------------------------------------- */
107
108
109extern GdkGC *gc_bg, *gc_bg_error;
110extern GdkGC *gc_drag;
111extern GdkGC *gc_highlight;
112extern GdkGC *gc_active_frame;
113extern GdkGC *gc_vec[mode_n];
114extern GdkGC *gc_obj[mode_n];
115extern GdkGC *gc_pad[mode_n];
116extern GdkGC *gc_pad_bare[mode_n];
117extern GdkGC *gc_pad_trace[mode_n];
118extern GdkGC *gc_pad_mask[mode_n];
119extern GdkGC *gc_ptext[mode_n];
120extern GdkGC *gc_rim[mode_n];
121extern GdkGC *gc_hole[mode_n];
122extern GdkGC *gc_meas[mode_n];
123extern GdkGC *gc_frame[mode_n];
124
125extern PangoFontDescription *item_list_font;
126
127void gui_setup_style(GdkDrawable *drawable);
128void gui_cleanup_style(void);
129
130#endif /* !GUI_STYLE_H */
131

Archive Download this file

Branches:
master



interactive