Commit 79d45ab8 authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

Formatting fixes from multihead brnach. [ mostly foo(bar) => foo (bar) ]

Thu Jul 12 13:43:27 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkclist.c gtk/gtkcolorsel.c gtk/gtkcombo.c
	  gtk/gtkctree.c gtk/gtkcurve.c gtk/gtkentry.c
	  gtk/gtkfontsel.c gtk/gtkhandlebox.c
	  gtk/gtkimcontextsimple.c gtk/gtkmain.c gtk/gtkmenu.c
	  gtk/gtkmenuitem.c gtk/gtkoptionmenu.c gtk/gtkpixmap.c
	  gtk/gtkselection.c gtk/gtktextdisplay.c gtk/gtktextview.c
	  gtk/gtktooltips.c gtk/gtkwidget.c gtk/gtkwindow.c:
	Formatting fixes from multihead brnach. [ mostly foo(bar) => foo (bar) ]
parent eb1dbcd4
Thu Jul 12 13:43:27 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c gtk/gtkcolorsel.c gtk/gtkcombo.c
gtk/gtkctree.c gtk/gtkcurve.c gtk/gtkentry.c
gtk/gtkfontsel.c gtk/gtkhandlebox.c
gtk/gtkimcontextsimple.c gtk/gtkmain.c gtk/gtkmenu.c
gtk/gtkmenuitem.c gtk/gtkoptionmenu.c gtk/gtkpixmap.c
gtk/gtkselection.c gtk/gtktextdisplay.c gtk/gtktextview.c
gtk/gtktooltips.c gtk/gtkwidget.c gtk/gtkwindow.c:
Formatting fixes from multihead brnach. [ mostly foo(bar) => foo (bar) ]
2001-07-09 Peter Williams <peterw@ximian.com>
* gtk/Makefile.am ($(srcdir)/stamp-gtk.defs): Add a cd $(srcdir)
......
Thu Jul 12 13:43:27 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c gtk/gtkcolorsel.c gtk/gtkcombo.c
gtk/gtkctree.c gtk/gtkcurve.c gtk/gtkentry.c
gtk/gtkfontsel.c gtk/gtkhandlebox.c
gtk/gtkimcontextsimple.c gtk/gtkmain.c gtk/gtkmenu.c
gtk/gtkmenuitem.c gtk/gtkoptionmenu.c gtk/gtkpixmap.c
gtk/gtkselection.c gtk/gtktextdisplay.c gtk/gtktextview.c
gtk/gtktooltips.c gtk/gtkwidget.c gtk/gtkwindow.c:
Formatting fixes from multihead brnach. [ mostly foo(bar) => foo (bar) ]
2001-07-09 Peter Williams <peterw@ximian.com>
* gtk/Makefile.am ($(srcdir)/stamp-gtk.defs): Add a cd $(srcdir)
......
Thu Jul 12 13:43:27 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c gtk/gtkcolorsel.c gtk/gtkcombo.c
gtk/gtkctree.c gtk/gtkcurve.c gtk/gtkentry.c
gtk/gtkfontsel.c gtk/gtkhandlebox.c
gtk/gtkimcontextsimple.c gtk/gtkmain.c gtk/gtkmenu.c
gtk/gtkmenuitem.c gtk/gtkoptionmenu.c gtk/gtkpixmap.c
gtk/gtkselection.c gtk/gtktextdisplay.c gtk/gtktextview.c
gtk/gtktooltips.c gtk/gtkwidget.c gtk/gtkwindow.c:
Formatting fixes from multihead brnach. [ mostly foo(bar) => foo (bar) ]
2001-07-09 Peter Williams <peterw@ximian.com>
* gtk/Makefile.am ($(srcdir)/stamp-gtk.defs): Add a cd $(srcdir)
......
Thu Jul 12 13:43:27 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c gtk/gtkcolorsel.c gtk/gtkcombo.c
gtk/gtkctree.c gtk/gtkcurve.c gtk/gtkentry.c
gtk/gtkfontsel.c gtk/gtkhandlebox.c
gtk/gtkimcontextsimple.c gtk/gtkmain.c gtk/gtkmenu.c
gtk/gtkmenuitem.c gtk/gtkoptionmenu.c gtk/gtkpixmap.c
gtk/gtkselection.c gtk/gtktextdisplay.c gtk/gtktextview.c
gtk/gtktooltips.c gtk/gtkwidget.c gtk/gtkwindow.c:
Formatting fixes from multihead brnach. [ mostly foo(bar) => foo (bar) ]
2001-07-09 Peter Williams <peterw@ximian.com>
* gtk/Makefile.am ($(srcdir)/stamp-gtk.defs): Add a cd $(srcdir)
......
Thu Jul 12 13:43:27 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c gtk/gtkcolorsel.c gtk/gtkcombo.c
gtk/gtkctree.c gtk/gtkcurve.c gtk/gtkentry.c
gtk/gtkfontsel.c gtk/gtkhandlebox.c
gtk/gtkimcontextsimple.c gtk/gtkmain.c gtk/gtkmenu.c
gtk/gtkmenuitem.c gtk/gtkoptionmenu.c gtk/gtkpixmap.c
gtk/gtkselection.c gtk/gtktextdisplay.c gtk/gtktextview.c
gtk/gtktooltips.c gtk/gtkwidget.c gtk/gtkwindow.c:
Formatting fixes from multihead brnach. [ mostly foo(bar) => foo (bar) ]
2001-07-09 Peter Williams <peterw@ximian.com>
* gtk/Makefile.am ($(srcdir)/stamp-gtk.defs): Add a cd $(srcdir)
......
Thu Jul 12 13:43:27 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c gtk/gtkcolorsel.c gtk/gtkcombo.c
gtk/gtkctree.c gtk/gtkcurve.c gtk/gtkentry.c
gtk/gtkfontsel.c gtk/gtkhandlebox.c
gtk/gtkimcontextsimple.c gtk/gtkmain.c gtk/gtkmenu.c
gtk/gtkmenuitem.c gtk/gtkoptionmenu.c gtk/gtkpixmap.c
gtk/gtkselection.c gtk/gtktextdisplay.c gtk/gtktextview.c
gtk/gtktooltips.c gtk/gtkwidget.c gtk/gtkwindow.c:
Formatting fixes from multihead brnach. [ mostly foo(bar) => foo (bar) ]
2001-07-09 Peter Williams <peterw@ximian.com>
* gtk/Makefile.am ($(srcdir)/stamp-gtk.defs): Add a cd $(srcdir)
......
Thu Jul 12 13:43:27 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c gtk/gtkcolorsel.c gtk/gtkcombo.c
gtk/gtkctree.c gtk/gtkcurve.c gtk/gtkentry.c
gtk/gtkfontsel.c gtk/gtkhandlebox.c
gtk/gtkimcontextsimple.c gtk/gtkmain.c gtk/gtkmenu.c
gtk/gtkmenuitem.c gtk/gtkoptionmenu.c gtk/gtkpixmap.c
gtk/gtkselection.c gtk/gtktextdisplay.c gtk/gtktextview.c
gtk/gtktooltips.c gtk/gtkwidget.c gtk/gtkwindow.c:
Formatting fixes from multihead brnach. [ mostly foo(bar) => foo (bar) ]
2001-07-09 Peter Williams <peterw@ximian.com>
* gtk/Makefile.am ($(srcdir)/stamp-gtk.defs): Add a cd $(srcdir)
......
......@@ -1721,7 +1721,7 @@ gtk_clist_set_column_auto_resize (GtkCList *clist,
if (auto_resize)
{
clist->column[column].resizeable = FALSE;
if (!GTK_CLIST_AUTO_RESIZE_BLOCKED(clist))
if (!GTK_CLIST_AUTO_RESIZE_BLOCKED (clist))
{
gint width;
......@@ -1873,7 +1873,7 @@ column_auto_resize (GtkCList *clist,
GtkRequisition requisition;
if (!clist->column[column].auto_resize ||
GTK_CLIST_AUTO_RESIZE_BLOCKED(clist))
GTK_CLIST_AUTO_RESIZE_BLOCKED (clist))
return;
if (clist_row)
......@@ -2470,7 +2470,7 @@ gtk_clist_set_shift (GtkCList *clist,
clist_row = ROW_ELEMENT (clist, row)->data;
if (clist->column[column].auto_resize &&
!GTK_CLIST_AUTO_RESIZE_BLOCKED(clist))
!GTK_CLIST_AUTO_RESIZE_BLOCKED (clist))
GTK_CLIST_GET_CLASS (clist)->cell_size_request (clist, clist_row,
column, &requisition);
......@@ -2507,7 +2507,7 @@ set_cell_contents (GtkCList *clist,
g_return_if_fail (clist_row != NULL);
if (clist->column[column].auto_resize &&
!GTK_CLIST_AUTO_RESIZE_BLOCKED(clist))
!GTK_CLIST_AUTO_RESIZE_BLOCKED (clist))
GTK_CLIST_GET_CLASS (clist)->cell_size_request (clist, clist_row,
column, &requisition);
......@@ -2571,7 +2571,7 @@ set_cell_contents (GtkCList *clist,
}
if (clist->column[column].auto_resize &&
!GTK_CLIST_AUTO_RESIZE_BLOCKED(clist))
!GTK_CLIST_AUTO_RESIZE_BLOCKED (clist))
column_auto_resize (clist, clist_row, column, requisition.width);
if (old_text)
......@@ -3345,7 +3345,7 @@ gtk_clist_set_cell_style (GtkCList *clist,
return;
if (clist->column[column].auto_resize &&
!GTK_CLIST_AUTO_RESIZE_BLOCKED(clist))
!GTK_CLIST_AUTO_RESIZE_BLOCKED (clist))
GTK_CLIST_GET_CLASS (clist)->cell_size_request (clist, clist_row,
column, &requisition);
......@@ -3419,7 +3419,7 @@ gtk_clist_set_row_style (GtkCList *clist,
old_width = g_new (gint, clist->columns);
if (!GTK_CLIST_AUTO_RESIZE_BLOCKED(clist))
if (!GTK_CLIST_AUTO_RESIZE_BLOCKED (clist))
{
for (i = 0; i < clist->columns; i++)
if (clist->column[i].auto_resize)
......@@ -3448,7 +3448,7 @@ gtk_clist_set_row_style (GtkCList *clist,
clist->clist_window);
}
if (GTK_CLIST_AUTO_RESIZE_BLOCKED(clist))
if (GTK_CLIST_AUTO_RESIZE_BLOCKED (clist))
for (i = 0; i < clist->columns; i++)
column_auto_resize (clist, clist_row, i, old_width[i]);
......@@ -4917,7 +4917,7 @@ gtk_clist_style_set (GtkWidget *widget,
gtk_clist_set_row_height (clist, 0);
/* Column widths */
if (!GTK_CLIST_AUTO_RESIZE_BLOCKED(clist))
if (!GTK_CLIST_AUTO_RESIZE_BLOCKED (clist))
{
gint width;
gint i;
......@@ -7066,7 +7066,7 @@ move_horizontal (GtkCList *clist,
value = CLAMP (clist->hadjustment->value + diff, 0.0,
clist->hadjustment->upper - clist->hadjustment->page_size);
gtk_adjustment_set_value(clist->hadjustment, value);
gtk_adjustment_set_value (clist->hadjustment, value);
}
static void
......@@ -7086,7 +7086,7 @@ move_vertical (GtkCList *clist,
if (value + clist->vadjustment->page_size > clist->vadjustment->upper)
value = clist->vadjustment->upper - clist->vadjustment->page_size;
gtk_adjustment_set_value(clist->vadjustment, value);
gtk_adjustment_set_value (clist->vadjustment, value);
}
static gint
......
......@@ -401,7 +401,7 @@ color_sample_draw_sample (GtkColorSelection *colorsel, int which)
wid = da->allocation.width;
heig = da->allocation.height;
buf = g_new(guchar, 3 * wid * heig);
buf = g_new (guchar, 3 * wid * heig);
#if 0
i = COLORSEL_RED;
......@@ -439,13 +439,13 @@ color_sample_draw_sample (GtkColorSelection *colorsel, int which)
}
}
gdk_draw_rgb_image(da->window,
da->style->black_gc,
0, 0,
wid, heig,
GDK_RGB_DITHER_NORMAL,
buf,
3*wid);
gdk_draw_rgb_image (da->window,
da->style->black_gc,
0, 0,
wid, heig,
GDK_RGB_DITHER_NORMAL,
buf,
3*wid);
g_free (buf);
......@@ -460,14 +460,18 @@ color_sample_draw_samples (GtkColorSelection *colorsel)
}
static void
color_old_sample_expose(GtkWidget* da, GdkEventExpose* event, GtkColorSelection *colorsel)
color_old_sample_expose (GtkWidget *da,
GdkEventExpose *event,
GtkColorSelection *colorsel)
{
color_sample_draw_sample (colorsel, 0);
}
static void
color_cur_sample_expose(GtkWidget* da, GdkEventExpose* event, GtkColorSelection *colorsel)
color_cur_sample_expose (GtkWidget *da,
GdkEventExpose *event,
GtkColorSelection *colorsel)
{
color_sample_draw_sample (colorsel, 1);
}
......
......@@ -198,7 +198,7 @@ gtk_combo_entry_key_press (GtkEntry * entry, GdkEventKey * event, GtkCombo * com
pos = gtk_editable_get_position (editable);
prefix = gtk_editable_get_chars (editable, 0, pos);
g_completion_complete(cmpl, prefix, &nprefix);
g_completion_complete (cmpl, prefix, &nprefix);
if (nprefix && strlen (nprefix) > strlen (prefix))
{
......@@ -384,7 +384,7 @@ gtk_combo_get_pos (GtkCombo * combo, gint * x, gint * y, gint * height, gint * w
gint old_height;
gint old_width;
widget = GTK_WIDGET(combo);
widget = GTK_WIDGET (combo);
popup = GTK_SCROLLED_WINDOW (combo->popup);
popwin = GTK_BIN (combo->popwin);
......@@ -775,7 +775,7 @@ gtk_combo_init (GtkCombo * combo)
(GtkSignalFunc) gtk_combo_button_release, combo);*/
gtk_signal_connect (GTK_OBJECT (combo->button), "leave_notify_event",
(GtkSignalFunc) gtk_combo_popup_button_leave, combo);
/*gtk_signal_connect(GTK_OBJECT(combo->button), "clicked",
/*gtk_signal_connect (GTK_OBJECT (combo->button), "clicked",
(GtkSignalFunc)prelight_bug, combo); */
combo->popwin = gtk_window_new (GTK_WINDOW_POPUP);
......@@ -815,7 +815,7 @@ gtk_combo_init (GtkCombo * combo)
*/
gtk_widget_set_events (combo->list, GDK_ENTER_NOTIFY_MASK);
gtk_list_set_selection_mode(GTK_LIST(combo->list), GTK_SELECTION_BROWSE);
gtk_list_set_selection_mode (GTK_LIST(combo->list), GTK_SELECTION_BROWSE);
gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (combo->popup), combo->list);
gtk_container_set_focus_vadjustment (GTK_CONTAINER (combo->list),
gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (combo->popup)));
......@@ -963,7 +963,7 @@ gtk_combo_set_item_string (GtkCombo * combo, GtkItem * item, const gchar * item_
}
if (item_value)
{
val = g_strdup(item_value);
val = g_strdup (item_value);
gtk_object_set_data (GTK_OBJECT (item), gtk_combo_string_key, val);
if (!connected)
gtk_signal_connect (GTK_OBJECT (item), "destroy",
......@@ -1011,7 +1011,7 @@ gtk_combo_disable_activate (GtkCombo* combo)
g_return_if_fail (GTK_IS_COMBO (combo));
if ( combo->activate_id ) {
gtk_signal_disconnect(GTK_OBJECT(combo->entry), combo->activate_id);
gtk_signal_disconnect (GTK_OBJECT(combo->entry), combo->activate_id);
combo->activate_id = 0;
}
}
......
......@@ -3571,7 +3571,7 @@ ctree_is_hot_spot (GtkCTree *ctree,
tree_row = GTK_CTREE_ROW (node);
cell = GTK_CELL_PIXTEXT(tree_row->row.cell[ctree->tree_column]);
cell = GTK_CELL_PIXTEXT (tree_row->row.cell[ctree->tree_column]);
yu = (ROW_TOP_YPIXEL (clist, row) + (clist->row_height - PM_SIZE) / 2 -
(clist->row_height - 1) % 2);
......@@ -4144,7 +4144,7 @@ gtk_ctree_find_node_ptr (GtkCTree *ctree,
g_return_val_if_fail (ctree_row != NULL, FALSE);
if (ctree_row->parent)
node = GTK_CTREE_ROW(ctree_row->parent)->children;
node = GTK_CTREE_ROW (ctree_row->parent)->children;
else
node = GTK_CTREE_NODE (GTK_CLIST (ctree)->row_list);
......@@ -4671,7 +4671,7 @@ gtk_ctree_node_set_text (GtkCTree *ctree,
clist = GTK_CLIST (ctree);
GTK_CLIST_GET_CLASS (clist)->set_cell_contents
(clist, &(GTK_CTREE_ROW(node)->row), column, GTK_CELL_TEXT,
(clist, &(GTK_CTREE_ROW (node)->row), column, GTK_CELL_TEXT,
text, 0, NULL, NULL);
tree_draw_node (ctree, node);
......@@ -4773,7 +4773,7 @@ gtk_ctree_set_node_info (GtkCTree *ctree,
while (work)
{
ptr = work;
work = GTK_CTREE_ROW(work)->sibling;
work = GTK_CTREE_ROW (work)->sibling;
gtk_ctree_remove_node (ctree, ptr);
}
}
......@@ -4952,7 +4952,7 @@ gtk_ctree_node_get_pixmap (GtkCTree *ctree,
return FALSE;
if (pixmap)
*pixmap = GTK_CELL_PIXMAP (GTK_CTREE_ROW(node)->row.cell[column])->pixmap;
*pixmap = GTK_CELL_PIXMAP (GTK_CTREE_ROW (node)->row.cell[column])->pixmap;
if (mask)
*mask = GTK_CELL_PIXMAP (GTK_CTREE_ROW (node)->row.cell[column])->mask;
......@@ -5884,7 +5884,7 @@ check_drag (GtkCTree *ctree,
ctree->drag_compare (ctree,
drag_source,
GTK_CTREE_ROW (drag_target)->parent,
GTK_CTREE_ROW(drag_target)->sibling));
GTK_CTREE_ROW (drag_target)->sibling));
break;
case GTK_CLIST_DRAG_BEFORE:
if (GTK_CTREE_ROW (drag_source)->sibling != drag_target)
......
......@@ -383,7 +383,7 @@ gtk_curve_draw (GtkCurve *c, gint width, gint height)
/* clear the pixmap: */
gtk_paint_flat_box (style, c->pixmap, GTK_STATE_NORMAL, GTK_SHADOW_NONE,
NULL, GTK_WIDGET(c), "curve_bg",
NULL, GTK_WIDGET (c), "curve_bg",
0, 0, width + RADIUS * 2, height + RADIUS * 2);
/* draw the grid lines: (XXX make more meaningful) */
for (i = 0; i < 5; i++)
......@@ -675,8 +675,8 @@ gtk_curve_set_curve_type (GtkCurve *c, GtkCurveType new_type)
{
gint width, height;
width = GTK_WIDGET(c)->allocation.width - RADIUS * 2;
height = GTK_WIDGET(c)->allocation.height - RADIUS * 2;
width = GTK_WIDGET (c)->allocation.width - RADIUS * 2;
height = GTK_WIDGET (c)->allocation.height - RADIUS * 2;
if (new_type == GTK_CURVE_TYPE_FREE)
{
......
......@@ -3145,8 +3145,8 @@ gtk_entry_get_invisible_char (GtkEntry *entry)
}
void
gtk_entry_set_editable(GtkEntry *entry,
gboolean editable)
gtk_entry_set_editable (GtkEntry *entry,
gboolean editable)
{
g_return_if_fail (entry != NULL);
g_return_if_fail (GTK_IS_ENTRY (entry));
......
......@@ -136,19 +136,19 @@ static void gtk_font_selection_update_preview (GtkFontSelection *fs);
static void gtk_font_selection_dialog_class_init (GtkFontSelectionDialogClass *klass);
static void gtk_font_selection_dialog_init (GtkFontSelectionDialog *fontseldiag);
static gint gtk_font_selection_dialog_on_configure(GtkWidget *widget,
GdkEventConfigure *event,
GtkFontSelectionDialog *fsd);
static gint gtk_font_selection_dialog_on_configure (GtkWidget *widget,
GdkEventConfigure *event,
GtkFontSelectionDialog *fsd);
static GtkWindowClass *font_selection_parent_class = NULL;
static GtkVBoxClass *font_selection_dialog_parent_class = NULL;
GtkType
gtk_font_selection_get_type()
gtk_font_selection_get_type ()
{
static GtkType font_selection_type = 0;
if(!font_selection_type)
if (!font_selection_type)
{
static const GtkTypeInfo fontsel_type_info =
{
......@@ -170,7 +170,7 @@ gtk_font_selection_get_type()
}
static void
gtk_font_selection_class_init(GtkFontSelectionClass *klass)
gtk_font_selection_class_init (GtkFontSelectionClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
......@@ -255,7 +255,7 @@ static void gtk_font_selection_get_property (GObject *object,
static void
gtk_font_selection_init(GtkFontSelection *fontsel)
gtk_font_selection_init (GtkFontSelection *fontsel)
{
GtkWidget *scrolled_win;
GtkWidget *text_frame;
......@@ -267,18 +267,18 @@ gtk_font_selection_init(GtkFontSelection *fontsel)
/* Create the table of font, style & size. */
table = gtk_table_new (3, 3, FALSE);
gtk_widget_show (table);
gtk_table_set_col_spacings(GTK_TABLE(table), 8);
gtk_table_set_col_spacings (GTK_TABLE (table), 8);
gtk_box_pack_start (GTK_BOX (fontsel), table, TRUE, TRUE, 0);
fontsel->font_entry = gtk_entry_new ();
gtk_entry_set_editable(GTK_ENTRY(fontsel->font_entry), FALSE);
gtk_entry_set_editable (GTK_ENTRY (fontsel->font_entry), FALSE);
gtk_widget_set_usize (fontsel->font_entry, 20, -1);
gtk_widget_show (fontsel->font_entry);
gtk_table_attach (GTK_TABLE (table), fontsel->font_entry, 0, 1, 1, 2,
GTK_FILL, 0, 0, 0);
fontsel->font_style_entry = gtk_entry_new ();
gtk_entry_set_editable (GTK_ENTRY(fontsel->font_style_entry), FALSE);
gtk_entry_set_editable (GTK_ENTRY (fontsel->font_style_entry), FALSE);
gtk_widget_set_usize (fontsel->font_style_entry, 20, -1);
gtk_widget_show (fontsel->font_style_entry);
gtk_table_attach (GTK_TABLE (table), fontsel->font_style_entry, 1, 2, 1, 2,
......@@ -325,8 +325,8 @@ gtk_font_selection_init(GtkFontSelection *fontsel)
gtk_container_add (GTK_CONTAINER (scrolled_win), fontsel->font_clist);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win),
GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
gtk_widget_show(fontsel->font_clist);
gtk_widget_show(scrolled_win);
gtk_widget_show (fontsel->font_clist);
gtk_widget_show (scrolled_win);
gtk_table_attach (GTK_TABLE (table), scrolled_win, 0, 1, 2, 3,
GTK_EXPAND | GTK_FILL,
......@@ -341,15 +341,15 @@ gtk_font_selection_init(GtkFontSelection *fontsel)
gtk_container_add (GTK_CONTAINER (scrolled_win), fontsel->font_style_clist);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win),
GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
gtk_widget_show(fontsel->font_style_clist);
gtk_widget_show(scrolled_win);
gtk_widget_show (fontsel->font_style_clist);
gtk_widget_show (scrolled_win);
gtk_table_attach (GTK_TABLE (table), scrolled_win, 1, 2, 2, 3,
GTK_EXPAND | GTK_FILL,
GTK_EXPAND | GTK_FILL, 0, 0);
fontsel->size_clist = gtk_clist_new (1);
gtk_clist_column_titles_hide (GTK_CLIST(fontsel->size_clist));
gtk_clist_set_column_width (GTK_CLIST(fontsel->size_clist), 0, 20);
gtk_clist_column_titles_hide (GTK_CLIST (fontsel->size_clist));
gtk_clist_set_column_width (GTK_CLIST (fontsel->size_clist), 0, 20);
scrolled_win = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_set_usize (scrolled_win, FONT_SIZE_LIST_WIDTH, -1);
gtk_container_add (GTK_CONTAINER (scrolled_win), fontsel->size_clist);
......@@ -362,35 +362,35 @@ gtk_font_selection_init(GtkFontSelection *fontsel)
/* Insert the fonts. If there exist fonts with the same family but
different foundries, then the foundry name is appended in brackets. */
gtk_font_selection_show_available_fonts(fontsel);
gtk_font_selection_show_available_fonts (fontsel);
gtk_signal_connect (GTK_OBJECT (fontsel->font_clist), "select_row",
GTK_SIGNAL_FUNC(gtk_font_selection_select_font),
GTK_SIGNAL_FUNC (gtk_font_selection_select_font),
fontsel);
GTK_WIDGET_SET_FLAGS (fontsel->font_clist, GTK_CAN_FOCUS);
gtk_signal_connect_after (GTK_OBJECT (fontsel->font_clist), "map",
GTK_SIGNAL_FUNC(gtk_font_selection_scroll_on_map),
GTK_SIGNAL_FUNC (gtk_font_selection_scroll_on_map),
fontsel);
gtk_font_selection_show_available_styles (fontsel);
gtk_signal_connect (GTK_OBJECT (fontsel->font_style_clist), "select_row",
GTK_SIGNAL_FUNC(gtk_font_selection_select_style),
GTK_SIGNAL_FUNC (gtk_font_selection_select_style),
fontsel);
GTK_WIDGET_SET_FLAGS (fontsel->font_style_clist, GTK_CAN_FOCUS);
gtk_font_selection_show_available_sizes (fontsel);
gtk_signal_connect (GTK_OBJECT (fontsel->size_clist), "select_row",
GTK_SIGNAL_FUNC(gtk_font_selection_select_size),
GTK_SIGNAL_FUNC (gtk_font_selection_select_size),
fontsel);
GTK_WIDGET_SET_FLAGS (fontsel->size_clist, GTK_CAN_FOCUS);
/* create the text entry widget */
text_frame = gtk_frame_new (_("Preview:"));
gtk_widget_show (text_frame);
gtk_frame_set_shadow_type(GTK_FRAME(text_frame), GTK_SHADOW_ETCHED_IN);
gtk_frame_set_shadow_type (GTK_FRAME (text_frame), GTK_SHADOW_ETCHED_IN);
gtk_box_pack_start (GTK_BOX (fontsel), text_frame,
FALSE, TRUE, 0);
......@@ -413,7 +413,7 @@ gtk_font_selection_init(GtkFontSelection *fontsel)
}
GtkWidget *
gtk_font_selection_new()
gtk_font_selection_new ()
{
GtkFontSelection *fontsel;
......@@ -459,39 +459,39 @@ gtk_font_selection_scroll_on_map (GtkWidget *widget,
gint index;
#ifdef FONTSEL_DEBUG
g_message("In expose_list\n");
g_message ("In expose_list\n");
#endif
fontsel = GTK_FONT_SELECTION(data);
fontsel = GTK_FONT_SELECTION (data);
/* Try to scroll the font family clist to the selected item */
selection = GTK_CLIST(fontsel->font_clist)->selection;
selection = GTK_CLIST (fontsel->font_clist)->selection;
if (selection)
{
index = GPOINTER_TO_INT (selection->data);
if (gtk_clist_row_is_visible(GTK_CLIST(fontsel->font_clist), index)
if (gtk_clist_row_is_visible (GTK_CLIST (fontsel->font_clist), index)
!= GTK_VISIBILITY_FULL)
gtk_clist_moveto(GTK_CLIST(fontsel->font_clist), index, -1, 0.5, 0);
gtk_clist_moveto (GTK_CLIST (fontsel->font_clist), index, -1, 0.5, 0);
}
/* Try to scroll the font style clist to the selected item */
selection = GTK_CLIST(fontsel->font_style_clist)->selection;
selection = GTK_CLIST (fontsel->font_style_clist)->selection;
if (selection)
{
index = GPOINTER_TO_INT (selection->data);
if (gtk_clist_row_is_visible(GTK_CLIST(fontsel->font_style_clist), index)
if (gtk_clist_row_is_visible (GTK_CLIST (fontsel->font_style_clist), index)
!= GTK_VISIBILITY_FULL)
gtk_clist_moveto(GTK_CLIST(fontsel->font_style_clist), index, -1,
gtk_clist_moveto (GTK_CLIST (fontsel->font_style_clist), index, -1,
0.5, 0);
}
/* Try to scroll the font size clist to the selected item */
selection = GTK_CLIST(fontsel->size_clist)->selection;
selection = GTK_CLIST (fontsel->size_clist)->selection;
if (selection)
{
index = GPOINTER_TO_INT (selection->data);
if (gtk_clist_row_is_visible(GTK_CLIST(fontsel->size_clist), index)
if (gtk_clist_row_is_visible (GTK_CLIST (fontsel->size_clist), index)
!= GTK_VISIBILITY_FULL)
gtk_clist_moveto(GTK_CLIST(fontsel->size_clist), index, -1, 0.5, 0);
gtk_clist_moveto (GTK_CLIST (fontsel->size_clist), index, -1, 0.5, 0);
}
}
......@@ -541,7 +541,7 @@ gtk_font_selection_show_available_fonts (GtkFontSelection *fontsel)
pango_context_list_families (gtk_widget_get_pango_context (GTK_WIDGET (fontsel)),
&families, &n_families);
qsort (families, n_families, sizeof(char *), cmp_strings);
qsort (families, n_families, sizeof (char *), cmp_strings);
gtk_clist_freeze (GTK_CLIST (fontsel->font_clist));
gtk_clist_clear (GTK_CLIST (fontsel->font_clist));
......@@ -552,12 +552,12 @@ gtk_font_selection_show_available_fonts (GtkFontSelection *fontsel)
if (!strcasecmp (families[i], fontsel->font_desc->family_name))
{
gtk_clist_select_row (GTK_CLIST(fontsel->font_clist), i, 0);
gtk_entry_set_text(GTK_ENTRY(fontsel->font_entry), families[i]);
gtk_clist_select_row (GTK_CLIST (fontsel->font_clist), i, 0);
gtk_entry_set_text (GTK_ENTRY (fontsel->font_entry), families[i]);
}
}
gtk_clist_thaw (GTK_CLIST(fontsel->font_clist));
gtk_clist_thaw (GTK_CLIST (fontsel->font_clist));
pango_font_map_free_families (families, n_families);
}
......@@ -602,7 +602,7 @@ gtk_font_selection_show_available_styles (GtkFontSelection *fontsel)
pango_context_list_fonts (gtk_widget_get_pango_context (GTK_WIDGET (fontsel)),
fontsel->font_desc->family_name, &descs, &n_descs);
qsort (descs, n_descs, sizeof(PangoFontDescription *), font_description_sort_func);
qsort (descs, n_descs, sizeof (PangoFontDescription *), font_description_sort_func);
gtk_clist_freeze (GTK_CLIST (fontsel->font_style_clist));
gtk_clist_clear (GTK_CLIST (fontsel->font_style_clist));
......@@ -634,7 +634,7 @@ gtk_font_selection_show_available_styles (GtkFontSelection *fontsel)
gtk_entry_set_text (GTK_ENTRY (fontsel->font_style_entry), str);
}
gtk_clist_thaw (GTK_CLIST(fontsel->font_style_clist));
gtk_clist_thaw (GTK_CLIST (fontsel->font_style_clist));
pango_font_descriptions_free (descs, n_descs);
}
......@@ -646,16 +646,16 @@ gtk_font_selection_show_available_styles (GtkFontSelection *fontsel)
However, the interface is so easy to use now I'm not sure it's worth it.
Note: This will load a font. */
static void
gtk_font_selection_select_best_style(GtkFontSelection *fontsel,
gboolean use_first)
gtk_font_selection_select_best_style (GtkFontSelection *fontsel,
gboolean use_first)
{
gint best_row = 0;
gtk_clist_select_row(GTK_CLIST(fontsel->font_style_clist), best_row, 0);
if (gtk_clist_row_is_visible(GTK_CLIST(fontsel->font_style_clist), best_row)
gtk_clist_select_row (GTK_CLIST (fontsel->font_style_clist), best_row, 0);
if (gtk_clist_row_is_visible (GTK_CLIST (fontsel->font_style_clist), best_row)
!= GTK_VISIBILITY_FULL)
gtk_clist_moveto(GTK_CLIST(fontsel->font_style_clist), best_row, -1,
0.5, 0);
gtk_clist_moveto (GTK_CLIST (fontsel->font_style_clist), best_row, -1,
0.5, 0);
gtk_font_selection_show_available_sizes (fontsel);
gtk_font_selection_select_best_size (fontsel);
}
......@@ -711,16 +711,16 @@ gtk_font_selection_show_available_sizes (GtkFontSelection *fontsel)
for (i = 0; i < G_N_ELEMENTS (font_sizes); i++)
{
sprintf(buffer, "%i", font_sizes[i]);
sprintf (buffer, "%i", font_sizes[i]);
size = buffer;
gtk_clist_append (GTK_CLIST(fontsel->size_clist), &size);
gtk_clist_append (GTK_CLIST (fontsel->size_clist), &size);
if (font_sizes[i] * PANGO_SCALE == fontsel->font_desc->size)
gtk_clist_select_row(GTK_CLIST(fontsel->size_clist), i, 0);
gtk_clist_select_row (GTK_CLIST (fontsel->size_clist), i, 0);
}
gtk_clist_thaw (GTK_CLIST(fontsel->size_clist));
gtk_clist_thaw (GTK_CLIST (fontsel->size_clist));
sprintf (buffer, "%i", fontsel->font_desc->size / PANGO_SCALE);
gtk_entry_set_text (GTK_ENTRY(fontsel->size_entry), buffer);
gtk_entry_set_text (GTK_ENTRY (fontsel->size_entry), buffer);
}
static void
......@@ -768,7 +768,7 @@ gtk_font_selection_select_size (GtkWidget *w,
if (bevent && !GTK_WIDGET_HAS_FOCUS (w))
gtk_widget_grab_focus (w);
gtk_clist_get_text(GTK_CLIST(fontsel->size_clist), row, 0, &text);
gtk_clist_get_text (GTK_CLIST (fontsel->size_clist), row, 0, &text);
new_size = atoi (text) * PANGO_SCALE;
if (fontsel->font_desc->size != new_size)
......@@ -818,13 +818,13 @@ gtk_font_selection_update_preview (GtkFontSelection *fontsel)
new_height = CLAMP (preview_entry->requisition.height, INITIAL_PREVIEW_HEIGHT, MAX_PREVIEW_HEIGHT);
if (new_height > old_requisition.height || new_height < old_requisition.height - 30)
gtk_widget_set_usize(preview_entry, -1, new_height);
gtk_widget_set_usize (preview_entry, -1, new_height);
/* This sets the preview text, if it hasn't been set already. */
text = gtk_entry_get_text(GTK_ENTRY(preview_entry));
if (strlen(text) == 0)
gtk_entry_set_text(GTK_ENTRY(preview_entry), PREVIEW_TEXT);
gtk_entry_set_position(GTK_ENTRY(preview_entry), 0);
text = gtk_entry_get_text (GTK_ENTRY (preview_entry));
if (strlen (text) == 0)
gtk_entry_set_text (GTK_ENTRY (preview_entry), PREVIEW_TEXT);
gtk_entry_set_position (GTK_ENTRY (preview_entry), 0);
}
/*****************************************************************************
......@@ -965,17 +965,17 @@ gtk_font_selection_dialog_init (GtkFontSelectionDialog *fontseldiag)
fontseldiag->dialog_width = -1;
fontseldiag->auto_resize = TRUE;
gtk_widget_set_events(GTK_WIDGET(fontseldiag), GDK_STRUCTURE_MASK);
gtk_widget_set_events (GTK_WIDGET (fontseldiag), GDK_STRUCTURE_MASK);
gtk_signal_connect (GTK_OBJECT (fontseldiag), "configure_event",
(GtkSignalFunc) gtk_font_selection_dialog_on_configure,
fontseldiag);
gtk_container_set_border_width (GTK_CONTAINER (fontseldiag), 4);
gtk_window_set_policy(GTK_WINDOW(fontseldiag), FALSE, TRUE, TRUE);
gtk_window_set_policy (GTK_WINDOW (fontseldiag), FALSE, TRUE, TRUE);
fontseldiag->main_vbox = dialog->vbox;
fontseldiag->fontsel = gtk_font_selection_new();
fontseldiag->fontsel = gtk_font_selection_new ();
gtk_container_set_border_width (GTK_CONTAINER (fontseldiag->fontsel), 4);
gtk_widget_show (fontseldiag->fontsel);
gtk_box_pack_start (GTK_BOX (fontseldiag->main_vbox),
......@@ -1005,7 +1005,7 @@ gtk_font_selection_dialog_init (GtkFontSelectionDialog *fontseldiag)
}
GtkWidget*
gtk_font_selection_dialog_new (const gchar *title)
gtk_font_selection_dialog_new (const gchar *title)
{
GtkFontSelectionDialog *fontseldiag;
......@@ -1018,36 +1018,35 @@ gtk_font_selection_dialog_new (const gchar *title)
}
gchar*
gtk_font_selection_dialog_get_font_name (GtkFontSelectionDialog *fsd)
gtk_font_selection_dialog_get_font_name (GtkFontSelectionDialog *fsd)
{
return gtk_font_selection_get_font_name(GTK_FONT_SELECTION(fsd->fontsel));
return gtk_font_selection_get_font_name (GTK_FONT_SELECTION (fsd->fontsel));
}