Commit Graph

50 Commits

Author SHA1 Message Date
Jehan 67e2e1b5bb app, libgimp, plug-ins: move Orientation metadata handling into core.
Orientation is now handled by core code, just next to profile conversion
handling.

One of the first consequence is that we don't need to have a non-GUI
version gimp_image_metadata_load_finish_batch() in libgimp, next to a
GUI version of the gimp_image_metadata_load_finish() function in
libgimpui. This makes for simpler API.
Also a plug-in which wishes to get access to the rotation dialog
provided by GIMP without loading ligimpui/GTK+ (for whatever reason)
will still have the feature.

The main advantage is that the "Don't ask me again" feature is now
handled by a settings in `Preferences > Image Import & Export` as the
"Metadata rotation policy". Until now it was saved as a global parasite,
which made it virtually non-editable once you checked it once (no easy
way to edit parasites except by scripts). So say you refused the
rotation once while checking "Don't ask again", and GIMP will forever
discard the rotation metadata without giving you a sane way to change
your mind. Of course, I could have passed the settings to plug-ins
through the PDB, but I find it a lot better to simply handle such
settings core-side.

The dialog code is basically the same as an app/dialogs/ as it was in
libgimp, with the minor improvement that it now takes the scale ratio
into account (basically the maximum thumbnail size will be bigger on
higher density displays).

Only downside of the move to the core is that this rotation dialog is
raised only when you open an image from the core, not as a PDB call. So
a plug-in which makes say a "file-jpeg-load" PDB call, even in
INTERACTIVE run mode, won't have rotation processed. Note that this was
already the same for embedded color profile conversion. This can be
wanted or not. Anyway some additional libgimp calls might be of interest
to explicitly call the core dialogs.
2020-09-24 12:43:41 +02:00
Michael Natterer b92dd2c8e3 app: split GimpDisplay in two classes: GimpDisplay and GimpDisplayImpl
GimpDisplay contains only the ID logic and the "gimp" and "config"
pointers, and lives in the core.

GimpDisplayImpl is a subclass and contains all the actual display
stuff. The subclass is only an implementation detail and doesn't
appear in any API.

Remove all hacks which pass displays as gpointer, GObject or
GimpObject through the core, or even lookup its type by name,
just use GimpDisplay.
2019-09-04 14:30:43 +02:00
Michael Natterer 7201d48231 Get rid of capitalized "ID" in function and variable names
and use "id" instead.
2019-08-23 22:23:23 +02:00
Jehan 5d2dbfe2e8 app: gdk_threads_(enter|leave)() deprecated since GDK 3.6.
There are no replacements. Just we must make sure that all GTK+/GDK
calls are run from the main thread, which is already what we were doing.

Actually I don't even think these were doing anything as we were not
calling gdk_threads_init() so the default lock functions were not set
anyway. These were just bogus calls.
2019-07-22 11:25:24 +02:00
Michael Natterer 5f700549e7 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:29:46 +02:00
Ell cec17de3c2 app: add gimp_wait()
Add a GimpGui::wait() virtual function, and a corresponding
gimp_wait() function.  The function takes an object implementing
the GimpWaitable interface, and a printf-style message, and waits
for the object to become ready, displaying the message as
indication in the meantime.  The default implementation simply
prints the message to STDERR.

Implement the function in gui-vtable, using the busy-dialog plug-
in added in the previous commit, to display the message in a
dialog.  Additionally, if the object implements the GimpCancelable
interface, provide a "cancel" button in the dialog, which, when
pressed, causes gimp_cancelable_cancel() to be called on the
object.  Note that the function keeps waiting on the object even
after requesting cancelation; GimpTriviallyCancelableWaitable can
be used to stop the wait once cancelation has been requested.
2018-05-29 16:04:28 -04:00
Michael Natterer b9103bbc5f Revert "app: remove all deprecated threads_enter/leave code"
This reverts commit 94b028bc39c7250997ee9883793e6649bf2490c7.

Dunno what breaks here, it just crashes, leave the commits there
instead of rebasing them away, as reminder...
2018-05-20 21:06:30 +02:00
Michael Natterer 579cf4c428 app: remove all deprecated threads_enter/leave code 2018-05-20 21:06:30 +02:00
Michael Natterer 5ece7a8d1f Port a lot of stuff from GdkScreen/monitor_number to GdkMonitor
including some fixes for getting pointer coords, and needed
API changes in libgimpwidgets.
2018-05-20 21:06:30 +02:00
Jehan 34fe992f44 app: keep track of number of errors and traces in GimpCriticalDialog.
We don't want an infinite number of traces because it takes some time to
get. Until now I was keeping track of traces in app/errors.c, but that
was very sucky because then I was limiting traces per session. Instead
save them as a variable of a GimpCriticalDialog instance. Therefore only
generate the traces for WARNING/CRITICAL at the last second, when
calling the dialog.
When too many traces are displayed, just fallback to just add error
messages only. But then even errors without traces can be time-consuming
(if you have dozens of thousands of errors in a few seconds, as I had
the other day, updating the dialog for all of them would just freeze the
whole application for a long time).
So also keep track of errors as well and as last fallback, just send the
remaining errors to the stderr.
2018-02-12 02:09:15 +01:00
Jehan 9fdf35550b app: new error dialog to backtrace and encourage people to report bugs.
GIMP will now try to get a backtrace (on Unix machines only for now,
using g_on_error_stack_trace(); for Windows, we will likely have to look
into DrMinGW).
This is now applied to CRITICAL errors only, which usually means major
bugs but are currently mostly hidden unless you run GIMP in terminal. We
limit to 3 backtraces, because many CRITICAL typically get into domino
effect and cause more CRITICALs (for instance when a g_return*_if_fail()
returns too early).
2018-01-28 15:43:07 +01:00
Michael Natterer 741be87d0f app: don't let display color management settings affect file import
gimp_image_import_color_profile(): get the intent and bpc settings
from the profile import dialog instead of asking the global
GimpColorConfig.
2016-06-05 22:36:52 +02:00
Benoit Touchette 6762bf5b9b Bug 759105 - Patch to add icon theme selection
Add support for custom icon themes much like custom theme
support. There is still work to be done but this is the
basic functionality.
2015-12-09 12:50:15 +01:00
Michael Natterer b51ee77ec0 app: implement the "Convert to RGB Working Space" import dialog in the core
Add gimp_image_import_color_profile(), a GUI vtable entry
query_profile_policy() and a new dialog which returns the profile
policy and the profile to convert to. Get rid of the wrapper that
calls the lcms plug-in for that dialog, the plug-in is now completely
unused.

This commit doesn't add any new features, it's just the former lcms
plug-in dialog implemented in app/ (except the little fix that it is
now aware of linear vs. gamma images).
2015-08-23 12:59:12 +02:00
Michael Natterer 7e7c22fc32 app: separate the mount logic from uploading/downloading
We need to mount every non-native GFile's volume, regardless of
whether the file procedure uses GIO directly or needs file-remote to
download/upload the file. Move the entire mount logic to a new
file-remote function and change gimp-gui.c and gui-vtable.c to only
return a GMountOperation. Try to mount every non-native file in
file-open.c and file-save.c and bail out if mounting fails. Simplify
the uploading and downloading code accordingly.
2014-07-23 21:37:13 +02:00
Michael Natterer 14c39816d8 app: keep the theme directories around a GFiles
and change gimp_get_theme_dir() to return a GFile.
2014-07-20 17:09:25 +02:00
Michael Natterer 5c1f14be67 app: add gimp_mount_enclosing_volume(), using the the GimpGui vtable
and implement it in gui-vtable.c using gtk_mount_operation_new().
2014-07-11 00:40:34 +02:00
Michael Natterer 3f52828896 app: change GimpImageFile and GimpDocumentList to speak GFile 2014-07-07 23:58:11 +02:00
Michael Natterer 8356003fa2 app: pass the startup monitor to displays opened from the copmmand line
Change gimp_get_display_name() to also return the screen, and its
implementation in the GUI to return the initial monitor during
startup. Retrieve that information in app.c using a weird callback
construct and pass the monitor to file_open_from_command_line().

Half-related, add screen and monitor parameters to GimpDisplayShell
and use these initial values for calculating the canvas's initial
extents.

The image windows still don't position themselves correctly though
because we have no mechanism for that whatsoever just yet, but we now
at least pass the needed monitor information to the right objects.
2014-05-03 00:54:20 +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
Martin Nordholts 07556242b0 app: Make positioning of new dockables depend on window mode
Add GimpWindowingStrategy with create_dockable_dialog() and use it in
dialogs_create_dockable_cmd_callback(). There are two implementations:
GimpSingleWindowStrategy and GimpMultiWindowStrategy. Depending on the
window mode, we want new dockables to appear in different places when
created. In single-window mode, they should appear inside the single
image window. In multi-window mode, a new dock window is created.
2011-07-03 21:20:36 +02:00
Michael Natterer f4af9b549e Globally switch to saying "window_id" instead of just "window"
when dealing with native window handles. Also get rid of using
GdkNativeWindow and simply consistently use guint32 all over the
place. This is more obvious and consistent and keeps the diff to the
gtk3-port branch smaller.
2011-02-06 12:07:55 +01: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 769c4f925a app/core/gimp-gui.[ch] app/widgets/gimphelp.[ch] app/gui/gui-vtable.c
2008-06-10  Sven Neumann  <sven@gimp.org>

	* app/core/gimp-gui.[ch]
	* app/widgets/gimphelp.[ch]
	* app/gui/gui-vtable.c
	* app/gui/gui.c: added a GimpProgress parameter to gimp_help().

	* app/actions/help-commands.c
	* app/widgets/gimpuimanager.c
	* tools/pdbgen/pdb/help.pdb: changed accordingly.

	* app/pdb/help-cmds.c: regenerated.

svn path=/trunk/; revision=25908
2008-06-10 09:54:54 +00:00
Sven Neumann 26d1021e77 Properly pass the focus from the core to plug-in dialogs:
2008-03-27  Sven Neumann  <sven@gimp.org>

	Properly pass the focus from the core to plug-in dialogs:

	* libgimpbase/gimpprotocol.[ch]: added a user_time member to the
	GimpConfig struct. Bumped the protocol version to 0x0012.

	* app/core/gimp-gui.[ch]
	* app/gui/gui-vtable.c: added gimp_get_user_time() to get the
	timestamp of the last user interaction.

	* app/plug-in/gimppluginmanager-call.c
	(gimp_plug_in_manager_call_run): pass the timestamp to in the
	GimpConfig message.

	* libgimp/gimp.[ch]:
	* libgimp/gimp.def: added method to access the timestamp as set
	in the config message.

	* libgimp/gimpui.c (gimp_ui_init): construct a fake startup ID and
	set the DESKTOP_STARTUP_ID environment variable.

svn path=/trunk/; revision=25263
2008-03-27 16:30:29 +00:00
Sven Neumann 76afd97769 app/core/gimp-gui.[ch] added gimp_get_empty_display() to the vtable.
2008-03-25  Sven Neumann  <sven@gimp.org>

	* app/core/gimp-gui.[ch]
	* app/gui/gui-vtable.c: added gimp_get_empty_display() to the vtable.

	* app/file/file-open.c (file_open_from_command_line): use the
	empty display as progress window when opening an image from the
	command-line or via the DBus interface.

svn path=/trunk/; revision=25219
2008-03-25 10:50:42 +00:00
Sven Neumann 3344c1b3bc Do not any longer keep the document history in two places. We only use
2008-03-24  Sven Neumann  <sven@gimp.org>

	Do not any longer keep the document history in two places. We 
only
	use GtkRecentManager now:

	* app/core/Makefile.am
	* app/core/gimp-documents.[ch]: removed these files.

	* app/core/gimpdocumentlist.c: removed code to load and save the
	"documents" file.
	(gimp_document_list_add_uri): call gimp_recent_list_add_uri() 
here.

	* app/core/gimpimagefile.[ch]: added function to set the 
mime-type.

	* app/core/gimp.c (gimp_restore): removed code to load the
	document history.
	(gimp_real_exit): removed code to save it.
	
	* app/core/gimp-gui.[ch]: extended the vtable with a method to
	populate the document list.

	* app/gui/gui-vtable.c: added code to populate the document 
history
	from the list of recently used files kept by GtkRecentManager.

	* app/gui/gui.c (gui_restore_callback): load the recent files 
here.

	* app/file/file-open.c
	* app/file/file-save.c: no need to call 
gimp_recent_list_add_uri()
	any longer as gimp_document_list_add_uri() does that for us now.

	* app/actions/documents-commands.c 
(documents_clear_cmd_callback):
	purge the items from GtkRecentManager. Also changed the dialog 
to
	emphasize that this operation now affects the document history 
in
	all applications.

	* docs/gimp.1.in: removed reference to "documents" file.


svn path=/trunk/; revision=25190
2008-03-24 11:11:15 +00:00
Michael Natterer cee3baea0f First draft of the "no image open" window, which is implemented as a
2008-03-18  Michael Natterer  <mitch@gimp.org>

	First draft of the "no image open" window, which is implemented as
	a display without image (a view with NULL model). Didn't change
	the display's appearance yet so I can first make sure the display
	without image works properly in all details before hiding these
	details.

	* app/core/gimp-gui.[ch]: add "gimp" parameter to display_create()
	and allow "image" to be NULL.

	* app/core/gimpcontext.c (gimp_context_real_set_display): a
	display's image can be NULL now.

	* app/display/gimpdisplay.[ch]: add Gimp and GimpDisplayConfig
	members.  Add Gimp parameter to gimp_display_shell_new(). Changed
	gimp_display_reconnect() to gimp_display_set_image() and allow to
	set a NULL image.

	* app/gui/gui-vtable.c (gui_display_create): if there is a single
	display without an image, call gimp_display_set_image() on that
	display instead of creating a new one.

	* app/display/gimpdisplayshell-close.c: if the last display is
	closed, don't close it but make it empty. Factored out that code
	to gimp_display_shell_really_close().

	* app/display/gimpdisplayshell-dnd.c: when dropping uris on an
	empty display, open the first one into that display and the other
	ones as layers of the newly opened image. This is consistent with
	dropping on an existing image but maybe needs some discussion.

	* app/display/gimpdisplayshell-callbacks.c: bail out early in the
	tool event callback so tools never have to deal with empty
	displays. In expose(), draw the drop zone on the empty display.

	* app/display/gimpdisplayshell-title.c: set the empty display's
	title to "Gimp - Drop Files".

	* app/display/gimpdisplay-foreach.c
	* app/display/gimpdisplay-handlers.c
	* app/display/gimpdisplayshell-appearance.c
	* app/display/gimpdisplayshell-autoscroll.c
	* app/display/gimpdisplayshell-callbacks.c
	* app/display/gimpdisplayshell-cursor.c
	* app/display/gimpdisplayshell-dnd.c
	* app/display/gimpdisplayshell-draw.c
	* app/display/gimpdisplayshell-filter-dialog.c
	* app/display/gimpdisplayshell-handlers.c
	* app/display/gimpdisplayshell-layer-select.c
	* app/display/gimpdisplayshell-preview.c
	* app/display/gimpdisplayshell-render.c
	* app/display/gimpdisplayshell-scale.c
	* app/display/gimpdisplayshell-scroll.c
	* app/display/gimpdisplayshell-selection.c
	* app/display/gimpdisplayshell-title.c
	* app/display/gimpdisplayshell.c
	* app/display/gimpnavigationeditor.c
	* app/display/gimpstatusbar.c: use display->gimp and
	display->config instead of going via the image. Guard against
	empty displays in some few places (most places can't be
	called). Where needed, use the canvas' dimensions instead of the
	image's dimensions so scroll offsets and scrollbars still have
	sane values instead of the last image's ones.

	* app/actions/actions.c (action_data_get_gimp)
	(action_data_get_context): use display->gimp instead of
	display->image->gimp.

	* app/actions/edit-commands.c (edit_paste_cmd_callback): redirect
	to "paste as new" if there is an empty display.

	* app/actions/tools-commands.c (tools_select_cmd_callback): don't
	initialize the new tool on an empty display.

	* app/actions/view-actions.c (view_actions_update): changed lots
	of sensitivity settings to be insensitive when there is no image
	(instead of no display).

	* app/actions/view-commands.c: use the display's config object
	instead of gimp's.


svn path=/trunk/; revision=25113
2008-03-18 21:22:21 +00:00
Nils Philippsen 8ff9c4c84c drop own recently used files code in favour of GtkRecentManager:
* app/core/gimp-gui.c (gimp_recent_list_add_uri), app/core/gimp-gui.h,
app/gui/gui-vtable.c (gui_recent_list_add_uri): add
{gimp,gui}_recent_list_add_uri(), gui_recent_list_add_uri() dispatches to
GtkRecentManager

* app/dialogs/file-save-dialog.c (file_save_dialog_save_image),
app/actions/file-commands.c (file_save_cmd_callback),
app/widgets/gimpdnd-xds.c (gimp_dnd_xds_save_image): pass Gimp instance to
file_save() calls

* app/file/file-open.c (file_open_with_proc_and_display,
file_open_layers), app/file/file-save.c (file_save), app/file/file-save.h:
pass Gimp instance to gimp_recent_list_add_uri() calls

* app/file/gimprecentitem.c, app/file/gimprecentitem.h,
app/file/gimprecentlist.c, app/file/gimprecentlist.h: removed

* app/file/Makefile.am: drop reference to removed files

svn path=/trunk/; revision=23526
2007-09-13 14:19:30 +00:00
Sven Neumann 41237259c9 In all files, changed the standard copyright notice to say "GIMP - The GNU
2006-12-09  Sven Neumann  <sven@gimp.org>

        * In all files, changed the standard copyright notice to say
        "GIMP - The GNU Image Manipulation Program".
2006-12-09 21:33:38 +00:00
Michael Natterer f5afb754a5 Added message severities and make sure all messages are routed through a
2006-10-09  Michael Natterer  <mitch@gimp.org>

	Added message severities and make sure all messages are routed
	through a central function, so redirecting to the error console or
	stderr work again:

	* app/core/core-enums.[ch]: added enum GimpMessageSeverity { INFO,
	WARNING, ERROR }.

	* app/core/gimp.[ch] (gimp_message)
	(gimp_message_valist): added severity parameter. Changed
	"GimpProgress *progress" parameter to "GObject *handler", where
	"handler" can be either a GimpProgress, a GtkWidget or NULL.

	* app/core/gimp-gui.[ch] (gimp_show_message): ditto. Honor
	--console-messages again. Always dispatch to the GUI message
	handler first if it exists.

	* app/gui/gui-message.[ch]: pass severity parameters around.

	(gui_message_error_dialog): if "handler" is a progress, dispatch
	the message to it first. If it is a widget (and *not* a progress),
	use a GtkMessageDialog on top of that widget's toplevel. Fall
	back to the usual GimpErrorDialog otherwise.

	* app/core/gimpprogress.[ch] (gimp_progress_message): added
	severity parameter. Also added boolean return value to the virtual
	function so it can decide to fail if it can't handle the message.

	* app/display/gimpdisplay.c: implement GimpProgress::message() and
	redirect the message to GimpDisplayShell.

	* app/display/gimpdisplayshell-progress.c: implement
	GimpProgress::message() and redirect the message to GimpStatusbar
	if it is not an error and if the status bar is visible.

	* app/display/gimpstatusbar.[ch]: implement GimpProgress::message(),
	but fail on messages that contain a newline. Show the right icons
	for the message severities (work in progress).

	* app/display/gimpdisplayshell.[ch]: removed
	gimp_display_shell_message() and its _valist() variant.

	* app/widgets/gimperrorconsole.[ch]: show the right icons for the
	message severities.

	* app/widgets/gimpthumbbox.c (gimp_thumb_box_progress_message):
	return TRUE to swallow all messages.

	* app/widgets/gimpwidgets-utils.[ch]: removed
	gimp_show_message_dialog(). Added gimp_get_message_stock_id().

	* app/errors.c
	* app/actions/edit-commands.c
	* app/actions/error-console-commands.c
	* app/actions/file-commands.c
	* app/actions/select-commands.c
	* app/actions/text-editor-commands.c
	* app/actions/vectors-commands.c
	* app/core/gimpimage-convert.c
	* app/core/gimpimagefile.c
	* app/dialogs/convert-dialog.c
	* app/dialogs/file-open-dialog.c
	* app/dialogs/file-open-location-dialog.c
	* app/dialogs/file-save-dialog.c
	* app/dialogs/palette-import-dialog.c
	* app/dialogs/stroke-dialog.c
	* app/display/gimpdisplayshell-dnd.c
	* app/pdb/gimppdb.c
	* app/plug-in/gimpplugin.c
	* app/tools/gimpimagemaptool.c
	* app/tools/gimptool.c
	* app/tools/gimpvectortool.c
	* app/widgets/gimpactionview.c
	* app/widgets/gimpcontrollerlist.c
	* app/widgets/gimppdbdialog.c
	* app/widgets/gimpvectorstreeview.c
	* app/xcf/xcf-load.c
	* app/xcf/xcf-save.c
	* app/xcf/xcf.c
	* tools/pdbgen/pdb/brush.pdb
	* tools/pdbgen/pdb/gradient.pdb
	* tools/pdbgen/pdb/image.pdb
	* tools/pdbgen/pdb/message.pdb
	* tools/pdbgen/pdb/palette.pdb: added severity parameter to
	gimp_message() calls. Convert all calls to
	gimp_show_message_dialog() and gimp_display_shell_message() to
	gimp_message(). Also converted some more g_message() calls.

	* app/pdb/brush_cmds.c
	* app/pdb/gradient_cmds.c
	* app/pdb/image_cmds.c
	* app/pdb/message_cmds.c
	* app/pdb/palette_cmds.c: regenerated.
2006-10-09 08:17:22 +00:00
Sven Neumann a69c1ff174 app/gui/gui-message.c moved utility function to gimpwidgets-utils.
2006-09-22  Sven Neumann  <sven@gimp.org>

	* app/gui/gui-message.c
	* app/widgets/gimpwidgets-utils.[ch]: moved utility function to
	gimpwidgets-utils.

	* app/core/gimp-gui.[ch]
	* app/gui/gui-vtable.c: added a progress parameter to
	gimp_pdb_dialog_new() and make the dialog transient to the progress
	window.

	* tools/pdbgen/pdb/brush_select.pdb
	* tools/pdbgen/pdb/font_select.pdb
	* tools/pdbgen/pdb/gradient_select.pdb
	* tools/pdbgen/pdb/palette_select.pdb
	* tools/pdbgen/pdb/pattern_select.pdb: pass progress to
	gimp_pdb_dialog_new().

	* app/pdb/brush_select_cmds.c
	* app/pdb/font_select_cmds.c
	* app/pdb/gradient_select_cmds.c
	* app/pdb/palette_select_cmds.c
	* app/pdb/pattern_select_cmds.c: regenerated.

	* libgimp/gimpselectbutton.c: cosmetics.
2006-09-22 09:24:41 +00:00
Sven Neumann 188bbe5d37 app/app_procs.[ch] initialize the error subsystem after the gimp object
2006-09-09  Sven Neumann  <sven@gimp.org>

	* app/app_procs.[ch]
	* app/main.c: initialize the error subsystem after the gimp
object
	has been created.

	* app/errors.[ch]: store a reference to the gimp object (eek)
and
	use it to call gimp_gui_ungrab() before g_on_error_query().

	* app/core/gimp-gui.[ch]
	* app/gui/gui-vtable.c: added gimp_gui_ungrab().
2006-09-09 16:36:15 +00:00
Sven Neumann 504fe2ccac app/core/gimp-gui.[ch] renamed gimp_message() to gimp_show_message()
2006-08-08  Sven Neumann  <sven@gimp.org>

	* app/core/gimp-gui.[ch]
	* app/gui/gui-vtable.c: renamed gimp_message() to
gimp_show_message()

	* app/errors.c
	* tools/pdbgen/pdb/message.pdb: changed accordingly.

	* app/pdb/message_cmds.c: regenerated.
2006-08-08 18:18:40 +00:00
Sven Neumann 6d922b21dc Make message dialogs transient for the progress window. Addresses bug
2006-07-19  Sven Neumann  <sven@gimp.org>

	Make message dialogs transient for the progress window.
Addresses
	bug #347214.

	* app/core/gimp-gui.[ch]: added a progress parameter to
	gimp_message().  Let gimp_message() deal with optionally
	delegating the message to gimp_progress_message().

	* app/errors.c: changed accordingly.

	* app/core/gimpprogress.[ch] (gimp_progress_message): return a
	boolean indicating whether the message was handled.

	* app/gui/Makefile.am
	* app/gui/gui-message.[ch]
	* app/gui/gui-vtable.c: moved message handling to a new file.
Only
	use the global error dialog for messages without a progress.
	Otherwise attach an error dialog to the progress and try to make
	it transient to the progress window.

	* tools/pdbgen/pdb/message.pdb:
	* app/plug-in/gimpplugin-progress.[ch]: don't delegate messages
to
	the progress interface, this is handled by gimp_message() now.

	* app/pdb/message_cmds.c: regenerated.

	* app/plug-in/gimpplugin.c
	* app/actions/documents-commands.c: formatting.
2006-07-19 06:50:34 +00:00
Michael Natterer 808b65cd31 added signals "plug-in-opened" and "plug-in-closed". Added functions
2006-05-05  Michael Natterer  <mitch@gimp.org>

	* app/plug-in/gimppluginmanager.[ch]: added signals
	"plug-in-opened" and "plug-in-closed". Added functions
	gimp_plug_in_manager_add_open_plug_in() and _remove_open_plugin()
	which maintain the list of open plug-ins and emit the signals.

	* app/plug-in/gimpplugin.c (gimp_plug_in_open)
	(gimp_plug_in_close): don't touch manager->open_plug_ins and don't
	ref/unref the plug-in. Call above new functions instead. Don't
	call gimp_pdb_dialogs_check().

	* app/core/gimp-gui.[ch]
	* app/gui/gui-vtable.c: removed gimp_pdb_dialogs_check().

	* app/widgets/gimppdbdialog.[ch]: removed
	gimp_pdb_dialogs_check_callback() and connect to the
	plug-in-manager's "plug-in-closed" signal instead.
2006-05-04 22:51:21 +00:00
Michael Natterer f1c3e79a4b app/plug-in/Makefile.am app/plug-in/plug-in-types.h new object which keeps
2006-04-29  Michael Natterer  <mitch@gimp.org>

	* app/plug-in/Makefile.am
	* app/plug-in/plug-in-types.h
	* app/plug-in/gimppluginmanager.[ch]: new object which keeps all
	plug-in related stuff that was kept in the Gimp instance. Has
	"menu-branch-added" and "last-plug-in-changed" signals.

	* app/plug-in/plug-ins.[ch]: removed, all its functions are in
	GimpPlugInManager now.

	* app/core/gimpmarshal.list: new marshaller for the new object.

	* app/core/gimp.[ch]: removed all plug-in related stuff and keep a
	GimpPlugInManager around.

	* app/plug-in/plug-in-data.[ch]
	* app/plug-in/plug-in-file.[ch]
	* app/plug-in/plug-in-help-domain.[ch]
	* app/plug-in/plug-in-locale-domain.[ch]
	* app/plug-in/plug-in-menu-branch.[ch]
	* app/plug-in/plug-ins-query.[ch]: removed...

	* app/plug-in/gimppluginmanager-data.[ch]
	* app/plug-in/gimppluginmanager-file.[ch]
	* app/plug-in/gimppluginmanager-help-domain.[ch]
	* app/plug-in/gimppluginmanager-locale-domain.[ch]
	* app/plug-in/gimppluginmanager-menu-branch.[ch]
	* app/plug-in/gimppluginmanager-query.[ch]: ...and added as
	methods of GimpPlugInManager.

	* app/plug-in/plug-in-debug.[ch]
	* app/plug-in/plug-in-shm.[ch]: removed...

	* app/plug-in/gimpplugindebug.[ch]
	* app/plug-in/gimppluginshm.[ch]: ...and added as properly
	namespeced structs with constructors and destructors.

	* app/core/Makefile.am
	* app/core/gimpenvirontable.[ch]
	* app/core/gimpinterpreterdb.[ch]: removed...

	* app/plug-in/gimpenvirontable.[ch]
	* app/plug-in/gimpinterpreterdb.[ch]: ...and added here unchanged.

	* app/core/gimp-gui.[ch]
	* app/gui/gui-vtable.c: remove gimp_menus_create_branch() and all
	related stuff.

	* app/actions/plug-in-actions.[ch]: connect to the
	plug-in-manager's "menu-path-added" signal and create menu branch
	actions accordingly.

	* app/plug-in/plug-in-context.c
	* app/plug-in/plug-in-message.c
	* app/plug-in/plug-in-progress.c
	* app/plug-in/plug-in-run.[ch]
	* app/plug-in/plug-in.[ch]
	* app/app_procs.c
	* app/actions/file-commands.c
	* app/actions/plug-in-commands.c
	* app/core/gimpimage.c
	* app/dialogs/file-open-location-dialog.c
	* app/dialogs/file-save-dialog.c
	* app/file/file-open.c
	* app/gui/gui.c
	* app/menus/plug-in-menus.c
	* app/pdb/gimppluginprocedure.c
	* app/pdb/gimptemporaryprocedure.c
	* app/widgets/gimpdnd-xds.c
	* app/widgets/gimpfiledialog.c
	* app/widgets/gimpfileprocview.c
	* app/widgets/gimphelp.c
	* app/widgets/gimpthumbbox.c
	* app/xcf/xcf.c
	* tools/pdbgen/pdb/context.pdb
	* tools/pdbgen/pdb/drawable.pdb
	* tools/pdbgen/pdb/fileops.pdb
	* tools/pdbgen/pdb/help.pdb
	* tools/pdbgen/pdb/message.pdb
	* tools/pdbgen/pdb/plug_in.pdb
	* tools/pdbgen/pdb/procedural_db.pdb
	* tools/pdbgen/pdb/progress.pdb
	* tools/pdbgen/pdb/undo.pdb: follow above refactoring.

	* app/pdb/context_cmds.c
	* app/pdb/drawable_cmds.c
	* app/pdb/fileops_cmds.c
	* app/pdb/help_cmds.c
	* app/pdb/message_cmds.c
	* app/pdb/plug_in_cmds.c
	* app/pdb/procedural_db_cmds.c
	* app/pdb/progress_cmds.c
	* app/pdb/undo_cmds.c: regenerated.
2006-04-28 22:26:51 +00:00
Michael Natterer 305ada6354 new function which returns string arrays of all registered locale domains
2006-04-27  Michael Natterer  <mitch@gimp.org>

	* app/plug-in/plug-in-locale-domain.[ch] (plug_in_locale_domains):
	new function which returns string arrays of all registered locale
	domains and paths.

	(plug_in_standard_locale_domain): removed this function. The
	standard plug-in domain is included in the domains returned by
	plug_in_locale_domains().

	* app/plug-in/plug-ins.c (plug_ins_init): simply bind the text
	domains here instead of calling gimp_menus_init(). Destroy
	gimp->plug_in_defs much earlier.

	* app/core/gimp-gui.[ch]
	* app/gui/gui-vtable.c: removed gimp_menus_init().

	* app/menus/plug-in-menus.[ch]: removed plug_in_menus_init(),
	binding text domains is completely done in the core now.
2006-04-27 21:53:33 +00:00
Michael Natterer ee66f2f31d Added some signals inspired by Rockwalrus' libpdb:
2006-04-27  Michael Natterer  <mitch@gimp.org>

	Added some signals inspired by Rockwalrus' libpdb:

	* app/pdb/gimppdb.[ch]: added signals "register-procedure" and
	"unregister-procedure".

	* app/pdb/gimppluginprocedure.[ch]: added signal "menu-path-added".

	* app/actions/plug-in-actions.[ch]
	* app/menus/plug-in-menus.[ch]: connect to the new signals and
	create/destroy plug-in actions and menus accordingly. Made all
	needed functions private and merged some of them with the newly
	added signal callbacks.

	* app/core/gimp-gui.[ch]
	* app/gui/gui-vtable.c: removed gimp_menus_create_item() and
	gimp_menus_delete_item() and all related stuff.

	* app/plug-in/plug-in.c
	* app/plug-in/plug-ins.c: removed calls to the removed functions.

	* app/plug-in/plug-ins.c (plug_ins_init): add the plug-in
	procedures to the PDB *after* calling gimp_menus_init() so their
	locale domains are properly initialized when the menus are
	created.
2006-04-27 19:36:13 +00:00
Michael Natterer 086d0b6371 app/plug-in/plug-in-types.h renamed to GimpPlugInProcedure and made a
2006-04-05  Michael Natterer  <mitch@gimp.org>

	* app/plug-in/plug-in-types.h
	* app/plug-in/plug-in-proc-def.[ch]: renamed to GimpPlugInProcedure
	and made a GObject derived from GimpProcedure (instead of having
	a pointer to a GimpProcedure). Added image_types and file_magic
	utility functions taken from plug-ins.[ch]. Still lives in the
	same crappy files because I am undecided where to put it...

	* app/pdb/gimpprocedure.c (gimp_procedure_real_execute): removed
	switch() statement and always call the internal marshaller because
	GimpProcedure::execute() is properly overridden by
	GimpPlugInProcedure now.

	* app/plug-in/plug-ins.[ch]: removed the mime_type and file_magic
	utilities added to GimpPlugInProcedure.

	* app/actions/file-commands.c
	* app/actions/plug-in-actions.[ch]
	* app/actions/plug-in-commands.[ch]
	* app/core/gimp-gui.[ch]
	* app/core/gimp.[ch]
	* app/core/gimpimage.[ch]
	* app/dialogs/file-open-dialog.c
	* app/dialogs/file-save-dialog.c
	* app/dialogs/print-size-dialog.c
	* app/file/file-open.[ch]
	* app/file/file-save.[ch]
	* app/file/file-utils.[ch]
	* app/gui/gui-vtable.c
	* app/menus/plug-in-menus.[ch]
	* app/plug-in/plug-in-def.[ch]
	* app/plug-in/plug-in-message.c
	* app/plug-in/plug-in-rc.c
	* app/plug-in/plug-in-run.c
	* app/plug-in/plug-in.c
	* app/plug-in/plug-ins-query.c
	* app/widgets/gimpactiongroup.[ch]
	* app/widgets/gimpdnd-xds.c
	* app/widgets/gimpfiledialog.[ch]
	* app/widgets/gimpfileprocview.[ch]
	* app/widgets/gimppluginaction.[ch]
	* app/xcf/xcf.c
	* tools/pdbgen/pdb/fileops.pdb
	* tools/pdbgen/pdb/plug_in.pdb: changed addordingly.

	* app/pdb/fileops_cmds.c
	* app/pdb/plug_in_cmds.c: regenerated.
2006-04-05 08:38:33 +00:00
Sven Neumann 5439aa4995 did a global gdisp -> display substitution.
2006-03-28  Sven Neumann  <sven@gimp.org>

	* app/*: did a global gdisp -> display substitution.
2006-03-28 17:55:52 +00:00
Sven Neumann 905fdfcbed did a global gimage -> image substitution.
2006-03-28  Sven Neumann  <sven@gimp.org>

	* app/*: did a global gimage -> image substitution.
2006-03-28 17:08:36 +00:00
Michael Natterer acdae9b354 app/core/gimp-gui.[ch] app/gui/gui-vtable.c pass displays around as
2006-03-23  Michael Natterer  <mitch@gimp.org>

	* app/core/gimp-gui.[ch]
	* app/gui/gui-vtable.c
	* app/plug-in/plug-in-progress.[ch]: pass displays around as
	GimpObject, not as integer IDs.

	* tools/pdbgen/pdb/progress.pdb: changed accordingly.

	* app/pdb/progress_cmds.c
	* libgimp/gimpprogress_pdb.c: regenerated.
2006-03-23 21:56:13 +00:00
Sven Neumann 489aebab5e app/core/gimp-gui.h app/core/gimp-utils.h app/core/gimpimage-undo.h
2005-09-27  Sven Neumann  <sven@gimp.org>

	* app/core/gimp-gui.h
	* app/core/gimp-utils.h
	* app/core/gimpimage-undo.h
	* app/text/gimptextlayer.h
	* app/widgets/gimpeditor.h
	* app/widgets/gimpmenufactory.h
	* app/widgets/gimpmessagedialog.h
	* app/widgets/gimpsessioninfo.h
	* app/widgets/gimptooldialog.h
	* app/widgets/gimpviewabledialog.h: use G_GNUC_NULL_TERMINATED
	where appropriate.
2005-09-27 17:31:32 +00:00
Sven Neumann ec56ef9d01 Address bug #307971:
2005-09-05  Sven Neumann  <sven@gimp.org>

	Address bug #307971:

	* app/core/gimp-gui.[ch]
	* app/display/gimpdisplay.[ch]
	* app/gui/gui-vtable.c
	* tools/pdbgen/pdb/display.pdb: added PDB function to obtain a
	window handle on an image display.

	* app/pdb/display_cmds.c
	* app/pdb/internal_procs.c
	* libgimp/gimpdisplay_pdb.[ch]: regenerated.

	* libgimp/gimpui.[ch]: added functions to set a GtkWindow transient
	to an image display.

	* plug-ins/common/gauss.c: use the new function exemplarily.

	* libgimp/gimp.def
	* libgimp/gimpui.def: updated.
2005-09-05 20:47:12 +00:00
Michael Natterer 0a5ce16b84 Added API to explicitly register dynamic menu items hierarchies. Fixes bug
2005-03-24  Michael Natterer  <mitch@gimp.org>

	Added API to explicitly register dynamic menu items hierarchies.
	Fixes bug #170623.

	* app/core/gimp.h: added "GSList *plug_in_menu_branches".

	* app/plug-in/plug-in-types.h

	* app/plug-in/plug-ins.[ch]: added API to register plug-in menu
	branches, just as for locale and help domans. Cleaned up handling
	of locale and help domains.

	(plug_ins_exit): free the registered menu branches.

	* app/actions/plug-in-actions.[ch] (plug_in_actions_add_branch):
	new function to explicitly add a menu branch action.

	(plug_in_actions_setup): add the registered menu branches to each
	new action group.

	(plug_in_actions_build_path): always strip the untranslated menu
	path from underlines before using it as hash table key or action
	name.

	* app/menus/plug-in-menus.c (plug_in_menus_add_proc): changed
	accordingly: strip underlines from untranslated menu paths before
	passing them to plug_in_menus_build_path().

	* app/core/gimp-gui.[ch]: added gimp_menus_create_branch() plus
	vtable entry to access the new stuff from the core. Renamed the
	functions desling with items from gimp_foo_entry() to
	gimp_foo_item().

	* app/gui/gui-vtable.c: implement create_branch() and add the
	branch action to all existing "plug-in" action groups. Note that
	we don't need to create any menus because that happens implicitly
	when adding menu items.

	* tools/pdbgen/pdb/plug_in.pdb (plugin_menu_branch_register): new
	PDB wrapper to access branch registering from plug-ins.

	* app/pdb/internal_procs.c
	* app/pdb/plug_in_cmds.c
	* libgimp/gimpplugin_pdb.[ch]: regenerated.

	* libgimp/gimp.def: changed accordingly.

	* plug-ins/script-fu/script-fu-scripts.c (script_fu_find_scripts):
	register the menu branches for all included scripts.
2005-03-24 16:08:04 +00:00
Michael Natterer d871be74bf Made plug-in menu registration work the same way for ordinary and
2004-11-17  Michael Natterer  <mitch@gimp.org>

	Made plug-in menu registration work the same way for ordinary and
	temporary procedures. Addresses bug #158117.

	* app/core/gimp-gui.[ch]: added "const gchar *menu_path" to
	gimp_menus_create_entry().

	* app/gui/gui-vtable.c (gui_menus_create_entry): if menu_path is
	NULL, behave as before and create an action and its menu entries
	for all the procedure's menu_paths. If it is non-NULL, skip action
	creation and create a menu entry just for that path.

	* app/plug-in/plug-ins.c (plug_ins_temp_proc_def_add): call
	gimp_menus_create_entry() with a NULL menu path and call it if
	proc_def->menu_paths *or* proc_def->menu_label is non-NULL, so
	it creates at least the procedure's action, even if it has
	no menu_path (yet).

	* tools/pdbgen/pdb/plug_in.pdb (plugin_menu_register): check both
	the list of procs and temp_procs when trying to register the
	entry.  Allow ordinary procedures and extensions to install stuff
	at query() and init() time and allow temp_procs to install stuff
	at any time.

	* app/pdb/plug_in_cmds.c: regenerated.
2004-11-17 14:51:50 +00:00
Michael Natterer ca30f73817 added "display_ID" to gimp_new_progress().
2004-08-11  Michael Natterer  <mitch@gimp.org>

	* app/core/gimp-gui.[ch]: added "display_ID" to gimp_new_progress().

	* app/gui/gui-vtable.c: changed accordingly.

	* app/plug-in/plug-in-progress.[ch]: reenabled showing the
	progress in a particular display.
2004-08-11 09:36:51 +00:00
Michael Natterer 02d2b990f5 Redid the whole internal progress stuff: don't pass around
2004-08-10  Michael Natterer  <mitch@gimp.org>

	Redid the whole internal progress stuff: don't pass around
	progress_callback and progress_data; instead, provide a
	pointer to a GimpProgressInterface which can be implemented
	by a variety of backends.

	Addresses (but not yet fixes) bugs #6010, #97266 and #135185.

	* app/display/Makefile.am
	* app/display/gimpprogress.[ch]: removed the old progress hack.

	* app/core/Makefile.am
	* app/core/core-types.h
	* app/core/gimpprogress.[ch]: implement GimpProgressInterface.

	* app/widgets/Makefile.am
	* app/widgets/widgets-types.h
	* app/widgets/gimpprogressdialog.[ch]: the standalone progress
	dialog as widget implementing GimpProgressInterface.

	* app/display/gimpdisplay.c
	* app/display/gimpstatusbar.[ch]
	* app/widgets/gimpfiledialog.[ch]
	* app/widgets/gimpthumbbox.[ch]: added GimpProgressInterface
	implementation to these classes.

	* app/core/gimp-gui.[ch]
	* app/gui/gui-vtable.c: replaced the old progress vtable entries
	by two new to create and destroy a GimpProgressDialog in case
	no other progress is available.

	* app/pdb/procedural_db.[ch]
	* app/plug-in/plug-in-run.[ch]
	* tools/pdbgen/app.pl: pass a GimpProgress to all PDB wrappers and
	all plug-ins.

	* app/plug-in/plug-in.[ch]
	* app/plug-in/plug-ins.c
	* app/plug-in/plug-in-message.c
	* app/plug-in/plug-in-progress.c: handle the case there the
	plug-in was crated with a progress as well as the case where it
	wasn't.

	* app/app_procs.c
	* app/batch.c
	* app/xcf/xcf.c
	* app/file/file-open.[ch]
	* app/file/file-save.[ch]
	* app/widgets/gimphelp.c
	* app/widgets/gimpbrushselect.c
	* app/widgets/gimpfontselect.c
	* app/widgets/gimpgradientselect.c
	* app/widgets/gimppaletteselect.c
	* app/widgets/gimppatternselect.c: changed accordingly.

	* app/core/gimpimagefile.[ch]
	* app/display/gimpdisplayshell-dnd.c
	* app/gui/file-open-dialog.c
	* app/gui/file-open-location-dialog.c
	* app/gui/file-save-dialog.c
	* app/widgets/gimplayertreeview.c
	* app/widgets/gimptoolbox-dnd.c: pass a GimpProgress to all file
	related functions. Embed the progress in the file dialog where
	possible.

	* app/core/gimpdrawable-blend.[ch]
	* app/core/gimpdrawable-transform.[ch]
	* app/core/gimpimage-convert.[ch]
	* app/core/gimpimage-flip.[ch]
	* app/core/gimpimage-resize.[ch]
	* app/core/gimpimage-rotate.[ch]
	* app/core/gimpimage-scale.[ch]
	* app/core/gimpitem-linked.[ch]
	* app/core/gimpitem.[ch]
	* app/core/gimpchannel.c
	* app/core/gimpdrawable.c
	* app/core/gimplayer.c
	* app/core/gimpselection.c
	* app/vectors/gimpvectors.c: replaced callback/data by GimpProgress.

	* app/tools/gimpblendtool.c
	* app/tools/gimptransformtool.c
	* app/gui/convert-dialog.c
	* app/actions/documents-commands.c
	* app/actions/file-commands.c
	* app/actions/image-commands.c
	* app/actions/layers-commands.c
	* app/actions/plug-in-commands.c
	* app/actions/vectors-commands.c
	* tools/pdbgen/pdb/convert.pdb
	* tools/pdbgen/pdb/edit.pdb
	* tools/pdbgen/pdb/image.pdb
	* tools/pdbgen/pdb/layer.pdb: changed callers accordingly.

	* app/pdb/*_cmds.c: regenerated.
2004-08-10 18:47:21 +00:00
Michael Natterer 509a6c57c5 app/core/Makefile.am new files defining a GimpGui vtable struct and
2004-07-12  Michael Natterer  <mitch@gimp.org>

	* app/core/Makefile.am
	* app/core/gimp-gui.[ch]: new files defining a GimpGui vtable
	struct and contianing all the vtable wrapper functions. Reordered
	and renamed some functions for consistency.

	* app/core/gimp.[ch]: removed all the vtable code.

	* app/gui/gui-vtable.c: changed accordingly.
2004-07-12 11:41:19 +00:00