On May 18, 2010, at 12:40 PM, Colin Walters wrote: > On Tue, May 18, 2010 at 2:54 PM, John Ralls <jra...@ceridwen.us> wrote: >> >> Where's gtkapplication.c? I can't find it in >> http://git.gnome.org/browse/gtk+/tree/gtk 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: > https://bugzilla.gnome.org/show_bug.cgi?id=127958 > >> >> 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 >> http://git.gnome.org/browse/glib/commit/?h=wip/gapplication&id=dfd5dd47d4008fd0cffce35957db0ce0116da4cf. >> 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). +void +gtk_application_run (GtkApplication *app) +{ + g_application_run (G_APPLICATION (app)); +} void 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. Regards, John Ralls _______________________________________________ gtk-devel-list mailing list gtk-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-devel-list