 
diff -bBp /root/original/gnome2/gedit/gedit/gedit-mdi.c gedit-mdi.c 
 
*** /root/original/gnome2/gedit/gedit/gedit-mdi.c	2004-03-03 16:19:26.000000000 +1100
--- gedit-mdi.c	2004-08-23 07:31:10.000000000 +1000
***************
*** 40,45 ****
--- 40,46 ----
  
  #include <gtksourceview/gtksourcelanguage.h>
  #include <gtksourceview/gtksourcelanguagesmanager.h>
+ #include <gtk/gtktextview.h>
  
  #include <string.h>
  
*************** struct _GeditWindowPrefs
*** 86,91 ****
--- 87,98 ----
  	gboolean statusbar_visible;
  
  	gboolean output_window_visible;
+ 	
+ 	gboolean statusbar_line_visible;
+ 
+ 	gboolean statusbar_char_visible;
+ 	
+ 	gboolean statusbar_word_visible;
  };
  
  static void gedit_mdi_class_init 	(GeditMDIClass	*klass);
*************** static GtkTargetEntry drag_types[] =
*** 154,159 ****
--- 161,167 ----
  
  static gint n_drag_types = sizeof (drag_types) / sizeof (drag_types [0]);
  
+ GeditWindowPrefs *p;//global variable 
  
  GType
  gedit_mdi_get_type (void)
*************** gedit_mdi_app_created_handler (BonoboMDI
*** 521,526 ****
--- 529,535 ----
  
  	prefs = gedit_window_prefs_new ();
  	gedit_window_prefs_attach_to_window (prefs, win);
+ 	p = prefs;
  	
  	/* Set the statusbar style according to prefs */
  	gedit_mdi_set_app_statusbar_style (win);
*************** gedit_mdi_app_created_handler (BonoboMDI
*** 556,561 ****
--- 565,582 ----
  			(BonoboUIListenerFn)gedit_mdi_view_menu_item_toggled_handler, 
  			(gpointer)win);
  	
+ 	bonobo_ui_component_add_listener (ui_component, "ShowLine", 
+ 			(BonoboUIListenerFn)gedit_mdi_view_menu_item_toggled_handler, 
+ 			(gpointer)win);
+ 	
+ 	bonobo_ui_component_add_listener (ui_component, "ShowChar", 
+ 			(BonoboUIListenerFn)gedit_mdi_view_menu_item_toggled_handler, 
+ 			(gpointer)win);
+ 	
+ 	bonobo_ui_component_add_listener (ui_component, "ShowWord", 
+ 			(BonoboUIListenerFn)gedit_mdi_view_menu_item_toggled_handler, 
+ 			(gpointer)win);
+ 	
  	/* add a GeditRecentView object */
  	model = gedit_recent_get_model ();
  	view = EGG_RECENT_VIEW (egg_recent_view_bonobo_new (
*************** gedit_mdi_view_menu_item_toggled_handler
*** 722,729 ****
--- 743,799 ----
  		goto save_prefs;
  	}
  
+ 	if (strcmp (path, "ShowLine") == 0)
+ 	{
+ 		if (s == 1)
+ 		{	
+ 			prefs->statusbar_line_visible = TRUE;
+ 			p->statusbar_line_visible = TRUE;
+ 			gedit_view_call_toggle ();
+ 		}
+ 		else
+ 		{
+ 			prefs->statusbar_line_visible = FALSE;
+ 			p->statusbar_line_visible = FALSE;
+ 			gedit_view_call_toggle ();
+ 		}
+ 	}
+ 
+ 	if (strcmp (path, "ShowChar") == 0)
+ 	{
+ 		if (s == 1)
+ 		{
+ 			prefs->statusbar_char_visible = TRUE;
+ 			p->statusbar_char_visible = TRUE;
+ 			gedit_view_call_toggle ();
+ 		}
+ 		else
+ 		{
+ 			prefs->statusbar_char_visible = FALSE;
+ 			p->statusbar_char_visible = FALSE;
+ 			gedit_view_call_toggle ();
+ 		}
+ 	}
+ 
+ 	if (strcmp (path, "ShowWord") == 0)
+ 	{
+ 		if (s == 1)
+ 		{
+ 			prefs->statusbar_word_visible = TRUE;
+ 			p->statusbar_word_visible = TRUE;
+ 			gedit_view_call_toggle ();
+ 		}
+ 		else
+ 		{
+ 			prefs->statusbar_word_visible = FALSE;
+ 			p->statusbar_word_visible = FALSE;
+ 			gedit_view_call_toggle ();
+ 		}
+ 	}
+ 
  save_prefs:
  	gedit_window_prefs_save (prefs);
+ 	p = prefs;
  }
  
  static void 
*************** gedit_mdi_set_app_statusbar_style (Bonob
*** 885,890 ****
--- 955,984 ----
  				    "/commands/ViewStatusbar",
  				    prefs->statusbar_visible);
  	
+ 	gedit_menus_set_verb_sensitive (ui_component, 
+ 				    "/commands/ShowLine",
+ 				    prefs->statusbar_visible);
+ 	
+ 	gedit_menus_set_verb_sensitive (ui_component, 
+ 				    "/commands/ShowChar",
+ 				    prefs->statusbar_visible);
+ 	
+ 	gedit_menus_set_verb_sensitive (ui_component, 
+ 				    "/commands/ShowWord",
+ 				    prefs->statusbar_visible);
+ 	
+ 	gedit_menus_set_verb_state (ui_component, 
+ 				    "/commands/ViewStatusbar",
+ 				    prefs->statusbar_visible);
+ 	
+ 	gedit_menus_set_verb_state (ui_component, 
+ 				    "/commands/ViewStatusbar",
+ 				    prefs->statusbar_visible);
+ 	
+ 	gedit_menus_set_verb_state (ui_component, 
+ 				    "/commands/ViewStatusbar",
+ 				    prefs->statusbar_visible);
+ 	
  	/* Actually update status bar style */
  	bonobo_ui_component_set_prop (
  		ui_component, "/status",
*************** gedit_window_prefs_new (void)
*** 1685,1690 ****
--- 1779,1790 ----
  
  	prefs->output_window_visible = FALSE;
  
+ 	prefs->statusbar_line_visible = TRUE;
+ 
+ 	prefs->statusbar_char_visible = TRUE;	
+ 
+ 	prefs->statusbar_word_visible = FALSE;
+ 
  	return prefs;
  }
  
*************** gedit_mdi_set_state (GeditMDI   *mdi,
*** 2183,2185 ****
--- 2283,2299 ----
  	}
  }
  
+ gboolean gedit_mdi_statusbar_line_count (void)
+ {
+ 	return p->statusbar_line_visible;
+ }
+ 
+ gboolean gedit_mdi_statusbar_char_count (void)
+ {
+ 	return p->statusbar_char_visible;
+ }
+ 
+ gboolean gedit_mdi_statusbar_word_count (void)
+ {
+ 	return p->statusbar_word_visible;
+ }

diff -bBp /root/original/gnome2/gedit/gedit/gedit-mdi.h gedit-mdi.h 
 
*** /root/original/gnome2/gedit/gedit/gedit-mdi.h	2004-03-03 16:19:26.000000000 +1100
--- gedit-mdi.h	2004-08-22 08:27:33.000000000 +1000
*************** void		 gedit_mdi_show_progress_bar_for_w
*** 98,102 ****
--- 98,110 ----
  GeditState	 gedit_mdi_get_state 			(GeditMDI   *mdi);
  void		 gedit_mdi_set_state			(GeditMDI   *mdi,
  							 GeditState  state);
+ 
+ /*return status for lline, char ,words on statusbar*/
+ gboolean gedit_mdi_statusbar_line_count (void);
+ 
+ gboolean gedit_mdi_statusbar_char_count (void);
+ 
+ gboolean gedit_mdi_statusbar_word_count (void);
+ 
  #endif /* __GEDIT_MDI_H__ */
  
 
diff -bBp /root/original/gnome2/gedit/gedit/gedit-view.c gedit-view.c 
 
*** /root/original/gnome2/gedit/gedit/gedit-view.c	2004-03-03 16:19:27.000000000 +1100
--- gedit-view.c	2004-08-23 06:07:47.000000000 +1000
***************
*** 38,47 ****
--- 38,50 ----
  #include <gdk/gdkkeysyms.h>
  
  #include <gtksourceview/gtksourceview.h>
+ #include <gtk/gtktextview.h>
  
  #include "gedit-view.h"
  #include "gedit-debug.h"
  #include "gedit-menus.h"
+ #include "gedit-mdi.h"
+ 
  #include "gedit-prefs-manager-app.h"
  
  #include "gedit-marshal.h"
*************** static void gedit_view_populate_popup (G
*** 91,96 ****
--- 94,101 ----
  
  static GtkVBoxClass *parent_class = NULL;
  
+ GeditView *global_view = NULL;
+ 
  GType
  gedit_view_get_type (void)
  {
*************** gedit_view_set_cursor_position_statusbar
*** 621,629 ****
--- 626,637 ----
  	view->priv->cursor_position_statusbar = status;
  
  	if ((status != NULL) && (view->priv->document != NULL))
+ 	{
  		gedit_view_update_cursor_position_statusbar
  			(GTK_TEXT_BUFFER (view->priv->document),		
  			 view);
+ 		global_view = view;
+ 	}
  }
  
  void
*************** gedit_view_set_overwrite_mode_statusbar 
*** 645,655 ****
  static void
  gedit_view_update_cursor_position_statusbar (GtkTextBuffer *buffer, GeditView* view)
  {
! 	gchar *msg;
  	guint row, col/*, chars*/;
  	GtkTextIter iter;
  	GtkTextIter start;
  	guint tab_size;
  
  	gedit_debug (DEBUG_VIEW, "");
    
--- 653,666 ----
  static void
  gedit_view_update_cursor_position_statusbar (GtkTextBuffer *buffer, GeditView* view)
  {
! 	gchar *msg=NULL;
  	guint row, col/*, chars*/;
+ 	guint words = 0;
  	GtkTextIter iter;
  	GtkTextIter start;
+ 	GtkTextIter buffer_start,buffer_end;
  	guint tab_size;
+ 	gboolean word_count_space = FALSE;
  
  	gedit_debug (DEBUG_VIEW, "");
    
*************** gedit_view_update_cursor_position_status
*** 687,700 ****
  		gtk_text_iter_forward_char (&start);
  	}
  	
  	/*
  	if (col == chars)
  		msg = g_strdup_printf (_("  Ln %d, Col %d"), row + 1, col + 1);
  	else
  		msg = g_strdup_printf (_("  Ln %d, Col %d-%d"), row + 1, chars + 1, col + 1);
  	*/
  
- 	msg = g_strdup_printf (_("  Ln %d, Col %d"), row + 1, col + 1);
  	
  	gtk_statusbar_push (GTK_STATUSBAR (view->priv->cursor_position_statusbar), 
  			    0, msg);
--- 698,752 ----
  		gtk_text_iter_forward_char (&start);
  	}
  	
+ 	gtk_text_buffer_get_start_iter(buffer,&buffer_start);
+ 	gtk_text_buffer_get_end_iter(buffer,&buffer_end);
+ 	
+ 	while (!gtk_text_iter_equal (&buffer_start, &buffer_end))
+ 	{
+ 		if (gtk_text_iter_get_char (&buffer_start) == '\t' || gtk_text_iter_get_char (&buffer_start) == '\n')	
+ 			word_count_space = FALSE;
+ 		else
+ 		{
+ 			if (gtk_text_iter_get_char(&buffer_start) != ' ')
+ 			{
+ 				if (word_count_space == FALSE)
+ 				{
+ 					++words;
+ 					word_count_space = TRUE;
+ 				}
+ 			}
+ 			else
+ 				word_count_space = FALSE;
+ 		}
+ 			gtk_text_iter_forward_char (&buffer_start);
+ 	}
  	/*
  	if (col == chars)
  		msg = g_strdup_printf (_("  Ln %d, Col %d"), row + 1, col + 1);
  	else
  		msg = g_strdup_printf (_("  Ln %d, Col %d-%d"), row + 1, chars + 1, col + 1);
  	*/
+ 	if (gedit_mdi_statusbar_line_count())
+ 		msg = g_strdup_printf (_(" Line %d"), row + 1);
+ 	
+ 	if (gedit_mdi_statusbar_char_count())
+ 		msg = g_strdup_printf (_(" Col %d"), col + 1);
+ 
+ 	if (gedit_mdi_statusbar_word_count())
+ 		msg = g_strdup_printf (_(" Word %d"),words);
+ 	
+ 	if (gedit_mdi_statusbar_line_count() && gedit_mdi_statusbar_char_count() && gedit_mdi_statusbar_word_count())
+ 		msg = g_strdup_printf (_(" Line %d, Col %d, Word %d"), row + 1, col + 1, words);
+ 
+ 	else if (gedit_mdi_statusbar_line_count() && gedit_mdi_statusbar_char_count())
+ 		msg = g_strdup_printf (_(" Line %d, Col %d"), row + 1, col + 1);
+ 
+ 	else if (gedit_mdi_statusbar_line_count() && gedit_mdi_statusbar_word_count())
+ 		msg = g_strdup_printf (_(" Line %d, Word %d"), row + 1, words);
+ 
+ 	else if (gedit_mdi_statusbar_char_count() && gedit_mdi_statusbar_word_count())
+ 		msg = g_strdup_printf (_(" Col %d, Word %d"), col + 1, words);
  
  	
  	gtk_statusbar_push (GTK_STATUSBAR (view->priv->cursor_position_statusbar), 
  			    0, msg);
*************** gedit_view_set_insert_spaces_instead_of_
*** 779,781 ****
--- 831,840 ----
  	gtk_source_view_set_insert_spaces_instead_of_tabs (view->priv->text_view,
  							   enable);
  }
+ 
+ void gedit_view_call_toggle (void)
+ {
+ 		gedit_view_update_cursor_position_statusbar
+ 			(GTK_TEXT_BUFFER (global_view->priv->document),		
+ 			 global_view);
+ }
 
diff -bBp /root/original/gnome2/gedit/gedit/gedit-view.h gedit-view.h 
 
*** /root/original/gnome2/gedit/gedit/gedit-view.h	2004-03-03 16:19:27.000000000 +1100
--- gedit-view.h	2004-08-22 08:36:43.000000000 +1000
*************** GtkTextView    *gedit_view_get_gtk_text_
*** 105,109 ****
--- 105,111 ----
  
  void 		gedit_view_set_editable 	(GeditView *view, gboolean editable);
  
+ void gedit_view_call_toggle (void);
+ 
  #endif /* __GEDIT_VIEW_H__ */
  
 
diff -bBp /root/original/gnome2/gedit/gedit/gedit-ui.xml gedit-ui.xml 
 
*** /root/original/gnome2/gedit/gedit/gedit-ui.xml	2004-03-03 16:19:26.000000000 +1100
--- gedit-ui.xml	2004-08-22 08:30:24.000000000 +1000
***************
*** 110,115 ****
--- 110,121 ----
          <cmd name="ToolbarIconBothHoriz" id="ToolbarIconBothHoriz" _label="T_ext for Important Icons" 
  	 type="radio" group="buttons" _tip ="Show text only beside important icons in the toolbar"/>
  
+ 	<cmd name="ShowLine" id="ShowLine" _label="Show _Line Count" type="toggle" _tip="Show the current line number on the statusbar" state="1"/>
+ 
+ 	<cmd name="ShowChar" id="ShowChar" _label="Show _Char Count" type="toggle" _tip="Show number of characters in current line in the statusbar" state="1"/>
+ 
+ 	<cmd name="ShowWord" id="ShowWord" _label="Show _Word Count" type="toggle" _tip="Show number of words in the current document" state="0"/>
+ 
          <cmd name="SettingsPreferences" _label="Pr_eferences" _tip="Configure the application"
  	  pixtype="stock" pixname="gtk-preferences"/>
  
***************
*** 230,235 ****
--- 236,253 ----
  
  	<placeholder name="ViewOps" delimit="top"/>
  
+ 	<separator/>
+ 
+ 	<submenu name="CutomizeStatusbar" _label="Customize Status_bar">
+ 	
+ 		<menuitem name="ShowLine" verb="" _label="Show _Line Count"/>
+ 
+ 		<menuitem name="ShowChar" verb="" _label="Show _Char Count"/>
+ 
+ 		<menuitem name="ShowWord" verb="" _label="Show _Word Count"/>
+ 
+ 	</submenu> 	
+ 
  </submenu>
 
