X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fclearlooks-older%2Fclearlooks_style.c;h=da4720ed56403ff468586746d0209d45182c658d;hb=ed4909bd59a2bc62b589e51c4faef66118071141;hp=29cc30dd9b18d216e6198817c1eff892d54c0c51;hpb=4dc63966f0872efe768dad61eb9b8785d06b92d1;p=ardour.git diff --git a/libs/clearlooks-older/clearlooks_style.c b/libs/clearlooks-older/clearlooks_style.c index 29cc30dd9b..da4720ed56 100644 --- a/libs/clearlooks-older/clearlooks_style.c +++ b/libs/clearlooks-older/clearlooks_style.c @@ -43,7 +43,7 @@ static void cl_progressbar_remove (gpointer data) progressbars = g_list_remove (progressbars, data); g_object_unref (data); - + if (g_list_first(progressbars) == NULL) { g_source_remove(timer_id); timer_id = 0; @@ -58,11 +58,11 @@ static void update_progressbar (gpointer data, gpointer user_data) return; fraction = gtk_progress_bar_get_fraction (GTK_PROGRESS_BAR (data)); - + /* update only if not filled */ if (fraction < 1.0) gtk_widget_queue_resize ((GtkWidget*)data); - + if (fraction >= 1.0 || GTK_PROGRESS (data)->activity_mode) cl_progressbar_remove (data); } @@ -89,7 +89,7 @@ static void cl_progressbar_add (gpointer data) g_object_ref (data); g_signal_connect ((GObject*)data, "unrealize", G_CALLBACK (cl_progressbar_remove), data); - + if (timer_id == 0) timer_id = g_timeout_add (100, timer_func, NULL); } @@ -98,7 +98,7 @@ static GdkColor * clearlooks_get_spot_color (ClearlooksRcStyle *clearlooks_rc) { GtkRcStyle *rc = GTK_RC_STYLE (clearlooks_rc); - + if (clearlooks_rc->has_spot_color) return &clearlooks_rc->spot_color; else @@ -128,12 +128,12 @@ draw_tab (GtkStyle *style, GtkRequisition indicator_size; GtkBorder indicator_spacing; gint arrow_height; - + option_menu_get_props (widget, &indicator_size, &indicator_spacing); - + indicator_size.width += (indicator_size.width % 2) - 1; arrow_height = indicator_size.width / 2 + 2; - + x += (width - indicator_size.width) / 2; y += height/2; @@ -147,11 +147,11 @@ draw_tab (GtkStyle *style, GTK_ARROW_DOWN, 1+x, 1+y+1, indicator_size.width, arrow_height); } - + draw_arrow (window, style->fg_gc[state_type], area, GTK_ARROW_UP, x, y-arrow_height, indicator_size.width, arrow_height); - + draw_arrow (window, style->fg_gc[state_type], area, GTK_ARROW_DOWN, x, y+1, indicator_size.width, arrow_height); @@ -175,9 +175,9 @@ clearlooks_draw_arrow (GtkStyle *style, ClearlooksStyle *clearlooks_style = CLEARLOOKS_STYLE (style); gint original_width, original_x; GdkGC *gc; - + sanitize_size (window, &width, &height); - + if (is_combo_box (widget)) { width = 7; @@ -194,57 +194,57 @@ clearlooks_draw_arrow (GtkStyle *style, GTK_ARROW_DOWN, 1+x, 1+y+1, width, height); } - + draw_arrow (window, style->fg_gc[state], area, GTK_ARROW_UP, x, y-height, width, height); - + draw_arrow (window, style->fg_gc[state], area, GTK_ARROW_DOWN, x, y+1, width, height); - + return; } - + original_width = width; original_x = x; - + /* Make spinbutton arrows and arrows in menus * slightly larger to get the right pixels drawn */ if (DETAIL ("spinbutton")) height += 1; - + if (DETAIL("menuitem")) { width = 6; height = 7; } - + /* Compensate arrow position for "sunken" look */ if (DETAIL ("spinbutton") && arrow_type == GTK_ARROW_DOWN && style->xthickness > 2 && style->ythickness > 2) y -= 1; - + if (widget && widget->parent && GTK_IS_COMBO (widget->parent->parent)) { width -= 2; height -=2; x++; } - + calculate_arrow_geometry (arrow_type, &x, &y, &width, &height); - + if (DETAIL ("menuitem")) x = original_x + original_width - width; - + if (DETAIL ("spinbutton") && (arrow_type == GTK_ARROW_DOWN)) y += 1; - + if (state == GTK_STATE_INSENSITIVE) draw_arrow (window, style->light_gc[state], area, arrow_type, x + 1, y + 1, width, height); gc = style->fg_gc[state]; - + draw_arrow (window, gc, area, arrow_type, x, y, width, height); } @@ -259,7 +259,7 @@ draw_flat_box (DRAW_ARGS) sanitize_size (window, &width, &height); - if (detail && + if (detail && clearlooks_style->listviewitemstyle == 1 && state_type == GTK_STATE_SELECTED && ( !strncmp ("cell_even", detail, strlen ("cell_even")) || @@ -279,7 +279,7 @@ draw_flat_box (DRAW_ARGS) gc = style->base_gc[GTK_STATE_ACTIVE]; upper_color = &style->base[GTK_STATE_ACTIVE]; } - + if (GTK_IS_TREE_VIEW (widget) && 0) { GtkTreeSelection *sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (widget)); @@ -292,12 +292,12 @@ draw_flat_box (DRAW_ARGS) return; } } - + shade (upper_color, &lower_color, 0.8); if (area) gdk_gc_set_clip_rectangle (gc, area); - + draw_hgradient (window, gc, style, x, y, width, height, upper_color, &lower_color); @@ -319,7 +319,7 @@ draw_shadow (DRAW_ARGS) { ClearlooksStyle *clearlooks_style = CLEARLOOKS_STYLE (style); CLRectangle r; - + GdkGC *outer_gc = clearlooks_style->shade_gc[4]; GdkGC *gc1 = NULL; GdkGC *gc2 = NULL; @@ -358,12 +358,12 @@ draw_shadow (DRAW_ARGS) gdk_gc_set_clip_rectangle (clearlooks_style->shade_gc[3], area); gdk_gc_set_clip_rectangle (clearlooks_style->shade_gc[0], area); } - + gdk_draw_line (window, clearlooks_style->shade_gc[3], x, y, x + width, y); gdk_draw_line (window, clearlooks_style->shade_gc[0], x, y + 1, x + width, y + 1); - + if (area) { gdk_gc_set_clip_rectangle (clearlooks_style->shade_gc[3], NULL); @@ -411,7 +411,7 @@ draw_shadow (DRAW_ARGS) { GdkGC *a = clearlooks_style->shade_gc[(shadow_type == GTK_SHADOW_ETCHED_IN) ? 0 : 3]; GdkGC *b = clearlooks_style->shade_gc[(shadow_type == GTK_SHADOW_ETCHED_IN) ? 3 : 0]; - + cl_rectangle_set_corners (&r, CL_CORNER_NONE, CL_CORNER_NONE, CL_CORNER_NONE, CL_CORNER_NONE); @@ -419,17 +419,17 @@ draw_shadow (DRAW_ARGS) cl_rectangle_set_clip_rectangle (&r, area); cl_draw_rectangle (window, widget, style, x+1, y+1, width-1, height-1, &r); cl_rectangle_reset_clip_rectangle (&r); - + r.bordergc = b; cl_rectangle_set_clip_rectangle (&r, area); - cl_draw_rectangle (window, widget, style, x, y, width-1, height-1, &r); + cl_draw_rectangle (window, widget, style, x, y, width-1, height-1, &r); cl_rectangle_reset_clip_rectangle (&r); } else if (shadow_type == GTK_SHADOW_ETCHED_IN) { GdkGC *a = clearlooks_style->shade_gc[(shadow_type == GTK_SHADOW_ETCHED_IN) ? 3 : 0]; GdkGC *b = clearlooks_style->shade_gc[(shadow_type == GTK_SHADOW_ETCHED_IN) ? 0 : 3]; - + cl_rectangle_set_corners (&r, CL_CORNER_NONE, CL_CORNER_NONE, CL_CORNER_NONE, CL_CORNER_NONE); @@ -437,12 +437,12 @@ draw_shadow (DRAW_ARGS) cl_rectangle_set_clip_rectangle (&r, area); cl_draw_rectangle (window, widget, style, x+1, y+1, width-1, height-1, &r); cl_rectangle_reset_clip_rectangle (&r); - + r.bordergc = b; cl_rectangle_set_clip_rectangle (&r, area); - cl_draw_rectangle (window, widget, style, x, y, width-1, height-1, &r); + cl_draw_rectangle (window, widget, style, x, y, width-1, height-1, &r); cl_rectangle_reset_clip_rectangle (&r); - } + } else parent_class->draw_shadow (style, window, state_type, shadow_type, area, widget, detail, @@ -464,7 +464,7 @@ draw_box_gap (DRAW_ARGS, { ClearlooksStyle *clearlooks_style = CLEARLOOKS_STYLE (style); CLRectangle r; - + GdkRegion *area_region = NULL, *gap_region = NULL; GdkRectangle light_rect; @@ -473,10 +473,10 @@ draw_box_gap (DRAW_ARGS, #if DEBUG printf("draw_box_gap: %s %d %d %d %d\n", detail, x, y, width, height); #endif - + g_return_if_fail (GTK_IS_STYLE (style)); g_return_if_fail (window != NULL); - + sanitize_size (window, &width, &height); cl_rectangle_reset (&r, style); @@ -493,7 +493,7 @@ draw_box_gap (DRAW_ARGS, GdkRectangle tmp = { x, y, width, height }; area_region = gdk_region_rectangle (&tmp); } - + switch (gap_side) { case GTK_POS_TOP: @@ -503,7 +503,7 @@ draw_box_gap (DRAW_ARGS, GDK_RECTANGLE_SET (light_rect, x+gap_x+1, y, x+gap_x+1, y+1); GDK_RECTANGLE_SET (dark_rect, x+gap_x+gap_width-2, y, x+gap_x+gap_width-2, y); - + cl_rectangle_set_corners (&r, CL_CORNER_NONE, CL_CORNER_NONE, CL_CORNER_ROUND, CL_CORNER_ROUND); @@ -513,7 +513,7 @@ draw_box_gap (DRAW_ARGS, { GdkRectangle rect = { x+gap_x+1, y+height-2, gap_width-2, 2 }; gap_region = gdk_region_rectangle (&rect); - + GDK_RECTANGLE_SET (light_rect, x+gap_x+1, y+height-2, x+gap_x+1, y+height-1); GDK_RECTANGLE_SET (dark_rect, x+gap_x+gap_width-2, y+height-2, x+gap_x+gap_width-2, y+height-1); @@ -526,37 +526,37 @@ draw_box_gap (DRAW_ARGS, { GdkRectangle rect = { x, y+gap_x+1, 2, gap_width-2 }; gap_region = gdk_region_rectangle (&rect); - + GDK_RECTANGLE_SET (light_rect, x, y+gap_x+1, x+1, y+gap_x+1); GDK_RECTANGLE_SET (dark_rect, x, y+gap_x+gap_width-2, x, y+gap_x+gap_width-2); cl_rectangle_set_corners (&r, CL_CORNER_NONE, CL_CORNER_ROUND, CL_CORNER_NONE, CL_CORNER_ROUND); break; - } + } case GTK_POS_RIGHT: { GdkRectangle rect = { x+width-2, y+gap_x+1, 2, gap_width-2 }; gap_region = gdk_region_rectangle (&rect); - + GDK_RECTANGLE_SET (light_rect, x+width-2, y+gap_x+1, x+width-1, y+gap_x+1); GDK_RECTANGLE_SET (dark_rect, x+width-2, y+gap_x+gap_width-2, x+width-1, y+gap_x+gap_width-2); cl_rectangle_set_corners (&r, CL_CORNER_ROUND, CL_CORNER_NONE, CL_CORNER_ROUND, CL_CORNER_NONE); break; - } + } } - + gdk_region_subtract (area_region, gap_region); - + gdk_gc_set_clip_region (r.bordergc, area_region); gdk_gc_set_clip_region (r.topleft, area_region); gdk_gc_set_clip_region (r.bottomright, area_region); - + gdk_region_destroy (area_region); gdk_region_destroy (gap_region); - + gdk_draw_rectangle (window, style->bg_gc[state_type], TRUE, x, y, width, height); cl_draw_rectangle (window, widget, style, x, y, width, height, &r); @@ -566,12 +566,12 @@ draw_box_gap (DRAW_ARGS, gdk_gc_set_clip_region (r.bordergc, NULL); gdk_gc_set_clip_region (r.topleft, NULL); gdk_gc_set_clip_region (r.bottomright, NULL); - + /* it's a semi hack */ gdk_draw_line (window, style->light_gc[state_type], light_rect.x, light_rect.y, light_rect.width, light_rect.height); - + gdk_draw_line (window, clearlooks_style->shade_gc[1], dark_rect.x, dark_rect.y, dark_rect.width, dark_rect.height); @@ -592,9 +592,9 @@ draw_extension (DRAW_ARGS, GtkPositionType gap_side) g_return_if_fail (GTK_IS_STYLE (style)); g_return_if_fail (window != NULL); - + sanitize_size (window, &width, &height); - + if (DETAIL ("tab")) { GdkRectangle new_area; @@ -603,12 +603,12 @@ draw_extension (DRAW_ARGS, GtkPositionType gap_side) cl_rectangle_set_button (&r, style, state_type, FALSE, FALSE, CL_CORNER_ROUND, CL_CORNER_ROUND, CL_CORNER_ROUND, CL_CORNER_ROUND); - + if (state_type == GTK_STATE_ACTIVE) shade (&style->bg[state_type], &tmp_color, 1.08); else shade (&style->bg[state_type], &tmp_color, 1.05); - + if (area) { new_area = *area; @@ -620,7 +620,7 @@ draw_extension (DRAW_ARGS, GtkPositionType gap_side) new_area.width = width; new_area.height = height; } - + switch (gap_side) { case GTK_POS_BOTTOM: @@ -666,20 +666,20 @@ draw_extension (DRAW_ARGS, GtkPositionType gap_side) &clearlooks_style->border[CL_BORDER_LOWER+my_state_type]); break; } - - r.topleft = style->light_gc[state_type]; + + r.topleft = style->light_gc[state_type]; r.bottomright = (state_type == GTK_STATE_NORMAL) ? clearlooks_style->shade_gc[1] : NULL; cl_rectangle_set_clip_rectangle (&r, &new_area); cl_draw_rectangle (window, widget, style, x, y, width, height, &r); cl_draw_shadow (window, widget, style, x, y, width, height, &r); cl_rectangle_reset_clip_rectangle (&r); - + /* draw the selection stripe */ if (state_type != GTK_STATE_ACTIVE) { cl_rectangle_set_gradient (&r.fill_gradient, NULL, NULL); r.fillgc = clearlooks_style->spot2_gc; - + switch (gap_side) { case GTK_POS_BOTTOM: @@ -717,14 +717,14 @@ draw_extension (DRAW_ARGS, GtkPositionType gap_side) CL_CORNER_ROUND, CL_CORNER_NONE); cl_rectangle_set_gradient (&r.border_gradient, &clearlooks_style->spot3, &clearlooks_style->spot2); r.gradient_type = CL_GRADIENT_HORIZONTAL; - + cl_rectangle_set_clip_rectangle (&r, &new_area); cl_draw_rectangle (window, widget, style, x, y, 3, height, &r); cl_rectangle_reset_clip_rectangle (&r); break; } } - + } else @@ -752,16 +752,16 @@ draw_handle (DRAW_ARGS, GtkOrientation orientation) int i; int n_lines; int offset; - + #if DEBUG printf("draw_handle: %s %d %d %d %d\n", detail, x, y, width, height); #endif g_return_if_fail (GTK_IS_STYLE (style)); g_return_if_fail (window != NULL); - + sanitize_size (window, &width, &height); - + if (state_type == GTK_STATE_PRELIGHT) gtk_style_apply_default_background (style, window, widget && !GTK_WIDGET_NO_WINDOW (widget), @@ -786,10 +786,10 @@ draw_handle (DRAW_ARGS, GtkOrientation orientation) orientation == GTK_ORIENTATION_VERTICAL ) { /* The line in the toolbar */ - + light_gc = style->light_gc[state_type]; dark_gc = clearlooks_style->shade_gc[3]; - + if (area) { gdk_gc_set_clip_rectangle (light_gc, area); @@ -810,14 +810,14 @@ draw_handle (DRAW_ARGS, GtkOrientation orientation) gdk_draw_line (window, clearlooks_style->shade_gc[0], x, y, x + width, y); gdk_draw_line (window, clearlooks_style->shade_gc[3], x, y + height - 1, x + width, y + height - 1); - + if (area) { gdk_gc_set_clip_rectangle (clearlooks_style->shade_gc[0], NULL); gdk_gc_set_clip_rectangle (clearlooks_style->shade_gc[3], NULL); } } - + light_gc = clearlooks_style->shade_gc[0]; dark_gc = clearlooks_style->shade_gc[4]; @@ -825,7 +825,7 @@ draw_handle (DRAW_ARGS, GtkOrientation orientation) rect.y = y + ythick; rect.width = width - (xthick * 2); rect.height = height - (ythick * 2); - + if (area) intersect = gdk_rectangle_intersect (area, &rect, &dest); else @@ -839,19 +839,19 @@ draw_handle (DRAW_ARGS, GtkOrientation orientation) gdk_gc_set_clip_rectangle (light_gc, &dest); gdk_gc_set_clip_rectangle (dark_gc, &dest); - + n_lines = (!strcmp (detail, "paned")) ? 21 : 11; if (orientation == GTK_ORIENTATION_VERTICAL) - { + { h = width - 2 * xthick; h = MAX (3, h - 6); - + xx = x + (width - h) / 2; offset = (height - 2*ythick - 2*n_lines)/2 + 1; if (offset < 0) offset = 0; - + for (i = 0, yy = y + ythick + offset; yy <= (y + height - ythick - 1) && i < n_lines; yy += 2, i++) { gdk_draw_line (window, dark_gc, xx, yy, xx + h, yy); @@ -862,12 +862,12 @@ draw_handle (DRAW_ARGS, GtkOrientation orientation) { h = height - 2 * ythick; h = MAX (3, h - 6); - + yy = y + (height - h) / 2; offset = (width - 2*xthick - 2*n_lines)/2 + 1; if (offset < 0) offset = 0; - + for (i = 0, xx = x + xthick + offset; i < n_lines; xx += 2, i++) { gdk_draw_line (window, dark_gc, xx, yy, xx, yy + h); @@ -891,13 +891,13 @@ draw_box (DRAW_ARGS) #ifdef DEBUG printf("draw_box: %s %d %d %d %d\n", detail, x, y, width, height); #endif - + g_return_if_fail (style != NULL); g_return_if_fail (window != NULL); if (width == -1 || height == -1) false_size = TRUE; - + if ((width == -1) && (height == -1)) gdk_window_get_size (window, &width, &height); else if (width == -1) @@ -909,7 +909,7 @@ draw_box (DRAW_ARGS) if (widget == NULL) return; - + /* listview headers */ if (widget && DETAIL ("button") && widget->parent && (GTK_IS_TREE_VIEW(widget->parent) || @@ -938,7 +938,7 @@ draw_box (DRAW_ARGS) !strcmp (detail, "spinbutton_up") || !strcmp (detail, "spinbutton_down") || !strcmp (detail, "spinbutton"))) - { + { cl_draw_spinbutton (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height); } @@ -955,7 +955,7 @@ draw_box (DRAW_ARGS) r.fill_gradient.to = &clearlooks_style->shade[2]; r.bottomright = clearlooks_style->shade_gc[2]; } - + cl_set_corner_sharpness (detail, widget, &r); if (!strcmp (detail, "spinbutton_up")) @@ -971,24 +971,24 @@ draw_box (DRAW_ARGS) gtk_style_apply_default_background (style, window, FALSE, state_type, area, x, y, width, height); } - - cl_rectangle_set_clip_rectangle (&r, area); + + cl_rectangle_set_clip_rectangle (&r, area); cl_draw_rectangle (window, widget, style, x+1, y+1, width-2, height-2, &r); cl_draw_shadow (window, widget, style, x+1, y+1, width-2, height-2, &r); - cl_rectangle_reset_clip_rectangle (&r); + cl_rectangle_reset_clip_rectangle (&r); } else if (DETAIL ("trough") && GTK_IS_PROGRESS_BAR (widget)) { GdkPoint points[4] = { {x,y}, {x+width-1,y}, {x,y+height-1}, {x+width-1,y+height-1} }; - + gdk_draw_points (window, style->bg_gc[state_type], points, 4); - + r.bordergc = clearlooks_style->shade_gc[5]; r.fillgc = clearlooks_style->shade_gc[2]; - + cl_rectangle_set_corners (&r, CL_CORNER_NARROW, CL_CORNER_NARROW, CL_CORNER_NARROW, CL_CORNER_NARROW); - + cl_rectangle_set_clip_rectangle (&r, area); cl_draw_rectangle (window, widget, style, x, y, width, height, &r); cl_rectangle_reset_clip_rectangle (&r); @@ -1001,11 +1001,11 @@ draw_box (DRAW_ARGS) *shadow = clearlooks_style->shade_gc[4]; GdkColor upper_color = *clearlooks_get_spot_color (CLEARLOOKS_RC_STYLE (style->rc_style)), lower_color; - + GtkAdjustment *adjustment = gtk_range_get_adjustment (GTK_RANGE (widget)); - + GtkOrientation orientation = GTK_RANGE (widget)->orientation; - + gint fill_size = (orientation ? height : width) * (1 / ((adjustment->upper - adjustment->lower) / (adjustment->value - adjustment->lower))); @@ -1020,60 +1020,60 @@ draw_box (DRAW_ARGS) x += (width - SCALE_SIZE) / 2; width = SCALE_SIZE; } - + if (state_type == GTK_STATE_INSENSITIVE) { outer = clearlooks_style->shade_gc[4]; inner = clearlooks_style->shade_gc[2]; shadow = clearlooks_style->shade_gc[3]; } - + cl_rectangle_init (&r, inner, outer, CL_CORNER_NONE, CL_CORNER_NONE, CL_CORNER_NONE, CL_CORNER_NONE ); - + r.topleft = shadow; - - cl_rectangle_set_clip_rectangle (&r, area); + + cl_rectangle_set_clip_rectangle (&r, area); cl_draw_rectangle (window, widget, style, x, y, width, height, &r); cl_draw_shadow (window, widget, style, x, y, width, height, &r); - cl_rectangle_reset_clip_rectangle (&r); + cl_rectangle_reset_clip_rectangle (&r); /* DRAW FILL */ shade (&upper_color, &lower_color, 1.3); - + r.bordergc = clearlooks_style->spot3_gc; r.fillgc = style->bg_gc[state_type]; - + r.gradient_type = (orientation == GTK_ORIENTATION_HORIZONTAL ) ? CL_GRADIENT_VERTICAL : CL_GRADIENT_HORIZONTAL; - + cl_rectangle_set_gradient (&r.fill_gradient, &upper_color, &lower_color); - - cl_rectangle_set_clip_rectangle (&r, area); + + cl_rectangle_set_clip_rectangle (&r, area); if (orientation == GTK_ORIENTATION_HORIZONTAL && fill_size > 1) { if (gtk_range_get_inverted(GTK_RANGE(widget)) != (get_direction(widget) == GTK_TEXT_DIR_RTL)) cl_draw_rectangle (window, widget, style, x+width-fill_size, y, fill_size, height, &r); else - cl_draw_rectangle (window, widget, style, x, y, fill_size, height, &r); + cl_draw_rectangle (window, widget, style, x, y, fill_size, height, &r); } else if (fill_size > 1) { if (gtk_range_get_inverted (GTK_RANGE (widget))) cl_draw_rectangle (window, widget, style, x, y+height-fill_size, width, fill_size, &r); else - cl_draw_rectangle (window, widget, style, x, y, width, fill_size, &r); + cl_draw_rectangle (window, widget, style, x, y, width, fill_size, &r); } - cl_rectangle_reset_clip_rectangle (&r); + cl_rectangle_reset_clip_rectangle (&r); } else if (DETAIL ("trough")) { GdkGC *inner = clearlooks_style->shade_gc[3], - *outer = clearlooks_style->shade_gc[5]; - + *outer = clearlooks_style->shade_gc[5]; + cl_rectangle_init (&r, inner, outer, CL_CORNER_NONE, CL_CORNER_NONE, CL_CORNER_NONE, CL_CORNER_NONE ); - + if (GTK_RANGE (widget)->orientation == GTK_ORIENTATION_VERTICAL) { y+=1; @@ -1084,7 +1084,7 @@ draw_box (DRAW_ARGS) x+=1; width-=2; } - + cl_rectangle_set_clip_rectangle (&r, area); cl_draw_rectangle (window, widget, style, x, y, width, height, &r); cl_rectangle_reset_clip_rectangle (&r); @@ -1114,18 +1114,18 @@ draw_box (DRAW_ARGS) } cl_rectangle_set_button (&r, style, state_type, FALSE, FALSE, 0,0,0,0); - + cl_rectangle_set_gradient (&r.fill_gradient, NULL, NULL); cl_rectangle_set_gradient (&r.fill_gradient, &clearlooks_style->inset_light[state_type], &clearlooks_style->inset_dark[state_type]); - - + + r.gradient_type = horizontal ? CL_GRADIENT_VERTICAL : CL_GRADIENT_HORIZONTAL; - + r.bottomright = clearlooks_style->shade_gc[1]; r.border_gradient.to = r.border_gradient.from; - + if (button_type == CL_SCROLLBUTTON_OTHER) { cl_rectangle_set_corners (&r, CL_CORNER_NONE, CL_CORNER_NONE, @@ -1149,11 +1149,11 @@ draw_box (DRAW_ARGS) cl_rectangle_set_corners (&r, CL_CORNER_NONE, CL_CORNER_NONE, CL_CORNER_ROUND, CL_CORNER_ROUND); } - - cl_rectangle_set_clip_rectangle (&r, area); + + cl_rectangle_set_clip_rectangle (&r, area); cl_draw_rectangle (window, widget, style, x, y, width, height, &r); cl_draw_shadow (window, widget, style, x, y, width, height, &r); - cl_rectangle_reset_clip_rectangle (&r); + cl_rectangle_reset_clip_rectangle (&r); } else if (DETAIL ("slider")) @@ -1161,7 +1161,7 @@ draw_box (DRAW_ARGS) if (DETAIL("slider") && widget && GTK_IS_RANGE (widget)) { GtkAdjustment *adj = GTK_RANGE (widget)->adjustment; - + if (adj->value <= adj->lower && (GTK_RANGE (widget)->has_stepper_a || GTK_RANGE (widget)->has_stepper_b)) { @@ -1185,11 +1185,11 @@ draw_box (DRAW_ARGS) width+=1; } } - + cl_rectangle_set_button (&r, style, state_type, FALSE, GTK_WIDGET_HAS_FOCUS (widget), CL_CORNER_NONE, CL_CORNER_NONE, CL_CORNER_NONE, CL_CORNER_NONE); - + r.gradient_type = GTK_IS_HSCROLLBAR (widget) ? CL_GRADIENT_VERTICAL : CL_GRADIENT_HORIZONTAL; @@ -1198,11 +1198,11 @@ draw_box (DRAW_ARGS) r.bottomright = clearlooks_style->shade_gc[1]; r.border_gradient.to = r.border_gradient.from; - - cl_rectangle_set_clip_rectangle (&r, area); + + cl_rectangle_set_clip_rectangle (&r, area); cl_draw_rectangle (window, widget, style, x, y, width, height, &r); cl_draw_shadow (window, widget, style, x, y, width, height, &r); - cl_rectangle_reset_clip_rectangle (&r); + cl_rectangle_reset_clip_rectangle (&r); } else if (detail && !strcmp (detail, "optionmenu")) /* supporting deprecated */ { @@ -1213,7 +1213,7 @@ draw_box (DRAW_ARGS) if (clearlooks_style->menuitemstyle == 0) { cl_draw_menuitem_flat (window, widget, style, area, state_type, - x, y, width, height, &r); + x, y, width, height, &r); } else if (clearlooks_style->menuitemstyle == 1) { @@ -1230,52 +1230,52 @@ draw_box (DRAW_ARGS) { GdkGC *dark = clearlooks_style->shade_gc[2]; GdkColor upper_color, lower_color; - + /* don't draw sunken menubar on gnome panel IT'S A HACK! HORRIBLE HACK! HIDEOUS HACK! BUT IT WORKS FOR ME(tm)! */ if (widget->parent && strcmp(G_OBJECT_TYPE_NAME (widget->parent), "PanelWidget") == 0) return; - + shade(&style->bg[state_type], &upper_color, 1.0); shade(&style->bg[state_type], &lower_color, 0.95); - + cl_rectangle_set_corners (&r, CL_CORNER_NONE, CL_CORNER_NONE, CL_CORNER_NONE, CL_CORNER_NONE); - + r.fillgc = style->bg_gc[state_type]; r.bordergc = clearlooks_style->shade_gc[2]; r.gradient_type = CL_GRADIENT_VERTICAL; - + cl_rectangle_set_gradient (&r.border_gradient, &clearlooks_style->shade[2], &clearlooks_style->shade[3]); cl_rectangle_set_gradient (&r.fill_gradient, &upper_color, &lower_color); - + /* make vertical and top borders invisible for style 2 */ if (clearlooks_style->menubarstyle == 2) { x--; width+=2; y--; height+=1; } - + cl_rectangle_set_clip_rectangle (&r, area); cl_draw_rectangle (window, widget, style, x, y, width, height, &r); cl_rectangle_reset_clip_rectangle (&r); } else if (DETAIL ("menu") && widget->parent && GDK_IS_WINDOW (widget->parent->window)) - { + { cl_rectangle_set_corners (&r, CL_CORNER_NONE, CL_CORNER_NONE, CL_CORNER_NONE, CL_CORNER_NONE); - + r.bordergc = clearlooks_style->border_gc[CL_BORDER_UPPER]; r.topleft = style->light_gc[state_type]; r.bottomright = clearlooks_style->shade_gc[1]; - + cl_rectangle_set_clip_rectangle (&r, area); cl_draw_rectangle (window, widget, style, x, y, width, height, &r); cl_draw_shadow (window, widget, style, x, y, width, height, &r); - cl_rectangle_reset_clip_rectangle (&r); + cl_rectangle_reset_clip_rectangle (&r); return; } @@ -1285,29 +1285,29 @@ draw_box (DRAW_ARGS) lower_color, prev_foreground; gboolean activity_mode = GTK_PROGRESS (widget)->activity_mode; - + #ifdef HAVE_ANIMATION if (!activity_mode && gtk_progress_bar_get_fraction (widget) != 1.0 && !cl_progressbar_known((gconstpointer)widget)) { cl_progressbar_add ((gpointer)widget); } -#endif +#endif cl_progressbar_fill (window, widget, style, style->black_gc, x, y, width, height, #ifdef HAVE_ANIMATION activity_mode ? 0 : pboffset, #else - 0, + 0, #endif area); - + cl_rectangle_set_corners (&r, CL_CORNER_NONE, CL_CORNER_NONE, CL_CORNER_NONE, CL_CORNER_NONE); - + r.bordergc = clearlooks_style->spot3_gc; r.topleft = clearlooks_style->spot2_gc; - + prev_foreground = cl_gc_set_fg_color_shade (clearlooks_style->spot2_gc, style->colormap, &clearlooks_style->spot2, @@ -1317,7 +1317,7 @@ draw_box (DRAW_ARGS) cl_draw_rectangle (window, widget, style, x, y, width, height, &r); cl_draw_shadow (window, widget, style, x, y, width, height, &r); cl_rectangle_reset_clip_rectangle (&r); - + gdk_gc_set_foreground (clearlooks_style->spot2_gc, &prev_foreground); } @@ -1328,21 +1328,21 @@ draw_box (DRAW_ARGS) gdk_gc_set_clip_rectangle (clearlooks_style->shade_gc[0], area); gdk_gc_set_clip_rectangle (clearlooks_style->shade_gc[3], area); } - + gtk_style_apply_default_background (style, window, widget && !GTK_WIDGET_NO_WINDOW (widget), state_type, area, x, y, width, height); - + /* we only want the borders on horizontal toolbars */ if ( DETAIL ("menubar") || height < 2*width ) { if (!DETAIL ("menubar")) gdk_draw_line (window, clearlooks_style->shade_gc[0], x, y, x + width, y); /* top */ - + gdk_draw_line (window, clearlooks_style->shade_gc[3], x, y + height - 1, x + width, y + height - 1); /* bottom */ } - + if (area) { gdk_gc_set_clip_rectangle (clearlooks_style->shade_gc[0], NULL); @@ -1368,10 +1368,10 @@ ensure_check_pixmaps (GtkStyle *style, ClearlooksRcStyle *clearlooks_rc = CLEARLOOKS_RC_STYLE (style->rc_style); GdkPixbuf *check, *base, *inconsistent, *composite; GdkColor *spot_color = clearlooks_get_spot_color (clearlooks_rc); - + if (clearlooks_style->check_pixmap_nonactive[state] != NULL) return; - + if (state == GTK_STATE_ACTIVE || state == GTK_STATE_SELECTED) { check = generate_bit (check_alpha, &style->text[GTK_STATE_NORMAL], 1.0); inconsistent = generate_bit (check_inconsistent_alpha, &style->text[GTK_STATE_NORMAL], 1.0); @@ -1379,24 +1379,24 @@ ensure_check_pixmaps (GtkStyle *style, check = generate_bit (check_alpha, &style->text[state], 1.0); inconsistent = generate_bit (check_inconsistent_alpha, &style->text[state], 1.0); } - + if (state == GTK_STATE_ACTIVE && !treeview) base = generate_bit (check_base_alpha, &style->bg[state], 1.0); else base = generate_bit (check_base_alpha, &style->base[GTK_STATE_NORMAL], 1.0); - + if (treeview) composite = generate_bit (NULL, &clearlooks_style->shade[6], 1.0); else composite = generate_bit (NULL, &clearlooks_style->shade[5], 1.0); - + gdk_pixbuf_composite (base, composite, 0, 0, RADIO_SIZE, RADIO_SIZE, 0, 0, 1.0, 1.0, GDK_INTERP_NEAREST, 255); clearlooks_style->check_pixmap_nonactive[state] = pixbuf_to_pixmap (style, composite, screen); - + gdk_pixbuf_composite (check, composite, 0, 0, RADIO_SIZE, RADIO_SIZE, 0, 0, 1.0, 1.0, GDK_INTERP_NEAREST, 255); @@ -1457,7 +1457,7 @@ draw_check (DRAW_ARGS) y += (height - CHECK_SIZE)/2; gdk_draw_drawable (window, gc, pixmap, 0, 0, x, y, CHECK_SIZE, CHECK_SIZE); - + if (area) gdk_gc_set_clip_rectangle (gc, NULL); } @@ -1486,7 +1486,7 @@ draw_slider (DRAW_ARGS, GtkOrientation orientation) if ((orientation == GTK_ORIENTATION_VERTICAL && height < 20) || (orientation == GTK_ORIENTATION_HORIZONTAL && width < 20)) return; - + if (detail && strcmp ("slider", detail) == 0) { if (area) @@ -1571,10 +1571,10 @@ ensure_radio_pixmaps (GtkStyle *style, GdkPixbuf *dot, *circle, *outline, *inconsistent, *composite; GdkColor *spot_color = clearlooks_get_spot_color (clearlooks_rc); GdkColor *composite_color; - + if (clearlooks_style->radio_pixmap_nonactive[state] != NULL) return; - + if (state == GTK_STATE_ACTIVE || state == GTK_STATE_SELECTED) { dot = colorize_bit (dot_intensity, dot_alpha, &style->text[GTK_STATE_NORMAL]); inconsistent = generate_bit (inconsistent_alpha, &style->text[GTK_STATE_NORMAL], 1.0); @@ -1582,9 +1582,9 @@ ensure_radio_pixmaps (GtkStyle *style, dot = colorize_bit (dot_intensity, dot_alpha, &style->text[state]); inconsistent = generate_bit (inconsistent_alpha, &style->text[state], 1.0); } - + outline = generate_bit (outline_alpha, &clearlooks_style->shade[5], 1.0); - + if (clearlooks_style->radio_pixmap_mask == NULL) { gdk_pixbuf_render_pixmap_and_mask (outline, @@ -1592,7 +1592,7 @@ ensure_radio_pixmaps (GtkStyle *style, &clearlooks_style->radio_pixmap_mask, 1); } - + if (state == GTK_STATE_ACTIVE) { composite_color = &style->bg[GTK_STATE_PRELIGHT]; @@ -1603,31 +1603,31 @@ ensure_radio_pixmaps (GtkStyle *style, composite_color = &style->bg[state]; circle = generate_bit (circle_alpha, &style->base[GTK_STATE_NORMAL], 1.0); } - + composite = generate_bit (NULL, composite_color, 1.0); - + gdk_pixbuf_composite (outline, composite, 0, 0, RADIO_SIZE, RADIO_SIZE, 0, 0, 1.0, 1.0, GDK_INTERP_NEAREST, 255); - + gdk_pixbuf_composite (circle, composite, 0, 0, RADIO_SIZE, RADIO_SIZE, 0, 0, 1.0, 1.0, GDK_INTERP_NEAREST, 255); - + clearlooks_style->radio_pixmap_nonactive[state] = pixbuf_to_pixmap (style, composite, screen); - + gdk_pixbuf_composite (dot, composite, 0, 0, RADIO_SIZE, RADIO_SIZE, 0, 0, 1.0, 1.0, GDK_INTERP_NEAREST, 255); - + clearlooks_style->radio_pixmap_active[state] = pixbuf_to_pixmap (style, composite, screen); - + g_object_unref (composite); - + composite = generate_bit (NULL, composite_color,1.0); - + gdk_pixbuf_composite (outline, composite, 0, 0, RADIO_SIZE, RADIO_SIZE, 0, 0, 1.0, 1.0, GDK_INTERP_NEAREST, 255); @@ -1637,10 +1637,10 @@ ensure_radio_pixmaps (GtkStyle *style, gdk_pixbuf_composite (inconsistent, composite, 0, 0, RADIO_SIZE, RADIO_SIZE, 0, 0, 1.0, 1.0, GDK_INTERP_NEAREST, 255); - + clearlooks_style->radio_pixmap_inconsistent[state] = pixbuf_to_pixmap (style, composite, screen); - + g_object_unref (composite); g_object_unref (circle); g_object_unref (dot); @@ -1654,42 +1654,42 @@ draw_option (DRAW_ARGS) ClearlooksStyle *clearlooks_style = CLEARLOOKS_STYLE (style); GdkGC *gc = style->base_gc[state_type]; GdkPixmap *pixmap; - + if (DETAIL ("option")) /* Menu item */ { parent_class->draw_option (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height); return; } - + ensure_radio_pixmaps (style, state_type, gtk_widget_get_screen (widget)); - + if (area) gdk_gc_set_clip_rectangle (gc, area); - + if (shadow_type == GTK_SHADOW_IN) pixmap = clearlooks_style->radio_pixmap_active[state_type]; else if (shadow_type == GTK_SHADOW_ETCHED_IN) /* inconsistent */ pixmap = clearlooks_style->radio_pixmap_inconsistent[state_type]; else pixmap = clearlooks_style->radio_pixmap_nonactive[state_type]; - + x += (width - RADIO_SIZE)/2; y += (height - RADIO_SIZE)/2; - + #ifndef GTKOSX gdk_gc_set_clip_mask (gc, clearlooks_style->radio_pixmap_mask); gdk_gc_set_clip_origin (gc, x, y); #endif - + gdk_draw_drawable (window, gc, pixmap, 0, 0, x, y, RADIO_SIZE, RADIO_SIZE); - + #ifndef GTKOSX gdk_gc_set_clip_origin (gc, 0, 0); gdk_gc_set_clip_mask (gc, NULL); #endif - + if (area) gdk_gc_set_clip_rectangle (gc, NULL); } @@ -1714,17 +1714,17 @@ draw_shadow_gap (DRAW_ARGS, g_return_if_fail (GTK_IS_STYLE (style)); g_return_if_fail (window != NULL); - + sanitize_size (window, &width, &height); cl_rectangle_reset (&r, style); cl_rectangle_set_corners (&r, CL_CORNER_NONE, CL_CORNER_NONE, CL_CORNER_NONE, CL_CORNER_NONE); - + if (area) { area_region = gdk_region_rectangle (area); - + switch (gap_side) { case GTK_POS_TOP: @@ -1744,18 +1744,18 @@ draw_shadow_gap (DRAW_ARGS, GdkRectangle rect = { x, y+gap_x, 2, gap_width }; gap_region = gdk_region_rectangle (&rect); break; - } + } case GTK_POS_RIGHT: { GdkRectangle rect = { x+width-2, y+gap_x, 2, gap_width }; gap_region = gdk_region_rectangle (&rect); break; - } + } } - + gdk_region_subtract (area_region, gap_region); } - + if (shadow_type == GTK_SHADOW_ETCHED_IN || shadow_type == GTK_SHADOW_ETCHED_OUT) { @@ -1772,9 +1772,9 @@ draw_shadow_gap (DRAW_ARGS, a = clearlooks_style->shade_gc[3]; b = style->light_gc[state_type]; } - - gdk_gc_set_clip_region (a, area_region); - gdk_gc_set_clip_region (b, area_region); + + gdk_gc_set_clip_region (a, area_region); + gdk_gc_set_clip_region (b, area_region); r.bordergc = a; cl_draw_rectangle (window, widget, style, x+1, y+1, width-1, height-1, &r); @@ -1782,21 +1782,21 @@ draw_shadow_gap (DRAW_ARGS, r.bordergc = b; cl_draw_rectangle (window, widget, style, x, y, width-1, height-1, &r); - gdk_gc_set_clip_region (a, NULL); - gdk_gc_set_clip_region (b, NULL); + gdk_gc_set_clip_region (a, NULL); + gdk_gc_set_clip_region (b, NULL); } else if (shadow_type == GTK_SHADOW_IN || shadow_type == GTK_SHADOW_OUT) { r.topleft = (shadow_type == GTK_SHADOW_OUT) ? style->light_gc[state_type] : clearlooks_style->shade_gc[1]; r.bottomright = (shadow_type == GTK_SHADOW_OUT) ? clearlooks_style->shade_gc[1] : style->light_gc[state_type]; r.bordergc = clearlooks_style->shade_gc[5]; - - gdk_gc_set_clip_region (r.bordergc, area_region); - gdk_gc_set_clip_region (r.topleft, area_region); - gdk_gc_set_clip_region (r.bottomright, area_region); - + + gdk_gc_set_clip_region (r.bordergc, area_region); + gdk_gc_set_clip_region (r.topleft, area_region); + gdk_gc_set_clip_region (r.bottomright, area_region); + cl_draw_rectangle (window, widget, style, x, y, width, height, &r); - + cl_draw_shadow (window, widget, style, x, y, width, height, &r); gdk_gc_set_clip_region (r.bordergc, NULL); @@ -1828,25 +1828,25 @@ draw_hline (GtkStyle *style, g_return_if_fail (GTK_IS_STYLE (style)); g_return_if_fail (window != NULL); - + if (area) gdk_gc_set_clip_rectangle (clearlooks_style->shade_gc[2], area); - + if (detail && !strcmp (detail, "label")) { if (state_type == GTK_STATE_INSENSITIVE) gdk_draw_line (window, style->light_gc[state_type], x1 + 1, y + 1, x2 + 1, y + 1); - + gdk_draw_line (window, style->fg_gc[state_type], x1, y, x2, y); } else { gdk_draw_line (window, clearlooks_style->shade_gc[2], x1, y, x2, y); - + /* if (DETAIL ("menuitem")) */ gdk_draw_line (window, clearlooks_style->shade_gc[0], x1, y+1, x2, y+1); } - + if (area) gdk_gc_set_clip_rectangle (clearlooks_style->shade_gc[2], NULL); } @@ -1873,16 +1873,16 @@ draw_vline (GtkStyle *style, g_return_if_fail (GTK_IS_STYLE (style)); g_return_if_fail (window != NULL); - + thickness_light = style->xthickness / 2; thickness_dark = style->xthickness - thickness_light; - + if (area) gdk_gc_set_clip_rectangle (clearlooks_style->shade_gc[2], area); - + gdk_draw_line (window, clearlooks_style->shade_gc[2], x, y1, x, y2 - 1); gdk_draw_line (window, clearlooks_style->shade_gc[0], x+1, y1, x+1, y2 - 1); - + if (area) gdk_gc_set_clip_rectangle (clearlooks_style->shade_gc[2], NULL); } @@ -1911,38 +1911,38 @@ draw_focus (GtkStyle *style, #if DEBUG printf("draw_focus: %s %d %d %d %d\n", detail, x, y, width, height); #endif - + gc = clearlooks_style->shade_gc[6]; - + if (widget) { gtk_widget_style_get (widget, "focus-line-width", &line_width, "focus-line-pattern", (gchar *)&dash_list, NULL); - + free_dash_list = TRUE; } - + sanitize_size (window, &width, &height); - + if (area) gdk_gc_set_clip_rectangle (gc, area); - + gdk_gc_set_line_attributes (gc, line_width, dash_list[0] ? GDK_LINE_ON_OFF_DASH : GDK_LINE_SOLID, GDK_CAP_BUTT, GDK_JOIN_MITER); - - + + if (detail && !strcmp (detail, "add-mode")) { if (free_dash_list) g_free (dash_list); - + dash_list = "\4\4"; free_dash_list = FALSE; } - + points[0].x = x + line_width / 2; points[0].y = y + line_width / 2; points[1].x = x + width - line_width + line_width / 2; @@ -1952,7 +1952,7 @@ draw_focus (GtkStyle *style, points[3].x = x + line_width / 2; points[3].y = y + height - line_width + line_width / 2; points[4] = points[0]; - + if (!dash_list[0]) { gdk_draw_lines (window, gc, points, 5); @@ -1960,41 +1960,41 @@ draw_focus (GtkStyle *style, else { dash_len = strlen (dash_list); - + if (dash_list[0]) gdk_gc_set_dashes (gc, 0, dash_list, dash_len); - + gdk_draw_lines (window, gc, points, 3); - + points[2].x += 1; - + if (dash_list[0]) { gint dash_pixels = 0; gint i; - + /* Adjust the dash offset for the bottom and left so we * match up at the upper left. */ for (i = 0; i < dash_len; i++) dash_pixels += dash_list[i]; - + if (dash_len % 2 == 1) dash_pixels *= 2; - + gdk_gc_set_dashes (gc, dash_pixels - (width + height - 2 * line_width) % dash_pixels, dash_list, dash_len); } - + gdk_draw_lines (window, gc, points + 2, 3); } - + gdk_gc_set_line_attributes (gc, 0, GDK_LINE_SOLID, GDK_CAP_BUTT, GDK_JOIN_MITER); - + if (area) gdk_gc_set_clip_rectangle (gc, NULL); - + if (free_dash_list) g_free (dash_list); } @@ -2009,14 +2009,14 @@ draw_layout(GtkStyle * style, const gchar * detail, gint x, gint y, PangoLayout * layout) { ClearlooksStyle *clearlooks_style = CLEARLOOKS_STYLE (style); - + g_return_if_fail(GTK_IS_STYLE (style)); g_return_if_fail(window != NULL); parent_class->draw_layout(style, window, state_type, use_text, area, widget, detail, x, y, layout); - + } /**************************************************************************/ @@ -2205,7 +2205,7 @@ draw_resize_grip (GtkStyle *style, xi -= 3; yi -= 3; - + } } break; @@ -2260,7 +2260,7 @@ draw_resize_grip (GtkStyle *style, xi -= 3; yi += 3; - + } } break; @@ -2316,26 +2316,26 @@ clearlooks_style_init_from_rc (GtkStyle * style, double shades[] = {1.065, 0.93, 0.896, 0.85, 0.768, 0.665, 0.4, 0.205}; int i; double contrast; - + parent_class->init_from_rc (style, rc_style); - + contrast = CLEARLOOKS_RC_STYLE (rc_style)->contrast; - + clearlooks_style->sunkenmenubar = CLEARLOOKS_RC_STYLE (rc_style)->sunkenmenubar; clearlooks_style->progressbarstyle = CLEARLOOKS_RC_STYLE (rc_style)->progressbarstyle; clearlooks_style->menubarstyle = CLEARLOOKS_RC_STYLE (rc_style)->menubarstyle; clearlooks_style->menuitemstyle = CLEARLOOKS_RC_STYLE (rc_style)->menuitemstyle; clearlooks_style->listviewitemstyle = CLEARLOOKS_RC_STYLE (rc_style)->listviewitemstyle; - + /* Lighter to darker */ for (i = 0; i < 8; i++) { shade (&style->bg[GTK_STATE_NORMAL], &clearlooks_style->shade[i], (shades[i]-0.7) * contrast + 0.7); } - + spot_color = clearlooks_get_spot_color (CLEARLOOKS_RC_STYLE (rc_style)); - + clearlooks_style->spot_color = *spot_color; shade (&clearlooks_style->spot_color, &clearlooks_style->spot1, 1.42); shade (&clearlooks_style->spot_color, &clearlooks_style->spot2, 1.05); @@ -2352,11 +2352,11 @@ realize_color (GtkStyle * style, GdkColor * color) { GdkGCValues gc_values; - + gdk_colormap_alloc_color (style->colormap, color, FALSE, TRUE); - + gc_values.foreground = *color; - + return gtk_gc_get (style->depth, style->colormap, &gc_values, GDK_GC_FOREGROUND); } @@ -2365,15 +2365,15 @@ clearlooks_style_realize (GtkStyle * style) { ClearlooksStyle *clearlooks_style = CLEARLOOKS_STYLE (style); int i; - + parent_class->realize (style); - + for (i = 0; i < 8; i++) clearlooks_style->shade_gc[i] = realize_color (style, &clearlooks_style->shade[i]); for (i=0; i < CL_BORDER_COUNT; i++) clearlooks_style->border_gc[i] = realize_color (style, &clearlooks_style->border[i]); - + clearlooks_style->spot1_gc = realize_color (style, &clearlooks_style->spot1); clearlooks_style->spot2_gc = realize_color (style, &clearlooks_style->spot2); clearlooks_style->spot3_gc = realize_color (style, &clearlooks_style->spot3); @@ -2390,10 +2390,10 @@ clearlooks_style_realize (GtkStyle * style) shade (&style->bg[i], &clearlooks_style->listview_bg[i], 1.015); gdk_rgb_find_color (style->colormap, &clearlooks_style->listview_bg[i]); - /* CREATE GRADIENT FOR BUTTONS */ + /* CREATE GRADIENT FOR BUTTONS */ shade (&style->bg[i], &clearlooks_style->button_g1[i], 1.055); gdk_rgb_find_color (style->colormap, &clearlooks_style->button_g1[i]); - + shade (&style->bg[i], &clearlooks_style->button_g2[i], 1.005); gdk_rgb_find_color (style->colormap, &clearlooks_style->button_g2[i]); @@ -2411,7 +2411,7 @@ clearlooks_style_unrealize (GtkStyle * style) { ClearlooksStyle *clearlooks_style = CLEARLOOKS_STYLE (style); int i; - + /* We don't free the colors, because we don't know if * gtk_gc_release() actually freed the GC. FIXME - need * a way of ref'ing colors explicitely so GtkGC can @@ -2419,11 +2419,11 @@ clearlooks_style_unrealize (GtkStyle * style) */ for (i=0; i < 8; i++) gtk_gc_release (clearlooks_style->shade_gc[i]); - + gtk_gc_release (clearlooks_style->spot1_gc); gtk_gc_release (clearlooks_style->spot2_gc); gtk_gc_release (clearlooks_style->spot3_gc); - + for (i = 0; i < 5; i++) { if (clearlooks_style->radio_pixmap_nonactive[i] != NULL) @@ -2435,7 +2435,7 @@ clearlooks_style_unrealize (GtkStyle * style) g_object_unref (clearlooks_style->radio_pixmap_inconsistent[i]); clearlooks_style->radio_pixmap_inconsistent[i] = NULL; } - + if (clearlooks_style->check_pixmap_nonactive[i] != NULL) { g_object_unref (clearlooks_style->check_pixmap_nonactive[i]); @@ -2446,21 +2446,21 @@ clearlooks_style_unrealize (GtkStyle * style) clearlooks_style->check_pixmap_inconsistent[i] = NULL; } } - + if (clearlooks_style->radio_pixmap_mask != NULL) g_object_unref (clearlooks_style->radio_pixmap_mask); - + clearlooks_style->radio_pixmap_mask = NULL; while (progressbars = g_list_first (progressbars)) cl_progressbar_remove (progressbars->data); - + if (timer_id != 0) { g_source_remove(timer_id); - timer_id = 0; + timer_id = 0; } - + parent_class->unrealize (style); } @@ -2529,16 +2529,16 @@ render_icon (GtkStyle *style, GdkPixbuf *base_pixbuf; GdkScreen *screen; GtkSettings *settings; - + /* Oddly, style can be NULL in this function, because * GtkIconSet can be used without a style and if so * it uses this function. */ - + base_pixbuf = gtk_icon_source_get_pixbuf (source); - + g_return_val_if_fail (base_pixbuf != NULL, NULL); - + if (widget && gtk_widget_has_screen (widget)) { screen = gtk_widget_get_screen (widget); settings = gtk_settings_get_for_screen (screen); @@ -2550,7 +2550,7 @@ render_icon (GtkStyle *style, GTK_NOTE (MULTIHEAD, g_warning ("Using the default screen for gtk_default_render_icon()")); } - + if (size != (GtkIconSize) -1 && !gtk_icon_size_lookup_for_settings (settings, size, &width, &height)) { g_warning (G_STRLOC ": invalid icon size '%d'", size); @@ -2564,7 +2564,7 @@ render_icon (GtkStyle *style, scaled = scale_or_ref (base_pixbuf, width, height); else scaled = g_object_ref (base_pixbuf); - + /* If the state was wildcarded, then generate a state. */ if (gtk_icon_source_get_state_wildcarded (source)) { if (state == GTK_STATE_INSENSITIVE) { @@ -2581,14 +2581,14 @@ render_icon (GtkStyle *style, #endif gdk_pixbuf_saturate_and_pixelate (stated, stated, 0.1, FALSE); - + g_object_unref (scaled); } else if (state == GTK_STATE_PRELIGHT) { stated = gdk_pixbuf_copy (scaled); - + gdk_pixbuf_saturate_and_pixelate (scaled, stated, 1.2, FALSE); - + g_object_unref (scaled); } else { stated = scaled; @@ -2609,7 +2609,7 @@ static void clearlooks_style_class_init (ClearlooksStyleClass * klass) { GtkStyleClass *style_class = GTK_STYLE_CLASS (klass); - + parent_class = g_type_class_peek_parent (klass); style_class->realize = clearlooks_style_realize; @@ -2630,7 +2630,7 @@ clearlooks_style_class_init (ClearlooksStyleClass * klass) style_class->draw_box_gap = draw_box_gap; style_class->draw_extension = draw_extension; style_class->draw_option = draw_option; - style_class->draw_layout = draw_layout; + style_class->draw_layout = draw_layout; style_class->render_icon = render_icon; style_class->draw_flat_box = draw_flat_box; }