2003-01-05 21:52:14 +08:00
|
|
|
/* LIBGIMP - The GIMP Library
|
|
|
|
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
|
|
|
*
|
|
|
|
* gimpmemsizeentry.c
|
|
|
|
* Copyright (C) 2000-2003 Sven Neumann <sven@gimp.org>
|
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This library is free software: you can redistribute it and/or
|
2003-01-05 21:52:14 +08:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
2009-01-18 06:28:01 +08:00
|
|
|
* version 3 of the License, or (at your option) any later version.
|
2003-01-05 21:52:14 +08:00
|
|
|
*
|
|
|
|
* 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
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2009-01-18 06:28:01 +08:00
|
|
|
* License along with this library. If not, see
|
2018-07-12 05:27:07 +08:00
|
|
|
* <https://www.gnu.org/licenses/>.
|
2003-01-05 21:52:14 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2013-11-02 05:32:06 +08:00
|
|
|
#include <gegl.h>
|
2003-01-05 21:52:14 +08:00
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
|
|
|
#include "gimpwidgetstypes.h"
|
|
|
|
|
|
|
|
#include "gimpmemsizeentry.h"
|
|
|
|
#include "gimpwidgets.h"
|
|
|
|
|
|
|
|
#include "libgimp/libgimp-intl.h"
|
|
|
|
|
2003-11-13 00:39:11 +08:00
|
|
|
|
2010-07-06 00:01:28 +08:00
|
|
|
/**
|
|
|
|
* SECTION: gimpmemsizeentry
|
|
|
|
* @title: GimpMemSizeEntry
|
2012-11-11 22:50:25 +08:00
|
|
|
* @short_description: A composite widget to enter a memory size.
|
2010-07-06 00:01:28 +08:00
|
|
|
*
|
|
|
|
* Similar to a #GimpSizeEntry but instead of lengths, this widget is
|
2012-11-11 22:50:25 +08:00
|
|
|
* used to let the user enter memory sizes. A combo box allows one to
|
2010-07-06 00:01:28 +08:00
|
|
|
* switch between Kilobytes, Megabytes and Gigabytes. Used in the GIMP
|
|
|
|
* preferences dialog.
|
|
|
|
**/
|
|
|
|
|
|
|
|
|
2003-01-05 21:52:14 +08:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
VALUE_CHANGED,
|
|
|
|
LAST_SIGNAL
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-01-03 21:03:00 +08:00
|
|
|
struct _GimpMemsizeEntryPrivate
|
|
|
|
{
|
|
|
|
guint64 value;
|
|
|
|
guint64 lower;
|
|
|
|
guint64 upper;
|
|
|
|
|
|
|
|
guint shift;
|
|
|
|
|
2018-07-14 19:15:26 +08:00
|
|
|
/* adjustment is owned by spinbutton. Do not unref() it. */
|
2011-01-03 21:03:00 +08:00
|
|
|
GtkAdjustment *adjustment;
|
|
|
|
GtkWidget *spinbutton;
|
|
|
|
GtkWidget *menu;
|
|
|
|
};
|
|
|
|
|
2018-05-03 18:51:36 +08:00
|
|
|
#define GET_PRIVATE(obj) (((GimpMemsizeEntry *) (obj))->priv)
|
2011-01-03 21:03:00 +08:00
|
|
|
|
|
|
|
|
2005-12-21 04:35:23 +08:00
|
|
|
static void gimp_memsize_entry_adj_callback (GtkAdjustment *adj,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpMemsizeEntry *entry);
|
2005-12-21 04:35:23 +08:00
|
|
|
static void gimp_memsize_entry_unit_callback (GtkWidget *widget,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpMemsizeEntry *entry);
|
2003-01-05 21:52:14 +08:00
|
|
|
|
2020-08-05 19:33:07 +08:00
|
|
|
static guint64 gimp_memsize_entry_get_rounded_value (GimpMemsizeEntry *entry,
|
|
|
|
guint64 value);
|
2003-01-05 21:52:14 +08:00
|
|
|
|
app, libgimp*, modules: don't use g_type_class_add_private() ...
... and G_TYPE_INSTANCE_GET_PRIVATE()
g_type_class_add_private() and G_TYPE_INSTANCE_GET_PRIVATE() were
deprecated in GLib 2.58. Instead, use
G_DEFINE_[ABSTRACT_]TYPE_WITH_PRIVATE(), and
G_ADD_PRIVATE[_DYNAMIC](), and the implictly-defined
foo_get_instance_private() functions, all of which are available in
the GLib versions we depend on.
This commit only covers types registered using one of the
G_DEFINE_FOO() macros (i.e., most types), but not types with a
custom registration function, of which we still have a few -- GLib
currently only provides a (non-deprecated) public API for adding a
private struct using the G_DEFINE_FOO() macros.
Note that this commit was 99% auto-generated (because I'm not
*that* crazy :), so if there are any style mismatches... we'll have
to live with them for now.
2018-09-19 00:09:39 +08:00
|
|
|
G_DEFINE_TYPE_WITH_PRIVATE (GimpMemsizeEntry, gimp_memsize_entry, GTK_TYPE_BOX)
|
2003-01-05 21:52:14 +08:00
|
|
|
|
2005-12-21 04:35:23 +08:00
|
|
|
#define parent_class gimp_memsize_entry_parent_class
|
2003-01-05 21:52:14 +08:00
|
|
|
|
2005-12-21 04:35:23 +08:00
|
|
|
static guint gimp_memsize_entry_signals[LAST_SIGNAL] = { 0 };
|
2003-01-05 21:52:14 +08:00
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_memsize_entry_class_init (GimpMemsizeEntryClass *klass)
|
|
|
|
{
|
app, libgimp*, modules: don't use g_type_class_add_private() ...
... and G_TYPE_INSTANCE_GET_PRIVATE()
g_type_class_add_private() and G_TYPE_INSTANCE_GET_PRIVATE() were
deprecated in GLib 2.58. Instead, use
G_DEFINE_[ABSTRACT_]TYPE_WITH_PRIVATE(), and
G_ADD_PRIVATE[_DYNAMIC](), and the implictly-defined
foo_get_instance_private() functions, all of which are available in
the GLib versions we depend on.
This commit only covers types registered using one of the
G_DEFINE_FOO() macros (i.e., most types), but not types with a
custom registration function, of which we still have a few -- GLib
currently only provides a (non-deprecated) public API for adding a
private struct using the G_DEFINE_FOO() macros.
Note that this commit was 99% auto-generated (because I'm not
*that* crazy :), so if there are any style mismatches... we'll have
to live with them for now.
2018-09-19 00:09:39 +08:00
|
|
|
klass->value_changed = NULL;
|
2005-12-21 04:35:23 +08:00
|
|
|
|
2003-10-15 23:30:11 +08:00
|
|
|
gimp_memsize_entry_signals[VALUE_CHANGED] =
|
2005-05-27 21:05:26 +08:00
|
|
|
g_signal_new ("value-changed",
|
2006-04-12 18:53:28 +08:00
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpMemsizeEntryClass, value_changed),
|
2020-01-12 18:06:05 +08:00
|
|
|
NULL, NULL, NULL,
|
2006-04-12 18:53:28 +08:00
|
|
|
G_TYPE_NONE, 0);
|
2003-01-05 21:52:14 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_memsize_entry_init (GimpMemsizeEntry *entry)
|
|
|
|
{
|
app, libgimp*, modules: don't use g_type_class_add_private() ...
... and G_TYPE_INSTANCE_GET_PRIVATE()
g_type_class_add_private() and G_TYPE_INSTANCE_GET_PRIVATE() were
deprecated in GLib 2.58. Instead, use
G_DEFINE_[ABSTRACT_]TYPE_WITH_PRIVATE(), and
G_ADD_PRIVATE[_DYNAMIC](), and the implictly-defined
foo_get_instance_private() functions, all of which are available in
the GLib versions we depend on.
This commit only covers types registered using one of the
G_DEFINE_FOO() macros (i.e., most types), but not types with a
custom registration function, of which we still have a few -- GLib
currently only provides a (non-deprecated) public API for adding a
private struct using the G_DEFINE_FOO() macros.
Note that this commit was 99% auto-generated (because I'm not
*that* crazy :), so if there are any style mismatches... we'll have
to live with them for now.
2018-09-19 00:09:39 +08:00
|
|
|
entry->priv = gimp_memsize_entry_get_instance_private (entry);
|
2011-01-03 21:03:00 +08:00
|
|
|
|
2011-07-28 01:53:34 +08:00
|
|
|
gtk_orientable_set_orientation (GTK_ORIENTABLE (entry),
|
|
|
|
GTK_ORIENTATION_HORIZONTAL);
|
|
|
|
|
2003-10-15 23:30:11 +08:00
|
|
|
gtk_box_set_spacing (GTK_BOX (entry), 4);
|
2003-01-05 21:52:14 +08:00
|
|
|
}
|
|
|
|
|
2003-11-13 00:39:11 +08:00
|
|
|
static void
|
|
|
|
gimp_memsize_entry_adj_callback (GtkAdjustment *adj,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpMemsizeEntry *entry)
|
2003-11-13 00:39:11 +08:00
|
|
|
{
|
2011-01-03 21:03:00 +08:00
|
|
|
GimpMemsizeEntryPrivate *private = GET_PRIVATE (entry);
|
|
|
|
guint64 size = gtk_adjustment_get_value (adj);
|
2003-11-13 00:39:11 +08:00
|
|
|
|
2020-08-05 19:33:07 +08:00
|
|
|
if (gimp_memsize_entry_get_rounded_value (entry, private->value) != size)
|
|
|
|
/* Do not allow losing accuracy if the converted/displayed value
|
|
|
|
* stays the same.
|
|
|
|
*/
|
|
|
|
private->value = size << private->shift;
|
2003-11-13 00:39:11 +08:00
|
|
|
|
|
|
|
g_signal_emit (entry, gimp_memsize_entry_signals[VALUE_CHANGED], 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_memsize_entry_unit_callback (GtkWidget *widget,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpMemsizeEntry *entry)
|
2003-11-13 00:39:11 +08:00
|
|
|
{
|
2011-01-03 21:03:00 +08:00
|
|
|
GimpMemsizeEntryPrivate *private = GET_PRIVATE (entry);
|
|
|
|
guint shift;
|
2004-04-20 22:37:12 +08:00
|
|
|
|
|
|
|
gimp_int_combo_box_get_active (GIMP_INT_COMBO_BOX (widget), (gint *) &shift);
|
2003-11-13 00:39:11 +08:00
|
|
|
|
2004-07-12 05:53:17 +08:00
|
|
|
#if _MSC_VER < 1300
|
2003-11-17 05:20:14 +08:00
|
|
|
# define CAST (gint64)
|
|
|
|
#else
|
|
|
|
# define CAST
|
|
|
|
#endif
|
|
|
|
|
2011-01-03 21:03:00 +08:00
|
|
|
if (shift != private->shift)
|
2003-11-13 00:39:11 +08:00
|
|
|
{
|
2011-01-03 21:03:00 +08:00
|
|
|
private->shift = shift;
|
|
|
|
|
|
|
|
gtk_adjustment_configure (private->adjustment,
|
2020-08-05 19:33:07 +08:00
|
|
|
gimp_memsize_entry_get_rounded_value (entry, private->value),
|
2011-01-03 21:03:00 +08:00
|
|
|
CAST private->lower >> shift,
|
|
|
|
CAST private->upper >> shift,
|
|
|
|
gtk_adjustment_get_step_increment (private->adjustment),
|
|
|
|
gtk_adjustment_get_page_increment (private->adjustment),
|
|
|
|
gtk_adjustment_get_page_size (private->adjustment));
|
2003-11-13 00:39:11 +08:00
|
|
|
}
|
2009-03-22 23:42:42 +08:00
|
|
|
|
2003-11-17 05:20:14 +08:00
|
|
|
#undef CAST
|
2003-11-13 00:39:11 +08:00
|
|
|
}
|
|
|
|
|
2020-08-05 19:33:07 +08:00
|
|
|
/**
|
|
|
|
* gimp_memsize_entry_get_rounded_value:
|
|
|
|
* @entry: #GimpMemsizeEntry whose set unit is used.
|
|
|
|
* @value: value to convert to @entry unit, and rounded.
|
|
|
|
*
|
|
|
|
* Returns: the proper integer value to be displayed for current unit.
|
|
|
|
* This value has been appropriately rounded to the nearest
|
|
|
|
* integer, away from zero.
|
|
|
|
*/
|
|
|
|
static guint64
|
|
|
|
gimp_memsize_entry_get_rounded_value (GimpMemsizeEntry *entry,
|
|
|
|
guint64 value)
|
|
|
|
{
|
|
|
|
GimpMemsizeEntryPrivate *private = GET_PRIVATE (entry);
|
|
|
|
guint64 converted;
|
|
|
|
|
|
|
|
#if _MSC_VER < 1300
|
|
|
|
# define CAST (gint64)
|
|
|
|
#else
|
|
|
|
# define CAST
|
|
|
|
#endif
|
|
|
|
|
|
|
|
converted = (CAST value >> private->shift) +
|
|
|
|
((CAST private->value >> (private->shift - 1)) & 1);
|
|
|
|
|
|
|
|
#undef CAST
|
|
|
|
|
|
|
|
return converted;
|
|
|
|
}
|
|
|
|
|
2003-11-13 00:39:11 +08:00
|
|
|
|
2003-01-05 21:52:14 +08:00
|
|
|
/**
|
|
|
|
* gimp_memsize_entry_new:
|
|
|
|
* @value: the initial value (in Bytes)
|
|
|
|
* @lower: the lower limit for the value (in Bytes)
|
|
|
|
* @upper: the upper limit for the value (in Bytes)
|
|
|
|
*
|
|
|
|
* Creates a new #GimpMemsizeEntry which is a #GtkHBox with a #GtkSpinButton
|
|
|
|
* and a #GtkOptionMenu all setup to allow the user to enter memory sizes.
|
|
|
|
*
|
|
|
|
* Returns: Pointer to the new #GimpMemsizeEntry.
|
|
|
|
**/
|
|
|
|
GtkWidget *
|
2003-11-14 20:29:51 +08:00
|
|
|
gimp_memsize_entry_new (guint64 value,
|
2006-04-12 18:53:28 +08:00
|
|
|
guint64 lower,
|
|
|
|
guint64 upper)
|
2003-01-05 21:52:14 +08:00
|
|
|
{
|
2011-01-03 21:03:00 +08:00
|
|
|
GimpMemsizeEntry *entry;
|
|
|
|
GimpMemsizeEntryPrivate *private;
|
|
|
|
guint shift;
|
2003-01-05 21:52:14 +08:00
|
|
|
|
2004-07-12 05:53:17 +08:00
|
|
|
#if _MSC_VER < 1300
|
2003-11-17 05:20:14 +08:00
|
|
|
# define CAST (gint64)
|
|
|
|
#else
|
|
|
|
# define CAST
|
|
|
|
#endif
|
|
|
|
|
2003-01-05 21:52:14 +08:00
|
|
|
g_return_val_if_fail (value >= lower && value <= upper, NULL);
|
|
|
|
|
2003-06-07 02:22:46 +08:00
|
|
|
entry = g_object_new (GIMP_TYPE_MEMSIZE_ENTRY, NULL);
|
2003-01-05 21:52:14 +08:00
|
|
|
|
2011-01-03 21:03:00 +08:00
|
|
|
private = GET_PRIVATE (entry);
|
|
|
|
|
2003-01-05 21:52:14 +08:00
|
|
|
for (shift = 30; shift > 10; shift -= 10)
|
|
|
|
{
|
2008-01-06 08:52:00 +08:00
|
|
|
if (value > (G_GUINT64_CONSTANT (1) << shift) &&
|
|
|
|
value % (G_GUINT64_CONSTANT (1) << shift) == 0)
|
2003-01-05 21:52:14 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2011-01-03 21:03:00 +08:00
|
|
|
private->value = value;
|
|
|
|
private->lower = lower;
|
|
|
|
private->upper = upper;
|
|
|
|
private->shift = shift;
|
2003-06-07 02:22:46 +08:00
|
|
|
|
2020-08-05 19:33:07 +08:00
|
|
|
private->adjustment = gtk_adjustment_new (gimp_memsize_entry_get_rounded_value (entry,
|
|
|
|
private->value),
|
2018-06-25 00:15:16 +08:00
|
|
|
CAST (lower >> shift),
|
|
|
|
CAST (upper >> shift),
|
|
|
|
1, 8, 0);
|
2014-06-22 04:35:39 +08:00
|
|
|
|
2019-03-09 20:25:19 +08:00
|
|
|
private->spinbutton = gimp_spin_button_new (private->adjustment, 1.0, 0);
|
2011-01-03 21:03:00 +08:00
|
|
|
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (private->spinbutton), TRUE);
|
2003-11-17 05:20:14 +08:00
|
|
|
|
|
|
|
#undef CAST
|
2003-01-05 21:52:14 +08:00
|
|
|
|
2011-01-03 21:03:00 +08:00
|
|
|
gtk_entry_set_width_chars (GTK_ENTRY (private->spinbutton), 7);
|
|
|
|
gtk_box_pack_start (GTK_BOX (entry), private->spinbutton, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (private->spinbutton);
|
2003-01-05 21:52:14 +08:00
|
|
|
|
2011-01-03 21:03:00 +08:00
|
|
|
g_signal_connect (private->adjustment, "value-changed",
|
2003-01-05 21:52:14 +08:00
|
|
|
G_CALLBACK (gimp_memsize_entry_adj_callback),
|
|
|
|
entry);
|
2003-06-07 02:22:46 +08:00
|
|
|
|
2020-08-05 19:33:07 +08:00
|
|
|
private->menu = gimp_int_combo_box_new (_("Kibibyte"), 10,
|
|
|
|
_("Mebibyte"), 20,
|
|
|
|
_("Gibibyte"), 30,
|
|
|
|
NULL);
|
2004-04-20 22:37:12 +08:00
|
|
|
|
2011-01-03 21:03:00 +08:00
|
|
|
gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (private->menu), shift);
|
2004-04-20 22:37:12 +08:00
|
|
|
|
2011-01-03 21:03:00 +08:00
|
|
|
g_signal_connect (private->menu, "changed",
|
2004-04-20 22:37:12 +08:00
|
|
|
G_CALLBACK (gimp_memsize_entry_unit_callback),
|
|
|
|
entry);
|
2003-01-05 21:52:14 +08:00
|
|
|
|
2011-01-03 21:03:00 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (entry), private->menu, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (private->menu);
|
2003-01-05 21:52:14 +08:00
|
|
|
|
|
|
|
return GTK_WIDGET (entry);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_memsize_entry_set_value:
|
|
|
|
* @entry: a #GimpMemsizeEntry
|
|
|
|
* @value: the new value (in Bytes)
|
|
|
|
*
|
|
|
|
* Sets the @entry's value. Please note that the #GimpMemsizeEntry rounds
|
|
|
|
* the value to full Kilobytes.
|
|
|
|
**/
|
|
|
|
void
|
|
|
|
gimp_memsize_entry_set_value (GimpMemsizeEntry *entry,
|
2006-04-12 18:53:28 +08:00
|
|
|
guint64 value)
|
2003-01-05 21:52:14 +08:00
|
|
|
{
|
2011-01-03 21:03:00 +08:00
|
|
|
GimpMemsizeEntryPrivate *private;
|
|
|
|
guint shift;
|
2003-01-05 21:52:14 +08:00
|
|
|
|
|
|
|
g_return_if_fail (GIMP_IS_MEMSIZE_ENTRY (entry));
|
2011-01-03 21:03:00 +08:00
|
|
|
|
|
|
|
private = GET_PRIVATE (entry);
|
|
|
|
|
|
|
|
g_return_if_fail (value >= private->lower && value <= private->upper);
|
2003-01-05 21:52:14 +08:00
|
|
|
|
|
|
|
for (shift = 30; shift > 10; shift -= 10)
|
|
|
|
{
|
2008-01-06 08:52:00 +08:00
|
|
|
if (value > (G_GUINT64_CONSTANT (1) << shift) &&
|
|
|
|
value % (G_GUINT64_CONSTANT (1) << shift) == 0)
|
2003-01-05 21:52:14 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2011-01-03 21:03:00 +08:00
|
|
|
if (shift != private->shift)
|
2020-08-05 18:30:21 +08:00
|
|
|
gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (private->menu), shift);
|
2003-01-05 21:52:14 +08:00
|
|
|
|
2020-08-05 19:33:07 +08:00
|
|
|
gtk_adjustment_set_value (private->adjustment,
|
|
|
|
(gdouble) gimp_memsize_entry_get_rounded_value (entry, value));
|
2003-11-17 05:20:14 +08:00
|
|
|
|
|
|
|
#undef CASE
|
2003-01-05 21:52:14 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_memsize_entry_get_value:
|
|
|
|
* @entry: a #GimpMemsizeEntry
|
|
|
|
*
|
|
|
|
* Retrieves the current value from a #GimpMemsizeEntry.
|
|
|
|
*
|
|
|
|
* Returns: the current value of @entry (in Bytes).
|
|
|
|
**/
|
2003-11-14 20:29:51 +08:00
|
|
|
guint64
|
2003-01-05 21:52:14 +08:00
|
|
|
gimp_memsize_entry_get_value (GimpMemsizeEntry *entry)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_MEMSIZE_ENTRY (entry), 0);
|
2003-10-15 23:30:11 +08:00
|
|
|
|
2011-01-03 21:03:00 +08:00
|
|
|
return GET_PRIVATE (entry)->value;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_memsize_entry_get_spinbutton:
|
|
|
|
* @entry: a #GimpMemsizeEntry
|
|
|
|
*
|
GIR: Try to return more specific GtkWidget subclass
In GTK, a common scheme is to let a function creating a specific widget
to return a `GtkWidget *`, rather than the specific subtype, since you
often need to call API of GtkWidget, avoiding some useless casts.
For bindings however (and especially bindings to compiled languages),
this is a bit annoying, as you have to explicitly change the type of the
return value (downcast), which is not trivial (or at least desirable) in
each language.
Luckily, we can use `(type ...)` annotation for this use case, leaving
the C API unchanged, while improving the experience for bindings.
2020-12-25 22:05:16 +08:00
|
|
|
* Returns: (transfer none) (type GtkSpinButton): the entry's #GtkSpinbutton.
|
2011-01-03 21:03:00 +08:00
|
|
|
*
|
2019-07-24 07:18:30 +08:00
|
|
|
* Since: 3.0
|
2011-01-03 21:03:00 +08:00
|
|
|
**/
|
|
|
|
GtkWidget *
|
|
|
|
gimp_memsize_entry_get_spinbutton (GimpMemsizeEntry *entry)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_MEMSIZE_ENTRY (entry), 0);
|
|
|
|
|
|
|
|
return GET_PRIVATE (entry)->spinbutton;
|
2003-01-05 21:52:14 +08:00
|
|
|
}
|