Initial commit
This commit is contained in:
194
engines/director/lingo/xlibs/p/paco.cpp
Normal file
194
engines/director/lingo/xlibs/p/paco.cpp
Normal file
@@ -0,0 +1,194 @@
|
||||
/* 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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "common/system.h"
|
||||
#include "common/tokenizer.h"
|
||||
#include "graphics/paletteman.h"
|
||||
#include "video/paco_decoder.h"
|
||||
|
||||
#include "director/director.h"
|
||||
#include "director/window.h"
|
||||
#include "director/lingo/lingo.h"
|
||||
#include "director/lingo/lingo-object.h"
|
||||
#include "director/lingo/lingo-utils.h"
|
||||
#include "director/lingo/xlibs/p/paco.h"
|
||||
|
||||
/**************************************************
|
||||
*
|
||||
* USED IN:
|
||||
* hellcab-win
|
||||
*
|
||||
**************************************************/
|
||||
|
||||
/*
|
||||
-- PACow External Factory. 15Jul93 JMU
|
||||
--PACo
|
||||
SS mNew, command --Creates a new instance of the XObject
|
||||
X mDispose --Disposes of XObject instance
|
||||
SSS mPACo, commands, results --Plays Paco movies
|
||||
*/
|
||||
|
||||
namespace Director {
|
||||
|
||||
const char *const PACoXObj::xlibName = "PACo";
|
||||
const XlibFileDesc PACoXObj::fileNames[] = {
|
||||
{ "PACO", nullptr },
|
||||
{ "PACOW", nullptr },
|
||||
{ nullptr, nullptr },
|
||||
};
|
||||
|
||||
static const MethodProto xlibMethods[] = {
|
||||
{ "new", PACoXObj::m_new, 1, 1, 300 },
|
||||
{ "dispose", PACoXObj::m_dispose, 0, 0, 300 },
|
||||
{ "pACo", PACoXObj::m_pACo, 2, 2, 300 },
|
||||
{ nullptr, nullptr, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static const BuiltinProto xlibBuiltins[] = {
|
||||
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
|
||||
};
|
||||
|
||||
PACoXObject::PACoXObject(ObjectType ObjectType) :Object<PACoXObject>("PACo") {
|
||||
_objType = ObjectType;
|
||||
}
|
||||
|
||||
void PACoXObj::open(ObjectType type, const Common::Path &path) {
|
||||
PACoXObject::initMethods(xlibMethods);
|
||||
PACoXObject *xobj = new PACoXObject(type);
|
||||
g_lingo->exposeXObject(xlibName, xobj);
|
||||
g_lingo->initBuiltIns(xlibBuiltins);
|
||||
}
|
||||
|
||||
void PACoXObj::close(ObjectType type) {
|
||||
PACoXObject::cleanupMethods();
|
||||
g_lingo->_globalvars[xlibName] = Datum();
|
||||
|
||||
}
|
||||
|
||||
void callPacoPlay(const Common::String &cmd) {
|
||||
Common::StringTokenizer st(cmd);
|
||||
|
||||
Common::String verb = st.nextToken();
|
||||
if (verb == "playfile") {
|
||||
|
||||
Common::String videoPath = st.nextToken();
|
||||
|
||||
int posX = 0;
|
||||
int posY = 0;
|
||||
|
||||
while (!st.empty()) {
|
||||
Common::String token = st.nextToken();
|
||||
if (token == "-posx") {
|
||||
posX = atoi(st.nextToken().c_str());
|
||||
} else if (token == "-posy") {
|
||||
posY = atoi(st.nextToken().c_str());
|
||||
} else {
|
||||
warning("callPacoPlay: Unknown parameter %s %s", token.c_str(), st.nextToken().c_str());
|
||||
}
|
||||
}
|
||||
|
||||
Video::PacoDecoder *video = new Video::PacoDecoder();
|
||||
bool result = video->loadFile(findPath(videoPath));
|
||||
if (!result) {
|
||||
warning("callPacoPlay: PACo video not loaded: %s", videoPath.c_str());
|
||||
delete video;
|
||||
return;
|
||||
}
|
||||
|
||||
// save the current palette
|
||||
byte origPalette[256 * 3];
|
||||
uint16 origCount = g_director->getPaletteColorCount();
|
||||
|
||||
if (origCount > 256) {
|
||||
warning("callPacoPlay: too big palette, %d > 256", origCount);
|
||||
origCount = 256;
|
||||
}
|
||||
|
||||
memcpy(origPalette, g_director->getPalette(), origCount * 3);
|
||||
byte videoPalette[256 * 3];
|
||||
|
||||
Graphics::Surface const *frame = nullptr;
|
||||
Common::Event event;
|
||||
bool keepPlaying = true;
|
||||
video->start();
|
||||
memcpy(videoPalette, video->getPalette(), 256 * 3);
|
||||
while (!video->endOfVideo()) {
|
||||
if (g_director->pollEvent(event)) {
|
||||
switch (event.type) {
|
||||
case Common::EVENT_QUIT:
|
||||
g_director->processEventQUIT();
|
||||
// fallthrough
|
||||
case Common::EVENT_KEYDOWN:
|
||||
case Common::EVENT_RBUTTONDOWN:
|
||||
case Common::EVENT_LBUTTONDOWN:
|
||||
keepPlaying = false;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!keepPlaying)
|
||||
break;
|
||||
if (video->needsUpdate()) {
|
||||
frame = video->decodeNextFrame();
|
||||
// Palette info gets set after the frame is decoded
|
||||
if (video->hasDirtyPalette()) {
|
||||
byte *palette = const_cast<byte *>(video->getPalette());
|
||||
memcpy(videoPalette, palette, 256 * 3);
|
||||
}
|
||||
|
||||
// Video palette order is going to be different to the screen, we need to untangle it
|
||||
Graphics::Surface *dither = frame->convertTo(g_director->_wm->_pixelformat, videoPalette, 256, origPalette, origCount, Graphics::kDitherNaive);
|
||||
int width = MIN(dither->w + posX, (int)g_system->getWidth()) - posX;
|
||||
int height = MIN(dither->h + posY, (int)g_system->getHeight()) - posY;
|
||||
g_system->copyRectToScreen(dither->getPixels(), dither->pitch, posX, posY, width, height);
|
||||
dither->free();
|
||||
delete dither;
|
||||
}
|
||||
g_system->updateScreen();
|
||||
g_director->delayMillis(10);
|
||||
}
|
||||
|
||||
video->close();
|
||||
delete video;
|
||||
} else {
|
||||
warning("callPacoPlay: Unknown verb %s", verb.c_str());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void PACoXObj::m_new(int nargs) {
|
||||
g_lingo->printSTUBWithArglist("PACoXObj::m_new", nargs);
|
||||
if (nargs == 1) {
|
||||
Common::String cmd = g_lingo->pop().asString();
|
||||
callPacoPlay(cmd);
|
||||
} else {
|
||||
warning("PACoXObj::m_new: Invalid number of args %d", nargs);
|
||||
g_lingo->dropStack(nargs);
|
||||
}
|
||||
g_lingo->push(g_lingo->_state->me);
|
||||
}
|
||||
|
||||
XOBJSTUBNR(PACoXObj::m_dispose)
|
||||
XOBJSTUB(PACoXObj::m_pACo, "")
|
||||
|
||||
}
|
||||
48
engines/director/lingo/xlibs/p/paco.h
Normal file
48
engines/director/lingo/xlibs/p/paco.h
Normal file
@@ -0,0 +1,48 @@
|
||||
/* 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_PACO_H
|
||||
#define DIRECTOR_LINGO_XLIBS_PACO_H
|
||||
|
||||
namespace Director {
|
||||
|
||||
class PACoXObject : public Object<PACoXObject> {
|
||||
public:
|
||||
PACoXObject(ObjectType objType);
|
||||
};
|
||||
|
||||
namespace PACoXObj {
|
||||
|
||||
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_pACo(int nargs);
|
||||
|
||||
} // End of namespace PACoXObj
|
||||
|
||||
} // End of namespace Director
|
||||
|
||||
#endif
|
||||
110
engines/director/lingo/xlibs/p/palxobj.cpp
Normal file
110
engines/director/lingo/xlibs/p/palxobj.cpp
Normal file
@@ -0,0 +1,110 @@
|
||||
/* 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:
|
||||
* Majestic-mac
|
||||
* chopsuey-mac
|
||||
* Jewels of the Oracle - Mac
|
||||
*
|
||||
*************************************/
|
||||
|
||||
/*
|
||||
* Quicktime movies and PICT castmembers continually display
|
||||
* in wrong colors after an 8 palette switch
|
||||
* this XObject can be used to patch this problem
|
||||
* use mPatchIt message on the same frame as the palette switch
|
||||
* pass in the stage window coordinates when creating the XObject
|
||||
*
|
||||
* From: http://www.zeusprod.com/technote/patchpal.html
|
||||
* The FixPalette XObject is needed when using QuickTime movies with
|
||||
* more than one custom palette. If it not used on the PC, nor is it
|
||||
* needed if you are only using one custom palette. If the first
|
||||
* QuickTime you play looks fine, but the second QuickTime video
|
||||
* that is played looks funky or psychedelic, then there is a good
|
||||
* chance that the FixPaletet XObject will solve your problem.
|
||||
*
|
||||
* It's only necessary on Mac.
|
||||
*/
|
||||
|
||||
#include "director/director.h"
|
||||
#include "director/lingo/lingo.h"
|
||||
#include "director/lingo/lingo-object.h"
|
||||
#include "director/lingo/xlibs/p/palxobj.h"
|
||||
|
||||
|
||||
namespace Director {
|
||||
|
||||
// The name is different from the obj filename.
|
||||
const char *const PalXObj::xlibName = "FixPalette";
|
||||
const XlibFileDesc PalXObj::fileNames[] = {
|
||||
{ "PalXObj", nullptr },
|
||||
{ "FixPalette", nullptr },
|
||||
{ "FixPaletteXObj", nullptr },
|
||||
{ "PALETTE.XOB", nullptr }, // Jewels of the Oracle - Mac
|
||||
{ nullptr, nullptr },
|
||||
};
|
||||
|
||||
static const MethodProto xlibMethods[] = {
|
||||
{ "new", PalXObj::m_new, 4, 4, 400 }, // D4
|
||||
{ "PatchIt", PalXObj::m_patchIt, 0, 0, 400 }, // D4
|
||||
{ nullptr, nullptr, 0, 0, 0 }
|
||||
};
|
||||
|
||||
void PalXObj::open(ObjectType type, const Common::Path &path) {
|
||||
if (type == kXObj) {
|
||||
PalXObject::initMethods(xlibMethods);
|
||||
PalXObject *xobj = new PalXObject(kXObj);
|
||||
g_lingo->exposeXObject(xlibName, xobj);
|
||||
}
|
||||
}
|
||||
|
||||
void PalXObj::close(ObjectType type) {
|
||||
if (type == kXObj) {
|
||||
PalXObject::cleanupMethods();
|
||||
g_lingo->_globalvars[xlibName] = Datum();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
PalXObject::PalXObject(ObjectType ObjectType) :Object<PalXObject>("FixPalette") {
|
||||
_objType = ObjectType;
|
||||
}
|
||||
|
||||
void PalXObj::m_new(int nargs) {
|
||||
PalXObject *me = static_cast<PalXObject *>(g_lingo->_state->me.u.obj);
|
||||
|
||||
Common::Rect rect;
|
||||
rect.bottom = g_lingo->pop().asInt();
|
||||
rect.right = g_lingo->pop().asInt();
|
||||
rect.top = g_lingo->pop().asInt();
|
||||
rect.left = g_lingo->pop().asInt();
|
||||
me->_stageWindowCoordinates = rect;
|
||||
|
||||
g_lingo->push(g_lingo->_state->me);
|
||||
}
|
||||
|
||||
void PalXObj::m_patchIt(int nargs) {
|
||||
warning("STUB: PalXObj::m_patchIt");
|
||||
}
|
||||
|
||||
} // End of namespace Director
|
||||
50
engines/director/lingo/xlibs/p/palxobj.h
Normal file
50
engines/director/lingo/xlibs/p/palxobj.h
Normal file
@@ -0,0 +1,50 @@
|
||||
/* 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_PALXOBJ_H
|
||||
#define DIRECTOR_LINGO_XLIBS_PALXOBJ_H
|
||||
|
||||
namespace Director {
|
||||
|
||||
class PalXObject : public Object<PalXObject> {
|
||||
public:
|
||||
Common::Rect _stageWindowCoordinates;
|
||||
|
||||
public:
|
||||
PalXObject(ObjectType objType);
|
||||
};
|
||||
|
||||
namespace PalXObj {
|
||||
|
||||
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_patchIt(int nargs);
|
||||
|
||||
} // End of namespace PalXObj
|
||||
|
||||
} // End of namespace Director
|
||||
|
||||
#endif
|
||||
135
engines/director/lingo/xlibs/p/panel.cpp
Normal file
135
engines/director/lingo/xlibs/p/panel.cpp
Normal file
@@ -0,0 +1,135 @@
|
||||
/* 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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "common/system.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/p/panel.h"
|
||||
|
||||
/**************************************************
|
||||
*
|
||||
* USED IN:
|
||||
* Standard Macromedia Director XObject
|
||||
*
|
||||
**************************************************/
|
||||
|
||||
/*
|
||||
--Panel, Tool, 1.0
|
||||
--© 1989, 1990 MacroMind, Inc.
|
||||
--by John Thompson and Al McNeil
|
||||
------------------------------------------------------------------
|
||||
------------------------------------------------------------------
|
||||
--=METHODS=--
|
||||
IISIO mNew, kindSymbol, titleString, myNameSymbol, windowObj --Creates a new instance.
|
||||
--kindSymbol is one of: #pushButton, #checkBox, #radioButton, #staticText, #castBitmap
|
||||
X mDispose --Disposes of the instance.
|
||||
S mName --Returns the XObject's name.
|
||||
X mShow --Shows instance.
|
||||
X mHide --Hides instance.
|
||||
X mUpdate --Updates the instance.
|
||||
XII mMove, hpos, vpos ---Moves to h, v.
|
||||
XII mSize, width, height --Changes size to the specified width, height.
|
||||
XII mDrag, startH, startV
|
||||
XI mSetValue, value --Sets panel value.
|
||||
I mGetValue --Returns panel value.
|
||||
XI mSetHilite, flag --Sets hilite state.
|
||||
I mGetHilite --Returns panel hilite state.
|
||||
XS mSetTitle, string --Sets title for control.
|
||||
S mGetTitle --Returns the control's title string.
|
||||
XII mMouseDown, loch, locv --Sends a mousedown at given location in panel.
|
||||
/X mBounds, rectPtr --Returns the bounding rect
|
||||
*/
|
||||
|
||||
namespace Director {
|
||||
|
||||
const char *const PanelXObj::xlibName = "Panel";
|
||||
const XlibFileDesc PanelXObj::fileNames[] = {
|
||||
{ "Panel", nullptr },
|
||||
{ nullptr, nullptr },
|
||||
};
|
||||
|
||||
static const MethodProto xlibMethods[] = {
|
||||
{ "new", PanelXObj::m_new, 4, 4, 200 },
|
||||
{ "dispose", PanelXObj::m_dispose, 0, 0, 200 },
|
||||
{ "name", PanelXObj::m_name, 0, 0, 200 },
|
||||
{ "show", PanelXObj::m_show, 0, 0, 200 },
|
||||
{ "hide", PanelXObj::m_hide, 0, 0, 200 },
|
||||
{ "update", PanelXObj::m_update, 0, 0, 200 },
|
||||
{ "move", PanelXObj::m_move, 2, 2, 200 },
|
||||
{ "size", PanelXObj::m_size, 2, 2, 200 },
|
||||
{ "drag", PanelXObj::m_drag, 2, 2, 200 },
|
||||
{ "setValue", PanelXObj::m_setValue, 1, 1, 200 },
|
||||
{ "getValue", PanelXObj::m_getValue, 0, 0, 200 },
|
||||
{ "setHilite", PanelXObj::m_setHilite, 1, 1, 200 },
|
||||
{ "getHilite", PanelXObj::m_getHilite, 0, 0, 200 },
|
||||
{ "setTitle", PanelXObj::m_setTitle, 1, 1, 200 },
|
||||
{ "getTitle", PanelXObj::m_getTitle, 0, 0, 200 },
|
||||
{ "mouseDown", PanelXObj::m_mouseDown, 2, 2, 200 },
|
||||
{ "bounds", PanelXObj::m_bounds, 0, 0, 200 },
|
||||
{ nullptr, nullptr, 0, 0, 0 }
|
||||
};
|
||||
|
||||
PanelXObject::PanelXObject(ObjectType ObjectType) :Object<PanelXObject>("Panel") {
|
||||
_objType = ObjectType;
|
||||
}
|
||||
|
||||
void PanelXObj::open(ObjectType type, const Common::Path &path) {
|
||||
if (type == kXObj) {
|
||||
PanelXObject::initMethods(xlibMethods);
|
||||
PanelXObject *xobj = new PanelXObject(kXObj);
|
||||
g_lingo->exposeXObject(xlibName, xobj);
|
||||
}
|
||||
}
|
||||
|
||||
void PanelXObj::close(ObjectType type) {
|
||||
if (type == kXObj) {
|
||||
PanelXObject::cleanupMethods();
|
||||
g_lingo->_globalvars[xlibName] = Datum();
|
||||
}
|
||||
}
|
||||
|
||||
void PanelXObj::m_new(int nargs) {
|
||||
g_lingo->printSTUBWithArglist("PanelXObj::m_new", nargs);
|
||||
g_lingo->dropStack(nargs);
|
||||
g_lingo->push(g_lingo->_state->me);
|
||||
}
|
||||
|
||||
XOBJSTUBNR(PanelXObj::m_dispose)
|
||||
XOBJSTUB(PanelXObj::m_name, "")
|
||||
XOBJSTUBNR(PanelXObj::m_show)
|
||||
XOBJSTUBNR(PanelXObj::m_hide)
|
||||
XOBJSTUBNR(PanelXObj::m_update)
|
||||
XOBJSTUBNR(PanelXObj::m_move)
|
||||
XOBJSTUBNR(PanelXObj::m_size)
|
||||
XOBJSTUBNR(PanelXObj::m_drag)
|
||||
XOBJSTUBNR(PanelXObj::m_setValue)
|
||||
XOBJSTUB(PanelXObj::m_getValue, 0)
|
||||
XOBJSTUBNR(PanelXObj::m_setHilite)
|
||||
XOBJSTUB(PanelXObj::m_getHilite, 0)
|
||||
XOBJSTUBNR(PanelXObj::m_setTitle)
|
||||
XOBJSTUB(PanelXObj::m_getTitle, "")
|
||||
XOBJSTUBNR(PanelXObj::m_mouseDown)
|
||||
XOBJSTUBNR(PanelXObj::m_bounds)
|
||||
|
||||
}
|
||||
62
engines/director/lingo/xlibs/p/panel.h
Normal file
62
engines/director/lingo/xlibs/p/panel.h
Normal file
@@ -0,0 +1,62 @@
|
||||
/* 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_PANEL_H
|
||||
#define DIRECTOR_LINGO_XLIBS_PANEL_H
|
||||
|
||||
namespace Director {
|
||||
|
||||
class PanelXObject : public Object<PanelXObject> {
|
||||
public:
|
||||
PanelXObject(ObjectType objType);
|
||||
};
|
||||
|
||||
namespace PanelXObj {
|
||||
|
||||
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_name(int nargs);
|
||||
void m_show(int nargs);
|
||||
void m_hide(int nargs);
|
||||
void m_update(int nargs);
|
||||
void m_move(int nargs);
|
||||
void m_size(int nargs);
|
||||
void m_drag(int nargs);
|
||||
void m_setValue(int nargs);
|
||||
void m_getValue(int nargs);
|
||||
void m_setHilite(int nargs);
|
||||
void m_getHilite(int nargs);
|
||||
void m_setTitle(int nargs);
|
||||
void m_getTitle(int nargs);
|
||||
void m_mouseDown(int nargs);
|
||||
void m_bounds(int nargs);
|
||||
|
||||
} // End of namespace PanelXObj
|
||||
|
||||
} // End of namespace Director
|
||||
|
||||
#endif
|
||||
106
engines/director/lingo/xlibs/p/pharaohs.cpp
Normal file
106
engines/director/lingo/xlibs/p/pharaohs.cpp
Normal file
@@ -0,0 +1,106 @@
|
||||
/* 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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "common/system.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/p/pharaohs.h"
|
||||
|
||||
/**************************************************
|
||||
*
|
||||
* USED IN:
|
||||
* gordak
|
||||
*
|
||||
**************************************************/
|
||||
|
||||
/*
|
||||
-- Pharaohs External Factory. 16Feb93 PTM
|
||||
--Pharaohs
|
||||
I mNew --Creates a new instance of the XObject
|
||||
X mDispose --Disposes of XObject instance
|
||||
S mWindowsdir --Return the first nchars of string str
|
||||
ISSSS mWritestring --Write a string into an initialization file
|
||||
SSSS mGetstring --Get a string from an initialization file
|
||||
IS mCheckattrib --Check a file's attribute
|
||||
S mCheckDrive --Check the possible CD-ROM drive
|
||||
*/
|
||||
|
||||
namespace Director {
|
||||
|
||||
const char *PharaohsXObj::xlibName = "Pharaohs";
|
||||
const XlibFileDesc PharaohsXObj::fileNames[] = {
|
||||
{ "GORDAKCD", "gordak" },
|
||||
{ "Pharaohs", nullptr },
|
||||
{ nullptr, nullptr },
|
||||
};
|
||||
|
||||
static MethodProto xlibMethods[] = {
|
||||
{ "new", PharaohsXObj::m_new, 0, 0, 400 },
|
||||
{ "dispose", PharaohsXObj::m_dispose, 0, 0, 400 },
|
||||
{ "windowsdir", PharaohsXObj::m_windowsdir, 0, 0, 400 },
|
||||
{ "writestring", PharaohsXObj::m_writestring, 4, 4, 400 },
|
||||
{ "getstring", PharaohsXObj::m_getstring, 3, 3, 400 },
|
||||
{ "checkattrib", PharaohsXObj::m_checkattrib, 1, 1, 400 },
|
||||
{ "checkDrive", PharaohsXObj::m_checkDrive, 0, 0, 400 },
|
||||
{ nullptr, nullptr, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static BuiltinProto xlibBuiltins[] = {
|
||||
|
||||
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
|
||||
};
|
||||
|
||||
PharaohsXObject::PharaohsXObject(ObjectType ObjectType) :Object<PharaohsXObject>("Pharaohs") {
|
||||
_objType = ObjectType;
|
||||
}
|
||||
|
||||
void PharaohsXObj::open(ObjectType type, const Common::Path &path) {
|
||||
PharaohsXObject::initMethods(xlibMethods);
|
||||
PharaohsXObject *xobj = new PharaohsXObject(type);
|
||||
if (type == kXtraObj)
|
||||
g_lingo->_openXtras.push_back(xlibName);
|
||||
g_lingo->exposeXObject(xlibName, xobj);
|
||||
g_lingo->initBuiltIns(xlibBuiltins);
|
||||
}
|
||||
|
||||
void PharaohsXObj::close(ObjectType type) {
|
||||
PharaohsXObject::cleanupMethods();
|
||||
g_lingo->_globalvars[xlibName] = Datum();
|
||||
|
||||
}
|
||||
|
||||
void PharaohsXObj::m_new(int nargs) {
|
||||
g_lingo->printSTUBWithArglist("PharaohsXObj::m_new", nargs);
|
||||
g_lingo->dropStack(nargs);
|
||||
g_lingo->push(g_lingo->_state->me);
|
||||
}
|
||||
|
||||
XOBJSTUBNR(PharaohsXObj::m_dispose)
|
||||
XOBJSTUB(PharaohsXObj::m_windowsdir, "C:\\WINDOWS")
|
||||
XOBJSTUB(PharaohsXObj::m_writestring, 0)
|
||||
XOBJSTUB(PharaohsXObj::m_getstring, "")
|
||||
XOBJSTUB(PharaohsXObj::m_checkattrib, -1)
|
||||
XOBJSTUB(PharaohsXObj::m_checkDrive, "D")
|
||||
|
||||
}
|
||||
52
engines/director/lingo/xlibs/p/pharaohs.h
Normal file
52
engines/director/lingo/xlibs/p/pharaohs.h
Normal file
@@ -0,0 +1,52 @@
|
||||
/* 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_PHARAOHS_H
|
||||
#define DIRECTOR_LINGO_XLIBS_PHARAOHS_H
|
||||
|
||||
namespace Director {
|
||||
|
||||
class PharaohsXObject : public Object<PharaohsXObject> {
|
||||
public:
|
||||
PharaohsXObject(ObjectType objType);
|
||||
};
|
||||
|
||||
namespace PharaohsXObj {
|
||||
|
||||
extern const char *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_windowsdir(int nargs);
|
||||
void m_writestring(int nargs);
|
||||
void m_getstring(int nargs);
|
||||
void m_checkattrib(int nargs);
|
||||
void m_checkDrive(int nargs);
|
||||
|
||||
} // End of namespace PharaohsXObj
|
||||
|
||||
} // End of namespace Director
|
||||
|
||||
#endif
|
||||
102
engines/director/lingo/xlibs/p/playsoundmoviexobj.cpp
Normal file
102
engines/director/lingo/xlibs/p/playsoundmoviexobj.cpp
Normal file
@@ -0,0 +1,102 @@
|
||||
/* 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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "common/system.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/p/playsoundmoviexobj.h"
|
||||
|
||||
/**************************************************
|
||||
*
|
||||
* USED IN:
|
||||
* wttf
|
||||
*
|
||||
**************************************************/
|
||||
|
||||
/*
|
||||
-- SaveNRestore XObj v 1.0d2 (c) 1995 Samizdat Productions. All Rights Reserved.
|
||||
-- written by Christopher P. Kelly
|
||||
I mNew
|
||||
IS mMovieOpen fullPathName
|
||||
I mMovieIdle
|
||||
II mMovieSetVolume newVolume
|
||||
I mMovieStop
|
||||
*/
|
||||
|
||||
namespace Director {
|
||||
|
||||
const char *PlaySoundMovieXObj::xlibName = "PlaySoundMovieXObj";
|
||||
const XlibFileDesc PlaySoundMovieXObj::fileNames[] = {
|
||||
{ "PlaySoundMovieXObj", nullptr },
|
||||
{ nullptr, nullptr },
|
||||
};
|
||||
|
||||
static MethodProto xlibMethods[] = {
|
||||
{ "new", PlaySoundMovieXObj::m_new, 0, 0, 400 },
|
||||
{ "movieOpen", PlaySoundMovieXObj::m_movieOpen, 1, 1, 400 },
|
||||
{ "movieIdle", PlaySoundMovieXObj::m_movieIdle, 0, 0, 400 },
|
||||
{ "movieSetVolume", PlaySoundMovieXObj::m_movieSetVolume, 1, 1, 400 },
|
||||
{ "movieStop", PlaySoundMovieXObj::m_movieStop, 0, 0, 400 },
|
||||
|
||||
{ nullptr, nullptr, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static BuiltinProto xlibBuiltins[] = {
|
||||
|
||||
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
|
||||
};
|
||||
|
||||
PlaySoundMovieXObject::PlaySoundMovieXObject(ObjectType ObjectType) :Object<PlaySoundMovieXObject>("PlaySoundMovieXObj") {
|
||||
_objType = ObjectType;
|
||||
}
|
||||
|
||||
void PlaySoundMovieXObj::open(ObjectType type, const Common::Path &path) {
|
||||
PlaySoundMovieXObject::initMethods(xlibMethods);
|
||||
PlaySoundMovieXObject *xobj = new PlaySoundMovieXObject(type);
|
||||
if (type == kXtraObj) {
|
||||
g_lingo->_openXtras.push_back(xlibName);
|
||||
g_lingo->_openXtraObjects.push_back(xobj);
|
||||
}
|
||||
g_lingo->exposeXObject(xlibName, xobj);
|
||||
g_lingo->initBuiltIns(xlibBuiltins);
|
||||
}
|
||||
|
||||
void PlaySoundMovieXObj::close(ObjectType type) {
|
||||
PlaySoundMovieXObject::cleanupMethods();
|
||||
g_lingo->_globalvars[xlibName] = Datum();
|
||||
|
||||
}
|
||||
|
||||
void PlaySoundMovieXObj::m_new(int nargs) {
|
||||
g_lingo->printSTUBWithArglist("PlaySoundMovieXObj::m_new", nargs);
|
||||
g_lingo->dropStack(nargs);
|
||||
g_lingo->push(g_lingo->_state->me);
|
||||
}
|
||||
|
||||
XOBJSTUB(PlaySoundMovieXObj::m_movieOpen, 0)
|
||||
XOBJSTUB(PlaySoundMovieXObj::m_movieIdle, 0)
|
||||
XOBJSTUB(PlaySoundMovieXObj::m_movieSetVolume, 0)
|
||||
XOBJSTUB(PlaySoundMovieXObj::m_movieStop, 0)
|
||||
|
||||
}
|
||||
50
engines/director/lingo/xlibs/p/playsoundmoviexobj.h
Normal file
50
engines/director/lingo/xlibs/p/playsoundmoviexobj.h
Normal file
@@ -0,0 +1,50 @@
|
||||
/* 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_P_PLAYSOUNDMOVIEXOBJ_H
|
||||
#define DIRECTOR_LINGO_XLIBS_P_PLAYSOUNDMOVIEXOBJ_H
|
||||
|
||||
namespace Director {
|
||||
|
||||
class PlaySoundMovieXObject : public Object<PlaySoundMovieXObject> {
|
||||
public:
|
||||
PlaySoundMovieXObject(ObjectType objType);
|
||||
};
|
||||
|
||||
namespace PlaySoundMovieXObj {
|
||||
|
||||
extern const char *xlibName;
|
||||
extern const XlibFileDesc fileNames[];
|
||||
|
||||
void open(ObjectType type, const Common::Path &path);
|
||||
void close(ObjectType type);
|
||||
|
||||
void m_new(int nargs);
|
||||
void m_movieOpen(int nargs);
|
||||
void m_movieIdle(int nargs);
|
||||
void m_movieSetVolume(int nargs);
|
||||
void m_movieStop(int nargs);
|
||||
|
||||
} // End of namespace PlaySoundMovieXObj
|
||||
|
||||
} // End of namespace Director
|
||||
|
||||
#endif
|
||||
224
engines/director/lingo/xlibs/p/popupmenuxobj.cpp
Normal file
224
engines/director/lingo/xlibs/p/popupmenuxobj.cpp
Normal file
@@ -0,0 +1,224 @@
|
||||
/* 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 Apartment
|
||||
*
|
||||
*************************************/
|
||||
|
||||
/*
|
||||
* --PopMenu, Tool, 1.0, 4/1/90
|
||||
* --© 1989, 1990 MacroMind, Inc.
|
||||
* -- by Jeff Tanner
|
||||
* ------------------------------------------------
|
||||
* ------------------------------------------------
|
||||
* -- IMPORTANT NOTE: In Lingo, build PopMenus after using
|
||||
* -- the command installMenu. On the Mac, Pop-up menus are
|
||||
* -- extensions of the menu bar. When the command installMenu
|
||||
* -- is called, this will remove all menus currently on
|
||||
* -- the menubar (including pop-up menus) and only install those
|
||||
* -- menus defined in the text window referenced by the
|
||||
* -- castNum parameter. If installMenu is used after
|
||||
* -- creating PopMenus, these PopMenus must be disposed of
|
||||
* -- and then recreated.
|
||||
* ------------------------------------------------
|
||||
* -- MENULIST NOTE: In Lingo, there are several ways
|
||||
* -- to build the menu list for a PopUp menu.
|
||||
* --
|
||||
* -- - a menulist can be a continuous string
|
||||
* -- with items separated by semicolons.
|
||||
* -- example: "item1;item2;item3"
|
||||
* --
|
||||
* -- - a menulist can be a set of strings, each
|
||||
* -- representing an item, separated by
|
||||
* -- &return& and ending with &return
|
||||
* -- example: "item1"&return&"item2"&return
|
||||
* --
|
||||
* -- - a menulist could come from a cast member with
|
||||
* -- each menu item separated by a carrage return.
|
||||
* -- example: set menulist to the text of cast A31
|
||||
* ------------------------------------------------
|
||||
* -- MENUITEM NOTE: Use only alphanumeric characters,
|
||||
* -- 0 - 9 and A - Z. Avoid dashes. Indicate
|
||||
* -- style by "item1;item2<B;item3<U"
|
||||
* -- To change an item's style, add < followed by a
|
||||
* -- character at the end of the menu item text:
|
||||
* -- <B Bold
|
||||
* -- <U Underlined
|
||||
* -- <I Italics
|
||||
* -- <S Shadowed
|
||||
* -- <O Outlined
|
||||
* ------------------------------------------------
|
||||
* ------------------------------------------------
|
||||
* --=METHODS=--
|
||||
* XSI mNew, menuList, menuID --Creates a new instance of the XObject.
|
||||
* -- menuItemList - "item1;item2<B;item3<U"
|
||||
* -- Separate all items with semicolons.
|
||||
* -- Maximum character length of menulist is 256.
|
||||
* -- menuID - to avoid resourse conflict with Director,
|
||||
* -- use a menu ID between 100 and 1000.
|
||||
* --
|
||||
* X mDispose --Disposes of the XObject instance.
|
||||
* S mName --Returns the name of the XObject.
|
||||
* ------------------------------------------------
|
||||
* ------------------------------------------------
|
||||
* XS mAppendMenu, menuList --Adds items to menuList.
|
||||
* XI mDisableItem, itemNum --Disables item in pop up menu.
|
||||
* XI mEnableItem, itemNum --Enables item in pop up menu.
|
||||
* SI mGetItem, itemNum --Returns item in pop up menu.
|
||||
* I mGetMenuID --Returns the assigned Menu ID number.
|
||||
* ------------------------------------------------
|
||||
* ------------------------------------------------
|
||||
* IIII mPopNum, Left, Top, itemNum --Returns selected item's number.
|
||||
* SIII mPopText, Left, Top, itemNum --Returns selected item's text.
|
||||
* ------------------------------------------------
|
||||
* ------------------------------------------------
|
||||
* XIS mSetItem, itemNum, newItemText --Sets changes to an item in pop up menu
|
||||
* XI mSetItemMark, markNum --Sets marker for pop up menu: default is check.
|
||||
* XI mSmart, TrueOrFalse --Remembers last selection if itemNum is 0
|
||||
* XII mSetItemIcon, itemNum, iconID --Attaches an icon to menu item, id# 257 - 511
|
||||
* ------------------------------------------------
|
||||
* ------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "director/director.h"
|
||||
#include "director/window.h"
|
||||
|
||||
#include "director/lingo/lingo.h"
|
||||
#include "director/lingo/lingo-object.h"
|
||||
#include "director/lingo/lingo-utils.h"
|
||||
#include "director/lingo/xlibs/p/popupmenuxobj.h"
|
||||
|
||||
#include "graphics/macgui/macpopupmenu.h"
|
||||
|
||||
namespace Director {
|
||||
|
||||
const char *const PopUpMenuXObj::xlibName = "PopMenu";
|
||||
const XlibFileDesc PopUpMenuXObj::fileNames[] = {
|
||||
{ "PopMenu", nullptr },
|
||||
{ "PopUp Menu XObj", nullptr },
|
||||
{ nullptr, nullptr },
|
||||
};
|
||||
|
||||
static const MethodProto xlibMethods[] = {
|
||||
{ "new", PopUpMenuXObj::m_new, 2, 2, 200 }, // D2
|
||||
{ "AppendMenu", PopUpMenuXObj::m_appendMenu, 1, 1, 200 }, // D2
|
||||
{ "DisableItem", PopUpMenuXObj::m_disableItem, 1, 1, 200 }, // D2
|
||||
{ "EnableItem", PopUpMenuXObj::m_enableItem, 1, 1, 200 }, // D2
|
||||
{ "GetItem", PopUpMenuXObj::m_getItem, 1, 1, 200 }, // D2
|
||||
{ "GetMenuID", PopUpMenuXObj::m_getMenuID, 0, 0, 200 }, // D2
|
||||
{ "PopNum", PopUpMenuXObj::m_popNum, 3, 3, 200 }, // D2
|
||||
{ "PopText", PopUpMenuXObj::m_popText, 3, 3, 200 }, // D2
|
||||
{ "SetItem", PopUpMenuXObj::m_setItem, 2, 2, 200 }, // D2
|
||||
{ "SetItemMark", PopUpMenuXObj::m_setItemMark, 1, 1, 200 }, // D2
|
||||
{ "Smart", PopUpMenuXObj::m_smart, 1, 1, 200 }, // D2
|
||||
{ "SetItemIcon", PopUpMenuXObj::m_setItemIcon, 2, 2, 200 }, // D2
|
||||
{ nullptr, nullptr, 0, 0, 0 }
|
||||
};
|
||||
|
||||
void PopUpMenuXObj::open(ObjectType type, const Common::Path &path) {
|
||||
if (type == kXObj) {
|
||||
PopUpMenuXObject::initMethods(xlibMethods);
|
||||
PopUpMenuXObject *xobj = new PopUpMenuXObject(kXObj);
|
||||
g_lingo->exposeXObject(xlibName, xobj);
|
||||
}
|
||||
}
|
||||
|
||||
void PopUpMenuXObj::close(ObjectType type) {
|
||||
if (type == kXObj) {
|
||||
PopUpMenuXObject::cleanupMethods();
|
||||
g_lingo->_globalvars[xlibName] = Datum();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
PopUpMenuXObject::PopUpMenuXObject(ObjectType ObjectType) : Object<PopUpMenuXObject>("PopMenu") {
|
||||
_objType = ObjectType;
|
||||
}
|
||||
|
||||
void PopUpMenuXObj::m_new(int nargs) {
|
||||
PopUpMenuXObject *me = static_cast<PopUpMenuXObject *>(g_lingo->_state->me.u.obj);
|
||||
|
||||
int menuId = g_lingo->pop().asInt();
|
||||
Common::String menuList = g_lingo->pop().asString();
|
||||
|
||||
new Graphics::MacPopUp(menuId, g_director->_wm->getScreenBounds(), g_director->_wm, menuList.c_str());
|
||||
me->_menuId = menuId;
|
||||
|
||||
g_lingo->push(g_lingo->_state->me);
|
||||
}
|
||||
|
||||
void PopUpMenuXObj::m_popNum(int nargs) {
|
||||
PopUpMenuXObject *me = static_cast<PopUpMenuXObject *>(g_lingo->_state->me.u.obj);
|
||||
|
||||
int itemNum = g_lingo->pop().asInt();
|
||||
int top = g_lingo->pop().asInt();
|
||||
int left = g_lingo->pop().asInt();
|
||||
|
||||
// Convert window coordinates to screen coordinates
|
||||
Common::Rect windowRect = g_director->getCurrentWindow()->getMacWindow()->getInnerDimensions();
|
||||
int screenTop = top + windowRect.top - 1;
|
||||
int screenLeft = left + windowRect.left - 1;
|
||||
|
||||
Graphics::MacPopUp *menu = static_cast<Graphics::MacPopUp *>(g_director->_wm->getMenu(me->_menuId));
|
||||
int selected = menu->drawAndSelectMenu(screenLeft, screenTop, itemNum);
|
||||
g_lingo->push(Datum(selected));
|
||||
}
|
||||
|
||||
void PopUpMenuXObj::m_popText(int nargs) {
|
||||
PopUpMenuXObject *me = static_cast<PopUpMenuXObject *>(g_lingo->_state->me.u.obj);
|
||||
|
||||
int itemNum = g_lingo->pop().asInt();
|
||||
int top = g_lingo->pop().asInt();
|
||||
int left = g_lingo->pop().asInt();
|
||||
|
||||
// Convert window coordinates to screen coordinates
|
||||
Common::Rect windowRect = g_director->getCurrentWindow()->getMacWindow()->getInnerDimensions();
|
||||
int screenTop = top + windowRect.top - 1;
|
||||
int screenLeft = left + windowRect.left - 1;
|
||||
|
||||
Graphics::MacPopUp *menu = static_cast<Graphics::MacPopUp *>(g_director->_wm->getMenu(me->_menuId));
|
||||
int selected = menu->drawAndSelectMenu(screenLeft, screenTop, itemNum);
|
||||
Common::String selectedText = menu->getItemText(selected);
|
||||
|
||||
g_lingo->push(Datum(selectedText));
|
||||
}
|
||||
|
||||
void PopUpMenuXObj::m_smart(int nargs) {
|
||||
PopUpMenuXObject *me = static_cast<PopUpMenuXObject *>(g_lingo->_state->me.u.obj);
|
||||
bool isSmart = g_lingo->pop().asInt() != 0;
|
||||
|
||||
Graphics::MacPopUp *menu = static_cast<Graphics::MacPopUp *>(g_director->_wm->getMenu(me->_menuId));
|
||||
menu->setSmart(isSmart);
|
||||
}
|
||||
|
||||
XOBJSTUBNR(PopUpMenuXObj::m_appendMenu)
|
||||
XOBJSTUBNR(PopUpMenuXObj::m_disableItem)
|
||||
XOBJSTUBNR(PopUpMenuXObj::m_enableItem)
|
||||
XOBJSTUB(PopUpMenuXObj::m_getItem, "")
|
||||
XOBJSTUB(PopUpMenuXObj::m_getMenuID, 0)
|
||||
XOBJSTUBNR(PopUpMenuXObj::m_setItem)
|
||||
XOBJSTUBNR(PopUpMenuXObj::m_setItemMark)
|
||||
XOBJSTUBNR(PopUpMenuXObj::m_setItemIcon)
|
||||
|
||||
} // End of namespace Director
|
||||
58
engines/director/lingo/xlibs/p/popupmenuxobj.h
Normal file
58
engines/director/lingo/xlibs/p/popupmenuxobj.h
Normal file
@@ -0,0 +1,58 @@
|
||||
/* 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_POPUPMENUXOBJ_H
|
||||
#define DIRECTOR_LINGO_XLIBS_POPUPMENUXOBJ_H
|
||||
|
||||
namespace Director {
|
||||
|
||||
class PopUpMenuXObject : public Object<PopUpMenuXObject> {
|
||||
public:
|
||||
int _menuId;
|
||||
PopUpMenuXObject(ObjectType objType);
|
||||
};
|
||||
|
||||
namespace PopUpMenuXObj {
|
||||
|
||||
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_appendMenu(int nargs);
|
||||
void m_disableItem(int nargs);
|
||||
void m_enableItem(int nargs);
|
||||
void m_getItem(int nargs);
|
||||
void m_getMenuID(int nargs);
|
||||
void m_popNum(int nargs);
|
||||
void m_popText(int nargs);
|
||||
void m_setItem(int nargs);
|
||||
void m_setItemMark(int nargs);
|
||||
void m_smart(int nargs);
|
||||
void m_setItemIcon(int nargs);
|
||||
|
||||
} // End of namespace PopUpMenuXObj
|
||||
|
||||
} // End of namespace Director
|
||||
|
||||
#endif
|
||||
66
engines/director/lingo/xlibs/p/porta.cpp
Normal file
66
engines/director/lingo/xlibs/p/porta.cpp
Normal file
@@ -0,0 +1,66 @@
|
||||
/* 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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "director/director.h"
|
||||
#include "director/lingo/lingo.h"
|
||||
#include "director/lingo/lingo-object.h"
|
||||
#include "director/lingo/xlibs/p/porta.h"
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* XCMD: Porta
|
||||
*
|
||||
* USED IN:
|
||||
* the7colors: The Seven Colors: Legend of PSY・S City
|
||||
*
|
||||
* Used in Piano mini-game
|
||||
*
|
||||
*************************************/
|
||||
|
||||
namespace Director {
|
||||
|
||||
const char *const Porta::xlibName = "Porta";
|
||||
const XlibFileDesc Porta::fileNames[] = {
|
||||
{ "Porta", nullptr },
|
||||
{ "PortaXCMD.rsrc", nullptr },
|
||||
{ nullptr, nullptr },
|
||||
};
|
||||
|
||||
static const BuiltinProto builtins[] = {
|
||||
{ "Porta", Porta::b_porta, 1, 1, 300, HBLTIN },
|
||||
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
|
||||
};
|
||||
|
||||
void Porta::open(ObjectType type, const Common::Path &path) {
|
||||
g_lingo->initBuiltIns(builtins);
|
||||
}
|
||||
|
||||
void Porta::close(ObjectType type) {
|
||||
g_lingo->cleanupBuiltIns(builtins);
|
||||
}
|
||||
|
||||
void Porta::b_porta(int nargs) {
|
||||
int mode = g_lingo->pop().asInt();
|
||||
|
||||
debug(5, "LB::b_porta: mode: %d", mode);
|
||||
}
|
||||
|
||||
} // End of namespace Director
|
||||
41
engines/director/lingo/xlibs/p/porta.h
Normal file
41
engines/director/lingo/xlibs/p/porta.h
Normal file
@@ -0,0 +1,41 @@
|
||||
/* 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_PORTA_H
|
||||
#define DIRECTOR_LINGO_XLIBS_PORTA_H
|
||||
|
||||
namespace Director {
|
||||
|
||||
namespace Porta {
|
||||
|
||||
extern const char *const xlibName;
|
||||
extern const XlibFileDesc fileNames[];
|
||||
|
||||
void open(ObjectType type, const Common::Path &path);
|
||||
void close(ObjectType type);
|
||||
|
||||
void b_porta(int nargs);
|
||||
|
||||
} // End of namespace Porta
|
||||
|
||||
} // End of namespace Director
|
||||
|
||||
#endif
|
||||
85
engines/director/lingo/xlibs/p/prefpath.cpp
Normal file
85
engines/director/lingo/xlibs/p/prefpath.cpp
Normal file
@@ -0,0 +1,85 @@
|
||||
/* 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:
|
||||
* Night Light (Mac)
|
||||
*
|
||||
*************************************/
|
||||
/*
|
||||
-- PrefPath XObject
|
||||
I mNew
|
||||
X mDispose
|
||||
SS mPrefPath
|
||||
*/
|
||||
|
||||
#include "director/director.h"
|
||||
#include "director/lingo/lingo.h"
|
||||
#include "director/lingo/lingo-object.h"
|
||||
#include "director/lingo/xlibs/p/prefpath.h"
|
||||
|
||||
|
||||
namespace Director {
|
||||
|
||||
const char *const PrefPath::xlibName = "PrefPath";
|
||||
const XlibFileDesc PrefPath::fileNames[] = {
|
||||
{ "PrefPath", nullptr },
|
||||
{ nullptr, nullptr },
|
||||
};
|
||||
|
||||
static const MethodProto xlibMethods[] = {
|
||||
{ "PrefPath", PrefPath::m_prefpath, 1, 1, 400 }, // D4
|
||||
{ nullptr, nullptr, 0, 0, 0 }
|
||||
};
|
||||
|
||||
void PrefPath::open(ObjectType type, const Common::Path &path) {
|
||||
if (type == kXObj) {
|
||||
PrefPathObject::initMethods(xlibMethods);
|
||||
PrefPathObject *xobj = new PrefPathObject(kXObj);
|
||||
g_lingo->exposeXObject(xlibName, xobj);
|
||||
}
|
||||
}
|
||||
|
||||
void PrefPath::close(ObjectType type) {
|
||||
if (type == kXObj) {
|
||||
PrefPathObject::cleanupMethods();
|
||||
g_lingo->_globalvars[xlibName] = Datum();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
PrefPathObject::PrefPathObject(ObjectType ObjectType) :Object<PrefPathObject>("PrefPath") {
|
||||
_objType = ObjectType;
|
||||
}
|
||||
|
||||
void PrefPath::m_new(int nargs) {
|
||||
g_lingo->push(g_lingo->_state->me);
|
||||
}
|
||||
|
||||
void PrefPath::m_prefpath(int nargs) {
|
||||
// Returns 0 if the Preferences File cannot be read
|
||||
g_lingo->printSTUBWithArglist("PrefPath", nargs);
|
||||
g_lingo->dropStack(nargs);
|
||||
g_lingo->push(Datum(1));
|
||||
}
|
||||
|
||||
} // End of namespace Director
|
||||
47
engines/director/lingo/xlibs/p/prefpath.h
Normal file
47
engines/director/lingo/xlibs/p/prefpath.h
Normal file
@@ -0,0 +1,47 @@
|
||||
/* 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_PREFPATH_H
|
||||
#define DIRECTOR_LINGO_XLIBS_PREFPATH_H
|
||||
|
||||
namespace Director {
|
||||
|
||||
class PrefPathObject : public Object<PrefPathObject> {
|
||||
public:
|
||||
PrefPathObject(ObjectType objType);
|
||||
};
|
||||
|
||||
namespace PrefPath {
|
||||
|
||||
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_prefpath(int nargs);
|
||||
|
||||
} // End of namespace PrefPath
|
||||
|
||||
} // End of namespace Director
|
||||
|
||||
#endif
|
||||
388
engines/director/lingo/xlibs/p/printomatic.cpp
Normal file
388
engines/director/lingo/xlibs/p/printomatic.cpp
Normal file
@@ -0,0 +1,388 @@
|
||||
/* 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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "common/system.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/p/printomatic.h"
|
||||
|
||||
/**************************************************
|
||||
*
|
||||
* USED IN:
|
||||
* Plates are People Too!
|
||||
* I Spy
|
||||
*
|
||||
**************************************************/
|
||||
|
||||
/*
|
||||
-- PrintOMatic XObject
|
||||
-- Version 1.1.4, August 8, 1995
|
||||
-- ©1994-95 Electronic Ink
|
||||
--
|
||||
-- STANDARD METHODS
|
||||
I mNew
|
||||
X mDispose
|
||||
--
|
||||
-- DOCUMENT ATTRIBUTES
|
||||
X mReset
|
||||
I mNewPage
|
||||
XI mSetPage, pageNum
|
||||
IIIII mSetMargins, left, top, right, bottom
|
||||
X mSetPrintableMargins
|
||||
I mGetPageWidth
|
||||
I mGetPageHeight
|
||||
--
|
||||
-- GRAPHICS STATE
|
||||
XIII mSetColor, r, g, b (scale = 0-255)
|
||||
XI mSetGray, grayLevel (scale = 0-100)
|
||||
XII mSetPenSize, h, v
|
||||
XS mSetTextFont, fontName
|
||||
XI mSetTextSize, fontSize
|
||||
XS mSetTextStyle, styleNames
|
||||
XS mSetTextJust, [ right | left | centered ]
|
||||
--
|
||||
-- TEXT ELEMENTS
|
||||
XIIIII mTextBox, left, top, right, bottom, linkedToPrevious
|
||||
V mSetText, textString [, autoAppend]
|
||||
V mAppendText, textString [, autoAppend]
|
||||
V mAppendTextFile, fileName [, autoAppend]
|
||||
V mAppendTextResource, id | name [, autoAppend]
|
||||
ISII mDrawText, text, startH, startV
|
||||
S mGetInsertionPoint
|
||||
--
|
||||
-- MASTER FLOWS
|
||||
XIIII mMasterTextBox, left, top, right, bottom
|
||||
V mAppendMasterText, textString
|
||||
V mAppendMasterTextFiles, fileName
|
||||
XIIII mMasterPictBox, left, top, right, bottom
|
||||
V mAppendMasterPict, pict | pictFile | pictFolder | pictResID
|
||||
X mStageToMasterPict
|
||||
--
|
||||
-- GRAPHIC ELEMENTS
|
||||
XIIII mStrokedRect, left, top, right, bottom
|
||||
XIIII mFilledRect, left, top, right, bottom
|
||||
XIIIII mStrokedRoundRect, left, top, right, bottom, cornerRadius
|
||||
XIIIII mFilledRoundRect, left, top, right, bottom, cornerRadius
|
||||
V mStrokedOval [, left, top, right, bottom | , centerH, centerV, radius ]
|
||||
V mFilledOval [, left, top, right, bottom | , centerH, centerV, radius ]
|
||||
XIIII mLine, startH, startV, endH, endV
|
||||
V mPicture, pict | pictFile | pictResID, left, top [ , right, bottom ]
|
||||
V mStagePicture, left, top , right, bottom [,clipLeft ,clipTop ...]
|
||||
V m1BitStagePicture, left, top , right, bottom [,clipLeft ,clipTop ...]
|
||||
V mEPSFile, fileName, left, top , right, bottom
|
||||
--
|
||||
-- PRINTING
|
||||
II mSetLandscapeMode, trueOrFalse
|
||||
XS mSetDocumentName, name
|
||||
I mDoPageSetup
|
||||
I mDoJobSetup
|
||||
XS mSetProgressMsg, text
|
||||
V mSetProgressPict, pict
|
||||
XII mSetProgressLoc, left, top
|
||||
I mPrintPreview
|
||||
V mPrintPicts [, folder]
|
||||
X mPrint
|
||||
--
|
||||
-- SAVING TO DISK
|
||||
ISISS mSavePageSetup, fileName, resID, fileType, fileCreator
|
||||
ISI mGetPageSetup, fileName, resID
|
||||
--
|
||||
-- MISCELLANEOUS
|
||||
XI mHideMessages, trueOrFalse
|
||||
IS mSetPageNumSymbol, symbol
|
||||
IS mRegister, serialNumber
|
||||
|
||||
|
||||
-- xtra PrintOMatic
|
||||
--
|
||||
-- PrintOMatic Xtra
|
||||
-- Version 1.5.3
|
||||
-- Copyright 1994-97 Electronic Ink
|
||||
-- Published by g/matter, inc.
|
||||
--
|
||||
-- Product Information: http://www.gmatter.com/
|
||||
-- Technical Support & Updates: <support@gmatter.com>
|
||||
--
|
||||
--
|
||||
-- CREATE/DESTROY/RESET A DOCUMENT
|
||||
new object
|
||||
forget object
|
||||
reset object
|
||||
--
|
||||
-- DOCUMENT/JOB SETUP
|
||||
doPageSetup object -- returns TRUE or FALSE
|
||||
doJobSetup object -- returns TRUE or FALSE
|
||||
--
|
||||
-- DOCUMENT ATTRIBUTES
|
||||
setDocumentName object, string name
|
||||
setLandscapeMode object, boolean landscape
|
||||
setMargins object, rect margins
|
||||
setPrintableMargins object
|
||||
getPageWidth object -- returns page width
|
||||
getPageHeight object -- returns page height
|
||||
getPaperWidth object -- returns paper width
|
||||
getPaperHeight object -- returns paper height
|
||||
--
|
||||
-- CREATE/SET PAGES
|
||||
newPage object -- returns page number
|
||||
setPage object, int pageNumber
|
||||
--
|
||||
-- TEXT/GRAPHIC ATTRIBUTES
|
||||
setTextFont object, string fontName -- returns TRUE if font was set
|
||||
setTextSize object, int pointSize
|
||||
setTextStyle object, string styleCodes
|
||||
setTextJust object, string justification
|
||||
setTextLineSpacing object, int spacing
|
||||
setColor object, int red, int green, int blue
|
||||
setGray object, int graylevel
|
||||
setLineWeight object, int pointSize
|
||||
--
|
||||
-- GRAPHIC ELEMENTS
|
||||
drawRect object, rect bounds, boolean filled
|
||||
drawLine object, point start, point end
|
||||
drawRoundRect object, rect bounds, int cornerRadius, boolean filled
|
||||
drawOval object, rect bounds, boolean filled
|
||||
drawText object, string text, point location
|
||||
drawPicture object, * -- castmem or fileName, location (point or rect)
|
||||
drawStagePicture object, * -- location (point or rect), stage portion (rect)
|
||||
--
|
||||
-- CREATE FRAMES AND APPEND CONTENTS
|
||||
newFrame object, rect bounds, boolean linkedToPrevious
|
||||
append object, * any
|
||||
appendFile object, * fileName
|
||||
getInsertionPoint object -- returns string "page, x, y"
|
||||
--
|
||||
-- CUSTOMIZE THE PROGRESS BOX
|
||||
setProgressMsg object, string message
|
||||
setProgressPict object, * pictCastMember
|
||||
setProgressLoc object, point location
|
||||
--
|
||||
-- PRINT OR PREVIEW
|
||||
* printPreview *
|
||||
* print *
|
||||
--
|
||||
-- MISCELLANEOUS
|
||||
hideMessages object, boolean hide
|
||||
setPageNumSymbol object, string symbol
|
||||
+ register object, string serialNumber -- returns TRUE or FALSE
|
||||
+ setLowMemLimits object, globalHeap, localHeap
|
||||
|
||||
*/
|
||||
|
||||
namespace Director {
|
||||
|
||||
const char *PrintOMaticXObj::xlibName = "PrintOMatic";
|
||||
const XlibFileDesc PrintOMaticXObj::fileNames[] = {
|
||||
{ "PrintOMatic", nullptr },
|
||||
{ "PMATIC", nullptr },
|
||||
{ nullptr, nullptr },
|
||||
};
|
||||
|
||||
static MethodProto xlibMethods[] = {
|
||||
{ "new", PrintOMaticXObj::m_new, 0, 0, 400 },
|
||||
{ "dispose", PrintOMaticXObj::m_dispose, 0, 0, 400 },
|
||||
{ "forget", PrintOMaticXObj::m_dispose, 0, 0, 500 },
|
||||
{ "reset", PrintOMaticXObj::m_reset, 0, 0, 400 },
|
||||
{ "newPage", PrintOMaticXObj::m_newPage, 0, 0, 400 },
|
||||
{ "setPage", PrintOMaticXObj::m_setPage, 1, 1, 400 },
|
||||
{ "setMargins", PrintOMaticXObj::m_setMargins, 4, 4, 400 },
|
||||
{ "setPrintableMargins", PrintOMaticXObj::m_setPrintableMargins, 0, 0, 400 },
|
||||
{ "getPageWidth", PrintOMaticXObj::m_getPageWidth, 0, 0, 400 },
|
||||
{ "getPageHeight", PrintOMaticXObj::m_getPageHeight, 0, 0, 400 },
|
||||
{ "getPaperWidth", PrintOMaticXObj::m_getPaperWidth, 0, 0, 500 },
|
||||
{ "getPaperHeight", PrintOMaticXObj::m_getPaperHeight, 0, 0, 500 },
|
||||
{ "setColor", PrintOMaticXObj::m_setColor, 3, 3, 400 },
|
||||
{ "setGray", PrintOMaticXObj::m_setGray, 1, 1, 400 },
|
||||
{ "setPenSize", PrintOMaticXObj::m_setPenSize, 2, 2, 400 },
|
||||
{ "setLineWeight", PrintOMaticXObj::m_setLineWeight, 1, 1, 500 },
|
||||
{ "setTextFont", PrintOMaticXObj::m_setTextFont, 1, 1, 400 },
|
||||
{ "setTextSize", PrintOMaticXObj::m_setTextSize, 1, 1, 400 },
|
||||
{ "setTextStyle", PrintOMaticXObj::m_setTextStyle, 1, 1, 400 },
|
||||
{ "setTextJust", PrintOMaticXObj::m_setTextJust, 1, 1, 400 },
|
||||
{ "setTextLineSpacing", PrintOMaticXObj::m_setTextLineSpacing, 1, 1, 500 },
|
||||
{ "textBox", PrintOMaticXObj::m_textBox, 5, 5, 400 },
|
||||
{ "setText", PrintOMaticXObj::m_setText, 0, 0, 400 },
|
||||
{ "appendText", PrintOMaticXObj::m_appendText, 0, 0, 400 },
|
||||
{ "appendTextFile", PrintOMaticXObj::m_appendTextFile, 0, 0, 400 },
|
||||
{ "append", PrintOMaticXObj::m_appendText, 0, 0, 500 },
|
||||
{ "appendFile", PrintOMaticXObj::m_appendTextFile, 0, 0, 500 },
|
||||
{ "appendTextResource", PrintOMaticXObj::m_appendTextResource, 0, 0, 400 },
|
||||
{ "newFrame", PrintOMaticXObj::m_newFrame, 2, 2, 500 },
|
||||
{ "drawRect", PrintOMaticXObj::m_drawRect, 2, 2, 500 },
|
||||
{ "drawLine", PrintOMaticXObj::m_drawLine, 2, 2, 500 },
|
||||
{ "drawRoundRect", PrintOMaticXObj::m_drawRoundRect, 3, 3, 500 },
|
||||
{ "drawOval", PrintOMaticXObj::m_drawOval, 2, 2, 500 },
|
||||
{ "drawText", PrintOMaticXObj::m_drawText, 3, 3, 400 },
|
||||
{ "drawPicture", PrintOMaticXObj::m_drawPicture, 2, 2, 500 },
|
||||
{ "drawStagePicture", PrintOMaticXObj::m_drawStagePicture, 2, 2, 500 },
|
||||
{ "getInsertionPoint", PrintOMaticXObj::m_getInsertionPoint, 0, 0, 400 },
|
||||
{ "masterTextBox", PrintOMaticXObj::m_masterTextBox, 4, 4, 400 },
|
||||
{ "appendMasterText", PrintOMaticXObj::m_appendMasterText, 0, 0, 400 },
|
||||
{ "appendMasterTextFiles", PrintOMaticXObj::m_appendMasterTextFiles, 0, 0, 400 },
|
||||
{ "masterPictBox", PrintOMaticXObj::m_masterPictBox, 4, 4, 400 },
|
||||
{ "appendMasterPict", PrintOMaticXObj::m_appendMasterPict, 0, 0, 400 },
|
||||
{ "stageToMasterPict", PrintOMaticXObj::m_stageToMasterPict, 0, 0, 400 },
|
||||
{ "strokedRect", PrintOMaticXObj::m_strokedRect, 4, 4, 400 },
|
||||
{ "filledRect", PrintOMaticXObj::m_filledRect, 4, 4, 400 },
|
||||
{ "strokedRoundRect", PrintOMaticXObj::m_strokedRoundRect, 5, 5, 400 },
|
||||
{ "filledRoundRect", PrintOMaticXObj::m_filledRoundRect, 5, 5, 400 },
|
||||
{ "strokedOval", PrintOMaticXObj::m_strokedOval, 0, 0, 400 },
|
||||
{ "filledOval", PrintOMaticXObj::m_filledOval, 0, 0, 400 },
|
||||
{ "line", PrintOMaticXObj::m_line, 4, 4, 400 },
|
||||
{ "picture", PrintOMaticXObj::m_picture, 0, 0, 400 },
|
||||
{ "stagePicture", PrintOMaticXObj::m_stagePicture, 0, 0, 400 },
|
||||
{ "1BitStagePicture", PrintOMaticXObj::m_1BitStagePicture, 0, 0, 400 },
|
||||
{ "ePSFile", PrintOMaticXObj::m_ePSFile, 0, 0, 400 },
|
||||
{ "setLandscapeMode", PrintOMaticXObj::m_setLandscapeMode, 1, 1, 400 },
|
||||
{ "setDocumentName", PrintOMaticXObj::m_setDocumentName, 1, 1, 400 },
|
||||
{ "doPageSetup", PrintOMaticXObj::m_doPageSetup, 0, 0, 400 },
|
||||
{ "doJobSetup", PrintOMaticXObj::m_doJobSetup, 0, 0, 400 },
|
||||
{ "setProgressMsg", PrintOMaticXObj::m_setProgressMsg, 1, 1, 400 },
|
||||
{ "setProgressPict", PrintOMaticXObj::m_setProgressPict, 0, 0, 400 },
|
||||
{ "setProgressLoc", PrintOMaticXObj::m_setProgressLoc, 2, 2, 400 },
|
||||
{ "printPreview", PrintOMaticXObj::m_printPreview, 0, 0, 400 },
|
||||
{ "printPicts", PrintOMaticXObj::m_printPicts, 0, 0, 400 },
|
||||
{ "print", PrintOMaticXObj::m_print, 0, 0, 400 },
|
||||
{ "savePageSetup", PrintOMaticXObj::m_savePageSetup, 4, 4, 400 },
|
||||
{ "getPageSetup", PrintOMaticXObj::m_getPageSetup, 2, 2, 400 },
|
||||
{ "hideMessages", PrintOMaticXObj::m_hideMessages, 1, 1, 400 },
|
||||
{ "setPageNumSymbol", PrintOMaticXObj::m_setPageNumSymbol, 1, 1, 400 },
|
||||
{ "register", PrintOMaticXObj::m_register, 1, 1, 400 },
|
||||
{ nullptr, nullptr, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static BuiltinProto xlibBuiltins[] = {
|
||||
|
||||
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
|
||||
};
|
||||
|
||||
PrintOMaticXObject::PrintOMaticXObject(ObjectType ObjectType) :Object<PrintOMaticXObject>("PrintOMatic") {
|
||||
_objType = ObjectType;
|
||||
}
|
||||
|
||||
bool PrintOMaticXObject::hasProp(const Common::String &propName) {
|
||||
return (propName == "name");
|
||||
}
|
||||
|
||||
Datum PrintOMaticXObject::getProp(const Common::String &propName) {
|
||||
if (propName == "name")
|
||||
return Datum(PrintOMaticXObj::xlibName);
|
||||
warning("FileIO::PrintOMaticXObject: unknown property '%s'", propName.c_str());
|
||||
return Datum();
|
||||
}
|
||||
|
||||
void PrintOMaticXObj::open(ObjectType type, const Common::Path &path) {
|
||||
PrintOMaticXObject::initMethods(xlibMethods);
|
||||
PrintOMaticXObject *xobj = new PrintOMaticXObject(type);
|
||||
if (type == kXtraObj) {
|
||||
g_lingo->_openXtras.push_back(xlibName);
|
||||
g_lingo->_openXtraObjects.push_back(xobj);
|
||||
}
|
||||
g_lingo->exposeXObject(xlibName, xobj);
|
||||
g_lingo->initBuiltIns(xlibBuiltins);
|
||||
}
|
||||
|
||||
void PrintOMaticXObj::close(ObjectType type) {
|
||||
PrintOMaticXObject::cleanupMethods();
|
||||
g_lingo->_globalvars[xlibName] = Datum();
|
||||
|
||||
}
|
||||
|
||||
void PrintOMaticXObj::m_new(int nargs) {
|
||||
g_lingo->printSTUBWithArglist("PrintOMaticXObj::m_new", nargs);
|
||||
g_lingo->dropStack(nargs);
|
||||
g_lingo->push(g_lingo->_state->me);
|
||||
}
|
||||
|
||||
XOBJSTUBNR(PrintOMaticXObj::m_dispose)
|
||||
XOBJSTUBNR(PrintOMaticXObj::m_reset)
|
||||
XOBJSTUB(PrintOMaticXObj::m_newPage, 0)
|
||||
XOBJSTUBNR(PrintOMaticXObj::m_setPage)
|
||||
XOBJSTUB(PrintOMaticXObj::m_setMargins, 0)
|
||||
XOBJSTUBNR(PrintOMaticXObj::m_setPrintableMargins)
|
||||
XOBJSTUB(PrintOMaticXObj::m_getPageWidth, 0)
|
||||
XOBJSTUB(PrintOMaticXObj::m_getPageHeight, 0)
|
||||
XOBJSTUB(PrintOMaticXObj::m_getPaperWidth, 0)
|
||||
XOBJSTUB(PrintOMaticXObj::m_getPaperHeight, 0)
|
||||
XOBJSTUBNR(PrintOMaticXObj::m_setColor)
|
||||
XOBJSTUBNR(PrintOMaticXObj::m_setGray)
|
||||
XOBJSTUBNR(PrintOMaticXObj::m_setPenSize)
|
||||
XOBJSTUBNR(PrintOMaticXObj::m_setLineWeight)
|
||||
XOBJSTUBNR(PrintOMaticXObj::m_setTextFont)
|
||||
XOBJSTUBNR(PrintOMaticXObj::m_setTextSize)
|
||||
XOBJSTUBNR(PrintOMaticXObj::m_setTextStyle)
|
||||
XOBJSTUBNR(PrintOMaticXObj::m_setTextJust)
|
||||
XOBJSTUBNR(PrintOMaticXObj::m_setTextLineSpacing)
|
||||
XOBJSTUBNR(PrintOMaticXObj::m_textBox)
|
||||
XOBJSTUB(PrintOMaticXObj::m_setText, 0)
|
||||
XOBJSTUB(PrintOMaticXObj::m_appendText, 0)
|
||||
XOBJSTUB(PrintOMaticXObj::m_appendTextFile, 0)
|
||||
XOBJSTUB(PrintOMaticXObj::m_appendTextResource, 0)
|
||||
XOBJSTUB(PrintOMaticXObj::m_newFrame, 0)
|
||||
XOBJSTUBNR(PrintOMaticXObj::m_drawRect)
|
||||
XOBJSTUBNR(PrintOMaticXObj::m_drawLine)
|
||||
XOBJSTUBNR(PrintOMaticXObj::m_drawRoundRect)
|
||||
XOBJSTUBNR(PrintOMaticXObj::m_drawOval)
|
||||
XOBJSTUB(PrintOMaticXObj::m_drawText, 0)
|
||||
XOBJSTUBNR(PrintOMaticXObj::m_drawPicture)
|
||||
XOBJSTUBNR(PrintOMaticXObj::m_drawStagePicture)
|
||||
XOBJSTUB(PrintOMaticXObj::m_getInsertionPoint, "page, 0, 0")
|
||||
XOBJSTUBNR(PrintOMaticXObj::m_masterTextBox)
|
||||
XOBJSTUB(PrintOMaticXObj::m_appendMasterText, 0)
|
||||
XOBJSTUB(PrintOMaticXObj::m_appendMasterTextFiles, 0)
|
||||
XOBJSTUBNR(PrintOMaticXObj::m_masterPictBox)
|
||||
XOBJSTUB(PrintOMaticXObj::m_appendMasterPict, 0)
|
||||
XOBJSTUBNR(PrintOMaticXObj::m_stageToMasterPict)
|
||||
XOBJSTUBNR(PrintOMaticXObj::m_strokedRect)
|
||||
XOBJSTUBNR(PrintOMaticXObj::m_filledRect)
|
||||
XOBJSTUBNR(PrintOMaticXObj::m_strokedRoundRect)
|
||||
XOBJSTUBNR(PrintOMaticXObj::m_filledRoundRect)
|
||||
XOBJSTUB(PrintOMaticXObj::m_strokedOval, 0)
|
||||
XOBJSTUB(PrintOMaticXObj::m_filledOval, 0)
|
||||
XOBJSTUBNR(PrintOMaticXObj::m_line)
|
||||
XOBJSTUB(PrintOMaticXObj::m_picture, 0)
|
||||
XOBJSTUB(PrintOMaticXObj::m_stagePicture, 0)
|
||||
XOBJSTUB(PrintOMaticXObj::m_1BitStagePicture, 0)
|
||||
XOBJSTUB(PrintOMaticXObj::m_ePSFile, 0)
|
||||
XOBJSTUB(PrintOMaticXObj::m_setLandscapeMode, 0)
|
||||
XOBJSTUBNR(PrintOMaticXObj::m_setDocumentName)
|
||||
XOBJSTUB(PrintOMaticXObj::m_doPageSetup, 0)
|
||||
XOBJSTUB(PrintOMaticXObj::m_doJobSetup, 0)
|
||||
XOBJSTUBNR(PrintOMaticXObj::m_setProgressMsg)
|
||||
XOBJSTUB(PrintOMaticXObj::m_setProgressPict, 0)
|
||||
XOBJSTUBNR(PrintOMaticXObj::m_setProgressLoc)
|
||||
XOBJSTUB(PrintOMaticXObj::m_printPreview, 0)
|
||||
XOBJSTUB(PrintOMaticXObj::m_printPicts, 0)
|
||||
XOBJSTUBNR(PrintOMaticXObj::m_print)
|
||||
XOBJSTUB(PrintOMaticXObj::m_savePageSetup, 0)
|
||||
XOBJSTUB(PrintOMaticXObj::m_getPageSetup, 0)
|
||||
XOBJSTUBNR(PrintOMaticXObj::m_hideMessages)
|
||||
XOBJSTUB(PrintOMaticXObj::m_setPageNumSymbol, 0)
|
||||
|
||||
void PrintOMaticXObj::m_register(int nargs) {
|
||||
Common::String serialNumber = g_lingo->pop().asString();
|
||||
debugC(1, kDebugXObj, "PrintOMaticXObj::m_register: Registered with serial \"%s\"", serialNumber.c_str());
|
||||
}
|
||||
|
||||
}
|
||||
114
engines/director/lingo/xlibs/p/printomatic.h
Normal file
114
engines/director/lingo/xlibs/p/printomatic.h
Normal file
@@ -0,0 +1,114 @@
|
||||
/* 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_PRINTOMATIC_H
|
||||
#define DIRECTOR_LINGO_XLIBS_PRINTOMATIC_H
|
||||
|
||||
namespace Director {
|
||||
|
||||
class PrintOMaticXObject : public Object<PrintOMaticXObject> {
|
||||
public:
|
||||
PrintOMaticXObject(ObjectType objType);
|
||||
|
||||
bool hasProp(const Common::String &propName) override;
|
||||
Datum getProp(const Common::String &propName) override;
|
||||
};
|
||||
|
||||
namespace PrintOMaticXObj {
|
||||
|
||||
extern const char *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_reset(int nargs);
|
||||
void m_newPage(int nargs);
|
||||
void m_setPage(int nargs);
|
||||
void m_setMargins(int nargs);
|
||||
void m_setPrintableMargins(int nargs);
|
||||
void m_getPageWidth(int nargs);
|
||||
void m_getPageHeight(int nargs);
|
||||
void m_getPaperWidth(int nargs);
|
||||
void m_getPaperHeight(int nargs);
|
||||
void m_setColor(int nargs);
|
||||
void m_setGray(int nargs);
|
||||
void m_setPenSize(int nargs);
|
||||
void m_setLineWeight(int nargs);
|
||||
void m_setTextFont(int nargs);
|
||||
void m_setTextSize(int nargs);
|
||||
void m_setTextStyle(int nargs);
|
||||
void m_setTextJust(int nargs);
|
||||
void m_setTextLineSpacing(int nargs);
|
||||
void m_textBox(int nargs);
|
||||
void m_setText(int nargs);
|
||||
void m_appendText(int nargs);
|
||||
void m_appendTextFile(int nargs);
|
||||
void m_appendTextResource(int nargs);
|
||||
void m_newFrame(int nargs);
|
||||
void m_drawRect(int nargs);
|
||||
void m_drawLine(int nargs);
|
||||
void m_drawRoundRect(int nargs);
|
||||
void m_drawOval(int nargs);
|
||||
void m_drawText(int nargs);
|
||||
void m_drawPicture(int nargs);
|
||||
void m_drawStagePicture(int nargs);
|
||||
void m_getInsertionPoint(int nargs);
|
||||
void m_masterTextBox(int nargs);
|
||||
void m_appendMasterText(int nargs);
|
||||
void m_appendMasterTextFiles(int nargs);
|
||||
void m_masterPictBox(int nargs);
|
||||
void m_appendMasterPict(int nargs);
|
||||
void m_stageToMasterPict(int nargs);
|
||||
void m_strokedRect(int nargs);
|
||||
void m_filledRect(int nargs);
|
||||
void m_strokedRoundRect(int nargs);
|
||||
void m_filledRoundRect(int nargs);
|
||||
void m_strokedOval(int nargs);
|
||||
void m_filledOval(int nargs);
|
||||
void m_line(int nargs);
|
||||
void m_picture(int nargs);
|
||||
void m_stagePicture(int nargs);
|
||||
void m_1BitStagePicture(int nargs);
|
||||
void m_ePSFile(int nargs);
|
||||
void m_setLandscapeMode(int nargs);
|
||||
void m_setDocumentName(int nargs);
|
||||
void m_doPageSetup(int nargs);
|
||||
void m_doJobSetup(int nargs);
|
||||
void m_setProgressMsg(int nargs);
|
||||
void m_setProgressPict(int nargs);
|
||||
void m_setProgressLoc(int nargs);
|
||||
void m_printPreview(int nargs);
|
||||
void m_printPicts(int nargs);
|
||||
void m_print(int nargs);
|
||||
void m_savePageSetup(int nargs);
|
||||
void m_getPageSetup(int nargs);
|
||||
void m_hideMessages(int nargs);
|
||||
void m_setPageNumSymbol(int nargs);
|
||||
void m_register(int nargs);
|
||||
|
||||
} // End of namespace PrintOMaticXObj
|
||||
|
||||
} // End of namespace Director
|
||||
|
||||
#endif
|
||||
92
engines/director/lingo/xlibs/p/processxobj.cpp
Normal file
92
engines/director/lingo/xlibs/p/processxobj.cpp
Normal file
@@ -0,0 +1,92 @@
|
||||
/* 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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "common/system.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/p/processxobj.h"
|
||||
|
||||
/**************************************************
|
||||
*
|
||||
* USED IN:
|
||||
* chopsuey
|
||||
*
|
||||
**************************************************/
|
||||
|
||||
/*
|
||||
-- ProcessXObj, Kills a specified process
|
||||
-- ©1994 Image Technologies, Inc.
|
||||
-- Written by: Steve Kos
|
||||
X mNew -- inits mem space
|
||||
X mDispose
|
||||
ISS mFindPSN -- finds the psn
|
||||
X mKillProcess -- kills this process
|
||||
*/
|
||||
|
||||
namespace Director {
|
||||
|
||||
const char *const ProcessXObj::xlibName = "ProcessXObj";
|
||||
const XlibFileDesc ProcessXObj::fileNames[] = {
|
||||
{ "ProcessXObj", nullptr },
|
||||
{ nullptr, nullptr },
|
||||
};
|
||||
|
||||
static const MethodProto xlibMethods[] = {
|
||||
{ "new", ProcessXObj::m_new, 0, 0, 400 },
|
||||
{ "dispose", ProcessXObj::m_dispose, 0, 0, 400 },
|
||||
{ "findPSN", ProcessXObj::m_findPSN, 2, 2, 400 },
|
||||
{ "killProcess", ProcessXObj::m_killProcess, 0, 0, 400 },
|
||||
{ nullptr, nullptr, 0, 0, 0 }
|
||||
};
|
||||
|
||||
ProcessXObject::ProcessXObject(ObjectType ObjectType) :Object<ProcessXObject>("ProcessXObj") {
|
||||
_objType = ObjectType;
|
||||
}
|
||||
|
||||
void ProcessXObj::open(ObjectType type, const Common::Path &path) {
|
||||
if (type == kXObj) {
|
||||
ProcessXObject::initMethods(xlibMethods);
|
||||
ProcessXObject *xobj = new ProcessXObject(kXObj);
|
||||
g_lingo->exposeXObject(xlibName, xobj);
|
||||
}
|
||||
}
|
||||
|
||||
void ProcessXObj::close(ObjectType type) {
|
||||
if (type == kXObj) {
|
||||
ProcessXObject::cleanupMethods();
|
||||
g_lingo->_globalvars[xlibName] = Datum();
|
||||
}
|
||||
}
|
||||
|
||||
void ProcessXObj::m_new(int nargs) {
|
||||
g_lingo->printSTUBWithArglist("ProcessXObj::m_new", nargs);
|
||||
g_lingo->dropStack(nargs);
|
||||
g_lingo->push(g_lingo->_state->me);
|
||||
}
|
||||
|
||||
XOBJSTUBNR(ProcessXObj::m_dispose)
|
||||
XOBJSTUB(ProcessXObj::m_findPSN, 0)
|
||||
XOBJSTUBNR(ProcessXObj::m_killProcess)
|
||||
|
||||
}
|
||||
49
engines/director/lingo/xlibs/p/processxobj.h
Normal file
49
engines/director/lingo/xlibs/p/processxobj.h
Normal 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_PROCESSXOBJ_H
|
||||
#define DIRECTOR_LINGO_XLIBS_PROCESSXOBJ_H
|
||||
|
||||
namespace Director {
|
||||
|
||||
class ProcessXObject : public Object<ProcessXObject> {
|
||||
public:
|
||||
ProcessXObject(ObjectType objType);
|
||||
};
|
||||
|
||||
namespace ProcessXObj {
|
||||
|
||||
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_findPSN(int nargs);
|
||||
void m_killProcess(int nargs);
|
||||
|
||||
} // End of namespace ProcessXObj
|
||||
|
||||
} // End of namespace Director
|
||||
|
||||
#endif
|
||||
96
engines/director/lingo/xlibs/p/putcurs.cpp
Normal file
96
engines/director/lingo/xlibs/p/putcurs.cpp
Normal 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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "common/system.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/p/putcurs.h"
|
||||
|
||||
/**************************************************
|
||||
*
|
||||
* USED IN:
|
||||
* Die tolle Spiele-Box (Tivola)
|
||||
* Masters of the Elements
|
||||
*
|
||||
**************************************************/
|
||||
|
||||
/*
|
||||
--Put Cursor XObject. 31 ago 95. Mauricio Piacentini Tabuleiro da Baiana Multimedia
|
||||
--putCurs
|
||||
I mNew --Creates a new instance of the XObject
|
||||
X mDispose --Disposes of XObject instance
|
||||
III mSet, Xpos, Ypos --Set the cursor to a new position
|
||||
*/
|
||||
|
||||
namespace Director {
|
||||
|
||||
const char *PutcursXObj::xlibName = "Putcurs";
|
||||
const XlibFileDesc PutcursXObj::fileNames[] = {
|
||||
{ "PUTCURS", nullptr },
|
||||
{ nullptr, nullptr },
|
||||
};
|
||||
|
||||
static MethodProto xlibMethods[] = {
|
||||
{ "new", PutcursXObj::m_new, 0, 0, 400 },
|
||||
{ "dispose", PutcursXObj::m_dispose, 0, 0, 400 },
|
||||
{ "set", PutcursXObj::m_set, 2, 2, 400 },
|
||||
{ nullptr, nullptr, 0, 0, 0 }
|
||||
};
|
||||
|
||||
PutcursXObject::PutcursXObject(ObjectType ObjectType) :Object<PutcursXObject>("Putcurs") {
|
||||
_objType = ObjectType;
|
||||
}
|
||||
|
||||
void PutcursXObj::open(ObjectType type, const Common::Path &path) {
|
||||
PutcursXObject::initMethods(xlibMethods);
|
||||
PutcursXObject *xobj = new PutcursXObject(kXObj);
|
||||
g_lingo->exposeXObject(xlibName, xobj);
|
||||
}
|
||||
|
||||
void PutcursXObj::close(ObjectType type) {
|
||||
PutcursXObject::cleanupMethods();
|
||||
g_lingo->_globalvars[xlibName] = Datum();
|
||||
|
||||
}
|
||||
|
||||
void PutcursXObj::m_new(int nargs) {
|
||||
g_lingo->printSTUBWithArglist("PutcursXObj::m_new", nargs);
|
||||
g_lingo->dropStack(nargs);
|
||||
g_lingo->push(g_lingo->_state->me);
|
||||
}
|
||||
|
||||
void PutcursXObj::m_set(int nargs) {
|
||||
if (nargs != 2) {
|
||||
warning("PutcursXObj::m_set: expected 2 arguments, got %d", nargs);
|
||||
g_lingo->dropStack(nargs);
|
||||
return;
|
||||
}
|
||||
int y = g_lingo->pop().asInt();
|
||||
int x = g_lingo->pop().asInt();
|
||||
g_system->warpMouse(x, y);
|
||||
}
|
||||
|
||||
XOBJSTUBNR(PutcursXObj::m_dispose)
|
||||
|
||||
}
|
||||
48
engines/director/lingo/xlibs/p/putcurs.h
Normal file
48
engines/director/lingo/xlibs/p/putcurs.h
Normal file
@@ -0,0 +1,48 @@
|
||||
/* 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_PUTCURS_H
|
||||
#define DIRECTOR_LINGO_XLIBS_PUTCURS_H
|
||||
|
||||
namespace Director {
|
||||
|
||||
class PutcursXObject : public Object<PutcursXObject> {
|
||||
public:
|
||||
PutcursXObject(ObjectType objType);
|
||||
};
|
||||
|
||||
namespace PutcursXObj {
|
||||
|
||||
extern const char *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_set(int nargs);
|
||||
|
||||
} // End of namespace PutcursXObj
|
||||
|
||||
} // End of namespace Director
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user