GUI アプリケーションのエントリポイントを並べてみる
Delphi
begin Application.Initialize; Application.CreateForm(TForm1, Form1); Application.Run; end.
Lazarus
begin {$I project1.lrs} Application.Initialize; Application.CreateForm(TForm1, Form1); Application.Run; end.
Qt
#include <qapplication.h> #include <qpushbutton.h> int main( int argc, char **argv ) { QApplication a( argc, argv ); QPushButton hello( "Hello world!", 0 ); hello.resize( 100, 30 ); a.setMainWidget( &hello ); hello.show(); return a.exec(); }
wxWidgets
#include "main.h" #include "simple.h" IMPLEMENT_APP(MyApp) bool MyApp::OnInit() { Simple *simple = new Simple(wxT("Simple")); simple->Show(true); return true; }
WinMain は中で持っているというタイプ。あまり好きじゃない。
Cocoa
#import <Cocoa/Cocoa.h> int main(int argc, char *argv[]) { return NSApplicationMain(argc, (const char **) argv); }
実際の処理は、classes.nib に書いてあるクラスから始まるっぽい。
Carbon
#include <Carbon/Carbon.h> int main(int argc, char* argv[]) { // ???? }
まだ調査中です。