gtkmm_cocoa - native OS X apps, using gtkmm API to wrap cocoa
- From: Joonas Kiviharju <satelliittipupu yahoo co uk>
- To: gtkmm-list gnome org
- Subject: gtkmm_cocoa - native OS X apps, using gtkmm API to wrap cocoa
- Date: Fri, 1 Jul 2005 10:09:53 +0100 (BST)
gtkmm_cocoa - native OS X apps, using gtkmm API to
wrap cocoa
Hello. It's been a long time since I last wrote to
this list...
Just for a couple of months I've been bothered by the
lack of native looking version of gtkmm on Mac OS X.
On Windows the situation is much better. Gtkmm apps
look pretty much native on Windows. So, I did some
searches on the net and found a couple of projects
which were trying to make gtk+ run natively on OS X.
(http://gtk-osx.sourceforge.net/ and
http://gtk-quartz.sourceforge.net/), but it seems they
have slightly different goals or haven't progressed
much.
Because I know nothing about Gtk+ (and really don't
want to mess with it), I decided I'd do some
half-serious tests about wrapping the cocoa API with
the gtkmm API. I wanted to achieve this as I'm
developing a non-linear editing program called Pihlaja
(http://www.pihlaja.org). And I wanted it to run
natively on OS X, with the same gtkmm code, that is
already quite cross-platform. I don't like the fact
that gtkmm apps have to be run on top of X11, or the
fact that their menus are on top of the windows,
instead of the OS X way, in the top of the screen.
Pihlaja also uses libgnomecanvasmm, so I decided to
wrap it as an OpenGLView on cocoa. This I did because
opengl is the only graphics API that I'm familiar
with, and it's fast.
So, I've already wrapped some basic gtkmm classes (not
completely): Gtk::Window, Gtk::Widget, Gtk::VScale,
Gtk::HBox and Gtk::VPaned. And on the libgnomecanvasmm
side I've done most of Gnome::Canvas::Rect.
I haven't yet tried wrapping libglademm, but glibmm
doesn't need to be wrapped, as it doesn't use X.
It's all really really hacky, as I had to change some
include files from sigc++2 and glibmm to get it to
compile (the most problematic was the word "nil" which
is an objective-C keyword, like NULL, and it is being
used a couple of times in sigc++). They're included on
the zipped package. The libgnomecanvasmm wrap with
OpenGL is also really bad, as I'm using a stupid way
to send events to Gnome::Canvas::items.
So, if you want to have a look at what I've done, or
if you're interested in native gtkmm on OS X, then
check out the code, or atleast the screenshots:
http://pupuedit.sourceforge.net/gtkmm_cocoa/gtkmm_cocoa_1_7_2005.tiff
and the same program with X11 gtkmm:
http://pupuedit.sourceforge.net/gtkmm_cocoa/gtkmm_testeri_x11_1_7_2005.tiff
(the x11 version crashes if I try to use
Gnome::Canvas:rects, so that's why they're not
included here. I don't really understand this problem,
because my X11 version of Pihlaja works just fine,
with the same kind of code.)
And you can get the source code from:
http://pupuedit.sourceforge.net/gtkmm_cocoa/gtkmm_cocoa.zip
If you think that what I'm doing is completely
idiotic, I'd like to know about it. And if you think
it's great, or it should be done differently, or there
are better projects doing the same thing with less
effort, I'd really like to hear from you.
This project is completely leaving Gtk+ out of the
picture. It is an effort to use the platform that I
like, with the gtkmm API that I've learned to
appreciate for it's user friendly approach. And it's
mainly an effort to get those classes working that are
used in the Pihlaja non-linear editor (which is still
non-working by the way...)
Joonas Kiviharju
satelliittipupu YOU KNOW WHAT I'M THINKING yahoo.co.uk
___________________________________________________________
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]