rpms/anjuta/devel anjuta-2.24.2-webkit.patch,NONE,1.1

Debarshi Ray rishi at fedoraproject.org
Mon Jan 5 17:18:14 UTC 2009


Author: rishi

Update of /cvs/pkgs/rpms/anjuta/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv26262

Added Files:
	anjuta-2.24.2-webkit.patch 
Log Message:
* Sun Jan 04 2009 Debarshi Ray <rishi at fedoraproject.org> - 1:2.24.2-1
- Version bump to 2.24.2. Closes Red Hat Bugzilla bug #478684.


anjuta-2.24.2-webkit.patch:

--- NEW FILE anjuta-2.24.2-webkit.patch ---
diff -urNp anjuta-2.24.2.orig/configure anjuta-2.24.2/configure
--- anjuta-2.24.2.orig/configure	2009-01-04 15:27:36.000000000 +0530
+++ anjuta-2.24.2/configure	2009-01-04 15:27:51.000000000 +0530
@@ -2395,7 +2395,7 @@ VTE_REQUIRED=0.9.0
 VTE_NEW_REQUIRED=0.13.1
 LIBXML_REQUIRED=2.4.23
 PANGO_REQUIRED=1.1.1
-LIBDEVHELP_REQUIRED=0.13
+LIBDEVHELP_REQUIRED=0.22
 GDL_REQUIRED=0.7.3
 GNOMEBUILD_REQUIRED=0.3.0
 GLADEUI_REQUIRED=3.2.0
@@ -18753,12 +18753,12 @@ if test -n "$PKG_CONFIG"; then
         pkg_cv_PLUGIN_DEVHELP_CFLAGS="$PLUGIN_DEVHELP_CFLAGS"
     else
         if test -n "$PKG_CONFIG" && \
-    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libdevhelp-1.0 >= \$LIBDEVHELP_REQUIRED\"") >&5
-  ($PKG_CONFIG --exists --print-errors "libdevhelp-1.0 >= $LIBDEVHELP_REQUIRED") 2>&5
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libdevhelp-1.0 >= \$LIBDEVHELP_REQUIRED webkit-1.0\"") >&5
+  ($PKG_CONFIG --exists --print-errors "libdevhelp-1.0 >= $LIBDEVHELP_REQUIRED webkit-1.0") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-  pkg_cv_PLUGIN_DEVHELP_CFLAGS=`$PKG_CONFIG --cflags "libdevhelp-1.0 >= $LIBDEVHELP_REQUIRED" 2>/dev/null`
+  pkg_cv_PLUGIN_DEVHELP_CFLAGS=`$PKG_CONFIG --cflags "libdevhelp-1.0 >= $LIBDEVHELP_REQUIRED webkit-1.0" 2>/dev/null`
 else
   pkg_failed=yes
 fi
@@ -18771,12 +18771,12 @@ if test -n "$PKG_CONFIG"; then
         pkg_cv_PLUGIN_DEVHELP_LIBS="$PLUGIN_DEVHELP_LIBS"
     else
         if test -n "$PKG_CONFIG" && \
-    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libdevhelp-1.0 >= \$LIBDEVHELP_REQUIRED\"") >&5
-  ($PKG_CONFIG --exists --print-errors "libdevhelp-1.0 >= $LIBDEVHELP_REQUIRED") 2>&5
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libdevhelp-1.0 >= \$LIBDEVHELP_REQUIRED webkit-1.0\"") >&5
+  ($PKG_CONFIG --exists --print-errors "libdevhelp-1.0 >= $LIBDEVHELP_REQUIRED webkit-1.0") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-  pkg_cv_PLUGIN_DEVHELP_LIBS=`$PKG_CONFIG --libs "libdevhelp-1.0 >= $LIBDEVHELP_REQUIRED" 2>/dev/null`
+  pkg_cv_PLUGIN_DEVHELP_LIBS=`$PKG_CONFIG --libs "libdevhelp-1.0 >= $LIBDEVHELP_REQUIRED webkit-1.0" 2>/dev/null`
 else
   pkg_failed=yes
 fi
@@ -18795,9 +18795,9 @@ else
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-	        PLUGIN_DEVHELP_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libdevhelp-1.0 >= $LIBDEVHELP_REQUIRED"`
+	        PLUGIN_DEVHELP_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libdevhelp-1.0 >= $LIBDEVHELP_REQUIRED webkit-1.0"`
         else
-	        PLUGIN_DEVHELP_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libdevhelp-1.0 >= $LIBDEVHELP_REQUIRED"`
+	        PLUGIN_DEVHELP_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libdevhelp-1.0 >= $LIBDEVHELP_REQUIRED webkit-1.0"`
         fi
 	# Put the nasty error message in config.log where it belongs
 	echo "$PLUGIN_DEVHELP_PKG_ERRORS" >&5
diff -urNp anjuta-2.24.2.orig/plugins/devhelp/anjuta-devhelp.ui anjuta-2.24.2/plugins/devhelp/anjuta-devhelp.ui
--- anjuta-2.24.2.orig/plugins/devhelp/anjuta-devhelp.ui	2009-01-04 15:27:36.000000000 +0530
+++ anjuta-2.24.2/plugins/devhelp/anjuta-devhelp.ui	2009-01-04 15:27:51.000000000 +0530
@@ -1,14 +1,6 @@
 <!--*- xml -*-->
 <ui>
 	<menubar name="MenuMain">
-		<menu name="MenuView" action="ActionMenuView">
-			<menu name="Goto" action="ActionMenuGoto">
-				<placeholder name="PlaceholderGotoMenus">
-					<menuitem name="BackHelp" action="ActionDevhelpBack" />
-					<menuitem name="ForwardHelp" action="ActionDevhelpForward" />
-				</placeholder>
-			</menu>
-		</menu>
 		<placeholder name="PlaceHolderHelpMenus" >
 			<menu name="MenuHelp" action="ActionMenuHelp" >
 				<placeholder name="PlaceHolderHelpDevel" >
@@ -24,7 +16,5 @@
 	</toolbar>
 	<toolbar name="ToolbarBrowser">		
 		<toolitem name="Context" action="ActionHelpContext" />
-		<toolitem name="BackHelp" action="ActionDevhelpBack" />
-		<toolitem name="ForwardHelp" action="ActionDevhelpForward" />
 	</toolbar>
 </ui>
diff -urNp anjuta-2.24.2.orig/plugins/devhelp/htmlview.c anjuta-2.24.2/plugins/devhelp/htmlview.c
--- anjuta-2.24.2.orig/plugins/devhelp/htmlview.c	2009-01-04 15:27:36.000000000 +0530
+++ anjuta-2.24.2/plugins/devhelp/htmlview.c	1970-01-01 05:30:00.000000000 +0530
@@ -1,182 +0,0 @@
-/*
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Library General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "htmlview.h"
-
-#include <devhelp/dh-book-tree.h>
-#include <devhelp/dh-html.h>
-#include <devhelp/dh-preferences.h>
-#include <devhelp/dh-search.h>
-#include <devhelp/dh-base.h>
-
-static void html_view_class_init(HtmlViewClass *klass);
-static void html_view_init(HtmlView *sp);
-static void html_view_finalize(GObject *object);
-
-struct _HtmlViewPrivate {
-	DhHtml* html;
-	AnjutaDevhelp* devhelp;
-	gchar* uri;
-	guint idle_realize;
-};
-
-G_DEFINE_TYPE(HtmlView, html_view, GTK_TYPE_HBOX)
-
-static gboolean
-devhelp_html_open_uri_cb (DhHtml      *html,
-			 const gchar *uri,
-			 AnjutaDevhelp    *widget)
-{
-#ifdef HAVE_OLD_DEVHELP
-	dh_book_tree_show_uri (DH_BOOK_TREE (widget->book_tree), uri);
-#else
-	dh_book_tree_select_uri (DH_BOOK_TREE (widget->book_tree), uri);
-#endif
-	return FALSE;
-}
-
-static void
-devhelp_html_location_changed_cb (DhHtml      *html,
-				 const gchar *location,
-				 AnjutaDevhelp    *widget)
-{	
-	anjuta_devhelp_check_history (widget);
-}
-
-static gboolean
-html_view_create_html(HtmlView* html_view)
-{
-	GtkWidget* view;
-	HtmlViewPrivate* priv = html_view->priv;
-
-	priv->html = dh_html_new();
-	
-	if (!priv->html || !DH_IS_HTML(priv->html))	
-		return TRUE; /* I think the idea is to wait until we get a widget? */
-	
-	view = dh_html_get_widget(priv->html);
-	gtk_box_pack_start(GTK_BOX(html_view), dh_html_get_widget(priv->html), TRUE, TRUE, 1);
-	
-	g_signal_connect (priv->html, "open-uri",
-			  G_CALLBACK (devhelp_html_open_uri_cb),
-			  priv->devhelp);
-	g_signal_connect (priv->html, "location-changed",
-			  G_CALLBACK (devhelp_html_location_changed_cb),
-			  priv->devhelp);
-	
-	/* Hack to get GtkMozEmbed to work properly. */
-	gtk_widget_realize (view);
-
-	if (priv->uri)
-		dh_html_open_uri(priv->html, priv->uri);
-	else
-		dh_html_clear(priv->html);
-	
-	gtk_widget_show (view);
-	
-	return FALSE;
-}
-
-static void
-html_view_realize(GtkWidget* widget)
-{
-	HtmlView* html_view = HTML_VIEW(widget);
-	
-	if (html_view->priv->idle_realize == 0)
-	{
-		html_view->priv->idle_realize =
-			g_idle_add((GSourceFunc) html_view_create_html, html_view);
-	}	
-	(* GTK_WIDGET_CLASS (html_view_parent_class)->realize)(widget);
-}
-
-static void
-html_view_unrealize(GtkWidget* widget)
-{
-	HtmlView* html_view = HTML_VIEW(widget);
-	
-	if (html_view->priv->idle_realize > 0)
-	{
-		g_source_remove (html_view->priv->idle_realize);
-		html_view->priv->idle_realize = 0;
-	}
-	
-	if (html_view->priv->html != NULL)
-	{
-		g_free(html_view->priv->uri);
-		html_view->priv->uri = dh_html_get_location(html_view->priv->html);
-	}
-	else
-		html_view->priv->uri = NULL;
-	
-	if (gtk_container_get_children(GTK_CONTAINER(html_view)))
-	{
-		gtk_container_remove(GTK_CONTAINER(widget), dh_html_get_widget(html_view->priv->html));
-		html_view->priv->html = NULL;
-	}
-
-	(* GTK_WIDGET_CLASS (html_view_parent_class)->unrealize)(widget);
-}
-
-static void
-html_view_class_init(HtmlViewClass *klass)
-{
-	GObjectClass *object_class = G_OBJECT_CLASS(klass);
-	GtkWidgetClass* widget_class = GTK_WIDGET_CLASS(klass);
-
-	object_class->finalize = html_view_finalize;
-	
-	widget_class->realize = html_view_realize;
-	widget_class->unrealize = html_view_unrealize;
-}
-
-static void
-html_view_init(HtmlView *obj)
-{
-	obj->priv = g_new0(HtmlViewPrivate, 1);
-	gtk_widget_show(GTK_WIDGET(obj));
-}
-
-static void
-html_view_finalize(GObject *object)
-{
-	HtmlView *cobj;
-	cobj = HTML_VIEW(object);
-	
-	/* Free private members, etc. */
-	if (cobj->priv->html)
-		gtk_widget_destroy(dh_html_get_widget(cobj->priv->html));
-	g_free (cobj->priv->uri);	
-	g_free(cobj->priv);
-	G_OBJECT_CLASS(html_view_parent_class)->finalize(object);
-}
-
-GtkWidget*
-html_view_new(AnjutaDevhelp* devhelp)
-{
-	HtmlView *obj;
-	
-	obj = HTML_VIEW(g_object_new(HTML_TYPE_VIEW, NULL));
-	
-	obj->priv->devhelp = devhelp;
-	
-	return GTK_WIDGET(obj);
-}
-
-DhHtml* html_view_get_dh_html(HtmlView* view)
-{
-	return view->priv->html;
-}
diff -urNp anjuta-2.24.2.orig/plugins/devhelp/htmlview.h anjuta-2.24.2/plugins/devhelp/htmlview.h
--- anjuta-2.24.2.orig/plugins/devhelp/htmlview.h	2009-01-04 15:27:36.000000000 +0530
+++ anjuta-2.24.2/plugins/devhelp/htmlview.h	1970-01-01 05:30:00.000000000 +0530
@@ -1,57 +0,0 @@
-/*
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Library General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#ifndef HTMLVIEW_H
-#define HTMLVIEW_H
-
-#include <glib.h>
-#include <glib-object.h>
-#include <gtk/gtk.h>
-
-#include <devhelp/dh-html.h>
-
-#include "plugin.h"
-
-G_BEGIN_DECLS
-
-#define HTML_TYPE_VIEW         (html_view_get_type ())
-#define HTML_VIEW(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), HTML_TYPE_VIEW, HtmlView))
-#define HTML_VIEW_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), HTML_TYPE_VIEW, HtmlViewClass))
-#define HTML_IS_VIEW(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), HTML_TYPE_VIEW))
-#define HTML_IS_VIEW_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), HTML_TYPE_VIEW))
-#define HTML_VIEW_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), HTML_TYPE_VIEW, HtmlViewClass))
-
-typedef struct _HtmlView HtmlView;
-typedef struct _HtmlViewPrivate HtmlViewPrivate;
-typedef struct _HtmlViewClass HtmlViewClass;
-
-struct _HtmlView {
-	GtkHBox parent;
-	HtmlViewPrivate *priv;
-};
-
-struct _HtmlViewClass {
-	GtkHBoxClass parent_class;
-};
-
-GType html_view_get_type(void);
-GtkWidget *html_view_new(AnjutaDevhelp* devhelp);
-
-DhHtml* html_view_get_dh_html(HtmlView* html_view);
-
-G_END_DECLS
-
-#endif /* HTMLVIEW_H */
diff -urNp anjuta-2.24.2.orig/plugins/devhelp/Makefile.in anjuta-2.24.2/plugins/devhelp/Makefile.in
--- anjuta-2.24.2.orig/plugins/devhelp/Makefile.in	2009-01-04 15:27:36.000000000 +0530
+++ anjuta-2.24.2/plugins/devhelp/Makefile.in	2009-01-04 15:27:51.000000000 +0530
@@ -37,11 +37,7 @@ build_triplet = @build@
 host_triplet = @host@
 @HAVE_PLUGIN_DEVHELP_TRUE at am__append_1 = $(PLUGIN_DEVHELP_CFLAGS)
 @HAVE_PLUGIN_DEVHELP_FALSE at am__append_2 = -DDISABLE_EMBEDDED_DEVHELP
- at HAVE_PLUGIN_DEVHELP_TRUE@am__append_3 = \
- at HAVE_PLUGIN_DEVHELP_TRUE@	htmlview.c \
- at HAVE_PLUGIN_DEVHELP_TRUE@	htmlview.h
-
- at HAVE_PLUGIN_DEVHELP_TRUE@am__append_4 = $(PLUGIN_DEVHELP_LIBS)
+ at HAVE_PLUGIN_DEVHELP_TRUE@am__append_3 = $(PLUGIN_DEVHELP_LIBS)
 subdir = plugins/devhelp
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -67,10 +63,7 @@ am__DEPENDENCIES_1 =
 @HAVE_PLUGIN_DEVHELP_TRUE at am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1)
 libanjuta_devhelp_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
 	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
-am__libanjuta_devhelp_la_SOURCES_DIST = plugin.c plugin.h htmlview.c \
-	htmlview.h
- at HAVE_PLUGIN_DEVHELP_TRUE@am__objects_1 = htmlview.lo
-am_libanjuta_devhelp_la_OBJECTS = plugin.lo $(am__objects_1)
+am_libanjuta_devhelp_la_OBJECTS = plugin.lo
 libanjuta_devhelp_la_OBJECTS = $(am_libanjuta_devhelp_la_OBJECTS)
 libanjuta_devhelp_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
@@ -88,7 +81,7 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLF
 	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
 	$(LDFLAGS) -o $@
 SOURCES = $(libanjuta_devhelp_la_SOURCES)
-DIST_SOURCES = $(am__libanjuta_devhelp_la_SOURCES_DIST)
+DIST_SOURCES = $(libanjuta_devhelp_la_SOURCES)
 devhelp_pixmapsDATA_INSTALL = $(INSTALL_DATA)
 devhelp_pluginDATA_INSTALL = $(INSTALL_DATA)
 devhelp_uiDATA_INSTALL = $(INSTALL_DATA)
@@ -389,6 +382,7 @@ sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 sysconfdir = @sysconfdir@
 target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
@@ -424,11 +418,14 @@ plugin_LTLIBRARIES = libanjuta-devhelp.l
 libanjuta_devhelp_la_LDFLAGS = $(ANJUTA_PLUGIN_LDFLAGS)
 
 # Plugin sources
-libanjuta_devhelp_la_SOURCES = plugin.c plugin.h $(am__append_3)
+libanjuta_devhelp_la_SOURCES = \
+	plugin.c \
+	plugin.h
+
 
 # Plugin dependencies
 libanjuta_devhelp_la_LIBADD = $(GTK_LIBS) $(LIBANJUTA_LIBS) \
-	$(am__append_4)
+	$(am__append_3)
 EXTRA_DIST = \
 	$(plugin_in_files) \
 	$(devhelp_plugin_DATA) \
@@ -504,7 +501,6 @@ mostlyclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/htmlview.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/plugin.Plo at am__quote@
 
 .c.o:
diff -urNp anjuta-2.24.2.orig/plugins/devhelp/plugin.c anjuta-2.24.2/plugins/devhelp/plugin.c
--- anjuta-2.24.2.orig/plugins/devhelp/plugin.c	2009-01-04 15:27:36.000000000 +0530
+++ anjuta-2.24.2/plugins/devhelp/plugin.c	2009-01-04 15:27:51.000000000 +0530
@@ -34,11 +34,9 @@
 #ifndef DISABLE_EMBEDDED_DEVHELP
 
 #include <devhelp/dh-book-tree.h>
-#include <devhelp/dh-html.h>
-#include <devhelp/dh-preferences.h>
 #include <devhelp/dh-search.h>
 #include <devhelp/dh-base.h>
-#include "htmlview.h"
+#include <webkit/webkit.h>
 #define UI_FILE PACKAGE_DATA_DIR"/ui/anjuta-devhelp.ui"
 
 #else /* DISABLE_EMBEDDED_DEVHELP */
@@ -51,12 +49,8 @@ static gpointer parent_class;
 
 #ifndef DISABLE_EMBEDDED_DEVHELP
 
-#define ANJUTA_PIXMAP_HELP_NEXT "anjuta-go-help-next-24.png"
-#define ANJUTA_PIXMAP_HELP_PREV "anjuta-go-help-prev-24.png"
 #define ANJUTA_PIXMAP_DEVHELP "anjuta-devhelp-plugin-48.png"
 
-#define ANJUTA_STOCK_HELP_NEXT "anjuta-help-next"
-#define ANJUTA_STOCK_HELP_PREV "anjuta-help-prev"
 #define ANJUTA_STOCK_DEVHELP "anjuta-devhelp"
 
 static void
@@ -74,76 +68,55 @@ register_stock_icons (AnjutaPlugin *plug
 	/* Register stock icons */
 	ui = anjuta_shell_get_ui (plugin->shell, NULL);
 	icon_factory = anjuta_ui_get_icon_factory (ui);
-	REGISTER_ICON (ANJUTA_PIXMAP_HELP_NEXT, ANJUTA_STOCK_HELP_NEXT);
-	REGISTER_ICON (ANJUTA_PIXMAP_HELP_PREV, ANJUTA_STOCK_HELP_PREV);
 	REGISTER_ICON (ANJUTA_PIXMAP_DEVHELP, ANJUTA_STOCK_DEVHELP);
 }
 
 static void
-devhelp_tree_link_selected_cb (GObject       *ignored,
-			      DhLink        *link,
-			      AnjutaDevhelp *widget)
+devhelp_tree_link_selected_cb (GObject       *ignored, DhLink *link,
+							   AnjutaDevhelp *widget)
 {
+	gchar *uri;
 	
-	DhHtml       *html;
+	/*anjuta_shell_present_widget (ANJUTA_PLUGIN (widget)->shell,
+								 widget->view, NULL);*/
 
-	anjuta_shell_present_widget (ANJUTA_PLUGIN (widget)->shell,
-								 widget->htmlview, NULL);
-
-	html = html_view_get_dh_html(HTML_VIEW(widget->htmlview));
-	
-	if (!DH_IS_HTML(html))
-		return;
+	uri = dh_link_get_uri (link);
+	webkit_web_view_open (WEBKIT_WEB_VIEW (widget->view), uri);
+	g_free (uri);
 	
-	dh_html_open_uri (html, link->uri);
-
 	anjuta_devhelp_check_history (widget);
 }
 
 static void
-devhelp_search_link_selected_cb (GObject  *ignored,
-				DhLink   *link,
-				 AnjutaDevhelp *widget)
+devhelp_search_link_selected_cb (GObject  *ignored, DhLink *link,
+								 AnjutaDevhelp *widget)
 {
-	DhHtml       *html;
-
-	anjuta_shell_present_widget (ANJUTA_PLUGIN (widget)->shell,
-								 widget->htmlview, NULL);
-
-	html = html_view_get_dh_html(HTML_VIEW(widget->htmlview));
-
-	if (!DH_IS_HTML(html))
-		return;
-
-	dh_html_open_uri (html, link->uri);
+	gchar *uri;
+	
+	/*anjuta_shell_present_widget (ANJUTA_PLUGIN (widget)->shell,
+								 widget->view, NULL);*/
 
+	uri = dh_link_get_uri (link);
+	webkit_web_view_open (WEBKIT_WEB_VIEW (widget->view), uri);
+	g_free (uri);
+	
 	anjuta_devhelp_check_history (widget);
 }
 
 static void
-on_go_back_activate (GtkAction *action, AnjutaDevhelp *plugin)
+on_go_back_clicked (GtkWidget *widget, AnjutaDevhelp *plugin)
 {
-	DhHtml* html;
-
-	html = html_view_get_dh_html(HTML_VIEW(plugin->htmlview));
+	webkit_web_view_go_back (WEBKIT_WEB_VIEW (plugin->view));
 	
-	if (!DH_IS_HTML(html))
-		return;
-		
-	dh_html_go_back(html);
+	anjuta_devhelp_check_history (plugin);
 }
 
 static void
-on_go_forward_activate (GtkAction *action, AnjutaDevhelp *plugin)
+on_go_forward_clicked (GtkWidget *widget, AnjutaDevhelp *plugin)
 {
-	DhHtml* html;
-
-	html = html_view_get_dh_html(HTML_VIEW(plugin->htmlview));
+	webkit_web_view_go_forward (WEBKIT_WEB_VIEW (plugin->view));
 	
-	if (!DH_IS_HTML(html))
-		return;
-	
-	dh_html_go_forward(html);
+	anjuta_devhelp_check_history (plugin);
 }
 
 static gboolean
@@ -173,7 +146,7 @@ on_api_reference_activate (GtkAction *ac
 }
 
 static gboolean
-context_idle(AnjutaDevhelp* plugin)
+context_idle (AnjutaDevhelp* plugin)
 {
 	IAnjutaEditor *editor;
 	gchar *current_word;
@@ -232,22 +205,6 @@ static GtkActionEntry actions[] = {
 		NULL,
 		NULL
 	},
-	{
-		"ActionDevhelpBack",
-		ANJUTA_STOCK_HELP_PREV,
-		N_("Previous Help"),
-		NULL,
-		N_("Go to previous help page"),
-		G_CALLBACK (on_go_back_activate)
-	},
-	{
-		"ActionDevhelpForward",
-		ANJUTA_STOCK_HELP_NEXT,
-		N_("Next Help"),
-		NULL,
-		N_("Go to next help page"),
-		G_CALLBACK (on_go_forward_activate)
-	},
 #endif /* DISABLE_EMBEDDED_DEVHELP */
 	{
 		"ActionHelpApi",
@@ -282,7 +239,7 @@ static GtkActionEntry actions[] = {
 /* Watches callbacks */
 
 static void
-value_added_current_editor (AnjutaPlugin *plugin, const char *name,
+value_added_current_editor (AnjutaPlugin *plugin, const gchar *name,
 							const GValue *value, gpointer data)
 {
 	GtkAction *action;
@@ -300,7 +257,7 @@ value_added_current_editor (AnjutaPlugin
 
 static void
 value_removed_current_editor (AnjutaPlugin *plugin,
-							  const char *name, gpointer data)
+							  const gchar *name, gpointer data)
 {
 	GtkAction *action;
 	AnjutaDevhelp* devhelp = ANJUTA_PLUGIN_DEVHELP (data);	
@@ -314,7 +271,6 @@ value_removed_current_editor (AnjutaPlug
 static gboolean
 devhelp_activate (AnjutaPlugin *plugin)
 {
-
 	AnjutaUI *ui;
 	AnjutaDevhelp *devhelp;
 
@@ -323,12 +279,15 @@ devhelp_activate (AnjutaPlugin *plugin)
 	GNode *books;
 	GList *keywords;
 	GtkWidget* books_sw;
+	GtkWidget *scrolled_window;
+	GtkWidget *main_vbox;
+	GtkWidget *button_hbox;
 	
 	if (!init)
 	{
 		register_stock_icons (plugin);
 		init = TRUE;
-	}	
+	}
 #endif
 
 	DEBUG_PRINT ("AnjutaDevhelp: Activating AnjutaDevhelp plugin ...");
@@ -346,47 +305,89 @@ devhelp_activate (AnjutaPlugin *plugin)
 	devhelp->uiid = anjuta_ui_merge (ui, UI_FILE);
 
 #ifndef DISABLE_EMBEDDED_DEVHELP
-
+	/*
+	 * Forward/back buttons
+	 */
+	main_vbox = gtk_vbox_new (FALSE, 6);
+	gtk_widget_show (main_vbox);
+	button_hbox = gtk_hbox_new (FALSE, 0);
+	gtk_widget_show (button_hbox);
+	
+	devhelp->go_back = gtk_button_new_from_stock (GTK_STOCK_GO_BACK);
+	gtk_widget_show (devhelp->go_back);
+	gtk_box_pack_start (GTK_BOX (button_hbox), devhelp->go_back, FALSE, FALSE, 0);
+	gtk_widget_set_sensitive (devhelp->go_back, FALSE);
+	g_signal_connect (devhelp->go_back, "clicked",
+			  G_CALLBACK (on_go_back_clicked), devhelp);
+	
+	devhelp->go_forward = gtk_button_new_from_stock (GTK_STOCK_GO_FORWARD);
+	gtk_widget_show (devhelp->go_forward);
+	gtk_box_pack_start (GTK_BOX (button_hbox), devhelp->go_forward, FALSE, FALSE, 0);
+	gtk_widget_set_sensitive (devhelp->go_forward, FALSE);
+	g_signal_connect (devhelp->go_forward, "clicked",
+			  G_CALLBACK (on_go_forward_clicked), devhelp);
+	
+	gtk_box_pack_start (GTK_BOX (main_vbox), button_hbox, FALSE, FALSE, 0);
+	
+	/*
+	 * Notebook
+	 */
 	books = dh_base_get_book_tree (devhelp->base);
 	keywords = dh_base_get_keywords (devhelp->base);
 	
-	books_sw = gtk_scrolled_window_new(NULL, NULL);
+	books_sw = gtk_scrolled_window_new (NULL, NULL);
 	gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (books_sw),
-					GTK_POLICY_NEVER,
-					GTK_POLICY_AUTOMATIC);
+									GTK_POLICY_NEVER,
+									GTK_POLICY_AUTOMATIC);
 	gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (books_sw),
-					     GTK_SHADOW_IN);
+									     GTK_SHADOW_IN);
 	gtk_container_set_border_width (GTK_CONTAINER (books_sw), 2);
 	
-	devhelp->control_notebook = gtk_notebook_new();
-	devhelp->book_tree = dh_book_tree_new(books);
-	devhelp->search = dh_search_new(keywords);
+	devhelp->control_notebook = gtk_notebook_new ();
+	gtk_box_pack_start (GTK_BOX (main_vbox), devhelp->control_notebook, TRUE, TRUE, 0);
+	devhelp->book_tree = dh_book_tree_new (books);
+	
+	devhelp->search = dh_search_new (keywords);
+	gtk_widget_set_size_request (devhelp->search, 0, 0);
 	
 	g_signal_connect (devhelp->book_tree,
-			  "link-selected",
-			  G_CALLBACK (devhelp_tree_link_selected_cb),
-			  devhelp);
+					  "link-selected",
+					  G_CALLBACK (devhelp_tree_link_selected_cb),
+					  devhelp);
 	g_signal_connect (devhelp->search,
-			  "link-selected",
-			  G_CALLBACK (devhelp_search_link_selected_cb),
-			  devhelp);
-	
-	gtk_container_add(GTK_CONTAINER(books_sw), devhelp->book_tree);
-	gtk_notebook_append_page(GTK_NOTEBOOK(devhelp->control_notebook), books_sw,
-		gtk_label_new(_("Books")));
-	gtk_notebook_append_page(GTK_NOTEBOOK(devhelp->control_notebook), devhelp->search,
-		gtk_label_new(_("Search")));
-	
-	devhelp->htmlview = html_view_new(devhelp);	
-
-	anjuta_shell_add_widget (plugin->shell, devhelp->control_notebook,
-								 "AnjutaDevhelpIndex", _("Help"), ANJUTA_STOCK_DEVHELP,
-								 ANJUTA_SHELL_PLACEMENT_LEFT, NULL);
+					  "link-selected",
+					  G_CALLBACK (devhelp_search_link_selected_cb),
+					  devhelp);
+	
+	gtk_container_add (GTK_CONTAINER (books_sw), devhelp->book_tree);
+	gtk_notebook_append_page (GTK_NOTEBOOK (devhelp->control_notebook), books_sw,
+							 gtk_label_new (_("Contents")));
+	gtk_notebook_append_page (GTK_NOTEBOOK (devhelp->control_notebook), devhelp->search,
+							  gtk_label_new (_("Search")));
+	
+	gtk_widget_show_all (devhelp->control_notebook);
+	
+	/* View */
+	devhelp->view = webkit_web_view_new ();
+	gtk_widget_show (devhelp->view);
+	
+	webkit_web_view_open (WEBKIT_WEB_VIEW (devhelp->view), "about:blank");
+	
+	scrolled_window = gtk_scrolled_window_new (NULL, NULL);
+	gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
+									GTK_POLICY_AUTOMATIC,
+									GTK_POLICY_AUTOMATIC);
+	gtk_widget_show (scrolled_window);
+	gtk_container_add (GTK_CONTAINER (scrolled_window), devhelp->view);
+
+	anjuta_shell_add_widget (plugin->shell, main_vbox,
+							 "AnjutaDevhelpIndex", _("Help"), ANJUTA_STOCK_DEVHELP,
+							 ANJUTA_SHELL_PLACEMENT_LEFT, NULL);
 	/* This is the window that show the html help text */
-	anjuta_shell_add_widget (plugin->shell, devhelp->htmlview,
-								 "AnjutaDevhelpDisplay", _("Help display"),
-								 ANJUTA_STOCK_DEVHELP,
-								 ANJUTA_SHELL_PLACEMENT_CENTER, NULL);
+	anjuta_shell_add_widget (plugin->shell, scrolled_window,
+							 "AnjutaDevhelpDisplay", _("Help display"),
+							 ANJUTA_STOCK_DEVHELP,
+							 ANJUTA_SHELL_PLACEMENT_CENTER, NULL);
 								 
 #endif /* DISABLE_EMBEDDED_DEVHELP */
 
@@ -415,7 +416,7 @@ devhelp_deactivate (AnjutaPlugin *plugin
 #ifndef DISABLE_EMBEDDED_DEVHELP
 
 	/* Remove widgets */
-	anjuta_shell_remove_widget(plugin->shell, devhelp->htmlview, NULL);
+	anjuta_shell_remove_widget(plugin->shell, devhelp->view, NULL);
 	anjuta_shell_remove_widget(plugin->shell, devhelp->control_notebook, NULL);	
 
 #endif /* DISABLE_EMBEDDED_DEVHELP */
@@ -431,32 +432,22 @@ devhelp_deactivate (AnjutaPlugin *plugin
 
 #ifndef DISABLE_EMBEDDED_DEVHELP
 
-void anjuta_devhelp_check_history(AnjutaDevhelp* devhelp)
+void
+anjuta_devhelp_check_history (AnjutaDevhelp* devhelp)
 {
-	GtkAction* action_forward;
-	GtkAction* action_back;
-	DhHtml* html = html_view_get_dh_html(HTML_VIEW(devhelp->htmlview));
-	
-	action_forward = gtk_action_group_get_action (devhelp->action_group,
-										  "ActionDevhelpForward");
-	action_back = gtk_action_group_get_action (devhelp->action_group,
-										  "ActionDevhelpBack");
-	if (html != NULL)
-	{
-		g_object_set (action_forward, "sensitive", dh_html_can_go_forward (html) , NULL);
-		g_object_set (action_back, "sensitive", dh_html_can_go_back (html) , NULL);
-	}
+	gtk_widget_set_sensitive (devhelp->go_forward, webkit_web_view_can_go_forward (WEBKIT_WEB_VIEW (devhelp->view)));
+
+	gtk_widget_set_sensitive (devhelp->go_back, webkit_web_view_can_go_back (WEBKIT_WEB_VIEW (devhelp->view)));
 }
 
 #endif /* DISABLE_EMBEDDED_DEVHELP */
 
-#if 0
 static void
 devhelp_finalize (GObject *obj)
 {
+	DEBUG_PRINT ("%s", "Finalising Devhelp plugin");
+
 	/* Finalization codes here */
-	AnjutaDevhelp *plugin = ANJUTA_PLUGIN_DEVHELP (obj);
-	
 	G_OBJECT_CLASS (parent_class)->finalize (obj);
 }
 
@@ -465,13 +456,17 @@ devhelp_dispose (GObject *obj)
 {
 	AnjutaDevhelp* devhelp = ANJUTA_PLUGIN_DEVHELP (obj);
 	
-	/* Destroy devhelp - seems not to work... */
-	// g_object_unref(G_OBJECT(devhelp->base));
+	DEBUG_PRINT ("%s", "Disposing Devhelp plugin");
+	
+	if (devhelp->base)
+	{
+		g_object_unref(G_OBJECT(devhelp->base));
+		devhelp->base = NULL;
+	}
 
 	/* Disposition codes */
 	G_OBJECT_CLASS (parent_class)->dispose (obj);
 }
-#endif
 
 static void
 devhelp_instance_init (GObject *obj)
@@ -497,10 +492,9 @@ devhelp_class_init (GObjectClass *klass)
 
 	plugin_class->activate = devhelp_activate;
 	plugin_class->deactivate = devhelp_deactivate;
-#if 0
+	
 	klass->finalize = devhelp_finalize;
 	klass->dispose = devhelp_dispose;
-#endif
 }
 
 #ifndef DISABLE_EMBEDDED_DEVHELP
@@ -515,7 +509,7 @@ ihelp_search (IAnjutaHelp *help, const g
 	anjuta_shell_present_widget (ANJUTA_PLUGIN (plugin)->shell,
 								 plugin->control_notebook, NULL);
 	
-	dh_search_set_search_string (DH_SEARCH (plugin->search), query);
+	dh_search_set_search_string (DH_SEARCH (plugin->search), query, NULL);
 	gtk_notebook_set_current_page (GTK_NOTEBOOK (plugin->control_notebook), 1);
 }
 
@@ -524,34 +518,33 @@ ihelp_search (IAnjutaHelp *help, const g
 static void
 ihelp_search (IAnjutaHelp *help, const gchar *query, GError **err)
 {
-	AnjutaDevhelp *plugin;
-	
-	plugin = ANJUTA_PLUGIN_DEVHELP (help);
+	gchar *cmd[4];
 	
 	if (!anjuta_util_prog_is_installed ("devhelp", TRUE))
 	{
 		return;
 	}
 	
-	if(query && strlen (query) > 0)
+	cmd[0] = "devhelp";
+	
+	if (query && strlen (query) > 0)
 	{
-		fprintf(stderr, "Word is %s\n", query);
-		if(fork()==0)
-		{
-			execlp("devhelp", "devhelp", "-s", query, NULL);
-			g_warning (_("Cannot execute command: \"%s\""), "devhelp");
-			_exit(1);
-		}
+		cmd[1] = "-s";
+		cmd[2] = (gchar *)query;
+		cmd[3] = NULL;	
 	}
 	else
 	{
-		if(fork()==0)
-		{
-			execlp("devhelp", "devhelp", NULL);
-			g_warning (_("Cannot execute command: \"%s\""), "devhelp");
-			_exit(1);
-		}
+		cmd[1] = NULL;
 	}
+	
+	gdk_spawn_on_screen (gdk_screen_get_default (),
+					     NULL,
+					     cmd,
+					     NULL,
+					     G_SPAWN_SEARCH_PATH,
+					     NULL,
+					     NULL, NULL, NULL);
 }
 
 #endif /* DISABLE_EMBEDDED_DEVHELP */
diff -urNp anjuta-2.24.2.orig/plugins/devhelp/plugin.h anjuta-2.24.2/plugins/devhelp/plugin.h
--- anjuta-2.24.2.orig/plugins/devhelp/plugin.h	2009-01-04 15:27:36.000000000 +0530
+++ anjuta-2.24.2/plugins/devhelp/plugin.h	2009-01-04 15:27:51.000000000 +0530
@@ -49,10 +49,12 @@ struct _AnjutaDevhelp{
 #ifndef DISABLE_EMBEDDED_DEVHELP
 	DhBase         *base;
 #endif /* DISABLE_EMBEDDED_DEVHELP */
-	GtkWidget     *htmlview;    
+	GtkWidget      *view;    
 	GtkWidget      *control_notebook; 
 	GtkWidget      *book_tree;
 	GtkWidget      *search;
+    GtkWidget      *go_back;
+    GtkWidget      *go_forward;
 	
 	IAnjutaEditor	*editor;
 	guint editor_watch_id;




More information about the fedora-extras-commits mailing list