~ubuntu-branches/ubuntu/maverick/gimp/maverick-updates

« back to all changes in this revision

Viewing changes to app/widgets/gimpgradienteditor.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2005-12-09 19:44:52 UTC
  • Revision ID: james.westby@ubuntu.com-20051209194452-yggpemjlofpjqyf4
Tags: upstream-2.2.9
ImportĀ upstreamĀ versionĀ 2.2.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* The GIMP -- an image manipulation program
 
2
 * Copyright (C) 1995 Spencer Kimball and Peter Mattis
 
3
 *
 
4
 * Gradient editor module copyight (C) 1996-1997 Federico Mena Quintero
 
5
 * federico@nuclecu.unam.mx
 
6
 *
 
7
 * This program is free software; you can redistribute it and/or modify
 
8
 * it under the terms of the GNU General Public License as published by
 
9
 * the Free Software Foundation; either version 2 of the License, or
 
10
 * (at your option) any later version.
 
11
 *
 
12
 * This program is distributed in the hope that it will be useful,
 
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
 * GNU General Public License for more details.
 
16
 *
 
17
 * You should have received a copy of the GNU General Public License
 
18
 * along with this program; if not, write to the Free Software
 
19
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
20
 */
 
21
 
 
22
#ifndef __GIMP_GRADIENT_EDITOR_H__
 
23
#define __GIMP_GRADIENT_EDITOR_H__
 
24
 
 
25
 
 
26
#include "gimpdataeditor.h"
 
27
 
 
28
 
 
29
#define GRAD_NUM_COLORS 10
 
30
 
 
31
 
 
32
typedef enum
 
33
{
 
34
  GRAD_DRAG_NONE = 0,
 
35
  GRAD_DRAG_LEFT,
 
36
  GRAD_DRAG_MIDDLE,
 
37
  GRAD_DRAG_ALL
 
38
} GradientEditorDragMode;
 
39
 
 
40
 
 
41
#define GIMP_TYPE_GRADIENT_EDITOR            (gimp_gradient_editor_get_type ())
 
42
#define GIMP_GRADIENT_EDITOR(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_GRADIENT_EDITOR, GimpGradientEditor))
 
43
#define GIMP_GRADIENT_EDITOR_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_GRADIENT_EDITOR, GimpGradientEditorClass))
 
44
#define GIMP_IS_GRADIENT_EDITOR(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_GRADIENT_EDITOR))
 
45
#define GIMP_IS_GRADIENT_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_GRADIENT_EDITOR))
 
46
#define GIMP_GRADIENT_EDITOR_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_GRADIENT_EDITOR, GimpGradientEditorClass))
 
47
 
 
48
 
 
49
typedef struct _GimpGradientEditorClass GimpGradientEditorClass;
 
50
 
 
51
struct _GimpGradientEditor
 
52
{
 
53
  GimpDataEditor  parent_instance;
 
54
 
 
55
  GtkWidget      *hint_label1;
 
56
  GtkWidget      *hint_label2;
 
57
  GtkWidget      *hint_label3;
 
58
  GtkWidget      *hint_label4;
 
59
  GtkWidget      *scrollbar;
 
60
  GtkWidget      *preview;
 
61
  GtkWidget      *control;
 
62
 
 
63
  /*  Zoom and scrollbar  */
 
64
  guint           zoom_factor;
 
65
  GtkObject      *scroll_data;
 
66
 
 
67
  /*  Instant update  */
 
68
  gboolean        instant_update;
 
69
 
 
70
  /*  Color dialog  */
 
71
  GtkWidget      *color_dialog;
 
72
 
 
73
  /*  Gradient preview  */
 
74
  gint            preview_last_x;
 
75
  gboolean        preview_button_down;
 
76
 
 
77
  /*  Gradient control  */
 
78
  GdkPixmap              *control_pixmap;
 
79
  GimpGradientSegment    *control_drag_segment; /* Segment which is being dragged */
 
80
  GimpGradientSegment    *control_sel_l;        /* Left segment of selection */
 
81
  GimpGradientSegment    *control_sel_r;        /* Right segment of selection */
 
82
  GradientEditorDragMode  control_drag_mode;    /* What is being dragged? */
 
83
  guint32                 control_click_time;   /* Time when mouse was pressed */
 
84
  gboolean                control_compress;     /* Compressing/expanding handles */
 
85
  gint                    control_last_x;       /* Last mouse position when dragging */
 
86
  gdouble                 control_last_gx;      /* Last position (wrt gradient) when dragging */
 
87
  gdouble                 control_orig_pos;     /* Original click position when dragging */
 
88
 
 
89
  /*  Split uniformly dialog  */
 
90
  gint          split_parts;
 
91
 
 
92
  /*  Replicate dialog  */
 
93
  gint          replicate_times;
 
94
 
 
95
  /*  Saved colors  */
 
96
  GimpRGB       saved_colors[GRAD_NUM_COLORS];
 
97
 
 
98
  /*  Color dialogs  */
 
99
  GimpGradientSegment *left_saved_segments;
 
100
  gboolean             left_saved_dirty;
 
101
 
 
102
  GimpGradientSegment *right_saved_segments;
 
103
  gboolean             right_saved_dirty;
 
104
};
 
105
 
 
106
struct _GimpGradientEditorClass
 
107
{
 
108
  GimpDataEditorClass  parent_class;
 
109
};
 
110
 
 
111
 
 
112
GType       gimp_gradient_editor_get_type (void) G_GNUC_CONST;
 
113
 
 
114
GtkWidget * gimp_gradient_editor_new      (Gimp               *gimp,
 
115
                                           GimpMenuFactory    *menu_factory);
 
116
 
 
117
void        gimp_gradient_editor_update   (GimpGradientEditor *editor);
 
118
void        gimp_gradient_editor_zoom     (GimpGradientEditor *editor,
 
119
                                           GimpZoomType        zoom_type);
 
120
 
 
121
 
 
122
#endif  /* __GIMP_GRADIENT_EDITOR_H__ */