Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CocoaExecutor.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,7 @@
558B98751987FCBD00ADF159 /* default_ctab_values.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = default_ctab_values.cpp; sourceTree = "<group>"; };
558B98761987FCBD00ADF159 /* desk.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = desk.cpp; sourceTree = "<group>"; };
558B98771987FCBD00ADF159 /* desperate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = desperate.cpp; sourceTree = "<group>"; };
558B98781987FCBD00ADF159 /* device.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = device.cpp; sourceTree = "<group>"; usesTabs = 0; };
558B98781987FCBD00ADF159 /* device.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = device.cpp; sourceTree = "<group>"; };
558B98791987FCBD00ADF159 /* dialAlert.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dialAlert.cpp; sourceTree = "<group>"; };
558B987A1987FCBD00ADF159 /* dialCreate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dialCreate.cpp; sourceTree = "<group>"; };
558B987B1987FCBD00ADF159 /* dialDispatch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dialDispatch.cpp; sourceTree = "<group>"; };
Expand Down
29 changes: 14 additions & 15 deletions OSX-only/CocoaExecutor/NeXT Classes/NEXT.mm
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include "ResourceMgr.h"

using namespace Executor;
using namespace ByteSwap;

PUBLIC keyboard_enum_t Executor::ROMlib_keyboard_type;

Expand Down Expand Up @@ -373,8 +372,8 @@
#endif /* SANE_DEBUGGING */
)
{
p.h = BigEndianValue(MouseLocation.h);
p.v = BigEndianValue(MouseLocation.v);
p.h = CW(MouseLocation.h);
p.v = CW(MouseLocation.v);
ROMlib_PPostEvent(osEvt, SUSPENDRESUMEBITS|SUSPEND|CONVERTCLIPBOARD,
(HIDDEN_EvQElPtr *) 0, TickCount(), p, ROMlib_mods);
}
Expand All @@ -397,8 +396,8 @@
what = SUSPENDRESUMEBITS | RESUME;
if (cvtclip)
what |= CONVERTCLIPBOARD;
p.h = BigEndianValue(MouseLocation.h);
p.v = BigEndianValue(MouseLocation.v);
p.h = CW(MouseLocation.h);
p.v = CW(MouseLocation.v);
ROMlib_PPostEvent(osEvt, what, (HIDDEN_EvQElPtr *) 0, TickCount(),
p, ROMlib_mods);
}
Expand All @@ -408,8 +407,8 @@
{
Point p;

p.h = BigEndianValue(MouseLocation.h);
p.v = BigEndianValue(MouseLocation.v);
p.h = CW(MouseLocation.h);
p.v = CW(MouseLocation.v);
ROMlib_PPostEvent(keyDown, 0x0863, /* 0x63 == 'c' */
(HIDDEN_EvQElPtr *) 0, TickCount(), p, cmdKey|btnState);
ROMlib_PPostEvent(keyUp, 0x0863,
Expand All @@ -420,8 +419,8 @@
{
Point p;

p.h = BigEndianValue(MouseLocation.h);
p.v = BigEndianValue(MouseLocation.v);
p.h = CW(MouseLocation.h);
p.v = CW(MouseLocation.v);
ROMlib_PPostEvent(keyDown, 0x0976, /* 0x76 == 'v' */
(HIDDEN_EvQElPtr *) 0, TickCount(), p, cmdKey|btnState);
ROMlib_PPostEvent(keyUp, 0x0976,
Expand All @@ -431,8 +430,8 @@
PRIVATE void pinmouse(INTEGER *hp, INTEGER *vp, BOOLEAN swap)
{
if (swap) {
*hp = BigEndianValue(*hp);
*vp = BigEndianValue(*vp);
*hp = CW(*hp);
*vp = CW(*vp);
}

if (*hp < 0)
Expand All @@ -446,15 +445,15 @@ PRIVATE void pinmouse(INTEGER *hp, INTEGER *vp, BOOLEAN swap)
*vp = vdriver_height - 1;

if (swap) {
*hp = BigEndianValue(*hp);
*vp = BigEndianValue(*vp);
*hp = CW(*hp);
*vp = CW(*vp);
}
}

A1(PUBLIC, void, ROMlib_updatemouselocation, NSEvent *, neventp) /* INTERNAL */
{
MouseLocation.h = BigEndianValue ([neventp locationInWindow].x);
MouseLocation.v = BigEndianValue (vdriver_height - [neventp locationInWindow].y);
MouseLocation.h = CW ([neventp locationInWindow].x);
MouseLocation.v = CW (vdriver_height - [neventp locationInWindow].y);
pinmouse(&MouseLocation.h, &MouseLocation.v, TRUE);
}

Expand Down
3 changes: 2 additions & 1 deletion OSX-only/CocoaExecutor/NeXT Classes/NEXTkeyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ keyboard_enum_t Executor::ROMlib_get_keyboard_type( void )
{
NXEventHandle handle;
NXEventSystemDevice dev[NX_EVS_DEVICE_MAX];
unsigned int cnt = NX_EVS_DEVICE_INFO_COUNT, i;
unsigned int cnt, i;
int interface, id;
keyboard_enum_t retval;

if ( (handle = NXOpenEventStatus()) == 0 )
return no_keyboard;
cnt = NX_EVS_DEVICE_INFO_COUNT;
NXEventSystemInfo( handle, NX_EVS_DEVICE_INFO, (int *)dev, &cnt );
NXCloseEventStatus( handle );
interface = -1;
Expand Down
18 changes: 8 additions & 10 deletions OSX-only/CocoaExecutor/NeXT Classes/NEXTprint.mm
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
*/

namespace Executor {
using namespace ByteSwap;

void ROMlib_newFont(char *font, float txSize)
{
[[NSFont fontWithName:[NSString stringWithCString:font encoding:NSMacOSRomanStringEncoding] size:txSize] set];
Expand All @@ -33,8 +31,8 @@ void ROMlib_updatenextpagerect(comRect *rp)
NSSize new_paper_size;
virtual_int_state_t block = block_virtual_ints();

new_paper_size.height = BigEndianValue(rp->bottom) - BigEndianValue(rp->top);
new_paper_size.width = BigEndianValue(rp->right) - BigEndianValue(rp->left);
new_paper_size.height = CW(rp->bottom) - CW(rp->top);
new_paper_size.width = CW(rp->right) - CW(rp->left);
[[NSPrintInfo sharedPrintInfo] setPaperSize:new_paper_size];
restore_virtual_ints(block);
}
Expand All @@ -56,17 +54,17 @@ void ROMlib_updatemacpagerect(comRect *paperp, comRect *page1p,
CGFloat scaling_factor;

new_size = [[NSPrintInfo sharedPrintInfo] paperSize];
paperp->top = BigEndianValue(0 - HALFINCH);
paperp->left = BigEndianValue(0 - HALFINCH);
paperp->top = CW(0 - HALFINCH);
paperp->left = CW(0 - HALFINCH);

scaling_factor = printer_scaling_factor ();
paperp->bottom = BigEndianValue(new_size.height * (1 / scaling_factor) - HALFINCH);
paperp->right = BigEndianValue(new_size.width * (1 / scaling_factor) - HALFINCH);
paperp->bottom = CW(new_size.height * (1 / scaling_factor) - HALFINCH);
paperp->right = CW(new_size.width * (1 / scaling_factor) - HALFINCH);

page1p->top = page2p->top = 0;
page1p->left = page2p->left = 0;
page1p->bottom = page2p->bottom = BigEndianValue(BigEndianValue(paperp->bottom) - HALFINCH);
page1p->right = page2p->right = BigEndianValue(BigEndianValue(paperp->right) - HALFINCH);
page1p->bottom = page2p->bottom = CW(CW(paperp->bottom) - HALFINCH);
page1p->right = page2p->right = CW(CW(paperp->right) - HALFINCH);
restore_virtual_ints(block);
}
}
32 changes: 15 additions & 17 deletions src/AE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ boolean_t send_application_open_aevt_p;
AEDesc * desc_out);

}

using namespace Executor;
using namespace ByteSwap;


/* dispatching apple events */
Expand Down Expand Up @@ -80,7 +78,7 @@ P1 (PUBLIC pascal trap, OSErr, AEProcessAppleEvent,
if (err != bufferIsSmall)
AE_RETURN_ERROR (errAEEventNotHandled);

evt_data = NewHandle (BigEndianValue (evt_data_size));
evt_data = NewHandle (CL (evt_data_size));
if (MemError () != noErr)
AE_RETURN_ERROR (MemError ());

Expand Down Expand Up @@ -110,7 +108,7 @@ P1 (PUBLIC pascal trap, OSErr, AEProcessAppleEvent,
AEDisposeDesc (evt);
AE_RETURN_ERROR (err);
}
BigEndianInPlace (event_class);
event_class = CL (event_class);

err = AEGetAttributePtr (evt, keyEventIDAttr,
typeType, &dummy_type,
Expand All @@ -120,7 +118,7 @@ P1 (PUBLIC pascal trap, OSErr, AEProcessAppleEvent,
AEDisposeDesc (evt);
AE_RETURN_ERROR (err);
}
event_id = BigEndianValue (event_id);
event_id = CL (event_id);

err = AEGetEventHandler (event_class, event_id, &hdlr, &refcon, FALSE);
if (err != noErr)
Expand All @@ -133,7 +131,7 @@ P1 (PUBLIC pascal trap, OSErr, AEProcessAppleEvent,
}
}
hdlr = MR (hdlr);
refcon = BigEndianValue (refcon);
refcon = CL (refcon);

{
AppleEvent *reply = (AppleEvent*)alloca (sizeof *reply);
Expand All @@ -151,7 +149,7 @@ P1 (PUBLIC pascal trap, OSErr, AEProcessAppleEvent,
/* dummy */ -1, /* dummy */ -1,
reply);

retval = CToPascalCall (&hdlr,
retval = CToPascalCall ((void*)hdlr,
CTOP_EventHandlerTemplate,
evt, reply, refcon);

Expand Down Expand Up @@ -187,8 +185,8 @@ P7 (PUBLIC pascal trap, OSErr, AESend,
/* ### not sure what error we should return here */
AE_RETURN_ERROR (errAEEventNotHandled);

target_type = BigEndianValue (target_type);
target_size = BigEndianValue (target_size);
target_type = CL (target_type);
target_size = CL (target_size);

if (err != noErr)
AE_RETURN_ERROR (err);
Expand Down Expand Up @@ -434,7 +432,7 @@ P5 (PUBLIC pascal trap, OSErr, AECoercePtr,

/* swap things to a normal state */
coercion_hdlr = MR (coercion_hdlr);
BigEndianInPlace (refcon);
refcon = CL (refcon);

if (is_desc_hdlr_p)
{
Expand All @@ -444,14 +442,14 @@ P5 (PUBLIC pascal trap, OSErr, AECoercePtr,
if (err != noErr)
return memFullErr;

err = CToPascalCall (&coercion_hdlr, PTOC_CoerceDescTemplate,
err = CToPascalCall ((void*)coercion_hdlr, PTOC_CoerceDescTemplate,
desc, result_type, refcon, desc_out);

AEDisposeDesc (desc);
}
else
{
err = CToPascalCall (&coercion_hdlr, PTOC_CoercePtrTemplate,
err = CToPascalCall ((void*)coercion_hdlr, PTOC_CoercePtrTemplate,
data_type, data, data_size, result_type,
refcon, desc_out);
}
Expand Down Expand Up @@ -484,7 +482,7 @@ parse_evt (const AppleEvent *evtp, AEDesc *desc_out)
LONGINT n;

retval = AECountItems (&d, &n);
n = BigEndianValue (n);
n = CL (n);
if (retval == noErr)
{
Handle h;
Expand All @@ -498,7 +496,7 @@ parse_evt (const AppleEvent *evtp, AEDesc *desc_out)
LONGINT l;

p->magic = CLC (APP_PARAMS_MAGIC);
p->n_fsspec = BigEndianValue (n);
p->n_fsspec = CW (n);
for (l = 1; retval == noErr && l <= n; ++l)
{
AEDesc d2;
Expand Down Expand Up @@ -568,11 +566,11 @@ P3 (PUBLIC pascal trap, OSErr, AECoerceDesc,

/* swap things to a normal state */
coercion_hdlr = MR (coercion_hdlr);
refcon = BigEndianValue (refcon);
refcon = CL (refcon);

if (is_desc_hdlr_p)
{
err = CToPascalCall (&coercion_hdlr, PTOC_CoerceDescTemplate,
err = CToPascalCall((void*)coercion_hdlr, PTOC_CoerceDescTemplate,
desc, result_type, refcon, desc_out);
}
else
Expand All @@ -584,7 +582,7 @@ P3 (PUBLIC pascal trap, OSErr, AECoerceDesc,
LOCK_HANDLE_EXCURSION_1
(desc_data,
{
err = CToPascalCall (&coercion_hdlr, PTOC_CoercePtrTemplate,
err = CToPascalCall((void*)coercion_hdlr, PTOC_CoercePtrTemplate,
desc_type, STARH (desc_data),
GetHandleSize (desc_data),
result_type, refcon, desc_out);
Expand Down
Loading