From: Piotr S. <ps...@us...> - 2009-09-17 12:05:13
|
Update of /cvsroot/ayttm/ayttm/src/gtk In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv12682/src/gtk Modified Files: about_window.c gtk_tree_view_tooltip.c gtk_tree_view_tooltip.h gtkspell.c gtkspell.h gtkutils.c gtkutils.h html_text_buffer.c html_text_buffer.h Log Message: reformatted source code Index: about_window.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/src/gtk/about_window.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- about_window.c 3 Aug 2007 20:38:41 -0000 1.2 +++ about_window.c 17 Sep 2009 12:05:02 -0000 1.3 @@ -20,10 +20,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - */ + */ #include <assert.h> - + #include "intl.h" #include "ui_about_window.h" @@ -31,7 +31,6 @@ #include "pixmaps/ayttmlogo.xpm" - /* the one and only about window */ static GtkWidget *sAboutWindow = NULL; @@ -39,170 +38,177 @@ Functions */ -static void destroy_about( void ) +static void destroy_about(void) { - if ( sAboutWindow != NULL ) - gtk_widget_destroy( sAboutWindow ); + if (sAboutWindow != NULL) + gtk_widget_destroy(sAboutWindow); sAboutWindow = NULL; } -static GtkTable *sMakeDeveloperTable( int inNumDevelopers, const tDeveloperInfo *inDevInfo ) +static GtkTable *sMakeDeveloperTable(int inNumDevelopers, + const tDeveloperInfo *inDevInfo) { - GtkTable *table = GTK_TABLE( gtk_table_new( inNumDevelopers, 3, FALSE ) ); - GtkLabel *label = NULL; - int i = 0; - - - for ( i = 0; i < inNumDevelopers; i++ ) - { - label = GTK_LABEL( gtk_label_new( inDevInfo[i].m_name ) ); - gtk_misc_set_alignment( GTK_MISC( label ), 0.0, 0.5 ); - gtk_widget_show( GTK_WIDGET(label ) ); - gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, i, i+1, GTK_FILL, GTK_FILL, 10, 0 ); - - label = GTK_LABEL( gtk_label_new( inDevInfo[i].m_email ) ); - gtk_misc_set_alignment( GTK_MISC( label ), 0.0, 0.5 ); - gtk_widget_show( GTK_WIDGET( label ) ); - gtk_table_attach( table, GTK_WIDGET( label ), 1, 2, i, i+1, GTK_FILL, GTK_FILL, 10, 0 ); - - label = GTK_LABEL( gtk_label_new( inDevInfo[i].m_role ) ); - gtk_misc_set_alignment( GTK_MISC( label ), 0.0, 0.5 ); - gtk_widget_show( GTK_WIDGET( label ) ); - gtk_table_attach(table, GTK_WIDGET( label ), 2, 3, i, i+1, GTK_FILL, GTK_FILL, 10, 0 ); + GtkTable *table = GTK_TABLE(gtk_table_new(inNumDevelopers, 3, FALSE)); + GtkLabel *label = NULL; + int i = 0; + + for (i = 0; i < inNumDevelopers; i++) { + label = GTK_LABEL(gtk_label_new(inDevInfo[i].m_name)); + gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); + gtk_widget_show(GTK_WIDGET(label)); + gtk_table_attach(table, GTK_WIDGET(label), 0, 1, i, i + 1, + GTK_FILL, GTK_FILL, 10, 0); + + label = GTK_LABEL(gtk_label_new(inDevInfo[i].m_email)); + gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); + gtk_widget_show(GTK_WIDGET(label)); + gtk_table_attach(table, GTK_WIDGET(label), 1, 2, i, i + 1, + GTK_FILL, GTK_FILL, 10, 0); + + label = GTK_LABEL(gtk_label_new(inDevInfo[i].m_role)); + gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); + gtk_widget_show(GTK_WIDGET(label)); + gtk_table_attach(table, GTK_WIDGET(label), 2, 3, i, i + 1, + GTK_FILL, GTK_FILL, 10, 0); } - gtk_widget_show( GTK_WIDGET( table ) ); - - return( table ); -} + gtk_widget_show(GTK_WIDGET(table)); + return (table); +} -void ay_ui_about_window_create( const tAboutInfo *inAboutInfo ) +void ay_ui_about_window_create(const tAboutInfo *inAboutInfo) { - GtkWidget *logo = NULL; - GtkWidget *ok = NULL; - GtkLabel *label = NULL; - GtkTable *table = NULL; - GtkWidget *separator = NULL; - GtkBox *vbox = NULL; - GtkBox *vbox2 = NULL; - GtkStyle *style = NULL; - GdkPixbuf *pm = NULL; - GtkWidget *scroll = NULL; - + GtkWidget *logo = NULL; + GtkWidget *ok = NULL; + GtkLabel *label = NULL; + GtkTable *table = NULL; + GtkWidget *separator = NULL; + GtkBox *vbox = NULL; + GtkBox *vbox2 = NULL; + GtkStyle *style = NULL; + GdkPixbuf *pm = NULL; + GtkWidget *scroll = NULL; - if ( sAboutWindow != NULL ) - { + if (sAboutWindow != NULL) { gtk_widget_show(sAboutWindow); return; } - assert( inAboutInfo != NULL ); - + assert(inAboutInfo != NULL); + /* create the window and set some attributes */ - sAboutWindow = gtk_window_new( GTK_WINDOW_TOPLEVEL ); - gtk_widget_realize( sAboutWindow ); - gtk_window_set_position( GTK_WINDOW(sAboutWindow), GTK_WIN_POS_MOUSE ); - gtk_window_set_resizable( GTK_WINDOW(sAboutWindow), FALSE ); - gtk_window_set_title( GTK_WINDOW(sAboutWindow), _("About Ayttm") ); - gtk_container_set_border_width( GTK_CONTAINER(sAboutWindow), 5 ); + sAboutWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL); + gtk_widget_realize(sAboutWindow); + gtk_window_set_position(GTK_WINDOW(sAboutWindow), GTK_WIN_POS_MOUSE); + gtk_window_set_resizable(GTK_WINDOW(sAboutWindow), FALSE); + gtk_window_set_title(GTK_WINDOW(sAboutWindow), _("About Ayttm")); + gtk_container_set_border_width(GTK_CONTAINER(sAboutWindow), 5); - vbox = GTK_BOX( gtk_vbox_new(FALSE, 0) ); - gtk_widget_show( GTK_WIDGET(vbox) ); + vbox = GTK_BOX(gtk_vbox_new(FALSE, 0)); + gtk_widget_show(GTK_WIDGET(vbox)); /* logo */ - style = gtk_widget_get_style( sAboutWindow ); - pm = gdk_pixbuf_new_from_xpm_data( (const char **)ayttmlogo_xpm ); + style = gtk_widget_get_style(sAboutWindow); + pm = gdk_pixbuf_new_from_xpm_data((const char **)ayttmlogo_xpm); - logo = gtk_image_new_from_pixbuf( pm ); - gtk_box_pack_start( vbox, logo, FALSE, FALSE, 5 ); - gtk_widget_show( logo ); + logo = gtk_image_new_from_pixbuf(pm); + gtk_box_pack_start(vbox, logo, FALSE, FALSE, 5); + gtk_widget_show(logo); /* version */ - label = GTK_LABEL(gtk_label_new( inAboutInfo->m_version )); - gtk_widget_show( GTK_WIDGET(label) ); + label = GTK_LABEL(gtk_label_new(inAboutInfo->m_version)); + gtk_widget_show(GTK_WIDGET(label)); gtk_box_pack_start(vbox, GTK_WIDGET(label), FALSE, FALSE, 5); /* separator */ separator = gtk_hseparator_new(); - gtk_widget_show( separator ); - gtk_box_pack_start( vbox, separator, FALSE, FALSE, 5 ); + gtk_widget_show(separator); + gtk_box_pack_start(vbox, separator, FALSE, FALSE, 5); /* scroll */ - scroll = gtk_scrolled_window_new( NULL, NULL ); - gtk_widget_show( scroll ); - gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW(scroll), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC ); + scroll = gtk_scrolled_window_new(NULL, NULL); + gtk_widget_show(scroll); + gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll), + GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); - vbox2 = GTK_BOX( gtk_vbox_new(FALSE, 0) ); - gtk_widget_show( GTK_WIDGET(vbox2) ); + vbox2 = GTK_BOX(gtk_vbox_new(FALSE, 0)); + gtk_widget_show(GTK_WIDGET(vbox2)); /* text */ - label = GTK_LABEL( gtk_label_new( _("Ayttm is brought to you by:") ) ); - gtk_label_set_justify( label, GTK_JUSTIFY_LEFT ); - gtk_misc_set_alignment( GTK_MISC(label), 0.0, 0.5 ); - gtk_widget_show( GTK_WIDGET(label) ); - gtk_box_pack_start( vbox2, GTK_WIDGET(label), TRUE, TRUE, 5 ); + label = GTK_LABEL(gtk_label_new(_("Ayttm is brought to you by:"))); + gtk_label_set_justify(label, GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); + gtk_widget_show(GTK_WIDGET(label)); + gtk_box_pack_start(vbox2, GTK_WIDGET(label), TRUE, TRUE, 5); /* list of Ayttm developers */ - table = sMakeDeveloperTable( inAboutInfo->m_num_ay_developers, inAboutInfo->m_ay_developers ); - gtk_box_pack_start( vbox2, GTK_WIDGET(table), TRUE, TRUE, 5 ); + table = sMakeDeveloperTable(inAboutInfo->m_num_ay_developers, + inAboutInfo->m_ay_developers); + gtk_box_pack_start(vbox2, GTK_WIDGET(table), TRUE, TRUE, 5); /* separator */ separator = gtk_hseparator_new(); - gtk_widget_show( separator ); - gtk_box_pack_start( vbox2, separator, TRUE, TRUE, 5 ); + gtk_widget_show(separator); + gtk_box_pack_start(vbox2, separator, TRUE, TRUE, 5); /* text */ - label = GTK_LABEL( gtk_label_new( _("\"With a little help from\":") ) ); - gtk_label_set_justify( label, GTK_JUSTIFY_LEFT ); - gtk_misc_set_alignment( GTK_MISC(label), 0.0, 0.5 ); - gtk_widget_show( GTK_WIDGET(label) ); - gtk_box_pack_start( vbox2, GTK_WIDGET(label), TRUE, TRUE, 5 ); + label = GTK_LABEL(gtk_label_new(_("\"With a little help from\":"))); + gtk_label_set_justify(label, GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); + gtk_widget_show(GTK_WIDGET(label)); + gtk_box_pack_start(vbox2, GTK_WIDGET(label), TRUE, TRUE, 5); /* list of kudos to people who've helped us */ - table = sMakeDeveloperTable( inAboutInfo->m_num_ay_kudos, inAboutInfo->m_ay_kudos ); - gtk_box_pack_start( vbox2, GTK_WIDGET(table), TRUE, TRUE, 5 ); + table = sMakeDeveloperTable(inAboutInfo->m_num_ay_kudos, + inAboutInfo->m_ay_kudos); + gtk_box_pack_start(vbox2, GTK_WIDGET(table), TRUE, TRUE, 5); /* separator */ separator = gtk_hseparator_new(); - gtk_widget_show( separator ); - gtk_box_pack_start( vbox2, separator, TRUE, TRUE, 5 ); + gtk_widget_show(separator); + gtk_box_pack_start(vbox2, separator, TRUE, TRUE, 5); /* another separator */ separator = gtk_hseparator_new(); - gtk_widget_show( separator ); - gtk_box_pack_start( vbox2, separator, TRUE, TRUE, 5 ); - + gtk_widget_show(separator); + gtk_box_pack_start(vbox2, separator, TRUE, TRUE, 5); + /* text */ - label = GTK_LABEL( gtk_label_new( _("Ayttm is based on Everybuddy 0.4.3 which was brought to you by:") ) ); - gtk_label_set_justify( label, GTK_JUSTIFY_LEFT ); - gtk_misc_set_alignment( GTK_MISC(label), 0.0, 0.5 ); - gtk_widget_show( GTK_WIDGET(label) ); - gtk_box_pack_start( vbox2, GTK_WIDGET(label), TRUE, TRUE, 5 ); + label = GTK_LABEL(gtk_label_new(_ + ("Ayttm is based on Everybuddy 0.4.3 which was brought to you by:"))); + gtk_label_set_justify(label, GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); + gtk_widget_show(GTK_WIDGET(label)); + gtk_box_pack_start(vbox2, GTK_WIDGET(label), TRUE, TRUE, 5); /* list of Everybuddy developers */ - table = sMakeDeveloperTable( inAboutInfo->m_num_eb_developers, inAboutInfo->m_eb_developers ); - gtk_box_pack_start( vbox2, GTK_WIDGET(table), TRUE, TRUE, 5 ); + table = sMakeDeveloperTable(inAboutInfo->m_num_eb_developers, + inAboutInfo->m_eb_developers); + gtk_box_pack_start(vbox2, GTK_WIDGET(table), TRUE, TRUE, 5); - gtk_scrolled_window_add_with_viewport( GTK_SCROLLED_WINDOW(scroll), GTK_WIDGET(vbox2) ); + gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scroll), + GTK_WIDGET(vbox2)); - gtk_box_pack_start( vbox, GTK_WIDGET(scroll), TRUE, TRUE, 5 ); - - /* close button */ - ok = gtk_button_new_with_label( _("Close") ); - g_signal_connect_swapped( ok, "clicked", G_CALLBACK(destroy_about), sAboutWindow ); + gtk_box_pack_start(vbox, GTK_WIDGET(scroll), TRUE, TRUE, 5); - gtk_box_pack_start( vbox, ok, FALSE, FALSE, 0 ); - GTK_WIDGET_SET_FLAGS( ok, GTK_CAN_DEFAULT ); - gtk_widget_show( ok ); - - g_signal_connect_swapped(sAboutWindow, "destroy", G_CALLBACK(destroy_about), sAboutWindow); - - gtk_container_add( GTK_CONTAINER(sAboutWindow), GTK_WIDGET(vbox) ); - - gtk_widget_set_size_request( sAboutWindow, -1, 400 ); - gtk_widget_show( sAboutWindow ); - gtk_widget_grab_default( ok ); - gtk_widget_grab_focus( ok ); + /* close button */ + ok = gtk_button_new_with_label(_("Close")); + g_signal_connect_swapped(ok, "clicked", G_CALLBACK(destroy_about), + sAboutWindow); + + gtk_box_pack_start(vbox, ok, FALSE, FALSE, 0); + GTK_WIDGET_SET_FLAGS(ok, GTK_CAN_DEFAULT); + gtk_widget_show(ok); + + g_signal_connect_swapped(sAboutWindow, "destroy", + G_CALLBACK(destroy_about), sAboutWindow); + + gtk_container_add(GTK_CONTAINER(sAboutWindow), GTK_WIDGET(vbox)); + + gtk_widget_set_size_request(sAboutWindow, -1, 400); + gtk_widget_show(sAboutWindow); + gtk_widget_grab_default(ok); + gtk_widget_grab_focus(ok); } Index: gtk_tree_view_tooltip.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/src/gtk/gtk_tree_view_tooltip.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- gtk_tree_view_tooltip.c 24 Aug 2009 13:19:43 -0000 1.7 +++ gtk_tree_view_tooltip.c 17 Sep 2009 12:05:03 -0000 1.8 @@ -24,7 +24,8 @@ #include <gtk/gtk.h> /* Initialize the GtkTreeViewTooltipClass */ -static void gtk_tree_view_tooltip_class_init(GtkTreeViewTooltipClass *tooltipclass) +static void gtk_tree_view_tooltip_class_init(GtkTreeViewTooltipClass + *tooltipclass) { return; } @@ -32,42 +33,42 @@ /* Initialize a GtkTreeViewTooltip instance */ void gtk_tree_view_tooltip_init(GtkTreeViewTooltip *tooltip) { - tooltip->window = NULL; - tooltip->tip_icon = NULL; - tooltip->tip_title_label = NULL; - tooltip->tip_tiptext_label = NULL; - - tooltip->tip_flag_column = -1; - tooltip->icon_column = -1; - tooltip->title_column = -1; - tooltip->tiptext_column = -1; - tooltip->source = 0; - - tooltip->treeview = NULL; - tooltip->active_path = NULL; - tooltip->enable_tips = FALSE; + tooltip->window = NULL; + tooltip->tip_icon = NULL; + tooltip->tip_title_label = NULL; + tooltip->tip_tiptext_label = NULL; + + tooltip->tip_flag_column = -1; + tooltip->icon_column = -1; + tooltip->title_column = -1; + tooltip->tiptext_column = -1; + tooltip->source = 0; + + tooltip->treeview = NULL; + tooltip->active_path = NULL; + tooltip->enable_tips = FALSE; } /* Closes the tooltip window */ void gtk_tree_view_tooltip_reset(GtkTreeViewTooltip *tooltip) { - g_return_if_fail(tooltip!=NULL); + g_return_if_fail(tooltip != NULL); - if(tooltip->source) { + if (tooltip->source) { g_source_remove(tooltip->source); g_free(tooltip->data); tooltip->source = 0; } - if(tooltip->window && GTK_WIDGET_VISIBLE(tooltip->window)) + if (tooltip->window && GTK_WIDGET_VISIBLE(tooltip->window)) gtk_widget_destroy(tooltip->window); - tooltip->window = NULL; - tooltip->tip_icon = NULL; - tooltip->tip_title_label = NULL; - tooltip->tip_tiptext_label = NULL; + tooltip->window = NULL; + tooltip->tip_icon = NULL; + tooltip->tip_title_label = NULL; + tooltip->tip_tiptext_label = NULL; - tooltip->enable_tips = FALSE; + tooltip->enable_tips = FALSE; } /* Shows the tooltip window */ @@ -90,28 +91,32 @@ g_free(data); /* We don't need to re-create it if it already exists, just update it in that case */ - if(!tooltip->window) { + if (!tooltip->window) { hbox = gtk_hbox_new(FALSE, 0); vbox = gtk_vbox_new(FALSE, 0); - + iconwid = gtk_image_new_from_pixbuf(tooltip->tip_icon); gtk_widget_show(iconwid); - - gtk_box_pack_start(GTK_BOX(vbox), tooltip->tip_title_label, TRUE, FALSE, 2); - gtk_box_pack_end(GTK_BOX(vbox), tooltip->tip_tiptext_label, TRUE, FALSE, 2); - + + gtk_box_pack_start(GTK_BOX(vbox), tooltip->tip_title_label, + TRUE, FALSE, 2); + gtk_box_pack_end(GTK_BOX(vbox), tooltip->tip_tiptext_label, + TRUE, FALSE, 2); + gtk_widget_show(tooltip->tip_title_label); gtk_widget_show(tooltip->tip_tiptext_label); gtk_widget_show(vbox); - + gtk_box_pack_start(GTK_BOX(hbox), iconwid, FALSE, FALSE, 5); gtk_box_pack_end(GTK_BOX(hbox), vbox, TRUE, TRUE, 5); gtk_widget_show(hbox); tooltip->window = gtk_window_new(GTK_WINDOW_POPUP); - gtk_window_set_type_hint(GTK_WINDOW(tooltip->window), GDK_WINDOW_TYPE_HINT_TOOLTIP); + gtk_window_set_type_hint(GTK_WINDOW(tooltip->window), + GDK_WINDOW_TYPE_HINT_TOOLTIP); gtk_container_add(GTK_CONTAINER(tooltip->window), hbox); - gtk_container_set_border_width(GTK_CONTAINER(tooltip->window), 5); + gtk_container_set_border_width(GTK_CONTAINER(tooltip->window), + 5); gtk_window_set_resizable(GTK_WINDOW(tooltip->window), FALSE); } gtk_window_move(GTK_WINDOW(tooltip->window), x, y); @@ -124,14 +129,16 @@ } /* All the funny stuff happens here... showing and hiding of the tooltip and all that */ -static void treeview_tooltip_event_handler(GtkTreeView *treeview, GdkEvent *event, gpointer data) +static void treeview_tooltip_event_handler(GtkTreeView *treeview, + GdkEvent *event, gpointer data) { GtkTreeViewTooltip *tooltip = GTK_TREE_VIEW_TOOLTIP(data); - - if((tooltip->icon_column == -1 && tooltip->title_column == -1 && tooltip->tiptext_column == -1)) + + if ((tooltip->icon_column == -1 && tooltip->title_column == -1 + && tooltip->tiptext_column == -1)) return; - - switch(event->type) { + + switch (event->type) { case GDK_LEAVE_NOTIFY: case GDK_BUTTON_PRESS: case GDK_BUTTON_RELEASE: @@ -141,96 +148,109 @@ gtk_tree_view_tooltip_reset(tooltip); return; case GDK_MOTION_NOTIFY: - { - GtkTreePath *path; - gchar *title = NULL; - GdkPixbuf *icon = NULL; - gchar *tiptext = NULL; - GdkRectangle rect; - int x, y, wx, wy; - gboolean tips_enabled; - CoordData *cdata = NULL; - - GtkTreeIter iter; - GtkTreeModel *model = gtk_tree_view_get_model(treeview); - GdkEventMotion *eventmotion = (GdkEventMotion *)event; - - /* Are we over a valid row at all? */ - if(!gtk_tree_view_get_path_at_pos(treeview, - eventmotion->x, eventmotion->y, - &path, NULL, - NULL, NULL)) - { - return; - } - - /* Have we moved on to the next row? */ - if(tooltip->active_path && - !gtk_tree_path_compare(tooltip->active_path, path)) { - return; - } - - gtk_tree_view_tooltip_reset(tooltip); + GtkTreePath *path; + gchar *title = NULL; + GdkPixbuf *icon = NULL; + gchar *tiptext = NULL; + GdkRectangle rect; + int x, y, wx, wy; + gboolean tips_enabled; + CoordData *cdata = NULL; + + GtkTreeIter iter; + GtkTreeModel *model = gtk_tree_view_get_model(treeview); + GdkEventMotion *eventmotion = (GdkEventMotion *)event; + + /* Are we over a valid row at all? */ + if (!gtk_tree_view_get_path_at_pos(treeview, + eventmotion->x, eventmotion->y, + &path, NULL, NULL, NULL)) { + return; + } - gtk_tree_path_free(tooltip->active_path); - tooltip->active_path = gtk_tree_path_copy(path); - gtk_tree_path_free(path); - - gtk_tree_model_get_iter(model, &iter, tooltip->active_path); - if(tooltip->tip_flag_column!=-1) { - gtk_tree_model_get(model, &iter, - tooltip->tip_flag_column, &tips_enabled, -1); - - if(!tips_enabled) + /* Have we moved on to the next row? */ + if (tooltip->active_path && + !gtk_tree_path_compare(tooltip->active_path, + path)) { return; - } - if(tooltip->icon_column!=-1) { - gtk_tree_model_get(model, &iter, - tooltip->icon_column, &icon, -1); - tooltip->tip_icon = icon; - } - if(tooltip->title_column!=-1) { - gchar *markup; + } - gtk_tree_model_get(model, &iter, - tooltip->title_column, &title, -1); - - if(!tooltip->tip_title_label) - tooltip->tip_title_label = gtk_label_new(NULL); - - markup = g_markup_printf_escaped("<span size=\'large\'><b>%s</b></span>", title); - gtk_label_set_markup(GTK_LABEL(tooltip->tip_title_label), markup); - } - if(tooltip->tiptext_column!=-1) { - gtk_tree_model_get(model, &iter, - tooltip->tiptext_column, &tiptext, -1); - - if(!tooltip->tip_tiptext_label) { - tooltip->tip_tiptext_label = gtk_label_new(NULL); - gtk_label_set_line_wrap(GTK_LABEL(tooltip->tip_tiptext_label), TRUE); + gtk_tree_view_tooltip_reset(tooltip); + + gtk_tree_path_free(tooltip->active_path); + tooltip->active_path = gtk_tree_path_copy(path); + gtk_tree_path_free(path); + + gtk_tree_model_get_iter(model, &iter, + tooltip->active_path); + if (tooltip->tip_flag_column != -1) { + gtk_tree_model_get(model, &iter, + tooltip->tip_flag_column, &tips_enabled, + -1); + + if (!tips_enabled) + return; + } + if (tooltip->icon_column != -1) { + gtk_tree_model_get(model, &iter, + tooltip->icon_column, &icon, -1); + tooltip->tip_icon = icon; + } + if (tooltip->title_column != -1) { + gchar *markup; + + gtk_tree_model_get(model, &iter, + tooltip->title_column, &title, -1); + + if (!tooltip->tip_title_label) + tooltip->tip_title_label = + gtk_label_new(NULL); + + markup = g_markup_printf_escaped + ("<span size=\'large\'><b>%s</b></span>", + title); + gtk_label_set_markup(GTK_LABEL(tooltip-> + tip_title_label), markup); } - - gtk_label_set_markup(GTK_LABEL(tooltip->tip_tiptext_label), tiptext); + if (tooltip->tiptext_column != -1) { + gtk_tree_model_get(model, &iter, + tooltip->tiptext_column, &tiptext, -1); + + if (!tooltip->tip_tiptext_label) { + tooltip->tip_tiptext_label = + gtk_label_new(NULL); + gtk_label_set_line_wrap(GTK_LABEL + (tooltip->tip_tiptext_label), + TRUE); + } + + gtk_label_set_markup(GTK_LABEL(tooltip-> + tip_tiptext_label), tiptext); + } + + /* Now to get the coordinates of the popup */ + gtk_tree_view_get_cell_area(treeview, + tooltip->active_path, NULL, &rect); + gtk_tree_view_tree_to_widget_coords(treeview, rect.x, + rect.y, &wx, &wy); + + y = eventmotion->y_root + rect.height - eventmotion->y + + rect.y; + x = eventmotion->x_root - eventmotion->x + + rect.width / 2; + + cdata = g_new0(CoordData, 1); + cdata->tooltip = tooltip; + cdata->x = x; + cdata->y = y; + + tooltip->data = cdata; + + tooltip->source = + g_timeout_add(1000, tooltip_show_tip, cdata); + return; } - - /* Now to get the coordinates of the popup */ - gtk_tree_view_get_cell_area(treeview, tooltip->active_path, NULL, &rect); - gtk_tree_view_tree_to_widget_coords(treeview, rect.x, rect.y, &wx, &wy); - - y = eventmotion->y_root + rect.height - eventmotion->y + rect.y; - x = eventmotion->x_root - eventmotion->x + rect.width/2; - - cdata = g_new0(CoordData, 1); - cdata->tooltip = tooltip; - cdata->x = x; - cdata->y = y; - - tooltip->data = cdata; - - tooltip->source = g_timeout_add(1000, tooltip_show_tip, cdata); - return; - } default: return; @@ -244,16 +264,14 @@ gtk_tree_view_tooltip_reset(tooltip); } - /********* Public Functions **********/ -GType gtk_tree_view_tooltip_get_type (void) +GType gtk_tree_view_tooltip_get_type(void) { static GType treeview_tooltip_type = 0; - if( !treeview_tooltip_type ) { - static const GTypeInfo treeview_tooltip_info = - { + if (!treeview_tooltip_type) { + static const GTypeInfo treeview_tooltip_info = { sizeof(GtkTreeViewTooltipClass), NULL, NULL, @@ -266,24 +284,20 @@ }; treeview_tooltip_type = g_type_register_static(G_TYPE_OBJECT, - "GtkTreeViewTooltip", - &treeview_tooltip_info, - 0); + "GtkTreeViewTooltip", &treeview_tooltip_info, 0); } return treeview_tooltip_type; } - - GtkTreeViewTooltip *gtk_tree_view_tooltip_new(void) { - return GTK_TREE_VIEW_TOOLTIP( g_object_new(GTK_TREE_VIEW_TOOLTIP_TYPE, NULL) ); + return GTK_TREE_VIEW_TOOLTIP(g_object_new(GTK_TREE_VIEW_TOOLTIP_TYPE, + NULL)); } - - -GtkTreeViewTooltip *gtk_tree_view_tooltip_new_for_treeview(GtkTreeView *treeview) +GtkTreeViewTooltip *gtk_tree_view_tooltip_new_for_treeview(GtkTreeView + *treeview) { GtkTreeViewTooltip *tooltip = gtk_tree_view_tooltip_new(); gtk_tree_view_tooltip_set_treeview(tooltip, treeview); @@ -291,27 +305,28 @@ return tooltip; } - - -void gtk_tree_view_tooltip_set_treeview(GtkTreeViewTooltip *tooltip, GtkTreeView *treeview) +void gtk_tree_view_tooltip_set_treeview(GtkTreeViewTooltip *tooltip, + GtkTreeView *treeview) { - g_return_if_fail(tooltip!=NULL); + g_return_if_fail(tooltip != NULL); tooltip->treeview = treeview; - if(!treeview) + if (!treeview) return; - g_signal_connect_after(treeview, "event-after", G_CALLBACK(treeview_tooltip_event_handler), tooltip); - g_signal_connect(treeview, "unmap", G_CALLBACK(treeview_tooltip_unmap), tooltip); - g_signal_connect(treeview, "unrealize", G_CALLBACK(treeview_tooltip_unmap), tooltip); - g_signal_connect(treeview, "destroy", G_CALLBACK(treeview_tooltip_unmap), tooltip); + g_signal_connect_after(treeview, "event-after", + G_CALLBACK(treeview_tooltip_event_handler), tooltip); + g_signal_connect(treeview, "unmap", G_CALLBACK(treeview_tooltip_unmap), + tooltip); + g_signal_connect(treeview, "unrealize", + G_CALLBACK(treeview_tooltip_unmap), tooltip); + g_signal_connect(treeview, "destroy", + G_CALLBACK(treeview_tooltip_unmap), tooltip); } - - -void gtk_tree_view_tooltip_set_tip_columns(GtkTreeViewTooltip *tooltip, gint tip_flag_col, gint icon_col, - gint title_col, gint tiptext_col) +void gtk_tree_view_tooltip_set_tip_columns(GtkTreeViewTooltip *tooltip, + gint tip_flag_col, gint icon_col, gint title_col, gint tiptext_col) { tooltip->tip_flag_column = tip_flag_col; tooltip->icon_column = icon_col; @@ -319,31 +334,22 @@ tooltip->tiptext_column = tiptext_col; } - - gint gtk_tree_view_tooltip_get_tip_icon_column(GtkTreeViewTooltip *tooltip) { return tooltip->icon_column; } - - gint gtk_tree_view_tooltip_get_tip_title_column(GtkTreeViewTooltip *tooltip) { return tooltip->title_column; } - - gint gtk_tree_view_tooltip_get_tip_text_column(GtkTreeViewTooltip *tooltip) { return tooltip->tiptext_column; } - - gint gtk_tree_view_tooltip_get_tip_flag_column(GtkTreeViewTooltip *tooltip) { return tooltip->tip_flag_column; } - Index: gtk_tree_view_tooltip.h =================================================================== RCS file: /cvsroot/ayttm/ayttm/src/gtk/gtk_tree_view_tooltip.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- gtk_tree_view_tooltip.h 24 Aug 2009 13:19:43 -0000 1.4 +++ gtk_tree_view_tooltip.h 17 Sep 2009 12:05:03 -0000 1.5 @@ -21,7 +21,6 @@ * */ - #ifndef __GTK_TREE_VIEW_TOOLTIP__ #define __GTK_TREE_VIEW_TOOLTIP__ @@ -33,18 +32,15 @@ #include <gdk-pixbuf/gdk-pixbuf.h> G_BEGIN_DECLS - #define GTK_TREE_VIEW_TOOLTIP_TYPE (gtk_tree_view_tooltip_get_type ()) #define GTK_TREE_VIEW_TOOLTIP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TREE_VIEW_TOOLTIP_TYPE, GtkTreeViewTooltip)) #define GTK_TREE_VIEW_TOOLTIP_CLASS(cls) (G_TYPE_CHECK_CLASS_CAST ((cls), GTK_TREE_VIEW_TOOLTIP_TYPE, GtkTreeViewTooltipClass)) #define GTK_IS_TREE_VIEW_TOOLTIP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TREE_VIEW_TOOLTIP_TYPE)) #define GTK_IS_TREE_VIEW_TOOLTIP_CLASS(cls) (G_TYPE_CHECK_CLASS_TYPE ((cls), GTK_TREE_VIEW_TOOLTIP_TYPE)) +typedef struct _GtkTreeViewTooltip GtkTreeViewTooltip; +typedef struct _GtkTreeViewTooltipClass GtkTreeViewTooltipClass; -typedef struct _GtkTreeViewTooltip GtkTreeViewTooltip; -typedef struct _GtkTreeViewTooltipClass GtkTreeViewTooltipClass; - -struct _GtkTreeViewTooltip -{ +struct _GtkTreeViewTooltip { GObject parent; GtkWidget *window; @@ -65,20 +61,19 @@ gpointer data; }; -struct _GtkTreeViewTooltipClass -{ +struct _GtkTreeViewTooltipClass { GObjectClass parent_class; }; /* * Get the type number of GtkTreeViewTooltip as registered with GLib */ -GType gtk_tree_view_tooltip_get_type (); +GType gtk_tree_view_tooltip_get_type(); /* * Create a new GtkTreeViewTooltip */ -GtkTreeViewTooltip* gtk_tree_view_tooltip_new (void); +GtkTreeViewTooltip *gtk_tree_view_tooltip_new(void); /* * Create a new GtkTreeViewTooltip for a given tree view object @@ -86,7 +81,8 @@ * Arguments: * @ treeview: The GtkTreeView to which the newly created tooltip must attach */ -GtkTreeViewTooltip* gtk_tree_view_tooltip_new_for_treeview (GtkTreeView *treeview); +GtkTreeViewTooltip *gtk_tree_view_tooltip_new_for_treeview(GtkTreeView + *treeview); /* * Attach the tooltip object to a tree view @@ -95,7 +91,8 @@ * @ tooltip: The GtkTreeViewTooltip object * @ treeview: The GtkTreeView object to which tooltip must attach */ -void gtk_tree_view_tooltip_set_treeview (GtkTreeViewTooltip *tooltip, GtkTreeView *treeview); +void gtk_tree_view_tooltip_set_treeview(GtkTreeViewTooltip *tooltip, + GtkTreeView *treeview); /* * Set the columns on the tree model from which the tooltip should read its data. @@ -108,30 +105,28 @@ * @ title_col: Column number for the bold title of the tip * @ tiptext_col: Column number for the detailed tip */ -void gtk_tree_view_tooltip_set_tip_columns (GtkTreeViewTooltip *tooltip, gint tip_flag_col, gint icon_col, - gint title_col, gint tiptext_col); +void gtk_tree_view_tooltip_set_tip_columns(GtkTreeViewTooltip *tooltip, + gint tip_flag_col, gint icon_col, gint title_col, gint tiptext_col); /* * Returns the column number for the tip flag */ -gint gtk_tree_view_tooltip_get_tip_flag_column (GtkTreeViewTooltip *tooltip); +gint gtk_tree_view_tooltip_get_tip_flag_column(GtkTreeViewTooltip *tooltip); /* * Returns the column number for the tip icon */ -gint gtk_tree_view_tooltip_get_tip_icon_column (GtkTreeViewTooltip *tooltip); +gint gtk_tree_view_tooltip_get_tip_icon_column(GtkTreeViewTooltip *tooltip); /* * Returns the column number for the tip title */ -gint gtk_tree_view_tooltip_get_tip_title_column (GtkTreeViewTooltip *tooltip); +gint gtk_tree_view_tooltip_get_tip_title_column(GtkTreeViewTooltip *tooltip); /* * Returns the column number for the tip text */ -gint gtk_tree_view_tooltip_get_tip_text_column (GtkTreeViewTooltip *tooltip); - +gint gtk_tree_view_tooltip_get_tip_text_column(GtkTreeViewTooltip *tooltip); G_END_DECLS -#endif /*End __GTK_TREE_VIEW_TOOLTIP__*/ - +#endif /*End __GTK_TREE_VIEW_TOOLTIP__ */ Index: gtkspell.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/src/gtk/gtkspell.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- gtkspell.c 26 Aug 2009 09:26:14 -0000 1.8 +++ gtkspell.c 17 Sep 2009 12:05:03 -0000 1.9 @@ -31,7 +31,6 @@ #include "util.h" #include "platform_defs.h" - /* size of the text buffer used in various word-processing routines. */ #define BUFSIZE 1024 /* number of suggestions to display on each menu. */ @@ -44,8 +43,7 @@ GtkTextTag *error_tag = NULL; - -static gboolean iswordsep(char c) +static gboolean iswordsep(char c) { return !isalpha(c) && c != '\''; } @@ -53,47 +51,48 @@ /* * Gets the text and boundaries of the word under a given position */ -static gboolean get_word_from_pos(GtkTextBuffer* gtktext, GtkTextIter pos, char* buf, - GtkTextIter *pstart,GtkTextIter *pend) +static gboolean get_word_from_pos(GtkTextBuffer *gtktext, GtkTextIter pos, + char *buf, GtkTextIter *pstart, GtkTextIter *pend) { GtkTextIter word_start, word_end; gchar *tmp; - if( !gtk_text_iter_inside_word(&pos) && gtk_text_iter_get_char(&pos)!='\'' ) + if (!gtk_text_iter_inside_word(&pos) + && gtk_text_iter_get_char(&pos) != '\'') return FALSE; /* Get the end iter */ word_end = pos; - if( !gtk_text_iter_forward_word_end(&word_end) ) + if (!gtk_text_iter_forward_word_end(&word_end)) return FALSE; - if( gtk_text_iter_get_char(&word_end) == '\'' ) { + if (gtk_text_iter_get_char(&word_end) == '\'') { gtk_text_iter_forward_char(&word_end); - if(g_unichar_isalpha(gtk_text_iter_get_char(&word_end))) { - if(!gtk_text_iter_forward_word_end(&word_end)) + if (g_unichar_isalpha(gtk_text_iter_get_char(&word_end))) { + if (!gtk_text_iter_forward_word_end(&word_end)) return FALSE; } } - if(pend) + if (pend) *pend = word_end; /* Get the word start iter */ word_start = pos; - if( !gtk_text_iter_backward_word_start(&word_start) ) + if (!gtk_text_iter_backward_word_start(&word_start)) return FALSE; - if( gtk_text_iter_get_char(&word_start) == '\'' ) { + if (gtk_text_iter_get_char(&word_start) == '\'') { gtk_text_iter_backward_char(&word_start); - if(g_unichar_isalpha( gtk_text_iter_get_char(&word_start) )) { - if(!gtk_text_iter_backward_word_start(&word_start)) + if (g_unichar_isalpha(gtk_text_iter_get_char(&word_start))) { + if (!gtk_text_iter_backward_word_start(&word_start)) return FALSE; } } - if(pstart) + if (pstart) *pstart = word_start; gtk_text_iter_forward_char(&word_end); @@ -107,11 +106,12 @@ /* * Gets word under the cursor */ -static gboolean get_curword(GtkTextBuffer* buffer, char* buf, - GtkTextIter *pstart, GtkTextIter *pend) +static gboolean get_curword(GtkTextBuffer *buffer, char *buf, + GtkTextIter *pstart, GtkTextIter *pend) { GtkTextIter iter; - gtk_text_buffer_get_iter_at_mark(buffer, &iter, gtk_text_buffer_get_insert(buffer)); + gtk_text_buffer_get_iter_at_mark(buffer, &iter, + gtk_text_buffer_get_insert(buffer)); return get_word_from_pos(buffer, iter, buf, pstart, pend); } @@ -119,11 +119,11 @@ /* * Check word under the cursor and mark it if its spelling is incorrect */ -static gboolean check_at(GtkTextBuffer *gtktext, GtkTextIter *from_pos) +static gboolean check_at(GtkTextBuffer *gtktext, GtkTextIter *from_pos) { GtkTextIter start, end; - char buf[BUFSIZE]={0}; + char buf[BUFSIZE] = { 0 }; if (!get_word_from_pos(gtktext, *from_pos, buf, &start, &end)) { return FALSE; @@ -132,7 +132,7 @@ if (ay_spell_check(buf)) { gtk_text_buffer_remove_tag(gtktext, error_tag, &start, &end); return FALSE; - } else { + } else { gtk_text_buffer_apply_tag(gtktext, error_tag, &start, &end); return TRUE; } @@ -141,22 +141,20 @@ /* * Check the entire buffer and mark spelling erors */ -void gtkspell_check_all(GtkTextBuffer *gtktext) +void gtkspell_check_all(GtkTextBuffer *gtktext) { GtkTextIter pos; GtkTextIter end; gtk_text_buffer_get_bounds(gtktext, &pos, &end); - - while ( gtk_text_iter_compare(&pos, &end) < 0 ) { - while ( gtk_text_iter_compare(&pos, &end) <0 && - iswordsep(gtk_text_iter_get_char(&pos))) - { + + while (gtk_text_iter_compare(&pos, &end) < 0) { + while (gtk_text_iter_compare(&pos, &end) < 0 && + iswordsep(gtk_text_iter_get_char(&pos))) { gtk_text_iter_forward_char(&pos); } - while ( gtk_text_iter_compare(&pos, &end) <0 && - !iswordsep(gtk_text_iter_get_char(&pos))) - { + while (gtk_text_iter_compare(&pos, &end) < 0 && + !iswordsep(gtk_text_iter_get_char(&pos))) { gtk_text_iter_forward_char(&pos); } gtk_text_iter_backward_char(&pos); @@ -168,16 +166,19 @@ * Text insert callback */ static void entry_insert_cb(GtkTextBuffer *gtktext, GtkTextIter *ppos, - gchar *newtext, guint len, gpointer d) + gchar *newtext, guint len, gpointer d) { GtkTextIter end; - g_signal_handlers_block_by_func(gtktext, G_CALLBACK(entry_insert_cb), NULL); + g_signal_handlers_block_by_func(gtktext, G_CALLBACK(entry_insert_cb), + NULL); gtk_text_buffer_insert_at_cursor(gtktext, newtext, len); - g_signal_handlers_unblock_by_func(gtktext, G_CALLBACK(entry_insert_cb), NULL); + g_signal_handlers_unblock_by_func(gtktext, G_CALLBACK(entry_insert_cb), + NULL); g_signal_stop_emission_by_name(gtktext, "insert-text"); - gtk_text_buffer_get_iter_at_mark(gtktext, ppos, gtk_text_buffer_get_insert(gtktext)); + gtk_text_buffer_get_iter_at_mark(gtktext, ppos, + gtk_text_buffer_get_insert(gtktext)); gtk_text_buffer_get_end_iter(gtktext, &end); if (iswordsep(newtext[0])) { @@ -189,7 +190,8 @@ } /* did we just split a word? */ - if (gtk_text_iter_get_offset(ppos) < gtk_text_iter_get_offset(&end)) { + if (gtk_text_iter_get_offset(ppos) < + gtk_text_iter_get_offset(&end)) { gtk_text_iter_forward_char(ppos); check_at(gtktext, ppos); gtk_text_iter_backward_char(ppos); @@ -198,9 +200,9 @@ /* check as they type, *except* if they're typing at the end (the most * common case. */ - if (gtk_text_iter_get_offset(ppos) < gtk_text_iter_get_offset(&end) && - !iswordsep(gtk_text_iter_get_char(ppos))) - { + if (gtk_text_iter_get_offset(ppos) < + gtk_text_iter_get_offset(&end) + && !iswordsep(gtk_text_iter_get_char(ppos))) { gtk_text_iter_backward_char(ppos); check_at(gtktext, ppos); gtk_text_iter_forward_char(ppos); @@ -213,7 +215,7 @@ * Text delete callback */ static void entry_delete_cb(GtkTextBuffer *gtktext, - GtkTextIter *start, GtkTextIter *end, gpointer d) + GtkTextIter *start, GtkTextIter *end, gpointer d) { check_at(gtktext, start); } @@ -221,13 +223,13 @@ /* * Replace word with selected spelling suggestion */ -static void replace_word(GtkWidget *w, gpointer d) +static void replace_word(GtkWidget *w, gpointer d) { GtkTextIter start, end; int newword_len; const gchar *newword; - char buf[BUFSIZE]={0}; + char buf[BUFSIZE] = { 0 }; int offset; /* we don't save their position, @@ -241,22 +243,25 @@ newword_len = strlen(newword); gtk_text_buffer_delete(GTK_TEXT_BUFFER(d), &start, &end); - + gtk_text_buffer_get_iter_at_offset(GTK_TEXT_BUFFER(d), &start, offset); gtk_text_buffer_place_cursor(GTK_TEXT_BUFFER(d), &start); - gtk_text_buffer_insert(GTK_TEXT_BUFFER(d), &start, newword, newword_len); + gtk_text_buffer_insert(GTK_TEXT_BUFFER(d), &start, newword, + newword_len); } /* * Add spelling suggestions into a menu. */ -static GtkMenu *make_menu(GList *l, GtkTextBuffer *gtktext) +static GtkMenu *make_menu(GList *l, GtkTextBuffer *gtktext) { GtkWidget *menu, *item; char *caption; - menu = gtk_menu_new(); + menu = gtk_menu_new(); { - caption = g_strdup_printf(_("Not in dictionary: %s"), (char*)l->data); + caption = + g_strdup_printf(_("Not in dictionary: %s"), + (char *)l->data); item = gtk_menu_item_new_with_label(caption); /* I'd like to make it so this item is never selectable, like * the menu titles in the GNOME panel... unfortunately, the GNOME @@ -270,7 +275,8 @@ l = l->next; if (l == NULL) { - item = gtk_menu_item_new_with_label(_("(no suggestions)")); + item = gtk_menu_item_new_with_label(_ + ("(no suggestions)")); gtk_widget_show(item); gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); } else { @@ -280,24 +286,32 @@ if (l->data == NULL && l->next != NULL) { count = 0; curmenu = gtk_menu_new(); - item = gtk_menu_item_new_with_label(_("Other Possibilities...")); + item = gtk_menu_item_new_with_label(_ + ("Other Possibilities...")); gtk_widget_show(item); - gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), curmenu); - gtk_menu_shell_append(GTK_MENU_SHELL(curmenu), item); + gtk_menu_item_set_submenu(GTK_MENU_ITEM + (item), curmenu); + gtk_menu_shell_append(GTK_MENU_SHELL + (curmenu), item); l = l->next; } else if (count > MENUCOUNT) { count -= MENUCOUNT; - item = gtk_menu_item_new_with_label("More..."); + item = gtk_menu_item_new_with_label + ("More..."); gtk_widget_show(item); - gtk_menu_shell_append(GTK_MENU_SHELL(curmenu), item); + gtk_menu_shell_append(GTK_MENU_SHELL + (curmenu), item); curmenu = gtk_menu_new(); - gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), curmenu); + gtk_menu_item_set_submenu(GTK_MENU_ITEM + (item), curmenu); } - item = gtk_menu_item_new_with_label((char*)l->data); + item = gtk_menu_item_new_with_label((char *)l-> + data); g_signal_connect(item, "activate", - G_CALLBACK(replace_word), gtktext); + G_CALLBACK(replace_word), gtktext); gtk_widget_show(item); - gtk_menu_shell_append(GTK_MENU_SHELL(curmenu), item); + gtk_menu_shell_append(GTK_MENU_SHELL(curmenu), + item); count++; } while ((l = l->next) != NULL); } @@ -308,80 +322,84 @@ /* * Position the popup menu at the cursor */ -void position_popup_menu(GtkMenu *menu, gint *x, gint *y, gboolean *push_in, gpointer data) +void position_popup_menu(GtkMenu *menu, gint *x, gint *y, gboolean *push_in, + gpointer data) { GdkEventButton *eb = data; - if(eb) { + if (eb) { *x = eb->x_root; *y = eb->y_root; - } - else { + } else { GdkRectangle location; GtkTextIter cur_pos; int wx, wy; - GtkTextView *text_view = g_object_get_data(G_OBJECT(menu), "parent_textview"); + GtkTextView *text_view = + g_object_get_data(G_OBJECT(menu), "parent_textview"); GtkTextBuffer *gtktext = gtk_text_view_get_buffer(text_view); - GdkWindow *parent = gtk_widget_get_parent_window(GTK_WIDGET(text_view)); + GdkWindow *parent = + gtk_widget_get_parent_window(GTK_WIDGET(text_view)); gdk_window_get_position(parent, &wx, &wy); gtk_text_buffer_get_iter_at_mark(gtktext, &cur_pos, - gtk_text_buffer_get_insert(gtktext)); + gtk_text_buffer_get_insert(gtktext)); gtk_text_view_get_iter_location(text_view, &cur_pos, &location); - gtk_text_view_buffer_to_window_coords(text_view, GTK_TEXT_WINDOW_WIDGET, - location.x, location.y, x, y); + gtk_text_view_buffer_to_window_coords(text_view, + GTK_TEXT_WINDOW_WIDGET, location.x, location.y, x, y); - *x += GTK_WIDGET(text_view)->allocation.x + wx + location.width/2; - *y += GTK_WIDGET(text_view)->allocation.y + wy + location.height/2; + *x += GTK_WIDGET(text_view)->allocation.x + wx + + location.width / 2; + *y += GTK_WIDGET(text_view)->allocation.y + wy + + location.height / 2; } } /* * Popup a menu filled with spelling suggestions */ -static void popup_menu(GtkTextView *text_view, GdkEventButton *eb) +static void popup_menu(GtkTextView *text_view, GdkEventButton *eb) { - char buf[BUFSIZE]={0}; + char buf[BUFSIZE] = { 0 }; GtkTextBuffer *gtktext = gtk_text_view_get_buffer(text_view); GtkTextIter pos; int bx, by, trailing; int button, event_time; GList *list; - - if(eb) { + + if (eb) { button = eb->button; event_time = eb->time; - gtk_text_view_window_to_buffer_coords(text_view, GTK_TEXT_WINDOW_TEXT, - eb->x, eb->y, &bx, &by); - gtk_text_view_get_iter_at_position(text_view, &pos, &trailing, bx, by); + gtk_text_view_window_to_buffer_coords(text_view, + GTK_TEXT_WINDOW_TEXT, eb->x, eb->y, &bx, &by); + gtk_text_view_get_iter_at_position(text_view, &pos, &trailing, + bx, by); gtk_text_buffer_place_cursor(gtktext, &pos); get_word_from_pos(gtktext, pos, buf, NULL, NULL); - } - else { + } else { button = 0; event_time = gtk_get_current_event_time(); get_curword(gtktext, buf, NULL, NULL); } - - if(ay_spell_check(buf)) + if (ay_spell_check(buf)) return; - list = llist_to_glist( ay_spell_check_suggest(buf), 1 ); + list = llist_to_glist(ay_spell_check_suggest(buf), 1); list = g_list_prepend(list, strdup(buf)); if (list != NULL) { GtkMenu *menu = make_menu(list, gtktext); g_object_set_data(G_OBJECT(menu), "parent_textview", text_view); - gtk_menu_popup(menu, NULL, NULL, position_popup_menu, eb, button, event_time); + gtk_menu_popup(menu, NULL, NULL, position_popup_menu, eb, + button, event_time); while (list) { - GList * l = g_list_next(list); + GList *l = g_list_next(list); g_free(list->data); g_list_free_1(list); list = l; @@ -401,9 +419,11 @@ * UPDATE: Nothing whacky about it anymore. Move along. */ -static gboolean button_press_intercept_cb(GtkTextView *gtktext, GdkEventButton *event, gpointer d) { +static gboolean button_press_intercept_cb(GtkTextView *gtktext, + GdkEventButton *event, gpointer d) +{ - if(event->button == 3 && event->type == GDK_BUTTON_PRESS) { + if (event->button == 3 && event->type == GDK_BUTTON_PRESS) { popup_menu(gtktext, event); return TRUE; } @@ -420,7 +440,7 @@ /* * Get rid of all the spelling error notifications */ -void gtkspell_uncheck_all(GtkTextBuffer *gtktext) +void gtkspell_uncheck_all(GtkTextBuffer *gtktext) { GtkTextIter start, end; @@ -431,31 +451,35 @@ /* * The fun starts here. */ -void gtkspell_attach(GtkTextView *text_view) +void gtkspell_attach(GtkTextView *text_view) { GtkTextBuffer *buffer = gtk_text_view_get_buffer(text_view); error_tag = gtk_text_buffer_create_tag(buffer, "error_tag", - "underline", PANGO_UNDERLINE_ERROR, NULL); + "underline", PANGO_UNDERLINE_ERROR, NULL); - g_signal_connect(buffer, "insert-text", G_CALLBACK(entry_insert_cb), NULL); - g_signal_connect_after(buffer, "delete-range", G_CALLBACK(entry_delete_cb), NULL); + g_signal_connect(buffer, "insert-text", G_CALLBACK(entry_insert_cb), + NULL); + g_signal_connect_after(buffer, "delete-range", + G_CALLBACK(entry_delete_cb), NULL); g_signal_connect(text_view, "button-press-event", - G_CALLBACK(button_press_intercept_cb), NULL); + G_CALLBACK(button_press_intercept_cb), NULL); g_signal_connect(text_view, "popup-menu", - G_CALLBACK(popup_menu_callback), NULL); + G_CALLBACK(popup_menu_callback), NULL); } /* * The fun ends here. */ -void gtkspell_detach(GtkTextView *gtktext) +void gtkspell_detach(GtkTextView *gtktext) { GtkTextBuffer *buffer = gtk_text_view_get_buffer(gtktext); - - g_signal_handlers_disconnect_by_func(buffer, G_CALLBACK(entry_insert_cb), NULL); - g_signal_handlers_disconnect_by_func(buffer, G_CALLBACK(entry_delete_cb), NULL); - g_signal_handlers_disconnect_by_func(gtktext, G_CALLBACK(button_press_intercept_cb), NULL); + + g_signal_handlers_disconnect_by_func(buffer, + G_CALLBACK(entry_insert_cb), NULL); + g_signal_handlers_disconnect_by_func(buffer, + G_CALLBACK(entry_delete_cb), NULL); + g_signal_handlers_disconnect_by_func(gtktext, + G_CALLBACK(button_press_intercept_cb), NULL); gtkspell_uncheck_all(buffer); } - Index: gtkspell.h =================================================================== RCS file: /cvsroot/ayttm/ayttm/src/gtk/gtkspell.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- gtkspell.h 3 Aug 2007 20:38:42 -0000 1.4 +++ gtkspell.h 17 Sep 2009 12:05:03 -0000 1.5 @@ -26,7 +26,7 @@ extern "C" { #endif -extern void gtkspell_attach(GtkTextView *text); + extern void gtkspell_attach(GtkTextView *text); /* Attach GtkSpell to a GtkText Widget. * This enables checking as you type and the popup menu. * @@ -38,17 +38,17 @@ * text = gtk_text_new(NULL, NULL); * gtk_text_set_editable(GTK_TEXT(text), TRUE); * gtkspell_attach(GTK_TEXT(text)); - */ + */ -void gtkspell_detach(GtkTextView *gtktext); + void gtkspell_detach(GtkTextView *gtktext); /* Detach GtkSpell from a GtkText widget. * * Arguments: * - "text" is the widget from which GtkSpell should detach. * - */ + */ -void gtkspell_check_all(GtkTextBuffer *gtktext); + void gtkspell_check_all(GtkTextBuffer *gtktext); /* Check and highlight the misspelled words. * Note that the popup menu will not work unless you gtkspell_attach(). * @@ -56,7 +56,7 @@ * - "text" is the widget to check. */ -void gtkspell_uncheck_all(GtkTextBuffer *gtktext); + void gtkspell_uncheck_all(GtkTextBuffer *gtktext); /* Remove all of the highlighting from the widget. * * Arguments: @@ -66,5 +66,4 @@ #ifdef __cplusplus } #endif - -#endif /* __gtkspell_h__ */ +#endif /* __gtkspell_h__ */ Index: gtkutils.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/src/gtk/gtkutils.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- gtkutils.c 7 Sep 2009 07:52:50 -0000 1.16 +++ gtkutils.c 17 Sep 2009 12:05:03 -0000 1.17 @@ -23,38 +23,38 @@ */ #include <assert.h> - + #include <gdk/gdkprivate.h> #include "gtkutils.h" #include "gtk_globals.h" #include "account.h" - -static void s_set_option( GtkWidget *inWidget, int *ioData ) +static void s_set_option(GtkWidget *inWidget, int *ioData) { - *ioData = !(*ioData); + *ioData = !(*ioData); } -GtkWidget *gtkut_button( const char *inText, int *inValue, GtkWidget *inPage, GtkAccelGroup *inAccelGroup ) +GtkWidget *gtkut_button(const char *inText, int *inValue, GtkWidget *inPage, + GtkAccelGroup *inAccelGroup) { - GtkWidget *button = gtk_check_button_new_with_mnemonic( inText ); - - assert( inValue != NULL ); - - gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(button), *inValue ); - gtk_box_pack_start( GTK_BOX(inPage), button, FALSE, FALSE, 0 ); - g_signal_connect( button, "clicked", G_CALLBACK(s_set_option), inValue ); - gtk_widget_show( button ); + GtkWidget *button = gtk_check_button_new_with_mnemonic(inText); - return( button ); + assert(inValue != NULL); + + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), *inValue); + gtk_box_pack_start(GTK_BOX(inPage), button, FALSE, FALSE, 0); + g_signal_connect(button, "clicked", G_CALLBACK(s_set_option), inValue); + gtk_widget_show(button); + + return (button); } -GtkWidget *gtkut_create_icon_widget( const char **inXPM, GtkWidget *inParent ) +GtkWidget *gtkut_create_icon_widget(const char **inXPM, GtkWidget *inParent) { - GtkWidget *iconwid = NULL; - GdkPixbuf *buf = NULL; - + GtkWidget *iconwid = NULL; + GdkPixbuf *buf = NULL; + buf = gdk_pixbuf_new_from_xpm_data(inXPM); iconwid = gtk_image_new_from_pixbuf(buf); gtk_widget_show(iconwid); @@ -62,18 +62,19 @@ return (iconwid); } - -GtkWidget *gtkut_stock_button_new_with_label(const char *label, const char *stock) +GtkWidget *gtkut_stock_button_new_with_label(const char *label, + const char *stock) { GtkWidget *hbox = gtk_hbox_new(FALSE, 5); GtkWidget *button = gtk_button_new(); - GtkWidget *iconwid = gtk_image_new_from_stock(stock, GTK_ICON_SIZE_BUTTON); + GtkWidget *iconwid = + gtk_image_new_from_stock(stock, GTK_ICON_SIZE_BUTTON); GtkWidget *labelwid = gtk_label_new(label); - + gtk_box_pack_start(GTK_BOX(hbox), iconwid, FALSE, FALSE, 2); gtk_box_pack_start(GTK_BOX(hbox), labelwid, FALSE, FALSE, 2); - gtk_container_add(GTK_CONTAINER(button), hbox); - + gtk_container_add(GTK_CONTAINER(button), hbox); + gtk_widget_show(iconwid); gtk_widget_show(labelwid); gtk_widget_show(hbox); @@ -82,62 +83,59 @@ return button; } - -GtkWidget *gtkut_create_icon_button( const char *inLabel, const char **inXPM, GtkWidget *inParent ) +GtkWidget *gtkut_create_icon_button(const char *inLabel, const char **inXPM, + GtkWidget *inParent) { - GtkWidget *button = NULL; - GtkWidget *label = NULL; - GtkWidget *hbox = NULL; - GtkWidget *iconwid = NULL; - GtkStyle *style = NULL; - const int min_width = 80; - int width = min_width; - int height = -1; - int using_label = (inLabel != NULL); - - if ( using_label ) - { - hbox = gtk_hbox_new( FALSE, 0 ); - gtk_widget_show( hbox ); + GtkWidget *button = NULL; + GtkWidget *label = NULL; + GtkWidget *hbox = NULL; + GtkWidget *iconwid = NULL; + GtkStyle *style = NULL; + const int min_width = 80; + int width = min_width; + int height = -1; + int using_label = (inLabel != NULL); + + if (using_label) { + hbox = gtk_hbox_new(FALSE, 0); + gtk_widget_show(hbox); } - - style = gtk_widget_get_style( inParent ); - - iconwid = gtkut_create_icon_widget( inXPM, inParent ); - height = gdk_pixbuf_get_height( gtk_image_get_pixbuf(GTK_IMAGE(iconwid)) )+5; - - if ( using_label ) - { - gtk_box_pack_start( GTK_BOX(hbox), iconwid, FALSE, FALSE, 0 ); - - label = gtk_label_new( inLabel ); - gtk_widget_show( label ); - gtk_box_pack_start( GTK_BOX(hbox), label, TRUE, TRUE, 0 ); + + style = gtk_widget_get_style(inParent); + + iconwid = gtkut_create_icon_widget(inXPM, inParent); + height = gdk_pixbuf_get_height(gtk_image_get_pixbuf(GTK_IMAGE(iconwid))) + + 5; + + if (using_label) { + gtk_box_pack_start(GTK_BOX(hbox), iconwid, FALSE, FALSE, 0); + + label = gtk_label_new(inLabel); + gtk_widget_show(label); + gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 0); } - + button = gtk_button_new(); - if ( using_label ) - { - gtk_container_add( GTK_CONTAINER(button), hbox ); - - if ( button->requisition.width > width ) + if (using_label) { + gtk_container_add(GTK_CONTAINER(button), hbox); + + if (button->requisition.width > width) width = button->requisition.width; - gtk_widget_set_size_request( button, width, height ); - } - else - { - gtk_container_add( GTK_CONTAINER(button), iconwid ); + gtk_widget_set_size_request(button, width, height); + } else { + gtk_container_add(GTK_CONTAINER(button), iconwid); } - - gtk_widget_show( button ); - - return( button ); + + gtk_widget_show(button); + + return (button); } -void gtkut_set_pixbuf( eb_local_account *ela, const char **inXPM, GdkPixbuf **outPixbuf ) +void gtkut_set_pixbuf(eb_local_account *ela, const char **inXPM, + GdkPixbuf **outPixbuf) { - if ( (inXPM == NULL) || (*outPixbuf == NULL) ) + if ((inXPM == NULL) || (*outPixbuf == NULL)) return; /* * FIXME: This is slowing things down for now as it compulsarily @@ -147,161 +145,157 @@ *outPixbuf = gdk_pixbuf_new_from_xpm_data(inXPM); } -void gtkut_set_pixbuf_from_xpm( const char **inXPM, GdkPixbuf **outPixbuf ) +void gtkut_set_pixbuf_from_xpm(const char **inXPM, GdkPixbuf **outPixbuf) { - if ( (inXPM == NULL) || (*outPixbuf == NULL) ) + if ((inXPM == NULL) || (*outPixbuf == NULL)) return; - + #ifndef __MINGW32__ - *outPixbuf = gdk_pixbuf_new_from_xpm_data( inXPM ); + *outPixbuf = gdk_pixbuf_new_from_xpm_data(inXPM); #endif } -void gtkut_widget_get_uposition( GtkWidget *inWidget, int *outXpos, int *outYpos ) +void gtkut_widget_get_uposition(GtkWidget *inWidget, int *outXpos, int *outYpos) { - int x = 0; - int y = 0; - int sx = 0; - int sy = 0; + int x = 0; + int y = 0; + int sx = 0; + int sy = 0; - - if ( outXpos != NULL ) + if (outXpos != NULL) *outXpos = 0; - - if ( outYpos != NULL ) + + if (outYpos != NULL) *outYpos = 0; - - if ( (inWidget == NULL) || (inWidget->window == NULL) ) - return; + + if ((inWidget == NULL) || (inWidget->window == NULL)) + return; sx = gdk_screen_width(); sy = gdk_screen_height(); - gdk_window_get_root_origin( inWidget->window, &x, &y ); + gdk_window_get_root_origin(inWidget->window, &x, &y); x %= sx; - if ( x < 0 ) + if (x < 0) x = 0; - + y %= sy; - if ( y < 0 ) + if (y < 0) y = 0; - - if ( outXpos != NULL ) + + if (outXpos != NULL) *outXpos = x; - - if ( outYpos != NULL ) + + if (outYpos != NULL) *outYpos = y; } -GtkWidget *gtkut_create_label_button( const char *inButtonText, GCallback inSignalFunc, void *inCallbackData ) +GtkWidget *gtkut_create_label_button(const char *inButtonText, + GCallback inSignalFunc, void *inCallbackData) { - GtkWidget *button = NULL; + GtkWidget *button = NULL; button = gtk_button_new_with_mnemonic(inButtonText); - gtk_widget_show( button ); - - g_signal_connect( button, "clicked", inSignalFunc, inCallbackData ); - - return( button ); -} - -GSList *gtkut_add_radio_button_to_group( GSList *ioGroup, GtkWidget *inParentBox, - const char *inButtonText, int inIsSelected, - GCallback inSignalFunc, void *inCallbackData ) -{ - GtkWidget *radio = NULL; - - - if ( inButtonText == NULL ) - radio = gtk_radio_button_new( ioGroup ); + gtk_widget_show(button); + + g_signal_connect(button, "clicked", inSignalFunc, inCallbackData); + + return (button); +} + +GSList *gtkut_add_radio_button_to_group(GSList *ioGroup, GtkWidget *inParentBox, + const char *inButtonText, int inIsSelected, + GCallback inSignalFunc, void *inCallbackData) +{ + GtkWidget *radio = NULL; + + if (inButtonText == NULL) + radio = gtk_radio_button_new(ioGroup); else - radio = gtk_radio_button_new_with_label( ioGroup, inButtonText ); - - gtk_widget_show( radio ); + radio = gtk_radio_button_new_with_label(ioGroup, inButtonText); - gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(radio), inIsSelected ); + gtk_widget_show(radio); - gtk_box_pack_start( GTK_BOX(inParentBox), radio, FALSE, FALSE, 0 ); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio), inIsSelected); - g_signal_connect( radio, "clicked", inSignalFunc, inCallbackData ); + gtk_box_pack_start(GTK_BOX(inParentBox), radio, FALSE, FALSE, 0); - return( gtk_radio_button_get_group( GTK_RADIO_BUTTON(radio) ) ); -} + g_signal_connect(radio, "clicked", inSignalFunc, inCallbackData); + return (gtk_radio_button_get_group(GTK_RADIO_BUTTON(radio))); +} -GtkWidget *gtkut_check_button( GtkWidget *inParentBox, const char *inButtonText, int inIsSelected, - GCallback inSignalFunc, void *inCallbackData ) +GtkWidget *gtkut_check_button(GtkWidget *inParentBox, const char *inButtonText, + int inIsSelected, GCallback inSignalFunc, void *inCallbackData) { GtkWidget *button = NULL; - - if ( inButtonText == NULL ) + if (inButtonText == NULL) button = gtk_check_button_new(); else - button = gtk_check_button_new_with_mnemonic( inButtonText ); - - gtk_widget_show( button ); - - gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(button), inIsSelected ); - - gtk_box_pack_start( GTK_BOX(inParentBox), button, FALSE, FALSE, 0 ); - - g_signal_connect( GTK_OBJECT(button), "clicked", inSignalFunc, inCallbackData ); - - return( button ); -} + button = gtk_check_button_new_with_mnemonic(inButtonText); + + gtk_widget_show(button); + + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), inIsSelected); + gtk_box_pack_start(GTK_BOX(inParentBox), button, FALSE, FALSE, 0); -GtkWidget *gtkut_create_menu_button( GtkMenu *inMenu, const char *inLabel, - GCallback inSignalFunc, void *inCallbackData ) + g_signal_connect(GTK_OBJECT(button), "clicked", inSignalFunc, + inCallbackData); + + return (button); +} + +GtkWidget *gtkut_create_menu_button(GtkMenu *inMenu, const char *inLabel, + GCallback inSignalFunc, void *inCallbackData) { GtkWidget *button = NULL; - - assert( inMenu != NULL ); - - if ( inLabel == NULL ) + + assert(inMenu != NULL); + + if (inLabel == NULL) button = gtk_menu_item_new(); else - button = gtk_menu_item_new_with_label( inLabel ) ; - - if ( inSignalFunc != NULL ) - g_signal_connect( button, "activate", inSignalFunc, inCallbackData ); - - gtk_menu_shell_append( GTK_MENU_SHELL(inMenu), button ); - gtk_widget_show( button ); + button = gtk_menu_item_new_with_label(inLabel); - return( button ); + if (inSignalFunc != NULL) + g_signal_connect(button, "activate", inSignalFunc, + inCallbackData); + + gtk_menu_shell_append(GTK_MENU_SHELL(inMenu), button); + gtk_widget_show(button); + + return (button); } -GtkWidget *gtkut_attach_submenu( GtkMenu *inMenu, const char *inLabel, - GtkWidget *inSubmenu, int inActive ) +GtkWidget *gtkut_attach_submenu(GtkMenu *inMenu, const char *inLabel, + GtkWidget *inSubmenu, int inActive) { GtkWidget *button = NULL; - - if ( inLabel == NULL ) + if (inLabel == NULL) button = gtk_menu_item_new(); else - button = gtk_menu_item_new_with_label( inLabel ) ; - - gtk_widget_set_sensitive( button, inActive ); + button = gtk_menu_item_new_with_label(inLabel); - gtk_menu_shell_append( GTK_MENU_SHELL(inMenu), button ); + gtk_widget_set_sensitive(button, inActive); - gtk_menu_item_set_submenu( GTK_MENU_ITEM(button), inSubmenu ); - gtk_widget_show( button ); + gtk_menu_shell_append(GTK_MENU_SHELL(inMenu), button); - return( button ); + gtk_menu_item_set_submenu(GTK_MENU_ITEM(button), inSubmenu); + gtk_widget_show(button); + + return (button); } -void gtkut_set_window_icon( GtkWindow *inWindow, const gchar **inXPM ) +void gtkut_set_window_icon(GtkWindow *inWindow, const gchar **inXPM) { - GdkPixbuf *the_pixbuf = NULL; - - if ( inXPM != NULL ) - { - the_pixbuf = gdk_pixbuf_new_from_xpm_data( inXPM ); - gtk_window_set_icon( inWindow, the_pixbuf); + GdkPixbuf *the_pixbuf = NULL; + + if (inXPM != NULL) { + the_pixbuf = gdk_pixbuf_new_from_xpm_data(inXPM); + gtk_window_set_icon(inWindow, the_pixbuf); } } Index: gtkutils.h =================================================================== RCS file: /cvsroot/ayttm/ayttm/src/gtk/gtkutils.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- gtkutils.h 7 Sep 2009 07:52:50 -0000 1.11 +++ gtkutils.h 17 Sep 2009 12:05:03 -0000 1.12 @@ -32,7 +32,8 @@ extern "C" { #endif -GtkWidget *gtkut_button( const char *inText, int *inValue, GtkWidget *inPage, GtkAccelGroup *inAccelGroup ); + GtkWidget *gtkut_button(const char *inText, int *inValue, + GtkWidget *inPage, GtkAccelGroup *inAccelGroup); /** Create a widget with an xpm. @@ -41,7 +42,8 @@ @returns the new widget */ -GtkWidget *gtkut_create_icon_widget( const char **inXPM, GtkWidget *inParent ); + GtkWidget *gtkut_create_icon_widget(const char **inXPM, + GtkWidget *inParent); /** Create a button with an xpm and optional label. @@ -51,7 +53,8 @@ @returns the new button */ -GtkWidget *gtkut_create_icon_button( const char *inLabel, const char **inXPM, GtkWidget *inParent ); + GtkWidget *gtkut_create_icon_button(const char *inLabel, + const char **inXPM, GtkWidget *inParent); /** Create a button with a stock icon and custom label. @@ -61,11 +64,14 @@ @returns the new button */ -GtkWidget *gtkut_stock_button_new_with_label(const char *label, const char *stock); + GtkWidget *gtkut_stock_button_new_with_label(const char *label, + const char *stock); -void gtkut_set_pixbuf_from_xpm( const char **inXPM, GdkPixbuf **outPixbuf ); + void gtkut_set_pixbuf_from_xpm(const char **inXPM, + GdkPixbuf **outPixbuf); -void gtkut_set_pixbuf( eb_local_account *ela, const cha... [truncated message content] |