|
|
| version 1.3, 2003/11/05 15:12:17 | version 1.4, 2003/11/05 16:08:59 |
|---|---|
| Line 12 | Line 12 |
| #include "soundmng.h" | #include "soundmng.h" |
| #include "fdefine.h" | #include "fdefine.h" |
| //for 10.2 | |
| //#define JAGUAR | |
| enum { | enum { |
| IDC_TOOLHDDACC = 0, | IDC_TOOLHDDACC = 0, |
| Line 117 static DragReceiveHandlerUPP dr; | Line 115 static DragReceiveHandlerUPP dr; |
| // ---- | // ---- |
| static bool isPuma(void) { | |
| long res; | |
| Gestalt(gestaltSystemVersion, &res); | |
| if (res<0x1020) { | |
| return(true); | |
| } | |
| return(false); | |
| } | |
| static PicHandle skinload(const char *path, Rect* bounds) { | static PicHandle skinload(const char *path, Rect* bounds) { |
| char fname[MAX_PATH]; | char fname[MAX_PATH]; |
| Line 600 static pascal OSErr DragReceiver( Window | Line 608 static pascal OSErr DragReceiver( Window |
| static WindowRef makeNibWindow (IBNibRef nibRef) { | static WindowRef makeNibWindow (IBNibRef nibRef) { |
| OSStatus err; | OSStatus err; |
| WindowRef win = NULL; | WindowRef win = NULL; |
| #ifndef JAGUAR | |
| Rect bounds; | if (isPuma()) { |
| SetRect(&bounds, 0, 0, 100, 100); | Rect bounds; |
| err = CreateNewWindow(kFloatingWindowClass, kWindowStandardHandlerAttribute, &bounds, &win); | SetRect(&bounds, 0, 0, 100, 100); |
| #else | err = CreateNewWindow(kFloatingWindowClass, kWindowStandardHandlerAttribute, &bounds, &win); |
| err = CreateWindowFromNib(nibRef, CFSTR("ToolWindow"), &win); | } |
| #endif | else { |
| err = CreateWindowFromNib(nibRef, CFSTR("ToolWindow"), &win); | |
| } | |
| if (err == noErr) { | if (err == noErr) { |
| InstallStandardEventHandler(GetWindowEventTarget(win)); | InstallStandardEventHandler(GetWindowEventTarget(win)); |
| EventTypeSpec list[]={ | EventTypeSpec list[]={ |
| Line 796 void toolwin_open(void) { | Line 806 void toolwin_open(void) { |
| goto twope_err2; | goto twope_err2; |
| } | } |
| #ifndef JAGUAR | if (isPuma()) { |
| toolwincreate(hWnd); | toolwincreate(hWnd); |
| #endif | } |
| SizeWindow(hWnd, bounds.right-bounds.left, bounds.bottom-bounds.top, true); | SizeWindow(hWnd, bounds.right-bounds.left, bounds.bottom-bounds.top, true); |
| ControlButtonContentInfo info; | ControlButtonContentInfo info; |
| info.contentType = kControlContentPictHandle; | info.contentType = kControlContentPictHandle; |
| info.u.picture = hbmp; | info.u.picture = hbmp; |
| CreatePictureControl(hWnd, &bounds, &info, true, &image); | CreatePictureControl(hWnd, &bounds, &info, true, &image); |
| InstallControlEventHandler (image, NewEventHandlerUPP(cfControlproc), GetEventTypeCount(list), list, (void *)hWnd, &ref); | InstallControlEventHandler (image, NewEventHandlerUPP(cfControlproc), GetEventTypeCount(list), list, (void *)hWnd, &ref); |
| if (!isPuma()) { | |
| toolwincreate(hWnd); | |
| } | |
| #ifdef JAGUAR | if (isPuma()) { |
| toolwincreate(hWnd); | if (np2tool.posy < 35) np2tool.posy = 35; |
| #endif | if (np2tool.posx < 5 ) np2tool.posx = 5; |
| MoveWindow(hWnd, np2tool.posx, np2tool.posy, true); | |
| #ifndef JAGUAR | ShowWindow(hWnd); |
| if (np2tool.posy < 35) np2tool.posy = 35; | } |
| if (np2tool.posx < 5 ) np2tool.posx = 5; | else{ |
| MoveWindow(hWnd, np2tool.posx, np2tool.posy, true); | SetDrawerParent(hWnd, hWndMain); |
| ShowWindow(hWnd); | SetDrawerOffsets(hWnd, (640-(bounds.right-bounds.left))/2-11, (640-(bounds.right-bounds.left))/2-11); |
| #else | SetDrawerPreferredEdge(hWnd, kWindowEdgeTop); |
| SetDrawerParent(hWnd, hWndMain); | OpenDrawer(hWnd, kWindowEdgeDefault, 1); |
| SetDrawerOffsets(hWnd, (640-(bounds.right-bounds.left))/2-11, (640-(bounds.right-bounds.left))/2-11); | } |
| SetDrawerPreferredEdge(hWnd, kWindowEdgeTop); | |
| OpenDrawer(hWnd, kWindowEdgeDefault, 1); | |
| #endif | |
| return; | return; |
| Line 835 twope_err1: | Line 845 twope_err1: |
| void toolwin_close(void) { | void toolwin_close(void) { |
| if (toolwin.hwnd) { | if (toolwin.hwnd) { |
| #ifdef JAGUAR | if (!isPuma()) { |
| CloseDrawer(toolwin.hwnd, 0); | CloseDrawer(toolwin.hwnd, 0); |
| #else | } |
| DisposeWindow(toolwin.hwnd); | else{ |
| #endif | DisposeWindow(toolwin.hwnd); |
| } | |
| RemoveReceiveHandler(dr, toolwin.hwnd); | RemoveReceiveHandler(dr, toolwin.hwnd); |
| toolwindestroy(); | toolwindestroy(); |
| DisposeWindow(toolwin.hwnd); | DisposeWindow(toolwin.hwnd); |