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

« back to all changes in this revision

Viewing changes to app/tools/gimpinktool.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
 * This program is free software; you can redistribute it and/or modify
35
35
#include "gimp-intl.h"
36
36
 
37
37
 
38
 
static void   gimp_ink_tool_init          (GimpInkTool      *tool);
39
 
static void   gimp_ink_tool_class_init    (GimpInkToolClass *klass);
40
 
 
41
 
static void   gimp_ink_tool_cursor_update (GimpTool         *tool,
42
 
                                           GimpCoords       *coords,
43
 
                                           GdkModifierType   state,
44
 
                                           GimpDisplay      *gdisp);
45
 
 
46
 
 
47
 
static GimpPaintToolClass *parent_class = NULL;
 
38
G_DEFINE_TYPE (GimpInkTool, gimp_ink_tool, GIMP_TYPE_PAINT_TOOL)
 
39
 
 
40
#define parent_class gimp_ink_tool_parent_class
48
41
 
49
42
 
50
43
void
60
53
                GIMP_CONTEXT_PAINT_MODE_MASK,
61
54
                "gimp-ink-tool",
62
55
                _("Ink"),
63
 
                _("Draw in ink"),
 
56
                _("Ink Tool: Calligraphy-style painting"),
64
57
                N_("In_k"), "K",
65
58
                NULL, GIMP_HELP_TOOL_INK,
66
59
                GIMP_STOCK_TOOL_INK,
67
60
                data);
68
61
}
69
62
 
70
 
GType
71
 
gimp_ink_tool_get_type (void)
72
 
{
73
 
  static GType tool_type = 0;
74
 
 
75
 
  if (! tool_type)
76
 
    {
77
 
      static const GTypeInfo tool_info =
78
 
      {
79
 
        sizeof (GimpInkToolClass),
80
 
        (GBaseInitFunc) NULL,
81
 
        (GBaseFinalizeFunc) NULL,
82
 
        (GClassInitFunc) gimp_ink_tool_class_init,
83
 
        NULL,           /* class_finalize */
84
 
        NULL,           /* class_data     */
85
 
        sizeof (GimpInkTool),
86
 
        0,              /* n_preallocs    */
87
 
        (GInstanceInitFunc) gimp_ink_tool_init,
88
 
      };
89
 
 
90
 
      tool_type = g_type_register_static (GIMP_TYPE_PAINT_TOOL,
91
 
                                          "GimpInkTool",
92
 
                                          &tool_info, 0);
93
 
    }
94
 
 
95
 
  return tool_type;
96
 
}
97
 
 
98
63
static void
99
64
gimp_ink_tool_class_init (GimpInkToolClass *klass)
100
65
{
101
 
  GimpToolClass *tool_class = GIMP_TOOL_CLASS (klass);
102
 
 
103
 
  parent_class = g_type_class_peek_parent (klass);
104
 
 
105
 
  tool_class->cursor_update = gimp_ink_tool_cursor_update;
106
66
}
107
67
 
108
68
static void
110
70
{
111
71
  GimpTool *tool = GIMP_TOOL (ink_tool);
112
72
 
113
 
  gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_INK);
 
73
  gimp_tool_control_set_tool_cursor    (tool->control, GIMP_TOOL_CURSOR_INK);
 
74
  gimp_tool_control_set_action_value_2 (tool->control,
 
75
                                        "tools/tools-ink-blob-size-set");
 
76
  gimp_tool_control_set_action_value_3 (tool->control,
 
77
                                        "tools/tools-ink-blob-aspect-set");
 
78
  gimp_tool_control_set_action_value_4 (tool->control,
 
79
                                        "tools/tools-ink-blob-angle-set");
114
80
 
115
81
  gimp_paint_tool_enable_color_picker (GIMP_PAINT_TOOL (ink_tool),
116
82
                                       GIMP_COLOR_PICK_MODE_FOREGROUND);
117
83
}
118
 
 
119
 
static void
120
 
gimp_ink_tool_cursor_update (GimpTool         *tool,
121
 
                             GimpCoords       *coords,
122
 
                             GdkModifierType   state,
123
 
                             GimpDisplay      *gdisp)
124
 
{
125
 
  GimpPaintTool *paint_tool = GIMP_PAINT_TOOL (tool);
126
 
 
127
 
  paint_tool->show_cursor = TRUE;
128
 
 
129
 
  GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, gdisp);
130
 
}