Commit f1b91c02 authored by Daiki Ueno's avatar Daiki Ueno
Browse files

Add border style configuration (WIP).

parent cadb0f18
.key {
color: #ffffff;
background-gradient-direction: radial;
background-gradient-direction: vertical;
background-gradient-start: #000000;
background-gradient-end: #232323;
background-gradient-end: #555555;
border-width: 2px;
border-color: #777777;
border-radius: 3px;
}
.key:active {
background-gradient-direction: vertical;
background-gradient-start: #FF0000;
background-gradient-end: #FF0000;
}
.keyboard {
......
This diff is collapsed.
......@@ -80,74 +80,80 @@ struct _EekRendererClass
gpointer pdummy[23];
};
GType eek_renderer_get_type (void) G_GNUC_CONST;
EekRenderer *eek_renderer_new (EekKeyboard *keyboard,
PangoContext *pcontext);
void eek_renderer_set_allocation_size (EekRenderer *renderer,
gdouble width,
gdouble height);
void eek_renderer_get_size (EekRenderer *renderer,
gdouble *width,
gdouble *height);
void eek_renderer_get_key_bounds (EekRenderer *renderer,
EekKey *key,
EekBounds *bounds,
gboolean rotate);
gdouble eek_renderer_get_scale (EekRenderer *renderer);
PangoLayout *eek_renderer_create_pango_layout (EekRenderer *renderer);
void eek_renderer_render_key_label (EekRenderer *renderer,
PangoLayout *layout,
EekKey *key);
void eek_renderer_render_key_outline (EekRenderer *renderer,
cairo_t *cr,
EekKey *key,
gdouble scale,
gboolean rotate);
void eek_renderer_render_key (EekRenderer *renderer,
cairo_t *cr,
EekKey *key,
gdouble scale,
gboolean rotate);
void eek_renderer_render_key_icon (EekRenderer *renderer,
cairo_t *cr,
EekKey *key,
gdouble scale,
gboolean rotate);
void eek_renderer_render_keyboard (EekRenderer *renderer,
cairo_t *cr);
GType eek_renderer_get_type (void) G_GNUC_CONST;
EekRenderer *eek_renderer_new (EekKeyboard *keyboard,
PangoContext *pcontext);
void eek_renderer_set_allocation_size (EekRenderer *renderer,
gdouble width,
gdouble height);
void eek_renderer_get_size (EekRenderer *renderer,
gdouble *width,
gdouble *height);
void eek_renderer_get_key_bounds (EekRenderer *renderer,
EekKey *key,
EekBounds *bounds,
gboolean rotate);
gdouble eek_renderer_get_scale (EekRenderer *renderer);
PangoLayout *eek_renderer_create_pango_layout (EekRenderer *renderer);
void eek_renderer_render_key_label (EekRenderer *renderer,
PangoLayout *layout,
EekKey *key);
void eek_renderer_render_key_outline (EekRenderer *renderer,
cairo_t *cr,
EekKey *key,
gdouble scale,
gboolean rotate);
void eek_renderer_render_key (EekRenderer *renderer,
cairo_t *cr,
EekKey *key,
gdouble scale,
gboolean rotate);
void eek_renderer_render_key_icon (EekRenderer *renderer,
cairo_t *cr,
EekKey *key,
gdouble scale,
gboolean rotate);
void eek_renderer_render_keyboard (EekRenderer *renderer,
cairo_t *cr);
void eek_renderer_set_default_foreground_color
(EekRenderer *renderer,
EekColor *foreground);
(EekRenderer *renderer,
const EekColor *color);
void eek_renderer_set_default_background_color
(EekRenderer *renderer,
EekColor *background);
EekColor *eek_renderer_get_foreground_color (EekRenderer *renderer,
EekElement *element);
EekColor *eek_renderer_get_background_color (EekRenderer *renderer,
EekElement *element);
EekGradient *eek_renderer_get_background_gradient (EekRenderer *renderer,
EekElement *element);
void eek_renderer_set_border_width (EekRenderer *renderer,
gdouble border_width);
EekKey *eek_renderer_find_key_by_position (EekRenderer *renderer,
gdouble x,
gdouble y);
(EekRenderer *renderer,
const EekColor *color);
void eek_renderer_get_foreground_color (EekRenderer *renderer,
EekElement *element,
EekColor *color);
void eek_renderer_get_background_color (EekRenderer *renderer,
EekElement *element,
EekColor *color);
void eek_renderer_get_background_gradient
(EekRenderer *renderer,
EekElement *element,
EekGradientType *type,
EekColor *start,
EekColor *end);
void eek_renderer_set_border_width (EekRenderer *renderer,
gdouble border_width);
EekKey *eek_renderer_find_key_by_position (EekRenderer *renderer,
gdouble x,
gdouble y);
void eek_renderer_apply_transformation_for_key
(EekRenderer *renderer,
cairo_t *cr,
EekKey *key,
gdouble scale,
gboolean rotate);
void eek_renderer_set_theme (EekRenderer *renderer,
EekTheme *theme);
(EekRenderer *renderer,
cairo_t *cr,
EekKey *key,
gdouble scale,
gboolean rotate);
void eek_renderer_set_theme (EekRenderer *renderer,
EekTheme *theme);
G_END_DECLS
#endif /* EEK_RENDERER_H */
This diff is collapsed.
......@@ -43,6 +43,20 @@ G_BEGIN_DECLS
* borders and padding.
*/
typedef enum {
EEK_SIDE_TOP,
EEK_SIDE_RIGHT,
EEK_SIDE_BOTTOM,
EEK_SIDE_LEFT
} EekSide;
typedef enum {
EEK_CORNER_TOPLEFT,
EEK_CORNER_TOPRIGHT,
EEK_CORNER_BOTTOMRIGHT,
EEK_CORNER_BOTTOMLEFT
} EekCorner;
#define EEK_TYPE_THEME_NODE (eek_theme_node_get_type())
#define EEK_THEME_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EEK_TYPE_THEME_NODE, EekThemeNode))
#define EEK_THEME_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EEK_TYPE_THEME_NODE, EekThemeNodeClass))
......@@ -86,9 +100,6 @@ const char *eek_theme_node_get_element_id
(EekThemeNode *node);
const char *eek_theme_node_get_element_class
(EekThemeNode *node);
void eek_theme_node_set_pseudo_class
(EekThemeNode *node,
const gchar *pseudo_class);
const char *eek_theme_node_get_pseudo_class
(EekThemeNode *node);
......@@ -97,20 +108,34 @@ const char *eek_theme_node_get_pseudo_class
* details of the actual CSS rules, which can be complicated, especially
* for fonts
*/
gboolean eek_theme_node_get_color
void eek_theme_node_get_color
(EekThemeNode *node,
const char *property_name,
gboolean inherit,
EekColor **color);
EekColor *color);
/* Specific getters for particular properties: cached
*/
EekColor *eek_theme_node_get_background_color
(EekThemeNode *node);
EekColor *eek_theme_node_get_foreground_color
(EekThemeNode *node);
EekGradient *eek_theme_node_get_background_gradient
(EekThemeNode *node);
void eek_theme_node_get_background_color
(EekThemeNode *node,
EekColor *color);
void eek_theme_node_get_foreground_color
(EekThemeNode *node,
EekColor *color);
void eek_theme_node_get_background_gradient
(EekThemeNode *node,
EekGradientType *type,
EekColor *start,
EekColor *end);
int eek_theme_node_get_border_width
(EekThemeNode *node,
EekSide side);
int eek_theme_node_get_border_radius
(EekThemeNode *node,
EekCorner corner);
void eek_theme_node_get_border_color
(EekThemeNode *node,
EekSide side,
EekColor *color);
G_END_DECLS
......
......@@ -222,45 +222,3 @@ eek_color_new (gdouble red,
return color;
}
GType
eek_gradient_get_type (void)
{
static GType our_type = 0;
if (our_type == 0)
our_type =
g_boxed_type_register_static ("EekGradient",
(GBoxedCopyFunc)eek_gradient_copy,
(GBoxedFreeFunc)eek_gradient_free);
return our_type;
}
EekGradient *
eek_gradient_new (EekGradientType type,
EekColor *start,
EekColor *end)
{
EekGradient *gradient;
gradient = g_slice_new (EekGradient);
gradient->type = type;
gradient->start = eek_color_copy (start);
gradient->end = eek_color_copy (end);
return gradient;
}
EekGradient *
eek_gradient_copy (const EekGradient *gradient)
{
return eek_gradient_new (gradient->type, gradient->start, gradient->end);
}
void
eek_gradient_free (EekGradient *gradient)
{
eek_color_free (gradient->start);
eek_color_free (gradient->end);
g_slice_free (EekGradient, gradient);
}
......@@ -262,21 +262,5 @@ typedef enum {
EEK_GRADIENT_RADIAL
} EekGradientType;
struct _EekGradient
{
EekGradientType type;
EekColor *start;
EekColor *end;
};
typedef struct _EekGradient EekGradient;
GType eek_gradient_get_type (void) G_GNUC_CONST;
EekGradient *eek_gradient_new (EekGradientType type,
EekColor *start,
EekColor *end);
EekGradient *eek_gradient_copy (const EekGradient *gradient);
void eek_gradient_free (EekGradient *gradient);
G_END_DECLS
#endif /* EEK_TYPES_H */
......@@ -189,6 +189,8 @@ on_realize (GtkWidget *widget,
GDK_FUNC_MOVE |
GDK_FUNC_MINIMIZE |
GDK_FUNC_CLOSE);
gtk_window_set_opacity (GTK_WINDOW(context->window), 0.9);
}
#define DEFAULT_THEME (THEMEDIR "/default.css")
......@@ -249,6 +251,7 @@ update_widget (ServerContext *context)
gtk_window_set_title (GTK_WINDOW(context->window), _("Keyboard"));
gtk_window_set_icon_name (GTK_WINDOW(context->window), "eekboard");
gtk_window_set_keep_above (GTK_WINDOW(context->window), TRUE);
gtk_window_set_decorated (GTK_WINDOW(context->window), FALSE);
g_signal_connect (context->window, "realize",
G_CALLBACK(on_realize), context);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment