]> git.pld-linux.org Git - packages/anjuta.git/blob - anjuta-devhelp.patch
- added -schemas.patch (restores schemas files)
[packages/anjuta.git] / anjuta-devhelp.patch
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
4 @@ -22,7 +22,7 @@
5  VTE_NEW_REQUIRED=0.13.1
6  LIBXML_REQUIRED=2.4.23
7  PANGO_REQUIRED=1.1.1
8 -LIBDEVHELP_REQUIRED=0.13
9 +LIBDEVHELP_REQUIRED=0.22
10  GDL_REQUIRED=0.7.3
11  GNOMEBUILD_REQUIRED=0.3.0
12  GLADEUI_REQUIRED=3.2.0
13 @@ -235,33 +195,15 @@
14         devhelp_enabled="no"
15  else
16         AC_MSG_RESULT(no)
17 -       devhelp_old=yes
18         PKG_CHECK_MODULES(PLUGIN_DEVHELP, 
19 -                               [libdevhelp-1.0 >= $LIBDEVHELP_REQUIRED],
20 -                                        [
21 -                                           devhelp_old=no
22 -                                               devhelp_enabled=yes
23 -                                        ], [
24 -                                                  AC_MSG_RESULT([version >= 0.11 not found])
25 -                                                  devhelp_old=yes
26 -                                                  devhelp_enabled=no
27 -                                        ])
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])
32 -               fi
33 -       fi
34 +                               [libdevhelp-1.0 >= $LIBDEVHELP_REQUIRED webkit-1.0],
35 +                               [
36 +                                   devhelp_enabled=yes
37 +                               ], [
38 +                                   devhelp_enabled=no
39 +                               ])
40  fi
41  
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"
46 -       fi
47 -fi
48 -AC_SUBST(ANJUTA_LDFLAGS)
49 -
50  AM_CONDITIONAL(HAVE_PLUGIN_DEVHELP, [test x$devhelp_enabled = xyes])
51  
52  dnl Check for Gnome Build
53 @@ -1133,7 +1075,7 @@
54         echo "Building devhelp plugin: ...............................YES"
55  else
56         echo "Building devhelp plugin: ...............................NO"
57 -       echo "        Requires devhelp"
58 +       echo "        Requires devhelp >= 0.22"
59  fi
60  
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
65 @@ -1,77 +0,0 @@
66 -[Anjuta Plugin]
67 -Name=API Help
68 -Name[ar]=مساعدة واجهة برمجة التطبيقات
69 -Name[be@latin]=Daviednik API
70 -Name[ca]=Ajuda de l'API
71 -Name[cs]=Nápověda k API
72 -Name[da]=API-hjælp
73 -Name[de]=API-Hilfe
74 -Name[dz]=ཨེ་པི་ཨའི་གྲོགས་རམ།
75 -Name[el]=Βοήθεια API
76 -Name[en_GB]=API Help
77 -Name[es]=Ayuda
78 -Name[fi]=API-ohje
79 -Name[fr]=Aide API
80 -Name[gl]=Axuda de API
81 -Name[hi]=API मद
82 -Name[hu]=API súgó
83 -Name[it]=Aiuto API
84 -Name[ja]=APIヘルプ
85 -Name[kn]=API ಸಹಾಯ
86 -Name[ko]=API 도움말
87 -Name[mk]=API помош
88 -Name[ml]=എപിഐ സഹായം
89 -Name[mr]=API मदत
90 -Name[nb]=API-hjelp
91 -Name[ne]=API मद्दत
92 -Name[nl]=API-hulp
93 -Name[pl]=Pomoc API
94 -Name[pt]=Ajuda de API
95 -Name[pt_BR]=Ajuda da API
96 -Name[ru]=Справка по API
97 -Name[sl]=API Pomoč
98 -Name[sv]=API-hjälp
99 -Name[th]=วิธีใช้ API
100 -Name[tr]=API Yardımı
101 -Name[vi]=Trợ giúp API
102 -Name[zh_HK]=API求助
103 -Name[zh_TW]=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
146 @@ -1,14 +1,6 @@
147  <!--*- xml -*-->
148  <ui>
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" />
155 -                               </placeholder>
156 -                       </menu>
157 -               </menu>
158                 <placeholder name="PlaceHolderHelpMenus" >
159                         <menu name="MenuHelp" action="ActionMenuHelp" >
160                                 <placeholder name="PlaceHolderHelpDevel" >
161 @@ -24,7 +16,5 @@
162         </toolbar>
163         <toolbar name="ToolbarBrowser">         
164                 <toolitem name="Context" action="ActionHelpContext" />
165 -               <toolitem name="BackHelp" action="ActionDevhelpBack" />
166 -               <toolitem name="ForwardHelp" action="ActionDevhelpForward" />
167         </toolbar>
168  </ui>
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
172 @@ -1,182 +0,0 @@
173 -/*
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.
178 - *
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.
183 - *
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.
187 - */
188 -
189 -#include "htmlview.h"
190 -
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>
196 -
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);
200 -
201 -struct _HtmlViewPrivate {
202 -       DhHtml* html;
203 -       AnjutaDevhelp* devhelp;
204 -       gchar* uri;
205 -       guint idle_realize;
206 -};
207 -
208 -G_DEFINE_TYPE(HtmlView, html_view, GTK_TYPE_HBOX)
209 -
210 -static gboolean
211 -devhelp_html_open_uri_cb (DhHtml      *html,
212 -                        const gchar *uri,
213 -                        AnjutaDevhelp    *widget)
214 -{
215 -#ifdef HAVE_OLD_DEVHELP
216 -       dh_book_tree_show_uri (DH_BOOK_TREE (widget->book_tree), uri);
217 -#else
218 -       dh_book_tree_select_uri (DH_BOOK_TREE (widget->book_tree), uri);
219 -#endif
220 -       return FALSE;
221 -}
222 -
223 -static void
224 -devhelp_html_location_changed_cb (DhHtml      *html,
225 -                                const gchar *location,
226 -                                AnjutaDevhelp    *widget)
227 -{      
228 -       anjuta_devhelp_check_history (widget);
229 -}
230 -
231 -static gboolean
232 -html_view_create_html(HtmlView* html_view)
233 -{
234 -       GtkWidget* view;
235 -       HtmlViewPrivate* priv = html_view->priv;
236 -
237 -       priv->html = dh_html_new();
238 -       
239 -       if (!priv->html || !DH_IS_HTML(priv->html))     
240 -               return TRUE; /* I think the idea is to wait until we get a widget? */
241 -       
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);
244 -       
245 -       g_signal_connect (priv->html, "open-uri",
246 -                         G_CALLBACK (devhelp_html_open_uri_cb),
247 -                         priv->devhelp);
248 -       g_signal_connect (priv->html, "location-changed",
249 -                         G_CALLBACK (devhelp_html_location_changed_cb),
250 -                         priv->devhelp);
251 -       
252 -       /* Hack to get GtkMozEmbed to work properly. */
253 -       gtk_widget_realize (view);
254 -
255 -       if (priv->uri)
256 -               dh_html_open_uri(priv->html, priv->uri);
257 -       else
258 -               dh_html_clear(priv->html);
259 -       
260 -       gtk_widget_show (view);
261 -       
262 -       return FALSE;
263 -}
264 -
265 -static void
266 -html_view_realize(GtkWidget* widget)
267 -{
268 -       HtmlView* html_view = HTML_VIEW(widget);
269 -       
270 -       if (html_view->priv->idle_realize == 0)
271 -       {
272 -               html_view->priv->idle_realize =
273 -                       g_idle_add((GSourceFunc) html_view_create_html, html_view);
274 -       }       
275 -       (* GTK_WIDGET_CLASS (html_view_parent_class)->realize)(widget);
276 -}
277 -
278 -static void
279 -html_view_unrealize(GtkWidget* widget)
280 -{
281 -       HtmlView* html_view = HTML_VIEW(widget);
282 -       
283 -       if (html_view->priv->idle_realize > 0)
284 -       {
285 -               g_source_remove (html_view->priv->idle_realize);
286 -               html_view->priv->idle_realize = 0;
287 -       }
288 -       
289 -       if (html_view->priv->html != NULL)
290 -       {
291 -               g_free(html_view->priv->uri);
292 -               html_view->priv->uri = dh_html_get_location(html_view->priv->html);
293 -       }
294 -       else
295 -               html_view->priv->uri = NULL;
296 -       
297 -       if (gtk_container_get_children(GTK_CONTAINER(html_view)))
298 -       {
299 -               gtk_container_remove(GTK_CONTAINER(widget), dh_html_get_widget(html_view->priv->html));
300 -               html_view->priv->html = NULL;
301 -       }
302 -
303 -       (* GTK_WIDGET_CLASS (html_view_parent_class)->unrealize)(widget);
304 -}
305 -
306 -static void
307 -html_view_class_init(HtmlViewClass *klass)
308 -{
309 -       GObjectClass *object_class = G_OBJECT_CLASS(klass);
310 -       GtkWidgetClass* widget_class = GTK_WIDGET_CLASS(klass);
311 -
312 -       object_class->finalize = html_view_finalize;
313 -       
314 -       widget_class->realize = html_view_realize;
315 -       widget_class->unrealize = html_view_unrealize;
316 -}
317 -
318 -static void
319 -html_view_init(HtmlView *obj)
320 -{
321 -       obj->priv = g_new0(HtmlViewPrivate, 1);
322 -       gtk_widget_show(GTK_WIDGET(obj));
323 -}
324 -
325 -static void
326 -html_view_finalize(GObject *object)
327 -{
328 -       HtmlView *cobj;
329 -       cobj = HTML_VIEW(object);
330 -       
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);
337 -}
338 -
339 -GtkWidget*
340 -html_view_new(AnjutaDevhelp* devhelp)
341 -{
342 -       HtmlView *obj;
343 -       
344 -       obj = HTML_VIEW(g_object_new(HTML_TYPE_VIEW, NULL));
345 -       
346 -       obj->priv->devhelp = devhelp;
347 -       
348 -       return GTK_WIDGET(obj);
349 -}
350 -
351 -DhHtml* html_view_get_dh_html(HtmlView* view)
352 -{
353 -       return view->priv->html;
354 -}
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
358 @@ -1,57 +0,0 @@
359 -/*
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.
364 - *
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.
369 - *
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.
373 - */
374 -
375 -#ifndef HTMLVIEW_H
376 -#define HTMLVIEW_H
377 -
378 -#include <glib.h>
379 -#include <glib-object.h>
380 -#include <gtk/gtk.h>
381 -
382 -#include <devhelp/dh-html.h>
383 -
384 -#include "plugin.h"
385 -
386 -G_BEGIN_DECLS
387 -
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))
394 -
395 -typedef struct _HtmlView HtmlView;
396 -typedef struct _HtmlViewPrivate HtmlViewPrivate;
397 -typedef struct _HtmlViewClass HtmlViewClass;
398 -
399 -struct _HtmlView {
400 -       GtkHBox parent;
401 -       HtmlViewPrivate *priv;
402 -};
403 -
404 -struct _HtmlViewClass {
405 -       GtkHBoxClass parent_class;
406 -};
407 -
408 -GType html_view_get_type(void);
409 -GtkWidget *html_view_new(AnjutaDevhelp* devhelp);
410 -
411 -DhHtml* html_view_get_dh_html(HtmlView* html_view);
412 -
413 -G_END_DECLS
414 -
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
419 @@ -8,11 +8,7 @@
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
429  
430  # Plugin description file
431  plugin_in_files = anjuta-devhelp.plugin.in
432 @@ -46,20 +42,11 @@
433         plugin.c \
434         plugin.h
435  
436 -if HAVE_PLUGIN_DEVHELP
437 -libanjuta_devhelp_la_SOURCES += \
438 -       htmlview.c \
439 -       htmlview.h
440 -endif
441 -
442  # Plugin dependencies
443  libanjuta_devhelp_la_LIBADD = \
444         $(GTK_LIBS) \
445 -       $(LIBANJUTA_LIBS)
446 -
447 -if HAVE_PLUGIN_DEVHELP
448 -libanjuta_devhelp_la_LIBADD += $(PLUGIN_DEVHELP_LIBS)
449 -endif
450 +       $(LIBANJUTA_LIBS) \
451 +       $(PLUGIN_DEVHELP_LIBS)
452  
453  EXTRA_DIST = \
454         $(plugin_in_files) \
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
458 @@ -34,11 +34,12 @@
459  #ifndef DISABLE_EMBEDDED_DEVHELP
460  
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>
468 +
469 +#define ONLINE_API_DOCS "http://library.gnome.org/devel"
470 +
471  #define UI_FILE PACKAGE_DATA_DIR"/ui/anjuta-devhelp.ui"
472  
473  #else /* DISABLE_EMBEDDED_DEVHELP */
474 @@ -51,12 +52,8 @@
475  
476  #ifndef DISABLE_EMBEDDED_DEVHELP
477  
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"
481  
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"
485  
486  static void
487 @@ -74,76 +71,71 @@
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);
494  }
495  
496  static void
497 -devhelp_tree_link_selected_cb (GObject       *ignored,
498 -                             DhLink        *link,
499 -                             AnjutaDevhelp *widget)
500 +devhelp_tree_link_selected_cb (GObject       *ignored, DhLink *link,
501 +                                                          AnjutaDevhelp *widget)
502  {
503 +       gchar *uri;
504         
505 -       DhHtml       *html;
506 -
507         anjuta_shell_present_widget (ANJUTA_PLUGIN (widget)->shell,
508 -                                                                widget->htmlview, NULL);
509 +                                                                widget->view_sw, NULL);
510  
511 -       html = html_view_get_dh_html(HTML_VIEW(widget->htmlview));
512 -       
513 -       if (!DH_IS_HTML(html))
514 -               return;
515 +       uri = dh_link_get_uri (link);
516 +       webkit_web_view_open (WEBKIT_WEB_VIEW (widget->view), uri);
517 +       g_free (uri);
518         
519 -       dh_html_open_uri (html, link->uri);
520 -
521         anjuta_devhelp_check_history (widget);
522  }
523  
524  static void
525 -devhelp_search_link_selected_cb (GObject  *ignored,
526 -                               DhLink   *link,
527 -                                AnjutaDevhelp *widget)
528 +devhelp_search_link_selected_cb (GObject  *ignored, DhLink *link,
529 +                                                                AnjutaDevhelp *widget)
530  {
531 -       DhHtml       *html;
532 -
533 +       gchar *uri;
534 +       
535         anjuta_shell_present_widget (ANJUTA_PLUGIN (widget)->shell,
536 -                                                                widget->htmlview, NULL);
537 -
538 -       html = html_view_get_dh_html(HTML_VIEW(widget->htmlview));
539 -
540 -       if (!DH_IS_HTML(html))
541 -               return;
542 -
543 -       dh_html_open_uri (html, link->uri);
544 +                                                                widget->view_sw, NULL);
545  
546 +       uri = dh_link_get_uri (link);
547 +       webkit_web_view_open (WEBKIT_WEB_VIEW (widget->view), uri);
548 +       g_free (uri);
549 +       
550         anjuta_devhelp_check_history (widget);
551  }
552  
553  static void
554 -on_go_back_activate (GtkAction *action, AnjutaDevhelp *plugin)
555 +on_go_back_clicked (GtkWidget *widget, AnjutaDevhelp *plugin)
556  {
557 -       DhHtml* html;
558 +       anjuta_shell_present_widget (ANJUTA_PLUGIN (plugin)->shell,
559 +                                                                plugin->view_sw, NULL);
560  
561 -       html = html_view_get_dh_html(HTML_VIEW(plugin->htmlview));
562 +       webkit_web_view_go_back (WEBKIT_WEB_VIEW (plugin->view));
563         
564 -       if (!DH_IS_HTML(html))
565 -               return;
566 -               
567 -       dh_html_go_back(html);
568 +       anjuta_devhelp_check_history (plugin);
569  }
570  
571  static void
572 -on_go_forward_activate (GtkAction *action, AnjutaDevhelp *plugin)
573 +on_go_forward_clicked (GtkWidget *widget, AnjutaDevhelp *plugin)
574  {
575 -       DhHtml* html;
576 +       anjuta_shell_present_widget (ANJUTA_PLUGIN (plugin)->shell,
577 +                                                                plugin->view_sw, NULL);
578  
579 -       html = html_view_get_dh_html(HTML_VIEW(plugin->htmlview));
580 -       
581 -       if (!DH_IS_HTML(html))
582 -               return;
583 +       webkit_web_view_go_forward (WEBKIT_WEB_VIEW (plugin->view));
584         
585 -       dh_html_go_forward(html);
586 +       anjuta_devhelp_check_history (plugin);
587 +}
588 +
589 +static void
590 +on_online_clicked (GtkWidget* widget, AnjutaDevhelp* plugin)
591 +{
592 +       anjuta_shell_present_widget (ANJUTA_PLUGIN (plugin)->shell,
593 +                                                                plugin->view_sw, NULL);
594 +       webkit_web_view_open (WEBKIT_WEB_VIEW(plugin->view),
595 +                                                 ONLINE_API_DOCS);
596 +       anjuta_devhelp_check_history (plugin);
597  }
598  
599  static gboolean
600 @@ -151,7 +143,7 @@
601  {      
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);
606         return FALSE;
607  }
608  
609 @@ -173,7 +165,7 @@
610  }
611  
612  static gboolean
613 -context_idle(AnjutaDevhelp* plugin)
614 +context_idle (AnjutaDevhelp* plugin)
615  {
616         IAnjutaEditor *editor;
617         gchar *current_word;
618 @@ -232,22 +224,6 @@
619                 NULL,
620                 NULL
621         },
622 -       {
623 -               "ActionDevhelpBack",
624 -               ANJUTA_STOCK_HELP_PREV,
625 -               N_("Previous Help"),
626 -               NULL,
627 -               N_("Go to previous help page"),
628 -               G_CALLBACK (on_go_back_activate)
629 -       },
630 -       {
631 -               "ActionDevhelpForward",
632 -               ANJUTA_STOCK_HELP_NEXT,
633 -               N_("Next Help"),
634 -               NULL,
635 -               N_("Go to next help page"),
636 -               G_CALLBACK (on_go_forward_activate)
637 -       },
638  #endif /* DISABLE_EMBEDDED_DEVHELP */
639         {
640                 "ActionHelpApi",
641 @@ -282,7 +258,7 @@
642  /* Watches callbacks */
643  
644  static void
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)
648  {
649         GtkAction *action;
650 @@ -300,7 +276,7 @@
651  
652  static void
653  value_removed_current_editor (AnjutaPlugin *plugin,
654 -                                                         const char *name, gpointer data)
655 +                                                         const gchar *name, gpointer data)
656  {
657         GtkAction *action;
658         AnjutaDevhelp* devhelp = ANJUTA_PLUGIN_DEVHELP (data);  
659 @@ -311,10 +287,17 @@
660         g_object_set (action, "sensitive", FALSE, NULL);
661  }
662  
663 +#ifndef DISABLE_EMBEDDED_DEVHELP
664 +static void on_load_finished (GObject* view, GObject* frame, gpointer user_data)
665 +{
666 +       AnjutaDevhelp* devhelp = ANJUTA_PLUGIN_DEVHELP(user_data);
667 +       anjuta_devhelp_check_history(devhelp);
668 +}
669 +#endif
670 +
671  static gboolean
672  devhelp_activate (AnjutaPlugin *plugin)
673  {
674 -
675         AnjutaUI *ui;
676         AnjutaDevhelp *devhelp;
677  
678 @@ -323,15 +306,16 @@
679         GNode *books;
680         GList *keywords;
681         GtkWidget* books_sw;
682 +       GtkWidget *button_hbox;
683         
684         if (!init)
685         {
686                 register_stock_icons (plugin);
687                 init = TRUE;
688 -       }       
689 +       }
690  #endif
691  
692 -       DEBUG_PRINT ("AnjutaDevhelp: Activating AnjutaDevhelp plugin ...");
693 +       DEBUG_PRINT ("%s", "AnjutaDevhelp: Activating AnjutaDevhelp plugin ...");
694         devhelp = ANJUTA_PLUGIN_DEVHELP (plugin);
695  
696         /* Add all UI actions and merge UI */
697 @@ -346,47 +330,100 @@
698         devhelp->uiid = anjuta_ui_merge (ui, UI_FILE);
699  
700  #ifndef DISABLE_EMBEDDED_DEVHELP
701 -
702 +       /*
703 +        * Forward/back buttons
704 +        */
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);
709 +       
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);
716 +       
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);
723 +
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);
729 +       
730 +       gtk_box_pack_start (GTK_BOX (devhelp->main_vbox), button_hbox, FALSE, FALSE, 0);
731 +       
732 +       /*
733 +        * Notebook
734 +        */
735         books = dh_base_get_book_tree (devhelp->base);
736         keywords = dh_base_get_keywords (devhelp->base);
737         
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),
741 -                                       GTK_POLICY_NEVER,
742 -                                       GTK_POLICY_AUTOMATIC);
743 +                                                                       GTK_POLICY_NEVER,
744 +                                                                       GTK_POLICY_AUTOMATIC);
745         gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (books_sw),
746 -                                            GTK_SHADOW_IN);
747 +                                                                            GTK_SHADOW_IN);
748         gtk_container_set_border_width (GTK_CONTAINER (books_sw), 2);
749         
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,
755 +                                               TRUE, TRUE, 0);
756 +       devhelp->book_tree = dh_book_tree_new (books);
757 +       
758 +       devhelp->search = dh_search_new (keywords);
759 +       gtk_widget_set_size_request (devhelp->search, 0, 0);
760         
761         g_signal_connect (devhelp->book_tree,
762 -                         "link-selected",
763 -                         G_CALLBACK (devhelp_tree_link_selected_cb),
764 -                         devhelp);
765 +                                         "link-selected",
766 +                                         G_CALLBACK (devhelp_tree_link_selected_cb),
767 +                                         devhelp);
768         g_signal_connect (devhelp->search,
769 -                         "link-selected",
770 -                         G_CALLBACK (devhelp_search_link_selected_cb),
771 -                         devhelp);
772 -       
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")));
778 -       
779 -       devhelp->htmlview = html_view_new(devhelp);     
780 -
781 -       anjuta_shell_add_widget (plugin->shell, devhelp->control_notebook,
782 -                                                                "AnjutaDevhelpIndex", _("Help"), ANJUTA_STOCK_DEVHELP,
783 -                                                                ANJUTA_SHELL_PLACEMENT_LEFT, NULL);
784 +                                         "link-selected",
785 +                                         G_CALLBACK (devhelp_search_link_selected_cb),
786 +                                         devhelp);
787 +       
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")));
793 +       
794 +       gtk_widget_show_all (devhelp->control_notebook);
795 +       
796 +       /* View */
797 +       devhelp->view = webkit_web_view_new ();
798 +       gtk_widget_show (devhelp->view);
799 +       
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);
804 +       
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);
812 +
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);
825                                                                  
826  #endif /* DISABLE_EMBEDDED_DEVHELP */
827  
828 @@ -406,7 +443,7 @@
829         AnjutaUI *ui;
830         AnjutaDevhelp* devhelp = ANJUTA_PLUGIN_DEVHELP (plugin);
831  
832 -       DEBUG_PRINT ("AnjutaDevhelp: Dectivating AnjutaDevhelp plugin ...");
833 +       DEBUG_PRINT ("%s", "AnjutaDevhelp: Dectivating AnjutaDevhelp plugin ...");
834  
835  
836         ui = anjuta_shell_get_ui (plugin->shell, NULL);
837 @@ -415,8 +452,8 @@
838  #ifndef DISABLE_EMBEDDED_DEVHELP
839  
840         /* Remove widgets */
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);    
845  
846  #endif /* DISABLE_EMBEDDED_DEVHELP */
847         
848 @@ -431,47 +468,43 @@
849  
850  #ifndef DISABLE_EMBEDDED_DEVHELP
851  
852 -void anjuta_devhelp_check_history(AnjutaDevhelp* devhelp)
853 +void
854 +anjuta_devhelp_check_history (AnjutaDevhelp* devhelp)
855  {
856 -       GtkAction* action_forward;
857 -       GtkAction* action_back;
858 -       DhHtml* html = html_view_get_dh_html(HTML_VIEW(devhelp->htmlview));
859 -       
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");
864 -       if (html != NULL)
865 -       {
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);
868 -       }
869 +       gtk_widget_set_sensitive (devhelp->go_forward, webkit_web_view_can_go_forward (WEBKIT_WEB_VIEW (devhelp->view)));
870 +
871 +       gtk_widget_set_sensitive (devhelp->go_back, webkit_web_view_can_go_back (WEBKIT_WEB_VIEW (devhelp->view)));
872  }
873  
874  #endif /* DISABLE_EMBEDDED_DEVHELP */
875  
876 -#if 0
877  static void
878  devhelp_finalize (GObject *obj)
879  {
880 +       DEBUG_PRINT ("%s", "Finalising Devhelp plugin");
881 +
882         /* Finalization codes here */
883 -       AnjutaDevhelp *plugin = ANJUTA_PLUGIN_DEVHELP (obj);
884 -       
885         G_OBJECT_CLASS (parent_class)->finalize (obj);
886  }
887  
888  static void
889  devhelp_dispose (GObject *obj)
890  {
891 +       DEBUG_PRINT ("%s", "Disposing Devhelp plugin");
892 +       
893 +#ifndef DISABLE_EMBEDDED_DEVHELP
894         AnjutaDevhelp* devhelp = ANJUTA_PLUGIN_DEVHELP (obj);
895         
896 -       /* Destroy devhelp - seems not to work... */
897 -       // g_object_unref(G_OBJECT(devhelp->base));
898 +       if (devhelp->base)
899 +       {
900 +               g_object_unref(G_OBJECT(devhelp->base));
901 +               devhelp->base = NULL;
902 +       }
903 +#endif /* DISABLE_EMBEDDED_DEVHELP */
904  
905         /* Disposition codes */
906         G_OBJECT_CLASS (parent_class)->dispose (obj);
907  }
908 -#endif
909  
910  static void
911  devhelp_instance_init (GObject *obj)
912 @@ -497,10 +530,9 @@
913  
914         plugin_class->activate = devhelp_activate;
915         plugin_class->deactivate = devhelp_deactivate;
916 -#if 0
917 +       
918         klass->finalize = devhelp_finalize;
919         klass->dispose = devhelp_dispose;
920 -#endif
921  }
922  
923  #ifndef DISABLE_EMBEDDED_DEVHELP
924 @@ -513,9 +545,9 @@
925         plugin = ANJUTA_PLUGIN_DEVHELP (help);
926         
927         anjuta_shell_present_widget (ANJUTA_PLUGIN (plugin)->shell,
928 -                                                                plugin->control_notebook, NULL);
929 +                                                                plugin->main_vbox, NULL);
930         
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);
934  }
935  
936 @@ -524,34 +556,33 @@
937  static void
938  ihelp_search (IAnjutaHelp *help, const gchar *query, GError **err)
939  {
940 -       AnjutaDevhelp *plugin;
941 -       
942 -       plugin = ANJUTA_PLUGIN_DEVHELP (help);
943 +       gchar *cmd[4];
944         
945         if (!anjuta_util_prog_is_installed ("devhelp", TRUE))
946         {
947                 return;
948         }
949         
950 -       if(query && strlen (query) > 0)
951 +       cmd[0] = "devhelp";
952 +       
953 +       if (query && strlen (query) > 0)
954         {
955 -               fprintf(stderr, "Word is %s\n", query);
956 -               if(fork()==0)
957 -               {
958 -                       execlp("devhelp", "devhelp", "-s", query, NULL);
959 -                       g_warning (_("Cannot execute command: \"%s\""), "devhelp");
960 -                       _exit(1);
961 -               }
962 +               cmd[1] = "-s";
963 +               cmd[2] = (gchar *)query;
964 +               cmd[3] = NULL;  
965         }
966         else
967         {
968 -               if(fork()==0)
969 -               {
970 -                       execlp("devhelp", "devhelp", NULL);
971 -                       g_warning (_("Cannot execute command: \"%s\""), "devhelp");
972 -                       _exit(1);
973 -               }
974 +               cmd[1] = NULL;
975         }
976 +       
977 +       gdk_spawn_on_screen (gdk_screen_get_default (),
978 +                                            NULL,
979 +                                            cmd,
980 +                                            NULL,
981 +                                            G_SPAWN_SEARCH_PATH,
982 +                                            NULL,
983 +                                            NULL, NULL, NULL);
984  }
985  
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
990 @@ -49,10 +49,15 @@
991  #ifndef DISABLE_EMBEDDED_DEVHELP
992         DhBase         *base;
993  #endif /* DISABLE_EMBEDDED_DEVHELP */
994 -       GtkWidget     *htmlview;    
995 +       GtkWidget      *view;
996 +       GtkWidget      *view_sw;
997         GtkWidget      *control_notebook; 
998 +       GtkWidget      *main_vbox;
999         GtkWidget      *book_tree;
1000         GtkWidget      *search;
1001 +       GtkWidget      *go_back;
1002 +       GtkWidget      *go_forward;
1003 +       GtkWidget      *online;
1004         
1005         IAnjutaEditor   *editor;
1006         guint editor_watch_id;
This page took 0.142876 seconds and 3 git commands to generate.