Commit Graph

12935 Commits

Author SHA1 Message Date
Michael Natterer c9645cc0d3 Add "active-item" property and API to GimpItemTree
and use it to store the image's active layer, channel and vectors.
2010-02-07 14:52:34 +01:00
Michael Natterer 78375e0ec5 Move gimp_image_get_insert_pos() to gimp_item_tree_get_insert_pos() 2010-02-07 14:08:52 +01:00
Michael Natterer 82f8cee292 Use the newly added get_parent() APIs
Get rid of tons of local "parent" variables and inline the
get_parent() calls. They were on separate lines only to make them
readable at all.
2010-02-07 13:46:46 +01:00
Michael Natterer e0224cdbfb Add get_parent() API for items, layers, channels and vectors
this is pretty pointless from an abstraction point of view, but using
these functions will make the code a lot more readable by getting rid
of tons of ugly casts to and from GimpViewable whenever getting an
item's parent.
2010-02-07 12:03:07 +01:00
Michael Natterer f2c56cb363 app: #if 0 some stuff to aviod warnings 2010-02-07 12:02:37 +01:00
Michael Natterer 1b7d60cc87 Add gimp_item_tree_add_item() and gimp_item_tree_remove_item()
and use them from gimp_image_add,remove_layer,channel,vectors().
Removes quite some code duplication from the remove() functions but
almost none from add() because of the ongoing floating selection
madness. We need the calls to the item tree anyway because it's
going to ensure unique names of its items.
2010-02-07 11:47:33 +01:00
Michael Natterer 7bfd5dcf75 Merge the layer, channel and vectors reorder undo into one item undo
- get rid of the individual undo types and add GIMP_UNDO_ITEM_REORDER.
- replace the pushing functions by a single one.
- merge all the actual undo code into gimpitempropundo.[ch].
- use gimp_item_tree_reorder_item() to do the actual reordering.
- fix gimp_item_tree_reorder_item() to use an ordinary "push_undo"
  boolean again instead of a pointer to an undo function.

GimpVectorsPropUndo is now a completely empty skeleton. Keep it around
anyway, maybe we'll get vectors properties to undo soon.
2010-02-06 16:41:54 +01:00
Michael Natterer 804e692c86 Add some item tree infrastructure that will be needed later
- add gimp_image_get_layer_tree(), channel_tree() and vectors_tree()
- change GimpItem::get_container() to GimpItem::get_tree()
- implement gimp_item_get_container() using gimp_item_get_tree()
2010-02-06 16:17:23 +01:00
Michael Natterer 25d39f2daa Add gimp_item_tree_reorder_item()
and remove the code duplication in gimp_image_reorder_layer(),
_channel() and _vectors(), which now consist of a single call to
gimp_item_tree_reorder_item().
2010-02-06 16:00:06 +01:00
Michael Natterer f551333cbe Add an "image" property to GimpItemTree 2010-02-06 13:49:09 +01:00
Michael Natterer c9d0b370fe Use GimpItemTrees to keep the image's layers, channels and vectors
This commit is basically just an exchange of the stack-keeping
objects and one big replacement of e.g. private->layers by
private->layers->container. Useful code will follow :)
2010-02-06 13:41:16 +01:00
Michael Natterer d57f39df00 Add unused new class GimpItemTree which will keep the image's items
It will make sure all items in the tree have unique names,
will keep the active item, handle inserting, removing and
reordering and whatnot...
2010-02-06 13:00:03 +01:00
Michael Natterer 004b96ac6c Don't use gimpimage-private.h undoing guide/sample point removals
Instead, use the proper "add" APIs and remove checks for the guides /
sample points being at the right positions (they might be out of image
when an image resize or rotation is undone). Add comments to make
clear that these functions are internal API, also add comments to the
proper public APIs so it's clear which one to use in which situation.
2010-02-06 13:00:03 +01:00
Michael Natterer 4211524ee2 Use gimp_image_undo_is_enabled() instead of private->undo_freeze_count 2010-02-05 09:19:43 +01:00
Michael Natterer 2b2464d6c8 Move the "flush_accum" to GimpImagePrivate 2010-02-05 09:13:25 +01:00
Martin Nordholts 43c0cfedbd app: "Pixel dimensions" -> "Size in pixels" in Image Properties dialog
'Pixel dimensions' can be misinterpreted with the size of a pixel, so
use 'size in pixels' instead. This is consistent with e.g. the Image
Scale dialog which talks about 'image size'.
2010-02-04 21:25:17 +01:00
Michael Natterer 0f0853ca86 Move "preview" to GimpImagePrivate 2010-02-04 21:09:19 +01:00
Michael Natterer 09c897262e Move all undo-related members to GimpImagePrivate
Also add some new API to access them.
2010-02-04 20:06:49 +01:00
Michael Natterer 4c1ec79281 Move the quick mask members to GimpImagePrivate
and add API to access the "inverted" state.
2010-02-04 09:49:45 +01:00
Michael Natterer 02f5931c96 Move "visible" and "active" to GimpImagePrivate
and add accessors for the entire arrays (not just their members).
2010-02-04 09:10:02 +01:00
Michael Natterer 4143f5cd62 Move "parasites" to GimpImagePrivate 2010-02-03 23:42:32 +01:00
Michael Natterer 4a247e9182 Move "floating_sel" and "selection_mask" to GimpImagePrivate 2010-02-03 23:24:18 +01:00
Michael Natterer 3720938517 Move the active layer, channel and vectors to GimpImagePrivate 2010-02-03 23:12:22 +01:00
Michael Natterer 67014260dd Move some container handlers to GimpImagePrivate 2010-02-03 23:05:49 +01:00
Michael Natterer 88de69464e Move "layers", "channels" and "vectors" to GimpImagePrivate 2010-02-03 23:00:31 +01:00
Michael Natterer c9b9b8e18e Increating and decreasing the display count were swapped 2010-02-03 22:59:50 +01:00
Michael Natterer c9f8399614 Move "grid", "guides" and "sample_points" to GimpImagePrivate 2010-02-03 22:16:02 +01:00
Michael Natterer 2005fd1a68 Move "projection" and "graph" to GimpImagePrivate 2010-02-03 21:46:09 +01:00
Michael Natterer bb624cb8c4 Move "tattoo_state" to GimpImagePrivate 2010-02-03 21:31:27 +01:00
Michael Natterer 0b2c804e9d Move "disp_count" and "instance_count" to GimpImagePrivate
and add the neccessary API to access and modify them.
2010-02-03 21:22:00 +01:00
Sven Neumann a179537e29 app: fix compiler warning and improve formatting a little 2010-02-03 20:49:38 +01:00
Michael Natterer f769284aca Start private struct for GimpImage and move the first members there 2010-02-03 20:31:25 +01:00
Michael Natterer 32358615d4 Don't access image->colormap directly 2010-02-03 20:09:20 +01:00
Michael Natterer f18943f4ce Don't access the image's unit and resolution members directly 2010-02-03 19:53:45 +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
Martin Nordholts ed2d178da3 app: Get rid of config -> display module dependency
In order to make a clear separation between the core modules and the
UI modules, move the necessary enums from display-enums.h and
widgets-enums.h to config-enums.h and the files
gimpdisplayoptions.[ch] from the display to the config module. This
removes the config -> display dependency.

This change has three main benefits
 * It lets us remove includes of display files from the config module
 * We don't have to link gimp-console and test-config with a subset of
   object files from the display module
 * It is reflected in devel-docs/gimp-module-dependencies.svg that the
   application is made up of core modules and UI modules and that no
   core module depends on any UI module
2010-02-01 21:56:48 +01:00
Michael Natterer e82e09307c app: increase vector loading float array size
xcf_load_vector(): the size of GIMP_COORDS_DEFAULT_VALUES has changed,
so the array has must be large enough to hold all its members.
2010-01-31 21:38:19 +01:00
Martin Nordholts 523c599baa app: Simplify gimp_dockbook_init() a bit 2010-01-31 20:22:24 +01:00
Martin Nordholts 02d3874eb7 app: Only add "gimp-toolbox" dock to "gimp-toolbox-window" 2010-01-31 20:21:17 +01:00
Martin Nordholts bf92270051 app: Don't crash when the toolbox dock window don't have docks
Session files from GIMP 2.6 don't need to have docks in the toolbox
top-level. Don't crash on that, instead add a "gimp-toolbox" dock
during sessionrc parsing.
2010-01-31 19:04:51 +01:00
Martin Nordholts 1438b9b31c app/tests: Make sessionrc more realistic
GIMP 2.6 can't have a toolbox top-level with an empty dock, remove the
dock. This gives us a more realistic test.
2010-01-31 19:04:51 +01:00
Michael Natterer 08b7709535 Bug 604820 - GEGL Operation "path" crashes GIMP
Blacklist "gegl:path".
2010-01-31 17:36:56 +01:00
Michael Natterer 74bf91cb63 Bug 603711 - Crashes when using path tool
gimp_display_shell_get_*_coord(): initialize the coords with
GIMP_COORDS_DEFAULT_VALUES allGimpCoords members get initialized.
2010-01-31 17:19:51 +01:00
Michael Natterer 98818f91cf Fix GimpCoords' default initializer
Add #define GIMP_COORDS_DEFAULT_DIRECTION and include it in
GIMP_COORDS_DEFAULT_VALUES so coords using it are not partly
uninitialized.
2010-01-31 14:30:08 +01:00
Michael Natterer a6d052f774 Bug 607140 - Tags not saved for Paint Dynamics resources on GIMP restart
(gimp_restore): add the dynamics container to the tag cache.
2010-01-31 11:31:19 +01:00
Martin Nordholts 8ba9700ddb Bug 597368 - Widget spacing around canvas steals working space
Remove spacing between the canvas and the surrounding widgets so that
that space can be used for the actual canvas itself instead.
2010-01-30 08:59:28 +01:00
Martin Nordholts f77c400957 app/tests: Generalize gimp_test_utils_set_gimp2_directory()
Support both builddir and srcdir with
gimp_test_utils_set_gimp2_directory() so we can have gimpdir-output in
the build dir.
2010-01-30 08:07:24 +01:00
Martin Nordholts 97bbde6e5b app/tests: Distribute sessionrc-expected 2010-01-30 08:06:09 +01:00
Martin Nordholts 985f2ae093 app/tests: Create gimpdir-output properly
The rule check-local is run after the tests themselves are run, so
make the tests depend on this directory to be created instead.
2010-01-30 08:06:09 +01:00
Martin Nordholts 3612ef2d76 app: Have separate output gimpdir for test cases
Make our test cases write gimpdir files in a dedicate output directory
by changing GIMP2_DIRECTORY at runtime. This ends the writing to the
source directory which make distcheck doesn't like, and it also allows
us to have a separate expected sessionrc for the session management
test. In that test we load a GIMP 2.6 formated sessionrc but write one
updated for 2.8.

We perform this change by passing the builddir through an environment
variable to the test cases. The patch also does some generalizations
in gimp-app-test-utils.c and adapts test cases accordingly.

Also do an adjustment in sessionrc on the toolbox size since
GIMP/GTK+/X/whatever has a tendency to adjust that during runs. The
new size is stable for the moment.
2010-01-29 18:33:22 +01:00
Martin Nordholts c094736f83 app: Remove accidentally commited g_printerr() 2010-01-22 21:00:17 +01:00
Martin Nordholts ba37aaa532 app: Support multi-column DnD in toolbox window
Add a drag handler to the toolbox so it's possible to create
multi-column docks in the toolbox dock window.
2010-01-22 20:48:34 +01:00
Martin Nordholts 613b330bc0 app: Clarify why we need URI drop target on toolbox 2010-01-21 21:00:31 +01:00
Martin Nordholts 1093462ae9 app: Merge 'global_toolbox_factory' into 'global_dock_factory'
Get rid of 'global_toolbox_factory' and manage everything dock-related
with 'global_dock_factory'. The whole of 'global_toolbox_factory' was
a big special-case and getting rid of it makes it easier to extend the
session management with e.g. single-window mode dock functionality.

To get rid of 'global_toolbox_factory' we, roughly, have to
 * Replace 'global_toolbox_factory' with 'global_dock_factory'
   everywhere. We can also get rid of lots of code that did special
   things for the "toolbox" factory.
 * Make the use or interaction with the toolbox explicit in some
   places. For example, a function gimp_dock_window_has_toolbox() has
   been introduced.
 * Make GimpSessionInfoDock have an 'identifier' parameter so we can
   differentiate between the "gimp-dock" and "gimp-toolbox" dock
   types.
2010-01-20 18:29:54 +01:00
Martin Nordholts dd8b867852 app: Kill #if-zeroed GimpContext code that doesn't seem to be needed 2010-01-19 23:18:30 +01:00
Martin Nordholts 2604db71a8 app: Don't yell in FIXME, explain instead 2010-01-19 23:15:37 +01:00
Martin Nordholts 84dd0d5241 app: Remove windows_commands_get_toolbox(), use dialog variant
Remove windows_commands_get_toolbox() and use dialogs_get_toolbox()
instead.
2010-01-19 23:05:45 +01:00
Martin Nordholts 66197c5d11 app: global_dock_window_factory -> global_dock_factory
Rename back global_dock_window_factory to
global_dock_factory. Renaming to global_dock_window_factory was done
under the assumption that there would be a separate factory that would
create non-toplevel dockables, but I don't expect this to happen in
the forseeable future.
2010-01-19 22:40:06 +01:00
Martin Nordholts 56a8cb68a8 app: Have dialog factory entries for the dock windows
Let dock windows have proper GimpDialogFactory entries. This allows us
to get rid of a lot of ugly mostly duplicated code. This also makes us
ready the merge the dock window and toolbox factories which will soon
be done. A few things should be noted:

 * We adjust the wrap box aspect ratio in the toolbox to avoid having
   the toolbox dock window explode

 * We make sure that we still can handle sessionrc files from GIMP 2.6
   and older
2010-01-19 22:24:17 +01:00
Martin Nordholts 8c10d1c451 app/tests: Add simple tests to switch to and from single-window mode 2010-01-17 10:43:16 +01:00
Martin Nordholts 408c22b79e app: Use the dialog factory for creating docks
Instead of having one dock constructor per dialog factory, put entries
for the normal dock and the toolbox dock in the dock window
factory. To do this we also need to merge the dock and normal dialog
constructors into one function protptype.

This takes us one step closer to be able to merge the
global_dock_window_factory and the global_toolbox_factory into one.

The long term goal: Support multi-column dock windows with one of the
docks being the toolbox. In this situation we can't have the toolbox
dock created by a separate dialog factory, that is too messy.
2010-01-17 00:00:19 +01:00
Martin Nordholts 0e9f434277 app/tests: Explain why gimp_test_utils_get_source_subdir() might fail 2010-01-16 23:51:23 +01:00
Martin Nordholts f8060aed27 app/tests: Add "/gimp-ui/create-new-image-via-dialog" test
Add a test to create a new image via the new image dialog that would
have caught the regression fixed by:
db2221c9 "app: Fix gimp_dialog_factory_constructor()".
2010-01-16 23:05:18 +01:00
Martin Nordholts a259d46716 app/tests: Add "gimp-image-new-dialog" to sessionrc
Add "gimp-image-new-dialog" to sessionrc so we can have tests with
this dialog without sessionrc changing.
2010-01-16 21:47:36 +01:00
Martin Nordholts db2221c97d app: Fix gimp_dialog_factory_constructor()
Fix gimp_dialog_factory_constructor() so that non-dockables can be
created by the dialog factory.
2010-01-16 21:22:56 +01:00
Martin Nordholts 08078ca79c app: Remove gimp_dialog_factory_set_put_in_dockables()
Instead of having gimp_dialog_factory_set_put_in_dockables() with all
the cruft that leads to we can use the 'dockable' member on
GimpDialogFactoryEntry. This is a general strategy that the code base
is being moved in: try to keep information per-entry rather than
per-factory.
2010-01-16 19:43:33 +01:00
Martin Nordholts 2527955c21 app: Copy 'dockable' member in gimp_dialog_factory_register_entry()
Copying 'dockable' for a dialog factory entry was forgotten in
gimp_dialog_factory_register_entry().
2010-01-16 19:35:34 +01:00
Martin Nordholts deb07e812d app: Introduce gimp_dialog_factory_set_put_in_dockables()
Change gimp_dialog_factory_set_constructor() to
gimp_dialog_factory_set_put_in_dockables() order to narrow the
interface a bit. We can make both
gimp_dialog_factory_set_put_in_dockables() and the
GimpDialogConstructor typedef internal this way.

The main reason we do this is because we want to get rid of a
dependency on factory->p->new_dock_func. Eventually we want to
construct docks just like we construct other widgets in the factory,
so new_dock_func will be removed.

Also improve readability of code such as making it explicit that
gimp_dialog_factory_put_in_dockable_constructor() is just an extended
version of gimp_dialog_factory_default_constructor().
2010-01-16 17:54:56 +01:00
Michael Natterer 73445668a6 app: remove #undef GSEAL_ENABLE, this file is completely ported 2010-01-16 15:12:50 +01:00
Michael Natterer fa6fc65fbf app: port one more file to GSEAL_ENABLE
Use accessors instad of widget->parent and widget->allocation
2010-01-16 11:25:43 +01:00
Michael Natterer 7175f3e883 Some more changes to build with GSEAL_ENABLE
- use more GTK+ accessors instead of struct members
- remove quite some #undef GSEAL_ENABLE from completely ported files
2010-01-15 15:35:03 +01:00
Alexia Death d3dde03b78 app: Fix a tug of war with scrollbars when middle click panning.
Whenever panning with a mouse scrollbars generated reverse events,
one for each, causing flicker on image borders.
2010-01-10 22:16:27 +02:00
Martin Nordholts e87c77bcfc app: Allow tests to override the menus directory
In order to let tests run against the source dir, allow them to
override the menus directory. Add utility functions for this and
adjust gimpuimanager.c accordingly.
2010-01-08 15:05:15 +01:00
Martin Nordholts 33e8b08f12 app/tests: Distribute test files and test directories 2010-01-08 13:37:25 +01:00
Martin Nordholts 5d79f664d3 app: Add "dialog-factory", "ui-manager" properties to GimpDockColumns
Add "dialog-factory", "ui-manager" properties to GimpDockColumns and
let GimpDock look for these before trying to look for a dock window
which does not exist in single-window mode.
2010-01-07 19:18:03 +01:00
Martin Nordholts bc5da21ba2 app: Add gimp_dock_columns_new() and GimpContext property
Add and use gimp_dock_columns_new() and add a GimpContext property to
GimpDockColumns. Also move the widget construction from _init() to
_constructor() in GimpDockWindow so we have a context object to pass
to gimp_dock_columns_new().
2010-01-07 19:13:13 +01:00
Martin Nordholts 33573b466b app: Check for dirty images before forcing single-window mode
Check for dirty images before forcing single-window mode since it is
annoying to have the UI split up and _then_ being asked about unsaved
images. The user might even click 'Cancel' in which case the UI will
have been switched to multi-window mode.
2010-01-06 18:19:20 +01:00
Martin Nordholts 5c4154d438 app: Don't remove the toolbox dock from dock columns
The toolbox always wants to make trouble :( Don't remove the toolbox
dock, even if it's empty.
2010-01-06 15:10:32 +01:00
Martin Nordholts f1bbb2c70a app: Fix menubar suddently stopping to work when toggling window modes
The image window must not disconnect from the active shell when any
page is removed, only when the active page is removed. This fixes the
bug with this step-by-step:

1. Start GIMP with a clean gimpdir
2. Create two windows
3. Enable single-window mode
4. Disable single-window mode
5. Try to execute a menu action, e.g. Select -> Invert, on both images

Expected result:
It works

Actual result:
It won't work in the image window that was reused and thus once had
two notebook pages, since it disconnected from page 1 when page 2 was
removed.

Also add some debug output.
2010-01-06 14:50:36 +01:00
Martin Nordholts fecc04914e app: gimp_image_window_page_removed() gets the widget, not page
The first GtkNotebook::"page-removed" signal parameter is the
GtkWidget that was removed, not a GtkNotebookPage. Correct function
signature.
2010-01-06 14:50:36 +01:00
Michael Schumacher 17b36d3bec Fix some compile warnings on Microsoft Windows
Added WPARAM and LPARAM cast to SendMessage arguments 3 and 4.
2010-01-06 14:12:40 +01:00
Martin Nordholts 3015b0d0d0 app: Update docks with new context when switching to window modes
When moving dockables from a dock window to an image window, they need
to start listening to the user context. So update the dockables with
the new context when we switch window mode.
2010-01-06 13:33:47 +01:00
Martin Nordholts eae77112e1 app: Bail out, not fail, in gimp_view_render_to_surface() buffer test
Don't fail when checking for availability of buffers in
gimp_view_render_to_surface(). The buffers will be gone when quitting
GIMP while in s-w-m and we don't want to print a warning every time
that happens.
2010-01-06 11:35:37 +01:00
Martin Nordholts 7e5224f828 app: Add and use gimp_dock_window_new() 2010-01-06 11:35:25 +01:00
Sven Neumann 8f6fea7636 app: prepare another refactoring 2010-01-05 22:30:17 +01:00
Sven Neumann 50c2ba45ec app: add GimpTranslationStore class
Derive GimpTranslationStore from GimpLanguageStore. It lists the
installed GIMP translations. Also sort the list alphabetically
instead of relying on the XML file being sorted.
2010-01-05 22:30:16 +01:00
Sven Neumann d2804b48fb app: add GimpLanguageComboBox and use it from the Preferences dialog 2010-01-05 22:30:16 +01:00
Sven Neumann a56de78b01 app: add "language" gimprc option and set the language accordingly 2010-01-05 22:30:16 +01:00
Martin Nordholts efbf581d61 app: Add newline at end of gimpbrush-transform.c 2010-01-05 21:19:12 +01:00
Martin Nordholts 6fb317598e app: Add TODO with importance of killing config -> display dependency
Add TODO describing why we should get rid of the dependency to
app/display that app/config has: this is the only dependency from the
core to the UI code.
2010-01-05 18:28:09 +01:00
Martin Nordholts 8a66f9357f app: Prevent losing dockables, force multi-window mode on exit
In order to prevent people from losing dockable dialogs, force
multi-window mode on exit. This is a workaround until single-window
mode is session managed.

This idea comes from some guy in the IRC channel who I unfortunately
forgot the name of and fail to find in the logs.
2010-01-05 13:21:09 +01:00
Martin Nordholts b42a5a9967 app: Handle calls to gimp_view_render_to_surface() while GIMP exists 2010-01-05 13:21:09 +01:00
Martin Nordholts 87c25236b8 app: Don't try to create widgets that requires a context while detached
When quitting GIMP while in single-window mode and the widget
hierarchies are cleaned up, prevent a tab widget from being
constructed so we don't get any annoying warnings due to failing to
look up a context.
2010-01-05 11:31:21 +01:00
Martin Nordholts 4fcd3024f1 app: Set a GimpContext on GimpDockColumns
In order to make a GimpDock get hold of a GimpContext both in
single-window mode and in multi-window mode, don't make it look for a
GimpContext in a GimpDockWindow, put the context in GimpDockColumns
instead. GimpDockColumns exists both in s-w-m and m-w-m, contrary to
GimpDockWindow. Still use the GimpDockWindow as a backup though.
2010-01-05 11:31:15 +01:00
Martin Nordholts 64896eed7f app: Add run-time check to gimp_dock_columns_get_docks() 2010-01-05 10:37:03 +01:00
Martin Nordholts 1e62e58f61 app: gimp_dockable_set_dockbook() must be able to take NULL 2010-01-05 10:28:16 +01:00
Martin Nordholts f8410035f1 app: Ref dockables in DnD signal code
Use g_signal_connect_object() instead of g_signal_connect() so that
the dockable is referenced and not destroyed before
_drag_end(). Prevents a crash, but DnD in single-window mode does not
work properly yet.
2010-01-05 10:26:07 +01:00
Martin Nordholts be653a7110 app: Seal GimpDockable and add necessary getters and setters 2010-01-05 00:32:35 +01:00
Martin Nordholts b5defd4e4a app: Add GIMP_LOG_FLOATING_SELECTION domain
Add GIMP_LOG_FLOATING_SELECTION domain to get rid of the somewhat
annoying debug prints. Floating selection is likely to require further
debuggin later on, so instead of just removing the output, use
GIMP_LOG for it.
2010-01-02 23:41:52 +01:00
Martin Nordholts 86e14c2c2f app/tests: Add a GIMP 2.8 XCF feature test template
Add template code for writing a test that makes sure GIMP 2.8 images
do not lose information when written to a file and loaded again, in
hope that mitch will fill in the rest ;)
2010-01-02 23:30:14 +01:00
Martin Nordholts 19183f81b2 app/tests: Test loading of an XCF file created with GIMP 2.6
Do a basic regression test on being able to load XCF files created
with GIMP 2.6. To add things to this file, add things to
gimp_write_and_read_file() and run the code in GIMP 2.6.

Also add a file-local helper function gimp_test_load_image().
2010-01-02 23:16:55 +01:00
Martin Nordholts f86f9e2adf app/tests: Sort TESTS in Makefile.am 2010-01-02 23:10:54 +01:00
Martin Nordholts 745d2dbf76 app/tests: Add a "gimp-comment" with an explanation of the file
Make it clear that the file is created from pure code execution and
not graphically with GIMP.
2010-01-02 23:09:21 +01:00
Martin Nordholts 0724959b61 app/tests: Make channel same size as image in XCF test
In order to avoid crashes when rending the image, make the channel the
same size as the image.
2010-01-02 23:06:57 +01:00
Martin Nordholts 69f28be91c app: Remove unused variable 'hardness' in paint/gimpbrushcore.c 2010-01-02 20:36:59 +01:00
Martin Nordholts c380512ce1 Revert "app: Add gimp_vectors_get_stroke()"
This reverts commit 2d2b6f03c5 and
adapts the code. We can use gimp_vectors_stroke_get_next (vectors,
NULL) instead of gimp_vectors_get_stroke (vectors, 0). Thanks to nomis
for pointing this out.
2010-01-02 20:20:10 +01:00
Martin Nordholts 3e81e87bca app/tests: Improve code coverage and test names in XCF test
Add another layer, a channel, a selection and two vectors to the test
image. Parameterize the image construction so we can create different
variants of test images, and add a test for an "unusual" GimpImage,
which is an image with compatible vectors and with a floating
selection. The test are renamed to something with "GIMP 2.6" to
emphasize that the tests work with files that might as well have been
constructed with GIMP 2.6. Also adjust the list of things that should
be tested, but that isn't tested yet.

FWIW, using the GNU gcc gcov tool it can be seen that xcf-load.c now
has a code coverage of 67.04% of 722 lines.
2010-01-02 18:55:44 +01:00
Martin Nordholts 2d2b6f03c5 app: Add gimp_vectors_get_stroke() 2010-01-02 18:55:44 +01:00
Alexia Death bdec911bfc app: Fix a mixing quirk in linear dynamics mixing
Angular dynamics could have resulted in a value > 1 giving unexpected results with hardness.
2010-01-01 19:03:59 +02:00
Alexia Death 2c4c9ad333 app: Clean up the hardness feature. Lets convolve PixelRegions. 2010-01-01 18:16:29 +02:00
Alexia Death 9774988f30 Real dynamic hardness support for both generated and pixmap brushes.
For generated brushes, dynamic input is applied on top of the set hardness as a factor.
For pixmaps, it influences the amount of blur applied to the stamp. Be warned, process is slow
for large pixmaps. The odd feature previously advertised as hardness is left in but disabled.
If I figure out what it should be exposed as, it might be made available again.
2010-01-01 15:54:31 +02:00
Michael Natterer 37b6a205d3 app: change the way the operation for layer compositing is determined
By default, get the operation from gimp_layer_mode_to_gegl_operation()
and special-case all modes except from "normal", so the special cases
actually become less as the new operations are filled with code.
2009-12-30 18:01:09 +01:00
Sven Neumann b9b1cbe00e comment out debug output from tag-cache 2009-12-30 16:39:35 +01:00
Michael Natterer 9f6827be7c app: add back individual operation classes for the layer modes
They are derived from GimpOperationPointLayerMode and are completely
empty and unused, but can be filled with code and enabled one-by-one
now.
2009-12-30 15:22:35 +01:00
Michael Natterer a58e7ee918 app: add .libs to .gitignore 2009-12-30 15:22:35 +01:00
Alexia Death 9b4ff636ed app: Fix typo in event history option blurb noticed by Mikael Magnusson 2009-12-30 16:03:11 +02:00
Alexia Death e79834b75e app: Fix garbage appearing in generated brushes with dynamic angles
Rounds angle used in generated brushes to avoid floating point precision problems.
2009-12-30 15:10:34 +02:00
Alexia Death c5b4643d69 Revert "app: Fix garbage appearing in 1:1 apect ratio 2 spike generated brushes"
This reverts commit 54844e8ab8.
An unneded pseudofix. Proper fix will be commited soon.
2009-12-30 13:21:26 +02:00
Michael Natterer bb852184e1 app: pass the drop_path to GimpContainerTreeView::drop_possible()
Together with some more refactoring, this will soon enable smarter
layer group dnd behavior.
2009-12-28 21:10:04 +01:00
Michael Natterer 3d9f9124f3 app: formatting 2009-12-28 21:07:38 +01:00
Michael Natterer 79c4023552 app: inline the inner curve mapping function for internal use
Makes gegl-curves about 1/3 faster for a simple case where only
the "value" curve was changed. The speedup should be better when
multiple curves are changed from the identity mapping.
2009-12-28 20:50:26 +01:00
Martin Nordholts 14ca90ac2f app/tests: Clean up test-ui.c a bit 2009-12-28 11:00:40 +01:00
Sven Neumann a3a8cf16c0 add libgimpapptestutils.a to .gitignore 2009-12-27 19:47:14 +01:00
Alexia Death 54844e8ab8 app: Fix garbage appearing in 1:1 apect ratio 2 spike generated brushes 2009-12-27 00:27:29 +02:00
Sven Neumann 345bbfe475 app: adjust wording and spelling in error messages 2009-12-26 20:46:19 +01:00
Michael Natterer 105b7c5afa app: fix mapping for CURVE_BLUE (use the blue, not the green curve) 2009-12-26 14:10:31 +01:00
Martin Nordholts 780ebd7c24 app/tests: Fix warnings about files not existing
Let each test sets GIMP2_DIRECTORY on their own through the help of a
new test utility function gimp_test_utils_set_gimp2_directory() that
is compiled into its own lib which tests are then linked with. Also,
instead of using "/tmp/gimpdir", we use "gimpdir-empty" in the source
dir. This way we get rid of a bunch of annoying warnings when running
the tests and have more control.
2009-12-24 23:01:48 +01:00
Martin Nordholts 47709fab18 app/tests: Use implicit _SOURCES 2009-12-24 18:54:11 +01:00
Martin Nordholts 999fb38164 app/tests: Create brushes, gradients and patterns dirs in gimpdir
Create brushes, gradients and patterns dirs in gimpdir to get rid of
warnings for those dirs not existing.
2009-12-24 18:15:43 +01:00
Martin Nordholts 1e89d01417 app/tests: Run main loop until idle instead of for a given time
Use gimp_test_run_mainloop_until_idle() instead of
gimp_test_run_temp_mainloop () since we then don't have to wait for a
timeout, we only wait the minimal amount of time.
2009-12-24 17:50:39 +01:00
Martin Nordholts ad56949d5b app: Make gimp_tool_options_editor_new() use only g_object_new()
In preparation for cleaning up the dialog factory stuff, start making
dockable constructable with just g_object_new(). First out is
gimp_tool_options_editor_new(). Move code from that function into
gimp_tool_options_editor_constructor() and add the necessary "gimp"
GObject property. The regression test
"/gimp-ui/tool-options-editor-updates" still passes after the
refactoring, of course.
2009-12-24 17:50:39 +01:00
Martin Nordholts 5e9aa1281c app/tests: Add regression test "/gimp-ui/tool-options-editor-updates"
Add a new test suite called "test-ui" which will contain several UI
related tests. Right now it just contains a test to make sure that the
tool options editor is updated when the tool changes
("/gimp-ui/tool-options-editor-updates").
2009-12-24 17:50:39 +01:00
Martin Nordholts 049de90d81 app: Add gimp_test_run_mainloop_until_idle()
Add function that runs a main loop until it is idle. Useful for test
cases.
2009-12-24 17:50:39 +01:00
Martin Nordholts 0f7c373f3b app: Add gimp_tool_options_editor_get_tool_options()
Add gimp_tool_options_editor_get_tool_options() for unit testing
purposes.
2009-12-24 17:50:39 +01:00
Martin Nordholts cf5d4953fd app: Add GimpToolOptionsEditorPrivate
Add GimpToolOptionsEditorPrivate and format static function
prototypes.
2009-12-23 22:39:47 +01:00
Martin Nordholts c331d5f9eb Bug 598454 - Improve visual feedback for Free Select Tool handles
Highlight the handle for the first vertex in the Free Select Tool even
with button1 down, since releasing the button on the first point will
close the polygon, so it's a significant state which we must give
feedback for.
2009-12-21 22:24:26 +01:00
Martin Nordholts 50525e4543 app: Fill Free Select Tool handles when mouse is over them
Right now the Free Select Tool vertex handles are shown when the
cursor is in the proximity. Extend this a bit, so when the cursor is
_on_ a vertex handle, fill it completely. See bug 598454.
2009-12-21 21:27:54 +01:00
Martin Nordholts caccbe8b67 app/tests: Add XCF write-and-load sanity test
Lay a foundation for having automated XCF file format testing. The
only current test constructs an image, writes it to a file, loads a
new image from that file, and makes sure the loaded image is in the
state we expected, i.e. the same state as the original file.

Next up is adding GIMP 2.6 regression testing to this test suite.
2009-12-21 19:04:48 +01:00
Martin Nordholts 8efb46bd0b app: Remove unused include #include <sys/types.h> in base/base.c 2009-12-21 17:25:01 +01:00
Martin Nordholts a7cb4742c5 app: Correct a comment regarding dock window factory 2009-12-20 20:30:16 +01:00
Martin Nordholts 90d7ffde1a app: Make all GimpDialogFactory members private
Add necessary trivial API that allows us to make remaining
GimpDialogFactory instance members private, and make them private.
2009-12-20 20:21:26 +01:00
Alexia Death dbf844c012 app: Disable history buffer via use of gimprc option
Adds non-UI option to disable the use of often buggy history buffer.
This option defaults to false, since a lot of device/X/GDK combos are broken
and the resulting stroke often actually looks better without history events.
Put (use-event-history yes) in gimprc if you want more events and possibly bugs.
2009-12-20 18:46:25 +02:00
Alexia Death 1f4098200a Revert "app: Removing code for making use of the X event history buffer"
This reverts commit af4717e78f.
People want it, to see when the backend is fixed.
2009-12-20 17:29:22 +02:00
Alexia Death af4717e78f app: Removing code for making use of the X event history buffer
X event history buffer is major source of problems. Almost all reports
about painting at an offset from the cursor in GIMP seem to originate
from history buffer bugs either at X or GTK level. There are device&X
combinations that work fine and there are others that are broken.
With current smothing the benefits of using the buffer are almost gone
and more exact does not always mean better to look at.
2009-12-20 16:27:03 +02:00
Martin Nordholts 8699511bbd app: global_dock_window_factory -> global_dock_factory
With GimpDock not being a toplevel any longer, it makes more sense to
name global_dock_factory global_dock_window_factory. Do that.
2009-12-20 14:41:02 +01:00
Martin Nordholts b8fe7278c8 app: Add GimpDialogFactoryPrivate
Add and use GimpDialogFactoryPrivate for the members that are not used
by clients. Remove initialiation in _init() for member put in the
private struct, the struct is zeroed for us.
2009-12-20 12:30:59 +01:00
Martin Nordholts 1ed1f5e31d app: Format static function prototypes in widgets/gimpdialogfactory.c 2009-12-20 12:28:12 +01:00
Alexia Death 355f1bfd56 app: Fix tabs to spaces for dynamics 2009-12-19 17:36:27 +02:00
Martin Nordholts b237e9343e app: dialogs_toolbox_get() -> dialogs_toolbox_new() 2009-12-19 12:33:27 +01:00
Martin Nordholts a0ffbd17b1 app: Continue cleanup of macro definitions in dialogs/dialogs.c
Move all macros definitions at the top and decorate struct
initialization values with the corresponding member names. Also do
some whitespace adjustments.
2009-12-19 11:26:10 +01:00
Martin Nordholts 5f03cf20d7 app: Improve readability of macros in dialogs/dialogs.c
As a workaround for not using C99, specify struct member names with
comments instead.
2009-12-19 10:36:05 +01:00
Martin Nordholts 6eb3e65445 app: Remove unused variables in gradient_options_gui() 2009-12-19 09:29:49 +01:00
Martin Nordholts a5ef19fb59 app: Cleanup actions/windows-commands.c from last commit
I forgot to rename a function and initialie a variable.
2009-12-19 09:29:35 +01:00
Martin Nordholts 2b7f8f7a7e app: Inline gimp_dialog_factory_show_toolbox()
Merge gimp_dialog_factory_show_toolbox() into the only caller
windows_show_toolbox() to get rid of one non-generic GimpDialogFactory
function.
2009-12-19 09:23:47 +01:00
Alexia Death b95dda6eea app: Fix dynamics mixing for inputs&outputs that have paint options toggles 2009-12-18 20:51:23 +02:00
Alexia Death d2ad292848 app: Remove repeat options from gradient for paint tools
Repeat for gradient/color or any other dynamic driving is provided by fade.
2009-12-18 20:51:23 +02:00
Martin Nordholts 30bb7b5891 Bug 604796 - Restore keyboard method to acquire screenshot
Move the mnemonic 't' in the File menu from 'Create Template...' to
'Create'.
2009-12-18 18:33:51 +01:00
Martin Nordholts ef6bd20c3b app: When paned widget is removed, clear drag handler
When paned widget is removed, clear drag handler. Not clearing was a
copy and paste mistake.
2009-12-17 19:51:13 +01:00
Sven Neumann cfc3c4c693 initialize all fields of GimpCoords (based on a patch by Massimo) 2009-12-14 20:28:47 +01:00
Michael Natterer 335597ce7d Bug 604508 - gimp-layer-new-from-visible should work from updated projection
Call gimp_pickable_flush(projection) before creating a new layer from it.
2009-12-14 14:01:37 +01:00
Alexia Death 60705f79e9 app: Making spacing available as dynamic parameter
Spacing is now dynamically controllable. Unlike other parameters it
made little sense to scale down from default spacing so it scales between
current and maximum spacing.
2009-12-13 22:46:09 +02:00
Martin Nordholts 65c5541faf app: Don't crash when detaching dockables from image window
Don't crash when detaching dockables from the image window. This
scenario only occurs in single-window mode. We solve it by using
global variables and checking for NULL for src_dock_window; there is
no dock window when detaching from the image window.

The use of global variables is meant to be temporary.
2009-12-10 19:30:49 +01:00
Michael Natterer c02d28643f app: fix gimp_button_menu_position() to not add the y position twice
Fixes commit 4822ca0d6d from ages ago,
does nobody around here actually *use* master?
2009-12-10 12:20:03 +01:00
Martin Nordholts c7a5195bdf Bug 604078 - Crash when pressing Backspace with Free Select Tool
Make sure we never call gimp_free_select_tool_remove_last_segment()
with priv->n_segment_indices being negative, and increase robustness
of the code in general.

Note that we always halt the tool when backspace is pressed and there
are no vertices left. This is to minimize the risk of ending up in an
invalid tool state.
2009-12-09 22:33:03 +01:00
Martin Nordholts f3235e6f45 app: Add "dock-factory" property to GimpImageWindow
With the introduction of a single-window mode, not only dock windows
needs to be able to create docks, the image window also needs to. So
give it a "dock-factory" property.
2009-12-08 19:49:13 +01:00
Alexia Death a736b8f972 Adding repeat option to fade.
Now fade can be applied either as sawtooth or triangular wave.
Also fade can be reversed.
2009-12-06 20:06:34 +02:00
Martin Nordholts 34ad9dad1a app: Session manage multi-column dock windows
Introduce GimpSessionInfoDock and session manage multi-column dock
windows. We are still backwards compatible with sessionrc, the only
difference is that a "session-info" entry now can have multiple "dock"
entries.

Also make ond dock window multi-column in the regression test
app/tests/test-session-management.c and adjust positions and image
selection menus a bit.
2009-12-06 14:49:53 +01:00
Martin Nordholts bfd91ebdb7 app: Append in gimp_dock_columns_add_dock()
Append new docks to the GimpDockColumns list to preserve the order of
addition. This will become important when we serialize the docks into
sessionrc.
2009-12-06 14:36:57 +01:00
Martin Nordholts 482f31cd3f app: Add GimpMenuFactoryPrivate
Add GimpMenuFactoryPrivate. Note that we don't introduce a Gimp-getter
since the menu factory is globally accesible and we want to have as
much control as possible in who can get the Gimp instance.
2009-12-06 10:23:05 +01:00
Martin Nordholts b1b560b0c4 app: Only kill living dock windows when switching to s-w-m
Only kill living dock windows when switching to single-window
mode. When we remove the last dock in a non-toolbox dock window, it
will commit suicide.
2009-12-06 09:50:02 +01:00
Martin Nordholts 5819c3c83a app: Have an "Export" button, not "Save", in export dialogs 2009-12-06 08:58:44 +01:00
Martin Nordholts 3bb15eac78 app: Move out dock window logic from gimp_session_info_dock_restore()
Move out dock window logic, most notably aux info, from
gimp_session_info_dock_restore() and put it in
gimp_session_info_restore() where it belongs.
2009-12-05 22:43:32 +01:00
Martin Nordholts 1bf84999e4 Move the Image Selection Menu to GimpDockWindow
Move the Image Selection Menu from GimpMenuDock to
GimpDockWindow. That is, if a dock window contains many docks then
they will share the same Image Selection Menu.

To do this we need to move around quite a bit of code. Move the
"context", "dialog-factory" and "ui-manager" properties from GimpDock
to GimpToolbox, GimpMenuDock doesn't need it any longer. Turn the
GimpDock getters for these properties into wrappers that go to the
GimpDockWindow properties. In some places, most notably GimpToolbox
construction, we use the GimpToolbox values of these properties, but
most of the time it works fine to just use the GimpDockWindow
properties. GimpDock::setup() and set/get_aux_info() have also been
moved to GimpDockWindow since the only aux info for docks was for the
image selection menu.

Also, we don't bother porting gimp_menu_dock_destroy() to
GimpDockWindow, but we leave the code around. If this is a problem, it
will show.
2009-12-05 21:21:24 +01:00
Martin Nordholts cb854e6ad7 app: Only do necessary init in gimp_dock_window_init()
The private instance data struct is zeroed out for us so we don't need
to assign NULL, FALSE and 0 to private instance data members in
gimp_dock_window_init().
2009-12-05 12:38:55 +01:00
Martin Nordholts df44751292 app: Add GimpMenuDockPrivate
Add GimpMenuDockPrivate which requires two new trivial getters.
2009-12-05 09:54:40 +01:00
Martin Nordholts c0e8018e8d app/tests: Use Palette Editor in sessionrc test for dockable aux info
Use Palette Editor in the sessionrc regression test so that the test
includes aux info for a dockable.
2009-12-04 08:31:49 +01:00
Martin Nordholts d33f643f6b app: Move GimpDockWindow::"font-scale" style property to GimpDock
To make the smaller font in docks also apply in single-window mode,
move the GimpDockWindow::font-scale style property to GimpDock. We use
the GimpDockWindow approach, so now each GimpDock has a name of the
form "gimp-internal-dock-<id>". We add "internal" to avoid clashing
with the GimpDockWindow legacy id "gimp-dock-<id>".
2009-12-03 23:08:30 +01:00
Martin Nordholts 5ae5ef0f9f app: dock_ID -> dock_window_ID in gimp_dock_window_init() 2009-12-03 21:51:56 +01:00
Martin Nordholts 4ccb650435 Exterminate GimpDockSeparator
Remove all GimpDockSeparator-related code. Seems pointless to keep
even the stuff in gtkrc.
2009-12-02 20:40:39 +01:00
Martin Nordholts c08c6e21e0 app: Add gimp_dialog_factory_dock_new() 2009-12-01 22:18:04 +01:00
Martin Nordholts 95bab5da5f app: gimp_dialog_factory_dock_new() -> _dock_with_window_new() 2009-12-01 21:42:24 +01:00
Martin Nordholts ae3c3291b0 app: Check for API availability in gimp_statusbar_init() 2009-11-30 23:14:54 +01:00
Martin Nordholts a81dc5ead3 app: Use more proper API in gimp_statusbar_init()
Use more proper API in gimp_statusbar_init() when we rearrange widgets
to get rid of warnings. Requires an up to date GTK+, max 2 weeks old
or so, for gtk_statusbar_get_message_area().

This makes app/tests run again since there are no warnings about wrong
widget parent.
2009-11-30 22:55:31 +01:00
Martin Nordholts 7b85cf4de8 app: Use a GdkWindow instead of GimpDockSeparators for dockable DND
Make drag-and-drop rearrangement of dockables happen directly in the
existing widget hierarchy so we don't have to use special, ugly
widgets (read GimpDockSeparator:s) for that.

More specifically, make edges of dockables and dockbooks have the same
semantics as the GimpDockSeparators had. We put a highlight colored
GdkWindow on top of the widget in question to highlight these special
drop areas. This GdkWindow is not taken into consideration in the GTK+
drag-and-drop code, so it does not interupt the DND interaction.

To achive this, there is a problem we must solve: Drag events in GTK+
are propagated inwards and out, but we sometimes want ancenstor
widgets to take care of drop events. We solve this by introducing the
concept of "drag handlers". A drag handler is asked if it will handle
a given drag event, and if it will, a client will let the drag event
be propagated upwards in the widget hierarchy. Right now, the
GimpPanedBox is the only "drag handler". The code could be generalized
more but it doesn't feel worth it at this point.

The size of the special drop area is 5px, the same size as the default
GtkPaned handles. This is because the plan is to later use these
handles as drop areas too.

Other changes of interest are:
 * We need to take care of "drag-motion", "drag-drop" and widget
   highlightning ourselves. We can not use the GtkDestDefaults
   conveniences with gtk_drag_dest_set() any longer since we need more
   control.
 * Make the drop callback pass the insert index directly instead of a
   GimpDockSeparator
 * Add some GIMP_LOG() debug output for DND
 * Disable the GimpDockSeparator code in GimpToolbox
2009-11-29 18:22:12 +01:00
Martin Nordholts 9ea1d490a4 app: Make gimp_paned_box_remove_widget() more destruction friendly
When closing a GimpDockWindow, the GtkBox code might already have
removed the widget. In that case we don't need to do anything.
2009-11-29 15:07:40 +01:00
Michael Natterer 7739670a93 gimp_layer_sync_mode_node(): use gegl:over for normal mode 2009-11-29 13:51:22 +01:00
Michael Natterer 12ac8ce899 Factor out configuring the layer's mode node to a utility function 2009-11-29 13:35:27 +01:00
Martin Nordholts e4e7bf8471 app: Add and use gimp_highlight_widget()
Add gimp_highlight_widget() so we can simplify
gimp_dockbook_tab_drag_motion() a bit.
2009-11-28 19:12:39 +01:00
Michael Natterer 2c05af036c Use gegl:over instead of gegl:normal 2009-11-27 21:11:26 +01:00
Michael Natterer 938de3ac01 Simplify if()s a bit in dockable_toggle_view_cmd_callback() 2009-11-19 14:44:56 +01:00
Michael Natterer e466da8616 Plug memleak found by Nelson A. de Oliveira 2009-11-19 14:40:25 +01:00
Michael Natterer b45454bc6c Make the popup arrow look sane again
Render the arrow to a temp GdkPixmap, turn it into a GdkPixbuf and set
the pixbuf as icon on the GtkEntry.
2009-11-15 21:35:34 +01:00
Martin Nordholts a685508713 app: Make GimpDockColumns listen to "dock-removed"
Make GimpDockColumns listen to "dock-removed", not "dockbook-removed",
when trying to figure out when to destroy itself. Fixes some crashes
when rearranging the UI, for example when doing this step-by-step:

1. Have two dock windows with one dockable each, say A and B
2. Move A to B's dock window and make it multi-column
3. Try to detach B, will result in a crash
2009-11-15 21:26:17 +01:00
Michael Natterer 79563b99c2 Use GtkEntry's icon feature instead of reimplementing our own popup arrow
Removes tons of code but looks ugly because it uses GTK_STOCK_GO_DOWN
currently, will fix that. Also did some random small cleanups and
removed unused members from the instance struct.
2009-11-15 20:30:57 +01:00
Martin Nordholts b5eae26c4b app: gimp_dock_columns_dock_book_remove() -> _removed() 2009-11-15 19:51:15 +01:00
Martin Nordholts 13bac61020 app: Move g_list_copy() out from gimp_dock_columns_get_docks()
Move g_list_copy() out from gimp_dock_columns_get_docks(). Fixes at
least one memory leak (in gimp_dock_window_get_dock()) and feels nicer
and more flexible.
2009-11-15 19:21:57 +01:00
Martin Nordholts 8a473663d5 app: Fix gimp_dock_separator_get_insert_pos(), we must return an index
The insert position for new column in GimpDockColumns was sometimes
wrong, the problem was in gimp_dock_separator_get_insert_pos() not
return an index but a GtkAnchorType. Convert from GtkAnchorType to an
insert index.
2009-11-15 16:10:59 +01:00
Martin Nordholts ae2f595f12 app: Remove empty GimpDocks from GimpDockColumns 2009-11-15 15:57:49 +01:00
Martin Nordholts 12530bfcf1 app: Add GimpDockColumns "dock-added" and "dock-removed" signals 2009-11-15 15:57:49 +01:00
Michael Natterer 0715c58c13 Fix the find_widget_under_pointer() code to build with GSEAL_ENABLE 2009-11-11 21:01:21 +01:00
Michael Natterer 3a8b59ada5 Use ${gimp_dir} and ${gimp_data_dir} in tags.xml
* app/core/gimpdata.c (gimp_data_get_identifier): check if the data's
  path starts with either of those and use the symbolic paths in that
  case.

* data/tags/gimp-tags-default.xml.in: use them here too instead of
  /home/martin/foo/bar/...

This way we can ship a default file that makes sense, and need much
less identifier remapping. The identifiers even stay the same when
upgrading GIMP.
2009-11-07 21:14:56 +01:00
Michael Natterer e4d8a36080 Store the active dynamics with the input device
Also remove cruft #include <stdio.h>
2009-11-07 17:39:02 +01:00
Michael Natterer 2651c2517b Bail our from expose() when the event doesn't come from entry->text_area 2009-11-06 12:04:58 +01:00
Michael Natterer dd3c1d5eb5 Use the standard system mouse cursor over the popup arrow 2009-11-05 22:48:11 +01:00
Simon Budig 68e1605666 Added workaround for the solaris-printf behaviour. 2009-11-05 10:55:00 +01:00
Michael Natterer 6a00a4ef22 Add comment why we implement focus_in_event() and focus_out_event() 2009-11-04 19:32:13 +01:00
Michael Natterer a4694d8a0a Optimize gimp_statusbar_replace_valist()
Don't replace anything if the status message didn't change. Gets rid
of quite some statusbar invalidations in many tools.
2009-11-03 15:49:18 +01:00
Michael Natterer ae70da3e72 Remove unused #define STATUSBAR_SIZE 200 2009-11-03 15:43:32 +01:00
Michael Natterer 8c07e52759 Don't let focus-in and focus-out on the canvas invalidate everything
Implement GtkWidget::focus_in_event() and ::focus_out_event() in
GimpCanvas and don't chanin up so the default handler never runs.
Remove code that tries to do the same in the canvas' tool events
callback.

The default impl invalidates the entire widget for no reason (the
canvas doesn't draw a focus indicator anyway), and the old solution
failed for empty displays and was constantly invalidating the entire
drop zone when the toplevel window gained or lost focus.
2009-11-03 13:58:36 +01:00
Michael Natterer 10bb9b090f Get rid of useless const in "const GimpDisplayShell*" 2009-11-01 20:47:18 +01:00
Michael Natterer deed1636f9 Remove all code from gimp_display_shell_new()
Move the entire widget construction code to constructor().
2009-11-01 18:18:17 +01:00
Michael Natterer 439994d994 Clean up gimp_display_shell_init()
Only initialize members that don't default to zero. It was simply too
much and soon widgets will be constructed in init().
2009-11-01 14:51:08 +01:00
Martin Nordholts 397650bc46 app: Remove #include "gimpdockseparator.h" in gimpwidgets-utils.c 2009-10-31 20:56:28 +01:00
Michael Natterer 22767ca7b8 Seal GimpData completely and add the missing accessors 2009-10-31 18:48:38 +01:00
Michael Natterer 7abcfbf237 Add private struct to GimpData
And start sealing by moving "filename" there. Add
gimp_data_get_filename() and use it everywhere.
2009-10-31 15:24:57 +01:00
Michael Natterer cfa76869d6 Bug 599797 - Crash on "Refresh dynamics" if ~/.gimp-2.7/dynamics folder is missing
(gimp_data_factory_refresh_cache_add): don't add data objects without
filename to the refresh cache. Regardless why they have no filename,
they can't be reloaded anyway (in this case it's newly created objects
that couldn't be saved because there is no folder to save them).
2009-10-30 22:58:19 +01:00
Michael Natterer 223cbeb6fb Fix gimp_data_factory_data_foreach()
Make the function do what is says also if the callback doesn't remove
the data from the factory, argh... also add "gboolean skip_internal"
parameter because doing that unconditionally feels equally broken.
2009-10-30 22:50:02 +01:00
Michael Natterer a0e70231fb Rename cache utility function and reorder stuff to make more sense 2009-10-30 22:40:50 +01:00
Michael Natterer 118440affc Add typedef GimpDataForeachFunc
instead of defining the callback signature in the
declaration of gimp_data_factory_data_foreach().
2009-10-30 22:00:51 +01:00
Michael Natterer 2700b35dae gimp_data_factory_load_data(): add local "loader" variable for readability 2009-10-30 21:45:03 +01:00
Michael Natterer 1e49fd6b50 Give a proper error message if there is no writable data directory
(gimp_data_factory_get_save_dir): add GError and return an error
message telling why exactly a writable folder could not be found.

Show that error message instead of silently failing of just giving a
useless generic error so the user knows how to fix the problem.
2009-10-30 21:34:08 +01:00
Michael Natterer 0c908fc12b Inline a function that was only used once
Keeping gimp_data_factory_data_reload() separate from
gimp_data_factory_data_refresh() is more confusing than helpful
because the function is an integral part of the refresh logic and
implemented everything but saving all dirty objects.
2009-10-28 20:25:55 +01:00
Alexia Death 05f6d89ab0 Stop smudge from crashing by disabling dynamic transfrorming in the brush core. 2009-10-27 23:21:17 +02:00
Michael Natterer 3329c89ad5 Formatting cleanup 2009-10-27 19:48:36 +01:00
Michael Natterer 962bf514c8 Don't try to make quarks from NULL strings
Because that warns badly. The functionality is unchanged though
because the code does properly check for 0 quarks. Also moved some
variables to local scopes.
2009-10-27 19:48:36 +01:00
Michael Natterer 398607ee94 Bug 599765 - F1 key on gimp-tool-align in menu have wrong link and it open gimp-tool-move
Add help ID "gimp-tool-align" and use it for the align tool.
2009-10-27 18:54:34 +01:00
Michael Natterer 0c81d491fb Change coords in GimpDynamicsOutput from call-by-value to "const GimpCoords*" 2009-10-27 14:30:20 +01:00
Martin Nordholts 624bb78c4c app: Move down gimp_dock_window_from_dock() in the file
Move down gimp_dock_window_from_dock() in the file as it is a special
kind of function.
2009-10-26 07:52:07 +01:00
Martin Nordholts dd96705549 app: Allow multi-column dock windows by drag-and-drop
When dropping a dockable on a dock separator on the side of e.g. a
dock window, a new column of dockables will be created. This allows
multi-column dock window setups.
2009-10-25 23:34:43 +01:00
Martin Nordholts d3bb3e7f99 app: Add and use gimp_dockbook_drag_source_to_dockable() 2009-10-25 23:02:05 +01:00
Martin Nordholts 2b622f99cd app: gimp_dock_separator_get_anchor() -> _get_insert_pos() 2009-10-25 22:25:06 +01:00
Martin Nordholts 521543106c app: Enable repeated toggling between Multi- and Single-window mode
Enable repeated toggling between Multi- an Single-window mode. When
enabling Single-window mode all docks and displays are put in a single
window. When disabling Single-window mode they are moved out to their
own windows again.
2009-10-25 22:05:57 +01:00
Martin Nordholts fdf2454666 app: Add gimp_image_window_new/destroy()
Add gimp_image_window_new/destroy() so we have a central place where
the Gimp::image_windows list is managed.
2009-10-25 22:02:38 +01:00
Martin Nordholts 19baff1a50 app: Add gimp_image_window_get_shell() 2009-10-25 21:57:14 +01:00
Martin Nordholts be8e0045ac app: Add gimp_dock_window_get_docks()
Add gimp_dock_window_get_docks() and get rid of trailing whitespace.
2009-10-25 21:50:08 +01:00
Martin Nordholts b9214fd3cf app: Add "gimp" property to GimpImageWindow 2009-10-25 21:44:23 +01:00
Martin Nordholts d7c61bade9 app: Copy dialogs list so we can remove while we iterate 2009-10-25 20:35:49 +01:00
Martin Nordholts ca5fbf45d4 app: gimp_get_image_window_iter() -> gimp_get_image_windows()
Rename gimp_get_image_window_iter() to gimp_get_image_windows() and
make it return a copy of the list of windows. Typically we will kill
or create new windows when we use this function which is why we do a
copy.
2009-10-25 20:31:55 +01:00
Martin Nordholts 39ee4ffa43 app: Use gimp_dock_window_remove_dock() not gtk_container_remove()
Since we added a GimpDockColumns to GimpDockWindows we need to use
gimp_dock_window_remove_dock() not gtk_container_remove(). This makes
"Windows→Single-window mode" work as before again.
2009-10-25 20:27:28 +01:00
Martin Nordholts 870d7f9376 app: Connect to GtkNotebook::page-removed in GimpImageWindow
We must disconnect from the last display shell when it is removed
when rearranging the UI, so connect to GtkNotebook::page-removed
in GimpImageWindow and do that.
2009-10-25 20:03:51 +01:00
Martin Nordholts 75ee76ecb6 app: Handle gimp_image_window_get_active_shell() returning NULL
When rearranging the UI it is pretty common that
gimp_image_window_get_active_shell() returns NULL so check for that.
2009-10-25 20:03:51 +01:00
Alexia Death fc3c368f96 Fix 180 degrees rotated brushes with dynamics off and direction following. 2009-10-25 17:16:26 +02:00
Martin Nordholts e81c4f44de app: Allow more than one dock inside a dock window
Put a GimpDockColumns inside GimpDockWindow so that there can be more
than one dock inside a dock window. For now,
gimp_dock_window_get_dock() returns the first dock. Eventually need to
return all docks and refactor the other code as needed.
2009-10-25 13:10:08 +01:00
Martin Nordholts ff6a787757 app: Add gimp_dialog_factory_dock_window_new()
Add gimp_dialog_factory_dock_window_new() since we need to be able to
create only dock windows when going from single-window mode back to
multi-window.
2009-10-25 12:24:54 +01:00
Martin Nordholts 3934813dd1 app: Insert, not prepend, into GimpDock dockbooks list
Insert, not prepend, into GimpDock dockbooks list. Fixes failing test
'test-session-management.c'.
2009-10-25 11:49:54 +01:00
Martin Nordholts 43c000498b app: Format gimpdialogfactory.h 2009-10-25 10:53:00 +01:00
Martin Nordholts 9cbe0cafa8 app: Document GimpDialogFactory 2009-10-25 10:38:42 +01:00
Martin Nordholts 65c0ce5dbe app: Get rid of const disqualifier warning
Get rid of const qualifier for a bunch of GimpDisplayShell getters to
get rid of a disqualifier warning. The problem is that we call into
GTK+ which sometime misses const which breaks the chain. As a general
guideline we should avoid const for widgets.
2009-10-24 21:02:19 +02:00
Martin Nordholts 4bd2230a55 app: Chain up GimpPanedBox::finalize() 2009-10-24 20:33:09 +02:00
Martin Nordholts 6f95bc6888 app: Keep GimpDocks in GtkPaneds in GimpDockColumns
Use the new GimpPanedBox to make the space for GimpDocks in
GimpDockColumns manually distributable by the use of GtkPaneds.
2009-10-24 20:10:42 +02:00