diff options
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/draw-workspace.c | 42 | ||||
-rw-r--r-- | src/ui/draw-workspace.h | 8 | ||||
-rw-r--r-- | src/ui/fixedtip.c | 22 | ||||
-rw-r--r-- | src/ui/fixedtip.h | 8 | ||||
-rw-r--r-- | src/ui/frames.c | 16 | ||||
-rw-r--r-- | src/ui/frames.h | 10 | ||||
-rw-r--r-- | src/ui/gradient.c | 128 | ||||
-rw-r--r-- | src/ui/gradient.h | 6 | ||||
-rw-r--r-- | src/ui/metaaccellabel.c | 8 | ||||
-rw-r--r-- | src/ui/preview-widget.c | 88 | ||||
-rw-r--r-- | src/ui/preview-widget.h | 8 | ||||
-rw-r--r-- | src/ui/resizepopup.c | 48 | ||||
-rw-r--r-- | src/ui/tabpopup.c | 146 | ||||
-rw-r--r-- | src/ui/testgradient.c | 32 | ||||
-rw-r--r-- | src/ui/theme-parser.h | 6 | ||||
-rw-r--r-- | src/ui/theme-viewer.c | 172 | ||||
-rw-r--r-- | src/ui/theme.c | 14 | ||||
-rw-r--r-- | src/ui/theme.h | 48 | ||||
-rw-r--r-- | src/ui/themewidget.c | 40 | ||||
-rw-r--r-- | src/ui/themewidget.h | 6 |
20 files changed, 428 insertions, 428 deletions
diff --git a/src/ui/draw-workspace.c b/src/ui/draw-workspace.c index 2a6e7675..a4ad240e 100644 --- a/src/ui/draw-workspace.c +++ b/src/ui/draw-workspace.c @@ -6,9 +6,9 @@ * libwnck or marco, since it's used in both of them */ -/* +/* * Copyright (C) 2002 Red Hat Inc. - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the @@ -18,7 +18,7 @@ * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA @@ -37,23 +37,23 @@ get_window_rect (const WnckWindowDisplayInfo *win, { double width_ratio, height_ratio; int x, y, width, height; - + width_ratio = (double) workspace_rect->width / (double) screen_width; height_ratio = (double) workspace_rect->height / (double) screen_height; - + x = win->x; y = win->y; width = win->width; height = win->height; - + x *= width_ratio; y *= height_ratio; width *= width_ratio; height *= height_ratio; - + x += workspace_rect->x; y += workspace_rect->y; - + if (width < 3) width = 3; if (height < 3) @@ -90,7 +90,7 @@ draw_window (GtkWidget *widget, #if GTK_CHECK_VERSION(3, 0, 0) cairo_save(cr); - #else + #else cr = gdk_cairo_create (drawable); #endif @@ -116,9 +116,9 @@ draw_window (GtkWidget *widget, icon = win->icon; icon_w = icon_h = 0; - + if (icon) - { + { icon_w = gdk_pixbuf_get_width (icon); icon_h = gdk_pixbuf_get_height (icon); @@ -134,7 +134,7 @@ draw_window (GtkWidget *widget, { icon_w = gdk_pixbuf_get_width (icon); icon_h = gdk_pixbuf_get_height (icon); - + /* Give up. */ if (icon_w > (winrect->width - 2) || icon_h > (winrect->height - 2)) @@ -147,7 +147,7 @@ draw_window (GtkWidget *widget, { icon_x = winrect->x + (winrect->width - icon_w) / 2; icon_y = winrect->y + (winrect->height - icon_h) / 2; - + cairo_save (cr); gdk_cairo_set_source_pixbuf (cr, icon, icon_x, icon_y); cairo_rectangle (cr, icon_x, icon_y, icon_w, icon_h); @@ -155,7 +155,7 @@ draw_window (GtkWidget *widget, cairo_paint (cr); cairo_restore (cr); } - + if (is_active) color = &style->fg[state]; else @@ -170,7 +170,7 @@ draw_window (GtkWidget *widget, winrect->x + 0.5, winrect->y + 0.5, MAX (0, winrect->width - 1), MAX (0, winrect->height - 1)); cairo_stroke (cr); - + #if GTK_CHECK_VERSION(3, 0, 0) cairo_restore(cr); #else @@ -210,7 +210,7 @@ wnck_draw_workspace (GtkWidget *widget, if (is_active) state = GTK_STATE_SELECTED; - else if (workspace_background) + else if (workspace_background) state = GTK_STATE_PRELIGHT; else state = GTK_STATE_NORMAL; @@ -220,7 +220,7 @@ wnck_draw_workspace (GtkWidget *widget, #else cr = gdk_cairo_create (drawable); #endif - + if (workspace_background) { gdk_cairo_set_source_pixbuf (cr, workspace_background, x, y); @@ -236,16 +236,16 @@ wnck_draw_workspace (GtkWidget *widget, #if !GTK_CHECK_VERSION(3, 0, 0) cairo_destroy (cr); #endif - + i = 0; while (i < n_windows) { const WnckWindowDisplayInfo *win = &windows[i]; GdkRectangle winrect; - + get_window_rect (win, screen_width, screen_height, &workspace_rect, &winrect); - + draw_window (widget, #if GTK_CHECK_VERSION(3, 0, 0) cr, @@ -255,7 +255,7 @@ wnck_draw_workspace (GtkWidget *widget, win, &winrect, state); - + ++i; } diff --git a/src/ui/draw-workspace.h b/src/ui/draw-workspace.h index b1dabae3..59a6e6ed 100644 --- a/src/ui/draw-workspace.h +++ b/src/ui/draw-workspace.h @@ -6,9 +6,9 @@ * libwnck or marco, since it's used in both of them */ -/* +/* * Copyright (C) 2002 Red Hat Inc. - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the @@ -18,7 +18,7 @@ * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA @@ -42,7 +42,7 @@ typedef struct int height; guint is_active : 1; - + } WnckWindowDisplayInfo; void wnck_draw_workspace (GtkWidget *widget, diff --git a/src/ui/fixedtip.c b/src/ui/fixedtip.c index b06c9708..6f07c6bb 100644 --- a/src/ui/fixedtip.c +++ b/src/ui/fixedtip.c @@ -2,9 +2,9 @@ /* Marco fixed tooltip routine */ -/* +/* * Copyright (C) 2001 Havoc Pennington - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the @@ -14,7 +14,7 @@ * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA @@ -75,7 +75,7 @@ static gint expose_handler (GtkTooltips *tooltips) { gtk_paint_flat_box (gtk_widget_get_style (tip), gtk_widget_get_window (tip), - GTK_STATE_NORMAL, GTK_SHADOW_OUT, + GTK_STATE_NORMAL, GTK_SHADOW_OUT, NULL, tip, "tooltip", 0, 0, -1, -1); @@ -89,9 +89,9 @@ meta_fixed_tip_show (Display *xdisplay, int screen_number, const char *markup_text) { int w, h; - + if (tip == NULL) - { + { tip = gtk_window_new (GTK_WINDOW_POPUP); gtk_window_set_type_hint (GTK_WINDOW(tip), GDK_WINDOW_TYPE_HINT_TOOLTIP); @@ -109,7 +109,7 @@ meta_fixed_tip_show (Display *xdisplay, int screen_number, screen_right_edge = monitor.x + monitor.width; screen_bottom_edge = monitor.y + monitor.height; } - + gtk_widget_set_app_paintable (tip, TRUE); gtk_window_set_resizable (GTK_WINDOW (tip), FALSE); gtk_widget_set_name (tip, "gtk-tooltips"); @@ -117,7 +117,7 @@ meta_fixed_tip_show (Display *xdisplay, int screen_number, #if GTK_CHECK_VERSION(3, 0, 0) g_signal_connect (tip, "draw", - G_CALLBACK (draw_handler), NULL); + G_CALLBACK (draw_handler), NULL); #else g_signal_connect_swapped (tip, "expose_event", G_CALLBACK (expose_handler), NULL); @@ -127,7 +127,7 @@ meta_fixed_tip_show (Display *xdisplay, int screen_number, gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); gtk_misc_set_alignment (GTK_MISC (label), 0.5, 0.5); gtk_widget_show (label); - + gtk_container_add (GTK_CONTAINER (tip), label); g_signal_connect (tip, "destroy", @@ -135,7 +135,7 @@ meta_fixed_tip_show (Display *xdisplay, int screen_number, } gtk_label_set_markup (GTK_LABEL (label), markup_text); - + gtk_window_get_size (GTK_WINDOW (tip), &w, &h); if (meta_ui_get_direction() == META_UI_DIRECTION_RTL) @@ -143,7 +143,7 @@ meta_fixed_tip_show (Display *xdisplay, int screen_number, if ((root_x + w) > screen_right_edge) root_x -= (root_x + w) - screen_right_edge; - + gtk_window_move (GTK_WINDOW (tip), root_x, root_y); gtk_widget_show (tip); diff --git a/src/ui/fixedtip.h b/src/ui/fixedtip.h index 3c4a6ed8..e3eac8f5 100644 --- a/src/ui/fixedtip.h +++ b/src/ui/fixedtip.h @@ -1,8 +1,8 @@ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ -/* +/* * Copyright (C) 2001 Havoc Pennington - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the @@ -12,7 +12,7 @@ * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA @@ -21,7 +21,7 @@ /** * \file fixedtip.h Marco fixed tooltip routine - * + * * Sometimes we want to display a small floating rectangle with helpful * text near the pointer. For example, if the user holds the mouse over * the maximise button, we can display a tooltip saying "Maximize". diff --git a/src/ui/frames.c b/src/ui/frames.c index c6f7f94e..57b73182 100644 --- a/src/ui/frames.c +++ b/src/ui/frames.c @@ -2232,7 +2232,7 @@ generate_pixmap (MetaFrames *frames, result = gdk_window_create_similar_surface (frame->window, CAIRO_CONTENT_COLOR, rect->width, rect->height); - + cr = cairo_create (result); cairo_translate (cr, -rect->x, -rect->y); @@ -2430,13 +2430,13 @@ cached_pixels_draw (CachedPixels *pixels, { CachedFramePiece *piece; piece = &pixels->piece[i]; - + if (piece->pixmap) { cairo_set_source_surface (cr, piece->pixmap, piece->rect.x, piece->rect.y); cairo_paint (cr); - + region_piece = cairo_region_create_rectangle (&piece->rect); cairo_region_subtract (region, region_piece); cairo_region_destroy (region_piece); @@ -2486,7 +2486,7 @@ subtract_client_area (cairo_region_t *region, MetaUIFrame *frame) MetaFrameType type; cairo_region_t *tmp_region; Display *display; - + display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()); meta_core_get (display, frame->xwindow, @@ -2496,7 +2496,7 @@ subtract_client_area (cairo_region_t *region, MetaUIFrame *frame) META_CORE_GET_CLIENT_HEIGHT, &area.height, META_CORE_GET_END); meta_theme_get_frame_borders (meta_theme_get_current (), - type, frame->text_height, flags, + type, frame->text_height, flags, &area.x, NULL, &area.y, NULL); tmp_region = cairo_region_create_rectangle (&area); @@ -2535,11 +2535,11 @@ meta_frames_draw (GtkWidget *widget, populate_cache (frames, frame); region = cairo_region_create_rectangle (&clip); - + pixels = get_cache (frames, frame); cached_pixels_draw (pixels, cr, region); - + clip_to_screen (region, frame); subtract_client_area (region, frame); @@ -2567,7 +2567,7 @@ meta_frames_draw (GtkWidget *widget, } cairo_region_destroy (region); - + return TRUE; } diff --git a/src/ui/frames.h b/src/ui/frames.h index 8ada07ca..3c4156cb 100644 --- a/src/ui/frames.h +++ b/src/ui/frames.h @@ -2,9 +2,9 @@ /* Marco window frame manager widget */ -/* +/* * Copyright (C) 2001 Havoc Pennington - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the @@ -14,7 +14,7 @@ * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA @@ -86,7 +86,7 @@ struct _MetaUIFrame char *title; /* NULL once we have a layout */ guint expose_delayed : 1; guint shape_applied : 1; - + /* FIXME get rid of this, it can just be in the MetaFrames struct */ MetaFrameControl prelit_control; }; @@ -98,7 +98,7 @@ struct _MetaFrames #else GtkWindow parent_instance; #endif - + GHashTable *text_heights; GHashTable *frames; diff --git a/src/ui/gradient.c b/src/ui/gradient.c index cac22be1..78a5a9eb 100644 --- a/src/ui/gradient.c +++ b/src/ui/gradient.c @@ -2,11 +2,11 @@ /* Marco gradient rendering */ -/* +/* * Copyright (C) 2001 Havoc Pennington, 99% copied from wrlib in * WindowMaker, Copyright (C) 1997-2000 Dan Pascu and Alfredo Kojima * Copyright (C) 2005 Elijah Newren - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the @@ -16,7 +16,7 @@ * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA @@ -74,7 +74,7 @@ blank_pixbuf (int width, int height, gboolean no_padding) if (no_padding) rowstride = width * 3; else - /* Always align rows to 32-bit boundaries */ + /* Always align rows to 32-bit boundaries */ rowstride = 4 * ((3 * width + 3) / 4); buf = g_try_malloc (height * rowstride); @@ -163,7 +163,7 @@ meta_gradient_create_interwoven (int width, const GdkColor colors2[2], int thickness2) { - + int i, j, k, l, ll; long r1, g1, b1, dr1, dg1, db1; long r2, g2, b2, dr2, dg2, db2; @@ -171,14 +171,14 @@ meta_gradient_create_interwoven (int width, unsigned char *ptr; unsigned char *pixels; int rowstride; - + pixbuf = blank_pixbuf (width, height, FALSE); if (pixbuf == NULL) return NULL; - + pixels = gdk_pixbuf_get_pixels (pixbuf); rowstride = gdk_pixbuf_get_rowstride (pixbuf); - + r1 = colors1[0].red<<8; g1 = colors1[0].green<<8; b1 = colors1[0].blue<<8; @@ -198,7 +198,7 @@ meta_gradient_create_interwoven (int width, for (i=0,k=0,l=0,ll=thickness1; i<height; i++) { ptr = pixels + i * rowstride; - + if (k == 0) { ptr[0] = (unsigned char) (r1>>16); @@ -233,7 +233,7 @@ meta_gradient_create_interwoven (int width, r1+=dr1; g1+=dg1; b1+=db1; - + r2+=dr2; g2+=dg2; b2+=db2; @@ -246,20 +246,20 @@ meta_gradient_create_interwoven (int width, *---------------------------------------------------------------------- * meta_gradient_create_horizontal-- * Renders a horizontal linear gradient of the specified size in the - * GdkPixbuf format with a border of the specified type. - * + * GdkPixbuf format with a border of the specified type. + * * Returns: * A 24bit GdkPixbuf with the gradient (no alpha channel). - * + * * Side effects: * None - *---------------------------------------------------------------------- + *---------------------------------------------------------------------- */ static GdkPixbuf* meta_gradient_create_horizontal (int width, int height, const GdkColor *from, const GdkColor *to) -{ +{ int i; long r, g, b, dr, dg, db; GdkPixbuf *pixbuf; @@ -272,22 +272,22 @@ meta_gradient_create_horizontal (int width, int height, pixbuf = blank_pixbuf (width, height, FALSE); if (pixbuf == NULL) return NULL; - + pixels = gdk_pixbuf_get_pixels (pixbuf); ptr = pixels; rowstride = gdk_pixbuf_get_rowstride (pixbuf); - + r0 = (guchar) (from->red / 256.0); g0 = (guchar) (from->green / 256.0); b0 = (guchar) (from->blue / 256.0); rf = (guchar) (to->red / 256.0); gf = (guchar) (to->green / 256.0); - bf = (guchar) (to->blue / 256.0); - + bf = (guchar) (to->blue / 256.0); + r = r0 << 16; g = g0 << 16; b = b0 << 16; - + dr = ((rf-r0)<<16)/(int)width; dg = ((gf-g0)<<16)/(int)width; db = ((bf-b0)<<16)/(int)width; @@ -336,21 +336,21 @@ meta_gradient_create_vertical (int width, int height, int rf, gf, bf; int rowstride; unsigned char *pixels; - + pixbuf = blank_pixbuf (width, height, FALSE); if (pixbuf == NULL) return NULL; - + pixels = gdk_pixbuf_get_pixels (pixbuf); rowstride = gdk_pixbuf_get_rowstride (pixbuf); - + r0 = (guchar) (from->red / 256.0); g0 = (guchar) (from->green / 256.0); b0 = (guchar) (from->blue / 256.0); rf = (guchar) (to->red / 256.0); gf = (guchar) (to->green / 256.0); bf = (guchar) (to->blue / 256.0); - + r = r0<<16; g = g0<<16; b = b0<<16; @@ -362,7 +362,7 @@ meta_gradient_create_vertical (int width, int height, for (i=0; i<height; i++) { ptr = pixels + i * rowstride; - + ptr[0] = (unsigned char)(r>>16); ptr[1] = (unsigned char)(g>>16); ptr[2] = (unsigned char)(b>>16); @@ -405,7 +405,7 @@ meta_gradient_create_diagonal (int width, int height, unsigned char *ptr; unsigned char *pixels; int rowstride; - + if (width == 1) return meta_gradient_create_vertical (width, height, from, to); else if (height == 1) @@ -414,7 +414,7 @@ meta_gradient_create_diagonal (int width, int height, pixbuf = blank_pixbuf (width, height, FALSE); if (pixbuf == NULL) return NULL; - + pixels = gdk_pixbuf_get_pixels (pixbuf); rowstride = gdk_pixbuf_get_rowstride (pixbuf); @@ -452,27 +452,27 @@ meta_gradient_create_multi_horizontal (int width, int height, GdkPixbuf *pixbuf; unsigned char *ptr; unsigned char *pixels; - int width2; + int width2; int rowstride; - + g_return_val_if_fail (count > 2, NULL); pixbuf = blank_pixbuf (width, height, FALSE); if (pixbuf == NULL) return NULL; - + pixels = gdk_pixbuf_get_pixels (pixbuf); rowstride = gdk_pixbuf_get_rowstride (pixbuf); ptr = pixels; - + if (count > width) count = width; - + if (count > 1) width2 = width/(count-1); else width2 = width; - + k = 0; r = colors[0].red << 8; @@ -505,7 +505,7 @@ meta_gradient_create_multi_horizontal (int width, int height, *ptr++ = (unsigned char)(g>>16); *ptr++ = (unsigned char)(b>>16); } - + /* copy the first line to the other lines */ for (i=1; i<height; i++) { @@ -526,25 +526,25 @@ meta_gradient_create_multi_vertical (int width, int height, int height2; int x; int rowstride; - + g_return_val_if_fail (count > 2, NULL); pixbuf = blank_pixbuf (width, height, FALSE); if (pixbuf == NULL) return NULL; - + pixels = gdk_pixbuf_get_pixels (pixbuf); rowstride = gdk_pixbuf_get_rowstride (pixbuf); ptr = pixels; - + if (count > height) count = height; - + if (count > 1) height2 = height/(count-1); else height2 = height; - + k = 0; r = colors[0].red << 8; @@ -568,7 +568,7 @@ meta_gradient_create_multi_vertical (int width, int height, memcpy (&(ptr[x*3]), ptr, (width - x)*3); ptr += rowstride; - + r += dr; g += dg; b += db; @@ -592,14 +592,14 @@ meta_gradient_create_multi_vertical (int width, int height, memcpy (&(ptr[x*3]), ptr, (width - x)*3); ptr += rowstride; - + for (j=k+1; j<height; j++) { memcpy (ptr, tmp, rowstride); ptr += rowstride; } } - + return pixbuf; } @@ -615,7 +615,7 @@ meta_gradient_create_multi_diagonal (int width, int height, unsigned char *ptr; unsigned char *pixels; int rowstride; - + g_return_val_if_fail (count > 2, NULL); if (width == 1) @@ -627,10 +627,10 @@ meta_gradient_create_multi_diagonal (int width, int height, width, height); if (pixbuf == NULL) return NULL; - + pixels = gdk_pixbuf_get_pixels (pixbuf); rowstride = gdk_pixbuf_get_rowstride (pixbuf); - + if (count > width) count = width; if (count > height) @@ -677,12 +677,12 @@ simple_multiply_alpha (GdkPixbuf *pixbuf, int row; g_return_if_fail (GDK_IS_PIXBUF (pixbuf)); - + if (alpha == 255) return; - + g_assert (gdk_pixbuf_get_has_alpha (pixbuf)); - + pixels = gdk_pixbuf_get_pixels (pixbuf); rowstride = gdk_pixbuf_get_rowstride (pixbuf); height = gdk_pixbuf_get_height (pixbuf); @@ -707,7 +707,7 @@ simple_multiply_alpha (GdkPixbuf *pixbuf, */ /* ((*p / 255.0) * (alpha / 255.0)) * 255; */ *p = (guchar) (((int) *p * (int) alpha) / (int) 255); - + ++p; /* skip A */ } @@ -724,13 +724,13 @@ meta_gradient_add_alpha_horizontal (GdkPixbuf *pixbuf, long a, da; unsigned char *p; unsigned char *pixels; - int width2; + int width2; int rowstride; int width, height; unsigned char *gradient; unsigned char *gradient_p; unsigned char *gradient_end; - + g_return_if_fail (n_alphas > 0); if (n_alphas == 1) @@ -739,24 +739,24 @@ meta_gradient_add_alpha_horizontal (GdkPixbuf *pixbuf, simple_multiply_alpha (pixbuf, alphas[0]); return; } - + width = gdk_pixbuf_get_width (pixbuf); height = gdk_pixbuf_get_height (pixbuf); gradient = g_new (unsigned char, width); gradient_end = gradient + width; - + if (n_alphas > width) n_alphas = width; - + if (n_alphas > 1) width2 = width / (n_alphas - 1); else width2 = width; - + a = alphas[0] << 8; gradient_p = gradient; - + /* render the gradient into an array */ for (i = 1; i < n_alphas; i++) { @@ -765,7 +765,7 @@ meta_gradient_add_alpha_horizontal (GdkPixbuf *pixbuf, for (j = 0; j < width2; j++) { *gradient_p++ = (a >> 8); - + a += da; } @@ -777,11 +777,11 @@ meta_gradient_add_alpha_horizontal (GdkPixbuf *pixbuf, { *gradient_p++ = a >> 8; } - + /* Now for each line of the pixbuf, fill in with the gradient */ pixels = gdk_pixbuf_get_pixels (pixbuf); rowstride = gdk_pixbuf_get_rowstride (pixbuf); - + p = pixels; i = 0; while (i < height) @@ -807,7 +807,7 @@ meta_gradient_add_alpha_horizontal (GdkPixbuf *pixbuf, p = row_end; ++i; } - + g_free (gradient); } @@ -820,21 +820,21 @@ meta_gradient_add_alpha (GdkPixbuf *pixbuf, g_return_if_fail (GDK_IS_PIXBUF (pixbuf)); g_return_if_fail (gdk_pixbuf_get_has_alpha (pixbuf)); g_return_if_fail (n_alphas > 0); - + switch (type) { case META_GRADIENT_HORIZONTAL: meta_gradient_add_alpha_horizontal (pixbuf, alphas, n_alphas); break; - + case META_GRADIENT_VERTICAL: g_printerr ("marco: vertical alpha channel gradient not implemented yet\n"); break; - + case META_GRADIENT_DIAGONAL: g_printerr ("marco: diagonal alpha channel gradient not implemented yet\n"); break; - + case META_GRADIENT_LAST: g_assert_not_reached (); break; diff --git a/src/ui/gradient.h b/src/ui/gradient.h index 0cba4a23..b65b3878 100644 --- a/src/ui/gradient.h +++ b/src/ui/gradient.h @@ -2,10 +2,10 @@ /* Marco gradient rendering */ -/* +/* * Copyright (C) 2001 Havoc Pennington, 99% copied from wrlib in * WindowMaker, Copyright (C) 1997-2000 Dan Pascu and Alfredo Kojima - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the @@ -15,7 +15,7 @@ * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA diff --git a/src/ui/metaaccellabel.c b/src/ui/metaaccellabel.c index 829b8a75..3ef870bc 100644 --- a/src/ui/metaaccellabel.c +++ b/src/ui/metaaccellabel.c @@ -362,9 +362,9 @@ meta_accel_label_draw (GtkWidget *widget, cairo_translate (cr, ac_width, 0); if (gtk_label_get_ellipsize (label)) pango_layout_set_width (label_layout, - pango_layout_get_width (label_layout) + pango_layout_get_width (label_layout) - ac_width * PANGO_SCALE); - + allocation.width -= ac_width; gtk_widget_set_allocation (widget, &allocation); if (GTK_WIDGET_CLASS (meta_accel_label_parent_class)->draw) @@ -374,7 +374,7 @@ meta_accel_label_draw (GtkWidget *widget, gtk_widget_set_allocation (widget, &allocation); if (gtk_label_get_ellipsize (label)) pango_layout_set_width (label_layout, - pango_layout_get_width (label_layout) + pango_layout_get_width (label_layout) + ac_width * PANGO_SCALE); cairo_restore (cr); @@ -409,7 +409,7 @@ meta_accel_label_draw (GtkWidget *widget, if (GTK_WIDGET_CLASS (meta_accel_label_parent_class)->draw) GTK_WIDGET_CLASS (meta_accel_label_parent_class)->draw (widget, cr); } - + return FALSE; } diff --git a/src/ui/preview-widget.c b/src/ui/preview-widget.c index 9e592cdc..5b008fa2 100644 --- a/src/ui/preview-widget.c +++ b/src/ui/preview-widget.c @@ -2,9 +2,9 @@ /* Marco theme preview widget */ -/* +/* * Copyright (C) 2002 Havoc Pennington - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the @@ -14,7 +14,7 @@ * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA @@ -122,7 +122,7 @@ static void meta_preview_init (MetaPreview *preview) { int i; - + gtk_widget_set_has_window (GTK_WIDGET (preview), FALSE); i = 0; @@ -132,13 +132,13 @@ meta_preview_init (MetaPreview *preview) preview->button_layout.right_buttons[i] = META_BUTTON_FUNCTION_LAST; ++i; } - + preview->button_layout.left_buttons[0] = META_BUTTON_FUNCTION_MENU; preview->button_layout.right_buttons[0] = META_BUTTON_FUNCTION_MINIMIZE; preview->button_layout.right_buttons[1] = META_BUTTON_FUNCTION_MAXIMIZE; preview->button_layout.right_buttons[2] = META_BUTTON_FUNCTION_CLOSE; - + preview->type = META_FRAME_TYPE_NORMAL; preview->flags = META_FRAME_ALLOWS_DELETE | @@ -150,7 +150,7 @@ meta_preview_init (MetaPreview *preview) META_FRAME_HAS_FOCUS | META_FRAME_ALLOWS_SHADE | META_FRAME_ALLOWS_MOVE; - + preview->left_width = -1; preview->right_width = -1; preview->top_height = -1; @@ -161,13 +161,13 @@ GtkWidget* meta_preview_new (void) { MetaPreview *preview; - + #if GTK_CHECK_VERSION(3, 0, 0) preview = g_object_new (META_TYPE_PREVIEW, NULL); #else preview = gtk_type_new (META_TYPE_PREVIEW); #endif - + return GTK_WIDGET (preview); } @@ -180,7 +180,7 @@ meta_preview_finalize (GObject *object) g_free (preview->title); preview->title = NULL; - + G_OBJECT_CLASS (parent_class)->finalize (object); } @@ -190,7 +190,7 @@ ensure_info (MetaPreview *preview) GtkWidget *widget; widget = GTK_WIDGET (preview); - + if (preview->layout == NULL) { PangoFontDescription *font_desc; @@ -198,34 +198,34 @@ ensure_info (MetaPreview *preview) PangoAttrList *attrs; PangoAttribute *attr; - if (preview->theme) + if (preview->theme) scale = meta_theme_get_title_scale (preview->theme, preview->type, preview->flags); else scale = 1.0; - + preview->layout = gtk_widget_create_pango_layout (widget, preview->title); - + font_desc = meta_gtk_widget_get_font_desc (widget, scale, NULL); - + preview->text_height = meta_pango_font_desc_get_text_height (font_desc, gtk_widget_get_pango_context (widget)); - + attrs = pango_attr_list_new (); - + attr = pango_attr_size_new (pango_font_description_get_size (font_desc)); attr->start_index = 0; attr->end_index = G_MAXINT; - + pango_attr_list_insert (attrs, attr); - + pango_layout_set_attributes (preview->layout, attrs); - - pango_attr_list_unref (attrs); - + + pango_attr_list_unref (attrs); + pango_font_description_free (font_desc); } @@ -341,7 +341,7 @@ meta_preview_draw(GtkWidget *widget, META_BUTTON_STATE_NORMAL, META_BUTTON_STATE_NORMAL }; - + g_return_val_if_fail (META_IS_PREVIEW (widget), FALSE); preview = META_PREVIEW (widget); @@ -351,7 +351,7 @@ meta_preview_draw(GtkWidget *widget, cairo_save (cr); border_width = gtk_container_get_border_width (GTK_CONTAINER (widget)); - + gtk_widget_get_allocation (widget, &allocation); client_width = allocation.width - preview->left_width - preview->right_width - border_width * 2; client_height = allocation.height - preview->top_height - preview->bottom_height - border_width * 2; @@ -359,8 +359,8 @@ meta_preview_draw(GtkWidget *widget, if (client_width < 0) client_width = 1; if (client_height < 0) - client_height = 1; - + client_height = 1; + if (preview->theme) { border_width = gtk_container_get_border_width (GTK_CONTAINER (widget)); @@ -403,7 +403,7 @@ meta_preview_expose (GtkWidget *widget, META_BUTTON_STATE_NORMAL, META_BUTTON_STATE_NORMAL }; - + g_return_val_if_fail (META_IS_PREVIEW (widget), FALSE); g_return_val_if_fail (event != NULL, FALSE); @@ -412,7 +412,7 @@ meta_preview_expose (GtkWidget *widget, ensure_info (preview); border_width = gtk_container_get_border_width (GTK_CONTAINER (widget)); - + gtk_widget_get_allocation (widget, &allocation); client_width = allocation.width - preview->left_width - preview->right_width - border_width * 2; client_height = allocation.height - preview->top_height - preview->bottom_height - border_width * 2; @@ -420,12 +420,12 @@ meta_preview_expose (GtkWidget *widget, if (client_width < 0) client_width = 1; if (client_height < 0) - client_height = 1; - + client_height = 1; + if (preview->theme) { border_width = gtk_container_get_border_width (GTK_CONTAINER (widget)); - + meta_theme_draw_frame (preview->theme, widget, gtk_widget_get_window (widget), @@ -464,7 +464,7 @@ meta_preview_size_request (GtkWidget *widget, req->width = preview->left_width + preview->right_width; req->height = preview->top_height + preview->bottom_height; - + child = gtk_bin_get_child (GTK_BIN (preview)); if (child && gtk_widget_get_visible (child)) @@ -500,11 +500,11 @@ meta_preview_size_allocate (GtkWidget *widget, GtkAllocation child_allocation; #endif GtkWidget *child; - + preview = META_PREVIEW (widget); ensure_info (preview); - + #if GTK_CHECK_VERSION(3, 0, 0) gtk_widget_set_allocation (widget, allocation); #else @@ -512,7 +512,7 @@ meta_preview_size_allocate (GtkWidget *widget, #endif border_width = gtk_container_get_border_width (GTK_CONTAINER (widget)); - + child = gtk_bin_get_child (GTK_BIN (widget)); if (child && gtk_widget_get_visible (child)) @@ -521,13 +521,13 @@ meta_preview_size_allocate (GtkWidget *widget, gtk_widget_get_allocation (widget, &widget_allocation); child_allocation.x = widget_allocation.x + border_width + preview->left_width; child_allocation.y = widget_allocation.y + border_width + preview->top_height; - + child_allocation.width = MAX (1, widget_allocation.width - border_width * 2 - preview->left_width - preview->right_width); child_allocation.height = MAX (1, widget_allocation.height - border_width * 2 - preview->top_height - preview->bottom_height); #else child_allocation.x = allocation->x + border_width + preview->left_width; child_allocation.y = allocation->y + border_width + preview->top_height; - + child_allocation.width = MAX (1, allocation->width - border_width * 2 - preview->left_width - preview->right_width); child_allocation.height = MAX (1, allocation->height - border_width * 2 - preview->top_height - preview->bottom_height); #endif @@ -557,7 +557,7 @@ meta_preview_set_theme (MetaPreview *preview, g_return_if_fail (META_IS_PREVIEW (preview)); preview->theme = theme; - + clear_cache (preview); gtk_widget_queue_resize (GTK_WIDGET (preview)); @@ -571,7 +571,7 @@ meta_preview_set_title (MetaPreview *preview, g_free (preview->title); preview->title = g_strdup (title); - + clear_cache (preview); gtk_widget_queue_resize (GTK_WIDGET (preview)); @@ -608,9 +608,9 @@ meta_preview_set_button_layout (MetaPreview *preview, const MetaButtonLayout *button_layout) { g_return_if_fail (META_IS_PREVIEW (preview)); - - preview->button_layout = *button_layout; - + + preview->button_layout = *button_layout; + gtk_widget_queue_draw (GTK_WIDGET (preview)); } @@ -643,7 +643,7 @@ meta_preview_get_icon (void) g_assert (default_icon); } - + return default_icon; } @@ -676,7 +676,7 @@ meta_preview_get_mini_icon (void) g_assert (default_icon); } - + return default_icon; } diff --git a/src/ui/preview-widget.h b/src/ui/preview-widget.h index c19da7cc..bb5d2893 100644 --- a/src/ui/preview-widget.h +++ b/src/ui/preview-widget.h @@ -2,9 +2,9 @@ /* Marco theme preview widget */ -/* +/* * Copyright (C) 2002 Havoc Pennington - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the @@ -14,7 +14,7 @@ * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA @@ -53,7 +53,7 @@ struct _MetaPreview MetaTheme *theme; char *title; MetaFrameType type; - MetaFrameFlags flags; + MetaFrameFlags flags; PangoLayout *layout; int text_height; diff --git a/src/ui/resizepopup.c b/src/ui/resizepopup.c index 06b8c5af..9f9137b8 100644 --- a/src/ui/resizepopup.c +++ b/src/ui/resizepopup.c @@ -2,9 +2,9 @@ /* Marco resizing-terminal-window feedback */ -/* +/* * Copyright (C) 2001 Havoc Pennington - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the @@ -14,7 +14,7 @@ * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA @@ -36,13 +36,13 @@ struct _MetaResizePopup GtkWidget *size_window; GtkWidget *size_label; Display *display; - int screen_number; + int screen_number; int vertical_size; int horizontal_size; - + gboolean showing; - + MetaRectangle rect; }; @@ -56,7 +56,7 @@ meta_ui_resize_popup_new (Display *display, popup->display = display; popup->screen_number = screen_number; - + return popup; } @@ -64,10 +64,10 @@ void meta_ui_resize_popup_free (MetaResizePopup *popup) { g_return_if_fail (popup != NULL); - + if (popup->size_window) gtk_widget_destroy (popup->size_window); - + g_free (popup); } @@ -75,20 +75,20 @@ static void ensure_size_window (MetaResizePopup *popup) { GtkWidget *frame; - + if (popup->size_window) return; - + popup->size_window = gtk_window_new (GTK_WINDOW_POPUP); gtk_window_set_screen (GTK_WINDOW (popup->size_window), gdk_display_get_screen (gdk_x11_lookup_xdisplay (popup->display), popup->screen_number)); - + /* never shrink the size window */ gtk_window_set_resizable (GTK_WINDOW (popup->size_window), TRUE); - + frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT); @@ -108,9 +108,9 @@ update_size_window (MetaResizePopup *popup) char *str; int x, y; int width, height; - + g_return_if_fail (popup->size_window != NULL); - + /* Translators: This represents the size of a window. The first number is * the width of the window and the second is the height. */ @@ -126,7 +126,7 @@ update_size_window (MetaResizePopup *popup) x = popup->rect.x + (popup->rect.width - width) / 2; y = popup->rect.y + (popup->rect.height - height) / 2; - + if (GTK_WIDGET_REALIZED (popup->size_window)) { /* using move_resize to avoid jumpiness */ @@ -154,7 +154,7 @@ sync_showing (MetaResizePopup *popup) { if (popup->size_window) gtk_widget_show (popup->size_window); - + if (popup->size_window && GTK_WIDGET_REALIZED (popup->size_window)) #if GTK_CHECK_VERSION(3, 0, 0) gdk_window_raise (gtk_widget_get_window(GTK_WIDGET(popup->size_window))); @@ -179,11 +179,11 @@ meta_ui_resize_popup_set (MetaResizePopup *popup, { gboolean need_update_size; int display_w, display_h; - + g_return_if_fail (popup != NULL); need_update_size = FALSE; - + display_w = rect.width - base_width; if (width_inc > 0) display_w /= width_inc; @@ -196,17 +196,17 @@ meta_ui_resize_popup_set (MetaResizePopup *popup, display_w != popup->horizontal_size || display_h != popup->vertical_size) need_update_size = TRUE; - + popup->rect = rect; popup->vertical_size = display_h; popup->horizontal_size = display_w; - + if (need_update_size) { ensure_size_window (popup); update_size_window (popup); } - + sync_showing (popup); } @@ -215,7 +215,7 @@ meta_ui_resize_popup_set_showing (MetaResizePopup *popup, gboolean showing) { g_return_if_fail (popup != NULL); - + if (showing == popup->showing) return; @@ -226,6 +226,6 @@ meta_ui_resize_popup_set_showing (MetaResizePopup *popup, ensure_size_window (popup); update_size_window (popup); } - + sync_showing (popup); } diff --git a/src/ui/tabpopup.c b/src/ui/tabpopup.c index 6cee30cd..fe3f6b9f 100644 --- a/src/ui/tabpopup.c +++ b/src/ui/tabpopup.c @@ -2,11 +2,11 @@ /* Marco popup window thing showing windows you can tab to */ -/* +/* * Copyright (C) 2001 Havoc Pennington * Copyright (C) 2002 Red Hat, Inc. * Copyright (C) 2005 Elijah Newren - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the @@ -16,7 +16,7 @@ * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA @@ -85,11 +85,11 @@ outline_window_expose (GtkWidget *widget, gpointer data) { MetaTabPopup *popup; - TabEntry *te; + TabEntry *te; GtkStyle *style; GdkWindow *window; cairo_t *cr; - + popup = data; if (!popup->outline || popup->current_selected_entry == NULL) @@ -99,7 +99,7 @@ outline_window_expose (GtkWidget *widget, window = gtk_widget_get_window (widget); style = gtk_widget_get_style (widget); cr = gdk_cairo_create (window); - + cairo_set_line_width (cr, 1.0); gdk_cairo_set_source_color (cr, &style->white); @@ -138,7 +138,7 @@ dimm_icon (GdkPixbuf *pixbuf) } w = gdk_pixbuf_get_width (dimmed_pixbuf); - h = gdk_pixbuf_get_height (dimmed_pixbuf); + h = gdk_pixbuf_get_height (dimmed_pixbuf); pixel_stride = 4; @@ -147,24 +147,24 @@ dimm_icon (GdkPixbuf *pixbuf) for (y = 0; y < h; y++) { - pixels = row; - for (x = 0; x < w; x++) + pixels = row; + for (x = 0; x < w; x++) { - pixels[3] /= 2; + pixels[3] /= 2; pixels += pixel_stride; - } + } row += row_stride; } return dimmed_pixbuf; } -static TabEntry* -tab_entry_new (const MetaTabEntry *entry, +static TabEntry* +tab_entry_new (const MetaTabEntry *entry, gint screen_width, gboolean outline) { TabEntry *te; - + te = g_new (TabEntry, 1); te->key = entry->key; te->title = NULL; @@ -185,9 +185,9 @@ tab_entry_new (const MetaTabEntry *entry, g_free (str); str = tmp; - if (entry->demands_attention) - { - /* Escape the whole line of text then markup the text and + if (entry->demands_attention) + { + /* Escape the whole line of text then markup the text and * copy it back into the original buffer. */ tmp = g_strdup_printf ("<b>%s</b>", str); @@ -209,7 +209,7 @@ tab_entry_new (const MetaTabEntry *entry, if (entry->hidden) te->dimmed_icon = dimm_icon (entry->icon); } - + if (outline) { te->rect.x = entry->rect.x; @@ -244,7 +244,7 @@ meta_ui_tab_popup_new (const MetaTabEntry *entries, AtkObject *obj; GdkScreen *screen; int screen_width; - + popup = g_new (MetaTabPopup, 1); popup->outline_window = gtk_window_new (GTK_WINDOW_POPUP); @@ -259,7 +259,7 @@ meta_ui_tab_popup_new (const MetaTabEntry *entries, g_signal_connect (G_OBJECT (popup->outline_window), "expose_event", G_CALLBACK (outline_window_expose), popup); - + popup->window = gtk_window_new (GTK_WINDOW_POPUP); gtk_window_set_screen (GTK_WINDOW (popup->window), @@ -283,7 +283,7 @@ meta_ui_tab_popup_new (const MetaTabEntry *entries, } popup->entries = g_list_reverse (popup->entries); - + g_assert (width > 0); height = i / width; if (i % width) @@ -291,7 +291,7 @@ meta_ui_tab_popup_new (const MetaTabEntry *entries, table = gtk_table_new (height, width, FALSE); vbox = gtk_vbox_new (FALSE, 0); - + frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT); gtk_container_set_border_width (GTK_CONTAINER (table), 1); @@ -326,7 +326,7 @@ meta_ui_tab_popup_new (const MetaTabEntry *entries, tmp = popup->entries; while (tmp && top < height) - { + { left = 0; right = 1; @@ -350,7 +350,7 @@ meta_ui_tab_popup_new (const MetaTabEntry *entries, { image = selectable_image_new (te->dimmed_icon); } - else + else { image = selectable_image_new (te->icon); } @@ -359,7 +359,7 @@ meta_ui_tab_popup_new (const MetaTabEntry *entries, INSIDE_SELECT_RECT + OUTSIDE_SELECT_RECT + 1, INSIDE_SELECT_RECT + OUTSIDE_SELECT_RECT + 1); gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0.5); - } + } else { image = selectable_workspace_new ((MetaWorkspace *) te->key); @@ -378,13 +378,13 @@ meta_ui_tab_popup_new (const MetaTabEntry *entries, te->title); gtk_widget_size_request (popup->label, &req); max_label_width = MAX (max_label_width, req.width); - + tmp = tmp->next; - + ++left; ++right; } - + ++top; ++bottom; } @@ -395,17 +395,17 @@ meta_ui_tab_popup_new (const MetaTabEntry *entries, gtk_label_set_ellipsize (GTK_LABEL (popup->label), PANGO_ELLIPSIZE_END); /* Limit the window size to no bigger than screen_width/4 */ - if (max_label_width>(screen_width/4)) + if (max_label_width>(screen_width/4)) { max_label_width = screen_width/4; } max_label_width += 20; /* add random padding */ - + gtk_window_set_default_size (GTK_WINDOW (popup->window), max_label_width, -1); - + return popup; } @@ -415,7 +415,7 @@ free_tab_entry (gpointer data, gpointer user_data) TabEntry *te; te = data; - + g_free (te->title); if (te->icon) g_object_unref (G_OBJECT (te->icon)); @@ -429,14 +429,14 @@ void meta_ui_tab_popup_free (MetaTabPopup *popup) { meta_verbose ("Destroying tab popup window\n"); - + gtk_widget_destroy (popup->outline_window); gtk_widget_destroy (popup->window); - + g_list_foreach (popup->entries, free_tab_entry, NULL); g_list_free (popup->entries); - + g_free (popup); } @@ -468,7 +468,7 @@ display_entry (MetaTabPopup *popup, GdkRegion *inner_region; GdkWindow *window; - + if (popup->current_selected_entry) { if (popup->outline) @@ -476,7 +476,7 @@ display_entry (MetaTabPopup *popup, else unselect_workspace (popup->current_selected_entry->widget); } - + gtk_label_set_markup (GTK_LABEL (popup->label), te->title); if (popup->outline) @@ -489,7 +489,7 @@ display_entry (MetaTabPopup *popup, /* Do stuff behind gtk's back */ gdk_window_hide (gtk_widget_get_window(popup->outline_window)); meta_core_increment_event_serial (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ())); - + rect = te->rect; rect.x = 0; rect.y = 0; @@ -499,7 +499,7 @@ display_entry (MetaTabPopup *popup, gdk_window_move_resize (window, te->rect.x, te->rect.y, te->rect.width, te->rect.height); - + #if GTK_CHECK_VERSION(3, 0, 0) GdkRGBA black = { 0.0, 0.0, 0.0, 1.0 }; gdk_window_set_background_rgba (window, &black); @@ -507,18 +507,18 @@ display_entry (MetaTabPopup *popup, gdk_window_set_background (window, &popup->outline_window->style->black); #endif - + region = gdk_region_rectangle (&rect); inner_region = gdk_region_rectangle (&te->inner_rect); gdk_region_subtract (region, inner_region); gdk_region_destroy (inner_region); - + gdk_window_shape_combine_region (window, region, 0, 0); gdk_region_destroy (region); - + /* This should piss off gtk a bit, but we don't want to raise * above the tab popup. So, instead of calling gtk_widget_show, * we manually set the window as mapped and then manually map it @@ -544,7 +544,7 @@ meta_ui_tab_popup_forward (MetaTabPopup *popup) if (popup->current == NULL) popup->current = popup->entries; - + if (popup->current != NULL) { TabEntry *te; @@ -563,7 +563,7 @@ meta_ui_tab_popup_backward (MetaTabPopup *popup) if (popup->current == NULL) popup->current = g_list_last (popup->entries); - + if (popup->current != NULL) { TabEntry *te; @@ -598,7 +598,7 @@ meta_ui_tab_popup_select (MetaTabPopup *popup, /* Note, "key" may not be in the list of entries; other code assumes * it's OK to pass in a key that isn't. */ - + tmp = popup->entries; while (tmp != NULL) { @@ -609,12 +609,12 @@ meta_ui_tab_popup_select (MetaTabPopup *popup, if (te->key == key) { popup->current = tmp; - + display_entry (popup, te); return; } - + tmp = tmp->next; } } @@ -645,7 +645,7 @@ selectable_image_new (GdkPixbuf *pixbuf) GtkWidget *w; w = g_object_new (meta_select_image_get_type (), NULL); - gtk_image_set_from_pixbuf (GTK_IMAGE (w), pixbuf); + gtk_image_set_from_pixbuf (GTK_IMAGE (w), pixbuf); return w; } @@ -705,14 +705,14 @@ static void meta_select_image_class_init (MetaSelectImageClass *klass) { GtkWidgetClass *widget_class; - + parent_class = g_type_class_peek (gtk_image_get_type ()); widget_class = GTK_WIDGET_CLASS (klass); #if GTK_CHECK_VERSION(3, 0, 0) widget_class->draw = meta_select_image_draw; - #else + #else widget_class->expose_event = meta_select_image_expose_event; #endif } @@ -742,13 +742,13 @@ meta_select_image_draw (GtkWidget *widget, gtk_widget_get_requisition (widget, &requisition); gtk_misc_get_alignment (misc, &xalign, &yalign); gtk_misc_get_padding (misc, &xpad, &ypad); - + x = (allocation.width - (requisition.width - xpad * 2)) * xalign + 0.5; y = (allocation.height - (requisition.height - ypad * 2)) * yalign + 0.5; x -= INSIDE_SELECT_RECT + 1; - y -= INSIDE_SELECT_RECT + 1; - + y -= INSIDE_SELECT_RECT + 1; + w = requisition.width - OUTSIDE_SELECT_RECT * 2 - 1; h = requisition.height - OUTSIDE_SELECT_RECT * 2 - 1; @@ -789,7 +789,7 @@ meta_select_image_expose_event (GtkWidget *widget, gtk_widget_get_allocation(widget, &allocation); misc = GTK_MISC (widget); - + x = (allocation.x * (1.0 - misc->xalign) + (allocation.x + allocation.width - (widget->requisition.width - misc->xpad * 2)) * @@ -800,8 +800,8 @@ meta_select_image_expose_event (GtkWidget *widget, misc->yalign) + 0.5; x -= INSIDE_SELECT_RECT + 1; - y -= INSIDE_SELECT_RECT + 1; - + y -= INSIDE_SELECT_RECT + 1; + w = widget->requisition.width - OUTSIDE_SELECT_RECT * 2 - 1; h = widget->requisition.height - OUTSIDE_SELECT_RECT * 2 - 1; @@ -822,7 +822,7 @@ meta_select_image_expose_event (GtkWidget *widget, cairo_fill (cr); #endif -#if 0 +#if 0 gtk_paint_focus (widget->style, widget->window, &event->area, widget, "meta-tab-image", x, y, w, h); @@ -865,13 +865,13 @@ selectable_workspace_new (MetaWorkspace *workspace) { GtkWidget *widget; double screen_aspect; - + widget = g_object_new (meta_select_workspace_get_type (), NULL); screen_aspect = (double) workspace->screen->rect.height / (double) workspace->screen->rect.width; - - /* account for select rect */ + + /* account for select rect */ gtk_widget_set_size_request (widget, MINI_WORKSPACE_WIDTH + SELECT_OUTLINE_WIDTH * 2, MINI_WORKSPACE_WIDTH * screen_aspect + SELECT_OUTLINE_WIDTH * 2); @@ -925,9 +925,9 @@ meta_select_workspace_get_type (void) (GInstanceInitFunc) NULL, }; - workspace_type = g_type_register_static (GTK_TYPE_DRAWING_AREA, - "MetaSelectWorkspace", - &workspace_info, + workspace_type = g_type_register_static (GTK_TYPE_DRAWING_AREA, + "MetaSelectWorkspace", + &workspace_info, 0); } @@ -938,9 +938,9 @@ static void meta_select_workspace_class_init (MetaSelectWorkspaceClass *klass) { GtkWidgetClass *widget_class; - + widget_class = GTK_WIDGET_CLASS (klass); - + #if GTK_CHECK_VERSION(3, 0, 0) widget_class->draw = meta_select_workspace_draw; #else @@ -959,7 +959,7 @@ meta_convert_meta_to_wnck (MetaWindow *window, MetaScreen *screen) WnckWindowDisplayInfo wnck_window; wnck_window.icon = window->icon; wnck_window.mini_icon = window->mini_icon; - + wnck_window.is_active = FALSE; if (window == window->display->expected_focus_window) wnck_window.is_active = TRUE; @@ -994,7 +994,7 @@ meta_select_workspace_draw (GtkWidget *widget, GList *tmp, *list; workspace = META_SELECT_WORKSPACE (widget)->workspace; - + list = meta_stack_list_windows (workspace->screen->stack, workspace); n_windows = g_list_length (list); windows = g_new (WnckWindowDisplayInfo, n_windows); @@ -1011,7 +1011,7 @@ meta_select_workspace_draw (GtkWidget *widget, ignoreable_sticky = window->on_all_workspaces && workspace != workspace->screen->active_workspace; - if (window->skip_pager || + if (window->skip_pager || !meta_window_showing_on_its_workspace (window) || window->unmaps_pending || ignoreable_sticky) @@ -1044,7 +1044,7 @@ meta_select_workspace_draw (GtkWidget *widget, n_windows); g_free (windows); - + if (META_SELECT_WORKSPACE (widget)->selected) { GtkStyleContext *context; @@ -1083,11 +1083,11 @@ meta_select_workspace_expose_event (GtkWidget *widget, int i, n_windows; GList *tmp, *list; GtkAllocation allocation; - + gtk_widget_get_allocation(widget, &allocation); workspace = META_SELECT_WORKSPACE (widget)->workspace; - + list = meta_stack_list_windows (workspace->screen->stack, workspace); n_windows = g_list_length (list); windows = g_new (WnckWindowDisplayInfo, n_windows); @@ -1104,7 +1104,7 @@ meta_select_workspace_expose_event (GtkWidget *widget, ignoreable_sticky = window->on_all_workspaces && workspace != workspace->screen->active_workspace; - if (window->skip_pager || + if (window->skip_pager || !meta_window_showing_on_its_workspace (window) || window->unmaps_pending || ignoreable_sticky) @@ -1135,7 +1135,7 @@ meta_select_workspace_expose_event (GtkWidget *widget, n_windows); g_free (windows); - + if (META_SELECT_WORKSPACE (widget)->selected) { style = gtk_widget_get_style (widget); diff --git a/src/ui/testgradient.c b/src/ui/testgradient.c index 18a9de41..8f8cd6a5 100644 --- a/src/ui/testgradient.c +++ b/src/ui/testgradient.c @@ -2,9 +2,9 @@ /* Marco gradient test program */ -/* +/* * Copyright (C) 2002 Havoc Pennington - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the @@ -14,7 +14,7 @@ * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA @@ -51,10 +51,10 @@ draw_checkerboard (GdkDrawable *drawable, #if !GTK_CHECK_VERSION (3, 0, 0) cairo_t *cr; #endif - + #define CHECK_SIZE 10 -#define SPACING 2 - +#define SPACING 2 + color1.red = 30000; color1.green = 30000; color1.blue = 30000; @@ -112,7 +112,7 @@ render_simple ( { GdkPixbuf *pixbuf; GdkColor from, to; - + gdk_color_parse ("blue", &from); gdk_color_parse ("green", &to); @@ -123,16 +123,16 @@ render_simple ( if (with_alpha) { const unsigned char alphas[] = { 0xff, 0xaa, 0x2f, 0x0, 0xcc, 0xff, 0xff }; - + if (!gdk_pixbuf_get_has_alpha (pixbuf)) { GdkPixbuf *new_pixbuf; - + new_pixbuf = gdk_pixbuf_add_alpha (pixbuf, FALSE, 0, 0, 0); g_object_unref (G_OBJECT (pixbuf)); pixbuf = new_pixbuf; } - + meta_gradient_add_alpha (pixbuf, alphas, G_N_ELEMENTS (alphas), META_GRADIENT_HORIZONTAL); @@ -143,7 +143,7 @@ render_simple ( draw_checkerboard (drawable, width, height); #endif } - + gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0); cairo_rectangle (cr, 0, 0, width, height); cairo_fill (cr); @@ -372,13 +372,13 @@ create_gradient_window (const char *title, window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (window), title); - + drawing_area = gtk_drawing_area_new (); gtk_widget_set_size_request (drawing_area, 1, 1); gtk_window_set_default_size (GTK_WINDOW (window), 175, 175); - + g_signal_connect (G_OBJECT (drawing_area), #if GTK_CHECK_VERSION (3, 0, 0) "draw", @@ -392,7 +392,7 @@ create_gradient_window (const char *title, gtk_container_add (GTK_CONTAINER (window), drawing_area); gtk_widget_show_all (window); - + return window; } @@ -403,7 +403,7 @@ meta_gradient_test (void) window = create_gradient_window ("Simple vertical", render_vertical_func); - + window = create_gradient_window ("Simple horizontal", render_horizontal_func); @@ -412,7 +412,7 @@ meta_gradient_test (void) window = create_gradient_window ("Multi vertical", render_vertical_multi_func); - + window = create_gradient_window ("Multi horizontal", render_horizontal_multi_func); diff --git a/src/ui/theme-parser.h b/src/ui/theme-parser.h index 27c86a81..61573776 100644 --- a/src/ui/theme-parser.h +++ b/src/ui/theme-parser.h @@ -2,9 +2,9 @@ /* Marco theme parsing */ -/* +/* * Copyright (C) 2001 Havoc Pennington - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the @@ -14,7 +14,7 @@ * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA diff --git a/src/ui/theme-viewer.c b/src/ui/theme-viewer.c index f8ed0d15..95858d2e 100644 --- a/src/ui/theme-viewer.c +++ b/src/ui/theme-viewer.c @@ -96,12 +96,12 @@ normal_contents (void) GtkWidget *contents; GtkWidget *sw; GtkItemFactory *item_factory; - + table = gtk_table_new (1, 4, FALSE); - + /* Create the menubar */ - + item_factory = gtk_item_factory_new (GTK_TYPE_MENU_BAR, "<main>", NULL); gtk_item_factory_set_translate_func(item_factory, @@ -156,7 +156,7 @@ normal_contents (void) handlebox = gtk_handle_box_new (); gtk_container_add (GTK_CONTAINER (handlebox), toolbar); - + gtk_table_attach (GTK_TABLE (table), handlebox, /* X direction */ /* Y direction */ @@ -175,18 +175,18 @@ normal_contents (void) gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw), GTK_SHADOW_IN); - + gtk_table_attach (GTK_TABLE (table), sw, /* X direction */ /* Y direction */ 0, 1, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - + contents = gtk_text_view_new (); gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (contents), PANGO_WRAP_WORD); - + gtk_container_add (GTK_CONTAINER (sw), contents); @@ -223,19 +223,19 @@ dialog_contents (void) GtkWidget *label; GtkWidget *image; GtkWidget *button; - + vbox = gtk_vbox_new (FALSE, 0); action_area = gtk_hbutton_box_new (); gtk_button_box_set_layout (GTK_BUTTON_BOX (action_area), - GTK_BUTTONBOX_END); + GTK_BUTTONBOX_END); button = gtk_button_new_from_stock (GTK_STOCK_OK); gtk_box_pack_end (GTK_BOX (action_area), button, FALSE, TRUE, 0); - + gtk_box_pack_end (GTK_BOX (vbox), action_area, FALSE, TRUE, 0); @@ -245,10 +245,10 @@ dialog_contents (void) image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_INFO, GTK_ICON_SIZE_DIALOG); gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0.0); - + gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); gtk_label_set_selectable (GTK_LABEL (label), TRUE); - + hbox = gtk_hbox_new (FALSE, 6); gtk_box_pack_start (GTK_BOX (hbox), image, @@ -284,11 +284,11 @@ utility_contents (void) char *str; str = g_strdup_printf ("_%c", (char) ('A' + 4*i + j)); - + button = gtk_button_new_with_mnemonic (str); g_free (str); - + gtk_table_attach (GTK_TABLE (table), button, /* X direction */ /* Y direction */ @@ -303,7 +303,7 @@ utility_contents (void) } gtk_widget_show_all (table); - + return table; } @@ -311,7 +311,7 @@ static GtkWidget* menu_contents (void) { GtkWidget *vbox; - GtkWidget *mi; + GtkWidget *mi; int i; GtkWidget *frame; @@ -329,14 +329,14 @@ menu_contents (void) gtk_misc_set_alignment (GTK_MISC (mi), 0.0, 0.5); g_free (str); gtk_box_pack_start (GTK_BOX (vbox), mi, FALSE, FALSE, 0); - + ++i; } gtk_container_add (GTK_CONTAINER (frame), vbox); - + gtk_widget_show_all (frame); - + return frame; } @@ -354,19 +354,19 @@ border_only_contents (void) color.green = 0; color.blue = 40000; gtk_widget_modify_bg (event_box, GTK_STATE_NORMAL, &color); - + vbox = gtk_vbox_new (FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (vbox), 3); - + w = gtk_label_new (_("Border-only window")); gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 0); w = gtk_button_new_with_label (_("Bar")); gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 0); gtk_container_add (GTK_CONTAINER (event_box), vbox); - + gtk_widget_show_all (event_box); - + return event_box; } @@ -399,7 +399,7 @@ get_window_contents (MetaFrameType type, case META_FRAME_TYPE_BORDER: *title = _("Border"); return border_only_contents (); - + case META_FRAME_TYPE_LAST: g_assert_not_reached (); break; @@ -422,7 +422,7 @@ get_window_flags (MetaFrameType type) META_FRAME_HAS_FOCUS | META_FRAME_ALLOWS_SHADE | META_FRAME_ALLOWS_MOVE; - + switch (type) { case META_FRAME_TYPE_NORMAL: @@ -446,12 +446,12 @@ get_window_flags (MetaFrameType type) case META_FRAME_TYPE_BORDER: break; - + case META_FRAME_TYPE_LAST: g_assert_not_reached (); break; - } - + } + return flags; } @@ -476,7 +476,7 @@ preview_collection (int font_size, eventbox = gtk_event_box_new (); gtk_container_add (GTK_CONTAINER (eventbox), box); - + gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (sw), eventbox); desktop_color.red = 0x5144; @@ -496,23 +496,23 @@ preview_collection (int font_size, GtkWidget *preview; PangoFontDescription *font_desc; double scale; - + eventbox2 = gtk_event_box_new (); - + preview = meta_preview_new (); - + gtk_container_add (GTK_CONTAINER (eventbox2), preview); - + meta_preview_set_frame_type (META_PREVIEW (preview), i); meta_preview_set_frame_flags (META_PREVIEW (preview), get_window_flags (i)); - + meta_preview_set_theme (META_PREVIEW (preview), global_theme); - + contents = get_window_contents (i, &title); - + meta_preview_set_title (META_PREVIEW (preview), title); - + gtk_container_add (GTK_CONTAINER (preview), contents); if (i == META_FRAME_TYPE_MENU) @@ -525,10 +525,10 @@ preview_collection (int font_size, xalign = 0.5; yalign = 0.5; } - + align = gtk_alignment_new (0.0, 0.0, xalign, yalign); gtk_container_add (GTK_CONTAINER (align), eventbox2); - + gtk_box_pack_start (GTK_BOX (box), align, TRUE, TRUE, 0); switch (font_size) @@ -547,17 +547,17 @@ preview_collection (int font_size, if (scale != 1.0) { font_desc = pango_font_description_new (); - + pango_font_description_set_size (font_desc, MAX (pango_font_description_get_size (base_desc) * scale, 1)); - + gtk_widget_modify_font (preview, font_desc); pango_font_description_free (font_desc); } - + previews[font_size*META_FRAME_TYPE_LAST + i] = preview; - + ++i; } @@ -586,13 +586,13 @@ init_layouts (void) } ++i; } - + #ifndef ALLOW_DUPLICATE_BUTTONS i = 0; while (i <= MAX_BUTTONS_PER_CORNER) { int j; - + j = 0; while (j < i) { @@ -604,34 +604,34 @@ init_layouts (void) different_layouts[i].left_buttons[j-i] = (MetaButtonFunction) j; ++j; } - + ++i; } /* Special extra case for no buttons on either side */ different_layouts[i].left_buttons[0] = META_BUTTON_FUNCTION_LAST; different_layouts[i].right_buttons[0] = META_BUTTON_FUNCTION_LAST; - + #else /* FIXME this code is if we allow duplicate buttons, * which we currently do not */ int left; int i; - + left = 0; i = 0; while (left < MAX_BUTTONS_PER_CORNER) { int right; - + right = 0; - + while (right < MAX_BUTTONS_PER_CORNER) { int j; - + static MetaButtonFunction left_functions[MAX_BUTTONS_PER_CORNER] = { META_BUTTON_FUNCTION_MENU, META_BUTTON_FUNCTION_MINIMIZE, @@ -646,7 +646,7 @@ init_layouts (void) }; g_assert (i < BUTTON_LAYOUT_COMBINATIONS); - + j = 0; while (j <= left) { @@ -660,12 +660,12 @@ init_layouts (void) different_layouts[i].right_buttons[j] = right_functions[j]; ++j; } - + ++i; - + ++right; } - + ++left; } #endif @@ -681,13 +681,13 @@ previews_of_button_layouts (void) GdkColor desktop_color; int i; GtkWidget *eventbox; - + if (!initted) { init_layouts (); initted = TRUE; } - + sw = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), GTK_POLICY_AUTOMATIC, @@ -699,7 +699,7 @@ previews_of_button_layouts (void) eventbox = gtk_event_box_new (); gtk_container_add (GTK_CONTAINER (eventbox), box); - + gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (sw), eventbox); desktop_color.red = 0x5144; @@ -718,11 +718,11 @@ previews_of_button_layouts (void) char *title; eventbox2 = gtk_event_box_new (); - + preview = meta_preview_new (); - - gtk_container_add (GTK_CONTAINER (eventbox2), preview); - + + gtk_container_add (GTK_CONTAINER (eventbox2), preview); + meta_preview_set_theme (META_PREVIEW (preview), global_theme); title = g_strdup_printf (_("Button layout test %d"), i+1); @@ -731,20 +731,20 @@ previews_of_button_layouts (void) meta_preview_set_button_layout (META_PREVIEW (preview), &different_layouts[i]); - + xalign = 0.5; yalign = 0.5; - + align = gtk_alignment_new (0.0, 0.0, xalign, yalign); gtk_container_add (GTK_CONTAINER (align), eventbox2); - + gtk_box_pack_start (GTK_BOX (box), align, TRUE, TRUE, 0); previews[META_FRAME_TYPE_LAST*FONT_SIZE_LAST + i] = preview; - + ++i; } - + return sw; } @@ -753,7 +753,7 @@ benchmark_summary (void) { char *msg; GtkWidget *label; - + msg = g_strdup_printf (_("%g milliseconds to draw one window frame"), milliseconds_to_draw_frame); label = gtk_label_new (msg); @@ -771,7 +771,7 @@ main (int argc, char **argv) clock_t start, end; GtkWidget *notebook; int i; - + bindtextdomain (GETTEXT_PACKAGE, MARCO_LOCALEDIR); textdomain(GETTEXT_PACKAGE); bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); @@ -788,7 +788,7 @@ main (int argc, char **argv) meta_set_debugging (TRUE); meta_set_verbose (TRUE); } - + start = clock (); err = NULL; if (argc == 1) @@ -815,7 +815,7 @@ main (int argc, char **argv) (end - start) / (double) CLOCKS_PER_SEC); run_theme_benchmark (); - + window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 350, 350); @@ -835,7 +835,7 @@ main (int argc, char **argv) title); g_free (title); - } + } g_signal_connect (G_OBJECT (window), "destroy", G_CALLBACK (gtk_main_quit), NULL); @@ -843,7 +843,7 @@ main (int argc, char **argv) gtk_widget_realize (window); g_assert (window->style); g_assert (window->style->font_desc); - + notebook = gtk_notebook_new (); gtk_container_add (GTK_CONTAINER (window), notebook); @@ -852,13 +852,13 @@ main (int argc, char **argv) gtk_notebook_append_page (GTK_NOTEBOOK (notebook), collection, gtk_label_new (_("Normal Title Font"))); - + collection = preview_collection (FONT_SIZE_SMALL, window->style->font_desc); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), collection, gtk_label_new (_("Small Title Font"))); - + collection = preview_collection (FONT_SIZE_LARGE, window->style->font_desc); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), @@ -874,7 +874,7 @@ main (int argc, char **argv) gtk_notebook_append_page (GTK_NOTEBOOK (notebook), collection, gtk_label_new (_("Benchmark"))); - + i = 0; while (i < (int) G_N_ELEMENTS (previews)) { @@ -885,7 +885,7 @@ main (int argc, char **argv) ++i; } - + gtk_widget_show_all (window); gtk_main (); @@ -948,10 +948,10 @@ run_theme_benchmark (void) int client_width; int client_height; int inc; - + widget = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_widget_realize (widget); - + meta_theme_get_frame_borders (global_theme, META_FRAME_TYPE_NORMAL, get_text_height (widget), @@ -960,9 +960,9 @@ run_theme_benchmark (void) &bottom_height, &left_width, &right_width); - + layout = create_title_layout (widget); - + i = 0; while (i < MAX_BUTTONS_PER_CORNER) { @@ -970,7 +970,7 @@ run_theme_benchmark (void) button_layout.right_buttons[i] = META_BUTTON_FUNCTION_LAST; ++i; } - + button_layout.left_buttons[0] = META_BUTTON_FUNCTION_MENU; button_layout.right_buttons[0] = META_BUTTON_FUNCTION_MINIMIZE; @@ -985,7 +985,7 @@ run_theme_benchmark (void) inc = 1000 / ITERATIONS; /* Increment to grow width/height, * eliminates caching effects. */ - + i = 0; while (i < ITERATIONS) { @@ -1013,7 +1013,7 @@ run_theme_benchmark (void) meta_preview_get_icon ()); g_object_unref (G_OBJECT (pixmap)); - + ++i; client_width += inc; client_height += inc; @@ -1023,7 +1023,7 @@ run_theme_benchmark (void) g_timer_stop (timer); milliseconds_to_draw_frame = (g_timer_elapsed (timer, NULL) / (double) ITERATIONS) * 1000; - + g_print (_("Drew %d frames in %g client-side seconds (%g milliseconds per frame) and %g seconds wall clock time including X server resources (%g milliseconds per frame)\n"), ITERATIONS, ((double)end - (double)start) / CLOCKS_PER_SEC, @@ -1217,7 +1217,7 @@ run_position_expression_tests (void) test->expr, test->expected_x, test->expected_y); err = NULL; - + env.rect = meta_rect (test->rect.x, test->rect.y, test->rect.width, test->rect.height); env.object_width = -1; diff --git a/src/ui/theme.c b/src/ui/theme.c index 2ddb1485..aa49963a 100644 --- a/src/ui/theme.c +++ b/src/ui/theme.c @@ -3464,7 +3464,7 @@ meta_draw_op_draw_with_env (const MetaDrawOp *op, cairo_clip (cr); } #endif - + switch (op->type) { case META_DRAW_LINE: @@ -3935,12 +3935,12 @@ meta_draw_op_draw_with_env (const MetaDrawOp *op, /* tile offset should not include x/y */ tile_xoffset -= rect.x; tile_yoffset -= rect.y; - + tile.width = parse_size_unchecked (op->data.tile.tile_width, env); tile.height = parse_size_unchecked (op->data.tile.tile_height, env); tile.x = rx - tile_xoffset; - + while (tile.x < (rx + rwidth)) { tile.y = ry - tile_yoffset; @@ -4148,7 +4148,7 @@ meta_draw_op_list_draw_with_style (const MetaDrawOpList *op_list, * evaluated), we make an array of those, and then fold * adjacent items when possible. */ - + #if GTK_CHECK_VERSION(3, 0, 0) cairo_save(cr); #else @@ -4176,13 +4176,13 @@ meta_draw_op_list_draw_with_style (const MetaDrawOpList *op_list, { cairo_restore (cr); - cairo_rectangle (cr, + cairo_rectangle (cr, parse_x_position_unchecked (op->data.clip.x, &env), parse_y_position_unchecked (op->data.clip.y, &env), parse_size_unchecked (op->data.clip.width, &env), parse_size_unchecked (op->data.clip.height, &env)); cairo_clip (cr); - + cairo_save (cr); } else if (gdk_cairo_get_clip_rectangle (cr, NULL)) @@ -4801,7 +4801,7 @@ meta_frame_style_draw_with_style (MetaFrameStyle *style, button_rect (j, fgeom, middle_bg_offset, &rect); op_list = get_button (style, j, button_states[j]); - + if (op_list) { cairo_save (cr); diff --git a/src/ui/theme.h b/src/ui/theme.h index cfa3bde4..89d41efe 100644 --- a/src/ui/theme.h +++ b/src/ui/theme.h @@ -2,9 +2,9 @@ /* Marco Theme Rendering */ -/* +/* * Copyright (C) 2001 Havoc Pennington - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the @@ -14,7 +14,7 @@ * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA @@ -34,7 +34,7 @@ typedef struct _MetaFrameStyleSet MetaFrameStyleSet; typedef struct _MetaDrawOp MetaDrawOp; typedef struct _MetaDrawOpList MetaDrawOpList; typedef struct _MetaGradientSpec MetaGradientSpec; -typedef struct _MetaAlphaGradientSpec MetaAlphaGradientSpec; +typedef struct _MetaAlphaGradientSpec MetaAlphaGradientSpec; typedef struct _MetaColorSpec MetaColorSpec; typedef struct _MetaFrameLayout MetaFrameLayout; typedef struct _MetaButtonSpace MetaButtonSpace; @@ -84,14 +84,14 @@ struct _MetaFrameLayout { /** Reference count. */ int refcount; - + /** Size of left side */ int left_width; /** Size of right side */ int right_width; /** Size of bottom side */ int bottom_height; - + /** Border of blue title region * \bug (blue?!) **/ @@ -99,12 +99,12 @@ struct _MetaFrameLayout /** Extra height for inside of title region, above the font height */ int title_vertical_pad; - + /** Right indent of buttons from edges of frame */ int right_titlebar_edge; /** Left indent of buttons from edges of frame */ int left_titlebar_edge; - + /** * Sizing rule of buttons, either META_BUTTON_SIZING_ASPECT * (in which case button_aspect will be honoured, and @@ -120,7 +120,7 @@ struct _MetaFrameLayout * Otherwise we figure out the height from the button_border. */ double button_aspect; - + /** Width of a button; set even when we are using aspect sizing */ int button_width; @@ -132,7 +132,7 @@ struct _MetaFrameLayout /** scale factor for title text */ double title_scale; - + /** Whether title text will be displayed */ guint has_title : 1; @@ -174,7 +174,7 @@ struct _MetaFrameGeometry int bottom_height; int width; - int height; + int height; GdkRectangle title_rect; @@ -186,7 +186,7 @@ struct _MetaFrameGeometry /* used for a memset hack */ #define ADDRESS_OF_BUTTON_RECTS(fgeom) (((char*)(fgeom)) + G_STRUCT_OFFSET (MetaFrameGeometry, close_rect)) #define LENGTH_OF_BUTTON_RECTS (G_STRUCT_OFFSET (MetaFrameGeometry, right_right_background) + sizeof (GdkRectangle) - G_STRUCT_OFFSET (MetaFrameGeometry, close_rect)) - + /* The button rects (if changed adjust memset hack) */ MetaButtonSpace close_rect; MetaButtonSpace max_rect; @@ -209,7 +209,7 @@ struct _MetaFrameGeometry GdkRectangle right_middle_backgrounds[MAX_MIDDLE_BACKGROUNDS]; GdkRectangle right_right_background; /* End of button rects (if changed adjust memset hack) */ - + /* Round corners */ guint top_left_corner_rounded_radius; guint top_right_corner_rounded_radius; @@ -309,14 +309,14 @@ typedef enum /** Clip to a rectangle */ META_DRAW_CLIP, - + /* Texture thingies */ /** Just a filled rectangle with alpha */ META_DRAW_TINT, META_DRAW_GRADIENT, META_DRAW_IMAGE, - + /** GTK theme engine stuff */ META_DRAW_GTK_ARROW, META_DRAW_GTK_BOX, @@ -402,7 +402,7 @@ typedef struct _MetaDrawSpec * otherwise it is zero. */ int value; - + /** A list of tokens in the expression. */ PosToken *tokens; @@ -460,7 +460,7 @@ struct _MetaDrawOp MetaDrawSpec *width; MetaDrawSpec *height; } clip; - + struct { MetaColorSpec *color_spec; MetaAlphaGradientSpec *alpha_spec; @@ -494,7 +494,7 @@ struct _MetaDrawOp unsigned int vertical_stripes : 1; unsigned int horizontal_stripes : 1; } image; - + struct { GtkStateType state; GtkShadowType shadow; @@ -520,7 +520,7 @@ struct _MetaDrawOp GtkStateType state; MetaDrawSpec *x; MetaDrawSpec *y1; - MetaDrawSpec *y2; + MetaDrawSpec *y2; } gtk_vline; struct { @@ -557,7 +557,7 @@ struct _MetaDrawOp MetaDrawSpec *tile_width; MetaDrawSpec *tile_height; } tile; - + } data; }; @@ -630,7 +630,7 @@ typedef enum * | rather than | * */ - + /* entire frame */ META_FRAME_PIECE_ENTIRE_BACKGROUND, /* entire titlebar background */ @@ -698,7 +698,7 @@ struct _MetaFrameStyle }; /* Kinds of frame... - * + * * normal -> noresize / vert only / horz only / both * focused / unfocused * max -> focused / unfocused @@ -710,7 +710,7 @@ struct _MetaFrameStyle * * 14 window states times 7 or 8 window types. Except some * window types never get a frame so that narrows it down a bit. - * + * */ typedef enum { @@ -1130,7 +1130,7 @@ void meta_theme_calc_geometry (MetaTheme *theme, int client_height, const MetaButtonLayout *button_layout, MetaFrameGeometry *fgeom); - + MetaFrameLayout* meta_theme_lookup_layout (MetaTheme *theme, const char *name); void meta_theme_insert_layout (MetaTheme *theme, diff --git a/src/ui/themewidget.c b/src/ui/themewidget.c index 938248bd..36c481c6 100644 --- a/src/ui/themewidget.c +++ b/src/ui/themewidget.c @@ -2,9 +2,9 @@ /* Marco theme widget (displays themed draw operations) */ -/* +/* * Copyright (C) 2002 Havoc Pennington - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the @@ -14,7 +14,7 @@ * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA @@ -123,10 +123,10 @@ meta_area_new (void) #if GTK_CHECK_VERSION(3, 0, 0) area = g_object_new (META_TYPE_AREA, NULL); - #else + #else area = gtk_type_new (META_TYPE_AREA); #endif - + return GTK_WIDGET (area); } @@ -136,10 +136,10 @@ meta_area_finalize (GObject *object) MetaArea *area; area = META_AREA (object); - + if (area->dnotify) (* area->dnotify) (area->user_data); - + G_OBJECT_CLASS (parent_class)->finalize (object); } @@ -177,21 +177,21 @@ meta_area_draw (GtkWidget *widget, gtk_misc_get_padding(misc, &xpad, &ypad); - + x = floor (allocation.x + xpad + ((allocation.width - req.width) * xalign) + 0.5); - y = floor (allocation.y + ypad + y = floor (allocation.y + ypad + ((allocation.height - req.height) * yalign) + 0.5); - + if (area->draw_func) { (* area->draw_func) (area, cr, area->user_data); } } - + return FALSE; } @@ -218,21 +218,21 @@ meta_area_expose (GtkWidget *widget, xalign = misc->xalign; else xalign = 1.0 - misc->xalign; - + x = floor (widget->allocation.x + misc->xpad + ((widget->allocation.width - widget->requisition.width) * xalign) + 0.5); - y = floor (widget->allocation.y + misc->ypad + y = floor (widget->allocation.y + misc->ypad + ((widget->allocation.height - widget->requisition.height) * misc->yalign) + 0.5); - + if (area->expose_func) { (* area->expose_func) (area, event, x, y, area->user_data); } } - + return FALSE; } @@ -245,10 +245,10 @@ meta_area_size_request (GtkWidget *widget, MetaArea *area; area = META_AREA (widget); - + req->width = 0; req->height = 0; - + if (area->size_func) { (* area->size_func) (area, &req->width, &req->height, @@ -258,7 +258,7 @@ meta_area_size_request (GtkWidget *widget, #if GTK_CHECK_VERSION(3, 0, 0) -static void +static void meta_area_get_preferred_width (GtkWidget *widget, gint *minimal, gint *natural) @@ -270,7 +270,7 @@ meta_area_get_preferred_width (GtkWidget *widget, *minimal = *natural = requisition.width; } -static void +static void meta_area_get_preferred_height (GtkWidget *widget, gint *minimal, gint *natural) @@ -297,7 +297,7 @@ meta_area_setup (MetaArea *area, { if (area->dnotify) (* area->dnotify) (area->user_data); - + area->size_func = size_func; #if GTK_CHECK_VERSION(3, 0, 0) area->draw_func = draw_func; diff --git a/src/ui/themewidget.h b/src/ui/themewidget.h index 940b44fc..17b9d993 100644 --- a/src/ui/themewidget.h +++ b/src/ui/themewidget.h @@ -2,9 +2,9 @@ /* Marco theme widget (displays themed draw operations) */ -/* +/* * Copyright (C) 2002 Havoc Pennington - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the @@ -14,7 +14,7 @@ * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA |