Commit Graph

2370 Commits

Author SHA1 Message Date
Mikael Magnusson cd002dd0c6 app: remove two duplicated variable inits 2012-02-16 11:30:38 +01:00
Michael Natterer b3c8cbd5a5 app: remove all docks from GimpImageWindow in dispose()
Seems to fix irregularly occuring warnings on exit about dialogs
being still around.
2012-02-13 00:12:50 +01:00
Michael Natterer f70bc837fa app: remove gimpdisplay-utils.[ch], move its only function to gimpdisplay.[ch] 2012-02-11 17:57:27 +01:00
Massimo Valentini 39368a410d plugged memory leaks 2012-02-07 17:32:02 +01:00
Michael Natterer 0a68527edc app: move the GimpWindowStrategy interface from display/ to widgets/ 2012-01-30 23:33:21 +01:00
Michael Natterer 79a66d36d2 app: rename GimpWindowStrategy::create_dockable_dialog()
to ::show_dockable_dialog() because that's what it wlays does, no
matter if the dialog has to be created or now.
2012-01-30 22:59:09 +01:00
Michael Natterer 4aa866a8b9 Bug 664885 - Open 'Document History' --> always a additional history tab appears
In SWM, try to find an existing dialog in
gimp_single_window_strategy_create_dockable_dialog() before falling
back to creating a new one.
2012-01-30 22:53:43 +01:00
Martin Nordholts 64d2dc122a app: Add and use gimp_dialog_factory_find_widget() 2012-01-10 19:47:52 +01:00
Alexia Death c2d26d7e03 app: Keep canvas in place when image tabs show/hide 2012-01-04 22:09:07 +02:00
Michael Natterer 056e09a6cb Remove the makefile.msc build system, it is unmaintained since 2008 2011-12-16 15:53:56 +01:00
Michael Natterer 51a8e66824 app: reduce nesting in gimp_display_shell_canvas_no_image_events() 2011-12-15 22:35:44 +01:00
Massimo Valentini bea8b93959 app: use projection and not image sizes
these are the same nearly always, but during
an image-scale, the image size is updated early
and expose redraw following dialog destruction
uses the projection before the scale.

Basically this patch partly restores the code
before commit 8b8e67ffe2
2011-12-11 17:11:25 +01:00
Michael Natterer 5046f167fd app: remove checks for grab time consistency
because tests need to be able to pass GDK_CURRENT_TIME here, which is
a legal argument to grab functions. Fixes distcheck.
2011-12-11 16:39:01 +01:00
Michael Natterer 8569c6e2f7 app: don't request motion hints on the canvas
They are a dark ages concept, and it's almost 2012.
2011-12-10 23:22:08 +01:00
Michael Natterer 022af2610e app: GimpDisplayShell: fix type of the new grab time members 2011-12-09 23:21:22 +01:00
Michael Natterer 7da455214d app: merge if() madness into one single even bigger madness 2011-12-09 22:34:44 +01:00
Alexia Death 5ec2bd7287 app: improve ignoring other buttons while one down 2011-12-09 23:27:18 +02:00
Michael Natterer 435b5b4386 app: move variable to local scope in gimp_display_shell_canvas_tool_events() 2011-12-09 20:54:24 +01:00
Michael Natterer ea49a7b466 app: ignore new button events on the canvas while another button is down
Fixes tons of possibly dangerous warnings, and likely some weird
crashes.
2011-12-09 20:53:11 +01:00
Michael Natterer 01f92a3b48 app: get rid of server grabs for almost all canvas interaction
Because it's generally the right thing to do, and server grabs broke
badly with input devices / client side windows.

gimpdisplayshell-grab.c: change logic to only server-grab if an event
is passed to the pointer grab/ungrab functions, but always use
gtk_grab_add/remove() which is sufficient in most cases.

gimpdisplayshell-tool-events.c: have the grab functions grab the
server only for space-bar scrolling and do all tool interaction,
including ruler clicks, with gtk_grab_add/remove(). Refactor things
a bit to also use the grab API for button-2 scrolling.

gimpdeviceinfo-coords.c: transform the event's coords to the canvas'
coordinate system, they might come from a ruler now.

This fixes the following bugs:

Bug 645315 - gimp_display_shell_pointer_grab: gdk_pointer_grab failed...
Bug 644351 - Gimp misses some strokes especially when drawing fast
Bug 645747 - Gimp is now unusable on xfce4
2011-12-09 20:20:02 +01:00
Michael Natterer 9781aa65ea Bug 658467 - Replace g_format_size_for_display() by g_format_size()
Use g_format_size() instead of g_format_size_for_display() because
the latter is deprecated.
2011-11-30 23:37:55 +01:00
Michael Natterer d38ded387d Bug 663121 - guides are below rotate/transform/shear/perspective preview
Add a canvas item group for previews, and a small preview infrastructure
to GimpDrawTool, and put the transform preview into the preview group,
which is below all guides, grid and layer boundaries.
2011-11-16 21:32:29 +01:00
Michael Natterer ffc9948d6e app: add a canvas group for tool items
so we can control where in the canvas item stack they appear.
Put the group right below the software cursor.
2011-11-16 21:10:43 +01:00
Mukund Sivaraman d9f1a9eec6 app: Drop redundant assignment 2011-10-12 19:02:49 +05:30
Mukund Sivaraman 6e4a5b1996 app (display): Drop redundant assignments 2011-10-11 10:29:55 +05:30
Michael Natterer 11239c4b17 app: don't use g_list_length() to check if a list is empty 2011-10-09 00:27:53 +02:00
Michael Natterer a38faefba7 app: use toggle_behavior_mask not CONTROL to trigger zoom-on-scroll 2011-10-07 00:00:42 +02:00
Michael Natterer 59f4396c7b app: use the toggle_behavior modifier instead of GDK_CONTROL_MASK
to switch between dragging a guide or a sample point from a ruler.
2011-10-06 21:10:18 +02:00
Michael Natterer e8250320d5 app: use gdk_event_triggers_context_menu() for the image menu
and clean up button event handling a bit.
2011-10-05 20:04:42 +02:00
Michael Natterer c18c21f651 app: treat Meta_L and Meta_R as tool-relevant modifiers
for the Mac, they are still unhandled by tools though.
2011-10-05 19:44:24 +02:00
Michael Natterer f1d4dde36a libgimpwidgets: add gdk_event_triggers_context_menu() to gimp3migration.[ch]
and remove gimp_button_event_triggers_context_menu() again. Update
all callers to use the new function.
2011-10-02 16:23:59 +02:00
Mukund Sivaraman e79f90d3b6 app: Fix assignment (may be confused as compound assignment) 2011-10-02 19:15:08 +05:30
Michael Natterer 2c175b068d libgimpwidgets: add gtk_paned_new() to gimp3migration.[ch]
and use it all over the place.
2011-10-02 14:36:42 +02:00
Michael Natterer 19b9bfd189 libgimpwidgets: add gtk_scale_new() to gimp3migration.[ch]
and use it all over the place. Also change some GtkObject* variables
to GtkAdjustment*.
2011-10-02 14:36:41 +02:00
Michael Natterer 16817c666f libgimpwidgets: add gtk_scrollbar_new() to gimp3migration.[ch]
and use it all over the place.
2011-10-02 14:36:41 +02:00
Michael Natterer 3e336199b9 app: use gtk_box_new() 2011-09-30 11:29:11 +02:00
Michael Natterer d92cd2f6c8 Add gimp_button_event_triggers_context_menu() and use it
instead of checking for event->button == 3, so context menus
work correctly on the Mac. Didn't change the image menu yet
because thet requires some more refactoring.
2011-09-19 00:47:23 +02:00
Michael Natterer ed00cff9d3 app: don't use image_window->menubar if it's NULL 2011-09-16 23:24:49 +02:00
Michael Natterer 9cfa0a5dde app: use a smaller icon for the image tabs' close button
Also make sure the visibility of the icon doesn't depend on
GTK+ settings by packing it manually.
2011-09-15 09:04:38 +02:00
Massimo Valentini 8b8e67ffe2 Bug 656129: Warnings: render_image_tile_fault: assertion `tile[4]... 2011-09-08 18:37:28 +02:00
Martin Nordholts 9f1187f6a5 app: Prefix TileManager functions
read_pixel_data() -> tile_manager_read_pixel_data()
write_pixel_data() -> tile_manager_write_pixel_data()
read_pixel_data_1() -> tile_manager_read_pixel_data_1()
write_pixel_data_1() -> tile_manager_write_pixel_data_1()

for consistency.
2011-09-07 12:08:43 +02:00
Martin Nordholts a11989542a app: Add a close button to image window tabs
It takes a bit more space, but it needs to be easy to close images.
2011-08-24 23:02:19 +02:00
Martin Nordholts b9ccf189b4 Bug 650348 - Window unmaximizes when a document is closed
Refactor GimpImageWindow session management. As far as session
management goes, there are four states and four transitions that are
interesting.

The states are:

 State    Window mode     Images opened
 ------------------------------------------
  s1          swm               0
  s2          swm              >0
  s3          mwm               0
  s4          mwm              >0

The transitions are:

  Transition     Description
 -------------------------------------------
      t1         Enter single-window mode (swm)
      t2         Enter multi-window mwm (mwm)
      t3         Open an image
      t4         Close an image

When thinking of it like this, it is pretty easy to see when to call
gimp_image_window_session_clear() and when to call
gimp_image_window_session_apply(). So kill
gimp_image_window_set_entry_id() and handle all transitions in
gimp_image_window_session_update().
2011-08-09 20:25:06 +02:00
Martin Nordholts dbf6b4d944 app: Fix warning 2011-08-05 01:51:56 +02:00
Martin Nordholts 3ce4c49314 app: Handle special case "Toolbox" in GimpSingleWindowStrategy
The special case isn't pretty, but the current design can't handle it
nicely. This is not the first special case for the toolbox.
2011-07-20 16:36:36 +02:00
Alexander Hämmerle 421ca4114e Bug 641187 - GIMP needs a left-handed cursor option
Add a cursor-handedness setting and flip the cursor when it's set to
left-handed.
2011-07-24 22:09:21 +02:00
Michael Natterer 6b78436f56 app: implement all rectangle guides options for the transform guides 2011-07-24 19:07:51 +02:00
Michael Natterer c2e6f24687 app: add GimpCanvasTransformGuides and use them in the transform tool
which removes a lot of code from the transform tool, and reduces the
number of canvas items used for the transform grid from possibly
gazillions to one.
2011-07-24 18:42:13 +02:00
Michael Natterer be5c0df173 app: add "n-lines" property to GimpCanvasRectangleGuides
and add handling of the N_LINES guides type. Hardcode "4" in
GimpdrawTool for now, it's currently unused anyway.
2011-07-24 17:49:31 +02:00
Michael Natterer f7a390d5d0 app: add N_LINES and SPACING to enum GimpGuidesType
but don't show them in the rectangle options UI, this is just a step
towards unifying the enums.
2011-07-24 17:47:08 +02:00
Martin Nordholts 008a845aea app: Undeprecate GimpNavigationEditor 2011-07-05 22:13:18 +02:00
Martin Nordholts 07556242b0 app: Make positioning of new dockables depend on window mode
Add GimpWindowingStrategy with create_dockable_dialog() and use it in
dialogs_create_dockable_cmd_callback(). There are two implementations:
GimpSingleWindowStrategy and GimpMultiWindowStrategy. Depending on the
window mode, we want new dockables to appear in different places when
created. In single-window mode, they should appear inside the single
image window. In multi-window mode, a new dock window is created.
2011-07-03 21:20:36 +02:00
Martin Nordholts a410716503 app: Remove unused variable 2011-07-03 16:38:37 +02:00
Michael Natterer 8b57ef51cc app: clean up the new brush outline stuff a bit 2011-06-30 09:27:43 +02:00
Alexia Death 3c3657f780 app: Refactor path code to support styles and add outline style for use in brush outline 2011-06-29 23:05:14 +03:00
Nils Philippsen b1a2c736bf app: guard against crash due to quitting while DND is processed
In gimp_display_shell_drop_uri_list(), shell->display is dereferenced in
some places without checking that it's still there. It can be set to
NULL if the user quits the application while a drag and drop action is
being processed and the main loop is iterated during execution of this
function. (Bug #652280)
2011-06-10 18:12:33 +02:00
Martin Nordholts bb39703c7a app: Update appearance after adding dock
Since gimp_display_shell_appearance_update() depends on docks being
present, call it in gimp_image_window_add_dock(). Otherwise the resize
handle will be present when starting in single-window mode.
2011-06-06 16:07:25 +02:00
Michael Natterer ea27c7bc83 app: add the MIN4() and MAX4() macros to gimp-utils.h
instead of having them in 5 .c files.
2011-06-04 17:16:21 +02:00
Martin Nordholts 42c2c747d8 Bug 603848 - Single-window mode is not properly session managed yet
Make GimpImageWindow implement GimpDockContainer and
GimpSessionManaged so that GIMP can be started in single-window mode.
2011-06-04 12:22:20 +02:00
Martin Nordholts 75259bf4bb app: Call gimp_image_window_session_update() early
Call gimp_image_window_session_update() at the end of
gimp_image_window_constructed() so that if GIMP is closed right after
being started, the image window session info has the widget
initialized (and also so that the correct size is setup initially).
2011-06-04 12:22:20 +02:00
Michael Natterer 1bff2c8df2 app: sprinkle const qualifiers in the tool event callback functions 2011-05-31 23:18:11 +02:00
Michael Natterer da18c1114b app: gimpdisplayshell-tool-events.c: move Tab handling to a utility function
instead of having separate utility functions for the different
functions triggered by various Tab combinations.
2011-05-31 09:24:14 +02:00
Michael Natterer 8e5f18fb9e app: make Alt+Tab and Alt+Shift+Tab cycle through all open displays
in both multi- and single-window mode. This is useful especially in
multi-window mode because in single-window we can already cycle
through all tabs with Ctrl+PageUp/Down.
2011-05-30 23:46:50 +02:00
Massimo Valentini 1371602383 app: call cairo_surface_flush before drawing directly 2011-05-26 20:17:08 +02:00
Michael Natterer a6a6dd880a app: use hline/vline utility functions in GimpCanvasRectangleGuides 2011-05-25 10:23:02 +02:00
Michael Natterer c1c20e4c38 app: fix GimpCanvasRectangleGuides' extents 2011-05-24 20:49:49 +02:00
Michael Natterer 4e6f43a890 app: add new item class GimpCanvasRectangleGuides and use it
Removes a lot of code from the rectangle tool and fixes off-by-one
drawing problems because in image coordinates, lines can't be aligned
correctly with rectangles.
2011-05-22 22:09:09 +02:00
Michael Natterer 0dcdfe9e80 app: move enum GimpRectangleGuide from tools/ to display/
and rename it to enum GimpGuidesType.
2011-05-20 19:41:48 +02:00
Massimo Valentini 3efa2062c5 Bug 650426 - Missing call to cairo_surface_flush
app: before drawing directly on the surface.
2011-05-18 08:41:10 +02:00
Michael Natterer ab0b88b5db app: replace the last GtkObject members by GtkAdjustment
Also get rid of some unneeded GTK_ADJUSTMENT() casts and replace some
local GtkObject veriables by GtkAdjustment.
2011-05-15 17:00:41 +02:00
Michael Natterer 1ebd2b5113 Revert "app: Make alt+[number] switch tabs in single-window mode"
This reverts commit 110b3daa97.
2011-05-07 23:54:54 +02:00
Michael Natterer d7b8f8e81f app: formatting in gimpdisplayshell-selection.c 2011-05-07 22:33:05 +02:00
Michael Natterer c35ff719a7 app/libgimp*: remove stuff found by -Wunused-but-set-variable 2011-05-01 23:23:19 +02:00
Michael Natterer 99df9e114e app: GimpCanvasLayerBoundary: actually use the figured "edit_mask" boolean
instead of always passing FALSE when changing to a different
layer. For some reason we were displaying the right state anyway,
which can only mean that we do things redundantly here and call this
function twice.
2011-05-01 22:36:25 +02:00
Michael Natterer cc47b2a600 libgimpwidgets/color: move the cairo color utility functions to libgimpcolor
Add CAIRO_CFLAGS to a lot of Makefiles to make this possible, and
because they pull in cairo via the libgimp headers.
2011-04-28 15:50:39 +02:00
Michael Natterer 81911a7b02 app: allow to drop buffers and components to empty displays
and simply create new images from them.
2011-04-28 01:59:38 +02:00
Michael Natterer 69d3aa5b36 Bug 648820 - drag and drop grayscale/greyscale image causes image corruption
gimp_display_shell_drop_pixbuf(): use the image's type to create the
layer, not the dropped pixbuf's.
2011-04-28 01:44:48 +02:00
Michael Natterer 85509f4ffb app: GimpScaleComboBox: don't derive from GtkComboBoxEntry
because it's deprecated. Derive from GtkComboBox directly, use the
"has-entry" property and move the setup code from init() to
constructed().
2011-04-18 21:49:23 +02:00
Michael Natterer 5b14564d8e app: GimpMotionBuffer: remove empty constructed()
and move buffer destruction from dispose() to finalize().
2011-04-18 15:54:03 +02:00
Michael Natterer 534b48cb0d app: add gimp_motion_buffer_get_last_motion_time() and use it
The last poking into the buffer is gone now.
2011-04-18 13:13:51 +02:00
Michael Natterer d305d000ff app: struct GimpMotionBufferClass: parent_class had the wrong type 2011-04-18 11:35:51 +02:00
Michael Natterer e028195cf3 app: rename process_stroke() and process_hover() to request_foo()
Because that's what we are doing by calling the functions: requesting
the emission of "stroke" and "hover" signals.
2011-04-18 11:32:10 +02:00
Michael Natterer 3fbbb9b333 app: GimpMotionBuffer API cleanup and refactoring
- start_stroke()/finih_stroke() -> begin_stroke()/end_stroke()
- process_event_queue() -> process_stroke()
- GimpMotionBuffer::motion() -> GimpMotionBuffer::stroke()
- add GimpMotionBuffer::hover() and process_hover()
- remove push_event_history() and pop_event_queue() from API

The thing works like this:

- Motion events are continuously fed into the buffer using motion_event()
- begin_stroke()/end_stroke() correspond to BUTTON_PRESS/BUTTON_RELEASE,
  the period between them is a "stroke"
- If motion_event() returns TRUE, we request "stroke" signals by calling
  process_stroke() and "hover" signals by calling process_hover()
2011-04-18 11:08:24 +02:00
Michael Natterer d62cf65030 app: rename gimp_motion_buffer_eval_event() to motion_event()
because it's feeding it motion events.
2011-04-18 01:09:57 +02:00
Michael Natterer 6f865eda2b app: add start_stroke() and finish_stroke() API to GimpMotionBuffer
where finish_stroke() is the former flush_event_queue() and
start_stroke() is used in BUTTON_PRESS instead of poking into the
motion buffer's internals. Also, call finish_stroke() also when the
tool is not active, so the event buffer is flushed (the "motion"
callback will ignore the events if the tool is not active).
2011-04-18 00:35:20 +02:00
Michael Natterer e3b1ed7728 app: remove the timeout in GObject::dispose() 2011-04-17 22:00:18 +02:00
Michael Natterer e822fb0d95 app: separate the queue flushing function from the timeout function
and add g_return_if_fail() to all public functions.
2011-04-17 21:58:03 +02:00
Michael Natterer 334e4c5d71 app: move process_event_queue() and flush_event_queue() to GimpMotionBuffer
and emit the buffer's "motion" signal when a motion is supposed
to happen. In GimpDisplayShell, connect to GimpMotionBuffer::motion()
and call the tool.
2011-04-17 21:46:29 +02:00
Michael Natterer d784ca0a59 app: don't PAUSE/RESUME the active tool around sending it motion events
That's most likely a very old artifact that was needed not even when
we used to do XOR, and these days it's even wrong because it makes
the tools think that something about the display has changed, like
zoom or scroll.
2011-04-17 21:12:02 +02:00
Michael Natterer 9f61a7d2a1 app: siplify gimp_display_shell_process_event_queue()
by using gimp_motion_buffer_pop_event_queue() here too.
2011-04-17 20:43:55 +02:00
Michael Natterer fae0589767 app: minor cleanup gimp_motion_buffer_eval_event(), no logic change 2011-04-17 20:27:54 +02:00
Michael Natterer bb3eac557d app: add gimp_motion_buffer_pop_event_queue() and use it
instead of accessing and removing the queue's first element menually.
2011-04-17 20:20:18 +02:00
Michael Natterer aa7c31b802 app: s/gdouble inertia_factor/gboolean event_fill/ in eval_event()
Also remove "gdouble max_coord_smooth" from GimpTool and simply use
the existing motion mode for deciding whether or not to fill in
events.
2011-04-17 19:59:31 +02:00
Michael Natterer 41b469fcf5 app: gimp_motion_buffer_eval_event(): always set last_read_motion_time
We need it for correctly requesting device history, so we must
remember it also when returning FALSE and ignoring the event.
2011-04-17 19:34:02 +02:00
Michael Natterer 7ab72eb54a app: flush the event queue unconditionally on BUTTON_RELEASE
The flashing function checks for a non-empty queue by itself. Also
remove the timeout source explicitly in flush_event_queue() because it
might be called directly, and its FALSE return value has no effect on
the timeout source in that case.
2011-04-17 19:21:46 +02:00
Michael Natterer 2dbaf7f490 app: set "last_read_motion_time" in gimp_motion_buffer_eval_event()
because it is called whenever we process a newly received event.
2011-04-17 19:05:49 +02:00
Michael Natterer e09520fb08 app: add GimpMotionBuffer class to swallow all the event smoothing code
This commit only adds the class and removes the members from
GimpDisplayShell, so everything looks more ugly than before, but
I wanted the member moving separate from any refactorings.
2011-04-17 18:53:42 +02:00
Mikael Magnusson bebccfc95a Bug 647897 - Marching ants only visible in single window mode
Use gdk_window_create_similar_surface instead of gdk_cairo_create in
selection_render_mask, as the latter is not entirely correct to use
outside the expose handler and may have some unwanted clipping state.
2011-04-16 01:36:32 +02:00
Michael Natterer fde934ac58 app: s/GdkRectangle/cairo_rectangle_int_t/ in all GimpCanvasItems 2011-04-10 18:15:16 +02:00
Martin Nordholts 27ac2a3c38 app: Make GimpEditor instance members private 2011-04-10 12:12:01 +02:00