Initial commit

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

View File

@@ -0,0 +1,97 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/*************************************
*
* USED IN:
* Alice: An Interactive Museum
*
*************************************/
/*
* Widget External Factory
*
* Widget
* I mNew --Creates a new instance of the XObject
* X mDispose --Disposes of XObject instance
* S mGetPro --
* I mAskQuit --
*/
#include "director/director.h"
#include "director/lingo/lingo.h"
#include "director/lingo/lingo-object.h"
#include "director/lingo/lingo-utils.h"
#include "director/lingo/xlibs/w/widgetxobj.h"
namespace Director {
const char *const WidgetXObj::xlibName = "Widget";
const XlibFileDesc WidgetXObj::fileNames[] = {
{ "widget", nullptr },
{ nullptr, nullptr },
};
static const MethodProto xlibMethods[] = {
{ "new", WidgetXObj::m_new, 0, 0, 400 }, // D4
{ "Dispose", WidgetXObj::m_dispose, 0, 0, 400 }, // D4
{ "GetPro", WidgetXObj::m_getPro, 0, 0, 400 }, // D4
{ "AskQuit", WidgetXObj::m_askQuit, 0, 0, 400 }, // D4
{ nullptr, nullptr, 0, 0, 0 }
};
void WidgetXObj::open(ObjectType type, const Common::Path &path) {
if (type == kXObj) {
WidgetXObject::initMethods(xlibMethods);
WidgetXObject *xobj = new WidgetXObject(kXObj);
g_lingo->exposeXObject(xlibName, xobj);
}
}
void WidgetXObj::close(ObjectType type) {
if (type == kXObj) {
WidgetXObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
}
WidgetXObject::WidgetXObject(ObjectType ObjectType) :Object<WidgetXObject>("Widget") {
_objType = ObjectType;
}
void WidgetXObj::m_new(int nargs) {
g_lingo->push(g_lingo->_state->me);
}
void WidgetXObj::m_dispose(int nargs) {
g_lingo->printSTUBWithArglist("WidgetXObj::m_dispose", nargs);
g_lingo->dropStack(nargs);
}
void WidgetXObj::m_getPro(int nargs) {
// seems to want a disk drive letter
g_lingo->push(Datum("D"));
}
XOBJSTUB(WidgetXObj::m_askQuit, 0)
} // End of namespace Director

View File

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

View File

@@ -0,0 +1,153 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "common/system.h"
#include "director/director.h"
#include "director/lingo/lingo.h"
#include "director/lingo/lingo-object.h"
#include "director/lingo/lingo-utils.h"
#include "director/lingo/xlibs/w/window.h"
/**************************************************
*
* USED IN:
* Standard Macromedia Director XObject
*
**************************************************/
/*
--Window, Tool, 1.0
--© 1989, 1990 MacroMind, Inc.
--by John Thompson
-----------------------------------------------------------------------
--NOTE: This XObject will not create a window with scroll bars.--
-----------------------------------------------------------------------
-----------------------------------------------------------------------
--=METHODS=--
--
IIS mNew, kind, titleString --Creates a new instance of the XObject.
--kind: #document #noGrowDoc, #dialog, #roundDialog, #plainDialog, #altDialog
X mDispose --Disposes of the instance.
S mName --Returns name of the XObject.
X mSelect --Brings to the front
X mShow --Shows instance.
X mHide --Hides instance.
XII mMove, hpos, vpos --Moves to hpos, vpos.
XII mSize, width, height --Changes size to width, height.
XIO mAddPanel, symbol, panelObj --Adds a panel.
OI mGetPanel, panelSymbolName --Gets a panel.
XO mSetHandler, handlerObject --Sets the event handler. Args:
O mGetHandler --Return the event handler
/X mIdle
/XI mActivate, flag
/X mUpdate
/XII mMouseUp, eventRecPtr, mdcode
/XII mMouseDown, eventRecPtr, mdcode
/XI mKeyDown, theChar
/X mWindowPtr
/XX mSetTitle
X +mDisposeAll --Closes all windows.
OI +mNthWindow, n --Returns the n'th window.
*/
namespace Director {
const char *const WindowXObj::xlibName = "Window";
const XlibFileDesc WindowXObj::fileNames[] = {
{ "Window", nullptr },
{ nullptr, nullptr },
};
static const MethodProto xlibMethods[] = {
{ "new", WindowXObj::m_new, 2, 2, 200 },
{ "dispose", WindowXObj::m_dispose, 0, 0, 200 },
{ "name", WindowXObj::m_name, 0, 0, 200 },
{ "select", WindowXObj::m_select, 0, 0, 200 },
{ "show", WindowXObj::m_show, 0, 0, 200 },
{ "hide", WindowXObj::m_hide, 0, 0, 200 },
{ "move", WindowXObj::m_move, 2, 2, 200 },
{ "size", WindowXObj::m_size, 2, 2, 200 },
{ "addPanel", WindowXObj::m_addPanel, 2, 2, 200 },
{ "getPanel", WindowXObj::m_getPanel, 1, 1, 200 },
{ "setHandler", WindowXObj::m_setHandler, 1, 1, 200 },
{ "getHandler", WindowXObj::m_getHandler, 0, 0, 200 },
{ "idle", WindowXObj::m_idle, 0, 0, 200 },
{ "activate", WindowXObj::m_activate, 1, 1, 200 },
{ "update", WindowXObj::m_update, 0, 0, 200 },
{ "mouseUp", WindowXObj::m_mouseUp, 2, 2, 200 },
{ "mouseDown", WindowXObj::m_mouseDown, 2, 2, 200 },
{ "keyDown", WindowXObj::m_keyDown, 1, 1, 200 },
{ "windowPtr", WindowXObj::m_windowPtr, 0, 0, 200 },
{ "setTitle", WindowXObj::m_setTitle, 1, 1, 200 },
{ "disposeAll", WindowXObj::m_disposeAll, 0, 0, 200 },
{ "nthWindow", WindowXObj::m_nthWindow, 1, 1, 200 },
{ nullptr, nullptr, 0, 0, 0 }
};
WindowXObject::WindowXObject(ObjectType ObjectType) :Object<WindowXObject>("Window") {
_objType = ObjectType;
}
void WindowXObj::open(ObjectType type, const Common::Path &path) {
if (type == kXObj) {
WindowXObject::initMethods(xlibMethods);
WindowXObject *xobj = new WindowXObject(kXObj);
g_lingo->exposeXObject(xlibName, xobj);
}
}
void WindowXObj::close(ObjectType type) {
if (type == kXObj) {
WindowXObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
}
void WindowXObj::m_new(int nargs) {
g_lingo->printSTUBWithArglist("WindowXObj::m_new", nargs);
g_lingo->dropStack(nargs);
g_lingo->push(g_lingo->_state->me);
}
XOBJSTUBNR(WindowXObj::m_dispose)
XOBJSTUB(WindowXObj::m_name, "")
XOBJSTUBNR(WindowXObj::m_select)
XOBJSTUBNR(WindowXObj::m_show)
XOBJSTUBNR(WindowXObj::m_hide)
XOBJSTUBNR(WindowXObj::m_move)
XOBJSTUBNR(WindowXObj::m_size)
XOBJSTUBNR(WindowXObj::m_addPanel)
XOBJSTUB(WindowXObj::m_getPanel, 0)
XOBJSTUBNR(WindowXObj::m_setHandler)
XOBJSTUB(WindowXObj::m_getHandler, 0)
XOBJSTUBNR(WindowXObj::m_idle)
XOBJSTUBNR(WindowXObj::m_activate)
XOBJSTUBNR(WindowXObj::m_update)
XOBJSTUBNR(WindowXObj::m_mouseUp)
XOBJSTUBNR(WindowXObj::m_mouseDown)
XOBJSTUBNR(WindowXObj::m_keyDown)
XOBJSTUBNR(WindowXObj::m_windowPtr)
XOBJSTUBNR(WindowXObj::m_setTitle)
XOBJSTUBNR(WindowXObj::m_disposeAll)
XOBJSTUB(WindowXObj::m_nthWindow, 0)
}

View File

@@ -0,0 +1,67 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef DIRECTOR_LINGO_XLIBS_WINDOW_H
#define DIRECTOR_LINGO_XLIBS_WINDOW_H
namespace Director {
class WindowXObject : public Object<WindowXObject> {
public:
WindowXObject(ObjectType objType);
};
namespace WindowXObj {
extern const char *const xlibName;
extern const XlibFileDesc fileNames[];
void open(ObjectType type, const Common::Path &path);
void close(ObjectType type);
void m_new(int nargs);
void m_dispose(int nargs);
void m_name(int nargs);
void m_select(int nargs);
void m_show(int nargs);
void m_hide(int nargs);
void m_move(int nargs);
void m_size(int nargs);
void m_addPanel(int nargs);
void m_getPanel(int nargs);
void m_setHandler(int nargs);
void m_getHandler(int nargs);
void m_idle(int nargs);
void m_activate(int nargs);
void m_update(int nargs);
void m_mouseUp(int nargs);
void m_mouseDown(int nargs);
void m_keyDown(int nargs);
void m_windowPtr(int nargs);
void m_setTitle(int nargs);
void m_disposeAll(int nargs);
void m_nthWindow(int nargs);
} // End of namespace WindowXObj
} // End of namespace Director
#endif

View 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/xlibs/w/wininfo.h"
/**************************************************
*
* USED IN:
* Devil's Canyon: A Dinamation Adventure
*
**************************************************/
/*
-- Wininfo Interface - (c)24/9/1995 Terabyte Interactive Ltd - Robert P. Beyer
Wininfo
I mNew --Creates the XObject
X mDispose --Closes the XObject
S mName --Returns the XObject Name and Version
SSSS mWinInfo, file, section, entry --Returns Windows information item
*/
namespace Director {
const char *const WinInfoXObj::xlibName = "Wininfo";
const XlibFileDesc WinInfoXObj::fileNames[] = {
{ "wininfo", nullptr },
{ nullptr, nullptr },
};
static const MethodProto xlibMethods[] = {
{ "new", WinInfoXObj::m_new, 0, 0, 400 },
{ "dispose", WinInfoXObj::m_dispose, 0, 0, 400 },
{ "name", WinInfoXObj::m_name, 0, 0, 400 },
{ "winInfo", WinInfoXObj::m_winInfo, 3, 3, 400 },
{ nullptr, nullptr, 0, 0, 0 }
};
WinInfoXObject::WinInfoXObject(ObjectType ObjectType) : Object<WinInfoXObject>("Wininfo") {
_objType = ObjectType;
}
void WinInfoXObj::open(ObjectType type, const Common::Path &path) {
if (type == kXObj) {
WinInfoXObject::initMethods(xlibMethods);
WinInfoXObject *xobj = new WinInfoXObject(kXObj);
g_lingo->exposeXObject(xlibName, xobj);
}
}
void WinInfoXObj::close(ObjectType type) {
if (type == kXObj) {
WinInfoXObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
}
void WinInfoXObj::m_new(int nargs) {
g_lingo->printSTUBWithArglist("WinInfoXObj::m_new", nargs);
g_lingo->dropStack(nargs);
g_lingo->push(g_lingo->_state->me);
}
XOBJSTUBNR(WinInfoXObj::m_dispose)
XOBJSTUB(WinInfoXObj::m_name, "")
XOBJSTUB(WinInfoXObj::m_winInfo, "")
}

View File

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

View File

@@ -0,0 +1,317 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/*************************************
*
* USED IN:
* Alice: An Interactive Museum
*
*************************************/
/*
* RearWindow is a Mac only XObject. Its purpose is to cover the screen
* with either a 1-bit pattern, indexed color, direct(RGB) color, bitmappedCastMember
* or PICT file picture.
*
* It does this when the Stage size is smaller than the monitor screen.
*
* Implemented as a no-op, since ScummVM doesn't handle desktop backgrounds.
*/
#include "director/director.h"
#include "director/lingo/lingo.h"
#include "director/lingo/lingo-object.h"
#include "director/lingo/xlibs/w/winxobj.h"
namespace Director {
const char *const RearWindowXObj::xlibName = "RearWindow";
const XlibFileDesc RearWindowXObj::fileNames[] = {
{ "RearWindow", nullptr },
{ "RearWindow.Xobj", nullptr },
{ "RearWindow XObj", nullptr },
{ "RW.XOB", nullptr },
{ "winXObj", nullptr },
{ nullptr, nullptr },
};
/*
-- RearWindow.XObj by David Jackson-Shields
-- vers. 1.0.2 (10/11/93)
-- © 1992-93 by David Jackson-Shields
-- All Rights Reserved.
--
-- Includes code from the XObject Developers Kit
-- © 1989-93 by Macromedia Inc.
--
-- Purpose of the XObject:
-- Covers the Finder desktop (behind the Director Stage) with a window
-- containing either a 1-bit pattern, indexed color, direct (RGB) color,
-- bitmapped castMember, or PICT file picture.
--
-- This XObject is for when the Stage size is be smaller than the monitor screen,
-- for covering the Finder Desktop behind the Stage. It requires system 6.0.5
-- or later with Director 3.0 or later. It also provides utility methods for
-- getting the monitor screen size (top, left, bottom, right). In cases where
-- there are multiple monitors, these utility methods return a Rect which contains
-- the minimum bounding rect which contains all monitors. Another utility method
-- returns the name of the current application. Subsequent methods create the Rear
-- Window and fill it with the appropriate color, 1-bit pattern, or image.
--
-- NOTE: When using ResEdit to install this XObject in the resource fork of
-- the movie or projector, be sure to copy the RearWindow WDEF resource as well.
-- This custom Window Definition Procedure prevents accidental clicks on the
-- the RearWindow from bringing it forward, obscuring the Director Stage.
--
IS mNew -- creates the object in RAM. It only takes one argument.
-- (1) The argument specifies multiple or single screen devices to be covered.
-- Use either "M" for multiple, or "S" for single monitor coverage.
-- If you only have only one monitor, you can still use an "M" argument. In fact,
-- the only time a Single-Monitor would be specified would be if you expect a
-- low-memory situation, where the RearWindow plus the size of cast or PICT
-- image would take up more than the largest available freeBlock of memory.
--
-- The mNew method returns system error codes (if any)..otherwise it returns
-- the object handle (a memory address)...like all other XObjects.
-- Example of Lingo syntax:
-- global myObj
-- if objectP( myObj ) then myObj( mDispose )
-- -- [ "M" indicates multiple monitors.]
-- set myObj= RearWindow( mNew, "M" )
-- set resultCode = value( myObj )
-- if resultCode < 0 then
-- alert "System Error trying to create the RearWindow" && string( resultCode )
-- end if
--
S mGetAppName -- returns name of current application, so you can test for either
-- "Macromedia Director 3.x", "MacroMind Player 3.x", or the name of your projector.
-- Example of Lingo syntax:
-- global myObj
-- if objectP( myObj ) then
-- put myObj( mGetAppName ) into returnStr
-- end if
--
I mGetMemoryNeeded -- Returns number of Bytes needed to create a RearWindow
-- for all screen devices. Compare this with the Lingo function 'the freeBlock'.
-- If the mNew method specified "Single" monitor configuration, then
-- this refers to the number of Bytes for only one monitor. See the
-- RearWindow Example Movie for how to use this with Lingo
--
-- Example of Lingo syntax:
-- global myObj
-- set memNeeded = myObj( mGetMemoryNeeded )
--
I mGetScreenTop -- Returns "top" pixel coordinate for all screens
-- (refers to minimum rect surrounding multiple monitors)
--
-- Example of Lingo syntax:
-- global myObj
-- set theScreenTop = myObj( mGetScreenTop )
--
I mGetScreenLeft -- Returns "left" pixel coordinate of all screen areas
-- (refers to minimum rect surrounding multiple monitors)
--
-- Example of Lingo syntax:
-- global myObj
-- set theScreenLeft = myObj( mGetScreenLeft )
--
I mGetScreenBottom -- Returns "bottom" pixel coordinate of all screen areas
-- (refers to minimum rect surrounding multiple monitors)
--
-- Example of Lingo syntax:
-- global myObj
-- set theScreenBottom = myObj( mGetScreenBottom )
--
I mGetScreenRight -- Returns "right" pixel coordinate of all screen areas
-- (refers to minimum rect surrounding multiple monitors)
--
-- Example of Lingo syntax:
-- global myObj
-- set theScreenRight = myObj( mGetScreenRight )
--
II mPatToWindow -- Fills the window behind the Director stage with a particular
-- one-bit QuickDraw pattern, or the Finder desktop pattern. Returns a resultCode
--
-- Example of Lingo syntax:
-- global myObj
-- set resultCode = myObj( mPatToWindow, -1 ) -- fills with a white pattern
-- set resultCode = myObj( mPatToWindow, -2 ) -- fills with a light gray pattern
-- set resultCode = myObj( mPatToWindow, -3 ) -- fills with a middle gray pattern
-- set resultCode = myObj( mPatToWindow, -4 ) -- fills with a dark gray pattern
-- set resultCode = myObj( mPatToWindow, -5 ) -- fills with a black pattern
-- set resultCode = myObj( mPatToWindow, -99 ) -- any other negative number fills with
-- --the Finder desktop pattern (whether color or black & white)
--
II mIndexColorToWindow -- In 256-color Monitor mode or less, fills the RearWindow
-- with a specified index color from the current palette. Returns resultCode
--
-- Example of Lingo syntax:
-- global myObj
-- --(int is an integer from 0 to 255:)
-- set resultCode = myObj( mIndexColorToWindow, int ) -- fills with an index color
--
-- NOTE: In direct-color display modes such as “thousands” or “millions”, using the
-- mIndexColorToWindow method will work, but produce unpredictable colors. In modes
-- lower than 256-colors, integers higher than the highest palette index will yield black.
--
IIII mRGBColorToWindow -- Fills the window behind the Director stage with a specified
-- RGB color. In 256-color Monitor mode or less, it produces the closest color in the
-- current indexed palette. Returns a resultCode
--
-- Example of Lingo syntax:
-- global myObj
-- --(red, green and blue are integers from 0 to 65535:)
-- set resultCode = myObj( mRGBColorToWindow, red, green, blue ) -- fills with an
-- --RGB color or its closest equivalent in indexed palette modes
--
ISII mPICTToWindow -- Displays a PICT file in the window behind the Director stage
-- There are 3 arguments:
-- (1) the pathName and fileName -- a string
-- (2) the image placement code -- an integer:
-- Ø = stretched across each monitor screen
-- -1 = positioned in the upper-left of each monitor screen (no stretch)
-- 1 = centered within each monitor screen (no stretch)
-- (3) the background pattern (if any) -- an integer, same as mIndexToWindow
-- Returns a resultCode
--
-- Example of Lingo syntax:
-- global myObj
-- -- to find a file in the same folder as the movie, specify the pathName & «fileName»
-- -- otherwise, specify the full pathName beginning with the volume
-- set fileName = the pathName & "bkPictFile"
-- set resultCode = myObj( mPICTToWindow, fileName, -1, 112 )
--
IPII mCastToWindow -- Displays a movie castMember in the window behind the Stage
-- There are 3 arguments:
-- (1) the picture of a castMember
-- (2) the image placement code -- an integer:
-- Ø = stretched across each monitor screen
-- -1 = positioned in the upper-left of each monitor screen (no stretch)
-- 1 = centered within each monitor screen (no stretch)
-- (3) the background pattern (if any) -- an integer, same as mIndexToWindow
-- Returns resultCode
--
-- Example of Lingo syntax:
-- global myObj
-- set myPic = the picture of cast "bkPict"
-- set resultCode = myObj( mCastToWindow, myPic, 0, 0 )
--
X mDispose -- closes the RearWindow, releases its data, and the XObject itself from RAM
--
-- Example of Lingo syntax:
-- global myObj
-- if objectP( myObj ) then myObj( mDispose )
--
/X mIdle
/XI mActivate, flag
/X mUpdate
/XII mMouseUp, eventRecPtr, mdcode
/XII mMouseDown, eventRecPtr, mdcode
/XI mKeyDown, theChar
/I mMakeWindow
/I mInitDeviceArray
/I mDevPixMapToWindow
*/
static const MethodProto xlibMethods[] = {
{ "new", RearWindowXObj::m_new, 1, 1, 400 }, // D4
{ "getappname", RearWindowXObj::m_getAppName, 0, 0, 400 }, // D4
{ "GetMemoryNeeded", RearWindowXObj::m_getMemoryNeeded, 0, 0, 400 }, // D4
{ "GetScreenBottom", RearWindowXObj::m_getScreenBottom, 0, 0, 400 }, // D4
{ "GetScreenLeft", RearWindowXObj::m_getScreenLeft, 0, 0, 400 }, // D4
{ "GetScreenRight", RearWindowXObj::m_getScreenRight, 0, 0, 400 }, // D4
{ "GetScreenTop", RearWindowXObj::m_getScreenTop, 0, 0, 400 }, // D4
{ "IndexColorToWindow", RearWindowXObj::m_indexColorToWindow, 1, 1, 400 }, // D4
{ "PatToWindow", RearWindowXObj::m_patToWindow, 1, 1, 400 }, // D4
{ "RGBColorToWindow", RearWindowXObj::m_rgbColorToWindow, 3, 3, 400 }, // D4
{ nullptr, nullptr, 0, 0, 0 }
};
void RearWindowXObj::open(ObjectType type, const Common::Path &path) {
if (type == kXObj) {
RearWindowXObject::initMethods(xlibMethods);
RearWindowXObject *xobj = new RearWindowXObject(kXObj);
g_lingo->exposeXObject(xlibName, xobj);
}
}
void RearWindowXObj::close(ObjectType type) {
if (type == kXObj) {
RearWindowXObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
}
RearWindowXObject::RearWindowXObject(ObjectType ObjectType) :Object<RearWindowXObject>("RearWindow") {
_objType = ObjectType;
}
void RearWindowXObj::m_new(int nargs) {
Datum d1 = g_lingo->pop();
g_lingo->push(g_lingo->_state->me);
}
void RearWindowXObj::m_getMemoryNeeded(int nargs) {
// No memory is needed for a stubbed XLib.
g_lingo->push(Datum(0));
}
void RearWindowXObj::m_patToWindow(int nargs) {
g_lingo->pop();
g_lingo->push(Datum(0));
}
void RearWindowXObj::m_indexColorToWindow(int nargs) {
g_lingo->pop();
}
void RearWindowXObj::m_getAppName(int nargs) {
g_lingo->push(Datum(g_director->getStartMovie().startMovie));
}
void RearWindowXObj::m_rgbColorToWindow(int nargs) {
Datum r = g_lingo->pop();
Datum g = g_lingo->pop();
Datum b = g_lingo->pop();
Graphics::MacWindowManager *window = g_director->getMacWindowManager();
window->setDesktopColor(r.asInt(), g.asInt(), b.asInt());
}
void RearWindowXObj::m_getScreenTop(int nargs) {
g_lingo->push(Datum(0));
}
void RearWindowXObj::m_getScreenLeft(int nargs) {
g_lingo->push(Datum(0));
}
void RearWindowXObj::m_getScreenBottom(int nargs) {
g_lingo->push(Datum(g_director->getMacWindowManager()->getHeight()));
}
void RearWindowXObj::m_getScreenRight(int nargs) {
g_lingo->push(Datum(g_director->getMacWindowManager()->getWidth()));
}
} // End of namespace Director

View 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_XLIBS_WINXOBJ_H
#define DIRECTOR_LINGO_XLIBS_WINXOBJ_H
namespace Director {
class RearWindowXObject : public Object<RearWindowXObject> {
public:
RearWindowXObject(ObjectType objType);
};
namespace RearWindowXObj {
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_getAppName(int nargs);
void m_getMemoryNeeded(int nargs);
void m_indexColorToWindow(int nargs);
void m_patToWindow(int nargs);
void m_rgbColorToWindow(int nargs);
void m_getScreenTop(int nargs);
void m_getScreenLeft(int nargs);
void m_getScreenBottom(int nargs);
void m_getScreenRight(int nargs);
} // End of namespace RearWindowXObj
} // End of namespace Director
#endif