Re: Ige-mac-integration: New version with Cocoa interface available.

On May 18, 2010, at 12:40 PM, Colin Walters wrote:

> On Tue, May 18, 2010 at 2:54 PM, John Ralls <jralls ceridwen us> wrote:
>> Where's gtkapplication.c? I can't find it in and I don't see an obvious branch.
> I'll make a branch as soon as GApplication settles down a bit, but
> presently the code lives here:
>> Maybe I should ask you to look at GtkOSXApplication.
>> In the case of an NSApplicationShouldTerminate, the NSApplication receives the notification in Apple-provided code and calls the following function in the application delegate:
> I would think this would map to the GApplication Quit signal/vfunc, no?
>> All the platforms I'm familiar (which is only X11, MSWin, and Quartz) do just hook the platform sources. The only point I can see to providing a g_application_main_loop() is to replace the GMainLoop with something else, and I don't think that GApplication is the right place to do that.
> The only reason for this weirdness is because GApplication has to be
> separate from GtkApplication.  For GtkApplication the _run is defined
> to be gtk_main() so that we preserve compatibility with that
> function's init and quit func hooks.
>> gunixapplication.c rename? I don't see any deletes in How is it a rename?
> It was named that before it was imported into the branch.

OK, I looked at GtkApplication. It does two things, neither terribly useful: It provides an interface for adding a dock tile menu, and it provides for setting a particular window which, if closed, will quit the application. The rest is just pass-through (so now we have double indirection for calling gtk_main).

Yes, for that particular case, the GApplication Quit signal would map just fine. But you were asking for what I meant by connecting to notifications. Look at GtkOSXApplication and you'll see that there are 4 such notifications which are re-emitted as GSignals (so far).

+gtk_application_run (GtkApplication  *app)
+  g_application_run (G_APPLICATION (app));
g_application_run (GApplication *application)
  g_return_if_fail (G_IS_APPLICATION (application));
  G_APPLICATION_GET_CLASS (application)->run (application);
static void
g_application_default_run (GApplication *application)
  GMainLoop *mainloop = g_application_get_mainloop (application);
  g_main_loop_run (mainloop);

Perhaps an oops? (gtk_application_default_run calls gtk_main(), but it isn't itself called.)
I still don't see the point of one-line functions that serve only to rename another function in the toolkit, whether it's g_main_loop(), gtk_main(), or anything else. Renaming a platform function is another matter, especially when that platform function is in another language like Objective-C.

What was gunixapplication.c named? And I still don't understand how a file with only static functions and variables is of any use.

John Ralls

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]