Yelp porting to Gnome2



Hi,

I have removed the deprecated function calls from Yelp.
Find the diff file attached with this mail.
Pl. let me know your comments.

I am planning to add session management to Yelp.

Regards,
Sandip.
--- yelp/ChangeLog	Fri Feb 22 02:02:03 2002
+++ yelp-new/ChangeLog	Fri Feb 22 14:38:56 2002
@@ -1,3 +1,11 @@
+2002-02-22  Sandeep V Honde <sandeep honde wipro com>
+	
+	* char replaced by gchar,int replaced by gint
+	* src/yelp-main.c : BonoboObject replaced by BonoboXObject
+          BonoboObjectClass replaced by BonoboXObjectClass
+        * src/yelp-base.c : BonoboObject replaced by BonoboXObject
+          BonoboObjectClass replaced by BonoboXObjectClass
+
 2002-02-22  Kjartan Maraas  <kmaraas gnome org>
 
 	* src/yelp-main.c: Remove unsupported #ifdef ENABLE_NLS stuff.
--- yelp/src/gtktreemodelfilter.c	Tue Jan 15 22:26:12 2002
+++ yelp-new/src/gtktreemodelfilter.c	Fri Feb 22 13:20:35 2002
@@ -392,7 +392,7 @@ gtk_tree_model_filter_row_back_child_upd
                                               FilterLevel        *level,
                                               FilterElt          *elt)
 {
-  int i, len;
+  gint i, len;
   GArray *a = NULL;
   GtkTreeIter childs;
 
@@ -2302,7 +2302,7 @@ static void
 gtk_tree_path_add (GtkTreePath *path1,
 		   GtkTreePath *path2)
 {
-  int i;
+  gint i;
   gint depth;
   gint *indices;
 
@@ -2321,7 +2321,7 @@ gtk_tree_path_apply_root (GtkTreePath *p
 			  GtkTreePath *root)
 {
   GtkTreePath *retval;
-  int i;
+  gint i;
   gint depth;
   gint *indices;
 
--- yelp/src/yelp-base.c	Wed Feb 13 09:32:05 2002
+++ yelp-new/src/yelp-base.c	Fri Feb 22 13:20:35 2002
@@ -54,7 +54,7 @@ static void           yelp_base_window_f
 
 
 #define PARENT_TYPE BONOBO_OBJECT_TYPE
-static BonoboObjectClass *parent_class;
+static BonoboXObjectClass *parent_class;
 
 static void
 impl_Yelp_newWindow (PortableServer_Servant  servant,
--- yelp/src/yelp-html.c	Mon Feb 18 14:13:45 2002
+++ yelp-new/src/yelp-html.c	Fri Feb 22 13:20:35 2002
@@ -379,7 +379,7 @@ yelp_html_open_uri (YelpHtml    *view, 
         YelpHtmlPriv *priv;
         StreamData   *sdata;
 	GnomeVFSURI  *uri;
-	const char   *fragment;
+	const gchar   *fragment;
 	
         d(puts(G_GNUC_FUNCTION));
 	
--- yelp/src/yelp-info.c	Sun Feb 10 14:43:39 2002
+++ yelp-new/src/yelp-info.c	Fri Feb 22 13:20:35 2002
@@ -43,7 +43,7 @@
 
 
 static void
-yelp_info_populate_tree_for_subdir (const char *basedir, GNode *parent)
+yelp_info_populate_tree_for_subdir (const gchar *basedir, GNode *parent)
 {
 	DIR           *dirh;
 	struct dirent *dent;
@@ -56,8 +56,8 @@ yelp_info_populate_tree_for_subdir (cons
 	readdir (dirh);
 
 	while ((dent = readdir (dirh))) {
-		char *ctmp = NULL;
-		char uribuf[128], titlebuf[128];
+		gchar *ctmp = NULL;
+		gchar uribuf[128], titlebuf[128];
 
 		if (dent->d_name[0] == '.')
 			continue;
--- yelp/src/yelp-main.c	Fri Feb 22 02:02:04 2002
+++ yelp-new/src/yelp-main.c	Fri Feb 22 13:31:28 2002
@@ -30,10 +30,12 @@
 #include <bonobo/bonobo-exception.h>
 #include <bonobo/bonobo-generic-factory.h>
 #include <bonobo/bonobo-main.h>
+#include <bonobo/bonobo-xobject.h>
 #include <libgnome/gnome-i18n.h>
 #include <libgnome/gnome-program.h>
 #include <libgnomeui/gnome-ui-init.h>
 #include <libgnomevfs/gnome-vfs.h>
+#include <stdlib.h>
 
 #include "GNOME_Yelp.h"
 #include "yelp-window.h"
@@ -41,13 +43,13 @@
 
 #define YELP_FACTORY_OAFIID "OAFIID:GNOME_Yelp_Factory"
 
-static BonoboObject * yelp_base_factory       (BonoboGenericFactory *factory,
+static BonoboXObject * yelp_base_factory       (BonoboGenericFactory *factory,
 					      const gchar           *iid,
 					      gpointer               closure);
 static CORBA_Object   yelp_main_activate_base (void);
 static gboolean       yelp_main_idle_start    (gchar                *url);
 
-static BonoboObject *
+static BonoboXObject *
 yelp_base_factory (BonoboGenericFactory *factory,
 		   const gchar          *iid,
 		   gpointer              closure)
--- yelp/src/yelp-util.c	Mon Feb 18 14:13:45 2002
+++ yelp-new/src/yelp-util.c	Fri Feb 22 13:20:35 2002
@@ -29,9 +29,9 @@
 /* This code comes from gnome vfs: */
 
 static gboolean
-is_uri_relative (const char *uri)
+is_uri_relative (const gchar *uri)
 {
-	const char *current;
+	const gchar *current;
 
 	/* RFC 2396 section 3.1 */
 	for (current = uri ; 
@@ -62,9 +62,9 @@ is_uri_relative (const char *uri)
  * in place.
  */
 static void
-remove_internal_relative_components (char *uri_current)
+remove_internal_relative_components (gchar *uri_current)
 {
-	char *segment_prev, *segment_cur;
+	gchar *segment_prev, *segment_cur;
 	gsize len_prev, len_cur;
 
 	len_prev = len_cur = 0;
@@ -135,11 +135,11 @@ remove_internal_relative_components (cha
 /* If I had known this relative uri code would have ended up this long, I would
  * have done it a different way
  */
-char *
-yelp_util_resolve_relative_uri (const char *base_uri,
-				const char *uri)
+gchar *
+yelp_util_resolve_relative_uri (const gchar *base_uri,
+				const gchar *uri)
 {
-	char *result = NULL;
+	gchar *result = NULL;
 
 	g_return_val_if_fail (base_uri != NULL, g_strdup (uri));
 	g_return_val_if_fail (uri != NULL, NULL);
@@ -155,12 +155,12 @@ yelp_util_resolve_relative_uri (const ch
 		result = g_strconcat (base_uri, uri, NULL);
 	}
 	else if (is_uri_relative (uri)) {
-		char *mutable_base_uri;
-		char *mutable_uri;
+		gchar *mutable_base_uri;
+		gchar *mutable_uri;
 
-		char *uri_current;
+		gchar *uri_current;
 		gsize base_uri_length;
-		char *separator;
+		gchar *separator;
 
 		/* We may need one extra character
 		 * to append a "/" to uri's that have no "/"
@@ -276,11 +276,11 @@ yelp_util_resolve_relative_uri (const ch
 	return result;
 }
 
-char *
+gchar *
 yelp_util_node_to_string_path (GNode *node)
 {
-	char *str, *t;
-	char *escaped_node_name;
+	gchar *str, *t;
+	gchar *escaped_node_name;
 	YelpSection *section;
 
 	section = node->data;
@@ -304,10 +304,10 @@ yelp_util_node_to_string_path (GNode *no
 }
 
 static GNode *
-yelp_util_string_path_to_node_helper (char  **path,
+yelp_util_string_path_to_node_helper (gchar  **path,
 				      GNode  *node)
 {
-	char *unescaped_pathname;
+	gchar *unescaped_pathname;
 	YelpSection *section;
 		
 	if (*path == NULL) {
@@ -347,10 +347,10 @@ yelp_util_string_path_to_node_helper (ch
 
      
 GNode *
-yelp_util_string_path_to_node (const char *string_path,
+yelp_util_string_path_to_node (const gchar *string_path,
 			       GNode      *root)
 {
-	char **path;
+	gchar **path;
 	GNode *node;
 
 	path = g_strsplit (string_path, "/", 0);
@@ -365,7 +365,7 @@ yelp_util_string_path_to_node (const cha
 
 GNode *
 yelp_util_decompose_path_url (GNode       *root,
-			      const char  *path_url,
+			      const gchar  *path_url,
 			      gchar      **embedded_url)
 {
 	const gchar *first_part;
@@ -399,11 +399,11 @@ yelp_util_decompose_path_url (GNode     
 	return res;
 }
 
-char *
+gchar *
 yelp_util_compose_path_url (GNode      *node,
-			    const char *embedded_url)
+			    const gchar *embedded_url)
 {
-	char *path;
+	gchar *path;
 
 	path = yelp_util_node_to_string_path (node);
 
--- yelp/src/yelp-view-toc.c	Mon Feb 18 14:13:45 2002
+++ yelp-new/src/yelp-view-toc.c	Fri Feb 22 13:20:35 2002
@@ -58,7 +58,7 @@ enum {
 static gint signals[LAST_SIGNAL] = { 0 };
 
 typedef struct {
-	char *title;
+	gchar *title;
 	GList *seriesids;
 } YelpImportantDocsSection;
 
@@ -69,8 +69,8 @@ struct _YelpViewTOCPriv {
 	HtmlDocument *doc;
 	GNode        *doc_tree;
 	GList        *important_sections;
-	char          buffer[BUFFER_SIZE];
-	int           buffer_pos;
+	gchar          buffer[BUFFER_SIZE];
+	gint           buffer_pos;
 };
 
 GType
@@ -167,10 +167,10 @@ yelp_view_toc_close (YelpViewTOC *view)
 }
 
 static void
-yelp_view_toc_write (YelpViewTOC *view, char *data, int len)
+yelp_view_toc_write (YelpViewTOC *view, gchar *data, gint len)
 {
 	YelpViewTOCPriv *priv = view->priv;
-	int chunk_size;
+	gint chunk_size;
 	
 	if (len < 0) {
 		len = strlen (data);
@@ -197,7 +197,7 @@ yelp_view_toc_write (YelpViewTOC *view, 
 }
 
 static void
-yelp_view_toc_printf (YelpViewTOC *view, char *format, ...)
+yelp_view_toc_printf (YelpViewTOC *view, gchar *format, ...)
 {
   va_list args;
   gchar *string;
@@ -214,9 +214,9 @@ yelp_view_toc_printf (YelpViewTOC *view,
 }
 
 static void
-yelp_view_toc_write_header (YelpViewTOC *view, char *title)
+yelp_view_toc_write_header (YelpViewTOC *view, gchar *title)
 {
-	char *header="\n"
+	gchar *header="\n"
 "<html>\n"
 "  <head>\n"
 "    <title>\n"
@@ -231,7 +231,7 @@ yelp_view_toc_write_header (YelpViewTOC 
 "    </style>\n"
 "  </head>\n"
 "  <body bgcolor=\"#ffffff\">";
-	char *s;
+	gchar *s;
 
 	s = g_strdup_printf (header, title);
 
@@ -243,7 +243,7 @@ yelp_view_toc_write_header (YelpViewTOC 
 static void
 yelp_view_toc_write_footer (YelpViewTOC *view)
 {
-	char *footer="\n"
+	gchar *footer="\n"
 "  </body>\n"
 "</html>\n";
 	yelp_view_toc_write (view, footer, -1);
@@ -264,9 +264,9 @@ yelp_view_toc_start (YelpViewTOC *view)
 "      </tr>\n"
 "    </table>\n"
 "   </center>\n";
-	char            *seriesid;
+	gchar            *seriesid;
 	GNode           *root;
-	char            *path;
+	gchar            *path;
 	GList           *sections, *seriesids;
 	gchar           *other_docs_string = _("Other document systems");
 	gchar           *man_string = _("Manual pages");
@@ -379,10 +379,10 @@ yelp_view_toc_start (YelpViewTOC *view)
 	yelp_view_toc_close (view);
 }
 
-static char *
+static gchar *
 yelp_view_toc_full_path_name (YelpViewTOC *view, GNode *node) 
 {
-	char *str, *t;		
+	gchar *str, *t;		
 	YelpSection *section;
 
 	section = node->data;
@@ -414,8 +414,8 @@ yelp_view_toc_man_emit (YelpViewTOC *vie
 	GNode *node, *child;
 	YelpSection *section;
 	gboolean got_a_leaf;
-	char *path, *url;
-	int i;
+	gchar *path, *url;
+	gint i;
 
 	priv = view->priv;
 
@@ -507,7 +507,7 @@ yelp_view_toc_man_1 (YelpViewTOC *view)
 	YelpViewTOCPriv *priv;
 	GNode           *root, *node, *child;
 	YelpSection     *section;
-	char            *path;
+	gchar            *path;
 	gchar           *string = _("Manual page sections");
 	
 	priv = view->priv;
@@ -554,7 +554,7 @@ yelp_view_toc_info (YelpViewTOC *view)
 	YelpViewTOCPriv *priv;
 	GNode           *root, *node;
 	YelpSection     *section;
-	char            *url;
+	gchar            *url;
 	gchar           *string = _("Info pages");
 	
 	priv = view->priv;
@@ -674,7 +674,7 @@ yelp_view_toc_scrollkeeper (YelpViewTOC 
 	GNode           *node, *child;
 	YelpSection     *section;
 	gboolean         got_a_leaf;
-	char            *path;
+	gchar            *path;
 	gchar           *name;
 	gchar           *string = _("Scrollkeeper docs for category");
 
@@ -733,10 +733,10 @@ yelp_view_toc_scrollkeeper (YelpViewTOC 
 
 
 void
-yelp_view_toc_open_url (YelpViewTOC *view, const char *url)
+yelp_view_toc_open_url (YelpViewTOC *view, const gchar *url)
 {
-	const char *toc_type;
-	const char *path_string;
+	const gchar *toc_type;
+	const gchar *path_string;
 	GNode *node;
 	
 	g_assert (strncmp (url, "toc:", 4) == 0);
--- yelp/src/yelp-window.c	Mon Feb 18 14:13:45 2002
+++ yelp-new/src/yelp-window.c	Fri Feb 22 13:20:35 2002
@@ -51,8 +51,8 @@ static void        yw_populate          
 static gboolean    yw_handle_url             (YelpWindow          *window,
 					      const gchar         *url);
 static void        yw_url_selected_cb        (gpointer             view,
-					      char                *url,
-					      char                *base_url,
+					      gchar                *url,
+					      gchar                *base_url,
 					      gboolean             handled,
 					      YelpWindow          *window);
 static void        yw_toggle_history_buttons (GtkWidget           *button,
@@ -278,8 +278,8 @@ yw_handle_url (YelpWindow *window, const
 
 static void
 yw_url_selected_cb (gpointer    view,
-		    char       *url,
-		    char       *base_url,
+		    gchar       *url,
+		    gchar       *base_url,
 		    gboolean    handled,
 		    YelpWindow *window)
 {
--- yelp/src/gtktreemodelfilter.h	Tue Jan 15 22:26:12 2002
+++ yelp-new/src/gtktreemodelfilter.h	Fri Feb 22 13:20:35 2002
@@ -68,7 +68,7 @@ struct _GtkTreeModelFilterClass
   GObjectClass parent_class;
 };
 
-GtkType       gtk_tree_model_filter_get_type                   (void);
+GType       gtk_tree_model_filter_get_type                   (void);
 GtkTreeModel *gtk_tree_model_filter_new_with_model             (GtkTreeModel       *child_model,
 								gint                filter_column,
 								GtkTreePath        *virtual_root);
--- yelp/src/yelp-base.h	Wed Jan  9 00:06:38 2002
+++ yelp-new/src/yelp-base.h	Fri Feb 22 13:20:35 2002
@@ -24,6 +24,7 @@
 #define __YELP_BASE_H__
 
 #include <bonobo/bonobo-object.h>
+#include <bonobo/bonobo-xobject.h>
 #include "GNOME_Yelp.h"
 
 typedef struct _YelpBase      YelpBase;
@@ -39,13 +40,13 @@ typedef struct _YelpBasePriv  YelpBasePr
 
 
 struct _YelpBase {
-        BonoboObject  parent;
+        BonoboXObject  parent;
         
         YelpBasePriv  *priv;
 };
 
 struct _YelpBaseClass {
-        BonoboObjectClass       parent_class;
+        BonoboXObjectClass       parent_class;
 
 	POA_GNOME_Yelp__epv epv;
 };
--- yelp/src/yelp-html.h	Mon Feb 18 14:13:45 2002
+++ yelp-new/src/yelp-html.h	Fri Feb 22 13:20:35 2002
@@ -50,8 +50,8 @@ struct _YelpHtmlClass {
 
 	/* Signals */
 	void (*url_selected)   (YelpHtml  *view,
-				char      *url,
-				char      *base_url,
+				gchar      *url,
+				gchar      *base_url,
 				gboolean   handled);
 };
 
--- yelp/src/yelp-util.h	Sun Feb 10 14:43:39 2002
+++ yelp-new/src/yelp-util.h	Fri Feb 22 13:20:35 2002
@@ -34,7 +34,7 @@ GNode *  yelp_util_string_path_to_node  
 
 GNode *  yelp_util_decompose_path_url       (GNode         *root,
 					     const gchar   *path_url,
-					     char         **embedded_url);
+					     gchar         **embedded_url);
 gchar *  yelp_util_compose_path_url         (GNode         *node,
 					     const gchar   *embedded_url);
 
--- yelp/src/yelp-view-toc.h	Tue Jan 22 20:40:52 2002
+++ yelp-new/src/yelp-view-toc.h	Fri Feb 22 13:20:35 2002
@@ -50,14 +50,14 @@ struct _YelpViewTOCClass {
 
 
 	void (*url_selected)   (YelpViewTOC   *view,
-				char          *url,
-				char          *base_url,
+				gchar          *url,
+				gchar          *base_url,
 				gboolean       handled);
 };
 
 GType           yelp_view_toc_get_type       (void);
 GtkWidget      *yelp_view_toc_new            (GNode        *doc_tree);
 void            yelp_view_toc_open_url       (YelpViewTOC  *view,
-					      const char   *url);
+					      const gchar   *url);
 
 #endif /* __YELP_VIEW_TOC__ */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]