Initial commit
This commit is contained in:
199
engines/director/lingo/xtras/a/audio.cpp
Normal file
199
engines/director/lingo/xtras/a/audio.cpp
Normal file
@@ -0,0 +1,199 @@
|
||||
/* 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/xtras/a/audio.h"
|
||||
|
||||
/**************************************************
|
||||
*
|
||||
* USED IN:
|
||||
* [insert game here]
|
||||
*
|
||||
**************************************************/
|
||||
|
||||
/*
|
||||
-- xtra audio
|
||||
--
|
||||
-- Audio Xtra
|
||||
-- Published by updateStage
|
||||
--
|
||||
-- Sales: sales@updatestage.com, (781) 641-6043
|
||||
-- Technical support: support@updatestage.com, (781) 641-6043
|
||||
-- Web: http://www.updatestage.com
|
||||
-- Written by Scott Kildall, Red Eye Software
|
||||
--Copyright 1996-1998, Red Eye Software
|
||||
|
||||
new object me, integer bufferSize
|
||||
forget object me
|
||||
|
||||
+ Register object xtraRef, string serialNumber -- Registers the Sound Xtra. THIS MUST BE CALLED FOR YOUR RUNTIME (PROJECTOR) FILES
|
||||
GetError object me -- returns the last error number
|
||||
GetInfo object me, integer identifier -- returns specific information
|
||||
SetInfo object me, integer identifier, integer setting -- sets specific information
|
||||
Status object me -- returns the status of a sound
|
||||
ConnectInputDevice object me -- connects to the sound recorder
|
||||
DisconnectInputDevice object me -- disconnects from the sound recorder
|
||||
SetSoundType object me, string type, string name, string action -- specifies a file for sound recording or playback
|
||||
ClearSoundType object me -- clears information about the sound file
|
||||
Play object me -- plays a sound
|
||||
Record object me -- records a sound
|
||||
Stop object me -- stops a sound
|
||||
Pause object me -- pauses a sound
|
||||
Resume object me -- resumes a paused sound
|
||||
GetCurrentTime object me -- returns the playback time of a sound
|
||||
IsASound object me, string type, string name -- indicates if this sound exists
|
||||
DeleteSound object me, string type, string name -- deletes a sound
|
||||
SetPlaySegment object me, int start, int end -- sets the start and end points of a playback sound
|
||||
ClearPlaySegment object me -- resets the start and end points
|
||||
SetSampleRate object me, integer rate -- sets the sample rate of a sound
|
||||
SetSampleDepth object me, integer depth -- sets the sample depth of a sound
|
||||
SetCompression object me, integer compressor -- sets a compressor for the sound
|
||||
GetInputLevel object me -- returns the input level of the microphone
|
||||
FreeRecordingTime object me -- returns the free recording time
|
||||
|
||||
-- Wave-plotting functions
|
||||
SetForegroundColor object me, integer red, integer green, integer blue -- sets the foreground color for wave-plotting
|
||||
SetBackgroundColor object me, integer red, integer green, integer blue -- sets the background color for wave-plotting
|
||||
PlotWaveform object me, member bitmapCastMember, integer width, integer height, integer dotsPerX, integer timebase, integer normalize -- generates a waveform
|
||||
--
|
||||
|
||||
*/
|
||||
|
||||
namespace Director {
|
||||
|
||||
const char *AudioXtra::xlibName = "Audio";
|
||||
const XlibFileDesc AudioXtra::fileNames[] = {
|
||||
{ "audio", nullptr },
|
||||
{ "Resaudio", nullptr },
|
||||
{ nullptr, nullptr },
|
||||
};
|
||||
|
||||
static MethodProto xlibMethods[] = {
|
||||
{ "new", AudioXtra::m_new, 1, 1, 500 },
|
||||
{ "forget", AudioXtra::m_forget, 0, 0, 500 },
|
||||
{ "GetError", AudioXtra::m_GetError, 0, 0, 500 },
|
||||
{ "GetInfo", AudioXtra::m_GetInfo, 1, 1, 500 },
|
||||
{ "SetInfo", AudioXtra::m_SetInfo, 2, 2, 500 },
|
||||
{ "Status", AudioXtra::m_Status, 0, 0, 500 },
|
||||
{ "ConnectInputDevice", AudioXtra::m_ConnectInputDevice, 0, 0, 500 },
|
||||
{ "DisconnectInputDevice", AudioXtra::m_DisconnectInputDevice, 0, 0, 500 },
|
||||
{ "SetSoundType", AudioXtra::m_SetSoundType, 3, 3, 500 },
|
||||
{ "ClearSoundType", AudioXtra::m_ClearSoundType, 0, 0, 500 },
|
||||
{ "Play", AudioXtra::m_Play, 0, 0, 500 },
|
||||
{ "Record", AudioXtra::m_Record, 0, 0, 500 },
|
||||
{ "Stop", AudioXtra::m_Stop, 0, 0, 500 },
|
||||
{ "Pause", AudioXtra::m_Pause, 0, 0, 500 },
|
||||
{ "Resume", AudioXtra::m_Resume, 0, 0, 500 },
|
||||
{ "GetCurrentTime", AudioXtra::m_GetCurrentTime, 0, 0, 500 },
|
||||
{ "IsASound", AudioXtra::m_IsASound, 2, 2, 500 },
|
||||
{ "DeleteSound", AudioXtra::m_DeleteSound, 2, 2, 500 },
|
||||
{ "SetPlaySegment", AudioXtra::m_SetPlaySegment, 2, 2, 500 },
|
||||
{ "ClearPlaySegment", AudioXtra::m_ClearPlaySegment, 0, 0, 500 },
|
||||
{ "SetSampleRate", AudioXtra::m_SetSampleRate, 1, 1, 500 },
|
||||
{ "SetSampleDepth", AudioXtra::m_SetSampleDepth, 1, 1, 500 },
|
||||
{ "SetCompression", AudioXtra::m_SetCompression, 1, 1, 500 },
|
||||
{ "GetInputLevel", AudioXtra::m_GetInputLevel, 0, 0, 500 },
|
||||
{ "FreeRecordingTime", AudioXtra::m_FreeRecordingTime, 0, 0, 500 },
|
||||
{ "SetForegroundColor", AudioXtra::m_SetForegroundColor, 3, 3, 500 },
|
||||
{ "SetBackgroundColor", AudioXtra::m_SetBackgroundColor, 3, 3, 500 },
|
||||
{ "PlotWaveform", AudioXtra::m_PlotWaveform, 6, 6, 500 },
|
||||
{ "Register", AudioXtra::m_Register, 1, 1, 500 },
|
||||
{ nullptr, nullptr, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static BuiltinProto xlibBuiltins[] = {
|
||||
|
||||
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
|
||||
};
|
||||
|
||||
AudioXtraObject::AudioXtraObject(ObjectType ObjectType) :Object<AudioXtraObject>("Audio") {
|
||||
_objType = ObjectType;
|
||||
}
|
||||
|
||||
bool AudioXtraObject::hasProp(const Common::String &propName) {
|
||||
return (propName == "name");
|
||||
}
|
||||
|
||||
Datum AudioXtraObject::getProp(const Common::String &propName) {
|
||||
if (propName == "name")
|
||||
return Datum(AudioXtra::xlibName);
|
||||
warning("AudioXtra::getProp: unknown property '%s'", propName.c_str());
|
||||
return Datum();
|
||||
}
|
||||
|
||||
void AudioXtra::open(ObjectType type, const Common::Path &path) {
|
||||
AudioXtraObject::initMethods(xlibMethods);
|
||||
AudioXtraObject *xobj = new AudioXtraObject(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 AudioXtra::close(ObjectType type) {
|
||||
AudioXtraObject::cleanupMethods();
|
||||
g_lingo->_globalvars[xlibName] = Datum();
|
||||
|
||||
}
|
||||
|
||||
void AudioXtra::m_new(int nargs) {
|
||||
g_lingo->printSTUBWithArglist("AudioXtra::m_new", nargs);
|
||||
g_lingo->dropStack(nargs);
|
||||
g_lingo->push(g_lingo->_state->me);
|
||||
}
|
||||
|
||||
XOBJSTUB(AudioXtra::m_forget, 0)
|
||||
XOBJSTUB(AudioXtra::m_Register, 0)
|
||||
XOBJSTUB(AudioXtra::m_GetError, 0)
|
||||
XOBJSTUB(AudioXtra::m_GetInfo, 0)
|
||||
XOBJSTUB(AudioXtra::m_SetInfo, 0)
|
||||
XOBJSTUB(AudioXtra::m_Status, 0)
|
||||
XOBJSTUB(AudioXtra::m_ConnectInputDevice, 0)
|
||||
XOBJSTUB(AudioXtra::m_DisconnectInputDevice, 0)
|
||||
XOBJSTUB(AudioXtra::m_SetSoundType, 0)
|
||||
XOBJSTUB(AudioXtra::m_ClearSoundType, 0)
|
||||
XOBJSTUB(AudioXtra::m_Play, 0)
|
||||
XOBJSTUB(AudioXtra::m_Record, 0)
|
||||
XOBJSTUB(AudioXtra::m_Stop, 0)
|
||||
XOBJSTUB(AudioXtra::m_Pause, 0)
|
||||
XOBJSTUB(AudioXtra::m_Resume, 0)
|
||||
XOBJSTUB(AudioXtra::m_GetCurrentTime, 0)
|
||||
XOBJSTUB(AudioXtra::m_IsASound, 0)
|
||||
XOBJSTUB(AudioXtra::m_DeleteSound, 0)
|
||||
XOBJSTUB(AudioXtra::m_SetPlaySegment, 0)
|
||||
XOBJSTUB(AudioXtra::m_ClearPlaySegment, 0)
|
||||
XOBJSTUB(AudioXtra::m_SetSampleRate, 0)
|
||||
XOBJSTUB(AudioXtra::m_SetSampleDepth, 0)
|
||||
XOBJSTUB(AudioXtra::m_SetCompression, 0)
|
||||
XOBJSTUB(AudioXtra::m_GetInputLevel, 0)
|
||||
XOBJSTUB(AudioXtra::m_FreeRecordingTime, 0)
|
||||
XOBJSTUB(AudioXtra::m_SetForegroundColor, 0)
|
||||
XOBJSTUB(AudioXtra::m_SetBackgroundColor, 0)
|
||||
XOBJSTUB(AudioXtra::m_PlotWaveform, 0)
|
||||
|
||||
}
|
||||
77
engines/director/lingo/xtras/a/audio.h
Normal file
77
engines/director/lingo/xtras/a/audio.h
Normal file
@@ -0,0 +1,77 @@
|
||||
/* 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_XTRAS_A_AUDIO_H
|
||||
#define DIRECTOR_LINGO_XTRAS_A_AUDIO_H
|
||||
|
||||
namespace Director {
|
||||
|
||||
class AudioXtraObject : public Object<AudioXtraObject> {
|
||||
public:
|
||||
AudioXtraObject(ObjectType objType);
|
||||
|
||||
bool hasProp(const Common::String &propName) override;
|
||||
Datum getProp(const Common::String &propName) override;
|
||||
};
|
||||
|
||||
namespace AudioXtra {
|
||||
|
||||
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_forget(int nargs);
|
||||
void m_Register(int nargs);
|
||||
void m_GetError(int nargs);
|
||||
void m_GetInfo(int nargs);
|
||||
void m_SetInfo(int nargs);
|
||||
void m_Status(int nargs);
|
||||
void m_ConnectInputDevice(int nargs);
|
||||
void m_DisconnectInputDevice(int nargs);
|
||||
void m_SetSoundType(int nargs);
|
||||
void m_ClearSoundType(int nargs);
|
||||
void m_Play(int nargs);
|
||||
void m_Record(int nargs);
|
||||
void m_Stop(int nargs);
|
||||
void m_Pause(int nargs);
|
||||
void m_Resume(int nargs);
|
||||
void m_GetCurrentTime(int nargs);
|
||||
void m_IsASound(int nargs);
|
||||
void m_DeleteSound(int nargs);
|
||||
void m_SetPlaySegment(int nargs);
|
||||
void m_ClearPlaySegment(int nargs);
|
||||
void m_SetSampleRate(int nargs);
|
||||
void m_SetSampleDepth(int nargs);
|
||||
void m_SetCompression(int nargs);
|
||||
void m_GetInputLevel(int nargs);
|
||||
void m_FreeRecordingTime(int nargs);
|
||||
void m_SetForegroundColor(int nargs);
|
||||
void m_SetBackgroundColor(int nargs);
|
||||
void m_PlotWaveform(int nargs);
|
||||
|
||||
} // End of namespace AudioXtra
|
||||
|
||||
} // End of namespace Director
|
||||
|
||||
#endif
|
||||
503
engines/director/lingo/xtras/b/budapi.cpp
Normal file
503
engines/director/lingo/xtras/b/budapi.cpp
Normal file
@@ -0,0 +1,503 @@
|
||||
/* 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/xtras/b/budapi.h"
|
||||
|
||||
/**************************************************
|
||||
*
|
||||
* USED IN:
|
||||
* I Spy Spooky Mansion
|
||||
*
|
||||
**************************************************/
|
||||
|
||||
/*
|
||||
-- xtra BudAPI
|
||||
new object me
|
||||
|
||||
-- Information Functions
|
||||
* baVersion string Type -- returns version information
|
||||
* baSysFolder string FolderType -- returns Windows special folders location
|
||||
* baCpuInfo string InfoType -- returns information about the processor installed
|
||||
* baDiskInfo string Disk, string InfoType -- returns information about Disk
|
||||
* baMemoryInfo string InfoType -- returns memory information
|
||||
* baFindApp string Extension -- finds application associated with Extension
|
||||
* baReadIni string Section, string Keyname, string Default, string IniFile -- reads ini file entry
|
||||
* baWriteIni string Section, string Keyname, string Default, string IniFile -- writes ini file entry
|
||||
* baFlushIni string IniFile -- flushes ini file to disk
|
||||
* baReadRegString string Keyname, string Value, string Default, string Branch -- returns text from the registry
|
||||
* baWriteRegString string Keyname, string Value, string NewData, string Branch -- writes a number into the registry
|
||||
* baReadRegNumber string Keyname, string Value, integer Default, string Branch -- returns a number from the registry
|
||||
* baWriteRegNumber string Keyname, string Value, integer NewData, string Branch -- writes a number into the registry
|
||||
* baDeleteReg string Keyname, string Value, string Branch -- deletes Keyname/Value from registry
|
||||
* baRegKeyList string Keyname, string Branch -- returns list of keys in Keyname
|
||||
* baRegValueList string Keyname, string Branch -- returns list of values in Keyname
|
||||
* baSoundCard -- returns 1 if a sound card is installed
|
||||
* baFontInstalled string FontName, string FontStyle -- returns 1 if font is installed
|
||||
* baFontList string FontType -- returns list of installed FontType fonts
|
||||
* baFontStyleList string FontName -- returns list of available FontName styles
|
||||
* baCommandArgs -- returns the arguments the projector was started with
|
||||
* baPrevious integer Activate -- returns window handle of a previous instance of application
|
||||
* baScreenInfo string InfoType -- returns information about the screen
|
||||
|
||||
|
||||
-- System Functions
|
||||
* baDisableDiskErrors integer Disable -- disable/enable disk errors
|
||||
* baDisableKeys integer Disable, integer WinHandle -- disables key presses in window
|
||||
* baDisableMouse integer Disable, integer WinHandle -- disables/enables mouse clicks in window
|
||||
* baDisableSwitching integer Disable -- disables/enables task switching
|
||||
* baDisableScreenSaver integer Disable -- sets the screen saver on or off
|
||||
* baScreenSaverTime integer Time -- sets the screen saver time out
|
||||
* baSetScreenSaver string FileName -- sets FileName as the active screen saver
|
||||
* baSetWallpaper string FileName, integer Tile -- sets FileName as the desktop wallpaper
|
||||
* baSetPattern string Name, string Pattern -- sets Pattern as the desktop pattern
|
||||
* baSetDisplay integer Width, integer Height, integer Depth, string Mode, integer Force -- changes the screen display settings
|
||||
* baExitWindows string Option -- shuts down Windows
|
||||
* baRunProgram string FileName, string State, integer Wait -- runs external program
|
||||
* baWinHelp string Command, string FileName, string Data -- shows windows help file
|
||||
* baMsgBox string Message, string Caption, string Buttons, string Icon, integer DefaultButton -- shows message box
|
||||
* baHideTaskBar integer Hide -- returns whether TaskBar is showing
|
||||
* baSetCurrentDir string Dir -- sets the current directory to Dir
|
||||
* baCopyText string Text -- copies Text to the clipboard
|
||||
* baPasteText -- returns text from clipboard
|
||||
* baEncryptText string Text, string Key -- encrypt Text with Key
|
||||
* baDecryptText string Text, string Key -- decrypt Text with Key
|
||||
* baPlaceCursor integer X, integer Y -- positions the cursor
|
||||
* baRestrictCursor integer Left, integer Top, integer Right, integer Bottom -- restirct cursor
|
||||
* baFreeCursor -- allows cursor to move freely
|
||||
* baSetVolume string Type, integer Volume -- sets current volume for wave, cd, midi
|
||||
* baGetVolume string Type -- gets current volume for wave, cd, midi
|
||||
* baInstallFont string fontfile, string fontname -- installs the font
|
||||
* baKeyIsDown integer Key -- returns 1 if Key is down
|
||||
* baKeyBeenPressed integer Key -- returns 1 if Key has been pressed since the last call to baKeyBeenPressed
|
||||
* baSleep integer milliSecs -- sleeps for milliSecs
|
||||
* baCreatePMGroup string Group -- creates Program Manager / Start Menu group
|
||||
* baDeletePMGroup string Group -- deletes Program Manager / Start Menu group
|
||||
* baCreatePMIcon string Cmd, string Title, string Icon, integer IconNumber -- creates Program Manager / Start Menu icon
|
||||
* baDeletePMIcon string Icon -- deletes Program Manager / Start Menu icon
|
||||
* baPMGroupList -- returns list of Program Manager / Start Menu groups
|
||||
* baPMIconList string Group -- returns list of icons in Group
|
||||
* baPMSubGroupList string Group -- returns list of Start Menu groups in Group
|
||||
* baSystemTime string Format -- gets system date/time
|
||||
* baSetSystemTime string Format, string Time -- sets system date/time
|
||||
* baPrinterInfo string InfoType -- gets information about installed printers
|
||||
* baSetPrinter string InfoType, any Data -- sets printer settings
|
||||
* baRefreshDesktop integer Wait -- refreshed the desktop icons
|
||||
|
||||
-- File Functions
|
||||
* baFileAge string FileName -- returns the age of the file
|
||||
* baFileExists string FileName -- returns 1 if file exists
|
||||
* baFolderExists string DirName -- returns 1 if directory exists
|
||||
* baCreateFolder string DirName -- creates directory
|
||||
* baDeleteFolder string DirName -- deletes dirname if empty
|
||||
* baRenameFile string FileName, string NewName -- renames filename to NewName
|
||||
* baDeleteFile string FileName -- deletes filename
|
||||
* baDeleteXFiles string DirName, string FileSpec -- deletes files matching FileSpec from DirName
|
||||
* baXDelete string DirName, string FileSpec -- deletes files matching FileSpec from DirName, including sub-directories
|
||||
* baFileDate string FileName, string dateformat, string timeformat -- returns date of file
|
||||
* baFileSize string FileName -- returns size of file in bytes, or -1 if FileName doesn't exist
|
||||
* baFileAttributes string FileName -- returns string of set attributes in FileName
|
||||
* baSetFileAttributes string FileName, string Attributes -- sets Attributes for FileName
|
||||
* baRecycleFile string Filename -- place filename in Recycle Bin
|
||||
* baCopyFile string SrcFile, string DestFile, string Overwrite -- copies SrcFile to DestFile
|
||||
* baCopyXFiles string SrcDir, string DestDir, string FileSpec, string Overwrite -- copies all FileSpec files in SrcDir to DestDir
|
||||
* baXCopy string SrcDir, string DestDir, string FileSpec, string Overwrite, integer MakeDirs -- copies all FileSpec files in SrcDir to DestDir, including sub-directories
|
||||
* baFileList string Folder, string Pattern -- returns list of files in Folder
|
||||
* baFolderList string Folder -- returns list of folders in Folder
|
||||
* baFindFirstFile string Dir, string FileSpec -- finds first file matching FileSpec in Src
|
||||
* baFindNextFile -- finds next file
|
||||
* baFindClose -- closes a FindFirst/FindNext loop
|
||||
* baGetFilename string Operation, string StartDir, string Filename, string Filter, integer Flags, string Instruction, integer NoChangeFolder, integer X, integer Y -- shows Open/save file dialog box
|
||||
* baGetFolder string StartDir, string Instruction, integer Flags, string Title, integer X, integer Y -- shows directory selector dialog
|
||||
* baFileVersion string FileName -- returns version of FileName
|
||||
* baEncryptFile string FileName, string Key -- encrypts FileName with Key
|
||||
* baFindDrive string StartDrive, string FileName -- finds drive containing FileName
|
||||
* baOpenFile string FileName, string State -- open FileName
|
||||
* baOpenURL string FileName, string State -- opens the URL
|
||||
* baPrintFile string FileName -- prints a file
|
||||
* baShell string Operation, string FileName, string Args, string WorkDir, string State -- executes a file
|
||||
* baShortFileName string FileName -- returns the DOS short name of FileName
|
||||
* baTempFileName string Prefix -- returns a temporary file name
|
||||
* baMakeShortcut string Filename, string Path, string Caption -- creates a Win95/NT shortcut
|
||||
* baMakeShortcutEx string File, string Folder, string Title, string Args, string WorkDir, string Icon, integer IconNumber, integer Hotkey, string State -- creates a Win95/NT Shortcut
|
||||
* baResolveShortcut string Linkname -- returns file that Linkname points to
|
||||
|
||||
-- Window Functions
|
||||
* baWindowInfo integer WinHandle, string Info -- gets information about a window
|
||||
* baFindWindow string Classname, string caption -- finds a window
|
||||
* baActiveWindow -- returns the active window
|
||||
* baCloseWindow integer WinHandle -- closes window
|
||||
* baCloseApp integer WinHandle -- closes application owning window
|
||||
* baSetWindowState integer WinHandle, string State -- sets state of window
|
||||
* baActivateWindow integer WinHandle -- activates window
|
||||
* baSetWindowTitle integer WinHandle, string Title -- sets title of window
|
||||
* baMoveWindow integer WinHandle, integer x, integer y, integer width, integer height, integer activate -- moves/resizes WinHandle
|
||||
* baWindowToFront integer WinHandle -- brings window to front
|
||||
* baWindowToBack integer WinHandle -- sends window to back
|
||||
* baGetWindow integer WinHandle, string relation -- gets window related to WinHandle
|
||||
* baWaitTillActive integer WinHandle -- waits till window becomes the active one
|
||||
* baWaitForWindow integer WinHandle, string State, integer Ticks -- waits till window is State, for maximuum of Ticks (1 tick = 1/60th sec)
|
||||
* baNextActiveWindow integer secs -- returns the next active window apart from the Director/Authorware window, with a timeout of Ticks (1 tick = 1/60th sec)
|
||||
* baWindowExists integer WinHandle -- returns 1 if WinHandle is a valid window handle
|
||||
* baWindowList string Classname, string Caption, integer Match -- returns list of all matching windows
|
||||
* baChildWindowList integer ParentWnd, string Classname, string Caption, integer Match -- returns list of all matching child windows of ParentWnd
|
||||
* baWindowDepth integer WinHandle -- returns z-order depth of specified window
|
||||
* baSetWindowDepth integer WinHandle, integer Depth -- sets WinHandle to z-order Depth
|
||||
* baSendKeys string Keys -- send Keys to the active window
|
||||
* baSendMsg integer WinHandle, integer msg, integer wParam, integer lParam, integer wait -- sends msg to window
|
||||
* baAddSysItems integer WinHandle, integer SysMenu, integer MinBox, integer MaxBox -- adds system items
|
||||
* baRemoveSysItems integer WinHandle, integer SysMenu, integer MinBox, integer MaxBox -- removes system items
|
||||
* baWinHandle -- returns the handle of the Director or Authorware window
|
||||
* baStageHandle -- returns the handle of the Director Stage window
|
||||
|
||||
-- Buddy Functions
|
||||
* baAbout -- shows info about Buddy API
|
||||
* baRegister string UserName, integer Number -- enter your registration information
|
||||
* baSaveRegistration string UserName, integer UserName -- saves your registration information
|
||||
* baGetRegistration -- retrieves your registration information
|
||||
* baFunctions -- retrieves the number of functions you are licensed to use
|
||||
|
||||
*/
|
||||
|
||||
namespace Director {
|
||||
|
||||
const char *BudAPIXtra::xlibName = "BudAPI";
|
||||
const XlibFileDesc BudAPIXtra::fileNames[] = {
|
||||
{ "budapi", nullptr },
|
||||
{ nullptr, nullptr },
|
||||
};
|
||||
|
||||
static MethodProto xlibMethods[] = {
|
||||
{ "new", BudAPIXtra::m_new, 0, 0, 500 },
|
||||
{ nullptr, nullptr, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static BuiltinProto xlibBuiltins[] = {
|
||||
{ "baVersion", BudAPIXtra::m_baVersion, 1, 1, 500, HBLTIN },
|
||||
{ "baSysFolder", BudAPIXtra::m_baSysFolder, 1, 1, 500, HBLTIN },
|
||||
{ "baCpuInfo", BudAPIXtra::m_baCpuInfo, 1, 1, 500, HBLTIN },
|
||||
{ "baDiskInfo", BudAPIXtra::m_baDiskInfo, 2, 2, 500, HBLTIN },
|
||||
{ "baMemoryInfo", BudAPIXtra::m_baMemoryInfo, 1, 1, 500, HBLTIN },
|
||||
{ "baFindApp", BudAPIXtra::m_baFindApp, 1, 1, 500, HBLTIN },
|
||||
{ "baReadIni", BudAPIXtra::m_baReadIni, 4, 4, 500, HBLTIN },
|
||||
{ "baWriteIni", BudAPIXtra::m_baWriteIni, 4, 4, 500, HBLTIN },
|
||||
{ "baFlushIni", BudAPIXtra::m_baFlushIni, 1, 1, 500, HBLTIN },
|
||||
{ "baReadRegString", BudAPIXtra::m_baReadRegString, 4, 4, 500, HBLTIN },
|
||||
{ "baWriteRegString", BudAPIXtra::m_baWriteRegString, 4, 4, 500, HBLTIN },
|
||||
{ "baReadRegNumber", BudAPIXtra::m_baReadRegNumber, 4, 4, 500, HBLTIN },
|
||||
{ "baWriteRegNumber", BudAPIXtra::m_baWriteRegNumber, 4, 4, 500, HBLTIN },
|
||||
{ "baDeleteReg", BudAPIXtra::m_baDeleteReg, 3, 3, 500, HBLTIN },
|
||||
{ "baRegKeyList", BudAPIXtra::m_baRegKeyList, 2, 2, 500, HBLTIN },
|
||||
{ "baRegValueList", BudAPIXtra::m_baRegValueList, 2, 2, 500, HBLTIN },
|
||||
{ "baSoundCard", BudAPIXtra::m_baSoundCard, 0, 0, 500, HBLTIN },
|
||||
{ "baFontInstalled", BudAPIXtra::m_baFontInstalled, 2, 2, 500, HBLTIN },
|
||||
{ "baFontList", BudAPIXtra::m_baFontList, 1, 1, 500, HBLTIN },
|
||||
{ "baFontStyleList", BudAPIXtra::m_baFontStyleList, 1, 1, 500, HBLTIN },
|
||||
{ "baCommandArgs", BudAPIXtra::m_baCommandArgs, 0, 0, 500, HBLTIN },
|
||||
{ "baPrevious", BudAPIXtra::m_baPrevious, 1, 1, 500, HBLTIN },
|
||||
{ "baScreenInfo", BudAPIXtra::m_baScreenInfo, 1, 1, 500, HBLTIN },
|
||||
{ "baDisableDiskErrors", BudAPIXtra::m_baDisableDiskErrors, 1, 1, 500, HBLTIN },
|
||||
{ "baDisableKeys", BudAPIXtra::m_baDisableKeys, 2, 2, 500, HBLTIN },
|
||||
{ "baDisableMouse", BudAPIXtra::m_baDisableMouse, 2, 2, 500, HBLTIN },
|
||||
{ "baDisableSwitching", BudAPIXtra::m_baDisableSwitching, 1, 1, 500, HBLTIN },
|
||||
{ "baDisableScreenSaver", BudAPIXtra::m_baDisableScreenSaver, 1, 1, 500, HBLTIN },
|
||||
{ "baScreenSaverTime", BudAPIXtra::m_baScreenSaverTime, 1, 1, 500, HBLTIN },
|
||||
{ "baSetScreenSaver", BudAPIXtra::m_baSetScreenSaver, 1, 1, 500, HBLTIN },
|
||||
{ "baSetWallpaper", BudAPIXtra::m_baSetWallpaper, 2, 2, 500, HBLTIN },
|
||||
{ "baSetPattern", BudAPIXtra::m_baSetPattern, 2, 2, 500, HBLTIN },
|
||||
{ "baSetDisplay", BudAPIXtra::m_baSetDisplay, 5, 5, 500, HBLTIN },
|
||||
{ "baExitWindows", BudAPIXtra::m_baExitWindows, 1, 1, 500, HBLTIN },
|
||||
{ "baRunProgram", BudAPIXtra::m_baRunProgram, 3, 3, 500, HBLTIN },
|
||||
{ "baWinHelp", BudAPIXtra::m_baWinHelp, 3, 3, 500, HBLTIN },
|
||||
{ "baMsgBox", BudAPIXtra::m_baMsgBox, 5, 5, 500, HBLTIN },
|
||||
{ "baHideTaskBar", BudAPIXtra::m_baHideTaskBar, 1, 1, 500, HBLTIN },
|
||||
{ "baSetCurrentDir", BudAPIXtra::m_baSetCurrentDir, 1, 1, 500, HBLTIN },
|
||||
{ "baCopyText", BudAPIXtra::m_baCopyText, 1, 1, 500, HBLTIN },
|
||||
{ "baPasteText", BudAPIXtra::m_baPasteText, 0, 0, 500, HBLTIN },
|
||||
{ "baEncryptText", BudAPIXtra::m_baEncryptText, 2, 2, 500, HBLTIN },
|
||||
{ "baDecryptText", BudAPIXtra::m_baDecryptText, 2, 2, 500, HBLTIN },
|
||||
{ "baPlaceCursor", BudAPIXtra::m_baPlaceCursor, 2, 2, 500, HBLTIN },
|
||||
{ "baRestrictCursor", BudAPIXtra::m_baRestrictCursor, 4, 4, 500, HBLTIN },
|
||||
{ "baFreeCursor", BudAPIXtra::m_baFreeCursor, 0, 0, 500, HBLTIN },
|
||||
{ "baSetVolume", BudAPIXtra::m_baSetVolume, 2, 2, 500, HBLTIN },
|
||||
{ "baGetVolume", BudAPIXtra::m_baGetVolume, 1, 1, 500, HBLTIN },
|
||||
{ "baInstallFont", BudAPIXtra::m_baInstallFont, 2, 2, 500, HBLTIN },
|
||||
{ "baKeyIsDown", BudAPIXtra::m_baKeyIsDown, 1, 1, 500, HBLTIN },
|
||||
{ "baKeyBeenPressed", BudAPIXtra::m_baKeyBeenPressed, 1, 1, 500, HBLTIN },
|
||||
{ "baSleep", BudAPIXtra::m_baSleep, 1, 1, 500, HBLTIN },
|
||||
{ "baCreatePMGroup", BudAPIXtra::m_baCreatePMGroup, 1, 1, 500, HBLTIN },
|
||||
{ "baDeletePMGroup", BudAPIXtra::m_baDeletePMGroup, 1, 1, 500, HBLTIN },
|
||||
{ "baCreatePMIcon", BudAPIXtra::m_baCreatePMIcon, 4, 4, 500, HBLTIN },
|
||||
{ "baDeletePMIcon", BudAPIXtra::m_baDeletePMIcon, 1, 1, 500, HBLTIN },
|
||||
{ "baPMGroupList", BudAPIXtra::m_baPMGroupList, 0, 0, 500, HBLTIN },
|
||||
{ "baPMIconList", BudAPIXtra::m_baPMIconList, 1, 1, 500, HBLTIN },
|
||||
{ "baPMSubGroupList", BudAPIXtra::m_baPMSubGroupList, 1, 1, 500, HBLTIN },
|
||||
{ "baSystemTime", BudAPIXtra::m_baSystemTime, 1, 1, 500, HBLTIN },
|
||||
{ "baSetSystemTime", BudAPIXtra::m_baSetSystemTime, 2, 2, 500, HBLTIN },
|
||||
{ "baPrinterInfo", BudAPIXtra::m_baPrinterInfo, 1, 1, 500, HBLTIN },
|
||||
{ "baSetPrinter", BudAPIXtra::m_baSetPrinter, 2, 2, 500, HBLTIN },
|
||||
{ "baRefreshDesktop", BudAPIXtra::m_baRefreshDesktop, 1, 1, 500, HBLTIN },
|
||||
{ "baFileAge", BudAPIXtra::m_baFileAge, 1, 1, 500, HBLTIN },
|
||||
{ "baFileExists", BudAPIXtra::m_baFileExists, 1, 1, 500, HBLTIN },
|
||||
{ "baFolderExists", BudAPIXtra::m_baFolderExists, 1, 1, 500, HBLTIN },
|
||||
{ "baCreateFolder", BudAPIXtra::m_baCreateFolder, 1, 1, 500, HBLTIN },
|
||||
{ "baDeleteFolder", BudAPIXtra::m_baDeleteFolder, 1, 1, 500, HBLTIN },
|
||||
{ "baRenameFile", BudAPIXtra::m_baRenameFile, 2, 2, 500, HBLTIN },
|
||||
{ "baDeleteFile", BudAPIXtra::m_baDeleteFile, 1, 1, 500, HBLTIN },
|
||||
{ "baDeleteXFiles", BudAPIXtra::m_baDeleteXFiles, 2, 2, 500, HBLTIN },
|
||||
{ "baXDelete", BudAPIXtra::m_baXDelete, 2, 2, 500, HBLTIN },
|
||||
{ "baFileDate", BudAPIXtra::m_baFileDate, 3, 3, 500, HBLTIN },
|
||||
{ "baFileSize", BudAPIXtra::m_baFileSize, 1, 1, 500, HBLTIN },
|
||||
{ "baFileAttributes", BudAPIXtra::m_baFileAttributes, 1, 1, 500, HBLTIN },
|
||||
{ "baSetFileAttributes", BudAPIXtra::m_baSetFileAttributes, 2, 2, 500, HBLTIN },
|
||||
{ "baRecycleFile", BudAPIXtra::m_baRecycleFile, 1, 1, 500, HBLTIN },
|
||||
{ "baCopyFile", BudAPIXtra::m_baCopyFile, 3, 3, 500, HBLTIN },
|
||||
{ "baCopyXFiles", BudAPIXtra::m_baCopyXFiles, 4, 4, 500, HBLTIN },
|
||||
{ "baXCopy", BudAPIXtra::m_baXCopy, 5, 5, 500, HBLTIN },
|
||||
{ "baFileList", BudAPIXtra::m_baFileList, 2, 2, 500, HBLTIN },
|
||||
{ "baFolderList", BudAPIXtra::m_baFolderList, 1, 1, 500, HBLTIN },
|
||||
{ "baFindFirstFile", BudAPIXtra::m_baFindFirstFile, 2, 2, 500, HBLTIN },
|
||||
{ "baFindNextFile", BudAPIXtra::m_baFindNextFile, 0, 0, 500, HBLTIN },
|
||||
{ "baFindClose", BudAPIXtra::m_baFindClose, 0, 0, 500, HBLTIN },
|
||||
{ "baGetFilename", BudAPIXtra::m_baGetFilename, 9, 9, 500, HBLTIN },
|
||||
{ "baGetFolder", BudAPIXtra::m_baGetFolder, 6, 6, 500, HBLTIN },
|
||||
{ "baFileVersion", BudAPIXtra::m_baFileVersion, 1, 1, 500, HBLTIN },
|
||||
{ "baEncryptFile", BudAPIXtra::m_baEncryptFile, 2, 2, 500, HBLTIN },
|
||||
{ "baFindDrive", BudAPIXtra::m_baFindDrive, 2, 2, 500, HBLTIN },
|
||||
{ "baOpenFile", BudAPIXtra::m_baOpenFile, 2, 2, 500, HBLTIN },
|
||||
{ "baOpenURL", BudAPIXtra::m_baOpenURL, 2, 2, 500, HBLTIN },
|
||||
{ "baPrintFile", BudAPIXtra::m_baPrintFile, 1, 1, 500, HBLTIN },
|
||||
{ "baShell", BudAPIXtra::m_baShell, 5, 5, 500, HBLTIN },
|
||||
{ "baShortFileName", BudAPIXtra::m_baShortFileName, 1, 1, 500, HBLTIN },
|
||||
{ "baTempFileName", BudAPIXtra::m_baTempFileName, 1, 1, 500, HBLTIN },
|
||||
{ "baMakeShortcut", BudAPIXtra::m_baMakeShortcut, 3, 3, 500, HBLTIN },
|
||||
{ "baMakeShortcutEx", BudAPIXtra::m_baMakeShortcutEx, 9, 9, 500, HBLTIN },
|
||||
{ "baResolveShortcut", BudAPIXtra::m_baResolveShortcut, 1, 1, 500, HBLTIN },
|
||||
{ "baWindowInfo", BudAPIXtra::m_baWindowInfo, 2, 2, 500, HBLTIN },
|
||||
{ "baFindWindow", BudAPIXtra::m_baFindWindow, 2, 2, 500, HBLTIN },
|
||||
{ "baActiveWindow", BudAPIXtra::m_baActiveWindow, 0, 0, 500, HBLTIN },
|
||||
{ "baCloseWindow", BudAPIXtra::m_baCloseWindow, 1, 1, 500, HBLTIN },
|
||||
{ "baCloseApp", BudAPIXtra::m_baCloseApp, 1, 1, 500, HBLTIN },
|
||||
{ "baSetWindowState", BudAPIXtra::m_baSetWindowState, 2, 2, 500, HBLTIN },
|
||||
{ "baActivateWindow", BudAPIXtra::m_baActivateWindow, 1, 1, 500, HBLTIN },
|
||||
{ "baSetWindowTitle", BudAPIXtra::m_baSetWindowTitle, 2, 2, 500, HBLTIN },
|
||||
{ "baMoveWindow", BudAPIXtra::m_baMoveWindow, 6, 6, 500, HBLTIN },
|
||||
{ "baWindowToFront", BudAPIXtra::m_baWindowToFront, 1, 1, 500, HBLTIN },
|
||||
{ "baWindowToBack", BudAPIXtra::m_baWindowToBack, 1, 1, 500, HBLTIN },
|
||||
{ "baGetWindow", BudAPIXtra::m_baGetWindow, 2, 2, 500, HBLTIN },
|
||||
{ "baWaitTillActive", BudAPIXtra::m_baWaitTillActive, 1, 1, 500, HBLTIN },
|
||||
{ "baWaitForWindow", BudAPIXtra::m_baWaitForWindow, 3, 3, 500, HBLTIN },
|
||||
{ "baNextActiveWindow", BudAPIXtra::m_baNextActiveWindow, 1, 1, 500, HBLTIN },
|
||||
{ "baWindowExists", BudAPIXtra::m_baWindowExists, 1, 1, 500, HBLTIN },
|
||||
{ "baWindowList", BudAPIXtra::m_baWindowList, 3, 3, 500, HBLTIN },
|
||||
{ "baChildWindowList", BudAPIXtra::m_baChildWindowList, 4, 4, 500, HBLTIN },
|
||||
{ "baWindowDepth", BudAPIXtra::m_baWindowDepth, 1, 1, 500, HBLTIN },
|
||||
{ "baSetWindowDepth", BudAPIXtra::m_baSetWindowDepth, 2, 2, 500, HBLTIN },
|
||||
{ "baSendKeys", BudAPIXtra::m_baSendKeys, 1, 1, 500, HBLTIN },
|
||||
{ "baSendMsg", BudAPIXtra::m_baSendMsg, 5, 5, 500, HBLTIN },
|
||||
{ "baAddSysItems", BudAPIXtra::m_baAddSysItems, 4, 4, 500, HBLTIN },
|
||||
{ "baRemoveSysItems", BudAPIXtra::m_baRemoveSysItems, 4, 4, 500, HBLTIN },
|
||||
{ "baWinHandle", BudAPIXtra::m_baWinHandle, 0, 0, 500, HBLTIN },
|
||||
{ "baStageHandle", BudAPIXtra::m_baStageHandle, 0, 0, 500, HBLTIN },
|
||||
{ "baAbout", BudAPIXtra::m_baAbout, 0, 0, 500, HBLTIN },
|
||||
{ "baRegister", BudAPIXtra::m_baRegister, 2, 2, 500, HBLTIN },
|
||||
{ "baSaveRegistration", BudAPIXtra::m_baSaveRegistration, 2, 2, 500, HBLTIN },
|
||||
{ "baGetRegistration", BudAPIXtra::m_baGetRegistration, 0, 0, 500, HBLTIN },
|
||||
{ "baFunctions", BudAPIXtra::m_baFunctions, 0, 0, 500, HBLTIN },
|
||||
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
|
||||
};
|
||||
|
||||
BudAPIXtraObject::BudAPIXtraObject(ObjectType ObjectType) :Object<BudAPIXtraObject>("BudAPI") {
|
||||
_objType = ObjectType;
|
||||
}
|
||||
|
||||
bool BudAPIXtraObject::hasProp(const Common::String &propName) {
|
||||
return (propName == "name");
|
||||
}
|
||||
|
||||
Datum BudAPIXtraObject::getProp(const Common::String &propName) {
|
||||
if (propName == "name")
|
||||
return Datum(BudAPIXtra::xlibName);
|
||||
warning("BudAPIXtra::getProp: unknown property '%s'", propName.c_str());
|
||||
return Datum();
|
||||
}
|
||||
|
||||
void BudAPIXtra::open(ObjectType type, const Common::Path &path) {
|
||||
BudAPIXtraObject::initMethods(xlibMethods);
|
||||
BudAPIXtraObject *xobj = new BudAPIXtraObject(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 BudAPIXtra::close(ObjectType type) {
|
||||
BudAPIXtraObject::cleanupMethods();
|
||||
g_lingo->_globalvars[xlibName] = Datum();
|
||||
|
||||
}
|
||||
|
||||
void BudAPIXtra::m_new(int nargs) {
|
||||
g_lingo->printSTUBWithArglist("BudAPIXtra::m_new", nargs);
|
||||
g_lingo->dropStack(nargs);
|
||||
g_lingo->push(g_lingo->_state->me);
|
||||
}
|
||||
|
||||
XOBJSTUB(BudAPIXtra::m_baVersion, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baSysFolder, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baCpuInfo, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baDiskInfo, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baMemoryInfo, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baFindApp, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baReadIni, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baWriteIni, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baFlushIni, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baReadRegString, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baWriteRegString, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baReadRegNumber, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baWriteRegNumber, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baDeleteReg, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baRegKeyList, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baRegValueList, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baSoundCard, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baFontInstalled, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baFontList, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baFontStyleList, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baCommandArgs, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baPrevious, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baScreenInfo, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baDisableDiskErrors, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baDisableKeys, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baDisableMouse, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baDisableSwitching, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baDisableScreenSaver, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baScreenSaverTime, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baSetScreenSaver, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baSetWallpaper, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baSetPattern, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baSetDisplay, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baExitWindows, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baRunProgram, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baWinHelp, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baMsgBox, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baHideTaskBar, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baSetCurrentDir, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baCopyText, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baPasteText, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baEncryptText, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baDecryptText, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baPlaceCursor, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baRestrictCursor, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baFreeCursor, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baSetVolume, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baGetVolume, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baInstallFont, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baKeyIsDown, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baKeyBeenPressed, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baSleep, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baCreatePMGroup, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baDeletePMGroup, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baCreatePMIcon, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baDeletePMIcon, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baPMGroupList, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baPMIconList, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baPMSubGroupList, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baSystemTime, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baSetSystemTime, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baPrinterInfo, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baSetPrinter, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baRefreshDesktop, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baFileAge, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baFileExists, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baFolderExists, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baCreateFolder, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baDeleteFolder, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baRenameFile, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baDeleteFile, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baDeleteXFiles, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baXDelete, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baFileDate, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baFileSize, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baFileAttributes, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baSetFileAttributes, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baRecycleFile, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baCopyFile, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baCopyXFiles, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baXCopy, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baFileList, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baFolderList, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baFindFirstFile, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baFindNextFile, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baFindClose, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baGetFilename, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baGetFolder, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baFileVersion, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baEncryptFile, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baFindDrive, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baOpenFile, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baOpenURL, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baPrintFile, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baShell, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baShortFileName, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baTempFileName, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baMakeShortcut, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baMakeShortcutEx, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baResolveShortcut, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baWindowInfo, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baFindWindow, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baActiveWindow, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baCloseWindow, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baCloseApp, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baSetWindowState, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baActivateWindow, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baSetWindowTitle, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baMoveWindow, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baWindowToFront, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baWindowToBack, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baGetWindow, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baWaitTillActive, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baWaitForWindow, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baNextActiveWindow, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baWindowExists, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baWindowList, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baChildWindowList, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baWindowDepth, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baSetWindowDepth, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baSendKeys, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baSendMsg, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baAddSysItems, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baRemoveSysItems, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baWinHandle, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baStageHandle, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baAbout, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baRegister, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baSaveRegistration, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baGetRegistration, 0)
|
||||
XOBJSTUB(BudAPIXtra::m_baFunctions, 0)
|
||||
|
||||
}
|
||||
180
engines/director/lingo/xtras/b/budapi.h
Normal file
180
engines/director/lingo/xtras/b/budapi.h
Normal file
@@ -0,0 +1,180 @@
|
||||
/* 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_XTRAS_B_BUDAPI_H
|
||||
#define DIRECTOR_LINGO_XTRAS_B_BUDAPI_H
|
||||
|
||||
namespace Director {
|
||||
|
||||
class BudAPIXtraObject : public Object<BudAPIXtraObject> {
|
||||
public:
|
||||
BudAPIXtraObject(ObjectType objType);
|
||||
|
||||
bool hasProp(const Common::String &propName) override;
|
||||
Datum getProp(const Common::String &propName) override;
|
||||
};
|
||||
|
||||
namespace BudAPIXtra {
|
||||
|
||||
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_baVersion(int nargs);
|
||||
void m_baSysFolder(int nargs);
|
||||
void m_baCpuInfo(int nargs);
|
||||
void m_baDiskInfo(int nargs);
|
||||
void m_baMemoryInfo(int nargs);
|
||||
void m_baFindApp(int nargs);
|
||||
void m_baReadIni(int nargs);
|
||||
void m_baWriteIni(int nargs);
|
||||
void m_baFlushIni(int nargs);
|
||||
void m_baReadRegString(int nargs);
|
||||
void m_baWriteRegString(int nargs);
|
||||
void m_baReadRegNumber(int nargs);
|
||||
void m_baWriteRegNumber(int nargs);
|
||||
void m_baDeleteReg(int nargs);
|
||||
void m_baRegKeyList(int nargs);
|
||||
void m_baRegValueList(int nargs);
|
||||
void m_baSoundCard(int nargs);
|
||||
void m_baFontInstalled(int nargs);
|
||||
void m_baFontList(int nargs);
|
||||
void m_baFontStyleList(int nargs);
|
||||
void m_baCommandArgs(int nargs);
|
||||
void m_baPrevious(int nargs);
|
||||
void m_baScreenInfo(int nargs);
|
||||
void m_baDisableDiskErrors(int nargs);
|
||||
void m_baDisableKeys(int nargs);
|
||||
void m_baDisableMouse(int nargs);
|
||||
void m_baDisableSwitching(int nargs);
|
||||
void m_baDisableScreenSaver(int nargs);
|
||||
void m_baScreenSaverTime(int nargs);
|
||||
void m_baSetScreenSaver(int nargs);
|
||||
void m_baSetWallpaper(int nargs);
|
||||
void m_baSetPattern(int nargs);
|
||||
void m_baSetDisplay(int nargs);
|
||||
void m_baExitWindows(int nargs);
|
||||
void m_baRunProgram(int nargs);
|
||||
void m_baWinHelp(int nargs);
|
||||
void m_baMsgBox(int nargs);
|
||||
void m_baHideTaskBar(int nargs);
|
||||
void m_baSetCurrentDir(int nargs);
|
||||
void m_baCopyText(int nargs);
|
||||
void m_baPasteText(int nargs);
|
||||
void m_baEncryptText(int nargs);
|
||||
void m_baDecryptText(int nargs);
|
||||
void m_baPlaceCursor(int nargs);
|
||||
void m_baRestrictCursor(int nargs);
|
||||
void m_baFreeCursor(int nargs);
|
||||
void m_baSetVolume(int nargs);
|
||||
void m_baGetVolume(int nargs);
|
||||
void m_baInstallFont(int nargs);
|
||||
void m_baKeyIsDown(int nargs);
|
||||
void m_baKeyBeenPressed(int nargs);
|
||||
void m_baSleep(int nargs);
|
||||
void m_baCreatePMGroup(int nargs);
|
||||
void m_baDeletePMGroup(int nargs);
|
||||
void m_baCreatePMIcon(int nargs);
|
||||
void m_baDeletePMIcon(int nargs);
|
||||
void m_baPMGroupList(int nargs);
|
||||
void m_baPMIconList(int nargs);
|
||||
void m_baPMSubGroupList(int nargs);
|
||||
void m_baSystemTime(int nargs);
|
||||
void m_baSetSystemTime(int nargs);
|
||||
void m_baPrinterInfo(int nargs);
|
||||
void m_baSetPrinter(int nargs);
|
||||
void m_baRefreshDesktop(int nargs);
|
||||
void m_baFileAge(int nargs);
|
||||
void m_baFileExists(int nargs);
|
||||
void m_baFolderExists(int nargs);
|
||||
void m_baCreateFolder(int nargs);
|
||||
void m_baDeleteFolder(int nargs);
|
||||
void m_baRenameFile(int nargs);
|
||||
void m_baDeleteFile(int nargs);
|
||||
void m_baDeleteXFiles(int nargs);
|
||||
void m_baXDelete(int nargs);
|
||||
void m_baFileDate(int nargs);
|
||||
void m_baFileSize(int nargs);
|
||||
void m_baFileAttributes(int nargs);
|
||||
void m_baSetFileAttributes(int nargs);
|
||||
void m_baRecycleFile(int nargs);
|
||||
void m_baCopyFile(int nargs);
|
||||
void m_baCopyXFiles(int nargs);
|
||||
void m_baXCopy(int nargs);
|
||||
void m_baFileList(int nargs);
|
||||
void m_baFolderList(int nargs);
|
||||
void m_baFindFirstFile(int nargs);
|
||||
void m_baFindNextFile(int nargs);
|
||||
void m_baFindClose(int nargs);
|
||||
void m_baGetFilename(int nargs);
|
||||
void m_baGetFolder(int nargs);
|
||||
void m_baFileVersion(int nargs);
|
||||
void m_baEncryptFile(int nargs);
|
||||
void m_baFindDrive(int nargs);
|
||||
void m_baOpenFile(int nargs);
|
||||
void m_baOpenURL(int nargs);
|
||||
void m_baPrintFile(int nargs);
|
||||
void m_baShell(int nargs);
|
||||
void m_baShortFileName(int nargs);
|
||||
void m_baTempFileName(int nargs);
|
||||
void m_baMakeShortcut(int nargs);
|
||||
void m_baMakeShortcutEx(int nargs);
|
||||
void m_baResolveShortcut(int nargs);
|
||||
void m_baWindowInfo(int nargs);
|
||||
void m_baFindWindow(int nargs);
|
||||
void m_baActiveWindow(int nargs);
|
||||
void m_baCloseWindow(int nargs);
|
||||
void m_baCloseApp(int nargs);
|
||||
void m_baSetWindowState(int nargs);
|
||||
void m_baActivateWindow(int nargs);
|
||||
void m_baSetWindowTitle(int nargs);
|
||||
void m_baMoveWindow(int nargs);
|
||||
void m_baWindowToFront(int nargs);
|
||||
void m_baWindowToBack(int nargs);
|
||||
void m_baGetWindow(int nargs);
|
||||
void m_baWaitTillActive(int nargs);
|
||||
void m_baWaitForWindow(int nargs);
|
||||
void m_baNextActiveWindow(int nargs);
|
||||
void m_baWindowExists(int nargs);
|
||||
void m_baWindowList(int nargs);
|
||||
void m_baChildWindowList(int nargs);
|
||||
void m_baWindowDepth(int nargs);
|
||||
void m_baSetWindowDepth(int nargs);
|
||||
void m_baSendKeys(int nargs);
|
||||
void m_baSendMsg(int nargs);
|
||||
void m_baAddSysItems(int nargs);
|
||||
void m_baRemoveSysItems(int nargs);
|
||||
void m_baWinHandle(int nargs);
|
||||
void m_baStageHandle(int nargs);
|
||||
void m_baAbout(int nargs);
|
||||
void m_baRegister(int nargs);
|
||||
void m_baSaveRegistration(int nargs);
|
||||
void m_baGetRegistration(int nargs);
|
||||
void m_baFunctions(int nargs);
|
||||
|
||||
} // End of namespace BudAPIXtra
|
||||
|
||||
} // End of namespace Director
|
||||
|
||||
#endif
|
||||
207
engines/director/lingo/xtras/d/displayres.cpp
Normal file
207
engines/director/lingo/xtras/d/displayres.cpp
Normal file
@@ -0,0 +1,207 @@
|
||||
/* 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/xtras/d/displayres.h"
|
||||
|
||||
/**************************************************
|
||||
*
|
||||
* USED IN:
|
||||
* I Spy Spooky Mansion
|
||||
*
|
||||
**************************************************/
|
||||
|
||||
/*
|
||||
-- xtra DisplayRes
|
||||
-- DisplayRes Xtra, Version 1.0.0.3, 4/27/1997
|
||||
-- Copyright 1997 Glenn M. Picher, Dirigo Multimedia
|
||||
--
|
||||
--Published by g/matter, inc.
|
||||
--Sales: sales@gmatter.com, (800)933-6223
|
||||
--Tech support: support@gmatter.com, (415)243-0394
|
||||
--Web: http://www.gmatter.com
|
||||
--
|
||||
--Author: Glenn M. Picher, gpicher@maine.com, (207)767-8015
|
||||
--Web: http://www.maine.com/shops/gpicher
|
||||
--
|
||||
-- Registered version-- thank you! See the 'register' handler.
|
||||
--
|
||||
new object me
|
||||
-- Note: this Xtra uses only global handlers, so there's no need to
|
||||
-- create any child objects. Just use the handlers listed below.
|
||||
--
|
||||
-- All methods return a string. Check the result for word 1 'Error:' to
|
||||
-- verify proper operation.
|
||||
--
|
||||
* dresGetDisplaySettings
|
||||
-- Provides a string of possible resolutions for the current display,
|
||||
-- in the format:
|
||||
-- width height colors frequency interlace grayOrColor capability
|
||||
-- Reports width in pixels; height in pixels; color depth in bits per pixel: 1 (2
|
||||
-- colors), 4 (16 colors), 8 (256 colors), 15 (32K colors), 16 (64K colors),
|
||||
-- 24 (16 million colors), 32 (24 million colors plus 8 bits transparency);
|
||||
-- vertical refresh rate in cycles per second (a value of 0 or 1 may be returned,
|
||||
-- which indicates the default hardware refresh); 'interlaced' or 'noninterlaced';
|
||||
-- 'grayscale' or 'color'; and the capabilites (typically 'dynamic' or 'restart,'
|
||||
-- but if some error occurs while checking capabilities, could also be 'badFlags',
|
||||
-- 'failed', 'badMode', 'notUpdated', or 'unknown'). Note that the quality of
|
||||
-- of Windows display drivers varies wildly. Some drivers may report they can
|
||||
-- change modes dynamically when they really can't. Some report no error when
|
||||
-- actually asked to change modes dynamically and unable to do so (I've observed
|
||||
-- this on Windows NT 3.51). Therefore, it's best to verify that the display really
|
||||
-- *has* changed with dresGetCurrentDisplay(), after using dresDynamicSetDisplay().
|
||||
-- NOTE: This method can return more than one line. Each possible display setting
|
||||
-- is on a different line of the returned string. Based on the results, choose
|
||||
-- a line number of the new mode you want to set with dresDynamicSetDisplay() (or,
|
||||
-- if 'capability' indicates a restart is required, dresRestartSetDisplay).
|
||||
--
|
||||
* dresDynamicSetDisplay integer lineNumber
|
||||
-- Change the monitor to use the display settings on the specified line
|
||||
-- of the information returned by dresGetDisplaySettings. Does not affect
|
||||
-- registry settings, so the default will be restored on the next restart.
|
||||
-- It's best to verify proper operation with dresGetCurrentDisplay().
|
||||
--
|
||||
* dresRestartSetDisplay integer lineNumber
|
||||
-- Change the monitor to use the display settings on the specified line
|
||||
-- of the information returned by dresGetDisplaySettings (updating the
|
||||
-- default registry settings for the next time the computer restarts).
|
||||
-- Note that this method *will* change dynamically if it's possible, as
|
||||
-- well as updating the default registry settings. Use dresGetCurrentDisplay()
|
||||
-- to verify whether a dynamic change was made.
|
||||
* dresRestart
|
||||
-- Restart the machine. Lingo's 'restart' doesn't work on Win95/NT.
|
||||
* dresShutdown
|
||||
-- Shut down the machine. Lingo's 'shutdown' doesn't work on Win95/NT.
|
||||
--
|
||||
* dresDefaultDisplay
|
||||
-- Sets the display to the default values stored in the registry. Useful to
|
||||
-- restore the screen after a dynamic change with dresDynamicSetDisplay.
|
||||
-- Note that dresRestartSetDisplay() will *change* the defaults, so this method
|
||||
-- can't be used to restore an old setting after a restart.
|
||||
* dresGetCurrentDisplay
|
||||
-- Returns a line of information about the current display settings (in the same
|
||||
-- format as dresGetDisplaySettings). This is useful to save the existing settings
|
||||
-- when you change the display, so you can know what to restore it to later.
|
||||
-- This also returns up-to-date information after a display change, which Lingo's
|
||||
-- 'the desktopRectList' and 'the colorDepth' will not (in Director 5 at least).
|
||||
-- Note that the values for 'interlace' and 'grayOrColor' are not meaningful; the value
|
||||
-- for 'capability' is always 'dynamic' (because by definition the sytem is already
|
||||
-- using this display mode); and the value for 'frequency' is only meaningful on
|
||||
-- Windows NT. This is due to the nature of the underlying Windows API functions.
|
||||
--
|
||||
+ register object xtraReference, string registrationString
|
||||
--
|
||||
|
||||
*/
|
||||
|
||||
namespace Director {
|
||||
|
||||
const char *DisplayResXtra::xlibName = "DisplayRes";
|
||||
const XlibFileDesc DisplayResXtra::fileNames[] = {
|
||||
{ "displayres", nullptr },
|
||||
{ "DispRes", nullptr },
|
||||
{ nullptr, nullptr },
|
||||
};
|
||||
|
||||
static MethodProto xlibMethods[] = {
|
||||
{ "new", DisplayResXtra::m_new, 0, 0, 500 },
|
||||
{ "register", DisplayResXtra::m_register, 1, 1, 500 },
|
||||
{ nullptr, nullptr, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static BuiltinProto xlibBuiltins[] = {
|
||||
{ "dresGetDisplaySettings", DisplayResXtra::m_dresGetDisplaySettings, 0, 0, 500, HBLTIN },
|
||||
{ "dresDynamicSetDisplay", DisplayResXtra::m_dresDynamicSetDisplay, 1, 1, 500, HBLTIN },
|
||||
{ "dresRestartSetDisplay", DisplayResXtra::m_dresRestartSetDisplay, 1, 1, 500, HBLTIN },
|
||||
{ "dresRestart", DisplayResXtra::m_dresRestart, 0, 0, 500, HBLTIN },
|
||||
{ "dresShutdown", DisplayResXtra::m_dresShutdown, 0, 0, 500, HBLTIN },
|
||||
{ "dresDefaultDisplay", DisplayResXtra::m_dresDefaultDisplay, 0, 0, 500, HBLTIN },
|
||||
{ "dresGetCurrentDisplay", DisplayResXtra::m_dresGetCurrentDisplay, 0, 0, 500, HBLTIN },
|
||||
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
|
||||
};
|
||||
|
||||
DisplayResXtraObject::DisplayResXtraObject(ObjectType ObjectType) :Object<DisplayResXtraObject>("DisplayRes") {
|
||||
_objType = ObjectType;
|
||||
}
|
||||
|
||||
bool DisplayResXtraObject::hasProp(const Common::String &propName) {
|
||||
return (propName == "name");
|
||||
}
|
||||
|
||||
Datum DisplayResXtraObject::getProp(const Common::String &propName) {
|
||||
if (propName == "name")
|
||||
return Datum(DisplayResXtra::xlibName);
|
||||
warning("DisplayResXtra::getProp: unknown property '%s'", propName.c_str());
|
||||
return Datum();
|
||||
}
|
||||
|
||||
void DisplayResXtra::open(ObjectType type, const Common::Path &path) {
|
||||
DisplayResXtraObject::initMethods(xlibMethods);
|
||||
DisplayResXtraObject *xobj = new DisplayResXtraObject(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 DisplayResXtra::close(ObjectType type) {
|
||||
DisplayResXtraObject::cleanupMethods();
|
||||
g_lingo->_globalvars[xlibName] = Datum();
|
||||
|
||||
}
|
||||
|
||||
void DisplayResXtra::m_new(int nargs) {
|
||||
g_lingo->printSTUBWithArglist("DisplayResXtra::m_new", nargs);
|
||||
g_lingo->dropStack(nargs);
|
||||
g_lingo->push(g_lingo->_state->me);
|
||||
}
|
||||
|
||||
void DisplayResXtra::m_dresGetDisplaySettings(int nargs) {
|
||||
Common::String result = Common::String::format("%d %d %d %d noninterlaced color dynamic", g_director->_wm->getWidth(), g_director->_wm->getHeight(), g_director->_wm->_pixelformat.bytesPerPixel*8, 0);
|
||||
g_lingo->push(Datum(result));
|
||||
}
|
||||
|
||||
XOBJSTUB(DisplayResXtra::m_dresDynamicSetDisplay, 0)
|
||||
XOBJSTUB(DisplayResXtra::m_dresRestartSetDisplay, 0)
|
||||
XOBJSTUB(DisplayResXtra::m_dresRestart, 0)
|
||||
XOBJSTUB(DisplayResXtra::m_dresShutdown, 0)
|
||||
XOBJSTUB(DisplayResXtra::m_dresDefaultDisplay, 0)
|
||||
|
||||
void DisplayResXtra::m_dresGetCurrentDisplay(int nargs) {
|
||||
Common::String result = Common::String::format("%d %d %d %d noninterlaced color dynamic", g_director->_wm->getWidth(), g_director->_wm->getHeight(), g_director->_wm->_pixelformat.bytesPerPixel*8, 0);
|
||||
g_lingo->push(Datum(result));
|
||||
}
|
||||
|
||||
|
||||
void DisplayResXtra::m_register(int nargs) {
|
||||
Datum key = g_lingo->pop();
|
||||
debugC(5, kDebugXObj, "DisplayResXtra::m_register: %s", key.asString().c_str());
|
||||
g_lingo->push(Datum("OK"));
|
||||
}
|
||||
|
||||
}
|
||||
57
engines/director/lingo/xtras/d/displayres.h
Normal file
57
engines/director/lingo/xtras/d/displayres.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/* 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_XTRAS_D_DISPLAYRES_H
|
||||
#define DIRECTOR_LINGO_XTRAS_D_DISPLAYRES_H
|
||||
|
||||
namespace Director {
|
||||
|
||||
class DisplayResXtraObject : public Object<DisplayResXtraObject> {
|
||||
public:
|
||||
DisplayResXtraObject(ObjectType objType);
|
||||
|
||||
bool hasProp(const Common::String &propName) override;
|
||||
Datum getProp(const Common::String &propName) override;
|
||||
};
|
||||
|
||||
namespace DisplayResXtra {
|
||||
|
||||
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_dresGetDisplaySettings(int nargs);
|
||||
void m_dresDynamicSetDisplay(int nargs);
|
||||
void m_dresRestartSetDisplay(int nargs);
|
||||
void m_dresRestart(int nargs);
|
||||
void m_dresShutdown(int nargs);
|
||||
void m_dresDefaultDisplay(int nargs);
|
||||
void m_dresGetCurrentDisplay(int nargs);
|
||||
void m_register(int nargs);
|
||||
|
||||
} // End of namespace DisplayResXtra
|
||||
|
||||
} // End of namespace Director
|
||||
|
||||
#endif
|
||||
382
engines/director/lingo/xtras/directsound.cpp
Normal file
382
engines/director/lingo/xtras/directsound.cpp
Normal file
@@ -0,0 +1,382 @@
|
||||
/* 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/sound.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/xtras/directsound.h"
|
||||
|
||||
/**************************************************
|
||||
*
|
||||
* USED IN:
|
||||
* safecracker
|
||||
*
|
||||
**************************************************/
|
||||
|
||||
/*
|
||||
-- xtra DirectSound
|
||||
new object me
|
||||
--
|
||||
-- DirectSound Xtra(tm) version 1.3.
|
||||
--
|
||||
-- Programmed by Tomer Berda, Hed Arzi - Multimedia.
|
||||
-- Copyright 1996.
|
||||
--
|
||||
* dsOpen
|
||||
* dsNewSound string fileName, integer Mode
|
||||
* dsDelSound integer ID
|
||||
* dsDupSound integer ID
|
||||
* dsPlay integer ID
|
||||
* dsStop integer ID
|
||||
* dsGetSize integer ID
|
||||
* dsGetFreq integer ID
|
||||
* dsSetFreq integer ID, integer Frequency
|
||||
* dsGetVolume integer ID
|
||||
* dsSetVolume integer ID, integer Volume
|
||||
* dsGetPan integer ID
|
||||
* dsSetPan integer ID, integer Pan
|
||||
* dsGetPosition integer ID
|
||||
* dsSetPosition integer ID, integer Pos
|
||||
* dsGetLoop integer ID
|
||||
* dsSetLoop integer ID, integer loopFlag
|
||||
* dsIsPlaying integer ID
|
||||
* dsGetCaps
|
||||
--
|
||||
* ds3DOpen
|
||||
* ds3DLGetPosition
|
||||
* ds3DLSetPosition float X, float Y, float Z
|
||||
* ds3DLGetOrientation
|
||||
* ds3DLSetOrientation float xFront,float yFront,float zFront,float xTop,float yTop,float zTop
|
||||
* ds3DLGetVelocity
|
||||
* ds3DLSetVelocity float X, float Y, float Z
|
||||
* ds3DLGetDopplerFactor
|
||||
* ds3DLSetDopplerFactor float DopplerFactor
|
||||
* ds3DLGetRolloffFactor
|
||||
* ds3DLSetRolloffFactor float RolloffFactor
|
||||
--
|
||||
* ds3DGetPosition integer ID
|
||||
* ds3DSetPosition integer ID,float X,float Y,float Z
|
||||
* ds3DGetOrientation integer ID
|
||||
* ds3DSetOrientation integer ID, float X, float Y, float Z
|
||||
* ds3DGetVelocity integer ID
|
||||
* ds3DSetVelocity integer ID,float X,float Y,float Z
|
||||
* ds3DGetOutsideVolume integer ID
|
||||
* ds3DSetOutsideVolume integer ID, integer Volume
|
||||
* ds3DGetAngles integer ID
|
||||
* ds3DSetAngles integer ID, integer Inside, integer Outside
|
||||
* ds3DGetMaxDistance integer ID
|
||||
* ds3DSetMaxDistance integer ID, float MaxDistance
|
||||
* ds3DGetMinDistance integer ID
|
||||
* ds3DSetMinDistance integer ID, float MinDistance
|
||||
* dsClose
|
||||
|
||||
*/
|
||||
|
||||
namespace Director {
|
||||
|
||||
const char *const DirectsoundXtra::xlibName = "Directsound";
|
||||
const XlibFileDesc DirectsoundXtra::fileNames[] = {
|
||||
{ "directsound", nullptr },
|
||||
{ "Dsound_r", nullptr },
|
||||
{ nullptr, nullptr },
|
||||
};
|
||||
|
||||
static const MethodProto xlibMethods[] = {
|
||||
{ "new", DirectsoundXtra::m_new, 0, 0, 500 },
|
||||
{ nullptr, nullptr, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static const BuiltinProto xlibBuiltins[] = {
|
||||
{ "dsOpen", DirectsoundXtra::m_dsOpen, 0, 0, 500, HBLTIN },
|
||||
{ "dsNewSound", DirectsoundXtra::m_dsNewSound, 2, 2, 500, HBLTIN },
|
||||
{ "dsDelSound", DirectsoundXtra::m_dsDelSound, 1, 1, 500, HBLTIN },
|
||||
{ "dsDupSound", DirectsoundXtra::m_dsDupSound, 1, 1, 500, HBLTIN },
|
||||
{ "dsPlay", DirectsoundXtra::m_dsPlay, 1, 1, 500, HBLTIN },
|
||||
{ "dsStop", DirectsoundXtra::m_dsStop, 1, 1, 500, HBLTIN },
|
||||
{ "dsGetSize", DirectsoundXtra::m_dsGetSize, 1, 1, 500, HBLTIN },
|
||||
{ "dsGetFreq", DirectsoundXtra::m_dsGetFreq, 1, 1, 500, HBLTIN },
|
||||
{ "dsSetFreq", DirectsoundXtra::m_dsSetFreq, 2, 2, 500, HBLTIN },
|
||||
{ "dsGetVolume", DirectsoundXtra::m_dsGetVolume, 1, 1, 500, HBLTIN },
|
||||
{ "dsSetVolume", DirectsoundXtra::m_dsSetVolume, 2, 2, 500, HBLTIN },
|
||||
{ "dsGetPan", DirectsoundXtra::m_dsGetPan, 1, 1, 500, HBLTIN },
|
||||
{ "dsSetPan", DirectsoundXtra::m_dsSetPan, 2, 2, 500, HBLTIN },
|
||||
{ "dsGetPosition", DirectsoundXtra::m_dsGetPosition, 1, 1, 500, HBLTIN },
|
||||
{ "dsSetPosition", DirectsoundXtra::m_dsSetPosition, 2, 2, 500, HBLTIN },
|
||||
{ "dsGetLoop", DirectsoundXtra::m_dsGetLoop, 1, 1, 500, HBLTIN },
|
||||
{ "dsSetLoop", DirectsoundXtra::m_dsSetLoop, 2, 2, 500, HBLTIN },
|
||||
{ "dsIsPlaying", DirectsoundXtra::m_dsIsPlaying, 1, 1, 500, HBLTIN },
|
||||
{ "dsGetCaps", DirectsoundXtra::m_dsGetCaps, 0, 0, 500, HBLTIN },
|
||||
{ "ds3DOpen", DirectsoundXtra::m_ds3DOpen, 0, 0, 500, HBLTIN },
|
||||
{ "ds3DLGetPosition", DirectsoundXtra::m_ds3DLGetPosition, 0, 0, 500, HBLTIN },
|
||||
{ "ds3DLSetPosition", DirectsoundXtra::m_ds3DLSetPosition, 3, 3, 500, HBLTIN },
|
||||
{ "ds3DLGetOrientation", DirectsoundXtra::m_ds3DLGetOrientation, 0, 0, 500, HBLTIN },
|
||||
{ "ds3DLSetOrientation", DirectsoundXtra::m_ds3DLSetOrientation, 6, 6, 500, HBLTIN },
|
||||
{ "ds3DLGetVelocity", DirectsoundXtra::m_ds3DLGetVelocity, 0, 0, 500, HBLTIN },
|
||||
{ "ds3DLSetVelocity", DirectsoundXtra::m_ds3DLSetVelocity, 3, 3, 500, HBLTIN },
|
||||
{ "ds3DLGetDopplerFactor", DirectsoundXtra::m_ds3DLGetDopplerFactor, 0, 0, 500, HBLTIN },
|
||||
{ "ds3DLSetDopplerFactor", DirectsoundXtra::m_ds3DLSetDopplerFactor, 1, 1, 500, HBLTIN },
|
||||
{ "ds3DLGetRolloffFactor", DirectsoundXtra::m_ds3DLGetRolloffFactor, 0, 0, 500, HBLTIN },
|
||||
{ "ds3DLSetRolloffFactor", DirectsoundXtra::m_ds3DLSetRolloffFactor, 1, 1, 500, HBLTIN },
|
||||
{ "ds3DGetPosition", DirectsoundXtra::m_ds3DGetPosition, 1, 1, 500, HBLTIN },
|
||||
{ "ds3DSetPosition", DirectsoundXtra::m_ds3DSetPosition, 4, 4, 500, HBLTIN },
|
||||
{ "ds3DGetOrientation", DirectsoundXtra::m_ds3DGetOrientation, 1, 1, 500, HBLTIN },
|
||||
{ "ds3DSetOrientation", DirectsoundXtra::m_ds3DSetOrientation, 4, 4, 500, HBLTIN },
|
||||
{ "ds3DGetVelocity", DirectsoundXtra::m_ds3DGetVelocity, 1, 1, 500, HBLTIN },
|
||||
{ "ds3DSetVelocity", DirectsoundXtra::m_ds3DSetVelocity, 4, 4, 500, HBLTIN },
|
||||
{ "ds3DGetOutsideVolume", DirectsoundXtra::m_ds3DGetOutsideVolume, 1, 1, 500, HBLTIN },
|
||||
{ "ds3DSetOutsideVolume", DirectsoundXtra::m_ds3DSetOutsideVolume, 2, 2, 500, HBLTIN },
|
||||
{ "ds3DGetAngles", DirectsoundXtra::m_ds3DGetAngles, 1, 1, 500, HBLTIN },
|
||||
{ "ds3DSetAngles", DirectsoundXtra::m_ds3DSetAngles, 3, 3, 500, HBLTIN },
|
||||
{ "ds3DGetMaxDistance", DirectsoundXtra::m_ds3DGetMaxDistance, 1, 1, 500, HBLTIN },
|
||||
{ "ds3DSetMaxDistance", DirectsoundXtra::m_ds3DSetMaxDistance, 2, 2, 500, HBLTIN },
|
||||
{ "ds3DGetMinDistance", DirectsoundXtra::m_ds3DGetMinDistance, 1, 1, 500, HBLTIN },
|
||||
{ "ds3DSetMinDistance", DirectsoundXtra::m_ds3DSetMinDistance, 2, 2, 500, HBLTIN },
|
||||
{ "dsClose", DirectsoundXtra::m_dsClose, 0, 0, 500, HBLTIN },
|
||||
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
|
||||
};
|
||||
|
||||
DirectsoundXtraObject::DirectsoundXtraObject(ObjectType ObjectType) :Object<DirectsoundXtraObject>("Directsound") {
|
||||
_objType = ObjectType;
|
||||
}
|
||||
|
||||
bool DirectsoundXtraObject::hasProp(const Common::String &propName) {
|
||||
return (propName == "name");
|
||||
}
|
||||
|
||||
Datum DirectsoundXtraObject::getProp(const Common::String &propName) {
|
||||
if (propName == "name")
|
||||
return Datum(DirectsoundXtra::xlibName);
|
||||
warning("DirectsoundXtra::getProp: unknown property '%s'", propName.c_str());
|
||||
return Datum();
|
||||
}
|
||||
|
||||
void DirectsoundXtra::open(ObjectType type, const Common::Path &path) {
|
||||
DirectsoundXtraObject::initMethods(xlibMethods);
|
||||
DirectsoundXtraObject *xobj = new DirectsoundXtraObject(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 DirectsoundXtra::close(ObjectType type) {
|
||||
DirectsoundXtraObject::cleanupMethods();
|
||||
g_lingo->_globalvars[xlibName] = Datum();
|
||||
}
|
||||
|
||||
void DirectsoundXtra::m_new(int nargs) {
|
||||
ARGNUMCHECK(0);
|
||||
g_lingo->push(g_lingo->_state->me);
|
||||
}
|
||||
|
||||
void DirectsoundXtra::m_dsOpen(int nargs) {
|
||||
ARGNUMCHECK(0);
|
||||
g_lingo->push(1); // We are always open
|
||||
}
|
||||
|
||||
void DirectsoundXtra::m_dsNewSound(int nargs) {
|
||||
ARGNUMCHECK(2);
|
||||
|
||||
DirectsoundXtraObject *me = (DirectsoundXtraObject *)g_lingo->_globalvars[xlibName].u.obj;
|
||||
|
||||
DirectsoundXtraObject::DXSound newSound;
|
||||
newSound.parameter = g_lingo->pop().asInt();
|
||||
newSound.fname = g_lingo->pop().asString();
|
||||
|
||||
int newId = -1;
|
||||
|
||||
for (uint i = 0; i < me->_sounds.size(); i++) {
|
||||
if (me->_sounds[i].free) {
|
||||
newId = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (newId == -1) {
|
||||
newSound.channel = 1000 + me->_sounds.size();
|
||||
me->_sounds.push_back(newSound);
|
||||
newId = me->_sounds.size() - 1;
|
||||
} else {
|
||||
newSound.channel = me->_sounds[newId].channel; // Reuse sound channel
|
||||
me->_sounds[newId] = newSound;
|
||||
}
|
||||
|
||||
g_lingo->push(Common::String::format("DSoundXtra:%d", newId));
|
||||
}
|
||||
|
||||
static int parseId(Common::String id) {
|
||||
if (id.empty() || id.equals("0"))
|
||||
return -1;
|
||||
|
||||
if (!id.hasPrefix("DSoundXtra:")) {
|
||||
warning("DirectsoundXtra: Malformed sound reference: %s", id.c_str());
|
||||
return -1;
|
||||
}
|
||||
|
||||
return atoi(&id.c_str()[11]);
|
||||
}
|
||||
|
||||
void DirectsoundXtra::m_dsDelSound(int nargs) {
|
||||
ARGNUMCHECK(1);
|
||||
|
||||
DirectsoundXtraObject *me = (DirectsoundXtraObject *)g_lingo->_globalvars[xlibName].u.obj;
|
||||
int id = parseId(g_lingo->pop().asString());
|
||||
|
||||
if (id == -1)
|
||||
return;
|
||||
|
||||
DirectorSound *sound = g_director->getCurrentWindow()->getSoundManager();
|
||||
|
||||
if (me->_sounds[id].channel != -1)
|
||||
sound->stopSound(me->_sounds[id].channel);
|
||||
|
||||
me->_sounds[id].free = true;
|
||||
}
|
||||
|
||||
XOBJSTUB(DirectsoundXtra::m_dsDupSound, 0)
|
||||
|
||||
void DirectsoundXtra::m_dsPlay(int nargs) {
|
||||
ARGNUMCHECK(1);
|
||||
|
||||
DirectsoundXtraObject *me = (DirectsoundXtraObject *)g_lingo->_globalvars[xlibName].u.obj;
|
||||
int id = parseId(g_lingo->pop().asString());
|
||||
|
||||
if (id == -1)
|
||||
return;
|
||||
|
||||
DirectorSound *sound = g_director->getCurrentWindow()->getSoundManager();
|
||||
|
||||
if (me->_sounds[id].channel != -1)
|
||||
sound->playFile(me->_sounds[id].fname, me->_sounds[id].channel);
|
||||
}
|
||||
|
||||
XOBJSTUB(DirectsoundXtra::m_dsStop, 0)
|
||||
XOBJSTUB(DirectsoundXtra::m_dsGetSize, 0)
|
||||
XOBJSTUB(DirectsoundXtra::m_dsGetFreq, 0)
|
||||
XOBJSTUB(DirectsoundXtra::m_dsSetFreq, 0)
|
||||
XOBJSTUB(DirectsoundXtra::m_dsGetVolume, 0)
|
||||
|
||||
void DirectsoundXtra::m_dsSetVolume(int nargs) {
|
||||
ARGNUMCHECK(2);
|
||||
|
||||
DirectsoundXtraObject *me = (DirectsoundXtraObject *)g_lingo->_globalvars[xlibName].u.obj;
|
||||
int vol = g_lingo->pop().asInt();
|
||||
int id = parseId(g_lingo->pop().asString());
|
||||
|
||||
if (id == -1)
|
||||
return;
|
||||
|
||||
// original range is 0..-10000
|
||||
vol = (10000 + vol) * 256 / 10000;
|
||||
|
||||
DirectorSound *sound = g_director->getCurrentWindow()->getSoundManager();
|
||||
|
||||
if (me->_sounds[id].channel != -1)
|
||||
sound->setChannelVolume(me->_sounds[id].channel, vol);
|
||||
}
|
||||
|
||||
XOBJSTUB(DirectsoundXtra::m_dsGetPan, 0)
|
||||
XOBJSTUB(DirectsoundXtra::m_dsSetPan, 0)
|
||||
XOBJSTUB(DirectsoundXtra::m_dsGetPosition, 0)
|
||||
XOBJSTUB(DirectsoundXtra::m_dsSetPosition, 0)
|
||||
XOBJSTUB(DirectsoundXtra::m_dsGetLoop, 0)
|
||||
|
||||
void DirectsoundXtra::m_dsSetLoop(int nargs) {
|
||||
ARGNUMCHECK(2);
|
||||
|
||||
int loops = g_lingo->pop().asInt();
|
||||
int id = parseId(g_lingo->pop().asString());
|
||||
|
||||
if (id == -1)
|
||||
return;
|
||||
|
||||
if (loops > 1)
|
||||
warning("STUB: DirectsoundXtra::m_dsSetLoop(\"DSoundXtra:%d\", %d)", id, loops);
|
||||
}
|
||||
|
||||
void DirectsoundXtra::m_dsIsPlaying(int nargs) {
|
||||
ARGNUMCHECK(1);
|
||||
|
||||
DirectsoundXtraObject *me = (DirectsoundXtraObject *)g_lingo->_globalvars[xlibName].u.obj;
|
||||
int id = parseId(g_lingo->pop().asString());
|
||||
|
||||
if (id == -1) {
|
||||
g_lingo->push(0);
|
||||
return;
|
||||
}
|
||||
|
||||
DirectorSound *sound = g_director->getCurrentWindow()->getSoundManager();
|
||||
|
||||
if (me->_sounds[id].channel != -1)
|
||||
g_lingo->push(sound->isChannelActive(me->_sounds[id].channel) ? 1 : 0);
|
||||
else
|
||||
g_lingo->push(0);
|
||||
}
|
||||
|
||||
XOBJSTUB(DirectsoundXtra::m_dsGetCaps, 0)
|
||||
XOBJSTUB(DirectsoundXtra::m_ds3DOpen, 0)
|
||||
XOBJSTUB(DirectsoundXtra::m_ds3DLGetPosition, 0)
|
||||
XOBJSTUB(DirectsoundXtra::m_ds3DLSetPosition, 0)
|
||||
XOBJSTUB(DirectsoundXtra::m_ds3DLGetOrientation, 0)
|
||||
XOBJSTUB(DirectsoundXtra::m_ds3DLSetOrientation, 0)
|
||||
XOBJSTUB(DirectsoundXtra::m_ds3DLGetVelocity, 0)
|
||||
XOBJSTUB(DirectsoundXtra::m_ds3DLSetVelocity, 0)
|
||||
XOBJSTUB(DirectsoundXtra::m_ds3DLGetDopplerFactor, 0)
|
||||
XOBJSTUB(DirectsoundXtra::m_ds3DLSetDopplerFactor, 0)
|
||||
XOBJSTUB(DirectsoundXtra::m_ds3DLGetRolloffFactor, 0)
|
||||
XOBJSTUB(DirectsoundXtra::m_ds3DLSetRolloffFactor, 0)
|
||||
XOBJSTUB(DirectsoundXtra::m_ds3DGetPosition, 0)
|
||||
XOBJSTUB(DirectsoundXtra::m_ds3DSetPosition, 0)
|
||||
XOBJSTUB(DirectsoundXtra::m_ds3DGetOrientation, 0)
|
||||
XOBJSTUB(DirectsoundXtra::m_ds3DSetOrientation, 0)
|
||||
XOBJSTUB(DirectsoundXtra::m_ds3DGetVelocity, 0)
|
||||
XOBJSTUB(DirectsoundXtra::m_ds3DSetVelocity, 0)
|
||||
XOBJSTUB(DirectsoundXtra::m_ds3DGetOutsideVolume, 0)
|
||||
XOBJSTUB(DirectsoundXtra::m_ds3DSetOutsideVolume, 0)
|
||||
XOBJSTUB(DirectsoundXtra::m_ds3DGetAngles, 0)
|
||||
XOBJSTUB(DirectsoundXtra::m_ds3DSetAngles, 0)
|
||||
XOBJSTUB(DirectsoundXtra::m_ds3DGetMaxDistance, 0)
|
||||
XOBJSTUB(DirectsoundXtra::m_ds3DSetMaxDistance, 0)
|
||||
XOBJSTUB(DirectsoundXtra::m_ds3DGetMinDistance, 0)
|
||||
XOBJSTUB(DirectsoundXtra::m_ds3DSetMinDistance, 0)
|
||||
|
||||
void DirectsoundXtra::m_dsClose(int nargs) {
|
||||
ARGNUMCHECK(0);
|
||||
|
||||
DirectsoundXtraObject *me = (DirectsoundXtraObject *)g_lingo->_globalvars[xlibName].u.obj;
|
||||
DirectorSound *sound = g_director->getCurrentWindow()->getSoundManager();
|
||||
|
||||
for (uint i = 0; i < me->_sounds.size(); i++) {
|
||||
if (me->_sounds[i].channel != -1)
|
||||
sound->stopSound(me->_sounds[i].channel);
|
||||
|
||||
me->_sounds[i].free = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
104
engines/director/lingo/xtras/directsound.h
Normal file
104
engines/director/lingo/xtras/directsound.h
Normal file
@@ -0,0 +1,104 @@
|
||||
/* 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_XTRAS_DIRECTSOUND_H
|
||||
#define DIRECTOR_LINGO_XTRAS_DIRECTSOUND_H
|
||||
|
||||
namespace Director {
|
||||
|
||||
class DirectsoundXtraObject : public Object<DirectsoundXtraObject> {
|
||||
public:
|
||||
DirectsoundXtraObject(ObjectType objType);
|
||||
|
||||
bool hasProp(const Common::String &propName) override;
|
||||
Datum getProp(const Common::String &propName) override;
|
||||
|
||||
struct DXSound {
|
||||
Common::String fname;
|
||||
int parameter = -1;
|
||||
bool free = false;
|
||||
int channel = -1;
|
||||
bool loop = false;
|
||||
};
|
||||
|
||||
Common::Array<DXSound> _sounds;
|
||||
};
|
||||
|
||||
namespace DirectsoundXtra {
|
||||
|
||||
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_dsOpen(int nargs);
|
||||
void m_dsNewSound(int nargs);
|
||||
void m_dsDelSound(int nargs);
|
||||
void m_dsDupSound(int nargs);
|
||||
void m_dsPlay(int nargs);
|
||||
void m_dsStop(int nargs);
|
||||
void m_dsGetSize(int nargs);
|
||||
void m_dsGetFreq(int nargs);
|
||||
void m_dsSetFreq(int nargs);
|
||||
void m_dsGetVolume(int nargs);
|
||||
void m_dsSetVolume(int nargs);
|
||||
void m_dsGetPan(int nargs);
|
||||
void m_dsSetPan(int nargs);
|
||||
void m_dsGetPosition(int nargs);
|
||||
void m_dsSetPosition(int nargs);
|
||||
void m_dsGetLoop(int nargs);
|
||||
void m_dsSetLoop(int nargs);
|
||||
void m_dsIsPlaying(int nargs);
|
||||
void m_dsGetCaps(int nargs);
|
||||
void m_ds3DOpen(int nargs);
|
||||
void m_ds3DLGetPosition(int nargs);
|
||||
void m_ds3DLSetPosition(int nargs);
|
||||
void m_ds3DLGetOrientation(int nargs);
|
||||
void m_ds3DLSetOrientation(int nargs);
|
||||
void m_ds3DLGetVelocity(int nargs);
|
||||
void m_ds3DLSetVelocity(int nargs);
|
||||
void m_ds3DLGetDopplerFactor(int nargs);
|
||||
void m_ds3DLSetDopplerFactor(int nargs);
|
||||
void m_ds3DLGetRolloffFactor(int nargs);
|
||||
void m_ds3DLSetRolloffFactor(int nargs);
|
||||
void m_ds3DGetPosition(int nargs);
|
||||
void m_ds3DSetPosition(int nargs);
|
||||
void m_ds3DGetOrientation(int nargs);
|
||||
void m_ds3DSetOrientation(int nargs);
|
||||
void m_ds3DGetVelocity(int nargs);
|
||||
void m_ds3DSetVelocity(int nargs);
|
||||
void m_ds3DGetOutsideVolume(int nargs);
|
||||
void m_ds3DSetOutsideVolume(int nargs);
|
||||
void m_ds3DGetAngles(int nargs);
|
||||
void m_ds3DSetAngles(int nargs);
|
||||
void m_ds3DGetMaxDistance(int nargs);
|
||||
void m_ds3DSetMaxDistance(int nargs);
|
||||
void m_ds3DGetMinDistance(int nargs);
|
||||
void m_ds3DSetMinDistance(int nargs);
|
||||
void m_dsClose(int nargs);
|
||||
|
||||
} // End of namespace DirectsoundXtra
|
||||
|
||||
} // End of namespace Director
|
||||
|
||||
#endif
|
||||
164
engines/director/lingo/xtras/filextra.cpp
Normal file
164
engines/director/lingo/xtras/filextra.cpp
Normal file
@@ -0,0 +1,164 @@
|
||||
/* 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/xtras/filextra.h"
|
||||
|
||||
/**************************************************
|
||||
*
|
||||
* USED IN:
|
||||
* I Spy
|
||||
*
|
||||
**************************************************/
|
||||
|
||||
/*
|
||||
-- xtra FileXtra
|
||||
-- FileXtra v2.0.4 of 18-Apr-97 by Kent Kersten
|
||||
-- Copyright (c) 1996-97 Little Planet Publishing
|
||||
-- For updates see http://www.littleplanet.com/kent/kent.html
|
||||
-- Contact the author at kent@littleplanet.com
|
||||
-- This no-charge Xtra may be freely distributed as long as it is
|
||||
-- accompanied by its documentation and sample movie.
|
||||
--
|
||||
-- Drive Functions --
|
||||
* DriveExists string driveName
|
||||
* DrivesToList
|
||||
* DriveFreeSpace string driveName
|
||||
* DriveIsCDROM string driveName
|
||||
--
|
||||
-- File Functions --
|
||||
* FileOpenDialog string initialDir, string filtStr, string dlogTitle, Boolean createPrompt, Boolean fileMustExist
|
||||
* FileSaveAsDialog string initialDir, string filename, string dlogTitle, Boolean overwritePrompt
|
||||
* FileExists string fileName
|
||||
* RenameFile string oldName, string newName
|
||||
* DeleteFile string fileName
|
||||
* CopyFile string fromFName, string toFName
|
||||
* GetFileModDate string fileName
|
||||
--
|
||||
-- Directory Functions --
|
||||
* DirectoryExists string dirName
|
||||
* CreateDirectory string dirName
|
||||
* DeleteDirectory string dirName
|
||||
* XDeleteDirectory string dirName
|
||||
* CopyDirectory string fromDirName, string toDirName
|
||||
* XCopyDirectory string fromDirName, string toDirName
|
||||
* DirectoryToList string dirName
|
||||
|
||||
*/
|
||||
|
||||
namespace Director {
|
||||
|
||||
const char *FileXtra::xlibName = "File";
|
||||
const XlibFileDesc FileXtra::fileNames[] = {
|
||||
{ "filextra", nullptr },
|
||||
{ nullptr, nullptr },
|
||||
};
|
||||
|
||||
static MethodProto xlibMethods[] = {
|
||||
|
||||
{ nullptr, nullptr, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static BuiltinProto xlibBuiltins[] = {
|
||||
{ "DriveExists", FileXtra::m_DriveExists, 1, 1, 500, HBLTIN },
|
||||
{ "DrivesToList", FileXtra::m_DrivesToList, 0, 0, 500, HBLTIN },
|
||||
{ "DriveFreeSpace", FileXtra::m_DriveFreeSpace, 1, 1, 500, HBLTIN },
|
||||
{ "DriveIsCDROM", FileXtra::m_DriveIsCDROM, 1, 1, 500, HBLTIN },
|
||||
{ "FileOpenDialog", FileXtra::m_FileOpenDialog, 5, 5, 500, HBLTIN },
|
||||
{ "FileSaveAsDialog", FileXtra::m_FileSaveAsDialog, 4, 4, 500, HBLTIN },
|
||||
{ "FileExists", FileXtra::m_FileExists, 1, 1, 500, HBLTIN },
|
||||
{ "RenameFile", FileXtra::m_RenameFile, 2, 2, 500, HBLTIN },
|
||||
{ "DeleteFile", FileXtra::m_DeleteFile, 1, 1, 500, HBLTIN },
|
||||
{ "CopyFile", FileXtra::m_CopyFile, 2, 2, 500, HBLTIN },
|
||||
{ "GetFileModDate", FileXtra::m_GetFileModDate, 1, 1, 500, HBLTIN },
|
||||
{ "DirectoryExists", FileXtra::m_DirectoryExists, 1, 1, 500, HBLTIN },
|
||||
{ "CreateDirectory", FileXtra::m_CreateDirectory, 1, 1, 500, HBLTIN },
|
||||
{ "DeleteDirectory", FileXtra::m_DeleteDirectory, 1, 1, 500, HBLTIN },
|
||||
{ "XDeleteDirectory", FileXtra::m_XDeleteDirectory, 1, 1, 500, HBLTIN },
|
||||
{ "CopyDirectory", FileXtra::m_CopyDirectory, 2, 2, 500, HBLTIN },
|
||||
{ "XCopyDirectory", FileXtra::m_XCopyDirectory, 2, 2, 500, HBLTIN },
|
||||
{ "DirectoryToList", FileXtra::m_DirectoryToList, 1, 1, 500, HBLTIN },
|
||||
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
|
||||
};
|
||||
|
||||
FileXtraObject::FileXtraObject(ObjectType ObjectType) :Object<FileXtraObject>("File") {
|
||||
_objType = ObjectType;
|
||||
}
|
||||
|
||||
bool FileXtraObject::hasProp(const Common::String &propName) {
|
||||
return (propName == "name");
|
||||
}
|
||||
|
||||
Datum FileXtraObject::getProp(const Common::String &propName) {
|
||||
if (propName == "name")
|
||||
return Datum(FileXtra::xlibName);
|
||||
warning("FileXtra::getProp: unknown property '%s'", propName.c_str());
|
||||
return Datum();
|
||||
}
|
||||
|
||||
void FileXtra::open(ObjectType type, const Common::Path &path) {
|
||||
FileXtraObject::initMethods(xlibMethods);
|
||||
FileXtraObject *xobj = new FileXtraObject(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 FileXtra::close(ObjectType type) {
|
||||
FileXtraObject::cleanupMethods();
|
||||
g_lingo->_globalvars[xlibName] = Datum();
|
||||
|
||||
}
|
||||
|
||||
void FileXtra::m_new(int nargs) {
|
||||
g_lingo->printSTUBWithArglist("FileXtra::m_new", nargs);
|
||||
g_lingo->dropStack(nargs);
|
||||
g_lingo->push(g_lingo->_state->me);
|
||||
}
|
||||
|
||||
XOBJSTUB(FileXtra::m_DriveExists, 0)
|
||||
XOBJSTUB(FileXtra::m_DrivesToList, 0)
|
||||
XOBJSTUB(FileXtra::m_DriveFreeSpace, 0)
|
||||
XOBJSTUB(FileXtra::m_DriveIsCDROM, 0)
|
||||
XOBJSTUB(FileXtra::m_FileOpenDialog, 0)
|
||||
XOBJSTUB(FileXtra::m_FileSaveAsDialog, 0)
|
||||
XOBJSTUB(FileXtra::m_FileExists, 0)
|
||||
XOBJSTUB(FileXtra::m_RenameFile, 0)
|
||||
XOBJSTUB(FileXtra::m_DeleteFile, 0)
|
||||
XOBJSTUB(FileXtra::m_CopyFile, 0)
|
||||
XOBJSTUB(FileXtra::m_GetFileModDate, 0)
|
||||
XOBJSTUB(FileXtra::m_DirectoryExists, 0)
|
||||
XOBJSTUB(FileXtra::m_CreateDirectory, 0)
|
||||
XOBJSTUB(FileXtra::m_DeleteDirectory, 0)
|
||||
XOBJSTUB(FileXtra::m_XDeleteDirectory, 0)
|
||||
XOBJSTUB(FileXtra::m_CopyDirectory, 0)
|
||||
XOBJSTUB(FileXtra::m_XCopyDirectory, 0)
|
||||
XOBJSTUB(FileXtra::m_DirectoryToList, 0)
|
||||
|
||||
}
|
||||
68
engines/director/lingo/xtras/filextra.h
Normal file
68
engines/director/lingo/xtras/filextra.h
Normal file
@@ -0,0 +1,68 @@
|
||||
/* 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_XTRAS_FILEXTRA_H
|
||||
#define DIRECTOR_LINGO_XTRAS_FILEXTRA_H
|
||||
|
||||
namespace Director {
|
||||
|
||||
class FileXtraObject : public Object<FileXtraObject> {
|
||||
public:
|
||||
FileXtraObject(ObjectType objType);
|
||||
|
||||
bool hasProp(const Common::String &propName) override;
|
||||
Datum getProp(const Common::String &propName) override;
|
||||
};
|
||||
|
||||
namespace FileXtra {
|
||||
|
||||
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_DriveExists(int nargs);
|
||||
void m_DrivesToList(int nargs);
|
||||
void m_DriveFreeSpace(int nargs);
|
||||
void m_DriveIsCDROM(int nargs);
|
||||
void m_FileOpenDialog(int nargs);
|
||||
void m_FileSaveAsDialog(int nargs);
|
||||
void m_FileExists(int nargs);
|
||||
void m_RenameFile(int nargs);
|
||||
void m_DeleteFile(int nargs);
|
||||
void m_CopyFile(int nargs);
|
||||
void m_GetFileModDate(int nargs);
|
||||
void m_DirectoryExists(int nargs);
|
||||
void m_CreateDirectory(int nargs);
|
||||
void m_DeleteDirectory(int nargs);
|
||||
void m_XDeleteDirectory(int nargs);
|
||||
void m_CopyDirectory(int nargs);
|
||||
void m_XCopyDirectory(int nargs);
|
||||
void m_DirectoryToList(int nargs);
|
||||
|
||||
} // End of namespace FileXtra
|
||||
|
||||
} // End of namespace Director
|
||||
|
||||
#endif
|
||||
137
engines/director/lingo/xtras/keypoll.cpp
Normal file
137
engines/director/lingo/xtras/keypoll.cpp
Normal file
@@ -0,0 +1,137 @@
|
||||
/* 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/xtras/keypoll.h"
|
||||
|
||||
/**************************************************
|
||||
*
|
||||
* USED IN:
|
||||
* Safecracker
|
||||
* Teazle
|
||||
*
|
||||
**************************************************/
|
||||
|
||||
/*
|
||||
-- -- KeyPoll Xtra
|
||||
-- by Brian Gray
|
||||
-- (c) 1996 Macromedia, Inc. All Rights Reserved.
|
||||
|
||||
xtra KeyPoll
|
||||
new object me
|
||||
|
||||
-- KeyPoll handlers --
|
||||
* bgOneKey integer keyCode -- returns TRUE if key (argument) is down, else FALSE
|
||||
* bgAllKeys -- returns a linear list of the keycodes of every key currently down
|
||||
|
||||
*/
|
||||
|
||||
namespace Director {
|
||||
|
||||
const char *const KeypollXtra::xlibName = "Keypoll";
|
||||
const XlibFileDesc KeypollXtra::fileNames[] = {
|
||||
{ "keypoll", nullptr },
|
||||
{ "KeyPollFat", nullptr },
|
||||
{ nullptr, nullptr },
|
||||
};
|
||||
|
||||
static const MethodProto xlibMethods[] = {
|
||||
{ "xtra", KeypollXtra::m_xtra, 0, 0, 500 },
|
||||
{ "new", KeypollXtra::m_new, 0, 0, 500 },
|
||||
{ nullptr, nullptr, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static const BuiltinProto xlibBuiltins[] = {
|
||||
{ "bgOneKey", KeypollXtra::m_bgOneKey, 1, 1, 500, HBLTIN },
|
||||
{ "bgAllKeys", KeypollXtra::m_bgAllKeys, 0, 0, 500, HBLTIN },
|
||||
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
|
||||
};
|
||||
|
||||
KeypollXtraObject::KeypollXtraObject(ObjectType ObjectType) :Object<KeypollXtraObject>("Keypoll") {
|
||||
_objType = ObjectType;
|
||||
}
|
||||
|
||||
bool KeypollXtraObject::hasProp(const Common::String &propName) {
|
||||
return (propName == "name");
|
||||
}
|
||||
|
||||
Datum KeypollXtraObject::getProp(const Common::String &propName) {
|
||||
if (propName == "name")
|
||||
return Datum(KeypollXtra::xlibName);
|
||||
warning("KeypollXtra::getProp: unknown property '%s'", propName.c_str());
|
||||
return Datum();
|
||||
}
|
||||
|
||||
void KeypollXtra::open(ObjectType type, const Common::Path &path) {
|
||||
KeypollXtraObject::initMethods(xlibMethods);
|
||||
KeypollXtraObject *xobj = new KeypollXtraObject(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 KeypollXtra::close(ObjectType type) {
|
||||
KeypollXtraObject::cleanupMethods();
|
||||
g_lingo->_globalvars[xlibName] = Datum();
|
||||
|
||||
}
|
||||
|
||||
void KeypollXtra::m_new(int nargs) {
|
||||
g_lingo->printSTUBWithArglist("KeypollXtra::m_new", nargs);
|
||||
g_lingo->dropStack(nargs);
|
||||
g_lingo->push(g_lingo->_state->me);
|
||||
}
|
||||
|
||||
XOBJSTUB(KeypollXtra::m_xtra, 0)
|
||||
|
||||
void KeypollXtra::m_bgOneKey(int nargs) {
|
||||
ARGNUMCHECK(1);
|
||||
|
||||
Common::Event event;
|
||||
|
||||
int requestedKey = g_lingo->pop().asInt();
|
||||
|
||||
while (g_system->getEventManager()->pollEvent(event)) {
|
||||
switch (event.type) {
|
||||
case Common::EVENT_KEYDOWN:
|
||||
if (event.kbd.keycode == requestedKey) {
|
||||
g_lingo->push(1);
|
||||
return;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
g_lingo->push(0);
|
||||
}
|
||||
|
||||
XOBJSTUB(KeypollXtra::m_bgAllKeys, 0)
|
||||
|
||||
}
|
||||
52
engines/director/lingo/xtras/keypoll.h
Normal file
52
engines/director/lingo/xtras/keypoll.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_XTRAS_KEYPOLL_H
|
||||
#define DIRECTOR_LINGO_XTRAS_KEYPOLL_H
|
||||
|
||||
namespace Director {
|
||||
|
||||
class KeypollXtraObject : public Object<KeypollXtraObject> {
|
||||
public:
|
||||
KeypollXtraObject(ObjectType objType);
|
||||
|
||||
bool hasProp(const Common::String &propName) override;
|
||||
Datum getProp(const Common::String &propName) override;
|
||||
};
|
||||
|
||||
namespace KeypollXtra {
|
||||
|
||||
extern const char *const xlibName;
|
||||
extern const XlibFileDesc fileNames[];
|
||||
|
||||
void open(ObjectType type, const Common::Path &path);
|
||||
void close(ObjectType type);
|
||||
|
||||
void m_xtra(int nargs);
|
||||
void m_new(int nargs);
|
||||
void m_bgOneKey(int nargs);
|
||||
void m_bgAllKeys(int nargs);
|
||||
|
||||
} // End of namespace KeypollXtra
|
||||
|
||||
} // End of namespace Director
|
||||
|
||||
#endif
|
||||
216
engines/director/lingo/xtras/m/mui.cpp
Normal file
216
engines/director/lingo/xtras/m/mui.cpp
Normal file
@@ -0,0 +1,216 @@
|
||||
/* 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/xtras/m/mui.h"
|
||||
|
||||
/**************************************************
|
||||
*
|
||||
* USED IN:
|
||||
* I Spy Spooky Mansion
|
||||
*
|
||||
**************************************************/
|
||||
|
||||
/*
|
||||
-- xtra Mui
|
||||
-- methods are Initialize, Run, WindowOperation, ItemUpdate --
|
||||
----------------------------------------------------------------------
|
||||
-- Data types (prop lists required formats)
|
||||
-- #widgetTypes -- call GetWidgetList on object for complete list
|
||||
-- #checkBox , #radioButton, #editText, #editTextLarge, #labelNormal, etc
|
||||
-- #attributeTypes -- varies depending on the type of widget, contains 0 or more of the following
|
||||
-- #textSize : [#large, #tiny, #normal(default)]
|
||||
-- #textStyle : [#bold, #italic, #underline, #plain (default), #inverse (v2)
|
||||
-- #textAlign : [#left, #right, #center (defaults to system language standard)
|
||||
-- #popupStyle : [#tiny, #cramped, #normal (default)
|
||||
-- #valueList : ['one', #two, 3, 4.0] (list of mmvalues, all coerced to strings)
|
||||
-- #valueRange : [#min:0.0, #max:1000.0, #increment:1.0, #jump:10.0, #acceleration:0.5]
|
||||
-- #sliderStyle : [#ticks, #value]
|
||||
-- #layoutStyle : [#lockPosition, #lockSize, #minimize, #centerH, #right, #left, #centerV, #top, #bottom ]
|
||||
-- according to the following breakdown of supported widgets and appropriate attributes
|
||||
-- #widgetTypes | vs | UT | Attributes to use, UT = Uses Title
|
||||
-- #none, | 1.0 | No | <layoutStyle>
|
||||
-- #dividerV, | 1.0 | No | <layoutStyle>
|
||||
-- #dividerH, | 1.0 | No | <layoutStyle>
|
||||
-- #bitmap, | 1.0 | No | <layoutStyle>
|
||||
-- #checkBox, | 1.0 | Yes| <textSize><layoutStyle>
|
||||
-- #radioButton, | 1.0 | Yes| <textSize><layoutStyle>
|
||||
-- #popupList, | 1.0 | No | <popupStyle><valueList><layoutStyle>
|
||||
-- #editText, | 1.0 | No | <textSize><justification><textStyle><layoutStyle>
|
||||
-- #windowBegin, | 1.0 | No |
|
||||
-- #windowEnd, | 1.0 | No |
|
||||
-- #groupHBegin, | 1.0 | No |
|
||||
-- #groupHEnd, | 1.0 | No |
|
||||
-- #groupVBegin, | 1.0 | No |
|
||||
-- #groupVEnd, | 1.0 | No |
|
||||
-- #label, | 1.0 | No | <textSize><justification><textStyle><layoutStyle>
|
||||
-- #IntegerSliderH, | 1.0 | No | <sliderStyle><valueRange><layoutStyle>
|
||||
-- #floatSliderH, | 1.0 | No | <sliderStyle><valueRange><layoutStyle>
|
||||
-- #defaultPushButton, | 1.0 | Yes| <textSize><layoutStyle>
|
||||
-- #cancelPushButton, | 1.0 | Yes| <textSize><layoutStyle>
|
||||
-- #pushButton, | 1.0 | Yes| <textSize><layoutStyle>
|
||||
-- #toggleButton, | 1.0 | Yes| <textSize><layoutStyle>
|
||||
--
|
||||
-- alertList =
|
||||
-- [ #buttons : <#Ok/#OkCancel/#AbortRetryIgnore/#YesNoCancel/#YesNo/#RetryCancel>,
|
||||
-- #default : 1, -- button number to default, 0 for no default
|
||||
-- #title : 'Unsaved File Alert',
|
||||
-- #message : 'Save before quitting?',
|
||||
-- #icon : <#stop/#note/#caution/#question/#error>,
|
||||
-- #movable : <TRUE/FALSE>]
|
||||
-- itemPropList =
|
||||
-- [ #value : <1 or 1.1 or 'string'>,
|
||||
-- #type : <#widgetType>,
|
||||
-- #attributes : #attributeTypes,
|
||||
-- #title : <'title'>, -- title to display for item, '' for no title
|
||||
-- #tip : <'tooltip'>, -- tip for item, '' for no tip
|
||||
-- #locH : <10>, -- in pixels from upper left, 0 to accept default
|
||||
-- #locV : <10> -- in pixels from upper left, 0 to accept default
|
||||
-- #width : <16>, -- in pixels, 0 if don't care
|
||||
-- #height : <16>, -- in pixels, 0 if don't care
|
||||
-- #enabled : <TRUE or FALSE> -- whether or not the item is enabled ]
|
||||
-- #windowItemList = [ itemPropList, itemPropList, ...]
|
||||
-- #windowPropList =
|
||||
-- [ #type : <#alert/#normal/#palette>,
|
||||
-- #name : 'windowName', -- name of window, '' for no name
|
||||
-- #callback : 'nothing', -- callback interface
|
||||
-- #mode : <#data/#dialogUnit/#pixel>, -- autolayout or your specifications
|
||||
-- #XPosition : <16>, -- left of window, from left of dialog, -1 = Center
|
||||
-- #YPosition : <16>; -- top of window, from top of dialog, -1 = Center
|
||||
-- #width : <200>; -- pixel width of window, 0 if don't care/automatic
|
||||
-- #height : <200>, -- pixel height of window, 0 if don't care/automatic
|
||||
-- #modal : <TRUE or FALSE>, -- whether or not dialog is modal
|
||||
-- #toolTips : <TRUE or FALSE>, -- whether or not to INITIALLY use tooltips
|
||||
-- #closeBox : <TRUE or FALSE>, -- whether or not dialog has close box
|
||||
-- #canZoom : <TRUE or FALSE>; -- whether or not window zooms
|
||||
-- initPropList = [ #windowPropList : [], #windowItemList : [] ]
|
||||
-- When an event occurs in dialog, the callback is called with 3 params, 1st a callback event symbol,
|
||||
-- callbackEvents = #itemChanged/#itemClicked/#windowOpening/#windowClosed/#windowZoomed/#windowResized
|
||||
-- #itemEnteringFocus/#itemLosingFocus
|
||||
-- second, event specific information. (e.g.item events will return item position in #windowItemList), and
|
||||
-- third, the new item proplist for the item that was effected.
|
||||
----------------------------------------------------------------------
|
||||
New object me -- call this first to access object methods
|
||||
Initialize object me, object initPropList -- call this to setup window items
|
||||
Run object me -- shows window
|
||||
Stop object me, integer stopItem -- stops window, stopitem will be passed to callback if specified
|
||||
WindowOperation object me, symbol operation -- #hide, #show, #center, #zoom, #tipsOn, #tipsOff
|
||||
ItemUpdate object me, integer itemNumber, object itemInputPropList -- update an item
|
||||
GetWindowPropList object me -- returns a property list in the standard format for initing window
|
||||
GetItemPropList object me -- returns a default itemPropList
|
||||
GetWidgetList object me -- returns a linear list of current supported widget symbols
|
||||
Alert object me, object alertList -- display an alert
|
||||
GetUrl object me, string url, boolean movable -- puts up url entry dialog
|
||||
FileOpen object me, string file -- puts up a system standard dialog for opening a file
|
||||
FileSave object me, string file, string prompt -- puts up system dialog for saving a file.
|
||||
*MoaErrorToString integer MoaError -- xtra returns a big neg. int, call and get a string explaining.
|
||||
|
||||
*/
|
||||
|
||||
namespace Director {
|
||||
|
||||
const char *MuiXtra::xlibName = "Mui";
|
||||
const XlibFileDesc MuiXtra::fileNames[] = {
|
||||
{ "mui", nullptr },
|
||||
{ "Mui Dialog", nullptr },
|
||||
{ nullptr, nullptr },
|
||||
};
|
||||
|
||||
static MethodProto xlibMethods[] = {
|
||||
{ "New", MuiXtra::m_New, 0, 0, 500 },
|
||||
{ "Initialize", MuiXtra::m_Initialize, 1, 0, 500 },
|
||||
{ "Run", MuiXtra::m_Run, 0, 0, 500 },
|
||||
{ "Stop", MuiXtra::m_Stop, 1, 0, 500 },
|
||||
{ "WindowOperation", MuiXtra::m_WindowOperation, 1, 0, 500 },
|
||||
{ "ItemUpdate", MuiXtra::m_ItemUpdate, 2, 0, 500 },
|
||||
{ "GetWindowPropList", MuiXtra::m_GetWindowPropList, 0, 0, 500 },
|
||||
{ "GetItemPropList", MuiXtra::m_GetItemPropList, 0, 0, 500 },
|
||||
{ "GetWidgetList", MuiXtra::m_GetWidgetList, 0, 0, 500 },
|
||||
{ "Alert", MuiXtra::m_Alert, 1, 0, 500 },
|
||||
{ "GetUrl", MuiXtra::m_GetUrl, 2, 0, 500 },
|
||||
{ "FileOpen", MuiXtra::m_FileOpen, 1, 0, 500 },
|
||||
{ "FileSave", MuiXtra::m_FileSave, 2, 0, 500 },
|
||||
{ nullptr, nullptr, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static BuiltinProto xlibBuiltins[] = {
|
||||
{ "MoaErrorToString", MuiXtra::m_MoaErrorToString, 1, 1, 500, HBLTIN },
|
||||
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
|
||||
};
|
||||
|
||||
MuiXtraObject::MuiXtraObject(ObjectType ObjectType) :Object<MuiXtraObject>("Mui") {
|
||||
_objType = ObjectType;
|
||||
}
|
||||
|
||||
bool MuiXtraObject::hasProp(const Common::String &propName) {
|
||||
return (propName == "name");
|
||||
}
|
||||
|
||||
Datum MuiXtraObject::getProp(const Common::String &propName) {
|
||||
if (propName == "name")
|
||||
return Datum(MuiXtra::xlibName);
|
||||
warning("MuiXtra::getProp: unknown property '%s'", propName.c_str());
|
||||
return Datum();
|
||||
}
|
||||
|
||||
void MuiXtra::open(ObjectType type, const Common::Path &path) {
|
||||
MuiXtraObject::initMethods(xlibMethods);
|
||||
MuiXtraObject *xobj = new MuiXtraObject(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 MuiXtra::close(ObjectType type) {
|
||||
MuiXtraObject::cleanupMethods();
|
||||
g_lingo->_globalvars[xlibName] = Datum();
|
||||
|
||||
}
|
||||
|
||||
void MuiXtra::m_New(int nargs) {
|
||||
g_lingo->printSTUBWithArglist("MuiXtra::m_New", nargs);
|
||||
g_lingo->dropStack(nargs);
|
||||
g_lingo->push(g_lingo->_state->me);
|
||||
}
|
||||
|
||||
XOBJSTUB(MuiXtra::m_Initialize, 0)
|
||||
XOBJSTUB(MuiXtra::m_Run, 0)
|
||||
XOBJSTUB(MuiXtra::m_Stop, 0)
|
||||
XOBJSTUB(MuiXtra::m_WindowOperation, 0)
|
||||
XOBJSTUB(MuiXtra::m_ItemUpdate, 0)
|
||||
XOBJSTUB(MuiXtra::m_GetWindowPropList, 0)
|
||||
XOBJSTUB(MuiXtra::m_GetItemPropList, 0)
|
||||
XOBJSTUB(MuiXtra::m_GetWidgetList, 0)
|
||||
XOBJSTUB(MuiXtra::m_Alert, 0)
|
||||
XOBJSTUB(MuiXtra::m_GetUrl, 0)
|
||||
XOBJSTUB(MuiXtra::m_FileOpen, 0)
|
||||
XOBJSTUB(MuiXtra::m_FileSave, 0)
|
||||
XOBJSTUB(MuiXtra::m_MoaErrorToString, 0)
|
||||
|
||||
}
|
||||
62
engines/director/lingo/xtras/m/mui.h
Normal file
62
engines/director/lingo/xtras/m/mui.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_XTRAS_M_MUI_H
|
||||
#define DIRECTOR_LINGO_XTRAS_M_MUI_H
|
||||
|
||||
namespace Director {
|
||||
|
||||
class MuiXtraObject : public Object<MuiXtraObject> {
|
||||
public:
|
||||
MuiXtraObject(ObjectType objType);
|
||||
|
||||
bool hasProp(const Common::String &propName) override;
|
||||
Datum getProp(const Common::String &propName) override;
|
||||
};
|
||||
|
||||
namespace MuiXtra {
|
||||
|
||||
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_Initialize(int nargs);
|
||||
void m_Run(int nargs);
|
||||
void m_Stop(int nargs);
|
||||
void m_WindowOperation(int nargs);
|
||||
void m_ItemUpdate(int nargs);
|
||||
void m_GetWindowPropList(int nargs);
|
||||
void m_GetItemPropList(int nargs);
|
||||
void m_GetWidgetList(int nargs);
|
||||
void m_Alert(int nargs);
|
||||
void m_GetUrl(int nargs);
|
||||
void m_FileOpen(int nargs);
|
||||
void m_FileSave(int nargs);
|
||||
void m_MoaErrorToString(int nargs);
|
||||
|
||||
} // End of namespace MuiXtra
|
||||
|
||||
} // End of namespace Director
|
||||
|
||||
#endif
|
||||
682
engines/director/lingo/xtras/masterapp.cpp
Normal file
682
engines/director/lingo/xtras/masterapp.cpp
Normal file
@@ -0,0 +1,682 @@
|
||||
/* 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/xtras/masterapp.h"
|
||||
|
||||
/**************************************************
|
||||
*
|
||||
* USED IN:
|
||||
* puppetmotel
|
||||
*
|
||||
**************************************************/
|
||||
|
||||
/*
|
||||
-- xtra MasterApp
|
||||
-- MasterApp Xtra
|
||||
-- Copyright © 1996-1998 Glenn M. Picher, Dirigo Multimedia
|
||||
--
|
||||
-- Published and supported by:
|
||||
--
|
||||
-- updateStage
|
||||
-- 1341 Mass Ave., Suite 124
|
||||
-- Arlington, MA USA 02174
|
||||
-- Web: http://www.updatestage.com
|
||||
-- Email: sales@updatestage.com, support@updatestage.com
|
||||
-- Voice: 781-641-6043
|
||||
-- Fax: 781-641-7068
|
||||
-- Email/phone/fax support hours: 10AM - 6PM US EST
|
||||
--
|
||||
--
|
||||
-- Developed by:
|
||||
--
|
||||
-- Glenn M. Picher
|
||||
-- Dirigo Multimedia
|
||||
-- 50 Market St., Suite 1A-338
|
||||
-- South Portland, ME USA 04106
|
||||
-- Web: http://www.maine.com/shops/gpicher
|
||||
-- Email: gpicher@maine.com
|
||||
-- Voice: 207-767-8015
|
||||
-- Fax: 207-767-1018
|
||||
--
|
||||
-- Registered 32-bit version, April 22, 1998, v1.0.0.37
|
||||
--
|
||||
new object me
|
||||
-- Note: since the MasterApp Xtra only uses global handlers, there is no need
|
||||
-- to create a child object. Just use the handlers listed below.
|
||||
--
|
||||
+ register object xtraReference, string serialNumber
|
||||
-- Note: you only get one chance per Director session to enter this correctly.
|
||||
-- There will be a beep and a five second delay if you get the serial number wrong.
|
||||
-- Subsequent attempts to register will have no effect, until restarting Director.
|
||||
--
|
||||
-- Note: check the return values of all handlers for a string with word 1 'Error:' !
|
||||
--
|
||||
-- TASK FUNCTIONS
|
||||
-- --------------
|
||||
* mappGetTaskList
|
||||
-- Returns a string listing of all currently running tasks, one per line,
|
||||
-- with the following info on each line, separated by commas:
|
||||
-- taskName, taskID, parentTaskID, instanceID, moduleID
|
||||
-- Note: the .x32 and Mac versions use the same numbers for taskID, instanceID,
|
||||
-- and moduleID. Under Windows NT with the .x32 version, parentTaskID is always 0.
|
||||
-- Note that Win32 sometimes reuses taskIDs; verify the taskName is still the same!
|
||||
* mappGetTaskIDs
|
||||
-- Get taskIDs for all running tasks, separated by ' '. Use 'word' to examine results.
|
||||
* mappTaskName integer taskID
|
||||
* mappTaskParent integer taskID
|
||||
* mappTaskInstance integer taskID
|
||||
* mappTaskModule integer taskID
|
||||
* mappTaskEvents integer taskID --Applies to Win 3.1 only; on Win95/NT, always returns '0'.
|
||||
* mappGetTaskWindowList integer taskID
|
||||
-- Gets a listing of all windows belonging to this taskID, in the form:
|
||||
-- windowName, windowID, parentWindowID, hasChildren, windowType
|
||||
* mappGetTaskWindowIDs integer taskID
|
||||
* mappGetWindowTask integer windowID
|
||||
* mappRudeQuitTask integer taskID, integer exitValue
|
||||
-- Rude way of quitting a program. Using mappCloseWindow is better! Returns
|
||||
-- 0 if the program's already quit, -4 if it's still running. It's not unusual
|
||||
-- to see -4 as a result. On Win32, -4 is *always* the result.
|
||||
* mappTaskIsRunning integer taskID
|
||||
* mappFeedTimeSlice integer taskID
|
||||
-- Note: on Win32, the taskID is ignored; has same effect as a generic time slice.
|
||||
* mappFeedGenericTimeSlice
|
||||
* mappHostAppTask
|
||||
-- Returns the taskID for this Xtra's host application.
|
||||
* mappDirectorTask
|
||||
* mappAuthorwareTask
|
||||
-- Synonyms for mappHostAppTask.
|
||||
* mappGetTaskOrder
|
||||
-- Reports taskIDs with visible windows, in front-to-back order. Note that Windows
|
||||
-- Explorer usually shows up first, due to the Windows task bar.
|
||||
--
|
||||
--
|
||||
-- THREAD FUNCTIONS (WIN32 ONLY)
|
||||
-- -----------------------------
|
||||
* mappGetThreadList
|
||||
-- .x32 version only; gets a listing of all threads, in the form:
|
||||
-- threadID, parentTaskID
|
||||
-- Primarily useful with mappGetThreadWindowList and 16-bit apps on NT.
|
||||
* mappGetTaskThreads integer taskID
|
||||
-- .x32 version only; gets a list of all threadIDs for this taskID, separated by ' '.
|
||||
* mappGetThreadWindowList integer threadID
|
||||
-- .x32 version only; gets a list of all windows for this threadID, in the form:
|
||||
-- windowName, windowID, parentWindowID, hasChildren, windowType
|
||||
* mappGetThreadWindowIDs integer threadID
|
||||
-- .x32 version only; reports only the thread's windowIDs, separated by spaces.
|
||||
--
|
||||
--
|
||||
-- MODULE FUNCTIONS
|
||||
-- ----------------
|
||||
* mappGetModuleList
|
||||
-- Returns a string listing of all currently running modules, one per line,
|
||||
-- with the following info on each line, separated by commas:
|
||||
-- moduleName, moduleID, moduleFileName
|
||||
-- Note: the .x32 and Mac versions use the same numbers for taskID, instanceID,
|
||||
-- and moduleID. Under Windows NT with the .x32 version, moduleFileName does not
|
||||
-- include the full path or the filename extension. Note that Win32 sometimes
|
||||
-- reuses moduleIDs; verify the moduleName is still the same!
|
||||
* mappGetModuleIDs
|
||||
-- Returns a string of moduleIDs, separated by spaces.
|
||||
* mappModuleTask integer moduleID
|
||||
* mappModuleFilename integer moduleID
|
||||
-- Note: on Windows NT, the answer does not include a full path or extension!
|
||||
* mappHostAppFilename
|
||||
* mappDirectorFilename
|
||||
* mappAuthorwareFilename
|
||||
-- Where is this program's executable file located? These are all synonyms.
|
||||
* mappModuleName integer moduleID
|
||||
-- Note: on Win32, this is a synonym for mappTaskName.
|
||||
* mappModuleIsRunning integer moduleID
|
||||
-- Is the indicated moduleID still running?
|
||||
* mappUnloadModule integer moduleID
|
||||
-- Note: on Win32, each task gets its own address space and thus unloading
|
||||
-- a module doesn't affect other tasks; so on Win32 and the Mac, this method is a
|
||||
-- synonym for mappRudeQuitTask().
|
||||
* mappHostAppModule
|
||||
* mappDirectorModule
|
||||
* mappAuthorwareModule
|
||||
-- Returns moduleID for the current program. All are synonyms.
|
||||
--
|
||||
--
|
||||
-- WINDOW FUNCTIONS
|
||||
-- ----------------
|
||||
* mappGetParentWindowList
|
||||
-- Gets a list of all parent windows, in the form:
|
||||
-- windowName, windowID, parentWindowID, hasChildren, windowType
|
||||
-- These are reported in front-to-back screen draw order, though not all of
|
||||
-- the reported windows may be visible or on-screen. Note the Windows 95/NT
|
||||
-- taskbar, or tooltip windows, are typically the first windows listed.
|
||||
* mappGetParentWindowIDs
|
||||
-- Gets all parent windowIDs, separated by spaces.
|
||||
* mappGetChildWindowList integer windowID
|
||||
-- Gets a list of all child windows of the supplied window, in the form:
|
||||
-- windowName, windowID, parentWindowID, hasChildren, windowType
|
||||
* mappGetChildWindowIDs integer windowID
|
||||
-- Gets a string of all windowIDs owned by the windowID, separated by ' '.
|
||||
* mappWindowParent integer windowID
|
||||
* mappGetWindowParent integer windowID
|
||||
-- Gets parent windowID of the supplied windowID. These are synonyms.
|
||||
* mappGetHighestWindowParent integer windowID
|
||||
* mappWindowName integer windowID
|
||||
* mappGetWindowName integer windowID
|
||||
-- Gets window name. These are synonyms.
|
||||
* mappSetWindowName integer windowID, string newName
|
||||
* mappWindowHasChildren integer windowID
|
||||
* mappWindowType integer windowID
|
||||
* mappGetWindowType integer windowID
|
||||
* mappWindowIsVisible integer windowID
|
||||
* mappFindWindow any windowName, any windowType
|
||||
-- Get a windowID for the first parent window matching the windowName and windowType.
|
||||
-- For windowName, supply a string to check a windowName, or 0 for all windowNames.
|
||||
-- For windowType, supply a string to check a windowType, or 0 for all windowTypes.
|
||||
-- Returns a string for an error, or an integer with the first found windowID.
|
||||
-- Example: see if Windows Paint accessory is running with syntax like this:
|
||||
-- set alreadyRunning = integerP(mappFindWindow(0,"MSPaintApp"))
|
||||
* mappGetActiveWindow
|
||||
-- Gets the currently active top level parent windowID. Applies only to the host app,
|
||||
-- not other apps. Generally the same as mappHostAppMainWindow(), but can be used with
|
||||
-- mappSetActiveWindow() to determine the current state.
|
||||
* mappSetActiveWindow integer windowID
|
||||
-- Sets the active window to the supplied top level parent windowID . Use with care-- can
|
||||
-- take over mouse and keyboard input! Returns the previously active windowID, or 0 if no
|
||||
-- window in the host app was previously active.
|
||||
* mappGetForegroundWindow
|
||||
-- Win32 only method! Returns the windowID that the user is currently working with.
|
||||
-- Can be easier to use than mappGetParentWindowList() or mappGetParentWindowIDs(),
|
||||
-- since it doesn't return floating Windows Explorer task bar windowIDs, etc.
|
||||
* mappSetForegroundWindow integer windowID
|
||||
-- Win32 only method! Changes front to back draw order and gives the window's task higher
|
||||
-- priority for processor time slices. Similar to mappWindowToFront, but more immediate.
|
||||
-- Returns TRUE or FALSE for success or failure.
|
||||
* mappGetKeyboardInputWindow
|
||||
-- What windowID is currently getting keyboard events?
|
||||
* mappSetKeyboardInputWindow integer windowID
|
||||
-- Set the windowID to receive keyboard events. Supply 0 if you want keyboard input to be
|
||||
-- ignored. Returns the windowID previously receiving keyboard events.
|
||||
* mappCaptureMouseInput integer windowID
|
||||
-- Directs mouse input to the specified window. For use with the host app's windows.
|
||||
-- Returns the previously set input window. The supplied windowID must already be
|
||||
-- frontmost. This allows a window to react to mouse movement outside its rectangle.
|
||||
-- This doesn't prevent other windows from being activated by mouse clicks.
|
||||
* mappReleaseMouseInput
|
||||
-- Frees mouse input to be received normally. Reverses effect of mappCaptureMouseInput().
|
||||
-- No return value.
|
||||
* mappGetParentWindowTopChild integer windowID
|
||||
-- Returns the topmost child window of the supplied parent windowID. May return a 'floating
|
||||
-- palette' window, such as Director's 'Control Panel' window. Supply 0 if you want
|
||||
-- the top window on the screen-- this can tell you if the Windows taskbar is showing, if
|
||||
-- the windowType of the returned top window is 'Shell_TrayWnd'.
|
||||
* mappGetDesktopWindow
|
||||
-- Gets a windowID for the desktop, the screen 'parent' of every parent window.
|
||||
* mappGetWindowOutsideRect integer windowID
|
||||
* mappGetWindowInsideRect integer windowID
|
||||
* mappSetWindowOutsideRect integer windowID, integer l, integer t, integer b, integer r
|
||||
* mappSetWindowRect integer windowID, integer l, integer t, integer b, integer r
|
||||
* mappCloseWindow integer windowID
|
||||
-- Closes a window. This is the normal way to quit an application. Returns
|
||||
-- -1 (bad windowID), 0 (windows has quit), or -2 (windows hasn't quit yet).
|
||||
-- Unlike the XObject and .x16 version, the .x32 version waits up to 3 seconds
|
||||
-- for the window to quit.
|
||||
* mappWindowExists integer windowID
|
||||
* mappWindowToFront integer windowID
|
||||
-- Brings the window to the front of the screen.
|
||||
* mappWindowToBack integer windowID
|
||||
-- Sends the window to the back.
|
||||
* mappHideWindow integer windowID
|
||||
* mappShowWindow integer windowID
|
||||
-- Controls the appearance of the window.
|
||||
* mappMinimizeWindow integer windowID
|
||||
* mappRestoreWindow integer windowID
|
||||
* mappMaximizeWindow integer windowID
|
||||
* mappDirectorStageWindow
|
||||
-- Returns the windowID of the stage. Director-only; doesn't work in Authorware.
|
||||
* mappHostAppMainWindow
|
||||
-- Returns the main windowID for this Xtra's host application.
|
||||
-- In the case of Director, this is the parent of the parent of the stage window.
|
||||
* mappDirectorMainWindow
|
||||
* mappAuthorwareMainWindow
|
||||
-- Synonyms for mappHostAppMainWindow.
|
||||
* mappKeepOnTop integer windowID
|
||||
-- Window is displayed on top of all other windows, even when other app's
|
||||
-- windows are activated. Useful for making floating control panels.
|
||||
* mappDontKeepOnTop integer windowID
|
||||
-- Reverses the results of mappKeepOnTop().
|
||||
--
|
||||
--
|
||||
-- LAUNCH FUNCTIONS
|
||||
-- ----------------
|
||||
* mappLaunch string theApp, string theCommandLineArguments
|
||||
-- Launch the program indicated by the full pathname 'theApp', possibly with command line
|
||||
-- arguments (supply EMPTY if there are no command line arguments). Returns an instanceID
|
||||
-- or a moduleID (which is the same number as a taskID with the .x32 and Mac versions).
|
||||
-- With the .x16 version, use mappInstanceTask() or mappModuleTask() to get a taskID.
|
||||
-- Note that Win32 sometimes reuses taskIDs, so verify the taskName is still what
|
||||
-- you expect; see mappGetTaskList() and mappTaskName().
|
||||
* mappLaunchButDontActivate string theApp, string theCommandLineArguments
|
||||
* mappLaunchHidden string theApp, string theCommandLineArguments
|
||||
* mappLaunchMinimized string theApp, string theCommandLineArguments
|
||||
* mappLaunchMaximized string theApp, string theCommandLineArguments
|
||||
-- Similar to mappLaunch, but with different initial appearance. Not every application
|
||||
-- respects the requested appearance-- testing is required.
|
||||
--
|
||||
--
|
||||
-- LAUNCH UTILITIES
|
||||
-- ----------------
|
||||
* mappLocateExecutable string theFile
|
||||
-- Locate the executable file registered to handle the document file indicated
|
||||
-- by the full pathname 'theFile'. Alternative syntax: supply a file name with no path
|
||||
-- and the DOS 'PATH' environment variable will be searched for the application.
|
||||
-- Note that mappGetWindowsRegistry() can also be used to find apps, even if they do
|
||||
-- not register any document types.
|
||||
* mappGetShortFileName string theFile
|
||||
* mappGetLongFileName string theFile
|
||||
-- Converts between MS-DOS 8.3 compliant short file names and long file names. Some
|
||||
-- programs require, or work more reliably with, short file names.
|
||||
* mappOpenDocument string theDocument
|
||||
-- Opens the document with the application registered to open that type of document.
|
||||
-- Supply a full pathname to the document. Returns 'OK', or a string with word 1 'Error:'.
|
||||
-- This is a difference from the XObject version, which returns an instanceID or moduleID;
|
||||
-- however, the 32-bit Windows API does not support this! Use mappGetTaskList(), etc. to
|
||||
-- identify the launched applications, or use mappLaunch() with the doc as the command line.
|
||||
* mappPrintDocument string theDocument
|
||||
-- Opens the document with the application registered to open that type of document
|
||||
-- and prints one copy to the default printer. Same return values as mappOpenDocument.
|
||||
* mappInstanceTask integer instanceID
|
||||
* mappInstanceIsRunning integer instanceID
|
||||
* mappUnloadInstance integer instanceID
|
||||
-- Note: on Win32, each instance gets its own address space and thus unloading
|
||||
-- an instance doesn't affect other tasks; so on Win32 and the Mac, this method is a
|
||||
-- synonym for mappRudeQuitTask().
|
||||
--
|
||||
--
|
||||
-- INPUT SIMULATION
|
||||
-- ----------------
|
||||
* mappFakeMouseClick integer windowID, integer x, integer y
|
||||
* mappFakeMouseClickWait integer windowID, integer x, integer y
|
||||
* mappFakeCharacter integer windowID, string theChar
|
||||
* mappFakeCharacterWait integer windowID, string theChar
|
||||
* mappFakeCharCode integer windowID, integer charNum, integer codeNum
|
||||
* mappFakeCharCodeWait integer windowID, integer charNum, integer codeNum
|
||||
-- Simulates a keypress of a special key in the window. Examples:
|
||||
-- Tab key = 9,15 ; Return key = 13,28; Escape key = 27,1;
|
||||
-- Ctrl-x (cut) = 24,45; Ctrl-c (copy) = 3,46; Ctrl-v (paste) =
|
||||
-- 22,47; for others, use a keyboard sniffer. See documentation.
|
||||
* mappShowMenu integer windowID
|
||||
* mappShowMenuWait integer windowID
|
||||
* mappAnyWindowAtPoint integer x, integer y
|
||||
-- What windowID is under point(x,y)? Use screen coordinates.
|
||||
* mappChildWindowAtPoint integer windowID, integer x, integer y
|
||||
-- What child window of the supplied parent windowID is under point(x,y)?
|
||||
-- Use screen coordinates. This can provide a windowID *within* a windowID
|
||||
-- returned by mappAnyWindowAtPoint().
|
||||
--
|
||||
--
|
||||
-- WINDOWS REGISTRY FUNCTIONS
|
||||
-- --------------------------
|
||||
* mappGetWindowsRegistry string theBase, string theKey, string theValue
|
||||
-- Gets the value theValue of registry key theKey, a subkey of key theBase.
|
||||
-- For the .x16 version, 'theBase' can only be 'HKEY_CLASSES_ROOT' and theValue
|
||||
-- must be EMPTY (because that's just how the 16-bit registry works). For the .x32
|
||||
-- version, theBase can also be 'HKEY_CURRENT_USER', 'HKEY_LOCAL_MACHINE' or
|
||||
-- 'HKEY_USERS'. Note that theKey can specify multiple keys in the registry,
|
||||
-- separated by '\' characters. Suppy EMPTY for theValue if you want the '(Default)'
|
||||
-- value for theKey (the 16-bit registry only knows about the '(Default') key).
|
||||
-- See the read me info, and experiment with REGEDIT.EXE, to learn more!
|
||||
-- Returns a string, an integer, or binary data in the form of a list of bytes (as
|
||||
-- integers from 0 to 255), depending on what type of entry is present in the registry.
|
||||
* mappSetWindowsRegistry string theBase, string theKey, string theValue, any theData
|
||||
-- Sets a registry entry with new data. The key and its parent keys are created if needed.
|
||||
-- Supply a string, an integer, or binary data in the form of a list of bytes as integers
|
||||
-- from 0 to 255 (depending on what sort of entry you are making). The entry type will be
|
||||
-- changed if needed. Supply EMPTY for theValue to set the '(Default)' value (the default
|
||||
-- 16-bit registry value), which must be a string value. Note: while you can use all the
|
||||
-- keys for 'theBase' listed under mappGetWindowsRegistry(), it's inadvisable to create
|
||||
-- settings under 'HKEY_USERS'. NOTE: Be *careful* with this method!
|
||||
-- It can damage your registry data and prevent your computer from working right.
|
||||
-- Please back up your registry data before doing development work and testing.
|
||||
* mappGetWindowsRegistryEntries string theBase, string theKey
|
||||
-- Returns a string with all entries (subkeys and values) available under the
|
||||
-- supplied key; one entry per line. Subkeys are listed first, then values; but
|
||||
-- the order in which subkeys and values are reported may vary from call to call.
|
||||
-- The default 16-bit value is not included in the list of values; it's always available.
|
||||
* mappGetWindowsRegistryKeys string theBase, string theKey
|
||||
-- Returns a string with all subkeys available under the
|
||||
-- supplied key; one entry per line.
|
||||
* mappGetWindowsRegistryValues string theBase, string theKey
|
||||
-- Returns a string with all values available under the
|
||||
-- supplied key; one entry per line. Does not include 16-bit default value.
|
||||
* mappGetWindowsRegistryEntryType string theBase, string theKey, string theValue
|
||||
-- Returns the type of data in the indicated registry entry: 'string', 'integer',
|
||||
-- 'bytelist', 'unsupported' or 'subkey'.
|
||||
* mappDeleteWindowsRegistry string theBase, string theKey, string theValue
|
||||
-- Erases the registry key. On Windows 95, this also deletes any subkeys.
|
||||
-- On Windows NT, this won't work if subkeys exist, so use mappGetWindowsRegistryKeys()
|
||||
-- to detect and delete any subkeys first. NOTE: Be *careful* with this method!
|
||||
-- It can damage your registry data and prevent your computer from working right.
|
||||
-- Please back up your registry data before doing development work and testing.
|
||||
-- Note: supply 'EMPTY' for 'theValue' for 16-bit registry values.
|
||||
--
|
||||
--
|
||||
-- MISCELLANEOUS WINDOWS-ONLY FUNCTIONS
|
||||
-- ------------------------------------
|
||||
* mappGetDefaultPrinter
|
||||
-- What printer is set as the default printer?
|
||||
* mappSetDefaultPrinter string thePrinter
|
||||
-- Set this printer to be the default printer. Supply the exact results of either
|
||||
-- mappGetDefaultPrinter() or one of the lines returned by mappGetInstalledPrinters().
|
||||
* mappGetInstalledPrinters
|
||||
-- What are the installed printers which can be used with mappSetDefaultPrinter?
|
||||
* mappWindowsFlavor
|
||||
-- Which flavor of Windows is running? Returns 'win31', 'win95' or 'winNT'.
|
||||
-- Obviously the .x32 version never reports 'win31'.
|
||||
|
||||
*/
|
||||
|
||||
namespace Director {
|
||||
|
||||
const char *MasterAppXtra::xlibName = "MasterApp";
|
||||
const XlibFileDesc MasterAppXtra::fileNames[] = {
|
||||
{ "masterapp", nullptr },
|
||||
{ nullptr, nullptr },
|
||||
};
|
||||
|
||||
static MethodProto xlibMethods[] = {
|
||||
{ "new", MasterAppXtra::m_new, 0, 0, 500 },
|
||||
{ nullptr, nullptr, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static BuiltinProto xlibBuiltins[] = {
|
||||
{ "mappGetTaskList", MasterAppXtra::m_mappGetTaskList, 0, 0, 500, HBLTIN },
|
||||
{ "mappGetTaskIDs", MasterAppXtra::m_mappGetTaskIDs, 0, 0, 500, HBLTIN },
|
||||
{ "mappTaskName", MasterAppXtra::m_mappTaskName, 1, 1, 500, HBLTIN },
|
||||
{ "mappTaskParent", MasterAppXtra::m_mappTaskParent, 1, 1, 500, HBLTIN },
|
||||
{ "mappTaskInstance", MasterAppXtra::m_mappTaskInstance, 1, 1, 500, HBLTIN },
|
||||
{ "mappTaskModule", MasterAppXtra::m_mappTaskModule, 1, 1, 500, HBLTIN },
|
||||
{ "mappTaskEvents", MasterAppXtra::m_mappTaskEvents, 1, 1, 500, HBLTIN },
|
||||
{ "mappGetTaskWindowList", MasterAppXtra::m_mappGetTaskWindowList, 1, 1, 500, HBLTIN },
|
||||
{ "mappGetTaskWindowIDs", MasterAppXtra::m_mappGetTaskWindowIDs, 1, 1, 500, HBLTIN },
|
||||
{ "mappGetWindowTask", MasterAppXtra::m_mappGetWindowTask, 1, 1, 500, HBLTIN },
|
||||
{ "mappRudeQuitTask", MasterAppXtra::m_mappRudeQuitTask, 2, 2, 500, HBLTIN },
|
||||
{ "mappTaskIsRunning", MasterAppXtra::m_mappTaskIsRunning, 1, 1, 500, HBLTIN },
|
||||
{ "mappFeedTimeSlice", MasterAppXtra::m_mappFeedTimeSlice, 1, 1, 500, HBLTIN },
|
||||
{ "mappFeedGenericTimeSlice", MasterAppXtra::m_mappFeedGenericTimeSlice, 0, 0, 500, HBLTIN },
|
||||
{ "mappHostAppTask", MasterAppXtra::m_mappHostAppTask, 0, 0, 500, HBLTIN },
|
||||
{ "mappDirectorTask", MasterAppXtra::m_mappDirectorTask, 0, 0, 500, HBLTIN },
|
||||
{ "mappAuthorwareTask", MasterAppXtra::m_mappAuthorwareTask, 0, 0, 500, HBLTIN },
|
||||
{ "mappGetTaskOrder", MasterAppXtra::m_mappGetTaskOrder, 0, 0, 500, HBLTIN },
|
||||
{ "mappGetThreadList", MasterAppXtra::m_mappGetThreadList, 0, 0, 500, HBLTIN },
|
||||
{ "mappGetTaskThreads", MasterAppXtra::m_mappGetTaskThreads, 1, 1, 500, HBLTIN },
|
||||
{ "mappGetThreadWindowList", MasterAppXtra::m_mappGetThreadWindowList, 1, 1, 500, HBLTIN },
|
||||
{ "mappGetThreadWindowIDs", MasterAppXtra::m_mappGetThreadWindowIDs, 1, 1, 500, HBLTIN },
|
||||
{ "mappGetModuleList", MasterAppXtra::m_mappGetModuleList, 0, 0, 500, HBLTIN },
|
||||
{ "mappGetModuleIDs", MasterAppXtra::m_mappGetModuleIDs, 0, 0, 500, HBLTIN },
|
||||
{ "mappModuleTask", MasterAppXtra::m_mappModuleTask, 1, 1, 500, HBLTIN },
|
||||
{ "mappModuleFilename", MasterAppXtra::m_mappModuleFilename, 1, 1, 500, HBLTIN },
|
||||
{ "mappHostAppFilename", MasterAppXtra::m_mappHostAppFilename, 0, 0, 500, HBLTIN },
|
||||
{ "mappDirectorFilename", MasterAppXtra::m_mappDirectorFilename, 0, 0, 500, HBLTIN },
|
||||
{ "mappAuthorwareFilename", MasterAppXtra::m_mappAuthorwareFilename, 0, 0, 500, HBLTIN },
|
||||
{ "mappModuleName", MasterAppXtra::m_mappModuleName, 1, 1, 500, HBLTIN },
|
||||
{ "mappModuleIsRunning", MasterAppXtra::m_mappModuleIsRunning, 1, 1, 500, HBLTIN },
|
||||
{ "mappUnloadModule", MasterAppXtra::m_mappUnloadModule, 1, 1, 500, HBLTIN },
|
||||
{ "mappHostAppModule", MasterAppXtra::m_mappHostAppModule, 0, 0, 500, HBLTIN },
|
||||
{ "mappDirectorModule", MasterAppXtra::m_mappDirectorModule, 0, 0, 500, HBLTIN },
|
||||
{ "mappAuthorwareModule", MasterAppXtra::m_mappAuthorwareModule, 0, 0, 500, HBLTIN },
|
||||
{ "mappGetParentWindowList", MasterAppXtra::m_mappGetParentWindowList, 0, 0, 500, HBLTIN },
|
||||
{ "mappGetParentWindowIDs", MasterAppXtra::m_mappGetParentWindowIDs, 0, 0, 500, HBLTIN },
|
||||
{ "mappGetChildWindowList", MasterAppXtra::m_mappGetChildWindowList, 1, 1, 500, HBLTIN },
|
||||
{ "mappGetChildWindowIDs", MasterAppXtra::m_mappGetChildWindowIDs, 1, 1, 500, HBLTIN },
|
||||
{ "mappWindowParent", MasterAppXtra::m_mappWindowParent, 1, 1, 500, HBLTIN },
|
||||
{ "mappGetWindowParent", MasterAppXtra::m_mappGetWindowParent, 1, 1, 500, HBLTIN },
|
||||
{ "mappGetHighestWindowParent", MasterAppXtra::m_mappGetHighestWindowParent, 1, 1, 500, HBLTIN },
|
||||
{ "mappWindowName", MasterAppXtra::m_mappWindowName, 1, 1, 500, HBLTIN },
|
||||
{ "mappGetWindowName", MasterAppXtra::m_mappGetWindowName, 1, 1, 500, HBLTIN },
|
||||
{ "mappSetWindowName", MasterAppXtra::m_mappSetWindowName, 2, 2, 500, HBLTIN },
|
||||
{ "mappWindowHasChildren", MasterAppXtra::m_mappWindowHasChildren, 1, 1, 500, HBLTIN },
|
||||
{ "mappWindowType", MasterAppXtra::m_mappWindowType, 1, 1, 500, HBLTIN },
|
||||
{ "mappGetWindowType", MasterAppXtra::m_mappGetWindowType, 1, 1, 500, HBLTIN },
|
||||
{ "mappWindowIsVisible", MasterAppXtra::m_mappWindowIsVisible, 1, 1, 500, HBLTIN },
|
||||
{ "mappFindWindow", MasterAppXtra::m_mappFindWindow, 2, 2, 500, HBLTIN },
|
||||
{ "mappGetActiveWindow", MasterAppXtra::m_mappGetActiveWindow, 0, 0, 500, HBLTIN },
|
||||
{ "mappSetActiveWindow", MasterAppXtra::m_mappSetActiveWindow, 1, 1, 500, HBLTIN },
|
||||
{ "mappGetForegroundWindow", MasterAppXtra::m_mappGetForegroundWindow, 0, 0, 500, HBLTIN },
|
||||
{ "mappSetForegroundWindow", MasterAppXtra::m_mappSetForegroundWindow, 1, 1, 500, HBLTIN },
|
||||
{ "mappGetKeyboardInputWindow", MasterAppXtra::m_mappGetKeyboardInputWindow, 0, 0, 500, HBLTIN },
|
||||
{ "mappSetKeyboardInputWindow", MasterAppXtra::m_mappSetKeyboardInputWindow, 1, 1, 500, HBLTIN },
|
||||
{ "mappCaptureMouseInput", MasterAppXtra::m_mappCaptureMouseInput, 1, 1, 500, HBLTIN },
|
||||
{ "mappReleaseMouseInput", MasterAppXtra::m_mappReleaseMouseInput, 0, 0, 500, HBLTIN },
|
||||
{ "mappGetParentWindowTopChild", MasterAppXtra::m_mappGetParentWindowTopChild, 1, 1, 500, HBLTIN },
|
||||
{ "mappGetDesktopWindow", MasterAppXtra::m_mappGetDesktopWindow, 0, 0, 500, HBLTIN },
|
||||
{ "mappGetWindowOutsideRect", MasterAppXtra::m_mappGetWindowOutsideRect, 1, 1, 500, HBLTIN },
|
||||
{ "mappGetWindowInsideRect", MasterAppXtra::m_mappGetWindowInsideRect, 1, 1, 500, HBLTIN },
|
||||
{ "mappSetWindowOutsideRect", MasterAppXtra::m_mappSetWindowOutsideRect, 5, 5, 500, HBLTIN },
|
||||
{ "mappSetWindowRect", MasterAppXtra::m_mappSetWindowRect, 5, 5, 500, HBLTIN },
|
||||
{ "mappCloseWindow", MasterAppXtra::m_mappCloseWindow, 1, 1, 500, HBLTIN },
|
||||
{ "mappWindowExists", MasterAppXtra::m_mappWindowExists, 1, 1, 500, HBLTIN },
|
||||
{ "mappWindowToFront", MasterAppXtra::m_mappWindowToFront, 1, 1, 500, HBLTIN },
|
||||
{ "mappWindowToBack", MasterAppXtra::m_mappWindowToBack, 1, 1, 500, HBLTIN },
|
||||
{ "mappHideWindow", MasterAppXtra::m_mappHideWindow, 1, 1, 500, HBLTIN },
|
||||
{ "mappShowWindow", MasterAppXtra::m_mappShowWindow, 1, 1, 500, HBLTIN },
|
||||
{ "mappMinimizeWindow", MasterAppXtra::m_mappMinimizeWindow, 1, 1, 500, HBLTIN },
|
||||
{ "mappRestoreWindow", MasterAppXtra::m_mappRestoreWindow, 1, 1, 500, HBLTIN },
|
||||
{ "mappMaximizeWindow", MasterAppXtra::m_mappMaximizeWindow, 1, 1, 500, HBLTIN },
|
||||
{ "mappDirectorStageWindow", MasterAppXtra::m_mappDirectorStageWindow, 0, 0, 500, HBLTIN },
|
||||
{ "mappHostAppMainWindow", MasterAppXtra::m_mappHostAppMainWindow, 0, 0, 500, HBLTIN },
|
||||
{ "mappDirectorMainWindow", MasterAppXtra::m_mappDirectorMainWindow, 0, 0, 500, HBLTIN },
|
||||
{ "mappAuthorwareMainWindow", MasterAppXtra::m_mappAuthorwareMainWindow, 0, 0, 500, HBLTIN },
|
||||
{ "mappKeepOnTop", MasterAppXtra::m_mappKeepOnTop, 1, 1, 500, HBLTIN },
|
||||
{ "mappDontKeepOnTop", MasterAppXtra::m_mappDontKeepOnTop, 1, 1, 500, HBLTIN },
|
||||
{ "mappLaunch", MasterAppXtra::m_mappLaunch, 2, 2, 500, HBLTIN },
|
||||
{ "mappLaunchButDontActivate", MasterAppXtra::m_mappLaunchButDontActivate, 2, 2, 500, HBLTIN },
|
||||
{ "mappLaunchHidden", MasterAppXtra::m_mappLaunchHidden, 2, 2, 500, HBLTIN },
|
||||
{ "mappLaunchMinimized", MasterAppXtra::m_mappLaunchMinimized, 2, 2, 500, HBLTIN },
|
||||
{ "mappLaunchMaximized", MasterAppXtra::m_mappLaunchMaximized, 2, 2, 500, HBLTIN },
|
||||
{ "mappLocateExecutable", MasterAppXtra::m_mappLocateExecutable, 1, 1, 500, HBLTIN },
|
||||
{ "mappGetShortFileName", MasterAppXtra::m_mappGetShortFileName, 1, 1, 500, HBLTIN },
|
||||
{ "mappGetLongFileName", MasterAppXtra::m_mappGetLongFileName, 1, 1, 500, HBLTIN },
|
||||
{ "mappOpenDocument", MasterAppXtra::m_mappOpenDocument, 1, 1, 500, HBLTIN },
|
||||
{ "mappPrintDocument", MasterAppXtra::m_mappPrintDocument, 1, 1, 500, HBLTIN },
|
||||
{ "mappInstanceTask", MasterAppXtra::m_mappInstanceTask, 1, 1, 500, HBLTIN },
|
||||
{ "mappInstanceIsRunning", MasterAppXtra::m_mappInstanceIsRunning, 1, 1, 500, HBLTIN },
|
||||
{ "mappUnloadInstance", MasterAppXtra::m_mappUnloadInstance, 1, 1, 500, HBLTIN },
|
||||
{ "mappFakeMouseClick", MasterAppXtra::m_mappFakeMouseClick, 3, 3, 500, HBLTIN },
|
||||
{ "mappFakeMouseClickWait", MasterAppXtra::m_mappFakeMouseClickWait, 3, 3, 500, HBLTIN },
|
||||
{ "mappFakeCharacter", MasterAppXtra::m_mappFakeCharacter, 2, 2, 500, HBLTIN },
|
||||
{ "mappFakeCharacterWait", MasterAppXtra::m_mappFakeCharacterWait, 2, 2, 500, HBLTIN },
|
||||
{ "mappFakeCharCode", MasterAppXtra::m_mappFakeCharCode, 3, 3, 500, HBLTIN },
|
||||
{ "mappFakeCharCodeWait", MasterAppXtra::m_mappFakeCharCodeWait, 3, 3, 500, HBLTIN },
|
||||
{ "mappShowMenu", MasterAppXtra::m_mappShowMenu, 1, 1, 500, HBLTIN },
|
||||
{ "mappShowMenuWait", MasterAppXtra::m_mappShowMenuWait, 1, 1, 500, HBLTIN },
|
||||
{ "mappAnyWindowAtPoint", MasterAppXtra::m_mappAnyWindowAtPoint, 2, 2, 500, HBLTIN },
|
||||
{ "mappChildWindowAtPoint", MasterAppXtra::m_mappChildWindowAtPoint, 3, 3, 500, HBLTIN },
|
||||
{ "mappGetWindowsRegistry", MasterAppXtra::m_mappGetWindowsRegistry, 3, 3, 500, HBLTIN },
|
||||
{ "mappSetWindowsRegistry", MasterAppXtra::m_mappSetWindowsRegistry, 4, 4, 500, HBLTIN },
|
||||
{ "mappGetWindowsRegistryEntries", MasterAppXtra::m_mappGetWindowsRegistryEntries, 2, 2, 500, HBLTIN },
|
||||
{ "mappGetWindowsRegistryKeys", MasterAppXtra::m_mappGetWindowsRegistryKeys, 2, 2, 500, HBLTIN },
|
||||
{ "mappGetWindowsRegistryValues", MasterAppXtra::m_mappGetWindowsRegistryValues, 2, 2, 500, HBLTIN },
|
||||
{ "mappGetWindowsRegistryEntryType", MasterAppXtra::m_mappGetWindowsRegistryEntryType, 3, 3, 500, HBLTIN },
|
||||
{ "mappDeleteWindowsRegistry", MasterAppXtra::m_mappDeleteWindowsRegistry, 3, 3, 500, HBLTIN },
|
||||
{ "mappGetDefaultPrinter", MasterAppXtra::m_mappGetDefaultPrinter, 0, 0, 500, HBLTIN },
|
||||
{ "mappSetDefaultPrinter", MasterAppXtra::m_mappSetDefaultPrinter, 1, 1, 500, HBLTIN },
|
||||
{ "mappGetInstalledPrinters", MasterAppXtra::m_mappGetInstalledPrinters, 0, 0, 500, HBLTIN },
|
||||
{ "mappWindowsFlavor", MasterAppXtra::m_mappWindowsFlavor, 0, 0, 500, HBLTIN },
|
||||
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
|
||||
};
|
||||
|
||||
MasterAppXtraObject::MasterAppXtraObject(ObjectType ObjectType) :Object<MasterAppXtraObject>("MasterApp") {
|
||||
_objType = ObjectType;
|
||||
}
|
||||
|
||||
bool MasterAppXtraObject::hasProp(const Common::String &propName) {
|
||||
return (propName == "name");
|
||||
}
|
||||
|
||||
Datum MasterAppXtraObject::getProp(const Common::String &propName) {
|
||||
if (propName == "name")
|
||||
return Datum(MasterAppXtra::xlibName);
|
||||
warning("MasterAppXtra::getProp: unknown property '%s'", propName.c_str());
|
||||
return Datum();
|
||||
}
|
||||
|
||||
void MasterAppXtra::open(ObjectType type, const Common::Path &path) {
|
||||
MasterAppXtraObject::initMethods(xlibMethods);
|
||||
MasterAppXtraObject *xobj = new MasterAppXtraObject(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 MasterAppXtra::close(ObjectType type) {
|
||||
MasterAppXtraObject::cleanupMethods();
|
||||
g_lingo->_globalvars[xlibName] = Datum();
|
||||
|
||||
}
|
||||
|
||||
void MasterAppXtra::m_new(int nargs) {
|
||||
g_lingo->printSTUBWithArglist("MasterAppXtra::m_new", nargs);
|
||||
g_lingo->dropStack(nargs);
|
||||
g_lingo->push(g_lingo->_state->me);
|
||||
}
|
||||
|
||||
XOBJSTUB(MasterAppXtra::m_register, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappGetTaskList, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappGetTaskIDs, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappTaskName, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappTaskParent, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappTaskInstance, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappTaskModule, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappTaskEvents, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappGetTaskWindowList, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappGetTaskWindowIDs, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappGetWindowTask, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappRudeQuitTask, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappTaskIsRunning, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappFeedTimeSlice, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappFeedGenericTimeSlice, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappHostAppTask, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappDirectorTask, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappAuthorwareTask, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappGetTaskOrder, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappGetThreadList, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappGetTaskThreads, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappGetThreadWindowList, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappGetThreadWindowIDs, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappGetModuleList, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappGetModuleIDs, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappModuleTask, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappModuleFilename, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappHostAppFilename, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappDirectorFilename, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappAuthorwareFilename, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappModuleName, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappModuleIsRunning, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappUnloadModule, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappHostAppModule, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappDirectorModule, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappAuthorwareModule, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappGetParentWindowList, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappGetParentWindowIDs, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappGetChildWindowList, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappGetChildWindowIDs, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappWindowParent, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappGetWindowParent, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappGetHighestWindowParent, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappWindowName, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappGetWindowName, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappSetWindowName, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappWindowHasChildren, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappWindowType, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappGetWindowType, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappWindowIsVisible, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappFindWindow, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappGetActiveWindow, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappSetActiveWindow, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappGetForegroundWindow, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappSetForegroundWindow, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappGetKeyboardInputWindow, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappSetKeyboardInputWindow, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappCaptureMouseInput, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappReleaseMouseInput, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappGetParentWindowTopChild, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappGetDesktopWindow, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappGetWindowOutsideRect, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappGetWindowInsideRect, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappSetWindowOutsideRect, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappSetWindowRect, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappCloseWindow, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappWindowExists, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappWindowToFront, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappWindowToBack, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappHideWindow, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappShowWindow, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappMinimizeWindow, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappRestoreWindow, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappMaximizeWindow, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappDirectorStageWindow, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappHostAppMainWindow, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappDirectorMainWindow, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappAuthorwareMainWindow, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappKeepOnTop, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappDontKeepOnTop, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappLaunch, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappLaunchButDontActivate, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappLaunchHidden, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappLaunchMinimized, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappLaunchMaximized, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappLocateExecutable, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappGetShortFileName, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappGetLongFileName, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappOpenDocument, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappPrintDocument, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappInstanceTask, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappInstanceIsRunning, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappUnloadInstance, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappFakeMouseClick, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappFakeMouseClickWait, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappFakeCharacter, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappFakeCharacterWait, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappFakeCharCode, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappFakeCharCodeWait, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappShowMenu, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappShowMenuWait, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappAnyWindowAtPoint, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappChildWindowAtPoint, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappGetWindowsRegistry, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappSetWindowsRegistry, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappGetWindowsRegistryEntries, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappGetWindowsRegistryKeys, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappGetWindowsRegistryValues, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappGetWindowsRegistryEntryType, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappDeleteWindowsRegistry, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappGetDefaultPrinter, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappSetDefaultPrinter, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappGetInstalledPrinters, 0)
|
||||
XOBJSTUB(MasterAppXtra::m_mappWindowsFlavor, 0)
|
||||
|
||||
}
|
||||
163
engines/director/lingo/xtras/masterapp.h
Normal file
163
engines/director/lingo/xtras/masterapp.h
Normal file
@@ -0,0 +1,163 @@
|
||||
/* 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_XTRAS_MASTERAPP_H
|
||||
#define DIRECTOR_LINGO_XTRAS_MASTERAPP_H
|
||||
|
||||
namespace Director {
|
||||
|
||||
class MasterAppXtraObject : public Object<MasterAppXtraObject> {
|
||||
public:
|
||||
MasterAppXtraObject(ObjectType objType);
|
||||
|
||||
bool hasProp(const Common::String &propName) override;
|
||||
Datum getProp(const Common::String &propName) override;
|
||||
};
|
||||
|
||||
namespace MasterAppXtra {
|
||||
|
||||
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_register(int nargs);
|
||||
void m_mappGetTaskList(int nargs);
|
||||
void m_mappGetTaskIDs(int nargs);
|
||||
void m_mappTaskName(int nargs);
|
||||
void m_mappTaskParent(int nargs);
|
||||
void m_mappTaskInstance(int nargs);
|
||||
void m_mappTaskModule(int nargs);
|
||||
void m_mappTaskEvents(int nargs);
|
||||
void m_mappGetTaskWindowList(int nargs);
|
||||
void m_mappGetTaskWindowIDs(int nargs);
|
||||
void m_mappGetWindowTask(int nargs);
|
||||
void m_mappRudeQuitTask(int nargs);
|
||||
void m_mappTaskIsRunning(int nargs);
|
||||
void m_mappFeedTimeSlice(int nargs);
|
||||
void m_mappFeedGenericTimeSlice(int nargs);
|
||||
void m_mappHostAppTask(int nargs);
|
||||
void m_mappDirectorTask(int nargs);
|
||||
void m_mappAuthorwareTask(int nargs);
|
||||
void m_mappGetTaskOrder(int nargs);
|
||||
void m_mappGetThreadList(int nargs);
|
||||
void m_mappGetTaskThreads(int nargs);
|
||||
void m_mappGetThreadWindowList(int nargs);
|
||||
void m_mappGetThreadWindowIDs(int nargs);
|
||||
void m_mappGetModuleList(int nargs);
|
||||
void m_mappGetModuleIDs(int nargs);
|
||||
void m_mappModuleTask(int nargs);
|
||||
void m_mappModuleFilename(int nargs);
|
||||
void m_mappHostAppFilename(int nargs);
|
||||
void m_mappDirectorFilename(int nargs);
|
||||
void m_mappAuthorwareFilename(int nargs);
|
||||
void m_mappModuleName(int nargs);
|
||||
void m_mappModuleIsRunning(int nargs);
|
||||
void m_mappUnloadModule(int nargs);
|
||||
void m_mappHostAppModule(int nargs);
|
||||
void m_mappDirectorModule(int nargs);
|
||||
void m_mappAuthorwareModule(int nargs);
|
||||
void m_mappGetParentWindowList(int nargs);
|
||||
void m_mappGetParentWindowIDs(int nargs);
|
||||
void m_mappGetChildWindowList(int nargs);
|
||||
void m_mappGetChildWindowIDs(int nargs);
|
||||
void m_mappWindowParent(int nargs);
|
||||
void m_mappGetWindowParent(int nargs);
|
||||
void m_mappGetHighestWindowParent(int nargs);
|
||||
void m_mappWindowName(int nargs);
|
||||
void m_mappGetWindowName(int nargs);
|
||||
void m_mappSetWindowName(int nargs);
|
||||
void m_mappWindowHasChildren(int nargs);
|
||||
void m_mappWindowType(int nargs);
|
||||
void m_mappGetWindowType(int nargs);
|
||||
void m_mappWindowIsVisible(int nargs);
|
||||
void m_mappFindWindow(int nargs);
|
||||
void m_mappGetActiveWindow(int nargs);
|
||||
void m_mappSetActiveWindow(int nargs);
|
||||
void m_mappGetForegroundWindow(int nargs);
|
||||
void m_mappSetForegroundWindow(int nargs);
|
||||
void m_mappGetKeyboardInputWindow(int nargs);
|
||||
void m_mappSetKeyboardInputWindow(int nargs);
|
||||
void m_mappCaptureMouseInput(int nargs);
|
||||
void m_mappReleaseMouseInput(int nargs);
|
||||
void m_mappGetParentWindowTopChild(int nargs);
|
||||
void m_mappGetDesktopWindow(int nargs);
|
||||
void m_mappGetWindowOutsideRect(int nargs);
|
||||
void m_mappGetWindowInsideRect(int nargs);
|
||||
void m_mappSetWindowOutsideRect(int nargs);
|
||||
void m_mappSetWindowRect(int nargs);
|
||||
void m_mappCloseWindow(int nargs);
|
||||
void m_mappWindowExists(int nargs);
|
||||
void m_mappWindowToFront(int nargs);
|
||||
void m_mappWindowToBack(int nargs);
|
||||
void m_mappHideWindow(int nargs);
|
||||
void m_mappShowWindow(int nargs);
|
||||
void m_mappMinimizeWindow(int nargs);
|
||||
void m_mappRestoreWindow(int nargs);
|
||||
void m_mappMaximizeWindow(int nargs);
|
||||
void m_mappDirectorStageWindow(int nargs);
|
||||
void m_mappHostAppMainWindow(int nargs);
|
||||
void m_mappDirectorMainWindow(int nargs);
|
||||
void m_mappAuthorwareMainWindow(int nargs);
|
||||
void m_mappKeepOnTop(int nargs);
|
||||
void m_mappDontKeepOnTop(int nargs);
|
||||
void m_mappLaunch(int nargs);
|
||||
void m_mappLaunchButDontActivate(int nargs);
|
||||
void m_mappLaunchHidden(int nargs);
|
||||
void m_mappLaunchMinimized(int nargs);
|
||||
void m_mappLaunchMaximized(int nargs);
|
||||
void m_mappLocateExecutable(int nargs);
|
||||
void m_mappGetShortFileName(int nargs);
|
||||
void m_mappGetLongFileName(int nargs);
|
||||
void m_mappOpenDocument(int nargs);
|
||||
void m_mappPrintDocument(int nargs);
|
||||
void m_mappInstanceTask(int nargs);
|
||||
void m_mappInstanceIsRunning(int nargs);
|
||||
void m_mappUnloadInstance(int nargs);
|
||||
void m_mappFakeMouseClick(int nargs);
|
||||
void m_mappFakeMouseClickWait(int nargs);
|
||||
void m_mappFakeCharacter(int nargs);
|
||||
void m_mappFakeCharacterWait(int nargs);
|
||||
void m_mappFakeCharCode(int nargs);
|
||||
void m_mappFakeCharCodeWait(int nargs);
|
||||
void m_mappShowMenu(int nargs);
|
||||
void m_mappShowMenuWait(int nargs);
|
||||
void m_mappAnyWindowAtPoint(int nargs);
|
||||
void m_mappChildWindowAtPoint(int nargs);
|
||||
void m_mappGetWindowsRegistry(int nargs);
|
||||
void m_mappSetWindowsRegistry(int nargs);
|
||||
void m_mappGetWindowsRegistryEntries(int nargs);
|
||||
void m_mappGetWindowsRegistryKeys(int nargs);
|
||||
void m_mappGetWindowsRegistryValues(int nargs);
|
||||
void m_mappGetWindowsRegistryEntryType(int nargs);
|
||||
void m_mappDeleteWindowsRegistry(int nargs);
|
||||
void m_mappGetDefaultPrinter(int nargs);
|
||||
void m_mappSetDefaultPrinter(int nargs);
|
||||
void m_mappGetInstalledPrinters(int nargs);
|
||||
void m_mappWindowsFlavor(int nargs);
|
||||
|
||||
} // End of namespace MasterAppXtra
|
||||
|
||||
} // End of namespace Director
|
||||
|
||||
#endif
|
||||
109
engines/director/lingo/xtras/openurl.cpp
Normal file
109
engines/director/lingo/xtras/openurl.cpp
Normal file
@@ -0,0 +1,109 @@
|
||||
/* 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/xtras/openurl.h"
|
||||
|
||||
/**************************************************
|
||||
*
|
||||
* USED IN:
|
||||
* Cracking the Conspiracy
|
||||
*
|
||||
**************************************************/
|
||||
|
||||
/*
|
||||
-- xtra OpenURL
|
||||
new object me
|
||||
|
||||
* gsOpenURL string URL -- opens URL in default browser; returns 1 for success, 0 for failure.
|
||||
|
||||
-- Copyright: Gary Smith, 9th August, 1997.
|
||||
-- Email: gary@mods.com.au
|
||||
-- Web site: http://www.mods.com.au
|
||||
-- This Xtra may be freely distributed.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
namespace Director {
|
||||
|
||||
const char *OpenURLXtra::xlibName = "OpenURL";
|
||||
const XlibFileDesc OpenURLXtra::fileNames[] = {
|
||||
{ "openurl", nullptr },
|
||||
{ nullptr, nullptr },
|
||||
};
|
||||
|
||||
static MethodProto xlibMethods[] = {
|
||||
{ "new", OpenURLXtra::m_new, 0, 0, 500 },
|
||||
{ nullptr, nullptr, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static BuiltinProto xlibBuiltins[] = {
|
||||
{ "gsOpenURL", OpenURLXtra::m_gsOpenURL, 1, 1, 500, HBLTIN },
|
||||
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
|
||||
};
|
||||
|
||||
OpenURLXtraObject::OpenURLXtraObject(ObjectType ObjectType) :Object<OpenURLXtraObject>("OpenURL") {
|
||||
_objType = ObjectType;
|
||||
}
|
||||
|
||||
bool OpenURLXtraObject::hasProp(const Common::String &propName) {
|
||||
return (propName == "name");
|
||||
}
|
||||
|
||||
Datum OpenURLXtraObject::getProp(const Common::String &propName) {
|
||||
if (propName == "name")
|
||||
return Datum(OpenURLXtra::xlibName);
|
||||
warning("OpenURLXtra::getProp: unknown property '%s'", propName.c_str());
|
||||
return Datum();
|
||||
}
|
||||
|
||||
void OpenURLXtra::open(ObjectType type, const Common::Path &path) {
|
||||
OpenURLXtraObject::initMethods(xlibMethods);
|
||||
OpenURLXtraObject *xobj = new OpenURLXtraObject(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 OpenURLXtra::close(ObjectType type) {
|
||||
OpenURLXtraObject::cleanupMethods();
|
||||
g_lingo->_globalvars[xlibName] = Datum();
|
||||
|
||||
}
|
||||
|
||||
void OpenURLXtra::m_new(int nargs) {
|
||||
g_lingo->printSTUBWithArglist("OpenURLXtra::m_new", nargs);
|
||||
g_lingo->dropStack(nargs);
|
||||
g_lingo->push(g_lingo->_state->me);
|
||||
}
|
||||
|
||||
XOBJSTUB(OpenURLXtra::m_gsOpenURL, 0)
|
||||
|
||||
}
|
||||
50
engines/director/lingo/xtras/openurl.h
Normal file
50
engines/director/lingo/xtras/openurl.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_XTRAS_OPENURL_H
|
||||
#define DIRECTOR_LINGO_XTRAS_OPENURL_H
|
||||
|
||||
namespace Director {
|
||||
|
||||
class OpenURLXtraObject : public Object<OpenURLXtraObject> {
|
||||
public:
|
||||
OpenURLXtraObject(ObjectType objType);
|
||||
|
||||
bool hasProp(const Common::String &propName) override;
|
||||
Datum getProp(const Common::String &propName) override;
|
||||
};
|
||||
|
||||
namespace OpenURLXtra {
|
||||
|
||||
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_gsOpenURL(int nargs);
|
||||
|
||||
} // End of namespace OpenURLXtra
|
||||
|
||||
} // End of namespace Director
|
||||
|
||||
#endif
|
||||
103
engines/director/lingo/xtras/oscheck.cpp
Normal file
103
engines/director/lingo/xtras/oscheck.cpp
Normal file
@@ -0,0 +1,103 @@
|
||||
/* 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/xtras/oscheck.h"
|
||||
|
||||
/**************************************************
|
||||
*
|
||||
* USED IN:
|
||||
* sinkha
|
||||
*
|
||||
**************************************************/
|
||||
|
||||
/*
|
||||
-- xtra osCheck
|
||||
new object me
|
||||
-- Template handlers --
|
||||
* chos -- returns true if Japan OS
|
||||
|
||||
*/
|
||||
|
||||
namespace Director {
|
||||
|
||||
const char *OSCheckXtra::xlibName = "OSCheck";
|
||||
const XlibFileDesc OSCheckXtra::fileNames[] = {
|
||||
{ "oscheck", nullptr },
|
||||
{ nullptr, nullptr },
|
||||
};
|
||||
|
||||
static MethodProto xlibMethods[] = {
|
||||
{ "new", OSCheckXtra::m_new, 0, 0, 400 },
|
||||
{ nullptr, nullptr, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static BuiltinProto xlibBuiltins[] = {
|
||||
{ "chos", OSCheckXtra::m_chos, 0, 0, 400, HBLTIN },
|
||||
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
|
||||
};
|
||||
|
||||
OSCheckXtraObject::OSCheckXtraObject(ObjectType ObjectType) :Object<OSCheckXtraObject>("OSCheck") {
|
||||
_objType = ObjectType;
|
||||
}
|
||||
|
||||
bool OSCheckXtraObject::hasProp(const Common::String &propName) {
|
||||
return (propName == "name");
|
||||
}
|
||||
|
||||
Datum OSCheckXtraObject::getProp(const Common::String &propName) {
|
||||
if (propName == "name")
|
||||
return Datum(OSCheckXtra::xlibName);
|
||||
warning("OSCheckXtra::getProp: unknown property '%s'", propName.c_str());
|
||||
return Datum();
|
||||
}
|
||||
|
||||
void OSCheckXtra::open(ObjectType type, const Common::Path &path) {
|
||||
OSCheckXtraObject::initMethods(xlibMethods);
|
||||
OSCheckXtraObject *xobj = new OSCheckXtraObject(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 OSCheckXtra::close(ObjectType type) {
|
||||
OSCheckXtraObject::cleanupMethods();
|
||||
g_lingo->_globalvars[xlibName] = Datum();
|
||||
|
||||
}
|
||||
|
||||
void OSCheckXtra::m_new(int nargs) {
|
||||
g_lingo->printSTUBWithArglist("OSCheckXtra::m_new", nargs);
|
||||
g_lingo->dropStack(nargs);
|
||||
g_lingo->push(g_lingo->_state->me);
|
||||
}
|
||||
|
||||
XOBJSTUB(OSCheckXtra::m_chos, 0)
|
||||
|
||||
}
|
||||
50
engines/director/lingo/xtras/oscheck.h
Normal file
50
engines/director/lingo/xtras/oscheck.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_XTRAS_OSCHECK_H
|
||||
#define DIRECTOR_LINGO_XTRAS_OSCHECK_H
|
||||
|
||||
namespace Director {
|
||||
|
||||
class OSCheckXtraObject : public Object<OSCheckXtraObject> {
|
||||
public:
|
||||
OSCheckXtraObject(ObjectType objType);
|
||||
|
||||
bool hasProp(const Common::String &propName) override;
|
||||
Datum getProp(const Common::String &propName) override;
|
||||
};
|
||||
|
||||
namespace OSCheckXtra {
|
||||
|
||||
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_chos(int nargs);
|
||||
|
||||
} // End of namespace OSCheckXtra
|
||||
|
||||
} // End of namespace Director
|
||||
|
||||
#endif
|
||||
1200
engines/director/lingo/xtras/qtvrxtra.cpp
Normal file
1200
engines/director/lingo/xtras/qtvrxtra.cpp
Normal file
File diff suppressed because it is too large
Load Diff
142
engines/director/lingo/xtras/qtvrxtra.h
Normal file
142
engines/director/lingo/xtras/qtvrxtra.h
Normal file
@@ -0,0 +1,142 @@
|
||||
/* 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_XTRAS_QTVRXTRA_H
|
||||
#define DIRECTOR_LINGO_XTRAS_QTVRXTRA_H
|
||||
|
||||
#include "video/qt_decoder.h"
|
||||
|
||||
namespace Director {
|
||||
|
||||
class QtvrxtraXtraObject;
|
||||
|
||||
class QtvrxtraWidget : public Graphics::MacWidget {
|
||||
public:
|
||||
QtvrxtraWidget(QtvrxtraXtraObject *xtra, Graphics::MacWidget *parent, int x, int y, int w, int h, Graphics::MacWindowManager *wm);
|
||||
|
||||
virtual bool processEvent(Common::Event &event);
|
||||
|
||||
QtvrxtraXtraObject *_xtra;
|
||||
};
|
||||
|
||||
class QtvrxtraXtraObject : public Object<QtvrxtraXtraObject> {
|
||||
public:
|
||||
QtvrxtraXtraObject(ObjectType objType);
|
||||
|
||||
bool hasProp(const Common::String &propName) override;
|
||||
Datum getProp(const Common::String &propName) override;
|
||||
|
||||
Video::QuickTimeDecoder *_video;
|
||||
QtvrxtraWidget *_widget;
|
||||
|
||||
Common::Rect _rect;
|
||||
bool _visible;
|
||||
|
||||
bool _passMouseDown;
|
||||
bool _exitMouseOver = false;
|
||||
|
||||
Common::String _rolloverHotSpotHandler;
|
||||
Common::String _mouseDownHandler;
|
||||
Common::String _mouseOverHandler;
|
||||
Common::String _mouseStillDownHandler;
|
||||
Common::String _panZoomStartHandler;
|
||||
Common::String _nodeLeaveHandler;
|
||||
};
|
||||
|
||||
namespace QtvrxtraXtra {
|
||||
|
||||
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_forget(int nargs);
|
||||
void m_QTVREnter(int nargs);
|
||||
void m_QTVRExit(int nargs);
|
||||
void m_QTVROpen(int nargs);
|
||||
void m_QTVRClose(int nargs);
|
||||
void m_QTVRUpdate(int nargs);
|
||||
void m_QTVRGetQTVRType(int nargs);
|
||||
void m_QTVRIdle(int nargs);
|
||||
void m_QTVRMouseDown(int nargs);
|
||||
void m_QTVRMouseOver(int nargs);
|
||||
void m_QTVRGetPanAngle(int nargs);
|
||||
void m_QTVRSetPanAngle(int nargs);
|
||||
void m_QTVRGetTiltAngle(int nargs);
|
||||
void m_QTVRSetTiltAngle(int nargs);
|
||||
void m_QTVRGetFOV(int nargs);
|
||||
void m_QTVRSetFOV(int nargs);
|
||||
void m_QTVRGetClickLoc(int nargs);
|
||||
void m_QTVRSetClickLoc(int nargs);
|
||||
void m_QTVRGetClickPanAngles(int nargs);
|
||||
void m_QTVRGetClickPanLoc(int nargs);
|
||||
void m_QTVRGetHotSpotID(int nargs);
|
||||
void m_QTVRSetHotSpotID(int nargs);
|
||||
void m_QTVRGetHotSpotName(int nargs);
|
||||
void m_QTVRGetHotSpotType(int nargs);
|
||||
void m_QTVRGetHotSpotViewAngles(int nargs);
|
||||
void m_QTVRGetObjectViewAngles(int nargs);
|
||||
void m_QTVRGetObjectZoomRect(int nargs);
|
||||
void m_QTVRGetNodeID(int nargs);
|
||||
void m_QTVRSetNodeID(int nargs);
|
||||
void m_QTVRGetNodeName(int nargs);
|
||||
void m_QTVRGetQuality(int nargs);
|
||||
void m_QTVRSetQuality(int nargs);
|
||||
void m_QTVRGetTransitionMode(int nargs);
|
||||
void m_QTVRSetTransitionMode(int nargs);
|
||||
void m_QTVRGetTransitionSpeed(int nargs);
|
||||
void m_QTVRSetTransitionSpeed(int nargs);
|
||||
void m_QTVRGetUpdateMode(int nargs);
|
||||
void m_QTVRSetUpdateMode(int nargs);
|
||||
void m_QTVRGetVisible(int nargs);
|
||||
void m_QTVRSetVisible(int nargs);
|
||||
void m_QTVRGetWarpMode(int nargs);
|
||||
void m_QTVRSetWarpMode(int nargs);
|
||||
void m_QTVRCollapseToHotSpotRgn(int nargs);
|
||||
void m_QTVRZoomOutEffect(int nargs);
|
||||
void m_QTVRGetColumn(int nargs);
|
||||
void m_QTVRSetColumn(int nargs);
|
||||
void m_QTVRGetRow(int nargs);
|
||||
void m_QTVRSetRow(int nargs);
|
||||
void m_QTVRNudge(int nargs);
|
||||
void m_QTVRGetMouseDownHandler(int nargs);
|
||||
void m_QTVRSetMouseDownHandler(int nargs);
|
||||
void m_QTVRGetMouseOverHandler(int nargs);
|
||||
void m_QTVRSetMouseOverHandler(int nargs);
|
||||
void m_QTVRGetMouseStillDownHandler(int nargs);
|
||||
void m_QTVRSetMouseStillDownHandler(int nargs);
|
||||
void m_QTVRGetNodeLeaveHandler(int nargs);
|
||||
void m_QTVRSetNodeLeaveHandler(int nargs);
|
||||
void m_QTVRGetPanZoomStartHandler(int nargs);
|
||||
void m_QTVRSetPanZoomStartHandler(int nargs);
|
||||
void m_QTVRGetRolloverHotSpotHandler(int nargs);
|
||||
void m_QTVRSetRolloverHotSpotHandler(int nargs);
|
||||
void m_QTVRExitMouseOver(int nargs);
|
||||
void m_QTVRPassMouseDown(int nargs);
|
||||
void m_IsQTVRMovie(int nargs);
|
||||
|
||||
} // End of namespace QtvrxtraXtra
|
||||
|
||||
} // End of namespace Director
|
||||
|
||||
#endif
|
||||
118
engines/director/lingo/xtras/r/registryreader.cpp
Normal file
118
engines/director/lingo/xtras/r/registryreader.cpp
Normal file
@@ -0,0 +1,118 @@
|
||||
/* 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/xtras/r/registryreader.h"
|
||||
|
||||
/**************************************************
|
||||
*
|
||||
* USED IN:
|
||||
* I Spy Spooky Mansion
|
||||
*
|
||||
**************************************************/
|
||||
|
||||
/*
|
||||
-- xtra RegistryReader
|
||||
-- RegistryReader Xtra in the Magister Goodie series of free Xtras
|
||||
-- for Macromedia Director.
|
||||
-- Copyright (C) 1997, Magister Ludi s.r.l.
|
||||
--
|
||||
-- For other Xtras and multimedia products, check out www.magisterludi.com
|
||||
--
|
||||
--
|
||||
new object me -- do not instantiate this Xtra - it is not needed!
|
||||
* GetPrivateProfileString string fileName, sectionName, keyName, defaultStr
|
||||
-- a wrapper for Windows' GetPrivateProfileString
|
||||
* ReadRegistryValue string keyName, valueName
|
||||
-- reads the key/value in the registry
|
||||
-- keyName should include "HKEY_CURRENT_USER"
|
||||
-- or "HKEY_LOCAL_MACHINE"
|
||||
|
||||
*/
|
||||
|
||||
namespace Director {
|
||||
|
||||
const char *RegistryReaderXtra::xlibName = "RegistryReader";
|
||||
const XlibFileDesc RegistryReaderXtra::fileNames[] = {
|
||||
{ "registryreader", nullptr },
|
||||
{ "RegRead", nullptr },
|
||||
{ nullptr, nullptr },
|
||||
};
|
||||
|
||||
static MethodProto xlibMethods[] = {
|
||||
{ "new", RegistryReaderXtra::m_new, 0, 0, 500 },
|
||||
|
||||
{ nullptr, nullptr, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static BuiltinProto xlibBuiltins[] = {
|
||||
{ "GetPrivateProfileString", RegistryReaderXtra::m_GetPrivateProfileString, 4, 4, 500, HBLTIN },
|
||||
{ "ReadRegistryValue", RegistryReaderXtra::m_ReadRegistryValue, 2, 2, 500, HBLTIN },
|
||||
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
|
||||
};
|
||||
|
||||
RegistryReaderXtraObject::RegistryReaderXtraObject(ObjectType ObjectType) :Object<RegistryReaderXtraObject>("RegistryReader") {
|
||||
_objType = ObjectType;
|
||||
}
|
||||
|
||||
bool RegistryReaderXtraObject::hasProp(const Common::String &propName) {
|
||||
return (propName == "name");
|
||||
}
|
||||
|
||||
Datum RegistryReaderXtraObject::getProp(const Common::String &propName) {
|
||||
if (propName == "name")
|
||||
return Datum(RegistryReaderXtra::xlibName);
|
||||
warning("RegistryReaderXtra::getProp: unknown property '%s'", propName.c_str());
|
||||
return Datum();
|
||||
}
|
||||
|
||||
void RegistryReaderXtra::open(ObjectType type, const Common::Path &path) {
|
||||
RegistryReaderXtraObject::initMethods(xlibMethods);
|
||||
RegistryReaderXtraObject *xobj = new RegistryReaderXtraObject(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 RegistryReaderXtra::close(ObjectType type) {
|
||||
RegistryReaderXtraObject::cleanupMethods();
|
||||
g_lingo->_globalvars[xlibName] = Datum();
|
||||
|
||||
}
|
||||
|
||||
void RegistryReaderXtra::m_new(int nargs) {
|
||||
g_lingo->printSTUBWithArglist("RegistryReaderXtra::m_new", nargs);
|
||||
g_lingo->dropStack(nargs);
|
||||
g_lingo->push(g_lingo->_state->me);
|
||||
}
|
||||
|
||||
XOBJSTUB(RegistryReaderXtra::m_GetPrivateProfileString, 0)
|
||||
XOBJSTUB(RegistryReaderXtra::m_ReadRegistryValue, 0)
|
||||
|
||||
}
|
||||
51
engines/director/lingo/xtras/r/registryreader.h
Normal file
51
engines/director/lingo/xtras/r/registryreader.h
Normal file
@@ -0,0 +1,51 @@
|
||||
/* 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_XTRAS_R_REGISTRYREADER_H
|
||||
#define DIRECTOR_LINGO_XTRAS_R_REGISTRYREADER_H
|
||||
|
||||
namespace Director {
|
||||
|
||||
class RegistryReaderXtraObject : public Object<RegistryReaderXtraObject> {
|
||||
public:
|
||||
RegistryReaderXtraObject(ObjectType objType);
|
||||
|
||||
bool hasProp(const Common::String &propName) override;
|
||||
Datum getProp(const Common::String &propName) override;
|
||||
};
|
||||
|
||||
namespace RegistryReaderXtra {
|
||||
|
||||
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_GetPrivateProfileString(int nargs);
|
||||
void m_ReadRegistryValue(int nargs);
|
||||
|
||||
} // End of namespace RegistryReaderXtra
|
||||
|
||||
} // End of namespace Director
|
||||
|
||||
#endif
|
||||
232
engines/director/lingo/xtras/rtk.cpp
Normal file
232
engines/director/lingo/xtras/rtk.cpp
Normal file
@@ -0,0 +1,232 @@
|
||||
/* 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/movie.h"
|
||||
#include "director/score.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/xtras/rtk.h"
|
||||
|
||||
/**************************************************
|
||||
*
|
||||
* USED IN:
|
||||
* Cracking the Conspiracy
|
||||
*
|
||||
**************************************************/
|
||||
|
||||
// Usage instructions
|
||||
// http://web.archive.org/web/19991008052339/http://www.penworks.com/xtras/rtk/about.cgi
|
||||
|
||||
/*
|
||||
-- xtra Rollover_Toolkit
|
||||
-- Rollover Toolkit (tm)
|
||||
-- by Penworks Corporation
|
||||
-- Copyright (c) 1996 by Penworks Corporation.
|
||||
-- All rights reserved.
|
||||
-- Net: admin@penworks.com Web: http://www.penworks.com
|
||||
new object me
|
||||
* CheckForRollovers * -- Put this in your 'on idle' handler
|
||||
* CurrentRollover -- Returns number of sprite rolled over
|
||||
* EndAnyRollovers -- Forces all activated rollovers to end
|
||||
* ResetRollovers -- Clears any pending rollovers
|
||||
* EnableCastmemberDetection -- Takes cast member changes into account
|
||||
* DisableCastmemberDetection -- Ignores cast member changes (the default)
|
||||
* GetCastmemberDetectionStatus -- Returns TRUE if detecting cast member changes
|
||||
* AutoSetSpriteRange -- One-time check to find active sprites
|
||||
* MonitorAllSprites -- Watches all sprites (default)
|
||||
* MonitorNoSprites -- Watches no sprites
|
||||
* MonitorSpriteRange integer, integer -- Set specific range of sprites to check
|
||||
* UnMonitorSpriteRange integer, integer -- Frees specific range of sprites from checking
|
||||
* MonitorSprite integer -- Watches particular sprite
|
||||
* UnMonitorSprite integer -- Removes watch from a particular sprite
|
||||
* GetMonitorStatus integer -- Returns TRUE if specified sprite is monitored
|
||||
* DumpMonitorStatus -- Dumps the rollover status list to the message window
|
||||
* ShowRTKVersion -- Displays the current version number and date of the Toolkit
|
||||
* EnableMatteDetection -- Checks for Matte ink rollovers
|
||||
* DisableMatteDetection -- Disables Matte ink detection (default)
|
||||
* GetMatteDetectionStatus -- Returns TRUE if Matte detection is on
|
||||
* rtkRegisterMac string -- Registers for use on Macintosh
|
||||
* rtkRegisterX16 string -- Registers for use on 16-bit Windows
|
||||
* rtkRegisterX32 string -- Registers for use on 32-bit Windows
|
||||
|
||||
*/
|
||||
|
||||
namespace Director {
|
||||
|
||||
const char *RolloverToolkitXtra::xlibName = "RolloverToolkit";
|
||||
const XlibFileDesc RolloverToolkitXtra::fileNames[] = {
|
||||
{ "RTK", nullptr },
|
||||
{ "rollover_toolkit", nullptr },
|
||||
{ nullptr, nullptr },
|
||||
};
|
||||
|
||||
static MethodProto xlibMethods[] = {
|
||||
{ "new", RolloverToolkitXtra::m_new, 0, 0, 500 },
|
||||
{ nullptr, nullptr, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static BuiltinProto xlibBuiltins[] = {
|
||||
{ "CheckForRollovers", RolloverToolkitXtra::m_CheckForRollovers, -1, 0, 500, HBLTIN },
|
||||
{ "CurrentRollover", RolloverToolkitXtra::m_CurrentRollover, 0, 0, 500, HBLTIN },
|
||||
{ "EndAnyRollovers", RolloverToolkitXtra::m_EndAnyRollovers, 0, 0, 500, HBLTIN },
|
||||
{ "ResetRollovers", RolloverToolkitXtra::m_ResetRollovers, 0, 0, 500, HBLTIN },
|
||||
{ "EnableCastmemberDetection", RolloverToolkitXtra::m_EnableCastmemberDetection, 0, 0, 500, HBLTIN },
|
||||
{ "DisableCastmemberDetection", RolloverToolkitXtra::m_DisableCastmemberDetection, 0, 0, 500, HBLTIN },
|
||||
{ "GetCastmemberDetectionStatus", RolloverToolkitXtra::m_GetCastmemberDetectionStatus, 0, 0, 500, HBLTIN },
|
||||
{ "AutoSetSpriteRange", RolloverToolkitXtra::m_AutoSetSpriteRange, 0, 0, 500, HBLTIN },
|
||||
{ "MonitorAllSprites", RolloverToolkitXtra::m_MonitorAllSprites, 0, 0, 500, HBLTIN },
|
||||
{ "MonitorNoSprites", RolloverToolkitXtra::m_MonitorNoSprites, 0, 0, 500, HBLTIN },
|
||||
{ "MonitorSpriteRange", RolloverToolkitXtra::m_MonitorSpriteRange, 2, 2, 500, HBLTIN },
|
||||
{ "UnMonitorSpriteRange", RolloverToolkitXtra::m_UnMonitorSpriteRange, 2, 2, 500, HBLTIN },
|
||||
{ "MonitorSprite", RolloverToolkitXtra::m_MonitorSprite, 1, 1, 500, HBLTIN },
|
||||
{ "UnMonitorSprite", RolloverToolkitXtra::m_UnMonitorSprite, 1, 1, 500, HBLTIN },
|
||||
{ "GetMonitorStatus", RolloverToolkitXtra::m_GetMonitorStatus, 1, 1, 500, HBLTIN },
|
||||
{ "DumpMonitorStatus", RolloverToolkitXtra::m_DumpMonitorStatus, 0, 0, 500, HBLTIN },
|
||||
{ "ShowRTKVersion", RolloverToolkitXtra::m_ShowRTKVersion, 0, 0, 500, HBLTIN },
|
||||
{ "EnableMatteDetection", RolloverToolkitXtra::m_EnableMatteDetection, 0, 0, 500, HBLTIN },
|
||||
{ "DisableMatteDetection", RolloverToolkitXtra::m_DisableMatteDetection, 0, 0, 500, HBLTIN },
|
||||
{ "GetMatteDetectionStatus", RolloverToolkitXtra::m_GetMatteDetectionStatus, 0, 0, 500, HBLTIN },
|
||||
{ "rtkRegisterMac", RolloverToolkitXtra::m_rtkRegisterMac, 1, 1, 500, HBLTIN },
|
||||
{ "rtkRegisterX16", RolloverToolkitXtra::m_rtkRegisterX16, 1, 1, 500, HBLTIN },
|
||||
{ "rtkRegisterX32", RolloverToolkitXtra::m_rtkRegisterX32, 1, 1, 500, HBLTIN },
|
||||
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
|
||||
};
|
||||
|
||||
class RolloverToolkitXtraState : public Object<RolloverToolkitXtraState> {
|
||||
public:
|
||||
RolloverToolkitXtraState() : Object<RolloverToolkitXtraState>("Rollover_Toolkit") {};
|
||||
|
||||
Common::HashMap<int, int> lastSprite;
|
||||
};
|
||||
|
||||
RolloverToolkitXtraObject::RolloverToolkitXtraObject(ObjectType ObjectType) :Object<RolloverToolkitXtraObject>("RolloverToolkit") {
|
||||
_objType = ObjectType;
|
||||
}
|
||||
|
||||
bool RolloverToolkitXtraObject::hasProp(const Common::String &propName) {
|
||||
return (propName == "name");
|
||||
}
|
||||
|
||||
Datum RolloverToolkitXtraObject::getProp(const Common::String &propName) {
|
||||
if (propName == "name")
|
||||
return Datum(RolloverToolkitXtra::xlibName);
|
||||
warning("RolloverToolkitXtra::getProp: unknown property '%s'", propName.c_str());
|
||||
return Datum();
|
||||
}
|
||||
|
||||
void RolloverToolkitXtra::open(ObjectType type, const Common::Path &path) {
|
||||
RolloverToolkitXtraObject::initMethods(xlibMethods);
|
||||
RolloverToolkitXtraObject *xobj = new RolloverToolkitXtraObject(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);
|
||||
if (!g_lingo->_openXtrasState.contains("Rollover_Toolkit")) {
|
||||
RolloverToolkitXtraState *state = new RolloverToolkitXtraState();
|
||||
g_lingo->_openXtrasState.setVal("Rollover_Toolkit", state);
|
||||
}
|
||||
// Add some extra mappings for event compatibility
|
||||
g_lingo->_eventHandlerTypeIds["startRollover"] = kEventMouseEnter;
|
||||
g_lingo->_eventHandlerTypeIds["endRollover"] = kEventMouseLeave;
|
||||
}
|
||||
|
||||
void RolloverToolkitXtra::close(ObjectType type) {
|
||||
RolloverToolkitXtraObject::cleanupMethods();
|
||||
g_lingo->_globalvars[xlibName] = Datum();
|
||||
}
|
||||
|
||||
void RolloverToolkitXtra::m_new(int nargs) {
|
||||
g_lingo->printSTUBWithArglist("RolloverToolkitXtra::m_new", nargs);
|
||||
g_lingo->dropStack(nargs);
|
||||
g_lingo->push(g_lingo->_state->me);
|
||||
}
|
||||
|
||||
void RolloverToolkitXtra::m_CheckForRollovers(int nargs) {
|
||||
// We don't need any hints about what the current rollover is
|
||||
g_lingo->dropStack(nargs);
|
||||
|
||||
// check what the current rolled over sprite is
|
||||
// if it's new
|
||||
// - check if there's an on endRollover handler, provide old sprite as arg 1
|
||||
// - check if there's a on startRollover handler, provide new sprite as arg 1
|
||||
Window *window = g_director->getCurrentWindow();
|
||||
Movie *movie = window->getCurrentMovie();
|
||||
Score *score = movie->getScore();
|
||||
|
||||
if (!score) {
|
||||
warning("RolloverToolkitXtra::m_CheckForRollovers: Reference to an empty score");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!g_lingo->_openXtrasState.contains("Rollover_Toolkit")) {
|
||||
warning("RolloverToolkitXtra::m_CheckForRollovers: Missing state");
|
||||
return;
|
||||
}
|
||||
RolloverToolkitXtraState *state = (RolloverToolkitXtraState *)g_lingo->_openXtrasState.getVal("Rollover_Toolkit");
|
||||
|
||||
|
||||
Common::Point pos = g_director->getCurrentWindow()->getMousePos();
|
||||
int lastSprite = state->lastSprite.getValOrDefault(window->getId(), 0);
|
||||
|
||||
int newSprite = score->getRollOverSpriteIDFromPos(pos);
|
||||
if (newSprite != lastSprite && lastSprite != 0) {
|
||||
// try and call endRollover(lastSprite)
|
||||
movie->queueInputEvent(kEventMouseLeave, lastSprite, pos);
|
||||
}
|
||||
if (newSprite != lastSprite && newSprite != 0) {
|
||||
// try and call startRollover(lastSprite)
|
||||
movie->queueInputEvent(kEventMouseEnter, newSprite, pos);
|
||||
}
|
||||
state->lastSprite[window->getId()] = newSprite;
|
||||
}
|
||||
|
||||
|
||||
XOBJSTUB(RolloverToolkitXtra::m_CurrentRollover, 0)
|
||||
XOBJSTUB(RolloverToolkitXtra::m_EndAnyRollovers, 0)
|
||||
XOBJSTUB(RolloverToolkitXtra::m_ResetRollovers, 0)
|
||||
XOBJSTUB(RolloverToolkitXtra::m_EnableCastmemberDetection, 0)
|
||||
XOBJSTUB(RolloverToolkitXtra::m_DisableCastmemberDetection, 0)
|
||||
XOBJSTUB(RolloverToolkitXtra::m_GetCastmemberDetectionStatus, 0)
|
||||
XOBJSTUB(RolloverToolkitXtra::m_AutoSetSpriteRange, 0)
|
||||
XOBJSTUB(RolloverToolkitXtra::m_MonitorAllSprites, 0)
|
||||
XOBJSTUB(RolloverToolkitXtra::m_MonitorNoSprites, 0)
|
||||
XOBJSTUB(RolloverToolkitXtra::m_MonitorSpriteRange, 0)
|
||||
XOBJSTUB(RolloverToolkitXtra::m_UnMonitorSpriteRange, 0)
|
||||
XOBJSTUB(RolloverToolkitXtra::m_MonitorSprite, 0)
|
||||
XOBJSTUB(RolloverToolkitXtra::m_UnMonitorSprite, 0)
|
||||
XOBJSTUB(RolloverToolkitXtra::m_GetMonitorStatus, 0)
|
||||
XOBJSTUB(RolloverToolkitXtra::m_DumpMonitorStatus, 0)
|
||||
XOBJSTUB(RolloverToolkitXtra::m_ShowRTKVersion, 0)
|
||||
XOBJSTUB(RolloverToolkitXtra::m_EnableMatteDetection, 0)
|
||||
XOBJSTUB(RolloverToolkitXtra::m_DisableMatteDetection, 0)
|
||||
XOBJSTUB(RolloverToolkitXtra::m_GetMatteDetectionStatus, 0)
|
||||
XOBJSTUB(RolloverToolkitXtra::m_rtkRegisterMac, 0)
|
||||
XOBJSTUB(RolloverToolkitXtra::m_rtkRegisterX16, 0)
|
||||
XOBJSTUB(RolloverToolkitXtra::m_rtkRegisterX32, 0)
|
||||
|
||||
}
|
||||
72
engines/director/lingo/xtras/rtk.h
Normal file
72
engines/director/lingo/xtras/rtk.h
Normal file
@@ -0,0 +1,72 @@
|
||||
/* 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_XTRAS_RTK_H
|
||||
#define DIRECTOR_LINGO_XTRAS_RTK_H
|
||||
|
||||
namespace Director {
|
||||
|
||||
class RolloverToolkitXtraObject : public Object<RolloverToolkitXtraObject> {
|
||||
public:
|
||||
RolloverToolkitXtraObject(ObjectType objType);
|
||||
|
||||
bool hasProp(const Common::String &propName) override;
|
||||
Datum getProp(const Common::String &propName) override;
|
||||
};
|
||||
|
||||
namespace RolloverToolkitXtra {
|
||||
|
||||
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_CheckForRollovers(int nargs);
|
||||
void m_CurrentRollover(int nargs);
|
||||
void m_EndAnyRollovers(int nargs);
|
||||
void m_ResetRollovers(int nargs);
|
||||
void m_EnableCastmemberDetection(int nargs);
|
||||
void m_DisableCastmemberDetection(int nargs);
|
||||
void m_GetCastmemberDetectionStatus(int nargs);
|
||||
void m_AutoSetSpriteRange(int nargs);
|
||||
void m_MonitorAllSprites(int nargs);
|
||||
void m_MonitorNoSprites(int nargs);
|
||||
void m_MonitorSpriteRange(int nargs);
|
||||
void m_UnMonitorSpriteRange(int nargs);
|
||||
void m_MonitorSprite(int nargs);
|
||||
void m_UnMonitorSprite(int nargs);
|
||||
void m_GetMonitorStatus(int nargs);
|
||||
void m_DumpMonitorStatus(int nargs);
|
||||
void m_ShowRTKVersion(int nargs);
|
||||
void m_EnableMatteDetection(int nargs);
|
||||
void m_DisableMatteDetection(int nargs);
|
||||
void m_GetMatteDetectionStatus(int nargs);
|
||||
void m_rtkRegisterMac(int nargs);
|
||||
void m_rtkRegisterX16(int nargs);
|
||||
void m_rtkRegisterX32(int nargs);
|
||||
|
||||
} // End of namespace RolloverToolkitXtra
|
||||
|
||||
} // End of namespace Director
|
||||
|
||||
#endif
|
||||
207
engines/director/lingo/xtras/s/smacker.cpp
Normal file
207
engines/director/lingo/xtras/s/smacker.cpp
Normal file
@@ -0,0 +1,207 @@
|
||||
/* 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/xtras/s/smacker.h"
|
||||
|
||||
/**************************************************
|
||||
*
|
||||
* USED IN:
|
||||
* I Spy Spooky House
|
||||
*
|
||||
**************************************************/
|
||||
|
||||
/*
|
||||
-- xtra Smacker
|
||||
-- An Xtra for playing Smacker animations.
|
||||
-- Version 3.1q
|
||||
------------------------------------------
|
||||
new object
|
||||
*SmackQuickPlay string, integer, integer, string
|
||||
*SmackQuickPlayTrans string, integer, integer, integer, integer, integer
|
||||
SmackOpen object, string, integer, integer
|
||||
SmackOpenTrans object, string, integer, integer, integer, integer, integer
|
||||
SmackClose object
|
||||
SmackPlay object
|
||||
SmackPlayFrames object, integer, integer
|
||||
SmackPlayLooped object, integer
|
||||
SmackPlayNext object, integer
|
||||
SmackRemapToSystemPalette object
|
||||
SmackRemapToPalette object, string, string
|
||||
SmackRemapToBitmap object, string, string
|
||||
SmackSetWindowStyle object, string
|
||||
SmackSetWindowTitle object, string
|
||||
SmackSetTransBackground object, string, string, integer, integer, integer
|
||||
SmackSetInterfaceKeys object, string
|
||||
SmackSetBitmap object, string, string
|
||||
SmackSetPosition object, integer, integer
|
||||
SmackSetAlignment object, integer
|
||||
SmackGoto object, integer
|
||||
SmackGetFramesPerSecond object
|
||||
SmackGetFrameNum object
|
||||
SmackGetFrames object
|
||||
SmackGetHeight object
|
||||
SmackGetWidth object
|
||||
SmackGetLastKey object
|
||||
SmackGetMouseX object
|
||||
SmackGetMouseY object
|
||||
SmackGetMouseClickX object
|
||||
SmackGetMouseClickY object
|
||||
SmackHideVideo object, integer
|
||||
SmackSetDisplayMode object, integer
|
||||
SmackGetSummary object
|
||||
SmackScreenMethod object, integer
|
||||
|
||||
*/
|
||||
|
||||
namespace Director {
|
||||
|
||||
const char *SmackerXtra::xlibName = "Smacker";
|
||||
const XlibFileDesc SmackerXtra::fileNames[] = {
|
||||
{ "smacker", nullptr },
|
||||
{ "Smackx32", nullptr },
|
||||
{ "SmackerXtra", nullptr },
|
||||
{ nullptr, nullptr },
|
||||
};
|
||||
|
||||
static MethodProto xlibMethods[] = {
|
||||
{ "new", SmackerXtra::m_new, 0, 0, 500 },
|
||||
{ "SmackOpen", SmackerXtra::m_SmackOpen, 3, 3, 500 },
|
||||
{ "SmackOpenTrans", SmackerXtra::m_SmackOpenTrans, 6, 6, 500 },
|
||||
{ "SmackClose", SmackerXtra::m_SmackClose, 0, 0, 500 },
|
||||
{ "SmackPlay", SmackerXtra::m_SmackPlay, 0, 0, 500 },
|
||||
{ "SmackPlayFrames", SmackerXtra::m_SmackPlayFrames, 2, 2, 500 },
|
||||
{ "SmackPlayLooped", SmackerXtra::m_SmackPlayLooped, 1, 1, 500 },
|
||||
{ "SmackPlayNext", SmackerXtra::m_SmackPlayNext, 1, 1, 500 },
|
||||
{ "SmackRemapToSystemPalette", SmackerXtra::m_SmackRemapToSystemPalette, 0, 0, 500 },
|
||||
{ "SmackRemapToPalette", SmackerXtra::m_SmackRemapToPalette, 2, 2, 500 },
|
||||
{ "SmackRemapToBitmap", SmackerXtra::m_SmackRemapToBitmap, 2, 2, 500 },
|
||||
{ "SmackSetWindowStyle", SmackerXtra::m_SmackSetWindowStyle, 1, 1, 500 },
|
||||
{ "SmackSetWindowTitle", SmackerXtra::m_SmackSetWindowTitle, 1, 1, 500 },
|
||||
{ "SmackSetTransBackground", SmackerXtra::m_SmackSetTransBackground, 5, 5, 500 },
|
||||
{ "SmackSetInterfaceKeys", SmackerXtra::m_SmackSetInterfaceKeys, 1, 1, 500 },
|
||||
{ "SmackSetBitmap", SmackerXtra::m_SmackSetBitmap, 2, 2, 500 },
|
||||
{ "SmackSetPosition", SmackerXtra::m_SmackSetPosition, 2, 2, 500 },
|
||||
{ "SmackSetAlignment", SmackerXtra::m_SmackSetAlignment, 1, 1, 500 },
|
||||
{ "SmackGoto", SmackerXtra::m_SmackGoto, 1, 1, 500 },
|
||||
{ "SmackGetFramesPerSecond", SmackerXtra::m_SmackGetFramesPerSecond, 0, 0, 500 },
|
||||
{ "SmackGetFrameNum", SmackerXtra::m_SmackGetFrameNum, 0, 0, 500 },
|
||||
{ "SmackGetFrames", SmackerXtra::m_SmackGetFrames, 0, 0, 500 },
|
||||
{ "SmackGetHeight", SmackerXtra::m_SmackGetHeight, 0, 0, 500 },
|
||||
{ "SmackGetWidth", SmackerXtra::m_SmackGetWidth, 0, 0, 500 },
|
||||
{ "SmackGetLastKey", SmackerXtra::m_SmackGetLastKey, 0, 0, 500 },
|
||||
{ "SmackGetMouseX", SmackerXtra::m_SmackGetMouseX, 0, 0, 500 },
|
||||
{ "SmackGetMouseY", SmackerXtra::m_SmackGetMouseY, 0, 0, 500 },
|
||||
{ "SmackGetMouseClickX", SmackerXtra::m_SmackGetMouseClickX, 0, 0, 500 },
|
||||
{ "SmackGetMouseClickY", SmackerXtra::m_SmackGetMouseClickY, 0, 0, 500 },
|
||||
{ "SmackHideVideo", SmackerXtra::m_SmackHideVideo, 1, 1, 500 },
|
||||
{ "SmackSetDisplayMode", SmackerXtra::m_SmackSetDisplayMode, 1, 1, 500 },
|
||||
{ "SmackGetSummary", SmackerXtra::m_SmackGetSummary, 0, 0, 500 },
|
||||
{ "SmackScreenMethod", SmackerXtra::m_SmackScreenMethod, 1, 1, 500 },
|
||||
|
||||
{ nullptr, nullptr, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static BuiltinProto xlibBuiltins[] = {
|
||||
{ "SmackQuickPlay", SmackerXtra::m_SmackQuickPlay, 4, 4, 500, HBLTIN },
|
||||
{ "SmackQuickPlayTrans", SmackerXtra::m_SmackQuickPlayTrans, 6, 6, 500, HBLTIN },
|
||||
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
|
||||
};
|
||||
|
||||
SmackerXtraObject::SmackerXtraObject(ObjectType ObjectType) :Object<SmackerXtraObject>("Smacker") {
|
||||
_objType = ObjectType;
|
||||
}
|
||||
|
||||
bool SmackerXtraObject::hasProp(const Common::String &propName) {
|
||||
return (propName == "name");
|
||||
}
|
||||
|
||||
Datum SmackerXtraObject::getProp(const Common::String &propName) {
|
||||
if (propName == "name")
|
||||
return Datum(SmackerXtra::xlibName);
|
||||
warning("SmackerXtra::getProp: unknown property '%s'", propName.c_str());
|
||||
return Datum();
|
||||
}
|
||||
|
||||
void SmackerXtra::open(ObjectType type, const Common::Path &path) {
|
||||
SmackerXtraObject::initMethods(xlibMethods);
|
||||
SmackerXtraObject *xobj = new SmackerXtraObject(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 SmackerXtra::close(ObjectType type) {
|
||||
SmackerXtraObject::cleanupMethods();
|
||||
g_lingo->_globalvars[xlibName] = Datum();
|
||||
|
||||
}
|
||||
|
||||
void SmackerXtra::m_new(int nargs) {
|
||||
g_lingo->printSTUBWithArglist("SmackerXtra::m_new", nargs);
|
||||
g_lingo->dropStack(nargs);
|
||||
g_lingo->push(g_lingo->_state->me);
|
||||
}
|
||||
|
||||
XOBJSTUB(SmackerXtra::m_SmackQuickPlay, 0)
|
||||
XOBJSTUB(SmackerXtra::m_SmackQuickPlayTrans, 0)
|
||||
XOBJSTUB(SmackerXtra::m_SmackOpen, 0)
|
||||
XOBJSTUB(SmackerXtra::m_SmackOpenTrans, 0)
|
||||
XOBJSTUB(SmackerXtra::m_SmackClose, 0)
|
||||
XOBJSTUB(SmackerXtra::m_SmackPlay, 0)
|
||||
XOBJSTUB(SmackerXtra::m_SmackPlayFrames, 0)
|
||||
XOBJSTUB(SmackerXtra::m_SmackPlayLooped, 0)
|
||||
XOBJSTUB(SmackerXtra::m_SmackPlayNext, 0)
|
||||
XOBJSTUB(SmackerXtra::m_SmackRemapToSystemPalette, 0)
|
||||
XOBJSTUB(SmackerXtra::m_SmackRemapToPalette, 0)
|
||||
XOBJSTUB(SmackerXtra::m_SmackRemapToBitmap, 0)
|
||||
XOBJSTUB(SmackerXtra::m_SmackSetWindowStyle, 0)
|
||||
XOBJSTUB(SmackerXtra::m_SmackSetWindowTitle, 0)
|
||||
XOBJSTUB(SmackerXtra::m_SmackSetTransBackground, 0)
|
||||
XOBJSTUB(SmackerXtra::m_SmackSetInterfaceKeys, 0)
|
||||
XOBJSTUB(SmackerXtra::m_SmackSetBitmap, 0)
|
||||
XOBJSTUB(SmackerXtra::m_SmackSetPosition, 0)
|
||||
XOBJSTUB(SmackerXtra::m_SmackSetAlignment, 0)
|
||||
XOBJSTUB(SmackerXtra::m_SmackGoto, 0)
|
||||
XOBJSTUB(SmackerXtra::m_SmackGetFramesPerSecond, 0)
|
||||
XOBJSTUB(SmackerXtra::m_SmackGetFrameNum, 0)
|
||||
XOBJSTUB(SmackerXtra::m_SmackGetFrames, 0)
|
||||
XOBJSTUB(SmackerXtra::m_SmackGetHeight, 0)
|
||||
XOBJSTUB(SmackerXtra::m_SmackGetWidth, 0)
|
||||
XOBJSTUB(SmackerXtra::m_SmackGetLastKey, 0)
|
||||
XOBJSTUB(SmackerXtra::m_SmackGetMouseX, 0)
|
||||
XOBJSTUB(SmackerXtra::m_SmackGetMouseY, 0)
|
||||
XOBJSTUB(SmackerXtra::m_SmackGetMouseClickX, 0)
|
||||
XOBJSTUB(SmackerXtra::m_SmackGetMouseClickY, 0)
|
||||
XOBJSTUB(SmackerXtra::m_SmackHideVideo, 0)
|
||||
XOBJSTUB(SmackerXtra::m_SmackSetDisplayMode, 0)
|
||||
XOBJSTUB(SmackerXtra::m_SmackGetSummary, 0)
|
||||
XOBJSTUB(SmackerXtra::m_SmackScreenMethod, 0)
|
||||
|
||||
}
|
||||
83
engines/director/lingo/xtras/s/smacker.h
Normal file
83
engines/director/lingo/xtras/s/smacker.h
Normal file
@@ -0,0 +1,83 @@
|
||||
/* 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_XTRAS_S_SMACKER_H
|
||||
#define DIRECTOR_LINGO_XTRAS_S_SMACKER_H
|
||||
|
||||
namespace Director {
|
||||
|
||||
class SmackerXtraObject : public Object<SmackerXtraObject> {
|
||||
public:
|
||||
SmackerXtraObject(ObjectType objType);
|
||||
|
||||
bool hasProp(const Common::String &propName) override;
|
||||
Datum getProp(const Common::String &propName) override;
|
||||
};
|
||||
|
||||
namespace SmackerXtra {
|
||||
|
||||
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_SmackQuickPlay(int nargs);
|
||||
void m_SmackQuickPlayTrans(int nargs);
|
||||
void m_SmackOpen(int nargs);
|
||||
void m_SmackOpenTrans(int nargs);
|
||||
void m_SmackClose(int nargs);
|
||||
void m_SmackPlay(int nargs);
|
||||
void m_SmackPlayFrames(int nargs);
|
||||
void m_SmackPlayLooped(int nargs);
|
||||
void m_SmackPlayNext(int nargs);
|
||||
void m_SmackRemapToSystemPalette(int nargs);
|
||||
void m_SmackRemapToPalette(int nargs);
|
||||
void m_SmackRemapToBitmap(int nargs);
|
||||
void m_SmackSetWindowStyle(int nargs);
|
||||
void m_SmackSetWindowTitle(int nargs);
|
||||
void m_SmackSetTransBackground(int nargs);
|
||||
void m_SmackSetInterfaceKeys(int nargs);
|
||||
void m_SmackSetBitmap(int nargs);
|
||||
void m_SmackSetPosition(int nargs);
|
||||
void m_SmackSetAlignment(int nargs);
|
||||
void m_SmackGoto(int nargs);
|
||||
void m_SmackGetFramesPerSecond(int nargs);
|
||||
void m_SmackGetFrameNum(int nargs);
|
||||
void m_SmackGetFrames(int nargs);
|
||||
void m_SmackGetHeight(int nargs);
|
||||
void m_SmackGetWidth(int nargs);
|
||||
void m_SmackGetLastKey(int nargs);
|
||||
void m_SmackGetMouseX(int nargs);
|
||||
void m_SmackGetMouseY(int nargs);
|
||||
void m_SmackGetMouseClickX(int nargs);
|
||||
void m_SmackGetMouseClickY(int nargs);
|
||||
void m_SmackHideVideo(int nargs);
|
||||
void m_SmackSetDisplayMode(int nargs);
|
||||
void m_SmackGetSummary(int nargs);
|
||||
void m_SmackScreenMethod(int nargs);
|
||||
|
||||
} // End of namespace SmackerXtra
|
||||
|
||||
} // End of namespace Director
|
||||
|
||||
#endif
|
||||
122
engines/director/lingo/xtras/s/staytoonedball.cpp
Normal file
122
engines/director/lingo/xtras/s/staytoonedball.cpp
Normal 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/xtras/s/staytoonedball.h"
|
||||
|
||||
/**************************************************
|
||||
*
|
||||
* USED IN:
|
||||
* Stay Tooned
|
||||
*
|
||||
**************************************************/
|
||||
|
||||
/*
|
||||
-- xtra Toon -- Fridge Fight 7/15/96 Programmer: Keith Laverty FunnyBone Interactive
|
||||
new object me
|
||||
* mInitRandom integer SomeThing -- feeds a number bewteen 1-100 to the Random# Array
|
||||
* mInitGame integer NUM1,integer NUM2 -- Cast Size
|
||||
* mOPERATEGAME integer NUM1, integer NUM2, integer NUM3, integer NUM4 -- feeds a number bewteen 1-100 to the Random# Array
|
||||
* mGactions -- feeds a number bewteen 1-100 to the Random# Array
|
||||
* mGetInfo integer NUM1, integer NUM2, integer NUM3 -- feeds a number bewteen 1-100 to the Random# Array
|
||||
* mSetSize integer NUM1,integer NUM2,integer NUM3,integer NUM4,integer NUM5,integer NUM6 -- Cast Size
|
||||
* mAddStuff integer NUM1,integer NUM2 -- feeds a number bewteen 1-100 to the Random# Array
|
||||
|
||||
*/
|
||||
|
||||
namespace Director {
|
||||
|
||||
const char *StayToonedBallXtra::xlibName = "Toon";
|
||||
const XlibFileDesc StayToonedBallXtra::fileNames[] = {
|
||||
{ "ball", "staytooned" },
|
||||
{ "ball_mac", "staytooned" },
|
||||
{ nullptr, nullptr },
|
||||
};
|
||||
|
||||
static MethodProto xlibMethods[] = {
|
||||
{ "new", StayToonedBallXtra::m_new, 0, 0, 500 },
|
||||
|
||||
{ nullptr, nullptr, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static BuiltinProto xlibBuiltins[] = {
|
||||
{ "mInitRandom", StayToonedBallXtra::m_mInitRandom, 1, 1, 500, HBLTIN },
|
||||
{ "mInitGame", StayToonedBallXtra::m_mInitGame, 2, 2, 500, HBLTIN },
|
||||
{ "mOPERATEGAME", StayToonedBallXtra::m_mOPERATEGAME, 4, 4, 500, HBLTIN },
|
||||
{ "mGactions", StayToonedBallXtra::m_mGactions, 0, 0, 500, HBLTIN },
|
||||
{ "mGetInfo", StayToonedBallXtra::m_mGetInfo, 3, 3, 500, HBLTIN },
|
||||
{ "mSetSize", StayToonedBallXtra::m_mSetSize, 6, 6, 500, HBLTIN },
|
||||
{ "mAddStuff", StayToonedBallXtra::m_mAddStuff, 2, 2, 500, HBLTIN },
|
||||
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
|
||||
};
|
||||
|
||||
StayToonedBallXtraObject::StayToonedBallXtraObject(ObjectType ObjectType) :Object<StayToonedBallXtraObject>("StayToonedBall") {
|
||||
_objType = ObjectType;
|
||||
}
|
||||
|
||||
bool StayToonedBallXtraObject::hasProp(const Common::String &propName) {
|
||||
return (propName == "name");
|
||||
}
|
||||
|
||||
Datum StayToonedBallXtraObject::getProp(const Common::String &propName) {
|
||||
if (propName == "name")
|
||||
return Datum(StayToonedBallXtra::xlibName);
|
||||
warning("StayToonedBallXtra::getProp: unknown property '%s'", propName.c_str());
|
||||
return Datum();
|
||||
}
|
||||
|
||||
void StayToonedBallXtra::open(ObjectType type, const Common::Path &path) {
|
||||
StayToonedBallXtraObject::initMethods(xlibMethods);
|
||||
StayToonedBallXtraObject *xobj = new StayToonedBallXtraObject(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 StayToonedBallXtra::close(ObjectType type) {
|
||||
StayToonedBallXtraObject::cleanupMethods();
|
||||
g_lingo->_globalvars[xlibName] = Datum();
|
||||
|
||||
}
|
||||
|
||||
void StayToonedBallXtra::m_new(int nargs) {
|
||||
g_lingo->printSTUBWithArglist("StayToonedBallXtra::m_new", nargs);
|
||||
g_lingo->dropStack(nargs);
|
||||
g_lingo->push(g_lingo->_state->me);
|
||||
}
|
||||
|
||||
XOBJSTUB(StayToonedBallXtra::m_mInitRandom, 0)
|
||||
XOBJSTUB(StayToonedBallXtra::m_mInitGame, 0)
|
||||
XOBJSTUB(StayToonedBallXtra::m_mOPERATEGAME, 0)
|
||||
XOBJSTUB(StayToonedBallXtra::m_mGactions, 0)
|
||||
XOBJSTUB(StayToonedBallXtra::m_mGetInfo, 0)
|
||||
XOBJSTUB(StayToonedBallXtra::m_mSetSize, 0)
|
||||
XOBJSTUB(StayToonedBallXtra::m_mAddStuff, 0)
|
||||
|
||||
}
|
||||
56
engines/director/lingo/xtras/s/staytoonedball.h
Normal file
56
engines/director/lingo/xtras/s/staytoonedball.h
Normal file
@@ -0,0 +1,56 @@
|
||||
/* 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_XTRAS_S_STAYTOONEDBALL_H
|
||||
#define DIRECTOR_LINGO_XTRAS_S_STAYTOONEDBALL_H
|
||||
|
||||
namespace Director {
|
||||
|
||||
class StayToonedBallXtraObject : public Object<StayToonedBallXtraObject> {
|
||||
public:
|
||||
StayToonedBallXtraObject(ObjectType objType);
|
||||
|
||||
bool hasProp(const Common::String &propName) override;
|
||||
Datum getProp(const Common::String &propName) override;
|
||||
};
|
||||
|
||||
namespace StayToonedBallXtra {
|
||||
|
||||
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_mInitRandom(int nargs);
|
||||
void m_mInitGame(int nargs);
|
||||
void m_mOPERATEGAME(int nargs);
|
||||
void m_mGactions(int nargs);
|
||||
void m_mGetInfo(int nargs);
|
||||
void m_mSetSize(int nargs);
|
||||
void m_mAddStuff(int nargs);
|
||||
|
||||
} // End of namespace StayToonedBallXtra
|
||||
|
||||
} // End of namespace Director
|
||||
|
||||
#endif
|
||||
128
engines/director/lingo/xtras/s/staytoonedglop.cpp
Normal file
128
engines/director/lingo/xtras/s/staytoonedglop.cpp
Normal file
@@ -0,0 +1,128 @@
|
||||
/* 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/xtras/s/staytoonedglop.h"
|
||||
|
||||
/**************************************************
|
||||
*
|
||||
* USED IN:
|
||||
* Stay Tooned
|
||||
*
|
||||
**************************************************/
|
||||
|
||||
/*
|
||||
-- xtra Glop -- Fridge Fight 7/15/96 Programmer: Keith Laverty FunnyBone Interactive
|
||||
new object me
|
||||
* mInitRandom integer SomeThing -- feeds a number bewteen 1-100 to the Random# Array
|
||||
* mInitGame integer NUM1,integer NUM2,integer NUM3,integer NUM4 -- Cast Size
|
||||
* mInitLevel integer NUM1 -- feeds a number bewteen 1-100 to the Random# Array
|
||||
* mInitDoctor -- feeds a number bewteen 1-100 to the Random# Array
|
||||
* mOPERATEGAME integer NUM1, integer NUM2, integer NUM3 -- feeds a number bewteen 1-100 to the Random# Array
|
||||
* mReadData integer NUM1, integer NUM2, integer NUM3 -- feeds a number bewteen 1-100 to the Random# Array
|
||||
* mGactions -- feeds a number bewteen 1-100 to the Random# Array
|
||||
* mPassArray integer NUM1, integer NUM2, integer NUM3 -- feeds a number bewteen 1-100 to the Random# Array
|
||||
* mPassCastSize integer NUM1, integer NUM2, integer NUM3, integer NUM4, integer NUM5 -- feeds a number bewteen 1-100 to the Random# Array
|
||||
|
||||
*/
|
||||
|
||||
namespace Director {
|
||||
|
||||
const char *StayToonedGlopXtra::xlibName = "Glop";
|
||||
const XlibFileDesc StayToonedGlopXtra::fileNames[] = {
|
||||
{ "glop", "staytooned" },
|
||||
{ "glop_mac", "staytooned" },
|
||||
{ nullptr, nullptr },
|
||||
};
|
||||
|
||||
static MethodProto xlibMethods[] = {
|
||||
{ "new", StayToonedGlopXtra::m_new, 0, 0, 500 },
|
||||
|
||||
{ nullptr, nullptr, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static BuiltinProto xlibBuiltins[] = {
|
||||
{ "mInitRandom", StayToonedGlopXtra::m_mInitRandom, 1, 1, 500, HBLTIN },
|
||||
{ "mInitGame", StayToonedGlopXtra::m_mInitGame, 4, 4, 500, HBLTIN },
|
||||
{ "mInitLevel", StayToonedGlopXtra::m_mInitLevel, 1, 1, 500, HBLTIN },
|
||||
{ "mInitDoctor", StayToonedGlopXtra::m_mInitDoctor, 0, 0, 500, HBLTIN },
|
||||
{ "mOPERATEGAME", StayToonedGlopXtra::m_mOPERATEGAME, 3, 3, 500, HBLTIN },
|
||||
{ "mReadData", StayToonedGlopXtra::m_mReadData, 3, 3, 500, HBLTIN },
|
||||
{ "mGactions", StayToonedGlopXtra::m_mGactions, 0, 0, 500, HBLTIN },
|
||||
{ "mPassArray", StayToonedGlopXtra::m_mPassArray, 3, 3, 500, HBLTIN },
|
||||
{ "mPassCastSize", StayToonedGlopXtra::m_mPassCastSize, 5, 5, 500, HBLTIN },
|
||||
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
|
||||
};
|
||||
|
||||
StayToonedGlopXtraObject::StayToonedGlopXtraObject(ObjectType ObjectType) :Object<StayToonedGlopXtraObject>("StayToonedGlop") {
|
||||
_objType = ObjectType;
|
||||
}
|
||||
|
||||
bool StayToonedGlopXtraObject::hasProp(const Common::String &propName) {
|
||||
return (propName == "name");
|
||||
}
|
||||
|
||||
Datum StayToonedGlopXtraObject::getProp(const Common::String &propName) {
|
||||
if (propName == "name")
|
||||
return Datum(StayToonedGlopXtra::xlibName);
|
||||
warning("StayToonedGlopXtra::getProp: unknown property '%s'", propName.c_str());
|
||||
return Datum();
|
||||
}
|
||||
|
||||
void StayToonedGlopXtra::open(ObjectType type, const Common::Path &path) {
|
||||
StayToonedGlopXtraObject::initMethods(xlibMethods);
|
||||
StayToonedGlopXtraObject *xobj = new StayToonedGlopXtraObject(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 StayToonedGlopXtra::close(ObjectType type) {
|
||||
StayToonedGlopXtraObject::cleanupMethods();
|
||||
g_lingo->_globalvars[xlibName] = Datum();
|
||||
|
||||
}
|
||||
|
||||
void StayToonedGlopXtra::m_new(int nargs) {
|
||||
g_lingo->printSTUBWithArglist("StayToonedGlopXtra::m_new", nargs);
|
||||
g_lingo->dropStack(nargs);
|
||||
g_lingo->push(g_lingo->_state->me);
|
||||
}
|
||||
|
||||
XOBJSTUB(StayToonedGlopXtra::m_mInitRandom, 0)
|
||||
XOBJSTUB(StayToonedGlopXtra::m_mInitGame, 0)
|
||||
XOBJSTUB(StayToonedGlopXtra::m_mInitLevel, 0)
|
||||
XOBJSTUB(StayToonedGlopXtra::m_mInitDoctor, 0)
|
||||
XOBJSTUB(StayToonedGlopXtra::m_mOPERATEGAME, 0)
|
||||
XOBJSTUB(StayToonedGlopXtra::m_mReadData, 0)
|
||||
XOBJSTUB(StayToonedGlopXtra::m_mGactions, 0)
|
||||
XOBJSTUB(StayToonedGlopXtra::m_mPassArray, 0)
|
||||
XOBJSTUB(StayToonedGlopXtra::m_mPassCastSize, 0)
|
||||
|
||||
}
|
||||
58
engines/director/lingo/xtras/s/staytoonedglop.h
Normal file
58
engines/director/lingo/xtras/s/staytoonedglop.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_XTRAS_S_STAYTOONEDGLOP_H
|
||||
#define DIRECTOR_LINGO_XTRAS_S_STAYTOONEDGLOP_H
|
||||
|
||||
namespace Director {
|
||||
|
||||
class StayToonedGlopXtraObject : public Object<StayToonedGlopXtraObject> {
|
||||
public:
|
||||
StayToonedGlopXtraObject(ObjectType objType);
|
||||
|
||||
bool hasProp(const Common::String &propName) override;
|
||||
Datum getProp(const Common::String &propName) override;
|
||||
};
|
||||
|
||||
namespace StayToonedGlopXtra {
|
||||
|
||||
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_mInitRandom(int nargs);
|
||||
void m_mInitGame(int nargs);
|
||||
void m_mInitLevel(int nargs);
|
||||
void m_mInitDoctor(int nargs);
|
||||
void m_mOPERATEGAME(int nargs);
|
||||
void m_mReadData(int nargs);
|
||||
void m_mGactions(int nargs);
|
||||
void m_mPassArray(int nargs);
|
||||
void m_mPassCastSize(int nargs);
|
||||
|
||||
} // End of namespace StayToonedGlopXtra
|
||||
|
||||
} // End of namespace Director
|
||||
|
||||
#endif
|
||||
125
engines/director/lingo/xtras/s/staytoonedhall.cpp
Normal file
125
engines/director/lingo/xtras/s/staytoonedhall.cpp
Normal file
@@ -0,0 +1,125 @@
|
||||
/* 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/xtras/s/staytoonedhall.h"
|
||||
|
||||
/**************************************************
|
||||
*
|
||||
* USED IN:
|
||||
* Stay Tooned
|
||||
*
|
||||
**************************************************/
|
||||
|
||||
/*
|
||||
-- xtra Hall -- Remote Combat Game 7/8/96 Programmer: Keith Laverty
|
||||
new object me
|
||||
* mInitRandom integer SomeThing -- feeds a number bewteen 1-100 to the Random# Array
|
||||
* mInitGame integer NUM1, integer NUM2, integer NUM3-- feeds a number bewteen 1-100 to the Random# Array
|
||||
* mInitLevel integer NUM1-- feeds a number bewteen 1-100 to the Random# Array
|
||||
* mOPERATEGAME integer NUM1, integer NUM2, integer NUM3-- feeds a number bewteen 1-100 to the Random# Array
|
||||
* mReadData integer NUM1, integer NUM2, integer NUM3-- feeds a number bewteen 1-100 to the Random# Array
|
||||
* mGactions -- feeds a number bewteen 1-100 to the Random# Array
|
||||
* mPassArray integer NUM1, integer NUM2, integer NUM3-- feeds a number bewteen 1-100 to the Random# Array
|
||||
* mPassCastSize integer NUM1, integer NUM2, integer NUM3, integer NUM4, integer NUM5-- feeds a number bewteen 1-100 to the Random# Array
|
||||
|
||||
*/
|
||||
|
||||
namespace Director {
|
||||
|
||||
const char *StayToonedHallXtra::xlibName = "Hall";
|
||||
const XlibFileDesc StayToonedHallXtra::fileNames[] = {
|
||||
{ "hall", "staytooned" },
|
||||
{ "hall_mac", "staytooned" },
|
||||
{ nullptr, nullptr },
|
||||
};
|
||||
|
||||
static MethodProto xlibMethods[] = {
|
||||
{ "new", StayToonedHallXtra::m_new, 0, 0, 500 },
|
||||
|
||||
{ nullptr, nullptr, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static BuiltinProto xlibBuiltins[] = {
|
||||
{ "mInitRandom", StayToonedHallXtra::m_mInitRandom, 1, 1, 500, HBLTIN },
|
||||
{ "mInitGame", StayToonedHallXtra::m_mInitGame, 3, 3, 500, HBLTIN },
|
||||
{ "mInitLevel", StayToonedHallXtra::m_mInitLevel, 1, 1, 500, HBLTIN },
|
||||
{ "mOPERATEGAME", StayToonedHallXtra::m_mOPERATEGAME, 3, 3, 500, HBLTIN },
|
||||
{ "mReadData", StayToonedHallXtra::m_mReadData, 3, 3, 500, HBLTIN },
|
||||
{ "mGactions", StayToonedHallXtra::m_mGactions, 0, 0, 500, HBLTIN },
|
||||
{ "mPassArray", StayToonedHallXtra::m_mPassArray, 3, 3, 500, HBLTIN },
|
||||
{ "mPassCastSize", StayToonedHallXtra::m_mPassCastSize, 5, 5, 500, HBLTIN },
|
||||
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
|
||||
};
|
||||
|
||||
StayToonedHallXtraObject::StayToonedHallXtraObject(ObjectType ObjectType) :Object<StayToonedHallXtraObject>("StayToonedHall") {
|
||||
_objType = ObjectType;
|
||||
}
|
||||
|
||||
bool StayToonedHallXtraObject::hasProp(const Common::String &propName) {
|
||||
return (propName == "name");
|
||||
}
|
||||
|
||||
Datum StayToonedHallXtraObject::getProp(const Common::String &propName) {
|
||||
if (propName == "name")
|
||||
return Datum(StayToonedHallXtra::xlibName);
|
||||
warning("StayToonedHallXtra::getProp: unknown property '%s'", propName.c_str());
|
||||
return Datum();
|
||||
}
|
||||
|
||||
void StayToonedHallXtra::open(ObjectType type, const Common::Path &path) {
|
||||
StayToonedHallXtraObject::initMethods(xlibMethods);
|
||||
StayToonedHallXtraObject *xobj = new StayToonedHallXtraObject(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 StayToonedHallXtra::close(ObjectType type) {
|
||||
StayToonedHallXtraObject::cleanupMethods();
|
||||
g_lingo->_globalvars[xlibName] = Datum();
|
||||
|
||||
}
|
||||
|
||||
void StayToonedHallXtra::m_new(int nargs) {
|
||||
g_lingo->printSTUBWithArglist("StayToonedHallXtra::m_new", nargs);
|
||||
g_lingo->dropStack(nargs);
|
||||
g_lingo->push(g_lingo->_state->me);
|
||||
}
|
||||
|
||||
XOBJSTUB(StayToonedHallXtra::m_mInitRandom, 0)
|
||||
XOBJSTUB(StayToonedHallXtra::m_mInitGame, 0)
|
||||
XOBJSTUB(StayToonedHallXtra::m_mInitLevel, 0)
|
||||
XOBJSTUB(StayToonedHallXtra::m_mOPERATEGAME, 0)
|
||||
XOBJSTUB(StayToonedHallXtra::m_mReadData, 0)
|
||||
XOBJSTUB(StayToonedHallXtra::m_mGactions, 0)
|
||||
XOBJSTUB(StayToonedHallXtra::m_mPassArray, 0)
|
||||
XOBJSTUB(StayToonedHallXtra::m_mPassCastSize, 0)
|
||||
|
||||
}
|
||||
57
engines/director/lingo/xtras/s/staytoonedhall.h
Normal file
57
engines/director/lingo/xtras/s/staytoonedhall.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/* 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_XTRAS_S_STAYTOONEDHALL_H
|
||||
#define DIRECTOR_LINGO_XTRAS_S_STAYTOONEDHALL_H
|
||||
|
||||
namespace Director {
|
||||
|
||||
class StayToonedHallXtraObject : public Object<StayToonedHallXtraObject> {
|
||||
public:
|
||||
StayToonedHallXtraObject(ObjectType objType);
|
||||
|
||||
bool hasProp(const Common::String &propName) override;
|
||||
Datum getProp(const Common::String &propName) override;
|
||||
};
|
||||
|
||||
namespace StayToonedHallXtra {
|
||||
|
||||
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_mInitRandom(int nargs);
|
||||
void m_mInitGame(int nargs);
|
||||
void m_mInitLevel(int nargs);
|
||||
void m_mOPERATEGAME(int nargs);
|
||||
void m_mReadData(int nargs);
|
||||
void m_mGactions(int nargs);
|
||||
void m_mPassArray(int nargs);
|
||||
void m_mPassCastSize(int nargs);
|
||||
|
||||
} // End of namespace StayToonedHallXtra
|
||||
|
||||
} // End of namespace Director
|
||||
|
||||
#endif
|
||||
122
engines/director/lingo/xtras/s/staytoonedhigh.cpp
Normal file
122
engines/director/lingo/xtras/s/staytoonedhigh.cpp
Normal 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/xtras/s/staytoonedhigh.h"
|
||||
|
||||
/**************************************************
|
||||
*
|
||||
* USED IN:
|
||||
* Stay Tooned
|
||||
*
|
||||
**************************************************/
|
||||
|
||||
/*
|
||||
-- xtra Toon -- Fridge Fight 7/15/96 Programmer: Keith Laverty FunnyBone Interactive
|
||||
new object me
|
||||
* mInitRandom integer SomeThing -- feeds a number bewteen 1-100 to the Random# Array
|
||||
* mInitGame integer NUM1,integer NUM2,integer NUM3,integer NUM4,integer NUM5 -- Cast Size
|
||||
* mInitLevel integer NUM1 -- feeds a number bewteen 1-100 to the Random# Array
|
||||
* mInitBall -- feeds a number bewteen 1-100 to the Random# Array
|
||||
* mOPERATEGAME integer NUM1, integer NUM2 -- feeds a number bewteen 1-100 to the Random# Array
|
||||
* mReturnData integer NUM1, integer NUM2, integer NUM3 -- feeds a number bewteen 1-100 to the Random# Array
|
||||
* mGactions -- feeds a number bewteen 1-100 to the Random# Array
|
||||
|
||||
*/
|
||||
|
||||
namespace Director {
|
||||
|
||||
const char *StayToonedHighXtra::xlibName = "Toon";
|
||||
const XlibFileDesc StayToonedHighXtra::fileNames[] = {
|
||||
{ "high", nullptr },
|
||||
{ "high_mac", nullptr },
|
||||
{ nullptr, nullptr },
|
||||
};
|
||||
|
||||
static MethodProto xlibMethods[] = {
|
||||
{ "new", StayToonedHighXtra::m_new, 0, 0, 500 },
|
||||
|
||||
{ nullptr, nullptr, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static BuiltinProto xlibBuiltins[] = {
|
||||
{ "mInitRandom", StayToonedHighXtra::m_mInitRandom, 1, 1, 500, HBLTIN },
|
||||
{ "mInitGame", StayToonedHighXtra::m_mInitGame, 5, 5, 500, HBLTIN },
|
||||
{ "mInitLevel", StayToonedHighXtra::m_mInitLevel, 1, 1, 500, HBLTIN },
|
||||
{ "mInitBall", StayToonedHighXtra::m_mInitBall, 0, 0, 500, HBLTIN },
|
||||
{ "mOPERATEGAME", StayToonedHighXtra::m_mOPERATEGAME, 2, 2, 500, HBLTIN },
|
||||
{ "mReturnData", StayToonedHighXtra::m_mReturnData, 3, 3, 500, HBLTIN },
|
||||
{ "mGactions", StayToonedHighXtra::m_mGactions, 0, 0, 500, HBLTIN },
|
||||
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
|
||||
};
|
||||
|
||||
StayToonedHighXtraObject::StayToonedHighXtraObject(ObjectType ObjectType) :Object<StayToonedHighXtraObject>("StayToonedHigh") {
|
||||
_objType = ObjectType;
|
||||
}
|
||||
|
||||
bool StayToonedHighXtraObject::hasProp(const Common::String &propName) {
|
||||
return (propName == "name");
|
||||
}
|
||||
|
||||
Datum StayToonedHighXtraObject::getProp(const Common::String &propName) {
|
||||
if (propName == "name")
|
||||
return Datum(StayToonedHighXtra::xlibName);
|
||||
warning("StayToonedHighXtra::getProp: unknown property '%s'", propName.c_str());
|
||||
return Datum();
|
||||
}
|
||||
|
||||
void StayToonedHighXtra::open(ObjectType type, const Common::Path &path) {
|
||||
StayToonedHighXtraObject::initMethods(xlibMethods);
|
||||
StayToonedHighXtraObject *xobj = new StayToonedHighXtraObject(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 StayToonedHighXtra::close(ObjectType type) {
|
||||
StayToonedHighXtraObject::cleanupMethods();
|
||||
g_lingo->_globalvars[xlibName] = Datum();
|
||||
|
||||
}
|
||||
|
||||
void StayToonedHighXtra::m_new(int nargs) {
|
||||
g_lingo->printSTUBWithArglist("StayToonedHighXtra::m_new", nargs);
|
||||
g_lingo->dropStack(nargs);
|
||||
g_lingo->push(g_lingo->_state->me);
|
||||
}
|
||||
|
||||
XOBJSTUB(StayToonedHighXtra::m_mInitRandom, 0)
|
||||
XOBJSTUB(StayToonedHighXtra::m_mInitGame, 0)
|
||||
XOBJSTUB(StayToonedHighXtra::m_mInitLevel, 0)
|
||||
XOBJSTUB(StayToonedHighXtra::m_mInitBall, 0)
|
||||
XOBJSTUB(StayToonedHighXtra::m_mOPERATEGAME, 0)
|
||||
XOBJSTUB(StayToonedHighXtra::m_mReturnData, 0)
|
||||
XOBJSTUB(StayToonedHighXtra::m_mGactions, 0)
|
||||
|
||||
}
|
||||
56
engines/director/lingo/xtras/s/staytoonedhigh.h
Normal file
56
engines/director/lingo/xtras/s/staytoonedhigh.h
Normal file
@@ -0,0 +1,56 @@
|
||||
/* 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_XTRAS_S_STAYTOONEDHIGH_H
|
||||
#define DIRECTOR_LINGO_XTRAS_S_STAYTOONEDHIGH_H
|
||||
|
||||
namespace Director {
|
||||
|
||||
class StayToonedHighXtraObject : public Object<StayToonedHighXtraObject> {
|
||||
public:
|
||||
StayToonedHighXtraObject(ObjectType objType);
|
||||
|
||||
bool hasProp(const Common::String &propName) override;
|
||||
Datum getProp(const Common::String &propName) override;
|
||||
};
|
||||
|
||||
namespace StayToonedHighXtra {
|
||||
|
||||
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_mInitRandom(int nargs);
|
||||
void m_mInitGame(int nargs);
|
||||
void m_mInitLevel(int nargs);
|
||||
void m_mInitBall(int nargs);
|
||||
void m_mOPERATEGAME(int nargs);
|
||||
void m_mReturnData(int nargs);
|
||||
void m_mGactions(int nargs);
|
||||
|
||||
} // End of namespace StayToonedHighXtra
|
||||
|
||||
} // End of namespace Director
|
||||
|
||||
#endif
|
||||
125
engines/director/lingo/xtras/s/staytoonedober.cpp
Normal file
125
engines/director/lingo/xtras/s/staytoonedober.cpp
Normal file
@@ -0,0 +1,125 @@
|
||||
/* 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/xtras/s/staytoonedober.h"
|
||||
|
||||
/**************************************************
|
||||
*
|
||||
* USED IN:
|
||||
* Stay Tooned
|
||||
*
|
||||
**************************************************/
|
||||
|
||||
/*
|
||||
-- xtra Toon -- Fridge Fight 7/15/96 Programmer: Keith Laverty FunnyBone Interactive
|
||||
new object me
|
||||
* mInitRandom integer SomeThing -- feeds a number bewteen 1-100 to the Random# Array
|
||||
* mBuildTable integer SlotNum,integer XOff,integer YOff,integer XSize,integer YSize -- Cast Size
|
||||
* mInitGame integer NumOfGuns,integer NumOfNukes -- feeds a number bewteen 1-100 to the Random# Array
|
||||
* mInitGun -- feeds a number bewteen 1-100 to the Random# Array
|
||||
* mOPERATEGAME integer NUM1, integer NUM2, integer NUM3,integer NUM4 -- feeds a number bewteen 1-100 to the Random# Array
|
||||
* mReturnData integer NUM1, integer NUM2 -- feeds a number bewteen 1-100 to the Random# Array
|
||||
* mGactions -- feeds a number bewteen 1-100 to the Random# Array
|
||||
* mCastStarts integer NUM1 -- feeds a number bewteen 1-100 to the Random# Array
|
||||
|
||||
*/
|
||||
|
||||
namespace Director {
|
||||
|
||||
const char *StayToonedOberXtra::xlibName = "Toon";
|
||||
const XlibFileDesc StayToonedOberXtra::fileNames[] = {
|
||||
{ "ober", "staytooned" },
|
||||
{ "ober_mac", "staytooned" },
|
||||
{ nullptr, nullptr },
|
||||
};
|
||||
|
||||
static MethodProto xlibMethods[] = {
|
||||
{ "new", StayToonedOberXtra::m_new, 0, 0, 500 },
|
||||
|
||||
{ nullptr, nullptr, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static BuiltinProto xlibBuiltins[] = {
|
||||
{ "mInitRandom", StayToonedOberXtra::m_mInitRandom, 1, 1, 500, HBLTIN },
|
||||
{ "mBuildTable", StayToonedOberXtra::m_mBuildTable, 5, 5, 500, HBLTIN },
|
||||
{ "mInitGame", StayToonedOberXtra::m_mInitGame, 2, 2, 500, HBLTIN },
|
||||
{ "mInitGun", StayToonedOberXtra::m_mInitGun, 0, 0, 500, HBLTIN },
|
||||
{ "mOPERATEGAME", StayToonedOberXtra::m_mOPERATEGAME, 4, 4, 500, HBLTIN },
|
||||
{ "mReturnData", StayToonedOberXtra::m_mReturnData, 2, 2, 500, HBLTIN },
|
||||
{ "mGactions", StayToonedOberXtra::m_mGactions, 0, 0, 500, HBLTIN },
|
||||
{ "mCastStarts", StayToonedOberXtra::m_mCastStarts, 1, 1, 500, HBLTIN },
|
||||
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
|
||||
};
|
||||
|
||||
StayToonedOberXtraObject::StayToonedOberXtraObject(ObjectType ObjectType) :Object<StayToonedOberXtraObject>("StayToonedOber") {
|
||||
_objType = ObjectType;
|
||||
}
|
||||
|
||||
bool StayToonedOberXtraObject::hasProp(const Common::String &propName) {
|
||||
return (propName == "name");
|
||||
}
|
||||
|
||||
Datum StayToonedOberXtraObject::getProp(const Common::String &propName) {
|
||||
if (propName == "name")
|
||||
return Datum(StayToonedOberXtra::xlibName);
|
||||
warning("StayToonedOberXtra::getProp: unknown property '%s'", propName.c_str());
|
||||
return Datum();
|
||||
}
|
||||
|
||||
void StayToonedOberXtra::open(ObjectType type, const Common::Path &path) {
|
||||
StayToonedOberXtraObject::initMethods(xlibMethods);
|
||||
StayToonedOberXtraObject *xobj = new StayToonedOberXtraObject(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 StayToonedOberXtra::close(ObjectType type) {
|
||||
StayToonedOberXtraObject::cleanupMethods();
|
||||
g_lingo->_globalvars[xlibName] = Datum();
|
||||
|
||||
}
|
||||
|
||||
void StayToonedOberXtra::m_new(int nargs) {
|
||||
g_lingo->printSTUBWithArglist("StayToonedOberXtra::m_new", nargs);
|
||||
g_lingo->dropStack(nargs);
|
||||
g_lingo->push(g_lingo->_state->me);
|
||||
}
|
||||
|
||||
XOBJSTUB(StayToonedOberXtra::m_mInitRandom, 0)
|
||||
XOBJSTUB(StayToonedOberXtra::m_mBuildTable, 0)
|
||||
XOBJSTUB(StayToonedOberXtra::m_mInitGame, 0)
|
||||
XOBJSTUB(StayToonedOberXtra::m_mInitGun, 0)
|
||||
XOBJSTUB(StayToonedOberXtra::m_mOPERATEGAME, 0)
|
||||
XOBJSTUB(StayToonedOberXtra::m_mReturnData, 0)
|
||||
XOBJSTUB(StayToonedOberXtra::m_mGactions, 0)
|
||||
XOBJSTUB(StayToonedOberXtra::m_mCastStarts, 0)
|
||||
|
||||
}
|
||||
57
engines/director/lingo/xtras/s/staytoonedober.h
Normal file
57
engines/director/lingo/xtras/s/staytoonedober.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/* 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_XTRAS_S_STAYTOONEDOBER_H
|
||||
#define DIRECTOR_LINGO_XTRAS_S_STAYTOONEDOBER_H
|
||||
|
||||
namespace Director {
|
||||
|
||||
class StayToonedOberXtraObject : public Object<StayToonedOberXtraObject> {
|
||||
public:
|
||||
StayToonedOberXtraObject(ObjectType objType);
|
||||
|
||||
bool hasProp(const Common::String &propName) override;
|
||||
Datum getProp(const Common::String &propName) override;
|
||||
};
|
||||
|
||||
namespace StayToonedOberXtra {
|
||||
|
||||
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_mInitRandom(int nargs);
|
||||
void m_mBuildTable(int nargs);
|
||||
void m_mInitGame(int nargs);
|
||||
void m_mInitGun(int nargs);
|
||||
void m_mOPERATEGAME(int nargs);
|
||||
void m_mReturnData(int nargs);
|
||||
void m_mGactions(int nargs);
|
||||
void m_mCastStarts(int nargs);
|
||||
|
||||
} // End of namespace StayToonedOberXtra
|
||||
|
||||
} // End of namespace Director
|
||||
|
||||
#endif
|
||||
125
engines/director/lingo/xtras/s/staytoonedtoon.cpp
Normal file
125
engines/director/lingo/xtras/s/staytoonedtoon.cpp
Normal file
@@ -0,0 +1,125 @@
|
||||
/* 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/xtras/s/staytoonedtoon.h"
|
||||
|
||||
/**************************************************
|
||||
*
|
||||
* USED IN:
|
||||
* Stay Tooned
|
||||
*
|
||||
**************************************************/
|
||||
|
||||
/*
|
||||
-- xtra ToonBoy -- ToonBoy 7/15/96 Programmer: Keith Laverty FunnyBone Interactive
|
||||
new object me
|
||||
* mInitRandom integer SomeThing -- feeds a number bewteen 1-100 to the Random# Array
|
||||
* mInitGame -- feeds a number bewteen 1-100 to the Random# Array
|
||||
* mInitScoop -- feeds a number bewteen 1-100 to the Random# Array
|
||||
* mOPERATEGAME integer NUM1 -- feeds a number bewteen 1-100 to the Random# Array
|
||||
* mReadData integer NUM1, integer NUM2, integer NUM3-- feeds a number bewteen 1-100 to the Random# Array
|
||||
* mGactions -- feeds a number bewteen 1-100 to the Random# Array
|
||||
* mPassArray integer NUM1, integer NUM2, integer NUM3-- feeds a number bewteen 1-100 to the Random# Array
|
||||
* mPassCastSize integer NUM1, integer NUM2, integer NUM3, integer NUM4, integer NUM5-- feeds a number bewteen 1-100 to the Random# Array
|
||||
|
||||
*/
|
||||
|
||||
namespace Director {
|
||||
|
||||
const char *StayToonedToonXtra::xlibName = "ToonBoy";
|
||||
const XlibFileDesc StayToonedToonXtra::fileNames[] = {
|
||||
{ "toon", "staytooned" },
|
||||
{ "toon_mac", "staytooned" },
|
||||
{ nullptr, nullptr },
|
||||
};
|
||||
|
||||
static MethodProto xlibMethods[] = {
|
||||
{ "new", StayToonedToonXtra::m_new, 0, 0, 500 },
|
||||
|
||||
{ nullptr, nullptr, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static BuiltinProto xlibBuiltins[] = {
|
||||
{ "mInitRandom", StayToonedToonXtra::m_mInitRandom, 1, 1, 500, HBLTIN },
|
||||
{ "mInitGame", StayToonedToonXtra::m_mInitGame, 0, 0, 500, HBLTIN },
|
||||
{ "mInitScoop", StayToonedToonXtra::m_mInitScoop, 0, 0, 500, HBLTIN },
|
||||
{ "mOPERATEGAME", StayToonedToonXtra::m_mOPERATEGAME, 1, 1, 500, HBLTIN },
|
||||
{ "mReadData", StayToonedToonXtra::m_mReadData, 3, 3, 500, HBLTIN },
|
||||
{ "mGactions", StayToonedToonXtra::m_mGactions, 0, 0, 500, HBLTIN },
|
||||
{ "mPassArray", StayToonedToonXtra::m_mPassArray, 3, 3, 500, HBLTIN },
|
||||
{ "mPassCastSize", StayToonedToonXtra::m_mPassCastSize, 5, 5, 500, HBLTIN },
|
||||
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
|
||||
};
|
||||
|
||||
StayToonedToonXtraObject::StayToonedToonXtraObject(ObjectType ObjectType) :Object<StayToonedToonXtraObject>("StayToonedToon") {
|
||||
_objType = ObjectType;
|
||||
}
|
||||
|
||||
bool StayToonedToonXtraObject::hasProp(const Common::String &propName) {
|
||||
return (propName == "name");
|
||||
}
|
||||
|
||||
Datum StayToonedToonXtraObject::getProp(const Common::String &propName) {
|
||||
if (propName == "name")
|
||||
return Datum(StayToonedToonXtra::xlibName);
|
||||
warning("StayToonedToonXtra::getProp: unknown property '%s'", propName.c_str());
|
||||
return Datum();
|
||||
}
|
||||
|
||||
void StayToonedToonXtra::open(ObjectType type, const Common::Path &path) {
|
||||
StayToonedToonXtraObject::initMethods(xlibMethods);
|
||||
StayToonedToonXtraObject *xobj = new StayToonedToonXtraObject(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 StayToonedToonXtra::close(ObjectType type) {
|
||||
StayToonedToonXtraObject::cleanupMethods();
|
||||
g_lingo->_globalvars[xlibName] = Datum();
|
||||
|
||||
}
|
||||
|
||||
void StayToonedToonXtra::m_new(int nargs) {
|
||||
g_lingo->printSTUBWithArglist("StayToonedToonXtra::m_new", nargs);
|
||||
g_lingo->dropStack(nargs);
|
||||
g_lingo->push(g_lingo->_state->me);
|
||||
}
|
||||
|
||||
XOBJSTUB(StayToonedToonXtra::m_mInitRandom, 0)
|
||||
XOBJSTUB(StayToonedToonXtra::m_mInitGame, 0)
|
||||
XOBJSTUB(StayToonedToonXtra::m_mInitScoop, 0)
|
||||
XOBJSTUB(StayToonedToonXtra::m_mOPERATEGAME, 0)
|
||||
XOBJSTUB(StayToonedToonXtra::m_mReadData, 0)
|
||||
XOBJSTUB(StayToonedToonXtra::m_mGactions, 0)
|
||||
XOBJSTUB(StayToonedToonXtra::m_mPassArray, 0)
|
||||
XOBJSTUB(StayToonedToonXtra::m_mPassCastSize, 0)
|
||||
|
||||
}
|
||||
57
engines/director/lingo/xtras/s/staytoonedtoon.h
Normal file
57
engines/director/lingo/xtras/s/staytoonedtoon.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/* 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_XTRAS_S_STAYTOONEDTOON_H
|
||||
#define DIRECTOR_LINGO_XTRAS_S_STAYTOONEDTOON_H
|
||||
|
||||
namespace Director {
|
||||
|
||||
class StayToonedToonXtraObject : public Object<StayToonedToonXtraObject> {
|
||||
public:
|
||||
StayToonedToonXtraObject(ObjectType objType);
|
||||
|
||||
bool hasProp(const Common::String &propName) override;
|
||||
Datum getProp(const Common::String &propName) override;
|
||||
};
|
||||
|
||||
namespace StayToonedToonXtra {
|
||||
|
||||
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_mInitRandom(int nargs);
|
||||
void m_mInitGame(int nargs);
|
||||
void m_mInitScoop(int nargs);
|
||||
void m_mOPERATEGAME(int nargs);
|
||||
void m_mReadData(int nargs);
|
||||
void m_mGactions(int nargs);
|
||||
void m_mPassArray(int nargs);
|
||||
void m_mPassCastSize(int nargs);
|
||||
|
||||
} // End of namespace StayToonedToonXtra
|
||||
|
||||
} // End of namespace Director
|
||||
|
||||
#endif
|
||||
91
engines/director/lingo/xtras/scrnutil.cpp
Normal file
91
engines/director/lingo/xtras/scrnutil.cpp
Normal file
@@ -0,0 +1,91 @@
|
||||
/* 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/xtras/scrnutil.h"
|
||||
|
||||
/**************************************************
|
||||
*
|
||||
* USED IN:
|
||||
* amber
|
||||
*
|
||||
**************************************************/
|
||||
|
||||
/*
|
||||
-- xtra ScrnUtil
|
||||
-- ScrnUtil Xtra version 1.0 copyright (c) 1996 by g/matter, inc.
|
||||
-- Programming copyright (c) 1996 Little Planet Publishing
|
||||
-- For technical support or updates, contact http://www.gmatter.com or support@gmatter.com
|
||||
--
|
||||
-- Picture Capture Functions --
|
||||
* ScreenToClipboard integer left, integer top, integer right, integer bottom
|
||||
* ScreenToFile integer left, integer top, integer right, integer bottom, string filename
|
||||
|
||||
*/
|
||||
|
||||
namespace Director {
|
||||
|
||||
const char *const ScrnUtilXtra::xlibName = "ScrnUtil";
|
||||
const XlibFileDesc ScrnUtilXtra::fileNames[] = {
|
||||
{ "scrnutil", nullptr },
|
||||
{ nullptr, nullptr },
|
||||
};
|
||||
|
||||
static const MethodProto xlibMethods[] = {
|
||||
{ nullptr, nullptr, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static const BuiltinProto xlibBuiltins[] = {
|
||||
{ "ScreenToClipboard", ScrnUtilXtra::m_ScreenToClipboard, 4, 4, 500, HBLTIN },
|
||||
{ "ScreenToFile", ScrnUtilXtra::m_ScreenToFile, 5, 5, 500, HBLTIN },
|
||||
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
|
||||
};
|
||||
|
||||
ScrnUtilXtraObject::ScrnUtilXtraObject(ObjectType ObjectType) :Object<ScrnUtilXtraObject>("ScrnUtilXtra") {
|
||||
_objType = ObjectType;
|
||||
}
|
||||
|
||||
void ScrnUtilXtra::open(ObjectType type, const Common::Path &path) {
|
||||
ScrnUtilXtraObject::initMethods(xlibMethods);
|
||||
ScrnUtilXtraObject *xobj = new ScrnUtilXtraObject(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 ScrnUtilXtra::close(ObjectType type) {
|
||||
ScrnUtilXtraObject::cleanupMethods();
|
||||
g_lingo->_globalvars[xlibName] = Datum();
|
||||
|
||||
}
|
||||
|
||||
XOBJSTUB(ScrnUtilXtra::m_ScreenToClipboard, 0)
|
||||
XOBJSTUB(ScrnUtilXtra::m_ScreenToFile, 0)
|
||||
|
||||
}
|
||||
47
engines/director/lingo/xtras/scrnutil.h
Normal file
47
engines/director/lingo/xtras/scrnutil.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_XTRAS_SCRNUTIL_H
|
||||
#define DIRECTOR_LINGO_XTRAS_SCRNUTIL_H
|
||||
|
||||
namespace Director {
|
||||
|
||||
class ScrnUtilXtraObject : public Object<ScrnUtilXtraObject> {
|
||||
public:
|
||||
ScrnUtilXtraObject(ObjectType objType);
|
||||
};
|
||||
|
||||
namespace ScrnUtilXtra {
|
||||
|
||||
extern const char *const xlibName;
|
||||
extern const XlibFileDesc fileNames[];
|
||||
|
||||
void open(ObjectType type, const Common::Path &path);
|
||||
void close(ObjectType type);
|
||||
|
||||
void m_ScreenToClipboard(int nargs);
|
||||
void m_ScreenToFile(int nargs);
|
||||
|
||||
} // End of namespace ScrnUtilXtra
|
||||
|
||||
} // End of namespace Director
|
||||
|
||||
#endif
|
||||
118
engines/director/lingo/xtras/timextra.cpp
Normal file
118
engines/director/lingo/xtras/timextra.cpp
Normal file
@@ -0,0 +1,118 @@
|
||||
/* 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/xtras/timextra.h"
|
||||
|
||||
/**************************************************
|
||||
*
|
||||
* USED IN:
|
||||
* Safecracker
|
||||
*
|
||||
**************************************************/
|
||||
|
||||
/*
|
||||
-- xtra TimeXtra
|
||||
new object me, any
|
||||
* getTime -- add two numbers
|
||||
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************
|
||||
Return value is hours * 3600 + minutes * 60 + seconds in UTC.
|
||||
The underlying function in the XTRA is GetSystemTime:
|
||||
https://learn.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getsystemtime
|
||||
|
||||
Safecrackers only needs the number of seconds since the start of the game.
|
||||
Since not all platforms that run ScummVM have a clock, it's implemented as
|
||||
the number of seconds since the start of ScummVM.
|
||||
**************************************************/
|
||||
|
||||
|
||||
namespace Director {
|
||||
|
||||
const char *const TimextraXtra::xlibName = "Timextra";
|
||||
const XlibFileDesc TimextraXtra::fileNames[] = {
|
||||
{ "timextra", nullptr },
|
||||
{ nullptr, nullptr },
|
||||
};
|
||||
|
||||
static const MethodProto xlibMethods[] = {
|
||||
{ "new", TimextraXtra::m_new, 1, 0, 500 },
|
||||
{ nullptr, nullptr, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static const BuiltinProto xlibBuiltins[] = {
|
||||
{ "getTime", TimextraXtra::m_getTime, 0, 0, 500, HBLTIN },
|
||||
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
|
||||
};
|
||||
|
||||
TimextraXtraObject::TimextraXtraObject(ObjectType ObjectType) :Object<TimextraXtraObject>("Timextra") {
|
||||
_objType = ObjectType;
|
||||
}
|
||||
|
||||
bool TimextraXtraObject::hasProp(const Common::String &propName) {
|
||||
return (propName == "name");
|
||||
}
|
||||
|
||||
Datum TimextraXtraObject::getProp(const Common::String &propName) {
|
||||
if (propName == "name")
|
||||
return Datum(TimextraXtra::xlibName);
|
||||
warning("TimextraXtra::getProp: unknown property '%s'", propName.c_str());
|
||||
return Datum();
|
||||
}
|
||||
|
||||
void TimextraXtra::open(ObjectType type, const Common::Path &path) {
|
||||
TimextraXtraObject::initMethods(xlibMethods);
|
||||
TimextraXtraObject *xobj = new TimextraXtraObject(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 TimextraXtra::close(ObjectType type) {
|
||||
TimextraXtraObject::cleanupMethods();
|
||||
g_lingo->_globalvars[xlibName] = Datum();
|
||||
}
|
||||
|
||||
void TimextraXtra::m_new(int nargs) {
|
||||
g_lingo->printSTUBWithArglist("TimextraXtra::m_new", nargs);
|
||||
g_lingo->dropStack(nargs);
|
||||
g_lingo->push(g_lingo->_state->me);
|
||||
}
|
||||
|
||||
void TimextraXtra::m_getTime(int nargs) {
|
||||
ARGNUMCHECK(0);
|
||||
int seconds = g_system->getMillis() / 1000;
|
||||
Datum const res(seconds);
|
||||
g_lingo->push(res);
|
||||
}
|
||||
|
||||
}
|
||||
50
engines/director/lingo/xtras/timextra.h
Normal file
50
engines/director/lingo/xtras/timextra.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_XTRAS_TIMEXTRA_H
|
||||
#define DIRECTOR_LINGO_XTRAS_TIMEXTRA_H
|
||||
|
||||
namespace Director {
|
||||
|
||||
class TimextraXtraObject : public Object<TimextraXtraObject> {
|
||||
public:
|
||||
TimextraXtraObject(ObjectType objType);
|
||||
|
||||
bool hasProp(const Common::String &propName) override;
|
||||
Datum getProp(const Common::String &propName) override;
|
||||
};
|
||||
|
||||
namespace TimextraXtra {
|
||||
|
||||
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_getTime(int nargs);
|
||||
|
||||
} // End of namespace TimextraXtra
|
||||
|
||||
} // End of namespace Director
|
||||
|
||||
#endif
|
||||
198
engines/director/lingo/xtras/xsound.cpp
Normal file
198
engines/director/lingo/xtras/xsound.cpp
Normal file
@@ -0,0 +1,198 @@
|
||||
/* 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/xtras/xsound.h"
|
||||
|
||||
/**************************************************
|
||||
*
|
||||
* USED IN:
|
||||
* I Spy
|
||||
*
|
||||
**************************************************/
|
||||
|
||||
/*
|
||||
-- xtra xsound
|
||||
new object me, int bufferSize
|
||||
forget object me
|
||||
-- Sound Xtra(tm) version 3.0.1
|
||||
-- Engineered by Scott Kildall, redeye@igc.org
|
||||
-- Entire program code (c) 1995-97 by Red Eye Software
|
||||
-- Sound Xtra is a registered trademark of g/matter, inc
|
||||
-- All rights reserved.
|
||||
--
|
||||
-- For more information on Sound Xtra, see our website:
|
||||
-- http://www.gmatter.com
|
||||
--
|
||||
-- For technical support and sales, please email:
|
||||
-- <support@gmatter.com>
|
||||
-- <sales@gmatter.com>
|
||||
--
|
||||
-- Online help is available under the Xtras menu.
|
||||
--
|
||||
-- For information about other Red Eye Software products, visit
|
||||
-- the Red Eye Software website at http://www.halcyon.com/redeye
|
||||
--
|
||||
+ Register object xtraRef, string serialNumber -- Registers the Sound Xtra. THIS MUST BE CALLED FOR YOUR RUNTIME (PROJECTOR) FILES
|
||||
GetError object me -- returns the last error number
|
||||
GetInfo object me, int identifier -- returns specific information
|
||||
SetInfo object me, int identifier, int setting -- sets specific information
|
||||
Status object me -- returns the status of a sound
|
||||
ConnectInputDevice object me -- connects to the sound recorder
|
||||
DisconnectInputDevice object me -- disconnects from the sound recorder
|
||||
SetSoundType object me, string type, string name, string action -- specifies a file for sound recording or playback
|
||||
ClearSoundType object me -- clears information about the sound file
|
||||
Play object me -- plays a sound
|
||||
Record object me -- records a sound
|
||||
Stop object me -- stops a sound
|
||||
Pause object me -- pauses a sound
|
||||
Resume object me -- resumes a paused sound
|
||||
GetCurrentTime object me -- returns the playback time of a sound
|
||||
IsASound object me, string type, string name -- indicates if this sound exists
|
||||
DeleteSound object me, string type, string name -- deletes a sound
|
||||
SetPlaySegment object me, int start, int end -- sets the start and end points of a playback sound
|
||||
ClearPlaySegment object me -- resets the start and end points
|
||||
SetSampleRate object me, int rate -- sets the sample rate of a sound
|
||||
SetSampleDepth object me, int depth -- sets the sample depth of a sound
|
||||
SetCompression object me, int compressor -- sets a compressor for the sound
|
||||
GetInputLevel object me -- returns the input level of the microphone
|
||||
FreeRecordingTime object me -- returns the free recording time
|
||||
*/
|
||||
|
||||
namespace Director {
|
||||
|
||||
const char *XsoundXtra::xlibName = "Xsound";
|
||||
const XlibFileDesc XsoundXtra::fileNames[] = {
|
||||
{ "xsound", nullptr },
|
||||
{ nullptr, nullptr },
|
||||
};
|
||||
|
||||
static MethodProto xlibMethods[] = {
|
||||
{ "new", XsoundXtra::m_new, 1, 0, 500 },
|
||||
{ "forget", XsoundXtra::m_forget, 0, 0, 500 },
|
||||
{ "Register", XsoundXtra::m_Register, 1, 1, 500 },
|
||||
{ "GetError", XsoundXtra::m_GetError, 0, 0, 500 },
|
||||
{ "GetInfo", XsoundXtra::m_GetInfo, 1, 0, 500 },
|
||||
{ "SetInfo", XsoundXtra::m_SetInfo, 2, 0, 500 },
|
||||
{ "Status", XsoundXtra::m_Status, 0, 0, 500 },
|
||||
{ "ConnectInputDevice", XsoundXtra::m_ConnectInputDevice, 0, 0, 500 },
|
||||
{ "DisconnectInputDevice", XsoundXtra::m_DisconnectInputDevice, 0, 0, 500 },
|
||||
{ "SetSoundType", XsoundXtra::m_SetSoundType, 3, 0, 500 },
|
||||
{ "ClearSoundType", XsoundXtra::m_ClearSoundType, 0, 0, 500 },
|
||||
{ "Play", XsoundXtra::m_Play, 0, 0, 500 },
|
||||
{ "Record", XsoundXtra::m_Record, 0, 0, 500 },
|
||||
{ "Stop", XsoundXtra::m_Stop, 0, 0, 500 },
|
||||
{ "Pause", XsoundXtra::m_Pause, 0, 0, 500 },
|
||||
{ "Resume", XsoundXtra::m_Resume, 0, 0, 500 },
|
||||
{ "GetCurrentTime", XsoundXtra::m_GetCurrentTime, 0, 0, 500 },
|
||||
{ "IsASound", XsoundXtra::m_IsASound, 2, 0, 500 },
|
||||
{ "DeleteSound", XsoundXtra::m_DeleteSound, 2, 0, 500 },
|
||||
{ "SetPlaySegment", XsoundXtra::m_SetPlaySegment, 2, 0, 500 },
|
||||
{ "ClearPlaySegment", XsoundXtra::m_ClearPlaySegment, 0, 0, 500 },
|
||||
{ "SetSampleRate", XsoundXtra::m_SetSampleRate, 1, 0, 500 },
|
||||
{ "SetSampleDepth", XsoundXtra::m_SetSampleDepth, 1, 0, 500 },
|
||||
{ "SetCompression", XsoundXtra::m_SetCompression, 1, 0, 500 },
|
||||
{ "GetInputLevel", XsoundXtra::m_GetInputLevel, 0, 0, 500 },
|
||||
{ "FreeRecordingTime", XsoundXtra::m_FreeRecordingTime, 0, 0, 500 },
|
||||
{ nullptr, nullptr, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static BuiltinProto xlibBuiltins[] = {
|
||||
|
||||
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
|
||||
};
|
||||
|
||||
XsoundXtraObject::XsoundXtraObject(ObjectType ObjectType) :Object<XsoundXtraObject>("Xsound") {
|
||||
_objType = ObjectType;
|
||||
}
|
||||
|
||||
bool XsoundXtraObject::hasProp(const Common::String &propName) {
|
||||
return (propName == "name");
|
||||
}
|
||||
|
||||
Datum XsoundXtraObject::getProp(const Common::String &propName) {
|
||||
if (propName == "name")
|
||||
return Datum(XsoundXtra::xlibName);
|
||||
warning("XsoundXtra::getProp: unknown property '%s'", propName.c_str());
|
||||
return Datum();
|
||||
}
|
||||
|
||||
void XsoundXtra::open(ObjectType type, const Common::Path &path) {
|
||||
XsoundXtraObject::initMethods(xlibMethods);
|
||||
XsoundXtraObject *xobj = new XsoundXtraObject(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 XsoundXtra::close(ObjectType type) {
|
||||
XsoundXtraObject::cleanupMethods();
|
||||
g_lingo->_globalvars[xlibName] = Datum();
|
||||
|
||||
}
|
||||
|
||||
void XsoundXtra::m_new(int nargs) {
|
||||
g_lingo->printSTUBWithArglist("XsoundXtra::m_new", nargs);
|
||||
g_lingo->dropStack(nargs);
|
||||
g_lingo->push(g_lingo->_state->me);
|
||||
}
|
||||
|
||||
XOBJSTUB(XsoundXtra::m_forget, 0)
|
||||
|
||||
void XsoundXtra::m_Register(int nargs) {
|
||||
Common::String serialNumber = g_lingo->pop().asString();
|
||||
debugC(1, kDebugXObj, "XsoundXtra::m_register: Registered with serial \"%s\"", serialNumber.c_str());
|
||||
g_lingo->push(Datum(0));
|
||||
}
|
||||
|
||||
XOBJSTUB(XsoundXtra::m_GetError, 0)
|
||||
XOBJSTUB(XsoundXtra::m_GetInfo, 0)
|
||||
XOBJSTUB(XsoundXtra::m_SetInfo, 0)
|
||||
XOBJSTUB(XsoundXtra::m_Status, 0)
|
||||
XOBJSTUB(XsoundXtra::m_ConnectInputDevice, 0)
|
||||
XOBJSTUB(XsoundXtra::m_DisconnectInputDevice, 0)
|
||||
XOBJSTUB(XsoundXtra::m_SetSoundType, 0)
|
||||
XOBJSTUB(XsoundXtra::m_ClearSoundType, 0)
|
||||
XOBJSTUB(XsoundXtra::m_Play, 0)
|
||||
XOBJSTUB(XsoundXtra::m_Record, 0)
|
||||
XOBJSTUB(XsoundXtra::m_Stop, 0)
|
||||
XOBJSTUB(XsoundXtra::m_Pause, 0)
|
||||
XOBJSTUB(XsoundXtra::m_Resume, 0)
|
||||
XOBJSTUB(XsoundXtra::m_GetCurrentTime, 0)
|
||||
XOBJSTUB(XsoundXtra::m_IsASound, 0)
|
||||
XOBJSTUB(XsoundXtra::m_DeleteSound, 0)
|
||||
XOBJSTUB(XsoundXtra::m_SetPlaySegment, 0)
|
||||
XOBJSTUB(XsoundXtra::m_ClearPlaySegment, 0)
|
||||
XOBJSTUB(XsoundXtra::m_SetSampleRate, 0)
|
||||
XOBJSTUB(XsoundXtra::m_SetSampleDepth, 0)
|
||||
XOBJSTUB(XsoundXtra::m_SetCompression, 0)
|
||||
XOBJSTUB(XsoundXtra::m_GetInputLevel, 0)
|
||||
XOBJSTUB(XsoundXtra::m_FreeRecordingTime, 0)
|
||||
|
||||
}
|
||||
74
engines/director/lingo/xtras/xsound.h
Normal file
74
engines/director/lingo/xtras/xsound.h
Normal file
@@ -0,0 +1,74 @@
|
||||
/* 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_XTRAS_XSOUND_H
|
||||
#define DIRECTOR_LINGO_XTRAS_XSOUND_H
|
||||
|
||||
namespace Director {
|
||||
|
||||
class XsoundXtraObject : public Object<XsoundXtraObject> {
|
||||
public:
|
||||
XsoundXtraObject(ObjectType objType);
|
||||
|
||||
bool hasProp(const Common::String &propName) override;
|
||||
Datum getProp(const Common::String &propName) override;
|
||||
};
|
||||
|
||||
namespace XsoundXtra {
|
||||
|
||||
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_forget(int nargs);
|
||||
void m_Register(int nargs);
|
||||
void m_GetError(int nargs);
|
||||
void m_GetInfo(int nargs);
|
||||
void m_SetInfo(int nargs);
|
||||
void m_Status(int nargs);
|
||||
void m_ConnectInputDevice(int nargs);
|
||||
void m_DisconnectInputDevice(int nargs);
|
||||
void m_SetSoundType(int nargs);
|
||||
void m_ClearSoundType(int nargs);
|
||||
void m_Play(int nargs);
|
||||
void m_Record(int nargs);
|
||||
void m_Stop(int nargs);
|
||||
void m_Pause(int nargs);
|
||||
void m_Resume(int nargs);
|
||||
void m_GetCurrentTime(int nargs);
|
||||
void m_IsASound(int nargs);
|
||||
void m_DeleteSound(int nargs);
|
||||
void m_SetPlaySegment(int nargs);
|
||||
void m_ClearPlaySegment(int nargs);
|
||||
void m_SetSampleRate(int nargs);
|
||||
void m_SetSampleDepth(int nargs);
|
||||
void m_SetCompression(int nargs);
|
||||
void m_GetInputLevel(int nargs);
|
||||
void m_FreeRecordingTime(int nargs);
|
||||
|
||||
} // End of namespace XsoundXtra
|
||||
|
||||
} // End of namespace Director
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user