1 diff -urN anjuta-2.24.2/configure.in trunk/configure.in
2 --- anjuta-2.24.2/configure.in 2008-11-24 15:10:28.000000000 +0100
3 +++ trunk/configure.in 2008-12-07 23:31:30.579285390 +0100
5 VTE_NEW_REQUIRED=0.13.1
8 -LIBDEVHELP_REQUIRED=0.13
9 +LIBDEVHELP_REQUIRED=0.22
11 GNOMEBUILD_REQUIRED=0.3.0
12 GLADEUI_REQUIRED=3.2.0
18 PKG_CHECK_MODULES(PLUGIN_DEVHELP,
19 - [libdevhelp-1.0 >= $LIBDEVHELP_REQUIRED],
24 - AC_MSG_RESULT([version >= 0.11 not found])
28 - if test x$devhelp_old = xyes; then
29 - PKG_CHECK_MODULES(PLUGIN_DEVHELP, [libdevhelp-1.0 >= 0.9], [devhelp_enabled=yes], [devhelp_enabled=no])
30 - if test x$devhelp_enabled = xyes; then
31 - AC_DEFINE(HAVE_OLD_DEVHELP, 1, [If old devhelp (>= 0.9 < 0.11) is installed])
34 + [libdevhelp-1.0 >= $LIBDEVHELP_REQUIRED webkit-1.0],
42 -if test x$devhelp_enabled = xyes; then
43 - GECKO_HOME=`$PKGCONFIG_CONFIG --variable=gecko_home libdevhelp-1.0`
44 - if test x$GECKO_HOME != x; then
45 - ANJUTA_LDFLAGS="$ANJUTA_LDFLAGS -R$GECKO_HOME"
48 -AC_SUBST(ANJUTA_LDFLAGS)
50 AM_CONDITIONAL(HAVE_PLUGIN_DEVHELP, [test x$devhelp_enabled = xyes])
52 dnl Check for Gnome Build
54 echo "Building devhelp plugin: ...............................YES"
56 echo "Building devhelp plugin: ...............................NO"
57 - echo " Requires devhelp"
58 + echo " Requires devhelp >= 0.22"
61 if [ test x$libgraphviz_found = xyes ]; then
62 diff -urN anjuta-2.24.2/plugins/devhelp/anjuta-devhelp.plugin trunk/plugins/devhelp/anjuta-devhelp.plugin
63 --- anjuta-2.24.2/plugins/devhelp/anjuta-devhelp.plugin 2008-11-24 14:49:19.000000000 +0100
64 +++ trunk/plugins/devhelp/anjuta-devhelp.plugin 1970-01-01 01:00:00.000000000 +0100
68 -Name[ar]=مساعدة واجهة برمجة التطبيقات
69 -Name[be@latin]=Daviednik API
70 -Name[ca]=Ajuda de l'API
71 -Name[cs]=Nápověda k API
74 -Name[dz]=ཨེ་པི་ཨའི་གྲོགས་རམ།
80 -Name[gl]=Axuda de API
94 -Name[pt]=Ajuda de API
95 -Name[pt_BR]=Ajuda da API
96 -Name[ru]=Справка по API
100 -Name[tr]=API Yardımı
101 -Name[vi]=Trợ giúp API
104 -Description=Devhelp Plugin for Anjuta.
105 -Description[ar]=ملحق Devhelp لأنجوتا.
106 -Description[be@latin]=Plugin Devhelp dla Anjuty.
107 -Description[ca]=Connector del DevHelp per a l'Anjuta.
108 -Description[cs]=Zásuvný modul Devhelp pro Anjutu.
109 -Description[da]=Devhelp-modul til Anjuta.
110 -Description[de]=Devhelp-Komponente für Anjuta
111 -Description[dz]=ཨན་ཇུ་ཊ་གི་དོན་ལུ་ཌེབ་གྲོགས་རམ་པ་ལག་ཨིན།
112 -Description[el]=Πρόσθετη λειτουργία του devhelp για το Anjuta.
113 -Description[en_GB]=Devhelp Plugin for Anjuta.
114 -Description[es]=Complemento Devhelp para Anjuta.
115 -Description[fi]=Anjutan devhelp-liitännäinen.
116 -Description[fr]=Greffon Devhelp pour Anjuta
117 -Description[gl]=Complemento Devhelp para Anjuta.
118 -Description[he]=תוסף Devhelp ל-Anjuta
119 -Description[hi]=अंजुटा के लिए डेव वहेल्प प्लगिन
120 -Description[hu]=Devhelp bővítmény az Anjuta-hoz
121 -Description[it]=Plugin Devhelp per Anjuta.
122 -Description[ja]=Devhelp を利用するためのプラグインです
123 -Description[kn]=Anjuta ಗಾಗಿನ ಪ್ಲಗ್ಇನ್ Devhelp.
124 -Description[ko]=Anjuta 개발자 도움말(Devhelp) 플러그인.
125 -Description[mk]=Devhelp приклучок за Anjuta.
126 -Description[ml]=അഞ്ചുതയ്ക്കുള്ള Devhelp പ്ലഗ്ഗിന്
127 -Description[mr]=Anjuta करीता डेव्हमदत प्लगइन.
128 -Description[ne]=अन्जुताका लागि Devhelp प्लगइन ।
129 -Description[pl]=Wtyczka Devhelp dla Anjuty.
130 -Description[pt]=Plugin Devhelp para o Anjuta.
131 -Description[pt_BR]=Plug-in Devhelp para Anjuta.
132 -Description[ru]=Справка разработчика для Anjuta.
133 -Description[sl]=Vstavek Anjute za Devhelp
134 -Description[sv]=Devhelp-instick för Anjuta.
135 -Description[th]=ปลั๊กอิน Devhelp สำหรับแอนจูตา
136 -Description[tr]=Anjuta için Devhelp Eklentisi.
137 -Description[vi]=Phần bổ sung Trợ giúp Phát triển cho Anjuta
138 -Description[zh_HK]=給 Anjuta 的 Devhelp 外掛程式。
139 -Description[zh_TW]=給 Anjuta 的 Devhelp 外掛程式。
140 -Location=anjuta-devhelp:AnjutaDevhelp
141 -Icon=anjuta-devhelp-plugin-48.png
142 -Interfaces=IAnjutaHelp
143 diff -urN anjuta-2.24.2/plugins/devhelp/anjuta-devhelp.ui trunk/plugins/devhelp/anjuta-devhelp.ui
144 --- anjuta-2.24.2/plugins/devhelp/anjuta-devhelp.ui 2008-10-19 17:35:29.000000000 +0200
145 +++ trunk/plugins/devhelp/anjuta-devhelp.ui 2008-12-07 23:31:25.922619748 +0100
149 <menubar name="MenuMain">
150 - <menu name="MenuView" action="ActionMenuView">
151 - <menu name="Goto" action="ActionMenuGoto">
152 - <placeholder name="PlaceholderGotoMenus">
153 - <menuitem name="BackHelp" action="ActionDevhelpBack" />
154 - <menuitem name="ForwardHelp" action="ActionDevhelpForward" />
158 <placeholder name="PlaceHolderHelpMenus" >
159 <menu name="MenuHelp" action="ActionMenuHelp" >
160 <placeholder name="PlaceHolderHelpDevel" >
163 <toolbar name="ToolbarBrowser">
164 <toolitem name="Context" action="ActionHelpContext" />
165 - <toolitem name="BackHelp" action="ActionDevhelpBack" />
166 - <toolitem name="ForwardHelp" action="ActionDevhelpForward" />
169 diff -urN anjuta-2.24.2/plugins/devhelp/htmlview.c trunk/plugins/devhelp/htmlview.c
170 --- anjuta-2.24.2/plugins/devhelp/htmlview.c 2008-10-19 17:35:29.000000000 +0200
171 +++ trunk/plugins/devhelp/htmlview.c 1970-01-01 01:00:00.000000000 +0100
174 - * This program is free software; you can redistribute it and/or modify
175 - * it under the terms of the GNU General Public License as published by
176 - * the Free Software Foundation; either version 2 of the License, or
177 - * (at your option) any later version.
179 - * This program is distributed in the hope that it will be useful,
180 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
181 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
182 - * GNU Library General Public License for more details.
184 - * You should have received a copy of the GNU General Public License
185 - * along with this program; if not, write to the Free Software
186 - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
189 -#include "htmlview.h"
191 -#include <devhelp/dh-book-tree.h>
192 -#include <devhelp/dh-html.h>
193 -#include <devhelp/dh-preferences.h>
194 -#include <devhelp/dh-search.h>
195 -#include <devhelp/dh-base.h>
197 -static void html_view_class_init(HtmlViewClass *klass);
198 -static void html_view_init(HtmlView *sp);
199 -static void html_view_finalize(GObject *object);
201 -struct _HtmlViewPrivate {
203 - AnjutaDevhelp* devhelp;
205 - guint idle_realize;
208 -G_DEFINE_TYPE(HtmlView, html_view, GTK_TYPE_HBOX)
211 -devhelp_html_open_uri_cb (DhHtml *html,
213 - AnjutaDevhelp *widget)
215 -#ifdef HAVE_OLD_DEVHELP
216 - dh_book_tree_show_uri (DH_BOOK_TREE (widget->book_tree), uri);
218 - dh_book_tree_select_uri (DH_BOOK_TREE (widget->book_tree), uri);
224 -devhelp_html_location_changed_cb (DhHtml *html,
225 - const gchar *location,
226 - AnjutaDevhelp *widget)
228 - anjuta_devhelp_check_history (widget);
232 -html_view_create_html(HtmlView* html_view)
235 - HtmlViewPrivate* priv = html_view->priv;
237 - priv->html = dh_html_new();
239 - if (!priv->html || !DH_IS_HTML(priv->html))
240 - return TRUE; /* I think the idea is to wait until we get a widget? */
242 - view = dh_html_get_widget(priv->html);
243 - gtk_box_pack_start(GTK_BOX(html_view), dh_html_get_widget(priv->html), TRUE, TRUE, 1);
245 - g_signal_connect (priv->html, "open-uri",
246 - G_CALLBACK (devhelp_html_open_uri_cb),
248 - g_signal_connect (priv->html, "location-changed",
249 - G_CALLBACK (devhelp_html_location_changed_cb),
252 - /* Hack to get GtkMozEmbed to work properly. */
253 - gtk_widget_realize (view);
256 - dh_html_open_uri(priv->html, priv->uri);
258 - dh_html_clear(priv->html);
260 - gtk_widget_show (view);
266 -html_view_realize(GtkWidget* widget)
268 - HtmlView* html_view = HTML_VIEW(widget);
270 - if (html_view->priv->idle_realize == 0)
272 - html_view->priv->idle_realize =
273 - g_idle_add((GSourceFunc) html_view_create_html, html_view);
275 - (* GTK_WIDGET_CLASS (html_view_parent_class)->realize)(widget);
279 -html_view_unrealize(GtkWidget* widget)
281 - HtmlView* html_view = HTML_VIEW(widget);
283 - if (html_view->priv->idle_realize > 0)
285 - g_source_remove (html_view->priv->idle_realize);
286 - html_view->priv->idle_realize = 0;
289 - if (html_view->priv->html != NULL)
291 - g_free(html_view->priv->uri);
292 - html_view->priv->uri = dh_html_get_location(html_view->priv->html);
295 - html_view->priv->uri = NULL;
297 - if (gtk_container_get_children(GTK_CONTAINER(html_view)))
299 - gtk_container_remove(GTK_CONTAINER(widget), dh_html_get_widget(html_view->priv->html));
300 - html_view->priv->html = NULL;
303 - (* GTK_WIDGET_CLASS (html_view_parent_class)->unrealize)(widget);
307 -html_view_class_init(HtmlViewClass *klass)
309 - GObjectClass *object_class = G_OBJECT_CLASS(klass);
310 - GtkWidgetClass* widget_class = GTK_WIDGET_CLASS(klass);
312 - object_class->finalize = html_view_finalize;
314 - widget_class->realize = html_view_realize;
315 - widget_class->unrealize = html_view_unrealize;
319 -html_view_init(HtmlView *obj)
321 - obj->priv = g_new0(HtmlViewPrivate, 1);
322 - gtk_widget_show(GTK_WIDGET(obj));
326 -html_view_finalize(GObject *object)
329 - cobj = HTML_VIEW(object);
331 - /* Free private members, etc. */
332 - if (cobj->priv->html)
333 - gtk_widget_destroy(dh_html_get_widget(cobj->priv->html));
334 - g_free (cobj->priv->uri);
335 - g_free(cobj->priv);
336 - G_OBJECT_CLASS(html_view_parent_class)->finalize(object);
340 -html_view_new(AnjutaDevhelp* devhelp)
344 - obj = HTML_VIEW(g_object_new(HTML_TYPE_VIEW, NULL));
346 - obj->priv->devhelp = devhelp;
348 - return GTK_WIDGET(obj);
351 -DhHtml* html_view_get_dh_html(HtmlView* view)
353 - return view->priv->html;
355 diff -urN anjuta-2.24.2/plugins/devhelp/htmlview.h trunk/plugins/devhelp/htmlview.h
356 --- anjuta-2.24.2/plugins/devhelp/htmlview.h 2008-10-19 17:35:29.000000000 +0200
357 +++ trunk/plugins/devhelp/htmlview.h 1970-01-01 01:00:00.000000000 +0100
360 - * This program is free software; you can redistribute it and/or modify
361 - * it under the terms of the GNU General Public License as published by
362 - * the Free Software Foundation; either version 2 of the License, or
363 - * (at your option) any later version.
365 - * This program is distributed in the hope that it will be useful,
366 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
367 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
368 - * GNU Library General Public License for more details.
370 - * You should have received a copy of the GNU General Public License
371 - * along with this program; if not, write to the Free Software
372 - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
379 -#include <glib-object.h>
380 -#include <gtk/gtk.h>
382 -#include <devhelp/dh-html.h>
388 -#define HTML_TYPE_VIEW (html_view_get_type ())
389 -#define HTML_VIEW(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), HTML_TYPE_VIEW, HtmlView))
390 -#define HTML_VIEW_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), HTML_TYPE_VIEW, HtmlViewClass))
391 -#define HTML_IS_VIEW(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), HTML_TYPE_VIEW))
392 -#define HTML_IS_VIEW_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), HTML_TYPE_VIEW))
393 -#define HTML_VIEW_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), HTML_TYPE_VIEW, HtmlViewClass))
395 -typedef struct _HtmlView HtmlView;
396 -typedef struct _HtmlViewPrivate HtmlViewPrivate;
397 -typedef struct _HtmlViewClass HtmlViewClass;
401 - HtmlViewPrivate *priv;
404 -struct _HtmlViewClass {
405 - GtkHBoxClass parent_class;
408 -GType html_view_get_type(void);
409 -GtkWidget *html_view_new(AnjutaDevhelp* devhelp);
411 -DhHtml* html_view_get_dh_html(HtmlView* html_view);
415 -#endif /* HTMLVIEW_H */
416 diff -urN anjuta-2.24.2/plugins/devhelp/Makefile.am trunk/plugins/devhelp/Makefile.am
417 --- anjuta-2.24.2/plugins/devhelp/Makefile.am 2008-10-19 17:35:29.000000000 +0200
418 +++ trunk/plugins/devhelp/Makefile.am 2008-12-07 23:31:25.935952354 +0100
420 devhelp_pixmapsdir = $(anjuta_image_dir)
421 devhelp_pixmaps_DATA = \
422 anjuta-devhelp-plugin.svg \
423 - anjuta-devhelp-plugin-48.png \
424 - anjuta-go-help-next-24.png \
425 - anjuta-go-help-next-16.png \
426 - anjuta-go-help-prev-24.png \
427 - anjuta-go-help-prev-16.png
428 + anjuta-devhelp-plugin-48.png
430 # Plugin description file
431 plugin_in_files = anjuta-devhelp.plugin.in
436 -if HAVE_PLUGIN_DEVHELP
437 -libanjuta_devhelp_la_SOURCES += \
442 # Plugin dependencies
443 libanjuta_devhelp_la_LIBADD = \
447 -if HAVE_PLUGIN_DEVHELP
448 -libanjuta_devhelp_la_LIBADD += $(PLUGIN_DEVHELP_LIBS)
450 + $(LIBANJUTA_LIBS) \
451 + $(PLUGIN_DEVHELP_LIBS)
455 diff -urN anjuta-2.24.2/plugins/devhelp/plugin.c trunk/plugins/devhelp/plugin.c
456 --- anjuta-2.24.2/plugins/devhelp/plugin.c 2008-10-19 17:35:29.000000000 +0200
457 +++ trunk/plugins/devhelp/plugin.c 2008-12-07 23:31:25.922619748 +0100
459 #ifndef DISABLE_EMBEDDED_DEVHELP
461 #include <devhelp/dh-book-tree.h>
462 -#include <devhelp/dh-html.h>
463 -#include <devhelp/dh-preferences.h>
464 #include <devhelp/dh-search.h>
465 #include <devhelp/dh-base.h>
466 -#include "htmlview.h"
467 +#include <webkit/webkit.h>
469 +#define ONLINE_API_DOCS "http://library.gnome.org/devel"
471 #define UI_FILE PACKAGE_DATA_DIR"/ui/anjuta-devhelp.ui"
473 #else /* DISABLE_EMBEDDED_DEVHELP */
476 #ifndef DISABLE_EMBEDDED_DEVHELP
478 -#define ANJUTA_PIXMAP_HELP_NEXT "anjuta-go-help-next-24.png"
479 -#define ANJUTA_PIXMAP_HELP_PREV "anjuta-go-help-prev-24.png"
480 #define ANJUTA_PIXMAP_DEVHELP "anjuta-devhelp-plugin-48.png"
482 -#define ANJUTA_STOCK_HELP_NEXT "anjuta-help-next"
483 -#define ANJUTA_STOCK_HELP_PREV "anjuta-help-prev"
484 #define ANJUTA_STOCK_DEVHELP "anjuta-devhelp"
488 /* Register stock icons */
489 ui = anjuta_shell_get_ui (plugin->shell, NULL);
490 icon_factory = anjuta_ui_get_icon_factory (ui);
491 - REGISTER_ICON (ANJUTA_PIXMAP_HELP_NEXT, ANJUTA_STOCK_HELP_NEXT);
492 - REGISTER_ICON (ANJUTA_PIXMAP_HELP_PREV, ANJUTA_STOCK_HELP_PREV);
493 REGISTER_ICON (ANJUTA_PIXMAP_DEVHELP, ANJUTA_STOCK_DEVHELP);
497 -devhelp_tree_link_selected_cb (GObject *ignored,
499 - AnjutaDevhelp *widget)
500 +devhelp_tree_link_selected_cb (GObject *ignored, DhLink *link,
501 + AnjutaDevhelp *widget)
507 anjuta_shell_present_widget (ANJUTA_PLUGIN (widget)->shell,
508 - widget->htmlview, NULL);
509 + widget->view_sw, NULL);
511 - html = html_view_get_dh_html(HTML_VIEW(widget->htmlview));
513 - if (!DH_IS_HTML(html))
515 + uri = dh_link_get_uri (link);
516 + webkit_web_view_open (WEBKIT_WEB_VIEW (widget->view), uri);
519 - dh_html_open_uri (html, link->uri);
521 anjuta_devhelp_check_history (widget);
525 -devhelp_search_link_selected_cb (GObject *ignored,
527 - AnjutaDevhelp *widget)
528 +devhelp_search_link_selected_cb (GObject *ignored, DhLink *link,
529 + AnjutaDevhelp *widget)
535 anjuta_shell_present_widget (ANJUTA_PLUGIN (widget)->shell,
536 - widget->htmlview, NULL);
538 - html = html_view_get_dh_html(HTML_VIEW(widget->htmlview));
540 - if (!DH_IS_HTML(html))
543 - dh_html_open_uri (html, link->uri);
544 + widget->view_sw, NULL);
546 + uri = dh_link_get_uri (link);
547 + webkit_web_view_open (WEBKIT_WEB_VIEW (widget->view), uri);
550 anjuta_devhelp_check_history (widget);
554 -on_go_back_activate (GtkAction *action, AnjutaDevhelp *plugin)
555 +on_go_back_clicked (GtkWidget *widget, AnjutaDevhelp *plugin)
558 + anjuta_shell_present_widget (ANJUTA_PLUGIN (plugin)->shell,
559 + plugin->view_sw, NULL);
561 - html = html_view_get_dh_html(HTML_VIEW(plugin->htmlview));
562 + webkit_web_view_go_back (WEBKIT_WEB_VIEW (plugin->view));
564 - if (!DH_IS_HTML(html))
567 - dh_html_go_back(html);
568 + anjuta_devhelp_check_history (plugin);
572 -on_go_forward_activate (GtkAction *action, AnjutaDevhelp *plugin)
573 +on_go_forward_clicked (GtkWidget *widget, AnjutaDevhelp *plugin)
576 + anjuta_shell_present_widget (ANJUTA_PLUGIN (plugin)->shell,
577 + plugin->view_sw, NULL);
579 - html = html_view_get_dh_html(HTML_VIEW(plugin->htmlview));
581 - if (!DH_IS_HTML(html))
583 + webkit_web_view_go_forward (WEBKIT_WEB_VIEW (plugin->view));
585 - dh_html_go_forward(html);
586 + anjuta_devhelp_check_history (plugin);
590 +on_online_clicked (GtkWidget* widget, AnjutaDevhelp* plugin)
592 + anjuta_shell_present_widget (ANJUTA_PLUGIN (plugin)->shell,
593 + plugin->view_sw, NULL);
594 + webkit_web_view_open (WEBKIT_WEB_VIEW(plugin->view),
596 + anjuta_devhelp_check_history (plugin);
602 gtk_notebook_set_current_page (GTK_NOTEBOOK (plugin->control_notebook), 0);
603 anjuta_shell_present_widget (ANJUTA_PLUGIN (plugin)->shell,
604 - plugin->control_notebook, NULL);
605 + plugin->main_vbox, NULL);
613 -context_idle(AnjutaDevhelp* plugin)
614 +context_idle (AnjutaDevhelp* plugin)
616 IAnjutaEditor *editor;
623 - "ActionDevhelpBack",
624 - ANJUTA_STOCK_HELP_PREV,
625 - N_("Previous Help"),
627 - N_("Go to previous help page"),
628 - G_CALLBACK (on_go_back_activate)
631 - "ActionDevhelpForward",
632 - ANJUTA_STOCK_HELP_NEXT,
635 - N_("Go to next help page"),
636 - G_CALLBACK (on_go_forward_activate)
638 #endif /* DISABLE_EMBEDDED_DEVHELP */
642 /* Watches callbacks */
645 -value_added_current_editor (AnjutaPlugin *plugin, const char *name,
646 +value_added_current_editor (AnjutaPlugin *plugin, const gchar *name,
647 const GValue *value, gpointer data)
653 value_removed_current_editor (AnjutaPlugin *plugin,
654 - const char *name, gpointer data)
655 + const gchar *name, gpointer data)
658 AnjutaDevhelp* devhelp = ANJUTA_PLUGIN_DEVHELP (data);
659 @@ -311,10 +287,17 @@
660 g_object_set (action, "sensitive", FALSE, NULL);
663 +#ifndef DISABLE_EMBEDDED_DEVHELP
664 +static void on_load_finished (GObject* view, GObject* frame, gpointer user_data)
666 + AnjutaDevhelp* devhelp = ANJUTA_PLUGIN_DEVHELP(user_data);
667 + anjuta_devhelp_check_history(devhelp);
672 devhelp_activate (AnjutaPlugin *plugin)
676 AnjutaDevhelp *devhelp;
678 @@ -323,15 +306,16 @@
682 + GtkWidget *button_hbox;
686 register_stock_icons (plugin);
692 - DEBUG_PRINT ("AnjutaDevhelp: Activating AnjutaDevhelp plugin ...");
693 + DEBUG_PRINT ("%s", "AnjutaDevhelp: Activating AnjutaDevhelp plugin ...");
694 devhelp = ANJUTA_PLUGIN_DEVHELP (plugin);
696 /* Add all UI actions and merge UI */
697 @@ -346,47 +330,100 @@
698 devhelp->uiid = anjuta_ui_merge (ui, UI_FILE);
700 #ifndef DISABLE_EMBEDDED_DEVHELP
703 + * Forward/back buttons
705 + devhelp->main_vbox = gtk_vbox_new (FALSE, 6);
706 + gtk_widget_show (devhelp->main_vbox);
707 + button_hbox = gtk_hbox_new (FALSE, 0);
708 + gtk_widget_show (button_hbox);
710 + devhelp->go_back = gtk_button_new_from_stock (GTK_STOCK_GO_BACK);
711 + gtk_widget_show (devhelp->go_back);
712 + gtk_box_pack_start (GTK_BOX (button_hbox), devhelp->go_back, FALSE, FALSE, 0);
713 + gtk_widget_set_sensitive (devhelp->go_back, FALSE);
714 + g_signal_connect (devhelp->go_back, "clicked",
715 + G_CALLBACK (on_go_back_clicked), devhelp);
717 + devhelp->go_forward = gtk_button_new_from_stock (GTK_STOCK_GO_FORWARD);
718 + gtk_widget_show (devhelp->go_forward);
719 + gtk_box_pack_start (GTK_BOX (button_hbox), devhelp->go_forward, FALSE, FALSE, 0);
720 + gtk_widget_set_sensitive (devhelp->go_forward, FALSE);
721 + g_signal_connect (devhelp->go_forward, "clicked",
722 + G_CALLBACK (on_go_forward_clicked), devhelp);
724 + devhelp->online = gtk_button_new_from_stock (_("Online"));
725 + gtk_widget_show (devhelp->online);
726 + gtk_box_pack_start (GTK_BOX (button_hbox), devhelp->online, FALSE, FALSE, 0);
727 + g_signal_connect (devhelp->online, "clicked",
728 + G_CALLBACK (on_online_clicked), devhelp);
730 + gtk_box_pack_start (GTK_BOX (devhelp->main_vbox), button_hbox, FALSE, FALSE, 0);
735 books = dh_base_get_book_tree (devhelp->base);
736 keywords = dh_base_get_keywords (devhelp->base);
738 - books_sw = gtk_scrolled_window_new(NULL, NULL);
739 + books_sw = gtk_scrolled_window_new (NULL, NULL);
740 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (books_sw),
742 - GTK_POLICY_AUTOMATIC);
744 + GTK_POLICY_AUTOMATIC);
745 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (books_sw),
748 gtk_container_set_border_width (GTK_CONTAINER (books_sw), 2);
750 - devhelp->control_notebook = gtk_notebook_new();
751 - devhelp->book_tree = dh_book_tree_new(books);
752 - devhelp->search = dh_search_new(keywords);
753 + devhelp->control_notebook = gtk_notebook_new ();
754 + gtk_box_pack_start (GTK_BOX (devhelp->main_vbox), devhelp->control_notebook,
756 + devhelp->book_tree = dh_book_tree_new (books);
758 + devhelp->search = dh_search_new (keywords);
759 + gtk_widget_set_size_request (devhelp->search, 0, 0);
761 g_signal_connect (devhelp->book_tree,
763 - G_CALLBACK (devhelp_tree_link_selected_cb),
766 + G_CALLBACK (devhelp_tree_link_selected_cb),
768 g_signal_connect (devhelp->search,
770 - G_CALLBACK (devhelp_search_link_selected_cb),
773 - gtk_container_add(GTK_CONTAINER(books_sw), devhelp->book_tree);
774 - gtk_notebook_append_page(GTK_NOTEBOOK(devhelp->control_notebook), books_sw,
775 - gtk_label_new(_("Books")));
776 - gtk_notebook_append_page(GTK_NOTEBOOK(devhelp->control_notebook), devhelp->search,
777 - gtk_label_new(_("Search")));
779 - devhelp->htmlview = html_view_new(devhelp);
781 - anjuta_shell_add_widget (plugin->shell, devhelp->control_notebook,
782 - "AnjutaDevhelpIndex", _("Help"), ANJUTA_STOCK_DEVHELP,
783 - ANJUTA_SHELL_PLACEMENT_LEFT, NULL);
785 + G_CALLBACK (devhelp_search_link_selected_cb),
788 + gtk_container_add (GTK_CONTAINER (books_sw), devhelp->book_tree);
789 + gtk_notebook_append_page (GTK_NOTEBOOK (devhelp->control_notebook), books_sw,
790 + gtk_label_new (_("Contents")));
791 + gtk_notebook_append_page (GTK_NOTEBOOK (devhelp->control_notebook), devhelp->search,
792 + gtk_label_new (_("Search")));
794 + gtk_widget_show_all (devhelp->control_notebook);
797 + devhelp->view = webkit_web_view_new ();
798 + gtk_widget_show (devhelp->view);
800 + // TODO: Show some good start page
801 + webkit_web_view_open (WEBKIT_WEB_VIEW (devhelp->view), "about:blank");
802 + g_signal_connect(G_OBJECT (devhelp->view), "load-finished",
803 + G_CALLBACK (on_load_finished), devhelp);
805 + devhelp->view_sw = gtk_scrolled_window_new (NULL, NULL);
806 + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (devhelp->view_sw),
807 + GTK_POLICY_AUTOMATIC,
808 + GTK_POLICY_AUTOMATIC);
809 + gtk_container_set_border_width (GTK_CONTAINER (devhelp->view_sw), 5);
810 + gtk_widget_show (devhelp->view_sw);
811 + gtk_container_add (GTK_CONTAINER (devhelp->view_sw), devhelp->view);
813 + anjuta_shell_add_widget (plugin->shell, devhelp->main_vbox,
814 + "AnjutaDevhelpIndex", _("Help"), ANJUTA_STOCK_DEVHELP,
815 + ANJUTA_SHELL_PLACEMENT_LEFT, NULL);
816 /* This is the window that show the html help text */
817 - anjuta_shell_add_widget (plugin->shell, devhelp->htmlview,
818 - "AnjutaDevhelpDisplay", _("Help display"),
819 - ANJUTA_STOCK_DEVHELP,
820 - ANJUTA_SHELL_PLACEMENT_CENTER, NULL);
821 + anjuta_shell_add_widget (plugin->shell, devhelp->view_sw,
822 + "AnjutaDevhelpDisplay", _("Help display"),
823 + ANJUTA_STOCK_DEVHELP,
824 + ANJUTA_SHELL_PLACEMENT_CENTER, NULL);
826 #endif /* DISABLE_EMBEDDED_DEVHELP */
830 AnjutaDevhelp* devhelp = ANJUTA_PLUGIN_DEVHELP (plugin);
832 - DEBUG_PRINT ("AnjutaDevhelp: Dectivating AnjutaDevhelp plugin ...");
833 + DEBUG_PRINT ("%s", "AnjutaDevhelp: Dectivating AnjutaDevhelp plugin ...");
836 ui = anjuta_shell_get_ui (plugin->shell, NULL);
838 #ifndef DISABLE_EMBEDDED_DEVHELP
841 - anjuta_shell_remove_widget(plugin->shell, devhelp->htmlview, NULL);
842 - anjuta_shell_remove_widget(plugin->shell, devhelp->control_notebook, NULL);
843 + anjuta_shell_remove_widget(plugin->shell, devhelp->view_sw, NULL);
844 + anjuta_shell_remove_widget(plugin->shell, devhelp->main_vbox, NULL);
846 #endif /* DISABLE_EMBEDDED_DEVHELP */
848 @@ -431,47 +468,43 @@
850 #ifndef DISABLE_EMBEDDED_DEVHELP
852 -void anjuta_devhelp_check_history(AnjutaDevhelp* devhelp)
854 +anjuta_devhelp_check_history (AnjutaDevhelp* devhelp)
856 - GtkAction* action_forward;
857 - GtkAction* action_back;
858 - DhHtml* html = html_view_get_dh_html(HTML_VIEW(devhelp->htmlview));
860 - action_forward = gtk_action_group_get_action (devhelp->action_group,
861 - "ActionDevhelpForward");
862 - action_back = gtk_action_group_get_action (devhelp->action_group,
863 - "ActionDevhelpBack");
866 - g_object_set (action_forward, "sensitive", dh_html_can_go_forward (html) , NULL);
867 - g_object_set (action_back, "sensitive", dh_html_can_go_back (html) , NULL);
869 + gtk_widget_set_sensitive (devhelp->go_forward, webkit_web_view_can_go_forward (WEBKIT_WEB_VIEW (devhelp->view)));
871 + gtk_widget_set_sensitive (devhelp->go_back, webkit_web_view_can_go_back (WEBKIT_WEB_VIEW (devhelp->view)));
874 #endif /* DISABLE_EMBEDDED_DEVHELP */
878 devhelp_finalize (GObject *obj)
880 + DEBUG_PRINT ("%s", "Finalising Devhelp plugin");
882 /* Finalization codes here */
883 - AnjutaDevhelp *plugin = ANJUTA_PLUGIN_DEVHELP (obj);
885 G_OBJECT_CLASS (parent_class)->finalize (obj);
889 devhelp_dispose (GObject *obj)
891 + DEBUG_PRINT ("%s", "Disposing Devhelp plugin");
893 +#ifndef DISABLE_EMBEDDED_DEVHELP
894 AnjutaDevhelp* devhelp = ANJUTA_PLUGIN_DEVHELP (obj);
896 - /* Destroy devhelp - seems not to work... */
897 - // g_object_unref(G_OBJECT(devhelp->base));
900 + g_object_unref(G_OBJECT(devhelp->base));
901 + devhelp->base = NULL;
903 +#endif /* DISABLE_EMBEDDED_DEVHELP */
905 /* Disposition codes */
906 G_OBJECT_CLASS (parent_class)->dispose (obj);
911 devhelp_instance_init (GObject *obj)
914 plugin_class->activate = devhelp_activate;
915 plugin_class->deactivate = devhelp_deactivate;
918 klass->finalize = devhelp_finalize;
919 klass->dispose = devhelp_dispose;
923 #ifndef DISABLE_EMBEDDED_DEVHELP
925 plugin = ANJUTA_PLUGIN_DEVHELP (help);
927 anjuta_shell_present_widget (ANJUTA_PLUGIN (plugin)->shell,
928 - plugin->control_notebook, NULL);
929 + plugin->main_vbox, NULL);
931 - dh_search_set_search_string (DH_SEARCH (plugin->search), query);
932 + dh_search_set_search_string (DH_SEARCH (plugin->search), query, NULL);
933 gtk_notebook_set_current_page (GTK_NOTEBOOK (plugin->control_notebook), 1);
936 @@ -524,34 +556,33 @@
938 ihelp_search (IAnjutaHelp *help, const gchar *query, GError **err)
940 - AnjutaDevhelp *plugin;
942 - plugin = ANJUTA_PLUGIN_DEVHELP (help);
945 if (!anjuta_util_prog_is_installed ("devhelp", TRUE))
950 - if(query && strlen (query) > 0)
951 + cmd[0] = "devhelp";
953 + if (query && strlen (query) > 0)
955 - fprintf(stderr, "Word is %s\n", query);
958 - execlp("devhelp", "devhelp", "-s", query, NULL);
959 - g_warning (_("Cannot execute command: \"%s\""), "devhelp");
963 + cmd[2] = (gchar *)query;
970 - execlp("devhelp", "devhelp", NULL);
971 - g_warning (_("Cannot execute command: \"%s\""), "devhelp");
977 + gdk_spawn_on_screen (gdk_screen_get_default (),
981 + G_SPAWN_SEARCH_PATH,
986 #endif /* DISABLE_EMBEDDED_DEVHELP */
987 diff -urN anjuta-2.24.2/plugins/devhelp/plugin.h trunk/plugins/devhelp/plugin.h
988 --- anjuta-2.24.2/plugins/devhelp/plugin.h 2008-10-19 17:35:29.000000000 +0200
989 +++ trunk/plugins/devhelp/plugin.h 2008-12-07 23:31:25.927410883 +0100
991 #ifndef DISABLE_EMBEDDED_DEVHELP
993 #endif /* DISABLE_EMBEDDED_DEVHELP */
994 - GtkWidget *htmlview;
996 + GtkWidget *view_sw;
997 GtkWidget *control_notebook;
998 + GtkWidget *main_vbox;
999 GtkWidget *book_tree;
1001 + GtkWidget *go_back;
1002 + GtkWidget *go_forward;
1003 + GtkWidget *online;
1005 IAnjutaEditor *editor;
1006 guint editor_watch_id;