#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);
#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 ------
};
// 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;
case kEventRawKeyModifiersChanged: {
const static struct {
UInt32 mask;
- jstring xwtKey;
+ jstring ibexKey;
} modifiersTable[] = {
{ shiftKey, JvNewStringLatin1("shift") },
{ alphaLock, JvNewStringLatin1("caps_lock") },
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;
}
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;
}
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;
}
}
WC(DisposeWindow)(window);
}
-void Darwin$CarbonSurface::natSetIcon(org::xwt::Picture *_p) {
+void Darwin$CarbonSurface::natSetIcon(org::ibex::Picture *_p) {
}
void Darwin$CarbonSurface::natSetLocation() {
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;
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;
}
HTTP$Proxy *Darwin::natDetectProxy() {
- using org::xwt::HTTP$Proxy;
+ using org::ibex::HTTP$Proxy;
HTTP$Proxy *p=0;
CFStringRef string;
CFNumberRef number;
*/
/*
- using org::xwt::Proxy;
+ using org::ibex::Proxy;
AutoARP pool;
Proxy *p=0;
NSString *host;
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)(¤tProcess);
checkStatus(r,"GetCurrentProcess");
r = WC(CPSEnableForegroundOperation)( ¤tProcess );
Darwin$CarbonSurface::natDispose();
}
-} } } // end namepsace org::xwt::plat
+} } } // end namepsace org::ibex::plat