2004-08-31 06:10:26 +08:00
|
|
|
/* LIBGIMP - The GIMP Library
|
|
|
|
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
|
|
|
*
|
|
|
|
* gimppreview.h
|
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This library is free software: you can redistribute it and/or
|
2004-08-31 06:10:26 +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.
|
2004-08-31 06:10:26 +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
|
|
|
|
* Lesser 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
|
|
|
|
* <http://www.gnu.org/licenses/>.
|
2004-08-31 06:10:26 +08:00
|
|
|
*/
|
|
|
|
|
2011-04-28 20:30:41 +08:00
|
|
|
#if !defined (__GIMP_WIDGETS_H_INSIDE__) && !defined (GIMP_WIDGETS_COMPILATION)
|
|
|
|
#error "Only <libgimpwidgets/gimpwidgets.h> can be included directly."
|
|
|
|
#endif
|
|
|
|
|
2004-08-31 06:10:26 +08:00
|
|
|
#ifndef __GIMP_PREVIEW_H__
|
|
|
|
#define __GIMP_PREVIEW_H__
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2004-08-31 06:49:06 +08:00
|
|
|
|
2004-08-31 06:10:26 +08:00
|
|
|
/* For information look into the C source or the html documentation */
|
|
|
|
|
2004-08-31 06:49:06 +08:00
|
|
|
|
2004-08-31 06:10:26 +08:00
|
|
|
#define GIMP_TYPE_PREVIEW (gimp_preview_get_type ())
|
|
|
|
#define GIMP_PREVIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_PREVIEW, GimpPreview))
|
|
|
|
#define GIMP_PREVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_PREVIEW, GimpPreviewClass))
|
|
|
|
#define GIMP_IS_PREVIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_PREVIEW))
|
|
|
|
#define GIMP_IS_PREVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_PREVIEW))
|
|
|
|
#define GIMP_PREVIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_PREVIEW, GimpPreviewClass))
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _GimpPreviewClass GimpPreviewClass;
|
|
|
|
|
|
|
|
struct _GimpPreview
|
|
|
|
{
|
2011-07-28 01:53:34 +08:00
|
|
|
GtkBox parent_instance;
|
2004-08-31 06:10:26 +08:00
|
|
|
|
2004-09-01 22:01:10 +08:00
|
|
|
gboolean update_preview;
|
|
|
|
|
|
|
|
/*< protected >*/
|
|
|
|
GtkWidget *area;
|
2004-09-29 07:23:09 +08:00
|
|
|
GtkWidget *table;
|
2004-09-09 23:27:34 +08:00
|
|
|
GtkWidget *frame;
|
2004-09-01 22:01:10 +08:00
|
|
|
GtkWidget *toggle;
|
|
|
|
GdkCursor *cursor_busy;
|
2004-10-14 02:56:28 +08:00
|
|
|
GdkCursor *default_cursor;
|
2004-09-01 22:01:10 +08:00
|
|
|
|
|
|
|
/*< private >*/
|
2004-09-29 21:39:23 +08:00
|
|
|
gint xoff, yoff;
|
2004-08-31 06:10:26 +08:00
|
|
|
gint xmin, xmax, ymin, ymax;
|
|
|
|
gint width, height;
|
2004-09-01 22:01:10 +08:00
|
|
|
|
2004-09-01 07:37:04 +08:00
|
|
|
guint timeout_id;
|
2004-08-31 06:10:26 +08:00
|
|
|
};
|
2004-09-29 07:23:09 +08:00
|
|
|
|
2004-08-31 06:10:26 +08:00
|
|
|
struct _GimpPreviewClass
|
|
|
|
{
|
2011-07-28 01:53:34 +08:00
|
|
|
GtkBoxClass parent_class;
|
2004-08-31 06:10:26 +08:00
|
|
|
|
2007-01-12 07:41:45 +08:00
|
|
|
/* virtual methods */
|
2004-09-10 05:36:52 +08:00
|
|
|
void (* draw) (GimpPreview *preview);
|
2004-09-29 21:39:23 +08:00
|
|
|
void (* draw_thumb) (GimpPreview *preview,
|
|
|
|
GimpPreviewArea *area,
|
|
|
|
gint width,
|
|
|
|
gint height);
|
2004-09-29 23:33:02 +08:00
|
|
|
void (* draw_buffer) (GimpPreview *preview,
|
|
|
|
const guchar *buffer,
|
|
|
|
gint rowstride);
|
2004-09-29 07:23:09 +08:00
|
|
|
void (* set_cursor) (GimpPreview *preview);
|
2004-08-31 06:10:26 +08:00
|
|
|
|
|
|
|
/* signal */
|
2007-01-12 07:41:45 +08:00
|
|
|
void (* invalidated) (GimpPreview *preview);
|
|
|
|
|
|
|
|
/* virtual methods */
|
|
|
|
void (* transform) (GimpPreview *preview,
|
|
|
|
gint src_x,
|
|
|
|
gint src_y,
|
|
|
|
gint *dest_x,
|
|
|
|
gint *dest_y);
|
|
|
|
void (* untransform) (GimpPreview *preview,
|
|
|
|
gint src_x,
|
|
|
|
gint src_y,
|
|
|
|
gint *dest_x,
|
|
|
|
gint *dest_y);
|
2004-10-24 03:59:18 +08:00
|
|
|
|
|
|
|
/* Padding for future expansion */
|
|
|
|
void (* _gimp_reserved3) (void);
|
|
|
|
void (* _gimp_reserved4) (void);
|
2004-08-31 06:10:26 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2005-07-21 22:02:29 +08:00
|
|
|
GType gimp_preview_get_type (void) G_GNUC_CONST;
|
|
|
|
|
|
|
|
void gimp_preview_set_update (GimpPreview *preview,
|
|
|
|
gboolean update);
|
|
|
|
gboolean gimp_preview_get_update (GimpPreview *preview);
|
|
|
|
|
|
|
|
void gimp_preview_set_bounds (GimpPreview *preview,
|
|
|
|
gint xmin,
|
|
|
|
gint ymin,
|
|
|
|
gint xmax,
|
|
|
|
gint ymax);
|
|
|
|
|
|
|
|
void gimp_preview_get_position (GimpPreview *preview,
|
|
|
|
gint *x,
|
|
|
|
gint *y);
|
|
|
|
void gimp_preview_get_size (GimpPreview *preview,
|
|
|
|
gint *width,
|
|
|
|
gint *height);
|
|
|
|
|
2007-01-12 07:41:45 +08:00
|
|
|
void gimp_preview_transform (GimpPreview *preview,
|
|
|
|
gint src_x,
|
|
|
|
gint src_y,
|
|
|
|
gint *dest_x,
|
|
|
|
gint *dest_y);
|
|
|
|
void gimp_preview_untransform (GimpPreview *preview,
|
|
|
|
gint src_x,
|
|
|
|
gint src_y,
|
|
|
|
gint *dest_x,
|
|
|
|
gint *dest_y);
|
|
|
|
|
2005-07-21 22:02:29 +08:00
|
|
|
GtkWidget * gimp_preview_get_area (GimpPreview *preview);
|
|
|
|
|
|
|
|
void gimp_preview_draw (GimpPreview *preview);
|
|
|
|
void gimp_preview_draw_buffer (GimpPreview *preview,
|
|
|
|
const guchar *buffer,
|
|
|
|
gint rowstride);
|
|
|
|
|
|
|
|
void gimp_preview_invalidate (GimpPreview *preview);
|
|
|
|
|
2005-09-28 19:02:02 +08:00
|
|
|
void gimp_preview_set_default_cursor (GimpPreview *preview,
|
|
|
|
GdkCursor *cursor);
|
2004-08-31 06:10:26 +08:00
|
|
|
|
2005-09-28 19:02:02 +08:00
|
|
|
GtkWidget * gimp_preview_get_controls (GimpPreview *preview);
|
2005-09-28 10:46:06 +08:00
|
|
|
|
2004-08-31 22:29:25 +08:00
|
|
|
|
2004-08-31 06:10:26 +08:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __GIMP_PREVIEW_H__ */
|