Commit Graph

73 Commits

Author SHA1 Message Date
Jehan c6906e77da app: get rid of dummy "*-menu" and "*-popup" actions.
With our old code, we needed dummy actions for every submenu. This is not needed
anymore. Actions are only for end menu items (items which actually do something,
not just open a submenu).
Get rid of them all, as well as the code to ignore any action ending with such
suffixes in action-listing pieces of code.
2023-04-20 15:36:11 +02:00
Jehan 38d0abc026 app: prevent multiple registrations of a same action.
Pre-GIMP-3.0 code logics would re-allocate several GimpMenuFactory or
GimpUIManager for no good reason. While it was still working with old GtkAction
code, with our new GAction-based code, we were ending up overriding an action
with a new version of the same action, while keeping reference to old actions.
This made for discrepancies of the enabled or visible state of actions.

The new code keeps singleton of some objects and references to already
registered GimpUIManager or GimpActionGroups objects and make sure no actions
with the same name are created twice.
2023-04-12 22:07:09 +02:00
Jehan 4251c931c7 app, menus: big cleanup of most of GtkUIManager API.
Only remaining API are action group-related.

While doing this, I also remove 2 debug actions which don't look like they were
outputting any information anyway (at least on the main dev branch):
"debug-dump-items" and "debug-dump-managers".
2023-04-12 22:07:09 +02:00
Jehan 68d862b3c2 app: fully get rid of gimp_action_get_accel_closure().
All the remaining pieces of code where the deprecated concept of accelerator
closure was still used have now been replaced by proper GimpAction API using the
newer GAction API.
2023-04-12 22:07:08 +02:00
Jehan cd6e777dcd Issue #6045: File > Debug > Show Image Graph == GIMP_Crash.
The issue has also been fixed on GEGL side (see commit 5ac40e3c3 in
GEGL), but since the fact that "gegl:introspect" relies on a runtime
tool (which is not the best thing), let's make an additional check
within GIMP to make sure we have a proper buffer as a result to
"gegl:introspect". Otherwise we might crash when trying to use this
NULL buffer.
2020-12-05 18:55:59 +01:00
Ell 1f9d0d275c app: add gimp_image_invalidate_all()
... which invalidates the entire image.  This replaces all calls to
gimp_image_invalidate() with the full canvas size, since the image
content can now be larger than the canvas.
2019-09-04 19:16:42 +03:00
Michael Natterer 3b6b3fc189 app: GtkAction -> GAction madness part two
Change all action callbacks so they can be invoked by a GAction:

- add GimpActionCallback typedef:
  void (* cb) (GimpAction*, GVariant*, gpointer)
- change all action callbacks to the GimpActionCallback signature
- add "gimp-activate" and "gimp-change-state" signals to GimpAction,
  with the same signature as the resp. GAction signals
- remove all other custom action signals and only use the new
  GimpAction signals
- pass around appropriate GVariants containing booleans, int32,
  strings
- badly hack around to force a GimpProcedure pointer into a
  uint64 variant
- remove all G_CALLBACK() casts from all action callbacks,
  they all have the same signature now
2019-07-04 01:11:48 +02:00
Michael Natterer b9d47f2d1f app: change all action callback signatures to use GimpAction
instead of GtkAction, which is correct now because all our actions
implement the GimpAction interface.
2019-07-02 16:12:18 +02:00
Michael Natterer 86e07c16b5 app: start porting away from GtkAction and friends
Step one: get rid of all those deprecation warnings that make
it hard to see any other warnings:

- add a lot of dummy API to GimpAction, GimpActionGroup, GimpUIManager
  etc. which simply forwards to the deprecated GTK functions, they
  will all go away again later
- rename GimpAction to GimpActionImpl
- add interface GimpAction that is implemented by all action classes,
  creates a common interface and allows to remove some duplicated
  logic from GimpToggleAction and GimpRadioAction, and at the same
  time adds more features
2019-07-02 14:21:32 +02:00
Ell dac9bfe334 app: add "direct" parameter to gimp_projection_flush_now()
Add a boolean "direct" parameter to gimp_projection_flush_now(),
which specifies if the projection buffer should only be invalidated
(FALSE), or rendered directly (TRUE).

Pass TRUE when flushing the projection during painting, so that the
affected regions are rendered in a single step, instead of tile-by-
tile.  We previously only invalidated the projection buffer, but
since we synchronously flush the display right after that, the
invalidated regions would still get rendered, albeit less
efficiently.

Likewise, pass TRUE when benchmarking the projection through the
debug action, and avoid flushing the display, to more accurately
measure the render time.
2018-12-02 10:14:58 -05:00
Michael Natterer 5f700549e7 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:29:46 +02:00
Michael Natterer 669127dbd6 app, menus: add new menu item Debug -> Start GtkInspector
so it can by launchaed at any time even if not requested via
GTK_DEBUG=interactive and without enabling the magic keyboard
shortcut.
2018-06-20 20:43:41 +02:00
luz.paz 7fdb963e01 Bug 794996 - Misc. typo fixes in comments in app/
Found via `codespell -q 3 --skip="./po*"`
2018-04-08 21:25:56 +02:00
Ell 53c145c0be app: add --show-debug-menu command-line option
The debug menu is currently not included in stable versions.

Include the menu unconditionally, but hide it, and its associated
actions, by default in stable versions.  Allow enabling the menu
using a new --show-debug-menu command-line option, in the same vein
as --show-playground.
2018-03-29 05:26:03 -04:00
Massimo Valentini b118e8242b Bug 784647: Crash when choosing debug option Show Image Graph
The attached patch avoids CRITICALs when executing Debug actions
with no images open.
1) do not run projection benchmark unless there is an image
2) memsize of pluginmanager member was incorrectly computed using
   gimp_object functions for 2 GObjects
2018-01-10 17:06:56 +01:00
Jehan 3fa016fb4b app: clean out tab indentations. 2016-12-21 04:05:32 +01:00
Michael Natterer 7d4948b190 app: use gimp_create_image_from_buffer() to create the debug image graph 2015-06-19 23:49:41 +02:00
Michael Natterer db09d0f3d3 app: move functions to create layers to new files gimplayer-new.[ch] 2015-06-17 13:21:01 +02:00
Michael Natterer ff6ea69569 app: change the image's various URIs to GFiles
which gets rid of a lot of temporarily added GFile code again because
we don't need to convert between URI and GFile any longer.
2014-07-07 23:58:11 +02:00
Michael Natterer 41148e8996 app: bring back Debug -> Benchmark Projection 2014-06-02 21:32:00 +02:00
Michael Natterer 7f23fbec34 app: add screen and monitor to all display and image window constructors
so they appear on the proper monitor as well.
2014-05-02 20:21:41 +02:00
Michael Natterer caf73f5f35 Add support for both gamma-corrected and linear for all bit depths
- Add new enum GimpComponentType which contains u8, u16, u32 etc.
- Change GimpPrecision to be u8-linear, u8-gamma, u16-linear etc.
- Add all the needed formats to gimp-babl.c
- Bump the XCF version to 5 and make sure version 4 with the old
  GimpPrecision enum values is loaded correctly

This change blows up the precision enums in "New Image" and
Image->Precision so we can test all this stuff. It is undecided what
format will be user-visible options in 2.10.
2013-06-23 16:51:24 +02:00
Michael Natterer 220b28677b Bug 676566 - Window title becomes "Untitled" after exporting without saving
Fix this and other issues more globally by moving the logic that
formats the image's display name into the GimpImage object, and return
the properly formatted name, e.g. "Foo.xcf", or "[Foo] (imported)"
from gimp_image_get_display_name().

Also add gimp_image_get_display_path() which returns the full path
instead. Use the two functions for formatting the image title, and
apply various other fixes that make sure the UI always uses the same
string to identify the image.

Call gimp_object_name_changed() whenever the save/export status
changes, so the image's cached display name and path get cleared.
2012-07-17 22:52:49 +02:00
Michael Natterer eec5e9968e app: remove Debug -> Benchmark Projection 2012-05-20 20:13:59 +02:00
Michael Natterer 69893e4f72 app: remove GimpPickable::get_tiles()
and change some legacy places to get their tiles from the buffer
returned by GimpPickable::get_buffer().
2012-05-06 01:01:54 +02:00
Simon Budig 71d5fbe6af debug: follow new gimp_image_new signature 2012-05-02 17:51:23 +02:00
Michael Natterer c14738806e app: use gimp_image_get_layer_format() instead of dealing with image_type 2012-05-02 17:50:57 +02:00
Michael Natterer 765c2cfea2 app: replace GimpDraable's type by a Babl format
and change gimp_drawable_new() and all gimp_layer_new() variants to
take formats instead of types.
2012-05-02 17:46:06 +02:00
Øyvind Kolås 830b49993b app: set GeglBuffer directly in show image-graph 2012-05-02 17:45:48 +02:00
Martin Nordholts 6ea36f3383 app: Use gimp_image_set_uri()
I forgot to do this...
2011-02-02 22:28:47 +01:00
Martin Nordholts ac773489e4 app: gimp_image_get_uri() -> gimp_image_get_uri_or_untitled() 2011-01-26 07:55:14 +01:00
Michael Natterer 8a27702ac3 app: add simple macros GIMP_TIMER_START() and GIMP_TIMER_END()
which measure the time taken between them and print out a message.
Use it for projection benchmarking and add timing to scaling.
2010-06-06 20:24:27 +02: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
Michael Natterer 3e500a4f7f Use gtk_container_get_children() instead of menushell->children 2009-10-09 21:19:06 +02:00
Michael Natterer 87440be423 Use gtk_menu_item_get_submenu() instead of menuitem->submenu 2009-10-09 21:19:06 +02:00
Michael Natterer ac98c2c234 Use gimp_display_get_shell() instead of directly accessing it 2009-10-04 19:56:39 +02:00
Michael Natterer 1c430a2b19 Move all GimpImageWindow members to a private struct
Add accessor functions for publically available members and visibility
functions for menubar and statusbar.
2009-09-29 21:44:43 +02:00
Michael Natterer 253b8e2cbe Use gimp_display_shell_get_window() instead of gtk_widget_get_toplevel()
The new function does the right thing, unlike get_toplevel() which
returns the shell itself if it is not in a window. Check the return
value of get_window() for being non-NULL.
2009-09-29 20:32:26 +02:00
Michael Natterer 6793d68769 Move the menubar and the menubar_manager to GimpImageWindow
Also move some of their related code and update other code to
go via gtk_widget_get_toplevel(), but also add some horrid temp
/* FIXME image window */ hacks.
2009-09-28 22:55:38 +02:00
Michael Natterer d442379d5e Change GimpProjectable::update to GimpProjectable:invalidate
The only purpose of this change is to avoid having the "update"
signal twice on GimpGroupLayer (from GimpDrawable and from
GimpProjectable). Switch back to normal g_signal_connect()
in the projection.
2009-08-26 13:06:55 +02:00
Michael Natterer c4075975bf Bring parent items to the public API in the core
* app/core/gimpimage.[ch]: make the parent parameter public in
add_layer(), add_layers(), add_channel() and add_vectors().

* app/vectors/gimpvectors-import.[ch]: add parent parameters to
  the vectors import functions.

* app/core/gimpchannelundo.[ch]
* app/core/gimplayerundo.[ch]
* app/vectors/gimpvectorsundo.[ch]
* app/core/gimpimage-undo-push.[ch]: remember the parent item when
  removing layers, channels and vectors.

* app/actions/channels-commands.c
* app/actions/debug-commands.c
* app/actions/edit-commands.c
* app/actions/layers-commands.c
* app/actions/vectors-commands.c
* app/core/gimp-edit.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-merge.c
* app/core/gimpimage-quick-mask.c
* app/core/gimplayer-floating-sel.c
* app/core/gimpselection.c
* app/core/gimptemplate.c
* app/dialogs/file-open-dialog.c
* app/display/gimpdisplayshell-dnd.c
* app/text/gimptext-compat.c
* app/tools/gimptexttool.c
* app/tools/gimpvectortool.c
* app/widgets/gimptoolbox-dnd.c
* app/xcf/xcf-load.c
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/paths.pdb
* tools/pdbgen/pdb/vectors.pdb: pass NULL as parent item to above
  functions and add FIXMEs all over the place because there is some
  more hacking needed to make adding with index = -1 (on top of the
  current item) work again.

* app/pdb/image-cmds.c
* app/pdb/paths-cmds.c
* app/pdb/vectors-cmds.c: regenerated.

* app/core/gimpimage-duplicate.c: duplicate the original image's
  tree structure in the copy.

* app/widgets/gimpitemtreeview.[ch]: add parent to GimpAddItemFunc,
  add utility function gimp_item_tree_view_get_drop_index() which
  figures where to add something dropped to an item tree.

* app/widgets/gimpchanneltreeview.c
* app/widgets/gimplayertreeview.c
* app/widgets/gimpvectorstreeview.c: changed accordingly, using above
  new GimpItemTreeView API.
2009-08-03 19:21:51 +02:00
Michael Natterer c73b71810d Use g_strdup_printf() instead of g_new() and g_sprintf() 2009-05-29 20:49:40 +02:00
Michael Natterer c9674b4603 Use the new GtkAction accessors instead of g_object_get()/set() 2009-05-24 22:29:18 +02:00
Martin Nordholts 9cf6214c74 app: Sort 'Dump Keyboard Shortcuts' output 2009-05-16 14:42:17 +02:00
Martin Nordholts 1c33708f5a app: Add File -> Debug -> Dump Keyboard Shortcuts menu command
Add a Debug menu item 'Dump Keyboard Shortcuts' that can for example
be used to see what keyboard shortcuts that are unused or to simply
get an overview of what current keyboard shortcuts we hvae. Based on
code in gimp_action_view_new().
2009-05-08 20:13:27 +02:00
Martin Nordholts 5803dc058b Improve Debug -> Show Image Graph output
Use the new gegl:introspect feature of showing the graph of nodes a
given node depends on. This gives much better depicted graphs.

svn path=/trunk/; revision=28265
2009-04-12 10:23:02 +00:00
Martin Nordholts 0c17e790a7 Properly show name of image graph source image
svn path=/trunk/; revision=28077
2009-02-28 10:11:48 +00:00
Martin Nordholts c9b62622db Add a Show Image Graph item to the Debug menu
Add a Show Image Graph item to the Debug menu that creates a new image
showing the GEGL graph for the image. Would benefit from an enhanced
gegl:introspect op with a clearer graph, but still quite interesting
in its current shape.

svn path=/trunk/; revision=28069
2009-02-23 20:43:30 +00:00
Michael Natterer d9b5207aa2 Change licence to GPLv3 (and to LGPLv3 for libgimp).
2009-01-17  Michael Natterer  <mitch@gimp.org>

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

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

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


svn path=/trunk/; revision=27913
2009-01-17 22:28:01 +00:00
Sven Neumann f2665fe374 run the benchmark in an idle callback.
2008-11-15  Sven Neumann  <sven@gimp.org>

	* app/actions/debug-commands.c
	(debug_benchmark_projection_cmd_callback): run the benchmark in 
an
	idle callback.


svn path=/trunk/; revision=27657
2008-11-15 12:43:18 +00:00