Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/gtk/engine/sugar-rc-style.h
blob: be6c8ee3f0dfc245c424286b3dab11ece5f8dea7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*
 * Copyright (C) 2007, Red Hat, Inc.
 * Copyright (C) 2008, Benjamin Berg
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */


#ifndef __SUGAR_RC_STYLE_H
#define __SUGAR_RC_STYLE_H

#include <gtk/gtkrc.h>

typedef struct _SugarRcStyle SugarRcStyle;
typedef struct _SugarRcStyleClass SugarRcStyleClass;

G_GNUC_INTERNAL extern GType sugar_type_rc_style;

/* Bit field for the engine options. */
typedef enum {
    OPTION_LINE_WIDTH       = 1 << 0,
    OPTION_THICK_LINE_WIDTH = 1 << 1,
    OPTION_MAX_RADIUS       = 1 << 2,
    OPTION_SCROLLBAR_BORDER = 1 << 3,
    OPTION_FAKE_PADDING     = 1 << 4,
    OPTION_SUBCELL_SIZE     = 1 << 5,
    OPTION_HINT             = 1 << 6,
    OPTION_LABEL_FG_COLOR   = 1 << 7
} SugarRcStyleOptions;

typedef struct {
    guint8 fg[5];
    guint8 bg[5];
    guint8 base[5];
    guint8 text[5];
} SugarColorMapping;

typedef enum {
    SUGAR_COLOR_ORIGINAL = 0xff,
    SUGAR_COLOR_FG       = 0,
    SUGAR_COLOR_BG       = 1,
} SugarRCColor;
#define SUGAR_COLOR_COUNT 2

#define SUGAR_TYPE_RC_STYLE              sugar_type_rc_style
#define SUGAR_RC_STYLE(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), SUGAR_TYPE_RC_STYLE, SugarRcStyle))
#define SUGAR_RC_STYLE_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), SUGAR_TYPE_RC_STYLE, SugarRcStyleClass))
#define SUGAR_IS_RC_STYLE(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), SUGAR_TYPE_RC_STYLE))
#define SUGAR_IS_RC_STYLE_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), SUGAR_TYPE_RC_STYLE))
#define SUGAR_RC_STYLE_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), SUGAR_TYPE_RC_STYLE, SugarRcStyleClass))

struct _SugarRcStyle {
    GtkRcStyle parent_instance;

    SugarRcStyleOptions flags;

    gchar *hint;
    gdouble line_width;
    gdouble thick_line_width;
    gdouble max_radius;
    gdouble scrollbar_border;
    gdouble fake_padding;
    gdouble subcell_size;

    /* The purpose of this color is to be able to apply a color from
     * a different style at merge time. This cannot be done with symbolic
     * colors. */
    guint color_flags;
    GdkColor colors[SUGAR_COLOR_COUNT];
    SugarColorMapping color_mapping;
};

struct _SugarRcStyleClass {
    GtkRcStyleClass parent_class;
};

G_GNUC_INTERNAL void sugar_rc_style_register_type (GTypeModule *module);

#endif /* __SUGAR_RC_STYLE_H */