gimp/app/core/gimpprojection.h

120 lines
4.6 KiB
C
Raw Normal View History

/* GIMP - The GNU Image Manipulation Program
1997-11-25 06:05:25 +08:00
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* 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.
1997-11-25 06:05:25 +08:00
*/
app/Makefile.am app/channel_pvt.h app/drawable_pvt.h app/gdisplayF.h 2000-12-29 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/channel_pvt.h * app/drawable_pvt.h * app/gdisplayF.h * app/gimpdrawableP.h * app/gimpimageP.h * app/layer_pvt.h * app/toolsF.h: removed these files. * app/apptypes.h * tools/pdbgen/enums.pl: added tons of opaque typedefs and enums. * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/convert.pdb * tools/pdbgen/pdb/display.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/help.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/patterns.pdb * tools/pdbgen/pdb/selection.pdb * tools/pdbgen/pdb/tools.pdb * app/*: chainsaw #include cleanup: - Never (never!!) include stuff in header files except where we need access to structures' contents (like derived objects). - Added prototypes and proper formating in many files. - The #include order in *all* *.c files is as follows: #include "config.h" #include <system stuff> #include <gtk/gtk.h> #include "apptypes.h" #include "gimp stuff" #include "libgimp stuff" #include "libgimp/gimpintl.h" By following this scheme we can easily see a file's dependencies from it's #include's and can grep for the inclusion to find out where a file is used. * tools/pdbgen/app.pl: changed to follow the include scheme above. * libgimp/Makefile.am * libgimp/gimpuitypes.h: new file, included from libgimp/gimpui.h and from app/apptypes.h. * libgimp/gimpcolorbutton.[ch] * libgimp/gimpdialog.[ch] * libgimp/gimphelpui.[ch] * libgimp/gimpparasite.[ch] * libgimp/gimppatheditor.[ch] * libgimp/gimpprotocol.c * libgimp/gimpquerybox.[ch] * libgimp/gimpsizeentry.[ch] * libgimp/gimptypes.h * libgimp/gimpui.h * libgimp/gimpunit.h * libgimp/gimpunitmenu.[ch] * libgimp/gimpwidgets.[ch]: changed accordingly. * plug-ins/FractalExplorer/Dialogs.c * plug-ins/gdyntext/message_window.c * plug-ins/imagemap/imap_default_dialog.c * plug-ins/imagemap/imap_file.c: these files used to include "libgimp/gimpui.h" without including "libgimp/gimp.h". This is no longer possible because the libgimpui headers don't inlcude "libgimp/gimpunit.h" any more.
2000-12-29 23:22:01 +08:00
2004-07-14 00:36:29 +08:00
#ifndef __GIMP_PROJECTION_H__
#define __GIMP_PROJECTION_H__
1997-11-25 06:05:25 +08:00
2004-07-14 00:36:29 +08:00
#include "gimpobject.h"
added app/display/ and app/plug-in/. Empty for now except for the types 2001-08-17 Michael Natterer <mitch@gimp.org> * configure.in: added app/display/ and app/plug-in/. Empty for now except for the types files. * app/Makefile.am * app/appenums.h * app/apptypes.h: removed. * app/display/Makefile.am * app/display/display-types.h * app/plug-in/Makefile.am * app/plug-in/plug-in-types.h * app/gui/Makefile.am * app/gui/gui-types.h * app/pdb/Makefile.am * app/pdb/pdb-types.h: new files for typedefs. * app/appenv.h: added MessageHandlerType and StackTraceMode here. * app/undo_types.h: moved undo struct typedefs here. * app/tools/tools-types.h * app/core/core-types.h: added some enums and Tattoo here (renamed to GimpTattoo). * app/gdisplay.h: temp_hack: #include "display/display-types.h" * app/gimphelp.c: s/gtk_idle_add/g_idle_add/ * app/gimprc.c: don't use "gimprc" in token handlers but the passed "val1p" and "val2p". * app/image_map.[ch]: cleanup in preparation of making a GObject out of it. * app/base/pixel-region.[ch]: no need to pass the PixelRegionIterator around as void pointer. * app/core/gimp.[ch] * app/core/gimpcontext.[ch] * app/core/gimptoolinfo.[ch] * app/tools/tool_manager.c * app/widgets/gimpdnd.c: added the standard_tool_info to the Gimp object. * app/batch.c * app/file-open.c * app/file-save.c * app/file-utils.c * app/interface.c * app/main.c * app/path.[ch] * app/pathP.h * app/plug_in.h * app/core/gimpdrawable.[ch] * app/core/gimpimage-mask.c * app/core/gimpimage.[ch] * app/core/gimplayer.c * app/gui/color-area.c * app/gui/color-notebook.c * app/gui/colormap-dialog.c * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.c * app/gui/error-console-dialog.c * app/gui/gradient-editor.c * app/gui/gradient-select.c * app/gui/indicator-area.c * app/gui/info-dialog.c * app/gui/palette-editor.c * app/gui/palette-select.c * app/gui/pattern-select.c * app/gui/session.c * app/gui/splash.c * app/gui/view-commands.c * app/tools/gimpinktool-blob.c * app/widgets/gimpcolorpanel.c * app/widgets/gimpdockbook.c * app/widgets/gimppreview.c * app/xcf/xcf-load.c * app/xcf/xcf-save.c * app/xcf/xcf.c: changed accordingly: s/Tattoo/GimpTattoo/, include the new types files, include <glib-object.h> instead of >gtk/gtk.h>. Bad hacks to get rid of SELECTION_OFF and friends in core/ (will be replaced ba a signal soon). * tools/pdbgen/Makefile.am: changed list of headers scanned for enums accordingly. * app/pdb/procedural_db.c * tools/pdbgen/app.pl * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/display.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/pattern_select.pdb: same fixes as above, added hacks to ensure that all foo-types.h files are included before all other gimp internal includes, include "pdb-types.h" unconditionally. * tools/pdbgen/enums.pl * app/pdb/*_cmds.c: regenerated.
2001-08-17 22:27:31 +08:00
app/Makefile.am removed. Stuff now lives in app_procs.[ch] and in 2001-05-13 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/cursorutil.[ch]: removed. Stuff now lives in app_procs.[ch] and in widgets/gimpcursor.[ch] * app/appenv.h: added the "gimp_busy" boolean. * app/app_procs.[ch]: added the "busy" stuff here. * app/gui/gui.[ch]: "busy" stuff for the gui. * app/widgets/Makefile.am * app/widgets/gimpcursor.[ch]: exports only one function: gimp_cursor_new() which returns a GdkCursor which has to be destroyed. * app/apptypes.h * app/appenums.h: removed the cursor types. * app/widgets/widgets-types.h: added here. * app/tools/gimpeditselectiontool.[ch]: added gtkutil_compress_motion() here (will go to some utils file in widgets/). * app/tools/tools-types.h: #include "widgets/widgets-types.h" * app/dialog_handler.c * app/disp_callbacks.c * app/gdisplay.[ch] * app/nav_window.c * app/scroll.c * app/xcf.c * app/core/gimpimage-convert.c * app/core/gimpimage-duplicate.c * app/core/gimpimage.c * app/gui/file-open-dialog.c * app/tools/gimpblendtool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpcroptool.c * app/tools/gimpfuzzyselecttool.c * app/tools/gimptransformtool.c * tools/pdbgen/pdb/image.pdb * app/pdb/image_cmds.c: use the new cursor and "busy" functions. * app/gdisplay.h * app/core/gimpbrush.c: added some ugly cross-includes. * app/context_manager.c * app/gdisplay_ops.c * app/gimprc.c * app/core/gimpdrawable-offset.c * app/gui/file-save-dialog.c * app/gui/gradient-editor.c * app/gui/preferences-dialog.c * app/tools/gimpbezierselecttool.c * app/tools/gimpbycolorselecttool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorpickertool.c * app/tools/gimperasertool.c * app/tools/gimpfliptool.c * app/tools/gimpinktool.c * app/tools/gimpiscissorstool.c * app/tools/gimpmagnifytool.c * app/tools/gimpmeasuretool.c * app/tools/gimpmovetool.c * app/tools/gimppainttool.c * app/tools/gimprectselecttool.c * app/tools/gimprotatetool.c * app/tools/gimpselectiontool.c: removed inclusion of "cursorutil.h"
2001-05-14 05:51:20 +08:00
typedef struct _GimpProjectionIdleRender GimpProjectionIdleRender;
struct _GimpProjectionIdleRender
{
Michael Natterer <mitch@gimp.org> 2001-12-03 Sven Neumann <sven@gimp.org> Michael Natterer <mitch@gimp.org> * app/paint-funcs/paint-funcs-mmx.h: removed redefiniton of HAS_ALPHA macro. * app/core/gimp.c: reverted Daniel's change; it doesn't make the code simpler, only more error-prone. * app/gui/info-dialog.h * app/gui/resize-dialog.h * app/core/gimp.h * app/core/gimpbrushgenerated.h * app/core/gimpbrushpipe.h * app/core/gimpchannel.[ch] * app/core/gimpcontainer.h * app/core/gimpcoreconfig.h * app/core/gimpdata.h * app/core/gimpdatafactory.[ch] * app/core/gimpdrawable-blend.c * app/core/gimpdrawable.[ch] * app/core/gimpimage.h * app/core/gimpimagefile.h * app/core/gimplayer.h * app/core/gimplayermask.h * app/core/gimpmoduleinfo.h * app/core/gimppalette.h * app/core/gimpundo.h * app/widgets/gimpbrushfactoryview.h * app/widgets/gimpconstrainedhwrapbox.h * app/widgets/gimpcontainermenu.h * app/widgets/gimpcontainerview.h * app/widgets/gimpdialogfactory.h * app/widgets/gimpimagedock.h * app/widgets/gimplistitem.h * app/widgets/gimpmenuitem.h * app/widgets/gimpnavigationpreview.h * app/widgets/gimppreview.h * app/gimprc.h * app/pathP.h * app/tools/gimpbezierselecttool.h * app/tools/gimpcolorbalancetool.h * app/tools/gimpcurvestool.h * app/tools/gimpdodgeburntool.c * app/tools/gimpfreeselecttool.h * app/tools/gimphuesaturationtool.h * app/tools/gimpinktool-blob.h * app/tools/gimpinktool.h * app/tools/gimpiscissorstool.h * app/tools/gimpmagnifytool.h * app/tools/gimpmeasuretool.h * app/tools/gimppainttool.h * app/tools/gimppathtool.h * app/tools/gimprectselecttool.h * app/tools/gimpthresholdtool.h * app/tools/gimptool.h * app/tools/gimptransformtool.h * app/base/base-config.h * app/base/gimplut.[ch] * app/base/pixel-region.h * app/base/pixel-surround.[ch] * app/base/temp-buf.[ch] * app/base/tile-manager-private.h * app/base/tile-manager.[ch] * app/base/tile-private.h * app/base/tile.[ch] * app/display/gimpdisplay.h * app/display/gimpdisplayshell-selection.h * app/display/gimpdisplayshell.h * app/gui/brush-select.h * app/gui/gradient-editor.h * app/gui/gradient-select.h: reverted most of Daniel's changes. There's no reason to use unsigned integers here and in lots of places it is even wrong. Then it's way too early to convert gbooleans into bitfields. This change may make sense in a few places but can happen later when the API has settled and the code is more stable. * app/gimprc.c: reverted Daniel's change. This is a GCC-ism and this code is about to die soon anyway.
2001-12-03 21:44:59 +08:00
gint width;
gint height;
gint x;
gint y;
gint base_x;
gint base_y;
guint idle_id;
GSList *update_areas; /* flushed update areas */
};
2004-07-14 00:36:29 +08:00
#define GIMP_TYPE_PROJECTION (gimp_projection_get_type ())
#define GIMP_PROJECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_PROJECTION, GimpProjection))
#define GIMP_PROJECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_PROJECTION, GimpProjectionClass))
#define GIMP_IS_PROJECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_PROJECTION))
#define GIMP_IS_PROJECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_PROJECTION))
#define GIMP_PROJECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_PROJECTION, GimpProjectionClass))
#define PYRAMID_MAX_LEVELS 10
#define PYRAMID_BASE_LEVEL 0
2004-07-14 00:36:29 +08:00
typedef struct _GimpProjectionClass GimpProjectionClass;
2004-07-14 00:36:29 +08:00
struct _GimpProjection
1997-11-25 06:05:25 +08:00
{
GimpObject parent_instance;
GimpImage *image;
2001-11-01 05:20:09 +08:00
GimpImageType type;
gint bytes;
/* An image pyramid. Level n + 1 has half the width and height of level n. */
TileManager *pyramid[PYRAMID_MAX_LEVELS];
gint top_level;
2001-11-01 05:20:09 +08:00
GSList *update_areas;
GimpProjectionIdleRender idle_render;
2001-11-01 05:20:09 +08:00
gboolean construct_flag;
1997-11-25 06:05:25 +08:00
};
2004-07-14 00:36:29 +08:00
struct _GimpProjectionClass
{
GimpObjectClass parent_class;
1997-11-25 06:05:25 +08:00
void (* update) (GimpProjection *image,
2004-07-14 00:36:29 +08:00
gboolean now,
gint x,
gint y,
gint width,
gint height);
};
1997-11-25 06:05:25 +08:00
2001-11-01 05:20:09 +08:00
GType gimp_projection_get_type (void) G_GNUC_CONST;
2001-11-01 05:20:09 +08:00
GimpProjection * gimp_projection_new (GimpImage *image);
2001-11-01 05:20:09 +08:00
TileManager * gimp_projection_get_tiles (GimpProjection *proj);
TileManager * gimp_projection_get_tiles_at_level
(GimpProjection *proj,
gint level);
void gimp_projection_level_size_from_scale
(GimpProjection *proj,
gdouble scalex,
gint *level,
gint *width,
gint *height);
gint gimp_projection_scale_to_level (GimpProjection *proj,
gdouble scalex);
GimpImage * gimp_projection_get_image (const GimpProjection *proj);
GimpImageType gimp_projection_get_image_type (const GimpProjection *proj);
gint gimp_projection_get_bytes (const GimpProjection *proj);
gdouble gimp_projection_get_opacity (const GimpProjection *proj);
void gimp_projection_flush (GimpProjection *proj);
void gimp_projection_flush_now (GimpProjection *proj);
void gimp_projection_finish_draw (GimpProjection *proj);
gint64 gimp_projection_estimate_memsize (GimpImageBaseType type,
gint width,
gint height);
2004-07-14 00:36:29 +08:00
#endif /* __GIMP_PROJECTION_H__ */