Commit Graph

225 Commits

Author SHA1 Message Date
Michael Natterer 83a936b8fe pdb: rename all functions in the "plug_in" group
from gimp_plugin_foo() to gimp_plug_in_foo() for consistency.
2019-09-11 23:58:47 +02:00
Michael Natterer 6de4af4ade pdb: change paths and URIs in the "plug_in" group to GFiles 2019-09-11 23:54:53 +02:00
Michael Natterer 2fa9b8f030 pdb: forgot to change an URI to GFile in gimp_file_load() 2019-09-11 22:48:32 +02:00
Michael Natterer 77731d1e8e pdb: change the URIs in the color profile API to GFiles 2019-09-11 22:44:17 +02:00
Michael Natterer 14af676b51 pdb, libgimp: change "filename" to "file" in gimp_pdb_dump() 2019-09-11 22:37:40 +02:00
Michael Natterer 6468fa06c7 pdb, plug-ins: change gimp_temp_name() to gimp_temp_file() 2019-09-11 22:32:44 +02:00
Michael Natterer 6bca8c4f89 pdb, app, libgimp, plug-ins: replace most PDB filenames/URIs by GFile
and in an attack of madness, changes almost all file plug-in
code to use GFile instead of filenames, which means passing
the GFile down to the bottom and get its filename at the very
end where it's actually needed.
2019-09-11 21:48:34 +02:00
Félix Piédallu ba6973e791 Fix Meson some changes not pulled from Autotools 2019-09-11 17:10:47 +02:00
Félix Piédallu 65eff6f150 Meson port. 2019-09-11 16:42:04 +02:00
Michael Natterer f3fb3d1a57 Remove the second "raw-filename"/"raw-uri" parameter from file procedures
It's an ancient concept from ancient times when we didn't have URIs
and only filenames (not to speak of GFile), and actually even from
before the ancient time before that ancient time when we first had
ones and zeros, and only had zeros.
2019-09-11 00:21:03 +02:00
Michael Natterer 6115d34fe8 Rename the "fileops" PDB group to just "file" 2019-09-10 21:38:11 +02:00
Michael Natterer 7c5cb29ca6 pdb: move the file procedure register API from "fileops" to "pdb"
because it has nothing to do with the other procedures in fileops and
only sets properties on procedures.
2019-09-10 21:24:09 +02:00
Michael Natterer 56fee73441 pdb: reorder stuff in the "pdb" group to make more sense 2019-09-10 20:23:19 +02:00
Michael Natterer ff9b469808 app: move the file procedure registering functions into gimpplugin-proc.c
They are simply setting properties on GimpPlugInProcedures, just like
the other functions in gimpplugin-proc.[ch], so there is no reason to
have them elsewhere and with worse checks and error messages.
2019-09-10 20:05:27 +02:00
Michael Natterer 0745043ddb pdb, libgimp: remove _gimp_register_load_handler()
and rename _gimp_register_magic_load_handler() to
_gimp_register_load_handler().
2019-09-10 12:29:17 +02:00
Michael Natterer a88aa27942 app: use GError in all gimpplugin-proc.[ch] functions, not gimp_message() 2019-09-09 12:10:32 +02:00
Michael Natterer bde70bcdab pdb: avoid duplicate argument names in gimp-plugins-query
Also rename all arguments to make more sense.
2019-09-09 01:51:33 +02:00
Michael Natterer 22a780c9d1 pdb: add gimp_pdb_set_proc_documentation() and _attribution()
and all the needed code in libgimp/ and app/ to set them on a
procedure using the new API. Remove the strings from GPProcInstall.
2019-09-09 00:36:24 +02:00
Michael Natterer 6b0486174d app, pdb: split GimpProcedure's "strings" into "help" and "attribution" 2019-09-08 23:40:34 +02:00
Michael Natterer 26c8286675 app, pdb: take "deprecated" out of GimpProcedure's "strings" API
and add gimp_procedure_set_deprecated().
2019-09-08 23:23:32 +02:00
Michael Natterer 1716666bd1 app: keep the help_id in GimpProcedure not GimpPlugInProcedure 2019-09-08 22:25:26 +02:00
Michael Natterer 453b4f4aa2 pdb: add gimp_pdb_set_proc_menu_label()
and all the needed code in libgimp/ and app/ to set a plug-in
procedure's menu label using the new API. Remove the menu label from
GPProcInstall.
2019-09-08 17:30:54 +02:00
Michael Natterer 2a62287439 pdb: add gimp_pdb_set_proc_image_types()
and all the needed code in libgimp/ and app/ to set a plug-in
procedure's image types using the new API. Remove the image types from
GPProcInstall.
2019-09-08 16:54:08 +02:00
Michael Natterer d75a25c565 app: move the plug-in procedure setters to gimpplugin-proc.[ch]
because there are going to be much more more.
2019-09-08 16:38:31 +02:00
Michael Natterer 303ccbedad pdb: move gimp_plugin_icon_register_invoker() from "plugin" to "pdb"
and call it gimp_pdb_set_proc_icon(). Change icon registration code in
libgimp/ and app/ so it's now possible to register icons for temporary
procedures.
2019-09-08 16:22:32 +02:00
Michael Natterer d89adebff8 pdb: move gimp_plugin_menu_register() from the "plugin" to the "pdb" group
and call it gimp_pdb_add_proc_menu_path(). Move around and rename some
code in app/ to prepare for more procedure setters to work this way.
2019-09-08 15:53:37 +02:00
Michael Natterer e82c80bf5f pdb: rename all procedure query procedures to gimp-pdb-get-proc-foo 2019-09-08 15:07:24 +02:00
Michael Natterer 388776df07 Simplify the plug-in query API and fix plugin-browser
- remove the menu path and image types from "gimp-plugins-query",
  they are available via GimpProcedure, also reorder and rename
  its remaining return values to make sense
- remove the "menu_path" parameter to gimp_proc_view_new(),
  it can also ask GimpProcedure
- adapt plugin-browser to the new API and make it use GimpProcedure
- fix plugin-browser's tree view to show all menu hierarchies
  completely, it was still expecting menu paths that contain
  the menu label too
2019-09-08 14:59:09 +02:00
Michael Natterer 48692e58c3 pdb: add pdb API to get a procedure's image types, menu label and menu paths 2019-09-07 21:08:13 +02:00
Ell 85704c6c46 pdb: add $since info to gimp-image-merge-layer-group 2019-09-07 10:55:09 +03:00
Ell 62a6023b27 pdb: add gimp-image-merge-layer-group procedure
Oddly, we didn't have this one yet :P
2019-09-07 10:33:43 +03:00
Michael Natterer 46608393c3 pdb, libgimp: add a HORRIBLE hack to make sure objects arrays don't leak
In the generated libgimp wrappers, we can't return object arrays
from a call to GIMP_VALUES_DUP_OBJECT_ARRAY() because it returns
a deep copy and adds a reference to all objects, which the caller
would have to unref.

But we want a shallow (transfer container) copy because we don't want
libgimp proxy objects to be refed or unrefed by any user code.

Therefore, add a HACK that simply memdup()s and returns the
GimpObjectArray's array memory, and leaves the contained object
pointers alone.
2019-09-05 15:03:14 +02:00
Michael Natterer f764fd0f82 pdb, libgimp: change all generated ID array return values to object arrays
and remove the manual libgimp wrappers which now have the same
signature as the generated functions.
2019-09-05 13:01:00 +02:00
Ell cf3638391d app: add support for color picking in "show all" mode
Add a show_all parameter to gimp_image_pick_color(), which, when
TRUE, allows picking colors outside the canvas bounds in sample-
merged mode.  Forward the display's "show all" mode through this
parameter where applicable (in particular, in the color-picker tool
and the pointer dockable).
2019-09-04 20:51:43 +03: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 5e00decc13 pdb, libgimp: use GIMP_VALUES_GET,DUP_FOO() in the libgimp PDB wrappers 2019-09-04 02:49:33 +02:00
Michael Natterer cb24709916 pdb: remove the "id" field from all pdb types, it's now unused 2019-09-04 02:10:43 +02:00
Michael Natterer 90f9d551dc pdb, libgimp: use GIMP_VALLUES_GET_ENUM() in libgimp PDB wrappers
to get the procedure's return status.
2019-09-04 01:49:35 +02:00
Michael Natterer feaf96735f pdb: don't return any strings from _gimp_pdb_proc_info()
and instead add _gimp_pdb_proc_documentation() and
_gimp_pdb_proc_attribution().

Remove the gimp_pdb_proc_info() utility function in app/.
2019-09-04 01:38:31 +02:00
Michael Natterer a351ce9126 Remove the entire old plug-in interface 2019-09-04 00:03:12 +02:00
Jehan 71ccaa21ee pdb, libgimp: remove double API generation from PDB.
All plug-ins got ported. Let's remove support for the old API with IDs
instead of objects.
2019-09-03 13:31:27 +02:00
Jehan 1c0fb800e5 app, pdb: fix gimp_item_id_is_vectors().
It was testing for GimpDrawable!
2019-09-02 11:44:36 +02:00
Michael Natterer 8a78203aed Properly prefix the values of enum GimpPDBProcType
to be GIMP_PDB_PROC_TYPE_PLUGIN, _EXTENSION etc.
2019-08-30 12:52:28 +02:00
Michael Natterer 392f00baf5 app, libgimp: get rid of all ID GTypes and ID param specs
Turn all ID param specs into object param specs (e.g. GimpParamImageID
becomes GimpParamImage) and convert between IDs and objects in
gimpgpparams.c directly above the the wire protocol, so all of app/,
libgimp/ and plug-ins/ can deal directly with objects down to the
lowest level and not care about IDs.

Use the actual object param specs for procedure arguments and return
values again instead of a plain g_param_spec_object() and bring back
the none_ok parameter.

This implies changing the PDB type checking functions to work on pure
integers instead of IDs (one can't check whether object creation is
possible if performing that check requires the object to already
exist).

For example gimp_foo_is_valid() becomes gimp_foo_id_is_valid() and is
not involved in automatic object creation magic at the protocol
level. Added wrappers which still say gimp_foo_is_valid() and take the
respective objects.

Adapted all code, and it all becomes nicer and less convoluted, even
the generated PDB wrappers in app/ and libgimp/.
2019-08-29 11:39:34 +02:00
Jehan 24af759483 pdb: update a bunch of docs where s/-1/%NULL/
Also add a none_ok on gimp_text_fontname() outarg since it is clearly
noted as being able to return no layer with invalid parameters.
2019-08-25 12:01:41 +02:00
Jehan ac1c0ae3ce libgimp, pdb: annotate arguments with none_ok as (nullable).
Same for returned value though it seems we have no function with none_ok
as return value. At least we have the rule in the generation script for
when this will happen.
2019-08-25 12:01:41 +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 08849a584c libgimp: GimpItem now also belong to libgimp. 2019-08-22 15:54:36 +02:00
Jehan d15388c8c9 libgimp: s/gimp_display_new_by_id/gimp_display_get_by_id/
GimpDisplay objects now also belongs to libgimp!
2019-08-22 15:54:36 +02:00
Jehan cfd30ec62a libgimp: s/gimp_image_new_by_id()/gimp_image_get_by_id()/
This means that images' ownership is not given to caller in particular.
libgimp will now keep a reference of all GimpImage-s it creates and
return this same reference if called again. It also means that you can
now compare images by pointer comparison (as 2 GimpImage objects
representing the same image ID will be equal).
Obviously as a side effect, gimp_image_list() is changed to (transfer
container) as you must only free the container now, not the elements.
Also various other functions creating new images are now (transfer none)
too.

Long-time plug-ins will have to be taken in consideration in a further
step (we currently never free GimpImage for destroyed images in
particular).
2019-08-22 15:54:36 +02:00