2003/09/23 08:25:00
[org.ibex.core.git] / src / org / xwt / plat / Darwin.cc
index 6f4789d..f946729 100644 (file)
@@ -697,7 +697,7 @@ void Darwin$CarbonSurface::natInit(jboolean framed) {
     // FIXME: unframed windows should appear in the window menu
     // This probably needs a hack similar to whats in Cocoa.mm
     WindowAttributes attr =  kWindowStandardHandlerAttribute|
-        (framed ? kWindowInWindowMenuAttribute|kWindowStandardDocumentAttributes|kWindowLiveResizeAttribute : 0);
+      (framed ? kWindowInWindowMenuAttribute|kWindowStandardDocumentAttributes|kWindowLiveResizeAttribute : 0);
     OSStatus r;
     rect.top = 0; rect.left = 0; rect.bottom = 300; rect.right=300;
     EventHandlerUPP upp = WC(NewEventHandlerUPP)(our_windowEventHandler);
@@ -710,12 +710,14 @@ void Darwin$CarbonSurface::natInit(jboolean framed) {
     WindowDefSpec myCustomWindowSpec;
     myCustomWindowSpec.defType = kWindowDefObjectClass;
     myCustomWindowSpec.u.classRef = customWindow;
+
     r = WC(CreateCustomWindow) (&myCustomWindowSpec,
-                            kDocumentWindowClass,
-                            kWindowStandardHandlerAttribute | kWindowStandardDocumentAttributes, 
-                            &rect,
-                            &window); 
+                                kDocumentWindowClass,
+                                kWindowStandardHandlerAttribute | kWindowStandardDocumentAttributes, 
+                                &rect,
+                                &window);
 
+    //r = CreateNewWindow(kDocumentWindowClass, attr, &rect, &window);
     Darwin$CarbonSurface* me = this;
     WC(SetWindowProperty) (window, 'XWT!', 'XWT!', sizeof(me), &me);
     checkStatus(r,"WC(CreateNewWindow)");
@@ -738,9 +740,11 @@ void Darwin$CarbonSurface::natDispose() {
 void Darwin$CarbonSurface::natSetIcon(org::xwt::Picture *_p) {
 }
 
-void Darwin$CarbonSurface::natSetLocation(jint x, jint y) {
+void Darwin$CarbonSurface::natSetLocation() {
     WindowRef window = (WindowRef) rawWindowRef;
     Rect rect;
+    jint x = root->x;
+    jint y = root->y;
     OSStatus r = WC(GetWindowBounds)(window,kWindowStructureRgn,&rect);
     checkStatus(r,"WC(GetWindowBounds)");
     rect.bottom = y + (rect.bottom - rect.top);
@@ -1012,10 +1016,6 @@ void Darwin::_newBrowserWindow(jstring js) {
     WC(CFRelease)(url);
 }
 
-void Darwin::_exit() {
-    WC(QuitApplicationEventLoop)();
-}
-
 void Darwin::natInit() {     
     OSStatus r;
     #ifdef XWT_CARBON_NO_BUNDLE_HACK
@@ -1044,7 +1044,7 @@ void Darwin::natInit() {
     #endif
 }
 
-void Darwin::_running() {
+void Darwin::runApplicationEventLoop() {
     WC(RunApplicationEventLoop)();
     WC(ExitToShell)();
 }