source: Sophya/trunk/SophyaPI/PI/Quartz/PIApplQuartz.cpp@ 3479

Last change on this file since 3479 was 3479, checked in by mansoux, 17 years ago

Second Version

  • Property svn:executable set to *
File size: 2.0 KB
Line 
1/*
2 * PIApplQuartz.cpp
3 * PI
4 *
5 * Created by Bruno MANSOUX on Wed Jun 09 2004.
6 * Copyright (c) 2004 __MyCompanyName__. All rights reserved.
7 *
8 */
9
10#include "PIApplQuartz.h"
11
12static OSErr QuitAppleEventHandler(const AppleEvent *appleEvt, AppleEvent* reply, UInt32 refcon);
13
14
15PIApplicationQuartz::PIApplicationQuartz()
16:PIApplicationGen()
17{
18 OSErr err;
19
20 err = AEInstallEventHandler( kCoreEventClass, kAEQuitApplication,
21 NewAEEventHandlerUPP((AEEventHandlerProcPtr)QuitAppleEventHandler),
22 0, false );
23 if (err != noErr)
24 ExitToShell();
25
26 menubar = new PIMenubar(this, "DefMenubar");
27}
28
29
30PIApplicationQuartz::PIApplicationQuartz(int width, int height,int narg, char *arg[])
31:PIApplicationGen()
32{
33 OSErr err;
34
35 err = AEInstallEventHandler( kCoreEventClass, kAEQuitApplication,
36 NewAEEventHandlerUPP((AEEventHandlerProcPtr)QuitAppleEventHandler),
37 0, false );
38 if (err != noErr)
39 ExitToShell();
40
41 topcont = new PIContainer((PIContainer*)this,(const char*)"Main Window",width,height,50,50);
42 menubar = new PIMenubar(this, "DefMenubar");
43 mainWindow = new PIWindow(this,(const char*)"Main Window",PIWK_normal,width,height,50,50);
44 mainWindow->Refresh();
45}
46
47PIApplicationQuartz::~PIApplicationQuartz()
48{
49}
50
51
52void PIApplicationQuartz::Run()
53{
54 RunApplicationEventLoop ();
55 return;
56}
57
58void PIApplicationQuartz::Stop()
59{
60 ExitToShell ();
61 return;
62}
63
64void PIApplicationQuartz::SetReady()
65{
66mState = kReadyState;
67}
68
69/* There's no default window in MacOSX */
70void PIApplicationQuartz::PrefCompSize(int& szx, int& szy)
71{
72 return;
73}
74
75void PIApplicationQuartz::ScreenSize(int& szx, int& szy)
76{
77 return;
78}
79
80void PIApplicationQuartz::ScreenSizeMM(int& szx, int& szy)
81{
82 return;
83}
84
85void PIApplicationQuartz::ScreenResolution(int& resolx, int& resoly)
86{
87 return;
88}
89
90static OSErr QuitAppleEventHandler( const AppleEvent *appleEvt, AppleEvent* reply, UInt32 refcon )
91{
92 ExitToShell ();
93 return noErr;
94}
95
96
Note: See TracBrowser for help on using the repository browser.