Initial commit
This commit is contained in:
148
engines/director/lingo/xlibs/j/jitdraw3.cpp
Normal file
148
engines/director/lingo/xlibs/j/jitdraw3.cpp
Normal file
@@ -0,0 +1,148 @@
|
||||
/* 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:
|
||||
* Learning CorelDRAW 3
|
||||
*
|
||||
*************************************/
|
||||
/*
|
||||
* -- 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/lingo-utils.h"
|
||||
#include "director/lingo/xlibs/j/jitdraw3.h"
|
||||
|
||||
|
||||
namespace Director {
|
||||
|
||||
const char *const JITDraw3XObj::xlibName = "JITDraw3";
|
||||
const XlibFileDesc JITDraw3XObj::fileNames[] = {
|
||||
{ "JITDraw3", nullptr },
|
||||
{ nullptr, nullptr },
|
||||
};
|
||||
|
||||
static const 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(ObjectType type, const Common::Path &path) {
|
||||
if (type == kXObj) {
|
||||
JITDraw3XObject::initMethods(xlibMethods);
|
||||
JITDraw3XObject *xobj = new JITDraw3XObject(kXObj);
|
||||
g_lingo->exposeXObject(xlibName, xobj);
|
||||
}
|
||||
}
|
||||
|
||||
void JITDraw3XObj::close(ObjectType 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->_state->me);
|
||||
}
|
||||
|
||||
XOBJSTUBNR(JITDraw3XObj::m_dispose)
|
||||
XOBJSTUB(JITDraw3XObj::m_checkifcdrom, 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);
|
||||
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));
|
||||
}
|
||||
|
||||
XOBJSTUB(JITDraw3XObj::m_gotodraw, 3)
|
||||
XOBJSTUB(JITDraw3XObj::m_adddrawbutton, 0)
|
||||
XOBJSTUB(JITDraw3XObj::m_removedrawbutton, 0)
|
||||
|
||||
} // End of namespace Director
|
||||
54
engines/director/lingo/xlibs/j/jitdraw3.h
Normal file
54
engines/director/lingo/xlibs/j/jitdraw3.h
Normal 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 *const xlibName;
|
||||
extern const XlibFileDesc fileNames[];
|
||||
|
||||
void open(ObjectType type, const Common::Path &path);
|
||||
void close(ObjectType 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
|
||||
133
engines/director/lingo/xlibs/j/jwxini.cpp
Normal file
133
engines/director/lingo/xlibs/j/jwxini.cpp
Normal file
@@ -0,0 +1,133 @@
|
||||
/* 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:
|
||||
* Gahan Wilson's Ultimate Haunted House
|
||||
* Wellen, Wracks und Wassermaenner
|
||||
*
|
||||
*************************************/
|
||||
|
||||
/*
|
||||
* +Access INI Files (c) JourneyWare Media 1994
|
||||
* -- Access INI files
|
||||
* X mDispose --Dispose of the XObject
|
||||
* ISSIS mGetPrivateProfileInt, App, Key, Def, File --GetPrivateProfileInt
|
||||
* SSSSIS mGetPrivateProfileString, App, Key, Default, Size, File --GetPrivateProfileString
|
||||
* ISSI mGetProfileInt, App, Key, Default --GetProfileInt
|
||||
* SSSSI mGetProfileString, App, Key, Def, Size --GetProfileString
|
||||
* S mName --Return XObject name
|
||||
* I mNew --Create a new instance
|
||||
* ISSSS mWritePrivateProfileString, App, Key, String, File --WritePrivateProfileString
|
||||
* ISSS mWriteProfileString, App, Key, String --WriteProfileString
|
||||
*/
|
||||
|
||||
#include "director/director.h"
|
||||
#include "director/lingo/lingo.h"
|
||||
#include "director/lingo/lingo-object.h"
|
||||
#include "director/lingo/lingo-utils.h"
|
||||
#include "director/lingo/xlibs/j/jwxini.h"
|
||||
|
||||
namespace Director {
|
||||
|
||||
const char *const JourneyWareXINIXObj::xlibName = "INI";
|
||||
const XlibFileDesc JourneyWareXINIXObj::fileNames[] = {
|
||||
{ "JWXINI", nullptr },
|
||||
{ "INI", "www" }, // "Wellen, Wracks und Wassermaenner" names it INI.DLL
|
||||
{ nullptr, nullptr },
|
||||
};
|
||||
|
||||
static const MethodProto xlibMethods[] = {
|
||||
{"new", JourneyWareXINIXObj::m_new, 0, 0, 400}, // D4
|
||||
{"GetPrivateProfileInt", JourneyWareXINIXObj::m_GetPrivateProfileInt, 4, 4, 400}, // D4
|
||||
{"GetPrivateProfileString", JourneyWareXINIXObj::m_GetPrivateProfileString, 5, 5, 400}, // D4
|
||||
{"GetProfileInt", JourneyWareXINIXObj::m_GetProfileInt, 3, 3, 400}, // D4
|
||||
{"GetProfileString", JourneyWareXINIXObj::m_GetProfileString, 4, 4, 400}, // D4
|
||||
{"WritePrivateProfileString", JourneyWareXINIXObj::m_WritePrivateProfileString, 4, 4, 400}, // D4
|
||||
{"WriteProfileString", JourneyWareXINIXObj::m_WriteProfileString, 3, 3, 400}, // D4
|
||||
{nullptr, nullptr, 0, 0, 0}
|
||||
};
|
||||
|
||||
void JourneyWareXINIXObj::open(ObjectType type, const Common::Path &path) {
|
||||
if (type == kXObj) {
|
||||
JourneyWareXINIXObject::initMethods(xlibMethods);
|
||||
JourneyWareXINIXObject *xobj = new JourneyWareXINIXObject(kXObj);
|
||||
g_lingo->exposeXObject(xlibName, xobj);
|
||||
}
|
||||
}
|
||||
|
||||
void JourneyWareXINIXObj::close(ObjectType type) {
|
||||
if (type == kXObj) {
|
||||
JourneyWareXINIXObject::cleanupMethods();
|
||||
g_lingo->_globalvars[xlibName] = Datum();
|
||||
}
|
||||
}
|
||||
|
||||
JourneyWareXINIXObject::JourneyWareXINIXObject(ObjectType ObjectType) :Object<JourneyWareXINIXObject>("INI") {
|
||||
_objType = ObjectType;
|
||||
}
|
||||
|
||||
void JourneyWareXINIXObj::m_new(int nargs) {
|
||||
g_lingo->printSTUBWithArglist("JWXIni::new", nargs);
|
||||
g_lingo->push(g_lingo->_state->me);
|
||||
}
|
||||
|
||||
void JourneyWareXINIXObj::m_GetPrivateProfileInt(int nargs) {
|
||||
g_lingo->printSTUBWithArglist("JWXIni::GetPrivateProfileInt", nargs);
|
||||
/*auto file= */g_lingo->pop().asString();
|
||||
auto defaultValue = g_lingo->pop().asInt();
|
||||
/*auto key = */g_lingo->pop().asString();
|
||||
/*auto application = */g_lingo->pop().asString();
|
||||
g_lingo->push(Datum(defaultValue)); // TODO: We only return the default for now
|
||||
}
|
||||
|
||||
void JourneyWareXINIXObj::m_GetPrivateProfileString(int nargs) {
|
||||
g_lingo->printSTUBWithArglist("JWXIni::GetPrivateProfileString", nargs);
|
||||
/*auto file = */g_lingo->pop().asString();
|
||||
/*auto size = */g_lingo->pop().asInt();
|
||||
auto defaultValue = g_lingo->pop().asString();
|
||||
/*auto key = */g_lingo->pop().asString();
|
||||
/*auto application = */g_lingo->pop().asString();
|
||||
g_lingo->push(Datum(defaultValue)); // TODO: We only return the default for now
|
||||
}
|
||||
|
||||
void JourneyWareXINIXObj::m_GetProfileInt(int nargs) {
|
||||
g_lingo->printSTUBWithArglist("JWXIni::GetProfileInt", nargs);
|
||||
auto defaultValue = g_lingo->pop().asInt();
|
||||
/*auto key = */g_lingo->pop().asString();
|
||||
/*auto application = */g_lingo->pop().asString();
|
||||
g_lingo->push(Datum(defaultValue)); // TODO: We only return the default for now
|
||||
}
|
||||
|
||||
void JourneyWareXINIXObj::m_GetProfileString(int nargs) {
|
||||
g_lingo->printSTUBWithArglist("JWXIni::GetProfileString", nargs);
|
||||
/*auto size = */g_lingo->pop().asInt();
|
||||
auto defaultValue = g_lingo->pop().asString();
|
||||
/*auto key = */g_lingo->pop().asString();
|
||||
/*auto application = */g_lingo->pop().asString();
|
||||
g_lingo->push(Datum(defaultValue)); // TODO: We only return the default for now
|
||||
}
|
||||
|
||||
XOBJSTUB(JourneyWareXINIXObj::m_WritePrivateProfileString, 0)
|
||||
XOBJSTUB(JourneyWareXINIXObj::m_WriteProfileString, 0)
|
||||
|
||||
} // End of namespace Director
|
||||
55
engines/director/lingo/xlibs/j/jwxini.h
Normal file
55
engines/director/lingo/xlibs/j/jwxini.h
Normal file
@@ -0,0 +1,55 @@
|
||||
/* 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_JWXINI_H
|
||||
#define DIRECTOR_LINGO_XLIBS_JWXINI_H
|
||||
|
||||
namespace Director {
|
||||
|
||||
class JourneyWareXINIXObject : public Object<JourneyWareXINIXObject> {
|
||||
public:
|
||||
JourneyWareXINIXObject(ObjectType objType);
|
||||
};
|
||||
|
||||
namespace JourneyWareXINIXObj {
|
||||
|
||||
extern const char *const xlibName;
|
||||
extern const XlibFileDesc fileNames[];
|
||||
|
||||
void open(ObjectType type, const Common::Path &path);
|
||||
void close(ObjectType type);
|
||||
|
||||
void m_new(int nargs);
|
||||
void m_clear(int nargs);
|
||||
|
||||
void m_GetPrivateProfileInt(int nargs);
|
||||
void m_GetPrivateProfileString(int nargs);
|
||||
void m_GetProfileInt(int nargs);
|
||||
void m_GetProfileString(int nargs);
|
||||
void m_WritePrivateProfileString(int nargs);
|
||||
void m_WriteProfileString(int nargs);
|
||||
|
||||
} // End of namespace JourneyWareXINIXObj
|
||||
|
||||
} // End of namespace Director
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user