~ubuntu-branches/ubuntu/raring/xiphos/raring

« back to all changes in this revision

Viewing changes to src/gnome2/parallel_view.c

  • Committer: Bazaar Package Importer
  • Author(s): Dmitrijs Ledkovs, Jonathan Marsden, Dmitrijs Ledkovs
  • Date: 2010-11-25 21:26:48 UTC
  • mfrom: (2.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20101125212648-mc64wvs0nw3xp7bx
Tags: 3.1.4-1
[ Jonathan Marsden ]
* New upstream release 3.1.4
* Removed debian/patch/* since the one patch was included upstream.
* Bumped Standards-Version to 3.9.1 (no changes required).
* debian/README.Debian: Corrected spelling and reworded for clarity.
* debian/control: Add Jonathan Marsden back into Uploaders.

[ Dmitrijs Ledkovs ]
* Added local options dpkg-source to unapply patches and fail on
  upstream source changes (ignoring false positives).
* Added bzr-builddeb hook to generate source-format before build. If you
  are not using bzr-builddeb, you must run "./debian/rules clean" before
  building.
* patches/xul-2.0.patch: bump UPPER_RANGE to allow running against xul20.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * Xiphos Bible Study Tool
3
3
 * gs_parallel.c - support for displaying multiple modules
4
4
 *
5
 
 * Copyright (C) 2000-2009 Xiphos Developer Team
 
5
 * Copyright (C) 2000-2010 Xiphos Developer Team
6
6
 *
7
7
 * This program is free software; you can redistribute it and/or modify
8
8
 * it under the terms of the GNU General Public License as published by
42
42
#include "gui/xiphos.h"
43
43
#include "gui/widgets.h"
44
44
#include "gui/tabbed_browser.h"
 
45
#include "gui/preferences_dialog.h"
45
46
 
46
47
#include "main/parallel_view.h"
47
48
#include "main/global_ops.hh"
108
109
 
109
110
 
110
111
 
111
 
/******************************************************************************
112
 
 * Name
113
 
 *   on_changeint1mod_activate
114
 
 *
115
 
 * Synopsis
116
 
 *   #include "gui/parallel.h
117
 
 *
118
 
 *   void on_changeint1mod_activate(GtkMenuItem * menuitem,
119
 
 *                             gpointer user_data)
120
 
 *
121
 
 * Description
122
 
 *
123
 
 *
124
 
 * Return value
125
 
 *   void
126
 
 */
127
 
 
128
 
void on_changeint1mod_activate(GtkMenuItem * menuitem,
129
 
                                      gpointer user_data)
130
 
{
131
 
 
132
 
        gchar *mod_name = NULL;
133
 
//      GS_message(("mod_name",(gchar *) user_data));
134
 
        mod_name = main_module_name_from_description((gchar *) user_data);
135
 
 
136
 
        if (!mod_name)
137
 
                return;
138
 
        main_change_parallel_module(PARALLEL1, mod_name);
139
 
}
140
 
 
141
 
 
142
 
 
143
 
 
144
 
/******************************************************************************
145
 
 * Name
146
 
 *   on_changeint2mod_activate
147
 
 *
148
 
 * Synopsis
149
 
 *   #include "gui/parallel.h
150
 
 *
151
 
 *   void on_changeint2mod_activate(GtkMenuItem * menuitem,
152
 
 *                             gpointer user_data)
153
 
 *
154
 
 * Description
155
 
 *
156
 
 *
157
 
 * Return value
158
 
 *   void
159
 
 */
160
 
 
161
 
static void on_changeint2mod_activate(GtkMenuItem * menuitem,
162
 
                                      gpointer user_data)
163
 
{
164
 
        gchar *mod_name = NULL;
165
 
 
166
 
        mod_name = main_module_name_from_description((gchar *) user_data);
167
 
        if (!mod_name)
168
 
                return;
169
 
        main_change_parallel_module(PARALLEL2, mod_name);
170
 
}
171
 
 
172
 
 
173
 
/******************************************************************************
174
 
 * Name
175
 
 *   on_changeint3mod_activate
176
 
 *
177
 
 * Synopsis
178
 
 *   #include "gui/parallel.h
179
 
 *
180
 
 *   void on_changeint3mod_activate(GtkMenuItem * menuitem,
181
 
                               gpointer user_data)
182
 
 *
183
 
 * Description
184
 
 *
185
 
 *
186
 
 * Return value
187
 
 *   void
188
 
 */
189
 
 
190
 
static void on_changeint3mod_activate(GtkMenuItem * menuitem,
191
 
                                      gpointer user_data)
192
 
{
193
 
        gchar *mod_name = NULL;
194
 
 
195
 
        mod_name = main_module_name_from_description((gchar *) user_data);
196
 
        if (!mod_name)
197
 
                return;
198
 
        main_change_parallel_module(PARALLEL3, mod_name);
199
 
}
200
 
 
201
 
 
202
 
/******************************************************************************
203
 
 * Name
204
 
 *   on_changeint4mod_activate
205
 
 *
206
 
 * Synopsis
207
 
 *   #include "gui/parallel.h
208
 
 *
209
 
 *   void on_changeint4mod_activate(GtkMenuItem * menuitem,
210
 
 *                             gpointer user_data)
211
 
 *
212
 
 * Description
213
 
 *
214
 
 *
215
 
 * Return value
216
 
 *   void
217
 
 */
218
 
 
219
 
static void on_changeint4mod_activate(GtkMenuItem * menuitem,
220
 
                                      gpointer user_data)
221
 
{
222
 
        gchar *mod_name = NULL;
223
 
 
224
 
        mod_name = main_module_name_from_description((gchar *) user_data);
225
 
        if (!mod_name)
226
 
                return;
227
 
        main_change_parallel_module(PARALLEL4, mod_name);
228
 
}
229
 
 
230
 
 
231
 
/******************************************************************************
232
 
 * Name
233
 
 *   on_changeint5mod_activate
234
 
 *
235
 
 * Synopsis
236
 
 *   #include "gui/parallel.h
237
 
 *
238
 
 *   void on_changeint5mod_activate(GtkMenuItem * menuitem,
239
 
                               gpointer user_data)
240
 
 *
241
 
 * Description
242
 
 *
243
 
 *
244
 
 * Return value
245
 
 *   void
246
 
 */
247
 
 
248
 
static void on_changeint5mod_activate(GtkMenuItem * menuitem,
249
 
                                      gpointer user_data)
250
 
{
251
 
        gchar *mod_name = NULL;
252
 
 
253
 
        mod_name = main_module_name_from_description((gchar *) user_data);
254
 
 
255
 
        if (!mod_name)
256
 
                return;
257
 
        main_change_parallel_module(PARALLEL5, mod_name);
258
 
}
259
 
 
260
 
 
261
112
void gui_popup_menu_parallel(void)
262
113
{
263
114
        GtkWidget *menu;
264
 
        GtkWidget *copy7;
265
115
        GtkWidget *undockInt = NULL;
266
116
        GtkWidget *module_options;
267
 
        GtkWidget *separator2;
 
117
        GtkWidget *separator;
268
118
        GtkWidget *module_options_menu;
269
119
 
270
120
        menu = gtk_menu_new();
271
121
        g_object_set_data(G_OBJECT(menu), "pmInt", menu);
272
122
 
273
 
        copy7 = gtk_menu_item_new_with_label(_("Copy"));
274
 
        gtk_widget_hide(copy7);
275
 
        gtk_container_add(GTK_CONTAINER(menu), copy7);
276
 
 
277
 
        separator2 = gtk_menu_item_new();
278
 
        gtk_widget_hide(separator2);
279
 
        gtk_container_add(GTK_CONTAINER(menu), separator2);
280
 
        gtk_widget_set_sensitive(separator2, FALSE);
281
 
 
282
123
        if (!settings.showparatab) {
283
124
                undockInt = gtk_menu_item_new_with_label(_("Detach/Attach"));
284
125
                gtk_widget_show(undockInt);
296
137
 
297
138
        main_load_g_ops_parallel(module_options_menu);
298
139
 
299
 
        separator2 = gtk_menu_item_new();
300
 
        gtk_widget_show(separator2);
301
 
        gtk_container_add(GTK_CONTAINER(menu), separator2);
302
 
        gtk_widget_set_sensitive(separator2, FALSE);
303
 
        /* build change parallel modules submenu */
304
 
        main_load_menu_form_mod_list(menu, _("Change parallel 1"),
305
 
                                     G_CALLBACK(on_changeint1mod_activate));
306
 
        main_load_menu_form_mod_list(menu, _("Change parallel 2"),
307
 
                                     G_CALLBACK(on_changeint2mod_activate));
308
 
        main_load_menu_form_mod_list(menu, _("Change parallel 3"),
309
 
                                     G_CALLBACK(on_changeint3mod_activate));
310
 
        main_load_menu_form_mod_list(menu, _("Change parallel 4"),
311
 
                                     G_CALLBACK(on_changeint4mod_activate));
312
 
        main_load_menu_form_mod_list(menu, _("Change parallel 5"),
313
 
                                     G_CALLBACK(on_changeint5mod_activate));
314
 
 
315
 
/*      g_signal_connect(GTK_OBJECT(copy7), "activate",
316
 
                           G_CALLBACK(gui_copyhtml_activate),
317
 
                           NULL);*/
 
140
        separator = gtk_menu_item_new();
 
141
        gtk_widget_show(separator);
 
142
        gtk_container_add(GTK_CONTAINER(menu), separator);
 
143
        gtk_widget_set_sensitive(separator, FALSE);
318
144
 
319
145
        if (!settings.showparatab) {
320
146
                if (undockInt) {
332
158
 
333
159
 
334
160
static gboolean
335
 
on_enter_notify_event        (GtkWidget       *widget,
336
 
                                        GdkEventCrossing *event,
337
 
                                        gpointer         user_data)
 
161
on_enter_notify_event(GtkWidget       *widget,
 
162
                      GdkEventCrossing *event,
 
163
                      gpointer         user_data)
338
164
{
339
165
        gtk_widget_grab_focus (widgets.html_parallel);
340
 
        //settings.whichwindow = MAIN_TEXT_WINDOW;
341
 
        //gui_change_window_title(settings.MainWindowModule);
342
 
        return FALSE;
343
 
}
344
 
 
345
 
static gboolean on_key_press_event           (GtkWidget       *widget,
346
 
                                        GdkEventKey     *event,
347
 
                                        gpointer         user_data)
348
 
{
349
 
        switch (event->hardware_keycode) {
350
 
                case 50:
351
 
                case 62:
352
 
                        shift_key_pressed = TRUE;
353
 
                break;
354
 
        }
355
 
        return FALSE;
356
 
}
357
 
 
358
 
 
359
 
static gboolean on_key_release_event         (GtkWidget       *widget,
360
 
                                        GdkEventKey     *event,
361
 
                                        gpointer         user_data)
362
 
{
363
 
        switch (event->hardware_keycode) {
364
 
                case 50:
365
 
                case 62:
366
 
                        shift_key_pressed = FALSE;
367
 
                break;
368
 
        }
369
166
        return FALSE;
370
167
}
371
168
 
464
261
                         "button_release_event",
465
262
                         G_CALLBACK (_popupmenu_requested_cb),
466
263
                         NULL);
 
264
        g_signal_connect(GTK_OBJECT(widgets.html_parallel),
 
265
                         "url_requested",
 
266
                         G_CALLBACK(url_requested), NULL);
467
267
#endif
468
268
 
469
269
        label = gtk_label_new(_("Parallel View"));
478
278
        g_signal_connect ((gpointer) widgets.html_parallel, "enter_notify_event",
479
279
                    G_CALLBACK (on_enter_notify_event),
480
280
                    NULL);
481
 
        g_signal_connect ((gpointer) widgets.html_parallel, "key_press_event",
482
 
                    G_CALLBACK (on_key_press_event),
483
 
                    NULL);
484
 
        g_signal_connect ((gpointer) widgets.html_parallel, "key_release_event",
485
 
                    G_CALLBACK (on_key_release_event),
486
 
                    NULL);
487
281
}