Commit Graph

175 Commits

Author SHA1 Message Date
Michael Natterer e4532fe2a8 app: call gimp_canvas_item_begin,end_change() around passe partout changes
Also remove the "highlight" member from the GimpDisplayShell struct.
2010-11-12 20:18:03 +01:00
Michael Natterer 458230bf8d app: use a GimpCanvasPassePartout for drawing the crop highlight
and remove all old drawing logic.
2010-11-12 19:47:51 +01:00
Michael Natterer b2a2e3200e app: derive GimpDisplayShell from GtkBox instead of GtkVBox
and avoid gtk_container_add() on boxes in some more plavces.
2010-10-30 15:12:20 +02:00
Michael Natterer 5b64b83569 app: introduce enum GimpHandleAnchor as replacement for GtkAnchorType
because the latter is gone in GTK+ 3.0
2010-10-18 12:50:17 +02:00
Michael Natterer 55f01bf6f3 app: remove gimp_display_shell_draw_vectors()
which is the last bit of non-item drawing of stuff that is not
somehow the image itself... wheee!

This involves reverting commit
6bce0641d4 and adding back all the
vectors handlers that were in gimpdisplayshell-callbacks.c before.
Change the callbacks to manage proxy items for all the image's
vectors.
2010-10-08 01:03:56 +02:00
Michael Natterer 3e69ae0039 app: add a layer boundary canvas item class
and use it to draw the layer boundary. Remove a lot of stuff
that was there only to draw the boundary before:

- remvoe all layer boundary stuff from the selection code
- remove gimp_display_shell_draw_layer()
- remove enum values GIMP_SELECTION_LAYER_ON,OFF from core-enums.h
- remove all lines calling gimp_image_selection_control() with
  the removed enum values
- remove gimp_layer_boundary()
2010-10-03 00:28:40 +02:00
Michael Natterer 1d45f6295e app: add a software cursor canvas item
and use it to draw the sw cursor. Almost every aspect of the old code
was ugly and hard to read, this is so much nicer...
2010-10-02 21:56:36 +02:00
Michael Natterer 502d7c815b app: add a canvas grid item class and use it to draw the grid
Remove gimp_display_shell_draw_grid().
2010-10-02 20:57:40 +02:00
Michael Natterer 3b4f2ec94c app: add a GimpCanvasProxyGroup that will be used for guides 2010-10-01 10:33:39 +02:00
Michael Natterer 75b4c8096f app: add a proxy group which will keep sample point canvas items 2010-10-01 09:27:57 +02:00
Michael Natterer 7edfa2ca54 app: start an infrastructure where the shell keeps around its canvas items
- Invalidate the proper area when an item gets added or removed.
- Draw the kept canvas items instead of calling a draw tool function.
- The draw tool now sets its item on the shell.
2010-09-29 22:12:01 +02:00
Sven Neumann 2ef259cd20 app: use GimpRGB as mask color
Instead of passing GimpChannelType as mask color to
gimp_display_shell_set_mask(), change that function to accept a
GimpRGB color.

Adapt GimpForegroundSelectTool, the only user of the display mask
feature, to this change.
2010-09-29 20:35:00 +02:00
Sven Neumann a7413bd784 app/display: implement drawing of selection mask
Use cairo_mask_surface() to render the selection mask (as used by
the foreground selection tool).
2010-09-29 20:35:00 +02:00
Sven Neumann ccee0ec41a app/display: let cairo render the checkerboard
Instead of blending the scaled image data onto the checkerboard and
then painting this image to the screen, render the image data into
an ARGB cairo image surface. Then paint a checkerboard on the canvas
and the image on top of it.
2010-09-29 20:34:59 +02:00
Michael Natterer 6bce0641d4 app: add signal GimpImage::update_vectors() and have the image manage updates
...just as we do for drawables. Connect to adding, removing, modifying
and toggling visibility of all vectors and emit "update-vectors"
accordingly. Add an update-vectors signal handler to GimpDisplayShell
and remove all other vectors handlers.
2010-09-17 11:31:57 +02:00
Michael Natterer f0c40d3717 app: port GimpDisplayShell image drawing to cairo 2010-08-27 23:15:25 +02:00
Michael Natterer 18d3882c5c app: port GimpDisplayShell pen drawing to cairo 2010-08-23 21:59:27 +02:00
Michael Natterer 529ce40a5d app: port GimpDisplayShell grid drawing to cairo 2010-08-11 13:16:55 +02:00
Martin Nordholts 7e3898da09 app/tests: Add keyboard zoom focus regression test
Add keyboard zoom focus regression test. We also need a new display
shell utility function
gimp_display_shell_push_zoom_focus_pointer_pos() for that.
2010-06-18 20:57:59 +02:00
Michael Natterer 84d33e4316 app: make image-coords overlay widgets work fine at any zoom factor
Add anchor and spacing parameters to the shell overlay API, so
overlays can be positioned on each side of a point in image space,
with configurable spacing in display space.
2010-02-28 14:48:47 +01:00
Michael Natterer ff01c2d77e app: add API to move an existing image-coords overlay around 2010-02-26 01:27:04 +01:00
Michael Natterer 9b75184442 app: add API to add overlays in image coordinates
and update their positions when the shell scrolls and zooms.
2010-02-20 15:15:53 +01:00
Michael Natterer b6ce5d075d Remove macros SCREEN_XRES() and SCREEN_YRES()
and add gimp_display_shell_get_screen_resolution() instead. The times
when these macros were used in inner loops have long passed.
2010-02-03 19:50:46 +01:00
Michael Natterer 94dcbe0e2e Add new function gimp_display_shell_present()
Not only presents the shell's toplevel, but also makes it the active
shell in the image window.
2009-10-04 19:24:55 +02:00
Michael Natterer dee0afed79 Move the statusbar back to GimpDisplayShell
Keeping it in GimpImageWindow was a bad idea because
- it wasted space
- it produced evil code because
- it conceptually didn't belong there
2009-10-04 15:33:03 +02:00
Michael Natterer 750c11f001 Move the display render buf size #defines to gimpdisplayshell-render.h 2009-10-03 00:15:04 +02:00
Michael Natterer cbc4013412 Reindent prototypes 2009-10-03 00:06:44 +02:00
Michael Natterer f6fd3aed51 Move GimpDisplayShell's expose functions to separate files 2009-10-02 23:55:26 +02:00
Michael Natterer 59274856ad Derive GimpDisplayShell from GtkVBox instead of GimpImageWindow
...and pack the widget into a separately created GimpImageWindow.
2009-09-29 20:56:14 +02:00
Michael Natterer 97987aff6e Add gimp_display_shell_get_window() which returns an image window or NULL 2009-09-28 23:53:05 +02:00
Michael Natterer 5b5e4e039a Add gimp_image_window_add_display() and use it
This API is most likely not final, but enables adding the vbox of
shell widgets to the image window's vbox *after* the shell constructor
returns. Seems to work nicely :-)
2009-09-28 22:55:51 +02:00
Michael Natterer 32783d7228 Move shrink_wrap() from the display to the window
Also fix all callers. This clearly needs more cleanup.
2009-09-28 22:55:50 +02:00
Michael Natterer 8c2934f626 Remove dead and forgotten declaration of gimp_display_shell_update_icon() 2009-09-28 22:55:50 +02:00
Michael Natterer 8b5a692099 Remove display_factory member from GimpDisplayShell 2009-09-28 22:55:45 +02:00
Michael Natterer 1bbcd8f7b5 Add "icon" property to GimpDisplayShell
Set it instead of setting the window icon and connect GimpImageWindow
to the notification.
2009-09-28 22:55:40 +02:00
Michael Natterer 660c333b55 Add "title" and "status" properties to GimpSisplayShell
Set the properties when updating title and status. In GimpImageWindow,
connect to notifications of the properties to update window title and
statusbar.
2009-09-28 22:55:39 +02:00
Michael Natterer 10b98034d4 Move the statusbar to GimpImageWindow
As with the menubar, port some code properly, and add some
horrible /* FIXME image window */ hacks to make it work.
2009-09-28 22:55:38 +02:00
Michael Natterer 6793d68769 Move the menubar and the menubar_manager to GimpImageWindow
Also move some of their related code and update other code to
go via gtk_widget_get_toplevel(), but also add some horrid temp
/* FIXME image window */ hacks.
2009-09-28 22:55:38 +02:00
Michael Natterer be93e6564a Move the fullscreen API from GimpDisplayShell to GimpImageWindow
Also remove GimpDisplayShell's "window_state" member. Use
gtk_widget_get_toplvel() to get to the GimpImageWindow when we need a
display shell's fullscreen state.
2009-09-28 22:55:37 +02:00
Michael Natterer aad8fbad3e Derive GimpDisplayShell from GimpImageWindow
This is just a refactoring step, later the image window will have one
or many display shells.
2009-09-28 22:55:35 +02:00
Michael Natterer 6425f5404d Use GimpTreeHandler to connect to all vectors in the image 2009-08-04 22:06:28 +02:00
Michael Natterer d9b5207aa2 Change licence to GPLv3 (and to LGPLv3 for libgimp).
2009-01-17  Michael Natterer  <mitch@gimp.org>

	* all files with a GPL header and all COPYING files:

	Change licence to GPLv3 (and to LGPLv3 for libgimp).

	Cleaned up some copyright headers and regenerated the parsers in
	the ImageMap plugin.


svn path=/trunk/; revision=27913
2009-01-17 22:28:01 +00:00
Sven Neumann f171d10506 Bug 471344 – Circular brush strokes are not smooth and have corners
2009-01-10  Sven Neumann  <sven@gimp.org>

	Bug 471344 – Circular brush strokes are not smooth and have 
corners

	Bug 127785 – stroking with size linked to pressure sensitivity
	should scale the spacing

	* app/core/gimpcoords-interpolate.[ch]
	* app/display/gimpdisplayshell.[ch]
	* app/display/gimpdisplayshell-callbacks.[ch]
	* app/display/gimpdisplayshell-coords.[ch]: applied patch from
	Alexia Death that introduces a Catmul-Rom splines based event
	interpolation and also adapts the brush spacing to brush size.


svn path=/trunk/; revision=27898
2009-01-10 00:48:30 +00:00
Sven Neumann 1ff4b3da7d optimize access to GimpDisplayShell struct members by placing related and
2008-11-16  Sven Neumann  <sven@gimp.org>

	* app/display/gimpdisplayshell.h: optimize access to
	GimpDisplayShell struct members by placing related and frequently
	accessed members like like scale and offset into the same
	cacheline.

	* app/display/gimpdisplayshell.c (gimp_display_shell_init): resort
	initialization accordingly.


svn path=/trunk/; revision=27668
2008-11-15 23:16:04 +00:00
Michael Natterer 3b053f79fa don't #include "libgimpwidgets/gimpwidgets.h".
2008-10-23  Michael Natterer  <mitch@gimp.org>

	* app/display/gimpdisplayshell.h: don't #include
	"libgimpwidgets/gimpwidgets.h".

	* app/display/gimpdisplayshell-draw.c
	* app/display/gimpdisplayshell-scale.c
	* app/tools/gimpeditselectiontool.c: include it here.


svn path=/trunk/; revision=27375
2008-10-23 09:42:55 +00:00
Martin Nordholts 384df24b80 When applying the centering logic we need to know the size of the new
2008-08-17  Martin Nordholts  <martinn@svn.gnome.org>

	* app/display/gimpdisplayshell.[ch]
	(gimp_display_shell_configure_event): When applying the centering
	logic we need to know the size of the new canvas, so instead of
	having it here, only make sure that this logic is run on the next
	canvas size-allocate.

	* app/display/gimpdisplayshell-callbacks.c
	(gimp_display_shell_canvas_size_allocate): If the size-allocate
	comes from a top level window resize, apply centering logic.

svn path=/trunk/; revision=26611
2008-08-17 07:21:41 +00:00
Sven Neumann 9d17a53267 moved last motion stuff to the end
svn path=/trunk/; revision=26233
2008-07-18 11:58:57 +00:00
Sven Neumann 92661af96c removed delta_time, delta_x, delta_y, distance and random from the
2008-07-18  Sven Neumann  <sven@gimp.org>

	* app/core/core-types.h: removed delta_time, delta_x, delta_y,
	distance and random from the GimpCoords struct. These don't need
	to be kept here and they can't be properly interpolated.

	* app/core/gimpcoords.c: changed accordingly.

	* app/xcf/xcf-load.c (xcf_load_vector): the size of the 
GimpCoords
	struct changed.

	* app/display/gimpdisplayshell.[ch] (struct _GimpDisplayShell):
	added some members to store values from the last event that are
	needed in gimp_display_shell_eval_event() and which are not any
	longer part of GimpCoords.

	* app/display/gimpdisplayshell-coords.c
	(gimp_display_shell_eval_event): changed accordingly.
	
	* app/paint/gimppaintoptions.c: calculate a random number when 
one
	is needed.

	* app/paint/gimpbrushcore.c (gimp_brush_core_interpolate):
	GimpCoords doesn't have a "random" field any longer.


svn path=/trunk/; revision=26232
2008-07-18 11:56:05 +00:00
Martin Nordholts a33d80107b Kill disp_[xy]offset! We now keep store that information by using negative
2008-07-12  Martin Nordholts  <martinn@svn.gnome.org>

	* app/display/gimpdisplayshell.c: Kill disp_[xy]offset! We now
	keep store that information by using negative values in
	offset_[xy].

	* app/display/gimpdisplayshell-scroll.[ch]
	(gimp_display_shell_scroll_clamp_offsets)
	(gimp_display_shell_get_scaled_image_viewport_offset): Adjust
	accordingly to preserve current behaviour.

	(gimp_display_shell_get_disp_offset): New function to get the old
	disp_[xy]offset based on the new offset_[xy].

	(gimp_display_shell_get_render_start_offset): New function to get
	th old offset_[xy] based on the new offset_[xy].

	* app/display/gimpdisplayshell-draw.c
	* app/display/gimpdisplayshell-scale.c
	* app/display/gimpdisplayshell-render.c: Get rid of
	disp_[xy]offset and use
	gimp_display_shell_get_render_start_offset() and
	gimp_display_shell_get_disp_offset() instead.

svn path=/trunk/; revision=26146
2008-07-12 07:00:46 +00:00
Sven Neumann f23d046965 app/widgets/Makefile.am app/widgets/widgets-types.h added GimpWindow class
2008-04-28  Sven Neumann  <sven@gimp.org>

	* app/widgets/Makefile.am
	* app/widgets/widgets-types.h
	* app/widgets/gimpwindow.[ch]: added GimpWindow class and moved
	key-press-event handler from GimpDock to this class.

	* app/widgets/gimpdock.[ch]:
	* app/display/gimpdisplayshell.[ch]: derive from GimpWindow.


svn path=/trunk/; revision=25541
2008-04-28 16:30:55 +00:00