RSS/Atom feed Twitter
Site is read-only, email is disabled

Developing a GIMP plugin (2 questions)

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

5 of 5 messages available
Toggle history

Please log in to manage your subscriptions.

Developing a GIMP plugin (2 questions) javi palau 22 Jul 20:18
  Developing a GIMP plugin (2 questions) David Neary 22 Jul 20:58
  Developing a GIMP plugin (2 questions) Simon Budig 22 Jul 23:19
   Developing a GIMP plugin (2 questions) Daniel Egger 23 Jul 00:43
  Developing a GIMP plugin (2 questions) Sven Neumann 23 Jul 01:47
javi palau
2004-07-22 20:18:02 UTC (over 20 years ago)

Developing a GIMP plugin (2 questions)

Hi, I'm a student who's developing a GIMP plug-in. I've been reading the API's documents but i haven't found the solution. Two questions:
1º When i execute my plug-in for 2nd time, i'd like to configure the parameters like the user introduce the first time. Is there any "gimp memory" to save the values introduced by the user?

2ºHow i can know the language used by GIMP?. I've been searching in the "gimprc" file, but i haven't found anything.

Thanks a lot.

PD: Forgive me for my english. ;P

__________________

David Neary
2004-07-22 20:58:37 UTC (over 20 years ago)

Developing a GIMP plugin (2 questions)

Hi Javi,

javi palau wrote:

Two questions:
1º When i execute my plug-in for 2nd time, i'd like to configure the parameters like the user introduce the first time. Is there any "gimp memory" to save the values introduced by the user?

You can tell when a plug-in is re-run by testing the run mode (parameter 0 of the input parameters of every plug-in). If it is GIMP_RUN_WITH_LAST_VALS, the plug-in has been run with that menu item, if it's run GIMP_RUN_INTERRACTIVE it has been run through a menu entry.

The usual way that you get back last used values is to call gimp_set_data(plug_in_name, pointer_to_option_struct, sizeof(option_struct));

So the first thing that you can do after starting the plug-in is to call
gimp_get_data(plug_in_name, pointer_to_option_struct);

2ºHow i can know the language used by GIMP?. I've been searching in the "gimprc" file, but i haven't found anything.

The GIMP is written in C, primarily, but you can write plug-ins in any language which wraps libgimp (if it wraps gtk+ as well, all the better). That currently includes perl, python and scheme (script-fu), but there is no reason not to have others.

The gimprc file format is a readable serialisation of internal configuration stuff, I don't think you could call it a language.

Cheers, Dave.

Simon Budig
2004-07-22 23:19:34 UTC (over 20 years ago)

Developing a GIMP plugin (2 questions)

javi palau (javipalau@hotmail.com) wrote:

2ºHow i can know the language used by GIMP?. I've been searching in the "gimprc" file, but i haven't found anything.

We use the gettext library to determine what language the text in our user interface should be. In fact gettext does all the hard work for us.

You can also use it for your plugin and you'll automatically have the same language as the rest of the GIMP.

Bye, Simon

Daniel Egger
2004-07-23 00:43:23 UTC (over 20 years ago)

Developing a GIMP plugin (2 questions)

On 22.07.2004, at 23:19, Simon Budig wrote:

We use the gettext library to determine what language the text in our user interface should be. In fact gettext does all the hard work for us.

Not quite but almost. :) The choice of language is expressed by setting environment variables. Those are picked up by the i18n environment which is hosted either by the libc or in a on some systems in freestanding library called libintl. What is called gettext is on one hand the library call which will do the translation[1] and on the other hand a set of userland tools[2] to extract strings from the sourcecode, convert human readable text into machine optimized binary form and do other manipulations on catalogs.

[1] iff the language is set, differs from the default English and a catalog in one of the choosen languages with a matching translation string is available [2] also the name of one particular tool within the set

Servus, Daniel

Sven Neumann
2004-07-23 01:47:23 UTC (over 20 years ago)

Developing a GIMP plugin (2 questions)

Hi,

"javi palau" writes:

Hi, I'm a student who's developing a GIMP plug-in. I've been reading the API's documents but i haven't found the solution.

I strongly suggest you look at some of the plug-ins distributed with GIMP and also get your hands on the gimp-plugin-template [1]. That should answer your questions.

Sven

[1] http://developer.gimp.org/plug-in-template.html