Chopped up the display stuff (beware: unfinished)...
2001-10-31 Michael Natterer <mitch@gimp.org> Chopped up the display stuff (beware: unfinished)... The plan is that GimpDisplay is the object which collects updates from the image, compresses them and waits for the GIMP to be idle to actually paint them. It should be a non-GUI object which is the model for the actual widget to connect to. GimpDisplayShell has all the widgets and handles painting and exposing of the result. Nobody should actually be required to update ot look at it as it should be a view on the GimpDisplay object. Much stuff is still in the wrong place and the functions don't follow their files' filename namespace any more. More to come... * app/display/Makefile.am * app/display/gimpdisplay-ops.[ch]: removed. It's functions didn't belong together anyway. * app/display/gimpdisplay-area.[ch]: new files: the GimpArea functions. * app/display/gimpdisplay-handlers.[ch]: new files: signal handlers for GimpImage signals. Mostly from app/gui.c. * app/display/gimpdisplay.[ch]: removed all widgets and other GUI stuff. There is still much undecided here... * app/display/gimpdisplayshell.[ch]: actually use the object and filled it with all the stuff from GimpDisplay. * app/display/gimpdisplay-callbacks.[ch] * app/display/gimpdisplay-foreach.[ch] * app/display/gimpdisplay-render.c * app/display/gimpdisplay-scale.[ch] * app/display/gimpdisplay-scroll.[ch] * app/display/gimpdisplay-selection.c: changed accordingly. * app/core/gimp.[ch]: return a GimpObject from gimp_create_display() so it can be used as single GUI independent point to create displays, require the initial scale as parameter. * app/core/gimpcontext.c: changed the ugly EEKWrapper according to the GimpDisplay structure changes. Bugfix: set the image to NULL in gimp_context_display_destroyed(). * app/core/gimpedit.c * app/core/gimpimage-new.c: changed gimp_create_display() calls accordingly. * app/core/gimpimage-convert.c: invalidate the layer & image previews here, not in the caller. * app/core/gimpimage-crop.c: update the whole image after cropping. * app/core/gimpimage.[ch]: added gimp_image_find_guide(), gimp_image_snap_point() and gimp_image_snap_rectangle(). Added "resolution_changed" and "unit_changed" signals and corresp. public convenience functions to emit them. * app/core/gimplayer.c: emit the image's "alpha_changed" signal when adding alpha to the bottom (and only) layer of the image. * app/gimpprogress.c * app/image_map.c * app/nav_window.c * app/qmask.c * app/undo.c * app/user_install.c: changed accordingly. * app/gui/edit-commands.c * app/gui/file-commands.c * app/gui/file-open-dialog.c * app/gui/image-commands.c * app/gui/info-window.c * app/gui/preferences-dialog.c * app/gui/toolbox.c * app/gui/view-commands.c: ditto. * app/gui/gui.[ch]: removed most gimp->images handlers as the displays connect to them themselves now. chaged gui_display_new() according to the gimp_create_display() changes. Added gui_get_screen_resolution(). * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpbycolorselecttool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimpdrawtool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpfliptool.c * app/tools/gimpfreeselecttool.c * app/tools/gimpfuzzyselecttool.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/gimppathtool.c * app/tools/gimprectselecttool.c * app/tools/gimpselectiontool.c * app/tools/gimptexttool.c * app/tools/gimptool.c * app/tools/gimptransformtool.c * app/tools/xinput_airbrush.c: lots of changes because GimpDisplay has become two objects. Lots of gdisp->shell casting uglyness added. This is fine because exactly these parts will have to go away. (GimpDisplay will provide methods for XOR drawing upon the display in image coordinates without the need to transform coordinates all the time. Also the tools shouldn't see GdkEvents but get more useful virtual functions which speak in image coordinates too). * app/widgets/gimpcomponentlistitem.c: removed a now useless image update. * tools/pdbgen/pdb/display.pdb: use gimp_create_display(). * app/pdb/display_cmds.c: regenerated.
This commit is contained in:
committed by
Michael Natterer
parent
4158715b25
commit
5f63e079b8
@ -139,6 +139,8 @@ struct _GimpImageClass
|
||||
void (* component_active_changed) (GimpImage *gimage,
|
||||
ChannelType channel);
|
||||
void (* mask_changed) (GimpImage *gimage);
|
||||
void (* resolution_changed) (GimpImage *gimage);
|
||||
void (* unit_changed) (GimpImage *gimage);
|
||||
void (* selection_control) (GimpImage *gimage,
|
||||
GimpSelectionControl control);
|
||||
|
||||
@ -161,110 +163,125 @@ struct _GimpImageClass
|
||||
|
||||
/* function declarations */
|
||||
|
||||
GType gimp_image_get_type (void);
|
||||
GType gimp_image_get_type (void);
|
||||
|
||||
GimpImage * gimp_image_new (Gimp *gimp,
|
||||
gint width,
|
||||
gint height,
|
||||
GimpImageBaseType base_type);
|
||||
GimpImage * gimp_image_new (Gimp *gimp,
|
||||
gint width,
|
||||
gint height,
|
||||
GimpImageBaseType base_type);
|
||||
|
||||
gint gimp_image_get_ID (GimpImage *gimage);
|
||||
GimpImage * gimp_image_get_by_ID (Gimp *gimp,
|
||||
gint id);
|
||||
|
||||
gint gimp_image_get_ID (GimpImage *gimage);
|
||||
GimpImage * gimp_image_get_by_ID (Gimp *gimp,
|
||||
gint id);
|
||||
void gimp_image_set_filename (GimpImage *gimage,
|
||||
const gchar *filename);
|
||||
void gimp_image_set_resolution (GimpImage *gimage,
|
||||
gdouble xres,
|
||||
gdouble yres);
|
||||
void gimp_image_get_resolution (const GimpImage *gimage,
|
||||
gdouble *xresolution,
|
||||
gdouble *yresolution);
|
||||
void gimp_image_set_unit (GimpImage *gimage,
|
||||
GimpUnit unit);
|
||||
GimpUnit gimp_image_get_unit (const GimpImage *gimage);
|
||||
void gimp_image_set_save_proc (GimpImage *gimage,
|
||||
PlugInProcDef *proc);
|
||||
PlugInProcDef * gimp_image_get_save_proc (const GimpImage *gimage);
|
||||
gint gimp_image_get_width (const GimpImage *gimage);
|
||||
gint gimp_image_get_height (const GimpImage *gimage);
|
||||
void gimp_image_resize (GimpImage *gimage,
|
||||
gint new_width,
|
||||
gint new_height,
|
||||
gint offset_x,
|
||||
gint offset_y);
|
||||
void gimp_image_scale (GimpImage *gimage,
|
||||
gint new_width,
|
||||
gint new_height);
|
||||
gboolean gimp_image_check_scaling (const GimpImage *gimage,
|
||||
gint new_width,
|
||||
gint new_height);
|
||||
TileManager * gimp_image_shadow (GimpImage *gimage,
|
||||
gint width,
|
||||
gint height,
|
||||
gint bpp);
|
||||
void gimp_image_free_shadow (GimpImage *gimage);
|
||||
void gimp_image_apply_image (GimpImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
PixelRegion *src2PR,
|
||||
gboolean undo,
|
||||
gint opacity,
|
||||
LayerModeEffects mode,
|
||||
TileManager *src1_tiles,
|
||||
gint x,
|
||||
gint y);
|
||||
void gimp_image_replace_image (GimpImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
PixelRegion *src2PR,
|
||||
gboolean undo,
|
||||
gint opacity,
|
||||
PixelRegion *maskPR,
|
||||
gint x,
|
||||
gint y);
|
||||
void gimp_image_get_foreground (const GimpImage *gimage,
|
||||
const GimpDrawable *drawable,
|
||||
guchar *fg);
|
||||
void gimp_image_get_background (const GimpImage *gimage,
|
||||
const GimpDrawable *drawable,
|
||||
guchar *bg);
|
||||
guchar * gimp_image_get_color_at (GimpImage *gimage,
|
||||
gint x,
|
||||
gint y);
|
||||
void gimp_image_get_color (const GimpImage *gimage,
|
||||
GimpImageType d_type,
|
||||
guchar *rgb,
|
||||
guchar *src);
|
||||
void gimp_image_transform_color (const GimpImage *gimage,
|
||||
const GimpDrawable *drawable,
|
||||
guchar *src,
|
||||
guchar *dest,
|
||||
GimpImageBaseType type);
|
||||
GimpGuide * gimp_image_add_hguide (GimpImage *gimage);
|
||||
GimpGuide * gimp_image_add_vguide (GimpImage *gimage);
|
||||
void gimp_image_add_guide (GimpImage *gimage,
|
||||
GimpGuide *guide);
|
||||
void gimp_image_remove_guide (GimpImage *gimage,
|
||||
GimpGuide *guide);
|
||||
void gimp_image_delete_guide (GimpImage *gimage,
|
||||
GimpGuide *guide);
|
||||
GimpGuide * gimp_image_find_guide (GimpImage *gimage,
|
||||
gint x,
|
||||
gint y);
|
||||
gboolean gimp_image_snap_point (GimpImage *gimage,
|
||||
gint x,
|
||||
gint y,
|
||||
gint *tx,
|
||||
gint *ty);
|
||||
gboolean gimp_image_snap_rectangle (GimpImage *gimage,
|
||||
gint x1,
|
||||
gint y1,
|
||||
gint x2,
|
||||
gint y2,
|
||||
gint *tx1,
|
||||
gint *ty1);
|
||||
|
||||
void gimp_image_set_filename (GimpImage *gimage,
|
||||
const gchar *filename);
|
||||
void gimp_image_set_resolution (GimpImage *gimage,
|
||||
gdouble xres,
|
||||
gdouble yres);
|
||||
void gimp_image_get_resolution (const GimpImage *gimage,
|
||||
gdouble *xresolution,
|
||||
gdouble *yresolution);
|
||||
void gimp_image_set_unit (GimpImage *gimage,
|
||||
GimpUnit unit);
|
||||
GimpUnit gimp_image_get_unit (const GimpImage *gimage);
|
||||
void gimp_image_set_save_proc (GimpImage *gimage,
|
||||
PlugInProcDef *proc);
|
||||
PlugInProcDef * gimp_image_get_save_proc (const GimpImage *gimage);
|
||||
gint gimp_image_get_width (const GimpImage *gimage);
|
||||
gint gimp_image_get_height (const GimpImage *gimage);
|
||||
void gimp_image_resize (GimpImage *gimage,
|
||||
gint new_width,
|
||||
gint new_height,
|
||||
gint offset_x,
|
||||
gint offset_y);
|
||||
void gimp_image_scale (GimpImage *gimage,
|
||||
gint new_width,
|
||||
gint new_height);
|
||||
gboolean gimp_image_check_scaling (const GimpImage *gimage,
|
||||
gint new_width,
|
||||
gint new_height);
|
||||
TileManager * gimp_image_shadow (GimpImage *gimage,
|
||||
gint width,
|
||||
gint height,
|
||||
gint bpp);
|
||||
void gimp_image_free_shadow (GimpImage *gimage);
|
||||
void gimp_image_apply_image (GimpImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
PixelRegion *src2PR,
|
||||
gboolean undo,
|
||||
gint opacity,
|
||||
LayerModeEffects mode,
|
||||
TileManager *src1_tiles,
|
||||
gint x,
|
||||
gint y);
|
||||
void gimp_image_replace_image (GimpImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
PixelRegion *src2PR,
|
||||
gboolean undo,
|
||||
gint opacity,
|
||||
PixelRegion *maskPR,
|
||||
gint x,
|
||||
gint y);
|
||||
void gimp_image_get_foreground (const GimpImage *gimage,
|
||||
const GimpDrawable *drawable,
|
||||
guchar *fg);
|
||||
void gimp_image_get_background (const GimpImage *gimage,
|
||||
const GimpDrawable *drawable,
|
||||
guchar *bg);
|
||||
guchar * gimp_image_get_color_at (GimpImage *gimage,
|
||||
gint x,
|
||||
gint y);
|
||||
void gimp_image_get_color (const GimpImage *gimage,
|
||||
GimpImageType d_type,
|
||||
guchar *rgb,
|
||||
guchar *src);
|
||||
void gimp_image_transform_color (const GimpImage *gimage,
|
||||
const GimpDrawable *drawable,
|
||||
guchar *src,
|
||||
guchar *dest,
|
||||
GimpImageBaseType type);
|
||||
GimpGuide * gimp_image_add_hguide (GimpImage *gimage);
|
||||
GimpGuide * gimp_image_add_vguide (GimpImage *gimage);
|
||||
void gimp_image_add_guide (GimpImage *gimage,
|
||||
GimpGuide *guide);
|
||||
void gimp_image_remove_guide (GimpImage *gimage,
|
||||
GimpGuide *guide);
|
||||
void gimp_image_delete_guide (GimpImage *gimage,
|
||||
GimpGuide *guide);
|
||||
GimpParasite * gimp_image_parasite_find (const GimpImage *gimage,
|
||||
const gchar *name);
|
||||
gchar ** gimp_image_parasite_list (const GimpImage *gimage,
|
||||
gint *count);
|
||||
void gimp_image_parasite_attach (GimpImage *gimage,
|
||||
GimpParasite *parasite);
|
||||
void gimp_image_parasite_detach (GimpImage *gimage,
|
||||
const gchar *parasite);
|
||||
|
||||
GimpParasite * gimp_image_parasite_find (const GimpImage *gimage,
|
||||
const gchar *name);
|
||||
gchar ** gimp_image_parasite_list (const GimpImage *gimage,
|
||||
gint *count);
|
||||
void gimp_image_parasite_attach (GimpImage *gimage,
|
||||
GimpParasite *parasite);
|
||||
void gimp_image_parasite_detach (GimpImage *gimage,
|
||||
const gchar *parasite);
|
||||
GimpTattoo gimp_image_get_new_tattoo (GimpImage *gimage);
|
||||
gboolean gimp_image_set_tattoo_state (GimpImage *gimage,
|
||||
GimpTattoo val);
|
||||
GimpTattoo gimp_image_get_tattoo_state (GimpImage *gimage);
|
||||
|
||||
GimpTattoo gimp_image_get_new_tattoo (GimpImage *gimage);
|
||||
gboolean gimp_image_set_tattoo_state (GimpImage *gimage,
|
||||
GimpTattoo val);
|
||||
GimpTattoo gimp_image_get_tattoo_state (GimpImage *gimage);
|
||||
|
||||
void gimp_image_set_paths (GimpImage *gimage,
|
||||
PathList *paths);
|
||||
PathList * gimp_image_get_paths (const GimpImage *gimage);
|
||||
void gimp_image_set_paths (GimpImage *gimage,
|
||||
PathList *paths);
|
||||
PathList * gimp_image_get_paths (const GimpImage *gimage);
|
||||
|
||||
/* Temporary hack till colormap manipulation is encapsulated in functions.
|
||||
* Call this whenever you modify an image's colormap. The col argument
|
||||
@ -272,20 +289,22 @@ PathList * gimp_image_get_paths (const GimpImage *gimage);
|
||||
* Currently, use this also when the image's base type is changed to/from
|
||||
* indexed.
|
||||
*/
|
||||
void gimp_image_colormap_changed (GimpImage *gimage,
|
||||
gint col);
|
||||
void gimp_image_colormap_changed (GimpImage *gimage,
|
||||
gint col);
|
||||
|
||||
void gimp_image_mode_changed (GimpImage *gimage);
|
||||
void gimp_image_alpha_changed (GimpImage *gimage);
|
||||
void gimp_image_floating_selection_changed (GimpImage *gimage);
|
||||
void gimp_image_mask_changed (GimpImage *gimage);
|
||||
void gimp_image_update (GimpImage *gimage,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
void gimp_image_selection_control (GimpImage *gimage,
|
||||
GimpSelectionControl control);
|
||||
void gimp_image_mode_changed (GimpImage *gimage);
|
||||
void gimp_image_alpha_changed (GimpImage *gimage);
|
||||
void gimp_image_floating_selection_changed (GimpImage *gimage);
|
||||
void gimp_image_mask_changed (GimpImage *gimage);
|
||||
void gimp_image_resolution_changed (GimpImage *gimage);
|
||||
void gimp_image_unit_changed (GimpImage *gimage);
|
||||
void gimp_image_update (GimpImage *gimage,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
void gimp_image_selection_control (GimpImage *gimage,
|
||||
GimpSelectionControl control);
|
||||
|
||||
|
||||
/* layer/channel functions */
|
||||
|
||||
Reference in New Issue
Block a user