DIRECTOR: Add stubbed AppleCD, Barake, JITDraw3 and MiscX XObjs; add more functions to memoryxobj and flushxobj

This commit is contained in:
eientei 2022-06-23 09:21:17 +12:00 committed by Eugene Sandulenko
parent 9da200007e
commit 356e1264df
14 changed files with 774 additions and 35 deletions

View File

@ -37,14 +37,18 @@
#include "director/lingo/lingo-the.h"
#include "director/lingo/xlibs/aiff.h"
#include "director/lingo/xlibs/applecdxobj.h"
#include "director/lingo/xlibs/barakeobj.h"
#include "director/lingo/xlibs/cdromxobj.h"
#include "director/lingo/xlibs/fileio.h"
#include "director/lingo/xlibs/flushxobj.h"
#include "director/lingo/xlibs/fplayxobj.h"
#include "director/lingo/xlibs/gpid.h"
#include "director/lingo/xlibs/jwxini.h"
#include "director/lingo/xlibs/jitdraw3.h"
#include "director/lingo/xlibs/labeldrvxobj.h"
#include "director/lingo/xlibs/memoryxobj.h"
#include "director/lingo/xlibs/miscx.h"
#include "director/lingo/xlibs/movemousexobj.h"
#include "director/lingo/xlibs/movutils.h"
#include "director/lingo/xlibs/orthoplayxobj.h"
@ -68,21 +72,21 @@ static struct PredefinedProto {
int version;
} predefinedMethods[] = {
// all except window
{ "new", LM::m_new, -1, 0, kAllObj, 200 }, // D2
{ "new", LM::m_new, -1, 0, kAllObj, 200 }, // D2
// factory and XObject
{ "describe", LM::m_describe, 0, 0, kXObj, 200 }, // D2
{ "dispose", LM::m_dispose, 0, 0, kFactoryObj | kXObj, 200 }, // D2
{ "get", LM::m_get, 1, 1, kFactoryObj, 200 }, // D2
{ "instanceRespondsTo", LM::m_instanceRespondsTo, 1, 1, kXObj, 300 }, // D3
{ "messageList", LM::m_messageList, 0, 0, kXObj, 300 }, // D3
{ "name", LM::m_name, 0, 0, kXObj, 300 }, // D3
{ "perform", LM::m_perform, -1, 0, kFactoryObj | kXObj, 300 }, // D3
{ "instanceRespondsTo", LM::m_instanceRespondsTo, 1, 1, kXObj, 300 }, // D3
{ "messageList", LM::m_messageList, 0, 0, kXObj, 300 }, // D3
{ "name", LM::m_name, 0, 0, kXObj, 300 }, // D3
{ "perform", LM::m_perform, -1, 0, kFactoryObj | kXObj, 300 }, // D3
{ "put", LM::m_put, 2, 2, kFactoryObj, 200 }, // D2
{ "respondsTo", LM::m_respondsTo, 1, 1, kXObj, 200 }, // D2
// script object and Xtra
{ "birth", LM::m_new, -1, 0, kScriptObj | kXtraObj, 400 }, // D4
{ "birth", LM::m_new, -1, 0, kScriptObj | kXtraObj, 400 }, // D4
{ nullptr, nullptr, 0, 0, 0, 0 }
};
@ -127,25 +131,29 @@ static struct XLibProto {
int version;
} xlibs[] = {
{ AiffXObj::fileNames, AiffXObj::open, AiffXObj::close, kXObj, 400 }, // D4
{ AppleCDXObj::fileNames, AppleCDXObj::open, AppleCDXObj::close, kXObj, 400 }, // D4
{ BarakeObj::fileNames, BarakeObj::open, BarakeObj::close, kXObj, 400 }, // D4
{ CDROMXObj::fileNames, CDROMXObj::open, CDROMXObj::close, kXObj, 200 }, // D2
{ FileIO::fileNames, FileIO::open, FileIO::close, kXObj | kXtraObj, 200 }, // D2
{ FlushXObj::fileNames, FlushXObj::open, FlushXObj::close, kXObj, 400 }, // D4
{ FlushXObj::fileNames, FlushXObj::open, FlushXObj::close, kXObj, 300 }, // D3
{ FPlayXObj::fileNames, FPlayXObj::open, FPlayXObj::close, kXObj, 200 }, // D2
{ GpidXObj::fileNames, GpidXObj::open, GpidXObj::close, kXObj, 400 }, // D4
{ LabelDrvXObj::fileNames, LabelDrvXObj::open, LabelDrvXObj::close, kXObj, 400 }, // D4
{ OrthoPlayXObj::fileNames, OrthoPlayXObj::open, OrthoPlayXObj::close, kXObj, 400 }, // D4
{ JourneyWareXINIXObj::fileNames, JourneyWareXINIXObj::open, JourneyWareXINIXObj::close, kXObj, 400 }, // D4
{ PalXObj::fileNames, PalXObj::open, PalXObj::close, kXObj, 400 }, // D4
{ MemoryXObj::fileNames, MemoryXObj::open, MemoryXObj::close, kXObj, 400 }, // D4
{ MovUtilsXObj::fileNames, MovUtilsXObj::open, MovUtilsXObj::close, kXObj, 400 }, // D4
{ PopUpMenuXObj::fileNames, PopUpMenuXObj::open, PopUpMenuXObj::close, kXObj, 200 }, // D2
{ JITDraw3XObj::fileNames, JITDraw3XObj::open, JITDraw3XObj::close, kXObj, 400 }, // D4
{ JourneyWareXINIXObj::fileNames, JourneyWareXINIXObj::open, JourneyWareXINIXObj::close, kXObj, 400 }, // D4
{ LabelDrvXObj::fileNames, LabelDrvXObj::open, LabelDrvXObj::close, kXObj, 400 }, // D4
{ MemoryXObj::fileNames, MemoryXObj::open, MemoryXObj::close, kXObj, 300 }, // D3
{ MiscX::fileNames, MiscX::open, MiscX::close, kXObj, 400 }, // D4
{ MoveMouseXObj::fileNames, MoveMouseXObj::open, MoveMouseXObj::close, kXObj, 400 }, // D4
{ MovUtilsXObj::fileNames, MovUtilsXObj::open, MovUtilsXObj::close, kXObj, 400 }, // D4
{ OrthoPlayXObj::fileNames, OrthoPlayXObj::open, OrthoPlayXObj::close, kXObj, 400 }, // D4
{ PalXObj::fileNames, PalXObj::open, PalXObj::close, kXObj, 400 }, // D4
{ PopUpMenuXObj::fileNames, PopUpMenuXObj::open, PopUpMenuXObj::close, kXObj, 200 }, // D2
{ RearWindowXObj::fileNames, RearWindowXObj::open, RearWindowXObj::close, kXObj, 400 }, // D4
{ RegisterComponent::fileNames, RegisterComponent::open, RegisterComponent::close, kXObj, 400 }, // D4
{ SerialPortXObj::fileNames, SerialPortXObj::open, SerialPortXObj::close, kXObj, 200 }, // D2
{ SoundJam::fileNames, SoundJam::open, SoundJam::close, kXObj, 400 }, // D4
{ RegisterComponent::fileNames, RegisterComponent::open, RegisterComponent::close, kXObj, 400 }, // D4
{ VideodiscXObj::fileNames, VideodiscXObj::open, VideodiscXObj::close, kXObj, 200 }, // D2
{ RearWindowXObj::fileNames, RearWindowXObj::open, RearWindowXObj::close, kXObj, 400 }, // D4
{ MoveMouseXObj::fileNames, MoveMouseXObj::open, MoveMouseXObj::close, kXObj, 400 }, // D4
{ XPlayAnim::fileNames, XPlayAnim::open, XPlayAnim::close, kXObj, 300 }, // D3
{ VideodiscXObj::fileNames, VideodiscXObj::open, VideodiscXObj::close, kXObj, 200 }, // D2
{ XPlayAnim::fileNames, XPlayAnim::open, XPlayAnim::close, kXObj, 300 }, // D3
{ nullptr, nullptr, nullptr, 0, 0 }
};

View File

@ -0,0 +1,141 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/*************************************
*
* USED IN:
* The Daedalus Encounter
*
*************************************/
/* -! Category compactDisc
* -! Title AppleCD SC
* -! Protocol Ortho-Play 1.6.1
* --© 1990,1991 MacroMind, Inc. Alan McNeil
* ------------------------------------------------------
* --AppleCD SC, version 2.5.6
* --Mar 7 1994
* --including AppleCD SC Plus volume control
* ------------------------------------------------------
* X mNew
* X mDispose
* --
* I mGetMaxNodes
* SI mGetNodeTitle NodeNum
* II mSelectNode NodeNum
* --
* I mService
* I mGetValue
* I mCancel
* S mExplain
* I mIdle
* --
* X mReadStatus
* X mReadPos
* XI mSearchTo position
* X mPlay
* X mStill
* X mStop
* X mScanForward
* X mScanReverse
* X mEject
* --
* I mGetFirstTrack
* I mGetLastTrack
* II mGetFirstFrame tracknum
* II mGetLastFrame tracknum
* I mGetTrack
* XII mAudioEnable number number
* I mGetFrameResolution
* --
* II mSetInPoint frame
* II mSetOutPoint frame
* II mSetDuration frames
* --
* X mPlayCue
* X mPlaySegment
* --
* S mTitle
* SI mTrackName tracknum
* IS mSetTitle string
* IIS mSetTrackName tracknum string
* II mGetTrackType tracknum
* III mSetVolume leftVolume rightVolume
* II mGetVolume leftFlag
* --
*/
#include "director/director.h"
#include "director/lingo/lingo.h"
#include "director/lingo/lingo-object.h"
#include "director/lingo/xlibs/applecdxobj.h"
namespace Director {
const char *AppleCDXObj::xlibName = "AppleCD";
const char *AppleCDXObj::fileNames[] = {
"AppleCD",
0
};
static MethodProto xlibMethods[] = {
{ "new", AppleCDXObj::m_new, 0, 0, 400 }, // D4
{ "Service", AppleCDXObj::m_service, 0, 0, 400 }, // D4
{ "ReadStatus", AppleCDXObj::m_readStatus, 0, 0, 400 }, // D4
{ "Eject", AppleCDXObj::m_eject, 0, 0, 400 }, // D4
{ nullptr, nullptr, 0, 0, 0 }
};
void AppleCDXObj::open(int type) {
if (type == kXObj) {
AppleCDXObject::initMethods(xlibMethods);
AppleCDXObject *xobj = new AppleCDXObject(kXObj);
g_lingo->_globalvars[xlibName] = xobj;
}
}
void AppleCDXObj::close(int type) {
if (type == kXObj) {
AppleCDXObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
}
AppleCDXObject::AppleCDXObject(ObjectType ObjectType) :Object<AppleCDXObject>("AppleCDXObj") {
_objType = ObjectType;
}
void AppleCDXObj::m_new(int nargs) {
g_lingo->push(g_lingo->_currentMe);
}
void AppleCDXObj::m_service(int nargs) {
g_lingo->push(Datum(0));
}
void AppleCDXObj::m_readStatus(int nargs) {
}
void AppleCDXObj::m_eject(int nargs) {
}
} // End of namespace Director

View File

@ -0,0 +1,49 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef DIRECTOR_LINGO_XLIBS_APPLECDXOBJ_H
#define DIRECTOR_LINGO_XLIBS_APPLECDXOBJ_H
namespace Director {
class AppleCDXObject : public Object<AppleCDXObject> {
public:
AppleCDXObject(ObjectType objType);
};
namespace AppleCDXObj {
extern const char *xlibName;
extern const char *fileNames[];
void open(int type);
void close(int type);
void m_new(int nargs);
void m_service(int nargs);
void m_readStatus(int nargs);
void m_eject(int nargs);
} // End of namespace AppleCDXObj
} // End of namespace Director
#endif

View File

@ -0,0 +1,96 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/*************************************
*
* USED IN:
* Angel Gate demo
*
*************************************/
/*
-- Picter, a simple demo XObject, v1.0
I mNew
XIII mGpal, h, l, s
XIIIIII mLine, y1, y2, y3, y4, y5, c
II mGetDate, value
X mClear
*/
#include "director/director.h"
#include "director/lingo/lingo.h"
#include "director/lingo/lingo-object.h"
#include "director/lingo/xlibs/barakeobj.h"
namespace Director {
const char *BarakeObj::xlibName = "BarakeObj";
const char *BarakeObj::fileNames[] = {
"BarakeObj",
0
};
static MethodProto xlibMethods[] = {
{ "new", BarakeObj::m_new, 0, 0, 400 }, // D4
{ "Clear", BarakeObj::m_clear, 0, 0, 400 }, // D4
{ "Gpal", BarakeObj::m_gpal, 3, 3, 400 }, // D4
{ "Line", BarakeObj::m_line, 6, 6, 400 }, // D4
{ nullptr, nullptr, 0, 0, 0 }
};
void BarakeObj::open(int type) {
if (type == kXObj) {
BarakeObject::initMethods(xlibMethods);
BarakeObject *xobj = new BarakeObject(kXObj);
g_lingo->_globalvars[xlibName] = xobj;
}
}
void BarakeObj::close(int type) {
if (type == kXObj) {
BarakeObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
}
BarakeObject::BarakeObject(ObjectType ObjectType) :Object<BarakeObject>("BarakeObj") {
_objType = ObjectType;
}
void BarakeObj::m_new(int nargs) {
g_lingo->push(g_lingo->_currentMe);
}
void BarakeObj::m_clear(int nargs) {
}
void BarakeObj::m_gpal(int nargs) {
g_lingo->printSTUBWithArglist("BarakeObj::Gpal", nargs);
g_lingo->dropStack(nargs);
}
void BarakeObj::m_line(int nargs) {
g_lingo->printSTUBWithArglist("BarakeObj::Line", nargs);
g_lingo->dropStack(nargs);
}
} // End of namespace Director

View File

@ -0,0 +1,49 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef DIRECTOR_LINGO_XLIBS_BARAKEOBJ_H
#define DIRECTOR_LINGO_XLIBS_BARAKEOBJ_H
namespace Director {
class BarakeObject : public Object<BarakeObject> {
public:
BarakeObject(ObjectType objType);
};
namespace BarakeObj {
extern const char *xlibName;
extern const char *fileNames[];
void open(int type);
void close(int type);
void m_new(int nargs);
void m_clear(int nargs);
void m_gpal(int nargs);
void m_line(int nargs);
} // End of namespace BarakeObj
} // End of namespace Director
#endif

View File

@ -47,16 +47,18 @@ const char *FlushXObj::xlibNames[] = {
nullptr,
};
const char *FlushXObj::fileNames[] = {
"FlushEvents",
"FlushXObj",
"Johnny",
"Toilet",
nullptr
};
static MethodProto xlibMethods[] = {
{ "new", FlushXObj::m_new, 0, 0, 400 }, // D4
{ "new", FlushXObj::m_new, 0, 0, 300 }, // D3
{ "AddToMask", FlushXObj::m_addToMask, 2, 2, 400 }, // D4
{ "ClearMask", FlushXObj::m_clearMask, 0, 0, 400 }, // D4
{ "Flush", FlushXObj::m_flush, 0, 0, 400 }, // D4
{ "Flush", FlushXObj::m_flush, 0, 0, 300 }, // D3
{ "FlushEvents", FlushXObj::m_flushEvents, 2, 2, 400 }, // D4
{ nullptr, nullptr, 0, 0, 0 }
};

View File

@ -0,0 +1,160 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/*
-- JITDraw3 External Factory. 16Feb93 PTM
JITDraw3
I mNew --Creates a new instance of the XObject
X mDispose --Disposes of XObject instance
S mName --Returns the XObject name (JITDraw3)
I mCheckRegistration
I mCheckIfCDROM
S mUserName
S mUserCompany
IS mSetSignature
S mGetSignature
S mPreRegister
II mBookMark1
II mBookMark2
II mBookMark3
II mBookMark4
II mBookMark5
II mBookMark6
I mAddDrawButton
I mRemoveDrawButton
I mGotoDraw
I mLoadDraw
I mIsDrawLoaded
ISS mMsgOkCancel
ISS mMsgOk
ISS mMsgYesNo
I mOrder
*/
#include "common/system.h"
#include "common/translation.h"
#include "gui/message.h"
// #include "audio/mixer.h"
#include "director/director.h"
#include "director/lingo/lingo.h"
#include "director/lingo/lingo-object.h"
#include "director/lingo/xlibs/jitdraw3.h"
namespace Director {
const char *JITDraw3XObj::xlibName = "JITDraw3";
const char *JITDraw3XObj::fileNames[] = {
"JITDraw3",
nullptr
};
static MethodProto xlibMethods[] = {
{ "New", JITDraw3XObj::m_new, 0, 0, 400 }, // D4
{ "Dispose", JITDraw3XObj::m_dispose, 0, 0, 400 }, // D4
{ "CheckIfCDROM", JITDraw3XObj::m_checkifcdrom, 0, 0, 400 }, // D4
{ "MsgOkCancel", JITDraw3XObj::m_msgokcancel, 2, 2, 400 }, // D4
{ "MsgOk", JITDraw3XObj::m_msgok, 2, 2, 400 }, // D4
{ "MsgYesNo", JITDraw3XObj::m_msgyesno, 2, 2, 400 }, // D4
{ "GotoDraw", JITDraw3XObj::m_gotodraw, 0, 0, 400 }, // D4
{ "AddDrawButton", JITDraw3XObj::m_adddrawbutton, 0, 0, 400 }, // D4
{ "RemoveDrawButton", JITDraw3XObj::m_removedrawbutton, 0, 0, 400 }, // D4
{ nullptr, nullptr, 0, 0, 0 }
};
void JITDraw3XObj::open(int type) {
if (type == kXObj) {
JITDraw3XObject::initMethods(xlibMethods);
JITDraw3XObject *xobj = new JITDraw3XObject(kXObj);
g_lingo->_globalvars[xlibName] = xobj;
}
}
void JITDraw3XObj::close(int type) {
if (type == kXObj) {
JITDraw3XObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
}
JITDraw3XObject::JITDraw3XObject(ObjectType ObjectType) :Object<JITDraw3XObject>("JITDraw3") {
_objType = ObjectType;
}
void JITDraw3XObj::m_new(int nargs) {
g_lingo->push(g_lingo->_currentMe);
}
void JITDraw3XObj::m_dispose(int nargs) {
g_lingo->printSTUBWithArglist("JITDraw3XObj::m_dispose", nargs);
g_lingo->dropStack(nargs);
}
void JITDraw3XObj::m_checkifcdrom(int nargs) {
g_lingo->printSTUBWithArglist("JITDraw3XObj::m_checkifcdrom", nargs);
g_lingo->push(Datum(0));
}
void JITDraw3XObj::m_msgokcancel(int nargs) {
Common::U32String caption = g_lingo->pop().asString(); // Title of the message box
Common::U32String message = g_lingo->pop().asString();
GUI::MessageDialog dialog(message, _("Ok"), _("Cancel"));
int result = dialog.runModal();
g_lingo->push(Datum(result == GUI::kMessageOK ? 1 : 0));
}
void JITDraw3XObj::m_msgok(int nargs) {
Common::U32String caption = g_lingo->pop().asString(); // Title of the message box
Common::U32String message = g_lingo->pop().asString();
GUI::MessageDialog dialog(message, _("Ok"));
dialog.runModal();
g_lingo->push(Datum());
}
void JITDraw3XObj::m_msgyesno(int nargs) {
Common::U32String caption = g_lingo->pop().asString(); // Title of the message box
Common::U32String message = g_lingo->pop().asString();
GUI::MessageDialog dialog(message, _("Yes"), _("No"));
int result = dialog.runModal();
g_lingo->push(Datum(result == GUI::kMessageOK ? 1 : 0));
}
void JITDraw3XObj::m_gotodraw(int nargs) {
g_lingo->printSTUBWithArglist("JITDraw3XObj::m_gotodraw", nargs);
g_lingo->dropStack(nargs);
g_lingo->push(Datum(3));
}
void JITDraw3XObj::m_adddrawbutton(int nargs) {
g_lingo->printSTUBWithArglist("JITDraw3XObj::m_adddrawbutton", nargs);
g_lingo->dropStack(nargs);
}
void JITDraw3XObj::m_removedrawbutton(int nargs) {
g_lingo->printSTUBWithArglist("JITDraw3XObj::m_removedrawbutton", nargs);
g_lingo->dropStack(nargs);
}
} // End of namespace Director

View File

@ -0,0 +1,54 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef DIRECTOR_LINGO_XLIBS_JITDRAW3XOBJ_H
#define DIRECTOR_LINGO_XLIBS_JITDRAW3XOBJ_H
namespace Director {
class JITDraw3XObject : public Object<JITDraw3XObject> {
public:
JITDraw3XObject(ObjectType objType);
};
namespace JITDraw3XObj {
extern const char *xlibName;
extern const char *fileNames[];
void open(int type);
void close(int type);
void m_new(int nargs);
void m_dispose(int nargs);
void m_checkifcdrom(int nargs);
void m_msgokcancel(int nargs);
void m_msgok(int nargs);
void m_msgyesno(int nargs);
void m_gotodraw(int nargs);
void m_adddrawbutton(int nargs);
void m_removedrawbutton(int nargs);
} // End of namespace JITDraw3XObj
} // End of namespace Director
#endif

View File

@ -58,13 +58,14 @@ namespace Director {
const char *MemoryXObj::xlibName = "Memory";
const char *MemoryXObj::fileNames[] = {
"Memory XObj",
"Memory",
nullptr
};
static MethodProto xlibMethods[] = {
{ "new", MemoryXObj::m_new, 0, 0, 400 }, // D4
{ "Clear", MemoryXObj::m_clear, 0, 0, 400 }, // D4
{ "new", MemoryXObj::m_new, 0, 0, 300 }, // D3
{ "Clear", MemoryXObj::m_clear, 0, 0, 300 }, // D3
{ "Purge", MemoryXObj::m_purge, 0, 0, 400 }, // D4
{ nullptr, nullptr, 0, 0, 0 }
};
@ -90,16 +91,13 @@ MemoryXObject::MemoryXObject(ObjectType ObjectType) :Object<MemoryXObject>("Memo
}
void MemoryXObj::m_new(int nargs) {
// Datum d1 = g_lingo->pop();
g_lingo->push(g_lingo->_currentMe);
}
void MemoryXObj::m_clear(int nargs) {
// g_lingo->pop();
}
void MemoryXObj::m_purge(int nargs) {
// g_lingo->pop();
}
} // End of namespace Director

View File

@ -0,0 +1,117 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/*************************************
*
* USED IN:
* Pippi
*
*************************************/
/* -- Misc_X, Misc Utilities XObject v2.0
* Misc_X
* I mNew
* X mDispose
* S mBootName -- get the name of the boot disk
* S mWindowsDirectory -- get the path to the Windows directory
* IS mFileExists, filePath -- return 1 if file is there, otherwise 0
* ISS mCopyFile, sourcePath, destPath -- return 1 if successful, otherwise 0
* IS mFolderExists, folderPath -- return 1 if folder exists, otherwise 0
* IS mInsureFolder, folderPath -- create a full path to the folder, return possible error
* XS mDeleteFolder, folderPath -- delete folder along with contents
* SS mFileList, fontainerPath -- return list of files in the folder
* SSSSS mAsk, query, default, btnOK, btnCancel -- dialog box that accepts user input
* SSSSS mAnswer, query, btnL, btnM, btnR -- alert type dialog box with variable number of buttons
* IS mSpaceOnVol, volumeName -- return the number of free bytes on volume
* IS mDeleteGroup, groupName -- delete program group under Windows
* ----
* -- Copyright 1994 Sanctuary Woods --
* -- written by Bob McKay and Brian Parkinson
* --
* -- Append folder name in mInsureFolder with a colon
* -- gXObject(mInsureFolder, the pathName & "bands:genesis:"
* --
* -- The mAsk dialog box returns the text field if btnOk clicked, otherwise the btnCancel text
* -- The mAnswer dialog box returns the text of the button clicked
* --
* -- For mAnswer dialog box, the number of buttons is variable
* -- gXObject(mAnswer, "Are you sure ?", "", "Yes", "No") -- two buttons
* -- gXObject(mAnswer, "A simple alert box", "", "", "Ok") -- one button
* ----
*/
#include "director/director.h"
#include "director/lingo/lingo.h"
#include "director/lingo/lingo-object.h"
#include "director/lingo/xlibs/miscx.h"
namespace Director {
const char *MiscX::xlibName = "Misc_X";
const char *MiscX::fileNames[] = {
"MISC_X",
0
};
static MethodProto xlibMethods[] = {
{ "new", MiscX::m_new, 0, 0, 400 }, // D4
{ "BootName", MiscX::m_bootName, 0, 0, 400 }, // D4
{ "InsureFolder", MiscX::m_insureFolder, 1, 1, 400 }, // D4
{ "PrefsFolder", MiscX::m_prefsFolder, 0, 0, 400 }, // D4
{ nullptr, nullptr, 0, 0, 0 }
};
void MiscX::open(int type) {
if (type == kXObj) {
MiscXObject::initMethods(xlibMethods);
MiscXObject *xobj = new MiscXObject(kXObj);
g_lingo->_globalvars[xlibName] = xobj;
}
}
void MiscX::close(int type) {
if (type == kXObj) {
MiscXObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
}
MiscXObject::MiscXObject(ObjectType ObjectType) :Object<MiscXObject>("MiscX") {
_objType = ObjectType;
}
void MiscX::m_new(int nargs) {
g_lingo->push(g_lingo->_currentMe);
}
void MiscX::m_bootName(int nargs) {
g_lingo->push(Datum(""));
}
void MiscX::m_insureFolder(int nargs) {
}
void MiscX::m_prefsFolder(int nargs) {
g_lingo->push(Datum(""));
}
} // End of namespace Director

View File

@ -0,0 +1,49 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef DIRECTOR_LINGO_XLIBS_MISCX_H
#define DIRECTOR_LINGO_XLIBS_MISCX_H
namespace Director {
class MiscXObject : public Object<MiscXObject> {
public:
MiscXObject(ObjectType objType);
};
namespace MiscX {
extern const char *xlibName;
extern const char *fileNames[];
void open(int type);
void close(int type);
void m_new(int nargs);
void m_bootName(int nargs);
void m_insureFolder(int nargs);
void m_prefsFolder(int nargs);
} // End of namespace MiscX
} // End of namespace Director
#endif

View File

@ -39,9 +39,10 @@ namespace Director {
const char *RearWindowXObj::xlibName = "RearWindow";
const char *RearWindowXObj::fileNames[] = {
"Backdrop",
"RearWindow",
"RearWindow.Xobj",
"winXObj",
"RearWindow",
nullptr
};
@ -225,14 +226,15 @@ X mDispose -- closes the RearWindow, releases its data, and the XObject itself f
static MethodProto xlibMethods[] = {
{ "new", RearWindowXObj::m_new, 1, 1, 400 }, // D4
{ "getappname", RearWindowXObj::m_getAppName, 0, 0, 400 }, // D4
{ "GetMemoryNeeded", RearWindowXObj::m_getMemoryNeeded, 0, 0, 400 }, // D4
{ "PatToWindow", RearWindowXObj::m_patToWindow, 1, 1, 400 }, // D4
{ "IndexColorToWindow", RearWindowXObj::m_indexColorToWindow, 1, 1, 400 }, // D4
{ "RGBColorToWindow", RearWindowXObj::m_rgbColorToWindow, 3, 3, 400 }, // D4
{ "GetScreenTop", RearWindowXObj::m_getScreenTop, 0, 0, 400 }, // D4
{ "GetScreenLeft", RearWindowXObj::m_getScreenLeft, 0, 0, 400 }, // D4
{ "GetScreenBottom", RearWindowXObj::m_getScreenBottom, 0, 0, 400 }, // D4
{ "GetScreenLeft", RearWindowXObj::m_getScreenLeft, 0, 0, 400 }, // D4
{ "GetScreenRight", RearWindowXObj::m_getScreenRight, 0, 0, 400 }, // D4
{ "GetScreenTop", RearWindowXObj::m_getScreenTop, 0, 0, 400 }, // D4
{ "IndexColorToWindow", RearWindowXObj::m_indexColorToWindow, 1, 1, 400 }, // D4
{ "PatToWindow", RearWindowXObj::m_patToWindow, 1, 1, 400 }, // D4
{ "RGBColorToWindow", RearWindowXObj::m_rgbColorToWindow, 3, 3, 400 }, // D4
{ nullptr, nullptr, 0, 0, 0 }
};
@ -268,12 +270,17 @@ void RearWindowXObj::m_getMemoryNeeded(int nargs) {
void RearWindowXObj::m_patToWindow(int nargs) {
g_lingo->pop();
g_lingo->push(Datum(0));
}
void RearWindowXObj::m_indexColorToWindow(int nargs) {
g_lingo->pop();
}
void RearWindowXObj::m_getAppName(int nargs) {
g_lingo->push(Datum(g_director->getStartMovie().startMovie));
}
void RearWindowXObj::m_rgbColorToWindow(int nargs) {
Datum r = g_lingo->pop();
Datum g = g_lingo->pop();

View File

@ -39,9 +39,14 @@ void open(int type);
void close(int type);
void m_new(int nargs);
void m_getAppName(int nargs);
void m_getMemoryNeeded(int nargs);
void m_patToWindow(int nargs);
void m_getScreenBottom(int nargs);
void m_getScreenLeft(int nargs);
void m_getScreenRight(int nargs);
void m_getScreenTop(int nargs);
void m_indexColorToWindow(int nargs);
void m_patToWindow(int nargs);
void m_rgbColorToWindow(int nargs);
void m_getScreenTop(int nargs);
void m_getScreenLeft(int nargs);

View File

@ -40,16 +40,20 @@ MODULE_OBJS = \
lingo/lingo-the.o \
lingo/lingo-utils.o \
lingo/xlibs/aiff.o \
lingo/xlibs/applecdxobj.o \
lingo/xlibs/barakeobj.o \
lingo/xlibs/cdromxobj.o \
lingo/xlibs/fileio.o \
lingo/xlibs/flushxobj.o \
lingo/xlibs/fplayxobj.o \
lingo/xlibs/gpid.o \
lingo/xlibs/labeldrvxobj.o \
lingo/xlibs/movutils.o \
lingo/xlibs/jitdraw3.o \
lingo/xlibs/jwxini.o \
lingo/xlibs/labeldrvxobj.o \
lingo/xlibs/memoryxobj.o \
lingo/xlibs/miscx.o \
lingo/xlibs/movemousexobj.o \
lingo/xlibs/movutils.o \
lingo/xlibs/orthoplayxobj.o \
lingo/xlibs/palxobj.o \
lingo/xlibs/popupmenuxobj.o \