2001-02-05 06:10:54 +08:00
|
|
|
/* The GIMP -- an image manipulation program
|
|
|
|
* Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
2001-04-22 08:38:56 +08:00
|
|
|
* gimpviewable.h
|
|
|
|
* Copyright (C) 2001 Michael Natterer <mitch@gimp.org>
|
|
|
|
*
|
2001-02-05 06:10:54 +08:00
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program 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 General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __GIMP_VIEWABLE_H__
|
|
|
|
#define __GIMP_VIEWABLE_H__
|
|
|
|
|
|
|
|
|
|
|
|
#include "gimpobject.h"
|
|
|
|
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
#include <gdk-pixbuf/gdk-pixbuf.h>
|
|
|
|
|
2001-02-05 06:10:54 +08:00
|
|
|
|
2003-04-01 21:53:47 +08:00
|
|
|
#define GIMP_VIEWABLE_MAX_PREVIEW_SIZE 1024
|
2003-10-09 20:26:46 +08:00
|
|
|
#define GIMP_VIEWABLE_MAX_POPUP_SIZE 256
|
|
|
|
#define GIMP_VIEWABLE_MAX_BUTTON_SIZE 64
|
|
|
|
#define GIMP_VIEWABLE_MAX_MENU_SIZE 48
|
2003-02-27 21:59:41 +08:00
|
|
|
|
|
|
|
|
2001-02-05 06:10:54 +08:00
|
|
|
#define GIMP_TYPE_VIEWABLE (gimp_viewable_get_type ())
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
#define GIMP_VIEWABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_VIEWABLE, GimpViewable))
|
|
|
|
#define GIMP_VIEWABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_VIEWABLE, GimpViewableClass))
|
|
|
|
#define GIMP_IS_VIEWABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_VIEWABLE))
|
|
|
|
#define GIMP_IS_VIEWABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_VIEWABLE))
|
2001-08-07 20:42:23 +08:00
|
|
|
#define GIMP_VIEWABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_VIEWABLE, GimpViewableClass))
|
2001-02-05 06:10:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
typedef struct _GimpViewableClass GimpViewableClass;
|
|
|
|
|
|
|
|
struct _GimpViewable
|
|
|
|
{
|
|
|
|
GimpObject parent_instance;
|
2003-02-27 00:15:50 +08:00
|
|
|
|
2003-02-27 02:08:26 +08:00
|
|
|
/*< private >*/
|
2003-02-27 00:15:50 +08:00
|
|
|
gchar *stock_id;
|
2001-02-05 06:10:54 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _GimpViewableClass
|
|
|
|
{
|
|
|
|
GimpObjectClass parent_class;
|
|
|
|
|
2003-02-27 02:08:26 +08:00
|
|
|
const gchar *default_stock_id;
|
2002-04-29 07:10:42 +08:00
|
|
|
const gchar *name_changed_signal;
|
|
|
|
|
2001-08-07 20:42:23 +08:00
|
|
|
/* signals */
|
2004-05-13 20:15:10 +08:00
|
|
|
void (* invalidate_preview) (GimpViewable *viewable);
|
|
|
|
void (* size_changed) (GimpViewable *viewable);
|
2001-06-18 21:10:03 +08:00
|
|
|
|
2001-08-07 20:42:23 +08:00
|
|
|
/* virtual functions */
|
2004-05-13 20:15:10 +08:00
|
|
|
void (* get_preview_size) (GimpViewable *viewable,
|
|
|
|
gint size,
|
|
|
|
gboolean is_popup,
|
|
|
|
gboolean dot_for_dot,
|
|
|
|
gint *width,
|
|
|
|
gint *height);
|
|
|
|
gboolean (* get_popup_size) (GimpViewable *viewable,
|
|
|
|
gint width,
|
|
|
|
gint height,
|
|
|
|
gboolean dot_for_dot,
|
|
|
|
gint *popup_width,
|
|
|
|
gint *popup_height);
|
|
|
|
TempBuf * (* get_preview) (GimpViewable *viewable,
|
|
|
|
gint width,
|
|
|
|
gint height);
|
|
|
|
TempBuf * (* get_new_preview) (GimpViewable *viewable,
|
|
|
|
gint width,
|
|
|
|
gint height);
|
|
|
|
GdkPixbuf * (* get_pixbuf) (GimpViewable *viewable,
|
|
|
|
gint width,
|
|
|
|
gint height);
|
|
|
|
GdkPixbuf * (* get_new_pixbuf) (GimpViewable *viewable,
|
|
|
|
gint width,
|
|
|
|
gint height);
|
|
|
|
gchar * (* get_description) (GimpViewable *viewable,
|
|
|
|
gchar **tooltip);
|
2001-02-05 06:10:54 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2004-05-13 20:15:10 +08:00
|
|
|
GType gimp_viewable_get_type (void) G_GNUC_CONST;
|
|
|
|
|
|
|
|
void gimp_viewable_invalidate_preview (GimpViewable *viewable);
|
|
|
|
void gimp_viewable_size_changed (GimpViewable *viewable);
|
|
|
|
|
|
|
|
void gimp_viewable_calc_preview_size (gint aspect_width,
|
|
|
|
gint aspect_height,
|
|
|
|
gint width,
|
|
|
|
gint height,
|
|
|
|
gboolean dot_for_dot,
|
|
|
|
gdouble xresolution,
|
|
|
|
gdouble yresolution,
|
|
|
|
gint *return_width,
|
|
|
|
gint *return_height,
|
|
|
|
gboolean *scaling_up);
|
|
|
|
|
|
|
|
void gimp_viewable_get_preview_size (GimpViewable *viewable,
|
|
|
|
gint size,
|
|
|
|
gboolean popup,
|
|
|
|
gboolean dot_for_dot,
|
|
|
|
gint *width,
|
|
|
|
gint *height);
|
|
|
|
gboolean gimp_viewable_get_popup_size (GimpViewable *viewable,
|
|
|
|
gint width,
|
|
|
|
gint height,
|
|
|
|
gboolean dot_for_dot,
|
|
|
|
gint *popup_width,
|
|
|
|
gint *popup_height);
|
|
|
|
|
|
|
|
TempBuf * gimp_viewable_get_preview (GimpViewable *viewable,
|
|
|
|
gint width,
|
|
|
|
gint height);
|
|
|
|
TempBuf * gimp_viewable_get_new_preview (GimpViewable *viewable,
|
|
|
|
gint width,
|
|
|
|
gint height);
|
|
|
|
|
2004-07-15 17:53:17 +08:00
|
|
|
TempBuf * gimp_viewable_get_dummy_preview (GimpViewable *viewable,
|
2004-05-13 20:15:10 +08:00
|
|
|
gint width,
|
|
|
|
gint height,
|
|
|
|
gint bpp);
|
|
|
|
|
|
|
|
GdkPixbuf * gimp_viewable_get_pixbuf (GimpViewable *viewable,
|
|
|
|
gint width,
|
|
|
|
gint height);
|
|
|
|
GdkPixbuf * gimp_viewable_get_new_pixbuf (GimpViewable *viewable,
|
|
|
|
gint width,
|
|
|
|
gint height);
|
|
|
|
|
|
|
|
GdkPixbuf * gimp_viewable_get_dummy_pixbuf (GimpViewable *viewable,
|
|
|
|
gint width,
|
|
|
|
gint height,
|
|
|
|
gint bpp);
|
|
|
|
|
|
|
|
gchar * gimp_viewable_get_description (GimpViewable *viewable,
|
|
|
|
gchar **tooltip);
|
|
|
|
|
|
|
|
const gchar * gimp_viewable_get_stock_id (GimpViewable *viewable);
|
|
|
|
void gimp_viewable_set_stock_id (GimpViewable *viewable,
|
|
|
|
const gchar *stock_id);
|
2001-02-05 06:10:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
#endif /* __GIMP_VIEWABLE_H__ */
|