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

« back to all changes in this revision

Viewing changes to app/paint/gimpsourceoptions.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
/* GIMP - The GNU Image Manipulation Program
 
2
 * Copyright (C) 1995 Spencer Kimball and Peter Mattis
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or modify
 
5
 * it under the terms of the GNU General Public License as published by
 
6
 * the Free Software Foundation; either version 2 of the License, or
 
7
 * (at your option) any later version.
 
8
 *
 
9
 * This program is distributed in the hope that it will be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 * GNU General Public License for more details.
 
13
 *
 
14
 * You should have received a copy of the GNU General Public License
 
15
 * along with this program; if not, write to the Free Software
 
16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
17
 */
 
18
 
 
19
#include "config.h"
 
20
 
 
21
#include <glib-object.h>
 
22
 
 
23
#include "libgimpconfig/gimpconfig.h"
 
24
 
 
25
#include "paint-types.h"
 
26
 
 
27
#include "gimpsourceoptions.h"
 
28
 
 
29
 
 
30
enum
 
31
{
 
32
  PROP_0,
 
33
  PROP_ALIGN_MODE,
 
34
  PROP_SAMPLE_MERGED
 
35
};
 
36
 
 
37
 
 
38
static void   gimp_source_options_set_property (GObject      *object,
 
39
                                                guint         property_id,
 
40
                                                const GValue *value,
 
41
                                                GParamSpec   *pspec);
 
42
static void   gimp_source_options_get_property (GObject      *object,
 
43
                                                guint         property_id,
 
44
                                                GValue       *value,
 
45
                                                GParamSpec   *pspec);
 
46
 
 
47
 
 
48
G_DEFINE_TYPE (GimpSourceOptions, gimp_source_options, GIMP_TYPE_PAINT_OPTIONS)
 
49
 
 
50
 
 
51
static void
 
52
gimp_source_options_class_init (GimpSourceOptionsClass *klass)
 
53
{
 
54
  GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
55
 
 
56
  object_class->set_property = gimp_source_options_set_property;
 
57
  object_class->get_property = gimp_source_options_get_property;
 
58
 
 
59
  GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_ALIGN_MODE,
 
60
                                 "align-mode", NULL,
 
61
                                 GIMP_TYPE_SOURCE_ALIGN_MODE,
 
62
                                 GIMP_SOURCE_ALIGN_NO,
 
63
                                 GIMP_PARAM_STATIC_STRINGS);
 
64
 
 
65
  GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SAMPLE_MERGED,
 
66
                                    "sample-merged", NULL,
 
67
                                    FALSE,
 
68
                                    GIMP_PARAM_STATIC_STRINGS);
 
69
}
 
70
 
 
71
static void
 
72
gimp_source_options_init (GimpSourceOptions *options)
 
73
{
 
74
  options->use_source = TRUE;
 
75
}
 
76
 
 
77
static void
 
78
gimp_source_options_set_property (GObject      *object,
 
79
                                  guint         property_id,
 
80
                                  const GValue *value,
 
81
                                  GParamSpec   *pspec)
 
82
{
 
83
  GimpSourceOptions *options = GIMP_SOURCE_OPTIONS (object);
 
84
 
 
85
  switch (property_id)
 
86
    {
 
87
    case PROP_ALIGN_MODE:
 
88
      options->align_mode = g_value_get_enum (value);
 
89
      break;
 
90
    case PROP_SAMPLE_MERGED:
 
91
      options->sample_merged = g_value_get_boolean (value);
 
92
      break;
 
93
    default:
 
94
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
 
95
      break;
 
96
    }
 
97
}
 
98
 
 
99
static void
 
100
gimp_source_options_get_property (GObject    *object,
 
101
                                  guint       property_id,
 
102
                                  GValue     *value,
 
103
                                  GParamSpec *pspec)
 
104
{
 
105
  GimpSourceOptions *options = GIMP_SOURCE_OPTIONS (object);
 
106
 
 
107
  switch (property_id)
 
108
    {
 
109
    case PROP_ALIGN_MODE:
 
110
      g_value_set_enum (value, options->align_mode);
 
111
      break;
 
112
    case PROP_SAMPLE_MERGED:
 
113
      g_value_set_boolean (value, options->sample_merged);
 
114
      break;
 
115
    default:
 
116
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
 
117
      break;
 
118
    }
 
119
}