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

« back to all changes in this revision

Viewing changes to app/widgets/gimpdocked.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:
1
 
/* The GIMP -- an image manipulation program
 
1
/* GIMP - The GNU Image Manipulation Program
2
2
 * Copyright (C) 1995 Spencer Kimball and Peter Mattis
3
3
 *
4
4
 * gimpdocked.c
21
21
 
22
22
#include "config.h"
23
23
 
 
24
#include <string.h>
 
25
 
24
26
#include <gtk/gtk.h>
25
27
 
26
28
#include "widgets-types.h"
29
31
#include "core/gimpmarshal.h"
30
32
 
31
33
#include "gimpdocked.h"
 
34
#include "gimpsessioninfo.h"
32
35
 
33
36
 
34
37
enum
38
41
};
39
42
 
40
43
 
41
 
static void  gimp_docked_iface_base_init (GimpDockedInterface *docked_iface);
 
44
static void    gimp_docked_iface_base_init    (GimpDockedInterface *docked_iface);
 
45
 
 
46
static void    gimp_docked_iface_set_aux_info (GimpDocked          *docked,
 
47
                                               GList               *aux_info);
 
48
static GList * gimp_docked_iface_get_aux_info (GimpDocked          *docked);
 
49
 
42
50
 
43
51
 
44
52
static guint docked_signals[LAST_SIGNAL] = { 0 };
51
59
 
52
60
  if (!docked_iface_type)
53
61
    {
54
 
      static const GTypeInfo docked_iface_info =
 
62
      const GTypeInfo docked_iface_info =
55
63
      {
56
64
        sizeof (GimpDockedInterface),
57
 
        (GBaseInitFunc)     gimp_docked_iface_base_init,
58
 
        (GBaseFinalizeFunc) NULL,
 
65
        (GBaseInitFunc)     gimp_docked_iface_base_init,
 
66
        (GBaseFinalizeFunc) NULL,
59
67
      };
60
68
 
61
69
      docked_iface_type = g_type_register_static (G_TYPE_INTERFACE,
74
82
{
75
83
  static gboolean initialized = FALSE;
76
84
 
 
85
  if (! docked_iface->get_aux_info)
 
86
    {
 
87
      docked_iface->get_aux_info = gimp_docked_iface_get_aux_info;
 
88
      docked_iface->set_aux_info = gimp_docked_iface_set_aux_info;
 
89
    }
 
90
 
77
91
  if (! initialized)
78
92
    {
79
93
      docked_signals[TITLE_CHANGED] =
80
 
        g_signal_new ("title_changed",
 
94
        g_signal_new ("title-changed",
81
95
                      GIMP_TYPE_DOCKED,
82
96
                      G_SIGNAL_RUN_FIRST,
83
97
                      G_STRUCT_OFFSET (GimpDockedInterface, title_changed),
89
103
    }
90
104
}
91
105
 
 
106
#define AUX_INFO_SHOW_BUTTON_BAR "show-button-bar"
 
107
 
 
108
static void
 
109
gimp_docked_iface_set_aux_info (GimpDocked *docked,
 
110
                                GList      *aux_info)
 
111
{
 
112
  GList *list;
 
113
 
 
114
  for (list = aux_info; list; list = g_list_next (list))
 
115
    {
 
116
      GimpSessionInfoAux *aux = list->data;
 
117
 
 
118
      if (strcmp (aux->name, AUX_INFO_SHOW_BUTTON_BAR) == 0)
 
119
        {
 
120
          gboolean show = g_ascii_strcasecmp (aux->value, "false");
 
121
 
 
122
          gimp_docked_set_show_button_bar (docked, show);
 
123
        }
 
124
    }
 
125
}
 
126
 
 
127
static GList *
 
128
gimp_docked_iface_get_aux_info (GimpDocked *docked)
 
129
{
 
130
  if (gimp_docked_has_button_bar (docked) &&
 
131
      ! gimp_docked_get_show_button_bar (docked))
 
132
    {
 
133
      return g_list_append (NULL,
 
134
                            gimp_session_info_aux_new (AUX_INFO_SHOW_BUTTON_BAR,
 
135
                                                       "false"));
 
136
    }
 
137
 
 
138
  return NULL;
 
139
}
 
140
 
92
141
void
93
142
gimp_docked_title_changed (GimpDocked *docked)
94
143
{
191
240
  if (docked_iface->set_context)
192
241
    docked_iface->set_context (docked, context);
193
242
}
 
243
 
 
244
gboolean
 
245
gimp_docked_has_button_bar (GimpDocked *docked)
 
246
{
 
247
  GimpDockedInterface *docked_iface;
 
248
 
 
249
  g_return_val_if_fail (GIMP_IS_DOCKED (docked), FALSE);
 
250
 
 
251
  docked_iface = GIMP_DOCKED_GET_INTERFACE (docked);
 
252
 
 
253
  if (docked_iface->has_button_bar)
 
254
    return docked_iface->has_button_bar (docked);
 
255
 
 
256
  return FALSE;
 
257
}
 
258
 
 
259
void
 
260
gimp_docked_set_show_button_bar (GimpDocked *docked,
 
261
                                 gboolean    show)
 
262
{
 
263
  GimpDockedInterface *docked_iface;
 
264
 
 
265
  g_return_if_fail (GIMP_IS_DOCKED (docked));
 
266
 
 
267
  docked_iface = GIMP_DOCKED_GET_INTERFACE (docked);
 
268
 
 
269
  if (docked_iface->set_show_button_bar)
 
270
    docked_iface->set_show_button_bar (docked, show ? TRUE : FALSE);
 
271
}
 
272
 
 
273
gboolean
 
274
gimp_docked_get_show_button_bar (GimpDocked *docked)
 
275
{
 
276
  GimpDockedInterface *docked_iface;
 
277
 
 
278
  g_return_val_if_fail (GIMP_IS_DOCKED (docked), FALSE);
 
279
 
 
280
  docked_iface = GIMP_DOCKED_GET_INTERFACE (docked);
 
281
 
 
282
  if (docked_iface->get_show_button_bar)
 
283
    return docked_iface->get_show_button_bar (docked);
 
284
 
 
285
  return FALSE;
 
286
}