axmol/cocos/editor-support/cocostudio/WidgetReader/TabControlReader/TabControlReader.cpp

1007 lines
34 KiB
C++
Raw Normal View History

Squashed commit of the following: commit 87b7c3e404a9b6cce6d4f6bc8565e7feef429ee0 Author: geron-cn <c.ever.fallen@gmail.com> Date: Thu Mar 3 13:43:04 2016 +0800 change enum to enum class use tabitem as pointer to replace _currentTabItemIndex commit c0830cc581b8a07d6eed63268bf5be6a828c113a Merge: 3663156 166931a Author: geron-cn <c.ever.fallen@gmail.com> Date: Thu Mar 3 11:48:44 2016 +0800 Merge remote-tracking branch 'gero/tabview' into tabcontrol commit 366315624143ff01c3e2b22b415ab79050e381e4 Author: geron-cn <c.ever.fallen@gmail.com> Date: Thu Mar 3 11:48:15 2016 +0800 Squashed commit of the following: commit 166931a28c8736ab58b7c4319c1139b5e4865a9e Author: geron-cn <c.ever.fallen@gmail.com> Date: Wed Mar 2 21:35:06 2016 +0800 fix commit e0eb069846a8ceb4b726c3c945801c944404b102 Author: geron-cn <c.ever.fallen@gmail.com> Date: Wed Mar 2 21:30:44 2016 +0800 fix active deactive in tabcontrol commit aeb1c857cab23299e44a86ac1f627c7bd5fa5a6d Author: geron-cn <c.ever.fallen@gmail.com> Date: Wed Mar 2 20:16:22 2016 +0800 fix active -1 commit e57796cbbae851e8cff52656b3265c80c2e8f6f7 Author: geron-cn <c.ever.fallen@gmail.com> Date: Wed Mar 2 16:00:51 2016 +0800 fix merge file commit cdd44f1c577ad190bc175896107a48fbb36b65bb Merge: 1658ad6 6bf55ed Author: geron-cn <c.ever.fallen@gmail.com> Date: Wed Mar 2 15:57:48 2016 +0800 Merge branch 'v3' of github.com:cocos2d/cocos2d-x into tabview # Conflicts: # cocos/ui/CMakeLists.txt commit 1658ad6f4a2bd0889d6cc020072d7fb9192cafc3 Author: geron-cn <c.ever.fallen@gmail.com> Date: Wed Mar 2 15:27:31 2016 +0800 configure for win8.1 commit ec236bff711b72952d48ec4d8b9137b4812b7a72 Author: geron-cn <c.ever.fallen@gmail.com> Date: Tue Mar 1 10:20:23 2016 +0800 configure for iOS mac twos android linux commit 9d6678a4388461a791abe968fa637df2fc6839d3 Author: geron-cn <c.ever.fallen@gmail.com> Date: Tue Mar 1 10:02:17 2016 +0800 add lack files commit 1f2b5a3e989b05f67a705c81a20c75d3e0ed88a1 Author: geron-cn <c.ever.fallen@gmail.com> Date: Mon Feb 29 22:05:22 2016 +0800 add test case for TabControl commit 97b8d8d87a37881b33ebe90478392150ef341b3e Author: geron-cn <c.ever.fallen@gmail.com> Date: Mon Feb 29 15:43:29 2016 +0800 add const to getter setter commit f49a0483049d2aa7e21bcbe10e553c207adc4bdf Author: geron-cn <c.ever.fallen@gmail.com> Date: Mon Feb 29 14:50:04 2016 +0800 format the comments commit a1989a8f89d33ef8d9eefff6c8117b45977308ad Author: geron-cn <c.ever.fallen@gmail.com> Date: Mon Feb 29 11:51:06 2016 +0800 remove reference commit 1a573e68d30cc56bed9b2338cbbd311e2541fdfd Author: geron-cn <c.ever.fallen@gmail.com> Date: Mon Feb 29 11:40:04 2016 +0800 configure for win8.1 commit c015ac54028534202f62ff85f9a9d4b62b12801e Author: geron-cn <c.ever.fallen@gmail.com> Date: Mon Feb 29 11:27:54 2016 +0800 fix error commit 91c4ac9ae73d4e7efcee389d7af5ec7178c94836 Author: geron-cn <c.ever.fallen@gmail.com> Date: Mon Feb 29 11:25:51 2016 +0800 add interface commit eaf3e237cdcb9c49cd4161691471a8761f8dbdae Author: geron-cn <c.ever.fallen@gmail.com> Date: Sun Feb 28 03:21:22 2016 +0800 fix compile error for tw-os commit 3bfaa2976751e844a591ae5524bfd81249927c7c Author: geron-cn <c.ever.fallen@gmail.com> Date: Sun Feb 28 03:04:23 2016 +0800 fix linux compile error commit fafe3ad660e644924fd02665b77e1df4076a4802 Author: geron-cn <c.ever.fallen@gmail.com> Date: Sun Feb 28 02:54:34 2016 +0800 re-indent code with X-Code commit f8dfe5b551b0bb0a1a1d7b15556db700a35651a5 Author: geron-cn <c.ever.fallen@gmail.com> Date: Sun Feb 28 02:37:51 2016 +0800 add reader configure for android commit 07033f7b6074edf8a333e40c2382a09a2b2325e4 Author: geron-cn <c.ever.fallen@gmail.com> Date: Sun Feb 28 02:22:00 2016 +0800 format code, remove some warning commit 22ed160628f1946d0ccbdf6fc066ec80e56ae611 Author: geron-cn <c.ever.fallen@gmail.com> Date: Sun Feb 28 02:02:27 2016 +0800 configure for mac project commit de21cea12c0a898ea95f9951022be85bdddeefaf Author: geron-cn <c.ever.fallen@gmail.com> Date: Sat Feb 27 18:28:10 2016 +0800 add comment for apis commit b9cebf881a5cd4ecbb740b98cff7dc61183b1db2 Author: geron-cn <c.ever.fallen@gmail.com> Date: Sat Feb 27 15:32:46 2016 +0800 fix parse objects in container commit 53bcce68b053a5b918a29735fed393c210d9cc2c Author: geron-cn <c.ever.fallen@gmail.com> Date: Fri Feb 26 22:10:54 2016 +0800 fix flatbuffer parse commit 9cbdbdc5d046751ae1398dd622ccab0e2797d055 Author: geron-cn <c.ever.fallen@gmail.com> Date: Fri Feb 26 18:26:07 2016 +0800 Init ui::TabControl commit 166931a28c8736ab58b7c4319c1139b5e4865a9e Author: geron-cn <c.ever.fallen@gmail.com> Date: Wed Mar 2 21:35:06 2016 +0800 fix commit e0eb069846a8ceb4b726c3c945801c944404b102 Author: geron-cn <c.ever.fallen@gmail.com> Date: Wed Mar 2 21:30:44 2016 +0800 fix active deactive in tabcontrol commit aeb1c857cab23299e44a86ac1f627c7bd5fa5a6d Author: geron-cn <c.ever.fallen@gmail.com> Date: Wed Mar 2 20:16:22 2016 +0800 fix active -1 commit e57796cbbae851e8cff52656b3265c80c2e8f6f7 Author: geron-cn <c.ever.fallen@gmail.com> Date: Wed Mar 2 16:00:51 2016 +0800 fix merge file commit cdd44f1c577ad190bc175896107a48fbb36b65bb Merge: 1658ad6 6bf55ed Author: geron-cn <c.ever.fallen@gmail.com> Date: Wed Mar 2 15:57:48 2016 +0800 Merge branch 'v3' of github.com:cocos2d/cocos2d-x into tabview # Conflicts: # cocos/ui/CMakeLists.txt commit 1658ad6f4a2bd0889d6cc020072d7fb9192cafc3 Author: geron-cn <c.ever.fallen@gmail.com> Date: Wed Mar 2 15:27:31 2016 +0800 configure for win8.1 commit ec236bff711b72952d48ec4d8b9137b4812b7a72 Author: geron-cn <c.ever.fallen@gmail.com> Date: Tue Mar 1 10:20:23 2016 +0800 configure for iOS mac twos android linux commit 9d6678a4388461a791abe968fa637df2fc6839d3 Author: geron-cn <c.ever.fallen@gmail.com> Date: Tue Mar 1 10:02:17 2016 +0800 add lack files commit 1f2b5a3e989b05f67a705c81a20c75d3e0ed88a1 Author: geron-cn <c.ever.fallen@gmail.com> Date: Mon Feb 29 22:05:22 2016 +0800 add test case for TabControl commit 97b8d8d87a37881b33ebe90478392150ef341b3e Author: geron-cn <c.ever.fallen@gmail.com> Date: Mon Feb 29 15:43:29 2016 +0800 add const to getter setter commit f49a0483049d2aa7e21bcbe10e553c207adc4bdf Author: geron-cn <c.ever.fallen@gmail.com> Date: Mon Feb 29 14:50:04 2016 +0800 format the comments commit a1989a8f89d33ef8d9eefff6c8117b45977308ad Author: geron-cn <c.ever.fallen@gmail.com> Date: Mon Feb 29 11:51:06 2016 +0800 remove reference commit 1a573e68d30cc56bed9b2338cbbd311e2541fdfd Author: geron-cn <c.ever.fallen@gmail.com> Date: Mon Feb 29 11:40:04 2016 +0800 configure for win8.1 commit c015ac54028534202f62ff85f9a9d4b62b12801e Author: geron-cn <c.ever.fallen@gmail.com> Date: Mon Feb 29 11:27:54 2016 +0800 fix error commit 91c4ac9ae73d4e7efcee389d7af5ec7178c94836 Author: geron-cn <c.ever.fallen@gmail.com> Date: Mon Feb 29 11:25:51 2016 +0800 add interface commit eaf3e237cdcb9c49cd4161691471a8761f8dbdae Author: geron-cn <c.ever.fallen@gmail.com> Date: Sun Feb 28 03:21:22 2016 +0800 fix compile error for tw-os commit 3bfaa2976751e844a591ae5524bfd81249927c7c Author: geron-cn <c.ever.fallen@gmail.com> Date: Sun Feb 28 03:04:23 2016 +0800 fix linux compile error commit fafe3ad660e644924fd02665b77e1df4076a4802 Author: geron-cn <c.ever.fallen@gmail.com> Date: Sun Feb 28 02:54:34 2016 +0800 re-indent code with X-Code commit f8dfe5b551b0bb0a1a1d7b15556db700a35651a5 Author: geron-cn <c.ever.fallen@gmail.com> Date: Sun Feb 28 02:37:51 2016 +0800 add reader configure for android commit 07033f7b6074edf8a333e40c2382a09a2b2325e4 Author: geron-cn <c.ever.fallen@gmail.com> Date: Sun Feb 28 02:22:00 2016 +0800 format code, remove some warning commit 22ed160628f1946d0ccbdf6fc066ec80e56ae611 Author: geron-cn <c.ever.fallen@gmail.com> Date: Sun Feb 28 02:02:27 2016 +0800 configure for mac project commit de21cea12c0a898ea95f9951022be85bdddeefaf Author: geron-cn <c.ever.fallen@gmail.com> Date: Sat Feb 27 18:28:10 2016 +0800 add comment for apis commit b9cebf881a5cd4ecbb740b98cff7dc61183b1db2 Author: geron-cn <c.ever.fallen@gmail.com> Date: Sat Feb 27 15:32:46 2016 +0800 fix parse objects in container commit 53bcce68b053a5b918a29735fed393c210d9cc2c Author: geron-cn <c.ever.fallen@gmail.com> Date: Fri Feb 26 22:10:54 2016 +0800 fix flatbuffer parse commit 9cbdbdc5d046751ae1398dd622ccab0e2797d055 Author: geron-cn <c.ever.fallen@gmail.com> Date: Fri Feb 26 18:26:07 2016 +0800 Init ui::TabControl
2016-03-03 14:17:48 +08:00
/****************************************************************************
Copyright (c) 2015 Chukong Technologies Inc.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "tinyxml2/tinyxml2.h"
#include "flatbuffers/flatbuffers.h"
#include "editor-support/cocostudio/WidgetReader/WidgetReader.h"
#include "editor-support/cocostudio/CSParseBinary_generated.h"
#include "editor-support/cocostudio/WidgetReader/TabControlReader/TabControlReader.h"
#include "editor-support/cocostudio/FlatBuffersSerialize.h"
#include "editor-support/cocostudio/ActionTimeline/CSLoader.h"
#include "ui/UITabControl.h"
2016-04-18 15:09:21 +08:00
#include "platform/CCFileUtils.h"
#include "2d/CCSpriteFrameCache.h"
Squashed commit of the following: commit 87b7c3e404a9b6cce6d4f6bc8565e7feef429ee0 Author: geron-cn <c.ever.fallen@gmail.com> Date: Thu Mar 3 13:43:04 2016 +0800 change enum to enum class use tabitem as pointer to replace _currentTabItemIndex commit c0830cc581b8a07d6eed63268bf5be6a828c113a Merge: 3663156 166931a Author: geron-cn <c.ever.fallen@gmail.com> Date: Thu Mar 3 11:48:44 2016 +0800 Merge remote-tracking branch 'gero/tabview' into tabcontrol commit 366315624143ff01c3e2b22b415ab79050e381e4 Author: geron-cn <c.ever.fallen@gmail.com> Date: Thu Mar 3 11:48:15 2016 +0800 Squashed commit of the following: commit 166931a28c8736ab58b7c4319c1139b5e4865a9e Author: geron-cn <c.ever.fallen@gmail.com> Date: Wed Mar 2 21:35:06 2016 +0800 fix commit e0eb069846a8ceb4b726c3c945801c944404b102 Author: geron-cn <c.ever.fallen@gmail.com> Date: Wed Mar 2 21:30:44 2016 +0800 fix active deactive in tabcontrol commit aeb1c857cab23299e44a86ac1f627c7bd5fa5a6d Author: geron-cn <c.ever.fallen@gmail.com> Date: Wed Mar 2 20:16:22 2016 +0800 fix active -1 commit e57796cbbae851e8cff52656b3265c80c2e8f6f7 Author: geron-cn <c.ever.fallen@gmail.com> Date: Wed Mar 2 16:00:51 2016 +0800 fix merge file commit cdd44f1c577ad190bc175896107a48fbb36b65bb Merge: 1658ad6 6bf55ed Author: geron-cn <c.ever.fallen@gmail.com> Date: Wed Mar 2 15:57:48 2016 +0800 Merge branch 'v3' of github.com:cocos2d/cocos2d-x into tabview # Conflicts: # cocos/ui/CMakeLists.txt commit 1658ad6f4a2bd0889d6cc020072d7fb9192cafc3 Author: geron-cn <c.ever.fallen@gmail.com> Date: Wed Mar 2 15:27:31 2016 +0800 configure for win8.1 commit ec236bff711b72952d48ec4d8b9137b4812b7a72 Author: geron-cn <c.ever.fallen@gmail.com> Date: Tue Mar 1 10:20:23 2016 +0800 configure for iOS mac twos android linux commit 9d6678a4388461a791abe968fa637df2fc6839d3 Author: geron-cn <c.ever.fallen@gmail.com> Date: Tue Mar 1 10:02:17 2016 +0800 add lack files commit 1f2b5a3e989b05f67a705c81a20c75d3e0ed88a1 Author: geron-cn <c.ever.fallen@gmail.com> Date: Mon Feb 29 22:05:22 2016 +0800 add test case for TabControl commit 97b8d8d87a37881b33ebe90478392150ef341b3e Author: geron-cn <c.ever.fallen@gmail.com> Date: Mon Feb 29 15:43:29 2016 +0800 add const to getter setter commit f49a0483049d2aa7e21bcbe10e553c207adc4bdf Author: geron-cn <c.ever.fallen@gmail.com> Date: Mon Feb 29 14:50:04 2016 +0800 format the comments commit a1989a8f89d33ef8d9eefff6c8117b45977308ad Author: geron-cn <c.ever.fallen@gmail.com> Date: Mon Feb 29 11:51:06 2016 +0800 remove reference commit 1a573e68d30cc56bed9b2338cbbd311e2541fdfd Author: geron-cn <c.ever.fallen@gmail.com> Date: Mon Feb 29 11:40:04 2016 +0800 configure for win8.1 commit c015ac54028534202f62ff85f9a9d4b62b12801e Author: geron-cn <c.ever.fallen@gmail.com> Date: Mon Feb 29 11:27:54 2016 +0800 fix error commit 91c4ac9ae73d4e7efcee389d7af5ec7178c94836 Author: geron-cn <c.ever.fallen@gmail.com> Date: Mon Feb 29 11:25:51 2016 +0800 add interface commit eaf3e237cdcb9c49cd4161691471a8761f8dbdae Author: geron-cn <c.ever.fallen@gmail.com> Date: Sun Feb 28 03:21:22 2016 +0800 fix compile error for tw-os commit 3bfaa2976751e844a591ae5524bfd81249927c7c Author: geron-cn <c.ever.fallen@gmail.com> Date: Sun Feb 28 03:04:23 2016 +0800 fix linux compile error commit fafe3ad660e644924fd02665b77e1df4076a4802 Author: geron-cn <c.ever.fallen@gmail.com> Date: Sun Feb 28 02:54:34 2016 +0800 re-indent code with X-Code commit f8dfe5b551b0bb0a1a1d7b15556db700a35651a5 Author: geron-cn <c.ever.fallen@gmail.com> Date: Sun Feb 28 02:37:51 2016 +0800 add reader configure for android commit 07033f7b6074edf8a333e40c2382a09a2b2325e4 Author: geron-cn <c.ever.fallen@gmail.com> Date: Sun Feb 28 02:22:00 2016 +0800 format code, remove some warning commit 22ed160628f1946d0ccbdf6fc066ec80e56ae611 Author: geron-cn <c.ever.fallen@gmail.com> Date: Sun Feb 28 02:02:27 2016 +0800 configure for mac project commit de21cea12c0a898ea95f9951022be85bdddeefaf Author: geron-cn <c.ever.fallen@gmail.com> Date: Sat Feb 27 18:28:10 2016 +0800 add comment for apis commit b9cebf881a5cd4ecbb740b98cff7dc61183b1db2 Author: geron-cn <c.ever.fallen@gmail.com> Date: Sat Feb 27 15:32:46 2016 +0800 fix parse objects in container commit 53bcce68b053a5b918a29735fed393c210d9cc2c Author: geron-cn <c.ever.fallen@gmail.com> Date: Fri Feb 26 22:10:54 2016 +0800 fix flatbuffer parse commit 9cbdbdc5d046751ae1398dd622ccab0e2797d055 Author: geron-cn <c.ever.fallen@gmail.com> Date: Fri Feb 26 18:26:07 2016 +0800 Init ui::TabControl commit 166931a28c8736ab58b7c4319c1139b5e4865a9e Author: geron-cn <c.ever.fallen@gmail.com> Date: Wed Mar 2 21:35:06 2016 +0800 fix commit e0eb069846a8ceb4b726c3c945801c944404b102 Author: geron-cn <c.ever.fallen@gmail.com> Date: Wed Mar 2 21:30:44 2016 +0800 fix active deactive in tabcontrol commit aeb1c857cab23299e44a86ac1f627c7bd5fa5a6d Author: geron-cn <c.ever.fallen@gmail.com> Date: Wed Mar 2 20:16:22 2016 +0800 fix active -1 commit e57796cbbae851e8cff52656b3265c80c2e8f6f7 Author: geron-cn <c.ever.fallen@gmail.com> Date: Wed Mar 2 16:00:51 2016 +0800 fix merge file commit cdd44f1c577ad190bc175896107a48fbb36b65bb Merge: 1658ad6 6bf55ed Author: geron-cn <c.ever.fallen@gmail.com> Date: Wed Mar 2 15:57:48 2016 +0800 Merge branch 'v3' of github.com:cocos2d/cocos2d-x into tabview # Conflicts: # cocos/ui/CMakeLists.txt commit 1658ad6f4a2bd0889d6cc020072d7fb9192cafc3 Author: geron-cn <c.ever.fallen@gmail.com> Date: Wed Mar 2 15:27:31 2016 +0800 configure for win8.1 commit ec236bff711b72952d48ec4d8b9137b4812b7a72 Author: geron-cn <c.ever.fallen@gmail.com> Date: Tue Mar 1 10:20:23 2016 +0800 configure for iOS mac twos android linux commit 9d6678a4388461a791abe968fa637df2fc6839d3 Author: geron-cn <c.ever.fallen@gmail.com> Date: Tue Mar 1 10:02:17 2016 +0800 add lack files commit 1f2b5a3e989b05f67a705c81a20c75d3e0ed88a1 Author: geron-cn <c.ever.fallen@gmail.com> Date: Mon Feb 29 22:05:22 2016 +0800 add test case for TabControl commit 97b8d8d87a37881b33ebe90478392150ef341b3e Author: geron-cn <c.ever.fallen@gmail.com> Date: Mon Feb 29 15:43:29 2016 +0800 add const to getter setter commit f49a0483049d2aa7e21bcbe10e553c207adc4bdf Author: geron-cn <c.ever.fallen@gmail.com> Date: Mon Feb 29 14:50:04 2016 +0800 format the comments commit a1989a8f89d33ef8d9eefff6c8117b45977308ad Author: geron-cn <c.ever.fallen@gmail.com> Date: Mon Feb 29 11:51:06 2016 +0800 remove reference commit 1a573e68d30cc56bed9b2338cbbd311e2541fdfd Author: geron-cn <c.ever.fallen@gmail.com> Date: Mon Feb 29 11:40:04 2016 +0800 configure for win8.1 commit c015ac54028534202f62ff85f9a9d4b62b12801e Author: geron-cn <c.ever.fallen@gmail.com> Date: Mon Feb 29 11:27:54 2016 +0800 fix error commit 91c4ac9ae73d4e7efcee389d7af5ec7178c94836 Author: geron-cn <c.ever.fallen@gmail.com> Date: Mon Feb 29 11:25:51 2016 +0800 add interface commit eaf3e237cdcb9c49cd4161691471a8761f8dbdae Author: geron-cn <c.ever.fallen@gmail.com> Date: Sun Feb 28 03:21:22 2016 +0800 fix compile error for tw-os commit 3bfaa2976751e844a591ae5524bfd81249927c7c Author: geron-cn <c.ever.fallen@gmail.com> Date: Sun Feb 28 03:04:23 2016 +0800 fix linux compile error commit fafe3ad660e644924fd02665b77e1df4076a4802 Author: geron-cn <c.ever.fallen@gmail.com> Date: Sun Feb 28 02:54:34 2016 +0800 re-indent code with X-Code commit f8dfe5b551b0bb0a1a1d7b15556db700a35651a5 Author: geron-cn <c.ever.fallen@gmail.com> Date: Sun Feb 28 02:37:51 2016 +0800 add reader configure for android commit 07033f7b6074edf8a333e40c2382a09a2b2325e4 Author: geron-cn <c.ever.fallen@gmail.com> Date: Sun Feb 28 02:22:00 2016 +0800 format code, remove some warning commit 22ed160628f1946d0ccbdf6fc066ec80e56ae611 Author: geron-cn <c.ever.fallen@gmail.com> Date: Sun Feb 28 02:02:27 2016 +0800 configure for mac project commit de21cea12c0a898ea95f9951022be85bdddeefaf Author: geron-cn <c.ever.fallen@gmail.com> Date: Sat Feb 27 18:28:10 2016 +0800 add comment for apis commit b9cebf881a5cd4ecbb740b98cff7dc61183b1db2 Author: geron-cn <c.ever.fallen@gmail.com> Date: Sat Feb 27 15:32:46 2016 +0800 fix parse objects in container commit 53bcce68b053a5b918a29735fed393c210d9cc2c Author: geron-cn <c.ever.fallen@gmail.com> Date: Fri Feb 26 22:10:54 2016 +0800 fix flatbuffer parse commit 9cbdbdc5d046751ae1398dd622ccab0e2797d055 Author: geron-cn <c.ever.fallen@gmail.com> Date: Fri Feb 26 18:26:07 2016 +0800 Init ui::TabControl
2016-03-03 14:17:48 +08:00
USING_NS_CC;
using namespace cocostudio;
using namespace flatbuffers;
using namespace cocos2d::ui;
IMPLEMENT_CLASS_NODE_READER_INFO(TabControlReader)
TabControlReader::TabControlReader()
{
}
TabControlReader* TabControlReader::_tabReaderInstance = nullptr;
TabControlReader* TabControlReader::getInstance()
{
if (_tabReaderInstance == nullptr)
{
_tabReaderInstance = new (std::nothrow) TabControlReader();
}
return _tabReaderInstance;
}
void TabControlReader::destroyInstance()
{
CC_SAFE_DELETE(_tabReaderInstance);
}
flatbuffers::Offset<flatbuffers::Table> TabControlReader::createOptionsWithFlatBuffers(
const tinyxml2::XMLElement* objectData, flatbuffers::FlatBufferBuilder* builder)
{
auto temp = WidgetReader::getInstance()->createOptionsWithFlatBuffers(objectData, builder);
auto nodeOptions = *(Offset<WidgetOptions>*)(&temp);
int headerPlace = 0;
int headerWidth = 50;
int headerHeight = 20;
float selectedTabZoom = 0.0f;
int selectedIndex = 0;
bool ignoretexturesize = true;
std::vector<Offset<TabItemOption>> tabItems;
const tinyxml2::XMLAttribute* attribute = objectData->FirstAttribute();
while (attribute)
{
std::string attriname = attribute->Name();
std::string value = attribute->Value();
if (attriname == "HeaderPlace")
{
auto placeStr = value.c_str();
if (strcmp(placeStr, "TOP") == 0)
headerPlace = 0;
else if (strcmp(placeStr, "LEFT") == 0)
headerPlace = 1;
else if (strcmp(placeStr, "BOTTOM") == 0)
headerPlace = 2;
else if (strcmp(placeStr, "RIGHT") == 0)
headerPlace = 3;
}
else if (attriname == "HeaderWidth")
{
headerWidth = atoi(value.c_str());
}
else if (attriname == "HeaderHeight")
{
headerHeight = atoi(value.c_str());
}
else if (attriname == "SelectedTabZoom")
{
selectedTabZoom = atof(value.c_str());
}
else if (attriname == "SelectedTabIndex")
{
selectedIndex = atoi(value.c_str());
}
else if (attriname == "IgnoreHeaderTextureSize")
{
ignoretexturesize = FLATSTR_TO_BOOL(value);
}
attribute = attribute->Next();
}
bool containChildrenElement = false;
const tinyxml2::XMLElement* child = objectData->FirstChildElement();
while (child)
{
if (strcmp("Children", child->Name()) == 0)
{
containChildrenElement = true;
break;
}
child = child->NextSiblingElement();
}
if (containChildrenElement)
{
child = child->FirstChildElement(); //first child
bool hasItem = true;
while (child && hasItem)
{
const tinyxml2::XMLAttribute* childattribute = child->FirstAttribute();
while (childattribute)
{
std::string attriname = childattribute->Name();
std::string value = childattribute->Value();
if (attriname == "ctype")
{
if (value.compare("TabItemObjectData") == 0)
{
auto itemOption = TabItemReader::getInstance()->createTabItemOptionWithFlatBuffers(child, builder);
tabItems.push_back(itemOption);
break;
}
else
hasItem = false;
break;
}
childattribute = childattribute->Next();
}
child = child->NextSiblingElement();
}
}
auto options = CreateTabControlOption(*builder,
nodeOptions,
headerPlace,
headerWidth,
headerHeight,
selectedTabZoom,
selectedIndex,
ignoretexturesize,
builder->CreateVector(tabItems));
return *(Offset<Table>*)(&options);
}
void TabControlReader::setPropsWithFlatBuffers(cocos2d::Node* node, const flatbuffers::Table* nodeOption)
{
auto tabControl = static_cast<cocos2d::ui::TabControl*>(node);
auto options = (flatbuffers::TabControlOption*)nodeOption;
int headerPlace = options->headerPlace();
tabControl->ignoreHeadersTextureSize((bool)options->ignoreHeaderTextureSize());
tabControl->setHeaderDockPlace((cocos2d::ui::TabControl::Dock)headerPlace);
tabControl->setHeaderWidth(options->headerWidth());
tabControl->setHeaderHeight(options->headerHeight());
tabControl->setHeaderSelectedZoom(options->selectedTabZoom());
int tabItemCount = options->tabItems()->size();
for (int i = 0; i < tabItemCount; i++)
{
auto item = options->tabItems()->Get(i);
auto header = TabHeaderReader::getInstance()->createNodeWithFlatBuffers((Table*)item->header());
auto container = CSLoader::getInstance()->nodeWithFlatBuffers(item->container());
tabControl->insertTab(i, (TabHeader*)header, (Layout*)container);
}
tabControl->setSelectTab(options->selectedTabIndex());
}
cocos2d::Node* TabControlReader::createNodeWithFlatBuffers(const flatbuffers::Table* nodeOptions)
{
auto node = cocos2d::ui::TabControl::create();
auto taboptions = (flatbuffers::TabControlOption*)nodeOptions;
setPropsWithFlatBuffers(node, nodeOptions);
auto nodereader = WidgetReader::getInstance();
nodereader->setPropsWithFlatBuffers(node, (Table*)taboptions->nodeOptions());
return node;
}
TabControlReader::~TabControlReader()
{
}
TabHeaderReader::TabHeaderReader()
{
}
TabHeaderReader::~TabHeaderReader()
{
}
TabHeaderReader* TabHeaderReader::_tabheaderReaderInstance = nullptr;
TabHeaderReader* TabHeaderReader::getInstance()
{
if (_tabheaderReaderInstance == nullptr)
{
_tabheaderReaderInstance = new (std::nothrow) TabHeaderReader();
}
return _tabheaderReaderInstance;
}
void TabHeaderReader::destroyInstance()
{
CC_SAFE_DELETE(_tabheaderReaderInstance);
}
flatbuffers::Offset<flatbuffers::Table> TabHeaderReader::createOptionsWithFlatBuffers(
const tinyxml2::XMLElement* objectData, flatbuffers::FlatBufferBuilder* builder)
{
auto temp = WidgetReader::getInstance()->createOptionsWithFlatBuffers(objectData, builder);
auto nodeOptions = *(Offset<WidgetOptions>*)(&temp);
int fontsize = 12;
std::string text = "";
cocos2d::Color4B textColor(255, 255, 255, 255);
std::string fontName;
int backgroundboxResourceType = 0;
std::string backgroundboxPath = "";
std::string backgroundboxPlistFile = "";
int backGroundBoxSelectedResourceType = 0;
std::string backGroundBoxSelectedPath = "";
std::string backGroundBoxSelectedPlistFile = "";
int frontCrossResourceType = 0;
std::string frontCrossPath = "";
std::string frontCrossPlistFile = "";
int backGroundBoxDisabledResourceType = 0;
std::string backGroundBoxDisabledPath = "";
std::string backGroundBoxDisabledPlistFile = "";
int frontCrossDisabledResourceType = 0;
std::string frontCrossDisabledPath = "";
std::string frontCrossDisabledPlistFile = "";
std::string fontResourcePath = "";
std::string fontResourcePlistFile = "";
int fontResourceResourceType = 0;
const tinyxml2::XMLAttribute* attribute = objectData->FirstAttribute();
while (attribute)
{
std::string attriname = attribute->Name();
std::string value = attribute->Value();
if (attriname.compare("FontSize") == 0)
{
fontsize = atoi(value.c_str());
}
else if (attriname.compare("TitleText") == 0)
{
text = value;
}
attribute = attribute->Next();
}
const tinyxml2::XMLElement* child = objectData->FirstChildElement();
while (child)
{
std::string name = child->Name();
if (name == "TextColor")
{
attribute = child->FirstAttribute();
while (attribute)
{
name = attribute->Name();
std::string value = attribute->Value();
if (name == "R")
{
textColor.r = atoi(value.c_str());
}
else if (name == "G")
{
textColor.g = atoi(value.c_str());
}
else if (name == "B")
{
textColor.b = atoi(value.c_str());
}
attribute = attribute->Next();
}
}
else if (name == "NormalBackFileData")
{
std::string texture = "";
std::string texturePng = "";
attribute = child->FirstAttribute();
while (attribute)
{
name = attribute->Name();
std::string value = attribute->Value();
if (name == "Path")
{
backgroundboxPath = value;
}
else if (name == "Type")
{
backgroundboxResourceType = getResourceType(value);
}
else if (name == "Plist")
{
backgroundboxPlistFile = value;
texture = value;
}
attribute = attribute->Next();
}
if (backgroundboxResourceType == 1)
{
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
fbs->_textures.push_back(builder->CreateString(texture));
}
}
else if (name == "PressedBackFileData")
{
std::string texture = "";
std::string texturePng = "";
attribute = child->FirstAttribute();
while (attribute)
{
name = attribute->Name();
std::string value = attribute->Value();
if (name == "Path")
{
backGroundBoxSelectedPath = value;
}
else if (name == "Type")
{
backGroundBoxSelectedResourceType = getResourceType(value);
}
else if (name == "Plist")
{
backGroundBoxSelectedPlistFile = value;
texture = value;
}
attribute = attribute->Next();
}
if (backGroundBoxSelectedResourceType == 1)
{
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
fbs->_textures.push_back(builder->CreateString(texture));
}
}
else if (name == "NodeNormalFileData")
{
std::string texture = "";
std::string texturePng = "";
attribute = child->FirstAttribute();
while (attribute)
{
name = attribute->Name();
std::string value = attribute->Value();
if (name == "Path")
{
frontCrossPath = value;
}
else if (name == "Type")
{
frontCrossResourceType = getResourceType(value);
}
else if (name == "Plist")
{
frontCrossPlistFile = value;
texture = value;
}
attribute = attribute->Next();
}
if (frontCrossResourceType == 1)
{
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
fbs->_textures.push_back(builder->CreateString(texture));
}
}
else if (name == "DisableBackFileData")
{
std::string texture = "";
std::string texturePng = "";
attribute = child->FirstAttribute();
while (attribute)
{
name = attribute->Name();
std::string value = attribute->Value();
if (name == "Path")
{
backGroundBoxDisabledPath = value;
}
else if (name == "Type")
{
backGroundBoxDisabledResourceType = getResourceType(value);
}
else if (name == "Plist")
{
backGroundBoxDisabledPlistFile = value;
texture = value;
}
attribute = attribute->Next();
}
if (backGroundBoxDisabledResourceType == 1)
{
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
fbs->_textures.push_back(builder->CreateString(texture));
}
}
else if (name == "NodeDisableFileData")
{
std::string texture = "";
std::string texturePng = "";
attribute = child->FirstAttribute();
while (attribute)
{
name = attribute->Name();
std::string value = attribute->Value();
if (name == "Path")
{
frontCrossDisabledPath = value;
}
else if (name == "Type")
{
frontCrossDisabledResourceType = getResourceType(value);
}
else if (name == "Plist")
{
frontCrossDisabledPlistFile = value;
texture = value;
}
attribute = attribute->Next();
}
if (frontCrossDisabledResourceType == 1)
{
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
fbs->_textures.push_back(builder->CreateString(texture));
}
}
else if (name == "FontResource")
{
attribute = child->FirstAttribute();
while (attribute)
{
name = attribute->Name();
std::string value = attribute->Value();
if (name == "Path")
{
fontResourcePath = value;
}
else if (name == "Type")
{
fontResourceResourceType = getResourceType(value);
}
else if (name == "Plist")
{
fontResourcePlistFile = value;
}
attribute = attribute->Next();
}
}
child = child->NextSiblingElement();
}
Color f_textColor(255, textColor.r, textColor.g, textColor.b);
auto option = CreateTabHeaderOption(*builder,
nodeOptions,
CreateResourceData(*builder,
builder->CreateString(fontResourcePath),
builder->CreateString(fontResourcePlistFile),
fontResourceResourceType),
fontsize,
builder->CreateString(text),
&f_textColor,
CreateResourceData(*builder,
builder->CreateString(backgroundboxPath),
builder->CreateString(backgroundboxPlistFile),
backgroundboxResourceType),
CreateResourceData(*builder,
builder->CreateString(backGroundBoxSelectedPath),
builder->CreateString(backGroundBoxSelectedPlistFile),
backGroundBoxSelectedResourceType),
CreateResourceData(*builder,
builder->CreateString(backGroundBoxDisabledPath),
builder->CreateString(backGroundBoxDisabledPlistFile),
backGroundBoxDisabledResourceType),
CreateResourceData(*builder,
builder->CreateString(frontCrossPath),
builder->CreateString(frontCrossPlistFile),
frontCrossResourceType),
CreateResourceData(*builder,
builder->CreateString(frontCrossDisabledPath),
builder->CreateString(frontCrossDisabledPlistFile),
frontCrossDisabledResourceType)
);
return *(Offset<Table>*)(&option);
}
void TabHeaderReader::setPropsWithFlatBuffers(cocos2d::Node* node, const flatbuffers::Table* nodeOption)
{
auto header = static_cast<cocos2d::ui::TabHeader*>(node);
auto options = (flatbuffers::TabHeaderOption*)nodeOption;
header->setTitleFontSize(options->fontSize());
header->setTitleText(options->titleText()->c_str());
auto textColor = options->textColor();
Color4B titleColor(textColor->r(), textColor->g(), textColor->b(), textColor->a());
header->setTitleColor(titleColor);
auto resourceData = options->fontRes();
bool fileExist = false;
std::string errorFilePath = "";
std::string path = resourceData->path()->c_str();
if (path != "")
{
if (FileUtils::getInstance()->isFileExist(path))
{
fileExist = true;
}
else
{
errorFilePath = path;
fileExist = false;
}
if (fileExist)
{
header->setTitleFontName(path);
}
}
bool backGroundFileExist = false;
std::string backGroundErrorFilePath = "";
auto backGroundDic = options->normalBackFile();
int backGroundType = backGroundDic->resourceType();
std::string backGroundTexturePath = backGroundDic->path()->c_str();
switch (backGroundType)
{
case 0:
{
if (FileUtils::getInstance()->isFileExist(backGroundTexturePath))
{
backGroundFileExist = true;
}
else
{
backGroundErrorFilePath = backGroundTexturePath;
backGroundFileExist = false;
}
break;
}
case 1:
{
std::string plist = backGroundDic->plistFile()->c_str();
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(backGroundTexturePath);
if (spriteFrame)
{
backGroundFileExist = true;
}
else
{
if (FileUtils::getInstance()->isFileExist(plist))
{
ValueMap value = FileUtils::getInstance()->getValueMapFromFile(plist);
ValueMap metadata = value["metadata"].asValueMap();
std::string textureFileName = metadata["textureFileName"].asString();
if (!FileUtils::getInstance()->isFileExist(textureFileName))
{
backGroundErrorFilePath = textureFileName;
}
}
else
{
backGroundErrorFilePath = plist;
}
backGroundFileExist = false;
}
break;
}
default:
break;
}
if (backGroundFileExist)
{
header->loadTextureBackGround(backGroundTexturePath, (Widget::TextureResType)backGroundType);
}
//load background selected image
bool backGroundSelectedfileExist = false;
std::string backGroundSelectedErrorFilePath = "";
auto backGroundSelectedDic = options->pressBackFile();
int backGroundSelectedType = backGroundSelectedDic->resourceType();
std::string backGroundSelectedTexturePath = backGroundSelectedDic->path()->c_str();
switch (backGroundSelectedType)
{
case 0:
{
if (FileUtils::getInstance()->isFileExist(backGroundSelectedTexturePath))
{
backGroundSelectedfileExist = true;
}
else
{
backGroundSelectedErrorFilePath = backGroundSelectedTexturePath;
backGroundSelectedfileExist = false;
}
break;
}
case 1:
{
std::string plist = backGroundSelectedDic->plistFile()->c_str();
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(backGroundSelectedTexturePath);
if (spriteFrame)
{
backGroundSelectedfileExist = true;
}
else
{
if (FileUtils::getInstance()->isFileExist(plist))
{
ValueMap value = FileUtils::getInstance()->getValueMapFromFile(plist);
ValueMap metadata = value["metadata"].asValueMap();
std::string textureFileName = metadata["textureFileName"].asString();
if (!FileUtils::getInstance()->isFileExist(textureFileName))
{
backGroundSelectedErrorFilePath = textureFileName;
}
}
else
{
backGroundSelectedErrorFilePath = plist;
}
backGroundSelectedfileExist = false;
}
break;
}
default:
break;
}
if (backGroundSelectedfileExist)
{
header->loadTextureBackGroundSelected(backGroundSelectedTexturePath, (cocos2d::ui::Widget::TextureResType)backGroundSelectedType);
}
//load frontCross image
bool frontCrossFileExist = false;
std::string frontCrossErrorFilePath = "";
auto frontCrossDic = options->crossNormalFile();
int frontCrossType = frontCrossDic->resourceType();
std::string frontCrossFileName = frontCrossDic->path()->c_str();
switch (frontCrossType)
{
case 0:
{
if (FileUtils::getInstance()->isFileExist(frontCrossFileName))
{
frontCrossFileExist = true;
}
else
{
frontCrossErrorFilePath = frontCrossFileName;
frontCrossFileExist = false;
}
break;
}
case 1:
{
std::string plist = frontCrossDic->plistFile()->c_str();
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(frontCrossFileName);
if (spriteFrame)
{
frontCrossFileExist = true;
}
else
{
if (FileUtils::getInstance()->isFileExist(plist))
{
ValueMap value = FileUtils::getInstance()->getValueMapFromFile(plist);
ValueMap metadata = value["metadata"].asValueMap();
std::string textureFileName = metadata["textureFileName"].asString();
if (!FileUtils::getInstance()->isFileExist(textureFileName))
{
frontCrossErrorFilePath = textureFileName;
}
}
else
{
frontCrossErrorFilePath = plist;
}
frontCrossFileExist = false;
}
break;
}
default:
break;
}
if (frontCrossFileExist)
{
header->loadTextureFrontCross(frontCrossFileName, (Widget::TextureResType)frontCrossType);
}
//load backGroundBoxDisabledData
bool backGroundBoxDisabledFileExist = false;
std::string backGroundBoxDisabledErrorFilePath = "";
auto backGroundDisabledDic = options->disableBackFile();
int backGroundDisabledType = backGroundDisabledDic->resourceType();
std::string backGroundDisabledFileName = backGroundDisabledDic->path()->c_str();
switch (backGroundDisabledType)
{
case 0:
{
if (FileUtils::getInstance()->isFileExist(backGroundDisabledFileName))
{
backGroundBoxDisabledFileExist = true;
}
else
{
backGroundBoxDisabledErrorFilePath = backGroundDisabledFileName;
backGroundBoxDisabledFileExist = false;
}
break;
}
case 1:
{
std::string plist = backGroundDisabledDic->plistFile()->c_str();
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(backGroundDisabledFileName);
if (spriteFrame)
{
backGroundBoxDisabledFileExist = true;
}
else
{
if (FileUtils::getInstance()->isFileExist(plist))
{
ValueMap value = FileUtils::getInstance()->getValueMapFromFile(plist);
ValueMap metadata = value["metadata"].asValueMap();
std::string textureFileName = metadata["textureFileName"].asString();
if (!FileUtils::getInstance()->isFileExist(textureFileName))
{
backGroundBoxDisabledErrorFilePath = textureFileName;
}
}
else
{
backGroundBoxDisabledErrorFilePath = plist;
}
backGroundBoxDisabledFileExist = false;
}
break;
}
default:
break;
}
if (backGroundBoxDisabledFileExist)
{
header->loadTextureBackGroundDisabled(backGroundDisabledFileName, (Widget::TextureResType)backGroundDisabledType);
}
///load frontCrossDisabledData
bool frontCrossDisabledFileExist = false;
std::string frontCrossDisabledErrorFilePath = "";
auto frontCrossDisabledDic = options->crossDisableFile();
int frontCrossDisabledType = frontCrossDisabledDic->resourceType();
std::string frontCrossDisabledFileName = frontCrossDisabledDic->path()->c_str();
switch (frontCrossDisabledType)
{
case 0:
{
if (FileUtils::getInstance()->isFileExist(frontCrossDisabledFileName))
{
frontCrossDisabledFileExist = true;
}
else
{
frontCrossDisabledErrorFilePath = frontCrossDisabledFileName;
frontCrossDisabledFileExist = false;
}
break;
}
case 1:
{
std::string plist = frontCrossDisabledDic->plistFile()->c_str();
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(frontCrossDisabledFileName);
if (spriteFrame)
{
frontCrossDisabledFileExist = true;
}
else
{
if (FileUtils::getInstance()->isFileExist(plist))
{
ValueMap value = FileUtils::getInstance()->getValueMapFromFile(plist);
ValueMap metadata = value["metadata"].asValueMap();
std::string textureFileName = metadata["textureFileName"].asString();
if (!FileUtils::getInstance()->isFileExist(textureFileName))
{
frontCrossDisabledErrorFilePath = textureFileName;
}
}
else
{
frontCrossDisabledErrorFilePath = plist;
}
frontCrossDisabledFileExist = false;
}
break;
}
default:
break;
}
if (frontCrossDisabledFileExist)
{
header->loadTextureFrontCrossDisabled(frontCrossDisabledFileName, (Widget::TextureResType)frontCrossDisabledType);
}
}
cocos2d::Node* TabHeaderReader::createNodeWithFlatBuffers(const flatbuffers::Table* nodeOptions)
{
auto node = cocos2d::ui::TabHeader::create();
auto taboptions = (flatbuffers::TabHeaderOption*)nodeOptions;
setPropsWithFlatBuffers(node, nodeOptions);
auto nodereader = WidgetReader::getInstance();
nodereader->setPropsWithFlatBuffers(node, (Table*)taboptions->nodeOptions());
return node;
}
int TabHeaderReader::getResourceType(std::string key)
{
if (key == "Normal" || key == "Default")
{
return 0;
}
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
if (fbs->_isSimulator)
{
if (key == "MarkedSubImage")
{
return 0;
}
}
return 1;
}
TabItemReader::TabItemReader()
{
}
TabItemReader::~TabItemReader()
{
}
TabItemReader* TabItemReader::_tabItemReaderInstance = nullptr;
TabItemReader* TabItemReader::getInstance()
{
if (_tabItemReaderInstance == nullptr)
{
_tabItemReaderInstance = new (std::nothrow) TabItemReader();
}
return _tabItemReaderInstance;
}
void TabItemReader::destroyInstance()
{
CC_SAFE_DELETE(_tabItemReaderInstance);
}
flatbuffers::Offset<flatbuffers::TabItemOption> TabItemReader::createTabItemOptionWithFlatBuffers(
const tinyxml2::XMLElement* objectData, flatbuffers::FlatBufferBuilder* builder)
{
flatbuffers::Offset<Table> header;
flatbuffers::Offset<NodeTree> container;
tinyxml2::XMLElement* containerData = nullptr;
tinyxml2::XMLElement* containerChildrenData = nullptr;
const tinyxml2::XMLElement* child = objectData->FirstChildElement();
while (child)
{
std::string attriName = child->Name();
if (attriName.compare("Children") == 0)
{
containerChildrenData = const_cast<tinyxml2::XMLElement*>(child);
}
if (attriName.compare("Header") == 0)
{
header = TabHeaderReader::getInstance()->createOptionsWithFlatBuffers(child, builder);
}
else if (attriName.compare("Container") == 0)
{
containerData = const_cast<tinyxml2::XMLElement*>(child);
}
child = child->NextSiblingElement();
}
if (containerChildrenData != nullptr)
{
containerData->InsertEndChild(containerChildrenData);
}
container = FlatBuffersSerialize::getInstance()->createNodeTree(containerData, "PanelObjectData");
auto options = CreateTabItemOption(*builder,
*(Offset<flatbuffers::TabHeaderOption>*)(&header),
container
);
return *(&options);
}
void TabItemReader::setPropsWithFlatBuffers(cocos2d::Node* node, const flatbuffers::Table* nodeOption)
{
// do nothing
}
cocos2d::Node* TabItemReader::createNodeWithFlatBuffers(const flatbuffers::Table* nodeOptions)
{
// do nothing
return nullptr;
}
flatbuffers::Offset<flatbuffers::Table> TabItemReader::createOptionsWithFlatBuffers(
const tinyxml2::XMLElement* objectData, flatbuffers::FlatBufferBuilder* builder)
{
// nothing
return flatbuffers::Offset<flatbuffers::Table>();
}