From d745fd59111de6983f5b1aa0b43f127c5dca00af Mon Sep 17 00:00:00 2001 From: minggo Date: Mon, 18 Jan 2021 18:37:18 +0800 Subject: [PATCH] Remove files (#3230) --- native/CMakeLists.txt | 17 +- native/cocos/base/Scheduler.cpp | 1 - native/cocos/base/utlist.h | 848 ------------------ native/cocos/bindings/auto/jsb_cocos_auto.cpp | 527 +++++------ native/cocos/bindings/auto/jsb_cocos_auto.h | 61 +- .../bindings/manual/jsb_cocos_manual.cpp | 1 - .../cocos/bindings/manual/jsb_conversions.h | 3 +- .../manual/jsb_dragonbones_manual.cpp | 16 +- native/cocos/bindings/manual/jsb_global.cpp | 5 +- .../bindings/manual/jsb_module_register.cpp | 6 +- .../bindings/manual/jsb_platform_android.cpp | 2 +- .../bindings/manual/jsb_spine_manual.cpp | 24 +- native/cocos/cocos2d.cpp | 37 - native/cocos/cocos2d.h | 87 -- .../dragonbones-creator-support/CCSlot.h | 1 - .../CCTextureAtlasData.h | 1 - native/cocos/platform/ios/Application-ios.mm | 1 + native/templates/ios/ViewController.mm | 1 + native/tools/tojs/cocos.ini | 2 +- 19 files changed, 329 insertions(+), 1312 deletions(-) delete mode 100644 native/cocos/base/utlist.h delete mode 100644 native/cocos/cocos2d.cpp delete mode 100644 native/cocos/cocos2d.h diff --git a/native/CMakeLists.txt b/native/CMakeLists.txt index f898a8b743..1d0a74d1bd 100644 --- a/native/CMakeLists.txt +++ b/native/CMakeLists.txt @@ -174,12 +174,6 @@ endif() include(${CMAKE_CURRENT_LIST_DIR}/external/CMakeLists.txt) - -cocos_source_files( - cocos/cocos2d.h - cocos/cocos2d.cpp -) - ##### audio if(USE_AUDIO) cocos_source_files( @@ -342,7 +336,6 @@ cocos_source_files( cocos/base/Object.h cocos/base/TypeDef.h cocos/base/uthash.h - cocos/base/utlist.h cocos/base/StringUtil.cpp cocos/base/StringUtil.h cocos/base/UTFString.cpp @@ -1635,8 +1628,8 @@ if(MSVC) target_compile_options(cocos2d PUBLIC /MP) endif() -if(COMMAND target_precompile_headers) - target_precompile_headers(cocos2d PUBLIC - $<$:${CWD}/cocos/cocos2d.h> - ) -endif() +#if(COMMAND target_precompile_headers) + #target_precompile_headers(cocos2d PUBLIC + #$<$:${CWD}/cocos/cocos2d.h> + #) +#endif() diff --git a/native/cocos/base/Scheduler.cpp b/native/cocos/base/Scheduler.cpp index 89bf0f8efa..07b80baad3 100644 --- a/native/cocos/base/Scheduler.cpp +++ b/native/cocos/base/Scheduler.cpp @@ -27,7 +27,6 @@ THE SOFTWARE. ****************************************************************************/ #include "base/Scheduler.h" #include "base/Macros.h" -#include "base/utlist.h" #include "base/Array.h" #define CC_REPEAT_FOREVER (UINT_MAX - 1) diff --git a/native/cocos/base/utlist.h b/native/cocos/base/utlist.h deleted file mode 100644 index 8e34eb5513..0000000000 --- a/native/cocos/base/utlist.h +++ /dev/null @@ -1,848 +0,0 @@ -/* -Copyright (c) 2007-2013, Troy D. Hanson http://troydhanson.github.com/uthash/ -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS -IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER -OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifndef UTLIST_H -#define UTLIST_H -/// @cond DO_NOT_SHOW - -#define UTLIST_VERSION 1.9.8 - -#include - -/* - * This file contains macros to manipulate singly and doubly-linked lists. - * - * 1. LL_ macros: singly-linked lists. - * 2. DL_ macros: doubly-linked lists. - * 3. CDL_ macros: circular doubly-linked lists. - * - * To use singly-linked lists, your structure must have a "next" pointer. - * To use doubly-linked lists, your structure must "prev" and "next" pointers. - * Either way, the pointer to the head of the list must be initialized to NULL. - * - * ----------------.EXAMPLE ------------------------- - * struct item { - * int id; - * struct item *prev, *next; - * } - * - * struct item *list = NULL: - * - * int main() { - * struct item *item; - * ... allocate and populate item ... - * DL_APPEND(list, item); - * } - * -------------------------------------------------- - * - * For doubly-linked lists, the append and delete macros are O(1) - * For singly-linked lists, append and delete are O(n) but prepend is O(1) - * The sort macro is O(n log(n)) for all types of single/double/circular lists. - */ - -/* These macros use decltype or the earlier __typeof GNU extension. - As decltype is only available in newer compilers (VS2010 or gcc 4.3+ - when compiling c++ code), this code uses whatever method is needed - or, for VS2008 where neither is available, uses casting workarounds. */ -#ifdef _MSC_VER /* MS compiler */ - #if _MSC_VER >= 1600 && defined(__cplusplus) /* VS2010 or newer in C++ mode */ - #define LDECLTYPE(x) decltype(x) - #else /* VS2008 or older (or VS2010 in C mode) */ - #define NO_DECLTYPE - #define LDECLTYPE(x) char * - #endif -#else /* GNU, Sun and other compilers */ - #define LDECLTYPE(x) __typeof(x) -#endif - -/* for VS2008 we use some workarounds to get around the lack of decltype, - * namely, we always reassign our tmp variable to the list head if we need - * to dereference its prev/next pointers, and save/restore the real head.*/ -#ifdef NO_DECLTYPE - #define _SV(elt, list) \ - _tmp = (char *)(list); \ - { \ - char **_alias = (char **)&(list); \ - *_alias = (elt); \ - } - #define _NEXT(elt, list, next) ((char *)((list)->next)) - #define _NEXTASGN(elt, list, to, next) \ - { \ - char **_alias = (char **)&((list)->next); \ - *_alias = (char *)(to); \ - } - /* #define _PREV(elt,list,prev) ((char*)((list)->prev)) */ - #define _PREVASGN(elt, list, to, prev) \ - { \ - char **_alias = (char **)&((list)->prev); \ - *_alias = (char *)(to); \ - } - #define _RS(list) \ - { \ - char **_alias = (char **)&(list); \ - *_alias = _tmp; \ - } - #define _CASTASGN(a, b) \ - { \ - char **_alias = (char **)&(a); \ - *_alias = (char *)(b); \ - } -#else - #define _SV(elt, list) - #define _NEXT(elt, list, next) ((elt)->next) - #define _NEXTASGN(elt, list, to, next) ((elt)->next) = (to) - /* #define _PREV(elt,list,prev) ((elt)->prev) */ - #define _PREVASGN(elt, list, to, prev) ((elt)->prev) = (to) - #define _RS(list) - #define _CASTASGN(a, b) (a) = (b) -#endif - -/****************************************************************************** - * The sort macro is an adaptation of Simon Tatham's O(n log(n)) mergesort * - * Unwieldy variable names used here to avoid shadowing passed-in variables. * - *****************************************************************************/ -#define LL_SORT(list, cmp) \ - LL_SORT2(list, cmp, next) - -#define LL_SORT2(list, cmp, next) \ - do { \ - LDECLTYPE(list) \ - _ls_p; \ - LDECLTYPE(list) \ - _ls_q; \ - LDECLTYPE(list) \ - _ls_e; \ - LDECLTYPE(list) \ - _ls_tail; \ - int _ls_insize, _ls_nmerges, _ls_psize, _ls_qsize, _ls_i, _ls_looping; \ - if (list) { \ - _ls_insize = 1; \ - _ls_looping = 1; \ - while (_ls_looping) { \ - _CASTASGN(_ls_p, list); \ - list = NULL; \ - _ls_tail = NULL; \ - _ls_nmerges = 0; \ - while (_ls_p) { \ - _ls_nmerges++; \ - _ls_q = _ls_p; \ - _ls_psize = 0; \ - for (_ls_i = 0; _ls_i < _ls_insize; _ls_i++) { \ - _ls_psize++; \ - _SV(_ls_q, list); \ - _ls_q = _NEXT(_ls_q, list, next); \ - _RS(list); \ - if (!_ls_q) break; \ - } \ - _ls_qsize = _ls_insize; \ - while (_ls_psize > 0 || (_ls_qsize > 0 && _ls_q)) { \ - if (_ls_psize == 0) { \ - _ls_e = _ls_q; \ - _SV(_ls_q, list); \ - _ls_q = \ - _NEXT(_ls_q, list, next); \ - _RS(list); \ - _ls_qsize--; \ - } else if (_ls_qsize == 0 || !_ls_q) { \ - _ls_e = _ls_p; \ - _SV(_ls_p, list); \ - _ls_p = \ - _NEXT(_ls_p, list, next); \ - _RS(list); \ - _ls_psize--; \ - } else if (cmp(_ls_p, _ls_q) <= 0) { \ - _ls_e = _ls_p; \ - _SV(_ls_p, list); \ - _ls_p = \ - _NEXT(_ls_p, list, next); \ - _RS(list); \ - _ls_psize--; \ - } else { \ - _ls_e = _ls_q; \ - _SV(_ls_q, list); \ - _ls_q = \ - _NEXT(_ls_q, list, next); \ - _RS(list); \ - _ls_qsize--; \ - } \ - if (_ls_tail) { \ - _SV(_ls_tail, list); \ - _NEXTASGN(_ls_tail, list, _ls_e, next); \ - _RS(list); \ - } else { \ - _CASTASGN(list, _ls_e); \ - } \ - _ls_tail = _ls_e; \ - } \ - _ls_p = _ls_q; \ - } \ - if (_ls_tail) { \ - _SV(_ls_tail, list); \ - _NEXTASGN(_ls_tail, list, NULL, next); \ - _RS(list); \ - } \ - if (_ls_nmerges <= 1) { \ - _ls_looping = 0; \ - } \ - _ls_insize *= 2; \ - } \ - } \ - } while (0) - -#define DL_SORT(list, cmp) \ - DL_SORT2(list, cmp, prev, next) - -#define DL_SORT2(list, cmp, prev, next) \ - do { \ - LDECLTYPE(list) \ - _ls_p; \ - LDECLTYPE(list) \ - _ls_q; \ - LDECLTYPE(list) \ - _ls_e; \ - LDECLTYPE(list) \ - _ls_tail; \ - int _ls_insize, _ls_nmerges, _ls_psize, _ls_qsize, _ls_i, _ls_looping; \ - if (list) { \ - _ls_insize = 1; \ - _ls_looping = 1; \ - while (_ls_looping) { \ - _CASTASGN(_ls_p, list); \ - list = NULL; \ - _ls_tail = NULL; \ - _ls_nmerges = 0; \ - while (_ls_p) { \ - _ls_nmerges++; \ - _ls_q = _ls_p; \ - _ls_psize = 0; \ - for (_ls_i = 0; _ls_i < _ls_insize; _ls_i++) { \ - _ls_psize++; \ - _SV(_ls_q, list); \ - _ls_q = _NEXT(_ls_q, list, next); \ - _RS(list); \ - if (!_ls_q) break; \ - } \ - _ls_qsize = _ls_insize; \ - while (_ls_psize > 0 || (_ls_qsize > 0 && _ls_q)) { \ - if (_ls_psize == 0) { \ - _ls_e = _ls_q; \ - _SV(_ls_q, list); \ - _ls_q = \ - _NEXT(_ls_q, list, next); \ - _RS(list); \ - _ls_qsize--; \ - } else if (_ls_qsize == 0 || !_ls_q) { \ - _ls_e = _ls_p; \ - _SV(_ls_p, list); \ - _ls_p = \ - _NEXT(_ls_p, list, next); \ - _RS(list); \ - _ls_psize--; \ - } else if (cmp(_ls_p, _ls_q) <= 0) { \ - _ls_e = _ls_p; \ - _SV(_ls_p, list); \ - _ls_p = \ - _NEXT(_ls_p, list, next); \ - _RS(list); \ - _ls_psize--; \ - } else { \ - _ls_e = _ls_q; \ - _SV(_ls_q, list); \ - _ls_q = \ - _NEXT(_ls_q, list, next); \ - _RS(list); \ - _ls_qsize--; \ - } \ - if (_ls_tail) { \ - _SV(_ls_tail, list); \ - _NEXTASGN(_ls_tail, list, _ls_e, next); \ - _RS(list); \ - } else { \ - _CASTASGN(list, _ls_e); \ - } \ - _SV(_ls_e, list); \ - _PREVASGN(_ls_e, list, _ls_tail, prev); \ - _RS(list); \ - _ls_tail = _ls_e; \ - } \ - _ls_p = _ls_q; \ - } \ - _CASTASGN(list->prev, _ls_tail); \ - _SV(_ls_tail, list); \ - _NEXTASGN(_ls_tail, list, NULL, next); \ - _RS(list); \ - if (_ls_nmerges <= 1) { \ - _ls_looping = 0; \ - } \ - _ls_insize *= 2; \ - } \ - } \ - } while (0) - -#define CDL_SORT(list, cmp) \ - CDL_SORT2(list, cmp, prev, next) - -#define CDL_SORT2(list, cmp, prev, next) \ - do { \ - LDECLTYPE(list) \ - _ls_p; \ - LDECLTYPE(list) \ - _ls_q; \ - LDECLTYPE(list) \ - _ls_e; \ - LDECLTYPE(list) \ - _ls_tail; \ - LDECLTYPE(list) \ - _ls_oldhead; \ - LDECLTYPE(list) \ - _tmp; \ - int _ls_insize, _ls_nmerges, _ls_psize, _ls_qsize, _ls_i, _ls_looping; \ - if (list) { \ - _ls_insize = 1; \ - _ls_looping = 1; \ - while (_ls_looping) { \ - _CASTASGN(_ls_p, list); \ - _CASTASGN(_ls_oldhead, list); \ - list = NULL; \ - _ls_tail = NULL; \ - _ls_nmerges = 0; \ - while (_ls_p) { \ - _ls_nmerges++; \ - _ls_q = _ls_p; \ - _ls_psize = 0; \ - for (_ls_i = 0; _ls_i < _ls_insize; _ls_i++) { \ - _ls_psize++; \ - _SV(_ls_q, list); \ - if (_NEXT(_ls_q, list, next) == _ls_oldhead) { \ - _ls_q = NULL; \ - } else { \ - _ls_q = _NEXT(_ls_q, list, next); \ - } \ - _RS(list); \ - if (!_ls_q) break; \ - } \ - _ls_qsize = _ls_insize; \ - while (_ls_psize > 0 || (_ls_qsize > 0 && _ls_q)) { \ - if (_ls_psize == 0) { \ - _ls_e = _ls_q; \ - _SV(_ls_q, list); \ - _ls_q = \ - _NEXT(_ls_q, list, next); \ - _RS(list); \ - _ls_qsize--; \ - if (_ls_q == _ls_oldhead) { \ - _ls_q = NULL; \ - } \ - } else if (_ls_qsize == 0 || !_ls_q) { \ - _ls_e = _ls_p; \ - _SV(_ls_p, list); \ - _ls_p = \ - _NEXT(_ls_p, list, next); \ - _RS(list); \ - _ls_psize--; \ - if (_ls_p == _ls_oldhead) { \ - _ls_p = NULL; \ - } \ - } else if (cmp(_ls_p, _ls_q) <= 0) { \ - _ls_e = _ls_p; \ - _SV(_ls_p, list); \ - _ls_p = \ - _NEXT(_ls_p, list, next); \ - _RS(list); \ - _ls_psize--; \ - if (_ls_p == _ls_oldhead) { \ - _ls_p = NULL; \ - } \ - } else { \ - _ls_e = _ls_q; \ - _SV(_ls_q, list); \ - _ls_q = \ - _NEXT(_ls_q, list, next); \ - _RS(list); \ - _ls_qsize--; \ - if (_ls_q == _ls_oldhead) { \ - _ls_q = NULL; \ - } \ - } \ - if (_ls_tail) { \ - _SV(_ls_tail, list); \ - _NEXTASGN(_ls_tail, list, _ls_e, next); \ - _RS(list); \ - } else { \ - _CASTASGN(list, _ls_e); \ - } \ - _SV(_ls_e, list); \ - _PREVASGN(_ls_e, list, _ls_tail, prev); \ - _RS(list); \ - _ls_tail = _ls_e; \ - } \ - _ls_p = _ls_q; \ - } \ - _CASTASGN(list->prev, _ls_tail); \ - _CASTASGN(_tmp, list); \ - _SV(_ls_tail, list); \ - _NEXTASGN(_ls_tail, list, _tmp, next); \ - _RS(list); \ - if (_ls_nmerges <= 1) { \ - _ls_looping = 0; \ - } \ - _ls_insize *= 2; \ - } \ - } \ - } while (0) - -/****************************************************************************** - * singly linked list macros (non-circular) * - *****************************************************************************/ -#define LL_PREPEND(head, add) \ - LL_PREPEND2(head, add, next) - -#define LL_PREPEND2(head, add, next) \ - do { \ - (add)->next = head; \ - head = add; \ - } while (0) - -#define LL_CONCAT(head1, head2) \ - LL_CONCAT2(head1, head2, next) - -#define LL_CONCAT2(head1, head2, next) \ - do { \ - LDECLTYPE(head1) \ - _tmp; \ - if (head1) { \ - _tmp = head1; \ - while (_tmp->next) { \ - _tmp = _tmp->next; \ - } \ - _tmp->next = (head2); \ - } else { \ - (head1) = (head2); \ - } \ - } while (0) - -#define LL_APPEND(head, add) \ - LL_APPEND2(head, add, next) - -#define LL_APPEND2(head, add, next) \ - do { \ - LDECLTYPE(head) \ - _tmp; \ - (add)->next = NULL; \ - if (head) { \ - _tmp = head; \ - while (_tmp->next) { \ - _tmp = _tmp->next; \ - } \ - _tmp->next = (add); \ - } else { \ - (head) = (add); \ - } \ - } while (0) - -#define LL_DELETE(head, del) \ - LL_DELETE2(head, del, next) - -#define LL_DELETE2(head, del, next) \ - do { \ - LDECLTYPE(head) \ - _tmp; \ - if ((head) == (del)) { \ - (head) = (head)->next; \ - } else { \ - _tmp = head; \ - while (_tmp->next && (_tmp->next != (del))) { \ - _tmp = _tmp->next; \ - } \ - if (_tmp->next) { \ - _tmp->next = ((del)->next); \ - } \ - } \ - } while (0) - -/* Here are VS2008 replacements for LL_APPEND and LL_DELETE */ -#define LL_APPEND_VS2008(head, add) \ - LL_APPEND2_VS2008(head, add, next) - -#define LL_APPEND2_VS2008(head, add, next) \ - do { \ - if (head) { \ - (add)->next = head; /* use add->next as a temp variable */ \ - while ((add)->next->next) { \ - (add)->next = (add)->next->next; \ - } \ - (add)->next->next = (add); \ - } else { \ - (head) = (add); \ - } \ - (add)->next = NULL; \ - } while (0) - -#define LL_DELETE_VS2008(head, del) \ - LL_DELETE2_VS2008(head, del, next) - -#define LL_DELETE2_VS2008(head, del, next) \ - do { \ - if ((head) == (del)) { \ - (head) = (head)->next; \ - } else { \ - char *_tmp = (char *)(head); \ - while ((head)->next && ((head)->next != (del))) { \ - head = (head)->next; \ - } \ - if ((head)->next) { \ - (head)->next = ((del)->next); \ - } \ - { \ - char **_head_alias = (char **)&(head); \ - *_head_alias = _tmp; \ - } \ - } \ - } while (0) -#ifdef NO_DECLTYPE - #undef LL_APPEND - #define LL_APPEND LL_APPEND_VS2008 - #undef LL_DELETE - #define LL_DELETE LL_DELETE_VS2008 - #undef LL_DELETE2 - #define LL_DELETE2_VS2008 - #undef LL_APPEND2 - #define LL_APPEND2 LL_APPEND2_VS2008 - #undef LL_CONCAT /* no LL_CONCAT_VS2008 */ - #undef DL_CONCAT /* no DL_CONCAT_VS2008 */ -#endif -/* end VS2008 replacements */ - -#define LL_FOREACH(head, el) \ - LL_FOREACH2(head, el, next) - -#define LL_FOREACH2(head, el, next) \ - for (el = head; el; el = (el)->next) - -#define LL_FOREACH_SAFE(head, el, tmp) \ - LL_FOREACH_SAFE2(head, el, tmp, next) - -#define LL_FOREACH_SAFE2(head, el, tmp, next) \ - for ((el) = (head); (el) && (tmp = (el)->next, 1); (el) = tmp) - -#define LL_SEARCH_SCALAR(head, out, field, val) \ - LL_SEARCH_SCALAR2(head, out, field, val, next) - -#define LL_SEARCH_SCALAR2(head, out, field, val, next) \ - do { \ - LL_FOREACH2(head, out, next) { \ - if ((out)->field == (val)) break; \ - } \ - } while (0) - -#define LL_SEARCH(head, out, elt, cmp) \ - LL_SEARCH2(head, out, elt, cmp, next) - -#define LL_SEARCH2(head, out, elt, cmp, next) \ - do { \ - LL_FOREACH2(head, out, next) { \ - if ((cmp(out, elt)) == 0) break; \ - } \ - } while (0) - -#define LL_REPLACE_ELEM(head, el, add) \ - do { \ - LDECLTYPE(head) \ - _tmp; \ - assert(head != NULL); \ - assert(el != NULL); \ - assert(add != NULL); \ - (add)->next = (el)->next; \ - if ((head) == (el)) { \ - (head) = (add); \ - } else { \ - _tmp = head; \ - while (_tmp->next && (_tmp->next != (el))) { \ - _tmp = _tmp->next; \ - } \ - if (_tmp->next) { \ - _tmp->next = (add); \ - } \ - } \ - } while (0) - -#define LL_PREPEND_ELEM(head, el, add) \ - do { \ - LDECLTYPE(head) \ - _tmp; \ - assert(head != NULL); \ - assert(el != NULL); \ - assert(add != NULL); \ - (add)->next = (el); \ - if ((head) == (el)) { \ - (head) = (add); \ - } else { \ - _tmp = head; \ - while (_tmp->next && (_tmp->next != (el))) { \ - _tmp = _tmp->next; \ - } \ - if (_tmp->next) { \ - _tmp->next = (add); \ - } \ - } \ - } while (0) - -/****************************************************************************** - * doubly linked list macros (non-circular) * - *****************************************************************************/ -#define DL_PREPEND(head, add) \ - DL_PREPEND2(head, add, prev, next) - -#define DL_PREPEND2(head, add, prev, next) \ - do { \ - (add)->next = head; \ - if (head) { \ - (add)->prev = (head)->prev; \ - (head)->prev = (add); \ - } else { \ - (add)->prev = (add); \ - } \ - (head) = (add); \ - } while (0) - -#define DL_APPEND(head, add) \ - DL_APPEND2(head, add, prev, next) - -#define DL_APPEND2(head, add, prev, next) \ - do { \ - if (head) { \ - (add)->prev = (head)->prev; \ - (head)->prev->next = (add); \ - (head)->prev = (add); \ - (add)->next = NULL; \ - } else { \ - (head) = (add); \ - (head)->prev = (head); \ - (head)->next = NULL; \ - } \ - } while (0) - -#define DL_CONCAT(head1, head2) \ - DL_CONCAT2(head1, head2, prev, next) - -#define DL_CONCAT2(head1, head2, prev, next) \ - do { \ - LDECLTYPE(head1) \ - _tmp; \ - if (head2) { \ - if (head1) { \ - _tmp = (head2)->prev; \ - (head2)->prev = (head1)->prev; \ - (head1)->prev->next = (head2); \ - (head1)->prev = _tmp; \ - } else { \ - (head1) = (head2); \ - } \ - } \ - } while (0) - -#define DL_DELETE(head, del) \ - DL_DELETE2(head, del, prev, next) - -#define DL_DELETE2(head, del, prev, next) \ - do { \ - assert((del)->prev != NULL); \ - if ((del)->prev == (del)) { \ - (head) = NULL; \ - } else if ((del) == (head)) { \ - (del)->next->prev = (del)->prev; \ - (head) = (del)->next; \ - } else { \ - (del)->prev->next = (del)->next; \ - if ((del)->next) { \ - (del)->next->prev = (del)->prev; \ - } else { \ - (head)->prev = (del)->prev; \ - } \ - } \ - } while (0) - -#define DL_FOREACH(head, el) \ - DL_FOREACH2(head, el, next) - -#define DL_FOREACH2(head, el, next) \ - for (el = head; el; el = (el)->next) - -/* this version is safe for deleting the elements during iteration */ -#define DL_FOREACH_SAFE(head, el, tmp) \ - DL_FOREACH_SAFE2(head, el, tmp, next) - -#define DL_FOREACH_SAFE2(head, el, tmp, next) \ - for ((el) = (head); (el) && (tmp = (el)->next, 1); (el) = tmp) - -/* these are identical to their singly-linked list counterparts */ -#define DL_SEARCH_SCALAR LL_SEARCH_SCALAR -#define DL_SEARCH LL_SEARCH -#define DL_SEARCH_SCALAR2 LL_SEARCH_SCALAR2 -#define DL_SEARCH2 LL_SEARCH2 - -#define DL_REPLACE_ELEM(head, el, add) \ - do { \ - assert(head != NULL); \ - assert(el != NULL); \ - assert(add != NULL); \ - if ((head) == (el)) { \ - (head) = (add); \ - (add)->next = (el)->next; \ - if ((el)->next == NULL) { \ - (add)->prev = (add); \ - } else { \ - (add)->prev = (el)->prev; \ - (add)->next->prev = (add); \ - } \ - } else { \ - (add)->next = (el)->next; \ - (add)->prev = (el)->prev; \ - (add)->prev->next = (add); \ - if ((el)->next == NULL) { \ - (head)->prev = (add); \ - } else { \ - (add)->next->prev = (add); \ - } \ - } \ - } while (0) - -#define DL_PREPEND_ELEM(head, el, add) \ - do { \ - assert(head != NULL); \ - assert(el != NULL); \ - assert(add != NULL); \ - (add)->next = (el); \ - (add)->prev = (el)->prev; \ - (el)->prev = (add); \ - if ((head) == (el)) { \ - (head) = (add); \ - } else { \ - (add)->prev->next = (add); \ - } \ - } while (0) - -/****************************************************************************** - * circular doubly linked list macros * - *****************************************************************************/ -#define CDL_PREPEND(head, add) \ - CDL_PREPEND2(head, add, prev, next) - -#define CDL_PREPEND2(head, add, prev, next) \ - do { \ - if (head) { \ - (add)->prev = (head)->prev; \ - (add)->next = (head); \ - (head)->prev = (add); \ - (add)->prev->next = (add); \ - } else { \ - (add)->prev = (add); \ - (add)->next = (add); \ - } \ - (head) = (add); \ - } while (0) - -#define CDL_DELETE(head, del) \ - CDL_DELETE2(head, del, prev, next) - -#define CDL_DELETE2(head, del, prev, next) \ - do { \ - if (((head) == (del)) && ((head)->next == (head))) { \ - (head) = 0L; \ - } else { \ - (del)->next->prev = (del)->prev; \ - (del)->prev->next = (del)->next; \ - if ((del) == (head)) (head) = (del)->next; \ - } \ - } while (0) - -#define CDL_FOREACH(head, el) \ - CDL_FOREACH2(head, el, next) - -#define CDL_FOREACH2(head, el, next) \ - for (el = head; el; el = ((el)->next == head ? 0L : (el)->next)) - -#define CDL_FOREACH_SAFE(head, el, tmp1, tmp2) \ - CDL_FOREACH_SAFE2(head, el, tmp1, tmp2, prev, next) - -#define CDL_FOREACH_SAFE2(head, el, tmp1, tmp2, prev, next) \ - for ((el) = (head), ((tmp1) = (head) ? ((head)->prev) : NULL); \ - (el) && ((tmp2) = (el)->next, 1); \ - ((el) = (((el) == (tmp1)) ? 0L : (tmp2)))) - -#define CDL_SEARCH_SCALAR(head, out, field, val) \ - CDL_SEARCH_SCALAR2(head, out, field, val, next) - -#define CDL_SEARCH_SCALAR2(head, out, field, val, next) \ - do { \ - CDL_FOREACH2(head, out, next) { \ - if ((out)->field == (val)) break; \ - } \ - } while (0) - -#define CDL_SEARCH(head, out, elt, cmp) \ - CDL_SEARCH2(head, out, elt, cmp, next) - -#define CDL_SEARCH2(head, out, elt, cmp, next) \ - do { \ - CDL_FOREACH2(head, out, next) { \ - if ((cmp(out, elt)) == 0) break; \ - } \ - } while (0) - -#define CDL_REPLACE_ELEM(head, el, add) \ - do { \ - assert(head != NULL); \ - assert(el != NULL); \ - assert(add != NULL); \ - if ((el)->next == (el)) { \ - (add)->next = (add); \ - (add)->prev = (add); \ - (head) = (add); \ - } else { \ - (add)->next = (el)->next; \ - (add)->prev = (el)->prev; \ - (add)->next->prev = (add); \ - (add)->prev->next = (add); \ - if ((head) == (el)) { \ - (head) = (add); \ - } \ - } \ - } while (0) - -#define CDL_PREPEND_ELEM(head, el, add) \ - do { \ - assert(head != NULL); \ - assert(el != NULL); \ - assert(add != NULL); \ - (add)->next = (el); \ - (add)->prev = (el)->prev; \ - (el)->prev = (add); \ - (add)->prev->next = (add); \ - if ((head) == (el)) { \ - (head) = (add); \ - } \ - } while (0) - -/// @endcond -#endif /* UTLIST_H */ diff --git a/native/cocos/bindings/auto/jsb_cocos_auto.cpp b/native/cocos/bindings/auto/jsb_cocos_auto.cpp index 1839fa779e..c1115b45ee 100644 --- a/native/cocos/bindings/auto/jsb_cocos_auto.cpp +++ b/native/cocos/bindings/auto/jsb_cocos_auto.cpp @@ -1,7 +1,10 @@ #include "cocos/bindings/auto/jsb_cocos_auto.h" #include "cocos/bindings/manual/jsb_conversions.h" #include "cocos/bindings/manual/jsb_global.h" -#include "cocos2d.h" +#include "platform/FileUtils.h" +#include "platform/CanvasRenderingContext2D.h" +#include "platform/Device.h" +#include "platform/SAXParser.h" #ifndef JSB_ALLOC #define JSB_ALLOC(kls, ...) new (std::nothrow) kls(__VA_ARGS__) @@ -880,267 +883,6 @@ bool js_register_engine_FileUtils(se::Object* obj) return true; } -se::Object* __jsb_cc_Device_proto = nullptr; -se::Class* __jsb_cc_Device_class = nullptr; - -static bool js_engine_Device_getDevicePixelRatio(se::State& s) -{ - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - float result = cc::Device::getDevicePixelRatio(); - ok &= nativevalue_to_se(result, s.rval(), nullptr /*ctx*/); - SE_PRECONDITION2(ok, false, "js_engine_Device_getDevicePixelRatio : Error processing arguments"); - SE_HOLD_RETURN_VALUE(result, s.thisObject(), s.rval()); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_engine_Device_getDevicePixelRatio) - -static bool js_engine_Device_setAccelerometerEnabled(se::State& s) -{ - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - HolderType arg0 = {}; - ok &= sevalue_to_native(args[0], &arg0, nullptr); - SE_PRECONDITION2(ok, false, "js_engine_Device_setAccelerometerEnabled : Error processing arguments"); - cc::Device::setAccelerometerEnabled(arg0.value()); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_engine_Device_setAccelerometerEnabled) - -static bool js_engine_Device_setAccelerometerInterval(se::State& s) -{ - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - HolderType arg0 = {}; - ok &= sevalue_to_native(args[0], &arg0, nullptr); - SE_PRECONDITION2(ok, false, "js_engine_Device_setAccelerometerInterval : Error processing arguments"); - cc::Device::setAccelerometerInterval(arg0.value()); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_engine_Device_setAccelerometerInterval) - -static bool js_engine_Device_vibrate(se::State& s) -{ - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - HolderType arg0 = {}; - ok &= sevalue_to_native(args[0], &arg0, nullptr); - SE_PRECONDITION2(ok, false, "js_engine_Device_vibrate : Error processing arguments"); - cc::Device::vibrate(arg0.value()); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_engine_Device_vibrate) - -static bool js_engine_Device_setKeepScreenOn(se::State& s) -{ - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - HolderType arg0 = {}; - ok &= sevalue_to_native(args[0], &arg0, nullptr); - SE_PRECONDITION2(ok, false, "js_engine_Device_setKeepScreenOn : Error processing arguments"); - cc::Device::setKeepScreenOn(arg0.value()); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_engine_Device_setKeepScreenOn) - -static bool js_engine_Device_getNetworkType(se::State& s) -{ - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - int result = (int)cc::Device::getNetworkType(); - ok &= nativevalue_to_se(result, s.rval(), nullptr /*ctx*/); - SE_PRECONDITION2(ok, false, "js_engine_Device_getNetworkType : Error processing arguments"); - SE_HOLD_RETURN_VALUE(result, s.thisObject(), s.rval()); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_engine_Device_getNetworkType) - -static bool js_engine_Device_getBatteryLevel(se::State& s) -{ - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - float result = cc::Device::getBatteryLevel(); - ok &= nativevalue_to_se(result, s.rval(), nullptr /*ctx*/); - SE_PRECONDITION2(ok, false, "js_engine_Device_getBatteryLevel : Error processing arguments"); - SE_HOLD_RETURN_VALUE(result, s.thisObject(), s.rval()); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_engine_Device_getBatteryLevel) - -static bool js_engine_Device_getDeviceOrientation(se::State& s) -{ - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - int result = (int)cc::Device::getDeviceOrientation(); - ok &= nativevalue_to_se(result, s.rval(), nullptr /*ctx*/); - SE_PRECONDITION2(ok, false, "js_engine_Device_getDeviceOrientation : Error processing arguments"); - SE_HOLD_RETURN_VALUE(result, s.thisObject(), s.rval()); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_engine_Device_getDeviceOrientation) - -static bool js_engine_Device_getDPI(se::State& s) -{ - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - int result = cc::Device::getDPI(); - ok &= nativevalue_to_se(result, s.rval(), nullptr /*ctx*/); - SE_PRECONDITION2(ok, false, "js_engine_Device_getDPI : Error processing arguments"); - SE_HOLD_RETURN_VALUE(result, s.thisObject(), s.rval()); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_engine_Device_getDPI) - -static bool js_engine_Device_getSafeAreaEdge(se::State& s) -{ - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - cc::Vec4 result = cc::Device::getSafeAreaEdge(); - ok &= nativevalue_to_se(result, s.rval(), nullptr /*ctx*/); - SE_PRECONDITION2(ok, false, "js_engine_Device_getSafeAreaEdge : Error processing arguments"); - SE_HOLD_RETURN_VALUE(result, s.thisObject(), s.rval()); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_engine_Device_getSafeAreaEdge) - -static bool js_engine_Device_getDeviceModel(se::State& s) -{ - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - std::string result = cc::Device::getDeviceModel(); - ok &= nativevalue_to_se(result, s.rval(), nullptr /*ctx*/); - SE_PRECONDITION2(ok, false, "js_engine_Device_getDeviceModel : Error processing arguments"); - SE_HOLD_RETURN_VALUE(result, s.thisObject(), s.rval()); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_engine_Device_getDeviceModel) - - - - -bool js_register_engine_Device(se::Object* obj) -{ - auto cls = se::Class::create("Device", obj, nullptr, nullptr); - - cls->defineStaticFunction("getDevicePixelRatio", _SE(js_engine_Device_getDevicePixelRatio)); - cls->defineStaticFunction("setAccelerometerEnabled", _SE(js_engine_Device_setAccelerometerEnabled)); - cls->defineStaticFunction("setAccelerometerInterval", _SE(js_engine_Device_setAccelerometerInterval)); - cls->defineStaticFunction("vibrate", _SE(js_engine_Device_vibrate)); - cls->defineStaticFunction("setKeepScreenOn", _SE(js_engine_Device_setKeepScreenOn)); - cls->defineStaticFunction("getNetworkType", _SE(js_engine_Device_getNetworkType)); - cls->defineStaticFunction("getBatteryLevel", _SE(js_engine_Device_getBatteryLevel)); - cls->defineStaticFunction("getDeviceOrientation", _SE(js_engine_Device_getDeviceOrientation)); - cls->defineStaticFunction("getDPI", _SE(js_engine_Device_getDPI)); - cls->defineStaticFunction("getSafeAreaEdge", _SE(js_engine_Device_getSafeAreaEdge)); - cls->defineStaticFunction("getDeviceModel", _SE(js_engine_Device_getDeviceModel)); - cls->install(); - JSBClassType::registerClass(cls); - - __jsb_cc_Device_proto = cls->getProto(); - __jsb_cc_Device_class = cls; - - se::ScriptEngine::getInstance()->clearException(); - return true; -} - -se::Object* __jsb_cc_SAXParser_proto = nullptr; -se::Class* __jsb_cc_SAXParser_class = nullptr; - -static bool js_engine_SAXParser_init(se::State& s) -{ - cc::SAXParser* cobj = SE_THIS_OBJECT(s); - SE_PRECONDITION2(cobj, false, "js_engine_SAXParser_init : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - HolderType arg0 = {}; - ok &= sevalue_to_native(args[0], &arg0, s.thisObject()); - SE_PRECONDITION2(ok, false, "js_engine_SAXParser_init : Error processing arguments"); - bool result = cobj->init(arg0.value()); - ok &= nativevalue_to_se(result, s.rval(), nullptr /*ctx*/); - SE_PRECONDITION2(ok, false, "js_engine_SAXParser_init : Error processing arguments"); - SE_HOLD_RETURN_VALUE(result, s.thisObject(), s.rval()); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_engine_SAXParser_init) - - - - -bool js_register_engine_SAXParser(se::Object* obj) -{ - auto cls = se::Class::create("PlistParser", obj, nullptr, nullptr); - - cls->defineFunction("init", _SE(js_engine_SAXParser_init)); - cls->install(); - JSBClassType::registerClass(cls); - - __jsb_cc_SAXParser_proto = cls->getProto(); - __jsb_cc_SAXParser_class = cls; - - se::ScriptEngine::getInstance()->clearException(); - return true; -} - se::Object* __jsb_cc_CanvasGradient_proto = nullptr; se::Class* __jsb_cc_CanvasGradient_class = nullptr; @@ -1633,6 +1375,267 @@ bool js_register_engine_CanvasRenderingContext2D(se::Object* obj) return true; } +se::Object* __jsb_cc_Device_proto = nullptr; +se::Class* __jsb_cc_Device_class = nullptr; + +static bool js_engine_Device_getDevicePixelRatio(se::State& s) +{ + const auto& args = s.args(); + size_t argc = args.size(); + CC_UNUSED bool ok = true; + if (argc == 0) { + float result = cc::Device::getDevicePixelRatio(); + ok &= nativevalue_to_se(result, s.rval(), nullptr /*ctx*/); + SE_PRECONDITION2(ok, false, "js_engine_Device_getDevicePixelRatio : Error processing arguments"); + SE_HOLD_RETURN_VALUE(result, s.thisObject(), s.rval()); + return true; + } + SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); + return false; +} +SE_BIND_FUNC(js_engine_Device_getDevicePixelRatio) + +static bool js_engine_Device_setAccelerometerEnabled(se::State& s) +{ + const auto& args = s.args(); + size_t argc = args.size(); + CC_UNUSED bool ok = true; + if (argc == 1) { + HolderType arg0 = {}; + ok &= sevalue_to_native(args[0], &arg0, nullptr); + SE_PRECONDITION2(ok, false, "js_engine_Device_setAccelerometerEnabled : Error processing arguments"); + cc::Device::setAccelerometerEnabled(arg0.value()); + return true; + } + SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); + return false; +} +SE_BIND_FUNC(js_engine_Device_setAccelerometerEnabled) + +static bool js_engine_Device_setAccelerometerInterval(se::State& s) +{ + const auto& args = s.args(); + size_t argc = args.size(); + CC_UNUSED bool ok = true; + if (argc == 1) { + HolderType arg0 = {}; + ok &= sevalue_to_native(args[0], &arg0, nullptr); + SE_PRECONDITION2(ok, false, "js_engine_Device_setAccelerometerInterval : Error processing arguments"); + cc::Device::setAccelerometerInterval(arg0.value()); + return true; + } + SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); + return false; +} +SE_BIND_FUNC(js_engine_Device_setAccelerometerInterval) + +static bool js_engine_Device_vibrate(se::State& s) +{ + const auto& args = s.args(); + size_t argc = args.size(); + CC_UNUSED bool ok = true; + if (argc == 1) { + HolderType arg0 = {}; + ok &= sevalue_to_native(args[0], &arg0, nullptr); + SE_PRECONDITION2(ok, false, "js_engine_Device_vibrate : Error processing arguments"); + cc::Device::vibrate(arg0.value()); + return true; + } + SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); + return false; +} +SE_BIND_FUNC(js_engine_Device_vibrate) + +static bool js_engine_Device_setKeepScreenOn(se::State& s) +{ + const auto& args = s.args(); + size_t argc = args.size(); + CC_UNUSED bool ok = true; + if (argc == 1) { + HolderType arg0 = {}; + ok &= sevalue_to_native(args[0], &arg0, nullptr); + SE_PRECONDITION2(ok, false, "js_engine_Device_setKeepScreenOn : Error processing arguments"); + cc::Device::setKeepScreenOn(arg0.value()); + return true; + } + SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); + return false; +} +SE_BIND_FUNC(js_engine_Device_setKeepScreenOn) + +static bool js_engine_Device_getNetworkType(se::State& s) +{ + const auto& args = s.args(); + size_t argc = args.size(); + CC_UNUSED bool ok = true; + if (argc == 0) { + int result = (int)cc::Device::getNetworkType(); + ok &= nativevalue_to_se(result, s.rval(), nullptr /*ctx*/); + SE_PRECONDITION2(ok, false, "js_engine_Device_getNetworkType : Error processing arguments"); + SE_HOLD_RETURN_VALUE(result, s.thisObject(), s.rval()); + return true; + } + SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); + return false; +} +SE_BIND_FUNC(js_engine_Device_getNetworkType) + +static bool js_engine_Device_getBatteryLevel(se::State& s) +{ + const auto& args = s.args(); + size_t argc = args.size(); + CC_UNUSED bool ok = true; + if (argc == 0) { + float result = cc::Device::getBatteryLevel(); + ok &= nativevalue_to_se(result, s.rval(), nullptr /*ctx*/); + SE_PRECONDITION2(ok, false, "js_engine_Device_getBatteryLevel : Error processing arguments"); + SE_HOLD_RETURN_VALUE(result, s.thisObject(), s.rval()); + return true; + } + SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); + return false; +} +SE_BIND_FUNC(js_engine_Device_getBatteryLevel) + +static bool js_engine_Device_getDeviceOrientation(se::State& s) +{ + const auto& args = s.args(); + size_t argc = args.size(); + CC_UNUSED bool ok = true; + if (argc == 0) { + int result = (int)cc::Device::getDeviceOrientation(); + ok &= nativevalue_to_se(result, s.rval(), nullptr /*ctx*/); + SE_PRECONDITION2(ok, false, "js_engine_Device_getDeviceOrientation : Error processing arguments"); + SE_HOLD_RETURN_VALUE(result, s.thisObject(), s.rval()); + return true; + } + SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); + return false; +} +SE_BIND_FUNC(js_engine_Device_getDeviceOrientation) + +static bool js_engine_Device_getDPI(se::State& s) +{ + const auto& args = s.args(); + size_t argc = args.size(); + CC_UNUSED bool ok = true; + if (argc == 0) { + int result = cc::Device::getDPI(); + ok &= nativevalue_to_se(result, s.rval(), nullptr /*ctx*/); + SE_PRECONDITION2(ok, false, "js_engine_Device_getDPI : Error processing arguments"); + SE_HOLD_RETURN_VALUE(result, s.thisObject(), s.rval()); + return true; + } + SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); + return false; +} +SE_BIND_FUNC(js_engine_Device_getDPI) + +static bool js_engine_Device_getSafeAreaEdge(se::State& s) +{ + const auto& args = s.args(); + size_t argc = args.size(); + CC_UNUSED bool ok = true; + if (argc == 0) { + cc::Vec4 result = cc::Device::getSafeAreaEdge(); + ok &= nativevalue_to_se(result, s.rval(), nullptr /*ctx*/); + SE_PRECONDITION2(ok, false, "js_engine_Device_getSafeAreaEdge : Error processing arguments"); + SE_HOLD_RETURN_VALUE(result, s.thisObject(), s.rval()); + return true; + } + SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); + return false; +} +SE_BIND_FUNC(js_engine_Device_getSafeAreaEdge) + +static bool js_engine_Device_getDeviceModel(se::State& s) +{ + const auto& args = s.args(); + size_t argc = args.size(); + CC_UNUSED bool ok = true; + if (argc == 0) { + std::string result = cc::Device::getDeviceModel(); + ok &= nativevalue_to_se(result, s.rval(), nullptr /*ctx*/); + SE_PRECONDITION2(ok, false, "js_engine_Device_getDeviceModel : Error processing arguments"); + SE_HOLD_RETURN_VALUE(result, s.thisObject(), s.rval()); + return true; + } + SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); + return false; +} +SE_BIND_FUNC(js_engine_Device_getDeviceModel) + + + + +bool js_register_engine_Device(se::Object* obj) +{ + auto cls = se::Class::create("Device", obj, nullptr, nullptr); + + cls->defineStaticFunction("getDevicePixelRatio", _SE(js_engine_Device_getDevicePixelRatio)); + cls->defineStaticFunction("setAccelerometerEnabled", _SE(js_engine_Device_setAccelerometerEnabled)); + cls->defineStaticFunction("setAccelerometerInterval", _SE(js_engine_Device_setAccelerometerInterval)); + cls->defineStaticFunction("vibrate", _SE(js_engine_Device_vibrate)); + cls->defineStaticFunction("setKeepScreenOn", _SE(js_engine_Device_setKeepScreenOn)); + cls->defineStaticFunction("getNetworkType", _SE(js_engine_Device_getNetworkType)); + cls->defineStaticFunction("getBatteryLevel", _SE(js_engine_Device_getBatteryLevel)); + cls->defineStaticFunction("getDeviceOrientation", _SE(js_engine_Device_getDeviceOrientation)); + cls->defineStaticFunction("getDPI", _SE(js_engine_Device_getDPI)); + cls->defineStaticFunction("getSafeAreaEdge", _SE(js_engine_Device_getSafeAreaEdge)); + cls->defineStaticFunction("getDeviceModel", _SE(js_engine_Device_getDeviceModel)); + cls->install(); + JSBClassType::registerClass(cls); + + __jsb_cc_Device_proto = cls->getProto(); + __jsb_cc_Device_class = cls; + + se::ScriptEngine::getInstance()->clearException(); + return true; +} + +se::Object* __jsb_cc_SAXParser_proto = nullptr; +se::Class* __jsb_cc_SAXParser_class = nullptr; + +static bool js_engine_SAXParser_init(se::State& s) +{ + cc::SAXParser* cobj = SE_THIS_OBJECT(s); + SE_PRECONDITION2(cobj, false, "js_engine_SAXParser_init : Invalid Native Object"); + const auto& args = s.args(); + size_t argc = args.size(); + CC_UNUSED bool ok = true; + if (argc == 1) { + HolderType arg0 = {}; + ok &= sevalue_to_native(args[0], &arg0, s.thisObject()); + SE_PRECONDITION2(ok, false, "js_engine_SAXParser_init : Error processing arguments"); + bool result = cobj->init(arg0.value()); + ok &= nativevalue_to_se(result, s.rval(), nullptr /*ctx*/); + SE_PRECONDITION2(ok, false, "js_engine_SAXParser_init : Error processing arguments"); + SE_HOLD_RETURN_VALUE(result, s.thisObject(), s.rval()); + return true; + } + SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); + return false; +} +SE_BIND_FUNC(js_engine_SAXParser_init) + + + + +bool js_register_engine_SAXParser(se::Object* obj) +{ + auto cls = se::Class::create("PlistParser", obj, nullptr, nullptr); + + cls->defineFunction("init", _SE(js_engine_SAXParser_init)); + cls->install(); + JSBClassType::registerClass(cls); + + __jsb_cc_SAXParser_proto = cls->getProto(); + __jsb_cc_SAXParser_class = cls; + + se::ScriptEngine::getInstance()->clearException(); + return true; +} + bool register_all_engine(se::Object* obj) { // Get the ns diff --git a/native/cocos/bindings/auto/jsb_cocos_auto.h b/native/cocos/bindings/auto/jsb_cocos_auto.h index cce293e62b..d0b1b443c8 100644 --- a/native/cocos/bindings/auto/jsb_cocos_auto.h +++ b/native/cocos/bindings/auto/jsb_cocos_auto.h @@ -3,7 +3,10 @@ #include #include "cocos/bindings/jswrapper/SeApi.h" #include "cocos/bindings/manual/jsb_conversions.h" -#include "cocos/cocos2d.h" +#include "cocos/platform/FileUtils.h" +#include "cocos/platform/CanvasRenderingContext2D.h" +#include "cocos/platform/Device.h" +#include "cocos/platform/SAXParser.h" extern se::Object* __jsb_cc_FileUtils_proto; extern se::Class* __jsb_cc_FileUtils_class; @@ -49,34 +52,6 @@ SE_DECLARE_FUNC(js_engine_FileUtils_writeValueVectorToFile); SE_DECLARE_FUNC(js_engine_FileUtils_setDelegate); SE_DECLARE_FUNC(js_engine_FileUtils_getInstance); -extern se::Object* __jsb_cc_Device_proto; -extern se::Class* __jsb_cc_Device_class; - -bool js_register_cc_Device(se::Object* obj); -bool register_all_engine(se::Object* obj); - -JSB_REGISTER_OBJECT_TYPE(cc::Device); -SE_DECLARE_FUNC(js_engine_Device_getDevicePixelRatio); -SE_DECLARE_FUNC(js_engine_Device_setAccelerometerEnabled); -SE_DECLARE_FUNC(js_engine_Device_setAccelerometerInterval); -SE_DECLARE_FUNC(js_engine_Device_vibrate); -SE_DECLARE_FUNC(js_engine_Device_setKeepScreenOn); -SE_DECLARE_FUNC(js_engine_Device_getNetworkType); -SE_DECLARE_FUNC(js_engine_Device_getBatteryLevel); -SE_DECLARE_FUNC(js_engine_Device_getDeviceOrientation); -SE_DECLARE_FUNC(js_engine_Device_getDPI); -SE_DECLARE_FUNC(js_engine_Device_getSafeAreaEdge); -SE_DECLARE_FUNC(js_engine_Device_getDeviceModel); - -extern se::Object* __jsb_cc_SAXParser_proto; -extern se::Class* __jsb_cc_SAXParser_class; - -bool js_register_cc_SAXParser(se::Object* obj); -bool register_all_engine(se::Object* obj); - -JSB_REGISTER_OBJECT_TYPE(cc::SAXParser); -SE_DECLARE_FUNC(js_engine_SAXParser_init); - extern se::Object* __jsb_cc_CanvasGradient_proto; extern se::Class* __jsb_cc_CanvasGradient_class; @@ -113,3 +88,31 @@ SE_DECLARE_FUNC(js_engine_CanvasRenderingContext2D_transform); SE_DECLARE_FUNC(js_engine_CanvasRenderingContext2D_translate); SE_DECLARE_FUNC(js_engine_CanvasRenderingContext2D_CanvasRenderingContext2D); +extern se::Object* __jsb_cc_Device_proto; +extern se::Class* __jsb_cc_Device_class; + +bool js_register_cc_Device(se::Object* obj); +bool register_all_engine(se::Object* obj); + +JSB_REGISTER_OBJECT_TYPE(cc::Device); +SE_DECLARE_FUNC(js_engine_Device_getDevicePixelRatio); +SE_DECLARE_FUNC(js_engine_Device_setAccelerometerEnabled); +SE_DECLARE_FUNC(js_engine_Device_setAccelerometerInterval); +SE_DECLARE_FUNC(js_engine_Device_vibrate); +SE_DECLARE_FUNC(js_engine_Device_setKeepScreenOn); +SE_DECLARE_FUNC(js_engine_Device_getNetworkType); +SE_DECLARE_FUNC(js_engine_Device_getBatteryLevel); +SE_DECLARE_FUNC(js_engine_Device_getDeviceOrientation); +SE_DECLARE_FUNC(js_engine_Device_getDPI); +SE_DECLARE_FUNC(js_engine_Device_getSafeAreaEdge); +SE_DECLARE_FUNC(js_engine_Device_getDeviceModel); + +extern se::Object* __jsb_cc_SAXParser_proto; +extern se::Class* __jsb_cc_SAXParser_class; + +bool js_register_cc_SAXParser(se::Object* obj); +bool register_all_engine(se::Object* obj); + +JSB_REGISTER_OBJECT_TYPE(cc::SAXParser); +SE_DECLARE_FUNC(js_engine_SAXParser_init); + diff --git a/native/cocos/bindings/manual/jsb_cocos_manual.cpp b/native/cocos/bindings/manual/jsb_cocos_manual.cpp index ddc23c9acf..b53b7a1e25 100644 --- a/native/cocos/bindings/manual/jsb_cocos_manual.cpp +++ b/native/cocos/bindings/manual/jsb_cocos_manual.cpp @@ -31,7 +31,6 @@ #include "cocos/bindings/auto/jsb_cocos_auto.h" #include "storage/local-storage/LocalStorage.h" -#include "cocos2d.h" using namespace cc; diff --git a/native/cocos/bindings/manual/jsb_conversions.h b/native/cocos/bindings/manual/jsb_conversions.h index ff1d998622..2a064ee12a 100644 --- a/native/cocos/bindings/manual/jsb_conversions.h +++ b/native/cocos/bindings/manual/jsb_conversions.h @@ -27,8 +27,7 @@ #include "bindings/jswrapper/SeApi.h" #include "bindings/manual/jsb_classtype.h" - -#include "cocos2d.h" +#include "cocos/base/Vector.h" #include "extensions/cocos-ext.h" #include "network/Downloader.h" #include diff --git a/native/cocos/bindings/manual/jsb_dragonbones_manual.cpp b/native/cocos/bindings/manual/jsb_dragonbones_manual.cpp index 6f391c8704..3d421e433b 100644 --- a/native/cocos/bindings/manual/jsb_dragonbones_manual.cpp +++ b/native/cocos/bindings/manual/jsb_dragonbones_manual.cpp @@ -28,15 +28,13 @@ #if USE_DRAGONBONES > 0 - #include "cocos/bindings/auto/jsb_dragonbones_auto.h" - #include "cocos/bindings/auto/jsb_editor_support_auto.h" - #include "cocos/bindings/jswrapper/SeApi.h" - #include "cocos/bindings/manual/jsb_conversions.h" - #include "cocos/bindings/manual/jsb_global.h" - #include "cocos/bindings/manual/jsb_helper.h" - #include "cocos/editor-support/dragonbones-creator-support/CCDragonBonesHeaders.h" - - #include "cocos2d.h" +#include "cocos/bindings/auto/jsb_dragonbones_auto.h" +#include "cocos/bindings/auto/jsb_editor_support_auto.h" +#include "cocos/bindings/jswrapper/SeApi.h" +#include "cocos/bindings/manual/jsb_conversions.h" +#include "cocos/bindings/manual/jsb_global.h" +#include "cocos/bindings/manual/jsb_helper.h" +#include "cocos/editor-support/dragonbones-creator-support/CCDragonBonesHeaders.h" using namespace cc; diff --git a/native/cocos/bindings/manual/jsb_global.cpp b/native/cocos/bindings/manual/jsb_global.cpp index 0c78ceb9fc..6c9e56748a 100644 --- a/native/cocos/bindings/manual/jsb_global.cpp +++ b/native/cocos/bindings/manual/jsb_global.cpp @@ -22,15 +22,16 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ - #include "jsb_global.h" #include "jsb_conversions.h" #include "xxtea/xxtea.h" - +#include "base/ZipUtils.h" #include "base/Scheduler.h" #include "base/ThreadPool.h" +#include "base/base64.h" #include "network/HttpClient.h" #include "platform/Application.h" +#include "platform/Image.h" #include "renderer/core/Core.h" #include "ui/edit-box/EditBox.h" diff --git a/native/cocos/bindings/manual/jsb_module_register.cpp b/native/cocos/bindings/manual/jsb_module_register.cpp index b4bbc10f8e..1ded4cd0d0 100644 --- a/native/cocos/bindings/manual/jsb_module_register.cpp +++ b/native/cocos/bindings/manual/jsb_module_register.cpp @@ -22,14 +22,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ - -#include "cocos2d.h" - #include "cocos/bindings/jswrapper/SeApi.h" #include "cocos/bindings/manual/jsb_module_register.h" - #include "cocos/bindings/auto/jsb_cocos_auto.h" - +#include "cocos/base/AutoreleasePool.h" #include "cocos/bindings/dop/jsb_dop.h" #include "cocos/bindings/auto/jsb_extension_auto.h" #include "cocos/bindings/auto/jsb_network_auto.h" diff --git a/native/cocos/bindings/manual/jsb_platform_android.cpp b/native/cocos/bindings/manual/jsb_platform_android.cpp index 19ac11b0b8..d5284033ce 100644 --- a/native/cocos/bindings/manual/jsb_platform_android.cpp +++ b/native/cocos/bindings/manual/jsb_platform_android.cpp @@ -22,13 +22,13 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ - #include "jsb_platform.h" #include "cocos/bindings/jswrapper/SeApi.h" #include "cocos/bindings/manual/jsb_conversions.h" #include "cocos/bindings/manual/jsb_global.h" #include "cocos/platform/FileUtils.h" +#include "cocos/platform/android/jni/JniHelper.h" #include diff --git a/native/cocos/bindings/manual/jsb_spine_manual.cpp b/native/cocos/bindings/manual/jsb_spine_manual.cpp index 6c77942d7e..43f4f5dc9b 100644 --- a/native/cocos/bindings/manual/jsb_spine_manual.cpp +++ b/native/cocos/bindings/manual/jsb_spine_manual.cpp @@ -22,26 +22,24 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ - #include "jsb_spine_manual.h" #include "base/Config.h" #if USE_SPINE > 0 - #include "cocos/bindings/auto/jsb_spine_auto.h" - #include "cocos/bindings/jswrapper/SeApi.h" - #include "cocos/bindings/manual/jsb_conversions.h" - #include "cocos/bindings/manual/jsb_global.h" - #include "cocos/bindings/manual/jsb_helper.h" +#include "cocos/bindings/auto/jsb_spine_auto.h" +#include "cocos/bindings/jswrapper/SeApi.h" +#include "cocos/bindings/manual/jsb_conversions.h" +#include "cocos/bindings/manual/jsb_global.h" +#include "cocos/bindings/manual/jsb_helper.h" - #include "middleware-adapter.h" - #include "spine-creator-support/SkeletonDataMgr.h" - #include "spine-creator-support/SkeletonRenderer.h" - #include "spine-creator-support/spine-cocos2dx.h" +#include "middleware-adapter.h" +#include "spine-creator-support/SkeletonDataMgr.h" +#include "spine-creator-support/SkeletonRenderer.h" +#include "spine-creator-support/spine-cocos2dx.h" - #include "cocos/editor-support/spine-creator-support/spine-cocos2dx.h" - #include "cocos/editor-support/spine/spine.h" - #include "cocos2d.h" +#include "cocos/editor-support/spine-creator-support/spine-cocos2dx.h" +#include "cocos/editor-support/spine/spine.h" using namespace cc; diff --git a/native/cocos/cocos2d.cpp b/native/cocos/cocos2d.cpp deleted file mode 100644 index f8cc58d84b..0000000000 --- a/native/cocos/cocos2d.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/**************************************************************************** -Copyright (c) 2008-2010 Ricardo Quesada -Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2011 Zynga Inc. -Copyright (c) 2013-2016 Chukong Technologies Inc. -Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - -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 "base/Macros.h" - -namespace cc { - -CC_DLL const char *cocos2dVersion() { - return "2.0.x"; -} - -} // namespace cc diff --git a/native/cocos/cocos2d.h b/native/cocos/cocos2d.h deleted file mode 100644 index 5b887a0a7d..0000000000 --- a/native/cocos/cocos2d.h +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************** -Copyright (c) 2008-2010 Ricardo Quesada -Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2011 Zynga Inc. -Copyright (c) 2013-2016 Chukong Technologies Inc. -Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - -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. -****************************************************************************/ - -#ifndef __COCOS2D_H__ -#define __COCOS2D_H__ - -// 0x00 HI ME LO -// 00 03 08 00 -#define COCOS2D_VERSION 0x00031300 - -// -// all cocos2d include files -// -#include "base/Config.h" - -// base -#include "base/AutoreleasePool.h" -#include "base/Data.h" -#include "base/Map.h" -#include "base/Ref.h" -#include "base/Value.h" -#include "base/Vector.h" -#include "base/ZipUtils.h" -#include "base/base64.h" -#include "base/Config.h" -#include "base/Macros.h" -#include "base/UTF8.h" -#include "base/Utils.h" - - -// math -#include "math/Geometry.h" -#include "math/Vertex.h" -#include "math/Mat4.h" -#include "math/MathUtil.h" -#include "math/Quaternion.h" -#include "math/Vec2.h" -#include "math/Vec3.h" -#include "math/Vec4.h" - - -// include - -// renderer - -// platform -#include "platform/Device.h" -#include "platform/FileUtils.h" -#include "platform/Image.h" -#include "base/Macros.h" -#include "platform/SAXParser.h" -#include "platform/CanvasRenderingContext2D.h" - - -namespace cc { - -CC_DLL const char* cocos2dVersion(); - -} - -#endif // __COCOS2D_H__ - diff --git a/native/cocos/editor-support/dragonbones-creator-support/CCSlot.h b/native/cocos/editor-support/dragonbones-creator-support/CCSlot.h index 1c5ce18e71..31e72302e3 100644 --- a/native/cocos/editor-support/dragonbones-creator-support/CCSlot.h +++ b/native/cocos/editor-support/dragonbones-creator-support/CCSlot.h @@ -24,7 +24,6 @@ #ifndef DRAGONBONES_CC_SLOT_H #define DRAGONBONES_CC_SLOT_H -#include "cocos2d.h" #include "dragonbones/DragonBonesHeaders.h" #include "math/Geometry.h" #include "math/Mat4.h" diff --git a/native/cocos/editor-support/dragonbones-creator-support/CCTextureAtlasData.h b/native/cocos/editor-support/dragonbones-creator-support/CCTextureAtlasData.h index 3f7d4f46f6..79e5203b91 100644 --- a/native/cocos/editor-support/dragonbones-creator-support/CCTextureAtlasData.h +++ b/native/cocos/editor-support/dragonbones-creator-support/CCTextureAtlasData.h @@ -24,7 +24,6 @@ #ifndef DRAGONBONES_CC_TEXTUREATLAS_DATA_H #define DRAGONBONES_CC_TEXTUREATLAS_DATA_H -#include "cocos2d.h" #include "dragonbones/DragonBonesHeaders.h" #include "middleware-adapter.h" diff --git a/native/cocos/platform/ios/Application-ios.mm b/native/cocos/platform/ios/Application-ios.mm index 73b295c932..e13a61430e 100644 --- a/native/cocos/platform/ios/Application-ios.mm +++ b/native/cocos/platform/ios/Application-ios.mm @@ -29,6 +29,7 @@ #include "bindings/event/EventDispatcher.h" #include "bindings/jswrapper/SeApi.h" #include "audio/include/AudioEngine.h" +#include "platform/Device.h" #ifndef CC_USE_METAL @interface MyTimer : NSObject { diff --git a/native/templates/ios/ViewController.mm b/native/templates/ios/ViewController.mm index ed29458750..08c0262fcf 100644 --- a/native/templates/ios/ViewController.mm +++ b/native/templates/ios/ViewController.mm @@ -25,6 +25,7 @@ ****************************************************************************/ #import "ViewController.h" #include "cocos/bindings/event/EventDispatcher.h" +#include "cocos/platform/Device.h" namespace { cc::Device::Orientation _lastOrientation; diff --git a/native/tools/tojs/cocos.ini b/native/tools/tojs/cocos.ini index 531540546c..bb738b3572 100644 --- a/native/tools/tojs/cocos.ini +++ b/native/tools/tojs/cocos.ini @@ -24,7 +24,7 @@ cxxgenerator_headers = extra_arguments = %(android_headers)s %(clang_headers)s %(cxxgenerator_headers)s %(cocos_headers)s %(android_flags)s %(clang_flags)s %(cocos_flags)s %(extra_flags)s # what headers to parse -headers = %(cocosdir)s/cocos/cocos2d.h +headers = %(cocosdir)s/cocos/platform/FileUtils.h %(cocosdir)s/cocos/platform/CanvasRenderingContext2D.h %(cocosdir)s/cocos/platform/Device.h %(cocosdir)s/cocos/platform/SAXParser.h replace_headers=