Commit Graph

271 Commits

Author SHA1 Message Date
Martin Nordholts 6812d5bdce Bug 346881 - Remove redundant title of tab and move menu button up
Remove the dockable drag handle and move the menu button it hosts up
to the GimpDockbook, with the gtk_notebook_set_action_widget() API.

This frees up quite a lot of screen estate which can be used for the
content of dockables instead.
2010-06-12 01:24:39 +02:00
Martin Nordholts 9b86acd16b Add 'Automatic' Tab Style support
Add support for a new type of Tab Style called 'Automatic'. This tab
style makes the GimpDockbook use the biggest actual tab style it can
for its auto tab style dockables, based on its widget allocation.

The tab style candidates for auto tab style are "Status + Blurb",
"Status + Text" and "Status". A docked widget can also say that it
wants to use "Icon" instead of "Status" for its auto tab style. The
'Tool Options' dockable does this. This is to be as backwards
compatible with the old tab style setup, we make 'automatic' the
default everywhere.

We have quite a bit of dependency to internal layout code in
GtkNotebook, but the current code should be pixel perfect and rather
complete.

Also add a basic regression test.
2010-06-12 01:23:42 +02:00
Martin Nordholts c67a8c7546 app/tests: Don't have toolbox in sessionrc in session-management test
Enable it again when we have a way to handle that the toolbox size is
likely to change due to the use of GDK_HINT_RESIZE_INC.
2010-05-29 15:46:38 +02:00
Martin Nordholts d7dc2dc1ab app: Make tooltips in the toolbox work again
We need to be able to pass a GimpUIManager to
gimp_dialog_factory_dialog_new(), so make that possible. Also make
sure to set ui_manager in gimp_dialog_factory_dialog_new_internal()
when we create both a dock window and a dock, so tooltips works in
toolboxes created from scratch.
2010-05-16 12:19:18 +02:00
Martin Nordholts 7b8352bfa0 app/tests: Make test that closes dock window use multi-column variant
Make test that closes dock window use multi-column variant so it
catches a bunch of warnings that occurs when closing multi-column dock
windows.
2010-03-07 09:00:08 +01:00
Martin Nordholts bdfbddd5e8 app/tests: Generalize gimp_ui_find_non_toolbox_dock_window()
Generalize gimp_ui_find_non_toolbox_dock_window() by renaming it to
gimp_ui_find_dock_window() and adding a parameter with a function that
will be used to find the toolbox.
2010-03-07 08:55:18 +01:00
Martin Nordholts 11b1300b6f app: Introduce gimp_dialog_factory_get_singleton()
Instead of including dialogs/dialogs.h everywhere, introduce
gimp_dialog_factory_get_singleton(). The dialog factory singleton is
still initialized by dialogs.c though.

Right now the assumption is that we never will have another dialog
factory instance around. There were so many problems before when we
had four of them, so let's just keep one of them around.
2010-02-28 23:23:24 +01:00
Martin Nordholts 82c52974e2 app/tests: Don't exit before test-xcf.c tests are run 2010-02-28 23:23:23 +01:00
Martin Nordholts 947e28596f app: Remove gimp_dialog_factory_from_name()
We only have one dialog factory now, and
gimp_dialog_factory_from_name() doesn't provide compile-time type
safety, so use global_dialog_factory directly instead.
2010-02-28 20:02:45 +01:00
Martin Nordholts 18f3be6bd3 Bug 602223 - Can't hide docks with Tab in single-window mode
Add a "hide-docks" config and connect the Windows->Hide docks menu
item to it. Also connect the image window to the config property so it
can hide/show its docks when it needs to.

Also add and use a utility function
gimp_image_window_keep_canvas_pos() to ensure that the image in the
window remains fixed when toggling visiblity of docks. One problem:
When GimpDrawTool is active on the canvas, there is flicker. The end
position is correct though.

Also add regression testing for this fix to test-ui.c
2010-02-24 19:53:48 +01:00
Martin Nordholts 82b2e2cff5 app/tests: Update test-ui.c, gimp_dialog_factories_toggle() is removed 2010-02-24 19:53:48 +01:00
Martin Nordholts 1e9048ded9 app: Turn gimp_dialog_factory_dock_with_window_new() into util func
Turn gimp_dialog_factory_dock_with_window_new() into a utility
function, it doesn't make sense to let it be part of the generic
GimpDialogFactory.
2010-02-20 16:55:59 +01:00
Martin Nordholts ea6efc3885 app: Make Recently Used Docks work with GIMP 2.6 dockrc files
In GIMP 2.6 dockrc did not contain the factory entries for the session
infos, so set that up manually if needed. Also take the opportunity to
add a copyright notice to dialogs.c since tha file is almost rewritten
by now...
2010-02-20 13:05:16 +01:00
Martin Nordholts dec798e0df app: Serialize factory entry name along with GimpSessionInfo
Serialize factory entry name along with GimpSessionInfo so we can make
the Recently Closed Docks feature work across sessions in a natural
way.
2010-02-20 13:05:16 +01:00
Martin Nordholts 1d120d9b02 app/tests: Improve test-session-management.c output
Don't bail out if sessionrc fails, report result for dockrc too. And
change system() to g_spawn_sync().
2010-02-20 13:05:16 +01:00
Martin Nordholts c3619fb85c app: Merge "toplevel" and "display" factories
Merge "toplevel" and "display" factories so that we only have one
dialog factory. This allows us to get rid of a lot of special casing.
2010-02-20 10:58:29 +01:00
Martin Nordholts 8b458fb591 app: Merge "toplevel" and "dock" dialog factories
Merge "toplevel" and "dock" dialog factories. The end goal is to have
only one dialog factory.
2010-02-20 09:28:26 +01:00
Sven Neumann 3c63462e43 app: always use snprintf(), even in tests 2010-02-19 19:30:55 +01:00
Martin Nordholts 3545bafc41 app/tests: When session management test fails, use system() to say why 2010-02-18 21:49:34 +01:00
Martin Nordholts b081d91370 app/tests: Add regression test for hide/show of dock windows
Add regression test for hide/show of dock windows that makes sure that
dock window positions are kept after a hide/show cycle. Also introduce
a helper function gimp_ui_find_non_toolbox_dock_window().
2010-02-18 07:25:07 +01:00
Martin Nordholts 33d66f5c7e app/tests: Add regression test for Recently Closed Docks
Add a simple regression test for Windows → Recently Closed Docks.
2010-02-13 20:10:40 +01:00
Martin Nordholts 5093109122 app: Fix gimp_ui_get_ui_manager() to allow arbitrary test exec order
Make gimp_ui_get_ui_manager() in test-ui.c handle when there is no
empty display so we can put the new-image test before the
single-window mode tests. We want the single-window mode tests lasts
because they are so flickery.
2010-02-13 20:10:40 +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
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 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 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 8c10d1c451 app/tests: Add simple tests to switch to and from single-window mode 2010-01-17 10:43:16 +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 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 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 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
Michael Natterer a58e7ee918 app: add .libs to .gitignore 2009-12-30 15:22:35 +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
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 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 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 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 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 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 95bab5da5f app: gimp_dialog_factory_dock_new() -> _dock_with_window_new() 2009-12-01 21:42:24 +01:00
Martin Nordholts 3cd7c5a6cd app/tests: Do role tests on the dock windows, not the docks 2009-09-26 12:48:44 +02:00
Martin Nordholts fca590925b app/tests: Add dockrc to session regression testing
Add dockrc to session regression testing and do some general cleanups
and generalizations in the test.
2009-09-19 13:04:18 +02:00
Martin Nordholts 6e0befa6ba app: Add regression testing for sessionrc/docks
Add a regression test for sessionrc parsing, handing and writing. The
test work in the following way: GIMP starts so that sessionrc is
deserialized and stored internally, the UI is shown, and then the
internal data structure about windows is serialized to a new
sessionrc. The test makes sure that a new sessionrc actually has been
created, and then that the content of the new file is identical to the
old one.
2009-09-17 01:56:17 +02:00
Martin Nordholts dc51d81671 app: Don't use the gimpdir for WM tests
The WM tests mess up the GIMP dir, in particular any sessionrc if it
exists, due to the interface never being shown. Make the WM test use a
tmp dir to avoid that.
2009-09-17 01:51:54 +02:00
Martin Nordholts 0601229f9f app: Add show_gui parameter to gimp_init_for_gui_testing()
Add show_gui parameter to gimp_init_for_gui_testing() so that we can
have tests that shows the the actual GIMP interface.
2009-09-17 01:51:53 +02:00
Martin Nordholts c847b56d0e app: Add GIMPDIR for tests
Add GIMPDIR for tests, both to get rid of warning about missing
tags.xml and for future usage.
2009-09-17 01:51:53 +02:00
Martin Nordholts fb549cdabf app: Call gimp_exit() in tests to avoid warnings about broken pipes 2009-09-17 01:51:53 +02:00
Martin Nordholts 810f325a16 app: Add regression test for window roles 2009-09-08 19:32:39 +02:00
Martin Nordholts 3e6f6088ee app: Create libapp.a for convenient test case linking
Create libapp.a for convenient test case linking and link the existing
tests against that.
2009-09-07 23:05:11 +02:00
Michael Natterer 5bb149fa9d Add some more checks that come for free to the existing tests 2009-09-07 20:52:10 +02:00
Michael Natterer a0914f8df1 Add test-layers to .gitignore 2009-09-07 19:11:21 +02:00
Michael Natterer a17f7e0d4f Add a layers test
Contains the add-layers test from the "template" test and also a
remove-layers one.
2009-09-07 19:09:48 +02:00
Michael Natterer 6542617751 Initialize some more stuff so real tests are possible
* tests.[ch]: initialize base so we have a tile cache and add
  parameter "gboolean use_cpu_accel" so we can test stuff both with
  and without using CPU features.

* tests/test-layer-grouping.c: changed accordingly. Call g_thread_init()
  so the tile cache works (and to be on the safe side in general).
2009-09-07 19:06:57 +02:00
Michael Natterer 2e2c7aaf34 Minor formatting cleanup 2009-09-07 18:55:18 +02:00
Martin Nordholts d6c8fa9783 app: Update .gitignore 2009-09-05 16:09:57 +02:00
Martin Nordholts 14aa5314af app: Add GIMP core unit testing framework and a simple first test
Enable us to have regression testing by introducing a core testing
framework that uses the GLib JUnit-like test library.

Do this by adding a new subdir app/tests that will contain all our
tests (it contains one trivial test already). Also add app/tests.[ch]
with a new function gimp_init_for_testing() so that test cases can
easily setup the core object system.
2009-09-05 16:02:32 +02:00