~ubuntu-branches/ubuntu/hardy/evince/hardy-security

« back to all changes in this revision

Viewing changes to debian/patches/03_hildon_interface.patch

  • Committer: Bazaar Package Importer
  • Author(s): Adilson Oliveira
  • Date: 2007-09-25 09:38:38 UTC
  • Revision ID: james.westby@ubuntu.com-20070925093838-kkqmyb0kezyv5fh4
Tags: 2.20.0-0ubuntu2
* debian/patches/03_hildon_interface.patch
  Adds support for Hildon interface with including:
  - Registration of the program into the hildon enviromment.
  - D-bus processing via ossolib.
  - Changed selection and button event handling to match Hildon model.
  - Changes in accelerators handling Zoom, Fullscreen and Presentation
    modes.
  - Uses Hildon chooser dialog.
  - Selects the Hildon interface definition file when in Hildon mode.
  - If the arch is not lpia, the standard gtk interface is used.
  - Fixes interface rendering problem when compiled for lpia.
  - Adjusted the Makefile.am files to include the Hildon interface
    options and interface file evince-hildon-ui.xml.
* shell/evince-hildon-ui.xml
  Modified interface file.
  - This file is selected for instalation at build time only if the
    package is built for lpia, if not, the usual evince-hildon-ui.xml
    is installed.
* debian/control:
  - Build-Depends update.
* debian/rules
  - Added configuration for lpia arch.
* Moved configure.ac patch to 03_hildon_interface.patch.
* Moved new changes in autoconf result to 90_autoreconf.patch.
* debian/patches/90_autoreconf.patch
  - Result of autoconf and automake, necessary to adjust the Makefile.in
    files after the changes done in 03_hildon_interface.patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
diff -Nur evince-2.20.0/data/evince-hildon-ui.xml evince-2.20.0.new/data/evince-hildon-ui.xml
 
2
--- evince-2.20.0/data/evince-hildon-ui.xml     1969-12-31 21:00:00.000000000 -0300
 
3
+++ evince-2.20.0.new/data/evince-hildon-ui.xml 2007-09-18 22:28:49.000000000 -0300
 
4
@@ -0,0 +1,103 @@
 
5
+<ui>
 
6
+  <popup name="MainMenu">
 
7
+    <menu name="FileMenu" action="File">
 
8
+      <menuitem name="FileOpenMenu" action="FileOpen"/>
 
9
+      <menuitem name="FileSaveAsMenu" action="FileSaveAs"/>
 
10
+      <separator/>
 
11
+      <menuitem name="FilePropertiesMenu" action="FileProperties"/>
 
12
+      <separator/>
 
13
+      <placeholder name="RecentFilesMenu"/>
 
14
+      <menuitem name="FileCloseWindowMenu" action="FileCloseWindow"/>
 
15
+    </menu>
 
16
+
 
17
+    <menu name="EditMenu" action="Edit">
 
18
+      <menuitem name="EditCopyMenu" action="EditCopy"/>
 
19
+      <separator/>
 
20
+      <menuitem name="EditSelectAllMenu" action="EditSelectAll"/>
 
21
+      <separator/>
 
22
+      <menuitem name="EditFindMenu" action="EditFind"/>
 
23
+      <menuitem name="EditFindNextMenu" action="EditFindNext"/>
 
24
+      <separator/>
 
25
+      <menuitem name="EditRotateLeftMenu" action="EditRotateLeft"/>
 
26
+      <menuitem name="EditRotateRigtMenu" action="EditRotateRight"/>
 
27
+    </menu>
 
28
+
 
29
+    <menu name="ViewMenu" action="View">
 
30
+      <menuitem name="ViewToolbarMenu" action="ViewToolbar"/>
 
31
+      <menuitem name="ViewSidebarMenu" action="ViewSidebar"/>
 
32
+      <separator/>
 
33
+      <menuitem name="ViewFullscreenMenu" action="ViewFullscreen"/>
 
34
+      <menuitem name="ViewPresentationMenu" action="ViewPresentation"/>
 
35
+      <separator/>
 
36
+      <menuitem name="ViewContinuousMenu" action="ViewContinuous"/>
 
37
+      <menuitem name="ViewDualMenu" action="ViewDual"/>
 
38
+      <menuitem name="ViewZoomInMenu" action="ViewZoomIn"/>
 
39
+      <menuitem name="ViewZoomInMenu" action="ViewZoomIn"/>
 
40
+      <menuitem name="ViewZoomOutMenu" action="ViewZoomOut"/>
 
41
+      <menuitem name="ViewBestFitMenu" action="ViewBestFit"/>
 
42
+      <menuitem name="ViewPageWidthMenu" action="ViewPageWidth"/>
 
43
+      <separator/>
 
44
+      <menuitem name="ViewReload" action="ViewReload"/>
 
45
+    </menu>
 
46
+
 
47
+    <menu name="GoMenu" action="Go">
 
48
+      <menuitem name="GoPreviousPageMenu" action="GoPreviousPage"/>
 
49
+      <menuitem name="GoNextPageMenu" action="GoNextPage"/>
 
50
+      <separator/>
 
51
+      <menuitem name="GoFirstPageMenu" action="GoFirstPage"/>
 
52
+      <menuitem name="GoLastPageMenu" action="GoLastPage"/>
 
53
+    </menu>
 
54
+
 
55
+    <menu name="HelpMenu" action="Help">
 
56
+      <menuitem name="HelpAboutMenu" action="HelpAbout"/>
 
57
+    </menu>
 
58
+  </popup>
 
59
+
 
60
+  <popup name="DocumentPopup" action="PopupAction">
 
61
+    <menuitem name="OpenLink" action="OpenLink"/>
 
62
+    <menuitem name="CopyLinkAddress" action="CopyLinkAddress"/>
 
63
+    <menuitem name="GoLink" action="GoLink"/>
 
64
+    <separator/>
 
65
+    <menuitem name="GoPreviousPage" action="GoPreviousPage"/>
 
66
+    <menuitem name="GoNextPage" action="GoNextPage"/>
 
67
+    <menuitem name="ViewReload" action="ViewReload"/>
 
68
+    <separator/>
 
69
+    <menuitem name="EditCopy" action="EditCopy"/>
 
70
+    <menuitem name="EditSelectAllPopup" action="EditSelectAll"/>
 
71
+  </popup>
 
72
+
 
73
+  <toolbar name="DefaultToolBar">
 
74
+    <toolitem action="FileOpen"/>
 
75
+    <separator/>
 
76
+    <toolitem action="GoFirstPage"/>
 
77
+    <toolitem action="GoPreviousPage"/>
 
78
+    <toolitem action="PageSelector"/>
 
79
+    <toolitem action="GoNextPage"/>
 
80
+    <toolitem action="GoLastPage"/>
 
81
+    <separator/>
 
82
+    <toolitem action="ViewZoom"/>
 
83
+  </toolbar>
 
84
+
 
85
+  <accelerator name="PageDownAccel" action="PageDown"/>
 
86
+  <accelerator name="PageUpAccel" action="PageUp"/>
 
87
+  <accelerator name="GoBackwardFastAccel" action="GoBackwardFast"/>
 
88
+  <accelerator name="GoForwardFastAccel" action="GoForwardFast"/>
 
89
+  <accelerator name="EscapeAccel" action="Escape"/>
 
90
+  <accelerator name="SlashAccel" action="Slash"/>
 
91
+  <accelerator name="SpaceAccel" action="Space"/>
 
92
+  <accelerator name="ReturnAccel" action="Return"/>
 
93
+  <accelerator name="BackSpaceAccel" action="BackSpace"/>
 
94
+  <accelerator name="ShiftSpaceAccel" action="ShiftSpace"/>
 
95
+  <accelerator name="ShiftBackSpaceAccel" action="ShiftBackSpace"/>
 
96
+  <accelerator name="ShiftReturnAccel" action="ShiftReturn"/>
 
97
+  <accelerator name="FocusPageSelectorAccel" action="FocusPageSelector"/>
 
98
+  <accelerator name="PlusAccel" action="Plus"/>
 
99
+  <accelerator name="MinusAccel" action="Minus"/>
 
100
+  <accelerator name="Equal" action="Equal"/>
 
101
+  <accelerator name="CtrlEqualAccel" action="CtrlEqual"/>
 
102
+  <accelerator name="KpPlusAccel" action="KpPlus"/>
 
103
+  <accelerator name="KpMinusAccel" action="KpMinus"/>
 
104
+  <accelerator name="CtrlKpPlusAccel" action="CtrlKpPlus"/>
 
105
+  <accelerator name="CtrlKpMinusAccel" action="CtrlKpMinus"/>
 
106
+  
 
107
+</ui>
 
108
diff -Nur evince-2.20.0/data/evince.service evince-2.20.0.new/data/evince.service
 
109
--- evince-2.20.0/data/evince.service   1969-12-31 21:00:00.000000000 -0300
 
110
+++ evince-2.20.0.new/data/evince.service       2007-09-18 22:28:49.000000000 -0300
 
111
@@ -0,0 +1,3 @@
 
112
+[D-BUS Service]
 
113
+Name=com.nokia.evince
 
114
+Exec=/usr/bin/evince
 
115
diff -Nur evince-2.20.0/shell/ev-application.c evince-2.20.0.new/shell/ev-application.c
 
116
--- evince-2.20.0/shell/ev-application.c        2007-09-17 13:19:25.000000000 -0300
 
117
+++ evince-2.20.0.new/shell/ev-application.c    2007-09-18 22:28:49.000000000 -0300
 
118
@@ -399,7 +399,7 @@
 
119
        }
 
120
        ev_application_add_icon_path_for_screen (screen);
 
121
        
 
122
-       gtk_widget_show (new_window);
 
123
+       gtk_widget_show_all (new_window);
 
124
        
 
125
        gtk_window_present_with_time (GTK_WINDOW (new_window),
 
126
                                      timestamp);
 
127
diff -Nur evince-2.20.0/shell/ev-view.c evince-2.20.0.new/shell/ev-view.c
 
128
--- evince-2.20.0/shell/ev-view.c       2007-09-17 13:19:25.000000000 -0300
 
129
+++ evince-2.20.0.new/shell/ev-view.c   2007-09-18 22:28:49.000000000 -0300
 
130
@@ -113,6 +113,14 @@
 
131
 
 
132
 #define SCROLL_TIME 150
 
133
 
 
134
+#ifdef USE_HILDON
 
135
+#define SCROLL_BUTTON 1
 
136
+#define SELECT_BUTTON 2
 
137
+#else
 
138
+#define SCROLL_BUTTON 2
 
139
+#define SELECT_BUTTON 1
 
140
+#endif
 
141
+
 
142
 /*** Scrolling ***/
 
143
 static void       scroll_to_current_page                    (EvView *view,
 
144
                                                              GtkOrientation orientation);
 
145
@@ -2643,7 +2651,7 @@
 
146
        view->selection_info.in_drag = FALSE;
 
147
        
 
148
        switch (event->button) {
 
149
-               case 1: {
 
150
+               case SELECT_BUTTON: {
 
151
                        EvImage *image;
 
152
                        EvFormField *field;
 
153
 
 
154
@@ -2679,7 +2687,7 @@
 
155
                        }
 
156
                }                       
 
157
                        return TRUE;
 
158
-               case 2:
 
159
+               case SCROLL_BUTTON:
 
160
                        /* use root coordinates as reference point because
 
161
                         * scrolling changes window relative coordinates */
 
162
                        view->drag_info.start.x = event->x_root;
 
163
@@ -2916,7 +2924,7 @@
 
164
        /* For the Evince 0.4.x release, we limit selection to un-rotated
 
165
         * documents only.
 
166
         */
 
167
-       if (view->pressed_button == 1 && view->rotation == 0) {
 
168
+       if (view->pressed_button == SELECT_BUTTON && view->rotation == 0) {
 
169
 
 
170
                /* Schedule timeout to scroll during selection and additionally 
 
171
                 * scroll once to allow arbitrary speed. */
 
172
@@ -2938,7 +2946,7 @@
 
173
                        view->selection_update_id = g_idle_add ((GSourceFunc)selection_update_idle_cb, view);
 
174
 
 
175
                return TRUE;
 
176
-       } else if (view->pressed_button == 2) {
 
177
+       } else if (view->pressed_button == SCROLL_BUTTON) {
 
178
                if (!view->drag_info.in_drag) {
 
179
                        gboolean start;
 
180
 
 
181
@@ -2992,7 +3000,7 @@
 
182
        view->drag_info.in_drag = FALSE;
 
183
        view->image_dnd_info.in_drag = FALSE;
 
184
 
 
185
-       if (view->pressed_button == 2) {
 
186
+       if (view->pressed_button == SCROLL_BUTTON) {
 
187
                ev_view_handle_cursor_over_xy (view, event->x, event->y);
 
188
        }
 
189
 
 
190
diff -Nur evince-2.20.0/shell/ev-window.c evince-2.20.0.new/shell/ev-window.c
 
191
--- evince-2.20.0/shell/ev-window.c     2007-09-18 22:28:48.000000000 -0300
 
192
+++ evince-2.20.0.new/shell/ev-window.c 2007-09-18 22:28:49.000000000 -0300
 
193
@@ -87,6 +87,12 @@
 
194
 #include <glib/gstdio.h>
 
195
 #include <glib/gi18n.h>
 
196
 #include <gtk/gtk.h>
 
197
+
 
198
+#ifdef USE_HILDON
 
199
+#include <hildon/hildon-program.h>
 
200
+#include <hildon/hildon-file-chooser-dialog.h>
 
201
+#endif
 
202
+
 
203
 #include <libgnomevfs/gnome-vfs-utils.h>
 
204
 #include <libgnomevfs/gnome-vfs-async-ops.h>
 
205
 #include <libgnomevfs/gnome-vfs-ops.h>
 
206
@@ -99,6 +105,12 @@
 
207
 #include <string.h>
 
208
 #include <unistd.h>
 
209
 
 
210
+#ifdef USE_HILDON
 
211
+#define UI_FILE "evince-hildon-ui.xml"
 
212
+#else
 
213
+#define UI_FILE "evince-ui.xml"
 
214
+#endif
 
215
+
 
216
 #if !GLIB_CHECK_VERSION (2, 13, 3)
 
217
 char *xdg_user_dir_lookup (char *type);
 
218
 #endif
 
219
@@ -204,6 +216,9 @@
 
220
        GtkPrintSettings *print_settings;
 
221
        GtkPageSetup     *print_page_setup;
 
222
 #endif
 
223
+#ifdef USE_HILDON
 
224
+       HildonProgram    *hildon_program;
 
225
+#endif
 
226
 };
 
227
 
 
228
 #define EV_WINDOW_GET_PRIVATE(object) \
 
229
@@ -281,8 +296,11 @@
 
230
 static void     find_bar_search_changed_cb              (EggFindBar       *find_bar,
 
231
                                                         GParamSpec       *param,
 
232
                                                         EvWindow         *ev_window);
 
233
-
 
234
+#ifdef USE_HILDON
 
235
+G_DEFINE_TYPE (EvWindow, ev_window, HILDON_TYPE_WINDOW)
 
236
+#else
 
237
 G_DEFINE_TYPE (EvWindow, ev_window, GTK_TYPE_WINDOW)
 
238
+#endif
 
239
 
 
240
 static void
 
241
 ev_window_set_action_sensitive (EvWindow   *ev_window,
 
242
@@ -491,12 +509,14 @@
 
243
 static void
 
244
 set_widget_visibility (GtkWidget *widget, gboolean visible)
 
245
 {
 
246
-       g_assert (GTK_IS_WIDGET (widget));
 
247
-       
 
248
-       if (visible)
 
249
-               gtk_widget_show (widget);
 
250
-       else
 
251
-               gtk_widget_hide (widget);
 
252
+       if (widget) {
 
253
+               g_assert (GTK_IS_WIDGET (widget));
 
254
+
 
255
+               if (visible)
 
256
+                       gtk_widget_show (widget);
 
257
+               else
 
258
+                       gtk_widget_hide (widget);
 
259
+       }
 
260
 }
 
261
 
 
262
 static void
 
263
@@ -1557,6 +1577,12 @@
 
264
 ev_window_cmd_file_open (GtkAction *action, EvWindow *window)
 
265
 {
 
266
        GtkWidget *chooser;
 
267
+       gboolean select_multiple = TRUE;
 
268
+
 
269
+#ifdef USE_HILDON
 
270
+       chooser = hildon_file_chooser_dialog_new (GTK_WINDOW (window), GTK_FILE_CHOOSER_ACTION_OPEN);
 
271
+       select_multiple = FALSE;
 
272
+#else
 
273
 
 
274
        chooser = gtk_file_chooser_dialog_new (_("Open Document"),
 
275
                                               GTK_WINDOW (window),
 
276
@@ -1565,9 +1591,10 @@
 
277
                                               GTK_RESPONSE_CANCEL,
 
278
                                               GTK_STOCK_OPEN, GTK_RESPONSE_OK,
 
279
                                               NULL);
 
280
+#endif
 
281
 
 
282
        ev_document_factory_add_filters (chooser, NULL);
 
283
-       gtk_file_chooser_set_select_multiple (GTK_FILE_CHOOSER (chooser), TRUE);
 
284
+       gtk_file_chooser_set_select_multiple (GTK_FILE_CHOOSER (chooser), select_multiple);
 
285
        gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (chooser), FALSE);
 
286
        if (ev_application_get_chooser_uri (EV_APP) != NULL) {
 
287
                gtk_file_chooser_set_uri (GTK_FILE_CHOOSER (chooser),
 
288
@@ -2059,12 +2086,16 @@
 
289
        gchar *folder;
 
290
 #endif
 
291
 
 
292
+#ifdef USE_HILDON
 
293
+       fc = hildon_file_chooser_dialog_new (GTK_WINDOW (ev_window), GTK_FILE_CHOOSER_ACTION_SAVE);
 
294
+#else
 
295
        fc = gtk_file_chooser_dialog_new (
 
296
                _("Save a Copy"),
 
297
                GTK_WINDOW (ev_window), GTK_FILE_CHOOSER_ACTION_SAVE,
 
298
                GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
 
299
                GTK_STOCK_SAVE, GTK_RESPONSE_OK,
 
300
                NULL);
 
301
+#endif
 
302
 
 
303
        ev_document_factory_add_filters (fc, ev_window->priv->document);
 
304
        gtk_dialog_set_default_response (GTK_DIALOG (fc), GTK_RESPONSE_OK);
 
305
@@ -4238,6 +4269,13 @@
 
306
                priv->presentation_timeout_id = 0;
 
307
        }
 
308
 
 
309
+#ifdef USE_HILDON
 
310
+       if (window->priv->hildon_program != NULL) {
 
311
+               g_object_unref (window->priv->hildon_program);
 
312
+               window->priv->hildon_program = NULL;
 
313
+       }
 
314
+#endif
 
315
+
 
316
        G_OBJECT_CLASS (ev_window_parent_class)->dispose (object);
 
317
 }
 
318
 
 
319
@@ -4255,6 +4293,18 @@
 
320
        g_type_class_add_private (g_object_class, sizeof (EvWindowPrivate));
 
321
 }
 
322
 
 
323
+#ifdef USE_HILDON
 
324
+#define ZOOM_IN_ACCEL "F7"
 
325
+#define ZOOM_OUT_ACCEL "F8"
 
326
+#define FULLSCREEN_ACCEL "F6"
 
327
+#define PRESENTATION_ACCEL NULL
 
328
+#else
 
329
+#define ZOOM_IN_ACCEL "<control>plus"
 
330
+#define ZOOM_OUT_ACCEL "<control>minus"
 
331
+#define FULLSCREEN_ACCEL "F11"
 
332
+#define PRESENTATION_ACCEL "F5"
 
333
+#endif
 
334
+
 
335
 /* Normal items */
 
336
 static const GtkActionEntry entries[] = {
 
337
        { "File", NULL, N_("_File") },
 
338
@@ -4308,10 +4358,10 @@
 
339
          G_CALLBACK (ev_window_cmd_edit_rotate_right) },
 
340
 
 
341
         /* View menu */
 
342
-        { "ViewZoomIn", GTK_STOCK_ZOOM_IN, NULL, "<control>plus",
 
343
+        { "ViewZoomIn", GTK_STOCK_ZOOM_IN, NULL, "ZOOM_IN_ACCEL",
 
344
           N_("Enlarge the document"),
 
345
           G_CALLBACK (ev_window_cmd_view_zoom_in) },
 
346
-        { "ViewZoomOut", GTK_STOCK_ZOOM_OUT, NULL, "<control>minus",
 
347
+        { "ViewZoomOut", GTK_STOCK_ZOOM_OUT, NULL, "ZOOM_OUT_ACCEL",
 
348
           N_("Shrink the document"),
 
349
           G_CALLBACK (ev_window_cmd_view_zoom_out) },
 
350
         { "ViewReload", GTK_STOCK_REFRESH, N_("_Reload"), "<control>R",
 
351
@@ -4410,10 +4460,10 @@
 
352
         { "ViewDual", EV_STOCK_VIEW_DUAL, N_("_Dual"), NULL,
 
353
          N_("Show two pages at once"),
 
354
          G_CALLBACK (ev_window_cmd_dual), FALSE },
 
355
-        { "ViewFullscreen", GTK_STOCK_FULLSCREEN, N_("_Fullscreen"), "F11",
 
356
+        { "ViewFullscreen", GTK_STOCK_FULLSCREEN, N_("_Fullscreen"), "FULLSCREEN_ACCEL",
 
357
           N_("Expand the window to fill the screen"),
 
358
           G_CALLBACK (ev_window_cmd_view_fullscreen) },
 
359
-        { "ViewPresentation", EV_STOCK_RUN_PRESENTATION, N_("_Presentation"), "F5",
 
360
+        { "ViewPresentation", EV_STOCK_RUN_PRESENTATION, N_("_Presentation"), "PRESENTATION_ACCEL",
 
361
           N_("Run document as a presentation"),
 
362
           G_CALLBACK (ev_window_cmd_view_presentation) },
 
363
         { "ViewBestFit", EV_STOCK_ZOOM_PAGE, N_("_Best Fit"), NULL,
 
364
@@ -4936,6 +4986,9 @@
 
365
        if (!window->priv->image)
 
366
                return;
 
367
 
 
368
+#ifdef USE_HILDON
 
369
+       fc = hildon_file_chooser_dialog_new (GTK_WINDOW (window), GTK_FILE_CHOOSER_ACTION_SAVE);
 
370
+#else
 
371
        fc = gtk_file_chooser_dialog_new (_("Save Image"),
 
372
                                          GTK_WINDOW (window),
 
373
                                          GTK_FILE_CHOOSER_ACTION_SAVE,
 
374
@@ -4943,6 +4996,7 @@
 
375
                                          GTK_RESPONSE_CANCEL,
 
376
                                          GTK_STOCK_SAVE, GTK_RESPONSE_OK,
 
377
                                          NULL);
 
378
+#endif
 
379
 
 
380
        gtk_dialog_set_default_response (GTK_DIALOG (fc), GTK_RESPONSE_OK);
 
381
        gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (fc), FALSE);
 
382
@@ -5096,6 +5150,9 @@
 
383
        if (g_list_length (window->priv->attach_list) == 1)
 
384
                attachment = (EvAttachment *) window->priv->attach_list->data;
 
385
        
 
386
+#ifdef USE_HILDON
 
387
+       fc = hildon_file_chooser_dialog_new (GTK_WINDOW (window), attachment ? GTK_FILE_CHOOSER_ACTION_SAVE : GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER);
 
388
+#else
 
389
        fc = gtk_file_chooser_dialog_new (
 
390
                _("Save Attachment"),
 
391
                GTK_WINDOW (window),
 
392
@@ -5104,6 +5161,7 @@
 
393
                GTK_RESPONSE_CANCEL,
 
394
                GTK_STOCK_SAVE, GTK_RESPONSE_OK,
 
395
                NULL);
 
396
+#endif
 
397
 
 
398
        gtk_dialog_set_default_response (GTK_DIALOG (fc), GTK_RESPONSE_OK);
 
399
        gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (fc), TRUE);
 
400
@@ -5127,6 +5185,10 @@
 
401
        GtkAccelGroup *accel_group;
 
402
        GError *error = NULL;
 
403
        GtkWidget *sidebar_widget;
 
404
+       gchar *ui_file = NULL;
 
405
+#ifdef USE_HILDON
 
406
+       static HildonProgram * hildon_prog = NULL;
 
407
+#endif
 
408
 
 
409
        g_signal_connect (ev_window, "configure_event",
 
410
                          G_CALLBACK (window_configure_event_cb), NULL);
 
411
@@ -5135,6 +5197,17 @@
 
412
 
 
413
        ev_window->priv = EV_WINDOW_GET_PRIVATE (ev_window);
 
414
 
 
415
+#ifdef USE_HILDON
 
416
+       if (hildon_prog == NULL) {
 
417
+               hildon_prog = HILDON_PROGRAM (hildon_program_get_instance ());
 
418
+       } else {
 
419
+               g_object_ref (hildon_prog);
 
420
+       }
 
421
+
 
422
+       ev_window->priv->hildon_program = hildon_prog;
 
423
+       hildon_program_add_window (ev_window->priv->hildon_program, HILDON_WINDOW (ev_window));
 
424
+#endif
 
425
+
 
426
        ev_window->priv->page_mode = PAGE_MODE_DOCUMENT;
 
427
        ev_window->priv->title = ev_window_title_new (ev_window);
 
428
 
 
429
@@ -5181,13 +5254,16 @@
 
430
        gtk_ui_manager_insert_action_group (ev_window->priv->ui_manager,
 
431
                                            action_group, 0);
 
432
 
 
433
+       ui_file = g_build_filename (DATADIR, UI_FILE, NULL);
 
434
        if (!gtk_ui_manager_add_ui_from_file (ev_window->priv->ui_manager,
 
435
-                                             DATADIR"/evince-ui.xml",
 
436
+                                             ui_file,
 
437
                                              &error)) {
 
438
                g_warning ("building menus failed: %s", error->message);
 
439
                g_error_free (error);
 
440
        }
 
441
        
 
442
+       g_free (ui_file);
 
443
+
 
444
 #ifdef HAVE_GTK_RECENT
 
445
 #if GTK_CHECK_VERSION(2,11,4)
 
446
        ev_window->priv->recent_manager = gtk_recent_manager_get_default ();
 
447
@@ -5207,6 +5283,13 @@
 
448
        launchpad_integration_add_ui (ev_window->priv->ui_manager,
 
449
                                      "/MainMenu/HelpMenu/LaunchpadItems");
 
450
        
 
451
+#ifdef USE_HILDON
 
452
+       hildon_window_set_menu (HILDON_WINDOW (ev_window),
 
453
+                               GTK_MENU (gtk_ui_manager_get_widget (ev_window->priv->ui_manager, "/MainMenu")));
 
454
+       ev_window->priv->toolbar = gtk_ui_manager_get_widget (ev_window->priv->ui_manager, "/DefaultToolBar");
 
455
+       hildon_window_add_toolbar (HILDON_WINDOW (ev_window), GTK_TOOLBAR (ev_window->priv->toolbar));
 
456
+       gtk_widget_show (ev_window->priv->toolbar);
 
457
+#else
 
458
        ev_window->priv->menubar =
 
459
                 gtk_ui_manager_get_widget (ev_window->priv->ui_manager,
 
460
                                            "/MainMenu");
 
461
@@ -5227,6 +5310,7 @@
 
462
        gtk_box_pack_start (GTK_BOX (ev_window->priv->main_box),
 
463
                            ev_window->priv->toolbar,
 
464
                            FALSE, FALSE, 0);
 
465
+#endif
 
466
        gtk_widget_show (ev_window->priv->toolbar);
 
467
 
 
468
        /* Add the main area */
 
469
diff -Nur evince-2.20.0/shell/ev-window.h evince-2.20.0.new/shell/ev-window.h
 
470
--- evince-2.20.0/shell/ev-window.h     2007-09-17 13:19:25.000000000 -0300
 
471
+++ evince-2.20.0.new/shell/ev-window.h 2007-09-18 22:28:49.000000000 -0300
 
472
@@ -27,6 +27,10 @@
 
473
 #include <gtk/gtkwindow.h>
 
474
 #include <gtk/gtkscrolledwindow.h>
 
475
 
 
476
+#ifdef USE_HILDON
 
477
+#include <hildon/hildon-window.h>
 
478
+#endif
 
479
+
 
480
 #include "ev-link.h"
 
481
 #include "ev-page-cache.h"
 
482
 
 
483
@@ -63,12 +67,20 @@
 
484
 
 
485
 
 
486
 struct _EvWindow {
 
487
+#ifdef USE_HILDON
 
488
+       HildonWindow            base_instance;
 
489
+#else
 
490
        GtkWindow               base_instance;
 
491
+#endif
 
492
        EvWindowPrivate         *priv;
 
493
 };
 
494
 
 
495
 struct _EvWindowClass {
 
496
+#ifdef USE_HILDON
 
497
+       HildonWindowClass       base_class;
 
498
+#else
 
499
        GtkWindowClass          base_class;
 
500
+#endif
 
501
 };
 
502
 
 
503
 GType          ev_window_get_type        (void);
 
504
diff -Nur evince-2.20.0/shell/main.c evince-2.20.0.new/shell/main.c
 
505
--- evince-2.20.0/shell/main.c  2007-09-17 13:19:25.000000000 -0300
 
506
+++ evince-2.20.0.new/shell/main.c      2007-09-18 22:28:49.000000000 -0300
 
507
@@ -42,6 +42,10 @@
 
508
 #include <dbus/dbus-glib-bindings.h>
 
509
 #endif
 
510
 
 
511
+#ifdef USE_HILDON
 
512
+#include <libosso.h>
 
513
+#endif
 
514
+
 
515
 #include "ev-stock-icons.h"
 
516
 #include "ev-job-queue.h"
 
517
 #include "ev-file-helpers.h"
 
518
@@ -310,6 +314,9 @@
 
519
        char *accel_filename;
 
520
        GError *error = NULL;
 
521
 #endif
 
522
+#ifdef USE_HILDON
 
523
+       osso_context_t *osso_context = NULL;
 
524
+#endif
 
525
 
 
526
        context = g_option_context_new (_("GNOME Document Viewer"));
 
527
 
 
528
@@ -324,6 +331,10 @@
 
529
        g_option_context_add_main_entries (context, goption_options, NULL);
 
530
 #endif
 
531
 
 
532
+#ifdef USE_HILDON
 
533
+       osso_context = osso_initialize (PACKAGE, VERSION, TRUE, NULL);
 
534
+#endif
 
535
+
 
536
 #if WITH_GNOME
 
537
        program = gnome_program_init (PACKAGE, VERSION,
 
538
                                      LIBGNOMEUI_MODULE, argc, argv,
 
539
@@ -382,6 +393,13 @@
 
540
 
 
541
        gtk_main ();
 
542
 
 
543
+#ifdef USE_HILDON
 
544
+       if (osso_context != NULL) {
 
545
+               osso_deinitialize (osso_context);
 
546
+       }
 
547
+#endif
 
548
+
 
549
+
 
550
 #if WITH_GNOME
 
551
        gnome_accelerators_sync ();
 
552
 #else
 
553
diff -Nur evince-2.20.0/configure.ac evince-2.20.0.new/configure.ac
 
554
--- evince-2.20.0/configure.ac  2007-09-18 22:49:25.000000000 -0300
 
555
+++ evince-2.20.0.new/configure.ac      2007-09-18 22:49:26.000000000 -0300
 
556
@@ -59,6 +59,33 @@
 
557
 PKG_CHECK_MODULES(FRONTEND_CORE, gtk+-2.0 >= $GTK_REQUIRED libglade-2.0 gnome-vfs-2.0)
 
558
 PKG_CHECK_MODULES(SHELL_CORE, libxml-2.0 >= $LIBXML_REQUIRED gtk+-2.0 >= $GTK_REQUIRED launchpad-integration gnome-icon-theme >= $GNOME_ICON_THEME_REQUIRED gnome-vfs-2.0 libglade-2.0 gconf-2.0 gnome-keyring-1 >= $KEYRING_REQUIRED)
 
559
 
 
560
+dnl ==============================================
 
561
+dnl Maemo/Hildon based User Interface
 
562
+
 
563
+AC_ARG_ENABLE(hildon,
 
564
+       AC_HELP_STRING([--enable-hildon],[Build with Maemo/Hildon support]),
 
565
+    enable_hildon="$enableval",
 
566
+    enable_hildon=no)
 
567
+
 
568
+if test "x$enable_hildon" = "xyes" ; then
 
569
+    PKG_CHECK_MODULES(HILDON,
 
570
+                      hildon-1 hildon-fm-2 libosso,
 
571
+                      HAVE_HILDON=yes, HAVE_HILDON=no)
 
572
+fi
 
573
+
 
574
+if test "x$HAVE_HILDON" = "xyes" ; then
 
575
+    AC_DEFINE(USE_HILDON, 1, [Build with Maemo/Hildon support])
 
576
+fi
 
577
+
 
578
+AM_CONDITIONAL(USE_HILDON, test "x$HAVE_HILDON" = "xyes")
 
579
+
 
580
+HILDON_CFLAGS="$HILDON_CFLAGS -DUSE_STABLE_LIBGNOMEUI"
 
581
+AC_SUBST(HILDON_CFLAGS)
 
582
+AC_SUBST(HILDON_LIBS)
 
583
+
 
584
+dnl ==============================================
 
585
+dnl GNOME libs
 
586
+
 
587
 AC_ARG_WITH(libgnome,
 
588
         AC_HELP_STRING([--without-libgnome],[disable the use of libgnome]),
 
589
        [case "${withval}" in
 
590
@@ -498,6 +525,7 @@
 
591
 echo "
 
592
 Configure summary:
 
593
        GNOME Support......:  $WITH_GNOME
 
594
+       Hildon Support.....:  $HAVE_HILDON
 
595
        Print Support......:  $enable_print
 
596
        DBUS Support.......:  $enable_dbus
 
597
        Nautilus Plugin....:  $HAVE_NAUTILUS
 
598
diff -Nur evince-2.20.0/shell/Makefile.am evince-2.20.0.new/shell/Makefile.am
 
599
--- evince-2.20.0/shell/Makefile.am     2007-09-24 14:23:16.000000000 -0300
 
600
+++ evince-2.20.0.new/shell/Makefile.am 2007-09-24 14:28:40.000000000 -0300
 
601
@@ -12,7 +12,8 @@
 
602
        $(WARN_CFLAGS)                                  \
 
603
        $(DISABLE_DEPRECATED)                           \
 
604
        $(GNOME_PRINT_CFLAGS)                           \
 
605
-       $(GTK_PRINT_CFLAGS)
 
606
+       $(GTK_PRINT_CFLAGS)                             \
 
607
+       $(HILDON_CFLAGS)
 
608
 
 
609
 if HAVE_GTK_RECENT
 
610
 INCLUDES +=
 
611
@@ -100,7 +101,8 @@
 
612
        $(top_builddir)/properties/libevproperties.la                   \
 
613
        $(top_builddir)/libdocument/libevbackend.la                     \
 
614
        $(SHELL_LIBS)                                                   \
 
615
-       $(GNOME_PRINT_LIBS)
 
616
+       $(GNOME_PRINT_LIBS)                                             \
 
617
+       $(HILDON_LIBS)
 
618
 
 
619
 if HAVE_GTK_RECENT
 
620
 evince_LDADD +=
 
621
diff -Nur evince-2.20.0/data/Makefile.am evince-2.20.0.new/data/Makefile.am
 
622
--- evince-2.20.0/data/Makefile.am      2007-09-18 22:48:36.000000000 -0300
 
623
+++ evince-2.20.0.new/data/Makefile.am  2007-09-18 22:50:54.000000000 -0300
 
624
@@ -15,11 +15,19 @@
 
625
 #
 
626
 
 
627
 uidir = $(pkgdatadir)
 
628
+if USE_HILDON
 
629
+ui_DATA =                              \
 
630
+       evince-hildon-ui.xml            \
 
631
+       evince-toolbar.xml              \
 
632
+       hand-open.png                   \
 
633
+       $(NULL)
 
634
+else
 
635
 ui_DATA =                              \
 
636
        evince-ui.xml                   \
 
637
        evince-toolbar.xml              \
 
638
        hand-open.png                   \
 
639
        $(NULL)
 
640
+endif
 
641
 
 
642
 #
 
643
 # Glade
 
644
@@ -38,11 +46,18 @@
 
645
 @INTLTOOL_DESKTOP_RULE@
 
646
 
 
647
 DESKTOP_IN_FILES= evince.desktop.in.in
 
648
-DESKTOP_FILES= $(DESKTOP_IN_FILES:.desktop.in.in=.desktop)
 
649
-
 
650
 desktopdir = $(datadir)/applications
 
651
+
 
652
+DESKTOP_FILES= $(DESKTOP_IN_FILES:.desktop.in.in=.desktop)
 
653
 desktop_DATA = $(DESKTOP_FILES)
 
654
 
 
655
+#
 
656
+# D-Bus service (Maemo)
 
657
+#
 
658
+if USE_HILDON
 
659
+dbus_servicedir   = $(datadir)/dbus-1/services
 
660
+dbus_service_DATA = evince.service
 
661
+endif
 
662
 
 
663
 #
 
664
 # GConf schema
 
665
@@ -107,6 +122,7 @@
 
666
        $(DESKTOP_IN_FILES)             \
 
667
        $(schema_in_files)              \
 
668
        $(man_MANS)                     \
 
669
+       $(dbus_service_DATA)            \
 
670
        $(NULL)                         
 
671
 
 
672
 #