mass rename and rebranding from xwt to ibex - fixed to use ixt files
[org.ibex.core.git] / src / org / ibex / plat / Darwin.cc
similarity index 96%
rename from src/org/xwt/plat/Darwin.cc
rename to src/org/ibex/plat/Darwin.cc
index fc05588..7adf0ee 100644 (file)
 #include <java/lang/Object.h>
 #include <java/lang/Error.h>
 
-#include <org/xwt/plat/Darwin.h>
-#include <org/xwt/plat/Darwin$CarbonSurface.h>
-#include <org/xwt/plat/Darwin$GLCarbonSurface.h>
-#include <org/xwt/plat/Darwin$GLCarbonPixelBuffer.h>
-#include <org/xwt/plat/Darwin$CarbonMessage.h>
-#include <org/xwt/plat/Darwin$CarbonOpenGL.h>
-#include <org/xwt/plat/Darwin$FileDialogHelper.h>
-#include <org/xwt/plat/GCJ$Retainer.h>
-#include <org/xwt/HTTP$Proxy.h>
-#include <org/xwt/util/Semaphore.h>
+#include <org/ibex/plat/Darwin.h>
+#include <org/ibex/plat/Darwin$CarbonSurface.h>
+#include <org/ibex/plat/Darwin$GLCarbonSurface.h>
+#include <org/ibex/plat/Darwin$GLCarbonPixelBuffer.h>
+#include <org/ibex/plat/Darwin$CarbonMessage.h>
+#include <org/ibex/plat/Darwin$CarbonOpenGL.h>
+#include <org/ibex/plat/Darwin$FileDialogHelper.h>
+#include <org/ibex/plat/GCJ$Retainer.h>
+#include <org/ibex/HTTP$Proxy.h>
+#include <org/ibex/util/Semaphore.h>
 
 #include <stdlib.h>
 #include <pthread.h>
 
 #include "DarwinCarbonHeaders.h"
 
-#define XWT_CARBON_NO_BUNDLE_HACK
-#ifdef XWT_CARBON_NO_BUNDLE_HACK
+#define Ibex_CARBON_NO_BUNDLE_HACK
+#ifdef Ibex_CARBON_NO_BUNDLE_HACK
 extern "C" {
     OSErr CPSEnableForegroundOperation(ProcessSerialNumber *psn);
     OSErr CPSSetFrontProcess(ProcessSerialNumber *psn);
@@ -161,12 +161,12 @@ declare_weak(NewWindowPaintUPP);
 #define InstallEventHandler WC(InstallEventHandler)
 #define __CFStringMakeConstantString WC(__CFStringMakeConstantString)
 
-using namespace org::xwt::plat;
+using namespace org::ibex::plat;
 using gnu::gcj::RawData;
-using org::xwt::util::Semaphore;
+using org::ibex::util::Semaphore;
 using java::lang::Object;
 
-namespace org { namespace xwt { namespace plat {
+namespace org { namespace ibex { namespace plat {
 
 
 #pragma mark ----- Blit Locks ------
@@ -256,9 +256,9 @@ class SmartCFString {
 };
 
 // CHECKME: Is just making up your own four char codes really correct?
-const static UInt32 kEventClassCarbonMessage = 'xwta';
-const static UInt32 kEventCarbonMessage = 'xwtb';
-const static UInt32 kEventParamCarbonMessage = 'xwtc';
+const static UInt32 kEventClassCarbonMessage = 'ibexa';
+const static UInt32 kEventCarbonMessage = 'ibexb';
+const static UInt32 kEventParamCarbonMessage = 'ibexc';
 
 static OSStatus carbonMessageEventHandler(EventHandlerCallRef handler, EventRef e, void *userData);
 static EventHandlerUPP carbonMessageEventHandlerUPP;
@@ -505,7 +505,7 @@ static OSStatus windowEventHandler(EventHandlerCallRef handler, EventRef e, void
                 case kEventRawKeyModifiersChanged: {
                     const static struct {
                         UInt32 mask;
-                        jstring xwtKey;
+                        jstring ibexKey;
                     } modifiersTable[] = {
                         { shiftKey,  JvNewStringLatin1("shift")     },
                         { alphaLock, JvNewStringLatin1("caps_lock") },
@@ -526,9 +526,9 @@ static OSStatus windowEventHandler(EventHandlerCallRef handler, EventRef e, void
                         UInt32 mask = modifiersTable[i].mask;
                         if(!(changedModifiers & mask)) continue;
                         if(newModifiers & mask)
-                            surface->KeyPressed(modifiersTable[i].xwtKey);
+                            surface->KeyPressed(modifiersTable[i].ibexKey);
                         else
-                            surface->KeyReleased(modifiersTable[i].xwtKey);
+                            surface->KeyReleased(modifiersTable[i].ibexKey);
                     }
                     return noErr;
                 }
@@ -558,27 +558,27 @@ static OSStatus windowEventHandler(EventHandlerCallRef handler, EventRef e, void
                 case kEventMouseUp: {
                     EventMouseButton button;
                     UInt32 clickCount;
-                    jint xwtButton;
+                    jint ibexButton;
                     r = WC(GetEventParameter)(e,kEventParamMouseButton,typeMouseButton,NULL,sizeof(button),NULL,&button);
                     checkStatus(r,"GetEventParameter");
                     r = WC(GetEventParameter)(e,kEventParamClickCount,typeUInt32,NULL,sizeof(clickCount),NULL,&clickCount);
                     checkStatus(r,"GetEventParameter");
                     
                     switch(button) {
-                        case kEventMouseButtonPrimary:   xwtButton = 1; break;
-                        case kEventMouseButtonSecondary: xwtButton = 2; break;
-                        case kEventMouseButtonTertiary:  xwtButton = 3; break;
+                        case kEventMouseButtonPrimary:   ibexButton = 1; break;
+                        case kEventMouseButtonSecondary: ibexButton = 2; break;
+                        case kEventMouseButtonTertiary:  ibexButton = 3; break;
                         default: return noErr;
                     }
                     if(eKind == kEventMouseDown) {
-                        surface->Press(xwtButton);
+                        surface->Press(ibexButton);
                     } else {
-                        surface->Release(xwtButton);
+                        surface->Release(ibexButton);
                         while(clickCount > 1) {
-                            surface->DoubleClick(xwtButton);
+                            surface->DoubleClick(ibexButton);
                             clickCount-=2;
                         }
-                        if(clickCount) surface->Click(xwtButton);
+                        if(clickCount) surface->Click(ibexButton);
                     }
                     return noErr;
                 }
@@ -591,7 +591,7 @@ static OSStatus windowEventHandler(EventHandlerCallRef handler, EventRef e, void
                     r = WC(GetEventParameter)(e,kEventParamMouseWheelDelta,typeSInt32,NULL,sizeof(delta),NULL,&delta);
                     checkStatus(r,"GetEventParameter");
                     fprintf(stderr,"kEventMouseWheelMoved: delta: %d",delta);
-                    // surface->MouseWheelMoved(...) IMPROVMENT: mouse wheel support in xwt
+                    // surface->MouseWheelMoved(...) IMPROVMENT: mouse wheel support in ibex
                     return noErr;
                 }
             }
@@ -739,7 +739,7 @@ void Darwin$CarbonSurface::natDispose() {
     WC(DisposeWindow)(window);
 }
 
-void Darwin$CarbonSurface::natSetIcon(org::xwt::Picture *_p) {
+void Darwin$CarbonSurface::natSetIcon(org::ibex::Picture *_p) {
 }
 
 void Darwin$CarbonSurface::natSetLocation() {
@@ -826,7 +826,7 @@ void fileDialogEventHandler(NavEventCallbackMessage callBackSelector, NavCBRecPt
 void Darwin::natFileDialog(Darwin$FileDialogHelper *helper,jstring suggestion_, jboolean write) {
     NavDialogRef dlg;
     SmartCFString suggestion = suggestion_;
-    CFStringRef message = CFSTR("By selecting a file in this dialog you are giving this XWT application permission to access that file.");
+    CFStringRef message = CFSTR("By selecting a file in this dialog you are giving this Ibex application permission to access that file.");
     OSStatus r;
     WindowRef window = WC(FrontWindow)();
     NavDialogCreationOptions options;
@@ -835,7 +835,7 @@ void Darwin::natFileDialog(Darwin$FileDialogHelper *helper,jstring suggestion_,
     options.optionFlags =
         (options.optionFlags|kNavAllFilesInPopup|kNavSelectAllReadableItem|kNavDontUseCustomFrame|kNavDontConfirmReplacement)
         &~(kNavAllowStationery|kNavAllowMultipleFiles);
-    options.clientName = CFSTR("XWT");
+    options.clientName = CFSTR("Ibex");
     if(write)
         options.saveFileName  = suggestion;
     options.message = message;
@@ -889,7 +889,7 @@ void Darwin::natSetClipBoard(jstring js) {
 }
 
 HTTP$Proxy *Darwin::natDetectProxy() {
-    using org::xwt::HTTP$Proxy;
+    using org::ibex::HTTP$Proxy;
     HTTP$Proxy *p=0;
     CFStringRef string;
     CFNumberRef number;
@@ -947,7 +947,7 @@ doproto(SOCKS,socks)
     */    
             
 /*
-    using org::xwt::Proxy;
+    using org::ibex::Proxy;
     AutoARP pool;
     Proxy *p=0;
     NSString *host;
@@ -1025,11 +1025,11 @@ void Darwin::natInit() {
     fileDialogEventHandlerUPP = WC(NewNavEventUPP)(fileDialogEventHandler);
     paintProcUPP = WC(NewWindowPaintUPP)(paintProc);
 
-    #ifdef XWT_CARBON_NO_BUNDLE_HACK
+    #ifdef Ibex_CARBON_NO_BUNDLE_HACK
     {        
         ProcessSerialNumber currentProcess = { 0, kCurrentProcess };
         
-        ::fprintf(stderr,"Doing XWT_CARBON_NO_BUNDLE_HACK\n");
+        ::fprintf(stderr,"Doing Ibex_CARBON_NO_BUNDLE_HACK\n");
         r = WC(GetCurrentProcess)(&currentProcess);
         checkStatus(r,"GetCurrentProcess");
         r = WC(CPSEnableForegroundOperation)( &currentProcess );
@@ -1278,7 +1278,7 @@ void Darwin$GLCarbonSurface::natDispose() {
     Darwin$CarbonSurface::natDispose();
 }
 
-} } } // end namepsace org::xwt::plat
+} } } // end namepsace org::ibex::plat