[Scummvm-git-logs] scummvm master -> b9c632b224835289d094a671581b70588c213628

sev- sev at scummvm.org
Mon Aug 2 21:01:05 UTC 2021


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
b9c632b224 DIRECTOR: Added stub for PopUp Menu XObj


Commit: b9c632b224835289d094a671581b70588c213628
    https://github.com/scummvm/scummvm/commit/b9c632b224835289d094a671581b70588c213628
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-08-02T23:00:18+02:00

Commit Message:
DIRECTOR: Added stub for PopUp Menu XObj

Changed paths:
  A engines/director/lingo/xlibs/popupmenuxobj.cpp
  A engines/director/lingo/xlibs/popupmenuxobj.h
    engines/director/lingo/lingo-object.cpp
    engines/director/module.mk


diff --git a/engines/director/lingo/lingo-object.cpp b/engines/director/lingo/lingo-object.cpp
index bef55274dc..de03f867b1 100644
--- a/engines/director/lingo/lingo-object.cpp
+++ b/engines/director/lingo/lingo-object.cpp
@@ -40,6 +40,7 @@
 #include "director/lingo/xlibs/fplayxobj.h"
 #include "director/lingo/xlibs/labeldrvxobj.h"
 #include "director/lingo/xlibs/palxobj.h"
+#include "director/lingo/xlibs/popupmenuxobj.h"
 #include "director/lingo/xlibs/soundjam.h"
 #include "director/lingo/xlibs/winxobj.h"
 
@@ -116,6 +117,7 @@ static struct XLibProto {
 	{ "FlushXObj",				FlushXObj::open,		FlushXObj::close,			kXObj,					400 },	// D4
 	{ "FPlayXObj",				FPlayXObj::open,		FPlayXObj::close,			kXObj,					200 },	// D2
 	{ "PalXObj",				PalXObj::open,			PalXObj::close,				kXObj,					400 }, 	// D4
+	{ "PopUp Menu XObj",		PopUpMenuXObj::open,	PopUpMenuXObj::close,		kXObj | kXtraObj,		200 }, 	// D2
 	{ "LabelDrv",				LabelDrvXObj::open,		LabelDrvXObj::close,		kXObj,					400 }, 	// D4
 	{ "SoundJam",				SoundJam::open,			SoundJam::close,			kXObj,					400 },	// D4
 	{ "winXObj",				RearWindowXObj::open,	RearWindowXObj::close,		kXObj,					400 },	// D4
diff --git a/engines/director/lingo/xlibs/popupmenuxobj.cpp b/engines/director/lingo/xlibs/popupmenuxobj.cpp
new file mode 100644
index 0000000000..38060daa74
--- /dev/null
+++ b/engines/director/lingo/xlibs/popupmenuxobj.cpp
@@ -0,0 +1,152 @@
+/* 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 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * mAppendMenu, menuList  adds items to menuList
+ * mDisableItem, itemNum  disables item in pop up menu
+ * mEnableItem, itemNum  enables item in pop up menu
+ * mGetItem, itemNum  returns item in pop up menu
+ * mGetMenuID  returns assigned menuID number
+ * mPopNum, Left, Top, itemNum  returns selected
+ *     item’s number
+ * mPopText, Left, Top, itemNum  returns selected
+ *     item’s text
+ * mSetItem, itemNum, newItemText  sets changes to an
+ *     item in pop up menu
+ * mSetItemMark, markNum  sets marker for pop up menu,
+ *     default is check
+ * mSmart, TrueOrFalse  remembers last selection if itemNum
+ *    is 0 (there was no item selected by user)
+ * mSetItemIcon, itemNum, iconID  attaches an icon to
+ *    menu item; icons should have IDs from 257 to 511
+ */
+
+#include "director/director.h"
+#include "director/lingo/lingo.h"
+#include "director/lingo/lingo-object.h"
+#include "director/lingo/xlibs/popupmenuxobj.h"
+
+
+namespace Director {
+
+static const char *xlibName = "PopUp Menu XObj";
+
+static MethodProto xlibMethods[] = {
+	{ "new",				PopUpMenuXObj::m_new,			 0, 0,	200 },	// D2
+	{ "AppendMenu",			PopUpMenuXObj::m_appendMenu,	 1, 1,	200 },	// D2
+	{ "DisableItem",		PopUpMenuXObj::m_disableItem,	 1, 1,	200 },	// D2
+	{ "EnableItem",			PopUpMenuXObj::m_enableItem,	 1, 1,	200 },	// D2
+	{ "GetItem",			PopUpMenuXObj::m_getItem,		 1, 1,  200 },	// D2
+	{ "GetMenuID",			PopUpMenuXObj::m_getMenuID,		 0, 0,  200 },	// D2
+	{ "PopNum",				PopUpMenuXObj::m_popNum,		 3, 3,  200 },	// D2
+	{ "PopText",			PopUpMenuXObj::m_popText,		 3, 3,  200 },	// D2
+	{ "SetItem",			PopUpMenuXObj::m_setItem,		 2, 2,  200 },	// D2
+	{ "SetItemMark",		PopUpMenuXObj::m_setItemMark,	 1, 1,  200 },	// D2
+	{ "Smart",				PopUpMenuXObj::m_smart,			 1, 1,  200 },	// D2
+	{ "SetItemIcon",		PopUpMenuXObj::m_setItemIcon,	 2, 2,  200 },	// D2
+	{ 0, 0, 0, 0, 0 }
+};
+
+void PopUpMenuXObj::open(int type) {
+	if (type == kXObj) {
+		PopUpMenuXObject::initMethods(xlibMethods);
+		PopUpMenuXObject *xobj = new PopUpMenuXObject(kXObj);
+		g_lingo->_globalvars[xlibName] = xobj;
+	}
+}
+
+void PopUpMenuXObj::close(int type) {
+	if (type == kXObj) {
+		PopUpMenuXObject::cleanupMethods();
+		g_lingo->_globalvars[xlibName] = Datum();
+	}
+}
+
+
+PopUpMenuXObject::PopUpMenuXObject(ObjectType ObjectType) :Object<PopUpMenuXObject>("PopUp Menu XObj") {
+	_objType = ObjectType;
+}
+
+void PopUpMenuXObj::m_new(int nargs) {
+	g_lingo->push(g_lingo->_currentMe);
+}
+
+void PopUpMenuXObj::m_appendMenu(int nargs) {
+	 g_lingo->printSTUBWithArglist("PopUpMenuXObj::m_appendMenu", nargs);
+	 g_lingo->dropStack(nargs);
+}
+
+void PopUpMenuXObj::m_disableItem(int nargs) {
+	 g_lingo->printSTUBWithArglist("PopUpMenuXObj::m_disableItem", nargs);
+	 g_lingo->dropStack(nargs);
+}
+
+void PopUpMenuXObj::m_enableItem(int nargs) {
+	 g_lingo->printSTUBWithArglist("PopUpMenuXObj::m_enableItem", nargs);
+	 g_lingo->dropStack(nargs);
+}
+
+void PopUpMenuXObj::m_getItem(int nargs) {
+	 g_lingo->printSTUBWithArglist("PopUpMenuXObj::m_getItem", nargs);
+	 g_lingo->dropStack(nargs);
+	 g_lingo->push(Datum());
+}
+
+void PopUpMenuXObj::m_getMenuID(int nargs) {
+	 g_lingo->printSTUBWithArglist("PopUpMenuXObj::m_getMenuID", nargs);
+	 g_lingo->dropStack(nargs);
+	 g_lingo->push(Datum());
+}
+
+void PopUpMenuXObj::m_popNum(int nargs) {
+	 g_lingo->printSTUBWithArglist("PopUpMenuXObj::m_popNum", nargs);
+	 g_lingo->dropStack(nargs);
+	 g_lingo->push(Datum());
+}
+
+void PopUpMenuXObj::m_popText(int nargs) {
+	 g_lingo->printSTUBWithArglist("PopUpMenuXObj::m_popText", nargs);
+	 g_lingo->dropStack(nargs);
+	 g_lingo->push(Datum());
+}
+
+void PopUpMenuXObj::m_setItem(int nargs) {
+	 g_lingo->printSTUBWithArglist("PopUpMenuXObj::m_setItem", nargs);
+	 g_lingo->dropStack(nargs);
+}
+
+void PopUpMenuXObj::m_setItemMark(int nargs) {
+	 g_lingo->printSTUBWithArglist("PopUpMenuXObj::m_setItemMark", nargs);
+	 g_lingo->dropStack(nargs);
+}
+
+void PopUpMenuXObj::m_smart(int nargs) {
+	 g_lingo->printSTUBWithArglist("PopUpMenuXObj::m_smart", nargs);
+	 g_lingo->dropStack(nargs);
+}
+
+void PopUpMenuXObj::m_setItemIcon(int nargs) {
+	 g_lingo->printSTUBWithArglist("PopUpMenuXObj::m_setItemIcon", nargs);
+	 g_lingo->dropStack(nargs);
+}
+
+} // End of namespace Director
diff --git a/engines/director/lingo/xlibs/popupmenuxobj.h b/engines/director/lingo/xlibs/popupmenuxobj.h
new file mode 100644
index 0000000000..f18c6115b6
--- /dev/null
+++ b/engines/director/lingo/xlibs/popupmenuxobj.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef DIRECTOR_LINGO_XLIBS_POPUPMENUXOBJ_H
+#define DIRECTOR_LINGO_XLIBS_POPUPMENUXOBJ_H
+
+namespace Director {
+
+class PopUpMenuXObject : public Object<PopUpMenuXObject> {
+public:
+	PopUpMenuXObject(ObjectType objType);
+};
+
+namespace PopUpMenuXObj {
+
+void open(int type);
+void close(int type);
+
+void m_new(int nargs);
+void m_appendMenu(int nargs);
+void m_disableItem(int nargs);
+void m_enableItem(int nargs);
+void m_getItem(int nargs);
+void m_getMenuID(int nargs);
+void m_popNum(int nargs);
+void m_popText(int nargs);
+void m_setItem(int nargs);
+void m_setItemMark(int nargs);
+void m_smart(int nargs);
+void m_setItemIcon(int nargs);
+
+} // End of namespace PopUpMenuXObj
+
+} // End of namespace Director
+
+#endif
diff --git a/engines/director/module.mk b/engines/director/module.mk
index f8292454ce..936739dfc6 100644
--- a/engines/director/module.mk
+++ b/engines/director/module.mk
@@ -42,6 +42,7 @@ MODULE_OBJS = \
 	lingo/xlibs/fplayxobj.o \
 	lingo/xlibs/labeldrvxobj.o \
 	lingo/xlibs/palxobj.o \
+	lingo/xlibs/popupmenuxobj.o \
 	lingo/xlibs/soundjam.o \
 	lingo/xlibs/winxobj.o
 




More information about the Scummvm-git-logs mailing list