Commit 5b538db8 authored by David Odin's avatar David Odin

New object to handle zoom factor, and create widgets to control or view

* libgimpwidgets/gimpzoommodel.[ch]: New object to handle zoom
  factor, and create widgets to control or view this value.

* libgimpwidgets/Makefile.am
* libgimpwidgets/gimpwidgets.h: Added gimpzoommodel.[ch].

* libgimpwidgets/gimpwidgetsenums.h: new enum: GimpZoomWidgetType.
  This enumerate which knid of widget you can created from the zoom
  model.

* libgimpwidgets/gimpwidgetsenums.c
* libgimpwidgets/gimpwidgetstypes.h: regenerated.

* libgimpwidgets/gimppreview.c: move the update toggle to the bottom
  of the vbox.

* libgimp/Makefile.am
* libgimp/gimpui.h
* libgimp/gimpuitypes.h
* libgimp/gimpzoompreview.[ch]: New widget, derivated from
  GimpScrolledPreview, which offer the same functionnalities as the
  GimpAspectPreview widget plus zoom facilities.

* plug-ins/common/AlienMap2.c
* plug-ins/common/apply_lens.c
* plug-ins/common/blinds.c
* plug-ins/common/channel_mixer.c
* plug-ins/common/colorify.c
* plug-ins/common/flarefx.c
* plug-ins/common/illusion.c
* plug-ins/common/jigsaw.c
* plug-ins/common/mapcolor.c
* plug-ins/common/max_rgb.c
* plug-ins/common/nova.c
* plug-ins/common/polar.c
* plug-ins/common/retinex.c
* plug-ins/common/waves.c
* plug-ins/common/whirlpinch.c: use a GimpZoomPreview instead of a
  GimpAspectPreview.
parent c7998a18
2005-09-20 DindinX <dindinx@gimp.org>
* libgimpwidgets/gimpzoommodel.[ch]: New object to handle zoom
factor, and create widgets to control or view this value.
* libgimpwidgets/Makefile.am
* libgimpwidgets/gimpwidgets.h: Added gimpzoommodel.[ch].
* libgimpwidgets/gimpwidgetsenums.h: new enum: GimpZoomWidgetType.
This enumerate which knid of widget you can created from the zoom
model.
* libgimpwidgets/gimpwidgetsenums.c
* libgimpwidgets/gimpwidgetstypes.h: regenerated.
* libgimpwidgets/gimppreview.c: move the update toggle to the bottom
of the box.
* libgimp/Makefile.am
* libgimp/gimpui.h
* libgimp/gimpuitypes.h
* libgimp/gimpzoompreview.[ch]: New widget, derivated from
GimpScrolledPreview, which offer the same functionnalities as the
GimpAspectPreview widget plus zoom facilities.
* plug-ins/common/AlienMap2.c
* plug-ins/common/apply_lens.c
* plug-ins/common/blinds.c
* plug-ins/common/channel_mixer.c
* plug-ins/common/colorify.c
* plug-ins/common/flarefx.c
* plug-ins/common/illusion.c
* plug-ins/common/jigsaw.c
* plug-ins/common/mapcolor.c
* plug-ins/common/max_rgb.c
* plug-ins/common/nova.c
* plug-ins/common/polar.c
* plug-ins/common/retinex.c
* plug-ins/common/waves.c
* plug-ins/common/whirlpinch.c: use a GimpZoomPreview instead of a
GimpAspectPreview.
2005-09-19 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpclipboard.[ch]: added new public function
......
......@@ -264,7 +264,9 @@ libgimpui_2_0_la_sources = \
gimpprocview.c \
gimpprocview.h \
gimpprogressbar.c \
gimpprogressbar.h
gimpprogressbar.h \
gimpzoompreview.c \
gimpzoompreview.h
libgimpui_2_0_la_built_sources = \
gimpuimarshal.c \
......@@ -323,7 +325,8 @@ gimpinclude_HEADERS = \
gimppixbuf.h \
gimpprocbrowserdialog.h \
gimpprocview.h \
gimpprogressbar.h
gimpprogressbar.h \
gimpzoompreview.h
libgimp_2_0_la_LDFLAGS = \
-version-info $(LT_VERSION_INFO) \
......
......@@ -42,7 +42,7 @@
#include <libgimp/gimpdrawablecombobox.h>
#include <libgimp/gimpimagecombobox.h>
#include <libgimp/gimpfontselectbutton.h>
#include <libgimp/gimpzoompreview.h>
G_BEGIN_DECLS
......
......@@ -33,6 +33,7 @@ typedef struct _GimpAspectPreview GimpAspectPreview;
typedef struct _GimpDrawablePreview GimpDrawablePreview;
typedef struct _GimpProcBrowserDialog GimpProcBrowserDialog;
typedef struct _GimpProgressBar GimpProgressBar;
typedef struct _GimpZoomPreview GimpZoomPreview;
typedef struct _GimpDrawableComboBox GimpDrawableComboBox;
typedef struct _GimpChannelComboBox GimpChannelComboBox;
......
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
*
* gimpzoompreview.c
* Copyright (C) 2005 David Odin <dindinx@gimp.org>
*
* 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 2 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, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "gimpuitypes.h"
#include "gimp.h"
#include "libgimp-intl.h"
#include "gimpzoompreview.h"
#define SELECTION_BORDER 2
static void gimp_zoom_preview_set_adjustments (GimpZoomPreview *preview);
static void gimp_zoom_preview_size_allocate (GtkWidget *widget,
GtkAllocation *allocation,
GimpZoomPreview *preview);
static void gimp_zoom_preview_style_set (GtkWidget *widget,
GtkStyle *prev_style);
static void gimp_zoom_preview_draw (GimpPreview *preview);
static void gimp_zoom_preview_draw_buffer (GimpPreview *preview,
const guchar *buffer,
gint rowstride);
static void gimp_zoom_preview_draw_thumb (GimpPreview *preview,
GimpPreviewArea *area,
gint width,
gint height);
static gboolean gimp_zoom_preview_get_bounds (GimpDrawable *drawable,
gint *xmin,
gint *ymin,
gint *xmax,
gint *ymax);
G_DEFINE_TYPE (GimpZoomPreview, gimp_zoom_preview,
GIMP_TYPE_SCROLLED_PREVIEW)
#define parent_class gimp_zoom_preview_parent_class
static void
gimp_zoom_preview_class_init (GimpZoomPreviewClass *klass)
{
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
GimpPreviewClass *preview_class = GIMP_PREVIEW_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
widget_class->style_set = gimp_zoom_preview_style_set;
preview_class->draw = gimp_zoom_preview_draw;
preview_class->draw_buffer = gimp_zoom_preview_draw_buffer;
preview_class->draw_thumb = gimp_zoom_preview_draw_thumb;
}
static void
gimp_zoom_preview_init (GimpZoomPreview *preview)
{
GtkWidget *button_bar;
GtkWidget *button;
GtkWidget *label;
preview->zoom = gimp_zoom_model_new (1.1);
g_signal_connect_swapped (preview->zoom, "notify::zoom-factor",
G_CALLBACK (gimp_zoom_preview_set_adjustments),
preview);
button_bar = gtk_hbox_new (FALSE, 0);
gtk_box_pack_end (GTK_BOX (preview), button_bar, FALSE, FALSE, 0);
gtk_widget_show (button_bar);
/* zoom out */
button = gimp_zoom_widget_new (preview->zoom, GIMP_ZOOM_OUT_BUTTON);
gtk_box_pack_start (GTK_BOX (button_bar), button,
FALSE, FALSE, 0);
gtk_widget_show (button);
/* zoom in */
button = gimp_zoom_widget_new (preview->zoom, GIMP_ZOOM_IN_BUTTON);
gtk_box_pack_start (GTK_BOX (button_bar), button,
FALSE, FALSE, 0);
gtk_widget_show (button);
/* label */
label = gimp_zoom_widget_new (preview->zoom, GIMP_ZOOM_LABEL);
gtk_box_pack_start (GTK_BOX (button_bar), label,
FALSE, FALSE, 0);
gtk_widget_show (label);
g_signal_connect (GIMP_PREVIEW (preview)->area, "size-allocate",
G_CALLBACK (gimp_zoom_preview_size_allocate),
preview);
g_object_set (GIMP_PREVIEW (preview)->area,
"check-size", gimp_check_size (),
"check-type", gimp_check_type (),
NULL);
}
static void
gimp_zoom_preview_set_adjustments (GimpZoomPreview *preview)
{
GimpScrolledPreview *scrolled_preview;
GtkAdjustment *adj;
gdouble zoom_factor;
scrolled_preview = GIMP_SCROLLED_PREVIEW (preview);
zoom_factor = gimp_zoom_model_get_factor (preview->zoom);
if (fabs (zoom_factor - 1.0) < 0.05)
{
gtk_widget_hide (scrolled_preview->vscr);
gtk_widget_hide (scrolled_preview->hscr);
gtk_widget_hide (scrolled_preview->nav_icon);
}
else
{
adj = gtk_range_get_adjustment (GTK_RANGE (scrolled_preview->hscr));
adj->lower = 0;
adj->page_size = GIMP_PREVIEW (preview)->width;
adj->upper = GIMP_PREVIEW (preview)->width * zoom_factor;
adj->step_increment = 1.0;
adj->page_increment = MAX (adj->page_size / 2.0, adj->step_increment);
adj->value = CLAMP (adj->value,
adj->lower,
adj->upper - adj->page_size);
gtk_adjustment_changed (adj);
adj = gtk_range_get_adjustment (GTK_RANGE (scrolled_preview->vscr));
adj->lower = 0;
adj->page_size = GIMP_PREVIEW (preview)->height;
adj->upper = GIMP_PREVIEW (preview)->height * zoom_factor;
adj->step_increment = 1.0;
adj->page_increment = MAX (adj->page_size / 2.0, adj->step_increment);
adj->value = CLAMP (adj->value,
adj->lower,
adj->upper - adj->page_size);
gtk_adjustment_changed (adj);
gtk_widget_show (scrolled_preview->vscr);
gtk_widget_show (scrolled_preview->hscr);
gtk_widget_show (scrolled_preview->nav_icon);
}
gimp_preview_invalidate (GIMP_PREVIEW (preview));
}
static void
gimp_zoom_preview_size_allocate (GtkWidget *widget,
GtkAllocation *allocation,
GimpZoomPreview *preview)
{
gint width = GIMP_PREVIEW (preview)->xmax - GIMP_PREVIEW (preview)->xmin;
gint height = GIMP_PREVIEW (preview)->ymax - GIMP_PREVIEW (preview)->ymin;
GIMP_PREVIEW (preview)->width = MIN (width, allocation->width);
GIMP_PREVIEW (preview)->height = MIN (height, allocation->height);
gimp_zoom_preview_set_adjustments (preview);
}
static void
gimp_zoom_preview_style_set (GtkWidget *widget,
GtkStyle *prev_style)
{
GimpPreview *preview = GIMP_PREVIEW (widget);
GimpDrawable *drawable = GIMP_ZOOM_PREVIEW (preview)->drawable;
gint size;
gint width, height;
if (GTK_WIDGET_CLASS (parent_class)->style_set)
GTK_WIDGET_CLASS (parent_class)->style_set (widget, prev_style);
gtk_widget_style_get (widget,
"size", &size,
NULL);
width = gimp_drawable_width (drawable->drawable_id);
height = gimp_drawable_height (drawable->drawable_id);
if (width > height)
{
preview->width = MIN (width, size);
preview->height = (height * preview->width) / width;
}
else
{
preview->height = MIN (height, size);
preview->width = (width * preview->height) / height;
}
gtk_widget_set_size_request (preview->area,
preview->width, preview->height);
}
guchar *
gimp_zoom_preview_get_data (GimpZoomPreview *preview,
gint *width,
gint *height,
gint *bpp)
{
guchar *data;
GimpDrawable *drawable = preview->drawable;
gint src_x;
gint src_y;
gint src_width;
gint src_height;
gdouble zoom_factor = gimp_zoom_model_get_factor (preview->zoom);
GimpPreview *gimp_preview = GIMP_PREVIEW (preview);
*width = gimp_preview->width;
*height = gimp_preview->height;
src_x = preview->extents.x +
gimp_preview->xoff * preview->extents.width / *width / zoom_factor;
src_y = preview->extents.y +
gimp_preview->yoff * preview->extents.height / *height / zoom_factor;
src_width = preview->extents.width / zoom_factor;
src_height = preview->extents.height / zoom_factor;
data = gimp_drawable_get_sub_thumbnail_data (drawable->drawable_id,
src_x, src_y,
src_width, src_height,
width, height, bpp);
return data;
}
static void
gimp_zoom_preview_draw (GimpPreview *gimp_preview)
{
guchar *data;
gint width;
gint height;
gint bpp;
gint src_x;
gint src_y;
gint src_width;
gint src_height;
GimpZoomPreview *preview;
GimpDrawable *drawable;
gdouble zoom_factor;
g_return_if_fail (GIMP_IS_ZOOM_PREVIEW (gimp_preview));
preview = GIMP_ZOOM_PREVIEW (gimp_preview);
drawable = preview->drawable;
if (!drawable)
return;
zoom_factor = gimp_zoom_model_get_factor (preview->zoom);
width = gimp_preview->width;
height = gimp_preview->height;
src_x = preview->extents.x +
gimp_preview->xoff * preview->extents.width / width / zoom_factor;
src_y = preview->extents.y +
gimp_preview->yoff * preview->extents.height / height / zoom_factor;
src_width = preview->extents.width / zoom_factor;
src_height = preview->extents.height / zoom_factor;
data = gimp_drawable_get_sub_thumbnail_data (drawable->drawable_id,
src_x, src_y,
src_width, src_height,
&width, &height, &bpp);
gimp_preview_area_draw (GIMP_PREVIEW_AREA (gimp_preview->area),
0, 0, width, height,
gimp_drawable_type (drawable->drawable_id),
data, width * bpp);
g_free (data);
}
static void
gimp_zoom_preview_draw_buffer (GimpPreview *preview,
const guchar *buffer,
gint rowstride)
{
gint32 image_id;
GimpDrawable *drawable = GIMP_ZOOM_PREVIEW (preview)->drawable;
image_id = gimp_drawable_get_image (drawable->drawable_id);
if (gimp_selection_is_empty (image_id))
{
gimp_preview_area_draw (GIMP_PREVIEW_AREA (preview->area),
0, 0,
preview->width, preview->height,
gimp_drawable_type (drawable->drawable_id),
buffer,
rowstride);
}
else
{
guchar *sel;
guchar *src;
gint selection_id;
gint width, height;
gint bpp;
selection_id = gimp_image_get_selection (image_id);
width = preview->width;
height = preview->height;
src = gimp_drawable_get_thumbnail_data (drawable->drawable_id,
&width, &height, &bpp);
sel = gimp_drawable_get_thumbnail_data (selection_id,
&width, &height, &bpp);
gimp_preview_area_mask (GIMP_PREVIEW_AREA (preview->area),
0, 0, preview->width, preview->height,
gimp_drawable_type (drawable->drawable_id),
src, width * drawable->bpp,
buffer, rowstride,
sel, width);
g_free (sel);
g_free (src);
}
}
static void
gimp_zoom_preview_draw_thumb (GimpPreview *preview,
GimpPreviewArea *area,
gint width,
gint height)
{
GimpZoomPreview *zoom_preview = GIMP_ZOOM_PREVIEW (preview);
GimpDrawable *drawable = zoom_preview->drawable;
guchar *buffer;
gint x1, y1, x2, y2;
gint bpp;
if (! drawable)
return;
if (gimp_zoom_preview_get_bounds (drawable, &x1, &y1, &x2, &y2))
{
buffer = gimp_drawable_get_sub_thumbnail_data (drawable->drawable_id,
x1, y1, x2 - x1, y2 - y1,
&width, &height, &bpp);
}
else
{
buffer = gimp_drawable_get_thumbnail_data (drawable->drawable_id,
&width, &height, &bpp);
}
if (buffer)
{
GimpImageType type;
gtk_widget_set_size_request (GTK_WIDGET (area), width, height);
gtk_widget_show (GTK_WIDGET (area));
gtk_widget_realize (GTK_WIDGET (area));
switch (bpp)
{
case 1: type = GIMP_GRAY_IMAGE; break;
case 2: type = GIMP_GRAYA_IMAGE; break;
case 3: type = GIMP_RGB_IMAGE; break;
case 4: type = GIMP_RGBA_IMAGE; break;
default:
g_free (buffer);
return;
}
gimp_preview_area_draw (area,
0, 0, width, height,
type, buffer, bpp * width);
g_free (buffer);
}
}
#define MAX3(a, b, c) (MAX (MAX ((a), (b)), (c)))
#define MIN3(a, b, c) (MIN (MIN ((a), (b)), (c)))
static gboolean
gimp_zoom_preview_get_bounds (GimpDrawable *drawable,
gint *xmin,
gint *ymin,
gint *xmax,
gint *ymax)
{
gint width;
gint height;
gint offset_x;
gint offset_y;
gint x1, y1;
gint x2, y2;
gboolean retval;
width = gimp_drawable_width (drawable->drawable_id);
height = gimp_drawable_height (drawable->drawable_id);
retval = gimp_drawable_mask_bounds (drawable->drawable_id,
&x1, &y1, &x2, &y2);
gimp_drawable_offsets (drawable->drawable_id, &offset_x, &offset_y);
*xmin = MAX3 (x1 - SELECTION_BORDER, 0, - offset_x);
*ymin = MAX3 (y1 - SELECTION_BORDER, 0, - offset_y);
*xmax = MIN3 (x2 + SELECTION_BORDER, width, width + offset_x);
*ymax = MIN3 (y2 + SELECTION_BORDER, height, height + offset_y);
return retval;
}
GtkWidget *
gimp_zoom_preview_new (GimpDrawable *drawable)
{
GimpZoomPreview *preview;
gint width, height;
gint max_width, max_height;
preview = g_object_new (GIMP_TYPE_ZOOM_PREVIEW, NULL);
preview->drawable = drawable;
width = gimp_drawable_width (drawable->drawable_id);
height = gimp_drawable_height (drawable->drawable_id);
preview->extents.x = 0;
preview->extents.y = 0;
preview->extents.width = width;
preview->extents.height = height;
if (width > height)
{
max_width = MIN (width, 512);
max_height = (height * max_width) / width;
}
else
{
max_height = MIN (height, 512);
max_width = (width * max_height) / height;
}
gimp_preview_set_bounds (GIMP_PREVIEW (preview),
0, 0, max_width, max_height);
g_object_set (GIMP_PREVIEW (preview)->frame,
"ratio", (gdouble) width / (gdouble) height,
NULL);
gimp_zoom_preview_set_adjustments (preview);
return GTK_WIDGET (preview);
}
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
*
* gimpzoompreview.h
* Copyright (C) 2005 David Odin <dindinx@gimp.org>
*
* 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 2 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, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GIMP_ZOOM_PREVIEW_H__
#define __GIMP_ZOOM_PREVIEW_H__
#include <libgimpwidgets/gimppreview.h>
G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
#define GIMP_TYPE_ZOOM_PREVIEW (gimp_zoom_preview_get_type ())
#define GIMP_ZOOM_PREVIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_ZOOM_PREVIEW, GimpZoomPreview))
#define GIMP_ZOOM_PREVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_ZOOM_PREVIEW, GimpZoomPreviewClass))
#define GIMP_IS_ZOOM_PREVIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_ZOOM_PREVIEW))
#define GIMP_IS_ZOOM_PREVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_ZOOM_PREVIEW))
#define GIMP_ZOOM_PREVIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_ZOOM_PREVIEW, GimpZoomPreviewClass))
typedef struct _GimpZoomPreviewClass GimpZoomPreviewClass;
struct _GimpZoomPreview
{
GimpScrolledPreview parent_instance;
/*< private >*/
GimpDrawable *drawable;
GimpZoomModel *zoom;
GdkRectangle extents;
};
struct _GimpZoomPreviewClass
{
GimpScrolledPreviewClass parent_class;
/* Padding for future expansion */
void (* _gimp_reserved1) (void);
void (* _gimp_reserved2) (void);
void (* _gimp_reserved3) (void);
void (* _gimp_reserved4) (void);
};
GType gimp_zoom_preview_get_type (void) G_GNUC_CONST;
GtkWidget * gimp_zoom_preview_new (GimpDrawable *drawable);
guchar * gimp_zoom_preview_get_data (GimpZoomPreview *preview,
gint *width,
gint *height,
gint *bpp);
G_END_DECLS
#endif /* __GIMP_ZOOM_PREVIEW_H__ */
......@@ -150,6 +150,8 @@ libgimpwidgets_2_0_la_sources = \
gimpstock.h \
gimpunitmenu.c \
gimpunitmenu.h \
gimpzoommodel.c \
gimpzoommodel.h \
gimpwidgets-private.c \
gimpwidgets-private.h
......@@ -215,7 +217,8 @@ libgimpwidgetsinclude_HEADERS = \
gimpscrolledpreview.h \
gimpsizeentry.h \
gimpstock.h \
gimpunitmenu.h
gimpunitmenu.h \
gimpzoommodel.h
libgimpwidgets_2_0_la_LDFLAGS = \
-version-info $(LT_VERSION_INFO) \
......
......@@ -240,7 +240,7 @@ gimp_preview_init (GimpPreview *preview)
preview->toggle = gtk_check_button_new_with_mnemonic (_("_Preview"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (preview->toggle),
preview->update_preview);
gtk_box_pack_start (GTK_BOX (preview), preview->toggle, FALSE, FALSE, 0);
gtk_box_pack_end (GTK_BOX (preview), preview->toggle, FALSE, FALSE, 0);
gtk_widget_show (preview->toggle);
g_signal_connect (preview->toggle, "toggled",
......
......@@ -67,6 +67,7 @@
#include <libgimpwidgets/gimpsizeentry.h>
#include <libgimpwidgets/gimpstock.h>
#include <libgimpwidgets/gimpunitmenu.h>
#include <libgimpwidgets/gimpzoommodel.h>
#include <libgimpwidgets/gimpoldwidgets.h>
......
......@@ -171,6 +171,37 @@ gimp_size_entry_update_policy_get_type (void)
return type;
}
GType
gimp_zoom_widget_type_get_type (void)
{
static const GEnumValue values[] =
{
{ GIMP_ZOOM_IN_BUTTON, "GIMP_ZOOM_IN_BUTTON", "in-button" },
{ GIMP_ZOOM_OUT_BUTTON, "GIMP_ZOOM_OUT_BUTTON", "out-button" },
{ GIMP_ZOOM_LABEL, "GIMP_ZOOM_LABEL", "label" },
{ 0, NULL, NULL }
};
static const GimpEnumDesc descs[] =
{
{ GIMP_ZOOM_IN_BUTTON, "GIMP_ZOOM_IN_BUTTON", NULL },
{ GIMP_ZOOM_OUT_BUTTON, "GIMP_ZOOM_OUT_BUTTON", NULL },
{ GIMP_ZOOM_LABEL, "GIMP_ZOOM_LABEL", NULL },
{ 0, NULL, NULL }
};
static GType type = 0;
if (! type)
{
type = g_enum_register_static ("GimpZoomWidgetType", values);
gimp_type_set_translation_domain (type, GETTEXT_PACKAGE "-libgimp");
gimp_enum_set_value_descriptions (type, descs);
}
return type;
}
/* Generated data ends here */
......@@ -90,6 +90,18 @@ typedef enum
} GimpSizeEntryUpdatePolicy;
#define GIMP_TYPE_ZOOM_WIDGET_TYPE (gimp_zoom_model_widget_type_get_type ())
GType gimp_zoom_widget_type_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_ZOOM_IN_BUTTON,
GIMP_ZOOM_OUT_BUTTON,
GIMP_ZOOM_LABEL
} GimpZoomWidgetType;
G_END_DECLS
#endif /* __GIMP_WIDGETS_ENUMS_H__ */
......@@ -68,6 +68,7 @@ typedef struct _GimpResolutionEntry GimpResolutionEntry;
typedef struct _GimpScrolledPreview GimpScrolledPreview;
typedef struct _GimpSizeEntry GimpSizeEntry;
typedef struct _GimpUnitMenu GimpUnitMenu;
typedef struct _GimpZoomModel GimpZoomModel;