summaryrefslogtreecommitdiffstats
path: root/libgimpwidgets/gimpscaleentry.h
blob: b02d56cce9f1c4475e1c15893b8454013bd31fa8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
/* LIBGIMP - The GIMP Library
 * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
 *
 * gimpscaleentry.h
 * Copyright (C) 2000 Michael Natterer <mitch@gimp.org>,
 *               2008 Bill Skaggs <weskaggs@primate.ucdavis.edu>
 *
 * This library is free software: you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library.  If not, see
 * <https://www.gnu.org/licenses/>.
 */

#if !defined (__GIMP_WIDGETS_H_INSIDE__) && !defined (GIMP_WIDGETS_COMPILATION)
#error "Only <libgimpwidgets/gimpwidgets.h> can be included directly."
#endif

#ifndef __GIMP_SCALE_ENTRY_H__
#define __GIMP_SCALE_ENTRY_H__

G_BEGIN_DECLS


/**
 * GIMP_SCALE_ENTRY_LABEL:
 * @adj: The #GtkAdjustment returned by gimp_scale_entry_new().
 *
 * Returns: the scale_entry's #GtkLabel.
 **/
#define GIMP_SCALE_ENTRY_LABEL(adj) \
        (g_object_get_data (G_OBJECT (adj), "label"))

/**
 * GIMP_SCALE_ENTRY_SCALE:
 * @adj: The #GtkAdjustment returned by gimp_scale_entry_new().
 *
 * Returns: the scale_entry's #GtkHScale.
 **/
#define GIMP_SCALE_ENTRY_SCALE(adj) \
        (g_object_get_data (G_OBJECT (adj), "scale"))

/**
 * GIMP_SCALE_ENTRY_SCALE_ADJ:
 * @adj: The #GtkAdjustment returned by gimp_scale_entry_new().
 *
 * Returns: the #GtkAdjustment of the scale_entry's #GtkHScale.
 **/
#define GIMP_SCALE_ENTRY_SCALE_ADJ(adj)     \
        gtk_range_get_adjustment \
        (GTK_RANGE (g_object_get_data (G_OBJECT (adj), "scale")))

/**
 * GIMP_SCALE_ENTRY_SPINBUTTON:
 * @adj: The #GtkAdjustment returned by gimp_scale_entry_new().
 *
 * Returns: the scale_entry's #GtkSpinButton.
 **/
#define GIMP_SCALE_ENTRY_SPINBUTTON(adj) \
        (g_object_get_data (G_OBJECT (adj), "spinbutton"))

/**
 * GIMP_SCALE_ENTRY_SPINBUTTON_ADJ:
 * @adj: The #GtkAdjustment returned by gimp_scale_entry_new().
 *
 * Returns: the #GtkAdjustment of the scale_entry's #GtkSpinButton.
 **/
#define GIMP_SCALE_ENTRY_SPINBUTTON_ADJ(adj) \
        gtk_spin_button_get_adjustment \
        (GTK_SPIN_BUTTON (g_object_get_data (G_OBJECT (adj), "spinbutton")))


GtkObject * gimp_scale_entry_new             (GtkTable    *table,
                                              gint         column,
                                              gint         row,
                                              const gchar *text,
                                              gint         scale_width,
                                              gint         spinbutton_width,
                                              gdouble      value,
                                              gdouble      lower,
                                              gdouble      upper,
                                              gdouble      step_increment,
                                              gdouble      page_increment,
                                              guint        digits,
                                              gboolean     constrain,
                                              gdouble      unconstrained_lower,
                                              gdouble      unconstrained_upper,
                                              const gchar *tooltip,
                                              const gchar *help_id);

GtkObject * gimp_color_scale_entry_new       (GtkTable    *table,
                                              gint         column,
                                              gint         row,
                                              const gchar *text,
                                              gint         scale_width,
                                              gint         spinbutton_width,
                                              gdouble      value,
                                              gdouble      lower,
                                              gdouble      upper,
                                              gdouble      step_increment,
                                              gdouble      page_increment,
                                              guint        digits,
                                              const gchar *tooltip,
                                              const gchar *help_id);

void        gimp_scale_entry_set_sensitive   (GtkObject   *adjustment,
                                              gboolean     sensitive);

void        gimp_scale_entry_set_logarithmic (GtkObject   *adjustment,
                                              gboolean     logarithmic);
gboolean    gimp_scale_entry_get_logarithmic (GtkObject   *adjustment);



G_END_DECLS

#endif /* __GIMP_SCALE_ENTRY_H__ */