diff options
author | Behdad Esfahbod <behdad@gnome.org> | 2007-01-16 20:07:35 +0000 |
---|---|---|
committer | Behdad Esfahbod <behdad@src.gnome.org> | 2007-01-16 20:07:35 +0000 |
commit | 80e647a8dbc97662b9d966c0f7a8e1aedea89eed (patch) | |
tree | d3a322c28112b7623765847aa32e8e319c576b45 /pango-view | |
parent | e6b83e4264b4ad2ab73a3239d902b4064c75634d (diff) | |
download | pango-80e647a8dbc97662b9d966c0f7a8e1aedea89eed.tar.gz |
*.c, *.h: Drop trailing whitespace.
2007-01-16 Behdad Esfahbod <behdad@gnome.org>
*.c, *.h: Drop trailing whitespace.
svn path=/trunk/; revision=2163
Diffstat (limited to 'pango-view')
-rw-r--r-- | pango-view/viewer-main.c | 8 | ||||
-rw-r--r-- | pango-view/viewer-pangocairo.c | 18 | ||||
-rw-r--r-- | pango-view/viewer-pangoft2.c | 8 | ||||
-rw-r--r-- | pango-view/viewer-pangox.c | 6 | ||||
-rw-r--r-- | pango-view/viewer-pangoxft.c | 8 | ||||
-rw-r--r-- | pango-view/viewer-render.c | 24 | ||||
-rw-r--r-- | pango-view/viewer-win32.c | 84 | ||||
-rw-r--r-- | pango-view/viewer-x.c | 14 | ||||
-rw-r--r-- | pango-view/viewer-x.h | 2 |
9 files changed, 86 insertions, 86 deletions
diff --git a/pango-view/viewer-main.c b/pango-view/viewer-main.c index 7217c544..4ec70f02 100644 --- a/pango-view/viewer-main.c +++ b/pango-view/viewer-main.c @@ -46,11 +46,11 @@ main (int argc, int run; int width, height; gpointer surface; - + g_type_init(); setlocale (LC_ALL, ""); parse_options (argc, argv); - + view = opt_viewer; g_assert (view->id); @@ -84,7 +84,7 @@ main (int argc, GError *error; convert_argv[2] = opt_output; - + if (!g_spawn_async_with_pipes (NULL, (gchar **)convert_argv, NULL, G_SPAWN_SEARCH_PATH | G_SPAWN_STDOUT_TO_DEV_NULL | @@ -134,7 +134,7 @@ main (int argc, if (!view->write) fail ("%s viewer backend does not support displaying or writing", view->name); display_argv[2] = title; - + if (!g_spawn_async_with_pipes (NULL, (gchar **)display_argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD | G_SPAWN_SEARCH_PATH | diff --git a/pango-view/viewer-pangocairo.c b/pango-view/viewer-pangocairo.c index df927466..50eae22f 100644 --- a/pango-view/viewer-pangocairo.c +++ b/pango-view/viewer-pangocairo.c @@ -64,7 +64,7 @@ pangocairo_view_create (const PangoViewer *klass) return instance; } -static void +static void pangocairo_view_destroy (gpointer instance) { CairoViewer *c = (CairoViewer *) instance; @@ -90,7 +90,7 @@ pangocairo_view_get_context (gpointer instance) return context; } -typedef struct +typedef struct { gpointer backend; @@ -117,7 +117,7 @@ pangocairo_view_create_surface (gpointer instance, return surface; } -static void +static void pangocairo_view_destroy_surface (gpointer instance, gpointer surface) { @@ -149,7 +149,7 @@ render_callback (PangoLayout *layout, PangoRectangle ink, logical; double lw = cairo_get_line_width (cr); PangoLayoutIter* iter; - + pango_layout_get_extents (layout, &ink, &logical); /* draw resolved gravity "roof" in blue */ @@ -184,7 +184,7 @@ render_callback (PangoLayout *layout, cairo_set_source_rgba (cr, 0.0, 0.0, 0.7, 0.2); cairo_stroke (cr); cairo_restore (cr); - + /* draw block progression arrow in green */ cairo_save (cr); @@ -214,7 +214,7 @@ render_callback (PangoLayout *layout, cairo_set_source_rgba (cr, 0.0, 0.7, 0.0, 0.2); cairo_stroke (cr); cairo_restore (cr); - + /* draw baselines with line direction arrow in orange */ cairo_save (cr); cairo_set_source_rgba (cr, 1.0, 0.5, 0.0, 0.5); @@ -298,11 +298,11 @@ transform_callback (PangoContext *context, } cairo_set_matrix (cr, &cairo_matrix); - + pango_cairo_update_context (cr, context); } -static void +static void pangocairo_view_render (gpointer instance, gpointer surface, PangoContext *context, @@ -330,7 +330,7 @@ pangocairo_view_render (gpointer instance, cairo_set_source_rgb (cr, 1.0, 1.0, 1.0); cairo_paint (cr); - + cairo_set_source_rgb (cr, 0.0, 0.0, 0.0); do_output (context, render_callback, transform_callback, cr, state, NULL, NULL); diff --git a/pango-view/viewer-pangoft2.c b/pango-view/viewer-pangoft2.c index ac0b5b41..a3672399 100644 --- a/pango-view/viewer-pangoft2.c +++ b/pango-view/viewer-pangoft2.c @@ -38,7 +38,7 @@ substitute_func (FcPattern *pattern, { FcPatternDel (pattern, FC_HINTING); FcPatternAddBool (pattern, FC_HINTING, opt_hinting != HINT_NONE); - + FcPatternDel (pattern, FC_AUTOHINT); FcPatternAddBool (pattern, FC_AUTOHINT, opt_hinting == HINT_AUTO); } @@ -56,7 +56,7 @@ pangoft2_view_create (const PangoViewer *klass) return fontmap; } -static void +static void pangoft2_view_destroy (gpointer instance) { g_object_unref (instance); @@ -87,7 +87,7 @@ pangoft2_view_create_surface (gpointer instance, return bitmap; } -static void +static void pangoft2_view_destroy_surface (gpointer instance, gpointer surface) { @@ -109,7 +109,7 @@ render_callback (PangoLayout *layout, x, y); } -static void +static void pangoft2_view_render (gpointer instance, gpointer surface, PangoContext *context, diff --git a/pango-view/viewer-pangox.c b/pango-view/viewer-pangox.c index 75126473..084747b3 100644 --- a/pango-view/viewer-pangox.c +++ b/pango-view/viewer-pangox.c @@ -25,7 +25,7 @@ #include <pango/pangox.h> -static void +static void pangox_view_destroy (gpointer instance) { XViewer *x = (XViewer *)instance; @@ -52,7 +52,7 @@ pangox_view_get_context (gpointer instance) return context; } -typedef struct +typedef struct { XViewer *x; Drawable drawable; @@ -75,7 +75,7 @@ render_callback (PangoLayout *layout, x, y); } -static void +static void pangox_view_render (gpointer instance, gpointer surface, PangoContext *context, diff --git a/pango-view/viewer-pangoxft.c b/pango-view/viewer-pangoxft.c index f33f6102..80863ca7 100644 --- a/pango-view/viewer-pangoxft.c +++ b/pango-view/viewer-pangoxft.c @@ -36,7 +36,7 @@ default_substitute (FcPattern *pattern, { FcPatternDel (pattern, FC_HINTING); FcPatternAddBool (pattern, FC_HINTING, opt_hinting != HINT_NONE); - + FcPatternDel (pattern, FC_AUTOHINT); FcPatternAddBool (pattern, FC_AUTOHINT, opt_hinting == HINT_AUTO); } @@ -57,7 +57,7 @@ pangoxft_view_create (const PangoViewer *klass) return instance; } -static void +static void pangoxft_view_destroy (gpointer instance) { XViewer *x = (XViewer *)instance; @@ -75,7 +75,7 @@ pangoxft_view_get_context (gpointer instance) return pango_xft_get_context (x->display, x->screen); } -typedef struct +typedef struct { XftDraw *draw; XftColor color; @@ -96,7 +96,7 @@ render_callback (PangoLayout *layout, x * PANGO_SCALE, y * PANGO_SCALE); } -static void +static void pangoxft_view_render (gpointer instance, gpointer surface, PangoContext *context, diff --git a/pango-view/viewer-render.c b/pango-view/viewer-render.c index 4a102ffc..86bf04c5 100644 --- a/pango-view/viewer-render.c +++ b/pango-view/viewer-render.c @@ -168,7 +168,7 @@ output_body (PangoContext *context, PangoRectangle logical_rect; int size, start_size, end_size, increment; int x = 0, y = 0; - + if (!supports_matrix) { const PangoMatrix* matrix; @@ -353,7 +353,7 @@ parse_enum (GType type, if (!ret && error) { g_set_error(error, - G_OPTION_ERROR, + G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE, "Argument for %s must be one of %s", name, @@ -413,12 +413,12 @@ parse_hinting (const char *name, else { g_set_error(error, - G_OPTION_ERROR, + G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE, "Argument for --hinting must be one of none/auto/full"); ret = FALSE; } - + return ret; } @@ -442,7 +442,7 @@ backends_to_string (void) { GString *backends = g_string_new (NULL); const PangoViewer **viewer; - + for (viewer = viewers; *viewer; viewer++) if ((*viewer)->id) { @@ -450,7 +450,7 @@ backends_to_string (void) g_string_append_c (backends, '/'); } g_string_truncate (backends, MAX (0, (gint)backends->len - 1)); - + return g_string_free(backends,FALSE); } @@ -463,7 +463,7 @@ backends_get_count (void) for (viewer = viewers; *viewer; viewer++) if ((*viewer)->id) i++; - + return i; } @@ -473,7 +473,7 @@ backend_description (void) { GString *description = g_string_new("Pango backend to use for rendering "); int backends_count = backends_get_count (); - + if (backends_count > 1) g_string_append_printf(description,"(default: %s)", (*viewers)->id); else if (backends_count == 1) @@ -482,7 +482,7 @@ backend_description (void) g_string_append_printf(description,"(no backends found!)"); return g_string_free(description,FALSE); - + } @@ -506,9 +506,9 @@ parse_backend (const char *name, gchar *backends = backends_to_string (); g_set_error(error, - G_OPTION_ERROR, + G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE, - "Available --backend options are: %s", + "Available --backend options are: %s", backends); g_free(backends); ret = FALSE; @@ -613,7 +613,7 @@ parse_options (int argc, char *argv[]) { if (opt_text && argc != 1) fail ("When specifying --text, no file should be given"); - + g_printerr ("Usage: %s [OPTION...] FILE\n", prog_name); exit (1); } diff --git a/pango-view/viewer-win32.c b/pango-view/viewer-win32.c index 3ac67ba0..96449931 100644 --- a/pango-view/viewer-win32.c +++ b/pango-view/viewer-win32.c @@ -110,7 +110,7 @@ split_paragraphs (char *text) gunichar wc; GList *result = NULL; char *last_para = text; - + while (*p) { wc = g_utf8_get_char (p); @@ -131,7 +131,7 @@ split_paragraphs (char *text) para->height = 0; last_para = next; - + result = g_list_prepend (result, para); } if (!wc) /* incomplete character at end */ @@ -157,19 +157,19 @@ xy_to_cp (int width, int x, int y, Paragraph **para_return, int *index) while (para_list && height < y) { Paragraph *para = para_list->data; - + if (height + para->height >= y) { gboolean result = pango_layout_xy_to_index (para->layout, x * PANGO_SCALE, - (y - height) * PANGO_SCALE, + (y - height) * PANGO_SCALE, index, NULL); if (result && para_return) *para_return = para; return result; } - + height += para->height; para_list = para_list->next; } @@ -179,19 +179,19 @@ xy_to_cp (int width, int x, int y, Paragraph **para_return, int *index) /* Given a paragraph and offset in that paragraph, find the * bounding rectangle for the character at the offset. - */ + */ void char_bounds (Paragraph *para, int index, int width, PangoRectangle *rect) { GList *para_list; - + int height = 0; - + para_list = paragraphs; while (para_list) { Paragraph *cur_para = para_list->data; - + if (cur_para == para) { PangoRectangle pos; @@ -203,7 +203,7 @@ char_bounds (Paragraph *para, int index, int width, PangoRectangle *rect) rect->y = height + PANGO_PIXELS (pos.y); rect->height = PANGO_PIXELS (pos.height); } - + height += cur_para->height; para_list = para_list->next; } @@ -256,7 +256,7 @@ size_allocate (GtkWidget *layout, GtkAllocation *allocation) { Paragraph *para = tmp_list->data; PangoRectangle logical_rect; - + tmp_list = tmp_list->next; pango_layout_set_alignment (para->layout, @@ -265,7 +265,7 @@ size_allocate (GtkWidget *layout, GtkAllocation *allocation) pango_layout_get_extents (para->layout, NULL, &logical_rect); para->height = PANGO_PIXELS (logical_rect.height); - + height += para->height; } @@ -285,13 +285,13 @@ draw (GtkWidget *layout, GdkRectangle *area) guint height = 0; HDC hdc; const GdkGCValuesMask mask = GDK_GC_FOREGROUND|GDK_GC_BACKGROUND|GDK_GC_FONT; - + gdk_draw_rectangle (GTK_LAYOUT (layout)->bin_window, layout->style->base_gc[layout->state], TRUE, - area->x, area->y, + area->x, area->y, area->width, area->height); - + gdk_gc_set_clip_rectangle (layout->style->text_gc[layout->state], area); hdc = gdk_win32_hdc_get (GTK_LAYOUT (layout)->bin_window, @@ -303,7 +303,7 @@ draw (GtkWidget *layout, GdkRectangle *area) { Paragraph *para = tmp_list->data; tmp_list = tmp_list->next; - + if (height + para->height >= GTK_LAYOUT (layout)->yoffset + area->y) pango_win32_render_layout (hdc, para->layout, 0, height - GTK_LAYOUT (layout)->yoffset); @@ -334,7 +334,7 @@ button_press (GtkWidget *layout, GdkEventButton *event) Paragraph *para = NULL; int offset; gchar *message; - + xy_to_cp (layout->allocation.width, event->x, event->y + GTK_LAYOUT (layout)->yoffset, ¶, &offset); @@ -344,14 +344,14 @@ button_press (GtkWidget *layout, GdkEventButton *event) highlight_para = para; highlight_offset = offset; - + if (para) { gunichar wc; wc = g_utf8_get_char (para->text + offset); message = g_strdup_printf ("Current char: U%04x", wc); - + xor_char (layout, NULL, highlight_para, highlight_offset); } else @@ -365,7 +365,7 @@ static void checkbutton_toggled (GtkWidget *widget, gpointer data) { GList *para_list; - + pango_context_set_base_dir (context, GTK_TOGGLE_BUTTON (widget)->active ? PANGO_DIRECTION_RTL : PANGO_DIRECTION_LTR); para_list = paragraphs; @@ -415,7 +415,7 @@ set_style (GtkWidget *entry, gpointer data) { char *str = gtk_editable_get_chars (GTK_EDITABLE (entry), 0, -1); PangoFontDescription *tmp_desc; - + tmp_desc = pango_font_description_from_string (str); pango_font_description_set_style(font_description, pango_font_description_get_style(tmp_desc)); @@ -425,7 +425,7 @@ set_style (GtkWidget *entry, gpointer data) pango_font_description_free (tmp_desc); g_free (str); - + reload_font (); } @@ -448,7 +448,7 @@ compare_font_descriptions (const PangoFontDescription *a, const PangoFontDescrip if (pango_font_description_get_style(a) != pango_font_description_get_style(b)) return pango_font_description_get_style(a) - pango_font_description_get_style(b); - + if (pango_font_description_get_stretch(a) != pango_font_description_get_stretch(b)) return pango_font_description_get_stretch(a) - pango_font_description_get_stretch(b); @@ -464,7 +464,7 @@ font_description_sort_func (const void *a, const void *b) return compare_font_descriptions (*(PangoFontDescription **)a, *(PangoFontDescription **)b); } -typedef struct +typedef struct { PangoFontDescription **descs; int n_descs; @@ -487,7 +487,7 @@ fill_styles_combo (GtkWidget *combo) int n_families; const char *family_name = pango_font_description_get_family(font_description); - /* + /* * Now map back the given family name to the family. There are more efficient * ways to handle this but it should not matter much ... */ @@ -521,13 +521,13 @@ fill_styles_combo (GtkWidget *combo) for (i=0; i<info->n_descs; i++) { char *str; - + PangoFontDescription *tmp_desc; tmp_desc = info->descs[i]; pango_font_description_set_family(tmp_desc, NULL); pango_font_description_unset_fields(tmp_desc, PANGO_FONT_MASK_SIZE); - + str = pango_font_description_to_string (tmp_desc); style_list = g_list_prepend (style_list, str); } @@ -552,7 +552,7 @@ make_styles_combo () styles_combo = combo; fill_styles_combo (combo); - + return combo; } @@ -570,7 +570,7 @@ make_families_menu () PangoFontFamily **families; GList *family_list = NULL; int i; - + pango_context_list_families (context, &families, &n_families); qsort (families, n_families, sizeof(char *), cmp_families); @@ -578,7 +578,7 @@ make_families_menu () family_list = g_list_prepend (family_list, pango_font_family_get_name (families[i])); family_list = g_list_reverse (family_list); - + combo = gtk_combo_new (); gtk_combo_set_popdown_strings (GTK_COMBO (combo), family_list); gtk_combo_set_value_in_list (GTK_COMBO (combo), TRUE, FALSE); @@ -588,7 +588,7 @@ make_families_menu () gtk_signal_connect (GTK_OBJECT (GTK_COMBO (combo)->entry), "changed", GTK_SIGNAL_FUNC (set_family), NULL); - + g_list_free (family_list); return combo; @@ -604,15 +604,15 @@ make_font_selector (void) GtkWidget *option_menu; GtkWidget *spin_button; GtkAdjustment *adj; - + hbox = gtk_hbox_new (FALSE, 4); - + util_hbox = gtk_hbox_new (FALSE, 2); label = gtk_label_new ("Family:"); gtk_box_pack_start (GTK_BOX (util_hbox), label, FALSE, FALSE, 0); option_menu = make_families_menu (); gtk_box_pack_start (GTK_BOX (util_hbox), option_menu, FALSE, FALSE, 0); - + gtk_box_pack_start (GTK_BOX (hbox), util_hbox, FALSE, FALSE, 0); util_hbox = gtk_hbox_new (FALSE, 2); @@ -620,7 +620,7 @@ make_font_selector (void) gtk_box_pack_start (GTK_BOX (util_hbox), label, FALSE, FALSE, 0); option_menu = make_styles_combo (); gtk_box_pack_start (GTK_BOX (util_hbox), option_menu, FALSE, FALSE, 0); - + gtk_box_pack_start (GTK_BOX (hbox), util_hbox, FALSE, FALSE, 0); util_hbox = gtk_hbox_new (FALSE, 2); @@ -642,11 +642,11 @@ make_font_selector (void) gtk_signal_connect (GTK_OBJECT (adj), "value_changed", GTK_SIGNAL_FUNC (font_size_changed), NULL); - + return hbox; } -int +int main (int argc, char **argv) { char *text; @@ -657,7 +657,7 @@ main (int argc, char **argv) GtkWidget *checkbutton; gtk_init (&argc, &argv); - + if (argc != 2) { fprintf (stderr, "Usage: %s FILE\n", g_get_prgname ()); @@ -702,13 +702,13 @@ main (int argc, char **argv) hbox = make_font_selector (); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); - + scrollwin = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrollwin), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); - + gtk_box_pack_start (GTK_BOX (vbox), scrollwin, TRUE, TRUE, 0); - + layout = gtk_layout_new (NULL, NULL); gtk_widget_set_events (layout, GDK_BUTTON_PRESS_MASK); gtk_widget_set_app_paintable (layout, TRUE); @@ -743,6 +743,6 @@ main (int argc, char **argv) gtk_widget_show_all (window); gtk_main (); - + return 0; } diff --git a/pango-view/viewer-x.c b/pango-view/viewer-x.c index 19fb8f2e..95724d86 100644 --- a/pango-view/viewer-x.c +++ b/pango-view/viewer-x.c @@ -49,7 +49,7 @@ x_view_create (const PangoViewer *klass) return instance; } -void +void x_view_destroy (gpointer instance) { XViewer *x = (XViewer *)instance; @@ -73,7 +73,7 @@ x_view_create_surface (gpointer instance, return (gpointer) pixmap; } -void +void x_view_destroy_surface (gpointer instance, gpointer surface) { @@ -102,7 +102,7 @@ update (Display *display, extents.x, extents.y); XFreeGC (display, gc); - + XDestroyRegion (*update_region); *update_region = NULL; } @@ -141,17 +141,17 @@ x_view_create_window (gpointer instance, bg, bg); XSelectInput (x->display, window, ExposureMask | KeyPressMask); - + XMapWindow (x->display, window); XmbSetWMProperties (x->display, window, title, NULL, NULL, 0, NULL, NULL, NULL); - + memset ((char *)&size_hints, 0, sizeof (XSizeHints)); size_hints.flags = PSize | PMaxSize; size_hints.width = width; size_hints.height = height; /* for compat only */ size_hints.max_width = width; size_hints.max_height = height; - + XSetWMNormalHints (x->display, window, &size_hints); return (gpointer) window; @@ -203,7 +203,7 @@ x_view_display (gpointer instance, { if (!XPending (x->display) && update_region) update (x->display, pixmap, window, &update_region); - + XNextEvent (x->display, &xev); switch (xev.xany.type) { case KeyPress: diff --git a/pango-view/viewer-x.h b/pango-view/viewer-x.h index 71c1279e..e9e965be 100644 --- a/pango-view/viewer-x.h +++ b/pango-view/viewer-x.h @@ -29,7 +29,7 @@ #include "viewer.h" -typedef struct +typedef struct { Display *display; int screen; |