Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'intern/action/test/action_c_test')
-rw-r--r--intern/action/test/action_c_test/ActionTest.c83
-rw-r--r--intern/action/test/action_c_test/TestAction.c59
-rw-r--r--intern/action/test/action_c_test/TestAction.h50
-rw-r--r--intern/action/test/action_c_test/make/msvc_6_0/action_c_test.dsp109
-rw-r--r--intern/action/test/action_c_test/make/msvc_6_0/action_c_test.dsw44
5 files changed, 345 insertions, 0 deletions
diff --git a/intern/action/test/action_c_test/ActionTest.c b/intern/action/test/action_c_test/ActionTest.c
new file mode 100644
index 00000000000..a30163e0c3b
--- /dev/null
+++ b/intern/action/test/action_c_test/ActionTest.c
@@ -0,0 +1,83 @@
+/**
+ * $Id$
+ * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
+ *
+ * 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. The Blender
+ * Foundation also sells licenses for use in proprietary software under
+ * the Blender License. See http://www.blender.org/BL/ for information
+ * about this.
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL/BL DUAL LICENSE BLOCK *****
+ */
+
+/**
+
+ * $Id$
+ * Copyright (C) 2001 NaN Technologies B.V.
+ * @author Maarten Gribnau
+ * @date March 31, 2001
+ */
+
+#include "ACT_ActionC-Api.h"
+#include "TestAction.h"
+
+int main(int argc, char *argv[])
+{
+ ACT_ActionStackPtr stack = ACT_ActionStackCreate (3);
+ ACT_ActionPtr action = ACT_ActionCreate("action1", 0, 0, printApplied, printUndone, printDisposed);
+ ACT_ActionStackPush(stack, action);
+ MEM_RefCountedDecRef(action);
+ action = ACT_ActionCreate("action2", 0, 0, printApplied, printUndone, printDisposed);
+ ACT_ActionStackPush(stack, action);
+ MEM_RefCountedDecRef(action);
+ action = ACT_ActionCreate("action3", 0, 0, printApplied, printUndone, printDisposed);
+ ACT_ActionStackPush(stack, action);
+ MEM_RefCountedDecRef(action);
+
+ ACT_ActionStackUndo(stack);
+ ACT_ActionStackUndo(stack);
+ ACT_ActionStackUndo(stack);
+ ACT_ActionStackRedo(stack);
+ ACT_ActionStackRedo(stack);
+ ACT_ActionStackRedo(stack);
+
+ ACT_ActionStackSetMaxStackDepth(stack, 1);
+ ACT_ActionStackUndo(stack);
+ ACT_ActionStackRedo(stack);
+ ACT_ActionStackSetMaxStackDepth(stack, 5);
+ ACT_ActionStackUndo(stack);
+ ACT_ActionStackRedo(stack);
+
+ action = ACT_ActionCreate("action4", 0, 0, printApplied, printUndone, printDisposed);
+ ACT_ActionStackPush(stack, action);
+ MEM_RefCountedDecRef(action);
+ ACT_ActionStackUndo(stack);
+ action = ACT_ActionCreate("action5", 0, 0, printApplied, printUndone, printDisposed);
+ ACT_ActionStackPush(stack, action);
+ MEM_RefCountedDecRef(action);
+ ACT_ActionStackUndo(stack);
+ ACT_ActionStackUndo(stack);
+ ACT_ActionStackRedo(stack);
+ ACT_ActionStackRedo(stack);
+
+ return 0;
+} \ No newline at end of file
diff --git a/intern/action/test/action_c_test/TestAction.c b/intern/action/test/action_c_test/TestAction.c
new file mode 100644
index 00000000000..7b9739495d0
--- /dev/null
+++ b/intern/action/test/action_c_test/TestAction.c
@@ -0,0 +1,59 @@
+/**
+ * $Id$
+ * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
+ *
+ * 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. The Blender
+ * Foundation also sells licenses for use in proprietary software under
+ * the Blender License. See http://www.blender.org/BL/ for information
+ * about this.
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL/BL DUAL LICENSE BLOCK *****
+ */
+
+/**
+
+ * $Id$
+ * Copyright (C) 2001 NaN Technologies B.V.
+ * @author Maarten Gribnau
+ * @date March 31, 2001
+ */
+
+#include <stdio.h>
+
+#include "TestAction.h"
+
+
+void printApplied(ACT_ActionPtr action, ACT_ActionUserDataPtr userData)
+{
+ printf("%s: applied\n", ACT_ActionGetName(action));
+}
+
+void printUndone(ACT_ActionPtr action, ACT_ActionUserDataPtr userData)
+{
+ printf("%s: undone\n", ACT_ActionGetName(action));
+}
+
+
+void printDisposed(ACT_ActionPtr action, ACT_ActionUserDataPtr userData)
+{
+ printf("%s: disposed\n", ACT_ActionGetName(action));
+}
diff --git a/intern/action/test/action_c_test/TestAction.h b/intern/action/test/action_c_test/TestAction.h
new file mode 100644
index 00000000000..7abf0be6919
--- /dev/null
+++ b/intern/action/test/action_c_test/TestAction.h
@@ -0,0 +1,50 @@
+/**
+ * $Id$
+ * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
+ *
+ * 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. The Blender
+ * Foundation also sells licenses for use in proprietary software under
+ * the Blender License. See http://www.blender.org/BL/ for information
+ * about this.
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL/BL DUAL LICENSE BLOCK *****
+ */
+
+/**
+
+ * $Id$
+ * Copyright (C) 2001 NaN Technologies B.V.
+ * @author Maarten Gribnau
+ * @date March 31, 2001
+ */
+
+#ifndef _H_ACT_TESTACTION_C_H_
+#define _H_ACT_TESTACTION_C_H_
+
+#include "ACT_ActionC-Api.h"
+
+void printApplied(ACT_ActionPtr action, ACT_ActionUserDataPtr userData);
+void printUndone(ACT_ActionPtr action, ACT_ActionUserDataPtr userData);
+void printDisposed(ACT_ActionPtr action, ACT_ActionUserDataPtr userData);
+
+
+#endif // _H_ACT_TESTACTION_C_H_ \ No newline at end of file
diff --git a/intern/action/test/action_c_test/make/msvc_6_0/action_c_test.dsp b/intern/action/test/action_c_test/make/msvc_6_0/action_c_test.dsp
new file mode 100644
index 00000000000..807024f20be
--- /dev/null
+++ b/intern/action/test/action_c_test/make/msvc_6_0/action_c_test.dsp
@@ -0,0 +1,109 @@
+# Microsoft Developer Studio Project File - Name="action_c_test" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=action_c_test - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "action_c_test.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "action_c_test.mak" CFG="action_c_test - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "action_c_test - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "action_c_test - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "action_c_test - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "../../../../../../../obj/windows/intern/action/test"
+# PROP Intermediate_Dir "../../../../../../../obj/windows/intern/action/test"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "../../../.." /I "../../../../../../lib/windows/memutil/include/" /I "../../../../../../lib/windows/string/include/" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib string.lib memutil.lib /nologo /subsystem:console /machine:I386 /libpath:"../../../../../../lib/windows/memutil/lib" /libpath:"../../../../../../lib/windows/string/lib"
+
+!ELSEIF "$(CFG)" == "action_c_test - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "../../../../../../../obj/windows/intern/action/test/debug"
+# PROP Intermediate_Dir "../../../../../../../obj/windows/intern/action/test/debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../.." /I "../../../../../../lib/windows/memutil/include/" /I "../../../../../../lib/windows/string/include/" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib string.lib memutil.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"../../../../../../lib/windows/memutil/lib/debug" /libpath:"../../../../../../lib/windows/string/lib/debug"
+
+!ENDIF
+
+# Begin Target
+
+# Name "action_c_test - Win32 Release"
+# Name "action_c_test - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\ActionTest.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\TestAction.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\TestAction.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/intern/action/test/action_c_test/make/msvc_6_0/action_c_test.dsw b/intern/action/test/action_c_test/make/msvc_6_0/action_c_test.dsw
new file mode 100644
index 00000000000..688f24e4d53
--- /dev/null
+++ b/intern/action/test/action_c_test/make/msvc_6_0/action_c_test.dsw
@@ -0,0 +1,44 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "action"="..\..\..\..\make\msvc_6_0\action.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "action_c_test"=".\action_c_test.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name action
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+