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
Call gimp_cpu_accel_set_use() in app_run(). Add "use_cpu_accel"
parameter to gimp_new() and keep it around in the Gimp instance. Pass
the flag to plug-ins again.
Initially contains antialias, feather and feather radius for the
upcoming gimp-item-to-selection preocedure. Keeping states in the
context reduces the number of parameters of procedures, and both the
state API and the API using the states can be changed/deprecated
independently. Make sure that all procedures and all plug-ins get
GimpPDBContexts instead of plain GimpContexts passed.
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-08-21 Sven Neumann <sven@gimp.org>
* app/plug-in/gimppluginprocedure.c
* app/plug-in/gimptemporaryprocedure.c: don't just free the
return
values when running procedures asynchronously. Instead examine
them and display the error message if there's one.
* app/plug-in/gimppluginmanager-call.c
(gimp_plug_in_manager_call_run_temp): return NULL if
procedure->plug_in is not set.
* app/plug-in/gimpplugin-message.c: comment.
svn path=/trunk/; revision=26700
2008-08-16 Sven Neumann <sven@gimp.org>
If a procedure call fails, pass a string describing the error as
the second return value. First step towars fixing bug #344818.
* app/pdb/gimpprocedure.[ch] (gimp_procedure_get_return_values):
added a GError parameter. If it is set, pass the error message
to
the return values.
* app/pdb/gimppdberror.h: added some more error codes.
* app/pdb/gimppdb.c
* app/xcf/xcf.c: pass errors to
gimp_procedure_get_return_values().
* app/plug-in/gimpplugin-message.c
(gimp_plug_in_handle_proc_run):
show a different error message for execution vs. calling errors.
* app/plug-in/gimpplugin-progress.c
(gimp_plug_in_progress_cancel_callback): pass the error
GIMP_PDB_CANCELLED to gimp_procedure_get_return_values().
* app/plug-in/gimppluginmanager-call.[ch]
(gimp_plug_in_manager_call_run): removed the
'destroy_return_vals'
parameter.
* app/plug-in/gimppluginprocedure.c: destroy the return values
here.
* app/plug-in/gimppluginprocframe.c: pass an error to
gimp_procedure_get_return_values().
* tools/pdbgen/app.pl
* tools/pdbgen/pdb/fileops.pdb: generate code that passes the
error to gimp_procedure_get_return_values().
* app/pdb/*-cmds.c: regenerated.
* plug-ins/pygimp/pygimp-pdb.c: extract the error message from
the
return values and pass it to the exception that is thrown.
svn path=/trunk/; revision=26593
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
2007-03-14 Michael Natterer <mitch@gimp.org>
* app/plug-in/gimpplugin.c (gimp_plug_in_new): require either
"procedure" or "prog" being non-NULL, not both of them at the same
time. Get the executable name from the procedure if the procedure
was passed.
* app/plug-in/gimppluginmanager-call.c
(gimp_plug_in_manager_call_run): pass a NULL prog since we already
pass the procedure.
svn path=/trunk/; revision=22122
2006-06-01 Sven Neumann <sven@gimp.org>
Added basic framework for plug-ins to access the use_cpu_accel
configuration (bug #342860):
* app/composite/gimp-composite.[ch]: added new function
gimp_composite_use_cpu_accel().
* libgimpbase/gimpprotocol.[ch]: added use_cpu_accel to the config
message.
* app/plug-in/gimppluginmanager-call.c: pass the return value of
gimp_composite_use_cpu_accel() for config.use_cpu_accel.
* libgimp/gimp.[ch]: make the config value accessible by means of
a new function gimp_use_cpu_accel().
* libgimp/gimp.def: updated.
2006-05-04 Michael Natterer <mitch@gimp.org>
* app/plug-in/gimppluginshm.c: cleaned up a bit.
(gimp_plug_in_shm_new): return NULL if anything goes wrong,
instead of a GimpPlugInShm structure that contains no shm (we
don't need multiple cases of "there is no shm"),
* app/plug-in/gimppluginmanager.[ch]
(gimp_plug_in_manager_get_shm_ID)
(gimp_plug_in_manager_get_shm_addr): removed these functions.
* app/plug-in/gimppluginmanager-call.c (gimp_plug_in_manager_call_run)
* app/plug-in/gimpplugin-message.c (gimp_plug_in_handle_tile_req):
get the shm ID and addr directly from manager->shm if it exists,
use -1 and NULL otherwise.
Unrelated:
* app/plug-in/gimppluginmanager.c: move most stuff from
gimp_plug_in_manager_exit() to gimp_plug_in_manager_finalize().
Simplify plug-in killing in _exit().
2006-05-04 Michael Natterer <mitch@gimp.org>
* app/plug-in/gimpplugin.c
* app/plug-in/gimppluginmanager-call.c: use the right procedure
types in calls to gimp_plug_in_proc_frame_foo().
2006-05-03 Michael Natterer <mitch@gimp.org>
Made an object out of the plug-in struct. Also change refcounting
considerably:
- gimp_plug_in_open() adds a reference that is only dropped by
gimp_plug_in_close().
- temporarily ref the plug-in while handling messages.
- remporarily ref the plug-in while a recursive main loop is
running.
- each caller of gimp_plug_in_new() also unrefs the plug-in before
returning, the only reference that persists across functions
(that keeps the plug-in alive) is the one added by open().
* app/plug-in/plug-in.[ch]
* app/plug-in/plug-in-context.[ch]
* app/plug-in/plug-in-message.[ch]
* app/plug-in/plug-in-progress.[ch]: removed these files...
* app/plug-in/gimpplugin.[ch]
* app/plug-in/gimpplugin-context.[ch]
* app/plug-in/gimpplugin-message.[ch]
* app/plug-in/gimpplugin-progress.[ch]: ...and added here as GObject.
* app/plug-in/plug-in-proc-frame.[ch]: removed...
* app/plug-in/gimppluginprocframe.[ch]: ...and added with a namespace.
* app/plug-in/Makefile.am
* app/plug-in/plug-in-types.h
* app/plug-in/gimppluginmanager-call.c
* app/plug-in/gimppluginmanager-file.c
* app/plug-in/gimppluginmanager.[ch]
* app/pdb/gimppluginprocedure.c
* app/pdb/gimptemporaryprocedure.c
* app/pdb/gimptemporaryprocedure.h
* tools/pdbgen/pdb/context.pdb
* tools/pdbgen/pdb/drawable.pdb
* tools/pdbgen/pdb/help.pdb
* tools/pdbgen/pdb/message.pdb
* tools/pdbgen/pdb/plug_in.pdb
* tools/pdbgen/pdb/progress.pdb
* tools/pdbgen/pdb/undo.pdb: changed accordingly.
* app/pdb/context_cmds.c
* app/pdb/drawable_cmds.c
* app/pdb/help_cmds.c
* app/pdb/message_cmds.c
* app/pdb/plug_in_cmds.c
* app/pdb/progress_cmds.c
* app/pdb/undo_cmds.c: regenerated.
2006-04-09 Michael Natterer <mitch@gimp.org>
* app/plug-in/plug-in-params.[ch] (plug_in_params_destroy):
removed this function. We only have shallow GPParam arrays in the
core that can be freed with g_free(), and gp_params_destroy()
could always be used for freeing deep copies.
* app/plug-in/plug-in-message.c
* app/plug-in/plug-in-run.c: simply g_free() the GPParam arrays.
2006-04-07 Michael Natterer <mitch@gimp.org>
* app/plug-in/plug-in-run.[ch]: made plug_in_run_temp() public and
changed its parameters to match the ones of plug_in_run().
* app/pdb/gimpprocedure.[ch]: added GimpProcedure::execute_async()
which takes an additional display_ID parameter and returns nothing.
* app/pdb/gimppluginprocedure.c
* app/pdb/gimptemporaryprocedure.c: implement it, using
plug_in_run() and plug_in_run_temp().
* app/core/gimp-utils.[ch]: added gimp_value_array_truncate()
which takes a GValueArray and the number of values to truncate the
array to.
* app/actions/plug-in-commands.c
* app/actions/vectors-commands.c
* app/pdb/gimp-pdb.c
* app/plug-in/plug-ins.c
* app/widgets/gimphelp.c: use gimp_procedure_execute_async()
instead of plug_in_run() and don't #include "plug-in-run.h".
Truncate GValueArray passed to plug-ins again, and don't just pass
some default values to the noninteractive args.
Unrelated:
* tools/pdbgen/pdb/plug_in.pdb: don't call
gimp_menus_create_branch() here.
* app/plug-in/plug-ins.c (plug_ins_menu_branch_add): call it here
instead.
* app/pdb/plug_in_cmds.c: regenerated.
2006-04-06 Michael Natterer <mitch@gimp.org>
* app/plug-in/plug-in-run.[ch]: removed plug_in_repeat()...
* app/actions/plug-in-commands.c: ...and merged it into
plug_in_repeat_cmd_callback(). It's essentially the same code as
plug_in_run_cmd_callback() and there's no reason (except
historical ones) to keep its implementation separate.
2006-04-05 Michael Natterer <mitch@gimp.org>
* app/plug-in/plug-in-proc-frame.[ch]: added
plug_in_proc_frame_get_return_vals().
* app/plug-in/plug-in-run.c: removed plug_in_get_return_vals()
and call plug_in_proc_frame_get_return_vals() instead.
Don't leak stuff in case calling the plug-in fails.
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-03-31 Michael Natterer <mitch@gimp.org>
* app/pdb/gimpprocedure.[ch]: added gimp_procedure_new() and
gimp_procedure_free() functions.
* app/plug-in/plug-in-proc-def.h (struct PlugInProcDef): use a
ProcRecord pointer instead of including the entire struct.
* app/plug-in/plug-in-proc-def.c: use the new() and free()
functions above to allocate/free the ProcRecord.
* app/actions/plug-in-actions.c
* app/actions/plug-in-commands.c
* app/menus/plug-in-menus.c
* 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/plug-in/plug-ins.c
* app/xcf/xcf.c: changed accordingly.
Unrelated:
* app/pdb/gimpprocedure.c (gimp_procedure_execute): be more verbose
when warning about out-of-bounds parameter values.
* tools/pdbgen/pdb/fileops.pdb: allow GIMP_RUN_WITH_LAST_VALS for
file_save because indirect saving (e.g. remote or compressed)
needs it.
* app/pdb/fileops_cmds.c: regenerated.
2006-03-30 Michael Natterer <mitch@gimp.org>
* app/pdb/procedural_db.[ch] (struct Argument): replace the value
union by a GValue.
(procedural_db_argument_init)
(procedural_db_compat_arg_init): new functions to initialize
an Argument. They call g_value_init() on the Argument's value.
(procedural_db_arguments)
(procedural_db_return_values): initialize the returned Argument
arrays so their GValues are ready to use. Allow to get the
(unsuccessful) return values of a NULL ProcRecord.
(procedural_db_destroy_args): g_value_unset() the values. Added a
"gboolean full_destroy" parameter. Its only effect is to destroy
PDB arrays, everything else is nicely memory managed by GValue.
(procedural_db_execute)
(procedural_db_run_proc): do GValue stuff. Added n_args and
n_return_vals parameters to execute().
(procedural_db_execute_proc): private function to execute a
procedure. Validates the passed in arguments using the registered
GParamSpecs before passing them to the resp. exec method.
* app/plug-in/plug-in-params.[ch] (plug_in_params_to_args): needs
an array of ProcArgs now in order to initialize the Arguments'
GValues correctly. Passing NULL ProcArgs uses
procedural_db_compat_arg_init(), so procedures (plug-ins)
returning more values than expected work.
(plug_in_args_to_params): do GValue stuff here too.
(plug_in_args_destroy): removed this function,
procedural_db_destroy_args() does the same now.
* app/plug-in/plug-in-message.c (plug_in_handle_proc_run):
simplified quite a bit because everything returns n_return_values
now. Call plug_in_params_to_args() only of the procedure was found.
(plug_in_handle_proc_return_priv): pass ProcRecs to
plug_in_params_to_args().
* app/batch.c
* app/actions/plug-in-commands.c
* app/actions/vectors-commands.c
* app/core/gimppdbprogress.c
* app/dialogs/about-dialog.c
* app/file/file-open.c
* app/file/file-save.c
* app/plug-in/plug-ins.c
* app/plug-in/plug-in-progress.c
* app/plug-in/plug-in-run.[ch]
* app/widgets/gimphelp.c
* app/widgets/gimppdbdialog.c
* app/xcf/xcf.c
* tools/pdbgen/pdb/fileops.pdb: changed accordingly: don't
g_new/g_free Argument arrays, always use procedural_db_foo()
functions. Use GValue functions to get/set Arguments.
* tools/pdbgen/pdb.pl: added get_value_func and set_value_func to
all PDB types. Removed id_func, id_ret_func and check_func. Added
flags which indicated that a type is an ID. Removed unused utility
functions.
* tools/pdbgen/lib.pl: use the flag instead of looking at
functions and value types.
* tools/pdbgen/app.pl: use the get_value_func and set_value_func
to marshal inargs and outargs. Removed all checks performed on
inargs because that's done by GParamSpec validation now. Added the
missing bits to register excluded values with GimpParamSpecEnum.
* app/pdb/*_cmds.c: regenerated.
2006-03-10 Sven Neumann <ven@gimp.org>
* app/widgets/gimpaction.c: factored out some code to a utility
function.
* app/config/gimpguiconfig.[ch]
* app/config/gimprc-blurbs.h
* app/dialogs/preferences-dialog.c
* app/gui/gui.c
* app/plug-in/plug-in-run.c
* libgimp/gimp.c
* libgimpbase/gimpprotocol.[ch]: renamed tool_tips to tooltips in
variables and in the gimprc.
* app/config/gimpbaseconfig.[ch]: removed stingy_memory_use from
the GimpBaseConfig struct.
2006-02-20 Sven Neumann <sven@gimp.org>
* app/config/gimpcoreconfig.[ch]
* app/config/gimprc-blurbs.h
* app/core/gimp.[ch]: keep a history of recently used plug-ins.
* app/plug-in/plug-in-run.[ch] (plug_in_repeat): pass an index
into the plug-in history.
* app/actions/plug-in-actions.c
* app/actions/plug-in-commands.c
* app/menus/plug-in-menus.c
* menus/image-menu.xml.in: added a submenu with recently used
plug-ins to the Filters menu. Fixes bug #148855.
2005-12-13 Sven Neumann <sven@gimp.org>
* libgimpbase/gimpwire.[ch]: let the private wire methods live in
the GIMP namespace. Declare internal functions as such and prefix
them with an underscore.
* libgimp/gimp.c
* libgimp/gimptile.c
* libgimpbase/gimpbase.def
* libgimpbase/gimpprotocol.c
* app/plug-in/plug-in-message.[ch]
* app/plug-in/plug-in-run.c
* app/plug-in/plug-in.c: changed accordingly.
2005-08-03 Michael Natterer <mitch@gimp.org>
Changed naming scheme for PDB procedure names from
random_crap_that_traditionally_has_underscores to
enforced-canonical-identifiers. I'm pretty sure some things are
broken after this commit. More changes to come...
* libgimpbase/gimpbase.def
* libgimpbase/gimputils.[ch]: added gimp_canonicalize_identifier().
* app/pdb/procedural_db.[ch] (struct ProcRecord): added
"gchar *original_name" to keep a procedure's original name as
reigstered by plug-ins (compat cruft).
(procedural_db_init_procs): canonicalized list of deprecated
procedures.
* app/plug-in/plug-in-proc-def.c (plug_in_proc_def_free): free
original_name.
* app/plug-in/plug-in-message.c: canonicalize procedure names
which are received over the wire.
* app/plug-in/plug-in-rc.c: serialize the original_name and create
the canonicalized name on-the-fly when deserializing.
* app/plug-in/plug-in-run.c: pass the original_name to plug-ins
when running them because they strcmp() the passed procedure name.
* app/plug-in/plug-ins.c (plug_ins_add_to_db): pass
canonical procedure names to procedural_db_execute().
(plug_ins_file_proc_compare): special-case "gimp-xcf", not "gimp_xcf".
* app/xcf/xcf.c: changed static XCF procedures accordingly.
* tools/pdbgen/app.pl
* tools/pdbgen/lib.pl: do some trivial substitutions to generate
canonicalized names in app/, and C identifiers with underscores in
libgimp/.
* tools/pdbgen/pdb/brushes.pdb
* tools/pdbgen/pdb/fileops.pdb
* tools/pdbgen/pdb/gradients.pdb
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/palettes.pdb
* tools/pdbgen/pdb/patterns.pdb
* tools/pdbgen/pdb/plug_in.pdb
* tools/pdbgen/pdb/procedural_db.pdb
* tools/pdbgen/pdb/text_tool.pdb
* tools/pdbgen/pdb/transform_tools.pdb: canonicaloized procedure
names in calls to std_pdb_deprecated() and in procedure names in
generated C code.
* app/pdb/*_cmds.c
* libgimp/*_pdb.c: regenerated.
2004-12-14 Michael Natterer <mitch@gimp.org>
* app/plug-in/plug-in-proc-frame.[ch]: added "gint ref_count" to
the PlugInProcFrame struct. Added new functions
plug_in_proc_frame_ref/unref().
(plug_in_proc_frame_new): set the ref_count to 1.
* app/plug-in/plug-in.[ch] (plug_in_proc_frame_push): return the
new proc_frame.
(plug_in_proc_frame_pop): use unref() instead of free().
* app/plug-in/plug-in-run.c (plug_in_temp_run): ref the proc_frame
while running its main loop. Removed the call to
plug_in_proc_frame_pop().
* app/plug-in/plug-in-message.c (plug_in_handle_temp_proc_return):
call plug_in_proc_frame_pop() immediately after
plug_in_main_loop_quit() so the proc_frame goes away from the
stack and can't be used accidentially if the core is too busy to
return to the main loop before the next command arrives on the
wire. Really fixes bug #161114 this time.