[Gimp-developer] how to create a window in gimp plugin?

2009-07-01 Thread gbstack
Hello,everybody!

I want to create a window in gimp plugin,so this is my code(part of the 
plugin):

/static void run (const gchar  *name,
 gint  nparams,
 const GimpParam  *param,
 gint *nreturn_vals,
 GimpParam   **return_vals)
{
  static GimpParam  values[1];
  GimpPDBStatusType status = GIMP_PDB_SUCCESS;
  GimpRunMode   run_mode;
  GtkWidget   *window;

  gtk_init();

  /* Setting mandatory output values */
  *nreturn_vals = 1;
  *return_vals  = values;

  values[0].type = GIMP_PDB_STATUS;
  values[0].data.d_status = status;

  /* Getting run_mode - we won't display a dialog if
   * we are in NONINTERACTIVE mode */
  run_mode = param[0].data.d_int32;
 
  window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
  gtk_window_set_title(GTK_WINDOW(window),"hello");
  gtk_widget_show(window);

  gtk_main();
 
}

/but when I ran the plugin in gimp,it didn't work...
and this is the error message:

(hello:12429): GLib-GObject-WARNING **: invalid (NULL) pointer instance

(hello:12429): GLib-GObject-CRITICAL **: g_signal_connect_data: 
assertion `G_TYPE_CHECK_INSTANCE (instance)' failed

(hello:12429): LibGimp-CRITICAL **: gimp_window_set_transient: assertion 
`gimp_ui_initialized' failed

(hello:12429): Gtk-WARNING **: Screen for GtkWindow not set; you must 
always set
a screen for a GtkWindow before using the window

(hello:12429): Gdk-CRITICAL **: gdk_screen_get_default_colormap: 
assertion `GDK_IS_SCREEN (screen)' failed

(hello:12429): Gdk-CRITICAL **: gdk_colormap_get_visual: assertion 
`GDK_IS_COLORMAP (colormap)' failed

(hello:12429): Gdk-CRITICAL **: gdk_screen_get_default_colormap: 
assertion `GDK_IS_SCREEN (screen)' failed

(hello:12429): Gdk-CRITICAL **: gdk_screen_get_root_window: assertion 
`GDK_IS_SCREEN (screen)' failed

(hello:12429): Gdk-CRITICAL **: gdk_screen_get_root_window: assertion 
`GDK_IS_SCREEN (screen)' failed

(hello:12429): Gdk-CRITICAL **: gdk_window_new: assertion `GDK_IS_WINDOW 
(parent)' failed

(hello:12429): Gdk-CRITICAL **: 
gdk_window_enable_synchronized_configure: assertion `GDK_IS_WINDOW 
(window)' failed

(hello:12429): Gdk-CRITICAL **: gdk_window_set_user_data: assertion 
`window != NULL' failed

(hello:12429): Gtk-CRITICAL **: gtk_style_attach: assertion `window != 
NULL' failed

(hello:12429): Gtk-CRITICAL **: gtk_style_set_background: assertion 
`GTK_IS_STYLE (style)' failed

(hello:12429): Gtk-CRITICAL **: gtk_paint_flat_box: assertion 
`GTK_IS_STYLE (style)' failed

(hello:12429): Gdk-CRITICAL **: gdk_window_set_accept_focus: assertion 
`GDK_IS_WINDOW (window)' failed

(hello:12429): Gdk-CRITICAL **: gdk_window_set_focus_on_map: assertion 
`GDK_IS_WINDOW (window)' failed

(hello:12429): Gdk-CRITICAL **: gdk_window_set_modal_hint: assertion 
`GDK_IS_WINDOW (window)' failed

(hello:12429): Gtk-CRITICAL **: gtk_window_realize_icon: assertion 
`widget->window != NULL' failed

(hello:12429): Gtk-WARNING **: Screen for GtkWindow not set; you must 
always set
a screen for a GtkWindow before using the window

(hello:12429): Gdk-CRITICAL **: gdk_window_set_geometry_hints: assertion 
`GDK_IS_WINDOW (window)' failed

(hello:12429): Gdk-CRITICAL **: gdk_window_unmaximize: assertion 
`GDK_IS_WINDOW (window)' failed

(hello:12429): Gdk-CRITICAL **: gdk_window_unstick: assertion 
`GDK_IS_WINDOW (window)' failed

(hello:12429): Gdk-CRITICAL **: gdk_window_deiconify: assertion 
`GDK_IS_WINDOW (window)' failed

(hello:12429): Gdk-CRITICAL **: gdk_window_unfullscreen: assertion 
`GDK_IS_WINDOW (window)' failed

(hello:12429): Gdk-CRITICAL **: gdk_window_set_keep_above: assertion 
`GDK_IS_WINDOW (window)' failed

(hello:12429): Gdk-CRITICAL **: gdk_window_set_keep_below: assertion 
`GDK_IS_WINDOW (window)' failed

(hello:12429): Gdk-CRITICAL **: gdk_window_show: assertion 
`GDK_IS_WINDOW (window)' failed

anyone can tell me how to fix it?

any suggestion is appreciated.



Regards,
Todong Ma.
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


[Gimp-developer] What's next for the meta-data browser

2009-07-01 Thread Roman Joost
Hi folks,

I'm currently devoting some of my spare time on working on the metadata
browser and I'm wondering which should be worked on next. As a quick
background:

The metadata browser currently consists of seven tabs: Description,
Copyright, Origin, Camera 1, Camera 2, Advanced. Only two tabs "work":
Description and Advanced. The first tab shows dublin core metadata
fields, such as: title author, description, keywords. The last -
advanced - tab, shows schemas and their properties expanded as a tree.
Some of the property values can be edited by the user, some can't.


So, I picked as a next working target the description tab.

Two questions:

1. Do I have to be careful when entry callbacks write to the
XMPModel (or any other model or structure) everytime a user types in
a character (performance wise)?

2. I tried to find out how I can add callbacks to editable tree
items. Those callbacks should update the corresponding fields in the
description tab. E.g someone changes in the advanced tab the title
field. This change should then visible in the description tab and
the title has changed.
What am I looking for, when I want to add callbacks to those tree
columns? A pointer to documentation or some keywords I should look
out for would be helpful.

If there are more important changes for the browser than the description
tab, let me know. Maybe I should rather focus on make the advanced tab
more usable ... don't know.

If you need more information to provide useful help, let me know :)

Cheers!
-- 
Roman Joost
www: http://www.romanofski.de
email: romanof...@gimp.org


signature.asc
Description: Digital signature
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


[Gimp-developer] JavaFX support in the GIMP?

2009-07-01 Thread Joshua Marinacci
Hi GIMP developers.  I'd like to see if there is anyone interested in  
working on a JavaFX plugin for the GIMP.

Please let me introduce myself. I'm Josh Marinacci from the JavaFX  
engineering team at Sun. JavaFX is our new platform for graphic &  
media intensive applications that runs on Mac, Windows, and Linux (as  
well as phones and TVs in the future). Recently there have been  
threads on a few mailing lists asking for JavaFX support in the Gimp  
so I thought I'd see if there was anyone in the GIMP developer  
community interested in creating such a plugin.  Let me explain what  
this means.

Today we have something called the JavaFX Production Suite, which is a  
set of plugins for Photoshop and Illustrator.  They let you export  
graphics from those tools and then integrate them in an app you are  
building, adding animation and event handlers directly to the  
graphics. I put together a short screencast to show you how it works  
in Photoshop:

http://blip.tv/file/2288262

We simply don't have the developer resources to create plugins for  
tools other than Photoshop and Illustrator, but we also don't want to  
leave open source and Linux designers out of the loop. We'd love to  
help some on the GIMP community build such a plugin. We can provide  
technical support and specs, and answer questions.  I think it would  
be pretty easy for an experienced GIMP developer to build such an  
export plugin. The underlying .FXZ format is basically a zip file  
containing images and some text metadata similar to XML. It should be  
pretty easy to generate.

Please let me know if there's any interest. Thanks!

Josh
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


Re: [Gimp-developer] [GSoC] GIT commit messages

2009-07-01 Thread Jerson Michael Perpetua
Please do consider that the other 4 GSoC projects are for GEGL and
should appear here: http://git.gnome.org/cgit/gegl/.  For now, Martin
has created the GEGL+GPU branch as I have yet to receive my push
access approval for gnome git.  I suspect that the other 3 students
are in a similar state.  There are about more than a dozen commits
already in my branch.

Best wishes,
Daerd

(P.S. My branch can be accessed here:
http://git.gnome.org/cgit/gegl/log/?h=gsoc2009-gpu. Note that the
branch is in a very rudimentary state, which means that it is untested
and might eat your pets. It, however, shows a great deal of what I'm
currently up to in an architectural/prototypical level.)
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


Re: [Gimp-developer] New color mode

2009-07-01 Thread Martin Nordholts
On 07/01/2009 08:21 PM, Emil Assarsson wrote:
> On Mon, Jun 29, 2009 at 9:33 PM, Martin Nordholts  wrote:
>
>> Maybe the RGB ->  HSL conversion is buggy?
>>  
>
> I don't see it as a bug... it's more of a problem. Gimp uses HSL(?)
> and PhotoShop /seems/ to use CIELAB for these operations.
>
> Any comments on this?
>

If using a CIE Lab based color space for defining and implementing the 
color layer modes gives better looking and more intuitive results, than 
that is the color space we shall use.

A patch that uses CIE Lab (or CIE LCH?) for this when using GEGL would 
be much appreciated.

  / Martin


___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


Re: [Gimp-developer] New color mode

2009-07-01 Thread Emil Assarsson
On Mon, Jun 29, 2009 at 9:33 PM, Martin Nordholts wrote:
> Maybe the RGB -> HSL conversion is buggy?

I don't see it as a bug... it's more of a problem. Gimp uses HSL(?)
and PhotoShop /seems/ to use CIELAB for these operations.
This effects all layer modes that uses that color space for
conversions and doesn't work in the same way as PS... Hue, Saturation,
Color and Value.

HSL treats pure yellow by giving it the same lightness as pure purple.
CIELAB treats them more from a human perspective and sets the pure
yellow to be light (lightness) and pure purple as dark.

Helpful tool to visualize it: http://www.cs.rit.edu/~ncs/color/a_spaces.html

I think we need to add conversion tools for the color space and
rewrite those routines (or add new ones) if it should be a goal to
correctly import PS files with layer modes. (This could actually be a
good way to learn some more about the gimp code for me)

Any comments on this?
-- 
Emil
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


[Gimp-developer] [GSoC] GIT commit messages

2009-07-01 Thread Michael Schumacher
Hi,

I'm seeing the first commit to soc-2009-* branches. According to 
http://git.gnome.org/cgit/gimp/, two branches have been added already, and at 
least one other is in preparation.

However, please make your commit messages meaningful. I've seen some commits 
that do only use a rather obscure version number. 

The commit messages should use a format like

---

[tag] Short explanation of the commit

Longer explanation explaining exactly what's changed, whether any
external or private interfaces changed, what bugs were fixed (with bug
tracker reference if applicable) and so forth. Be concise but not too brief.

---

Talk to your mentors about the optional tags, they might want you to use 
special ones depending on what the commit covers.

See also http://live.gnome.org/Git/CommitMessages


P.S. Keep in mind that midterm sruveys do start next week.


Regards,
Michael
-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


Re: [Gimp-developer] connecting to update signal in uimanager

2009-07-01 Thread Jordan Stinson
Yes, this helps.
Thanks!

- Jordan

On Wed, Jul 1, 2009 at 12:41 AM, Martin Nordholts  wrote:

> On 07/01/2009 12:08 AM, Jordan Stinson wrote:
> > static void
> > toolbox_create_commands (GimpToolbox *toolbox,
> >GimpContext *context)
> > {
> > GimpUIManager *ui_manager = GIMP_IMAGE_DOCK (toolbox)->ui_manager;
> > ...
> >g_signal_connect (G_OBJECT (ui_manager), "update", G_CALLBACK
> > (toolbox_refresh_commands),
> > (gpointer) toolbox);
> > }
> >
> > /*Callback function*/
> > static void
> > toolbox_refresh_commands (GimpUIManager *ui_manager, gpointer data)
> > {
> > GimpToolbox *toolbox = GIMP_TOOLBOX (data);
> > if (toolbox)
> > gimptoolbox_refresh_commands (toolbox);
> > }
>
> Hi,
>
> Please don't break threads by sending to just one persion, continue the
> thread on gimp-developer.
>
> The "update" signal on GimpUIManager has a parameter, as can be seen in
> app/widgets/gimpuimanager.c:
>
>   manager_signals[UPDATE] =
> g_signal_new ("update",
>   G_TYPE_FROM_CLASS (klass),
>   G_SIGNAL_RUN_LAST,
>   G_STRUCT_OFFSET (GimpUIManagerClass, update),
>   NULL, NULL,
>   gimp_marshal_VOID__POINTER,
>   G_TYPE_NONE, 1,
>   G_TYPE_POINTER);
>
> where 1, G_TYPE_POINTER means the signal has one parameter of type
> pointer. It is this parameter you get in your 'data' in your callback.
> Your callback signature shall look like it does for other clients, such
> as the tool options menu:
>
>   g_signal_connect (manager, "update",
> G_CALLBACK (tool_options_menu_update),
> (gpointer) ui_path);
>
>   // ...
>
> static void
> tool_options_menu_update (GimpUIManager *manager,
>   gpointer   update_data,
>   const gchar   *ui_path)
>
> I.e. you need to "make room" for the "update" signal parameter.
>
> Hope this helps,
>
>  / Martin
>
> ___
> Gimp-developer mailing list
> Gimp-developer@lists.XCF.Berkeley.EDU
> https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
>
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer