[gtk-theme-engine-clearlooks/gtk-style-context: 20/21] Remove unneeded code.
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk-theme-engine-clearlooks/gtk-style-context: 20/21] Remove unneeded code.
- Date: Tue, 16 Nov 2010 12:27:34 +0000 (UTC)
commit 3c1466c740b37a75e599a04cf689bf10c2aa10c8
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Nov 16 01:56:25 2010 +0100
Remove unneeded code.
src/clearlooks_engine.c | 169 ++++++++---------------------------------------
1 files changed, 29 insertions(+), 140 deletions(-)
---
diff --git a/src/clearlooks_engine.c b/src/clearlooks_engine.c
index 267fefb..38104d8 100644
--- a/src/clearlooks_engine.c
+++ b/src/clearlooks_engine.c
@@ -59,38 +59,6 @@
G_DEFINE_DYNAMIC_TYPE (ClearlooksEngine, clearlooks_engine, GTK_TYPE_THEMING_ENGINE)
static void
-clearlooks_set_parameters (GtkThemingEngine *engine,
- GtkStateFlags state,
- WidgetParameters *params)
-{
- params->style_functions = &(CLEARLOOKS_ENGINE_GET_CLASS (engine)->style_functions[CLEARLOOKS_ENGINE (engine)->style]);
-#if 0
- params->style_constants = &(CLEARLOOKS_ENGINE_GET_CLASS (engine)->style_constants[CLEARLOOKS_ENGINE (engine)->style]);
-
- params->active = (state & GTK_STATE_FLAG_ACTIVE) != 0;
- params->prelight = (state & GTK_STATE_FLAG_PRELIGHT) != 0;
- params->disabled = (state & GTK_STATE_FLAG_INSENSITIVE) != 0;
- params->state_type = GTK_STATE_NORMAL;
- params->corners = CR_CORNER_ALL;
- params->ltr = (gtk_theming_engine_get_direction (engine) == GTK_TEXT_DIR_LTR);
- params->focus = !CLEARLOOKS_ENGINE (engine)->disable_focus && (state & GTK_STATE_FLAG_FOCUSED);
- params->is_default = gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_DEFAULT);
- params->enable_shadow = FALSE;
- params->radius = CLEARLOOKS_ENGINE (engine)->radius;
-
- params->xthickness = style->xthickness;
- params->ythickness = style->ythickness;
-
- /* This is used in GtkEntry to fake transparency. The reason to do this
- * is that the entry has it's entire background filled with base[STATE].
- * This is not a very good solution as it will eg. fail if one changes
- * the background color of a notebook. */
- params->parentbg = CLEARLOOKS_STYLE (style)->colors.bg[state_type];
- clearlooks_get_parent_bg (widget, ¶ms->parentbg);
-#endif
-}
-
-static void
clearlooks_engine_render_background (GtkThemingEngine *engine,
cairo_t *cr,
gdouble x,
@@ -1097,7 +1065,7 @@ clearlooks_engine_render_slider (GtkThemingEngine *engine,
scrollbar.has_color = TRUE;
}
- if ((style == CL_STYLE_GLOSSY || style == CL_STYLE_GUMMY) && !scrollbar.has_color) {
+ if ((style == CLEARLOOKS_STYLE_GLOSSY || style == CLEARLOOKS_STYLE_GUMMY) && !scrollbar.has_color) {
CairoColor *bg_color;
gtk_theming_engine_get (engine, state,
@@ -1256,57 +1224,6 @@ clearlooks_engine_render_arrow (GtkThemingEngine *engine,
style_functions->draw_arrow (cr, engine, &arrow, x, y, size, size);
}
-#if 0
-static void
-clearlooks_style_realize (GtkStyle * style)
-{
- ClearlooksStyle *clearlooks_style = CLEARLOOKS_STYLE (style);
- double shades[] = {1.15, 0.95, 0.896, 0.82, 0.7, 0.665, 0.475, 0.45, 0.4};
- CairoColor spot_color;
- CairoColor bg_normal;
- double contrast;
- int i;
-
- GTK_STYLE_CLASS (clearlooks_style_parent_class)->realize (style);
-
- contrast = CLEARLOOKS_RC_STYLE (style->rc_style)->contrast;
-
- /* Lighter to darker */
- ge_gdk_color_to_cairo (&style->bg[GTK_STATE_NORMAL], &bg_normal);
-
- for (i = 0; i < 9; i++)
- {
- ge_shade_color (&bg_normal, (shades[i] < 1.0) ?
- (shades[i]/contrast) : (shades[i]*contrast),
- &clearlooks_style->colors.shade[i]);
- }
-
- ge_gdk_color_to_cairo (&style->bg[GTK_STATE_SELECTED], &spot_color);
-
- /* Andrea Cimitan wants something like the following to handle dark themes.
- * However, these two lines are broken currently, as ge_hsb_from_color expects
- * a CairoColor and not GdkColor
- * ge_hsb_from_color (&style->bg[GTK_STATE_SELECTED], &hue_spot, &saturation_spot, &brightness_spot);
- * ge_hsb_from_color (&style->bg[GTK_STATE_NORMAL], &hue_bg, &saturation_bg, &brightness_bg);
- */
-
- /* Here to place some checks for dark themes.
- * We should use a different shade value for spot[2]. */
-
- ge_shade_color (&spot_color, 1.25, &clearlooks_style->colors.spot[0]);
- ge_shade_color (&spot_color, 1.05, &clearlooks_style->colors.spot[1]);
- ge_shade_color (&spot_color, 0.65, &clearlooks_style->colors.spot[2]);
-
- for (i=0; i<5; i++)
- {
- ge_gdk_color_to_cairo (&style->fg[i], &clearlooks_style->colors.fg[i]);
- ge_gdk_color_to_cairo (&style->bg[i], &clearlooks_style->colors.bg[i]);
- ge_gdk_color_to_cairo (&style->base[i], &clearlooks_style->colors.base[i]);
- ge_gdk_color_to_cairo (&style->text[i], &clearlooks_style->colors.text[i]);
- }
-}
-#endif
-
static void
clearlooks_engine_render_focus (GtkThemingEngine *engine,
cairo_t *cr,
@@ -1600,11 +1517,8 @@ clearlooks_engine_render_layout (GtkThemingEngine *engine,
if (state & GTK_STATE_FLAG_INSENSITIVE)
{
- WidgetParameters params;
CairoColor *color, temp;
- clearlooks_set_parameters (engine, state, ¶ms);
-
gtk_theming_engine_get (engine, state,
"background-color", &color,
NULL);
@@ -1698,8 +1612,34 @@ clearlooks_engine_register_types (GTypeModule *module)
static void
clearlooks_engine_init (ClearlooksEngine *clearlooks_engine)
{
- clearlooks_register_style_classic (&clearlooks_engine->style_functions[CL_STYLE_CLASSIC],
- &clearlooks_engine->style_constants[CL_STYLE_CLASSIC]);
+ clearlooks_register_style_classic (&clearlooks_engine->style_functions[CLEARLOOKS_STYLE_CLASSIC],
+ &clearlooks_engine->style_constants[CLEARLOOKS_STYLE_CLASSIC]);
+
+#if 0
+ clearlooks_register_style_classic (&klass->style_functions[CL_STYLE_CLASSIC],
+ &klass->style_constants[CL_STYLE_CLASSIC]);
+
+ klass->style_functions[CL_STYLE_GLOSSY] = klass->style_functions[CL_STYLE_CLASSIC];
+ klass->style_constants[CL_STYLE_GLOSSY] = klass->style_constants[CL_STYLE_CLASSIC];
+ clearlooks_register_style_glossy (&klass->style_functions[CL_STYLE_GLOSSY],
+ &klass->style_constants[CL_STYLE_GLOSSY]);
+
+ klass->style_functions[CL_STYLE_INVERTED] = klass->style_functions[CL_STYLE_CLASSIC];
+ klass->style_constants[CL_STYLE_INVERTED] = klass->style_constants[CL_STYLE_CLASSIC];
+ clearlooks_register_style_inverted (&klass->style_functions[CL_STYLE_INVERTED],
+ &klass->style_constants[CL_STYLE_INVERTED]);
+
+ klass->style_functions[CL_STYLE_GUMMY] = klass->style_functions[CL_STYLE_CLASSIC];
+ klass->style_constants[CL_STYLE_GUMMY] = klass->style_constants[CL_STYLE_CLASSIC];
+ clearlooks_register_style_gummy (&klass->style_functions[CL_STYLE_GUMMY],
+ &klass->style_constants[CL_STYLE_GUMMY]);
+
+ klass->style_functions[CL_STYLE_GNOME3] = klass->style_functions[CL_STYLE_CLASSIC];
+ klass->style_constants[CL_STYLE_GNOME3] = klass->style_constants[CL_STYLE_CLASSIC];
+ clearlooks_register_style_gnome3 (&klass->style_functions[CL_STYLE_GNOME3],
+ &klass->style_constants[CL_STYLE_GNOME3]);
+
+#endif
}
static void
@@ -1762,57 +1702,6 @@ clearlooks_engine_class_init (ClearlooksEngineClass * klass)
CLEARLOOKS_TYPE_STYLE,
CLEARLOOKS_STYLE_CLASSIC,
0));
-
-#if 0
- GtkStyleClass *style_class = GTK_STYLE_CLASS (klass);
-
- style_class->copy = clearlooks_style_copy;
- style_class->realize = clearlooks_style_realize;
- style_class->unrealize = clearlooks_style_unrealize;
- style_class->init_from_rc = clearlooks_style_init_from_rc;
- style_class->draw_handle = clearlooks_style_draw_handle;
- style_class->draw_slider = clearlooks_style_draw_slider;
- style_class->draw_shadow_gap = clearlooks_style_draw_shadow_gap;
- style_class->draw_focus = clearlooks_style_draw_focus;
- style_class->draw_box = clearlooks_style_draw_box;
- style_class->draw_shadow = clearlooks_style_draw_shadow;
- style_class->draw_box_gap = clearlooks_style_draw_box_gap;
- style_class->draw_extension = clearlooks_style_draw_extension;
- style_class->draw_option = clearlooks_style_draw_option;
- style_class->draw_check = clearlooks_style_draw_check;
- style_class->draw_flat_box = clearlooks_style_draw_flat_box;
- style_class->draw_vline = clearlooks_style_draw_vline;
- style_class->draw_hline = clearlooks_style_draw_hline;
- style_class->draw_resize_grip = clearlooks_style_draw_resize_grip;
- style_class->draw_tab = clearlooks_style_draw_tab;
- style_class->draw_arrow = clearlooks_style_draw_arrow;
- style_class->draw_layout = clearlooks_style_draw_layout;
- style_class->render_icon = clearlooks_style_draw_render_icon;
-
- clearlooks_register_style_classic (&klass->style_functions[CL_STYLE_CLASSIC],
- &klass->style_constants[CL_STYLE_CLASSIC]);
-
- klass->style_functions[CL_STYLE_GLOSSY] = klass->style_functions[CL_STYLE_CLASSIC];
- klass->style_constants[CL_STYLE_GLOSSY] = klass->style_constants[CL_STYLE_CLASSIC];
- clearlooks_register_style_glossy (&klass->style_functions[CL_STYLE_GLOSSY],
- &klass->style_constants[CL_STYLE_GLOSSY]);
-
- klass->style_functions[CL_STYLE_INVERTED] = klass->style_functions[CL_STYLE_CLASSIC];
- klass->style_constants[CL_STYLE_INVERTED] = klass->style_constants[CL_STYLE_CLASSIC];
- clearlooks_register_style_inverted (&klass->style_functions[CL_STYLE_INVERTED],
- &klass->style_constants[CL_STYLE_INVERTED]);
-
- klass->style_functions[CL_STYLE_GUMMY] = klass->style_functions[CL_STYLE_CLASSIC];
- klass->style_constants[CL_STYLE_GUMMY] = klass->style_constants[CL_STYLE_CLASSIC];
- clearlooks_register_style_gummy (&klass->style_functions[CL_STYLE_GUMMY],
- &klass->style_constants[CL_STYLE_GUMMY]);
-
- klass->style_functions[CL_STYLE_GNOME3] = klass->style_functions[CL_STYLE_CLASSIC];
- klass->style_constants[CL_STYLE_GNOME3] = klass->style_constants[CL_STYLE_CLASSIC];
- clearlooks_register_style_gnome3 (&klass->style_functions[CL_STYLE_GNOME3],
- &klass->style_constants[CL_STYLE_GNOME3]);
-
-#endif
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]