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.
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.
This reverts commit 94b028bc39c7250997ee9883793e6649bf2490c7.
Dunno what breaks here, it just crashes, leave the commits there
instead of rebasing them away, as reminder...
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.
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).
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).
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.
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.
- don't include <gdk-pixbuf/gdk-pixbuf.h> in headers in app/
- instead, include it in many .c files instead of <glib-object.h>,
finally acknowledging the fact that app/ depends on gdk-pixbuf almost
globally
- fix up includes as if libgimpbase depended in GIO, which it soon will
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.
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.
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
2008-10-09 Michael Natterer <mitch@gimp.org>
Add GEGL_CFLAGS and #includes as if gimpdrawable.h and gimpimage.h
had a GEGL dependency (they will have in the next commit, but I
wanted to keep the commit separate).
* app/dialogs/Makefile.am
* app/file/Makefile.am
* app/gui/Makefile.am
* app/menus/Makefile.am
* app/paint/Makefile.am
* app/plug-in/Makefile.am
* app/text/Makefile.am
* app/vectors/Makefile.am
* app/widgets/Makefile.am
* app/xcf/Makefile.am: add GEGL_CFLAGS.
* app/actions/*.c
* app/core/*.c
* app/dialogs/*.c
* app/display/*.c
* app/file/*.c
* app/gui/*.c
* app/menus/*.c
* app/paint/*.c
* app/pdb/gimppdb-utils.c
* app/pdb/gimpprocedure.c
* app/plug-in/*.c
* app/text/*.c
* app/tools/*.c
* app/vectors/*.c
* app/widgets/*.c
* app/xcf/*.c: add <gegl.h> or replace <glib-object.h> by <gegl.h>
to all files which include a drawable subclass or gimpimage.h
* tools/pdbgen/app.pl: include <gegl.h> instead of <glib-object.h>
in all generated files.
* app/pdb/*-cmds.c: regenerated.
* data/images/gimp-splash.png: the goat is still sleeping.
By Aurore Derriennic.
svn path=/trunk/; revision=27202
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-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-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-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
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-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-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-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-05-09 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage.c (gimp_image_new)
* app/core/gimpitem.c (gimp_item_configure)
* app/display/gimpdisplay.c (gimp_display_new): make sure IDs wrap
correctly at G_MAXINT and skip IDs which are currently in use.
It makes no sense to treat gimp->image_table and gimp->images
differently, since they keep the same set of images. And it makes
no sense to treat gimp->displays and gimp->images differently.
Moved all container adding into the objects' constructors:
* app/core/gimp.c (gimp_create_image): don't add the new image
to gimp->images here...
* app/core/gimpimage.c (gimp_image_constructor): ...but here.
* app/core/gimp-gui.c (gimp_create_display): don't add the new
display to gimp->displays here...
* app/display/gimpdisplay.c (gimp_display_new): ...but here.
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-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 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-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.
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.