Initial commit

This commit is contained in:
2026-02-02 04:50:13 +01:00
commit 5b11698731
22592 changed files with 7677434 additions and 0 deletions

View File

@@ -0,0 +1,491 @@
/* 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 2.0
* Cellofania
*
*************************************/
/*
* --AppleAudioCD, CDAudio, 1.0, 4/3/90
* --
* --© 1989, 1990 MacroMind, Inc.
* -- by Jeff Tanner
* --
* ------------------------------------------------------
* ------------------------------------------------------
* -- An Apple CD SC Player must be mounted
* -- in order for this XObject to operate properly.
* -- The easiest way to check for mounting is to
* -- check the desktop for the CD icon.
* ------------------------------------------------------
* ------------------------------------------------------
* -- This XObject recognizes only the first player in the SCSI chain .
* ------------------------------------------------------
* ------------------------------------------------------
* --=METHODS=--
* X mNew --Creates a new instance of the XObject.
* X mDispose --Disposes of the instance.
* S mName --Returns name of the XObject.
* ------------------------------------------------------
* ------------------------------------------------------
* -- PLAY CD METHODS:
* S mPlay --Plays current track from the beginning.
* SI mPlayTrack, trackNum --Plays the specified track from the beginning.
* SS mPlayName, trackName --Plays by track name.
* -- Note: The full pathname is unnecessary.
* -- The track names for tracks 1 - 9 are
* -- "TRACK<space><space>trackNum" and for tracks 10 to 99 are
* -- "TRACK<space>trackNum".
* SIII mPlayAbsTime, minute, second, frame --Starts play at absolute time position on current CD-ROM.
* --
* SIIIIII mPlaySegment, startMin, startSec, startFrm, stopMin, stopSec, stopFrm
* -- < startMin, startSec, startFrm > - Start time
* -- < stopMin, stopSec, stopFrm > - Stop time
* SII mAskPlay, leftDialog, topDialog --With a file dialog box,
* -- selects an Audio track to play.
* -- < leftDialog, topDialog > - Where to place the file dialog box
* ------------------------------------------------------
* S mStepFwd --Steps forward one track and Plays.
* S mStepBwd --Steps back one track and Plays.
* --
* S mPause --Pauses the player.
* -- When this method is called a second time,
* -- the player will continue in normal play mode.
* S mContinue --Continues the mode prior to calling mPause.
* --
* S mStop --Stops play.
* SI mStopTrack, trackNum --Stops when the selected track finishes playing.
* SIII mStopAbsTime, minute, second, frame --Stops play at a specified absolute time position.
* S mRemoveStop -- Removes stop conditions.
* -- Stop conditions are set with these methods:
* -- mPlaySegment
* -- mStopTrack
* -- mStopAbsTime
* --
* S mEject --Ejects CD-ROM from drive.
* --
* ------------------------------------------------------
* ------------------------------------------------------
* -- STATUS METHODS:
* S mStatus --Returns status of Audio CD player.
* -- Returns message strings:
* -- Audio play in progress
* -- Audio pause in operation
* -- Audio muting on
* -- Audio play operation completed
* -- Error occurred during audio play
* -- Not currently playing
* --
* S mPlayMode --Returns a play mode from audio track.
* -- The play mode describes how to play the audio track.
* -- Returns message strings:
* -- Muting on (no audio)
* -- Right channel through right channel only
* -- Left channel through right channel only
* -- Left and right channels through right channel only
* -- Right channel through left channel only
* -- Right channel through left and right channel
* -- Right channel through left channel,
* -- Left channel through right channel
* -- Right channel through left channel,
* -- Left and right channels through right channel
* -- Left channel through left channel only
* -- Left channel through left channel,
* -- Right channel through right channel (Stereo)
* -- Left channel through left and right channel
* -- Left channel through left channel,
* -- Left and right channels through right channel
* -- Left and right channels through left channel only
* -- Left and right channels through left channel,
* -- Right channel through right channel
* -- Left and right channels through left channel,
* -- Left channel through right channel
* -- Left and right channels through
* -- both left channel and right channel (Mono)
* --
* S mCurrentFormat --Returns the format of the current track.
* -- Returns message strings:
* -- 2 audio channels without preemphasis
* -- 2 audio channels with preemphasis
* -- 4 audio channels without preemphasis
* -- 4 audio channels with preemphasis
* -- Data track
* --
* ------------------------------------------------------
* ------------------------------------------------------
* --
* I mCurrentTrack --Returns number of the current track.
* S mCurrentTime --Returns the current absolute time (min:sec:frm).
* --
* I mFirstTrack -- Returns first track number on current CD-ROM.
* I mLastTrack -- Returns last track number on current CD-ROM.
* S mTotalTime -- Returns total time on current CD-ROM (min:sec:frm)
* ------------------------------------------------------
* ------------------------------------------------------
* -- SCANNING METHODS:
* -- Starting at a specific time:
* -- min, sec, and frm parameters are to indicate
* -- the absolute time to start scan.
* -- monitorP - if true, it will stop scan moment mouse
* -- is released, and continue playing at current position.
* -- However, this will inhibit all other events.
* -- Otherwise use mStopScan method.
* SIIII mScanFwd min, sec, frm, monitorP -- Fast forward scan
* SIIII mScanBwd min, sec, frm, monitorP -- Fast reverse scan
* --
* S mStopScan --Stops scan and continues playing at current position.
* --
* -- End description of AppleAudioCD XObject methods.
* ------------------------------------------------------
* ------------------------------------------------------
*/
#include "backends/audiocd/audiocd.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/c/cdromxobj.h"
namespace Director {
const char *const CDROMXObj::xlibName = "AppleAudioCD";
const XlibFileDesc CDROMXObj::fileNames[] = {
{ "CD-ROM XObj", nullptr },
{ "AppleAudioCD", nullptr },
{ nullptr, nullptr },
};
static const MethodProto xlibMethods[] = {
{ "new", CDROMXObj::m_new, 0, 0, 200 }, // D2
{ "Name", CDROMXObj::m_name, 0, 0, 200 }, // D2
{ "Play", CDROMXObj::m_play, 0, 0, 200 }, // D2
{ "PlayTrack", CDROMXObj::m_playTrack, 1, 1, 200 }, // D2
{ "PlayName", CDROMXObj::m_playName, 1, 1, 200 }, // D2
{ "PlayAbsTime", CDROMXObj::m_playAbsTime, 3, 3, 200 }, // D2
{ "PlaySegment", CDROMXObj::m_playSegment, 6, 6, 200 }, // D2
{ "AskPlay", CDROMXObj::m_askPlay, 2, 2, 200 }, // D2
{ "StepFwd", CDROMXObj::m_stepFwd, 0, 0, 200 }, // D2
{ "StepBwd", CDROMXObj::m_stepBwd, 0, 0, 200 }, // D2
{ "Pause", CDROMXObj::m_pause, 0, 0, 200 }, // D2
{ "Continue", CDROMXObj::m_continue, 0, 0, 200 }, // D2
{ "Stop", CDROMXObj::m_stop, 0, 0, 200 }, // D2
{ "StopTrack", CDROMXObj::m_stopTrack, 1, 1, 200 }, // D2
{ "StopAbsTime", CDROMXObj::m_stopAbsTime, 3, 3, 200 }, // D2
{ "RemoveStop", CDROMXObj::m_removeStop, 0, 0, 200 }, // D2
{ "Eject", CDROMXObj::m_eject, 0, 0, 200 }, // D2
{ "Status", CDROMXObj::m_status, 0, 0, 200 }, // D2
{ "PlayMode", CDROMXObj::m_playMode, 0, 0, 200 }, // D2
{ "CurrentFormat", CDROMXObj::m_currentFormat, 0, 0, 200 }, // D2
{ "CurrentTrack", CDROMXObj::m_currentTrack, 0, 0, 200 }, // D2
{ "CurrentTime", CDROMXObj::m_currentTime, 0, 0, 200 }, // D2
{ "FirstTrack", CDROMXObj::m_firstTrack, 0, 0, 200 }, // D2
{ "LastTrack", CDROMXObj::m_lastTrack, 0, 0, 200 }, // D2
{ "TotalTime", CDROMXObj::m_totalTime, 0, 0, 200 }, // D2
{ "ScanFwd", CDROMXObj::m_scanFwd, 4, 4, 200 }, // D2
{ "ScanBwd", CDROMXObj::m_scanBwd, 4, 4, 200 }, // D2
{ "StopScan", CDROMXObj::m_stopScan, 0, 0, 200 }, // D2
{ nullptr, nullptr, 0, 0, 0 }
};
void CDROMXObj::open(ObjectType type, const Common::Path &path) {
if (type == kXObj) {
CDROMXObject::initMethods(xlibMethods);
CDROMXObject *xobj = new CDROMXObject(kXObj);
g_lingo->exposeXObject(xlibName, xobj);
}
}
void CDROMXObj::close(ObjectType type) {
if (type == kXObj) {
CDROMXObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
g_director->_system->getAudioCDManager()->close();
}
}
CDROMXObject::CDROMXObject(ObjectType ObjectType) :Object<CDROMXObject>("AppleAudioCD") {
_objType = ObjectType;
// Initialize _cdda_status
_cdda_status.playing = false;
_cdda_status.track = 0;
_cdda_status.start = 0;
_cdda_status.duration = 0;
_cdda_status.numLoops = 0;
_cdda_status.volume = Audio::Mixer::kMaxChannelVolume;
_cdda_status.balance = 0;
}
void CDROMXObj::m_new(int nargs) {
g_director->_system->getAudioCDManager()->open();
g_lingo->printSTUBWithArglist("CDROMXObj::m_new", nargs);
g_lingo->dropStack(nargs);
g_lingo->push(g_lingo->_state->me);
}
// Returns the name of the XObj
void CDROMXObj::m_name(int nargs) {
g_lingo->push(Datum("AppleAudioCD"));
}
void CDROMXObj::m_play(int nargs) {
CDROMXObject *me = static_cast<CDROMXObject *>(g_lingo->_state->me.u.obj);
// This is a request to play the current track from the start,
// which we can't do if there's no track information.
if (me->_cdda_status.track == 0)
return;
g_director->_system->getAudioCDManager()->play(me->_cdda_status.track, -1, 0, 0);
me->_cdda_status = g_director->_system->getAudioCDManager()->getStatus();
}
void CDROMXObj::m_playTrack(int nargs) {
CDROMXObject *me = static_cast<CDROMXObject *>(g_lingo->_state->me.u.obj);
int track = g_lingo->pop().asInt();
g_director->_system->getAudioCDManager()->play(track - 1, -1, 0, 0);
me->_cdda_status = g_director->_system->getAudioCDManager()->getStatus();
}
// Name format is "TRACK NN", with one-digit tracks padded with a leading space
void CDROMXObj::m_playName(int nargs) {
CDROMXObject *me = static_cast<CDROMXObject *>(g_lingo->_state->me.u.obj);
Common::String track = g_lingo->pop().asString();
if (track.size() < 8) {
warning("CDROMXObj::m_playName: specified name has an invalid format (provided string was %s)", track.c_str());
return;
}
Common::String trackNum = track.substr(6, 2);
// Remove the leading string as needed
if (trackNum.substr(0, 1) == " ")
trackNum = trackNum.substr(1, 1);
int trackNumI = atoi(trackNum.c_str());
if (trackNumI < 1) {
warning("CDROMXObj::m_playName: track number failed to parse (provided string was %s)", track.c_str());
}
g_director->_system->getAudioCDManager()->play(trackNumI - 1, -1, 0, 0);
me->_cdda_status = g_director->_system->getAudioCDManager()->getStatus();
}
void CDROMXObj::m_playAbsTime(int nargs) {
CDROMXObject *me = static_cast<CDROMXObject *>(g_lingo->_state->me.u.obj);
Datum min = g_lingo->pop();
Datum sec = g_lingo->pop();
Datum frac = g_lingo->pop();
int startFrame = (min.asInt() * 60 * 75) + (sec.asInt() * 75) + frac.asInt();
debug(5, "CDROMXObj::m_playAbsTime: playing at frame %i", startFrame);
g_director->_system->getAudioCDManager()->playAbsolute(startFrame, -1, 0);
me->_cdda_status = g_director->_system->getAudioCDManager()->getStatus();
g_lingo->push(Datum());
}
void CDROMXObj::m_playSegment(int nargs) {
Datum startMin = g_lingo->pop();
Datum startSec = g_lingo->pop();
Datum startFrac = g_lingo->pop();
Datum endMin = g_lingo->pop();
Datum endSec = g_lingo->pop();
Datum endFrac = g_lingo->pop();
// Can't implement this without implementing a full CD TOC, since
// it doesn't interact with songs at the "track" level.
debug(5, "STUB: CDROMXObj::m_playSegment Request to play starting at %i:%i.%i and ending at %i:%i.%i", startMin.asInt(), startSec.asInt(), startFrac.asInt(), endMin.asInt(), endSec.asInt(), endFrac.asInt());
g_lingo->push(Datum());
}
XOBJSTUBV(CDROMXObj::m_askPlay)
void CDROMXObj::m_stepFwd(int nargs) {
CDROMXObject *me = static_cast<CDROMXObject *>(g_lingo->_state->me.u.obj);
g_director->_system->getAudioCDManager()->play(me->_cdda_status.track + 1, -1, 0, 0);
me->_cdda_status = g_director->_system->getAudioCDManager()->getStatus();
}
void CDROMXObj::m_stepBwd(int nargs) {
CDROMXObject *me = static_cast<CDROMXObject *>(g_lingo->_state->me.u.obj);
int track = me->_cdda_status.track - 1;
if (track < 1)
track = 1;
g_director->_system->getAudioCDManager()->play(track, -1, 0, 0);
me->_cdda_status = g_director->_system->getAudioCDManager()->getStatus();
}
void CDROMXObj::m_pause(int nargs) {
CDROMXObject *me = static_cast<CDROMXObject *>(g_lingo->_state->me.u.obj);
// Leaves a trace of the current position so we can resume from it
me->_cdda_status = g_director->_system->getAudioCDManager()->getStatus();
me->_cdda_status.playing = false;
g_director->_system->getAudioCDManager()->stop();
}
void CDROMXObj::m_continue(int nargs) {
CDROMXObject *me = static_cast<CDROMXObject *>(g_lingo->_state->me.u.obj);
// Can only resume if there's data to resume from
if (me->_cdda_status.track == 0)
return;
g_director->_system->getAudioCDManager()->play(me->_cdda_status.track, -1, me->_cdda_status.start, 0);
me->_cdda_status = g_director->_system->getAudioCDManager()->getStatus();
}
void CDROMXObj::m_stop(int nargs) {
CDROMXObject *me = static_cast<CDROMXObject *>(g_lingo->_state->me.u.obj);
g_director->_system->getAudioCDManager()->stop();
me->_cdda_status = g_director->_system->getAudioCDManager()->getStatus();
}
void CDROMXObj::m_stopTrack(int nargs) {
CDROMXObject *me = static_cast<CDROMXObject *>(g_lingo->_state->me.u.obj);
Datum track = g_lingo->pop();
AudioCDManager::Status status = g_director->_system->getAudioCDManager()->getStatus();
if (!status.playing)
return;
// stopTrack isn't "stop now", but "stop after this track".
// This play command ensures we continue from here and end with this
// track, regardless of previous commands.
g_director->_system->getAudioCDManager()->play(status.track, 1, status.start, status.start + status.duration);
me->_cdda_status = g_director->_system->getAudioCDManager()->getStatus();
}
void CDROMXObj::m_stopAbsTime(int nargs) {
Datum min = g_lingo->pop();
Datum sec = g_lingo->pop();
Datum frac = g_lingo->pop();
// Can't implement this without implementing a full CD TOC, since
// it doesn't interact with songs at the "track" level.
debug(5, "STUB: CDROMXObj::m_stopAbsTime Request to play starting at %i:%i.%i", min.asInt(), sec.asInt(), frac.asInt());
g_lingo->dropStack(nargs);
g_lingo->push(Datum());
}
void CDROMXObj::m_removeStop(int nargs) {
CDROMXObject *me = static_cast<CDROMXObject *>(g_lingo->_state->me.u.obj);
Datum track = g_lingo->pop();
AudioCDManager::Status status = g_director->_system->getAudioCDManager()->getStatus();
if (!status.playing)
return;
g_director->_system->getAudioCDManager()->play(status.track, -1, status.start, status.start + status.duration);
me->_cdda_status = g_director->_system->getAudioCDManager()->getStatus();
}
void CDROMXObj::m_eject(int nargs) {
warning("If you had had a CD drive, it would have ejected just now.");
}
// Valid strings are:
// "Audio play in progress"
// "Audio pause in operation"
// "Audio muting on"
// "Audio play operation completed"
// "Error occurred during audio play"
// "Not currently playing"
void CDROMXObj::m_status(int nargs) {
// A fuller implementation could also track data to return the
// "pause" and "completed" states.
if (g_director->_system->getAudioCDManager()->isPlaying())
g_lingo->push(Datum("Audio play in progress"));
else
g_lingo->push(Datum("Not currently playing"));
}
// Valid strings are:
// "Muting on (no audio)"
// "Right channel through right channel only"
// "Left channel through right channel only"
// "Left and right channels through right channel only"
// "Right channel through left channel only"
// "Right channel through left and right channel"
// "Right channel through left channel"
// "Left channel through right channel"
// "Right channel through left channel"
// "Left and right channels through right channel"
// "Left channel through left channel only"
// "Left channel through left channel"
// "Right channel through right channel (Stereo)"
// "Left channel through left and right channel"
// "Left channel through left channel"
// "Left and right channels through right channel"
// "Left and right channels through left channel only"
// "Left and right channels through left channel"
// "Left and right channels through left channel"
// "Right channel through right channel"
// "Left and right channels through left channel"
// "Left channel through right channel"
// "Left and right channels through"
// "both left channel and right channel (Mono)"
void CDROMXObj::m_playMode(int nargs) {
// For now, nothing to change modes is implemented, so just return
// a default
g_lingo->push(Datum("Right channel through right channel (Stereo)"));
}
// Valid strings are:
// "audio channels without preemphasis"
// "audio channels with preemphasis"
void CDROMXObj::m_currentFormat(int nargs) {
// Preemphasis not implemented, so just return this
g_lingo->push(Datum("audio channels without preemphasis"));
}
void CDROMXObj::m_currentTrack(int nargs) {
CDROMXObject *me = static_cast<CDROMXObject *>(g_lingo->_state->me.u.obj);
g_lingo->push(Datum(me->_cdda_status.track));
}
XOBJSTUBV(CDROMXObj::m_currentTime)
// The next few methods depend on full TOC implementation, so they
// can't be implemented right now.
XOBJSTUBV(CDROMXObj::m_firstTrack)
XOBJSTUBV(CDROMXObj::m_lastTrack)
XOBJSTUBV(CDROMXObj::m_totalTime)
// The scan methods depend on absolute timing, so they also require
// a full TOC.
XOBJSTUBV(CDROMXObj::m_scanFwd)
XOBJSTUBV(CDROMXObj::m_scanBwd)
XOBJSTUBV(CDROMXObj::m_stopScan)
} // End of namespace Director

View File

@@ -0,0 +1,76 @@
/* 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_CDROMXOBJ_H
#define DIRECTOR_LINGO_XLIBS_CDROMXOBJ_H
#include "backends/audiocd/audiocd.h"
namespace Director {
class CDROMXObject : public Object<CDROMXObject> {
public:
CDROMXObject(ObjectType objType);
AudioCDManager::Status _cdda_status;
};
namespace CDROMXObj {
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_name(int nargs);
void m_play(int nargs);
void m_playTrack(int nargs);
void m_playName(int nargs);
void m_playAbsTime(int nargs);
void m_playSegment(int nargs);
void m_askPlay(int nargs);
void m_stepFwd(int nargs);
void m_stepBwd(int nargs);
void m_pause(int nargs);
void m_continue(int nargs);
void m_stop(int nargs);
void m_stopTrack(int nargs);
void m_stopAbsTime(int nargs);
void m_removeStop(int nargs);
void m_eject(int nargs);
void m_status(int nargs);
void m_playMode(int nargs);
void m_currentFormat(int nargs);
void m_currentTrack(int nargs);
void m_currentTime(int nargs);
void m_firstTrack(int nargs);
void m_lastTrack(int nargs);
void m_totalTime(int nargs);
void m_scanFwd(int nargs);
void m_scanBwd(int nargs);
void m_stopScan(int nargs);
} // End of namespace CDROMXObj
} // End of namespace Director
#endif

View File

@@ -0,0 +1,60 @@
/* 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/c/closebleedwindowxcmd.h"
/**************************************************
*
* USED IN:
* the7colors
*
**************************************************/
namespace Director {
const char *const CloseBleedWindowXCMD::xlibName = "CloseBleedWindow";
const XlibFileDesc CloseBleedWindowXCMD::fileNames[] = {
{ "CloseBleedWindow", nullptr },
{ nullptr, nullptr },
};
static const BuiltinProto builtins[] = {
{ "CloseBleedWindow", CloseBleedWindowXCMD::m_CloseBleedWindow, -1, 0, 300, CBLTIN },
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
};
void CloseBleedWindowXCMD::open(ObjectType type, const Common::Path &path) {
g_lingo->initBuiltIns(builtins);
}
void CloseBleedWindowXCMD::close(ObjectType type) {
g_lingo->cleanupBuiltIns(builtins);
}
XOBJSTUB(CloseBleedWindowXCMD::m_CloseBleedWindow, 0)
}

View 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_CLOSEBLEEDWINDOWXCMD_H
#define DIRECTOR_LINGO_XLIBS_CLOSEBLEEDWINDOWXCMD_H
namespace Director {
namespace CloseBleedWindowXCMD {
extern const char *const xlibName;
extern const XlibFileDesc fileNames[];
void open(ObjectType type, const Common::Path &path);
void close(ObjectType type);
void m_CloseBleedWindow(int nargs);
} // End of namespace CloseBleedWindowXCMD
} // End of namespace Director
#endif

View File

@@ -0,0 +1,90 @@
/* 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/c/colorcursorxobj.h"
/**************************************************
*
* USED IN:
* Jewels of the Oracle - Mac
*
**************************************************/
/*
-- ColorCursor, and X-Object for using color cursor resources
-- by Chris Perkins 1993. (CPerkins@aol.com)
I mNew
XI mGetSetCursor, crsrID -- crsrID is the resource ID number of a 'crsr' type resource
X mReleaseCursor -- CALL THIS BEFORE DISPOSING OBJECT or using the lingo <cursor> routine
*/
namespace Director {
const char *const ColorCursorXObj::xlibName = "colorcursorxobj";
const XlibFileDesc ColorCursorXObj::fileNames[] = {
{ "CCURSOR.XOB", nullptr },
{ nullptr, nullptr },
};
static const MethodProto xlibMethods[] = {
{ "new", ColorCursorXObj::m_new, 0, 0, 400 },
{ "dispose", ColorCursorXObj::m_dispose, 0, 0, 400 },
{ "getsetcursor", ColorCursorXObj::m_getSetCursor, 1, 1, 400 },
{ "releasecursor", ColorCursorXObj::m_releaseCursor, 0, 0, 400 },
{ nullptr, nullptr, 0, 0, 0 }
};
ColorCursorXObject::ColorCursorXObject(ObjectType ObjectType) :Object<ColorCursorXObject>("ColorCursorXObj") {
_objType = ObjectType;
}
void ColorCursorXObj::open(ObjectType type, const Common::Path &path) {
if (type == kXObj) {
ColorCursorXObject::initMethods(xlibMethods);
ColorCursorXObject *xobj = new ColorCursorXObject(kXObj);
g_lingo->exposeXObject(xlibName, xobj);
}
}
void ColorCursorXObj::close(ObjectType type) {
if (type == kXObj) {
ColorCursorXObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
}
void ColorCursorXObj::m_new(int nargs) {
g_lingo->printSTUBWithArglist("ColorCursorXObj::m_new", nargs);
g_lingo->dropStack(nargs);
g_lingo->push(g_lingo->_state->me);
}
XOBJSTUBNR(ColorCursorXObj::m_dispose)
XOBJSTUBNR(ColorCursorXObj::m_getSetCursor)
XOBJSTUBNR(ColorCursorXObj::m_releaseCursor)
}

View File

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

View 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/>.
*
*/
/**********************************************
*
* USED IN:
* Star Trek TNG Episode Guide
*
**********************************************/
/*
* -- Color External Factory. 16Feb93 PTM
* Color
* I mNew --Creates a new instance of the XObject
* X mDispose --Disposes of XObject instance
* X mSetOurColors --Set Trek-happy colors
* X mRestoreColors --Restore real windows colors
* S mName --Returns the XObject name (Widget)
* I mStatus --Returns an integer status code
* SI mError, code --Returns an error string
* S mLastError --Returns last error string
* III mAdd, arg1, arg2 --Returns arg1+arg2
* SSI mFirst, str, nchars --Return the first nchars of string str
* V mMul, f1, f2 --Returns f1*f2 as floating point
* X mGlobals --Sample code to Read & Modify globals
* X mSymbols --Sample code to work with Symbols
* X mSendPerform --Sample code to show SendPerform call
* X mFactory --Sample code to find Factory objects
* II mGetSysColor, attrib -- gets rgb attrib as a long
* III mSetSysColor, attrib, rgbVal -- sets r,g,b as a long
* IIIII mSetSysColorRGB, attrib, r, g, b -- sets r,g,b as a 3 longs
* III mSetSysColorIndex, attrib, nIndex -- sets nth palette entry
*/
#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/c/colorxobj.h"
namespace Director {
const char *const ColorXObj::xlibName = "Color";
const XlibFileDesc ColorXObj::fileNames[] = {
{ "color", nullptr },
{ nullptr, nullptr },
};
static const MethodProto xlibMethods[] = {
{ "new", ColorXObj::m_new, 1, 1, 400 }, // D4
{ "dispose", ColorXObj::m_dispose, 0, 0, 400 }, // D4
{ "setOurColors", ColorXObj::m_setOurColors, 0, 0, 400 }, // D4
{ "restoreColors", ColorXObj::m_restoreColors, 0, 0, 400 }, // D4
{ "getSysColor", ColorXObj::m_getSysColor, 1, 1, 400 }, // D4
{ "setSysColor", ColorXObj::m_setSysColor, 2, 2, 400 }, // D4
{ "setSysColorRGB", ColorXObj::m_setSysColorRGB, 4, 4, 400 }, // D4
{ "setSysColorIndex", ColorXObj::m_setSysColorIndex, 2, 2, 400 }, // D4
{ nullptr, nullptr, 0, 0, 0 }
};
ColorXObject::ColorXObject(ObjectType ObjectType) :Object<ColorXObject>("Color") {
_objType = ObjectType;
}
void ColorXObj::open(ObjectType type, const Common::Path &path) {
if (type == kXObj) {
ColorXObject::initMethods(xlibMethods);
ColorXObject *xobj = new ColorXObject(kXObj);
g_lingo->exposeXObject(xlibName, xobj);
}
}
void ColorXObj::close(ObjectType type) {
if (type == kXObj) {
ColorXObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
}
void ColorXObj::m_new(int nargs) {
g_lingo->printSTUBWithArglist("ColorXObj::m_new", nargs);
g_lingo->dropStack(nargs);
g_lingo->push(g_lingo->_state->me);
}
XOBJSTUB(ColorXObj::m_dispose, 0)
XOBJSTUBNR(ColorXObj::m_setOurColors)
XOBJSTUBNR(ColorXObj::m_restoreColors)
XOBJSTUB(ColorXObj::m_getSysColor, 0)
XOBJSTUB(ColorXObj::m_setSysColor, 0)
XOBJSTUB(ColorXObj::m_setSysColorRGB, 0)
XOBJSTUB(ColorXObj::m_setSysColorIndex, 0)
} // End of namespace Director

View File

@@ -0,0 +1,53 @@
/* 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_COLORXOBJ_H
#define DIRECTOR_LINGO_XLIBS_COLORXOBJ_H
namespace Director {
namespace ColorXObj {
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_setOurColors(int nargs);
void m_restoreColors(int nargs);
void m_getSysColor(int nargs);
void m_setSysColor(int nargs);
void m_setSysColorRGB(int nargs);
void m_setSysColorIndex(int nargs);
} // End of namespace ColorXObj
class ColorXObject : public Object<ColorXObject> {
public:
ColorXObject(ObjectType objType);
};
} // End of namespace Director
#endif

View File

@@ -0,0 +1,122 @@
/* 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/c/consumer.h"
/*
* Used in: Bob Winkle Solves Life's Greatest Mysteries
*
-- Consumer dialog xobject. 02Aug95 JA
Consumer
I mNew --Creates a new instance of the XObject
X mDispose --Disposes of XObject instance
S mName --Returns the XObject name (Consumer)
SII mSettingsDlg --Shows the settings dialog and returns results
ISIS mPopHotword --Pops up a hot word window
SSSSS mExplore --Shows the Eplore dialog
SSSS mPrefSetValue --Set a preference file entry
SSS mPrefGetValue --Get a preference file entry
SSSSSS mContentLock --Shows the content lock dialog
SSI mGetRecord --Retrieves a data file record
SSS mGetWinIniEntry --Retrieves an entry from the WIN.INI
I mAboutDlg --Displays the About Box
IS mRegisterDlg --Displays the Registration Dialog
I mLockedDlg --Displays the Term Locked Dialog
II mCheckCD --Checks for the presence of the CD
I mHackMenu --Hack to destroy menu
*/
namespace Director {
const char *const ConsumerXObj::xlibName = "Consumer";
const XlibFileDesc ConsumerXObj::fileNames[] = {
{ "consumer", nullptr },
{ nullptr, nullptr },
};
static const MethodProto xlibMethods[] = {
{ "new", ConsumerXObj::m_new, 0, 0, 400 }, // D4
{ "dispose", ConsumerXObj::m_dispose, 0, 0, 400 }, // D4
{ "name", ConsumerXObj::m_name, 0, 0, 400 }, // D4
{ "settingsDlg", ConsumerXObj::m_settingsDlg, 2, 2, 400 }, // D4
{ "popHotword", ConsumerXObj::m_popHotword, 3, 3, 400 }, // D4
{ "explore", ConsumerXObj::m_explore, 4, 4, 400 }, // D4
{ "prefSetValue", ConsumerXObj::m_prefSetValue, 3, 3, 400 }, // D4
{ "prefGetValue", ConsumerXObj::m_prefGetValue, 2, 2, 400 }, // D4
{ "contentLock", ConsumerXObj::m_contentLock, 5, 5, 400 }, // D4
{ "getRecord", ConsumerXObj::m_getRecord, 2, 2, 400 }, // D4
{ "getWinIniEntry", ConsumerXObj::m_getWinIniEntry, 2, 2, 400 }, // D4
{ "aboutDlg", ConsumerXObj::m_aboutDlg, 0, 0, 400 }, // D4
{ "registerDlg", ConsumerXObj::m_registerDlg, 1, 1, 400 }, // D4
{ "lockedDlg", ConsumerXObj::m_lockedDlg, 0, 0, 400 }, // D4
{ "checkCD", ConsumerXObj::m_checkCD, 1, 1, 400 }, // D4
{ "hackMenu", ConsumerXObj::m_hackMenu, 0, 0, 400 }, // D4
{ nullptr, nullptr, 0, 0, 0 }
};
ConsumerXObject::ConsumerXObject(ObjectType ObjectType) :Object<ConsumerXObject>("Consumer") {
_objType = ObjectType;
}
void ConsumerXObj::open(ObjectType type, const Common::Path &path) {
if (type == kXObj) {
ConsumerXObject::initMethods(xlibMethods);
ConsumerXObject *xobj = new ConsumerXObject(kXObj);
g_lingo->exposeXObject(xlibName, xobj);
}
}
void ConsumerXObj::close(ObjectType type) {
if (type == kXObj) {
ConsumerXObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
}
void ConsumerXObj::m_new(int nargs) {
g_lingo->printSTUBWithArglist("ConsumerXObj::m_new", nargs);
g_lingo->dropStack(nargs);
g_lingo->push(g_lingo->_state->me);
}
XOBJSTUBNR(ConsumerXObj::m_dispose)
XOBJSTUB(ConsumerXObj::m_name, "Consumer")
XOBJSTUB(ConsumerXObj::m_settingsDlg, "")
XOBJSTUB(ConsumerXObj::m_popHotword, 0)
XOBJSTUB(ConsumerXObj::m_explore, "")
XOBJSTUB(ConsumerXObj::m_prefSetValue, "")
XOBJSTUB(ConsumerXObj::m_prefGetValue, "")
XOBJSTUB(ConsumerXObj::m_contentLock, "")
XOBJSTUB(ConsumerXObj::m_getRecord, "0,0,0") // used to bypass the locked question check
XOBJSTUB(ConsumerXObj::m_getWinIniEntry, "")
XOBJSTUB(ConsumerXObj::m_aboutDlg, 0)
XOBJSTUB(ConsumerXObj::m_registerDlg, 0)
XOBJSTUB(ConsumerXObj::m_lockedDlg, 0)
XOBJSTUB(ConsumerXObj::m_checkCD, 1)
XOBJSTUB(ConsumerXObj::m_hackMenu, 0)
}

View File

@@ -0,0 +1,61 @@
/* 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_CONSUMER_H
#define DIRECTOR_LINGO_XLIBS_CONSUMER_H
namespace Director {
class ConsumerXObject : public Object<ConsumerXObject> {
public:
ConsumerXObject(ObjectType objType);
};
namespace ConsumerXObj {
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_settingsDlg(int nargs);
void m_popHotword(int nargs);
void m_explore(int nargs);
void m_prefSetValue(int nargs);
void m_prefGetValue(int nargs);
void m_contentLock(int nargs);
void m_getRecord(int nargs);
void m_getWinIniEntry(int nargs);
void m_aboutDlg(int nargs);
void m_registerDlg(int nargs);
void m_lockedDlg(int nargs);
void m_checkCD(int nargs);
void m_hackMenu(int nargs);
} // End of namespace ConsumerXObj
} // End of namespace Director
#endif

View File

@@ -0,0 +1,88 @@
/* 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/c/cursorxobj.h"
/**************************************************
*
* USED IN:
* Jewels of the Oracle - Win
*
**************************************************/
/*
-- Cursor External Factory. 16/03/95 - AAF - Changed to play concatenated movies
Cursor
I mNew --Creates a new instance of the XObject
X mDispose --Disposes of XObject instance
XSS mSetCursor, cursorName, windowName --Sets the window cursor
*/
namespace Director {
const char *const CursorXObj::xlibName = "Cursor";
const XlibFileDesc CursorXObj::fileNames[] = {
{ "CURSOR", nullptr },
{ nullptr, nullptr },
};
static const MethodProto xlibMethods[] = {
{ "new", CursorXObj::m_new, 0, 0, 400 },
{ "dispose", CursorXObj::m_dispose, 0, 0, 400 },
{ "setCursor", CursorXObj::m_setCursor, 2, 2, 400 },
{ nullptr, nullptr, 0, 0, 0 }
};
CursorXObject::CursorXObject(ObjectType ObjectType) :Object<CursorXObject>("Cursor") {
_objType = ObjectType;
}
void CursorXObj::open(ObjectType type, const Common::Path &path) {
if (type == kXObj) {
CursorXObject::initMethods(xlibMethods);
CursorXObject *xobj = new CursorXObject(kXObj);
g_lingo->exposeXObject(xlibName, xobj);
}
}
void CursorXObj::close(ObjectType type) {
if (type == kXObj) {
CursorXObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
}
void CursorXObj::m_new(int nargs) {
g_lingo->printSTUBWithArglist("CursorXObj::m_new", nargs);
g_lingo->dropStack(nargs);
g_lingo->push(g_lingo->_state->me);
}
XOBJSTUBNR(CursorXObj::m_dispose)
XOBJSTUBNR(CursorXObj::m_setCursor)
}

View 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_CURSORXOBJ_H
#define DIRECTOR_LINGO_XLIBS_CURSORXOBJ_H
namespace Director {
class CursorXObject : public Object<CursorXObject> {
public:
CursorXObject(ObjectType objType);
};
namespace CursorXObj {
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_setCursor(int nargs);
} // End of namespace CursorXObj
} // End of namespace Director
#endif