~ubuntu-branches/ubuntu/jaunty/gimp/jaunty-security

« back to all changes in this revision

Viewing changes to libgimpwidgets/gimphelpui.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-05-02 16:33:03 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070502163303-bvzhjzbpw8qglc4y
Tags: 2.3.16-1ubuntu1
* Resynchronized with Debian, remaining Ubuntu changes:
  - debian/rules: i18n magic.
* debian/control.in:
  - Maintainer: Ubuntu Core Developers <ubuntu-devel@lists.ubuntu.com>
* debian/patches/02_help-message.patch,
  debian/patches/03_gimp.desktop.in.in.patch,
  debian/patches/10_dont_show_wizard.patch: updated.
* debian/patches/04_composite-signedness.patch,
  debian/patches/05_add-letter-spacing.patch: dropped, used upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
static gboolean   gimp_context_help_button_press   (GtkWidget      *widget,
52
52
                                                    GdkEventButton *bevent,
53
53
                                                    gpointer        data);
 
54
static gboolean   gimp_context_help_key_press      (GtkWidget      *widget,
 
55
                                                    GdkEventKey    *kevent,
 
56
                                                    gpointer        data);
54
57
static gboolean   gimp_context_help_idle_show_help (gpointer        data);
55
58
 
56
59
 
83
86
  tool_tips = gtk_tooltips_new ();
84
87
 
85
88
  /* take ownership of the tooltips */
86
 
  g_object_ref (tool_tips);
87
 
  gtk_object_sink (GTK_OBJECT (tool_tips));
 
89
  g_object_ref_sink (tool_tips);
88
90
}
89
91
 
90
92
/**
179
181
 
180
182
  g_object_set_data (G_OBJECT (widget), "gimp-help-data", help_data);
181
183
 
182
 
  g_signal_connect (widget, "show_help",
 
184
  g_signal_connect (widget, "show-help",
183
185
                    G_CALLBACK (gimp_help_callback),
184
186
                    help_func);
185
187
 
207
209
{
208
210
  g_return_if_fail (GTK_IS_WIDGET (widget));
209
211
 
210
 
  if (tooltip)
211
 
    gtk_tooltips_set_tip (tool_tips, widget, tooltip, help_id);
212
 
  else
 
212
  gtk_tooltips_set_tip (tool_tips, widget, tooltip, help_id);
 
213
 
 
214
  if (! tooltip)
213
215
    g_object_set_qdata (G_OBJECT (widget), GIMP_HELP_ID, (gpointer) help_id);
214
216
}
215
217
 
377
379
          return FALSE;
378
380
        }
379
381
 
 
382
      if (gdk_keyboard_grab (invisible->window, TRUE,
 
383
                             GDK_CURRENT_TIME) != GDK_GRAB_SUCCESS)
 
384
        {
 
385
          gdk_display_pointer_ungrab (gtk_widget_get_display (invisible),
 
386
                                      GDK_CURRENT_TIME);
 
387
          gtk_widget_destroy (invisible);
 
388
          return FALSE;
 
389
        }
 
390
 
380
391
      gtk_grab_add (invisible);
381
392
 
382
 
      g_signal_connect (invisible, "button_press_event",
 
393
      g_signal_connect (invisible, "button-press-event",
383
394
                        G_CALLBACK (gimp_context_help_button_press),
384
395
                        NULL);
 
396
      g_signal_connect (invisible, "key-press-event",
 
397
                        G_CALLBACK (gimp_context_help_key_press),
 
398
                        NULL);
385
399
    }
386
400
 
387
401
  return FALSE;
392
406
                                GdkEventButton *bevent,
393
407
                                gpointer        data)
394
408
{
395
 
  GtkWidget *event_widget;
396
 
 
397
 
  event_widget = gtk_get_event_widget ((GdkEvent *) bevent);
 
409
  GtkWidget *event_widget = gtk_get_event_widget ((GdkEvent *) bevent);
398
410
 
399
411
  if (event_widget && bevent->button == 1 && bevent->type == GDK_BUTTON_PRESS)
400
412
    {
 
413
      GdkDisplay *display = gtk_widget_get_display (widget);
 
414
 
401
415
      gtk_grab_remove (widget);
402
 
      gdk_display_pointer_ungrab (gtk_widget_get_display (widget),
403
 
                                  bevent->time);
 
416
      gdk_display_keyboard_ungrab (display, bevent->time);
 
417
      gdk_display_pointer_ungrab (display, bevent->time);
404
418
      gtk_widget_destroy (widget);
405
419
 
406
420
      if (event_widget != widget)
411
425
}
412
426
 
413
427
static gboolean
 
428
gimp_context_help_key_press (GtkWidget   *widget,
 
429
                             GdkEventKey *kevent,
 
430
                             gpointer     data)
 
431
{
 
432
  if (kevent->keyval == GDK_Escape)
 
433
    {
 
434
      GdkDisplay *display = gtk_widget_get_display (widget);
 
435
 
 
436
      gtk_grab_remove (widget);
 
437
      gdk_display_keyboard_ungrab (display, kevent->time);
 
438
      gdk_display_pointer_ungrab (display, kevent->time);
 
439
      gtk_widget_destroy (widget);
 
440
    }
 
441
 
 
442
  return TRUE;
 
443
}
 
444
 
 
445
static gboolean
414
446
gimp_context_help_idle_show_help (gpointer data)
415
447
{
416
448
  GtkWidget   *help_widget;