[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49982] branches/soc-2012-swiss_cheese: Moving toward the new way of handling context.
Nicholas Rishel
rishel.nick at gmail.com
Sat Aug 18 08:06:43 CEST 2012
Revision: 49982
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49982
Author: nicholas_rishel
Date: 2012-08-18 06:06:35 +0000 (Sat, 18 Aug 2012)
Log Message:
-----------
Moving toward the new way of handling context. Not fleshed out, but merging to prevent against data loss (while it is still compiling!).
Modified Paths:
--------------
branches/soc-2012-swiss_cheese/intern/touch/CMakeLists.txt
branches/soc-2012-swiss_cheese/intern/touch/TOUCH_API.h
branches/soc-2012-swiss_cheese/intern/touch/TOUCH_Manager.h
branches/soc-2012-swiss_cheese/intern/touch/TOUCH_Types.h
branches/soc-2012-swiss_cheese/intern/touch/intern/TOUCH_API.cpp
branches/soc-2012-swiss_cheese/intern/touch/intern/TOUCH_Manager.cpp
branches/soc-2012-swiss_cheese/source/blender/windowmanager/intern/wm_init_exit.c
Added Paths:
-----------
branches/soc-2012-swiss_cheese/intern/touch/TOUCH_Context.h
branches/soc-2012-swiss_cheese/intern/touch/TOUCH_ContextBlender.h
branches/soc-2012-swiss_cheese/intern/touch/TOUCH_ContextGameEngine.h
branches/soc-2012-swiss_cheese/intern/touch/TOUCH_TypesBlender.h
branches/soc-2012-swiss_cheese/intern/touch/TOUCH_TypesGameEngine.h
branches/soc-2012-swiss_cheese/intern/touch/intern/TOUCH_Context.cpp
branches/soc-2012-swiss_cheese/intern/touch/intern/TOUCH_ContextBlender.cpp
branches/soc-2012-swiss_cheese/intern/touch/intern/TOUCH_ContextGameEngine.cpp
Modified: branches/soc-2012-swiss_cheese/intern/touch/CMakeLists.txt
===================================================================
--- branches/soc-2012-swiss_cheese/intern/touch/CMakeLists.txt 2012-08-18 05:49:55 UTC (rev 49981)
+++ branches/soc-2012-swiss_cheese/intern/touch/CMakeLists.txt 2012-08-18 06:06:35 UTC (rev 49982)
@@ -33,12 +33,23 @@
)
set(SRC
+ intern/TOUCH_API.cpp
+
intern/TOUCH_Manager.cpp
- intern/TOUCH_API.cpp
+ intern/TOUCH_Context.cpp
+ intern/TOUCH_ContextBlender.cpp
+ intern/TOUCH_ContextGameEngine.cpp
TOUCH_API.h
TOUCH_Types.h
+ TOUCH_TypesBlender.h
+ TOUCH_TypesGameEngine.h
+
TOUCH_Manager.h
+ TOUCH_Context.h
+ TOUCH_ContextBlender.h
+ TOUCH_ContextGameEngine.h
+
)
blender_add_lib(bf_intern_touch "${SRC}" "${INC}" "${INC_SYS}")
Modified: branches/soc-2012-swiss_cheese/intern/touch/TOUCH_API.h
===================================================================
--- branches/soc-2012-swiss_cheese/intern/touch/TOUCH_API.h 2012-08-18 05:49:55 UTC (rev 49981)
+++ branches/soc-2012-swiss_cheese/intern/touch/TOUCH_API.h 2012-08-18 06:06:35 UTC (rev 49982)
@@ -41,14 +41,11 @@
#endif
extern TOUCH_Handle TOUCH_InitManager();
+
extern void TOUCH_DestoryManager(TOUCH_Handle * handle);
-#if 0
-extern void TOUCH_RegisterContext(TOUCH_Handle* handle, const char * context);
-extern void TOUCH_RegisterRegion(TOUCH_Handle* handle, const char * context);
-extern void TOUCH_RegisterData(TOUCH_Handle* handle, const char * context);
-#endif
-extern void TOUCH_AddTouchEvent(TOUCH_Handle* handle, void * event);
+extern void TOUCH_AddTouchEvent(TOUCH_Handle * handle, void * event);
+
#ifdef __cplusplus
}
#endif
Added: branches/soc-2012-swiss_cheese/intern/touch/TOUCH_Context.h
===================================================================
--- branches/soc-2012-swiss_cheese/intern/touch/TOUCH_Context.h (rev 0)
+++ branches/soc-2012-swiss_cheese/intern/touch/TOUCH_Context.h 2012-08-18 06:06:35 UTC (rev 49982)
@@ -0,0 +1,42 @@
+/*
+ * ***** BEGIN GPL 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.
+ *
+ * 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.
+ *
+ * The Original Code is Copyright (C) 2012 Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Nicholas Rishel
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file touch/TOUCH_Context.h
+ * \ingroup TOUCH
+ */
+
+#ifndef __TOUCH_CONTEXT_H__
+#define __TOUCH_CONTEXT_H__
+
+class TOUCH_Context {
+protected:
+ TOUCH_Context();
+ virtual ~TOUCH_Context();
+public:
+};
+
+#endif // __TOUCH_CONTEXT_H__
Added: branches/soc-2012-swiss_cheese/intern/touch/TOUCH_ContextBlender.h
===================================================================
--- branches/soc-2012-swiss_cheese/intern/touch/TOUCH_ContextBlender.h (rev 0)
+++ branches/soc-2012-swiss_cheese/intern/touch/TOUCH_ContextBlender.h 2012-08-18 06:06:35 UTC (rev 49982)
@@ -0,0 +1,49 @@
+/*
+ * ***** BEGIN GPL 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.
+ *
+ * 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.
+ *
+ * The Original Code is Copyright (C) 2012 Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Nicholas Rishel
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file touch/TOUCH_ContextBlender.h
+ * \ingroup TOUCH
+ */
+
+/*
+ * Touch Context for Blender assumes that a known Area and Region have been provided
+ */
+
+#ifndef __TOUCH_CONTEXTBLENDER_H__
+#define __TOUCH_CONTEXTBLENDER_H__
+
+#include "TOUCH_TypesBlender.h"
+#include "TOUCH_Context.h"
+
+class TOUCH_ContextBlender : TOUCH_Context {
+public:
+ TOUCH_ContextBlender();
+ ~TOUCH_ContextBlender();
+protected:
+};
+
+#endif // __TOUCH_CONTEXTBLENDER_H__
Added: branches/soc-2012-swiss_cheese/intern/touch/TOUCH_ContextGameEngine.h
===================================================================
--- branches/soc-2012-swiss_cheese/intern/touch/TOUCH_ContextGameEngine.h (rev 0)
+++ branches/soc-2012-swiss_cheese/intern/touch/TOUCH_ContextGameEngine.h 2012-08-18 06:06:35 UTC (rev 49982)
@@ -0,0 +1,45 @@
+/*
+ * ***** BEGIN GPL 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.
+ *
+ * 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.
+ *
+ * The Original Code is Copyright (C) 2012 Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Nicholas Rishel
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file touch/TOUCH_ContextGameEngine.h
+ * \ingroup TOUCH
+ */
+
+#ifndef __TOUCH_CONTEXTGAMEENGINE_H__
+#define __TOUCH_CONTEXTGAMEENGINE_H__
+
+#include "TOUCH_TypesGameEngine.h"
+#include "TOUCH_Context.h"
+
+class TOUCH_ContextGameEngine : TOUCH_Context {
+public:
+ TOUCH_ContextGameEngine();
+ ~TOUCH_ContextGameEngine();
+protected:
+};
+
+#endif // __TOUCH_CONTEXTGAMEENGINE_H__
Modified: branches/soc-2012-swiss_cheese/intern/touch/TOUCH_Manager.h
===================================================================
--- branches/soc-2012-swiss_cheese/intern/touch/TOUCH_Manager.h 2012-08-18 05:49:55 UTC (rev 49981)
+++ branches/soc-2012-swiss_cheese/intern/touch/TOUCH_Manager.h 2012-08-18 06:06:35 UTC (rev 49982)
@@ -32,21 +32,20 @@
#ifndef __TOUCH_TOUCH_H__
#define __TOUCH_TOUCH_H__
-#include "TOUCH_Types.h"
#include <vector>
#include "STR_String.h"
+#include "TOUCH_Types.h"
+#if 1
+# include "TOUCH_ContextBlender.h"
+#else
+# include "TOUCH_ContextGameEngine.h"
+#endif
+
#ifdef INPUT_TOUCH_DEBUG
#include <stdio.h>
#endif
-struct TOUCH_Context
-{
- TOUCH_Context();
- STR_String external_id;
- char internal_encoding;
-};
-
class TOUCH_Manager
{
public:
@@ -60,25 +59,15 @@
*/
~TOUCH_Manager();
- void RegisterContext(std::vector<TOUCH_Context> * context_type, const char * context_id);
+ void AddTouchEvent(void * event);
- void AddTouchEvent(std::vector<TOUCH_event_info> event);
-
static void CreateManager();
static void DestroyManager();
static TOUCH_Manager * GetManager();
private:
- char checkRegisteredContext(std::vector<TOUCH_Context> * context_type, const char * context_id);
-
STR_String input_string;
- //std::vector<TOUCH_position> touch_position_begin; XXX
- //std::vector<TOUCH_position> touch_position_last; XXX
- std::vector<TOUCH_Context> registered_area; //pass with ®istered_area
- std::vector<TOUCH_Context> registered_region;
- std::vector<TOUCH_Context> registered_data;
-
static TOUCH_Manager * manager;
};
Modified: branches/soc-2012-swiss_cheese/intern/touch/TOUCH_Types.h
===================================================================
--- branches/soc-2012-swiss_cheese/intern/touch/TOUCH_Types.h 2012-08-18 05:49:55 UTC (rev 49981)
+++ branches/soc-2012-swiss_cheese/intern/touch/TOUCH_Types.h 2012-08-18 06:06:35 UTC (rev 49982)
@@ -25,7 +25,7 @@
* ***** END GPL LICENSE BLOCK *****
*/
-/** \file touch/touch_types.h
+/** \file touch/TOUCH_Types.h
* \ingroup TOUCH
*/
@@ -48,17 +48,11 @@
TOUCH_UP = 2
} TOUCH_state;
-typedef struct TOUCH_position {
- int position_x, position_y;
-} TOUCH_position;
-
-typedef struct TOUCH_event_info {
- //TOUCH_event_info *prev, *next;
- TOUCH_position position;
+typedef struct TOUCH_event_base {
char index;
+ int position_x;
+ int position_y;
TOUCH_state state;
+} TOUCH_event_base;
- char * area, * region, * data;
-} TOUCH_event_info;
-
-#endif /* TOUCH_TYPES_H */
+#endif /* __TOUCH_TYPES_H__ */
Added: branches/soc-2012-swiss_cheese/intern/touch/TOUCH_TypesBlender.h
===================================================================
--- branches/soc-2012-swiss_cheese/intern/touch/TOUCH_TypesBlender.h (rev 0)
+++ branches/soc-2012-swiss_cheese/intern/touch/TOUCH_TypesBlender.h 2012-08-18 06:06:35 UTC (rev 49982)
@@ -0,0 +1,47 @@
+/*
+ * ***** BEGIN GPL 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.
+ *
+ * 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,
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list