diff
stringlengths 41
2.03M
| msg
stringlengths 1
1.5k
⌀ | repo
stringlengths 5
40
| sha
stringlengths 40
40
| time
stringlengths 20
20
|
---|---|---|---|---|
mmm a / editor / editor_file_system . cpp <nl> ppp b / editor / editor_file_system . cpp <nl> void EditorFileSystem : : update_file ( const String & p_file ) { <nl> fs - > files [ cpos ] - > deps = _get_dependencies ( p_file ) ; <nl> fs - > files [ cpos ] - > import_valid = ResourceLoader : : is_import_valid ( p_file ) ; <nl> <nl> + / / Update preview <nl> + EditorResourcePreview : : get_singleton ( ) - > check_for_invalidation ( p_file ) ; <nl> + <nl> call_deferred ( " emit_signal " , " filesystem_changed " ) ; / / update later <nl> } <nl> <nl>
|
Update preview on filesystem change
|
godotengine/godot
|
188ccf190ba398ef9d3f661016f15cc005505c26
|
2018-03-10T13:21:17Z
|
mmm a / hphp / php7 / bytecode . h <nl> ppp b / hphp / php7 / bytecode . h <nl> <nl> <nl> namespace HPHP { namespace php7 { <nl> <nl> + struct Block ; <nl> + <nl> namespace bc { <nl> <nl> / / void * immediate types just aren ' t being used right now <nl> namespace bc { <nl> # define IMM_TYPE_CAR int32_t <nl> # define IMM_TYPE_CAW int32_t <nl> # define IMM_TYPE_DA double <nl> - # define IMM_TYPE_SA int <nl> + # define IMM_TYPE_SA std : : string <nl> # define IMM_TYPE_AA int <nl> # define IMM_TYPE_RATA void * <nl> - # define IMM_TYPE_BA uint64_t / / offset ( basic block id ) <nl> + # define IMM_TYPE_BA Block * <nl> # define IMM_TYPE_OA ( subtype ) subtype <nl> # define IMM_TYPE_KA void * <nl> # define IMM_TYPE_LAR void * <nl> OPCODES <nl> / / too many opcodes for us to use boost : : variant so we ' ll roll our own : ) <nl> struct Bytecode { <nl> Bytecode ( ) <nl> - : code ( Op : : Nop ) { <nl> - op . Nop = bc : : Nop { } ; <nl> - } <nl> - <nl> + : code ( Op : : Nop ) , <nl> + Nop ( ) { } <nl> <nl> # define O ( opcode , imms , inputs , outputs , flags ) \ <nl> / * implicit * / Bytecode ( const bc : : opcode & data ) \ <nl> : code ( Op : : opcode ) { \ <nl> - new ( & op ) bc : : opcode ( data ) ; \ <nl> + new ( & opcode ) bc : : opcode ( data ) ; \ <nl> } <nl> OPCODES <nl> # undef O <nl> <nl> + Bytecode ( const Bytecode & b ) { <nl> + code = b . code ; <nl> + switch ( code ) { <nl> + # define O ( opcode , . . . ) \ <nl> + case Op : : opcode : new ( & opcode ) bc : : opcode ( b . opcode ) ; break ; <nl> + OPCODES <nl> + # undef O <nl> + } <nl> + } <nl> + <nl> + Bytecode ( Bytecode & & b ) { <nl> + code = b . code ; <nl> + switch ( code ) { <nl> + # define O ( opcode , . . . ) \ <nl> + case Op : : opcode : new ( & opcode ) bc : : opcode ( std : : move ( b . opcode ) ) ; break ; <nl> + OPCODES <nl> + # undef O <nl> + } <nl> + } <nl> + <nl> + Bytecode & operator = ( const Bytecode & b ) { <nl> + destroy_op ( ) ; <nl> + code = b . code ; <nl> + switch ( code ) { <nl> + # define O ( opcode , . . . ) case Op : : opcode : opcode = b . opcode ; break ; <nl> + OPCODES <nl> + # undef O <nl> + } <nl> + return * this ; <nl> + } <nl> + <nl> + Bytecode & operator = ( Bytecode & & b ) { <nl> + destroy_op ( ) ; <nl> + code = b . code ; <nl> + switch ( code ) { <nl> + # define O ( opcode , . . . ) case Op : : opcode : opcode = std : : move ( b . opcode ) ; break ; <nl> + OPCODES <nl> + # undef O <nl> + } <nl> + return * this ; <nl> + } <nl> + <nl> + ~ Bytecode ( ) { <nl> + destroy_op ( ) ; <nl> + } <nl> + <nl> template < class Visitor > <nl> void visit ( Visitor & & visit ) const { <nl> switch ( code ) { <nl> - # define O ( opcode , . . . ) case Op : : opcode : visit . bytecode ( op . opcode ) ; break ; <nl> + # define O ( opcode , . . . ) case Op : : opcode : visit . bytecode ( opcode ) ; break ; <nl> OPCODES <nl> # undef O <nl> } <nl> } <nl> <nl> private : <nl> + void destroy_op ( ) { <nl> + using namespace bc ; <nl> + switch ( code ) { <nl> + # define O ( opcode , . . . ) case Op : : opcode : opcode . ~ opcode ( ) ; break ; <nl> + OPCODES <nl> + # undef O <nl> + } <nl> + } <nl> + <nl> Op code ; <nl> union { <nl> # define O ( opcode , imms , inputs , outputs , flags ) \ <nl> bc : : opcode opcode ; <nl> OPCODES <nl> # undef O <nl> - } op ; <nl> + } ; <nl> } ; <nl> <nl> <nl> mmm a / hphp / php7 / compiler . cpp <nl> ppp b / hphp / php7 / compiler . cpp <nl> <nl> <nl> namespace HPHP { namespace php7 { <nl> <nl> + namespace { <nl> + / / helpers to cope with these functions taking non - const pointers <nl> + / / in zend_ast . h <nl> + <nl> + inline const zval * zend_ast_get_zval ( const zend_ast * ast ) { <nl> + return & reinterpret_cast < const zend_ast_zval * > ( ast ) - > val ; <nl> + } <nl> + <nl> + inline const zend_ast_list * zend_ast_get_list ( const zend_ast * ast ) { <nl> + return reinterpret_cast < const zend_ast_list * > ( ast ) ; <nl> + } <nl> + <nl> + } / / namespace <nl> + <nl> + <nl> using namespace bc ; <nl> <nl> Compiler : : Compiler ( ) { <nl> Compiler : : Compiler ( ) { <nl> unit - > name = " unit . hhas " ; <nl> } <nl> <nl> - void Compiler : : compileProgram ( zend_ast * ast ) { <nl> + void Compiler : : compileProgram ( const zend_ast * ast ) { <nl> assert ( ast - > kind = = ZEND_AST_STMT_LIST ) ; <nl> auto list = zend_ast_get_list ( ast ) ; <nl> <nl> auto pseudomain = unit - > getPseudomain ( ) ; <nl> + activeFunction = pseudomain ; <nl> activeBlock = pseudomain - > entry ; <nl> <nl> - for ( int i = 0 ; i < list - > children ; i + + ) { <nl> + for ( uint32_t i = 0 ; i < list - > children ; i + + ) { <nl> compileStatement ( list - > child [ i ] ) ; <nl> } <nl> <nl> void Compiler : : panic ( const std : : string & msg ) { <nl> throw CompilerException ( folly : : sformat ( " panic : { } " , msg ) ) ; <nl> } <nl> <nl> - void Compiler : : compileZvalLiteral ( zval * zv ) { <nl> + void Compiler : : compileZvalLiteral ( const zval * zv ) { <nl> switch ( Z_TYPE_P ( zv ) ) { <nl> case IS_LONG : <nl> activeBlock - > emit ( Int { Z_LVAL_P ( zv ) } ) ; <nl> break ; <nl> + case IS_NULL : <nl> + activeBlock - > emit ( Null { } ) ; <nl> + break ; <nl> + case IS_FALSE : <nl> + activeBlock - > emit ( False { } ) ; <nl> + break ; <nl> + case IS_TRUE : <nl> + activeBlock - > emit ( True { } ) ; <nl> + break ; <nl> + case IS_DOUBLE : <nl> + activeBlock - > emit ( Double { Z_DVAL_P ( zv ) } ) ; <nl> + break ; <nl> + case IS_STRING : <nl> + activeBlock - > emit ( String { Z_STRVAL_P ( zv ) } ) ; <nl> + break ; <nl> default : <nl> panic ( " unsupported literal " ) ; <nl> } <nl> + } <nl> + <nl> + void Compiler : : compileConstant ( const zend_ast * ast ) { <nl> + auto name = ast - > child [ 0 ] ; <nl> + const char * str = Z_STRVAL_P ( zend_ast_get_zval ( name ) ) ; <nl> + if ( name - > attr & ZEND_NAME_NOT_FQ ) { <nl> + if ( strcasecmp ( str , " true " ) = = 0 ) { <nl> + activeBlock - > emit ( True { } ) ; <nl> + } else if ( strcasecmp ( str , " false " ) = = 0 ) { <nl> + activeBlock - > emit ( False { } ) ; <nl> + } else if ( strcasecmp ( str , " null " ) = = 0 ) { <nl> + activeBlock - > emit ( Null { } ) ; <nl> + } else { <nl> + panic ( " unknown unqualified constant " ) ; <nl> + } <nl> + } else { <nl> + panic ( " unknown constant " ) ; <nl> + } <nl> + } <nl> + <nl> + Bytecode Compiler : : opForBinaryOp ( const zend_ast * ast ) { <nl> + / / NB : bizarrely , greater - than ( > , > = ) have their own AST type <nl> + / / and there is no ZEND_IS_GREATER since it doesn ' t correspond to a VM <nl> + / / instruction <nl> + if ( ast - > kind = = ZEND_AST_GREATER ) { <nl> + return Gt { } ; <nl> + } else if ( ast - > kind = = ZEND_AST_GREATER_EQUAL ) { <nl> + return Gte { } ; <nl> + } <nl> + <nl> + switch ( ast - > attr ) { <nl> + case ZEND_ADD : return Add { } ; <nl> + case ZEND_SUB : return Sub { } ; <nl> + case ZEND_MUL : return Mul { } ; <nl> + case ZEND_DIV : return Div { } ; <nl> + case ZEND_POW : return Pow { } ; <nl> + case ZEND_MOD : return Mod { } ; <nl> + case ZEND_SL : return Shl { } ; <nl> + case ZEND_SR : return Shr { } ; <nl> + case ZEND_BW_OR : return BitOr { } ; <nl> + case ZEND_BW_AND : return BitAnd { } ; <nl> + case ZEND_BW_XOR : return BitXor { } ; <nl> + case ZEND_CONCAT : return Concat { } ; <nl> + <nl> + case ZEND_IS_IDENTICAL : return Same { } ; <nl> + case ZEND_IS_NOT_IDENTICAL : return NSame { } ; <nl> + case ZEND_IS_EQUAL : return Eq { } ; <nl> + case ZEND_IS_NOT_EQUAL : return Neq { } ; <nl> + case ZEND_IS_SMALLER : return Lt { } ; <nl> + case ZEND_IS_SMALLER_OR_EQUAL : return Lte { } ; <nl> + case ZEND_SPACESHIP : return Cmp { } ; <nl> + default : <nl> + panic ( " unknown binop " ) ; <nl> + } <nl> + } <nl> <nl> + void Compiler : : compileUnaryOp ( const zend_ast * ast ) { <nl> + switch ( ast - > kind ) { <nl> + case ZEND_AST_UNARY_MINUS : <nl> + activeBlock - > emit ( Int { 0 } ) ; <nl> + compileExpression ( ast - > child [ 0 ] ) ; <nl> + activeBlock - > emit ( Sub { } ) ; <nl> + return ; <nl> + case ZEND_AST_UNARY_PLUS : <nl> + activeBlock - > emit ( Int { 0 } ) ; <nl> + compileExpression ( ast - > child [ 0 ] ) ; <nl> + activeBlock - > emit ( Add { } ) ; <nl> + return ; <nl> + case ZEND_AST_UNARY_OP : <nl> + compileExpression ( ast - > child [ 0 ] ) ; <nl> + switch ( ast - > attr ) { <nl> + case ZEND_BOOL_NOT : <nl> + activeBlock - > emit ( Not { } ) ; <nl> + return ; <nl> + case ZEND_BW_NOT : <nl> + activeBlock - > emit ( BitNot { } ) ; <nl> + return ; <nl> + } <nl> + } <nl> + panic ( " unknown unop " ) ; <nl> } <nl> <nl> - void Compiler : : compileExpression ( zend_ast * ast ) { <nl> + void Compiler : : compileExpression ( const zend_ast * ast ) { <nl> switch ( ast - > kind ) { <nl> case ZEND_AST_ZVAL : <nl> compileZvalLiteral ( zend_ast_get_zval ( ast ) ) ; <nl> break ; <nl> + case ZEND_AST_CONST : <nl> + compileConstant ( ast ) ; <nl> + break ; <nl> + case ZEND_AST_UNARY_MINUS : <nl> + case ZEND_AST_UNARY_PLUS : <nl> + case ZEND_AST_UNARY_OP : <nl> + compileUnaryOp ( ast ) ; <nl> + break ; <nl> case ZEND_AST_BINARY_OP : <nl> + case ZEND_AST_GREATER : <nl> + case ZEND_AST_GREATER_EQUAL : <nl> compileExpression ( ast - > child [ 0 ] ) ; <nl> compileExpression ( ast - > child [ 1 ] ) ; <nl> - switch ( ast - > attr ) { <nl> - case ZEND_ADD : <nl> - activeBlock - > emit ( Add { } ) ; <nl> - break ; <nl> - default : <nl> - panic ( " unsupported binop " ) ; <nl> - } <nl> + activeBlock - > emit ( opForBinaryOp ( ast ) ) ; <nl> break ; <nl> default : <nl> panic ( " unsupported expression " ) ; <nl> } <nl> } <nl> <nl> - void Compiler : : compileStatement ( zend_ast * ast ) { <nl> + void Compiler : : compileStatement ( const zend_ast * ast ) { <nl> switch ( ast - > kind ) { <nl> case ZEND_AST_STMT_LIST : { <nl> / / just a block , so recur please : ) <nl> auto list = zend_ast_get_list ( ast ) ; <nl> - for ( int i = 0 ; i < list - > children ; i + + ) { <nl> + for ( uint32_t i = 0 ; i < list - > children ; i + + ) { <nl> compileStatement ( list - > child [ i ] ) ; <nl> } <nl> break ; <nl> void Compiler : : compileStatement ( zend_ast * ast ) { <nl> activeBlock - > emit ( Print { } ) ; <nl> activeBlock - > emit ( PopC { } ) ; <nl> break ; <nl> + case ZEND_AST_IF : <nl> + compileIf ( ast ) ; <nl> + break ; <nl> default : <nl> panic ( " unsupported statement " ) ; <nl> } <nl> } <nl> <nl> + void Compiler : : compileIf ( const zend_ast * ast ) { <nl> + auto list = zend_ast_get_list ( ast ) ; <nl> + <nl> + / / where control will return after we ' re finished <nl> + auto end = activeFunction - > allocateBlock ( ) ; <nl> + <nl> + for ( uint32_t i = 0 ; i < list - > children ; i + + ) { <nl> + auto elem = list - > child [ i ] ; <nl> + auto condition = elem - > child [ 0 ] ; <nl> + auto contents = elem - > child [ 1 ] ; <nl> + if ( ! condition ) { <nl> + / / if no condition is provided , this is the ' else ' branch <nl> + compileStatement ( contents ) ; <nl> + break ; <nl> + } else { <nl> + / / otherwise , we have a conditional <nl> + auto mainBlock = activeBlock ; <nl> + auto branch = activeFunction - > allocateBlock ( ) ; <nl> + <nl> + activeBlock = branch ; <nl> + compileStatement ( contents ) ; <nl> + activeBlock - > emit ( Jmp { end } ) ; <nl> + activeBlock = mainBlock ; <nl> + <nl> + compileExpression ( condition ) ; <nl> + activeBlock - > emit ( JmpNZ { branch } ) ; <nl> + } <nl> + } <nl> + <nl> + activeBlock - > emit ( Jmp { end } ) ; <nl> + activeBlock = end ; <nl> + <nl> + } <nl> + <nl> } } / / HPHP : : php7 <nl> mmm a / hphp / php7 / compiler . h <nl> ppp b / hphp / php7 / compiler . h <nl> <nl> <nl> # include " hphp / php7 / zend / zend . h " <nl> # include " hphp / php7 / ast_info . h " <nl> + # include " hphp / php7 / bytecode . h " <nl> # include " hphp / php7 / unit . h " <nl> <nl> # include < string > <nl> struct CompilerException : public std : : logic_error { <nl> struct Compiler { <nl> explicit Compiler ( ) ; <nl> <nl> - static std : : unique_ptr < Unit > compile ( zend_ast * ast ) { <nl> + static std : : unique_ptr < Unit > compile ( const zend_ast * ast ) { <nl> Compiler compiler ; <nl> compiler . compileProgram ( ast ) ; <nl> return std : : move ( compiler . unit ) ; <nl> } <nl> <nl> private : <nl> - void compileProgram ( zend_ast * ast ) ; <nl> - void compileStatement ( zend_ast * ast ) ; <nl> - void compileExpression ( zend_ast * ast ) ; <nl> - void compileZvalLiteral ( zval * ast ) ; <nl> + void compileProgram ( const zend_ast * ast ) ; <nl> + void compileStatement ( const zend_ast * ast ) ; <nl> + void compileExpression ( const zend_ast * ast ) ; <nl> + <nl> + void compileZvalLiteral ( const zval * ast ) ; <nl> + void compileConstant ( const zend_ast * ast ) ; <nl> + void compileIf ( const zend_ast * ast ) ; <nl> + <nl> + Bytecode opForBinaryOp ( const zend_ast * op ) ; <nl> + void compileUnaryOp ( const zend_ast * op ) ; <nl> <nl> [ [ noreturn ] ] <nl> void panic ( const std : : string & msg ) ; <nl> <nl> std : : unique_ptr < Unit > unit ; <nl> <nl> + Function * activeFunction ; <nl> Block * activeBlock ; <nl> } ; <nl> <nl> mmm a / hphp / php7 / hhas . cpp <nl> ppp b / hphp / php7 / hhas . cpp <nl> <nl> # include " hphp / php7 / hhas . h " <nl> <nl> # include < folly / Format . h > <nl> + # include < folly / String . h > <nl> <nl> namespace HPHP { namespace php7 { <nl> <nl> struct InstrVisitor { <nl> folly : : format ( & out , " { } " , intimm ) ; <nl> } <nl> <nl> + void imm ( double n ) { <nl> + folly : : format ( & out , " { } " , n ) ; <nl> + } <nl> + <nl> + void imm ( const std : : string & str ) { <nl> + folly : : format ( & out , " \ " { } \ " " , folly : : cEscape < std : : string > ( str ) ) ; <nl> + } <nl> + <nl> + void imm ( Block * blk ) { <nl> + folly : : format ( & out , " L { } " , blk - > id ) ; <nl> + } <nl> + <nl> + <nl> template < class T > <nl> void imm ( const T & imm ) { <nl> out . append ( " < immediate > " ) ; <nl> struct InstrVisitor { <nl> std : : string dump_pseudomain ( const Function & func ) { <nl> std : : string out ; <nl> out . append ( " . main { \ n " ) ; <nl> - out . append ( dump_block ( * func . entry ) ) ; <nl> + for ( const auto & blk : func . blocks ) { <nl> + out . append ( dump_block ( * blk ) ) ; <nl> + } <nl> out . append ( " } " ) ; <nl> return out ; <nl> } <nl> mmm a / hphp / php7 / unit . h <nl> ppp b / hphp / php7 / unit . h <nl> struct Unit ; <nl> <nl> struct Block { <nl> void emit ( Bytecode & & bc ) { <nl> - code . push_back ( bc ) ; <nl> + code . push_back ( std : : move ( bc ) ) ; <nl> } <nl> <nl> / / identifies this block in its unit <nl> new file mode 100644 <nl> index 00000000000 . . 9c832418fca <nl> mmm / dev / null <nl> ppp b / hphp / test / php7 - emitter / binops . php <nl> <nl> + < ? php <nl> + <nl> + echo 2 + 4 * 10 ; echo " \ n " ; <nl> + echo 2 - 14 / 7 ; echo " \ n " ; <nl> + <nl> + echo 2 > 10 ; echo " \ n " ; <nl> + echo 2 < 10 ; echo " \ n " ; <nl> + echo 2 < = 10 ; echo " \ n " ; <nl> + echo 10 < = 10 ; echo " \ n " ; <nl> + echo 10 > = 10 ; echo " \ n " ; <nl> + echo 10 > 10 ; echo " \ n " ; <nl> + echo 10 < 10 ; echo " \ n " ; <nl> + echo 10 = = 10 ; echo " \ n " ; <nl> + echo 10 = = " 10 " ; echo " \ n " ; <nl> + echo 10 = = = " 10 " ; echo " \ n " ; <nl> + echo 10 = = = 10 ; echo " \ n " ; <nl> + <nl> + echo 15 % 8 ; echo " \ n " ; <nl> + echo 15 & 8 ; echo " \ n " ; <nl> + echo 15 | 8 ; echo " \ n " ; <nl> + echo 15 ^ 40 ; echo " \ n " ; <nl> + echo " hello " . " world \ n " ; <nl> + echo 2 * * 8 ; echo " \ n " ; <nl> + echo 2 < = > 2 ; echo " \ n " ; <nl> + echo 2 < = > 3 ; echo " \ n " ; <nl> + echo 3 < = > 2 ; echo " \ n " ; <nl> new file mode 100644 <nl> index 00000000000 . . 931b68ce980 <nl> mmm / dev / null <nl> ppp b / hphp / test / php7 - emitter / binops . php . expect <nl> <nl> + 42 <nl> + 0 <nl> + <nl> + 1 <nl> + 1 <nl> + 1 <nl> + 1 <nl> + <nl> + <nl> + 1 <nl> + 1 <nl> + <nl> + 1 <nl> + 7 <nl> + 8 <nl> + 15 <nl> + 39 <nl> + hello world <nl> + 256 <nl> + 0 <nl> + - 1 <nl> + 1 <nl> new file mode 100644 <nl> index 00000000000 . . c3093585d6d <nl> mmm / dev / null <nl> ppp b / hphp / test / php7 - emitter / branches . php <nl> <nl> + < ? php <nl> + <nl> + if ( true ) { <nl> + echo " hello \ n " ; <nl> + } else { <nl> + echo " wat \ n " ; <nl> + } <nl> + <nl> + if ( 2 > 10 ) { <nl> + echo " no \ n " ; <nl> + } else if ( 2 > 5 ) { <nl> + echo " no \ n " ; <nl> + } else if ( " foo " = = = false ) { <nl> + echo " no \ n " ; <nl> + } else if ( 1 < 2 ) { <nl> + echo " yes \ n " ; <nl> + } else if ( 0 < = 2 ) { <nl> + echo " doesn ' t get here \ n " ; <nl> + } <nl> + <nl> + if ( null = = 2 ) { <nl> + echo " no \ n " ; <nl> + } else { <nl> + echo " yes \ n " ; <nl> + } <nl> new file mode 100644 <nl> index 00000000000 . . 41a0a427d5b <nl> mmm / dev / null <nl> ppp b / hphp / test / php7 - emitter / branches . php . expect <nl> <nl> + hello <nl> + yes <nl> + yes <nl> mmm a / hphp / test / php7 - emitter / config . ini <nl> ppp b / hphp / test / php7 - emitter / config . ini <nl> <nl> - hhvm . repo . local . mode = - - <nl> - hhvm . repo . mode = readonly <nl> + hhvm . repo . local . mode = rw <nl> + hhvm . repo . local . path = " : memory : " <nl> + hhvm . repo . mode = local <nl> new file mode 100644 <nl> index 00000000000 . . d90dc5e6f26 <nl> mmm / dev / null <nl> ppp b / hphp / test / php7 - emitter / constants . php <nl> <nl> + < ? php <nl> + <nl> + echo true ; echo " \ n " ; <nl> + echo TRue ; echo " \ n " ; <nl> + echo TRUE ; echo " \ n " ; <nl> + echo True ; echo " \ n " ; <nl> + <nl> + echo False ; echo " \ n " ; <nl> + echo false ; echo " \ n " ; <nl> + echo faLsE ; echo " \ n " ; <nl> + echo FALSE ; echo " \ n " ; <nl> + <nl> + echo null ; echo " \ n " ; <nl> + echo nULL ; echo " \ n " ; <nl> + echo Null ; echo " \ n " ; <nl> + echo nULL ; echo " \ n " ; <nl> + <nl> + echo 12 ; echo " \ n " ; <nl> + <nl> + echo 124 . 5 ; echo " \ n " ; <nl> + echo - 12 . 1 ; echo " \ n " ; <nl> + <nl> + echo " hello " ; echo " \ n " ; <nl> new file mode 100644 <nl> index 00000000000 . . d81222764a1 <nl> mmm / dev / null <nl> ppp b / hphp / test / php7 - emitter / constants . php . expect <nl> <nl> + 1 <nl> + 1 <nl> + 1 <nl> + 1 <nl> + <nl> + <nl> + <nl> + <nl> + <nl> + <nl> + <nl> + <nl> + 12 <nl> + 124 . 5 <nl> + - 12 . 1 <nl> + hello <nl> new file mode 100644 <nl> index 00000000000 . . 4a594e58dbd <nl> mmm / dev / null <nl> ppp b / hphp / test / php7 - emitter / unops . php <nl> <nl> + < ? php <nl> + <nl> + echo + ( 1 ) ; echo " \ n " ; <nl> + echo - ( 1 . 5 ) ; echo " \ n " ; <nl> + <nl> + if ( ! true ) { <nl> + echo " no \ n " ; <nl> + } else { <nl> + echo " yes \ n " ; <nl> + } <nl> + <nl> + if ( ! false ) { <nl> + echo " yes \ n " ; <nl> + } else { <nl> + echo " no \ n " ; <nl> + } <nl> + <nl> + echo ~ 0 ; echo " \ n " ; <nl> + echo 15 & ~ 1 ; echo " \ n " ; <nl> new file mode 100644 <nl> index 00000000000 . . cd7d0571179 <nl> mmm / dev / null <nl> ppp b / hphp / test / php7 - emitter / unops . php . expect <nl> <nl> + 1 <nl> + - 1 . 5 <nl> + yes <nl> + yes <nl> + - 1 <nl> + 14 <nl>
|
Add support for remaining ( scalar ) literal types , binops , and if / else
|
facebook/hhvm
|
49c5e373724c6d625efe085bc70554f79f05d2fc
|
2017-07-03T22:03:08Z
|
mmm a / swoole_runtime . cc <nl> ppp b / swoole_runtime . cc <nl> static PHP_FUNCTION ( _stream_select ) <nl> php_error_docref ( NULL , E_WARNING , " The microseconds parameter must be greater than 0 " ) ; <nl> RETURN_FALSE <nl> } <nl> - timeout = sec + ( usec / 1000000 ) ; <nl> + timeout = ( double ) sec + ( ( double ) usec / 1000000 ) ; <nl> } <nl> <nl> / * slight hack to support buffered data ; if there is data sitting in the <nl> mmm a / tests / swoole_runtime / stream_select / base . phpt <nl> ppp b / tests / swoole_runtime / stream_select / base . phpt <nl> <nl> - - TEST - - <nl> swoole_runtime / stream_select : base <nl> - - SKIPIF - - <nl> - < ? php require __DIR__ . ' / . . / include / skipif . inc ' ; ? > <nl> + < ? php require __DIR__ . ' / . . / . . / include / skipif . inc ' ; ? > <nl> - - FILE - - <nl> < ? php <nl> - require __DIR__ . ' / . . / include / bootstrap . php ' ; <nl> + require __DIR__ . ' / . . / . . / include / bootstrap . php ' ; <nl> Swoole \ Runtime : : enableCoroutine ( ) ; <nl> go ( function ( ) { <nl> Swoole \ Runtime : : enableCoroutine ( ) ; <nl> mmm a / tests / swoole_runtime / stream_select / blocked . phpt <nl> ppp b / tests / swoole_runtime / stream_select / blocked . phpt <nl> <nl> - - TEST - - <nl> swoole_runtime / stream_select : blocked <nl> - - SKIPIF - - <nl> - < ? php require __DIR__ . ' / . . / include / skipif . inc ' ; ? > <nl> + < ? php require __DIR__ . ' / . . / . . / include / skipif . inc ' ; ? > <nl> - - FILE - - <nl> < ? php <nl> - require __DIR__ . ' / . . / include / bootstrap . php ' ; <nl> + require __DIR__ . ' / . . / . . / include / bootstrap . php ' ; <nl> Swoole \ Runtime : : enableCoroutine ( ) ; <nl> $ fp1 = stream_socket_client ( " tcp : / / www . baidu . com : 80 " , $ errno , $ errstr , 30 ) ; <nl> $ fp2 = stream_socket_client ( " tcp : / / www . qq . com : 80 " , $ errno , $ errstr , 30 ) ; <nl> mmm a / tests / swoole_runtime / stream_select / never_timeout . phpt <nl> ppp b / tests / swoole_runtime / stream_select / never_timeout . phpt <nl> <nl> - - TEST - - <nl> swoole_runtime / stream_select : never timeout <nl> - - SKIPIF - - <nl> - < ? php require __DIR__ . ' / . . / include / skipif . inc ' ; ? > <nl> + < ? php require __DIR__ . ' / . . / . . / include / skipif . inc ' ; ? > <nl> - - FILE - - <nl> < ? php <nl> - require __DIR__ . ' / . . / include / bootstrap . php ' ; <nl> + require __DIR__ . ' / . . / . . / include / bootstrap . php ' ; <nl> Swoole \ Runtime : : enableCoroutine ( ) ; <nl> go ( function ( ) { <nl> $ server1 = Co \ TestServer : : createHttpHelloWorld ( ) ; <nl> mmm a / tests / swoole_runtime / stream_select / timeout . phpt <nl> ppp b / tests / swoole_runtime / stream_select / timeout . phpt <nl> <nl> - - TEST - - <nl> swoole_runtime / stream_select : timeout <nl> - - SKIPIF - - <nl> - < ? php require __DIR__ . ' / . . / include / skipif . inc ' ; ? > <nl> + < ? php require __DIR__ . ' / . . / . . / include / skipif . inc ' ; ? > <nl> - - FILE - - <nl> < ? php <nl> - require __DIR__ . ' / . . / include / bootstrap . php ' ; <nl> + require __DIR__ . ' / . . / . . / include / bootstrap . php ' ; <nl> Swoole \ Runtime : : enableCoroutine ( ) ; <nl> go ( function ( ) { <nl> Swoole \ Runtime : : enableCoroutine ( ) ; <nl> go ( function ( ) { <nl> $ r_array = [ $ fp1 ] ; <nl> $ w_array = $ e_array = null ; <nl> $ s = microtime ( true ) ; <nl> - $ n = stream_select ( $ r_array , $ w_array , $ e_array , 1 ) ; <nl> + $ timeout = ms_random ( 0 . 1 , 0 . 5 ) ; <nl> + $ n = stream_select ( $ r_array , $ w_array , $ e_array , 0 , $ timeout * 1000000 ) ; <nl> Assert : : eq ( $ n , 0 ) ; <nl> - assert ( microtime ( true ) - $ s > 0 . 99 ) ; <nl> + assert ( time_approximate ( $ timeout , microtime ( true ) - $ s ) ) ; <nl> + echo " SUCCESS \ n " ; <nl> } <nl> } ) ; <nl> ? > <nl> - - EXPECT - - <nl> + SUCCESS <nl>
|
Fix usec parser , fix tests .
|
swoole/swoole-src
|
c166b7a7222b721e18caedeec5610584eea6193c
|
2019-03-28T07:36:43Z
|
mmm a / jstests / core / collation . js <nl> ppp b / jstests / core / collation . js <nl> <nl> assert . commandFailed ( <nl> db . createCollection ( " collation " , { collation : { locale : " en " , strength : 99 } } ) ) ; <nl> <nl> + / / Attempting to create a collection whose collation version does not match the collator version <nl> + / / produced by ICU should result in failure with a special error code . <nl> + assert . commandFailedWithCode ( <nl> + db . createCollection ( " collation " , { collation : { locale : " en " , version : " unknownVersion " } } ) , <nl> + ErrorCodes . IncompatibleCollationVersion ) ; <nl> + <nl> / / Ensure we can create a collection with the " simple " collation as the collection default . <nl> assert . commandWorked ( db . createCollection ( " collation " , { collation : { locale : " simple " } } ) ) ; <nl> var collectionInfos = db . getCollectionInfos ( { name : " collation " } ) ; <nl> <nl> alternate : " non - ignorable " , <nl> maxVariable : " punct " , <nl> normalization : false , <nl> - backwards : true <nl> + backwards : true , <nl> + version : " 57 . 1 " , <nl> } ) ; <nl> <nl> / / Ensure that an index with no collation inherits the collection - default collation . <nl> <nl> alternate : " non - ignorable " , <nl> maxVariable : " punct " , <nl> normalization : false , <nl> - backwards : true <nl> + backwards : true , <nl> + version : " 57 . 1 " , <nl> } ) ; <nl> <nl> / / Ensure that an index which specifies an overriding collation does not use the collection <nl> <nl> alternate : " non - ignorable " , <nl> maxVariable : " punct " , <nl> normalization : false , <nl> - backwards : false <nl> + backwards : false , <nl> + version : " 57 . 1 " , <nl> } ) ; <nl> <nl> coll . drop ( ) ; <nl> <nl> assert . commandFailed ( coll . ensureIndex ( { a : 1 } , { collation : { locale : " xx " } } ) ) ; <nl> assert . commandFailed ( coll . ensureIndex ( { a : 1 } , { collation : { locale : " en " , strength : 99 } } ) ) ; <nl> <nl> + / / Attempting to create an index whose collation version does not match the collator version <nl> + / / produced by ICU should result in failure with a special error code . <nl> + assert . commandFailedWithCode ( <nl> + coll . ensureIndex ( { a : 1 } , { collation : { locale : " en " , version : " unknownVersion " } } ) , <nl> + ErrorCodes . IncompatibleCollationVersion ) ; <nl> + <nl> assert . commandWorked ( coll . ensureIndex ( { a : 1 } , { collation : { locale : " en_US " } } ) ) ; <nl> assertIndexHasCollation ( { a : 1 } , { <nl> locale : " en_US " , <nl> <nl> alternate : " non - ignorable " , <nl> maxVariable : " punct " , <nl> normalization : false , <nl> - backwards : false <nl> + backwards : false , <nl> + version : " 57 . 1 " , <nl> } ) ; <nl> <nl> assert . commandWorked ( coll . createIndex ( { b : 1 } , { collation : { locale : " en_US " } } ) ) ; <nl> <nl> alternate : " non - ignorable " , <nl> maxVariable : " punct " , <nl> normalization : false , <nl> - backwards : false <nl> + backwards : false , <nl> + version : " 57 . 1 " , <nl> } ) ; <nl> <nl> assert . commandWorked ( coll . createIndexes ( [ { c : 1 } , { d : 1 } ] , { collation : { locale : " fr_CA " } } ) ) ; <nl> <nl> alternate : " non - ignorable " , <nl> maxVariable : " punct " , <nl> normalization : false , <nl> - backwards : true <nl> + backwards : true , <nl> + version : " 57 . 1 " , <nl> } ) ; <nl> assertIndexHasCollation ( { d : 1 } , { <nl> locale : " fr_CA " , <nl> <nl> alternate : " non - ignorable " , <nl> maxVariable : " punct " , <nl> normalization : false , <nl> - backwards : true <nl> + backwards : true , <nl> + version : " 57 . 1 " , <nl> } ) ; <nl> <nl> assert . commandWorked ( coll . createIndexes ( [ { e : 1 } ] , { collation : { locale : " simple " } } ) ) ; <nl> mmm a / src / mongo / base / error_codes . err <nl> ppp b / src / mongo / base / error_codes . err <nl> error_code ( " CanRepairToDowngrade " , 157 ) <nl> error_code ( " MustUpgrade " , 158 ) <nl> error_code ( " DurationOverflow " , 159 ) <nl> error_code ( " MaxStalenessOutOfRange " , 160 ) <nl> + error_code ( " IncompatibleCollationVersion " , 161 ) <nl> <nl> # Non - sequential error codes ( for compatibility only ) <nl> error_code ( " SocketException " , 9001 ) <nl> mmm a / src / mongo / db / catalog / collection . cpp <nl> ppp b / src / mongo / db / catalog / collection . cpp <nl> Status checkValidatorForBannedExpressions ( const BSONObj & validator ) { <nl> } <nl> <nl> / / Uses the collator factory to convert the BSON representation of a collator to a <nl> - / / CollatorInterface . Returns null if the BSONObj is empty . Returns a non - OK status if the collation <nl> - / / fails to parse . <nl> - StatusWith < std : : unique_ptr < CollatorInterface > > parseCollation ( OperationContext * txn , <nl> - BSONObj collationSpec ) { <nl> + / / CollatorInterface . Returns null if the BSONObj is empty . We expect the stored collation to be <nl> + / / valid , since it gets validated on collection create . <nl> + std : : unique_ptr < CollatorInterface > parseCollation ( OperationContext * txn , <nl> + const NamespaceString & nss , <nl> + BSONObj collationSpec ) { <nl> if ( collationSpec . isEmpty ( ) ) { <nl> return { nullptr } ; <nl> } <nl> <nl> - return CollatorFactoryInterface : : get ( txn - > getServiceContext ( ) ) - > makeFromBSON ( collationSpec ) ; <nl> + auto collator = <nl> + CollatorFactoryInterface : : get ( txn - > getServiceContext ( ) ) - > makeFromBSON ( collationSpec ) ; <nl> + <nl> + / / If the collection ' s default collator has a version not currently supported by our ICU <nl> + / / integration , shut down the server . Errors other than IncompatibleCollationVersion should not <nl> + / / be possible , so these are an invariant rather than fassert . <nl> + if ( collator = = ErrorCodes : : IncompatibleCollationVersion ) { <nl> + log ( ) < < " Collection " < < nss <nl> + < < " has a default collation which is incompatible with this version : " <nl> + < < collationSpec ; <nl> + fassertFailedNoTrace ( 40144 ) ; <nl> + } <nl> + invariantOK ( collator . getStatus ( ) ) ; <nl> + <nl> + return std : : move ( collator . getValue ( ) ) ; <nl> } <nl> } <nl> <nl> Collection : : Collection ( OperationContext * txn , <nl> _needCappedLock ( supportsDocLocking ( ) & & _recordStore - > isCapped ( ) & & _ns . db ( ) ! = " local " ) , <nl> _infoCache ( this ) , <nl> _indexCatalog ( this ) , <nl> - _collator ( <nl> - uassertStatusOK ( parseCollation ( txn , _details - > getCollectionOptions ( txn ) . collation ) ) ) , <nl> + _collator ( parseCollation ( txn , _ns , _details - > getCollectionOptions ( txn ) . collation ) ) , <nl> _validatorDoc ( _details - > getCollectionOptions ( txn ) . validator . getOwned ( ) ) , <nl> _validator ( uassertStatusOK ( parseValidator ( _validatorDoc ) ) ) , <nl> _validationAction ( uassertStatusOK ( <nl> mmm a / src / mongo / db / catalog / index_catalog_entry . cpp <nl> ppp b / src / mongo / db / catalog / index_catalog_entry . cpp <nl> IndexCatalogEntry : : IndexCatalogEntry ( OperationContext * txn , <nl> BSONObj collation = collationElement . Obj ( ) ; <nl> auto statusWithCollator = <nl> CollatorFactoryInterface : : get ( txn - > getServiceContext ( ) ) - > makeFromBSON ( collation ) ; <nl> + <nl> + / / Index spec should have already been validated . <nl> invariantOK ( statusWithCollator . getStatus ( ) ) ; <nl> + <nl> _collator = std : : move ( statusWithCollator . getValue ( ) ) ; <nl> } <nl> <nl> mmm a / src / mongo / db / query / collation / collation_serializer . cpp <nl> ppp b / src / mongo / db / query / collation / collation_serializer . cpp <nl> BSONObj CollationSerializer : : specToBSON ( const CollationSpec & spec ) { <nl> <nl> builder . append ( CollationSpec : : kNormalizationField , spec . normalization ) ; <nl> builder . append ( CollationSpec : : kBackwardsField , spec . backwards ) ; <nl> + builder . append ( CollationSpec : : kVersionField , spec . version ) ; <nl> return builder . obj ( ) ; <nl> } <nl> <nl> mmm a / src / mongo / db / query / collation / collation_serializer_test . cpp <nl> ppp b / src / mongo / db / query / collation / collation_serializer_test . cpp <nl> using namespace mongo ; <nl> TEST ( CollationSerializerTest , ToBSONCorrectlySerializesDefaults ) { <nl> CollationSpec collationSpec ; <nl> collationSpec . localeID = " myLocale " ; <nl> + collationSpec . version = " myVersion " ; <nl> <nl> BSONObj expectedObj = BSON ( " locale " <nl> < < " myLocale " <nl> TEST ( CollationSerializerTest , ToBSONCorrectlySerializesDefaults ) { <nl> < < " normalization " <nl> < < false <nl> < < " backwards " <nl> - < < false ) ; <nl> + < < false <nl> + < < " version " <nl> + < < " myVersion " ) ; <nl> <nl> ASSERT_EQ ( expectedObj , CollationSerializer : : specToBSON ( collationSpec ) ) ; <nl> } <nl> TEST ( CollationSerializerTest , ToBSONCorrectlySerializesDefaults ) { <nl> TEST ( CollationSerializerTest , ToBSONCorrectlySerializesCaseFirstUpper ) { <nl> CollationSpec collationSpec ; <nl> collationSpec . localeID = " myLocale " ; <nl> + collationSpec . version = " myVersion " ; <nl> collationSpec . caseFirst = CollationSpec : : CaseFirstType : : kUpper ; <nl> <nl> BSONObj expectedObj = BSON ( " locale " <nl> TEST ( CollationSerializerTest , ToBSONCorrectlySerializesCaseFirstUpper ) { <nl> < < " normalization " <nl> < < false <nl> < < " backwards " <nl> - < < false ) ; <nl> + < < false <nl> + < < " version " <nl> + < < " myVersion " ) ; <nl> <nl> ASSERT_EQ ( expectedObj , CollationSerializer : : specToBSON ( collationSpec ) ) ; <nl> } <nl> TEST ( CollationSerializerTest , ToBSONCorrectlySerializesCaseFirstUpper ) { <nl> TEST ( CollationSerializerTest , ToBSONCorrectlySerializesCaseFirstLower ) { <nl> CollationSpec collationSpec ; <nl> collationSpec . localeID = " myLocale " ; <nl> + collationSpec . version = " myVersion " ; <nl> collationSpec . caseFirst = CollationSpec : : CaseFirstType : : kLower ; <nl> <nl> BSONObj expectedObj = BSON ( " locale " <nl> TEST ( CollationSerializerTest , ToBSONCorrectlySerializesCaseFirstLower ) { <nl> < < " normalization " <nl> < < false <nl> < < " backwards " <nl> - < < false ) ; <nl> + < < false <nl> + < < " version " <nl> + < < " myVersion " ) ; <nl> <nl> ASSERT_EQ ( expectedObj , CollationSerializer : : specToBSON ( collationSpec ) ) ; <nl> } <nl> TEST ( CollationSerializerTest , ToBSONCorrectlySerializesCaseFirstLower ) { <nl> TEST ( CollationSerializerTest , ToBSONCorrectlySerializesPrimaryStrength ) { <nl> CollationSpec collationSpec ; <nl> collationSpec . localeID = " myLocale " ; <nl> + collationSpec . version = " myVersion " ; <nl> collationSpec . strength = CollationSpec : : StrengthType : : kPrimary ; <nl> <nl> BSONObj expectedObj = BSON ( " locale " <nl> TEST ( CollationSerializerTest , ToBSONCorrectlySerializesPrimaryStrength ) { <nl> < < " normalization " <nl> < < false <nl> < < " backwards " <nl> - < < false ) ; <nl> + < < false <nl> + < < " version " <nl> + < < " myVersion " ) ; <nl> <nl> ASSERT_EQ ( expectedObj , CollationSerializer : : specToBSON ( collationSpec ) ) ; <nl> } <nl> TEST ( CollationSerializerTest , ToBSONCorrectlySerializesPrimaryStrength ) { <nl> TEST ( CollationSerializerTest , ToBSONCorrectlySerializesSecondaryStrength ) { <nl> CollationSpec collationSpec ; <nl> collationSpec . localeID = " myLocale " ; <nl> + collationSpec . version = " myVersion " ; <nl> collationSpec . strength = CollationSpec : : StrengthType : : kSecondary ; <nl> <nl> BSONObj expectedObj = BSON ( " locale " <nl> TEST ( CollationSerializerTest , ToBSONCorrectlySerializesSecondaryStrength ) { <nl> < < " normalization " <nl> < < false <nl> < < " backwards " <nl> - < < false ) ; <nl> + < < false <nl> + < < " version " <nl> + < < " myVersion " ) ; <nl> <nl> ASSERT_EQ ( expectedObj , CollationSerializer : : specToBSON ( collationSpec ) ) ; <nl> } <nl> TEST ( CollationSerializerTest , ToBSONCorrectlySerializesSecondaryStrength ) { <nl> TEST ( CollationSerializerTest , ToBSONCorrectlySerializesQuaternaryStrength ) { <nl> CollationSpec collationSpec ; <nl> collationSpec . localeID = " myLocale " ; <nl> + collationSpec . version = " myVersion " ; <nl> collationSpec . strength = CollationSpec : : StrengthType : : kQuaternary ; <nl> <nl> BSONObj expectedObj = BSON ( " locale " <nl> TEST ( CollationSerializerTest , ToBSONCorrectlySerializesQuaternaryStrength ) { <nl> < < " normalization " <nl> < < false <nl> < < " backwards " <nl> - < < false ) ; <nl> + < < false <nl> + < < " version " <nl> + < < " myVersion " ) ; <nl> <nl> ASSERT_EQ ( expectedObj , CollationSerializer : : specToBSON ( collationSpec ) ) ; <nl> } <nl> TEST ( CollationSerializerTest , ToBSONCorrectlySerializesQuaternaryStrength ) { <nl> TEST ( CollationSerializerTest , ToBSONCorrectlySerializesIdenticalStrength ) { <nl> CollationSpec collationSpec ; <nl> collationSpec . localeID = " myLocale " ; <nl> + collationSpec . version = " myVersion " ; <nl> collationSpec . strength = CollationSpec : : StrengthType : : kIdentical ; <nl> <nl> BSONObj expectedObj = BSON ( " locale " <nl> TEST ( CollationSerializerTest , ToBSONCorrectlySerializesIdenticalStrength ) { <nl> < < " normalization " <nl> < < false <nl> < < " backwards " <nl> - < < false ) ; <nl> + < < false <nl> + < < " version " <nl> + < < " myVersion " ) ; <nl> <nl> ASSERT_EQ ( expectedObj , CollationSerializer : : specToBSON ( collationSpec ) ) ; <nl> } <nl> TEST ( CollationSerializerTest , ToBSONCorrectlySerializesIdenticalStrength ) { <nl> TEST ( CollationSerializerTest , ToBSONCorrectlySerializesAlternateShifted ) { <nl> CollationSpec collationSpec ; <nl> collationSpec . localeID = " myLocale " ; <nl> + collationSpec . version = " myVersion " ; <nl> collationSpec . alternate = CollationSpec : : AlternateType : : kShifted ; <nl> <nl> BSONObj expectedObj = BSON ( " locale " <nl> TEST ( CollationSerializerTest , ToBSONCorrectlySerializesAlternateShifted ) { <nl> < < " normalization " <nl> < < false <nl> < < " backwards " <nl> - < < false ) ; <nl> + < < false <nl> + < < " version " <nl> + < < " myVersion " ) ; <nl> <nl> ASSERT_EQ ( expectedObj , CollationSerializer : : specToBSON ( collationSpec ) ) ; <nl> } <nl> TEST ( CollationSerializerTest , ToBSONCorrectlySerializesAlternateShifted ) { <nl> TEST ( CollationSerializerTest , ToBSONCorrectlySerializesMaxVariableSpace ) { <nl> CollationSpec collationSpec ; <nl> collationSpec . localeID = " myLocale " ; <nl> + collationSpec . version = " myVersion " ; <nl> collationSpec . maxVariable = CollationSpec : : MaxVariableType : : kSpace ; <nl> <nl> BSONObj expectedObj = BSON ( " locale " <nl> TEST ( CollationSerializerTest , ToBSONCorrectlySerializesMaxVariableSpace ) { <nl> < < " normalization " <nl> < < false <nl> < < " backwards " <nl> - < < false ) ; <nl> + < < false <nl> + < < " version " <nl> + < < " myVersion " ) ; <nl> <nl> ASSERT_EQ ( expectedObj , CollationSerializer : : specToBSON ( collationSpec ) ) ; <nl> } <nl> mmm a / src / mongo / db / query / collation / collation_spec . cpp <nl> ppp b / src / mongo / db / query / collation / collation_spec . cpp <nl> const char * CollationSpec : : kAlternateField = " alternate " ; <nl> const char * CollationSpec : : kMaxVariableField = " maxVariable " ; <nl> const char * CollationSpec : : kNormalizationField = " normalization " ; <nl> const char * CollationSpec : : kBackwardsField = " backwards " ; <nl> + const char * CollationSpec : : kVersionField = " version " ; <nl> const char * CollationSpec : : kSimpleBinaryComparison = " simple " ; <nl> const char * CollationSpec : : kCaseFirstUpper = " upper " ; <nl> const char * CollationSpec : : kCaseFirstLower = " lower " ; <nl> mmm a / src / mongo / db / query / collation / collation_spec . h <nl> ppp b / src / mongo / db / query / collation / collation_spec . h <nl> struct CollationSpec { <nl> static const char * kMaxVariableField ; <nl> static const char * kNormalizationField ; <nl> static const char * kBackwardsField ; <nl> + static const char * kVersionField ; <nl> <nl> / / Field value constants . <nl> static const char * kSimpleBinaryComparison ; <nl> struct CollationSpec { <nl> * Constructs a CollationSpec for the given locale , where all other fields have their default <nl> * values . <nl> * / <nl> - CollationSpec ( std : : string locale ) : localeID ( std : : move ( locale ) ) { } <nl> + CollationSpec ( std : : string locale , std : : string version ) <nl> + : localeID ( std : : move ( locale ) ) , version ( std : : move ( version ) ) { } <nl> <nl> / / A string such as " en_US " , identifying the language , country , or other attributes of the <nl> / / locale for this collation . <nl> struct CollationSpec { <nl> / / Causes accent differences to be considered in reverse order , as it is done in the French <nl> / / language . <nl> bool backwards = false ; <nl> + <nl> + / / Indicates the version of the collator . It is used to ensure that we do not mix versions by , <nl> + / / for example , constructing an index with one version of ICU and then attempting to use this <nl> + / / index with a server that is built against a newer ICU version . <nl> + std : : string version ; <nl> } ; <nl> <nl> / * * <nl> inline bool operator = = ( const CollationSpec & left , const CollationSpec & right ) { <nl> ( left . caseFirst = = right . caseFirst ) & & ( left . strength = = right . strength ) & & <nl> ( left . numericOrdering = = right . numericOrdering ) & & <nl> ( left . alternate = = right . alternate ) & & ( left . maxVariable = = right . maxVariable ) & & <nl> - ( left . normalization = = right . normalization ) & & ( left . backwards = = right . backwards ) ) ; <nl> + ( left . normalization = = right . normalization ) & & ( left . backwards = = right . backwards ) & & <nl> + ( left . version = = right . version ) ) ; <nl> } <nl> <nl> inline bool operator ! = ( const CollationSpec & left , const CollationSpec & right ) { <nl> mmm a / src / mongo / db / query / collation / collation_spec_test . cpp <nl> ppp b / src / mongo / db / query / collation / collation_spec_test . cpp <nl> TEST ( CollationSpecTest , SpecsWithNonEqualBackwardsValuesAreNotEqual ) { <nl> ASSERT_TRUE ( collationSpec1 ! = collationSpec2 ) ; <nl> } <nl> <nl> + TEST ( CollationSpecTest , SpecsWithNonEqualVersionValuesAreNotEqual ) { <nl> + CollationSpec collationSpec1 ; <nl> + collationSpec1 . localeID = " fr " ; <nl> + collationSpec1 . version = " version1 " ; <nl> + <nl> + CollationSpec collationSpec2 ; <nl> + collationSpec2 . localeID = " fr " ; <nl> + collationSpec2 . version = " version2 " ; <nl> + <nl> + ASSERT_FALSE ( collationSpec1 = = collationSpec2 ) ; <nl> + ASSERT_TRUE ( collationSpec1 ! = collationSpec2 ) ; <nl> + } <nl> + <nl> TEST ( CollationSpecTest , EqualSpecs ) { <nl> CollationSpec collationSpec1 ; <nl> collationSpec1 . localeID = " fr " ; <nl> mmm a / src / mongo / db / query / collation / collator_factory_icu . cpp <nl> ppp b / src / mongo / db / query / collation / collator_factory_icu . cpp <nl> <nl> # include < unicode / coll . h > <nl> # include < unicode / errorcode . h > <nl> # include < unicode / ucol . h > <nl> + # include < unicode / uvernum . h > <nl> <nl> # include " mongo / bson / bsonobj . h " <nl> # include " mongo / bson / util / bson_extract . h " <nl> StatusWith < CollationSpec > parseToCollationSpec ( const BSONObj & spec , <nl> } <nl> } <nl> <nl> + / / Populate the spec with the ICU version information . <nl> + parsedSpec . version = U_ICU_VERSION ; <nl> + <nl> + / / Parse the version string , if present in the spec . If the version string does not match the <nl> + / / ICU version currently in use we must return an " IncompatibleCollationVersion " error . <nl> + std : : string specVersionStr ; <nl> + parseStatus = bsonExtractStringField ( spec , CollationSpec : : kVersionField , & specVersionStr ) ; <nl> + if ( parseStatus = = ErrorCodes : : NoSuchKey ) { <nl> + / / The BSON spec does not have any particular version . We ' ve already populated it with the <nl> + / / ICU version string above . <nl> + invariant ( ! parsedSpec . version . empty ( ) ) ; <nl> + } else if ( ! parseStatus . isOK ( ) ) { <nl> + return parseStatus ; <nl> + } else { <nl> + if ( specVersionStr ! = parsedSpec . version ) { <nl> + return { ErrorCodes : : IncompatibleCollationVersion , <nl> + str : : stream ( ) < < " Requested collation version " < < specVersionStr <nl> + < < " but the only available collator version was " <nl> + < < parsedSpec . version <nl> + < < " . Requested collation spec : " <nl> + < < spec } ; <nl> + } <nl> + <nl> + + + parsedFields ; <nl> + } <nl> + <nl> / / Check for unknown fields . <nl> invariant ( parsedFields < = spec . nFields ( ) ) ; <nl> if ( parsedFields < spec . nFields ( ) ) { <nl> mmm a / src / mongo / db / query / collation / collator_factory_icu_test . cpp <nl> ppp b / src / mongo / db / query / collation / collator_factory_icu_test . cpp <nl> TEST ( CollatorFactoryICUTest , NonBoolBackwardsFieldFailsToParse ) { <nl> ASSERT_EQ ( collator . getStatus ( ) , ErrorCodes : : TypeMismatch ) ; <nl> } <nl> <nl> + TEST ( CollatorFactoryICUTest , VersionFieldParsesSuccessfully ) { <nl> + CollatorFactoryICU factory ; <nl> + auto collator = factory . makeFromBSON ( BSON ( " locale " <nl> + < < " en_US " <nl> + < < " version " <nl> + < < " 57 . 1 " ) ) ; <nl> + ASSERT_OK ( collator . getStatus ( ) ) ; <nl> + ASSERT_EQ ( " 57 . 1 " , collator . getValue ( ) - > getSpec ( ) . version ) ; <nl> + } <nl> + <nl> + TEST ( CollatorFactoryICUTest , VersionFieldPopulatedWhenOmitted ) { <nl> + CollatorFactoryICU factory ; <nl> + auto collator = factory . makeFromBSON ( BSON ( " locale " <nl> + < < " en_US " ) ) ; <nl> + ASSERT_OK ( collator . getStatus ( ) ) ; <nl> + ASSERT_EQ ( " 57 . 1 " , collator . getValue ( ) - > getSpec ( ) . version ) ; <nl> + } <nl> + <nl> + TEST ( CollatorFactoryICUTest , NonStringVersionFieldFailsToParse ) { <nl> + CollatorFactoryICU factory ; <nl> + auto collator = factory . makeFromBSON ( BSON ( " locale " <nl> + < < " en_US " <nl> + < < " version " <nl> + < < 3 ) ) ; <nl> + ASSERT_NOT_OK ( collator . getStatus ( ) ) ; <nl> + ASSERT_EQ ( collator . getStatus ( ) , ErrorCodes : : TypeMismatch ) ; <nl> + } <nl> + <nl> + TEST ( CollatorFactoryICUTest , UnknownCollatorVersionResultsInIncompatibleCollationVersionError ) { <nl> + CollatorFactoryICU factory ; <nl> + auto collator = factory . makeFromBSON ( BSON ( " locale " <nl> + < < " en_US " <nl> + < < " version " <nl> + < < " unknownVersion " ) ) ; <nl> + ASSERT_NOT_OK ( collator . getStatus ( ) ) ; <nl> + ASSERT_EQ ( collator . getStatus ( ) , ErrorCodes : : IncompatibleCollationVersion ) ; <nl> + } <nl> + <nl> TEST ( CollatorFactoryICUTest , FactoryMadeCollatorComparesStringsCorrectlyEnUS ) { <nl> CollatorFactoryICU factory ; <nl> auto collator = factory . makeFromBSON ( BSON ( " locale " <nl> mmm a / src / mongo / db / query / collation / collator_factory_interface . h <nl> ppp b / src / mongo / db / query / collation / collator_factory_interface . h <nl> class CollatorFactoryInterface { <nl> * <nl> * Returns a non - OK status if ' spec ' is invalid or otherwise cannot be converted into a <nl> * collator . <nl> + * <nl> + * Returns ErrorCodes : : IncompatibleCollationVersion if the collator version does not match the <nl> + * version requested in ' spec ' . <nl> * / <nl> virtual StatusWith < std : : unique_ptr < CollatorInterface > > makeFromBSON ( const BSONObj & spec ) = 0 ; <nl> } ; <nl> mmm a / src / mongo / db / query / collation / collator_interface_mock . cpp <nl> ppp b / src / mongo / db / query / collation / collator_interface_mock . cpp <nl> std : : string mockTypeToString ( CollatorInterfaceMock : : MockType type ) { <nl> } / / namespace <nl> <nl> CollatorInterfaceMock : : CollatorInterfaceMock ( MockType mockType ) <nl> - : CollatorInterface ( CollationSpec ( mockTypeToString ( mockType ) ) ) , _mockType ( mockType ) { } <nl> + : CollatorInterface ( CollationSpec ( mockTypeToString ( mockType ) , " mock_version " ) ) , <nl> + _mockType ( mockType ) { } <nl> <nl> std : : unique_ptr < CollatorInterface > CollatorInterfaceMock : : clone ( ) const { <nl> auto clone = stdx : : make_unique < CollatorInterfaceMock > ( _mockType ) ; <nl> mmm a / src / mongo / db / query / collation / collator_interface_mock_test . cpp <nl> ppp b / src / mongo / db / query / collation / collator_interface_mock_test . cpp <nl> TEST ( CollatorInterfaceMockSelfTest , WoCompareNumbersWithMockCollator ) { <nl> ASSERT_LT ( left . woCompare ( right , BSONObj ( ) , true , & collator ) , 0 ) ; <nl> ASSERT_GT ( right . woCompare ( left , BSONObj ( ) , true , & collator ) , 0 ) ; <nl> } <nl> + <nl> + TEST ( CollatorInterfaceMockSelfTest , MockCollatorReportsMockVersionString ) { <nl> + CollatorInterfaceMock reverseCollator ( CollatorInterfaceMock : : MockType : : kReverseString ) ; <nl> + CollatorInterfaceMock alwaysEqualCollator ( CollatorInterfaceMock : : MockType : : kAlwaysEqual ) ; <nl> + ASSERT_EQ ( reverseCollator . getSpec ( ) . version , " mock_version " ) ; <nl> + ASSERT_EQ ( alwaysEqualCollator . getSpec ( ) . version , " mock_version " ) ; <nl> + } <nl> } ; <nl>
|
SERVER - 24183 persist collation version string in catalog metadata
|
mongodb/mongo
|
72b444d2831f018f3ae27219d07c69e6a3a60213
|
2016-06-10T22:43:23Z
|
mmm a / tensorflow / contrib / slim / python / slim / evaluation . py <nl> ppp b / tensorflow / contrib / slim / python / slim / evaluation . py <nl> def evaluation_loop ( master , <nl> eval_interval_secs = 60 , <nl> max_number_of_evaluations = None , <nl> session_config = None , <nl> - timeout = None ) : <nl> + timeout = None , <nl> + hooks = None ) : <nl> " " " Runs TF - Slim ' s Evaluation Loop . <nl> <nl> Args : <nl> def evaluation_loop ( master , <nl> configure the ` Session ` . If left as ` None ` , the default will be used . <nl> timeout : The maximum amount of time to wait between checkpoints . If left as <nl> ` None ` , then the process will wait indefinitely . <nl> + hooks : A list of additional SessionRunHook objects to pass during <nl> + repeated evaluations . <nl> <nl> Returns : <nl> The value of ` final_op ` or ` None ` if ` final_op ` is ` None ` . <nl> def evaluation_loop ( master , <nl> if summary_op = = _USE_DEFAULT : <nl> summary_op = summary . merge_all ( ) <nl> <nl> - hooks = [ evaluation . StopAfterNEvalsHook ( num_evals ) , ] <nl> + all_hooks = [ evaluation . StopAfterNEvalsHook ( num_evals ) , ] <nl> <nl> if summary_op is not None : <nl> - hooks . append ( evaluation . SummaryAtEndHook ( <nl> + all_hooks . append ( evaluation . SummaryAtEndHook ( <nl> log_dir = logdir , summary_op = summary_op , feed_dict = summary_op_feed_dict ) ) <nl> <nl> + if hooks is not None : <nl> + # Add custom hooks if provided . <nl> + all_hooks . extend ( hooks ) <nl> + <nl> saver = None <nl> if variables_to_restore is not None : <nl> saver = tf_saver . Saver ( variables_to_restore ) <nl> def evaluation_loop ( master , <nl> final_ops = final_op , <nl> final_ops_feed_dict = final_op_feed_dict , <nl> eval_interval_secs = eval_interval_secs , <nl> - hooks = hooks , <nl> + hooks = all_hooks , <nl> config = session_config , <nl> max_number_of_evaluations = max_number_of_evaluations , <nl> timeout = timeout ) <nl> mmm a / tensorflow / contrib / slim / python / slim / evaluation_test . py <nl> ppp b / tensorflow / contrib / slim / python / slim / evaluation_test . py <nl> <nl> from tensorflow . python . summary import summary_iterator <nl> from tensorflow . python . training import input <nl> from tensorflow . python . training import saver as saver_lib <nl> + from tensorflow . python . training import session_run_hook <nl> + <nl> <nl> FLAGS = flags . FLAGS <nl> <nl> def testFinalOpsOnEvaluationLoop ( self ) : <nl> init_op . run ( ) <nl> saver . save ( sess , os . path . join ( chkpt_dir , ' chkpt ' ) ) <nl> <nl> + class Object ( object ) : <nl> + <nl> + def __init__ ( self ) : <nl> + self . hook_was_run = False <nl> + <nl> + obj = Object ( ) <nl> + <nl> + # Create a custom session run hook . <nl> + class CustomHook ( session_run_hook . SessionRunHook ) : <nl> + <nl> + def __init__ ( self , obj ) : <nl> + self . obj = obj <nl> + <nl> + def end ( self , session ) : <nl> + self . obj . hook_was_run = True <nl> + <nl> # Now , run the evaluation loop : <nl> accuracy_value = evaluation . evaluation_loop ( <nl> ' ' , <nl> def testFinalOpsOnEvaluationLoop ( self ) : <nl> logdir , <nl> eval_op = update_op , <nl> final_op = value_op , <nl> + hooks = [ CustomHook ( obj ) ] , <nl> max_number_of_evaluations = 1 ) <nl> self . assertAlmostEqual ( accuracy_value , self . _expected_accuracy ) <nl> <nl> + # Validate that custom hook ran . <nl> + self . assertTrue ( obj . hook_was_run ) <nl> + <nl> def _create_names_to_metrics ( self , predictions , labels ) : <nl> accuracy0 , update_op0 = metric_ops . streaming_accuracy ( predictions , labels ) <nl> accuracy1 , update_op1 = metric_ops . streaming_accuracy ( predictions + 1 , <nl>
|
Allow passing custom hooks to ' evaluation_loop ' .
|
tensorflow/tensorflow
|
740053be5054027bc66c7995c045d40b07479943
|
2017-04-11T18:59:06Z
|
mmm a / test / interface / artificial_table . py <nl> ppp b / test / interface / artificial_table . py <nl> <nl> <nl> conn = r . connect ( host = server . host , port = server . driver_port ) <nl> <nl> + # note : these tests are impicitly run in sequence because of the - - table option <nl> + <nl> command_line = [ <nl> - os . path . abspath ( os . path . join ( os . path . dirname ( __file__ ) , os . path . pardir , ' rql_test ' , ' test - runner ' ) ) , <nl> + os . path . join ( os . path . dirname ( os . path . abspath ( __file__ ) ) , os . path . pardir , ' rql_test ' , ' test - runner ' ) , <nl> ' - - cluster - port ' , str ( server . cluster_port ) , <nl> ' - - driver - port ' , str ( server . driver_port ) , <nl> ' - - table ' , ' rethinkdb . _debug_scratch ' ] <nl> <nl> <nl> print ( " Command line : " , " " . join ( command_line ) ) <nl> print ( " Running the QL test ( % . 2fs ) " % ( time . time ( ) - startTime ) ) <nl> - with open ( " test - runner - log . txt " , " w " ) as f : <nl> - subprocess . check_call ( command_line , stdout = f , stderr = f ) <nl> + <nl> + print ( ' = = = = Start test - runner Output = = = = ' ) <nl> + subprocess . check_call ( command_line ) <nl> + print ( ' = = = = End test - runner Output = = = = ' ) <nl> <nl> print ( " Cleaning up ( % . 2fs ) " % ( time . time ( ) - startTime ) ) <nl> print ( " Done . ( % . 2fs ) " % ( time . time ( ) - startTime ) ) <nl> mmm a / test / rql_test / drivers / driver . js <nl> ppp b / test / rql_test / drivers / driver . js <nl> function setup_table ( table_variable_name , table_name , db_name ) { <nl> table = required_external_tables . pop ( ) ; <nl> defines [ table_variable_name ] = r . db ( table [ 0 ] ) . table ( table [ 1 ] ) ; <nl> tables_to_cleanup . push ( [ table [ 0 ] , table [ 1 ] ] ) <nl> - runTest ( ) ; <nl> + <nl> + / / check that the table exists <nl> + r . db ( table [ 0 ] ) . table ( table [ 1 ] ) . info ( ) . run ( reqlConn , function ( err , res ) { <nl> + if ( err ) { <nl> + unexpectedException ( " External table " + table [ 0 ] + " . " + table [ 1 ] + " did not exist " ) <nl> + } else { <nl> + runTest ( ) ; <nl> + } <nl> + } ) ; <nl> } else { <nl> / / create the table as provided <nl> <nl> mmm a / test / rql_test / drivers / driver . py <nl> ppp b / test / rql_test / drivers / driver . py <nl> def _clean_table ( table_name , db_name ) : <nl> r . db ( db_name ) . table ( table_name ) . index_list ( ) . for_each ( r . db ( db_name ) . table ( table_name ) . index_drop ( r . row ) ) . run ( driver . cpp_conn ) <nl> <nl> if len ( required_external_tables ) > 0 : <nl> - table_name , db_name = required_external_tables . pop ( ) <nl> - assert r . db ( db_name ) . table_list ( ) . set_intersection ( [ table_name ] ) . count ( ) . eq ( 1 ) . run ( driver . cpp_conn ) is True , ' External table % s . % s did not exist ' % ( db_name , table_name ) <nl> - atexit . register ( _clean_table , tableName = table_name , dbName = db_name ) <nl> + db_name , table_name = required_external_tables . pop ( ) <nl> + try : <nl> + r . db ( db_name ) . table ( table_name ) . info ( driver . cpp_conn ) <nl> + except r . RqlRuntimeError : <nl> + raise AssertionError ( ' External table % s . % s did not exist ' % ( db_name , table_name ) ) <nl> + atexit . register ( _clean_table , table_name = table_name , db_name = db_name ) <nl> <nl> print ( ' Using existing table : % s . % s , will be % s ' % ( db_name , table_name , table_variable_name ) ) <nl> else : <nl> mmm a / test / rql_test / drivers / driver . rb <nl> ppp b / test / rql_test / drivers / driver . rb <nl> def setup_table ( table_variable_name , table_name , db_name = " test " ) <nl> <nl> if $ required_external_tables . count > 0 <nl> # use one of the required tables <nl> - table_name , db_name = $ required_external_tables . pop <nl> - raise " External table # { db_name } . # { table_name } did not exist " unless r . db ( db_name ) . table_list ( ) . set_intersection ( [ table_name ] ) . count ( ) . eq ( 1 ) . run ( $ reql_conn ) <nl> + db_name , table_name = $ required_external_tables . pop <nl> + begin <nl> + r . db ( db_name ) . table ( table_name ) . info ( ) . run ( $ reql_conn ) <nl> + rescue RethinkDB : : RqlRuntimeError <nl> + " External table # { db_name } . # { table_name } did not exist " <nl> + end <nl> <nl> puts ( " Using existing table : # { db_name } . # { table_name } , will be : # { table_variable_name } " ) <nl> <nl> mmm a / test / rql_test / src / control . yaml <nl> ppp b / test / rql_test / src / control . yaml <nl> <nl> desc : Tests RQL control flow structures <nl> - table_variable_name : tbl <nl> + table_variable_name : tbl , tbl2 <nl> tests : <nl> <nl> - # Setup a second table <nl> - - cd : r . db ( ' test ' ) . table_create ( ' test2 ' ) <nl> - ot : partial ( { ' tables_created ' : 1 } ) <nl> - def : tbl2 = r . db ( ' test ' ) . table ( ' test2 ' ) <nl> - <nl> # # FunCall <nl> <nl> - py : " r . expr ( 1 ) . do ( lambda v : v * 2 ) " <nl> tests : <nl> <nl> - cd : r . expr ( 1 ) . do ( r . db ( ' test ' ) . table_create ( ' nested_table ' ) ) <nl> ot : partial ( { ' tables_created ' : 1 } ) <nl> - <nl> - # Cleanup <nl> - - cd : r . db ( ' test ' ) . table_drop ( ' test2 ' ) <nl> - ot : partial ( { ' tables_dropped ' : 1 } ) <nl> - <nl> - cd : r . db ( ' test ' ) . table_drop ( ' nested_table ' ) <nl> - ot : partial ( { ' tables_dropped ' : 1 } ) <nl> mmm a / test / rql_test / src / joins . yaml <nl> ppp b / test / rql_test / src / joins . yaml <nl> <nl> desc : Tests that manipulation data in tables <nl> - table_variable_name : tbl <nl> + table_variable_name : tbl , tbl2 , senders , receivers , messages <nl> tests : <nl> <nl> - # Set up some more tables <nl> - <nl> - - cd : r . db ( ' test ' ) . table_create ( ' test2 ' ) <nl> - ot : partial ( { ' tables_created ' : 1 } ) <nl> - def : tbl2 = r . db ( ' test ' ) . table ( ' test2 ' ) <nl> + # Setup some more tables <nl> <nl> - py : r . db ( ' test ' ) . table_create ( ' test3 ' , primary_key = ' foo ' ) <nl> rb : r . db ( ' test ' ) . table_create ( ' test3 ' , { : primary_key = > ' foo ' } ) <nl> js : r . db ( ' test ' ) . tableCreate ( ' test3 ' , { ' primaryKey ' : ' foo ' } ) <nl> ot : partial ( { ' tables_created ' : 1 } ) <nl> - def : tbl3 = r . db ( ' test ' ) . table ( ' test3 ' ) <nl> - <nl> - - py : tbl . insert ( [ { ' id ' : i , ' a ' : i % 4 } for i in xrange ( 100 ) ] ) <nl> - js : | <nl> - tbl . insert ( function ( ) { <nl> - var res = [ ] <nl> - for ( var i = 0 ; i < 100 ; i + + ) { <nl> - res . push ( { id : i , ' a ' : i % 4 } ) ; <nl> - } <nl> - return res ; <nl> - } ( ) ) <nl> - rb : tbl . insert ( ( 0 . . 99 ) . map { | i | { : id = > i , : a = > i % 4 } } ) <nl> - ot : ( { ' deleted ' : 0 . 0 , ' replaced ' : 0 . 0 , ' unchanged ' : 0 . 0 , ' errors ' : 0 . 0 , ' skipped ' : 0 . 0 , ' inserted ' : 100 } ) <nl> - <nl> - - py : tbl2 . insert ( [ { ' id ' : i , ' b ' : i % 4 } for i in xrange ( 100 ) ] ) <nl> - js : | <nl> - tbl2 . insert ( function ( ) { <nl> - var res = [ ] <nl> - for ( var i = 0 ; i < 100 ; i + + ) { <nl> - res . push ( { id : i , ' b ' : i % 4 } ) ; <nl> - } <nl> - return res ; <nl> - } ( ) ) <nl> - rb : tbl2 . insert ( ( 0 . . 99 ) . map { | i | { : id = > i , : b = > i % 4 } } ) <nl> - ot : ( { ' deleted ' : 0 . 0 , ' replaced ' : 0 . 0 , ' unchanged ' : 0 . 0 , ' errors ' : 0 . 0 , ' skipped ' : 0 . 0 , ' inserted ' : 100 } ) <nl> - <nl> - - py : tbl3 . insert ( [ { ' foo ' : i , ' b ' : i % 4 } for i in xrange ( 100 ) ] ) <nl> - js : | <nl> - tbl3 . insert ( function ( ) { <nl> - var res = [ ] <nl> - for ( var i = 0 ; i < 100 ; i + + ) { <nl> - res . push ( { foo : i , ' b ' : i % 4 } ) ; <nl> - } <nl> - return res ; <nl> - } ( ) ) <nl> - rb : tbl3 . insert ( ( 0 . . 99 ) . map { | i | { : foo = > i , : b = > i % 4 } } ) <nl> - ot : ( { ' deleted ' : 0 . 0 , ' replaced ' : 0 . 0 , ' unchanged ' : 0 . 0 , ' errors ' : 0 . 0 , ' skipped ' : 0 . 0 , ' inserted ' : 100 } ) <nl> + - def : tbl3 = r . db ( ' test ' ) . table ( ' test3 ' ) <nl> + <nl> + - py : tbl . insert ( r . range ( 0 , 100 ) . map ( { ' id ' : r . row , ' a ' : r . row % 4 } ) ) <nl> + rb : tbl . insert ( r . range ( 0 , 100 ) . map { | row | { ' id ' : row , a : row % 4 } } ) <nl> + js : tbl . insert ( r . range ( 0 , 100 ) . map ( function ( row ) { return { ' id ' : row , ' a ' : row . mod ( 4 ) } ; } ) ) <nl> + ot : partial ( { ' errors ' : 0 , ' inserted ' : 100 } ) <nl> + <nl> + - py : tbl2 . insert ( r . range ( 0 , 100 ) . map ( { ' id ' : r . row , ' b ' : r . row % 4 } ) ) <nl> + rb : tbl2 . insert ( r . range ( 0 , 100 ) . map { | row | { ' id ' : row , b : row % 4 } } ) <nl> + js : tbl2 . insert ( r . range ( 0 , 100 ) . map ( function ( row ) { return { ' id ' : row , ' b ' : row . mod ( 4 ) } ; } ) ) <nl> + ot : partial ( { ' errors ' : 0 , ' inserted ' : 100 } ) <nl> + <nl> + - py : tbl3 . insert ( r . range ( 0 , 100 ) . map ( { ' foo ' : r . row , ' b ' : r . row % 4 } ) ) <nl> + rb : tbl3 . insert ( r . range ( 0 , 100 ) . map { | row | { ' foo ' : row , b : row % 4 } } ) <nl> + js : tbl3 . insert ( r . range ( 0 , 100 ) . map ( function ( row ) { return { ' foo ' : row , ' b ' : row . mod ( 4 ) } ; } ) ) <nl> + ot : partial ( { ' errors ' : 0 , ' inserted ' : 100 } ) <nl> <nl> # Inner - Join <nl> + <nl> - def : <nl> py : ij = tbl . inner_join ( tbl2 , lambda x , y : x [ ' a ' ] = = y [ ' b ' ] ) . zip ( ) <nl> js : ij = tbl . innerJoin ( tbl2 , function ( x , y ) { return x ( ' a ' ) . eq ( y ( ' b ' ) ) ; } ) . zip ( ) <nl> tests : <nl> js : oj . filter ( function ( row ) { return row ( ' a ' ) . ne ( row ( ' b ' ) ) ; } ) . count ( ) <nl> rb : oj . filter { | row | row [ : a ] . ne row [ : b ] } . count <nl> ot : 0 <nl> - <nl> + <nl> # Eq - Join <nl> - cd : tbl . eq_join ( ' a ' , tbl2 ) . zip ( ) . count ( ) <nl> ot : 100 <nl> tests : <nl> rb : left . outer_join ( right ) { | lt , rt | lt [ : a ] . eq ( rt [ : b ] ) } . zip <nl> ot : [ { ' a ' : 1 } , { ' a ' : 2 , ' b ' : 2 } , { ' a ' : 3 , ' b ' : 3 } ] <nl> <nl> - - rb : r . table_create ( ' senders ' ) <nl> - ot : partial ( { ' tables_created ' : 1 } ) <nl> - - rb : r . table_create ( ' receivers ' ) <nl> - ot : partial ( { ' tables_created ' : 1 } ) <nl> - - rb : r . table_create ( ' messages ' ) <nl> - ot : partial ( { ' tables_created ' : 1 } ) <nl> - <nl> - - rb : r . table ( ' senders ' ) . insert ( { id : 1 , sender : ' Sender One ' } ) [ ' inserted ' ] <nl> + - rb : senders . insert ( { id : 1 , sender : ' Sender One ' } ) [ ' inserted ' ] <nl> ot : 1 <nl> - - rb : r . table ( ' receivers ' ) . insert ( { id : 1 , receiver : ' Receiver One ' } ) [ ' inserted ' ] <nl> + - rb : receivers . insert ( { id : 1 , receiver : ' Receiver One ' } ) [ ' inserted ' ] <nl> ot : 1 <nl> - - rb : r . table ( ' messages ' ) . insert ( [ { id : 10 , sender_id : 1 , receiver_id : 1 , msg : ' Message One ' } , { id : 20 , sender_id : 1 , receiver_id : 1 , msg : ' Message Two ' } , { id : 30 , sender_id : 1 , receiver_id : 1 , msg : ' Message Three ' } ] ) [ ' inserted ' ] <nl> + - rb : messages . insert ( [ { id : 10 , sender_id : 1 , receiver_id : 1 , msg : ' Message One ' } , { id : 20 , sender_id : 1 , receiver_id : 1 , msg : ' Message Two ' } , { id : 30 , sender_id : 1 , receiver_id : 1 , msg : ' Message Three ' } ] ) [ ' inserted ' ] <nl> ot : 3 <nl> <nl> - - rb : r . table ( ' messages ' ) . orderby ( index : ' id ' ) . eq_join ( ' sender_id ' , r . table ( ' senders ' ) ) . without ( { right : { id : true } } ) . zip . eq_join ( ' receiver_id ' , r . table ( ' receivers ' ) ) . without ( { right : { id : true } } ) . zip <nl> + - rb : messages . orderby ( index : ' id ' ) . eq_join ( ' sender_id ' , senders ) . without ( { right : { id : true } } ) . zip . eq_join ( ' receiver_id ' , receivers ) . without ( { right : { id : true } } ) . zip <nl> ot : [ { ' id ' : 10 , ' msg ' : ' Message One ' , ' receiver ' : ' Receiver One ' , ' receiver_id ' : 1 , ' sender ' : ' Sender One ' , ' sender_id ' : 1 } , { ' id ' : 20 , ' msg ' : ' Message Two ' , ' receiver ' : ' Receiver One ' , ' receiver_id ' : 1 , ' sender ' : ' Sender One ' , ' sender_id ' : 1 } , { ' id ' : 30 , ' msg ' : ' Message Three ' , ' receiver ' : ' Receiver One ' , ' receiver_id ' : 1 , ' sender ' : ' Sender One ' , ' sender_id ' : 1 } ] <nl> <nl> # Clean up <nl> - - cd : r . db ( ' test ' ) . table_drop ( ' test2 ' ) <nl> - ot : partial ( { ' tables_dropped ' : 1 } ) <nl> + <nl> - cd : r . db ( ' test ' ) . table_drop ( ' test3 ' ) <nl> ot : partial ( { ' tables_dropped ' : 1 } ) <nl> - - rb : r . db ( ' test ' ) . table_drop ( ' senders ' ) <nl> - ot : partial ( { ' tables_dropped ' : 1 } ) <nl> - - rb : r . db ( ' test ' ) . table_drop ( ' messages ' ) <nl> - ot : partial ( { ' tables_dropped ' : 1 } ) <nl> - - rb : r . db ( ' test ' ) . table_drop ( ' receivers ' ) <nl> - ot : partial ( { ' tables_dropped ' : 1 } ) <nl> mmm a / test / rql_test / test - runner <nl> ppp b / test / rql_test / test - runner <nl> testExtensions = [ ' test ' , ' yaml ' ] <nl> <nl> r = utils . import_python_driver ( ) <nl> <nl> + print_debug = False <nl> + <nl> # - - set the default tempfolder to a generated folder in this directory <nl> <nl> tempfile . tempdir = tempfile . mkdtemp ( prefix = ' . rethinkdbTestTemp - ' , dir = os . getcwd ( ) ) <nl> signal . signal ( signal . SIGINT , setCancelRun ) <nl> <nl> # - - <nl> <nl> + def debug ( message ) : <nl> + if print_debug : <nl> + sys . stdout . write ( ' DEBUG : % s ' % message . rstrip ( ) ) <nl> + <nl> + # - - <nl> + <nl> # This class attempts to abstract some of the details that separate our source languages . <nl> class SrcLang ( object ) : <nl> test_types = None <nl> class WorkerThread ( threading . Thread ) : <nl> outputQueue = None <nl> <nl> existingServer = None <nl> + existingDBsToTables = None # dict of arrays of db_name = > table_name already on this server <nl> + <nl> server = None <nl> serverLogFile = None <nl> reqlConnection = None <nl> class WorkerThread ( threading . Thread ) : <nl> if isinstance ( existingServer , RethinkDBRunningServer ) : <nl> self . existingServer = existingServer <nl> self . server = existingServer <nl> + <nl> + self . reqlConnection = r . connect ( host = self . server . host , port = self . server . driver_port ) <nl> + self . existingDBsToTables = { } <nl> + for dbName in r . db_list ( ) . run ( self . reqlConnection ) : <nl> + self . existingDBsToTables [ dbName ] = r . db ( dbName ) . table_list ( ) . run ( self . reqlConnection ) <nl> else : <nl> raise Exception ( ' existingServer must be an instance of RethinkDBRunningServer , got : % s ' % repr ( existingServer ) ) <nl> <nl> class WorkerThread ( threading . Thread ) : <nl> <nl> def clean_server ( self ) : <nl> ' ' ' Clean out the server so it only has the rethinkdb and an empty test databases ' ' ' <nl> - assert self . existingServer is None <nl> <nl> if self . reqlConnection is None : <nl> raise ValueError ( ' clean_server called when there was no connection ' ) <nl> <nl> try : <nl> - <nl> - # - - clean out other databases <nl> <nl> - r . db_list ( ) . set_difference ( [ ' test ' , ' rethinkdb ' ] ) . for_each ( lambda dbName : r . db_drop ( dbName ) ) . run ( self . reqlConnection ) <nl> + # - - ensure that the test db is present <nl> + <nl> + r . expr ( [ ' test ' ] ) . set_difference ( r . db_list ( ) ) . for_each ( r . db_create ( r . row ) ) . run ( self . reqlConnection ) <nl> <nl> - # - - ensure that the test db is present and empty <nl> + # - - clean out databases / tables <nl> <nl> - if ' test ' not in r . db_list ( ) . run ( self . reqlConnection ) : <nl> - r . db_create ( ' test ' ) . run ( self . reqlConnection ) <nl> + if self . existingServer is None : <nl> + <nl> + # - drop all databases except test and rethinkdb <nl> + <nl> + r . db_list ( ) . set_difference ( [ ' test ' , ' rethinkdb ' ] ) . for_each ( r . db_drop ( r . row ) ) . run ( self . reqlConnection ) <nl> + <nl> + # - drop all tables in test <nl> + <nl> + r . db ( ' test ' ) . table_list ( ) . for_each ( r . db ( ' test ' ) . table_drop ( r . row ) ) . run ( self . reqlConnection ) <nl> + <nl> else : <nl> - r . db ( ' test ' ) . table_list ( ) . for_each ( lambda tableName : r . db ( ' test ' ) . table_drop ( tableName ) ) . run ( self . reqlConnection ) <nl> + <nl> + # - remove all dbs that were not there initially <nl> + <nl> + r . db_list ( ) . set_difference ( self . existingDBsToTables . keys ( ) ) . for_each ( r . db_drop ( r . row ) ) . run ( self . reqlConnection ) <nl> + <nl> + # - groom out the tables that were not there initially <nl> + <nl> + for db_name in r . db_list ( ) . run ( self . reqlConnection ) : <nl> + if db_name = = ' rethinkdb ' : <nl> + continue <nl> + r . db ( db_name ) . table_list ( ) . set_difference ( self . existingDBsToTables [ db_name ] ) . for_each ( r . db ( db_name ) . table_drop ( r . row ) ) . run ( self . reqlConnection ) <nl> <nl> # - - clean rethinkdb . _debug_scratch <nl> <nl> class WorkerThread ( threading . Thread ) : <nl> <nl> # - - remove any other connected servers <nl> <nl> - r . db ( ' rethinkdb ' ) . table ( ' server_config ' ) . filter ( r . row [ ' id ' ] ! = self . server . uuid ) . delete ( ) . run ( self . reqlConnection ) <nl> - r . wait ( ) . run ( self . reqlConnection ) <nl> + if self . existingServer is None : <nl> + r . db ( ' rethinkdb ' ) . table ( ' server_config ' ) . filter ( r . row [ ' id ' ] ! = self . server . uuid ) . delete ( ) . run ( self . reqlConnection ) <nl> + r . wait ( ) . run ( self . reqlConnection ) <nl> <nl> except Exception as e : <nl> - warnings . warn ( ' Unable to clean server , starting a new one . Error message : % s ' % str ( e ) ) # ToDo : improve logging <nl> - try : <nl> - self . server . close ( ) <nl> - except Exception : pass <nl> - self . server = None <nl> - self . reqlConnection = None <nl> + if self . existingServer : <nl> + warnings . warn ( ' Unable to clean existing server ! Error message : % s ' % str ( e ) ) # ToDo : improve logging <nl> + else : <nl> + warnings . warn ( ' Unable to clean server , starting a new one . Error message : % s ' % str ( e ) ) # ToDo : improve logging <nl> + try : <nl> + self . server . close ( ) <nl> + except Exception : pass <nl> + self . server = None <nl> + self . reqlConnection = None <nl> <nl> def run ( self ) : <nl> try : <nl> class WorkerThread ( threading . Thread ) : <nl> <nl> # - - make sure it is clean and setup <nl> <nl> - if self . existingServer is None : <nl> - self . clean_server ( ) <nl> + self . clean_server ( ) <nl> <nl> # - - set writeToStdout <nl> <nl> class WorkerThread ( threading . Thread ) : <nl> except Exception as e : <nl> debug ( traceback . format_exc ( ) ) <nl> raise Warning ( " Worker failure : " + unicode ( e ) ) <nl> + <nl> + finally : <nl> + if self . existingServer : <nl> + self . clean_server ( ) <nl> <nl> def main ( ) : <nl> + global print_debug <nl> <nl> testFilters = [ ] <nl> testList = [ ] <nl> def main ( ) : <nl> <nl> parser . add_option ( ' - v ' , ' - - verbose ' , dest = ' verbose ' , default = False , action = ' store_true ' , help = ' show test output while running ( disables - j / - - jobs ' ) <nl> <nl> - parser . add_option ( ' - j ' , ' - - jobs ' , dest = ' workerThreads ' , default = 2 , type = ' int ' , help = ' tests to run simultaneously ( default 2 ) ' ) <nl> + parser . add_option ( ' - j ' , ' - - jobs ' , dest = ' workerThreads ' , default = None , type = ' int ' , help = ' tests to run simultaneously ( default 2 ) ' ) <nl> <nl> options , args = parser . parse_args ( ) <nl> <nl> def main ( ) : <nl> <nl> # workerThreads <nl> <nl> - if options . workerThreads < 1 : <nl> - parser . error ( ' - j / - - jobs value must be 1 or greater ' ) <nl> - <nl> - # verbose <nl> + if options . workerThreads is None : <nl> + if options . table or options . verbose is True : <nl> + options . workerThreads = 1 <nl> + else : <nl> + options . workerThreads = 2 <nl> <nl> - if options . verbose is True : <nl> - if options . workerThreads > 2 : <nl> - warnings . warn ( ' - v / - - verbose disables running more than one test in parallel ' ) <nl> + elif options . verbose is True : <nl> + warnings . warn ( ' - v / - - verbose disables running more than one test in parallel ' ) <nl> options . workerThreads = 1 <nl> <nl> + elif options . workerThreads < 1 : <nl> + parser . error ( ' - j / - - jobs value must be 1 or greater ' ) <nl> + <nl> # - add filters <nl> <nl> for newFilter in args : <nl> def main ( ) : <nl> sys . stderr . write ( ' > > > % s % s % s after % s ( % s ) \ n \ n ' % ( test . result . capitalize ( ) , test . name , extraMessage , durationString , timeString ) ) <nl> sys . stderr . write ( test . console_output ) <nl> sys . stderr . write ( ' \ n < < < end % s : % s \ n ' % ( test . result . capitalize ( ) , test . name ) ) <nl> + sys . stderr . flush ( ) <nl> + sys . stdout . flush ( ) <nl> <nl> # - end if there are no worker threads <nl> <nl>
|
initial checkin for interface . artificial_table timing out on polyglot / joins . py on MacOS
|
rethinkdb/rethinkdb
|
f4b7005b4de11cccf91a4f406e230b5d5f12825a
|
2015-03-03T00:24:31Z
|
mmm a / src / core / ext / client_config / client_channel . c <nl> ppp b / src / core / ext / client_config / client_channel . c <nl> typedef struct client_channel_call_data { <nl> / / stack and each has its own mutex . If / when we have time , find a way <nl> / / to avoid this without breaking the grpc_deadline_state abstraction . <nl> grpc_deadline_state deadline_state ; <nl> + gpr_timespec deadline ; <nl> + <nl> + grpc_error * cancel_error ; <nl> <nl> / * * either 0 for no call , 1 for cancelled , or a pointer to a <nl> grpc_subchannel_call * / <nl> static void subchannel_ready ( grpc_exec_ctx * exec_ctx , void * arg , <nl> } else { <nl> grpc_subchannel_call * subchannel_call = NULL ; <nl> grpc_error * new_error = grpc_connected_subchannel_create_call ( <nl> - exec_ctx , calld - > connected_subchannel , calld - > pollent , <nl> + exec_ctx , calld - > connected_subchannel , calld - > pollent , calld - > deadline , <nl> & subchannel_call ) ; <nl> if ( new_error ! = GRPC_ERROR_NONE ) { <nl> new_error = grpc_error_add_child ( new_error , error ) ; <nl> static void cc_start_transport_stream_op ( grpc_exec_ctx * exec_ctx , <nl> grpc_subchannel_call * call = GET_CALL ( calld ) ; <nl> GPR_TIMER_BEGIN ( " cc_start_transport_stream_op " , 0 ) ; <nl> if ( call = = CANCELLED_CALL ) { <nl> - grpc_transport_stream_op_finish_with_failure ( exec_ctx , op , <nl> - GRPC_ERROR_CANCELLED ) ; <nl> + grpc_transport_stream_op_finish_with_failure ( <nl> + exec_ctx , op , GRPC_ERROR_REF ( calld - > cancel_error ) ) ; <nl> GPR_TIMER_END ( " cc_start_transport_stream_op " , 0 ) ; <nl> return ; <nl> } <nl> static void cc_start_transport_stream_op ( grpc_exec_ctx * exec_ctx , <nl> call = GET_CALL ( calld ) ; <nl> if ( call = = CANCELLED_CALL ) { <nl> gpr_mu_unlock ( & calld - > mu ) ; <nl> - grpc_transport_stream_op_finish_with_failure ( exec_ctx , op , <nl> - GRPC_ERROR_CANCELLED ) ; <nl> + grpc_transport_stream_op_finish_with_failure ( <nl> + exec_ctx , op , GRPC_ERROR_REF ( calld - > cancel_error ) ) ; <nl> GPR_TIMER_END ( " cc_start_transport_stream_op " , 0 ) ; <nl> return ; <nl> } <nl> static void cc_start_transport_stream_op ( grpc_exec_ctx * exec_ctx , <nl> ( gpr_atm ) ( uintptr_t ) CANCELLED_CALL ) ) { <nl> goto retry ; <nl> } else { <nl> + / / Stash a copy of cancel_error in our call data , so that we can use <nl> + / / it for subsequent operations . This ensures that if the call is <nl> + / / cancelled before any ops are passed down ( e . g . , if the deadline <nl> + / / is in the past when the call starts ) , we can return the right <nl> + / / error to the caller when the first op does get passed down . <nl> + calld - > cancel_error = GRPC_ERROR_REF ( op - > cancel_error ) ; <nl> switch ( calld - > creation_phase ) { <nl> case GRPC_SUBCHANNEL_CALL_HOLDER_NOT_CREATING : <nl> fail_locked ( exec_ctx , calld , GRPC_ERROR_REF ( op - > cancel_error ) ) ; <nl> static void cc_start_transport_stream_op ( grpc_exec_ctx * exec_ctx , <nl> calld - > connected_subchannel ! = NULL ) { <nl> grpc_subchannel_call * subchannel_call = NULL ; <nl> grpc_error * error = grpc_connected_subchannel_create_call ( <nl> - exec_ctx , calld - > connected_subchannel , calld - > pollent , <nl> + exec_ctx , calld - > connected_subchannel , calld - > pollent , calld - > deadline , <nl> & subchannel_call ) ; <nl> if ( error ! = GRPC_ERROR_NONE ) { <nl> subchannel_call = CANCELLED_CALL ; <nl> static grpc_error * cc_init_call_elem ( grpc_exec_ctx * exec_ctx , <nl> grpc_call_element * elem , <nl> grpc_call_element_args * args ) { <nl> call_data * calld = elem - > call_data ; <nl> - grpc_deadline_state_init ( & calld - > deadline_state , args - > call_stack ) ; <nl> + grpc_deadline_state_init ( exec_ctx , elem , args ) ; <nl> + calld - > deadline = args - > deadline ; <nl> + calld - > cancel_error = GRPC_ERROR_NONE ; <nl> gpr_atm_rel_store ( & calld - > subchannel_call , 0 ) ; <nl> gpr_mu_init ( & calld - > mu ) ; <nl> calld - > connected_subchannel = NULL ; <nl> static void cc_destroy_call_elem ( grpc_exec_ctx * exec_ctx , <nl> const grpc_call_final_info * final_info , <nl> void * and_free_memory ) { <nl> call_data * calld = elem - > call_data ; <nl> - grpc_deadline_state_destroy ( exec_ctx , & calld - > deadline_state ) ; <nl> + grpc_deadline_state_destroy ( exec_ctx , elem ) ; <nl> + GRPC_ERROR_UNREF ( calld - > cancel_error ) ; <nl> grpc_subchannel_call * call = GET_CALL ( calld ) ; <nl> if ( call ! = NULL & & call ! = CANCELLED_CALL ) { <nl> GRPC_SUBCHANNEL_CALL_UNREF ( exec_ctx , call , " client_channel_destroy_call " ) ; <nl> mmm a / src / core / ext / client_config / subchannel . c <nl> ppp b / src / core / ext / client_config / subchannel . c <nl> grpc_connected_subchannel * grpc_subchannel_get_connected_subchannel ( <nl> <nl> grpc_error * grpc_connected_subchannel_create_call ( <nl> grpc_exec_ctx * exec_ctx , grpc_connected_subchannel * con , <nl> - grpc_polling_entity * pollent , grpc_subchannel_call * * call ) { <nl> + grpc_polling_entity * pollent , gpr_timespec deadline , <nl> + grpc_subchannel_call * * call ) { <nl> grpc_channel_stack * chanstk = CHANNEL_STACK_FROM_CONNECTION ( con ) ; <nl> * call = gpr_malloc ( sizeof ( grpc_subchannel_call ) + chanstk - > call_stack_size ) ; <nl> grpc_call_stack * callstk = SUBCHANNEL_CALL_TO_CALL_STACK ( * call ) ; <nl> ( * call ) - > connection = con ; / / Ref is added below . <nl> grpc_error * error = <nl> grpc_call_stack_init ( exec_ctx , chanstk , 1 , subchannel_call_destroy , * call , <nl> - NULL , NULL , callstk ) ; <nl> + NULL , NULL , deadline , callstk ) ; <nl> if ( error ! = GRPC_ERROR_NONE ) { <nl> const char * error_string = grpc_error_string ( error ) ; <nl> gpr_log ( GPR_ERROR , " error : % s " , error_string ) ; <nl> mmm a / src / core / ext / client_config / subchannel . h <nl> ppp b / src / core / ext / client_config / subchannel . h <nl> void grpc_subchannel_call_unref ( grpc_exec_ctx * exec_ctx , <nl> / * * construct a subchannel call * / <nl> grpc_error * grpc_connected_subchannel_create_call ( <nl> grpc_exec_ctx * exec_ctx , grpc_connected_subchannel * connected_subchannel , <nl> - grpc_polling_entity * pollent , grpc_subchannel_call * * subchannel_call ) ; <nl> + grpc_polling_entity * pollent , gpr_timespec deadline , <nl> + grpc_subchannel_call * * subchannel_call ) ; <nl> <nl> / * * process a transport level op * / <nl> void grpc_connected_subchannel_process_transport_op ( <nl> mmm a / src / core / lib / channel / channel_stack . c <nl> ppp b / src / core / lib / channel / channel_stack . c <nl> void grpc_channel_stack_destroy ( grpc_exec_ctx * exec_ctx , <nl> } <nl> } <nl> <nl> - grpc_error * grpc_call_stack_init ( grpc_exec_ctx * exec_ctx , <nl> - grpc_channel_stack * channel_stack , <nl> - int initial_refs , grpc_iomgr_cb_func destroy , <nl> - void * destroy_arg , <nl> - grpc_call_context_element * context , <nl> - const void * transport_server_data , <nl> - grpc_call_stack * call_stack ) { <nl> + grpc_error * grpc_call_stack_init ( <nl> + grpc_exec_ctx * exec_ctx , grpc_channel_stack * channel_stack , <nl> + int initial_refs , grpc_iomgr_cb_func destroy , void * destroy_arg , <nl> + grpc_call_context_element * context , const void * transport_server_data , <nl> + gpr_timespec deadline , grpc_call_stack * call_stack ) { <nl> grpc_channel_element * channel_elems = CHANNEL_ELEMS_FROM_STACK ( channel_stack ) ; <nl> grpc_call_element_args args ; <nl> size_t count = channel_stack - > count ; <nl> grpc_error * grpc_call_stack_init ( grpc_exec_ctx * exec_ctx , <nl> args . call_stack = call_stack ; <nl> args . server_transport_data = transport_server_data ; <nl> args . context = context ; <nl> + args . deadline = deadline ; <nl> call_elems [ i ] . filter = channel_elems [ i ] . filter ; <nl> call_elems [ i ] . channel_data = channel_elems [ i ] . channel_data ; <nl> call_elems [ i ] . call_data = user_data ; <nl> mmm a / src / core / lib / channel / channel_stack . h <nl> ppp b / src / core / lib / channel / channel_stack . h <nl> typedef struct { <nl> grpc_call_stack * call_stack ; <nl> const void * server_transport_data ; <nl> grpc_call_context_element * context ; <nl> + gpr_timespec deadline ; <nl> } grpc_call_element_args ; <nl> <nl> typedef struct { <nl> void grpc_channel_stack_destroy ( grpc_exec_ctx * exec_ctx , <nl> / * Initialize a call stack given a channel stack . transport_server_data is <nl> expected to be NULL on a client , or an opaque transport owned pointer on the <nl> server . * / <nl> - grpc_error * grpc_call_stack_init ( grpc_exec_ctx * exec_ctx , <nl> - grpc_channel_stack * channel_stack , <nl> - int initial_refs , grpc_iomgr_cb_func destroy , <nl> - void * destroy_arg , <nl> - grpc_call_context_element * context , <nl> - const void * transport_server_data , <nl> - grpc_call_stack * call_stack ) ; <nl> + grpc_error * grpc_call_stack_init ( <nl> + grpc_exec_ctx * exec_ctx , grpc_channel_stack * channel_stack , <nl> + int initial_refs , grpc_iomgr_cb_func destroy , void * destroy_arg , <nl> + grpc_call_context_element * context , const void * transport_server_data , <nl> + gpr_timespec deadline , grpc_call_stack * call_stack ) ; <nl> / * Set a pollset or a pollset_set for a call stack : must occur before the first <nl> * op is started * / <nl> void grpc_call_stack_set_pollset_or_pollset_set ( grpc_exec_ctx * exec_ctx , <nl> mmm a / src / core / lib / channel / deadline_filter . c <nl> ppp b / src / core / lib / channel / deadline_filter . c <nl> <nl> # include < stdbool . h > <nl> # include < string . h > <nl> <nl> + # include < grpc / support / alloc . h > <nl> # include < grpc / support / log . h > <nl> # include < grpc / support / sync . h > <nl> # include < grpc / support / time . h > <nl> <nl> + # include " src / core / lib / iomgr / exec_ctx . h " <nl> # include " src / core / lib / iomgr / timer . h " <nl> <nl> / / <nl> static void inject_on_complete_cb ( grpc_deadline_state * deadline_state , <nl> op - > on_complete = & deadline_state - > on_complete ; <nl> } <nl> <nl> - void grpc_deadline_state_init ( grpc_deadline_state * deadline_state , <nl> - grpc_call_stack * call_stack ) { <nl> + / / Callback and associated state for starting the timer after call stack <nl> + / / initialization has been completed . <nl> + struct start_timer_after_init_state { <nl> + grpc_call_element * elem ; <nl> + gpr_timespec deadline ; <nl> + grpc_closure closure ; <nl> + } ; <nl> + static void start_timer_after_init ( grpc_exec_ctx * exec_ctx , void * arg , <nl> + grpc_error * error ) { <nl> + struct start_timer_after_init_state * state = arg ; <nl> + start_timer_if_needed ( exec_ctx , state - > elem , state - > deadline ) ; <nl> + gpr_free ( state ) ; <nl> + } <nl> + <nl> + void grpc_deadline_state_init ( grpc_exec_ctx * exec_ctx , grpc_call_element * elem , <nl> + grpc_call_element_args * args ) { <nl> + grpc_deadline_state * deadline_state = elem - > call_data ; <nl> memset ( deadline_state , 0 , sizeof ( * deadline_state ) ) ; <nl> - deadline_state - > call_stack = call_stack ; <nl> + deadline_state - > call_stack = args - > call_stack ; <nl> gpr_mu_init ( & deadline_state - > timer_mu ) ; <nl> + / / Deadline will always be infinite on servers , so the timer will only be <nl> + / / set on clients with a finite deadline . <nl> + const gpr_timespec deadline = <nl> + gpr_convert_clock_type ( args - > deadline , GPR_CLOCK_MONOTONIC ) ; <nl> + if ( gpr_time_cmp ( deadline , gpr_inf_future ( GPR_CLOCK_MONOTONIC ) ) ! = 0 ) { <nl> + / / When the deadline passes , we indicate the failure by sending down <nl> + / / an op with cancel_error set . However , we can ' t send down any ops <nl> + / / until after the call stack is fully initialized . If we start the <nl> + / / timer here , we have no guarantee that the timer won ' t pop before <nl> + / / call stack initialization is finished . To avoid that problem , we <nl> + / / create a closure to start the timer , and we schedule that closure <nl> + / / to be run after call stack initialization is done . <nl> + struct start_timer_after_init_state * state = gpr_malloc ( sizeof ( * state ) ) ; <nl> + state - > elem = elem ; <nl> + state - > deadline = deadline ; <nl> + grpc_closure_init ( & state - > closure , start_timer_after_init , state ) ; <nl> + grpc_exec_ctx_sched ( exec_ctx , & state - > closure , GRPC_ERROR_NONE , NULL ) ; <nl> + } <nl> } <nl> <nl> void grpc_deadline_state_destroy ( grpc_exec_ctx * exec_ctx , <nl> - grpc_deadline_state * deadline_state ) { <nl> + grpc_call_element * elem ) { <nl> + grpc_deadline_state * deadline_state = elem - > call_data ; <nl> cancel_timer_if_needed ( exec_ctx , deadline_state ) ; <nl> gpr_mu_destroy ( & deadline_state - > timer_mu ) ; <nl> } <nl> void grpc_deadline_state_client_start_transport_stream_op ( <nl> op - > close_error ! = GRPC_ERROR_NONE ) { <nl> cancel_timer_if_needed ( exec_ctx , deadline_state ) ; <nl> } else { <nl> - / / If we ' re sending initial metadata , get the deadline from the metadata <nl> - / / and start the timer if needed . <nl> - if ( op - > send_initial_metadata ! = NULL ) { <nl> - start_timer_if_needed ( exec_ctx , elem , <nl> - op - > send_initial_metadata - > deadline ) ; <nl> - } <nl> / / Make sure we know when the call is complete , so that we can cancel <nl> / / the timer . <nl> if ( op - > recv_trailing_metadata ! = NULL ) { <nl> typedef struct server_call_data { <nl> static grpc_error * init_call_elem ( grpc_exec_ctx * exec_ctx , <nl> grpc_call_element * elem , <nl> grpc_call_element_args * args ) { <nl> - base_call_data * calld = elem - > call_data ; <nl> / / Note : size of call data is different between client and server . <nl> - memset ( calld , 0 , elem - > filter - > sizeof_call_data ) ; <nl> - grpc_deadline_state_init ( & calld - > deadline_state , args - > call_stack ) ; <nl> + memset ( elem - > call_data , 0 , elem - > filter - > sizeof_call_data ) ; <nl> + grpc_deadline_state_init ( exec_ctx , elem , args ) ; <nl> return GRPC_ERROR_NONE ; <nl> } <nl> <nl> static grpc_error * init_call_elem ( grpc_exec_ctx * exec_ctx , <nl> static void destroy_call_elem ( grpc_exec_ctx * exec_ctx , grpc_call_element * elem , <nl> const grpc_call_final_info * final_info , <nl> void * and_free_memory ) { <nl> - base_call_data * calld = elem - > call_data ; <nl> - grpc_deadline_state_destroy ( exec_ctx , & calld - > deadline_state ) ; <nl> + grpc_deadline_state_destroy ( exec_ctx , elem ) ; <nl> } <nl> <nl> / / Method for starting a call op for client filter . <nl> mmm a / src / core / lib / channel / deadline_filter . h <nl> ppp b / src / core / lib / channel / deadline_filter . h <nl> <nl> # include " src / core / lib / iomgr / timer . h " <nl> <nl> / / State used for filters that enforce call deadlines . <nl> - / / Should be the first field in the filter ' s call_data . <nl> + / / Must be the first field in the filter ' s call_data . <nl> typedef struct grpc_deadline_state { <nl> / / We take a reference to the call stack for the timer callback . <nl> grpc_call_stack * call_stack ; <nl> typedef struct grpc_deadline_state { <nl> grpc_closure * next_on_complete ; <nl> } grpc_deadline_state ; <nl> <nl> - void grpc_deadline_state_init ( grpc_deadline_state * call_data , <nl> - grpc_call_stack * call_stack ) ; <nl> - void grpc_deadline_state_destroy ( grpc_exec_ctx * exec_ctx , <nl> - grpc_deadline_state * call_data ) ; <nl> - <nl> - / / To be used in a filter ' s start_transport_stream_op ( ) method to <nl> - / / enforce call deadlines . <nl> - / / It is the caller ' s responsibility to chain to the next filter if <nl> - / / necessary after this function returns . <nl> + / / To be used in a filter ' s init_call_elem ( ) , destroy_call_elem ( ) , and <nl> + / / start_transport_stream_op ( ) methods to enforce call deadlines . <nl> + / / <nl> / / REQUIRES : The first field in elem - > call_data is a grpc_deadline_state . <nl> + / / <nl> + / / For grpc_deadline_state_client_start_transport_stream_op ( ) , it is the <nl> + / / caller ' s responsibility to chain to the next filter if necessary <nl> + / / after the function returns . <nl> + void grpc_deadline_state_init ( grpc_exec_ctx * exec_ctx , grpc_call_element * elem , <nl> + grpc_call_element_args * args ) ; <nl> + void grpc_deadline_state_destroy ( grpc_exec_ctx * exec_ctx , <nl> + grpc_call_element * elem ) ; <nl> void grpc_deadline_state_client_start_transport_stream_op ( <nl> grpc_exec_ctx * exec_ctx , grpc_call_element * elem , <nl> grpc_transport_stream_op * op ) ; <nl> mmm a / src / core / lib / surface / call . c <nl> ppp b / src / core / lib / surface / call . c <nl> grpc_call * grpc_call_create ( <nl> } <nl> } <nl> send_deadline = gpr_convert_clock_type ( send_deadline , GPR_CLOCK_MONOTONIC ) ; <nl> - GRPC_CHANNEL_INTERNAL_REF ( channel , " call " ) ; <nl> - / * initial refcount dropped by grpc_call_destroy * / <nl> - grpc_error * error = grpc_call_stack_init ( <nl> - & exec_ctx , channel_stack , 1 , destroy_call , call , call - > context , <nl> - server_transport_data , CALL_STACK_FROM_CALL ( call ) ) ; <nl> - if ( error ! = GRPC_ERROR_NONE ) { <nl> - grpc_status_code status ; <nl> - const char * error_str ; <nl> - grpc_error_get_status ( error , & status , & error_str ) ; <nl> - close_with_status ( & exec_ctx , call , status , error_str ) ; <nl> - GRPC_ERROR_UNREF ( error ) ; <nl> - } <nl> - if ( cq ! = NULL ) { <nl> - GPR_ASSERT ( <nl> - pollset_set_alternative = = NULL & & <nl> - " Only one of ' cq ' and ' pollset_set_alternative ' should be non - NULL . " ) ; <nl> - GRPC_CQ_INTERNAL_REF ( cq , " bind " ) ; <nl> - call - > pollent = <nl> - grpc_polling_entity_create_from_pollset ( grpc_cq_pollset ( cq ) ) ; <nl> - } <nl> - if ( pollset_set_alternative ! = NULL ) { <nl> - call - > pollent = <nl> - grpc_polling_entity_create_from_pollset_set ( pollset_set_alternative ) ; <nl> - } <nl> - if ( ! grpc_polling_entity_is_empty ( & call - > pollent ) ) { <nl> - grpc_call_stack_set_pollset_or_pollset_set ( <nl> - & exec_ctx , CALL_STACK_FROM_CALL ( call ) , & call - > pollent ) ; <nl> - } <nl> + <nl> if ( parent_call ! = NULL ) { <nl> GRPC_CALL_INTERNAL_REF ( parent_call , " child " ) ; <nl> GPR_ASSERT ( call - > is_client ) ; <nl> grpc_call * grpc_call_create ( <nl> <nl> gpr_mu_unlock ( & parent_call - > mu ) ; <nl> } <nl> + <nl> call - > send_deadline = send_deadline ; <nl> + <nl> + GRPC_CHANNEL_INTERNAL_REF ( channel , " call " ) ; <nl> + / * initial refcount dropped by grpc_call_destroy * / <nl> + grpc_error * error = grpc_call_stack_init ( <nl> + & exec_ctx , channel_stack , 1 , destroy_call , call , call - > context , <nl> + server_transport_data , send_deadline , CALL_STACK_FROM_CALL ( call ) ) ; <nl> + if ( error ! = GRPC_ERROR_NONE ) { <nl> + grpc_status_code status ; <nl> + const char * error_str ; <nl> + grpc_error_get_status ( error , & status , & error_str ) ; <nl> + close_with_status ( & exec_ctx , call , status , error_str ) ; <nl> + GRPC_ERROR_UNREF ( error ) ; <nl> + } <nl> + if ( cq ! = NULL ) { <nl> + GPR_ASSERT ( <nl> + pollset_set_alternative = = NULL & & <nl> + " Only one of ' cq ' and ' pollset_set_alternative ' should be non - NULL . " ) ; <nl> + GRPC_CQ_INTERNAL_REF ( cq , " bind " ) ; <nl> + call - > pollent = <nl> + grpc_polling_entity_create_from_pollset ( grpc_cq_pollset ( cq ) ) ; <nl> + } <nl> + if ( pollset_set_alternative ! = NULL ) { <nl> + call - > pollent = <nl> + grpc_polling_entity_create_from_pollset_set ( pollset_set_alternative ) ; <nl> + } <nl> + if ( ! grpc_polling_entity_is_empty ( & call - > pollent ) ) { <nl> + grpc_call_stack_set_pollset_or_pollset_set ( <nl> + & exec_ctx , CALL_STACK_FROM_CALL ( call ) , & call - > pollent ) ; <nl> + } <nl> + <nl> grpc_exec_ctx_finish ( & exec_ctx ) ; <nl> GPR_TIMER_END ( " grpc_call_create " , 0 ) ; <nl> return call ; <nl> static void receiving_initial_metadata_ready ( grpc_exec_ctx * exec_ctx , <nl> if ( gpr_time_cmp ( md - > deadline , gpr_inf_future ( md - > deadline . clock_type ) ) ! = <nl> 0 & & <nl> ! call - > is_client ) { <nl> - call - > send_deadline = gpr_convert_clock_type ( md - > deadline , <nl> - GPR_CLOCK_MONOTONIC ) ; <nl> + call - > send_deadline = <nl> + gpr_convert_clock_type ( md - > deadline , GPR_CLOCK_MONOTONIC ) ; <nl> } <nl> } <nl> <nl> static void finish_batch ( grpc_exec_ctx * exec_ctx , void * bctlp , <nl> GRPC_ERROR_REF ( error ) ; <nl> <nl> gpr_mu_lock ( & call - > mu ) ; <nl> + <nl> + / / If the error has an associated status code , set the call ' s status . <nl> + intptr_t status ; <nl> + if ( error ! = GRPC_ERROR_NONE & & <nl> + grpc_error_get_int ( error , GRPC_ERROR_INT_GRPC_STATUS , & status ) ) { <nl> + set_status_from_error ( call , STATUS_FROM_CORE , error ) ; <nl> + } <nl> + <nl> if ( bctl - > send_initial_metadata ) { <nl> if ( error ! = GRPC_ERROR_NONE ) { <nl> set_status_from_error ( call , STATUS_FROM_CORE , error ) ; <nl> mmm a / test / core / end2end / invalid_call_argument_test . c <nl> ppp b / test / core / end2end / invalid_call_argument_test . c <nl> static void test_receive_initial_metadata_twice_at_client ( ) { <nl> grpc_op * op ; <nl> prepare_test ( 1 ) ; <nl> op = g_state . ops ; <nl> - op - > op = GRPC_OP_SEND_INITIAL_METADATA ; <nl> - op - > data . send_initial_metadata . count = 0 ; <nl> - op - > flags = 0 ; <nl> - op - > reserved = NULL ; <nl> - op + + ; <nl> op - > op = GRPC_OP_RECV_INITIAL_METADATA ; <nl> op - > data . recv_initial_metadata = & g_state . initial_metadata_recv ; <nl> op - > flags = 0 ; <nl> static void test_recv_status_on_client_twice ( ) { <nl> prepare_test ( 1 ) ; <nl> <nl> op = g_state . ops ; <nl> - op - > op = GRPC_OP_SEND_INITIAL_METADATA ; <nl> - op - > data . send_initial_metadata . count = 0 ; <nl> - op - > flags = 0 ; <nl> - op - > reserved = NULL ; <nl> - op + + ; <nl> op - > op = GRPC_OP_RECV_STATUS_ON_CLIENT ; <nl> op - > data . recv_status_on_client . trailing_metadata = <nl> & g_state . trailing_metadata_recv ; <nl> mmm a / test / core / end2end / tests / negative_deadline . c <nl> ppp b / test / core / end2end / tests / negative_deadline . c <nl> static void simple_request_body ( grpc_end2end_test_fixture f , size_t num_ops ) { <nl> <nl> memset ( ops , 0 , sizeof ( ops ) ) ; <nl> op = ops ; <nl> - op - > op = GRPC_OP_SEND_INITIAL_METADATA ; <nl> - op - > data . send_initial_metadata . count = 0 ; <nl> - op - > flags = 0 ; <nl> - op - > reserved = NULL ; <nl> - op + + ; <nl> op - > op = GRPC_OP_RECV_STATUS_ON_CLIENT ; <nl> op - > data . recv_status_on_client . trailing_metadata = & trailing_metadata_recv ; <nl> op - > data . recv_status_on_client . status = & status ; <nl> static void simple_request_body ( grpc_end2end_test_fixture f , size_t num_ops ) { <nl> op - > flags = 0 ; <nl> op - > reserved = NULL ; <nl> op + + ; <nl> + op - > op = GRPC_OP_SEND_INITIAL_METADATA ; <nl> + op - > data . send_initial_metadata . count = 0 ; <nl> + op - > flags = 0 ; <nl> + op - > reserved = NULL ; <nl> + op + + ; <nl> op - > op = GRPC_OP_SEND_CLOSE_FROM_CLIENT ; <nl> op - > flags = 0 ; <nl> op - > reserved = NULL ; <nl> op + + ; <nl> - / / Need to send at least the SEND_INITIAL_METADATA and <nl> - / / RECV_STATUS_ON_CLIENT ops , since the former allows the client to set <nl> - / / the deadline timer , and the latter returns status to the test . <nl> - GPR_ASSERT ( num_ops > = 2 ) ; <nl> GPR_ASSERT ( num_ops < = ( size_t ) ( op - ops ) ) ; <nl> error = grpc_call_start_batch ( c , ops , num_ops , tag ( 1 ) , NULL ) ; <nl> GPR_ASSERT ( GRPC_CALL_OK = = error ) ; <nl> static void test_invoke_simple_request ( grpc_end2end_test_config config , <nl> <nl> void negative_deadline ( grpc_end2end_test_config config ) { <nl> size_t i ; <nl> - for ( i = 2 ; i < = 4 ; i + + ) { <nl> + for ( i = 1 ; i < = 4 ; i + + ) { <nl> test_invoke_simple_request ( config , i ) ; <nl> } <nl> } <nl>
|
Pass deadline into filters via grpc_call_element_args , so that we can
|
grpc/grpc
|
f28763c68c9b3caf539f4d38ff123ae5de69e6d8
|
2016-09-14T22:18:40Z
|
mmm a / src / compiler / serializer - for - background - compilation . cc <nl> ppp b / src / compiler / serializer - for - background - compilation . cc <nl> class SerializerForBackgroundCompilation { <nl> CompilationDependencies * dependencies , CompilationSubject function , <nl> base : : Optional < Hints > new_target , const HintsVector & arguments , <nl> MissingArgumentsPolicy padding , <nl> - SerializerForBackgroundCompilationFlags flags ) ; <nl> + SerializerForBackgroundCompilationFlags flags , int nesting_level ) ; <nl> <nl> bool BailoutOnUninitialized ( ProcessedFeedback const & feedback ) ; <nl> <nl> class SerializerForBackgroundCompilation { <nl> HintsVector const arguments_ ; <nl> Hints return_value_hints_ ; <nl> Hints closure_hints_ ; <nl> + <nl> + int nesting_level_ = 0 ; <nl> } ; <nl> <nl> void RunSerializerForBackgroundCompilation ( <nl> SerializerForBackgroundCompilation : : SerializerForBackgroundCompilation ( <nl> CompilationDependencies * dependencies , CompilationSubject function , <nl> base : : Optional < Hints > new_target , const HintsVector & arguments , <nl> MissingArgumentsPolicy padding , <nl> - SerializerForBackgroundCompilationFlags flags ) <nl> + SerializerForBackgroundCompilationFlags flags , int nesting_level ) <nl> : broker_ ( broker ) , <nl> dependencies_ ( dependencies ) , <nl> zone_scope_ ( zone_stats , ZONE_NAME ) , <nl> SerializerForBackgroundCompilation : : SerializerForBackgroundCompilation ( <nl> environment_ ( new ( zone ( ) ) <nl> Environment ( zone ( ) , broker_ - > isolate ( ) , function , <nl> new_target , arguments , padding ) ) , <nl> - arguments_ ( arguments ) { <nl> + arguments_ ( arguments ) , <nl> + nesting_level_ ( nesting_level ) { <nl> Handle < JSFunction > closure ; <nl> if ( function . closure ( ) . ToHandle ( & closure ) ) { <nl> closure_hints_ . AddConstant ( closure , zone ( ) ) ; <nl> bool SerializerForBackgroundCompilation : : BailoutOnUninitialized ( <nl> <nl> Hints SerializerForBackgroundCompilation : : Run ( ) { <nl> TraceScope tracer ( broker ( ) , this , " SerializerForBackgroundCompilation : : Run " ) ; <nl> + if ( nesting_level_ > = FLAG_max_serializer_nesting ) { <nl> + TRACE_BROKER_MISSING ( <nl> + broker ( ) , <nl> + " opportunity - Reached max nesting level for " <nl> + " SerializerForBackgroundCompilation : : Run , bailing out . \ n " ) ; <nl> + return Hints ( ) ; <nl> + } <nl> + <nl> TRACE_BROKER_MEMORY ( broker ( ) , " [ serializer start ] Broker zone usage : " <nl> < < broker ( ) - > zone ( ) - > allocation_size ( ) ) ; <nl> SharedFunctionInfoRef shared ( broker ( ) , function ( ) . shared ( ) ) ; <nl> FeedbackVectorRef feedback_vector_ref ( broker ( ) , feedback_vector ( ) ) ; <nl> if ( ! broker ( ) - > ShouldBeSerializedForCompilation ( shared , feedback_vector_ref , <nl> arguments_ ) ) { <nl> - TRACE_BROKER ( broker ( ) , " Already ran serializer for SharedFunctionInfo " <nl> - < < Brief ( * shared . object ( ) ) <nl> - < < " , bailing out . \ n " ) ; <nl> + TRACE_BROKER_MISSING ( <nl> + broker ( ) , " opportunity - Already ran serializer for SharedFunctionInfo " <nl> + < < Brief ( * shared . object ( ) ) < < " , bailing out . \ n " ) ; <nl> return Hints ( ) ; <nl> } <nl> <nl> Hints SerializerForBackgroundCompilation : : RunChildSerializer ( <nl> const HintsVector & arguments , MissingArgumentsPolicy padding ) { <nl> SerializerForBackgroundCompilation child_serializer ( <nl> zone_scope_ . zone_stats ( ) , broker ( ) , dependencies ( ) , function , new_target , <nl> - arguments , padding , flags ( ) ) ; <nl> + arguments , padding , flags ( ) , nesting_level_ + 1 ) ; <nl> Hints result = child_serializer . Run ( ) ; <nl> / / The Hints returned by the call to Run are allocated in the zone <nl> / / created by the child serializer . Adding those hints to a hints <nl> mmm a / src / flags / flag - definitions . h <nl> ppp b / src / flags / flag - definitions . h <nl> DEFINE_BOOL ( block_concurrent_recompilation , false , <nl> " block queued jobs until released " ) <nl> DEFINE_BOOL ( concurrent_inlining , false , <nl> " run optimizing compiler ' s inlining phase on a separate thread " ) <nl> + DEFINE_INT ( max_serializer_nesting , 25 , <nl> + " maximum levels for nesting child serializers " ) <nl> DEFINE_IMPLICATION ( future , concurrent_inlining ) <nl> DEFINE_BOOL ( trace_heap_broker_verbose , false , <nl> " trace the heap broker verbosely ( all reports ) " ) <nl> new file mode 100644 <nl> index 00000000000 . . 36ecb94eea8 <nl> mmm / dev / null <nl> ppp b / test / mjsunit / compiler / regress - 1034768 <nl> <nl> + / / Copyright 2019 the V8 project authors . All rights reserved . <nl> + / / Use of this source code is governed by a BSD - style license that can be <nl> + / / found in the LICENSE file . <nl> + <nl> + / / Flags : - - allow - natives - syntax - - max - serializer - nesting = 4 <nl> + function f1 ( ) { <nl> + return 1 ; <nl> + } <nl> + <nl> + function f2 ( ) { return f1 ( ) ; } <nl> + function f3 ( ) { return f2 ( ) ; } <nl> + function f4 ( ) { return f3 ( ) ; } <nl> + function f5 ( ) { return f4 ( ) ; } <nl> + <nl> + % PrepareFunctionForOptimization ( f1 ) ; <nl> + % PrepareFunctionForOptimization ( f2 ) ; <nl> + % PrepareFunctionForOptimization ( f3 ) ; <nl> + % PrepareFunctionForOptimization ( f4 ) ; <nl> + % PrepareFunctionForOptimization ( f5 ) ; <nl> + <nl> + f5 ( ) ; <nl> + f5 ( ) ; <nl> + % OptimizeFunctionOnNextCall ( f5 ) ; <nl> + f5 ( ) ; <nl>
|
[ turbofan ] Add a nesting limit for the child serializer
|
v8/v8
|
b297fcc50d8cef08eb02b7dcb043070b3ff0bd7b
|
2019-12-17T18:22:46Z
|
mmm a / src / qt / guiutil . cpp <nl> ppp b / src / qt / guiutil . cpp <nl> QFont fixedPitchFont ( ) <nl> # endif <nl> } <nl> <nl> + / / Just some dummy data to generate an convincing random - looking ( but consistent ) address <nl> + static const uint8_t dummydata [ ] = { 0xeb , 0x15 , 0x23 , 0x1d , 0xfc , 0xeb , 0x60 , 0x92 , 0x58 , 0x86 , 0xb6 , 0x7d , 0x06 , 0x52 , 0x99 , 0x92 , 0x59 , 0x15 , 0xae , 0xb1 , 0x72 , 0xc0 , 0x66 , 0x47 } ; <nl> + <nl> + / / Generate a dummy address with invalid CRC , starting with the network prefix . <nl> + static std : : string DummyAddress ( const CChainParams & params ) <nl> + { <nl> + std : : vector < unsigned char > sourcedata = params . Base58Prefix ( CChainParams : : PUBKEY_ADDRESS ) ; <nl> + sourcedata . insert ( sourcedata . end ( ) , dummydata , dummydata + sizeof ( dummydata ) ) ; <nl> + for ( int i = 0 ; i < 256 ; + + i ) { / / Try every trailing byte <nl> + std : : string s = EncodeBase58 ( begin_ptr ( sourcedata ) , end_ptr ( sourcedata ) ) ; <nl> + if ( ! CBitcoinAddress ( s ) . IsValid ( ) ) <nl> + return s ; <nl> + sourcedata [ sourcedata . size ( ) - 1 ] + = 1 ; <nl> + } <nl> + return " " ; <nl> + } <nl> + <nl> void setupAddressWidget ( QValidatedLineEdit * widget , QWidget * parent ) <nl> { <nl> parent - > setFocusProxy ( widget ) ; <nl> void setupAddressWidget ( QValidatedLineEdit * widget , QWidget * parent ) <nl> # if QT_VERSION > = 0x040700 <nl> / / We don ' t want translators to use own addresses in translations <nl> / / and this is the only place , where this address is supplied . <nl> - widget - > setPlaceholderText ( QObject : : tr ( " Enter a Bitcoin address ( e . g . % 1 ) " ) . arg ( " 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L " ) ) ; <nl> + widget - > setPlaceholderText ( QObject : : tr ( " Enter a Bitcoin address ( e . g . % 1 ) " ) . arg ( <nl> + QString : : fromStdString ( DummyAddress ( Params ( ) ) ) ) ) ; <nl> # endif <nl> widget - > setValidator ( new BitcoinAddressEntryValidator ( parent ) ) ; <nl> widget - > setCheckValidator ( new BitcoinAddressCheckValidator ( parent ) ) ; <nl>
|
qt : Network - specific example address
|
bitcoin/bitcoin
|
4f44cb616d98a0e17ae0599e5a58f50f3be2910b
|
2016-06-29T15:35:54Z
|
mmm a / scala - package / core / pom . xml <nl> ppp b / scala - package / core / pom . xml <nl> <nl> < version > 0 . 1 - SNAPSHOT < / version > <nl> < name > MXNet Scala Package - Core < / name > <nl> <nl> - < url > https : / / github . com / dmlc / mxnet / tree / master / scala - package < / url > <nl> - < description > MXNet Scala core without native lib < / description > <nl> - <nl> - < organization > <nl> - < name > Distributed ( Deep ) Machine Learning Community < / name > <nl> - < url > http : / / dmlc . ml < / url > <nl> - < / organization > <nl> - <nl> < profiles > <nl> < profile > <nl> < id > osx - x86_64 - cpu < / id > <nl> <nl> < / profile > <nl> < profile > <nl> < id > release < / id > <nl> - < distributionManagement > <nl> - < snapshotRepository > <nl> - < id > nexus - release < / id > <nl> - < url > https : / / oss . sonatype . org / content / repositories / snapshots / < / url > <nl> - < / snapshotRepository > <nl> - < repository > <nl> - < id > nexus - release < / id > <nl> - < url > https : / / oss . sonatype . org / service / local / staging / deploy / maven2 / < / url > <nl> - < / repository > <nl> - < / distributionManagement > <nl> < build > <nl> < plugins > <nl> < plugin > <nl> <nl> < groupId > org . apache . maven . plugins < / groupId > <nl> < artifactId > maven - gpg - plugin < / artifactId > <nl> < / plugin > <nl> + < plugin > <nl> + < groupId > org . sonatype . plugins < / groupId > <nl> + < artifactId > nexus - staging - maven - plugin < / artifactId > <nl> + < / plugin > <nl> < / plugins > <nl> < / build > <nl> < / profile > <nl> mmm a / scala - package / pom . xml <nl> ppp b / scala - package / pom . xml <nl> <nl> < artifactId > mxnet - parent_2 . 10 < / artifactId > <nl> < version > 0 . 1 - SNAPSHOT < / version > <nl> < name > MXNet Scala Package - Parent < / name > <nl> + < url > https : / / github . com / dmlc / mxnet / tree / master / scala - package < / url > <nl> + < description > MXNet Scala Package < / description > <nl> + < organization > <nl> + < name > Distributed ( Deep ) Machine Learning Community < / name > <nl> + < url > http : / / dmlc . ml < / url > <nl> + < / organization > <nl> + < licenses > <nl> + < license > <nl> + < name > The Apache License , Version 2 . 0 < / name > <nl> + < url > http : / / www . apache . org / licenses / LICENSE - 2 . 0 . txt < / url > <nl> + < / license > <nl> + < / licenses > <nl> + < scm > <nl> + < connection > scm : git : git @ github . com : dmlc / mxnet . git < / connection > <nl> + < developerConnection > scm : git : git @ github . com : javelinjs / mxnet . git < / developerConnection > <nl> + < url > https : / / github . com / dmlc / mxnet < / url > <nl> + < / scm > <nl> + <nl> + < developers > <nl> + < developer > <nl> + < name > Yizhi Liu < / name > <nl> + < id > javelinjs < / id > <nl> + < email > javelinjs @ gmail . com < / email > <nl> + < organization > DMLC < / organization > <nl> + < organizationUrl > http : / / dmlc . ml < / organizationUrl > <nl> + < / developer > <nl> + < developer > <nl> + < name > Zixuan Huang < / name > <nl> + < email > toofooltosay @ gmail . com < / email > <nl> + < organization > DMLC < / organization > <nl> + < organizationUrl > http : / / dmlc . ml < / organizationUrl > <nl> + < / developer > <nl> + < developer > <nl> + < name > Yuan Tang < / name > <nl> + < email > terrytangyuan @ gmail . com < / email > <nl> + < organization > DMLC < / organization > <nl> + < organizationUrl > http : / / dmlc . ml < / organizationUrl > <nl> + < / developer > <nl> + < / developers > <nl> <nl> < properties > <nl> < scala . version > 2 . 10 . 4 < / scala . version > <nl> <nl> < module > assembly < / module > <nl> < / modules > <nl> <nl> - < developers > <nl> - < developer > <nl> - < name > Yizhi Liu < / name > <nl> - < id > javelinjs < / id > <nl> - < email > javelinjs @ gmail . com < / email > <nl> - < roles > <nl> - < role > Developer < / role > <nl> - < / roles > <nl> - < timezone > + 8 < / timezone > <nl> - < / developer > <nl> - < / developers > <nl> + < distributionManagement > <nl> + < snapshotRepository > <nl> + < id > ossrh < / id > <nl> + < url > https : / / oss . sonatype . org / content / repositories / snapshots < / url > <nl> + < / snapshotRepository > <nl> + < / distributionManagement > <nl> <nl> < build > <nl> < pluginManagement > <nl> <nl> < artifactId > maven - deploy - plugin < / artifactId > <nl> < version > 2 . 8 . 2 < / version > <nl> < / plugin > <nl> - < ! - - Source - - > <nl> < plugin > <nl> < groupId > org . apache . maven . plugins < / groupId > <nl> < artifactId > maven - source - plugin < / artifactId > <nl> <nl> < / execution > <nl> < / executions > <nl> < / plugin > <nl> - < ! - - Javadoc - - > <nl> < plugin > <nl> < groupId > org . apache . maven . plugins < / groupId > <nl> < artifactId > maven - javadoc - plugin < / artifactId > <nl> <nl> < / execution > <nl> < / executions > <nl> < / plugin > <nl> + < ! - - OSSRH Repo - - > <nl> + < plugin > <nl> + < groupId > org . sonatype . plugins < / groupId > <nl> + < artifactId > nexus - staging - maven - plugin < / artifactId > <nl> + < version > 1 . 6 . 3 < / version > <nl> + < extensions > true < / extensions > <nl> + < configuration > <nl> + < serverId > ossrh < / serverId > <nl> + < nexusUrl > https : / / oss . sonatype . org / < / nexusUrl > <nl> + < autoReleaseAfterClose > true < / autoReleaseAfterClose > <nl> + < / configuration > <nl> + < / plugin > <nl> < ! - - Surefire runs all Java tests - - > <nl> < plugin > <nl> < groupId > org . apache . maven . plugins < / groupId > <nl>
|
deploy for scala core module ready
|
apache/incubator-mxnet
|
ad2e47f5358a7fb3f2430ada7099362205df93f4
|
2016-03-24T13:21:28Z
|
mmm a / xbmc / pvr / channels / PVRChannelGroups . cpp <nl> ppp b / xbmc / pvr / channels / PVRChannelGroups . cpp <nl> bool CPVRChannelGroups : : LoadUserDefinedChannelGroups ( void ) <nl> if ( bSyncWithBackends ) <nl> { <nl> GetGroupsFromClients ( ) ; <nl> - CLog : : Log ( LOGDEBUG , " PVR - % s - % d new user defined % s channel groups fetched from clients " , __FUNCTION__ , ( int ) ( m_groups . size ( ) - iSize ) , m_bRadio ? " radio " : " TV " ) ; <nl> + CLog : : Log ( LOGDEBUG , " PVR - % s - % " PRIuS " new user defined % s channel groups fetched from clients " , __FUNCTION__ , ( m_groups . size ( ) - iSize ) , m_bRadio ? " radio " : " TV " ) ; <nl> } <nl> else <nl> CLog : : Log ( LOGDEBUG , " PVR - % s - ' synchannelgroups ' is disabled ; skipping groups from clients " , __FUNCTION__ ) ; <nl> bool CPVRChannelGroups : : Load ( void ) <nl> <nl> / / load groups from the database <nl> database - > Get ( * this ) ; <nl> - CLog : : Log ( LOGDEBUG , " PVR - % s - % d % s groups fetched from the database " , __FUNCTION__ , m_groups . size ( ) , m_bRadio ? " radio " : " TV " ) ; <nl> + CLog : : Log ( LOGDEBUG , " PVR - % s - % " PRIuS " % s groups fetched from the database " , __FUNCTION__ , m_groups . size ( ) , m_bRadio ? " radio " : " TV " ) ; <nl> <nl> / / load channels of internal group <nl> if ( ! internalGroup - > Load ( ) ) <nl> bool CPVRChannelGroups : : Load ( void ) <nl> CPVRChannelGroupPtr lastPlayedGroup = GetLastPlayedGroup ( ) ; <nl> SetSelectedGroup ( lastPlayedGroup ? lastPlayedGroup : internalGroup ) ; <nl> <nl> - CLog : : Log ( LOGDEBUG , " PVR - % s - % d % s channel groups loaded " , __FUNCTION__ , ( int ) m_groups . size ( ) , m_bRadio ? " radio " : " TV " ) ; <nl> + CLog : : Log ( LOGDEBUG , " PVR - % s - % " PRIuS " % s channel groups loaded " , __FUNCTION__ , m_groups . size ( ) , m_bRadio ? " radio " : " TV " ) ; <nl> <nl> / / need at least 1 group <nl> return m_groups . size ( ) > 0 ; <nl>
|
Merge pull request from xhaggi / pvr - fix - printf - format - mismatch
|
xbmc/xbmc
|
82ea9fd853f964e2fc053f3e7cd10663d4afc9f5
|
2014-09-24T14:23:23Z
|
mmm a / third_party / mlir / tblgen . bzl <nl> ppp b / third_party / mlir / tblgen . bzl <nl> <nl> " " " BUILD extensions for MLIR table generation . " " " <nl> <nl> - def gentbl ( name , tblgen , td_file , tbl_outs , td_srcs = [ ] , td_includes = [ ] , strip_include_prefix = None ) : <nl> + def gentbl ( name , tblgen , td_file , tbl_outs , td_srcs = [ ] , td_includes = [ ] , strip_include_prefix = None , test = False ) : <nl> " " " gentbl ( ) generates tabular code from a table definition file . <nl> <nl> Args : <nl> def gentbl ( name , tblgen , td_file , tbl_outs , td_srcs = [ ] , td_includes = [ ] , stri <nl> td_srcs : A list of table definition files included transitively . <nl> td_includes : A list of include paths for relative includes . <nl> strip_include_prefix : attribute to pass through to cc_library . <nl> + test : whether to create a test to invoke the tool too . <nl> " " " <nl> srcs = [ ] <nl> srcs + = td_srcs <nl> if td_file not in td_srcs : <nl> srcs + = [ td_file ] <nl> <nl> - # Add google_mlir / include directory and the directory with generated td <nl> - # files as includes , so derived op td files can import relative to that . <nl> - td_includes_str = " - I external / local_config_mlir / include - I external / org_tensorflow - I $ ( GENDIR ) " <nl> + td_includes_cmd = [ " - I external / local_config_mlir / include - I external / org_tensorflow " ] <nl> for td_include in td_includes : <nl> - td_includes_str + = " - I % s " % td_include <nl> - td_includes_str + = " - I $ $ ( dirname $ ( location % s ) ) " % td_file <nl> + td_includes_cmd + = [ " - I % s " % td_include ] <nl> + local_inc = " - I $ $ ( dirname $ ( location % s ) ) " % td_file <nl> + <nl> + if test : <nl> + # Rule to generate shell script to invoke tblgen . This generates a very <nl> + # bare shell file which the sh_test uses . <nl> + native . genrule ( <nl> + name = " % s_genrule_sh " % name , <nl> + srcs = srcs , <nl> + outs = [ " % s . gen . sh " % name ] , <nl> + cmd = ( " echo \ " \ \ $ $ 1 \ " % s \ \ $ $ { @ : 2 } - o / dev / null > $ @ " % local_inc ) , <nl> + executable = 1 , <nl> + ) <nl> + <nl> for ( opts , out ) in tbl_outs : <nl> + # All arguments to generate the output except output destination . <nl> + base_args = [ <nl> + " $ ( location % s ) " % tblgen , <nl> + " % s " % opts , <nl> + " $ ( location % s ) " % td_file , <nl> + " - I $ ( GENDIR ) " , <nl> + ] + td_includes_cmd <nl> rule_suffix = " _ " . join ( opts . replace ( " - " , " _ " ) . replace ( " = " , " _ " ) . split ( " " ) ) <nl> + <nl> + # Rule to generate code using generated shell script . <nl> native . genrule ( <nl> name = " % s_ % s_genrule " % ( name , rule_suffix ) , <nl> srcs = srcs , <nl> outs = [ out ] , <nl> tools = [ tblgen ] , <nl> message = " Generating code from table : % s " % td_file , <nl> - cmd = ( ( " $ ( location % s ) % s % s $ ( location % s ) - o $ @ " ) % ( <nl> - tblgen , <nl> - td_includes_str , <nl> - opts , <nl> - td_file , <nl> - ) ) , <nl> + cmd = ( " " . join ( base_args ) + " % s - o $ @ " % local_inc ) , <nl> ) <nl> <nl> + # Optionally generate rule to test tblgen invocation . <nl> + if test : <nl> + native . sh_test ( <nl> + name = " % s_ % s_genrule_test " % ( name , rule_suffix ) , <nl> + srcs = [ " % s . gen . sh " % name ] , <nl> + args = base_args , <nl> + data = srcs + [ tblgen ] , <nl> + ) <nl> + <nl> # List of opts that do not generate cc files . <nl> skip_opts = [ " - gen - op - doc " ] <nl> hdrs = [ f for ( opts , f ) in tbl_outs if opts not in skip_opts ] <nl> mmm a / third_party / mlir / test / BUILD <nl> ppp b / third_party / mlir / test / BUILD <nl> gentbl ( <nl> " @ local_config_mlir / / : include / mlir / Analysis / CallInterfaces . td " , <nl> " @ local_config_mlir / / : include / mlir / Analysis / InferTypeOpInterface . td " , <nl> ] , <nl> + test = True , <nl> ) <nl> <nl> cc_library ( <nl>
|
Change tblgen rule to generate sh_test too
|
tensorflow/tensorflow
|
0657d9465b32221107d5219d517e846e326be916
|
2019-10-20T15:38:18Z
|
mmm a / test / cpp / tensorexpr / test_loopnest . cpp <nl> ppp b / test / cpp / tensorexpr / test_loopnest . cpp <nl> TEST ( LoopNest , LoopNestComputeAt_2 ) { <nl> const std : : string & verification_pattern = <nl> R " IR ( <nl> # CHECK : for ( int cy = 0 ; cy < H ; cy + + ) <nl> - # CHECK : Allocate ( temp , int , { 2 , W + 1 } ) <nl> + # CHECK : Allocate ( temp , int , { 2 * ( W + 1 ) } ) <nl> # CHECK : for <nl> # CHECK : for <nl> # CHECK : for ( int cx = 0 ; cx < W ; cx + + ) <nl> TEST ( LoopNest , LoopNestComputeAt_2 ) { <nl> R " IR ( <nl> # CHECK : for ( int cy = 0 ; cy < H ; cy + + ) <nl> # CHECK : for ( int cx = 0 ; cx < W ; cx + + ) <nl> - # CHECK : Allocate ( temp , int , { 2 , 2 } ) <nl> + # CHECK : Allocate ( temp , int , { 4 } ) <nl> # CHECK : for <nl> # CHECK : for <nl> # CHECK - NOT : prod [ <nl> TEST ( LoopNest , LoopNestComputeAt_3 ) { <nl> # CHECK : for ( int cx = 0 ; cx < W ; cx + + ) <nl> # CHECK : C [ <nl> # CHECK : for ( int dy = 0 ; dy < H ; dy + + ) <nl> - # CHECK : Allocate ( temp , int , { 1 , W } ) <nl> + # CHECK : Allocate ( temp , int , { W } ) <nl> # CHECK : for ( int dx = 0 ; dx < W ; dx + + ) <nl> # CHECK - NOT : A [ ) IR " ; <nl> torch : : jit : : testing : : FileCheck ( ) . run ( verification_pattern , oss . str ( ) ) ; <nl> TEST ( LoopNest , LoopNestComputeAt_3 ) { <nl> # CHECK : C [ <nl> # CHECK : for ( int dy = 0 ; dy < H ; dy + + ) <nl> # CHECK : for ( int dx = 0 ; dx < W ; dx + + ) <nl> - # CHECK : Allocate ( temp , int , { 1 , 1 } ) <nl> + # CHECK : Allocate ( temp , int , { 1 } ) <nl> # CHECK - NOT : A [ ) IR " ; <nl> torch : : jit : : testing : : FileCheck ( ) . run ( verification_pattern , oss . str ( ) ) ; <nl> <nl> TEST ( LoopNest , CacheReadsSimple ) { <nl> / / just this once : verify the whole thing . <nl> const std : : string & expected_ir = <nl> R " IR ( <nl> - # CHECK : Allocate ( A , int , { 64 , 64 } ) ; <nl> + # CHECK : Allocate ( A , int , { 4096 } ) ; <nl> # CHECK : for ( int i <nl> # CHECK : for ( int j <nl> # CHECK : A [ <nl> # CHECK : } <nl> # CHECK : } <nl> # CHECK : for ( int i_1 <nl> - # CHECK : Allocate ( A_local , int , { 1 , 10 } ) ; <nl> + # CHECK : Allocate ( A_local , int , { 10 } ) ; <nl> # CHECK : for ( int j_1 <nl> # CHECK : A_local [ j_1 ] = A [ <nl> # CHECK : } <nl> TEST ( LoopNest , CacheReadsOuter ) { <nl> oss < < * result ; <nl> const std : : string & expected_ir = <nl> R " IR ( <nl> - # CHECK : Allocate ( A_local , int , { 21 , 11 } ) ; <nl> + # CHECK : Allocate ( A_local , int , { 231 } ) ; <nl> # CHECK : A_local [ j_1 + 11 * i_1 ] = <nl> # CHECK : B [ 10 * i_2 + j_2 ] = ( A_local [ ( j_2 + 11 * i_2 ) + 12 ] ) + ( A_local [ j_2 + 11 * i_2 ] ) ; <nl> ) IR " ; <nl> TEST ( LoopNest , CacheReadsInternal ) { <nl> oss < < * result ; <nl> const std : : string & expected_ir = <nl> R " IR ( <nl> - # CHECK : Allocate ( A_local , int , { 2 , 11 } ) ; <nl> + # CHECK : Allocate ( A_local , int , { 22 } ) ; <nl> # CHECK : A_local [ j_1 + 11 * i_2 ] = <nl> # CHECK : B [ 10 * i_1 + j_2 ] = ( A_local [ j_2 ] ) + ( A_local [ j_2 + 12 ] ) ; <nl> ) IR " ; <nl> TEST ( LoopNest , CacheReadsInner ) { <nl> oss < < * result ; <nl> const std : : string & expected_ir = <nl> R " IR ( <nl> - # CHECK : Allocate ( A_local , int , { 5 , 2 } ) ; <nl> + # CHECK : Allocate ( A_local , int , { 10 } ) ; <nl> # CHECK : A_local [ 2 * i_2 + j_2 ] = <nl> # CHECK : B [ 10 * i_1 + j_1 ] = ( A_local [ 8 ] ) + ( A_local [ 1 ] ) ; <nl> ) IR " ; <nl> TEST ( LoopNest , CacheWritesSimple ) { <nl> oss < < * result ; <nl> const std : : string & expected_ir = <nl> R " IR ( <nl> - # CHECK : Allocate ( A_local , int , { 1 , 64 } ) ; <nl> + # CHECK : Allocate ( A_local , int , { 64 } ) ; <nl> # CHECK : for ( int j = 0 ; j < 64 <nl> # CHECK : A_local [ j ] = i * j ; <nl> # CHECK : for ( int j_1 = 0 ; j_1 < 64 <nl> mmm a / test / cpp / tensorexpr / test_memdependency . cpp <nl> ppp b / test / cpp / tensorexpr / test_memdependency . cpp <nl> TEST ( MemDependency , MemDependencyCheckerComputeGEMM ) { <nl> stmt - > accept ( & analyzer_lowered ) ; <nl> <nl> / / Lowering will change the dimensionality of all bounds due to index <nl> - / / flattening , but not the number of accesses . <nl> + / / flattening and will insert Allocates and Frees . <nl> <nl> auto history_before = analyzer_unlowered . getHistory ( ) ; <nl> auto history_after = analyzer_lowered . getHistory ( ) ; <nl> <nl> + ASSERT_EQ ( history_before . size ( ) + 2 , history_after . size ( ) ) ; <nl> + <nl> + / / Filter out the alloc / free ; <nl> + auto isAllocFree = [ ] ( const auto & info ) { <nl> + return info - > type ( ) = = AccessType : : Alloc | | <nl> + info - > type ( ) = = AccessType : : Free ; <nl> + } ; <nl> + history_after . erase ( <nl> + std : : remove_if ( history_after . begin ( ) , history_after . end ( ) , isAllocFree ) , <nl> + history_after . end ( ) ) ; <nl> + <nl> ASSERT_EQ ( history_before . size ( ) , history_after . size ( ) ) ; <nl> <nl> for ( size_t i = 0 ; i < history_before . size ( ) ; + + i ) { <nl> ASSERT_EQ ( history_before [ i ] - > type ( ) , history_after [ i ] - > type ( ) ) ; <nl> ASSERT_EQ ( history_before [ i ] - > var ( ) , history_after [ i ] - > var ( ) ) ; <nl> - ASSERT_EQ ( <nl> - history_before [ i ] - > dependencies ( ) . size ( ) , <nl> - history_after [ i ] - > dependencies ( ) . size ( ) ) ; <nl> - ASSERT_EQ ( <nl> - history_before [ i ] - > dependents ( ) . size ( ) , <nl> - history_after [ i ] - > dependents ( ) . size ( ) ) ; <nl> + <nl> + if ( history_before [ i ] - > dependencies ( ) . size ( ) ! = <nl> + history_after [ i ] - > dependencies ( ) . size ( ) ) { <nl> + / / Must depend on an Alloc . <nl> + ASSERT_TRUE ( std : : any_of ( <nl> + history_after [ i ] - > dependencies ( ) . begin ( ) , <nl> + history_after [ i ] - > dependencies ( ) . end ( ) , <nl> + [ ] ( const auto & pair ) { <nl> + return pair . second - > type ( ) = = AccessType : : Alloc ; <nl> + } ) ) ; <nl> + <nl> + ASSERT_EQ ( <nl> + history_before [ i ] - > dependencies ( ) . size ( ) + 1 , <nl> + history_after [ i ] - > dependencies ( ) . size ( ) ) ; <nl> + } <nl> + <nl> + if ( history_before [ i ] - > dependents ( ) . size ( ) ! = <nl> + history_after [ i ] - > dependents ( ) . size ( ) ) { <nl> + / / Must depend on an Free . <nl> + ASSERT_TRUE ( std : : any_of ( <nl> + history_after [ i ] - > dependents ( ) . begin ( ) , <nl> + history_after [ i ] - > dependents ( ) . end ( ) , <nl> + [ ] ( const auto & pair ) { <nl> + return pair . second - > type ( ) = = AccessType : : Free ; <nl> + } ) ) ; <nl> + <nl> + ASSERT_EQ ( <nl> + history_before [ i ] - > dependents ( ) . size ( ) + 1 , <nl> + history_after [ i ] - > dependents ( ) . size ( ) ) ; <nl> + } <nl> <nl> / / Inputs and outputs are not flattened , only accesses . <nl> if ( history_before [ i ] - > type ( ) = = AccessType : : Input | | <nl> mmm a / test / cpp / tensorexpr / test_reductions . cpp <nl> ppp b / test / cpp / tensorexpr / test_reductions . cpp <nl> TEST ( Reductions , ReductionCacheBodyAccess ) { <nl> oss < < * result ; <nl> const std : : string & expected_ir = <nl> R " IR ( <nl> - # CHECK : Allocate ( scale_local , float , { 1 , 32 , 12 } ) ; <nl> + # CHECK : Allocate ( scale_local , float , { 384 } ) ; <nl> # CHECK : for ( int j = 0 ; j < 32 ; j + + ) { <nl> # CHECK : for ( int k = 0 ; k < 12 ; k + + ) { <nl> # CHECK : scale_local [ k + 12 * j ] = scale [ ( k + 384 * l1 ) + 12 * j ] ; <nl> mmm a / torch / csrc / jit / tensorexpr / loopnest . cpp <nl> ppp b / torch / csrc / jit / tensorexpr / loopnest . cpp <nl> Stmt * LoopNest : : insertAllocFree ( Stmt * stmt ) { <nl> / / Insert allocations and frees for temporary buffers in the innermost <nl> / / possible scope . <nl> for ( const Buf * buf : intermediate_bufs_ ) { <nl> - Stmt * alloc = new Allocate ( buf - > base_handle ( ) , buf - > dtype ( ) , buf - > dims ( ) ) ; <nl> + const Expr * flat_size = new IntImm ( 1 ) ; <nl> + for ( auto & d : buf - > dims ( ) ) { <nl> + flat_size = new Mul ( flat_size , d ) ; <nl> + } <nl> + flat_size = IRSimplifier : : simplify ( flat_size ) ; <nl> + Stmt * alloc = new Allocate ( buf - > base_handle ( ) , buf - > dtype ( ) , { flat_size } ) ; <nl> Stmt * free = new Free ( buf - > base_handle ( ) ) ; <nl> Block * alloc_block = findLowestContainingBlock ( uses . at ( buf ) ) ; <nl> alloc_block - > prepend_stmt ( alloc ) ; <nl> mmm a / torch / csrc / jit / tensorexpr / mem_dependency_checker . cpp <nl> ppp b / torch / csrc / jit / tensorexpr / mem_dependency_checker . cpp <nl> const char * AccessToString ( AccessType a ) { <nl> return " Call " ; <nl> case AccessType : : AtomicAdd : <nl> return " AtomicAdd " ; <nl> + case AccessType : : Alloc : <nl> + return " Alloc " ; <nl> + case AccessType : : Free : <nl> + return " Free " ; <nl> default : <nl> break ; <nl> } <nl> bool AccessInfo : : isWrite ( ) const { <nl> case AccessType : : Input : <nl> case AccessType : : Store : <nl> case AccessType : : AtomicAdd : <nl> + case AccessType : : Alloc : <nl> + case AccessType : : Free : <nl> return true ; <nl> default : <nl> break ; <nl> void AccessInfo : : print ( ) const { <nl> } <nl> <nl> void AccessInfo : : dumpDOT ( std : : ostream & os ) const { <nl> - if ( type_ = = AccessType : : Input | | type_ = = AccessType : : Output ) { <nl> + if ( type_ = = AccessType : : Input | | type_ = = AccessType : : Output | | <nl> + type_ = = AccessType : : Alloc ) { <nl> os < < " n " < < id_ < < " [ \ n " ; <nl> os < < " label = \ " " < < AccessToString ( type_ ) < < " \ \ n " < < * var_ < < " [ " ; <nl> if ( bounds_ . size ( ) > 0 ) { <nl> const char * AccessInfo : : AccessTypeColour ( ) const { <nl> return " dodgerblue " ; <nl> case AccessType : : Call : <nl> return " violet " ; <nl> + case AccessType : : Alloc : <nl> + case AccessType : : Free : <nl> + return " sandybrown " ; <nl> default : <nl> break ; <nl> } <nl> bool executionSafetyCheck ( <nl> const std : : vector < const Expr * > & aStrides , <nl> const std : : vector < const Expr * > & oStrides , <nl> bool parallelized ) { <nl> + if ( aStrides . empty ( ) | | oStrides . empty ( ) ) { <nl> + return false ; <nl> + } <nl> + TORCH_INTERNAL_ASSERT ( info - > bounds ( ) . size ( ) = = other - > bounds ( ) . size ( ) ) ; <nl> for ( size_t b = 0 ; b < info - > bounds ( ) . size ( ) ; + + b ) { <nl> const Expr * aIndexStride = aStrides [ b ] ; <nl> const Expr * oIndexStride = oStrides [ b ] ; <nl> void MemDependencyChecker : : visit ( const For * v ) { <nl> bool parallelized = v - > loop_options ( ) . is_gpu_block_index ( ) | | <nl> v - > loop_options ( ) . is_gpu_thread_index ( ) ; <nl> <nl> + / / Store buffers allocated at this scope . <nl> + std : : unordered_set < const Var * > local_intermediates ; <nl> + <nl> / / Scanning from the top of the loop , we look for accesses which may depend <nl> / / on a previous or parallel loop iteration . <nl> for ( size_t a = 0 ; a < currentScope_ - > accesses_ . size ( ) ; + + a ) { <nl> auto & info = currentScope_ - > accesses_ [ a ] ; <nl> + if ( info - > type ( ) = = AccessType : : Alloc ) { <nl> + local_intermediates . insert ( info - > var ( ) ) ; <nl> + continue ; <nl> + } <nl> + <nl> if ( ! info - > isRead ( ) ) { <nl> continue ; <nl> } <nl> <nl> + / / Vars that don ' t carry outside this scope can ' t have loop self dependence . <nl> + if ( local_intermediates . count ( info - > var ( ) ) ) { <nl> + continue ; <nl> + } <nl> + <nl> / / Copy the bounds so we can keep track of open bounds internally without <nl> / / affecting the merge into the enclosing scope . The open portion of the <nl> / / bounds may be cut into multiple independent slices . <nl> void MemDependencyChecker : : visit ( const AtomicAdd * v ) { <nl> throw std : : runtime_error ( " MemDependencyChecker AtomicAdd unimplemented " ) ; <nl> } <nl> <nl> + void MemDependencyChecker : : visit ( const Allocate * v ) { <nl> + const Stmt * last = lastStmt_ ; <nl> + lastStmt_ = v ; <nl> + <nl> + IRVisitor : : visit ( v ) ; <nl> + <nl> + const Var * var = v - > buffer_var ( ) ; <nl> + IndexBounds bounds ; <nl> + for ( auto * d : v - > dims ( ) ) { <nl> + bounds . push_back ( <nl> + { new IntImm ( 0 ) , IRSimplifier : : simplify ( new Sub ( d , new IntImm ( 1 ) ) ) } ) ; <nl> + } <nl> + auto info = std : : make_shared < AccessInfo > ( <nl> + nextAccess_ + + , AccessType : : Alloc , nullptr , var , bounds ) ; <nl> + <nl> + intermediates_ [ var ] = info ; <nl> + <nl> + auto & history = currentScope_ - > openWrites_ [ var ] ; <nl> + history . emplace_back ( std : : make_pair ( info - > bounds ( ) , info ) ) ; <nl> + currentScope_ - > accesses_ . push_back ( info ) ; <nl> + <nl> + lastStmt_ = last ; <nl> + } <nl> + <nl> + void MemDependencyChecker : : visit ( const Free * v ) { <nl> + const Stmt * last = lastStmt_ ; <nl> + lastStmt_ = v ; <nl> + <nl> + IRVisitor : : visit ( v ) ; <nl> + <nl> + const Var * var = v - > buffer_var ( ) ; <nl> + auto it = intermediates_ . find ( var ) ; <nl> + TORCH_INTERNAL_ASSERT ( it ! = intermediates_ . end ( ) ) ; <nl> + <nl> + IndexBounds bounds = it - > second - > bounds ( ) ; <nl> + auto info = std : : make_shared < AccessInfo > ( <nl> + nextAccess_ + + , AccessType : : Free , nullptr , var , bounds ) ; <nl> + <nl> + auto & history = currentScope_ - > openWrites_ [ var ] ; <nl> + updateWriteHistory ( history , info , info - > id ( ) ) ; <nl> + currentScope_ - > accesses_ . push_back ( info ) ; <nl> + <nl> + lastStmt_ = last ; <nl> + } <nl> + <nl> void MemDependencyChecker : : updateWriteHistory ( <nl> std : : list < BoundRelationship > & writeHistory , <nl> const std : : shared_ptr < AccessInfo > & info , <nl> mmm a / torch / csrc / jit / tensorexpr / mem_dependency_checker . h <nl> ppp b / torch / csrc / jit / tensorexpr / mem_dependency_checker . h <nl> namespace jit { <nl> namespace tensorexpr { <nl> namespace analysis { <nl> <nl> - enum class AccessType { Input , Output , Load , Store , Call , AtomicAdd } ; <nl> + enum class AccessType { <nl> + Input , <nl> + Output , <nl> + Load , <nl> + Store , <nl> + Call , <nl> + AtomicAdd , <nl> + Alloc , <nl> + Free <nl> + } ; <nl> const char * AccessToString ( AccessType a ) ; <nl> <nl> class AccessInfo ; <nl> class TORCH_API MemDependencyChecker : public IRVisitor { <nl> void visit ( const Block * v ) override ; <nl> void visit ( const Let * v ) override ; <nl> void visit ( const AtomicAdd * v ) override ; <nl> - <nl> - # define STMT_ON_STACK ( Op ) \ <nl> - virtual void visit ( const Op * v ) override { \ <nl> - const Stmt * last = lastStmt_ ; \ <nl> - lastStmt_ = v ; \ <nl> - IRVisitor : : visit ( v ) ; \ <nl> - lastStmt_ = last ; \ <nl> - } <nl> - STMT_ON_STACK ( Allocate ) ; <nl> - STMT_ON_STACK ( Free ) ; <nl> - <nl> - # undef STMT_ON_STACK <nl> + void visit ( const Allocate * v ) override ; <nl> + void visit ( const Free * v ) override ; <nl> <nl> using BoundRelationship = std : : pair < IndexBounds , std : : shared_ptr < AccessInfo > > ; <nl> <nl> class TORCH_API MemDependencyChecker : public IRVisitor { <nl> / / Maps for inputs and outputs , since they aren ' t present directly in the IR . <nl> std : : unordered_map < const Buf * , std : : shared_ptr < AccessInfo > > inputs_ ; <nl> std : : unordered_map < const Buf * , std : : shared_ptr < AccessInfo > > outputs_ ; <nl> + std : : unordered_map < const Var * , std : : shared_ptr < AccessInfo > > intermediates_ ; <nl> <nl> / / Inserts accesses for Buf ' s : specifically for inputs and outputs . <nl> void insertBuffers ( <nl>
|
[ NNC ] Intermediate allocs flattened and dependency support ( )
|
pytorch/pytorch
|
db2e9c1e7f326e8431e9f46b39d2c1abd6ea88f3
|
2020-12-21T18:35:15Z
|
mmm a / src / ppc / builtins - ppc . cc <nl> ppp b / src / ppc / builtins - ppc . cc <nl> void Builtins : : Generate_InOptimizationQueue ( MacroAssembler * masm ) { <nl> <nl> <nl> static void Generate_JSConstructStubHelper ( MacroAssembler * masm , <nl> - bool is_api_function ) { <nl> + bool is_api_function , <nl> + bool create_implicit_receiver ) { <nl> / / mmmmmmmmm - - S t a t e mmmmmmmmmmmm - <nl> / / - - r3 : number of arguments <nl> / / - - r4 : constructor function <nl> static void Generate_JSConstructStubHelper ( MacroAssembler * masm , <nl> <nl> / / Preserve the incoming parameters on the stack . <nl> __ AssertUndefinedOrAllocationSite ( r5 , r7 ) ; <nl> - __ SmiTag ( r3 ) ; <nl> - __ Push ( r5 , r3 , r4 , r6 ) ; <nl> - <nl> - / / Try to allocate the object without transitioning into C code . If any of <nl> - / / the preconditions is not met , the code bails out to the runtime call . <nl> - Label rt_call , allocated ; <nl> - if ( FLAG_inline_new ) { <nl> - / / Verify that the new target is a JSFunction . <nl> - __ CompareObjectType ( r6 , r8 , r7 , JS_FUNCTION_TYPE ) ; <nl> - __ bne ( & rt_call ) ; <nl> - <nl> - / / Load the initial map and verify that it is in fact a map . <nl> - / / r6 : new target <nl> - __ LoadP ( r5 , <nl> - FieldMemOperand ( r6 , JSFunction : : kPrototypeOrInitialMapOffset ) ) ; <nl> - __ JumpIfSmi ( r5 , & rt_call ) ; <nl> - __ CompareObjectType ( r5 , r8 , r7 , MAP_TYPE ) ; <nl> - __ bne ( & rt_call ) ; <nl> - <nl> - / / Fall back to runtime if the expected base constructor and base <nl> - / / constructor differ . <nl> - __ LoadP ( r8 , FieldMemOperand ( r5 , Map : : kConstructorOrBackPointerOffset ) ) ; <nl> - __ cmp ( r4 , r8 ) ; <nl> - __ bne ( & rt_call ) ; <nl> - <nl> - / / Check that the constructor is not constructing a JSFunction ( see <nl> - / / comments in Runtime_NewObject in runtime . cc ) . In which case the <nl> - / / initial map ' s instance type would be JS_FUNCTION_TYPE . <nl> - / / r4 : constructor function <nl> - / / r5 : initial map <nl> - __ CompareInstanceType ( r5 , r8 , JS_FUNCTION_TYPE ) ; <nl> - __ beq ( & rt_call ) ; <nl> - <nl> - if ( ! is_api_function ) { <nl> - Label allocate ; <nl> - MemOperand bit_field3 = FieldMemOperand ( r5 , Map : : kBitField3Offset ) ; <nl> - / / Check if slack tracking is enabled . <nl> - __ lwz ( r7 , bit_field3 ) ; <nl> - __ DecodeField < Map : : Counter > ( r11 , r7 ) ; <nl> - __ cmpi ( r11 , Operand ( Map : : kSlackTrackingCounterEnd ) ) ; <nl> - __ blt ( & allocate ) ; <nl> - / / Decrease generous allocation count . <nl> - __ Add ( r7 , r7 , - ( 1 < < Map : : Counter : : kShift ) , r0 ) ; <nl> - __ stw ( r7 , bit_field3 ) ; <nl> - __ cmpi ( r11 , Operand ( Map : : kSlackTrackingCounterEnd ) ) ; <nl> - __ bne ( & allocate ) ; <nl> - <nl> - __ Push ( r4 , r5 , r5 ) ; / / r5 = initial map <nl> - __ CallRuntime ( Runtime : : kFinalizeInstanceSize , 1 ) ; <nl> - <nl> - __ Pop ( r4 , r5 ) ; <nl> - <nl> - __ bind ( & allocate ) ; <nl> - } <nl> - <nl> - / / Now allocate the JSObject on the heap . <nl> - / / r4 : constructor function <nl> - / / r5 : initial map <nl> - Label rt_call_reload_new_target ; <nl> - __ lbz ( r6 , FieldMemOperand ( r5 , Map : : kInstanceSizeOffset ) ) ; <nl> - <nl> - __ Allocate ( r6 , r7 , r8 , r9 , & rt_call_reload_new_target , SIZE_IN_WORDS ) ; <nl> <nl> - / / Allocated the JSObject , now initialize the fields . Map is set to <nl> - / / initial map and properties and elements are set to empty fixed array . <nl> - / / r4 : constructor function <nl> - / / r5 : initial map <nl> - / / r6 : object size <nl> - / / r7 : JSObject ( not tagged ) <nl> - __ LoadRoot ( r9 , Heap : : kEmptyFixedArrayRootIndex ) ; <nl> - __ mr ( r8 , r7 ) ; <nl> - __ StoreP ( r5 , MemOperand ( r8 , JSObject : : kMapOffset ) ) ; <nl> - __ StoreP ( r9 , MemOperand ( r8 , JSObject : : kPropertiesOffset ) ) ; <nl> - __ StoreP ( r9 , MemOperand ( r8 , JSObject : : kElementsOffset ) ) ; <nl> - __ addi ( r8 , r8 , Operand ( JSObject : : kElementsOffset + kPointerSize ) ) ; <nl> - <nl> - __ ShiftLeftImm ( r9 , r6 , Operand ( kPointerSizeLog2 ) ) ; <nl> - __ add ( r9 , r7 , r9 ) ; / / End of object . <nl> - <nl> - / / Fill all the in - object properties with the appropriate filler . <nl> - / / r4 : constructor function <nl> - / / r5 : initial map <nl> - / / r6 : object size <nl> - / / r7 : JSObject ( not tagged ) <nl> - / / r8 : First in - object property of JSObject ( not tagged ) <nl> - / / r9 : End of object <nl> - DCHECK_EQ ( 3 * kPointerSize , JSObject : : kHeaderSize ) ; <nl> - __ LoadRoot ( r10 , Heap : : kUndefinedValueRootIndex ) ; <nl> - <nl> - if ( ! is_api_function ) { <nl> - Label no_inobject_slack_tracking ; <nl> - <nl> - / / Check if slack tracking is enabled . <nl> - __ cmpi ( r11 , Operand ( Map : : kSlackTrackingCounterEnd ) ) ; <nl> - __ blt ( & no_inobject_slack_tracking ) ; <nl> - <nl> - / / Allocate object with a slack . <nl> - __ lbz ( <nl> - r3 , <nl> - FieldMemOperand ( <nl> - r5 , Map : : kInObjectPropertiesOrConstructorFunctionIndexOffset ) ) ; <nl> - __ lbz ( r5 , FieldMemOperand ( r5 , Map : : kUnusedPropertyFieldsOffset ) ) ; <nl> - __ sub ( r3 , r3 , r5 ) ; <nl> - if ( FLAG_debug_code ) { <nl> - __ ShiftLeftImm ( r0 , r3 , Operand ( kPointerSizeLog2 ) ) ; <nl> - __ add ( r0 , r8 , r0 ) ; <nl> - / / r0 : offset of first field after pre - allocated fields <nl> - __ cmp ( r0 , r9 ) ; <nl> - __ Assert ( le , kUnexpectedNumberOfPreAllocatedPropertyFields ) ; <nl> - } <nl> - { <nl> - Label done ; <nl> - __ cmpi ( r3 , Operand : : Zero ( ) ) ; <nl> - __ beq ( & done ) ; <nl> - __ InitializeNFieldsWithFiller ( r8 , r3 , r10 ) ; <nl> - __ bind ( & done ) ; <nl> + if ( ! create_implicit_receiver ) { <nl> + / / Push new . target onto the construct frame . This is stored just below the <nl> + / / receiver on the stack . <nl> + __ SmiTag ( r7 , r3 , SetRC ) ; <nl> + __ Push ( r5 , r7 , r6 ) ; <nl> + __ PushRoot ( Heap : : kTheHoleValueRootIndex ) ; <nl> + } else { <nl> + __ SmiTag ( r3 ) ; <nl> + __ Push ( r5 , r3 , r4 , r6 ) ; <nl> + <nl> + / / Try to allocate the object without transitioning into C code . If any of <nl> + / / the preconditions is not met , the code bails out to the runtime call . <nl> + Label rt_call , allocated ; <nl> + if ( FLAG_inline_new ) { <nl> + / / Verify that the new target is a JSFunction . <nl> + __ CompareObjectType ( r6 , r8 , r7 , JS_FUNCTION_TYPE ) ; <nl> + __ bne ( & rt_call ) ; <nl> + <nl> + / / Load the initial map and verify that it is in fact a map . <nl> + / / r6 : new target <nl> + __ LoadP ( r5 , <nl> + FieldMemOperand ( r6 , JSFunction : : kPrototypeOrInitialMapOffset ) ) ; <nl> + __ JumpIfSmi ( r5 , & rt_call ) ; <nl> + __ CompareObjectType ( r5 , r8 , r7 , MAP_TYPE ) ; <nl> + __ bne ( & rt_call ) ; <nl> + <nl> + / / Fall back to runtime if the expected base constructor and base <nl> + / / constructor differ . <nl> + __ LoadP ( r8 , FieldMemOperand ( r5 , Map : : kConstructorOrBackPointerOffset ) ) ; <nl> + __ cmp ( r4 , r8 ) ; <nl> + __ bne ( & rt_call ) ; <nl> + <nl> + / / Check that the constructor is not constructing a JSFunction ( see <nl> + / / comments in Runtime_NewObject in runtime . cc ) . In which case the <nl> + / / initial map ' s instance type would be JS_FUNCTION_TYPE . <nl> + / / r4 : constructor function <nl> + / / r5 : initial map <nl> + __ CompareInstanceType ( r5 , r8 , JS_FUNCTION_TYPE ) ; <nl> + __ beq ( & rt_call ) ; <nl> + <nl> + if ( ! is_api_function ) { <nl> + Label allocate ; <nl> + MemOperand bit_field3 = FieldMemOperand ( r5 , Map : : kBitField3Offset ) ; <nl> + / / Check if slack tracking is enabled . <nl> + __ lwz ( r7 , bit_field3 ) ; <nl> + __ DecodeField < Map : : Counter > ( r11 , r7 ) ; <nl> + __ cmpi ( r11 , Operand ( Map : : kSlackTrackingCounterEnd ) ) ; <nl> + __ blt ( & allocate ) ; <nl> + / / Decrease generous allocation count . <nl> + __ Add ( r7 , r7 , - ( 1 < < Map : : Counter : : kShift ) , r0 ) ; <nl> + __ stw ( r7 , bit_field3 ) ; <nl> + __ cmpi ( r11 , Operand ( Map : : kSlackTrackingCounterEnd ) ) ; <nl> + __ bne ( & allocate ) ; <nl> + <nl> + __ Push ( r4 , r5 , r5 ) ; / / r5 = initial map <nl> + __ CallRuntime ( Runtime : : kFinalizeInstanceSize , 1 ) ; <nl> + <nl> + __ Pop ( r4 , r5 ) ; <nl> + <nl> + __ bind ( & allocate ) ; <nl> } <nl> - / / To allow for truncation . <nl> - __ LoadRoot ( r10 , Heap : : kOnePointerFillerMapRootIndex ) ; <nl> - / / Fill the remaining fields with one pointer filler map . <nl> <nl> - __ bind ( & no_inobject_slack_tracking ) ; <nl> - } <nl> + / / Now allocate the JSObject on the heap . <nl> + / / r4 : constructor function <nl> + / / r5 : initial map <nl> + Label rt_call_reload_new_target ; <nl> + __ lbz ( r6 , FieldMemOperand ( r5 , Map : : kInstanceSizeOffset ) ) ; <nl> + <nl> + __ Allocate ( r6 , r7 , r8 , r9 , & rt_call_reload_new_target , SIZE_IN_WORDS ) ; <nl> + <nl> + / / Allocated the JSObject , now initialize the fields . Map is set to <nl> + / / initial map and properties and elements are set to empty fixed array . <nl> + / / r4 : constructor function <nl> + / / r5 : initial map <nl> + / / r6 : object size <nl> + / / r7 : JSObject ( not tagged ) <nl> + __ LoadRoot ( r9 , Heap : : kEmptyFixedArrayRootIndex ) ; <nl> + __ mr ( r8 , r7 ) ; <nl> + __ StoreP ( r5 , MemOperand ( r8 , JSObject : : kMapOffset ) ) ; <nl> + __ StoreP ( r9 , MemOperand ( r8 , JSObject : : kPropertiesOffset ) ) ; <nl> + __ StoreP ( r9 , MemOperand ( r8 , JSObject : : kElementsOffset ) ) ; <nl> + __ addi ( r8 , r8 , Operand ( JSObject : : kElementsOffset + kPointerSize ) ) ; <nl> + <nl> + __ ShiftLeftImm ( r9 , r6 , Operand ( kPointerSizeLog2 ) ) ; <nl> + __ add ( r9 , r7 , r9 ) ; / / End of object . <nl> + <nl> + / / Fill all the in - object properties with the appropriate filler . <nl> + / / r4 : constructor function <nl> + / / r5 : initial map <nl> + / / r6 : object size <nl> + / / r7 : JSObject ( not tagged ) <nl> + / / r8 : First in - object property of JSObject ( not tagged ) <nl> + / / r9 : End of object <nl> + DCHECK_EQ ( 3 * kPointerSize , JSObject : : kHeaderSize ) ; <nl> + __ LoadRoot ( r10 , Heap : : kUndefinedValueRootIndex ) ; <nl> + <nl> + if ( ! is_api_function ) { <nl> + Label no_inobject_slack_tracking ; <nl> + <nl> + / / Check if slack tracking is enabled . <nl> + __ cmpi ( r11 , Operand ( Map : : kSlackTrackingCounterEnd ) ) ; <nl> + __ blt ( & no_inobject_slack_tracking ) ; <nl> + <nl> + / / Allocate object with a slack . <nl> + __ lbz ( r3 , <nl> + FieldMemOperand ( <nl> + r5 , <nl> + Map : : kInObjectPropertiesOrConstructorFunctionIndexOffset ) ) ; <nl> + __ lbz ( r5 , FieldMemOperand ( r5 , Map : : kUnusedPropertyFieldsOffset ) ) ; <nl> + __ sub ( r3 , r3 , r5 ) ; <nl> + if ( FLAG_debug_code ) { <nl> + __ ShiftLeftImm ( r0 , r3 , Operand ( kPointerSizeLog2 ) ) ; <nl> + __ add ( r0 , r8 , r0 ) ; <nl> + / / r0 : offset of first field after pre - allocated fields <nl> + __ cmp ( r0 , r9 ) ; <nl> + __ Assert ( le , kUnexpectedNumberOfPreAllocatedPropertyFields ) ; <nl> + } <nl> + { <nl> + Label done ; <nl> + __ cmpi ( r3 , Operand : : Zero ( ) ) ; <nl> + __ beq ( & done ) ; <nl> + __ InitializeNFieldsWithFiller ( r8 , r3 , r10 ) ; <nl> + __ bind ( & done ) ; <nl> + } <nl> + / / To allow for truncation . <nl> + __ LoadRoot ( r10 , Heap : : kOnePointerFillerMapRootIndex ) ; <nl> + / / Fill the remaining fields with one pointer filler map . <nl> + <nl> + __ bind ( & no_inobject_slack_tracking ) ; <nl> + } <nl> <nl> - __ InitializeFieldsWithFiller ( r8 , r9 , r10 ) ; <nl> + __ InitializeFieldsWithFiller ( r8 , r9 , r10 ) ; <nl> <nl> - / / Add the object tag to make the JSObject real , so that we can continue <nl> - / / and jump into the continuation code at any time from now on . <nl> - __ addi ( r7 , r7 , Operand ( kHeapObjectTag ) ) ; <nl> + / / Add the object tag to make the JSObject real , so that we can continue <nl> + / / and jump into the continuation code at any time from now on . <nl> + __ addi ( r7 , r7 , Operand ( kHeapObjectTag ) ) ; <nl> <nl> - / / Continue with JSObject being successfully allocated <nl> - / / r7 : JSObject <nl> - __ b ( & allocated ) ; <nl> + / / Continue with JSObject being successfully allocated <nl> + / / r7 : JSObject <nl> + __ b ( & allocated ) ; <nl> <nl> - / / Reload the new target and fall - through . <nl> - __ bind ( & rt_call_reload_new_target ) ; <nl> - __ LoadP ( r6 , MemOperand ( sp , 0 * kPointerSize ) ) ; <nl> - } <nl> + / / Reload the new target and fall - through . <nl> + __ bind ( & rt_call_reload_new_target ) ; <nl> + __ LoadP ( r6 , MemOperand ( sp , 0 * kPointerSize ) ) ; <nl> + } <nl> <nl> - / / Allocate the new receiver object using the runtime call . <nl> - / / r4 : constructor function <nl> - / / r6 : new target <nl> - __ bind ( & rt_call ) ; <nl> - __ Push ( r4 , r6 ) ; / / constructor function , new target <nl> - __ CallRuntime ( Runtime : : kNewObject , 2 ) ; <nl> - __ mr ( r7 , r3 ) ; <nl> + / / Allocate the new receiver object using the runtime call . <nl> + / / r4 : constructor function <nl> + / / r6 : new target <nl> + __ bind ( & rt_call ) ; <nl> + __ Push ( r4 , r6 ) ; / / constructor function , new target <nl> + __ CallRuntime ( Runtime : : kNewObject , 2 ) ; <nl> + __ mr ( r7 , r3 ) ; <nl> <nl> - / / Receiver for constructor call allocated . <nl> - / / r7 : JSObject <nl> - __ bind ( & allocated ) ; <nl> + / / Receiver for constructor call allocated . <nl> + / / r7 : JSObject <nl> + __ bind ( & allocated ) ; <nl> <nl> - / / Restore the parameters . <nl> - __ Pop ( r4 , ip ) ; <nl> + / / Restore the parameters . <nl> + __ Pop ( r4 , r6 ) ; <nl> <nl> - / / Retrieve smi - tagged arguments count from the stack . <nl> - __ LoadP ( r6 , MemOperand ( sp ) ) ; <nl> + / / Retrieve smi - tagged arguments count from the stack . <nl> + __ LoadP ( r3 , MemOperand ( sp ) ) ; <nl> + __ SmiUntag ( r3 , SetRC ) ; <nl> <nl> - / / Push new . target onto the construct frame . This is stored just below the <nl> - / / receiver on the stack . <nl> - __ Push ( ip , r7 , r7 ) ; <nl> + / / Push new . target onto the construct frame . This is stored just below the <nl> + / / receiver on the stack . <nl> + / / Push the allocated receiver to the stack . We need two copies <nl> + / / because we may have to return the original one and the calling <nl> + / / conventions dictate that the called function pops the receiver . <nl> + __ Push ( r6 , r7 , r7 ) ; <nl> + } <nl> <nl> / / Set up pointer to last argument . <nl> __ addi ( r5 , fp , Operand ( StandardFrameConstants : : kCallerSPOffset ) ) ; <nl> <nl> / / Copy arguments and receiver to the expression stack . <nl> + / / r3 : number of arguments <nl> / / r4 : constructor function <nl> / / r5 : address of last argument ( caller sp ) <nl> - / / r6 : number of arguments ( smi - tagged ) <nl> + / / cr0 : condition indicating whether r3 is zero <nl> / / sp [ 0 ] : receiver <nl> / / sp [ 1 ] : receiver <nl> / / sp [ 2 ] : new . target <nl> / / sp [ 3 ] : number of arguments ( smi - tagged ) <nl> Label loop , no_args ; <nl> - __ SmiUntag ( r3 , r6 , SetRC ) ; <nl> __ beq ( & no_args , cr0 ) ; <nl> __ ShiftLeftImm ( ip , r3 , Operand ( kPointerSizeLog2 ) ) ; <nl> __ sub ( sp , sp , ip ) ; <nl> static void Generate_JSConstructStubHelper ( MacroAssembler * masm , <nl> } <nl> <nl> / / Store offset of return address for deoptimizer . <nl> - if ( ! is_api_function ) { <nl> + if ( create_implicit_receiver & & ! is_api_function ) { <nl> masm - > isolate ( ) - > heap ( ) - > SetConstructStubDeoptPCOffset ( masm - > pc_offset ( ) ) ; <nl> } <nl> <nl> static void Generate_JSConstructStubHelper ( MacroAssembler * masm , <nl> / / sp [ 2 ] : number of arguments ( smi - tagged ) <nl> __ LoadP ( cp , MemOperand ( fp , StandardFrameConstants : : kContextOffset ) ) ; <nl> <nl> - / / If the result is an object ( in the ECMA sense ) , we should get rid <nl> - / / of the receiver and use the result ; see ECMA - 262 section 13 . 2 . 2 - 7 <nl> - / / on page 74 . <nl> - Label use_receiver , exit ; <nl> - <nl> - / / If the result is a smi , it is * not * an object in the ECMA sense . <nl> - / / r3 : result <nl> - / / sp [ 0 ] : receiver <nl> - / / sp [ 1 ] : new . target <nl> - / / sp [ 2 ] : number of arguments ( smi - tagged ) <nl> - __ JumpIfSmi ( r3 , & use_receiver ) ; <nl> - <nl> - / / If the type of the result ( stored in its map ) is less than <nl> - / / FIRST_SPEC_OBJECT_TYPE , it is not an object in the ECMA sense . <nl> - __ CompareObjectType ( r3 , r4 , r6 , FIRST_SPEC_OBJECT_TYPE ) ; <nl> - __ bge ( & exit ) ; <nl> - <nl> - / / Throw away the result of the constructor invocation and use the <nl> - / / on - stack receiver as the result . <nl> - __ bind ( & use_receiver ) ; <nl> - __ LoadP ( r3 , MemOperand ( sp ) ) ; <nl> - <nl> - / / Remove receiver from the stack , remove caller arguments , and <nl> - / / return . <nl> - __ bind ( & exit ) ; <nl> - / / r3 : result <nl> - / / sp [ 0 ] : receiver ( newly allocated object ) <nl> - / / sp [ 1 ] : new . target ( new target ) <nl> - / / sp [ 2 ] : number of arguments ( smi - tagged ) <nl> - __ LoadP ( r4 , MemOperand ( sp , 2 * kPointerSize ) ) ; <nl> + if ( create_implicit_receiver ) { <nl> + / / If the result is an object ( in the ECMA sense ) , we should get rid <nl> + / / of the receiver and use the result ; see ECMA - 262 section 13 . 2 . 2 - 7 <nl> + / / on page 74 . <nl> + Label use_receiver , exit ; <nl> + <nl> + / / If the result is a smi , it is * not * an object in the ECMA sense . <nl> + / / r3 : result <nl> + / / sp [ 0 ] : receiver <nl> + / / sp [ 1 ] : new . target <nl> + / / sp [ 2 ] : number of arguments ( smi - tagged ) <nl> + __ JumpIfSmi ( r3 , & use_receiver ) ; <nl> + <nl> + / / If the type of the result ( stored in its map ) is less than <nl> + / / FIRST_SPEC_OBJECT_TYPE , it is not an object in the ECMA sense . <nl> + __ CompareObjectType ( r3 , r4 , r6 , FIRST_SPEC_OBJECT_TYPE ) ; <nl> + __ bge ( & exit ) ; <nl> + <nl> + / / Throw away the result of the constructor invocation and use the <nl> + / / on - stack receiver as the result . <nl> + __ bind ( & use_receiver ) ; <nl> + __ LoadP ( r3 , MemOperand ( sp ) ) ; <nl> + <nl> + / / Remove receiver from the stack , remove caller arguments , and <nl> + / / return . <nl> + __ bind ( & exit ) ; <nl> + / / r3 : result <nl> + / / sp [ 0 ] : receiver ( newly allocated object ) <nl> + / / sp [ 1 ] : new . target ( new target ) <nl> + / / sp [ 2 ] : number of arguments ( smi - tagged ) <nl> + __ LoadP ( r4 , MemOperand ( sp , 2 * kPointerSize ) ) ; <nl> + } else { <nl> + __ LoadP ( r4 , MemOperand ( sp , kPointerSize ) ) ; <nl> + } <nl> <nl> / / Leave construct frame . <nl> } <nl> static void Generate_JSConstructStubHelper ( MacroAssembler * masm , <nl> __ SmiToPtrArrayOffset ( r4 , r4 ) ; <nl> __ add ( sp , sp , r4 ) ; <nl> __ addi ( sp , sp , Operand ( kPointerSize ) ) ; <nl> - __ IncrementCounter ( isolate - > counters ( ) - > constructed_objects ( ) , 1 , r4 , r5 ) ; <nl> + if ( create_implicit_receiver ) { <nl> + __ IncrementCounter ( isolate - > counters ( ) - > constructed_objects ( ) , 1 , r4 , r5 ) ; <nl> + } <nl> __ blr ( ) ; <nl> } <nl> <nl> <nl> void Builtins : : Generate_JSConstructStubGeneric ( MacroAssembler * masm ) { <nl> - Generate_JSConstructStubHelper ( masm , false ) ; <nl> + Generate_JSConstructStubHelper ( masm , false , true ) ; <nl> } <nl> <nl> <nl> void Builtins : : Generate_JSConstructStubApi ( MacroAssembler * masm ) { <nl> - Generate_JSConstructStubHelper ( masm , true ) ; <nl> + Generate_JSConstructStubHelper ( masm , true , true ) ; <nl> } <nl> <nl> <nl> - void Builtins : : Generate_JSConstructStubForDerived ( MacroAssembler * masm ) { <nl> - / / mmmmmmmmm - - S t a t e mmmmmmmmmmmm - <nl> - / / - - r3 : number of arguments <nl> - / / - - r4 : constructor function <nl> - / / - - r5 : allocation site or undefined <nl> - / / - - r6 : new target <nl> - / / - - lr : return address <nl> - / / - - sp [ . . . ] : constructor arguments <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - { <nl> - FrameAndConstantPoolScope scope ( masm , StackFrame : : CONSTRUCT ) ; <nl> - <nl> - __ AssertUndefinedOrAllocationSite ( r5 , r7 ) ; <nl> - <nl> - / / Smi - tagged arguments count . <nl> - __ mr ( r7 , r3 ) ; <nl> - __ SmiTag ( r7 , SetRC ) ; <nl> - <nl> - / / receiver is the hole . <nl> - __ LoadRoot ( ip , Heap : : kTheHoleValueRootIndex ) ; <nl> - <nl> - / / allocation site , smi arguments count , new . target , receiver <nl> - __ Push ( r5 , r7 , r6 , ip ) ; <nl> - <nl> - / / Set up pointer to last argument . <nl> - __ addi ( r5 , fp , Operand ( StandardFrameConstants : : kCallerSPOffset ) ) ; <nl> - <nl> - / / Copy arguments and receiver to the expression stack . <nl> - / / r3 : number of arguments <nl> - / / r4 : constructor function <nl> - / / r5 : address of last argument ( caller sp ) <nl> - / / r7 : number of arguments ( smi - tagged ) <nl> - / / cr0 : compare against zero of arguments <nl> - / / sp [ 0 ] : receiver <nl> - / / sp [ 1 ] : new . target <nl> - / / sp [ 2 ] : number of arguments ( smi - tagged ) <nl> - Label loop , no_args ; <nl> - __ beq ( & no_args , cr0 ) ; <nl> - __ ShiftLeftImm ( ip , r3 , Operand ( kPointerSizeLog2 ) ) ; <nl> - __ mtctr ( r3 ) ; <nl> - __ bind ( & loop ) ; <nl> - __ subi ( ip , ip , Operand ( kPointerSize ) ) ; <nl> - __ LoadPX ( r0 , MemOperand ( r5 , ip ) ) ; <nl> - __ push ( r0 ) ; <nl> - __ bdnz ( & loop ) ; <nl> - __ bind ( & no_args ) ; <nl> - <nl> - / / Call the function . <nl> - / / r3 : number of arguments <nl> - / / r4 : constructor function <nl> - ParameterCount actual ( r3 ) ; <nl> - __ InvokeFunction ( r4 , actual , CALL_FUNCTION , NullCallWrapper ( ) ) ; <nl> - <nl> - / / Restore context from the frame . <nl> - / / r3 : result <nl> - / / sp [ 0 ] : number of arguments ( smi - tagged ) <nl> - __ LoadP ( cp , MemOperand ( fp , StandardFrameConstants : : kContextOffset ) ) ; <nl> - / / Get arguments count , skipping over new . target . <nl> - __ LoadP ( r4 , MemOperand ( sp , kPointerSize ) ) ; <nl> - <nl> - / / Leave construct frame . <nl> - } <nl> - <nl> - __ SmiToPtrArrayOffset ( r4 , r4 ) ; <nl> - __ add ( sp , sp , r4 ) ; <nl> - __ addi ( sp , sp , Operand ( kPointerSize ) ) ; <nl> - __ blr ( ) ; <nl> + void Builtins : : Generate_JSBuiltinsConstructStub ( MacroAssembler * masm ) { <nl> + Generate_JSConstructStubHelper ( masm , false , false ) ; <nl> } <nl> <nl> <nl>
|
PPC : Introduce a BuiltinsConstructStub that sets up new . target and does a [ [ call ] ] per ES6 9 . 3 . 2
|
v8/v8
|
289c54cff97f92eeb5068e0d7f255af9a533dd23
|
2015-11-19T23:08:29Z
|
mmm a / HOW - TO - BUILD . md <nl> ppp b / HOW - TO - BUILD . md <nl> The environment required to build weex is categorized by platforms . <nl> # # Android <nl> * JDK ` 1 . 8 + ` <nl> * Android SDK Platform 28 <nl> - * ` $ ANDROID_HOME ` must be configured by using ` export ANDROID_HOME = / path_to_ndk ` <nl> + * ` $ ANDROID_HOME ` must be configured by using ` export ANDROID_HOME = / path_to_sdk ` <nl> * Normally , you should install [ Android Studio ] ( https : / / developer . android . com / studio ) to get Android SDK Platform 28 installed . <nl> * Gradle 4 . 10 + <nl> * NDK ` r18 ` <nl>
|
update HOW - TO - BUILD . md ( )
|
apache/incubator-weex
|
cadd403fc884d81ec4688a691dff90986871ed09
|
2019-10-16T15:44:51Z
|
mmm a / R - package / R / xgb . model . dt . tree . R <nl> ppp b / R - package / R / xgb . model . dt . tree . R <nl> <nl> # ' <nl> # ' bst < - xgboost ( data = train $ data , label = train $ label , max . depth = 2 , <nl> # ' eta = 1 , nround = 2 , objective = " binary : logistic " ) <nl> - # ' xgb . dump ( bst , ' xgb . model . dump ' , with . stats = T ) <nl> + # ' xgb . dump ( bst , ' xgb . model . dump ' , with . stats = TRUE ) <nl> # ' <nl> # ' # agaricus . test $ data @ @ Dimnames [ [ 2 ] ] represents the column names of the sparse matrix . <nl> # ' xgb . model . dt . tree ( agaricus . train $ data @ @ Dimnames [ [ 2 ] ] , filename_dump = ' xgb . model . dump ' ) <nl> mmm a / R - package / man / xgb . model . dt . tree . Rd <nl> ppp b / R - package / man / xgb . model . dt . tree . Rd <nl> train < - agaricus . train <nl> <nl> bst < - xgboost ( data = train $ data , label = train $ label , max . depth = 2 , <nl> eta = 1 , nround = 2 , objective = " binary : logistic " ) <nl> - xgb . dump ( bst , ' xgb . model . dump ' , with . stats = T ) <nl> + xgb . dump ( bst , ' xgb . model . dump ' , with . stats = TRUE ) <nl> <nl> # agaricus . test $ data @ Dimnames [ [ 2 ] ] represents the column names of the sparse matrix . <nl> xgb . model . dt . tree ( agaricus . train $ data @ Dimnames [ [ 2 ] ] , filename_dump = ' xgb . model . dump ' ) <nl>
|
documentation update
|
dmlc/xgboost
|
42110f3d70355ed05cd0aec176e2511b9a4f7489
|
2015-01-21T00:24:01Z
|
mmm a / CMakeLists . txt <nl> ppp b / CMakeLists . txt <nl> if ( WITH_MATLAB ) <nl> include ( cmake / OpenCVFindMatlab . cmake ) <nl> endif ( ) <nl> <nl> - include ( cmake / OpenCVDetectVTK . cmake ) <nl> + if ( WITH_VTK ) <nl> + include ( cmake / OpenCVDetectVTK . cmake ) <nl> + endif ( ) <nl> <nl> if ( WITH_OPENVX ) <nl> include ( cmake / FindOpenVX . cmake ) <nl> mmm a / cmake / OpenCVDetectVTK . cmake <nl> ppp b / cmake / OpenCVDetectVTK . cmake <nl> <nl> - if ( NOT WITH_VTK ) <nl> - return ( ) <nl> - endif ( ) <nl> - <nl> # VTK 6 . x components <nl> find_package ( VTK QUIET COMPONENTS vtkInteractionStyle vtkRenderingLOD vtkIOPLY vtkFiltersTexture vtkRenderingFreeType vtkIOExport NO_MODULE ) <nl> IF ( VTK_FOUND ) <nl> mmm a / modules / viz / CMakeLists . txt <nl> ppp b / modules / viz / CMakeLists . txt <nl> <nl> - if ( NOT WITH_VTK OR NOT DEFINED HAVE_VTK OR NOT HAVE_VTK ) <nl> + if ( NOT HAVE_VTK ) <nl> ocv_module_disable ( viz ) <nl> endif ( ) <nl> <nl>
|
cmake : fix WITH_VTK usage
|
opencv/opencv
|
22c0bb7dc9570416d6c4beec54735b6a58dac495
|
2017-11-29T18:43:09Z
|
mmm a / modules / prediction / evaluator / evaluator_manager . cc <nl> ppp b / modules / prediction / evaluator / evaluator_manager . cc <nl> <nl> # include " modules / prediction / evaluator / evaluator_manager . h " <nl> <nl> # include < algorithm > <nl> - # include < map > <nl> + # include < unordered_map > <nl> # include < vector > <nl> <nl> # include " modules / common / configs / vehicle_config_helper . h " <nl> namespace prediction { <nl> <nl> using apollo : : common : : adapter : : AdapterConfig ; <nl> using apollo : : perception : : PerceptionObstacle ; <nl> - using IdObstacleMap = std : : map < int , std : : list < Obstacle * > > ; <nl> + using IdObstacleListMap = std : : unordered_map < int , std : : list < Obstacle * > > ; <nl> <nl> namespace { <nl> <nl> bool IsTrainable ( const Feature & feature ) { <nl> <nl> void GroupObstaclesByObstacleId ( const int obstacle_id , <nl> ObstaclesContainer * const obstacles_container , <nl> - IdObstacleMap * const id_obstacle_map ) { <nl> + IdObstacleListMap * const id_obstacle_map ) { <nl> Obstacle * obstacle_ptr = obstacles_container - > GetObstacle ( obstacle_id ) ; <nl> if ( obstacle_ptr = = nullptr ) { <nl> AERROR < < " Null obstacle [ " < < obstacle_id < < " ] found " ; <nl> void EvaluatorManager : : Run ( ) { <nl> std : : vector < Obstacle * > dynamic_env ; <nl> <nl> if ( FLAGS_enable_multi_thread ) { <nl> - IdObstacleMap id_obstacle_map ; <nl> + IdObstacleListMap id_obstacle_map ; <nl> for ( int id : obstacles_container - > curr_frame_considered_obstacle_ids ( ) ) { <nl> GroupObstaclesByObstacleId ( id , obstacles_container , & id_obstacle_map ) ; <nl> } <nl> PredictionThreadPool : : ForEach ( <nl> id_obstacle_map . begin ( ) , id_obstacle_map . end ( ) , <nl> - [ & ] ( IdObstacleMap : : iterator : : value_type & obstacles_iter ) { <nl> + [ & ] ( IdObstacleListMap : : iterator : : value_type & obstacles_iter ) { <nl> / / TODO ( kechxu ) : parallelize this level <nl> for ( auto obstacle_ptr : obstacles_iter . second ) { <nl> EvaluateObstacle ( obstacle_ptr , dynamic_env ) ; <nl> mmm a / modules / prediction / predictor / predictor_manager . cc <nl> ppp b / modules / prediction / predictor / predictor_manager . cc <nl> <nl> <nl> # include " modules / prediction / predictor / predictor_manager . h " <nl> <nl> + # include < list > <nl> + # include < memory > <nl> + # include < unordered_map > <nl> + <nl> # include " modules / prediction / common / feature_output . h " <nl> # include " modules / prediction / common / prediction_gflags . h " <nl> # include " modules / prediction / common / prediction_system_gflags . h " <nl> namespace prediction { <nl> <nl> using apollo : : common : : adapter : : AdapterConfig ; <nl> using apollo : : perception : : PerceptionObstacle ; <nl> - using IdObstacleMap = std : : map < int , std : : list < Obstacle * > > ; <nl> + using IdObstacleListMap = std : : unordered_map < int , std : : list < Obstacle * > > ; <nl> + using IdPredictionObstacleMap = <nl> + std : : unordered_map < int , std : : shared_ptr < PredictionObstacle > > ; <nl> <nl> namespace { <nl> <nl> void GroupObstaclesByObstacleId ( const int obstacle_id , <nl> ObstaclesContainer * const obstacles_container , <nl> - IdObstacleMap * const id_obstacle_map ) { <nl> + IdObstacleListMap * const id_obstacle_map ) { <nl> Obstacle * obstacle_ptr = obstacles_container - > GetObstacle ( obstacle_id ) ; <nl> if ( obstacle_ptr = = nullptr ) { <nl> AERROR < < " Null obstacle [ " < < obstacle_id < < " ] found " ; <nl> void PredictorManager : : PredictObstacles ( <nl> void PredictorManager : : PredictObstaclesInParallel ( <nl> ObstaclesContainer * obstacles_container , <nl> ADCTrajectoryContainer * adc_trajectory_container ) { <nl> - / / TODO ( kechxu ) implement <nl> - IdObstacleMap id_obstacle_map ; <nl> + IdPredictionObstacleMap id_prediction_obstacle_map ; <nl> + for ( int id : obstacles_container - > curr_frame_obstacle_ids ( ) ) { <nl> + id_prediction_obstacle_map [ id ] = std : : make_shared < PredictionObstacle > ( ) ; <nl> + } <nl> + IdObstacleListMap id_obstacle_map ; <nl> for ( int id : obstacles_container - > curr_frame_obstacle_ids ( ) ) { <nl> Obstacle * obstacle = obstacles_container - > GetObstacle ( id ) ; <nl> + const PerceptionObstacle & perception_obstacle = <nl> + obstacles_container - > GetPerceptionObstacle ( id ) ; <nl> if ( obstacle = = nullptr ) { <nl> - / / TODO ( kechxu ) set is_static = true <nl> + std : : shared_ptr < PredictionObstacle > prediction_obstacle_ptr = <nl> + id_prediction_obstacle_map [ id ] ; <nl> + prediction_obstacle_ptr - > set_is_static ( true ) ; <nl> + prediction_obstacle_ptr - > set_timestamp ( perception_obstacle . timestamp ( ) ) ; <nl> } else { <nl> GroupObstaclesByObstacleId ( id , obstacles_container , & id_obstacle_map ) ; <nl> } <nl> } <nl> PredictionThreadPool : : ForEach ( id_obstacle_map . begin ( ) , id_obstacle_map . end ( ) , <nl> - [ = ] ( IdObstacleMap : : iterator : : value_type & obstacles_iter ) { <nl> + [ & ] ( IdObstacleListMap : : iterator : : value_type & obstacles_iter ) { <nl> for ( auto obstacle_ptr : obstacles_iter . second ) { <nl> - PredictionObstacle prediction_obstacle ; <nl> - PredictObstacle ( obstacle_ptr , & prediction_obstacle , <nl> + int id = obstacle_ptr - > id ( ) ; <nl> + PredictObstacle ( obstacle_ptr , id_prediction_obstacle_map [ id ] . get ( ) , <nl> adc_trajectory_container ) ; <nl> } <nl> } ) ; <nl> + for ( auto & item : id_prediction_obstacle_map ) { <nl> + int id = item . first ; <nl> + auto prediction_obstacle_ptr = item . second ; <nl> + const PerceptionObstacle & perception_obstacle = <nl> + obstacles_container - > GetPerceptionObstacle ( id ) ; <nl> + prediction_obstacle_ptr - > set_predicted_period ( <nl> + FLAGS_prediction_trajectory_time_length ) ; <nl> + prediction_obstacle_ptr - > mutable_perception_obstacle ( ) - > CopyFrom ( <nl> + perception_obstacle ) ; <nl> + prediction_obstacles_ . add_prediction_obstacle ( ) - > CopyFrom ( <nl> + * prediction_obstacle_ptr ) ; <nl> + } <nl> } <nl> <nl> void PredictorManager : : PredictObstacle ( <nl>
|
Prediction : implement output part in multi - thread predictor manager
|
ApolloAuto/apollo
|
9c298a1321184404a5dfcddc20a8cb618ea7d17d
|
2019-04-26T02:05:56Z
|
mmm a / test / Interpreter / SDK / objc_swift3_deprecated_objc_inference . swift <nl> ppp b / test / Interpreter / SDK / objc_swift3_deprecated_objc_inference . swift <nl> <nl> / / RUN : % empty - directory ( % t ) <nl> / / RUN : % target - build - swift - swift - version 4 - Xfrontend - enable - swift3 - objc - inference % s - o % t / a . out <nl> - / / RUN : % target - codesign % t / a . out <nl> / / RUN : % target - run % t / a . out 2 > & 1 | % FileCheck % s - check - prefix = CHECK_WARNINGS <nl> / / RUN : env % env - SWIFT_DEBUG_IMPLICIT_OBJC_ENTRYPOINT = 0 % target - run % t / a . out 2 > & 1 | % FileCheck % s - check - prefix = CHECK_NOTHING <nl> <nl>
|
Remove codesign from test / Interpreter / SDK / objc_swift3_deprecated_objc_inference . swift
|
apple/swift
|
473f55ced8009d988e9e0d146dff8e0f3c1b0171
|
2020-08-07T22:53:45Z
|
mmm a / cocos / scripting / lua - bindings / auto / api / GLProgram . lua <nl> ppp b / cocos / scripting / lua - bindings / auto / api / GLProgram . lua <nl> <nl> - - @ param self <nl> - - @ return string # string ret ( return value : string ) <nl> <nl> + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + - - @ function [ parent = # GLProgram ] getUniform <nl> + - - @ param self <nl> + - - @ param # string str <nl> + - - @ return Uniform # Uniform ret ( return value : cc . Uniform ) <nl> + <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - - overload function : setUniformsForBuiltins ( matrix_table ) <nl> - - <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - - @ function [ parent = # GLProgram ] getUniformLocation <nl> - - @ param self <nl> mmm @ param # char char <nl> + - - @ param # string str <nl> - - @ return int # int ret ( return value : int ) <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - - @ function [ parent = # GLProgram ] bindAttribLocation <nl> - - @ param self <nl> mmm @ param # char char <nl> + - - @ param # string str <nl> - - @ param # unsigned int int <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - - @ function [ parent = # GLProgram ] getAttribLocation <nl> - - @ param self <nl> mmm @ param # char char <nl> + - - @ param # string str <nl> - - @ return int # int ret ( return value : int ) <nl> <nl> + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + - - @ function [ parent = # GLProgram ] getVertexAttrib <nl> + - - @ param self <nl> + - - @ param # string str <nl> + - - @ return VertexAttrib # VertexAttrib ret ( return value : cc . VertexAttrib ) <nl> + <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - - @ function [ parent = # GLProgram ] setUniformLocationWithMatrix2fv <nl> - - @ param self <nl> <nl> - - @ param # int int <nl> - - @ param # int int <nl> <nl> + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + - - @ function [ parent = # GLProgram ] createWithByteArrays <nl> + - - @ param self <nl> + - - @ param # char char <nl> + - - @ param # char char <nl> + - - @ return GLProgram # GLProgram ret ( return value : cc . GLProgram ) <nl> + <nl> + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + - - @ function [ parent = # GLProgram ] createWithFilenames <nl> + - - @ param self <nl> + - - @ param # string str <nl> + - - @ param # string str <nl> + - - @ return GLProgram # GLProgram ret ( return value : cc . GLProgram ) <nl> + <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - - @ function [ parent = # GLProgram ] GLProgram <nl> - - @ param self <nl> mmm a / cocos / scripting / lua - bindings / auto / api / Node . lua <nl> ppp b / cocos / scripting / lua - bindings / auto / api / Node . lua <nl> <nl> - - @ param self <nl> - - @ param # cc . PhysicsBody physicsbody <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> mmm overload function : getShaderProgram ( ) <nl> mmm <nl> mmm overload function : getShaderProgram ( ) <nl> mmm <nl> mmm @ function [ parent = # Node ] getShaderProgram <nl> mmm @ param self <nl> mmm @ return GLProgram # GLProgram ret ( retunr value : cc . GLProgram ) <nl> - <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - - @ function [ parent = # Node ] getDescription <nl> - - @ param self <nl> <nl> - - @ return int # int ret ( return value : int ) <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> mmm @ function [ parent = # Node ] getNodeToWorldAffineTransform <nl> + - - @ function [ parent = # Node ] getGLProgram <nl> - - @ param self <nl> mmm @ return AffineTransform # AffineTransform ret ( return value : cc . AffineTransform ) <nl> + - - @ return GLProgram # GLProgram ret ( return value : cc . GLProgram ) <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - - @ function [ parent = # Node ] getNodeToWorldTransform <nl> <nl> - - @ param # float float <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> mmm @ function [ parent = # Node ] setSkewY <nl> + - - @ function [ parent = # Node ] setGLProgramState <nl> - - @ param self <nl> mmm @ param # float float <nl> + - - @ param # cc . GLProgramState glprogramstate <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - - @ function [ parent = # Node ] getOpacity <nl> <nl> - - @ param self <nl> - - @ param # bool bool <nl> <nl> + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + - - @ function [ parent = # Node ] setSkewY <nl> + - - @ param self <nl> + - - @ param # float float <nl> + <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - - @ function [ parent = # Node ] setPositionZ <nl> - - @ param self <nl> <nl> - - @ return bool # bool ret ( return value : bool ) <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> mmm @ function [ parent = # Node ] setShaderProgram <nl> + - - @ function [ parent = # Node ] isOpacityModifyRGB <nl> - - @ param self <nl> mmm @ param # cc . GLProgram glprogram <nl> + - - @ return bool # bool ret ( return value : bool ) <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - - @ function [ parent = # Node ] getRotation <nl> <nl> - - @ param # cc . Action action <nl> - - @ return Action # Action ret ( return value : cc . Action ) <nl> <nl> + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + - - @ function [ parent = # Node ] getGLProgramState <nl> + - - @ param self <nl> + - - @ return GLProgramState # GLProgramState ret ( return value : cc . GLProgramState ) <nl> + <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - - @ function [ parent = # Node ] setScheduler <nl> - - @ param self <nl> <nl> - - @ param self <nl> - - @ param # float float <nl> <nl> + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + - - @ function [ parent = # Node ] getNodeToWorldAffineTransform <nl> + - - @ param self <nl> + - - @ return AffineTransform # AffineTransform ret ( return value : cc . AffineTransform ) <nl> + <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - - @ function [ parent = # Node ] updateDisplayedColor <nl> - - @ param self <nl> <nl> - - @ param self <nl> - - @ return matrix_table # matrix_table ret ( return value : matrix_table ) <nl> <nl> + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + - - @ function [ parent = # Node ] setGLProgram <nl> + - - @ param self <nl> + - - @ param # cc . GLProgram glprogram <nl> + <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - - @ function [ parent = # Node ] getScale <nl> - - @ param self <nl> <nl> - - @ param self <nl> - - @ return bool # bool ret ( return value : bool ) <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> mmm @ function [ parent = # Node ] isOpacityModifyRGB <nl> mmm @ param self <nl> mmm @ return bool # bool ret ( return value : bool ) <nl> - <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - - @ function [ parent = # Node ] stopAction <nl> - - @ param self <nl> deleted file mode 100644 <nl> index 3447ae9099d8 . . 000000000000 <nl> mmm a / cocos / scripting / lua - bindings / auto / api / ShaderCache . lua <nl> ppp / dev / null <nl> <nl> - <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> mmm @ module ShaderCache <nl> mmm @ extend Ref <nl> - <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> mmm @ function [ parent = # ShaderCache ] reloadDefaultShaders <nl> mmm @ param self <nl> - <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> mmm @ function [ parent = # ShaderCache ] addProgram <nl> mmm @ param self <nl> mmm @ param # cc . GLProgram glprogram <nl> mmm @ param # string str <nl> - <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> mmm @ function [ parent = # ShaderCache ] getProgram <nl> mmm @ param self <nl> mmm @ param # string str <nl> mmm @ return GLProgram # GLProgram ret ( return value : cc . GLProgram ) <nl> - <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> mmm @ function [ parent = # ShaderCache ] loadDefaultShaders <nl> mmm @ param self <nl> - <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> mmm @ function [ parent = # ShaderCache ] destroyInstance <nl> mmm @ param self <nl> - <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> mmm @ function [ parent = # ShaderCache ] getInstance <nl> mmm @ param self <nl> mmm @ return ShaderCache # ShaderCache ret ( return value : cc . ShaderCache ) <nl> - <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> mmm @ function [ parent = # ShaderCache ] ShaderCache <nl> mmm @ param self <nl> - <nl> - return nil <nl> mmm a / cocos / scripting / lua - bindings / auto / api / Texture2D . lua <nl> ppp b / cocos / scripting / lua - bindings / auto / api / Texture2D . lua <nl> <nl> - - @ module Texture2D <nl> - - @ extend Ref <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> mmm @ function [ parent = # Texture2D ] getShaderProgram <nl> mmm @ param self <nl> mmm @ return GLProgram # GLProgram ret ( return value : cc . GLProgram ) <nl> - <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - - @ function [ parent = # Texture2D ] getMaxT <nl> - - @ param self <nl> <nl> - - @ param # cc . Texture2D : : PixelFormat pixelformat <nl> - - @ return bool # bool ret ( retunr value : bool ) <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> mmm @ function [ parent = # Texture2D ] setShaderProgram <nl> mmm @ param self <nl> mmm @ param # cc . GLProgram glprogram <nl> - <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - - @ function [ parent = # Texture2D ] getMaxS <nl> - - @ param self <nl> <nl> - - @ param self <nl> - - @ param # vector2_table array <nl> <nl> + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + - - @ function [ parent = # Texture2D ] getGLProgram <nl> + - - @ param self <nl> + - - @ return GLProgram # GLProgram ret ( return value : cc . GLProgram ) <nl> + <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - - @ function [ parent = # Texture2D ] hasMipmaps <nl> - - @ param self <nl> - - @ return bool # bool ret ( return value : bool ) <nl> <nl> + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + - - @ function [ parent = # Texture2D ] setGLProgram <nl> + - - @ param self <nl> + - - @ param # cc . GLProgram glprogram <nl> + <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - - @ function [ parent = # Texture2D ] setMaxS <nl> - - @ param self <nl> mmm a / cocos / scripting / lua - bindings / auto / api / lua_cocos2dx_auto_api . lua <nl> ppp b / cocos / scripting / lua - bindings / auto / api / lua_cocos2dx_auto_api . lua <nl> <nl> <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> mmm the cc GLProgram <nl> mmm @ field [ parent = # cc ] GLProgram # GLProgram GLProgram preloaded module <nl> + - - the cc EventListener <nl> + - - @ field [ parent = # cc ] EventListener # EventListener EventListener preloaded module <nl> <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> mmm the cc Touch <nl> mmm @ field [ parent = # cc ] Touch # Touch Touch preloaded module <nl> + - - the cc Event <nl> + - - @ field [ parent = # cc ] Event # Event Event preloaded module <nl> <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> mmm the cc Event <nl> mmm @ field [ parent = # cc ] Event # Event Event preloaded module <nl> + - - the cc EventDispatcher <nl> + - - @ field [ parent = # cc ] EventDispatcher # EventDispatcher EventDispatcher preloaded module <nl> + <nl> + <nl> + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + - - the cc Touch <nl> + - - @ field [ parent = # cc ] Touch # Touch Touch preloaded module <nl> <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> <nl> <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> mmm the cc EventListener <nl> mmm @ field [ parent = # cc ] EventListener # EventListener EventListener preloaded module <nl> - <nl> - <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> mmm the cc EventDispatcher <nl> mmm @ field [ parent = # cc ] EventDispatcher # EventDispatcher EventDispatcher preloaded module <nl> + - - the cc Node <nl> + - - @ field [ parent = # cc ] Node # Node Node preloaded module <nl> <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> mmm the cc Node <nl> mmm @ field [ parent = # cc ] Node # Node Node preloaded module <nl> + - - the cc GLProgram <nl> + - - @ field [ parent = # cc ] GLProgram # GLProgram GLProgram preloaded module <nl> <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> <nl> - - @ field [ parent = # cc ] GLView # GLView GLView preloaded module <nl> <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> mmm the cc ShaderCache <nl> mmm @ field [ parent = # cc ] ShaderCache # ShaderCache ShaderCache preloaded module <nl> - <nl> - <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - - the cc AnimationCache <nl> - - @ field [ parent = # cc ] AnimationCache # AnimationCache AnimationCache preloaded module <nl> mmm a / cocos / scripting / lua - bindings / auto / lua_cocos2dx_auto . cpp <nl> ppp b / cocos / scripting / lua - bindings / auto / lua_cocos2dx_auto . cpp <nl> int lua_register_cocos2dx_Console ( lua_State * tolua_S ) <nl> return 1 ; <nl> } <nl> <nl> - int lua_cocos2dx_GLProgram_getFragmentShaderLog ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_EventListener_setEnabled ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : GLProgram * cobj = nullptr ; <nl> + cocos2d : : EventListener * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_GLProgram_getFragmentShaderLog ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . EventListener " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : EventListener * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_getFragmentShaderLog ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_EventListener_setEnabled ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 0 ) <nl> + if ( argc = = 1 ) <nl> { <nl> + bool arg0 ; <nl> + <nl> + ok & = luaval_to_boolean ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - std : : string ret = cobj - > getFragmentShaderLog ( ) ; <nl> - tolua_pushcppstring ( tolua_S , ret ) ; <nl> - return 1 ; <nl> + cobj - > setEnabled ( arg0 ) ; <nl> + return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getFragmentShaderLog " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setEnabled " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_getFragmentShaderLog ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_EventListener_setEnabled ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_GLProgram_initWithByteArrays ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_EventListener_clone ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : GLProgram * cobj = nullptr ; <nl> + cocos2d : : EventListener * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_GLProgram_initWithByteArrays ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . EventListener " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : EventListener * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_initWithByteArrays ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_EventListener_clone ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 2 ) <nl> + if ( argc = = 0 ) <nl> { <nl> - const char * arg0 ; <nl> - const char * arg1 ; <nl> - <nl> - std : : string arg0_tmp ; ok & = luaval_to_std_string ( tolua_S , 2 , & arg0_tmp ) ; arg0 = arg0_tmp . c_str ( ) ; <nl> - <nl> - std : : string arg1_tmp ; ok & = luaval_to_std_string ( tolua_S , 3 , & arg1_tmp ) ; arg1 = arg1_tmp . c_str ( ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - bool ret = cobj - > initWithByteArrays ( arg0 , arg1 ) ; <nl> - tolua_pushboolean ( tolua_S , ( bool ) ret ) ; <nl> + cocos2d : : EventListener * ret = cobj - > clone ( ) ; <nl> + object_to_luaval < cocos2d : : EventListener > ( tolua_S , " cc . EventListener " , ( cocos2d : : EventListener * ) ret ) ; <nl> return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " initWithByteArrays " , argc , 2 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " clone " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_initWithByteArrays ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_EventListener_clone ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_GLProgram_setUniformLocationWithMatrix4fv ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_EventListener_isEnabled ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : GLProgram * cobj = nullptr ; <nl> + cocos2d : : EventListener * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_GLProgram_setUniformLocationWithMatrix4fv ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . EventListener " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : EventListener * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_setUniformLocationWithMatrix4fv ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_EventListener_isEnabled ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 3 ) <nl> + if ( argc = = 0 ) <nl> { <nl> - int arg0 ; <nl> - const float * arg1 ; <nl> - unsigned int arg2 ; <nl> - <nl> - ok & = luaval_to_int32 ( tolua_S , 2 , ( int * ) & arg0 ) ; <nl> - <nl> - # pragma warning NO CONVERSION TO NATIVE FOR float * ; <nl> - <nl> - ok & = luaval_to_uint32 ( tolua_S , 4 , & arg2 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > setUniformLocationWithMatrix4fv ( arg0 , arg1 , arg2 ) ; <nl> - return 0 ; <nl> + bool ret = cobj - > isEnabled ( ) ; <nl> + tolua_pushboolean ( tolua_S , ( bool ) ret ) ; <nl> + return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setUniformLocationWithMatrix4fv " , argc , 3 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " isEnabled " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_setUniformLocationWithMatrix4fv ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_EventListener_isEnabled ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_GLProgram_initWithFilenames ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_EventListener_checkAvailable ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : GLProgram * cobj = nullptr ; <nl> + cocos2d : : EventListener * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_GLProgram_initWithFilenames ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . EventListener " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : EventListener * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_initWithFilenames ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_EventListener_checkAvailable ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 2 ) <nl> + if ( argc = = 0 ) <nl> { <nl> - std : : string arg0 ; <nl> - std : : string arg1 ; <nl> - <nl> - ok & = luaval_to_std_string ( tolua_S , 2 , & arg0 ) ; <nl> - <nl> - ok & = luaval_to_std_string ( tolua_S , 3 , & arg1 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - bool ret = cobj - > initWithFilenames ( arg0 , arg1 ) ; <nl> + bool ret = cobj - > checkAvailable ( ) ; <nl> tolua_pushboolean ( tolua_S , ( bool ) ret ) ; <nl> return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " initWithFilenames " , argc , 2 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " checkAvailable " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_initWithFilenames ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_EventListener_checkAvailable ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_GLProgram_getUniformLocationForName ( lua_State * tolua_S ) <nl> + static int lua_cocos2dx_EventListener_finalize ( lua_State * tolua_S ) <nl> + { <nl> + printf ( " luabindings : finalizing LUA object ( EventListener ) " ) ; <nl> + return 0 ; <nl> + } <nl> + <nl> + int lua_register_cocos2dx_EventListener ( lua_State * tolua_S ) <nl> + { <nl> + tolua_usertype ( tolua_S , " cc . EventListener " ) ; <nl> + tolua_cclass ( tolua_S , " EventListener " , " cc . EventListener " , " cc . Ref " , nullptr ) ; <nl> + <nl> + tolua_beginmodule ( tolua_S , " EventListener " ) ; <nl> + tolua_function ( tolua_S , " setEnabled " , lua_cocos2dx_EventListener_setEnabled ) ; <nl> + tolua_function ( tolua_S , " clone " , lua_cocos2dx_EventListener_clone ) ; <nl> + tolua_function ( tolua_S , " isEnabled " , lua_cocos2dx_EventListener_isEnabled ) ; <nl> + tolua_function ( tolua_S , " checkAvailable " , lua_cocos2dx_EventListener_checkAvailable ) ; <nl> + tolua_endmodule ( tolua_S ) ; <nl> + std : : string typeName = typeid ( cocos2d : : EventListener ) . name ( ) ; <nl> + g_luaType [ typeName ] = " cc . EventListener " ; <nl> + g_typeCast [ " EventListener " ] = " cc . EventListener " ; <nl> + return 1 ; <nl> + } <nl> + <nl> + int lua_cocos2dx_Event_isStopped ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : GLProgram * cobj = nullptr ; <nl> + cocos2d : : Event * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_GLProgram_getUniformLocationForName ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Event " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : Event * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_getUniformLocationForName ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Event_isStopped ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 1 ) <nl> + if ( argc = = 0 ) <nl> { <nl> - const char * arg0 ; <nl> - <nl> - std : : string arg0_tmp ; ok & = luaval_to_std_string ( tolua_S , 2 , & arg0_tmp ) ; arg0 = arg0_tmp . c_str ( ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - int ret = cobj - > getUniformLocationForName ( arg0 ) ; <nl> - tolua_pushnumber ( tolua_S , ( lua_Number ) ret ) ; <nl> + bool ret = cobj - > isStopped ( ) ; <nl> + tolua_pushboolean ( tolua_S , ( bool ) ret ) ; <nl> return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getUniformLocationForName " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " isStopped " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_getUniformLocationForName ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Event_isStopped ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_GLProgram_use ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Event_getType ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : GLProgram * cobj = nullptr ; <nl> + cocos2d : : Event * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_GLProgram_use ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Event " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : Event * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_use ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Event_getType ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_GLProgram_use ( lua_State * tolua_S ) <nl> { <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > use ( ) ; <nl> - return 0 ; <nl> + int ret = ( int ) cobj - > getType ( ) ; <nl> + tolua_pushnumber ( tolua_S , ( lua_Number ) ret ) ; <nl> + return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " use " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getType " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_use ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Event_getType ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_GLProgram_getVertexShaderLog ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Event_getCurrentTarget ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : GLProgram * cobj = nullptr ; <nl> + cocos2d : : Event * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_GLProgram_getVertexShaderLog ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Event " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : Event * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_getVertexShaderLog ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Event_getCurrentTarget ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_GLProgram_getVertexShaderLog ( lua_State * tolua_S ) <nl> { <nl> if ( ! ok ) <nl> return 0 ; <nl> - std : : string ret = cobj - > getVertexShaderLog ( ) ; <nl> - tolua_pushcppstring ( tolua_S , ret ) ; <nl> + cocos2d : : Node * ret = cobj - > getCurrentTarget ( ) ; <nl> + object_to_luaval < cocos2d : : Node > ( tolua_S , " cc . Node " , ( cocos2d : : Node * ) ret ) ; <nl> return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getVertexShaderLog " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getCurrentTarget " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_getVertexShaderLog ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Event_getCurrentTarget ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_GLProgram_setUniformsForBuiltins ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Event_stopPropagation ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : GLProgram * cobj = nullptr ; <nl> + cocos2d : : Event * cobj = nullptr ; <nl> bool ok = true ; <nl> + <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_Error tolua_err ; <nl> # endif <nl> <nl> + <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Event " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> - cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + <nl> + cobj = ( cocos2d : : Event * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! cobj ) <nl> + if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_setUniformsForBuiltins ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Event_stopPropagation ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> - argc = lua_gettop ( tolua_S ) - 1 ; <nl> - do { <nl> - if ( argc = = 1 ) { <nl> - cocos2d : : Matrix arg0 ; <nl> - ok & = luaval_to_matrix ( tolua_S , 2 , & arg0 ) ; <nl> <nl> - if ( ! ok ) { break ; } <nl> - cobj - > setUniformsForBuiltins ( arg0 ) ; <nl> - return 0 ; <nl> - } <nl> - } while ( 0 ) ; <nl> - ok = true ; <nl> - do { <nl> - if ( argc = = 0 ) { <nl> - cobj - > setUniformsForBuiltins ( ) ; <nl> + argc = lua_gettop ( tolua_S ) - 1 ; <nl> + if ( argc = = 0 ) <nl> + { <nl> + if ( ! ok ) <nl> return 0 ; <nl> - } <nl> - } while ( 0 ) ; <nl> - ok = true ; <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setUniformsForBuiltins " , argc , 0 ) ; <nl> + cobj - > stopPropagation ( ) ; <nl> + return 0 ; <nl> + } <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " stopPropagation " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_setUniformsForBuiltins ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Event_stopPropagation ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_GLProgram_setUniformLocationWith3i ( lua_State * tolua_S ) <nl> + static int lua_cocos2dx_Event_finalize ( lua_State * tolua_S ) <nl> + { <nl> + printf ( " luabindings : finalizing LUA object ( Event ) " ) ; <nl> + return 0 ; <nl> + } <nl> + <nl> + int lua_register_cocos2dx_Event ( lua_State * tolua_S ) <nl> + { <nl> + tolua_usertype ( tolua_S , " cc . Event " ) ; <nl> + tolua_cclass ( tolua_S , " Event " , " cc . Event " , " cc . Ref " , nullptr ) ; <nl> + <nl> + tolua_beginmodule ( tolua_S , " Event " ) ; <nl> + tolua_function ( tolua_S , " isStopped " , lua_cocos2dx_Event_isStopped ) ; <nl> + tolua_function ( tolua_S , " getType " , lua_cocos2dx_Event_getType ) ; <nl> + tolua_function ( tolua_S , " getCurrentTarget " , lua_cocos2dx_Event_getCurrentTarget ) ; <nl> + tolua_function ( tolua_S , " stopPropagation " , lua_cocos2dx_Event_stopPropagation ) ; <nl> + tolua_endmodule ( tolua_S ) ; <nl> + std : : string typeName = typeid ( cocos2d : : Event ) . name ( ) ; <nl> + g_luaType [ typeName ] = " cc . Event " ; <nl> + g_typeCast [ " Event " ] = " cc . Event " ; <nl> + return 1 ; <nl> + } <nl> + <nl> + int lua_cocos2dx_EventDispatcher_pauseEventListenersForTarget ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : GLProgram * cobj = nullptr ; <nl> + cocos2d : : EventDispatcher * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_GLProgram_setUniformLocationWith3i ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . EventDispatcher " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : EventDispatcher * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_setUniformLocationWith3i ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_EventDispatcher_pauseEventListenersForTarget ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 4 ) <nl> + if ( argc = = 1 ) <nl> { <nl> - int arg0 ; <nl> - int arg1 ; <nl> - int arg2 ; <nl> - int arg3 ; <nl> - <nl> - ok & = luaval_to_int32 ( tolua_S , 2 , ( int * ) & arg0 ) ; <nl> + cocos2d : : Node * arg0 ; <nl> <nl> - ok & = luaval_to_int32 ( tolua_S , 3 , ( int * ) & arg1 ) ; <nl> + ok & = luaval_to_object < cocos2d : : Node > ( tolua_S , 2 , " cc . Node " , & arg0 ) ; <nl> + if ( ! ok ) <nl> + return 0 ; <nl> + cobj - > pauseEventListenersForTarget ( arg0 ) ; <nl> + return 0 ; <nl> + } <nl> + if ( argc = = 2 ) <nl> + { <nl> + cocos2d : : Node * arg0 ; <nl> + bool arg1 ; <nl> <nl> - ok & = luaval_to_int32 ( tolua_S , 4 , ( int * ) & arg2 ) ; <nl> + ok & = luaval_to_object < cocos2d : : Node > ( tolua_S , 2 , " cc . Node " , & arg0 ) ; <nl> <nl> - ok & = luaval_to_int32 ( tolua_S , 5 , ( int * ) & arg3 ) ; <nl> + ok & = luaval_to_boolean ( tolua_S , 3 , & arg1 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > setUniformLocationWith3i ( arg0 , arg1 , arg2 , arg3 ) ; <nl> + cobj - > pauseEventListenersForTarget ( arg0 , arg1 ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setUniformLocationWith3i " , argc , 4 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " pauseEventListenersForTarget " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_setUniformLocationWith3i ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_EventDispatcher_pauseEventListenersForTarget ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_GLProgram_setUniformLocationWith3iv ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_EventDispatcher_addEventListenerWithSceneGraphPriority ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : GLProgram * cobj = nullptr ; <nl> + cocos2d : : EventDispatcher * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_GLProgram_setUniformLocationWith3iv ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . EventDispatcher " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : EventDispatcher * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_setUniformLocationWith3iv ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_EventDispatcher_addEventListenerWithSceneGraphPriority ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 3 ) <nl> + if ( argc = = 2 ) <nl> { <nl> - int arg0 ; <nl> - int * arg1 ; <nl> - unsigned int arg2 ; <nl> - <nl> - ok & = luaval_to_int32 ( tolua_S , 2 , ( int * ) & arg0 ) ; <nl> + cocos2d : : EventListener * arg0 ; <nl> + cocos2d : : Node * arg1 ; <nl> <nl> - # pragma warning NO CONVERSION TO NATIVE FOR int * ; <nl> + ok & = luaval_to_object < cocos2d : : EventListener > ( tolua_S , 2 , " cc . EventListener " , & arg0 ) ; <nl> <nl> - ok & = luaval_to_uint32 ( tolua_S , 4 , & arg2 ) ; <nl> + ok & = luaval_to_object < cocos2d : : Node > ( tolua_S , 3 , " cc . Node " , & arg1 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > setUniformLocationWith3iv ( arg0 , arg1 , arg2 ) ; <nl> + cobj - > addEventListenerWithSceneGraphPriority ( arg0 , arg1 ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setUniformLocationWith3iv " , argc , 3 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " addEventListenerWithSceneGraphPriority " , argc , 2 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_setUniformLocationWith3iv ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_EventDispatcher_addEventListenerWithSceneGraphPriority ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_GLProgram_updateUniforms ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_EventDispatcher_setEnabled ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : GLProgram * cobj = nullptr ; <nl> + cocos2d : : EventDispatcher * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_GLProgram_updateUniforms ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . EventDispatcher " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : EventDispatcher * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_updateUniforms ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_EventDispatcher_setEnabled ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 0 ) <nl> + if ( argc = = 1 ) <nl> { <nl> + bool arg0 ; <nl> + <nl> + ok & = luaval_to_boolean ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > updateUniforms ( ) ; <nl> + cobj - > setEnabled ( arg0 ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " updateUniforms " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setEnabled " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_updateUniforms ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_EventDispatcher_setEnabled ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_GLProgram_setUniformLocationWith4iv ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_EventDispatcher_addEventListenerWithFixedPriority ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : GLProgram * cobj = nullptr ; <nl> + cocos2d : : EventDispatcher * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_GLProgram_setUniformLocationWith4iv ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . EventDispatcher " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : EventDispatcher * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_setUniformLocationWith4iv ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_EventDispatcher_addEventListenerWithFixedPriority ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 3 ) <nl> + if ( argc = = 2 ) <nl> { <nl> - int arg0 ; <nl> - int * arg1 ; <nl> - unsigned int arg2 ; <nl> - <nl> - ok & = luaval_to_int32 ( tolua_S , 2 , ( int * ) & arg0 ) ; <nl> + cocos2d : : EventListener * arg0 ; <nl> + int arg1 ; <nl> <nl> - # pragma warning NO CONVERSION TO NATIVE FOR int * ; <nl> + ok & = luaval_to_object < cocos2d : : EventListener > ( tolua_S , 2 , " cc . EventListener " , & arg0 ) ; <nl> <nl> - ok & = luaval_to_uint32 ( tolua_S , 4 , & arg2 ) ; <nl> + ok & = luaval_to_int32 ( tolua_S , 3 , ( int * ) & arg1 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > setUniformLocationWith4iv ( arg0 , arg1 , arg2 ) ; <nl> + cobj - > addEventListenerWithFixedPriority ( arg0 , arg1 ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setUniformLocationWith4iv " , argc , 3 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " addEventListenerWithFixedPriority " , argc , 2 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_setUniformLocationWith4iv ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_EventDispatcher_addEventListenerWithFixedPriority ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_GLProgram_getUniformLocation ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_EventDispatcher_removeEventListener ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : GLProgram * cobj = nullptr ; <nl> + cocos2d : : EventDispatcher * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_GLProgram_getUniformLocation ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . EventDispatcher " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : EventDispatcher * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_getUniformLocation ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_EventDispatcher_removeEventListener ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_GLProgram_getUniformLocation ( lua_State * tolua_S ) <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> if ( argc = = 1 ) <nl> { <nl> - const char * arg0 ; <nl> + cocos2d : : EventListener * arg0 ; <nl> <nl> - std : : string arg0_tmp ; ok & = luaval_to_std_string ( tolua_S , 2 , & arg0_tmp ) ; arg0 = arg0_tmp . c_str ( ) ; <nl> + ok & = luaval_to_object < cocos2d : : EventListener > ( tolua_S , 2 , " cc . EventListener " , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - int ret = cobj - > getUniformLocation ( arg0 ) ; <nl> - tolua_pushnumber ( tolua_S , ( lua_Number ) ret ) ; <nl> - return 1 ; <nl> + cobj - > removeEventListener ( arg0 ) ; <nl> + return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getUniformLocation " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " removeEventListener " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_getUniformLocation ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_EventDispatcher_removeEventListener ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_GLProgram_setUniformLocationWith1i ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_EventDispatcher_resumeEventListenersForTarget ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : GLProgram * cobj = nullptr ; <nl> + cocos2d : : EventDispatcher * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_GLProgram_setUniformLocationWith1i ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . EventDispatcher " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : EventDispatcher * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_setUniformLocationWith1i ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_EventDispatcher_resumeEventListenersForTarget ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> + if ( argc = = 1 ) <nl> + { <nl> + cocos2d : : Node * arg0 ; <nl> + <nl> + ok & = luaval_to_object < cocos2d : : Node > ( tolua_S , 2 , " cc . Node " , & arg0 ) ; <nl> + if ( ! ok ) <nl> + return 0 ; <nl> + cobj - > resumeEventListenersForTarget ( arg0 ) ; <nl> + return 0 ; <nl> + } <nl> if ( argc = = 2 ) <nl> { <nl> - int arg0 ; <nl> - int arg1 ; <nl> + cocos2d : : Node * arg0 ; <nl> + bool arg1 ; <nl> <nl> - ok & = luaval_to_int32 ( tolua_S , 2 , ( int * ) & arg0 ) ; <nl> + ok & = luaval_to_object < cocos2d : : Node > ( tolua_S , 2 , " cc . Node " , & arg0 ) ; <nl> <nl> - ok & = luaval_to_int32 ( tolua_S , 3 , ( int * ) & arg1 ) ; <nl> + ok & = luaval_to_boolean ( tolua_S , 3 , & arg1 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > setUniformLocationWith1i ( arg0 , arg1 ) ; <nl> + cobj - > resumeEventListenersForTarget ( arg0 , arg1 ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setUniformLocationWith1i " , argc , 2 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " resumeEventListenersForTarget " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_setUniformLocationWith1i ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_EventDispatcher_resumeEventListenersForTarget ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_GLProgram_setUniformLocationWith2iv ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_EventDispatcher_removeEventListenersForTarget ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : GLProgram * cobj = nullptr ; <nl> + cocos2d : : EventDispatcher * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_GLProgram_setUniformLocationWith2iv ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . EventDispatcher " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : EventDispatcher * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_setUniformLocationWith2iv ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_EventDispatcher_removeEventListenersForTarget ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 3 ) <nl> + if ( argc = = 1 ) <nl> { <nl> - int arg0 ; <nl> - int * arg1 ; <nl> - unsigned int arg2 ; <nl> + cocos2d : : Node * arg0 ; <nl> <nl> - ok & = luaval_to_int32 ( tolua_S , 2 , ( int * ) & arg0 ) ; <nl> + ok & = luaval_to_object < cocos2d : : Node > ( tolua_S , 2 , " cc . Node " , & arg0 ) ; <nl> + if ( ! ok ) <nl> + return 0 ; <nl> + cobj - > removeEventListenersForTarget ( arg0 ) ; <nl> + return 0 ; <nl> + } <nl> + if ( argc = = 2 ) <nl> + { <nl> + cocos2d : : Node * arg0 ; <nl> + bool arg1 ; <nl> <nl> - # pragma warning NO CONVERSION TO NATIVE FOR int * ; <nl> + ok & = luaval_to_object < cocos2d : : Node > ( tolua_S , 2 , " cc . Node " , & arg0 ) ; <nl> <nl> - ok & = luaval_to_uint32 ( tolua_S , 4 , & arg2 ) ; <nl> + ok & = luaval_to_boolean ( tolua_S , 3 , & arg1 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > setUniformLocationWith2iv ( arg0 , arg1 , arg2 ) ; <nl> + cobj - > removeEventListenersForTarget ( arg0 , arg1 ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setUniformLocationWith2iv " , argc , 3 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " removeEventListenersForTarget " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_setUniformLocationWith2iv ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_EventDispatcher_removeEventListenersForTarget ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_GLProgram_setUniformLocationWithMatrix3fv ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_EventDispatcher_setPriority ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : GLProgram * cobj = nullptr ; <nl> + cocos2d : : EventDispatcher * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_GLProgram_setUniformLocationWithMatrix3fv ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . EventDispatcher " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : EventDispatcher * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_setUniformLocationWithMatrix3fv ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_EventDispatcher_setPriority ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 3 ) <nl> + if ( argc = = 2 ) <nl> { <nl> - int arg0 ; <nl> - const float * arg1 ; <nl> - unsigned int arg2 ; <nl> - <nl> - ok & = luaval_to_int32 ( tolua_S , 2 , ( int * ) & arg0 ) ; <nl> + cocos2d : : EventListener * arg0 ; <nl> + int arg1 ; <nl> <nl> - # pragma warning NO CONVERSION TO NATIVE FOR float * ; <nl> + ok & = luaval_to_object < cocos2d : : EventListener > ( tolua_S , 2 , " cc . EventListener " , & arg0 ) ; <nl> <nl> - ok & = luaval_to_uint32 ( tolua_S , 4 , & arg2 ) ; <nl> + ok & = luaval_to_int32 ( tolua_S , 3 , ( int * ) & arg1 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > setUniformLocationWithMatrix3fv ( arg0 , arg1 , arg2 ) ; <nl> + cobj - > setPriority ( arg0 , arg1 ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setUniformLocationWithMatrix3fv " , argc , 3 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setPriority " , argc , 2 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_setUniformLocationWithMatrix3fv ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_EventDispatcher_setPriority ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_GLProgram_reset ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_EventDispatcher_addCustomEventListener ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : GLProgram * cobj = nullptr ; <nl> + cocos2d : : EventDispatcher * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_GLProgram_reset ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . EventDispatcher " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : EventDispatcher * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_reset ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_EventDispatcher_addCustomEventListener ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 0 ) <nl> + if ( argc = = 2 ) <nl> { <nl> - if ( ! ok ) <nl> - return 0 ; <nl> - cobj - > reset ( ) ; <nl> - return 0 ; <nl> - } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " reset " , argc , 0 ) ; <nl> - return 0 ; <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_reset ' . " , & tolua_err ) ; <nl> - # endif <nl> - <nl> - return 0 ; <nl> - } <nl> - int lua_cocos2dx_GLProgram_bindAttribLocation ( lua_State * tolua_S ) <nl> - { <nl> - int argc = 0 ; <nl> - cocos2d : : GLProgram * cobj = nullptr ; <nl> - bool ok = true ; <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - tolua_Error tolua_err ; <nl> - # endif <nl> - <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> - # endif <nl> - <nl> - cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - if ( ! cobj ) <nl> - { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_bindAttribLocation ' " , nullptr ) ; <nl> - return 0 ; <nl> - } <nl> - # endif <nl> - <nl> - argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 2 ) <nl> - { <nl> - const char * arg0 ; <nl> - unsigned int arg1 ; <nl> + std : : string arg0 ; <nl> + std : : function < void ( cocos2d : : EventCustom * ) > arg1 ; <nl> <nl> - std : : string arg0_tmp ; ok & = luaval_to_std_string ( tolua_S , 2 , & arg0_tmp ) ; arg0 = arg0_tmp . c_str ( ) ; <nl> + ok & = luaval_to_std_string ( tolua_S , 2 , & arg0 ) ; <nl> <nl> - ok & = luaval_to_uint32 ( tolua_S , 3 , & arg1 ) ; <nl> + do { <nl> + / / Lambda binding for lua is not supported . <nl> + assert ( false ) ; <nl> + } while ( 0 ) <nl> + ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > bindAttribLocation ( arg0 , arg1 ) ; <nl> - return 0 ; <nl> + cocos2d : : EventListenerCustom * ret = cobj - > addCustomEventListener ( arg0 , arg1 ) ; <nl> + object_to_luaval < cocos2d : : EventListenerCustom > ( tolua_S , " cc . EventListenerCustom " , ( cocos2d : : EventListenerCustom * ) ret ) ; <nl> + return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " bindAttribLocation " , argc , 2 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " addCustomEventListener " , argc , 2 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_bindAttribLocation ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_EventDispatcher_addCustomEventListener ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_GLProgram_getAttribLocation ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_EventDispatcher_dispatchEvent ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : GLProgram * cobj = nullptr ; <nl> + cocos2d : : EventDispatcher * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_GLProgram_getAttribLocation ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . EventDispatcher " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : EventDispatcher * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_getAttribLocation ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_EventDispatcher_dispatchEvent ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_GLProgram_getAttribLocation ( lua_State * tolua_S ) <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> if ( argc = = 1 ) <nl> { <nl> - const char * arg0 ; <nl> + cocos2d : : Event * arg0 ; <nl> <nl> - std : : string arg0_tmp ; ok & = luaval_to_std_string ( tolua_S , 2 , & arg0_tmp ) ; arg0 = arg0_tmp . c_str ( ) ; <nl> + ok & = luaval_to_object < cocos2d : : Event > ( tolua_S , 2 , " cc . Event " , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - int ret = cobj - > getAttribLocation ( arg0 ) ; <nl> - tolua_pushnumber ( tolua_S , ( lua_Number ) ret ) ; <nl> - return 1 ; <nl> + cobj - > dispatchEvent ( arg0 ) ; <nl> + return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getAttribLocation " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " dispatchEvent " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_getAttribLocation ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_EventDispatcher_dispatchEvent ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_GLProgram_setUniformLocationWithMatrix2fv ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_EventDispatcher_removeAllEventListeners ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : GLProgram * cobj = nullptr ; <nl> + cocos2d : : EventDispatcher * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_GLProgram_setUniformLocationWithMatrix2fv ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . EventDispatcher " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : EventDispatcher * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_setUniformLocationWithMatrix2fv ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_EventDispatcher_removeAllEventListeners ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 3 ) <nl> + if ( argc = = 0 ) <nl> { <nl> - int arg0 ; <nl> - const float * arg1 ; <nl> - unsigned int arg2 ; <nl> - <nl> - ok & = luaval_to_int32 ( tolua_S , 2 , ( int * ) & arg0 ) ; <nl> - <nl> - # pragma warning NO CONVERSION TO NATIVE FOR float * ; <nl> - <nl> - ok & = luaval_to_uint32 ( tolua_S , 4 , & arg2 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > setUniformLocationWithMatrix2fv ( arg0 , arg1 , arg2 ) ; <nl> + cobj - > removeAllEventListeners ( ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setUniformLocationWithMatrix2fv " , argc , 3 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " removeAllEventListeners " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_setUniformLocationWithMatrix2fv ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_EventDispatcher_removeAllEventListeners ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_GLProgram_setUniformLocationWith4i ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_EventDispatcher_removeCustomEventListeners ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : GLProgram * cobj = nullptr ; <nl> + cocos2d : : EventDispatcher * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_GLProgram_setUniformLocationWith4i ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . EventDispatcher " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : EventDispatcher * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_setUniformLocationWith4i ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_EventDispatcher_removeCustomEventListeners ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 5 ) <nl> + if ( argc = = 1 ) <nl> { <nl> - int arg0 ; <nl> - int arg1 ; <nl> - int arg2 ; <nl> - int arg3 ; <nl> - int arg4 ; <nl> - <nl> - ok & = luaval_to_int32 ( tolua_S , 2 , ( int * ) & arg0 ) ; <nl> - <nl> - ok & = luaval_to_int32 ( tolua_S , 3 , ( int * ) & arg1 ) ; <nl> - <nl> - ok & = luaval_to_int32 ( tolua_S , 4 , ( int * ) & arg2 ) ; <nl> - <nl> - ok & = luaval_to_int32 ( tolua_S , 5 , ( int * ) & arg3 ) ; <nl> + std : : string arg0 ; <nl> <nl> - ok & = luaval_to_int32 ( tolua_S , 6 , ( int * ) & arg4 ) ; <nl> + ok & = luaval_to_std_string ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > setUniformLocationWith4i ( arg0 , arg1 , arg2 , arg3 , arg4 ) ; <nl> + cobj - > removeCustomEventListeners ( arg0 ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setUniformLocationWith4i " , argc , 5 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " removeCustomEventListeners " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_setUniformLocationWith4i ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_EventDispatcher_removeCustomEventListeners ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_GLProgram_link ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_EventDispatcher_isEnabled ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : GLProgram * cobj = nullptr ; <nl> + cocos2d : : EventDispatcher * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_GLProgram_link ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . EventDispatcher " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : EventDispatcher * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_link ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_EventDispatcher_isEnabled ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_GLProgram_link ( lua_State * tolua_S ) <nl> { <nl> if ( ! ok ) <nl> return 0 ; <nl> - bool ret = cobj - > link ( ) ; <nl> + bool ret = cobj - > isEnabled ( ) ; <nl> tolua_pushboolean ( tolua_S , ( bool ) ret ) ; <nl> return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " link " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " isEnabled " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_link ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_EventDispatcher_isEnabled ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_GLProgram_setUniformLocationWith2i ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_EventDispatcher_removeEventListenersForType ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : GLProgram * cobj = nullptr ; <nl> + cocos2d : : EventDispatcher * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_GLProgram_setUniformLocationWith2i ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . EventDispatcher " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : EventDispatcher * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_setUniformLocationWith2i ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_EventDispatcher_removeEventListenersForType ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 3 ) <nl> + if ( argc = = 1 ) <nl> { <nl> - int arg0 ; <nl> - int arg1 ; <nl> - int arg2 ; <nl> + cocos2d : : EventListener : : Type arg0 ; <nl> <nl> ok & = luaval_to_int32 ( tolua_S , 2 , ( int * ) & arg0 ) ; <nl> - <nl> - ok & = luaval_to_int32 ( tolua_S , 3 , ( int * ) & arg1 ) ; <nl> - <nl> - ok & = luaval_to_int32 ( tolua_S , 4 , ( int * ) & arg2 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > setUniformLocationWith2i ( arg0 , arg1 , arg2 ) ; <nl> + cobj - > removeEventListenersForType ( arg0 ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setUniformLocationWith2i " , argc , 3 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " removeEventListenersForType " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_setUniformLocationWith2i ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_EventDispatcher_removeEventListenersForType ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_GLProgram_constructor ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_EventDispatcher_constructor ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : GLProgram * cobj = nullptr ; <nl> + cocos2d : : EventDispatcher * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_GLProgram_constructor ( lua_State * tolua_S ) <nl> { <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj = new cocos2d : : GLProgram ( ) ; <nl> + cobj = new cocos2d : : EventDispatcher ( ) ; <nl> cobj - > autorelease ( ) ; <nl> int ID = ( int ) cobj - > _ID ; <nl> int * luaID = & cobj - > _luaID ; <nl> - toluafix_pushusertype_ccobject ( tolua_S , ID , luaID , ( void * ) cobj , " cc . GLProgram " ) ; <nl> + toluafix_pushusertype_ccobject ( tolua_S , ID , luaID , ( void * ) cobj , " cc . EventDispatcher " ) ; <nl> return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " GLProgram " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " EventDispatcher " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_constructor ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_EventDispatcher_constructor ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> <nl> - static int lua_cocos2dx_GLProgram_finalize ( lua_State * tolua_S ) <nl> + static int lua_cocos2dx_EventDispatcher_finalize ( lua_State * tolua_S ) <nl> { <nl> - printf ( " luabindings : finalizing LUA object ( GLProgram ) " ) ; <nl> + printf ( " luabindings : finalizing LUA object ( EventDispatcher ) " ) ; <nl> return 0 ; <nl> } <nl> <nl> - int lua_register_cocos2dx_GLProgram ( lua_State * tolua_S ) <nl> + int lua_register_cocos2dx_EventDispatcher ( lua_State * tolua_S ) <nl> { <nl> - tolua_usertype ( tolua_S , " cc . GLProgram " ) ; <nl> - tolua_cclass ( tolua_S , " GLProgram " , " cc . GLProgram " , " cc . Ref " , nullptr ) ; <nl> + tolua_usertype ( tolua_S , " cc . EventDispatcher " ) ; <nl> + tolua_cclass ( tolua_S , " EventDispatcher " , " cc . EventDispatcher " , " cc . Ref " , nullptr ) ; <nl> <nl> - tolua_beginmodule ( tolua_S , " GLProgram " ) ; <nl> - tolua_function ( tolua_S , " getFragmentShaderLog " , lua_cocos2dx_GLProgram_getFragmentShaderLog ) ; <nl> - tolua_function ( tolua_S , " initWithByteArrays " , lua_cocos2dx_GLProgram_initWithByteArrays ) ; <nl> - tolua_function ( tolua_S , " setUniformLocationWithMatrix4fv " , lua_cocos2dx_GLProgram_setUniformLocationWithMatrix4fv ) ; <nl> - tolua_function ( tolua_S , " initWithFilenames " , lua_cocos2dx_GLProgram_initWithFilenames ) ; <nl> - tolua_function ( tolua_S , " getUniformLocationForName " , lua_cocos2dx_GLProgram_getUniformLocationForName ) ; <nl> - tolua_function ( tolua_S , " use " , lua_cocos2dx_GLProgram_use ) ; <nl> - tolua_function ( tolua_S , " getVertexShaderLog " , lua_cocos2dx_GLProgram_getVertexShaderLog ) ; <nl> - tolua_function ( tolua_S , " setUniformsForBuiltins " , lua_cocos2dx_GLProgram_setUniformsForBuiltins ) ; <nl> - tolua_function ( tolua_S , " setUniformLocationWith3i " , lua_cocos2dx_GLProgram_setUniformLocationWith3i ) ; <nl> - tolua_function ( tolua_S , " setUniformLocationWith3iv " , lua_cocos2dx_GLProgram_setUniformLocationWith3iv ) ; <nl> - tolua_function ( tolua_S , " updateUniforms " , lua_cocos2dx_GLProgram_updateUniforms ) ; <nl> - tolua_function ( tolua_S , " setUniformLocationWith4iv " , lua_cocos2dx_GLProgram_setUniformLocationWith4iv ) ; <nl> - tolua_function ( tolua_S , " getUniformLocation " , lua_cocos2dx_GLProgram_getUniformLocation ) ; <nl> - tolua_function ( tolua_S , " setUniformLocationI32 " , lua_cocos2dx_GLProgram_setUniformLocationWith1i ) ; <nl> - tolua_function ( tolua_S , " setUniformLocationWith2iv " , lua_cocos2dx_GLProgram_setUniformLocationWith2iv ) ; <nl> - tolua_function ( tolua_S , " setUniformLocationWithMatrix3fv " , lua_cocos2dx_GLProgram_setUniformLocationWithMatrix3fv ) ; <nl> - tolua_function ( tolua_S , " reset " , lua_cocos2dx_GLProgram_reset ) ; <nl> - tolua_function ( tolua_S , " bindAttribLocation " , lua_cocos2dx_GLProgram_bindAttribLocation ) ; <nl> - tolua_function ( tolua_S , " getAttribLocation " , lua_cocos2dx_GLProgram_getAttribLocation ) ; <nl> - tolua_function ( tolua_S , " setUniformLocationWithMatrix2fv " , lua_cocos2dx_GLProgram_setUniformLocationWithMatrix2fv ) ; <nl> - tolua_function ( tolua_S , " setUniformLocationWith4i " , lua_cocos2dx_GLProgram_setUniformLocationWith4i ) ; <nl> - tolua_function ( tolua_S , " link " , lua_cocos2dx_GLProgram_link ) ; <nl> - tolua_function ( tolua_S , " setUniformLocationWith2i " , lua_cocos2dx_GLProgram_setUniformLocationWith2i ) ; <nl> - tolua_function ( tolua_S , " new " , lua_cocos2dx_GLProgram_constructor ) ; <nl> + tolua_beginmodule ( tolua_S , " EventDispatcher " ) ; <nl> + tolua_function ( tolua_S , " pauseEventListenersForTarget " , lua_cocos2dx_EventDispatcher_pauseEventListenersForTarget ) ; <nl> + tolua_function ( tolua_S , " addEventListenerWithSceneGraphPriority " , lua_cocos2dx_EventDispatcher_addEventListenerWithSceneGraphPriority ) ; <nl> + tolua_function ( tolua_S , " setEnabled " , lua_cocos2dx_EventDispatcher_setEnabled ) ; <nl> + tolua_function ( tolua_S , " addEventListenerWithFixedPriority " , lua_cocos2dx_EventDispatcher_addEventListenerWithFixedPriority ) ; <nl> + tolua_function ( tolua_S , " removeEventListener " , lua_cocos2dx_EventDispatcher_removeEventListener ) ; <nl> + tolua_function ( tolua_S , " resumeEventListenersForTarget " , lua_cocos2dx_EventDispatcher_resumeEventListenersForTarget ) ; <nl> + tolua_function ( tolua_S , " removeEventListenersForTarget " , lua_cocos2dx_EventDispatcher_removeEventListenersForTarget ) ; <nl> + tolua_function ( tolua_S , " setPriority " , lua_cocos2dx_EventDispatcher_setPriority ) ; <nl> + tolua_function ( tolua_S , " addCustomEventListener " , lua_cocos2dx_EventDispatcher_addCustomEventListener ) ; <nl> + tolua_function ( tolua_S , " dispatchEvent " , lua_cocos2dx_EventDispatcher_dispatchEvent ) ; <nl> + tolua_function ( tolua_S , " removeAllEventListeners " , lua_cocos2dx_EventDispatcher_removeAllEventListeners ) ; <nl> + tolua_function ( tolua_S , " removeCustomEventListeners " , lua_cocos2dx_EventDispatcher_removeCustomEventListeners ) ; <nl> + tolua_function ( tolua_S , " isEnabled " , lua_cocos2dx_EventDispatcher_isEnabled ) ; <nl> + tolua_function ( tolua_S , " removeEventListenersForType " , lua_cocos2dx_EventDispatcher_removeEventListenersForType ) ; <nl> + tolua_function ( tolua_S , " new " , lua_cocos2dx_EventDispatcher_constructor ) ; <nl> tolua_endmodule ( tolua_S ) ; <nl> - std : : string typeName = typeid ( cocos2d : : GLProgram ) . name ( ) ; <nl> - g_luaType [ typeName ] = " cc . GLProgram " ; <nl> - g_typeCast [ " GLProgram " ] = " cc . GLProgram " ; <nl> + std : : string typeName = typeid ( cocos2d : : EventDispatcher ) . name ( ) ; <nl> + g_luaType [ typeName ] = " cc . EventDispatcher " ; <nl> + g_typeCast [ " EventDispatcher " ] = " cc . EventDispatcher " ; <nl> return 1 ; <nl> } <nl> <nl> int lua_register_cocos2dx_Touch ( lua_State * tolua_S ) <nl> return 1 ; <nl> } <nl> <nl> - int lua_cocos2dx_Event_isStopped ( lua_State * tolua_S ) <nl> - { <nl> - int argc = 0 ; <nl> - cocos2d : : Event * cobj = nullptr ; <nl> - bool ok = true ; <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - tolua_Error tolua_err ; <nl> - # endif <nl> - <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Event " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> - # endif <nl> - <nl> - cobj = ( cocos2d : : Event * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - if ( ! cobj ) <nl> - { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Event_isStopped ' " , nullptr ) ; <nl> - return 0 ; <nl> - } <nl> - # endif <nl> - <nl> - argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 0 ) <nl> - { <nl> - if ( ! ok ) <nl> - return 0 ; <nl> - bool ret = cobj - > isStopped ( ) ; <nl> - tolua_pushboolean ( tolua_S , ( bool ) ret ) ; <nl> - return 1 ; <nl> - } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " isStopped " , argc , 0 ) ; <nl> - return 0 ; <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Event_isStopped ' . " , & tolua_err ) ; <nl> - # endif <nl> - <nl> - return 0 ; <nl> - } <nl> - int lua_cocos2dx_Event_getType ( lua_State * tolua_S ) <nl> - { <nl> - int argc = 0 ; <nl> - cocos2d : : Event * cobj = nullptr ; <nl> - bool ok = true ; <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - tolua_Error tolua_err ; <nl> - # endif <nl> - <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Event " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> - # endif <nl> - <nl> - cobj = ( cocos2d : : Event * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - if ( ! cobj ) <nl> - { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Event_getType ' " , nullptr ) ; <nl> - return 0 ; <nl> - } <nl> - # endif <nl> - <nl> - argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 0 ) <nl> - { <nl> - if ( ! ok ) <nl> - return 0 ; <nl> - int ret = ( int ) cobj - > getType ( ) ; <nl> - tolua_pushnumber ( tolua_S , ( lua_Number ) ret ) ; <nl> - return 1 ; <nl> - } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getType " , argc , 0 ) ; <nl> - return 0 ; <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Event_getType ' . " , & tolua_err ) ; <nl> - # endif <nl> - <nl> - return 0 ; <nl> - } <nl> - int lua_cocos2dx_Event_getCurrentTarget ( lua_State * tolua_S ) <nl> - { <nl> - int argc = 0 ; <nl> - cocos2d : : Event * cobj = nullptr ; <nl> - bool ok = true ; <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - tolua_Error tolua_err ; <nl> - # endif <nl> - <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Event " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> - # endif <nl> - <nl> - cobj = ( cocos2d : : Event * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - if ( ! cobj ) <nl> - { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Event_getCurrentTarget ' " , nullptr ) ; <nl> - return 0 ; <nl> - } <nl> - # endif <nl> - <nl> - argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 0 ) <nl> - { <nl> - if ( ! ok ) <nl> - return 0 ; <nl> - cocos2d : : Node * ret = cobj - > getCurrentTarget ( ) ; <nl> - object_to_luaval < cocos2d : : Node > ( tolua_S , " cc . Node " , ( cocos2d : : Node * ) ret ) ; <nl> - return 1 ; <nl> - } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getCurrentTarget " , argc , 0 ) ; <nl> - return 0 ; <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Event_getCurrentTarget ' . " , & tolua_err ) ; <nl> - # endif <nl> - <nl> - return 0 ; <nl> - } <nl> - int lua_cocos2dx_Event_stopPropagation ( lua_State * tolua_S ) <nl> - { <nl> - int argc = 0 ; <nl> - cocos2d : : Event * cobj = nullptr ; <nl> - bool ok = true ; <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - tolua_Error tolua_err ; <nl> - # endif <nl> - <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Event " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> - # endif <nl> - <nl> - cobj = ( cocos2d : : Event * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - if ( ! cobj ) <nl> - { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Event_stopPropagation ' " , nullptr ) ; <nl> - return 0 ; <nl> - } <nl> - # endif <nl> - <nl> - argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 0 ) <nl> - { <nl> - if ( ! ok ) <nl> - return 0 ; <nl> - cobj - > stopPropagation ( ) ; <nl> - return 0 ; <nl> - } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " stopPropagation " , argc , 0 ) ; <nl> - return 0 ; <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Event_stopPropagation ' . " , & tolua_err ) ; <nl> - # endif <nl> - <nl> - return 0 ; <nl> - } <nl> - static int lua_cocos2dx_Event_finalize ( lua_State * tolua_S ) <nl> - { <nl> - printf ( " luabindings : finalizing LUA object ( Event ) " ) ; <nl> - return 0 ; <nl> - } <nl> - <nl> - int lua_register_cocos2dx_Event ( lua_State * tolua_S ) <nl> - { <nl> - tolua_usertype ( tolua_S , " cc . Event " ) ; <nl> - tolua_cclass ( tolua_S , " Event " , " cc . Event " , " cc . Ref " , nullptr ) ; <nl> - <nl> - tolua_beginmodule ( tolua_S , " Event " ) ; <nl> - tolua_function ( tolua_S , " isStopped " , lua_cocos2dx_Event_isStopped ) ; <nl> - tolua_function ( tolua_S , " getType " , lua_cocos2dx_Event_getType ) ; <nl> - tolua_function ( tolua_S , " getCurrentTarget " , lua_cocos2dx_Event_getCurrentTarget ) ; <nl> - tolua_function ( tolua_S , " stopPropagation " , lua_cocos2dx_Event_stopPropagation ) ; <nl> - tolua_endmodule ( tolua_S ) ; <nl> - std : : string typeName = typeid ( cocos2d : : Event ) . name ( ) ; <nl> - g_luaType [ typeName ] = " cc . Event " ; <nl> - g_typeCast [ " Event " ] = " cc . Event " ; <nl> - return 1 ; <nl> - } <nl> - <nl> int lua_cocos2dx_EventTouch_getEventCode ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> int lua_register_cocos2dx_EventKeyboard ( lua_State * tolua_S ) <nl> return 1 ; <nl> } <nl> <nl> - int lua_cocos2dx_Texture2D_getShaderProgram ( lua_State * tolua_S ) <nl> - { <nl> - int argc = 0 ; <nl> - cocos2d : : Texture2D * cobj = nullptr ; <nl> - bool ok = true ; <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - tolua_Error tolua_err ; <nl> - # endif <nl> - <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Texture2D " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> - # endif <nl> - <nl> - cobj = ( cocos2d : : Texture2D * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - if ( ! cobj ) <nl> - { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Texture2D_getShaderProgram ' " , nullptr ) ; <nl> - return 0 ; <nl> - } <nl> - # endif <nl> - <nl> - argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 0 ) <nl> - { <nl> - if ( ! ok ) <nl> - return 0 ; <nl> - cocos2d : : GLProgram * ret = cobj - > getGLProgram ( ) ; <nl> - object_to_luaval < cocos2d : : GLProgram > ( tolua_S , " cc . GLProgram " , ( cocos2d : : GLProgram * ) ret ) ; <nl> - return 1 ; <nl> - } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getShaderProgram " , argc , 0 ) ; <nl> - return 0 ; <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Texture2D_getShaderProgram ' . " , & tolua_err ) ; <nl> - # endif <nl> - <nl> - return 0 ; <nl> - } <nl> int lua_cocos2dx_Texture2D_getMaxT ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> int lua_cocos2dx_Texture2D_initWithImage ( lua_State * tolua_S ) <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Texture2D_setGLProgram ( lua_State * tolua_S ) <nl> - { <nl> - int argc = 0 ; <nl> - cocos2d : : Texture2D * cobj = nullptr ; <nl> - bool ok = true ; <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - tolua_Error tolua_err ; <nl> - # endif <nl> - <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Texture2D " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> - # endif <nl> - <nl> - cobj = ( cocos2d : : Texture2D * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - if ( ! cobj ) <nl> - { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Texture2D_setShaderProgram ' " , nullptr ) ; <nl> - return 0 ; <nl> - } <nl> - # endif <nl> - <nl> - argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 1 ) <nl> - { <nl> - cocos2d : : GLProgram * arg0 ; <nl> - <nl> - ok & = luaval_to_object < cocos2d : : GLProgram > ( tolua_S , 2 , " cc . GLProgram " , & arg0 ) ; <nl> - if ( ! ok ) <nl> - return 0 ; <nl> - cobj - > setGLProgram ( arg0 ) ; <nl> - return 0 ; <nl> - } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setShaderProgram " , argc , 1 ) ; <nl> - return 0 ; <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Texture2D_setShaderProgram ' . " , & tolua_err ) ; <nl> - # endif <nl> - <nl> - return 0 ; <nl> - } <nl> int lua_cocos2dx_Texture2D_getMaxS ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> int lua_cocos2dx_Texture2D_drawAtPoint ( lua_State * tolua_S ) <nl> <nl> return 0 ; <nl> } <nl> + int lua_cocos2dx_Texture2D_getGLProgram ( lua_State * tolua_S ) <nl> + { <nl> + int argc = 0 ; <nl> + cocos2d : : Texture2D * cobj = nullptr ; <nl> + bool ok = true ; <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + tolua_Error tolua_err ; <nl> + # endif <nl> + <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Texture2D " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + # endif <nl> + <nl> + cobj = ( cocos2d : : Texture2D * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + if ( ! cobj ) <nl> + { <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Texture2D_getGLProgram ' " , nullptr ) ; <nl> + return 0 ; <nl> + } <nl> + # endif <nl> + <nl> + argc = lua_gettop ( tolua_S ) - 1 ; <nl> + if ( argc = = 0 ) <nl> + { <nl> + if ( ! ok ) <nl> + return 0 ; <nl> + cocos2d : : GLProgram * ret = cobj - > getGLProgram ( ) ; <nl> + object_to_luaval < cocos2d : : GLProgram > ( tolua_S , " cc . GLProgram " , ( cocos2d : : GLProgram * ) ret ) ; <nl> + return 1 ; <nl> + } <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getGLProgram " , argc , 0 ) ; <nl> + return 0 ; <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + tolua_lerror : <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Texture2D_getGLProgram ' . " , & tolua_err ) ; <nl> + # endif <nl> + <nl> + return 0 ; <nl> + } <nl> int lua_cocos2dx_Texture2D_hasMipmaps ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> int lua_cocos2dx_Texture2D_hasMipmaps ( lua_State * tolua_S ) <nl> <nl> return 0 ; <nl> } <nl> + int lua_cocos2dx_Texture2D_setGLProgram ( lua_State * tolua_S ) <nl> + { <nl> + int argc = 0 ; <nl> + cocos2d : : Texture2D * cobj = nullptr ; <nl> + bool ok = true ; <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + tolua_Error tolua_err ; <nl> + # endif <nl> + <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Texture2D " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + # endif <nl> + <nl> + cobj = ( cocos2d : : Texture2D * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + if ( ! cobj ) <nl> + { <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Texture2D_setGLProgram ' " , nullptr ) ; <nl> + return 0 ; <nl> + } <nl> + # endif <nl> + <nl> + argc = lua_gettop ( tolua_S ) - 1 ; <nl> + if ( argc = = 1 ) <nl> + { <nl> + cocos2d : : GLProgram * arg0 ; <nl> + <nl> + ok & = luaval_to_object < cocos2d : : GLProgram > ( tolua_S , 2 , " cc . GLProgram " , & arg0 ) ; <nl> + if ( ! ok ) <nl> + return 0 ; <nl> + cobj - > setGLProgram ( arg0 ) ; <nl> + return 0 ; <nl> + } <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setGLProgram " , argc , 1 ) ; <nl> + return 0 ; <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + tolua_lerror : <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Texture2D_setGLProgram ' . " , & tolua_err ) ; <nl> + # endif <nl> + <nl> + return 0 ; <nl> + } <nl> int lua_cocos2dx_Texture2D_setMaxS ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> int lua_register_cocos2dx_Texture2D ( lua_State * tolua_S ) <nl> tolua_cclass ( tolua_S , " Texture2D " , " cc . Texture2D " , " cc . Ref " , nullptr ) ; <nl> <nl> tolua_beginmodule ( tolua_S , " Texture2D " ) ; <nl> - tolua_function ( tolua_S , " getShaderProgram " , lua_cocos2dx_Texture2D_getShaderProgram ) ; <nl> tolua_function ( tolua_S , " getMaxT " , lua_cocos2dx_Texture2D_getMaxT ) ; <nl> tolua_function ( tolua_S , " getStringForFormat " , lua_cocos2dx_Texture2D_getStringForFormat ) ; <nl> tolua_function ( tolua_S , " initWithImage " , lua_cocos2dx_Texture2D_initWithImage ) ; <nl> - tolua_function ( tolua_S , " setShaderProgram " , lua_cocos2dx_Texture2D_setShaderProgram ) ; <nl> tolua_function ( tolua_S , " getMaxS " , lua_cocos2dx_Texture2D_getMaxS ) ; <nl> tolua_function ( tolua_S , " updateWithData " , lua_cocos2dx_Texture2D_updateWithData ) ; <nl> tolua_function ( tolua_S , " hasPremultipliedAlpha " , lua_cocos2dx_Texture2D_hasPremultipliedAlpha ) ; <nl> int lua_register_cocos2dx_Texture2D ( lua_State * tolua_S ) <nl> tolua_function ( tolua_S , " getContentSizeInPixels " , lua_cocos2dx_Texture2D_getContentSizeInPixels ) ; <nl> tolua_function ( tolua_S , " getPixelsWide " , lua_cocos2dx_Texture2D_getPixelsWide ) ; <nl> tolua_function ( tolua_S , " drawAtPoint " , lua_cocos2dx_Texture2D_drawAtPoint ) ; <nl> + tolua_function ( tolua_S , " getGLProgram " , lua_cocos2dx_Texture2D_getGLProgram ) ; <nl> tolua_function ( tolua_S , " hasMipmaps " , lua_cocos2dx_Texture2D_hasMipmaps ) ; <nl> + tolua_function ( tolua_S , " setGLProgram " , lua_cocos2dx_Texture2D_setGLProgram ) ; <nl> tolua_function ( tolua_S , " setMaxS " , lua_cocos2dx_Texture2D_setMaxS ) ; <nl> tolua_function ( tolua_S , " new " , lua_cocos2dx_Texture2D_constructor ) ; <nl> tolua_function ( tolua_S , " setDefaultAlphaPixelFormat " , lua_cocos2dx_Texture2D_setDefaultAlphaPixelFormat ) ; <nl> int lua_register_cocos2dx_Texture2D ( lua_State * tolua_S ) <nl> return 1 ; <nl> } <nl> <nl> - int lua_cocos2dx_EventListener_setEnabled ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_addChild ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : EventListener * cobj = nullptr ; <nl> + cocos2d : : Node * cobj = nullptr ; <nl> bool ok = true ; <nl> - <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_Error tolua_err ; <nl> # endif <nl> <nl> - <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . EventListener " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> - <nl> - cobj = ( cocos2d : : EventListener * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> - <nl> + cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! cobj ) <nl> + if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_EventListener_setEnabled ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_addChild ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> - <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 1 ) <nl> - { <nl> - bool arg0 ; <nl> + do { <nl> + if ( argc = = 2 ) { <nl> + cocos2d : : Node * arg0 ; <nl> + ok & = luaval_to_object < cocos2d : : Node > ( tolua_S , 2 , " cc . Node " , & arg0 ) ; <nl> <nl> - ok & = luaval_to_boolean ( tolua_S , 2 , & arg0 ) ; <nl> - if ( ! ok ) <nl> + if ( ! ok ) { break ; } <nl> + int arg1 ; <nl> + ok & = luaval_to_int32 ( tolua_S , 3 , ( int * ) & arg1 ) ; <nl> + <nl> + if ( ! ok ) { break ; } <nl> + cobj - > addChild ( arg0 , arg1 ) ; <nl> return 0 ; <nl> - cobj - > setEnabled ( arg0 ) ; <nl> - return 0 ; <nl> - } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setEnabled " , argc , 1 ) ; <nl> + } <nl> + } while ( 0 ) ; <nl> + ok = true ; <nl> + do { <nl> + if ( argc = = 1 ) { <nl> + cocos2d : : Node * arg0 ; <nl> + ok & = luaval_to_object < cocos2d : : Node > ( tolua_S , 2 , " cc . Node " , & arg0 ) ; <nl> + <nl> + if ( ! ok ) { break ; } <nl> + cobj - > addChild ( arg0 ) ; <nl> + return 0 ; <nl> + } <nl> + } while ( 0 ) ; <nl> + ok = true ; <nl> + do { <nl> + if ( argc = = 3 ) { <nl> + cocos2d : : Node * arg0 ; <nl> + ok & = luaval_to_object < cocos2d : : Node > ( tolua_S , 2 , " cc . Node " , & arg0 ) ; <nl> + <nl> + if ( ! ok ) { break ; } <nl> + int arg1 ; <nl> + ok & = luaval_to_int32 ( tolua_S , 3 , ( int * ) & arg1 ) ; <nl> + <nl> + if ( ! ok ) { break ; } <nl> + int arg2 ; <nl> + ok & = luaval_to_int32 ( tolua_S , 4 , ( int * ) & arg2 ) ; <nl> + <nl> + if ( ! ok ) { break ; } <nl> + cobj - > addChild ( arg0 , arg1 , arg2 ) ; <nl> + return 0 ; <nl> + } <nl> + } while ( 0 ) ; <nl> + ok = true ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " addChild " , argc , 3 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_EventListener_setEnabled ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_addChild ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_EventListener_clone ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_removeComponent ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : EventListener * cobj = nullptr ; <nl> + cocos2d : : Node * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_EventListener_clone ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . EventListener " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : EventListener * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_EventListener_clone ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_removeComponent ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 0 ) <nl> + if ( argc = = 1 ) <nl> { <nl> + std : : string arg0 ; <nl> + <nl> + ok & = luaval_to_std_string ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cocos2d : : EventListener * ret = cobj - > clone ( ) ; <nl> - object_to_luaval < cocos2d : : EventListener > ( tolua_S , " cc . EventListener " , ( cocos2d : : EventListener * ) ret ) ; <nl> + bool ret = cobj - > removeComponent ( arg0 ) ; <nl> + tolua_pushboolean ( tolua_S , ( bool ) ret ) ; <nl> return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " clone " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " removeComponent " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_EventListener_clone ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_removeComponent ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_EventListener_isEnabled ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_setPhysicsBody ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : EventListener * cobj = nullptr ; <nl> + cocos2d : : Node * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_EventListener_isEnabled ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . EventListener " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : EventListener * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_EventListener_isEnabled ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setPhysicsBody ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 0 ) <nl> + if ( argc = = 1 ) <nl> { <nl> + cocos2d : : PhysicsBody * arg0 ; <nl> + <nl> + ok & = luaval_to_object < cocos2d : : PhysicsBody > ( tolua_S , 2 , " cc . PhysicsBody " , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - bool ret = cobj - > isEnabled ( ) ; <nl> - tolua_pushboolean ( tolua_S , ( bool ) ret ) ; <nl> - return 1 ; <nl> + cobj - > setPhysicsBody ( arg0 ) ; <nl> + return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " isEnabled " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setPhysicsBody " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_EventListener_isEnabled ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setPhysicsBody ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_EventListener_checkAvailable ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getDescription ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : EventListener * cobj = nullptr ; <nl> + cocos2d : : Node * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_EventListener_checkAvailable ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . EventListener " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : EventListener * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_EventListener_checkAvailable ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getDescription ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_EventListener_checkAvailable ( lua_State * tolua_S ) <nl> { <nl> if ( ! ok ) <nl> return 0 ; <nl> - bool ret = cobj - > checkAvailable ( ) ; <nl> - tolua_pushboolean ( tolua_S , ( bool ) ret ) ; <nl> + std : : string ret = cobj - > getDescription ( ) ; <nl> + tolua_pushcppstring ( tolua_S , ret ) ; <nl> return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " checkAvailable " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getDescription " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_EventListener_checkAvailable ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getDescription ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - static int lua_cocos2dx_EventListener_finalize ( lua_State * tolua_S ) <nl> - { <nl> - printf ( " luabindings : finalizing LUA object ( EventListener ) " ) ; <nl> - return 0 ; <nl> - } <nl> - <nl> - int lua_register_cocos2dx_EventListener ( lua_State * tolua_S ) <nl> - { <nl> - tolua_usertype ( tolua_S , " cc . EventListener " ) ; <nl> - tolua_cclass ( tolua_S , " EventListener " , " cc . EventListener " , " cc . Ref " , nullptr ) ; <nl> - <nl> - tolua_beginmodule ( tolua_S , " EventListener " ) ; <nl> - tolua_function ( tolua_S , " setEnabled " , lua_cocos2dx_EventListener_setEnabled ) ; <nl> - tolua_function ( tolua_S , " clone " , lua_cocos2dx_EventListener_clone ) ; <nl> - tolua_function ( tolua_S , " isEnabled " , lua_cocos2dx_EventListener_isEnabled ) ; <nl> - tolua_function ( tolua_S , " checkAvailable " , lua_cocos2dx_EventListener_checkAvailable ) ; <nl> - tolua_endmodule ( tolua_S ) ; <nl> - std : : string typeName = typeid ( cocos2d : : EventListener ) . name ( ) ; <nl> - g_luaType [ typeName ] = " cc . EventListener " ; <nl> - g_typeCast [ " EventListener " ] = " cc . EventListener " ; <nl> - return 1 ; <nl> - } <nl> - <nl> - int lua_cocos2dx_EventDispatcher_pauseEventListenersForTarget ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_setRotationSkewY ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : EventDispatcher * cobj = nullptr ; <nl> + cocos2d : : Node * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_EventDispatcher_pauseEventListenersForTarget ( lua_State * tolua_S <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . EventDispatcher " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : EventDispatcher * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_EventDispatcher_pauseEventListenersForTarget ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setRotationSkewY ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_EventDispatcher_pauseEventListenersForTarget ( lua_State * tolua_S <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> if ( argc = = 1 ) <nl> { <nl> - cocos2d : : Node * arg0 ; <nl> - <nl> - ok & = luaval_to_object < cocos2d : : Node > ( tolua_S , 2 , " cc . Node " , & arg0 ) ; <nl> - if ( ! ok ) <nl> - return 0 ; <nl> - cobj - > pauseEventListenersForTarget ( arg0 ) ; <nl> - return 0 ; <nl> - } <nl> - if ( argc = = 2 ) <nl> - { <nl> - cocos2d : : Node * arg0 ; <nl> - bool arg1 ; <nl> - <nl> - ok & = luaval_to_object < cocos2d : : Node > ( tolua_S , 2 , " cc . Node " , & arg0 ) ; <nl> + double arg0 ; <nl> <nl> - ok & = luaval_to_boolean ( tolua_S , 3 , & arg1 ) ; <nl> + ok & = luaval_to_number ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > pauseEventListenersForTarget ( arg0 , arg1 ) ; <nl> + cobj - > setRotationSkewY ( arg0 ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " pauseEventListenersForTarget " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setRotationSkewY " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_EventDispatcher_pauseEventListenersForTarget ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setRotationSkewY ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_EventDispatcher_addEventListenerWithSceneGraphPriority ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_setOpacityModifyRGB ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : EventDispatcher * cobj = nullptr ; <nl> + cocos2d : : Node * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_EventDispatcher_addEventListenerWithSceneGraphPriority ( lua_Stat <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . EventDispatcher " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : EventDispatcher * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_EventDispatcher_addEventListenerWithSceneGraphPriority ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setOpacityModifyRGB ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 2 ) <nl> + if ( argc = = 1 ) <nl> { <nl> - cocos2d : : EventListener * arg0 ; <nl> - cocos2d : : Node * arg1 ; <nl> - <nl> - ok & = luaval_to_object < cocos2d : : EventListener > ( tolua_S , 2 , " cc . EventListener " , & arg0 ) ; <nl> + bool arg0 ; <nl> <nl> - ok & = luaval_to_object < cocos2d : : Node > ( tolua_S , 3 , " cc . Node " , & arg1 ) ; <nl> + ok & = luaval_to_boolean ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > addEventListenerWithSceneGraphPriority ( arg0 , arg1 ) ; <nl> + cobj - > setOpacityModifyRGB ( arg0 ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " addEventListenerWithSceneGraphPriority " , argc , 2 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setOpacityModifyRGB " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_EventDispatcher_addEventListenerWithSceneGraphPriority ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setOpacityModifyRGB ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_EventDispatcher_setEnabled ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_setCascadeOpacityEnabled ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : EventDispatcher * cobj = nullptr ; <nl> + cocos2d : : Node * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_EventDispatcher_setEnabled ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . EventDispatcher " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : EventDispatcher * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_EventDispatcher_setEnabled ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setCascadeOpacityEnabled ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_EventDispatcher_setEnabled ( lua_State * tolua_S ) <nl> ok & = luaval_to_boolean ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > setEnabled ( arg0 ) ; <nl> + cobj - > setCascadeOpacityEnabled ( arg0 ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setEnabled " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setCascadeOpacityEnabled " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_EventDispatcher_setEnabled ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setCascadeOpacityEnabled ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_EventDispatcher_addEventListenerWithFixedPriority ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getChildren ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : EventDispatcher * cobj = nullptr ; <nl> + cocos2d : : Node * cobj = nullptr ; <nl> bool ok = true ; <nl> - <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_Error tolua_err ; <nl> # endif <nl> <nl> - <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . EventDispatcher " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> - <nl> - cobj = ( cocos2d : : EventDispatcher * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> - <nl> + cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! cobj ) <nl> + if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_EventDispatcher_addEventListenerWithFixedPriority ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getChildren ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> - <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 2 ) <nl> - { <nl> - cocos2d : : EventListener * arg0 ; <nl> - int arg1 ; <nl> - <nl> - ok & = luaval_to_object < cocos2d : : EventListener > ( tolua_S , 2 , " cc . EventListener " , & arg0 ) ; <nl> - <nl> - ok & = luaval_to_int32 ( tolua_S , 3 , ( int * ) & arg1 ) ; <nl> - if ( ! ok ) <nl> - return 0 ; <nl> - cobj - > addEventListenerWithFixedPriority ( arg0 , arg1 ) ; <nl> - return 0 ; <nl> - } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " addEventListenerWithFixedPriority " , argc , 2 ) ; <nl> + do { <nl> + if ( argc = = 0 ) { <nl> + const cocos2d : : Vector < cocos2d : : Node * > & ret = cobj - > getChildren ( ) ; <nl> + ccvector_to_luaval ( tolua_S , ret ) ; <nl> + return 1 ; <nl> + } <nl> + } while ( 0 ) ; <nl> + ok = true ; <nl> + do { <nl> + if ( argc = = 0 ) { <nl> + cocos2d : : Vector < cocos2d : : Node * > & ret = cobj - > getChildren ( ) ; <nl> + ccvector_to_luaval ( tolua_S , ret ) ; <nl> + return 1 ; <nl> + } <nl> + } while ( 0 ) ; <nl> + ok = true ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getChildren " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_EventDispatcher_addEventListenerWithFixedPriority ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getChildren ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_EventDispatcher_removeEventListener ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_pause ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : EventDispatcher * cobj = nullptr ; <nl> + cocos2d : : Node * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_EventDispatcher_removeEventListener ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . EventDispatcher " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : EventDispatcher * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_EventDispatcher_removeEventListener ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_pause ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 1 ) <nl> + if ( argc = = 0 ) <nl> { <nl> - cocos2d : : EventListener * arg0 ; <nl> - <nl> - ok & = luaval_to_object < cocos2d : : EventListener > ( tolua_S , 2 , " cc . EventListener " , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > removeEventListener ( arg0 ) ; <nl> + cobj - > pause ( ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " removeEventListener " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " pause " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_EventDispatcher_removeEventListener ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_pause ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_EventDispatcher_resumeEventListenersForTarget ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_convertToWorldSpaceAR ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : EventDispatcher * cobj = nullptr ; <nl> + cocos2d : : Node * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_EventDispatcher_resumeEventListenersForTarget ( lua_State * tolua_ <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . EventDispatcher " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : EventDispatcher * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_EventDispatcher_resumeEventListenersForTarget ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_convertToWorldSpaceAR ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_EventDispatcher_resumeEventListenersForTarget ( lua_State * tolua_ <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> if ( argc = = 1 ) <nl> { <nl> - cocos2d : : Node * arg0 ; <nl> - <nl> - ok & = luaval_to_object < cocos2d : : Node > ( tolua_S , 2 , " cc . Node " , & arg0 ) ; <nl> - if ( ! ok ) <nl> - return 0 ; <nl> - cobj - > resumeEventListenersForTarget ( arg0 ) ; <nl> - return 0 ; <nl> - } <nl> - if ( argc = = 2 ) <nl> - { <nl> - cocos2d : : Node * arg0 ; <nl> - bool arg1 ; <nl> - <nl> - ok & = luaval_to_object < cocos2d : : Node > ( tolua_S , 2 , " cc . Node " , & arg0 ) ; <nl> + cocos2d : : Vector2 arg0 ; <nl> <nl> - ok & = luaval_to_boolean ( tolua_S , 3 , & arg1 ) ; <nl> + ok & = luaval_to_vector2 ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > resumeEventListenersForTarget ( arg0 , arg1 ) ; <nl> - return 0 ; <nl> + cocos2d : : Vector2 ret = cobj - > convertToWorldSpaceAR ( arg0 ) ; <nl> + vector2_to_luaval ( tolua_S , ret ) ; <nl> + return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " resumeEventListenersForTarget " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " convertToWorldSpaceAR " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_EventDispatcher_resumeEventListenersForTarget ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_convertToWorldSpaceAR ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_EventDispatcher_removeEventListenersForTarget ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_isIgnoreAnchorPointForPosition ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : EventDispatcher * cobj = nullptr ; <nl> + cocos2d : : Node * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_EventDispatcher_removeEventListenersForTarget ( lua_State * tolua_ <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . EventDispatcher " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : EventDispatcher * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_EventDispatcher_removeEventListenersForTarget ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_isIgnoreAnchorPointForPosition ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 1 ) <nl> + if ( argc = = 0 ) <nl> { <nl> - cocos2d : : Node * arg0 ; <nl> - <nl> - ok & = luaval_to_object < cocos2d : : Node > ( tolua_S , 2 , " cc . Node " , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > removeEventListenersForTarget ( arg0 ) ; <nl> - return 0 ; <nl> + bool ret = cobj - > isIgnoreAnchorPointForPosition ( ) ; <nl> + tolua_pushboolean ( tolua_S , ( bool ) ret ) ; <nl> + return 1 ; <nl> } <nl> - if ( argc = = 2 ) <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " isIgnoreAnchorPointForPosition " , argc , 0 ) ; <nl> + return 0 ; <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + tolua_lerror : <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_isIgnoreAnchorPointForPosition ' . " , & tolua_err ) ; <nl> + # endif <nl> + <nl> + return 0 ; <nl> + } <nl> + int lua_cocos2dx_Node_updateDisplayedOpacity ( lua_State * tolua_S ) <nl> + { <nl> + int argc = 0 ; <nl> + cocos2d : : Node * cobj = nullptr ; <nl> + bool ok = true ; <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + tolua_Error tolua_err ; <nl> + # endif <nl> + <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + # endif <nl> + <nl> + cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + if ( ! cobj ) <nl> { <nl> - cocos2d : : Node * arg0 ; <nl> - bool arg1 ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_updateDisplayedOpacity ' " , nullptr ) ; <nl> + return 0 ; <nl> + } <nl> + # endif <nl> <nl> - ok & = luaval_to_object < cocos2d : : Node > ( tolua_S , 2 , " cc . Node " , & arg0 ) ; <nl> + argc = lua_gettop ( tolua_S ) - 1 ; <nl> + if ( argc = = 1 ) <nl> + { <nl> + uint16_t arg0 ; <nl> <nl> - ok & = luaval_to_boolean ( tolua_S , 3 , & arg1 ) ; <nl> + ok & = luaval_to_uint16 ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > removeEventListenersForTarget ( arg0 , arg1 ) ; <nl> + cobj - > updateDisplayedOpacity ( arg0 ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " removeEventListenersForTarget " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " updateDisplayedOpacity " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_EventDispatcher_removeEventListenersForTarget ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_updateDisplayedOpacity ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_EventDispatcher_setPriority ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_setRotation ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : EventDispatcher * cobj = nullptr ; <nl> + cocos2d : : Node * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_EventDispatcher_setPriority ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . EventDispatcher " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : EventDispatcher * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_EventDispatcher_setPriority ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setRotation ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 2 ) <nl> + if ( argc = = 1 ) <nl> { <nl> - cocos2d : : EventListener * arg0 ; <nl> - int arg1 ; <nl> - <nl> - ok & = luaval_to_object < cocos2d : : EventListener > ( tolua_S , 2 , " cc . EventListener " , & arg0 ) ; <nl> + double arg0 ; <nl> <nl> - ok & = luaval_to_int32 ( tolua_S , 3 , ( int * ) & arg1 ) ; <nl> + ok & = luaval_to_number ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > setPriority ( arg0 , arg1 ) ; <nl> + cobj - > setRotation ( arg0 ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setPriority " , argc , 2 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setRotation " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_EventDispatcher_setPriority ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setRotation ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_EventDispatcher_addCustomEventListener ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_setScaleZ ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : EventDispatcher * cobj = nullptr ; <nl> + cocos2d : : Node * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_EventDispatcher_addCustomEventListener ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . EventDispatcher " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : EventDispatcher * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_EventDispatcher_addCustomEventListener ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setScaleZ ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 2 ) <nl> + if ( argc = = 1 ) <nl> { <nl> - std : : string arg0 ; <nl> - std : : function < void ( cocos2d : : EventCustom * ) > arg1 ; <nl> - <nl> - ok & = luaval_to_std_string ( tolua_S , 2 , & arg0 ) ; <nl> + double arg0 ; <nl> <nl> - do { <nl> - / / Lambda binding for lua is not supported . <nl> - assert ( false ) ; <nl> - } while ( 0 ) <nl> - ; <nl> + ok & = luaval_to_number ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cocos2d : : EventListenerCustom * ret = cobj - > addCustomEventListener ( arg0 , arg1 ) ; <nl> - object_to_luaval < cocos2d : : EventListenerCustom > ( tolua_S , " cc . EventListenerCustom " , ( cocos2d : : EventListenerCustom * ) ret ) ; <nl> - return 1 ; <nl> + cobj - > setScaleZ ( arg0 ) ; <nl> + return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " addCustomEventListener " , argc , 2 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setScaleZ " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_EventDispatcher_addCustomEventListener ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setScaleZ ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_EventDispatcher_dispatchEvent ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_setScaleY ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : EventDispatcher * cobj = nullptr ; <nl> + cocos2d : : Node * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_EventDispatcher_dispatchEvent ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . EventDispatcher " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : EventDispatcher * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_EventDispatcher_dispatchEvent ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setScaleY ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_EventDispatcher_dispatchEvent ( lua_State * tolua_S ) <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> if ( argc = = 1 ) <nl> { <nl> - cocos2d : : Event * arg0 ; <nl> + double arg0 ; <nl> <nl> - ok & = luaval_to_object < cocos2d : : Event > ( tolua_S , 2 , " cc . Event " , & arg0 ) ; <nl> + ok & = luaval_to_number ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > dispatchEvent ( arg0 ) ; <nl> + cobj - > setScaleY ( arg0 ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " dispatchEvent " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setScaleY " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_EventDispatcher_dispatchEvent ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setScaleY ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_EventDispatcher_removeAllEventListeners ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_setScaleX ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : EventDispatcher * cobj = nullptr ; <nl> + cocos2d : : Node * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_EventDispatcher_removeAllEventListeners ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . EventDispatcher " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : EventDispatcher * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_EventDispatcher_removeAllEventListeners ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setScaleX ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 0 ) <nl> + if ( argc = = 1 ) <nl> { <nl> + double arg0 ; <nl> + <nl> + ok & = luaval_to_number ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > removeAllEventListeners ( ) ; <nl> + cobj - > setScaleX ( arg0 ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " removeAllEventListeners " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setScaleX " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_EventDispatcher_removeAllEventListeners ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setScaleX ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_EventDispatcher_removeCustomEventListeners ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_setRotationSkewX ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : EventDispatcher * cobj = nullptr ; <nl> + cocos2d : : Node * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_EventDispatcher_removeCustomEventListeners ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . EventDispatcher " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : EventDispatcher * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_EventDispatcher_removeCustomEventListeners ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setRotationSkewX ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_EventDispatcher_removeCustomEventListeners ( lua_State * tolua_S ) <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> if ( argc = = 1 ) <nl> { <nl> - std : : string arg0 ; <nl> + double arg0 ; <nl> <nl> - ok & = luaval_to_std_string ( tolua_S , 2 , & arg0 ) ; <nl> + ok & = luaval_to_number ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > removeCustomEventListeners ( arg0 ) ; <nl> + cobj - > setRotationSkewX ( arg0 ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " removeCustomEventListeners " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setRotationSkewX " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_EventDispatcher_removeCustomEventListeners ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setRotationSkewX ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_EventDispatcher_isEnabled ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_removeAllComponents ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : EventDispatcher * cobj = nullptr ; <nl> + cocos2d : : Node * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_EventDispatcher_isEnabled ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . EventDispatcher " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : EventDispatcher * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_EventDispatcher_isEnabled ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_removeAllComponents ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_EventDispatcher_isEnabled ( lua_State * tolua_S ) <nl> { <nl> if ( ! ok ) <nl> return 0 ; <nl> - bool ret = cobj - > isEnabled ( ) ; <nl> - tolua_pushboolean ( tolua_S , ( bool ) ret ) ; <nl> - return 1 ; <nl> + cobj - > removeAllComponents ( ) ; <nl> + return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " isEnabled " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " removeAllComponents " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_EventDispatcher_isEnabled ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_removeAllComponents ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_EventDispatcher_removeEventListenersForType ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node__setLocalZOrder ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : EventDispatcher * cobj = nullptr ; <nl> + cocos2d : : Node * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_EventDispatcher_removeEventListenersForType ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . EventDispatcher " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : EventDispatcher * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_EventDispatcher_removeEventListenersForType ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node__setLocalZOrder ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_EventDispatcher_removeEventListenersForType ( lua_State * tolua_S ) <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> if ( argc = = 1 ) <nl> { <nl> - cocos2d : : EventListener : : Type arg0 ; <nl> + int arg0 ; <nl> <nl> ok & = luaval_to_int32 ( tolua_S , 2 , ( int * ) & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > removeEventListenersForType ( arg0 ) ; <nl> + cobj - > _setLocalZOrder ( arg0 ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " removeEventListenersForType " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " _setLocalZOrder " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_EventDispatcher_removeEventListenersForType ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node__setLocalZOrder ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_EventDispatcher_constructor ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getTag ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : EventDispatcher * cobj = nullptr ; <nl> + cocos2d : : Node * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_EventDispatcher_constructor ( lua_State * tolua_S ) <nl> # endif <nl> <nl> <nl> + # if COCOS2D_DEBUG > = 1 <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + # endif <nl> + <nl> + cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + if ( ! cobj ) <nl> + { <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getTag ' " , nullptr ) ; <nl> + return 0 ; <nl> + } <nl> + # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> if ( argc = = 0 ) <nl> { <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj = new cocos2d : : EventDispatcher ( ) ; <nl> - cobj - > autorelease ( ) ; <nl> - int ID = ( int ) cobj - > _ID ; <nl> - int * luaID = & cobj - > _luaID ; <nl> - toluafix_pushusertype_ccobject ( tolua_S , ID , luaID , ( void * ) cobj , " cc . EventDispatcher " ) ; <nl> + int ret = cobj - > getTag ( ) ; <nl> + tolua_pushnumber ( tolua_S , ( lua_Number ) ret ) ; <nl> return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " EventDispatcher " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getTag " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_EventDispatcher_constructor ' . " , & tolua_err ) ; <nl> + tolua_lerror : <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getTag ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - <nl> - static int lua_cocos2dx_EventDispatcher_finalize ( lua_State * tolua_S ) <nl> - { <nl> - printf ( " luabindings : finalizing LUA object ( EventDispatcher ) " ) ; <nl> - return 0 ; <nl> - } <nl> - <nl> - int lua_register_cocos2dx_EventDispatcher ( lua_State * tolua_S ) <nl> - { <nl> - tolua_usertype ( tolua_S , " cc . EventDispatcher " ) ; <nl> - tolua_cclass ( tolua_S , " EventDispatcher " , " cc . EventDispatcher " , " cc . Ref " , nullptr ) ; <nl> - <nl> - tolua_beginmodule ( tolua_S , " EventDispatcher " ) ; <nl> - tolua_function ( tolua_S , " pauseEventListenersForTarget " , lua_cocos2dx_EventDispatcher_pauseEventListenersForTarget ) ; <nl> - tolua_function ( tolua_S , " addEventListenerWithSceneGraphPriority " , lua_cocos2dx_EventDispatcher_addEventListenerWithSceneGraphPriority ) ; <nl> - tolua_function ( tolua_S , " setEnabled " , lua_cocos2dx_EventDispatcher_setEnabled ) ; <nl> - tolua_function ( tolua_S , " addEventListenerWithFixedPriority " , lua_cocos2dx_EventDispatcher_addEventListenerWithFixedPriority ) ; <nl> - tolua_function ( tolua_S , " removeEventListener " , lua_cocos2dx_EventDispatcher_removeEventListener ) ; <nl> - tolua_function ( tolua_S , " resumeEventListenersForTarget " , lua_cocos2dx_EventDispatcher_resumeEventListenersForTarget ) ; <nl> - tolua_function ( tolua_S , " removeEventListenersForTarget " , lua_cocos2dx_EventDispatcher_removeEventListenersForTarget ) ; <nl> - tolua_function ( tolua_S , " setPriority " , lua_cocos2dx_EventDispatcher_setPriority ) ; <nl> - tolua_function ( tolua_S , " addCustomEventListener " , lua_cocos2dx_EventDispatcher_addCustomEventListener ) ; <nl> - tolua_function ( tolua_S , " dispatchEvent " , lua_cocos2dx_EventDispatcher_dispatchEvent ) ; <nl> - tolua_function ( tolua_S , " removeAllEventListeners " , lua_cocos2dx_EventDispatcher_removeAllEventListeners ) ; <nl> - tolua_function ( tolua_S , " removeCustomEventListeners " , lua_cocos2dx_EventDispatcher_removeCustomEventListeners ) ; <nl> - tolua_function ( tolua_S , " isEnabled " , lua_cocos2dx_EventDispatcher_isEnabled ) ; <nl> - tolua_function ( tolua_S , " removeEventListenersForType " , lua_cocos2dx_EventDispatcher_removeEventListenersForType ) ; <nl> - tolua_function ( tolua_S , " new " , lua_cocos2dx_EventDispatcher_constructor ) ; <nl> - tolua_endmodule ( tolua_S ) ; <nl> - std : : string typeName = typeid ( cocos2d : : EventDispatcher ) . name ( ) ; <nl> - g_luaType [ typeName ] = " cc . EventDispatcher " ; <nl> - g_typeCast [ " EventDispatcher " ] = " cc . EventDispatcher " ; <nl> - return 1 ; <nl> - } <nl> - <nl> - int lua_cocos2dx_Node_addChild ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getGLProgram ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> bool ok = true ; <nl> + <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_Error tolua_err ; <nl> # endif <nl> <nl> + <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> + <nl> cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! cobj ) <nl> + if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_addChild ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getGLProgram ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> + <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - do { <nl> - if ( argc = = 2 ) { <nl> - cocos2d : : Node * arg0 ; <nl> - ok & = luaval_to_object < cocos2d : : Node > ( tolua_S , 2 , " cc . Node " , & arg0 ) ; <nl> + if ( argc = = 0 ) <nl> + { <nl> + if ( ! ok ) <nl> + return 0 ; <nl> + cocos2d : : GLProgram * ret = cobj - > getGLProgram ( ) ; <nl> + object_to_luaval < cocos2d : : GLProgram > ( tolua_S , " cc . GLProgram " , ( cocos2d : : GLProgram * ) ret ) ; <nl> + return 1 ; <nl> + } <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getGLProgram " , argc , 0 ) ; <nl> + return 0 ; <nl> <nl> - if ( ! ok ) { break ; } <nl> - int arg1 ; <nl> - ok & = luaval_to_int32 ( tolua_S , 3 , ( int * ) & arg1 ) ; <nl> + # if COCOS2D_DEBUG > = 1 <nl> + tolua_lerror : <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getGLProgram ' . " , & tolua_err ) ; <nl> + # endif <nl> <nl> - if ( ! ok ) { break ; } <nl> - cobj - > addChild ( arg0 , arg1 ) ; <nl> - return 0 ; <nl> - } <nl> - } while ( 0 ) ; <nl> - ok = true ; <nl> - do { <nl> - if ( argc = = 1 ) { <nl> - cocos2d : : Node * arg0 ; <nl> - ok & = luaval_to_object < cocos2d : : Node > ( tolua_S , 2 , " cc . Node " , & arg0 ) ; <nl> + return 0 ; <nl> + } <nl> + int lua_cocos2dx_Node_getNodeToWorldTransform ( lua_State * tolua_S ) <nl> + { <nl> + int argc = 0 ; <nl> + cocos2d : : Node * cobj = nullptr ; <nl> + bool ok = true ; <nl> <nl> - if ( ! ok ) { break ; } <nl> - cobj - > addChild ( arg0 ) ; <nl> - return 0 ; <nl> - } <nl> - } while ( 0 ) ; <nl> - ok = true ; <nl> - do { <nl> - if ( argc = = 3 ) { <nl> - cocos2d : : Node * arg0 ; <nl> - ok & = luaval_to_object < cocos2d : : Node > ( tolua_S , 2 , " cc . Node " , & arg0 ) ; <nl> + # if COCOS2D_DEBUG > = 1 <nl> + tolua_Error tolua_err ; <nl> + # endif <nl> <nl> - if ( ! ok ) { break ; } <nl> - int arg1 ; <nl> - ok & = luaval_to_int32 ( tolua_S , 3 , ( int * ) & arg1 ) ; <nl> <nl> - if ( ! ok ) { break ; } <nl> - int arg2 ; <nl> - ok & = luaval_to_int32 ( tolua_S , 4 , ( int * ) & arg2 ) ; <nl> + # if COCOS2D_DEBUG > = 1 <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + # endif <nl> <nl> - if ( ! ok ) { break ; } <nl> - cobj - > addChild ( arg0 , arg1 , arg2 ) ; <nl> + cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + if ( ! cobj ) <nl> + { <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getNodeToWorldTransform ' " , nullptr ) ; <nl> + return 0 ; <nl> + } <nl> + # endif <nl> + <nl> + argc = lua_gettop ( tolua_S ) - 1 ; <nl> + if ( argc = = 0 ) <nl> + { <nl> + if ( ! ok ) <nl> return 0 ; <nl> - } <nl> - } while ( 0 ) ; <nl> - ok = true ; <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " addChild " , argc , 3 ) ; <nl> + cocos2d : : Matrix ret = cobj - > getNodeToWorldTransform ( ) ; <nl> + matrix_to_luaval ( tolua_S , ret ) ; <nl> + return 1 ; <nl> + } <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getNodeToWorldTransform " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_addChild ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getNodeToWorldTransform ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_removeComponent ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getPosition3D ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_removeComponent ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_removeComponent ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getPosition3D ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 1 ) <nl> + if ( argc = = 0 ) <nl> { <nl> - std : : string arg0 ; <nl> - <nl> - ok & = luaval_to_std_string ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - bool ret = cobj - > removeComponent ( arg0 ) ; <nl> - tolua_pushboolean ( tolua_S , ( bool ) ret ) ; <nl> + cocos2d : : Vector3 ret = cobj - > getPosition3D ( ) ; <nl> + vector3_to_luaval ( tolua_S , ret ) ; <nl> return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " removeComponent " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getPosition3D " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_removeComponent ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getPosition3D ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_setPhysicsBody ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_removeChild ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_setPhysicsBody ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setPhysicsBody ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_removeChild ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node_setPhysicsBody ( lua_State * tolua_S ) <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> if ( argc = = 1 ) <nl> { <nl> - cocos2d : : PhysicsBody * arg0 ; <nl> + cocos2d : : Node * arg0 ; <nl> <nl> - ok & = luaval_to_object < cocos2d : : PhysicsBody > ( tolua_S , 2 , " cc . PhysicsBody " , & arg0 ) ; <nl> + ok & = luaval_to_object < cocos2d : : Node > ( tolua_S , 2 , " cc . Node " , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > setPhysicsBody ( arg0 ) ; <nl> + cobj - > removeChild ( arg0 ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setPhysicsBody " , argc , 1 ) ; <nl> + if ( argc = = 2 ) <nl> + { <nl> + cocos2d : : Node * arg0 ; <nl> + bool arg1 ; <nl> + <nl> + ok & = luaval_to_object < cocos2d : : Node > ( tolua_S , 2 , " cc . Node " , & arg0 ) ; <nl> + <nl> + ok & = luaval_to_boolean ( tolua_S , 3 , & arg1 ) ; <nl> + if ( ! ok ) <nl> + return 0 ; <nl> + cobj - > removeChild ( arg0 , arg1 ) ; <nl> + return 0 ; <nl> + } <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " removeChild " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setPhysicsBody ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_removeChild ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getShaderProgram ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_convertToWorldSpace ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> bool ok = true ; <nl> + <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_Error tolua_err ; <nl> # endif <nl> <nl> + <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> + <nl> cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! cobj ) <nl> + if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getShaderProgram ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_convertToWorldSpace ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> + <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - do { <nl> - if ( argc = = 0 ) { <nl> - const cocos2d : : GLProgram * ret = cobj - > getGLProgram ( ) ; <nl> - object_to_luaval < cocos2d : : GLProgram > ( tolua_S , " cc . GLProgram " , ( cocos2d : : GLProgram * ) ret ) ; <nl> - return 1 ; <nl> - } <nl> - } while ( 0 ) ; <nl> - ok = true ; <nl> - do { <nl> - if ( argc = = 0 ) { <nl> - cocos2d : : GLProgram * ret = cobj - > getGLProgram ( ) ; <nl> - object_to_luaval < cocos2d : : GLProgram > ( tolua_S , " cc . GLProgram " , ( cocos2d : : GLProgram * ) ret ) ; <nl> - return 1 ; <nl> - } <nl> - } while ( 0 ) ; <nl> - ok = true ; <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getShaderProgram " , argc , 0 ) ; <nl> + if ( argc = = 1 ) <nl> + { <nl> + cocos2d : : Vector2 arg0 ; <nl> + <nl> + ok & = luaval_to_vector2 ( tolua_S , 2 , & arg0 ) ; <nl> + if ( ! ok ) <nl> + return 0 ; <nl> + cocos2d : : Vector2 ret = cobj - > convertToWorldSpace ( arg0 ) ; <nl> + vector2_to_luaval ( tolua_S , ret ) ; <nl> + return 1 ; <nl> + } <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " convertToWorldSpace " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getShaderProgram ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_convertToWorldSpace ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getDescription ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getScene ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_getDescription ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getDescription ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getScene ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node_getDescription ( lua_State * tolua_S ) <nl> { <nl> if ( ! ok ) <nl> return 0 ; <nl> - std : : string ret = cobj - > getDescription ( ) ; <nl> - tolua_pushcppstring ( tolua_S , ret ) ; <nl> + cocos2d : : Scene * ret = cobj - > getScene ( ) ; <nl> + object_to_luaval < cocos2d : : Scene > ( tolua_S , " cc . Scene " , ( cocos2d : : Scene * ) ret ) ; <nl> return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getDescription " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getScene " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getDescription ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getScene ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_setRotationSkewY ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getEventDispatcher ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_setRotationSkewY ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setRotationSkewY ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getEventDispatcher ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 1 ) <nl> + if ( argc = = 0 ) <nl> { <nl> - double arg0 ; <nl> - <nl> - ok & = luaval_to_number ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > setRotationSkewY ( arg0 ) ; <nl> - return 0 ; <nl> + cocos2d : : EventDispatcher * ret = cobj - > getEventDispatcher ( ) ; <nl> + object_to_luaval < cocos2d : : EventDispatcher > ( tolua_S , " cc . EventDispatcher " , ( cocos2d : : EventDispatcher * ) ret ) ; <nl> + return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setRotationSkewY " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getEventDispatcher " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setRotationSkewY ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getEventDispatcher ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_setOpacityModifyRGB ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_setSkewX ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_setOpacityModifyRGB ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setOpacityModifyRGB ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setSkewX ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node_setOpacityModifyRGB ( lua_State * tolua_S ) <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> if ( argc = = 1 ) <nl> { <nl> - bool arg0 ; <nl> + double arg0 ; <nl> <nl> - ok & = luaval_to_boolean ( tolua_S , 2 , & arg0 ) ; <nl> + ok & = luaval_to_number ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > setOpacityModifyRGB ( arg0 ) ; <nl> + cobj - > setSkewX ( arg0 ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setOpacityModifyRGB " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setSkewX " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setOpacityModifyRGB ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setSkewX ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_setCascadeOpacityEnabled ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_setGLProgramState ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_setCascadeOpacityEnabled ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setCascadeOpacityEnabled ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setGLProgramState ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node_setCascadeOpacityEnabled ( lua_State * tolua_S ) <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> if ( argc = = 1 ) <nl> { <nl> - bool arg0 ; <nl> + cocos2d : : GLProgramState * arg0 ; <nl> <nl> - ok & = luaval_to_boolean ( tolua_S , 2 , & arg0 ) ; <nl> + ok & = luaval_to_object < cocos2d : : GLProgramState > ( tolua_S , 2 , " cc . GLProgramState " , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > setCascadeOpacityEnabled ( arg0 ) ; <nl> + cobj - > setGLProgramState ( arg0 ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setCascadeOpacityEnabled " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setGLProgramState " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setCascadeOpacityEnabled ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setGLProgramState ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getChildren ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getOpacity ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> bool ok = true ; <nl> + <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_Error tolua_err ; <nl> # endif <nl> <nl> + <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> + <nl> cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! cobj ) <nl> + if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getChildren ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getOpacity ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> + <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - do { <nl> - if ( argc = = 0 ) { <nl> - const cocos2d : : Vector < cocos2d : : Node * > & ret = cobj - > getChildren ( ) ; <nl> - ccvector_to_luaval ( tolua_S , ret ) ; <nl> - return 1 ; <nl> - } <nl> - } while ( 0 ) ; <nl> - ok = true ; <nl> - do { <nl> - if ( argc = = 0 ) { <nl> - cocos2d : : Vector < cocos2d : : Node * > & ret = cobj - > getChildren ( ) ; <nl> - ccvector_to_luaval ( tolua_S , ret ) ; <nl> - return 1 ; <nl> - } <nl> - } while ( 0 ) ; <nl> - ok = true ; <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getChildren " , argc , 0 ) ; <nl> + if ( argc = = 0 ) <nl> + { <nl> + if ( ! ok ) <nl> + return 0 ; <nl> + uint16_t ret = cobj - > getOpacity ( ) ; <nl> + tolua_pushnumber ( tolua_S , ( lua_Number ) ret ) ; <nl> + return 1 ; <nl> + } <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getOpacity " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getChildren ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getOpacity ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_pause ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_convertTouchToNodeSpace ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_pause ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_pause ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_convertTouchToNodeSpace ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 0 ) <nl> + if ( argc = = 1 ) <nl> { <nl> + cocos2d : : Touch * arg0 ; <nl> + <nl> + ok & = luaval_to_object < cocos2d : : Touch > ( tolua_S , 2 , " cc . Touch " , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > pause ( ) ; <nl> + cocos2d : : Vector2 ret = cobj - > convertTouchToNodeSpace ( arg0 ) ; <nl> + vector2_to_luaval ( tolua_S , ret ) ; <nl> + return 1 ; <nl> + } <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " convertTouchToNodeSpace " , argc , 1 ) ; <nl> + return 0 ; <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + tolua_lerror : <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_convertTouchToNodeSpace ' . " , & tolua_err ) ; <nl> + # endif <nl> + <nl> + return 0 ; <nl> + } <nl> + int lua_cocos2dx_Node_removeAllChildrenWithCleanup ( lua_State * tolua_S ) <nl> + { <nl> + int argc = 0 ; <nl> + cocos2d : : Node * cobj = nullptr ; <nl> + bool ok = true ; <nl> + # if COCOS2D_DEBUG > = 1 <nl> + tolua_Error tolua_err ; <nl> + # endif <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + # endif <nl> + cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + # if COCOS2D_DEBUG > = 1 <nl> + if ( ! cobj ) <nl> + { <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_removeAllChildrenWithCleanup ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " pause " , argc , 0 ) ; <nl> + # endif <nl> + argc = lua_gettop ( tolua_S ) - 1 ; <nl> + do { <nl> + if ( argc = = 1 ) { <nl> + bool arg0 ; <nl> + ok & = luaval_to_boolean ( tolua_S , 2 , & arg0 ) ; <nl> + <nl> + if ( ! ok ) { break ; } <nl> + cobj - > removeAllChildrenWithCleanup ( arg0 ) ; <nl> + return 0 ; <nl> + } <nl> + } while ( 0 ) ; <nl> + ok = true ; <nl> + do { <nl> + if ( argc = = 0 ) { <nl> + cobj - > removeAllChildren ( ) ; <nl> + return 0 ; <nl> + } <nl> + } while ( 0 ) ; <nl> + ok = true ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " removeAllChildren " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_pause ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_removeAllChildrenWithCleanup ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_convertToWorldSpaceAR ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getNodeToParentAffineTransform ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_convertToWorldSpaceAR ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_convertToWorldSpaceAR ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getNodeToParentAffineTransform ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 1 ) <nl> + if ( argc = = 0 ) <nl> { <nl> - cocos2d : : Vector2 arg0 ; <nl> - <nl> - ok & = luaval_to_vector2 ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cocos2d : : Vector2 ret = cobj - > convertToWorldSpaceAR ( arg0 ) ; <nl> - vector2_to_luaval ( tolua_S , ret ) ; <nl> + cocos2d : : AffineTransform ret = cobj - > getNodeToParentAffineTransform ( ) ; <nl> + affinetransform_to_luaval ( tolua_S , ret ) ; <nl> return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " convertToWorldSpaceAR " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getNodeToParentAffineTransform " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_convertToWorldSpaceAR ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getNodeToParentAffineTransform ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_isIgnoreAnchorPointForPosition ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_isCascadeOpacityEnabled ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_isIgnoreAnchorPointForPosition ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_isIgnoreAnchorPointForPosition ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_isCascadeOpacityEnabled ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node_isIgnoreAnchorPointForPosition ( lua_State * tolua_S ) <nl> { <nl> if ( ! ok ) <nl> return 0 ; <nl> - bool ret = cobj - > isIgnoreAnchorPointForPosition ( ) ; <nl> + bool ret = cobj - > isCascadeOpacityEnabled ( ) ; <nl> tolua_pushboolean ( tolua_S , ( bool ) ret ) ; <nl> return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " isIgnoreAnchorPointForPosition " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " isCascadeOpacityEnabled " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_isIgnoreAnchorPointForPosition ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_isCascadeOpacityEnabled ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_updateDisplayedOpacity ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_setParent ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_updateDisplayedOpacity ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_updateDisplayedOpacity ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setParent ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node_updateDisplayedOpacity ( lua_State * tolua_S ) <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> if ( argc = = 1 ) <nl> { <nl> - uint16_t arg0 ; <nl> + cocos2d : : Node * arg0 ; <nl> <nl> - ok & = luaval_to_uint16 ( tolua_S , 2 , & arg0 ) ; <nl> + ok & = luaval_to_object < cocos2d : : Node > ( tolua_S , 2 , " cc . Node " , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > updateDisplayedOpacity ( arg0 ) ; <nl> + cobj - > setParent ( arg0 ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " updateDisplayedOpacity " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setParent " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_updateDisplayedOpacity ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setParent ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_setRotation ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getRotation3D ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_setRotation ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setRotation ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getRotation3D ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 1 ) <nl> + if ( argc = = 0 ) <nl> { <nl> - double arg0 ; <nl> - <nl> - ok & = luaval_to_number ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > setRotation ( arg0 ) ; <nl> - return 0 ; <nl> + cocos2d : : Vector3 ret = cobj - > getRotation3D ( ) ; <nl> + vector3_to_luaval ( tolua_S , ret ) ; <nl> + return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setRotation " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getRotation3D " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setRotation ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getRotation3D ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_setScaleZ ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getNodeToParentTransform ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_setScaleZ ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setScaleZ ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getNodeToParentTransform ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 1 ) <nl> + if ( argc = = 0 ) <nl> { <nl> - double arg0 ; <nl> - <nl> - ok & = luaval_to_number ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > setScaleZ ( arg0 ) ; <nl> - return 0 ; <nl> + const cocos2d : : Matrix & ret = cobj - > getNodeToParentTransform ( ) ; <nl> + matrix_to_luaval ( tolua_S , ret ) ; <nl> + return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setScaleZ " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getNodeToParentTransform " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setScaleZ ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getNodeToParentTransform ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_setScaleY ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_convertTouchToNodeSpaceAR ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_setScaleY ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setScaleY ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_convertTouchToNodeSpaceAR ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node_setScaleY ( lua_State * tolua_S ) <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> if ( argc = = 1 ) <nl> { <nl> - double arg0 ; <nl> + cocos2d : : Touch * arg0 ; <nl> <nl> - ok & = luaval_to_number ( tolua_S , 2 , & arg0 ) ; <nl> + ok & = luaval_to_object < cocos2d : : Touch > ( tolua_S , 2 , " cc . Touch " , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > setScaleY ( arg0 ) ; <nl> - return 0 ; <nl> + cocos2d : : Vector2 ret = cobj - > convertTouchToNodeSpaceAR ( arg0 ) ; <nl> + vector2_to_luaval ( tolua_S , ret ) ; <nl> + return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setScaleY " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " convertTouchToNodeSpaceAR " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setScaleY ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_convertTouchToNodeSpaceAR ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_setScaleX ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_convertToNodeSpace ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_setScaleX ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setScaleX ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_convertToNodeSpace ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node_setScaleX ( lua_State * tolua_S ) <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> if ( argc = = 1 ) <nl> { <nl> - double arg0 ; <nl> + cocos2d : : Vector2 arg0 ; <nl> <nl> - ok & = luaval_to_number ( tolua_S , 2 , & arg0 ) ; <nl> + ok & = luaval_to_vector2 ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > setScaleX ( arg0 ) ; <nl> - return 0 ; <nl> + cocos2d : : Vector2 ret = cobj - > convertToNodeSpace ( arg0 ) ; <nl> + vector2_to_luaval ( tolua_S , ret ) ; <nl> + return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setScaleX " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " convertToNodeSpace " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setScaleX ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_convertToNodeSpace ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_setRotationSkewX ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_resume ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_setRotationSkewX ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setRotationSkewX ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_resume ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 1 ) <nl> + if ( argc = = 0 ) <nl> { <nl> - double arg0 ; <nl> - <nl> - ok & = luaval_to_number ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > setRotationSkewX ( arg0 ) ; <nl> + cobj - > resume ( ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setRotationSkewX " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " resume " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setRotationSkewX ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_resume ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_removeAllComponents ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getPhysicsBody ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_removeAllComponents ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_removeAllComponents ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getPhysicsBody ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node_removeAllComponents ( lua_State * tolua_S ) <nl> { <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > removeAllComponents ( ) ; <nl> + cocos2d : : PhysicsBody * ret = cobj - > getPhysicsBody ( ) ; <nl> + object_to_luaval < cocos2d : : PhysicsBody > ( tolua_S , " cc . PhysicsBody " , ( cocos2d : : PhysicsBody * ) ret ) ; <nl> + return 1 ; <nl> + } <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getPhysicsBody " , argc , 0 ) ; <nl> + return 0 ; <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + tolua_lerror : <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getPhysicsBody ' . " , & tolua_err ) ; <nl> + # endif <nl> + <nl> + return 0 ; <nl> + } <nl> + int lua_cocos2dx_Node_setPosition ( lua_State * tolua_S ) <nl> + { <nl> + int argc = 0 ; <nl> + cocos2d : : Node * cobj = nullptr ; <nl> + bool ok = true ; <nl> + # if COCOS2D_DEBUG > = 1 <nl> + tolua_Error tolua_err ; <nl> + # endif <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + # endif <nl> + cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + # if COCOS2D_DEBUG > = 1 <nl> + if ( ! cobj ) <nl> + { <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setPosition ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " removeAllComponents " , argc , 0 ) ; <nl> + # endif <nl> + argc = lua_gettop ( tolua_S ) - 1 ; <nl> + do { <nl> + if ( argc = = 2 ) { <nl> + double arg0 ; <nl> + ok & = luaval_to_number ( tolua_S , 2 , & arg0 ) ; <nl> + <nl> + if ( ! ok ) { break ; } <nl> + double arg1 ; <nl> + ok & = luaval_to_number ( tolua_S , 3 , & arg1 ) ; <nl> + <nl> + if ( ! ok ) { break ; } <nl> + cobj - > setPosition ( arg0 , arg1 ) ; <nl> + return 0 ; <nl> + } <nl> + } while ( 0 ) ; <nl> + ok = true ; <nl> + do { <nl> + if ( argc = = 1 ) { <nl> + cocos2d : : Vector2 arg0 ; <nl> + ok & = luaval_to_vector2 ( tolua_S , 2 , & arg0 ) ; <nl> + <nl> + if ( ! ok ) { break ; } <nl> + cobj - > setPosition ( arg0 ) ; <nl> + return 0 ; <nl> + } <nl> + } while ( 0 ) ; <nl> + ok = true ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setPosition " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_removeAllComponents ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setPosition ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node__setLocalZOrder ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_stopActionByTag ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node__setLocalZOrder ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node__setLocalZOrder ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_stopActionByTag ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node__setLocalZOrder ( lua_State * tolua_S ) <nl> ok & = luaval_to_int32 ( tolua_S , 2 , ( int * ) & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > _setLocalZOrder ( arg0 ) ; <nl> + cobj - > stopActionByTag ( arg0 ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " _setLocalZOrder " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " stopActionByTag " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node__setLocalZOrder ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_stopActionByTag ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getTag ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_reorderChild ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_getTag ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getTag ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_reorderChild ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 0 ) <nl> + if ( argc = = 2 ) <nl> { <nl> + cocos2d : : Node * arg0 ; <nl> + int arg1 ; <nl> + <nl> + ok & = luaval_to_object < cocos2d : : Node > ( tolua_S , 2 , " cc . Node " , & arg0 ) ; <nl> + <nl> + ok & = luaval_to_int32 ( tolua_S , 3 , ( int * ) & arg1 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - int ret = cobj - > getTag ( ) ; <nl> - tolua_pushnumber ( tolua_S , ( lua_Number ) ret ) ; <nl> - return 1 ; <nl> + cobj - > reorderChild ( arg0 , arg1 ) ; <nl> + return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getTag " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " reorderChild " , argc , 2 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getTag ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_reorderChild ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getNodeToWorldAffineTransform ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_ignoreAnchorPointForPosition ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_getNodeToWorldAffineTransform ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getNodeToWorldAffineTransform ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_ignoreAnchorPointForPosition ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 0 ) <nl> + if ( argc = = 1 ) <nl> { <nl> + bool arg0 ; <nl> + <nl> + ok & = luaval_to_boolean ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cocos2d : : AffineTransform ret = cobj - > getNodeToWorldAffineTransform ( ) ; <nl> - affinetransform_to_luaval ( tolua_S , ret ) ; <nl> - return 1 ; <nl> + cobj - > ignoreAnchorPointForPosition ( arg0 ) ; <nl> + return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getNodeToWorldAffineTransform " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " ignoreAnchorPointForPosition " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getNodeToWorldAffineTransform ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_ignoreAnchorPointForPosition ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getNodeToWorldTransform ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_setSkewY ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_getNodeToWorldTransform ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getNodeToWorldTransform ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setSkewY ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 0 ) <nl> + if ( argc = = 1 ) <nl> { <nl> + double arg0 ; <nl> + <nl> + ok & = luaval_to_number ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cocos2d : : Matrix ret = cobj - > getNodeToWorldTransform ( ) ; <nl> - matrix_to_luaval ( tolua_S , ret ) ; <nl> - return 1 ; <nl> + cobj - > setSkewY ( arg0 ) ; <nl> + return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getNodeToWorldTransform " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setSkewY " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getNodeToWorldTransform ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setSkewY ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getPosition3D ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_setPositionZ ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_getPosition3D ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getPosition3D ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setPositionZ ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 0 ) <nl> + if ( argc = = 1 ) <nl> { <nl> + double arg0 ; <nl> + <nl> + ok & = luaval_to_number ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cocos2d : : Vector3 ret = cobj - > getPosition3D ( ) ; <nl> - vector3_to_luaval ( tolua_S , ret ) ; <nl> - return 1 ; <nl> + cobj - > setPositionZ ( arg0 ) ; <nl> + return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getPosition3D " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setPositionZ " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getPosition3D ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setPositionZ ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_removeChild ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_setRotation3D ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_removeChild ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_removeChild ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setRotation3D ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node_removeChild ( lua_State * tolua_S ) <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> if ( argc = = 1 ) <nl> { <nl> - cocos2d : : Node * arg0 ; <nl> - <nl> - ok & = luaval_to_object < cocos2d : : Node > ( tolua_S , 2 , " cc . Node " , & arg0 ) ; <nl> - if ( ! ok ) <nl> - return 0 ; <nl> - cobj - > removeChild ( arg0 ) ; <nl> - return 0 ; <nl> - } <nl> - if ( argc = = 2 ) <nl> - { <nl> - cocos2d : : Node * arg0 ; <nl> - bool arg1 ; <nl> - <nl> - ok & = luaval_to_object < cocos2d : : Node > ( tolua_S , 2 , " cc . Node " , & arg0 ) ; <nl> + cocos2d : : Vector3 arg0 ; <nl> <nl> - ok & = luaval_to_boolean ( tolua_S , 3 , & arg1 ) ; <nl> + ok & = luaval_to_vector3 ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > removeChild ( arg0 , arg1 ) ; <nl> + cobj - > setRotation3D ( arg0 ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " removeChild " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setRotation3D " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_removeChild ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setRotation3D ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_convertToWorldSpace ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_setPositionX ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_convertToWorldSpace ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_convertToWorldSpace ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setPositionX ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node_convertToWorldSpace ( lua_State * tolua_S ) <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> if ( argc = = 1 ) <nl> { <nl> - cocos2d : : Vector2 arg0 ; <nl> + double arg0 ; <nl> <nl> - ok & = luaval_to_vector2 ( tolua_S , 2 , & arg0 ) ; <nl> + ok & = luaval_to_number ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cocos2d : : Vector2 ret = cobj - > convertToWorldSpace ( arg0 ) ; <nl> - vector2_to_luaval ( tolua_S , ret ) ; <nl> - return 1 ; <nl> + cobj - > setPositionX ( arg0 ) ; <nl> + return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " convertToWorldSpace " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setPositionX " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_convertToWorldSpace ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setPositionX ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getScene ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_setNodeToParentTransform ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_getScene ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getScene ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setNodeToParentTransform ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 0 ) <nl> + if ( argc = = 1 ) <nl> { <nl> + cocos2d : : Matrix arg0 ; <nl> + <nl> + ok & = luaval_to_matrix ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cocos2d : : Scene * ret = cobj - > getScene ( ) ; <nl> - object_to_luaval < cocos2d : : Scene > ( tolua_S , " cc . Scene " , ( cocos2d : : Scene * ) ret ) ; <nl> - return 1 ; <nl> + cobj - > setNodeToParentTransform ( arg0 ) ; <nl> + return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getScene " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setNodeToParentTransform " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getScene ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setNodeToParentTransform ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getEventDispatcher ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getAnchorPoint ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_getEventDispatcher ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getEventDispatcher ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getAnchorPoint ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node_getEventDispatcher ( lua_State * tolua_S ) <nl> { <nl> if ( ! ok ) <nl> return 0 ; <nl> - cocos2d : : EventDispatcher * ret = cobj - > getEventDispatcher ( ) ; <nl> - object_to_luaval < cocos2d : : EventDispatcher > ( tolua_S , " cc . EventDispatcher " , ( cocos2d : : EventDispatcher * ) ret ) ; <nl> + const cocos2d : : Vector2 & ret = cobj - > getAnchorPoint ( ) ; <nl> + vector2_to_luaval ( tolua_S , ret ) ; <nl> return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getEventDispatcher " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getAnchorPoint " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getEventDispatcher ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getAnchorPoint ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_setSkewX ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getNumberOfRunningActions ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_setSkewX ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setSkewX ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getNumberOfRunningActions ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 1 ) <nl> + if ( argc = = 0 ) <nl> { <nl> - double arg0 ; <nl> - <nl> - ok & = luaval_to_number ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > setSkewX ( arg0 ) ; <nl> - return 0 ; <nl> + ssize_t ret = cobj - > getNumberOfRunningActions ( ) ; <nl> + tolua_pushnumber ( tolua_S , ( lua_Number ) ret ) ; <nl> + return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setSkewX " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getNumberOfRunningActions " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setSkewX ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getNumberOfRunningActions ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_setSkewY ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_updateTransform ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_setSkewY ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setSkewY ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_updateTransform ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 1 ) <nl> + if ( argc = = 0 ) <nl> { <nl> - double arg0 ; <nl> - <nl> - ok & = luaval_to_number ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > setSkewY ( arg0 ) ; <nl> + cobj - > updateTransform ( ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setSkewY " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " updateTransform " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setSkewY ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_updateTransform ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getOpacity ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_isVisible ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_getOpacity ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getOpacity ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_isVisible ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node_getOpacity ( lua_State * tolua_S ) <nl> { <nl> if ( ! ok ) <nl> return 0 ; <nl> - uint16_t ret = cobj - > getOpacity ( ) ; <nl> - tolua_pushnumber ( tolua_S , ( lua_Number ) ret ) ; <nl> + bool ret = cobj - > isVisible ( ) ; <nl> + tolua_pushboolean ( tolua_S , ( bool ) ret ) ; <nl> return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getOpacity " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " isVisible " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getOpacity ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_isVisible ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_convertTouchToNodeSpace ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getChildrenCount ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_convertTouchToNodeSpace ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_convertTouchToNodeSpace ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getChildrenCount ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 1 ) <nl> + if ( argc = = 0 ) <nl> { <nl> - cocos2d : : Touch * arg0 ; <nl> - <nl> - ok & = luaval_to_object < cocos2d : : Touch > ( tolua_S , 2 , " cc . Touch " , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cocos2d : : Vector2 ret = cobj - > convertTouchToNodeSpace ( arg0 ) ; <nl> - vector2_to_luaval ( tolua_S , ret ) ; <nl> + ssize_t ret = cobj - > getChildrenCount ( ) ; <nl> + tolua_pushnumber ( tolua_S , ( lua_Number ) ret ) ; <nl> return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " convertTouchToNodeSpace " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getChildrenCount " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_convertTouchToNodeSpace ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getChildrenCount ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_removeAllChildrenWithCleanup ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_convertToNodeSpaceAR ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> bool ok = true ; <nl> + <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_Error tolua_err ; <nl> # endif <nl> <nl> + <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> + <nl> cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! cobj ) <nl> + if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_removeAllChildrenWithCleanup ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_convertToNodeSpaceAR ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> + <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - do { <nl> - if ( argc = = 1 ) { <nl> - bool arg0 ; <nl> - ok & = luaval_to_boolean ( tolua_S , 2 , & arg0 ) ; <nl> + if ( argc = = 1 ) <nl> + { <nl> + cocos2d : : Vector2 arg0 ; <nl> <nl> - if ( ! ok ) { break ; } <nl> - cobj - > removeAllChildrenWithCleanup ( arg0 ) ; <nl> - return 0 ; <nl> - } <nl> - } while ( 0 ) ; <nl> - ok = true ; <nl> - do { <nl> - if ( argc = = 0 ) { <nl> - cobj - > removeAllChildren ( ) ; <nl> + ok & = luaval_to_vector2 ( tolua_S , 2 , & arg0 ) ; <nl> + if ( ! ok ) <nl> return 0 ; <nl> - } <nl> - } while ( 0 ) ; <nl> - ok = true ; <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " removeAllChildren " , argc , 0 ) ; <nl> + cocos2d : : Vector2 ret = cobj - > convertToNodeSpaceAR ( arg0 ) ; <nl> + vector2_to_luaval ( tolua_S , ret ) ; <nl> + return 1 ; <nl> + } <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " convertToNodeSpaceAR " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_removeAllChildrenWithCleanup ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_convertToNodeSpaceAR ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getNodeToParentAffineTransform ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_addComponent ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_getNodeToParentAffineTransform ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getNodeToParentAffineTransform ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_addComponent ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 0 ) <nl> + if ( argc = = 1 ) <nl> { <nl> + cocos2d : : Component * arg0 ; <nl> + <nl> + ok & = luaval_to_object < cocos2d : : Component > ( tolua_S , 2 , " cc . Component " , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cocos2d : : AffineTransform ret = cobj - > getNodeToParentAffineTransform ( ) ; <nl> - affinetransform_to_luaval ( tolua_S , ret ) ; <nl> + bool ret = cobj - > addComponent ( arg0 ) ; <nl> + tolua_pushboolean ( tolua_S , ( bool ) ret ) ; <nl> return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getNodeToParentAffineTransform " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " addComponent " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getNodeToParentAffineTransform ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_addComponent ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_isCascadeOpacityEnabled ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_isOpacityModifyRGB ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_isCascadeOpacityEnabled ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_isCascadeOpacityEnabled ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_isOpacityModifyRGB ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node_isCascadeOpacityEnabled ( lua_State * tolua_S ) <nl> { <nl> if ( ! ok ) <nl> return 0 ; <nl> - bool ret = cobj - > isCascadeOpacityEnabled ( ) ; <nl> + bool ret = cobj - > isOpacityModifyRGB ( ) ; <nl> tolua_pushboolean ( tolua_S , ( bool ) ret ) ; <nl> return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " isCascadeOpacityEnabled " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " isOpacityModifyRGB " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_isCascadeOpacityEnabled ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_isOpacityModifyRGB ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_setParent ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getRotation ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_setParent ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setParent ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getRotation ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 1 ) <nl> + if ( argc = = 0 ) <nl> { <nl> - cocos2d : : Node * arg0 ; <nl> - <nl> - ok & = luaval_to_object < cocos2d : : Node > ( tolua_S , 2 , " cc . Node " , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > setParent ( arg0 ) ; <nl> - return 0 ; <nl> + double ret = cobj - > getRotation ( ) ; <nl> + tolua_pushnumber ( tolua_S , ( lua_Number ) ret ) ; <nl> + return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setParent " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getRotation " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setParent ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getRotation ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getRotation3D ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getAnchorPointInPoints ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_getRotation3D ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getRotation3D ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getAnchorPointInPoints ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node_getRotation3D ( lua_State * tolua_S ) <nl> { <nl> if ( ! ok ) <nl> return 0 ; <nl> - cocos2d : : Vector3 ret = cobj - > getRotation3D ( ) ; <nl> - vector3_to_luaval ( tolua_S , ret ) ; <nl> + const cocos2d : : Vector2 & ret = cobj - > getAnchorPointInPoints ( ) ; <nl> + vector2_to_luaval ( tolua_S , ret ) ; <nl> return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getRotation3D " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getAnchorPointInPoints " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getRotation3D ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getAnchorPointInPoints ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getNodeToParentTransform ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_runAction ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_getNodeToParentTransform ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getNodeToParentTransform ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_runAction ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 0 ) <nl> + if ( argc = = 1 ) <nl> { <nl> + cocos2d : : Action * arg0 ; <nl> + <nl> + ok & = luaval_to_object < cocos2d : : Action > ( tolua_S , 2 , " cc . Action " , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - const cocos2d : : Matrix & ret = cobj - > getNodeToParentTransform ( ) ; <nl> - matrix_to_luaval ( tolua_S , ret ) ; <nl> + cocos2d : : Action * ret = cobj - > runAction ( arg0 ) ; <nl> + object_to_luaval < cocos2d : : Action > ( tolua_S , " cc . Action " , ( cocos2d : : Action * ) ret ) ; <nl> return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getNodeToParentTransform " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " runAction " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getNodeToParentTransform ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_runAction ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_convertTouchToNodeSpaceAR ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getGLProgramState ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_convertTouchToNodeSpaceAR ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_convertTouchToNodeSpaceAR ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getGLProgramState ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 1 ) <nl> + if ( argc = = 0 ) <nl> { <nl> - cocos2d : : Touch * arg0 ; <nl> - <nl> - ok & = luaval_to_object < cocos2d : : Touch > ( tolua_S , 2 , " cc . Touch " , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cocos2d : : Vector2 ret = cobj - > convertTouchToNodeSpaceAR ( arg0 ) ; <nl> - vector2_to_luaval ( tolua_S , ret ) ; <nl> + cocos2d : : GLProgramState * ret = cobj - > getGLProgramState ( ) ; <nl> + object_to_luaval < cocos2d : : GLProgramState > ( tolua_S , " cc . GLProgramState " , ( cocos2d : : GLProgramState * ) ret ) ; <nl> return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " convertTouchToNodeSpaceAR " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getGLProgramState " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_convertTouchToNodeSpaceAR ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getGLProgramState ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_convertToNodeSpace ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_setScheduler ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_convertToNodeSpace ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_convertToNodeSpace ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setScheduler ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node_convertToNodeSpace ( lua_State * tolua_S ) <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> if ( argc = = 1 ) <nl> { <nl> - cocos2d : : Vector2 arg0 ; <nl> + cocos2d : : Scheduler * arg0 ; <nl> <nl> - ok & = luaval_to_vector2 ( tolua_S , 2 , & arg0 ) ; <nl> + ok & = luaval_to_object < cocos2d : : Scheduler > ( tolua_S , 2 , " cc . Scheduler " , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cocos2d : : Vector2 ret = cobj - > convertToNodeSpace ( arg0 ) ; <nl> - vector2_to_luaval ( tolua_S , ret ) ; <nl> - return 1 ; <nl> + cobj - > setScheduler ( arg0 ) ; <nl> + return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " convertToNodeSpace " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setScheduler " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_convertToNodeSpace ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setScheduler ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_resume ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_stopAllActions ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_resume ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_resume ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_stopAllActions ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node_resume ( lua_State * tolua_S ) <nl> { <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > resume ( ) ; <nl> + cobj - > stopAllActions ( ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " resume " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " stopAllActions " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_resume ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_stopAllActions ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getPhysicsBody ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getSkewX ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_getPhysicsBody ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getPhysicsBody ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getSkewX ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node_getPhysicsBody ( lua_State * tolua_S ) <nl> { <nl> if ( ! ok ) <nl> return 0 ; <nl> - cocos2d : : PhysicsBody * ret = cobj - > getPhysicsBody ( ) ; <nl> - object_to_luaval < cocos2d : : PhysicsBody > ( tolua_S , " cc . PhysicsBody " , ( cocos2d : : PhysicsBody * ) ret ) ; <nl> + double ret = cobj - > getSkewX ( ) ; <nl> + tolua_pushnumber ( tolua_S , ( lua_Number ) ret ) ; <nl> return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getPhysicsBody " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getSkewX " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getPhysicsBody ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getSkewX ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_setPosition ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getSkewY ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> bool ok = true ; <nl> + <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_Error tolua_err ; <nl> # endif <nl> <nl> + <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> + <nl> cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! cobj ) <nl> + if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setPosition ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getSkewY ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> - argc = lua_gettop ( tolua_S ) - 1 ; <nl> - do { <nl> - if ( argc = = 2 ) { <nl> - double arg0 ; <nl> - ok & = luaval_to_number ( tolua_S , 2 , & arg0 ) ; <nl> - <nl> - if ( ! ok ) { break ; } <nl> - double arg1 ; <nl> - ok & = luaval_to_number ( tolua_S , 3 , & arg1 ) ; <nl> - <nl> - if ( ! ok ) { break ; } <nl> - cobj - > setPosition ( arg0 , arg1 ) ; <nl> - return 0 ; <nl> - } <nl> - } while ( 0 ) ; <nl> - ok = true ; <nl> - do { <nl> - if ( argc = = 1 ) { <nl> - cocos2d : : Vector2 arg0 ; <nl> - ok & = luaval_to_vector2 ( tolua_S , 2 , & arg0 ) ; <nl> <nl> - if ( ! ok ) { break ; } <nl> - cobj - > setPosition ( arg0 ) ; <nl> + argc = lua_gettop ( tolua_S ) - 1 ; <nl> + if ( argc = = 0 ) <nl> + { <nl> + if ( ! ok ) <nl> return 0 ; <nl> - } <nl> - } while ( 0 ) ; <nl> - ok = true ; <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setPosition " , argc , 1 ) ; <nl> + double ret = cobj - > getSkewY ( ) ; <nl> + tolua_pushnumber ( tolua_S , ( lua_Number ) ret ) ; <nl> + return 1 ; <nl> + } <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getSkewY " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setPosition ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getSkewY ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_stopActionByTag ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getDisplayedColor ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_stopActionByTag ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_stopActionByTag ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getDisplayedColor ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 1 ) <nl> + if ( argc = = 0 ) <nl> { <nl> - int arg0 ; <nl> - <nl> - ok & = luaval_to_int32 ( tolua_S , 2 , ( int * ) & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > stopActionByTag ( arg0 ) ; <nl> - return 0 ; <nl> + const cocos2d : : Color3B & ret = cobj - > getDisplayedColor ( ) ; <nl> + color3b_to_luaval ( tolua_S , ret ) ; <nl> + return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " stopActionByTag " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getDisplayedColor " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_stopActionByTag ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getDisplayedColor ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_reorderChild ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getActionByTag ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_reorderChild ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_reorderChild ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getActionByTag ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 2 ) <nl> + if ( argc = = 1 ) <nl> { <nl> - cocos2d : : Node * arg0 ; <nl> - int arg1 ; <nl> - <nl> - ok & = luaval_to_object < cocos2d : : Node > ( tolua_S , 2 , " cc . Node " , & arg0 ) ; <nl> + int arg0 ; <nl> <nl> - ok & = luaval_to_int32 ( tolua_S , 3 , ( int * ) & arg1 ) ; <nl> + ok & = luaval_to_int32 ( tolua_S , 2 , ( int * ) & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > reorderChild ( arg0 , arg1 ) ; <nl> - return 0 ; <nl> + cocos2d : : Action * ret = cobj - > getActionByTag ( arg0 ) ; <nl> + object_to_luaval < cocos2d : : Action > ( tolua_S , " cc . Action " , ( cocos2d : : Action * ) ret ) ; <nl> + return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " reorderChild " , argc , 2 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getActionByTag " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_reorderChild ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getActionByTag ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_ignoreAnchorPointForPosition ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_setAdditionalTransform ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> bool ok = true ; <nl> - <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_Error tolua_err ; <nl> # endif <nl> <nl> - <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> - <nl> cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> - <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! cobj ) <nl> + if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_ignoreAnchorPointForPosition ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setAdditionalTransform ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> - <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 1 ) <nl> - { <nl> - bool arg0 ; <nl> + do { <nl> + if ( argc = = 1 ) { <nl> + cocos2d : : AffineTransform arg0 ; <nl> + ok & = luaval_to_affinetransform ( tolua_S , 2 , & arg0 ) ; <nl> <nl> - ok & = luaval_to_boolean ( tolua_S , 2 , & arg0 ) ; <nl> - if ( ! ok ) <nl> + if ( ! ok ) { break ; } <nl> + cobj - > setAdditionalTransform ( arg0 ) ; <nl> return 0 ; <nl> - cobj - > ignoreAnchorPointForPosition ( arg0 ) ; <nl> - return 0 ; <nl> - } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " ignoreAnchorPointForPosition " , argc , 1 ) ; <nl> + } <nl> + } while ( 0 ) ; <nl> + ok = true ; <nl> + do { <nl> + if ( argc = = 1 ) { <nl> + cocos2d : : Matrix * arg0 ; <nl> + ok & = luaval_to_object < cocos2d : : Matrix > ( tolua_S , 2 , " cc . Matrix " , & arg0 ) ; <nl> + <nl> + if ( ! ok ) { break ; } <nl> + cobj - > setAdditionalTransform ( arg0 ) ; <nl> + return 0 ; <nl> + } <nl> + } while ( 0 ) ; <nl> + ok = true ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setAdditionalTransform " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_ignoreAnchorPointForPosition ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setAdditionalTransform ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_setPositionZ ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getDisplayedOpacity ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_setPositionZ ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setPositionZ ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getDisplayedOpacity ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 1 ) <nl> + if ( argc = = 0 ) <nl> { <nl> - double arg0 ; <nl> - <nl> - ok & = luaval_to_number ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > setPositionZ ( arg0 ) ; <nl> - return 0 ; <nl> + uint16_t ret = cobj - > getDisplayedOpacity ( ) ; <nl> + tolua_pushnumber ( tolua_S , ( lua_Number ) ret ) ; <nl> + return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setPositionZ " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getDisplayedOpacity " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setPositionZ ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getDisplayedOpacity ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_setRotation3D ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getLocalZOrder ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_setRotation3D ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setRotation3D ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getLocalZOrder ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 1 ) <nl> + if ( argc = = 0 ) <nl> { <nl> - cocos2d : : Vector3 arg0 ; <nl> - <nl> - ok & = luaval_to_vector3 ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > setRotation3D ( arg0 ) ; <nl> - return 0 ; <nl> + int ret = cobj - > getLocalZOrder ( ) ; <nl> + tolua_pushnumber ( tolua_S , ( lua_Number ) ret ) ; <nl> + return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setRotation3D " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getLocalZOrder " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setRotation3D ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getLocalZOrder ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_setPositionX ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getScheduler ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> bool ok = true ; <nl> - <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_Error tolua_err ; <nl> # endif <nl> <nl> - <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> - <nl> cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> - <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! cobj ) <nl> + if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setPositionX ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getScheduler ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> - <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 1 ) <nl> - { <nl> - double arg0 ; <nl> - <nl> - ok & = luaval_to_number ( tolua_S , 2 , & arg0 ) ; <nl> - if ( ! ok ) <nl> - return 0 ; <nl> - cobj - > setPositionX ( arg0 ) ; <nl> - return 0 ; <nl> - } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setPositionX " , argc , 1 ) ; <nl> + do { <nl> + if ( argc = = 0 ) { <nl> + const cocos2d : : Scheduler * ret = cobj - > getScheduler ( ) ; <nl> + object_to_luaval < cocos2d : : Scheduler > ( tolua_S , " cc . Scheduler " , ( cocos2d : : Scheduler * ) ret ) ; <nl> + return 1 ; <nl> + } <nl> + } while ( 0 ) ; <nl> + ok = true ; <nl> + do { <nl> + if ( argc = = 0 ) { <nl> + cocos2d : : Scheduler * ret = cobj - > getScheduler ( ) ; <nl> + object_to_luaval < cocos2d : : Scheduler > ( tolua_S , " cc . Scheduler " , ( cocos2d : : Scheduler * ) ret ) ; <nl> + return 1 ; <nl> + } <nl> + } while ( 0 ) ; <nl> + ok = true ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getScheduler " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setPositionX ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getScheduler ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_setNodeToParentTransform ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getParentToNodeAffineTransform ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_setNodeToParentTransform ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setNodeToParentTransform ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getParentToNodeAffineTransform ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 1 ) <nl> + if ( argc = = 0 ) <nl> { <nl> - cocos2d : : Matrix arg0 ; <nl> - <nl> - ok & = luaval_to_matrix ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > setNodeToParentTransform ( arg0 ) ; <nl> - return 0 ; <nl> + cocos2d : : AffineTransform ret = cobj - > getParentToNodeAffineTransform ( ) ; <nl> + affinetransform_to_luaval ( tolua_S , ret ) ; <nl> + return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setNodeToParentTransform " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getParentToNodeAffineTransform " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setNodeToParentTransform ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getParentToNodeAffineTransform ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getAnchorPoint ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getOrderOfArrival ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_getAnchorPoint ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getAnchorPoint ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getOrderOfArrival ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node_getAnchorPoint ( lua_State * tolua_S ) <nl> { <nl> if ( ! ok ) <nl> return 0 ; <nl> - const cocos2d : : Vector2 & ret = cobj - > getAnchorPoint ( ) ; <nl> - vector2_to_luaval ( tolua_S , ret ) ; <nl> + int ret = cobj - > getOrderOfArrival ( ) ; <nl> + tolua_pushnumber ( tolua_S , ( lua_Number ) ret ) ; <nl> return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getAnchorPoint " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getOrderOfArrival " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getAnchorPoint ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getOrderOfArrival ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getNumberOfRunningActions ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_setActionManager ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_getNumberOfRunningActions ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getNumberOfRunningActions ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setActionManager ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 0 ) <nl> + if ( argc = = 1 ) <nl> { <nl> + cocos2d : : ActionManager * arg0 ; <nl> + <nl> + ok & = luaval_to_object < cocos2d : : ActionManager > ( tolua_S , 2 , " cc . ActionManager " , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - ssize_t ret = cobj - > getNumberOfRunningActions ( ) ; <nl> - tolua_pushnumber ( tolua_S , ( lua_Number ) ret ) ; <nl> - return 1 ; <nl> + cobj - > setActionManager ( arg0 ) ; <nl> + return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getNumberOfRunningActions " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setActionManager " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getNumberOfRunningActions ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setActionManager ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_updateTransform ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_setColor ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_updateTransform ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_updateTransform ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setColor ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 0 ) <nl> + if ( argc = = 1 ) <nl> { <nl> + cocos2d : : Color3B arg0 ; <nl> + <nl> + ok & = luaval_to_color3b ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > updateTransform ( ) ; <nl> + cobj - > setColor ( arg0 ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " updateTransform " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setColor " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_updateTransform ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setColor ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_isVisible ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_isRunning ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_isVisible ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_isVisible ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_isRunning ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node_isVisible ( lua_State * tolua_S ) <nl> { <nl> if ( ! ok ) <nl> return 0 ; <nl> - bool ret = cobj - > isVisible ( ) ; <nl> + bool ret = cobj - > isRunning ( ) ; <nl> tolua_pushboolean ( tolua_S , ( bool ) ret ) ; <nl> return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " isVisible " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " isRunning " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_isVisible ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_isRunning ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getChildrenCount ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getParent ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> bool ok = true ; <nl> - <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_Error tolua_err ; <nl> # endif <nl> <nl> - <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> - <nl> cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> - <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! cobj ) <nl> + if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getChildrenCount ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getParent ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> - <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 0 ) <nl> - { <nl> - if ( ! ok ) <nl> - return 0 ; <nl> - ssize_t ret = cobj - > getChildrenCount ( ) ; <nl> - tolua_pushnumber ( tolua_S , ( lua_Number ) ret ) ; <nl> - return 1 ; <nl> - } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getChildrenCount " , argc , 0 ) ; <nl> + do { <nl> + if ( argc = = 0 ) { <nl> + const cocos2d : : Node * ret = cobj - > getParent ( ) ; <nl> + object_to_luaval < cocos2d : : Node > ( tolua_S , " cc . Node " , ( cocos2d : : Node * ) ret ) ; <nl> + return 1 ; <nl> + } <nl> + } while ( 0 ) ; <nl> + ok = true ; <nl> + do { <nl> + if ( argc = = 0 ) { <nl> + cocos2d : : Node * ret = cobj - > getParent ( ) ; <nl> + object_to_luaval < cocos2d : : Node > ( tolua_S , " cc . Node " , ( cocos2d : : Node * ) ret ) ; <nl> + return 1 ; <nl> + } <nl> + } while ( 0 ) ; <nl> + ok = true ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getParent " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getChildrenCount ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getParent ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_convertToNodeSpaceAR ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getPositionZ ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_convertToNodeSpaceAR ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_convertToNodeSpaceAR ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getPositionZ ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 1 ) <nl> + if ( argc = = 0 ) <nl> { <nl> - cocos2d : : Vector2 arg0 ; <nl> - <nl> - ok & = luaval_to_vector2 ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cocos2d : : Vector2 ret = cobj - > convertToNodeSpaceAR ( arg0 ) ; <nl> - vector2_to_luaval ( tolua_S , ret ) ; <nl> + double ret = cobj - > getPositionZ ( ) ; <nl> + tolua_pushnumber ( tolua_S , ( lua_Number ) ret ) ; <nl> return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " convertToNodeSpaceAR " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getPositionZ " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_convertToNodeSpaceAR ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getPositionZ ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_addComponent ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getPositionY ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_addComponent ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_addComponent ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getPositionY ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 1 ) <nl> + if ( argc = = 0 ) <nl> { <nl> - cocos2d : : Component * arg0 ; <nl> - <nl> - ok & = luaval_to_object < cocos2d : : Component > ( tolua_S , 2 , " cc . Component " , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - bool ret = cobj - > addComponent ( arg0 ) ; <nl> - tolua_pushboolean ( tolua_S , ( bool ) ret ) ; <nl> + double ret = cobj - > getPositionY ( ) ; <nl> + tolua_pushnumber ( tolua_S , ( lua_Number ) ret ) ; <nl> return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " addComponent " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getPositionY " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_addComponent ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getPositionY ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_setGLProgram ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getPositionX ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_setGLProgram ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setShaderProgram ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getPositionX ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 1 ) <nl> + if ( argc = = 0 ) <nl> { <nl> - cocos2d : : GLProgram * arg0 ; <nl> - <nl> - ok & = luaval_to_object < cocos2d : : GLProgram > ( tolua_S , 2 , " cc . GLProgram " , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > setGLProgram ( arg0 ) ; <nl> - return 0 ; <nl> + double ret = cobj - > getPositionX ( ) ; <nl> + tolua_pushnumber ( tolua_S , ( lua_Number ) ret ) ; <nl> + return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setShaderProgram " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getPositionX " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setShaderProgram ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getPositionX ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getRotation ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_removeChildByTag ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_getRotation ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getRotation ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_removeChildByTag ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 0 ) <nl> + if ( argc = = 1 ) <nl> { <nl> + int arg0 ; <nl> + <nl> + ok & = luaval_to_int32 ( tolua_S , 2 , ( int * ) & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - double ret = cobj - > getRotation ( ) ; <nl> - tolua_pushnumber ( tolua_S , ( lua_Number ) ret ) ; <nl> - return 1 ; <nl> + cobj - > removeChildByTag ( arg0 ) ; <nl> + return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getRotation " , argc , 0 ) ; <nl> + if ( argc = = 2 ) <nl> + { <nl> + int arg0 ; <nl> + bool arg1 ; <nl> + <nl> + ok & = luaval_to_int32 ( tolua_S , 2 , ( int * ) & arg0 ) ; <nl> + <nl> + ok & = luaval_to_boolean ( tolua_S , 3 , & arg1 ) ; <nl> + if ( ! ok ) <nl> + return 0 ; <nl> + cobj - > removeChildByTag ( arg0 , arg1 ) ; <nl> + return 0 ; <nl> + } <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " removeChildByTag " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getRotation ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_removeChildByTag ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getAnchorPointInPoints ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_setPositionY ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_getAnchorPointInPoints ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getAnchorPointInPoints ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setPositionY ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 0 ) <nl> + if ( argc = = 1 ) <nl> { <nl> + double arg0 ; <nl> + <nl> + ok & = luaval_to_number ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - const cocos2d : : Vector2 & ret = cobj - > getAnchorPointInPoints ( ) ; <nl> - vector2_to_luaval ( tolua_S , ret ) ; <nl> - return 1 ; <nl> + cobj - > setPositionY ( arg0 ) ; <nl> + return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getAnchorPointInPoints " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setPositionY " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getAnchorPointInPoints ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setPositionY ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_runAction ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getNodeToWorldAffineTransform ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_runAction ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_runAction ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getNodeToWorldAffineTransform ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 1 ) <nl> + if ( argc = = 0 ) <nl> { <nl> - cocos2d : : Action * arg0 ; <nl> - <nl> - ok & = luaval_to_object < cocos2d : : Action > ( tolua_S , 2 , " cc . Action " , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cocos2d : : Action * ret = cobj - > runAction ( arg0 ) ; <nl> - object_to_luaval < cocos2d : : Action > ( tolua_S , " cc . Action " , ( cocos2d : : Action * ) ret ) ; <nl> + cocos2d : : AffineTransform ret = cobj - > getNodeToWorldAffineTransform ( ) ; <nl> + affinetransform_to_luaval ( tolua_S , ret ) ; <nl> return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " runAction " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getNodeToWorldAffineTransform " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_runAction ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getNodeToWorldAffineTransform ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_setScheduler ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_updateDisplayedColor ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_setScheduler ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setScheduler ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_updateDisplayedColor ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node_setScheduler ( lua_State * tolua_S ) <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> if ( argc = = 1 ) <nl> { <nl> - cocos2d : : Scheduler * arg0 ; <nl> + cocos2d : : Color3B arg0 ; <nl> <nl> - ok & = luaval_to_object < cocos2d : : Scheduler > ( tolua_S , 2 , " cc . Scheduler " , & arg0 ) ; <nl> + ok & = luaval_to_color3b ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > setScheduler ( arg0 ) ; <nl> + cobj - > updateDisplayedColor ( arg0 ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setScheduler " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " updateDisplayedColor " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setScheduler ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_updateDisplayedColor ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_stopAllActions ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_setVisible ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_stopAllActions ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_stopAllActions ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setVisible ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 0 ) <nl> + if ( argc = = 1 ) <nl> { <nl> + bool arg0 ; <nl> + <nl> + ok & = luaval_to_boolean ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > stopAllActions ( ) ; <nl> + cobj - > setVisible ( arg0 ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " stopAllActions " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setVisible " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_stopAllActions ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setVisible ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getSkewX ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getParentToNodeTransform ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_getSkewX ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getSkewX ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getParentToNodeTransform ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node_getSkewX ( lua_State * tolua_S ) <nl> { <nl> if ( ! ok ) <nl> return 0 ; <nl> - double ret = cobj - > getSkewX ( ) ; <nl> - tolua_pushnumber ( tolua_S , ( lua_Number ) ret ) ; <nl> + const cocos2d : : Matrix & ret = cobj - > getParentToNodeTransform ( ) ; <nl> + matrix_to_luaval ( tolua_S , ret ) ; <nl> return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getSkewX " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getParentToNodeTransform " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getSkewX ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getParentToNodeTransform ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getSkewY ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_setGlobalZOrder ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_getSkewY ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getSkewY ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setGlobalZOrder ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 0 ) <nl> + if ( argc = = 1 ) <nl> { <nl> + double arg0 ; <nl> + <nl> + ok & = luaval_to_number ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - double ret = cobj - > getSkewY ( ) ; <nl> - tolua_pushnumber ( tolua_S , ( lua_Number ) ret ) ; <nl> - return 1 ; <nl> + cobj - > setGlobalZOrder ( arg0 ) ; <nl> + return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getSkewY " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setGlobalZOrder " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getSkewY ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setGlobalZOrder ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getDisplayedColor ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_setScale ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> bool ok = true ; <nl> - <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_Error tolua_err ; <nl> # endif <nl> <nl> - <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> - <nl> cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> - <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! cobj ) <nl> + if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getDisplayedColor ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setScale ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> - <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 0 ) <nl> - { <nl> - if ( ! ok ) <nl> + do { <nl> + if ( argc = = 2 ) { <nl> + double arg0 ; <nl> + ok & = luaval_to_number ( tolua_S , 2 , & arg0 ) ; <nl> + <nl> + if ( ! ok ) { break ; } <nl> + double arg1 ; <nl> + ok & = luaval_to_number ( tolua_S , 3 , & arg1 ) ; <nl> + <nl> + if ( ! ok ) { break ; } <nl> + cobj - > setScale ( arg0 , arg1 ) ; <nl> return 0 ; <nl> - const cocos2d : : Color3B & ret = cobj - > getDisplayedColor ( ) ; <nl> - color3b_to_luaval ( tolua_S , ret ) ; <nl> - return 1 ; <nl> - } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getDisplayedColor " , argc , 0 ) ; <nl> + } <nl> + } while ( 0 ) ; <nl> + ok = true ; <nl> + do { <nl> + if ( argc = = 1 ) { <nl> + double arg0 ; <nl> + ok & = luaval_to_number ( tolua_S , 2 , & arg0 ) ; <nl> + <nl> + if ( ! ok ) { break ; } <nl> + cobj - > setScale ( arg0 ) ; <nl> + return 0 ; <nl> + } <nl> + } while ( 0 ) ; <nl> + ok = true ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setScale " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getDisplayedColor ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setScale ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getActionByTag ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getChildByTag ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_getActionByTag ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getActionByTag ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getChildByTag ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node_getActionByTag ( lua_State * tolua_S ) <nl> ok & = luaval_to_int32 ( tolua_S , 2 , ( int * ) & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cocos2d : : Action * ret = cobj - > getActionByTag ( arg0 ) ; <nl> - object_to_luaval < cocos2d : : Action > ( tolua_S , " cc . Action " , ( cocos2d : : Action * ) ret ) ; <nl> + cocos2d : : Node * ret = cobj - > getChildByTag ( arg0 ) ; <nl> + object_to_luaval < cocos2d : : Node > ( tolua_S , " cc . Node " , ( cocos2d : : Node * ) ret ) ; <nl> return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getActionByTag " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getChildByTag " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getActionByTag ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getChildByTag ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_setAdditionalTransform ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_setOrderOfArrival ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> bool ok = true ; <nl> + <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_Error tolua_err ; <nl> # endif <nl> <nl> + <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> + <nl> cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! cobj ) <nl> + if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setAdditionalTransform ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setOrderOfArrival ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> - argc = lua_gettop ( tolua_S ) - 1 ; <nl> - do { <nl> - if ( argc = = 1 ) { <nl> - cocos2d : : AffineTransform arg0 ; <nl> - ok & = luaval_to_affinetransform ( tolua_S , 2 , & arg0 ) ; <nl> <nl> - if ( ! ok ) { break ; } <nl> - cobj - > setAdditionalTransform ( arg0 ) ; <nl> - return 0 ; <nl> - } <nl> - } while ( 0 ) ; <nl> - ok = true ; <nl> - do { <nl> - if ( argc = = 1 ) { <nl> - cocos2d : : Matrix * arg0 ; <nl> - ok & = luaval_to_object < cocos2d : : Matrix > ( tolua_S , 2 , " cc . Matrix " , & arg0 ) ; <nl> + argc = lua_gettop ( tolua_S ) - 1 ; <nl> + if ( argc = = 1 ) <nl> + { <nl> + int arg0 ; <nl> <nl> - if ( ! ok ) { break ; } <nl> - cobj - > setAdditionalTransform ( arg0 ) ; <nl> + ok & = luaval_to_int32 ( tolua_S , 2 , ( int * ) & arg0 ) ; <nl> + if ( ! ok ) <nl> return 0 ; <nl> - } <nl> - } while ( 0 ) ; <nl> - ok = true ; <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setAdditionalTransform " , argc , 1 ) ; <nl> + cobj - > setOrderOfArrival ( arg0 ) ; <nl> + return 0 ; <nl> + } <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setOrderOfArrival " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setAdditionalTransform ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setOrderOfArrival ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getDisplayedOpacity ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getScaleZ ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_getDisplayedOpacity ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getDisplayedOpacity ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getScaleZ ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node_getDisplayedOpacity ( lua_State * tolua_S ) <nl> { <nl> if ( ! ok ) <nl> return 0 ; <nl> - uint16_t ret = cobj - > getDisplayedOpacity ( ) ; <nl> + double ret = cobj - > getScaleZ ( ) ; <nl> tolua_pushnumber ( tolua_S , ( lua_Number ) ret ) ; <nl> return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getDisplayedOpacity " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getScaleZ " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getDisplayedOpacity ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getScaleZ ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getLocalZOrder ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getScaleY ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_getLocalZOrder ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getLocalZOrder ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getScaleY ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node_getLocalZOrder ( lua_State * tolua_S ) <nl> { <nl> if ( ! ok ) <nl> return 0 ; <nl> - int ret = cobj - > getLocalZOrder ( ) ; <nl> + double ret = cobj - > getScaleY ( ) ; <nl> tolua_pushnumber ( tolua_S , ( lua_Number ) ret ) ; <nl> return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getLocalZOrder " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getScaleY " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getLocalZOrder ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getScaleY ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getScheduler ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getScaleX ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> bool ok = true ; <nl> + <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_Error tolua_err ; <nl> # endif <nl> <nl> + <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> + <nl> cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! cobj ) <nl> + if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getScheduler ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getScaleX ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> + <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - do { <nl> - if ( argc = = 0 ) { <nl> - const cocos2d : : Scheduler * ret = cobj - > getScheduler ( ) ; <nl> - object_to_luaval < cocos2d : : Scheduler > ( tolua_S , " cc . Scheduler " , ( cocos2d : : Scheduler * ) ret ) ; <nl> - return 1 ; <nl> - } <nl> - } while ( 0 ) ; <nl> - ok = true ; <nl> - do { <nl> - if ( argc = = 0 ) { <nl> - cocos2d : : Scheduler * ret = cobj - > getScheduler ( ) ; <nl> - object_to_luaval < cocos2d : : Scheduler > ( tolua_S , " cc . Scheduler " , ( cocos2d : : Scheduler * ) ret ) ; <nl> - return 1 ; <nl> - } <nl> - } while ( 0 ) ; <nl> - ok = true ; <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getScheduler " , argc , 0 ) ; <nl> + if ( argc = = 0 ) <nl> + { <nl> + if ( ! ok ) <nl> + return 0 ; <nl> + double ret = cobj - > getScaleX ( ) ; <nl> + tolua_pushnumber ( tolua_S , ( lua_Number ) ret ) ; <nl> + return 1 ; <nl> + } <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getScaleX " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getScheduler ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getScaleX ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getParentToNodeAffineTransform ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_setLocalZOrder ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_getParentToNodeAffineTransform ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getParentToNodeAffineTransform ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setLocalZOrder ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 0 ) <nl> + if ( argc = = 1 ) <nl> { <nl> + int arg0 ; <nl> + <nl> + ok & = luaval_to_int32 ( tolua_S , 2 , ( int * ) & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cocos2d : : AffineTransform ret = cobj - > getParentToNodeAffineTransform ( ) ; <nl> - affinetransform_to_luaval ( tolua_S , ret ) ; <nl> - return 1 ; <nl> + cobj - > setLocalZOrder ( arg0 ) ; <nl> + return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getParentToNodeAffineTransform " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setLocalZOrder " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getParentToNodeAffineTransform ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setLocalZOrder ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getOrderOfArrival ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getWorldToNodeAffineTransform ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_getOrderOfArrival ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getOrderOfArrival ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getWorldToNodeAffineTransform ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node_getOrderOfArrival ( lua_State * tolua_S ) <nl> { <nl> if ( ! ok ) <nl> return 0 ; <nl> - int ret = cobj - > getOrderOfArrival ( ) ; <nl> - tolua_pushnumber ( tolua_S , ( lua_Number ) ret ) ; <nl> + cocos2d : : AffineTransform ret = cobj - > getWorldToNodeAffineTransform ( ) ; <nl> + affinetransform_to_luaval ( tolua_S , ret ) ; <nl> return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getOrderOfArrival " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getWorldToNodeAffineTransform " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getOrderOfArrival ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getWorldToNodeAffineTransform ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_setActionManager ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_setCascadeColorEnabled ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_setActionManager ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setActionManager ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setCascadeColorEnabled ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node_setActionManager ( lua_State * tolua_S ) <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> if ( argc = = 1 ) <nl> { <nl> - cocos2d : : ActionManager * arg0 ; <nl> + bool arg0 ; <nl> <nl> - ok & = luaval_to_object < cocos2d : : ActionManager > ( tolua_S , 2 , " cc . ActionManager " , & arg0 ) ; <nl> + ok & = luaval_to_boolean ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > setActionManager ( arg0 ) ; <nl> + cobj - > setCascadeColorEnabled ( arg0 ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setActionManager " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setCascadeColorEnabled " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setActionManager ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setCascadeColorEnabled ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_setColor ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_setOpacity ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_setColor ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setColor ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setOpacity ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node_setColor ( lua_State * tolua_S ) <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> if ( argc = = 1 ) <nl> { <nl> - cocos2d : : Color3B arg0 ; <nl> + uint16_t arg0 ; <nl> <nl> - ok & = luaval_to_color3b ( tolua_S , 2 , & arg0 ) ; <nl> + ok & = luaval_to_uint16 ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > setColor ( arg0 ) ; <nl> + cobj - > setOpacity ( arg0 ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setColor " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setOpacity " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setColor ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setOpacity ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_isRunning ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_cleanup ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_isRunning ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_isRunning ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_cleanup ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node_isRunning ( lua_State * tolua_S ) <nl> { <nl> if ( ! ok ) <nl> return 0 ; <nl> - bool ret = cobj - > isRunning ( ) ; <nl> - tolua_pushboolean ( tolua_S , ( bool ) ret ) ; <nl> - return 1 ; <nl> + cobj - > cleanup ( ) ; <nl> + return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " isRunning " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " cleanup " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_isRunning ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_cleanup ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getParent ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getComponent ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> bool ok = true ; <nl> + <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_Error tolua_err ; <nl> # endif <nl> <nl> + <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> + <nl> cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! cobj ) <nl> + if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getParent ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getComponent ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> + <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - do { <nl> - if ( argc = = 0 ) { <nl> - const cocos2d : : Node * ret = cobj - > getParent ( ) ; <nl> - object_to_luaval < cocos2d : : Node > ( tolua_S , " cc . Node " , ( cocos2d : : Node * ) ret ) ; <nl> - return 1 ; <nl> - } <nl> - } while ( 0 ) ; <nl> - ok = true ; <nl> - do { <nl> - if ( argc = = 0 ) { <nl> - cocos2d : : Node * ret = cobj - > getParent ( ) ; <nl> - object_to_luaval < cocos2d : : Node > ( tolua_S , " cc . Node " , ( cocos2d : : Node * ) ret ) ; <nl> - return 1 ; <nl> - } <nl> - } while ( 0 ) ; <nl> - ok = true ; <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getParent " , argc , 0 ) ; <nl> + if ( argc = = 1 ) <nl> + { <nl> + std : : string arg0 ; <nl> + <nl> + ok & = luaval_to_std_string ( tolua_S , 2 , & arg0 ) ; <nl> + if ( ! ok ) <nl> + return 0 ; <nl> + cocos2d : : Component * ret = cobj - > getComponent ( arg0 ) ; <nl> + object_to_luaval < cocos2d : : Component > ( tolua_S , " cc . Component " , ( cocos2d : : Component * ) ret ) ; <nl> + return 1 ; <nl> + } <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getComponent " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getParent ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getComponent ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getPositionZ ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getContentSize ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_getPositionZ ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getPositionZ ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getContentSize ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node_getPositionZ ( lua_State * tolua_S ) <nl> { <nl> if ( ! ok ) <nl> return 0 ; <nl> - double ret = cobj - > getPositionZ ( ) ; <nl> - tolua_pushnumber ( tolua_S , ( lua_Number ) ret ) ; <nl> + const cocos2d : : Size & ret = cobj - > getContentSize ( ) ; <nl> + size_to_luaval ( tolua_S , ret ) ; <nl> return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getPositionZ " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getContentSize " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getPositionZ ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getContentSize ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getPositionY ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getColor ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_getPositionY ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getPositionY ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getColor ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node_getPositionY ( lua_State * tolua_S ) <nl> { <nl> if ( ! ok ) <nl> return 0 ; <nl> - double ret = cobj - > getPositionY ( ) ; <nl> - tolua_pushnumber ( tolua_S , ( lua_Number ) ret ) ; <nl> + const cocos2d : : Color3B & ret = cobj - > getColor ( ) ; <nl> + color3b_to_luaval ( tolua_S , ret ) ; <nl> return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getPositionY " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getColor " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getPositionY ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getColor ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getPositionX ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getBoundingBox ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_getPositionX ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getPositionX ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getBoundingBox ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node_getPositionX ( lua_State * tolua_S ) <nl> { <nl> if ( ! ok ) <nl> return 0 ; <nl> - double ret = cobj - > getPositionX ( ) ; <nl> - tolua_pushnumber ( tolua_S , ( lua_Number ) ret ) ; <nl> + cocos2d : : Rect ret = cobj - > getBoundingBox ( ) ; <nl> + rect_to_luaval ( tolua_S , ret ) ; <nl> return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getPositionX " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getBoundingBox " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getPositionX ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getBoundingBox ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_removeChildByTag ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_setEventDispatcher ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_removeChildByTag ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_removeChildByTag ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setEventDispatcher ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node_removeChildByTag ( lua_State * tolua_S ) <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> if ( argc = = 1 ) <nl> { <nl> - int arg0 ; <nl> - <nl> - ok & = luaval_to_int32 ( tolua_S , 2 , ( int * ) & arg0 ) ; <nl> - if ( ! ok ) <nl> - return 0 ; <nl> - cobj - > removeChildByTag ( arg0 ) ; <nl> - return 0 ; <nl> - } <nl> - if ( argc = = 2 ) <nl> - { <nl> - int arg0 ; <nl> - bool arg1 ; <nl> - <nl> - ok & = luaval_to_int32 ( tolua_S , 2 , ( int * ) & arg0 ) ; <nl> + cocos2d : : EventDispatcher * arg0 ; <nl> <nl> - ok & = luaval_to_boolean ( tolua_S , 3 , & arg1 ) ; <nl> + ok & = luaval_to_object < cocos2d : : EventDispatcher > ( tolua_S , 2 , " cc . EventDispatcher " , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > removeChildByTag ( arg0 , arg1 ) ; <nl> + cobj - > setEventDispatcher ( arg0 ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " removeChildByTag " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setEventDispatcher " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_removeChildByTag ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setEventDispatcher ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_setPositionY ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getGlobalZOrder ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_setPositionY ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setPositionY ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getGlobalZOrder ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 1 ) <nl> + if ( argc = = 0 ) <nl> { <nl> - double arg0 ; <nl> - <nl> - ok & = luaval_to_number ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > setPositionY ( arg0 ) ; <nl> - return 0 ; <nl> + double ret = cobj - > getGlobalZOrder ( ) ; <nl> + tolua_pushnumber ( tolua_S , ( lua_Number ) ret ) ; <nl> + return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setPositionY " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getGlobalZOrder " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setPositionY ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getGlobalZOrder ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_updateDisplayedColor ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_draw ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> bool ok = true ; <nl> - <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_Error tolua_err ; <nl> # endif <nl> <nl> - <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> - <nl> cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> - <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! cobj ) <nl> + if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_updateDisplayedColor ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_draw ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> - <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 1 ) <nl> - { <nl> - cocos2d : : Color3B arg0 ; <nl> + do { <nl> + if ( argc = = 0 ) { <nl> + cobj - > draw ( ) ; <nl> + return 0 ; <nl> + } <nl> + } while ( 0 ) ; <nl> + ok = true ; <nl> + do { <nl> + if ( argc = = 3 ) { <nl> + cocos2d : : Renderer * arg0 ; <nl> + ok & = luaval_to_object < cocos2d : : Renderer > ( tolua_S , 2 , " cc . Renderer " , & arg0 ) ; <nl> <nl> - ok & = luaval_to_color3b ( tolua_S , 2 , & arg0 ) ; <nl> - if ( ! ok ) <nl> + if ( ! ok ) { break ; } <nl> + cocos2d : : Matrix arg1 ; <nl> + ok & = luaval_to_matrix ( tolua_S , 3 , & arg1 ) ; <nl> + <nl> + if ( ! ok ) { break ; } <nl> + bool arg2 ; <nl> + ok & = luaval_to_boolean ( tolua_S , 4 , & arg2 ) ; <nl> + <nl> + if ( ! ok ) { break ; } <nl> + cobj - > draw ( arg0 , arg1 , arg2 ) ; <nl> return 0 ; <nl> - cobj - > updateDisplayedColor ( arg0 ) ; <nl> - return 0 ; <nl> - } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " updateDisplayedColor " , argc , 1 ) ; <nl> + } <nl> + } while ( 0 ) ; <nl> + ok = true ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " draw " , argc , 3 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_updateDisplayedColor ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_draw ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_setVisible ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_setUserObject ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_setVisible ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setVisible ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setUserObject ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node_setVisible ( lua_State * tolua_S ) <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> if ( argc = = 1 ) <nl> { <nl> - bool arg0 ; <nl> + cocos2d : : Ref * arg0 ; <nl> <nl> - ok & = luaval_to_boolean ( tolua_S , 2 , & arg0 ) ; <nl> + ok & = luaval_to_object < cocos2d : : Ref > ( tolua_S , 2 , " cc . Ref " , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > setVisible ( arg0 ) ; <nl> + cobj - > setUserObject ( arg0 ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setVisible " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setUserObject " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setVisible ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setUserObject ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getParentToNodeTransform ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_removeFromParentAndCleanup ( lua_State * tolua_S ) <nl> + { <nl> + int argc = 0 ; <nl> + cocos2d : : Node * cobj = nullptr ; <nl> + bool ok = true ; <nl> + # if COCOS2D_DEBUG > = 1 <nl> + tolua_Error tolua_err ; <nl> + # endif <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + # endif <nl> + cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + # if COCOS2D_DEBUG > = 1 <nl> + if ( ! cobj ) <nl> + { <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_removeFromParentAndCleanup ' " , nullptr ) ; <nl> + return 0 ; <nl> + } <nl> + # endif <nl> + argc = lua_gettop ( tolua_S ) - 1 ; <nl> + do { <nl> + if ( argc = = 1 ) { <nl> + bool arg0 ; <nl> + ok & = luaval_to_boolean ( tolua_S , 2 , & arg0 ) ; <nl> + <nl> + if ( ! ok ) { break ; } <nl> + cobj - > removeFromParentAndCleanup ( arg0 ) ; <nl> + return 0 ; <nl> + } <nl> + } while ( 0 ) ; <nl> + ok = true ; <nl> + do { <nl> + if ( argc = = 0 ) { <nl> + cobj - > removeFromParent ( ) ; <nl> + return 0 ; <nl> + } <nl> + } while ( 0 ) ; <nl> + ok = true ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " removeFromParent " , argc , 0 ) ; <nl> + return 0 ; <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + tolua_lerror : <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_removeFromParentAndCleanup ' . " , & tolua_err ) ; <nl> + # endif <nl> + <nl> + return 0 ; <nl> + } <nl> + int lua_cocos2dx_Node_setPosition3D ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_getParentToNodeTransform ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getParentToNodeTransform ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setPosition3D ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 0 ) <nl> + if ( argc = = 1 ) <nl> { <nl> + cocos2d : : Vector3 arg0 ; <nl> + <nl> + ok & = luaval_to_vector3 ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - const cocos2d : : Matrix & ret = cobj - > getParentToNodeTransform ( ) ; <nl> - matrix_to_luaval ( tolua_S , ret ) ; <nl> - return 1 ; <nl> + cobj - > setPosition3D ( arg0 ) ; <nl> + return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getParentToNodeTransform " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setPosition3D " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getParentToNodeTransform ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setPosition3D ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_setGlobalZOrder ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_update ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_setGlobalZOrder ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setGlobalZOrder ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_update ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node_setGlobalZOrder ( lua_State * tolua_S ) <nl> ok & = luaval_to_number ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > setGlobalZOrder ( arg0 ) ; <nl> + cobj - > update ( arg0 ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setGlobalZOrder " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " update " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setGlobalZOrder ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_update ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_setScale ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_sortAllChildren ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> bool ok = true ; <nl> + <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_Error tolua_err ; <nl> # endif <nl> <nl> + <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> + <nl> cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! cobj ) <nl> + if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setScale ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_sortAllChildren ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> - argc = lua_gettop ( tolua_S ) - 1 ; <nl> - do { <nl> - if ( argc = = 2 ) { <nl> - double arg0 ; <nl> - ok & = luaval_to_number ( tolua_S , 2 , & arg0 ) ; <nl> - <nl> - if ( ! ok ) { break ; } <nl> - double arg1 ; <nl> - ok & = luaval_to_number ( tolua_S , 3 , & arg1 ) ; <nl> <nl> - if ( ! ok ) { break ; } <nl> - cobj - > setScale ( arg0 , arg1 ) ; <nl> - return 0 ; <nl> - } <nl> - } while ( 0 ) ; <nl> - ok = true ; <nl> - do { <nl> - if ( argc = = 1 ) { <nl> - double arg0 ; <nl> - ok & = luaval_to_number ( tolua_S , 2 , & arg0 ) ; <nl> - <nl> - if ( ! ok ) { break ; } <nl> - cobj - > setScale ( arg0 ) ; <nl> + argc = lua_gettop ( tolua_S ) - 1 ; <nl> + if ( argc = = 0 ) <nl> + { <nl> + if ( ! ok ) <nl> return 0 ; <nl> - } <nl> - } while ( 0 ) ; <nl> - ok = true ; <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setScale " , argc , 1 ) ; <nl> + cobj - > sortAllChildren ( ) ; <nl> + return 0 ; <nl> + } <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " sortAllChildren " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setScale ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_sortAllChildren ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getChildByTag ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getWorldToNodeTransform ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_getChildByTag ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getChildByTag ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getWorldToNodeTransform ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 1 ) <nl> + if ( argc = = 0 ) <nl> { <nl> - int arg0 ; <nl> - <nl> - ok & = luaval_to_int32 ( tolua_S , 2 , ( int * ) & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cocos2d : : Node * ret = cobj - > getChildByTag ( arg0 ) ; <nl> - object_to_luaval < cocos2d : : Node > ( tolua_S , " cc . Node " , ( cocos2d : : Node * ) ret ) ; <nl> + cocos2d : : Matrix ret = cobj - > getWorldToNodeTransform ( ) ; <nl> + matrix_to_luaval ( tolua_S , ret ) ; <nl> return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getChildByTag " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getWorldToNodeTransform " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getChildByTag ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getWorldToNodeTransform ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_setOrderOfArrival ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_setGLProgram ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_setOrderOfArrival ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setOrderOfArrival ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setGLProgram ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node_setOrderOfArrival ( lua_State * tolua_S ) <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> if ( argc = = 1 ) <nl> { <nl> - int arg0 ; <nl> + cocos2d : : GLProgram * arg0 ; <nl> <nl> - ok & = luaval_to_int32 ( tolua_S , 2 , ( int * ) & arg0 ) ; <nl> + ok & = luaval_to_object < cocos2d : : GLProgram > ( tolua_S , 2 , " cc . GLProgram " , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > setOrderOfArrival ( arg0 ) ; <nl> + cobj - > setGLProgram ( arg0 ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setOrderOfArrival " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setGLProgram " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setOrderOfArrival ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setGLProgram ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getScaleZ ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getScale ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_getScaleZ ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getScaleZ ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getScale ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node_getScaleZ ( lua_State * tolua_S ) <nl> { <nl> if ( ! ok ) <nl> return 0 ; <nl> - double ret = cobj - > getScaleZ ( ) ; <nl> + double ret = cobj - > getScale ( ) ; <nl> tolua_pushnumber ( tolua_S , ( lua_Number ) ret ) ; <nl> return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getScaleZ " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getScale " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getScaleZ ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getScale ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getScaleY ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getRotationSkewX ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_getScaleY ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getScaleY ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getRotationSkewX ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node_getScaleY ( lua_State * tolua_S ) <nl> { <nl> if ( ! ok ) <nl> return 0 ; <nl> - double ret = cobj - > getScaleY ( ) ; <nl> + double ret = cobj - > getRotationSkewX ( ) ; <nl> tolua_pushnumber ( tolua_S , ( lua_Number ) ret ) ; <nl> return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getScaleY " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getRotationSkewX " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getScaleY ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getRotationSkewX ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getScaleX ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getRotationSkewY ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_getScaleX ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getScaleX ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getRotationSkewY ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node_getScaleX ( lua_State * tolua_S ) <nl> { <nl> if ( ! ok ) <nl> return 0 ; <nl> - double ret = cobj - > getScaleX ( ) ; <nl> + double ret = cobj - > getRotationSkewY ( ) ; <nl> tolua_pushnumber ( tolua_S , ( lua_Number ) ret ) ; <nl> return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getScaleX " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getRotationSkewY " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getScaleX ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getRotationSkewY ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_setLocalZOrder ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_setTag ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_setLocalZOrder ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setLocalZOrder ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setTag ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node_setLocalZOrder ( lua_State * tolua_S ) <nl> ok & = luaval_to_int32 ( tolua_S , 2 , ( int * ) & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > setLocalZOrder ( arg0 ) ; <nl> + cobj - > setTag ( arg0 ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setLocalZOrder " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setTag " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setLocalZOrder ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setTag ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getWorldToNodeAffineTransform ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_isCascadeColorEnabled ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_getWorldToNodeAffineTransform ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getWorldToNodeAffineTransform ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_isCascadeColorEnabled ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node_getWorldToNodeAffineTransform ( lua_State * tolua_S ) <nl> { <nl> if ( ! ok ) <nl> return 0 ; <nl> - cocos2d : : AffineTransform ret = cobj - > getWorldToNodeAffineTransform ( ) ; <nl> - affinetransform_to_luaval ( tolua_S , ret ) ; <nl> + bool ret = cobj - > isCascadeColorEnabled ( ) ; <nl> + tolua_pushboolean ( tolua_S , ( bool ) ret ) ; <nl> return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getWorldToNodeAffineTransform " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " isCascadeColorEnabled " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getWorldToNodeAffineTransform ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_isCascadeColorEnabled ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_setCascadeColorEnabled ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_stopAction ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> int lua_cocos2dx_Node_setCascadeColorEnabled ( lua_State * tolua_S ) <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setCascadeColorEnabled ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_stopAction ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node_setCascadeColorEnabled ( lua_State * tolua_S ) <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> if ( argc = = 1 ) <nl> { <nl> - bool arg0 ; <nl> + cocos2d : : Action * arg0 ; <nl> <nl> - ok & = luaval_to_boolean ( tolua_S , 2 , & arg0 ) ; <nl> + ok & = luaval_to_object < cocos2d : : Action > ( tolua_S , 2 , " cc . Action " , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > setCascadeColorEnabled ( arg0 ) ; <nl> + cobj - > stopAction ( arg0 ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setCascadeColorEnabled " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " stopAction " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setCascadeColorEnabled ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_stopAction ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_setOpacity ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_Node_getActionManager ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> cocos2d : : Node * cobj = nullptr ; <nl> bool ok = true ; <nl> + # if COCOS2D_DEBUG > = 1 <nl> + tolua_Error tolua_err ; <nl> + # endif <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + # endif <nl> + cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + # if COCOS2D_DEBUG > = 1 <nl> + if ( ! cobj ) <nl> + { <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getActionManager ' " , nullptr ) ; <nl> + return 0 ; <nl> + } <nl> + # endif <nl> + argc = lua_gettop ( tolua_S ) - 1 ; <nl> + do { <nl> + if ( argc = = 0 ) { <nl> + const cocos2d : : ActionManager * ret = cobj - > getActionManager ( ) ; <nl> + object_to_luaval < cocos2d : : ActionManager > ( tolua_S , " cc . ActionManager " , ( cocos2d : : ActionManager * ) ret ) ; <nl> + return 1 ; <nl> + } <nl> + } while ( 0 ) ; <nl> + ok = true ; <nl> + do { <nl> + if ( argc = = 0 ) { <nl> + cocos2d : : ActionManager * ret = cobj - > getActionManager ( ) ; <nl> + object_to_luaval < cocos2d : : ActionManager > ( tolua_S , " cc . ActionManager " , ( cocos2d : : ActionManager * ) ret ) ; <nl> + return 1 ; <nl> + } <nl> + } while ( 0 ) ; <nl> + ok = true ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getActionManager " , argc , 0 ) ; <nl> + return 0 ; <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + tolua_lerror : <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getActionManager ' . " , & tolua_err ) ; <nl> + # endif <nl> + <nl> + return 0 ; <nl> + } <nl> + int lua_cocos2dx_Node_create ( lua_State * tolua_S ) <nl> + { <nl> + int argc = 0 ; <nl> + bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_Error tolua_err ; <nl> # endif <nl> <nl> + # if COCOS2D_DEBUG > = 1 <nl> + if ( ! tolua_isusertable ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + # endif <nl> <nl> + argc = lua_gettop ( tolua_S ) - 1 ; <nl> + <nl> + if ( argc = = 0 ) <nl> + { <nl> + if ( ! ok ) <nl> + return 0 ; <nl> + cocos2d : : Node * ret = cocos2d : : Node : : create ( ) ; <nl> + object_to_luaval < cocos2d : : Node > ( tolua_S , " cc . Node " , ( cocos2d : : Node * ) ret ) ; <nl> + return 1 ; <nl> + } <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " create " , argc , 0 ) ; <nl> + return 0 ; <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + tolua_lerror : <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_create ' . " , & tolua_err ) ; <nl> + # endif <nl> + return 0 ; <nl> + } <nl> + static int lua_cocos2dx_Node_finalize ( lua_State * tolua_S ) <nl> + { <nl> + printf ( " luabindings : finalizing LUA object ( Node ) " ) ; <nl> + return 0 ; <nl> + } <nl> + <nl> + int lua_register_cocos2dx_Node ( lua_State * tolua_S ) <nl> + { <nl> + tolua_usertype ( tolua_S , " cc . Node " ) ; <nl> + tolua_cclass ( tolua_S , " Node " , " cc . Node " , " cc . Ref " , nullptr ) ; <nl> + <nl> + tolua_beginmodule ( tolua_S , " Node " ) ; <nl> + tolua_function ( tolua_S , " addChild " , lua_cocos2dx_Node_addChild ) ; <nl> + tolua_function ( tolua_S , " removeComponent " , lua_cocos2dx_Node_removeComponent ) ; <nl> + tolua_function ( tolua_S , " setPhysicsBody " , lua_cocos2dx_Node_setPhysicsBody ) ; <nl> + tolua_function ( tolua_S , " getDescription " , lua_cocos2dx_Node_getDescription ) ; <nl> + tolua_function ( tolua_S , " setRotationSkewY " , lua_cocos2dx_Node_setRotationSkewY ) ; <nl> + tolua_function ( tolua_S , " setOpacityModifyRGB " , lua_cocos2dx_Node_setOpacityModifyRGB ) ; <nl> + tolua_function ( tolua_S , " setCascadeOpacityEnabled " , lua_cocos2dx_Node_setCascadeOpacityEnabled ) ; <nl> + tolua_function ( tolua_S , " getChildren " , lua_cocos2dx_Node_getChildren ) ; <nl> + tolua_function ( tolua_S , " pause " , lua_cocos2dx_Node_pause ) ; <nl> + tolua_function ( tolua_S , " convertToWorldSpaceAR " , lua_cocos2dx_Node_convertToWorldSpaceAR ) ; <nl> + tolua_function ( tolua_S , " isIgnoreAnchorPointForPosition " , lua_cocos2dx_Node_isIgnoreAnchorPointForPosition ) ; <nl> + tolua_function ( tolua_S , " updateDisplayedOpacity " , lua_cocos2dx_Node_updateDisplayedOpacity ) ; <nl> + tolua_function ( tolua_S , " setRotation " , lua_cocos2dx_Node_setRotation ) ; <nl> + tolua_function ( tolua_S , " setScaleZ " , lua_cocos2dx_Node_setScaleZ ) ; <nl> + tolua_function ( tolua_S , " setScaleY " , lua_cocos2dx_Node_setScaleY ) ; <nl> + tolua_function ( tolua_S , " setScaleX " , lua_cocos2dx_Node_setScaleX ) ; <nl> + tolua_function ( tolua_S , " setRotationSkewX " , lua_cocos2dx_Node_setRotationSkewX ) ; <nl> + tolua_function ( tolua_S , " removeAllComponents " , lua_cocos2dx_Node_removeAllComponents ) ; <nl> + tolua_function ( tolua_S , " _setLocalZOrder " , lua_cocos2dx_Node__setLocalZOrder ) ; <nl> + tolua_function ( tolua_S , " getTag " , lua_cocos2dx_Node_getTag ) ; <nl> + tolua_function ( tolua_S , " getGLProgram " , lua_cocos2dx_Node_getGLProgram ) ; <nl> + tolua_function ( tolua_S , " getNodeToWorldTransform " , lua_cocos2dx_Node_getNodeToWorldTransform ) ; <nl> + tolua_function ( tolua_S , " getPosition3D " , lua_cocos2dx_Node_getPosition3D ) ; <nl> + tolua_function ( tolua_S , " removeChild " , lua_cocos2dx_Node_removeChild ) ; <nl> + tolua_function ( tolua_S , " convertToWorldSpace " , lua_cocos2dx_Node_convertToWorldSpace ) ; <nl> + tolua_function ( tolua_S , " getScene " , lua_cocos2dx_Node_getScene ) ; <nl> + tolua_function ( tolua_S , " getEventDispatcher " , lua_cocos2dx_Node_getEventDispatcher ) ; <nl> + tolua_function ( tolua_S , " setSkewX " , lua_cocos2dx_Node_setSkewX ) ; <nl> + tolua_function ( tolua_S , " setGLProgramState " , lua_cocos2dx_Node_setGLProgramState ) ; <nl> + tolua_function ( tolua_S , " getOpacity " , lua_cocos2dx_Node_getOpacity ) ; <nl> + tolua_function ( tolua_S , " convertTouchToNodeSpace " , lua_cocos2dx_Node_convertTouchToNodeSpace ) ; <nl> + tolua_function ( tolua_S , " removeAllChildren " , lua_cocos2dx_Node_removeAllChildrenWithCleanup ) ; <nl> + tolua_function ( tolua_S , " getNodeToParentAffineTransform " , lua_cocos2dx_Node_getNodeToParentAffineTransform ) ; <nl> + tolua_function ( tolua_S , " isCascadeOpacityEnabled " , lua_cocos2dx_Node_isCascadeOpacityEnabled ) ; <nl> + tolua_function ( tolua_S , " setParent " , lua_cocos2dx_Node_setParent ) ; <nl> + tolua_function ( tolua_S , " getRotation3D " , lua_cocos2dx_Node_getRotation3D ) ; <nl> + tolua_function ( tolua_S , " getNodeToParentTransform " , lua_cocos2dx_Node_getNodeToParentTransform ) ; <nl> + tolua_function ( tolua_S , " convertTouchToNodeSpaceAR " , lua_cocos2dx_Node_convertTouchToNodeSpaceAR ) ; <nl> + tolua_function ( tolua_S , " convertToNodeSpace " , lua_cocos2dx_Node_convertToNodeSpace ) ; <nl> + tolua_function ( tolua_S , " resume " , lua_cocos2dx_Node_resume ) ; <nl> + tolua_function ( tolua_S , " getPhysicsBody " , lua_cocos2dx_Node_getPhysicsBody ) ; <nl> + tolua_function ( tolua_S , " setPosition " , lua_cocos2dx_Node_setPosition ) ; <nl> + tolua_function ( tolua_S , " stopActionByTag " , lua_cocos2dx_Node_stopActionByTag ) ; <nl> + tolua_function ( tolua_S , " reorderChild " , lua_cocos2dx_Node_reorderChild ) ; <nl> + tolua_function ( tolua_S , " ignoreAnchorPointForPosition " , lua_cocos2dx_Node_ignoreAnchorPointForPosition ) ; <nl> + tolua_function ( tolua_S , " setSkewY " , lua_cocos2dx_Node_setSkewY ) ; <nl> + tolua_function ( tolua_S , " setPositionZ " , lua_cocos2dx_Node_setPositionZ ) ; <nl> + tolua_function ( tolua_S , " setRotation3D " , lua_cocos2dx_Node_setRotation3D ) ; <nl> + tolua_function ( tolua_S , " setPositionX " , lua_cocos2dx_Node_setPositionX ) ; <nl> + tolua_function ( tolua_S , " setNodeToParentTransform " , lua_cocos2dx_Node_setNodeToParentTransform ) ; <nl> + tolua_function ( tolua_S , " getAnchorPoint " , lua_cocos2dx_Node_getAnchorPoint ) ; <nl> + tolua_function ( tolua_S , " getNumberOfRunningActions " , lua_cocos2dx_Node_getNumberOfRunningActions ) ; <nl> + tolua_function ( tolua_S , " updateTransform " , lua_cocos2dx_Node_updateTransform ) ; <nl> + tolua_function ( tolua_S , " isVisible " , lua_cocos2dx_Node_isVisible ) ; <nl> + tolua_function ( tolua_S , " getChildrenCount " , lua_cocos2dx_Node_getChildrenCount ) ; <nl> + tolua_function ( tolua_S , " convertToNodeSpaceAR " , lua_cocos2dx_Node_convertToNodeSpaceAR ) ; <nl> + tolua_function ( tolua_S , " addComponent " , lua_cocos2dx_Node_addComponent ) ; <nl> + tolua_function ( tolua_S , " isOpacityModifyRGB " , lua_cocos2dx_Node_isOpacityModifyRGB ) ; <nl> + tolua_function ( tolua_S , " getRotation " , lua_cocos2dx_Node_getRotation ) ; <nl> + tolua_function ( tolua_S , " getAnchorPointInPoints " , lua_cocos2dx_Node_getAnchorPointInPoints ) ; <nl> + tolua_function ( tolua_S , " runAction " , lua_cocos2dx_Node_runAction ) ; <nl> + tolua_function ( tolua_S , " getGLProgramState " , lua_cocos2dx_Node_getGLProgramState ) ; <nl> + tolua_function ( tolua_S , " setScheduler " , lua_cocos2dx_Node_setScheduler ) ; <nl> + tolua_function ( tolua_S , " stopAllActions " , lua_cocos2dx_Node_stopAllActions ) ; <nl> + tolua_function ( tolua_S , " getSkewX " , lua_cocos2dx_Node_getSkewX ) ; <nl> + tolua_function ( tolua_S , " getSkewY " , lua_cocos2dx_Node_getSkewY ) ; <nl> + tolua_function ( tolua_S , " getDisplayedColor " , lua_cocos2dx_Node_getDisplayedColor ) ; <nl> + tolua_function ( tolua_S , " getActionByTag " , lua_cocos2dx_Node_getActionByTag ) ; <nl> + tolua_function ( tolua_S , " setAdditionalTransform " , lua_cocos2dx_Node_setAdditionalTransform ) ; <nl> + tolua_function ( tolua_S , " getDisplayedOpacity " , lua_cocos2dx_Node_getDisplayedOpacity ) ; <nl> + tolua_function ( tolua_S , " getLocalZOrder " , lua_cocos2dx_Node_getLocalZOrder ) ; <nl> + tolua_function ( tolua_S , " getScheduler " , lua_cocos2dx_Node_getScheduler ) ; <nl> + tolua_function ( tolua_S , " getParentToNodeAffineTransform " , lua_cocos2dx_Node_getParentToNodeAffineTransform ) ; <nl> + tolua_function ( tolua_S , " getOrderOfArrival " , lua_cocos2dx_Node_getOrderOfArrival ) ; <nl> + tolua_function ( tolua_S , " setActionManager " , lua_cocos2dx_Node_setActionManager ) ; <nl> + tolua_function ( tolua_S , " setColor " , lua_cocos2dx_Node_setColor ) ; <nl> + tolua_function ( tolua_S , " isRunning " , lua_cocos2dx_Node_isRunning ) ; <nl> + tolua_function ( tolua_S , " getParent " , lua_cocos2dx_Node_getParent ) ; <nl> + tolua_function ( tolua_S , " getPositionZ " , lua_cocos2dx_Node_getPositionZ ) ; <nl> + tolua_function ( tolua_S , " getPositionY " , lua_cocos2dx_Node_getPositionY ) ; <nl> + tolua_function ( tolua_S , " getPositionX " , lua_cocos2dx_Node_getPositionX ) ; <nl> + tolua_function ( tolua_S , " removeChildByTag " , lua_cocos2dx_Node_removeChildByTag ) ; <nl> + tolua_function ( tolua_S , " setPositionY " , lua_cocos2dx_Node_setPositionY ) ; <nl> + tolua_function ( tolua_S , " getNodeToWorldAffineTransform " , lua_cocos2dx_Node_getNodeToWorldAffineTransform ) ; <nl> + tolua_function ( tolua_S , " updateDisplayedColor " , lua_cocos2dx_Node_updateDisplayedColor ) ; <nl> + tolua_function ( tolua_S , " setVisible " , lua_cocos2dx_Node_setVisible ) ; <nl> + tolua_function ( tolua_S , " getParentToNodeTransform " , lua_cocos2dx_Node_getParentToNodeTransform ) ; <nl> + tolua_function ( tolua_S , " setGlobalZOrder " , lua_cocos2dx_Node_setGlobalZOrder ) ; <nl> + tolua_function ( tolua_S , " setScale " , lua_cocos2dx_Node_setScale ) ; <nl> + tolua_function ( tolua_S , " getChildByTag " , lua_cocos2dx_Node_getChildByTag ) ; <nl> + tolua_function ( tolua_S , " setOrderOfArrival " , lua_cocos2dx_Node_setOrderOfArrival ) ; <nl> + tolua_function ( tolua_S , " getScaleZ " , lua_cocos2dx_Node_getScaleZ ) ; <nl> + tolua_function ( tolua_S , " getScaleY " , lua_cocos2dx_Node_getScaleY ) ; <nl> + tolua_function ( tolua_S , " getScaleX " , lua_cocos2dx_Node_getScaleX ) ; <nl> + tolua_function ( tolua_S , " setLocalZOrder " , lua_cocos2dx_Node_setLocalZOrder ) ; <nl> + tolua_function ( tolua_S , " getWorldToNodeAffineTransform " , lua_cocos2dx_Node_getWorldToNodeAffineTransform ) ; <nl> + tolua_function ( tolua_S , " setCascadeColorEnabled " , lua_cocos2dx_Node_setCascadeColorEnabled ) ; <nl> + tolua_function ( tolua_S , " setOpacity " , lua_cocos2dx_Node_setOpacity ) ; <nl> + tolua_function ( tolua_S , " cleanup " , lua_cocos2dx_Node_cleanup ) ; <nl> + tolua_function ( tolua_S , " getComponent " , lua_cocos2dx_Node_getComponent ) ; <nl> + tolua_function ( tolua_S , " getContentSize " , lua_cocos2dx_Node_getContentSize ) ; <nl> + tolua_function ( tolua_S , " getColor " , lua_cocos2dx_Node_getColor ) ; <nl> + tolua_function ( tolua_S , " getBoundingBox " , lua_cocos2dx_Node_getBoundingBox ) ; <nl> + tolua_function ( tolua_S , " setEventDispatcher " , lua_cocos2dx_Node_setEventDispatcher ) ; <nl> + tolua_function ( tolua_S , " getGlobalZOrder " , lua_cocos2dx_Node_getGlobalZOrder ) ; <nl> + tolua_function ( tolua_S , " draw " , lua_cocos2dx_Node_draw ) ; <nl> + tolua_function ( tolua_S , " setUserObject " , lua_cocos2dx_Node_setUserObject ) ; <nl> + tolua_function ( tolua_S , " removeFromParent " , lua_cocos2dx_Node_removeFromParentAndCleanup ) ; <nl> + tolua_function ( tolua_S , " setPosition3D " , lua_cocos2dx_Node_setPosition3D ) ; <nl> + tolua_function ( tolua_S , " update " , lua_cocos2dx_Node_update ) ; <nl> + tolua_function ( tolua_S , " sortAllChildren " , lua_cocos2dx_Node_sortAllChildren ) ; <nl> + tolua_function ( tolua_S , " getWorldToNodeTransform " , lua_cocos2dx_Node_getWorldToNodeTransform ) ; <nl> + tolua_function ( tolua_S , " setGLProgram " , lua_cocos2dx_Node_setGLProgram ) ; <nl> + tolua_function ( tolua_S , " getScale " , lua_cocos2dx_Node_getScale ) ; <nl> + tolua_function ( tolua_S , " getRotationSkewX " , lua_cocos2dx_Node_getRotationSkewX ) ; <nl> + tolua_function ( tolua_S , " getRotationSkewY " , lua_cocos2dx_Node_getRotationSkewY ) ; <nl> + tolua_function ( tolua_S , " setTag " , lua_cocos2dx_Node_setTag ) ; <nl> + tolua_function ( tolua_S , " isCascadeColorEnabled " , lua_cocos2dx_Node_isCascadeColorEnabled ) ; <nl> + tolua_function ( tolua_S , " stopAction " , lua_cocos2dx_Node_stopAction ) ; <nl> + tolua_function ( tolua_S , " getActionManager " , lua_cocos2dx_Node_getActionManager ) ; <nl> + tolua_function ( tolua_S , " create " , lua_cocos2dx_Node_create ) ; <nl> + tolua_endmodule ( tolua_S ) ; <nl> + std : : string typeName = typeid ( cocos2d : : Node ) . name ( ) ; <nl> + g_luaType [ typeName ] = " cc . Node " ; <nl> + g_typeCast [ " Node " ] = " cc . Node " ; <nl> + return 1 ; <nl> + } <nl> + <nl> + int lua_cocos2dx_GLProgram_getFragmentShaderLog ( lua_State * tolua_S ) <nl> + { <nl> + int argc = 0 ; <nl> + cocos2d : : GLProgram * cobj = nullptr ; <nl> + bool ok = true ; <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + tolua_Error tolua_err ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + # endif <nl> + <nl> + cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setOpacity ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_getFragmentShaderLog ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 1 ) <nl> + if ( argc = = 0 ) <nl> { <nl> - uint16_t arg0 ; <nl> - <nl> - ok & = luaval_to_uint16 ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > setOpacity ( arg0 ) ; <nl> + std : : string ret = cobj - > getFragmentShaderLog ( ) ; <nl> + tolua_pushcppstring ( tolua_S , ret ) ; <nl> + return 1 ; <nl> + } <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getFragmentShaderLog " , argc , 0 ) ; <nl> + return 0 ; <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + tolua_lerror : <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_getFragmentShaderLog ' . " , & tolua_err ) ; <nl> + # endif <nl> + <nl> + return 0 ; <nl> + } <nl> + int lua_cocos2dx_GLProgram_initWithByteArrays ( lua_State * tolua_S ) <nl> + { <nl> + int argc = 0 ; <nl> + cocos2d : : GLProgram * cobj = nullptr ; <nl> + bool ok = true ; <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + tolua_Error tolua_err ; <nl> + # endif <nl> + <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + # endif <nl> + <nl> + cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + if ( ! cobj ) <nl> + { <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_initWithByteArrays ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setOpacity " , argc , 1 ) ; <nl> + # endif <nl> + <nl> + argc = lua_gettop ( tolua_S ) - 1 ; <nl> + if ( argc = = 2 ) <nl> + { <nl> + const char * arg0 ; <nl> + const char * arg1 ; <nl> + <nl> + std : : string arg0_tmp ; ok & = luaval_to_std_string ( tolua_S , 2 , & arg0_tmp ) ; arg0 = arg0_tmp . c_str ( ) ; <nl> + <nl> + std : : string arg1_tmp ; ok & = luaval_to_std_string ( tolua_S , 3 , & arg1_tmp ) ; arg1 = arg1_tmp . c_str ( ) ; <nl> + if ( ! ok ) <nl> + return 0 ; <nl> + bool ret = cobj - > initWithByteArrays ( arg0 , arg1 ) ; <nl> + tolua_pushboolean ( tolua_S , ( bool ) ret ) ; <nl> + return 1 ; <nl> + } <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " initWithByteArrays " , argc , 2 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setOpacity ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_initWithByteArrays ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_cleanup ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_GLProgram_setUniformLocationWithMatrix4fv ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : Node * cobj = nullptr ; <nl> + cocos2d : : GLProgram * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_Node_cleanup ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_cleanup ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_setUniformLocationWithMatrix4fv ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 0 ) <nl> + if ( argc = = 3 ) <nl> { <nl> + int arg0 ; <nl> + const float * arg1 ; <nl> + unsigned int arg2 ; <nl> + <nl> + ok & = luaval_to_int32 ( tolua_S , 2 , ( int * ) & arg0 ) ; <nl> + <nl> + # pragma warning NO CONVERSION TO NATIVE FOR float * ; <nl> + <nl> + ok & = luaval_to_uint32 ( tolua_S , 4 , & arg2 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > cleanup ( ) ; <nl> + cobj - > setUniformLocationWithMatrix4fv ( arg0 , arg1 , arg2 ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " cleanup " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setUniformLocationWithMatrix4fv " , argc , 3 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_cleanup ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_setUniformLocationWithMatrix4fv ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getComponent ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_GLProgram_initWithFilenames ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : Node * cobj = nullptr ; <nl> + cocos2d : : GLProgram * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_Node_getComponent ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getComponent ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_initWithFilenames ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 1 ) <nl> + if ( argc = = 2 ) <nl> { <nl> std : : string arg0 ; <nl> + std : : string arg1 ; <nl> <nl> ok & = luaval_to_std_string ( tolua_S , 2 , & arg0 ) ; <nl> + <nl> + ok & = luaval_to_std_string ( tolua_S , 3 , & arg1 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cocos2d : : Component * ret = cobj - > getComponent ( arg0 ) ; <nl> - object_to_luaval < cocos2d : : Component > ( tolua_S , " cc . Component " , ( cocos2d : : Component * ) ret ) ; <nl> + bool ret = cobj - > initWithFilenames ( arg0 , arg1 ) ; <nl> + tolua_pushboolean ( tolua_S , ( bool ) ret ) ; <nl> + return 1 ; <nl> + } <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " initWithFilenames " , argc , 2 ) ; <nl> + return 0 ; <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + tolua_lerror : <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_initWithFilenames ' . " , & tolua_err ) ; <nl> + # endif <nl> + <nl> + return 0 ; <nl> + } <nl> + int lua_cocos2dx_GLProgram_getUniformLocationForName ( lua_State * tolua_S ) <nl> + { <nl> + int argc = 0 ; <nl> + cocos2d : : GLProgram * cobj = nullptr ; <nl> + bool ok = true ; <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + tolua_Error tolua_err ; <nl> + # endif <nl> + <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + # endif <nl> + <nl> + cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + if ( ! cobj ) <nl> + { <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_getUniformLocationForName ' " , nullptr ) ; <nl> + return 0 ; <nl> + } <nl> + # endif <nl> + <nl> + argc = lua_gettop ( tolua_S ) - 1 ; <nl> + if ( argc = = 1 ) <nl> + { <nl> + const char * arg0 ; <nl> + <nl> + std : : string arg0_tmp ; ok & = luaval_to_std_string ( tolua_S , 2 , & arg0_tmp ) ; arg0 = arg0_tmp . c_str ( ) ; <nl> + if ( ! ok ) <nl> + return 0 ; <nl> + int ret = cobj - > getUniformLocationForName ( arg0 ) ; <nl> + tolua_pushnumber ( tolua_S , ( lua_Number ) ret ) ; <nl> + return 1 ; <nl> + } <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getUniformLocationForName " , argc , 1 ) ; <nl> + return 0 ; <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + tolua_lerror : <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_getUniformLocationForName ' . " , & tolua_err ) ; <nl> + # endif <nl> + <nl> + return 0 ; <nl> + } <nl> + int lua_cocos2dx_GLProgram_use ( lua_State * tolua_S ) <nl> + { <nl> + int argc = 0 ; <nl> + cocos2d : : GLProgram * cobj = nullptr ; <nl> + bool ok = true ; <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + tolua_Error tolua_err ; <nl> + # endif <nl> + <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + # endif <nl> + <nl> + cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + if ( ! cobj ) <nl> + { <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_use ' " , nullptr ) ; <nl> + return 0 ; <nl> + } <nl> + # endif <nl> + <nl> + argc = lua_gettop ( tolua_S ) - 1 ; <nl> + if ( argc = = 0 ) <nl> + { <nl> + if ( ! ok ) <nl> + return 0 ; <nl> + cobj - > use ( ) ; <nl> + return 0 ; <nl> + } <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " use " , argc , 0 ) ; <nl> + return 0 ; <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + tolua_lerror : <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_use ' . " , & tolua_err ) ; <nl> + # endif <nl> + <nl> + return 0 ; <nl> + } <nl> + int lua_cocos2dx_GLProgram_getVertexShaderLog ( lua_State * tolua_S ) <nl> + { <nl> + int argc = 0 ; <nl> + cocos2d : : GLProgram * cobj = nullptr ; <nl> + bool ok = true ; <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + tolua_Error tolua_err ; <nl> + # endif <nl> + <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + # endif <nl> + <nl> + cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + if ( ! cobj ) <nl> + { <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_getVertexShaderLog ' " , nullptr ) ; <nl> + return 0 ; <nl> + } <nl> + # endif <nl> + <nl> + argc = lua_gettop ( tolua_S ) - 1 ; <nl> + if ( argc = = 0 ) <nl> + { <nl> + if ( ! ok ) <nl> + return 0 ; <nl> + std : : string ret = cobj - > getVertexShaderLog ( ) ; <nl> + tolua_pushcppstring ( tolua_S , ret ) ; <nl> return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getComponent " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getVertexShaderLog " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getComponent ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_getVertexShaderLog ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getContentSize ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_GLProgram_getUniform ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : Node * cobj = nullptr ; <nl> + cocos2d : : GLProgram * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_Node_getContentSize ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getContentSize ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_getUniform ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 0 ) <nl> + if ( argc = = 1 ) <nl> { <nl> + std : : string arg0 ; <nl> + <nl> + ok & = luaval_to_std_string ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - const cocos2d : : Size & ret = cobj - > getContentSize ( ) ; <nl> - size_to_luaval ( tolua_S , ret ) ; <nl> + cocos2d : : Uniform * ret = cobj - > getUniform ( arg0 ) ; <nl> + # pragma warning NO CONVERSION FROM NATIVE FOR Uniform * ; <nl> return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getContentSize " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getUniform " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getContentSize ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_getUniform ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getColor ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_GLProgram_setUniformsForBuiltins ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : Node * cobj = nullptr ; <nl> + cocos2d : : GLProgram * cobj = nullptr ; <nl> bool ok = true ; <nl> - <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_Error tolua_err ; <nl> # endif <nl> <nl> - <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> - <nl> - cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> - <nl> + cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! cobj ) <nl> + if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getColor ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_setUniformsForBuiltins ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> - <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 0 ) <nl> - { <nl> - if ( ! ok ) <nl> + do { <nl> + if ( argc = = 1 ) { <nl> + cocos2d : : Matrix arg0 ; <nl> + ok & = luaval_to_matrix ( tolua_S , 2 , & arg0 ) ; <nl> + <nl> + if ( ! ok ) { break ; } <nl> + cobj - > setUniformsForBuiltins ( arg0 ) ; <nl> return 0 ; <nl> - const cocos2d : : Color3B & ret = cobj - > getColor ( ) ; <nl> - color3b_to_luaval ( tolua_S , ret ) ; <nl> - return 1 ; <nl> - } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getColor " , argc , 0 ) ; <nl> + } <nl> + } while ( 0 ) ; <nl> + ok = true ; <nl> + do { <nl> + if ( argc = = 0 ) { <nl> + cobj - > setUniformsForBuiltins ( ) ; <nl> + return 0 ; <nl> + } <nl> + } while ( 0 ) ; <nl> + ok = true ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setUniformsForBuiltins " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getColor ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_setUniformsForBuiltins ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getBoundingBox ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_GLProgram_setUniformLocationWith3i ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : Node * cobj = nullptr ; <nl> + cocos2d : : GLProgram * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_Node_getBoundingBox ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getBoundingBox ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_setUniformLocationWith3i ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 0 ) <nl> + if ( argc = = 4 ) <nl> { <nl> + int arg0 ; <nl> + int arg1 ; <nl> + int arg2 ; <nl> + int arg3 ; <nl> + <nl> + ok & = luaval_to_int32 ( tolua_S , 2 , ( int * ) & arg0 ) ; <nl> + <nl> + ok & = luaval_to_int32 ( tolua_S , 3 , ( int * ) & arg1 ) ; <nl> + <nl> + ok & = luaval_to_int32 ( tolua_S , 4 , ( int * ) & arg2 ) ; <nl> + <nl> + ok & = luaval_to_int32 ( tolua_S , 5 , ( int * ) & arg3 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cocos2d : : Rect ret = cobj - > getBoundingBox ( ) ; <nl> - rect_to_luaval ( tolua_S , ret ) ; <nl> - return 1 ; <nl> + cobj - > setUniformLocationWith3i ( arg0 , arg1 , arg2 , arg3 ) ; <nl> + return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getBoundingBox " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setUniformLocationWith3i " , argc , 4 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getBoundingBox ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_setUniformLocationWith3i ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_setEventDispatcher ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_GLProgram_setUniformLocationWith3iv ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : Node * cobj = nullptr ; <nl> + cocos2d : : GLProgram * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_Node_setEventDispatcher ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setEventDispatcher ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_setUniformLocationWith3iv ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 1 ) <nl> + if ( argc = = 3 ) <nl> { <nl> - cocos2d : : EventDispatcher * arg0 ; <nl> + int arg0 ; <nl> + int * arg1 ; <nl> + unsigned int arg2 ; <nl> <nl> - ok & = luaval_to_object < cocos2d : : EventDispatcher > ( tolua_S , 2 , " cc . EventDispatcher " , & arg0 ) ; <nl> + ok & = luaval_to_int32 ( tolua_S , 2 , ( int * ) & arg0 ) ; <nl> + <nl> + # pragma warning NO CONVERSION TO NATIVE FOR int * ; <nl> + <nl> + ok & = luaval_to_uint32 ( tolua_S , 4 , & arg2 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > setEventDispatcher ( arg0 ) ; <nl> + cobj - > setUniformLocationWith3iv ( arg0 , arg1 , arg2 ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setEventDispatcher " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setUniformLocationWith3iv " , argc , 3 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setEventDispatcher ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_setUniformLocationWith3iv ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getGlobalZOrder ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_GLProgram_updateUniforms ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : Node * cobj = nullptr ; <nl> + cocos2d : : GLProgram * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_Node_getGlobalZOrder ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getGlobalZOrder ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_updateUniforms ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node_getGlobalZOrder ( lua_State * tolua_S ) <nl> { <nl> if ( ! ok ) <nl> return 0 ; <nl> - double ret = cobj - > getGlobalZOrder ( ) ; <nl> - tolua_pushnumber ( tolua_S , ( lua_Number ) ret ) ; <nl> - return 1 ; <nl> + cobj - > updateUniforms ( ) ; <nl> + return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getGlobalZOrder " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " updateUniforms " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getGlobalZOrder ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_updateUniforms ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_draw ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_GLProgram_setUniformLocationWith4iv ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : Node * cobj = nullptr ; <nl> + cocos2d : : GLProgram * cobj = nullptr ; <nl> bool ok = true ; <nl> + <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_Error tolua_err ; <nl> # endif <nl> <nl> + <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> - cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + <nl> + cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! cobj ) <nl> + if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_draw ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_setUniformLocationWith4iv ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> + <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - do { <nl> - if ( argc = = 0 ) { <nl> - cobj - > draw ( ) ; <nl> - return 0 ; <nl> - } <nl> - } while ( 0 ) ; <nl> - ok = true ; <nl> - do { <nl> - if ( argc = = 3 ) { <nl> - cocos2d : : Renderer * arg0 ; <nl> - ok & = luaval_to_object < cocos2d : : Renderer > ( tolua_S , 2 , " cc . Renderer " , & arg0 ) ; <nl> + if ( argc = = 3 ) <nl> + { <nl> + int arg0 ; <nl> + int * arg1 ; <nl> + unsigned int arg2 ; <nl> <nl> - if ( ! ok ) { break ; } <nl> - cocos2d : : Matrix arg1 ; <nl> - ok & = luaval_to_matrix ( tolua_S , 3 , & arg1 ) ; <nl> + ok & = luaval_to_int32 ( tolua_S , 2 , ( int * ) & arg0 ) ; <nl> <nl> - if ( ! ok ) { break ; } <nl> - bool arg2 ; <nl> - ok & = luaval_to_boolean ( tolua_S , 4 , & arg2 ) ; <nl> + # pragma warning NO CONVERSION TO NATIVE FOR int * ; <nl> <nl> - if ( ! ok ) { break ; } <nl> - cobj - > draw ( arg0 , arg1 , arg2 ) ; <nl> + ok & = luaval_to_uint32 ( tolua_S , 4 , & arg2 ) ; <nl> + if ( ! ok ) <nl> return 0 ; <nl> - } <nl> - } while ( 0 ) ; <nl> - ok = true ; <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " draw " , argc , 3 ) ; <nl> + cobj - > setUniformLocationWith4iv ( arg0 , arg1 , arg2 ) ; <nl> + return 0 ; <nl> + } <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setUniformLocationWith4iv " , argc , 3 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_draw ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_setUniformLocationWith4iv ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_setUserObject ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_GLProgram_getUniformLocation ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : Node * cobj = nullptr ; <nl> + cocos2d : : GLProgram * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_Node_setUserObject ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setUserObject ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_getUniformLocation ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node_setUserObject ( lua_State * tolua_S ) <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> if ( argc = = 1 ) <nl> { <nl> - cocos2d : : Ref * arg0 ; <nl> + std : : string arg0 ; <nl> <nl> - ok & = luaval_to_object < cocos2d : : Ref > ( tolua_S , 2 , " cc . Ref " , & arg0 ) ; <nl> + ok & = luaval_to_std_string ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > setUserObject ( arg0 ) ; <nl> - return 0 ; <nl> + int ret = cobj - > getUniformLocation ( arg0 ) ; <nl> + tolua_pushnumber ( tolua_S , ( lua_Number ) ret ) ; <nl> + return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setUserObject " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getUniformLocation " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setUserObject ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_getUniformLocation ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_removeFromParentAndCleanup ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_GLProgram_setUniformLocationWith1i ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : Node * cobj = nullptr ; <nl> + cocos2d : : GLProgram * cobj = nullptr ; <nl> bool ok = true ; <nl> + <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_Error tolua_err ; <nl> # endif <nl> <nl> + <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> - cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + <nl> + cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! cobj ) <nl> + if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_removeFromParentAndCleanup ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_setUniformLocationWith1i ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> + <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - do { <nl> - if ( argc = = 1 ) { <nl> - bool arg0 ; <nl> - ok & = luaval_to_boolean ( tolua_S , 2 , & arg0 ) ; <nl> + if ( argc = = 2 ) <nl> + { <nl> + int arg0 ; <nl> + int arg1 ; <nl> <nl> - if ( ! ok ) { break ; } <nl> - cobj - > removeFromParentAndCleanup ( arg0 ) ; <nl> - return 0 ; <nl> - } <nl> - } while ( 0 ) ; <nl> - ok = true ; <nl> - do { <nl> - if ( argc = = 0 ) { <nl> - cobj - > removeFromParent ( ) ; <nl> + ok & = luaval_to_int32 ( tolua_S , 2 , ( int * ) & arg0 ) ; <nl> + <nl> + ok & = luaval_to_int32 ( tolua_S , 3 , ( int * ) & arg1 ) ; <nl> + if ( ! ok ) <nl> return 0 ; <nl> - } <nl> - } while ( 0 ) ; <nl> - ok = true ; <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " removeFromParent " , argc , 0 ) ; <nl> + cobj - > setUniformLocationWith1i ( arg0 , arg1 ) ; <nl> + return 0 ; <nl> + } <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setUniformLocationWith1i " , argc , 2 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_removeFromParentAndCleanup ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_setUniformLocationWith1i ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_setPosition3D ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_GLProgram_setUniformLocationWith2iv ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : Node * cobj = nullptr ; <nl> + cocos2d : : GLProgram * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_Node_setPosition3D ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setPosition3D ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_setUniformLocationWith2iv ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 1 ) <nl> + if ( argc = = 3 ) <nl> { <nl> - cocos2d : : Vector3 arg0 ; <nl> + int arg0 ; <nl> + int * arg1 ; <nl> + unsigned int arg2 ; <nl> <nl> - ok & = luaval_to_vector3 ( tolua_S , 2 , & arg0 ) ; <nl> + ok & = luaval_to_int32 ( tolua_S , 2 , ( int * ) & arg0 ) ; <nl> + <nl> + # pragma warning NO CONVERSION TO NATIVE FOR int * ; <nl> + <nl> + ok & = luaval_to_uint32 ( tolua_S , 4 , & arg2 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > setPosition3D ( arg0 ) ; <nl> + cobj - > setUniformLocationWith2iv ( arg0 , arg1 , arg2 ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setPosition3D " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setUniformLocationWith2iv " , argc , 3 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setPosition3D ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_setUniformLocationWith2iv ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_update ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_GLProgram_setUniformLocationWithMatrix3fv ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : Node * cobj = nullptr ; <nl> + cocos2d : : GLProgram * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_Node_update ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_update ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_setUniformLocationWithMatrix3fv ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 1 ) <nl> + if ( argc = = 3 ) <nl> { <nl> - double arg0 ; <nl> + int arg0 ; <nl> + const float * arg1 ; <nl> + unsigned int arg2 ; <nl> <nl> - ok & = luaval_to_number ( tolua_S , 2 , & arg0 ) ; <nl> + ok & = luaval_to_int32 ( tolua_S , 2 , ( int * ) & arg0 ) ; <nl> + <nl> + # pragma warning NO CONVERSION TO NATIVE FOR float * ; <nl> + <nl> + ok & = luaval_to_uint32 ( tolua_S , 4 , & arg2 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > update ( arg0 ) ; <nl> + cobj - > setUniformLocationWithMatrix3fv ( arg0 , arg1 , arg2 ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " update " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setUniformLocationWithMatrix3fv " , argc , 3 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_update ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_setUniformLocationWithMatrix3fv ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_sortAllChildren ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_GLProgram_reset ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : Node * cobj = nullptr ; <nl> + cocos2d : : GLProgram * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_Node_sortAllChildren ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_sortAllChildren ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_reset ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node_sortAllChildren ( lua_State * tolua_S ) <nl> { <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > sortAllChildren ( ) ; <nl> + cobj - > reset ( ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " sortAllChildren " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " reset " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_sortAllChildren ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_reset ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getWorldToNodeTransform ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_GLProgram_bindAttribLocation ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : Node * cobj = nullptr ; <nl> + cocos2d : : GLProgram * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_Node_getWorldToNodeTransform ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getWorldToNodeTransform ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_bindAttribLocation ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 0 ) <nl> + if ( argc = = 2 ) <nl> { <nl> + std : : string arg0 ; <nl> + unsigned int arg1 ; <nl> + <nl> + ok & = luaval_to_std_string ( tolua_S , 2 , & arg0 ) ; <nl> + <nl> + ok & = luaval_to_uint32 ( tolua_S , 3 , & arg1 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cocos2d : : Matrix ret = cobj - > getWorldToNodeTransform ( ) ; <nl> - matrix_to_luaval ( tolua_S , ret ) ; <nl> - return 1 ; <nl> + cobj - > bindAttribLocation ( arg0 , arg1 ) ; <nl> + return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getWorldToNodeTransform " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " bindAttribLocation " , argc , 2 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getWorldToNodeTransform ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_bindAttribLocation ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getScale ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_GLProgram_getAttribLocation ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : Node * cobj = nullptr ; <nl> + cocos2d : : GLProgram * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_Node_getScale ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getScale ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_getAttribLocation ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 0 ) <nl> + if ( argc = = 1 ) <nl> { <nl> + std : : string arg0 ; <nl> + <nl> + ok & = luaval_to_std_string ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - double ret = cobj - > getScale ( ) ; <nl> + int ret = cobj - > getAttribLocation ( arg0 ) ; <nl> tolua_pushnumber ( tolua_S , ( lua_Number ) ret ) ; <nl> return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getScale " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getAttribLocation " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getScale ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_getAttribLocation ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getRotationSkewX ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_GLProgram_getVertexAttrib ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : Node * cobj = nullptr ; <nl> + cocos2d : : GLProgram * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_Node_getRotationSkewX ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getRotationSkewX ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_getVertexAttrib ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 0 ) <nl> + if ( argc = = 1 ) <nl> { <nl> + std : : string arg0 ; <nl> + <nl> + ok & = luaval_to_std_string ( tolua_S , 2 , & arg0 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - double ret = cobj - > getRotationSkewX ( ) ; <nl> - tolua_pushnumber ( tolua_S , ( lua_Number ) ret ) ; <nl> + cocos2d : : VertexAttrib * ret = cobj - > getVertexAttrib ( arg0 ) ; <nl> + # pragma warning NO CONVERSION FROM NATIVE FOR VertexAttrib * ; <nl> return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getRotationSkewX " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getVertexAttrib " , argc , 1 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getRotationSkewX ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_getVertexAttrib ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getRotationSkewY ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_GLProgram_setUniformLocationWithMatrix2fv ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : Node * cobj = nullptr ; <nl> + cocos2d : : GLProgram * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_Node_getRotationSkewY ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getRotationSkewY ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_setUniformLocationWithMatrix2fv ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 0 ) <nl> + if ( argc = = 3 ) <nl> { <nl> + int arg0 ; <nl> + const float * arg1 ; <nl> + unsigned int arg2 ; <nl> + <nl> + ok & = luaval_to_int32 ( tolua_S , 2 , ( int * ) & arg0 ) ; <nl> + <nl> + # pragma warning NO CONVERSION TO NATIVE FOR float * ; <nl> + <nl> + ok & = luaval_to_uint32 ( tolua_S , 4 , & arg2 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - double ret = cobj - > getRotationSkewY ( ) ; <nl> - tolua_pushnumber ( tolua_S , ( lua_Number ) ret ) ; <nl> - return 1 ; <nl> + cobj - > setUniformLocationWithMatrix2fv ( arg0 , arg1 , arg2 ) ; <nl> + return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getRotationSkewY " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setUniformLocationWithMatrix2fv " , argc , 3 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getRotationSkewY ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_setUniformLocationWithMatrix2fv ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_setTag ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_GLProgram_setUniformLocationWith4i ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : Node * cobj = nullptr ; <nl> + cocos2d : : GLProgram * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_Node_setTag ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_setTag ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_setUniformLocationWith4i ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 1 ) <nl> + if ( argc = = 5 ) <nl> { <nl> int arg0 ; <nl> + int arg1 ; <nl> + int arg2 ; <nl> + int arg3 ; <nl> + int arg4 ; <nl> <nl> ok & = luaval_to_int32 ( tolua_S , 2 , ( int * ) & arg0 ) ; <nl> + <nl> + ok & = luaval_to_int32 ( tolua_S , 3 , ( int * ) & arg1 ) ; <nl> + <nl> + ok & = luaval_to_int32 ( tolua_S , 4 , ( int * ) & arg2 ) ; <nl> + <nl> + ok & = luaval_to_int32 ( tolua_S , 5 , ( int * ) & arg3 ) ; <nl> + <nl> + ok & = luaval_to_int32 ( tolua_S , 6 , ( int * ) & arg4 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > setTag ( arg0 ) ; <nl> + cobj - > setUniformLocationWith4i ( arg0 , arg1 , arg2 , arg3 , arg4 ) ; <nl> return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setTag " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setUniformLocationWith4i " , argc , 5 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_setTag ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_setUniformLocationWith4i ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_isCascadeColorEnabled ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_GLProgram_link ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : Node * cobj = nullptr ; <nl> + cocos2d : : GLProgram * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_Node_isCascadeColorEnabled ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_isCascadeColorEnabled ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_link ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> int lua_cocos2dx_Node_isCascadeColorEnabled ( lua_State * tolua_S ) <nl> { <nl> if ( ! ok ) <nl> return 0 ; <nl> - bool ret = cobj - > isCascadeColorEnabled ( ) ; <nl> + bool ret = cobj - > link ( ) ; <nl> tolua_pushboolean ( tolua_S , ( bool ) ret ) ; <nl> return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " isCascadeColorEnabled " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " link " , argc , 0 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_isCascadeColorEnabled ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_link ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_isOpacityModifyRGB ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_GLProgram_setUniformLocationWith2i ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : Node * cobj = nullptr ; <nl> + cocos2d : : GLProgram * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> int lua_cocos2dx_Node_isOpacityModifyRGB ( lua_State * tolua_S ) <nl> <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + cobj = ( cocos2d : : GLProgram * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> if ( ! cobj ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_isOpacityModifyRGB ' " , nullptr ) ; <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_GLProgram_setUniformLocationWith2i ' " , nullptr ) ; <nl> return 0 ; <nl> } <nl> # endif <nl> <nl> argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 0 ) <nl> + if ( argc = = 3 ) <nl> { <nl> + int arg0 ; <nl> + int arg1 ; <nl> + int arg2 ; <nl> + <nl> + ok & = luaval_to_int32 ( tolua_S , 2 , ( int * ) & arg0 ) ; <nl> + <nl> + ok & = luaval_to_int32 ( tolua_S , 3 , ( int * ) & arg1 ) ; <nl> + <nl> + ok & = luaval_to_int32 ( tolua_S , 4 , ( int * ) & arg2 ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - bool ret = cobj - > isOpacityModifyRGB ( ) ; <nl> - tolua_pushboolean ( tolua_S , ( bool ) ret ) ; <nl> - return 1 ; <nl> + cobj - > setUniformLocationWith2i ( arg0 , arg1 , arg2 ) ; <nl> + return 0 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " isOpacityModifyRGB " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " setUniformLocationWith2i " , argc , 3 ) ; <nl> return 0 ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_isOpacityModifyRGB ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_setUniformLocationWith2i ' . " , & tolua_err ) ; <nl> # endif <nl> <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_stopAction ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_GLProgram_createWithByteArrays ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : Node * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_Error tolua_err ; <nl> # endif <nl> <nl> - <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertable ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> <nl> - cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - if ( ! cobj ) <nl> - { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_stopAction ' " , nullptr ) ; <nl> - return 0 ; <nl> - } <nl> - # endif <nl> + argc = lua_gettop ( tolua_S ) - 1 ; <nl> <nl> - argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 1 ) <nl> + if ( argc = = 2 ) <nl> { <nl> - cocos2d : : Action * arg0 ; <nl> - <nl> - ok & = luaval_to_object < cocos2d : : Action > ( tolua_S , 2 , " cc . Action " , & arg0 ) ; <nl> + const char * arg0 ; <nl> + const char * arg1 ; <nl> + std : : string arg0_tmp ; ok & = luaval_to_std_string ( tolua_S , 2 , & arg0_tmp ) ; arg0 = arg0_tmp . c_str ( ) ; <nl> + std : : string arg1_tmp ; ok & = luaval_to_std_string ( tolua_S , 3 , & arg1_tmp ) ; arg1 = arg1_tmp . c_str ( ) ; <nl> if ( ! ok ) <nl> return 0 ; <nl> - cobj - > stopAction ( arg0 ) ; <nl> - return 0 ; <nl> + cocos2d : : GLProgram * ret = cocos2d : : GLProgram : : createWithByteArrays ( arg0 , arg1 ) ; <nl> + object_to_luaval < cocos2d : : GLProgram > ( tolua_S , " cc . GLProgram " , ( cocos2d : : GLProgram * ) ret ) ; <nl> + return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " stopAction " , argc , 1 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " createWithByteArrays " , argc , 2 ) ; <nl> return 0 ; <nl> - <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_stopAction ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_createWithByteArrays ' . " , & tolua_err ) ; <nl> # endif <nl> - <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_getActionManager ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_GLProgram_createWithFilenames ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> - cocos2d : : Node * cobj = nullptr ; <nl> bool ok = true ; <nl> + <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_Error tolua_err ; <nl> # endif <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + if ( ! tolua_isusertable ( tolua_S , 1 , " cc . GLProgram " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> # endif <nl> - cobj = ( cocos2d : : Node * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> - # if COCOS2D_DEBUG > = 1 <nl> - if ( ! cobj ) <nl> + <nl> + argc = lua_gettop ( tolua_S ) - 1 ; <nl> + <nl> + if ( argc = = 2 ) <nl> { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Node_getActionManager ' " , nullptr ) ; <nl> - return 0 ; <nl> + std : : string arg0 ; <nl> + std : : string arg1 ; <nl> + ok & = luaval_to_std_string ( tolua_S , 2 , & arg0 ) ; <nl> + ok & = luaval_to_std_string ( tolua_S , 3 , & arg1 ) ; <nl> + if ( ! ok ) <nl> + return 0 ; <nl> + cocos2d : : GLProgram * ret = cocos2d : : GLProgram : : createWithFilenames ( arg0 , arg1 ) ; <nl> + object_to_luaval < cocos2d : : GLProgram > ( tolua_S , " cc . GLProgram " , ( cocos2d : : GLProgram * ) ret ) ; <nl> + return 1 ; <nl> } <nl> - # endif <nl> - argc = lua_gettop ( tolua_S ) - 1 ; <nl> - do { <nl> - if ( argc = = 0 ) { <nl> - const cocos2d : : ActionManager * ret = cobj - > getActionManager ( ) ; <nl> - object_to_luaval < cocos2d : : ActionManager > ( tolua_S , " cc . ActionManager " , ( cocos2d : : ActionManager * ) ret ) ; <nl> - return 1 ; <nl> - } <nl> - } while ( 0 ) ; <nl> - ok = true ; <nl> - do { <nl> - if ( argc = = 0 ) { <nl> - cocos2d : : ActionManager * ret = cobj - > getActionManager ( ) ; <nl> - object_to_luaval < cocos2d : : ActionManager > ( tolua_S , " cc . ActionManager " , ( cocos2d : : ActionManager * ) ret ) ; <nl> - return 1 ; <nl> - } <nl> - } while ( 0 ) ; <nl> - ok = true ; <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getActionManager " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " createWithFilenames " , argc , 2 ) ; <nl> return 0 ; <nl> - <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_getActionManager ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_createWithFilenames ' . " , & tolua_err ) ; <nl> # endif <nl> - <nl> return 0 ; <nl> } <nl> - int lua_cocos2dx_Node_create ( lua_State * tolua_S ) <nl> + int lua_cocos2dx_GLProgram_constructor ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> + cocos2d : : GLProgram * cobj = nullptr ; <nl> bool ok = true ; <nl> <nl> # if COCOS2D_DEBUG > = 1 <nl> tolua_Error tolua_err ; <nl> # endif <nl> <nl> - # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertable ( tolua_S , 1 , " cc . Node " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> - # endif <nl> <nl> - argc = lua_gettop ( tolua_S ) - 1 ; <nl> <nl> - if ( argc = = 0 ) <nl> + argc = lua_gettop ( tolua_S ) - 1 ; <nl> + if ( argc = = 0 ) <nl> { <nl> if ( ! ok ) <nl> return 0 ; <nl> - cocos2d : : Node * ret = cocos2d : : Node : : create ( ) ; <nl> - object_to_luaval < cocos2d : : Node > ( tolua_S , " cc . Node " , ( cocos2d : : Node * ) ret ) ; <nl> + cobj = new cocos2d : : GLProgram ( ) ; <nl> + cobj - > autorelease ( ) ; <nl> + int ID = ( int ) cobj - > _ID ; <nl> + int * luaID = & cobj - > _luaID ; <nl> + toluafix_pushusertype_ccobject ( tolua_S , ID , luaID , ( void * ) cobj , " cc . GLProgram " ) ; <nl> return 1 ; <nl> } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " create " , argc , 0 ) ; <nl> + CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " GLProgram " , argc , 0 ) ; <nl> return 0 ; <nl> + <nl> # if COCOS2D_DEBUG > = 1 <nl> - tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Node_create ' . " , & tolua_err ) ; <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_GLProgram_constructor ' . " , & tolua_err ) ; <nl> # endif <nl> + <nl> return 0 ; <nl> } <nl> - static int lua_cocos2dx_Node_finalize ( lua_State * tolua_S ) <nl> + <nl> + static int lua_cocos2dx_GLProgram_finalize ( lua_State * tolua_S ) <nl> { <nl> - printf ( " luabindings : finalizing LUA object ( Node ) " ) ; <nl> + printf ( " luabindings : finalizing LUA object ( GLProgram ) " ) ; <nl> return 0 ; <nl> } <nl> <nl> - int lua_register_cocos2dx_Node ( lua_State * tolua_S ) <nl> + int lua_register_cocos2dx_GLProgram ( lua_State * tolua_S ) <nl> { <nl> - tolua_usertype ( tolua_S , " cc . Node " ) ; <nl> - tolua_cclass ( tolua_S , " Node " , " cc . Node " , " cc . Ref " , nullptr ) ; <nl> + tolua_usertype ( tolua_S , " cc . GLProgram " ) ; <nl> + tolua_cclass ( tolua_S , " GLProgram " , " cc . GLProgram " , " cc . Ref " , nullptr ) ; <nl> <nl> - tolua_beginmodule ( tolua_S , " Node " ) ; <nl> - tolua_function ( tolua_S , " addChild " , lua_cocos2dx_Node_addChild ) ; <nl> - tolua_function ( tolua_S , " removeComponent " , lua_cocos2dx_Node_removeComponent ) ; <nl> - tolua_function ( tolua_S , " setPhysicsBody " , lua_cocos2dx_Node_setPhysicsBody ) ; <nl> - tolua_function ( tolua_S , " getShaderProgram " , lua_cocos2dx_Node_getShaderProgram ) ; <nl> - tolua_function ( tolua_S , " getDescription " , lua_cocos2dx_Node_getDescription ) ; <nl> - tolua_function ( tolua_S , " setRotationSkewY " , lua_cocos2dx_Node_setRotationSkewY ) ; <nl> - tolua_function ( tolua_S , " setOpacityModifyRGB " , lua_cocos2dx_Node_setOpacityModifyRGB ) ; <nl> - tolua_function ( tolua_S , " setCascadeOpacityEnabled " , lua_cocos2dx_Node_setCascadeOpacityEnabled ) ; <nl> - tolua_function ( tolua_S , " getChildren " , lua_cocos2dx_Node_getChildren ) ; <nl> - tolua_function ( tolua_S , " pause " , lua_cocos2dx_Node_pause ) ; <nl> - tolua_function ( tolua_S , " convertToWorldSpaceAR " , lua_cocos2dx_Node_convertToWorldSpaceAR ) ; <nl> - tolua_function ( tolua_S , " isIgnoreAnchorPointForPosition " , lua_cocos2dx_Node_isIgnoreAnchorPointForPosition ) ; <nl> - tolua_function ( tolua_S , " updateDisplayedOpacity " , lua_cocos2dx_Node_updateDisplayedOpacity ) ; <nl> - tolua_function ( tolua_S , " setRotation " , lua_cocos2dx_Node_setRotation ) ; <nl> - tolua_function ( tolua_S , " setScaleZ " , lua_cocos2dx_Node_setScaleZ ) ; <nl> - tolua_function ( tolua_S , " setScaleY " , lua_cocos2dx_Node_setScaleY ) ; <nl> - tolua_function ( tolua_S , " setScaleX " , lua_cocos2dx_Node_setScaleX ) ; <nl> - tolua_function ( tolua_S , " setRotationSkewX " , lua_cocos2dx_Node_setRotationSkewX ) ; <nl> - tolua_function ( tolua_S , " removeAllComponents " , lua_cocos2dx_Node_removeAllComponents ) ; <nl> - tolua_function ( tolua_S , " _setLocalZOrder " , lua_cocos2dx_Node__setLocalZOrder ) ; <nl> - tolua_function ( tolua_S , " getTag " , lua_cocos2dx_Node_getTag ) ; <nl> - tolua_function ( tolua_S , " getNodeToWorldAffineTransform " , lua_cocos2dx_Node_getNodeToWorldAffineTransform ) ; <nl> - tolua_function ( tolua_S , " getNodeToWorldTransform " , lua_cocos2dx_Node_getNodeToWorldTransform ) ; <nl> - tolua_function ( tolua_S , " getPosition3D " , lua_cocos2dx_Node_getPosition3D ) ; <nl> - tolua_function ( tolua_S , " removeChild " , lua_cocos2dx_Node_removeChild ) ; <nl> - tolua_function ( tolua_S , " convertToWorldSpace " , lua_cocos2dx_Node_convertToWorldSpace ) ; <nl> - tolua_function ( tolua_S , " getScene " , lua_cocos2dx_Node_getScene ) ; <nl> - tolua_function ( tolua_S , " getEventDispatcher " , lua_cocos2dx_Node_getEventDispatcher ) ; <nl> - tolua_function ( tolua_S , " setSkewX " , lua_cocos2dx_Node_setSkewX ) ; <nl> - tolua_function ( tolua_S , " setSkewY " , lua_cocos2dx_Node_setSkewY ) ; <nl> - tolua_function ( tolua_S , " getOpacity " , lua_cocos2dx_Node_getOpacity ) ; <nl> - tolua_function ( tolua_S , " convertTouchToNodeSpace " , lua_cocos2dx_Node_convertTouchToNodeSpace ) ; <nl> - tolua_function ( tolua_S , " removeAllChildren " , lua_cocos2dx_Node_removeAllChildrenWithCleanup ) ; <nl> - tolua_function ( tolua_S , " getNodeToParentAffineTransform " , lua_cocos2dx_Node_getNodeToParentAffineTransform ) ; <nl> - tolua_function ( tolua_S , " isCascadeOpacityEnabled " , lua_cocos2dx_Node_isCascadeOpacityEnabled ) ; <nl> - tolua_function ( tolua_S , " setParent " , lua_cocos2dx_Node_setParent ) ; <nl> - tolua_function ( tolua_S , " getRotation3D " , lua_cocos2dx_Node_getRotation3D ) ; <nl> - tolua_function ( tolua_S , " getNodeToParentTransform " , lua_cocos2dx_Node_getNodeToParentTransform ) ; <nl> - tolua_function ( tolua_S , " convertTouchToNodeSpaceAR " , lua_cocos2dx_Node_convertTouchToNodeSpaceAR ) ; <nl> - tolua_function ( tolua_S , " convertToNodeSpace " , lua_cocos2dx_Node_convertToNodeSpace ) ; <nl> - tolua_function ( tolua_S , " resume " , lua_cocos2dx_Node_resume ) ; <nl> - tolua_function ( tolua_S , " getPhysicsBody " , lua_cocos2dx_Node_getPhysicsBody ) ; <nl> - tolua_function ( tolua_S , " setPosition " , lua_cocos2dx_Node_setPosition ) ; <nl> - tolua_function ( tolua_S , " stopActionByTag " , lua_cocos2dx_Node_stopActionByTag ) ; <nl> - tolua_function ( tolua_S , " reorderChild " , lua_cocos2dx_Node_reorderChild ) ; <nl> - tolua_function ( tolua_S , " ignoreAnchorPointForPosition " , lua_cocos2dx_Node_ignoreAnchorPointForPosition ) ; <nl> - tolua_function ( tolua_S , " setPositionZ " , lua_cocos2dx_Node_setPositionZ ) ; <nl> - tolua_function ( tolua_S , " setRotation3D " , lua_cocos2dx_Node_setRotation3D ) ; <nl> - tolua_function ( tolua_S , " setPositionX " , lua_cocos2dx_Node_setPositionX ) ; <nl> - tolua_function ( tolua_S , " setNodeToParentTransform " , lua_cocos2dx_Node_setNodeToParentTransform ) ; <nl> - tolua_function ( tolua_S , " getAnchorPoint " , lua_cocos2dx_Node_getAnchorPoint ) ; <nl> - tolua_function ( tolua_S , " getNumberOfRunningActions " , lua_cocos2dx_Node_getNumberOfRunningActions ) ; <nl> - tolua_function ( tolua_S , " updateTransform " , lua_cocos2dx_Node_updateTransform ) ; <nl> - tolua_function ( tolua_S , " isVisible " , lua_cocos2dx_Node_isVisible ) ; <nl> - tolua_function ( tolua_S , " getChildrenCount " , lua_cocos2dx_Node_getChildrenCount ) ; <nl> - tolua_function ( tolua_S , " convertToNodeSpaceAR " , lua_cocos2dx_Node_convertToNodeSpaceAR ) ; <nl> - tolua_function ( tolua_S , " addComponent " , lua_cocos2dx_Node_addComponent ) ; <nl> - tolua_function ( tolua_S , " setShaderProgram " , lua_cocos2dx_Node_setShaderProgram ) ; <nl> - tolua_function ( tolua_S , " getRotation " , lua_cocos2dx_Node_getRotation ) ; <nl> - tolua_function ( tolua_S , " getAnchorPointInPoints " , lua_cocos2dx_Node_getAnchorPointInPoints ) ; <nl> - tolua_function ( tolua_S , " runAction " , lua_cocos2dx_Node_runAction ) ; <nl> - tolua_function ( tolua_S , " setScheduler " , lua_cocos2dx_Node_setScheduler ) ; <nl> - tolua_function ( tolua_S , " stopAllActions " , lua_cocos2dx_Node_stopAllActions ) ; <nl> - tolua_function ( tolua_S , " getSkewX " , lua_cocos2dx_Node_getSkewX ) ; <nl> - tolua_function ( tolua_S , " getSkewY " , lua_cocos2dx_Node_getSkewY ) ; <nl> - tolua_function ( tolua_S , " getDisplayedColor " , lua_cocos2dx_Node_getDisplayedColor ) ; <nl> - tolua_function ( tolua_S , " getActionByTag " , lua_cocos2dx_Node_getActionByTag ) ; <nl> - tolua_function ( tolua_S , " setAdditionalTransform " , lua_cocos2dx_Node_setAdditionalTransform ) ; <nl> - tolua_function ( tolua_S , " getDisplayedOpacity " , lua_cocos2dx_Node_getDisplayedOpacity ) ; <nl> - tolua_function ( tolua_S , " getLocalZOrder " , lua_cocos2dx_Node_getLocalZOrder ) ; <nl> - tolua_function ( tolua_S , " getScheduler " , lua_cocos2dx_Node_getScheduler ) ; <nl> - tolua_function ( tolua_S , " getParentToNodeAffineTransform " , lua_cocos2dx_Node_getParentToNodeAffineTransform ) ; <nl> - tolua_function ( tolua_S , " getOrderOfArrival " , lua_cocos2dx_Node_getOrderOfArrival ) ; <nl> - tolua_function ( tolua_S , " setActionManager " , lua_cocos2dx_Node_setActionManager ) ; <nl> - tolua_function ( tolua_S , " setColor " , lua_cocos2dx_Node_setColor ) ; <nl> - tolua_function ( tolua_S , " isRunning " , lua_cocos2dx_Node_isRunning ) ; <nl> - tolua_function ( tolua_S , " getParent " , lua_cocos2dx_Node_getParent ) ; <nl> - tolua_function ( tolua_S , " getPositionZ " , lua_cocos2dx_Node_getPositionZ ) ; <nl> - tolua_function ( tolua_S , " getPositionY " , lua_cocos2dx_Node_getPositionY ) ; <nl> - tolua_function ( tolua_S , " getPositionX " , lua_cocos2dx_Node_getPositionX ) ; <nl> - tolua_function ( tolua_S , " removeChildByTag " , lua_cocos2dx_Node_removeChildByTag ) ; <nl> - tolua_function ( tolua_S , " setPositionY " , lua_cocos2dx_Node_setPositionY ) ; <nl> - tolua_function ( tolua_S , " updateDisplayedColor " , lua_cocos2dx_Node_updateDisplayedColor ) ; <nl> - tolua_function ( tolua_S , " setVisible " , lua_cocos2dx_Node_setVisible ) ; <nl> - tolua_function ( tolua_S , " getParentToNodeTransform " , lua_cocos2dx_Node_getParentToNodeTransform ) ; <nl> - tolua_function ( tolua_S , " setGlobalZOrder " , lua_cocos2dx_Node_setGlobalZOrder ) ; <nl> - tolua_function ( tolua_S , " setScale " , lua_cocos2dx_Node_setScale ) ; <nl> - tolua_function ( tolua_S , " getChildByTag " , lua_cocos2dx_Node_getChildByTag ) ; <nl> - tolua_function ( tolua_S , " setOrderOfArrival " , lua_cocos2dx_Node_setOrderOfArrival ) ; <nl> - tolua_function ( tolua_S , " getScaleZ " , lua_cocos2dx_Node_getScaleZ ) ; <nl> - tolua_function ( tolua_S , " getScaleY " , lua_cocos2dx_Node_getScaleY ) ; <nl> - tolua_function ( tolua_S , " getScaleX " , lua_cocos2dx_Node_getScaleX ) ; <nl> - tolua_function ( tolua_S , " setLocalZOrder " , lua_cocos2dx_Node_setLocalZOrder ) ; <nl> - tolua_function ( tolua_S , " getWorldToNodeAffineTransform " , lua_cocos2dx_Node_getWorldToNodeAffineTransform ) ; <nl> - tolua_function ( tolua_S , " setCascadeColorEnabled " , lua_cocos2dx_Node_setCascadeColorEnabled ) ; <nl> - tolua_function ( tolua_S , " setOpacity " , lua_cocos2dx_Node_setOpacity ) ; <nl> - tolua_function ( tolua_S , " cleanup " , lua_cocos2dx_Node_cleanup ) ; <nl> - tolua_function ( tolua_S , " getComponent " , lua_cocos2dx_Node_getComponent ) ; <nl> - tolua_function ( tolua_S , " getContentSize " , lua_cocos2dx_Node_getContentSize ) ; <nl> - tolua_function ( tolua_S , " getColor " , lua_cocos2dx_Node_getColor ) ; <nl> - tolua_function ( tolua_S , " getBoundingBox " , lua_cocos2dx_Node_getBoundingBox ) ; <nl> - tolua_function ( tolua_S , " setEventDispatcher " , lua_cocos2dx_Node_setEventDispatcher ) ; <nl> - tolua_function ( tolua_S , " getGlobalZOrder " , lua_cocos2dx_Node_getGlobalZOrder ) ; <nl> - tolua_function ( tolua_S , " draw " , lua_cocos2dx_Node_draw ) ; <nl> - tolua_function ( tolua_S , " setUserObject " , lua_cocos2dx_Node_setUserObject ) ; <nl> - tolua_function ( tolua_S , " removeFromParent " , lua_cocos2dx_Node_removeFromParentAndCleanup ) ; <nl> - tolua_function ( tolua_S , " setPosition3D " , lua_cocos2dx_Node_setPosition3D ) ; <nl> - tolua_function ( tolua_S , " update " , lua_cocos2dx_Node_update ) ; <nl> - tolua_function ( tolua_S , " sortAllChildren " , lua_cocos2dx_Node_sortAllChildren ) ; <nl> - tolua_function ( tolua_S , " getWorldToNodeTransform " , lua_cocos2dx_Node_getWorldToNodeTransform ) ; <nl> - tolua_function ( tolua_S , " getScale " , lua_cocos2dx_Node_getScale ) ; <nl> - tolua_function ( tolua_S , " getRotationSkewX " , lua_cocos2dx_Node_getRotationSkewX ) ; <nl> - tolua_function ( tolua_S , " getRotationSkewY " , lua_cocos2dx_Node_getRotationSkewY ) ; <nl> - tolua_function ( tolua_S , " setTag " , lua_cocos2dx_Node_setTag ) ; <nl> - tolua_function ( tolua_S , " isCascadeColorEnabled " , lua_cocos2dx_Node_isCascadeColorEnabled ) ; <nl> - tolua_function ( tolua_S , " isOpacityModifyRGB " , lua_cocos2dx_Node_isOpacityModifyRGB ) ; <nl> - tolua_function ( tolua_S , " stopAction " , lua_cocos2dx_Node_stopAction ) ; <nl> - tolua_function ( tolua_S , " getActionManager " , lua_cocos2dx_Node_getActionManager ) ; <nl> - tolua_function ( tolua_S , " create " , lua_cocos2dx_Node_create ) ; <nl> + tolua_beginmodule ( tolua_S , " GLProgram " ) ; <nl> + tolua_function ( tolua_S , " getFragmentShaderLog " , lua_cocos2dx_GLProgram_getFragmentShaderLog ) ; <nl> + tolua_function ( tolua_S , " initWithByteArrays " , lua_cocos2dx_GLProgram_initWithByteArrays ) ; <nl> + tolua_function ( tolua_S , " setUniformLocationWithMatrix4fv " , lua_cocos2dx_GLProgram_setUniformLocationWithMatrix4fv ) ; <nl> + tolua_function ( tolua_S , " initWithFilenames " , lua_cocos2dx_GLProgram_initWithFilenames ) ; <nl> + tolua_function ( tolua_S , " getUniformLocationForName " , lua_cocos2dx_GLProgram_getUniformLocationForName ) ; <nl> + tolua_function ( tolua_S , " use " , lua_cocos2dx_GLProgram_use ) ; <nl> + tolua_function ( tolua_S , " getVertexShaderLog " , lua_cocos2dx_GLProgram_getVertexShaderLog ) ; <nl> + tolua_function ( tolua_S , " getUniform " , lua_cocos2dx_GLProgram_getUniform ) ; <nl> + tolua_function ( tolua_S , " setUniformsForBuiltins " , lua_cocos2dx_GLProgram_setUniformsForBuiltins ) ; <nl> + tolua_function ( tolua_S , " setUniformLocationWith3i " , lua_cocos2dx_GLProgram_setUniformLocationWith3i ) ; <nl> + tolua_function ( tolua_S , " setUniformLocationWith3iv " , lua_cocos2dx_GLProgram_setUniformLocationWith3iv ) ; <nl> + tolua_function ( tolua_S , " updateUniforms " , lua_cocos2dx_GLProgram_updateUniforms ) ; <nl> + tolua_function ( tolua_S , " setUniformLocationWith4iv " , lua_cocos2dx_GLProgram_setUniformLocationWith4iv ) ; <nl> + tolua_function ( tolua_S , " getUniformLocation " , lua_cocos2dx_GLProgram_getUniformLocation ) ; <nl> + tolua_function ( tolua_S , " setUniformLocationI32 " , lua_cocos2dx_GLProgram_setUniformLocationWith1i ) ; <nl> + tolua_function ( tolua_S , " setUniformLocationWith2iv " , lua_cocos2dx_GLProgram_setUniformLocationWith2iv ) ; <nl> + tolua_function ( tolua_S , " setUniformLocationWithMatrix3fv " , lua_cocos2dx_GLProgram_setUniformLocationWithMatrix3fv ) ; <nl> + tolua_function ( tolua_S , " reset " , lua_cocos2dx_GLProgram_reset ) ; <nl> + tolua_function ( tolua_S , " bindAttribLocation " , lua_cocos2dx_GLProgram_bindAttribLocation ) ; <nl> + tolua_function ( tolua_S , " getAttribLocation " , lua_cocos2dx_GLProgram_getAttribLocation ) ; <nl> + tolua_function ( tolua_S , " getVertexAttrib " , lua_cocos2dx_GLProgram_getVertexAttrib ) ; <nl> + tolua_function ( tolua_S , " setUniformLocationWithMatrix2fv " , lua_cocos2dx_GLProgram_setUniformLocationWithMatrix2fv ) ; <nl> + tolua_function ( tolua_S , " setUniformLocationWith4i " , lua_cocos2dx_GLProgram_setUniformLocationWith4i ) ; <nl> + tolua_function ( tolua_S , " link " , lua_cocos2dx_GLProgram_link ) ; <nl> + tolua_function ( tolua_S , " setUniformLocationWith2i " , lua_cocos2dx_GLProgram_setUniformLocationWith2i ) ; <nl> + tolua_function ( tolua_S , " new " , lua_cocos2dx_GLProgram_constructor ) ; <nl> + tolua_function ( tolua_S , " createWithByteArrays " , lua_cocos2dx_GLProgram_createWithByteArrays ) ; <nl> + tolua_function ( tolua_S , " createWithFilenames " , lua_cocos2dx_GLProgram_createWithFilenames ) ; <nl> tolua_endmodule ( tolua_S ) ; <nl> - std : : string typeName = typeid ( cocos2d : : Node ) . name ( ) ; <nl> - g_luaType [ typeName ] = " cc . Node " ; <nl> - g_typeCast [ " Node " ] = " cc . Node " ; <nl> + std : : string typeName = typeid ( cocos2d : : GLProgram ) . name ( ) ; <nl> + g_luaType [ typeName ] = " cc . GLProgram " ; <nl> + g_typeCast [ " GLProgram " ] = " cc . GLProgram " ; <nl> return 1 ; <nl> } <nl> <nl> int lua_register_cocos2dx_GLView ( lua_State * tolua_S ) <nl> return 1 ; <nl> } <nl> <nl> - int lua_cocos2dx_ShaderCache_reloadDefaultShaders ( lua_State * tolua_S ) <nl> - { <nl> - int argc = 0 ; <nl> - cocos2d : : ShaderCache * cobj = nullptr ; <nl> - bool ok = true ; <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - tolua_Error tolua_err ; <nl> - # endif <nl> - <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . ShaderCache " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> - # endif <nl> - <nl> - cobj = ( cocos2d : : ShaderCache * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - if ( ! cobj ) <nl> - { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_ShaderCache_reloadDefaultShaders ' " , nullptr ) ; <nl> - return 0 ; <nl> - } <nl> - # endif <nl> - <nl> - argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 0 ) <nl> - { <nl> - if ( ! ok ) <nl> - return 0 ; <nl> - cobj - > reloadDefaultShaders ( ) ; <nl> - return 0 ; <nl> - } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " reloadDefaultShaders " , argc , 0 ) ; <nl> - return 0 ; <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_ShaderCache_reloadDefaultShaders ' . " , & tolua_err ) ; <nl> - # endif <nl> - <nl> - return 0 ; <nl> - } <nl> - int lua_cocos2dx_ShaderCache_addProgram ( lua_State * tolua_S ) <nl> - { <nl> - int argc = 0 ; <nl> - cocos2d : : ShaderCache * cobj = nullptr ; <nl> - bool ok = true ; <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - tolua_Error tolua_err ; <nl> - # endif <nl> - <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . ShaderCache " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> - # endif <nl> - <nl> - cobj = ( cocos2d : : ShaderCache * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - if ( ! cobj ) <nl> - { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_ShaderCache_addProgram ' " , nullptr ) ; <nl> - return 0 ; <nl> - } <nl> - # endif <nl> - <nl> - argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 2 ) <nl> - { <nl> - cocos2d : : GLProgram * arg0 ; <nl> - std : : string arg1 ; <nl> - <nl> - ok & = luaval_to_object < cocos2d : : GLProgram > ( tolua_S , 2 , " cc . GLProgram " , & arg0 ) ; <nl> - <nl> - ok & = luaval_to_std_string ( tolua_S , 3 , & arg1 ) ; <nl> - if ( ! ok ) <nl> - return 0 ; <nl> - cobj - > addProgram ( arg0 , arg1 ) ; <nl> - return 0 ; <nl> - } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " addProgram " , argc , 2 ) ; <nl> - return 0 ; <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_ShaderCache_addProgram ' . " , & tolua_err ) ; <nl> - # endif <nl> - <nl> - return 0 ; <nl> - } <nl> - int lua_cocos2dx_ShaderCache_getProgram ( lua_State * tolua_S ) <nl> - { <nl> - int argc = 0 ; <nl> - cocos2d : : ShaderCache * cobj = nullptr ; <nl> - bool ok = true ; <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - tolua_Error tolua_err ; <nl> - # endif <nl> - <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . ShaderCache " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> - # endif <nl> - <nl> - cobj = ( cocos2d : : ShaderCache * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - if ( ! cobj ) <nl> - { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_ShaderCache_getProgram ' " , nullptr ) ; <nl> - return 0 ; <nl> - } <nl> - # endif <nl> - <nl> - argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 1 ) <nl> - { <nl> - std : : string arg0 ; <nl> - <nl> - ok & = luaval_to_std_string ( tolua_S , 2 , & arg0 ) ; <nl> - if ( ! ok ) <nl> - return 0 ; <nl> - cocos2d : : GLProgram * ret = cobj - > getProgram ( arg0 ) ; <nl> - object_to_luaval < cocos2d : : GLProgram > ( tolua_S , " cc . GLProgram " , ( cocos2d : : GLProgram * ) ret ) ; <nl> - return 1 ; <nl> - } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getProgram " , argc , 1 ) ; <nl> - return 0 ; <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_ShaderCache_getProgram ' . " , & tolua_err ) ; <nl> - # endif <nl> - <nl> - return 0 ; <nl> - } <nl> - int lua_cocos2dx_ShaderCache_loadDefaultShaders ( lua_State * tolua_S ) <nl> - { <nl> - int argc = 0 ; <nl> - cocos2d : : ShaderCache * cobj = nullptr ; <nl> - bool ok = true ; <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - tolua_Error tolua_err ; <nl> - # endif <nl> - <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertype ( tolua_S , 1 , " cc . ShaderCache " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> - # endif <nl> - <nl> - cobj = ( cocos2d : : ShaderCache * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - if ( ! cobj ) <nl> - { <nl> - tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_ShaderCache_loadDefaultShaders ' " , nullptr ) ; <nl> - return 0 ; <nl> - } <nl> - # endif <nl> - <nl> - argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 0 ) <nl> - { <nl> - if ( ! ok ) <nl> - return 0 ; <nl> - cobj - > loadDefaultShaders ( ) ; <nl> - return 0 ; <nl> - } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " loadDefaultShaders " , argc , 0 ) ; <nl> - return 0 ; <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_ShaderCache_loadDefaultShaders ' . " , & tolua_err ) ; <nl> - # endif <nl> - <nl> - return 0 ; <nl> - } <nl> - int lua_cocos2dx_ShaderCache_destroyInstance ( lua_State * tolua_S ) <nl> - { <nl> - int argc = 0 ; <nl> - bool ok = true ; <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - tolua_Error tolua_err ; <nl> - # endif <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertable ( tolua_S , 1 , " cc . ShaderCache " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> - # endif <nl> - <nl> - argc = lua_gettop ( tolua_S ) - 1 ; <nl> - <nl> - if ( argc = = 0 ) <nl> - { <nl> - if ( ! ok ) <nl> - return 0 ; <nl> - cocos2d : : ShaderCache : : destroyInstance ( ) ; <nl> - return 0 ; <nl> - } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " destroyInstance " , argc , 0 ) ; <nl> - return 0 ; <nl> - # if COCOS2D_DEBUG > = 1 <nl> - tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_ShaderCache_destroyInstance ' . " , & tolua_err ) ; <nl> - # endif <nl> - return 0 ; <nl> - } <nl> - int lua_cocos2dx_ShaderCache_getInstance ( lua_State * tolua_S ) <nl> - { <nl> - int argc = 0 ; <nl> - bool ok = true ; <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - tolua_Error tolua_err ; <nl> - # endif <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - if ( ! tolua_isusertable ( tolua_S , 1 , " cc . ShaderCache " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> - # endif <nl> - <nl> - argc = lua_gettop ( tolua_S ) - 1 ; <nl> - <nl> - if ( argc = = 0 ) <nl> - { <nl> - if ( ! ok ) <nl> - return 0 ; <nl> - cocos2d : : ShaderCache * ret = cocos2d : : GLProgramCache : : getInstance ( ) ; <nl> - object_to_luaval < cocos2d : : ShaderCache > ( tolua_S , " cc . ShaderCache " , ( cocos2d : : ShaderCache * ) ret ) ; <nl> - return 1 ; <nl> - } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " getInstance " , argc , 0 ) ; <nl> - return 0 ; <nl> - # if COCOS2D_DEBUG > = 1 <nl> - tolua_lerror : <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_ShaderCache_getInstance ' . " , & tolua_err ) ; <nl> - # endif <nl> - return 0 ; <nl> - } <nl> - int lua_cocos2dx_ShaderCache_constructor ( lua_State * tolua_S ) <nl> - { <nl> - int argc = 0 ; <nl> - cocos2d : : ShaderCache * cobj = nullptr ; <nl> - bool ok = true ; <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - tolua_Error tolua_err ; <nl> - # endif <nl> - <nl> - <nl> - <nl> - argc = lua_gettop ( tolua_S ) - 1 ; <nl> - if ( argc = = 0 ) <nl> - { <nl> - if ( ! ok ) <nl> - return 0 ; <nl> - cobj = new cocos2d : : ShaderCache ( ) ; <nl> - cobj - > autorelease ( ) ; <nl> - int ID = ( int ) cobj - > _ID ; <nl> - int * luaID = & cobj - > _luaID ; <nl> - toluafix_pushusertype_ccobject ( tolua_S , ID , luaID , ( void * ) cobj , " cc . ShaderCache " ) ; <nl> - return 1 ; <nl> - } <nl> - CCLOG ( " % s has wrong number of arguments : % d , was expecting % d \ n " , " ShaderCache " , argc , 0 ) ; <nl> - return 0 ; <nl> - <nl> - # if COCOS2D_DEBUG > = 1 <nl> - tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_ShaderCache_constructor ' . " , & tolua_err ) ; <nl> - # endif <nl> - <nl> - return 0 ; <nl> - } <nl> - <nl> - static int lua_cocos2dx_ShaderCache_finalize ( lua_State * tolua_S ) <nl> - { <nl> - printf ( " luabindings : finalizing LUA object ( ShaderCache ) " ) ; <nl> - return 0 ; <nl> - } <nl> - <nl> - int lua_register_cocos2dx_ShaderCache ( lua_State * tolua_S ) <nl> - { <nl> - tolua_usertype ( tolua_S , " cc . ShaderCache " ) ; <nl> - tolua_cclass ( tolua_S , " ShaderCache " , " cc . ShaderCache " , " cc . Ref " , nullptr ) ; <nl> - <nl> - tolua_beginmodule ( tolua_S , " ShaderCache " ) ; <nl> - tolua_function ( tolua_S , " reloadDefaultShaders " , lua_cocos2dx_ShaderCache_reloadDefaultShaders ) ; <nl> - tolua_function ( tolua_S , " addProgram " , lua_cocos2dx_ShaderCache_addProgram ) ; <nl> - tolua_function ( tolua_S , " getProgram " , lua_cocos2dx_ShaderCache_getProgram ) ; <nl> - tolua_function ( tolua_S , " loadDefaultShaders " , lua_cocos2dx_ShaderCache_loadDefaultShaders ) ; <nl> - tolua_function ( tolua_S , " new " , lua_cocos2dx_ShaderCache_constructor ) ; <nl> - tolua_function ( tolua_S , " destroyInstance " , lua_cocos2dx_ShaderCache_destroyInstance ) ; <nl> - tolua_function ( tolua_S , " getInstance " , lua_cocos2dx_ShaderCache_getInstance ) ; <nl> - tolua_endmodule ( tolua_S ) ; <nl> - std : : string typeName = typeid ( cocos2d : : ShaderCache ) . name ( ) ; <nl> - g_luaType [ typeName ] = " cc . ShaderCache " ; <nl> - g_typeCast [ " ShaderCache " ] = " cc . ShaderCache " ; <nl> - return 1 ; <nl> - } <nl> - <nl> int lua_cocos2dx_AnimationCache_getAnimation ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> TOLUA_API int register_all_cocos2dx ( lua_State * tolua_S ) <nl> lua_register_cocos2dx_FiniteTimeAction ( tolua_S ) ; <nl> lua_register_cocos2dx_ActionInstant ( tolua_S ) ; <nl> lua_register_cocos2dx_Hide ( tolua_S ) ; <nl> - lua_register_cocos2dx_Scheduler ( tolua_S ) ; <nl> + lua_register_cocos2dx_ParticleSystem ( tolua_S ) ; <nl> + lua_register_cocos2dx_ParticleSystemQuad ( tolua_S ) ; <nl> + lua_register_cocos2dx_ParticleSpiral ( tolua_S ) ; <nl> lua_register_cocos2dx_GridBase ( tolua_S ) ; <nl> lua_register_cocos2dx_AnimationCache ( tolua_S ) ; <nl> lua_register_cocos2dx_ActionInterval ( tolua_S ) ; <nl> TOLUA_API int register_all_cocos2dx ( lua_State * tolua_S ) <nl> lua_register_cocos2dx_EventListenerMouse ( tolua_S ) ; <nl> lua_register_cocos2dx_TransitionRotoZoom ( tolua_S ) ; <nl> lua_register_cocos2dx_Director ( tolua_S ) ; <nl> - lua_register_cocos2dx_Texture2D ( tolua_S ) ; <nl> + lua_register_cocos2dx_Scheduler ( tolua_S ) ; <nl> lua_register_cocos2dx_ActionEase ( tolua_S ) ; <nl> lua_register_cocos2dx_EaseElastic ( tolua_S ) ; <nl> lua_register_cocos2dx_EaseElasticOut ( tolua_S ) ; <nl> lua_register_cocos2dx_EaseQuadraticActionInOut ( tolua_S ) ; <nl> lua_register_cocos2dx_EaseBackOut ( tolua_S ) ; <nl> + lua_register_cocos2dx_Texture2D ( tolua_S ) ; <nl> lua_register_cocos2dx_TransitionSceneOriented ( tolua_S ) ; <nl> lua_register_cocos2dx_TransitionFlipX ( tolua_S ) ; <nl> - lua_register_cocos2dx_ParticleSystem ( tolua_S ) ; <nl> - lua_register_cocos2dx_ParticleSystemQuad ( tolua_S ) ; <nl> lua_register_cocos2dx_GridAction ( tolua_S ) ; <nl> lua_register_cocos2dx_TiledGrid3DAction ( tolua_S ) ; <nl> lua_register_cocos2dx_FadeOutTRTiles ( tolua_S ) ; <nl> TOLUA_API int register_all_cocos2dx ( lua_State * tolua_S ) <nl> lua_register_cocos2dx_FadeOutDownTiles ( tolua_S ) ; <nl> lua_register_cocos2dx_StopGrid ( tolua_S ) ; <nl> lua_register_cocos2dx_SimpleAudioEngine ( tolua_S ) ; <nl> - lua_register_cocos2dx_ParticleSpiral ( tolua_S ) ; <nl> lua_register_cocos2dx_SkewTo ( tolua_S ) ; <nl> lua_register_cocos2dx_SkewBy ( tolua_S ) ; <nl> lua_register_cocos2dx_EaseQuadraticActionOut ( tolua_S ) ; <nl> TOLUA_API int register_all_cocos2dx ( lua_State * tolua_S ) <nl> lua_register_cocos2dx_Image ( tolua_S ) ; <nl> lua_register_cocos2dx_LayerMultiplex ( tolua_S ) ; <nl> lua_register_cocos2dx_Blink ( tolua_S ) ; <nl> - lua_register_cocos2dx_ShaderCache ( tolua_S ) ; <nl> lua_register_cocos2dx_JumpTo ( tolua_S ) ; <nl> lua_register_cocos2dx_ParticleExplosion ( tolua_S ) ; <nl> lua_register_cocos2dx_TransitionJumpZoom ( tolua_S ) ; <nl> mmm a / cocos / scripting / lua - bindings / auto / lua_cocos2dx_auto . hpp <nl> ppp b / cocos / scripting / lua - bindings / auto / lua_cocos2dx_auto . hpp <nl> int register_all_cocos2dx ( lua_State * tolua_S ) ; <nl> <nl> <nl> <nl> - <nl> - <nl> <nl> <nl> <nl>
|
Merge pull request from CocosRobot / update_lua_bindings_1399693609
|
cocos2d/cocos2d-x
|
029c38a789bb353109f5316414a5eee25bd48657
|
2014-05-10T03:56:03Z
|
mmm a / Telegram / SourceFiles / audio . cpp <nl> ppp b / Telegram / SourceFiles / audio . cpp <nl> Copyright ( c ) 2014 John Preston , https : / / desktop . telegram . org <nl> # include < opusfile . h > <nl> # include < ogg / ogg . h > <nl> <nl> + # include < mpg123 . h > <nl> + # include < mpeghead . h > <nl> + <nl> + # include < neaacdec . h > <nl> + # include < mp4ff . h > <nl> + <nl> namespace { <nl> ALCdevice * audioDevice = 0 ; <nl> ALCcontext * audioContext = 0 ; <nl> namespace { <nl> ALuint notifyBuffer = 0 ; <nl> QMutex voicemsgsMutex ; <nl> VoiceMessages * voicemsgs = 0 ; <nl> + bool _mpg123 = false ; <nl> } <nl> <nl> bool _checkALCError ( ) { <nl> void audioInit ( ) { <nl> <nl> voicemsgs = new VoiceMessages ( ) ; <nl> alcSuspendContext ( audioContext ) ; <nl> + <nl> + int mpg123res = mpg123_init ( ) ; <nl> + if ( mpg123res = = MPG123_OK ) { <nl> + _mpg123 = true ; <nl> + } else { <nl> + LOG ( ( " Could not init MPG123 , result : % 1 " ) . arg ( mpg123res ) ) ; <nl> + } <nl> + <nl> LOG ( ( " Audio init time : % 1 " ) . arg ( getms ( ) - ms ) ) ; <nl> } <nl> <nl> void audioFinish ( ) { <nl> alcCloseDevice ( audioDevice ) ; <nl> audioDevice = 0 ; <nl> } <nl> + <nl> + if ( _mpg123 ) mpg123_exit ( ) ; <nl> } <nl> <nl> VoiceMessages : : VoiceMessages ( ) : _current ( 0 ) , <nl> - _fader ( new VoiceMessagesFader ( & _faderThread ) ) , _loader ( new VoiceMessagesLoader ( & _loaderThread ) ) { <nl> + _fader ( new VoiceMessagesFader ( & _faderThread ) ) , _loader ( new VoiceMessagesLoaders ( & _loaderThread ) ) { <nl> connect ( this , SIGNAL ( faderOnTimer ( ) ) , _fader , SLOT ( onTimer ( ) ) ) ; <nl> connect ( this , SIGNAL ( loaderOnStart ( AudioData * ) ) , _loader , SLOT ( onStart ( AudioData * ) ) ) ; <nl> connect ( this , SIGNAL ( loaderOnCancel ( AudioData * ) ) , _loader , SLOT ( onCancel ( AudioData * ) ) ) ; <nl> void VoiceMessages : : pauseresume ( ) { <nl> emit faderOnTimer ( ) ; <nl> } <nl> <nl> - void VoiceMessages : : currentState ( AudioData * * audio , VoiceMessageState * state , int64 * position , int64 * duration ) { <nl> + void VoiceMessages : : currentState ( AudioData * * audio , VoiceMessageState * state , int64 * position , int64 * duration , int32 * frequency ) { <nl> QMutexLocker lock ( & voicemsgsMutex ) ; <nl> if ( audio ) * audio = _data [ _current ] . audio ; <nl> if ( state ) * state = _data [ _current ] . state ; <nl> if ( position ) * position = _data [ _current ] . position ; <nl> if ( duration ) * duration = _data [ _current ] . duration ; <nl> + if ( frequency ) * frequency = _data [ _current ] . frequency ; <nl> + } <nl> + <nl> + void VoiceMessages : : clearStoppedAtStart ( AudioData * audio ) { <nl> + QMutexLocker lock ( & voicemsgsMutex ) ; <nl> + if ( _data [ _current ] . audio = = audio & & _data [ _current ] . state = = VoiceMessageStoppedAtStart ) { <nl> + _data [ _current ] . state = VoiceMessageStopped ; <nl> + } <nl> } <nl> <nl> void VoiceMessages : : processContext ( ) { <nl> void VoiceMessagesFader : : onTimer ( ) { <nl> <nl> for ( int32 i = 0 ; i < AudioVoiceMsgSimultaneously ; + + i ) { <nl> VoiceMessages : : Msg & m ( voice - > _data [ i ] ) ; <nl> - if ( m . state = = VoiceMessageStopped | | m . state = = VoiceMessagePaused | | ! m . source ) continue ; <nl> + if ( m . state = = VoiceMessageStopped | | m . state = = VoiceMessageStoppedAtStart | | m . state = = VoiceMessagePaused | | ! m . source ) continue ; <nl> <nl> bool playing = false , fading = false ; <nl> ALint pos = 0 ; <nl> void VoiceMessagesFader : : onTimer ( ) { <nl> } <nl> m . state = VoiceMessageStopped ; <nl> emit audioStopped ( m . audio ) ; <nl> - } else if ( 1000 * ( pos + m . skipStart - m . started ) > = AudioFadeDuration * AudioVoiceMsgFrequency ) { <nl> + } else if ( 1000 * ( pos + m . skipStart - m . started ) > = AudioFadeDuration * m . frequency ) { <nl> fading = false ; <nl> alSourcef ( m . source , AL_GAIN , 1 ) ; <nl> switch ( m . state ) { <nl> void VoiceMessagesFader : : onTimer ( ) { <nl> break ; <nl> } <nl> } else { <nl> - float64 newGain = 1000 . * ( pos + m . skipStart - m . started ) / ( AudioFadeDuration * AudioVoiceMsgFrequency ) ; <nl> + float64 newGain = 1000 . * ( pos + m . skipStart - m . started ) / ( AudioFadeDuration * m . frequency ) ; <nl> if ( m . state = = VoiceMessagePausing | | m . state = = VoiceMessageFinishing ) { <nl> newGain = 1 . - newGain ; <nl> } <nl> void VoiceMessagesFader : : processContext ( ) { <nl> alcProcessContext ( audioContext ) ; <nl> } <nl> <nl> - struct VoiceMessagesLoader : : Loader { <nl> + class VoiceMessagesLoader { <nl> + public : <nl> + VoiceMessagesLoader ( const QString & fname , const QByteArray & data ) : fname ( fname ) , data ( data ) , dataPos ( 0 ) { <nl> + } <nl> + virtual ~ VoiceMessagesLoader ( ) { <nl> + } <nl> + <nl> + bool check ( const QString & fname , const QByteArray & data ) { <nl> + return this - > fname = = fname & & this - > data . size ( ) = = data . size ( ) ; <nl> + } <nl> + <nl> + virtual bool open ( ) = 0 ; <nl> + virtual int64 duration ( ) = 0 ; <nl> + virtual int32 frequency ( ) = 0 ; <nl> + virtual int32 format ( ) = 0 ; <nl> + virtual void started ( ) = 0 ; <nl> + virtual bool readMore ( QByteArray & result , int64 & samplesAdded ) = 0 ; <nl> + <nl> + protected : <nl> + <nl> QString fname ; <nl> QByteArray data ; <nl> + <nl> + QFile f ; <nl> + int32 dataPos ; <nl> + <nl> + bool openFile ( ) { <nl> + if ( data . isEmpty ( ) ) { <nl> + if ( f . isOpen ( ) ) f . close ( ) ; <nl> + f . setFileName ( fname ) ; <nl> + if ( ! f . open ( QIODevice : : ReadOnly ) ) { <nl> + LOG ( ( " Audio Error : could not open file ' % 1 ' , data size ' % 2 ' , error % 3 , % 4 " ) . arg ( fname ) . arg ( data . size ( ) ) . arg ( f . error ( ) ) . arg ( f . errorString ( ) ) ) ; <nl> + return false ; <nl> + } <nl> + } <nl> + dataPos = 0 ; <nl> + return true ; <nl> + } <nl> + <nl> + } ; <nl> + <nl> + class OggOpusLoader : public VoiceMessagesLoader { <nl> + public : <nl> + OggOpusLoader ( const QString & fname , const QByteArray & data ) : VoiceMessagesLoader ( fname , data ) , file ( 0 ) , pcm_offset ( 0 ) , pcm_print_offset ( 0 ) , prev_li ( - 1 ) { <nl> + } <nl> + <nl> + bool open ( ) { <nl> + if ( ! VoiceMessagesLoader : : openFile ( ) ) { <nl> + return false ; <nl> + } <nl> + <nl> + OpusFileCallbacks cb = { & OggOpusLoader : : _read_data , & OggOpusLoader : : _seek_data , & OggOpusLoader : : _tell_data , 0 } ; <nl> + if ( data . isEmpty ( ) ) { <nl> + cb = { & OggOpusLoader : : _read_file , & OggOpusLoader : : _seek_file , & OggOpusLoader : : _tell_file , 0 } ; <nl> + } <nl> + <nl> + int ret = 0 ; <nl> + file = op_open_callbacks ( reinterpret_cast < void * > ( this ) , & cb , 0 , 0 , & ret ) ; <nl> + if ( ! file ) { <nl> + LOG ( ( " Audio Error : op_open_file failed for ' % 1 ' , data size ' % 2 ' , error code % 3 " ) . arg ( fname ) . arg ( data . size ( ) ) . arg ( ret ) ) ; <nl> + return false ; <nl> + } <nl> + return true ; <nl> + } <nl> + <nl> + int64 duration ( ) { <nl> + ogg_int64_t duration = op_pcm_total ( file , - 1 ) ; <nl> + if ( duration < 0 ) { <nl> + LOG ( ( " Audio Error : op_pcm_total failed to get full duration for ' % 1 ' , data size ' % 2 ' , error code % 3 " ) . arg ( fname ) . arg ( data . size ( ) ) . arg ( duration ) ) ; <nl> + } <nl> + return duration ; <nl> + } <nl> + <nl> + int32 frequency ( ) { <nl> + return AudioVoiceMsgFrequency ; <nl> + } <nl> + <nl> + int32 format ( ) { <nl> + return AL_FORMAT_STEREO16 ; <nl> + } <nl> + <nl> + void started ( ) { <nl> + pcm_offset = op_pcm_tell ( file ) ; <nl> + pcm_print_offset = pcm_offset - AudioVoiceMsgFrequency ; <nl> + } <nl> + <nl> + bool readMore ( QByteArray & result , int64 & samplesAdded ) { <nl> + DEBUG_LOG ( ( " Audio Info : reading buffer for file ' % 1 ' , data size ' % 2 ' , current pcm_offset % 3 " ) . arg ( fname ) . arg ( data . size ( ) ) . arg ( pcm_offset ) ) ; <nl> + <nl> + opus_int16 pcm [ AudioVoiceMsgFrequency * AudioVoiceMsgChannels ] ; <nl> + <nl> + int ret = op_read_stereo ( file , pcm , sizeof ( pcm ) / sizeof ( * pcm ) ) ; <nl> + if ( ret < 0 ) { <nl> + LOG ( ( " Audio Error : op_read_stereo failed , error code % 1 ( corrupted voice message ? ) " ) . arg ( ret ) ) ; <nl> + return false ; <nl> + } <nl> + <nl> + int li = op_current_link ( file ) ; <nl> + if ( li ! = prev_li ) { <nl> + const OpusHead * head = op_head ( file , li ) ; <nl> + const OpusTags * tags = op_tags ( file , li ) ; <nl> + for ( int32 ci = 0 ; ci < tags - > comments ; + + ci ) { <nl> + const char * comment = tags - > user_comments [ ci ] ; <nl> + if ( opus_tagncompare ( " METADATA_BLOCK_PICTURE " , 22 , comment ) = = 0 ) { <nl> + OpusPictureTag pic ; <nl> + int err = opus_picture_tag_parse ( & pic , comment ) ; <nl> + if ( err > = 0 ) { <nl> + opus_picture_tag_clear ( & pic ) ; <nl> + } <nl> + } <nl> + } <nl> + if ( ! op_seekable ( file ) ) { <nl> + pcm_offset = op_pcm_tell ( file ) - ret ; <nl> + } <nl> + } <nl> + if ( li ! = prev_li | | pcm_offset > = pcm_print_offset + AudioVoiceMsgFrequency ) { <nl> + pcm_print_offset = pcm_offset ; <nl> + } <nl> + pcm_offset = op_pcm_tell ( file ) ; <nl> + <nl> + if ( ! ret ) { <nl> + DEBUG_LOG ( ( " Audio Info : read completed " ) ) ; <nl> + return false ; <nl> + } <nl> + result . append ( ( const char * ) pcm , sizeof ( * pcm ) * ret * AudioVoiceMsgChannels ) ; <nl> + prev_li = li ; <nl> + samplesAdded + = ret ; <nl> + return true ; <nl> + } <nl> + <nl> + ~ OggOpusLoader ( ) { <nl> + } <nl> + <nl> + private : <nl> OggOpusFile * file ; <nl> + <nl> ogg_int64_t pcm_offset ; <nl> ogg_int64_t pcm_print_offset ; <nl> int prev_li ; <nl> <nl> - Loader ( ) : file ( 0 ) , pcm_offset ( 0 ) , pcm_print_offset ( 0 ) , prev_li ( - 1 ) { <nl> + static int _read_data ( void * _stream , unsigned char * _ptr , int _nbytes ) { <nl> + OggOpusLoader * l = reinterpret_cast < OggOpusLoader * > ( _stream ) ; <nl> <nl> + int32 nbytes = qMin ( l - > data . size ( ) - l - > dataPos , _nbytes ) ; <nl> + if ( nbytes < = 0 ) { <nl> + return 0 ; <nl> + } <nl> + <nl> + memcpy ( _ptr , l - > data . constData ( ) + l - > dataPos , nbytes ) ; <nl> + l - > dataPos + = nbytes ; <nl> + return nbytes ; <nl> + } <nl> + <nl> + static int _seek_data ( void * _stream , opus_int64 _offset , int _whence ) { <nl> + OggOpusLoader * l = reinterpret_cast < OggOpusLoader * > ( _stream ) ; <nl> + <nl> + int32 newPos = - 1 ; <nl> + switch ( _whence ) { <nl> + case SEEK_SET : newPos = _offset ; break ; <nl> + case SEEK_CUR : newPos = l - > dataPos + _offset ; break ; <nl> + case SEEK_END : newPos = l - > data . size ( ) + _offset ; break ; <nl> + } <nl> + if ( newPos < 0 | | newPos > l - > data . size ( ) ) { <nl> + return - 1 ; <nl> + } <nl> + l - > dataPos = newPos ; <nl> + return 0 ; <nl> + } <nl> + <nl> + static opus_int64 _tell_data ( void * _stream ) { <nl> + OggOpusLoader * l = reinterpret_cast < OggOpusLoader * > ( _stream ) ; <nl> + return l - > dataPos ; <nl> + } <nl> + <nl> + static int _read_file ( void * _stream , unsigned char * _ptr , int _nbytes ) { <nl> + OggOpusLoader * l = reinterpret_cast < OggOpusLoader * > ( _stream ) ; <nl> + return int ( l - > f . read ( ( char * ) ( _ptr ) , _nbytes ) ) ; <nl> + } <nl> + <nl> + static int _seek_file ( void * _stream , opus_int64 _offset , int _whence ) { <nl> + OggOpusLoader * l = reinterpret_cast < OggOpusLoader * > ( _stream ) ; <nl> + <nl> + switch ( _whence ) { <nl> + case SEEK_SET : return l - > f . seek ( _offset ) ? 0 : - 1 ; <nl> + case SEEK_CUR : return l - > f . seek ( l - > f . pos ( ) + _offset ) ? 0 : - 1 ; <nl> + case SEEK_END : return l - > f . seek ( l - > f . size ( ) + _offset ) ? 0 : - 1 ; <nl> + } <nl> + return - 1 ; <nl> + } <nl> + <nl> + static opus_int64 _tell_file ( void * _stream ) { <nl> + OggOpusLoader * l = reinterpret_cast < OggOpusLoader * > ( _stream ) ; <nl> + return l - > f . pos ( ) ; <nl> } <nl> } ; <nl> <nl> - VoiceMessagesLoader : : VoiceMessagesLoader ( QThread * thread ) { <nl> + class Mpg123Loader : public VoiceMessagesLoader { <nl> + public : <nl> + Mpg123Loader ( const QString & fname , const QByteArray & data ) : VoiceMessagesLoader ( fname , data ) , <nl> + handle ( 0 ) , opened ( false ) , freq ( AudioVoiceMsgFrequency ) , fmt ( AL_FORMAT_STEREO16 ) , channels ( 0 ) { <nl> + int ret = 0 ; <nl> + handle = mpg123_new ( NULL , & ret ) ; <nl> + if ( ! handle ) { <nl> + LOG ( ( " Audio Error : Unable to create mpg123 handle : % 1 \ n " ) . arg ( mpg123_plain_strerror ( ret ) ) ) ; <nl> + return ; <nl> + } <nl> + mpg123_param ( handle , MPG123_REMOVE_FLAGS , MPG123_FORCE_FLOAT , 0 . ) ; / / not float <nl> + } <nl> + <nl> + bool open ( ) { <nl> + if ( ! VoiceMessagesLoader : : openFile ( ) ) { <nl> + return false ; <nl> + } <nl> + <nl> + int res ; <nl> + if ( data . isEmpty ( ) ) { <nl> + res = mpg123_replace_reader_handle ( handle , & Mpg123Loader : : _read_file , & Mpg123Loader : : _seek_file , 0 ) ; <nl> + } else { <nl> + res = mpg123_replace_reader_handle ( handle , & Mpg123Loader : : _read_data , & Mpg123Loader : : _seek_data , 0 ) ; <nl> + } <nl> + if ( res ! = MPG123_OK ) { <nl> + LOG ( ( " Audio Error : Unable to mpg123_replace_reader_handle ( ) file ' % 1 ' , data size ' % 2 ' , error % 3 , % 4 " ) . arg ( fname ) . arg ( data . size ( ) ) . arg ( res ) . arg ( mpg123_strerror ( handle ) ) ) ; <nl> + return false ; <nl> + } <nl> + res = mpg123_open_handle ( handle , reinterpret_cast < void * > ( this ) ) ; <nl> + if ( res ! = MPG123_OK ) { <nl> + LOG ( ( " Audio Error : Unable to mpg123_open ( ) file ' % 1 ' , data size ' % 2 ' , error % 3 , % 4 " ) . arg ( fname ) . arg ( data . size ( ) ) . arg ( res ) . arg ( mpg123_strerror ( handle ) ) ) ; <nl> + return false ; <nl> + } <nl> + opened = true ; <nl> + <nl> + int encoding = 0 ; <nl> + long rate = 0 ; <nl> + res = mpg123_getformat ( handle , & rate , & channels , & encoding ) ; <nl> + if ( res ! = MPG123_OK ) { <nl> + LOG ( ( " Audio Error : Unable to mpg123_getformat ( ) file ' % 1 ' , data size ' % 2 ' , error % 3 , % 4 " ) . arg ( fname ) . arg ( data . size ( ) ) . arg ( res ) . arg ( mpg123_strerror ( handle ) ) ) ; <nl> + return false ; <nl> + } <nl> + if ( channels = = 2 ) { <nl> + if ( encoding = = MPG123_ENC_SIGNED_16 ) { <nl> + fmt = AL_FORMAT_STEREO16 ; <nl> + } else if ( encoding = = MPG123_ENC_UNSIGNED_8 ) { <nl> + fmt = AL_FORMAT_STEREO8 ; <nl> + } else { <nl> + LOG ( ( " Audio Error : Bad encoding for 2 channels in mpg123_getformat ( ) file ' % 1 ' , data size ' % 2 ' , encoding % 3 " ) . arg ( fname ) . arg ( data . size ( ) ) . arg ( encoding ) ) ; <nl> + return false ; <nl> + } <nl> + } else if ( channels = = 1 ) { <nl> + if ( encoding = = MPG123_ENC_SIGNED_16 ) { <nl> + fmt = AL_FORMAT_MONO16 ; <nl> + } else if ( encoding = = MPG123_ENC_UNSIGNED_8 ) { <nl> + fmt = AL_FORMAT_MONO8 ; <nl> + } else { <nl> + LOG ( ( " Audio Error : Bad encoding for 1 channel in mpg123_getformat ( ) file ' % 1 ' , data size ' % 2 ' , encoding % 3 " ) . arg ( fname ) . arg ( data . size ( ) ) . arg ( encoding ) ) ; <nl> + return false ; <nl> + } <nl> + } else { <nl> + LOG ( ( " Audio Error : Bad channels in mpg123_getformat ( ) file ' % 1 ' , data size ' % 2 ' , channels % 3 " ) . arg ( fname ) . arg ( data . size ( ) ) . arg ( channels ) ) ; <nl> + return false ; <nl> + } <nl> + freq = rate ; <nl> + <nl> + mpg123_format_none ( handle ) ; <nl> + res = mpg123_format ( handle , freq , channels , encoding ) ; <nl> + if ( res ! = MPG123_OK ) { <nl> + LOG ( ( " Audio Error : Unable to mpg123_format ( ) file ' % 1 ' , data size ' % 2 ' , error % 3 , % 4 " ) . arg ( fname ) . arg ( data . size ( ) ) . arg ( res ) . arg ( mpg123_strerror ( handle ) ) ) ; <nl> + return false ; <nl> + } <nl> + return true ; <nl> + } <nl> + <nl> + int64 duration ( ) { <nl> + return mpg123_length ( handle ) ; <nl> + } <nl> + <nl> + int32 frequency ( ) { <nl> + return freq ; <nl> + } <nl> + <nl> + int32 format ( ) { <nl> + return fmt ; <nl> + } <nl> + <nl> + void started ( ) { <nl> + } <nl> + <nl> + bool readMore ( QByteArray & result , int64 & samplesAdded ) { <nl> + int64 more_samples ; <nl> + uchar buffer [ sizeof ( short ) * AudioVoiceMsgFrequency * AudioVoiceMsgChannels ] ; <nl> + size_t buffer_size = sizeof ( buffer ) , done = 0 ; <nl> + int res = mpg123_read ( handle , buffer , buffer_size , & done ) ; <nl> + if ( done ) { <nl> + samplesAdded + = done / ( sizeof ( short ) * channels ) ; <nl> + result . append ( ( const char * ) buffer , done ) ; <nl> + } <nl> + if ( res = = MPG123_DONE ) return false ; <nl> + if ( res ! = MPG123_OK ) { <nl> + LOG ( ( " Audio Error : Unable to mpg123_read ( ) file ' % 1 ' , data size ' % 2 ' , error % 3 , % 4 " ) . arg ( fname ) . arg ( data . size ( ) ) . arg ( res ) . arg ( mpg123_strerror ( handle ) ) ) ; <nl> + return false ; <nl> + } <nl> + return true ; <nl> + } <nl> + <nl> + ~ Mpg123Loader ( ) { <nl> + if ( handle ) { <nl> + if ( opened ) mpg123_close ( handle ) ; <nl> + mpg123_delete ( handle ) ; <nl> + } <nl> + } <nl> + <nl> + private : <nl> + mpg123_handle * handle ; <nl> + bool opened ; <nl> + int32 freq , fmt ; <nl> + int32 channels ; <nl> + <nl> + static ssize_t _read_data ( void * _stream , void * _ptr , size_t _nbytes ) { <nl> + Mpg123Loader * l = reinterpret_cast < Mpg123Loader * > ( _stream ) ; <nl> + <nl> + int32 nbytes = qMin ( l - > data . size ( ) - l - > dataPos , int32 ( _nbytes ) ) ; <nl> + if ( nbytes < = 0 ) { <nl> + return 0 ; <nl> + } <nl> + <nl> + memcpy ( _ptr , l - > data . constData ( ) + l - > dataPos , nbytes ) ; <nl> + l - > dataPos + = nbytes ; <nl> + return nbytes ; <nl> + } <nl> + <nl> + static off_t _seek_data ( void * _stream , off_t _offset , int _whence ) { <nl> + Mpg123Loader * l = reinterpret_cast < Mpg123Loader * > ( _stream ) ; <nl> + <nl> + int32 newPos = - 1 ; <nl> + switch ( _whence ) { <nl> + case SEEK_SET : newPos = _offset ; break ; <nl> + case SEEK_CUR : newPos = l - > dataPos + _offset ; break ; <nl> + case SEEK_END : newPos = l - > data . size ( ) + _offset ; break ; <nl> + } <nl> + if ( newPos < 0 ) { <nl> + return - 1 ; <nl> + } <nl> + l - > dataPos = newPos ; <nl> + return l - > dataPos ; <nl> + } <nl> + <nl> + static ssize_t _read_file ( void * _stream , void * _ptr , size_t _nbytes ) { <nl> + Mpg123Loader * l = reinterpret_cast < Mpg123Loader * > ( _stream ) ; <nl> + return ssize_t ( l - > f . read ( ( char * ) ( _ptr ) , _nbytes ) ) ; <nl> + } <nl> + <nl> + static off_t _seek_file ( void * _stream , off_t _offset , int _whence ) { <nl> + Mpg123Loader * l = reinterpret_cast < Mpg123Loader * > ( _stream ) ; <nl> + <nl> + switch ( _whence ) { <nl> + case SEEK_SET : return l - > f . seek ( _offset ) ? l - > f . pos ( ) : - 1 ; <nl> + case SEEK_CUR : return l - > f . seek ( l - > f . pos ( ) + _offset ) ? l - > f . pos ( ) : - 1 ; <nl> + case SEEK_END : return l - > f . seek ( l - > f . size ( ) + _offset ) ? l - > f . pos ( ) : - 1 ; <nl> + } <nl> + return - 1 ; <nl> + } <nl> + } ; <nl> + <nl> + class FAADMp4Loader : public VoiceMessagesLoader { <nl> + public : <nl> + FAADMp4Loader ( const QString & fname , const QByteArray & data ) : VoiceMessagesLoader ( fname , data ) , <nl> + freq ( AudioVoiceMsgFrequency ) , fmt ( AL_FORMAT_STEREO16 ) , len ( 0 ) , <nl> + mp4f ( 0 ) , <nl> + initial ( true ) , useAacLength ( false ) , <nl> + framesize ( 1024 ) , timescale ( AudioVoiceMsgFrequency ) , <nl> + trackId ( - 1 ) , sampleId ( 0 ) , samplesCount ( 0 ) { <nl> + } <nl> + <nl> + bool open ( ) { <nl> + if ( ! VoiceMessagesLoader : : openFile ( ) ) { <nl> + return false ; <nl> + } <nl> + <nl> + if ( data . isEmpty ( ) ) { <nl> + mp4cb = { & FAADMp4Loader : : _read_file , 0 , & FAADMp4Loader : : _seek_file , 0 , static_cast < void * > ( this ) } ; <nl> + } else { <nl> + mp4cb = { & FAADMp4Loader : : _read_data , 0 , & FAADMp4Loader : : _seek_data , 0 , static_cast < void * > ( this ) } ; <nl> + } <nl> + <nl> + hDecoder = NeAACDecOpen ( ) ; <nl> + <nl> + config = NeAACDecGetCurrentConfiguration ( hDecoder ) ; <nl> + config - > outputFormat = FAAD_FMT_16BIT ; <nl> + config - > downMatrix = 1 ; / / Down matrix 5 . 1 to 2 channels <nl> + NeAACDecSetConfiguration ( hDecoder , config ) ; <nl> + <nl> + mp4f = mp4ff_open_read ( & mp4cb ) ; <nl> + if ( ! mp4f ) { <nl> + LOG ( ( " Audio Error : Unable to mp4ff_open_read ( ) file ' % 1 ' , data size ' % 2 ' " ) . arg ( fname ) . arg ( data . size ( ) ) ) ; <nl> + return false ; <nl> + } <nl> + <nl> + trackId = getAACTrack ( ) ; <nl> + if ( trackId < 0 ) { <nl> + LOG ( ( " Audio Error : Unable to find correct AAC sound track in the MP4 file ' % 1 ' , data size ' % 2 ' " ) . arg ( fname ) . arg ( data . size ( ) ) ) ; <nl> + return false ; <nl> + } <nl> + <nl> + uchar * buffer = 0 ; <nl> + uint buffer_size = 0 ; <nl> + mp4ff_get_decoder_config ( mp4f , trackId , & buffer , & buffer_size ) ; <nl> + <nl> + unsigned long samplerate = 0 ; <nl> + uchar channels = 2 ; <nl> + if ( NeAACDecInit2 ( hDecoder , buffer , buffer_size , & samplerate , & channels ) < 0 ) { <nl> + free ( buffer ) ; <nl> + LOG ( ( " Audio Error : Error initializaing decoder library for file ' % 1 ' , data size ' % 2 ' " ) . arg ( fname ) . arg ( data . size ( ) ) ) ; <nl> + return false ; <nl> + } <nl> + freq = samplerate ; <nl> + switch ( channels ) { <nl> + case 1 : fmt = AL_FORMAT_MONO16 ; break ; <nl> + case 2 : fmt = AL_FORMAT_STEREO16 ; break ; <nl> + } <nl> + <nl> + timescale = mp4ff_time_scale ( mp4f , trackId ) ; <nl> + if ( buffer ) { <nl> + if ( NeAACDecAudioSpecificConfig ( buffer , buffer_size , & mp4ASC ) > = 0 ) { <nl> + if ( mp4ASC . frameLengthFlag = = 1 ) framesize = 960 ; <nl> + if ( mp4ASC . sbr_present_flag = = 1 ) framesize * = 2 ; <nl> + } <nl> + free ( buffer ) ; <nl> + } <nl> + <nl> + samplesCount = mp4ff_num_samples ( mp4f , trackId ) ; <nl> + int32 f = 1024 ; <nl> + if ( mp4ASC . sbr_present_flag = = 1 ) { <nl> + f * = 2 ; <nl> + } <nl> + len = int64 ( samplesCount ) * ( f - 1 ) ; <nl> + return true ; <nl> + } <nl> + <nl> + int64 duration ( ) { <nl> + return len ; <nl> + } <nl> + <nl> + int32 frequency ( ) { <nl> + return freq ; <nl> + } <nl> + <nl> + int32 format ( ) { <nl> + return fmt ; <nl> + } <nl> + <nl> + void started ( ) { <nl> + } <nl> + <nl> + bool readMore ( QByteArray & result , int64 & samplesAdded ) { <nl> + if ( sampleId > = samplesCount ) return false ; <nl> + <nl> + int32 dur = mp4ff_get_sample_duration ( mp4f , trackId , sampleId ) ; <nl> + <nl> + uchar * buffer = 0 ; <nl> + uint32 buffer_size = 0 ; <nl> + if ( ! mp4ff_read_sample ( mp4f , trackId , sampleId , & buffer , & buffer_size ) ) { <nl> + LOG ( ( " Audio Error : Unable to mp4ff_read_sample ( ) file ' % 1 ' , data size ' % 2 ' " ) . arg ( fname ) . arg ( data . size ( ) ) ) ; <nl> + return false ; <nl> + } <nl> + <nl> + void * sample_buffer = NeAACDecDecode ( hDecoder , & frameInfo , buffer , buffer_size ) ; <nl> + <nl> + if ( buffer ) free ( buffer ) ; <nl> + <nl> + if ( sampleId = = 0 ) dur = 0 ; <nl> + <nl> + uint32 sample_count = frameInfo . samples ; <nl> + if ( ! useAacLength & & timescale = = freq ) { <nl> + sample_count = ( uint32 ) ( dur * frameInfo . channels ) ; <nl> + if ( sample_count > frameInfo . samples ) { <nl> + sample_count = frameInfo . samples ; <nl> + } <nl> + <nl> + if ( ! initial & & ( sampleId < samplesCount / 2 ) & & ( sample_count ! = frameInfo . samples ) ) { <nl> + DEBUG_LOG ( ( " Audio Warning : MP4 seems to have incorrect frame duration , using values from AAC data in file ' % 1 ' , data size ' % 2 ' " ) . arg ( fname ) . arg ( data . size ( ) ) ) ; <nl> + useAacLength = true ; <nl> + sample_count = frameInfo . samples ; <nl> + } <nl> + } <nl> + <nl> + uint32 delay = 0 ; <nl> + if ( initial & & ( sample_count < framesize * frameInfo . channels ) & & ( frameInfo . samples > sample_count ) ) { <nl> + delay = frameInfo . samples - sample_count ; <nl> + } <nl> + <nl> + switch ( frameInfo . channels ) { <nl> + case 1 : fmt = AL_FORMAT_MONO16 ; break ; <nl> + case 2 : fmt = AL_FORMAT_STEREO16 ; break ; <nl> + } <nl> + <nl> + if ( sample_count > 0 ) initial = false ; <nl> + <nl> + if ( frameInfo . error ) { <nl> + DEBUG_LOG ( ( " Audio Warning : Read frame error in file ' % 1 ' , data size ' % 2 ' , error % 3 , % 4 " ) . arg ( fname ) . arg ( data . size ( ) ) . arg ( frameInfo . error ) . arg ( NeAACDecGetErrorMessage ( frameInfo . error ) ) ) ; <nl> + } else if ( sample_count > 0 ) { <nl> + samplesAdded + = sample_count / frameInfo . channels ; <nl> + result . append ( ( const char * ) sample_buffer + delay * sizeof ( short ) , sample_count * sizeof ( short ) ) ; / / delay <nl> + } <nl> + <nl> + + + sampleId ; <nl> + return true ; <nl> + } <nl> + <nl> + ~ FAADMp4Loader ( ) { <nl> + NeAACDecClose ( hDecoder ) ; <nl> + mp4ff_close ( mp4f ) ; <nl> + } <nl> + <nl> + private : <nl> + int32 freq , fmt ; <nl> + int64 len ; <nl> + <nl> + NeAACDecHandle hDecoder ; <nl> + NeAACDecConfigurationPtr config ; <nl> + NeAACDecFrameInfo frameInfo ; <nl> + mp4AudioSpecificConfig mp4ASC ; <nl> + <nl> + mp4ff_t * mp4f ; <nl> + mp4ff_callback_t mp4cb ; <nl> + <nl> + bool initial , useAacLength ; <nl> + int32 framesize , timescale ; <nl> + int32 trackId , sampleId , samplesCount ; <nl> + <nl> + int32 getAACTrack ( ) { <nl> + int32 rc ; <nl> + for ( int32 i = 0 , numTracks = mp4ff_total_tracks ( mp4f ) ; i < numTracks ; i + + ) <nl> + { <nl> + uchar * buff = 0 ; <nl> + uint32 buff_size = 0 ; <nl> + mp4ff_get_decoder_config ( mp4f , i , & buff , & buff_size ) ; <nl> + if ( buff ) { <nl> + mp4AudioSpecificConfig mp4ASC ; <nl> + rc = NeAACDecAudioSpecificConfig ( buff , buff_size , & mp4ASC ) ; <nl> + free ( buff ) ; <nl> + if ( rc < 0 ) continue ; <nl> + return i ; <nl> + } <nl> + } <nl> + return - 1 ; <nl> + } <nl> + <nl> + static uint32_t _read_data ( void * _stream , void * _ptr , uint32_t _nbytes ) { <nl> + FAADMp4Loader * l = reinterpret_cast < FAADMp4Loader * > ( _stream ) ; <nl> + <nl> + int32 nbytes = qMin ( l - > data . size ( ) - l - > dataPos , int32 ( _nbytes ) ) ; <nl> + if ( nbytes < = 0 ) { <nl> + return 0 ; <nl> + } <nl> + <nl> + memcpy ( _ptr , l - > data . constData ( ) + l - > dataPos , nbytes ) ; <nl> + l - > dataPos + = nbytes ; <nl> + return nbytes ; <nl> + } <nl> + <nl> + static uint32_t _seek_data ( void * _stream , uint64_t _offset ) { <nl> + FAADMp4Loader * l = reinterpret_cast < FAADMp4Loader * > ( _stream ) ; <nl> + <nl> + int32 newPos = _offset ; <nl> + if ( newPos < 0 ) { <nl> + return ( uint32_t ) - 1 ; <nl> + } <nl> + l - > dataPos = newPos ; <nl> + return 0 ; <nl> + } <nl> + <nl> + static uint32_t _read_file ( void * _stream , void * _ptr , uint32_t _nbytes ) { <nl> + FAADMp4Loader * l = reinterpret_cast < FAADMp4Loader * > ( _stream ) ; <nl> + return ssize_t ( l - > f . read ( ( char * ) ( _ptr ) , _nbytes ) ) ; <nl> + } <nl> + <nl> + static uint32_t _seek_file ( void * _stream , uint64_t _offset ) { <nl> + FAADMp4Loader * l = reinterpret_cast < FAADMp4Loader * > ( _stream ) ; <nl> + <nl> + return l - > f . seek ( _offset ) ? 0 : ( uint32_t ) - 1 ; <nl> + } <nl> + } ; <nl> + <nl> + VoiceMessagesLoaders : : VoiceMessagesLoaders ( QThread * thread ) { <nl> moveToThread ( thread ) ; <nl> } <nl> <nl> - VoiceMessagesLoader : : ~ VoiceMessagesLoader ( ) { <nl> + VoiceMessagesLoaders : : ~ VoiceMessagesLoaders ( ) { <nl> for ( Loaders : : iterator i = _loaders . begin ( ) , e = _loaders . end ( ) ; i ! = e ; + + i ) { <nl> delete i . value ( ) ; <nl> } <nl> _loaders . clear ( ) ; <nl> } <nl> <nl> - void VoiceMessagesLoader : : onInit ( ) { <nl> + void VoiceMessagesLoaders : : onInit ( ) { <nl> } <nl> <nl> - void VoiceMessagesLoader : : onStart ( AudioData * audio ) { <nl> + void VoiceMessagesLoaders : : onStart ( AudioData * audio ) { <nl> Loaders : : iterator i = _loaders . find ( audio ) ; <nl> if ( i ! = _loaders . end ( ) ) { <nl> delete ( * i ) ; <nl> void VoiceMessagesLoader : : onStart ( AudioData * audio ) { <nl> onLoad ( audio ) ; <nl> } <nl> <nl> - void VoiceMessagesLoader : : loadError ( Loaders : : iterator i ) { <nl> + void VoiceMessagesLoaders : : loadError ( Loaders : : iterator i ) { <nl> emit error ( i . key ( ) ) ; <nl> delete ( * i ) ; <nl> _loaders . erase ( i ) ; <nl> } <nl> <nl> - void VoiceMessagesLoader : : onLoad ( AudioData * audio ) { <nl> + void VoiceMessagesLoaders : : onLoad ( AudioData * audio ) { <nl> bool started = false ; <nl> int32 audioindex = - 1 ; <nl> - Loader * l = 0 ; <nl> + VoiceMessagesLoader * l = 0 ; <nl> Loaders : : iterator j = _loaders . end ( ) ; <nl> { <nl> QMutexLocker lock ( & voicemsgsMutex ) ; <nl> void VoiceMessagesLoader : : onLoad ( AudioData * audio ) { <nl> <nl> audioindex = i ; <nl> j = _loaders . find ( audio ) ; <nl> - if ( j ! = _loaders . end ( ) & & ( j . value ( ) - > fname ! = m . fname | | j . value ( ) - > data . size ( ) ! = m . data . size ( ) ) ) { <nl> + if ( j ! = _loaders . end ( ) & & ! j . value ( ) - > check ( m . fname , m . data ) ) { <nl> delete j . value ( ) ; <nl> _loaders . erase ( j ) ; <nl> j = _loaders . end ( ) ; <nl> } <nl> if ( j = = _loaders . end ( ) ) { <nl> - l = ( j = _loaders . insert ( audio , new Loader ( ) ) ) . value ( ) ; <nl> - l - > fname = m . fname ; <nl> - l - > data = m . data ; <nl> - <nl> - int ret ; <nl> - if ( m . data . isEmpty ( ) ) { <nl> - l - > file = op_open_file ( m . fname . toUtf8 ( ) . constData ( ) , & ret ) ; <nl> + QByteArray header = m . data . mid ( 0 , 8 ) ; <nl> + if ( header . isEmpty ( ) ) { <nl> + QFile f ( m . fname ) ; <nl> + if ( ! f . open ( QIODevice : : ReadOnly ) ) { <nl> + LOG ( ( " Audio Error : could not open file ' % 1 ' " ) . arg ( m . fname ) ) ; <nl> + m . state = VoiceMessageStoppedAtStart ; <nl> + return emit error ( audio ) ; <nl> + } <nl> + header = f . read ( 8 ) ; <nl> + } <nl> + if ( header . size ( ) < 8 ) { <nl> + LOG ( ( " Audio Error : could not read header from file ' % 1 ' , data size % 2 " ) . arg ( m . fname ) . arg ( m . data . isEmpty ( ) ? QFileInfo ( m . fname ) . size ( ) : m . data . size ( ) ) ) ; <nl> + m . state = VoiceMessageStoppedAtStart ; <nl> + return emit error ( audio ) ; <nl> + } <nl> + uint32 mpegHead = ( uint32 ( uchar ( header . at ( 0 ) ) ) < < 24 ) | ( uint32 ( uchar ( header . at ( 1 ) ) ) < < 16 ) | ( uint32 ( uchar ( header . at ( 2 ) ) ) < < 8 ) | uint32 ( uchar ( header . at ( 3 ) ) ) ; <nl> + bool validMpegHead = ( ( mpegHead & HDR_SYNC ) = = HDR_SYNC ) & & ! ! ( HDR_LAYER_VAL ( mpegHead ) ) & & ( HDR_BITRATE_VAL ( mpegHead ) ! = 0x0F ) & & ( HDR_SAMPLERATE_VAL ( mpegHead ) ! = 0x03 ) ; <nl> + <nl> + if ( header . at ( 0 ) = = ' O ' & & header . at ( 1 ) = = ' g ' & & header . at ( 2 ) = = ' g ' & & header . at ( 3 ) = = ' S ' ) { <nl> + j = _loaders . insert ( audio , new OggOpusLoader ( m . fname , m . data ) ) ; <nl> + } else if ( header . at ( 4 ) = = ' f ' & & header . at ( 5 ) = = ' t ' & & header . at ( 6 ) = = ' y ' & & header . at ( 7 ) = = ' p ' ) { <nl> + j = _loaders . insert ( audio , new FAADMp4Loader ( m . fname , m . data ) ) ; <nl> + } else if ( ( header . at ( 0 ) = = ' I ' & & header . at ( 1 ) = = ' D ' & & header . at ( 2 ) = = ' 3 ' ) | | validMpegHead ) { <nl> + if ( m . data . isEmpty ( ) ) { <nl> + QFile f ( m . fname ) ; <nl> + f . open ( QIODevice : : ReadOnly ) ; <nl> + m . data = f . readAll ( ) ; <nl> + m . fname = QString ( ) ; <nl> + } <nl> + j = _loaders . insert ( audio , new Mpg123Loader ( m . fname , m . data ) ) ; <nl> } else { <nl> - l - > file = op_open_memory ( ( const unsigned char * ) m . data . constData ( ) , m . data . size ( ) , & ret ) ; <nl> + LOG ( ( " Audio Error : could not guess file format from header , header % 1 file ' % 2 ' , data size % 3 " ) . arg ( mb ( header . constData ( ) , header . size ( ) ) . str ( ) ) . arg ( m . fname ) . arg ( m . data . isEmpty ( ) ? QFileInfo ( m . fname ) . size ( ) : m . data . size ( ) ) ) ; <nl> + m . state = VoiceMessageStoppedAtStart ; <nl> + return emit error ( audio ) ; <nl> } <nl> - if ( ! l - > file ) { <nl> - LOG ( ( " Audio Error : op_open_file failed for ' % 1 ' , data size ' % 2 ' , error code % 3 " ) . arg ( m . fname ) . arg ( m . data . size ( ) ) . arg ( ret ) ) ; <nl> - m . state = VoiceMessageStopped ; <nl> + l = j . value ( ) ; <nl> + <nl> + int ret ; <nl> + if ( ! l - > open ( ) ) { <nl> + m . state = VoiceMessageStoppedAtStart ; <nl> return loadError ( j ) ; <nl> } <nl> - ogg_int64_t duration = op_pcm_total ( l - > file , - 1 ) ; <nl> - if ( duration < 0 ) { <nl> - LOG ( ( " Audio Error : op_pcm_total failed to get full duration for ' % 1 ' , data size ' % 2 ' , error code % 3 " ) . arg ( m . fname ) . arg ( m . data . size ( ) ) . arg ( duration ) ) ; <nl> - m . state = VoiceMessageStopped ; <nl> + int64 duration = l - > duration ( ) ; <nl> + if ( duration < = 0 ) { <nl> + m . state = VoiceMessageStoppedAtStart ; <nl> return loadError ( j ) ; <nl> } <nl> m . duration = duration ; <nl> + m . frequency = l - > frequency ( ) ; <nl> + if ( ! m . frequency ) m . frequency = AudioVoiceMsgFrequency ; <nl> m . skipStart = 0 ; <nl> m . skipEnd = duration ; <nl> m . position = 0 ; <nl> void VoiceMessagesLoader : : onLoad ( AudioData * audio ) { <nl> return ; <nl> } <nl> if ( started ) { <nl> - l - > pcm_offset = op_pcm_tell ( l - > file ) ; <nl> - l - > pcm_print_offset = l - > pcm_offset - AudioVoiceMsgFrequency ; <nl> + l - > started ( ) ; <nl> } <nl> <nl> bool finished = false ; <nl> - DEBUG_LOG ( ( " Audio Info : reading buffer for file ' % 1 ' , data size ' % 2 ' , current pcm_offset % 3 " ) . arg ( l - > fname ) . arg ( l - > data . size ( ) ) . arg ( l - > pcm_offset ) ) ; <nl> <nl> QByteArray result ; <nl> - int64 samplesAdded = 0 ; <nl> + int64 samplesAdded = 0 , frequency = l - > frequency ( ) , format = l - > format ( ) ; <nl> while ( result . size ( ) < AudioVoiceMsgBufferSize ) { <nl> - opus_int16 pcm [ AudioVoiceMsgFrequency * AudioVoiceMsgChannels ] ; <nl> - <nl> - int ret = op_read_stereo ( l - > file , pcm , sizeof ( pcm ) / sizeof ( * pcm ) ) ; <nl> - if ( ret < 0 ) { <nl> - / * { <nl> - QMutexLocker lock ( & voicemsgsMutex ) ; <nl> - VoiceMessages * voice = audioVoice ( ) ; <nl> - if ( voice ) { <nl> - VoiceMessages : : Msg & m ( voice - > _data [ audioindex ] ) ; <nl> - if ( m . audio = = audio ) { <nl> - m . state = VoiceMessageStopped ; <nl> - } <nl> - } <nl> - } * / <nl> - LOG ( ( " Audio Error : op_read_stereo failed , error code % 1 ( corrupted voice message ? ) " ) . arg ( ret ) ) ; <nl> - finished = true ; <nl> - break ; <nl> - / / return loadError ( j ) ; <nl> - } <nl> - <nl> - int li = op_current_link ( l - > file ) ; <nl> - if ( li ! = l - > prev_li ) { <nl> - const OpusHead * head = op_head ( l - > file , li ) ; <nl> - const OpusTags * tags = op_tags ( l - > file , li ) ; <nl> - for ( int32 ci = 0 ; ci < tags - > comments ; + + ci ) { <nl> - const char * comment = tags - > user_comments [ ci ] ; <nl> - if ( opus_tagncompare ( " METADATA_BLOCK_PICTURE " , 22 , comment ) = = 0 ) { <nl> - OpusPictureTag pic ; <nl> - int err = opus_picture_tag_parse ( & pic , comment ) ; <nl> - if ( err > = 0 ) { <nl> - opus_picture_tag_clear ( & pic ) ; <nl> - } <nl> - } <nl> - } <nl> - if ( ! op_seekable ( l - > file ) ) { <nl> - l - > pcm_offset = op_pcm_tell ( l - > file ) - ret ; <nl> - } <nl> - } <nl> - if ( li ! = l - > prev_li | | l - > pcm_offset > = l - > pcm_print_offset + AudioVoiceMsgFrequency ) { <nl> - l - > pcm_print_offset = l - > pcm_offset ; <nl> - } <nl> - l - > pcm_offset = op_pcm_tell ( l - > file ) ; <nl> - <nl> - if ( ! ret ) { <nl> - DEBUG_LOG ( ( " Audio Info : read completed " ) ) ; <nl> + if ( ! l - > readMore ( result , samplesAdded ) ) { <nl> finished = true ; <nl> break ; <nl> } <nl> - result . append ( ( const char * ) pcm , sizeof ( * pcm ) * ret * AudioVoiceMsgChannels ) ; <nl> - l - > prev_li = li ; <nl> - samplesAdded + = ret ; <nl> - <nl> { <nl> QMutexLocker lock ( & voicemsgsMutex ) ; <nl> VoiceMessages * voice = audioVoice ( ) ; <nl> if ( ! voice ) return ; <nl> <nl> VoiceMessages : : Msg & m ( voice - > _data [ audioindex ] ) ; <nl> - if ( m . audio ! = audio | | ! m . loading | | m . fname ! = l - > fname | | m . data . size ( ) ! = l - > data . size ( ) ) { <nl> + if ( m . audio ! = audio | | ! m . loading | | ! l - > check ( m . fname , m . data ) ) { <nl> LOG ( ( " Audio Error : playing changed while loading " ) ) ; <nl> m . state = VoiceMessageStopped ; <nl> return loadError ( j ) ; <nl> void VoiceMessagesLoader : : onLoad ( AudioData * audio ) { <nl> if ( ! voice ) return ; <nl> <nl> VoiceMessages : : Msg & m ( voice - > _data [ audioindex ] ) ; <nl> - if ( m . audio ! = audio | | ! m . loading | | m . fname ! = l - > fname | | m . data . size ( ) ! = l - > data . size ( ) ) { <nl> + if ( m . audio ! = audio | | ! m . loading | | ! l - > check ( m . fname , m . data ) ) { <nl> LOG ( ( " Audio Error : playing changed while loading " ) ) ; <nl> m . state = VoiceMessageStopped ; <nl> return loadError ( j ) ; <nl> void VoiceMessagesLoader : : onLoad ( AudioData * audio ) { <nl> } <nl> <nl> m . samplesCount [ m . nextBuffer ] = samplesAdded ; <nl> - alBufferData ( m . buffers [ m . nextBuffer ] , AL_FORMAT_STEREO16 , result . constData ( ) , result . size ( ) , AudioVoiceMsgFrequency ) ; <nl> + alBufferData ( m . buffers [ m . nextBuffer ] , format , result . constData ( ) , result . size ( ) , frequency ) ; <nl> alSourceQueueBuffers ( m . source , 1 , m . buffers + m . nextBuffer ) ; <nl> m . skipEnd - = samplesAdded ; <nl> <nl> void VoiceMessagesLoader : : onLoad ( AudioData * audio ) { <nl> } <nl> } <nl> <nl> - void VoiceMessagesLoader : : onCancel ( AudioData * audio ) { <nl> + void VoiceMessagesLoaders : : onCancel ( AudioData * audio ) { <nl> Loaders : : iterator i = _loaders . find ( audio ) ; <nl> if ( i ! = _loaders . end ( ) ) { <nl> delete ( * i ) ; <nl> mmm a / Telegram / SourceFiles / audio . h <nl> ppp b / Telegram / SourceFiles / audio . h <nl> void audioFinish ( ) ; <nl> <nl> enum VoiceMessageState { <nl> VoiceMessageStopped , <nl> + VoiceMessageStoppedAtStart , <nl> VoiceMessageStarting , <nl> VoiceMessagePlaying , <nl> VoiceMessageFinishing , <nl> class VoiceMessages : public QObject { <nl> void play ( AudioData * audio ) ; <nl> void pauseresume ( ) ; <nl> <nl> - void currentState ( AudioData * * audio , VoiceMessageState * state = 0 , int64 * position = 0 , int64 * duration = 0 ) ; <nl> + void currentState ( AudioData * * audio , VoiceMessageState * state = 0 , int64 * position = 0 , int64 * duration = 0 , int32 * frequency = 0 ) ; <nl> + void clearStoppedAtStart ( AudioData * audio ) ; <nl> void processContext ( ) ; <nl> <nl> ~ VoiceMessages ( ) ; <nl> public slots : <nl> bool updateCurrentStarted ( int32 pos = - 1 ) ; <nl> <nl> struct Msg { <nl> - Msg ( ) : audio ( 0 ) , position ( 0 ) , duration ( 0 ) , skipStart ( 0 ) , skipEnd ( 0 ) , loading ( 0 ) , started ( 0 ) , <nl> + Msg ( ) : audio ( 0 ) , position ( 0 ) , duration ( 0 ) , frequency ( AudioVoiceMsgFrequency ) , skipStart ( 0 ) , skipEnd ( 0 ) , loading ( 0 ) , started ( 0 ) , <nl> state ( VoiceMessageStopped ) , source ( 0 ) , nextBuffer ( 0 ) { <nl> memset ( buffers , 0 , sizeof ( buffers ) ) ; <nl> memset ( samplesCount , 0 , sizeof ( samplesCount ) ) ; <nl> public slots : <nl> QString fname ; <nl> QByteArray data ; <nl> int64 position , duration ; <nl> + int32 frequency ; <nl> int64 skipStart , skipEnd ; <nl> bool loading ; <nl> int64 started ; <nl> public slots : <nl> QMutex _mutex ; <nl> <nl> friend class VoiceMessagesFader ; <nl> - friend class VoiceMessagesLoader ; <nl> + friend class VoiceMessagesLoaders ; <nl> <nl> QThread _faderThread ; <nl> QThread _loaderThread ; <nl> VoiceMessagesFader * _fader ; <nl> - VoiceMessagesLoader * _loader ; <nl> + VoiceMessagesLoaders * _loader ; <nl> <nl> } ; <nl> <nl> public slots : <nl> <nl> } ; <nl> <nl> - class VoiceMessagesLoader : public QObject { <nl> + class VoiceMessagesLoader ; <nl> + class VoiceMessagesLoaders : public QObject { <nl> Q_OBJECT <nl> <nl> public : <nl> <nl> - VoiceMessagesLoader ( QThread * thread ) ; <nl> - ~ VoiceMessagesLoader ( ) ; <nl> + VoiceMessagesLoaders ( QThread * thread ) ; <nl> + ~ VoiceMessagesLoaders ( ) ; <nl> <nl> signals : <nl> <nl> public slots : <nl> <nl> private : <nl> <nl> - struct Loader ; <nl> - typedef QMap < AudioData * , Loader * > Loaders ; <nl> + typedef QMap < AudioData * , VoiceMessagesLoader * > Loaders ; <nl> Loaders _loaders ; <nl> <nl> void loadError ( Loaders : : iterator i ) ; <nl> mmm a / Telegram / SourceFiles / gui / emoji_config . h <nl> ppp b / Telegram / SourceFiles / gui / emoji_config . h <nl> inline EmojiPtr emojiFromUrl ( const QString & url ) { <nl> } <nl> <nl> inline EmojiPtr emojiFromText ( const QChar * ch , const QChar * e , int & len ) { <nl> - QString tmp ( ch , e - ch ) ; <nl> - QByteArray tmp2 = tmp . toUtf8 ( ) ; <nl> - const char * tmp3 = tmp2 . constData ( ) ; <nl> EmojiPtr emoji = 0 ; <nl> if ( ch + 1 < e & & ( ( ch - > isHighSurrogate ( ) & & ( ch + 1 ) - > isLowSurrogate ( ) ) | | ( ( ( ch - > unicode ( ) > = 48 & & ch - > unicode ( ) < 58 ) | | ch - > unicode ( ) = = 35 ) & & ( ch + 1 ) - > unicode ( ) = = 0x20E3 ) ) ) { <nl> uint32 code = ( ch - > unicode ( ) < < 16 ) | ( ch + 1 ) - > unicode ( ) ; <nl> mmm a / Telegram / SourceFiles / history . cpp <nl> ppp b / Telegram / SourceFiles / history . cpp <nl> void HistoryAudio : : draw ( QPainter & p , const HistoryItem * parent , bool selected , i <nl> width = _maxw ; <nl> } <nl> <nl> - bool mp3 = ( data - > mime = = QLatin1String ( " audio / mp3 " ) ) ; <nl> - if ( ! data - > loader & & ! mp3 & & data - > status ! = FileFailed & & ! already & & ! hasdata & & data - > size < AudioVoiceMsgInMemory ) { <nl> + if ( ! data - > loader & & data - > status ! = FileFailed & & ! already & & ! hasdata & & data - > size < AudioVoiceMsgInMemory ) { <nl> data - > save ( QString ( ) ) ; <nl> } <nl> <nl> void HistoryAudio : : draw ( QPainter & p , const HistoryItem * parent , bool selected , i <nl> AudioData * playing = 0 ; <nl> VoiceMessageState playingState = VoiceMessageStopped ; <nl> int64 playingPosition = 0 , playingDuration = 0 ; <nl> - if ( ! mp3 & & audioVoice ( ) ) { <nl> - audioVoice ( ) - > currentState ( & playing , & playingState , & playingPosition , & playingDuration ) ; <nl> + int32 playingFrequency = 0 ; <nl> + if ( audioVoice ( ) ) { <nl> + audioVoice ( ) - > currentState ( & playing , & playingState , & playingPosition , & playingDuration , & playingFrequency ) ; <nl> } <nl> + <nl> QRect img ; <nl> - if ( ! mp3 & & ( already | | hasdata ) ) { <nl> + if ( already | | hasdata ) { <nl> bool showPause = ( playing = = data ) & & ( playingState = = VoiceMessagePlaying | | playingState = = VoiceMessageResuming | | playingState = = VoiceMessageStarting ) ; <nl> img = out ? ( showPause ? st : : mediaPauseOutImg : st : : mediaPlayOutImg ) : ( showPause ? st : : mediaPauseInImg : st : : mediaPlayInImg ) ; <nl> } else { <nl> void HistoryAudio : : draw ( QPainter & p , const HistoryItem * parent , bool selected , i <nl> <nl> style : : color status ( selected ? ( out ? st : : mediaOutSelectColor : st : : mediaInSelectColor ) : ( out ? st : : mediaOutColor : st : : mediaInColor ) ) ; <nl> p . setPen ( status - > p ) ; <nl> - if ( ! mp3 & & ( already | | hasdata ) ) { <nl> - if ( playing = = data & & playingState ! = VoiceMessageStopped ) { <nl> - statusText = formatDurationText ( playingPosition / AudioVoiceMsgFrequency ) + qsl ( " / " ) + formatDurationText ( playingDuration / AudioVoiceMsgFrequency ) ; <nl> + if ( already | | hasdata ) { <nl> + if ( playing = = data & & playingState ! = VoiceMessageStopped & & playingState ! = VoiceMessageStoppedAtStart ) { <nl> + statusText = formatDurationText ( playingPosition / ( playingFrequency ? playingFrequency : AudioVoiceMsgFrequency ) ) + qsl ( " / " ) + formatDurationText ( playingDuration / ( playingFrequency ? playingFrequency : AudioVoiceMsgFrequency ) ) ; <nl> } else { <nl> statusText = formatDurationText ( data - > duration ) ; <nl> } <nl> mmm a / Telegram / SourceFiles / mainwidget . cpp <nl> ppp b / Telegram / SourceFiles / mainwidget . cpp <nl> void MainWidget : : audioLoadProgress ( mtpFileLoader * loader ) { <nl> if ( audio - > loader ) { <nl> if ( audio - > loader - > done ( ) ) { <nl> audio - > finish ( ) ; <nl> - bool mp3 = ( audio - > mime = = QLatin1String ( " audio / mp3 " ) ) ; <nl> QString already = audio - > already ( ) ; <nl> - bool play = ! mp3 & & audio - > openOnSave > 0 & & audioVoice ( ) ; <nl> + bool play = audio - > openOnSave > 0 & & audioVoice ( ) ; <nl> if ( ( ! already . isEmpty ( ) & & audio - > openOnSave ) | | ( ! audio - > data . isEmpty ( ) & & play ) ) { <nl> if ( play ) { <nl> AudioData * playing = 0 ; <nl> void MainWidget : : audioLoadProgress ( mtpFileLoader * loader ) { <nl> } <nl> <nl> void MainWidget : : audioPlayProgress ( AudioData * audio ) { <nl> + AudioData * playing = 0 ; <nl> + VoiceMessageState state = VoiceMessageStopped ; <nl> + audioVoice ( ) - > currentState ( & playing , & state ) ; <nl> + if ( playing = = audio & & state = = VoiceMessageStoppedAtStart ) { <nl> + audioVoice ( ) - > clearStoppedAtStart ( audio ) ; <nl> + QString already = audio - > already ( true ) ; <nl> + if ( already . isEmpty ( ) & & ! audio - > data . isEmpty ( ) ) { <nl> + bool mp3 = ( audio - > mime = = QLatin1String ( " audio / mp3 " ) ) ; <nl> + QString filename = saveFileName ( lang ( lng_save_audio ) , mp3 ? qsl ( " MP3 Audio ( * . mp3 ) ; ; All files ( * . * ) " ) : qsl ( " OGG Opus Audio ( * . ogg ) ; ; All files ( * . * ) " ) , qsl ( " audio " ) , mp3 ? qsl ( " . mp3 " ) : qsl ( " . ogg " ) , false ) ; <nl> + if ( ! filename . isEmpty ( ) ) { <nl> + QFile f ( filename ) ; <nl> + if ( f . open ( QIODevice : : WriteOnly ) ) { <nl> + if ( f . write ( audio - > data ) = = audio - > data . size ( ) ) { <nl> + f . close ( ) ; <nl> + already = filename ; <nl> + audio - > location = FileLocation ( mtpToStorageType ( mtpc_storage_filePartial ) , filename ) ; <nl> + Local : : writeFileLocation ( mediaKey ( mtpToLocationType ( mtpc_inputAudioFileLocation ) , audio - > dc , audio - > id ) , FileLocation ( mtpToStorageType ( mtpc_storage_filePartial ) , filename ) ) ; <nl> + } <nl> + } <nl> + } <nl> + } <nl> + if ( ! already . isEmpty ( ) ) { <nl> + psOpenFile ( already ) ; <nl> + } <nl> + } <nl> + <nl> const AudioItems & items ( App : : audioItems ( ) ) ; <nl> AudioItems : : const_iterator i = items . constFind ( audio ) ; <nl> if ( i ! = items . cend ( ) ) { <nl> mmm a / Telegram / SourceFiles / structs . cpp <nl> ppp b / Telegram / SourceFiles / structs . cpp <nl> void AudioOpenLink : : onClick ( Qt : : MouseButton button ) const { <nl> AudioData * data = audio ( ) ; <nl> if ( ( ! data - > user & & ! data - > date ) | | button ! = Qt : : LeftButton ) return ; <nl> <nl> - bool mp3 = ( data - > mime = = QLatin1String ( " audio / mp3 " ) ) ; <nl> - <nl> QString already = data - > already ( true ) ; <nl> - bool play = ! mp3 & & audioVoice ( ) ; <nl> + bool play = audioVoice ( ) ; <nl> if ( ! already . isEmpty ( ) | | ( ! data - > data . isEmpty ( ) & & play ) ) { <nl> if ( play ) { <nl> AudioData * playing = 0 ; <nl> void AudioOpenLink : : onClick ( Qt : : MouseButton button ) const { <nl> <nl> if ( data - > status ! = FileReady ) return ; <nl> <nl> + bool mp3 = ( data - > mime = = QLatin1String ( " audio / mp3 " ) ) ; <nl> QString filename = saveFileName ( lang ( lng_save_audio ) , mp3 ? qsl ( " MP3 Audio ( * . mp3 ) ; ; All files ( * . * ) " ) : qsl ( " OGG Opus Audio ( * . ogg ) ; ; All files ( * . * ) " ) , qsl ( " audio " ) , mp3 ? qsl ( " . mp3 " ) : qsl ( " . ogg " ) , false ) ; <nl> if ( ! filename . isEmpty ( ) ) { <nl> data - > openOnSave = 1 ; <nl> mmm a / Telegram / Telegram . vcxproj <nl> ppp b / Telegram / Telegram . vcxproj <nl> <nl> < ItemDefinitionGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > <nl> < ClCompile > <nl> < PreprocessorDefinitions > AL_LIBTYPE_STATIC ; UNICODE ; WIN32 ; WIN64 ; HAVE_STDINT_H ; ZLIB_WINAPI ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> - < AdditionalIncludeDirectories > . \ . . \ . . \ Libraries \ lzma \ C ; . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 ; . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 ; . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include ; . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include ; . \ . . \ . . \ Libraries \ opus \ include ; . \ . . \ . . \ Libraries \ opusfile \ include ; . \ . . \ . . \ Libraries \ openal - soft \ include ; . \ SourceFiles ; . \ GeneratedFiles ; . ; $ ( QTDIR ) \ include ; . \ GeneratedFiles \ $ ( ConfigurationName ) ; . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore ; . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> + < AdditionalIncludeDirectories > . \ . . \ . . \ Libraries \ lzma \ C ; . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 ; . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 ; . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include ; . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include ; . \ . . \ . . \ Libraries \ opus \ include ; . \ . . \ . . \ Libraries \ opusfile \ include ; . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + ; . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 ; . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include ; . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff ; . \ . . \ . . \ Libraries \ openal - soft \ include ; . \ SourceFiles ; . \ GeneratedFiles ; . ; $ ( QTDIR ) \ include ; . \ GeneratedFiles \ $ ( ConfigurationName ) ; . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore ; . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> < DebugInformationFormat > ProgramDatabase < / DebugInformationFormat > <nl> < TreatWChar_tAsBuiltInType > false < / TreatWChar_tAsBuiltInType > <nl> < PrecompiledHeader > Use < / PrecompiledHeader > <nl> <nl> < Link > <nl> < SubSystem > Windows < / SubSystem > <nl> < OutputFile > $ ( OutDir ) $ ( ProjectName ) . exe < / OutputFile > <nl> - < AdditionalLibraryDirectories > . \ . . \ . . \ Libraries \ lzma \ C \ Util \ LzmaLib \ Debug ; . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 \ win32 \ Debug ; . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ win32 \ VS2010 \ Win32 \ Debug ; . \ . . \ . . \ Libraries \ opus \ win32 \ VS2010 \ Win32 \ Debug ; . \ . . \ . . \ Libraries \ opusfile \ win32 \ VS2010 \ Win32 \ Debug ; . \ . . \ . . \ Libraries \ openal - soft \ build \ Debug ; . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 \ contrib \ vstudio \ vc11 \ x86 \ ZlibStatDebug ; . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ lib \ VC \ static ; $ ( QTDIR ) \ lib ; $ ( QTDIR ) \ plugins ; % ( AdditionalLibraryDirectories ) < / AdditionalLibraryDirectories > <nl> - < AdditionalDependencies > kernel32 . lib ; user32 . lib ; shell32 . lib ; uuid . lib ; ole32 . lib ; advapi32 . lib ; ws2_32 . lib ; gdi32 . lib ; comdlg32 . lib ; oleaut32 . lib ; imm32 . lib ; winmm . lib ; qtmaind . lib ; glu32 . lib ; opengl32 . lib ; Strmiids . lib ; Qt5Cored . lib ; Qt5Guid . lib ; qtharfbuzzngd . lib ; Qt5Widgetsd . lib ; Qt5Networkd . lib ; Qt5PlatformSupportd . lib ; platforms \ qwindowsd . lib ; imageformats \ qwebpd . lib ; libeay32MTd . lib ; ssleay32MTd . lib ; Crypt32 . lib ; zlibstat . lib ; LzmaLib . lib ; lib_exif . lib ; UxTheme . lib ; DbgHelp . lib ; OpenAL32 . lib ; common . lib ; opusfile . lib ; opus . lib ; libogg_static . lib ; celt . lib ; silk_common . lib ; silk_float . lib ; % ( AdditionalDependencies ) < / AdditionalDependencies > <nl> + < AdditionalLibraryDirectories > . \ . . \ . . \ Libraries \ lzma \ C \ Util \ LzmaLib \ Debug ; . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 \ win32 \ Debug ; . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ win32 \ VS2010 \ Win32 \ Debug ; . \ . . \ . . \ Libraries \ opus \ win32 \ VS2010 \ Win32 \ Debug ; . \ . . \ . . \ Libraries \ opusfile \ win32 \ VS2010 \ Win32 \ Debug ; . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + \ 2010 \ libmpg123 \ Debug ; . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ libfaad \ Debug ; . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff \ Debug ; . \ . . \ . . \ Libraries \ openal - soft \ build \ Debug ; . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 \ contrib \ vstudio \ vc11 \ x86 \ ZlibStatDebug ; . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ lib \ VC \ static ; $ ( QTDIR ) \ lib ; $ ( QTDIR ) \ plugins ; % ( AdditionalLibraryDirectories ) < / AdditionalLibraryDirectories > <nl> + < AdditionalDependencies > kernel32 . lib ; user32 . lib ; shell32 . lib ; uuid . lib ; ole32 . lib ; advapi32 . lib ; ws2_32 . lib ; gdi32 . lib ; comdlg32 . lib ; oleaut32 . lib ; imm32 . lib ; winmm . lib ; qtmaind . lib ; glu32 . lib ; opengl32 . lib ; Strmiids . lib ; Qt5Cored . lib ; Qt5Guid . lib ; qtharfbuzzngd . lib ; Qt5Widgetsd . lib ; Qt5Networkd . lib ; Qt5PlatformSupportd . lib ; platforms \ qwindowsd . lib ; imageformats \ qwebpd . lib ; libeay32MTd . lib ; ssleay32MTd . lib ; Crypt32 . lib ; zlibstat . lib ; LzmaLib . lib ; lib_exif . lib ; UxTheme . lib ; DbgHelp . lib ; OpenAL32 . lib ; common . lib ; opusfile . lib ; opus . lib ; libogg_static . lib ; libmpg123 . lib ; libfaad . lib ; mp4ff . lib ; celt . lib ; silk_common . lib ; silk_float . lib ; % ( AdditionalDependencies ) < / AdditionalDependencies > <nl> < GenerateDebugInformation > true < / GenerateDebugInformation > <nl> < ImageHasSafeExceptionHandlers / > <nl> < IgnoreSpecificDefaultLibraries > <nl> <nl> < AdditionalInputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > $ ( QTDIR ) \ bin \ moc . exe ; % ( FullPath ) < / AdditionalInputs > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing types . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / types . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / types . h " < / Command > <nl> < AdditionalInputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > $ ( QTDIR ) \ bin \ moc . exe ; % ( FullPath ) < / AdditionalInputs > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing types . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < CustomBuild Include = " SourceFiles \ window . h " > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing window . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / window . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / window . h " < / Command > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing window . h . . . < / Message > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Deploy | Win32 ' " > Moc % 27ing window . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < CustomBuild Include = " SourceFiles \ application . h " > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing application . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / application . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / application . h " < / Command > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing application . h . . . < / Message > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Deploy | Win32 ' " > Moc % 27ing application . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < AdditionalInputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > $ ( QTDIR ) \ bin \ moc . exe ; % ( FullPath ) < / AdditionalInputs > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing apiwrap . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " " - fstdafx . h " " - f . . / . . / SourceFiles / apiwrap . h " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / apiwrap . h " < / Command > <nl> < AdditionalInputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > $ ( QTDIR ) \ bin \ moc . exe ; % ( FullPath ) < / AdditionalInputs > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing apiwrap . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < CustomBuild Include = " SourceFiles \ boxes \ aboutbox . h " > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing aboutbox . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / boxes / aboutbox . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / boxes / aboutbox . h " < / Command > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing aboutbox . h . . . < / Message > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Deploy | Win32 ' " > Moc % 27ing aboutbox . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < CustomBuild Include = " SourceFiles \ boxes \ addcontactbox . h " > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing addcontactbox . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / boxes / addcontactbox . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / boxes / addcontactbox . h " < / Command > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing addcontactbox . h . . . < / Message > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Deploy | Win32 ' " > Moc % 27ing addcontactbox . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < CustomBuild Include = " SourceFiles \ boxes \ confirmbox . h " > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing confirmbox . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / boxes / confirmbox . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / boxes / confirmbox . h " < / Command > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing confirmbox . h . . . < / Message > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Deploy | Win32 ' " > Moc % 27ing confirmbox . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < CustomBuild Include = " SourceFiles \ boxes \ connectionbox . h " > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing connectionbox . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / boxes / connectionbox . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / boxes / connectionbox . h " < / Command > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing connectionbox . h . . . < / Message > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Deploy | Win32 ' " > Moc % 27ing connectionbox . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < CustomBuild Include = " SourceFiles \ boxes \ contactsbox . h " > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing contactsbox . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / boxes / contactsbox . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / boxes / contactsbox . h " < / Command > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing contactsbox . h . . . < / Message > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Deploy | Win32 ' " > Moc % 27ing contactsbox . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < CustomBuild Include = " SourceFiles \ boxes \ photocropbox . h " > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing photocropbox . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / boxes / photocropbox . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / boxes / photocropbox . h " < / Command > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing photocropbox . h . . . < / Message > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Deploy | Win32 ' " > Moc % 27ing photocropbox . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < CustomBuild Include = " SourceFiles \ boxes \ photosendbox . h " > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing photosendbox . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / boxes / photosendbox . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / boxes / photosendbox . h " < / Command > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing photosendbox . h . . . < / Message > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Deploy | Win32 ' " > Moc % 27ing photosendbox . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < CustomBuild Include = " SourceFiles \ boxes \ emojibox . h " > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing emojibox . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / boxes / emojibox . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / boxes / emojibox . h " < / Command > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing emojibox . h . . . < / Message > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Deploy | Win32 ' " > Moc % 27ing emojibox . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < CustomBuild Include = " SourceFiles \ boxes \ downloadpathbox . h " > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing downloadpathbox . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / boxes / downloadpathbox . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / boxes / downloadpathbox . h " < / Command > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing downloadpathbox . h . . . < / Message > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Deploy | Win32 ' " > Moc % 27ing downloadpathbox . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < AdditionalInputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > $ ( QTDIR ) \ bin \ moc . exe ; % ( FullPath ) < / AdditionalInputs > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing audio . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / audio . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / audio . h " < / Command > <nl> < AdditionalInputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > $ ( QTDIR ) \ bin \ moc . exe ; % ( FullPath ) < / AdditionalInputs > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing audio . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < AdditionalInputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > $ ( QTDIR ) \ bin \ moc . exe ; % ( FullPath ) < / AdditionalInputs > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing usernamebox . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / boxes / usernamebox . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / boxes / usernamebox . h " < / Command > <nl> < AdditionalInputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > $ ( QTDIR ) \ bin \ moc . exe ; % ( FullPath ) < / AdditionalInputs > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing usernamebox . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < AdditionalInputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > $ ( QTDIR ) \ bin \ moc . exe ; % ( FullPath ) < / AdditionalInputs > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing languagebox . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / boxes / languagebox . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / boxes / languagebox . h " < / Command > <nl> < AdditionalInputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > $ ( QTDIR ) \ bin \ moc . exe ; % ( FullPath ) < / AdditionalInputs > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing languagebox . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < AdditionalInputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > $ ( QTDIR ) \ bin \ moc . exe ; % ( FullPath ) < / AdditionalInputs > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing backgroundbox . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / boxes / backgroundbox . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / boxes / backgroundbox . h " < / Command > <nl> < AdditionalInputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > $ ( QTDIR ) \ bin \ moc . exe ; % ( FullPath ) < / AdditionalInputs > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing backgroundbox . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < AdditionalInputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > $ ( QTDIR ) \ bin \ moc . exe ; % ( FullPath ) < / AdditionalInputs > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing autolockbox . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " " - fstdafx . h " " - f . . / . . / SourceFiles / boxes / autolockbox . h " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / boxes / autolockbox . h " < / Command > <nl> < AdditionalInputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > $ ( QTDIR ) \ bin \ moc . exe ; % ( FullPath ) < / AdditionalInputs > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing autolockbox . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < AdditionalInputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > $ ( QTDIR ) \ bin \ moc . exe ; % ( FullPath ) < / AdditionalInputs > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing passcodebox . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " " - fstdafx . h " " - f . . / . . / SourceFiles / boxes / passcodebox . h " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / boxes / passcodebox . h " < / Command > <nl> < AdditionalInputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > $ ( QTDIR ) \ bin \ moc . exe ; % ( FullPath ) < / AdditionalInputs > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing passcodebox . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < AdditionalInputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > $ ( QTDIR ) \ bin \ moc . exe ; % ( FullPath ) < / AdditionalInputs > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing sessionsbox . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " " - fstdafx . h " " - f . . / . . / SourceFiles / boxes / sessionsbox . h " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / boxes / sessionsbox . h " < / Command > <nl> < AdditionalInputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > $ ( QTDIR ) \ bin \ moc . exe ; % ( FullPath ) < / AdditionalInputs > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing sessionsbox . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < AdditionalInputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > $ ( QTDIR ) \ bin \ moc . exe ; % ( FullPath ) < / AdditionalInputs > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing abstractbox . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " " - fstdafx . h " " - f . . / . . / SourceFiles / boxes / abstractbox . h " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / boxes / abstractbox . h " < / Command > <nl> < AdditionalInputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > $ ( QTDIR ) \ bin \ moc . exe ; % ( FullPath ) < / AdditionalInputs > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing abstractbox . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < AdditionalInputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > $ ( QTDIR ) \ bin \ moc . exe ; % ( FullPath ) < / AdditionalInputs > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing stickersetbox . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " " - fstdafx . h " " - f . . / . . / SourceFiles / boxes / stickersetbox . h " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / boxes / stickersetbox . h " < / Command > <nl> < AdditionalInputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > $ ( QTDIR ) \ bin \ moc . exe ; % ( FullPath ) < / AdditionalInputs > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing stickersetbox . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < CustomBuild Include = " SourceFiles \ gui \ animation . h " > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing animation . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / gui / animation . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / gui / animation . h " < / Command > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing animation . h . . . < / Message > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Deploy | Win32 ' " > Moc % 27ing animation . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < CustomBuild Include = " SourceFiles \ gui \ button . h " > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing button . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / gui / button . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / gui / button . h " < / Command > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing button . h . . . < / Message > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Deploy | Win32 ' " > Moc % 27ing button . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < CustomBuild Include = " SourceFiles \ gui \ flatbutton . h " > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing flatbutton . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / gui / flatbutton . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / gui / flatbutton . h " < / Command > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing flatbutton . h . . . < / Message > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Deploy | Win32 ' " > Moc % 27ing flatbutton . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < CustomBuild Include = " SourceFiles \ gui \ flatinput . h " > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing flatinput . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / gui / flatinput . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / gui / flatinput . h " < / Command > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing flatinput . h . . . < / Message > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Deploy | Win32 ' " > Moc % 27ing flatinput . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < CustomBuild Include = " SourceFiles \ gui \ countrycodeinput . h " > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing countrycodeinput . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / gui / countrycodeinput . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / gui / countrycodeinput . h " < / Command > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing countrycodeinput . h . . . < / Message > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Deploy | Win32 ' " > Moc % 27ing countrycodeinput . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < CustomBuild Include = " SourceFiles \ gui \ phoneinput . h " > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing phoneinput . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / gui / phoneinput . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / gui / phoneinput . h " < / Command > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing phoneinput . h . . . < / Message > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Deploy | Win32 ' " > Moc % 27ing phoneinput . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < CustomBuild Include = " SourceFiles \ gui \ countryinput . h " > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing countryinput . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / gui / countryinput . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / gui / countryinput . h " < / Command > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing countryinput . h . . . < / Message > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Deploy | Win32 ' " > Moc % 27ing countryinput . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < CustomBuild Include = " SourceFiles \ gui \ scrollarea . h " > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing scrollarea . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / gui / scrollarea . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / gui / scrollarea . h " < / Command > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing scrollarea . h . . . < / Message > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Deploy | Win32 ' " > Moc % 27ing scrollarea . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < CustomBuild Include = " SourceFiles \ dialogswidget . h " > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing dialogswidget . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / dialogswidget . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / dialogswidget . h " < / Command > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing dialogswidget . h . . . < / Message > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Deploy | Win32 ' " > Moc % 27ing dialogswidget . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < CustomBuild Include = " SourceFiles \ gui \ flattextarea . h " > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing flattextarea . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / gui / flattextarea . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / gui / flattextarea . h " < / Command > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing flattextarea . h . . . < / Message > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Deploy | Win32 ' " > Moc % 27ing flattextarea . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < CustomBuild Include = " SourceFiles \ fileuploader . h " > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing fileuploader . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / fileuploader . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / fileuploader . h " < / Command > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing fileuploader . h . . . < / Message > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Deploy | Win32 ' " > Moc % 27ing fileuploader . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < CustomBuild Include = " SourceFiles \ dropdown . h " > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing dropdown . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / dropdown . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / dropdown . h " < / Command > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing dropdown . h . . . < / Message > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Deploy | Win32 ' " > Moc % 27ing dropdown . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < AdditionalInputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > $ ( QTDIR ) \ bin \ moc . exe ; % ( FullPath ) < / AdditionalInputs > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing contextmenu . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / gui / contextmenu . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / gui / contextmenu . h " < / Command > <nl> < AdditionalInputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > $ ( QTDIR ) \ bin \ moc . exe ; % ( FullPath ) < / AdditionalInputs > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing contextmenu . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < CustomBuild Include = " SourceFiles \ gui \ flatcheckbox . h " > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing flatcheckbox . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / gui / flatcheckbox . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / gui / flatcheckbox . h " < / Command > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing flatcheckbox . h . . . < / Message > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Deploy | Win32 ' " > Moc % 27ing flatcheckbox . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < CustomBuild Include = " SourceFiles \ gui \ flatlabel . h " > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing flatlabel . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / gui / flatlabel . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / gui / flatlabel . h " < / Command > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing flatlabel . h . . . < / Message > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Deploy | Win32 ' " > Moc % 27ing flatlabel . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < CustomBuild Include = " SourceFiles \ gui \ twidget . h " > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing twidget . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / gui / twidget . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / gui / twidget . h " < / Command > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing twidget . h . . . < / Message > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Deploy | Win32 ' " > Moc % 27ing twidget . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < AdditionalInputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > $ ( QTDIR ) \ bin \ moc . exe ; % ( FullPath ) < / AdditionalInputs > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing switcher . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / gui / switcher . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / gui / switcher . h " < / Command > <nl> < AdditionalInputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > $ ( QTDIR ) \ bin \ moc . exe ; % ( FullPath ) < / AdditionalInputs > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing switcher . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < AdditionalInputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > $ ( QTDIR ) \ bin \ moc . exe ; % ( FullPath ) < / AdditionalInputs > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing history . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / history . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / history . h " < / Command > <nl> < AdditionalInputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > $ ( QTDIR ) \ bin \ moc . exe ; % ( FullPath ) < / AdditionalInputs > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing history . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < CustomBuild Include = " SourceFiles \ historywidget . h " > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing historywidget . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / historywidget . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / historywidget . h " < / Command > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing historywidget . h . . . < / Message > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Deploy | Win32 ' " > Moc % 27ing historywidget . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < CustomBuild Include = " SourceFiles \ intro \ intro . h " > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing intro . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / intro / intro . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / intro / intro . h " < / Command > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing intro . h . . . < / Message > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Deploy | Win32 ' " > Moc % 27ing intro . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < CustomBuild Include = " SourceFiles \ intro \ introcode . h " > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing introcode . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / intro / introcode . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / intro / introcode . h " < / Command > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing introcode . h . . . < / Message > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Deploy | Win32 ' " > Moc % 27ing introcode . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < CustomBuild Include = " SourceFiles \ intro \ introphone . h " > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing introphone . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / intro / introphone . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / intro / introphone . h " < / Command > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing introphone . h . . . < / Message > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Deploy | Win32 ' " > Moc % 27ing introphone . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < CustomBuild Include = " SourceFiles \ intro \ introsignup . h " > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing introsignup . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / intro / introsignup . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / intro / introsignup . h " < / Command > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing introsignup . h . . . < / Message > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Deploy | Win32 ' " > Moc % 27ing introsignup . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < AdditionalInputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > $ ( QTDIR ) \ bin \ moc . exe ; % ( FullPath ) < / AdditionalInputs > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing intropwdcheck . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " " - fstdafx . h " " - f . . / . . / SourceFiles / intro / intropwdcheck . h " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / intro / intropwdcheck . h " < / Command > <nl> < AdditionalInputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > $ ( QTDIR ) \ bin \ moc . exe ; % ( FullPath ) < / AdditionalInputs > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing intropwdcheck . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < CustomBuild Include = " SourceFiles \ layerwidget . h " > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing layerwidget . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / layerwidget . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / layerwidget . h " < / Command > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing layerwidget . h . . . < / Message > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Deploy | Win32 ' " > Moc % 27ing layerwidget . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < CustomBuild Include = " SourceFiles \ localimageloader . h " > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing localimageloader . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / localimageloader . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / localimageloader . h " < / Command > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing localimageloader . h . . . < / Message > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Deploy | Win32 ' " > Moc % 27ing localimageloader . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < AdditionalInputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > $ ( QTDIR ) \ bin \ moc . exe ; % ( FullPath ) < / AdditionalInputs > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing localstorage . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / localstorage . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / localstorage . h " < / Command > <nl> < AdditionalInputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > $ ( QTDIR ) \ bin \ moc . exe ; % ( FullPath ) < / AdditionalInputs > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing localstorage . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < CustomBuild Include = " SourceFiles \ mtproto \ mtpConnection . h " > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing mtpConnection . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / mtproto / mtpConnection . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / mtproto / mtpConnection . h " < / Command > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing mtpConnection . h . . . < / Message > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Deploy | Win32 ' " > Moc % 27ing mtpConnection . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < CustomBuild Include = " SourceFiles \ mainwidget . h " > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing mainwidget . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / mainwidget . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / mainwidget . h " < / Command > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing mainwidget . h . . . < / Message > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Deploy | Win32 ' " > Moc % 27ing mainwidget . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < CustomBuild Include = " SourceFiles \ mtproto \ mtp . h " > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing mtp . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / mtproto / mtp . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / mtproto / mtp . h " < / Command > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing mtp . h . . . < / Message > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Deploy | Win32 ' " > Moc % 27ing mtp . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < AdditionalInputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > $ ( QTDIR ) \ bin \ moc . exe ; % ( FullPath ) < / AdditionalInputs > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing mediaview . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / mediaview . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / mediaview . h " < / Command > <nl> < AdditionalInputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > $ ( QTDIR ) \ bin \ moc . exe ; % ( FullPath ) < / AdditionalInputs > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing mediaview . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < CustomBuild Include = " SourceFiles \ mtproto \ mtpFileLoader . h " > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing mtpFileLoader . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / mtproto / mtpFileLoader . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / mtproto / mtpFileLoader . h " < / Command > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing mtpFileLoader . h . . . < / Message > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Deploy | Win32 ' " > Moc % 27ing mtpFileLoader . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < CustomBuild Include = " SourceFiles \ mtproto \ mtpDC . h " > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing mtpDC . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / mtproto / mtpDC . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / mtproto / mtpDC . h " < / Command > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing mtpDC . h . . . < / Message > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Deploy | Win32 ' " > Moc % 27ing mtpDC . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < CustomBuild Include = " SourceFiles \ mtproto \ mtpSession . h " > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing mtpSession . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / mtproto / mtpSession . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / mtproto / mtpSession . h " < / Command > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing mtpSession . h . . . < / Message > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Deploy | Win32 ' " > Moc % 27ing mtpSession . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < CustomBuild Include = " SourceFiles \ settingswidget . h " > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing settingswidget . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / settingswidget . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / settingswidget . h " < / Command > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing settingswidget . h . . . < / Message > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Deploy | Win32 ' " > Moc % 27ing settingswidget . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < CustomBuild Include = " SourceFiles \ profilewidget . h " > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing profilewidget . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / profilewidget . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / profilewidget . h " < / Command > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing profilewidget . h . . . < / Message > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Deploy | Win32 ' " > Moc % 27ing profilewidget . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < CustomBuild Include = " SourceFiles \ pspecific_wnd . h " > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing pspecific_wnd . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / pspecific_wnd . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / pspecific_wnd . h " < / Command > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing pspecific_wnd . h . . . < / Message > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Deploy | Win32 ' " > Moc % 27ing pspecific_wnd . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < AdditionalInputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > $ ( QTDIR ) \ bin \ moc . exe ; % ( FullPath ) < / AdditionalInputs > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing overviewwidget . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / overviewwidget . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / overviewwidget . h " < / Command > <nl> < AdditionalInputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > $ ( QTDIR ) \ bin \ moc . exe ; % ( FullPath ) < / AdditionalInputs > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing overviewwidget . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < AdditionalInputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > $ ( QTDIR ) \ bin \ moc . exe ; % ( FullPath ) < / AdditionalInputs > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing passcodewidget . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " " - fstdafx . h " " - f . . / . . / SourceFiles / passcodewidget . h " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / passcodewidget . h " < / Command > <nl> < AdditionalInputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > $ ( QTDIR ) \ bin \ moc . exe ; % ( FullPath ) < / AdditionalInputs > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing passcodewidget . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < AdditionalInputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > $ ( QTDIR ) \ bin \ moc . exe ; % ( FullPath ) < / AdditionalInputs > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing pspecific_linux . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " " - fstdafx . h " " - f . . / . . / SourceFiles / pspecific_linux . h " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / pspecific_linux . h " < / Command > <nl> < AdditionalInputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > $ ( QTDIR ) \ bin \ moc . exe ; % ( FullPath ) < / AdditionalInputs > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing pspecific_linux . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < AdditionalInputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > $ ( QTDIR ) \ bin \ moc . exe ; % ( FullPath ) < / AdditionalInputs > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing pspecific_mac . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " " - fstdafx . h " " - f . . / . . / SourceFiles / pspecific_mac . h " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / pspecific_mac . h " < / Command > <nl> < AdditionalInputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > $ ( QTDIR ) \ bin \ moc . exe ; % ( FullPath ) < / AdditionalInputs > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing pspecific_mac . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < CustomBuild Include = " SourceFiles \ sysbuttons . h " > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing sysbuttons . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / sysbuttons . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / sysbuttons . h " < / Command > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing sysbuttons . h . . . < / Message > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Deploy | Win32 ' " > Moc % 27ing sysbuttons . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> <nl> < CustomBuild Include = " SourceFiles \ title . h " > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > Moc % 27ing title . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl> - < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / title . h " < / Command > <nl> + < Command Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > " $ ( QTDIR ) \ bin \ moc . exe " " % ( FullPath ) " - o " . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp " - DAL_LIBTYPE_STATIC - DUNICODE - DWIN32 - DWIN64 - DHAVE_STDINT_H - DZLIB_WINAPI " - I . \ . . \ . . \ Libraries \ lzma \ C " " - I . \ . . \ . . \ Libraries \ libexif - 0 . 6 . 20 " " - I . \ . . \ . . \ Libraries \ zlib - 1 . 2 . 8 " " - I . \ . . \ . . \ Libraries \ OpenSSL - Win32 \ include " " - I . \ . . \ . . \ Libraries \ libogg - 1 . 3 . 2 \ include " " - I . \ . . \ . . \ Libraries \ opus \ include " " - I . \ . . \ . . \ Libraries \ opusfile \ include " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ ports \ MSVC + + " " - I . \ . . \ . . \ Libraries \ mpg123 - 1 . 22 . 1 \ src \ libmpg123 " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ include " " - I . \ . . \ . . \ Libraries \ faad2 - 2 . 7 \ common \ mp4ff " " - I . \ . . \ . . \ Libraries \ openal - soft \ include " " - I . \ SourceFiles " " - I . \ GeneratedFiles " " - I . " " - I $ ( QTDIR ) \ include " " - I . \ GeneratedFiles \ $ ( ConfigurationName ) \ . " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtCore \ 5 . 4 . 0 \ QtCore " " - I . \ . . \ . . \ Libraries \ QtStatic \ qtbase \ include \ QtGui \ 5 . 4 . 0 \ QtGui " " - fstdafx . h " " - f . . / . . / SourceFiles / title . h " < / Command > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Moc % 27ing title . h . . . < / Message > <nl> < Message Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Deploy | Win32 ' " > Moc % 27ing title . h . . . < / Message > <nl> < Outputs Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > . \ GeneratedFiles \ $ ( ConfigurationName ) \ moc_ % ( Filename ) . cpp < / Outputs > <nl>
|
implemented . mp3 playing through libmpg123 and . m4a playing through libfaad2 in voice messages
|
telegramdesktop/tdesktop
|
6befea6a1397c7a978c1112fc1b6922575920b2b
|
2015-05-24T17:58:39Z
|
mmm a / src / citra / citra . cpp <nl> ppp b / src / citra / citra . cpp <nl> int main ( int argc , char * * argv ) { <nl> System : : Init ( emu_window . get ( ) ) ; <nl> SCOPE_EXIT ( { System : : Shutdown ( ) ; } ) ; <nl> <nl> - std : : unique_ptr < Loader : : AppLoader > loader = Loader : : GetFileLoader ( boot_filename ) ; <nl> + std : : unique_ptr < Loader : : AppLoader > loader = Loader : : GetLoader ( boot_filename ) ; <nl> if ( ! loader ) { <nl> LOG_CRITICAL ( Frontend , " Failed to obtain loader for % s ! " , boot_filename . c_str ( ) ) ; <nl> return - 1 ; <nl> mmm a / src / citra_qt / game_list . cpp <nl> ppp b / src / citra_qt / game_list . cpp <nl> void GameListWorker : : AddFstEntriesToGameList ( const std : : string & dir_path , bool d <nl> if ( deep_scan & & FileUtil : : IsDirectory ( physical_name ) ) { <nl> AddFstEntriesToGameList ( physical_name , true ) ; <nl> } else { <nl> - std : : string filename_filename , filename_extension ; <nl> - Common : : SplitPath ( physical_name , nullptr , & filename_filename , & filename_extension ) ; <nl> - <nl> - Loader : : FileType guessed_filetype = Loader : : GuessFromExtension ( filename_extension ) ; <nl> - if ( guessed_filetype = = Loader : : FileType : : Unknown ) <nl> - return true ; <nl> - Loader : : FileType filetype = Loader : : IdentifyFile ( physical_name ) ; <nl> - if ( filetype = = Loader : : FileType : : Unknown ) { <nl> - LOG_WARNING ( Frontend , " File % s is of indeterminate type and is possibly corrupted . " , physical_name . c_str ( ) ) ; <nl> + std : : unique_ptr < Loader : : AppLoader > loader = Loader : : GetLoader ( physical_name ) ; <nl> + if ( ! loader ) <nl> return true ; <nl> - } <nl> - if ( guessed_filetype ! = filetype ) { <nl> - LOG_WARNING ( Frontend , " Filetype and extension of file % s do not match . " , physical_name . c_str ( ) ) ; <nl> - } <nl> <nl> std : : vector < u8 > smdh ; <nl> - std : : unique_ptr < Loader : : AppLoader > loader = Loader : : GetLoader ( FileUtil : : IOFile ( physical_name , " rb " ) , filetype , filename_filename , physical_name ) ; <nl> - <nl> - if ( loader ) <nl> - loader - > ReadIcon ( smdh ) ; <nl> + loader - > ReadIcon ( smdh ) ; <nl> <nl> emit EntryReady ( { <nl> new GameListItemPath ( QString : : fromStdString ( physical_name ) , smdh ) , <nl> - new GameListItem ( QString : : fromStdString ( Loader : : GetFileTypeString ( filetype ) ) ) , <nl> + new GameListItem ( QString : : fromStdString ( Loader : : GetFileTypeString ( loader - > GetFileType ( ) ) ) ) , <nl> new GameListItemSize ( FileUtil : : GetSize ( physical_name ) ) , <nl> } ) ; <nl> } <nl> mmm a / src / citra_qt / main . cpp <nl> ppp b / src / citra_qt / main . cpp <nl> bool GMainWindow : : InitializeSystem ( ) { <nl> } <nl> <nl> bool GMainWindow : : LoadROM ( const std : : string & filename ) { <nl> - std : : unique_ptr < Loader : : AppLoader > app_loader = Loader : : GetFileLoader ( filename ) ; <nl> + std : : unique_ptr < Loader : : AppLoader > app_loader = Loader : : GetLoader ( filename ) ; <nl> if ( ! app_loader ) { <nl> LOG_CRITICAL ( Frontend , " Failed to obtain loader for % s ! " , filename . c_str ( ) ) ; <nl> QMessageBox : : critical ( this , tr ( " Error while loading ROM ! " ) , <nl> mmm a / src / core / loader / loader . cpp <nl> ppp b / src / core / loader / loader . cpp <nl> const char * GetFileTypeString ( FileType type ) { <nl> return " unknown " ; <nl> } <nl> <nl> - std : : unique_ptr < AppLoader > GetLoader ( FileUtil : : IOFile & & file , FileType type , <nl> + / * * <nl> + * Get a loader for a file with a specific type <nl> + * @ param file The file to load <nl> + * @ param type The type of the file <nl> + * @ param filename the file name ( without path ) <nl> + * @ param filepath the file full path ( with name ) <nl> + * @ return std : : unique_ptr < AppLoader > a pointer to a loader object ; nullptr for unsupported type <nl> + * / <nl> + static std : : unique_ptr < AppLoader > GetFileLoader ( FileUtil : : IOFile & & file , FileType type , <nl> const std : : string & filename , const std : : string & filepath ) { <nl> switch ( type ) { <nl> <nl> std : : unique_ptr < AppLoader > GetLoader ( FileUtil : : IOFile & & file , FileType type , <nl> } <nl> } <nl> <nl> - std : : unique_ptr < AppLoader > GetFileLoader ( const std : : string & filename ) { <nl> + std : : unique_ptr < AppLoader > GetLoader ( const std : : string & filename ) { <nl> FileUtil : : IOFile file ( filename , " rb " ) ; <nl> if ( ! file . IsOpen ( ) ) { <nl> LOG_ERROR ( Loader , " Failed to load file % s " , filename . c_str ( ) ) ; <nl> std : : unique_ptr < AppLoader > GetFileLoader ( const std : : string & filename ) { <nl> <nl> LOG_INFO ( Loader , " Loading file % s as % s . . . " , filename . c_str ( ) , GetFileTypeString ( type ) ) ; <nl> <nl> - return GetLoader ( std : : move ( file ) , type , filename_filename , filename ) ; <nl> + return GetFileLoader ( std : : move ( file ) , type , filename_filename , filename ) ; <nl> } <nl> <nl> } / / namespace Loader <nl> mmm a / src / core / loader / loader . h <nl> ppp b / src / core / loader / loader . h <nl> class AppLoader : NonCopyable { <nl> * / <nl> extern const std : : initializer_list < Kernel : : AddressMapping > default_address_mappings ; <nl> <nl> - / * * <nl> - * Get a loader for a file with a specific type <nl> - * @ param file The file to load <nl> - * @ param type The type of the file <nl> - * @ param filename the file name ( without path ) <nl> - * @ param filepath the file full path ( with name ) <nl> - * @ return std : : unique_ptr < AppLoader > a pointer to a loader object ; nullptr for unsupported type <nl> - * / <nl> - std : : unique_ptr < AppLoader > GetLoader ( FileUtil : : IOFile & & file , FileType type , const std : : string & filename , const std : : string & filepath ) ; <nl> - <nl> / * * <nl> * Identifies a bootable file and return a suitable loader <nl> * @ param filename String filename of bootable file <nl> * @ return best loader for this file <nl> * / <nl> - std : : unique_ptr < AppLoader > GetFileLoader ( const std : : string & filename ) ; <nl> + std : : unique_ptr < AppLoader > GetLoader ( const std : : string & filename ) ; <nl> <nl> } / / namespace <nl>
|
CitraQt : Simplify the game list loader code
|
yuzu-emu/yuzu
|
314ce5e505aca066ad4d0385be46d7e8de9f6dfb
|
2016-05-21T16:09:59Z
|
mmm a / googlemock / test / gmock - actions_test . cc <nl> ppp b / googlemock / test / gmock - actions_test . cc <nl> TEST ( ReturnRefTest , DoesNotWorkForTemporary ) { <nl> auto nonScalarValue = [ ] ( ) - > std : : string { return " ABC " ; } ; <nl> EXPECT_FALSE ( CanCallReturnRef ( nonScalarValue ( ) ) ) ; <nl> <nl> - / / cannot use here callable returning " const scalar type " because C + + ignores such const for scalar return type , so the static_cast <nl> + / / cannot use here callable returning " const scalar type " , <nl> + / / because such const for scalar return type is ignored <nl> EXPECT_FALSE ( CanCallReturnRef ( static_cast < const int > ( 321 ) ) ) ; <nl> <nl> auto constNonScalarValue = [ ] ( ) - > const std : : string { return " CBA " ; } ; <nl>
|
Apply 80chars limit
|
google/googletest
|
5ff72f5295f315a23f83ce4cc86380d5bfed0787
|
2019-10-25T08:29:15Z
|
mmm a / xbmc / AddonDatabase . cpp <nl> ppp b / xbmc / AddonDatabase . cpp <nl> int CAddonDatabase : : AddRepository ( const CStdString & id , const VECADDONS & addons , <nl> if ( idRepo > - 1 ) <nl> DeleteRepository ( idRepo ) ; <nl> <nl> + BeginTransaction ( ) ; <nl> + <nl> CDateTime time = CDateTime : : GetCurrentDateTime ( ) ; <nl> sql = PrepareSQL ( " insert into repo ( id , addonID , checksum , lastcheck ) values ( NULL , ' % s ' , ' % s ' , ' % s ' ) " , id . c_str ( ) , checksum . c_str ( ) , time . GetAsDBDateTime ( ) . c_str ( ) ) ; <nl> m_pDS - > exec ( sql . c_str ( ) ) ; <nl> int CAddonDatabase : : AddRepository ( const CStdString & id , const VECADDONS & addons , <nl> for ( unsigned int i = 0 ; i < addons . size ( ) ; + + i ) <nl> AddAddon ( addons [ i ] , idRepo ) ; <nl> <nl> + CommitTransaction ( ) ; <nl> return idRepo ; <nl> } <nl> catch ( . . . ) <nl> { <nl> CLog : : Log ( LOGERROR , " % s failed on repo ' % s ' " , __FUNCTION__ , id . c_str ( ) ) ; <nl> + RollbackTransaction ( ) ; <nl> } <nl> return - 1 ; <nl> } <nl>
|
fixed : use db transactions to improve performance when adding addons
|
xbmc/xbmc
|
6b2300a9b1a82995a62b78ddb0964a244c6f567f
|
2010-08-24T08:22:03Z
|
mmm a / editor / editor_inspector . cpp <nl> ppp b / editor / editor_inspector . cpp <nl> void EditorInspector : : remove_inspector_plugin ( const Ref < EditorInspectorPlugin > & <nl> for ( int i = idx ; i < inspector_plugin_count - 1 ; i + + ) { <nl> inspector_plugins [ i ] = inspector_plugins [ i + 1 ] ; <nl> } <nl> + <nl> + if ( idx = = inspector_plugin_count - 1 ) <nl> + inspector_plugins [ idx ] = Ref < EditorInspectorPlugin > ( ) ; <nl> + <nl> inspector_plugin_count - - ; <nl> } <nl> <nl>
|
Merge pull request from willnationsdev / fix - inspector - plugin
|
godotengine/godot
|
2940475c716eab517ca52957acc8714f195d32cb
|
2019-03-06T00:14:48Z
|
mmm a / MachineLearning / CNTK / ComputationNetwork . h <nl> ppp b / MachineLearning / CNTK / ComputationNetwork . h <nl> class ComputationNetwork : public BS : : Object , public BS : : HasToString , public BS : <nl> <nl> / / TODO : why is this here ? Move to LearnableParameter class ? <nl> static void InitLearnableParametersFromFile ( const ComputationNodePtr node , <nl> - const std : : wstring & initFromFilePath , <nl> - DEVICEID_TYPE deviceId ) / / TODO : why not just use node - > m_deviceId ? <nl> + const std : : wstring & initFromFilePath , <nl> + DEVICEID_TYPE deviceId ) / / TODO : why not just use node - > m_deviceId ? <nl> { <nl> size_t numRows = 0 ; <nl> size_t numCols = 0 ; <nl> class ComputationNetwork : public BS : : Object , public BS : : HasToString , public BS : <nl> / / node construction <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> <nl> - / / TODO : move this into LearnableParameter directly ; no value to keep it out <nl> - static void InitLearnableParameters ( const ComputationNodePtr node , <nl> - const bool uniformInit , <nl> - const unsigned long randomSeed , <nl> - const ElemType initValueScale , <nl> - unsigned long randomSeedOffset ) <nl> - { <nl> - size_t inputSize = node - > FunctionValues ( ) . GetNumCols ( ) ; <nl> - <nl> - / / the random seed offset is set via the " randomSeedOffset " parameter in config <nl> - if ( uniformInit ) <nl> - { <nl> - ElemType randRange = 0 . 05f * initValueScale ; / / initValueScale / sqrt ( inputSize ) ; <nl> - node - > FunctionValues ( ) . SetUniformRandomValue ( - randRange , randRange , randomSeedOffset + randomSeed ) ; <nl> - } <nl> - else <nl> - { <nl> - ElemType randInitstd = 0 . 2f * initValueScale / sqrt ( ElemType ( inputSize ) ) ; <nl> - node - > FunctionValues ( ) . SetGaussianRandomValue ( 0 , randInitstd , randomSeedOffset + randomSeed ) ; <nl> - } <nl> - } <nl> - / / non - static version needed because it access m_randomSeedOffset <nl> + / / non - static version needed because it accesses m_randomSeedOffset <nl> + / / Excessively used by SimpleNetworkBuilder , but always after CreateLearnableParameter ( ) , so we should really absorb it there <nl> void InitLearnableParameters ( const ComputationNodePtr node , <nl> - const bool uniformInit , <nl> - const unsigned long randomSeed , <nl> - const ElemType initValueScale ) <nl> + const bool uniformInit , <nl> + const unsigned long randomSeed , <nl> + const ElemType initValueScale , <nl> + bool initOnCPUOnly = false ) <nl> { <nl> - return InitLearnableParameters ( node , uniformInit , randomSeed , initValueScale , GetRandomSeedOffset ( ) ) ; <nl> + auto learnableParameterNode = dynamic_pointer_cast < LearnableParameter < ElemType > > ( node ) ; <nl> + learnableParameterNode - > InitLearnableParameters ( uniformInit , randomSeed + GetRandomSeedOffset ( ) , initValueScale , initOnCPUOnly ) ; <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> class ComputationNetwork : public BS : : Object , public BS : : HasToString , public BS : <nl> <nl> ComputationNodePtr CreateLearnableParameter ( const std : : wstring & paramName , const size_t rows , const size_t cols ) <nl> { <nl> + / / TODO : in SimpleNetworkBuilder , this is very often followed by InitLearnableParameter ( ) - - we should have an overload that just does it right away <nl> return AddNodeToNet ( New < LearnableParameter < ElemType > > ( m_deviceId , paramName , rows , cols ) ) ; <nl> } <nl> <nl> class ComputationNetwork : public BS : : Object , public BS : : HasToString , public BS : <nl> <nl> for ( auto nodeIter = allNodes . begin ( ) ; nodeIter ! = allNodes . end ( ) ; nodeIter + + ) <nl> { <nl> + / / TODO : nbrSlices set once to the same value for all nodes each evaluation - - is it ever changed later ? <nl> ( * nodeIter ) - > SetNbrSlicesInEachRecurrentIteration ( m_nbrSlicesInEachRecurrentIteration ) ; <nl> if ( ( * nodeIter ) - > ReqMultiSeqHandling ( ) ) <nl> ( * nodeIter ) - > ResetBound ( & m_SentenceBoundary , & m_minibatchPackingFlag ) ; <nl> class ComputationNetwork : public BS : : Object , public BS : : HasToString , public BS : <nl> <nl> for ( auto nodeIter = allNodes . begin ( ) ; nodeIter ! = allNodes . end ( ) ; nodeIter + + ) <nl> { <nl> + / / TODO : is this the frame - by - frame evaluation ? Why is there no comment here ? ? <nl> EvaluateLoop ( allNodes , ( * nodeIter ) ) ; <nl> <nl> if ( ( * nodeIter ) - > IsFuncValueOlderThanInputs ( ) & & ( FindInRecurrentLoop ( * nodeIter ) = = - 1 ) ) <nl> class ComputationNetwork : public BS : : Object , public BS : : HasToString , public BS : <nl> fprintf ( stderr , " Forward_ % ls \ n " , ( * nodeIter ) - > NodeName ( ) . c_str ( ) ) ; <nl> # endif <nl> / / we manage time stamp here so that derived classes don ' t need to worry about it <nl> + / / TODO : is this the whole - batch evaluation ? <nl> ( * nodeIter ) - > EvaluateThisNodeGivenInputs ( ) ; <nl> ( * nodeIter ) - > UpdateEvalTimeStamp ( ) ; <nl> } <nl> mmm a / MachineLearning / CNTK / ExperimentalNetworkBuilder . cpp <nl> ppp b / MachineLearning / CNTK / ExperimentalNetworkBuilder . cpp <nl> namespace Microsoft { namespace MSR { namespace BS { <nl> struct MustFinalizeInit { virtual void FinalizeInit ( ) = 0 ; } ; / / derive from this to indicate ComputationNetwork should call FinalizeIitlate initialization <nl> <nl> wstring computationNodes = / / TODO : use actual TypeName ( ) here ? would first need to make it a wide string ; we should also extract those two methods into the base macro <nl> - L " LearnableParameter ( rows , cols , needGradient = true , init = ' uniform ' / * | fixedValue | gaussian | fromFile * / , initValueScale = 1 , value = 0 , initFromFilePath = ' ' , tag = ' ' ) = new ComputationNode [ operation = ' LearnableParameter ' / * plus the function args * / ] \ n " <nl> + L " LearnableParameter ( rows , cols , needGradient = true , init = ' uniform ' / * | fixedValue | gaussian | fromFile * / , initValueScale = 1 , value = 0 , initFromFilePath = ' ' , initOnCPUOnly = true , randomSeed = - 1 , tag = ' ' ) = new ComputationNode [ operation = ' LearnableParameter ' / * plus the function args * / ] \ n " <nl> L " Parameter = LearnableParameter / / deprecated \ n " <nl> / / ^ ^ already works ; vv untested <nl> L " Input ( rows , cols , tag = ' feature ' ) = new ComputationNode [ operation = ' InputValue ' ; isSparse = false ; isImage = false / * plus the function args * / ] \ n " / / note : naming a little inconsistent / / TODO : re - test after flag change <nl> namespace Microsoft { namespace MSR { namespace BS { <nl> if ( initString = = L " fixedValue " ) <nl> node - > FunctionValues ( ) . SetValue ( ( ElemType ) config [ L " value " ] ) ; <nl> else if ( initString = = L " uniform " | | initString = = L " gaussian " ) <nl> - ComputationNetwork < ElemType > : : InitLearnableParameters ( node , ( initString = = L " uniform " ) , randomSeed + + , config [ L " initValueScale " ] , m_randomSeedOffset ) ; <nl> + { <nl> + / / TODO : add these options also to old NDL <nl> + int forcedRandomSeed = config [ L " randomSeed " ] ; / / forcing a specific random seed is useful for testing to get repeatable initialization independent of evaluation order <nl> + dynamic_pointer_cast < LearnableParameter < ElemType > > ( node ) - > InitLearnableParameters ( ( initString = = L " uniform " ) , forcedRandomSeed < 0 ? ( randomSeed + + + m_randomSeedOffset ) : ( unsigned long ) forcedRandomSeed , config [ L " initValueScale " ] , config [ L " initOnCPUOnly " ] ) ; <nl> + } <nl> else if ( initString = = L " fromFile " ) <nl> { <nl> wstring initFromFilePath = config [ L " initFromFilePath " ] ; <nl> mmm a / MachineLearning / CNTK / InputAndParamNodes . h <nl> ppp b / MachineLearning / CNTK / InputAndParamNodes . h <nl> namespace Microsoft { namespace MSR { namespace CNTK { <nl> m_outputHeight = rows ; <nl> m_outputChannels = 1 ; <nl> } <nl> - <nl> + <nl> + / / TODO : ' LearnableParameters ' is now redundant in the name ; rename to InitRandom ( ) <nl> + / / TODO : also move file loading here ? <nl> + void InitLearnableParameters ( const bool uniformInit , <nl> + const unsigned long randomSeed , <nl> + const ElemType initValueScale , <nl> + bool initOnCPUOnly ) / / if true then always init on CPU , making initialization consistent across both ( for testing ) <nl> + { <nl> + size_t inputSize = FunctionValues ( ) . GetNumCols ( ) ; <nl> + <nl> + / / the random seed offset is set via the " randomSeedOffset " parameter in config <nl> + if ( initOnCPUOnly ) <nl> + m_functionValues . TransferToDeviceIfNotThereAndNotAutoPlace ( CPUDEVICE ) ; <nl> + if ( uniformInit ) <nl> + { <nl> + ElemType randRange = 0 . 05f * initValueScale ; / / initValueScale / sqrt ( inputSize ) ; <nl> + FunctionValues ( ) . SetUniformRandomValue ( - randRange , randRange , randomSeed ) ; <nl> + } <nl> + else <nl> + { <nl> + ElemType randInitstd = 0 . 2f * initValueScale / sqrt ( ElemType ( inputSize ) ) ; <nl> + FunctionValues ( ) . SetGaussianRandomValue ( 0 , randInitstd , randomSeed ) ; <nl> + } <nl> + if ( initOnCPUOnly ) <nl> + m_functionValues . TransferToDeviceIfNotThereAndNotAutoPlace ( m_deviceId ) ; <nl> + } <nl> + <nl> virtual const std : : wstring OperationName ( ) const { return TypeName ( ) ; } <nl> + <nl> virtual void ComputeInputPartial ( const size_t / * inputIndex * / ) { } <nl> virtual void / * ComputationNode : : * / ComputeInputPartial ( const size_t / * inputIndex * / , const FrameRange & ) { } <nl> virtual void EvaluateThisNode ( ) { } <nl>
|
InitLearnableParameters ( ) moved to LearnableParametersNode ;
|
microsoft/CNTK
|
4bf4c46d83f0b77c0e46218509605129614b0665
|
2015-09-01T13:39:43Z
|
mmm a / tensorflow / compiler / jit / kernels / xla_launch_op . cc <nl> ppp b / tensorflow / compiler / jit / kernels / xla_launch_op . cc <nl> void XlaLocalLaunchOp : : Compute ( OpKernelContext * ctx ) { <nl> <nl> xla : : LocalClient * client = static_cast < xla : : LocalClient * > ( cache - > client ( ) ) ; <nl> <nl> + / / Builds an XLA allocator for the device . <nl> + XlaAllocator xla_allocator ( client - > platform ( ) , ctx ) ; <nl> + <nl> XlaCompiler : : Options options ; <nl> options . client = client ; <nl> options . device_type = & cache - > device_type ( ) ; <nl> options . flib_def = ctx - > function_library ( ) - > GetFunctionLibraryDefinition ( ) ; <nl> options . graph_def_version = ctx - > function_library ( ) - > graph_def_version ( ) ; <nl> options . allow_cpu_custom_calls = ( platform_id_ = = gpu : : host : : kHostPlatformId ) ; <nl> + options . device_allocator = & xla_allocator ; <nl> <nl> const XlaCompiler : : CompilationResult * kernel ; <nl> xla : : LocalExecutable * executable ; <nl> void XlaLocalLaunchOp : : Compute ( OpKernelContext * ctx ) { <nl> <nl> VLOG ( 1 ) < < " Executing XLA Computation . . . " ; <nl> <nl> - / / Builds an XLA allocator for the device . <nl> - XlaAllocator xla_allocator ( client - > platform ( ) , ctx ) ; <nl> - <nl> std : : unique_ptr < xla : : ShapedBuffer > output ; <nl> / / Build xla : : ShapedBuffers that point directly to the Tensor buffers . <nl> std : : vector < std : : unique_ptr < xla : : ShapedBuffer > > arg_buffers ; <nl> mmm a / tensorflow / compiler / jit / xla_compilation_cache . cc <nl> ppp b / tensorflow / compiler / jit / xla_compilation_cache . cc <nl> Status XlaCompilationCache : : BuildExecutable ( <nl> xla : : ExecutableBuildOptions build_options ; <nl> build_options . set_device_ordinal ( client_ - > default_device_ordinal ( ) ) ; <nl> build_options . set_result_layout ( result . xla_output_shape ) ; <nl> + build_options . set_device_allocator ( options . device_allocator ) ; <nl> <nl> auto compile_result = <nl> client_ - > Compile ( * result . computation , argument_layouts , build_options ) ; <nl> mmm a / tensorflow / compiler / tf2xla / xla_compiler . h <nl> ppp b / tensorflow / compiler / tf2xla / xla_compiler . h <nl> class XlaCompiler { <nl> / / device is created , and can be used to create metadata objects <nl> / / that can be accessed by XLA op kernels . <nl> std : : function < Status ( ResourceMgr * ) > * populate_resource_manager = nullptr ; <nl> + <nl> + / / If not nullptr , this memory allocator can be used by the compiler for <nl> + / / temporary allocations it might want to make during compilation . <nl> + / / <nl> + / / For example , the compiler may want to try out different algorithms and <nl> + / / choose the fastest one , and it might run those algorithms over buffers <nl> + / / created using this allocator . <nl> + / / <nl> + / / The compiler can function correctly without an explicit allocator given <nl> + / / here , but on some devices ( notably , GPUs ) , TensorFlow tends to eagerly <nl> + / / allocate most or all available memory on the device , leaving none for the <nl> + / / compiler to access , unless it can use TensorFlow ' s allocator . <nl> + xla : : DeviceMemoryAllocator * device_allocator = nullptr ; <nl> } ; <nl> <nl> explicit XlaCompiler ( Options options ) ; <nl> mmm a / tensorflow / compiler / xla / client / local_client . cc <nl> ppp b / tensorflow / compiler / xla / client / local_client . cc <nl> const Shape * ExecutableBuildOptions : : result_layout ( ) const { <nl> return result_layout_set_ ? & result_layout_ : nullptr ; <nl> } <nl> <nl> + ExecutableBuildOptions & ExecutableBuildOptions : : set_device_allocator ( <nl> + DeviceMemoryAllocator * allocator ) { <nl> + device_allocator_ = allocator ; <nl> + return * this ; <nl> + } <nl> + <nl> + DeviceMemoryAllocator * ExecutableBuildOptions : : device_allocator ( ) const { <nl> + return device_allocator_ ; <nl> + } <nl> + <nl> namespace { <nl> StatusOr < Backend : : StreamPtr > BorrowStreamForDevice ( int device_ordinal , <nl> Backend * backend ) { <nl> StatusOr < std : : unique_ptr < LocalExecutable > > LocalClient : : Compile ( <nl> int device_ordinal = options . device_ordinal ( ) = = - 1 <nl> ? default_device_ordinal ( ) <nl> : options . device_ordinal ( ) ; <nl> - TF_ASSIGN_OR_RETURN ( std : : unique_ptr < Executable > executable , <nl> - local_service_ - > CompileExecutable ( <nl> - computation . handle ( ) , argument_layouts , <nl> - options . result_layout ( ) , device_ordinal ) ) ; <nl> + TF_ASSIGN_OR_RETURN ( <nl> + std : : unique_ptr < Executable > executable , <nl> + local_service_ - > CompileExecutable ( computation . handle ( ) , argument_layouts , <nl> + options . result_layout ( ) , device_ordinal , <nl> + options . device_allocator ( ) ) ) ; <nl> return WrapUnique ( new LocalExecutable ( std : : move ( executable ) , <nl> local_service_ - > mutable_backend ( ) , <nl> device_ordinal , options ) ) ; <nl> mmm a / tensorflow / compiler / xla / client / local_client . h <nl> ppp b / tensorflow / compiler / xla / client / local_client . h <nl> class ExecutableBuildOptions { <nl> ExecutableBuildOptions & set_result_layout ( const Shape & shape_with_layout ) ; <nl> const Shape * result_layout ( ) const ; <nl> <nl> + / / If set , this specifies an allocator that can be used to allocate temporary <nl> + / / space on the device during compilation . For example , the compiler might <nl> + / / want to run various algorithms on the device and pick the fastest one - - it <nl> + / / might allocate buffers for use by these algorithms using this allocator . <nl> + / / <nl> + / / This does not need to be the same as the DeviceMemoryAllocator passed when <nl> + / / running the executable . <nl> + ExecutableBuildOptions & set_device_allocator ( <nl> + DeviceMemoryAllocator * allocator ) ; <nl> + DeviceMemoryAllocator * device_allocator ( ) const ; <nl> + <nl> private : <nl> int device_ordinal_ = - 1 ; <nl> Shape result_layout_ ; <nl> bool result_layout_set_ = false ; <nl> + DeviceMemoryAllocator * device_allocator_ = nullptr ; <nl> } ; <nl> <nl> class LocalExecutable { <nl> mmm a / tensorflow / compiler / xla / service / compiler . h <nl> ppp b / tensorflow / compiler / xla / service / compiler . h <nl> class AotCompilationOptions { <nl> / / Returns the ID of the platform to which these options apply . <nl> virtual perftools : : gputools : : Platform : : Id PlatformId ( ) const = 0 ; <nl> <nl> + / / Optional allocator that may be used for allocating temp space on the device <nl> + / / during compilation . <nl> + DeviceMemoryAllocator * device_allocator ( ) const { return device_allocator_ ; } <nl> + void set_device_allocator ( DeviceMemoryAllocator * device_allocator ) { <nl> + device_allocator_ = device_allocator ; <nl> + } <nl> + <nl> protected : <nl> AotCompilationOptions ( ) = default ; <nl> + <nl> + private : <nl> + DeviceMemoryAllocator * device_allocator_ = nullptr ; <nl> } ; <nl> <nl> / / Abstract compiler interface that is subclassed for compilation on a <nl> class Compiler { <nl> <nl> / / Runs Hlo passes to optimize the given Hlo module , returns the optimized <nl> / / module . <nl> + / / <nl> + / / If device_allocator is not null , the compiler may use it to allocate temp <nl> + / / space on the device for use during compilation . For example , the compiler <nl> + / / may allocate buffers on the device and then run variants of a given <nl> + / / algorithm over those buffers , to see which variant is fastest . Any space <nl> + / / allocated should be deallocated before this function returns . <nl> virtual StatusOr < std : : unique_ptr < HloModule > > RunHloPasses ( <nl> std : : unique_ptr < HloModule > module , <nl> - perftools : : gputools : : StreamExecutor * executor ) = 0 ; <nl> + perftools : : gputools : : StreamExecutor * executor , <nl> + DeviceMemoryAllocator * device_allocator ) = 0 ; <nl> <nl> / / Compiles the HLO module for execution on a device given by the executor , <nl> / / and returns an executable object or an error status . No HLO passes are <nl> class Compiler { <nl> / / The compiler may optionally specialize to the individual device <nl> / / ( not just type of device ) indicated by the executor . <nl> / / <nl> + / / device_allocator is optional ; see RunHloPasses . <nl> + / / <nl> / / Use the overload below to compile computations that run in parallel . <nl> virtual StatusOr < std : : unique_ptr < Executable > > RunBackend ( <nl> std : : unique_ptr < HloModule > module , <nl> - perftools : : gputools : : StreamExecutor * executor ) = 0 ; <nl> + perftools : : gputools : : StreamExecutor * executor , <nl> + DeviceMemoryAllocator * device_allocator ) = 0 ; <nl> <nl> / / Compiles a set of HLO modules that can run in parallel , potentially <nl> / / communicating data between the modules , and returns a corresponding <nl> / / sequence of executable objects . <nl> / / <nl> + / / device_allocator is optional ; see RunHloPasses . <nl> + / / <nl> / / TODO ( b / 68666782 ) : Remove this method after adding support for multiple <nl> / / modules to RunHloPasses and RunBackends . <nl> virtual StatusOr < std : : vector < std : : unique_ptr < Executable > > > Compile ( <nl> std : : vector < std : : unique_ptr < HloModule > > modules , <nl> std : : vector < std : : vector < perftools : : gputools : : StreamExecutor * > > <nl> - stream_exec ) = 0 ; <nl> + stream_exec , <nl> + DeviceMemoryAllocator * device_allocator ) = 0 ; <nl> <nl> / / Compiles the HLO module for ahead - of - time execution . This is intended for <nl> / / use in static compilation . <nl> mmm a / tensorflow / compiler / xla / service / cpu / cpu_compiler . cc <nl> ppp b / tensorflow / compiler / xla / service / cpu / cpu_compiler . cc <nl> Status VerifyLlvmModule ( const llvm : : Module & llvm_module ) { <nl> <nl> StatusOr < std : : unique_ptr < HloModule > > CpuCompiler : : RunHloPasses ( <nl> std : : unique_ptr < HloModule > module , <nl> - perftools : : gputools : : StreamExecutor * / * stream_exec * / ) { <nl> + perftools : : gputools : : StreamExecutor * / * stream_exec * / , <nl> + DeviceMemoryAllocator * / * device_allocator * / ) { <nl> VLOG ( 2 ) < < " Before optimization : " ; <nl> XLA_VLOG_LINES ( 2 , module - > ToString ( ) ) ; <nl> <nl> StatusOr < std : : unique_ptr < HloModule > > CpuCompiler : : RunHloPasses ( <nl> <nl> StatusOr < std : : unique_ptr < Executable > > CpuCompiler : : RunBackend ( <nl> std : : unique_ptr < HloModule > module , <nl> - perftools : : gputools : : StreamExecutor * stream_exec ) { <nl> + perftools : : gputools : : StreamExecutor * stream_exec , <nl> + DeviceMemoryAllocator * / * device_allocator * / ) { <nl> const string timer_message = <nl> " Compiling [ " + module - > name ( ) + " ] for CPU using JIT " ; <nl> XLA_SCOPED_LOGGING_TIMER ( timer_message ) ; <nl> mmm a / tensorflow / compiler / xla / service / cpu / cpu_compiler . h <nl> ppp b / tensorflow / compiler / xla / service / cpu / cpu_compiler . h <nl> class CpuCompiler : public LLVMCompiler { <nl> <nl> StatusOr < std : : unique_ptr < HloModule > > RunHloPasses ( <nl> std : : unique_ptr < HloModule > module , <nl> - perftools : : gputools : : StreamExecutor * stream_exec ) override ; <nl> + perftools : : gputools : : StreamExecutor * stream_exec , <nl> + DeviceMemoryAllocator * device_allocator ) override ; <nl> <nl> StatusOr < std : : unique_ptr < Executable > > RunBackend ( <nl> std : : unique_ptr < HloModule > module , <nl> - perftools : : gputools : : StreamExecutor * stream_exec ) override ; <nl> + perftools : : gputools : : StreamExecutor * stream_exec , <nl> + DeviceMemoryAllocator * device_allocator ) override ; <nl> <nl> StatusOr < std : : vector < std : : unique_ptr < AotCompilationResult > > > <nl> CompileAheadOfTime ( std : : vector < std : : unique_ptr < HloModule > > modules , <nl> mmm a / tensorflow / compiler / xla / service / gpu / gpu_compiler . cc <nl> ppp b / tensorflow / compiler / xla / service / gpu / gpu_compiler . cc <nl> tensorflow : : Status OptimizeHloModule ( HloModule * hlo_module ) { <nl> <nl> / / Modifies the given HLO module so that it will be accepted by IrEmitter . <nl> / / Unlike optimization passes , the passes are necessary for correctness . <nl> - tensorflow : : Status PrepareHloModuleForIrEmitting ( HloModule * hlo_module ) { <nl> + tensorflow : : Status PrepareHloModuleForIrEmitting ( <nl> + HloModule * hlo_module , se : : StreamExecutor * stream_exec , <nl> + DeviceMemoryAllocator * / * device_allocator * / ) { <nl> / / In some cases , we have to place the result of an instruction in a temporary <nl> / / buffer . For instance , the buffer that holds an external parameter is <nl> / / assumed immutable at this point , and should not be reused for output <nl> GpuCompiler : : GpuCompiler ( ) <nl> . getPointerSize ( 0 / * default address space * / ) ) { } <nl> <nl> StatusOr < std : : unique_ptr < HloModule > > GpuCompiler : : RunHloPasses ( <nl> - std : : unique_ptr < HloModule > module , se : : StreamExecutor * / * stream_exec * / ) { <nl> + std : : unique_ptr < HloModule > module , se : : StreamExecutor * stream_exec , <nl> + DeviceMemoryAllocator * device_allocator ) { <nl> XLA_SCOPED_LOGGING_TIMER ( " GpuCompiler : : RunHloPasses " ) ; <nl> Tracing : : TraceMe annotation ( " HLO Transforms " , module - > name ( ) , <nl> / * is_expensive = * / true ) ; <nl> StatusOr < std : : unique_ptr < HloModule > > GpuCompiler : : RunHloPasses ( <nl> } <nl> <nl> StatusOr < std : : unique_ptr < Executable > > GpuCompiler : : RunBackend ( <nl> - std : : unique_ptr < HloModule > module , se : : StreamExecutor * stream_exec ) { <nl> + std : : unique_ptr < HloModule > module , se : : StreamExecutor * stream_exec , <nl> + DeviceMemoryAllocator * device_allocator ) { <nl> XLA_SCOPED_LOGGING_TIMER ( " GpuCompiler : : RunBackend " ) ; <nl> <nl> TF_RET_CHECK ( stream_exec ! = nullptr ) ; <nl> <nl> - TF_RETURN_IF_ERROR ( PrepareHloModuleForIrEmitting ( module . get ( ) ) ) ; <nl> + TF_RETURN_IF_ERROR ( PrepareHloModuleForIrEmitting ( module . get ( ) , stream_exec , <nl> + device_allocator ) ) ; <nl> <nl> llvm : : LLVMContext llvm_context ; <nl> std : : string buffer ; <nl> mmm a / tensorflow / compiler / xla / service / gpu / gpu_compiler . h <nl> ppp b / tensorflow / compiler / xla / service / gpu / gpu_compiler . h <nl> class GpuCompiler : public LLVMCompiler { <nl> <nl> StatusOr < std : : unique_ptr < HloModule > > RunHloPasses ( <nl> std : : unique_ptr < HloModule > module , <nl> - perftools : : gputools : : StreamExecutor * stream_exec ) override ; <nl> + perftools : : gputools : : StreamExecutor * stream_exec , <nl> + DeviceMemoryAllocator * device_allocator ) override ; <nl> <nl> StatusOr < std : : unique_ptr < Executable > > RunBackend ( <nl> std : : unique_ptr < HloModule > module , <nl> - perftools : : gputools : : StreamExecutor * stream_exec ) override ; <nl> + perftools : : gputools : : StreamExecutor * stream_exec , <nl> + DeviceMemoryAllocator * device_allocator ) override ; <nl> <nl> StatusOr < std : : vector < std : : unique_ptr < AotCompilationResult > > > <nl> CompileAheadOfTime ( std : : vector < std : : unique_ptr < HloModule > > module , <nl> mmm a / tensorflow / compiler / xla / service / hlo_runner . cc <nl> ppp b / tensorflow / compiler / xla / service / hlo_runner . cc <nl> StatusOr < std : : unique_ptr < Literal > > HloRunner : : ExecuteInternal ( <nl> if ( run_hlo_passes ) { <nl> TF_ASSIGN_OR_RETURN ( <nl> module , backend ( ) . compiler ( ) - > RunHloPasses ( <nl> - std : : move ( module ) , backend ( ) . default_stream_executor ( ) ) ) ; <nl> + std : : move ( module ) , backend ( ) . default_stream_executor ( ) , <nl> + / * device_allocator = * / nullptr ) ) ; <nl> } <nl> TF_ASSIGN_OR_RETURN ( <nl> std : : unique_ptr < Executable > executable , <nl> backend ( ) . compiler ( ) - > RunBackend ( std : : move ( module ) , <nl> - backend ( ) . default_stream_executor ( ) ) ) ; <nl> + backend ( ) . default_stream_executor ( ) , <nl> + / * device_allocator = * / nullptr ) ) ; <nl> <nl> se : : Stream stream ( backend ( ) . default_stream_executor ( ) ) ; <nl> stream . Init ( ) ; <nl> mmm a / tensorflow / compiler / xla / service / interpreter / compiler . cc <nl> ppp b / tensorflow / compiler / xla / service / interpreter / compiler . cc <nl> Status InterpreterCompiler : : RunHloOptimization ( HloModule * hlo_module ) { <nl> } <nl> <nl> StatusOr < std : : unique_ptr < HloModule > > InterpreterCompiler : : RunHloPasses ( <nl> - std : : unique_ptr < HloModule > hlo_module , <nl> - se : : StreamExecutor * / * stream_exec * / ) { <nl> + std : : unique_ptr < HloModule > hlo_module , se : : StreamExecutor * / * stream_exec * / , <nl> + DeviceMemoryAllocator * / * device_allocator * / ) { <nl> VLOG ( 1 ) < < " Run hlo passes on graph " < < hlo_module - > name ( ) ; <nl> TF_RETURN_IF_ERROR ( RunHloOptimization ( hlo_module . get ( ) ) ) ; <nl> return std : : move ( hlo_module ) ; <nl> } <nl> <nl> StatusOr < std : : unique_ptr < Executable > > InterpreterCompiler : : RunBackend ( <nl> - std : : unique_ptr < HloModule > hlo_module , se : : StreamExecutor * stream_exec ) { <nl> + std : : unique_ptr < HloModule > hlo_module , se : : StreamExecutor * stream_exec , <nl> + DeviceMemoryAllocator * / * device_allocator * / ) { <nl> TF_RET_CHECK ( stream_exec ! = nullptr ) ; <nl> <nl> VLOG ( 1 ) < < " Run backend " < < hlo_module - > name ( ) ; <nl> StatusOr < std : : unique_ptr < Executable > > InterpreterCompiler : : RunBackend ( <nl> <nl> StatusOr < std : : vector < std : : unique_ptr < Executable > > > InterpreterCompiler : : Compile ( <nl> std : : vector < std : : unique_ptr < HloModule > > / * hlo_modules * / , <nl> - std : : vector < std : : vector < se : : StreamExecutor * > > / * stream_execs * / ) { <nl> + std : : vector < std : : vector < se : : StreamExecutor * > > / * stream_execs * / , <nl> + DeviceMemoryAllocator * / * device_allocator * / ) { <nl> return tensorflow : : errors : : Unimplemented ( <nl> " Compilation of multiple HLO modules is not supported on Interpreter . " ) ; <nl> } <nl> mmm a / tensorflow / compiler / xla / service / interpreter / compiler . h <nl> ppp b / tensorflow / compiler / xla / service / interpreter / compiler . h <nl> class InterpreterCompiler : public Compiler { <nl> <nl> StatusOr < std : : unique_ptr < HloModule > > RunHloPasses ( <nl> std : : unique_ptr < HloModule > hlo_module , <nl> - perftools : : gputools : : StreamExecutor * stream_exec ) override ; <nl> + perftools : : gputools : : StreamExecutor * stream_exec , <nl> + DeviceMemoryAllocator * device_allocator ) override ; <nl> <nl> StatusOr < std : : unique_ptr < Executable > > RunBackend ( <nl> std : : unique_ptr < HloModule > hlo_module , <nl> - perftools : : gputools : : StreamExecutor * stream_exec ) override ; <nl> + perftools : : gputools : : StreamExecutor * stream_exec , <nl> + DeviceMemoryAllocator * device_allocator ) override ; <nl> <nl> StatusOr < std : : vector < std : : unique_ptr < Executable > > > Compile ( <nl> std : : vector < std : : unique_ptr < HloModule > > hlo_modules , <nl> std : : vector < std : : vector < perftools : : gputools : : StreamExecutor * > > <nl> - stream_exec ) override ; <nl> + stream_exec , <nl> + DeviceMemoryAllocator * device_allocator ) override ; <nl> <nl> StatusOr < std : : vector < std : : unique_ptr < AotCompilationResult > > > <nl> CompileAheadOfTime ( std : : vector < std : : unique_ptr < HloModule > > hlo_modules , <nl> mmm a / tensorflow / compiler / xla / service / llvm_compiler . cc <nl> ppp b / tensorflow / compiler / xla / service / llvm_compiler . cc <nl> limitations under the License . <nl> namespace xla { <nl> StatusOr < std : : vector < std : : unique_ptr < Executable > > > LLVMCompiler : : Compile ( <nl> std : : vector < std : : unique_ptr < HloModule > > modules , <nl> - std : : vector < std : : vector < perftools : : gputools : : StreamExecutor * > > <nl> - stream_execs ) { <nl> + std : : vector < std : : vector < perftools : : gputools : : StreamExecutor * > > stream_execs , <nl> + DeviceMemoryAllocator * device_allocator ) { <nl> std : : vector < std : : unique_ptr < Executable > > result ; <nl> for ( size_t i = 0 ; i < modules . size ( ) ; i + + ) { <nl> if ( stream_execs [ i ] . size ( ) ! = 1 ) { <nl> StatusOr < std : : vector < std : : unique_ptr < Executable > > > LLVMCompiler : : Compile ( <nl> " Model partitioning not implemented for the CPU / GPU compilers ! " ) ; <nl> } <nl> <nl> - TF_ASSIGN_OR_RETURN ( <nl> - modules [ i ] , RunHloPasses ( std : : move ( modules [ i ] ) , stream_execs [ i ] [ 0 ] ) ) ; <nl> + TF_ASSIGN_OR_RETURN ( modules [ i ] , <nl> + RunHloPasses ( std : : move ( modules [ i ] ) , stream_execs [ i ] [ 0 ] , <nl> + device_allocator ) ) ; <nl> TF_ASSIGN_OR_RETURN ( std : : unique_ptr < Executable > executable , <nl> - RunBackend ( std : : move ( modules [ i ] ) , stream_execs [ i ] [ 0 ] ) ) ; <nl> + RunBackend ( std : : move ( modules [ i ] ) , stream_execs [ i ] [ 0 ] , <nl> + device_allocator ) ) ; <nl> result . push_back ( std : : move ( executable ) ) ; <nl> } <nl> <nl> mmm a / tensorflow / compiler / xla / service / llvm_compiler . h <nl> ppp b / tensorflow / compiler / xla / service / llvm_compiler . h <nl> class LLVMCompiler : public Compiler { <nl> / / Bring in <nl> / / StatusOr < std : : unique_ptr < Executable > > RunBackend ( <nl> / / std : : unique_ptr < HloModule > module , <nl> - / / perftools : : gputools : : StreamExecutor * stream_exec ) <nl> + / / perftools : : gputools : : StreamExecutor * stream_exec , <nl> + / / DeviceMemoryAllocator * device_allocator ) <nl> / / StatusOr < std : : unique_ptr < HloModule > > RunHloPasses ( <nl> / / std : : unique_ptr < HloModule > module , <nl> - / / perftools : : gputools : : StreamExecutor * stream_exec ) <nl> + / / perftools : : gputools : : StreamExecutor * stream_exec , <nl> + / / DeviceMemoryAllocator * device_allocator ) <nl> using Compiler : : RunBackend ; <nl> using Compiler : : RunHloPasses ; <nl> <nl> StatusOr < std : : vector < std : : unique_ptr < Executable > > > Compile ( <nl> std : : vector < std : : unique_ptr < HloModule > > modules , <nl> std : : vector < std : : vector < perftools : : gputools : : StreamExecutor * > > <nl> - stream_execs ) override ; <nl> + stream_execs , <nl> + DeviceMemoryAllocator * device_allocator ) override ; <nl> <nl> protected : <nl> ModuleHook user_pre_optimization_hook_ ; <nl> mmm a / tensorflow / compiler / xla / service / local_service . cc <nl> ppp b / tensorflow / compiler / xla / service / local_service . cc <nl> LocalService : : LocalService ( const ServiceOptions & options , <nl> StatusOr < std : : unique_ptr < Executable > > LocalService : : CompileExecutable ( <nl> const ComputationHandle & computation , <nl> const tensorflow : : gtl : : ArraySlice < const Shape * > argument_layouts , <nl> - const Shape * result_layout , int device_ordinal ) { <nl> + const Shape * result_layout , int device_ordinal , <nl> + DeviceMemoryAllocator * device_allocator ) { <nl> TF_ASSIGN_OR_RETURN ( UserComputation * user_computation , <nl> computation_tracker_ . Resolve ( computation ) ) ; <nl> VersionedComputationHandle versioned_handle = <nl> StatusOr < std : : unique_ptr < Executable > > LocalService : : CompileExecutable ( <nl> execute_backend_ - > stream_executor ( device_ordinal ) ) ; <nl> <nl> return BuildExecutable ( versioned_handle , std : : move ( module_config ) , <nl> - execute_backend_ . get ( ) , executor ) ; <nl> + execute_backend_ . get ( ) , executor , device_allocator ) ; <nl> } <nl> <nl> StatusOr < int > LocalService : : ReplicaNumberToDeviceOrdinal ( int replica_number ) { <nl> mmm a / tensorflow / compiler / xla / service / local_service . h <nl> ppp b / tensorflow / compiler / xla / service / local_service . h <nl> class LocalService : public Service { <nl> <nl> / / Builds an Executable with the given argument layouts and options . If <nl> / / result_layout is non - null , then the executable is compiled to produce a <nl> - / / result of the given layout . <nl> + / / result of the given layout . If device_allocator is non - null , then the <nl> + / / compiler may use it to allocate temp space on the device . The compiler is <nl> + / / responsible for freeing any memory it allocates this way . <nl> StatusOr < std : : unique_ptr < Executable > > CompileExecutable ( <nl> const ComputationHandle & computation , <nl> const tensorflow : : gtl : : ArraySlice < const Shape * > argument_layouts , <nl> - const Shape * result_layout , int device_ordinal ) ; <nl> + const Shape * result_layout , int device_ordinal , <nl> + DeviceMemoryAllocator * device_allocator ) ; <nl> <nl> / / Returns the device ordinal that corresponds to the given replica number . <nl> / / <nl> mmm a / tensorflow / compiler / xla / service / service . cc <nl> ppp b / tensorflow / compiler / xla / service / service . cc <nl> StatusOr < std : : vector < std : : unique_ptr < Executable > > > Service : : BuildExecutables ( <nl> std : : vector < VersionedComputationHandle > versioned_handles , <nl> std : : vector < std : : unique_ptr < HloModuleConfig > > module_configs , <nl> Backend * backend , <nl> - std : : vector < std : : vector < perftools : : gputools : : StreamExecutor * > > executors ) { <nl> + std : : vector < std : : vector < perftools : : gputools : : StreamExecutor * > > executors , <nl> + DeviceMemoryAllocator * device_allocator ) { <nl> VLOG ( 1 ) < < Printf ( " BuildExecutable on service % p " , this ) ; <nl> <nl> / / Dump computation proto state if flag is set . <nl> StatusOr < std : : vector < std : : unique_ptr < Executable > > > Service : : BuildExecutables ( <nl> <nl> TF_ASSIGN_OR_RETURN ( <nl> std : : vector < std : : unique_ptr < Executable > > executables , <nl> - backend - > compiler ( ) - > Compile ( std : : move ( modules ) , std : : move ( executors ) ) ) ; <nl> + backend - > compiler ( ) - > Compile ( std : : move ( modules ) , std : : move ( executors ) , <nl> + device_allocator ) ) ; <nl> <nl> for ( size_t i = 0 ; i < versioned_handles . size ( ) ; + + i ) { <nl> if ( ! module_configs [ i ] - > debug_options ( ) . xla_dump_executions_to ( ) . empty ( ) ) { <nl> StatusOr < std : : vector < std : : unique_ptr < Executable > > > Service : : BuildExecutables ( <nl> <nl> StatusOr < std : : unique_ptr < Executable > > Service : : BuildExecutable ( <nl> const VersionedComputationHandle & versioned_handle , <nl> - std : : unique_ptr < HloModuleConfig > module_config , <nl> - Backend * backend , se : : StreamExecutor * executor ) { <nl> + std : : unique_ptr < HloModuleConfig > module_config , Backend * backend , <nl> + se : : StreamExecutor * executor , DeviceMemoryAllocator * device_allocator ) { <nl> VLOG ( 1 ) < < Printf ( " BuildExecutable on service % p with handle % s " , this , <nl> versioned_handle . ToString ( ) . c_str ( ) ) ; <nl> <nl> StatusOr < std : : unique_ptr < Executable > > Service : : BuildExecutable ( <nl> TF_RETURN_IF_ERROR ( MaybeDumpHloModule ( * module ) ) ; <nl> <nl> TF_ASSIGN_OR_RETURN ( <nl> - module , backend - > compiler ( ) - > RunHloPasses ( std : : move ( module ) , executor ) ) ; <nl> + module , backend - > compiler ( ) - > RunHloPasses ( std : : move ( module ) , executor , <nl> + device_allocator ) ) ; <nl> <nl> - TF_ASSIGN_OR_RETURN ( <nl> - std : : unique_ptr < Executable > executable , <nl> - backend - > compiler ( ) - > RunBackend ( std : : move ( module ) , executor ) ) ; <nl> + TF_ASSIGN_OR_RETURN ( std : : unique_ptr < Executable > executable , <nl> + backend - > compiler ( ) - > RunBackend ( <nl> + std : : move ( module ) , executor , device_allocator ) ) ; <nl> <nl> if ( ! other_directory_path . empty ( ) ) { <nl> executable - > set_session_module ( std : : move ( session_module ) ) ; <nl> StatusOr < std : : unique_ptr < Executable > > Service : : BuildExecutable ( <nl> <nl> StatusOr < std : : shared_ptr < Executable > > Service : : BuildAndCacheExecutable ( <nl> const VersionedComputationHandle & versioned_handle , <nl> - std : : unique_ptr < HloModuleConfig > module_config , <nl> - Backend * backend , perftools : : gputools : : StreamExecutor * executor , <nl> - ExecutionProfile * profile ) { <nl> + std : : unique_ptr < HloModuleConfig > module_config , Backend * backend , <nl> + perftools : : gputools : : StreamExecutor * executor , ExecutionProfile * profile , <nl> + DeviceMemoryAllocator * device_allocator ) { <nl> std : : shared_ptr < Executable > executable = <nl> compilation_cache_ . LookUp ( versioned_handle , * module_config ) ; <nl> <nl> StatusOr < std : : shared_ptr < Executable > > Service : : BuildAndCacheExecutable ( <nl> TF_ASSIGN_OR_RETURN ( <nl> std : : unique_ptr < Executable > executable_unique_ptr , <nl> BuildExecutable ( versioned_handle , std : : move ( module_config ) , backend , <nl> - executor ) ) ; <nl> + executor , device_allocator ) ) ; <nl> <nl> if ( profile ! = nullptr ) { <nl> uint64 end_micros = tensorflow : : Env : : Default ( ) - > NowMicros ( ) ; <nl> tensorflow : : Status Service : : ExecuteParallel ( const ExecuteParallelRequest * arg , <nl> <nl> / / Build the user computations into HloModules and compile to generate the <nl> / / executables . <nl> + / / <nl> + / / TODO ( jlebar ) : There ' s currently no way to pass a device allocator to <nl> + / / ExecuteParallel , so we have to pass a null device_allocator below . <nl> TF_ASSIGN_OR_RETURN ( <nl> std : : vector < std : : unique_ptr < Executable > > executables , <nl> BuildExecutables ( versioned_handles , std : : move ( module_configs ) , <nl> - execute_backend_ . get ( ) , all_executors ) ) ; <nl> + execute_backend_ . get ( ) , all_executors , <nl> + / * device_allocator = * / nullptr ) ) ; <nl> std : : vector < Executable * > executable_ptrs ; <nl> executable_ptrs . reserve ( executables . size ( ) ) ; <nl> for ( const auto & executable : executables ) { <nl> mmm a / tensorflow / compiler / xla / service / service . h <nl> ppp b / tensorflow / compiler / xla / service / service . h <nl> class Service : public ServiceInterface { <nl> const UserComputation & user_computation ) ; <nl> <nl> / / Builds an Executable for the given parameters . <nl> + / / <nl> + / / If device_allocator is not null , the compiler may use it to allocate temp <nl> + / / buffers , which the compiler is responsible for freeing . The allocator <nl> + / / given here need not match the allocator used when running the executable . <nl> StatusOr < std : : unique_ptr < Executable > > BuildExecutable ( <nl> const VersionedComputationHandle & versioned_handle , <nl> - std : : unique_ptr < HloModuleConfig > module_config , <nl> - Backend * backend , perftools : : gputools : : StreamExecutor * executor ) ; <nl> + std : : unique_ptr < HloModuleConfig > module_config , Backend * backend , <nl> + perftools : : gputools : : StreamExecutor * executor , <nl> + DeviceMemoryAllocator * device_allocator = nullptr ) ; <nl> <nl> / / Same as BuildExecutable ( ) above , but builds a list of Executables for the <nl> / / given computations that may interact with each other . <nl> class Service : public ServiceInterface { <nl> std : : vector < VersionedComputationHandle > versioned_handles , <nl> std : : vector < std : : unique_ptr < HloModuleConfig > > module_configs , <nl> Backend * backend , <nl> - std : : vector < std : : vector < perftools : : gputools : : StreamExecutor * > > executors ) ; <nl> + std : : vector < std : : vector < perftools : : gputools : : StreamExecutor * > > executors , <nl> + DeviceMemoryAllocator * device_allocator ) ; <nl> <nl> / / Similar to BuildExecutable , but look in the compilation cache for the <nl> / / executable first . If the executable is not in the cache , it is built and <nl> / / inserted into the cache . <nl> StatusOr < std : : shared_ptr < Executable > > BuildAndCacheExecutable ( <nl> const VersionedComputationHandle & versioned_handle , <nl> - std : : unique_ptr < HloModuleConfig > module_config , <nl> - Backend * backend , perftools : : gputools : : StreamExecutor * executor , <nl> - ExecutionProfile * profile ) ; <nl> + std : : unique_ptr < HloModuleConfig > module_config , Backend * backend , <nl> + perftools : : gputools : : StreamExecutor * executor , ExecutionProfile * profile , <nl> + DeviceMemoryAllocator * device_allocator = nullptr ) ; <nl> <nl> / / Runs the given executable with the given arguments and register the result <nl> / / in the allocation tracker . The handle of the result from the tracker is <nl> mmm a / tensorflow / compiler / xla / tests / codegen_test_base . cc <nl> ppp b / tensorflow / compiler / xla / tests / codegen_test_base . cc <nl> StatusOr < std : : unique_ptr < Executable > > CodegenTestBase : : CompileToExecutable ( <nl> std : : unique_ptr < HloModule > hlo_module ) { <nl> TF_ASSIGN_OR_RETURN ( hlo_module , backend ( ) . compiler ( ) - > RunHloPasses ( <nl> std : : move ( hlo_module ) , <nl> - backend ( ) . default_stream_executor ( ) ) ) ; <nl> + backend ( ) . default_stream_executor ( ) , <nl> + / * device_allocator = * / nullptr ) ) ; <nl> return backend ( ) . compiler ( ) - > RunBackend ( std : : move ( hlo_module ) , <nl> - backend ( ) . default_stream_executor ( ) ) ; <nl> + backend ( ) . default_stream_executor ( ) , <nl> + / * device_allocator = * / nullptr ) ; <nl> } <nl> <nl> StatusOr < std : : unique_ptr < AotCompilationResult > > <nl> mmm a / tensorflow / compiler / xla / tests / llvm_compiler_test . cc <nl> ppp b / tensorflow / compiler / xla / tests / llvm_compiler_test . cc <nl> class LLVMCompilerTest : public : : testing : : Test { <nl> <nl> ASSERT_TRUE ( compiler <nl> - > RunBackend ( std : : move ( hlo_module ) , <nl> - backend_ - > default_stream_executor ( ) ) <nl> + backend_ - > default_stream_executor ( ) , <nl> + / * device_allocator = * / nullptr ) <nl> . ok ( ) ) ; <nl> <nl> / / Test that hooks were called . <nl> class LLVMCompilerTest : public : : testing : : Test { <nl> executors . push_back ( { backend_ - > default_stream_executor ( ) } ) ; <nl> executors . push_back ( { backend_ - > default_stream_executor ( ) } ) ; <nl> <nl> - EXPECT_IS_OK ( compiler - > Compile ( std : : move ( modules ) , std : : move ( executors ) ) ) ; <nl> + EXPECT_IS_OK ( compiler - > Compile ( std : : move ( modules ) , std : : move ( executors ) , <nl> + / * device_allocator = * / nullptr ) ) ; <nl> } <nl> <nl> private : <nl> mmm a / tensorflow / compiler / xla / tools / dumped_computation_to_operation_list . cc <nl> ppp b / tensorflow / compiler / xla / tools / dumped_computation_to_operation_list . cc <nl> void RealMain ( tensorflow : : gtl : : ArraySlice < char * > args ) { <nl> layouts . push_back ( & program_shape - > parameters ( i ) ) ; <nl> } <nl> StatusOr < std : : unique_ptr < Executable > > executable = <nl> - local_service - > CompileExecutable ( computation . handle ( ) , layouts , <nl> - & program_shape - > result ( ) , <nl> - / * device_ordinal = * / 0 ) ; <nl> + local_service - > CompileExecutable ( <nl> + computation . handle ( ) , layouts , & program_shape - > result ( ) , <nl> + / * device_ordinal = * / 0 , / * device_allocator = * / nullptr ) ; <nl> <nl> const HloModule & module = executable . ValueOrDie ( ) - > module ( ) ; <nl> <nl> mmm a / tensorflow / compiler / xla / tools / dumped_computation_to_text . cc <nl> ppp b / tensorflow / compiler / xla / tools / dumped_computation_to_text . cc <nl> void RealMain ( tensorflow : : gtl : : ArraySlice < char * > args , bool compile ) { <nl> layouts . push_back ( & program_shape - > parameters ( i ) ) ; <nl> } <nl> StatusOr < std : : unique_ptr < Executable > > executable = <nl> - local_service - > CompileExecutable ( computation . handle ( ) , layouts , <nl> - & program_shape - > result ( ) , <nl> - / * device_ordinal = * / 0 ) ; <nl> + local_service - > CompileExecutable ( <nl> + computation . handle ( ) , layouts , & program_shape - > result ( ) , <nl> + / * device_ordinal = * / 0 , / * device_allocator = * / nullptr ) ; <nl> <nl> const HloModule & module = executable . ValueOrDie ( ) - > module ( ) ; <nl> <nl>
|
[ XLA ] Add a DeviceAllocator * argument to compilation .
|
tensorflow/tensorflow
|
0b164dd43bbf76547836a9ae6ae424b9cda65968
|
2018-01-27T01:16:06Z
|
mmm a / plugins / net_plugin / net_plugin . cpp <nl> ppp b / plugins / net_plugin / net_plugin . cpp <nl> namespace eosio { <nl> <nl> bool connection : : process_next_message ( net_plugin_impl & impl , uint32_t message_length ) { <nl> try { <nl> + if ( response_expected ) { <nl> + response_expected - > cancel ( ) ; <nl> + } <nl> / / If it is a signed_block , then save the raw message for the cache <nl> / / This must be done before we unpack the message . <nl> / / This code is copied from fc : : io : : unpack ( . . . , unsigned_int ) <nl> namespace eosio { <nl> <nl> bool sync_manager : : syncing ( ) { <nl> fc_dlog ( logger , " ours = $ { ours } known = $ { known } head = $ { head } " , ( " ours " , sync_last_requested_num ) ( " known " , sync_known_lib_num ) ( " head " , chain_plug - > chain ( ) . head_block_num ( ) ) ) ; <nl> - return ( sync_last_requested_num ! = sync_known_lib_num | | <nl> + <nl> + return ( sync_last_requested_num < sync_known_lib_num | | <nl> chain_plug - > chain ( ) . head_block_num ( ) < sync_last_requested_num ) ; <nl> } <nl> <nl> namespace eosio { <nl> auto socket = std : : make_shared < tcp : : socket > ( std : : ref ( app ( ) . get_io_service ( ) ) ) ; <nl> acceptor - > async_accept ( * socket , [ socket , this ] ( boost : : system : : error_code ec ) { <nl> if ( ! ec ) { <nl> + int visitors = 0 ; <nl> + for ( auto & conn : connections ) { <nl> + if ( conn - > current ( ) & & conn - > peer_addr . empty ( ) ) { <nl> + visitors + + ; <nl> + } <nl> + } <nl> + if ( num_clients ! = visitors ) { <nl> + ilog ( " checking max client , visitors = $ { v } num clients $ { n } " , ( " v " , visitors ) ( " n " , num_clients ) ) ; <nl> + num_clients = visitors ; <nl> + } <nl> if ( max_client_count = = 0 | | num_clients < max_client_count ) { <nl> + + num_clients ; <nl> connection_ptr c = std : : make_shared < connection > ( socket ) ; <nl>
|
fix for issues discovered on testnet 2 last night
|
EOSIO/eos
|
ef752bb07cfe6b1568f3a2e35ee23a6632190c70
|
2017-12-12T13:38:22Z
|
mmm a / html5 / default / app / bundle . js <nl> ppp b / html5 / default / app / bundle . js <nl> <nl> * / <nl> <nl> import semver from ' semver ' <nl> - import { typof , isPlainObject } from ' . . / util ' <nl> + import { isPlainObject } from ' . . / util ' <nl> import Vm from ' . . / vm ' <nl> + import { <nl> + registerCustomComponent , <nl> + requireCustomComponent , <nl> + initModules <nl> + } from ' . / register ' <nl> import * as downgrade from ' . / downgrade ' <nl> <nl> const WEEX_COMPONENT_REG = / ^ @ weex - component \ / / <nl> const JS_SURFIX_REG = / \ . js $ / <nl> const isWeexComponent = name = > ! ! name . match ( WEEX_COMPONENT_REG ) <nl> const isWeexModule = name = > ! ! name . match ( WEEX_MODULE_REG ) <nl> const isNormalModule = name = > ! ! name . match ( NORMAL_MODULE_REG ) <nl> - const isNpmModule = name = > ! isWeexComponent ( name ) & & <nl> - ! isWeexModule ( name ) & & <nl> - ! isNormalModule ( name ) <nl> + const isNpmModule = name = > ! isWeexComponent ( name ) & & ! isWeexModule ( name ) & & ! isNormalModule ( name ) <nl> <nl> function removeWeexPrefix ( str ) { <nl> - return str . replace ( WEEX_COMPONENT_REG , ' ' ) <nl> - . replace ( WEEX_MODULE_REG , ' ' ) <nl> + return str . replace ( WEEX_COMPONENT_REG , ' ' ) . replace ( WEEX_MODULE_REG , ' ' ) <nl> } <nl> <nl> function removeJSSurfix ( str ) { <nl> return str . replace ( JS_SURFIX_REG , ' ' ) <nl> } <nl> <nl> + / * * <nl> + * @ deprecated <nl> + * <nl> + * common modules are shared to all instances <nl> + * it ' s very dangerous <nl> + * / <nl> let commonModules = { } <nl> <nl> + / * * <nl> + * @ deprecated <nl> + * / <nl> export function clearCommonModules ( ) { <nl> commonModules = { } <nl> } <nl> <nl> - / / define ( name , factory ) for primary usage <nl> - / / or <nl> - / / define ( name , deps , factory ) for compatibility <nl> - / / Notice : DO NOT use function define ( ) { } , <nl> - / / it will cause error after builded by webpack <nl> - export const define = function ( name , deps , factory ) { <nl> + / * * <nl> + * define ( name , factory ) for primary usage <nl> + * or <nl> + * define ( name , deps , factory ) for compatibility <nl> + * Notice : DO NOT use function define ( ) { } , <nl> + * it will cause error after builded by webpack <nl> + * / <nl> + export function define ( app , name , . . . args ) { <nl> console . debug ( ` [ JS Framework ] define a component $ { name } ` ) <nl> <nl> - if ( typof ( deps ) = = = ' function ' ) { <nl> - factory = deps <nl> - deps = [ ] <nl> + / / adapt args : <nl> + / / 1 . name , deps [ ] , factory ( ) <nl> + / / 2 . name , factory ( ) <nl> + / / 3 . name , definition { } <nl> + let factory , definition <nl> + if ( args . length > 1 ) { <nl> + definition = args [ 1 ] <nl> + } <nl> + else { <nl> + definition = args [ 0 ] <nl> + } <nl> + if ( typeof definition = = = ' function ' ) { <nl> + factory = definition <nl> + definition = null <nl> } <nl> <nl> - const _require = ( name ) = > { <nl> - let cleanName <nl> - <nl> - if ( isWeexComponent ( name ) ) { <nl> - cleanName = removeWeexPrefix ( name ) <nl> - return this . requireComponent ( cleanName ) <nl> - } <nl> - if ( isWeexModule ( name ) ) { <nl> - cleanName = removeWeexPrefix ( name ) <nl> - return this . requireModule ( cleanName ) <nl> - } <nl> - if ( isNormalModule ( name ) ) { <nl> - cleanName = removeJSSurfix ( name ) <nl> - return commonModules [ name ] <nl> - } <nl> - if ( isNpmModule ( name ) ) { <nl> - cleanName = removeJSSurfix ( name ) <nl> - return commonModules [ name ] <nl> + / / resolve definition from factory <nl> + if ( factory ) { <nl> + const r = ( name ) = > { <nl> + if ( isWeexComponent ( name ) ) { <nl> + const cleanName = removeWeexPrefix ( name ) <nl> + return requireCustomComponent ( app , cleanName ) <nl> + } <nl> + if ( isWeexModule ( name ) ) { <nl> + const cleanName = removeWeexPrefix ( name ) <nl> + return app . requireModule ( cleanName ) <nl> + } <nl> + if ( isNormalModule ( name ) | | isNpmModule ( name ) ) { <nl> + const cleanName = removeJSSurfix ( name ) <nl> + return commonModules [ cleanName ] <nl> + } <nl> } <nl> + const m = { exports : { } } <nl> + factory ( r , m . exports , m ) <nl> + definition = m . exports <nl> } <nl> - const _module = { exports : { } } <nl> <nl> - let cleanName <nl> + / / apply definition <nl> if ( isWeexComponent ( name ) ) { <nl> - cleanName = removeWeexPrefix ( name ) <nl> - <nl> - factory ( _require , _module . exports , _module ) <nl> - <nl> - this . registerComponent ( cleanName , _module . exports ) <nl> + const cleanName = removeWeexPrefix ( name ) <nl> + registerCustomComponent ( app , cleanName , definition ) <nl> } <nl> else if ( isWeexModule ( name ) ) { <nl> - cleanName = removeWeexPrefix ( name ) <nl> - <nl> - factory ( _require , _module . exports , _module ) <nl> - <nl> - Vm . registerModules ( { <nl> - [ cleanName ] : _module . exports <nl> - } ) <nl> + const cleanName = removeWeexPrefix ( name ) <nl> + initModules ( { [ cleanName ] : definition } ) <nl> } <nl> else if ( isNormalModule ( name ) ) { <nl> - cleanName = removeJSSurfix ( name ) <nl> - <nl> - factory ( _require , _module . exports , _module ) <nl> - <nl> - commonModules [ cleanName ] = _module . exports <nl> + const cleanName = removeJSSurfix ( name ) <nl> + commonModules [ cleanName ] = definition <nl> } <nl> else if ( isNpmModule ( name ) ) { <nl> - cleanName = removeJSSurfix ( name ) <nl> - <nl> - factory ( _require , _module . exports , _module ) <nl> - <nl> - const exports = _module . exports <nl> - if ( exports . template | | <nl> - exports . style | | <nl> - exports . methods ) { <nl> + const cleanName = removeJSSurfix ( name ) <nl> + if ( definition . template | | <nl> + definition . style | | <nl> + definition . methods ) { <nl> / / downgrade to old define method ( define ( ' componentName ' , factory ) ) <nl> / / the exports contain one key of template , style or methods <nl> / / but it has risk ! ! ! <nl> - this . registerComponent ( cleanName , exports ) <nl> + registerCustomComponent ( app , cleanName , definition ) <nl> } <nl> else { <nl> - commonModules [ cleanName ] = _module . exports <nl> + commonModules [ cleanName ] = definition <nl> } <nl> } <nl> } <nl> <nl> + / * * <nl> + * bootstrap app from a certain custom component with config & data <nl> + * / <nl> export function bootstrap ( app , name , config , data ) { <nl> console . debug ( ` [ JS Framework ] bootstrap for $ { name } ` ) <nl> <nl> + / / 1 . validate custom component name first <nl> let cleanName <nl> - <nl> if ( isWeexComponent ( name ) ) { <nl> cleanName = removeWeexPrefix ( name ) <nl> } <nl> export function bootstrap ( app , name , config , data ) { <nl> cleanName = removeJSSurfix ( name ) <nl> / / check if define by old ' define ' method <nl> / * istanbul ignore if * / <nl> - if ( ! app . customComponentMap [ cleanName ] ) { <nl> + if ( ! requireCustomComponent ( app , cleanName ) ) { <nl> return new Error ( ` It ' s not a component : $ { name } ` ) <nl> } <nl> } <nl> export function bootstrap ( app , name , config , data ) { <nl> return new Error ( ` Wrong component name : $ { name } ` ) <nl> } <nl> <nl> + / / 2 . validate configuration <nl> config = isPlainObject ( config ) ? config : { } <nl> - <nl> + / / 2 . 1 transformer version check <nl> if ( typeof config . transformerVersion = = = ' string ' & & <nl> typeof global . transformerVersion = = = ' string ' & & <nl> ! semver . satisfies ( config . transformerVersion , <nl> export function bootstrap ( app , name , config , data ) { <nl> return new Error ( ` JS Bundle version : $ { config . transformerVersion } ` + <nl> ` not compatible with $ { global . transformerVersion } ` ) <nl> } <nl> - <nl> - const _checkDowngrade = downgrade . check ( config . downgrade ) <nl> + / / 2 . 2 downgrade version check <nl> + const downgradeResult = downgrade . check ( config . downgrade ) <nl> / * istanbul ignore if * / <nl> - if ( _checkDowngrade . isDowngrade ) { <nl> + if ( downgradeResult . isDowngrade ) { <nl> app . callTasks ( [ { <nl> module : ' instanceWrap ' , <nl> method : ' error ' , <nl> args : [ <nl> - _checkDowngrade . errorType , <nl> - _checkDowngrade . code , <nl> - _checkDowngrade . errorMessage <nl> + downgradeResult . errorType , <nl> + downgradeResult . code , <nl> + downgradeResult . errorMessage <nl> ] <nl> } ] ) <nl> - return new Error ( ` Downgrade [ $ { _checkDowngrade . code } ] : $ { _checkDowngrade . errorMessage } ` ) <nl> + return new Error ( ` Downgrade [ $ { downgradeResult . code } ] : $ { downgradeResult . errorMessage } ` ) <nl> } <nl> <nl> + / / 3 . create a new Vm with custom component name and data <nl> app . vm = new Vm ( cleanName , null , { _app : app } , null , data ) <nl> } <nl> <nl> / * * <nl> * @ deprecated <nl> * / <nl> - export function register ( type , options ) { <nl> + export function register ( app , type , options ) { <nl> console . warn ( ' [ JS Framework ] Register is deprecated , please install lastest transformer . ' ) <nl> - this . registerComponent ( type , options ) <nl> + registerCustomComponent ( app , type , options ) <nl> } <nl> mmm a / html5 / default / app / ctrl . js <nl> ppp b / html5 / default / app / ctrl . js <nl> <nl> * corresponded with the API of instance manager ( framework . js ) <nl> * / <nl> <nl> - import { extend , bind } from ' . . / util ' <nl> + import { extend , typof } from ' . . / util ' <nl> + import renderer from ' . . / config ' <nl> import { <nl> define , <nl> bootstrap , <nl> register <nl> } from ' . / bundle ' <nl> <nl> - export function updateActions ( ) { <nl> - this . differ . flush ( ) <nl> - const tasks = [ ] <nl> - if ( this . doc & & this . doc . listener & & this . doc . listener . updates . length ) { <nl> - tasks . push ( . . . this . doc . listener . updates ) <nl> - this . doc . listener . updates = [ ] <nl> - } <nl> - if ( tasks . length ) { <nl> - return this . callTasks ( tasks ) <nl> - } <nl> - } <nl> - <nl> - export function init ( code , data ) { <nl> + export function init ( app , code , data ) { <nl> console . debug ( ' [ JS Framework ] Intialize an instance with : \ n ' , data ) <nl> - <nl> let result <nl> - / / @ see : lib / app / bundle . js <nl> - const bundleDefine = bind ( define , this ) <nl> + <nl> + / / prepare app env methods <nl> + const bundleDefine = ( . . . args ) = > define ( app , . . . args ) <nl> const bundleBootstrap = ( name , config , _data ) = > { <nl> - result = bootstrap ( this , name , config , _data | | data ) <nl> - this . updateActions ( ) <nl> - this . doc . listener . createFinish ( ) <nl> - console . debug ( ` [ JS Framework ] After intialized an instance ( $ { this . id } ) ` ) <nl> + result = bootstrap ( app , name , config , _data | | data ) <nl> + updateActions ( app ) <nl> + app . doc . listener . createFinish ( ) <nl> + console . debug ( ` [ JS Framework ] After intialized an instance ( $ { app . id } ) ` ) <nl> } <nl> - <nl> - / / backward ( register / render ) <nl> - const bundleRegister = bind ( register , this ) <nl> + const bundleRegister = ( . . . args ) = > register ( app , . . . args ) <nl> const bundleRender = ( name , _data ) = > { <nl> - result = bootstrap ( this , name , { } , _data ) <nl> + result = bootstrap ( app , name , { } , _data ) <nl> } <nl> - <nl> const bundleRequire = name = > _data = > { <nl> - result = bootstrap ( this , name , { } , _data ) <nl> + result = bootstrap ( app , name , { } , _data ) <nl> } <nl> + const bundleDocument = app . doc <nl> <nl> - const bundleDocument = this . doc <nl> - <nl> + / / prepare code <nl> let functionBody <nl> / * istanbul ignore if * / <nl> if ( typeof code = = = ' function ' ) { <nl> export function init ( code , data ) { <nl> functionBody = code . toString ( ) <nl> } <nl> <nl> + / / run code and get result <nl> const { WXEnvironment } = global <nl> if ( WXEnvironment & & WXEnvironment . platform ! = = ' Web ' ) { <nl> - const timer = this . requireModule ( ' timer ' ) <nl> + / / timer APIs polyfill in native <nl> + const timer = app . requireModule ( ' timer ' ) <nl> const timerAPIs = { <nl> setTimeout : ( . . . args ) = > { <nl> const handler = function ( ) { <nl> args [ 0 ] ( . . . args . slice ( 2 ) ) <nl> } <nl> timer . setTimeout ( handler , args [ 1 ] ) <nl> - return this . uid . toString ( ) <nl> + return app . uid . toString ( ) <nl> } , <nl> setInterval : ( . . . args ) = > { <nl> const handler = function ( ) { <nl> args [ 0 ] ( . . . args . slice ( 2 ) ) <nl> } <nl> timer . setInterval ( handler , args [ 1 ] ) <nl> - return this . uid . toString ( ) <nl> + return app . uid . toString ( ) <nl> } , <nl> clearTimeout : ( n ) = > { <nl> timer . clearTimeout ( n ) <nl> export function init ( code , data ) { <nl> return result <nl> } <nl> <nl> - export function destroy ( ) { <nl> - console . debug ( ` [ JS Framework ] Destory an instance ( $ { this . id } ) ` ) <nl> + export function refresh ( app , data ) { <nl> + console . debug ( ` [ JS Framework ] Refresh with ` , data , <nl> + ` in instance [ $ { app . id } ] ` ) <nl> + const vm = app . vm <nl> + if ( vm & & data ) { <nl> + app . doc . close ( ) <nl> + if ( typeof vm . refreshData = = = ' function ' ) { <nl> + vm . refreshData ( data ) <nl> + } <nl> + else { <nl> + extend ( vm , data ) <nl> + } <nl> + updateActions ( app ) <nl> + app . doc . listener . refreshFinish ( ) <nl> + app . doc . open ( ) <nl> + return <nl> + } <nl> + return new Error ( ` invalid data " $ { data } " ` ) <nl> + } <nl> + <nl> + export function destroy ( app ) { <nl> + console . debug ( ` [ JS Framework ] Destory an instance ( $ { app . id } ) ` ) <nl> <nl> - this . id = ' ' <nl> - this . options = null <nl> - this . blocks = null <nl> - this . vm = null <nl> - this . doc = null <nl> - this . customComponentMap = null <nl> - this . callbacks = null <nl> + app . id = ' ' <nl> + app . options = null <nl> + app . blocks = null <nl> + app . vm = null <nl> + app . doc = null <nl> + app . customComponentMap = null <nl> + app . callbacks = null <nl> } <nl> <nl> - export function getRootElement ( ) { <nl> - const doc = this . doc | | { } <nl> + export function getRootElement ( app ) { <nl> + const doc = app . doc | | { } <nl> const body = doc . body | | { } <nl> return body . toJSON ? body . toJSON ( ) : { } <nl> } <nl> <nl> - export function fireEvent ( ref , type , e , domChanges ) { <nl> - console . debug ( ` [ JS Framework ] Fire a " $ { type } " event on an element ( $ { ref } ) in instance ( $ { this . id } ) ` ) <nl> + export function fireEvent ( app , ref , type , e , domChanges ) { <nl> + console . debug ( ` [ JS Framework ] Fire a " $ { type } " event on an element ( $ { ref } ) in instance ( $ { app . id } ) ` ) <nl> if ( Array . isArray ( ref ) ) { <nl> ref . some ( ( ref ) = > { <nl> - return this . fireEvent ( ref , type , e ) ! = = false <nl> + return app . fireEvent ( ref , type , e ) ! = = false <nl> } ) <nl> return <nl> } <nl> - <nl> - const el = this . doc . getRef ( ref ) <nl> - <nl> + const el = app . doc . getRef ( ref ) <nl> if ( el ) { <nl> - this . doc . close ( ) <nl> - const result = this . doc . fireEvent ( el , type , e , domChanges ) <nl> - this . updateActions ( ) <nl> - this . doc . listener . updateFinish ( ) <nl> - this . doc . open ( ) <nl> + app . doc . close ( ) <nl> + const result = app . doc . fireEvent ( el , type , e , domChanges ) <nl> + updateActions ( app ) <nl> + app . doc . listener . updateFinish ( ) <nl> + app . doc . open ( ) <nl> return result <nl> } <nl> - <nl> return new Error ( ` invalid element reference " $ { ref } " ` ) <nl> } <nl> <nl> - export function callback ( callbackId , data , ifKeepAlive ) { <nl> + export function callback ( app , callbackId , data , ifKeepAlive ) { <nl> console . debug ( ` [ JS Framework ] Invoke a callback ( $ { callbackId } ) with ` , data , <nl> - ` in instance ( $ { this . id } ) ` ) <nl> - <nl> - const callback = this . callbacks [ callbackId ] <nl> - <nl> + ` in instance ( $ { app . id } ) ` ) <nl> + const callback = app . callbacks [ callbackId ] <nl> if ( typeof callback = = = ' function ' ) { <nl> - this . doc . close ( ) <nl> - callback ( data ) / / data is already a object , @ see : lib / runtime / index . js <nl> - <nl> + app . doc . close ( ) <nl> + callback ( data ) <nl> if ( typeof ifKeepAlive = = = ' undefined ' | | ifKeepAlive = = = false ) { <nl> - this . callbacks [ callbackId ] = undefined <nl> + app . callbacks [ callbackId ] = undefined <nl> } <nl> - <nl> - this . updateActions ( ) <nl> - this . doc . listener . updateFinish ( ) <nl> - this . doc . open ( ) <nl> + updateActions ( app ) <nl> + app . doc . listener . updateFinish ( ) <nl> + app . doc . open ( ) <nl> return <nl> } <nl> - <nl> return new Error ( ` invalid callback id " $ { callbackId } " ` ) <nl> } <nl> <nl> - export function refreshData ( data ) { <nl> - console . debug ( ` [ JS Framework ] Refresh with ` , data , <nl> - ` in instance [ $ { this . id } ] ` ) <nl> - <nl> - const vm = this . vm <nl> + export function updateActions ( app ) { <nl> + app . differ . flush ( ) <nl> + const tasks = [ ] <nl> + if ( app . doc & & app . doc . listener & & app . doc . listener . updates . length ) { <nl> + tasks . push ( . . . app . doc . listener . updates ) <nl> + app . doc . listener . updates = [ ] <nl> + } <nl> + if ( tasks . length ) { <nl> + return callTasks ( app , tasks ) <nl> + } <nl> + } <nl> <nl> - if ( vm & & data ) { <nl> - this . doc . close ( ) <nl> - if ( typeof vm . refreshData = = = ' function ' ) { <nl> - vm . refreshData ( data ) <nl> - } <nl> - else { <nl> - extend ( vm , data ) <nl> - } <nl> - this . updateActions ( ) <nl> - this . doc . listener . refreshFinish ( ) <nl> - this . doc . open ( ) <nl> - return <nl> + export function callTasks ( app , tasks ) { <nl> + if ( typof ( tasks ) ! = = ' array ' ) { <nl> + tasks = [ tasks ] <nl> } <nl> <nl> - return new Error ( ` invalid data " $ { data } " ` ) <nl> + tasks . forEach ( ( task ) = > { <nl> + task . args = task . args . map ( arg = > normalize ( arg , app ) ) <nl> + } ) <nl> + <nl> + return renderer . sendTasks ( app . id , tasks , ' - 1 ' ) <nl> + } <nl> + <nl> + function normalize ( v , app ) { <nl> + const type = typof ( v ) <nl> + <nl> + switch ( type ) { <nl> + case ' undefined ' : <nl> + case ' null ' : <nl> + return ' ' <nl> + case ' regexp ' : <nl> + return v . toString ( ) <nl> + case ' date ' : <nl> + return v . toISOString ( ) <nl> + case ' number ' : <nl> + case ' string ' : <nl> + case ' boolean ' : <nl> + case ' array ' : <nl> + case ' object ' : <nl> + if ( v instanceof renderer . Element ) { <nl> + return v . ref <nl> + } <nl> + return v <nl> + case ' function ' : <nl> + app . callbacks [ + + app . uid ] = v <nl> + return app . uid . toString ( ) <nl> + default : <nl> + return JSON . stringify ( v ) <nl> + } <nl> } <nl> mmm a / html5 / default / app / index . js <nl> ppp b / html5 / default / app / index . js <nl> <nl> * Weex instance constructor & definition <nl> * / <nl> <nl> - import { extend , typof } from ' . . / util ' <nl> - import * as ctrl from ' . / ctrl ' <nl> import Differ from ' . / differ ' <nl> <nl> import renderer from ' . . / config ' <nl> - import { registerComponent , requireComponent , requireModule } from ' . / register ' <nl> + import { requireModule } from ' . / register ' <nl> + import { updateActions , callTasks } from ' . / ctrl ' <nl> <nl> - export default function AppInstance ( instanceId , options ) { <nl> - this . id = instanceId <nl> + export default function App ( id , options ) { <nl> + this . id = id <nl> this . options = options | | { } <nl> this . vm = null <nl> this . customComponentMap = { } <nl> this . callbacks = { } <nl> - this . doc = new renderer . Document ( <nl> - instanceId , <nl> - this . options . bundleUrl <nl> - ) <nl> - this . differ = new Differ ( instanceId ) <nl> + this . doc = new renderer . Document ( id , this . options . bundleUrl ) <nl> + this . differ = new Differ ( id ) <nl> this . uid = 0 <nl> } <nl> <nl> - function normalize ( v , app ) { <nl> - const type = typof ( v ) <nl> - <nl> - switch ( type ) { <nl> - case ' undefined ' : <nl> - case ' null ' : <nl> - return ' ' <nl> - case ' regexp ' : <nl> - return v . toString ( ) <nl> - case ' date ' : <nl> - return v . toISOString ( ) <nl> - case ' number ' : <nl> - case ' string ' : <nl> - case ' boolean ' : <nl> - case ' array ' : <nl> - case ' object ' : <nl> - if ( v instanceof renderer . Element ) { <nl> - return v . ref <nl> - } <nl> - return v <nl> - case ' function ' : <nl> - app . callbacks [ + + app . uid ] = v <nl> - return app . uid . toString ( ) <nl> - default : <nl> - return JSON . stringify ( v ) <nl> - } <nl> + / * * <nl> + * @ deprecated <nl> + * / <nl> + App . prototype . requireModule = function ( name ) { <nl> + return requireModule ( this , name ) <nl> } <nl> <nl> - AppInstance . prototype . callTasks = function ( tasks ) { <nl> - if ( typof ( tasks ) ! = = ' array ' ) { <nl> - tasks = [ tasks ] <nl> - } <nl> - <nl> - tasks . forEach ( ( task ) = > { <nl> - task . args = task . args . map ( arg = > normalize ( arg , this ) ) <nl> - } ) <nl> - <nl> - return renderer . sendTasks ( this . id , tasks , ' - 1 ' ) <nl> + / * * <nl> + * @ deprecated <nl> + * / <nl> + App . prototype . updateActions = function ( ) { <nl> + updateActions ( this ) <nl> } <nl> <nl> - extend ( AppInstance . prototype , ctrl , { <nl> - registerComponent , <nl> - requireComponent , <nl> - requireModule <nl> - } ) <nl> + / * * <nl> + * @ deprecated <nl> + * / <nl> + App . prototype . callTasks = function ( tasks ) { <nl> + callTasks ( this , tasks ) <nl> + } <nl> mmm a / html5 / default / app / register . js <nl> ppp b / html5 / default / app / register . js <nl> <nl> let nativeModules = { } <nl> <nl> - function assignModules ( modules , ifReplace ) { <nl> + / / for testing <nl> + <nl> + / * * <nl> + * for testing <nl> + * / <nl> + export function getModule ( moduleName ) { <nl> + return nativeModules [ moduleName ] <nl> + } <nl> + <nl> + / * * <nl> + * for testing <nl> + * / <nl> + export function clearModules ( ) { <nl> + nativeModules = { } <nl> + } <nl> + <nl> + / / for framework <nl> + <nl> + / * * <nl> + * init modules for an app instance <nl> + * the second param determines whether to replace an existed method <nl> + * / <nl> + export function initModules ( modules , ifReplace ) { <nl> for ( const moduleName in modules ) { <nl> / / init ` modules [ moduleName ] [ ] ` <nl> let methods = nativeModules [ moduleName ] <nl> function assignModules ( modules , ifReplace ) { <nl> } <nl> } <nl> <nl> - function assignApis ( Ctor , apis ) { <nl> - const p = Ctor . prototype <nl> + / * * <nl> + * init app methods <nl> + * / <nl> + export function initMethods ( Vm , apis ) { <nl> + const p = Vm . prototype <nl> <nl> for ( const apiName in apis ) { <nl> if ( ! p . hasOwnProperty ( apiName ) ) { <nl> function assignApis ( Ctor , apis ) { <nl> } <nl> } <nl> <nl> - export function clearModules ( ) { <nl> - nativeModules = { } <nl> - } <nl> - <nl> - export function getModule ( moduleName ) { <nl> - return nativeModules [ moduleName ] <nl> - } <nl> + / / for app <nl> <nl> / * * <nl> - * @ context a instance of AppInstance <nl> + * get a module of methods for an app instance <nl> * / <nl> - export function requireModule ( moduleName ) { <nl> - const methods = nativeModules [ moduleName ] <nl> + export function requireModule ( app , name ) { <nl> + const methods = nativeModules [ name ] <nl> const target = { } <nl> - <nl> for ( const methodName in methods ) { <nl> - target [ methodName ] = ( . . . args ) = > this . callTasks ( { <nl> - module : moduleName , <nl> + target [ methodName ] = ( . . . args ) = > app . callTasks ( { <nl> + module : name , <nl> method : methodName , <nl> args : args <nl> } ) <nl> } <nl> - <nl> return target <nl> } <nl> <nl> / * * <nl> - * @ context Vm <nl> - * / <nl> - export function registerModules ( modules , ifReplace ) { <nl> - assignModules ( modules , ifReplace ) <nl> - } <nl> - <nl> - / * * <nl> - * @ context Vm <nl> - * / <nl> - export function registerMethods ( apis ) { <nl> - assignApis ( this , apis ) <nl> - } <nl> - <nl> - / * * <nl> - * @ context a instance of AppInstance <nl> + * get a custom component options <nl> * / <nl> - export function requireComponent ( name ) { <nl> - const { customComponentMap } = this <nl> + export function requireCustomComponent ( app , name ) { <nl> + const { customComponentMap } = app <nl> return customComponentMap [ name ] <nl> } <nl> <nl> / * * <nl> - * @ context a instance of AppInstance <nl> + * register a custom component options <nl> * / <nl> - export function registerComponent ( name , def ) { <nl> - const { customComponentMap } = this <nl> + export function registerCustomComponent ( app , name , def ) { <nl> + const { customComponentMap } = app <nl> <nl> if ( customComponentMap [ name ] ) { <nl> console . error ( ` [ JS Framework ] define a component ( $ { name } ) that already exists ` ) <nl> mmm a / html5 / default / index . js <nl> ppp b / html5 / default / index . js <nl> <nl> / * * <nl> * @ fileOverview Main entry , instance manager <nl> * <nl> - * - createInstance ( instanceId , code , options , data ) <nl> - * - refreshInstance ( instanceId , data ) <nl> - * - destroyInstance ( instanceId ) <nl> + * - createInstance ( id , code , options , data ) <nl> + * - refreshInstance ( id , data ) <nl> + * - destroyInstance ( id ) <nl> * - registerComponents ( components ) <nl> * - registerModules ( modules ) <nl> - * - getRoot ( instanceId ) <nl> + * - getRoot ( id ) <nl> * - instanceMap <nl> - * - callJS ( instanceId , tasks ) <nl> + * - callJS ( id , tasks ) <nl> * - fireEvent ( ref , type , data ) <nl> * - callback ( funcId , data ) <nl> * / <nl> <nl> import config from ' . / config ' <nl> - import AppInstance from ' . / app ' <nl> + import App from ' . / app ' <nl> + import { <nl> + init as initApp , <nl> + refresh , <nl> + destroy , <nl> + getRootElement , <nl> + fireEvent , <nl> + callback <nl> + } from ' . / app / ctrl ' <nl> + import { <nl> + initModules , <nl> + initMethods <nl> + } from ' . / app / register ' <nl> import Vm from ' . / vm ' <nl> <nl> const { <nl> export function init ( cfg ) { <nl> / * * <nl> * create a Weex instance <nl> * <nl> - * @ param { string } instanceId <nl> + * @ param { string } id <nl> * @ param { string } code <nl> * @ param { object } [ options ] option ` HAS_LOG ` enable print log <nl> * @ param { object } [ data ] <nl> * / <nl> - export function createInstance ( instanceId , code , options , data ) { <nl> - let instance = instanceMap [ instanceId ] <nl> + export function createInstance ( id , code , options , data ) { <nl> + let instance = instanceMap [ id ] <nl> options = options | | { } <nl> - <nl> let result <nl> if ( ! instance ) { <nl> - instance = new AppInstance ( instanceId , options ) <nl> - instanceMap [ instanceId ] = instance <nl> - result = instance . init ( code , data ) <nl> + instance = new App ( id , options ) <nl> + instanceMap [ id ] = instance <nl> + result = initApp ( instance , code , data ) <nl> } <nl> else { <nl> - result = new Error ( ` invalid instance id " $ { instanceId } " ` ) <nl> + result = new Error ( ` invalid instance id " $ { id } " ` ) <nl> } <nl> - <nl> return result <nl> } <nl> <nl> / * * <nl> * refresh a Weex instance <nl> * <nl> - * @ param { string } instanceId <nl> + * @ param { string } id <nl> * @ param { object } data <nl> * / <nl> - export function refreshInstance ( instanceId , data ) { <nl> - const instance = instanceMap [ instanceId ] <nl> + export function refreshInstance ( id , data ) { <nl> + const instance = instanceMap [ id ] <nl> let result <nl> if ( instance ) { <nl> - result = instance . refreshData ( data ) <nl> + result = refresh ( instance , data ) <nl> } <nl> else { <nl> - result = new Error ( ` invalid instance id " $ { instanceId } " ` ) <nl> + result = new Error ( ` invalid instance id " $ { id } " ` ) <nl> } <nl> return result <nl> } <nl> <nl> / * * <nl> * destroy a Weex instance <nl> - * @ param { string } instanceId <nl> + * @ param { string } id <nl> * / <nl> - export function destroyInstance ( instanceId ) { <nl> - const instance = instanceMap [ instanceId ] <nl> + export function destroyInstance ( id ) { <nl> + const instance = instanceMap [ id ] <nl> if ( ! instance ) { <nl> - return new Error ( ` invalid instance id " $ { instanceId } " ` ) <nl> + return new Error ( ` invalid instance id " $ { id } " ` ) <nl> } <nl> - <nl> - instance . destroy ( ) <nl> - delete instanceMap [ instanceId ] <nl> + destroy ( instance ) <nl> + delete instanceMap [ id ] <nl> return instanceMap <nl> } <nl> <nl> export function registerComponents ( components ) { <nl> * / <nl> export function registerModules ( modules ) { <nl> if ( typeof modules = = = ' object ' ) { <nl> - Vm . registerModules ( modules ) <nl> + initModules ( modules ) <nl> } <nl> } <nl> <nl> export function registerModules ( modules ) { <nl> * register the name and methods of each api <nl> * @ param { object } apis a object of apis <nl> * / <nl> - export function registerMethods ( apis ) { <nl> - if ( typeof apis = = = ' object ' ) { <nl> - Vm . registerMethods ( apis ) <nl> + export function registerMethods ( methods ) { <nl> + if ( typeof methods = = = ' object ' ) { <nl> + initMethods ( Vm , methods ) <nl> } <nl> } <nl> + <nl> global . registerMethods = registerMethods <nl> <nl> / * * <nl> * get a whole element tree of an instance <nl> * for debugging <nl> - * @ param { string } instanceId <nl> + * @ param { string } id <nl> * @ return { object } a virtual dom tree <nl> * / <nl> - export function getRoot ( instanceId ) { <nl> - const instance = instanceMap [ instanceId ] <nl> + export function getRoot ( id ) { <nl> + const instance = instanceMap [ id ] <nl> let result <nl> if ( instance ) { <nl> - result = instance . getRootElement ( ) <nl> + result = getRootElement ( instance ) <nl> } <nl> else { <nl> - result = new Error ( ` invalid instance id " $ { instanceId } " ` ) <nl> + result = new Error ( ` invalid instance id " $ { id } " ` ) <nl> } <nl> return result <nl> } <nl> <nl> const jsHandlers = { <nl> - fireEvent : function fireEvent ( instanceId , ref , type , data , domChanges ) { <nl> - const instance = instanceMap [ instanceId ] <nl> - return instance . fireEvent ( ref , type , data , domChanges ) <nl> + fireEvent : ( id , . . . args ) = > { <nl> + return fireEvent ( instanceMap [ id ] , . . . args ) <nl> } , <nl> - <nl> - callback : function callback ( instanceId , funcId , data , ifLast ) { <nl> - const instance = instanceMap [ instanceId ] <nl> - return instance . callback ( funcId , data , ifLast ) <nl> + callback : ( id , . . . args ) = > { <nl> + return callback ( instanceMap [ id ] , . . . args ) <nl> } <nl> } <nl> <nl> / * * <nl> * accept calls from native ( event or callback ) <nl> * <nl> - * @ param { string } instanceId <nl> + * @ param { string } id <nl> * @ param { array } tasks list with ` method ` and ` args ` <nl> * / <nl> - export function receiveTasks ( instanceId , tasks ) { <nl> - const instance = instanceMap [ instanceId ] <nl> + export function receiveTasks ( id , tasks ) { <nl> + const instance = instanceMap [ id ] <nl> if ( instance & & Array . isArray ( tasks ) ) { <nl> const results = [ ] <nl> tasks . forEach ( ( task ) = > { <nl> const handler = jsHandlers [ task . method ] <nl> const args = [ . . . task . args ] <nl> if ( typeof handler = = = ' function ' ) { <nl> - args . unshift ( instanceId ) <nl> + args . unshift ( id ) <nl> results . push ( handler ( . . . args ) ) <nl> } <nl> } ) <nl> return results <nl> } <nl> - return new Error ( ` invalid instance id " $ { instanceId } " or tasks ` ) <nl> + return new Error ( ` invalid instance id " $ { id } " or tasks ` ) <nl> } <nl> mmm a / html5 / default / vm / index . js <nl> ppp b / html5 / default / vm / index . js <nl> import { <nl> initEvents , <nl> mixinEvents <nl> } from ' . / events ' <nl> - import { <nl> - registerModules , <nl> - registerMethods <nl> - } from ' . . / app / register ' <nl> <nl> / * * <nl> * ViewModel constructor <nl> export default function Vm ( <nl> } <nl> <nl> mixinEvents ( Vm . prototype ) <nl> - <nl> - extend ( Vm , { <nl> - registerModules , <nl> - registerMethods <nl> - } ) <nl> mmm a / html5 / test / unit / default / api / methods . js <nl> ppp b / html5 / test / unit / default / api / methods . js <nl> chai . use ( sinonChai ) <nl> import ' . . / . . / . . / . . / shared / console ' <nl> import * as modules from ' . . / . . / . . / . . / default / api / modules ' <nl> import * as methods from ' . . / . . / . . / . . / default / api / methods ' <nl> - import { registerModules , requireModule , clearModules , registerMethods } from ' . . / . . / . . / . . / default / app / register ' <nl> + import { initModules , requireModule , clearModules , initMethods } from ' . . / . . / . . / . . / default / app / register ' <nl> <nl> function Vm ( ) { <nl> } <nl> <nl> - Object . assign ( Vm , { <nl> - registerMethods <nl> - } ) <nl> - <nl> - describe ( ' built - in ' , ( ) = > { <nl> + describe ( ' built - in methods ' , ( ) = > { <nl> let vm <nl> const requireSpy = sinon . spy ( ) <nl> const moduleSpy = sinon . spy ( ) <nl> describe ( ' built - in ' , ( ) = > { <nl> before ( ( ) = > { <nl> clearModules ( ) <nl> <nl> - registerModules ( modules ) <nl> - Vm . registerMethods ( methods ) <nl> + initModules ( modules ) <nl> + initMethods ( Vm , methods ) <nl> <nl> vm = new Vm ( ) <nl> <nl> describe ( ' built - in ' , ( ) = > { <nl> requireModule : ( name ) = > { <nl> requireSpy ( name ) <nl> <nl> - const module = requireModule ( name ) <nl> + const module = requireModule ( this , name ) <nl> for ( const moduleName in module ) { <nl> module [ moduleName ] = function ( . . . args ) { <nl> moduleSpy ( . . . args ) <nl> describe ( ' built - in ' , ( ) = > { <nl> vm [ apiName ] = sinon . spy ( vm , apiName ) <nl> } <nl> } <nl> + sinon . stub ( console , ' warn ' ) <nl> } ) <nl> <nl> beforeEach ( ( ) = > { <nl> requireSpy . reset ( ) <nl> moduleSpy . reset ( ) <nl> + console . warn . reset ( ) <nl> } ) <nl> <nl> after ( ( ) = > { <nl> clearModules ( ) <nl> + console . warn . restore ( ) <nl> } ) <nl> <nl> - describe ( ' common apis ' , ( ) = > { <nl> - before ( ( ) = > { <nl> - sinon . stub ( console , ' warn ' ) <nl> - } ) <nl> - <nl> - beforeEach ( ( ) = > { <nl> - console . warn . reset ( ) <nl> - } ) <nl> - <nl> - after ( ( ) = > { <nl> - console . warn . restore ( ) <nl> - } ) <nl> + it ( ' $ ' , ( ) = > { <nl> + expect ( vm . $ ( ' a ' ) ) . to . deep . equal ( vm . _ids . a . vm ) <nl> + expect ( console . warn . callCount ) . to . be . equal ( 1 ) <nl> + } ) <nl> <nl> - it ( ' $ ' , ( ) = > { <nl> - expect ( vm . $ ( ' a ' ) ) . to . deep . equal ( vm . _ids . a . vm ) <nl> - expect ( console . warn . callCount ) . to . be . equal ( 1 ) <nl> - } ) <nl> + it ( ' $ el ' , ( ) = > { <nl> + expect ( vm . $ el ( ' a ' ) ) . to . deep . equal ( vm . _ids . a . el ) <nl> + } ) <nl> <nl> - it ( ' $ el ' , ( ) = > { <nl> - expect ( vm . $ el ( ' a ' ) ) . to . deep . equal ( vm . _ids . a . el ) <nl> - } ) <nl> + it ( ' $ vm ' , ( ) = > { <nl> + expect ( vm . $ vm ( ' a ' ) ) . to . deep . equal ( vm . _ids . a . vm ) <nl> + } ) <nl> <nl> - it ( ' $ vm ' , ( ) = > { <nl> - expect ( vm . $ vm ( ' a ' ) ) . to . deep . equal ( vm . _ids . a . vm ) <nl> - } ) <nl> + it ( ' $ scrollTo ' , ( ) = > { <nl> + vm . $ scrollTo ( ' a ' , 100 ) <nl> + expect ( requireSpy . firstCall . args [ 0 ] ) . to . be . equal ( ' dom ' ) <nl> + expect ( moduleSpy . firstCall . args . length ) . to . be . equal ( 2 ) <nl> + } ) <nl> <nl> - it ( ' $ scrollTo ' , ( ) = > { <nl> - vm . $ scrollTo ( ' a ' , 100 ) <nl> - expect ( requireSpy . firstCall . args [ 0 ] ) . to . be . equal ( ' dom ' ) <nl> - expect ( moduleSpy . firstCall . args . length ) . to . be . equal ( 2 ) <nl> + it ( ' $ transition ' , ( ) = > { <nl> + const callback = sinon . spy ( ) <nl> + vm . $ transition ( ' a ' , { styles : { color : ' # FF0000 ' } } , callback ) <nl> + expect ( requireSpy . firstCall . args [ 0 ] ) . eql ( ' animation ' ) <nl> + expect ( moduleSpy . firstCall . args . length ) . eql ( 3 ) <nl> + expect ( moduleSpy . firstCall . args [ 0 ] ) . eql ( ' _root ' ) <nl> + expect ( moduleSpy . firstCall . args [ 1 ] ) . eql ( { <nl> + styles : { color : ' # FF0000 ' } <nl> } ) <nl> + expect ( callback . callCount ) . eql ( 1 ) <nl> + } ) <nl> <nl> - it ( ' $ transition ' , ( ) = > { <nl> - const callback = sinon . spy ( ) <nl> - vm . $ transition ( ' a ' , { styles : { color : ' # FF0000 ' } } , callback ) <nl> - expect ( requireSpy . firstCall . args [ 0 ] ) . eql ( ' animation ' ) <nl> - expect ( moduleSpy . firstCall . args . length ) . eql ( 3 ) <nl> - expect ( moduleSpy . firstCall . args [ 0 ] ) . eql ( ' _root ' ) <nl> - expect ( moduleSpy . firstCall . args [ 1 ] ) . eql ( { <nl> - styles : { color : ' # FF0000 ' } <nl> - } ) <nl> - expect ( callback . callCount ) . eql ( 1 ) <nl> + it ( ' $ getConfig ' , ( ) = > { <nl> + global . WXEnvironment = { <nl> + a : ' b ' <nl> + } <nl> + const config = vm . $ getConfig ( ) <nl> + expect ( config ) . eql ( { <nl> + debug : true , <nl> + bundleUrl : ' path_to_bundleUrl ' , <nl> + env : { <nl> + a : ' b ' <nl> + } <nl> } ) <nl> <nl> - it ( ' $ getConfig ' , ( ) = > { <nl> - global . WXEnvironment = { <nl> + const configSpy = sinon . spy ( ) <nl> + vm . $ getConfig ( configSpy ) <nl> + expect ( console . warn . callCount ) . to . be . equal ( 1 ) <nl> + expect ( configSpy . args . length ) . eql ( 1 ) <nl> + expect ( configSpy . args [ 0 ] [ 0 ] ) . eql ( { <nl> + debug : true , <nl> + bundleUrl : ' path_to_bundleUrl ' , <nl> + env : { <nl> a : ' b ' <nl> } <nl> - const config = vm . $ getConfig ( ) <nl> - expect ( config ) . eql ( { <nl> - debug : true , <nl> - bundleUrl : ' path_to_bundleUrl ' , <nl> - env : { <nl> - a : ' b ' <nl> - } <nl> - } ) <nl> - <nl> - const configSpy = sinon . spy ( ) <nl> - vm . $ getConfig ( configSpy ) <nl> - expect ( console . warn . callCount ) . to . be . equal ( 1 ) <nl> - expect ( configSpy . args . length ) . eql ( 1 ) <nl> - expect ( configSpy . args [ 0 ] [ 0 ] ) . eql ( { <nl> - debug : true , <nl> - bundleUrl : ' path_to_bundleUrl ' , <nl> - env : { <nl> - a : ' b ' <nl> - } <nl> - } ) <nl> } ) <nl> + } ) <nl> <nl> - it ( ' $ sendHttp ' , ( ) = > { <nl> - const callback = sinon . spy ( ) <nl> - vm . $ sendHttp ( { a : 1 } , callback ) <nl> - expect ( requireSpy . firstCall . args [ 0 ] ) . eql ( ' stream ' ) <nl> - expect ( moduleSpy . firstCall . args . length ) . eql ( 2 ) <nl> - expect ( moduleSpy . firstCall . args ) . eql ( [ { a : 1 } , callback ] ) <nl> - expect ( callback . callCount ) . eql ( 1 ) <nl> - } ) <nl> + it ( ' $ sendHttp ' , ( ) = > { <nl> + const callback = sinon . spy ( ) <nl> + vm . $ sendHttp ( { a : 1 } , callback ) <nl> + expect ( requireSpy . firstCall . args [ 0 ] ) . eql ( ' stream ' ) <nl> + expect ( moduleSpy . firstCall . args . length ) . eql ( 2 ) <nl> + expect ( moduleSpy . firstCall . args ) . eql ( [ { a : 1 } , callback ] ) <nl> + expect ( callback . callCount ) . eql ( 1 ) <nl> + } ) <nl> <nl> - it ( ' $ openURL ' , ( ) = > { <nl> - vm . $ openURL ( ' url ' ) <nl> - expect ( requireSpy . firstCall . args [ 0 ] ) . eql ( ' event ' ) <nl> - expect ( moduleSpy . firstCall . args . length ) . eql ( 1 ) <nl> - expect ( moduleSpy . firstCall . args ) . eql ( [ ' url ' ] ) <nl> - } ) <nl> + it ( ' $ openURL ' , ( ) = > { <nl> + vm . $ openURL ( ' url ' ) <nl> + expect ( requireSpy . firstCall . args [ 0 ] ) . eql ( ' event ' ) <nl> + expect ( moduleSpy . firstCall . args . length ) . eql ( 1 ) <nl> + expect ( moduleSpy . firstCall . args ) . eql ( [ ' url ' ] ) <nl> + } ) <nl> <nl> - it ( ' $ setTitle ' , ( ) = > { <nl> - vm . $ setTitle ( ' title ' ) <nl> - expect ( requireSpy . firstCall . args [ 0 ] ) . eql ( ' pageInfo ' ) <nl> - expect ( moduleSpy . firstCall . args . length ) . eql ( 1 ) <nl> - expect ( moduleSpy . firstCall . args ) . eql ( [ ' title ' ] ) <nl> - } ) <nl> + it ( ' $ setTitle ' , ( ) = > { <nl> + vm . $ setTitle ( ' title ' ) <nl> + expect ( requireSpy . firstCall . args [ 0 ] ) . eql ( ' pageInfo ' ) <nl> + expect ( moduleSpy . firstCall . args . length ) . eql ( 1 ) <nl> + expect ( moduleSpy . firstCall . args ) . eql ( [ ' title ' ] ) <nl> + } ) <nl> <nl> - it ( ' $ call ' , ( ) = > { <nl> - vm . $ call ( ' event ' , ' openURL ' , ' url ' ) <nl> - expect ( requireSpy . firstCall . args [ 0 ] ) . eql ( ' event ' ) <nl> - expect ( moduleSpy . firstCall . args . length ) . eql ( 1 ) <nl> - expect ( moduleSpy . firstCall . args [ 0 ] ) . eql ( ' url ' ) <nl> - } ) <nl> + it ( ' $ call ' , ( ) = > { <nl> + vm . $ call ( ' event ' , ' openURL ' , ' url ' ) <nl> + expect ( requireSpy . firstCall . args [ 0 ] ) . eql ( ' event ' ) <nl> + expect ( moduleSpy . firstCall . args . length ) . eql ( 1 ) <nl> + expect ( moduleSpy . firstCall . args [ 0 ] ) . eql ( ' url ' ) <nl> } ) <nl> } ) <nl> mmm a / html5 / test / unit / default / api / modules . js <nl> ppp b / html5 / test / unit / default / api / modules . js <nl> import chai from ' chai ' <nl> const { expect } = chai <nl> <nl> import * as modules from ' . . / . . / . . / . . / default / api / modules ' <nl> - import { registerModules , requireModule , clearModules } from ' . . / . . / . . / . . / default / app / register ' <nl> + import { initModules , requireModule , clearModules } from ' . . / . . / . . / . . / default / app / register ' <nl> <nl> describe ( ' built - in modules ' , ( ) = > { <nl> before ( ( ) = > { <nl> describe ( ' built - in modules ' , ( ) = > { <nl> } ) <nl> <nl> it ( ' have keys ' , ( ) = > { <nl> - registerModules ( modules ) <nl> - <nl> - expect ( requireModule ( ' dom ' ) ) . to . have . all . keys ( ' scrollToElement ' ) <nl> - expect ( requireModule ( ' stream ' ) ) . to . have . all . keys ( ' sendHttp ' ) <nl> - expect ( requireModule ( ' event ' ) ) . to . have . all . keys ( ' openURL ' ) <nl> - expect ( requireModule ( ' pageInfo ' ) ) . to . have . all . keys ( ' setTitle ' ) <nl> - expect ( requireModule ( ' animation ' ) ) . to . have . all . keys ( ' transition ' ) <nl> + const app = { } <nl> + initModules ( modules ) <nl> + expect ( requireModule ( app , ' dom ' ) ) . to . have . all . keys ( ' scrollToElement ' ) <nl> + expect ( requireModule ( app , ' stream ' ) ) . to . have . all . keys ( ' sendHttp ' ) <nl> + expect ( requireModule ( app , ' event ' ) ) . to . have . all . keys ( ' openURL ' ) <nl> + expect ( requireModule ( app , ' pageInfo ' ) ) . to . have . all . keys ( ' setTitle ' ) <nl> + expect ( requireModule ( app , ' animation ' ) ) . to . have . all . keys ( ' transition ' ) <nl> } ) <nl> } ) <nl> mmm a / html5 / test / unit / default / app / bundle . js <nl> ppp b / html5 / test / unit / default / app / bundle . js <nl> import * as bundle from ' . . / . . / . . / . . / default / app / bundle ' <nl> import * as register from ' . . / . . / . . / . . / default / app / register ' <nl> import { Document } <nl> from ' . . / . . / . . / . . / vdom ' <nl> - import Vm from ' . . / . . / . . / . . / default / vm ' <nl> <nl> describe ( ' parsing a bundle file ' , ( ) = > { <nl> const componentTemplate = { <nl> describe ( ' parsing a bundle file ' , ( ) = > { <nl> callTasks : ( tasks , callback ) = > { <nl> callTasksSpy ( tasks ) <nl> callback & & callback ( ) <nl> + } , <nl> + requireModule : function ( name ) { <nl> + return register . requireModule ( this , name ) <nl> } <nl> } <nl> - <nl> - Object . assign ( app , bundle ) <nl> - } ) <nl> - <nl> - beforeEach ( ( ) = > { <nl> - app . registerComponent = sinon . spy ( register , ' registerComponent ' ) <nl> - app . requireComponent = sinon . spy ( register , ' requireComponent ' ) <nl> - app . requireModule = sinon . spy ( register , ' requireModule ' ) <nl> - Vm . registerModules = sinon . spy ( register , ' registerModules ' ) <nl> } ) <nl> <nl> afterEach ( ( ) = > { <nl> callTasksSpy . reset ( ) <nl> - register . registerComponent . restore ( ) <nl> - register . requireComponent . restore ( ) <nl> - register . requireModule . restore ( ) <nl> - register . registerModules . restore ( ) <nl> } ) <nl> <nl> describe ( ' define ' , ( ) = > { <nl> it ( ' a weex component ' , ( ) = > { <nl> - app . define ( ' @ weex - component / a ' , ( require , exports , module ) = > { <nl> + bundle . define ( app , ' @ weex - component / a ' , ( require , exports , module ) = > { <nl> module . exports = { <nl> template : componentTemplate <nl> } <nl> } ) <nl> <nl> - expect ( app . registerComponent . calledOnce ) . to . be . true <nl> - expect ( app . registerComponent . firstCall . args [ 0 ] ) . to . be . equal ( ' a ' ) <nl> - expect ( app . registerComponent . firstCall . args [ 1 ] ) . to . deep . equal ( { <nl> - template : componentTemplate <nl> - } ) <nl> - expect ( app . customComponentMap [ ' a ' ] . template ) <nl> - . to . deep . equal ( componentTemplate ) <nl> + expect ( app . customComponentMap [ ' a ' ] . template ) . to . deep . equal ( componentTemplate ) <nl> } ) <nl> <nl> it ( ' a weex module ' , ( ) = > { <nl> describe ( ' parsing a bundle file ' , ( ) = > { <nl> args : [ ] <nl> } ] <nl> <nl> - app . define ( ' @ weex - module / dom ' , ( require , exports , module ) = > { <nl> + bundle . define ( app , ' @ weex - module / dom ' , ( require , exports , module ) = > { <nl> module . exports = methods <nl> } ) <nl> - <nl> - expect ( Vm . registerModules . calledOnce ) . to . be . true <nl> - expect ( Vm . registerModules . firstCall . args [ 0 ] . dom ) <nl> - . to . deep . equal ( methods ) <nl> + / / todo <nl> } ) <nl> <nl> it ( ' a normal module ' , ( ) = > { <nl> - app . define ( ' . / a ' , ( require , exports , module ) = > { <nl> + bundle . define ( app , ' . / a ' , ( require , exports , module ) = > { <nl> exports . version = ' 0 . 1 ' <nl> } ) <nl> } ) <nl> <nl> it ( ' a npm module ' , ( ) = > { <nl> - app . define ( ' lib - httpurl ' , ( require , exports , module ) = > { <nl> + bundle . define ( app , ' lib - httpurl ' , ( require , exports , module ) = > { <nl> exports . version = ' 0 . 2 ' <nl> } ) <nl> } ) <nl> <nl> it ( ' a CMD module ' , ( ) = > { <nl> - app . define ( ' kg / base ' , [ ] , ( require , exports , module ) = > { <nl> + bundle . define ( app , ' kg / base ' , [ ] , ( require , exports , module ) = > { <nl> exports . version = ' 0 . 3 ' <nl> } ) <nl> } ) <nl> describe ( ' parsing a bundle file ' , ( ) = > { <nl> <nl> describe ( ' require ' , ( ) = > { <nl> it ( ' a weex component ' , ( done ) = > { <nl> - app . define ( ' @ weex - component / b ' , ( require , exports , module ) = > { <nl> + bundle . define ( app , ' @ weex - component / b ' , ( require , exports , module ) = > { <nl> const componentA = require ( ' @ weex - component / a ' ) <nl> <nl> - expect ( app . requireComponent . calledOnce ) . to . be . true <nl> - expect ( app . requireComponent . firstCall . args [ 0 ] ) . to . be . equal ( ' a ' ) <nl> expect ( componentA . template ) . to . be . equal ( componentTemplate ) <nl> done ( ) <nl> } ) <nl> } ) <nl> <nl> it ( ' a weex module ' , ( done ) = > { <nl> - app . define ( ' @ weex - component / c ' , ( require , exports , module ) = > { <nl> + bundle . define ( app , ' @ weex - component / c ' , ( require , exports , module ) = > { <nl> const dom = require ( ' @ weex - module / dom ' ) <nl> <nl> - expect ( app . requireModule . calledOnce ) . to . be . true <nl> - expect ( app . requireModule . firstCall . args [ 0 ] ) . to . be . equal ( ' dom ' ) <nl> expect ( dom . createBody ) . to . be . a ( ' function ' ) <nl> done ( ) <nl> } ) <nl> } ) <nl> <nl> it ( ' a normal module ' , ( done ) = > { <nl> - app . define ( ' @ weex - component / d ' , ( require , exports , module ) = > { <nl> + bundle . define ( app , ' @ weex - component / d ' , ( require , exports , module ) = > { <nl> const a = require ( ' . / a ' ) <nl> <nl> expect ( a . version ) . to . be . equal ( ' 0 . 1 ' ) <nl> describe ( ' parsing a bundle file ' , ( ) = > { <nl> } ) <nl> <nl> it ( ' a npm module ' , ( done ) = > { <nl> - app . define ( ' @ weex - component / e ' , ( require , exports , module ) = > { <nl> + bundle . define ( app , ' @ weex - component / e ' , ( require , exports , module ) = > { <nl> const HttpUrl = require ( ' lib - httpurl ' ) <nl> <nl> expect ( HttpUrl . version ) . to . be . equal ( ' 0 . 2 ' ) <nl> describe ( ' parsing a bundle file ' , ( ) = > { <nl> } ) <nl> <nl> it ( ' a CMD module ' , ( done ) = > { <nl> - app . define ( ' kg / sample ' , [ ' kg / base ' ] , ( require , exports , module ) = > { <nl> + bundle . define ( app , ' kg / sample ' , [ ' kg / base ' ] , ( require , exports , module ) = > { <nl> const base = require ( ' kg / base ' ) <nl> <nl> expect ( base . version ) . to . be . equal ( ' 0 . 3 ' ) <nl> describe ( ' parsing a bundle file ' , ( ) = > { <nl> <nl> before ( ( ) = > { <nl> global . transformerVersion = ' > = 0 . 1 < 1 . 0 ' <nl> - app . define ( ' @ weex - component / main ' , ( require , exports , module ) = > { <nl> + bundle . define ( app , ' @ weex - component / main ' , ( require , exports , module ) = > { <nl> module . exports = { <nl> template : componentTemplate , <nl> ready : ready <nl> describe ( ' parsing a bundle file ' , ( ) = > { <nl> callTasks : ( tasks , callback ) = > { <nl> callTasksSpy ( tasks ) <nl> callback & & callback ( ) <nl> + } , <nl> + requireModule : function ( name ) { <nl> + return register . requireModule ( this , name ) <nl> } <nl> } <nl> <nl> Object . assign ( app , bundle ) <nl> } ) <nl> <nl> - beforeEach ( ( ) = > { <nl> - app . registerComponent = sinon . spy ( register , ' registerComponent ' ) <nl> - app . requireComponent = sinon . spy ( register , ' requireComponent ' ) <nl> - app . requireModule = sinon . spy ( register , ' requireModule ' ) <nl> - Vm . registerModules = sinon . spy ( register , ' registerModules ' ) <nl> - } ) <nl> - <nl> afterEach ( ( ) = > { <nl> callTasksSpy . reset ( ) <nl> - register . registerComponent . restore ( ) <nl> - register . requireComponent . restore ( ) <nl> - register . requireModule . restore ( ) <nl> - register . registerModules . restore ( ) <nl> } ) <nl> <nl> describe ( ' register ' , ( ) = > { <nl> describe ( ' parsing a bundle file ' , ( ) = > { <nl> } <nl> <nl> it ( ' a component ' , ( ) = > { <nl> - app . register ( ' custom ' , { <nl> + bundle . register ( app , ' custom ' , { <nl> template : componentTemplate , <nl> data : { <nl> b : ' c ' <nl> describe ( ' parsing a bundle file ' , ( ) = > { <nl> } <nl> } ) <nl> <nl> - app . register ( ' main ' , { <nl> + bundle . register ( app , ' main ' , { <nl> template : template , <nl> data : { <nl> a : ' b ' <nl> describe ( ' parsing a bundle file ' , ( ) = > { <nl> } <nl> } ) <nl> <nl> - expect ( app . registerComponent . calledTwice ) . to . be . true <nl> - <nl> - expect ( app . registerComponent . firstCall . args [ 0 ] ) <nl> - . to . be . equal ( ' custom ' ) <nl> - expect ( app . registerComponent . firstCall . args [ 1 ] ) . to . deep . equal ( { <nl> - template : componentTemplate , <nl> - data : { <nl> - b : ' c ' <nl> - } , <nl> - methods : { <nl> - ready : readyfn <nl> - } <nl> - } ) <nl> expect ( app . customComponentMap [ ' custom ' ] . template ) <nl> . to . deep . equal ( componentTemplate ) <nl> - <nl> - expect ( app . registerComponent . secondCall . args [ 0 ] ) <nl> - . to . be . equal ( ' main ' ) <nl> - expect ( app . registerComponent . secondCall . args [ 1 ] ) . to . deep . equal ( { <nl> - template : template , <nl> - data : { <nl> - a : ' b ' <nl> - } , <nl> - methods : { <nl> - ready : readyfn <nl> - } <nl> - } ) <nl> expect ( app . customComponentMap [ ' main ' ] . template ) <nl> . to . deep . equal ( template ) <nl> } ) <nl> describe ( ' parsing a bundle file ' , ( ) = > { <nl> callTasks : ( tasks , callback ) = > { <nl> callTasksSpy ( tasks ) <nl> callback & & callback ( ) <nl> + } , <nl> + requireModule : function ( name ) { <nl> + return register . requireModule ( this , name ) <nl> } <nl> } <nl> - <nl> - Object . assign ( app , bundle ) <nl> - } ) <nl> - <nl> - beforeEach ( ( ) = > { <nl> - app . registerComponent = sinon . spy ( register , ' registerComponent ' ) <nl> - app . requireComponent = sinon . spy ( register , ' requireComponent ' ) <nl> - app . requireModule = sinon . spy ( register , ' requireModule ' ) <nl> - Vm . registerModules = sinon . spy ( register , ' registerModules ' ) <nl> } ) <nl> <nl> afterEach ( ( ) = > { <nl> callTasksSpy . reset ( ) <nl> - register . registerComponent . restore ( ) <nl> - register . requireComponent . restore ( ) <nl> - register . requireModule . restore ( ) <nl> - register . registerModules . restore ( ) <nl> } ) <nl> <nl> describe ( ' define ( old ) ' , ( ) = > { <nl> it ( ' a component ' , ( ) = > { <nl> - app . define ( ' main ' , ( require , exports , module ) = > { <nl> + bundle . define ( app , ' main ' , ( require , exports , module ) = > { <nl> module . exports = { <nl> template : componentTemplate <nl> } <nl> } ) <nl> - <nl> - expect ( app . registerComponent . calledOnce ) . to . be . true <nl> - expect ( app . registerComponent . firstCall . args [ 0 ] ) <nl> - . to . be . equal ( ' main ' ) <nl> - expect ( app . registerComponent . firstCall . args [ 1 ] ) . to . deep . equal ( { <nl> - template : componentTemplate <nl> - } ) <nl> expect ( app . customComponentMap [ ' main ' ] . template ) <nl> . to . deep . equal ( componentTemplate ) <nl> } ) <nl> mmm a / html5 / test / unit / default / app / ctrl . js <nl> ppp b / html5 / test / unit / default / app / ctrl . js <nl> describe ( ' the api of app ' , ( ) = > { <nl> app . doc . createBody ( ' div ' ) <nl> / / app . bootstrap . returns ( ) <nl> <nl> - Object . assign ( app , ctrl ) <nl> - <nl> return app <nl> } <nl> <nl> describe ( ' the api of app ' , ( ) = > { <nl> <nl> it ( ' a simple bundle ' , ( ) = > { <nl> app . requireModule = ( ) = > { } <nl> - app . init ( ` <nl> + ctrl . init ( app , ` <nl> define ( ' main ' , function ( r , e , m ) { <nl> e . template = { <nl> " type " : " container " , <nl> describe ( ' the api of app ' , ( ) = > { <nl> / / expect ( app . define . calledOnce ) . to . be . true <nl> / / expect ( app . bootstrap . calledOnce ) . to . be . true <nl> <nl> - const task = spy1 . firstCall . args [ 0 ] [ 0 ] <nl> + const task = spy1 . lastCall . args [ 0 ] [ 0 ] <nl> expect ( task . module ) . to . be . equal ( ' dom ' ) <nl> expect ( task . method ) . to . be . equal ( ' createFinish ' ) <nl> expect ( task . args . length ) . to . be . equal ( 0 ) <nl> describe ( ' the api of app ' , ( ) = > { <nl> <nl> describe ( ' getRootElement ' , ( ) = > { <nl> it ( ' from a simple ' , ( ) = > { <nl> - const json = app . getRootElement ( ) <nl> - expect ( json ) . to . deep . equal ( { <nl> - ref : ' _root ' , <nl> - type : ' div ' , <nl> - attr : { } , <nl> - style : { } <nl> - } ) <nl> + const json = ctrl . getRootElement ( app ) <nl> + expect ( json . ref ) . eql ( ' _root ' ) <nl> + expect ( json . type ) . eql ( ' div ' ) <nl> + expect ( json . children . length ) . eql ( 1 ) <nl> } ) <nl> } ) <nl> <nl> describe ( ' fireEvent ' , ( ) = > { <nl> it ( ' click on root ' , ( ) = > { <nl> - app . fireEvent ( ' _root ' , ' click ' ) <nl> - const task = spy1 . firstCall . args [ 0 ] [ 0 ] <nl> + ctrl . fireEvent ( app , ' _root ' , ' click ' ) <nl> + const task = spy1 . lastCall . args [ 0 ] [ 0 ] <nl> expect ( task . module ) . to . be . equal ( ' dom ' ) <nl> expect ( task . method ) . to . be . equal ( ' updateFinish ' ) <nl> expect ( task . args . length ) . to . be . equal ( 0 ) <nl> } ) <nl> <nl> it ( ' error ' , ( ) = > { <nl> - const result = app . fireEvent ( ' _rootTest ' , ' click ' ) <nl> + const result = ctrl . fireEvent ( app , ' _rootTest ' , ' click ' ) <nl> expect ( result ) . to . be . an . instanceof ( Error ) <nl> } ) <nl> } ) <nl> describe ( ' the api of app ' , ( ) = > { <nl> describe ( ' callback ' , ( ) = > { <nl> it ( ' with a simple data ' , ( ) = > { <nl> const data = { a : ' b ' } <nl> - app . callback ( ' 1 ' , data , true ) <nl> + ctrl . callback ( app , ' 1 ' , data , true ) <nl> expect ( spy2 . calledOnce ) . to . be . true <nl> expect ( spy2 . args [ 0 ] [ 0 ] ) . to . deep . equal ( data ) <nl> expect ( app . callbacks [ 1 ] ) . to . be . a ( ' function ' ) <nl> describe ( ' the api of app ' , ( ) = > { <nl> <nl> it ( ' multiple called ' , ( ) = > { <nl> const data = { a : ' b ' } <nl> - app . callback ( ' 1 ' , data , true ) <nl> + ctrl . callback ( app , ' 1 ' , data , true ) <nl> expect ( spy2 . calledTwice ) . to . be . true <nl> expect ( spy2 . args [ 0 ] [ 0 ] ) . to . deep . equal ( data ) <nl> expect ( app . callbacks [ 1 ] ) . to . be . a ( ' function ' ) <nl> <nl> - app . callback ( ' 1 ' , data , false ) <nl> + ctrl . callback ( app , ' 1 ' , data , false ) <nl> expect ( spy2 . calledThrice ) . to . be . true <nl> expect ( spy2 . args [ 0 ] [ 0 ] ) . to . deep . equal ( data ) <nl> expect ( app . callbacks [ 1 ] ) . to . be . undefined <nl> describe ( ' the api of app ' , ( ) = > { <nl> <nl> it ( ' error ' , ( ) = > { <nl> const data = null <nl> - const result = app . callback ( ' 1 ' , data , true ) <nl> + const result = ctrl . callback ( app , ' 1 ' , data , true ) <nl> expect ( result ) . to . be . an . instanceof ( Error ) <nl> } ) <nl> } ) <nl> describe ( ' the api of app ' , ( ) = > { <nl> describe ( ' refreshData ' , ( ) = > { <nl> it ( ' a simple data ' , ( ) = > { <nl> const data = { b : ' c ' } <nl> - app . refreshData ( data ) <nl> - expect ( app . vm ) . to . deep . equal ( data ) <nl> + ctrl . refresh ( app , data ) <nl> + expect ( app . vm . b ) . to . deep . equal ( data . b ) <nl> <nl> - const task = spy1 . firstCall . args [ 0 ] [ 0 ] <nl> + const task = spy1 . lastCall . args [ 0 ] [ 0 ] <nl> expect ( task . module ) . to . be . equal ( ' dom ' ) <nl> expect ( task . method ) . to . be . equal ( ' refreshFinish ' ) <nl> expect ( task . args . length ) . to . be . equal ( 0 ) <nl> describe ( ' the api of app ' , ( ) = > { <nl> <nl> it ( ' error ' , ( ) = > { <nl> const data = null <nl> - const result = app . refreshData ( data ) <nl> + const result = ctrl . refresh ( app , data ) <nl> expect ( result ) . to . be . an . instanceof ( Error ) <nl> } ) <nl> } ) <nl> <nl> describe ( ' destory ' , ( ) = > { <nl> it ( ' the simple data ' , ( ) = > { <nl> - app . destroy ( ) <nl> + ctrl . destroy ( app ) <nl> expect ( app . id ) . to . be . empty <nl> expect ( app . blocks ) . to . be . null <nl> expect ( app . vm ) . to . be . null <nl> mmm a / html5 / test / unit / default / app / index . js <nl> ppp b / html5 / test / unit / default / app / index . js <nl> chai . use ( sinonChai ) <nl> <nl> global . callNative = function ( ) { } <nl> <nl> - import AppInstance from ' . . / . . / . . / . . / default / app ' <nl> - / / import * as bundle from ' . . / . . / . . / . . / default / app / bundle ' <nl> - import * as ctrl from ' . . / . . / . . / . . / default / app / ctrl ' <nl> + import App from ' . . / . . / . . / . . / default / app ' <nl> import { Element } from ' . . / . . / . . / . . / vdom ' <nl> - import { <nl> - registerComponent , <nl> - requireComponent , <nl> - requireModule <nl> - } from ' . . / . . / . . / . . / default / app / register ' <nl> <nl> describe ( ' App Instance ' , ( ) = > { <nl> const oriCallNative = global . callNative <nl> describe ( ' App Instance ' , ( ) = > { <nl> } ) <nl> <nl> beforeEach ( ( ) = > { <nl> - app = new AppInstance ( Date . now ( ) + ' ' ) <nl> + app = new App ( Date . now ( ) + ' ' ) <nl> } ) <nl> <nl> after ( ( ) = > { <nl> describe ( ' App Instance ' , ( ) = > { <nl> <nl> describe ( ' normal check ' , ( ) = > { <nl> it ( ' is a class ' , ( ) = > { <nl> - expect ( AppInstance ) . to . be . an ( ' function ' ) <nl> + expect ( App ) . to . be . an ( ' function ' ) <nl> } ) <nl> <nl> it ( ' being created ' , ( ) = > { <nl> expect ( app ) . to . be . an ( ' object ' ) <nl> - expect ( app ) . to . be . instanceof ( AppInstance ) <nl> + expect ( app ) . to . be . instanceof ( App ) <nl> } ) <nl> <nl> it ( ' with some apis ' , ( ) = > { <nl> - const proto = Object . getPrototypeOf ( app ) <nl> - / / expect ( proto ) . to . contain . all . keys ( bundle ) <nl> - expect ( proto ) . to . contain . all . keys ( ctrl ) <nl> - expect ( proto ) . to . contain . all . keys ( { <nl> - registerComponent , <nl> - requireComponent , <nl> - requireModule <nl> - } ) <nl> + expect ( app . requireModule ) . a . function <nl> + expect ( app . updateActions ) . a . function <nl> + expect ( app . callTasks ) . a . function <nl> } ) <nl> } ) <nl> <nl> describe ( ' App Instance ' , ( ) = > { <nl> } ) <nl> } ) <nl> } ) <nl> - <nl> mmm a / html5 / test / unit / default / app / register . js <nl> ppp b / html5 / test / unit / default / app / register . js <nl> const { expect } = chai <nl> chai . use ( sinonChai ) <nl> <nl> import { <nl> - registerComponent , <nl> - requireComponent , <nl> - registerModules , <nl> - requireModule , <nl> getModule , <nl> clearModules , <nl> - registerMethods <nl> + initModules , <nl> + initMethods , <nl> + requireModule , <nl> + requireCustomComponent , <nl> + registerCustomComponent <nl> } from ' . . / . . / . . / . . / default / app / register ' <nl> <nl> function Ctx ( ) { <nl> describe ( ' register ' , ( ) = > { <nl> <nl> before ( ( ) = > { <nl> clearModules ( ) <nl> - <nl> - Ctx . prototype . requireModule = requireModule <nl> - Ctx . prototype . registerComponent = registerComponent <nl> - Ctx . prototype . requireComponent = requireComponent <nl> - Ctx . registerModules = registerModules <nl> - Ctx . registerMethods = registerMethods <nl> - <nl> ctx = new Ctx ( ) <nl> } ) <nl> <nl> describe ( ' register ' , ( ) = > { <nl> const def = { <nl> a : ' b ' <nl> } <nl> - <nl> - ctx . registerComponent ( ' componentA ' , def ) <nl> - expect ( ctx . requireComponent ( ' componentA ' ) ) . to . deep . equal ( def ) <nl> + registerCustomComponent ( ctx , ' componentA ' , def ) <nl> + expect ( requireCustomComponent ( ctx , ' componentA ' ) ) . to . deep . equal ( def ) <nl> } ) <nl> <nl> it ( ' with a existing name ' , ( ) = > { <nl> describe ( ' register ' , ( ) = > { <nl> a : ' b ' <nl> } <nl> sinon . stub ( console , ' error ' ) <nl> - ctx . registerComponent ( ' componentA ' , def ) <nl> + registerCustomComponent ( ctx , ' componentA ' , def ) <nl> expect ( console . error ) . callCount ( 1 ) <nl> console . error . restore ( ) <nl> } ) <nl> describe ( ' register ' , ( ) = > { <nl> <nl> describe ( ' module ' , ( ) = > { <nl> it ( ' with a old format ' , ( ) = > { <nl> - Ctx . registerModules ( { <nl> + initModules ( { <nl> dom : [ <nl> ' createBody ' , <nl> ' addElement ' <nl> ] <nl> } ) <nl> - <nl> - expect ( ctx . requireModule ( ' dom ' ) ) <nl> - . to . have . any . keys ( ' createBody ' , ' addElement ' ) <nl> + expect ( requireModule ( ctx , ' dom ' ) ) . to . have . any . keys ( ' createBody ' , ' addElement ' ) <nl> } ) <nl> <nl> it ( ' with a new format ' , ( ) = > { <nl> - Ctx . registerModules ( { <nl> + initModules ( { <nl> dom : [ <nl> { <nl> name : ' moveElement ' , <nl> describe ( ' register ' , ( ) = > { <nl> } <nl> ] <nl> } ) <nl> - <nl> - expect ( ctx . requireModule ( ' dom ' ) ) <nl> - . to . have . all . keys ( ' createBody ' , ' addElement ' , ' moveElement ' ) <nl> - expect ( ctx . requireModule ( ' stream ' ) ) . to . have . all . keys ( ' sendMtop ' ) <nl> + expect ( requireModule ( ctx , ' dom ' ) ) . to . have . all . keys ( ' createBody ' , ' addElement ' , ' moveElement ' ) <nl> + expect ( requireModule ( ctx , ' stream ' ) ) . to . have . all . keys ( ' sendMtop ' ) <nl> } ) <nl> <nl> it ( ' with a existed module . method ' , ( ) = > { <nl> - Ctx . registerModules ( { <nl> + initModules ( { <nl> dom : [ <nl> { <nl> name : ' moveElement ' , <nl> describe ( ' register ' , ( ) = > { <nl> } <nl> ] <nl> } , true ) <nl> - <nl> - Ctx . registerModules ( { <nl> + initModules ( { <nl> stream : [ <nl> { <nl> name : ' sendMtop ' , <nl> describe ( ' register ' , ( ) = > { <nl> } <nl> ] <nl> } ) <nl> - <nl> expect ( getModule ( ' dom ' ) . moveElement ) . to . deep . equal ( { <nl> name : ' moveElement ' , <nl> args : [ ' string ' , ' string ' , ' string ' ] <nl> describe ( ' register ' , ( ) = > { <nl> <nl> describe ( ' api ' , ( ) = > { <nl> it ( ' a common api ' , ( ) = > { <nl> - Ctx . registerMethods ( { <nl> + initMethods ( Ctx , { <nl> $ test1 : function ( ) { <nl> return { <nl> ctx : this , <nl> mmm a / html5 / test / unit / default / runtime . js <nl> ppp b / html5 / test / unit / default / runtime . js <nl> import framework from ' . . / . . / . . / runtime ' <nl> import frameworks from ' . . / . . / . . / runtime / config ' <nl> import config from ' . . / . . / . . / default / config ' <nl> import Vm from ' . . / . . / . . / default / vm ' <nl> + import { clearModules , getModule } from ' . . / . . / . . / default / app / register ' <nl> <nl> function clearRefs ( json ) { <nl> delete json . ref <nl> describe ( ' framework entry ' , ( ) = > { <nl> const instanceId = Date . now ( ) + ' ' <nl> <nl> before ( ( ) = > { <nl> - sinon . stub ( Vm , ' registerModules ' ) <nl> - sinon . stub ( Vm , ' registerMethods ' ) <nl> - <nl> global . callNative = ( id , tasks , callbackId ) = > { <nl> callNativeSpy ( id , tasks , callbackId ) <nl> / * istanbul ignore if * / <nl> describe ( ' framework entry ' , ( ) = > { <nl> } ) <nl> <nl> afterEach ( ( ) = > { <nl> - Vm . registerModules . reset ( ) <nl> - Vm . registerMethods . reset ( ) <nl> callNativeSpy . reset ( ) <nl> } ) <nl> <nl> after ( ( ) = > { <nl> - Vm . registerModules . restore ( ) <nl> - Vm . registerMethods . restore ( ) <nl> global . callNative = oriCallNative <nl> } ) <nl> <nl> describe ( ' framework entry ' , ( ) = > { <nl> <nl> describe ( ' register modules ' , ( ) = > { <nl> it ( ' with object of modules ' , ( ) = > { <nl> + clearModules ( ) <nl> const modules = { <nl> a : [ { <nl> name : ' b ' , <nl> describe ( ' framework entry ' , ( ) = > { <nl> } <nl> <nl> framework . registerModules ( modules ) <nl> - expect ( Vm . registerModules . firstCall . args [ 0 ] ) . to . be . deep . equal ( modules ) <nl> - } ) <nl> - <nl> - it ( ' with non - object ' , ( ) = > { <nl> - framework . registerModules ( 1 ) <nl> - expect ( Vm . registerModules . callCount ) . to . be . equal ( 0 ) <nl> + expect ( getModule ( ' b ' ) ) . an . object <nl> + clearModules ( ) <nl> } ) <nl> } ) <nl> <nl> describe ( ' framework entry ' , ( ) = > { <nl> } <nl> <nl> framework . registerMethods ( methods ) <nl> - expect ( Vm . registerMethods . firstCall . args [ 0 ] ) . to . be . deep . equal ( methods ) <nl> - } ) <nl> - <nl> - it ( ' with non - object ' , ( ) = > { <nl> - framework . registerMethods ( 1 ) <nl> - expect ( Vm . registerMethods . callCount ) . to . be . equal ( 0 ) <nl> + expect ( Vm . prototype . a ) . a . function <nl> + delete Vm . prototype . a <nl> } ) <nl> } ) <nl> } ) <nl>
|
* [ jsfm ] rebuild default app code
|
apache/incubator-weex
|
ac12fd85cdeba10a81354158b7dcdfc72f23d2a0
|
2016-07-21T19:50:36Z
|
mmm a / utils / resolve - crashes . py <nl> ppp b / utils / resolve - crashes . py <nl> def execute_cmd ( cmd ) : <nl> # The regular expression we use to match compiler - crasher lines . <nl> regex = re . compile ( <nl> ' . * Swift ( . * ) : : ' <nl> - ' ( compiler_crashers | compiler_crashers_2 | IDE / crashers ) / ( . * \ . swift ) . * ' ) <nl> + ' ( compiler_crashers | compiler_crashers_2 | IDE / crashers | SIL / crashers ) / ( . * \ . swift | . * \ . sil ) . * ' ) <nl> <nl> # Take the output of lit as standard input . <nl> for line in sys . stdin : <nl>
|
Teach resolve - crashers . py to resolve SIL crashers
|
apple/swift
|
1b11d9d4c3d5f1986146b481d64880310cb7ea24
|
2016-08-28T20:51:39Z
|
mmm a / . travis . yml <nl> ppp b / . travis . yml <nl> cache : <nl> <nl> addons : <nl> apt : <nl> - sources : [ ' ubuntu - toolchain - r - test ' , ' llvm - toolchain - precise - 3 . 6 ' ] <nl> - packages : [ ' clang - 3 . 6 ' , ' g + + - 6 ' , ' zlib1g - dev ' , ' libbz2 - dev ' , ' libsnappy - dev ' , ' curl ' , ' libgflags - dev ' , ' mingw - w64 ' ] <nl> + sources : [ ' ubuntu - toolchain - r - test ' , ' llvm - toolchain - trusty - 4 . 0 ' ] <nl> + packages : [ ' clang - 4 . 0 ' , ' g + + - 6 ' , ' zlib1g - dev ' , ' libbz2 - dev ' , ' libsnappy - dev ' , ' curl ' , ' libgflags - dev ' , ' mingw - w64 ' ] <nl> env : <nl> - TEST_GROUP = platform_dependent1 <nl> - TEST_GROUP = platform_dependent2 <nl> matrix : <nl> compiler : clang <nl> <nl> before_script : <nl> - - if [ [ " $ { TRAVIS_OS_NAME } " = = ' linux ' & & " $ { CXX } " = = ' clang + + ' ] ] ; then CXX = clang + + - 3 . 6 ; fi <nl> + - if [ [ " $ { TRAVIS_OS_NAME } " = = ' linux ' & & " $ { CXX } " = = ' clang + + ' ] ] ; then CXX = clang + + - 4 . 0 ; fi <nl> # test one linux g + + build with g + + - 6 <nl> - if [ [ " $ { TRAVIS_OS_NAME } " = = ' linux ' & & " $ { CXX } " = = ' g + + ' & & " $ { JOB_NAME } " = = ' unittests ' ] ] ; then CXX = g + + - 6 ; fi <nl> # Limit the maximum number of open file descriptors to 8192 <nl>
|
travis : clang - 3 . 6 - > clang - 4 . 0
|
facebook/rocksdb
|
f41bffb3ddebad7bfb7eb903252ac93a936ab5e5
|
2017-05-24T22:42:24Z
|
mmm a / modules / dnn / include / opencv2 / dnn / dnn . hpp <nl> ppp b / modules / dnn / include / opencv2 / dnn / dnn . hpp <nl> <nl> # include < opencv2 / core . hpp > <nl> <nl> # if ! defined CV_DOXYGEN & & ! defined CV_DNN_DONT_ADD_EXPERIMENTAL_NS <nl> - # define CV__DNN_EXPERIMENTAL_NS_BEGIN namespace experimental_dnn_v4 { <nl> + # define CV__DNN_EXPERIMENTAL_NS_BEGIN namespace experimental_dnn_v5 { <nl> # define CV__DNN_EXPERIMENTAL_NS_END } <nl> - namespace cv { namespace dnn { namespace experimental_dnn_v4 { } using namespace experimental_dnn_v4 ; } } <nl> + namespace cv { namespace dnn { namespace experimental_dnn_v5 { } using namespace experimental_dnn_v5 ; } } <nl> # else <nl> # define CV__DNN_EXPERIMENTAL_NS_BEGIN <nl> # define CV__DNN_EXPERIMENTAL_NS_END <nl>
|
experimental version + +
|
opencv/opencv
|
ab11b17d4bd8bd263faf3dc6bba61387b76c4a1d
|
2018-06-10T07:20:38Z
|
mmm a / include / swift / AST / Decl . h <nl> ppp b / include / swift / AST / Decl . h <nl> struct SelfReferenceKind { <nl> class ProtocolDecl : public NominalTypeDecl { <nl> SourceLoc ProtocolLoc ; <nl> <nl> - ArrayRef < ProtocolDecl * > InheritedProtocols ; <nl> - <nl> llvm : : DenseMap < ValueDecl * , Witness > DefaultWitnesses ; <nl> <nl> / / / The generic signature representing exactly the new requirements introduced <nl> class ProtocolDecl : public NominalTypeDecl { <nl> / / / because they could not be imported from Objective - C ) . <nl> unsigned HasMissingRequirements : 1 ; <nl> <nl> - / / / Whether we have already set the list of inherited protocols . <nl> - unsigned InheritedProtocolsSet : 1 ; <nl> - <nl> / / / If this is a compiler - known protocol , this will be a KnownProtocolKind <nl> / / / value , plus one . Otherwise , it will be 0 . <nl> unsigned KnownProtocol : 6 ; <nl> class ProtocolDecl : public NominalTypeDecl { <nl> using Decl : : getASTContext ; <nl> <nl> / / / Retrieve the set of protocols inherited from this protocol . <nl> - ArrayRef < ProtocolDecl * > getInheritedProtocols ( LazyResolver * resolver ) const ; <nl> + llvm : : TinyPtrVector < ProtocolDecl * > getInheritedProtocols ( ) const ; <nl> <nl> / / / \ brief Determine whether this protocol inherits from the given ( " super " ) <nl> / / / protocol . <nl> class ProtocolDecl : public NominalTypeDecl { <nl> / / / Record the default witness for a requirement . <nl> void setDefaultWitness ( ValueDecl * requirement , Witness witness ) ; <nl> <nl> - / / / Set the list of inherited protocols . <nl> - void setInheritedProtocols ( ArrayRef < ProtocolDecl * > protocols ) { <nl> - assert ( ! InheritedProtocolsSet & & " protocols already set " ) ; <nl> - InheritedProtocolsSet = true ; <nl> - InheritedProtocols = protocols ; <nl> - } <nl> - <nl> - void clearInheritedProtocols ( ) { <nl> - InheritedProtocolsSet = true ; <nl> - InheritedProtocols = { } ; <nl> - } <nl> - <nl> - bool isInheritedProtocolsValid ( ) const { <nl> - return InheritedProtocolsSet ; <nl> - } <nl> - <nl> / / / Retrieve the name to use for this protocol when interoperating <nl> / / / with the Objective - C runtime . <nl> StringRef getObjCRuntimeName ( llvm : : SmallVectorImpl < char > & buffer ) const ; <nl> mmm a / include / swift / SIL / SILWitnessVisitor . h <nl> ppp b / include / swift / SIL / SILWitnessVisitor . h <nl> template < class T > class SILWitnessVisitor : public ASTVisitor < T > { <nl> / / It would be abstractly good to allow conversion to a base <nl> / / protocol to be trivial , but it ' s not clear that there ' s <nl> / / really a structural guarantee we can rely on here . <nl> - for ( auto baseProto : protocol - > getInheritedProtocols ( nullptr ) ) { <nl> + for ( auto baseProto : protocol - > getInheritedProtocols ( ) ) { <nl> / / ObjC protocols do not have witnesses . <nl> if ( ! Lowering : : TypeConverter : : protocolRequiresWitnessTable ( baseProto ) ) <nl> continue ; <nl> mmm a / include / swift / Serialization / ModuleFormat . h <nl> ppp b / include / swift / Serialization / ModuleFormat . h <nl> const uint16_t VERSION_MAJOR = 0 ; <nl> / / / in source control , you should also update the comment to briefly <nl> / / / describe what change you made . The content of this comment isn ' t important ; <nl> / / / it just ensures a conflict if two people change the module format . <nl> - const uint16_t VERSION_MINOR = 319 ; / / Last change : generic subscripts <nl> + const uint16_t VERSION_MINOR = 320 ; / / Last change : inherited protocols <nl> <nl> using DeclID = PointerEmbeddedInt < unsigned , 31 > ; <nl> using DeclIDField = BCFixed < 31 > ; <nl> namespace decls_block { <nl> BCFixed < 1 > , / / objc ? <nl> GenericEnvironmentIDField , / / generic environment <nl> AccessibilityKindField , / / accessibility <nl> - BCVBR < 4 > , / / number of protocols <nl> - BCArray < DeclIDField > / / protocols and inherited types <nl> + BCArray < DeclIDField > / / inherited types <nl> / / Trailed by the generic parameters ( if any ) , the members record , and <nl> / / the default witness table record <nl> > ; <nl> mmm a / lib / AST / Decl . cpp <nl> ppp b / lib / AST / Decl . cpp <nl> ProtocolDecl : : ProtocolDecl ( DeclContext * DC , SourceLoc ProtocolLoc , <nl> ProtocolDeclBits . Circularity <nl> = static_cast < unsigned > ( CircularityCheck : : Unchecked ) ; <nl> HasMissingRequirements = false ; <nl> - InheritedProtocolsSet = false ; <nl> } <nl> <nl> - ArrayRef < ProtocolDecl * > <nl> - ProtocolDecl : : getInheritedProtocols ( LazyResolver * resolver ) const { <nl> - return InheritedProtocols ; <nl> + llvm : : TinyPtrVector < ProtocolDecl * > <nl> + ProtocolDecl : : getInheritedProtocols ( ) const { <nl> + llvm : : TinyPtrVector < ProtocolDecl * > result ; <nl> + <nl> + / / FIXME : Gather inherited protocols from the " inherited " list . <nl> + / / We shouldn ' t need this , but it shows up in recursive invocations . <nl> + if ( ! isRequirementSignatureComputed ( ) ) { <nl> + for ( auto inherited : getInherited ( ) ) { <nl> + SmallPtrSet < ProtocolDecl * , 4 > known ; <nl> + if ( auto type = inherited . getType ( ) ) { <nl> + SmallVector < ProtocolDecl * , 4 > protocols ; <nl> + if ( type - > isExistentialType ( protocols ) ) { <nl> + for ( auto proto : protocols ) { <nl> + if ( known . insert ( proto ) . second ) <nl> + result . push_back ( proto ) ; <nl> + } <nl> + } <nl> + } <nl> + } <nl> + return result ; <nl> + } <nl> + <nl> + / / Gather inherited protocols from the requirement signature . <nl> + auto selfType = getProtocolSelfType ( ) ; <nl> + for ( auto req : getRequirementSignature ( ) - > getRequirements ( ) ) { <nl> + if ( req . getKind ( ) = = RequirementKind : : Conformance & & <nl> + req . getFirstType ( ) - > isEqual ( selfType ) ) <nl> + result . push_back ( req . getSecondType ( ) - > castTo < ProtocolType > ( ) - > getDecl ( ) ) ; <nl> + } <nl> + return result ; <nl> } <nl> <nl> bool ProtocolDecl : : inheritsFrom ( const ProtocolDecl * super ) const { <nl> bool ProtocolDecl : : inheritsFrom ( const ProtocolDecl * super ) const { <nl> } <nl> <nl> bool ProtocolDecl : : requiresClassSlow ( ) { <nl> + if ( ! isRequirementSignatureComputed ( ) ) return false ; <nl> + <nl> ProtocolDeclBits . RequiresClass = false ; <nl> <nl> / / Ensure that the result cannot change in future . <nl> - assert ( isInheritedProtocolsValid ( ) ) ; <nl> <nl> if ( getAttrs ( ) . hasAttribute < ObjCAttr > ( ) | | isObjC ( ) ) { <nl> ProtocolDeclBits . RequiresClass = true ; <nl> bool ProtocolDecl : : requiresClassSlow ( ) { <nl> } <nl> <nl> / / Check inherited protocols for class - ness . <nl> - for ( auto * proto : getInheritedProtocols ( nullptr ) ) { <nl> + for ( auto * proto : getInheritedProtocols ( ) ) { <nl> if ( proto - > requiresClass ( ) ) { <nl> ProtocolDeclBits . RequiresClass = true ; <nl> return true ; <nl> bool ProtocolDecl : : existentialConformsToSelfSlow ( ) { <nl> / / Check whether any of the inherited protocols fail to conform to <nl> / / themselves . <nl> / / FIXME : does this need a resolver ? <nl> - for ( auto proto : getInheritedProtocols ( nullptr ) ) { <nl> + for ( auto proto : getInheritedProtocols ( ) ) { <nl> if ( ! proto - > existentialConformsToSelf ( ) ) { <nl> ProtocolDeclBits . ExistentialConformsToSelf = false ; <nl> return false ; <nl> bool ProtocolDecl : : existentialTypeSupportedSlow ( LazyResolver * resolver ) { <nl> <nl> / / Check whether all of the inherited protocols can have existential <nl> / / types themselves . <nl> - for ( auto proto : getInheritedProtocols ( resolver ) ) { <nl> + for ( auto proto : getInheritedProtocols ( ) ) { <nl> if ( ! proto - > existentialTypeSupported ( resolver ) ) { <nl> ProtocolDeclBits . ExistentialTypeSupported = false ; <nl> return false ; <nl> mmm a / lib / AST / LookupVisibleDecls . cpp <nl> ppp b / lib / AST / LookupVisibleDecls . cpp <nl> static void lookupVisibleProtocolMemberDecls ( <nl> if ( ! Visited . insert ( PT - > getDecl ( ) ) . second ) <nl> return ; <nl> <nl> - for ( auto Proto : PT - > getDecl ( ) - > getInheritedProtocols ( nullptr ) ) <nl> + for ( auto Proto : PT - > getDecl ( ) - > getInheritedProtocols ( ) ) <nl> lookupVisibleProtocolMemberDecls ( BaseTy , Proto - > getDeclaredType ( ) , Consumer , CurrDC , <nl> LS , getReasonForSuper ( Reason ) , TypeResolver , <nl> Visited ) ; <nl> mmm a / lib / AST / SubstitutionMap . cpp <nl> ppp b / lib / AST / SubstitutionMap . cpp <nl> Optional < T > SubstitutionMap : : forEachConformance ( <nl> } <nl> <nl> / / Search inherited conformances . <nl> - for ( auto inherited : proto - > getInheritedProtocols ( nullptr ) ) { <nl> + for ( auto inherited : proto - > getInheritedProtocols ( ) ) { <nl> if ( auto found = searchInConformance ( conformance . getInherited ( inherited ) , <nl> associatedTypeName , <nl> visited ) ) <nl> mmm a / lib / AST / Type . cpp <nl> ppp b / lib / AST / Type . cpp <nl> static void addMinimumProtocols ( Type T , <nl> <nl> if ( Visited . insert ( Proto - > getDecl ( ) ) . second ) { <nl> Stack . push_back ( Proto - > getDecl ( ) ) ; <nl> - for ( auto Inherited : Proto - > getDecl ( ) - > getInheritedProtocols ( nullptr ) ) <nl> + for ( auto Inherited : Proto - > getDecl ( ) - > getInheritedProtocols ( ) ) <nl> addMinimumProtocols ( Inherited - > getDeclaredType ( ) , Protocols , Known , <nl> Visited , Stack , ZappedAny ) ; <nl> } <nl> bool ProtocolType : : visitAllProtocols ( <nl> return true ; <nl> <nl> / / Add inherited protocols that we haven ' t seen already . <nl> - for ( auto inherited : proto - > getInheritedProtocols ( nullptr ) ) { <nl> + for ( auto inherited : proto - > getInheritedProtocols ( ) ) { <nl> if ( knownProtocols . insert ( inherited ) . second ) <nl> stack . push_back ( inherited ) ; <nl> } <nl> void ProtocolType : : canonicalizeProtocols ( <nl> stack . pop_back ( ) ; <nl> <nl> / / Add the protocols we inherited . <nl> - for ( auto Inherited : Current - > getInheritedProtocols ( nullptr ) ) { <nl> + for ( auto Inherited : Current - > getInheritedProtocols ( ) ) { <nl> addMinimumProtocols ( Inherited - > getDeclaredType ( ) , protocols , known , <nl> visited , stack , zappedAny ) ; <nl> } <nl> mmm a / lib / ClangImporter / ImportDecl . cpp <nl> ppp b / lib / ClangImporter / ImportDecl . cpp <nl> void SwiftDeclConverter : : addProtocols ( <nl> return ; <nl> <nl> protocols . push_back ( protocol ) ; <nl> - for ( auto inherited : protocol - > getInheritedProtocols ( Impl . getTypeResolver ( ) ) ) <nl> + for ( auto inherited : protocol - > getInheritedProtocols ( ) ) <nl> addProtocols ( inherited , protocols , known ) ; <nl> } <nl> <nl> void SwiftDeclConverter : : importObjCProtocols ( <nl> <nl> void SwiftDeclConverter : : addObjCProtocolConformances ( <nl> Decl * decl , ArrayRef < ProtocolDecl * > protocols ) { <nl> - / / Set the inherited protocols of a protocol . <nl> - if ( auto proto = dyn_cast < ProtocolDecl > ( decl ) ) { <nl> - / / Copy the list of protocols . <nl> - MutableArrayRef < ProtocolDecl * > allProtocols = <nl> - Impl . SwiftContext . AllocateCopy ( protocols ) ; <nl> - proto - > setInheritedProtocols ( allProtocols ) ; <nl> - <nl> - return ; <nl> - } <nl> + / / Nothing to do for protocols . <nl> + if ( isa < ProtocolDecl > ( decl ) ) return ; <nl> <nl> Impl . recordImportedProtocols ( decl , protocols ) ; <nl> <nl> void ClangImporter : : Implementation : : finishProtocolConformance ( <nl> <nl> / / And make sure any inherited conformances also get completed , if necessary . <nl> SmallVector < ProtocolDecl * , 8 > inheritedProtos ; <nl> - for ( auto * inherited : proto - > getInheritedProtocols ( / * resolver = * / nullptr ) ) { <nl> + for ( auto * inherited : proto - > getInheritedProtocols ( ) ) { <nl> inheritedProtos . push_back ( inherited ) ; <nl> } <nl> / / Sort for deterministic import . <nl> mmm a / lib / IRGen / Fulfillment . cpp <nl> ppp b / lib / IRGen / Fulfillment . cpp <nl> bool FulfillmentMap : : searchWitnessTable ( IRGenModule & IGM , <nl> bool hadFulfillment = false ; <nl> <nl> auto nextInheritedIndex = 0 ; <nl> - for ( auto inherited : protocol - > getInheritedProtocols ( nullptr ) ) { <nl> + for ( auto inherited : protocol - > getInheritedProtocols ( ) ) { <nl> auto index = nextInheritedIndex + + ; <nl> <nl> / / Ignore protocols that don ' t have witness tables . <nl> mmm a / lib / IRGen / GenArchetype . cpp <nl> ppp b / lib / IRGen / GenArchetype . cpp <nl> findConformanceDeclaration ( ArrayRef < ProtocolDecl * > conformsTo , <nl> <nl> / / Recurse into implied protocols . <nl> if ( auto result = <nl> - findConformanceDeclaration ( source - > getInheritedProtocols ( nullptr ) , <nl> + findConformanceDeclaration ( source - > getInheritedProtocols ( ) , <nl> associatedType , target ) ) { <nl> return result ; <nl> } <nl> mmm a / lib / IRGen / GenClass . cpp <nl> ppp b / lib / IRGen / GenClass . cpp <nl> namespace { <nl> / / Objective - C protocol conformances . <nl> / / FIXME : We can ' t use visitConformances ( ) because there are no <nl> / / conformances for protocols to protocols right now . <nl> - for ( ProtocolDecl * p : theProtocol - > getInheritedProtocols ( nullptr ) ) { <nl> + for ( ProtocolDecl * p : theProtocol - > getInheritedProtocols ( ) ) { <nl> if ( ! p - > isObjC ( ) ) <nl> continue ; <nl> / / Don ' t emit the magic AnyObject conformance . <nl> mmm a / lib / IRGen / GenMeta . cpp <nl> ppp b / lib / IRGen / GenMeta . cpp <nl> namespace { <nl> <nl> void addInherited ( ) { <nl> / / If there are no inherited protocols , produce null . <nl> - auto inherited = Protocol - > getInheritedProtocols ( nullptr ) ; <nl> + auto inherited = Protocol - > getInheritedProtocols ( ) ; <nl> if ( inherited . empty ( ) ) { <nl> addWord ( llvm : : ConstantPointerNull : : get ( IGM . Int8PtrTy ) ) ; <nl> return ; <nl> mmm a / lib / IRGen / GenProto . cpp <nl> ppp b / lib / IRGen / GenProto . cpp <nl> namespace { <nl> / / Keep track of whether we found a better path than the <nl> / / previous best . <nl> bool foundBetter = false ; <nl> - for ( auto base : proto - > getInheritedProtocols ( nullptr ) ) { <nl> + for ( auto base : proto - > getInheritedProtocols ( ) ) { <nl> / / ObjC protocols do not have witnesses . <nl> if ( ! Lowering : : TypeConverter : : protocolRequiresWitnessTable ( base ) ) <nl> continue ; <nl> llvm : : Value * MetadataPath : : followComponent ( IRGenFunction & IGF , <nl> auto conformance = sourceKey . Kind . getProtocolConformance ( ) ; <nl> auto protocol = conformance . getRequirement ( ) ; <nl> auto inheritedProtocol = <nl> - protocol - > getInheritedProtocols ( nullptr ) [ component . getPrimaryIndex ( ) ] ; <nl> + protocol - > getInheritedProtocols ( ) [ component . getPrimaryIndex ( ) ] ; <nl> <nl> sourceKey . Kind = <nl> LocalTypeDataKind : : forAbstractProtocolWitnessTable ( inheritedProtocol ) ; <nl> mmm a / lib / PrintAsObjC / PrintAsObjC . cpp <nl> ppp b / lib / PrintAsObjC / PrintAsObjC . cpp <nl> class ObjCPrinter : private DeclVisitor < ObjCPrinter > , <nl> < < " @ protocol " < < customName ; <nl> } <nl> <nl> - printProtocols ( PD - > getInheritedProtocols ( nullptr ) ) ; <nl> + printProtocols ( PD - > getInheritedProtocols ( ) ) ; <nl> os < < " \ n " ; <nl> assert ( ! protocolMembersOptional & & " protocols start required " ) ; <nl> printMembers ( PD - > getMembers ( ) ) ; <nl> class ModuleWriter { <nl> <nl> bool allRequirementsSatisfied = true ; <nl> <nl> - for ( auto proto : PD - > getInheritedProtocols ( nullptr ) ) { <nl> + for ( auto proto : PD - > getInheritedProtocols ( ) ) { <nl> assert ( proto - > isObjC ( ) ) ; <nl> allRequirementsSatisfied & = require ( proto ) ; <nl> } <nl> mmm a / lib / Sema / ITCDecl . cpp <nl> ppp b / lib / Sema / ITCDecl . cpp <nl> bool IterativeTypeChecker : : breakCycleForTypeCheckRawType ( EnumDecl * enumDecl ) { <nl> / / Inherited protocols <nl> / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> bool IterativeTypeChecker : : isInheritedProtocolsSatisfied ( ProtocolDecl * payload ) { <nl> - return payload - > isInheritedProtocolsValid ( ) ; <nl> + auto inheritedClause = payload - > getInherited ( ) ; <nl> + for ( unsigned i = 0 , n = inheritedClause . size ( ) ; i ! = n ; + + i ) { <nl> + TypeLoc & inherited = inheritedClause [ i ] ; <nl> + if ( ! inherited . getType ( ) ) return false ; <nl> + } <nl> + <nl> + return true ; <nl> } <nl> <nl> void IterativeTypeChecker : : processInheritedProtocols ( <nl> void IterativeTypeChecker : : processInheritedProtocols ( <nl> for ( auto inheritedProtocol : protocols ) { <nl> if ( inheritedProtocol = = protocol | | <nl> inheritedProtocol - > inheritsFrom ( protocol ) ) { <nl> - if ( ! diagnosedCircularity & & <nl> - ! protocol - > isInheritedProtocolsValid ( ) ) { <nl> + if ( ! diagnosedCircularity ) { <nl> diagnose ( protocol , <nl> diag : : circular_protocol_def , protocol - > getName ( ) . str ( ) ) <nl> . fixItRemove ( inherited . getSourceRange ( ) ) ; <nl> void IterativeTypeChecker : : processInheritedProtocols ( <nl> / / If we enumerated any dependencies , we can ' t complete this request . <nl> if ( anyDependencies ) <nl> return ; <nl> - <nl> - / / FIXME : Hack to deal with recursion elsewhere . <nl> - / / We recurse through DeclContext : : getLocalProtocols ( ) - - this should be <nl> - / / redone to use the IterativeDeclChecker also . <nl> - if ( protocol - > isInheritedProtocolsValid ( ) ) <nl> - return ; <nl> - protocol - > setInheritedProtocols ( getASTContext ( ) . AllocateCopy ( allProtocols ) ) ; <nl> } <nl> <nl> bool IterativeTypeChecker : : breakCycleForInheritedProtocols ( <nl> ProtocolDecl * protocol ) { <nl> / / FIXME : We ' d like to drop just the problematic protocols , not <nl> / / everything . <nl> - protocol - > setInheritedProtocols ( { } ) ; <nl> return true ; <nl> } <nl> <nl> mmm a / lib / Sema / TypeCheckDecl . cpp <nl> ppp b / lib / Sema / TypeCheckDecl . cpp <nl> void TypeChecker : : checkInheritanceClause ( Decl * decl , <nl> } <nl> <nl> if ( auto proto = dyn_cast < ProtocolDecl > ( decl ) ) { <nl> - / / FIXME : If we already set the inherited protocols , bail out . We ' d rather <nl> - / / not have to check this . <nl> - if ( proto - > isInheritedProtocolsValid ( ) ) <nl> - return ; <nl> - <nl> / / Check for circular inheritance . <nl> / / FIXME : The diagnostics here should be improved . <nl> bool diagnosedCircularity = false ; <nl> void TypeChecker : : checkInheritanceClause ( Decl * decl , <nl> <nl> + + i ; <nl> } <nl> - <nl> - proto - > setInheritedProtocols ( Context . AllocateCopy ( allProtocols ) ) ; <nl> } <nl> / / Set the superclass . <nl> else if ( auto classDecl = dyn_cast < ClassDecl > ( decl ) ) { <nl> void TypeChecker : : checkInheritanceClause ( Decl * decl , <nl> } <nl> <nl> / / / Retrieve the set of protocols the given protocol inherits . <nl> - static ArrayRef < ProtocolDecl * > <nl> + static llvm : : TinyPtrVector < ProtocolDecl * > <nl> getInheritedForCycleCheck ( TypeChecker & tc , <nl> ProtocolDecl * proto , <nl> ProtocolDecl * * scratch ) { <nl> static ArrayRef < EnumDecl * > getInheritedForCycleCheck ( TypeChecker & tc , <nl> / / <nl> / / FIXME : Just remove the problematic inheritance ? <nl> static void breakInheritanceCycle ( ProtocolDecl * proto ) { <nl> - proto - > clearInheritedProtocols ( ) ; <nl> } <nl> <nl> / / / Break the inheritance cycle for a class by removing its superclass . <nl> static void checkVarBehavior ( VarDecl * decl , TypeChecker & TC ) { <nl> / / we have those . <nl> / / <nl> / / TODO : Handle non - protocol requirements ( ' class ' , base class , etc . ) <nl> - for ( auto refinedProto : behaviorProto - > getInheritedProtocols ( & TC ) ) { <nl> + for ( auto refinedProto : behaviorProto - > getInheritedProtocols ( ) ) { <nl> / / A behavior in non - type or static context is never going to be able to <nl> / / satisfy Self constraints ( until we give structural types that ability ) . <nl> / / Give a tailored error message for this case . <nl> class DeclChecker : public DeclVisitor < DeclChecker > { <nl> if ( auto * tracker = SF - > getReferencedNameTracker ( ) ) { <nl> bool isNonPrivate = <nl> ( PD - > getFormalAccess ( ) > Accessibility : : FilePrivate ) ; <nl> - for ( auto * parentProto : PD - > getInheritedProtocols ( nullptr ) ) <nl> + for ( auto * parentProto : PD - > getInheritedProtocols ( ) ) <nl> tracker - > addUsedMember ( { parentProto , Identifier ( ) } , isNonPrivate ) ; <nl> } <nl> } <nl> void TypeChecker : : validateDecl ( ValueDecl * D ) { <nl> <nl> validateAttributes ( * this , D ) ; <nl> <nl> + proto - > computeRequirementSignature ( ) ; <nl> + <nl> / / If the protocol is @ objc , it may only refine other @ objc protocols . <nl> / / FIXME : Revisit this restriction . <nl> if ( proto - > getAttrs ( ) . hasAttribute < ObjCAttr > ( ) ) { <nl> Optional < ObjCReason > isObjC = ObjCReason : : ImplicitlyObjC ; <nl> <nl> - for ( auto inherited : proto - > getInheritedProtocols ( nullptr ) ) { <nl> + for ( auto inherited : proto - > getInheritedProtocols ( ) ) { <nl> if ( ! inherited - > isObjC ( ) ) { <nl> diagnose ( proto - > getLoc ( ) , <nl> diag : : objc_protocol_inherits_non_objc_protocol , <nl> void TypeChecker : : validateDecl ( ValueDecl * D ) { <nl> markAsObjC ( * this , proto , isObjC ) ; <nl> } <nl> <nl> - proto - > computeRequirementSignature ( ) ; <nl> - <nl> ValidatedTypes . insert ( proto ) ; <nl> break ; <nl> } <nl> void TypeChecker : : validateExtension ( ExtensionDecl * ext ) { <nl> assert ( extendedType - > is < NominalType > ( ) ) ; <nl> } <nl> <nl> - ArrayRef < ProtocolDecl * > <nl> + llvm : : TinyPtrVector < ProtocolDecl * > <nl> TypeChecker : : getDirectConformsTo ( ProtocolDecl * proto ) { <nl> resolveInheritedProtocols ( proto ) ; <nl> - return proto - > getInheritedProtocols ( nullptr ) ; <nl> + return proto - > getInheritedProtocols ( ) ; <nl> } <nl> <nl> / / / Build a default initializer string for the given pattern . <nl> mmm a / lib / Sema / TypeCheckProtocol . cpp <nl> ppp b / lib / Sema / TypeCheckProtocol . cpp <nl> compareDeclsForInference ( TypeChecker & TC , DeclContext * DC , <nl> if ( ! protos1 . insert ( p ) . second ) <nl> return ; <nl> <nl> - for ( auto parent : p - > getInheritedProtocols ( & TC ) ) <nl> + for ( auto parent : p - > getInheritedProtocols ( ) ) <nl> insertProtocol ( parent ) ; <nl> } ; <nl> <nl> compareDeclsForInference ( TypeChecker & TC , DeclContext * DC , <nl> return ; <nl> <nl> protos2AreSubsetOf1 & = protos1 . erase ( p ) ; <nl> - for ( auto parent : p - > getInheritedProtocols ( & TC ) ) <nl> + for ( auto parent : p - > getInheritedProtocols ( ) ) <nl> removeProtocol ( parent ) ; <nl> } ; <nl> <nl> checkConformsToProtocol ( TypeChecker & TC , <nl> } <nl> <nl> / / Check that T conforms to all inherited protocols . <nl> - for ( auto InheritedProto : Proto - > getInheritedProtocols ( & TC ) ) { <nl> + for ( auto InheritedProto : Proto - > getInheritedProtocols ( ) ) { <nl> auto InheritedConformance = <nl> TC . conformsToProtocol ( T , InheritedProto , DC , <nl> ConformanceCheckFlags : : Used , <nl> mmm a / lib / Sema / TypeCheckType . cpp <nl> ppp b / lib / Sema / TypeCheckType . cpp <nl> findDeclContextForType ( TypeChecker & TC , <nl> <nl> / / If not , walk into the superclass and inherited protocols , if any . <nl> if ( auto * protoDecl = dyn_cast < ProtocolDecl > ( parentNominal ) ) { <nl> - for ( auto * refined : protoDecl - > getInheritedProtocols ( & TC ) ) <nl> + for ( auto * refined : protoDecl - > getInheritedProtocols ( ) ) <nl> pushDecl ( refined ) ; <nl> } else { <nl> if ( auto * classDecl = dyn_cast < ClassDecl > ( parentNominal ) ) <nl> mmm a / lib / Sema / TypeChecker . h <nl> ppp b / lib / Sema / TypeChecker . h <nl> class TypeChecker final : public LazyResolver { <nl> GenericTypeResolver * resolver = nullptr ) ; <nl> <nl> / / / Retrieve the set of inherited protocols for this protocol type . <nl> - ArrayRef < ProtocolDecl * > getDirectConformsTo ( ProtocolDecl * proto ) ; <nl> + llvm : : TinyPtrVector < ProtocolDecl * > getDirectConformsTo ( ProtocolDecl * proto ) ; <nl> <nl> / / / \ brief Add any implicitly - defined constructors required for the given <nl> / / / struct or class . <nl> mmm a / lib / Serialization / Deserialization . cpp <nl> ppp b / lib / Serialization / Deserialization . cpp <nl> Decl * ModuleFile : : getDecl ( DeclID DID , Optional < DeclContext * > ForcedContext ) { <nl> bool isImplicit , isClassBounded , isObjC ; <nl> GenericEnvironmentID genericEnvID ; <nl> uint8_t rawAccessLevel ; <nl> - unsigned numProtocols ; <nl> - ArrayRef < uint64_t > rawProtocolAndInheritedIDs ; <nl> + ArrayRef < uint64_t > rawInheritedIDs ; <nl> <nl> decls_block : : ProtocolLayout : : readRecord ( scratch , nameID , contextID , <nl> isImplicit , isClassBounded , isObjC , <nl> genericEnvID , rawAccessLevel , <nl> - numProtocols , <nl> - rawProtocolAndInheritedIDs ) ; <nl> + rawInheritedIDs ) ; <nl> <nl> auto DC = getDeclContext ( contextID ) ; <nl> if ( declOrOffset . isComplete ( ) ) <nl> Decl * ModuleFile : : getDecl ( DeclID DID , Optional < DeclContext * > ForcedContext ) { <nl> assert ( genericParams & & " protocol with no generic parameters ? " ) ; <nl> proto - > setGenericParams ( genericParams ) ; <nl> <nl> - auto protocols = ctx . Allocate < ProtocolDecl * > ( numProtocols ) ; <nl> - for_each ( protocols , rawProtocolAndInheritedIDs . slice ( 0 , numProtocols ) , <nl> - [ this ] ( ProtocolDecl * & p , uint64_t rawID ) { <nl> - p = cast < ProtocolDecl > ( getDecl ( rawID ) ) ; <nl> - } ) ; <nl> - proto - > setInheritedProtocols ( protocols ) ; <nl> - <nl> - handleInherited ( proto , rawProtocolAndInheritedIDs . slice ( numProtocols ) ) ; <nl> + handleInherited ( proto , rawInheritedIDs ) ; <nl> <nl> configureGenericEnvironment ( proto , genericEnvID ) ; <nl> <nl> mmm a / lib / Serialization / Serialization . cpp <nl> ppp b / lib / Serialization / Serialization . cpp <nl> void Serializer : : writeDecl ( const Decl * D ) { <nl> <nl> auto contextID = addDeclContextRef ( proto - > getDeclContext ( ) ) ; <nl> <nl> - SmallVector < DeclID , 8 > protocolsAndInherited ; <nl> - for ( auto proto : proto - > getInheritedProtocols ( nullptr ) ) <nl> - protocolsAndInherited . push_back ( addDeclRef ( proto ) ) ; <nl> - unsigned numProtocols = protocolsAndInherited . size ( ) ; <nl> - for ( auto inherited : proto - > getInherited ( ) ) <nl> - protocolsAndInherited . push_back ( addTypeRef ( inherited . getType ( ) ) ) ; <nl> + SmallVector < DeclID , 8 > inherited ; <nl> + for ( auto element : proto - > getInherited ( ) ) <nl> + inherited . push_back ( addTypeRef ( element . getType ( ) ) ) ; <nl> <nl> uint8_t rawAccessLevel = <nl> getRawStableAccessibility ( proto - > getFormalAccess ( ) ) ; <nl> void Serializer : : writeDecl ( const Decl * D ) { <nl> addGenericEnvironmentRef ( <nl> proto - > getGenericEnvironment ( ) ) , <nl> rawAccessLevel , <nl> - numProtocols , <nl> - protocolsAndInherited ) ; <nl> + inherited ) ; <nl> <nl> writeGenericParams ( proto - > getGenericParams ( ) ) ; <nl> writeGenericRequirements ( <nl> mmm a / test / SILGen / objc_bridging_any . swift <nl> ppp b / test / SILGen / objc_bridging_any . swift <nl> class AnyHashableClass : NSObject { <nl> } <nl> <nl> / / CHECK - LABEL : sil_witness_table shared [ fragile ] GenericOption : Hashable module objc_generics { <nl> - / / CHECK - NEXT : base_protocol _Hashable : GenericOption : _Hashable module objc_generics <nl> / / CHECK - NEXT : base_protocol Equatable : GenericOption : Equatable module objc_generics <nl> + / / CHECK - NEXT : base_protocol _Hashable : GenericOption : _Hashable module objc_generics <nl> / / CHECK - NEXT : method # Hashable . hashValue ! getter . 1 : { { . * } } : @ _TTWVSC13GenericOptions8Hashable13objc_genericsFS0_g9hashValueSi <nl> / / CHECK - NEXT : } <nl> mmm a / test / decl / class / circular_inheritance . swift <nl> ppp b / test / decl / class / circular_inheritance . swift <nl> class B : A { } / / expected - note { { class ' B ' declared here } } <nl> class A : C { } / / expected - note { { class ' A ' declared here } } <nl> <nl> class TrivialCycle : TrivialCycle { } / / expected - error { { circular class inheritance TrivialCycle } } <nl> - protocol P : P { } / / expected - error { { circular protocol inheritance P } } <nl> + protocol P : P { } / / expected - error 3 { { circular protocol inheritance P } } <nl> <nl> class Isomorphism : Automorphism { } <nl> class Automorphism : Automorphism { } / / expected - error { { circular class inheritance Automorphism } } <nl> mmm a / test / decl / protocol / protocols . swift <nl> ppp b / test / decl / protocol / protocols . swift <nl> struct NotFormattedPrintable : FormattedPrintable { / / expected - error { { type ' Not <nl> <nl> / / Circular protocols <nl> <nl> - protocol CircleMiddle : CircleStart { func circle_middle ( ) } / / expected - error { { circular protocol inheritance CircleMiddle } } <nl> + protocol CircleMiddle : CircleStart { func circle_middle ( ) } / / expected - error 2 { { circular protocol inheritance CircleMiddle } } <nl> + / / expected - error @ - 1 { { circular protocol inheritance ' CircleMiddle ' - > ' CircleStart ' - > ' CircleEnd ' - > ' CircleMiddle ' } } <nl> / / expected - error @ + 1 { { circular protocol inheritance CircleStart } } <nl> - protocol CircleStart : CircleEnd { func circle_start ( ) } <nl> - protocol CircleEnd : CircleMiddle { func circle_end ( ) } <nl> + protocol CircleStart : CircleEnd { func circle_start ( ) } / / expected - error 2 { { circular protocol inheritance CircleStart } } <nl> + / / expected - note @ - 1 { { protocol ' CircleStart ' declared here } } <nl> + protocol CircleEnd : CircleMiddle { func circle_end ( ) } / / expected - note { { protocol ' CircleEnd ' declared here } } <nl> <nl> protocol CircleEntry : CircleTrivial { } <nl> - protocol CircleTrivial : CircleTrivial { } / / expected - error { { circular protocol inheritance CircleTrivial } } <nl> + protocol CircleTrivial : CircleTrivial { } / / expected - error 3 { { circular protocol inheritance CircleTrivial } } <nl> <nl> struct Circle { <nl> func circle_start ( ) { } <nl> similarity index 88 % <nl> rename from validation - test / compiler_crashers / 28599 - false - should - have - found - context - by - now . swift <nl> rename to validation - test / compiler_crashers_fixed / 28599 - false - should - have - found - context - by - now . swift <nl> mmm a / validation - test / compiler_crashers / 28599 - false - should - have - found - context - by - now . swift <nl> ppp b / validation - test / compiler_crashers_fixed / 28599 - false - should - have - found - context - by - now . swift <nl> <nl> / / See https : / / swift . org / LICENSE . txt for license information <nl> / / See https : / / swift . org / CONTRIBUTORS . txt for the list of Swift project authors <nl> <nl> - / / RUN : not - - crash % target - swift - frontend % s - emit - ir <nl> + / / RUN : not % target - swift - frontend % s - emit - ir <nl> / / REQUIRES : asserts <nl> protocol a : A { { } class d { func b ( a = } } protocol A : a { { } class a <nl> similarity index 87 % <nl> rename from validation - test / compiler_crashers / 28604 - isinheritedprotocolsvalid . swift <nl> rename to validation - test / compiler_crashers_fixed / 28604 - isinheritedprotocolsvalid . swift <nl> mmm a / validation - test / compiler_crashers / 28604 - isinheritedprotocolsvalid . swift <nl> ppp b / validation - test / compiler_crashers_fixed / 28604 - isinheritedprotocolsvalid . swift <nl> <nl> / / See https : / / swift . org / LICENSE . txt for license information <nl> / / See https : / / swift . org / CONTRIBUTORS . txt for the list of Swift project authors <nl> <nl> - / / RUN : not - - crash % target - swift - frontend % s - emit - ir <nl> + / / RUN : not % target - swift - frontend % s - emit - ir <nl> / / REQUIRES : asserts <nl> protocol a : b <nl> protocol b : Range < a > <nl>
|
[ AST ] Drop ProtocolDecl ' s " inherited protocols " list .
|
apple/swift
|
042e6510c324c699b86e7a8d0d20068b2ee8feb4
|
2017-02-20T17:41:00Z
|
mmm a / tensorflow / contrib / tensor_forest / BUILD <nl> ppp b / tensorflow / contrib / tensor_forest / BUILD <nl> tf_kernel_library ( <nl> " : model_ops_lib " , <nl> " / / tensorflow / core : framework " , <nl> " / / tensorflow / core : lib " , <nl> - " / / tensorflow / core : lib_internal " , <nl> ] , <nl> alwayslink = 1 , <nl> ) <nl> tf_kernel_library ( <nl> " : stats_ops_lib " , <nl> " / / tensorflow / core : framework " , <nl> " / / tensorflow / core : lib " , <nl> - " / / tensorflow / core : lib_internal " , <nl> ] , <nl> alwayslink = 1 , <nl> ) <nl>
|
Remove unused lib_internal dependency in contrib / tensor_forest .
|
tensorflow/tensorflow
|
6b40cba84e422bd9f2dca35e9c85af7851f7ccb7
|
2018-07-18T18:07:59Z
|
mmm a / include / swift / Runtime / RuntimeFunctions . def <nl> ppp b / include / swift / Runtime / RuntimeFunctions . def <nl> FUNCTION ( NativeWeakDestroy , swift_weakDestroy , DefaultCC , <nl> ARGS ( WeakReferencePtrTy ) , <nl> ATTRS ( NoUnwind ) ) <nl> <nl> - / / void swift_weakInit ( WeakReference * object , void * value ) ; <nl> + / / WeakReference * swift_weakInit ( WeakReference * object , void * value ) ; <nl> FUNCTION ( NativeWeakInit , swift_weakInit , DefaultCC , <nl> RETURNS ( WeakReferencePtrTy ) , <nl> ARGS ( WeakReferencePtrTy , RefCountedPtrTy ) , <nl> - ATTRS ( NoUnwind ) ) <nl> + ATTRS ( NoUnwind , FirstParamReturned ) ) <nl> <nl> - / / void swift_weakAssign ( WeakReference * object , void * value ) ; <nl> + / / WeakReferencePtr * swift_weakAssign ( WeakReference * object , void * value ) ; <nl> FUNCTION ( NativeWeakAssign , swift_weakAssign , DefaultCC , <nl> RETURNS ( WeakReferencePtrTy ) , <nl> ARGS ( WeakReferencePtrTy , RefCountedPtrTy ) , <nl> - ATTRS ( NoUnwind ) ) <nl> + ATTRS ( NoUnwind , FirstParamReturned ) ) <nl> <nl> / / void * swift_weakLoadStrong ( WeakReference * object ) ; <nl> FUNCTION ( NativeWeakLoadStrong , swift_weakLoadStrong , DefaultCC , <nl> FUNCTION ( NativeWeakTakeStrong , swift_weakTakeStrong , DefaultCC , <nl> ARGS ( WeakReferencePtrTy ) , <nl> ATTRS ( NoUnwind ) ) <nl> <nl> - / / void swift_weakCopyInit ( WeakReference * dest , WeakReference * src ) ; <nl> + / / WeakReference * swift_weakCopyInit ( WeakReference * dest , WeakReference * src ) ; <nl> FUNCTION ( NativeWeakCopyInit , swift_weakCopyInit , DefaultCC , <nl> RETURNS ( WeakReferencePtrTy ) , <nl> ARGS ( WeakReferencePtrTy , WeakReferencePtrTy ) , <nl> - ATTRS ( NoUnwind ) ) <nl> + ATTRS ( NoUnwind , FirstParamReturned ) ) <nl> <nl> - / / void swift_weakTakeInit ( WeakReference * dest , WeakReference * src ) ; <nl> + / / WeakReference * swift_weakTakeInit ( WeakReference * dest , WeakReference * src ) ; <nl> FUNCTION ( NativeWeakTakeInit , swift_weakTakeInit , DefaultCC , <nl> RETURNS ( WeakReferencePtrTy ) , <nl> ARGS ( WeakReferencePtrTy , WeakReferencePtrTy ) , <nl> - ATTRS ( NoUnwind ) ) <nl> + ATTRS ( NoUnwind , FirstParamReturned ) ) <nl> <nl> - / / void swift_weakCopyAssign ( WeakReference * dest , WeakReference * src ) ; <nl> + / / WeakReference * swift_weakCopyAssign ( WeakReference * dest , WeakReference * src ) ; <nl> FUNCTION ( NativeWeakCopyAssign , swift_weakCopyAssign , DefaultCC , <nl> RETURNS ( WeakReferencePtrTy ) , <nl> ARGS ( WeakReferencePtrTy , WeakReferencePtrTy ) , <nl> - ATTRS ( NoUnwind ) ) <nl> + ATTRS ( NoUnwind , FirstParamReturned ) ) <nl> <nl> - / / void swift_weakTakeAssign ( WeakReference * dest , WeakReference * src ) ; <nl> + / / WeakReference * swift_weakTakeAssign ( WeakReference * dest , WeakReference * src ) ; <nl> FUNCTION ( NativeWeakTakeAssign , swift_weakTakeAssign , DefaultCC , <nl> RETURNS ( WeakReferencePtrTy ) , <nl> ARGS ( WeakReferencePtrTy , WeakReferencePtrTy ) , <nl> - ATTRS ( NoUnwind ) ) <nl> + ATTRS ( NoUnwind , FirstParamReturned ) ) <nl> <nl> / / void swift_unknownWeakDestroy ( WeakReference * object ) ; <nl> FUNCTION ( UnknownWeakDestroy , swift_unknownWeakDestroy , DefaultCC , <nl> mmm a / lib / IRGen / IRGenModule . cpp <nl> ppp b / lib / IRGen / IRGenModule . cpp <nl> namespace RuntimeConstants { <nl> const auto NoReturn = llvm : : Attribute : : NoReturn ; <nl> const auto NoUnwind = llvm : : Attribute : : NoUnwind ; <nl> const auto ZExt = llvm : : Attribute : : ZExt ; <nl> + const auto FirstParamReturned = llvm : : Attribute : : Returned ; <nl> } / / namespace RuntimeConstants <nl> <nl> / / We don ' t use enough attributes to justify generalizing the <nl> namespace RuntimeConstants { <nl> static bool isReturnAttribute ( llvm : : Attribute : : AttrKind Attr ) { <nl> return Attr = = llvm : : Attribute : : ZExt ; <nl> } <nl> + / / Similar to the ' return ' attribute we assume that the ' returned ' attributed is <nl> + / / associated with the first function parameter . <nl> + static bool isReturnedAttribute ( llvm : : Attribute : : AttrKind Attr ) { <nl> + return Attr = = llvm : : Attribute : : Returned ; <nl> + } <nl> <nl> llvm : : Constant * swift : : getRuntimeFn ( llvm : : Module & Module , <nl> llvm : : Constant * & cache , <nl> llvm : : Constant * swift : : getRuntimeFn ( llvm : : Module & Module , <nl> <nl> llvm : : AttrBuilder buildFnAttr ; <nl> llvm : : AttrBuilder buildRetAttr ; <nl> + llvm : : AttrBuilder buildFirstParamAttr ; <nl> <nl> for ( auto Attr : attrs ) { <nl> if ( isReturnAttribute ( Attr ) ) <nl> buildRetAttr . addAttribute ( Attr ) ; <nl> + else if ( isReturnedAttribute ( Attr ) ) <nl> + buildFirstParamAttr . addAttribute ( Attr ) ; <nl> else <nl> buildFnAttr . addAttribute ( Attr ) ; <nl> } <nl> fn - > addAttributes ( llvm : : AttributeList : : FunctionIndex , buildFnAttr ) ; <nl> fn - > addAttributes ( llvm : : AttributeList : : ReturnIndex , buildRetAttr ) ; <nl> + fn - > addParamAttrs ( 0 , buildFirstParamAttr ) ; <nl> } <nl> <nl> return cache ; <nl> mmm a / test / IRGen / weak . sil <nl> ppp b / test / IRGen / weak . sil <nl> <nl> / / RUN : % target - swift - frontend - assume - parsing - unqualified - ownership - sil - emit - ir % s | % FileCheck % s <nl> + / / RUN : % target - swift - frontend - assume - parsing - unqualified - ownership - sil - O - S % s | % FileCheck % s - - check - prefix = TAILCALL <nl> <nl> / / REQUIRES : CPU = x86_64 <nl> / / XFAIL : linux <nl> sil_stage canonical <nl> <nl> import Swift <nl> <nl> - class C { } <nl> + public class C { } <nl> sil_vtable C { } <nl> sil @ _T04weak1CCfD : $ @ convention ( method ) ( C ) - > ( ) <nl> <nl> protocol P : class { <nl> func explode ( ) <nl> } <nl> <nl> - struct A { <nl> + public struct A { <nl> weak var x : C ? <nl> } <nl> <nl> bb0 ( % 0 : $ Optional < P > ) : <nl> / / CHECK - NEXT : [ [ T0 : % . * ] ] = bitcast [ [ A ] ] * [ [ DEST ] ] to [ [ OPAQUE ] ] * <nl> / / CHECK - NEXT : ret [ [ OPAQUE ] ] * [ [ T0 ] ] <nl> <nl> + / / TAILCALL : __T04weak1AVwCP : <nl> + / / TAILCALL : jmp _swift_weakCopyInit <nl> + <nl> / / destroy <nl> / / CHECK : define linkonce_odr hidden void @ _T04weak1AVwxx ( [ [ OPAQUE ] ] * noalias [ [ ARG : % . * ] ] , [ [ TYPE ] ] * <nl> / / CHECK : [ [ T0 : % . * ] ] = bitcast [ [ OPAQUE ] ] * [ [ ARG ] ] to [ [ A ] ] * <nl> bb0 ( % 0 : $ Optional < P > ) : <nl> / / CHECK - NEXT : call void @ swift_weakDestroy ( [ [ WEAK ] ] * [ [ T1 ] ] ) <nl> / / CHECK - NEXT : ret void <nl> <nl> + / / TAILCALL : __T04weak1AVwxx : <nl> + / / TAILCALL : jmp _swift_weakDestroy <nl> + <nl> / / initializeWithCopy <nl> / / CHECK : define linkonce_odr hidden [ [ OPAQUE ] ] * @ _T04weak1AVwcp ( [ [ OPAQUE ] ] * noalias [ [ DEST_OPQ : % . * ] ] , [ [ OPAQUE ] ] * noalias [ [ SRC_OPQ : % . * ] ] , [ [ TYPE ] ] * <nl> / / CHECK : [ [ DEST : % . * ] ] = bitcast [ [ OPAQUE ] ] * [ [ DEST_OPQ ] ] to [ [ A ] ] * <nl> bb0 ( % 0 : $ Optional < P > ) : <nl> / / CHECK - NEXT : [ [ T0 : % . * ] ] = bitcast [ [ A ] ] * [ [ DEST ] ] to [ [ OPAQUE ] ] * <nl> / / CHECK - NEXT : ret [ [ OPAQUE ] ] * [ [ T0 ] ] <nl> <nl> + / / TAILCALL : __T04weak1AVwcp : <nl> + / / TAILCALL : jmp _swift_weakCopyInit <nl> + <nl> / / assignWithCopy <nl> / / CHECK : define linkonce_odr hidden [ [ OPAQUE ] ] * @ _T04weak1AVwca ( [ [ OPAQUE ] ] * [ [ DEST_OPQ : % . * ] ] , [ [ OPAQUE ] ] * [ [ SRC_OPQ : % . * ] ] , [ [ TYPE ] ] * <nl> / / CHECK : [ [ DEST : % . * ] ] = bitcast [ [ OPAQUE ] ] * [ [ DEST_OPQ ] ] to [ [ A ] ] * <nl> bb0 ( % 0 : $ Optional < P > ) : <nl> / / CHECK - NEXT : [ [ T0 : % . * ] ] = bitcast [ [ A ] ] * [ [ DEST ] ] to [ [ OPAQUE ] ] * <nl> / / CHECK - NEXT : ret [ [ OPAQUE ] ] * [ [ T0 ] ] <nl> <nl> + / / TAILCALL : __T04weak1AVwca : <nl> + / / TAILCALL : jmp _swift_weakCopyAssign <nl> + <nl> / / assignWithTake <nl> / / CHECK : define linkonce_odr hidden [ [ OPAQUE ] ] * @ _T04weak1AVwta ( [ [ OPAQUE ] ] * noalias [ [ DEST_OPQ : % . * ] ] , [ [ OPAQUE ] ] * noalias [ [ SRC_OPQ : % . * ] ] , [ [ TYPE ] ] * <nl> / / CHECK : [ [ DEST : % . * ] ] = bitcast [ [ OPAQUE ] ] * [ [ DEST_OPQ ] ] to [ [ A ] ] * <nl> bb0 ( % 0 : $ Optional < P > ) : <nl> / / CHECK - NEXT : call [ [ WEAK ] ] * @ swift_weakTakeAssign ( [ [ WEAK ] ] * [ [ DEST_X ] ] , [ [ WEAK ] ] * [ [ SRC_X ] ] ) <nl> / / CHECK - NEXT : [ [ T0 : % . * ] ] = bitcast [ [ A ] ] * [ [ DEST ] ] to [ [ OPAQUE ] ] * <nl> / / CHECK - NEXT : ret [ [ OPAQUE ] ] * [ [ T0 ] ] <nl> + <nl> + / / TAILCALL : __T04weak1AVwtk : <nl> + / / TAILCALL : jmp _swift_weakTakeInit <nl> + <nl> + / / TAILCALL : __T04weak1AVwta : <nl> + / / TAILCALL : jmp _swift_weakTakeAssign <nl> + <nl> + / / TAILCALL : __T04weak1AVwTK : <nl> + / / TAILCALL : jmp _swift_weakTakeInit <nl>
|
Add llvm : Attribute : : Returned to the weak runtime functions
|
apple/swift
|
a39c83149303b68baa3736ed723d27a7ed8624be
|
2017-09-13T21:10:28Z
|
mmm a / XBMC . xcodeproj / project . pbxproj <nl> ppp b / XBMC . xcodeproj / project . pbxproj <nl> <nl> F5EA08860F78B1E7005C2EC5 / * libcdio . dylib in Frameworks * / = { isa = PBXBuildFile ; fileRef = F5EA08840F78B1E7005C2EC5 / * libcdio . dylib * / ; } ; <nl> F5EEB973106B07910019B552 / * GUIInfoTypes . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = F5EEB971106B07910019B552 / * GUIInfoTypes . cpp * / ; } ; <nl> F5EEB974106B07910019B552 / * GUIInfoTypes . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = F5EEB971106B07910019B552 / * GUIInfoTypes . cpp * / ; } ; <nl> + F5EEBA87107015070019B552 / * SamiTagConvertor . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = F5EEBA85107015070019B552 / * SamiTagConvertor . cpp * / ; } ; <nl> + F5EEBA88107015070019B552 / * SamiTagConvertor . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = F5EEBA85107015070019B552 / * SamiTagConvertor . cpp * / ; } ; <nl> F5F2EF4B0E593E0D0092C37F / * DVDFileInfo . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = F5F2EF4A0E593E0D0092C37F / * DVDFileInfo . cpp * / ; } ; <nl> F5F8E1DA0E427E8000A8E96F / * VGMCodec . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = F5F8E1D90E427E8000A8E96F / * VGMCodec . cpp * / ; } ; <nl> F5F8E1E80E427F6700A8E96F / * md5 . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = F5F8E1E60E427F6700A8E96F / * md5 . cpp * / ; } ; <nl> <nl> F54877680FDF702B00E506FD / * PlayerSelectionRule . cpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . cpp ; path = PlayerSelectionRule . cpp ; sourceTree = " < group > " ; } ; <nl> F548776B0FDF705800E506FD / * PlayerCoreConfig . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; path = PlayerCoreConfig . h ; sourceTree = " < group > " ; } ; <nl> F548786B0FE060FF00E506FD / * DVDSubtitleParserMPL2 . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; path = DVDSubtitleParserMPL2 . h ; sourceTree = " < group > " ; } ; <nl> - F548786C0FE060FF00E506FD / * DVDSubtitleParserMPL2 . cpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . cpp ; path = DVDSubtitleParserMPL2 . cpp ; sourceTree = " < group > " ; } ; <nl> + F548786C0FE060FF00E506FD / * DVDSubtitleParserMPL2 . cpp * / = { isa = PBXFileReference ; explicitFileType = sourcecode . cpp . cpp ; fileEncoding = 4 ; path = DVDSubtitleParserMPL2 . cpp ; sourceTree = " < group > " ; } ; <nl> F54878750FE0614F00E506FD / * ScriptSettings . cpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . cpp ; path = ScriptSettings . cpp ; sourceTree = " < group > " ; } ; <nl> F54878760FE0614F00E506FD / * ScriptSettings . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; path = ScriptSettings . h ; sourceTree = " < group > " ; } ; <nl> F54878790FE0619800E506FD / * PythonSettings . cpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . cpp ; path = PythonSettings . cpp ; sourceTree = " < group > " ; } ; <nl> <nl> F5EA08840F78B1E7005C2EC5 / * libcdio . dylib * / = { isa = PBXFileReference ; lastKnownFileType = " compiled . mach - o . dylib " ; name = libcdio . dylib ; path = / opt / local / lib / libcdio . dylib ; sourceTree = " < absolute > " ; } ; <nl> F5EEB971106B07910019B552 / * GUIInfoTypes . cpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . cpp ; path = GUIInfoTypes . cpp ; sourceTree = " < group > " ; } ; <nl> F5EEB972106B07910019B552 / * GUIInfoTypes . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; path = GUIInfoTypes . h ; sourceTree = " < group > " ; } ; <nl> + F5EEBA85107015070019B552 / * SamiTagConvertor . cpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . cpp ; path = SamiTagConvertor . cpp ; sourceTree = " < group > " ; } ; <nl> + F5EEBA86107015070019B552 / * SamiTagConvertor . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; path = SamiTagConvertor . h ; sourceTree = " < group > " ; } ; <nl> F5F2EF490E593E0D0092C37F / * DVDFileInfo . h * / = { isa = PBXFileReference ; fileEncoding = 30 ; lastKnownFileType = sourcecode . c . h ; path = DVDFileInfo . h ; sourceTree = " < group > " ; } ; <nl> F5F2EF4A0E593E0D0092C37F / * DVDFileInfo . cpp * / = { isa = PBXFileReference ; fileEncoding = 30 ; lastKnownFileType = sourcecode . cpp . cpp ; path = DVDFileInfo . cpp ; sourceTree = " < group > " ; } ; <nl> F5F8E1D80E427E8000A8E96F / * VGMCodec . h * / = { isa = PBXFileReference ; fileEncoding = 30 ; lastKnownFileType = sourcecode . c . h ; path = VGMCodec . h ; sourceTree = " < group > " ; } ; <nl> <nl> 8883CEA40DD81807004E8B72 / * DVDSubtitleParserSSA . h * / , <nl> 8883CEA50DD81807004E8B72 / * DVDSubtitlesLibass . cpp * / , <nl> 8883CEA60DD81807004E8B72 / * DVDSubtitlesLibass . h * / , <nl> - E36C29E40DA72442001F0C9D / * DVDSubtitleParserSami . h * / , <nl> - E36C29E50DA72442001F0C9D / * DVDSubtitleParserSami . cpp * / , <nl> E3B53E7A0D97B08100021A96 / * DVDSubtitleParserMicroDVD . cpp * / , <nl> E3B53E7B0D97B08100021A96 / * DVDSubtitleParserMicroDVD . h * / , <nl> F548786C0FE060FF00E506FD / * DVDSubtitleParserMPL2 . cpp * / , <nl> F548786B0FE060FF00E506FD / * DVDSubtitleParserMPL2 . h * / , <nl> + E36C29E50DA72442001F0C9D / * DVDSubtitleParserSami . cpp * / , <nl> + E36C29E40DA72442001F0C9D / * DVDSubtitleParserSami . h * / , <nl> E38E158F0D25F9FA00618676 / * DVDFactorySubtitle . cpp * / , <nl> E38E15900D25F9FA00618676 / * DVDFactorySubtitle . h * / , <nl> E38E15910D25F9FA00618676 / * DVDSubtitleLineCollection . cpp * / , <nl> <nl> F5D8EF5A103912A4004A11AB / * DVDSubtitleParserVplayer . h * / , <nl> E38E15960D25F9FA00618676 / * DVDSubtitleStream . cpp * / , <nl> E38E15970D25F9FA00618676 / * DVDSubtitleStream . h * / , <nl> + F5EEBA85107015070019B552 / * SamiTagConvertor . cpp * / , <nl> + F5EEBA86107015070019B552 / * SamiTagConvertor . h * / , <nl> ) ; <nl> path = DVDSubtitles ; <nl> sourceTree = " < group > " ; <nl> <nl> 7CCF7F1D1069F3AE00992676 / * Builtins . cpp in Sources * / , <nl> 7CCF7FC9106A0DF500992676 / * TimeUtils . cpp in Sources * / , <nl> F5EEB973106B07910019B552 / * GUIInfoTypes . cpp in Sources * / , <nl> + F5EEBA87107015070019B552 / * SamiTagConvertor . cpp in Sources * / , <nl> ) ; <nl> runOnlyForDeploymentPostprocessing = 0 ; <nl> } ; <nl> <nl> 7CCF7F1E1069F3AE00992676 / * Builtins . cpp in Sources * / , <nl> 7CCF7FCA106A0DF500992676 / * TimeUtils . cpp in Sources * / , <nl> F5EEB974106B07910019B552 / * GUIInfoTypes . cpp in Sources * / , <nl> + F5EEBA88107015070019B552 / * SamiTagConvertor . cpp in Sources * / , <nl> ) ; <nl> runOnlyForDeploymentPostprocessing = 0 ; <nl> } ; <nl>
|
xcode sync
|
xbmc/xbmc
|
f54b9baf2b68634ceda27131897d8869679f5050
|
2009-09-27T22:48:44Z
|
mmm a / src / interfaces / chain . cpp <nl> ppp b / src / interfaces / chain . cpp <nl> class ChainImpl : public Chain <nl> { <nl> return : : mempool . GetMinFee ( gArgs . GetArg ( " - maxmempool " , DEFAULT_MAX_MEMPOOL_SIZE ) * 1000000 ) ; <nl> } <nl> + bool getPruneMode ( ) override { return : : fPruneMode ; } <nl> } ; <nl> <nl> } / / namespace <nl> mmm a / src / interfaces / chain . h <nl> ppp b / src / interfaces / chain . h <nl> class Chain <nl> <nl> / / ! Pool min fee . <nl> virtual CFeeRate mempoolMinFee ( ) = 0 ; <nl> + <nl> + / / ! Check if pruning is enabled . <nl> + virtual bool getPruneMode ( ) = 0 ; <nl> } ; <nl> <nl> / / ! Interface to let node manage chain clients ( wallets , or maybe tools for <nl> mmm a / src / wallet / rpcdump . cpp <nl> ppp b / src / wallet / rpcdump . cpp <nl> UniValue importprivkey ( const JSONRPCRequest & request ) <nl> if ( ! request . params [ 2 ] . isNull ( ) ) <nl> fRescan = request . params [ 2 ] . get_bool ( ) ; <nl> <nl> - if ( fRescan & & fPruneMode ) <nl> + if ( fRescan & & pwallet - > chain ( ) . getPruneMode ( ) ) <nl> throw JSONRPCError ( RPC_WALLET_ERROR , " Rescan is disabled in pruned mode " ) ; <nl> <nl> if ( fRescan & & ! reserver . reserve ( ) ) { <nl> UniValue importaddress ( const JSONRPCRequest & request ) <nl> if ( ! request . params [ 2 ] . isNull ( ) ) <nl> fRescan = request . params [ 2 ] . get_bool ( ) ; <nl> <nl> - if ( fRescan & & fPruneMode ) <nl> + if ( fRescan & & pwallet - > chain ( ) . getPruneMode ( ) ) <nl> throw JSONRPCError ( RPC_WALLET_ERROR , " Rescan is disabled in pruned mode " ) ; <nl> <nl> WalletRescanReserver reserver ( pwallet ) ; <nl> UniValue importpubkey ( const JSONRPCRequest & request ) <nl> if ( ! request . params [ 2 ] . isNull ( ) ) <nl> fRescan = request . params [ 2 ] . get_bool ( ) ; <nl> <nl> - if ( fRescan & & fPruneMode ) <nl> + if ( fRescan & & pwallet - > chain ( ) . getPruneMode ( ) ) <nl> throw JSONRPCError ( RPC_WALLET_ERROR , " Rescan is disabled in pruned mode " ) ; <nl> <nl> WalletRescanReserver reserver ( pwallet ) ; <nl> UniValue importwallet ( const JSONRPCRequest & request ) <nl> } , <nl> } . ToString ( ) ) ; <nl> <nl> - if ( fPruneMode ) <nl> + if ( pwallet - > chain ( ) . getPruneMode ( ) ) <nl> throw JSONRPCError ( RPC_WALLET_ERROR , " Importing wallets is disabled in pruned mode " ) ; <nl> <nl> WalletRescanReserver reserver ( pwallet ) ; <nl> mmm a / src / wallet / wallet . cpp <nl> ppp b / src / wallet / wallet . cpp <nl> std : : shared_ptr < CWallet > CWallet : : CreateWalletFromFile ( interfaces : : Chain & chain , <nl> / / We can ' t rescan beyond non - pruned blocks , stop and throw an error <nl> / / this might happen if a user uses an old wallet within a pruned node <nl> / / or if he ran - disablewallet for a longer time , then decided to re - enable <nl> - if ( fPruneMode ) <nl> + if ( chain . getPruneMode ( ) ) <nl> { <nl> int block_height = * tip_height ; <nl> while ( block_height > 0 & & locked_chain - > haveBlockOnDisk ( block_height - 1 ) & & rescan_height ! = block_height ) { <nl>
|
Remove uses of fPruneMode in wallet code
|
bitcoin/bitcoin
|
cc3836e8f90894432db06d9de6b20eac53d93cbe
|
2019-02-22T19:43:02Z
|
mmm a / caffe2 / python / layers / sparse_lookup . py <nl> ppp b / caffe2 / python / layers / sparse_lookup . py <nl> def get_sparse_lookup_predictor_version ( version ) : <nl> return version <nl> <nl> <nl> + def _is_id_list ( input_record ) : <nl> + return schema . equal_schemas ( input_record , IdList ) <nl> + <nl> + <nl> + def _is_id_score_list ( input_record ) : <nl> + return schema . equal_schemas ( input_record , <nl> + IdScoreList , <nl> + check_field_types = False ) <nl> + <nl> + <nl> class SparseLookup ( ModelLayer ) : <nl> _id_list_supported_reducers = [ <nl> - ' PositionWeighted ' , ' LogMeanExp ' , ' LogSumExp ' , ' Max ' , ' Mean ' , ' Sum ' , <nl> + ' LogMeanExp ' , ' LogSumExp ' , ' Max ' , ' Mean ' , ' Sum ' , <nl> ' WeightedSum ' , ' WeightedMean ' , ' Sqrt ' , ' None ' ] <nl> <nl> _id_score_list_supported_reducers = [ <nl> def __init__ ( self , model , input_record , inner_shape , reducer , <nl> format ( type ( inner_shape ) ) <nl> <nl> if reducer = = " PositionWeighted " : <nl> + assert _is_id_score_list ( self . input_record ) , ( <nl> + " PositionWeighted only support IdScoreList , but got { } " + <nl> + " please use PositionWeighted layer to convert IdList " + <nl> + " to IdScoreList " ) . format ( repr ( self . input_record ) ) <nl> self . external_weights = input_record . values ( ) <nl> self . reducer = reducer <nl> <nl> def __init__ ( self , model , input_record , inner_shape , reducer , <nl> self . weight_init = weight_init if weight_init else ( <nl> ' UniformFill ' , { ' min ' : - scale , ' max ' : scale } ) <nl> <nl> - if schema . equal_schemas ( self . input_record , IdList ) : <nl> + if _is_id_list ( self . input_record ) : <nl> sparse_key = self . input_record . items ( ) <nl> - elif schema . equal_schemas ( <nl> - self . input_record , <nl> - IdScoreList , <nl> - check_field_types = False ) : <nl> + elif _is_id_score_list ( self . input_record ) : <nl> sparse_key = self . input_record . keys ( ) <nl> else : <nl> raise NotImplementedError ( ) <nl> def add_ops ( self , net ) : <nl> * * cur_scope . get ( get_sparse_lookup_predictor_version . __name__ , <nl> { ' version ' : ' fp32 ' } ) ) <nl> <nl> - if schema . equal_schemas ( self . input_record , IdList ) : <nl> + if _is_id_list ( self . input_record ) : <nl> self . _add_ops_id_list ( net , version = version ) <nl> - elif schema . equal_schemas ( self . input_record , <nl> - IdScoreList , <nl> - check_field_types = False ) : <nl> + elif _is_id_score_list ( self . input_record ) : <nl> self . _add_ops_id_score_list ( net , version = version ) <nl> else : <nl> raise " Unsupported input type { 0 } " . format ( self . input_record ) <nl> mmm a / caffe2 / python / layers_test . py <nl> ppp b / caffe2 / python / layers_test . py <nl> <nl> IdList , <nl> set_request_only , <nl> is_request_only_scalar , <nl> + get_key , <nl> ) <nl> <nl> <nl> def testFCWithoutBias ( self ) : <nl> predict_net = self . get_predict_net ( ) <nl> self . assertNetContainOps ( predict_net , [ mat_mul_spec ] ) <nl> <nl> - def testSparseLookup ( self ) : <nl> + def testSparseLookupSumPooling ( self ) : <nl> record = schema . NewRecord ( self . model . net , schema . Struct ( <nl> ( ' sparse ' , schema . Struct ( <nl> ( ' sparse_feature_0 ' , schema . List ( <nl> def testSparseLookup ( self ) : <nl> embedding_dim = 64 <nl> embedding_after_pooling = self . model . SparseLookup ( <nl> record . sparse . sparse_feature_0 , [ embedding_dim ] , ' Sum ' ) <nl> - self . model . output_schema = embedding_after_pooling <nl> + self . model . output_schema = schema . Struct ( ) <nl> self . assertEqual ( <nl> schema . Scalar ( ( np . float32 , ( embedding_dim , ) ) ) , <nl> embedding_after_pooling <nl> def testSparseLookup ( self ) : <nl> predict_net = self . get_predict_net ( ) <nl> self . assertNetContainOps ( predict_net , [ sparse_lookup_op_spec ] ) <nl> <nl> + def testSparseLookupIncorrectPositionWeightedOnIdList ( self ) : <nl> + ' ' ' <nl> + Currently the implementation of SparseLookup assumed input is id_score_list <nl> + when use PositionWeighted . <nl> + ' ' ' <nl> + record = schema . NewRecord ( self . model . net , schema . Struct ( <nl> + ( ' sparse ' , schema . Struct ( <nl> + ( ' sparse_feature_0 ' , schema . List ( <nl> + schema . Scalar ( np . int64 , <nl> + metadata = schema . Metadata ( categorical_limit = 1000 ) ) ) ) , <nl> + ) ) , <nl> + ) ) <nl> + <nl> + embedding_dim = 64 <nl> + with self . assertRaises ( AssertionError ) : <nl> + self . model . SparseLookup ( <nl> + record . sparse . sparse_feature_0 , [ embedding_dim ] , ' PositionWeighted ' ) <nl> + <nl> + def testSparseLookupPositionWeightedOnIdList ( self ) : <nl> + record = schema . NewRecord ( self . model . net , schema . Struct ( <nl> + ( ' sparse ' , schema . Struct ( <nl> + ( ' sparse_feature_0 ' , schema . List ( <nl> + schema . Scalar ( np . int64 , <nl> + metadata = schema . Metadata ( categorical_limit = 1000 ) ) ) ) , <nl> + ) ) , <nl> + ) ) <nl> + <nl> + # convert id_list to id_score_list with PositionWeighted layer <nl> + sparse_segment = record . sparse . sparse_feature_0 <nl> + pos_w_layer = self . model . PositionWeighted ( sparse_segment ) <nl> + <nl> + sparse_segment = schema . Map ( <nl> + keys = get_key ( sparse_segment ) , <nl> + values = pos_w_layer . position_weights , <nl> + lengths_blob = sparse_segment . lengths <nl> + ) <nl> + <nl> + embedding_dim = 64 <nl> + embedding_after_pooling = self . model . SparseLookup ( <nl> + sparse_segment , [ embedding_dim ] , ' PositionWeighted ' ) <nl> + self . model . output_schema = schema . Struct ( ) <nl> + self . assertEqual ( <nl> + schema . Scalar ( ( np . float32 , ( embedding_dim , ) ) ) , <nl> + embedding_after_pooling <nl> + ) <nl> + <nl> + train_init_net , train_net = self . get_training_nets ( ) <nl> + <nl> + self . assertNetContainOps ( <nl> + train_init_net , <nl> + [ <nl> + OpSpec ( " ConstantFill " , None , None ) , # position_weights / pos_w <nl> + OpSpec ( " UniformFill " , None , None ) , <nl> + OpSpec ( " ConstantFill " , None , None ) , <nl> + ] <nl> + ) <nl> + self . assertNetContainOps ( train_net , [ <nl> + OpSpec ( " LengthsRangeFill " , None , None ) , <nl> + OpSpec ( " Gather " , None , None ) , <nl> + OpSpec ( " SparseLengthsWeightedSum " , None , None ) , <nl> + ] ) <nl> + <nl> + predict_net = self . get_predict_net ( ) <nl> + self . assertNetContainOps ( predict_net , [ <nl> + OpSpec ( " LengthsRangeFill " , None , None ) , <nl> + OpSpec ( " Gather " , None , None ) , <nl> + OpSpec ( " SparseLengthsWeightedSum " , None , None ) , <nl> + ] ) <nl> + <nl> + def testSparseLookupPositionWeightedOnIdScoreList ( self ) : <nl> + record = schema . NewRecord ( self . model . net , schema . Struct ( <nl> + ( ' sparse ' , schema . Struct ( <nl> + ( ' id_score_list_0 ' , schema . Map ( <nl> + schema . Scalar ( <nl> + np . int64 , <nl> + metadata = schema . Metadata ( <nl> + categorical_limit = 1000 <nl> + ) , <nl> + ) , <nl> + np . float32 <nl> + ) ) , <nl> + ) ) , <nl> + ) ) <nl> + <nl> + embedding_dim = 64 <nl> + embedding_after_pooling = self . model . SparseLookup ( <nl> + record . sparse . id_score_list_0 , [ embedding_dim ] , ' PositionWeighted ' ) <nl> + self . model . output_schema = schema . Struct ( ) <nl> + self . assertEqual ( <nl> + schema . Scalar ( ( np . float32 , ( embedding_dim , ) ) ) , <nl> + embedding_after_pooling <nl> + ) <nl> + <nl> + train_init_net , train_net = self . get_training_nets ( ) <nl> + <nl> + init_ops = self . assertNetContainOps ( <nl> + train_init_net , <nl> + [ <nl> + OpSpec ( " UniformFill " , None , None ) , <nl> + OpSpec ( " ConstantFill " , None , None ) , <nl> + ] <nl> + ) <nl> + sparse_lookup_op_spec = OpSpec ( <nl> + ' SparseLengthsWeightedSum ' , <nl> + [ <nl> + init_ops [ 0 ] . output [ 0 ] , <nl> + record . sparse . id_score_list_0 . values ( ) , <nl> + record . sparse . id_score_list_0 . keys ( ) , <nl> + record . sparse . id_score_list_0 . lengths ( ) , <nl> + ] , <nl> + [ embedding_after_pooling ( ) ] <nl> + ) <nl> + self . assertNetContainOps ( train_net , [ sparse_lookup_op_spec ] ) <nl> + <nl> + predict_net = self . get_predict_net ( ) <nl> + self . assertNetContainOps ( predict_net , [ sparse_lookup_op_spec ] ) <nl> + <nl> def testSamplingTrain ( self ) : <nl> output_dims = 1000 <nl> <nl>
|
Test for PositionWeighted
|
pytorch/pytorch
|
8e0177255e24e12bc19aaeecfefc6f600638e090
|
2018-01-23T03:20:46Z
|
mmm a / src / runtime . js <nl> ppp b / src / runtime . js <nl> var Runtime = { <nl> return ret ; <nl> } <nl> this . processJSString = function processJSString ( string ) { <nl> + / * TODO : use TextEncoder when present , <nl> + var encoder = new TextEncoder ( ) ; <nl> + encoder [ ' encoding ' ] = " utf - 8 " ; <nl> + var utf8Array = encoder [ ' encode ' ] ( aMsg . data ) ; <nl> + * / <nl> string = unescape ( encodeURIComponent ( string ) ) ; <nl> var ret = [ ] ; <nl> for ( var i = 0 ; i < string . length ; i + + ) { <nl>
|
todo about TextEncoder
|
emscripten-core/emscripten
|
bda9400d094292be27f4be43473b0d1fc656df32
|
2014-03-07T18:36:17Z
|
mmm a / src / builtins / builtins - regexp . cc <nl> ppp b / src / builtins / builtins - regexp . cc <nl> MaybeHandle < JSRegExp > RegExpInitialize ( Isolate * isolate , <nl> } <nl> <nl> / / TODO ( jgruber ) : We could avoid the flags back and forth conversions . <nl> - RETURN_RESULT ( isolate , <nl> - JSRegExp : : Initialize ( regexp , pattern_string , flags_string ) , <nl> - JSRegExp ) ; <nl> + return JSRegExp : : Initialize ( regexp , pattern_string , flags_string ) ; <nl> } <nl> <nl> } / / namespace <nl> mmm a / src / isolate . h <nl> ppp b / src / isolate . h <nl> class Interpreter ; <nl> # define RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION ( isolate , T ) \ <nl> RETURN_VALUE_IF_SCHEDULED_EXCEPTION ( isolate , MaybeHandle < T > ( ) ) <nl> <nl> - # define RETURN_RESULT ( isolate , call , T ) \ <nl> - do { \ <nl> - Handle < T > __result__ ; \ <nl> - if ( ! ( call ) . ToHandle ( & __result__ ) ) { \ <nl> - DCHECK ( ( isolate ) - > has_pending_exception ( ) ) ; \ <nl> - return MaybeHandle < T > ( ) ; \ <nl> - } \ <nl> - return __result__ ; \ <nl> - } while ( false ) <nl> - <nl> # define RETURN_RESULT_OR_FAILURE ( isolate , call ) \ <nl> do { \ <nl> Handle < Object > __result__ ; \ <nl> mmm a / src / messages . cc <nl> ppp b / src / messages . cc <nl> MaybeHandle < String > JSStackFrame : : ToString ( ) { <nl> builder . AppendString ( Handle < String > : : cast ( function_name ) ) ; <nl> } else { <nl> AppendFileLocation ( isolate_ , this , & builder ) ; <nl> - RETURN_RESULT ( isolate_ , builder . Finish ( ) , String ) ; <nl> + return builder . Finish ( ) ; <nl> } <nl> <nl> builder . AppendCString ( " ( " ) ; <nl> AppendFileLocation ( isolate_ , this , & builder ) ; <nl> builder . AppendCString ( " ) " ) ; <nl> <nl> - RETURN_RESULT ( isolate_ , builder . Finish ( ) , String ) ; <nl> + return builder . Finish ( ) ; <nl> } <nl> <nl> int JSStackFrame : : GetPosition ( ) const { return code_ - > SourcePosition ( offset_ ) ; } <nl> MaybeHandle < String > AsmJsWasmStackFrame : : ToString ( ) { <nl> <nl> if ( IsNonEmptyString ( function_name ) ) builder . AppendCString ( " ) " ) ; <nl> <nl> - RETURN_RESULT ( isolate_ , builder . Finish ( ) , String ) ; <nl> + return builder . Finish ( ) ; <nl> } <nl> <nl> FrameArrayIterator : : FrameArrayIterator ( Isolate * isolate , <nl> MaybeHandle < Object > ErrorUtils : : FormatStackTrace ( Isolate * isolate , <nl> } <nl> } <nl> <nl> - RETURN_RESULT ( isolate , builder . Finish ( ) , Object ) ; <nl> + return builder . Finish ( ) ; <nl> } <nl> <nl> Handle < String > MessageTemplate : : FormatMessage ( Isolate * isolate , <nl>
|
Remove RETURN_RESULT macro
|
v8/v8
|
6f7cbc23c070005967f2e829d11877925fd3bc70
|
2016-10-14T09:18:54Z
|
mmm a / libraries / chain / contracts / chain_initializer . cpp <nl> ppp b / libraries / chain / contracts / chain_initializer . cpp <nl> void chain_initializer : : register_types ( chain_controller & chain , chainbase : : datab <nl> SET_APP_HANDLER ( eosio , eosio , postrecovery , eosio ) ; <nl> SET_APP_HANDLER ( eosio , eosio , passrecovery , eosio ) ; <nl> SET_APP_HANDLER ( eosio , eosio , vetorecovery , eosio ) ; <nl> + SET_APP_HANDLER ( eosio , eosio , canceldelay , eosio ) ; <nl> + SET_APP_HANDLER ( eosio , eosio , mindelay , eosio ) ; <nl> } <nl> <nl> <nl> abi_def chain_initializer : : eos_contract_abi ( const abi_def & eosio_system_abi ) <nl> eos_abi . actions . push_back ( action_def { name ( " vetorecovery " ) , " vetorecovery " } ) ; <nl> eos_abi . actions . push_back ( action_def { name ( " onerror " ) , " onerror " } ) ; <nl> eos_abi . actions . push_back ( action_def { name ( " onblock " ) , " onblock " } ) ; <nl> + eos_abi . actions . push_back ( action_def { name ( " canceldelay " ) , " canceldelay " } ) ; <nl> + eos_abi . actions . push_back ( action_def { name ( " mindelay " ) , " mindelay " } ) ; <nl> <nl> / / ACTION PAYLOADS <nl> <nl> abi_def chain_initializer : : eos_contract_abi ( const abi_def & eosio_system_abi ) <nl> { " permission " , " permission_name " } , <nl> { " parent " , " permission_name " } , <nl> { " data " , " authority " } , <nl> + { " delay " , " uint32 " } <nl> } <nl> } ) ; <nl> <nl> abi_def chain_initializer : : eos_contract_abi ( const abi_def & eosio_system_abi ) <nl> } <nl> } ) ; <nl> <nl> + eos_abi . structs . emplace_back ( struct_def { <nl> + " canceldelay " , " " , { <nl> + { " sender_id " , " uint32 " } , <nl> + } <nl> + } ) ; <nl> + <nl> + eos_abi . structs . emplace_back ( struct_def { <nl> + " mindelay " , " " , { <nl> + { " delay " , " uint32 " } , <nl> + } <nl> + } ) ; <nl> + <nl> / / DATABASE RECORDS <nl> <nl> eos_abi . structs . emplace_back ( struct_def { <nl> mmm a / libraries / chain / contracts / eosio_contract . cpp <nl> ppp b / libraries / chain / contracts / eosio_contract . cpp <nl> <nl> # include < eosio / chain / account_object . hpp > <nl> # include < eosio / chain / permission_object . hpp > <nl> # include < eosio / chain / permission_link_object . hpp > <nl> + # include < eosio / chain / generated_transaction_object . hpp > <nl> # include < eosio / chain / global_property_object . hpp > <nl> # include < eosio / chain / contracts / types . hpp > <nl> # include < eosio / chain / producer_object . hpp > <nl> void apply_eosio_vetorecovery ( apply_context & context ) { <nl> context . console_append_formatted ( " Recovery for account $ { account } vetoed ! \ n " , mutable_variant_object ( ) ( " account " , account ) ) ; <nl> } <nl> <nl> + void apply_eosio_canceldelay ( apply_context & context ) { <nl> + auto cancel = context . act . data_as < canceldelay > ( ) ; <nl> + const auto sender_id = cancel . sender_id . convert_to < uint32_t > ( ) ; <nl> + const auto & generated_transaction_idx = context . controller . get_database ( ) . get_index < generated_transaction_multi_index > ( ) ; <nl> + const auto & generated_index = generated_transaction_idx . indices ( ) . get < by_sender_id > ( ) ; <nl> + const auto & itr = generated_index . lower_bound ( boost : : make_tuple ( config : : system_account_name , sender_id ) ) ; <nl> + FC_ASSERT ( itr = = generated_index . end ( ) | | itr - > sender ! = config : : system_account_name | | itr - > sender_id ! = sender_id , <nl> + " cannot cancel sender_id = $ { sid } , there is no deferred transaction with that sender_id " , ( " sid " , sender_id ) ) ; <nl> + <nl> + auto dtrx = fc : : raw : : unpack < deferred_transaction > ( itr - > packed_trx . data ( ) , itr - > packed_trx . size ( ) ) ; <nl> + set < account_name > accounts ; <nl> + for ( const auto & act : dtrx . actions ) { <nl> + for ( const auto & auth : act . authorization ) { <nl> + accounts . insert ( auth . actor ) ; <nl> + } <nl> + } <nl> + <nl> + bool found = false ; <nl> + for ( const auto & auth : context . act . authorization ) { <nl> + if ( auth . permission = = config : : active_name & & accounts . count ( auth . actor ) ) { <nl> + found = true ; <nl> + break ; <nl> + } <nl> + } <nl> + <nl> + FC_ASSERT ( found , " canceldelay action must be signed with the \ " active \ " permission for one of the actors " <nl> + " provided in the authorizations on the original transaction " ) ; <nl> + context . cancel_deferred ( sender_id ) ; <nl> + } <nl> + <nl> + void apply_eosio_mindelay ( apply_context & context ) { <nl> + / / all processing is performed in chain_controller : : check_authorization <nl> + } <nl> <nl> } } } / / namespace eosio : : chain : : contracts <nl> mmm a / libraries / chain / include / eosio / chain / contracts / eos_contract . hpp <nl> ppp b / libraries / chain / include / eosio / chain / contracts / eos_contract . hpp <nl> namespace eosio { namespace chain { namespace contracts { <nl> void apply_eosio_setabi ( apply_context & ) ; <nl> <nl> void apply_eosio_onerror ( apply_context & ) ; <nl> + <nl> + void apply_eosio_canceldelay ( apply_context & ) ; <nl> + void apply_eosio_mindelay ( apply_context & ) ; <nl> / / / @ } end action handlers <nl> <nl> } } } / / / namespace eosio : : contracts <nl> mmm a / libraries / chain / include / eosio / chain / contracts / types . hpp <nl> ppp b / libraries / chain / include / eosio / chain / contracts / types . hpp <nl> struct vetorecovery { <nl> } <nl> } ; <nl> <nl> + struct canceldelay { <nl> + uint32 sender_id ; <nl> + <nl> + static account_name get_account ( ) { <nl> + return config : : system_account_name ; <nl> + } <nl> + <nl> + static action_name get_name ( ) { <nl> + return N ( canceldelay ) ; <nl> + } <nl> + } ; <nl> + <nl> + struct mindelay { <nl> + uint32 delay ; <nl> + <nl> + static account_name get_account ( ) { <nl> + return config : : system_account_name ; <nl> + } <nl> + <nl> + static action_name get_name ( ) { <nl> + return N ( mindelay ) ; <nl> + } <nl> + } ; <nl> <nl> } } } / / / namespace eosio : : chain : : contracts <nl> <nl> FC_REFLECT ( eosio : : chain : : contracts : : unlinkauth , ( account <nl> FC_REFLECT ( eosio : : chain : : contracts : : postrecovery , ( account ) ( data ) ( memo ) ) <nl> FC_REFLECT ( eosio : : chain : : contracts : : passrecovery , ( account ) ) <nl> FC_REFLECT ( eosio : : chain : : contracts : : vetorecovery , ( account ) ) <nl> + FC_REFLECT ( eosio : : chain : : contracts : : canceldelay , ( sender_id ) ) <nl> + FC_REFLECT ( eosio : : chain : : contracts : : mindelay , ( delay ) ) <nl>
|
Added native canceldelay and mindelay actions . GH # 1022
|
EOSIO/eos
|
cec3306ee2368177d2dc6309140f911e23a511a7
|
2018-03-28T01:13:55Z
|
mmm a / atom / browser / common_web_contents_delegate . cc <nl> ppp b / atom / browser / common_web_contents_delegate . cc <nl> <nl> # include " base / files / file_util . h " <nl> # include " base / json / json_reader . h " <nl> # include " base / task / post_task . h " <nl> + # include " base / threading / scoped_blocking_call . h " <nl> # include " base / threading / sequenced_task_runner_handle . h " <nl> # include " chrome / browser / ssl / security_state_tab_helper . h " <nl> # include " chrome / browser / ui / browser_dialogs . h " <nl> std : : unique_ptr < base : : DictionaryValue > CreateFileSystemValue ( <nl> } <nl> <nl> void WriteToFile ( const base : : FilePath & path , const std : : string & content ) { <nl> - base : : AssertBlockingAllowed ( ) ; <nl> + base : : ScopedBlockingCall scoped_blocking_call ( base : : BlockingType : : WILL_BLOCK ) ; <nl> DCHECK ( ! path . empty ( ) ) ; <nl> <nl> base : : WriteFile ( path , content . data ( ) , content . size ( ) ) ; <nl> } <nl> <nl> void AppendToFile ( const base : : FilePath & path , const std : : string & content ) { <nl> - base : : AssertBlockingAllowed ( ) ; <nl> + base : : ScopedBlockingCall scoped_blocking_call ( base : : BlockingType : : WILL_BLOCK ) ; <nl> DCHECK ( ! path . empty ( ) ) ; <nl> <nl> base : : AppendToFile ( path , content . data ( ) , content . size ( ) ) ; <nl>
|
replace base : : AssertBlockingAllowed with base : : ScopedBlockingCall
|
electron/electron
|
96b26238873a362e404b31f249552eab599662a5
|
2019-01-22T18:32:04Z
|
mmm a / tensorflow / g3doc / api_docs / python / constant_op . md <nl> ppp b / tensorflow / g3doc / api_docs / python / constant_op . md <nl> Example : <nl> # # # # # Returns : <nl> <nl> <nl> - * < b > ` samples ` < / b > : a ` Tensor ` of shape ` tf . concat ( shape , tf . shape ( alpha + beta ) ) ` with <nl> - values of type ` dtype ` . <nl> + * < b > ` samples ` < / b > : a ` Tensor ` of shape ` tf . concat_v2 ( shape , tf . shape ( alpha + beta ) ) ` <nl> + with values of type ` dtype ` . <nl> <nl> <nl> - - - <nl> mmm a / tensorflow / g3doc / api_docs / python / control_flow_ops . md <nl> ppp b / tensorflow / g3doc / api_docs / python / control_flow_ops . md <nl> Example using shape_invariants : <nl> i0 = tf . constant ( 0 ) <nl> m0 = tf . ones ( [ 2 , 2 ] ) <nl> c = lambda i , m : i < 10 <nl> - b = lambda i , m : [ i + 1 , tf . concat ( 0 , [ m , m ] ) ] <nl> + b = lambda i , m : [ i + 1 , tf . concat_v2 ( 0 , [ m , m ] ) ] <nl> tf . while_loop ( <nl> c , b , loop_vars = [ i0 , m0 ] , <nl> shape_invariants = [ i0 . get_shape ( ) , tensor_shape . TensorShape ( [ None , 2 ] ) ] ) <nl> mmm a / tensorflow / g3doc / api_docs / python / functions_and_classes / shard3 / tf . random_gamma . md <nl> ppp b / tensorflow / g3doc / api_docs / python / functions_and_classes / shard3 / tf . random_gamma . md <nl> Example : <nl> # # # # # Returns : <nl> <nl> <nl> - * < b > ` samples ` < / b > : a ` Tensor ` of shape ` tf . concat ( shape , tf . shape ( alpha + beta ) ) ` with <nl> - values of type ` dtype ` . <nl> + * < b > ` samples ` < / b > : a ` Tensor ` of shape ` tf . concat_v2 ( shape , tf . shape ( alpha + beta ) ) ` <nl> + with values of type ` dtype ` . <nl> <nl> mmm a / tensorflow / g3doc / api_docs / python / functions_and_classes / shard4 / tf . while_loop . md <nl> ppp b / tensorflow / g3doc / api_docs / python / functions_and_classes / shard4 / tf . while_loop . md <nl> Example using shape_invariants : <nl> i0 = tf . constant ( 0 ) <nl> m0 = tf . ones ( [ 2 , 2 ] ) <nl> c = lambda i , m : i < 10 <nl> - b = lambda i , m : [ i + 1 , tf . concat ( 0 , [ m , m ] ) ] <nl> + b = lambda i , m : [ i + 1 , tf . concat_v2 ( 0 , [ m , m ] ) ] <nl> tf . while_loop ( <nl> c , b , loop_vars = [ i0 , m0 ] , <nl> shape_invariants = [ i0 . get_shape ( ) , tensor_shape . TensorShape ( [ None , 2 ] ) ] ) <nl> mmm a / tensorflow / g3doc / api_docs / python / functions_and_classes / shard8 / tf . nn . bidirectional_dynamic_rnn . md <nl> ppp b / tensorflow / g3doc / api_docs / python / functions_and_classes / shard8 / tf . nn . bidirectional_dynamic_rnn . md <nl> given . <nl> It returns a tuple instead of a single concatenated ` Tensor ` , unlike <nl> in the ` bidirectional_rnn ` . If the concatenated one is preferred , <nl> the forward and backward outputs can be concatenated as <nl> - ` tf . concat ( 2 , outputs ) ` . <nl> + ` tf . concat_v2 ( outputs , 2 ) ` . <nl> * < b > ` output_states ` < / b > : A tuple ( output_state_fw , output_state_bw ) containing <nl> the forward and the backward final states of bidirectional rnn . <nl> <nl> mmm a / tensorflow / g3doc / api_docs / python / nn . md <nl> ppp b / tensorflow / g3doc / api_docs / python / nn . md <nl> given . <nl> It returns a tuple instead of a single concatenated ` Tensor ` , unlike <nl> in the ` bidirectional_rnn ` . If the concatenated one is preferred , <nl> the forward and backward outputs can be concatenated as <nl> - ` tf . concat ( 2 , outputs ) ` . <nl> + ` tf . concat_v2 ( outputs , 2 ) ` . <nl> * < b > ` output_states ` < / b > : A tuple ( output_state_fw , output_state_bw ) containing <nl> the forward and the backward final states of bidirectional rnn . <nl> <nl>
|
Update generated Python Op docs .
|
tensorflow/tensorflow
|
3d9d014cdba1c455494a7cb6d4fd2d56b6503cb7
|
2016-12-07T03:04:00Z
|
mmm a / js / apps / system / _admin / aardvark / APP / frontend / build / app . min . js <nl> ppp b / js / apps / system / _admin / aardvark / APP / frontend / build / app . min . js <nl> desc : ! 1 } , url : arangoHelper . databaseUrl ( " / _api / database " ) , comparator : function ( a , b ) <nl> b ! = = a . searchPhrase & & ( a . searchPhrase = b , this . render ( ) ) } , resetSearch : function ( ) { this . searchTimeout & & ( clearTimeout ( this . searchTimeout ) , this . searchTimeout = null ) ; var a = this . collection . searchOptions ; a . searchPhrase = null } , restrictToSearchPhraseKey : function ( ) { var a = this ; this . resetSearch ( ) , a . searchTimeout = setTimeout ( function ( ) { a . search ( ) } , 200 ) } , restrictToSearchPhrase : function ( ) { this . resetSearch ( ) , this . search ( ) } , createCollection : function ( a ) { a . preventDefault ( ) , this . createNewCollectionModal ( ) } , submitCreateCollection : function ( ) { var a = function ( a , b ) { if ( a ) arangoHelper . arangoError ( " DB " , " Could not check coordinator state " ) ; else { var c = $ ( " # new - collection - name " ) . val ( ) , d = $ ( " # new - collection - size " ) . val ( ) , e = $ ( " # new - replication - factor " ) . val ( ) , f = $ ( " # new - collection - type " ) . val ( ) , g = $ ( " # new - collection - sync " ) . val ( ) , h = 1 , i = [ ] ; if ( " " = = = e & & ( e = 1 ) , b ) { if ( h = $ ( " # new - collection - shards " ) . val ( ) , " " = = = h & & ( h = 1 ) , h = parseInt ( h , 10 ) , h < 1 ) return arangoHelper . arangoError ( " Number of shards has to be an integer value greater or equal 1 " ) , 0 ; i = _ . pluck ( $ ( " # new - collection - shardBy " ) . select2 ( " data " ) , " text " ) , 0 = = = i . length & & i . push ( " _key " ) } if ( " _ " = = = c . substr ( 0 , 1 ) ) return arangoHelper . arangoError ( ' No " _ " allowed as first character ! ' ) , 0 ; var j = ! 1 , k = " true " = = = g ; if ( d > 0 ) try { d = 1024 * JSON . parse ( d ) * 1024 } catch ( l ) { return arangoHelper . arangoError ( " Please enter a valid number " ) , 0 } if ( " " = = = c ) return arangoHelper . arangoError ( " No collection name entered ! " ) , 0 ; var m = function ( a , b ) { if ( a ) try { b = JSON . parse ( b . responseText ) , arangoHelper . arangoError ( " Error " , b . errorMessage ) } catch ( c ) { } else this . updateCollectionsView ( ) ; window . modalView . hide ( ) } . bind ( this ) ; this . collection . newCollection ( { collName : c , wfs : k , isSystem : j , journalSize : d , replicationFactor : e , collType : f , shards : h , shardBy : i } , m ) } } . bind ( this ) ; window . isCoordinator ( a ) } , createNewCollectionModal : function ( ) { var a = function ( a , b ) { if ( a ) arangoHelper . arangoError ( " DB " , " Could not check coordinator state " ) ; else { var c = [ ] , d = [ ] , e = { } , f = [ ] ; d . push ( window . modalView . createTextEntry ( " new - collection - name " , " Name " , " " , ! 1 , " " , ! 0 , [ { rule : Joi . string ( ) . regex ( / ^ [ a - zA - Z ] / ) , msg : " Collection name must always start with a letter . " } , { rule : Joi . string ( ) . regex ( / ^ [ a - zA - Z0 - 9 \ - _ ] * $ / ) , msg : ' Only symbols , " _ " and " - " are allowed . ' } , { rule : Joi . string ( ) . required ( ) , msg : " No collection name given . " } ] ) ) , d . push ( window . modalView . createSelectEntry ( " new - collection - type " , " Type " , " " , " The type of the collection to create . " , [ { value : 2 , label : " Document " } , { value : 3 , label : " Edge " } ] ) ) , b & & ( d . push ( window . modalView . createTextEntry ( " new - collection - shards " , " Shards " , " " , " The number of shards to create . You cannot change this afterwards . Recommended : DBServers squared " , " " , ! 0 ) ) , d . push ( window . modalView . createSelect2Entry ( " new - collection - shardBy " , " shardBy " , " " , " The keys used to distribute documents on shards . Type the key and press return to add it . " , " _key " , ! 1 ) ) ) , c . push ( window . modalView . createSuccessButton ( " Save " , this . submitCreateCollection . bind ( this ) ) ) , f . push ( window . modalView . createTextEntry ( " new - collection - size " , " Journal size " , " " , " The maximal size of a journal or datafile ( in MB ) . Must be at least 1 . " , " " , ! 1 , [ { rule : Joi . string ( ) . allow ( " " ) . optional ( ) . regex ( / ^ [ 0 - 9 ] * $ / ) , msg : " Must be a number . " } ] ) ) , window . App . isCluster & & f . push ( window . modalView . createTextEntry ( " new - replication - factor " , " Replication factor " , " " , " Numeric value . Must be at least 1 . Total number of copies of the data in the cluster " , " " , ! 1 , [ { rule : Joi . string ( ) . allow ( " " ) . optional ( ) . regex ( / ^ [ 0 - 9 ] * $ / ) , msg : " Must be a number . " } ] ) ) , f . push ( window . modalView . createSelectEntry ( " new - collection - sync " , " Wait for sync " , " " , " Synchronize to disk before returning from a create or update of a document . " , [ { value : ! 1 , label : " No " } , { value : ! 0 , label : " Yes " } ] ) ) , e . header = " Advanced " , e . content = f , window . modalView . show ( " modalTable . ejs " , " New Collection " , c , d , e ) , $ ( " # s2id_new - collection - shardBy . select2 - search - field input " ) . on ( " focusout " , function ( a ) { $ ( " . select2 - drop " ) . is ( " : visible " ) & & ( $ ( " # select2 - search - field input " ) . is ( " : focus " ) | | window . setTimeout ( function ( ) { $ ( a . currentTarget ) . parent ( ) . parent ( ) . parent ( ) . select2 ( " close " ) } , 200 ) ) } ) } } . bind ( this ) ; window . isCoordinator ( a ) } } ) } ( ) , function ( ) { " use strict " ; function a ( a , b ) { return void 0 ! = = a & & null ! = = a | | ( a = 0 ) , a . toFixed ( b ) } window . DashboardView = Backbone . View . extend ( { el : " # content " , interval : 1e4 , defaultTimeFrame : 12e5 , defaultDetailFrame : 1728e5 , history : { } , graphs : { } , events : { " click . subViewNavbar . subMenuEntry " : " toggleViews " } , tendencies : { asyncPerSecondCurrent : [ " asyncPerSecondCurrent " , " asyncPerSecondPercentChange " ] , syncPerSecondCurrent : [ " syncPerSecondCurrent " , " syncPerSecondPercentChange " ] , clientConnectionsCurrent : [ " clientConnectionsCurrent " , " clientConnectionsPercentChange " ] , clientConnectionsAverage : [ " clientConnections15M " , " clientConnections15MPercentChange " ] , numberOfThreadsCurrent : [ " numberOfThreadsCurrent " , " numberOfThreadsPercentChange " ] , numberOfThreadsAverage : [ " numberOfThreads15M " , " numberOfThreads15MPercentChange " ] , virtualSizeCurrent : [ " virtualSizeCurrent " , " virtualSizePercentChange " ] , virtualSizeAverage : [ " virtualSize15M " , " virtualSize15MPercentChange " ] } , barCharts : { totalTimeDistribution : [ " queueTimeDistributionPercent " , " requestTimeDistributionPercent " ] , dataTransferDistribution : [ " bytesSentDistributionPercent " , " bytesReceivedDistributionPercent " ] } , barChartsElementNames : { queueTimeDistributionPercent : " Queue " , requestTimeDistributionPercent : " Computation " , bytesSentDistributionPercent : " Bytes sent " , bytesReceivedDistributionPercent : " Bytes received " } , getDetailFigure : function ( a ) { var b = $ ( a . currentTarget ) . attr ( " id " ) . replace ( / ChartButton / g , " " ) ; return b } , showDetail : function ( a ) { var b , c = this , d = this . getDetailFigure ( a ) ; b = this . dygraphConfig . getDetailChartConfig ( d ) , this . getHistoryStatistics ( d ) , this . detailGraphFigure = d , window . modalView . hideFooter = ! 0 , window . modalView . hide ( ) , window . modalView . show ( " modalGraph . ejs " , b . header , void 0 , void 0 , void 0 , void 0 , this . events ) , window . modalView . hideFooter = ! 1 , $ ( " # modal - dialog " ) . on ( " hidden " , function ( ) { c . hidden ( ) } ) , $ ( " # modal - dialog " ) . toggleClass ( " modal - chart - detail " , ! 0 ) , b . height = . 7 * $ ( window ) . height ( ) , b . width = $ ( " . modal - inner - detail " ) . width ( ) , b . labelsDiv = $ ( b . labelsDiv ) [ 0 ] , this . detailGraph = new Dygraph ( document . getElementById ( " lineChartDetail " ) , this . history [ this . server ] [ d ] , b ) } , hidden : function ( ) { this . detailGraph . destroy ( ) , delete this . detailGraph , delete this . detailGraphFigure } , getCurrentSize : function ( a ) { " # " ! = = a . substr ( 0 , 1 ) & & ( a = " # " + a ) ; var b , c ; return $ ( a ) . attr ( " style " , " " ) , b = $ ( a ) . height ( ) , c = $ ( a ) . width ( ) , { height : b , width : c } } , prepareDygraphs : function ( ) { var a , b = this ; this . dygraphConfig . getDashBoardFigures ( ) . forEach ( function ( c ) { a = b . dygraphConfig . getDefaultConfig ( c ) ; var d = b . getCurrentSize ( a . div ) ; a . height = d . height , a . width = d . width , b . graphs [ c ] = new Dygraph ( document . getElementById ( a . div ) , b . history [ b . server ] [ c ] | | [ ] , a ) } ) } , initialize : function ( a ) { this . options = a , this . dygraphConfig = a . dygraphConfig , this . d3NotInitialized = ! 0 , this . events [ " click . dashboard - sub - bar - menu - sign " ] = this . showDetail . bind ( this ) , this . events [ " mousedown . dygraph - rangesel - zoomhandle " ] = this . stopUpdating . bind ( this ) , this . events [ " mouseup . dygraph - rangesel - zoomhandle " ] = this . startUpdating . bind ( this ) , this . serverInfo = a . serverToShow , this . serverInfo ? this . server = this . serverInfo . target : this . server = " - local - " , this . history [ this . server ] = { } } , toggleViews : function ( a ) { var b = a . currentTarget . id . split ( " - " ) [ 0 ] , c = this , d = [ " replication " , " requests " , " system " ] ; _ . each ( d , function ( a ) { b ! = = a ? $ ( " # " + a ) . hide ( ) : ( $ ( " # " + a ) . show ( ) , c . resize ( ) , $ ( window ) . resize ( ) ) } ) , $ ( " . subMenuEntries " ) . children ( ) . removeClass ( " active " ) , $ ( " # " + b + " - statistics " ) . addClass ( " active " ) , window . setTimeout ( function ( ) { c . resize ( ) , $ ( window ) . resize ( ) } , 200 ) } , updateCharts : function ( ) { var a = this ; return this . detailGraph ? void this . updateLineChart ( this . detailGraphFigure , ! 0 ) : ( this . prepareD3Charts ( this . isUpdating ) , this . prepareResidentSize ( this . isUpdating ) , this . updateTendencies ( ) , void Object . keys ( this . graphs ) . forEach ( function ( b ) { a . updateLineChart ( b , ! 1 ) } ) ) } , updateTendencies : function ( ) { var a = this , b = this . tendencies , c = " " ; Object . keys ( b ) . forEach ( function ( b ) { var d = " " , e = 0 ; a . history . hasOwnProperty ( a . server ) & & a . history [ a . server ] . hasOwnProperty ( b ) & & ( e = a . history [ a . server ] [ b ] [ 1 ] ) , e < 0 ? c = " # d05448 " : ( c = " # 77DB99 " , d = " + " ) , a . history . hasOwnProperty ( a . server ) & & a . history [ a . server ] . hasOwnProperty ( b ) ? $ ( " # " + b ) . html ( a . history [ a . server ] [ b ] [ 0 ] + ' < br / > < span class = " dashboard - figurePer " style = " color : ' + c + ' ; " > ' + d + e + " % < / span > " ) : $ ( " # " + b ) . html ( ' < br / > < span class = " dashboard - figurePer " style = " color : # 000 ; " > < p class = " dataNotReadyYet " > data not ready yet < / p > < / span > ' ) } ) } , updateDateWindow : function ( a , b ) { var c , d , e = ( new Date ) . getTime ( ) ; return b & & a . dateWindow_ ? ( c = a . dateWindow_ [ 0 ] , d = e - a . dateWindow_ [ 1 ] - 5 * this . interval > 0 ? a . dateWindow_ [ 1 ] : e , [ c , d ] ) : [ e - this . defaultTimeFrame , e ] } , updateLineChart : function ( a , b ) { var c = b ? this . detailGraph : this . graphs [ a ] , d = { file : this . history [ this . server ] [ a ] , dateWindow : this . updateDateWindow ( c , b ) } , e = 0 , f = [ ] ; _ . each ( d . file , function ( a ) { var b = a [ 0 ] . getSeconds ( ) - a [ 0 ] . getSeconds ( ) % 10 ; d . file [ e ] [ 0 ] . setSeconds ( b ) , f . push ( d . file [ e ] [ 0 ] ) , e + + } ) ; for ( var g = new Date ( Math . max . apply ( null , f ) ) , h = new Date ( Math . min . apply ( null , f ) ) , i = new Date ( h . getTime ( ) ) , j = [ ] , k = [ ] ; i < g ; ) i = new Date ( i . setSeconds ( i . getSeconds ( ) + 10 ) ) , k . push ( i ) ; _ . each ( k , function ( a ) { var b = ! 1 ; _ . each ( d . file , function ( c ) { Math . floor ( a . getTime ( ) / 1e3 ) = = = Math . floor ( c [ 0 ] . getTime ( ) / 1e3 ) & & ( b = ! 0 ) } ) , b = = = ! 1 & & a < new Date & & j . push ( a ) } ) , _ . each ( j , function ( b ) { " systemUserTime " ! = = a & & " requests " ! = = a & & " pageFaults " ! = = a & & " dataTransfer " ! = = a | | d . file . push ( [ b , 0 , 0 ] ) , " totalTime " = = = a & & d . file . push ( [ b , 0 , 0 , 0 ] ) } ) , void 0 = = = d . file ? ( $ ( " # loadingScreen span " ) . text ( " Statistics not ready yet . Waiting . " ) , " # dashboard " ! = = window . location . hash & & " " ! = = window . location . hash & & " # " ! = = window . location . hash | | ( $ ( " # loadingScreen " ) . show ( ) , $ ( " # content " ) . hide ( ) ) ) : ( $ ( " # content " ) . show ( ) , $ ( " # loadingScreen " ) . hide ( ) , d . file . sort ( function ( a , b ) { return new Date ( b [ 0 ] ) - new Date ( a [ 0 ] ) } ) , c . updateOptions ( d ) ) , $ ( window ) . trigger ( " resize " ) , this . resize ( ) } , mergeDygraphHistory : function ( a , b ) { var c , d = this ; this . dygraphConfig . getDashBoardFigures ( ! 0 ) . forEach ( function ( e ) { if ( d . dygraphConfig . mapStatToFigure [ e ] & & ( d . history [ d . server ] [ e ] | | ( d . history [ d . server ] [ e ] = [ ] ) , c = [ ] , d . dygraphConfig . mapStatToFigure [ e ] . forEach ( function ( d ) { a [ d ] & & ( " times " = = = d ? c . push ( new Date ( 1e3 * a [ d ] [ b ] ) ) : c . push ( a [ d ] [ b ] ) ) } ) , c . length > 1 ) ) { var f = 0 , g = 0 ; 9 = = = c . length & & ( f + = c [ 1 ] , f + = c [ 6 ] , f + = c [ 7 ] , f + = c [ 8 ] , g + = c [ 2 ] , g + = c [ 3 ] , g + = c [ 4 ] , g + = c [ 5 ] , c = [ c [ 0 ] , f , g ] ) , d . history [ d . server ] [ e ] . unshift ( c ) } } ) } , cutOffHistory : function ( a , b ) { for ( var c = this , d = c . history [ c . server ] [ a ] ; 0 ! = = d . length & & ! ( d [ d . length - 1 ] [ 0 ] > = b ) ; ) d . pop ( ) } , cutOffDygraphHistory : function ( a ) { var b = this , c = new Date ( a ) ; this . dygraphConfig . getDashBoardFigures ( ! 0 ) . forEach ( function ( a ) { b . dygraphConfig . mapStatToFigure [ a ] & & b . history [ b . server ] [ a ] & & b . cutOffHistory ( a , c ) } ) } , mergeHistory : function ( b ) { var c , d = this ; for ( c = 0 ; c < b . times . length ; + + c ) this . mergeDygraphHistory ( b , c ) ; this . cutOffDygraphHistory ( ( new Date ) . getTime ( ) - this . defaultTimeFrame ) , Object . keys ( this . tendencies ) . forEach ( function ( c ) { var e = 1 , f = 1 ; " virtualSizeCurrent " = = = c | | " virtualSizeAverage " = = = c ? ( b [ d . tendencies [ c ] [ 0 ] ] / = 1073741824 , e = 2 ) : " clientConnectionsCurrent " = = = c ? e = 0 : " numberOfThreadsCurrent " = = = c & & ( e = 0 ) , d . history [ d . server ] [ c ] = [ a ( b [ d . tendencies [ c ] [ 0 ] ] , e ) , a ( 100 * b [ d . tendencies [ c ] [ 1 ] ] , f ) ] } ) , Object . keys ( this . barCharts ) . forEach ( function ( a ) { d . history [ d . server ] [ a ] = d . mergeBarChartData ( d . barCharts [ a ] , b ) } ) , d . history [ d . server ] . physicalMemory = b . physicalMemory , d . history [ d . server ] . residentSizeCurrent = b . residentSizeCurrent , d . history [ d . server ] . residentSizePercent = b . residentSizePercent , d . history [ d . server ] . residentSizeChart = [ { key : " " , color : this . dygraphConfig . colors [ 1 ] , values : [ { label : " used " , value : 100 * b . residentSizePercent } ] } , { key : " " , color : this . dygraphConfig . colors [ 2 ] , values : [ { label : " used " , value : 100 - 100 * b . residentSizePercent } ] } ] , this . nextStart = b . nextStart } , mergeBarChartData : function ( a , b ) { var c , d = { key : this . barChartsElementNames [ a [ 0 ] ] , color : this . dygraphConfig . colors [ 1 ] , values : [ ] } , e = { key : this . barChartsElementNames [ a [ 1 ] ] , color : this . dygraphConfig . colors [ 2 ] , values : [ ] } ; for ( c = b [ a [ 0 ] ] . values . length - 1 ; c > = 0 ; - - c ) d . values . push ( { label : this . getLabel ( b [ a [ 0 ] ] . cuts , c ) , value : b [ a [ 0 ] ] . values [ c ] } ) , e . values . push ( { label : this . getLabel ( b [ a [ 1 ] ] . cuts , c ) , value : b [ a [ 1 ] ] . values [ c ] } ) ; return [ d , e ] } , getLabel : function ( a , b ) { return a [ b ] ? 0 = = = b ? " 0 - " + a [ b ] : a [ b - 1 ] + " - " + a [ b ] : " > " + a [ b - 1 ] } , renderReplicationStatistics : function ( a ) { $ ( " # repl - numbers table tr : nth - child ( 1 ) > td : nth - child ( 2 ) " ) . html ( a . state . totalEvents ) , $ ( " # repl - numbers table tr : nth - child ( 2 ) > td : nth - child ( 2 ) " ) . html ( a . state . totalRequests ) , $ ( " # repl - numbers table tr : nth - child ( 3 ) > td : nth - child ( 2 ) " ) . html ( a . state . totalFailedConnects ) , a . state . lastAppliedContinuousTick ? $ ( " # repl - ticks table tr : nth - child ( 1 ) > td : nth - child ( 2 ) " ) . html ( a . state . lastAppliedContinuousTick ) : $ ( " # repl - ticks table tr : nth - child ( 1 ) > td : nth - child ( 2 ) " ) . html ( " no data available " ) . addClass ( " no - data " ) , a . state . lastProcessedContinuousTick ? $ ( " # repl - ticks table tr : nth - child ( 2 ) > td : nth - child ( 2 ) " ) . html ( a . state . lastProcessedContinuousTick ) : $ ( " # repl - ticks table tr : nth - child ( 2 ) > td : nth - child ( 2 ) " ) . html ( " no data available " ) . addClass ( " no - data " ) , a . state . lastAvailableContinuousTick ? $ ( " # repl - ticks table tr : nth - child ( 3 ) > td : nth - child ( 2 ) " ) . html ( a . state . lastAvailableContinuousTick ) : $ ( " # repl - ticks table tr : nth - child ( 3 ) > td : nth - child ( 2 ) " ) . html ( " no data available " ) . addClass ( " no - data " ) , $ ( " # repl - progress table tr : nth - child ( 1 ) > td : nth - child ( 2 ) " ) . html ( a . state . progress . message ) , $ ( " # repl - progress table tr : nth - child ( 2 ) > td : nth - child ( 2 ) " ) . html ( a . state . progress . time ) , $ ( " # repl - progress table tr : nth - child ( 3 ) > td : nth - child ( 2 ) " ) . html ( a . state . progress . failedConnects ) } , getReplicationStatistics : function ( ) { var a = this ; $ . ajax ( arangoHelper . databaseUrl ( " / _api / replication / applier - state " ) , { async : ! 0 } ) . done ( function ( b ) { if ( b . hasOwnProperty ( " state " ) ) { var c ; c = b . state . running ? " active " : " inactive " , c = ' < span class = " state " > ' + c + " < / span > " , $ ( " # replication - chart . dashboard - sub - bar " ) . html ( " Replication " + c ) , a . renderReplicationStatistics ( b ) } } ) } , getStatistics : function ( a , b ) { var c = this , d = arangoHelper . databaseUrl ( " / _admin / aardvark / statistics / short " , " _system " ) , e = " ? start = " ; e + = c . nextStart ? c . nextStart : ( ( new Date ) . getTime ( ) - c . defaultTimeFrame ) / 1e3 , " - local - " ! = = c . server & & ( e + = " & type = short & DBserver = " + c . serverInfo . target , c . history . hasOwnProperty ( c . server ) | | ( c . history [ c . server ] = { } ) ) , $ . ajax ( d + e , { async : ! 0 , xhrFields : { withCredentials : ! 0 } , crossDomain : ! 0 } ) . done ( function ( d ) { d . times . length > 0 & & ( c . isUpdating = ! 0 , c . mergeHistory ( d ) ) , c . isUpdating ! = = ! 1 & & ( a & & a ( d . enabled , b ) , c . updateCharts ( ) ) } ) . error ( function ( a ) { console . log ( " stat fetch req error : " + a ) } ) , this . getReplicationStatistics ( ) } , getHistoryStatistics : function ( a ) { var b = this , c = " statistics / long " , d = " ? filter = " + this . dygraphConfig . mapStatToFigure [ a ] . join ( ) ; " - local - " ! = = b . server & & ( c = b . server . endpoint + arangoHelper . databaseUrl ( " / _admin / aardvark / statistics / cluster " ) , d + = " & type = long & DBserver = " + b . server . target , b . history . hasOwnProperty ( b . server ) | | ( b . history [ b . server ] = { } ) ) ; var e = window . location . href . split ( " / " ) , f = e [ 0 ] + " / / " + e [ 2 ] + " / " + e [ 3 ] + " / _system / " + e [ 5 ] + " / " + e [ 6 ] + " / " ; $ . ajax ( f + c + d , { async : ! 0 } ) . done ( function ( c ) { var d ; for ( b . history [ b . server ] [ a ] = [ ] , d = 0 ; d < c . times . length ; + + d ) b . mergeDygraphHistory ( c , d , ! 0 ) } ) } , addEmptyDataLabels : function ( ) { 0 = = = $ ( " . dataNotReadyYet " ) . length & & ( $ ( " # dataTransferDistribution " ) . prepend ( ' < p class = " dataNotReadyYet " > data not ready yet < / p > ' ) , $ ( " # totalTimeDistribution " ) . prepend ( ' < p class = " dataNotReadyYet " > data not ready yet < / p > ' ) , $ ( " . dashboard - bar - chart - title " ) . append ( ' < p class = " dataNotReadyYet " > data not ready yet < / p > ' ) ) } , removeEmptyDataLabels : function ( ) { $ ( " . dataNotReadyYet " ) . remove ( ) } , prepareResidentSize : function ( b ) { var c = this , d = this . getCurrentSize ( " # residentSizeChartContainer " ) , e = c . history [ c . server ] . residentSizeCurrent / 1024 / 1024 , f = " " ; f = e < 1025 ? a ( e , 2 ) + " MB " : a ( e / 1024 , 2 ) + " GB " ; var g = a ( 100 * c . history [ c . server ] . residentSizePercent , 2 ) , h = [ a ( c . history [ c . server ] . physicalMemory / 1024 / 1024 / 1024 , 0 ) + " GB " ] ; return void 0 = = = c . history [ c . server ] . residentSizeChart ? void this . addEmptyDataLabels ( ) : ( this . removeEmptyDataLabels ( ) , void nv . addGraph ( function ( ) { var a = nv . models . multiBarHorizontalChart ( ) . x ( function ( a ) { return a . label } ) . y ( function ( a ) { return a . value } ) . width ( d . width ) . height ( d . height ) . margin ( { top : ( $ ( " residentSizeChartContainer " ) . outerHeight ( ) - $ ( " residentSizeChartContainer " ) . height ( ) ) / 2 , right : 1 , bottom : ( $ ( " residentSizeChartContainer " ) . outerHeight ( ) - $ ( " residentSizeChartContainer " ) . height ( ) ) / 2 , left : 1 } ) . showValues ( ! 1 ) . showYAxis ( ! 1 ) . showXAxis ( ! 1 ) . showLegend ( ! 1 ) . showControls ( ! 1 ) . stacked ( ! 0 ) ; return a . yAxis . tickFormat ( function ( a ) { return a + " % " } ) . showMaxMin ( ! 1 ) , a . xAxis . showMaxMin ( ! 1 ) , d3 . select ( " # residentSizeChart svg " ) . datum ( c . history [ c . server ] . residentSizeChart ) . call ( a ) , d3 . select ( " # residentSizeChart svg " ) . select ( " . nv - zeroLine " ) . remove ( ) , b & & ( d3 . select ( " # residentSizeChart svg " ) . select ( " # total " ) . remove ( ) , d3 . select ( " # residentSizeChart svg " ) . select ( " # percentage " ) . remove ( ) ) , d3 . select ( " . dashboard - bar - chart - title . percentage " ) . html ( f + " ( " + g + " % ) " ) , d3 . select ( " . dashboard - bar - chart - title . absolut " ) . html ( h [ 0 ] ) , nv . utils . windowResize ( a . update ) , a } , function ( ) { d3 . selectAll ( " # residentSizeChart . nv - bar " ) . on ( " click " , function ( ) { } ) } ) ) } , prepareD3Charts : function ( b ) { var c = this , d = { totalTimeDistribution : [ " queueTimeDistributionPercent " , " requestTimeDistributionPercent " ] , dataTransferDistribution : [ " bytesSentDistributionPercent " , " bytesReceivedDistributionPercent " ] } ; this . d3NotInitialized & & ( b = ! 1 , this . d3NotInitialized = ! 1 ) , _ . each ( Object . keys ( d ) , function ( b ) { var d = c . getCurrentSize ( " # " + b + " Container . dashboard - interior - chart " ) , e = " # " + b + " Container svg " ; return void 0 = = = c . history [ c . server ] . residentSizeChart ? void c . addEmptyDataLabels ( ) : ( c . removeEmptyDataLabels ( ) , void nv . addGraph ( function ( ) { var f = [ 0 , . 25 , . 5 , . 75 , 1 ] , g = 75 , h = 23 , i = 6 ; d . width < 219 ? ( f = [ 0 , . 5 , 1 ] , g = 72 , h = 21 , i = 5 ) : d . width < 299 ? ( f = [ 0 , . 3334 , . 6667 , 1 ] , g = 77 ) : d . width < 379 ? g = 87 : d . width < 459 ? g = 95 : d . width < 539 ? g = 100 : d . width < 619 & & ( g = 105 ) ; var j = nv . models . multiBarHorizontalChart ( ) . x ( function ( a ) { return a . label } ) . y ( function ( a ) { return a . value } ) . width ( d . width ) . height ( d . height ) . margin ( { top : 5 , right : 20 , bottom : h , left : g } ) . showValues ( ! 1 ) . showYAxis ( ! 0 ) . showXAxis ( ! 0 ) . showLegend ( ! 1 ) . showControls ( ! 1 ) . forceY ( [ 0 , 1 ] ) ; return j . yAxis . showMaxMin ( ! 1 ) , d3 . select ( " . nv - y . nv - axis " ) . selectAll ( " text " ) . attr ( " transform " , " translate ( 0 , " + i + " ) " ) , j . yAxis . tickValues ( f ) . tickFormat ( function ( b ) { return a ( 100 * b * 100 / 100 , 0 ) + " % " } ) , d3 . select ( e ) . datum ( c . history [ c . server ] [ b ] ) . call ( j ) , nv . utils . windowResize ( j . update ) , j } , function ( ) { d3 . selectAll ( e + " . nv - bar " ) . on ( " click " , function ( ) { } ) } ) ) } ) } , stopUpdating : function ( ) { this . isUpdating = ! 1 } , startUpdating : function ( ) { var a = this ; a . timer | | ( a . timer = window . setInterval ( function ( ) { window . App . isCluster ? window . location . hash . indexOf ( a . serverInfo . target ) > - 1 & & a . getStatistics ( ) : a . getStatistics ( ) } , a . interval ) ) } , resize : function ( ) { if ( this . isUpdating ) { var a , b = this ; _ . each ( this . graphs , function ( c ) { a = b . getCurrentSize ( c . maindiv_ . id ) , c . resize ( a . width , a . height ) } ) , this . detailGraph & & ( a = this . getCurrentSize ( this . detailGraph . maindiv_ . id ) , this . detailGraph . resize ( a . width , a . height ) ) , this . prepareD3Charts ( ! 0 ) , this . prepareResidentSize ( ! 0 ) } } , template : templateEngine . createTemplate ( " dashboardView . ejs " ) , render : function ( a ) { var b = function ( a , b ) { return b | | $ ( this . el ) . html ( this . template . render ( ) ) , a & & " _system " = = = frontendConfig . db ? ( this . prepareDygraphs ( ) , this . isUpdating & & ( this . prepareD3Charts ( ) , this . prepareResidentSize ( ) , this . updateTendencies ( ) , $ ( window ) . trigger ( " resize " ) ) , this . startUpdating ( ) , void $ ( window ) . resize ( ) ) : ( $ ( this . el ) . html ( " " ) , void ( this . server ? $ ( this . el ) . append ( ' < div style = " color : red " > Server statistics ( ' + this . server + " ) are disabled . < / div > " ) : $ ( this . el ) . append ( ' < div style = " color : red " > Server statistics are disabled . < / div > ' ) ) ) } . bind ( this ) , c = function ( ) { $ ( this . el ) . html ( " " ) , $ ( " . contentDiv " ) . remove ( ) , $ ( " . headerBar " ) . remove ( ) , $ ( " . dashboard - headerbar " ) . remove ( ) , $ ( " . dashboard - row " ) . remove ( ) , $ ( this . el ) . append ( ' < div style = " color : red " > You do not have permission to view this page . < / div > ' ) , $ ( this . el ) . append ( " < div style = \ " color : red \ " > You can switch to ' _system ' to see the dashboard . < / div > " ) } . bind ( this ) ; if ( " _system " ! = = frontendConfig . db ) return void c ( ) ; var d = function ( d , e ) { d | | ( e ? this . getStatistics ( b , a ) : c ( ) ) } . bind ( this ) ; void 0 = = = window . App . currentDB . get ( " name " ) ? window . setTimeout ( function ( ) { return " _system " ! = = window . App . currentDB . get ( " name " ) ? void c ( ) : void this . options . database . hasSystemAccess ( d ) } . bind ( this ) , 300 ) : this . options . database . hasSystemAccess ( d ) } } ) } ( ) , function ( ) { " use strict " ; window . DatabaseView = Backbone . View . extend ( { users : null , el : " # content " , template : templateEngine . createTemplate ( " databaseView . ejs " ) , dropdownVisible : ! 1 , currentDB : " " , events : { " click # createDatabase " : " createDatabase " , " click # submitCreateDatabase " : " submitCreateDatabase " , " click . editDatabase " : " editDatabase " , " click # userManagementView . icon " : " editDatabase " , " click # selectDatabase " : " updateDatabase " , " click # submitDeleteDatabase " : " submitDeleteDatabase " , " click . contentRowInactive a " : " changeDatabase " , " keyup # databaseSearchInput " : " search " , " click # databaseSearchSubmit " : " search " , " click # databaseToggle " : " toggleSettingsDropdown " , " click . css - label " : " checkBoxes " , " click # dbSortDesc " : " sorting " } , sorting : function ( ) { $ ( " # dbSortDesc " ) . is ( " : checked " ) ? this . collection . setSortingDesc ( ! 0 ) : this . collection . setSortingDesc ( ! 1 ) , $ ( " # databaseDropdown " ) . is ( " : visible " ) ? this . dropdownVisible = ! 0 : this . dropdownVisible = ! 1 , this . render ( ) } , initialize : function ( ) { this . collection . fetch ( { async : ! 0 , cache : ! 1 } ) } , checkBoxes : function ( a ) { var b = a . currentTarget . id ; $ ( " # " + b ) . click ( ) } , render : function ( ) { var a = function ( a , b ) { a ? arangoHelper . arangoError ( " DB " , " Could not get current db properties " ) : ( this . currentDB = b , this . collection . sort ( ) , $ ( this . el ) . html ( this . template . render ( { collection : this . collection , searchString : " " , currentDB : this . currentDB } ) ) , this . dropdownVisible = = = ! 0 & & ( $ ( " # dbSortDesc " ) . attr ( " checked " , this . collection . sortOptions . desc ) , $ ( " # databaseToggle " ) . toggleClass ( " activated " ) , $ ( " # databaseDropdown2 " ) . show ( ) ) , arangoHelper . setCheckboxStatus ( " # databaseDropdown " ) , this . replaceSVGs ( ) ) } . bind ( this ) ; return this . collection . getCurrentDatabase ( a ) , this } , toggleSettingsDropdown : function ( ) { $ ( " # dbSortDesc " ) . attr ( " checked " , this . collection . sortOptions . desc ) , $ ( " # databaseToggle " ) . toggleClass ( " activated " ) , $ ( " # databaseDropdown2 " ) . slideToggle ( 200 ) } , selectedDatabase : function ( ) { return $ ( " # selectDatabases " ) . val ( ) } , handleError : function ( a , b , c ) { return 409 = = = a ? void arangoHelper . arangoError ( " DB " , " Database " + c + " already exists . " ) : 400 = = = a ? void arangoHelper . arangoError ( " DB " , " Invalid Parameters " ) : 403 = = = a ? void arangoHelper . arangoError ( " DB " , " Insufficent rights . Execute this from _system database " ) : void 0 } , validateDatabaseInfo : function ( a , b ) { return " " = = = b ? ( arangoHelper . arangoError ( " DB " , " You have to define an owner for the new database " ) , ! 1 ) : " " = = = a ? ( arangoHelper . arangoError ( " DB " , " You have to define a name for the new database " ) , ! 1 ) : 0 = = = a . indexOf ( " _ " ) ? ( arangoHelper . arangoError ( " DB " , " Databasename should not start with _ " ) , ! 1 ) : ! ! a . match ( / ^ [ a - zA - Z ] [ a - zA - Z0 - 9_ - ] * $ / ) | | ( arangoHelper . arangoError ( " DB " , " Databasename may only contain numbers , letters , _ and - " ) , ! 1 ) } , createDatabase : function ( a ) { a . preventDefault ( ) , this . createAddDatabaseModal ( ) } , switchDatabase : function ( a ) { if ( ! $ ( a . target ) . parent ( ) . hasClass ( " iconSet " ) ) { var b = $ ( a . currentTarget ) . find ( " h5 " ) . text ( ) ; if ( " " ! = = b ) { var c = this . collection . createDatabaseURL ( b ) ; window . location . replace ( c ) } } } , submitCreateDatabase : function ( ) { var a = this , b = $ ( " # newDatabaseName " ) . val ( ) , c = $ ( " # newUser " ) . val ( ) , d = { name : b } ; this . collection . create ( d , { error : function ( c , d ) { a . handleError ( d . status , d . statusText , b ) } , success : function ( d ) { " root " ! = = c & & $ . ajax ( { type : " PUT " , url : arangoHelper . databaseUrl ( " / _api / user / " + encodeURIComponent ( c ) + " / database / " + encodeURIComponent ( b ) ) , contentType : " application / json " , data : JSON . stringify ( { grant : " rw " } ) } ) , $ . ajax ( { type : " PUT " , url : arangoHelper . databaseUrl ( " / _api / user / root / database / " + encodeURIComponent ( b ) ) , contentType : " application / json " , data : JSON . stringify ( { grant : " rw " } ) } ) , " # databases " = = = window . location . hash & & a . updateDatabases ( ) , arangoHelper . arangoNotification ( " Database " + d . get ( " name " ) + " created . " ) } } ) , arangoHelper . arangoNotification ( " Database creation in progress . " ) , window . modalView . hide ( ) } , submitDeleteDatabase : function ( a ) { var b = this . collection . where ( { name : a } ) ; b [ 0 ] . destroy ( { wait : ! 0 , url : arangoHelper . databaseUrl ( " / _api / database / " + a ) } ) , this . updateDatabases ( ) , window . App . naviView . dbSelectionView . render ( $ ( " # dbSelect " ) ) , window . modalView . hide ( ) } , changeDatabase : function ( a ) { var b = $ ( a . currentTarget ) . attr ( " id " ) , c = this . collection . createDatabaseURL ( b ) ; window . location . replace ( c ) } , updateDatabases : function ( ) { var a = this ; this . collection . fetch ( { cache : ! 1 , success : function ( ) { a . render ( ) , window . App . handleSelectDatabase ( ) } } ) } , editDatabase : function ( a ) { var b = this . evaluateDatabaseName ( $ ( a . currentTarget ) . attr ( " id " ) , " _edit - database " ) , c = ! 0 ; b = = = this . currentDB & & ( c = ! 1 ) , this . createEditDatabaseModal ( b , c ) } , search : function ( ) { var a , b , c , d ; a = $ ( " # databaseSearchInput " ) , b = $ ( " # databaseSearchInput " ) . val ( ) , d = this . collection . filter ( function ( a ) { return a . get ( " name " ) . indexOf ( b ) ! = = - 1 } ) , $ ( this . el ) . html ( this . template . render ( { collection : d , searchString : b , currentDB : this . currentDB } ) ) , this . replaceSVGs ( ) , a = $ ( " # databaseSearchInput " ) , c = a . val ( ) . length , a . focus ( ) , a [ 0 ] . setSelectionRange ( c , c ) } , replaceSVGs : function ( ) { $ ( " . svgToReplace " ) . each ( function ( ) { var a = $ ( this ) , b = a . attr ( " id " ) , c = a . attr ( " src " ) ; $ . get ( c , function ( c ) { var d = $ ( c ) . find ( " svg " ) ; d . attr ( " id " , b ) . attr ( " class " , " tile - icon - svg " ) . removeAttr ( " xmlns : a " ) , a . replaceWith ( d ) } , " xml " ) } ) } , evaluateDatabaseName : function ( a , b ) { var c = a . lastIndexOf ( b ) ; return a . substring ( 0 , c ) } , createEditDatabaseModal : function ( a , b ) { var c = [ ] , d = [ ] ; d . push ( window . modalView . createReadOnlyEntry ( " id_name " , " Name " , a , " " ) ) , b ? c . push ( window . modalView . createDeleteButton ( " Delete " , this . submitDeleteDatabase . bind ( this , a ) ) ) : c . push ( window . modalView . createDisabledButton ( " Delete " ) ) , window . modalView . show ( " modalTable . ejs " , " Delete database " , c , d ) } , createAddDatabaseModal : function ( ) { var a = [ ] , b = [ ] ; b . push ( window . modalView . createTextEntry ( " newDatabaseName " , " Name " , " " , ! 1 , " Database Name " , ! 0 , [ { rule : Joi . string ( ) . regex ( / ^ [ a - zA - Z ] / ) , msg : " Database name must start with a letter . " } , { rule : Joi . string ( ) . regex ( / ^ [ a - zA - Z0 - 9 \ - _ ] * $ / ) , msg : ' Only Symbols " _ " and " - " are allowed . ' } , { rule : Joi . string ( ) . required ( ) , msg : " No database name given . " } ] ) ) ; var c = [ ] ; window . App . userCollection . each ( function ( a ) { c . push ( { value : a . get ( " user " ) , label : a . get ( " user " ) } ) } ) , b . push ( window . modalView . createSelectEntry ( " newUser " , " Username " , null ! = = this . users ? this . users . whoAmI ( ) : " root " , " Please define the owner of this database . This will be the only user having initial access to this database if authentication is turned on . Please note that if you specify a username different to your account you will not be able to access the database with your account after having creating it . Specifying a username is mandatory even with authentication turned off . If there is a failure you will be informed . " , c ) ) , a . push ( window . modalView . createSuccessButton ( " Create " , this . submitCreateDatabase . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Create Database " , a , b ) , $ ( " # useDefaultPassword " ) . change ( function ( ) { " true " = = = $ ( " # useDefaultPassword " ) . val ( ) ? $ ( " # row_newPassword " ) . hide ( ) : $ ( " # row_newPassword " ) . show ( ) } ) , $ ( " # row_newPassword " ) . hide ( ) } } ) } ( ) , function ( ) { " use strict " ; window . DBSelectionView = Backbone . View . extend ( { template : templateEngine . createTemplate ( " dbSelectionView . ejs " ) , events : { " click . dbSelectionLink " : " changeDatabase " } , initialize : function ( a ) { this . current = a . current } , changeDatabase : function ( a ) { var b = $ ( a . currentTarget ) . closest ( " . dbSelectionLink . tab " ) . attr ( " id " ) , c = this . collection . createDatabaseURL ( b ) ; window . location . replace ( c ) } , render : function ( a ) { var b = function ( b , c ) { b ? arangoHelper . arangoError ( " DB " , " Could not fetch databases " ) : ( this . $ el = a , this . $ el . html ( this . template . render ( { list : c , current : this . current . get ( " name " ) } ) ) , this . delegateEvents ( ) ) } . bind ( this ) ; return this . collection . getDatabasesForUser ( b ) , this . el } } ) } ( ) , function ( ) { " use strict " ; window . DocumentsView = window . PaginationView . extend ( { filters : { 0 : ! 0 } , filterId : 0 , paginationDiv : " # documentsToolbarF " , idPrefix : " documents " , addDocumentSwitch : ! 0 , activeFilter : ! 1 , lastCollectionName : void 0 , restoredFilters : [ ] , editMode : ! 1 , allowUpload : ! 1 , el : " # content " , table : " # documentsTableID " , template : templateEngine . createTemplate ( " documentsView . ejs " ) , collectionContext : { prev : null , next : null } , editButtons : [ " # deleteSelected " , " # moveSelected " ] , initialize : function ( a ) { this . documentStore = a . documentStore , this . collectionsStore = a . collectionsStore , this . tableView = new window . TableView ( { el : this . table , collection : this . collection } ) , this . tableView . setRowClick ( this . clicked . bind ( this ) ) , this . tableView . setRemoveClick ( this . remove . bind ( this ) ) } , resize : function ( ) { var a = ! 1 ; _ . each ( $ ( " . documentsDropdown " ) . first ( ) . children ( ) , function ( b ) { $ ( b ) . is ( " : visible " ) & & ( a = ! 0 ) } ) , a ? ( $ ( " # docPureTable " ) . height ( $ ( " . centralRow " ) . height ( ) - 210 - 57 ) , $ ( " # docPureTable . pure - table - body " ) . css ( " max - height " , $ ( " # docPureTable " ) . height ( ) - 47 ) ) : ( $ ( " # docPureTable " ) . height ( $ ( " . centralRow " ) . height ( ) - 210 ) , $ ( " # docPureTable . pure - table - body " ) . css ( " max - height " , $ ( " # docPureTable " ) . height ( ) - 47 ) ) } , setCollectionId : function ( a , b ) { this . collection . setCollection ( a ) , this . collection . setPage ( b ) , this . page = b ; var c = function ( b , c ) { b ? arangoHelper . arangoError ( " Error " , " Could not get collection properties . " ) : ( this . type = c , this . collection . getDocuments ( this . getDocsCallback . bind ( this ) ) , this . collectionModel = this . collectionsStore . get ( a ) ) } . bind ( this ) ; arangoHelper . collectionApiType ( a , null , c ) } , getDocsCallback : function ( a ) { $ ( " # documents_last " ) . css ( " visibility " , " hidden " ) , $ ( " # documents_first " ) . css ( " visibility " , " hidden " ) , a ? ( window . progressView . hide ( ) , arangoHelper . arangoError ( " Document error " , " Could not fetch requested documents . " ) ) : a & & void 0 = = = a | | ( window . progressView . hide ( ) , this . drawTable ( ) , this . renderPaginationElements ( ) ) } , events : { " click # collectionPrev " : " prevCollection " , " click # collectionNext " : " nextCollection " , " click # filterCollection " : " filterCollection " , " click # markDocuments " : " editDocuments " , " click # importCollection " : " importCollection " , " click # exportCollection " : " exportCollection " , " click # filterSend " : " sendFilter " , " click # addFilterItem " : " addFilterItem " , " click . removeFilterItem " : " removeFilterItem " , " click # deleteSelected " : " deleteSelectedDocs " , " click # moveSelected " : " moveSelectedDocs " , " click # addDocumentButton " : " addDocumentModal " , " click # documents_first " : " firstDocuments " , " click # documents_last " : " lastDocuments " , " click # documents_prev " : " prevDocuments " , " click # documents_next " : " nextDocuments " , " click # confirmDeleteBtn " : " confirmDelete " , " click . key " : " nop " , keyup : " returnPressedHandler " , " keydown . queryline input " : " filterValueKeydown " , " click # importModal " : " showImportModal " , " click # resetView " : " resetView " , " click # confirmDocImport " : " startUpload " , " click # exportDocuments " : " startDownload " , " change # documentSize " : " setPagesize " , " change # docsSort " : " setSorting " } , showSpinner : function ( ) { $ ( " . upload - indicator " ) . show ( ) } , hideSpinner : function ( ) { $ ( " . upload - indicator " ) . hide ( ) } , showImportModal : function ( ) { $ ( " # docImportModal " ) . modal ( " show " ) } , hideImportModal : function ( ) { $ ( " # docImportModal " ) . modal ( " hide " ) } , setPagesize : function ( ) { var a = $ ( " # documentSize " ) . find ( " : selected " ) . val ( ) ; this . collection . setPagesize ( a ) , this . collection . getDocuments ( this . getDocsCallback . bind ( this ) ) } , setSorting : function ( ) { var a = $ ( " # docsSort " ) . val ( ) ; " " ! = = a & & void 0 ! = = a & & null ! = = a | | ( a = " _key " ) , this . collection . setSort ( a ) } , returnPressedHandler : function ( a ) { 13 = = = a . keyCode & & $ ( a . target ) . is ( $ ( " # docsSort " ) ) & & this . collection . getDocuments ( this . getDocsCallback . bind ( this ) ) , 13 = = = a . keyCode & & $ ( " # confirmDeleteBtn " ) . attr ( " disabled " ) = = = ! 1 & & this . confirmDelete ( ) } , nop : function ( a ) { a . stopPropagation ( ) } , resetView : function ( ) { var a = function ( a ) { a & & arangoHelper . arangoError ( " Document " , " Could not fetch documents count " ) } ; $ ( " input " ) . val ( " " ) , $ ( " select " ) . val ( " = = " ) , this . removeAllFilterItems ( ) , $ ( " # documentSize " ) . val ( this . collection . getPageSize ( ) ) , $ ( " # documents_last " ) . css ( " visibility " , " visible " ) , $ ( " # documents_first " ) . css ( " visibility " , " visible " ) , this . addDocumentSwitch = ! 0 , this . collection . resetFilter ( ) , this . collection . loadTotal ( a ) , this . restoredFilters = [ ] , this . allowUpload = ! 1 , this . files = void 0 , this . file = void 0 , $ ( " # confirmDocImport " ) . attr ( " disabled " , ! 0 ) , this . markFilterToggle ( ) , this . collection . getDocuments ( this . getDocsCallback . bind ( this ) ) } , startDownload : function ( ) { var a = this . collection . buildDownloadDocumentQuery ( ) ; if ( " " ! = = a | | void 0 ! = = a | | null ! = = a ) { var b = " query / result / download / " + btoa ( JSON . stringify ( a ) ) ; arangoHelper . download ( b ) } else arangoHelper . arangoError ( " Document error " , " could not download documents " ) ; <nl> } , startUpload : function ( ) { var a = function ( a , b ) { a ? arangoHelper . arangoError ( " Upload " , b ) : ( this . hideImportModal ( ) , this . resetView ( ) ) , this . hideSpinner ( ) } . bind ( this ) ; this . allowUpload = = = ! 0 & & ( this . showSpinner ( ) , this . collection . uploadDocuments ( this . file , a ) ) } , uploadSetup : function ( ) { var a = this ; $ ( " # importDocuments " ) . change ( function ( b ) { a . files = b . target . files | | b . dataTransfer . files , a . file = a . files [ 0 ] , $ ( " # confirmDocImport " ) . attr ( " disabled " , ! 1 ) , a . allowUpload = ! 0 } ) } , buildCollectionLink : function ( a ) { return " collection / " + encodeURIComponent ( a . get ( " name " ) ) + " / documents / 1 " } , markFilterToggle : function ( ) { this . restoredFilters . length > 0 ? $ ( " # filterCollection " ) . addClass ( " activated " ) : $ ( " # filterCollection " ) . removeClass ( " activated " ) } , editDocuments : function ( ) { $ ( " # importCollection " ) . removeClass ( " activated " ) , $ ( " # exportCollection " ) . removeClass ( " activated " ) , this . markFilterToggle ( ) , $ ( " # markDocuments " ) . toggleClass ( " activated " ) , this . changeEditMode ( ) , $ ( " # filterHeader " ) . hide ( ) , $ ( " # importHeader " ) . hide ( ) , $ ( " # editHeader " ) . slideToggle ( 1 ) , $ ( " # exportHeader " ) . hide ( ) ; var a = this ; window . setTimeout ( function ( ) { a . resize ( ) } , 50 ) } , filterCollection : function ( ) { $ ( " # importCollection " ) . removeClass ( " activated " ) , $ ( " # exportCollection " ) . removeClass ( " activated " ) , $ ( " # markDocuments " ) . removeClass ( " activated " ) , this . changeEditMode ( ! 1 ) , this . markFilterToggle ( ) , this . activeFilter = ! 0 , $ ( " # importHeader " ) . hide ( ) , $ ( " # editHeader " ) . hide ( ) , $ ( " # exportHeader " ) . hide ( ) , $ ( " # filterHeader " ) . slideToggle ( 1 ) ; var a = this ; window . setTimeout ( function ( ) { a . resize ( ) } , 50 ) ; var b ; for ( b in this . filters ) if ( this . filters . hasOwnProperty ( b ) ) return void $ ( " # attribute_name " + b ) . focus ( ) } , exportCollection : function ( ) { $ ( " # importCollection " ) . removeClass ( " activated " ) , $ ( " # filterHeader " ) . removeClass ( " activated " ) , $ ( " # markDocuments " ) . removeClass ( " activated " ) , this . changeEditMode ( ! 1 ) , $ ( " # exportCollection " ) . toggleClass ( " activated " ) , this . markFilterToggle ( ) , $ ( " # exportHeader " ) . slideToggle ( 1 ) , $ ( " # importHeader " ) . hide ( ) , $ ( " # filterHeader " ) . hide ( ) , $ ( " # editHeader " ) . hide ( ) ; var a = this ; window . setTimeout ( function ( ) { a . resize ( ) } , 50 ) } , importCollection : function ( ) { this . markFilterToggle ( ) , $ ( " # markDocuments " ) . removeClass ( " activated " ) , this . changeEditMode ( ! 1 ) , $ ( " # importCollection " ) . toggleClass ( " activated " ) , $ ( " # exportCollection " ) . removeClass ( " activated " ) , $ ( " # importHeader " ) . slideToggle ( 1 ) , $ ( " # filterHeader " ) . hide ( ) , $ ( " # editHeader " ) . hide ( ) , $ ( " # exportHeader " ) . hide ( ) ; var a = this ; window . setTimeout ( function ( ) { a . resize ( ) } , 50 ) } , changeEditMode : function ( a ) { a = = = ! 1 | | this . editMode = = = ! 0 ? ( $ ( " # docPureTable . pure - table - body . pure - table - row " ) . css ( " cursor " , " default " ) , $ ( " . deleteButton " ) . fadeIn ( ) , $ ( " . addButton " ) . fadeIn ( ) , $ ( " . selected - row " ) . removeClass ( " selected - row " ) , this . editMode = ! 1 , this . tableView . setRowClick ( this . clicked . bind ( this ) ) ) : ( $ ( " # docPureTable . pure - table - body . pure - table - row " ) . css ( " cursor " , " copy " ) , $ ( " . deleteButton " ) . fadeOut ( ) , $ ( " . addButton " ) . fadeOut ( ) , $ ( " . selectedCount " ) . text ( 0 ) , this . editMode = ! 0 , this . tableView . setRowClick ( this . editModeClick . bind ( this ) ) ) } , getFilterContent : function ( ) { var a , b , c = [ ] ; for ( a in this . filters ) if ( this . filters . hasOwnProperty ( a ) ) { b = $ ( " # attribute_value " + a ) . val ( ) ; try { b = JSON . parse ( b ) } catch ( d ) { b = String ( b ) } " " ! = = $ ( " # attribute_name " + a ) . val ( ) & & c . push ( { attribute : $ ( " # attribute_name " + a ) . val ( ) , operator : $ ( " # operator " + a ) . val ( ) , value : b } ) } return c } , sendFilter : function ( ) { this . restoredFilters = this . getFilterContent ( ) ; var a = this ; this . collection . resetFilter ( ) , this . addDocumentSwitch = ! 1 , _ . each ( this . restoredFilters , function ( b ) { void 0 ! = = b . operator & & a . collection . addFilter ( b . attribute , b . operator , b . value ) } ) , this . collection . setToFirst ( ) , this . collection . getDocuments ( this . getDocsCallback . bind ( this ) ) , this . markFilterToggle ( ) } , restoreFilter : function ( ) { var a = this , b = 0 ; this . filterId = 0 , $ ( " # docsSort " ) . val ( this . collection . getSort ( ) ) , _ . each ( this . restoredFilters , function ( c ) { 0 ! = = b & & a . addFilterItem ( ) , void 0 ! = = c . operator & & ( $ ( " # attribute_name " + b ) . val ( c . attribute ) , $ ( " # operator " + b ) . val ( c . operator ) , $ ( " # attribute_value " + b ) . val ( c . value ) ) , b + + , a . collection . addFilter ( c . attribute , c . operator , c . value ) } ) , a . rerender ( ) } , addFilterItem : function ( ) { var a = + + this . filterId ; $ ( " # filterHeader " ) . append ( ' < div class = " queryline querylineAdd " > < input id = " attribute_name ' + a + ' " type = " text " placeholder = " Attribute name " > < select name = " operator " id = " operator ' + a + ' " class = " filterSelect " > < option value = " = = " > = = < / option > < option value = " ! = " > ! = < / option > < option value = " & lt ; " > & lt ; < / option > < option value = " & lt ; = " > & lt ; = < / option > < option value = " & gt ; " > & gt ; < / option > < option value = " & gt ; = " > & gt ; = < / option > < option value = " LIKE " > LIKE < / option > < option value = " IN " > IN < / option > < option value = " = ~ " > NOT IN < / option > < option value = " REGEX " > REGEX < / option > < / select > < input id = " attribute_value ' + a + ' " type = " text " placeholder = " Attribute value " class = " filterValue " > < a class = " removeFilterItem " id = " removeFilter ' + a + ' " > < i class = " fa fa - minus - circle " > < / i > < / a > < / div > ' ) , this . filters [ a ] = ! 0 , this . checkFilterState ( ) } , filterValueKeydown : function ( a ) { 13 = = = a . keyCode & & this . sendFilter ( ) } , checkFilterState : function ( ) { var a = $ ( " # filterHeader . queryline " ) . length ; if ( 1 = = = a ) $ ( " # filterHeader . removeFilterItem " ) . remove ( ) ; else if ( 0 = = = $ ( " # filterHeader . queryline " ) . first ( ) . find ( " . removeFilterItem " ) . length ) { var b = $ ( " # filterHeader . queryline " ) . first ( ) . children ( ) . first ( ) . attr ( " id " ) , c = b . substr ( 14 , b . length ) ; $ ( " # filterHeader . queryline " ) . first ( ) . find ( " . add - filter - item " ) . after ( ' < a class = " removeFilterItem " id = " removeFilter ' + c + ' " > < i class = " fa fa - minus - circle " > < / i > < / a > ' ) } 0 = = = $ ( " # filterHeader . queryline " ) . first ( ) . find ( " . add - filter - item " ) . length & & $ ( " # filterHeader . queryline " ) . first ( ) . find ( " . filterValue " ) . after ( ' < a id = " addFilterItem " class = " add - filter - item " > < i style = " margin - left : 4px ; " class = " fa fa - plus - circle " > < / i > < / a > ' ) } , removeFilterItem : function ( a ) { var b = a . currentTarget , c = b . id . replace ( / ^ removeFilter / , " " ) ; delete this . filters [ c ] , delete this . restoredFilters [ c ] , $ ( b . parentElement ) . remove ( ) , this . checkFilterState ( ) } , removeAllFilterItems : function ( ) { var a , b = $ ( " # filterHeader " ) . children ( ) . length ; for ( a = 1 ; a < = b ; a + + ) $ ( " # removeFilter " + a ) . parent ( ) . remove ( ) ; this . filters = { 0 : ! 0 } , this . filterId = 0 } , addDocumentModal : function ( ) { var a = window . location . hash . split ( " / " ) [ 1 ] , b = [ ] , c = [ ] , d = function ( a , d ) { a ? arangoHelper . arangoError ( " Error " , " Could not fetch collection type " ) : " edge " = = = d ? ( c . push ( window . modalView . createTextEntry ( " new - edge - from - attr " , " _from " , " " , " document _id : document handle of the linked vertex ( incoming relation ) " , void 0 , ! 1 , [ { rule : Joi . string ( ) . required ( ) , msg : " No _from attribute given . " } ] ) ) , c . push ( window . modalView . createTextEntry ( " new - edge - to " , " _to " , " " , " document _id : document handle of the linked vertex ( outgoing relation ) " , void 0 , ! 1 , [ { rule : Joi . string ( ) . required ( ) , msg : " No _to attribute given . " } ] ) ) , c . push ( window . modalView . createTextEntry ( " new - edge - key - attr " , " _key " , void 0 , " the edges unique key ( optional attribute , leave empty for autogenerated key " , " is optional : leave empty for autogenerated key " , ! 1 , [ { rule : Joi . string ( ) . allow ( " " ) . optional ( ) , msg : " " } ] ) ) , b . push ( window . modalView . createSuccessButton ( " Create " , this . addEdge . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Create edge " , b , c ) ) : ( c . push ( window . modalView . createTextEntry ( " new - document - key - attr " , " _key " , void 0 , " the documents unique key ( optional attribute , leave empty for autogenerated key " , " is optional : leave empty for autogenerated key " , ! 1 , [ { rule : Joi . string ( ) . allow ( " " ) . optional ( ) , msg : " " } ] ) ) , b . push ( window . modalView . createSuccessButton ( " Create " , this . addDocument . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Create document " , b , c ) ) } . bind ( this ) ; arangoHelper . collectionApiType ( a , ! 0 , d ) } , addEdge : function ( ) { var a , b = window . location . hash . split ( " / " ) [ 1 ] , c = $ ( " . modal - body # new - edge - from - attr " ) . last ( ) . val ( ) , d = $ ( " . modal - body # new - edge - to " ) . last ( ) . val ( ) , e = $ ( " . modal - body # new - edge - key - attr " ) . last ( ) . val ( ) , f = function ( b , c , d ) { if ( b ) arangoHelper . arangoError ( " Error " , d . errorMessage ) ; else { window . modalView . hide ( ) , c = c . _id . split ( " / " ) ; try { a = " collection / " + c [ 0 ] + " / " + c [ 1 ] , decodeURI ( a ) } catch ( e ) { a = " collection / " + c [ 0 ] + " / " + encodeURIComponent ( c [ 1 ] ) } window . location . hash = a } } ; " " ! = = e | | void 0 ! = = e ? this . documentStore . createTypeEdge ( b , c , d , e , f ) : this . documentStore . createTypeEdge ( b , c , d , null , f ) } , addDocument : function ( ) { var a , b = window . location . hash . split ( " / " ) [ 1 ] , c = $ ( " . modal - body # new - document - key - attr " ) . last ( ) . val ( ) , d = function ( b , c , d ) { if ( b ) arangoHelper . arangoError ( " Error " , d . errorMessage ) ; else { window . modalView . hide ( ) , c = c . split ( " / " ) ; try { a = " collection / " + c [ 0 ] + " / " + c [ 1 ] , decodeURI ( a ) } catch ( e ) { a = " collection / " + c [ 0 ] + " / " + encodeURIComponent ( c [ 1 ] ) } window . location . hash = a } } ; " " ! = = c | | void 0 ! = = c ? this . documentStore . createTypeDocument ( b , c , d ) : this . documentStore . createTypeDocument ( b , null , d ) } , moveSelectedDocs : function ( ) { var a = [ ] , b = [ ] , c = this . getSelectedDocs ( ) ; 0 ! = = c . length & & ( b . push ( window . modalView . createTextEntry ( " move - documents - to " , " Move to " , " " , ! 1 , " collection - name " , ! 0 , [ { rule : Joi . string ( ) . regex ( / ^ [ a - zA - Z ] / ) , msg : " Collection name must always start with a letter . " } , { rule : Joi . string ( ) . regex ( / ^ [ a - zA - Z0 - 9 \ - _ ] * $ / ) , msg : ' Only Symbols " _ " and " - " are allowed . ' } , { rule : Joi . string ( ) . required ( ) , msg : " No collection name given . " } ] ) ) , a . push ( window . modalView . createSuccessButton ( " Move " , this . confirmMoveSelectedDocs . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Move documents " , a , b ) ) } , confirmMoveSelectedDocs : function ( ) { var a = this . getSelectedDocs ( ) , b = this , c = $ ( " . modal - body " ) . last ( ) . find ( " # move - documents - to " ) . val ( ) , d = function ( ) { this . collection . getDocuments ( this . getDocsCallback . bind ( this ) ) , $ ( " # markDocuments " ) . click ( ) , window . modalView . hide ( ) } . bind ( this ) ; _ . each ( a , function ( a ) { b . collection . moveDocument ( a , b . collection . collectionID , c , d ) } ) } , deleteSelectedDocs : function ( ) { var a = [ ] , b = [ ] , c = this . getSelectedDocs ( ) ; 0 ! = = c . length & & ( b . push ( window . modalView . createReadOnlyEntry ( void 0 , c . length + " documents selected " , " Do you want to delete all selected documents ? " , void 0 , void 0 , ! 1 , void 0 ) ) , a . push ( window . modalView . createDeleteButton ( " Delete " , this . confirmDeleteSelectedDocs . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Delete documents " , a , b ) ) } , confirmDeleteSelectedDocs : function ( ) { var a = this . getSelectedDocs ( ) , b = [ ] , c = this ; _ . each ( a , function ( a ) { if ( " document " = = = c . type ) { var d = function ( a ) { a ? ( b . push ( ! 1 ) , arangoHelper . arangoError ( " Document error " , " Could not delete document . " ) ) : ( b . push ( ! 0 ) , c . collection . setTotalMinusOne ( ) , c . collection . getDocuments ( this . getDocsCallback . bind ( this ) ) , $ ( " # markDocuments " ) . click ( ) , window . modalView . hide ( ) ) } . bind ( c ) ; c . documentStore . deleteDocument ( c . collection . collectionID , a , d ) } else if ( " edge " = = = c . type ) { var e = function ( a ) { a ? ( b . push ( ! 1 ) , arangoHelper . arangoError ( " Edge error " , " Could not delete edge " ) ) : ( c . collection . setTotalMinusOne ( ) , b . push ( ! 0 ) , c . collection . getDocuments ( this . getDocsCallback . bind ( this ) ) , $ ( " # markDocuments " ) . click ( ) , window . modalView . hide ( ) ) } . bind ( c ) ; c . documentStore . deleteEdge ( c . collection . collectionID , a , e ) } } ) } , getSelectedDocs : function ( ) { var a = [ ] ; return _ . each ( $ ( " # docPureTable . pure - table - body . pure - table - row " ) , function ( b ) { $ ( b ) . hasClass ( " selected - row " ) & & a . push ( $ ( $ ( b ) . children ( ) [ 1 ] ) . find ( " . key " ) . text ( ) ) } ) , a } , remove : function ( a ) { this . docid = $ ( a . currentTarget ) . parent ( ) . parent ( ) . prev ( ) . find ( " . key " ) . text ( ) , $ ( " # confirmDeleteBtn " ) . attr ( " disabled " , ! 1 ) , $ ( " # docDeleteModal " ) . modal ( " show " ) } , confirmDelete : function ( ) { $ ( " # confirmDeleteBtn " ) . attr ( " disabled " , ! 0 ) ; var a = window . location . hash . split ( " / " ) , b = a [ 3 ] ; " source " ! = = b & & this . reallyDelete ( ) } , reallyDelete : function ( ) { if ( " document " = = = this . type ) { var a = function ( a ) { a ? arangoHelper . arangoError ( " Error " , " Could not delete document " ) : ( this . collection . setTotalMinusOne ( ) , this . collection . getDocuments ( this . getDocsCallback . bind ( this ) ) , $ ( " # docDeleteModal " ) . modal ( " hide " ) ) } . bind ( this ) ; this . documentStore . deleteDocument ( this . collection . collectionID , this . docid , a ) } else if ( " edge " = = = this . type ) { var b = function ( a ) { a ? arangoHelper . arangoError ( " Edge error " , " Could not delete edge " ) : ( this . collection . setTotalMinusOne ( ) , this . collection . getDocuments ( this . getDocsCallback . bind ( this ) ) , $ ( " # docDeleteModal " ) . modal ( " hide " ) ) } . bind ( this ) ; this . documentStore . deleteEdge ( this . collection . collectionID , this . docid , b ) } } , editModeClick : function ( a ) { var b = $ ( a . currentTarget ) ; b . hasClass ( " selected - row " ) ? b . removeClass ( " selected - row " ) : b . addClass ( " selected - row " ) ; var c = this . getSelectedDocs ( ) ; $ ( " . selectedCount " ) . text ( c . length ) , _ . each ( this . editButtons , function ( a ) { c . length > 0 ? ( $ ( a ) . prop ( " disabled " , ! 1 ) , $ ( a ) . removeClass ( " button - neutral " ) , $ ( a ) . removeClass ( " disabled " ) , " # moveSelected " = = = a ? $ ( a ) . addClass ( " button - success " ) : $ ( a ) . addClass ( " button - danger " ) ) : ( $ ( a ) . prop ( " disabled " , ! 0 ) , $ ( a ) . addClass ( " disabled " ) , $ ( a ) . addClass ( " button - neutral " ) , " # moveSelected " = = = a ? $ ( a ) . removeClass ( " button - success " ) : $ ( a ) . removeClass ( " button - danger " ) ) } ) } , clicked : function ( a ) { var b , c = a . currentTarget , d = $ ( c ) . attr ( " id " ) . substr ( 4 ) ; try { b = " collection / " + this . collection . collectionID + " / " + d , decodeURI ( d ) } catch ( e ) { b = " collection / " + this . collection . collectionID + " / " + encodeURIComponent ( d ) } window . location . hash = b } , drawTable : function ( ) { this . tableView . setElement ( $ ( " # docPureTable " ) ) . render ( ) , arangoHelper . fixTooltips ( " . icon_arangodb , . arangoicon " , " top " ) , $ ( " . prettify " ) . snippet ( " javascript " , { style : " nedit " , menu : ! 1 , startText : ! 1 , transparent : ! 0 , showNum : ! 1 } ) , this . resize ( ) } , checkCollectionState : function ( ) { this . lastCollectionName = = = this . collectionName ? this . activeFilter & & ( this . filterCollection ( ) , this . restoreFilter ( ) ) : void 0 ! = = this . lastCollectionName & & ( this . collection . resetFilter ( ) , this . collection . setSort ( " " ) , this . restoredFilters = [ ] , this . activeFilter = ! 1 ) } , render : function ( ) { return $ ( this . el ) . html ( this . template . render ( { } ) ) , 2 = = = this . type ? this . type = " document " : 3 = = = this . type & & ( this . type = " edge " ) , this . tableView . setElement ( $ ( this . table ) ) . drawLoading ( ) , this . collectionContext = this . collectionsStore . getPosition ( this . collection . collectionID ) , this . collectionName = window . location . hash . split ( " / " ) [ 1 ] , this . breadcrumb ( ) , window . arangoHelper . buildCollectionSubNav ( this . collectionName , " Content " ) , this . checkCollectionState ( ) , this . lastCollectionName = this . collectionName , this . uploadSetup ( ) , $ ( " [ data - toggle = tooltip ] " ) . tooltip ( ) , $ ( " . upload - info " ) . tooltip ( ) , arangoHelper . fixTooltips ( " . icon_arangodb , . arangoicon " , " top " ) , this . renderPaginationElements ( ) , this . selectActivePagesize ( ) , this . markFilterToggle ( ) , this . resize ( ) , this } , rerender : function ( ) { this . collection . getDocuments ( this . getDocsCallback . bind ( this ) ) , this . resize ( ) } , selectActivePagesize : function ( ) { $ ( " # documentSize " ) . val ( this . collection . getPageSize ( ) ) } , renderPaginationElements : function ( ) { this . renderPagination ( ) ; var a = $ ( " # totalDocuments " ) ; 0 = = = a . length & & ( $ ( " # documentsToolbarFL " ) . append ( ' < a id = " totalDocuments " class = " totalDocuments " > < / a > ' ) , a = $ ( " # totalDocuments " ) ) , " document " = = = this . type & & a . html ( numeral ( this . collection . getTotal ( ) ) . format ( " 0 , 0 " ) + " doc ( s ) " ) , " edge " = = = this . type & & a . html ( numeral ( this . collection . getTotal ( ) ) . format ( " 0 , 0 " ) + " edge ( s ) " ) } , breadcrumb : function ( ) { $ ( " # subNavigationBar . breadcrumb " ) . html ( " Collection : " + this . collectionName ) } } ) } ( ) , function ( ) { " use strict " ; var a = function ( a ) { var b = a . split ( " / " ) ; return " collection / " + encodeURIComponent ( b [ 0 ] ) + " / " + encodeURIComponent ( b [ 1 ] ) } ; window . DocumentView = Backbone . View . extend ( { el : " # content " , colid : 0 , docid : 0 , customView : ! 1 , defaultMode : " tree " , template : templateEngine . createTemplate ( " documentView . ejs " ) , events : { " click # saveDocumentButton " : " saveDocument " , " click # deleteDocumentButton " : " deleteDocumentModal " , " click # confirmDeleteDocument " : " deleteDocument " , " click # document - from " : " navigateToDocument " , " click # document - to " : " navigateToDocument " , " keydown # documentEditor . ace_editor " : " keyPress " , " keyup . jsoneditor . search input " : " checkSearchBox " , " click . jsoneditor . modes " : " storeMode " , " click # addDocument " : " addDocument " } , checkSearchBox : function ( a ) { " " = = = $ ( a . currentTarget ) . val ( ) & & this . editor . expandAll ( ) } , initialize : function ( ) { var a = localStorage . getItem ( " JSONEditorMode " ) ; a & & ( this . defaultMode = a ) } , addDocument : function ( ) { window . App . documentsView . addDocumentModal ( ) } , storeMode : function ( ) { var a = this ; $ ( " . type - modes " ) . on ( " click " , function ( b ) { var c = $ ( b . currentTarget ) . text ( ) . toLowerCase ( ) ; localStorage . setItem ( " JSONEditorMode " , c ) , a . defaultMode = c } ) } , keyPress : function ( a ) { a . ctrlKey & & 13 = = = a . keyCode ? ( a . preventDefault ( ) , this . saveDocument ( ) ) : a . metaKey & & 13 = = = a . keyCode & & ( a . preventDefault ( ) , this . saveDocument ( ) ) } , editor : 0 , setType : function ( a ) { a = 2 = = = a ? " document " : " edge " ; var b = function ( a , b ) { if ( a ) arangoHelper . arangoError ( " Error " , " Could not fetch data . " ) ; else { var c = b + " : " ; this . type = b , this . fillInfo ( c ) , this . fillEditor ( ) } } . bind ( this ) ; " edge " = = = a ? this . collection . getEdge ( this . colid , this . docid , b ) : " document " = = = a & & this . collection . getDocument ( this . colid , this . docid , b ) } , deleteDocumentModal : function ( ) { var a = [ ] , b = [ ] ; b . push ( window . modalView . createReadOnlyEntry ( " doc - delete - button " , " Confirm delete , document id is " , this . type . _id , void 0 , void 0 , ! 1 , / [ < > & ' " ] / ) ) , a . push ( window . modalView . createDeleteButton ( " Delete " , this . deleteDocument . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Delete Document " , a , b ) } , deleteDocument : function ( ) { var a = function ( ) { if ( this . customView ) this . customDeleteFunction ( ) ; else { var a = " collection / " + encodeURIComponent ( this . colid ) + " / documents / 1 " ; window . modalView . hide ( ) , window . App . navigate ( a , { trigger : ! 0 } ) } } . bind ( this ) ; if ( this . type . _from & & this . type . _to ) { var b = function ( b ) { b ? arangoHelper . arangoError ( " Edge error " , " Could not delete edge " ) : a ( ) } ; this . collection . deleteEdge ( this . colid , this . docid , b ) } else { var c = function ( b ) { b ? arangoHelper . arangoError ( " Error " , " Could not delete document " ) : a ( ) } ; this . collection . deleteDocument ( this . colid , this . docid , c ) } } , navigateToDocument : function ( a ) { var b = $ ( a . target ) . attr ( " documentLink " ) ; b & & window . App . navigate ( b , { trigger : ! 0 } ) } , fillInfo : function ( ) { var b = this . collection . first ( ) , c = b . get ( " _id " ) , d = b . get ( " _key " ) , e = b . get ( " _rev " ) , f = b . get ( " _from " ) , g = b . get ( " _to " ) ; if ( $ ( " # document - type " ) . css ( " margin - left " , " 10px " ) , $ ( " # document - type " ) . text ( " _id : " ) , $ ( " # document - id " ) . css ( " margin - left " , " 0 " ) , $ ( " # document - id " ) . text ( c ) , $ ( " # document - key " ) . text ( d ) , $ ( " # document - rev " ) . text ( e ) , f & & g ) { var h = a ( f ) , i = a ( g ) ; $ ( " # document - from " ) . text ( f ) , $ ( " # document - from " ) . attr ( " documentLink " , h ) , $ ( " # document - to " ) . text ( g ) , $ ( " # document - to " ) . attr ( " documentLink " , i ) } else $ ( " . edge - info - container " ) . hide ( ) } , fillEditor : function ( ) { var a = this . removeReadonlyKeys ( this . collection . first ( ) . attributes ) ; $ ( " . disabledBread " ) . last ( ) . text ( this . collection . first ( ) . get ( " _key " ) ) , this . editor . set ( a ) , $ ( " . ace_content " ) . attr ( " font - size " , " 11pt " ) } , jsonContentChanged : function ( ) { this . enableSaveButton ( ) } , resize : function ( ) { $ ( " # documentEditor " ) . height ( $ ( " . centralRow " ) . height ( ) - 300 ) } , render : function ( ) { $ ( this . el ) . html ( this . template . render ( { } ) ) , $ ( " # documentEditor " ) . height ( $ ( " . centralRow " ) . height ( ) - 300 ) , this . disableSaveButton ( ) , this . breadcrumb ( ) ; var a = this , b = document . getElementById ( " documentEditor " ) , c = { change : function ( ) { a . jsonContentChanged ( ) } , search : ! 0 , mode : " tree " , modes : [ " tree " , " code " ] , iconlib : " fontawesome4 " } ; return this . editor = new JSONEditor ( b , c ) , this . editor . setMode ( this . defaultMode ) , this } , removeReadonlyKeys : function ( a ) { return _ . omit ( a , [ " _key " , " _id " , " _from " , " _to " , " _rev " ] ) } , saveDocument : function ( ) { if ( void 0 = = = $ ( " # saveDocumentButton " ) . attr ( " disabled " ) ) if ( " _ " = = = this . collection . first ( ) . attributes . _id . substr ( 0 , 1 ) ) { var a = [ ] , b = [ ] ; b . push ( window . modalView . createReadOnlyEntry ( " doc - save - system - button " , " Caution " , " You are modifying a system collection . Really continue ? " , void 0 , void 0 , ! 1 , / [ < > & ' " ] / ) ) , a . push ( window . modalView . createSuccessButton ( " Save " , this . confirmSaveDocument . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Modify System Collection " , a , b ) } else this . confirmSaveDocument ( ) } , confirmSaveDocument : function ( ) { window . modalView . hide ( ) ; var a ; try { a = this . editor . get ( ) } catch ( b ) { return this . errorConfirmation ( b ) , void this . disableSaveButton ( ) } if ( a = JSON . stringify ( a ) , this . type . _from & & this . type . _to ) { var c = function ( a , b ) { a ? arangoHelper . arangoError ( " Error " , b . responseJSON . errorMessage ) : ( this . successConfirmation ( ) , this . disableSaveButton ( ) ) } . bind ( this ) ; this . collection . saveEdge ( this . colid , this . docid , this . type . _from , this . type . _to , a , c ) } else { var d = function ( a , b ) { a ? arangoHelper . arangoError ( " Error " , b . responseJSON . errorMessage ) : ( this . successConfirmation ( ) , this . disableSaveButton ( ) ) } . bind ( this ) ; this . collection . saveDocument ( this . colid , this . docid , a , d ) } } , successConfirmation : function ( ) { arangoHelper . arangoNotification ( " Document saved . " ) } , errorConfirmation : function ( a ) { arangoHelper . arangoError ( " Document editor : " , a ) } , enableSaveButton : function ( ) { $ ( " # saveDocumentButton " ) . prop ( " disabled " , ! 1 ) , $ ( " # saveDocumentButton " ) . addClass ( " button - success " ) , $ ( " # saveDocumentButton " ) . removeClass ( " button - close " ) } , disableSaveButton : function ( ) { $ ( " # saveDocumentButton " ) . prop ( " disabled " , ! 0 ) , $ ( " # saveDocumentButton " ) . addClass ( " button - close " ) , $ ( " # saveDocumentButton " ) . removeClass ( " button - success " ) } , breadcrumb : function ( ) { var a = window . location . hash . split ( " / " ) ; $ ( " # subNavigationBar . breadcrumb " ) . html ( ' < a href = " # collection / ' + a [ 1 ] + ' / documents / 1 " > Collection : ' + a [ 1 ] + ' < / a > < i class = " fa fa - chevron - right " > < / i > Document : ' + a [ 2 ] ) } , escaped : function ( a ) { return a . replace ( / & / g , " & amp ; " ) . replace ( / < / g , " & lt ; " ) . replace ( / > / g , " & gt ; " ) . replace ( / " / g , " & quot ; " ) . replace ( / ' / g , " & # 39 ; " ) } } ) } ( ) , function ( ) { " use strict " ; window . FooterView = Backbone . View . extend ( { el : " # footerBar " , system : { } , isOffline : ! 0 , isOfflineCounter : 0 , firstLogin : ! 0 , timer : 15e3 , lap : 0 , timerFunction : null , events : { " click . footer - center p " : " showShortcutModal " } , initialize : function ( ) { var a = this ; window . setInterval ( function ( ) { a . getVersion ( ) } , a . timer ) , a . getVersion ( ) , window . VISIBLE = ! 0 , document . addEventListener ( " visibilitychange " , function ( ) { window . VISIBLE = ! window . VISIBLE } ) , $ ( " # offlinePlaceholder button " ) . on ( " click " , function ( ) { a . getVersion ( ) } ) , window . setTimeout ( function ( ) { window . frontendConfig . isCluster = = = ! 0 & & ( $ ( " . health - state " ) . css ( " cursor " , " pointer " ) , $ ( " . health - state " ) . on ( " click " , function ( ) { window . App . navigate ( " # nodes " , { trigger : ! 0 } ) } ) ) } , 1e3 ) } , template : templateEngine . createTemplate ( " footerView . ejs " ) , showServerStatus : function ( a ) { window . App . isCluster ? this . renderClusterState ( a ) : a = = = ! 0 ? ( $ ( " # healthStatus " ) . removeClass ( " negative " ) , $ ( " # healthStatus " ) . addClass ( " positive " ) , $ ( " . health - state " ) . html ( " GOOD " ) , $ ( " . health - icon " ) . html ( ' < i class = " fa fa - check - circle " > < / i > ' ) , $ ( " # offlinePlaceholder " ) . hide ( ) ) : ( $ ( " # healthStatus " ) . removeClass ( " positive " ) , $ ( " # healthStatus " ) . addClass ( " negative " ) , $ ( " . health - state " ) . html ( " UNKNOWN " ) , $ ( " . health - icon " ) . html ( ' < i class = " fa fa - exclamation - circle " > < / i > ' ) , window . modalView . hide ( ) , $ ( " # offlinePlaceholder " ) . show ( ) , $ . noty . clearQueue ( ) , $ . noty . closeAll ( ) , this . reconnectAnimation ( 0 ) ) } , reconnectAnimation : function ( a ) { var b = this ; 0 = = = a & & ( b . lap = a , $ ( " # offlineSeconds " ) . text ( b . timer / 1e3 ) , clearTimeout ( b . timerFunction ) ) , b . lap < this . timer / 1e3 & & ( b . lap + + , $ ( " # offlineSeconds " ) . text ( b . timer / 1e3 - b . lap ) , b . timerFunction = window . setTimeout ( function ( ) { b . timer / 1e3 - b . lap = = = 0 ? b . getVersion ( ) : b . reconnectAnimation ( b . lap ) } , 1e3 ) ) } , renderClusterState : function ( a ) { if ( a ) { $ ( " # offlinePlaceholder " ) . hide ( ) ; var b = function ( a ) { var b = a . Health , c = 0 ; _ . each ( b , function ( a ) { " GOOD " ! = = a . Status & & c + + } ) , c > 0 ? ( $ ( " # healthStatus " ) . removeClass ( " positive " ) , $ ( " # healthStatus " ) . addClass ( " negative " ) , 1 = = = c ? $ ( " . health - state " ) . html ( c + " NODE ERROR " ) : $ ( " . health - state " ) . html ( c + " NODES ERROR " ) , $ ( " . health - icon " ) . html ( ' < i class = " fa fa - exclamation - circle " > < / i > ' ) ) : ( $ ( " # healthStatus " ) . removeClass ( " negative " ) , $ ( " # healthStatus " ) . addClass ( " positive " ) , $ ( " . health - state " ) . html ( " NODES OK " ) , $ ( " . health - icon " ) . html ( ' < i class = " fa fa - check - circle " > < / i > ' ) ) } ; $ . ajax ( { type : " GET " , cache : ! 1 , url : arangoHelper . databaseUrl ( " / _admin / cluster / health " ) , contentType : " application / json " , processData : ! 1 , async : ! 0 , success : function ( a ) { b ( a ) } } ) } else $ ( " # healthStatus " ) . removeClass ( " positive " ) , $ ( " # healthStatus " ) . addClass ( " negative " ) , $ ( " . health - state " ) . html ( window . location . host + " OFFLINE " ) , $ ( " . health - icon " ) . html ( ' < i class = " fa fa - exclamation - circle " > < / i > ' ) , $ ( " # offlinePlaceholder " ) . show ( ) , this . reconnectAnimation ( 0 ) } , showShortcutModal : function ( ) { window . arangoHelper . hotkeysFunctions . showHotkeysModal ( ) } , getVersion : function ( ) { var a = this ; $ . ajax ( { type : " GET " , cache : ! 1 , url : arangoHelper . databaseUrl ( " / _api / version " ) , contentType : " application / json " , processData : ! 1 , async : ! 0 , success : function ( b ) { a . showServerStatus ( ! 0 ) , a . isOffline = = = ! 0 & & ( a . isOffline = ! 1 , a . isOfflineCounter = 0 , a . firstLogin ? a . firstLogin = ! 1 : window . setTimeout ( function ( ) { a . showServerStatus ( ! 0 ) } , 1e3 ) , a . system . name = b . server , a . system . version = b . version , a . render ( ) ) } , error : function ( b ) { 401 = = = b . status ? ( a . showServerStatus ( ! 0 ) , window . App . navigate ( " login " , { trigger : ! 0 } ) ) : ( a . isOffline = ! 0 , a . isOfflineCounter + + , a . isOfflineCounter > = 1 & & a . showServerStatus ( ! 1 ) ) } } ) , a . system . hasOwnProperty ( " database " ) | | $ . ajax ( { type : " GET " , cache : ! 1 , url : arangoHelper . databaseUrl ( " / _api / database / current " ) , contentType : " application / json " , processData : ! 1 , async : ! 0 , success : function ( b ) { var c = b . result . name ; a . system . database = c ; var d = window . setInterval ( function ( ) { var b = $ ( " # databaseNavi " ) ; b & & ( window . clearTimeout ( d ) , d = null , a . render ( ) ) } , 50 ) } } ) } , renderVersion : function ( ) { this . system . hasOwnProperty ( " database " ) & & this . system . hasOwnProperty ( " name " ) & & $ ( this . el ) . html ( this . template . render ( { name : this . system . name , version : this . system . version , database : this . system . database } ) ) } , render : function ( ) { return this . system . version | | this . getVersion ( ) , $ ( this . el ) . html ( this . template . render ( { name : this . system . name , version : this . system . version } ) ) , this } } ) } ( ) , function ( ) { " use strict " ; window . FoxxActiveView = Backbone . View . extend ( { tagName : " div " , className : " tile pure - u - 1 - 1 pure - u - sm - 1 - 2 pure - u - md - 1 - 3 pure - u - lg - 1 - 4 pure - u - xl - 1 - 6 " , template : templateEngine . createTemplate ( " foxxActiveView . ejs " ) , _show : ! 0 , events : { click : " openAppDetailView " } , openAppDetailView : function ( ) { window . App . navigate ( " service / " + encodeURIComponent ( this . model . get ( " mount " ) ) , { trigger : ! 0 } ) } , toggle : function ( a , b ) { switch ( a ) { case " devel " : this . model . isDevelopment ( ) & & ( this . _show = b ) ; break ; case " production " : this . model . isDevelopment ( ) | | this . model . isSystem ( ) | | ( this . _show = b ) ; break ; case " system " : this . model . isSystem ( ) & & ( this . _show = b ) } this . _show ? $ ( this . el ) . show ( ) : $ ( this . el ) . hide ( ) } , render : function ( ) { return this . model . fetchThumbnail ( function ( ) { $ ( this . el ) . html ( this . template . render ( { model : this . model } ) ) ; var a = function ( ) { this . model . needsConfiguration ( ) & & ( $ ( this . el ) . find ( " . warning - icons " ) . length > 0 ? $ ( this . el ) . find ( " . warning - icons " ) . append ( ' < span class = " fa fa - cog " title = " Needs configuration " > < / span > ' ) : $ ( this . el ) . find ( " img " ) . after ( ' < span class = " warning - icons " > < span class = " fa fa - cog " title = " Needs configuration " > < / span > < / span > ' ) ) } . bind ( this ) , b = function ( ) { this . model . hasUnconfiguredDependencies ( ) & & ( $ ( this . el ) . find ( " . warning - icons " ) . length > 0 ? $ ( this . el ) . find ( " . warning - icons " ) . append ( ' < span class = " fa fa - cubes " title = " Unconfigured dependencies " > < / span > ' ) : $ ( this . el ) . find ( " img " ) . after ( ' < span class = " warning - icons " > < span class = " fa fa - cubes " title = " Unconfigured dependencies " > < / span > < / span > ' ) ) } . bind ( this ) ; this . model . getConfiguration ( a ) , this . model . getDependencies ( b ) } . bind ( this ) ) , $ ( this . el ) } } ) } ( ) , function ( ) { " use strict " ; var a = { ERROR_SERVICE_DOWNLOAD_FAILED : { code : 1752 , message : " service download failed " } } , b = templateEngine . createTemplate ( " applicationListView . ejs " ) , c = function ( a ) { this . collection = a . collection } , d = function ( b ) { var c = this ; if ( b . error = = = ! 1 ) this . collection . fetch ( { success : function ( ) { window . modalView . hide ( ) , c . reload ( ) , console . log ( b ) , arangoHelper . arangoNotification ( " Services " , " Service " + b . name + " installed . " ) } } ) ; else { var d = b ; switch ( b . hasOwnProperty ( " responseJSON " ) & & ( d = b . responseJSON ) , d . errorNum ) { case a . ERROR_SERVICE_DOWNLOAD_FAILED . code : arangoHelper . arangoError ( " Services " , " Unable to download application from the given repository . " ) ; break ; default : arangoHelper . arangoError ( " Services " , d . errorNum + " . " + d . errorMessage ) } } } , e = function ( ) { window . modalView . modalBindValidation ( { id : " new - app - mount " , validateInput : function ( ) { return [ { rule : Joi . string ( ) . regex ( / ^ ( \ / ( APP [ ^ \ / ] + | ( ? ! APP ) [ a - zA - Z0 - 9_ \ - % ] + ) ) + $ / i ) , msg : " May not contain / APP " } , { rule : Joi . string ( ) . regex ( / ^ ( \ / [ a - zA - Z0 - 9_ \ - % ] + ) + $ / ) , msg : " Can only contain [ a - zA - Z0 - 9_ - % ] " } , { rule : Joi . string ( ) . regex ( / ^ \ / ( [ ^ _ ] | _open \ / ) / ) , msg : " Mountpoints with _ are reserved for internal use " } , { rule : Joi . string ( ) . regex ( / [ ^ \ / ] $ / ) , msg : " May not end with / " } , { rule : Joi . string ( ) . regex ( / ^ \ / / ) , msg : " Has to start with / " } , { rule : Joi . string ( ) . required ( ) . min ( 2 ) , msg : " Has to be non - empty " } ] } } ) } , f = function ( ) { window . modalView . modalBindValidation ( { id : " repository " , validateInput : function ( ) { return [ { rule : Joi . string ( ) . required ( ) . regex ( / ^ [ a - zA - Z0 - 9_ - ] + \ / [ a - zA - Z0 - 9_ - ] + $ / ) , msg : " No valid Github account and repository . " } ] } } ) } , g = function ( ) { window . modalView . modalBindValidation ( { id : " new - app - author " , validateInput : function ( ) { return [ { rule : Joi . string ( ) . required ( ) . min ( 1 ) , msg : " Has to be non empty . " } ] } } ) , window . modalView . modalBindValidation ( { id : " new - app - name " , validateInput : function ( ) { return [ { rule : Joi . string ( ) . required ( ) . regex ( / ^ [ a - zA - Z \ - _ ] [ a - zA - Z0 - 9 \ - _ ] * $ / ) , msg : " Can only contain a to z , A to Z , 0 - 9 , ' - ' and ' _ ' . " } ] } } ) , window . modalView . modalBindValidation ( { id : " new - app - description " , validateInput : function ( ) { return [ { rule : Joi . string ( ) . required ( ) . min ( 1 ) , msg : " Has to be non empty . " } ] } } ) , window . modalView . modalBindValidation ( { id : " new - app - license " , validateInput : function ( ) { return [ { rule : Joi . string ( ) . required ( ) . regex ( / ^ [ a - zA - Z0 - 9 . , ; - ] + $ / ) , msg : " Has to be non empty . " } ] } } ) , window . modalView . modalTestAll ( ) } , h = function ( a ) { window . modalView . clearValidators ( ) ; var b = $ ( " # modalButton1 " ) ; switch ( this . _upgrade | | e ( ) , a ) { case " newApp " : b . html ( " Generate " ) , b . prop ( " disabled " , ! 1 ) , g ( ) ; break ; case " appstore " : b . html ( " Install " ) , b . prop ( " disabled " , ! 0 ) ; break ; case " github " : f ( ) , b . html ( " Install " ) , b . prop ( " disabled " , ! 1 ) ; break ; case " zip " : b . html ( " Install " ) , b . prop ( " disabled " , ! 1 ) } b . prop ( " disabled " ) | | window . modalView . modalTestAll ( ) | | b . prop ( " disabled " , ! 0 ) } , i = function ( a ) { var b = $ ( a . currentTarget ) . attr ( " href " ) . substr ( 1 ) ; h . call ( this , b ) } , j = function ( a ) { if ( h . call ( this , " appstore " ) , window . modalView . modalTestAll ( ) ) { var b , c ; this . _upgrade ? ( b = this . mount , c = $ ( " # new - app - teardown " ) . prop ( " checked " ) ) : b = window . arangoHelper . escapeHtml ( $ ( " # new - app - mount " ) . val ( ) ) ; var e = $ ( a . currentTarget ) . attr ( " appId " ) , f = $ ( a . currentTarget ) . attr ( " appVersion " ) ; void 0 ! = = c ? this . collection . installFromStore ( { name : e , version : f } , b , d . bind ( this ) , c ) : this . collection . installFromStore ( { name : e , version : f } , b , d . bind ( this ) ) , window . modalView . hide ( ) , arangoHelper . arangoNotification ( " Services " , " Installing " + e + " . " ) } } , k = function ( a , b ) { if ( void 0 = = = b ? b = this . _uploadData : this . _uploadData = b , b & & window . modalView . modalTestAll ( ) ) { var c , e , f ; this . _upgrade ? ( c = this . mount , e = Boolean ( $ ( " # new - app - teardown " ) . prop ( " checked " ) ) ) : c = window . arangoHelper . escapeHtml ( $ ( " # new - app - mount " ) . val ( ) ) , f = Boolean ( $ ( " # zip - app - islegacy " ) . prop ( " checked " ) ) , this . collection . installFromZip ( b . filename , c , d . bind ( this ) , f , e ) } } , l = function ( ) { if ( window . modalView . modalTestAll ( ) ) { var a , b , c , e , f ; this . _upgrade ? ( c = this . mount , e = $ ( " # new - app - teardown " ) . prop ( " checked " ) ) : c = window . arangoHelper . escapeHtml ( $ ( " # new - app - mount " ) . val ( ) ) , a = window . arangoHelper . escapeHtml ( $ ( " # repository " ) . val ( ) ) , b = window . arangoHelper . escapeHtml ( $ ( " # tag " ) . val ( ) ) , " " = = = b & & ( b = " master " ) ; var g = { url : window . arangoHelper . escapeHtml ( $ ( " # repository " ) . val ( ) ) , version : window . arangoHelper . escapeHtml ( $ ( " # tag " ) . val ( ) ) } ; try { Joi . assert ( a , Joi . string ( ) . regex ( / ^ [ a - zA - Z0 - 9_ - ] + \ / [ a - zA - Z0 - 9_ - ] + $ / ) ) } catch ( h ) { return } f = Boolean ( $ ( " # github - app - islegacy " ) . prop ( " checked " ) ) , this . collection . installFromGithub ( g , c , d . bind ( this ) , f , e ) } } , m = function ( ) { if ( window . modalView . modalTestAll ( ) ) { var a , b ; this . _upgrade ? ( a = this . mount , b = $ ( " # new - app - teardown " ) . prop ( " checked " ) ) : a = window . arangoHelper . escapeHtml ( $ ( " # new - app - mount " ) . val ( ) ) ; var c = { name : window . arangoHelper . escapeHtml ( $ ( " # new - app - name " ) . val ( ) ) , documentCollections : _ . map ( $ ( " # new - app - document - collections " ) . select2 ( " data " ) , function ( a ) { return window . arangoHelper . escapeHtml ( a . text ) } ) , edgeCollections : _ . map ( $ ( " # new - app - edge - collections " ) . select2 ( " data " ) , function ( a ) { return window . arangoHelper . escapeHtml ( a . text ) } ) , author : window . arangoHelper . escapeHtml ( $ ( " # new - app - author " ) . val ( ) ) , license : window . arangoHelper . escapeHtml ( $ ( " # new - app - license " ) . val ( ) ) , description : window . arangoHelper . escapeHtml ( $ ( " # new - app - description " ) . val ( ) ) } ; this . collection . generate ( c , a , d . bind ( this ) , b ) } } , n = function ( ) { var a = $ ( " . modal - body . tab - pane . active " ) . attr ( " id " ) ; switch ( a ) { case " newApp " : m . apply ( this ) ; break ; case " github " : l . apply ( this ) ; break ; case " zip " : k . apply ( this ) } } , o = function ( a , c ) { var d = [ ] , e = { " click # infoTab a " : i . bind ( a ) , " click . install - app " : j . bind ( a ) } ; d . push ( window . modalView . createSuccessButton ( " Generate " , n . bind ( a ) ) ) , window . modalView . show ( " modalApplicationMount . ejs " , " Install Service " , d , c , void 0 , void 0 , e ) , <nl> $ ( " # new - app - document - collections " ) . select2 ( { tags : [ ] , showSearchBox : ! 1 , minimumResultsForSearch : - 1 , width : " 336px " } ) , $ ( " # new - app - edge - collections " ) . select2 ( { tags : [ ] , showSearchBox : ! 1 , minimumResultsForSearch : - 1 , width : " 336px " } ) ; var f = function ( ) { var a = $ ( " # modalButton1 " ) ; a . prop ( " disabled " ) | | window . modalView . modalTestAll ( ) ? a . prop ( " disabled " , ! 1 ) : a . prop ( " disabled " , ! 0 ) } ; $ ( " . select2 - search - field input " ) . focusout ( function ( ) { f ( ) , window . setTimeout ( function ( ) { $ ( " . select2 - drop " ) . is ( " : visible " ) & & ( $ ( " # select2 - search - field input " ) . is ( " : focus " ) | | ( $ ( " # s2id_new - app - document - collections " ) . select2 ( " close " ) , $ ( " # s2id_new - app - edge - collections " ) . select2 ( " close " ) , f ( ) ) ) } , 200 ) } ) , $ ( " . select2 - search - field input " ) . focusin ( function ( ) { if ( $ ( " . select2 - drop " ) . is ( " : visible " ) ) { var a = $ ( " # modalButton1 " ) ; a . prop ( " disabled " , ! 0 ) } } ) , $ ( " # upload - foxx - zip " ) . uploadFile ( { url : arangoHelper . databaseUrl ( " / _api / upload ? multipart = true " ) , allowedTypes : " zip " , multiple : ! 1 , onSuccess : k . bind ( a ) } ) , $ . get ( " foxxes / fishbowl " , function ( a ) { var c = $ ( " # appstore - content " ) ; c . html ( " " ) , _ . each ( _ . sortBy ( a , " name " ) , function ( a ) { c . append ( b . render ( a ) ) } ) } ) . fail ( function ( ) { var a = $ ( " # appstore - content " ) ; a . append ( " < tr > < td > Store is not available . ArangoDB is not able to connect to github . com < / td > < / tr > " ) } ) } ; c . prototype . install = function ( a ) { this . reload = a , this . _upgrade = ! 1 , this . _uploadData = void 0 , delete this . mount , o ( this , ! 1 ) , window . modalView . clearValidators ( ) , e ( ) , g ( ) } , c . prototype . upgrade = function ( a , b ) { this . reload = b , this . _upgrade = ! 0 , this . _uploadData = void 0 , this . mount = a , o ( this , ! 0 ) , window . modalView . clearValidators ( ) , g ( ) } , window . FoxxInstallView = c } ( ) , function ( ) { " use strict " ; window . GraphManagementView = Backbone . View . extend ( { el : " # content " , template : templateEngine . createTemplate ( " graphManagementView . ejs " ) , edgeDefintionTemplate : templateEngine . createTemplate ( " edgeDefinitionTable . ejs " ) , eCollList : [ ] , removedECollList : [ ] , dropdownVisible : ! 1 , initialize : function ( a ) { this . options = a } , events : { " click # deleteGraph " : " deleteGraph " , " click . icon_arangodb_settings2 . editGraph " : " editGraph " , " click # createGraph " : " addNewGraph " , " keyup # graphManagementSearchInput " : " search " , " click # graphManagementSearchSubmit " : " search " , " click . tile - graph " : " redirectToGraphViewer " , " click # graphManagementToggle " : " toggleGraphDropdown " , " click . css - label " : " checkBoxes " , " change # graphSortDesc " : " sorting " } , toggleTab : function ( a ) { var b = a . currentTarget . id ; b = b . replace ( " tab - " , " " ) , $ ( " # tab - content - create - graph . tab - pane " ) . removeClass ( " active " ) , $ ( " # tab - content - create - graph # " + b ) . addClass ( " active " ) , " exampleGraphs " = = = b ? $ ( " # modal - dialog . modal - footer . button - success " ) . css ( " display " , " none " ) : $ ( " # modal - dialog . modal - footer . button - success " ) . css ( " display " , " initial " ) } , redirectToGraphViewer : function ( a ) { var b = $ ( a . currentTarget ) . attr ( " id " ) ; b = b . substr ( 0 , b . length - 5 ) , window . location . hash = window . location . hash . substr ( 0 , window . location . hash . length - 1 ) + " / " + encodeURIComponent ( b ) } , loadGraphViewer : function ( a , b ) { var c = function ( b ) { if ( b ) arangoHelper . arangoError ( " " , " " ) ; else { var c = this . collection . get ( a ) . get ( " edgeDefinitions " ) ; if ( ! c | | 0 = = = c . length ) return ; var d = { type : " gharial " , graphName : a , baseUrl : arangoHelper . databaseUrl ( " / " ) } , e = $ ( " # content " ) . width ( ) - 75 ; $ ( " # content " ) . html ( " " ) ; var f = arangoHelper . calculateCenterDivHeight ( ) ; this . ui = new GraphViewerUI ( $ ( " # content " ) [ 0 ] , d , e , $ ( " . centralRow " ) . height ( ) - 135 , { nodeShaper : { label : " _key " , color : { type : " attribute " , key : " _key " } } } , ( ! 0 ) ) , $ ( " . contentDiv " ) . height ( f ) } } . bind ( this ) ; b ? this . collection . fetch ( { cache : ! 1 , success : function ( ) { c ( ) } } ) : c ( ) } , handleResize : function ( a ) { this . width & & this . width = = = a | | ( this . width = a , this . ui & & this . ui . changeWidth ( a ) ) } , addNewGraph : function ( a ) { a . preventDefault ( ) , this . createEditGraphModal ( ) } , deleteGraph : function ( ) { var a = this , b = $ ( " # editGraphName " ) [ 0 ] . value ; if ( $ ( " # dropGraphCollections " ) . is ( " : checked " ) ) { var c = function ( c ) { c ? ( a . collection . remove ( a . collection . get ( b ) ) , a . updateGraphManagementView ( ) , window . modalView . hide ( ) ) : ( window . modalView . hide ( ) , arangoHelper . arangoError ( " Graph " , " Could not delete Graph . " ) ) } ; this . collection . dropAndDeleteGraph ( b , c ) } else this . collection . get ( b ) . destroy ( { success : function ( ) { a . updateGraphManagementView ( ) , window . modalView . hide ( ) } , error : function ( a , b ) { var c = JSON . parse ( b . responseText ) , d = c . errorMessage ; arangoHelper . arangoError ( d ) , window . modalView . hide ( ) } } ) } , checkBoxes : function ( a ) { var b = a . currentTarget . id ; $ ( " # " + b ) . click ( ) } , toggleGraphDropdown : function ( ) { $ ( " # graphSortDesc " ) . attr ( " checked " , this . collection . sortOptions . desc ) , $ ( " # graphManagementToggle " ) . toggleClass ( " activated " ) , $ ( " # graphManagementDropdown2 " ) . slideToggle ( 200 ) } , sorting : function ( ) { $ ( " # graphSortDesc " ) . is ( " : checked " ) ? this . collection . setSortingDesc ( ! 0 ) : this . collection . setSortingDesc ( ! 1 ) , $ ( " # graphManagementDropdown " ) . is ( " : visible " ) ? this . dropdownVisible = ! 0 : this . dropdownVisible = ! 1 , this . render ( ) } , createExampleGraphs : function ( a ) { var b = $ ( a . currentTarget ) . attr ( " graph - id " ) , c = this ; $ . ajax ( { type : " POST " , url : arangoHelper . databaseUrl ( " / _admin / aardvark / graph - examples / create / " + encodeURIComponent ( b ) ) , success : function ( ) { window . modalView . hide ( ) , c . updateGraphManagementView ( ) , arangoHelper . arangoNotification ( " Example Graphs " , " Graph : " + b + " created . " ) } , error : function ( a ) { if ( window . modalView . hide ( ) , a . responseText ) try { var c = JSON . parse ( a . responseText ) ; arangoHelper . arangoError ( " Example Graphs " , c . errorMessage ) } catch ( d ) { arangoHelper . arangoError ( " Example Graphs " , " Could not create example graph : " + b ) } else arangoHelper . arangoError ( " Example Graphs " , " Could not create example graph : " + b ) } } ) } , toggleSmartGraph : function ( ) { var a , b = this ; if ( $ ( " # new - is_smart " ) . is ( " : checked " ) = = = ! 0 ) { for ( a = 0 ; a < this . counter ; a + + ) $ ( " # newEdgeDefinitions " + a ) . select2 ( { tags : [ ] } ) , b . cachedNewEdgeDefinitions = $ ( " # newEdgeDefinitions " + a ) . select2 ( " data " ) , b . cachedNewEdgeDefinitionsState = $ ( " # newEdgeDefinitions " + a ) . attr ( " disabled " ) , $ ( " # newEdgeDefinitions " + a ) . select2 ( " data " , " " ) , $ ( " # newEdgeDefinitions " + a ) . attr ( " disabled " , ! 1 ) , $ ( " # newEdgeDefinitions " + a ) . change ( ) , $ ( " # fromCollections " + a ) . select2 ( { tags : [ ] } ) , b . cachedFromCollections = $ ( " # fromCollections " + a ) . select2 ( " data " ) , b . cachedFromCollectionsState = $ ( " # fromCollections " + a ) . attr ( " disabled " ) , $ ( " # fromCollections " + a ) . select2 ( " data " , " " ) , $ ( " # fromCollections " + a ) . attr ( " disabled " , ! 1 ) , $ ( " # fromCollections " + a ) . change ( ) , $ ( " # toCollections " + a ) . select2 ( { tags : [ ] } ) , b . cachedToCollections = $ ( " # toCollections " + a ) . select2 ( " data " ) , b . cachedToCollectionsState = $ ( " # toCollections " + a ) . attr ( " disabled " ) , $ ( " # toCollections " + a ) . select2 ( " data " , " " ) , $ ( " # toCollections " + a ) . attr ( " disabled " , ! 1 ) , $ ( " # toCollections " + a ) . change ( ) ; $ ( " # newVertexCollections " ) . select2 ( { tags : [ ] } ) , b . cachedNewVertexCollections = $ ( " # newVertexCollections " ) . select2 ( " data " ) , b . cachedNewVertexCollectionsState = $ ( " # newVertexCollections " ) . attr ( " disabled " ) , $ ( " # newVertexCollections " ) . select2 ( " data " , " " ) , $ ( " # newVertexCollections " ) . attr ( " disabled " , ! 1 ) , $ ( " # newVertexCollections " ) . change ( ) } else { var c = [ ] , d = this . options . collectionCollection . models ; for ( d . forEach ( function ( a ) { a . get ( " isSystem " ) | | c . push ( a . id ) } ) , a = 0 ; a < this . counter ; a + + ) $ ( " # newEdgeDefinitions " + a ) . select2 ( { tags : this . eCollList } ) , $ ( " # newEdgeDefinitions " + a ) . select2 ( " data " , b . cachedNewEdgeDefinitions ) , $ ( " # newEdgeDefinitions " + a ) . attr ( " disabled " , b . cachedNewEdgeDefinitionsState ) , $ ( " # fromCollections " + a ) . select2 ( { tags : c } ) , $ ( " # fromCollections " + a ) . select2 ( " data " , b . cachedFromCollections ) , $ ( " # fromCollections " + a ) . attr ( " disabled " , b . cachedFromCollectionsState ) , $ ( " # toCollections " + a ) . select2 ( { tags : c } ) , $ ( " # toCollections " + a ) . select2 ( " data " , b . cachedToCollections ) , $ ( " # toCollections " + a ) . attr ( " disabled " , b . cachedToCollectionsState ) ; $ ( " # newVertexCollections " ) . select2 ( { tags : c } ) , $ ( " # newVertexCollections " ) . select2 ( " data " , b . cachedNewVertexCollections ) , $ ( " # newVertexCollections " ) . attr ( " disabled " , b . cachedNewVertexCollectionsState ) } } , render : function ( a , b ) { var c = this ; return this . collection . fetch ( { cache : ! 1 , success : function ( ) { c . collection . sort ( ) , $ ( c . el ) . html ( c . template . render ( { graphs : c . collection , searchString : " " } ) ) , c . dropdownVisible = = = ! 0 & & ( $ ( " # graphManagementDropdown2 " ) . show ( ) , $ ( " # graphSortDesc " ) . attr ( " checked " , c . collection . sortOptions . desc ) , $ ( " # graphManagementToggle " ) . toggleClass ( " activated " ) , $ ( " # graphManagementDropdown " ) . show ( ) ) , c . events [ ' change tr [ id * = " newEdgeDefinitions " ] ' ] = c . setFromAndTo . bind ( c ) , c . events [ " click . graphViewer - icon - button " ] = c . addRemoveDefinition . bind ( c ) , c . events [ " click # graphTab a " ] = c . toggleTab . bind ( c ) , c . events [ " click . createExampleGraphs " ] = c . createExampleGraphs . bind ( c ) , c . events [ " click # new - is_smart " ] = c . toggleSmartGraph . bind ( c ) , c . events [ " focusout . select2 - search - field input " ] = function ( a ) { $ ( " . select2 - drop " ) . is ( " : visible " ) & & ( $ ( " # select2 - search - field input " ) . is ( " : focus " ) | | window . setTimeout ( function ( ) { $ ( a . currentTarget ) . parent ( ) . parent ( ) . parent ( ) . select2 ( " close " ) } , 200 ) ) } , arangoHelper . setCheckboxStatus ( " # graphManagementDropdown " ) } } ) , a & & this . loadGraphViewer ( a , b ) , this } , setFromAndTo : function ( a ) { console . log ( a ) , a . stopPropagation ( ) ; var b , c = this . calculateEdgeDefinitionMap ( ) ; if ( ! $ ( " # new - is_smart " ) . is ( " : checked " ) ) { if ( a . added ) { if ( this . eCollList . indexOf ( a . added . id ) = = = - 1 & & this . removedECollList . indexOf ( a . added . id ) ! = = - 1 ) return b = a . currentTarget . id . split ( " row_newEdgeDefinitions " ) [ 1 ] , $ ( ' input [ id * = " newEdgeDefinitions ' + b + ' " ] ' ) . select2 ( " val " , null ) , void $ ( ' input [ id * = " newEdgeDefinitions ' + b + ' " ] ' ) . attr ( " placeholder " , " The collection " + a . added . id + " is already used . " ) ; this . removedECollList . push ( a . added . id ) , this . eCollList . splice ( this . eCollList . indexOf ( a . added . id ) , 1 ) } else this . eCollList . push ( a . removed . id ) , this . removedECollList . splice ( this . removedECollList . indexOf ( a . removed . id ) , 1 ) ; c [ a . val ] ? ( b = a . currentTarget . id . split ( " row_newEdgeDefinitions " ) [ 1 ] , $ ( " # s2id_fromCollections " + b ) . select2 ( " val " , c [ a . val ] . from ) , $ ( " # fromCollections " + b ) . attr ( " disabled " , ! 0 ) , $ ( " # s2id_toCollections " + b ) . select2 ( " val " , c [ a . val ] . to ) , $ ( " # toCollections " + b ) . attr ( " disabled " , ! 0 ) ) : ( b = a . currentTarget . id . split ( " row_newEdgeDefinitions " ) [ 1 ] , $ ( " # s2id_fromCollections " + b ) . select2 ( " val " , null ) , $ ( " # fromCollections " + b ) . attr ( " disabled " , ! 1 ) , $ ( " # s2id_toCollections " + b ) . select2 ( " val " , null ) , $ ( " # toCollections " + b ) . attr ( " disabled " , ! 1 ) ) } } , editGraph : function ( a ) { a . stopPropagation ( ) , this . collection . fetch ( { cache : ! 1 } ) , this . graphToEdit = this . evaluateGraphName ( $ ( a . currentTarget ) . attr ( " id " ) , " _settings " ) ; var b = this . collection . findWhere ( { _key : this . graphToEdit } ) ; this . createEditGraphModal ( b ) } , saveEditedGraph : function ( ) { var a , b , c , d , e , f = $ ( " # editGraphName " ) [ 0 ] . value , g = _ . pluck ( $ ( " # newVertexCollections " ) . select2 ( " data " ) , " text " ) , h = [ ] , i = { } ; if ( e = $ ( " [ id ^ = s2id_newEdgeDefinitions ] " ) . toArray ( ) , e . forEach ( function ( e ) { if ( d = $ ( e ) . attr ( " id " ) , d = d . replace ( " s2id_newEdgeDefinitions " , " " ) , a = _ . pluck ( $ ( " # s2id_newEdgeDefinitions " + d ) . select2 ( " data " ) , " text " ) [ 0 ] , a & & " " ! = = a & & ( b = _ . pluck ( $ ( " # s2id_fromCollections " + d ) . select2 ( " data " ) , " text " ) , c = _ . pluck ( $ ( " # s2id_toCollections " + d ) . select2 ( " data " ) , " text " ) , 0 ! = = b . length & & 0 ! = = c . length ) ) { var f = { collection : a , from : b , to : c } ; h . push ( f ) , i [ a ] = f } } ) , 0 = = = h . length ) return $ ( " # s2id_newEdgeDefinitions0 . select2 - choices " ) . css ( " border - color " , " red " ) , $ ( " # s2id_newEdgeDefinitions0 " ) . parent ( ) . parent ( ) . next ( ) . find ( " . select2 - choices " ) . css ( " border - color " , " red " ) , void $ ( " # s2id_newEdgeDefinitions0 " ) . parent ( ) . parent ( ) . next ( ) . next ( ) . find ( " . select2 - choices " ) . css ( " border - color " , " red " ) ; var j = this . collection . findWhere ( { _key : f } ) , k = j . get ( " edgeDefinitions " ) , l = j . get ( " orphanCollections " ) , m = [ ] ; l . forEach ( function ( a ) { g . indexOf ( a ) = = = - 1 & & j . deleteVertexCollection ( a ) } ) , g . forEach ( function ( a ) { l . indexOf ( a ) = = = - 1 & & j . addVertexCollection ( a ) } ) ; var n = [ ] , o = [ ] , p = [ ] ; k . forEach ( function ( a ) { var b = a . collection ; m . push ( b ) ; var c = i [ b ] ; void 0 = = = c ? p . push ( b ) : JSON . stringify ( c ) ! = = JSON . stringify ( a ) & & o . push ( b ) } ) , h . forEach ( function ( a ) { var b = a . collection ; m . indexOf ( b ) = = = - 1 & & n . push ( b ) } ) , n . forEach ( function ( a ) { j . addEdgeDefinition ( i [ a ] ) } ) , o . forEach ( function ( a ) { j . modifyEdgeDefinition ( i [ a ] ) } ) , p . forEach ( function ( a ) { j . deleteEdgeDefinition ( a ) } ) , this . updateGraphManagementView ( ) , window . modalView . hide ( ) } , evaluateGraphName : function ( a , b ) { var c = a . lastIndexOf ( b ) ; return a . substring ( 0 , c ) } , search : function ( ) { var a , b , c , d ; a = $ ( " # graphManagementSearchInput " ) , b = $ ( " # graphManagementSearchInput " ) . val ( ) , d = this . collection . filter ( function ( a ) { return a . get ( " _key " ) . indexOf ( b ) ! = = - 1 } ) , $ ( this . el ) . html ( this . template . render ( { graphs : d , searchString : b } ) ) , a = $ ( " # graphManagementSearchInput " ) , c = a . val ( ) . length , a . focus ( ) , a [ 0 ] . setSelectionRange ( c , c ) } , updateGraphManagementView : function ( ) { var a = this ; this . collection . fetch ( { cache : ! 1 , success : function ( ) { a . render ( ) } } ) } , createNewGraph : function ( ) { var a , b , c , d , e , f = $ ( " # createNewGraphName " ) . val ( ) , g = _ . pluck ( $ ( " # newVertexCollections " ) . select2 ( " data " ) , " text " ) , h = [ ] , i = this ; if ( ! f ) return arangoHelper . arangoError ( " A name for the graph has to be provided . " ) , 0 ; if ( this . collection . findWhere ( { _key : f } ) ) return arangoHelper . arangoError ( " The graph ' " + f + " ' already exists . " ) , 0 ; if ( e = $ ( " [ id ^ = s2id_newEdgeDefinitions ] " ) . toArray ( ) , e . forEach ( function ( e ) { d = $ ( e ) . attr ( " id " ) , d = d . replace ( " s2id_newEdgeDefinitions " , " " ) , a = _ . pluck ( $ ( " # s2id_newEdgeDefinitions " + d ) . select2 ( " data " ) , " text " ) [ 0 ] , a & & " " ! = = a & & ( b = _ . pluck ( $ ( " # s2id_fromCollections " + d ) . select2 ( " data " ) , " text " ) , c = _ . pluck ( $ ( " # s2id_toCollections " + d ) . select2 ( " data " ) , " text " ) , 1 ! = = b & & 1 ! = = c & & h . push ( { collection : a , from : b , to : c } ) ) } ) , 0 = = = h . length ) return $ ( " # s2id_newEdgeDefinitions0 . select2 - choices " ) . css ( " border - color " , " red " ) , $ ( " # s2id_newEdgeDefinitions0 " ) . parent ( ) . parent ( ) . next ( ) . find ( " . select2 - choices " ) . css ( " border - color " , " red " ) , void $ ( " # s2id_newEdgeDefinitions0 " ) . parent ( ) . parent ( ) . next ( ) . next ( ) . find ( " . select2 - choices " ) . css ( " border - color " , " red " ) ; var j = { name : f , edgeDefinitions : h , orphanCollections : g } ; if ( $ ( " # new - is_smart " ) . is ( " : checked " ) ) { if ( " " = = = $ ( " # new - numberOfShards " ) . val ( ) | | " " = = = $ ( " # new - smartGraphAttribute " ) . val ( ) ) return ; j . isSmart = ! 0 , j . options = { numberOfShards : $ ( " # new - numberOfShards " ) . val ( ) , smartGraphAttribute : $ ( " # new - smartGraphAttribute " ) . val ( ) } } this . collection . create ( j , { success : function ( ) { i . updateGraphManagementView ( ) , window . modalView . hide ( ) } , error : function ( a , b ) { var c = JSON . parse ( b . responseText ) , d = c . errorMessage ; d = d . replace ( " < " , " " ) , d = d . replace ( " > " , " " ) , arangoHelper . arangoError ( d ) } } ) } , createEditGraphModal : function ( a ) { var b , c = [ ] , d = [ ] , e = [ ] , f = this . options . collectionCollection . models , g = this , h = " " , i = [ { collection : " " , from : " " , to : " " } ] , j = " " , k = function ( a , b ) { return a = a . toLowerCase ( ) , b = b . toLowerCase ( ) , a < b ? - 1 : a > b ? 1 : 0 } ; if ( this . eCollList = [ ] , this . removedECollList = [ ] , f . forEach ( function ( a ) { a . get ( " isSystem " ) | | ( " edge " = = = a . get ( " type " ) ? g . eCollList . push ( a . id ) : d . push ( a . id ) ) } ) , window . modalView . enableHotKeys = ! 1 , this . counter = 0 , a ? ( b = " Edit Graph " , h = a . get ( " _key " ) , i = a . get ( " edgeDefinitions " ) , i & & 0 ! = = i . length | | ( i = [ { collection : " " , from : " " , to : " " } ] ) , j = a . get ( " orphanCollections " ) , e . push ( window . modalView . createReadOnlyEntry ( " editGraphName " , " Name " , h , " The name to identify the graph . Has to be unique " ) ) , c . push ( window . modalView . createDeleteButton ( " Delete " , this . deleteGraph . bind ( this ) ) ) , c . push ( window . modalView . createNotificationButton ( " Reset display settings " , this . resetDisplaySettings . bind ( this ) ) ) , c . push ( window . modalView . createSuccessButton ( " Save " , this . saveEditedGraph . bind ( this ) ) ) ) : ( b = " Create Graph " , e . push ( window . modalView . createTextEntry ( " createNewGraphName " , " Name " , " " , " The name to identify the graph . Has to be unique . " , " graphName " , ! 0 ) ) , c . push ( window . modalView . createSuccessButton ( " Create " , this . createNewGraph . bind ( this ) ) ) ) , i . forEach ( function ( a ) { 0 = = = g . counter ? ( a . collection & & ( g . removedECollList . push ( a . collection ) , g . eCollList . splice ( g . eCollList . indexOf ( a . collection ) , 1 ) ) , e . push ( window . modalView . createSelect2Entry ( " newEdgeDefinitions " + g . counter , " Edge definitions " , a . collection , " An edge definition defines a relation of the graph " , " Edge definitions " , ! 0 , ! 1 , ! 0 , 1 , g . eCollList . sort ( k ) ) ) ) : e . push ( window . modalView . createSelect2Entry ( " newEdgeDefinitions " + g . counter , " Edge definitions " , a . collection , " An edge definition defines a relation of the graph " , " Edge definitions " , ! 1 , ! 0 , ! 1 , 1 , g . eCollList . sort ( k ) ) ) , e . push ( window . modalView . createSelect2Entry ( " fromCollections " + g . counter , " fromCollections " , a . from , " The collections that contain the start vertices of the relation . " , " fromCollections " , ! 0 , ! 1 , ! 1 , 10 , d . sort ( k ) ) ) , e . push ( window . modalView . createSelect2Entry ( " toCollections " + g . counter , " toCollections " , a . to , " The collections that contain the end vertices of the relation . " , " toCollections " , ! 0 , ! 1 , ! 1 , 10 , d . sort ( k ) ) ) , g . counter + + } ) , e . push ( window . modalView . createSelect2Entry ( " newVertexCollections " , " Vertex collections " , j , " Collections that are part of a graph but not used in an edge definition " , " Vertex Collections " , ! 1 , ! 1 , ! 1 , 10 , d . sort ( k ) ) ) , window . frontendConfig . isEnterprise = = = ! 0 ) { var l = { } , m = [ ] ; m . push ( window . modalView . createCheckboxEntry ( " new - is_smart " , " Smart Graph " , ! 0 , " Create a Smart Graph ? Edge and vertex collections will be automatically generated . They are not allowed to be present before graph creation . " , ! 1 ) ) , m . push ( window . modalView . createTextEntry ( " new - numberOfShards " , " Shards " , " " , " Number of shards the smart graph is using . " , " " , ! 1 , [ { rule : Joi . string ( ) . allow ( " " ) . optional ( ) . regex ( / ^ [ 0 - 9 ] * $ / ) , msg : " Must be a number . " } ] ) ) , m . push ( window . modalView . createTextEntry ( " new - smartGraphAttribute " , " SmartGraph Attribute " , " " , " The attribute name that is used to smartly shard the vertices of a graph . \ nEvery vertex in this Graph has to have this attribute . \ nCannot be modified later . " , " " , ! 1 , [ { rule : Joi . string ( ) , msg : " Must be a string . " } ] ) ) , l . header = " Smart Graph " , l . content = m , window . modalView . show ( " modalGraphTable . ejs " , b , c , e , l , void 0 , this . events ) } else window . modalView . show ( " modalGraphTable . ejs " , b , c , e , void 0 , void 0 , this . events ) ; if ( a ) { $ ( " . modal - body table " ) . css ( " border - collapse " , " separate " ) ; var n ; for ( $ ( " . modal - body . spacer " ) . remove ( ) , n = 0 ; n < = this . counter ; n + + ) $ ( " # row_fromCollections " + n ) . show ( ) , $ ( " # row_toCollections " + n ) . show ( ) , $ ( " # row_newEdgeDefinitions " + n ) . addClass ( " first " ) , $ ( " # row_fromCollections " + n ) . addClass ( " middle " ) , $ ( " # row_toCollections " + n ) . addClass ( " last " ) , $ ( " # row_toCollections " + n ) . after ( ' < tr id = " spacer ' + n + ' " class = " spacer " > < / tr > ' ) ; $ ( " # graphTab " ) . hide ( ) , $ ( " # modal - dialog . modal - delete - confirmation " ) . append ( ' < fieldset > < input type = " checkbox " id = " dropGraphCollections " name = " " value = " " > < label for = " dropGraphCollections " > also drop collections ? < / label > < / fieldset > ' ) } } , resetDisplaySettings : function ( ) { var a = $ ( " # editGraphName " ) . val ( ) , b = new window . GraphSettingsView ( { name : a , userConfig : window . App . userConfig } ) ; b . setDefaults ( ! 0 , ! 0 ) , b . remove ( ) , window . modalView . hide ( ) , arangoHelper . arangoNotification ( " Graph " , " Reset successful . " ) } , addRemoveDefinition : function ( a ) { var b = [ ] , c = this . options . collectionCollection . models ; c . forEach ( function ( a ) { a . get ( " isSystem " ) | | b . push ( a . id ) } ) , a . stopPropagation ( ) ; var d , e = $ ( a . currentTarget ) . attr ( " id " ) ; if ( e . indexOf ( " addAfter_newEdgeDefinitions " ) = = = - 1 ) e . indexOf ( " remove_newEdgeDefinitions " ) ! = = - 1 & & ( d = e . split ( " remove_newEdgeDefinitions " ) [ 1 ] , $ ( " # row_newEdgeDefinitions " + d ) . remove ( ) , $ ( " # row_fromCollections " + d ) . remove ( ) , $ ( " # row_toCollections " + d ) . remove ( ) , $ ( " # spacer " + d ) . remove ( ) ) ; else { this . counter + + , $ ( " # row_newVertexCollections " ) . before ( this . edgeDefintionTemplate . render ( { number : this . counter } ) ) , $ ( " # newEdgeDefinitions " + this . counter ) . select2 ( { tags : this . eCollList , showSearchBox : ! 1 , minimumResultsForSearch : - 1 , width : " 336px " , maximumSelectionSize : 1 } ) , $ ( " # fromCollections " + this . counter ) . select2 ( { tags : b , showSearchBox : ! 1 , minimumResultsForSearch : - 1 , width : " 336px " , maximumSelectionSize : 10 } ) , $ ( " # toCollections " + this . counter ) . select2 ( { tags : b , showSearchBox : ! 1 , minimumResultsForSearch : - 1 , width : " 336px " , maximumSelectionSize : 10 } ) , window . modalView . undelegateEvents ( ) , window . modalView . delegateEvents ( this . events ) ; var f ; for ( $ ( " . modal - body . spacer " ) . remove ( ) , f = 0 ; f < = this . counter ; f + + ) $ ( " # row_fromCollections " + f ) . show ( ) , $ ( " # row_toCollections " + f ) . show ( ) , $ ( " # row_newEdgeDefinitions " + f ) . addClass ( " first " ) , $ ( " # row_fromCollections " + f ) . addClass ( " middle " ) , $ ( " # row_toCollections " + f ) . addClass ( " last " ) , $ ( " # row_toCollections " + f ) . after ( ' < tr id = " spacer ' + f + ' " class = " spacer " > < / tr > ' ) } } , calculateEdgeDefinitionMap : function ( ) { var a = { } ; return this . collection . models . forEach ( function ( b ) { b . get ( " edgeDefinitions " ) . forEach ( function ( b ) { a [ b . collection ] = { from : b . from , to : b . to } } ) } ) , a } } ) } ( ) , function ( ) { " use strict " ; window . GraphSettingsView = Backbone . View . extend ( { el : " # graphSettingsContent " , remove : function ( ) { return this . $ el . empty ( ) . off ( ) , this . stopListening ( ) , this } , general : { graph : { type : " divider " , name : " Graph " } , nodeStart : { type : " string " , name : " Startnode " , desc : " A valid node id . If empty , a random node will be chosen . " , value : 2 } , layout : { type : " select " , name : " Layout " , desc : " Different graph algorithms . No overlap is very fast ( more than 5000 nodes ) , force is slower ( less than 5000 nodes ) and fruchtermann is the slowest ( less than 500 nodes ) . " , noverlap : { name : " No overlap " , val : " noverlap " } , force : { name : " Force " , val : " force " } , fruchtermann : { name : " Fruchtermann " , val : " fruchtermann " } } , renderer : { type : " select " , name : " Renderer " , desc : " Canvas enables editing , WebGL is only for displaying a graph but much faster . " , canvas : { name : " Canvas " , val : " canvas " } , webgl : { name : " WebGL ( experimental ) " , val : " webgl " } } , depth : { desc : " Search depth , starting from your start node . " , type : " number " , name : " Search Depth " , value : 2 } , limit : { desc : " Limit nodes count . If empty or zero , no limit is set . " , type : " number " , name : " Limit " , value : 250 } } , specific : { nodes : { type : " divider " , name : " Nodes " } , nodeLabel : { type : " string " , name : " Label " , desc : " Node label . Please choose a valid and available node attribute . " , " default " : " _key " } , nodeLabelByCollection : { type : " select " , name : " Add Collection Name " , desc : " Append collection name to the label ? " , yes : { name : " Yes " , val : " true " } , no : { name : " No " , val : " false " } } , nodeColorByCollection : { type : " select " , name : " Color By Collections " , no : { name : " No " , val : " false " } , yes : { name : " Yes " , val : " true " } , desc : " Should nodes be colorized by their collection ? If enabled , node color and node color attribute will be ignored . " } , nodeColor : { type : " color " , name : " Color " , desc : " Default node color . RGB or HEX value . " , " default " : " # 2ecc71 " } , nodeColorAttribute : { type : " string " , name : " Color Attribute " , desc : " If an attribute is given , nodes will then be colorized by the attribute . This setting ignores default node color if set . " } , nodeSizeByEdges : { type : " select " , name : " Size By Connections " , yes : { name : " Yes " , val : " true " } , no : { name : " No " , val : " false " } , desc : " Should nodes be sized by their edges count ? If enabled , node sizing attribute will be ignored . " } , nodeSize : { type : " string " , name : " Sizing Attribute " , desc : " Default node size . Numeric value > 0 . " } , edges : { type : " divider " , name : " Edges " } , edgeLabel : { type : " string " , name : " Label " , desc : " Default edge label . " } , edgeLabelByCollection : { type : " select " , name : " Add Collection Name " , desc : " Set label text by collection . If activated edge label attribute will be ignored . " , yes : { name : " Yes " , val : " true " } , no : { name : " No " , val : " false " } } , edgeColorByCollection : { type : " select " , name : " Color By Collections " , no : { name : " No " , val : " false " } , yes : { name : " Yes " , val : " true " } , desc : " Should edges be colorized by their collection ? If enabled , edge color and edge color attribute will be ignored . " } , edgeColor : { type : " color " , name : " Color " , desc : " Default edge color . RGB or HEX value . " , " default " : " # cccccc " } , edgeColorAttribute : { type : " string " , name : " Color Attribute " , desc : " If an attribute is given , edges will then be colorized by the attribute . This setting ignores default edge color if set . " } , edgeEditable : { type : " select " , hide : " true " , name : " Editable " , yes : { name : " Yes " , val : " true " } , no : { name : " No " , val : " false " } , desc : " Should edges be editable ? " } , edgeType : { type : " select " , name : " Type " , desc : " The type of the edge " , line : { name : " Line " , val : " line " } , arrow : { name : " Arrow " , val : " arrow " } , curve : { name : " Curve " , val : " curve " } , dotted : { name : " Dotted " , val : " dotted " } , dashed : { name : " Dashed " , val : " dashed " } , tapered : { name : " Tapered " , val : " tapered " } } } , template : templateEngine . createTemplate ( " graphSettingsView . ejs " ) , initialize : function ( a ) { this . name = a . name , this . userConfig = a . userConfig , this . saveCallback = a . saveCallback , a . noDefinedGraph & & ( this . noDefinedGraph = a . noDefinedGraph ) } , events : { " click # saveGraphSettings " : " saveGraphSettings " , " click # restoreGraphSettings " : " setDefaults " , " keyup # graphSettingsView input " : " checkEnterKey " , " keyup # graphSettingsView select " : " checkEnterKey " , ' change input [ type = " range " ] ' : " saveGraphSettings " , ' change input [ type = " color " ] ' : " checkColor " , " change select " : " saveGraphSettings " , " focus # graphSettingsView input " : " lastFocus " , " focus # graphSettingsView select " : " lastFocus " , ' focusout # graphSettingsView input [ type = " text " ] ' : " checkinput " } , lastFocus : function ( a ) { this . lastFocussed = a . currentTarget . id , this . lastFocussedValue = $ ( a . currentTarget ) . val ( ) } , checkinput : function ( a ) { new Date - this . lastSaved > 500 & & a . currentTarget . id = = = this . lastFocussed & & this . lastFocussedValue ! = = $ ( a . currentTarget ) . val ( ) & & this . saveGraphSettings ( ) } , checkEnterKey : function ( a ) { 13 = = = a . keyCode & & this . saveGraphSettings ( a ) } , getGraphSettings : function ( a ) { var b = this , c = frontendConfig . db + " _ " + this . name ; this . userConfig . fetch ( { success : function ( d ) { b . graphConfig = d . toJSON ( ) . graphs [ c ] , a & & b . continueRender ( ) } } ) } , checkColor : function ( ) { this . saveGraphSettings ( null , ! 0 ) } , saveGraphSettings : function ( a , b , c , d , e , f ) { var g = this , h = function ( ) { var a = ! $ ( " # g_nodeColor " ) . is ( " : disabled " ) , b = ! $ ( " # g_edgeColor " ) . is ( " : disabled " ) ; window . App . graphViewer . updateColors ( a , b , $ ( " # g_nodeColor " ) . val ( ) , $ ( " # g_edgeColor " ) . val ( ) ) } ; if ( this . noDefinedGraph ) { var i ; b ? h ( ) : " g_layout " = = = a . currentTarget . id ? window . App . graphViewer . rerenderAQL ( $ ( " # g_layout " ) . val ( ) , null ) : " g_nodeColorByCollection " = = = a . currentTarget . id ? ( i = $ ( " # g_nodeColorByCollection " ) . val ( ) , " true " = = = i ? window . App . graphViewer . switchNodeColorByCollection ( ! 0 ) : window . App . graphViewer . switchNodeColorByCollection ( ! 1 ) ) : " g_edgeColorByCollection " = = = a . currentTarget . id ? ( i = $ ( " # g_edgeColorByCollection " ) . val ( ) , " true " = = = i ? window . App . graphViewer . switchEdgeColorByCollection ( ! 0 ) : window . App . graphViewer . switchEdgeColorByCollection ( ! 1 ) ) : " g_nodeSizeByEdges " = = = a . currentTarget . id ? ( i = $ ( " # g_nodeSizeByEdges " ) . val ( ) , " true " = = = i ? window . App . graphViewer . switchNodeSizeByCollection ( ! 0 ) : window . App . graphViewer . switchNodeSizeByCollection ( ! 1 ) ) : " g_edgeType " = = = a . currentTarget . id & & window . App . graphViewer . switchEdgeType ( $ ( " # g_edgeType " ) . val ( ) ) } else { g . lastSaved = new Date ; var j = frontendConfig . db + " _ " + this . name , k = { } ; if ( d ) k [ j ] = d ; else { var l , m = { } ; $ ( " # graphSettingsView select " ) . each ( function ( a , b ) { l = b . id , m [ l . substr ( 2 , b . id . length ) ] = $ ( b ) . val ( ) } ) , $ ( " # graphSettingsView input " ) . each ( function ( a , b ) { l = b . id , m [ l . substr ( 2 , b . id . length ) ] = $ ( b ) . val ( ) } ) , k [ j ] = m } c & & ( k [ j ] . nodeStart = c ) ; var n = function ( ) { if ( window . App . graphViewer ) { var c ; if ( a ) { if ( " g_layout " = = = a . currentTarget . id ) return void window . App . graphViewer . switchLayout ( $ ( " # g_layout " ) . val ( ) ) ; if ( " g_nodeColorByCollection " = = = a . currentTarget . id ) return c = $ ( " # g_nodeColorByCollection " ) . val ( ) , void ( " true " = = = c ? window . App . graphViewer . switchNodeColorByCollection ( ! 0 ) : $ ( " # g_nodeColorAttribute " ) . is ( " : disabled " ) ? window . App . graphViewer . switchNodeColorByCollection ( ! 1 ) : window . App . graphViewer . switchNodeColorByCollection ( ! 1 , ! 0 ) ) ; if ( " g_edgeColorByCollection " = = = a . currentTarget . id ) return c = $ ( " # g_edgeColorByCollection " ) . val ( ) , void ( " true " = = = c ? window . App . graphViewer . switchEdgeColorByCollection ( ! 0 ) : $ ( " # g_nodeColorAttribute " ) . is ( " : disabled " ) ? window . App . graphViewer . switchEdgeColorByCollection ( ! 1 ) : window . App . graphViewer . switchEdgeColorByCollection ( ! 1 , ! 0 ) ) } " " ! = = b & & void 0 ! = = b ? h ( ) : window . App . graphViewer . render ( g . lastFocussed ) } else e | | arangoHelper . arangoNotification ( " Graph " + this . name , " Configuration saved . " ) ; f & & f ( ) } . bind ( this ) ; this . userConfig . setItem ( " graphs " , k , n ) } this . handleDependencies ( ) } , setDefaults : function ( a , b , c ) { var d = { layout : " force " , renderer : " canvas " , depth : " 2 " , limit : " 250 " , nodeColor : " # 2ecc71 " , nodeColorAttribute : " " , nodeColorByCollection : " true " , edgeColor : " # cccccc " , edgeColorAttribute : " " , edgeColorByCollection : " false " , nodeLabel : " _key " , edgeLabel : " " , edgeType : " arrow " , nodeSize : " " , nodeSizeByEdges : " true " , edgeEditable : " true " , nodeLabelByCollection : " false " , edgeLabelByCollection : " false " , nodeStart : " " , barnesHutOptimize : ! 0 } ; a = = = ! 0 ? b ? this . saveGraphSettings ( null , null , null , d , b , c ) : this . saveGraphSettings ( null , null , null , d ) : ( this . saveGraphSettings ( null , null , null , d , null ) , this . render ( ) , window . App . graphViewer . render ( this . lastFocussed ) ) } , toggle : function ( ) { $ ( this . el ) . is ( " : visible " ) ? this . hide ( ) : this . show ( ) } , show : function ( ) { $ ( this . el ) . show ( " slide " , { direction : " right " } , 250 ) } , hide : function ( ) { $ ( this . el ) . hide ( " slide " , { direction : " right " } , 250 ) } , render : function ( ) { this . noDefinedGraph ? this . continueRender ( ) : ( this . getGraphSettings ( ! 0 ) , this . lastSaved = new Date ) } , handleDependencies : function ( ) { " true " = = = $ ( " # g_nodeSizeByEdges " ) . val ( ) ? $ ( " # g_nodeSize " ) . prop ( " disabled " , ! 0 ) : $ ( " # g_nodeSize " ) . removeAttr ( " disabled " ) , " true " = = = $ ( " # g_nodeColorByCollection " ) . val ( ) ? ( $ ( " # g_nodeColorAttribute " ) . prop ( " disabled " , ! 0 ) , $ ( " # g_nodeColor " ) . prop ( " disabled " , ! 0 ) ) : ( $ ( " # g_nodeColorAttribute " ) . removeAttr ( " disabled " ) , $ ( " # g_nodeColor " ) . removeAttr ( " disabled " ) ) , this . noDefinedGraph | | " " ! = = $ ( " # g_nodeColorAttribute " ) . val ( ) & & $ ( " # g_nodeColor " ) . prop ( " disabled " , ! 0 ) , " true " = = = $ ( " # g_edgeColorByCollection " ) . val ( ) ? ( $ ( " # g_edgeColorAttribute " ) . prop ( " disabled " , ! 0 ) , $ ( " # g_edgeColor " ) . prop ( " disabled " , ! 0 ) ) : ( $ ( " # g_edgeColorAttribute " ) . removeAttr ( " disabled " ) , $ ( " # g_edgeColor " ) . removeAttr ( " disabled " ) ) , this . noDefinedGraph | | " " ! = = $ ( " # g_edgeColorAttribute " ) . val ( ) & & $ ( " # g_edgeColor " ) . prop ( " disabled " , ! 0 ) } , continueRender : function ( ) { $ ( this . el ) . html ( this . template . render ( { general : this . general , specific : this . specific } ) ) , arangoHelper . fixTooltips ( " . gv - tooltips " , " top " ) , this . graphConfig ? _ . each ( this . graphConfig , function ( a , b ) { $ ( " # g_ " + b ) . val ( a ) } ) : this . noDefinedGraph ? this . fitSettingsAQLMode ( ) : this . setDefaults ( ! 0 ) , this . handleDependencies ( ) } , fitSettingsAQLMode : function ( ) { var a = [ " g_nodeStart " , " g_depth " , " g_limit " , " g_renderer " , " g_nodeLabel " , " g_nodeLabelByCollection " , " g_nodeColorAttribute " , " g_nodeSize " , " g_edgeLabel " , " g_edgeColorAttribute " , " g_edgeLabelByCollection " ] ; _ . each ( a , function ( a ) { $ ( " # " + a ) . parent ( ) . prev ( ) . remove ( ) , $ ( " # " + a ) . parent ( ) . remove ( ) } ) , $ ( " # saveGraphSettings " ) . remove ( ) , $ ( " # restoreGraphSettings " ) . remove ( ) , $ ( " # g_nodeColorByCollection " ) . val ( " false " ) , $ ( " # g_edgeColorByCollection " ) . val ( " false " ) , $ ( " # g_nodeSizeByEdges " ) . val ( " false " ) , $ ( " # g_edgeType " ) . val ( " arrow " ) , $ ( " # g_layout " ) . val ( " force " ) } } ) } ( ) , function ( ) { " use strict " ; window . GraphViewer = Backbone . View . extend ( { el : " # content " , remove : function ( ) { return this . $ el . empty ( ) . off ( ) , this . stopListening ( ) , this . unbind ( ) , delete this . el , this } , template : templateEngine . createTemplate ( " graphViewer2 . ejs " ) , initialize : function ( a ) { var b = this ; a . id & & ( this . setElement ( a . id ) , this . graphData = a . data , this . aqlMode = ! 0 ) , a . noDefinedGraph & & ( this . noDefinedGraph = a . noDefinedGraph , this . graphData = a . data ) , this . name = a . name , this . userConfig = a . userConfig , this . documentStore = a . documentStore , void 0 ! = = this . name & & this . collection . fetch ( { cache : ! 1 , success : function ( c ) { b . model = b . collection . findWhere ( { _key : a . name } ) . toJSON ( ) } } ) } , colors : { hotaru : [ " # 364C4A " , " # 497C7F " , " # 92C5C0 " , " # 858168 " , " # CCBCA5 " ] , random1 : [ " # 292F36 " , " # 4ECDC4 " , " # F7FFF7 " , " # DD6363 " , " # FFE66D " ] , jans : [ " rgba ( 166 , 109 , 161 , 1 ) " , " rgba ( 64 , 74 , 83 , 1 ) " , " rgba ( 90 , 147 , 189 , 1 ) " , " rgba ( 153 , 63 , 0 , 1 ) " , " rgba ( 76 , 0 , 92 , 1 ) " , " rgba ( 25 , 25 , 25 , 1 ) " , " rgba ( 0 , 92 , 49 , 1 ) " , " rgba ( 43 , 206 , 72 , 1 ) " , " rgba ( 255 , 204 , 153 , 1 ) " , " rgba ( 128 , 128 , 128 , 1 ) " , " rgba ( 148 , 255 , 181 , 1 ) " , " rgba ( 143 , 124 , 0 , 1 ) " , " rgba ( 157 , 204 , 0 , 1 ) " , " rgba ( 194 , 0 , 136 , 1 ) " , " rgba ( 0 , 51 , 128 , 1 ) " , " rgba ( 255 , 164 , 5 , 1 ) " , " rgba ( 255 , 168 , 187 , 1 ) " , " rgba ( 66 , 102 , 0 , 1 ) " , " rgba ( 255 , 0 , 16 , 1 ) " , " rgba ( 94 , 241 , 242 , 1 ) " , " rgba ( 0 , 153 , 143 , 1 ) " , " rgba ( 224 , 255 , 102 , 1 ) " , " rgba ( 116 , 10 , 255 , 1 ) " , " rgba ( 153 , 0 , 0 , 1 ) " , " rgba ( 255 , 255 , 128 , 1 ) " , " rgba ( 255 , 255 , 0 , 1 ) " , " rgba ( 255 , 80 , 5 , 1 ) " ] , gv : [ " # 68BDF6 " , " # 6DCE9E " , " # FF756E " , " # DE9BF9 " , " # FB95AF " , " # FFD86E " , " # A5ABB6 " ] } , activeNodes : [ ] , selectedNodes : { } , aqlMode : ! 1 , events : { " click # downloadPNG " : " downloadPNG " , " click # loadFullGraph " : " loadFullGraphModal " , " click # reloadGraph " : " reloadGraph " , " click # settingsMenu " : " toggleSettings " , " click # toggleForce " : " toggleLayout " , " click # selectNodes " : " toggleLasso " } , cursorX : 0 , cursorY : 0 , layouting : ! 1 , model : null , viewStates : { captureMode : ! 1 } , graphConfig : null , graphSettings : null , downloadPNG : function ( ) { var a = parseInt ( $ ( " # graph - container " ) . width ( ) , 10 ) ; sigma . plugins . image ( this . currentGraph , this . currentGraph . renderers [ 0 ] , { download : ! 0 , size : a , clip : ! 0 , labels : ! 0 , background : " white " , zoom : ! 1 } ) } , loadFullGraphModal : function ( ) { var a = [ ] , b = [ ] ; b . push ( window . modalView . createReadOnlyEntry ( " load - full - graph - a " , " Caution " , " Really load full graph ? If no limit is set , your result set could be too big . " ) ) , a . push ( window . modalView . createSuccessButton ( " Load full graph " , this . loadFullGraph . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Load full graph " , a , b ) } , loadFullGraph : function ( ) { var a = this , b = { } ; this . graphConfig & & ( b = _ . clone ( this . graphConfig ) , <nl> - delete b . layout , delete b . edgeType , delete b . renderer ) , b . mode = " all " , $ . ajax ( { type : " GET " , url : arangoHelper . databaseUrl ( " / _admin / aardvark / graph / " + encodeURIComponent ( this . name ) ) , contentType : " application / json " , data : b , success : function ( b ) { a . killCurrentGraph ( ) , a . renderGraph ( b ) } , error : function ( a ) { console . log ( a ) , arangoHelper . arangoError ( " Graph " , " Could not load full graph . " ) } } ) , window . modalView . hide ( ) } , resize : function ( ) { $ ( " # graph - container " ) . width ( $ ( " . centralContent " ) . width ( ) ) , $ ( " # graph - container " ) . height ( $ ( " . centralRow " ) . height ( ) - 155 ) } , toggleSettings : function ( ) { this . graphSettingsView . toggle ( ) } , render : function ( a ) { this . $ el . html ( this . template . render ( { } ) ) , $ ( " # subNavigationBar . breadcrumb " ) . html ( " Graph : " + this . name ) , this . resize ( ) , this . fetchGraph ( a ) , this . initFullscreen ( ) } , initFullscreen : function ( ) { var a = this ; if ( window . App . initializedFullscreen = = = ! 1 | | void 0 = = = window . App . initializedFullscreen ) { window . App . initializedFullscreen = ! 0 , this . isFullscreen = ! 1 ; var b = function ( b ) { ( document . webkitIsFullScreen | | document . mozFullScreen | | null ! = = document . msFullscreenElement ) & & ( a . isFullscreen = = = ! 1 ? ( a . isFullscreen = ! 0 , $ ( " # toggleForce " ) . css ( " bottom " , " 10px " ) , $ ( " # toggleForce " ) . css ( " right " , " 10px " ) , $ ( " # objectCount " ) . css ( " bottom " , " 10px " ) , $ ( " # objectCount " ) . css ( " left " , " 10px " ) , $ ( " . nodeInfoDiv " ) . css ( " top " , " 10px " ) , $ ( " . nodeInfoDiv " ) . css ( " left " , " 10px " ) ) : ( a . isFullscreen = ! 1 , $ ( " # toggleForce " ) . css ( " bottom " , " 40px " ) , $ ( " # toggleForce " ) . css ( " right " , " 40px " ) , $ ( " # objectCount " ) . css ( " bottom " , " 50px " ) , $ ( " # objectCount " ) . css ( " left " , " 25px " ) , $ ( " . nodeInfoDiv " ) . css ( " top " , " " ) , $ ( " . nodeInfoDiv " ) . css ( " left " , " 165px " ) ) ) } ; document . addEventListener & & ( document . addEventListener ( " webkitfullscreenchange " , b , ! 1 ) , document . addEventListener ( " mozfullscreenchange " , b , ! 1 ) , document . addEventListener ( " fullscreenchange " , b , ! 1 ) , document . addEventListener ( " MSFullscreenChange " , b , ! 1 ) ) } } , renderAQLPreview : function ( a ) { this . $ el . html ( this . template . render ( { } ) ) , this . $ el . find ( " . headerBar " ) . remove ( ) ; var b = $ ( " . centralRow " ) . height ( ) - 250 ; this . $ el . find ( " # graph - container " ) . css ( " height " , b ) , this . graphData . modified = this . parseData ( this . graphData . original , this . graphData . graphInfo ) ; var c = ! 1 ; try { this . renderGraph ( this . graphData . modified , null , ! 0 ) , c = ! 0 } catch ( d ) { } return c } , renderAQL : function ( a ) { this . $ el . html ( this . template . render ( { } ) ) , $ ( " # subNavigationBar . breadcrumb " ) . html ( " AQL Graph " ) , $ ( " # subNavigationBar . bottom " ) . html ( " " ) , $ ( " . queries - menu " ) . removeClass ( " active " ) , this . resize ( ) , this . graphData . modified = this . parseData ( this . graphData . original , this . graphData . graphInfo ) , this . renderGraph ( this . graphData . modified , null , ! 1 ) , this . initFullscreen ( ) , this . graphSettingsView = new window . GraphSettingsView ( { name : this . name , userConfig : void 0 , saveCallback : void 0 , noDefinedGraph : ! 0 } ) , this . graphSettingsView . render ( ) } , killCurrentGraph : function ( ) { for ( var a in this . currentGraph . renderers ) this . currentGraph . renderers [ a ] . clear ( ) , this . currentGraph . kill ( a ) } , rerenderAQL : function ( a , b ) { this . killCurrentGraph ( ) , this . renderGraph ( this . graphData . modified , null , ! 1 , a , " canvas " ) , " true " = = = $ ( " # g_nodeColorByCollection " ) . val ( ) ? this . switchNodeColorByCollection ( ! 0 ) : $ ( " # g_nodeColor " ) . is ( " : disabled " ) ? this . updateColors ( ! 0 , ! 0 , null , null , ! 0 ) : this . ncolor ? this . updateColors ( ! 0 , ! 0 , this . ncolor , this . ecolor ) : this . updateColors ( ! 0 , ! 0 , " # 2ecc71 " , " # 2ecc71 " ) , " true " = = = $ ( " # g_edgeColorByCollection " ) . val ( ) ? this . switchEdgeColorByCollection ( ! 0 ) : $ ( " # g_edgeColor " ) . is ( " : disabled " ) ? this . updateColors ( ! 0 , ! 0 , null , null , ! 0 ) : this . ecolor ? this . updateColors ( ! 0 , ! 0 , this . ncolor , this . ecolor ) : this . updateColors ( ! 0 , ! 0 , " # 2ecc71 " , " # 2ecc71 " ) } , buildCollectionColors : function ( ) { var a = this ; if ( ! a . collectionColors ) { a . collectionColors = { } ; var b = 0 , c = { } , d = { } ; _ . each ( this . currentGraph . graph . nodes ( ) , function ( a ) { c [ a . id ] = void 0 } ) , _ . each ( a . currentGraph . graph . edges ( ) , function ( a ) { d [ a . id ] = void 0 } ) , _ . each ( c , function ( c , d ) { void 0 = = = a . collectionColors [ d . split ( " / " ) [ 0 ] ] & & ( a . collectionColors [ d . split ( " / " ) [ 0 ] ] = { color : a . colors . jans [ b ] } , b + + ) } ) , b = 0 , _ . each ( d , function ( c , d ) { void 0 = = = a . collectionColors [ d . split ( " / " ) [ 0 ] ] & & ( a . collectionColors [ d . split ( " / " ) [ 0 ] ] = { color : a . colors . jans [ b ] } , b + + ) } ) } } , switchNodeColorByCollection : function ( a , b ) { var c = this ; c . buildCollectionColors ( ) , a ? ( c . currentGraph . graph . nodes ( ) . forEach ( function ( a ) { a . color = c . collectionColors [ a . id . split ( " / " ) [ 0 ] ] . color } ) , c . currentGraph . refresh ( ) ) : b ? this . updateColors ( ! 0 , null , null , null , b ) : this . ncolor ? this . updateColors ( ! 0 , null , this . ncolor , this . ecolor ) : this . updateColors ( ! 0 , null , " # 2ecc71 " , " # 2ecc71 " ) } , switchEdgeColorByCollection : function ( a , b ) { var c = this ; c . buildCollectionColors ( ) , a ? ( c . currentGraph . graph . edges ( ) . forEach ( function ( a ) { a . color = c . collectionColors [ a . id . split ( " / " ) [ 0 ] ] . color } ) , c . currentGraph . refresh ( ) ) : b ? this . updateColors ( ! 0 , null , null , null , b ) : this . ecolor ? this . updateColors ( null , ! 0 , this . ncolor , this . ecolor ) : this . updateColors ( null , ! 0 , " # 2ecc71 " , " # 2ecc71 " ) } , buildCollectionSizes : function ( ) { var a = this ; if ( ! a . nodeEdgesCount ) { a . nodeEdgesCount = { } ; var b = { } ; _ . each ( this . currentGraph . graph . edges ( ) , function ( c ) { void 0 = = = b [ c . id ] & & ( b [ c . id ] = ! 0 , void 0 = = = a . nodeEdgesCount [ c . source ] ? a . nodeEdgesCount [ c . source ] = 1 : a . nodeEdgesCount [ c . source ] + = 1 , void 0 = = = a . nodeEdgesCount [ c . target ] ? a . nodeEdgesCount [ c . target ] = 1 : a . nodeEdgesCount [ c . target ] + = 1 ) } ) } } , switchNodeSizeByCollection : function ( a ) { var b = this ; a ? ( b . buildCollectionSizes ( ) , b . currentGraph . graph . nodes ( ) . forEach ( function ( a ) { a . size = b . nodeEdgesCount [ a . id ] } ) ) : b . currentGraph . graph . nodes ( ) . forEach ( function ( a ) { a . size = 15 } ) , b . currentGraph . refresh ( ) } , switchEdgeType : function ( a ) { var b = { nodes : this . currentGraph . graph . nodes ( ) , edges : this . currentGraph . graph . edges ( ) , settings : { } } ; this . killCurrentGraph ( ) , this . renderGraph ( b , null , ! 1 , null , null , a ) } , switchLayout : function ( a ) { var b = { nodes : this . currentGraph . graph . nodes ( ) , edges : this . currentGraph . graph . edges ( ) , settings : { } } ; this . killCurrentGraph ( ) , this . renderGraph ( b , null , ! 1 , a ) , " true " = = = $ ( " # g_nodeColorByCollection " ) . val ( ) & & this . switchNodeColorByCollection ( ! 0 ) , " true " = = = $ ( " # g_edgeColorByCollection " ) . val ( ) ? this . switchEdgeColorByCollection ( ! 0 ) : this . switchEdgeColorByCollection ( ! 1 ) } , parseData : function ( a , b ) { var c = { } , d = { } , e = " # 2ecc71 " , f = { nodes : [ ] , edges : [ ] , settings : { } } ; if ( this . ncolor & & ( e = this . ncolor ) , " object " = = = b ) { _ . each ( a , function ( a ) { a . edges & & a . vertices & & ( _ . each ( a . edges , function ( a ) { null ! = = a & & ( d [ a . _id ] = { id : a . _id , source : a . _from , color : " # cccccc " , target : a . _to } ) } ) , _ . each ( a . vertices , function ( a ) { null ! = = a & & ( c [ a . _id ] = { id : a . _id , label : a . _key , size : . 3 , color : e , x : Math . random ( ) , y : Math . random ( ) } ) } ) ) } ) ; var g = [ ] ; _ . each ( c , function ( a ) { f . nodes . push ( a ) , g . push ( a . id ) } ) , _ . each ( d , function ( a ) { g . includes ( a . source ) & & g . includes ( a . target ) & & f . edges . push ( a ) } ) } else " array " = = = b & & ( _ . each ( a , function ( a ) { c [ a . _from ] = null , c [ a . _to ] = null , f . edges . push ( { id : a . _id , source : a . _from , color : " # cccccc " , target : a . _to } ) } ) , _ . each ( c , function ( a , b ) { f . nodes . push ( { id : b , label : b , size : . 3 , color : e , x : Math . random ( ) , y : Math . random ( ) } ) } ) ) ; return f } , rerender : function ( ) { this . fetchGraph ( ) } , fetchGraph : function ( a ) { var b = this ; $ ( this . el ) . append ( ' < div id = " calculatingGraph " style = " position : absolute ; left : 25px ; top : 130px ; " > < i class = " fa fa - circle - o - notch fa - spin " style = " margin - right : 10px ; " > < / i > < span id = " calcText " > Fetching graph data . Please wait . . . < / span > < / br > < / br > < / br > < span style = " font - weight : 100 ; opacity : 0 . 6 ; font - size : 9pt ; " > If it ` s taking too much time to draw the graph , please navigate to : < a style = " font - weight : 500 " href = " ' + window . location . href + ' / graphs " > Graphs View < / a > < / br > Click the settings icon and reset the display settings . It is possible that the graph is too big to be handled by the browser . < / span > < / div > ' ) ; var c = function ( ) { var c = { } ; b . graphConfig & & ( c = _ . clone ( b . graphConfig ) , delete c . layout , delete c . edgeType , delete c . renderer ) , b . tmpStartNode & & ( b . graphConfig ? 0 = = = b . graphConfig . nodeStart . length & & ( c . nodeStart = b . tmpStartNode ) : c . nodeStart = b . tmpStartNode ) , b . setupSigma ( ) , b . fetchStarted = new Date , $ . ajax ( { type : " GET " , url : arangoHelper . databaseUrl ( " / _admin / aardvark / graph / " + encodeURIComponent ( b . name ) ) , contentType : " application / json " , data : c , success : function ( c ) { c . empty = = = ! 0 ? b . renderGraph ( c , a ) : ( c . settings & & c . settings . startVertex & & void 0 = = = b . graphConfig . startNode & & void 0 = = = b . tmpStartNode & & ( b . tmpStartNode = c . settings . startVertex . _id ) , b . fetchFinished = new Date , b . calcStart = b . fetchFinished , $ ( " # calcText " ) . html ( " Server response took " + Math . abs ( b . fetchFinished . getTime ( ) - b . fetchStarted . getTime ( ) ) + " ms . Initializing graph engine . Please wait . . . " ) , window . setTimeout ( function ( ) { b . renderGraph ( c , a ) } , 50 ) ) } , error : function ( a ) { try { var c ; if ( a . responseJSON . exception ) { c = a . responseJSON . exception ; var d = a . responseJSON . exception . search ( " 1205 " ) ; if ( d ! = = - 1 ) { var e = ' Starting point : < span style = " font - weight : 400 " > ' + b . graphConfig . nodeStart + " < / span > is invalid " ; $ ( " # calculatingGraph " ) . html ( ' < div style = " font - weight : 300 ; font - size : 10 . 5pt " > < span style = " font - weight : 400 " > Stopped . < / span > < / br > < / br > ' + e + ' . Please < a style = " color : # 3498db " href = " ' + window . location . href + ' / settings " > choose a different start node . < / a > < / div > ' ) } else $ ( " # calculatingGraph " ) . html ( " Failed to fetch graph information . " ) } else c = a . responseJSON . errorMessage , $ ( " # calculatingGraph " ) . html ( " Failed to fetch graph information : " + a . responseJSON . errorMessage ) ; arangoHelper . arangoError ( " Graph " , c ) } catch ( f ) { } } } ) } ; void 0 = = = b . graphConfig | | null = = = b . graphConfig ? b . userConfig . fetch ( { success : function ( a ) { var d = frontendConfig . db + " _ " + b . name ; try { b . graphConfig = a . toJSON ( ) . graphs [ d ] , b . getGraphSettings ( c ) , void 0 = = = b . graphConfig | | null = = = b . graphConfig ? ( b . graphSettingsView = new window . GraphSettingsView ( { name : b . name , userConfig : b . userConfig , saveCallback : b . render } ) , b . graphSettingsView . setDefaults ( ! 0 , ! 0 ) ) : ( b . graphSettingsView & & b . graphSettingsView . remove ( ) , b . graphSettingsView = new window . GraphSettingsView ( { name : b . name , userConfig : b . userConfig , saveCallback : b . render } ) ) } catch ( e ) { b . getGraphSettings ( c ) } } } ) : this . getGraphSettings ( c ) } , setupSigma : function ( ) { if ( this . graphConfig & & this . graphConfig . edgeLabel ) { sigma . utils . pkg ( " sigma . settings " ) ; var a = { defaultEdgeLabelColor : " # 000 " , defaultEdgeLabelActiveColor : " # 000 " , defaultEdgeLabelSize : 12 , edgeLabelSize : " fixed " , edgeLabelThreshold : 1 , edgeLabelSizePowRatio : 1 } ; sigma . settings = sigma . utils . extend ( sigma . settings | | { } , a ) , sigma . settings . drawEdgeLabels = ! 0 , sigma . settings . clone = ! 0 } } , contextState : { createEdge : ! 1 , _from : ! 1 , _to : ! 1 , fromX : ! 1 , fromY : ! 1 } , clearOldContextMenu : function ( a ) { var b = this ; $ ( " # nodeContextMenu " ) . remove ( ) ; var c = ' < div id = " nodeContextMenu " class = " nodeContextMenu animated zoomIn " > < / div > ' ; $ ( " # graph - container " ) . append ( c ) , a & & _ . each ( this . contextState , function ( a , c ) { b . contextState [ c ] = ! 1 } ) ; var d = document . getElementsByClassName ( " sigma - mouse " ) [ 0 ] ; d . removeEventListener ( " mousemove " , b . drawLine . bind ( this ) , ! 1 ) } , trackCursorPosition : function ( a ) { this . cursorX = a . x , this . cursorY = a . y } , deleteNode : function ( a , b ) { var c , d , e , f = this ; c = b ? b : $ ( " # delete - node - attr - id " ) . text ( ) , d = c . split ( " / " ) [ 0 ] , e = c . split ( " / " ) [ 1 ] ; var g = arangoHelper . databaseUrl ( " / _api / gharial / " + encodeURIComponent ( f . name ) + " / vertex / " + encodeURIComponent ( c . split ( " / " ) [ 0 ] ) + " / " + encodeURIComponent ( c . split ( " / " ) [ 1 ] ) ) ; if ( " yes " = = = $ ( " # delete - node - edges - attr " ) . val ( ) ) $ . ajax ( { cache : ! 1 , type : " DELETE " , contentType : " application / json " , url : g , success : function ( a ) { f . currentGraph . graph . dropNode ( c ) , f . currentGraph . refresh ( ) } , error : function ( ) { arangoHelper . arangoError ( " Graph " , " Could not delete node . " ) } } ) ; else { var h = function ( a ) { a ? arangoHelper . arangoError ( " Graph " , " Could not delete node . " ) : ( f . currentGraph . graph . dropNode ( c ) , f . currentGraph . refresh ( ) ) } ; this . documentStore . deleteDocument ( d , e , h ) } window . modalView . hide ( ) } , deleteNodes : function ( ) { var a = this ; try { var b = JSON . parse ( $ ( " # delete - nodes - arr - id " ) . text ( ) ) ; _ . each ( b , function ( b ) { a . deleteNode ( null , b ) } ) } catch ( c ) { } } , deleteNodesModal : function ( ) { var a = [ ] ; if ( _ . each ( this . selectedNodes , function ( b ) { a . push ( b ) } ) , 0 = = = a . length ) return void arangoHelper . arangoNotification ( " Graph " , " No nodes selected . " ) ; var b = [ ] , c = [ ] ; c . push ( window . modalView . createReadOnlyEntry ( " delete - nodes - arr - id " , " Really delete nodes " , JSON . stringify ( a ) ) ) , b . push ( window . modalView . createDeleteButton ( " Delete " , this . deleteNodes . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Delete nodes " , b , c ) } , deleteNodeModal : function ( a ) { var b = [ ] , c = [ ] ; c . push ( window . modalView . createReadOnlyEntry ( " delete - node - attr - id " , " Really delete node " , a ) ) , this . noDefinedGraph | | c . push ( window . modalView . createSelectEntry ( " delete - node - edges - attr " , " Also delete edges ? " , void 0 , void 0 , [ { value : " yes " , label : " Yes " } , { value : " no " , label : " No " } ] ) ) , b . push ( window . modalView . createDeleteButton ( " Delete " , this . deleteNode . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Delete node " , b , c ) } , addNode : function ( ) { var a = this , b = $ ( " . modal - body # new - node - collection - attr " ) . val ( ) , c = $ ( " . modal - body # new - node - key - attr " ) . last ( ) . val ( ) , d = function ( b , c , d ) { b ? arangoHelper . arangoError ( " Could not create node " , d ) : ( $ ( " # emptyGraph " ) . remove ( ) , a . currentGraph . graph . addNode ( { id : c , label : c . split ( " / " ) [ 1 ] | | " " , size : a . graphConfig . nodeSize | | 15 , color : a . graphConfig . nodeColor | | a . ncolor | | " # 2ecc71 " , originalColor : a . graphConfig . nodeColor | | a . ncolor | | " # 2ecc71 " , x : a . addNodeX + a . currentGraph . camera . x , y : a . addNodeY + a . currentGraph . camera . y } ) , window . modalView . hide ( ) , a . currentGraph . refresh ( ) , a . cameraToNode ( a . currentGraph . graph . nodes ( c ) ) ) } , e = { } ; if ( " " ! = = c & & void 0 ! = = c & & ( e . _key = c ) , this . graphSettings . isSmart ) { var f = $ ( " # new - smart - key - attr " ) . val ( ) ; " " ! = = f & & void 0 ! = = f ? e [ this . graphSettings . smartGraphAttribute ] = f : e [ this . graphSettings . smartGraphAttribute ] = null } this . collection . createNode ( a . name , b , e , d ) } , deleteEdgeModal : function ( a ) { var b = [ ] , c = [ ] ; c . push ( window . modalView . createReadOnlyEntry ( " delete - edge - attr - id " , " Really delete edge " , a ) ) , b . push ( window . modalView . createDeleteButton ( " Delete " , this . deleteEdge . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Delete edge " , b , c ) } , deleteEdge : function ( ) { var a = this , b = $ ( " # delete - edge - attr - id " ) . text ( ) , c = b . split ( " / " ) [ 0 ] , d = b . split ( " / " ) [ 1 ] , e = function ( c ) { c ? arangoHelper . arangoError ( " Graph " , " Could not delete edge . " ) : ( a . currentGraph . graph . dropEdge ( b ) , a . currentGraph . refresh ( ) ) } ; this . documentStore . deleteDocument ( c , d , e ) , window . modalView . hide ( ) } , addNodeModal : function ( ) { if ( 0 ! = = this . graphSettings . vertexCollections ) { var a = [ ] , b = [ ] , c = [ ] ; _ . each ( this . graphSettings . vertexCollections , function ( a ) { c . push ( { label : a . name , value : a . name } ) } ) , b . push ( window . modalView . createTextEntry ( " new - node - key - attr " , " _key " , void 0 , " The nodes unique key ( optional attribute , leave empty for autogenerated key " , " is optional : leave empty for autogenerated key " , ! 1 , [ { rule : Joi . string ( ) . allow ( " " ) . optional ( ) , msg : " " } ] ) ) , this . graphSettings . isSmart & & b . push ( window . modalView . createTextEntry ( " new - smart - key - attr " , this . graphSettings . smartGraphAttribute + " * " , void 0 , " The attribute value that is used to smartly shard the vertices of a graph . \ nEvery vertex in this Graph has to have this attribute . \ nCannot be modified later . " , " Cannot be modified later . " , ! 1 , [ { rule : Joi . string ( ) . allow ( " " ) . optional ( ) , msg : " " } ] ) ) , b . push ( window . modalView . createSelectEntry ( " new - node - collection - attr " , " Collection " , void 0 , " Please select the destination for the new node . " , c ) ) , a . push ( window . modalView . createSuccessButton ( " Create " , this . addNode . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Create node " , a , b ) } else arangoHelper . arangoError ( " Graph " , " No valid vertex collections found . " ) } , addEdge : function ( ) { var a , b = this , c = b . contextState . _from , d = b . contextState . _to ; a = " " = = = $ ( " . modal - body # new - edge - collection - attr " ) . val ( ) ? $ ( " . modal - body # new - edge - collection - attr " ) . text ( ) : $ ( " . modal - body # new - edge - collection - attr " ) . val ( ) ; var e = $ ( " . modal - body # new - edge - key - attr " ) . last ( ) . val ( ) , f = function ( a , e , f ) { if ( a ) arangoHelper . arangoError ( " Could not create edge " , f ) ; else { var g = { source : c , target : d , id : e , color : b . graphConfig . edgeColor | | b . ecolor } ; " true " = = = b . graphConfig . edgeEditable & & ( g . size = 1 ) , b . currentGraph . graph . addEdge ( g ) , b . graphConfig & & " curve " = = = b . graphConfig . edgeType & & sigma . canvas . edges . autoCurve ( b . currentGraph ) , b . currentGraph . refresh ( ) } b . clearOldContextMenu ( ! 0 ) , window . modalView . hide ( ) } , g = { _from : c , _to : d } ; " " ! = = e & & void 0 ! = = e & & ( g . _key = e ) , this . collection . createEdge ( b . name , a , g , f ) } , addEdgeModal : function ( a ) { if ( 0 ! = = a ) { var b = [ ] , c = [ ] ; if ( c . push ( window . modalView . createTextEntry ( " new - edge - key - attr " , " _key " , void 0 , " The edges unique key ( optional attribute , leave empty for autogenerated key " , " is optional : leave empty for autogenerated key " , ! 1 , [ { rule : Joi . string ( ) . allow ( " " ) . optional ( ) , msg : " " } ] ) ) , a . length > 1 ) { var d = [ ] ; _ . each ( a , function ( a ) { d . push ( { label : a , value : a } ) } ) , c . push ( window . modalView . createSelectEntry ( " new - edge - collection - attr " , " Edge collection " , void 0 , " Please select the destination for the new edge . " , d ) ) } else c . push ( window . modalView . createReadOnlyEntry ( " new - edge - collection - attr " , " Edge collection " , a [ 0 ] , " The edge collection to be used . " ) ) ; b . push ( window . modalView . createSuccessButton ( " Create " , this . addEdge . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Create edge " , b , c ) } else arangoHelper . arangoError ( " Graph " , " No valid edge definitions found . " ) } , updateColors : function ( a , b , c , d , e ) { var f = frontendConfig . db + " _ " + this . name , g = this ; c & & ( g . ncolor = c ) , d & & ( g . ecolor = d ) , this . userConfig . fetch ( { success : function ( h ) { if ( a = = = ! 0 ) { g . graphConfig = h . toJSON ( ) . graphs [ f ] ; try { g . currentGraph . graph . nodes ( ) . forEach ( function ( a ) { e ? a . color = a . sortColor : a . color = c } ) } catch ( i ) { g . graphNotInitialized = ! 0 , g . tmpGraphArray = [ a , b , c , d ] } } if ( b = = = ! 0 ) try { g . currentGraph . graph . edges ( ) . forEach ( function ( a ) { e ? a . color = a . sortColor : a . color = d } ) } catch ( j ) { g . graphNotInitialized = ! 0 , g . tmpGraphArray = [ a , b , c , d ] } g . currentGraph & & g . currentGraph . refresh ( ) } } ) } , nodesContextMenuCheck : function ( a ) { this . nodesContextEventState = a , this . openNodesDate = new Date } , createContextMenu : function ( a ) { var b = this , c = b . cursorX - 50 , d = b . cursorY - 50 ; this . clearOldContextMenu ( ) ; var e = function ( a ) { var c = wheelnav , d = new c ( " nodeContextMenu " ) ; d . maxPercent = 1 , d . wheelRadius = 50 , d . clockwise = ! 1 , d . colors = b . colors . hotaru , d . multiSelect = ! 0 , d . clickModeRotate = ! 1 , d . slicePathFunction = slicePath ( ) . DonutSlice , d . createWheel ( [ icon . plus , icon . arrowleft2 ] ) , d . navItems [ 0 ] . selected = ! 1 , d . navItems [ 0 ] . hovered = ! 1 , d . navItems [ 0 ] . navigateFunction = function ( a ) { b . clearOldContextMenu ( ) , b . addNodeModal ( ) } , d . navItems [ 1 ] . navigateFunction = function ( a ) { b . clearOldContextMenu ( ) } , d . navItems [ 0 ] . selected = ! 1 , d . navItems [ 0 ] . hovered = ! 1 } ; $ ( " # nodeContextMenu " ) . css ( " position " , " fixed " ) , $ ( " # nodeContextMenu " ) . css ( " left " , c ) , $ ( " # nodeContextMenu " ) . css ( " top " , d ) , $ ( " # nodeContextMenu " ) . width ( 100 ) , $ ( " # nodeContextMenu " ) . height ( 100 ) , e ( a ) } , createEdgeContextMenu : function ( a , b ) { var c = this , d = this . cursorX - 165 , e = this . cursorY - 120 ; this . clearOldContextMenu ( ) ; var f = function ( a , b ) { var d = [ " # 364C4A " , " # 497C7F " , " # 92C5C0 " , " # 858168 " , " # CCBCA5 " ] , e = wheelnav , f = new e ( " nodeContextMenu " ) ; f . maxPercent = 1 , f . wheelRadius = 50 , f . clockwise = ! 1 , f . colors = d , f . multiSelect = ! 0 , f . clickModeRotate = ! 1 , f . slicePathFunction = slicePath ( ) . DonutSlice , f . createWheel ( [ icon . edit , icon . trash ] ) , f . navItems [ 0 ] . selected = ! 1 , f . navItems [ 0 ] . hovered = ! 1 , f . navItems [ 0 ] . navigateFunction = function ( a ) { c . clearOldContextMenu ( ) , c . editEdge ( b ) } , f . navItems [ 1 ] . navigateFunction = function ( a ) { c . clearOldContextMenu ( ) , c . deleteEdgeModal ( b ) } , f . navItems [ 0 ] . selected = ! 1 , f . navItems [ 0 ] . hovered = ! 1 } ; $ ( " # nodeContextMenu " ) . css ( " left " , d + 115 ) , $ ( " # nodeContextMenu " ) . css ( " top " , e + 72 ) , $ ( " # nodeContextMenu " ) . width ( 100 ) , $ ( " # nodeContextMenu " ) . height ( 100 ) , f ( b , a ) } , createNodeContextMenu : function ( a , b ) { var c , d , e , f = this ; _ . each ( b . data . node , function ( a , b ) { " renderer " = = = b . substr ( 0 , 8 ) & & " x " = = = b . charAt ( b . length - 1 ) & & ( c = a ) , " renderer " = = = b . substr ( 0 , 8 ) & & " y " = = = b . charAt ( b . length - 1 ) & & ( d = a ) , " renderer " = = = b . substr ( 0 , 8 ) & & " e " = = = b . charAt ( b . length - 1 ) & & ( e = a ) } ) , void 0 = = = c & & void 0 = = = d & & _ . each ( b . data . node , function ( a , b ) { " read_cam " = = = b . substr ( 0 , 8 ) & & " x " = = = b . charAt ( b . length - 1 ) & & ( c = a + $ ( " # graph - container " ) . width ( ) / 2 ) , " read_cam " = = = b . substr ( 0 , 8 ) & & " y " = = = b . charAt ( b . length - 1 ) & & ( d = a + $ ( " # graph - container " ) . height ( ) / 2 ) } ) ; var g = 2 . 5 * e ; g < 75 & & ( g = 75 ) , this . clearOldContextMenu ( ) ; var h = function ( a , b ) { var e = [ " # 364C4A " , " # 497C7F " , " # 92C5C0 " , " # 858168 " , " # CCBCA5 " ] , h = wheelnav , i = new h ( " nodeContextMenu " ) ; i . maxPercent = 1 , i . wheelRadius = g , i . clockwise = ! 1 , i . colors = e , i . multiSelect = ! 1 , i . clickModeRotate = ! 1 , i . sliceHoverAttr = { stroke : " # fff " , " stroke - width " : 2 } , i . slicePathFunction = slicePath ( ) . DonutSlice , f . noDefinedGraph ? i . createWheel ( [ " imgsrc : img / gv_edit . png " , " imgsrc : img / gv_trash . png " ] ) : i . createWheel ( [ " imgsrc : img / gv_edit . png " , " imgsrc : img / gv_trash . png " , " imgsrc : img / gv_flag . png " , " imgsrc : img / gv_link . png " , " imgsrc : img / gv_expand . png " ] ) , $ ( " # nodeContextMenu " ) . addClass ( " animated bounceIn " ) , window . setTimeout ( function ( ) { i . navItems [ 0 ] . navigateFunction = function ( a ) { f . clearOldContextMenu ( ) , f . editNode ( b ) , f . removeHelp ( ) } , i . navItems [ 1 ] . navigateFunction = function ( a ) { f . clearOldContextMenu ( ) , f . deleteNodeModal ( b ) , f . removeHelp ( ) } , f . noDefinedGraph | | ( i . navItems [ 2 ] . navigateFunction = function ( a ) { f . clearOldContextMenu ( ) , f . setStartNode ( b ) , f . removeHelp ( ) } , i . navItems [ 3 ] . navigateFunction = function ( a ) { f . contextState . createEdge = ! 0 , f . contextState . _from = b , f . contextState . fromX = c , f . contextState . fromY = d ; var e = document . getElementsByClassName ( " sigma - mouse " ) [ 0 ] ; f . drawHelp ( " Now click destination node , or click background to cancel . " ) , e . addEventListener ( " mousemove " , f . drawLine . bind ( this ) , ! 1 ) , f . clearOldContextMenu ( ) , f . removeHelp ( ) } , i . navItems [ 4 ] . navigateFunction = function ( a ) { f . clearOldContextMenu ( ) , f . expandNode ( b ) , f . removeHelp ( ) } ) ; var a = [ " Edit the node . " , " Delete node . " ] ; f . noDefinedGraph | | ( a . push ( " Set as startnode . " ) , a . push ( " Draw edge . " ) , a . push ( " Expand the node . " ) ) , _ . each ( a , function ( a , b ) { i . navItems [ b ] . navTitle . mouseover ( function ( ) { f . drawHelp ( a ) } ) , i . navItems [ b ] . navTitle . mouseout ( function ( ) { f . removeHelp ( ) } ) } ) , i . navItems [ 0 ] . selected = ! 1 , i . navItems [ 0 ] . hovered = ! 1 } , 300 ) } , i = $ ( " # graph - container " ) . offset ( ) ; $ ( " # nodeContextMenu " ) . width ( 2 * g ) , $ ( " # nodeContextMenu " ) . height ( 2 * g ) , $ ( " # nodeContextMenu " ) . css ( " left " , c + i . left - g ) , $ ( " # nodeContextMenu " ) . css ( " top " , d + i . top - g ) , h ( b , a ) } , drawHelp : function ( a ) { null = = = document . getElementById ( " helpTooltip " ) ? $ ( this . el ) . append ( ' < div id = " helpTooltip " class = " helpTooltip " > < span > ' + a + " < / span > < / div > " ) : $ ( " # helpTooltip span " ) . text ( a ) , $ ( " # helpTooltip " ) . show ( ) } , removeHelp : function ( ) { $ ( " # helpTooltip " ) . remove ( ) } , clearMouseCanvas : function ( ) { var a = document . getElementsByClassName ( " sigma - mouse " ) [ 0 ] , b = a . getContext ( " 2d " ) ; b . clearRect ( 0 , 0 , $ ( a ) . width ( ) , $ ( a ) . height ( ) ) } , expandNode : function ( a ) { var b = this , c = { } ; this . graphConfig & & ( c = _ . clone ( this . graphConfig ) , delete c . layout , delete c . edgeType , delete c . renderer ) , c . query = ' FOR v , e , p IN 1 . . 1 ANY " ' + a + ' " GRAPH " ' + b . name + ' " RETURN p ' , $ . ajax ( { type : " GET " , url : arangoHelper . databaseUrl ( " / _admin / aardvark / graph / " + encodeURIComponent ( this . name ) ) , contentType : " application / json " , data : c , success : function ( c ) { b . checkExpand ( c , a ) } , error : function ( b ) { arangoHelper . arangoError ( " Graph " , " Could not expand node : " + a + " . " ) } } ) , b . removeHelp ( ) } , checkExpand : function ( a , b ) { var c , d = this , e = a . nodes , f = a . edges , g = this . currentGraph . graph . nodes ( ) , h = 0 , i = 0 ; _ . each ( e , function ( a ) { c = ! 1 , _ . each ( g , function ( d ) { c = = = ! 1 & & ( a . id = = = d . id ? ( d . id = = = b & & ( d . label = d . label + " ( expanded ) " ) , c = ! 0 ) : c = ! 1 ) } ) , c = = = ! 1 & & ( a . originalColor = a . color , d . currentGraph . graph . addNode ( a ) , h + + , _ . each ( f , function ( b ) { b . source ! = = a . id & & b . target ! = = a . id | | ( b . originalColor = b . color , d . currentGraph . graph . addEdge ( b ) , i + + ) } ) ) } ) , $ ( " # nodesCount " ) . text ( parseInt ( $ ( " # nodesCount " ) . text ( ) , 10 ) + h ) , $ ( " # edgesCount " ) . text ( parseInt ( $ ( " # edgesCount " ) . text ( ) , 10 ) + i ) , ( h > 0 | | i > 0 ) & & ( " force " = = = d . algorithm ? d . startLayout ( ! 0 , b ) : " fruchtermann " = = = d . algorithm ? ( sigma . layouts . fruchtermanReingold . start ( d . currentGraph ) , d . currentGraph . refresh ( ) , d . cameraToNode ( b , 1e3 ) ) : " noverlap " = = = d . algorithm & & d . startLayout ( ! 0 , b ) ) } , cameraToNode : function ( a , b ) { var c = this ; " string " = = typeof a & & ( a = c . currentGraph . graph . nodes ( a ) ) ; var d = function ( a ) { sigma . misc . animation . camera ( c . currentGraph . camera , { x : a . x , y : a . y } , { duration : 1e3 } ) } ; b ? window . setTimeout ( function ( ) { d ( a ) } , b ) : d ( a ) } , drawLine : function ( a ) { var b = window . App . graphViewer . contextState ; if ( b . createEdge ) { var c = b . fromX , d = b . fromY , e = a . offsetX , f = a . offsetY , g = document . getElementsByClassName ( " sigma - mouse " ) [ 0 ] , h = g . getContext ( " 2d " ) ; h . clearRect ( 0 , 0 , $ ( g ) . width ( ) , $ ( g ) . height ( ) ) , h . beginPath ( ) , h . moveTo ( c , d ) , h . lineTo ( e , f ) , h . strokeStyle = this . newEdgeColor , h . stroke ( ) } } , getGraphSettings : function ( a ) { var b = this ; this . userConfig . fetch ( { success : function ( c ) { var d = frontendConfig . db + " _ " + b . name ; b . graphConfig = c . toJSON ( ) . graphs [ d ] , b . graphSettingsView & & b . graphSettingsView . remove ( ) , b . graphSettingsView = new window . GraphSettingsView ( { name : b . name , userConfig : b . userConfig , saveCallback : b . render } ) ; var e = function ( ) { b . graphSettingsView . render ( ) , a & & a ( b . graphConfig ) } ; void 0 = = = b . graphConfig ? ( b . graphSettingsView . setDefaults ( ! 0 , ! 0 ) , b . userConfig . fetch ( { success : function ( a ) { b . graphConfig = a . toJSON ( ) . graphs [ d ] , e ( ) } } ) ) : e ( ) } } ) } , setStartNode : function ( a ) { this . graphConfig . nodeStart = a , this . graphSettingsView . saveGraphSettings ( void 0 , void 0 , a ) } , editNode : function ( a ) { var b = function ( a , b ) { } ; arangoHelper . openDocEditor ( a , " doc " , b ) } , editEdge : function ( a ) { var b = function ( ) { } ; arangoHelper . openDocEditor ( a , " edge " , b ) } , reloadGraph : function ( ) { Backbone . history . loadUrl ( Backbone . history . fragment ) } , getEdgeDefinitionCollections : function ( a , b ) { var c = [ ] ; return _ . each ( this . model . edgeDefinitions , function ( d ) { _ . each ( d . from , function ( e ) { e = = = a & & _ . each ( d . to , function ( a ) { a = = = b & & c . push ( d . collection ) } ) } ) } ) , c } , initializeGraph : function ( a , b ) { a . refresh ( ) } , renderGraph : function ( a , b , c , d , e , f ) { var g = this ; this . graphSettings = a . settings ; var h = " # 2ecc71 " ; if ( g . ncolor & & ( h = g . ncolor ) , a . edges & & a . nodes ) { 0 = = = a . nodes . length & & 0 = = = a . edges . length & & a . nodes . push ( { id : a . settings . startVertex . _id , label : a . settings . startVertex . _key , size : 10 , color : h , x : Math . random ( ) , y : Math . random ( ) } ) ; var i = " position : absolute ; left : 25px ; bottom : 50px ; " ; this . aqlMode | | $ ( " # graph - container " ) . append ( ' < div id = " objectCount " style = " ' + i + ' animated fadeIn " > < span style = " margin - right : 10px " class = " arangoState " > < span id = " nodesCount " > ' + a . nodes . length + ' < / span > nodes < / span > < span class = " arangoState " > < span id = " edgesCount " > ' + a . edges . length + " < / span > edges < / span > < / div > " ) } this . Sigma = sigma , d ? g . algorithm = d : g . algorithm = " force " , e ? g . renderer = e : g . renderer = " canvas " , this . graphConfig & & ( this . graphConfig . layout & & ( d | | ( g . algorithm = this . graphConfig . layout ) ) , this . graphConfig . renderer & & ( e | | ( g . renderer = this . graphConfig . renderer ) ) ) , " canvas " = = = g . renderer & & ( g . isEditable = ! 0 ) ; var j = { scalingMode : " inside " , borderSize : 3 , defaultNodeBorderColor : " # 8c8c8c " , doubleClickEnabled : ! 1 , minNodeSize : 5 , labelThreshold : 9 , maxNodeSize : 15 , batchEdgesDrawing : ! 0 , minEdgeSize : 1 , maxEdgeSize : 1 , enableEdgeHovering : ! 0 , edgeHoverColor : " # 8c8c8c " , defaultEdgeHoverColor : " # 8c8c8c " , defaultEdgeType : " arrow " , edgeHoverSizeRatio : 2 . 5 , edgeHoverExtremities : ! 0 , nodesPowRatio : . 5 , autoRescale : ! 0 , mouseEnabled : ! 0 , touchEnabled : ! 0 , approximateLabelWidth : ! 0 , font : " Roboto " } ; j . nodeHaloColor = " rgba ( 146 , 197 , 192 , 0 . 8 ) " , j . nodeHaloStroke = ! 1 , j . nodeHaloStrokeColor = " # 000 " , j . nodeHaloStrokeWidth = 0 , j . nodeHaloSize = 25 , j . nodeHaloClustering = ! 1 , j . nodeHaloClusteringMaxRadius = 1e3 , j . edgeHaloColor = " # fff " , j . edgeHaloSize = 10 , j . drawHalo = ! 0 , " canvas " = = = g . renderer & & ( j . autoCurveSortByDirection = ! 0 ) , a . nodes & & a . nodes . length > 250 & & ( j . hideEdgesOnMove = ! 0 ) , this . graphConfig & & this . graphConfig . edgeType & & ( j . defaultEdgeType = this . graphConfig . edgeType ) , f & & ( j . defaultEdgeType = f ) , " arrow " = = = j . defaultEdgeType & & ( j . minArrowSize = 7 ) , c & & ( g . renderer = " canvas " , a . nodes . length < 500 ? g . algorithm = " fruchtermann " : j . scalingMode = " outside " , j . drawEdgeLabels = ! 1 , j . minNodeSize = 2 , j . maxNodeSize = 8 ) , " webgl " = = = g . renderer & & ( j . enableEdgeHovering = ! 1 ) ; var k = new this . Sigma ( { graph : a , container : " graph - container " , renderer : { container : document . getElementById ( " graph - container " ) , type : g . renderer } , settings : j } ) ; if ( this . currentGraph = k , this . aqlMode | | sigma . plugins . fullScreen ( { container : " graph - container " , btnId : " graph - fullscreen - btn " } ) , k . graph . nodes ( ) . forEach ( function ( a ) { a . originalColor = a . color } ) , k . graph . edges ( ) . forEach ( function ( a ) { a . originalColor = a . color } ) , " noverlap " = = = g . algorithm ) { var l = k . configNoverlap ( { nodeMargin : . 1 , scaleNodes : 1 . 05 , gridSize : 75 , easing : " quadraticInOut " , duration : 1500 } ) ; l . bind ( " start stop interpolate " , function ( a ) { " start " = = = a . type , " interpolate " = = = a . type } ) } else if ( " fruchtermann " = = = g . algorithm ) { var m = sigma . layouts . fruchtermanReingold . configure ( k , { iterations : 100 , easing : " quadraticInOut " , duration : 1500 } ) ; m . bind ( " start stop interpolate " , function ( a ) { } ) } if ( ! g . aqlMode ) { var n = function ( a , b ) { if ( $ ( " . nodeInfoDiv " ) . remove ( ) , g . contextState . createEdge = = = ! 1 & & window . location . hash . indexOf ( " graph " ) > - 1 ) { var c = function ( a , b , c ) { if ( a ) g . currentGraph . graph . dropNode ( c ) , g . currentGraph . refresh ( ) ; else { var d = " " ; d + = ' < span class = " title " > ID < / span > < span class = " nodeId " > ' + b . _id + " < / span > " , Object . keys ( b ) . length > 3 & & ( d + = ' < span class = " title " > ATTRIBUTES < / span > ' ) , _ . each ( b , function ( a , b ) { " _key " ! = = b & & " _id " ! = = b & & " _rev " ! = = b & & " _from " ! = = b & & " _to " ! = = b & & ( d + = ' < span class = " nodeAttribute " > ' + b + " < / span > " ) } ) ; var e = ' < div id = " nodeInfoDiv " class = " nodeInfoDiv " style = " display : none ; " > ' + d + " < / div > " ; $ ( " # graph - container " ) . append ( e ) , g . isFullscreen & & ( $ ( " . nodeInfoDiv " ) . css ( " top " , " 10px " ) , $ ( " . nodeInfoDiv " ) . css ( " left " , " 10px " ) ) , $ ( " # nodeInfoDiv " ) . fadeIn ( " slow " ) } } ; b ? g . documentStore . getDocument ( a . data . node . id . split ( " / " ) [ 0 ] , a . data . node . id . split ( " / " ) [ 1 ] , c ) : g . documentStore . getDocument ( a . data . edge . id . split ( " / " ) [ 0 ] , a . data . edge . id . split ( " / " ) [ 1 ] , c ) } } ; k . bind ( " clickNode " , function ( a ) { if ( g . contextState . createEdge = = = ! 0 ) { g . clearMouseCanvas ( ) , g . removeHelp ( ) , g . contextState . _to = a . data . node . id ; var b = g . contextState . _from . split ( " / " ) [ 0 ] , c = g . contextState . _to . split ( " / " ) [ 0 ] , d = g . getEdgeDefinitionCollections ( b , c ) ; 0 = = = d . length ? arangoHelper . arangoNotification ( " Graph " , " No valid edge definition found . " ) : ( g . addEdgeModal ( d , g . contextState . _from , g . contextState . _to ) , g . clearOldContextMenu ( ! 1 ) ) } else g . dragging | | ( g . contextState . createEdge = = = ! 0 ? g . newEdgeColor = " # ff0000 " : g . newEdgeColor = " # 000000 " , " canvas " = = = g . renderer & & g . currentGraph . renderers [ 0 ] . halo ( { nodes : g . currentGraph . graph . nodes ( ) , nodeHaloColor : " # DF0101 " , nodeHaloSize : 100 } ) , n ( a , ! 0 ) , g . activeNodes = [ a . data . node ] , " canvas " = = = g . renderer & & k . renderers [ 0 ] . halo ( { nodes : [ a . data . node ] } ) , g . createNodeContextMenu ( a . data . node . id , a ) ) } ) , g . noDefinedGraph ? k . bind ( " clickStage " , function ( a ) { g . clearOldContextMenu ( ! 0 ) , g . clearMouseCanvas ( ) , g . removeHelp ( ) } ) : k . bind ( " clickStage " , function ( a ) { a . data . captor . isDragging ? ( g . clearOldContextMenu ( ! 0 ) , g . clearMouseCanvas ( ) ) : g . contextState . createEdge = = = ! 0 ? ( g . clearOldContextMenu ( ! 0 ) , g . clearMouseCanvas ( ) , g . removeHelp ( ) ) : ( $ ( " # nodeContextMenu " ) . is ( " : visible " ) ? ( g . clearOldContextMenu ( ! 0 ) , g . clearMouseCanvas ( ) ) : ( g . addNodeX = a . data . captor . x , g . addNodeY = a . data . captor . y , g . createContextMenu ( a ) , g . clearMouseCanvas ( ) ) , k . renderers [ 0 ] . halo ( { nodes : g . activeNodes } ) ) } ) } if ( " canvas " = = = g . renderer ) { this . graphConfig & & " curve " = = = this . graphConfig . edgeType & & sigma . canvas . edges . autoCurve ( k ) , k . bind ( " clickEdge " , function ( a ) { n ( a , ! 1 ) } ) , k . renderers [ 0 ] . bind ( " render " , function ( a ) { k . renderers [ 0 ] . halo ( { nodes : g . activeNodes } ) } ) ; var o = function ( ) { g . nodeHighlighted = ! 1 , g . activeNodes = [ ] , k . graph . nodes ( ) . forEach ( function ( a ) { a . color = a . originalColor } ) , k . graph . edges ( ) . forEach ( function ( a ) { a . color = a . originalColor } ) , $ ( " . nodeInfoDiv " ) . remove ( ) , k . refresh ( { skipIndexation : ! 0 } ) } ; k . bind ( " rightClickStage " , function ( a ) { g . nodeHighlighted = " undefinedid " , o ( ) } ) , k . bind ( " rightClickNode " , function ( a ) { if ( g . nodeHighlighted ! = = a . data . node . id ) { var b = a . data . node . id , c = k . graph . neighbors ( b ) ; c [ b ] = a . data . node , k . graph . nodes ( ) . forEach ( function ( a ) { c [ a . id ] ? a . color = a . originalColor : a . color = " # eee " } ) , k . graph . edges ( ) . forEach ( function ( a ) { c [ a . source ] & & c [ a . target ] ? a . color = " rgb ( 64 , 74 , 83 ) " : a . color = " # eee " } ) , g . nodeHighlighted = ! 0 , k . refresh ( { skipIndexation : ! 0 } ) } else o ( ) } ) , this . graphConfig & & this . graphConfig . edgeEditable & & k . bind ( " clickEdge " , function ( a ) { var b = a . data . edge . id ; g . createEdgeContextMenu ( b , a ) } ) } if ( " noverlap " = = = g . algorithm ) k . startNoverlap ( ) ; else if ( " force " = = = g . algorithm ) { var p = " color : rgb ( 64 , 74 , 83 ) ; cursor : pointer ; position : absolute ; right : 30px ; bottom : 40px ; z - index : 9999 ; " ; g . aqlMode & & ( p = " color : rgb ( 64 , 74 , 83 ) ; cursor : pointer ; position : absolute ; right : 30px ; margin - top : 10px ; margin - right : - 15px " ) , $ ( " # graph - container " ) . after ( ' < div id = " toggleForce " style = " ' + p + ' " > < i style = " margin - right : 5px ; " class = " fa fa - pause " > < / i > < span > Stop layout < / span > < / div > ' ) , g . startLayout ( ) ; var q = 250 , r = 500 ; a . nodes & & ( q = a . nodes . length , c ? q < 250 ? q = 250 : q + = r : ( q < = 250 & & ( q = 500 ) , q + = r ) ) , a . empty & & arangoHelper . arangoNotification ( " Graph " , " Your graph is empty . Click inside the white window to create your first node . " ) , window . setTimeout ( function ( ) { g . stopLayout ( ) } , q ) } else " fruchtermann " = = = g . algorithm & & sigma . layouts . fruchtermanReingold . start ( k ) ; " force " ! = = g . algorithm & & g . reInitDragListener ( ) ; var s = document . getElementsByClassName ( " sigma - mouse " ) [ 0 ] ; s . addEventListener ( " mousemove " , g . trackCursorPosition . bind ( this ) , ! 1 ) , <nl> + delete b . layout , delete b . edgeType , delete b . renderer ) , b . mode = " all " , $ . ajax ( { type : " GET " , url : arangoHelper . databaseUrl ( " / _admin / aardvark / graph / " + encodeURIComponent ( this . name ) ) , contentType : " application / json " , data : b , success : function ( b ) { a . killCurrentGraph ( ) , a . renderGraph ( b ) } , error : function ( a ) { console . log ( a ) , arangoHelper . arangoError ( " Graph " , " Could not load full graph . " ) } } ) , window . modalView . hide ( ) } , resize : function ( ) { $ ( " # graph - container " ) . width ( $ ( " . centralContent " ) . width ( ) ) , $ ( " # graph - container " ) . height ( $ ( " . centralRow " ) . height ( ) - 155 ) } , toggleSettings : function ( ) { this . graphSettingsView . toggle ( ) } , render : function ( a ) { this . $ el . html ( this . template . render ( { } ) ) , $ ( " # subNavigationBar . breadcrumb " ) . html ( " Graph : " + this . name ) , this . resize ( ) , this . fetchGraph ( a ) , this . initFullscreen ( ) } , initFullscreen : function ( ) { var a = this ; if ( window . App . initializedFullscreen = = = ! 1 | | void 0 = = = window . App . initializedFullscreen ) { window . App . initializedFullscreen = ! 0 , this . isFullscreen = ! 1 ; var b = function ( b ) { ( document . webkitIsFullScreen | | document . mozFullScreen | | null ! = = document . msFullscreenElement ) & & ( a . isFullscreen = = = ! 1 ? ( a . isFullscreen = ! 0 , $ ( " # toggleForce " ) . css ( " bottom " , " 10px " ) , $ ( " # toggleForce " ) . css ( " right " , " 10px " ) , $ ( " # objectCount " ) . css ( " bottom " , " 10px " ) , $ ( " # objectCount " ) . css ( " left " , " 10px " ) , $ ( " . nodeInfoDiv " ) . css ( " top " , " 10px " ) , $ ( " . nodeInfoDiv " ) . css ( " left " , " 10px " ) ) : ( a . isFullscreen = ! 1 , $ ( " # toggleForce " ) . css ( " bottom " , " 40px " ) , $ ( " # toggleForce " ) . css ( " right " , " 40px " ) , $ ( " # objectCount " ) . css ( " bottom " , " 50px " ) , $ ( " # objectCount " ) . css ( " left " , " 25px " ) , $ ( " . nodeInfoDiv " ) . css ( " top " , " " ) , $ ( " . nodeInfoDiv " ) . css ( " left " , " 165px " ) ) ) } ; document . addEventListener & & ( document . addEventListener ( " webkitfullscreenchange " , b , ! 1 ) , document . addEventListener ( " mozfullscreenchange " , b , ! 1 ) , document . addEventListener ( " fullscreenchange " , b , ! 1 ) , document . addEventListener ( " MSFullscreenChange " , b , ! 1 ) ) } } , renderAQLPreview : function ( a ) { this . $ el . html ( this . template . render ( { } ) ) , this . $ el . find ( " . headerBar " ) . remove ( ) ; var b = $ ( " . centralRow " ) . height ( ) - 250 ; this . $ el . find ( " # graph - container " ) . css ( " height " , b ) , this . graphData . modified = this . parseData ( this . graphData . original , this . graphData . graphInfo ) ; var c = ! 1 ; try { this . renderGraph ( this . graphData . modified , null , ! 0 ) , c = ! 0 } catch ( d ) { } return c } , renderAQL : function ( a ) { this . $ el . html ( this . template . render ( { } ) ) , $ ( " # subNavigationBar . breadcrumb " ) . html ( " AQL Graph " ) , $ ( " # subNavigationBar . bottom " ) . html ( " " ) , $ ( " . queries - menu " ) . removeClass ( " active " ) , this . resize ( ) , this . graphData . modified = this . parseData ( this . graphData . original , this . graphData . graphInfo ) , this . renderGraph ( this . graphData . modified , null , ! 1 ) , this . initFullscreen ( ) , this . graphSettingsView = new window . GraphSettingsView ( { name : this . name , userConfig : void 0 , saveCallback : void 0 , noDefinedGraph : ! 0 } ) , this . graphSettingsView . render ( ) } , killCurrentGraph : function ( ) { for ( var a in this . currentGraph . renderers ) try { this . currentGraph . renderers [ a ] . clear ( ) , this . currentGraph . kill ( a ) } catch ( b ) { } } , rerenderAQL : function ( a , b ) { this . killCurrentGraph ( ) , this . renderGraph ( this . graphData . modified , null , ! 1 , a , " canvas " ) , " true " = = = $ ( " # g_nodeColorByCollection " ) . val ( ) ? this . switchNodeColorByCollection ( ! 0 ) : $ ( " # g_nodeColor " ) . is ( " : disabled " ) ? this . updateColors ( ! 0 , ! 0 , null , null , ! 0 ) : this . ncolor ? this . updateColors ( ! 0 , ! 0 , this . ncolor , this . ecolor ) : this . updateColors ( ! 0 , ! 0 , " # 2ecc71 " , " # 2ecc71 " ) , " true " = = = $ ( " # g_edgeColorByCollection " ) . val ( ) ? this . switchEdgeColorByCollection ( ! 0 ) : $ ( " # g_edgeColor " ) . is ( " : disabled " ) ? this . updateColors ( ! 0 , ! 0 , null , null , ! 0 ) : this . ecolor ? this . updateColors ( ! 0 , ! 0 , this . ncolor , this . ecolor ) : this . updateColors ( ! 0 , ! 0 , " # 2ecc71 " , " # 2ecc71 " ) } , buildCollectionColors : function ( ) { var a = this ; if ( ! a . collectionColors ) { a . collectionColors = { } ; var b = 0 , c = { } , d = { } ; _ . each ( this . currentGraph . graph . nodes ( ) , function ( a ) { c [ a . id ] = void 0 } ) , _ . each ( a . currentGraph . graph . edges ( ) , function ( a ) { d [ a . id ] = void 0 } ) , _ . each ( c , function ( c , d ) { void 0 = = = a . collectionColors [ d . split ( " / " ) [ 0 ] ] & & ( a . collectionColors [ d . split ( " / " ) [ 0 ] ] = { color : a . colors . jans [ b ] } , b + + ) } ) , b = 0 , _ . each ( d , function ( c , d ) { void 0 = = = a . collectionColors [ d . split ( " / " ) [ 0 ] ] & & ( a . collectionColors [ d . split ( " / " ) [ 0 ] ] = { color : a . colors . jans [ b ] } , b + + ) } ) } } , switchNodeColorByCollection : function ( a , b ) { var c = this ; c . buildCollectionColors ( ) , a ? ( c . currentGraph . graph . nodes ( ) . forEach ( function ( a ) { a . color = c . collectionColors [ a . id . split ( " / " ) [ 0 ] ] . color } ) , c . currentGraph . refresh ( ) ) : b ? this . updateColors ( ! 0 , null , null , null , b ) : this . ncolor ? this . updateColors ( ! 0 , null , this . ncolor , this . ecolor ) : this . updateColors ( ! 0 , null , " # 2ecc71 " , " # 2ecc71 " ) } , switchEdgeColorByCollection : function ( a , b ) { var c = this ; c . buildCollectionColors ( ) , a ? ( c . currentGraph . graph . edges ( ) . forEach ( function ( a ) { a . color = c . collectionColors [ a . id . split ( " / " ) [ 0 ] ] . color } ) , c . currentGraph . refresh ( ) ) : b ? this . updateColors ( ! 0 , null , null , null , b ) : this . ecolor ? this . updateColors ( null , ! 0 , this . ncolor , this . ecolor ) : this . updateColors ( null , ! 0 , " # 2ecc71 " , " # 2ecc71 " ) } , buildCollectionSizes : function ( ) { var a = this ; if ( ! a . nodeEdgesCount ) { a . nodeEdgesCount = { } ; var b = { } ; _ . each ( this . currentGraph . graph . edges ( ) , function ( c ) { void 0 = = = b [ c . id ] & & ( b [ c . id ] = ! 0 , void 0 = = = a . nodeEdgesCount [ c . source ] ? a . nodeEdgesCount [ c . source ] = 1 : a . nodeEdgesCount [ c . source ] + = 1 , void 0 = = = a . nodeEdgesCount [ c . target ] ? a . nodeEdgesCount [ c . target ] = 1 : a . nodeEdgesCount [ c . target ] + = 1 ) } ) } } , switchNodeSizeByCollection : function ( a ) { var b = this ; a ? ( b . buildCollectionSizes ( ) , b . currentGraph . graph . nodes ( ) . forEach ( function ( a ) { a . size = b . nodeEdgesCount [ a . id ] } ) ) : b . currentGraph . graph . nodes ( ) . forEach ( function ( a ) { a . size = 15 } ) , b . currentGraph . refresh ( ) } , switchEdgeType : function ( a ) { var b = { nodes : this . currentGraph . graph . nodes ( ) , edges : this . currentGraph . graph . edges ( ) , settings : { } } ; this . killCurrentGraph ( ) , this . renderGraph ( b , null , ! 1 , null , null , a ) } , switchLayout : function ( a ) { var b = { nodes : this . currentGraph . graph . nodes ( ) , edges : this . currentGraph . graph . edges ( ) , settings : { } } ; this . killCurrentGraph ( ) , this . renderGraph ( b , null , ! 1 , a ) , " true " = = = $ ( " # g_nodeColorByCollection " ) . val ( ) & & this . switchNodeColorByCollection ( ! 0 ) , " true " = = = $ ( " # g_edgeColorByCollection " ) . val ( ) ? this . switchEdgeColorByCollection ( ! 0 ) : this . switchEdgeColorByCollection ( ! 1 ) } , parseData : function ( a , b ) { var c = { } , d = { } , e = " # 2ecc71 " , f = { nodes : [ ] , edges : [ ] , settings : { } } ; if ( this . ncolor & & ( e = this . ncolor ) , " object " = = = b ) { _ . each ( a , function ( a ) { a . edges & & a . vertices & & ( _ . each ( a . edges , function ( a ) { null ! = = a & & ( d [ a . _id ] = { id : a . _id , source : a . _from , color : " # cccccc " , target : a . _to } ) } ) , _ . each ( a . vertices , function ( a ) { null ! = = a & & ( c [ a . _id ] = { id : a . _id , label : a . _key , size : . 3 , color : e , x : Math . random ( ) , y : Math . random ( ) } ) } ) ) } ) ; var g = [ ] ; _ . each ( c , function ( a ) { f . nodes . push ( a ) , g . push ( a . id ) } ) , _ . each ( d , function ( a ) { g . includes ( a . source ) & & g . includes ( a . target ) & & f . edges . push ( a ) } ) } else " array " = = = b & & ( _ . each ( a , function ( a ) { c [ a . _from ] = null , c [ a . _to ] = null , f . edges . push ( { id : a . _id , source : a . _from , color : " # cccccc " , target : a . _to } ) } ) , _ . each ( c , function ( a , b ) { f . nodes . push ( { id : b , label : b , size : . 3 , color : e , x : Math . random ( ) , y : Math . random ( ) } ) } ) ) ; return f } , rerender : function ( ) { this . fetchGraph ( ) } , fetchGraph : function ( a ) { var b = this ; $ ( this . el ) . append ( ' < div id = " calculatingGraph " style = " position : absolute ; left : 25px ; top : 130px ; " > < i class = " fa fa - circle - o - notch fa - spin " style = " margin - right : 10px ; " > < / i > < span id = " calcText " > Fetching graph data . Please wait . . . < / span > < / br > < / br > < / br > < span style = " font - weight : 100 ; opacity : 0 . 6 ; font - size : 9pt ; " > If it ` s taking too much time to draw the graph , please navigate to : < a style = " font - weight : 500 " href = " ' + window . location . href + ' / graphs " > Graphs View < / a > < / br > Click the settings icon and reset the display settings . It is possible that the graph is too big to be handled by the browser . < / span > < / div > ' ) ; var c = function ( ) { var c = { } ; b . graphConfig & & ( c = _ . clone ( b . graphConfig ) , delete c . layout , delete c . edgeType , delete c . renderer ) , b . tmpStartNode & & ( b . graphConfig ? 0 = = = b . graphConfig . nodeStart . length & & ( c . nodeStart = b . tmpStartNode ) : c . nodeStart = b . tmpStartNode ) , b . setupSigma ( ) , b . fetchStarted = new Date , $ . ajax ( { type : " GET " , url : arangoHelper . databaseUrl ( " / _admin / aardvark / graph / " + encodeURIComponent ( b . name ) ) , contentType : " application / json " , data : c , success : function ( c ) { c . empty = = = ! 0 ? b . renderGraph ( c , a ) : ( c . settings & & c . settings . startVertex & & void 0 = = = b . graphConfig . startNode & & void 0 = = = b . tmpStartNode & & ( b . tmpStartNode = c . settings . startVertex . _id ) , b . fetchFinished = new Date , b . calcStart = b . fetchFinished , $ ( " # calcText " ) . html ( " Server response took " + Math . abs ( b . fetchFinished . getTime ( ) - b . fetchStarted . getTime ( ) ) + " ms . Initializing graph engine . Please wait . . . " ) , window . setTimeout ( function ( ) { b . renderGraph ( c , a ) } , 50 ) ) } , error : function ( a ) { try { var c ; if ( a . responseJSON . exception ) { c = a . responseJSON . exception ; var d = a . responseJSON . exception . search ( " 1205 " ) ; if ( d ! = = - 1 ) { var e = ' Starting point : < span style = " font - weight : 400 " > ' + b . graphConfig . nodeStart + " < / span > is invalid " ; $ ( " # calculatingGraph " ) . html ( ' < div style = " font - weight : 300 ; font - size : 10 . 5pt " > < span style = " font - weight : 400 " > Stopped . < / span > < / br > < / br > ' + e + ' . Please < a style = " color : # 3498db " href = " ' + window . location . href + ' / settings " > choose a different start node . < / a > < / div > ' ) } else $ ( " # calculatingGraph " ) . html ( " Failed to fetch graph information . " ) } else c = a . responseJSON . errorMessage , $ ( " # calculatingGraph " ) . html ( " Failed to fetch graph information : " + a . responseJSON . errorMessage ) ; arangoHelper . arangoError ( " Graph " , c ) } catch ( f ) { } } } ) } ; void 0 = = = b . graphConfig | | null = = = b . graphConfig ? b . userConfig . fetch ( { success : function ( a ) { var d = frontendConfig . db + " _ " + b . name ; try { b . graphConfig = a . toJSON ( ) . graphs [ d ] , b . getGraphSettings ( c ) , void 0 = = = b . graphConfig | | null = = = b . graphConfig ? ( b . graphSettingsView = new window . GraphSettingsView ( { name : b . name , userConfig : b . userConfig , saveCallback : b . render } ) , b . graphSettingsView . setDefaults ( ! 0 , ! 0 ) ) : ( b . graphSettingsView & & b . graphSettingsView . remove ( ) , b . graphSettingsView = new window . GraphSettingsView ( { name : b . name , userConfig : b . userConfig , saveCallback : b . render } ) ) } catch ( e ) { b . getGraphSettings ( c ) } } } ) : this . getGraphSettings ( c ) } , setupSigma : function ( ) { if ( this . graphConfig & & this . graphConfig . edgeLabel ) { sigma . utils . pkg ( " sigma . settings " ) ; var a = { defaultEdgeLabelColor : " # 000 " , defaultEdgeLabelActiveColor : " # 000 " , defaultEdgeLabelSize : 12 , edgeLabelSize : " fixed " , edgeLabelThreshold : 1 , edgeLabelSizePowRatio : 1 } ; sigma . settings = sigma . utils . extend ( sigma . settings | | { } , a ) , sigma . settings . drawEdgeLabels = ! 0 , sigma . settings . clone = ! 0 } } , contextState : { createEdge : ! 1 , _from : ! 1 , _to : ! 1 , fromX : ! 1 , fromY : ! 1 } , clearOldContextMenu : function ( a ) { var b = this ; $ ( " # nodeContextMenu " ) . remove ( ) ; var c = ' < div id = " nodeContextMenu " class = " nodeContextMenu animated zoomIn " > < / div > ' ; $ ( " # graph - container " ) . append ( c ) , a & & _ . each ( this . contextState , function ( a , c ) { b . contextState [ c ] = ! 1 } ) ; var d = document . getElementsByClassName ( " sigma - mouse " ) [ 0 ] ; d . removeEventListener ( " mousemove " , b . drawLine . bind ( this ) , ! 1 ) } , trackCursorPosition : function ( a ) { this . cursorX = a . x , this . cursorY = a . y } , deleteNode : function ( a , b ) { var c , d , e , f = this ; c = b ? b : $ ( " # delete - node - attr - id " ) . text ( ) , d = c . split ( " / " ) [ 0 ] , e = c . split ( " / " ) [ 1 ] ; var g = arangoHelper . databaseUrl ( " / _api / gharial / " + encodeURIComponent ( f . name ) + " / vertex / " + encodeURIComponent ( c . split ( " / " ) [ 0 ] ) + " / " + encodeURIComponent ( c . split ( " / " ) [ 1 ] ) ) ; if ( " yes " = = = $ ( " # delete - node - edges - attr " ) . val ( ) ) $ . ajax ( { cache : ! 1 , type : " DELETE " , contentType : " application / json " , url : g , success : function ( a ) { f . currentGraph . graph . dropNode ( c ) , f . currentGraph . refresh ( ) } , error : function ( ) { arangoHelper . arangoError ( " Graph " , " Could not delete node . " ) } } ) ; else { var h = function ( a ) { a ? arangoHelper . arangoError ( " Graph " , " Could not delete node . " ) : ( f . currentGraph . graph . dropNode ( c ) , f . currentGraph . refresh ( ) ) } ; this . documentStore . deleteDocument ( d , e , h ) } window . modalView . hide ( ) } , deleteNodes : function ( ) { var a = this ; try { var b = JSON . parse ( $ ( " # delete - nodes - arr - id " ) . text ( ) ) ; _ . each ( b , function ( b ) { a . deleteNode ( null , b ) } ) } catch ( c ) { } } , deleteNodesModal : function ( ) { var a = [ ] ; if ( _ . each ( this . selectedNodes , function ( b ) { a . push ( b ) } ) , 0 = = = a . length ) return void arangoHelper . arangoNotification ( " Graph " , " No nodes selected . " ) ; var b = [ ] , c = [ ] ; c . push ( window . modalView . createReadOnlyEntry ( " delete - nodes - arr - id " , " Really delete nodes " , JSON . stringify ( a ) ) ) , b . push ( window . modalView . createDeleteButton ( " Delete " , this . deleteNodes . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Delete nodes " , b , c ) } , deleteNodeModal : function ( a ) { var b = [ ] , c = [ ] ; c . push ( window . modalView . createReadOnlyEntry ( " delete - node - attr - id " , " Really delete node " , a ) ) , this . noDefinedGraph | | c . push ( window . modalView . createSelectEntry ( " delete - node - edges - attr " , " Also delete edges ? " , void 0 , void 0 , [ { value : " yes " , label : " Yes " } , { value : " no " , label : " No " } ] ) ) , b . push ( window . modalView . createDeleteButton ( " Delete " , this . deleteNode . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Delete node " , b , c ) } , addNode : function ( ) { var a = this , b = $ ( " . modal - body # new - node - collection - attr " ) . val ( ) , c = $ ( " . modal - body # new - node - key - attr " ) . last ( ) . val ( ) , d = function ( b , c , d ) { b ? arangoHelper . arangoError ( " Could not create node " , d ) : ( $ ( " # emptyGraph " ) . remove ( ) , a . currentGraph . graph . addNode ( { id : c , label : c . split ( " / " ) [ 1 ] | | " " , size : a . graphConfig . nodeSize | | 15 , color : a . graphConfig . nodeColor | | a . ncolor | | " # 2ecc71 " , originalColor : a . graphConfig . nodeColor | | a . ncolor | | " # 2ecc71 " , x : a . addNodeX + a . currentGraph . camera . x , y : a . addNodeY + a . currentGraph . camera . y } ) , window . modalView . hide ( ) , a . currentGraph . refresh ( ) , a . cameraToNode ( a . currentGraph . graph . nodes ( c ) ) ) } , e = { } ; if ( " " ! = = c & & void 0 ! = = c & & ( e . _key = c ) , this . graphSettings . isSmart ) { var f = $ ( " # new - smart - key - attr " ) . val ( ) ; " " ! = = f & & void 0 ! = = f ? e [ this . graphSettings . smartGraphAttribute ] = f : e [ this . graphSettings . smartGraphAttribute ] = null } this . collection . createNode ( a . name , b , e , d ) } , deleteEdgeModal : function ( a ) { var b = [ ] , c = [ ] ; c . push ( window . modalView . createReadOnlyEntry ( " delete - edge - attr - id " , " Really delete edge " , a ) ) , b . push ( window . modalView . createDeleteButton ( " Delete " , this . deleteEdge . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Delete edge " , b , c ) } , deleteEdge : function ( ) { var a = this , b = $ ( " # delete - edge - attr - id " ) . text ( ) , c = b . split ( " / " ) [ 0 ] , d = b . split ( " / " ) [ 1 ] , e = function ( c ) { c ? arangoHelper . arangoError ( " Graph " , " Could not delete edge . " ) : ( a . currentGraph . graph . dropEdge ( b ) , a . currentGraph . refresh ( ) ) } ; this . documentStore . deleteDocument ( c , d , e ) , window . modalView . hide ( ) } , addNodeModal : function ( ) { if ( 0 ! = = this . graphSettings . vertexCollections ) { var a = [ ] , b = [ ] , c = [ ] ; _ . each ( this . graphSettings . vertexCollections , function ( a ) { c . push ( { label : a . name , value : a . name } ) } ) , b . push ( window . modalView . createTextEntry ( " new - node - key - attr " , " _key " , void 0 , " The nodes unique key ( optional attribute , leave empty for autogenerated key " , " is optional : leave empty for autogenerated key " , ! 1 , [ { rule : Joi . string ( ) . allow ( " " ) . optional ( ) , msg : " " } ] ) ) , this . graphSettings . isSmart & & b . push ( window . modalView . createTextEntry ( " new - smart - key - attr " , this . graphSettings . smartGraphAttribute + " * " , void 0 , " The attribute value that is used to smartly shard the vertices of a graph . \ nEvery vertex in this Graph has to have this attribute . \ nCannot be modified later . " , " Cannot be modified later . " , ! 1 , [ { rule : Joi . string ( ) . allow ( " " ) . optional ( ) , msg : " " } ] ) ) , b . push ( window . modalView . createSelectEntry ( " new - node - collection - attr " , " Collection " , void 0 , " Please select the destination for the new node . " , c ) ) , a . push ( window . modalView . createSuccessButton ( " Create " , this . addNode . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Create node " , a , b ) } else arangoHelper . arangoError ( " Graph " , " No valid vertex collections found . " ) } , addEdge : function ( ) { var a , b = this , c = b . contextState . _from , d = b . contextState . _to ; a = " " = = = $ ( " . modal - body # new - edge - collection - attr " ) . val ( ) ? $ ( " . modal - body # new - edge - collection - attr " ) . text ( ) : $ ( " . modal - body # new - edge - collection - attr " ) . val ( ) ; var e = $ ( " . modal - body # new - edge - key - attr " ) . last ( ) . val ( ) , f = function ( a , e , f ) { if ( a ) arangoHelper . arangoError ( " Could not create edge " , f ) ; else { var g = { source : c , target : d , id : e , color : b . graphConfig . edgeColor | | b . ecolor } ; " true " = = = b . graphConfig . edgeEditable & & ( g . size = 1 ) , b . currentGraph . graph . addEdge ( g ) , b . graphConfig & & " curve " = = = b . graphConfig . edgeType & & sigma . canvas . edges . autoCurve ( b . currentGraph ) , b . currentGraph . refresh ( ) } b . clearOldContextMenu ( ! 0 ) , window . modalView . hide ( ) } , g = { _from : c , _to : d } ; " " ! = = e & & void 0 ! = = e & & ( g . _key = e ) , this . collection . createEdge ( b . name , a , g , f ) } , addEdgeModal : function ( a ) { if ( 0 ! = = a ) { var b = [ ] , c = [ ] ; if ( c . push ( window . modalView . createTextEntry ( " new - edge - key - attr " , " _key " , void 0 , " The edges unique key ( optional attribute , leave empty for autogenerated key " , " is optional : leave empty for autogenerated key " , ! 1 , [ { rule : Joi . string ( ) . allow ( " " ) . optional ( ) , msg : " " } ] ) ) , a . length > 1 ) { var d = [ ] ; _ . each ( a , function ( a ) { d . push ( { label : a , value : a } ) } ) , c . push ( window . modalView . createSelectEntry ( " new - edge - collection - attr " , " Edge collection " , void 0 , " Please select the destination for the new edge . " , d ) ) } else c . push ( window . modalView . createReadOnlyEntry ( " new - edge - collection - attr " , " Edge collection " , a [ 0 ] , " The edge collection to be used . " ) ) ; b . push ( window . modalView . createSuccessButton ( " Create " , this . addEdge . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Create edge " , b , c ) } else arangoHelper . arangoError ( " Graph " , " No valid edge definitions found . " ) } , updateColors : function ( a , b , c , d , e ) { var f = frontendConfig . db + " _ " + this . name , g = this ; c & & ( g . ncolor = c ) , d & & ( g . ecolor = d ) , this . userConfig . fetch ( { success : function ( h ) { if ( a = = = ! 0 ) { g . graphConfig = h . toJSON ( ) . graphs [ f ] ; try { g . currentGraph . graph . nodes ( ) . forEach ( function ( a ) { e ? a . color = a . sortColor : a . color = c } ) } catch ( i ) { g . graphNotInitialized = ! 0 , g . tmpGraphArray = [ a , b , c , d ] } } if ( b = = = ! 0 ) try { g . currentGraph . graph . edges ( ) . forEach ( function ( a ) { e ? a . color = a . sortColor : a . color = d } ) } catch ( j ) { g . graphNotInitialized = ! 0 , g . tmpGraphArray = [ a , b , c , d ] } g . currentGraph & & g . currentGraph . refresh ( ) } } ) } , nodesContextMenuCheck : function ( a ) { this . nodesContextEventState = a , this . openNodesDate = new Date } , createContextMenu : function ( a ) { var b = this , c = b . cursorX - 50 , d = b . cursorY - 50 ; this . clearOldContextMenu ( ) ; var e = function ( a ) { var c = wheelnav , d = new c ( " nodeContextMenu " ) ; d . maxPercent = 1 , d . wheelRadius = 50 , d . clockwise = ! 1 , d . colors = b . colors . hotaru , d . multiSelect = ! 0 , d . clickModeRotate = ! 1 , d . slicePathFunction = slicePath ( ) . DonutSlice , d . createWheel ( [ icon . plus , icon . arrowleft2 ] ) , d . navItems [ 0 ] . selected = ! 1 , d . navItems [ 0 ] . hovered = ! 1 , d . navItems [ 0 ] . navigateFunction = function ( a ) { b . clearOldContextMenu ( ) , b . addNodeModal ( ) } , d . navItems [ 1 ] . navigateFunction = function ( a ) { b . clearOldContextMenu ( ) } , d . navItems [ 0 ] . selected = ! 1 , d . navItems [ 0 ] . hovered = ! 1 } ; $ ( " # nodeContextMenu " ) . css ( " position " , " fixed " ) , $ ( " # nodeContextMenu " ) . css ( " left " , c ) , $ ( " # nodeContextMenu " ) . css ( " top " , d ) , $ ( " # nodeContextMenu " ) . width ( 100 ) , $ ( " # nodeContextMenu " ) . height ( 100 ) , e ( a ) } , createEdgeContextMenu : function ( a , b ) { var c = this , d = this . cursorX - 165 , e = this . cursorY - 120 ; this . clearOldContextMenu ( ) ; var f = function ( a , b ) { var d = [ " # 364C4A " , " # 497C7F " , " # 92C5C0 " , " # 858168 " , " # CCBCA5 " ] , e = wheelnav , f = new e ( " nodeContextMenu " ) ; f . maxPercent = 1 , f . wheelRadius = 50 , f . clockwise = ! 1 , f . colors = d , f . multiSelect = ! 0 , f . clickModeRotate = ! 1 , f . slicePathFunction = slicePath ( ) . DonutSlice , f . createWheel ( [ icon . edit , icon . trash ] ) , f . navItems [ 0 ] . selected = ! 1 , f . navItems [ 0 ] . hovered = ! 1 , f . navItems [ 0 ] . navigateFunction = function ( a ) { c . clearOldContextMenu ( ) , c . editEdge ( b ) } , f . navItems [ 1 ] . navigateFunction = function ( a ) { c . clearOldContextMenu ( ) , c . deleteEdgeModal ( b ) } , f . navItems [ 0 ] . selected = ! 1 , f . navItems [ 0 ] . hovered = ! 1 } ; $ ( " # nodeContextMenu " ) . css ( " left " , d + 115 ) , $ ( " # nodeContextMenu " ) . css ( " top " , e + 72 ) , $ ( " # nodeContextMenu " ) . width ( 100 ) , $ ( " # nodeContextMenu " ) . height ( 100 ) , f ( b , a ) } , createNodeContextMenu : function ( a , b ) { var c , d , e , f = this ; _ . each ( b . data . node , function ( a , b ) { " renderer " = = = b . substr ( 0 , 8 ) & & " x " = = = b . charAt ( b . length - 1 ) & & ( c = a ) , " renderer " = = = b . substr ( 0 , 8 ) & & " y " = = = b . charAt ( b . length - 1 ) & & ( d = a ) , " renderer " = = = b . substr ( 0 , 8 ) & & " e " = = = b . charAt ( b . length - 1 ) & & ( e = a ) } ) , void 0 = = = c & & void 0 = = = d & & _ . each ( b . data . node , function ( a , b ) { " read_cam " = = = b . substr ( 0 , 8 ) & & " x " = = = b . charAt ( b . length - 1 ) & & ( c = a + $ ( " # graph - container " ) . width ( ) / 2 ) , " read_cam " = = = b . substr ( 0 , 8 ) & & " y " = = = b . charAt ( b . length - 1 ) & & ( d = a + $ ( " # graph - container " ) . height ( ) / 2 ) } ) ; var g = 2 . 5 * e ; g < 75 & & ( g = 75 ) , this . clearOldContextMenu ( ) ; var h = function ( a , b ) { var e = [ " # 364C4A " , " # 497C7F " , " # 92C5C0 " , " # 858168 " , " # CCBCA5 " ] , h = wheelnav , i = new h ( " nodeContextMenu " ) ; i . maxPercent = 1 , i . wheelRadius = g , i . clockwise = ! 1 , i . colors = e , i . multiSelect = ! 1 , i . clickModeRotate = ! 1 , i . sliceHoverAttr = { stroke : " # fff " , " stroke - width " : 2 } , i . slicePathFunction = slicePath ( ) . DonutSlice , f . noDefinedGraph ? i . createWheel ( [ " imgsrc : img / gv_edit . png " , " imgsrc : img / gv_trash . png " ] ) : i . createWheel ( [ " imgsrc : img / gv_edit . png " , " imgsrc : img / gv_trash . png " , " imgsrc : img / gv_flag . png " , " imgsrc : img / gv_link . png " , " imgsrc : img / gv_expand . png " ] ) , $ ( " # nodeContextMenu " ) . addClass ( " animated bounceIn " ) , window . setTimeout ( function ( ) { i . navItems [ 0 ] . navigateFunction = function ( a ) { f . clearOldContextMenu ( ) , f . editNode ( b ) , f . removeHelp ( ) } , i . navItems [ 1 ] . navigateFunction = function ( a ) { f . clearOldContextMenu ( ) , f . deleteNodeModal ( b ) , f . removeHelp ( ) } , f . noDefinedGraph | | ( i . navItems [ 2 ] . navigateFunction = function ( a ) { f . clearOldContextMenu ( ) , f . setStartNode ( b ) , f . removeHelp ( ) } , i . navItems [ 3 ] . navigateFunction = function ( a ) { f . contextState . createEdge = ! 0 , f . contextState . _from = b , f . contextState . fromX = c , f . contextState . fromY = d ; var e = document . getElementsByClassName ( " sigma - mouse " ) [ 0 ] ; f . drawHelp ( " Now click destination node , or click background to cancel . " ) , e . addEventListener ( " mousemove " , f . drawLine . bind ( this ) , ! 1 ) , f . clearOldContextMenu ( ) , f . removeHelp ( ) } , i . navItems [ 4 ] . navigateFunction = function ( a ) { f . clearOldContextMenu ( ) , f . expandNode ( b ) , f . removeHelp ( ) } ) ; var a = [ " Edit the node . " , " Delete node . " ] ; f . noDefinedGraph | | ( a . push ( " Set as startnode . " ) , a . push ( " Draw edge . " ) , a . push ( " Expand the node . " ) ) , _ . each ( a , function ( a , b ) { i . navItems [ b ] . navTitle . mouseover ( function ( ) { f . drawHelp ( a ) } ) , i . navItems [ b ] . navTitle . mouseout ( function ( ) { f . removeHelp ( ) } ) } ) , i . navItems [ 0 ] . selected = ! 1 , i . navItems [ 0 ] . hovered = ! 1 } , 300 ) } , i = $ ( " # graph - container " ) . offset ( ) ; $ ( " # nodeContextMenu " ) . width ( 2 * g ) , $ ( " # nodeContextMenu " ) . height ( 2 * g ) , $ ( " # nodeContextMenu " ) . css ( " left " , c + i . left - g ) , $ ( " # nodeContextMenu " ) . css ( " top " , d + i . top - g ) , h ( b , a ) } , drawHelp : function ( a ) { null = = = document . getElementById ( " helpTooltip " ) ? $ ( this . el ) . append ( ' < div id = " helpTooltip " class = " helpTooltip " > < span > ' + a + " < / span > < / div > " ) : $ ( " # helpTooltip span " ) . text ( a ) , $ ( " # helpTooltip " ) . show ( ) } , removeHelp : function ( ) { $ ( " # helpTooltip " ) . remove ( ) } , clearMouseCanvas : function ( ) { var a = document . getElementsByClassName ( " sigma - mouse " ) [ 0 ] , b = a . getContext ( " 2d " ) ; b . clearRect ( 0 , 0 , $ ( a ) . width ( ) , $ ( a ) . height ( ) ) } , expandNode : function ( a ) { var b = this , c = { } ; this . graphConfig & & ( c = _ . clone ( this . graphConfig ) , delete c . layout , delete c . edgeType , delete c . renderer ) , c . query = ' FOR v , e , p IN 1 . . 1 ANY " ' + a + ' " GRAPH " ' + b . name + ' " RETURN p ' , $ . ajax ( { type : " GET " , url : arangoHelper . databaseUrl ( " / _admin / aardvark / graph / " + encodeURIComponent ( this . name ) ) , contentType : " application / json " , data : c , success : function ( c ) { b . checkExpand ( c , a ) } , error : function ( b ) { arangoHelper . arangoError ( " Graph " , " Could not expand node : " + a + " . " ) } } ) , b . removeHelp ( ) } , checkExpand : function ( a , b ) { var c , d = this , e = a . nodes , f = a . edges , g = this . currentGraph . graph . nodes ( ) , h = 0 , i = 0 ; _ . each ( e , function ( a ) { c = ! 1 , _ . each ( g , function ( d ) { c = = = ! 1 & & ( a . id = = = d . id ? ( d . id = = = b & & ( d . label = d . label + " ( expanded ) " ) , c = ! 0 ) : c = ! 1 ) } ) , c = = = ! 1 & & ( a . originalColor = a . color , d . currentGraph . graph . addNode ( a ) , h + + , _ . each ( f , function ( b ) { b . source ! = = a . id & & b . target ! = = a . id | | ( b . originalColor = b . color , d . currentGraph . graph . addEdge ( b ) , i + + ) } ) ) } ) , $ ( " # nodesCount " ) . text ( parseInt ( $ ( " # nodesCount " ) . text ( ) , 10 ) + h ) , $ ( " # edgesCount " ) . text ( parseInt ( $ ( " # edgesCount " ) . text ( ) , 10 ) + i ) , ( h > 0 | | i > 0 ) & & ( " force " = = = d . algorithm ? d . startLayout ( ! 0 , b ) : " fruchtermann " = = = d . algorithm ? ( sigma . layouts . fruchtermanReingold . start ( d . currentGraph ) , d . currentGraph . refresh ( ) , d . cameraToNode ( b , 1e3 ) ) : " noverlap " = = = d . algorithm & & d . startLayout ( ! 0 , b ) ) } , cameraToNode : function ( a , b ) { var c = this ; " string " = = typeof a & & ( a = c . currentGraph . graph . nodes ( a ) ) ; var d = function ( a ) { sigma . misc . animation . camera ( c . currentGraph . camera , { x : a . x , y : a . y } , { duration : 1e3 } ) } ; b ? window . setTimeout ( function ( ) { d ( a ) } , b ) : d ( a ) } , drawLine : function ( a ) { var b = window . App . graphViewer . contextState ; if ( b . createEdge ) { var c = b . fromX , d = b . fromY , e = a . offsetX , f = a . offsetY , g = document . getElementsByClassName ( " sigma - mouse " ) [ 0 ] , h = g . getContext ( " 2d " ) ; h . clearRect ( 0 , 0 , $ ( g ) . width ( ) , $ ( g ) . height ( ) ) , h . beginPath ( ) , h . moveTo ( c , d ) , h . lineTo ( e , f ) , h . strokeStyle = this . newEdgeColor , h . stroke ( ) } } , getGraphSettings : function ( a ) { var b = this ; this . userConfig . fetch ( { success : function ( c ) { var d = frontendConfig . db + " _ " + b . name ; b . graphConfig = c . toJSON ( ) . graphs [ d ] , b . graphSettingsView & & b . graphSettingsView . remove ( ) , b . graphSettingsView = new window . GraphSettingsView ( { name : b . name , userConfig : b . userConfig , saveCallback : b . render } ) ; var e = function ( ) { b . graphSettingsView . render ( ) , a & & a ( b . graphConfig ) } ; void 0 = = = b . graphConfig ? ( b . graphSettingsView . setDefaults ( ! 0 , ! 0 ) , b . userConfig . fetch ( { success : function ( a ) { b . graphConfig = a . toJSON ( ) . graphs [ d ] , e ( ) } } ) ) : e ( ) } } ) } , setStartNode : function ( a ) { this . graphConfig . nodeStart = a , this . graphSettingsView . saveGraphSettings ( void 0 , void 0 , a ) } , editNode : function ( a ) { var b = function ( a , b ) { } ; arangoHelper . openDocEditor ( a , " doc " , b ) } , editEdge : function ( a ) { var b = function ( ) { } ; arangoHelper . openDocEditor ( a , " edge " , b ) } , reloadGraph : function ( ) { Backbone . history . loadUrl ( Backbone . history . fragment ) } , getEdgeDefinitionCollections : function ( a , b ) { var c = [ ] ; return _ . each ( this . model . edgeDefinitions , function ( d ) { _ . each ( d . from , function ( e ) { e = = = a & & _ . each ( d . to , function ( a ) { a = = = b & & c . push ( d . collection ) } ) } ) } ) , c } , initializeGraph : function ( a , b ) { a . refresh ( ) } , renderGraph : function ( a , b , c , d , e , f ) { var g = this ; this . graphSettings = a . settings ; var h = " # 2ecc71 " ; if ( g . ncolor & & ( h = g . ncolor ) , a . edges & & a . nodes ) { 0 = = = a . nodes . length & & 0 = = = a . edges . length & & a . nodes . push ( { id : a . settings . startVertex . _id , label : a . settings . startVertex . _key , size : 10 , color : h , x : Math . random ( ) , y : Math . random ( ) } ) ; var i = " position : absolute ; left : 25px ; bottom : 50px ; " ; this . aqlMode | | $ ( " # graph - container " ) . append ( ' < div id = " objectCount " style = " ' + i + ' animated fadeIn " > < span style = " margin - right : 10px " class = " arangoState " > < span id = " nodesCount " > ' + a . nodes . length + ' < / span > nodes < / span > < span class = " arangoState " > < span id = " edgesCount " > ' + a . edges . length + " < / span > edges < / span > < / div > " ) } this . Sigma = sigma , d ? g . algorithm = d : g . algorithm = " force " , e ? g . renderer = e : g . renderer = " canvas " , this . graphConfig & & ( this . graphConfig . layout & & ( d | | ( g . algorithm = this . graphConfig . layout ) ) , this . graphConfig . renderer & & ( e | | ( g . renderer = this . graphConfig . renderer ) ) ) , " canvas " = = = g . renderer & & ( g . isEditable = ! 0 ) ; var j = { scalingMode : " inside " , borderSize : 3 , defaultNodeBorderColor : " # 8c8c8c " , doubleClickEnabled : ! 1 , minNodeSize : 5 , labelThreshold : 9 , maxNodeSize : 15 , batchEdgesDrawing : ! 0 , minEdgeSize : 1 , maxEdgeSize : 1 , enableEdgeHovering : ! 0 , edgeHoverColor : " # 8c8c8c " , defaultEdgeHoverColor : " # 8c8c8c " , defaultEdgeType : " arrow " , edgeHoverSizeRatio : 2 . 5 , edgeHoverExtremities : ! 0 , nodesPowRatio : . 5 , autoRescale : ! 0 , mouseEnabled : ! 0 , touchEnabled : ! 0 , approximateLabelWidth : ! 0 , font : " Roboto " } ; j . nodeHaloColor = " rgba ( 146 , 197 , 192 , 0 . 8 ) " , j . nodeHaloStroke = ! 1 , j . nodeHaloStrokeColor = " # 000 " , j . nodeHaloStrokeWidth = 0 , j . nodeHaloSize = 25 , j . nodeHaloClustering = ! 1 , j . nodeHaloClusteringMaxRadius = 1e3 , j . edgeHaloColor = " # fff " , j . edgeHaloSize = 10 , j . drawHalo = ! 0 , " canvas " = = = g . renderer & & ( j . autoCurveSortByDirection = ! 0 ) , a . nodes & & a . nodes . length > 250 & & ( j . hideEdgesOnMove = ! 0 ) , this . graphConfig & & this . graphConfig . edgeType & & ( j . defaultEdgeType = this . graphConfig . edgeType ) , f & & ( j . defaultEdgeType = f ) , " arrow " = = = j . defaultEdgeType & & ( j . minArrowSize = 7 ) , c & & ( g . renderer = " canvas " , a . nodes . length < 500 ? g . algorithm = " fruchtermann " : j . scalingMode = " outside " , j . drawEdgeLabels = ! 1 , j . minNodeSize = 2 , j . maxNodeSize = 8 ) , " webgl " = = = g . renderer & & ( j . enableEdgeHovering = ! 1 ) ; var k = new this . Sigma ( { graph : a , container : " graph - container " , renderer : { container : document . getElementById ( " graph - container " ) , type : g . renderer } , settings : j } ) ; if ( this . currentGraph = k , this . aqlMode | | sigma . plugins . fullScreen ( { container : " graph - container " , btnId : " graph - fullscreen - btn " } ) , k . graph . nodes ( ) . forEach ( function ( a ) { a . originalColor = a . color } ) , k . graph . edges ( ) . forEach ( function ( a ) { a . originalColor = a . color } ) , " noverlap " = = = g . algorithm ) { var l = k . configNoverlap ( { nodeMargin : . 1 , scaleNodes : 1 . 05 , gridSize : 75 , easing : " quadraticInOut " , duration : 1500 } ) ; l . bind ( " start stop interpolate " , function ( a ) { " start " = = = a . type , " interpolate " = = = a . type } ) } else if ( " fruchtermann " = = = g . algorithm ) { var m = sigma . layouts . fruchtermanReingold . configure ( k , { iterations : 100 , easing : " quadraticInOut " , duration : 1500 } ) ; m . bind ( " start stop interpolate " , function ( a ) { } ) } if ( ! g . aqlMode ) { var n = function ( a , b ) { if ( $ ( " . nodeInfoDiv " ) . remove ( ) , g . contextState . createEdge = = = ! 1 & & window . location . hash . indexOf ( " graph " ) > - 1 ) { var c = function ( a , b , c ) { if ( a ) g . currentGraph . graph . dropNode ( c ) , g . currentGraph . refresh ( ) ; else { var d = " " ; d + = ' < span class = " title " > ID < / span > < span class = " nodeId " > ' + b . _id + " < / span > " , Object . keys ( b ) . length > 3 & & ( d + = ' < span class = " title " > ATTRIBUTES < / span > ' ) , _ . each ( b , function ( a , b ) { " _key " ! = = b & & " _id " ! = = b & & " _rev " ! = = b & & " _from " ! = = b & & " _to " ! = = b & & ( d + = ' < span class = " nodeAttribute " > ' + b + " < / span > " ) } ) ; var e = ' < div id = " nodeInfoDiv " class = " nodeInfoDiv " style = " display : none ; " > ' + d + " < / div > " ; $ ( " # graph - container " ) . append ( e ) , g . isFullscreen & & ( $ ( " . nodeInfoDiv " ) . css ( " top " , " 10px " ) , $ ( " . nodeInfoDiv " ) . css ( " left " , " 10px " ) ) , $ ( " # nodeInfoDiv " ) . fadeIn ( " slow " ) } } ; b ? g . documentStore . getDocument ( a . data . node . id . split ( " / " ) [ 0 ] , a . data . node . id . split ( " / " ) [ 1 ] , c ) : g . documentStore . getDocument ( a . data . edge . id . split ( " / " ) [ 0 ] , a . data . edge . id . split ( " / " ) [ 1 ] , c ) } } ; k . bind ( " clickNode " , function ( a ) { if ( g . contextState . createEdge = = = ! 0 ) { g . clearMouseCanvas ( ) , g . removeHelp ( ) , g . contextState . _to = a . data . node . id ; var b = g . contextState . _from . split ( " / " ) [ 0 ] , c = g . contextState . _to . split ( " / " ) [ 0 ] , d = g . getEdgeDefinitionCollections ( b , c ) ; 0 = = = d . length ? arangoHelper . arangoNotification ( " Graph " , " No valid edge definition found . " ) : ( g . addEdgeModal ( d , g . contextState . _from , g . contextState . _to ) , g . clearOldContextMenu ( ! 1 ) ) } else g . dragging | | ( g . contextState . createEdge = = = ! 0 ? g . newEdgeColor = " # ff0000 " : g . newEdgeColor = " # 000000 " , " canvas " = = = g . renderer & & g . currentGraph . renderers [ 0 ] . halo ( { nodes : g . currentGraph . graph . nodes ( ) , nodeHaloColor : " # DF0101 " , nodeHaloSize : 100 } ) , n ( a , ! 0 ) , g . activeNodes = [ a . data . node ] , " canvas " = = = g . renderer & & k . renderers [ 0 ] . halo ( { nodes : [ a . data . node ] } ) , g . createNodeContextMenu ( a . data . node . id , a ) ) } ) , g . noDefinedGraph ? k . bind ( " clickStage " , function ( a ) { g . clearOldContextMenu ( ! 0 ) , g . clearMouseCanvas ( ) , g . removeHelp ( ) } ) : k . bind ( " clickStage " , function ( a ) { a . data . captor . isDragging ? ( g . clearOldContextMenu ( ! 0 ) , g . clearMouseCanvas ( ) ) : g . contextState . createEdge = = = ! 0 ? ( g . clearOldContextMenu ( ! 0 ) , g . clearMouseCanvas ( ) , g . removeHelp ( ) ) : ( $ ( " # nodeContextMenu " ) . is ( " : visible " ) ? ( g . clearOldContextMenu ( ! 0 ) , g . clearMouseCanvas ( ) ) : ( g . addNodeX = a . data . captor . x , g . addNodeY = a . data . captor . y , g . createContextMenu ( a ) , g . clearMouseCanvas ( ) ) , k . renderers [ 0 ] . halo ( { nodes : g . activeNodes } ) ) } ) } if ( " canvas " = = = g . renderer ) { this . graphConfig & & " curve " = = = this . graphConfig . edgeType & & sigma . canvas . edges . autoCurve ( k ) , k . bind ( " clickEdge " , function ( a ) { n ( a , ! 1 ) } ) , k . renderers [ 0 ] . bind ( " render " , function ( a ) { k . renderers [ 0 ] . halo ( { nodes : g . activeNodes } ) } ) ; var o = function ( ) { g . nodeHighlighted = ! 1 , g . activeNodes = [ ] , k . graph . nodes ( ) . forEach ( function ( a ) { a . color = a . originalColor } ) , k . graph . edges ( ) . forEach ( function ( a ) { a . color = a . originalColor } ) , $ ( " . nodeInfoDiv " ) . remove ( ) , k . refresh ( { skipIndexation : ! 0 } ) } ; k . bind ( " rightClickStage " , function ( a ) { g . nodeHighlighted = " undefinedid " , o ( ) } ) , k . bind ( " rightClickNode " , function ( a ) { if ( g . nodeHighlighted ! = = a . data . node . id ) { var b = a . data . node . id , c = k . graph . neighbors ( b ) ; c [ b ] = a . data . node , k . graph . nodes ( ) . forEach ( function ( a ) { c [ a . id ] ? a . color = a . originalColor : a . color = " # eee " } ) , k . graph . edges ( ) . forEach ( function ( a ) { c [ a . source ] & & c [ a . target ] ? a . color = " rgb ( 64 , 74 , 83 ) " : a . color = " # eee " } ) , g . nodeHighlighted = ! 0 , k . refresh ( { skipIndexation : ! 0 } ) } else o ( ) } ) , this . graphConfig & & this . graphConfig . edgeEditable & & k . bind ( " clickEdge " , function ( a ) { var b = a . data . edge . id ; g . createEdgeContextMenu ( b , a ) } ) } if ( " noverlap " = = = g . algorithm ) k . startNoverlap ( ) ; else if ( " force " = = = g . algorithm ) { var p = " color : rgb ( 64 , 74 , 83 ) ; cursor : pointer ; position : absolute ; right : 30px ; bottom : 40px ; z - index : 9999 ; " ; g . aqlMode & & ( p = " color : rgb ( 64 , 74 , 83 ) ; cursor : pointer ; position : absolute ; right : 30px ; margin - top : 10px ; margin - right : - 15px " ) , $ ( " # graph - container " ) . after ( ' < div id = " toggleForce " style = " ' + p + ' " > < i style = " margin - right : 5px ; " class = " fa fa - pause " > < / i > < span > Stop layout < / span > < / div > ' ) , g . startLayout ( ) ; var q = 250 , r = 500 ; a . nodes & & ( q = a . nodes . length , c ? q < 250 ? q = 250 : q + = r : ( q < = 250 & & ( q = 500 ) , q + = r ) ) , a . empty & & arangoHelper . arangoNotification ( " Graph " , " Your graph is empty . Click inside the white window to create your first node . " ) , window . setTimeout ( function ( ) { g . stopLayout ( ) } , q ) } else " fruchtermann " = = = g . algorithm & & sigma . layouts . fruchtermanReingold . start ( k ) ; " force " ! = = g . algorithm & & g . reInitDragListener ( ) ; var s = document . getElementsByClassName ( " sigma - mouse " ) [ 0 ] ; s . addEventListener ( " mousemove " , g . trackCursorPosition . bind ( this ) , ! 1 ) , <nl> b & & ( $ ( " # " + b ) . focus ( ) , $ ( " # graphSettingsContent " ) . animate ( { scrollTop : $ ( " # " + b ) . offset ( ) . top } , 2e3 ) ) , $ ( " # calculatingGraph " ) . fadeOut ( " slow " ) , c | | g . graphConfig & & " false " = = = g . graphConfig . nodeSizeByEdges , g . calcFinished = new Date , a . empty = = = ! 0 & & $ ( " . sigma - background " ) . before ( ' < span id = " emptyGraph " style = " position : absolute ; margin - left : 10px ; margin - top : 10px ; " > The graph is empty . Please right - click to add a node . < span > ' ) , g . graphNotInitialized = = = ! 0 & & ( g . updateColors ( g . tmpGraphArray ) , g . graphNotInitialized = ! 1 , g . tmpGraphArray = [ ] ) , " force " = = = g . algorithm ? $ ( " # toggleForce " ) . fadeIn ( " fast " ) : $ ( " # toggleForce " ) . fadeOut ( " fast " ) } , reInitDragListener : function ( ) { var a = this ; void 0 ! = = this . dragListener & & ( sigma . plugins . killDragNodes ( this . currentGraph ) , this . dragListener = { } ) , this . dragListener = sigma . plugins . dragNodes ( this . currentGraph , this . currentGraph . renderers [ 0 ] ) , this . dragListener . bind ( " drag " , function ( b ) { a . dragging = ! 0 } ) , this . dragListener . bind ( " drop " , function ( b ) { window . setTimeout ( function ( ) { a . dragging = ! 1 } , 400 ) } ) } , keyUpFunction : function ( a ) { var b = this ; switch ( a . keyCode ) { case 76 : a . altKey & & b . toggleLasso ( ) } } , toggleLayout : function ( ) { this . layouting ? this . stopLayout ( ) : this . startLayout ( ) } , startLayout : function ( a , b ) { var c = this ; this . currentGraph . settings ( " drawLabels " , ! 1 ) , this . currentGraph . settings ( " drawEdgeLabels " , ! 1 ) , sigma . plugins . killDragNodes ( this . currentGraph ) , a = = = ! 0 & & ( this . currentGraph . killForceAtlas2 ( ) , window . setTimeout ( function ( ) { c . stopLayout ( ) , b & & c . currentGraph . refresh ( { skipIndexation : ! 0 } ) } , 500 ) ) , $ ( " # toggleForce . fa " ) . removeClass ( " fa - play " ) . addClass ( " fa - pause " ) , $ ( " # toggleForce span " ) . html ( " Stop layout " ) , this . layouting = ! 0 , this . aqlMode ? this . currentGraph . startForceAtlas2 ( { worker : ! 0 } ) : this . currentGraph . startForceAtlas2 ( { worker : ! 0 } ) } , stopLayout : function ( ) { $ ( " # toggleForce . fa " ) . removeClass ( " fa - pause " ) . addClass ( " fa - play " ) , $ ( " # toggleForce span " ) . html ( " Resume layout " ) , this . layouting = ! 1 , this . currentGraph . stopForceAtlas2 ( ) , this . currentGraph . settings ( " drawLabels " , ! 0 ) , this . currentGraph . settings ( " drawEdgeLabels " , ! 0 ) , this . currentGraph . refresh ( { skipIndexation : ! 0 } ) , this . reInitDragListener ( ) } } ) } ( ) , function ( ) { " use strict " ; window . HelpUsView = Backbone . View . extend ( { el : " # content " , template : templateEngine . createTemplate ( " helpUsView . ejs " ) , render : function ( ) { this . $ el . html ( this . template . render ( { } ) ) } } ) } ( ) , function ( ) { " use strict " ; window . IndicesView = Backbone . View . extend ( { el : " # content " , initialize : function ( a ) { this . collectionName = a . collectionName , this . model = this . collection } , template : templateEngine . createTemplate ( " indicesView . ejs " ) , events : { } , render : function ( ) { $ ( this . el ) . html ( this . template . render ( { model : this . model } ) ) , this . breadcrumb ( ) , window . arangoHelper . buildCollectionSubNav ( this . collectionName , " Indexes " ) , this . getIndex ( ) } , breadcrumb : function ( ) { $ ( " # subNavigationBar . breadcrumb " ) . html ( " Collection : " + this . collectionName ) } , getIndex : function ( ) { var a = function ( a , b , c ) { a ? window . arangoHelper . arangoError ( " Index " , b . errorMessage ) : this . renderIndex ( b , c ) } . bind ( this ) ; this . model . getIndex ( a ) } , createIndex : function ( ) { var a , b , c , d = this , e = $ ( " # newIndexType " ) . val ( ) , f = { } ; switch ( e ) { case " Geo " : a = $ ( " # newGeoFields " ) . val ( ) ; var g = d . checkboxToValue ( " # newGeoJson " ) ; f = { type : " geo " , fields : d . stringToArray ( a ) , geoJson : g } ; break ; case " Persistent " : a = $ ( " # newPersistentFields " ) . val ( ) , b = d . checkboxToValue ( " # newPersistentUnique " ) , c = d . checkboxToValue ( " # newPersistentSparse " ) , f = { type : " persistent " , fields : d . stringToArray ( a ) , unique : b , sparse : c } ; break ; case " Hash " : a = $ ( " # newHashFields " ) . val ( ) , b = d . checkboxToValue ( " # newHashUnique " ) , c = d . checkboxToValue ( " # newHashSparse " ) , f = { type : " hash " , fields : d . stringToArray ( a ) , unique : b , sparse : c } ; break ; case " Fulltext " : a = $ ( " # newFulltextFields " ) . val ( ) ; var h = parseInt ( $ ( " # newFulltextMinLength " ) . val ( ) , 10 ) | | 0 ; f = { type : " fulltext " , fields : d . stringToArray ( a ) , minLength : h } ; break ; case " Skiplist " : a = $ ( " # newSkiplistFields " ) . val ( ) , b = d . checkboxToValue ( " # newSkiplistUnique " ) , c = d . checkboxToValue ( " # newSkiplistSparse " ) , f = { type : " skiplist " , fields : d . stringToArray ( a ) , unique : b , sparse : c } } var i = function ( a , b ) { if ( a ) if ( b ) { var c = JSON . parse ( b . responseText ) ; arangoHelper . arangoError ( " Document error " , c . errorMessage ) } else arangoHelper . arangoError ( " Document error " , " Could not create index . " ) ; d . toggleNewIndexView ( ) , d . render ( ) } ; this . model . createIndex ( f , i ) } , bindIndexEvents : function ( ) { this . unbindIndexEvents ( ) ; var a = this ; $ ( " # indexEditView # addIndex " ) . bind ( " click " , function ( ) { a . toggleNewIndexView ( ) , $ ( " # cancelIndex " ) . unbind ( " click " ) , $ ( " # cancelIndex " ) . bind ( " click " , function ( ) { a . toggleNewIndexView ( ) , a . render ( ) } ) , $ ( " # createIndex " ) . unbind ( " click " ) , $ ( " # createIndex " ) . bind ( " click " , function ( ) { a . createIndex ( ) } ) } ) , $ ( " # newIndexType " ) . bind ( " change " , function ( ) { a . selectIndexType ( ) } ) , $ ( " . deleteIndex " ) . bind ( " click " , function ( b ) { a . prepDeleteIndex ( b ) } ) , $ ( " # infoTab a " ) . bind ( " click " , function ( a ) { if ( $ ( " # indexDeleteModal " ) . remove ( ) , " Indexes " ! = = $ ( a . currentTarget ) . html ( ) | | $ ( a . currentTarget ) . parent ( ) . hasClass ( " active " ) | | ( $ ( " # newIndexView " ) . hide ( ) , $ ( " # indexEditView " ) . show ( ) , $ ( " # indexHeaderContent # modal - dialog . modal - footer . button - danger " ) . hide ( ) , $ ( " # indexHeaderContent # modal - dialog . modal - footer . button - success " ) . hide ( ) , $ ( " # indexHeaderContent # modal - dialog . modal - footer . button - notification " ) . hide ( ) ) , " General " = = = $ ( a . currentTarget ) . html ( ) & & ! $ ( a . currentTarget ) . parent ( ) . hasClass ( " active " ) ) { $ ( " # indexHeaderContent # modal - dialog . modal - footer . button - danger " ) . show ( ) , $ ( " # indexHeaderContent # modal - dialog . modal - footer . button - success " ) . show ( ) , $ ( " # indexHeaderContent # modal - dialog . modal - footer . button - notification " ) . show ( ) ; var b = $ ( " . index - button - bar2 " ) [ 0 ] ; $ ( " # cancelIndex " ) . is ( " : visible " ) & & ( $ ( " # cancelIndex " ) . detach ( ) . appendTo ( b ) , $ ( " # createIndex " ) . detach ( ) . appendTo ( b ) ) } } ) } , prepDeleteIndex : function ( a ) { var b = this ; this . lastTarget = a , this . lastId = $ ( this . lastTarget . currentTarget ) . parent ( ) . parent ( ) . first ( ) . children ( ) . first ( ) . text ( ) , $ ( " # content # modal - dialog . modal - footer " ) . after ( ' < div id = " indexDeleteModal " style = " display : block ; " class = " alert alert - error modal - delete - confirmation " > < strong > Really delete ? < / strong > < button id = " indexConfirmDelete " class = " button - danger pull - right modal - confirm - delete " > Yes < / button > < button id = " indexAbortDelete " class = " button - neutral pull - right " > No < / button > < / div > ' ) , $ ( " # indexHeaderContent # indexConfirmDelete " ) . unbind ( " click " ) , $ ( " # indexHeaderContent # indexConfirmDelete " ) . bind ( " click " , function ( ) { $ ( " # indexHeaderContent # indexDeleteModal " ) . remove ( ) , b . deleteIndex ( ) } ) , $ ( " # indexHeaderContent # indexAbortDelete " ) . unbind ( " click " ) , $ ( " # indexHeaderContent # indexAbortDelete " ) . bind ( " click " , function ( ) { $ ( " # indexHeaderContent # indexDeleteModal " ) . remove ( ) } ) } , unbindIndexEvents : function ( ) { $ ( " # indexHeaderContent # indexEditView # addIndex " ) . unbind ( " click " ) , $ ( " # indexHeaderContent # newIndexType " ) . unbind ( " change " ) , $ ( " # indexHeaderContent # infoTab a " ) . unbind ( " click " ) , $ ( " # indexHeaderContent . deleteIndex " ) . unbind ( " click " ) } , deleteIndex : function ( ) { var a = function ( a ) { a ? ( arangoHelper . arangoError ( " Could not delete index " ) , $ ( " tr th : contains ( ' " + this . lastId + " ' ) " ) . parent ( ) . children ( ) . last ( ) . html ( ' < span class = " deleteIndex icon_arangodb_roundminus " data - original - title = " Delete index " title = " Delete index " > < / span > ' ) , this . model . set ( " locked " , ! 1 ) ) : a | | void 0 = = = a | | ( $ ( " tr th : contains ( ' " + this . lastId + " ' ) " ) . parent ( ) . remove ( ) , this . model . set ( " locked " , ! 1 ) ) } . bind ( this ) ; this . model . set ( " locked " , ! 0 ) , this . model . deleteIndex ( this . lastId , a ) , $ ( " tr th : contains ( ' " + this . lastId + " ' ) " ) . parent ( ) . children ( ) . last ( ) . html ( ' < i class = " fa fa - circle - o - notch fa - spin " > < / i > ' ) } , renderIndex : function ( a , b ) { this . index = a ; var c = function ( a , c ) { if ( a ) arangoHelper . arangoError ( " Jobs " , " Could not read pending jobs . " ) ; else { var d = function ( a , b , c ) { a ? 404 = = = b . responseJSON . code ? arangoHelper . deleteAardvarkJob ( c ) : 400 = = = b . responseJSON . code ? ( arangoHelper . arangoError ( " Index creation failed " , b . responseJSON . errorMessage ) , arangoHelper . deleteAardvarkJob ( c ) ) : 204 = = = b . responseJSON . code & & arangoHelper . arangoMessage ( " Index " , " There is at least one new index in the queue or in the process of being created . " ) : arangoHelper . deleteAardvarkJob ( c ) } ; _ . each ( c , function ( a ) { a . collection = = = b & & $ . ajax ( { type : " PUT " , cache : ! 1 , url : arangoHelper . databaseUrl ( " / _api / job / " + a . id ) , contentType : " application / json " , success : function ( b , c , e ) { d ( ! 1 , b , a . id ) } , error : function ( b ) { d ( ! 0 , b , a . id ) } } ) } ) } } ; arangoHelper . getAardvarkJobs ( c ) ; var d = " collectionInfoTh modal - text " ; if ( this . index ) { var e = " " , f = " " ; _ . each ( this . index . indexes , function ( a ) { f = " primary " = = = a . type | | " edge " = = = a . type ? ' < span class = " icon_arangodb_locked " data - original - title = " No action " > < / span > ' : ' < span class = " deleteIndex icon_arangodb_roundminus " data - original - title = " Delete index " title = " Delete index " > < / span > ' , void 0 ! = = a . fields & & ( e = a . fields . join ( " , " ) ) ; var b = a . id . indexOf ( " / " ) , c = a . id . substr ( b + 1 , a . id . length ) , g = a . hasOwnProperty ( " selectivityEstimate " ) ? ( 100 * a . selectivityEstimate ) . toFixed ( 2 ) + " % " : " n / a " , h = a . hasOwnProperty ( " sparse " ) ? a . sparse : " n / a " ; $ ( " # collectionEditIndexTable " ) . append ( " < tr > < th class = " + JSON . stringify ( d ) + " > " + c + " < / th > < th class = " + JSON . stringify ( d ) + " > " + a . type + " < / th > < th class = " + JSON . stringify ( d ) + " > " + a . unique + " < / th > < th class = " + JSON . stringify ( d ) + " > " + h + " < / th > < th class = " + JSON . stringify ( d ) + " > " + g + " < / th > < th class = " + JSON . stringify ( d ) + " > " + e + " < / th > < th class = " + JSON . stringify ( d ) + " > " + f + " < / th > < / tr > " ) } ) } this . bindIndexEvents ( ) } , selectIndexType : function ( ) { $ ( " . newIndexClass " ) . hide ( ) ; var a = $ ( " # newIndexType " ) . val ( ) ; $ ( " # newIndexType " + a ) . show ( ) } , resetIndexForms : function ( ) { $ ( " # indexHeader input " ) . val ( " " ) . prop ( " checked " , ! 1 ) , $ ( " # newIndexType " ) . val ( " Geo " ) . prop ( " selected " , ! 0 ) , this . selectIndexType ( ) } , toggleNewIndexView : function ( ) { var a = $ ( " . index - button - bar2 " ) [ 0 ] ; $ ( " # indexEditView " ) . is ( " : visible " ) ? ( $ ( " # indexEditView " ) . hide ( ) , $ ( " # newIndexView " ) . show ( ) , $ ( " # cancelIndex " ) . detach ( ) . appendTo ( " # indexHeaderContent # modal - dialog . modal - footer " ) , $ ( " # createIndex " ) . detach ( ) . appendTo ( " # indexHeaderContent # modal - dialog . modal - footer " ) ) : ( $ ( " # indexEditView " ) . show ( ) , $ ( " # newIndexView " ) . hide ( ) , $ ( " # cancelIndex " ) . detach ( ) . appendTo ( a ) , $ ( " # createIndex " ) . detach ( ) . appendTo ( a ) ) , arangoHelper . fixTooltips ( " . icon_arangodb , . arangoicon " , " right " ) , this . resetIndexForms ( ) } , stringToArray : function ( a ) { var b = [ ] ; return a . split ( " , " ) . forEach ( function ( a ) { a = a . replace ( / ( ^ \ s + | \ s + $ ) / g , " " ) , " " ! = = a & & b . push ( a ) } ) , b } , checkboxToValue : function ( a ) { return $ ( a ) . prop ( " checked " ) } } ) } ( ) , function ( ) { " use strict " ; window . InfoView = Backbone . View . extend ( { el : " # content " , initialize : function ( a ) { this . collectionName = a . collectionName , this . model = this . collection } , events : { } , render : function ( ) { this . breadcrumb ( ) , window . arangoHelper . buildCollectionSubNav ( this . collectionName , " Info " ) , this . renderInfoView ( ) } , breadcrumb : function ( ) { $ ( " # subNavigationBar . breadcrumb " ) . html ( " Collection : " + this . collectionName ) } , renderInfoView : function ( ) { if ( this . model . get ( " locked " ) ) return 0 ; var a = function ( a , b , c ) { if ( a ) arangoHelper . arangoError ( " Figures " , " Could not get revision . " ) ; else { var d = [ ] , e = { figures : c , revision : b , model : this . model } ; window . modalView . show ( " modalCollectionInfo . ejs " , " Collection : " + this . model . get ( " name " ) , d , e , null , null , null , null , null , " content " ) } } . bind ( this ) , b = function ( b , c ) { if ( b ) arangoHelper . arangoError ( " Figures " , " Could not get figures . " ) ; else { var d = c ; this . model . getRevision ( a , d ) } } . bind ( this ) ; this . model . getFigures ( b ) } } ) } ( ) , function ( ) { " use strict " ; window . LoginView = Backbone . View . extend ( { el : " # content " , el2 : " . header " , el3 : " . footer " , loggedIn : ! 1 , loginCounter : 0 , events : { " keyPress # loginForm input " : " keyPress " , " click # submitLogin " : " validate " , " submit # dbForm " : " goTo " , " click # logout " : " logout " , " change # loginDatabase " : " renderDBS " } , template : templateEngine . createTemplate ( " loginView . ejs " ) , render : function ( a ) { var b = this ; $ ( this . el ) . html ( this . template . render ( { } ) ) , $ ( this . el2 ) . hide ( ) , $ ( this . el3 ) . hide ( ) ; var c = function ( a , c ) { var d ; d = a ? arangoHelper . databaseUrl ( " / _api / user / " + encodeURIComponent ( a ) + " / database " , " _system " ) : arangoHelper . databaseUrl ( " / _api / database / user " ) , frontendConfig . authenticationEnabled = = = ! 1 & & ( $ ( " # logout " ) . hide ( ) , $ ( " . login - window # databases " ) . css ( " height " , " 90px " ) ) , $ ( " # loginForm " ) . hide ( ) , $ ( " . login - window # databases " ) . show ( ) , $ . ajax ( d ) . success ( function ( a ) { $ ( " # loginDatabase " ) . html ( " " ) , _ . each ( a . result , function ( a , b ) { c ? $ ( " # loginDatabase " ) . append ( " < option > " + b + " < / option > " ) : $ ( " # loginDatabase " ) . append ( " < option > " + a + " < / option > " ) } ) , b . renderDBS ( ) } ) . error ( function ( ) { c ? c ( ) : console . log ( " could not fetch user db data " ) } ) } ; if ( frontendConfig . authenticationEnabled & & a ! = = ! 0 ) { var d = arangoHelper . getCurrentJwtUsername ( ) ; if ( null ! = = d & & " undefined " ! = = d & & void 0 ! = = d ) { var e = function ( ) { b . collection . logout ( ) , window . setTimeout ( function ( ) { $ ( " # loginUsername " ) . focus ( ) } , 300 ) } ; c ( arangoHelper . getCurrentJwtUsername ( ) , e ) } else window . setTimeout ( function ( ) { $ ( " # loginUsername " ) . focus ( ) } , 300 ) } else c ( ) ; return $ ( " . bodyWrapper " ) . show ( ) , b . checkVersion ( ) , this } , checkVersion : function ( ) { var a = this ; window . setTimeout ( function ( ) { var b , c = document . getElementById ( " loginSVG " ) , d = c . contentDocument ; void 0 ! = = frontendConfig . isEnterprise ? ( b = frontendConfig . isEnterprise ? d . getElementById ( " logo - enterprise " ) : d . getElementById ( " logo - community " ) , b . setAttribute ( " visibility " , " visible " ) ) : a . checkVersion ( ) } , 150 ) } , clear : function ( ) { $ ( " # loginForm input " ) . removeClass ( " form - error " ) , $ ( " . wrong - credentials " ) . hide ( ) } , keyPress : function ( a ) { a . ctrlKey & & 13 = = = a . keyCode ? ( a . preventDefault ( ) , this . validate ( ) ) : a . metaKey & & 13 = = = a . keyCode & & ( a . preventDefault ( ) , this . validate ( ) ) } , validate : function ( a ) { a . preventDefault ( ) , this . clear ( ) ; var b = $ ( " # loginUsername " ) . val ( ) , c = $ ( " # loginPassword " ) . val ( ) ; b & & this . collection . login ( b , c , this . loginCallback . bind ( this , b , c ) ) } , loginCallback : function ( a , b , c ) { var d = this ; if ( c ) { if ( 0 = = = d . loginCounter ) return d . loginCounter + + , void d . collection . login ( a , b , this . loginCallback . bind ( this , a ) ) ; d . loginCounter = 0 , $ ( " . wrong - credentials " ) . show ( ) , $ ( " # loginDatabase " ) . html ( " " ) , $ ( " # loginDatabase " ) . append ( " < option > _system < / option > " ) } else d . renderDBSelection ( a ) } , renderDBSelection : function ( a ) { var b = this , c = arangoHelper . databaseUrl ( " / _api / user / " + encodeURIComponent ( a ) + " / database " , " _system " ) ; frontendConfig . authenticationEnabled = = = ! 1 & & ( c = arangoHelper . databaseUrl ( " / _api / database / user " ) ) , $ ( " . wrong - credentials " ) . hide ( ) , b . loggedIn = ! 0 , $ . ajax ( c ) . success ( function ( a ) { _ . each ( a . result , function ( b , c ) { " rw " ! = = b & & delete a . result [ c ] } ) , $ ( " # loginForm " ) . hide ( ) , $ ( " . login - window # databases " ) . show ( ) , $ ( " # loginDatabase " ) . html ( " " ) , _ . each ( a . result , function ( a , b ) { $ ( " # loginDatabase " ) . append ( " < option > " + b + " < / option > " ) } ) , b . renderDBS ( ) } ) . error ( function ( ) { $ ( " . wrong - credentials " ) . show ( ) } ) } , renderDBS : function ( ) { if ( 0 = = = $ ( " # loginDatabase " ) . children ( ) . length ) $ ( " # dbForm " ) . remove ( ) , $ ( " . login - window # databases " ) . prepend ( ' < div class = " no - database " > You do not have permission to a database . < / div > ' ) ; else { var a = $ ( " # loginDatabase " ) . val ( ) ; $ ( " # goToDatabase " ) . html ( " Select DB : " + a ) , window . setTimeout ( function ( ) { $ ( " # goToDatabase " ) . focus ( ) } , 300 ) } } , logout : function ( ) { this . collection . logout ( ) } , goTo : function ( a ) { a . preventDefault ( ) ; var b = $ ( " # loginUsername " ) . val ( ) , c = $ ( " # loginDatabase " ) . val ( ) ; window . App . dbSet = c ; var d = function ( a ) { a & & arangoHelper . arangoError ( " User " , " Could not fetch user settings " ) } , e = window . location . protocol + " / / " + window . location . host + frontendConfig . basePath + " / _db / " + c + " / _admin / aardvark / index . html " ; window . location . href = e , $ ( this . el2 ) . show ( ) , $ ( this . el3 ) . show ( ) , $ ( " . bodyWrapper " ) . show ( ) , $ ( " . navbar " ) . show ( ) , $ ( " # currentUser " ) . text ( b ) , this . collection . loadUserSettings ( d ) } } ) } ( ) , function ( ) { " use strict " ; window . LogsView = window . PaginationView . extend ( { el : " # content " , id : " # logContent " , paginationDiv : " # logPaginationDiv " , idPrefix : " logTable " , fetchedAmount : ! 1 , initialize : function ( a ) { this . options = a , this . convertModelToJSON ( ) } , currentLoglevel : " logall " , events : { " click # arangoLogTabbar button " : " setActiveLoglevel " , " click # logTable_first " : " firstPage " , " click # logTable_last " : " lastPage " } , template : templateEngine . createTemplate ( " logsView . ejs " ) , tabbar : templateEngine . createTemplate ( " arangoTabbar . ejs " ) , table : templateEngine . createTemplate ( " arangoTable . ejs " ) , tabbarElements : { id : " arangoLogTabbar " , titles : [ [ " All " , " logall " ] , [ " Info " , " loginfo " ] , [ " Error " , " logerror " ] , [ " Warning " , " logwarning " ] , [ " Debug " , " logdebug " ] ] } , tableDescription : { id : " arangoLogTable " , titles : [ " Loglevel " , " Date " , " Message " ] , rows : [ ] } , convertedRows : null , setActiveLoglevel : function ( a ) { $ ( " . arangodb - tabbar " ) . removeClass ( " arango - active - tab " ) , this . currentLoglevel ! = = a . currentTarget . id & & ( this . currentLoglevel = a . currentTarget . id , this . convertModelToJSON ( ) ) } , initTotalAmount : function ( ) { var a = this ; this . collection = this . options [ this . currentLoglevel ] , this . collection . fetch ( { data : $ . param ( { test : ! 0 } ) , success : function ( ) { a . convertModelToJSON ( ) } } ) , this . fetchedAmount = ! 0 } , invertArray : function ( a ) { var b , c = [ ] , d = 0 ; for ( b = a . length - 1 ; b > = 0 ; b - - ) c [ d ] = a [ b ] , d + + ; return c } , convertModelToJSON : function ( ) { if ( ! this . fetchedAmount ) return void this . initTotalAmount ( ) ; var a , b = this , c = [ ] ; this . collection = this . options [ this . currentLoglevel ] , this . collection . fetch ( { success : function ( ) { b . collection . each ( function ( b ) { a = new Date ( 1e3 * b . get ( " timestamp " ) ) , c . push ( [ b . getLogStatus ( ) , arangoHelper . formatDT ( a ) , b . get ( " text " ) ] ) } ) , b . tableDescription . rows = b . invertArray ( c ) , b . render ( ) } } ) } , render : function ( ) { return $ ( this . el ) . html ( this . template . render ( { } ) ) , $ ( this . id ) . html ( this . tabbar . render ( { content : this . tabbarElements } ) ) , $ ( this . id ) . append ( this . table . render ( { content : this . tableDescription } ) ) , $ ( " # " + this . currentLoglevel ) . addClass ( " arango - active - tab " ) , $ ( " # logContent " ) . append ( ' < div id = " logPaginationDiv " class = " pagination - line " > < / div > ' ) , this . renderPagination ( ) , this } , rerender : function ( ) { this . convertModelToJSON ( ) } } ) } ( ) , function ( ) { " use strict " ; var a = function ( a , b , c , d ) { return { type : a , title : b , callback : c , confirm : d } } , b = function ( a , b , c , d , e , f , g , h , i , j , k ) { var l = { type : a , label : b } ; return void 0 ! = = c & & ( l . value = c ) , void 0 ! = = d & & ( l . info = d ) , void 0 ! = = e & & ( l . placeholder = e ) , void 0 ! = = f & & ( l . mandatory = f ) , void 0 ! = = h & & ( l . addDelete = h ) , void 0 ! = = i & & ( l . addAdd = i ) , void 0 ! = = j & & ( l . maxEntrySize = j ) , void 0 ! = = k & & ( l . tags = k ) , g & & ( l . validateInput = function ( ) { return g } ) , l } ; window . ModalView = Backbone . View . extend ( { _validators : [ ] , _validateWatchers : [ ] , baseTemplate : templateEngine . createTemplate ( " modalBase . ejs " ) , tableTemplate : templateEngine . createTemplate ( " modalTable . ejs " ) , el : " # modalPlaceholder " , contentEl : " # modalContent " , hideFooter : ! 1 , confirm : { list : " # modal - delete - confirmation " , yes : " # modal - confirm - delete " , no : " # modal - abort - delete " } , enabledHotkey : ! 1 , enableHotKeys : ! 0 , buttons : { SUCCESS : " success " , NOTIFICATION : " notification " , DELETE : " danger " , NEUTRAL : " neutral " , CLOSE : " close " } , tables : { READONLY : " readonly " , TEXT : " text " , BLOB : " blob " , PASSWORD : " password " , SELECT : " select " , SELECT2 : " select2 " , CHECKBOX : " checkbox " } , initialize : function ( ) { Object . freeze ( this . buttons ) , Object . freeze ( this . tables ) } , createModalHotkeys : function ( ) { $ ( this . el ) . unbind ( " keydown " ) , $ ( this . el ) . unbind ( " return " ) , $ ( this . el ) . bind ( " keydown " , " return " , function ( ) { $ ( " . createModalDialog . modal - footer . button - success " ) . click ( ) } ) , $ ( " . modal - body input " ) . unbind ( " keydown " ) , $ ( " . modal - body input " ) . unbind ( " return " ) , $ ( " . modal - body input " , $ ( this . el ) ) . bind ( " keydown " , " return " , function ( ) { $ ( " . createModalDialog . modal - footer . button - success " ) . click ( ) } ) , $ ( " . modal - body select " ) . unbind ( " keydown " ) , $ ( " . modal - body select " ) . unbind ( " return " ) , $ ( " . modal - body select " , $ ( this . el ) ) . bind ( " keydown " , " return " , function ( ) { $ ( " . createModalDialog . modal - footer . button - success " ) . click ( ) } ) } , createInitModalHotkeys : function ( ) { var a = this ; $ ( this . el ) . bind ( " keydown " , " left " , function ( ) { a . navigateThroughButtons ( " left " ) } ) , $ ( this . el ) . bind ( " keydown " , " right " , function ( ) { a . navigateThroughButtons ( " right " ) } ) } , navigateThroughButtons : function ( a ) { var b = $ ( " . createModalDialog . modal - footer button " ) . is ( " : focus " ) ; b = = = ! 1 ? " left " = = = a ? $ ( " . createModalDialog . modal - footer button " ) . first ( ) . focus ( ) : " right " = = = a & & $ ( " . createModalDialog . modal - footer button " ) . last ( ) . focus ( ) : b = = = ! 0 & & ( " left " = = = a ? $ ( " : focus " ) . prev ( ) . focus ( ) : " right " = = = a & & $ ( " : focus " ) . next ( ) . focus ( ) ) } , createCloseButton : function ( b , c ) { var d = this ; return a ( this . buttons . CLOSE , b , function ( ) { d . hide ( ) , c & & c ( ) } ) } , createSuccessButton : function ( b , c ) { return a ( this . buttons . SUCCESS , b , c ) } , createNotificationButton : function ( b , c ) { return a ( this . buttons . NOTIFICATION , b , c ) } , createDeleteButton : function ( b , c , d ) { return a ( this . buttons . DELETE , b , c , d ) } , createNeutralButton : function ( b , c ) { return a ( this . buttons . NEUTRAL , b , c ) } , createDisabledButton : function ( b ) { var c = a ( this . buttons . NEUTRAL , b ) ; return c . disabled = ! 0 , c } , createReadOnlyEntry : function ( a , c , d , e , f , g ) { var h = b ( this . tables . READONLY , c , d , e , void 0 , void 0 , void 0 , f , g ) ; return h . id = a , h } , createTextEntry : function ( a , c , d , e , f , g , h ) { var i = b ( this . tables . TEXT , c , d , e , f , g , h ) ; return i . id = a , i } , createBlobEntry : function ( a , c , d , e , f , g , h ) { var i = b ( this . tables . BLOB , c , d , e , f , g , h ) ; return i . id = a , i } , createSelect2Entry : function ( a , c , d , e , f , g , h , i , j , k ) { var l = b ( this . tables . SELECT2 , c , d , e , f , g , void 0 , h , i , j , k ) ; return l . id = a , l } , createPasswordEntry : function ( a , c , d , e , f , g , h ) { var i = b ( this . tables . PASSWORD , c , d , e , f , g , h ) ; return i . id = a , i } , createCheckboxEntry : function ( a , c , d , e , f ) { var g = b ( this . tables . CHECKBOX , c , d , e ) ; return g . id = a , f & & ( g . checked = f ) , d & & ( g . checked = d ) , g } , createSelectEntry : function ( a , c , d , e , f ) { var g = b ( this . tables . SELECT , c , null , e ) ; return g . id = a , d & & ( g . selected = d ) , g . options = f , g } , createOptionEntry : function ( a , b ) { return { label : a , value : b | | a } } , show : function ( a , b , c , d , e , f , g , h , i , j ) { var k , l , m = this , n = ! 1 ; c = c | | [ ] , h = Boolean ( h ) , this . clearValidators ( ) , c . length > 0 ? ( c . forEach ( function ( a ) { a . type = = = m . buttons . CLOSE & & ( n = ! 0 ) , a . type = = = m . buttons . DELETE & & ( l = l | | a . confirm ) } ) , n | | ( k = c . pop ( ) , c . push ( m . createCloseButton ( " Cancel " ) ) , c . push ( k ) ) ) : c . push ( m . createCloseButton ( " Close " ) ) , j ? ( $ ( " # " + j ) . html ( this . baseTemplate . render ( { title : b , buttons : c , hideFooter : this . hideFooter , confirm : l , tabBar : i } ) ) , $ ( " # " + j + " # modal - dialog " ) . removeClass ( " fade hide modal " ) , $ ( " # " + j + " . modal - header " ) . remove ( ) , $ ( " # " + j + " . modal - tabbar " ) . remove ( ) , $ ( " # " + j + " . modal - tabbar " ) . remove ( ) , $ ( " # " + j + " . button - close " ) . remove ( ) , 0 = = = $ ( " # " + j + " . modal - footer " ) . children ( ) . length & & $ ( " # " + j + " . modal - footer " ) . remove ( ) ) : $ ( this . el ) . html ( this . baseTemplate . render ( { title : b , buttons : c , hideFooter : this . hideFooter , confirm : l , tabBar : i } ) ) , _ . each ( c , function ( a , b ) { if ( ! a . disabled & & a . callback ) { if ( a . type = = = m . buttons . DELETE & & ! h ) { var c = " # modalButton " + b ; return j & & ( c = " # " + j + " # modalButton " + b ) , void $ ( c ) . bind ( " click " , function ( ) { j ? ( $ ( " # " + j + " " + m . confirm . yes ) . unbind ( " click " ) , $ ( " # " + j + " " + m . confirm . yes ) . bind ( " click " , a . callback ) , $ ( " # " + j + " " + m . confirm . list ) . css ( " display " , " block " ) ) : ( $ ( m . confirm . yes ) . unbind ( " click " ) , $ ( m . confirm . yes ) . bind ( " click " , a . callback ) , $ ( m . confirm . list ) . css ( " display " , " block " ) ) } ) } j ? $ ( " # " + j + " # modalButton " + b ) . bind ( " click " , a . callback ) : $ ( " # modalButton " + b ) . bind ( " click " , a . callback ) } } ) , j ? $ ( " # " + j + " " + this . confirm . no ) . bind ( " click " , function ( ) { $ ( " # " + j + " " + m . confirm . list ) . css ( " display " , " none " ) } ) : $ ( this . confirm . no ) . bind ( " click " , function ( ) { $ ( m . confirm . list ) . css ( " display " , " none " ) } ) ; var o ; if ( " string " = = typeof a ) o = templateEngine . createTemplate ( a ) , j ? $ ( " # " + j + " . createModalDialog . modal - body " ) . html ( o . render ( { content : d , advancedContent : e , info : f } ) ) : $ ( " # modalPlaceholder . createModalDialog . modal - body " ) . html ( o . render ( { content : d , advancedContent : e , info : f } ) ) ; else { var p = 0 ; _ . each ( a , function ( a ) { o = templateEngine . createTemplate ( a ) , $ ( " . createModalDialog . modal - body . tab - content # " + i [ p ] ) . html ( o . render ( { content : d , advancedContent : e , info : f } ) ) , p + + } ) } $ ( " . createModalDialog . modalTooltips " ) . tooltip ( { position : { my : " left top " , at : " right + 55 top - 1 " } } ) ; var q = d | | [ ] ; e & & e . content & & ( q = q . concat ( e . content ) ) , _ . each ( q , function ( a ) { m . modalBindValidation ( a ) , a . type = = = m . tables . SELECT2 & & $ ( " # " + a . id ) . select2 ( { tags : a . tags | | [ ] , showSearchBox : ! 1 , minimumResultsForSearch : - 1 , width : " 336px " , maximumSelectionSize : a . maxEntrySize | | 8 } ) } ) , g & & ( this . events = g , this . delegateEvents ( ) ) , $ ( " # accordion2 " ) & & ( $ ( " # accordion2 . accordion - toggle " ) . bind ( " click " , function ( ) { $ ( " # collapseOne " ) . is ( " : visible " ) ? ( $ ( " # collapseOne " ) . hide ( ) , setTimeout ( function ( ) { $ ( " . accordion - toggle " ) . addClass ( " collapsed " ) } , 100 ) ) : ( $ ( " # collapseOne " ) . show ( ) , setTimeout ( function ( ) { $ ( " . accordion - toggle " ) . removeClass ( " collapsed " ) } , 100 ) ) } ) , $ ( " # collapseOne " ) . hide ( ) , setTimeout ( function ( ) { $ ( " . accordion - toggle " ) . addClass ( " collapsed " ) } , 100 ) ) , j | | $ ( " # modal - dialog " ) . modal ( " show " ) , this . enabledHotkey = = = ! 1 & & ( this . createInitModalHotkeys ( ) , this . enabledHotkey = ! 0 ) , this . enableHotKeys & & this . createModalHotkeys ( ) ; var r ; r = j ? $ ( " # " + j + " # modal - dialog " ) . find ( " input " ) : $ ( " # modal - dialog " ) . find ( " input " ) , r & & setTimeout ( function ( ) { r = j ? $ ( " # " + j + " # modal - dialog " ) : $ ( " # modal - dialog " ) , r . length > 0 & & ( r = r . find ( " input " ) , r . length > 0 & & $ ( r [ 0 ] ) . focus ( ) ) } , 400 ) } , modalBindValidation : function ( a ) { var b = this ; if ( a . hasOwnProperty ( " id " ) & & a . hasOwnProperty ( " validateInput " ) ) { var c = function ( ) { var b = $ ( " # " + a . id ) , c = a . validateInput ( b ) , d = ! 1 ; if ( _ . each ( c , function ( a ) { var c = b . val ( ) ; if ( a . rule | | ( a = { rule : a } ) , " function " = = typeof a . rule ) try { a . rule ( c ) } catch ( e ) { d = a . msg | | e . message } else { var f = Joi . validate ( c , a . rule ) ; f . error & & ( d = a . msg | | f . error . message ) } if ( d ) return ! 1 } ) , d ) return d } , d = $ ( " # " + a . id ) ; d . on ( " keyup focusout " , function ( ) { var a = c ( ) , e = d . next ( ) [ 0 ] ; a ? ( d . addClass ( " invalid - input " ) , e ? $ ( e ) . text ( a ) : d . after ( ' < p class = " errorMessage " > ' + a + " < / p > " ) , $ ( " . createModalDialog . modal - footer . button - success " ) . prop ( " disabled " , ! 0 ) . addClass ( " disabled " ) ) : ( d . removeClass ( " invalid - input " ) , e & & $ ( e ) . remove ( ) , b . modalTestAll ( ) ) } ) , this . _validators . push ( c ) , this . _validateWatchers . push ( d ) } } , modalTestAll : function ( ) { var a = _ . map ( this . _validators , function ( a ) { return a ( ) } ) , b = _ . any ( a ) ; return b ? $ ( " . createModalDialog . modal - footer . button - success " ) . prop ( " disabled " , ! 0 ) . addClass ( " disabled " ) : $ ( " . createModalDialog . modal - footer . button - success " ) . prop ( " disabled " , ! 1 ) . removeClass ( " disabled " ) , ! b } , clearValidators : function ( ) { this . _validators = [ ] , _ . each ( this . _validateWatchers , function ( a ) { a . unbind ( " keyup focusout " ) } ) , this . _validateWatchers = [ ] } , hide : function ( ) { this . clearValidators ( ) , $ ( " # modal - dialog " ) . modal ( " hide " ) } } ) } ( ) , function ( ) { " use strict " ; window . NavigationView = Backbone . View . extend ( { el : " # navigationBar " , subEl : " # subNavigationBar " , events : { " change # arangoCollectionSelect " : " navigateBySelect " , " click . tab " : " navigateByTab " , " click li " : " switchTab " , " click . arangodbLogo " : " selectMenuItem " , " mouseenter . dropdown > * " : " showDropdown " , " click . shortcut - icons p " : " showShortcutModal " , " mouseleave . dropdown " : " hideDropdown " } , renderFirst : ! 0 , activeSubMenu : void 0 , changeDB : function ( ) { window . location . hash = " # login " } , initialize : function ( a ) { var b = this ; this . userCollection = a . userCollection , this . currentDB = a . currentDB , this . dbSelectionView = new window . DBSelectionView ( { collection : a . database , current : this . currentDB } ) , this . userBarView = new window . UserBarView ( { userCollection : this . userCollection } ) , this . notificationView = new window . NotificationView ( { collection : a . notificationCollection } ) , this . statisticBarView = new window . StatisticBarView ( { currentDB : this . currentDB } ) , this . isCluster = a . isCluster , this . handleKeyboardHotkeys ( ) , Backbone . history . on ( " all " , function ( ) { b . selectMenuItem ( ) } ) } , showShortcutModal : function ( ) { arangoHelper . hotkeysFunctions . showHotkeysModal ( ) } , handleSelectDatabase : function ( ) { this . dbSelectionView . render ( $ ( " # dbSelect " ) ) } , template : templateEngine . createTemplate ( " navigationView . ejs " ) , templateSub : templateEngine . createTemplate ( " subNavigationView . ejs " ) , render : function ( ) { var a = this ; $ ( this . el ) . html ( this . template . render ( { currentDB : this . currentDB , isCluster : this . isCluster } ) ) , " _system " ! = = this . currentDB . get ( " name " ) & & $ ( " # dashboard " ) . parent ( ) . remove ( ) , $ ( this . subEl ) . html ( this . templateSub . render ( { currentDB : this . currentDB . toJSON ( ) } ) ) , this . dbSelectionView . render ( $ ( " # dbSelect " ) ) ; var b = function ( a ) { a | | this . userBarView . render ( ) } . bind ( this ) ; return this . userCollection . whoAmI ( b ) , this . renderFirst & & ( this . renderFirst = ! 1 , this . selectMenuItem ( ) , $ ( " . arangodbLogo " ) . on ( " click " , function ( ) { a . selectMenuItem ( ) } ) , $ ( " # dbStatus " ) . on ( " click " , function ( ) { a . changeDB ( ) } ) ) , a . resize ( ) , window . frontendConfig . isEnterprise = = = ! 0 ? ( $ ( " # ArangoDBLogo " ) . after ( ' < span id = " enterpriseLabel " style = " display : none " > Enterprise Edition < / span > ' ) , $ ( " # enterpriseLabel " ) . fadeIn ( " slow " ) ) : ( $ ( " # ArangoDBLogo " ) . after ( ' < span id = " communityLabel " style = " display : none " > Community Edition < / span > ' ) , $ ( " # communityLabel " ) . fadeIn ( " slow " ) , $ ( " . enterprise - menu " ) . show ( ) ) , this } , resize : function ( ) { var a = $ ( window ) . height ( ) - $ ( " . subMenuEntries " ) . first ( ) . height ( ) ; $ ( " # navigationBar " ) . css ( " min - height " , a ) , $ ( " # navigationBar " ) . css ( " height " , a ) } , navigateBySelect : function ( ) { var a = $ ( " # arangoCollectionSelect " ) . find ( " option : selected " ) . val ( ) ; window . App . navigate ( a , { trigger : ! 0 } ) } , handleKeyboardHotkeys : function ( ) { arangoHelper . enableKeyboardHotkeys ( ! 0 ) } , navigateByTab : function ( a ) { var b = a . target | | a . srcElement , c = b . id , d = ! 1 ; " enterprise " ! = = c & & ( $ ( b ) . hasClass ( " fa " ) | | ( " " = = = c & & ( c = $ ( b ) . attr ( " class " ) ) , " links " = = = c ? ( d = ! 0 , $ ( " # link_dropdown " ) . slideToggle ( 1 ) , a . preventDefault ( ) ) : " tools " = = = c ? ( d = ! 0 , $ ( " # tools_dropdown " ) . slideToggle ( 1 ) , a . preventDefault ( ) ) : " dbselection " = = = c & & ( d = ! 0 , $ ( " # dbs_dropdown " ) . slideToggle ( 1 ) , a . preventDefault ( ) ) , d | | ( window . App . navigate ( c , { trigger : ! 0 } ) , a . preventDefault ( ) ) ) ) } , handleSelectNavigation : function ( ) { var a = this ; $ ( " # arangoCollectionSelect " ) . change ( function ( ) { a . navigateBySelect ( ) } ) } , subViewConfig : { documents : " collections " , collection : " collections " } , subMenuConfig : { cluster : [ { name : " Dashboard " , view : void 0 , active : ! 0 } , { name : " Logs " , view : void 0 , disabled : ! 0 } ] , collections : [ { name : " " , view : void 0 , active : ! 1 } ] , queries : [ { name : " Editor " , route : " query " , active : ! 0 } , { name : " Running Queries " , route : " queryManagement " , params : { active : ! 0 } , active : void 0 } , { name : " Slow Query History " , route : " queryManagement " , params : { active : ! 1 } , active : void 0 } ] } , renderSubMenu : function ( a ) { var b = this ; if ( void 0 = = = a & & ( a = window . isCluster ? " cluster " : " dashboard " ) , this . subMenuConfig [ a ] ) { $ ( this . subEl + " . bottom " ) . html ( " " ) ; var c = " " ; _ . each ( this . subMenuConfig [ a ] , function ( a ) { c = a . active ? " active " : " " , a . disabled & & ( c = " disabled " ) , $ ( b . subEl + " . bottom " ) . append ( ' < li class = " subMenuEntry ' + c + ' " > < a > ' + a . name + " < / a > < / li > " ) , a . disabled | | $ ( b . subEl + " . bottom " ) . children ( ) . last ( ) . bind ( " click " , function ( c ) { $ ( " # subNavigationBar . breadcrumb " ) . html ( " " ) , b . activeSubMenu = a , b . renderSubView ( a , c ) } ) } ) } } , renderSubView : function ( a , b ) { window . App [ a . route ] & & ( window . App [ a . route ] . resetState & & window . App [ a . route ] . resetState ( ) , window . App [ a . route ] ( ) ) , $ ( this . subEl + " . bottom " ) . children ( ) . removeClass ( " active " ) , $ ( b . currentTarget ) . addClass ( " active " ) } , switchTab : function ( a ) { var b = $ ( a . currentTarget ) . children ( ) . first ( ) . attr ( " id " ) ; return " enterprise " = = = b ? void window . open ( " https : / / www . arangodb . com / download - arangodb - enterprise / " , " _blank " ) : void ( b & & this . selectMenuItem ( b + " - menu " ) ) } , selectMenuItem : function ( a , b ) { void 0 = = = a & & ( a = window . location . hash . split ( " / " ) [ 0 ] , a = a . substr ( 1 , a . length - 1 ) ) , " " = = = a ? a = window . App . isCluster ? " cluster " : " dashboard " : " cNodes " ! = = a & & " dNodes " ! = = a | | ( a = " nodes " ) ; try { this . renderSubMenu ( a . split ( " - " ) [ 0 ] ) } catch ( c ) { this . renderSubMenu ( a ) } $ ( " . navlist li " ) . removeClass ( " active " ) , " string " = = typeof a & & ( b ? $ ( " . " + this . subViewConfig [ a ] + " - menu " ) . addClass ( " active " ) : a & & ( $ ( " . " + a ) . addClass ( " active " ) , $ ( " . " + a + " - menu " ) . addClass ( " active " ) ) ) , arangoHelper . hideArangoNotifications ( ) } , showSubDropdown : function ( a ) { $ ( a . currentTarget ) . find ( " . subBarDropdown " ) . toggle ( ) } , showDropdown : function ( a ) { var b = a . target | | a . srcElement , c = b . id ; " links " = = = c | | " link_dropdown " = = = c | | " links " = = = a . currentTarget . id ? $ ( " # link_dropdown " ) . fadeIn ( 1 ) : " tools " = = = c | | " tools_dropdown " = = = c | | " tools " = = = a . currentTarget . id ? $ ( " # tools_dropdown " ) . fadeIn ( 1 ) : " dbselection " ! = = c & & " dbs_dropdown " ! = = c & & " dbselection " ! = = a . currentTarget . id | | $ ( " # dbs_dropdown " ) . fadeIn ( 1 ) } , hideDropdown : function ( a ) { $ ( " # link_dropdown " ) . fadeOut ( 1 ) , $ ( " # tools_dropdown " ) . fadeOut ( 1 ) , $ ( " # dbs_dropdown " ) . fadeOut ( 1 ) } } ) } ( ) , function ( ) { " use strict " ; window . NodesView = Backbone . View . extend ( { el : " # content " , template : templateEngine . createTemplate ( " nodesView . ejs " ) , interval : 1e4 , knownServers : [ ] , events : { " click # nodesContent . coords - nodes . pure - table - row " : " navigateToNode " , " click # addCoord " : " addCoord " , " click # removeCoord " : " removeCoord " , " click # addDBs " : " addDBs " , " click # removeDBs " : " removeDBs " , " click . abortClusterPlan " : " abortClusterPlanModal " , " keyup # plannedCoords " : " checkKey " , " keyup # plannedDBs " : " checkKey " } , checkKey : function ( a ) { if ( 13 = = = a . keyCode ) { var b = this , c = function ( a ) { var c ; if ( " plannedCoords " = = = a . target . id ) try { c = JSON . parse ( $ ( " # plannedCoords " ) . val ( ) ) , " number " = = typeof c ? ( window . modalView . hide ( ) , b . setCoordSize ( c ) ) : arangoHelper . arangoError ( " Error " , " Invalid value . Must be a number . " ) } catch ( a ) { arangoHelper . arangoError ( " Error " , " Invalid value . Must be a number . " ) } else if ( " plannedDBs " = = = a . target . id ) try { c = JSON . parse ( $ ( " # plannedCoords " ) . val ( ) ) , " number " = = typeof c ? ( window . modalView . hide ( ) , b . setDBsSize ( c ) ) : arangoHelper . arangoError ( " Error " , " Invalid value . Must be a number . " ) } catch ( a ) { arangoHelper . arangoError ( " Error " , " Invalid value . Must be a number . " ) ; <nl> - } } ; this . changePlanModal ( c . bind ( null , a ) ) } } , changePlanModal : function ( a , b ) { var c = [ ] , d = [ ] ; d . push ( window . modalView . createReadOnlyEntry ( " plan - confirm - button " , " Caution " , " You are changing the cluster plan . Continue ? " , void 0 , void 0 , ! 1 , / [ < > & ' " ] / ) ) , c . push ( window . modalView . createSuccessButton ( " Yes " , a . bind ( this , b ) ) ) , window . modalView . show ( " modalTable . ejs " , " Modify Cluster Size " , c , d ) } , initialize : function ( ) { var a = this ; clearInterval ( this . intervalFunction ) , window . App . isCluster & & ( this . updateServerTime ( ) , this . intervalFunction = window . setInterval ( function ( ) { " # nodes " = = = window . location . hash & & a . render ( ! 1 ) } , this . interval ) ) } , navigateToNode : function ( a ) { if ( ! $ ( a . currentTarget ) . hasClass ( " noHover " ) ) { var b = $ ( a . currentTarget ) . attr ( " node " ) . slice ( 0 , - 5 ) ; window . App . navigate ( " # node / " + encodeURIComponent ( b ) , { trigger : ! 0 } ) } } , render : function ( a ) { if ( " # nodes " = = = window . location . hash ) { var b = this ; $ ( " # content " ) . is ( " : empty " ) & & arangoHelper . renderEmpty ( " Please wait . Requesting cluster information . . . " , " fa fa - spin fa - circle - o - notch " ) , a ! = = ! 1 & & arangoHelper . buildNodesSubNav ( " Overview " ) ; var c = function ( a ) { $ . ajax ( { type : " GET " , url : arangoHelper . databaseUrl ( " / _admin / cluster / numberOfServers " ) , contentType : " application / json " , success : function ( c ) { " # nodes " = = = window . location . hash & & b . continueRender ( a , c ) } } ) } ; $ . ajax ( { type : " GET " , cache : ! 1 , url : arangoHelper . databaseUrl ( " / _admin / cluster / health " ) , contentType : " application / json " , processData : ! 1 , async : ! 0 , success : function ( a ) { " # nodes " = = = window . location . hash & & c ( a . Health ) } , error : function ( ) { " # nodes " = = = window . location . hash & & arangoHelper . arangoError ( " Cluster " , " Could not fetch cluster information " ) } } ) } } , continueRender : function ( a , b ) { var c = { } , d = { } , e = ! 1 ; _ . each ( a , function ( a , b ) { " Coordinator " = = = a . Role ? c [ b ] = a : " DBServer " = = = a . Role & & ( d [ b ] = a ) } ) , null ! = = b . numberOfDBServers & & null ! = = b . numberOfCoordinators & & ( e = ! 0 ) ; var f = function ( a ) { this . $ el . html ( this . template . render ( { coords : c , dbs : d , scaling : e , scaleProperties : a , plannedDBs : b . numberOfDBServers , plannedCoords : b . numberOfCoordinators } ) ) , e | | ( $ ( " . title " ) . css ( " position " , " relative " ) , $ ( " . title " ) . css ( " top " , " - 4px " ) , $ ( " . sectionHeader . information " ) . css ( " margin - top " , " - 3px " ) ) } . bind ( this ) ; this . renderCounts ( e , f ) } , updatePlanned : function ( a ) { a . numberOfCoordinators & & ( $ ( " # plannedCoords " ) . val ( a . numberOfCoordinators ) , this . renderCounts ( ! 0 ) ) , a . numberOfDBServers & & ( $ ( " # plannedDBs " ) . val ( a . numberOfDBServers ) , this . renderCounts ( ! 0 ) ) } , setCoordSize : function ( a ) { var b = this , c = { numberOfCoordinators : a } ; $ . ajax ( { type : " PUT " , url : arangoHelper . databaseUrl ( " / _admin / cluster / numberOfServers " ) , contentType : " application / json " , data : JSON . stringify ( c ) , success : function ( ) { b . updatePlanned ( c ) } , error : function ( ) { arangoHelper . arangoError ( " Scale " , " Could not set coordinator size . " ) } } ) } , setDBsSize : function ( a ) { var b = this , c = { numberOfDBServers : a } ; $ . ajax ( { type : " PUT " , url : arangoHelper . databaseUrl ( " / _admin / cluster / numberOfServers " ) , contentType : " application / json " , data : JSON . stringify ( c ) , success : function ( ) { b . updatePlanned ( c ) } , error : function ( ) { arangoHelper . arangoError ( " Scale " , " Could not set coordinator size . " ) } } ) } , abortClusterPlanModal : function ( ) { var a = [ ] , b = [ ] ; b . push ( window . modalView . createReadOnlyEntry ( " plan - abort - button " , " Caution " , " You are aborting the planned cluster plan . All pending servers are going to be removed . Continue ? " , void 0 , void 0 , ! 1 , / [ < > & ' " ] / ) ) , a . push ( window . modalView . createSuccessButton ( " Yes " , this . abortClusterPlan . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Modify Cluster Size " , a , b ) } , abortClusterPlan : function ( ) { window . modalView . hide ( ) ; try { var a = JSON . parse ( $ ( " # infoCoords > . positive > span " ) . text ( ) ) , b = JSON . parse ( $ ( " # infoDBs > . positive > span " ) . text ( ) ) ; this . setCoordSize ( a ) , this . setDBsSize ( b ) } catch ( c ) { console . log ( c ) , arangoHelper . arangoError ( " Plan " , " Could not abort Cluster Plan " ) } } , renderCounts : function ( a , b ) { var c = this , d = function ( b , c , d , e ) { var f = ' < span class = " positive " > < span > ' + c + ' < / span > < i class = " fa fa - check - circle " > < / i > < / span > ' ; d & & a = = = ! 0 & & ( f = f + ' < span class = " warning " > < span > ' + d + ' < / span > < i class = " fa fa - circle - o - notch fa - spin " > < / i > < / span > < button class = " abortClusterPlan button - navbar button - default " > Abort < / button > ' ) , e & & ( f = f + ' < span class = " negative " > < span > ' + e + ' < / span > < i class = " fa fa - exclamation - circle " > < / i > < / span > ' ) , $ ( b ) . html ( f ) , a | | ( $ ( " . title " ) . css ( " position " , " relative " ) , $ ( " . title " ) . css ( " top " , " - 4px " ) ) } , e = function ( a ) { var e = 0 , f = 0 , g = 0 , h = 0 , i = 0 , j = 0 ; _ . each ( a , function ( a ) { " Coordinator " = = = a . Role ? " GOOD " = = = a . Status ? f + + : e + + : " DBServer " = = = a . Role & & ( " GOOD " = = = a . Status ? h + + : i + + ) } ) , $ . ajax ( { type : " GET " , cache : ! 1 , url : arangoHelper . databaseUrl ( " / _admin / cluster / numberOfServers " ) , contentType : " application / json " , processData : ! 1 , success : function ( a ) { g = Math . abs ( f + e - a . numberOfCoordinators ) , j = Math . abs ( h + i - a . numberOfDBServers ) , b ? b ( { coordsPending : g , coordsOk : f , coordsErrors : e , dbsPending : j , dbsOk : h , dbsErrors : i } ) : ( d ( " # infoDBs " , h , j , i ) , d ( " # infoCoords " , f , g , e ) ) , c . isPlanFinished ( ) | | ( $ ( " . scaleGroup " ) . addClass ( " no - hover " ) , $ ( " # plannedCoords " ) . attr ( " disabled " , " disabled " ) , $ ( " # plannedDBs " ) . attr ( " disabled " , " disabled " ) ) } } ) } ; $ . ajax ( { type : " GET " , cache : ! 1 , url : arangoHelper . databaseUrl ( " / _admin / cluster / health " ) , contentType : " application / json " , processData : ! 1 , success : function ( a ) { e ( a . Health ) } } ) } , isPlanFinished : function ( ) { var a ; return a = ! ( $ ( " # infoDBs " ) . find ( " . warning " ) . length > 0 ) & & ! ( $ ( " # infoCoords " ) . find ( " . warning " ) . length > 0 ) } , addCoord : function ( ) { var a = function ( ) { window . modalView . hide ( ) , this . setCoordSize ( this . readNumberFromID ( " # plannedCoords " , ! 0 ) ) } ; this . isPlanFinished ( ) ? this . changePlanModal ( a . bind ( this ) ) : ( arangoHelper . arangoNotification ( " Cluster Plan " , " Planned state not yet finished . " ) , $ ( " . noty_buttons . button - danger " ) . remove ( ) ) } , removeCoord : function ( ) { var a = function ( ) { window . modalView . hide ( ) , this . setCoordSize ( this . readNumberFromID ( " # plannedCoords " , ! 1 , ! 0 ) ) } ; this . isPlanFinished ( ) ? this . changePlanModal ( a . bind ( this ) ) : ( arangoHelper . arangoNotification ( " Cluster Plan " , " Planned state not yet finished . " ) , $ ( " . noty_buttons . button - danger " ) . remove ( ) ) } , addDBs : function ( ) { var a = function ( ) { window . modalView . hide ( ) , this . setDBsSize ( this . readNumberFromID ( " # plannedDBs " , ! 0 ) ) } ; this . isPlanFinished ( ) ? this . changePlanModal ( a . bind ( this ) ) : ( arangoHelper . arangoNotification ( " Cluster Plan " , " Planned state not yet finished . " ) , $ ( " . noty_buttons . button - danger " ) . remove ( ) ) } , removeDBs : function ( ) { var a = function ( ) { window . modalView . hide ( ) , this . setDBsSize ( this . readNumberFromID ( " # plannedDBs " , ! 1 , ! 0 ) ) } ; this . isPlanFinished ( ) ? this . changePlanModal ( a . bind ( this ) ) : ( arangoHelper . arangoNotification ( " Cluster Plan " , " Planned state not yet finished . " ) , $ ( " . noty_buttons . button - danger " ) . remove ( ) ) } , readNumberFromID : function ( a , b , c ) { var d = $ ( a ) . val ( ) , e = ! 1 ; try { e = JSON . parse ( d ) } catch ( f ) { } return b & & e + + , c & & 1 ! = = e & & e - - , e } , updateServerTime : function ( ) { this . serverTime = ( new Date ) . getTime ( ) } } ) } ( ) , function ( ) { " use strict " ; window . NodeView = Backbone . View . extend ( { el : " # content " , template : templateEngine . createTemplate ( " nodeView . ejs " ) , interval : 5e3 , dashboards : [ ] , events : { } , initialize : function ( a ) { window . App . isCluster & & ( this . coordinators = a . coordinators , this . dbServers = a . dbServers , this . coordname = a . coordname , this . updateServerTime ( ) ) } , breadcrumb : function ( a ) { $ ( " # subNavigationBar . breadcrumb " ) . html ( " Node : " + a ) } , render : function ( ) { this . $ el . html ( this . template . render ( { coords : [ ] } ) ) ; var a = function ( ) { this . continueRender ( ) , this . breadcrumb ( this . coordname ) , $ ( window ) . trigger ( " resize " ) } . bind ( this ) ; this . initCoordDone | | this . waitForCoordinators ( ) , this . initDBDone ? ( this . coordname = window . location . hash . split ( " / " ) [ 1 ] , this . coordinator = this . coordinators . findWhere ( { name : this . coordname } ) , a ( ) ) : this . waitForDBServers ( a ) } , continueRender : function ( ) { var a = this ; this . dashboards [ this . coordinator . get ( " name " ) ] = new window . DashboardView ( { dygraphConfig : window . dygraphConfig , database : window . App . arangoDatabase , serverToShow : { raw : this . coordinator . get ( " address " ) , isDBServer : ! 1 , endpoint : this . coordinator . get ( " protocol " ) + " : / / " + this . coordinator . get ( " address " ) , target : this . coordinator . get ( " name " ) } } ) , this . dashboards [ this . coordinator . get ( " name " ) ] . render ( ) , window . setTimeout ( function ( ) { a . dashboards [ a . coordinator . get ( " name " ) ] . resize ( ) } , 500 ) } , waitForCoordinators : function ( a ) { var b = this ; window . setTimeout ( function ( ) { 0 = = = b . coordinators . length ? b . waitForCoordinators ( a ) : ( b . coordinator = b . coordinators . findWhere ( { name : b . coordname } ) , b . initCoordDone = ! 0 , a & & a ( ) ) } , 200 ) } , waitForDBServers : function ( a ) { var b = this ; window . setTimeout ( function ( ) { 0 = = = b . dbServers [ 0 ] . length ? b . waitForDBServers ( a ) : ( b . initDBDone = ! 0 , b . dbServer = b . dbServers [ 0 ] , b . dbServer . each ( function ( a ) { " DBServer001 " = = = a . get ( " name " ) & & ( b . dbServer = a ) } ) , a ( ) ) } , 200 ) } , updateServerTime : function ( ) { this . serverTime = ( new Date ) . getTime ( ) } } ) } ( ) , function ( ) { " use strict " ; window . NotificationView = Backbone . View . extend ( { events : { " click . navlogo # stat_hd " : " toggleNotification " , " click . notificationItem . fa " : " removeNotification " , " click # removeAllNotifications " : " removeAllNotifications " } , initialize : function ( ) { this . collection . bind ( " add " , this . renderNotifications . bind ( this ) ) , this . collection . bind ( " remove " , this . renderNotifications . bind ( this ) ) , this . collection . bind ( " reset " , this . renderNotifications . bind ( this ) ) , window . setTimeout ( function ( ) { frontendConfig . authenticationEnabled = = = ! 1 & & frontendConfig . isCluster = = = ! 1 & & arangoHelper . showAuthDialog ( ) = = = ! 0 & & window . arangoHelper . arangoWarning ( " Warning " , " Authentication is disabled . Do not use this setup in production mode . " ) } , 2e3 ) } , notificationItem : templateEngine . createTemplate ( " notificationItem . ejs " ) , el : " # notificationBar " , template : templateEngine . createTemplate ( " notificationView . ejs " ) , toggleNotification : function ( ) { var a = this . collection . length ; 0 ! = = a & & $ ( " # notification_menu " ) . toggle ( ) } , removeAllNotifications : function ( ) { $ . noty . clearQueue ( ) , $ . noty . closeAll ( ) , this . collection . reset ( ) , $ ( " # notification_menu " ) . hide ( ) } , removeNotification : function ( a ) { var b = a . target . id ; this . collection . get ( b ) . destroy ( ) } , renderNotifications : function ( a , b , c ) { if ( c & & c . add ) { var d , e = this . collection . at ( this . collection . length - 1 ) , f = e . get ( " title " ) , g = 5e3 , h = [ " click " ] ; if ( e . get ( " content " ) & & ( f = f + " : " + e . get ( " content " ) ) , " error " = = = e . get ( " type " ) ? ( g = ! 1 , h = [ " button " ] , d = [ { addClass : " button - danger " , text : " Close " , onClick : function ( a ) { a . close ( ) } } ] ) : " warning " = = = e . get ( " type " ) & & ( g = 15e3 , d = [ { addClass : " button - warning " , text : " Close " , onClick : function ( a ) { a . close ( ) } } , { addClass : " button - danger " , text : " Don ' t show again . " , onClick : function ( a ) { a . close ( ) , window . arangoHelper . doNotShowAgain ( ) } } ] ) , $ . noty . clearQueue ( ) , $ . noty . closeAll ( ) , noty ( { theme : " relax " , text : f , template : ' < div class = " noty_message arango_message " > < div > < i class = " fa fa - close " > < / i > < / div > < span class = " noty_text arango_text " > < / span > < div class = " noty_close arango_close " > < / div > < / div > ' , maxVisible : 1 , closeWith : [ " click " ] , type : e . get ( " type " ) , layout : " bottom " , timeout : g , buttons : d , animation : { open : { height : " show " } , close : { height : " hide " } , easing : " swing " , speed : 200 , closeWith : h } } ) , " success " = = = e . get ( " type " ) ) return void e . destroy ( ) } $ ( " # stat_hd_counter " ) . text ( this . collection . length ) , 0 = = = this . collection . length ? ( $ ( " # stat_hd " ) . removeClass ( " fullNotification " ) , $ ( " # notification_menu " ) . hide ( ) ) : $ ( " # stat_hd " ) . addClass ( " fullNotification " ) , $ ( " . innerDropdownInnerUL " ) . html ( this . notificationItem . render ( { notifications : this . collection } ) ) , $ ( " . notificationInfoIcon " ) . tooltip ( { position : { my : " left top " , at : " right + 55 top - 1 " } } ) } , render : function ( ) { return $ ( this . el ) . html ( this . template . render ( { notifications : this . collection } ) ) , this . renderNotifications ( ) , this . delegateEvents ( ) , this . el } } ) } ( ) , function ( ) { " use strict " ; window . ProgressView = Backbone . View . extend ( { template : templateEngine . createTemplate ( " progressBase . ejs " ) , el : " # progressPlaceholder " , el2 : " # progressPlaceholderIcon " , toShow : ! 1 , lastDelay : 0 , action : function ( ) { } , events : { " click . progress - action button " : " performAction " } , performAction : function ( ) { " function " = = typeof this . action & & this . action ( ) , window . progressView . hide ( ) } , initialize : function ( ) { } , showWithDelay : function ( a , b , c , d ) { var e = this ; e . toShow = ! 0 , e . lastDelay = a , setTimeout ( function ( ) { e . toShow = = = ! 0 & & e . show ( b , c , d ) } , e . lastDelay ) } , show : function ( a , b , c ) { $ ( this . el ) . html ( this . template . render ( { } ) ) , $ ( " . progress - text " ) . text ( a ) , c ? $ ( " . progress - action " ) . html ( ' < button class = " button - danger " > ' + c + " < / button > " ) : $ ( " . progress - action " ) . html ( ' < button class = " button - danger " > Cancel < / button > ' ) , b ? this . action = b : this . action = this . hide ( ) , $ ( this . el ) . show ( ) } , hide : function ( ) { var a = this ; a . toShow = ! 1 , $ ( this . el ) . hide ( ) , this . action = function ( ) { } } } ) } ( ) , function ( ) { " use strict " ; window . QueryManagementView = Backbone . View . extend ( { el : " # content " , id : " # queryManagementContent " , templateActive : templateEngine . createTemplate ( " queryManagementViewActive . ejs " ) , templateSlow : templateEngine . createTemplate ( " queryManagementViewSlow . ejs " ) , table : templateEngine . createTemplate ( " arangoTable . ejs " ) , active : ! 0 , shouldRender : ! 0 , timer : 0 , refreshRate : 2e3 , initialize : function ( ) { var a = this ; this . activeCollection = new window . QueryManagementActive , this . slowCollection = new window . QueryManagementSlow , this . convertModelToJSON ( ! 0 ) , window . setInterval ( function ( ) { " # queries " = = = window . location . hash & & window . VISIBLE & & a . shouldRender & & " queryManagement " = = = arangoHelper . getCurrentSub ( ) . route & & ( a . active ? $ ( " # arangoQueryManagementTable " ) . is ( " : visible " ) & & a . convertModelToJSON ( ! 0 ) : $ ( " # arangoQueryManagementTable " ) . is ( " : visible " ) & & a . convertModelToJSON ( ! 1 ) ) } , a . refreshRate ) } , events : { " click # deleteSlowQueryHistory " : " deleteSlowQueryHistoryModal " , " click # arangoQueryManagementTable . fa - minus - circle " : " deleteRunningQueryModal " } , tableDescription : { id : " arangoQueryManagementTable " , titles : [ " ID " , " Query String " , " Runtime " , " Started " , " " ] , rows : [ ] , unescaped : [ ! 1 , ! 1 , ! 1 , ! 1 , ! 0 ] } , deleteRunningQueryModal : function ( a ) { this . killQueryId = $ ( a . currentTarget ) . attr ( " data - id " ) ; var b = [ ] , c = [ ] ; c . push ( window . modalView . createReadOnlyEntry ( void 0 , " Running Query " , " Do you want to kill the running query ? " , void 0 , void 0 , ! 1 , void 0 ) ) , b . push ( window . modalView . createDeleteButton ( " Kill " , this . killRunningQuery . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Kill Running Query " , b , c ) , $ ( " . modal - delete - confirmation strong " ) . html ( " Really kill ? " ) } , killRunningQuery : function ( ) { this . collection . killRunningQuery ( this . killQueryId , this . killRunningQueryCallback . bind ( this ) ) , window . modalView . hide ( ) } , killRunningQueryCallback : function ( ) { this . convertModelToJSON ( ! 0 ) , this . renderActive ( ) } , deleteSlowQueryHistoryModal : function ( ) { var a = [ ] , b = [ ] ; b . push ( window . modalView . createReadOnlyEntry ( void 0 , " Slow Query Log " , " Do you want to delete the slow query log entries ? " , void 0 , void 0 , ! 1 , void 0 ) ) , a . push ( window . modalView . createDeleteButton ( " Delete " , this . deleteSlowQueryHistory . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Delete Slow Query Log " , a , b ) } , deleteSlowQueryHistory : function ( ) { this . collection . deleteSlowQueryHistory ( this . slowQueryCallback . bind ( this ) ) , window . modalView . hide ( ) } , slowQueryCallback : function ( ) { this . convertModelToJSON ( ! 1 ) , this . renderSlow ( ) } , render : function ( ) { var a = arangoHelper . getCurrentSub ( ) ; a . params . active ? ( this . active = ! 0 , this . convertModelToJSON ( ! 0 ) ) : ( this . active = ! 1 , this . convertModelToJSON ( ! 1 ) ) } , addEvents : function ( ) { var a = this ; $ ( " # queryManagementContent tbody " ) . on ( " mousedown " , function ( ) { clearTimeout ( a . timer ) , a . shouldRender = ! 1 } ) , $ ( " # queryManagementContent tbody " ) . on ( " mouseup " , function ( ) { a . timer = window . setTimeout ( function ( ) { a . shouldRender = ! 0 } , 3e3 ) } ) } , renderActive : function ( ) { this . $ el . html ( this . templateActive . render ( { } ) ) , $ ( this . id ) . append ( this . table . render ( { content : this . tableDescription } ) ) , $ ( " # activequeries " ) . addClass ( " arango - active - tab " ) , this . addEvents ( ) } , renderSlow : function ( ) { this . $ el . html ( this . templateSlow . render ( { } ) ) , $ ( this . id ) . append ( this . table . render ( { content : this . tableDescription } ) ) , $ ( " # slowqueries " ) . addClass ( " arango - active - tab " ) , this . addEvents ( ) } , convertModelToJSON : function ( a ) { var b = this , c = [ ] ; a = = = ! 0 ? this . collection = this . activeCollection : this . collection = this . slowCollection , this . collection . fetch ( { success : function ( ) { b . collection . each ( function ( b ) { var d = " " ; a & & ( d = ' < i data - id = " ' + b . get ( " id " ) + ' " class = " fa fa - minus - circle " > < / i > ' ) , c . push ( [ b . get ( " id " ) , b . get ( " query " ) , b . get ( " runTime " ) . toFixed ( 2 ) + " s " , b . get ( " started " ) , d ] ) } ) ; var d = " No running queries . " ; a | | ( d = " No slow queries . " ) , 0 = = = c . length & & c . push ( [ d , " " , " " , " " , " " ] ) , b . tableDescription . rows = c , a ? b . renderActive ( ) : b . renderSlow ( ) } } ) } } ) } ( ) , function ( ) { " use strict " ; window . QueryView = Backbone . View . extend ( { el : " # content " , bindParamId : " # bindParamEditor " , myQueriesId : " # queryTable " , template : templateEngine . createTemplate ( " queryView . ejs " ) , table : templateEngine . createTemplate ( " arangoTable . ejs " ) , outputDiv : " # outputEditors " , outputTemplate : templateEngine . createTemplate ( " queryViewOutput . ejs " ) , outputCounter : 0 , allowUpload : ! 1 , renderComplete : ! 1 , customQueries : [ ] , cachedQueries : { } , graphViewers : [ ] , queries : [ ] , state : { lastQuery : { query : void 0 , bindParam : void 0 } } , graphs : [ ] , settings : { aqlWidth : void 0 } , currentQuery : { } , initDone : ! 1 , bindParamRegExp : / @ ( @ ? \ w + \ d * ) / , bindParamTableObj : { } , bindParamMode : " table " , bindParamTableDesc : { id : " arangoBindParamTable " , titles : [ " Key " , " Value " ] , rows : [ ] } , myQueriesTableDesc : { id : " arangoMyQueriesTable " , titles : [ " Name " , " Actions " ] , rows : [ ] } , execPending : ! 1 , aqlEditor : null , queryPreview : null , initialize : function ( ) { this . refreshAQL ( ) } , allowParamToggle : ! 0 , events : { " click # executeQuery " : " executeQuery " , " click # explainQuery " : " explainQuery " , " click # clearQuery " : " clearQuery " , " click . outputEditorWrapper # downloadQueryResult " : " downloadQueryResult " , " click . outputEditorWrapper . switchAce span " : " switchAce " , " click . outputEditorWrapper . closeResult " : " closeResult " , " click # toggleQueries1 " : " toggleQueries " , " click # toggleQueries2 " : " toggleQueries " , " click # createNewQuery " : " createAQL " , " click # saveCurrentQuery " : " addAQL " , " click # updateCurrentQuery " : " updateAQL " , " click # exportQuery " : " exportCustomQueries " , " click # importQuery " : " openImportDialog " , " click # removeResults " : " removeResults " , " click # querySpotlight " : " showSpotlight " , " click # deleteQuery " : " selectAndDeleteQueryFromTable " , " click # explQuery " : " selectAndExplainQueryFromTable " , " click . closeProfile " : " closeProfile " , " keydown # arangoBindParamTable input " : " updateBindParams " , " change # arangoBindParamTable input " : " updateBindParams " , " click # arangoMyQueriesTable tbody tr " : " showQueryPreview " , " dblclick # arangoMyQueriesTable tbody tr " : " selectQueryFromTable " , " click # arangoMyQueriesTable # copyQuery " : " selectQueryFromTable " , " click # closeQueryModal " : " closeExportDialog " , " click # confirmQueryImport " : " importCustomQueries " , " click # switchTypes " : " toggleBindParams " , " click # arangoMyQueriesTable # runQuery " : " selectAndRunQueryFromTable " } , clearQuery : function ( ) { this . aqlEditor . setValue ( " " , 1 ) } , closeProfile : function ( a ) { var b = $ ( a . currentTarget ) . parent ( ) . attr ( " counter " ) ; _ . each ( $ ( " . queryProfile " ) , function ( a ) { $ ( a ) . attr ( " counter " ) = = = b & & $ ( a ) . fadeOut ( " fast " ) . remove ( ) } ) } , toggleBindParams : function ( ) { this . allowParamToggle ? ( $ ( " # bindParamEditor " ) . toggle ( ) , $ ( " # bindParamAceEditor " ) . toggle ( ) , " JSON " = = = $ ( " # switchTypes " ) . text ( ) ? ( this . bindParamMode = " json " , $ ( " # switchTypes " ) . text ( " Table " ) , this . updateQueryTable ( ) , this . bindParamAceEditor . setValue ( JSON . stringify ( this . bindParamTableObj , null , " \ t " ) , 1 ) , this . deselect ( this . bindParamAceEditor ) ) : ( this . bindParamMode = " table " , $ ( " # switchTypes " ) . text ( " JSON " ) , this . renderBindParamTable ( ) ) ) : arangoHelper . arangoError ( " Bind parameter " , " Could not parse bind parameter " ) , this . resize ( ) } , openExportDialog : function ( ) { $ ( " # queryImportDialog " ) . modal ( " show " ) } , closeExportDialog : function ( ) { $ ( " # queryImportDialog " ) . modal ( " hide " ) } , initQueryImport : function ( ) { var a = this ; a . allowUpload = ! 1 , $ ( " # importQueries " ) . change ( function ( b ) { a . files = b . target . files | | b . dataTransfer . files , a . file = a . files [ 0 ] , a . allowUpload = ! 0 , $ ( " # confirmQueryImport " ) . removeClass ( " disabled " ) } ) } , importCustomQueries : function ( ) { var a = this ; if ( this . allowUpload = = = ! 0 ) { var b = function ( ) { this . collection . fetch ( { success : function ( ) { a . updateLocalQueries ( ) , a . updateQueryTable ( ) , a . resize ( ) , a . allowUpload = ! 1 , $ ( " # confirmQueryImport " ) . addClass ( " disabled " ) , $ ( " # queryImportDialog " ) . modal ( " hide " ) } , error : function ( a ) { arangoHelper . arangoError ( " Custom Queries " , a . responseText ) } } ) } . bind ( this ) ; a . collection . saveImportQueries ( a . file , b . bind ( this ) ) } } , removeResults : function ( ) { this . cachedQueries = { } , $ ( " . outputEditorWrapper " ) . hide ( " fast " , function ( ) { $ ( " . outputEditorWrapper " ) . remove ( ) } ) , $ ( " # removeResults " ) . hide ( ) } , getCustomQueryParameterByName : function ( a ) { return this . collection . findWhere ( { name : a } ) . get ( " parameter " ) } , getCustomQueryValueByName : function ( a ) { var b ; return a & & ( b = this . collection . findWhere ( { name : a } ) ) , b ? b = b . get ( " value " ) : _ . each ( this . queries , function ( c ) { c . name = = = a & & ( b = c . value ) } ) , b } , openImportDialog : function ( ) { $ ( " # queryImportDialog " ) . modal ( " show " ) } , closeImportDialog : function ( ) { $ ( " # queryImportDialog " ) . modal ( " hide " ) } , exportCustomQueries : function ( ) { var a ; $ . ajax ( " whoAmI ? _ = " + Date . now ( ) ) . success ( function ( b ) { a = b . user , null ! = = a & & a ! = = ! 1 | | ( a = " root " ) ; var c = " query / download / " + encodeURIComponent ( a ) ; arangoHelper . download ( c ) } ) } , toggleQueries : function ( a ) { a ? " toggleQueries1 " = = = a . currentTarget . id ? ( this . updateQueryTable ( ) , $ ( " # bindParamAceEditor " ) . hide ( ) , $ ( " # bindParamEditor " ) . show ( ) , $ ( " # switchTypes " ) . text ( " JSON " ) , $ ( " . aqlEditorWrapper " ) . first ( ) . width ( . 33 * $ ( window ) . width ( ) ) , this . queryPreview . setValue ( " No query selected . " , 1 ) , this . deselect ( this . queryPreview ) ) : ( $ ( " # updateCurrentQuery " ) . hide ( ) , void 0 = = = this . settings . aqlWidth ? $ ( " . aqlEditorWrapper " ) . first ( ) . width ( . 33 * $ ( window ) . width ( ) ) : $ ( " . aqlEditorWrapper " ) . first ( ) . width ( this . settings . aqlWidth ) , " undefined " ! = = localStorage . getItem ( " lastOpenQuery " ) & & $ ( " # updateCurrentQuery " ) . show ( ) ) : void 0 = = = this . settings . aqlWidth ? $ ( " . aqlEditorWrapper " ) . first ( ) . width ( . 33 * $ ( window ) . width ( ) ) : $ ( " . aqlEditorWrapper " ) . first ( ) . width ( this . settings . aqlWidth ) , this . resize ( ) ; var b = [ " aqlEditor " , " queryTable " , " previewWrapper " , " querySpotlight " , " bindParamEditor " , " toggleQueries1 " , " toggleQueries2 " , " createNewQuery " , " saveCurrentQuery " , " querySize " , " executeQuery " , " switchTypes " , " explainQuery " , " importQuery " , " exportQuery " ] ; _ . each ( b , function ( a ) { $ ( " # " + a ) . toggle ( ) } ) , this . resize ( ) } , showQueryPreview : function ( a ) { $ ( " # arangoMyQueriesTable tr " ) . removeClass ( " selected " ) , $ ( a . currentTarget ) . addClass ( " selected " ) ; var b = this . getQueryNameFromTable ( a ) ; this . queryPreview . setValue ( this . getCustomQueryValueByName ( b ) , 1 ) , this . deselect ( this . queryPreview ) } , getQueryNameFromTable : function ( a ) { var b ; return $ ( a . currentTarget ) . is ( " tr " ) ? b = $ ( a . currentTarget ) . children ( ) . first ( ) . text ( ) : $ ( a . currentTarget ) . is ( " span " ) & & ( b = $ ( a . currentTarget ) . parent ( ) . parent ( ) . prev ( ) . text ( ) ) , b } , deleteQueryModal : function ( a ) { var b = [ ] , c = [ ] ; c . push ( window . modalView . createReadOnlyEntry ( void 0 , a , " Do you want to delete the query ? " , void 0 , void 0 , ! 1 , void 0 ) ) , b . push ( window . modalView . createDeleteButton ( " Delete " , this . deleteAQL . bind ( this , a ) ) ) , window . modalView . show ( " modalTable . ejs " , " Delete Query " , b , c ) } , selectAndDeleteQueryFromTable : function ( a ) { var b = this . getQueryNameFromTable ( a ) ; this . deleteQueryModal ( b ) } , selectAndExplainQueryFromTable : function ( a ) { this . selectQueryFromTable ( a , ! 1 ) , this . explainQuery ( ) } , selectAndRunQueryFromTable : function ( a ) { this . selectQueryFromTable ( a , ! 1 ) , this . executeQuery ( ) } , selectQueryFromTable : function ( a , b ) { var c = this . getQueryNameFromTable ( a ) , d = this ; void 0 = = = b & & this . toggleQueries ( ) ; var e = localStorage . getItem ( " lastOpenQuery " ) ; this . state . lastQuery . query = this . aqlEditor . getValue ( ) , this . state . lastQuery . bindParam = this . bindParamTableObj , this . aqlEditor . setValue ( this . getCustomQueryValueByName ( c ) , 1 ) , this . fillBindParamTable ( this . getCustomQueryParameterByName ( c ) ) , this . updateBindParams ( ) , this . currentQuery = this . collection . findWhere ( { name : c } ) , this . currentQuery & & localStorage . setItem ( " lastOpenQuery " , this . currentQuery . get ( " name " ) ) , $ ( " # updateCurrentQuery " ) . show ( ) , $ ( " # lastQuery " ) . remove ( ) , e ! = = c & & ( $ ( " # queryContent . arangoToolbarTop . pull - left " ) . append ( ' < span id = " lastQuery " class = " clickable " > Previous Query < / span > ' ) , this . breadcrumb ( c ) ) , $ ( " # lastQuery " ) . hide ( ) . fadeIn ( 500 ) . on ( " click " , function ( ) { $ ( " # updateCurrentQuery " ) . hide ( ) , d . aqlEditor . setValue ( d . state . lastQuery . query , 1 ) , d . fillBindParamTable ( d . state . lastQuery . bindParam ) , d . updateBindParams ( ) , d . collection . each ( function ( a ) { a = a . toJSON ( ) , a . value = = = d . state . lastQuery . query ? d . breadcrumb ( a . name ) : d . breadcrumb ( ) } ) , $ ( " # lastQuery " ) . fadeOut ( 500 , function ( ) { $ ( this ) . remove ( ) } ) } ) } , deleteAQL : function ( a ) { var b = function ( a ) { a ? arangoHelper . arangoError ( " Query " , " Could not delete query . " ) : ( this . updateLocalQueries ( ) , this . updateQueryTable ( ) , this . resize ( ) , window . modalView . hide ( ) ) } . bind ( this ) , c = this . collection . findWhere ( { name : a } ) ; this . collection . remove ( c ) , this . collection . saveCollectionQueries ( b ) } , switchAce : function ( a ) { var b = $ ( a . currentTarget ) . attr ( " counter " ) , c = a . currentTarget ; if ( ! $ ( c ) . hasClass ( " disabled " ) ) { _ . each ( $ ( c ) . parent ( ) . children ( ) , function ( a ) { $ ( a ) . removeClass ( " active " ) } ) ; var d = $ ( c ) . attr ( " val " ) ; $ ( c ) . addClass ( " active " ) , $ ( c ) . text ( d . charAt ( 0 ) . toUpperCase ( ) + d . slice ( 1 ) ) , " JSON " = = = d ? ( $ ( " # outputEditor " + b ) . show ( ) , $ ( " # outputGraph " + b ) . hide ( ) , $ ( " # outputTable " + b ) . hide ( ) ) : " Table " = = = d ? ( $ ( " # outputTable " + b ) . show ( ) , $ ( " # outputGraph " + b ) . hide ( ) , $ ( " # outputEditor " + b ) . hide ( ) ) : " Graph " = = = d & & ( $ ( " # outputGraph " + b ) . show ( ) , $ ( " # outputTable " + b ) . hide ( ) , $ ( " # outputEditor " + b ) . hide ( ) ) , this . deselect ( ace . edit ( " outputEditor " + b ) ) , this . deselect ( ace . edit ( " sentQueryEditor " + b ) ) , this . deselect ( ace . edit ( " sentBindParamEditor " + b ) ) } } , downloadQueryResult : function ( a ) { var b = $ ( a . currentTarget ) . attr ( " counter " ) , c = ace . edit ( " sentQueryEditor " + b ) , d = c . getValue ( ) ; if ( " " ! = = d | | void 0 ! = = d | | null ! = = d ) { var e ; e = 0 = = = Object . keys ( this . bindParamTableObj ) . length ? " query / result / download / " + encodeURIComponent ( btoa ( JSON . stringify ( { query : d } ) ) ) : " query / result / download / " + encodeURIComponent ( btoa ( JSON . stringify ( { query : d , bindVars : this . bindParamTableObj } ) ) ) , arangoHelper . download ( e ) } else arangoHelper . arangoError ( " Query error " , " could not query result . " ) } , explainQuery : function ( ) { if ( ! this . verifyQueryAndParams ( ) ) { this . lastSentQueryString = this . aqlEditor . getValue ( ) , this . $ ( this . outputDiv ) . prepend ( this . outputTemplate . render ( { counter : this . outputCounter , type : " Explain " } ) ) ; var a = this . outputCounter , b = ace . edit ( " outputEditor " + a ) , c = ace . edit ( " sentQueryEditor " + a ) , d = ace . edit ( " sentBindParamEditor " + a ) ; c . getSession ( ) . setMode ( " ace / mode / aql " ) , c . setOption ( " vScrollBarAlwaysVisible " , ! 0 ) , c . setReadOnly ( ! 0 ) , this . setEditorAutoHeight ( c ) , b . setReadOnly ( ! 0 ) , b . getSession ( ) . setMode ( " ace / mode / json " ) , b . setOption ( " vScrollBarAlwaysVisible " , ! 0 ) , this . setEditorAutoHeight ( b ) , d . setValue ( JSON . stringify ( this . bindParamTableObj ) , 1 ) , d . setOption ( " vScrollBarAlwaysVisible " , ! 0 ) , d . getSession ( ) . setMode ( " ace / mode / json " ) , d . setReadOnly ( ! 0 ) , this . setEditorAutoHeight ( d ) , this . fillExplain ( b , c , a ) , this . outputCounter + + } } , fillExplain : function ( a , b , c ) { b . setValue ( this . aqlEditor . getValue ( ) , 1 ) ; var d = this , e = this . readQueryData ( ) ; if ( " false " ! = = e & & ( $ ( " # outputEditorWrapper " + c + " . queryExecutionTime " ) . text ( " " ) , this . execPending = ! 1 , e ) ) { var f = function ( ) { $ ( " # outputEditorWrapper " + c + " # spinner " ) . remove ( ) , $ ( " # outputEditor " + c ) . css ( " opacity " , " 1 " ) , $ ( " # outputEditorWrapper " + c + " . fa - close " ) . show ( ) , $ ( " # outputEditorWrapper " + c + " . switchAce " ) . show ( ) } ; $ . ajax ( { type : " POST " , url : arangoHelper . databaseUrl ( " / _admin / aardvark / query / explain / " ) , data : e , contentType : " application / json " , processData : ! 1 , success : function ( b ) { b . msg . includes ( " errorMessage " ) ? ( d . removeOutputEditor ( c ) , arangoHelper . arangoError ( " Explain " , b . msg ) ) : ( d . cachedQueries [ c ] = b , a . setValue ( b . msg , 1 ) , d . deselect ( a ) , $ . noty . clearQueue ( ) , $ . noty . closeAll ( ) , d . handleResult ( c ) , $ ( " . centralRow " ) . animate ( { scrollTop : $ ( " # queryContent " ) . height ( ) } , " fast " ) ) , f ( ) } , error : function ( a ) { try { var b = JSON . parse ( a . responseText ) ; arangoHelper . arangoError ( " Explain " , b . errorMessage ) } catch ( e ) { arangoHelper . arangoError ( " Explain " , " ERROR " ) } d . handleResult ( c ) , d . removeOutputEditor ( c ) , f ( ) } } ) } } , removeOutputEditor : function ( a ) { $ ( " # outputEditorWrapper " + a ) . hide ( ) , $ ( " # outputEditorWrapper " + a ) . remove ( ) , 0 = = = $ ( " . outputEditorWrapper " ) . length & & $ ( " # removeResults " ) . hide ( ) } , getCachedQueryAfterRender : function ( ) { if ( this . renderComplete = = = ! 1 ) { var a = this . getCachedQuery ( ) , b = this ; if ( null ! = = a & & void 0 ! = = a & & " " ! = = a ) { this . aqlEditor . setValue ( a . query , 1 ) ; var c = localStorage . getItem ( " lastOpenQuery " ) ; if ( void 0 ! = = c & & " undefined " ! = = c ) try { var d = this . collection . findWhere ( { name : c } ) . toJSON ( ) ; d . value = = = a . query & & ( b . breadcrumb ( c ) , $ ( " # updateCurrentQuery " ) . show ( ) ) } catch ( e ) { } if ( this . aqlEditor . getSession ( ) . setUndoManager ( new ace . UndoManager ) , " " ! = = a . parameter | | void 0 ! = = a ) try { b . bindParamTableObj = JSON . parse ( a . parameter ) ; var f ; _ . each ( $ ( " # arangoBindParamTable input " ) , function ( a ) { f = $ ( a ) . attr ( " name " ) , " object " = = typeof b . bindParamTableObj [ f ] ? $ ( a ) . val ( JSON . parse ( b . bindParamTableObj [ f ] ) ) : $ ( a ) . val ( b . bindParamTableObj [ f ] ) } ) , b . setCachedQuery ( b . aqlEditor . getValue ( ) , JSON . stringify ( b . bindParamTableObj ) ) } catch ( e ) { } } this . renderComplete = ! 0 } } , getCachedQuery : function ( ) { if ( " undefined " ! = = Storage ) { var a = localStorage . getItem ( " cachedQuery " ) ; if ( void 0 ! = = a ) { var b = JSON . parse ( a ) ; this . currentQuery = b ; try { this . bindParamTableObj = JSON . parse ( b . parameter ) } catch ( c ) { } return b } } } , setCachedQuery : function ( a , b ) { if ( " " ! = = a & & " undefined " ! = = Storage ) { var c = { query : a , parameter : b } ; this . currentQuery = c , localStorage . setItem ( " cachedQuery " , JSON . stringify ( c ) ) } } , closeResult : function ( a ) { var b = this , c = $ ( " # " + $ ( a . currentTarget ) . attr ( " element " ) ) . parent ( ) , d = $ ( c ) . attr ( " id " ) , e = d . substring ( d . length - 1 , d . length - 0 ) ; delete this . cachedQueries [ e ] , $ ( c ) . hide ( " fast " , function ( ) { $ ( c ) . remove ( ) , 0 = = = $ ( " . outputEditorWrapper " ) . length & & ( b . cachedQueries = { } , $ ( " # removeResults " ) . hide ( ) ) } ) } , fillSelectBoxes : function ( ) { var a = 1e3 , b = $ ( " # querySize " ) ; b . empty ( ) , [ 100 , 250 , 500 , 1e3 , 2500 , 5e3 , 1e4 , " all " ] . forEach ( function ( c ) { b . append ( ' < option value = " ' + _ . escape ( c ) + ' " ' + ( a = = = c ? " selected " : " " ) + " > " + _ . escape ( c ) + " results < / option > " ) } ) } , render : function ( ) { this . refreshAQL ( ) , this . renderComplete = ! 1 , this . $ el . html ( this . template . render ( { } ) ) , this . afterRender ( ) , this . initDone | | ( this . settings . aqlWidth = $ ( " . aqlEditorWrapper " ) . width ( ) ) , " json " = = = this . bindParamMode & & this . toggleBindParams ( ) , this . initDone = ! 0 , this . renderBindParamTable ( ! 0 ) , this . restoreCachedQueries ( ) } , cleanupGraphs : function ( ) { _ . each ( this . graphViewers , function ( a ) { a . killCurrentGraph ( ) , a . remove ( ) } ) , $ ( " canvas " ) . remove ( ) , this . graphViewers = null , this . graphViewers = [ ] } , afterRender : function ( ) { var a = this ; this . initAce ( ) , this . initTables ( ) , this . fillSelectBoxes ( ) , this . makeResizeable ( ) , this . initQueryImport ( ) , $ ( " . inputEditorWrapper " ) . height ( $ ( window ) . height ( ) / 10 * 5 + 25 ) , window . setTimeout ( function ( ) { a . resize ( ) } , 10 ) , a . deselect ( a . aqlEditor ) } , restoreCachedQueries : function ( ) { var a = this ; Object . keys ( this . cachedQueries ) . length > 0 & & _ . each ( this . cachedQueries , function ( b , c ) { a . renderQueryResultBox ( c , null , ! 0 ) , a . renderQueryResult ( b , c , ! 0 ) , a . fillSentQueryValue ( c ) , b . sentQuery & & a . bindQueryResultButtons ( null , c ) } ) } , fillSentQueryValue : function ( a ) { var b = ace . edit ( " sentQueryEditor " + a ) ; b . setValue ( this . cachedQueries [ a ] . sentQuery , 1 ) } , showSpotlight : function ( a ) { var b , c ; if ( void 0 ! = = a & & " click " ! = = a . type | | ( a = " aql " ) , " aql " = = = a ) b = function ( a ) { this . aqlEditor . insert ( a ) , $ ( " # aqlEditor . ace_text - input " ) . focus ( ) } . bind ( this ) , c = function ( ) { $ ( " # aqlEditor . ace_text - input " ) . focus ( ) } ; else { var d = $ ( " : focus " ) ; b = function ( a ) { var b = $ ( d ) . val ( ) ; $ ( d ) . val ( b + a ) , $ ( d ) . focus ( ) } , c = function ( ) { $ ( d ) . focus ( ) } } window . spotlightView . show ( b , c , a ) } , resize : function ( ) { this . resizeFunction ( ) } , resizeFunction : function ( ) { $ ( " # toggleQueries1 " ) . is ( " : visible " ) ? ( this . aqlEditor . resize ( ) , $ ( " # arangoBindParamTable thead " ) . css ( " width " , $ ( " # bindParamEditor " ) . width ( ) ) , $ ( " # arangoBindParamTable thead th " ) . css ( " width " , $ ( " # bindParamEditor " ) . width ( ) / 2 ) , $ ( " # arangoBindParamTable tr " ) . css ( " width " , $ ( " # bindParamEditor " ) . width ( ) ) , $ ( " # arangoBindParamTable tbody " ) . css ( " height " , $ ( " # aqlEditor " ) . height ( ) - 35 ) , $ ( " # arangoBindParamTable tbody " ) . css ( " width " , $ ( " # bindParamEditor " ) . width ( ) ) , $ ( " # arangoBindParamTable tbody tr " ) . css ( " width " , $ ( " # bindParamEditor " ) . width ( ) ) , $ ( " # arangoBindParamTable tbody td " ) . css ( " width " , $ ( " # bindParamEditor " ) . width ( ) / 2 ) ) : ( this . queryPreview . resize ( ) , $ ( " # arangoMyQueriesTable thead " ) . css ( " width " , $ ( " # queryTable " ) . width ( ) ) , $ ( " # arangoMyQueriesTable thead th " ) . css ( " width " , $ ( " # queryTable " ) . width ( ) / 2 ) , $ ( " # arangoMyQueriesTable tr " ) . css ( " width " , $ ( " # queryTable " ) . width ( ) ) , $ ( " # arangoMyQueriesTable tbody " ) . css ( " height " , $ ( " # queryTable " ) . height ( ) - 35 ) , $ ( " # arangoMyQueriesTable tbody " ) . css ( " width " , $ ( " # queryTable " ) . width ( ) ) , $ ( " # arangoMyQueriesTable tbody td " ) . css ( " width " , $ ( " # queryTable " ) . width ( ) / 2 ) ) } , makeResizeable : function ( ) { var a = this ; $ ( " . aqlEditorWrapper " ) . resizable ( { resize : function ( ) { a . resizeFunction ( ) , a . settings . aqlWidth = $ ( " . aqlEditorWrapper " ) . width ( ) } , handles : " e " } ) , $ ( " . inputEditorWrapper " ) . resizable ( { resize : function ( ) { a . resizeFunction ( ) } , handles : " s " } ) , this . resizeFunction ( ) } , initTables : function ( ) { this . $ ( this . bindParamId ) . html ( this . table . render ( { content : this . bindParamTableDesc } ) ) , this . $ ( this . myQueriesId ) . html ( this . table . render ( { <nl> - content : this . myQueriesTableDesc } ) ) } , checkType : function ( a ) { var b = " stringtype " ; try { a = JSON . parse ( a ) , b = a instanceof Array ? " arraytype " : typeof a + " type " } catch ( c ) { } return b } , updateBindParams : function ( a ) { var b , c = this ; if ( a ) { b = $ ( a . currentTarget ) . attr ( " name " ) , this . bindParamTableObj [ b ] = arangoHelper . parseInput ( a . currentTarget ) ; var d = [ " arraytype " , " objecttype " , " booleantype " , " numbertype " , " stringtype " ] ; _ . each ( d , function ( b ) { $ ( a . currentTarget ) . removeClass ( b ) } ) , $ ( a . currentTarget ) . addClass ( c . checkType ( $ ( a . currentTarget ) . val ( ) ) ) } else _ . each ( $ ( " # arangoBindParamTable input " ) , function ( a ) { b = $ ( a ) . attr ( " name " ) , c . bindParamTableObj [ b ] = arangoHelper . parseInput ( a ) } ) ; this . setCachedQuery ( this . aqlEditor . getValue ( ) , JSON . stringify ( this . bindParamTableObj ) ) , a & & ( ( a . ctrlKey | | a . metaKey ) & & 13 = = = a . keyCode & & ( a . preventDefault ( ) , this . executeQuery ( ) ) , ( a . ctrlKey | | a . metaKey ) & & 32 = = = a . keyCode & & ( a . preventDefault ( ) , this . showSpotlight ( " bind " ) ) ) } , parseQuery : function ( a ) { var b = 0 , c = 1 , d = 2 , e = 3 , f = 4 , g = 5 , h = 6 , i = 7 ; a + = " " ; var j , k , l , m = this , n = b , o = a . length , p = [ ] ; for ( k = 0 ; k < o ; + + k ) switch ( l = a . charAt ( k ) , n ) { case b : " @ " = = = l ? ( n = h , j = k ) : " ' " = = = l ? n = c : ' " ' = = = l ? n = d : " ` " = = = l ? n = e : " ´ " = = = l ? n = i : " / " = = = l & & k + 1 < o & & ( " / " = = = a . charAt ( k + 1 ) ? ( n = f , + + k ) : " * " = = = a . charAt ( k + 1 ) & & ( n = g , + + k ) ) ; break ; case f : " \ r " ! = = l & & " \ n " ! = = l | | ( n = b ) ; break ; case g : " * " = = = l & & k + 1 < = o & & " / " = = = a . charAt ( k + 1 ) & & ( n = b , + + k ) ; break ; case c : " \ \ " = = = l ? + + k : " ' " = = = l & & ( n = b ) ; break ; case d : " \ \ " = = = l ? + + k : ' " ' = = = l & & ( n = b ) ; break ; case e : " ` " = = = l & & ( n = b ) ; break ; case i : " ´ " = = = l & & ( n = b ) ; break ; case h : / ^ [ @ a - zA - Z0 - 9_ ] + $ / . test ( l ) | | ( p . push ( a . substring ( j , k ) ) , n = b , j = void 0 ) } var q ; return _ . each ( p , function ( a , b ) { q = a . match ( m . bindParamRegExp ) , q & & ( p [ b ] = q [ 1 ] ) } ) , { query : a , bindParams : p } } , checkForNewBindParams : function ( ) { var a = this , b = this . parseQuery ( this . aqlEditor . getValue ( ) ) . bindParams , c = { } ; _ . each ( b , function ( b ) { a . bindParamTableObj [ b ] ? c [ b ] = a . bindParamTableObj [ b ] : c [ b ] = " " } ) , Object . keys ( b ) . forEach ( function ( b ) { Object . keys ( a . bindParamTableObj ) . forEach ( function ( d ) { b = = = d & & ( c [ b ] = a . bindParamTableObj [ d ] ) } ) } ) , a . bindParamTableObj = c } , renderBindParamTable : function ( a ) { $ ( " # arangoBindParamTable tbody " ) . html ( " " ) , a & & this . getCachedQuery ( ) ; var b = 0 ; _ . each ( this . bindParamTableObj , function ( a , c ) { $ ( " # arangoBindParamTable tbody " ) . append ( " < tr > < td > " + c + " < / td > < td > < input name = " + c + ' type = " text " > < / input > < / td > < / tr > ' ) , b + + , _ . each ( $ ( " # arangoBindParamTable input " ) , function ( b ) { $ ( b ) . attr ( " name " ) = = = c & & ( a instanceof Array ? $ ( b ) . val ( JSON . stringify ( a ) ) . addClass ( " arraytype " ) : " object " = = typeof a ? $ ( b ) . val ( JSON . stringify ( a ) ) . addClass ( typeof a + " type " ) : $ ( b ) . val ( a ) . addClass ( typeof a + " type " ) ) } ) } ) , 0 = = = b & & $ ( " # arangoBindParamTable tbody " ) . append ( ' < tr class = " noBgColor " > < td > No bind parameters defined . < / td > < td > < / td > < / tr > ' ) ; var c = localStorage . getItem ( " lastOpenQuery " ) , d = this . collection . findWhere ( { name : c } ) ; try { d = d . toJSON ( ) } catch ( e ) { } if ( d ) { var f ; _ . each ( $ ( " # arangoBindParamTable input " ) , function ( a ) { f = $ ( a ) . attr ( " name " ) , _ . each ( d . parameter , function ( b , c ) { c = = = f & & $ ( a ) . val ( b ) } ) } ) } } , fillBindParamTable : function ( a ) { _ . each ( a , function ( a , b ) { _ . each ( $ ( " # arangoBindParamTable input " ) , function ( c ) { $ ( c ) . attr ( " name " ) = = = b & & $ ( c ) . val ( a ) } ) } ) } , initAce : function ( ) { var a = this ; this . aqlEditor = ace . edit ( " aqlEditor " ) , this . aqlEditor . getSession ( ) . setMode ( " ace / mode / aql " ) , this . aqlEditor . setFontSize ( " 10pt " ) , this . aqlEditor . setShowPrintMargin ( ! 1 ) , this . bindParamAceEditor = ace . edit ( " bindParamAceEditor " ) , this . bindParamAceEditor . getSession ( ) . setMode ( " ace / mode / json " ) , this . bindParamAceEditor . setFontSize ( " 10pt " ) , this . bindParamAceEditor . setShowPrintMargin ( ! 1 ) , this . bindParamAceEditor . getSession ( ) . on ( " change " , function ( ) { try { a . bindParamTableObj = JSON . parse ( a . bindParamAceEditor . getValue ( ) ) , a . allowParamToggle = ! 0 , a . setCachedQuery ( a . aqlEditor . getValue ( ) , JSON . stringify ( a . bindParamTableObj ) ) } catch ( b ) { " " = = = a . bindParamAceEditor . getValue ( ) ? ( _ . each ( a . bindParamTableObj , function ( b , c ) { a . bindParamTableObj [ c ] = " " } ) , a . allowParamToggle = ! 0 ) : a . allowParamToggle = ! 1 } } ) , this . aqlEditor . getSession ( ) . on ( " change " , function ( ) { if ( a . aqlEditor . getValue ( ) . length < 1 & & Object . keys ( a . bindParamTableObj ) . length > 0 & & ( a . lastCachedBindParameter = a . bindParamTableObj ) , a . checkForNewBindParams ( ) , a . renderBindParamTable ( ) , a . parseQuery ( a . aqlEditor . getValue ( ) ) . bindParams . length > 0 ) { var b = [ ] ; if ( _ . each ( a . parseQuery ( a . aqlEditor . getValue ( ) ) . bindParams , function ( c ) { if ( void 0 ! = = $ ( " input [ name = ' " + c + " ' ] " ) & & $ ( " input [ name = ' " + c + " ' ] " ) . length > 0 & & 0 = = = $ ( " input [ name = ' " + c + " ' ] " ) . val ( ) . length & & a . lastCachedBindParameter ) { var d = $ ( " input [ name = ' " + c + " ' ] " ) . val ( ) ; a . lastCachedBindParameter [ c ] & & a . lastCachedBindParameter [ c ] ! = = d & & b . push ( c ) } } ) , b . length > 0 ) { var c = { } ; _ . each ( b , function ( b , d ) { c [ b ] = a . lastCachedBindParameter [ b ] } ) , a . bindParamTableObj = c , a . renderBindParamTable ( ) } } a . initDone & & a . setCachedQuery ( a . aqlEditor . getValue ( ) , JSON . stringify ( a . bindParamTableObj ) ) , a . bindParamAceEditor . setValue ( JSON . stringify ( a . bindParamTableObj , null , " \ t " ) , 1 ) , $ ( " # aqlEditor . ace_text - input " ) . focus ( ) , a . resize ( ) } ) ; var b = function ( a ) { _ . each ( $ ( " . outputEditors " ) , function ( b ) { var c = $ ( b ) . children ( ) . first ( ) . attr ( " id " ) ; c = c . replace ( " Wrapper " , " " ) ; var d = ace . edit ( c ) ; d . setFontSize ( a ) } ) } , c = [ this . aqlEditor , this . bindParamAceEditor ] ; _ . each ( c , function ( c ) { c . commands . addCommand ( { name : " togglecomment " , bindKey : { win : " Ctrl - Shift - C " , linux : " Ctrl - Shift - C " , mac : " Command - Shift - C " } , exec : function ( a ) { a . toggleCommentLines ( ) } , multiSelectAction : " forEach " } ) , c . commands . addCommand ( { name : " increaseFontSize " , bindKey : { win : " Shift - Alt - Up " , linux : " Shift - Alt - Up " , mac : " Shift - Alt - Up " } , exec : function ( c ) { var d = parseInt ( a . aqlEditor . getFontSize ( ) . match ( / \ d + / ) [ 0 ] , 10 ) + 1 ; d + = " pt " , a . aqlEditor . setFontSize ( d ) , b ( d ) } , multiSelectAction : " forEach " } ) , c . commands . addCommand ( { name : " decreaseFontSize " , bindKey : { win : " Shift - Alt - Down " , linux : " Shift - Alt - Down " , mac : " Shift - Alt - Down " } , exec : function ( c ) { var d = parseInt ( a . aqlEditor . getFontSize ( ) . match ( / \ d + / ) [ 0 ] , 10 ) - 1 ; d + = " pt " , a . aqlEditor . setFontSize ( d ) , b ( d ) } , multiSelectAction : " forEach " } ) , c . commands . addCommand ( { name : " executeQuery " , bindKey : { win : " Ctrl - Return " , mac : " Command - Return " , linux : " Ctrl - Return " } , exec : function ( ) { a . executeQuery ( ) } } ) , c . commands . addCommand ( { name : " executeSelectedQuery " , bindKey : { win : " Ctrl - Alt - Return " , mac : " Command - Alt - Return " , linux : " Ctrl - Alt - Return " } , exec : function ( ) { a . executeQuery ( void 0 , ! 0 ) } } ) , c . commands . addCommand ( { name : " saveQuery " , bindKey : { win : " Ctrl - Shift - S " , mac : " Command - Shift - S " , linux : " Ctrl - Shift - S " } , exec : function ( ) { a . addAQL ( ) } } ) , c . commands . addCommand ( { name : " explainQuery " , bindKey : { win : " Ctrl - Shift - Return " , mac : " Command - Shift - Return " , linux : " Ctrl - Shift - Return " } , exec : function ( ) { a . explainQuery ( ) } } ) , c . commands . addCommand ( { name : " togglecomment " , bindKey : { win : " Ctrl - Shift - C " , linux : " Ctrl - Shift - C " , mac : " Command - Shift - C " } , exec : function ( a ) { a . toggleCommentLines ( ) } , multiSelectAction : " forEach " } ) , c . commands . addCommand ( { name : " showSpotlight " , bindKey : { win : " Ctrl - Space " , mac : " Ctrl - Space " , linux : " Ctrl - Space " } , exec : function ( ) { a . showSpotlight ( ) } } ) } ) , this . queryPreview = ace . edit ( " queryPreview " ) , this . queryPreview . getSession ( ) . setMode ( " ace / mode / aql " ) , this . queryPreview . setReadOnly ( ! 0 ) , this . queryPreview . setFontSize ( " 13px " ) , $ ( " # aqlEditor . ace_text - input " ) . focus ( ) } , updateQueryTable : function ( ) { function a ( a , b ) { var c ; return c = a . name < b . name ? - 1 : a . name > b . name ? 1 : 0 } var b = this ; this . updateLocalQueries ( ) , this . myQueriesTableDesc . rows = this . customQueries , _ . each ( this . myQueriesTableDesc . rows , function ( a ) { a . secondRow = ' < span class = " spanWrapper " > < span id = " copyQuery " title = " Copy query " > < i class = " fa fa - copy " > < / i > < / span > < span id = " explQuery " title = " Explain query " > < i class = " fa fa - comments " > < / i > < / i > < / span > < span id = " runQuery " title = " Run query " > < i class = " fa fa - play - circle - o " > < / i > < / i > < / span > < span id = " deleteQuery " title = " Delete query " > < i class = " fa fa - minus - circle " > < / i > < / span > < / span > ' , a . hasOwnProperty ( " parameter " ) & & delete a . parameter , delete a . value } ) , this . myQueriesTableDesc . rows . sort ( a ) , _ . each ( this . queries , function ( a ) { a . hasOwnProperty ( " parameter " ) & & delete a . parameter , b . myQueriesTableDesc . rows . push ( { name : a . name , thirdRow : ' < span class = " spanWrapper " > < span id = " copyQuery " title = " Copy query " > < i class = " fa fa - copy " > < / i > < / span > < / span > ' } ) } ) , this . myQueriesTableDesc . unescaped = [ ! 1 , ! 0 , ! 0 ] , this . $ ( this . myQueriesId ) . html ( this . table . render ( { content : this . myQueriesTableDesc } ) ) } , listenKey : function ( a ) { 13 = = = a . keyCode & & " Update " = = = $ ( " # modalButton1 " ) . html ( ) & & this . saveAQL ( ) , this . checkSaveName ( ) } , addAQL : function ( ) { this . refreshAQL ( ! 0 ) , this . createCustomQueryModal ( ) , setTimeout ( function ( ) { $ ( " # new - query - name " ) . focus ( ) } , 500 ) } , updateAQL : function ( ) { var a = this . aqlEditor . getValue ( ) , b = $ ( " # lastQueryName " ) . html ( ) , c = this . collection . findWhere ( { name : b } ) ; if ( c ) { c . set ( " value " , a ) , c . set ( " parameter " , this . bindParamTableObj ) ; var d = function ( a ) { if ( a ) arangoHelper . arangoError ( " Query " , " Could not save query " ) ; else { var c = this ; arangoHelper . arangoNotification ( " Saved query " , ' " ' + b + ' " ' ) , this . collection . fetch ( { success : function ( ) { c . updateLocalQueries ( ) } } ) } } . bind ( this ) ; this . collection . saveCollectionQueries ( d ) } this . refreshAQL ( ! 0 ) } , createAQL : function ( ) { localStorage . setItem ( " lastOpenQuery " , void 0 ) , this . aqlEditor . setValue ( " " ) , this . refreshAQL ( ! 0 ) , this . breadcrumb ( ) , $ ( " # updateCurrentQuery " ) . hide ( ) } , createCustomQueryModal : function ( ) { var a = [ ] , b = [ ] ; b . push ( window . modalView . createTextEntry ( " new - query - name " , " Name " , " " , void 0 , void 0 , ! 1 , [ { rule : Joi . string ( ) . required ( ) , msg : " No query name given . " } ] ) ) , a . push ( window . modalView . createSuccessButton ( " Save " , this . saveAQL . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Save Query " , a , b , void 0 , void 0 , { " keyup # new - query - name " : this . listenKey . bind ( this ) } ) } , checkSaveName : function ( ) { var a = $ ( " # new - query - name " ) . val ( ) ; if ( " Insert Query " = = = a ) return void $ ( " # new - query - name " ) . val ( " " ) ; var b = this . customQueries . some ( function ( b ) { return b . name = = = a } ) ; b ? ( $ ( " # modalButton1 " ) . removeClass ( " button - success " ) , $ ( " # modalButton1 " ) . addClass ( " button - warning " ) , $ ( " # modalButton1 " ) . text ( " Update " ) ) : ( $ ( " # modalButton1 " ) . removeClass ( " button - warning " ) , $ ( " # modalButton1 " ) . addClass ( " button - success " ) , $ ( " # modalButton1 " ) . text ( " Save " ) ) } , saveAQL : function ( a ) { a & & a . stopPropagation ( ) , this . refreshAQL ( ) ; var b = $ ( " # new - query - name " ) . val ( ) , c = this . bindParamTableObj ; if ( ! $ ( " # new - query - name " ) . hasClass ( " invalid - input " ) & & " " ! = = b . trim ( ) ) { var d = this . aqlEditor . getValue ( ) , e = ! 1 ; if ( _ . each ( this . customQueries , function ( a ) { if ( a . name = = = b ) return a . value = d , void ( e = ! 0 ) } ) , e = = = ! 0 ) this . collection . findWhere ( { name : b } ) . set ( " value " , d ) ; else { if ( " " ! = = c & & void 0 ! = = c | | ( c = " { } " ) , " string " = = typeof c ) try { c = JSON . parse ( c ) } catch ( f ) { arangoHelper . arangoError ( " Query " , " Could not parse bind parameter " ) } this . collection . add ( { name : b , parameter : c , value : d } ) } var g = function ( a ) { if ( a ) arangoHelper . arangoError ( " Query " , " Could not save query " ) ; else { var c = this ; this . collection . fetch ( { success : function ( ) { c . updateLocalQueries ( ) , $ ( " # updateCurrentQuery " ) . show ( ) , c . breadcrumb ( b ) } } ) } } . bind ( this ) ; this . collection . saveCollectionQueries ( g ) , window . modalView . hide ( ) } } , breadcrumb : function ( a ) { window . setTimeout ( function ( ) { a ? $ ( " # subNavigationBar . breadcrumb " ) . html ( ' Query : < span id = " lastQueryName " > ' + a + " < / span > " ) : $ ( " # subNavigationBar . breadcrumb " ) . html ( " " ) } , 50 ) } , verifyQueryAndParams : function ( ) { var a = ! 1 ; 0 = = = this . aqlEditor . getValue ( ) . length & & ( arangoHelper . arangoError ( " Query " , " Your query is empty " ) , a = ! 0 ) ; var b = [ ] ; return _ . each ( this . bindParamTableObj , function ( c , d ) { " " = = = c & & ( a = ! 0 , b . push ( d ) ) } ) , b . length > 0 & & arangoHelper . arangoError ( " Bind Parameter " , JSON . stringify ( b ) + " not defined . " ) , a } , executeQuery : function ( a , b ) { this . verifyQueryAndParams ( ) | | ( $ ( " # outputEditorWrapper " + this . outputCounter ) . hide ( ) , $ ( " # outputEditorWrapper " + this . outputCounter ) . show ( " fast " ) , this . lastSentQueryString = this . aqlEditor . getValue ( ) , this . renderQueryResultBox ( this . outputCounter , b ) ) } , renderQueryResultBox : function ( a , b , c ) { this . $ ( this . outputDiv ) . prepend ( this . outputTemplate . render ( { counter : a , type : " Query " } ) ) ; var d = ace . edit ( " outputEditor " + a ) , e = ace . edit ( " sentQueryEditor " + a ) , f = ace . edit ( " sentBindParamEditor " + a ) ; e . getSession ( ) . setMode ( " ace / mode / aql " ) , e . setOption ( " vScrollBarAlwaysVisible " , ! 0 ) , e . setFontSize ( " 13px " ) , e . setReadOnly ( ! 0 ) , this . setEditorAutoHeight ( e ) , d . setFontSize ( " 13px " ) , d . getSession ( ) . setMode ( " ace / mode / json " ) , d . setReadOnly ( ! 0 ) , d . setOption ( " vScrollBarAlwaysVisible " , ! 0 ) , d . setShowPrintMargin ( ! 1 ) , this . setEditorAutoHeight ( d ) , f . setValue ( JSON . stringify ( this . bindParamTableObj ) , 1 ) , f . setOption ( " vScrollBarAlwaysVisible " , ! 0 ) , f . getSession ( ) . setMode ( " ace / mode / json " ) , f . setReadOnly ( ! 0 ) , this . setEditorAutoHeight ( f ) , c | | ( this . fillResult ( a , b ) , this . outputCounter + + ) } , readQueryData : function ( a , b ) { var c = $ ( " # querySize " ) , d = { id : " currentFrontendQuery " } ; if ( a ? d . query = this . aqlEditor . getSelectedText ( ) : d . query = this . aqlEditor . getValue ( ) , 0 = = = d . query . length ) a ? arangoHelper . arangoError ( " Query " , " Your query selection is empty ! " ) : arangoHelper . arangoError ( " Query " , " Your query is empty ! " ) , d = ! 1 ; else { " all " = = = c . val ( ) ? d . batchSize = 1e6 : d . batchSize = parseInt ( c . val ( ) , 10 ) ; var e = { } ; Object . keys ( this . bindParamTableObj ) . length > 0 & & ( _ . each ( this . bindParamTableObj , function ( a , b ) { d . query . indexOf ( b ) > - 1 & & ( e [ b ] = a ) } ) , d . bindVars = this . bindParamTableObj ) , Object . keys ( e ) . length > 0 & & ( d . bindVars = e ) , b & & ( d . options = { profile : ! 0 } ) } return JSON . stringify ( d ) } , fillResult : function ( a , b ) { var c = this , d = this . readQueryData ( b , ! 0 ) ; if ( " false " ! = = d & & d ) { var e = ace . edit ( " sentQueryEditor " + a ) ; e . setValue ( c . aqlEditor . getValue ( ) , 1 ) , $ . ajax ( { type : " POST " , url : arangoHelper . databaseUrl ( " / _api / cursor " ) , headers : { " x - arango - async " : " store " } , data : d , contentType : " application / json " , processData : ! 1 , success : function ( b , d , e ) { e . getResponseHeader ( " x - arango - async - id " ) & & c . queryCallbackFunction ( e . getResponseHeader ( " x - arango - async - id " ) , a ) , $ . noty . clearQueue ( ) , $ . noty . closeAll ( ) , c . handleResult ( a ) } , error : function ( b ) { try { var d = JSON . parse ( b . responseText ) ; arangoHelper . arangoError ( " [ " + d . errorNum + " ] " , d . errorMessage ) } catch ( e ) { arangoHelper . arangoError ( " Query error " , " ERROR " ) } c . handleResult ( a ) } } ) } } , handleResult : function ( ) { var a = this ; window . progressView . hide ( ) , $ ( " # removeResults " ) . show ( ) , window . setTimeout ( function ( ) { a . aqlEditor . focus ( ) } , 300 ) } , setEditorAutoHeight : function ( a ) { var b = $ ( " . centralRow " ) . height ( ) , c = ( b - 250 ) / 17 ; a . setOptions ( { maxLines : c , minLines : 10 } ) } , deselect : function ( a ) { var b = a . getSelection ( ) , c = b . lead . row , d = b . lead . column ; b . setSelectionRange ( { start : { row : c , column : d } , end : { row : c , column : d } } ) , a . focus ( ) } , warningsFunc : function ( a , b ) { var c = " " ; a . extra & & a . extra . warnings & & a . extra . warnings . length > 0 & & ( c + = " Warnings : \ r \ n \ r \ n " , a . extra . warnings . forEach ( function ( a ) { c + = " [ " + a . code + " ] , ' " + a . message + " ' \ r \ n " } ) ) , " " ! = = c & & ( c + = " \ r \ nResult : \ r \ n \ r \ n " ) , b . setValue ( c + JSON . stringify ( a . result , void 0 , 2 ) , 1 ) , b . getSession ( ) . setScrollTop ( 0 ) } , renderQueryResult : function ( a , b , c ) { var d = this ; if ( " # queries " = = = window . location . hash ) { var e , f = ace . edit ( " outputEditor " + b ) ; if ( ! a . msg ) { var g = d . analyseQuery ( a . result ) ; if ( " table " = = = g . defaultType ) { $ ( " # outputEditorWrapper " + b + " . arangoToolbarTop " ) . after ( ' < div id = " outputTable ' + b + ' " class = " outputTable " > < / div > ' ) , $ ( " # outputTable " + b ) . show ( ) , d . renderOutputTable ( g , b ) ; var h = $ ( " . centralRow " ) . height ( ) - 250 ; $ ( " . outputEditorWrapper . tableWrapper " ) . css ( " max - height " , h ) , $ ( " # outputEditor " + b ) . hide ( ) , e = ! 0 } else " graph " = = = g . defaultType & & ( $ ( " # outputEditorWrapper " + b + " . arangoToolbarTop " ) . after ( ' < div id = " outputGraph ' + b + ' " > < / div > ' ) , $ ( " # outputGraph " + b ) . show ( ) , e = d . renderOutputGraph ( g , b ) , e ? ( $ ( " # outputEditor " + b ) . hide ( ) , $ ( " # outputEditorWrapper " + b + " # copy2gV " ) . show ( ) , $ ( " # outputEditorWrapper " + b + " # copy2gV " ) . bind ( " click " , function ( ) { d . showResultInGraphViewer ( g , b ) } ) ) : $ ( " # outputGraph " + b ) . remove ( ) ) ; e ! = = ! 1 ? $ ( " # " + g . defaultType + " - switch " ) . addClass ( " active " ) . css ( " display " , " inline " ) : $ ( " # json - switch " ) . addClass ( " active " ) . css ( " display " , " inline " ) ; var i = function ( a , c , d ) { d | | ( d = " " ) , $ ( " # outputEditorWrapper " + b + " . arangoToolbarTop . pull - left " ) . append ( ' < span class = " ' + d + ' " > < i class = " fa ' + c + ' " > < / i > < i class = " iconText " > ' + a + " < / i > < / span > " ) } , j = " - " ; a & & a . extra & & a . extra . stats & & ( j = a . extra . stats . executionTime . toFixed ( 3 ) + " s " ) , i ( a . result . length + " elements " , " fa - calculator " ) , i ( j , " fa - clock - o " ) , a . extra & & ( a . extra . profile & & ( i ( " " , " fa - caret - down " ) , d . appendProfileDetails ( b , a . extra . profile ) ) , a . extra . stats & & ( a . extra . stats . writesExecuted > 0 | | a . extra . stats . writesIgnored > 0 ) & & ( i ( a . extra . stats . writesExecuted + " writes " , " fa - check - circle positive " ) , 0 = = = a . extra . stats . writesIgnored ? i ( a . extra . stats . writesIgnored + " writes ignored " , " fa - check - circle positive " , " additional " ) : i ( a . extra . stats . writesIgnored + " writes ignored " , " fa - exclamation - circle warning " , " additional " ) ) ) } $ ( " # outputEditorWrapper " + b + " . pull - left # spinner " ) . remove ( ) , $ ( " # outputEditorWrapper " + b + " # cancelCurrentQuery " ) . remove ( ) , d . warningsFunc ( a , f ) , window . progressView . hide ( ) , $ ( " # outputEditorWrapper " + b + " . switchAce " ) . show ( ) , $ ( " # outputEditorWrapper " + b + " . fa - close " ) . show ( ) , $ ( " # outputEditor " + b ) . css ( " opacity " , " 1 " ) , a . msg | | ( $ ( " # outputEditorWrapper " + b + " # downloadQueryResult " ) . show ( ) , $ ( " # outputEditorWrapper " + b + " # copy2aqlEditor " ) . show ( ) ) , d . setEditorAutoHeight ( f ) , d . deselect ( f ) , a . id & & $ . ajax ( { url : arangoHelper . databaseUrl ( " / _api / cursor / " + encodeURIComponent ( a . id ) ) , type : " DELETE " } ) , c | | ( d . cachedQueries [ b ] = a , this . cachedQueries [ b ] . sentQuery = d . aqlEditor . getValue ( ) ) , a . msg & & ( $ ( " # outputEditorWrapper " + b + " . toolbarType " ) . html ( " Explain " ) , f . setValue ( a . msg , 1 ) ) } else d . cachedQueries [ b ] = a , d . cachedQueries [ b ] . sentQuery = d . lastSentQueryString , arangoHelper . arangoNotification ( " Query finished " , " Return to queries view to see the result . " ) } , bindQueryResultButtons : function ( a , b ) { var c = this ; if ( a ) var d = function ( a , b ) { $ . ajax ( { url : arangoHelper . databaseUrl ( " / _api / job / " + encodeURIComponent ( a ) + " / cancel " ) , type : " PUT " , success : function ( ) { window . clearTimeout ( c . checkQueryTimer ) , $ ( " # outputEditorWrapper " + b ) . remove ( ) , arangoHelper . arangoNotification ( " Query " , " Query canceled . " ) } } ) } ; $ ( " # outputEditorWrapper " + b + " # cancelCurrentQuery " ) . bind ( " click " , function ( ) { d ( a , b ) } ) , $ ( " # outputEditorWrapper " + b + " # copy2aqlEditor " ) . bind ( " click " , function ( ) { $ ( " # toggleQueries1 " ) . is ( " : visible " ) | | c . toggleQueries ( ) ; var a = ace . edit ( " sentQueryEditor " + b ) . getValue ( ) , d = JSON . parse ( ace . edit ( " sentBindParamEditor " + b ) . getValue ( ) ) ; c . aqlEditor . setValue ( a , 1 ) , c . deselect ( c . aqlEditor ) , Object . keys ( d ) . length > 0 & & ( c . bindParamTableObj = d , c . setCachedQuery ( c . aqlEditor . getValue ( ) , JSON . stringify ( c . bindParamTableObj ) ) , $ ( " # bindParamEditor " ) . is ( " : visible " ) ? c . renderBindParamTable ( ) : ( c . bindParamAceEditor . setValue ( JSON . stringify ( d ) , 1 ) , c . deselect ( c . bindParamAceEditor ) ) ) , $ ( " . centralRow " ) . animate ( { scrollTop : 0 } , " fast " ) , c . resize ( ) } ) } , queryCallbackFunction : function ( a , b ) { var c = this ; this . bindQueryResultButtons ( a , b ) , this . execPending = ! 1 ; var d = function ( ) { $ . ajax ( { type : " PUT " , url : arangoHelper . databaseUrl ( " / _api / job / " + encodeURIComponent ( a ) ) , contentType : " application / json " , processData : ! 1 , success : function ( a , e , f ) { 201 = = = f . status ? ( c . renderQueryResult ( a , b ) , $ ( " . centralRow " ) . animate ( { scrollTop : $ ( " # queryContent " ) . height ( ) } , " fast " ) ) : 204 = = = f . status & & ( c . checkQueryTimer = window . setTimeout ( function ( ) { d ( ) } , 500 ) ) } , error : function ( a ) { var d ; try { if ( " Gone " = = = a . statusText ) return arangoHelper . arangoNotification ( " Query " , " Query execution aborted . " ) , void c . removeOutputEditor ( b ) ; d = JSON . parse ( a . responseText ) , arangoHelper . arangoError ( " Query " , d . errorMessage ) , d . errorMessage & & ( null ! = = d . errorMessage . match ( / \ d + : \ d + / g ) ? c . markPositionError ( d . errorMessage . match ( / ' . * ' / g ) [ 0 ] , d . errorMessage . match ( / \ d + : \ d + / g ) [ 0 ] ) : c . markPositionError ( d . errorMessage . match ( / \ ( \ w + \ ) / g ) [ 0 ] ) , c . removeOutputEditor ( b ) ) } catch ( e ) { if ( c . removeOutputEditor ( b ) , 409 = = = d . code ) return ; 400 ! = = d . code & & 404 ! = = d . code & & 500 ! = = d . code & & arangoHelper . arangoNotification ( " Query " , " Successfully aborted . " ) } window . progressView . hide ( ) } } ) } ; d ( ) } , appendProfileDetails : function ( a , b ) { var c = " # outputEditorWrapper " + a ; $ ( c + " . fa - caret - down " ) . first ( ) . on ( " click " , function ( ) { var d = $ ( c ) . find ( " . queryProfile " ) ; if ( $ ( d ) . is ( " : visible " ) ) $ ( c ) . find ( " . queryProfile " ) . remove ( ) ; else { $ ( c ) . append ( ' < div class = " queryProfile " counter = " ' + a + ' " > < / div > ' ) ; var e = $ ( c + " . queryProfile " ) . first ( ) ; e . hide ( ) , e . css ( " position " , " absolute " ) . css ( " left " , 215 ) . css ( " top " , 55 ) ; var f = 590 , g = [ " A " , " B " , " C " , " D " , " E " , " F " , " G " ] , h = [ " rgb ( 48 , 125 , 153 ) " , " rgb ( 241 , 124 , 176 ) " , " rgb ( 137 , 110 , 37 ) " , " rgb ( 93 , 165 , 218 ) " , " rgb ( 250 , 164 , 58 ) " , " rgb ( 64 , 74 , 83 ) " , " rgb ( 96 , 189 , 104 ) " ] , i = [ " startup time for query engine " , " query parsing " , " abstract syntax tree optimizations " , " loading collections " , " instanciation of initial execution plan " , " execution plan optimization and permutation " , " query execution " ] ; e . append ( ' < i class = " fa fa - close closeProfile " > < / i > < span class = " profileHeader " > Profiling information < / span > < div class = " pure - g pure - table pure - table - body " > < / div > < div class = " prof - progress " > < / div > < div class = " prof - progress - label " > < / div > < div class = " clear " > < / div > ' ) ; var j = 0 ; _ . each ( b , function ( a ) { j + = 1e3 * a } ) ; var k , l = 0 , m = 0 ; _ . each ( b , function ( a , b ) { var c = numeral ( 1e3 * a ) . format ( " 0 . 000 " ) ; c + = " ms " , e . find ( " . pure - g " ) . append ( ' < div class = " pure - table - row noHover " > < div class = " pure - u - 1 - 24 left " > < p class = " bold " style = " background : ' + h [ l ] + ' " > ' + g [ l ] + ' < / p > < / div > < div class = " pure - u - 4 - 24 left " > ' + c + ' < / div > < div class = " pure - u - 6 - 24 left " > ' + b + ' < / div > < div class = " pure - u - 13 - 24 left " > ' + i [ l ] + " < / div > < / div > " ) , k = Math . floor ( 1e3 * a / j * 100 ) , 0 = = = k & & ( k = 1 , m + + ) , 6 ! = = l ? ( e . find ( " . prof - progress " ) . append ( ' < div style = " width : ' + k + " % ; background - color : " + h [ l ] + ' " > < / div > ' ) , k > 1 ? e . find ( " . prof - progress - label " ) . append ( ' < div style = " width : ' + k + ' % ; " > ' + g [ l ] + " < / div > " ) : e . find ( " . prof - progress - label " ) . append ( ' < div style = " width : ' + k + ' % ; font - size : 9px " > ' + g [ l ] + " < / div > " ) ) : ( m > 0 & & ( k - = m ) , e . find ( " . prof - progress " ) . append ( ' < div style = " width : ' + k + " % ; background - color : " + h [ l ] + ' " > < / div > ' ) , k > 1 ? e . find ( " . prof - progress - label " ) . append ( ' < div style = " width : ' + k + ' % ; " > ' + g [ l ] + " < / div > " ) : e . find ( " . prof - progress - label " ) . append ( ' < div style = " width : ' + k + ' % ; font - size : 9px " > ' + g [ l ] + " < / div > " ) ) , l + + } ) , e . width ( f ) , e . height ( " auto " ) , e . fadeIn ( " fast " ) } } ) } , analyseQuery : function ( a ) { var b = { defaultType : null , original : a , modified : null } , c = ! 1 ; if ( ! Array . isArray ( a ) ) return b . defaultType = " json " , b ; if ( a [ 0 ] ) if ( a [ 0 ] . vertices & & a [ 0 ] . edges ) { var d = 0 , e = 0 ; _ . each ( a , function ( a ) { a . edges & & _ . each ( a . edges , function ( a ) { null ! = = a & & ( a . _from & & a . _to & & d + + , e + + ) } ) } ) ; var f = 0 ; e > 0 & & ( f = d / e * 100 ) , f > = 95 & & ( c = ! 0 , b . defaultType = " graph " , b . graphInfo = " object " ) } else { var g = 0 , h = a . length ; _ . each ( a , function ( a ) { a . _from & & a . _to & & a . _id & & g + + } ) ; var i = 0 ; h > 0 & & ( i = g / h * 100 ) , i > = 95 & & ( c = ! 0 , b . defaultType = " graph " , b . graphInfo = " array " ) } if ( ! c ) { var j = ! 0 , k = { } ; if ( a . length < = 1 & & ( j = ! 1 ) , j ) { _ . each ( a , function ( a ) { " object " ! = typeof a | | null = = = a | | Array . isArray ( a ) | | _ . each ( a , function ( a , b ) { k . hasOwnProperty ( b ) ? + + k [ b ] : k [ b ] = 1 } ) } ) ; var l = 0 ; _ . each ( k , function ( b , c ) { j ! = = ! 1 & & ( l = b / a . length * 100 , l < = 95 & & ( j = ! 1 ) ) } ) , l < = 95 & & ( j = ! 1 ) } j & & ( c = ! 0 , b . defaultType = " table " ) } return c | | ( b . defaultType = " json " ) , b } , markPositionError : function ( a , b ) { var c ; b & & ( c = b . split ( " : " ) [ 0 ] , a = a . substr ( 1 , a . length - 2 ) ) ; var d = this . aqlEditor . find ( a ) ; ! d & & b & & ( this . aqlEditor . selection . moveCursorToPosition ( { row : c , column : 0 } ) , this . aqlEditor . selection . selectLine ( ) ) , window . setTimeout ( function ( ) { $ ( " . ace_start " ) . first ( ) . css ( " background " , " rgba ( 255 , 129 , 129 , 0 . 7 ) " ) } , 100 ) } , refreshAQL : function ( ) { var a = this , b = function ( b ) { b ? arangoHelper . arangoError ( " Query " , " Could not reload Queries " ) : ( a . updateLocalQueries ( ) , a . updateQueryTable ( ) ) } , c = function ( ) { a . getSystemQueries ( b ) } ; this . getAQL ( c ) } , getSystemQueries : function ( a ) { var b = this ; $ . ajax ( { type : " GET " , cache : ! 1 , url : " js / arango / aqltemplates . json " , contentType : " application / json " , processData : ! 1 , success : function ( c ) { a & & a ( ! 1 ) , b . queries = c } , error : function ( ) { a & & a ( ! 0 ) , arangoHelper . arangoNotification ( " Query " , " Error while loading system templates " ) } } ) } , updateLocalQueries : function ( ) { var a = this ; this . customQueries = [ ] , this . collection . each ( function ( b ) { a . customQueries . push ( { name : b . get ( " name " ) , value : b . get ( " value " ) , parameter : b . get ( " parameter " ) } ) } ) } , renderOutputTable : function ( a , b ) { var c = { id : " outputTableData " + b , titles : [ ] , rows : [ ] } , d = ! 0 , e = [ ] ; _ . each ( a . original , function ( a ) { d = = = ! 0 & & ( c . titles = Object . keys ( a ) , d = ! 1 ) , _ . each ( a , function ( a ) { " object " = = typeof a & & ( a = JSON . stringify ( a ) ) , e . push ( a ) } ) , c . rows . push ( e ) , e = [ ] } ) , $ ( " # outputTable " + b ) . append ( this . table . render ( { content : c } ) ) } , renderOutputGraph : function ( a , b ) { this . graphViewers [ b ] = new window . GraphViewer ( { name : void 0 , documentStore : window . App . arangoDocumentStore , collection : new window . GraphCollection , userConfig : window . App . userConfig , id : " # outputGraph " + b , data : a } ) ; var c = this . graphViewers [ b ] . renderAQLPreview ( ) ; return c } , showResultInGraphViewer : function ( a , b ) { window . location . hash = " # aql_graph " , window . App . graphViewer & & ( window . App . graphViewer . graphSettingsView & & window . App . graphViewer . graphSettingsView . remove ( ) , window . App . graphViewer . remove ( ) ) , window . App . graphViewer = new window . GraphViewer ( { name : void 0 , documentStore : window . App . arangoDocumentStore , collection : new window . GraphCollection , userConfig : window . App . userConfig , noDefinedGraph : ! 0 , data : a } ) , window . App . graphViewer . renderAQL ( ) } , getAQL : function ( a ) { var b = this ; this . collection . fetch ( { success : function ( ) { b . getCachedQueryAfterRender ( ) ; var c = localStorage . getItem ( " customQueries " ) ; if ( c ) { var d = JSON . parse ( c ) ; _ . each ( d , function ( a ) { b . collection . add ( { value : a . value , name : a . name } ) } ) ; var e = function ( a ) { a ? arangoHelper . arangoError ( " Custom Queries " , " Could not import old local storage queries " ) : localStorage . removeItem ( " customQueries " ) } ; b . collection . saveCollectionQueries ( e ) } b . updateLocalQueries ( ) , a & & a ( ) } } ) } } ) } ( ) , function ( ) { " use strict " ; window . ScaleView = Backbone . View . extend ( { el : " # content " , template : templateEngine . createTemplate ( " scaleView . ejs " ) , interval : 1e4 , knownServers : [ ] , events : { " click # addCoord " : " addCoord " , " click # removeCoord " : " removeCoord " , " click # addDBs " : " addDBs " , " click # removeDBs " : " removeDBs " } , setCoordSize : function ( a ) { var b = this , c = { numberOfCoordinators : a } ; $ . ajax ( { type : " PUT " , url : arangoHelper . databaseUrl ( " / _admin / cluster / numberOfServers " ) , contentType : " application / json " , data : JSON . stringify ( c ) , success : function ( ) { b . updateTable ( c ) } , error : function ( ) { arangoHelper . arangoError ( " Scale " , " Could not set coordinator size . " ) } } ) } , setDBsSize : function ( a ) { var b = this , c = { numberOfDBServers : a } ; $ . ajax ( { type : " PUT " , url : arangoHelper . databaseUrl ( " / _admin / cluster / numberOfServers " ) , contentType : " application / json " , data : JSON . stringify ( c ) , success : function ( ) { b . updateTable ( c ) } , error : function ( ) { arangoHelper . arangoError ( " Scale " , " Could not set coordinator size . " ) } } ) } , addCoord : function ( ) { this . setCoordSize ( this . readNumberFromID ( " # plannedCoords " , ! 0 ) ) } , removeCoord : function ( ) { this . setCoordSize ( this . readNumberFromID ( " # plannedCoords " , ! 1 , ! 0 ) ) } , addDBs : function ( ) { this . setDBsSize ( this . readNumberFromID ( " # plannedDBs " , ! 0 ) ) } , removeDBs : function ( ) { this . setDBsSize ( this . readNumberFromID ( " # plannedDBs " , ! 1 , ! 0 ) ) } , readNumberFromID : function ( a , b , c ) { var d = $ ( a ) . html ( ) , e = ! 1 ; try { e = JSON . parse ( d ) } catch ( f ) { } return b & & e + + , c & & 1 ! = = e & & e - - , e } , initialize : function ( a ) { var b = this ; clearInterval ( this . intervalFunction ) , window . App . isCluster & & ( this . dbServers = a . dbServers , this . coordinators = a . coordinators , this . updateServerTime ( ) , this . intervalFunction = window . setInterval ( function ( ) { " # sNodes " = = = window . location . hash & & b . coordinators . fetch ( { success : function ( ) { b . dbServers . fetch ( { success : function ( ) { b . continueRender ( ! 0 ) } } ) } } ) } , this . interval ) ) } , render : function ( ) { var a = this , b = function ( ) { var b = function ( ) { a . continueRender ( ) } ; this . waitForDBServers ( b ) } . bind ( this ) ; this . initDoneCoords ? b ( ) : this . waitForCoordinators ( b ) , window . arangoHelper . buildNodesSubNav ( " scale " ) } , continueRender : function ( a ) { var b , c , d = this ; b = this . coordinators . toJSON ( ) , c = this . dbServers . toJSON ( ) , this . $ el . html ( this . template . render ( { runningCoords : b . length , runningDBs : c . length , plannedCoords : void 0 , plannedDBs : void 0 , initialized : a } ) ) , $ . ajax ( { type : " GET " , cache : ! 1 , url : arangoHelper . databaseUrl ( " / _admin / cluster / numberOfServers " ) , contentType : " application / json " , processData : ! 1 , success : function ( a ) { d . updateTable ( a ) } } ) } , updateTable : function ( a ) { var b = ' < span class = " warning " > scaling in progress < i class = " fa fa - circle - o - notch fa - spin " > < / i > < / span > ' , c = ' < span class = " positive " > no scaling process active < / span > ' ; a . numberOfCoordinators & & ( $ ( " # plannedCoords " ) . html ( a . numberOfCoordinators ) , this . coordinators . toJSON ( ) . length = = = a . numberOfCoordinators ? $ ( " # statusCoords " ) . html ( c ) : $ ( " # statusCoords " ) . html ( b ) ) , a . numberOfDBServers & & ( $ ( " # plannedDBs " ) . html ( a . numberOfDBServers ) , this . dbServers . toJSON ( ) . length = = = a . numberOfDBServers ? $ ( " # statusDBs " ) . html ( c ) : $ ( " # statusDBs " ) . html ( b ) ) } , waitForDBServers : function ( a ) { var b = this ; 0 = = = this . dbServers . length ? window . setInterval ( function ( ) { b . waitForDBServers ( a ) } , 300 ) : a ( ) } , waitForCoordinators : function ( a ) { var b = this ; window . setTimeout ( function ( ) { 0 = = = b . coordinators . length ? b . waitForCoordinators ( a ) : ( b . initDoneCoords = ! 0 , a ( ) ) } , 200 ) } , updateServerTime : function ( ) { this . serverTime = ( new Date ) . getTime ( ) } } ) } ( ) , function ( ) { " use strict " ; window . SettingsView = Backbone . View . extend ( { el : " # content " , initialize : function ( a ) { this . collectionName = a . collectionName , this . model = this . collection } , events : { } , render : function ( ) { this . breadcrumb ( ) , window . arangoHelper . buildCollectionSubNav ( this . collectionName , " Settings " ) , this . renderSettings ( ) } , breadcrumb : function ( ) { $ ( " # subNavigationBar . breadcrumb " ) . html ( " Collection : " + this . collectionName ) } , unloadCollection : function ( ) { var a = function ( a ) { a ? arangoHelper . arangoError ( " Collection error " , this . model . get ( " name " ) + " could not be unloaded . " ) : void 0 = = = a ? ( this . model . set ( " status " , " unloading " ) , this . render ( ) ) : " # collections " = = = window . location . hash ? ( this . model . set ( " status " , " unloaded " ) , this . render ( ) ) : arangoHelper . arangoNotification ( " Collection " + this . model . get ( " name " ) + " unloaded . " ) } . bind ( this ) ; this . model . unloadCollection ( a ) , window . modalView . hide ( ) } , loadCollection : function ( ) { var a = function ( a ) { a ? arangoHelper . arangoError ( " Collection error " , this . model . get ( " name " ) + " could not be loaded . " ) : void 0 = = = a ? ( this . model . set ( " status " , " loading " ) , this . render ( ) ) : " # collections " = = = window . location . hash ? ( this . model . set ( " status " , " loaded " ) , this . render ( ) ) : arangoHelper . arangoNotification ( " Collection " + this . model . get ( " name " ) + " loaded . " ) } . bind ( this ) ; this . model . loadCollection ( a ) , window . modalView . hide ( ) } , truncateCollection : function ( ) { this . model . truncateCollection ( ) , $ ( " . modal - delete - confirmation " ) . hide ( ) , window . modalView . hide ( ) } , deleteCollection : function ( ) { this . model . destroy ( { error : function ( ) { arangoHelper . arangoError ( " Could not delete collection . " ) } , success : function ( ) { window . App . navigate ( " # collections " , { trigger : ! 0 } ) } } ) } , saveModifiedCollection : function ( ) { var a = function ( a , b ) { if ( a ) arangoHelper . arangoError ( " Error " , " Could not get coordinator info " ) ; else { var c ; c = b ? this . model . get ( " name " ) : $ ( " # change - collection - name " ) . val ( ) ; var d = this . model . get ( " status " ) ; if ( " loaded " = = = d ) { var e ; try { e = JSON . parse ( 1024 * $ ( " # change - collection - size " ) . val ( ) * 1024 ) } catch ( f ) { return arangoHelper . arangoError ( " Please enter a valid number " ) , 0 } var g ; try { if ( g = JSON . parse ( $ ( " # change - index - buckets " ) . val ( ) ) , g < 1 | | parseInt ( g , 10 ) ! = = Math . pow ( 2 , Math . log2 ( g ) ) ) throw new Error ( " invalid indexBuckets value " ) } catch ( f ) { return arangoHelper . arangoError ( " Please enter a valid number of index buckets " ) , 0 } var h = function ( a ) { a ? arangoHelper . arangoError ( " Collection error : " + a . responseText ) : ( arangoHelper . arangoNotification ( " Collection : Successfully changed . " ) , window . App . navigate ( " # cSettings / " + c , { trigger : ! 0 } ) ) } , i = function ( a ) { if ( a ) arangoHelper . arangoError ( " Collection error : " + a . responseText ) ; else { var b = $ ( " # change - collection - sync " ) . val ( ) ; this . model . changeCollection ( b , e , g , h ) } } . bind ( this ) ; frontendConfig . isCluster = = = ! 1 ? this . model . renameCollection ( c , i ) : i ( ) } else if ( " unloaded " = = = d ) if ( this . model . get ( " name " ) ! = = c ) { var j = function ( a , b ) { a ? arangoHelper . arangoError ( " Collection " + b . responseText ) : ( arangoHelper . arangoNotification ( " CollectionSuccessfully changed . " ) , window . App . navigate ( " # cSettings / " + c , { trigger : ! 0 } ) ) } ; frontendConfig . isCluster = = = ! 1 ? this . model . renameCollection ( c , j ) : j ( ) } else window . modalView . hide ( ) } } . bind ( this ) ; window . isCoordinator ( a ) } , renderSettings : function ( ) { var a = function ( a , b ) { if ( a ) arangoHelper . arangoError ( " Error " , " Could not get coordinator info " ) ; else { var c = ! 1 ; " loaded " = = = this . model . get ( " status " ) & & ( c = ! 0 ) ; var d = [ ] , e = [ ] ; b | | e . push ( window . modalView . createTextEntry ( " change - collection - name " , " Name " , this . model . get ( " name " ) , ! 1 , " " , ! 0 , [ { rule : Joi . string ( ) . regex ( / ^ [ a - zA - Z ] / ) , msg : " Collection name must always start with a letter . " } , { rule : Joi . string ( ) . regex ( / ^ [ a - zA - Z0 - 9 \ - _ ] * $ / ) , msg : ' Only Symbols " _ " and " - " are allowed . ' } , { rule : Joi . string ( ) . required ( ) , msg : " No collection name given . " } ] ) ) ; var f = function ( ) { e . push ( window . modalView . createReadOnlyEntry ( " change - collection - id " , " ID " , this . model . get ( " id " ) , " " ) ) , e . push ( window . modalView . createReadOnlyEntry ( " change - collection - type " , " Type " , this . model . get ( " type " ) , " " ) ) , e . push ( window . modalView . createReadOnlyEntry ( " change - collection - status " , " Status " , this . model . get ( " status " ) , " " ) ) , d . push ( window . modalView . createDeleteButton ( " Delete " , this . deleteCollection . bind ( this ) ) ) , d . push ( window . modalView . createDeleteButton ( " Truncate " , this . truncateCollection . bind ( this ) ) ) , <nl> - c ? d . push ( window . modalView . createNotificationButton ( " Unload " , this . unloadCollection . bind ( this ) ) ) : d . push ( window . modalView . createNotificationButton ( " Load " , this . loadCollection . bind ( this ) ) ) , d . push ( window . modalView . createSuccessButton ( " Save " , this . saveModifiedCollection . bind ( this ) ) ) ; var a = [ " General " , " Indexes " ] , b = [ " modalTable . ejs " , " indicesView . ejs " ] ; window . modalView . show ( b , " Modify Collection " , d , e , null , null , this . events , null , a , " content " ) , $ ( $ ( " # infoTab " ) . children ( ) [ 1 ] ) . remove ( ) } . bind ( this ) ; if ( c ) { var g = function ( a , b ) { if ( a ) arangoHelper . arangoError ( " Collection " , " Could not fetch properties " ) ; else { var c = b . journalSize / 1048576 , d = b . indexBuckets , g = b . waitForSync ; e . push ( window . modalView . createTextEntry ( " change - collection - size " , " Journal size " , c , " The maximal size of a journal or datafile ( in MB ) . Must be at least 1 . " , " " , ! 0 , [ { rule : Joi . string ( ) . allow ( " " ) . optional ( ) . regex ( / ^ [ 0 - 9 ] * $ / ) , msg : " Must be a number . " } ] ) ) , e . push ( window . modalView . createTextEntry ( " change - index - buckets " , " Index buckets " , d , " The number of index buckets for this collection . Must be at least 1 and a power of 2 . " , " " , ! 0 , [ { rule : Joi . string ( ) . allow ( " " ) . optional ( ) . regex ( / ^ [ 1 - 9 ] [ 0 - 9 ] * $ / ) , msg : " Must be a number greater than 1 and a power of 2 . " } ] ) ) , e . push ( window . modalView . createSelectEntry ( " change - collection - sync " , " Wait for sync " , g , " Synchronize to disk before returning from a create or update of a document . " , [ { value : ! 1 , label : " No " } , { value : ! 0 , label : " Yes " } ] ) ) } f ( ) } ; this . model . getProperties ( g ) } else f ( ) } } . bind ( this ) ; window . isCoordinator ( a ) } } ) } ( ) , function ( ) { " use strict " ; window . ShardsView = Backbone . View . extend ( { el : " # content " , template : templateEngine . createTemplate ( " shardsView . ejs " ) , interval : 1e4 , knownServers : [ ] , events : { " click # shardsContent . shardLeader span " : " moveShard " , " click # shardsContent . shardFollowers span " : " moveShardFollowers " , " click # rebalanceShards " : " rebalanceShards " } , initialize : function ( a ) { var b = this ; b . dbServers = a . dbServers , clearInterval ( this . intervalFunction ) , window . App . isCluster & & ( this . updateServerTime ( ) , this . intervalFunction = window . setInterval ( function ( ) { " # shards " = = = window . location . hash & & b . render ( ! 1 ) } , this . interval ) ) } , render : function ( a ) { if ( " # shards " = = = window . location . hash ) { var b = this ; $ . ajax ( { type : " GET " , cache : ! 1 , url : arangoHelper . databaseUrl ( " / _admin / cluster / shardDistribution " ) , contentType : " application / json " , processData : ! 1 , async : ! 0 , success : function ( a ) { var c = ! 1 ; b . shardDistribution = a . results , _ . each ( a . results , function ( a , b ) { " error " ! = = b & & " code " ! = = b & & ( " _ " ! = = b . substring ( 0 , 1 ) & & ( c = ! 0 ) , ( b . startsWith ( " _local_ " ) | | b . startsWith ( " _to_ " ) | | b . startsWith ( " _from_ " ) ) & & ( c = ! 0 ) ) } ) , c ? b . continueRender ( a . results ) : arangoHelper . renderEmpty ( " No collections and no shards available " ) } , error : function ( a ) { 0 ! = = a . readyState & & arangoHelper . arangoError ( " Cluster " , " Could not fetch sharding information . " ) } } ) , a ! = = ! 1 & & arangoHelper . buildNodesSubNav ( " Shards " ) } } , moveShardFollowers : function ( a ) { var b = $ ( a . currentTarget ) . html ( ) ; this . moveShard ( a , b ) } , moveShard : function ( a , b ) { var c , d , e , f , g = this , h = window . App . currentDB . get ( " name " ) ; d = $ ( a . currentTarget ) . parent ( ) . parent ( ) . attr ( " collection " ) , e = $ ( a . currentTarget ) . parent ( ) . parent ( ) . attr ( " shard " ) , b ? ( f = $ ( a . currentTarget ) . parent ( ) . parent ( ) . attr ( " leader " ) , c = b ) : c = $ ( a . currentTarget ) . parent ( ) . parent ( ) . attr ( " leader " ) ; var i = [ ] , j = [ ] , k = { } , l = [ ] ; g . dbServers [ 0 ] . fetch ( { success : function ( ) { return g . dbServers [ 0 ] . each ( function ( a ) { a . get ( " name " ) ! = = c & & ( k [ a . get ( " name " ) ] = { value : a . get ( " name " ) , label : a . get ( " name " ) } ) } ) , _ . each ( g . shardDistribution [ d ] . Plan [ e ] . followers , function ( a ) { delete k [ a ] } ) , b & & delete k [ f ] , _ . each ( k , function ( a ) { l . push ( a ) } ) , l = l . reverse ( ) , 0 = = = l . length ? void arangoHelper . arangoMessage ( " Shards " , " No database server for moving the shard is available . " ) : ( j . push ( window . modalView . createSelectEntry ( " toDBServer " , " Destination " , void 0 , " Please select the target database server . The selected database server will be the new leader of the shard . " , l ) ) , i . push ( window . modalView . createSuccessButton ( " Move " , g . confirmMoveShards . bind ( this , h , d , e , c ) ) ) , void window . modalView . show ( " modalTable . ejs " , " Move shard : " + e , i , j ) ) } } ) } , confirmMoveShards : function ( a , b , c , d ) { var e = $ ( " # toDBServer " ) . val ( ) , f = { database : a , collection : b , shard : c , fromServer : d , toServer : e } ; $ . ajax ( { type : " POST " , cache : ! 1 , url : arangoHelper . databaseUrl ( " / _admin / cluster / moveShard " ) , contentType : " application / json " , processData : ! 1 , data : JSON . stringify ( f ) , async : ! 0 , success : function ( a ) { a . id & & ( arangoHelper . arangoNotification ( " Shard " + c + " will be moved to " + e + " . " ) , window . setTimeout ( function ( ) { window . App . shardsView . render ( ) } , 2e3 ) ) } , error : function ( ) { arangoHelper . arangoError ( " Shard " + c + " could not be moved to " + e + " . " ) } } ) , window . modalView . hide ( ) } , rebalanceShards : function ( ) { var a = this ; $ . ajax ( { type : " POST " , cache : ! 1 , url : arangoHelper . databaseUrl ( " / _admin / cluster / rebalanceShards " ) , contentType : " application / json " , processData : ! 1 , data : JSON . stringify ( { } ) , async : ! 0 , success : function ( b ) { b = = = ! 0 & & ( window . setTimeout ( function ( ) { a . render ( ! 1 ) } , 1500 ) , arangoHelper . arangoNotification ( " Started rebalance process . " ) ) } , error : function ( ) { arangoHelper . arangoError ( " Could not start rebalance process . " ) } } ) , window . modalView . hide ( ) } , continueRender : function ( a ) { var b = this ; delete a . code , delete a . error , _ . each ( a , function ( b , c ) { var d = { Plan : { } , Current : { } } ; if ( c . startsWith ( " _local_ " ) ) { var e = c . substr ( 7 , c . length - 1 ) , f = [ " _local_ " + e , " _from_ " + e , " _to_ " + e , e ] , g = 0 ; _ . each ( f , function ( b , c ) { _ . each ( a [ f [ g ] ] . Current , function ( a , b ) { d . Current [ b ] = a } ) , _ . each ( a [ f [ g ] ] . Plan , function ( a , b ) { d . Plan [ b ] = a } ) , delete a [ f [ g ] ] , a [ e ] = d , g + + } ) } } ) ; var c = { } ; Object . keys ( a ) . sort ( ) . forEach ( function ( b ) { c [ b ] = a [ b ] } ) , this . $ el . html ( this . template . render ( { collections : c } ) ) ; var d = ! 1 ; _ . each ( a , function ( a ) { _ . each ( a . Plan , function ( a , b ) { a . progress & & ( d = ! 0 ) } ) } ) , d & & window . setTimeout ( function ( ) { b . render ( ) } , 1500 ) } , updateServerTime : function ( ) { this . serverTime = ( new Date ) . getTime ( ) } } ) } ( ) , function ( ) { " use strict " ; window . ShowClusterView = Backbone . View . extend ( { detailEl : " # modalPlaceholder " , el : " # content " , defaultFrame : 12e5 , template : templateEngine . createTemplate ( " showCluster . ejs " ) , modal : templateEngine . createTemplate ( " waitModal . ejs " ) , detailTemplate : templateEngine . createTemplate ( " detailView . ejs " ) , events : { " change # selectDB " : " updateCollections " , " change # selectCol " : " updateShards " , " click . dbserver . success " : " dashboard " , " click . coordinator . success " : " dashboard " } , replaceSVGs : function ( ) { $ ( " . svgToReplace " ) . each ( function ( ) { var a = $ ( this ) , b = a . attr ( " id " ) , c = a . attr ( " src " ) ; $ . get ( c , function ( c ) { var d = $ ( c ) . find ( " svg " ) ; d . attr ( " id " , b ) . attr ( " class " , " icon " ) . removeAttr ( " xmlns : a " ) , a . replaceWith ( d ) } , " xml " ) } ) } , updateServerTime : function ( ) { this . serverTime = ( new Date ) . getTime ( ) } , setShowAll : function ( ) { this . graphShowAll = ! 0 } , resetShowAll : function ( ) { this . graphShowAll = ! 1 , this . renderLineChart ( ) } , initialize : function ( a ) { this . options = a , this . interval = 1e4 , this . isUpdating = ! 1 , this . timer = null , this . knownServers = [ ] , this . graph = void 0 , this . graphShowAll = ! 1 , this . updateServerTime ( ) , this . dygraphConfig = this . options . dygraphConfig , this . dbservers = new window . ClusterServers ( [ ] , { interval : this . interval } ) , this . coordinators = new window . ClusterCoordinators ( [ ] , { interval : this . interval } ) , this . documentStore = new window . ArangoDocuments , this . statisticsDescription = new window . StatisticsDescription , this . statisticsDescription . fetch ( { async : ! 1 } ) , this . dbs = new window . ClusterDatabases ( [ ] , { interval : this . interval } ) , this . cols = new window . ClusterCollections , this . shards = new window . ClusterShards , this . startUpdating ( ) } , listByAddress : function ( a ) { var b = { } , c = this ; this . dbservers . byAddress ( b , function ( b ) { c . coordinators . byAddress ( b , a ) } ) } , updateCollections : function ( ) { var a = this , b = $ ( " # selectCol " ) , c = $ ( " # selectDB " ) . find ( " : selected " ) . attr ( " id " ) ; if ( c ) { var d = b . find ( " : selected " ) . attr ( " id " ) ; b . html ( " " ) , this . cols . getList ( c , function ( c ) { _ . each ( _ . pluck ( c , " name " ) , function ( a ) { b . append ( ' < option id = " ' + a + ' " > ' + a + " < / option > " ) } ) ; var e = $ ( " # " + d , b ) ; 1 = = = e . length & & e . prop ( " selected " , ! 0 ) , a . updateShards ( ) } ) } } , updateShards : function ( ) { var a = $ ( " # selectDB " ) . find ( " : selected " ) . attr ( " id " ) , b = $ ( " # selectCol " ) . find ( " : selected " ) . attr ( " id " ) ; this . shards . getList ( a , b , function ( a ) { $ ( " . shardCounter " ) . html ( " 0 " ) , _ . each ( a , function ( a ) { $ ( " # " + a . server + " Shards " ) . html ( a . shards . length ) } ) } ) } , updateServerStatus : function ( a ) { var b = this , c = function ( a , b , c ) { var d , e , f = c ; f = f . replace ( / \ . / g , " - " ) , f = f . replace ( / : / g , " _ " ) , e = $ ( " # id " + f ) , e . length < 1 | | ( d = e . attr ( " class " ) . split ( / \ s + / ) [ 1 ] , e . attr ( " class " , a + " " + d + " " + b ) , " coordinator " = = = a & & ( " success " = = = b ? $ ( " . button - gui " , e . closest ( " . tile " ) ) . toggleClass ( " button - gui - disabled " , ! 1 ) : $ ( " . button - gui " , e . closest ( " . tile " ) ) . toggleClass ( " button - gui - disabled " , ! 0 ) ) ) } ; this . coordinators . getStatuses ( c . bind ( this , " coordinator " ) , function ( ) { b . dbservers . getStatuses ( c . bind ( b , " dbserver " ) ) , a ( ) } ) } , updateDBDetailList : function ( ) { var a = this , b = $ ( " # selectDB " ) , c = b . find ( " : selected " ) . attr ( " id " ) ; b . html ( " " ) , this . dbs . getList ( function ( d ) { _ . each ( _ . pluck ( d , " name " ) , function ( a ) { b . append ( ' < option id = " ' + a + ' " > ' + a + " < / option > " ) } ) ; var e = $ ( " # " + c , b ) ; 1 = = = e . length & & e . prop ( " selected " , ! 0 ) , a . updateCollections ( ) } ) } , rerender : function ( ) { var a = this ; this . updateServerStatus ( function ( ) { a . getServerStatistics ( function ( ) { a . updateServerTime ( ) , a . data = a . generatePieData ( ) , a . renderPieChart ( a . data ) , a . renderLineChart ( ) , a . updateDBDetailList ( ) } ) } ) } , render : function ( ) { this . knownServers = [ ] , delete this . hist ; var a = this ; this . listByAddress ( function ( b ) { 1 = = = Object . keys ( b ) . length ? a . type = " testPlan " : a . type = " other " , a . updateDBDetailList ( ) , a . dbs . getList ( function ( c ) { $ ( a . el ) . html ( a . template . render ( { dbs : _ . pluck ( c , " name " ) , byAddress : b , type : a . type } ) ) , $ ( a . el ) . append ( a . modal . render ( { } ) ) , a . replaceSVGs ( ) , a . getServerStatistics ( function ( ) { a . data = a . generatePieData ( ) , a . renderPieChart ( a . data ) , a . renderLineChart ( ) , a . updateDBDetailList ( ) , a . startUpdating ( ) } ) } ) } ) } , generatePieData : function ( ) { var a = [ ] , b = this ; return this . data . forEach ( function ( c ) { a . push ( { key : c . get ( " name " ) , value : c . get ( " system " ) . virtualSize , time : b . serverTime } ) } ) , a } , addStatisticsItem : function ( a , b , c , d ) { var e = this ; e . hasOwnProperty ( " hist " ) | | ( e . hist = { } ) , e . hist . hasOwnProperty ( a ) | | ( e . hist [ a ] = [ ] ) ; var f = e . hist [ a ] , g = f . length ; if ( 0 = = = g ) f . push ( { time : b , snap : d , requests : c , requestsPerSecond : 0 } ) ; else { var h = f [ g - 1 ] . time , i = f [ g - 1 ] . requests ; if ( i < c ) { var j = b - h , k = 0 ; j > 0 & & ( k = ( c - i ) / j ) , f . push ( { time : b , snap : d , requests : c , requestsPerSecond : k } ) } } } , getServerStatistics : function ( a ) { var b = this , c = Math . round ( b . serverTime / 1e3 ) ; this . data = void 0 ; var d = new window . ClusterStatisticsCollection , e = this . coordinators . first ( ) ; this . dbservers . forEach ( function ( a ) { if ( " ok " = = = a . get ( " status " ) ) { b . knownServers . indexOf ( a . id ) = = = - 1 & & b . knownServers . push ( a . id ) ; var c = new window . Statistics ( { name : a . id } ) ; c . url = e . get ( " protocol " ) + " : / / " + e . get ( " address " ) + " / _admin / clusterStatistics ? DBserver = " + a . get ( " name " ) , d . add ( c ) } } ) , this . coordinators . forEach ( function ( a ) { if ( " ok " = = = a . get ( " status " ) ) { b . knownServers . indexOf ( a . id ) = = = - 1 & & b . knownServers . push ( a . id ) ; var c = new window . Statistics ( { name : a . id } ) ; c . url = a . get ( " protocol " ) + " : / / " + a . get ( " address " ) + " / _admin / statistics " , d . add ( c ) } } ) ; var f = d . size ( ) ; this . data = [ ] ; var g = function ( d ) { f - - ; var e = d . get ( " time " ) , g = d . get ( " name " ) , h = d . get ( " http " ) . requestsTotal ; b . addStatisticsItem ( g , e , h , c ) , b . data . push ( d ) , 0 = = = f & & a ( ) } , h = function ( ) { f - - , 0 = = = f & & a ( ) } ; d . fetch ( g , h ) } , renderPieChart : function ( a ) { var b = $ ( " # clusterGraphs svg " ) . width ( ) , c = $ ( " # clusterGraphs svg " ) . height ( ) , d = Math . min ( b , c ) / 2 , e = this . dygraphConfig . colors , f = d3 . svg . arc ( ) . outerRadius ( d - 20 ) . innerRadius ( 0 ) , g = d3 . layout . pie ( ) . sort ( function ( a ) { return a . value } ) . value ( function ( a ) { return a . value } ) ; d3 . select ( " # clusterGraphs " ) . select ( " svg " ) . remove ( ) ; var h = d3 . select ( " # clusterGraphs " ) . append ( " svg " ) . attr ( " class " , " clusterChart " ) . append ( " g " ) . attr ( " transform " , " translate ( " + b / 2 + " , " + ( c / 2 - 10 ) + " ) " ) , i = d3 . svg . arc ( ) . outerRadius ( d - 2 ) . innerRadius ( d - 2 ) , j = h . selectAll ( " . arc " ) . data ( g ( a ) ) . enter ( ) . append ( " g " ) . attr ( " class " , " slice " ) ; j . append ( " path " ) . attr ( " d " , f ) . style ( " fill " , function ( a , b ) { return e [ b % e . length ] } ) . style ( " stroke " , function ( a , b ) { return e [ b % e . length ] } ) , j . append ( " text " ) . attr ( " transform " , function ( a ) { return " translate ( " + f . centroid ( a ) + " ) " } ) . style ( " text - anchor " , " middle " ) . text ( function ( a ) { var b = a . data . value / 1024 / 1024 / 1024 ; return b . toFixed ( 2 ) } ) , j . append ( " text " ) . attr ( " transform " , function ( a ) { return " translate ( " + i . centroid ( a ) + " ) " } ) . style ( " text - anchor " , " middle " ) . text ( function ( a ) { return a . data . key } ) } , renderLineChart : function ( ) { var a , b , c , d , e , f , g = this , h = 1200 , i = [ ] , j = [ ] , k = Math . round ( ( new Date ) . getTime ( ) / 1e3 ) - h , l = g . knownServers , m = function ( ) { return null } ; for ( c = 0 ; c < l . length ; + + c ) if ( b = g . hist [ l [ c ] ] ) for ( d = 0 ; d < b . length ; + + d ) f = b [ d ] . snap , f < k | | ( j . hasOwnProperty ( f ) ? a = j [ f ] : ( e = new Date ( 1e3 * f ) , a = j [ f ] = [ e ] . concat ( l . map ( m ) ) ) , a [ c + 1 ] = b [ d ] . requestsPerSecond ) ; i = [ ] , Object . keys ( j ) . sort ( ) . forEach ( function ( a ) { i . push ( j [ a ] ) } ) ; var n = this . dygraphConfig . getDefaultConfig ( " clusterRequestsPerSecond " ) ; n . labelsDiv = $ ( " # lineGraphLegend " ) [ 0 ] , n . labels = [ " datetime " ] . concat ( l ) , g . graph = new Dygraph ( document . getElementById ( " lineGraph " ) , i , n ) } , stopUpdating : function ( ) { window . clearTimeout ( this . timer ) , delete this . graph , this . isUpdating = ! 1 } , startUpdating : function ( ) { if ( ! this . isUpdating ) { this . isUpdating = ! 0 ; var a = this ; this . timer = window . setInterval ( function ( ) { a . rerender ( ) } , this . interval ) } } , dashboard : function ( a ) { this . stopUpdating ( ) ; var b , c , d = $ ( a . currentTarget ) , e = { } , f = d . attr ( " id " ) ; f = f . replace ( / - / g , " . " ) , f = f . replace ( / _ / g , " : " ) , f = f . substr ( 2 ) , e . raw = f , e . isDBServer = d . hasClass ( " dbserver " ) , e . isDBServer ? ( b = this . dbservers . findWhere ( { address : e . raw } ) , c = this . coordinators . findWhere ( { status : " ok " } ) , e . endpoint = c . get ( " protocol " ) + " : / / " + c . get ( " address " ) ) : ( b = this . coordinators . findWhere ( { address : e . raw } ) , e . endpoint = b . get ( " protocol " ) + " : / / " + b . get ( " address " ) ) , e . target = encodeURIComponent ( b . get ( " name " ) ) , window . App . serverToShow = e , window . App . dashboard ( ) } , getCurrentSize : function ( a ) { " # " ! = = a . substr ( 0 , 1 ) & & ( a = " # " + a ) ; var b , c ; return $ ( a ) . attr ( " style " , " " ) , b = $ ( a ) . height ( ) , c = $ ( a ) . width ( ) , { height : b , width : c } } , resize : function ( ) { var a ; this . graph & & ( a = this . getCurrentSize ( this . graph . maindiv_ . id ) , this . graph . resize ( a . width , a . height ) ) } } ) } ( ) , function ( ) { " use strict " ; window . SpotlightView = Backbone . View . extend ( { template : templateEngine . createTemplate ( " spotlightView . ejs " ) , el : " # spotlightPlaceholder " , displayLimit : 8 , typeahead : null , callbackSuccess : null , callbackCancel : null , collections : { system : [ ] , doc : [ ] , edge : [ ] } , events : { " focusout # spotlight . tt - input " : " hide " , " keyup # spotlight . typeahead " : " listenKey " } , aqlKeywordsArray : [ ] , aqlBuiltinFunctionsArray : [ ] , aqlKeywords : " for | return | filter | sort | limit | let | collect | asc | desc | in | into | insert | update | remove | replace | upsert | options | with | and | or | not | distinct | graph | outbound | inbound | any | all | none | aggregate | like | count | shortest_path " , hide : function ( ) { this . typeahead = $ ( " # spotlight . typeahead " ) . typeahead ( " destroy " ) , $ ( this . el ) . hide ( ) } , listenKey : function ( a ) { if ( 27 = = = a . keyCode ) this . callbackSuccess & & this . callbackCancel ( ) , this . hide ( ) ; else if ( 13 = = = a . keyCode & & this . callbackSuccess ) { var b = $ ( this . typeahead ) . val ( ) ; this . callbackSuccess ( b ) , this . hide ( ) } } , substringMatcher : function ( a ) { return function ( b , c ) { var d , e ; d = [ ] , e = new RegExp ( b , " i " ) , _ . each ( a , function ( a ) { e . test ( a ) & & d . push ( a ) } ) , c ( d ) } } , updateDatasets : function ( ) { var a = this ; this . collections = { system : [ ] , doc : [ ] , edge : [ ] } , window . App . arangoCollectionsStore . each ( function ( b ) { b . get ( " isSystem " ) ? a . collections . system . push ( b . get ( " name " ) ) : " document " = = = b . get ( " type " ) ? a . collections . doc . push ( b . get ( " name " ) ) : a . collections . edge . push ( b . get ( " name " ) ) } ) } , stringToArray : function ( ) { var a = this ; _ . each ( this . aqlKeywords . split ( " | " ) , function ( b ) { a . aqlKeywordsArray . push ( b . toUpperCase ( ) ) } ) , a . aqlKeywordsArray . push ( ! 0 ) , a . aqlKeywordsArray . push ( ! 1 ) , a . aqlKeywordsArray . push ( null ) } , fetchKeywords : function ( a ) { var b = this ; $ . ajax ( { type : " GET " , cache : ! 1 , url : arangoHelper . databaseUrl ( " / _api / aql - builtin " ) , contentType : " application / json " , success : function ( c ) { b . stringToArray ( ) , b . updateDatasets ( ) , _ . each ( c . functions , function ( a ) { b . aqlBuiltinFunctionsArray . push ( a . name ) } ) , a & & a ( ) } , error : function ( ) { a & & a ( ) , arangoHelper . arangoError ( " AQL " , " Could not fetch AQL function definition . " ) } } ) } , show : function ( a , b , c ) { var d = this ; this . callbackSuccess = a , this . callbackCancel = b ; var e = function ( ) { var a = function ( a , b , c ) { var d = ' < div class = " header - type " > < h4 > ' + a + " < / h4 > " ; return b & & ( d + = ' < span > < i class = " fa ' + b + ' " > < / i > < / span > ' ) , c & & ( d + = ' < span class = " type " > ' + c . toUpperCase ( ) + " < / span > " ) , d + = " < / div > " } ; $ ( this . el ) . html ( this . template . render ( { } ) ) , $ ( this . el ) . show ( ) , " aql " = = = c ? this . typeahead = $ ( " # spotlight . typeahead " ) . typeahead ( { hint : ! 0 , highlight : ! 0 , minLength : 1 } , { name : " Functions " , source : d . substringMatcher ( d . aqlBuiltinFunctionsArray ) , limit : d . displayLimit , templates : { header : a ( " Functions " , " fa - code " , " aql " ) } } , { name : " Keywords " , source : d . substringMatcher ( d . aqlKeywordsArray ) , limit : d . displayLimit , templates : { header : a ( " Keywords " , " fa - code " , " aql " ) } } , { name : " Documents " , source : d . substringMatcher ( d . collections . doc ) , limit : d . displayLimit , templates : { header : a ( " Documents " , " fa - file - text - o " , " Collection " ) } } , { name : " Edges " , source : d . substringMatcher ( d . collections . edge ) , limit : d . displayLimit , templates : { header : a ( " Edges " , " fa - share - alt " , " Collection " ) } } , { name : " System " , limit : d . displayLimit , source : d . substringMatcher ( d . collections . system ) , templates : { header : a ( " System " , " fa - cogs " , " Collection " ) } } ) : this . typeahead = $ ( " # spotlight . typeahead " ) . typeahead ( { hint : ! 0 , highlight : ! 0 , minLength : 1 } , { name : " Documents " , source : d . substringMatcher ( d . collections . doc ) , limit : d . displayLimit , templates : { header : a ( " Documents " , " fa - file - text - o " , " Collection " ) } } , { name : " Edges " , source : d . substringMatcher ( d . collections . edge ) , limit : d . displayLimit , templates : { header : a ( " Edges " , " fa - share - alt " , " Collection " ) } } , { name : " System " , limit : d . displayLimit , source : d . substringMatcher ( d . collections . system ) , templates : { header : a ( " System " , " fa - cogs " , " Collection " ) } } ) , $ ( " # spotlight . typeahead " ) . focus ( ) } . bind ( this ) ; 0 = = = d . aqlBuiltinFunctionsArray . length ? this . fetchKeywords ( e ) : e ( ) } } ) } ( ) , function ( ) { " use strict " ; window . StatisticBarView = Backbone . View . extend ( { el : " # statisticBar " , events : { " change # arangoCollectionSelect " : " navigateBySelect " , " click . tab " : " navigateByTab " } , template : templateEngine . createTemplate ( " statisticBarView . ejs " ) , initialize : function ( a ) { this . currentDB = a . currentDB } , replaceSVG : function ( a ) { var b = a . attr ( " id " ) , c = a . attr ( " class " ) , d = a . attr ( " src " ) ; $ . get ( d , function ( d ) { var e = $ ( d ) . find ( " svg " ) ; void 0 = = = b & & ( e = e . attr ( " id " , b ) ) , void 0 = = = c & & ( e = e . attr ( " class " , c + " replaced - svg " ) ) , e = e . removeAttr ( " xmlns : a " ) , a . replaceWith ( e ) } , " xml " ) } , render : function ( ) { var a = this ; return $ ( this . el ) . html ( this . template . render ( { isSystem : this . currentDB . get ( " isSystem " ) } ) ) , $ ( " img . svg " ) . each ( function ( ) { a . replaceSVG ( $ ( this ) ) } ) , this } , navigateBySelect : function ( ) { var a = $ ( " # arangoCollectionSelect " ) . find ( " option : selected " ) . val ( ) ; window . App . navigate ( a , { trigger : ! 0 } ) } , navigateByTab : function ( a ) { var b = a . target | | a . srcElement , c = b . id ; return " links " = = = c ? ( $ ( " # link_dropdown " ) . slideToggle ( 200 ) , void a . preventDefault ( ) ) : " tools " = = = c ? ( $ ( " # tools_dropdown " ) . slideToggle ( 200 ) , void a . preventDefault ( ) ) : ( window . App . navigate ( c , { trigger : ! 0 } ) , void a . preventDefault ( ) ) } , handleSelectNavigation : function ( ) { $ ( " # arangoCollectionSelect " ) . change ( function ( ) { var a = $ ( this ) . find ( " option : selected " ) . val ( ) ; window . App . navigate ( a , { trigger : ! 0 } ) } ) } , selectMenuItem : function ( a ) { $ ( " . navlist li " ) . removeClass ( " active " ) , a & & $ ( " . " + a ) . addClass ( " active " ) } } ) } ( ) , function ( ) { " use strict " ; window . SupportView = Backbone . View . extend ( { el : " # content " , template : templateEngine . createTemplate ( " supportView . ejs " ) , events : { " click . subViewNavbar . subMenuEntry " : " toggleViews " } , render : function ( ) { this . $ el . html ( this . template . render ( { } ) ) } , resize : function ( a ) { a ? $ ( " . innerContent " ) . css ( " height " , " auto " ) : $ ( " . innerContent " ) . height ( $ ( " . centralRow " ) . height ( ) - 170 ) } , renderSwagger : function ( ) { var a = window . location . pathname . split ( " / " ) , b = window . location . protocol + " / / " + window . location . hostname + " : " + window . location . port + " / " + a [ 1 ] + " / " + a [ 2 ] + " / _admin / aardvark / api / index . html " ; $ ( " # swagger " ) . html ( " " ) , $ ( " # swagger " ) . append ( ' < iframe src = " ' + b + ' " style = " border : none " > < / iframe > ' ) } , toggleViews : function ( a ) { var b = this , c = a . currentTarget . id . split ( " - " ) [ 0 ] , d = [ " community " , " documentation " , " swagger " ] ; _ . each ( d , function ( a ) { c ! = = a ? $ ( " # " + a ) . hide ( ) : ( " swagger " = = = c ? ( b . renderSwagger ( ) , $ ( " # swagger iframe " ) . css ( " height " , " 100 % " ) , $ ( " # swagger iframe " ) . css ( " width " , " 100 % " ) , $ ( " # swagger iframe " ) . css ( " margin - top " , " - 13px " ) , b . resize ( ) ) : b . resize ( ! 0 ) , $ ( " # " + a ) . show ( ) ) } ) , $ ( " . subMenuEntries " ) . children ( ) . removeClass ( " active " ) , $ ( " # " + c + " - support " ) . addClass ( " active " ) } } ) } ( ) , function ( ) { " use strict " ; window . TableView = Backbone . View . extend ( { template : templateEngine . createTemplate ( " tableView . ejs " ) , loading : templateEngine . createTemplate ( " loadingTableView . ejs " ) , initialize : function ( a ) { this . rowClickCallback = a . rowClick } , events : { " click . pure - table - body . pure - table - row " : " rowClick " , " click . deleteButton " : " removeClick " } , rowClick : function ( a ) { this . hasOwnProperty ( " rowClickCallback " ) & & this . rowClickCallback ( a ) } , removeClick : function ( a ) { this . hasOwnProperty ( " removeClickCallback " ) & & ( this . removeClickCallback ( a ) , a . stopPropagation ( ) ) } , setRowClick : function ( a ) { this . rowClickCallback = a } , setRemoveClick : function ( a ) { this . removeClickCallback = a } , render : function ( ) { $ ( this . el ) . html ( this . template . render ( { docs : this . collection } ) ) } , drawLoading : function ( ) { $ ( this . el ) . html ( this . loading . render ( { } ) ) } } ) } ( ) , function ( ) { " use strict " ; window . UserBarView = Backbone . View . extend ( { events : { " change # userBarSelect " : " navigateBySelect " , " click . tab " : " navigateByTab " , " mouseenter . dropdown " : " showDropdown " , " mouseleave . dropdown " : " hideDropdown " , " click # userLogoutIcon " : " userLogout " , " click # userLogout " : " userLogout " } , initialize : function ( a ) { this . userCollection = a . userCollection , this . userCollection . fetch ( { cache : ! 1 , async : ! 0 } ) , this . userCollection . bind ( " change : extra " , this . render . bind ( this ) ) } , template : templateEngine . createTemplate ( " userBarView . ejs " ) , navigateBySelect : function ( ) { var a = $ ( " # arangoCollectionSelect " ) . find ( " option : selected " ) . val ( ) ; window . App . navigate ( a , { trigger : ! 0 } ) } , navigateByTab : function ( a ) { var b = a . target | | a . srcElement ; b = $ ( b ) . closest ( " a " ) ; var c = b . attr ( " id " ) ; return " user " = = = c ? ( $ ( " # user_dropdown " ) . slideToggle ( 200 ) , void a . preventDefault ( ) ) : ( window . App . navigate ( c , { trigger : ! 0 } ) , void a . preventDefault ( ) ) } , toggleUserMenu : function ( ) { $ ( " # userBar . subBarDropdown " ) . toggle ( ) } , showDropdown : function ( ) { $ ( " # user_dropdown " ) . fadeIn ( 1 ) } , hideDropdown : function ( ) { $ ( " # user_dropdown " ) . fadeOut ( 1 ) } , render : function ( ) { if ( frontendConfig . authenticationEnabled ! = = ! 1 ) { var a = this , b = function ( a , b ) { if ( a ) arangoHelper . arangoErro ( " User " , " Could not fetch user . " ) ; else { var c = null , d = null , e = ! 1 , f = null ; if ( b ! = = ! 1 ) return f = this . userCollection . findWhere ( { user : b } ) , f . set ( { loggedIn : ! 0 } ) , d = f . get ( " extra " ) . name , c = f . get ( " extra " ) . img , e = f . get ( " active " ) , c = c ? " https : / / s . gravatar . com / avatar / " + c + " ? s = 80 " : " img / default_user . png " , d | | ( d = " " ) , this . $ el = $ ( " # userBar " ) , this . $ el . html ( this . template . render ( { img : c , name : d , username : b , active : e } ) ) , this . delegateEvents ( ) , this . $ el } } . bind ( this ) ; $ ( " # userBar " ) . on ( " click " , function ( ) { a . toggleUserMenu ( ) } ) , this . userCollection . whoAmI ( b ) } } , userLogout : function ( ) { var a = function ( a ) { a ? arangoHelper . arangoError ( " User " , " Logout error " ) : this . userCollection . logout ( ) } . bind ( this ) ; this . userCollection . whoAmI ( a ) } } ) } ( ) , function ( ) { " use strict " ; window . UserManagementView = Backbone . View . extend ( { el : " # content " , el2 : " # userManagementThumbnailsIn " , template : templateEngine . createTemplate ( " userManagementView . ejs " ) , events : { " click # createUser " : " createUser " , " click # submitCreateUser " : " submitCreateUser " , " click # userManagementThumbnailsIn . tile " : " editUser " , " click # submitEditUser " : " submitEditUser " , " click # userManagementToggle " : " toggleView " , " keyup # userManagementSearchInput " : " search " , " click # userManagementSearchSubmit " : " search " , " click # callEditUserPassword " : " editUserPassword " , " click # submitEditUserPassword " : " submitEditUserPassword " , " click # submitEditCurrentUserProfile " : " submitEditCurrentUserProfile " , " click . css - label " : " checkBoxes " , " change # userSortDesc " : " sorting " } , dropdownVisible : ! 1 , initialize : function ( ) { var a = this , b = function ( a , b ) { frontendConfig . authenticationEnabled = = = ! 0 & & ( a | | null = = = b ? arangoHelper . arangoError ( " User " , " Could not fetch user data " ) : this . currentUser = this . collection . findWhere ( { user : b } ) ) } . bind ( this ) ; this . collection . fetch ( { cache : ! 1 , success : function ( ) { a . collection . whoAmI ( b ) } } ) } , checkBoxes : function ( a ) { var b = a . currentTarget . id ; $ ( " # " + b ) . click ( ) } , sorting : function ( ) { $ ( " # userSortDesc " ) . is ( " : checked " ) ? this . collection . setSortingDesc ( ! 0 ) : this . collection . setSortingDesc ( ! 1 ) , $ ( " # userManagementDropdown " ) . is ( " : visible " ) ? this . dropdownVisible = ! 0 : this . dropdownVisible = ! 1 , this . render ( ) } , render : function ( a ) { var b = ! 1 ; $ ( " # userManagementDropdown " ) . is ( " : visible " ) & & ( b = ! 0 ) ; var c = function ( ) { this . collection . sort ( ) , $ ( this . el ) . html ( this . template . render ( { collection : this . collection , searchString : " " } ) ) , b = = = ! 0 & & ( $ ( " # userManagementDropdown2 " ) . show ( ) , $ ( " # userSortDesc " ) . attr ( " checked " , this . collection . sortOptions . desc ) , $ ( " # userManagementToggle " ) . toggleClass ( " activated " ) , $ ( " # userManagementDropdown " ) . show ( ) ) , a & & this . editCurrentUser ( ) , arangoHelper . setCheckboxStatus ( " # userManagementDropdown " ) } . bind ( this ) ; return this . collection . fetch ( { cache : ! 1 , success : function ( ) { c ( ) } } ) , this } , search : function ( ) { var a , b , c , d ; a = $ ( " # userManagementSearchInput " ) , b = $ ( " # userManagementSearchInput " ) . val ( ) , d = this . collection . filter ( function ( a ) { return a . get ( " user " ) . indexOf ( b ) ! = = - 1 } ) , $ ( this . el ) . html ( this . template . render ( { collection : d , searchString : b } ) ) , a = $ ( " # userManagementSearchInput " ) , c = a . val ( ) . length , a . focus ( ) , a [ 0 ] . setSelectionRange ( c , c ) } , createUser : function ( a ) { a . preventDefault ( ) , this . createCreateUserModal ( ) } , submitCreateUser : function ( ) { var a = this , b = $ ( " # newUsername " ) . val ( ) , c = $ ( " # newName " ) . val ( ) , d = $ ( " # newPassword " ) . val ( ) , e = $ ( " # newStatus " ) . is ( " : checked " ) ; if ( this . validateUserInfo ( c , b , d , e ) ) { var f = { user : b , passwd : d , active : e , extra : { name : c } } ; this . collection . create ( f , { wait : ! 0 , error : function ( a , b ) { arangoHelper . parseError ( " User " , b , a ) } , success : function ( ) { a . updateUserManagement ( ) , window . modalView . hide ( ) } } ) } } , validateUserInfo : function ( a , b , c , d ) { return " " ! = = b | | ( arangoHelper . arangoError ( " You have to define an username " ) , $ ( " # newUsername " ) . closest ( " th " ) . css ( " backgroundColor " , " red " ) , ! 1 ) } , updateUserManagement : function ( ) { var a = this ; this . collection . fetch ( { cache : ! 1 , success : function ( ) { a . render ( ) } } ) } , editUser : function ( a ) { if ( " createUser " ! = = $ ( a . currentTarget ) . find ( " a " ) . attr ( " id " ) ) { $ ( a . currentTarget ) . hasClass ( " tile " ) & & ( a . currentTarget = $ ( a . currentTarget ) . find ( " img " ) ) , this . collection . fetch ( { cache : ! 1 } ) ; var b = this . evaluateUserName ( $ ( a . currentTarget ) . attr ( " id " ) , " _edit - user " ) ; " " = = = b & & ( b = $ ( a . currentTarget ) . attr ( " id " ) ) , window . App . navigate ( " user / " + encodeURIComponent ( b ) , { trigger : ! 0 } ) } } , toggleView : function ( ) { $ ( " # userSortDesc " ) . attr ( " checked " , this . collection . sortOptions . desc ) , $ ( " # userManagementToggle " ) . toggleClass ( " activated " ) , $ ( " # userManagementDropdown2 " ) . slideToggle ( 200 ) } , createCreateUserModal : function ( ) { var a = [ ] , b = [ ] ; b . push ( window . modalView . createTextEntry ( " newUsername " , " Username " , " " , ! 1 , " Username " , ! 0 , [ { rule : Joi . string ( ) . regex ( / ^ [ a - zA - Z0 - 9 \ - _ ] * $ / ) , msg : ' Only symbols , " _ " and " - " are allowed . ' } , { rule : Joi . string ( ) . required ( ) , msg : " No username given . " } ] ) ) , b . push ( window . modalView . createTextEntry ( " newName " , " Name " , " " , ! 1 , " Name " , ! 1 ) ) , b . push ( window . modalView . createPasswordEntry ( " newPassword " , " Password " , " " , ! 1 , " " , ! 1 ) ) , b . push ( window . modalView . createCheckboxEntry ( " newStatus " , " Active " , " active " , ! 1 , ! 0 ) ) , a . push ( window . modalView . createSuccessButton ( " Create " , this . submitCreateUser . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Create New User " , a , b ) } , evaluateUserName : function ( a , b ) { if ( a ) { var c = a . lastIndexOf ( b ) ; return a . substring ( 0 , c ) } } , updateUserProfile : function ( ) { var a = this ; this . collection . fetch ( { cache : ! 1 , success : function ( ) { a . render ( ) } } ) } } ) } ( ) , function ( ) { " use strict " ; window . UserPermissionView = Backbone . View . extend ( { el : " # content " , template : templateEngine . createTemplate ( " userPermissionView . ejs " ) , initialize : function ( a ) { this . username = a . username } , events : { ' click # userPermissionView [ type = " checkbox " ] ' : " setPermission " } , render : function ( ) { var a = this ; this . collection . fetch ( { success : function ( ) { a . continueRender ( ) } } ) } , setPermission : function ( a ) { var b = $ ( a . currentTarget ) . is ( " : checked " ) , c = $ ( a . currentTarget ) . attr ( " name " ) ; if ( b ) this . grantPermission ( this . currentUser . get ( " user " ) , c ) ; else if ( " _system " = = = c ) { var d = [ ] , e = [ ] ; e . push ( window . modalView . createReadOnlyEntry ( " db - system - revoke - button " , " Caution " , " You are removing your permissions to _system database . Really continue ? " , void 0 , void 0 , ! 1 ) ) , d . push ( window . modalView . createSuccessButton ( " Revoke " , this . revokePermission . bind ( this , this . currentUser . get ( " user " ) , c ) ) ) , d . push ( window . modalView . createCloseButton ( " Cancel " , this . rollbackInputButton . bind ( this , c ) ) ) , window . modalView . show ( " modalTable . ejs " , " Revoke _system Database Permission " , d , e ) } else this . revokePermission ( this . currentUser . get ( " user " ) , c ) } , rollbackInputButton : function ( a ) { $ ( ' input [ name = " ' + a + ' " ' ) . prop ( " checked " , " true " ) } , grantPermission : function ( a , b ) { $ . ajax ( { type : " PUT " , url : arangoHelper . databaseUrl ( " / _api / user / " + encodeURIComponent ( a ) + " / database / " + encodeURIComponent ( b ) ) , contentType : " application / json " , data : JSON . stringify ( { grant : " rw " } ) } ) } , revokePermission : function ( a , b ) { $ . ajax ( { type : " PUT " , url : arangoHelper . databaseUrl ( " / _api / user / " + encodeURIComponent ( a ) + " / database / " + encodeURIComponent ( b ) ) , contentType : " application / json " } ) , window . modalView . hide ( ) } , continueRender : function ( ) { var a = this ; this . currentUser = this . collection . findWhere ( { user : this . username } ) , this . breadcrumb ( ) , arangoHelper . buildUserSubNav ( this . currentUser . get ( " user " ) , " Permissions " ) ; var b = arangoHelper . databaseUrl ( " / _api / user / " + encodeURIComponent ( a . currentUser . get ( " user " ) ) + " / database " ) ; " _system " = = = frontendConfig . db & & ( b = arangoHelper . databaseUrl ( " / _api / user / root / database " ) ) , $ . ajax ( { type : " GET " , url : b , contentType : " application / json " , success : function ( b ) { var c = b . result ; $ . ajax ( { type : " GET " , url : arangoHelper . databaseUrl ( " / _api / user / " + encodeURIComponent ( a . currentUser . get ( " user " ) ) + " / database " ) , contentType : " application / json " , success : function ( b ) { var d = b . result ; if ( c . _system ) { var e = [ ] ; _ . each ( c , function ( a , b ) { e . push ( b ) } ) , c = e } a . finishRender ( c , d ) } } ) } } ) } , finishRender : function ( a , b ) { _ . each ( b , function ( a , c ) { " rw " ! = = a & & delete b [ c ] } ) , $ ( this . el ) . html ( this . template . render ( { allDBs : a , permissions : b } ) ) } , breadcrumb : function ( ) { $ ( " # subNavigationBar . breadcrumb " ) . html ( " User : " + this . currentUser . get ( " user " ) ) } } ) } ( ) , function ( ) { " use strict " ; window . UserView = Backbone . View . extend ( { el : " # content " , initialize : function ( a ) { this . username = a . username } , render : function ( ) { var a = this ; this . collection . fetch ( { success : function ( ) { a . continueRender ( ) } } ) } , editCurrentUser : function ( ) { this . createEditCurrentUserModal ( this . currentUser . get ( " user " ) , this . currentUser . get ( " extra " ) . name , this . currentUser . get ( " extra " ) . img ) } , continueRender : function ( ) { this . breadcrumb ( ) , this . currentUser = this . collection . findWhere ( { user : this . username } ) , arangoHelper . buildUserSubNav ( this . currentUser . get ( " user " ) , " General " ) , this . currentUser . get ( " loggedIn " ) ? this . editCurrentUser ( ) : this . createEditUserModal ( this . currentUser . get ( " user " ) , this . currentUser . get ( " extra " ) . name , this . currentUser . get ( " active " ) ) } , createEditUserPasswordModal : function ( ) { var a = [ ] , b = [ ] ; b . push ( window . modalView . createPasswordEntry ( " newCurrentPassword " , " New Password " , " " , ! 1 , " new password " , ! 1 ) ) , b . push ( window . modalView . createPasswordEntry ( " confirmCurrentPassword " , " Confirm New Password " , " " , ! 1 , " confirm new password " , ! 1 ) ) , a . push ( window . modalView . createSuccessButton ( " Save " , this . submitEditUserPassword . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Edit User Password " , a , b ) } , createEditCurrentUserModal : function ( a , b , c ) { var d = [ ] , e = [ ] ; e . push ( window . modalView . createReadOnlyEntry ( " id_username " , " Username " , a ) ) , e . push ( window . modalView . createTextEntry ( " editCurrentName " , " Name " , b , ! 1 , " Name " , ! 1 ) ) , e . push ( window . modalView . createTextEntry ( " editCurrentUserProfileImg " , " Gravatar account ( Mail ) " , c , " Mailaddress or its md5 representation of your gravatar account . The address will be converted into a md5 string . Only the md5 string will be stored , not the mailaddress . " , " myAccount ( at ) gravatar . com " ) ) , d . push ( window . modalView . createNotificationButton ( " Change Password " , this . editUserPassword . bind ( this ) ) ) , d . push ( window . modalView . createSuccessButton ( " Save " , this . submitEditCurrentUserProfile . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Edit User Profile " , d , e , null , null , this . events , null , null , " content " ) } , parseImgString : function ( a ) { return a . indexOf ( " @ " ) = = = - 1 ? a : CryptoJS . MD5 ( a ) . toString ( ) } , createEditUserModal : function ( a , b , c ) { var d , e ; e = [ { type : window . modalView . tables . READONLY , label : " Username " , value : _ . escape ( a ) } , { type : window . modalView . tables . TEXT , label : " Name " , value : b , id : " editName " , placeholder : " Name " } , { type : window . modalView . tables . CHECKBOX , label : " Active " , value : " active " , checked : c , <nl> - id : " editStatus " } ] , d = [ { title : " Delete " , type : window . modalView . buttons . DELETE , callback : this . submitDeleteUser . bind ( this , a ) } , { title : " Change Password " , type : window . modalView . buttons . NOTIFICATION , callback : this . createEditUserPasswordModal . bind ( this , a ) } , { title : " Save " , type : window . modalView . buttons . SUCCESS , callback : this . submitEditUser . bind ( this , a ) } ] , window . modalView . show ( " modalTable . ejs " , " Edit User " , d , e , null , null , this . events , null , null , " content " ) } , validateStatus : function ( a ) { return " " ! = = a } , submitDeleteUser : function ( a ) { var b = this . collection . findWhere ( { user : a } ) ; b . destroy ( { wait : ! 0 } ) , window . App . navigate ( " # users " , { trigger : ! 0 } ) } , submitEditCurrentUserProfile : function ( ) { var a = $ ( " # editCurrentName " ) . val ( ) , b = $ ( " # editCurrentUserProfileImg " ) . val ( ) ; b = this . parseImgString ( b ) ; var c = function ( a ) { a ? arangoHelper . arangoError ( " User " , " Could not edit user settings " ) : ( arangoHelper . arangoNotification ( " User " , " Changes confirmed . " ) , this . updateUserProfile ( ) ) } . bind ( this ) ; this . currentUser . setExtras ( a , b , c ) , window . modalView . hide ( ) } , submitEditUserPassword : function ( ) { var a = $ ( " # newCurrentPassword " ) . val ( ) , b = $ ( " # confirmCurrentPassword " ) . val ( ) ; $ ( " # newCurrentPassword " ) . val ( " " ) , $ ( " # confirmCurrentPassword " ) . val ( " " ) , $ ( " # newCurrentPassword " ) . closest ( " th " ) . css ( " backgroundColor " , " white " ) , $ ( " # confirmCurrentPassword " ) . closest ( " th " ) . css ( " backgroundColor " , " white " ) ; var c = ! 1 ; a ! = = b & & ( arangoHelper . arangoError ( " User " , " New passwords do not match . " ) , c = ! 0 ) , c | | ( this . currentUser . setPassword ( a ) , arangoHelper . arangoNotification ( " User " , " Password changed . " ) , window . modalView . hide ( ) ) } , validateUsername : function ( a ) { return " " = = = a ? ( arangoHelper . arangoError ( " You have to define an username " ) , $ ( " # newUsername " ) . closest ( " th " ) . css ( " backgroundColor " , " red " ) , ! 1 ) : ! ! a . match ( / ^ [ a - zA - Z ] [ a - zA - Z0 - 9_ - ] * $ / ) | | ( arangoHelper . arangoError ( " Wrong Username " , " Username may only contain numbers , letters , _ and - " ) , ! 1 ) } , editUserPassword : function ( ) { window . modalView . hide ( ) , this . createEditUserPasswordModal ( ) } , validateName : function ( a ) { return " " = = = a | | ( ! ! a . match ( / ^ [ a - zA - Z ] [ a - zA - Z0 - 9_ - ] * $ / ) | | ( arangoHelper . arangoError ( " Wrong Username " , " Username may only contain numbers , letters , _ and - " ) , ! 1 ) ) } , submitEditUser : function ( a ) { var b = $ ( " # editName " ) . val ( ) , c = $ ( " # editStatus " ) . is ( " : checked " ) ; if ( ! this . validateStatus ( c ) ) return void $ ( " # editStatus " ) . closest ( " th " ) . css ( " backgroundColor " , " red " ) ; if ( ! this . validateName ( b ) ) return void $ ( " # editName " ) . closest ( " th " ) . css ( " backgroundColor " , " red " ) ; var d = this . collection . findWhere ( { user : a } ) ; d . save ( { extra : { name : b } , active : c } , { type : " PATCH " , success : function ( ) { arangoHelper . arangoNotification ( " User " , d . get ( " user " ) + " updated . " ) } , error : function ( ) { arangoHelper . arangoError ( " User " , " Could not update " + d . get ( " user " ) + " . " ) } } ) } , breadcrumb : function ( ) { $ ( " # subNavigationBar . breadcrumb " ) . html ( " User : " + this . username ) } } ) } ( ) , function ( ) { " use strict " ; window . WorkMonitorView = Backbone . View . extend ( { el : " # content " , id : " # workMonitorContent " , template : templateEngine . createTemplate ( " workMonitorView . ejs " ) , table : templateEngine . createTemplate ( " arangoTable . ejs " ) , initialize : function ( ) { } , events : { } , tableDescription : { id : " workMonitorTable " , titles : [ " Type " , " Database " , " Task ID " , " Started " , " Url " , " User " , " Description " , " Method " ] , rows : [ ] , unescaped : [ ! 1 , ! 1 , ! 1 , ! 1 , ! 1 , ! 1 , ! 1 , ! 1 ] } , render : function ( ) { var a = this ; this . $ el . html ( this . template . render ( { } ) ) , this . collection . fetch ( { success : function ( ) { a . parseTableData ( ) , $ ( a . id ) . append ( a . table . render ( { content : a . tableDescription } ) ) } } ) } , parseTableData : function ( ) { var a = this ; this . collection . each ( function ( b ) { if ( " AQL query " = = = b . get ( " type " ) ) { var c = b . get ( " parent " ) ; if ( c ) try { a . tableDescription . rows . push ( [ b . get ( " type " ) , " ( p ) " + c . database , " ( p ) " + c . taskId , " ( p ) " + c . startTime , " ( p ) " + c . url , " ( p ) " + c . user , b . get ( " description " ) , " ( p ) " + c . method ] ) } catch ( d ) { console . log ( " some parse error " ) } } else " thread " ! = = b . get ( " type " ) & & a . tableDescription . rows . push ( [ b . get ( " type " ) , b . get ( " database " ) , b . get ( " taskId " ) , b . get ( " startTime " ) , b . get ( " url " ) , b . get ( " user " ) , b . get ( " description " ) , b . get ( " method " ) ] ) } ) } } ) } ( ) , function ( ) { " use strict " ; window . Router = Backbone . Router . extend ( { toUpdate : [ ] , dbServers : [ ] , isCluster : void 0 , lastRoute : void 0 , routes : { " " : " cluster " , dashboard : " dashboard " , collections : " collections " , " new " : " newCollection " , login : " login " , " collection / : colid / documents / : pageid " : " documents " , " cIndices / : colname " : " cIndices " , " cSettings / : colname " : " cSettings " , " cInfo / : colname " : " cInfo " , " collection / : colid / : docid " : " document " , shell : " shell " , queries : " query " , workMonitor : " workMonitor " , databases : " databases " , settings : " databases " , services : " applications " , " service / : mount " : " applicationDetail " , graphs : " graphManagement " , " graphs / : name " : " showGraph " , users : " userManagement " , " user / : name " : " userView " , " user / : name / permission " : " userPermissionView " , userProfile : " userProfile " , cluster : " cluster " , nodes : " nodes " , shards : " shards " , " node / : name " : " node " , logs : " logs " , helpus : " helpUs " , " graph / : name " : " graph " , " graph / : name / settings " : " graphSettings " , support : " support " } , execute : function ( a , b ) { " # queries " = = = this . lastRoute & & this . queryView . cleanupGraphs ( ) , this . lastRoute = window . location . hash , $ ( " # subNavigationBar . breadcrumb " ) . html ( " " ) , $ ( " # subNavigationBar . bottom " ) . html ( " " ) , $ ( " # loadingScreen " ) . hide ( ) , $ ( " # content " ) . show ( ) , a & & a . apply ( this , b ) , this . graphViewer & & this . graphViewer . graphSettingsView & & this . graphViewer . graphSettingsView . hide ( ) , this . queryView & & this . queryView . graphViewer & & this . queryView . graphViewer . graphSettingsView & & this . queryView . graphViewer . graphSettingsView . hide ( ) } , listenerFunctions : { } , listener : function ( a ) { _ . each ( window . App . listenerFunctions , function ( b , c ) { b ( a ) } ) } , checkUser : function ( ) { var a = this ; if ( " # login " ! = = window . location . hash ) { var b = function ( ) { this . initOnce ( ) , $ ( " . bodyWrapper " ) . show ( ) , $ ( " . navbar " ) . show ( ) } . bind ( this ) , c = function ( c , d ) { frontendConfig . authenticationEnabled ? ( a . currentUser = d , c | | null = = = d ? " # login " ! = = window . location . hash & & this . navigate ( " login " , { trigger : ! 0 } ) : b ( ) ) : b ( ) } . bind ( this ) ; frontendConfig . authenticationEnabled ? this . userCollection . whoAmI ( c ) : ( this . initOnce ( ) , $ ( " . bodyWrapper " ) . show ( ) , $ ( " . navbar " ) . show ( ) ) } } , waitForInit : function ( a , b , c ) { this . initFinished ? ( b | | a ( ! 0 ) , b & & ! c & & a ( b , ! 0 ) , b & & c & & a ( b , c , ! 0 ) ) : setTimeout ( function ( ) { b | | a ( ! 1 ) , b & & ! c & & a ( b , ! 1 ) , b & & c & & a ( b , c , ! 1 ) } , 350 ) } , initFinished : ! 1 , initialize : function ( ) { frontendConfig . isCluster = = = ! 0 & & ( this . isCluster = ! 0 ) , document . addEventListener ( " keyup " , this . listener , ! 1 ) , window . modalView = new window . ModalView , this . foxxList = new window . FoxxCollection , window . foxxInstallView = new window . FoxxInstallView ( { collection : this . foxxList } ) , window . progressView = new window . ProgressView ; var a = this ; this . userCollection = new window . ArangoUsers , this . initOnce = function ( ) { this . initOnce = function ( ) { } ; var b = function ( b , c ) { a = this , c = = = ! 0 & & a . coordinatorCollection . fetch ( { success : function ( ) { a . fetchDBS ( ) } } ) , b & & console . log ( b ) } . bind ( this ) ; window . isCoordinator ( b ) , frontendConfig . isCluster = = = ! 1 & & ( this . initFinished = ! 0 ) , this . arangoDatabase = new window . ArangoDatabase , this . currentDB = new window . CurrentDatabase , this . arangoCollectionsStore = new window . ArangoCollections , this . arangoDocumentStore = new window . ArangoDocument , this . coordinatorCollection = new window . ClusterCoordinators , arangoHelper . setDocumentStore ( this . arangoDocumentStore ) , this . arangoCollectionsStore . fetch ( { cache : ! 1 } ) , window . spotlightView = new window . SpotlightView ( { collection : this . arangoCollectionsStore } ) , this . footerView = new window . FooterView ( { collection : a . coordinatorCollection } ) , this . notificationList = new window . NotificationCollection , this . currentDB . fetch ( { cache : ! 1 , success : function ( ) { a . naviView = new window . NavigationView ( { database : a . arangoDatabase , currentDB : a . currentDB , notificationCollection : a . notificationList , userCollection : a . userCollection , isCluster : a . isCluster } ) , a . naviView . render ( ) } } ) , this . queryCollection = new window . ArangoQueries , this . footerView . render ( ) , window . checkVersion ( ) , this . userConfig = new window . UserConfig , this . userConfig . fetch ( ) , this . documentsView = new window . DocumentsView ( { collection : new window . ArangoDocuments , documentStore : this . arangoDocumentStore , collectionsStore : this . arangoCollectionsStore } ) , arangoHelper . initSigma ( ) } . bind ( this ) , $ ( window ) . resize ( function ( ) { a . handleResize ( ) } ) , $ ( window ) . scroll ( function ( ) { } ) } , handleScroll : function ( ) { $ ( window ) . scrollTop ( ) > 50 ? ( $ ( " . navbar > . secondary " ) . css ( " top " , $ ( window ) . scrollTop ( ) ) , $ ( " . navbar > . secondary " ) . css ( " position " , " absolute " ) , $ ( " . navbar > . secondary " ) . css ( " z - index " , " 10 " ) , $ ( " . navbar > . secondary " ) . css ( " width " , $ ( window ) . width ( ) ) ) : ( $ ( " . navbar > . secondary " ) . css ( " top " , " 0 " ) , $ ( " . navbar > . secondary " ) . css ( " position " , " relative " ) , $ ( " . navbar > . secondary " ) . css ( " width " , " " ) ) } , cluster : function ( a ) { return this . checkUser ( ) , a ? this . isCluster = = = ! 1 | | void 0 = = = this . isCluster ? void ( " _system " = = = this . currentDB . get ( " name " ) ? ( this . routes [ " " ] = " dashboard " , this . navigate ( " # dashboard " , { trigger : ! 0 } ) ) : ( this . routes [ " " ] = " collections " , this . navigate ( " # collections " , { trigger : ! 0 } ) ) ) : ( this . clusterView | | ( this . clusterView = new window . ClusterView ( { coordinators : this . coordinatorCollection , dbServers : this . dbServers } ) ) , void this . clusterView . render ( ) ) : void this . waitForInit ( this . cluster . bind ( this ) ) } , node : function ( a , b ) { return this . checkUser ( ) , b & & void 0 ! = = this . isCluster ? this . isCluster = = = ! 1 ? ( this . routes [ " " ] = " dashboard " , void this . navigate ( " # dashboard " , { trigger : ! 0 } ) ) : ( this . nodeView | | ( this . nodeView = new window . NodeView ( { coordname : a , coordinators : this . coordinatorCollection , dbServers : this . dbServers } ) ) , void this . nodeView . render ( ) ) : void this . waitForInit ( this . node . bind ( this ) , a ) } , shards : function ( a ) { return this . checkUser ( ) , a & & void 0 ! = = this . isCluster ? this . isCluster = = = ! 1 ? ( this . routes [ " " ] = " dashboard " , void this . navigate ( " # dashboard " , { trigger : ! 0 } ) ) : ( this . shardsView | | ( this . shardsView = new window . ShardsView ( { dbServers : this . dbServers } ) ) , void this . shardsView . render ( ) ) : void this . waitForInit ( this . shards . bind ( this ) ) } , nodes : function ( a ) { return this . checkUser ( ) , a & & void 0 ! = = this . isCluster ? this . isCluster = = = ! 1 ? ( this . routes [ " " ] = " dashboard " , void this . navigate ( " # dashboard " , { trigger : ! 0 } ) ) : ( this . nodesView | | ( this . nodesView = new window . NodesView ( { } ) ) , void this . nodesView . render ( ) ) : void this . waitForInit ( this . nodes . bind ( this ) ) } , cNodes : function ( a ) { return this . checkUser ( ) , a & & void 0 ! = = this . isCluster ? this . isCluster = = = ! 1 ? ( this . routes [ " " ] = " dashboard " , void this . navigate ( " # dashboard " , { trigger : ! 0 } ) ) : ( this . nodesView = new window . NodesView ( { coordinators : this . coordinatorCollection , dbServers : this . dbServers [ 0 ] , toRender : " coordinator " } ) , void this . nodesView . render ( ) ) : void this . waitForInit ( this . cNodes . bind ( this ) ) } , dNodes : function ( a ) { return this . checkUser ( ) , a & & void 0 ! = = this . isCluster ? this . isCluster = = = ! 1 ? ( this . routes [ " " ] = " dashboard " , void this . navigate ( " # dashboard " , { trigger : ! 0 } ) ) : 0 = = = this . dbServers . length ? void this . navigate ( " # cNodes " , { trigger : ! 0 } ) : ( this . nodesView = new window . NodesView ( { coordinators : this . coordinatorCollection , dbServers : this . dbServers [ 0 ] , toRender : " dbserver " } ) , void this . nodesView . render ( ) ) : void this . waitForInit ( this . dNodes . bind ( this ) ) } , sNodes : function ( a ) { return this . checkUser ( ) , a & & void 0 ! = = this . isCluster ? this . isCluster = = = ! 1 ? ( this . routes [ " " ] = " dashboard " , void this . navigate ( " # dashboard " , { trigger : ! 0 } ) ) : ( this . scaleView = new window . ScaleView ( { coordinators : this . coordinatorCollection , dbServers : this . dbServers [ 0 ] } ) , void this . scaleView . render ( ) ) : void this . waitForInit ( this . sNodes . bind ( this ) ) } , addAuth : function ( a ) { var b = this . clusterPlan . get ( " user " ) ; if ( ! b ) return a . abort ( ) , void ( this . isCheckingUser | | this . requestAuth ( ) ) ; var c = b . name , d = b . passwd , e = c . concat ( " : " , d ) ; a . setRequestHeader ( " Authorization " , " Basic " + btoa ( e ) ) } , logs : function ( a , b ) { if ( this . checkUser ( ) , ! b ) return void this . waitForInit ( this . logs . bind ( this ) , a ) ; if ( ! this . logsView ) { var c = new window . ArangoLogs ( { upto : ! 0 , loglevel : 4 } ) , d = new window . ArangoLogs ( { loglevel : 4 } ) , e = new window . ArangoLogs ( { loglevel : 3 } ) , f = new window . ArangoLogs ( { loglevel : 2 } ) , g = new window . ArangoLogs ( { loglevel : 1 } ) ; this . logsView = new window . LogsView ( { logall : c , logdebug : d , loginfo : e , logwarning : f , logerror : g } ) } this . logsView . render ( ) } , applicationDetail : function ( a , b ) { if ( this . checkUser ( ) , ! b ) return void this . waitForInit ( this . applicationDetail . bind ( this ) , a ) ; var c = function ( ) { this . hasOwnProperty ( " applicationDetailView " ) | | ( this . applicationDetailView = new window . ApplicationDetailView ( { model : this . foxxList . get ( decodeURIComponent ( a ) ) } ) ) , this . applicationDetailView . model = this . foxxList . get ( decodeURIComponent ( a ) ) , this . applicationDetailView . render ( " swagger " ) } . bind ( this ) ; 0 = = = this . foxxList . length ? this . foxxList . fetch ( { cache : ! 1 , success : function ( ) { c ( ) } } ) : c ( ) } , login : function ( ) { var a = function ( a , b ) { this . loginView | | ( this . loginView = new window . LoginView ( { collection : this . userCollection } ) ) , a | | null = = = b ? this . loginView . render ( ) : this . loginView . render ( ! 0 ) } . bind ( this ) ; this . userCollection . whoAmI ( a ) } , collections : function ( a ) { if ( this . checkUser ( ) , ! a ) return void this . waitForInit ( this . collections . bind ( this ) ) ; var b = this ; this . collectionsView | | ( this . collectionsView = new window . CollectionsView ( { collection : this . arangoCollectionsStore } ) ) , this . arangoCollectionsStore . fetch ( { cache : ! 1 , success : function ( ) { b . collectionsView . render ( ) } } ) } , cIndices : function ( a , b ) { var c = this ; return this . checkUser ( ) , b ? void this . arangoCollectionsStore . fetch ( { cache : ! 1 , success : function ( ) { c . indicesView = new window . IndicesView ( { collectionName : a , collection : c . arangoCollectionsStore . findWhere ( { name : a } ) } ) , c . indicesView . render ( ) } } ) : void this . waitForInit ( this . cIndices . bind ( this ) , a ) } , cSettings : function ( a , b ) { var c = this ; return this . checkUser ( ) , b ? void this . arangoCollectionsStore . fetch ( { cache : ! 1 , success : function ( ) { c . settingsView = new window . SettingsView ( { collectionName : a , collection : c . arangoCollectionsStore . findWhere ( { name : a } ) } ) , c . settingsView . render ( ) } } ) : void this . waitForInit ( this . cSettings . bind ( this ) , a ) } , cInfo : function ( a , b ) { var c = this ; return this . checkUser ( ) , b ? void this . arangoCollectionsStore . fetch ( { cache : ! 1 , success : function ( ) { c . infoView = new window . InfoView ( { collectionName : a , collection : c . arangoCollectionsStore . findWhere ( { name : a } ) } ) , c . infoView . render ( ) } } ) : void this . waitForInit ( this . cInfo . bind ( this ) , a ) } , documents : function ( a , b , c ) { return this . checkUser ( ) , c ? ( this . documentsView | | ( this . documentsView = new window . DocumentsView ( { collection : new window . ArangoDocuments , documentStore : this . arangoDocumentStore , collectionsStore : this . arangoCollectionsStore } ) ) , this . documentsView . setCollectionId ( a , b ) , void this . documentsView . render ( ) ) : void this . waitForInit ( this . documents . bind ( this ) , a , b ) } , document : function ( a , b , c ) { if ( this . checkUser ( ) , ! c ) return void this . waitForInit ( this . document . bind ( this ) , a , b ) ; this . documentView | | ( this . documentView = new window . DocumentView ( { collection : this . arangoDocumentStore } ) ) , this . documentView . colid = a ; var d = window . location . hash . split ( " / " ) [ 2 ] , e = ( d . split ( " % " ) . length - 1 ) % 3 ; decodeURI ( d ) ! = = d & & 0 ! = = e & & ( d = decodeURIComponent ( d ) ) , this . documentView . docid = d , this . documentView . render ( ) ; var f = function ( a , b ) { a ? console . log ( " Error " , " Could not fetch collection type " ) : this . documentView . setType ( b ) } . bind ( this ) ; arangoHelper . collectionApiType ( a , null , f ) } , query : function ( a ) { return this . checkUser ( ) , a ? ( this . queryView | | ( this . queryView = new window . QueryView ( { collection : this . queryCollection } ) ) , void this . queryView . render ( ) ) : void this . waitForInit ( this . query . bind ( this ) ) } , graph : function ( a , b ) { return this . checkUser ( ) , b ? ( this . graphViewer & & ( this . graphViewer . graphSettingsView & & this . graphViewer . graphSettingsView . remove ( ) , this . graphViewer . killCurrentGraph ( ) , this . graphViewer . unbind ( ) , this . graphViewer . remove ( ) ) , this . graphViewer = new window . GraphViewer ( { name : a , documentStore : this . arangoDocumentStore , collection : new window . GraphCollection , userConfig : this . userConfig } ) , void this . graphViewer . render ( ) ) : void this . waitForInit ( this . graph . bind ( this ) , a ) } , graphSettings : function ( a , b ) { return this . checkUser ( ) , b ? ( this . graphSettingsView & & this . graphSettingsView . remove ( ) , this . graphSettingsView = new window . GraphSettingsView ( { name : a , userConfig : this . userConfig } ) , void this . graphSettingsView . render ( ) ) : void this . waitForInit ( this . graphSettings . bind ( this ) , a ) } , helpUs : function ( a ) { return this . checkUser ( ) , a ? ( this . testView | | ( this . helpUsView = new window . HelpUsView ( { } ) ) , void this . helpUsView . render ( ) ) : void this . waitForInit ( this . helpUs . bind ( this ) ) } , support : function ( a ) { return this . checkUser ( ) , a ? ( this . testView | | ( this . supportView = new window . SupportView ( { } ) ) , void this . supportView . render ( ) ) : void this . waitForInit ( this . support . bind ( this ) ) } , workMonitor : function ( a ) { return this . checkUser ( ) , a ? ( this . workMonitorCollection | | ( this . workMonitorCollection = new window . WorkMonitorCollection ) , this . workMonitorView | | ( this . workMonitorView = new window . WorkMonitorView ( { collection : this . workMonitorCollection } ) ) , void this . workMonitorView . render ( ) ) : void this . waitForInit ( this . workMonitor . bind ( this ) ) } , queryManagement : function ( a ) { return this . checkUser ( ) , a ? ( this . queryManagementView | | ( this . queryManagementView = new window . QueryManagementView ( { collection : void 0 } ) ) , void this . queryManagementView . render ( ) ) : void this . waitForInit ( this . queryManagement . bind ( this ) ) } , databases : function ( a ) { if ( this . checkUser ( ) , ! a ) return void this . waitForInit ( this . databases . bind ( this ) ) ; var b = function ( a ) { a ? ( arangoHelper . arangoError ( " DB " , " Could not get list of allowed databases " ) , this . navigate ( " # " , { trigger : ! 0 } ) , $ ( " # databaseNavi " ) . css ( " display " , " none " ) , $ ( " # databaseNaviSelect " ) . css ( " display " , " none " ) ) : ( this . databaseView | | ( this . databaseView = new window . DatabaseView ( { users : this . userCollection , collection : this . arangoDatabase } ) ) , this . databaseView . render ( ) ) } . bind ( this ) ; arangoHelper . databaseAllowed ( b ) } , dashboard : function ( a ) { return this . checkUser ( ) , a ? ( void 0 = = = this . dashboardView & & ( this . dashboardView = new window . DashboardView ( { dygraphConfig : window . dygraphConfig , database : this . arangoDatabase } ) ) , void this . dashboardView . render ( ) ) : void this . waitForInit ( this . dashboard . bind ( this ) ) } , graphManagement : function ( a ) { return this . checkUser ( ) , a ? ( this . graphManagementView & & this . graphManagementView . undelegateEvents ( ) , this . graphManagementView = new window . GraphManagementView ( { collection : new window . GraphCollection , collectionCollection : this . arangoCollectionsStore } ) , void this . graphManagementView . render ( ) ) : void this . waitForInit ( this . graphManagement . bind ( this ) ) } , showGraph : function ( a , b ) { return this . checkUser ( ) , b ? void ( this . graphManagementView ? this . graphManagementView . loadGraphViewer ( a ) : ( this . graphManagementView = new window . GraphManagementView ( { collection : new window . GraphCollection , collectionCollection : this . arangoCollectionsStore } ) , this . graphManagementView . render ( a , ! 0 ) ) ) : void this . waitForInit ( this . showGraph . bind ( this ) , a ) } , applications : function ( a ) { return this . checkUser ( ) , a ? ( void 0 = = = this . applicationsView & & ( this . applicationsView = new window . ApplicationsView ( { collection : this . foxxList } ) ) , void this . applicationsView . reload ( ) ) : void this . waitForInit ( this . applications . bind ( this ) ) } , handleSelectDatabase : function ( a ) { return this . checkUser ( ) , a ? void this . naviView . handleSelectDatabase ( ) : void this . waitForInit ( this . handleSelectDatabase . bind ( this ) ) } , handleResize : function ( ) { this . dashboardView & & this . dashboardView . resize ( ) , this . graphManagementView & & " graphs " = = = Backbone . history . getFragment ( ) & & this . graphManagementView . handleResize ( $ ( " # content " ) . width ( ) ) , this . queryView & & " queries " = = = Backbone . history . getFragment ( ) & & this . queryView . resize ( ) , this . naviView & & this . naviView . resize ( ) , this . graphViewer & & Backbone . history . getFragment ( ) . indexOf ( " graph " ) > - 1 & & this . graphViewer . resize ( ) , this . documentsView & & Backbone . history . getFragment ( ) . indexOf ( " documents " ) > - 1 & & this . documentsView . resize ( ) , this . documentView & & Backbone . history . getFragment ( ) . indexOf ( " collection " ) > - 1 & & this . documentView . resize ( ) } , userPermissionView : function ( a , b ) { if ( this . checkUser ( ) , b | | null = = = b ) this . userPermissionView = new window . UserPermissionView ( { collection : this . userCollection , databases : this . arangoDatabase , username : a } ) , this . userPermissionView . render ( ) ; else if ( b = = = ! 1 ) return void this . waitForInit ( this . userPermissionView . bind ( this ) , a ) } , userView : function ( a , b ) { this . checkUser ( ) , b | | null = = = b ? ( this . userView = new window . UserView ( { collection : this . userCollection , username : a } ) , this . userView . render ( ) ) : b = = = ! 1 & & this . waitForInit ( this . userView . bind ( this ) , a ) } , userManagement : function ( a ) { return this . checkUser ( ) , a ? ( this . userManagementView | | ( this . userManagementView = new window . UserManagementView ( { collection : this . userCollection } ) ) , void this . userManagementView . render ( ) ) : void this . waitForInit ( this . userManagement . bind ( this ) ) } , userProfile : function ( a ) { return this . checkUser ( ) , a ? ( this . userManagementView | | ( this . userManagementView = new window . UserManagementView ( { collection : this . userCollection } ) ) , void this . userManagementView . render ( ! 0 ) ) : void this . waitForInit ( this . userProfile . bind ( this ) ) } , fetchDBS : function ( a ) { var b = this , c = ! 1 ; this . coordinatorCollection . each ( function ( a ) { b . dbServers . push ( new window . ClusterServers ( [ ] , { host : a . get ( " address " ) } ) ) } ) , this . initFinished = ! 0 , _ . each ( this . dbServers , function ( b ) { b . fetch ( { success : function ( ) { c = = = ! 1 & & a & & ( a ( ) , c = ! 0 ) } } ) } ) } , getNewRoute : function ( a ) { return " http : / / " + a } , registerForUpdate : function ( a ) { this . toUpdate . push ( a ) , a . updateUrl ( ) } } ) } ( ) , function ( ) { " use strict " ; var a = function ( a , b ) { var c = [ ] ; c . push ( window . modalView . createSuccessButton ( " Download Page " , function ( ) { window . open ( " https : / / www . arangodb . com / download " , " _blank " ) , window . modalView . hide ( ) } ) ) ; var d = [ ] , e = window . modalView . createReadOnlyEntry . bind ( window . modalView ) ; d . push ( e ( " current " , " Current " , a . toString ( ) ) ) , b . major & & d . push ( e ( " major " , " Major " , b . major . version ) ) , b . minor & & d . push ( e ( " minor " , " Minor " , b . minor . version ) ) , b . bugfix & & d . push ( e ( " bugfix " , " Bugfix " , b . bugfix . version ) ) , window . modalView . show ( " modalTable . ejs " , " New Version Available " , c , d ) } ; window . checkVersion = function ( ) { $ . ajax ( { type : " GET " , cache : ! 1 , url : arangoHelper . databaseUrl ( " / _api / version " ) , contentType : " application / json " , processData : ! 1 , async : ! 0 , success : function ( b ) { var c = window . versionHelper . fromString ( b . version ) ; $ ( " . navbar # currentVersion " ) . html ( b . version . substr ( 0 , 7 ) + ' < i class = " fa fa - check - circle " > < / i > ' ) , window . parseVersions = function ( b ) { return _ . isEmpty ( b ) ? void $ ( " # currentVersion " ) . addClass ( " up - to - date " ) : ( $ ( " # currentVersion " ) . addClass ( " out - of - date " ) , $ ( " # currentVersion . fa " ) . removeClass ( " fa - check - circle " ) . addClass ( " fa - exclamation - circle " ) , void $ ( " # currentVersion " ) . click ( function ( ) { a ( c , b ) } ) ) } , $ . ajax ( { type : " GET " , async : ! 0 , crossDomain : ! 0 , timeout : 3e3 , dataType : " jsonp " , url : " https : / / www . arangodb . com / repositories / versions . php ? jsonp = parseVersions & version = " + encodeURIComponent ( c . toString ( ) ) } ) } } ) } } ( ) , function ( ) { " use strict " ; window . hasOwnProperty ( " TEST_BUILD " ) | | ( $ ( document ) . ajaxSend ( function ( a , b , c ) { var d = window . arangoHelper . getCurrentJwt ( ) ; d & & b . setRequestHeader ( " Authorization " , " bearer " + d ) } ) , $ ( document ) . ready ( function ( ) { window . App = new window . Router , Backbone . history . start ( ) , window . App . handleResize ( ) } ) , $ ( document ) . click ( function ( a ) { a . stopPropagation ( ) , $ ( a . target ) . hasClass ( " subBarDropdown " ) | | $ ( a . target ) . hasClass ( " dropdown - header " ) | | $ ( a . target ) . hasClass ( " dropdown - footer " ) | | $ ( a . target ) . hasClass ( " toggle " ) | | $ ( " # userInfo " ) . is ( " : visible " ) & & $ ( " . subBarDropdown " ) . hide ( ) } ) ) } ( ) ; <nl> \ No newline at end of file <nl> + } } ; this . changePlanModal ( c . bind ( null , a ) ) } } , changePlanModal : function ( a , b ) { var c = [ ] , d = [ ] ; d . push ( window . modalView . createReadOnlyEntry ( " plan - confirm - button " , " Caution " , " You are changing the cluster plan . Continue ? " , void 0 , void 0 , ! 1 , / [ < > & ' " ] / ) ) , c . push ( window . modalView . createSuccessButton ( " Yes " , a . bind ( this , b ) ) ) , window . modalView . show ( " modalTable . ejs " , " Modify Cluster Size " , c , d ) } , initialize : function ( ) { var a = this ; clearInterval ( this . intervalFunction ) , window . App . isCluster & & ( this . updateServerTime ( ) , this . intervalFunction = window . setInterval ( function ( ) { " # nodes " = = = window . location . hash & & a . render ( ! 1 ) } , this . interval ) ) } , navigateToNode : function ( a ) { if ( ! $ ( a . currentTarget ) . hasClass ( " noHover " ) ) { var b = $ ( a . currentTarget ) . attr ( " node " ) . slice ( 0 , - 5 ) ; window . App . navigate ( " # node / " + encodeURIComponent ( b ) , { trigger : ! 0 } ) } } , render : function ( a ) { if ( " # nodes " = = = window . location . hash ) { var b = this ; $ ( " # content " ) . is ( " : empty " ) & & arangoHelper . renderEmpty ( " Please wait . Requesting cluster information . . . " , " fa fa - spin fa - circle - o - notch " ) , a ! = = ! 1 & & arangoHelper . buildNodesSubNav ( " Overview " ) ; var c = function ( a ) { $ . ajax ( { type : " GET " , url : arangoHelper . databaseUrl ( " / _admin / cluster / numberOfServers " ) , contentType : " application / json " , success : function ( c ) { " # nodes " = = = window . location . hash & & b . continueRender ( a , c ) } } ) } ; $ . ajax ( { type : " GET " , cache : ! 1 , url : arangoHelper . databaseUrl ( " / _admin / cluster / health " ) , contentType : " application / json " , processData : ! 1 , async : ! 0 , success : function ( a ) { " # nodes " = = = window . location . hash & & c ( a . Health ) } , error : function ( ) { " # nodes " = = = window . location . hash & & arangoHelper . arangoError ( " Cluster " , " Could not fetch cluster information " ) } } ) } } , continueRender : function ( a , b ) { var c = { } , d = { } , e = ! 1 ; _ . each ( a , function ( a , b ) { " Coordinator " = = = a . Role ? c [ b ] = a : " DBServer " = = = a . Role & & ( d [ b ] = a ) } ) , null ! = = b . numberOfDBServers & & null ! = = b . numberOfCoordinators & & ( e = ! 0 ) ; var f = function ( a ) { this . $ el . html ( this . template . render ( { coords : c , dbs : d , scaling : e , scaleProperties : a , plannedDBs : b . numberOfDBServers , plannedCoords : b . numberOfCoordinators } ) ) , e | | ( $ ( " . title " ) . css ( " position " , " relative " ) , $ ( " . title " ) . css ( " top " , " - 4px " ) , $ ( " . sectionHeader . information " ) . css ( " margin - top " , " - 3px " ) ) } . bind ( this ) ; this . renderCounts ( e , f ) } , updatePlanned : function ( a ) { a . numberOfCoordinators & & ( $ ( " # plannedCoords " ) . val ( a . numberOfCoordinators ) , this . renderCounts ( ! 0 ) ) , a . numberOfDBServers & & ( $ ( " # plannedDBs " ) . val ( a . numberOfDBServers ) , this . renderCounts ( ! 0 ) ) } , setCoordSize : function ( a ) { var b = this , c = { numberOfCoordinators : a } ; $ . ajax ( { type : " PUT " , url : arangoHelper . databaseUrl ( " / _admin / cluster / numberOfServers " ) , contentType : " application / json " , data : JSON . stringify ( c ) , success : function ( ) { b . updatePlanned ( c ) } , error : function ( ) { arangoHelper . arangoError ( " Scale " , " Could not set coordinator size . " ) } } ) } , setDBsSize : function ( a ) { var b = this , c = { numberOfDBServers : a } ; $ . ajax ( { type : " PUT " , url : arangoHelper . databaseUrl ( " / _admin / cluster / numberOfServers " ) , contentType : " application / json " , data : JSON . stringify ( c ) , success : function ( ) { b . updatePlanned ( c ) } , error : function ( ) { arangoHelper . arangoError ( " Scale " , " Could not set coordinator size . " ) } } ) } , abortClusterPlanModal : function ( ) { var a = [ ] , b = [ ] ; b . push ( window . modalView . createReadOnlyEntry ( " plan - abort - button " , " Caution " , " You are aborting the planned cluster plan . All pending servers are going to be removed . Continue ? " , void 0 , void 0 , ! 1 , / [ < > & ' " ] / ) ) , a . push ( window . modalView . createSuccessButton ( " Yes " , this . abortClusterPlan . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Modify Cluster Size " , a , b ) } , abortClusterPlan : function ( ) { window . modalView . hide ( ) ; try { var a = JSON . parse ( $ ( " # infoCoords > . positive > span " ) . text ( ) ) , b = JSON . parse ( $ ( " # infoDBs > . positive > span " ) . text ( ) ) ; this . setCoordSize ( a ) , this . setDBsSize ( b ) } catch ( c ) { console . log ( c ) , arangoHelper . arangoError ( " Plan " , " Could not abort Cluster Plan " ) } } , renderCounts : function ( a , b ) { var c = this , d = function ( b , c , d , e ) { var f = ' < span class = " positive " > < span > ' + c + ' < / span > < i class = " fa fa - check - circle " > < / i > < / span > ' ; d & & a = = = ! 0 & & ( f = f + ' < span class = " warning " > < span > ' + d + ' < / span > < i class = " fa fa - circle - o - notch fa - spin " > < / i > < / span > < button class = " abortClusterPlan button - navbar button - default " > Abort < / button > ' ) , e & & ( f = f + ' < span class = " negative " > < span > ' + e + ' < / span > < i class = " fa fa - exclamation - circle " > < / i > < / span > ' ) , $ ( b ) . html ( f ) , a | | ( $ ( " . title " ) . css ( " position " , " relative " ) , $ ( " . title " ) . css ( " top " , " - 4px " ) ) } , e = function ( a ) { var e = 0 , f = 0 , g = 0 , h = 0 , i = 0 , j = 0 ; _ . each ( a , function ( a ) { " Coordinator " = = = a . Role ? " GOOD " = = = a . Status ? f + + : e + + : " DBServer " = = = a . Role & & ( " GOOD " = = = a . Status ? h + + : i + + ) } ) , $ . ajax ( { type : " GET " , cache : ! 1 , url : arangoHelper . databaseUrl ( " / _admin / cluster / numberOfServers " ) , contentType : " application / json " , processData : ! 1 , success : function ( a ) { g = Math . abs ( f + e - a . numberOfCoordinators ) , j = Math . abs ( h + i - a . numberOfDBServers ) , b ? b ( { coordsPending : g , coordsOk : f , coordsErrors : e , dbsPending : j , dbsOk : h , dbsErrors : i } ) : ( d ( " # infoDBs " , h , j , i ) , d ( " # infoCoords " , f , g , e ) ) , c . isPlanFinished ( ) | | ( $ ( " . scaleGroup " ) . addClass ( " no - hover " ) , $ ( " # plannedCoords " ) . attr ( " disabled " , " disabled " ) , $ ( " # plannedDBs " ) . attr ( " disabled " , " disabled " ) ) } } ) } ; $ . ajax ( { type : " GET " , cache : ! 1 , url : arangoHelper . databaseUrl ( " / _admin / cluster / health " ) , contentType : " application / json " , processData : ! 1 , success : function ( a ) { e ( a . Health ) } } ) } , isPlanFinished : function ( ) { var a ; return a = ! ( $ ( " # infoDBs " ) . find ( " . warning " ) . length > 0 ) & & ! ( $ ( " # infoCoords " ) . find ( " . warning " ) . length > 0 ) } , addCoord : function ( ) { var a = function ( ) { window . modalView . hide ( ) , this . setCoordSize ( this . readNumberFromID ( " # plannedCoords " , ! 0 ) ) } ; this . isPlanFinished ( ) ? this . changePlanModal ( a . bind ( this ) ) : ( arangoHelper . arangoNotification ( " Cluster Plan " , " Planned state not yet finished . " ) , $ ( " . noty_buttons . button - danger " ) . remove ( ) ) } , removeCoord : function ( ) { var a = function ( ) { window . modalView . hide ( ) , this . setCoordSize ( this . readNumberFromID ( " # plannedCoords " , ! 1 , ! 0 ) ) } ; this . isPlanFinished ( ) ? this . changePlanModal ( a . bind ( this ) ) : ( arangoHelper . arangoNotification ( " Cluster Plan " , " Planned state not yet finished . " ) , $ ( " . noty_buttons . button - danger " ) . remove ( ) ) } , addDBs : function ( ) { var a = function ( ) { window . modalView . hide ( ) , this . setDBsSize ( this . readNumberFromID ( " # plannedDBs " , ! 0 ) ) } ; this . isPlanFinished ( ) ? this . changePlanModal ( a . bind ( this ) ) : ( arangoHelper . arangoNotification ( " Cluster Plan " , " Planned state not yet finished . " ) , $ ( " . noty_buttons . button - danger " ) . remove ( ) ) } , removeDBs : function ( ) { var a = function ( ) { window . modalView . hide ( ) , this . setDBsSize ( this . readNumberFromID ( " # plannedDBs " , ! 1 , ! 0 ) ) } ; this . isPlanFinished ( ) ? this . changePlanModal ( a . bind ( this ) ) : ( arangoHelper . arangoNotification ( " Cluster Plan " , " Planned state not yet finished . " ) , $ ( " . noty_buttons . button - danger " ) . remove ( ) ) } , readNumberFromID : function ( a , b , c ) { var d = $ ( a ) . val ( ) , e = ! 1 ; try { e = JSON . parse ( d ) } catch ( f ) { } return b & & e + + , c & & 1 ! = = e & & e - - , e } , updateServerTime : function ( ) { this . serverTime = ( new Date ) . getTime ( ) } } ) } ( ) , function ( ) { " use strict " ; window . NodeView = Backbone . View . extend ( { el : " # content " , template : templateEngine . createTemplate ( " nodeView . ejs " ) , interval : 5e3 , dashboards : [ ] , events : { } , initialize : function ( a ) { window . App . isCluster & & ( this . coordinators = a . coordinators , this . dbServers = a . dbServers , this . coordname = a . coordname , this . updateServerTime ( ) ) } , breadcrumb : function ( a ) { $ ( " # subNavigationBar . breadcrumb " ) . html ( " Node : " + a ) } , render : function ( ) { this . $ el . html ( this . template . render ( { coords : [ ] } ) ) ; var a = function ( ) { this . continueRender ( ) , this . breadcrumb ( this . coordname ) , $ ( window ) . trigger ( " resize " ) } . bind ( this ) ; this . initCoordDone | | this . waitForCoordinators ( ) , this . initDBDone ? ( this . coordname = window . location . hash . split ( " / " ) [ 1 ] , this . coordinator = this . coordinators . findWhere ( { name : this . coordname } ) , a ( ) ) : this . waitForDBServers ( a ) } , continueRender : function ( ) { var a = this ; this . dashboards [ this . coordinator . get ( " name " ) ] = new window . DashboardView ( { dygraphConfig : window . dygraphConfig , database : window . App . arangoDatabase , serverToShow : { raw : this . coordinator . get ( " address " ) , isDBServer : ! 1 , endpoint : this . coordinator . get ( " protocol " ) + " : / / " + this . coordinator . get ( " address " ) , target : this . coordinator . get ( " name " ) } } ) , this . dashboards [ this . coordinator . get ( " name " ) ] . render ( ) , window . setTimeout ( function ( ) { a . dashboards [ a . coordinator . get ( " name " ) ] . resize ( ) } , 500 ) } , waitForCoordinators : function ( a ) { var b = this ; window . setTimeout ( function ( ) { 0 = = = b . coordinators . length ? b . waitForCoordinators ( a ) : ( b . coordinator = b . coordinators . findWhere ( { name : b . coordname } ) , b . initCoordDone = ! 0 , a & & a ( ) ) } , 200 ) } , waitForDBServers : function ( a ) { var b = this ; window . setTimeout ( function ( ) { 0 = = = b . dbServers [ 0 ] . length ? b . waitForDBServers ( a ) : ( b . initDBDone = ! 0 , b . dbServer = b . dbServers [ 0 ] , b . dbServer . each ( function ( a ) { " DBServer001 " = = = a . get ( " name " ) & & ( b . dbServer = a ) } ) , a ( ) ) } , 200 ) } , updateServerTime : function ( ) { this . serverTime = ( new Date ) . getTime ( ) } } ) } ( ) , function ( ) { " use strict " ; window . NotificationView = Backbone . View . extend ( { events : { " click . navlogo # stat_hd " : " toggleNotification " , " click . notificationItem . fa " : " removeNotification " , " click # removeAllNotifications " : " removeAllNotifications " } , initialize : function ( ) { this . collection . bind ( " add " , this . renderNotifications . bind ( this ) ) , this . collection . bind ( " remove " , this . renderNotifications . bind ( this ) ) , this . collection . bind ( " reset " , this . renderNotifications . bind ( this ) ) , window . setTimeout ( function ( ) { frontendConfig . authenticationEnabled = = = ! 1 & & frontendConfig . isCluster = = = ! 1 & & arangoHelper . showAuthDialog ( ) = = = ! 0 & & window . arangoHelper . arangoWarning ( " Warning " , " Authentication is disabled . Do not use this setup in production mode . " ) } , 2e3 ) } , notificationItem : templateEngine . createTemplate ( " notificationItem . ejs " ) , el : " # notificationBar " , template : templateEngine . createTemplate ( " notificationView . ejs " ) , toggleNotification : function ( ) { var a = this . collection . length ; 0 ! = = a & & $ ( " # notification_menu " ) . toggle ( ) } , removeAllNotifications : function ( ) { $ . noty . clearQueue ( ) , $ . noty . closeAll ( ) , this . collection . reset ( ) , $ ( " # notification_menu " ) . hide ( ) } , removeNotification : function ( a ) { var b = a . target . id ; this . collection . get ( b ) . destroy ( ) } , renderNotifications : function ( a , b , c ) { if ( c & & c . add ) { var d , e = this . collection . at ( this . collection . length - 1 ) , f = e . get ( " title " ) , g = 5e3 , h = [ " click " ] ; if ( e . get ( " content " ) & & ( f = f + " : " + e . get ( " content " ) ) , " error " = = = e . get ( " type " ) ? ( g = ! 1 , h = [ " button " ] , d = [ { addClass : " button - danger " , text : " Close " , onClick : function ( a ) { a . close ( ) } } ] ) : " warning " = = = e . get ( " type " ) & & ( g = 15e3 , d = [ { addClass : " button - warning " , text : " Close " , onClick : function ( a ) { a . close ( ) } } , { addClass : " button - danger " , text : " Don ' t show again . " , onClick : function ( a ) { a . close ( ) , window . arangoHelper . doNotShowAgain ( ) } } ] ) , $ . noty . clearQueue ( ) , $ . noty . closeAll ( ) , noty ( { theme : " relax " , text : f , template : ' < div class = " noty_message arango_message " > < div > < i class = " fa fa - close " > < / i > < / div > < span class = " noty_text arango_text " > < / span > < div class = " noty_close arango_close " > < / div > < / div > ' , maxVisible : 1 , closeWith : [ " click " ] , type : e . get ( " type " ) , layout : " bottom " , timeout : g , buttons : d , animation : { open : { height : " show " } , close : { height : " hide " } , easing : " swing " , speed : 200 , closeWith : h } } ) , " success " = = = e . get ( " type " ) ) return void e . destroy ( ) } $ ( " # stat_hd_counter " ) . text ( this . collection . length ) , 0 = = = this . collection . length ? ( $ ( " # stat_hd " ) . removeClass ( " fullNotification " ) , $ ( " # notification_menu " ) . hide ( ) ) : $ ( " # stat_hd " ) . addClass ( " fullNotification " ) , $ ( " . innerDropdownInnerUL " ) . html ( this . notificationItem . render ( { notifications : this . collection } ) ) , $ ( " . notificationInfoIcon " ) . tooltip ( { position : { my : " left top " , at : " right + 55 top - 1 " } } ) } , render : function ( ) { return $ ( this . el ) . html ( this . template . render ( { notifications : this . collection } ) ) , this . renderNotifications ( ) , this . delegateEvents ( ) , this . el } } ) } ( ) , function ( ) { " use strict " ; window . ProgressView = Backbone . View . extend ( { template : templateEngine . createTemplate ( " progressBase . ejs " ) , el : " # progressPlaceholder " , el2 : " # progressPlaceholderIcon " , toShow : ! 1 , lastDelay : 0 , action : function ( ) { } , events : { " click . progress - action button " : " performAction " } , performAction : function ( ) { " function " = = typeof this . action & & this . action ( ) , window . progressView . hide ( ) } , initialize : function ( ) { } , showWithDelay : function ( a , b , c , d ) { var e = this ; e . toShow = ! 0 , e . lastDelay = a , setTimeout ( function ( ) { e . toShow = = = ! 0 & & e . show ( b , c , d ) } , e . lastDelay ) } , show : function ( a , b , c ) { $ ( this . el ) . html ( this . template . render ( { } ) ) , $ ( " . progress - text " ) . text ( a ) , c ? $ ( " . progress - action " ) . html ( ' < button class = " button - danger " > ' + c + " < / button > " ) : $ ( " . progress - action " ) . html ( ' < button class = " button - danger " > Cancel < / button > ' ) , b ? this . action = b : this . action = this . hide ( ) , $ ( this . el ) . show ( ) } , hide : function ( ) { var a = this ; a . toShow = ! 1 , $ ( this . el ) . hide ( ) , this . action = function ( ) { } } } ) } ( ) , function ( ) { " use strict " ; window . QueryManagementView = Backbone . View . extend ( { el : " # content " , id : " # queryManagementContent " , templateActive : templateEngine . createTemplate ( " queryManagementViewActive . ejs " ) , templateSlow : templateEngine . createTemplate ( " queryManagementViewSlow . ejs " ) , table : templateEngine . createTemplate ( " arangoTable . ejs " ) , active : ! 0 , shouldRender : ! 0 , timer : 0 , refreshRate : 2e3 , initialize : function ( ) { var a = this ; this . activeCollection = new window . QueryManagementActive , this . slowCollection = new window . QueryManagementSlow , this . convertModelToJSON ( ! 0 ) , window . setInterval ( function ( ) { " # queries " = = = window . location . hash & & window . VISIBLE & & a . shouldRender & & " queryManagement " = = = arangoHelper . getCurrentSub ( ) . route & & ( a . active ? $ ( " # arangoQueryManagementTable " ) . is ( " : visible " ) & & a . convertModelToJSON ( ! 0 ) : $ ( " # arangoQueryManagementTable " ) . is ( " : visible " ) & & a . convertModelToJSON ( ! 1 ) ) } , a . refreshRate ) } , events : { " click # deleteSlowQueryHistory " : " deleteSlowQueryHistoryModal " , " click # arangoQueryManagementTable . fa - minus - circle " : " deleteRunningQueryModal " } , tableDescription : { id : " arangoQueryManagementTable " , titles : [ " ID " , " Query String " , " Runtime " , " Started " , " " ] , rows : [ ] , unescaped : [ ! 1 , ! 1 , ! 1 , ! 1 , ! 0 ] } , deleteRunningQueryModal : function ( a ) { this . killQueryId = $ ( a . currentTarget ) . attr ( " data - id " ) ; var b = [ ] , c = [ ] ; c . push ( window . modalView . createReadOnlyEntry ( void 0 , " Running Query " , " Do you want to kill the running query ? " , void 0 , void 0 , ! 1 , void 0 ) ) , b . push ( window . modalView . createDeleteButton ( " Kill " , this . killRunningQuery . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Kill Running Query " , b , c ) , $ ( " . modal - delete - confirmation strong " ) . html ( " Really kill ? " ) } , killRunningQuery : function ( ) { this . collection . killRunningQuery ( this . killQueryId , this . killRunningQueryCallback . bind ( this ) ) , window . modalView . hide ( ) } , killRunningQueryCallback : function ( ) { this . convertModelToJSON ( ! 0 ) , this . renderActive ( ) } , deleteSlowQueryHistoryModal : function ( ) { var a = [ ] , b = [ ] ; b . push ( window . modalView . createReadOnlyEntry ( void 0 , " Slow Query Log " , " Do you want to delete the slow query log entries ? " , void 0 , void 0 , ! 1 , void 0 ) ) , a . push ( window . modalView . createDeleteButton ( " Delete " , this . deleteSlowQueryHistory . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Delete Slow Query Log " , a , b ) } , deleteSlowQueryHistory : function ( ) { this . collection . deleteSlowQueryHistory ( this . slowQueryCallback . bind ( this ) ) , window . modalView . hide ( ) } , slowQueryCallback : function ( ) { this . convertModelToJSON ( ! 1 ) , this . renderSlow ( ) } , render : function ( ) { var a = arangoHelper . getCurrentSub ( ) ; a . params . active ? ( this . active = ! 0 , this . convertModelToJSON ( ! 0 ) ) : ( this . active = ! 1 , this . convertModelToJSON ( ! 1 ) ) } , addEvents : function ( ) { var a = this ; $ ( " # queryManagementContent tbody " ) . on ( " mousedown " , function ( ) { clearTimeout ( a . timer ) , a . shouldRender = ! 1 } ) , $ ( " # queryManagementContent tbody " ) . on ( " mouseup " , function ( ) { a . timer = window . setTimeout ( function ( ) { a . shouldRender = ! 0 } , 3e3 ) } ) } , renderActive : function ( ) { this . $ el . html ( this . templateActive . render ( { } ) ) , $ ( this . id ) . append ( this . table . render ( { content : this . tableDescription } ) ) , $ ( " # activequeries " ) . addClass ( " arango - active - tab " ) , this . addEvents ( ) } , renderSlow : function ( ) { this . $ el . html ( this . templateSlow . render ( { } ) ) , $ ( this . id ) . append ( this . table . render ( { content : this . tableDescription } ) ) , $ ( " # slowqueries " ) . addClass ( " arango - active - tab " ) , this . addEvents ( ) } , convertModelToJSON : function ( a ) { var b = this , c = [ ] ; a = = = ! 0 ? this . collection = this . activeCollection : this . collection = this . slowCollection , this . collection . fetch ( { success : function ( ) { b . collection . each ( function ( b ) { var d = " " ; a & & ( d = ' < i data - id = " ' + b . get ( " id " ) + ' " class = " fa fa - minus - circle " > < / i > ' ) , c . push ( [ b . get ( " id " ) , b . get ( " query " ) , b . get ( " runTime " ) . toFixed ( 2 ) + " s " , b . get ( " started " ) , d ] ) } ) ; var d = " No running queries . " ; a | | ( d = " No slow queries . " ) , 0 = = = c . length & & c . push ( [ d , " " , " " , " " , " " ] ) , b . tableDescription . rows = c , a ? b . renderActive ( ) : b . renderSlow ( ) } } ) } } ) } ( ) , function ( ) { " use strict " ; window . QueryView = Backbone . View . extend ( { el : " # content " , bindParamId : " # bindParamEditor " , myQueriesId : " # queryTable " , template : templateEngine . createTemplate ( " queryView . ejs " ) , table : templateEngine . createTemplate ( " arangoTable . ejs " ) , outputDiv : " # outputEditors " , outputTemplate : templateEngine . createTemplate ( " queryViewOutput . ejs " ) , outputCounter : 0 , allowUpload : ! 1 , renderComplete : ! 1 , customQueries : [ ] , cachedQueries : { } , graphViewers : [ ] , queries : [ ] , state : { lastQuery : { query : void 0 , bindParam : void 0 } } , graphs : [ ] , settings : { aqlWidth : void 0 } , currentQuery : { } , initDone : ! 1 , bindParamRegExp : / @ ( @ ? \ w + \ d * ) / , bindParamTableObj : { } , bindParamMode : " table " , bindParamTableDesc : { id : " arangoBindParamTable " , titles : [ " Key " , " Value " ] , rows : [ ] } , myQueriesTableDesc : { id : " arangoMyQueriesTable " , titles : [ " Name " , " Actions " ] , rows : [ ] } , execPending : ! 1 , aqlEditor : null , queryPreview : null , initialize : function ( ) { this . refreshAQL ( ) } , allowParamToggle : ! 0 , events : { " click # executeQuery " : " executeQuery " , " click # explainQuery " : " explainQuery " , " click # clearQuery " : " clearQuery " , " click . outputEditorWrapper # downloadQueryResult " : " downloadQueryResult " , " click . outputEditorWrapper . switchAce span " : " switchAce " , " click . outputEditorWrapper . closeResult " : " closeResult " , " click # toggleQueries1 " : " toggleQueries " , " click # toggleQueries2 " : " toggleQueries " , " click # createNewQuery " : " createAQL " , " click # saveCurrentQuery " : " addAQL " , " click # updateCurrentQuery " : " updateAQL " , " click # exportQuery " : " exportCustomQueries " , " click # importQuery " : " openImportDialog " , " click # removeResults " : " removeResults " , " click # querySpotlight " : " showSpotlight " , " click # deleteQuery " : " selectAndDeleteQueryFromTable " , " click # explQuery " : " selectAndExplainQueryFromTable " , " click . closeProfile " : " closeProfile " , " keydown # arangoBindParamTable input " : " updateBindParams " , " change # arangoBindParamTable input " : " updateBindParams " , " click # arangoMyQueriesTable tbody tr " : " showQueryPreview " , " dblclick # arangoMyQueriesTable tbody tr " : " selectQueryFromTable " , " click # arangoMyQueriesTable # copyQuery " : " selectQueryFromTable " , " click # closeQueryModal " : " closeExportDialog " , " click # confirmQueryImport " : " importCustomQueries " , " click # switchTypes " : " toggleBindParams " , " click # arangoMyQueriesTable # runQuery " : " selectAndRunQueryFromTable " } , clearQuery : function ( ) { this . aqlEditor . setValue ( " " , 1 ) } , closeProfile : function ( a ) { var b = $ ( a . currentTarget ) . parent ( ) . attr ( " counter " ) ; _ . each ( $ ( " . queryProfile " ) , function ( a ) { $ ( a ) . attr ( " counter " ) = = = b & & $ ( a ) . fadeOut ( " fast " ) . remove ( ) } ) } , toggleBindParams : function ( ) { this . allowParamToggle ? ( $ ( " # bindParamEditor " ) . toggle ( ) , $ ( " # bindParamAceEditor " ) . toggle ( ) , " JSON " = = = $ ( " # switchTypes " ) . text ( ) ? ( this . bindParamMode = " json " , $ ( " # switchTypes " ) . text ( " Table " ) , this . updateQueryTable ( ) , this . bindParamAceEditor . setValue ( JSON . stringify ( this . bindParamTableObj , null , " \ t " ) , 1 ) , this . deselect ( this . bindParamAceEditor ) ) : ( this . bindParamMode = " table " , $ ( " # switchTypes " ) . text ( " JSON " ) , this . renderBindParamTable ( ) ) ) : arangoHelper . arangoError ( " Bind parameter " , " Could not parse bind parameter " ) , this . resize ( ) } , openExportDialog : function ( ) { $ ( " # queryImportDialog " ) . modal ( " show " ) } , closeExportDialog : function ( ) { $ ( " # queryImportDialog " ) . modal ( " hide " ) } , initQueryImport : function ( ) { var a = this ; a . allowUpload = ! 1 , $ ( " # importQueries " ) . change ( function ( b ) { a . files = b . target . files | | b . dataTransfer . files , a . file = a . files [ 0 ] , a . allowUpload = ! 0 , $ ( " # confirmQueryImport " ) . removeClass ( " disabled " ) } ) } , importCustomQueries : function ( ) { var a = this ; if ( this . allowUpload = = = ! 0 ) { var b = function ( ) { this . collection . fetch ( { success : function ( ) { a . updateLocalQueries ( ) , a . updateQueryTable ( ) , a . resize ( ) , a . allowUpload = ! 1 , $ ( " # confirmQueryImport " ) . addClass ( " disabled " ) , $ ( " # queryImportDialog " ) . modal ( " hide " ) } , error : function ( a ) { arangoHelper . arangoError ( " Custom Queries " , a . responseText ) } } ) } . bind ( this ) ; a . collection . saveImportQueries ( a . file , b . bind ( this ) ) } } , removeResults : function ( ) { this . cachedQueries = { } , $ ( " . outputEditorWrapper " ) . hide ( " fast " , function ( ) { $ ( " . outputEditorWrapper " ) . remove ( ) } ) , $ ( " # removeResults " ) . hide ( ) } , getCustomQueryParameterByName : function ( a ) { return this . collection . findWhere ( { name : a } ) . get ( " parameter " ) } , getCustomQueryValueByName : function ( a ) { var b ; return a & & ( b = this . collection . findWhere ( { name : a } ) ) , b ? b = b . get ( " value " ) : _ . each ( this . queries , function ( c ) { c . name = = = a & & ( b = c . value ) } ) , b } , openImportDialog : function ( ) { $ ( " # queryImportDialog " ) . modal ( " show " ) } , closeImportDialog : function ( ) { $ ( " # queryImportDialog " ) . modal ( " hide " ) } , exportCustomQueries : function ( ) { var a ; $ . ajax ( " whoAmI ? _ = " + Date . now ( ) ) . success ( function ( b ) { a = b . user , null ! = = a & & a ! = = ! 1 | | ( a = " root " ) ; var c = " query / download / " + encodeURIComponent ( a ) ; arangoHelper . download ( c ) } ) } , toggleQueries : function ( a ) { a ? " toggleQueries1 " = = = a . currentTarget . id ? ( this . updateQueryTable ( ) , $ ( " # bindParamAceEditor " ) . hide ( ) , $ ( " # bindParamEditor " ) . show ( ) , $ ( " # switchTypes " ) . text ( " JSON " ) , $ ( " . aqlEditorWrapper " ) . first ( ) . width ( . 33 * $ ( window ) . width ( ) ) , this . queryPreview . setValue ( " No query selected . " , 1 ) , this . deselect ( this . queryPreview ) ) : ( $ ( " # updateCurrentQuery " ) . hide ( ) , void 0 = = = this . settings . aqlWidth ? $ ( " . aqlEditorWrapper " ) . first ( ) . width ( . 33 * $ ( window ) . width ( ) ) : $ ( " . aqlEditorWrapper " ) . first ( ) . width ( this . settings . aqlWidth ) , " undefined " ! = = localStorage . getItem ( " lastOpenQuery " ) & & $ ( " # updateCurrentQuery " ) . show ( ) ) : void 0 = = = this . settings . aqlWidth ? $ ( " . aqlEditorWrapper " ) . first ( ) . width ( . 33 * $ ( window ) . width ( ) ) : $ ( " . aqlEditorWrapper " ) . first ( ) . width ( this . settings . aqlWidth ) , this . resize ( ) ; var b = [ " aqlEditor " , " queryTable " , " previewWrapper " , " querySpotlight " , " bindParamEditor " , " toggleQueries1 " , " toggleQueries2 " , " createNewQuery " , " saveCurrentQuery " , " querySize " , " executeQuery " , " switchTypes " , " explainQuery " , " importQuery " , " exportQuery " ] ; _ . each ( b , function ( a ) { $ ( " # " + a ) . toggle ( ) } ) , this . resize ( ) } , showQueryPreview : function ( a ) { $ ( " # arangoMyQueriesTable tr " ) . removeClass ( " selected " ) , $ ( a . currentTarget ) . addClass ( " selected " ) ; var b = this . getQueryNameFromTable ( a ) ; this . queryPreview . setValue ( this . getCustomQueryValueByName ( b ) , 1 ) , this . deselect ( this . queryPreview ) } , getQueryNameFromTable : function ( a ) { var b ; return $ ( a . currentTarget ) . is ( " tr " ) ? b = $ ( a . currentTarget ) . children ( ) . first ( ) . text ( ) : $ ( a . currentTarget ) . is ( " span " ) & & ( b = $ ( a . currentTarget ) . parent ( ) . parent ( ) . prev ( ) . text ( ) ) , b } , deleteQueryModal : function ( a ) { var b = [ ] , c = [ ] ; c . push ( window . modalView . createReadOnlyEntry ( void 0 , a , " Do you want to delete the query ? " , void 0 , void 0 , ! 1 , void 0 ) ) , b . push ( window . modalView . createDeleteButton ( " Delete " , this . deleteAQL . bind ( this , a ) ) ) , window . modalView . show ( " modalTable . ejs " , " Delete Query " , b , c ) } , selectAndDeleteQueryFromTable : function ( a ) { var b = this . getQueryNameFromTable ( a ) ; this . deleteQueryModal ( b ) } , selectAndExplainQueryFromTable : function ( a ) { this . selectQueryFromTable ( a , ! 1 ) , this . explainQuery ( ) } , selectAndRunQueryFromTable : function ( a ) { this . selectQueryFromTable ( a , ! 1 ) , this . executeQuery ( ) } , selectQueryFromTable : function ( a , b ) { var c = this . getQueryNameFromTable ( a ) , d = this ; void 0 = = = b & & this . toggleQueries ( ) ; var e = localStorage . getItem ( " lastOpenQuery " ) ; this . state . lastQuery . query = this . aqlEditor . getValue ( ) , this . state . lastQuery . bindParam = this . bindParamTableObj , this . aqlEditor . setValue ( this . getCustomQueryValueByName ( c ) , 1 ) , this . fillBindParamTable ( this . getCustomQueryParameterByName ( c ) ) , this . updateBindParams ( ) , this . currentQuery = this . collection . findWhere ( { name : c } ) , this . currentQuery & & localStorage . setItem ( " lastOpenQuery " , this . currentQuery . get ( " name " ) ) , $ ( " # updateCurrentQuery " ) . show ( ) , $ ( " # lastQuery " ) . remove ( ) , e ! = = c & & ( $ ( " # queryContent . arangoToolbarTop . pull - left " ) . append ( ' < span id = " lastQuery " class = " clickable " > Previous Query < / span > ' ) , this . breadcrumb ( c ) ) , $ ( " # lastQuery " ) . hide ( ) . fadeIn ( 500 ) . on ( " click " , function ( ) { $ ( " # updateCurrentQuery " ) . hide ( ) , d . aqlEditor . setValue ( d . state . lastQuery . query , 1 ) , d . fillBindParamTable ( d . state . lastQuery . bindParam ) , d . updateBindParams ( ) , d . collection . each ( function ( a ) { a = a . toJSON ( ) , a . value = = = d . state . lastQuery . query ? d . breadcrumb ( a . name ) : d . breadcrumb ( ) } ) , $ ( " # lastQuery " ) . fadeOut ( 500 , function ( ) { $ ( this ) . remove ( ) } ) } ) } , deleteAQL : function ( a ) { var b = function ( a ) { a ? arangoHelper . arangoError ( " Query " , " Could not delete query . " ) : ( this . updateLocalQueries ( ) , this . updateQueryTable ( ) , this . resize ( ) , window . modalView . hide ( ) ) } . bind ( this ) , c = this . collection . findWhere ( { name : a } ) ; this . collection . remove ( c ) , this . collection . saveCollectionQueries ( b ) } , switchAce : function ( a ) { var b = $ ( a . currentTarget ) . attr ( " counter " ) , c = a . currentTarget ; if ( ! $ ( c ) . hasClass ( " disabled " ) ) { _ . each ( $ ( c ) . parent ( ) . children ( ) , function ( a ) { $ ( a ) . removeClass ( " active " ) } ) ; var d = $ ( c ) . attr ( " val " ) ; $ ( c ) . addClass ( " active " ) , $ ( c ) . text ( d . charAt ( 0 ) . toUpperCase ( ) + d . slice ( 1 ) ) , " JSON " = = = d ? ( $ ( " # outputEditor " + b ) . show ( ) , $ ( " # outputGraph " + b ) . hide ( ) , $ ( " # outputTable " + b ) . hide ( ) ) : " Table " = = = d ? ( $ ( " # outputTable " + b ) . show ( ) , $ ( " # outputGraph " + b ) . hide ( ) , $ ( " # outputEditor " + b ) . hide ( ) ) : " Graph " = = = d & & ( $ ( " # outputGraph " + b ) . show ( ) , $ ( " # outputTable " + b ) . hide ( ) , $ ( " # outputEditor " + b ) . hide ( ) ) , this . deselect ( ace . edit ( " outputEditor " + b ) ) , this . deselect ( ace . edit ( " sentQueryEditor " + b ) ) , this . deselect ( ace . edit ( " sentBindParamEditor " + b ) ) } } , downloadQueryResult : function ( a ) { var b = $ ( a . currentTarget ) . attr ( " counter " ) , c = ace . edit ( " sentQueryEditor " + b ) , d = c . getValue ( ) ; if ( " " ! = = d | | void 0 ! = = d | | null ! = = d ) { var e ; e = 0 = = = Object . keys ( this . bindParamTableObj ) . length ? " query / result / download / " + encodeURIComponent ( btoa ( JSON . stringify ( { query : d } ) ) ) : " query / result / download / " + encodeURIComponent ( btoa ( JSON . stringify ( { query : d , bindVars : this . bindParamTableObj } ) ) ) , arangoHelper . download ( e ) } else arangoHelper . arangoError ( " Query error " , " could not query result . " ) } , explainQuery : function ( ) { if ( ! this . verifyQueryAndParams ( ) ) { this . lastSentQueryString = this . aqlEditor . getValue ( ) , this . $ ( this . outputDiv ) . prepend ( this . outputTemplate . render ( { counter : this . outputCounter , type : " Explain " } ) ) ; var a = this . outputCounter , b = ace . edit ( " outputEditor " + a ) , c = ace . edit ( " sentQueryEditor " + a ) , d = ace . edit ( " sentBindParamEditor " + a ) ; c . getSession ( ) . setMode ( " ace / mode / aql " ) , c . setOption ( " vScrollBarAlwaysVisible " , ! 0 ) , c . setReadOnly ( ! 0 ) , this . setEditorAutoHeight ( c ) , b . setReadOnly ( ! 0 ) , b . getSession ( ) . setMode ( " ace / mode / json " ) , b . setOption ( " vScrollBarAlwaysVisible " , ! 0 ) , this . setEditorAutoHeight ( b ) , d . setValue ( JSON . stringify ( this . bindParamTableObj ) , 1 ) , d . setOption ( " vScrollBarAlwaysVisible " , ! 0 ) , d . getSession ( ) . setMode ( " ace / mode / json " ) , d . setReadOnly ( ! 0 ) , this . setEditorAutoHeight ( d ) , this . fillExplain ( b , c , a ) , this . outputCounter + + } } , fillExplain : function ( a , b , c ) { b . setValue ( this . aqlEditor . getValue ( ) , 1 ) ; var d = this , e = this . readQueryData ( ) ; if ( " false " ! = = e & & ( $ ( " # outputEditorWrapper " + c + " . queryExecutionTime " ) . text ( " " ) , this . execPending = ! 1 , e ) ) { var f = function ( ) { $ ( " # outputEditorWrapper " + c + " # spinner " ) . remove ( ) , $ ( " # outputEditor " + c ) . css ( " opacity " , " 1 " ) , $ ( " # outputEditorWrapper " + c + " . fa - close " ) . show ( ) , $ ( " # outputEditorWrapper " + c + " . switchAce " ) . show ( ) } ; $ . ajax ( { type : " POST " , url : arangoHelper . databaseUrl ( " / _admin / aardvark / query / explain / " ) , data : e , contentType : " application / json " , processData : ! 1 , success : function ( b ) { b . msg . includes ( " errorMessage " ) ? ( d . removeOutputEditor ( c ) , arangoHelper . arangoError ( " Explain " , b . msg ) ) : ( d . cachedQueries [ c ] = b , a . setValue ( b . msg , 1 ) , d . deselect ( a ) , $ . noty . clearQueue ( ) , $ . noty . closeAll ( ) , d . handleResult ( c ) , $ ( " . centralRow " ) . animate ( { scrollTop : $ ( " # queryContent " ) . height ( ) } , " fast " ) ) , f ( ) } , error : function ( a ) { try { var b = JSON . parse ( a . responseText ) ; arangoHelper . arangoError ( " Explain " , b . errorMessage ) } catch ( e ) { arangoHelper . arangoError ( " Explain " , " ERROR " ) } d . handleResult ( c ) , d . removeOutputEditor ( c ) , f ( ) } } ) } } , removeOutputEditor : function ( a ) { $ ( " # outputEditorWrapper " + a ) . hide ( ) , $ ( " # outputEditorWrapper " + a ) . remove ( ) , 0 = = = $ ( " . outputEditorWrapper " ) . length & & $ ( " # removeResults " ) . hide ( ) } , getCachedQueryAfterRender : function ( ) { if ( this . renderComplete = = = ! 1 ) { var a = this . getCachedQuery ( ) , b = this ; if ( null ! = = a & & void 0 ! = = a & & " " ! = = a ) { this . aqlEditor . setValue ( a . query , 1 ) ; var c = localStorage . getItem ( " lastOpenQuery " ) ; if ( void 0 ! = = c & & " undefined " ! = = c ) try { var d = this . collection . findWhere ( { name : c } ) . toJSON ( ) ; d . value = = = a . query & & ( b . breadcrumb ( c ) , $ ( " # updateCurrentQuery " ) . show ( ) ) } catch ( e ) { } if ( this . aqlEditor . getSession ( ) . setUndoManager ( new ace . UndoManager ) , " " ! = = a . parameter | | void 0 ! = = a ) try { b . bindParamTableObj = JSON . parse ( a . parameter ) ; var f ; _ . each ( $ ( " # arangoBindParamTable input " ) , function ( a ) { f = $ ( a ) . attr ( " name " ) , " object " = = typeof b . bindParamTableObj [ f ] ? $ ( a ) . val ( JSON . parse ( b . bindParamTableObj [ f ] ) ) : $ ( a ) . val ( b . bindParamTableObj [ f ] ) } ) , b . setCachedQuery ( b . aqlEditor . getValue ( ) , JSON . stringify ( b . bindParamTableObj ) ) } catch ( e ) { } } this . renderComplete = ! 0 } } , getCachedQuery : function ( ) { if ( " undefined " ! = = Storage ) { var a = localStorage . getItem ( " cachedQuery " ) ; if ( void 0 ! = = a ) { var b = JSON . parse ( a ) ; this . currentQuery = b ; try { this . bindParamTableObj = JSON . parse ( b . parameter ) } catch ( c ) { } return b } } } , setCachedQuery : function ( a , b ) { if ( " " ! = = a & & " undefined " ! = = Storage ) { var c = { query : a , parameter : b } ; this . currentQuery = c , localStorage . setItem ( " cachedQuery " , JSON . stringify ( c ) ) } } , closeResult : function ( a ) { var b = this , c = $ ( " # " + $ ( a . currentTarget ) . attr ( " element " ) ) . parent ( ) , d = $ ( c ) . attr ( " id " ) , e = d . substring ( d . length - 1 , d . length - 0 ) ; delete this . cachedQueries [ e ] , $ ( c ) . hide ( " fast " , function ( ) { $ ( c ) . remove ( ) , 0 = = = $ ( " . outputEditorWrapper " ) . length & & ( b . cachedQueries = { } , $ ( " # removeResults " ) . hide ( ) ) } ) } , fillSelectBoxes : function ( ) { var a = 1e3 , b = $ ( " # querySize " ) ; b . empty ( ) , [ 100 , 250 , 500 , 1e3 , 2500 , 5e3 , 1e4 , " all " ] . forEach ( function ( c ) { b . append ( ' < option value = " ' + _ . escape ( c ) + ' " ' + ( a = = = c ? " selected " : " " ) + " > " + _ . escape ( c ) + " results < / option > " ) } ) } , render : function ( ) { this . refreshAQL ( ) , this . renderComplete = ! 1 , this . $ el . html ( this . template . render ( { } ) ) , this . afterRender ( ) , this . initDone | | ( this . settings . aqlWidth = $ ( " . aqlEditorWrapper " ) . width ( ) ) , " json " = = = this . bindParamMode & & this . toggleBindParams ( ) , this . initDone = ! 0 , this . renderBindParamTable ( ! 0 ) , this . restoreCachedQueries ( ) , this . delegateEvents ( ) } , cleanupGraphs : function ( ) { void 0 = = = this . graphViewers & & null = = = this . graphViewers | | ( _ . each ( this . graphViewers , function ( a ) { void 0 ! = = a & & ( a . killCurrentGraph ( ) , a . remove ( ) ) } ) , $ ( " canvas " ) . remove ( ) , this . graphViewers = null , this . graphViewers = [ ] ) } , afterRender : function ( ) { var a = this ; this . initAce ( ) , this . initTables ( ) , this . fillSelectBoxes ( ) , this . makeResizeable ( ) , this . initQueryImport ( ) , $ ( " . inputEditorWrapper " ) . height ( $ ( window ) . height ( ) / 10 * 5 + 25 ) , window . setTimeout ( function ( ) { a . resize ( ) } , 10 ) , a . deselect ( a . aqlEditor ) } , restoreCachedQueries : function ( ) { var a = this ; Object . keys ( this . cachedQueries ) . length > 0 & & ( _ . each ( this . cachedQueries , function ( b , c ) { a . renderQueryResultBox ( c , null , ! 0 ) , a . renderQueryResult ( b , c , ! 0 ) , a . fillSentQueryValue ( c ) , b . sentQuery & & a . bindQueryResultButtons ( null , c ) } ) , $ ( " # removeResults " ) . show ( ) ) } , fillSentQueryValue : function ( a ) { var b = ace . edit ( " sentQueryEditor " + a ) ; b . setValue ( this . cachedQueries [ a ] . sentQuery , 1 ) } , showSpotlight : function ( a ) { var b , c ; if ( void 0 ! = = a & & " click " ! = = a . type | | ( a = " aql " ) , " aql " = = = a ) b = function ( a ) { this . aqlEditor . insert ( a ) , $ ( " # aqlEditor . ace_text - input " ) . focus ( ) } . bind ( this ) , c = function ( ) { $ ( " # aqlEditor . ace_text - input " ) . focus ( ) } ; else { var d = $ ( " : focus " ) ; b = function ( a ) { var b = $ ( d ) . val ( ) ; $ ( d ) . val ( b + a ) , $ ( d ) . focus ( ) } , c = function ( ) { $ ( d ) . focus ( ) } } window . spotlightView . show ( b , c , a ) } , resize : function ( ) { this . resizeFunction ( ) } , resizeFunction : function ( ) { $ ( " # toggleQueries1 " ) . is ( " : visible " ) ? ( this . aqlEditor . resize ( ) , $ ( " # arangoBindParamTable thead " ) . css ( " width " , $ ( " # bindParamEditor " ) . width ( ) ) , $ ( " # arangoBindParamTable thead th " ) . css ( " width " , $ ( " # bindParamEditor " ) . width ( ) / 2 ) , $ ( " # arangoBindParamTable tr " ) . css ( " width " , $ ( " # bindParamEditor " ) . width ( ) ) , $ ( " # arangoBindParamTable tbody " ) . css ( " height " , $ ( " # aqlEditor " ) . height ( ) - 35 ) , $ ( " # arangoBindParamTable tbody " ) . css ( " width " , $ ( " # bindParamEditor " ) . width ( ) ) , $ ( " # arangoBindParamTable tbody tr " ) . css ( " width " , $ ( " # bindParamEditor " ) . width ( ) ) , $ ( " # arangoBindParamTable tbody td " ) . css ( " width " , $ ( " # bindParamEditor " ) . width ( ) / 2 ) ) : ( this . queryPreview . resize ( ) , $ ( " # arangoMyQueriesTable thead " ) . css ( " width " , $ ( " # queryTable " ) . width ( ) ) , $ ( " # arangoMyQueriesTable thead th " ) . css ( " width " , $ ( " # queryTable " ) . width ( ) / 2 ) , $ ( " # arangoMyQueriesTable tr " ) . css ( " width " , $ ( " # queryTable " ) . width ( ) ) , $ ( " # arangoMyQueriesTable tbody " ) . css ( " height " , $ ( " # queryTable " ) . height ( ) - 35 ) , $ ( " # arangoMyQueriesTable tbody " ) . css ( " width " , $ ( " # queryTable " ) . width ( ) ) , $ ( " # arangoMyQueriesTable tbody td " ) . css ( " width " , $ ( " # queryTable " ) . width ( ) / 2 ) ) } , makeResizeable : function ( ) { var a = this ; $ ( " . aqlEditorWrapper " ) . resizable ( { resize : function ( ) { a . resizeFunction ( ) , a . settings . aqlWidth = $ ( " . aqlEditorWrapper " ) . width ( ) } , handles : " e " } ) , $ ( " . inputEditorWrapper " ) . resizable ( { resize : function ( ) { a . resizeFunction ( ) } , handles : " s " } ) , this . resizeFunction ( ) ; <nl> + } , initTables : function ( ) { this . $ ( this . bindParamId ) . html ( this . table . render ( { content : this . bindParamTableDesc } ) ) , this . $ ( this . myQueriesId ) . html ( this . table . render ( { content : this . myQueriesTableDesc } ) ) } , checkType : function ( a ) { var b = " stringtype " ; try { a = JSON . parse ( a ) , b = a instanceof Array ? " arraytype " : typeof a + " type " } catch ( c ) { } return b } , updateBindParams : function ( a ) { var b , c = this ; if ( a ) { b = $ ( a . currentTarget ) . attr ( " name " ) , this . bindParamTableObj [ b ] = arangoHelper . parseInput ( a . currentTarget ) ; var d = [ " arraytype " , " objecttype " , " booleantype " , " numbertype " , " stringtype " ] ; _ . each ( d , function ( b ) { $ ( a . currentTarget ) . removeClass ( b ) } ) , $ ( a . currentTarget ) . addClass ( c . checkType ( $ ( a . currentTarget ) . val ( ) ) ) } else _ . each ( $ ( " # arangoBindParamTable input " ) , function ( a ) { b = $ ( a ) . attr ( " name " ) , c . bindParamTableObj [ b ] = arangoHelper . parseInput ( a ) } ) ; this . setCachedQuery ( this . aqlEditor . getValue ( ) , JSON . stringify ( this . bindParamTableObj ) ) , a & & ( ( a . ctrlKey | | a . metaKey ) & & 13 = = = a . keyCode & & ( a . preventDefault ( ) , this . executeQuery ( ) ) , ( a . ctrlKey | | a . metaKey ) & & 32 = = = a . keyCode & & ( a . preventDefault ( ) , this . showSpotlight ( " bind " ) ) ) } , parseQuery : function ( a ) { var b = 0 , c = 1 , d = 2 , e = 3 , f = 4 , g = 5 , h = 6 , i = 7 ; a + = " " ; var j , k , l , m = this , n = b , o = a . length , p = [ ] ; for ( k = 0 ; k < o ; + + k ) switch ( l = a . charAt ( k ) , n ) { case b : " @ " = = = l ? ( n = h , j = k ) : " ' " = = = l ? n = c : ' " ' = = = l ? n = d : " ` " = = = l ? n = e : " ´ " = = = l ? n = i : " / " = = = l & & k + 1 < o & & ( " / " = = = a . charAt ( k + 1 ) ? ( n = f , + + k ) : " * " = = = a . charAt ( k + 1 ) & & ( n = g , + + k ) ) ; break ; case f : " \ r " ! = = l & & " \ n " ! = = l | | ( n = b ) ; break ; case g : " * " = = = l & & k + 1 < = o & & " / " = = = a . charAt ( k + 1 ) & & ( n = b , + + k ) ; break ; case c : " \ \ " = = = l ? + + k : " ' " = = = l & & ( n = b ) ; break ; case d : " \ \ " = = = l ? + + k : ' " ' = = = l & & ( n = b ) ; break ; case e : " ` " = = = l & & ( n = b ) ; break ; case i : " ´ " = = = l & & ( n = b ) ; break ; case h : / ^ [ @ a - zA - Z0 - 9_ ] + $ / . test ( l ) | | ( p . push ( a . substring ( j , k ) ) , n = b , j = void 0 ) } var q ; return _ . each ( p , function ( a , b ) { q = a . match ( m . bindParamRegExp ) , q & & ( p [ b ] = q [ 1 ] ) } ) , { query : a , bindParams : p } } , checkForNewBindParams : function ( ) { var a = this , b = this . parseQuery ( this . aqlEditor . getValue ( ) ) . bindParams , c = { } ; _ . each ( b , function ( b ) { a . bindParamTableObj [ b ] ? c [ b ] = a . bindParamTableObj [ b ] : c [ b ] = " " } ) , Object . keys ( b ) . forEach ( function ( b ) { Object . keys ( a . bindParamTableObj ) . forEach ( function ( d ) { b = = = d & & ( c [ b ] = a . bindParamTableObj [ d ] ) } ) } ) , a . bindParamTableObj = c } , renderBindParamTable : function ( a ) { $ ( " # arangoBindParamTable tbody " ) . html ( " " ) , a & & this . getCachedQuery ( ) ; var b = 0 ; _ . each ( this . bindParamTableObj , function ( a , c ) { $ ( " # arangoBindParamTable tbody " ) . append ( " < tr > < td > " + c + " < / td > < td > < input name = " + c + ' type = " text " > < / input > < / td > < / tr > ' ) , b + + , _ . each ( $ ( " # arangoBindParamTable input " ) , function ( b ) { $ ( b ) . attr ( " name " ) = = = c & & ( a instanceof Array ? $ ( b ) . val ( JSON . stringify ( a ) ) . addClass ( " arraytype " ) : " object " = = typeof a ? $ ( b ) . val ( JSON . stringify ( a ) ) . addClass ( typeof a + " type " ) : $ ( b ) . val ( a ) . addClass ( typeof a + " type " ) ) } ) } ) , 0 = = = b & & $ ( " # arangoBindParamTable tbody " ) . append ( ' < tr class = " noBgColor " > < td > No bind parameters defined . < / td > < td > < / td > < / tr > ' ) ; var c = localStorage . getItem ( " lastOpenQuery " ) , d = this . collection . findWhere ( { name : c } ) ; try { d = d . toJSON ( ) } catch ( e ) { } if ( d ) { var f ; _ . each ( $ ( " # arangoBindParamTable input " ) , function ( a ) { f = $ ( a ) . attr ( " name " ) , _ . each ( d . parameter , function ( b , c ) { c = = = f & & $ ( a ) . val ( b ) } ) } ) } } , fillBindParamTable : function ( a ) { _ . each ( a , function ( a , b ) { _ . each ( $ ( " # arangoBindParamTable input " ) , function ( c ) { $ ( c ) . attr ( " name " ) = = = b & & $ ( c ) . val ( a ) } ) } ) } , initAce : function ( ) { var a = this ; this . aqlEditor = ace . edit ( " aqlEditor " ) , this . aqlEditor . getSession ( ) . setMode ( " ace / mode / aql " ) , this . aqlEditor . setFontSize ( " 10pt " ) , this . aqlEditor . setShowPrintMargin ( ! 1 ) , this . bindParamAceEditor = ace . edit ( " bindParamAceEditor " ) , this . bindParamAceEditor . getSession ( ) . setMode ( " ace / mode / json " ) , this . bindParamAceEditor . setFontSize ( " 10pt " ) , this . bindParamAceEditor . setShowPrintMargin ( ! 1 ) , this . bindParamAceEditor . getSession ( ) . on ( " change " , function ( ) { try { a . bindParamTableObj = JSON . parse ( a . bindParamAceEditor . getValue ( ) ) , a . allowParamToggle = ! 0 , a . setCachedQuery ( a . aqlEditor . getValue ( ) , JSON . stringify ( a . bindParamTableObj ) ) } catch ( b ) { " " = = = a . bindParamAceEditor . getValue ( ) ? ( _ . each ( a . bindParamTableObj , function ( b , c ) { a . bindParamTableObj [ c ] = " " } ) , a . allowParamToggle = ! 0 ) : a . allowParamToggle = ! 1 } } ) , this . aqlEditor . getSession ( ) . on ( " change " , function ( ) { if ( a . aqlEditor . getValue ( ) . length < 1 & & Object . keys ( a . bindParamTableObj ) . length > 0 & & ( a . lastCachedBindParameter = a . bindParamTableObj ) , a . checkForNewBindParams ( ) , a . renderBindParamTable ( ) , a . parseQuery ( a . aqlEditor . getValue ( ) ) . bindParams . length > 0 ) { var b = [ ] ; if ( _ . each ( a . parseQuery ( a . aqlEditor . getValue ( ) ) . bindParams , function ( c ) { if ( void 0 ! = = $ ( " input [ name = ' " + c + " ' ] " ) & & $ ( " input [ name = ' " + c + " ' ] " ) . length > 0 & & 0 = = = $ ( " input [ name = ' " + c + " ' ] " ) . val ( ) . length & & a . lastCachedBindParameter ) { var d = $ ( " input [ name = ' " + c + " ' ] " ) . val ( ) ; a . lastCachedBindParameter [ c ] & & a . lastCachedBindParameter [ c ] ! = = d & & b . push ( c ) } } ) , b . length > 0 ) { var c = { } ; _ . each ( b , function ( b , d ) { c [ b ] = a . lastCachedBindParameter [ b ] } ) , a . bindParamTableObj = c , a . renderBindParamTable ( ) } } a . initDone & & a . setCachedQuery ( a . aqlEditor . getValue ( ) , JSON . stringify ( a . bindParamTableObj ) ) , a . bindParamAceEditor . setValue ( JSON . stringify ( a . bindParamTableObj , null , " \ t " ) , 1 ) , $ ( " # aqlEditor . ace_text - input " ) . focus ( ) , a . resize ( ) } ) ; var b = function ( a ) { _ . each ( $ ( " . outputEditors " ) , function ( b ) { var c = $ ( b ) . children ( ) . first ( ) . attr ( " id " ) ; c = c . replace ( " Wrapper " , " " ) ; var d = ace . edit ( c ) ; d . setFontSize ( a ) } ) } , c = [ this . aqlEditor , this . bindParamAceEditor ] ; _ . each ( c , function ( c ) { c . commands . addCommand ( { name : " togglecomment " , bindKey : { win : " Ctrl - Shift - C " , linux : " Ctrl - Shift - C " , mac : " Command - Shift - C " } , exec : function ( a ) { a . toggleCommentLines ( ) } , multiSelectAction : " forEach " } ) , c . commands . addCommand ( { name : " increaseFontSize " , bindKey : { win : " Shift - Alt - Up " , linux : " Shift - Alt - Up " , mac : " Shift - Alt - Up " } , exec : function ( c ) { var d = parseInt ( a . aqlEditor . getFontSize ( ) . match ( / \ d + / ) [ 0 ] , 10 ) + 1 ; d + = " pt " , a . aqlEditor . setFontSize ( d ) , b ( d ) } , multiSelectAction : " forEach " } ) , c . commands . addCommand ( { name : " decreaseFontSize " , bindKey : { win : " Shift - Alt - Down " , linux : " Shift - Alt - Down " , mac : " Shift - Alt - Down " } , exec : function ( c ) { var d = parseInt ( a . aqlEditor . getFontSize ( ) . match ( / \ d + / ) [ 0 ] , 10 ) - 1 ; d + = " pt " , a . aqlEditor . setFontSize ( d ) , b ( d ) } , multiSelectAction : " forEach " } ) , c . commands . addCommand ( { name : " executeQuery " , bindKey : { win : " Ctrl - Return " , mac : " Command - Return " , linux : " Ctrl - Return " } , exec : function ( ) { a . executeQuery ( ) } } ) , c . commands . addCommand ( { name : " executeSelectedQuery " , bindKey : { win : " Ctrl - Alt - Return " , mac : " Command - Alt - Return " , linux : " Ctrl - Alt - Return " } , exec : function ( ) { a . executeQuery ( void 0 , ! 0 ) } } ) , c . commands . addCommand ( { name : " saveQuery " , bindKey : { win : " Ctrl - Shift - S " , mac : " Command - Shift - S " , linux : " Ctrl - Shift - S " } , exec : function ( ) { a . addAQL ( ) } } ) , c . commands . addCommand ( { name : " explainQuery " , bindKey : { win : " Ctrl - Shift - Return " , mac : " Command - Shift - Return " , linux : " Ctrl - Shift - Return " } , exec : function ( ) { a . explainQuery ( ) } } ) , c . commands . addCommand ( { name : " togglecomment " , bindKey : { win : " Ctrl - Shift - C " , linux : " Ctrl - Shift - C " , mac : " Command - Shift - C " } , exec : function ( a ) { a . toggleCommentLines ( ) } , multiSelectAction : " forEach " } ) , c . commands . addCommand ( { name : " showSpotlight " , bindKey : { win : " Ctrl - Space " , mac : " Ctrl - Space " , linux : " Ctrl - Space " } , exec : function ( ) { a . showSpotlight ( ) } } ) } ) , this . queryPreview = ace . edit ( " queryPreview " ) , this . queryPreview . getSession ( ) . setMode ( " ace / mode / aql " ) , this . queryPreview . setReadOnly ( ! 0 ) , this . queryPreview . setFontSize ( " 13px " ) , $ ( " # aqlEditor . ace_text - input " ) . focus ( ) } , updateQueryTable : function ( ) { function a ( a , b ) { var c ; return c = a . name < b . name ? - 1 : a . name > b . name ? 1 : 0 } var b = this ; this . updateLocalQueries ( ) , this . myQueriesTableDesc . rows = this . customQueries , _ . each ( this . myQueriesTableDesc . rows , function ( a ) { a . secondRow = ' < span class = " spanWrapper " > < span id = " copyQuery " title = " Copy query " > < i class = " fa fa - copy " > < / i > < / span > < span id = " explQuery " title = " Explain query " > < i class = " fa fa - comments " > < / i > < / i > < / span > < span id = " runQuery " title = " Run query " > < i class = " fa fa - play - circle - o " > < / i > < / i > < / span > < span id = " deleteQuery " title = " Delete query " > < i class = " fa fa - minus - circle " > < / i > < / span > < / span > ' , a . hasOwnProperty ( " parameter " ) & & delete a . parameter , delete a . value } ) , this . myQueriesTableDesc . rows . sort ( a ) , _ . each ( this . queries , function ( a ) { a . hasOwnProperty ( " parameter " ) & & delete a . parameter , b . myQueriesTableDesc . rows . push ( { name : a . name , thirdRow : ' < span class = " spanWrapper " > < span id = " copyQuery " title = " Copy query " > < i class = " fa fa - copy " > < / i > < / span > < / span > ' } ) } ) , this . myQueriesTableDesc . unescaped = [ ! 1 , ! 0 , ! 0 ] , this . $ ( this . myQueriesId ) . html ( this . table . render ( { content : this . myQueriesTableDesc } ) ) } , listenKey : function ( a ) { 13 = = = a . keyCode & & " Update " = = = $ ( " # modalButton1 " ) . html ( ) & & this . saveAQL ( ) , this . checkSaveName ( ) } , addAQL : function ( ) { this . refreshAQL ( ! 0 ) , this . createCustomQueryModal ( ) , setTimeout ( function ( ) { $ ( " # new - query - name " ) . focus ( ) } , 500 ) } , updateAQL : function ( ) { var a = this . aqlEditor . getValue ( ) , b = $ ( " # lastQueryName " ) . html ( ) , c = this . collection . findWhere ( { name : b } ) ; if ( c ) { c . set ( " value " , a ) , c . set ( " parameter " , this . bindParamTableObj ) ; var d = function ( a ) { if ( a ) arangoHelper . arangoError ( " Query " , " Could not save query " ) ; else { var c = this ; arangoHelper . arangoNotification ( " Saved query " , ' " ' + b + ' " ' ) , this . collection . fetch ( { success : function ( ) { c . updateLocalQueries ( ) } } ) } } . bind ( this ) ; this . collection . saveCollectionQueries ( d ) } this . refreshAQL ( ! 0 ) } , createAQL : function ( ) { localStorage . setItem ( " lastOpenQuery " , void 0 ) , this . aqlEditor . setValue ( " " ) , this . refreshAQL ( ! 0 ) , this . breadcrumb ( ) , $ ( " # updateCurrentQuery " ) . hide ( ) } , createCustomQueryModal : function ( ) { var a = [ ] , b = [ ] ; b . push ( window . modalView . createTextEntry ( " new - query - name " , " Name " , " " , void 0 , void 0 , ! 1 , [ { rule : Joi . string ( ) . required ( ) , msg : " No query name given . " } ] ) ) , a . push ( window . modalView . createSuccessButton ( " Save " , this . saveAQL . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Save Query " , a , b , void 0 , void 0 , { " keyup # new - query - name " : this . listenKey . bind ( this ) } ) } , checkSaveName : function ( ) { var a = $ ( " # new - query - name " ) . val ( ) ; if ( " Insert Query " = = = a ) return void $ ( " # new - query - name " ) . val ( " " ) ; var b = this . customQueries . some ( function ( b ) { return b . name = = = a } ) ; b ? ( $ ( " # modalButton1 " ) . removeClass ( " button - success " ) , $ ( " # modalButton1 " ) . addClass ( " button - warning " ) , $ ( " # modalButton1 " ) . text ( " Update " ) ) : ( $ ( " # modalButton1 " ) . removeClass ( " button - warning " ) , $ ( " # modalButton1 " ) . addClass ( " button - success " ) , $ ( " # modalButton1 " ) . text ( " Save " ) ) } , saveAQL : function ( a ) { a & & a . stopPropagation ( ) , this . refreshAQL ( ) ; var b = $ ( " # new - query - name " ) . val ( ) , c = this . bindParamTableObj ; if ( ! $ ( " # new - query - name " ) . hasClass ( " invalid - input " ) & & " " ! = = b . trim ( ) ) { var d = this . aqlEditor . getValue ( ) , e = ! 1 ; if ( _ . each ( this . customQueries , function ( a ) { if ( a . name = = = b ) return a . value = d , void ( e = ! 0 ) } ) , e = = = ! 0 ) this . collection . findWhere ( { name : b } ) . set ( " value " , d ) ; else { if ( " " ! = = c & & void 0 ! = = c | | ( c = " { } " ) , " string " = = typeof c ) try { c = JSON . parse ( c ) } catch ( f ) { arangoHelper . arangoError ( " Query " , " Could not parse bind parameter " ) } this . collection . add ( { name : b , parameter : c , value : d } ) } var g = function ( a ) { if ( a ) arangoHelper . arangoError ( " Query " , " Could not save query " ) ; else { var c = this ; this . collection . fetch ( { success : function ( ) { c . updateLocalQueries ( ) , $ ( " # updateCurrentQuery " ) . show ( ) , c . breadcrumb ( b ) } } ) } } . bind ( this ) ; this . collection . saveCollectionQueries ( g ) , window . modalView . hide ( ) } } , breadcrumb : function ( a ) { window . setTimeout ( function ( ) { a ? $ ( " # subNavigationBar . breadcrumb " ) . html ( ' Query : < span id = " lastQueryName " > ' + a + " < / span > " ) : $ ( " # subNavigationBar . breadcrumb " ) . html ( " " ) } , 50 ) } , verifyQueryAndParams : function ( ) { var a = ! 1 ; 0 = = = this . aqlEditor . getValue ( ) . length & & ( arangoHelper . arangoError ( " Query " , " Your query is empty " ) , a = ! 0 ) ; var b = [ ] ; return _ . each ( this . bindParamTableObj , function ( c , d ) { " " = = = c & & ( a = ! 0 , b . push ( d ) ) } ) , b . length > 0 & & arangoHelper . arangoError ( " Bind Parameter " , JSON . stringify ( b ) + " not defined . " ) , a } , executeQuery : function ( a , b ) { this . verifyQueryAndParams ( ) | | ( $ ( " # outputEditorWrapper " + this . outputCounter ) . hide ( ) , $ ( " # outputEditorWrapper " + this . outputCounter ) . show ( " fast " ) , this . lastSentQueryString = this . aqlEditor . getValue ( ) , this . renderQueryResultBox ( this . outputCounter , b ) ) } , renderQueryResultBox : function ( a , b , c ) { this . $ ( this . outputDiv ) . prepend ( this . outputTemplate . render ( { counter : a , type : " Query " } ) ) ; var d = ace . edit ( " outputEditor " + a ) , e = ace . edit ( " sentQueryEditor " + a ) , f = ace . edit ( " sentBindParamEditor " + a ) ; e . getSession ( ) . setMode ( " ace / mode / aql " ) , e . setOption ( " vScrollBarAlwaysVisible " , ! 0 ) , e . setFontSize ( " 13px " ) , e . setReadOnly ( ! 0 ) , this . setEditorAutoHeight ( e ) , d . setFontSize ( " 13px " ) , d . getSession ( ) . setMode ( " ace / mode / json " ) , d . setReadOnly ( ! 0 ) , d . setOption ( " vScrollBarAlwaysVisible " , ! 0 ) , d . setShowPrintMargin ( ! 1 ) , this . setEditorAutoHeight ( d ) , f . setValue ( JSON . stringify ( this . bindParamTableObj ) , 1 ) , f . setOption ( " vScrollBarAlwaysVisible " , ! 0 ) , f . getSession ( ) . setMode ( " ace / mode / json " ) , f . setReadOnly ( ! 0 ) , this . setEditorAutoHeight ( f ) , c | | ( this . fillResult ( a , b ) , this . outputCounter + + ) } , readQueryData : function ( a , b ) { var c = $ ( " # querySize " ) , d = { id : " currentFrontendQuery " } ; if ( a ? d . query = this . aqlEditor . getSelectedText ( ) : d . query = this . aqlEditor . getValue ( ) , 0 = = = d . query . length ) a ? arangoHelper . arangoError ( " Query " , " Your query selection is empty ! " ) : arangoHelper . arangoError ( " Query " , " Your query is empty ! " ) , d = ! 1 ; else { " all " = = = c . val ( ) ? d . batchSize = 1e6 : d . batchSize = parseInt ( c . val ( ) , 10 ) ; var e = { } ; Object . keys ( this . bindParamTableObj ) . length > 0 & & ( _ . each ( this . bindParamTableObj , function ( a , b ) { d . query . indexOf ( b ) > - 1 & & ( e [ b ] = a ) } ) , d . bindVars = this . bindParamTableObj ) , Object . keys ( e ) . length > 0 & & ( d . bindVars = e ) , b & & ( d . options = { profile : ! 0 } ) } return JSON . stringify ( d ) } , fillResult : function ( a , b ) { var c = this , d = this . readQueryData ( b , ! 0 ) ; if ( " false " ! = = d & & d ) { var e = ace . edit ( " sentQueryEditor " + a ) ; e . setValue ( c . aqlEditor . getValue ( ) , 1 ) , $ . ajax ( { type : " POST " , url : arangoHelper . databaseUrl ( " / _api / cursor " ) , headers : { " x - arango - async " : " store " } , data : d , contentType : " application / json " , processData : ! 1 , success : function ( b , d , e ) { e . getResponseHeader ( " x - arango - async - id " ) & & c . queryCallbackFunction ( e . getResponseHeader ( " x - arango - async - id " ) , a ) , $ . noty . clearQueue ( ) , $ . noty . closeAll ( ) , c . handleResult ( a ) } , error : function ( b ) { try { var d = JSON . parse ( b . responseText ) ; arangoHelper . arangoError ( " [ " + d . errorNum + " ] " , d . errorMessage ) } catch ( e ) { arangoHelper . arangoError ( " Query error " , " ERROR " ) } c . handleResult ( a ) } } ) } } , handleResult : function ( ) { var a = this ; window . progressView . hide ( ) , $ ( " # removeResults " ) . show ( ) , window . setTimeout ( function ( ) { a . aqlEditor . focus ( ) } , 300 ) } , setEditorAutoHeight : function ( a ) { var b = $ ( " . centralRow " ) . height ( ) , c = ( b - 250 ) / 17 ; a . setOptions ( { maxLines : c , minLines : 10 } ) } , deselect : function ( a ) { var b = a . getSelection ( ) , c = b . lead . row , d = b . lead . column ; b . setSelectionRange ( { start : { row : c , column : d } , end : { row : c , column : d } } ) , a . focus ( ) } , warningsFunc : function ( a , b ) { var c = " " ; a . extra & & a . extra . warnings & & a . extra . warnings . length > 0 & & ( c + = " Warnings : \ r \ n \ r \ n " , a . extra . warnings . forEach ( function ( a ) { c + = " [ " + a . code + " ] , ' " + a . message + " ' \ r \ n " } ) ) , " " ! = = c & & ( c + = " \ r \ nResult : \ r \ n \ r \ n " ) , b . setValue ( c + JSON . stringify ( a . result , void 0 , 2 ) , 1 ) , b . getSession ( ) . setScrollTop ( 0 ) } , renderQueryResult : function ( a , b , c ) { var d = this ; if ( " # queries " = = = window . location . hash ) { var e , f = ace . edit ( " outputEditor " + b ) ; if ( ! a . msg ) { var g = d . analyseQuery ( a . result ) ; if ( " table " = = = g . defaultType ) { $ ( " # outputEditorWrapper " + b + " . arangoToolbarTop " ) . after ( ' < div id = " outputTable ' + b + ' " class = " outputTable " > < / div > ' ) , $ ( " # outputTable " + b ) . show ( ) , d . renderOutputTable ( g , b ) ; var h = $ ( " . centralRow " ) . height ( ) - 250 ; $ ( " . outputEditorWrapper . tableWrapper " ) . css ( " max - height " , h ) , $ ( " # outputEditor " + b ) . hide ( ) , e = ! 0 } else " graph " = = = g . defaultType & & ( $ ( " # outputEditorWrapper " + b + " . arangoToolbarTop " ) . after ( ' < div id = " outputGraph ' + b + ' " > < / div > ' ) , $ ( " # outputGraph " + b ) . show ( ) , e = d . renderOutputGraph ( g , b ) , e ? ( $ ( " # outputEditor " + b ) . hide ( ) , $ ( " # outputEditorWrapper " + b + " # copy2gV " ) . show ( ) , $ ( " # outputEditorWrapper " + b + " # copy2gV " ) . bind ( " click " , function ( ) { d . showResultInGraphViewer ( g , b ) } ) ) : $ ( " # outputGraph " + b ) . remove ( ) ) ; e ! = = ! 1 ? $ ( " # " + g . defaultType + " - switch " ) . addClass ( " active " ) . css ( " display " , " inline " ) : $ ( " # json - switch " ) . addClass ( " active " ) . css ( " display " , " inline " ) ; var i = function ( a , c , d ) { d | | ( d = " " ) , $ ( " # outputEditorWrapper " + b + " . arangoToolbarTop . pull - left " ) . append ( ' < span class = " ' + d + ' " > < i class = " fa ' + c + ' " > < / i > < i class = " iconText " > ' + a + " < / i > < / span > " ) } , j = " - " ; a & & a . extra & & a . extra . stats & & ( j = a . extra . stats . executionTime . toFixed ( 3 ) + " s " ) , i ( a . result . length + " elements " , " fa - calculator " ) , i ( j , " fa - clock - o " ) , a . extra & & ( a . extra . profile & & ( i ( " " , " fa - caret - down " ) , d . appendProfileDetails ( b , a . extra . profile ) ) , a . extra . stats & & ( a . extra . stats . writesExecuted > 0 | | a . extra . stats . writesIgnored > 0 ) & & ( i ( a . extra . stats . writesExecuted + " writes " , " fa - check - circle positive " ) , 0 = = = a . extra . stats . writesIgnored ? i ( a . extra . stats . writesIgnored + " writes ignored " , " fa - check - circle positive " , " additional " ) : i ( a . extra . stats . writesIgnored + " writes ignored " , " fa - exclamation - circle warning " , " additional " ) ) ) } $ ( " # outputEditorWrapper " + b + " . pull - left # spinner " ) . remove ( ) , $ ( " # outputEditorWrapper " + b + " # cancelCurrentQuery " ) . remove ( ) , d . warningsFunc ( a , f ) , window . progressView . hide ( ) , $ ( " # outputEditorWrapper " + b + " . switchAce " ) . show ( ) , $ ( " # outputEditorWrapper " + b + " . fa - close " ) . show ( ) , $ ( " # outputEditor " + b ) . css ( " opacity " , " 1 " ) , a . msg | | ( $ ( " # outputEditorWrapper " + b + " # downloadQueryResult " ) . show ( ) , $ ( " # outputEditorWrapper " + b + " # copy2aqlEditor " ) . show ( ) ) , d . setEditorAutoHeight ( f ) , d . deselect ( f ) , a . id & & $ . ajax ( { url : arangoHelper . databaseUrl ( " / _api / cursor / " + encodeURIComponent ( a . id ) ) , type : " DELETE " } ) , c | | ( d . cachedQueries [ b ] = a , this . cachedQueries [ b ] . sentQuery = d . aqlEditor . getValue ( ) ) , a . msg & & ( $ ( " # outputEditorWrapper " + b + " . toolbarType " ) . html ( " Explain " ) , f . setValue ( a . msg , 1 ) ) } else d . cachedQueries [ b ] = a , d . cachedQueries [ b ] . sentQuery = d . lastSentQueryString , arangoHelper . arangoNotification ( " Query finished " , " Return to queries view to see the result . " ) } , bindQueryResultButtons : function ( a , b ) { var c = this ; if ( a ) var d = function ( a , b ) { $ . ajax ( { url : arangoHelper . databaseUrl ( " / _api / job / " + encodeURIComponent ( a ) + " / cancel " ) , type : " PUT " , success : function ( ) { window . clearTimeout ( c . checkQueryTimer ) , $ ( " # outputEditorWrapper " + b ) . remove ( ) , arangoHelper . arangoNotification ( " Query " , " Query canceled . " ) } } ) } ; $ ( " # outputEditorWrapper " + b + " # cancelCurrentQuery " ) . bind ( " click " , function ( ) { d ( a , b ) } ) , $ ( " # outputEditorWrapper " + b + " # copy2aqlEditor " ) . bind ( " click " , function ( ) { $ ( " # toggleQueries1 " ) . is ( " : visible " ) | | c . toggleQueries ( ) ; var a = ace . edit ( " sentQueryEditor " + b ) . getValue ( ) , d = JSON . parse ( ace . edit ( " sentBindParamEditor " + b ) . getValue ( ) ) ; c . aqlEditor . setValue ( a , 1 ) , c . deselect ( c . aqlEditor ) , Object . keys ( d ) . length > 0 & & ( c . bindParamTableObj = d , c . setCachedQuery ( c . aqlEditor . getValue ( ) , JSON . stringify ( c . bindParamTableObj ) ) , $ ( " # bindParamEditor " ) . is ( " : visible " ) ? c . renderBindParamTable ( ) : ( c . bindParamAceEditor . setValue ( JSON . stringify ( d ) , 1 ) , c . deselect ( c . bindParamAceEditor ) ) ) , $ ( " . centralRow " ) . animate ( { scrollTop : 0 } , " fast " ) , c . resize ( ) } ) } , queryCallbackFunction : function ( a , b ) { var c = this ; this . bindQueryResultButtons ( a , b ) , this . execPending = ! 1 ; var d = function ( ) { $ . ajax ( { type : " PUT " , url : arangoHelper . databaseUrl ( " / _api / job / " + encodeURIComponent ( a ) ) , contentType : " application / json " , processData : ! 1 , success : function ( a , e , f ) { 201 = = = f . status ? ( c . renderQueryResult ( a , b ) , $ ( " . centralRow " ) . animate ( { scrollTop : $ ( " # queryContent " ) . height ( ) } , " fast " ) ) : 204 = = = f . status & & ( c . checkQueryTimer = window . setTimeout ( function ( ) { d ( ) } , 500 ) ) } , error : function ( a ) { var d ; try { if ( " Gone " = = = a . statusText ) return arangoHelper . arangoNotification ( " Query " , " Query execution aborted . " ) , void c . removeOutputEditor ( b ) ; d = JSON . parse ( a . responseText ) , arangoHelper . arangoError ( " Query " , d . errorMessage ) , d . errorMessage & & ( null ! = = d . errorMessage . match ( / \ d + : \ d + / g ) ? c . markPositionError ( d . errorMessage . match ( / ' . * ' / g ) [ 0 ] , d . errorMessage . match ( / \ d + : \ d + / g ) [ 0 ] ) : c . markPositionError ( d . errorMessage . match ( / \ ( \ w + \ ) / g ) [ 0 ] ) , c . removeOutputEditor ( b ) ) } catch ( e ) { if ( c . removeOutputEditor ( b ) , 409 = = = d . code ) return ; 400 ! = = d . code & & 404 ! = = d . code & & 500 ! = = d . code & & arangoHelper . arangoNotification ( " Query " , " Successfully aborted . " ) } window . progressView . hide ( ) } } ) } ; d ( ) } , appendProfileDetails : function ( a , b ) { var c = " # outputEditorWrapper " + a ; $ ( c + " . fa - caret - down " ) . first ( ) . on ( " click " , function ( ) { var d = $ ( c ) . find ( " . queryProfile " ) ; if ( $ ( d ) . is ( " : visible " ) ) $ ( c ) . find ( " . queryProfile " ) . remove ( ) ; else { $ ( c ) . append ( ' < div class = " queryProfile " counter = " ' + a + ' " > < / div > ' ) ; var e = $ ( c + " . queryProfile " ) . first ( ) ; e . hide ( ) , e . css ( " position " , " absolute " ) . css ( " left " , 215 ) . css ( " top " , 55 ) ; var f = 590 , g = [ " A " , " B " , " C " , " D " , " E " , " F " , " G " ] , h = [ " rgb ( 48 , 125 , 153 ) " , " rgb ( 241 , 124 , 176 ) " , " rgb ( 137 , 110 , 37 ) " , " rgb ( 93 , 165 , 218 ) " , " rgb ( 250 , 164 , 58 ) " , " rgb ( 64 , 74 , 83 ) " , " rgb ( 96 , 189 , 104 ) " ] , i = [ " startup time for query engine " , " query parsing " , " abstract syntax tree optimizations " , " loading collections " , " instanciation of initial execution plan " , " execution plan optimization and permutation " , " query execution " ] ; e . append ( ' < i class = " fa fa - close closeProfile " > < / i > < span class = " profileHeader " > Profiling information < / span > < div class = " pure - g pure - table pure - table - body " > < / div > < div class = " prof - progress " > < / div > < div class = " prof - progress - label " > < / div > < div class = " clear " > < / div > ' ) ; var j = 0 ; _ . each ( b , function ( a ) { j + = 1e3 * a } ) ; var k , l = 0 , m = 0 ; _ . each ( b , function ( a , b ) { var c = numeral ( 1e3 * a ) . format ( " 0 . 000 " ) ; c + = " ms " , e . find ( " . pure - g " ) . append ( ' < div class = " pure - table - row noHover " > < div class = " pure - u - 1 - 24 left " > < p class = " bold " style = " background : ' + h [ l ] + ' " > ' + g [ l ] + ' < / p > < / div > < div class = " pure - u - 4 - 24 left " > ' + c + ' < / div > < div class = " pure - u - 6 - 24 left " > ' + b + ' < / div > < div class = " pure - u - 13 - 24 left " > ' + i [ l ] + " < / div > < / div > " ) , k = Math . floor ( 1e3 * a / j * 100 ) , 0 = = = k & & ( k = 1 , m + + ) , 6 ! = = l ? ( e . find ( " . prof - progress " ) . append ( ' < div style = " width : ' + k + " % ; background - color : " + h [ l ] + ' " > < / div > ' ) , k > 1 ? e . find ( " . prof - progress - label " ) . append ( ' < div style = " width : ' + k + ' % ; " > ' + g [ l ] + " < / div > " ) : e . find ( " . prof - progress - label " ) . append ( ' < div style = " width : ' + k + ' % ; font - size : 9px " > ' + g [ l ] + " < / div > " ) ) : ( m > 0 & & ( k - = m ) , e . find ( " . prof - progress " ) . append ( ' < div style = " width : ' + k + " % ; background - color : " + h [ l ] + ' " > < / div > ' ) , k > 1 ? e . find ( " . prof - progress - label " ) . append ( ' < div style = " width : ' + k + ' % ; " > ' + g [ l ] + " < / div > " ) : e . find ( " . prof - progress - label " ) . append ( ' < div style = " width : ' + k + ' % ; font - size : 9px " > ' + g [ l ] + " < / div > " ) ) , l + + } ) , e . width ( f ) , e . height ( " auto " ) , e . fadeIn ( " fast " ) } } ) } , analyseQuery : function ( a ) { var b = { defaultType : null , original : a , modified : null } , c = ! 1 ; if ( ! Array . isArray ( a ) ) return b . defaultType = " json " , b ; if ( a [ 0 ] ) if ( a [ 0 ] . vertices & & a [ 0 ] . edges ) { var d = 0 , e = 0 ; _ . each ( a , function ( a ) { a . edges & & _ . each ( a . edges , function ( a ) { null ! = = a & & ( a . _from & & a . _to & & d + + , e + + ) } ) } ) ; var f = 0 ; e > 0 & & ( f = d / e * 100 ) , f > = 95 & & ( c = ! 0 , b . defaultType = " graph " , b . graphInfo = " object " ) } else { var g = 0 , h = a . length ; _ . each ( a , function ( a ) { a . _from & & a . _to & & a . _id & & g + + } ) ; var i = 0 ; h > 0 & & ( i = g / h * 100 ) , i > = 95 & & ( c = ! 0 , b . defaultType = " graph " , b . graphInfo = " array " ) } if ( ! c ) { var j = ! 0 , k = { } ; if ( a . length < = 1 & & ( j = ! 1 ) , j ) { _ . each ( a , function ( a ) { " object " ! = typeof a | | null = = = a | | Array . isArray ( a ) | | _ . each ( a , function ( a , b ) { k . hasOwnProperty ( b ) ? + + k [ b ] : k [ b ] = 1 } ) } ) ; var l = 0 ; _ . each ( k , function ( b , c ) { j ! = = ! 1 & & ( l = b / a . length * 100 , l < = 95 & & ( j = ! 1 ) ) } ) , l < = 95 & & ( j = ! 1 ) } j & & ( c = ! 0 , b . defaultType = " table " ) } return c | | ( b . defaultType = " json " ) , b } , markPositionError : function ( a , b ) { var c ; b & & ( c = b . split ( " : " ) [ 0 ] , a = a . substr ( 1 , a . length - 2 ) ) ; var d = this . aqlEditor . find ( a ) ; ! d & & b & & ( this . aqlEditor . selection . moveCursorToPosition ( { row : c , column : 0 } ) , this . aqlEditor . selection . selectLine ( ) ) , window . setTimeout ( function ( ) { $ ( " . ace_start " ) . first ( ) . css ( " background " , " rgba ( 255 , 129 , 129 , 0 . 7 ) " ) } , 100 ) } , refreshAQL : function ( ) { var a = this , b = function ( b ) { b ? arangoHelper . arangoError ( " Query " , " Could not reload Queries " ) : ( a . updateLocalQueries ( ) , a . updateQueryTable ( ) ) } , c = function ( ) { a . getSystemQueries ( b ) } ; this . getAQL ( c ) } , getSystemQueries : function ( a ) { var b = this ; $ . ajax ( { type : " GET " , cache : ! 1 , url : " js / arango / aqltemplates . json " , contentType : " application / json " , processData : ! 1 , success : function ( c ) { a & & a ( ! 1 ) , b . queries = c } , error : function ( ) { a & & a ( ! 0 ) , arangoHelper . arangoNotification ( " Query " , " Error while loading system templates " ) } } ) } , updateLocalQueries : function ( ) { var a = this ; this . customQueries = [ ] , this . collection . each ( function ( b ) { a . customQueries . push ( { name : b . get ( " name " ) , value : b . get ( " value " ) , parameter : b . get ( " parameter " ) } ) } ) } , renderOutputTable : function ( a , b ) { var c = { id : " outputTableData " + b , titles : [ ] , rows : [ ] } , d = ! 0 , e = [ ] ; _ . each ( a . original , function ( a ) { d = = = ! 0 & & ( c . titles = Object . keys ( a ) , d = ! 1 ) , _ . each ( a , function ( a ) { " object " = = typeof a & & ( a = JSON . stringify ( a ) ) , e . push ( a ) } ) , c . rows . push ( e ) , e = [ ] } ) , $ ( " # outputTable " + b ) . append ( this . table . render ( { content : c } ) ) } , renderOutputGraph : function ( a , b ) { this . graphViewers [ b ] = new window . GraphViewer ( { name : void 0 , documentStore : window . App . arangoDocumentStore , collection : new window . GraphCollection , userConfig : window . App . userConfig , id : " # outputGraph " + b , data : a } ) ; var c = this . graphViewers [ b ] . renderAQLPreview ( ) ; return c } , showResultInGraphViewer : function ( a , b ) { window . location . hash = " # aql_graph " , window . App . graphViewer & & ( window . App . graphViewer . graphSettingsView & & window . App . graphViewer . graphSettingsView . remove ( ) , window . App . graphViewer . remove ( ) ) , window . App . graphViewer = new window . GraphViewer ( { name : void 0 , documentStore : window . App . arangoDocumentStore , collection : new window . GraphCollection , userConfig : window . App . userConfig , noDefinedGraph : ! 0 , data : a } ) , window . App . graphViewer . renderAQL ( ) } , getAQL : function ( a ) { var b = this ; this . collection . fetch ( { success : function ( ) { b . getCachedQueryAfterRender ( ) ; var c = localStorage . getItem ( " customQueries " ) ; if ( c ) { var d = JSON . parse ( c ) ; _ . each ( d , function ( a ) { b . collection . add ( { value : a . value , name : a . name } ) } ) ; var e = function ( a ) { a ? arangoHelper . arangoError ( " Custom Queries " , " Could not import old local storage queries " ) : localStorage . removeItem ( " customQueries " ) } ; b . collection . saveCollectionQueries ( e ) } b . updateLocalQueries ( ) , a & & a ( ) } } ) } } ) } ( ) , function ( ) { " use strict " ; window . ScaleView = Backbone . View . extend ( { el : " # content " , template : templateEngine . createTemplate ( " scaleView . ejs " ) , interval : 1e4 , knownServers : [ ] , events : { " click # addCoord " : " addCoord " , " click # removeCoord " : " removeCoord " , " click # addDBs " : " addDBs " , " click # removeDBs " : " removeDBs " } , setCoordSize : function ( a ) { var b = this , c = { numberOfCoordinators : a } ; $ . ajax ( { type : " PUT " , url : arangoHelper . databaseUrl ( " / _admin / cluster / numberOfServers " ) , contentType : " application / json " , data : JSON . stringify ( c ) , success : function ( ) { b . updateTable ( c ) } , error : function ( ) { arangoHelper . arangoError ( " Scale " , " Could not set coordinator size . " ) } } ) } , setDBsSize : function ( a ) { var b = this , c = { numberOfDBServers : a } ; $ . ajax ( { type : " PUT " , url : arangoHelper . databaseUrl ( " / _admin / cluster / numberOfServers " ) , contentType : " application / json " , data : JSON . stringify ( c ) , success : function ( ) { b . updateTable ( c ) } , error : function ( ) { arangoHelper . arangoError ( " Scale " , " Could not set coordinator size . " ) } } ) } , addCoord : function ( ) { this . setCoordSize ( this . readNumberFromID ( " # plannedCoords " , ! 0 ) ) } , removeCoord : function ( ) { this . setCoordSize ( this . readNumberFromID ( " # plannedCoords " , ! 1 , ! 0 ) ) } , addDBs : function ( ) { this . setDBsSize ( this . readNumberFromID ( " # plannedDBs " , ! 0 ) ) } , removeDBs : function ( ) { this . setDBsSize ( this . readNumberFromID ( " # plannedDBs " , ! 1 , ! 0 ) ) } , readNumberFromID : function ( a , b , c ) { var d = $ ( a ) . html ( ) , e = ! 1 ; try { e = JSON . parse ( d ) } catch ( f ) { } return b & & e + + , c & & 1 ! = = e & & e - - , e } , initialize : function ( a ) { var b = this ; clearInterval ( this . intervalFunction ) , window . App . isCluster & & ( this . dbServers = a . dbServers , this . coordinators = a . coordinators , this . updateServerTime ( ) , this . intervalFunction = window . setInterval ( function ( ) { " # sNodes " = = = window . location . hash & & b . coordinators . fetch ( { success : function ( ) { b . dbServers . fetch ( { success : function ( ) { b . continueRender ( ! 0 ) } } ) } } ) } , this . interval ) ) } , render : function ( ) { var a = this , b = function ( ) { var b = function ( ) { a . continueRender ( ) } ; this . waitForDBServers ( b ) } . bind ( this ) ; this . initDoneCoords ? b ( ) : this . waitForCoordinators ( b ) , window . arangoHelper . buildNodesSubNav ( " scale " ) } , continueRender : function ( a ) { var b , c , d = this ; b = this . coordinators . toJSON ( ) , c = this . dbServers . toJSON ( ) , this . $ el . html ( this . template . render ( { runningCoords : b . length , runningDBs : c . length , plannedCoords : void 0 , plannedDBs : void 0 , initialized : a } ) ) , $ . ajax ( { type : " GET " , cache : ! 1 , url : arangoHelper . databaseUrl ( " / _admin / cluster / numberOfServers " ) , contentType : " application / json " , processData : ! 1 , success : function ( a ) { d . updateTable ( a ) } } ) } , updateTable : function ( a ) { var b = ' < span class = " warning " > scaling in progress < i class = " fa fa - circle - o - notch fa - spin " > < / i > < / span > ' , c = ' < span class = " positive " > no scaling process active < / span > ' ; a . numberOfCoordinators & & ( $ ( " # plannedCoords " ) . html ( a . numberOfCoordinators ) , this . coordinators . toJSON ( ) . length = = = a . numberOfCoordinators ? $ ( " # statusCoords " ) . html ( c ) : $ ( " # statusCoords " ) . html ( b ) ) , a . numberOfDBServers & & ( $ ( " # plannedDBs " ) . html ( a . numberOfDBServers ) , this . dbServers . toJSON ( ) . length = = = a . numberOfDBServers ? $ ( " # statusDBs " ) . html ( c ) : $ ( " # statusDBs " ) . html ( b ) ) } , waitForDBServers : function ( a ) { var b = this ; 0 = = = this . dbServers . length ? window . setInterval ( function ( ) { b . waitForDBServers ( a ) } , 300 ) : a ( ) } , waitForCoordinators : function ( a ) { var b = this ; window . setTimeout ( function ( ) { 0 = = = b . coordinators . length ? b . waitForCoordinators ( a ) : ( b . initDoneCoords = ! 0 , a ( ) ) } , 200 ) } , updateServerTime : function ( ) { this . serverTime = ( new Date ) . getTime ( ) } } ) } ( ) , function ( ) { " use strict " ; window . SettingsView = Backbone . View . extend ( { el : " # content " , initialize : function ( a ) { this . collectionName = a . collectionName , this . model = this . collection } , events : { } , render : function ( ) { this . breadcrumb ( ) , window . arangoHelper . buildCollectionSubNav ( this . collectionName , " Settings " ) , this . renderSettings ( ) } , breadcrumb : function ( ) { $ ( " # subNavigationBar . breadcrumb " ) . html ( " Collection : " + this . collectionName ) } , unloadCollection : function ( ) { var a = function ( a ) { a ? arangoHelper . arangoError ( " Collection error " , this . model . get ( " name " ) + " could not be unloaded . " ) : void 0 = = = a ? ( this . model . set ( " status " , " unloading " ) , this . render ( ) ) : " # collections " = = = window . location . hash ? ( this . model . set ( " status " , " unloaded " ) , this . render ( ) ) : arangoHelper . arangoNotification ( " Collection " + this . model . get ( " name " ) + " unloaded . " ) } . bind ( this ) ; this . model . unloadCollection ( a ) , window . modalView . hide ( ) } , loadCollection : function ( ) { var a = function ( a ) { a ? arangoHelper . arangoError ( " Collection error " , this . model . get ( " name " ) + " could not be loaded . " ) : void 0 = = = a ? ( this . model . set ( " status " , " loading " ) , this . render ( ) ) : " # collections " = = = window . location . hash ? ( this . model . set ( " status " , " loaded " ) , this . render ( ) ) : arangoHelper . arangoNotification ( " Collection " + this . model . get ( " name " ) + " loaded . " ) } . bind ( this ) ; this . model . loadCollection ( a ) , window . modalView . hide ( ) } , truncateCollection : function ( ) { this . model . truncateCollection ( ) , $ ( " . modal - delete - confirmation " ) . hide ( ) , window . modalView . hide ( ) } , deleteCollection : function ( ) { this . model . destroy ( { error : function ( ) { arangoHelper . arangoError ( " Could not delete collection . " ) } , success : function ( ) { window . App . navigate ( " # collections " , { trigger : ! 0 } ) } } ) } , saveModifiedCollection : function ( ) { var a = function ( a , b ) { if ( a ) arangoHelper . arangoError ( " Error " , " Could not get coordinator info " ) ; else { var c ; c = b ? this . model . get ( " name " ) : $ ( " # change - collection - name " ) . val ( ) ; var d = this . model . get ( " status " ) ; if ( " loaded " = = = d ) { var e ; try { e = JSON . parse ( 1024 * $ ( " # change - collection - size " ) . val ( ) * 1024 ) } catch ( f ) { return arangoHelper . arangoError ( " Please enter a valid number " ) , 0 } var g ; try { if ( g = JSON . parse ( $ ( " # change - index - buckets " ) . val ( ) ) , g < 1 | | parseInt ( g , 10 ) ! = = Math . pow ( 2 , Math . log2 ( g ) ) ) throw new Error ( " invalid indexBuckets value " ) } catch ( f ) { return arangoHelper . arangoError ( " Please enter a valid number of index buckets " ) , 0 } var h = function ( a ) { a ? arangoHelper . arangoError ( " Collection error : " + a . responseText ) : ( arangoHelper . arangoNotification ( " Collection : Successfully changed . " ) , window . App . navigate ( " # cSettings / " + c , { trigger : ! 0 } ) ) } , i = function ( a ) { if ( a ) arangoHelper . arangoError ( " Collection error : " + a . responseText ) ; else { var b = $ ( " # change - collection - sync " ) . val ( ) ; this . model . changeCollection ( b , e , g , h ) } } . bind ( this ) ; frontendConfig . isCluster = = = ! 1 ? this . model . renameCollection ( c , i ) : i ( ) } else if ( " unloaded " = = = d ) if ( this . model . get ( " name " ) ! = = c ) { var j = function ( a , b ) { a ? arangoHelper . arangoError ( " Collection " + b . responseText ) : ( arangoHelper . arangoNotification ( " CollectionSuccessfully changed . " ) , window . App . navigate ( " # cSettings / " + c , { trigger : ! 0 } ) ) } ; frontendConfig . isCluster = = = ! 1 ? this . model . renameCollection ( c , j ) : j ( ) } else window . modalView . hide ( ) } } . bind ( this ) ; window . isCoordinator ( a ) } , renderSettings : function ( ) { var a = function ( a , b ) { if ( a ) arangoHelper . arangoError ( " Error " , " Could not get coordinator info " ) ; else { var c = ! 1 ; " loaded " = = = this . model . get ( " status " ) & & ( c = ! 0 ) ; var d = [ ] , e = [ ] ; b | | e . push ( window . modalView . createTextEntry ( " change - collection - name " , " Name " , this . model . get ( " name " ) , ! 1 , " " , ! 0 , [ { rule : Joi . string ( ) . regex ( / ^ [ a - zA - Z ] / ) , msg : " Collection name must always start with a letter . " } , { rule : Joi . string ( ) . regex ( / ^ [ a - zA - Z0 - 9 \ - _ ] * $ / ) , msg : ' Only Symbols " _ " and " - " are allowed . ' } , { rule : Joi . string ( ) . required ( ) , msg : " No collection name given . " } ] ) ) ; var f = function ( ) { e . push ( window . modalView . createReadOnlyEntry ( " change - collection - id " , " ID " , this . model . get ( " id " ) , " " ) ) , e . push ( window . modalView . createReadOnlyEntry ( " change - collection - type " , " Type " , this . model . get ( " type " ) , " " ) ) , e . push ( window . modalView . createReadOnlyEntry ( " change - collection - status " , " Status " , this . model . get ( " status " ) , " " ) ) , <nl> + d . push ( window . modalView . createDeleteButton ( " Delete " , this . deleteCollection . bind ( this ) ) ) , d . push ( window . modalView . createDeleteButton ( " Truncate " , this . truncateCollection . bind ( this ) ) ) , c ? d . push ( window . modalView . createNotificationButton ( " Unload " , this . unloadCollection . bind ( this ) ) ) : d . push ( window . modalView . createNotificationButton ( " Load " , this . loadCollection . bind ( this ) ) ) , d . push ( window . modalView . createSuccessButton ( " Save " , this . saveModifiedCollection . bind ( this ) ) ) ; var a = [ " General " , " Indexes " ] , b = [ " modalTable . ejs " , " indicesView . ejs " ] ; window . modalView . show ( b , " Modify Collection " , d , e , null , null , this . events , null , a , " content " ) , $ ( $ ( " # infoTab " ) . children ( ) [ 1 ] ) . remove ( ) } . bind ( this ) ; if ( c ) { var g = function ( a , b ) { if ( a ) arangoHelper . arangoError ( " Collection " , " Could not fetch properties " ) ; else { var c = b . journalSize / 1048576 , d = b . indexBuckets , g = b . waitForSync ; e . push ( window . modalView . createTextEntry ( " change - collection - size " , " Journal size " , c , " The maximal size of a journal or datafile ( in MB ) . Must be at least 1 . " , " " , ! 0 , [ { rule : Joi . string ( ) . allow ( " " ) . optional ( ) . regex ( / ^ [ 0 - 9 ] * $ / ) , msg : " Must be a number . " } ] ) ) , e . push ( window . modalView . createTextEntry ( " change - index - buckets " , " Index buckets " , d , " The number of index buckets for this collection . Must be at least 1 and a power of 2 . " , " " , ! 0 , [ { rule : Joi . string ( ) . allow ( " " ) . optional ( ) . regex ( / ^ [ 1 - 9 ] [ 0 - 9 ] * $ / ) , msg : " Must be a number greater than 1 and a power of 2 . " } ] ) ) , e . push ( window . modalView . createSelectEntry ( " change - collection - sync " , " Wait for sync " , g , " Synchronize to disk before returning from a create or update of a document . " , [ { value : ! 1 , label : " No " } , { value : ! 0 , label : " Yes " } ] ) ) } f ( ) } ; this . model . getProperties ( g ) } else f ( ) } } . bind ( this ) ; window . isCoordinator ( a ) } } ) } ( ) , function ( ) { " use strict " ; window . ShardsView = Backbone . View . extend ( { el : " # content " , template : templateEngine . createTemplate ( " shardsView . ejs " ) , interval : 1e4 , knownServers : [ ] , events : { " click # shardsContent . shardLeader span " : " moveShard " , " click # shardsContent . shardFollowers span " : " moveShardFollowers " , " click # rebalanceShards " : " rebalanceShards " } , initialize : function ( a ) { var b = this ; b . dbServers = a . dbServers , clearInterval ( this . intervalFunction ) , window . App . isCluster & & ( this . updateServerTime ( ) , this . intervalFunction = window . setInterval ( function ( ) { " # shards " = = = window . location . hash & & b . render ( ! 1 ) } , this . interval ) ) } , render : function ( a ) { if ( " # shards " = = = window . location . hash ) { var b = this ; $ . ajax ( { type : " GET " , cache : ! 1 , url : arangoHelper . databaseUrl ( " / _admin / cluster / shardDistribution " ) , contentType : " application / json " , processData : ! 1 , async : ! 0 , success : function ( a ) { var c = ! 1 ; b . shardDistribution = a . results , _ . each ( a . results , function ( a , b ) { " error " ! = = b & & " code " ! = = b & & ( " _ " ! = = b . substring ( 0 , 1 ) & & ( c = ! 0 ) , ( b . startsWith ( " _local_ " ) | | b . startsWith ( " _to_ " ) | | b . startsWith ( " _from_ " ) ) & & ( c = ! 0 ) ) } ) , c ? b . continueRender ( a . results ) : arangoHelper . renderEmpty ( " No collections and no shards available " ) } , error : function ( a ) { 0 ! = = a . readyState & & arangoHelper . arangoError ( " Cluster " , " Could not fetch sharding information . " ) } } ) , a ! = = ! 1 & & arangoHelper . buildNodesSubNav ( " Shards " ) } } , moveShardFollowers : function ( a ) { var b = $ ( a . currentTarget ) . html ( ) ; this . moveShard ( a , b ) } , moveShard : function ( a , b ) { var c , d , e , f , g = this , h = window . App . currentDB . get ( " name " ) ; d = $ ( a . currentTarget ) . parent ( ) . parent ( ) . attr ( " collection " ) , e = $ ( a . currentTarget ) . parent ( ) . parent ( ) . attr ( " shard " ) , b ? ( f = $ ( a . currentTarget ) . parent ( ) . parent ( ) . attr ( " leader " ) , c = b ) : c = $ ( a . currentTarget ) . parent ( ) . parent ( ) . attr ( " leader " ) ; var i = [ ] , j = [ ] , k = { } , l = [ ] ; g . dbServers [ 0 ] . fetch ( { success : function ( ) { return g . dbServers [ 0 ] . each ( function ( a ) { a . get ( " name " ) ! = = c & & ( k [ a . get ( " name " ) ] = { value : a . get ( " name " ) , label : a . get ( " name " ) } ) } ) , _ . each ( g . shardDistribution [ d ] . Plan [ e ] . followers , function ( a ) { delete k [ a ] } ) , b & & delete k [ f ] , _ . each ( k , function ( a ) { l . push ( a ) } ) , l = l . reverse ( ) , 0 = = = l . length ? void arangoHelper . arangoMessage ( " Shards " , " No database server for moving the shard is available . " ) : ( j . push ( window . modalView . createSelectEntry ( " toDBServer " , " Destination " , void 0 , " Please select the target database server . The selected database server will be the new leader of the shard . " , l ) ) , i . push ( window . modalView . createSuccessButton ( " Move " , g . confirmMoveShards . bind ( this , h , d , e , c ) ) ) , void window . modalView . show ( " modalTable . ejs " , " Move shard : " + e , i , j ) ) } } ) } , confirmMoveShards : function ( a , b , c , d ) { var e = $ ( " # toDBServer " ) . val ( ) , f = { database : a , collection : b , shard : c , fromServer : d , toServer : e } ; $ . ajax ( { type : " POST " , cache : ! 1 , url : arangoHelper . databaseUrl ( " / _admin / cluster / moveShard " ) , contentType : " application / json " , processData : ! 1 , data : JSON . stringify ( f ) , async : ! 0 , success : function ( a ) { a . id & & ( arangoHelper . arangoNotification ( " Shard " + c + " will be moved to " + e + " . " ) , window . setTimeout ( function ( ) { window . App . shardsView . render ( ) } , 2e3 ) ) } , error : function ( ) { arangoHelper . arangoError ( " Shard " + c + " could not be moved to " + e + " . " ) } } ) , window . modalView . hide ( ) } , rebalanceShards : function ( ) { var a = this ; $ . ajax ( { type : " POST " , cache : ! 1 , url : arangoHelper . databaseUrl ( " / _admin / cluster / rebalanceShards " ) , contentType : " application / json " , processData : ! 1 , data : JSON . stringify ( { } ) , async : ! 0 , success : function ( b ) { b = = = ! 0 & & ( window . setTimeout ( function ( ) { a . render ( ! 1 ) } , 1500 ) , arangoHelper . arangoNotification ( " Started rebalance process . " ) ) } , error : function ( ) { arangoHelper . arangoError ( " Could not start rebalance process . " ) } } ) , window . modalView . hide ( ) } , continueRender : function ( a ) { var b = this ; delete a . code , delete a . error , _ . each ( a , function ( b , c ) { var d = { Plan : { } , Current : { } } ; if ( c . startsWith ( " _local_ " ) ) { var e = c . substr ( 7 , c . length - 1 ) , f = [ " _local_ " + e , " _from_ " + e , " _to_ " + e , e ] , g = 0 ; _ . each ( f , function ( b , c ) { _ . each ( a [ f [ g ] ] . Current , function ( a , b ) { d . Current [ b ] = a } ) , _ . each ( a [ f [ g ] ] . Plan , function ( a , b ) { d . Plan [ b ] = a } ) , delete a [ f [ g ] ] , a [ e ] = d , g + + } ) } } ) ; var c = { } ; Object . keys ( a ) . sort ( ) . forEach ( function ( b ) { c [ b ] = a [ b ] } ) , this . $ el . html ( this . template . render ( { collections : c } ) ) ; var d = ! 1 ; _ . each ( a , function ( a ) { _ . each ( a . Plan , function ( a , b ) { a . progress & & ( d = ! 0 ) } ) } ) , d & & window . setTimeout ( function ( ) { b . render ( ) } , 1500 ) } , updateServerTime : function ( ) { this . serverTime = ( new Date ) . getTime ( ) } } ) } ( ) , function ( ) { " use strict " ; window . ShowClusterView = Backbone . View . extend ( { detailEl : " # modalPlaceholder " , el : " # content " , defaultFrame : 12e5 , template : templateEngine . createTemplate ( " showCluster . ejs " ) , modal : templateEngine . createTemplate ( " waitModal . ejs " ) , detailTemplate : templateEngine . createTemplate ( " detailView . ejs " ) , events : { " change # selectDB " : " updateCollections " , " change # selectCol " : " updateShards " , " click . dbserver . success " : " dashboard " , " click . coordinator . success " : " dashboard " } , replaceSVGs : function ( ) { $ ( " . svgToReplace " ) . each ( function ( ) { var a = $ ( this ) , b = a . attr ( " id " ) , c = a . attr ( " src " ) ; $ . get ( c , function ( c ) { var d = $ ( c ) . find ( " svg " ) ; d . attr ( " id " , b ) . attr ( " class " , " icon " ) . removeAttr ( " xmlns : a " ) , a . replaceWith ( d ) } , " xml " ) } ) } , updateServerTime : function ( ) { this . serverTime = ( new Date ) . getTime ( ) } , setShowAll : function ( ) { this . graphShowAll = ! 0 } , resetShowAll : function ( ) { this . graphShowAll = ! 1 , this . renderLineChart ( ) } , initialize : function ( a ) { this . options = a , this . interval = 1e4 , this . isUpdating = ! 1 , this . timer = null , this . knownServers = [ ] , this . graph = void 0 , this . graphShowAll = ! 1 , this . updateServerTime ( ) , this . dygraphConfig = this . options . dygraphConfig , this . dbservers = new window . ClusterServers ( [ ] , { interval : this . interval } ) , this . coordinators = new window . ClusterCoordinators ( [ ] , { interval : this . interval } ) , this . documentStore = new window . ArangoDocuments , this . statisticsDescription = new window . StatisticsDescription , this . statisticsDescription . fetch ( { async : ! 1 } ) , this . dbs = new window . ClusterDatabases ( [ ] , { interval : this . interval } ) , this . cols = new window . ClusterCollections , this . shards = new window . ClusterShards , this . startUpdating ( ) } , listByAddress : function ( a ) { var b = { } , c = this ; this . dbservers . byAddress ( b , function ( b ) { c . coordinators . byAddress ( b , a ) } ) } , updateCollections : function ( ) { var a = this , b = $ ( " # selectCol " ) , c = $ ( " # selectDB " ) . find ( " : selected " ) . attr ( " id " ) ; if ( c ) { var d = b . find ( " : selected " ) . attr ( " id " ) ; b . html ( " " ) , this . cols . getList ( c , function ( c ) { _ . each ( _ . pluck ( c , " name " ) , function ( a ) { b . append ( ' < option id = " ' + a + ' " > ' + a + " < / option > " ) } ) ; var e = $ ( " # " + d , b ) ; 1 = = = e . length & & e . prop ( " selected " , ! 0 ) , a . updateShards ( ) } ) } } , updateShards : function ( ) { var a = $ ( " # selectDB " ) . find ( " : selected " ) . attr ( " id " ) , b = $ ( " # selectCol " ) . find ( " : selected " ) . attr ( " id " ) ; this . shards . getList ( a , b , function ( a ) { $ ( " . shardCounter " ) . html ( " 0 " ) , _ . each ( a , function ( a ) { $ ( " # " + a . server + " Shards " ) . html ( a . shards . length ) } ) } ) } , updateServerStatus : function ( a ) { var b = this , c = function ( a , b , c ) { var d , e , f = c ; f = f . replace ( / \ . / g , " - " ) , f = f . replace ( / : / g , " _ " ) , e = $ ( " # id " + f ) , e . length < 1 | | ( d = e . attr ( " class " ) . split ( / \ s + / ) [ 1 ] , e . attr ( " class " , a + " " + d + " " + b ) , " coordinator " = = = a & & ( " success " = = = b ? $ ( " . button - gui " , e . closest ( " . tile " ) ) . toggleClass ( " button - gui - disabled " , ! 1 ) : $ ( " . button - gui " , e . closest ( " . tile " ) ) . toggleClass ( " button - gui - disabled " , ! 0 ) ) ) } ; this . coordinators . getStatuses ( c . bind ( this , " coordinator " ) , function ( ) { b . dbservers . getStatuses ( c . bind ( b , " dbserver " ) ) , a ( ) } ) } , updateDBDetailList : function ( ) { var a = this , b = $ ( " # selectDB " ) , c = b . find ( " : selected " ) . attr ( " id " ) ; b . html ( " " ) , this . dbs . getList ( function ( d ) { _ . each ( _ . pluck ( d , " name " ) , function ( a ) { b . append ( ' < option id = " ' + a + ' " > ' + a + " < / option > " ) } ) ; var e = $ ( " # " + c , b ) ; 1 = = = e . length & & e . prop ( " selected " , ! 0 ) , a . updateCollections ( ) } ) } , rerender : function ( ) { var a = this ; this . updateServerStatus ( function ( ) { a . getServerStatistics ( function ( ) { a . updateServerTime ( ) , a . data = a . generatePieData ( ) , a . renderPieChart ( a . data ) , a . renderLineChart ( ) , a . updateDBDetailList ( ) } ) } ) } , render : function ( ) { this . knownServers = [ ] , delete this . hist ; var a = this ; this . listByAddress ( function ( b ) { 1 = = = Object . keys ( b ) . length ? a . type = " testPlan " : a . type = " other " , a . updateDBDetailList ( ) , a . dbs . getList ( function ( c ) { $ ( a . el ) . html ( a . template . render ( { dbs : _ . pluck ( c , " name " ) , byAddress : b , type : a . type } ) ) , $ ( a . el ) . append ( a . modal . render ( { } ) ) , a . replaceSVGs ( ) , a . getServerStatistics ( function ( ) { a . data = a . generatePieData ( ) , a . renderPieChart ( a . data ) , a . renderLineChart ( ) , a . updateDBDetailList ( ) , a . startUpdating ( ) } ) } ) } ) } , generatePieData : function ( ) { var a = [ ] , b = this ; return this . data . forEach ( function ( c ) { a . push ( { key : c . get ( " name " ) , value : c . get ( " system " ) . virtualSize , time : b . serverTime } ) } ) , a } , addStatisticsItem : function ( a , b , c , d ) { var e = this ; e . hasOwnProperty ( " hist " ) | | ( e . hist = { } ) , e . hist . hasOwnProperty ( a ) | | ( e . hist [ a ] = [ ] ) ; var f = e . hist [ a ] , g = f . length ; if ( 0 = = = g ) f . push ( { time : b , snap : d , requests : c , requestsPerSecond : 0 } ) ; else { var h = f [ g - 1 ] . time , i = f [ g - 1 ] . requests ; if ( i < c ) { var j = b - h , k = 0 ; j > 0 & & ( k = ( c - i ) / j ) , f . push ( { time : b , snap : d , requests : c , requestsPerSecond : k } ) } } } , getServerStatistics : function ( a ) { var b = this , c = Math . round ( b . serverTime / 1e3 ) ; this . data = void 0 ; var d = new window . ClusterStatisticsCollection , e = this . coordinators . first ( ) ; this . dbservers . forEach ( function ( a ) { if ( " ok " = = = a . get ( " status " ) ) { b . knownServers . indexOf ( a . id ) = = = - 1 & & b . knownServers . push ( a . id ) ; var c = new window . Statistics ( { name : a . id } ) ; c . url = e . get ( " protocol " ) + " : / / " + e . get ( " address " ) + " / _admin / clusterStatistics ? DBserver = " + a . get ( " name " ) , d . add ( c ) } } ) , this . coordinators . forEach ( function ( a ) { if ( " ok " = = = a . get ( " status " ) ) { b . knownServers . indexOf ( a . id ) = = = - 1 & & b . knownServers . push ( a . id ) ; var c = new window . Statistics ( { name : a . id } ) ; c . url = a . get ( " protocol " ) + " : / / " + a . get ( " address " ) + " / _admin / statistics " , d . add ( c ) } } ) ; var f = d . size ( ) ; this . data = [ ] ; var g = function ( d ) { f - - ; var e = d . get ( " time " ) , g = d . get ( " name " ) , h = d . get ( " http " ) . requestsTotal ; b . addStatisticsItem ( g , e , h , c ) , b . data . push ( d ) , 0 = = = f & & a ( ) } , h = function ( ) { f - - , 0 = = = f & & a ( ) } ; d . fetch ( g , h ) } , renderPieChart : function ( a ) { var b = $ ( " # clusterGraphs svg " ) . width ( ) , c = $ ( " # clusterGraphs svg " ) . height ( ) , d = Math . min ( b , c ) / 2 , e = this . dygraphConfig . colors , f = d3 . svg . arc ( ) . outerRadius ( d - 20 ) . innerRadius ( 0 ) , g = d3 . layout . pie ( ) . sort ( function ( a ) { return a . value } ) . value ( function ( a ) { return a . value } ) ; d3 . select ( " # clusterGraphs " ) . select ( " svg " ) . remove ( ) ; var h = d3 . select ( " # clusterGraphs " ) . append ( " svg " ) . attr ( " class " , " clusterChart " ) . append ( " g " ) . attr ( " transform " , " translate ( " + b / 2 + " , " + ( c / 2 - 10 ) + " ) " ) , i = d3 . svg . arc ( ) . outerRadius ( d - 2 ) . innerRadius ( d - 2 ) , j = h . selectAll ( " . arc " ) . data ( g ( a ) ) . enter ( ) . append ( " g " ) . attr ( " class " , " slice " ) ; j . append ( " path " ) . attr ( " d " , f ) . style ( " fill " , function ( a , b ) { return e [ b % e . length ] } ) . style ( " stroke " , function ( a , b ) { return e [ b % e . length ] } ) , j . append ( " text " ) . attr ( " transform " , function ( a ) { return " translate ( " + f . centroid ( a ) + " ) " } ) . style ( " text - anchor " , " middle " ) . text ( function ( a ) { var b = a . data . value / 1024 / 1024 / 1024 ; return b . toFixed ( 2 ) } ) , j . append ( " text " ) . attr ( " transform " , function ( a ) { return " translate ( " + i . centroid ( a ) + " ) " } ) . style ( " text - anchor " , " middle " ) . text ( function ( a ) { return a . data . key } ) } , renderLineChart : function ( ) { var a , b , c , d , e , f , g = this , h = 1200 , i = [ ] , j = [ ] , k = Math . round ( ( new Date ) . getTime ( ) / 1e3 ) - h , l = g . knownServers , m = function ( ) { return null } ; for ( c = 0 ; c < l . length ; + + c ) if ( b = g . hist [ l [ c ] ] ) for ( d = 0 ; d < b . length ; + + d ) f = b [ d ] . snap , f < k | | ( j . hasOwnProperty ( f ) ? a = j [ f ] : ( e = new Date ( 1e3 * f ) , a = j [ f ] = [ e ] . concat ( l . map ( m ) ) ) , a [ c + 1 ] = b [ d ] . requestsPerSecond ) ; i = [ ] , Object . keys ( j ) . sort ( ) . forEach ( function ( a ) { i . push ( j [ a ] ) } ) ; var n = this . dygraphConfig . getDefaultConfig ( " clusterRequestsPerSecond " ) ; n . labelsDiv = $ ( " # lineGraphLegend " ) [ 0 ] , n . labels = [ " datetime " ] . concat ( l ) , g . graph = new Dygraph ( document . getElementById ( " lineGraph " ) , i , n ) } , stopUpdating : function ( ) { window . clearTimeout ( this . timer ) , delete this . graph , this . isUpdating = ! 1 } , startUpdating : function ( ) { if ( ! this . isUpdating ) { this . isUpdating = ! 0 ; var a = this ; this . timer = window . setInterval ( function ( ) { a . rerender ( ) } , this . interval ) } } , dashboard : function ( a ) { this . stopUpdating ( ) ; var b , c , d = $ ( a . currentTarget ) , e = { } , f = d . attr ( " id " ) ; f = f . replace ( / - / g , " . " ) , f = f . replace ( / _ / g , " : " ) , f = f . substr ( 2 ) , e . raw = f , e . isDBServer = d . hasClass ( " dbserver " ) , e . isDBServer ? ( b = this . dbservers . findWhere ( { address : e . raw } ) , c = this . coordinators . findWhere ( { status : " ok " } ) , e . endpoint = c . get ( " protocol " ) + " : / / " + c . get ( " address " ) ) : ( b = this . coordinators . findWhere ( { address : e . raw } ) , e . endpoint = b . get ( " protocol " ) + " : / / " + b . get ( " address " ) ) , e . target = encodeURIComponent ( b . get ( " name " ) ) , window . App . serverToShow = e , window . App . dashboard ( ) } , getCurrentSize : function ( a ) { " # " ! = = a . substr ( 0 , 1 ) & & ( a = " # " + a ) ; var b , c ; return $ ( a ) . attr ( " style " , " " ) , b = $ ( a ) . height ( ) , c = $ ( a ) . width ( ) , { height : b , width : c } } , resize : function ( ) { var a ; this . graph & & ( a = this . getCurrentSize ( this . graph . maindiv_ . id ) , this . graph . resize ( a . width , a . height ) ) } } ) } ( ) , function ( ) { " use strict " ; window . SpotlightView = Backbone . View . extend ( { template : templateEngine . createTemplate ( " spotlightView . ejs " ) , el : " # spotlightPlaceholder " , displayLimit : 8 , typeahead : null , callbackSuccess : null , callbackCancel : null , collections : { system : [ ] , doc : [ ] , edge : [ ] } , events : { " focusout # spotlight . tt - input " : " hide " , " keyup # spotlight . typeahead " : " listenKey " } , aqlKeywordsArray : [ ] , aqlBuiltinFunctionsArray : [ ] , aqlKeywords : " for | return | filter | sort | limit | let | collect | asc | desc | in | into | insert | update | remove | replace | upsert | options | with | and | or | not | distinct | graph | outbound | inbound | any | all | none | aggregate | like | count | shortest_path " , hide : function ( ) { this . typeahead = $ ( " # spotlight . typeahead " ) . typeahead ( " destroy " ) , $ ( this . el ) . hide ( ) } , listenKey : function ( a ) { if ( 27 = = = a . keyCode ) this . callbackSuccess & & this . callbackCancel ( ) , this . hide ( ) ; else if ( 13 = = = a . keyCode & & this . callbackSuccess ) { var b = $ ( this . typeahead ) . val ( ) ; this . callbackSuccess ( b ) , this . hide ( ) } } , substringMatcher : function ( a ) { return function ( b , c ) { var d , e ; d = [ ] , e = new RegExp ( b , " i " ) , _ . each ( a , function ( a ) { e . test ( a ) & & d . push ( a ) } ) , c ( d ) } } , updateDatasets : function ( ) { var a = this ; this . collections = { system : [ ] , doc : [ ] , edge : [ ] } , window . App . arangoCollectionsStore . each ( function ( b ) { b . get ( " isSystem " ) ? a . collections . system . push ( b . get ( " name " ) ) : " document " = = = b . get ( " type " ) ? a . collections . doc . push ( b . get ( " name " ) ) : a . collections . edge . push ( b . get ( " name " ) ) } ) } , stringToArray : function ( ) { var a = this ; _ . each ( this . aqlKeywords . split ( " | " ) , function ( b ) { a . aqlKeywordsArray . push ( b . toUpperCase ( ) ) } ) , a . aqlKeywordsArray . push ( ! 0 ) , a . aqlKeywordsArray . push ( ! 1 ) , a . aqlKeywordsArray . push ( null ) } , fetchKeywords : function ( a ) { var b = this ; $ . ajax ( { type : " GET " , cache : ! 1 , url : arangoHelper . databaseUrl ( " / _api / aql - builtin " ) , contentType : " application / json " , success : function ( c ) { b . stringToArray ( ) , b . updateDatasets ( ) , _ . each ( c . functions , function ( a ) { b . aqlBuiltinFunctionsArray . push ( a . name ) } ) , a & & a ( ) } , error : function ( ) { a & & a ( ) , arangoHelper . arangoError ( " AQL " , " Could not fetch AQL function definition . " ) } } ) } , show : function ( a , b , c ) { var d = this ; this . callbackSuccess = a , this . callbackCancel = b ; var e = function ( ) { var a = function ( a , b , c ) { var d = ' < div class = " header - type " > < h4 > ' + a + " < / h4 > " ; return b & & ( d + = ' < span > < i class = " fa ' + b + ' " > < / i > < / span > ' ) , c & & ( d + = ' < span class = " type " > ' + c . toUpperCase ( ) + " < / span > " ) , d + = " < / div > " } ; $ ( this . el ) . html ( this . template . render ( { } ) ) , $ ( this . el ) . show ( ) , " aql " = = = c ? this . typeahead = $ ( " # spotlight . typeahead " ) . typeahead ( { hint : ! 0 , highlight : ! 0 , minLength : 1 } , { name : " Functions " , source : d . substringMatcher ( d . aqlBuiltinFunctionsArray ) , limit : d . displayLimit , templates : { header : a ( " Functions " , " fa - code " , " aql " ) } } , { name : " Keywords " , source : d . substringMatcher ( d . aqlKeywordsArray ) , limit : d . displayLimit , templates : { header : a ( " Keywords " , " fa - code " , " aql " ) } } , { name : " Documents " , source : d . substringMatcher ( d . collections . doc ) , limit : d . displayLimit , templates : { header : a ( " Documents " , " fa - file - text - o " , " Collection " ) } } , { name : " Edges " , source : d . substringMatcher ( d . collections . edge ) , limit : d . displayLimit , templates : { header : a ( " Edges " , " fa - share - alt " , " Collection " ) } } , { name : " System " , limit : d . displayLimit , source : d . substringMatcher ( d . collections . system ) , templates : { header : a ( " System " , " fa - cogs " , " Collection " ) } } ) : this . typeahead = $ ( " # spotlight . typeahead " ) . typeahead ( { hint : ! 0 , highlight : ! 0 , minLength : 1 } , { name : " Documents " , source : d . substringMatcher ( d . collections . doc ) , limit : d . displayLimit , templates : { header : a ( " Documents " , " fa - file - text - o " , " Collection " ) } } , { name : " Edges " , source : d . substringMatcher ( d . collections . edge ) , limit : d . displayLimit , templates : { header : a ( " Edges " , " fa - share - alt " , " Collection " ) } } , { name : " System " , limit : d . displayLimit , source : d . substringMatcher ( d . collections . system ) , templates : { header : a ( " System " , " fa - cogs " , " Collection " ) } } ) , $ ( " # spotlight . typeahead " ) . focus ( ) } . bind ( this ) ; 0 = = = d . aqlBuiltinFunctionsArray . length ? this . fetchKeywords ( e ) : e ( ) } } ) } ( ) , function ( ) { " use strict " ; window . StatisticBarView = Backbone . View . extend ( { el : " # statisticBar " , events : { " change # arangoCollectionSelect " : " navigateBySelect " , " click . tab " : " navigateByTab " } , template : templateEngine . createTemplate ( " statisticBarView . ejs " ) , initialize : function ( a ) { this . currentDB = a . currentDB } , replaceSVG : function ( a ) { var b = a . attr ( " id " ) , c = a . attr ( " class " ) , d = a . attr ( " src " ) ; $ . get ( d , function ( d ) { var e = $ ( d ) . find ( " svg " ) ; void 0 = = = b & & ( e = e . attr ( " id " , b ) ) , void 0 = = = c & & ( e = e . attr ( " class " , c + " replaced - svg " ) ) , e = e . removeAttr ( " xmlns : a " ) , a . replaceWith ( e ) } , " xml " ) } , render : function ( ) { var a = this ; return $ ( this . el ) . html ( this . template . render ( { isSystem : this . currentDB . get ( " isSystem " ) } ) ) , $ ( " img . svg " ) . each ( function ( ) { a . replaceSVG ( $ ( this ) ) } ) , this } , navigateBySelect : function ( ) { var a = $ ( " # arangoCollectionSelect " ) . find ( " option : selected " ) . val ( ) ; window . App . navigate ( a , { trigger : ! 0 } ) } , navigateByTab : function ( a ) { var b = a . target | | a . srcElement , c = b . id ; return " links " = = = c ? ( $ ( " # link_dropdown " ) . slideToggle ( 200 ) , void a . preventDefault ( ) ) : " tools " = = = c ? ( $ ( " # tools_dropdown " ) . slideToggle ( 200 ) , void a . preventDefault ( ) ) : ( window . App . navigate ( c , { trigger : ! 0 } ) , void a . preventDefault ( ) ) } , handleSelectNavigation : function ( ) { $ ( " # arangoCollectionSelect " ) . change ( function ( ) { var a = $ ( this ) . find ( " option : selected " ) . val ( ) ; window . App . navigate ( a , { trigger : ! 0 } ) } ) } , selectMenuItem : function ( a ) { $ ( " . navlist li " ) . removeClass ( " active " ) , a & & $ ( " . " + a ) . addClass ( " active " ) } } ) } ( ) , function ( ) { " use strict " ; window . SupportView = Backbone . View . extend ( { el : " # content " , template : templateEngine . createTemplate ( " supportView . ejs " ) , events : { " click . subViewNavbar . subMenuEntry " : " toggleViews " } , render : function ( ) { this . $ el . html ( this . template . render ( { } ) ) } , resize : function ( a ) { a ? $ ( " . innerContent " ) . css ( " height " , " auto " ) : $ ( " . innerContent " ) . height ( $ ( " . centralRow " ) . height ( ) - 170 ) } , renderSwagger : function ( ) { var a = window . location . pathname . split ( " / " ) , b = window . location . protocol + " / / " + window . location . hostname + " : " + window . location . port + " / " + a [ 1 ] + " / " + a [ 2 ] + " / _admin / aardvark / api / index . html " ; $ ( " # swagger " ) . html ( " " ) , $ ( " # swagger " ) . append ( ' < iframe src = " ' + b + ' " style = " border : none " > < / iframe > ' ) } , toggleViews : function ( a ) { var b = this , c = a . currentTarget . id . split ( " - " ) [ 0 ] , d = [ " community " , " documentation " , " swagger " ] ; _ . each ( d , function ( a ) { c ! = = a ? $ ( " # " + a ) . hide ( ) : ( " swagger " = = = c ? ( b . renderSwagger ( ) , $ ( " # swagger iframe " ) . css ( " height " , " 100 % " ) , $ ( " # swagger iframe " ) . css ( " width " , " 100 % " ) , $ ( " # swagger iframe " ) . css ( " margin - top " , " - 13px " ) , b . resize ( ) ) : b . resize ( ! 0 ) , $ ( " # " + a ) . show ( ) ) } ) , $ ( " . subMenuEntries " ) . children ( ) . removeClass ( " active " ) , $ ( " # " + c + " - support " ) . addClass ( " active " ) } } ) } ( ) , function ( ) { " use strict " ; window . TableView = Backbone . View . extend ( { template : templateEngine . createTemplate ( " tableView . ejs " ) , loading : templateEngine . createTemplate ( " loadingTableView . ejs " ) , initialize : function ( a ) { this . rowClickCallback = a . rowClick } , events : { " click . pure - table - body . pure - table - row " : " rowClick " , " click . deleteButton " : " removeClick " } , rowClick : function ( a ) { this . hasOwnProperty ( " rowClickCallback " ) & & this . rowClickCallback ( a ) } , removeClick : function ( a ) { this . hasOwnProperty ( " removeClickCallback " ) & & ( this . removeClickCallback ( a ) , a . stopPropagation ( ) ) } , setRowClick : function ( a ) { this . rowClickCallback = a } , setRemoveClick : function ( a ) { this . removeClickCallback = a } , render : function ( ) { $ ( this . el ) . html ( this . template . render ( { docs : this . collection } ) ) } , drawLoading : function ( ) { $ ( this . el ) . html ( this . loading . render ( { } ) ) } } ) } ( ) , function ( ) { " use strict " ; window . UserBarView = Backbone . View . extend ( { events : { " change # userBarSelect " : " navigateBySelect " , " click . tab " : " navigateByTab " , " mouseenter . dropdown " : " showDropdown " , " mouseleave . dropdown " : " hideDropdown " , " click # userLogoutIcon " : " userLogout " , " click # userLogout " : " userLogout " } , initialize : function ( a ) { this . userCollection = a . userCollection , this . userCollection . fetch ( { cache : ! 1 , async : ! 0 } ) , this . userCollection . bind ( " change : extra " , this . render . bind ( this ) ) } , template : templateEngine . createTemplate ( " userBarView . ejs " ) , navigateBySelect : function ( ) { var a = $ ( " # arangoCollectionSelect " ) . find ( " option : selected " ) . val ( ) ; window . App . navigate ( a , { trigger : ! 0 } ) } , navigateByTab : function ( a ) { var b = a . target | | a . srcElement ; b = $ ( b ) . closest ( " a " ) ; var c = b . attr ( " id " ) ; return " user " = = = c ? ( $ ( " # user_dropdown " ) . slideToggle ( 200 ) , void a . preventDefault ( ) ) : ( window . App . navigate ( c , { trigger : ! 0 } ) , void a . preventDefault ( ) ) } , toggleUserMenu : function ( ) { $ ( " # userBar . subBarDropdown " ) . toggle ( ) } , showDropdown : function ( ) { $ ( " # user_dropdown " ) . fadeIn ( 1 ) } , hideDropdown : function ( ) { $ ( " # user_dropdown " ) . fadeOut ( 1 ) } , render : function ( ) { if ( frontendConfig . authenticationEnabled ! = = ! 1 ) { var a = this , b = function ( a , b ) { if ( a ) arangoHelper . arangoErro ( " User " , " Could not fetch user . " ) ; else { var c = null , d = null , e = ! 1 , f = null ; if ( b ! = = ! 1 ) return f = this . userCollection . findWhere ( { user : b } ) , f . set ( { loggedIn : ! 0 } ) , d = f . get ( " extra " ) . name , c = f . get ( " extra " ) . img , e = f . get ( " active " ) , c = c ? " https : / / s . gravatar . com / avatar / " + c + " ? s = 80 " : " img / default_user . png " , d | | ( d = " " ) , this . $ el = $ ( " # userBar " ) , this . $ el . html ( this . template . render ( { img : c , name : d , username : b , active : e } ) ) , this . delegateEvents ( ) , this . $ el } } . bind ( this ) ; $ ( " # userBar " ) . on ( " click " , function ( ) { a . toggleUserMenu ( ) } ) , this . userCollection . whoAmI ( b ) } } , userLogout : function ( ) { var a = function ( a ) { a ? arangoHelper . arangoError ( " User " , " Logout error " ) : this . userCollection . logout ( ) } . bind ( this ) ; this . userCollection . whoAmI ( a ) } } ) } ( ) , function ( ) { " use strict " ; window . UserManagementView = Backbone . View . extend ( { el : " # content " , el2 : " # userManagementThumbnailsIn " , template : templateEngine . createTemplate ( " userManagementView . ejs " ) , events : { " click # createUser " : " createUser " , " click # submitCreateUser " : " submitCreateUser " , " click # userManagementThumbnailsIn . tile " : " editUser " , " click # submitEditUser " : " submitEditUser " , " click # userManagementToggle " : " toggleView " , " keyup # userManagementSearchInput " : " search " , " click # userManagementSearchSubmit " : " search " , " click # callEditUserPassword " : " editUserPassword " , " click # submitEditUserPassword " : " submitEditUserPassword " , " click # submitEditCurrentUserProfile " : " submitEditCurrentUserProfile " , " click . css - label " : " checkBoxes " , " change # userSortDesc " : " sorting " } , dropdownVisible : ! 1 , initialize : function ( ) { var a = this , b = function ( a , b ) { frontendConfig . authenticationEnabled = = = ! 0 & & ( a | | null = = = b ? arangoHelper . arangoError ( " User " , " Could not fetch user data " ) : this . currentUser = this . collection . findWhere ( { user : b } ) ) } . bind ( this ) ; this . collection . fetch ( { cache : ! 1 , success : function ( ) { a . collection . whoAmI ( b ) } } ) } , checkBoxes : function ( a ) { var b = a . currentTarget . id ; $ ( " # " + b ) . click ( ) } , sorting : function ( ) { $ ( " # userSortDesc " ) . is ( " : checked " ) ? this . collection . setSortingDesc ( ! 0 ) : this . collection . setSortingDesc ( ! 1 ) , $ ( " # userManagementDropdown " ) . is ( " : visible " ) ? this . dropdownVisible = ! 0 : this . dropdownVisible = ! 1 , this . render ( ) } , render : function ( a ) { var b = ! 1 ; $ ( " # userManagementDropdown " ) . is ( " : visible " ) & & ( b = ! 0 ) ; var c = function ( ) { this . collection . sort ( ) , $ ( this . el ) . html ( this . template . render ( { collection : this . collection , searchString : " " } ) ) , b = = = ! 0 & & ( $ ( " # userManagementDropdown2 " ) . show ( ) , $ ( " # userSortDesc " ) . attr ( " checked " , this . collection . sortOptions . desc ) , $ ( " # userManagementToggle " ) . toggleClass ( " activated " ) , $ ( " # userManagementDropdown " ) . show ( ) ) , a & & this . editCurrentUser ( ) , arangoHelper . setCheckboxStatus ( " # userManagementDropdown " ) } . bind ( this ) ; return this . collection . fetch ( { cache : ! 1 , success : function ( ) { c ( ) } } ) , this } , search : function ( ) { var a , b , c , d ; a = $ ( " # userManagementSearchInput " ) , b = $ ( " # userManagementSearchInput " ) . val ( ) , d = this . collection . filter ( function ( a ) { return a . get ( " user " ) . indexOf ( b ) ! = = - 1 } ) , $ ( this . el ) . html ( this . template . render ( { collection : d , searchString : b } ) ) , a = $ ( " # userManagementSearchInput " ) , c = a . val ( ) . length , a . focus ( ) , a [ 0 ] . setSelectionRange ( c , c ) } , createUser : function ( a ) { a . preventDefault ( ) , this . createCreateUserModal ( ) } , submitCreateUser : function ( ) { var a = this , b = $ ( " # newUsername " ) . val ( ) , c = $ ( " # newName " ) . val ( ) , d = $ ( " # newPassword " ) . val ( ) , e = $ ( " # newStatus " ) . is ( " : checked " ) ; if ( this . validateUserInfo ( c , b , d , e ) ) { var f = { user : b , passwd : d , active : e , extra : { name : c } } ; this . collection . create ( f , { wait : ! 0 , error : function ( a , b ) { arangoHelper . parseError ( " User " , b , a ) } , success : function ( ) { a . updateUserManagement ( ) , window . modalView . hide ( ) } } ) } } , validateUserInfo : function ( a , b , c , d ) { return " " ! = = b | | ( arangoHelper . arangoError ( " You have to define an username " ) , $ ( " # newUsername " ) . closest ( " th " ) . css ( " backgroundColor " , " red " ) , ! 1 ) } , updateUserManagement : function ( ) { var a = this ; this . collection . fetch ( { cache : ! 1 , success : function ( ) { a . render ( ) } } ) } , editUser : function ( a ) { if ( " createUser " ! = = $ ( a . currentTarget ) . find ( " a " ) . attr ( " id " ) ) { $ ( a . currentTarget ) . hasClass ( " tile " ) & & ( a . currentTarget = $ ( a . currentTarget ) . find ( " img " ) ) , this . collection . fetch ( { cache : ! 1 } ) ; var b = this . evaluateUserName ( $ ( a . currentTarget ) . attr ( " id " ) , " _edit - user " ) ; " " = = = b & & ( b = $ ( a . currentTarget ) . attr ( " id " ) ) , window . App . navigate ( " user / " + encodeURIComponent ( b ) , { trigger : ! 0 } ) } } , toggleView : function ( ) { $ ( " # userSortDesc " ) . attr ( " checked " , this . collection . sortOptions . desc ) , $ ( " # userManagementToggle " ) . toggleClass ( " activated " ) , $ ( " # userManagementDropdown2 " ) . slideToggle ( 200 ) } , createCreateUserModal : function ( ) { var a = [ ] , b = [ ] ; b . push ( window . modalView . createTextEntry ( " newUsername " , " Username " , " " , ! 1 , " Username " , ! 0 , [ { rule : Joi . string ( ) . regex ( / ^ [ a - zA - Z0 - 9 \ - _ ] * $ / ) , msg : ' Only symbols , " _ " and " - " are allowed . ' } , { rule : Joi . string ( ) . required ( ) , msg : " No username given . " } ] ) ) , b . push ( window . modalView . createTextEntry ( " newName " , " Name " , " " , ! 1 , " Name " , ! 1 ) ) , b . push ( window . modalView . createPasswordEntry ( " newPassword " , " Password " , " " , ! 1 , " " , ! 1 ) ) , b . push ( window . modalView . createCheckboxEntry ( " newStatus " , " Active " , " active " , ! 1 , ! 0 ) ) , a . push ( window . modalView . createSuccessButton ( " Create " , this . submitCreateUser . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Create New User " , a , b ) } , evaluateUserName : function ( a , b ) { if ( a ) { var c = a . lastIndexOf ( b ) ; return a . substring ( 0 , c ) } } , updateUserProfile : function ( ) { var a = this ; this . collection . fetch ( { cache : ! 1 , success : function ( ) { a . render ( ) } } ) } } ) } ( ) , function ( ) { " use strict " ; window . UserPermissionView = Backbone . View . extend ( { el : " # content " , template : templateEngine . createTemplate ( " userPermissionView . ejs " ) , initialize : function ( a ) { this . username = a . username } , events : { ' click # userPermissionView [ type = " checkbox " ] ' : " setPermission " } , render : function ( ) { var a = this ; this . collection . fetch ( { success : function ( ) { a . continueRender ( ) } } ) } , setPermission : function ( a ) { var b = $ ( a . currentTarget ) . is ( " : checked " ) , c = $ ( a . currentTarget ) . attr ( " name " ) ; if ( b ) this . grantPermission ( this . currentUser . get ( " user " ) , c ) ; else if ( " _system " = = = c ) { var d = [ ] , e = [ ] ; e . push ( window . modalView . createReadOnlyEntry ( " db - system - revoke - button " , " Caution " , " You are removing your permissions to _system database . Really continue ? " , void 0 , void 0 , ! 1 ) ) , d . push ( window . modalView . createSuccessButton ( " Revoke " , this . revokePermission . bind ( this , this . currentUser . get ( " user " ) , c ) ) ) , d . push ( window . modalView . createCloseButton ( " Cancel " , this . rollbackInputButton . bind ( this , c ) ) ) , window . modalView . show ( " modalTable . ejs " , " Revoke _system Database Permission " , d , e ) } else this . revokePermission ( this . currentUser . get ( " user " ) , c ) } , rollbackInputButton : function ( a ) { $ ( ' input [ name = " ' + a + ' " ' ) . prop ( " checked " , " true " ) } , grantPermission : function ( a , b ) { $ . ajax ( { type : " PUT " , url : arangoHelper . databaseUrl ( " / _api / user / " + encodeURIComponent ( a ) + " / database / " + encodeURIComponent ( b ) ) , contentType : " application / json " , data : JSON . stringify ( { grant : " rw " } ) } ) } , revokePermission : function ( a , b ) { $ . ajax ( { type : " PUT " , url : arangoHelper . databaseUrl ( " / _api / user / " + encodeURIComponent ( a ) + " / database / " + encodeURIComponent ( b ) ) , contentType : " application / json " } ) , window . modalView . hide ( ) } , continueRender : function ( ) { var a = this ; this . currentUser = this . collection . findWhere ( { user : this . username } ) , this . breadcrumb ( ) , arangoHelper . buildUserSubNav ( this . currentUser . get ( " user " ) , " Permissions " ) ; var b = arangoHelper . databaseUrl ( " / _api / user / " + encodeURIComponent ( a . currentUser . get ( " user " ) ) + " / database " ) ; " _system " = = = frontendConfig . db & & ( b = arangoHelper . databaseUrl ( " / _api / user / root / database " ) ) , $ . ajax ( { type : " GET " , url : b , contentType : " application / json " , success : function ( b ) { var c = b . result ; $ . ajax ( { type : " GET " , url : arangoHelper . databaseUrl ( " / _api / user / " + encodeURIComponent ( a . currentUser . get ( " user " ) ) + " / database " ) , contentType : " application / json " , success : function ( b ) { var d = b . result ; if ( c . _system ) { var e = [ ] ; _ . each ( c , function ( a , b ) { e . push ( b ) } ) , c = e } a . finishRender ( c , d ) } } ) } } ) } , finishRender : function ( a , b ) { _ . each ( b , function ( a , c ) { " rw " ! = = a & & delete b [ c ] } ) , $ ( this . el ) . html ( this . template . render ( { allDBs : a , permissions : b } ) ) } , breadcrumb : function ( ) { $ ( " # subNavigationBar . breadcrumb " ) . html ( " User : " + this . currentUser . get ( " user " ) ) } } ) } ( ) , function ( ) { " use strict " ; window . UserView = Backbone . View . extend ( { el : " # content " , initialize : function ( a ) { this . username = a . username } , render : function ( ) { var a = this ; this . collection . fetch ( { success : function ( ) { a . continueRender ( ) } } ) } , editCurrentUser : function ( ) { this . createEditCurrentUserModal ( this . currentUser . get ( " user " ) , this . currentUser . get ( " extra " ) . name , this . currentUser . get ( " extra " ) . img ) } , continueRender : function ( ) { this . breadcrumb ( ) , this . currentUser = this . collection . findWhere ( { user : this . username } ) , arangoHelper . buildUserSubNav ( this . currentUser . get ( " user " ) , " General " ) , this . currentUser . get ( " loggedIn " ) ? this . editCurrentUser ( ) : this . createEditUserModal ( this . currentUser . get ( " user " ) , this . currentUser . get ( " extra " ) . name , this . currentUser . get ( " active " ) ) } , createEditUserPasswordModal : function ( ) { var a = [ ] , b = [ ] ; b . push ( window . modalView . createPasswordEntry ( " newCurrentPassword " , " New Password " , " " , ! 1 , " new password " , ! 1 ) ) , b . push ( window . modalView . createPasswordEntry ( " confirmCurrentPassword " , " Confirm New Password " , " " , ! 1 , " confirm new password " , ! 1 ) ) , a . push ( window . modalView . createSuccessButton ( " Save " , this . submitEditUserPassword . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Edit User Password " , a , b ) } , createEditCurrentUserModal : function ( a , b , c ) { var d = [ ] , e = [ ] ; e . push ( window . modalView . createReadOnlyEntry ( " id_username " , " Username " , a ) ) , e . push ( window . modalView . createTextEntry ( " editCurrentName " , " Name " , b , ! 1 , " Name " , ! 1 ) ) , e . push ( window . modalView . createTextEntry ( " editCurrentUserProfileImg " , " Gravatar account ( Mail ) " , c , " Mailaddress or its md5 representation of your gravatar account . The address will be converted into a md5 string . Only the md5 string will be stored , not the mailaddress . " , " myAccount ( at ) gravatar . com " ) ) , d . push ( window . modalView . createNotificationButton ( " Change Password " , this . editUserPassword . bind ( this ) ) ) , d . push ( window . modalView . createSuccessButton ( " Save " , this . submitEditCurrentUserProfile . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Edit User Profile " , d , e , null , null , this . events , null , null , " content " ) } , parseImgString : function ( a ) { return a . indexOf ( " @ " ) = = = - 1 ? a : CryptoJS . MD5 ( a ) . toString ( ) } , createEditUserModal : function ( a , b , c ) { var d , e ; e = [ { type : window . modalView . tables . READONLY , label : " Username " , value : _ . escape ( a ) <nl> + } , { type : window . modalView . tables . TEXT , label : " Name " , value : b , id : " editName " , placeholder : " Name " } , { type : window . modalView . tables . CHECKBOX , label : " Active " , value : " active " , checked : c , id : " editStatus " } ] , d = [ { title : " Delete " , type : window . modalView . buttons . DELETE , callback : this . submitDeleteUser . bind ( this , a ) } , { title : " Change Password " , type : window . modalView . buttons . NOTIFICATION , callback : this . createEditUserPasswordModal . bind ( this , a ) } , { title : " Save " , type : window . modalView . buttons . SUCCESS , callback : this . submitEditUser . bind ( this , a ) } ] , window . modalView . show ( " modalTable . ejs " , " Edit User " , d , e , null , null , this . events , null , null , " content " ) } , validateStatus : function ( a ) { return " " ! = = a } , submitDeleteUser : function ( a ) { var b = this . collection . findWhere ( { user : a } ) ; b . destroy ( { wait : ! 0 } ) , window . App . navigate ( " # users " , { trigger : ! 0 } ) } , submitEditCurrentUserProfile : function ( ) { var a = $ ( " # editCurrentName " ) . val ( ) , b = $ ( " # editCurrentUserProfileImg " ) . val ( ) ; b = this . parseImgString ( b ) ; var c = function ( a ) { a ? arangoHelper . arangoError ( " User " , " Could not edit user settings " ) : ( arangoHelper . arangoNotification ( " User " , " Changes confirmed . " ) , this . updateUserProfile ( ) ) } . bind ( this ) ; this . currentUser . setExtras ( a , b , c ) , window . modalView . hide ( ) } , submitEditUserPassword : function ( ) { var a = $ ( " # newCurrentPassword " ) . val ( ) , b = $ ( " # confirmCurrentPassword " ) . val ( ) ; $ ( " # newCurrentPassword " ) . val ( " " ) , $ ( " # confirmCurrentPassword " ) . val ( " " ) , $ ( " # newCurrentPassword " ) . closest ( " th " ) . css ( " backgroundColor " , " white " ) , $ ( " # confirmCurrentPassword " ) . closest ( " th " ) . css ( " backgroundColor " , " white " ) ; var c = ! 1 ; a ! = = b & & ( arangoHelper . arangoError ( " User " , " New passwords do not match . " ) , c = ! 0 ) , c | | ( this . currentUser . setPassword ( a ) , arangoHelper . arangoNotification ( " User " , " Password changed . " ) , window . modalView . hide ( ) ) } , validateUsername : function ( a ) { return " " = = = a ? ( arangoHelper . arangoError ( " You have to define an username " ) , $ ( " # newUsername " ) . closest ( " th " ) . css ( " backgroundColor " , " red " ) , ! 1 ) : ! ! a . match ( / ^ [ a - zA - Z ] [ a - zA - Z0 - 9_ - ] * $ / ) | | ( arangoHelper . arangoError ( " Wrong Username " , " Username may only contain numbers , letters , _ and - " ) , ! 1 ) } , editUserPassword : function ( ) { window . modalView . hide ( ) , this . createEditUserPasswordModal ( ) } , validateName : function ( a ) { return " " = = = a | | ( ! ! a . match ( / ^ [ a - zA - Z ] [ a - zA - Z0 - 9_ - ] * $ / ) | | ( arangoHelper . arangoError ( " Wrong Username " , " Username may only contain numbers , letters , _ and - " ) , ! 1 ) ) } , submitEditUser : function ( a ) { var b = $ ( " # editName " ) . val ( ) , c = $ ( " # editStatus " ) . is ( " : checked " ) ; if ( ! this . validateStatus ( c ) ) return void $ ( " # editStatus " ) . closest ( " th " ) . css ( " backgroundColor " , " red " ) ; if ( ! this . validateName ( b ) ) return void $ ( " # editName " ) . closest ( " th " ) . css ( " backgroundColor " , " red " ) ; var d = this . collection . findWhere ( { user : a } ) ; d . save ( { extra : { name : b } , active : c } , { type : " PATCH " , success : function ( ) { arangoHelper . arangoNotification ( " User " , d . get ( " user " ) + " updated . " ) } , error : function ( ) { arangoHelper . arangoError ( " User " , " Could not update " + d . get ( " user " ) + " . " ) } } ) } , breadcrumb : function ( ) { $ ( " # subNavigationBar . breadcrumb " ) . html ( " User : " + this . username ) } } ) } ( ) , function ( ) { " use strict " ; window . WorkMonitorView = Backbone . View . extend ( { el : " # content " , id : " # workMonitorContent " , template : templateEngine . createTemplate ( " workMonitorView . ejs " ) , table : templateEngine . createTemplate ( " arangoTable . ejs " ) , initialize : function ( ) { } , events : { } , tableDescription : { id : " workMonitorTable " , titles : [ " Type " , " Database " , " Task ID " , " Started " , " Url " , " User " , " Description " , " Method " ] , rows : [ ] , unescaped : [ ! 1 , ! 1 , ! 1 , ! 1 , ! 1 , ! 1 , ! 1 , ! 1 ] } , render : function ( ) { var a = this ; this . $ el . html ( this . template . render ( { } ) ) , this . collection . fetch ( { success : function ( ) { a . parseTableData ( ) , $ ( a . id ) . append ( a . table . render ( { content : a . tableDescription } ) ) } } ) } , parseTableData : function ( ) { var a = this ; this . collection . each ( function ( b ) { if ( " AQL query " = = = b . get ( " type " ) ) { var c = b . get ( " parent " ) ; if ( c ) try { a . tableDescription . rows . push ( [ b . get ( " type " ) , " ( p ) " + c . database , " ( p ) " + c . taskId , " ( p ) " + c . startTime , " ( p ) " + c . url , " ( p ) " + c . user , b . get ( " description " ) , " ( p ) " + c . method ] ) } catch ( d ) { console . log ( " some parse error " ) } } else " thread " ! = = b . get ( " type " ) & & a . tableDescription . rows . push ( [ b . get ( " type " ) , b . get ( " database " ) , b . get ( " taskId " ) , b . get ( " startTime " ) , b . get ( " url " ) , b . get ( " user " ) , b . get ( " description " ) , b . get ( " method " ) ] ) } ) } } ) } ( ) , function ( ) { " use strict " ; window . Router = Backbone . Router . extend ( { toUpdate : [ ] , dbServers : [ ] , isCluster : void 0 , lastRoute : void 0 , routes : { " " : " cluster " , dashboard : " dashboard " , collections : " collections " , " new " : " newCollection " , login : " login " , " collection / : colid / documents / : pageid " : " documents " , " cIndices / : colname " : " cIndices " , " cSettings / : colname " : " cSettings " , " cInfo / : colname " : " cInfo " , " collection / : colid / : docid " : " document " , shell : " shell " , queries : " query " , workMonitor : " workMonitor " , databases : " databases " , settings : " databases " , services : " applications " , " service / : mount " : " applicationDetail " , graphs : " graphManagement " , " graphs / : name " : " showGraph " , users : " userManagement " , " user / : name " : " userView " , " user / : name / permission " : " userPermissionView " , userProfile : " userProfile " , cluster : " cluster " , nodes : " nodes " , shards : " shards " , " node / : name " : " node " , logs : " logs " , helpus : " helpUs " , " graph / : name " : " graph " , " graph / : name / settings " : " graphSettings " , support : " support " } , execute : function ( a , b ) { " # queries " = = = this . lastRoute & & this . queryView . cleanupGraphs ( ) , this . lastRoute = window . location . hash , $ ( " # subNavigationBar . breadcrumb " ) . html ( " " ) , $ ( " # subNavigationBar . bottom " ) . html ( " " ) , $ ( " # loadingScreen " ) . hide ( ) , $ ( " # content " ) . show ( ) , a & & a . apply ( this , b ) , this . graphViewer & & this . graphViewer . graphSettingsView & & this . graphViewer . graphSettingsView . hide ( ) , this . queryView & & this . queryView . graphViewer & & this . queryView . graphViewer . graphSettingsView & & this . queryView . graphViewer . graphSettingsView . hide ( ) } , listenerFunctions : { } , listener : function ( a ) { _ . each ( window . App . listenerFunctions , function ( b , c ) { b ( a ) } ) } , checkUser : function ( ) { var a = this ; if ( " # login " ! = = window . location . hash ) { var b = function ( ) { this . initOnce ( ) , $ ( " . bodyWrapper " ) . show ( ) , $ ( " . navbar " ) . show ( ) } . bind ( this ) , c = function ( c , d ) { frontendConfig . authenticationEnabled ? ( a . currentUser = d , c | | null = = = d ? " # login " ! = = window . location . hash & & this . navigate ( " login " , { trigger : ! 0 } ) : b ( ) ) : b ( ) } . bind ( this ) ; frontendConfig . authenticationEnabled ? this . userCollection . whoAmI ( c ) : ( this . initOnce ( ) , $ ( " . bodyWrapper " ) . show ( ) , $ ( " . navbar " ) . show ( ) ) } } , waitForInit : function ( a , b , c ) { this . initFinished ? ( b | | a ( ! 0 ) , b & & ! c & & a ( b , ! 0 ) , b & & c & & a ( b , c , ! 0 ) ) : setTimeout ( function ( ) { b | | a ( ! 1 ) , b & & ! c & & a ( b , ! 1 ) , b & & c & & a ( b , c , ! 1 ) } , 350 ) } , initFinished : ! 1 , initialize : function ( ) { frontendConfig . isCluster = = = ! 0 & & ( this . isCluster = ! 0 ) , document . addEventListener ( " keyup " , this . listener , ! 1 ) , window . modalView = new window . ModalView , this . foxxList = new window . FoxxCollection , window . foxxInstallView = new window . FoxxInstallView ( { collection : this . foxxList } ) , window . progressView = new window . ProgressView ; var a = this ; this . userCollection = new window . ArangoUsers , this . initOnce = function ( ) { this . initOnce = function ( ) { } ; var b = function ( b , c ) { a = this , c = = = ! 0 & & a . coordinatorCollection . fetch ( { success : function ( ) { a . fetchDBS ( ) } } ) , b & & console . log ( b ) } . bind ( this ) ; window . isCoordinator ( b ) , frontendConfig . isCluster = = = ! 1 & & ( this . initFinished = ! 0 ) , this . arangoDatabase = new window . ArangoDatabase , this . currentDB = new window . CurrentDatabase , this . arangoCollectionsStore = new window . ArangoCollections , this . arangoDocumentStore = new window . ArangoDocument , this . coordinatorCollection = new window . ClusterCoordinators , arangoHelper . setDocumentStore ( this . arangoDocumentStore ) , this . arangoCollectionsStore . fetch ( { cache : ! 1 } ) , window . spotlightView = new window . SpotlightView ( { collection : this . arangoCollectionsStore } ) , this . footerView = new window . FooterView ( { collection : a . coordinatorCollection } ) , this . notificationList = new window . NotificationCollection , this . currentDB . fetch ( { cache : ! 1 , success : function ( ) { a . naviView = new window . NavigationView ( { database : a . arangoDatabase , currentDB : a . currentDB , notificationCollection : a . notificationList , userCollection : a . userCollection , isCluster : a . isCluster } ) , a . naviView . render ( ) } } ) , this . queryCollection = new window . ArangoQueries , this . footerView . render ( ) , window . checkVersion ( ) , this . userConfig = new window . UserConfig , this . userConfig . fetch ( ) , this . documentsView = new window . DocumentsView ( { collection : new window . ArangoDocuments , documentStore : this . arangoDocumentStore , collectionsStore : this . arangoCollectionsStore } ) , arangoHelper . initSigma ( ) } . bind ( this ) , $ ( window ) . resize ( function ( ) { a . handleResize ( ) } ) , $ ( window ) . scroll ( function ( ) { } ) } , handleScroll : function ( ) { $ ( window ) . scrollTop ( ) > 50 ? ( $ ( " . navbar > . secondary " ) . css ( " top " , $ ( window ) . scrollTop ( ) ) , $ ( " . navbar > . secondary " ) . css ( " position " , " absolute " ) , $ ( " . navbar > . secondary " ) . css ( " z - index " , " 10 " ) , $ ( " . navbar > . secondary " ) . css ( " width " , $ ( window ) . width ( ) ) ) : ( $ ( " . navbar > . secondary " ) . css ( " top " , " 0 " ) , $ ( " . navbar > . secondary " ) . css ( " position " , " relative " ) , $ ( " . navbar > . secondary " ) . css ( " width " , " " ) ) } , cluster : function ( a ) { return this . checkUser ( ) , a ? this . isCluster = = = ! 1 | | void 0 = = = this . isCluster ? void ( " _system " = = = this . currentDB . get ( " name " ) ? ( this . routes [ " " ] = " dashboard " , this . navigate ( " # dashboard " , { trigger : ! 0 } ) ) : ( this . routes [ " " ] = " collections " , this . navigate ( " # collections " , { trigger : ! 0 } ) ) ) : ( this . clusterView | | ( this . clusterView = new window . ClusterView ( { coordinators : this . coordinatorCollection , dbServers : this . dbServers } ) ) , void this . clusterView . render ( ) ) : void this . waitForInit ( this . cluster . bind ( this ) ) } , node : function ( a , b ) { return this . checkUser ( ) , b & & void 0 ! = = this . isCluster ? this . isCluster = = = ! 1 ? ( this . routes [ " " ] = " dashboard " , void this . navigate ( " # dashboard " , { trigger : ! 0 } ) ) : ( this . nodeView | | ( this . nodeView = new window . NodeView ( { coordname : a , coordinators : this . coordinatorCollection , dbServers : this . dbServers } ) ) , void this . nodeView . render ( ) ) : void this . waitForInit ( this . node . bind ( this ) , a ) } , shards : function ( a ) { return this . checkUser ( ) , a & & void 0 ! = = this . isCluster ? this . isCluster = = = ! 1 ? ( this . routes [ " " ] = " dashboard " , void this . navigate ( " # dashboard " , { trigger : ! 0 } ) ) : ( this . shardsView | | ( this . shardsView = new window . ShardsView ( { dbServers : this . dbServers } ) ) , void this . shardsView . render ( ) ) : void this . waitForInit ( this . shards . bind ( this ) ) } , nodes : function ( a ) { return this . checkUser ( ) , a & & void 0 ! = = this . isCluster ? this . isCluster = = = ! 1 ? ( this . routes [ " " ] = " dashboard " , void this . navigate ( " # dashboard " , { trigger : ! 0 } ) ) : ( this . nodesView | | ( this . nodesView = new window . NodesView ( { } ) ) , void this . nodesView . render ( ) ) : void this . waitForInit ( this . nodes . bind ( this ) ) } , cNodes : function ( a ) { return this . checkUser ( ) , a & & void 0 ! = = this . isCluster ? this . isCluster = = = ! 1 ? ( this . routes [ " " ] = " dashboard " , void this . navigate ( " # dashboard " , { trigger : ! 0 } ) ) : ( this . nodesView = new window . NodesView ( { coordinators : this . coordinatorCollection , dbServers : this . dbServers [ 0 ] , toRender : " coordinator " } ) , void this . nodesView . render ( ) ) : void this . waitForInit ( this . cNodes . bind ( this ) ) } , dNodes : function ( a ) { return this . checkUser ( ) , a & & void 0 ! = = this . isCluster ? this . isCluster = = = ! 1 ? ( this . routes [ " " ] = " dashboard " , void this . navigate ( " # dashboard " , { trigger : ! 0 } ) ) : 0 = = = this . dbServers . length ? void this . navigate ( " # cNodes " , { trigger : ! 0 } ) : ( this . nodesView = new window . NodesView ( { coordinators : this . coordinatorCollection , dbServers : this . dbServers [ 0 ] , toRender : " dbserver " } ) , void this . nodesView . render ( ) ) : void this . waitForInit ( this . dNodes . bind ( this ) ) } , sNodes : function ( a ) { return this . checkUser ( ) , a & & void 0 ! = = this . isCluster ? this . isCluster = = = ! 1 ? ( this . routes [ " " ] = " dashboard " , void this . navigate ( " # dashboard " , { trigger : ! 0 } ) ) : ( this . scaleView = new window . ScaleView ( { coordinators : this . coordinatorCollection , dbServers : this . dbServers [ 0 ] } ) , void this . scaleView . render ( ) ) : void this . waitForInit ( this . sNodes . bind ( this ) ) } , addAuth : function ( a ) { var b = this . clusterPlan . get ( " user " ) ; if ( ! b ) return a . abort ( ) , void ( this . isCheckingUser | | this . requestAuth ( ) ) ; var c = b . name , d = b . passwd , e = c . concat ( " : " , d ) ; a . setRequestHeader ( " Authorization " , " Basic " + btoa ( e ) ) } , logs : function ( a , b ) { if ( this . checkUser ( ) , ! b ) return void this . waitForInit ( this . logs . bind ( this ) , a ) ; if ( ! this . logsView ) { var c = new window . ArangoLogs ( { upto : ! 0 , loglevel : 4 } ) , d = new window . ArangoLogs ( { loglevel : 4 } ) , e = new window . ArangoLogs ( { loglevel : 3 } ) , f = new window . ArangoLogs ( { loglevel : 2 } ) , g = new window . ArangoLogs ( { loglevel : 1 } ) ; this . logsView = new window . LogsView ( { logall : c , logdebug : d , loginfo : e , logwarning : f , logerror : g } ) } this . logsView . render ( ) } , applicationDetail : function ( a , b ) { if ( this . checkUser ( ) , ! b ) return void this . waitForInit ( this . applicationDetail . bind ( this ) , a ) ; var c = function ( ) { this . hasOwnProperty ( " applicationDetailView " ) | | ( this . applicationDetailView = new window . ApplicationDetailView ( { model : this . foxxList . get ( decodeURIComponent ( a ) ) } ) ) , this . applicationDetailView . model = this . foxxList . get ( decodeURIComponent ( a ) ) , this . applicationDetailView . render ( " swagger " ) } . bind ( this ) ; 0 = = = this . foxxList . length ? this . foxxList . fetch ( { cache : ! 1 , success : function ( ) { c ( ) } } ) : c ( ) } , login : function ( ) { var a = function ( a , b ) { this . loginView | | ( this . loginView = new window . LoginView ( { collection : this . userCollection } ) ) , a | | null = = = b ? this . loginView . render ( ) : this . loginView . render ( ! 0 ) } . bind ( this ) ; this . userCollection . whoAmI ( a ) } , collections : function ( a ) { if ( this . checkUser ( ) , ! a ) return void this . waitForInit ( this . collections . bind ( this ) ) ; var b = this ; this . collectionsView | | ( this . collectionsView = new window . CollectionsView ( { collection : this . arangoCollectionsStore } ) ) , this . arangoCollectionsStore . fetch ( { cache : ! 1 , success : function ( ) { b . collectionsView . render ( ) } } ) } , cIndices : function ( a , b ) { var c = this ; return this . checkUser ( ) , b ? void this . arangoCollectionsStore . fetch ( { cache : ! 1 , success : function ( ) { c . indicesView = new window . IndicesView ( { collectionName : a , collection : c . arangoCollectionsStore . findWhere ( { name : a } ) } ) , c . indicesView . render ( ) } } ) : void this . waitForInit ( this . cIndices . bind ( this ) , a ) } , cSettings : function ( a , b ) { var c = this ; return this . checkUser ( ) , b ? void this . arangoCollectionsStore . fetch ( { cache : ! 1 , success : function ( ) { c . settingsView = new window . SettingsView ( { collectionName : a , collection : c . arangoCollectionsStore . findWhere ( { name : a } ) } ) , c . settingsView . render ( ) } } ) : void this . waitForInit ( this . cSettings . bind ( this ) , a ) } , cInfo : function ( a , b ) { var c = this ; return this . checkUser ( ) , b ? void this . arangoCollectionsStore . fetch ( { cache : ! 1 , success : function ( ) { c . infoView = new window . InfoView ( { collectionName : a , collection : c . arangoCollectionsStore . findWhere ( { name : a } ) } ) , c . infoView . render ( ) } } ) : void this . waitForInit ( this . cInfo . bind ( this ) , a ) } , documents : function ( a , b , c ) { return this . checkUser ( ) , c ? ( this . documentsView | | ( this . documentsView = new window . DocumentsView ( { collection : new window . ArangoDocuments , documentStore : this . arangoDocumentStore , collectionsStore : this . arangoCollectionsStore } ) ) , this . documentsView . setCollectionId ( a , b ) , void this . documentsView . render ( ) ) : void this . waitForInit ( this . documents . bind ( this ) , a , b ) } , document : function ( a , b , c ) { if ( this . checkUser ( ) , ! c ) return void this . waitForInit ( this . document . bind ( this ) , a , b ) ; this . documentView | | ( this . documentView = new window . DocumentView ( { collection : this . arangoDocumentStore } ) ) , this . documentView . colid = a ; var d = window . location . hash . split ( " / " ) [ 2 ] , e = ( d . split ( " % " ) . length - 1 ) % 3 ; decodeURI ( d ) ! = = d & & 0 ! = = e & & ( d = decodeURIComponent ( d ) ) , this . documentView . docid = d , this . documentView . render ( ) ; var f = function ( a , b ) { a ? console . log ( " Error " , " Could not fetch collection type " ) : this . documentView . setType ( b ) } . bind ( this ) ; arangoHelper . collectionApiType ( a , null , f ) } , query : function ( a ) { return this . checkUser ( ) , a ? ( this . queryView | | ( this . queryView = new window . QueryView ( { collection : this . queryCollection } ) ) , void this . queryView . render ( ) ) : void this . waitForInit ( this . query . bind ( this ) ) } , graph : function ( a , b ) { return this . checkUser ( ) , b ? ( this . graphViewer & & ( this . graphViewer . graphSettingsView & & this . graphViewer . graphSettingsView . remove ( ) , this . graphViewer . killCurrentGraph ( ) , this . graphViewer . unbind ( ) , this . graphViewer . remove ( ) ) , this . graphViewer = new window . GraphViewer ( { name : a , documentStore : this . arangoDocumentStore , collection : new window . GraphCollection , userConfig : this . userConfig } ) , void this . graphViewer . render ( ) ) : void this . waitForInit ( this . graph . bind ( this ) , a ) } , graphSettings : function ( a , b ) { return this . checkUser ( ) , b ? ( this . graphSettingsView & & this . graphSettingsView . remove ( ) , this . graphSettingsView = new window . GraphSettingsView ( { name : a , userConfig : this . userConfig } ) , void this . graphSettingsView . render ( ) ) : void this . waitForInit ( this . graphSettings . bind ( this ) , a ) } , helpUs : function ( a ) { return this . checkUser ( ) , a ? ( this . testView | | ( this . helpUsView = new window . HelpUsView ( { } ) ) , void this . helpUsView . render ( ) ) : void this . waitForInit ( this . helpUs . bind ( this ) ) } , support : function ( a ) { return this . checkUser ( ) , a ? ( this . testView | | ( this . supportView = new window . SupportView ( { } ) ) , void this . supportView . render ( ) ) : void this . waitForInit ( this . support . bind ( this ) ) } , workMonitor : function ( a ) { return this . checkUser ( ) , a ? ( this . workMonitorCollection | | ( this . workMonitorCollection = new window . WorkMonitorCollection ) , this . workMonitorView | | ( this . workMonitorView = new window . WorkMonitorView ( { collection : this . workMonitorCollection } ) ) , void this . workMonitorView . render ( ) ) : void this . waitForInit ( this . workMonitor . bind ( this ) ) } , queryManagement : function ( a ) { return this . checkUser ( ) , a ? ( this . queryManagementView | | ( this . queryManagementView = new window . QueryManagementView ( { collection : void 0 } ) ) , void this . queryManagementView . render ( ) ) : void this . waitForInit ( this . queryManagement . bind ( this ) ) } , databases : function ( a ) { if ( this . checkUser ( ) , ! a ) return void this . waitForInit ( this . databases . bind ( this ) ) ; var b = function ( a ) { a ? ( arangoHelper . arangoError ( " DB " , " Could not get list of allowed databases " ) , this . navigate ( " # " , { trigger : ! 0 } ) , $ ( " # databaseNavi " ) . css ( " display " , " none " ) , $ ( " # databaseNaviSelect " ) . css ( " display " , " none " ) ) : ( this . databaseView | | ( this . databaseView = new window . DatabaseView ( { users : this . userCollection , collection : this . arangoDatabase } ) ) , this . databaseView . render ( ) ) } . bind ( this ) ; arangoHelper . databaseAllowed ( b ) } , dashboard : function ( a ) { return this . checkUser ( ) , a ? ( void 0 = = = this . dashboardView & & ( this . dashboardView = new window . DashboardView ( { dygraphConfig : window . dygraphConfig , database : this . arangoDatabase } ) ) , void this . dashboardView . render ( ) ) : void this . waitForInit ( this . dashboard . bind ( this ) ) } , graphManagement : function ( a ) { return this . checkUser ( ) , a ? ( this . graphManagementView & & this . graphManagementView . undelegateEvents ( ) , this . graphManagementView = new window . GraphManagementView ( { collection : new window . GraphCollection , collectionCollection : this . arangoCollectionsStore } ) , void this . graphManagementView . render ( ) ) : void this . waitForInit ( this . graphManagement . bind ( this ) ) } , showGraph : function ( a , b ) { return this . checkUser ( ) , b ? void ( this . graphManagementView ? this . graphManagementView . loadGraphViewer ( a ) : ( this . graphManagementView = new window . GraphManagementView ( { collection : new window . GraphCollection , collectionCollection : this . arangoCollectionsStore } ) , this . graphManagementView . render ( a , ! 0 ) ) ) : void this . waitForInit ( this . showGraph . bind ( this ) , a ) } , applications : function ( a ) { return this . checkUser ( ) , a ? ( void 0 = = = this . applicationsView & & ( this . applicationsView = new window . ApplicationsView ( { collection : this . foxxList } ) ) , void this . applicationsView . reload ( ) ) : void this . waitForInit ( this . applications . bind ( this ) ) } , handleSelectDatabase : function ( a ) { return this . checkUser ( ) , a ? void this . naviView . handleSelectDatabase ( ) : void this . waitForInit ( this . handleSelectDatabase . bind ( this ) ) } , handleResize : function ( ) { this . dashboardView & & this . dashboardView . resize ( ) , this . graphManagementView & & " graphs " = = = Backbone . history . getFragment ( ) & & this . graphManagementView . handleResize ( $ ( " # content " ) . width ( ) ) , this . queryView & & " queries " = = = Backbone . history . getFragment ( ) & & this . queryView . resize ( ) , this . naviView & & this . naviView . resize ( ) , this . graphViewer & & Backbone . history . getFragment ( ) . indexOf ( " graph " ) > - 1 & & this . graphViewer . resize ( ) , this . documentsView & & Backbone . history . getFragment ( ) . indexOf ( " documents " ) > - 1 & & this . documentsView . resize ( ) , this . documentView & & Backbone . history . getFragment ( ) . indexOf ( " collection " ) > - 1 & & this . documentView . resize ( ) } , userPermissionView : function ( a , b ) { if ( this . checkUser ( ) , b | | null = = = b ) this . userPermissionView = new window . UserPermissionView ( { collection : this . userCollection , databases : this . arangoDatabase , username : a } ) , this . userPermissionView . render ( ) ; else if ( b = = = ! 1 ) return void this . waitForInit ( this . userPermissionView . bind ( this ) , a ) } , userView : function ( a , b ) { this . checkUser ( ) , b | | null = = = b ? ( this . userView = new window . UserView ( { collection : this . userCollection , username : a } ) , this . userView . render ( ) ) : b = = = ! 1 & & this . waitForInit ( this . userView . bind ( this ) , a ) } , userManagement : function ( a ) { return this . checkUser ( ) , a ? ( this . userManagementView | | ( this . userManagementView = new window . UserManagementView ( { collection : this . userCollection } ) ) , void this . userManagementView . render ( ) ) : void this . waitForInit ( this . userManagement . bind ( this ) ) } , userProfile : function ( a ) { return this . checkUser ( ) , a ? ( this . userManagementView | | ( this . userManagementView = new window . UserManagementView ( { collection : this . userCollection } ) ) , void this . userManagementView . render ( ! 0 ) ) : void this . waitForInit ( this . userProfile . bind ( this ) ) } , fetchDBS : function ( a ) { var b = this , c = ! 1 ; this . coordinatorCollection . each ( function ( a ) { b . dbServers . push ( new window . ClusterServers ( [ ] , { host : a . get ( " address " ) } ) ) } ) , this . initFinished = ! 0 , _ . each ( this . dbServers , function ( b ) { b . fetch ( { success : function ( ) { c = = = ! 1 & & a & & ( a ( ) , c = ! 0 ) } } ) } ) } , getNewRoute : function ( a ) { return " http : / / " + a } , registerForUpdate : function ( a ) { this . toUpdate . push ( a ) , a . updateUrl ( ) } } ) } ( ) , function ( ) { " use strict " ; var a = function ( a , b ) { var c = [ ] ; c . push ( window . modalView . createSuccessButton ( " Download Page " , function ( ) { window . open ( " https : / / www . arangodb . com / download " , " _blank " ) , window . modalView . hide ( ) } ) ) ; var d = [ ] , e = window . modalView . createReadOnlyEntry . bind ( window . modalView ) ; d . push ( e ( " current " , " Current " , a . toString ( ) ) ) , b . major & & d . push ( e ( " major " , " Major " , b . major . version ) ) , b . minor & & d . push ( e ( " minor " , " Minor " , b . minor . version ) ) , b . bugfix & & d . push ( e ( " bugfix " , " Bugfix " , b . bugfix . version ) ) , window . modalView . show ( " modalTable . ejs " , " New Version Available " , c , d ) } ; window . checkVersion = function ( ) { $ . ajax ( { type : " GET " , cache : ! 1 , url : arangoHelper . databaseUrl ( " / _api / version " ) , contentType : " application / json " , processData : ! 1 , async : ! 0 , success : function ( b ) { var c = window . versionHelper . fromString ( b . version ) ; $ ( " . navbar # currentVersion " ) . html ( b . version . substr ( 0 , 7 ) + ' < i class = " fa fa - check - circle " > < / i > ' ) , window . parseVersions = function ( b ) { return _ . isEmpty ( b ) ? void $ ( " # currentVersion " ) . addClass ( " up - to - date " ) : ( $ ( " # currentVersion " ) . addClass ( " out - of - date " ) , $ ( " # currentVersion . fa " ) . removeClass ( " fa - check - circle " ) . addClass ( " fa - exclamation - circle " ) , void $ ( " # currentVersion " ) . click ( function ( ) { a ( c , b ) } ) ) } , $ . ajax ( { type : " GET " , async : ! 0 , crossDomain : ! 0 , timeout : 3e3 , dataType : " jsonp " , url : " https : / / www . arangodb . com / repositories / versions . php ? jsonp = parseVersions & version = " + encodeURIComponent ( c . toString ( ) ) } ) } } ) } } ( ) , function ( ) { " use strict " ; window . hasOwnProperty ( " TEST_BUILD " ) | | ( $ ( document ) . ajaxSend ( function ( a , b , c ) { var d = window . arangoHelper . getCurrentJwt ( ) ; d & & b . setRequestHeader ( " Authorization " , " bearer " + d ) } ) , $ ( document ) . ready ( function ( ) { window . App = new window . Router , Backbone . history . start ( ) , window . App . handleResize ( ) } ) , $ ( document ) . click ( function ( a ) { a . stopPropagation ( ) , $ ( a . target ) . hasClass ( " subBarDropdown " ) | | $ ( a . target ) . hasClass ( " dropdown - header " ) | | $ ( a . target ) . hasClass ( " dropdown - footer " ) | | $ ( a . target ) . hasClass ( " toggle " ) | | $ ( " # userInfo " ) . is ( " : visible " ) & & $ ( " . subBarDropdown " ) . hide ( ) } ) ) } ( ) ; <nl> \ No newline at end of file <nl> Binary files a / js / apps / system / _admin / aardvark / APP / frontend / build / app . min . js . gz and b / js / apps / system / _admin / aardvark / APP / frontend / build / app . min . js . gz differ <nl> mmm a / js / apps / system / _admin / aardvark / APP / frontend / build / index - min . html <nl> ppp b / js / apps / system / _admin / aardvark / APP / frontend / build / index - min . html <nl> < h5 class = " collectionName " > < % = _ . escape ( username ) % > < % if ( name ! = = ' ' ) { % > ( < % <nl> < / div > <nl> <nl> < div id = " workMonitorContent " class = " innerContent " > <nl> - < / div > < / script > < / head > < body > < nav class = " navbar " style = " display : none " > < div class = " primary " > < div class = " navlogo " > < a class = " logo big " href = " # " > < img id = " ArangoDBLogo " class = " arangodbLogo " src = " img / arangodb - edition - optimized . svg " > < / a > < a class = " logo small " href = " # " > < img class = " arangodbLogo " src = " img / arangodb_logo_small . png " > < / a > < a class = " version " > < span id = " currentVersion " > < / span > < / a > < / div > < div class = " statmenu " id = " statisticBar " > < / div > < div class = " navmenu " id = " navigationBar " > < / div > < / div > < / nav > < div id = " modalPlaceholder " > < / div > < div class = " bodyWrapper " style = " display : none " > < div class = " centralRow " > < div id = " navbar2 " class = " navbarWrapper secondary " > < div class = " subnavmenu " id = " subNavigationBar " > < / div > < / div > < div class = " resizecontainer contentWrapper " > < div id = " loadingScreen " class = " loadingScreen " style = " display : none " > < i class = " fa fa - circle - o - notch fa - spin fa - 3x fa - fw margin - bottom " > < / i > < span class = " sr - only " > Loading . . . < / span > < / div > < div id = " content " class = " centralContent " > < / div > < footer class = " footer " > < div id = " footerBar " > < / div > < / footer > < / div > < / div > < / div > < div id = " progressPlaceholder " style = " display : none " > < / div > < div id = " spotlightPlaceholder " style = " display : none " > < / div > < div id = " graphSettingsContent " style = " display : none " > < / div > < div id = " offlinePlaceholder " style = " display : none " > < div class = " offline - div " > < div class = " pure - u " > < div class = " pure - u - 1 - 4 " > < / div > < div class = " pure - u - 1 - 2 offline - window " > < div class = " offline - header " > < h3 > You have been disconnected from the server < / h3 > < / div > < div class = " offline - body " > < p > The connection to the server has been lost . The server may be under heavy load . < / p > < p > Trying to reconnect in < span id = " offlineSeconds " > 10 < / span > seconds . < / p > < p class = " animation_state " > < span > < button class = " button - success " > Reconnect now < / button > < / span > < / p > < / div > < / div > < div class = " pure - u - 1 - 4 " > < / div > < / div > < / div > < / div > < div class = " arangoFrame " style = " " > < div class = " outerDiv " > < div class = " innerDiv " > < / div > < / div > < / div > < script src = " libs . js ? version = 1484678344782 " > < / script > < script src = " app . js ? version = 1484678344782 " > < / script > < / body > < / html > <nl> \ No newline at end of file <nl> + < / div > < / script > < / head > < body > < nav class = " navbar " style = " display : none " > < div class = " primary " > < div class = " navlogo " > < a class = " logo big " href = " # " > < img id = " ArangoDBLogo " class = " arangodbLogo " src = " img / arangodb - edition - optimized . svg " > < / a > < a class = " logo small " href = " # " > < img class = " arangodbLogo " src = " img / arangodb_logo_small . png " > < / a > < a class = " version " > < span id = " currentVersion " > < / span > < / a > < / div > < div class = " statmenu " id = " statisticBar " > < / div > < div class = " navmenu " id = " navigationBar " > < / div > < / div > < / nav > < div id = " modalPlaceholder " > < / div > < div class = " bodyWrapper " style = " display : none " > < div class = " centralRow " > < div id = " navbar2 " class = " navbarWrapper secondary " > < div class = " subnavmenu " id = " subNavigationBar " > < / div > < / div > < div class = " resizecontainer contentWrapper " > < div id = " loadingScreen " class = " loadingScreen " style = " display : none " > < i class = " fa fa - circle - o - notch fa - spin fa - 3x fa - fw margin - bottom " > < / i > < span class = " sr - only " > Loading . . . < / span > < / div > < div id = " content " class = " centralContent " > < / div > < footer class = " footer " > < div id = " footerBar " > < / div > < / footer > < / div > < / div > < / div > < div id = " progressPlaceholder " style = " display : none " > < / div > < div id = " spotlightPlaceholder " style = " display : none " > < / div > < div id = " graphSettingsContent " style = " display : none " > < / div > < div id = " offlinePlaceholder " style = " display : none " > < div class = " offline - div " > < div class = " pure - u " > < div class = " pure - u - 1 - 4 " > < / div > < div class = " pure - u - 1 - 2 offline - window " > < div class = " offline - header " > < h3 > You have been disconnected from the server < / h3 > < / div > < div class = " offline - body " > < p > The connection to the server has been lost . The server may be under heavy load . < / p > < p > Trying to reconnect in < span id = " offlineSeconds " > 10 < / span > seconds . < / p > < p class = " animation_state " > < span > < button class = " button - success " > Reconnect now < / button > < / span > < / p > < / div > < / div > < div class = " pure - u - 1 - 4 " > < / div > < / div > < / div > < / div > < div class = " arangoFrame " style = " " > < div class = " outerDiv " > < div class = " innerDiv " > < / div > < / div > < / div > < script src = " libs . js ? version = 1484747756272 " > < / script > < script src = " app . js ? version = 1484747756272 " > < / script > < / body > < / html > <nl> \ No newline at end of file <nl> Binary files a / js / apps / system / _admin / aardvark / APP / frontend / build / index - min . html . gz and b / js / apps / system / _admin / aardvark / APP / frontend / build / index - min . html . gz differ <nl>
|
grunt build
|
arangodb/arangodb
|
b36f7e5873b8c1a155177cf56278297442910394
|
2017-01-18T13:58:47Z
|
mmm a / src / video_core / morton . cpp <nl> ppp b / src / video_core / morton . cpp <nl> static void MortonCopy ( u32 stride , u32 block_height , u32 height , u32 block_depth <nl> <nl> / / With the BCn formats ( DXT and DXN ) , each 4x4 tile is swizzled instead of just individual <nl> / / pixel values . <nl> - const u32 tile_size_x { GetDefaultBlockWidth ( format ) } ; <nl> - const u32 tile_size_y { GetDefaultBlockHeight ( format ) } ; <nl> + constexpr u32 tile_size_x { GetDefaultBlockWidth ( format ) } ; <nl> + constexpr u32 tile_size_y { GetDefaultBlockHeight ( format ) } ; <nl> <nl> if constexpr ( morton_to_linear ) { <nl> Tegra : : Texture : : UnswizzleTexture ( buffer , addr , tile_size_x , tile_size_y , bytes_per_pixel , <nl> static MortonCopyFn GetSwizzleFunction ( MortonSwizzleMode mode , Surface : : PixelFor <nl> return morton_to_linear_fns [ static_cast < std : : size_t > ( format ) ] ; <nl> } <nl> <nl> - static u32 MortonInterleave128 ( u32 x , u32 y ) { <nl> - / / 128x128 Z - Order coordinate from 2D coordinates <nl> - static constexpr u32 xlut [ ] = { <nl> - 0x0000 , 0x0001 , 0x0002 , 0x0003 , 0x0008 , 0x0009 , 0x000a , 0x000b , 0x0040 , 0x0041 , 0x0042 , <nl> - 0x0043 , 0x0048 , 0x0049 , 0x004a , 0x004b , 0x0800 , 0x0801 , 0x0802 , 0x0803 , 0x0808 , 0x0809 , <nl> - 0x080a , 0x080b , 0x0840 , 0x0841 , 0x0842 , 0x0843 , 0x0848 , 0x0849 , 0x084a , 0x084b , 0x1000 , <nl> - 0x1001 , 0x1002 , 0x1003 , 0x1008 , 0x1009 , 0x100a , 0x100b , 0x1040 , 0x1041 , 0x1042 , 0x1043 , <nl> - 0x1048 , 0x1049 , 0x104a , 0x104b , 0x1800 , 0x1801 , 0x1802 , 0x1803 , 0x1808 , 0x1809 , 0x180a , <nl> - 0x180b , 0x1840 , 0x1841 , 0x1842 , 0x1843 , 0x1848 , 0x1849 , 0x184a , 0x184b , 0x2000 , 0x2001 , <nl> - 0x2002 , 0x2003 , 0x2008 , 0x2009 , 0x200a , 0x200b , 0x2040 , 0x2041 , 0x2042 , 0x2043 , 0x2048 , <nl> - 0x2049 , 0x204a , 0x204b , 0x2800 , 0x2801 , 0x2802 , 0x2803 , 0x2808 , 0x2809 , 0x280a , 0x280b , <nl> - 0x2840 , 0x2841 , 0x2842 , 0x2843 , 0x2848 , 0x2849 , 0x284a , 0x284b , 0x3000 , 0x3001 , 0x3002 , <nl> - 0x3003 , 0x3008 , 0x3009 , 0x300a , 0x300b , 0x3040 , 0x3041 , 0x3042 , 0x3043 , 0x3048 , 0x3049 , <nl> - 0x304a , 0x304b , 0x3800 , 0x3801 , 0x3802 , 0x3803 , 0x3808 , 0x3809 , 0x380a , 0x380b , 0x3840 , <nl> - 0x3841 , 0x3842 , 0x3843 , 0x3848 , 0x3849 , 0x384a , 0x384b , 0x0000 , 0x0001 , 0x0002 , 0x0003 , <nl> - 0x0008 , 0x0009 , 0x000a , 0x000b , 0x0040 , 0x0041 , 0x0042 , 0x0043 , 0x0048 , 0x0049 , 0x004a , <nl> - 0x004b , 0x0800 , 0x0801 , 0x0802 , 0x0803 , 0x0808 , 0x0809 , 0x080a , 0x080b , 0x0840 , 0x0841 , <nl> - 0x0842 , 0x0843 , 0x0848 , 0x0849 , 0x084a , 0x084b , 0x1000 , 0x1001 , 0x1002 , 0x1003 , 0x1008 , <nl> - 0x1009 , 0x100a , 0x100b , 0x1040 , 0x1041 , 0x1042 , 0x1043 , 0x1048 , 0x1049 , 0x104a , 0x104b , <nl> - 0x1800 , 0x1801 , 0x1802 , 0x1803 , 0x1808 , 0x1809 , 0x180a , 0x180b , 0x1840 , 0x1841 , 0x1842 , <nl> - 0x1843 , 0x1848 , 0x1849 , 0x184a , 0x184b , 0x2000 , 0x2001 , 0x2002 , 0x2003 , 0x2008 , 0x2009 , <nl> - 0x200a , 0x200b , 0x2040 , 0x2041 , 0x2042 , 0x2043 , 0x2048 , 0x2049 , 0x204a , 0x204b , 0x2800 , <nl> - 0x2801 , 0x2802 , 0x2803 , 0x2808 , 0x2809 , 0x280a , 0x280b , 0x2840 , 0x2841 , 0x2842 , 0x2843 , <nl> - 0x2848 , 0x2849 , 0x284a , 0x284b , 0x3000 , 0x3001 , 0x3002 , 0x3003 , 0x3008 , 0x3009 , 0x300a , <nl> - 0x300b , 0x3040 , 0x3041 , 0x3042 , 0x3043 , 0x3048 , 0x3049 , 0x304a , 0x304b , 0x3800 , 0x3801 , <nl> - 0x3802 , 0x3803 , 0x3808 , 0x3809 , 0x380a , 0x380b , 0x3840 , 0x3841 , 0x3842 , 0x3843 , 0x3848 , <nl> - 0x3849 , 0x384a , 0x384b , 0x0000 , 0x0001 , 0x0002 , 0x0003 , 0x0008 , 0x0009 , 0x000a , 0x000b , <nl> - 0x0040 , 0x0041 , 0x0042 , 0x0043 , 0x0048 , 0x0049 , 0x004a , 0x004b , 0x0800 , 0x0801 , 0x0802 , <nl> - 0x0803 , 0x0808 , 0x0809 , 0x080a , 0x080b , 0x0840 , 0x0841 , 0x0842 , 0x0843 , 0x0848 , 0x0849 , <nl> - 0x084a , 0x084b , 0x1000 , 0x1001 , 0x1002 , 0x1003 , 0x1008 , 0x1009 , 0x100a , 0x100b , 0x1040 , <nl> - 0x1041 , 0x1042 , 0x1043 , 0x1048 , 0x1049 , 0x104a , 0x104b , 0x1800 , 0x1801 , 0x1802 , 0x1803 , <nl> - 0x1808 , 0x1809 , 0x180a , 0x180b , 0x1840 , 0x1841 , 0x1842 , 0x1843 , 0x1848 , 0x1849 , 0x184a , <nl> - 0x184b , 0x2000 , 0x2001 , 0x2002 , 0x2003 , 0x2008 , 0x2009 , 0x200a , 0x200b , 0x2040 , 0x2041 , <nl> - 0x2042 , 0x2043 , 0x2048 , 0x2049 , 0x204a , 0x204b , 0x2800 , 0x2801 , 0x2802 , 0x2803 , 0x2808 , <nl> - 0x2809 , 0x280a , 0x280b , 0x2840 , 0x2841 , 0x2842 , 0x2843 , 0x2848 , 0x2849 , 0x284a , 0x284b , <nl> - 0x3000 , 0x3001 , 0x3002 , 0x3003 , 0x3008 , 0x3009 , 0x300a , 0x300b , 0x3040 , 0x3041 , 0x3042 , <nl> - 0x3043 , 0x3048 , 0x3049 , 0x304a , 0x304b , 0x3800 , 0x3801 , 0x3802 , 0x3803 , 0x3808 , 0x3809 , <nl> - 0x380a , 0x380b , 0x3840 , 0x3841 , 0x3842 , 0x3843 , 0x3848 , 0x3849 , 0x384a , 0x384b , <nl> - } ; <nl> - static constexpr u32 ylut [ ] = { <nl> - 0x0000 , 0x0004 , 0x0010 , 0x0014 , 0x0020 , 0x0024 , 0x0030 , 0x0034 , 0x0080 , 0x0084 , 0x0090 , <nl> - 0x0094 , 0x00a0 , 0x00a4 , 0x00b0 , 0x00b4 , 0x0100 , 0x0104 , 0x0110 , 0x0114 , 0x0120 , 0x0124 , <nl> - 0x0130 , 0x0134 , 0x0180 , 0x0184 , 0x0190 , 0x0194 , 0x01a0 , 0x01a4 , 0x01b0 , 0x01b4 , 0x0200 , <nl> - 0x0204 , 0x0210 , 0x0214 , 0x0220 , 0x0224 , 0x0230 , 0x0234 , 0x0280 , 0x0284 , 0x0290 , 0x0294 , <nl> - 0x02a0 , 0x02a4 , 0x02b0 , 0x02b4 , 0x0300 , 0x0304 , 0x0310 , 0x0314 , 0x0320 , 0x0324 , 0x0330 , <nl> - 0x0334 , 0x0380 , 0x0384 , 0x0390 , 0x0394 , 0x03a0 , 0x03a4 , 0x03b0 , 0x03b4 , 0x0400 , 0x0404 , <nl> - 0x0410 , 0x0414 , 0x0420 , 0x0424 , 0x0430 , 0x0434 , 0x0480 , 0x0484 , 0x0490 , 0x0494 , 0x04a0 , <nl> - 0x04a4 , 0x04b0 , 0x04b4 , 0x0500 , 0x0504 , 0x0510 , 0x0514 , 0x0520 , 0x0524 , 0x0530 , 0x0534 , <nl> - 0x0580 , 0x0584 , 0x0590 , 0x0594 , 0x05a0 , 0x05a4 , 0x05b0 , 0x05b4 , 0x0600 , 0x0604 , 0x0610 , <nl> - 0x0614 , 0x0620 , 0x0624 , 0x0630 , 0x0634 , 0x0680 , 0x0684 , 0x0690 , 0x0694 , 0x06a0 , 0x06a4 , <nl> - 0x06b0 , 0x06b4 , 0x0700 , 0x0704 , 0x0710 , 0x0714 , 0x0720 , 0x0724 , 0x0730 , 0x0734 , 0x0780 , <nl> - 0x0784 , 0x0790 , 0x0794 , 0x07a0 , 0x07a4 , 0x07b0 , 0x07b4 , 0x0000 , 0x0004 , 0x0010 , 0x0014 , <nl> - 0x0020 , 0x0024 , 0x0030 , 0x0034 , 0x0080 , 0x0084 , 0x0090 , 0x0094 , 0x00a0 , 0x00a4 , 0x00b0 , <nl> - 0x00b4 , 0x0100 , 0x0104 , 0x0110 , 0x0114 , 0x0120 , 0x0124 , 0x0130 , 0x0134 , 0x0180 , 0x0184 , <nl> - 0x0190 , 0x0194 , 0x01a0 , 0x01a4 , 0x01b0 , 0x01b4 , 0x0200 , 0x0204 , 0x0210 , 0x0214 , 0x0220 , <nl> - 0x0224 , 0x0230 , 0x0234 , 0x0280 , 0x0284 , 0x0290 , 0x0294 , 0x02a0 , 0x02a4 , 0x02b0 , 0x02b4 , <nl> - 0x0300 , 0x0304 , 0x0310 , 0x0314 , 0x0320 , 0x0324 , 0x0330 , 0x0334 , 0x0380 , 0x0384 , 0x0390 , <nl> - 0x0394 , 0x03a0 , 0x03a4 , 0x03b0 , 0x03b4 , 0x0400 , 0x0404 , 0x0410 , 0x0414 , 0x0420 , 0x0424 , <nl> - 0x0430 , 0x0434 , 0x0480 , 0x0484 , 0x0490 , 0x0494 , 0x04a0 , 0x04a4 , 0x04b0 , 0x04b4 , 0x0500 , <nl> - 0x0504 , 0x0510 , 0x0514 , 0x0520 , 0x0524 , 0x0530 , 0x0534 , 0x0580 , 0x0584 , 0x0590 , 0x0594 , <nl> - 0x05a0 , 0x05a4 , 0x05b0 , 0x05b4 , 0x0600 , 0x0604 , 0x0610 , 0x0614 , 0x0620 , 0x0624 , 0x0630 , <nl> - 0x0634 , 0x0680 , 0x0684 , 0x0690 , 0x0694 , 0x06a0 , 0x06a4 , 0x06b0 , 0x06b4 , 0x0700 , 0x0704 , <nl> - 0x0710 , 0x0714 , 0x0720 , 0x0724 , 0x0730 , 0x0734 , 0x0780 , 0x0784 , 0x0790 , 0x0794 , 0x07a0 , <nl> - 0x07a4 , 0x07b0 , 0x07b4 , 0x0000 , 0x0004 , 0x0010 , 0x0014 , 0x0020 , 0x0024 , 0x0030 , 0x0034 , <nl> - 0x0080 , 0x0084 , 0x0090 , 0x0094 , 0x00a0 , 0x00a4 , 0x00b0 , 0x00b4 , 0x0100 , 0x0104 , 0x0110 , <nl> - 0x0114 , 0x0120 , 0x0124 , 0x0130 , 0x0134 , 0x0180 , 0x0184 , 0x0190 , 0x0194 , 0x01a0 , 0x01a4 , <nl> - 0x01b0 , 0x01b4 , 0x0200 , 0x0204 , 0x0210 , 0x0214 , 0x0220 , 0x0224 , 0x0230 , 0x0234 , 0x0280 , <nl> - 0x0284 , 0x0290 , 0x0294 , 0x02a0 , 0x02a4 , 0x02b0 , 0x02b4 , 0x0300 , 0x0304 , 0x0310 , 0x0314 , <nl> - 0x0320 , 0x0324 , 0x0330 , 0x0334 , 0x0380 , 0x0384 , 0x0390 , 0x0394 , 0x03a0 , 0x03a4 , 0x03b0 , <nl> - 0x03b4 , 0x0400 , 0x0404 , 0x0410 , 0x0414 , 0x0420 , 0x0424 , 0x0430 , 0x0434 , 0x0480 , 0x0484 , <nl> - 0x0490 , 0x0494 , 0x04a0 , 0x04a4 , 0x04b0 , 0x04b4 , 0x0500 , 0x0504 , 0x0510 , 0x0514 , 0x0520 , <nl> - 0x0524 , 0x0530 , 0x0534 , 0x0580 , 0x0584 , 0x0590 , 0x0594 , 0x05a0 , 0x05a4 , 0x05b0 , 0x05b4 , <nl> - 0x0600 , 0x0604 , 0x0610 , 0x0614 , 0x0620 , 0x0624 , 0x0630 , 0x0634 , 0x0680 , 0x0684 , 0x0690 , <nl> - 0x0694 , 0x06a0 , 0x06a4 , 0x06b0 , 0x06b4 , 0x0700 , 0x0704 , 0x0710 , 0x0714 , 0x0720 , 0x0724 , <nl> - 0x0730 , 0x0734 , 0x0780 , 0x0784 , 0x0790 , 0x0794 , 0x07a0 , 0x07a4 , 0x07b0 , 0x07b4 , <nl> - } ; <nl> - return xlut [ x % 128 ] + ylut [ y % 128 ] ; <nl> - } <nl> - <nl> - static u32 GetMortonOffset128 ( u32 x , u32 y , u32 bytes_per_pixel ) { <nl> - / / Calculates the offset of the position of the pixel in Morton order <nl> - / / Framebuffer images are split into 128x128 tiles . <nl> - <nl> - constexpr u32 block_height = 128 ; <nl> - const u32 coarse_x = x & ~ 127 ; <nl> - <nl> - const u32 i = MortonInterleave128 ( x , y ) ; <nl> - <nl> - const u32 offset = coarse_x * block_height ; <nl> - <nl> - return ( i + offset ) * bytes_per_pixel ; <nl> - } <nl> - <nl> void MortonSwizzle ( MortonSwizzleMode mode , Surface : : PixelFormat format , u32 stride , <nl> u32 block_height , u32 height , u32 block_depth , u32 depth , u32 tile_width_spacing , <nl> u8 * buffer , u8 * addr ) { <nl> void MortonSwizzle ( MortonSwizzleMode mode , Surface : : PixelFormat format , u32 stri <nl> tile_width_spacing , buffer , addr ) ; <nl> } <nl> <nl> - void MortonCopyPixels128 ( MortonSwizzleMode mode , u32 width , u32 height , u32 bytes_per_pixel , <nl> - u32 linear_bytes_per_pixel , u8 * morton_data , u8 * linear_data ) { <nl> - const bool morton_to_linear = mode = = MortonSwizzleMode : : MortonToLinear ; <nl> - u8 * data_ptrs [ 2 ] ; <nl> - for ( u32 y = 0 ; y < height ; + + y ) { <nl> - for ( u32 x = 0 ; x < width ; + + x ) { <nl> - const u32 coarse_y = y & ~ 127 ; <nl> - const u32 morton_offset = <nl> - GetMortonOffset128 ( x , y , bytes_per_pixel ) + coarse_y * width * bytes_per_pixel ; <nl> - const u32 linear_pixel_index = ( x + y * width ) * linear_bytes_per_pixel ; <nl> - <nl> - data_ptrs [ morton_to_linear ? 1 : 0 ] = morton_data + morton_offset ; <nl> - data_ptrs [ morton_to_linear ? 0 : 1 ] = & linear_data [ linear_pixel_index ] ; <nl> - <nl> - std : : memcpy ( data_ptrs [ 0 ] , data_ptrs [ 1 ] , bytes_per_pixel ) ; <nl> - } <nl> - } <nl> - } <nl> - <nl> } / / namespace VideoCore <nl> mmm a / src / video_core / morton . h <nl> ppp b / src / video_core / morton . h <nl> void MortonSwizzle ( MortonSwizzleMode mode , VideoCore : : Surface : : PixelFormat forma <nl> u32 block_height , u32 height , u32 block_depth , u32 depth , u32 tile_width_spacing , <nl> u8 * buffer , u8 * addr ) ; <nl> <nl> - void MortonCopyPixels128 ( MortonSwizzleMode mode , u32 width , u32 height , u32 bytes_per_pixel , <nl> - u32 linear_bytes_per_pixel , u8 * morton_data , u8 * linear_data ) ; <nl> - <nl> } / / namespace VideoCore <nl> mmm a / src / video_core / renderer_opengl / renderer_opengl . cpp <nl> ppp b / src / video_core / renderer_opengl / renderer_opengl . cpp <nl> void RendererOpenGL : : SwapBuffers ( const Tegra : : FramebufferConfig * framebuffer ) { <nl> * Loads framebuffer from emulated memory into the active OpenGL texture . <nl> * / <nl> void RendererOpenGL : : LoadFBToScreenInfo ( const Tegra : : FramebufferConfig & framebuffer ) { <nl> - const auto pixel_format { <nl> - VideoCore : : Surface : : PixelFormatFromGPUPixelFormat ( framebuffer . pixel_format ) } ; <nl> - const u32 bytes_per_pixel { VideoCore : : Surface : : GetBytesPerPixel ( pixel_format ) } ; <nl> - const u64 size_in_bytes { framebuffer . stride * framebuffer . height * bytes_per_pixel } ; <nl> - const VAddr framebuffer_addr { framebuffer . address + framebuffer . offset } ; <nl> - <nl> / / Framebuffer orientation handling <nl> framebuffer_transform_flags = framebuffer . transform_flags ; <nl> framebuffer_crop_rect = framebuffer . crop_rect ; <nl> <nl> - / / Ensure no bad interactions with GL_UNPACK_ALIGNMENT , which by default <nl> - / / only allows rows to have a memory alignement of 4 . <nl> - ASSERT ( framebuffer . stride % 4 = = 0 ) ; <nl> - <nl> - if ( ! rasterizer - > AccelerateDisplay ( framebuffer , framebuffer_addr , framebuffer . stride ) ) { <nl> - / / Reset the screen info ' s display texture to its own permanent texture <nl> - screen_info . display_texture = screen_info . texture . resource . handle ; <nl> - <nl> - rasterizer - > FlushRegion ( ToCacheAddr ( Memory : : GetPointer ( framebuffer_addr ) ) , size_in_bytes ) ; <nl> - <nl> - constexpr u32 linear_bpp = 4 ; <nl> - VideoCore : : MortonCopyPixels128 ( VideoCore : : MortonSwizzleMode : : MortonToLinear , <nl> - framebuffer . width , framebuffer . height , bytes_per_pixel , <nl> - linear_bpp , Memory : : GetPointer ( framebuffer_addr ) , <nl> - gl_framebuffer_data . data ( ) ) ; <nl> - <nl> - glPixelStorei ( GL_UNPACK_ROW_LENGTH , static_cast < GLint > ( framebuffer . stride ) ) ; <nl> + const VAddr framebuffer_addr { framebuffer . address + framebuffer . offset } ; <nl> + if ( rasterizer - > AccelerateDisplay ( framebuffer , framebuffer_addr , framebuffer . stride ) ) { <nl> + return ; <nl> + } <nl> <nl> - / / Update existing texture <nl> - / / TODO : Test what happens on hardware when you change the framebuffer dimensions so that <nl> - / / they differ from the LCD resolution . <nl> - / / TODO : Applications could theoretically crash yuzu here by specifying too large <nl> - / / framebuffer sizes . We should make sure that this cannot happen . <nl> - glTextureSubImage2D ( screen_info . texture . resource . handle , 0 , 0 , 0 , framebuffer . width , <nl> - framebuffer . height , screen_info . texture . gl_format , <nl> - screen_info . texture . gl_type , gl_framebuffer_data . data ( ) ) ; <nl> + / / Reset the screen info ' s display texture to its own permanent texture <nl> + screen_info . display_texture = screen_info . texture . resource . handle ; <nl> <nl> - glPixelStorei ( GL_UNPACK_ROW_LENGTH , 0 ) ; <nl> - } <nl> + const auto pixel_format { <nl> + VideoCore : : Surface : : PixelFormatFromGPUPixelFormat ( framebuffer . pixel_format ) } ; <nl> + const u32 bytes_per_pixel { VideoCore : : Surface : : GetBytesPerPixel ( pixel_format ) } ; <nl> + const u64 size_in_bytes { framebuffer . stride * framebuffer . height * bytes_per_pixel } ; <nl> + const auto host_ptr { Memory : : GetPointer ( framebuffer_addr ) } ; <nl> + rasterizer - > FlushRegion ( ToCacheAddr ( host_ptr ) , size_in_bytes ) ; <nl> + <nl> + / / TODO ( Rodrigo ) : Read this from HLE <nl> + constexpr u32 block_height_log2 = 4 ; <nl> + VideoCore : : MortonSwizzle ( VideoCore : : MortonSwizzleMode : : MortonToLinear , pixel_format , <nl> + framebuffer . stride , block_height_log2 , framebuffer . height , 0 , 1 , 1 , <nl> + gl_framebuffer_data . data ( ) , host_ptr ) ; <nl> + <nl> + glPixelStorei ( GL_UNPACK_ROW_LENGTH , static_cast < GLint > ( framebuffer . stride ) ) ; <nl> + <nl> + / / Update existing texture <nl> + / / TODO : Test what happens on hardware when you change the framebuffer dimensions so that <nl> + / / they differ from the LCD resolution . <nl> + / / TODO : Applications could theoretically crash yuzu here by specifying too large <nl> + / / framebuffer sizes . We should make sure that this cannot happen . <nl> + glTextureSubImage2D ( screen_info . texture . resource . handle , 0 , 0 , 0 , framebuffer . width , <nl> + framebuffer . height , screen_info . texture . gl_format , <nl> + screen_info . texture . gl_type , gl_framebuffer_data . data ( ) ) ; <nl> + <nl> + glPixelStorei ( GL_UNPACK_ROW_LENGTH , 0 ) ; <nl> } <nl> <nl> / * * <nl>
|
renderer_opengl : Use block linear swizzling for CPU framebuffers
|
yuzu-emu/yuzu
|
9cdf5c6c3126d022cea24eb4cb905779738ef157
|
2019-08-21T05:17:14Z
|
mmm a / tensorflow / c / eager / tape . h <nl> ppp b / tensorflow / c / eager / tape . h <nl> Status InitialGradients ( <nl> gtl : : ArraySlice < Gradient * > output_gradients , const TensorTape & tensor_tape , <nl> const OpTape < BackwardFunction , TapeTensor > & op_tape , <nl> std : : unordered_map < int64 , std : : vector < Gradient * > > * result ) { <nl> - for ( int i = 0 ; i < target_tensor_ids . size ( ) ; + + i ) { <nl> + for ( int i = 0 , end = target_tensor_ids . size ( ) ; i < end ; + + i ) { <nl> const int64 id = target_tensor_ids [ i ] ; <nl> if ( output_gradients . empty ( ) | | output_gradients [ i ] = = nullptr ) { <nl> auto tensor_it = tensor_tape . find ( id ) ; <nl> Status GradientTape < Gradient , BackwardFunction , TapeTensor > : : ComputeGradient ( <nl> std : : vector < Gradient * > out_gradients ; <nl> out_gradients . reserve ( trace . output_tensor_info . size ( ) ) ; <nl> std : : vector < int64 > unneeded_gradients ; <nl> - for ( int i = 0 ; i < trace . input_tensor_id . size ( ) ; i + + ) { <nl> + for ( int i = 0 , end = trace . input_tensor_id . size ( ) ; i < end ; i + + ) { <nl> const auto & in_tensor_id = trace . input_tensor_id [ i ] ; <nl> if ( tensor_tape_ . find ( in_tensor_id ) = = tensor_tape_ . end ( ) & & <nl> sources_set . find ( in_tensor_id ) = = sources_set . end ( ) ) { <nl> Status GradientTape < Gradient , BackwardFunction , TapeTensor > : : ComputeGradient ( <nl> <nl> bool any_gradient_nonzero = false ; <nl> std : : vector < int > zero_indices ; <nl> - for ( int i = 0 ; i < trace . output_tensor_info . size ( ) ; + + i ) { <nl> + for ( int i = 0 , end = trace . output_tensor_info . size ( ) ; i < end ; + + i ) { <nl> const int64 id = trace . output_tensor_info [ i ] . GetID ( ) ; <nl> auto grad_it = gradients . find ( id ) ; <nl> if ( grad_it = = gradients . end ( ) ) { <nl> Status GradientTape < Gradient , BackwardFunction , TapeTensor > : : ComputeGradient ( <nl> } <nl> VLOG ( 1 ) < < " Got " < < in_gradients . size ( ) < < " in_gradients for " <nl> < < trace . input_tensor_id . size ( ) < < " sources " ; <nl> - for ( int i = 0 ; i < in_gradients . size ( ) ; + + i ) { <nl> + for ( int i = 0 , end = in_gradients . size ( ) ; i < end ; + + i ) { <nl> const int64 id = trace . input_tensor_id [ i ] ; <nl> if ( in_gradients [ i ] ! = nullptr ) { <nl> auto & unaggregated_grads = gradients [ id ] ; <nl> ForwardAccumulator < Gradient , BackwardFunction , TapeTensor > : : ForwardpropFromTape ( <nl> targets . reserve ( grad . size ( ) ) ; <nl> used_in_grads . reserve ( grad . size ( ) ) ; <nl> std : : unordered_map < int64 , TapeTensor > sources_that_are_targets ; <nl> - for ( int grad_index = 0 ; grad_index < grad . size ( ) ; + + grad_index ) { <nl> + for ( int grad_index = 0 , end = grad . size ( ) ; grad_index < end ; + + grad_index ) { <nl> Gradient * grad_tensor = grad [ grad_index ] ; <nl> if ( grad_tensor ! = nullptr ) { <nl> int64 tensor_id = vspace_ . TensorId ( grad_tensor ) ; <nl> mmm a / tensorflow / cc / framework / gradients . cc <nl> ppp b / tensorflow / cc / framework / gradients . cc <nl> Status SymbolicGradientBuilder : : ProcessWhileLoop ( Node * exit_node , <nl> / / Backprop along the in edges to the while loop ( i . e . the inputs to the enter <nl> / / nodes ) <nl> DCHECK_EQ ( dx . size ( ) , while_ctx - > enter_nodes ( ) . size ( ) ) ; <nl> - for ( int i = 0 ; i < dx . size ( ) ; + + i ) { <nl> + for ( int i = 0 , end = dx . size ( ) ; i < end ; + + i ) { <nl> Node * enter_node = while_ctx - > enter_nodes ( ) [ i ] ; <nl> for ( const Edge * e : enter_node - > in_edges ( ) ) { <nl> if ( e - > IsControlEdge ( ) ) continue ; <nl> Status SymbolicGradientBuilder : : AddGradients ( ) { <nl> / / All loop - specific control flow ops should have been handled above <nl> DCHECK ( ! n - > IsEnter ( ) & & ! n - > IsNextIteration ( ) ) < < n - > DebugString ( ) ; <nl> <nl> - const size_t num_no_grad = no_grad_dy_indices . size ( ) ; <nl> + const int num_no_grad = no_grad_dy_indices . size ( ) ; <nl> if ( IsPrimitiveOpWithNoGrad ( n - > type_string ( ) ) | | num_no_grad = = num_y ) { <nl> / / No grad defined for this op , or all outputs returned ' NoGradient ' : <nl> / / Backprop ' NoGradient ' along the in edges . <nl> Status SymbolicGradientBuilder : : AddGradients ( ) { <nl> for ( const Edge * e : n - > in_edges ( ) ) { <nl> if ( e - > IsControlEdge ( ) ) continue ; <nl> int dx_index = e - > dst_input ( ) ; <nl> - if ( dx_index > = dx . size ( ) ) { <nl> + const int dx_size = dx . size ( ) ; <nl> + if ( dx_index > = dx_size ) { <nl> return errors : : Internal ( <nl> " Invalid gradient output index : " , dx_index , " size : " , dx . size ( ) ) ; <nl> } <nl> mmm a / tensorflow / cc / framework / while_gradients . cc <nl> ppp b / tensorflow / cc / framework / while_gradients . cc <nl> Output ToOutput ( OutputTensor output_tensor ) { <nl> <nl> std : : vector < Output > ToOutputVector ( <nl> const std : : vector < OutputTensor > & output_tensors ) { <nl> - size_t n = output_tensors . size ( ) ; <nl> + const int n = output_tensors . size ( ) ; <nl> std : : vector < Output > result ; <nl> result . reserve ( n ) ; <nl> for ( int i = 0 ; i < n ; + + i ) result . push_back ( ToOutput ( output_tensors [ i ] ) ) ; <nl> mmm a / tensorflow / compiler / aot / codegen . cc <nl> ppp b / tensorflow / compiler / aot / codegen . cc <nl> string RewriteWithName ( const string & name , string code , <nl> Status GenArgMethods ( const tf2xla : : Config & config , <nl> const xla : : ProgramShapeProto & ps , <nl> const CompileResult & compile_result , string * methods ) { <nl> - size_t num_args = ps . parameters_size ( ) ; <nl> + const int num_args = ps . parameters_size ( ) ; <nl> / / feed_size ( ) + variable_size ( ) is the maximum number of args as an <nl> / / implementation may not create an argument for an unused variable . <nl> if ( config . feed_size ( ) + config . variable_size ( ) < num_args ) { <nl> Status GenResultMethods ( const tf2xla : : Config & config , <nl> int readonly_variables = absl : : c_count_if ( <nl> config . variable ( ) , <nl> [ ] ( const tf2xla : : Variable & var ) { return var . readonly ( ) ; } ) ; <nl> - if ( config . fetch_size ( ) + config . variable_size ( ) - readonly_variables ! = <nl> - num_results ) { <nl> + const int actual_num_results = config . fetch_size ( ) <nl> + + config . variable_size ( ) - readonly_variables ; <nl> + if ( actual_num_results ! = num_results ) { <nl> return errors : : InvalidArgument ( " mismatch between fetch_size ( " , <nl> config . fetch_size ( ) , " ) + variable_size ( " , <nl> config . variable_size ( ) , " ) and tuple_size ( " , <nl> Status GenResultMethods ( const tf2xla : : Config & config , <nl> / / Generate methods for variables . <nl> Status GenVariableMethods ( const tf2xla : : Config & config , <nl> const xla : : ProgramShapeProto & ps , string * methods ) { <nl> - size_t num_args = ps . parameters_size ( ) ; <nl> + const int num_args = ps . parameters_size ( ) ; <nl> for ( int i = config . feed_size ( ) ; i < num_args ; + + i ) { <nl> std : : vector < std : : pair < string , string > > rewrites ; <nl> TF_RETURN_IF_ERROR ( <nl> Status GenerateHeader ( const CodegenOpts & opts , const tf2xla : : Config & config , <nl> : : xla : : cpu : : CreateArgIndexTableFromBufferInfos ( buffer_infos ) ; <nl> std : : vector < string > buffer_infos_as_strings = <nl> BufferInfosToCppExpression ( buffer_infos ) ; <nl> - if ( result_index < 0 | | result_index > = buffer_infos . size ( ) ) { <nl> + const int64 buffer_infos_size = buffer_infos . size ( ) ; <nl> + if ( result_index < 0 | | result_index > = buffer_infos_size ) { <nl> return errors : : InvalidArgument ( " result index : " , result_index , <nl> " is outside the range of temp sizes : [ 0 , " , <nl> buffer_infos . size ( ) , " ) " ) ; <nl> Status ParseCppClass ( const string & cpp_class , string * class_name , <nl> / / Allow a fully qualified name that starts with " : : " . <nl> parts . erase ( parts . begin ( ) ) ; <nl> } <nl> - for ( int i = 0 ; i < parts . size ( ) ; + + i ) { <nl> - if ( i < parts . size ( ) - 1 ) { <nl> + for ( int i = 0 , end = parts . size ( ) ; i < end ; + + i ) { <nl> + if ( i < end - 1 ) { <nl> TF_RETURN_IF_ERROR ( ValidateCppIdent ( <nl> parts [ i ] , " in namespace component of cpp_class : " + cpp_class ) ) ; <nl> namespaces - > push_back ( parts [ i ] ) ; <nl> mmm a / tensorflow / compiler / jit / build_xla_ops_pass . cc <nl> ppp b / tensorflow / compiler / jit / build_xla_ops_pass . cc <nl> Status PredicateInt32Inputs ( const Scope & root , Node * n , <nl> root . graph ( ) - > AddControlEdge ( predicate_as_control . node ( ) , <nl> identity_n . operation . node ( ) ) ; <nl> <nl> - for ( int i = 0 ; i < int32_inputs . size ( ) ; i + + ) { <nl> + for ( int32 i = 0 , end = int32_inputs . size ( ) ; i < end ; i + + ) { <nl> TF_RETURN_IF_ERROR ( root . graph ( ) - > UpdateEdge ( identity_n [ i ] . node ( ) , i , n , <nl> int32_inputs_input_idxs [ i ] ) ) ; <nl> } <nl> mmm a / tensorflow / compiler / jit / compilability_check_util . h <nl> ppp b / tensorflow / compiler / jit / compilability_check_util . h <nl> class RecursiveCompilabilityChecker { <nl> UncompilableNodesMap * uncompilable_nodes_map ) ; <nl> <nl> / / Make sure we don ' t recurse infinitely on recursive functions . <nl> - const int kMaxRecursionDepth = 10 ; <nl> + const size_t kMaxRecursionDepth = 10 ; <nl> <nl> const OperationFilter & op_filter_ ; <nl> const DeviceType & jit_device_type_ ; <nl> mmm a / tensorflow / compiler / jit / device_util . cc <nl> ppp b / tensorflow / compiler / jit / device_util . cc <nl> using xla : : StatusOr ; <nl> void DeviceSet : : Insert ( DeviceId device_id ) { <nl> int word_index = device_id . id ( ) / kWordSize ; <nl> int bit_index = device_id . id ( ) % kWordSize ; <nl> - <nl> - if ( word_index > = storage_ . size ( ) ) { <nl> + const int storage_size = storage_ . size ( ) ; <nl> + if ( word_index > = storage_size ) { <nl> storage_ . resize ( word_index + 1 , 0 ) ; <nl> } <nl> <nl> void DeviceSet : : UnionWith ( const DeviceSet & other ) { <nl> storage_ . resize ( other . storage_ . size ( ) , 0 ) ; <nl> } <nl> <nl> - for ( int i = 0 ; i < other . storage_ . size ( ) ; i + + ) { <nl> + for ( int i = 0 , end = other . storage_ . size ( ) ; i < end ; i + + ) { <nl> storage_ [ i ] | = other . storage_ [ i ] ; <nl> } <nl> } <nl> mmm a / tensorflow / compiler / jit / device_util . h <nl> ppp b / tensorflow / compiler / jit / device_util . h <nl> class DeviceSet { <nl> void ForEach ( FnTy func ) const { <nl> / / This is really a poor man ' s iterator , we should consider writing a proper <nl> / / iterator if this ends up being used widely . <nl> - for ( int word_index = 0 ; word_index < storage_ . size ( ) ; word_index + + ) { <nl> + for ( int word_index = 0 , end = storage_ . size ( ) ; word_index < end ; word_index + + ) { <nl> uint64 word = storage_ [ word_index ] ; <nl> while ( word ! = 0 ) { <nl> uint64 only_lowest_bit_set = word & - word ; <nl> mmm a / tensorflow / compiler / jit / encapsulate_subgraphs_pass . cc <nl> ppp b / tensorflow / compiler / jit / encapsulate_subgraphs_pass . cc <nl> static Status GetArgTypes ( const Graph & graph , DataTypeVector * types ) { <nl> if ( n - > type_string ( ) = = kArgOp ) { <nl> int index ; <nl> TF_RETURN_IF_ERROR ( GetNodeAttr ( n - > attrs ( ) , " index " , & index ) ) ; <nl> - if ( index < 0 | | index > = types - > size ( ) ) { <nl> + const int types_size = types - > size ( ) ; <nl> + if ( index < 0 | | index > = types_size ) { <nl> return errors : : InvalidArgument ( " Invalid argument number " ) ; <nl> } <nl> ( * types ) [ index ] = n - > output_type ( 0 ) ; <nl> static Status RenumberArguments ( Graph * graph , <nl> if ( n - > type_string ( ) = = kArgOp ) { <nl> int index ; <nl> TF_RETURN_IF_ERROR ( GetNodeAttr ( n - > attrs ( ) , " index " , & index ) ) ; <nl> - if ( index < 0 | | index > = permutation . size ( ) ) { <nl> + const int permutation_size = permutation . size ( ) ; <nl> + if ( index < 0 | | index > = permutation_size ) { <nl> return errors : : InvalidArgument ( " Invalid argument number " ) ; <nl> } <nl> n - > AddAttr ( " index " , permutation [ index ] ) ; <nl> mmm a / tensorflow / compiler / jit / encapsulate_util . cc <nl> ppp b / tensorflow / compiler / jit / encapsulate_util . cc <nl> Status PreprocessDataEdgesBetweenOutsideCompilations ( <nl> / / Remove the edge from host to outside compilation . Add a placeholder as <nl> / / outside compilation node input . <nl> std : : map < std : : pair < string , int > , Node * > placeholders ; <nl> - for ( int i = 0 ; i < edges . size ( ) ; i + + ) { <nl> + for ( int i = 0 , end = edges . size ( ) ; i < end ; i + + ) { <nl> Node * dst = g - > FindNodeId ( edges [ i ] . dst_node_id ) ; <nl> const Edge * e ; <nl> TF_RETURN_IF_ERROR ( dst - > input_edge ( edges [ i ] . dst_input , & e ) ) ; <nl> Status PreprocessDataEdgesBetweenOutsideCompilations ( <nl> / / Other edge in ` edges ` might have ` e - > dst ( ) ` as src or dst <nl> / / node . Before removing ` e - > dst ( ) ` , replace those edges with <nl> / / corresponding edges for ` dst_replace_node ` . <nl> - for ( int j = i + 1 ; j < edges . size ( ) ; j + + ) { <nl> + for ( int j = i + 1 , end = edges . size ( ) ; j < end ; j + + ) { <nl> if ( edges [ j ] . dst_node_id = = edges [ i ] . dst_node_id ) { <nl> edges [ j ] . dst_node_id = dst_replace_node - > id ( ) ; <nl> } <nl> Status PostprocessDataEdgesBetweenOutsideCompilations ( <nl> g - > AddControlEdge ( original_node , e - > dst ( ) ) ; <nl> g - > RemoveEdge ( e ) ; <nl> } <nl> - for ( int i = 0 ; i < data_edges . size ( ) ; i + + ) { <nl> + for ( int i = 0 , end = data_edges . size ( ) ; i < end ; i + + ) { <nl> Node * dst = data_edges [ i ] . dst ; <nl> NodeDef new_def = dst - > def ( ) ; <nl> int dst_input = data_edges [ i ] . dst_input ; <nl> Status PostprocessDataEdgesBetweenOutsideCompilations ( <nl> <nl> / / Other edges might have ` dst ` as dst node . Update those edges with <nl> / / ` replace_node ` . <nl> - for ( int j = i + 1 ; j < data_edges . size ( ) ; j + + ) { <nl> + for ( int j = i + 1 , end = data_edges . size ( ) ; j < end ; j + + ) { <nl> if ( data_edges [ j ] . dst = = dst ) { <nl> data_edges [ j ] . dst = replace_node ; <nl> } <nl> mmm a / tensorflow / compiler / jit / encapsulate_xla_computations_pass . cc <nl> ppp b / tensorflow / compiler / jit / encapsulate_xla_computations_pass . cc <nl> Status RewriteSubgraph ( const std : : vector < OutputTensor > & arg_source_tensors , <nl> if ( ! status . ok ( ) ) { <nl> return status ; <nl> } <nl> - for ( int i = 0 ; i < data_inputs . size ( ) ; + + i ) { <nl> + for ( int i = 0 , end = data_inputs . size ( ) ; i < end ; + + i ) { <nl> graph - > AddEdge ( data_inputs [ i ] . first , data_inputs [ i ] . second , xla_launch , <nl> i ) ; <nl> } <nl> for ( Node * n : control_inputs ) { <nl> graph - > AddControlEdge ( n , xla_launch ) ; <nl> } <nl> - for ( int i = 0 ; i < data_outputs . size ( ) ; + + i ) { <nl> + for ( int i = 0 , end = data_outputs . size ( ) ; i < end ; + + i ) { <nl> for ( const auto & successor : data_outputs [ i ] ) { <nl> graph - > AddEdge ( xla_launch , i , successor . first , successor . second ) ; <nl> } <nl> mmm a / tensorflow / compiler / jit / extract_outside_compilation_pass . cc <nl> ppp b / tensorflow / compiler / jit / extract_outside_compilation_pass . cc <nl> Status GetArgDataTypes ( const std : : vector < Node * > & arg_nodes , <nl> TF_RETURN_IF_ERROR ( GetNodeAttr ( n - > attrs ( ) , " T " , & dtype ) ) ; <nl> ( * recv_at_host_dtypes ) [ index ] = dtype ; <nl> } <nl> - for ( int i = 0 ; i < recv_at_host_dtypes - > size ( ) ; i + + ) { <nl> + for ( int i = 0 , end = recv_at_host_dtypes - > size ( ) ; i < end ; i + + ) { <nl> if ( ( * recv_at_host_dtypes ) [ i ] = = DT_INVALID ) { <nl> return errors : : Internal ( " Cannot get datatype for input " , i ) ; <nl> } <nl> xla : : StatusOr < Node * > ReplaceArgNodesWithRecvAtHostNode ( <nl> } <nl> <nl> / / Rewrite dst nodes because their input changed . <nl> - for ( int i = 0 ; i < out_edge_info . size ( ) ; i + + ) { <nl> + for ( int i = 0 , end = out_edge_info . size ( ) ; i < end ; i + + ) { <nl> const OutEdgeInfo edge = out_edge_info [ i ] ; <nl> if ( edge . dst_input = = Graph : : kControlSlot ) { <nl> continue ; <nl> xla : : StatusOr < Node * > ReplaceArgNodesWithRecvAtHostNode ( <nl> <nl> / / Other edges might have ` dst ` as dst node as well . Update those edges <nl> / / with ` dst_replace ` . <nl> - for ( int j = i + 1 ; j < out_edge_info . size ( ) ; j + + ) { <nl> + for ( int j = i + 1 , end = out_edge_info . size ( ) ; j < end ; j + + ) { <nl> if ( out_edge_info [ j ] . dst = = dst ) { <nl> out_edge_info [ j ] . dst = dst_replace ; <nl> } <nl> Status GetRetDataTypes ( const std : : vector < Node * > & ret_nodes , <nl> TF_RETURN_IF_ERROR ( GetNodeAttr ( n - > attrs ( ) , " T " , & dtype ) ) ; <nl> ( * send_from_host_dtypes ) [ index ] = dtype ; <nl> } <nl> - for ( int i = 0 ; i < send_from_host_dtypes - > size ( ) ; i + + ) { <nl> + for ( int i = 0 , end = send_from_host_dtypes - > size ( ) ; i < end ; i + + ) { <nl> if ( ( * send_from_host_dtypes ) [ i ] = = DT_INVALID ) { <nl> return errors : : Internal ( " Cannot get datatype for output " , i ) ; <nl> } <nl> xla : : StatusOr < Node * > BuildSendFromHostNode ( <nl> for ( auto * n : ret_nodes ) { <nl> int index ; <nl> TF_RETURN_IF_ERROR ( GetNodeAttr ( n - > attrs ( ) , " index " , & index ) ) ; <nl> - if ( index < 0 | | index > = send_from_host_dtypes . size ( ) ) { <nl> + const int send_from_host_dtypes_size = send_from_host_dtypes . size ( ) ; <nl> + if ( index < 0 | | index > = send_from_host_dtypes_size ) { <nl> return errors : : Internal ( " Invalid _Retval index : " , index ) ; <nl> } <nl> for ( auto edge : n - > in_edges ( ) ) { <nl> xla : : StatusOr < NodeDef > BuildXlaHostComputeNodeDef ( <nl> if ( e - > IsControlEdge ( ) ) { <nl> continue ; <nl> } <nl> - <nl> - if ( e - > dst_input ( ) < 0 | | e - > dst_input ( ) > = input_dtypes . size ( ) ) { <nl> + <nl> + const int input_dtypes_size = input_dtypes . size ( ) ; <nl> + if ( e - > dst_input ( ) < 0 | | e - > dst_input ( ) > = input_dtypes_size ) { <nl> return errors : : Internal ( " Invalid dst_input : " , e - > dst_input ( ) ) ; <nl> } <nl> inputs [ e - > dst_input ( ) ] = NodeDefBuilder : : NodeOut { <nl> void AddEdgesFromOutsideCompilationNodes ( <nl> const std : : vector < DataType > & data_types , <nl> const std : : vector < Node * > & outside_compilation_nodes , Graph * g , Node * n ) { <nl> / / Add edges from outside compilation nodes to While node . <nl> - for ( int i = original_arg_count ; i < data_types . size ( ) ; i + + ) { <nl> + for ( int i = original_arg_count , end = data_types . size ( ) ; i < end ; i + + ) { <nl> Node * outside_compilation_node = <nl> outside_compilation_nodes [ i - original_arg_count ] ; <nl> g - > AddEdge ( outside_compilation_node , 0 , n , i + arg_to_input_edge_offset ) ; <nl> Status PostprocessLiftedArgsForWhile ( <nl> lifted_arg_nodes_and_outside_compilation_nodes . end ( ) , <nl> std : : back_inserter ( lifted_arg_nodes ) , <nl> [ ] ( const std : : pair < Node * , Node * > & pair ) { return pair . first ; } ) ; <nl> - for ( int i = original_arg_count ; i < data_types . size ( ) ; i + + ) { <nl> + for ( int i = original_arg_count , end = data_types . size ( ) ; i < end ; i + + ) { <nl> TF_ASSIGN_OR_RETURN ( Node * arg_node , <nl> AddOutsideCompilationInputArgToFunctionBody ( <nl> * body_function_body , i , data_types [ i ] ) ) ; <nl> Status PostprocessLiftedArgsForWhile ( <nl> AttrSlice ( & cond_func . attr ( ) ) , fld , <nl> & cond_function_body ) ) ; <nl> <nl> - for ( int i = original_arg_count ; i < data_types . size ( ) ; i + + ) { <nl> + for ( int i = original_arg_count , end = data_types . size ( ) ; i < end ; i + + ) { <nl> xla : : StatusOr < Node * > arg_node_or = <nl> AddOutsideCompilationInputArgToFunctionBody ( * cond_function_body , i , <nl> data_types [ i ] ) ; <nl> Status PostprocessLiftedArgsForIf ( <nl> data_types , outside_compilation_nodes , g , <nl> n ) ; <nl> <nl> - for ( int i = original_arg_count ; i < data_types . size ( ) ; + + i ) { <nl> + for ( int i = original_arg_count , end = data_types . size ( ) ; i < end ; + + i ) { <nl> TF_ASSIGN_OR_RETURN ( Node * then_branch_arg_node , <nl> AddOutsideCompilationInputArgToFunctionBody ( <nl> * then_branch_function_body , i , data_types [ i ] ) ) ; <nl> Status PostprocessLiftedArgsForCall ( <nl> lifted_arg_nodes_and_outside_compilation_nodes . end ( ) , <nl> std : : back_inserter ( lifted_arg_nodes ) , <nl> [ ] ( const std : : pair < Node * , Node * > & pair ) { return pair . first ; } ) ; <nl> - for ( int i = original_arg_count ; i < data_types . size ( ) ; + + i ) { <nl> + for ( int i = original_arg_count , end = data_types . size ( ) ; i < end ; + + i ) { <nl> TF_ASSIGN_OR_RETURN ( <nl> Node * arg_node , <nl> AddOutsideCompilationInputArgToFunctionBody ( * fbody , i , data_types [ i ] ) ) ; <nl> Status PostprocessLiftedArgsForCall ( <nl> / / We need to recreate the node . Otherwise TF will not know n - > num_inputs ( ) <nl> / / has increased . <nl> NodeDef node_def = n - > def ( ) ; <nl> - for ( int i = original_arg_count ; i < data_types . size ( ) ; i + + ) { <nl> + for ( int i = original_arg_count , end = data_types . size ( ) ; i < end ; i + + ) { <nl> Node * outside_compilation_node = <nl> lifted_arg_nodes_and_outside_compilation_nodes [ i - original_arg_count ] <nl> . second ; <nl> TF_ATTRIBUTE_NOINLINE Status ExtractOutsideCompilationForFuncCallNode ( <nl> if ( e - > IsControlEdge ( ) ) { <nl> continue ; <nl> } <nl> - <nl> - TF_RET_CHECK ( e - > dst_input ( ) > = 0 & & e - > dst_input ( ) < inputs . size ( ) ) ; <nl> + <nl> + const int input_size_check = e - > dst_input ( ) < inputs . size ( ) ; <nl> + TF_RET_CHECK ( e - > dst_input ( ) > = 0 & & input_size_check ) ; <nl> inputs [ e - > dst_input ( ) ] = <nl> NodeDefBuilder : : NodeOut { e - > src ( ) - > name ( ) , e - > src_output ( ) , <nl> e - > src ( ) - > output_type ( e - > src_output ( ) ) } ; <nl> mmm a / tensorflow / compiler / jit / graphcycles / graphcycles . cc <nl> ppp b / tensorflow / compiler / jit / graphcycles / graphcycles . cc <nl> string GraphCycles : : DebugString ( ) const { <nl> } <nl> <nl> string result = " digraph { \ n " ; <nl> - for ( int i = 0 ; i < rep_ - > nodes_ . size ( ) ; i + + ) { <nl> + for ( int i = 0 , end = rep_ - > nodes_ . size ( ) ; i < end ; i + + ) { <nl> if ( free_nodes_set . contains ( i ) ) { <nl> continue ; <nl> } <nl> mmm a / tensorflow / compiler / jit / increase_dynamism_for_auto_jit_pass . cc <nl> ppp b / tensorflow / compiler / jit / increase_dynamism_for_auto_jit_pass . cc <nl> Status ComputeSliceSize ( const Scope & host_scope , <nl> ConstantCache constant_pool ( host_scope , control_deps ) ; <nl> <nl> std : : vector < Output > slice_size ; <nl> - for ( int i = 0 ; i < slice_inputs . size_as_vector . size ( ) ; i + + ) { <nl> + for ( int i = 0 , end = slice_inputs . size_as_vector . size ( ) ; i < end ; i + + ) { <nl> if ( slice_inputs . size_as_vector [ i ] > = 0 ) { <nl> slice_size . push_back ( <nl> constant_pool . Get1DHostConstant ( slice_inputs . size_as_vector [ i ] ) ) ; <nl> mmm a / tensorflow / compiler / jit / shape_inference . cc <nl> ppp b / tensorflow / compiler / jit / shape_inference . cc <nl> Status ShapeHandleToTensorShape ( shape_inference : : InferenceContext * context , <nl> if ( ! context - > RankKnown ( handle ) ) return Status : : OK ( ) ; <nl> <nl> std : : vector < int64 > dims ( context - > Rank ( handle ) ) ; <nl> - for ( int32 i = 0 ; i < dims . size ( ) ; + + i ) { <nl> + for ( int32 i = 0 , end = dims . size ( ) ; i < end ; + + i ) { <nl> dims [ i ] = context - > Value ( context - > Dim ( handle , i ) ) ; <nl> } <nl> return PartialTensorShape : : MakePartialShape ( dims . data ( ) , dims . size ( ) , shape ) ; <nl> mmm a / tensorflow / compiler / jit / xla_cluster_util . cc <nl> ppp b / tensorflow / compiler / jit / xla_cluster_util . cc <nl> Status GetNodesRelatedToRefVariablesInDirection ( <nl> / * stable_comparator = * / NodeComparatorName ( ) ) ; <nl> } <nl> <nl> - int old_result_size ; <nl> + size_t old_result_size ; <nl> int iterations = 0 ; <nl> <nl> const int kMaxIterations = 10 * 1000 ; <nl> mmm a / tensorflow / compiler / jit / xla_compilation_cache . cc <nl> ppp b / tensorflow / compiler / jit / xla_compilation_cache . cc <nl> bool XlaCompilationCache : : Signature : : operator = = ( const Signature & other ) const { <nl> if ( arg_shapes ! = other . arg_shapes ) return false ; <nl> <nl> if ( arg_values . size ( ) ! = other . arg_values . size ( ) ) return false ; <nl> - for ( int i = 0 ; i < arg_values . size ( ) ; + + i ) { <nl> + for ( int i = 0 , end = arg_values . size ( ) ; i < end ; + + i ) { <nl> if ( arg_values [ i ] . dtype ( ) ! = other . arg_values [ i ] . dtype ( ) | | <nl> arg_values [ i ] . shape ( ) ! = other . arg_values [ i ] . shape ( ) | | <nl> arg_values [ i ] . tensor_data ( ) ! = other . arg_values [ i ] . tensor_data ( ) ) { <nl> Status XlaCompilationCache : : BuildExecutable ( <nl> <nl> std : : vector < const xla : : Shape * > argument_layouts ( <nl> result . xla_input_shapes . size ( ) ) ; <nl> - for ( int i = 0 ; i < result . xla_input_shapes . size ( ) ; + + i ) { <nl> + for ( int i = 0 , end = result . xla_input_shapes . size ( ) ; i < end ; + + i ) { <nl> argument_layouts [ i ] = & result . xla_input_shapes [ i ] ; <nl> } <nl> xla : : ExecutableBuildOptions build_options ; <nl> static xla : : StatusOr < std : : unique_ptr < Graph > > CreateGraph ( <nl> <nl> / / Create dummy _Arg nodes . Link these to ` node ` and also via a control <nl> / / dependency edge to the _SOURCE node . <nl> - for ( int64 i = 0 ; i < args . size ( ) ; + + i ) { <nl> + for ( int64 i = 0 , end = args . size ( ) ; i < end ; + + i ) { <nl> Node * node ; <nl> string arg_name = absl : : StrCat ( " _arg " , i ) ; <nl> Status status = <nl> static xla : : StatusOr < std : : unique_ptr < Graph > > CreateGraph ( <nl> } <nl> <nl> / / Similarly with return values , create dummy _Retval nodes fed by ` node ` . <nl> - for ( int64 i = 0 ; i < result_types . size ( ) ; + + i ) { <nl> + for ( int64 i = 0 , end = result_types . size ( ) ; i < end ; + + i ) { <nl> Node * node ; <nl> string retval_name = absl : : StrCat ( " _retval " , i ) ; <nl> Status status = NodeBuilder ( retval_name , FunctionLibraryDefinition : : kRetOp ) <nl> Status XlaCompilationCache : : CompileSingleOp ( <nl> auto compile_op = [ & ] ( XlaCompiler * compiler , <nl> XlaCompiler : : CompilationResult * result ) { <nl> std : : vector < DataType > result_dtypes ( ctx - > num_outputs ( ) ) ; <nl> - for ( int i = 0 ; i < result_dtypes . size ( ) ; + + i ) { <nl> + for ( int i = 0 , end = result_dtypes . size ( ) ; i < end ; + + i ) { <nl> result_dtypes [ i ] = ctx - > expected_output_dtype ( i ) ; <nl> } <nl> <nl> Status XlaCompilationCache : : CompileImpl ( <nl> <nl> if ( VLOG_IS_ON ( 2 ) ) { <nl> VLOG ( 2 ) < < " num_inputs = " < < args . size ( ) ; <nl> - for ( int i = 0 ; i < args . size ( ) ; i + + ) { <nl> + for ( int i = 0 , end = args . size ( ) ; i < end ; i + + ) { <nl> VLOG ( 3 ) < < i < < " : " < < args [ i ] . HumanString ( ) ; <nl> } <nl> } <nl> mmm a / tensorflow / compiler / jit / xla_launch_util . cc <nl> ppp b / tensorflow / compiler / jit / xla_launch_util . cc <nl> Status SnapshotResourceVariables ( OpKernelContext * ctx , <nl> absl : : Span < const int > variable_indices , <nl> absl : : Span < VariableInfo const > variable_infos , <nl> ResourceVarsSnapshot * result ) { <nl> - for ( int i = 0 ; i < variable_indices . size ( ) ; i + + ) { <nl> + for ( int i = 0 , end = variable_indices . size ( ) ; i < end ; i + + ) { <nl> Var * var = variable_infos [ i ] . var ( ) ; <nl> ( * result ) [ variable_indices [ i ] ] = <nl> var ? absl : : make_optional ( * var - > tensor ( ) ) : absl : : nullopt ; <nl> XlaComputationLaunchContext : : PopulateInputs ( <nl> <nl> xla : : TransferManager * transfer_manager = <nl> client_ - > backend ( ) . transfer_manager ( ) ; <nl> - for ( int i = 0 ; i < compilation_result - > xla_input_shapes . size ( ) ; + + i ) { <nl> + for ( int i = 0 , end = compilation_result - > xla_input_shapes . size ( ) ; i < end ; + + i ) { <nl> int arg_num = compilation_result - > input_mapping [ i ] ; <nl> CHECK_GE ( arg_num , missing_ctx_input_prefix ) ; <nl> const xla : : Shape & shape = compilation_result - > xla_input_shapes [ i ] ; <nl> Status XlaComputationLaunchContext : : PopulateOutputs ( <nl> <nl> / / Copy XLA results to the OpOutputList . <nl> int output_num = 0 ; <nl> - for ( int i = 0 ; i < ctx - > num_outputs ( ) ; + + i ) { <nl> + for ( int i = 0 , end = ctx - > num_outputs ( ) ; i < end ; + + i ) { <nl> const TensorShape & shape = output_tensor_shapes [ i ] ; <nl> const DataType & type = compilation_result - > outputs [ i ] . type ; <nl> VLOG ( 2 ) < < " Populating output for retval " < < i < < " shape " <nl> Status XlaComputationLaunchContext : : PopulateOutputs ( <nl> } <nl> <nl> / / Apply variable updates , if any . <nl> - for ( int i = 0 ; i < compilation_result - > resource_updates . size ( ) ; + + i ) { <nl> + for ( int i = 0 , end = compilation_result - > resource_updates . size ( ) ; i < end ; + + i ) { <nl> const XlaCompiler : : ResourceUpdate & write = <nl> compilation_result - > resource_updates [ i ] ; <nl> int actual_input_index = write . input_index - missing_ctx_input_prefix ; <nl>
|
c , compiler , jit resolutions
|
tensorflow/tensorflow
|
cb3cf00aade8e747783b57debe324d6bc00b77b3
|
2020-07-26T20:42:00Z
|
mmm a / tensorflow / python / ops / ragged / BUILD <nl> ppp b / tensorflow / python / ops / ragged / BUILD <nl> py_test ( <nl> size = " medium " , <nl> srcs = [ " ragged_tensor_test . py " ] , <nl> srcs_version = " PY2AND3 " , <nl> + tags = [ <nl> + " no_windows " , <nl> + ] , <nl> deps = [ <nl> " : ragged " , <nl> " / / tensorflow / python : array_ops " , <nl> py_test ( <nl> name = " ragged_to_sparse_op_test " , <nl> srcs = [ " ragged_to_sparse_op_test . py " ] , <nl> srcs_version = " PY2AND3 " , <nl> + tags = [ <nl> + " no_windows " , <nl> + ] , <nl> deps = [ <nl> " : ragged " , <nl> " / / tensorflow / python : array_ops " , <nl> py_test ( <nl> name = " ragged_constant_value_op_test " , <nl> srcs = [ " ragged_constant_value_op_test . py " ] , <nl> srcs_version = " PY2AND3 " , <nl> + tags = [ <nl> + " no_windows " , <nl> + ] , <nl> deps = [ <nl> " : ragged " , <nl> " / / tensorflow / python : framework_test_lib " , <nl>
|
Disable broken ragged_tensor tests on windows
|
tensorflow/tensorflow
|
f3c0d1a9d7d711d78e235e4da3038f5eb4f5a7f4
|
2018-11-15T22:14:22Z
|
mmm a / caffe2 / serialize / inline_container . cc <nl> ppp b / caffe2 / serialize / inline_container . cc <nl> void PyTorchStreamReader : : init ( ) { <nl> " . Your PyTorch installation may be too old . " ) ; <nl> } <nl> <nl> - void PyTorchStreamReader : : valid ( const char * what ) { <nl> + void PyTorchStreamReader : : valid ( const char * what , const char * info ) { <nl> auto err = mz_zip_get_last_error ( ar_ . get ( ) ) ; <nl> if ( err ! = MZ_ZIP_NO_ERROR ) { <nl> - CAFFE_THROW ( " PytorchStreamReader failed " , what , " : " , mz_zip_get_error_string ( err ) ) ; <nl> + CAFFE_THROW ( <nl> + " PytorchStreamReader failed " , <nl> + what , <nl> + info , <nl> + " : " , <nl> + mz_zip_get_error_string ( err ) ) ; <nl> } <nl> } <nl> <nl> bool PyTorchStreamReader : : hasRecord ( const std : : string & name ) { <nl> if ( ! result ) { <nl> ar_ - > m_last_error = MZ_ZIP_NO_ERROR ; <nl> } <nl> - valid ( " attempting to locate file " ) ; <nl> + valid ( " attempting to locate file " , name . c_str ( ) ) ; <nl> return result ; <nl> } <nl> <nl> size_t PyTorchStreamReader : : getRecordID ( const std : : string & name ) { <nl> if ( ar_ - > m_last_error = = MZ_ZIP_FILE_NOT_FOUND ) { <nl> CAFFE_THROW ( " file not found : " , ss . str ( ) ) ; <nl> } <nl> - valid ( " locating file " ) ; <nl> + valid ( " locating file " , name . c_str ( ) ) ; <nl> return result ; <nl> } <nl> <nl> std : : tuple < at : : DataPtr , size_t > PyTorchStreamReader : : getRecord ( const std : : string <nl> size_t key = getRecordID ( name ) ; <nl> mz_zip_archive_file_stat stat ; <nl> mz_zip_reader_file_stat ( ar_ . get ( ) , key , & stat ) ; <nl> - valid ( " retrieving file meta - data " ) ; <nl> + valid ( " retrieving file meta - data for " , name . c_str ( ) ) ; <nl> void * ptr = malloc ( stat . m_uncomp_size ) ; <nl> mz_zip_reader_extract_to_mem ( ar_ . get ( ) , key , ptr , stat . m_uncomp_size , 0 ) ; <nl> - valid ( " reading file " ) ; <nl> + valid ( " reading file " , name . c_str ( ) ) ; <nl> <nl> at : : DataPtr retval ( ptr , ptr , free , at : : kCPU ) ; <nl> return std : : make_tuple ( std : : move ( retval ) , stat . m_uncomp_size ) ; <nl> static int64_t read_le_16 ( uint8_t * buf ) { <nl> size_t PyTorchStreamReader : : getRecordOffset ( const std : : string & name ) { <nl> mz_zip_archive_file_stat stat ; <nl> mz_zip_reader_file_stat ( ar_ . get ( ) , getRecordID ( name ) , & stat ) ; <nl> - valid ( " retriving file meta - data " ) ; <nl> + valid ( " retrieving file meta - data for " , name . c_str ( ) ) ; <nl> uint8_t local_header [ MZ_ZIP_LOCAL_DIR_HEADER_SIZE ] ; <nl> in_ - > read ( <nl> stat . m_local_header_ofs , <nl> size_t PyTorchStreamReader : : getRecordOffset ( const std : : string & name ) { <nl> <nl> PyTorchStreamReader : : ~ PyTorchStreamReader ( ) { <nl> mz_zip_reader_end ( ar_ . get ( ) ) ; <nl> - valid ( " closing reader " ) ; <nl> + valid ( " closing reader for archive " , archive_name_ . c_str ( ) ) ; <nl> } <nl> <nl> size_t ostream_write_func ( void * pOpaque , mz_uint64 file_ofs , const void * pBuf , size_t n ) { <nl> PyTorchStreamWriter : : PyTorchStreamWriter ( <nl> if ( ! out_ ) { <nl> file_stream_ . open ( file_name , std : : ofstream : : out | std : : ofstream : : trunc | std : : ofstream : : binary ) ; <nl> out_ = & file_stream_ ; <nl> - valid ( " opening archive " ) ; <nl> + valid ( " opening archive " , file_name . c_str ( ) ) ; <nl> } <nl> <nl> ar_ - > m_pIO_opaque = this ; <nl> ar_ - > m_pWrite = ostream_write_func ; <nl> <nl> mz_zip_writer_init_v2 ( ar_ . get ( ) , 0 , MZ_ZIP_FLAG_WRITE_ZIP64 ) ; <nl> - valid ( " initializing archive " ) ; <nl> + valid ( " initializing archive " , file_name . c_str ( ) ) ; <nl> <nl> std : : stringstream version ; <nl> version < < kMaxSupportedFileFormatVersion < < " \ n " ; <nl> void PyTorchStreamWriter : : writeRecord ( const std : : string & name , const void * data , <nl> padding . size ( ) , <nl> nullptr , <nl> 0 ) ; <nl> - valid ( " writing file " ) ; <nl> + valid ( " writing file " , name . c_str ( ) ) ; <nl> } <nl> <nl> void PyTorchStreamWriter : : writeEndOfFile ( ) { <nl> void PyTorchStreamWriter : : writeEndOfFile ( ) { <nl> finalized_ = true ; <nl> mz_zip_writer_finalize_archive ( ar_ . get ( ) ) ; <nl> mz_zip_writer_end ( ar_ . get ( ) ) ; <nl> - valid ( " writing central directory " ) ; <nl> + valid ( " writing central directory for archive " , archive_name_ . c_str ( ) ) ; <nl> if ( file_stream_ . is_open ( ) ) <nl> file_stream_ . close ( ) ; <nl> } <nl> <nl> - <nl> - void PyTorchStreamWriter : : valid ( const char * what ) { <nl> + void PyTorchStreamWriter : : valid ( const char * what , const char * info ) { <nl> auto err = mz_zip_get_last_error ( ar_ . get ( ) ) ; <nl> if ( err ! = MZ_ZIP_NO_ERROR ) { <nl> - CAFFE_THROW ( " PytorchStreamWriter failed " , what , " : " , mz_zip_get_error_string ( err ) ) ; <nl> + CAFFE_THROW ( <nl> + " PytorchStreamWriter failed " , <nl> + what , <nl> + info , <nl> + " : " , <nl> + mz_zip_get_error_string ( err ) ) ; <nl> } <nl> if ( ! * out_ ) { <nl> - CAFFE_THROW ( " PytorchStreamWriter failed " , what , " . " ) ; <nl> + CAFFE_THROW ( " PytorchStreamWriter failed " , what , info , " . " ) ; <nl> } <nl> } <nl> <nl> mmm a / caffe2 / serialize / inline_container . h <nl> ppp b / caffe2 / serialize / inline_container . h <nl> class CAFFE2_API PyTorchStreamReader final { <nl> private : <nl> void init ( ) ; <nl> size_t read ( uint64_t pos , char * buf , size_t n ) ; <nl> - void valid ( const char * what ) ; <nl> + void valid ( const char * what , const char * info = " " ) ; <nl> size_t getRecordID ( const std : : string & name ) ; <nl> <nl> friend size_t <nl> class CAFFE2_API PyTorchStreamWriter final { <nl> ~ PyTorchStreamWriter ( ) ; <nl> <nl> private : <nl> - void valid ( const char * what ) ; <nl> - size_t current_pos_ = 0 ; <nl> - std : : unique_ptr < mz_zip_archive > ar_ ; <nl> - std : : string archive_name_ ; <nl> - std : : ostream * out_ ; <nl> - std : : ofstream file_stream_ ; <nl> - bool finalized_ = false ; <nl> - friend size_t ostream_write_func ( void * pOpaque , uint64_t file_ofs , const void * pBuf , size_t n ) ; <nl> + void valid ( const char * what , const char * info = " " ) ; <nl> + size_t current_pos_ = 0 ; <nl> + std : : unique_ptr < mz_zip_archive > ar_ ; <nl> + std : : string archive_name_ ; <nl> + std : : ostream * out_ ; <nl> + std : : ofstream file_stream_ ; <nl> + bool finalized_ = false ; <nl> + friend size_t ostream_write_func ( <nl> + void * pOpaque , <nl> + uint64_t file_ofs , <nl> + const void * pBuf , <nl> + size_t n ) ; <nl> } ; <nl> <nl> } / / namespace serialize <nl>
|
Add some extra info to PyTorchStreamReader / Writer errors ( )
|
pytorch/pytorch
|
2dff0b6f6a845b1cdd978f81e326d228195d14e9
|
2019-10-02T00:11:36Z
|
mmm a / modules / planning / scenarios / valet_parking / stage_approaching_parking_spot . cc <nl> ppp b / modules / planning / scenarios / valet_parking / stage_approaching_parking_spot . cc <nl> Stage : : StageStatus StageApproachingParkingSpot : : Process ( <nl> bool plan_ok = ExecuteTaskOnReferenceLine ( planning_init_point , frame ) ; <nl> if ( ! plan_ok ) { <nl> AERROR < < " StopSignUnprotectedStagePreStop planning error " ; <nl> + return StageStatus : : ERROR ; <nl> } <nl> GetContext ( ) - > valet_parking_pre_stop_fence_s = <nl> frame - > open_space_info ( ) . open_space_pre_stop_fence_s ( ) ; <nl> mmm a / modules / planning / scenarios / valet_parking / stage_approaching_parking_spot . h <nl> ppp b / modules / planning / scenarios / valet_parking / stage_approaching_parking_spot . h <nl> class StageApproachingParkingSpot : public Stage { <nl> <nl> bool CheckADCStop ( const ReferenceLineInfo & reference_line_info ) ; <nl> <nl> - private : <nl> - Stage : : StageStatus FinishStage ( ) ; <nl> - <nl> private : <nl> ScenarioValetParkingConfig scenario_config_ ; <nl> } ; <nl> mmm a / modules / planning / scenarios / valet_parking / stage_parking . cc <nl> ppp b / modules / planning / scenarios / valet_parking / stage_parking . cc <nl> namespace valet_parking { <nl> <nl> Stage : : StageStatus StageParking : : Process ( <nl> const common : : TrajectoryPoint & planning_init_point , Frame * frame ) { <nl> + / / Open space planning doesn ' t use planning_init_point from upstream because <nl> + / / of different stitching strategy <nl> + bool plan_ok = ExecuteTaskOnOpenSpace ( frame ) ; <nl> + if ( ! plan_ok ) { <nl> + AERROR < < " StageParking planning error " ; <nl> + return StageStatus : : ERROR ; <nl> + } <nl> + return StageStatus : : RUNNING ; <nl> + } <nl> + <nl> + Stage : : StageStatus StageParking : : FinishStage ( ) { <nl> return Stage : : FINISHED ; <nl> } <nl> <nl> mmm a / modules / planning / scenarios / valet_parking / stage_parking . h <nl> ppp b / modules / planning / scenarios / valet_parking / stage_parking . h <nl> namespace planning { <nl> namespace scenario { <nl> namespace valet_parking { <nl> <nl> - DECLARE_STAGE ( StageParking , ValetParkingContext ) ; <nl> + class StageParking : public Stage { <nl> + public : <nl> + explicit StageParking ( <nl> + const ScenarioConfig : : StageConfig & config ) <nl> + : Stage ( config ) { } <nl> + <nl> + private : <nl> + Stage : : StageStatus Process ( const common : : TrajectoryPoint & planning_init_point , <nl> + Frame * frame ) override ; <nl> + <nl> + ValetParkingContext * GetContext ( ) { <nl> + return GetContextAs < ValetParkingContext > ( ) ; <nl> + } <nl> + <nl> + private : <nl> + Stage : : StageStatus FinishStage ( ) ; <nl> + <nl> + private : <nl> + ScenarioValetParkingConfig scenario_config_ ; <nl> + } ; <nl> <nl> } / / namespace valet_parking <nl> } / / namespace scenario <nl>
|
Planning : OpenSpace : Implementation on Stage Parking
|
ApolloAuto/apollo
|
a4ab0c1c087ac8423c4b3a3267e24edfb7e10658
|
2019-03-08T05:27:37Z
|
mmm a / tests / test_browser . py <nl> ppp b / tests / test_browser . py <nl> def test_fetch_stream_file ( self ) : <nl> f . close ( ) <nl> self . btest ( ' fetch / stream_file . cpp ' , expected = ' 1 ' , args = [ ' - - std = c + + 11 ' , ' - s ' , ' FETCH_DEBUG = 1 ' , ' - s ' , ' FETCH = 1 ' , ' - s ' , ' TOTAL_MEMORY = 536870912 ' ] ) <nl> <nl> - # Tests emscripten_fetch ( ) usage in synchronous mode . <nl> + # Tests emscripten_fetch ( ) usage in synchronous mode when used from the main thread proxied to a Worker with - s PROXY_TO_PTHREAD = 1 option . <nl> def test_fetch_sync_xhr ( self ) : <nl> shutil . copyfile ( path_from_root ( ' tests ' , ' gears . png ' ) , os . path . join ( self . get_dir ( ) , ' gears . png ' ) ) <nl> self . btest ( ' fetch / sync_xhr . cpp ' , expected = ' 1 ' , args = [ ' - - std = c + + 11 ' , ' - s ' , ' FETCH_DEBUG = 1 ' , ' - s ' , ' FETCH = 1 ' , ' - s ' , ' USE_PTHREADS = 1 ' , ' - s ' , ' PROXY_TO_PTHREAD = 1 ' ] ) <nl> <nl> + # Tests that the Fetch API works for synchronous XHRs when used with - - proxy - to - worker . <nl> + def test_fetch_sync_xhr_in_proxy_to_worker ( self ) : <nl> + shutil . copyfile ( path_from_root ( ' tests ' , ' gears . png ' ) , os . path . join ( self . get_dir ( ) , ' gears . png ' ) ) <nl> + self . btest ( ' fetch / sync_xhr . cpp ' , expected = ' 1 ' , args = [ ' - - std = c + + 11 ' , ' - s ' , ' FETCH_DEBUG = 1 ' , ' - s ' , ' FETCH = 1 ' , ' - - proxy - to - worker ' ] ) <nl> + <nl> def test_fetch_idb_store ( self ) : <nl> self . btest ( ' fetch / idb_store . cpp ' , expected = ' 0 ' , args = [ ' - s ' , ' USE_PTHREADS = 1 ' , ' - s ' , ' FETCH_DEBUG = 1 ' , ' - s ' , ' FETCH = 1 ' , ' - s ' , ' PROXY_TO_PTHREAD = 1 ' ] ) <nl> <nl>
|
Add new test test_fetch_sync_xhr_in_proxy_to_worker to check that sync Fetches work with - - proxy - to - worker . ( )
|
emscripten-core/emscripten
|
298bb620ea783123374d17c4f9486d85d1301c06
|
2018-03-08T18:28:02Z
|
mmm a / dlib / CMakeLists . txt <nl> ppp b / dlib / CMakeLists . txt <nl> if ( NOT TARGET dlib ) <nl> endif ( ) <nl> <nl> # Find where cuSOLVER is since the FindCUDA cmake package doesn ' t <nl> - # bother to look for it . <nl> - get_filename_component ( cuda_blas_path " $ { CUDA_CUBLAS_LIBRARIES } " DIRECTORY ) <nl> - find_library ( cusolver cusolver HINTS $ { cuda_blas_path } ) <nl> - mark_as_advanced ( cusolver ) <nl> + # bother to look for it in older versions of cmake . <nl> + if ( NOT CUDA_cusolver_LIBRARY ) <nl> + get_filename_component ( cuda_blas_path " $ { CUDA_CUBLAS_LIBRARIES } " DIRECTORY ) <nl> + find_library ( CUDA_cusolver_LIBRARY cusolver HINTS $ { cuda_blas_path } ) <nl> + mark_as_advanced ( CUDA_cusolver_LIBRARY ) <nl> + endif ( ) <nl> # Also find OpenMP since cuSOLVER needs it . Importantly , we only <nl> # look for one to link to if our use of BLAS , specifically the <nl> # Intel MKL , hasn ' t already decided what to use . This is because <nl> if ( NOT TARGET dlib ) <nl> $ { CUDA_CUBLAS_LIBRARIES } <nl> $ { cudnn } <nl> $ { CUDA_curand_LIBRARY } <nl> - $ { cusolver } <nl> + $ { CUDA_cusolver_LIBRARY } <nl> ) <nl> if ( openmp_libraries ) <nl> list ( APPEND dlib_needed_libraries $ { openmp_libraries } ) <nl>
|
Made cusolver finding work in newer versions of cmake and cuda
|
davisking/dlib
|
70f9a9f11fb2ae82a057e5f4b3bae9238087e418
|
2019-03-02T14:45:08Z
|
mmm a / . travis . yml <nl> ppp b / . travis . yml <nl> branches : <nl> notifications : <nl> irc : " chat . freenode . net # arangodb " <nl> template : <nl> - - % { build_number } ( % { branch } - % { commit } : % { author } ) : % { message } " <nl> + - " % { build_number } ( % { branch } - % { commit } : % { author } ) : % { message } " <nl> # commit_message : commit message of build <nl>
|
fix syntax
|
arangodb/arangodb
|
8e469ad9bdc6a3f851ce9096c7420236f9761bd7
|
2014-10-16T08:19:07Z
|
deleted file mode 100644 <nl> index 549d8627223 . . 00000000000 <nl> mmm a / Examples / Text / ATIS / data / trash / query . wl <nl> ppp / dev / null <nl> <nl> - ' d <nl> - ' hare <nl> - ' ll <nl> - ' m <nl> - ' re <nl> - ' s <nl> - ' t <nl> - ' ve <nl> - 0900 <nl> - 1 <nl> - 10 <nl> - 100 <nl> - 1000 <nl> - 1017 <nl> - 1020 <nl> - 1024 <nl> - 1026 <nl> - 1030 <nl> - 1039 <nl> - 1045 <nl> - 1055 <nl> - 1059 <nl> - 106 <nl> - 1083 <nl> - 11 <nl> - 110 <nl> - 1100 <nl> - 1110 <nl> - 1115 <nl> - 1130 <nl> - 1133 <nl> - 1145 <nl> - 1158 <nl> - 12 <nl> - 1200 <nl> - 1201 <nl> - 1205 <nl> - 1207 <nl> - 1209 <nl> - 1220 <nl> - 1222 <nl> - 1230 <nl> - 124 <nl> - 1245 <nl> - 1288 <nl> - 1291 <nl> - 130 <nl> - 1300 <nl> - 137338 <nl> - 139 <nl> - 150 <nl> - 1500 <nl> - 1505 <nl> - 1600 <nl> - 163 <nl> - 1700 <nl> - 1765 <nl> - 1800 <nl> - 1850 <nl> - 19 <nl> - 1940 <nl> - 1991 <nl> - 1992 <nl> - 1993 <nl> - 1994 <nl> - 2 <nl> - 20 <nl> - 200 <nl> - 201 <nl> - 21 <nl> - 210 <nl> - 2100 <nl> - 212 <nl> - 2134 <nl> - 2153 <nl> - 217 <nl> - 225 <nl> - 229 <nl> - 230 <nl> - 257 <nl> - 269 <nl> - 270 <nl> - 271 <nl> - 279 <nl> - 281 <nl> - 296 <nl> - 297 <nl> - 3 <nl> - 300 <nl> - 305 <nl> - 311 <nl> - 315 <nl> - 320 <nl> - 323 <nl> - 324 <nl> - 329 <nl> - 3357 <nl> - 343 <nl> - 345 <nl> - 352 <nl> - 3724 <nl> - 382 <nl> - 4 <nl> - 400 <nl> - 402 <nl> - 405 <nl> - 415 <nl> - 416 <nl> - 417 <nl> - 419 <nl> - 420 <nl> - 428 <nl> - 43 <nl> - 430 <nl> - 4400 <nl> - 445 <nl> - 459 <nl> - 466 <nl> - 468 <nl> - 486 <nl> - 497766 <nl> - 5 <nl> - 500 <nl> - 505 <nl> - 515 <nl> - 530 <nl> - 539 <nl> - 55 <nl> - 555 <nl> - 57 <nl> - 6 <nl> - 608 <nl> - 615 <nl> - 630 <nl> - 639 <nl> - 645 <nl> - 650 <nl> - 665 <nl> - 673 <nl> - 7 <nl> - 705 <nl> - 71 <nl> - 718 <nl> - 720 <nl> - 723 <nl> - 727 <nl> - 72s <nl> - 730 <nl> - 733 <nl> - 734 <nl> - 737 <nl> - 73s <nl> - 746 <nl> - 747 <nl> - 755 <nl> - 757 <nl> - 767 <nl> - 771 <nl> - 8 <nl> - 80 <nl> - 810 <nl> - 811 <nl> - 813 <nl> - 815 <nl> - 819 <nl> - 82 <nl> - 823 <nl> - 825 <nl> - 838 <nl> - 842 <nl> - 845 <nl> - 852 <nl> - 9 <nl> - 928 <nl> - 932 <nl> - 934 <nl> - 950 <nl> - 98 <nl> - BOS <nl> - EOS <nl> - a <nl> - aa <nl> - abbreviation <nl> - abbreviations <nl> - able <nl> - about <nl> - ac <nl> - across <nl> - actually <nl> - advertises <nl> - after <nl> - afternoon <nl> - afternoons <nl> - afterwards <nl> - again <nl> - air <nl> - aircraft <nl> - airfare <nl> - airfares <nl> - airline <nl> - airlines <nl> - airplane <nl> - airplanes <nl> - airport <nl> - airports <nl> - al <nl> - alaska <nl> - all <nl> - along <nl> - also <nl> - am <nl> - america <nl> - american <nl> - amount <nl> - an <nl> - and <nl> - angeles <nl> - another <nl> - any <nl> - anything <nl> - anywhere <nl> - ap <nl> - ap57 <nl> - ap58 <nl> - ap68 <nl> - ap80 <nl> - approximately <nl> - april <nl> - are <nl> - area <nl> - arizona <nl> - around <nl> - arrange <nl> - arrangements <nl> - arrival <nl> - arrivals <nl> - arrive <nl> - arrives <nl> - arriving <nl> - as <nl> - at <nl> - atl <nl> - atlanta <nl> - august <nl> - available <nl> - b <nl> - back <nl> - baltimore <nl> - basis <nl> - bay <nl> - be <nl> - be1 <nl> - beach <nl> - before <nl> - beginning <nl> - begins <nl> - being <nl> - belong <nl> - besides <nl> - between <nl> - bh <nl> - bn <nl> - bna <nl> - boeing <nl> - book <nl> - booking <nl> - boston <nl> - both <nl> - bound <nl> - breakfast <nl> - bring <nl> - bur <nl> - burbank <nl> - business <nl> - but <nl> - buy <nl> - bwi <nl> - by <nl> - c <nl> - california <nl> - called <nl> - calling <nl> - can <nl> - canada <nl> - canadian <nl> - capacities <nl> - capacity <nl> - car <nl> - carolina <nl> - carried <nl> - carries <nl> - cars <nl> - catch <nl> - charges <nl> - charlotte <nl> - cheap <nl> - cheapest <nl> - chicago <nl> - choices <nl> - cincinnati <nl> - cities <nl> - city <nl> - class <nl> - classes <nl> - cleveland <nl> - close <nl> - closest <nl> - co <nl> - coach <nl> - code <nl> - codes <nl> - colorado <nl> - columbus <nl> - combination <nl> - come <nl> - comes <nl> - coming <nl> - companies <nl> - concerning <nl> - connect <nl> - connecting <nl> - connection <nl> - connections <nl> - connects <nl> - continent <nl> - continental <nl> - continuing <nl> - cost <nl> - costs <nl> - could <nl> - county <nl> - cover <nl> - cp <nl> - currently <nl> - cvg <nl> - d <nl> - d10 <nl> - d9s <nl> - daily <nl> - dallas <nl> - database <nl> - date <nl> - day <nl> - days <nl> - dc <nl> - dc10 <nl> - dc9 <nl> - dca <nl> - december <nl> - define <nl> - delta <nl> - denver <nl> - depart <nl> - departing <nl> - departs <nl> - departure <nl> - departures <nl> - describe <nl> - designate <nl> - destination <nl> - determine <nl> - detroit <nl> - dfw <nl> - dh8 <nl> - diego <nl> - difference <nl> - different <nl> - dinner <nl> - dinnertime <nl> - direct <nl> - directly <nl> - discount <nl> - display <nl> - distance <nl> - dl <nl> - do <nl> - does <nl> - doesn <nl> - dollars <nl> - don <nl> - downtown <nl> - dtw <nl> - dulles <nl> - during <nl> - ea <nl> - each <nl> - earlier <nl> - earliest <nl> - early <nl> - eastern <nl> - economic <nl> - economy <nl> - eight <nl> - eighteenth <nl> - eighth <nl> - either <nl> - eleven <nl> - eleventh <nl> - else <nl> - enroute <nl> - equal <nl> - equipment <nl> - evening <nl> - ever <nl> - everywhere <nl> - ewr <nl> - exceeding <nl> - expensive <nl> - explain <nl> - express <nl> - eye <nl> - f <nl> - f28 <nl> - far <nl> - fare <nl> - fares <nl> - february <nl> - ff <nl> - field <nl> - fifteen <nl> - fifteenth <nl> - fifth <nl> - final <nl> - find <nl> - fine <nl> - first <nl> - fit <nl> - flies <nl> - flight <nl> - flights <nl> - florida <nl> - fly <nl> - flying <nl> - fn <nl> - following <nl> - for <nl> - fort <nl> - four <nl> - fourteenth <nl> - fourth <nl> - francisco <nl> - friday <nl> - fridays <nl> - friends <nl> - from <nl> - general <nl> - georgia <nl> - get <nl> - gets <nl> - give <nl> - go <nl> - goes <nl> - going <nl> - good <nl> - got <nl> - great <nl> - greatest <nl> - ground <nl> - grounds <nl> - guardia <nl> - h <nl> - hartfield <nl> - has <nl> - have <nl> - having <nl> - heading <nl> - hello <nl> - help <nl> - here <nl> - hi <nl> - highest <nl> - hold <nl> - home <nl> - hopefully <nl> - hou <nl> - hours <nl> - houston <nl> - how <nl> - hp <nl> - i <nl> - iah <nl> - if <nl> - in <nl> - include <nl> - included <nl> - includes <nl> - including <nl> - india <nl> - indiana <nl> - indianapolis <nl> - inexpensive <nl> - inform <nl> - information <nl> - instead <nl> - intercontinental <nl> - interested <nl> - international <nl> - into <nl> - is <nl> - it <nl> - itinerary <nl> - j31 <nl> - january <nl> - jersey <nl> - jet <nl> - jfk <nl> - jose <nl> - july <nl> - june <nl> - just <nl> - k <nl> - kansas <nl> - kennedy <nl> - kind <nl> - kindly <nl> - kinds <nl> - know <nl> - kw <nl> - l10 <nl> - l1011 <nl> - la <nl> - lake <nl> - land <nl> - landing <nl> - landings <nl> - lands <nl> - largest <nl> - las <nl> - last <nl> - lastest <nl> - late <nl> - later <nl> - latest <nl> - lax <nl> - laying <nl> - layover <nl> - least <nl> - leave <nl> - leaves <nl> - leaving <nl> - less <nl> - lester <nl> - let <nl> - level <nl> - lga <nl> - like <nl> - limo <nl> - limousine <nl> - limousines <nl> - list <nl> - listed <nl> - listing <nl> - listings <nl> - live <nl> - lives <nl> - local <nl> - locate <nl> - located <nl> - logan <nl> - long <nl> - longest <nl> - look <nl> - looking <nl> - los <nl> - louis <nl> - love <nl> - lowest <nl> - ls <nl> - lufthansa <nl> - lunch <nl> - m <nl> - m80 <nl> - make <nl> - makes <nl> - making <nl> - many <nl> - march <nl> - maximum <nl> - may <nl> - mci <nl> - mco <nl> - me <nl> - meal <nl> - meals <nl> - mealtime <nl> - mean <nl> - meaning <nl> - memphis <nl> - mia <nl> - miami <nl> - michigan <nl> - midnight <nl> - midway <nl> - midwest <nl> - miles <nl> - milwaukee <nl> - minimum <nl> - minneapolis <nl> - minnesota <nl> - missouri <nl> - mitchell <nl> - monday <nl> - mondays <nl> - month <nl> - montreal <nl> - more <nl> - morning <nl> - mornings <nl> - most <nl> - much <nl> - must <nl> - my <nl> - name <nl> - names <nl> - nashville <nl> - nationair <nl> - near <nl> - need <nl> - nevada <nl> - new <nl> - newark <nl> - next <nl> - night <nl> - nights <nl> - nighttime <nl> - nineteenth <nl> - ninth <nl> - no <nl> - non <nl> - nonstop <nl> - nonstops <nl> - noon <nl> - noontime <nl> - north <nl> - northwest <nl> - not <nl> - november <nl> - now <nl> - number <nl> - numbers <nl> - nw <nl> - o <nl> - o ' clock <nl> - oak <nl> - oakland <nl> - october <nl> - of <nl> - off <nl> - offer <nl> - offered <nl> - offers <nl> - oh <nl> - ohio <nl> - okay <nl> - on <nl> - once <nl> - one <nl> - only <nl> - ontario <nl> - operating <nl> - operation <nl> - options <nl> - or <nl> - ord <nl> - order <nl> - originate <nl> - originating <nl> - orlando <nl> - other <nl> - out <nl> - over <nl> - overnight <nl> - passengers <nl> - paul <nl> - pearson <nl> - pennsylvania <nl> - people <nl> - petersburg <nl> - philadelphia <nl> - philly <nl> - phl <nl> - phoenix <nl> - pittsburgh <nl> - place <nl> - plan <nl> - plane <nl> - planes <nl> - planning <nl> - please <nl> - pm <nl> - possible <nl> - prefer <nl> - preferably <nl> - price <nl> - priced <nl> - prices <nl> - prior <nl> - proper <nl> - provide <nl> - provided <nl> - provides <nl> - put <nl> - q <nl> - qo <nl> - qualify <nl> - quebec <nl> - question <nl> - qw <nl> - qx <nl> - rate <nl> - rates <nl> - reaches <nl> - reaching <nl> - red <nl> - regarding <nl> - rent <nl> - rental <nl> - rentals <nl> - repeat <nl> - repeating <nl> - represented <nl> - requesting <nl> - reservation <nl> - reservations <nl> - restriction <nl> - restrictions <nl> - return <nl> - returning <nl> - reverse <nl> - right <nl> - round <nl> - route <nl> - run <nl> - runs <nl> - s <nl> - sa <nl> - salt <nl> - sam <nl> - same <nl> - san <nl> - saturday <nl> - saturdays <nl> - say <nl> - sb <nl> - scenario <nl> - schedule <nl> - scheduled <nl> - schedules <nl> - sd <nl> - seat <nl> - seating <nl> - seats <nl> - seattle <nl> - second <nl> - see <nl> - september <nl> - serve <nl> - served <nl> - serves <nl> - service <nl> - serviced <nl> - services <nl> - serving <nl> - seven <nl> - seventeen <nl> - seventeenth <nl> - seventh <nl> - sfo <nl> - shortest <nl> - should <nl> - show <nl> - single <nl> - six <nl> - sixteen <nl> - sixteenth <nl> - sixth <nl> - smallest <nl> - snack <nl> - snacks <nl> - so <nl> - some <nl> - somebody <nl> - sometime <nl> - soon <nl> - sorry <nl> - sort <nl> - sounds <nl> - southwest <nl> - spend <nl> - st . <nl> - stand <nl> - stands <nl> - stapleton <nl> - start <nl> - starting <nl> - staying <nl> - still <nl> - stop <nl> - stopover <nl> - stopovers <nl> - stopping <nl> - stops <nl> - straight <nl> - such <nl> - summer <nl> - sunday <nl> - sundays <nl> - supper <nl> - sure <nl> - symbols <nl> - tacoma <nl> - take <nl> - takeoff <nl> - takeoffs <nl> - takes <nl> - taking <nl> - tampa <nl> - taxi <nl> - tell <nl> - ten <nl> - tennessee <nl> - tenth <nl> - texas <nl> - than <nl> - thank <nl> - thanks <nl> - that <nl> - the <nl> - their <nl> - them <nl> - then <nl> - there <nl> - thereafter <nl> - these <nl> - they <nl> - thing <nl> - third <nl> - thirteenth <nl> - thirtieth <nl> - thirty <nl> - this <nl> - those <nl> - three <nl> - thrift <nl> - through <nl> - thursday <nl> - thursdays <nl> - ticket <nl> - tickets <nl> - time <nl> - times <nl> - to <nl> - today <nl> - tomorrow <nl> - tonight <nl> - too <nl> - toronto <nl> - total <nl> - toward <nl> - tower <nl> - town <nl> - tpa <nl> - train <nl> - trans <nl> - transcontinental <nl> - transport <nl> - transportation <nl> - travel <nl> - traveling <nl> - travels <nl> - trip <nl> - trips <nl> - try <nl> - trying <nl> - tuesday <nl> - tuesdays <nl> - turboprop <nl> - twa <nl> - twelfth <nl> - twelve <nl> - twentieth <nl> - twenty <nl> - two <nl> - type <nl> - types <nl> - ua <nl> - under <nl> - united <nl> - up <nl> - us <nl> - usa <nl> - use <nl> - used <nl> - uses <nl> - using <nl> - utah <nl> - various <nl> - vegas <nl> - very <nl> - via <nl> - vicinity <nl> - visit <nl> - want <nl> - wanted <nl> - wants <nl> - washington <nl> - way <nl> - we <nl> - wednesday <nl> - wednesdays <nl> - week <nl> - weekday <nl> - weekdays <nl> - well <nl> - west <nl> - westchester <nl> - what <nl> - when <nl> - where <nl> - whether <nl> - which <nl> - while <nl> - who <nl> - will <nl> - wish <nl> - with <nl> - within <nl> - without <nl> - wn <nl> - working <nl> - world <nl> - worth <nl> - would <nl> - y <nl> - year <nl> - yes <nl> - yn <nl> - york <nl> - you <nl> - your <nl> - yx <nl> - yyz <nl> - zone <nl> deleted file mode 100644 <nl> index c6c0dfd795d . . 00000000000 <nl> mmm a / Examples / Text / ATIS / data / trash / slots . wl <nl> ppp / dev / null <nl> <nl> - B - aircraft_code <nl> - B - airline_code <nl> - B - airline_name <nl> - B - airport_code <nl> - B - airport_name <nl> - B - arrive_date . date_relative <nl> - B - arrive_date . day_name <nl> - B - arrive_date . day_number <nl> - B - arrive_date . month_name <nl> - B - arrive_date . today_relative <nl> - B - arrive_time . end_time <nl> - B - arrive_time . period_mod <nl> - B - arrive_time . period_of_day <nl> - B - arrive_time . start_time <nl> - B - arrive_time . time <nl> - B - arrive_time . time_relative <nl> - B - booking_class <nl> - B - city_name <nl> - B - class_type <nl> - B - compartment <nl> - B - connect <nl> - B - cost_relative <nl> - B - day_name <nl> - B - day_number <nl> - B - days_code <nl> - B - depart_date . date_relative <nl> - B - depart_date . day_name <nl> - B - depart_date . day_number <nl> - B - depart_date . month_name <nl> - B - depart_date . today_relative <nl> - B - depart_date . year <nl> - B - depart_time . end_time <nl> - B - depart_time . period_mod <nl> - B - depart_time . period_of_day <nl> - B - depart_time . start_time <nl> - B - depart_time . time <nl> - B - depart_time . time_relative <nl> - B - economy <nl> - B - fare_amount <nl> - B - fare_basis_code <nl> - B - flight <nl> - B - flight_days <nl> - B - flight_mod <nl> - B - flight_number <nl> - B - flight_stop <nl> - B - flight_time <nl> - B - fromloc . airport_code <nl> - B - fromloc . airport_name <nl> - B - fromloc . city_name <nl> - B - fromloc . state_code <nl> - B - fromloc . state_name <nl> - B - meal <nl> - B - meal_code <nl> - B - meal_description <nl> - B - mod <nl> - B - month_name <nl> - B - or <nl> - B - period_of_day <nl> - B - restriction_code <nl> - B - return_date . date_relative <nl> - B - return_date . day_name <nl> - B - return_date . day_number <nl> - B - return_date . month_name <nl> - B - return_date . today_relative <nl> - B - return_time . period_mod <nl> - B - return_time . period_of_day <nl> - B - round_trip <nl> - B - state_code <nl> - B - state_name <nl> - B - stoploc . airport_code <nl> - B - stoploc . airport_name <nl> - B - stoploc . city_name <nl> - B - stoploc . state_code <nl> - B - time <nl> - B - time_relative <nl> - B - today_relative <nl> - B - toloc . airport_code <nl> - B - toloc . airport_name <nl> - B - toloc . city_name <nl> - B - toloc . country_name <nl> - B - toloc . state_code <nl> - B - toloc . state_name <nl> - B - transport_type <nl> - I - airline_name <nl> - I - airport_name <nl> - I - arrive_date . day_number <nl> - I - arrive_time . end_time <nl> - I - arrive_time . period_of_day <nl> - I - arrive_time . start_time <nl> - I - arrive_time . time <nl> - I - arrive_time . time_relative <nl> - I - city_name <nl> - I - class_type <nl> - I - cost_relative <nl> - I - depart_date . day_name <nl> - I - depart_date . day_number <nl> - I - depart_date . today_relative <nl> - I - depart_time . end_time <nl> - I - depart_time . period_of_day <nl> - I - depart_time . start_time <nl> - I - depart_time . time <nl> - I - depart_time . time_relative <nl> - I - economy <nl> - I - fare_amount <nl> - I - fare_basis_code <nl> - I - flight_mod <nl> - I - flight_number <nl> - I - flight_stop <nl> - I - flight_time <nl> - I - fromloc . airport_name <nl> - I - fromloc . city_name <nl> - I - fromloc . state_name <nl> - I - meal_code <nl> - I - meal_description <nl> - I - mod <nl> - I - restriction_code <nl> - I - return_date . date_relative <nl> - I - return_date . day_number <nl> - I - return_date . today_relative <nl> - I - round_trip <nl> - I - state_name <nl> - I - stoploc . city_name <nl> - I - time <nl> - I - today_relative <nl> - I - toloc . airport_name <nl> - I - toloc . city_name <nl> - I - toloc . state_name <nl> - I - transport_type <nl> - O <nl>
|
removed trash files
|
microsoft/CNTK
|
de50a4a2f0343d4957866688266e5e5baedd65c3
|
2016-09-15T15:32:00Z
|
mmm a / java / src / test / java / com / google / protobuf / UnknownFieldSetLiteTest . java <nl> ppp b / java / src / test / java / com / google / protobuf / UnknownFieldSetLiteTest . java <nl> <nl> <nl> import java . io . ByteArrayOutputStream ; <nl> import java . io . IOException ; <nl> - import java . nio . charset . StandardCharsets ; <nl> <nl> / * * <nl> * Tests for { @ link UnknownFieldSetLite } . <nl> public void testRoundTrips ( ) throws InvalidProtocolBufferException { <nl> assertEquals ( foo , copyOfCopy ) ; <nl> } <nl> <nl> - public void testMalformedBytes ( ) { <nl> + public void testMalformedBytes ( ) throws Exception { <nl> try { <nl> - Foo . parseFrom ( " this is a malformed protocol buffer " . getBytes ( StandardCharsets . UTF_8 ) ) ; <nl> + Foo . parseFrom ( " this is a malformed protocol buffer " . getBytes ( " UTF - 8 " ) ) ; <nl> fail ( ) ; <nl> } catch ( InvalidProtocolBufferException e ) { <nl> / / Expected . <nl>
|
Remove usage of features not supported in Java 1 . 6 .
|
protocolbuffers/protobuf
|
6a949cda379c0ee38cce1a926e2982d45f53dfce
|
2014-12-04T02:23:49Z
|
mmm a / swoole_coroutine . c <nl> ppp b / swoole_coroutine . c <nl> typedef struct cidmap <nl> } cidmap_t ; <nl> <nl> / * 1 < = cid < = 524288 * / <nl> - static cidmap_t cidmap = { 0x80000 , { 0 } } ; <nl> + static cidmap_t cidmap = { MAX_CORO_NUM_LIMIT , { 0 } } ; <nl> <nl> static int last_cid = - 1 ; <nl> <nl> mmm a / swoole_coroutine . h <nl> ppp b / swoole_coroutine . h <nl> <nl> <nl> # define DEFAULT_MAX_CORO_NUM 3000 <nl> # define DEFAULT_STACK_SIZE 8192 <nl> + # define MAX_CORO_NUM_LIMIT 0x80000 <nl> <nl> # define CORO_END 0 <nl> # define CORO_YIELD 1 <nl> mmm a / swoole_coroutine_util . c <nl> ppp b / swoole_coroutine_util . c <nl> static PHP_METHOD ( swoole_coroutine_util , set ) <nl> { <nl> COROG . max_coro_num = DEFAULT_MAX_CORO_NUM ; <nl> } <nl> + else if ( COROG . max_coro_num > = MAX_CORO_NUM_LIMIT ) <nl> + { <nl> + COROG . max_coro_num = MAX_CORO_NUM_LIMIT ; <nl> + } <nl> } <nl> if ( php_swoole_array_get_value ( vht , " stack_size " , v ) ) <nl> { <nl> mmm a / swoole_server . c <nl> ppp b / swoole_server . c <nl> PHP_METHOD ( swoole_server , set ) <nl> { <nl> COROG . max_coro_num = DEFAULT_MAX_CORO_NUM ; <nl> } <nl> + else if ( COROG . max_coro_num > = MAX_CORO_NUM_LIMIT ) <nl> + { <nl> + COROG . max_coro_num = MAX_CORO_NUM_LIMIT ; <nl> + } <nl> } <nl> # endif <nl> / / dispatch_mode <nl>
|
MAX_CORO_NUM_LIMIT
|
swoole/swoole-src
|
bdaf364483ae24088746908eaf5a8a06e23fc488
|
2018-03-23T02:31:56Z
|
mmm a / toolsrc / include / BuildInfo . h <nl> ppp b / toolsrc / include / BuildInfo . h <nl> namespace vcpkg { namespace PostBuildLint <nl> <nl> OutdatedDynamicCrt ( ) = delete ; <nl> <nl> - const std : : regex crt_regex ( ) const ; <nl> + std : : regex crt_regex ( ) const ; <nl> const std : : string & toString ( ) const ; <nl> <nl> private : <nl> mmm a / toolsrc / src / BuildInfo . cpp <nl> ppp b / toolsrc / src / BuildInfo . cpp <nl> namespace vcpkg { namespace PostBuildLint <nl> const OutdatedDynamicCrt OutdatedDynamicCrt : : MSVCRT20_DLL = OutdatedDynamicCrt ( " msvcrt20 . dll " , R " ( msvcrt20 \ . dll ) " ) ; ; <nl> const OutdatedDynamicCrt OutdatedDynamicCrt : : MSVCRT40_DLL = OutdatedDynamicCrt ( " msvcrt40 . dll " , R " ( msvcrt40 \ . dll ) " ) ; ; <nl> <nl> - const std : : regex OutdatedDynamicCrt : : crt_regex ( ) const <nl> + std : : regex OutdatedDynamicCrt : : crt_regex ( ) const <nl> { <nl> const std : : regex r ( this - > m_crt_regex_as_string , std : : regex_constants : : icase ) ; <nl> return r ; <nl>
|
Don ' t return by const value
|
microsoft/vcpkg
|
835693ce97f271c0213f65c1c782e8df84cfb409
|
2016-12-17T04:17:24Z
|
mmm a / tensorflow / python / distribute / values . py <nl> ppp b / tensorflow / python / distribute / values . py <nl> def __eq__ ( self , o ) : <nl> self . traceback = = o . traceback and self . type = = o . type ) <nl> <nl> def __hash__ ( self ) : <nl> - return hash ( ( self . name , self . graph , self . traceback , self . type ) ) <nl> + return hash ( ( self . name , self . graph , tuple ( self . traceback ) , self . type ) ) <nl> <nl> <nl> class DistributedVariable ( DistributedDelegate , variables_lib . Variable , <nl> mmm a / tensorflow / python / util / tf_stack . cc <nl> ppp b / tensorflow / python / util / tf_stack . cc <nl> PYBIND11_MODULE ( _tf_stack , m ) { <nl> / / For compatibility with the traceback module . <nl> . def ( " __eq__ " , & FrameSummary : : operator = = ) <nl> . def ( " __ne__ " , & FrameSummary : : operator ! = ) <nl> + . def ( " __hash__ " , <nl> + [ ] ( const FrameSummary & self ) { <nl> + return py : : hash ( <nl> + py : : make_tuple ( self . filename , self . lineno , self . name ) ) ; <nl> + } ) <nl> . def ( " __getitem__ " , <nl> [ ] ( const FrameSummary & self , const py : : object & index ) - > py : : object { <nl> return py : : make_tuple ( self . filename , self . lineno , self . name , <nl> mmm a / tensorflow / python / util / tf_stack_test . py <nl> ppp b / tensorflow / python / util / tf_stack_test . py <nl> def testFrameSummaryEquality ( self ) : <nl> another_frame0 , _ = tf_stack . extract_stack ( limit = 2 ) <nl> self . assertEqual ( frame0 , another_frame0 ) <nl> <nl> + def testFrameSummaryEqualityAndHash ( self ) : <nl> + # Both defined on the same line to produce identical stacks . <nl> + frame1 , frame2 = tf_stack . extract_stack ( ) , tf_stack . extract_stack ( ) <nl> + self . assertEqual ( len ( frame1 ) , len ( frame2 ) ) <nl> + for f1 , f2 in zip ( frame1 , frame2 ) : <nl> + self . assertEqual ( f1 , f2 ) <nl> + self . assertEqual ( hash ( f1 ) , hash ( f1 ) ) <nl> + self . assertEqual ( hash ( f1 ) , hash ( f2 ) ) <nl> + self . assertEqual ( frame1 , frame2 ) <nl> + self . assertEqual ( hash ( tuple ( frame1 ) ) , hash ( tuple ( frame2 ) ) ) <nl> + <nl> <nl> def extract_stack ( limit = None ) : <nl> # Both defined on the same line to produce identical stacks . <nl>
|
Adding __hash__ for forward compatibility with pybind11 update .
|
tensorflow/tensorflow
|
2f299464030b8b9552e3e75db0f26cd5709775ec
|
2020-08-21T22:05:35Z
|
mmm a / emcc <nl> ppp b / emcc <nl> CONFIGURE_CONFIG = ( os . environ . get ( ' EMMAKEN_JUST_CONFIGURE ' ) or ' conftest . c ' in <nl> CMAKE_CONFIG = ' CMakeFiles / cmTryCompileExec . dir ' in ' ' . join ( sys . argv ) # or ' CMakeCCompilerId ' in ' ' . join ( sys . argv ) <nl> if CONFIGURE_CONFIG or CMAKE_CONFIG : <nl> debug_configure = 0 # XXX use this to debug configure stuff . . / configure ' s generally hide our normal output including stderr so we write to a file <nl> - use_js = os . environ . get ( ' EMCONFIGURE_JS ' ) # whether we fake configure tests using clang - the local , native compiler - or not . if not we generate JS and use node with a shebang <nl> - # neither approach is perfect , you can try both , but may need to edit configure scripts in some cases <nl> - # XXX False is not fully tested yet <nl> + <nl> + # whether we fake configure tests using clang - the local , native compiler - or not . if not we generate JS and use node with a shebang <nl> + # neither approach is perfect , you can try both , but may need to edit configure scripts in some cases <nl> + # by default we configure in js , which can break on local filesystem access , etc . , but is otherwise accurate <nl> + use_js = os . environ . get ( ' EMCONFIGURE_JS ' ) or 1 <nl> <nl> if debug_configure : <nl> tempout = ' / tmp / emscripten_temp / out ' <nl> mmm a / tests / test_other . py <nl> ppp b / tests / test_other . py <nl> def test ( args , expected ) : <nl> <nl> def test_emconfigure_js_o ( self ) : <nl> # issue 2994 <nl> - try : <nl> - os . environ [ ' EMCONFIGURE_JS ' ] = ' 1 ' <nl> - Popen ( [ PYTHON , path_from_root ( ' emconfigure ' ) , PYTHON , EMCC , ' - c ' , ' - o ' , ' a . o ' , path_from_root ( ' tests ' , ' hello_world . c ' ) ] ) . communicate ( ) <nl> - Popen ( [ PYTHON , EMCC , ' a . o ' ] ) . communicate ( ) <nl> - assert ' hello , world ! ' in run_js ( self . in_dir ( ' a . out . js ' ) ) <nl> - finally : <nl> - del os . environ [ ' EMCONFIGURE_JS ' ] <nl> + for i in [ 0 , 1 ] : <nl> + print i <nl> + try : <nl> + os . environ [ ' EMCONFIGURE_JS ' ] = str ( i ) <nl> + Popen ( [ PYTHON , path_from_root ( ' emconfigure ' ) , PYTHON , EMCC , ' - c ' , ' - o ' , ' a . o ' , path_from_root ( ' tests ' , ' hello_world . c ' ) ] ) . communicate ( ) <nl> + Popen ( [ PYTHON , EMCC , ' a . o ' ] ) . communicate ( ) <nl> + assert ' hello , world ! ' in run_js ( self . in_dir ( ' a . out . js ' ) ) <nl> + finally : <nl> + del os . environ [ ' EMCONFIGURE_JS ' ] <nl> <nl> def test_emcc_c_multi ( self ) : <nl> def test ( args , llvm_opts = None ) : <nl>
|
enable EMCONFIGURE_JS by default , i . e . , run configure tests by compiling to js
|
emscripten-core/emscripten
|
9be0275876217eacd30c848b1c7cea68d1a3d986
|
2015-02-09T22:03:07Z
|
mmm a / src / dbg / _exports . cpp <nl> ppp b / src / dbg / _exports . cpp <nl> <nl> # include " xrefs . h " <nl> # include " encodemap . h " <nl> # include " argument . h " <nl> + # include " watch . h " <nl> <nl> static bool bOnlyCipAutoComments = false ; <nl> <nl> extern " C " DLL_EXPORT duint _dbg_sendmessage ( DBGMSG type , void * param1 , void * pa <nl> BookmarkDelRange ( ( duint ) param1 , ( duint ) param2 , true ) ; <nl> } <nl> break ; <nl> + <nl> + case DBG_GET_WATCH_LIST : <nl> + { <nl> + BridgeList < WATCHINFO > : : CopyData ( ( ListInfo * ) param1 , WatchGetList ( ) ) ; <nl> + } <nl> + break ; <nl> } <nl> return 0 ; <nl> } <nl>
|
watch view
|
x64dbg/x64dbg
|
30972da1ad5f0e9107160f2c98301d790c1403ea
|
2016-07-07T06:09:31Z
|
mmm a / include / mxnet / c_api . h <nl> ppp b / include / mxnet / c_api . h <nl> typedef void * DataIterHandle ; <nl> * \ return error info <nl> * / <nl> MXNET_DLL const char * MXGetLastError ( ) ; <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + / / Part 0 : Global State setups <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + / * ! <nl> + * \ brief Seed the global random number generators in mxnet . <nl> + * \ param seed the random number seed . <nl> + * \ return 0 when success , - 1 when failure happens . <nl> + * / <nl> + MXNET_DLL int MXRandomSeed ( int seed ) ; <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> / / Part 1 : NDArray creation and deletion <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> mmm a / include / mxnet / ndarray . h <nl> ppp b / include / mxnet / ndarray . h <nl> class NDArray { <nl> ret . shape_ = shape ; <nl> return ret ; <nl> } <nl> + / * ! <nl> + * \ brief Allocate the space if it is delayed allocated . <nl> + * This is an internal function used by system that normal user should not use <nl> + * / <nl> + inline void CheckAndAlloc ( ) const { <nl> + ptr_ - > CheckAndAlloc ( ) ; <nl> + } <nl> <nl> private : <nl> / * ! \ brief the real data chunk that backs NDArray * / <nl> class NDArray { <nl> TShape shape_ ; <nl> / * ! \ brief offset in chunk * / <nl> size_t offset_ ; <nl> - <nl> - / / add friend to helper functions <nl> - friend void CopyFromTo ( const NDArray & from , NDArray * to ) ; <nl> - template < typename OP > <nl> - friend void BinaryOp ( const NDArray & lhs , const NDArray & rhs , NDArray * out ) ; <nl> - template < typename OP > <nl> - friend void UnaryOp ( const NDArray & lhs , const NDArray & rhs , NDArray * out ) ; <nl> - template < typename OP , bool reverse > <nl> - friend void ScalarOp ( const NDArray & lhs , const real_t & rhs , NDArray * out ) ; <nl> - friend void SetValueOp ( const real_t & rhs , NDArray * out ) ; <nl> } ; <nl> <nl> / * ! <nl> NDArray operator / ( const NDArray & lhs , const NDArray & rhs ) ; <nl> * / <nl> NDArray operator / ( const NDArray & lhs , const real_t & rhs ) ; <nl> <nl> + / * ! <nl> + * \ brief Seed the random number generator . <nl> + * \ param seed the seed to set to global random number generators . <nl> + * / <nl> + void RandomSeed ( uint32_t seed ) ; <nl> + / * ! <nl> + * \ brief Sample uniform distribution for each elements of out . <nl> + * \ param begin lower bound of distribution . <nl> + * \ param end upper bound of distribution . <nl> + * \ param out output NDArray . <nl> + * / <nl> + void SampleUniform ( real_t begin , real_t end , NDArray * out ) ; <nl> + <nl> + / * ! <nl> + * \ brief Sample gaussian distribution for each elements of out . <nl> + * \ param mu mean of gaussian distribution . <nl> + * \ param sigma standard deviation of gaussian distribution . <nl> + * \ param out output NDArray . <nl> + * / <nl> + void SampleGaussian ( real_t mu , real_t sigma , NDArray * out ) ; <nl> + <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> / / The following part are API Registration of NDArray functions . <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> struct NDArrayFunctionReg <nl> * \ return ref to the registered entry , used to set properties <nl> * / <nl> inline NDArrayFunctionReg & set_function ( void fsetvalue ( const real_t & rhs , <nl> - NDArray * out ) ) { <nl> - body = [ fsetvalue ] ( NDArray * * used_vars , <nl> - real_t * s , NDArray * * mutate_vars ) { <nl> + NDArray * out ) ) { <nl> + body = [ fsetvalue ] ( NDArray * * used_vars , real_t * s , NDArray * * mutate_vars ) { <nl> fsetvalue ( s [ 0 ] , mutate_vars [ 0 ] ) ; <nl> } ; <nl> num_mutate_vars = 1 ; num_scalars = 1 ; <nl> - / / type_mask = kNDArrayArgBeforeScalar ; <nl> - this - > add_argument ( " rhs " , " real_t " , " Right operand to the function . " ) ; <nl> + this - > add_argument ( " src " , " real_t " , " Source input to the function . " ) ; <nl> return * this ; <nl> } <nl> / * ! <nl> struct NDArrayFunctionReg <nl> * \ return ref to the registered entry , used to set properties <nl> * / <nl> inline NDArrayFunctionReg & set_function ( void fbinary ( const NDArray & lhs , <nl> - const NDArray & rhs , <nl> - NDArray * out ) ) { <nl> + const NDArray & rhs , <nl> + NDArray * out ) ) { <nl> body = [ fbinary ] ( NDArray * * used_vars , <nl> real_t * s , NDArray * * mutate_vars ) { <nl> fbinary ( * used_vars [ 0 ] , * used_vars [ 1 ] , mutate_vars [ 0 ] ) ; <nl> struct NDArrayFunctionReg <nl> * \ return ref to the registered entry , used to set properties <nl> * / <nl> inline NDArrayFunctionReg & set_function ( void fscalar ( const NDArray & lhs , <nl> - const real_t & rhs , <nl> - NDArray * out ) ) { <nl> + const real_t & rhs , <nl> + NDArray * out ) ) { <nl> body = [ fscalar ] ( NDArray * * used_vars , <nl> - real_t * s , NDArray * * mutate_vars ) { <nl> + real_t * s , NDArray * * mutate_vars ) { <nl> fscalar ( * used_vars [ 0 ] , s [ 0 ] , mutate_vars [ 0 ] ) ; <nl> } ; <nl> num_use_vars = 1 ; num_mutate_vars = 1 ; num_scalars = 1 ; <nl> struct NDArrayFunctionReg <nl> * \ return ref to the registered entry , used to set properties <nl> * / <nl> inline NDArrayFunctionReg & set_function ( void funary ( const NDArray & src , <nl> - NDArray * out ) ) { <nl> + NDArray * out ) ) { <nl> body = [ funary ] ( NDArray * * used_vars , <nl> real_t * s , NDArray * * mutate_vars ) { <nl> funary ( * used_vars [ 0 ] , mutate_vars [ 0 ] ) ; <nl> mmm a / include / mxnet / resource . h <nl> ppp b / include / mxnet / resource . h <nl> class ResourceManager { <nl> * still hold by the manager singleton . <nl> * <nl> * / <nl> - virtual Resource Request ( Context ctx , const ResourceRequest & req ) ; <nl> + virtual Resource Request ( Context ctx , const ResourceRequest & req ) = 0 ; <nl> / * ! <nl> * \ brief Seed all the allocated random numbers . <nl> * \ param seed the seed to the random number generators on all devices . <nl> * / <nl> - virtual void SeedRandom ( uint32_t seed ) ; <nl> + virtual void SeedRandom ( uint32_t seed ) = 0 ; <nl> / * ! \ brief virtual destructor * / <nl> - virtual ~ ResourceManager ( ) noexcept ( false ) { } <nl> + virtual ~ ResourceManager ( ) { } <nl> / * ! <nl> * \ return Resource manager singleton . <nl> * / <nl> mmm a / python / mxnet / __init__ . py <nl> ppp b / python / mxnet / __init__ . py <nl> <nl> from . import io <nl> # use mx . nd as short for mx . ndarray <nl> from . import ndarray as nd <nl> + from . import random <nl> <nl> __version__ = " 0 . 1 . 0 " <nl> mmm a / python / mxnet / context . py <nl> ppp b / python / mxnet / context . py <nl> def __init__ ( self , device_type , device_id = 0 ) : <nl> device_id : int ( default = 0 ) <nl> the device id of the device , needed for GPU <nl> " " " <nl> - self . device_mask = Context . devtype2mask [ device_type ] <nl> - self . device_id = device_id <nl> + if isinstance ( device_type , Context ) : <nl> + self . device_mask = device_type . device_mask <nl> + self . device_id = device_type . device_id <nl> + else : <nl> + self . device_mask = Context . devtype2mask [ device_type ] <nl> + self . device_id = device_id <nl> self . _old_ctx = None <nl> <nl> @ property <nl> mmm a / python / mxnet / ndarray . py <nl> ppp b / python / mxnet / ndarray . py <nl> def zeros ( shape , ctx = None ) : <nl> mmmmmmmmm - <nl> shape : tuple <nl> shape of the NDArray . <nl> - <nl> - ctx : Context , optional <nl> + ctx : Context , optional . <nl> The context of the NDArray , default to current default context . <nl> <nl> Returns <nl> def ones ( shape , ctx = None ) : <nl> mmmmmmmmm - <nl> shape : tuple <nl> shape of the NDArray . <nl> - <nl> ctx : Context , optional <nl> The context of the NDArray , default to current default context . <nl> <nl> new file mode 100644 <nl> index 00000000000 . . 489a8bd1609 <nl> mmm / dev / null <nl> ppp b / python / mxnet / random . py <nl> <nl> + # coding : utf - 8 <nl> + # pylint : disable = no - member , protected - access <nl> + " " " Random Number interface of mxnet . " " " <nl> + from __future__ import absolute_import <nl> + <nl> + import ctypes <nl> + from . base import _LIB , check_call <nl> + from . ndarray import NDArray , empty <nl> + <nl> + <nl> + def uniform ( low , high , shape = None , ctx = None , out = None ) : <nl> + " " " Generate uniform distribution in [ low , high ) with shape . <nl> + <nl> + Parameters <nl> + mmmmmmmmm - <nl> + low : float <nl> + The lower bound of distribution . <nl> + high : float <nl> + The upper bound of distribution . <nl> + shape : tuple , optional <nl> + Output shape of the NDArray generated . <nl> + ctx : Context , optional <nl> + Context of output NDArray , will use default context if not specified . <nl> + out : NDArray , optional <nl> + Output place holder <nl> + <nl> + Returns <nl> + mmmmmm - <nl> + out : NDArray <nl> + The result NDArray with generated result . <nl> + " " " <nl> + if out is not None : <nl> + if shape is not None or ctx is not None : <nl> + raise ValueError ( ' shape and ctx is not needed when out is specified ' ) <nl> + else : <nl> + if shape is None : <nl> + raise ValueError ( ' shape is required when out is not specified ' ) <nl> + if isinstance ( shape , int ) : <nl> + shape = ( shape , ) <nl> + out = empty ( shape , ctx ) <nl> + return NDArray . _random_uniform ( low , high , out = out ) <nl> + <nl> + <nl> + def normal ( mean , stdvar , shape = None , ctx = None , out = None ) : <nl> + " " " Generate normal ( Gaussian ) distribution N ( mean , stdvar ^ 2 ) with shape . <nl> + <nl> + Parameters <nl> + mmmmmmmmm - <nl> + mean : float <nl> + The mean of the normal distribution . <nl> + stdvar : float <nl> + The standard deviation of normal distribution . <nl> + shape : tuple , optional <nl> + Output shape of the NDArray generated . <nl> + ctx : Context , optional <nl> + Context of output NDArray , will use default context if not specified . <nl> + out : NDArray , optional <nl> + Output place holder <nl> + <nl> + Returns <nl> + mmmmmm - <nl> + out : NDArray <nl> + The result NDArray with generated result . <nl> + " " " <nl> + if out is not None : <nl> + if shape is not None or ctx is not None : <nl> + raise ValueError ( ' shape and ctx is not needed when out is specified ' ) <nl> + else : <nl> + if shape is None : <nl> + raise ValueError ( ' shape is required when out is not specified ' ) <nl> + if isinstance ( shape , int ) : <nl> + shape = ( shape , ) <nl> + out = empty ( shape , ctx ) <nl> + return NDArray . _random_gaussian ( mean , stdvar , out = out ) <nl> + <nl> + <nl> + def seed ( seed_state ) : <nl> + " " " Seed the random number generators in mxnet . <nl> + <nl> + This seed will affect behavior of functions in this module , <nl> + as well as results from executors that contains Random number <nl> + such as Dropout operators . <nl> + <nl> + Parameters <nl> + mmmmmmmmm - <nl> + seed_state : int <nl> + The random number seed to set to all devices . <nl> + <nl> + Notes <nl> + mmm - - <nl> + The random number generator of mxnet is by default device specific . <nl> + This means if you set the same seed , the random number sequence <nl> + generated from GPU0 can be different from CPU . <nl> + " " " <nl> + if not isinstance ( seed_state , int ) : <nl> + raise ValueError ( ' sd must be int ' ) <nl> + seed_state = ctypes . c_int ( int ( seed_state ) ) <nl> + check_call ( _LIB . MXRandomSeed ( seed_state ) ) <nl> + <nl> mmm a / src / c_api . cc <nl> ppp b / src / c_api . cc <nl> inline int MXAPIGetFunctionRegInfo ( const FunRegType * e , <nl> } <nl> <nl> / / NOTE : return value is added in API_END <nl> + int MXRandomSeed ( int seed ) { <nl> + API_BEGIN ( ) ; <nl> + mxnet : : RandomSeed ( seed ) ; <nl> + API_END ( ) ; <nl> + } <nl> + <nl> int MXNDArrayCreateNone ( NDArrayHandle * out ) { <nl> API_BEGIN ( ) ; <nl> * out = new NDArray ( ) ; <nl> mmm a / src / common / lazy_alloc_array . h <nl> ppp b / src / common / lazy_alloc_array . h <nl> inline void LazyAllocArray < TElem > : : ForEach ( FVisit fvisit ) { <nl> std : : lock_guard < std : : mutex > lock ( create_mutex_ ) ; <nl> for ( size_t i = 0 ; i < head_ . size ( ) ; + + i ) { <nl> if ( head_ [ i ] . get ( ) ! = nullptr ) { <nl> - fviist ( i , head_ [ i ] . get ( ) ) ; <nl> + fvisit ( i , head_ [ i ] . get ( ) ) ; <nl> } <nl> } <nl> for ( size_t i = 0 ; i < more_ . size ( ) ; + + i ) { <nl> inline void LazyAllocArray < TElem > : : ForEach ( FVisit fvisit ) { <nl> } <nl> } / / namespace common <nl> } / / namespace mxnet <nl> - # endif / / MXNET_COMMON_LAZY_ARRAY_H_ <nl> + # endif / / MXNET_COMMON_LAZY_ALLOC_ARRAY_H_ <nl> mmm a / src / ndarray / ndarray . cc <nl> ppp b / src / ndarray / ndarray . cc <nl> <nl> # include < dmlc / registry . h > <nl> # include < mxnet / base . h > <nl> # include < mxnet / ndarray . h > <nl> + # include < mxnet / resource . h > <nl> # include < mshadow / tensor . h > <nl> # include " . / ndarray_function . h " <nl> <nl> inline void BinaryOp ( const NDArray & lhs , <nl> NDArray ret = * out ; <nl> / / get the const variables <nl> std : : vector < Engine : : VarHandle > const_vars ; <nl> - if ( lhs . ptr_ - > var ! = ret . ptr_ - > var ) const_vars . push_back ( lhs . ptr_ - > var ) ; <nl> - if ( rhs . ptr_ - > var ! = ret . ptr_ - > var ) const_vars . push_back ( rhs . ptr_ - > var ) ; <nl> + if ( lhs . var ( ) ! = ret . var ( ) ) const_vars . push_back ( lhs . var ( ) ) ; <nl> + if ( rhs . var ( ) ! = ret . var ( ) ) const_vars . push_back ( rhs . var ( ) ) ; <nl> <nl> / / redirect everything to mshadow operations <nl> switch ( lhs . ctx ( ) . dev_mask ) { <nl> case cpu : : kDevMask : { <nl> Engine : : Get ( ) - > PushSync ( [ lhs , rhs , ret ] ( RunContext ctx ) { <nl> - ret . ptr_ - > CheckAndAlloc ( ) ; <nl> + ret . CheckAndAlloc ( ) ; <nl> TBlob tmp = ret . data ( ) ; <nl> ndarray : : Eval < cpu , OP > ( lhs . data ( ) , rhs . data ( ) , & tmp , ctx ) ; <nl> - } , lhs . ctx ( ) , const_vars , { ret . ptr_ - > var } ) ; <nl> + } , lhs . ctx ( ) , const_vars , { ret . var ( ) } ) ; <nl> break ; <nl> } <nl> # if MXNET_USE_CUDA <nl> case gpu : : kDevMask : { <nl> Engine : : Get ( ) - > PushSync ( [ lhs , rhs , ret ] ( RunContext ctx ) { <nl> - ret . ptr_ - > CheckAndAlloc ( ) ; <nl> + ret . CheckAndAlloc ( ) ; <nl> TBlob tmp = ret . data ( ) ; <nl> ndarray : : Eval < gpu , OP > ( lhs . data ( ) , rhs . data ( ) , & tmp , ctx ) ; <nl> / / Wait GPU kernel to complete <nl> ctx . get_stream < gpu > ( ) - > Wait ( ) ; <nl> - } , lhs . ctx ( ) , const_vars , { ret . ptr_ - > var } ) ; <nl> + } , lhs . ctx ( ) , const_vars , { ret . var ( ) } ) ; <nl> break ; <nl> } <nl> # endif <nl> inline void SetValueOp ( const real_t & rhs , NDArray * out ) { <nl> switch ( ret . ctx ( ) . dev_mask ) { <nl> case cpu : : kDevMask : { <nl> Engine : : Get ( ) - > PushSync ( [ rhs , ret ] ( RunContext ctx ) { <nl> - ret . ptr_ - > CheckAndAlloc ( ) ; <nl> + ret . CheckAndAlloc ( ) ; <nl> TBlob tmp = ret . data ( ) ; <nl> ndarray : : Eval < cpu > ( rhs , & tmp , ctx ) ; <nl> - } , ret . ctx ( ) , { } , { ret . ptr_ - > var } ) ; <nl> + } , ret . ctx ( ) , { } , { ret . var ( ) } ) ; <nl> break ; <nl> } <nl> # if MXNET_USE_CUDA <nl> case gpu : : kDevMask : { <nl> Engine : : Get ( ) - > PushSync ( [ rhs , ret ] ( RunContext ctx ) { <nl> - ret . ptr_ - > CheckAndAlloc ( ) ; <nl> + ret . CheckAndAlloc ( ) ; <nl> TBlob tmp = ret . data ( ) ; <nl> ndarray : : Eval < gpu > ( rhs , & tmp , ctx ) ; <nl> / / Wait GPU kernel to complete <nl> ctx . get_stream < gpu > ( ) - > Wait ( ) ; <nl> - } , ret . ctx ( ) , { } , { ret . ptr_ - > var } ) ; <nl> + } , ret . ctx ( ) , { } , { ret . var ( ) } ) ; <nl> break ; <nl> } <nl> # endif <nl> inline void ScalarOp ( const NDArray & lhs , <nl> NDArray ret = * out ; <nl> / / get the const variables <nl> std : : vector < Engine : : VarHandle > const_vars ; <nl> - if ( lhs . ptr_ - > var ! = ret . ptr_ - > var ) const_vars . push_back ( lhs . ptr_ - > var ) ; <nl> + if ( lhs . var ( ) ! = ret . var ( ) ) const_vars . push_back ( lhs . var ( ) ) ; <nl> <nl> / / redirect everything to mshadow operations <nl> switch ( lhs . ctx ( ) . dev_mask ) { <nl> case cpu : : kDevMask : { <nl> Engine : : Get ( ) - > PushSync ( [ lhs , rhs , ret ] ( RunContext ctx ) { <nl> - ret . ptr_ - > CheckAndAlloc ( ) ; <nl> + ret . CheckAndAlloc ( ) ; <nl> TBlob tmp = ret . data ( ) ; <nl> ndarray : : Eval < cpu , OP , reverse > ( lhs . data ( ) , rhs , & tmp , ctx ) ; <nl> - } , lhs . ctx ( ) , const_vars , { ret . ptr_ - > var } ) ; <nl> + } , lhs . ctx ( ) , const_vars , { ret . var ( ) } ) ; <nl> break ; <nl> } <nl> # if MXNET_USE_CUDA <nl> case gpu : : kDevMask : { <nl> Engine : : Get ( ) - > PushSync ( [ lhs , rhs , ret ] ( RunContext ctx ) { <nl> - ret . ptr_ - > CheckAndAlloc ( ) ; <nl> + ret . CheckAndAlloc ( ) ; <nl> TBlob tmp = ret . data ( ) ; <nl> ndarray : : Eval < gpu , OP , reverse > ( lhs . data ( ) , rhs , & tmp , ctx ) ; <nl> / / Wait GPU kernel to complete <nl> ctx . get_stream < gpu > ( ) - > Wait ( ) ; <nl> - } , lhs . ctx ( ) , const_vars , { ret . ptr_ - > var } ) ; <nl> + } , lhs . ctx ( ) , const_vars , { ret . var ( ) } ) ; <nl> break ; <nl> } <nl> # endif <nl> void CopyFromTo ( const NDArray & from , NDArray * to ) { <nl> int b = to - > ctx ( ) . dev_mask ; <nl> <nl> std : : vector < Engine : : VarHandle > const_vars ; <nl> - if ( from . ptr_ - > var ! = ret . ptr_ - > var ) const_vars . push_back ( from . ptr_ - > var ) ; <nl> + if ( from . var ( ) ! = ret . var ( ) ) const_vars . push_back ( from . var ( ) ) ; <nl> <nl> if ( a = = cpu : : kDevMask & & b = = cpu : : kDevMask ) { <nl> Engine : : Get ( ) - > PushSync ( [ from , ret ] ( RunContext ctx ) { <nl> - ret . ptr_ - > CheckAndAlloc ( ) ; <nl> + ret . CheckAndAlloc ( ) ; <nl> TBlob tmp = ret . data ( ) ; <nl> ndarray : : Copy < cpu , cpu > ( from . data ( ) , & tmp , <nl> from . ctx ( ) , ret . ctx ( ) , ctx ) ; <nl> - } , from . ctx ( ) , const_vars , { ret . ptr_ - > var } ) ; <nl> + } , from . ctx ( ) , const_vars , { ret . var ( ) } ) ; <nl> } else { <nl> # if MXNET_USE_CUDA <nl> if ( a = = cpu : : kDevMask & & b = = gpu : : kDevMask ) { <nl> Engine : : Get ( ) - > PushSync ( [ from , ret ] ( RunContext ctx ) { <nl> - ret . ptr_ - > CheckAndAlloc ( ) ; <nl> + ret . CheckAndAlloc ( ) ; <nl> TBlob tmp = ret . data ( ) ; <nl> ndarray : : Copy < cpu , gpu > ( from . data ( ) , & tmp , <nl> from . ctx ( ) , ret . ctx ( ) , ctx ) ; <nl> / / Wait GPU kernel to complete <nl> ctx . get_stream < gpu > ( ) - > Wait ( ) ; <nl> - } , ret . ctx ( ) , const_vars , { ret . ptr_ - > var } , FnProperty : : kCopyToGPU ) ; <nl> + } , ret . ctx ( ) , const_vars , { ret . var ( ) } , FnProperty : : kCopyToGPU ) ; <nl> } else if ( a = = gpu : : kDevMask & & b = = cpu : : kDevMask ) { <nl> Engine : : Get ( ) - > PushSync ( [ from , ret ] ( RunContext ctx ) { <nl> - ret . ptr_ - > CheckAndAlloc ( ) ; <nl> + ret . CheckAndAlloc ( ) ; <nl> TBlob tmp = ret . data ( ) ; <nl> ndarray : : Copy < gpu , cpu > ( from . data ( ) , & tmp , <nl> from . ctx ( ) , ret . ctx ( ) , ctx ) ; <nl> / / Wait GPU kernel to complete <nl> ctx . get_stream < gpu > ( ) - > Wait ( ) ; <nl> - } , from . ctx ( ) , const_vars , { ret . ptr_ - > var } , FnProperty : : kCopyFromGPU ) ; <nl> + } , from . ctx ( ) , const_vars , { ret . var ( ) } , FnProperty : : kCopyFromGPU ) ; <nl> } else if ( a = = gpu : : kDevMask & & b = = gpu : : kDevMask ) { <nl> Engine : : Get ( ) - > PushSync ( [ from , ret ] ( RunContext ctx ) { <nl> - ret . ptr_ - > CheckAndAlloc ( ) ; <nl> + ret . CheckAndAlloc ( ) ; <nl> TBlob tmp = ret . data ( ) ; <nl> ndarray : : Copy < gpu , gpu > ( from . data ( ) , & tmp , <nl> from . ctx ( ) , ret . ctx ( ) , ctx ) ; <nl> / / Wait GPU kernel to complete <nl> ctx . get_stream < gpu > ( ) - > Wait ( ) ; <nl> - } , from . ctx ( ) , const_vars , { ret . ptr_ - > var } , FnProperty : : kCopyFromGPU ) ; <nl> + } , from . ctx ( ) , const_vars , { ret . var ( ) } , FnProperty : : kCopyFromGPU ) ; <nl> } else { <nl> LOG ( FATAL ) < < " unknown device mask " ; <nl> } <nl> void CopyFromTo ( const NDArray & from , NDArray * to ) { <nl> } <nl> } <nl> <nl> + <nl> + template < typename Distribution > <nl> + inline void SampleOP ( const real_t & a , <nl> + const real_t & b , <nl> + NDArray * out ) { <nl> + CHECK ( ! out - > is_none ( ) ) ; <nl> + Resource resource = ResourceManager : : Get ( ) - > Request ( <nl> + out - > ctx ( ) , ResourceRequest : : kRandom ) ; <nl> + / / important : callback must always capture by value <nl> + NDArray ret = * out ; <nl> + / / redirect everything to mshadow operations <nl> + switch ( out - > ctx ( ) . dev_mask ) { <nl> + case cpu : : kDevMask : { <nl> + Engine : : Get ( ) - > PushSync ( [ a , b , resource , ret ] ( RunContext ctx ) { <nl> + ret . CheckAndAlloc ( ) ; <nl> + TBlob tmp = ret . data ( ) ; <nl> + ndarray : : EvalRandom < cpu , Distribution > ( a , b , resource , & tmp , ctx ) ; <nl> + } , out - > ctx ( ) , { } , { ret . var ( ) , resource . var } ) ; <nl> + break ; <nl> + } <nl> + # if MXNET_USE_CUDA <nl> + case gpu : : kDevMask : { <nl> + Engine : : Get ( ) - > PushSync ( [ a , b , resource , ret ] ( RunContext ctx ) { <nl> + ret . CheckAndAlloc ( ) ; <nl> + TBlob tmp = ret . data ( ) ; <nl> + ndarray : : EvalRandom < gpu , Distribution > ( a , b , resource , & tmp , ctx ) ; <nl> + / / Wait GPU kernel to complete <nl> + ctx . get_stream < gpu > ( ) - > Wait ( ) ; <nl> + } , out - > ctx ( ) , { } , { ret . var ( ) , resource . var } ) ; <nl> + break ; <nl> + } <nl> + # endif <nl> + default : LOG ( FATAL ) < < MXNET_GPU_NOT_ENABLED_ERROR ; <nl> + } <nl> + } <nl> + <nl> + void SampleUniform ( real_t begin , real_t end , NDArray * out ) { <nl> + SampleOP < ndarray : : UniformDistribution > ( begin , end , out ) ; <nl> + } <nl> + <nl> + void SampleGaussian ( real_t mu , real_t sigma , NDArray * out ) { <nl> + SampleOP < ndarray : : GaussianDistribution > ( mu , sigma , out ) ; <nl> + } <nl> + <nl> + void RandomSeed ( uint32_t seed ) { <nl> + ResourceManager : : Get ( ) - > SeedRandom ( seed ) ; <nl> + } <nl> + <nl> template < typename OP > <nl> inline NDArray BinaryOpRet ( const NDArray & lhs , <nl> const NDArray & rhs ) { <nl> MXNET_REGISTER_NDARRAY_FUN ( _div ) . set_function ( BinaryOp < ndarray : : Div > ) ; <nl> <nl> / / register API function <nl> / / those with underscore will be registered at NDArray <nl> - / / scalar <nl> MXNET_REGISTER_NDARRAY_FUN ( _plus_scalar ) . set_function ( ScalarOp < ndarray : : Plus , false > ) ; <nl> MXNET_REGISTER_NDARRAY_FUN ( _minus_scalar ) . set_function ( ScalarOp < ndarray : : Minus , false > ) ; <nl> MXNET_REGISTER_NDARRAY_FUN ( _mul_scalar ) . set_function ( ScalarOp < ndarray : : Mul , false > ) ; <nl> MXNET_REGISTER_NDARRAY_FUN ( _div_scalar ) . set_function ( ScalarOp < ndarray : : Div , false > ) ; <nl> <nl> / / register API function <nl> - / / those with underscore will be registered at NDArray <nl> - / / scalar <nl> - / / reverse scalar <nl> + / / scalar , reverse scalar <nl> MXNET_REGISTER_NDARRAY_FUN ( _rminus_scalar ) . set_function ( ScalarOp < ndarray : : Minus , true > ) ; <nl> MXNET_REGISTER_NDARRAY_FUN ( _rdiv_scalar ) . set_function ( ScalarOp < ndarray : : Div , true > ) ; <nl> <nl> MXNET_REGISTER_NDARRAY_FUN ( _copyto ) <nl> . set_function ( CopyFromTo ) <nl> . set_type_mask ( kNDArrayArgBeforeScalar ) ; <nl> <nl> + / / register random number generators <nl> + MXNET_REGISTER_NDARRAY_FUN ( _random_uniform ) <nl> + . set_body ( [ ] ( NDArray * * u , real_t * s , NDArray * * out ) { <nl> + SampleUniform ( s [ 0 ] , s [ 1 ] , out [ 0 ] ) ; <nl> + } ) <nl> + . set_num_scalars ( 2 ) <nl> + . set_num_mutate_vars ( 1 ) ; <nl> + <nl> + MXNET_REGISTER_NDARRAY_FUN ( _random_gaussian ) <nl> + . set_body ( [ ] ( NDArray * * u , real_t * s , NDArray * * out ) { <nl> + SampleGaussian ( s [ 0 ] , s [ 1 ] , out [ 0 ] ) ; <nl> + } ) <nl> + . set_num_scalars ( 2 ) <nl> + . set_num_mutate_vars ( 1 ) ; <nl> } / / namespace mxnet <nl> mmm a / src / ndarray / ndarray_function - inl . h <nl> ppp b / src / ndarray / ndarray_function - inl . h <nl> <nl> } <nl> # endif <nl> <nl> - # ifndef DECL_SETVALUE <nl> - # define DECL_SETVALUE ( XPU ) \ <nl> - template < > \ <nl> - void Eval < XPU > ( const real_t & rhs , TBlob * ret , RunContext ctx ) { \ <nl> - mshadow : : Stream < XPU > * s = static_cast < mshadow : : Stream < XPU > * > ( ctx . stream ) ; \ <nl> - ret - > FlatTo2D < XPU , real_t > ( s ) = rhs ; \ <nl> - } <nl> - # endif <nl> - <nl> - <nl> # if defined ( __CUDACC__ ) <nl> # define DEVICE gpu <nl> # else <nl> namespace ndarray { <nl> / / true implementation <nl> template < typename xpu , typename OP > <nl> inline void EvalBinary_ ( const TBlob & lhs , const TBlob & rhs , <nl> - TBlob * ret , RunContext ctx ) { <nl> + TBlob * ret , RunContext ctx ) { <nl> using namespace mshadow : : expr ; <nl> - mshadow : : Stream < xpu > * s = static_cast < mshadow : : Stream < xpu > * > ( ctx . stream ) ; <nl> + mshadow : : Stream < xpu > * s = ctx . get_stream < xpu > ( ) ; <nl> ret - > FlatTo2D < xpu , real_t > ( s ) <nl> = F < typename OP : : mshadow_op > ( lhs . FlatTo2D < xpu , real_t > ( s ) , <nl> rhs . FlatTo2D < xpu , real_t > ( s ) ) ; <nl> template < typename xpu , typename OP , bool reverse > <nl> inline void EvalScalar_ ( const TBlob & lhs , const real_t & rhs , <nl> TBlob * ret , RunContext ctx ) { <nl> using namespace mshadow : : expr ; <nl> - mshadow : : Stream < xpu > * s = static_cast < mshadow : : Stream < xpu > * > ( ctx . stream ) ; <nl> + mshadow : : Stream < xpu > * s = ctx . get_stream < xpu > ( ) ; <nl> if ( reverse ) { <nl> ret - > FlatTo2D < xpu , real_t > ( s ) <nl> = F < typename OP : : mshadow_op > ( rhs , lhs . FlatTo2D < xpu , real_t > ( s ) ) ; <nl> inline void EvalScalar_ ( const TBlob & lhs , const real_t & rhs , <nl> } <nl> } <nl> <nl> + template < > <nl> + void EvalRandom < DEVICE , UniformDistribution > ( <nl> + const real_t & a , <nl> + const real_t & b , <nl> + const Resource & resource , <nl> + TBlob * ret , <nl> + RunContext ctx ) { <nl> + typedef DEVICE xpu ; <nl> + mshadow : : Stream < xpu > * s = ctx . get_stream < xpu > ( ) ; <nl> + mshadow : : Tensor < xpu , 2 , real_t > tmp = ret - > FlatTo2D < xpu , real_t > ( s ) ; <nl> + mshadow : : Random < xpu > * prnd = resource . get_random < xpu > ( s ) ; <nl> + prnd - > SampleUniform ( & tmp , a , b ) ; <nl> + } <nl> + <nl> + template < > <nl> + void EvalRandom < DEVICE , GaussianDistribution > ( <nl> + const real_t & mu , <nl> + const real_t & sigma , <nl> + const Resource & resource , <nl> + TBlob * ret , <nl> + RunContext ctx ) { <nl> + typedef DEVICE xpu ; <nl> + mshadow : : Stream < xpu > * s = ctx . get_stream < xpu > ( ) ; <nl> + mshadow : : Tensor < xpu , 2 , real_t > tmp = ret - > FlatTo2D < xpu , real_t > ( s ) ; <nl> + mshadow : : Random < xpu > * prnd = resource . get_random < xpu > ( s ) ; <nl> + prnd - > SampleGaussian ( & tmp , mu , sigma ) ; <nl> + } <nl> + <nl> + template < > <nl> + void Eval < DEVICE > ( const real_t & rhs , TBlob * ret , RunContext ctx ) { <nl> + mshadow : : Stream < DEVICE > * s = ctx . get_stream < DEVICE > ( ) ; <nl> + ret - > FlatTo2D < DEVICE , real_t > ( s ) = rhs ; <nl> + } <nl> <nl> / / declarations <nl> DECL_BINARY ( DEVICE , Plus , EvalBinary_ ) <nl> DECL_SCALAR ( DEVICE , Plus , EvalScalar_ , false ) <nl> DECL_SCALAR ( DEVICE , Minus , EvalScalar_ , false ) <nl> DECL_SCALAR ( DEVICE , Mul , EvalScalar_ , false ) <nl> DECL_SCALAR ( DEVICE , Div , EvalScalar_ , false ) <nl> - / / <nl> - DECL_SETVALUE ( DEVICE ) <nl> } / / namespace ndarray <nl> } / / namespace mxnet <nl> <nl> mmm a / src / ndarray / ndarray_function . h <nl> ppp b / src / ndarray / ndarray_function . h <nl> <nl> # include < dmlc / logging . h > <nl> # include < mshadow / tensor . h > <nl> # include < mxnet / base . h > <nl> + # include < mxnet / resource . h > <nl> <nl> namespace mxnet { <nl> / * ! \ brief namespace to support all possible Ndarray operator * / <nl> struct BinaryBase { <nl> struct Plus : public BinaryBase { <nl> typedef mshadow : : op : : plus mshadow_op ; <nl> } ; <nl> + <nl> struct Minus : public BinaryBase { <nl> typedef mshadow : : op : : minus mshadow_op ; <nl> } ; <nl> + <nl> struct Mul : public BinaryBase { <nl> typedef mshadow : : op : : mul mshadow_op ; <nl> } ; <nl> + <nl> struct Div : public BinaryBase { <nl> typedef mshadow : : op : : div mshadow_op ; <nl> } ; <nl> + <nl> + / / type holder for random number generators <nl> + struct UniformDistribution { } ; <nl> + <nl> + struct GaussianDistribution { } ; <nl> + <nl> + <nl> template < typename Device , typename OP > <nl> void Eval ( const TBlob & lhs , const TBlob & rhs , TBlob * ret , RunContext ctx ) ; <nl> <nl> void Eval ( const TBlob & lhs , const real_t & rhs , TBlob * ret , RunContext ctx ) ; <nl> template < typename Device > <nl> void Eval ( const real_t & rhs , TBlob * ret , RunContext ctx ) ; <nl> <nl> + template < typename Device , typename Distribution > <nl> + void EvalRandom ( const real_t & a , <nl> + const real_t & b , <nl> + const Resource & resource , <nl> + TBlob * ret , RunContext ctx ) ; <nl> + <nl> / / copy function when only cpu is involved <nl> template < typename DeviceFrom , typename DeviceTo > <nl> void Copy ( const TBlob & from , TBlob * to , <nl> mmm a / src / resource . cc <nl> ppp b / src / resource . cc <nl> class ResourceManagerImpl : public ResourceManager { <nl> cpu_rand_ = new ResourceRandom < cpu > ( <nl> Context ( cpu : : kDevMask , 0 ) , global_seed_ ) ; <nl> } <nl> - ~ ResourceManagerImpl ( ) noexcept ( false ) { <nl> + ~ ResourceManagerImpl ( ) { <nl> / / need explicit delete , before engine get killed <nl> delete cpu_rand_ ; <nl> # if MXNET_USE_CUDA <nl> class ResourceManagerImpl : public ResourceManager { <nl> resource . ptr_ = prnd ; <nl> resource . req = ResourceRequest ( ResourceRequest : : kRandom ) ; <nl> } <nl> - ~ ResourceRandom ( ) noexcept ( false ) { <nl> + ~ ResourceRandom ( ) { <nl> mshadow : : Random < xpu > * r = prnd ; <nl> Engine : : Get ( ) - > DeleteVariable ( <nl> [ r ] ( RunContext rctx ) { delete r ; } , ctx , resource . var ) ; <nl> ResourceManager * ResourceManager : : Get ( ) { <nl> static resource : : ResourceManagerImpl inst ; <nl> return & inst ; <nl> } <nl> - } / / namespace mxnetf <nl> + } / / namespace mxnet <nl> new file mode 100644 <nl> index 00000000000 . . 10be569e8f7 <nl> mmm / dev / null <nl> ppp b / tests / python / unittest / test_random . py <nl> <nl> + import os <nl> + import mxnet as mx <nl> + import numpy as np <nl> + <nl> + def same ( a , b ) : <nl> + return np . sum ( a ! = b ) = = 0 <nl> + <nl> + def check_with_device ( device ) : <nl> + with mx . Context ( device ) : <nl> + a , b = - 10 , 10 <nl> + mu , sigma = 10 , 2 <nl> + shape = ( 100 , 100 ) <nl> + mx . random . seed ( 128 ) <nl> + ret1 = mx . random . normal ( mu , sigma , shape ) <nl> + un1 = mx . random . uniform ( a , b , shape ) <nl> + mx . random . seed ( 128 ) <nl> + ret2 = mx . random . normal ( mu , sigma , shape ) <nl> + un2 = mx . random . uniform ( a , b , shape ) <nl> + assert same ( ret1 . asnumpy ( ) , ret2 . asnumpy ( ) ) <nl> + assert same ( un1 . asnumpy ( ) , un2 . asnumpy ( ) ) <nl> + assert abs ( np . mean ( ret1 . asnumpy ( ) ) - mu ) < 0 . 1 <nl> + assert abs ( np . std ( ret1 . asnumpy ( ) ) - sigma ) < 0 . 1 <nl> + assert abs ( np . mean ( un1 . asnumpy ( ) ) - ( a + b ) / 2 ) < 0 . 1 <nl> + <nl> + <nl> + def test_random ( ) : <nl> + check_with_device ( mx . cpu ( ) ) <nl> + <nl> + <nl> + if __name__ = = ' __main__ ' : <nl> + test_random ( ) <nl> + <nl>
|
Add random generation engine .
|
apache/incubator-mxnet
|
262da66a755c7275e1d90e1720cdc4377c3b0633
|
2015-09-16T15:39:05Z
|
mmm a / tests / test_other . py <nl> ppp b / tests / test_other . py <nl> def test_build_error_color ( self ) : <nl> self . assertNotEqual ( returncode , 0 ) <nl> self . assertIn ( b " \ x1b [ 1msrc . c : 1 : 13 : \ x1b [ 0m \ x1b [ 0 ; 1 ; 31merror : \ x1b [ 0m \ x1b [ 1mexpected ' } ' \ x1b [ 0m " , output ) <nl> self . assertIn ( b " shared : ERROR : \ x1b [ 31mcompiler frontend failed to generate LLVM bitcode , halting \ x1b [ 0m \ r \ n " , output ) <nl> + <nl> + def test_llvm_includes ( self ) : <nl> + self . build ( ' # include < stdatomic . h > ' , self . get_dir ( ) , ' atomics . c ' ) <nl> mmm a / tools / shared . py <nl> ppp b / tools / shared . py <nl> def emsdk_opts ( ) : <nl> path_from_root ( ' system ' , ' lib ' , ' libcxxabi ' , ' include ' ) <nl> ] <nl> <nl> - c_opts = [ ' - nostdinc ' , ' - Xclang ' , ' - nobuiltininc ' , ' - Xclang ' , ' - nostdsysteminc ' ] <nl> + c_opts = [ ' - Xclang ' , ' - nostdsysteminc ' ] <nl> <nl> def include_directive ( paths ) : <nl> result = [ ] <nl>
|
Enable clang builtin include path with llvm backend ( )
|
emscripten-core/emscripten
|
150b9d67b1678d5cf7e7513040aaf1bc79a712e9
|
2019-06-18T17:21:08Z
|
new file mode 100644 <nl> index 00000000000 . . 5a12f7d5cc2 <nl> mmm / dev / null <nl> ppp b / tests / binaryen_2170_emscripten_atomic_cas_u8 . cpp <nl> <nl> + # include < emscripten / threading . h > <nl> + # include < stdio . h > <nl> + <nl> + int main ( int argc , char * argv [ ] ) <nl> + { <nl> + / / https : / / github . com / WebAssembly / binaryen / issues / 2170 <nl> + unsigned char obj = 10 ; <nl> + emscripten_atomic_cas_u8 ( & obj , 1 , 2 ) ; <nl> + printf ( " % d \ n " , ( int ) obj ) ; <nl> + emscripten_atomic_cas_u8 ( & obj , 10 , 2 ) ; <nl> + printf ( " % d \ n " , ( int ) obj ) ; <nl> + } <nl> new file mode 100644 <nl> index 00000000000 . . 77f4b16c342 <nl> mmm / dev / null <nl> ppp b / tests / binaryen_2170_emscripten_atomic_cas_u8 . txt <nl> <nl> + 10 <nl> + 2 <nl> mmm a / tests / test_core . py <nl> ppp b / tests / test_core . py <nl> def metafunc ( self , standalone ) : <nl> def node_pthreads ( f ) : <nl> def decorated ( self ) : <nl> self . set_setting ( ' USE_PTHREADS ' , 1 ) <nl> - if not self . is_wasm_backend ( ) : <nl> - self . skipTest ( ' node pthreads only supported on wasm backend ' ) <nl> if not self . get_setting ( ' WASM ' ) : <nl> self . skipTest ( " pthreads doesn ' t work in non - wasm yet " ) <nl> if ' - fsanitize = address ' in self . emcc_args : <nl> def test_binaryen_trap_mode ( self ) : <nl> ' allow ' : TRAP_OUTPUTS <nl> } [ mode ] , assert_returncode = None ) <nl> <nl> + @ node_pthreads <nl> + def test_binaryen_2170_emscripten_atomic_cas_u8 ( self ) : <nl> + self . emcc_args + = [ ' - s ' , ' USE_PTHREADS = 1 ' ] <nl> + self . do_run_in_out_file_test ( ' tests ' , ' binaryen_2170_emscripten_atomic_cas_u8 ' ) <nl> + <nl> @ also_with_standalone_wasm ( ) <nl> def test_sbrk ( self ) : <nl> self . do_run ( open ( path_from_root ( ' tests ' , ' sbrk_brk . cpp ' ) ) . read ( ) , ' OK . ' ) <nl> def test_fpic_static ( self ) : <nl> <nl> @ node_pthreads <nl> def test_pthreads_create ( self ) : <nl> + if not self . is_wasm_backend ( ) : <nl> + self . skipTest ( ' only supported on wasm backend ' ) <nl> + <nl> def test ( ) : <nl> self . do_run_in_out_file_test ( ' tests ' , ' core ' , ' pthread ' , ' create ' ) <nl> test ( ) <nl>
|
Add test for https : / / github . com / WebAssembly / binaryen / issues / 2170 . ( )
|
emscripten-core/emscripten
|
3a0e72919e52aad690856142ed6b7a77ba14a998
|
2020-06-17T16:08:24Z
|
mmm a / tensorflow / contrib / tensorrt / python / trt_convert . py <nl> ppp b / tensorflow / contrib / tensorrt / python / trt_convert . py <nl> <nl> from tensorflow . python . framework import meta_graph <nl> from tensorflow . python . framework import ops <nl> <nl> - <nl> + # TODO ( skama ) : get outputs from session when implemented as c + + <nl> + # optimization pass <nl> def CreateInferenceGraph ( input_graph_def , outputs , max_batch_size = 1 , max_workspace_size = 2 < < 20 ) : <nl> " " " Python wrapper for the TRT transormation . <nl> <nl>
|
Add TODO message
|
tensorflow/tensorflow
|
84cab7b04b178ed63c19c9d618926f09da327fd7
|
2018-01-30T01:34:07Z
|
mmm a / tensorflow / java / src / main / java / org / tensorflow / Tensor . java <nl> ppp b / tensorflow / java / src / main / java / org / tensorflow / Tensor . java <nl> <nl> import java . nio . IntBuffer ; <nl> import java . nio . LongBuffer ; <nl> import java . util . Arrays ; <nl> + import java . util . HashMap ; <nl> <nl> / * * <nl> * A typed multi - dimensional array . <nl> <nl> * using { @ link # create ( DataType , long [ ] , ByteBuffer ) } instead . <nl> * / <nl> public static Tensor create ( Object obj ) { <nl> + return create ( obj , dataTypeOf ( obj ) ) ; <nl> + } <nl> + <nl> + / * * <nl> + * Create a Tensor of data type { @ code dtype } from a Java object . <nl> + * <nl> + * @ param dtype the intended tensor data type . It must match the the run - time type of the object . <nl> + * / <nl> + static Tensor create ( Object obj , DataType dtype ) { <nl> Tensor t = new Tensor ( ) ; <nl> - t . dtype = dataTypeOf ( obj ) ; <nl> - t . shapeCopy = new long [ numDimensions ( obj ) ] ; <nl> + t . dtype = dtype ; <nl> + t . shapeCopy = new long [ numDimensions ( obj , dtype ) ] ; <nl> + assert objectCompatWithType ( obj , dtype ) ; <nl> fillShape ( obj , 0 , t . shapeCopy ) ; <nl> if ( t . dtype ! = DataType . STRING ) { <nl> int byteSize = elemByteSize ( t . dtype ) * numElements ( t . shapeCopy ) ; <nl> public static Tensor create ( long [ ] shape , LongBuffer data ) { <nl> * <nl> * < p > Creates a Tensor with the provided shape of any type where the tensor ' s data has been <nl> * encoded into { @ code data } as per the specification of the TensorFlow < a <nl> - * href = " https : / / www . tensorflow . org / code / tensorflow / c / c_api . h " > C <nl> - * API < / a > . <nl> + * href = " https : / / www . tensorflow . org / code / tensorflow / c / c_api . h " > C API < / a > . <nl> * <nl> * @ param dataType the tensor datatype . <nl> * @ param shape the tensor shape . <nl> private static void throwExceptionIfNotByteOfByteArrays ( Object array ) { <nl> } <nl> } <nl> <nl> + private static HashMap < Class < ? > , DataType > classDataTypes = new HashMap < > ( ) ; <nl> + <nl> + static { <nl> + classDataTypes . put ( int . class , DataType . INT32 ) ; <nl> + classDataTypes . put ( Integer . class , DataType . INT32 ) ; <nl> + classDataTypes . put ( long . class , DataType . INT64 ) ; <nl> + classDataTypes . put ( Long . class , DataType . INT64 ) ; <nl> + classDataTypes . put ( float . class , DataType . FLOAT ) ; <nl> + classDataTypes . put ( Float . class , DataType . FLOAT ) ; <nl> + classDataTypes . put ( double . class , DataType . DOUBLE ) ; <nl> + classDataTypes . put ( Double . class , DataType . DOUBLE ) ; <nl> + classDataTypes . put ( byte . class , DataType . STRING ) ; <nl> + classDataTypes . put ( Byte . class , DataType . STRING ) ; <nl> + classDataTypes . put ( boolean . class , DataType . BOOL ) ; <nl> + classDataTypes . put ( Boolean . class , DataType . BOOL ) ; <nl> + } <nl> + <nl> private static DataType dataTypeOf ( Object o ) { <nl> - if ( o . getClass ( ) . isArray ( ) ) { <nl> - if ( Array . getLength ( o ) = = 0 ) { <nl> - throw new IllegalArgumentException ( " cannot create Tensors with a 0 dimension " ) ; <nl> - } <nl> - / / byte [ ] is a DataType . STRING scalar . <nl> - Object e = Array . get ( o , 0 ) ; <nl> - if ( e = = null ) { <nl> - throwExceptionIfNotByteOfByteArrays ( o ) ; <nl> - return DataType . STRING ; <nl> - } <nl> - if ( Byte . class . isInstance ( e ) | | byte . class . isInstance ( e ) ) { <nl> - return DataType . STRING ; <nl> - } <nl> - return dataTypeOf ( e ) ; <nl> + Class < ? > c = o . getClass ( ) ; <nl> + while ( c . isArray ( ) ) { <nl> + c = c . getComponentType ( ) ; <nl> } <nl> - if ( Float . class . isInstance ( o ) | | float . class . isInstance ( o ) ) { <nl> - return DataType . FLOAT ; <nl> - } else if ( Double . class . isInstance ( o ) | | double . class . isInstance ( o ) ) { <nl> - return DataType . DOUBLE ; <nl> - } else if ( Integer . class . isInstance ( o ) | | int . class . isInstance ( o ) ) { <nl> - return DataType . INT32 ; <nl> - } else if ( Long . class . isInstance ( o ) | | long . class . isInstance ( o ) ) { <nl> - return DataType . INT64 ; <nl> - } else if ( Boolean . class . isInstance ( o ) | | boolean . class . isInstance ( o ) ) { <nl> - return DataType . BOOL ; <nl> - } else { <nl> - throw new IllegalArgumentException ( " cannot create Tensors of " + o . getClass ( ) . getName ( ) ) ; <nl> + DataType ret = classDataTypes . get ( c ) ; <nl> + if ( ret ! = null ) { <nl> + return ret ; <nl> } <nl> + throw new IllegalArgumentException ( " cannot create Tensors of type " + c . getName ( ) ) ; <nl> } <nl> <nl> - private static int numDimensions ( Object o ) { <nl> - if ( o . getClass ( ) . isArray ( ) ) { <nl> - Object e = Array . get ( o , 0 ) ; <nl> - if ( e = = null ) { <nl> - throwExceptionIfNotByteOfByteArrays ( o ) ; <nl> - return 1 ; <nl> - } else if ( Byte . class . isInstance ( e ) | | byte . class . isInstance ( e ) ) { <nl> - return 0 ; <nl> - } <nl> - return 1 + numDimensions ( e ) ; <nl> + / * * <nl> + * Returns the number of dimensions of a tensor of type dtype when represented by the object o . <nl> + * / <nl> + private static int numDimensions ( Object o , DataType dtype ) { <nl> + int ret = numArrayDimensions ( o ) ; <nl> + if ( dtype = = DataType . STRING & & ret > 0 ) { <nl> + return ret - 1 ; <nl> } <nl> - return 0 ; <nl> + return ret ; <nl> } <nl> <nl> + / * * Returns the number of dimensions of the array object o . Returns 0 if o is not an array . * / <nl> + private static int numArrayDimensions ( Object o ) { <nl> + Class < ? > c = o . getClass ( ) ; <nl> + int i = 0 ; <nl> + while ( c . isArray ( ) ) { <nl> + c = c . getComponentType ( ) ; <nl> + i + + ; <nl> + } <nl> + return i ; <nl> + } <nl> + <nl> + / * * <nl> + * Fills in the remaining entries in the shape array starting from position { @ code dim } with the <nl> + * dimension sizes of the multidimensional array o . Checks that all arrays reachable from o have <nl> + * sizes consistent with the filled - in shape , throwing IllegalArgumentException otherwise . <nl> + * / <nl> private static void fillShape ( Object o , int dim , long [ ] shape ) { <nl> if ( shape = = null | | dim = = shape . length ) { <nl> return ; <nl> } <nl> final int len = Array . getLength ( o ) ; <nl> + if ( len = = 0 ) { <nl> + throw new IllegalArgumentException ( " cannot create Tensors with a 0 dimension " ) ; <nl> + } <nl> if ( shape [ dim ] = = 0 ) { <nl> shape [ dim ] = len ; <nl> } else if ( shape [ dim ] ! = len ) { <nl> private static void fillShape ( Object o , int dim , long [ ] shape ) { <nl> } <nl> } <nl> <nl> + / * * Returns whether the object { @ code obj } can represent a tensor with data type { @ code dtype } . * / <nl> + private static boolean objectCompatWithType ( Object obj , DataType dtype ) { <nl> + DataType dto = dataTypeOf ( obj ) ; <nl> + if ( dto . equals ( dtype ) ) { <nl> + return true ; <nl> + } <nl> + if ( dto = = DataType . STRING & & dtype = = DataType . UINT8 ) { <nl> + return true ; <nl> + } <nl> + return false ; <nl> + } <nl> + <nl> private void throwExceptionIfTypeIsIncompatible ( Object o ) { <nl> final int rank = numDimensions ( ) ; <nl> - final int oRank = numDimensions ( o ) ; <nl> + final int oRank = numDimensions ( o , dtype ) ; <nl> if ( oRank ! = rank ) { <nl> throw new IllegalArgumentException ( <nl> String . format ( <nl> " cannot copy Tensor with % d dimensions into an object with % d " , rank , oRank ) ) ; <nl> } <nl> - if ( dataTypeOf ( o ) ! = dtype ) { <nl> + if ( ! objectCompatWithType ( o , dtype ) ) { <nl> throw new IllegalArgumentException ( <nl> String . format ( <nl> " cannot copy Tensor with DataType % s into an object of type % s " , <nl> mmm a / tensorflow / java / src / test / java / org / tensorflow / TensorTest . java <nl> ppp b / tensorflow / java / src / test / java / org / tensorflow / TensorTest . java <nl> public void testNDimensionalStringTensor ( ) { <nl> } <nl> } <nl> <nl> + @ Test <nl> + public void testUInt8Tensor ( ) { <nl> + byte [ ] vector = new byte [ ] { 1 , 2 , 3 , 4 } ; <nl> + try ( Tensor t = Tensor . create ( vector , DataType . UINT8 ) ) { <nl> + assertEquals ( DataType . UINT8 , t . dataType ( ) ) ; <nl> + assertEquals ( 1 , t . numDimensions ( ) ) ; <nl> + assertArrayEquals ( new long [ ] { 4 } , t . shape ( ) ) ; <nl> + <nl> + byte [ ] got = t . copyTo ( new byte [ 4 ] ) ; <nl> + assertArrayEquals ( got , vector ) ; <nl> + } <nl> + } <nl> + <nl> @ Test <nl> public void failCreateOnMismatchedDimensions ( ) { <nl> int [ ] [ ] [ ] invalid = new int [ 3 ] [ 1 ] [ ] ; <nl>
|
Improvements to Java API handling of datatypes and arrays ( )
|
tensorflow/tensorflow
|
2d269cdfb09cc2e715fcc6b624bfbb16a6b53ccc
|
2017-09-13T22:18:22Z
|
mmm a / src / library_gl . js <nl> ppp b / src / library_gl . js <nl> var LibraryGL = { <nl> <nl> autoAddDeps ( LibraryGL , ' $ GL ' ) ; <nl> <nl> - / / Emulation requires everything else , potentially <nl> - LibraryGL . $ GLEmulation__deps = LibraryGL . $ GLEmulation__deps . slice ( 0 ) ; / / the __deps object is shared <nl> - var glFuncs = [ ] ; <nl> - for ( var item in LibraryGL ) { <nl> - if ( item ! = ' $ GLEmulation ' & & item . substr ( - 6 ) ! = ' __deps ' & & item . substr ( - 9 ) ! = ' __postset ' & & item . substr ( - 5 ) ! = ' __sig ' & & item . substr ( 0 , 2 ) = = ' gl ' ) { <nl> - glFuncs . push ( item ) ; <nl> - } <nl> - } <nl> - LibraryGL . $ GLEmulation__deps = LibraryGL . $ GLEmulation__deps . concat ( glFuncs ) ; <nl> - LibraryGL . $ GLEmulation__deps . push ( function ( ) { <nl> - for ( var func in Functions . getIndex . tentative ) { <nl> - Functions . getIndex ( func ) ; <nl> - Functions . unimplementedFunctions [ func ] = LibraryGL [ func . substr ( 1 ) + ' __sig ' ] ; <nl> + if ( DISABLE_GL_EMULATION ) { <nl> + delete LibraryGL . $ GLEmulation ; <nl> + } else { <nl> + / / Emulation requires everything else , potentially <nl> + LibraryGL . $ GLEmulation__deps = LibraryGL . $ GLEmulation__deps . slice ( 0 ) ; / / the __deps object is shared <nl> + var glFuncs = [ ] ; <nl> + for ( var item in LibraryGL ) { <nl> + if ( item ! = ' $ GLEmulation ' & & item . substr ( - 6 ) ! = ' __deps ' & & item . substr ( - 9 ) ! = ' __postset ' & & item . substr ( - 5 ) ! = ' __sig ' & & item . substr ( 0 , 2 ) = = ' gl ' ) { <nl> + glFuncs . push ( item ) ; <nl> + } <nl> } <nl> - } ) ; <nl> + LibraryGL . $ GLEmulation__deps = LibraryGL . $ GLEmulation__deps . concat ( glFuncs ) ; <nl> + LibraryGL . $ GLEmulation__deps . push ( function ( ) { <nl> + for ( var func in Functions . getIndex . tentative ) { <nl> + Functions . getIndex ( func ) ; <nl> + Functions . unimplementedFunctions [ func ] = LibraryGL [ func . substr ( 1 ) + ' __sig ' ] ; <nl> + } <nl> + } ) ; <nl> <nl> - if ( FORCE_GL_EMULATION ) { <nl> - LibraryGL . glDrawElements__deps = LibraryGL . glDrawElements__deps . concat ( ' $ GLEmulation ' ) ; <nl> - LibraryGL . glDrawArrays__deps = LibraryGL . glDrawArrays__deps . concat ( ' $ GLEmulation ' ) ; <nl> + if ( FORCE_GL_EMULATION ) { <nl> + LibraryGL . glDrawElements__deps = LibraryGL . glDrawElements__deps . concat ( ' $ GLEmulation ' ) ; <nl> + LibraryGL . glDrawArrays__deps = LibraryGL . glDrawArrays__deps . concat ( ' $ GLEmulation ' ) ; <nl> + } <nl> } <nl> <nl> mergeInto ( LibraryManager . library , LibraryGL ) ; <nl> mmm a / src / settings . js <nl> ppp b / src / settings . js <nl> var GL_MAX_TEMP_BUFFER_SIZE = 2097152 ; / / How large GL emulation temp buffers ar <nl> var GL_UNSAFE_OPTS = 1 ; / / Enables some potentially - unsafe optimizations in GL emulation code <nl> var FULL_ES2 = 0 ; / / Forces support for all GLES2 features , not just the WebGL - friendly subset . <nl> var FORCE_GL_EMULATION = 0 ; / / Forces inclusion of full GL emulation code . <nl> + var DISABLE_GL_EMULATION = 0 ; / / Disable inclusion of full GL emulation code . Useful when you don ' t want emulation <nl> + / / but do need INCLUDE_FULL_LIBRARY or MAIN_MODULE . <nl> <nl> var DISABLE_EXCEPTION_CATCHING = 0 ; / / Disables generating code to actually catch exceptions . If the code you <nl> / / are compiling does not actually rely on catching exceptions ( but the <nl> mmm a / tests / runner . py <nl> ppp b / tests / runner . py <nl> def test_l_link ( self ) : <nl> self . assertContained ( ' hello from lib ' , run_js ( os . path . join ( self . get_dir ( ) , ' a . out . js ' ) ) ) <nl> assert not os . path . exists ( ' a . out ' ) and not os . path . exists ( ' a . exe ' ) , ' Must not leave unneeded linker stubs ' <nl> <nl> - def zzztest_static_link ( self ) : <nl> + def test_static_link ( self ) : <nl> open ( os . path . join ( self . get_dir ( ) , ' main . cpp ' ) , ' w ' ) . write ( ' ' ' <nl> extern void printey ( ) ; <nl> int main ( ) { <nl> def zzztest_static_link ( self ) : <nl> } <nl> ' ' ' ) <nl> Popen ( [ PYTHON , EMCC , os . path . join ( self . get_dir ( ) , ' lib . cpp ' ) , ' - o ' , ' lib . js ' , ' - s ' , ' SIDE_MODULE = 1 ' , ' - O2 ' ] ) . communicate ( ) <nl> - Popen ( [ PYTHON , EMCC , os . path . join ( self . get_dir ( ) , ' main . cpp ' ) , ' - o ' , ' main . js ' , ' - s ' , ' MAIN_MODULE = 1 ' , ' - O2 ' ] ) . communicate ( ) <nl> + Popen ( [ PYTHON , EMCC , os . path . join ( self . get_dir ( ) , ' main . cpp ' ) , ' - o ' , ' main . js ' , ' - s ' , ' MAIN_MODULE = 1 ' , ' - O2 ' , ' - s ' , ' DISABLE_GL_EMULATION = 1 ' ] ) . communicate ( ) <nl> Popen ( [ PYTHON , EMLINK , ' main . js ' , ' lib . js ' , ' together . js ' ] ) <nl> self . assertContained ( ' hello from lib ' , run_js ( ' together . js ' ) ) <nl> <nl>
|
DISABLE_GL_EMULATION option
|
emscripten-core/emscripten
|
190b20e6088000640788bc5c8d0a7e6fc95c1c2d
|
2013-07-03T22:31:02Z
|
mmm a / npm / package . json <nl> ppp b / npm / package . json <nl> <nl> " types " : " electron . d . ts " , <nl> " dependencies " : { <nl> " @ types / node " : " ^ 8 . 0 . 24 " , <nl> - " electron - download " : " ^ 3 . 0 . 1 " , <nl> + " electron - download " : " ^ 4 . 1 . 0 " , <nl> " extract - zip " : " ^ 1 . 0 . 3 " <nl> } , <nl> " devDependencies " : { <nl> <nl> } , <nl> " directories " : { <nl> " test " : " test " <nl> + } , <nl> + " engines " : { <nl> + " node " : " > = 4 . 0 " <nl> } <nl> } <nl>
|
Merge pull request from electron / electron - download - 4 . x
|
electron/electron
|
7177e941eb01b5646f4356797ab2ed22b8f6b8f5
|
2018-05-18T11:20:42Z
|
mmm a / libraries / testing / include / eosio / testing / tester . hpp <nl> ppp b / libraries / testing / include / eosio / testing / tester . hpp <nl> namespace eosio { namespace testing { <nl> vcfg . blocks_dir = tempdir . path ( ) / std : : string ( " v_ " ) . append ( config : : default_blocks_dir_name ) ; <nl> vcfg . state_dir = tempdir . path ( ) / std : : string ( " v_ " ) . append ( config : : default_state_dir_name ) ; <nl> vcfg . state_size = 1024 * 1024 * 8 ; <nl> + vcfg . state_guard_size = 0 ; <nl> vcfg . reversible_cache_size = 1024 * 1024 * 8 ; <nl> + vcfg . reversible_guard_size = 0 ; <nl> vcfg . contracts_console = false ; <nl> <nl> vcfg . genesis . initial_timestamp = fc : : time_point : : from_iso_string ( " 2020 - 01 - 01T00 : 00 : 00 . 000 " ) ; <nl>
|
fix guards for testing library redux
|
EOSIO/eos
|
f494782b2d83dabaa628d62ef083b68590bbac8c
|
2018-07-16T23:40:51Z
|
mmm a / platform / osx / SCsub <nl> ppp b / platform / osx / SCsub <nl> files = [ <nl> ' audio_driver_osx . cpp ' , <nl> ' sem_osx . cpp ' , <nl> # ' context_gl_osx . cpp ' , <nl> + ' dir_access_osx . mm ' , <nl> ] <nl> <nl> env . Program ( ' # bin / godot ' , files ) <nl> new file mode 100644 <nl> index 00000000000 . . abd66cbba8c <nl> mmm / dev / null <nl> ppp b / platform / osx / dir_access_osx . h <nl> <nl> + / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + / * dir_access_unix . h * / <nl> + / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + / * This file is part of : * / <nl> + / * GODOT ENGINE * / <nl> + / * http : / / www . godotengine . org * / <nl> + / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + / * Copyright ( c ) 2007 - 2015 Juan Linietsky , Ariel Manzur . * / <nl> + / * * / <nl> + / * Permission is hereby granted , free of charge , to any person obtaining * / <nl> + / * a copy of this software and associated documentation files ( the * / <nl> + / * " Software " ) , to deal in the Software without restriction , including * / <nl> + / * without limitation the rights to use , copy , modify , merge , publish , * / <nl> + / * distribute , sublicense , and / or sell copies of the Software , and to * / <nl> + / * permit persons to whom the Software is furnished to do so , subject to * / <nl> + / * the following conditions : * / <nl> + / * * / <nl> + / * The above copyright notice and this permission notice shall be * / <nl> + / * included in all copies or substantial portions of the Software . * / <nl> + / * * / <nl> + / * THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , * / <nl> + / * EXPRESS OR IMPLIED , INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * / <nl> + / * MERCHANTABILITY , FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT . * / <nl> + / * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * / <nl> + / * CLAIM , DAMAGES OR OTHER LIABILITY , WHETHER IN AN ACTION OF CONTRACT , * / <nl> + / * TORT OR OTHERWISE , ARISING FROM , OUT OF OR IN CONNECTION WITH THE * / <nl> + / * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE . * / <nl> + / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + # ifndef DIR_ACCESS_OSX_H <nl> + # define DIR_ACCESS_OSX_H <nl> + <nl> + # if defined ( UNIX_ENABLED ) | | defined ( LIBC_FILEIO_ENABLED ) <nl> + <nl> + # include < sys / types . h > <nl> + # include < sys / stat . h > <nl> + # include < unistd . h > <nl> + # include < dirent . h > <nl> + <nl> + # include " os / dir_access . h " <nl> + <nl> + <nl> + / * * <nl> + @ author Juan Linietsky < reduzio @ gmail . com > <nl> + * / <nl> + class DirAccessOSX : public DirAccess { <nl> + <nl> + DIR * dir_stream ; <nl> + <nl> + static DirAccess * create_fs ( ) ; <nl> + <nl> + String current_dir ; <nl> + bool _cisdir ; <nl> + bool _cishidden ; <nl> + <nl> + public : <nl> + <nl> + virtual bool list_dir_begin ( ) ; / / / < This starts dir listing <nl> + virtual String get_next ( ) ; <nl> + virtual bool current_is_dir ( ) const ; <nl> + virtual bool current_is_hidden ( ) const ; <nl> + <nl> + virtual void list_dir_end ( ) ; / / / < <nl> + <nl> + virtual int get_drive_count ( ) ; <nl> + virtual String get_drive ( int p_drive ) ; <nl> + <nl> + virtual Error change_dir ( String p_dir ) ; / / / < can be relative or absolute , return false on success <nl> + virtual String get_current_dir ( ) ; / / / < return current dir location <nl> + virtual Error make_dir ( String p_dir ) ; <nl> + <nl> + virtual bool file_exists ( String p_file ) ; <nl> + virtual bool dir_exists ( String p_dir ) ; <nl> + <nl> + virtual uint64_t get_modified_time ( String p_file ) ; <nl> + <nl> + <nl> + <nl> + virtual Error rename ( String p_from , String p_to ) ; <nl> + virtual Error remove ( String p_name ) ; <nl> + <nl> + virtual size_t get_space_left ( ) ; <nl> + <nl> + <nl> + DirAccessOSX ( ) ; <nl> + ~ DirAccessOSX ( ) ; <nl> + <nl> + } ; <nl> + <nl> + <nl> + <nl> + # endif / / UNIX ENABLED <nl> + # endif <nl> new file mode 100644 <nl> index 00000000000 . . cc7db44929a <nl> mmm / dev / null <nl> ppp b / platform / osx / dir_access_osx . mm <nl> <nl> + / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + / * dir_access_unix . cpp * / <nl> + / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + / * This file is part of : * / <nl> + / * GODOT ENGINE * / <nl> + / * http : / / www . godotengine . org * / <nl> + / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + / * Copyright ( c ) 2007 - 2015 Juan Linietsky , Ariel Manzur . * / <nl> + / * * / <nl> + / * Permission is hereby granted , free of charge , to any person obtaining * / <nl> + / * a copy of this software and associated documentation files ( the * / <nl> + / * " Software " ) , to deal in the Software without restriction , including * / <nl> + / * without limitation the rights to use , copy , modify , merge , publish , * / <nl> + / * distribute , sublicense , and / or sell copies of the Software , and to * / <nl> + / * permit persons to whom the Software is furnished to do so , subject to * / <nl> + / * the following conditions : * / <nl> + / * * / <nl> + / * The above copyright notice and this permission notice shall be * / <nl> + / * included in all copies or substantial portions of the Software . * / <nl> + / * * / <nl> + / * THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , * / <nl> + / * EXPRESS OR IMPLIED , INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * / <nl> + / * MERCHANTABILITY , FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT . * / <nl> + / * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * / <nl> + / * CLAIM , DAMAGES OR OTHER LIABILITY , WHETHER IN AN ACTION OF CONTRACT , * / <nl> + / * TORT OR OTHERWISE , ARISING FROM , OUT OF OR IN CONNECTION WITH THE * / <nl> + / * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE . * / <nl> + / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + # include " dir_access_osx . h " <nl> + <nl> + # if defined ( UNIX_ENABLED ) | | defined ( LIBC_FILEIO_ENABLED ) <nl> + <nl> + # ifndef ANDROID_ENABLED <nl> + # include < sys / statvfs . h > <nl> + # endif <nl> + <nl> + # include < stdio . h > <nl> + # include " os / memory . h " <nl> + # include " print_string . h " <nl> + # include < errno . h > <nl> + <nl> + # include < Foundation / NSString . h > <nl> + <nl> + DirAccess * DirAccessOSX : : create_fs ( ) { <nl> + <nl> + return memnew ( DirAccessOSX ) ; <nl> + } <nl> + <nl> + bool DirAccessOSX : : list_dir_begin ( ) { <nl> + <nl> + list_dir_end ( ) ; / / close any previous dir opening ! <nl> + <nl> + <nl> + / / char real_current_dir_name [ 2048 ] ; / / is this enough ? ! <nl> + / / getcwd ( real_current_dir_name , 2048 ) ; <nl> + / / chdir ( curent_path . utf8 ( ) . get_data ( ) ) ; <nl> + dir_stream = opendir ( current_dir . utf8 ( ) . get_data ( ) ) ; <nl> + / / chdir ( real_current_dir_name ) ; <nl> + if ( ! dir_stream ) <nl> + return true ; / / error ! <nl> + <nl> + return false ; <nl> + } <nl> + <nl> + bool DirAccessOSX : : file_exists ( String p_file ) { <nl> + <nl> + GLOBAL_LOCK_FUNCTION <nl> + <nl> + <nl> + if ( p_file . is_rel_path ( ) ) <nl> + p_file = current_dir + " / " + p_file ; <nl> + else <nl> + p_file = fix_path ( p_file ) ; <nl> + <nl> + struct stat flags ; <nl> + bool success = ( stat ( p_file . utf8 ( ) . get_data ( ) , & flags ) = = 0 ) ; <nl> + <nl> + if ( success & & S_ISDIR ( flags . st_mode ) ) { <nl> + success = false ; <nl> + } <nl> + <nl> + return success ; <nl> + <nl> + } <nl> + <nl> + bool DirAccessOSX : : dir_exists ( String p_dir ) { <nl> + <nl> + GLOBAL_LOCK_FUNCTION <nl> + <nl> + <nl> + if ( p_dir . is_rel_path ( ) ) <nl> + p_dir = get_current_dir ( ) . plus_file ( p_dir ) ; <nl> + else <nl> + p_dir = fix_path ( p_dir ) ; <nl> + <nl> + struct stat flags ; <nl> + bool success = ( stat ( p_dir . utf8 ( ) . get_data ( ) , & flags ) = = 0 ) ; <nl> + <nl> + if ( success & & S_ISDIR ( flags . st_mode ) ) <nl> + return true ; <nl> + <nl> + return false ; <nl> + <nl> + } <nl> + <nl> + uint64_t DirAccessOSX : : get_modified_time ( String p_file ) { <nl> + <nl> + if ( p_file . is_rel_path ( ) ) <nl> + p_file = current_dir + " / " + p_file ; <nl> + else <nl> + p_file = fix_path ( p_file ) ; <nl> + <nl> + struct stat flags ; <nl> + bool success = ( stat ( p_file . utf8 ( ) . get_data ( ) , & flags ) = = 0 ) ; <nl> + <nl> + if ( success ) { <nl> + return flags . st_mtime ; <nl> + } else { <nl> + <nl> + ERR_FAIL_V ( 0 ) ; <nl> + } ; <nl> + return 0 ; <nl> + } ; <nl> + <nl> + <nl> + String DirAccessOSX : : get_next ( ) { <nl> + <nl> + if ( ! dir_stream ) <nl> + return " " ; <nl> + dirent * entry ; <nl> + <nl> + entry = readdir ( dir_stream ) ; <nl> + <nl> + if ( entry = = NULL ) { <nl> + <nl> + list_dir_end ( ) ; <nl> + return " " ; <nl> + } <nl> + <nl> + / / typedef struct stat Stat ; <nl> + struct stat flags ; <nl> + <nl> + String fname ; <nl> + NSString * nsstr = [ [ NSString stringWithUTF8String : entry - > d_name ] precomposedStringWithCanonicalMapping ] ; <nl> + <nl> + fname . parse_utf8 ( [ nsstr UTF8String ] ) ; <nl> + <nl> + / / [ nsstr autorelease ] ; <nl> + <nl> + String f = current_dir + " / " + fname ; <nl> + <nl> + if ( stat ( f . utf8 ( ) . get_data ( ) , & flags ) = = 0 ) { <nl> + <nl> + if ( S_ISDIR ( flags . st_mode ) ) { <nl> + <nl> + _cisdir = true ; <nl> + <nl> + } else { <nl> + <nl> + _cisdir = false ; <nl> + } <nl> + <nl> + } else { <nl> + <nl> + _cisdir = false ; <nl> + <nl> + } <nl> + <nl> + _cishidden = ( fname ! = " . " & & fname ! = " . . " & & fname . begins_with ( " . " ) ) ; <nl> + <nl> + <nl> + <nl> + return fname ; <nl> + <nl> + } <nl> + <nl> + bool DirAccessOSX : : current_is_dir ( ) const { <nl> + <nl> + return _cisdir ; <nl> + } <nl> + <nl> + bool DirAccessOSX : : current_is_hidden ( ) const { <nl> + <nl> + return _cishidden ; <nl> + } <nl> + <nl> + <nl> + void DirAccessOSX : : list_dir_end ( ) { <nl> + <nl> + if ( dir_stream ) <nl> + closedir ( dir_stream ) ; <nl> + dir_stream = 0 ; <nl> + _cisdir = false ; <nl> + } <nl> + <nl> + int DirAccessOSX : : get_drive_count ( ) { <nl> + <nl> + return 0 ; <nl> + } <nl> + String DirAccessOSX : : get_drive ( int p_drive ) { <nl> + <nl> + return " " ; <nl> + } <nl> + <nl> + Error DirAccessOSX : : make_dir ( String p_dir ) { <nl> + <nl> + GLOBAL_LOCK_FUNCTION <nl> + <nl> + p_dir = fix_path ( p_dir ) ; <nl> + <nl> + char real_current_dir_name [ 2048 ] ; <nl> + getcwd ( real_current_dir_name , 2048 ) ; <nl> + chdir ( current_dir . utf8 ( ) . get_data ( ) ) ; / / ascii since this may be unicode or wathever the host os wants <nl> + <nl> + bool success = ( mkdir ( p_dir . utf8 ( ) . get_data ( ) , S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH ) = = 0 ) ; <nl> + int err = errno ; <nl> + <nl> + chdir ( real_current_dir_name ) ; <nl> + <nl> + if ( success ) { <nl> + return OK ; <nl> + } ; <nl> + <nl> + if ( err = = EEXIST ) { <nl> + return ERR_ALREADY_EXISTS ; <nl> + } ; <nl> + <nl> + return ERR_CANT_CREATE ; <nl> + } <nl> + <nl> + <nl> + Error DirAccessOSX : : change_dir ( String p_dir ) { <nl> + <nl> + GLOBAL_LOCK_FUNCTION <nl> + p_dir = fix_path ( p_dir ) ; <nl> + <nl> + <nl> + char real_current_dir_name [ 2048 ] ; <nl> + getcwd ( real_current_dir_name , 2048 ) ; <nl> + String prev_dir ; <nl> + if ( prev_dir . parse_utf8 ( real_current_dir_name ) ) <nl> + prev_dir = real_current_dir_name ; / / no utf8 , maybe latin ? <nl> + <nl> + chdir ( current_dir . utf8 ( ) . get_data ( ) ) ; / / ascii since this may be unicode or wathever the host os wants <nl> + bool worked = ( chdir ( p_dir . utf8 ( ) . get_data ( ) ) = = 0 ) ; / / we can only give this utf8 <nl> + # ifndef IPHONE_ENABLED <nl> + String base = _get_root_path ( ) ; <nl> + if ( base ! = " " ) { <nl> + <nl> + getcwd ( real_current_dir_name , 2048 ) ; <nl> + String new_dir ; <nl> + new_dir . parse_utf8 ( real_current_dir_name ) ; <nl> + if ( ! new_dir . begins_with ( base ) ) <nl> + worked = false ; <nl> + } <nl> + # endif <nl> + if ( worked ) { <nl> + <nl> + getcwd ( real_current_dir_name , 2048 ) ; <nl> + if ( current_dir . parse_utf8 ( real_current_dir_name ) ) <nl> + current_dir = real_current_dir_name ; / / no utf8 , maybe latin ? <nl> + } <nl> + <nl> + chdir ( prev_dir . utf8 ( ) . get_data ( ) ) ; <nl> + return worked ? OK : ERR_INVALID_PARAMETER ; <nl> + <nl> + } <nl> + <nl> + String DirAccessOSX : : get_current_dir ( ) { <nl> + <nl> + String base = _get_root_path ( ) ; <nl> + if ( base ! = " " ) { <nl> + <nl> + String bd = current_dir . replace_first ( base , " " ) ; <nl> + if ( bd . begins_with ( " / " ) ) <nl> + return _get_root_string ( ) + bd . substr ( 1 , bd . length ( ) ) ; <nl> + else <nl> + return _get_root_string ( ) + bd ; <nl> + <nl> + } <nl> + return current_dir ; <nl> + } <nl> + <nl> + Error DirAccessOSX : : rename ( String p_path , String p_new_path ) { <nl> + <nl> + if ( p_path . is_rel_path ( ) ) <nl> + p_path = get_current_dir ( ) . plus_file ( p_path ) ; <nl> + else <nl> + p_path = fix_path ( p_path ) ; <nl> + <nl> + if ( p_new_path . is_rel_path ( ) ) <nl> + p_new_path = get_current_dir ( ) . plus_file ( p_new_path ) ; <nl> + else <nl> + p_new_path = fix_path ( p_new_path ) ; <nl> + <nl> + return : : rename ( p_path . utf8 ( ) . get_data ( ) , p_new_path . utf8 ( ) . get_data ( ) ) = = 0 ? OK : FAILED ; <nl> + } <nl> + Error DirAccessOSX : : remove ( String p_path ) { <nl> + <nl> + p_path = fix_path ( p_path ) ; <nl> + <nl> + struct stat flags ; <nl> + if ( ( stat ( p_path . utf8 ( ) . get_data ( ) , & flags ) ! = 0 ) ) <nl> + return FAILED ; <nl> + <nl> + if ( S_ISDIR ( flags . st_mode ) ) <nl> + return : : rmdir ( p_path . utf8 ( ) . get_data ( ) ) = = 0 ? OK : FAILED ; <nl> + else <nl> + return : : unlink ( p_path . utf8 ( ) . get_data ( ) ) = = 0 ? OK : FAILED ; <nl> + } <nl> + <nl> + <nl> + size_t DirAccessOSX : : get_space_left ( ) { <nl> + <nl> + # ifndef NO_STATVFS <nl> + struct statvfs vfs ; <nl> + if ( statvfs ( current_dir . utf8 ( ) . get_data ( ) , & vfs ) ! = 0 ) { <nl> + <nl> + return - 1 ; <nl> + } ; <nl> + <nl> + return vfs . f_bfree * vfs . f_bsize ; <nl> + # else <nl> + # warning THIS IS BROKEN <nl> + return 0 ; <nl> + # endif <nl> + } ; <nl> + <nl> + <nl> + <nl> + DirAccessOSX : : DirAccessOSX ( ) { <nl> + <nl> + dir_stream = 0 ; <nl> + current_dir = " . " ; <nl> + _cisdir = false ; <nl> + <nl> + / * determine drive count * / <nl> + <nl> + change_dir ( current_dir ) ; <nl> + <nl> + } <nl> + <nl> + <nl> + DirAccessOSX : : ~ DirAccessOSX ( ) { <nl> + <nl> + list_dir_end ( ) ; <nl> + } <nl> + <nl> + <nl> + # endif / / posix_enabled <nl> mmm a / platform / osx / os_osx . mm <nl> ppp b / platform / osx / os_osx . mm <nl> <nl> # include " servers / visual / visual_server_wrap_mt . h " <nl> # include " main / main . h " <nl> # include " os / keyboard . h " <nl> + # include " dir_access_osx . h " <nl> <nl> # include < sys / types . h > <nl> # include < sys / stat . h > <nl> - ( BOOL ) canBecomeKeyWindow <nl> OS : : VideoMode OS_OSX : : get_default_video_mode ( ) const { <nl> <nl> VideoMode vm ; <nl> - vm . width = 1280 ; <nl> - vm . height = 720 ; <nl> + vm . width = 800 ; <nl> + vm . height = 600 ; <nl> vm . fullscreen = false ; <nl> vm . resizable = true ; <nl> return vm ; <nl> - ( BOOL ) canBecomeKeyWindow <nl> void OS_OSX : : initialize_core ( ) { <nl> <nl> OS_Unix : : initialize_core ( ) ; <nl> + <nl> + DirAccess : : make_default < DirAccessOSX > ( DirAccess : : ACCESS_RESOURCES ) ; <nl> + DirAccess : : make_default < DirAccessOSX > ( DirAccess : : ACCESS_USERDATA ) ; <nl> + DirAccess : : make_default < DirAccessOSX > ( DirAccess : : ACCESS_FILESYSTEM ) ; <nl> + <nl> SemaphoreOSX : : make_default ( ) ; <nl> <nl> } <nl>
|
utf stuff on osx
|
godotengine/godot
|
c8077de71475c174aa14fd045a2cddfc28de2468
|
2015-12-14T01:21:49Z
|
mmm a / db / javajs . cpp <nl> ppp b / db / javajs . cpp <nl> jboolean JavaJSImpl : : scopeReset ( jlong id ) { <nl> } <nl> <nl> void JavaJSImpl : : scopeFree ( jlong id ) { <nl> - _getEnv ( ) - > CallStaticVoidMethod ( _dbhook , _scopeFree ) ; <nl> + _getEnv ( ) - > CallStaticVoidMethod ( _dbhook , _scopeFree , id ) ; <nl> } <nl> <nl> / / scope setters <nl>
|
$ where leak
|
mongodb/mongo
|
84e3a515b49873423d08db609a50099235361164
|
2008-09-10T01:51:27Z
|
mmm a / src / permutationSequence / permutationSequence . cpp <nl> ppp b / src / permutationSequence / permutationSequence . cpp <nl> string getPermutation ( int n , int k ) { <nl> ss < < num [ idx ] ; <nl> num . erase ( num . begin ( ) + idx ) ; <nl> n - - ; <nl> + / / the next k also can be caculated like this : <nl> + / / k = ( k - 1 ) % group + 1 ; <nl> k - = group * idx ; <nl> } <nl> <nl>
|
add some comments
|
haoel/leetcode
|
4cae32abc39e319c6bd1d9554c719e2acc79d188
|
2014-11-17T03:58:56Z
|
mmm a / modules / imgproc / src / opencl / cvtcolor . cl <nl> ppp b / modules / imgproc / src / opencl / cvtcolor . cl <nl> enum <nl> # define CAT ( x , y ) __CAT ( x , y ) <nl> <nl> # define DATA_TYPE_4 CAT ( DATA_TYPE , 4 ) <nl> + # define DATA_TYPE_3 CAT ( DATA_TYPE , 3 ) <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / RGB < - > GRAY / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> __kernel void RGB2Gray ( __global const uchar * srcptr , int src_step , int src_offs <nl> { <nl> __global const DATA_TYPE * src = ( __global const DATA_TYPE * ) ( srcptr + src_index ) ; <nl> __global DATA_TYPE * dst = ( __global DATA_TYPE * ) ( dstptr + dst_index ) ; <nl> - DATA_TYPE_4 src_pix = vload4 ( 0 , src ) ; <nl> + DATA_TYPE_3 src_pix = vload3 ( 0 , src ) ; <nl> # ifdef DEPTH_5 <nl> dst [ 0 ] = fma ( src_pix . B_COMP , B2YF , fma ( src_pix . G_COMP , G2YF , src_pix . R_COMP * R2YF ) ) ; <nl> # else <nl> __kernel void RGB2YUV ( __global const uchar * srcptr , int src_step , int src_offset <nl> { <nl> __global const DATA_TYPE * src = ( __global const DATA_TYPE * ) ( srcptr + src_index ) ; <nl> __global DATA_TYPE * dst = ( __global DATA_TYPE * ) ( dstptr + dst_index ) ; <nl> - DATA_TYPE_4 src_pix = vload4 ( 0 , src ) ; <nl> + DATA_TYPE_3 src_pix = vload3 ( 0 , src ) ; <nl> DATA_TYPE b = src_pix . B_COMP , g = src_pix . G_COMP , r = src_pix . R_COMP ; <nl> <nl> # ifdef DEPTH_5 <nl>
|
Merge pull request from alalek : ocl_fix_cvtcolor
|
opencv/opencv
|
6b1d9971f45aeca2cc93354f4576c918e29d5d77
|
2017-03-07T11:29:01Z
|
mmm a / Code / CryEngine / CryCommon / CryPhysics / physinterface . h <nl> ppp b / Code / CryEngine / CryCommon / CryPhysics / physinterface . h <nl> struct PhysicsVars : SolverSettings <nl> float breakageMinAxisInertia ; / / ! < For procedural breaking , each axis must have a minium inertia compared to the axis with the largest inertia ( 0 . 01 - 1 . 00 ) <nl> <nl> int bForceSyncPhysics ; <nl> + int idEntBreakOnAwake ; <nl> } ; <nl> <nl> struct ray_hit <nl> mmm a / Code / CryEngine / CryPhysics / physicalworld . cpp <nl> ppp b / Code / CryEngine / CryPhysics / physicalworld . cpp <nl> CPhysicalWorld : : CPhysicalWorld ( ILog * pLog ) : m_nWorkerThreads ( 0 ) <nl> 0 ; <nl> # endif <nl> m_vars . breakageMinAxisInertia = 0 . 01f ; <nl> + m_vars . idEntBreakOnAwake = - 1000 ; <nl> <nl> memset ( m_grpProfileData , 0 , sizeof ( m_grpProfileData ) ) ; <nl> m_grpProfileData [ 0 ] . pName = " Rigid bodies " ; <nl> mmm a / Code / CryEngine / CryPhysics / rigidentity . cpp <nl> ppp b / Code / CryEngine / CryPhysics / rigidentity . cpp <nl> int CRigidEntity : : Action ( pe_action * _action , int bThreadSafe ) <nl> <nl> if ( action - > iSource ! = 1 ) { <nl> m_bAwake = 1 ; <nl> + if ( m_pWorld - > m_vars . idEntBreakOnAwake = = m_id ) <nl> + DoBreak <nl> if ( m_iSimClass = = 1 ) { <nl> m_iSimClass = 2 ; m_pWorld - > RepositionEntity ( this , 2 ) ; <nl> } <nl> int CRigidEntity : : Awake ( int bAwake , int iSource ) <nl> { <nl> PREFAST_ASSUME ( m_pColliders [ i ] ) ; <nl> if ( m_pColliders [ i ] ! = this & & m_pColliders [ i ] - > GetMassInv ( ) > 0 ) <nl> - { <nl> m_pColliders [ i ] - > Awake ( ) ; <nl> - } <nl> } <nl> + if ( m_pWorld - > m_vars . idEntBreakOnAwake = = m_id ) <nl> + DoBreak <nl> } else <nl> m_bAwake = bAwake ; <nl> return m_iSimClass ; <nl> mmm a / Code / CryEngine / CrySystem / SystemInit . cpp <nl> ppp b / Code / CryEngine / CrySystem / SystemInit . cpp <nl> bool CSystem : : InitPhysics ( const SSystemInitParams & startupParams ) <nl> " Whether to use OBBs rather than AABBs for the entity grid setup for brushes " ) ; <nl> REGISTER_CVAR2 ( " p_num_startup_overload_checks " , & pVars - > nStartupOverloadChecks , pVars - > nStartupOverloadChecks , 0 , <nl> " For this many frames after loading a level , check if the physics gets overloaded and freezes non - player physicalized objects that are slow enough " ) ; <nl> + REGISTER_CVAR2 ( " p_break_on_awake_ent_id " , & pVars - > idEntBreakOnAwake , pVars - > idEntBreakOnAwake , 0 , <nl> + " Sets the id of the entity that will trigger debug break if awoken " ) ; <nl> <nl> pVars - > flagsColliderDebris = geom_colltype_debris ; <nl> pVars - > flagsANDDebris = ~ ( geom_colltype_vehicle | geom_colltype6 ) ; <nl>
|
! F ( Physics ) added cvar to debugbreak if a specific entity is awaken
|
CRYTEK/CRYENGINE
|
2d55fff66f890a1fdac3e705d881137033079068
|
2017-10-12T13:32:05Z
|
mmm a / python - package / xgboost / plotting . py <nl> ppp b / python - package / xgboost / plotting . py <nl> <nl> <nl> def plot_importance ( booster , ax = None , height = 0 . 2 , <nl> xlim = None , ylim = None , title = ' Feature importance ' , <nl> - xlabel = ' F score ' , ylabel = ' Features ' , <nl> + xlabel = ' F score ' , ylabel = ' Features ' , fmap = ' ' , <nl> importance_type = ' weight ' , max_num_features = None , <nl> grid = True , show_values = True , * * kwargs ) : <nl> " " " Plot importance based on fitted trees . <nl> def plot_importance ( booster , ax = None , height = 0 . 2 , <nl> X axis title label . To disable , pass None . <nl> ylabel : str , default " Features " <nl> Y axis title label . To disable , pass None . <nl> + fmap : str or os . PathLike ( optional ) <nl> + The name of feature map file . <nl> show_values : bool , default True <nl> Show values on plot . To disable , pass False . <nl> kwargs : <nl> def plot_importance ( booster , ax = None , height = 0 . 2 , <nl> <nl> if isinstance ( booster , XGBModel ) : <nl> importance = booster . get_booster ( ) . get_score ( <nl> - importance_type = importance_type ) <nl> + importance_type = importance_type , fmap = fmap ) <nl> elif isinstance ( booster , Booster ) : <nl> - importance = booster . get_score ( importance_type = importance_type ) <nl> + importance = booster . get_score ( importance_type = importance_type , fmap = fmap ) <nl> elif isinstance ( booster , dict ) : <nl> importance = booster <nl> else : <nl>
|
Allow pass fmap to importance plot ( )
|
dmlc/xgboost
|
251dc8a66306c914e78f429b8711a202c759ef73
|
2020-05-29T11:55:35Z
|
mmm a / lib / cmyth / libcmyth / commbreak . c <nl> ppp b / lib / cmyth / libcmyth / commbreak . c <nl> int cmyth_rcv_commbreaklist ( cmyth_conn_t conn , int * err , <nl> unsigned short type ; <nl> unsigned short start_type ; <nl> int i ; <nl> - int j ; <nl> <nl> if ( count < = 0 ) { <nl> * err = EINVAL ; <nl> int cmyth_rcv_commbreaklist ( cmyth_conn_t conn , int * err , <nl> start_type = type ; <nl> } else if ( type = = CMYTH_COMMBREAK_END | | type = = CMYTH_CUTLIST_END ) { <nl> if ( start > = 0 & & <nl> - ( type = = CMYTH_COMMBREAK_END & & start_type = = CMYTH_COMMBREAK_START <nl> - | | type = = CMYTH_CUTLIST_END & & start_type = = CMYTH_CUTLIST_START ) ) <nl> + ( ( type = = CMYTH_COMMBREAK_END & & start_type = = CMYTH_COMMBREAK_START ) <nl> + | | ( type = = CMYTH_CUTLIST_END & & start_type = = CMYTH_CUTLIST_START ) ) ) <nl> { <nl> commbreak = cmyth_commbreak_create ( ) ; <nl> commbreak - > start_mark = start ; <nl>
|
[ libcmyth ] Fix compiler warnings .
|
xbmc/xbmc
|
734b0d49f4d63b75c54492313d08328cc6b9582b
|
2012-06-20T09:50:18Z
|
mmm a / testnet . template <nl> ppp b / testnet . template <nl> wcmd create - n ignition <nl> # mmmmmm DO NOT ALTER THE NEXT LINE mmmmmm - <nl> # # # INSERT prodkeys <nl> <nl> - ecmd set contract eosio contracts / eosio . bios contracts / eosio . bios / eosio . bios . wast contracts / eosio . bios / eosio . bios . abi <nl> + ecmd set contract eosio contracts / eosio . bios eosio . bios . wast eosio . bios . abi <nl> <nl> # Create required system accounts <nl> ecmd create key <nl> ecmd create account eosio eosio . token $ pubsyskey $ pubsyskey <nl> ecmd create account eosio eosio . vpay $ pubsyskey $ pubsyskey <nl> ecmd create account eosio eosio . sudo $ pubsyskey $ pubsyskey <nl> <nl> - ecmd set contract eosio . token contracts / eosio . token contracts / eosio . token / eosio . token . wast contracts / eosio . token / eosio . token . abi <nl> - ecmd set contract eosio . msig contracts / eosio . msig contracts / eosio . msig / eosio . msig . wast contracts / eosio . msig / eosio . msig . abi <nl> - ecmd set contract eosio . sudo contracts / eosio . sudo contracts / eosio . sudo / eosio . sudo . wast contracts / eosio . sudo / eosio . sudo . abi <nl> + ecmd set contract eosio . token contracts / eosio . token eosio . token . wast eosio . token . abi <nl> + ecmd set contract eosio . msig contracts / eosio . msig eosio . msig . wast eosio . msig . abi <nl> + ecmd set contract eosio . sudo contracts / eosio . sudo eosio . sudo . wast eosio . sudo . abi <nl> <nl> echo = = = = = Start : $ step = = = = = = = = = = = = > > $ logfile <nl> echo executing : cleos - - wallet - url $ wdurl - - url http : / / $ bioshost : $ biosport push action eosio . token create ' [ " eosio " , " 10000000000 . 0000 SYS " ] ' - p eosio . token | tee - a $ logfile <nl> programs / cleos / cleos - - wallet - url $ wdurl - - url http : / / $ bioshost : $ biosport push a <nl> echo = = = = End : $ step = = = = = = = = = = = = = = > > $ logfile <nl> step = $ ( ( $ step + 1 ) ) <nl> <nl> - ecmd set contract eosio contracts / eosio . system contracts / eosio . system / eosio . system . wast contracts / eosio . system / eosio . system . abi <nl> + ecmd set contract eosio contracts / eosio . system eosio . system . wast eosio . system . abi <nl> <nl> # Manual deployers , add a series of lines below this block that looks like : <nl> # cacmd $ PRODNAME [ 0 ] $ OWNERKEY [ 0 ] $ ACTIVEKEY [ 0 ] <nl> mmm a / tests / Cluster . py <nl> ppp b / tests / Cluster . py <nl> def bootstrap ( totalNodes , prodCount , biosHost , biosPort , dontKill = False , onlyBio <nl> <nl> contract = " eosio . bios " <nl> contractDir = " contracts / % s " % ( contract ) <nl> - wastFile = " contracts / % s / % s . wast " % ( contract , contract ) <nl> - abiFile = " contracts / % s / % s . abi " % ( contract , contract ) <nl> + wastFile = " % s . wast " % ( contract ) <nl> + abiFile = " % s . abi " % ( contract ) <nl> Utils . Print ( " Publish % s contract " % ( contract ) ) <nl> trans = biosNode . publishContract ( eosioAccount . name , contractDir , wastFile , abiFile , waitForTransBlock = True ) <nl> if trans is None : <nl> def bootstrap ( totalNodes , prodCount , biosHost , biosPort , dontKill = False , onlyBio <nl> <nl> contract = " eosio . token " <nl> contractDir = " contracts / % s " % ( contract ) <nl> - wastFile = " contracts / % s / % s . wast " % ( contract , contract ) <nl> - abiFile = " contracts / % s / % s . abi " % ( contract , contract ) <nl> + wastFile = " % s . wast " % ( contract ) <nl> + abiFile = " % s . abi " % ( contract ) <nl> Utils . Print ( " Publish % s contract " % ( contract ) ) <nl> trans = biosNode . publishContract ( eosioTokenAccount . name , contractDir , wastFile , abiFile , waitForTransBlock = True ) <nl> if trans is None : <nl> def bootstrap ( totalNodes , prodCount , biosHost , biosPort , dontKill = False , onlyBio <nl> <nl> contract = " eosio . system " <nl> contractDir = " contracts / % s " % ( contract ) <nl> - wastFile = " contracts / % s / % s . wast " % ( contract , contract ) <nl> - abiFile = " contracts / % s / % s . abi " % ( contract , contract ) <nl> + wastFile = " % s . wast " % ( contract ) <nl> + abiFile = " % s . abi " % ( contract ) <nl> Utils . Print ( " Publish % s contract " % ( contract ) ) <nl> trans = biosNode . publishContract ( eosioAccount . name , contractDir , wastFile , abiFile , waitForTransBlock = True ) <nl> if trans is None : <nl> mmm a / tests / consensus - validation - malicious - producers . py <nl> ppp b / tests / consensus - validation - malicious - producers . py <nl> def myTest ( transWillEnterBlock ) : <nl> error ( " Failed to create account % s " % ( currencyAccount . name ) ) <nl> return False <nl> <nl> - wastFile = " contracts / currency / currency . wast " <nl> - abiFile = " contracts / currency / currency . abi " <nl> + wastFile = " currency . wast " <nl> + abiFile = " currency . abi " <nl> Print ( " Publish contract " ) <nl> trans = node . publishContract ( currencyAccount . name , wastFile , abiFile , waitForTransBlock = True ) <nl> if trans is None : <nl> mmm a / tests / nodeos_run_test . py <nl> ppp b / tests / nodeos_run_test . py <nl> def cmdError ( name , cmdCode = 0 , exitNow = False ) : <nl> errorExit ( " FAILURE - get code currency1111 failed " , raw = True ) <nl> <nl> contractDir = " contracts / eosio . token " <nl> - wastFile = " contracts / eosio . token / eosio . token . wast " <nl> - abiFile = " contracts / eosio . token / eosio . token . abi " <nl> + wastFile = " eosio . token . wast " <nl> + abiFile = " eosio . token . abi " <nl> Print ( " Publish contract " ) <nl> trans = node . publishContract ( currencyAccount . name , contractDir , wastFile , abiFile , waitForTransBlock = True ) <nl> if trans is None : <nl> def cmdError ( name , cmdCode = 0 , exitNow = False ) : <nl> Print ( " upload exchange contract " ) <nl> <nl> contractDir = " contracts / exchange " <nl> - wastFile = " contracts / exchange / exchange . wast " <nl> - abiFile = " contracts / exchange / exchange . abi " <nl> + wastFile = " exchange . wast " <nl> + abiFile = " exchange . abi " <nl> Print ( " Publish exchange contract " ) <nl> trans = node . publishContract ( exchangeAccount . name , contractDir , wastFile , abiFile , waitForTransBlock = True ) <nl> if trans is None : <nl> def cmdError ( name , cmdCode = 0 , exitNow = False ) : <nl> errorExit ( " Failed to publish contract . " ) <nl> <nl> contractDir = " contracts / simpledb " <nl> - wastFile = " contracts / simpledb / simpledb . wast " <nl> - abiFile = " contracts / simpledb / simpledb . abi " <nl> + wastFile = " simpledb . wast " <nl> + abiFile = " simpledb . abi " <nl> Print ( " Setting simpledb contract without simpledb account was causing core dump in % s . " % ( ClientName ) ) <nl> Print ( " Verify % s generates an error , but does not core dump . " % ( ClientName ) ) <nl> retMap = node . publishContract ( " simpledb " , contractDir , wastFile , abiFile , shouldFail = True ) <nl> mmm a / tests / p2p_network_test . py <nl> ppp b / tests / p2p_network_test . py <nl> <nl> Print ( " host % s : % s " % ( hosts [ i ] , trans ) ) <nl> <nl> <nl> - wastFile = " contracts / eosio . system / eosio . system . wast " <nl> - abiFile = " contracts / eosio . system / eosio . system . abi " <nl> + wastFile = " eosio . system . wast " <nl> + abiFile = " eosio . system . abi " <nl> Print ( " \ nPush system contract % s % s " % ( wastFile , abiFile ) ) <nl> trans = node0 . publishContract ( eosio . name , wastFile , abiFile , waitForTransBlock = True ) <nl> if trans is None : <nl>
|
Change cleos set contract command used in the unit tests
|
EOSIO/eos
|
96a769702e83a2bc78356e096c985fbe0b292a69
|
2018-07-19T05:49:35Z
|
mmm a / tests / performance / arithmetic . xml <nl> ppp b / tests / performance / arithmetic . xml <nl> <nl> < ! - - < test max_ignored_relative_change = " 0 . 4 " > <nl> TODO ( dakovalkov ) : uncomment this - - > <nl> + < test > <nl> < settings > <nl> < max_memory_usage > 30000000000 < / max_memory_usage > <nl> < / settings > <nl> mmm a / tests / performance / synthetic_hardware_benchmark . xml <nl> ppp b / tests / performance / synthetic_hardware_benchmark . xml <nl> <nl> < ! - - < test max_ignored_relative_change = " 0 . 2 " > <nl> TODO ( dakovalkov ) : uncomment this - - > <nl> + < test > <nl> < settings > <nl> < max_memory_usage > 30000000000 < / max_memory_usage > <nl> < / settings > <nl>
|
Fix test
|
ClickHouse/ClickHouse
|
71fabcedc4939b6ef917072d3e224de4bc65f6b8
|
2020-05-29T05:35:03Z
|
mmm a / Documentation / Books / Users / HttpGharial / Edges . mdpp <nl> ppp b / Documentation / Books / Users / HttpGharial / Edges . mdpp <nl> Furthermore the edge has to be valid in the definition of this edge collection . <nl> <nl> < ! - - @ startDocuBlock JSF_general_graph_edge_create_http_examples - - > <nl> <nl> + <nl> ` ` ` <nl> unix > curl - X POST - - data - binary @ - - - dump - http : / / localhost : 8529 / system / gharial / social / edge / relation <nl> { " type " : " friend " , " _from " : " female / alice " , " _to " : " female / diana " } <nl> <nl> HTTP / 1 . 1 201 Created <nl> content - type : application / json <nl> - etag : 543501814 <nl> + etag : 608373699 <nl> <nl> { <nl> " error " : false , <nl> " code " : 201 , <nl> " edge " : { <nl> - " _id " : " relation / 543501814 " , <nl> - " _rev " : " 543501814 " , <nl> - " _key " : " 543501814 " <nl> + " _id " : " relation / 608373699 " , <nl> + " _rev " : " 608373699 " , <nl> + " _key " : " 608373699 " <nl> } <nl> } <nl> <nl> Gets an edge from the given collection . <nl> < ! - - @ startDocuBlock JSF_general_graph_edge_get_http_examples - - > <nl> <nl> ` ` ` <nl> - unix > curl - - dump - http : / / localhost : 8529 / system / gharial / social / vertex / relation / aliceAndBob <nl> + unix > curl - - dump - http : / / localhost : 8529 / system / gharial / social / edge / relation / aliceAndBob <nl> <nl> HTTP / 1 . 1 200 OK <nl> content - type : application / json <nl> - etag : 546188790 <nl> + etag : 611191747 <nl> <nl> { <nl> " error " : false , <nl> " code " : 200 , <nl> - " vertex " : { <nl> + " edge " : { <nl> " _id " : " relation / aliceAndBob " , <nl> - " _rev " : " 546188790 " , <nl> + " _rev " : " 611191747 " , <nl> " _key " : " aliceAndBob " , <nl> " _from " : " female / alice " , <nl> " _to " : " male / bob " , <nl> Updates the data of the specific edge in the collection . <nl> < ! - - @ startDocuBlock JSF_general_graph_edge_modify_http_examples - - > <nl> <nl> ` ` ` <nl> - unix > curl - X PATCH - - data - binary @ - - - dump - http : / / localhost : 8529 / system / gharial / social / vertex / relation / aliceAndBob <nl> - { " since " : " 01 . 01 . 2001 " } <nl> + unix > curl - X PUT - - data - binary @ - - - dump - http : / / localhost : 8529 / system / gharial / social / edge / relation / aliceAndBob <nl> + { " type " : " divorced " } <nl> <nl> HTTP / 1 . 1 200 OK <nl> content - type : application / json <nl> - etag : 555494902 <nl> + etag : 616500163 <nl> <nl> { <nl> " error " : false , <nl> " code " : 200 , <nl> - " vertex " : { <nl> + " edge " : { <nl> " _id " : " relation / aliceAndBob " , <nl> - " _rev " : " 555494902 " , <nl> - " _oldRev " : " 554053110 " , <nl> + " _rev " : " 616500163 " , <nl> + " _oldRev " : " 615189443 " , <nl> " _key " : " aliceAndBob " <nl> } <nl> } <nl> Replaces the data of an edge in the collection . <nl> < ! - - @ startDocuBlock JSF_general_graph_edge_replace_http_examples - - > <nl> <nl> ` ` ` <nl> - unix > curl - X PUT - - data - binary @ - - - dump - http : / / localhost : 8529 / system / gharial / social / vertex / relation / aliceAndBob <nl> - { " type " : " divorced " } <nl> + unix > curl - X PATCH - - data - binary @ - - - dump - http : / / localhost : 8529 / system / gharial / social / edge / relation / aliceAndBob <nl> + { " since " : " 01 . 01 . 2001 " } <nl> <nl> HTTP / 1 . 1 200 OK <nl> content - type : application / json <nl> - etag : 551366134 <nl> + etag : 620760003 <nl> <nl> { <nl> " error " : false , <nl> " code " : 200 , <nl> - " vertex " : { <nl> + " edge " : { <nl> " _id " : " relation / aliceAndBob " , <nl> - " _rev " : " 551366134 " , <nl> - " _oldRev " : " 550055414 " , <nl> + " _rev " : " 620760003 " , <nl> + " _oldRev " : " 619318211 " , <nl> " _key " : " aliceAndBob " <nl> } <nl> } <nl> Removes an edge from the collection . <nl> < ! - - @ startDocuBlock JSF_general_graph_edge_delete_http_examples - - > <nl> <nl> ` ` ` <nl> - unix > curl - X DELETE - - dump - http : / / localhost : 8529 / system / gharial / social / vertex / relation / aliceAndBob <nl> + unix > curl - X DELETE - - dump - http : / / localhost : 8529 / system / gharial / social / edge / relation / aliceAndBob <nl> <nl> HTTP / 1 . 1 200 OK <nl> content - type : application / json <nl> content - type : application / json <nl> { <nl> " error " : false , <nl> " code " : 200 , <nl> - " vertex " : true <nl> + " edge " : true <nl> } <nl> <nl> ` ` ` <nl> mmm a / Documentation / Books / codeBlockReader . py <nl> ppp b / Documentation / Books / codeBlockReader . py <nl> def fetch_comments ( dirpath ) : <nl> if ( " @ startDocuBlock " in _text ) or \ <nl> ( " @ endDocuBlock " in _text ) : <nl> fh . write ( " < ! - - % s - - > \ n \ n " % _text ) <nl> - elif ( " @ EXAMPLE_ARANGOSH_OUTPUT " in _text ) : <nl> + elif ( " @ EXAMPLE_ARANGOSH_OUTPUT " in _text or \ <nl> + " @ EXAMPLE_ARANGOSH_RUN " in _text ) : <nl> shouldIgnoreLine = True <nl> _filename = re . search ( " { ( . * ) } " , _text ) . group ( 1 ) <nl> dirpath = os . path . abspath ( os . path . join ( os . path . dirname ( __file__ ) , os . pardir , " Examples " , _filename + " . generated " ) ) <nl> def fetch_comments ( dirpath ) : <nl> print " Could not find code for " + _filename <nl> else : <nl> fh . write ( " % s \ n " % _text ) <nl> - elif ( " @ END_EXAMPLE_ARANGOSH_OUTPUT " in _text ) : <nl> + elif ( " @ END_EXAMPLE_ARANGOSH_OUTPUT " in _text or \ <nl> + " @ END_EXAMPLE_ARANGOSH_RUN " in _text ) : <nl> shouldIgnoreLine = False <nl> <nl> fh . close ( ) <nl>
|
Fixed a bug in codeBlockReader and added new edge examples
|
arangodb/arangodb
|
5692606fd46ffaeb6cf235baa9a03cbf0d110819
|
2014-06-17T11:34:13Z
|
mmm a / tensorflow / compiler / xla / service / BUILD <nl> ppp b / tensorflow / compiler / xla / service / BUILD <nl> xla_test ( <nl> " cpu " , <nl> " gpu " , <nl> ] , <nl> + tags = [ <nl> + " no_windows " , # TODO ( b / 152037541 ) <nl> + ] , <nl> deps = [ <nl> " : hlo_parser " , <nl> " / / tensorflow / compiler / xla : execution_options_util " , <nl>
|
Temporarily disable elemental_ir_emitter_test on windows
|
tensorflow/tensorflow
|
e9650ec721ad94f08cf10242a36bd40fa44d1fe4
|
2020-03-20T16:31:45Z
|
mmm a / Telegram / SourceFiles / mtproto / connection . cpp <nl> ppp b / Telegram / SourceFiles / mtproto / connection . cpp <nl> namespace internal { <nl> namespace { <nl> <nl> constexpr auto kRecreateKeyId = AuthKey : : KeyId ( 0xFFFFFFFFFFFFFFFFULL ) ; <nl> + constexpr auto kIntSize = static_cast < int > ( sizeof ( mtpPrime ) ) ; <nl> <nl> void wrapInvokeAfter ( mtpRequest & to , const mtpRequest & from , const mtpRequestMap & haveSent , int32 skipBeforeRequest = 0 ) { <nl> mtpMsgId afterId ( * ( mtpMsgId * ) ( from - > after - > data ( ) + 4 ) ) ; <nl> void ConnectionPrivate : : handleReceived ( ) { <nl> <nl> onReceivedSome ( ) ; <nl> <nl> + auto restartOnError = [ this , & lockFinished ] { <nl> + lockFinished . unlock ( ) ; <nl> + restart ( ) ; <nl> + } ; <nl> + <nl> ReadLockerAttempt lock ( sessionData - > keyMutex ( ) ) ; <nl> if ( ! lock ) { <nl> DEBUG_LOG ( ( " MTP Error : auth_key for dc % 1 busy , cant lock " ) . arg ( _shiftedDcId ) ) ; <nl> clearMessages ( ) ; <nl> keyId = 0 ; <nl> <nl> - lockFinished . unlock ( ) ; <nl> - return restart ( ) ; <nl> + return restartOnError ( ) ; <nl> } <nl> <nl> auto key = sessionData - > getKey ( ) ; <nl> if ( ! key | | key - > keyId ( ) ! = keyId ) { <nl> DEBUG_LOG ( ( " MTP Error : auth_key id for dc % 1 changed " ) . arg ( _shiftedDcId ) ) ; <nl> - <nl> - lockFinished . unlock ( ) ; <nl> - return restart ( ) ; <nl> + return restartOnError ( ) ; <nl> } <nl> <nl> - while ( _conn - > received ( ) . size ( ) ) { <nl> - const mtpBuffer & encryptedBuf ( _conn - > received ( ) . front ( ) ) ; <nl> - uint32 len = encryptedBuf . size ( ) ; <nl> - const mtpPrime * encrypted ( encryptedBuf . data ( ) ) ; <nl> - if ( len < 18 ) { / / 2 auth_key_id , 4 msg_key , 2 salt , 2 session , 2 msg_id , 1 seq_no , 1 length , ( 1 data + 3 padding ) min <nl> - LOG ( ( " TCP Error : bad message received , len % 1 " ) . arg ( len * sizeof ( mtpPrime ) ) ) ; <nl> - TCP_LOG ( ( " TCP Error : bad message % 1 " ) . arg ( Logs : : mb ( encrypted , len * sizeof ( mtpPrime ) ) . str ( ) ) ) ; <nl> + while ( ! _conn - > received ( ) . empty ( ) ) { <nl> + auto intsBuffer = std : : move ( _conn - > received ( ) . front ( ) ) ; <nl> + _conn - > received ( ) . pop_front ( ) ; <nl> <nl> - lockFinished . unlock ( ) ; <nl> - return restart ( ) ; <nl> + constexpr auto kExternalHeaderIntsCount = 6U ; / / 2 auth_key_id , 4 msg_key <nl> + constexpr auto kEncryptedHeaderIntsCount = 8U ; / / 2 salt , 2 session , 2 msg_id , 1 seq_no , 1 length <nl> + constexpr auto kMinimalEncryptedIntsCount = kEncryptedHeaderIntsCount + 4U ; / / + 1 data + 3 padding <nl> + constexpr auto kMinimalIntsCount = kExternalHeaderIntsCount + kMinimalEncryptedIntsCount ; <nl> + auto intsCount = uint32 ( intsBuffer . size ( ) ) ; <nl> + auto ints = intsBuffer . constData ( ) ; <nl> + if ( intsCount < kMinimalIntsCount ) { <nl> + LOG ( ( " TCP Error : bad message received , len % 1 " ) . arg ( intsCount * kIntSize ) ) ; <nl> + TCP_LOG ( ( " TCP Error : bad message % 1 " ) . arg ( Logs : : mb ( ints , intsCount * kIntSize ) . str ( ) ) ) ; <nl> + <nl> + return restartOnError ( ) ; <nl> } <nl> - if ( keyId ! = * ( uint64 * ) encrypted ) { <nl> - LOG ( ( " TCP Error : bad auth_key_id % 1 instead of % 2 received " ) . arg ( keyId ) . arg ( * ( uint64 * ) encrypted ) ) ; <nl> - TCP_LOG ( ( " TCP Error : bad message % 1 " ) . arg ( Logs : : mb ( encrypted , len * sizeof ( mtpPrime ) ) . str ( ) ) ) ; <nl> + if ( keyId ! = * ( uint64 * ) ints ) { <nl> + LOG ( ( " TCP Error : bad auth_key_id % 1 instead of % 2 received " ) . arg ( keyId ) . arg ( * ( uint64 * ) ints ) ) ; <nl> + TCP_LOG ( ( " TCP Error : bad message % 1 " ) . arg ( Logs : : mb ( ints , intsCount * kIntSize ) . str ( ) ) ) ; <nl> <nl> - lockFinished . unlock ( ) ; <nl> - return restart ( ) ; <nl> + return restartOnError ( ) ; <nl> } <nl> <nl> - QByteArray dataBuffer ( ( len - 6 ) * sizeof ( mtpPrime ) , Qt : : Uninitialized ) ; <nl> - mtpPrime * data ( ( mtpPrime * ) dataBuffer . data ( ) ) , * msg = data + 8 ; <nl> - const mtpPrime * from ( msg ) , * end ; <nl> - MTPint128 msgKey ( * ( MTPint128 * ) ( encrypted + 2 ) ) ; <nl> + auto encryptedInts = ints + kExternalHeaderIntsCount ; <nl> + auto encryptedIntsCount = ( intsCount - kExternalHeaderIntsCount ) ; <nl> + auto encryptedBytesCount = encryptedIntsCount * kIntSize ; <nl> + auto decryptedBuffer = QByteArray ( encryptedBytesCount , Qt : : Uninitialized ) ; <nl> + auto msgKey = * ( MTPint128 * ) ( ints + 2 ) ; <nl> <nl> - aesIgeDecrypt ( encrypted + 6 , data , dataBuffer . size ( ) , key , msgKey ) ; <nl> + aesIgeDecrypt ( encryptedInts , decryptedBuffer . data ( ) , encryptedBytesCount , key , msgKey ) ; <nl> <nl> - uint64 serverSalt = * ( uint64 * ) & data [ 0 ] , session = * ( uint64 * ) & data [ 2 ] , msgId = * ( uint64 * ) & data [ 4 ] ; <nl> - uint32 seqNo = * ( uint32 * ) & data [ 6 ] , msgLen = * ( uint32 * ) & data [ 7 ] ; <nl> - bool needAck = ( seqNo & 0x01 ) ; <nl> + auto decryptedInts = reinterpret_cast < const mtpPrime * > ( decryptedBuffer . constData ( ) ) ; <nl> + auto serverSalt = * ( uint64 * ) & decryptedInts [ 0 ] ; <nl> + auto session = * ( uint64 * ) & decryptedInts [ 2 ] ; <nl> + auto msgId = * ( uint64 * ) & decryptedInts [ 4 ] ; <nl> + auto seqNo = * ( uint32 * ) & decryptedInts [ 6 ] ; <nl> + auto needAck = ( ( seqNo & 0x01 ) ! = 0 ) ; <nl> <nl> - if ( uint32 ( dataBuffer . size ( ) ) < msgLen + 8 * sizeof ( mtpPrime ) | | ( msgLen & 0x03 ) ) { <nl> - LOG ( ( " TCP Error : bad msg_len received % 1 , data size : % 2 " ) . arg ( msgLen ) . arg ( dataBuffer . size ( ) ) ) ; <nl> - TCP_LOG ( ( " TCP Error : bad message % 1 " ) . arg ( Logs : : mb ( encrypted , len * sizeof ( mtpPrime ) ) . str ( ) ) ) ; <nl> - _conn - > received ( ) . pop_front ( ) ; <nl> + auto messageLength = * ( uint32 * ) & decryptedInts [ 7 ] ; <nl> + auto fullDataLength = kEncryptedHeaderIntsCount * kIntSize + messageLength ; / / Without padding . <nl> <nl> - lockFinished . unlock ( ) ; <nl> - return restart ( ) ; <nl> + constexpr auto kMaxPaddingSize = 15U ; <nl> + auto paddingSize = encryptedBytesCount - fullDataLength ; / / Can underflow . <nl> + auto badMessageLength = ( / * paddingSize < 0 | | * / paddingSize > kMaxPaddingSize ) ; <nl> + auto hashedDataLength = badMessageLength ? encryptedBytesCount : fullDataLength ; <nl> + auto sha1ForMsgKeyCheck = hashSha1 ( decryptedInts , hashedDataLength ) ; <nl> + if ( memcmp ( & msgKey , sha1ForMsgKeyCheck . data ( ) + sha1ForMsgKeyCheck . size ( ) - sizeof ( msgKey ) , sizeof ( msgKey ) ) ! = 0 ) { <nl> + LOG ( ( " TCP Error : bad SHA1 hash after aesDecrypt in message . " ) ) ; <nl> + TCP_LOG ( ( " TCP Error : bad message % 1 " ) . arg ( Logs : : mb ( encryptedInts , encryptedBytesCount ) . str ( ) ) ) ; <nl> + <nl> + return restartOnError ( ) ; <nl> } <nl> - uchar sha1Buffer [ 20 ] ; <nl> - if ( memcmp ( & msgKey , hashSha1 ( data , msgLen + 8 * sizeof ( mtpPrime ) , sha1Buffer ) + 1 , sizeof ( msgKey ) ) ) { <nl> - LOG ( ( " TCP Error : bad SHA1 hash after aesDecrypt in message " ) ) ; <nl> - TCP_LOG ( ( " TCP Error : bad message % 1 " ) . arg ( Logs : : mb ( encrypted , len * sizeof ( mtpPrime ) ) . str ( ) ) ) ; <nl> - _conn - > received ( ) . pop_front ( ) ; <nl> + if ( badMessageLength | | ( messageLength & 0x03 ) ) { <nl> + LOG ( ( " TCP Error : bad msg_len received % 1 , data size : % 2 " ) . arg ( messageLength ) . arg ( encryptedBytesCount ) ) ; <nl> + TCP_LOG ( ( " TCP Error : bad message % 1 " ) . arg ( Logs : : mb ( encryptedInts , encryptedBytesCount ) . str ( ) ) ) ; <nl> <nl> - lockFinished . unlock ( ) ; <nl> - return restart ( ) ; <nl> + return restartOnError ( ) ; <nl> } <nl> - TCP_LOG ( ( " TCP Info : decrypted message % 1 , % 2 , % 3 is % 4 len " ) . arg ( msgId ) . arg ( seqNo ) . arg ( Logs : : b ( needAck ) ) . arg ( msgLen + 8 * sizeof ( mtpPrime ) ) ) ; <nl> + <nl> + TCP_LOG ( ( " TCP Info : decrypted message % 1 , % 2 , % 3 is % 4 len " ) . arg ( msgId ) . arg ( seqNo ) . arg ( Logs : : b ( needAck ) ) . arg ( fullDataLength ) ) ; <nl> <nl> uint64 serverSession = sessionData - > getSession ( ) ; <nl> if ( session ! = serverSession ) { <nl> LOG ( ( " MTP Error : bad server session received " ) ) ; <nl> TCP_LOG ( ( " MTP Error : bad server session % 1 instead of % 2 in message received " ) . arg ( session ) . arg ( serverSession ) ) ; <nl> - _conn - > received ( ) . pop_front ( ) ; <nl> <nl> - lockFinished . unlock ( ) ; <nl> - return restart ( ) ; <nl> + return restartOnError ( ) ; <nl> } <nl> <nl> - _conn - > received ( ) . pop_front ( ) ; <nl> - <nl> int32 serverTime ( ( int32 ) ( msgId > > 32 ) ) , clientTime ( unixtime ( ) ) ; <nl> bool isReply = ( ( msgId & 0x03 ) = = 1 ) ; <nl> if ( ! isReply & & ( ( msgId & 0x03 ) ! = 3 ) ) { <nl> LOG ( ( " MTP Error : bad msg_id % 1 in message received " ) . arg ( msgId ) ) ; <nl> <nl> - lockFinished . unlock ( ) ; <nl> - return restart ( ) ; <nl> + return restartOnError ( ) ; <nl> } <nl> <nl> bool badTime = false ; <nl> void ConnectionPrivate : : handleReceived ( ) { <nl> if ( needAck ) ackRequestData . push_back ( MTP_long ( msgId ) ) ; <nl> <nl> auto res = HandleResult : : Success ; / / if no need to handle , then succeed <nl> - end = data + 8 + ( msgLen > > 2 ) ; <nl> - const mtpPrime * sfrom ( data + 4 ) ; <nl> + auto from = decryptedInts + kEncryptedHeaderIntsCount ; <nl> + auto end = from + ( messageLength / kIntSize ) ; <nl> + auto sfrom = decryptedInts + 4U ; / / msg_id + seq_no + length + message <nl> MTP_LOG ( _shiftedDcId , ( " Recv : " ) + mtpTextSerialize ( sfrom , end ) ) ; <nl> <nl> bool needToHandle = false ; <nl> void ConnectionPrivate : : handleReceived ( ) { <nl> if ( res ! = HandleResult : : Success & & res ! = HandleResult : : Ignored ) { <nl> _needSessionReset = ( res = = HandleResult : : ResetSession ) ; <nl> <nl> - lockFinished . unlock ( ) ; <nl> - return restart ( ) ; <nl> + return restartOnError ( ) ; <nl> } <nl> retryTimeout = 1 ; / / reset restart ( ) timer <nl> <nl> bool ConnectionPrivate : : readResponseNotSecure ( TResponse & response ) { <nl> onReceivedSome ( ) ; <nl> <nl> try { <nl> - if ( _conn - > received ( ) . isEmpty ( ) ) { <nl> + if ( _conn - > received ( ) . empty ( ) ) { <nl> LOG ( ( " AuthKey Error : trying to read response from empty received list " ) ) ; <nl> return false ; <nl> } <nl> - mtpBuffer buffer ( _conn - > received ( ) . front ( ) ) ; <nl> + <nl> + auto buffer = std : : move ( _conn - > received ( ) . front ( ) ) ; <nl> _conn - > received ( ) . pop_front ( ) ; <nl> <nl> - const mtpPrime * answer ( buffer . constData ( ) ) ; <nl> - uint32 len = buffer . size ( ) ; <nl> + auto answer = buffer . constData ( ) ; <nl> + auto len = buffer . size ( ) ; <nl> if ( len < 5 ) { <nl> LOG ( ( " AuthKey Error : bad request answer , len = % 1 " ) . arg ( len * sizeof ( mtpPrime ) ) ) ; <nl> DEBUG_LOG ( ( " AuthKey Error : answer bytes % 1 " ) . arg ( Logs : : mb ( answer , len * sizeof ( mtpPrime ) ) . str ( ) ) ) ; <nl> mmm a / Telegram / SourceFiles / mtproto / connection_abstract . h <nl> ppp b / Telegram / SourceFiles / mtproto / connection_abstract . h <nl> class AbstractConnection : public QObject { <nl> <nl> virtual QString transport ( ) const = 0 ; <nl> <nl> - typedef QList < mtpBuffer > BuffersQueue ; <nl> + using BuffersQueue = std : : deque < mtpBuffer > ; <nl> BuffersQueue & received ( ) { <nl> - return receivedQueue ; <nl> + return _receivedQueue ; <nl> } <nl> <nl> / / Used to emit error ( . . . ) with no real code from the server . <nl> class AbstractConnection : public QObject { <nl> void disconnected ( ) ; <nl> <nl> protected : <nl> - BuffersQueue receivedQueue ; / / list of received packets , not processed yet <nl> + BuffersQueue _receivedQueue ; / / list of received packets , not processed yet <nl> bool _sentEncrypted ; <nl> <nl> / / first we always send fake MTPReq_pq to see if connection works at all <nl> mmm a / Telegram / SourceFiles / mtproto / connection_auto . cpp <nl> ppp b / Telegram / SourceFiles / mtproto / connection_auto . cpp <nl> void AutoConnection : : requestFinished ( QNetworkReply * reply ) { <nl> } <nl> } else if ( ! data . isEmpty ( ) ) { <nl> if ( status = = UsingHttp ) { <nl> - receivedQueue . push_back ( data ) ; <nl> + _receivedQueue . push_back ( data ) ; <nl> emit receivedData ( ) ; <nl> } else if ( status = = WaitingBoth | | status = = WaitingHttp ) { <nl> try { <nl> void AutoConnection : : socketPacket ( const char * packet , uint32 length ) { <nl> LOG ( ( " Strange Tcp Error ; status % 1 " ) . arg ( status ) ) ; <nl> } <nl> } else if ( status = = UsingTcp ) { <nl> - receivedQueue . push_back ( data ) ; <nl> + _receivedQueue . push_back ( data ) ; <nl> emit receivedData ( ) ; <nl> } else if ( status = = WaitingBoth | | status = = WaitingTcp | | status = = HttpReady ) { <nl> tcpTimeoutTimer . stop ( ) ; <nl> mmm a / Telegram / SourceFiles / mtproto / connection_http . cpp <nl> ppp b / Telegram / SourceFiles / mtproto / connection_http . cpp <nl> void HTTPConnection : : requestFinished ( QNetworkReply * reply ) { <nl> emit error ( data [ 0 ] ) ; <nl> } else if ( ! data . isEmpty ( ) ) { <nl> if ( status = = UsingHttp ) { <nl> - receivedQueue . push_back ( data ) ; <nl> + _receivedQueue . push_back ( data ) ; <nl> emit receivedData ( ) ; <nl> } else { <nl> try { <nl> mmm a / Telegram / SourceFiles / mtproto / connection_tcp . cpp <nl> ppp b / Telegram / SourceFiles / mtproto / connection_tcp . cpp <nl> void TCPConnection : : socketPacket ( const char * packet , uint32 length ) { <nl> if ( data . size ( ) = = 1 ) { <nl> emit error ( data [ 0 ] ) ; <nl> } else if ( status = = UsingTcp ) { <nl> - receivedQueue . push_back ( data ) ; <nl> + _receivedQueue . push_back ( data ) ; <nl> emit receivedData ( ) ; <nl> } else if ( status = = WaitingTcp ) { <nl> tcpTimeoutTimer . stop ( ) ; <nl>
|
Some improvements in mtproto data processing .
|
telegramdesktop/tdesktop
|
6c2f16e9a06366ed5a9e587b38183866bba071db
|
2017-02-27T09:51:03Z
|
mmm a / js / client / modules / @ arangodb / testing . js <nl> ppp b / js / client / modules / @ arangodb / testing . js <nl> const optionsDefaults = { <nl> ' loopSleepSec ' : 1 , <nl> ' loopSleepWhen ' : 1 , <nl> ' maxPort ' : 32768 , <nl> + ' mochaGrep ' : undefined , <nl> ' onlyNightly ' : false , <nl> ' password ' : ' ' , <nl> ' replication ' : false , <nl> function makePathGeneric ( path ) { <nl> function runThere ( options , instanceInfo , file ) { <nl> try { <nl> let testCode ; <nl> - <nl> + let mochaGrep = options . mochaGrep ? ' , ' + JSON . stringify ( options . mochaGrep ) : ' ' ; <nl> if ( file . indexOf ( ' - spec ' ) = = = - 1 ) { <nl> testCode = ' const runTest = require ( " jsunity " ) . runTest ; ' + <nl> ' return runTest ( ' + JSON . stringify ( file ) + ' , true ) ; ' ; <nl> } else { <nl> testCode = ' const runTest = require ( " @ arangodb / mocha - runner " ) ; ' + <nl> - ' return runTest ( ' + JSON . stringify ( file ) + ' , true ) ; ' ; <nl> + ' return runTest ( ' + JSON . stringify ( file ) + ' , true ' + mochaGrep + ' ) ; ' ; <nl> } <nl> <nl> if ( options . propagateInstanceInfo ) { <nl> mmm a / js / common / modules / @ arangodb / mocha - runner . js <nl> ppp b / js / common / modules / @ arangodb / mocha - runner . js <nl> const colors = require ( ' internal ' ) . COLORS ; <nl> <nl> const $ _MODULE_CONTEXT = Symbol . for ( ' @ arangodb / module . context ' ) ; <nl> <nl> - module . exports = function ( files , returnJson ) { <nl> - const results = runTests ( run , files , ' suite ' ) ; <nl> + module . exports = function ( files , returnJson , grep ) { <nl> + const results = runTests ( run , files , ' suite ' , grep ) ; <nl> print ( ) ; <nl> logSuite ( results ) ; <nl> logStats ( results . stats ) ; <nl> mmm a / js / common / modules / @ arangodb / mocha . js <nl> ppp b / js / common / modules / @ arangodb / mocha . js <nl> exports . reporters = { <nl> default : DefaultReporter <nl> } ; <nl> <nl> - exports . run = function runMochaTests ( run , files , reporterName ) { <nl> + exports . run = function runMochaTests ( run , files , reporterName , grep ) { <nl> if ( ! Array . isArray ( files ) ) { <nl> files = [ files ] ; <nl> } <nl> exports . run = function runMochaTests ( run , files , reporterName ) { <nl> return this ; <nl> } <nl> } ; <nl> + if ( grep ) { <nl> + mocha . grep ( grep ) ; <nl> + } <nl> <nl> / / Clean up after chai . should ( ) , etc <nl> var globals = Object . getOwnPropertyNames ( global ) ; <nl>
|
add mochagrep
|
arangodb/arangodb
|
9ad10acdc0daa45524c0a358be8afb3cf7e64fa5
|
2017-01-19T16:58:43Z
|
mmm a / hphp / hack / src / ifc / ifc . ml <nl> ppp b / hphp / hack / src / ifc / ifc . ml <nl> module Pp = Ifc_pretty <nl> module A = Aast <nl> module T = Typing_defs <nl> module L = Logic . Infix <nl> + module Reason = Typing_reason <nl> <nl> exception FlowInference of string <nl> <nl> let get_policy_var ? prefix lump_pol_opt proto_renv = <nl> Env . new_policy_var proto_renv prefix <nl> <nl> let rec class_ptype lump_pol_opt proto_renv name = <nl> - let { psig_policied_properties ; psig_unpolicied_properties } = <nl> + let { psig_policied_properties } = <nl> match SMap . find_opt name proto_renv . pre_psig_env with <nl> | Some class_policy_sig - > class_policy_sig <nl> | None - > fail ( " Could not found a class policy signature for " ^ name ) <nl> let rec class_ptype lump_pol_opt proto_renv name = <nl> ( prop , ptype ~ prefix : ( " . " ^ prop ) lump_pol_opt proto_renv ty ) ) <nl> in <nl> let lump_pol = get_policy_var lump_pol_opt proto_renv ~ prefix : " lump " in <nl> - let unpolicied_props = <nl> - List . map psig_unpolicied_properties ( fun ( prop , ty ) - > <nl> - ( prop , ptype ~ prefix : ( " . " ^ prop ) ( Some lump_pol ) proto_renv ty ) ) <nl> - in <nl> - let property_ptype_map = <nl> - SMap . of_list ( List . append policied_props unpolicied_props ) <nl> - in <nl> Tclass <nl> { <nl> c_name = name ; <nl> c_self = get_policy_var lump_pol_opt proto_renv ~ prefix : name ; <nl> c_lump = lump_pol ; <nl> - c_property_map = property_ptype_map ; <nl> + c_property_map = SMap . of_list policied_props ; <nl> } <nl> <nl> ( * Turns a locl_ty into a type with policy annotations ; <nl> and ptype ? prefix lump_pol_opt proto_renv ( t : T . locl_ty ) = <nl> | T . Tunion tyl - > Tunion ( List . map ~ f : ptype tyl ) <nl> | T . Tintersection tyl - > Tinter ( List . map ~ f : ptype tyl ) <nl> | T . Tclass ( ( _ , name ) , _ , _ ) - > class_ptype lump_pol_opt proto_renv name <nl> + | T . Tvar id - > <nl> + ( * Drops the environment ` expand_var ` returns . This is logically <nl> + * correct , but threading the envrionment would lead to faster future <nl> + * ` Tvar ` lookups . <nl> + * ) <nl> + let ( _ , ty ) = <nl> + Typing_inference_env . expand_var <nl> + proto_renv . pre_tenv . Tast . inference_env <nl> + Reason . Rnone <nl> + id <nl> + in <nl> + ptype ty <nl> ( * mmm types below are not yet unpported * ) <nl> | T . Tdependent ( _ , _ty ) - > fail " Tdependent " <nl> | T . Tdarray ( _keyty , _valty ) - > fail " Tdarray " <nl> and ptype ? prefix lump_pol_opt proto_renv ( t : T . locl_ty ) = <nl> | T . Toption _ty - > fail " Toption " <nl> | T . Tfun _fun_ty - > fail " Tfun " <nl> | T . Tshape ( _sh_kind , _sh_type_map ) - > fail " Tshape " <nl> - | T . Tvar _id - > fail " Tvar " <nl> | T . Tgeneric _name - > fail " Tgeneric " <nl> | T . Tnewtype ( _name , _ty_list , _as_bound ) - > fail " Tnewtype " <nl> | T . Tobject - > fail " Tobject " <nl> let receiver_of_obj_get obj_ptype property = <nl> | Tclass class_ - > class_ <nl> | _ - > fail ( " Couldn ' t find a class for the property ' " ^ property ^ " ' . " ) <nl> <nl> - let property_ptype obj_ptype property = <nl> + let property_ptype proto_renv obj_ptype property property_ty = <nl> let class_ = receiver_of_obj_get obj_ptype property in <nl> match SMap . find_opt property class_ . c_property_map with <nl> | Some ptype - > ptype <nl> | None - > <nl> - fail <nl> - ( " Property ' " ^ property ^ " ' doesn ' t exist in ' " ^ class_ . c_name ^ " ' . " ) <nl> + ptype ~ prefix : ( " . " ^ property ) ( Some class_ . c_lump ) proto_renv property_ty <nl> <nl> - let rec lvalue renv env ( ( ( _epos , _ety ) , e ) : Tast . expr ) = <nl> + let rec lvalue renv env ( ( ( _epos , ety ) , e ) : Tast . expr ) = <nl> match e with <nl> | A . Lvar ( _pos , lid ) - > ( env , Local lid ) <nl> | A . Obj_get ( obj , ( _ , A . Id ( _ , property ) ) , _ ) - > <nl> let ( env , obj_ptype ) = expr renv env obj in <nl> let obj_pol = ( receiver_of_obj_get obj_ptype property ) . c_self in <nl> - let prop_ptype = property_ptype obj_ptype property in <nl> + let prop_ptype = property_ptype renv . re_proto obj_ptype property ety in <nl> let env = Env . acc env ( add_dependencies [ obj_pol ] prop_ptype ) in <nl> ( env , Property prop_ptype ) <nl> | _ - > fail " unsupported lvalue " <nl> <nl> ( * Generate flow constraints for an expression * ) <nl> - and expr renv env ( ( ( _epos , _ety ) , e ) : Tast . expr ) = <nl> + and expr renv env ( ( ( _epos , ety ) , e ) : Tast . expr ) = <nl> let expr = expr renv in <nl> match e with <nl> | A . True <nl> and expr renv env ( ( ( _epos , _ety ) , e ) : Tast . expr ) = <nl> | A . Lvar ( _pos , lid ) - > ( env , Env . get_local_type env lid ) <nl> | A . Obj_get ( obj , ( _ , A . Id ( _ , property ) ) , _ ) - > <nl> let ( env , obj_ptype ) = expr env obj in <nl> - let prop_ptype = property_ptype obj_ptype property in <nl> + let prop_ptype = property_ptype renv . re_proto obj_ptype property ety in <nl> let ( env , super_ptype ) = <nl> weaken ~ prefix : ( " . " ^ property ) renv env prop_ptype <nl> in <nl> let func_or_method psig_env class_name_opt name saved_env params body lrty = <nl> try <nl> ( * Setup the read - only environment * ) <nl> let scope = Scope . alloc ( ) in <nl> - let proto_renv = Env . new_proto_renv scope psig_env in <nl> + let proto_renv = Env . new_proto_renv saved_env scope psig_env in <nl> <nl> let global_pc = Env . new_policy_var proto_renv " pc " in <nl> let this_ty = Option . map class_name_opt ( class_ptype None proto_renv ) in <nl> let ret_ty = ptype ~ prefix : " ret " None proto_renv lrty in <nl> - let renv = Env . new_renv proto_renv saved_env global_pc this_ty ret_ty in <nl> + let renv = Env . new_renv proto_renv global_pc this_ty ret_ty in <nl> <nl> ( * Initialise the mutable environment * ) <nl> let env = Env . new_env in <nl> mmm a / hphp / hack / src / ifc / ifc_decl . ml <nl> ppp b / hphp / hack / src / ifc / ifc_decl . ml <nl> let collect_class_policy_sigs = <nl> let extract { A . cv_id ; A . cv_type ; _ } = ( snd cv_id , fst cv_type ) in <nl> let def psig_env = function <nl> | A . Class { A . c_name = ( _ , name ) ; c_vars = properties ; _ } - > <nl> - let ( policied_props , unpolicied_props ) = <nl> - List . partition_tf ~ f : is_policied_property properties <nl> - in <nl> + let policied_props = List . filter ~ f : is_policied_property properties in <nl> SMap . add <nl> name <nl> - { <nl> - psig_policied_properties = List . map policied_props extract ; <nl> - psig_unpolicied_properties = List . map unpolicied_props extract ; <nl> - } <nl> + { psig_policied_properties = List . map policied_props extract } <nl> psig_env <nl> | _ - > psig_env <nl> in <nl> mmm a / hphp / hack / src / ifc / ifc_env . ml <nl> ppp b / hphp / hack / src / ifc / ifc_env . ml <nl> let new_policy_var { pre_scope ; pre_pvar_counters ; _ } prefix = <nl> in <nl> Pfree_var ( prefix ^ suffix , pre_scope ) <nl> <nl> - let new_proto_renv scope psig_env = <nl> + let new_proto_renv saved_tenv scope psig_env = <nl> { <nl> pre_scope = scope ; <nl> pre_psig_env = psig_env ; <nl> pre_pvar_counters = Hashtbl . create 10 ; <nl> + pre_tenv = saved_tenv ; <nl> } <nl> <nl> - let new_renv proto_renv saved_tenv global_pc this_ty ret_ty = <nl> + let new_renv proto_renv global_pc this_ty ret_ty = <nl> { <nl> re_proto = proto_renv ; <nl> - re_tenv = saved_tenv ; <nl> re_lpc = [ ] ; <nl> re_gpc = [ global_pc ] ; <nl> re_this = this_ty ; <nl> mmm a / hphp / hack / src / ifc / ifc_pretty . ml <nl> ppp b / hphp / hack / src / ifc / ifc_pretty . ml <nl> let env fmt env = <nl> fprintf fmt " @ , Constraints : @ , @ [ < v > % a @ ] " prop p ; <nl> fprintf fmt " @ ] " <nl> <nl> - let policy_sig fmt { psig_policied_properties ; psig_unpolicied_properties } = <nl> + let policy_sig fmt { psig_policied_properties } = <nl> let property fmt ( name , _ty ) = fprintf fmt " % s " name in <nl> let properties fmt = list comma_sep property fmt in <nl> fprintf fmt " @ [ < v > " ; <nl> let policy_sig fmt { psig_policied_properties ; psig_unpolicied_properties } = <nl> " * @ [ < hov2 > Policied properties : @ @ [ < hov > % a @ ] @ ] " <nl> properties <nl> psig_policied_properties ; <nl> - fprintf <nl> - fmt <nl> - " @ , * @ [ < hov2 > Unpolicied properties : @ @ [ < hov > % a @ ] @ ] " <nl> - properties <nl> - psig_unpolicied_properties ; <nl> fprintf fmt " @ ] " <nl> <nl> let policy_sig_env fmt map = <nl> mmm a / hphp / hack / src / ifc / ifc_types . ml <nl> ppp b / hphp / hack / src / ifc / ifc_types . ml <nl> type prop = <nl> | Cflow of ( policy * policy ) <nl> <nl> ( * Policy signature for a class . Used for generating policy types for objects * ) <nl> - type policy_sig = { <nl> - psig_policied_properties : ( string * Type . locl_ty ) list ; <nl> - psig_unpolicied_properties : ( string * Type . locl_ty ) list ; <nl> - } <nl> + type policy_sig = { psig_policied_properties : ( string * Type . locl_ty ) list } <nl> <nl> ( * Types with policies * ) <nl> type ptype = <nl> type proto_renv = { <nl> pre_pvar_counters : ( string , int ref ) Hashtbl . t ; <nl> ( * policy signatures for classes indexed by class name * ) <nl> pre_psig_env : policy_sig SMap . t ; <nl> + ( * Hack type environment * ) <nl> + pre_tenv : Tast . saved_env ; <nl> } <nl> <nl> ( * Read - only environment information managed following a stack discipline <nl> type proto_renv = { <nl> type renv = { <nl> ( * Section of renv needed to initialize full renv * ) <nl> re_proto : proto_renv ; <nl> - ( * Hack type environment * ) <nl> - re_tenv : Tast . saved_env ; <nl> ( * Policy tracking local effects , these effects <nl> are not observable outside the current function . <nl> Assignments to local variables fall into this <nl> mmm a / hphp / hack / test / ifc / property . php . exp <nl> ppp b / hphp / hack / test / ifc / property . php . exp <nl> <nl> Policy signature for \ My : <nl> * Policied properties : mInt , other <nl> - * Unpolicied properties : mBool <nl> <nl> Policy signature for \ Other : <nl> * Policied properties : oBool <nl> - * Unpolicied properties : oString <nl> <nl> Analyzing __construct : <nl> * pc : pc <nl> * This : <nl> - \ My < \ My , lump ' 1 , other - > \ Other < \ Other , lump , oString - > < lump > , <nl> - oBool - > < . oBool > > , mInt - > < . mInt > , mBool - > < lump ' 1 > > <nl> + \ My < \ My , lump ' 1 , other - > \ Other < \ Other , lump , oBool - > < . oBool > > , <nl> + mInt - > < . mInt > > <nl> * Return : < ret > <nl> - * Params : <nl> - { $ o - > \ Other < \ Other ' 1 , lump ' 2 , oString - > < lump ' 2 > , <nl> - oBool - > < . oBool ' 1 > > } <nl> + * Params : { $ o - > \ Other < \ Other ' 1 , lump ' 2 , oBool - > < . oBool ' 1 > > } <nl> * Final environment : <nl> - Locals : <nl> - { $ o - > \ Other < \ Other ' 1 , lump ' 2 , oString - > < lump ' 2 > , <nl> - oBool - > < . oBool ' 1 > > } <nl> + Locals : { $ o - > \ Other < \ Other ' 1 , lump ' 2 , oBool - > < . oBool ' 1 > > } <nl> Constraints : <nl> - [ \ My < \ Other , lump < lump ' 2 , lump ' 2 < lump , . oBool < . oBool ' 1 , <nl> - . oBool ' 1 < . oBool , lump ' 2 = lump , \ Other ' 1 < \ Other , pc < \ Other ] <nl> + [ \ My < \ Other , . oBool < . oBool ' 1 , . oBool ' 1 < . oBool , lump ' 2 = lump , <nl> + \ Other ' 1 < \ Other , pc < \ Other ] <nl> <nl> Analyzing getMInt : <nl> * pc : pc <nl> * This : <nl> - \ My < \ My , lump ' 1 , other - > \ Other < \ Other , lump , oString - > < lump > , <nl> - oBool - > < . oBool > > , mInt - > < . mInt > , mBool - > < lump ' 1 > > <nl> + \ My < \ My , lump ' 1 , other - > \ Other < \ Other , lump , oBool - > < . oBool > > , <nl> + mInt - > < . mInt > > <nl> * Return : < ret > <nl> * Params : { } <nl> * Final environment : <nl> Analyzing getMInt : <nl> Analyzing setMInt : <nl> * pc : pc <nl> * This : <nl> - \ My < \ My , lump ' 1 , other - > \ Other < \ Other , lump , oString - > < lump > , <nl> - oBool - > < . oBool > > , mInt - > < . mInt > , mBool - > < lump ' 1 > > <nl> + \ My < \ My , lump ' 1 , other - > \ Other < \ Other , lump , oBool - > < . oBool > > , <nl> + mInt - > < . mInt > > <nl> * Return : < ret > <nl> * Params : { $ candidate - > < $ candidate > } <nl> * Final environment : <nl> Analyzing \ tlGetMyInt : <nl> * Return : < ret > <nl> * Params : <nl> { $ obj - > <nl> - \ My < \ My , lump ' 1 , other - > \ Other < \ Other , lump , oString - > < lump > , <nl> - oBool - > < . oBool > > , mInt - > < . mInt > , mBool - > < lump ' 1 > > } <nl> + \ My < \ My , lump ' 1 , other - > \ Other < \ Other , lump , oBool - > < . oBool > > , <nl> + mInt - > < . mInt > > } <nl> * Final environment : <nl> Locals : <nl> { $ obj - > <nl> - \ My < \ My , lump ' 1 , other - > \ Other < \ Other , lump , oString - > < lump > , <nl> - oBool - > < . oBool > > , mInt - > < . mInt > , mBool - > < lump ' 1 > > } <nl> + \ My < \ My , lump ' 1 , other - > \ Other < \ Other , lump , oBool - > < . oBool > > , <nl> + mInt - > < . mInt > > } <nl> Constraints : <nl> [ . mInt < . mInt ' 1 , \ My < . mInt ' 1 , . mInt ' 1 < ret ] <nl> <nl> Analyzing \ tlSetMyInt : <nl> * Return : < ret > <nl> * Params : <nl> { $ obj - > <nl> - \ My < \ My , lump ' 1 , other - > \ Other < \ Other , lump , oString - > < lump > , <nl> - oBool - > < . oBool > > , mInt - > < . mInt > , mBool - > < lump ' 1 > > ; <nl> + \ My < \ My , lump ' 1 , other - > \ Other < \ Other , lump , oBool - > < . oBool > > , <nl> + mInt - > < . mInt > > ; <nl> $ val - > < $ val > } <nl> * Final environment : <nl> Locals : <nl> { $ obj - > <nl> - \ My < \ My , lump ' 1 , other - > \ Other < \ Other , lump , oString - > < lump > , <nl> - oBool - > < . oBool > > , mInt - > < . mInt > , mBool - > < lump ' 1 > > ; <nl> + \ My < \ My , lump ' 1 , other - > \ Other < \ Other , lump , oBool - > < . oBool > > , <nl> + mInt - > < . mInt > > ; <nl> $ val - > < $ val > } <nl> Constraints : <nl> [ \ My < . mInt , $ val < . mInt , pc < . mInt ] <nl> Analyzing \ tlSetMyInt : <nl> Analyzing \ tlGetOther : <nl> * pc : pc <nl> * This : None <nl> - * Return : \ Other < \ Other , lump , oString - > < lump > , oBool - > < . oBool > > <nl> + * Return : \ Other < \ Other , lump , oBool - > < . oBool > > <nl> * Params : <nl> { $ obj - > <nl> - \ My < \ My , lump ' 2 , other - > \ Other < \ Other ' 1 , lump ' 1 , oString - > < lump ' 1 > , <nl> - oBool - > < . oBool ' 1 > > , mInt - > < . mInt > , mBool - > < lump ' 2 > > } <nl> + \ My < \ My , lump ' 2 , other - > \ Other < \ Other ' 1 , lump ' 1 , oBool - > < . oBool ' 1 > > , <nl> + mInt - > < . mInt > > } <nl> * Final environment : <nl> Locals : <nl> { $ obj - > <nl> - \ My < \ My , lump ' 2 , other - > \ Other < \ Other ' 1 , lump ' 1 , oString - > < lump ' 1 > , <nl> - oBool - > < . oBool ' 1 > > , mInt - > < . mInt > , mBool - > < lump ' 2 > > } <nl> + \ My < \ My , lump ' 2 , other - > \ Other < \ Other ' 1 , lump ' 1 , oBool - > < . oBool ' 1 > > , <nl> + mInt - > < . mInt > > } <nl> Constraints : <nl> - [ \ Other ' 1 < . other , \ My < . other , lump < lump ' 1 , lump ' 1 < lump , <nl> - . oBool < . oBool ' 1 , . oBool ' 1 < . oBool , lump ' 1 = lump , . other < \ Other ] <nl> + [ \ Other ' 1 < . other , \ My < . other , . oBool < . oBool ' 1 , . oBool ' 1 < . oBool , <nl> + lump ' 1 = lump , . other < \ Other ] <nl> <nl> Analyzing \ tlGetOtherBool : <nl> * pc : pc <nl> Analyzing \ tlGetOtherBool : <nl> * Return : < ret > <nl> * Params : <nl> { $ obj - > <nl> - \ My < \ My , lump ' 1 , other - > \ Other < \ Other , lump , oString - > < lump > , <nl> - oBool - > < . oBool > > , mInt - > < . mInt > , mBool - > < lump ' 1 > > } <nl> + \ My < \ My , lump ' 1 , other - > \ Other < \ Other , lump , oBool - > < . oBool > > , <nl> + mInt - > < . mInt > > } <nl> * Final environment : <nl> Locals : <nl> { $ obj - > <nl> - \ My < \ My , lump ' 1 , other - > \ Other < \ Other , lump , oString - > < lump > , <nl> - oBool - > < . oBool > > , mInt - > < . mInt > , mBool - > < lump ' 1 > > } <nl> + \ My < \ My , lump ' 1 , other - > \ Other < \ Other , lump , oBool - > < . oBool > > , <nl> + mInt - > < . mInt > > } <nl> Constraints : <nl> [ \ Other < . other , \ My < . other , . oBool < . oBool ' 1 , . other < . oBool ' 1 , <nl> . oBool ' 1 < ret ] <nl> Analyzing \ tlSetOtherBool : <nl> * Params : <nl> { $ bool - > < $ bool > ; <nl> $ obj - > <nl> - \ My < \ My , lump ' 1 , other - > \ Other < \ Other , lump , oString - > < lump > , <nl> - oBool - > < . oBool > > , mInt - > < . mInt > , mBool - > < lump ' 1 > > } <nl> + \ My < \ My , lump ' 1 , other - > \ Other < \ Other , lump , oBool - > < . oBool > > , <nl> + mInt - > < . mInt > > } <nl> * Final environment : <nl> Locals : <nl> { $ bool - > < $ bool > ; <nl> $ obj - > <nl> - \ My < \ My , lump ' 1 , other - > \ Other < \ Other , lump , oString - > < lump > , <nl> - oBool - > < . oBool > > , mInt - > < . mInt > , mBool - > < lump ' 1 > > } <nl> + \ My < \ My , lump ' 1 , other - > \ Other < \ Other , lump , oBool - > < . oBool > > , <nl> + mInt - > < . mInt > > } <nl> Constraints : <nl> [ \ Other < . other , \ My < . other , . other < . oBool , $ bool < . oBool , <nl> pc < . oBool ] <nl> mmm a / hphp / hack / test / ifc / unpolicied_fields . php . exp <nl> ppp b / hphp / hack / test / ifc / unpolicied_fields . php . exp <nl> <nl> Policy signature for \ C : <nl> * Policied properties : cx <nl> - * Unpolicied properties : cy , cd <nl> <nl> Policy signature for \ D : <nl> * Policied properties : <nl> - * Unpolicied properties : di <nl> <nl> Analyzing __construct : <nl> * pc : pc <nl> - * This : <nl> - \ C < \ C , lump , cy - > < lump > , cx - > < . cx > , <nl> - cd - > \ D < lump , lump , di - > < lump > > > <nl> + * This : \ C < \ C , lump , cx - > < . cx > > <nl> * Return : < ret > <nl> - * Params : { $ cd - > \ D < \ D , lump ' 1 , di - > < lump ' 1 > > } <nl> + * Params : { $ cd - > \ D < \ D , lump ' 1 , > } <nl> * Final environment : <nl> - Locals : { $ cd - > \ D < \ D , lump ' 1 , di - > < lump ' 1 > > } <nl> + Locals : { $ cd - > \ D < \ D , lump ' 1 , > } <nl> Constraints : <nl> - [ \ C < lump , lump < lump ' 1 , lump ' 1 < lump , lump ' 1 = lump , \ D < lump , <nl> - pc < lump ] <nl> + [ \ C < lump , lump ' 1 = lump , \ D < lump , pc < lump ] <nl> <nl> Analyzing testGetUnpolicied : <nl> * pc : pc <nl> - * This : <nl> - \ C < \ C , lump , cy - > < lump > , cx - > < . cx > , <nl> - cd - > \ D < lump , lump , di - > < lump > > > <nl> - * Return : \ D < \ D , lump ' 1 , di - > < lump ' 1 > > <nl> + * This : \ C < \ C , lump , cx - > < . cx > > <nl> + * Return : \ D < \ D , lump ' 1 , > <nl> * Params : { } <nl> * Final environment : <nl> Locals : { } <nl> Constraints : <nl> - [ lump < . cd , \ C < . cd , lump ' 1 < lump , lump < lump ' 1 , lump = lump ' 1 , <nl> - . cd < \ D ] <nl> + [ lump < . cd , \ C < . cd , lump = lump ' 1 , . cd < \ D ] <nl> <nl> Analyzing testSetMultipleUnpolicied : <nl> * pc : pc <nl> - * This : <nl> - \ C < \ C , lump , cy - > < lump > , cx - > < . cx > , <nl> - cd - > \ D < lump , lump , di - > < lump > > > <nl> + * This : \ C < \ C , lump , cx - > < . cx > > <nl> * Return : < ret > <nl> - * Params : { $ d - > \ D < \ D , lump ' 1 , di - > < lump ' 1 > > } <nl> + * Params : { $ d - > \ D < \ D , lump ' 1 , > } <nl> * Final environment : <nl> - Locals : { $ d - > \ D < \ D , lump ' 1 , di - > < lump ' 1 > > } <nl> + Locals : { $ d - > \ D < \ D , lump ' 1 , > } <nl> Constraints : <nl> - [ \ C < lump , Bot < lump , pc < lump , \ C < lump , lump < lump ' 1 , <nl> - lump ' 1 < lump , lump ' 1 = lump , \ D < lump , pc < lump ] <nl> + [ \ C < lump , Bot < lump , pc < lump , \ C < lump , lump ' 1 = lump , \ D < lump , <nl> + pc < lump ] <nl> <nl> Analyzing testSetDeep : <nl> * pc : pc <nl> - * This : <nl> - \ C < \ C , lump , cy - > < lump > , cx - > < . cx > , <nl> - cd - > \ D < lump , lump , di - > < lump > > > <nl> + * This : \ C < \ C , lump , cx - > < . cx > > <nl> * Return : < ret > <nl> * Params : { $ i - > < $ i > } <nl> * Final environment : <nl> Analyzing testSetDeep : <nl> <nl> Analyzing __construct : <nl> * pc : pc <nl> - * This : \ D < \ D , lump , di - > < lump > > <nl> + * This : \ D < \ D , lump , > <nl> * Return : < ret > <nl> * Params : { $ di - > < $ di > } <nl> * Final environment : <nl>
|
Implicitly store unpolicied fields
|
facebook/hhvm
|
3568d1c2352226c407035bc7ec55b8f71fa7d09f
|
2020-06-09T12:00:11Z
|
mmm a / tensorflow / g3doc / tutorials / mnist / beginners / index . md <nl> ppp b / tensorflow / g3doc / tutorials / mnist / beginners / index . md <nl> or negative weight . Softmax then normalizes these weights , so that they add up <nl> to one , forming a valid probability distribution . ( To get more intuition about <nl> the softmax function , check out the <nl> [ section ] ( http : / / neuralnetworksanddeeplearning . com / chap3 . html # softmax ) <nl> - on it in Michael Nieslen ' s book , complete with an interactive visualization . ) <nl> + on it in Michael Nielsen ' s book , complete with an interactive visualization . ) <nl> <nl> <nl> You can picture our softmax regression as looking something like the following , <nl>
|
fixed typo in website
|
tensorflow/tensorflow
|
7d6bff455d73aca56adcd5212e1b8dbc94e7360a
|
2016-03-22T21:08:16Z
|
mmm a / include / Http . h <nl> ppp b / include / Http . h <nl> extern " C " <nl> <nl> enum http_method <nl> { <nl> - HTTP_DELETE = 0 , HTTP_GET , HTTP_HEAD , HTTP_POST , HTTP_PUT , <nl> + HTTP_DELETE = 1 , HTTP_GET , HTTP_HEAD , HTTP_POST , HTTP_PUT , <nl> / * pathological * / <nl> HTTP_CONNECT , HTTP_OPTIONS , HTTP_TRACE , <nl> / * webdav * / <nl> typedef int ( * http_cb ) ( http_parser * ) ; <nl> <nl> enum http_parser_type <nl> { <nl> - HTTP_REQUEST , HTTP_RESPONSE , HTTP_BOTH <nl> + HTTP_REQUEST = 1 , <nl> + HTTP_RESPONSE , <nl> + HTTP_BOTH , <nl> } ; <nl> <nl> enum http_version <nl> { <nl> - HTTP_VERSION_10 , <nl> + HTTP_VERSION_10 = 1 , <nl> HTTP_VERSION_11 , <nl> } ; <nl> <nl> mmm a / src / protocol / Http . c <nl> ppp b / src / protocol / Http . c <nl> int swHttpRequest_get_protocol ( swHttpRequest * request ) <nl> } <nl> else if ( memcmp ( p , " HTTP / 1 . 0 " , 8 ) = = 0 ) <nl> { <nl> - request - > method = HTTP_VERSION_10 ; <nl> + request - > version = HTTP_VERSION_10 ; <nl> break ; <nl> } <nl> else <nl>
|
Fixed http protocol parse error for http1 . 0
|
swoole/swoole-src
|
d0638de57621a23d7eed578f3bfb889d7bf736bd
|
2014-10-09T11:12:49Z
|
mmm a / caffe2 / operators / conv_op_cache_cudnn . h <nl> ppp b / caffe2 / operators / conv_op_cache_cudnn . h <nl> <nl> # include " caffe2 / core / tensor . h " <nl> <nl> namespace caffe2 { <nl> - template < typename T > <nl> + template < typename TAlgorithm > <nl> class AlgorithmsCache { <nl> public : <nl> - T getAlgorithm ( <nl> - const std : : vector < TIndex > & bottom , <nl> - const std : : vector < TIndex > & desc , <nl> - std : : function < T ( ) > generatingFunc ) ; <nl> + / / Caches the best algorithm for a given <nl> + / / combination of tensor dimensions & compute data type . <nl> + / / <nl> + TAlgorithm getAlgorithm ( <nl> + const std : : vector < TIndex > & tensorDimensions1 , <nl> + const std : : vector < TIndex > & tensorDimensions2 , <nl> + int algorithmFlags , / / Differentiate between algorithms with different <nl> + / / parameters in a generic way <nl> + std : : function < TAlgorithm ( ) > generatingFunc ) ; <nl> <nl> private : <nl> - std : : unordered_map < int64_t , T > hash_ ; <nl> + std : : unordered_map < int64_t , TAlgorithm > hash_ ; <nl> } ; <nl> <nl> - template < typename T > <nl> - T AlgorithmsCache < T > : : getAlgorithm ( <nl> - const std : : vector < TIndex > & vec1 , <nl> - const std : : vector < TIndex > & vec2 , <nl> - std : : function < T ( ) > generatingFunc ) { <nl> - uint64_t seed = 0 ; <nl> + template < typename TAlgorithm > <nl> + TAlgorithm AlgorithmsCache < TAlgorithm > : : getAlgorithm ( <nl> + const std : : vector < TIndex > & tensorDimensions1 , <nl> + const std : : vector < TIndex > & tensorDimensions2 , <nl> + int algorithmFlags , <nl> + std : : function < TAlgorithm ( ) > generatingFunc ) { <nl> + int64_t seed = 0 ; <nl> + / / Hash all of the inputs , which we wiill then use to try and look up <nl> + / / a previously discovered algorithm , or fall back to generating a new one . <nl> std : : hash < TIndex > hashFn ; <nl> - for ( const auto num : vec1 ) { <nl> + for ( const auto num : tensorDimensions1 ) { <nl> / / Copied from boost : : hash_combine . <nl> / / Adding 1 to differentiate between first and second vector . <nl> seed ^ = hashFn ( num ) + 0x9e3779b9 + ( seed < < 6 ) + ( seed > > 2 ) + 1 ; <nl> } <nl> <nl> - for ( const auto num : vec2 ) { <nl> + for ( const auto num : tensorDimensions2 ) { <nl> / / Copied from boost : : hash_combine . <nl> seed ^ = hashFn ( num ) + 0x9e3779b9 + ( seed < < 6 ) + ( seed > > 2 ) ; <nl> } <nl> <nl> + / / Adding 2 to differentiate from previous vectors <nl> + seed ^ = hashFn ( algorithmFlags ) + 0x9e3779b9 + ( seed < < 6 ) + ( seed > > 2 ) + 2 ; <nl> + <nl> if ( seed = = 0 ) { <nl> return generatingFunc ( ) ; <nl> } <nl> <nl> if ( hash_ . find ( seed ) = = hash_ . end ( ) ) { <nl> - T value = generatingFunc ( ) ; <nl> + TAlgorithm value = generatingFunc ( ) ; <nl> hash_ [ seed ] = value ; <nl> } <nl> <nl> return hash_ [ seed ] ; <nl> } <nl> - } <nl> + } / / namespace caffe2 <nl> + <nl> # endif <nl> mmm a / caffe2 / operators / conv_op_cache_cudnn_test . cc <nl> ppp b / caffe2 / operators / conv_op_cache_cudnn_test . cc <nl> namespace caffe2 { <nl> TEST ( AlgorithmsCacheTest , CachesCorrectly ) { <nl> AlgorithmsCache < int > cache ; <nl> int result = cache . getAlgorithm ( <nl> - std : : vector < TIndex > ( 1 ) , std : : vector < TIndex > ( 1 ) , [ ] ( ) { return 5 ; } ) ; <nl> + std : : vector < TIndex > ( 1 ) , std : : vector < TIndex > ( 1 ) , 0 , [ ] ( ) { return 5 ; } ) ; <nl> EXPECT_EQ ( result , 5 ) ; <nl> <nl> int res2 = cache . getAlgorithm ( <nl> - std : : vector < TIndex > ( 1 ) , std : : vector < TIndex > ( 1 ) , [ ] ( ) { return 10 ; } ) ; <nl> + std : : vector < TIndex > ( 1 ) , std : : vector < TIndex > ( 1 ) , 0 , [ ] ( ) { return 10 ; } ) ; <nl> <nl> EXPECT_EQ ( res2 , 5 ) ; <nl> } <nl> <nl> - TEST ( AlgorithmsCacheTest , DoesNotCacheEmptyKeys ) { <nl> + TEST ( AlgorithmsCacheTest , KeysDifferIfOneVectorIsEmpty ) { <nl> AlgorithmsCache < int > cache ; <nl> int result = cache . getAlgorithm ( <nl> - std : : vector < TIndex > ( ) , std : : vector < TIndex > ( ) , [ ] ( ) { return 5 ; } ) ; <nl> + std : : vector < TIndex > ( 1 , 10 ) , std : : vector < TIndex > ( ) , 0 , [ ] ( ) { return 5 ; } ) ; <nl> EXPECT_EQ ( result , 5 ) ; <nl> <nl> int res2 = cache . getAlgorithm ( <nl> - std : : vector < TIndex > ( ) , std : : vector < TIndex > ( ) , [ ] ( ) { return 10 ; } ) ; <nl> + std : : vector < TIndex > ( ) , std : : vector < TIndex > ( 1 , 10 ) , 0 , [ ] ( ) { <nl> + return 10 ; <nl> + } ) ; <nl> <nl> EXPECT_EQ ( res2 , 10 ) ; <nl> } <nl> <nl> - TEST ( AlgorithmsCacheTest , KeysDifferIfOneVectorIsEmpty ) { <nl> + TEST ( AlgorithmsCacheTest , KeysDifferIfFlagsAreDifferent ) { <nl> AlgorithmsCache < int > cache ; <nl> int result = cache . getAlgorithm ( <nl> - std : : vector < TIndex > ( 1 , 10 ) , std : : vector < TIndex > ( ) , [ ] ( ) { return 5 ; } ) ; <nl> + std : : vector < TIndex > { 2 , 3 , 4 } , std : : vector < TIndex > { 5 , 6 } , 123 , [ ] ( ) { <nl> + return 5 ; <nl> + } ) ; <nl> EXPECT_EQ ( result , 5 ) ; <nl> <nl> int res2 = cache . getAlgorithm ( <nl> - std : : vector < TIndex > ( ) , std : : vector < TIndex > ( 1 , 10 ) , [ ] ( ) { return 10 ; } ) ; <nl> + std : : vector < TIndex > { 2 , 3 , 4 } , std : : vector < TIndex > { 5 , 6 } , 456 , [ ] ( ) { <nl> + return 10 ; <nl> + } ) ; <nl> <nl> EXPECT_EQ ( res2 , 10 ) ; <nl> + <nl> + int res3 = cache . getAlgorithm ( <nl> + std : : vector < TIndex > { 2 , 3 , 4 } , std : : vector < TIndex > { 5 , 6 } , 456 , [ ] ( ) { <nl> + return 15 ; <nl> + } ) ; <nl> + <nl> + EXPECT_EQ ( res3 , 10 ) ; <nl> } <nl> <nl> } / / namespace caffe2 <nl> mmm a / caffe2 / operators / conv_op_cudnn . cc <nl> ppp b / caffe2 / operators / conv_op_cudnn . cc <nl> <nl> * / <nl> <nl> # include " caffe2 / core / context_gpu . h " <nl> + <nl> + # include " caffe2 / core / common_gpu . h " <nl> # include " caffe2 / core / cudnn_wrappers . h " <nl> # include " caffe2 / operators / conv_op . h " <nl> # include " caffe2 / operators / conv_op_cache_cudnn . h " <nl> # include " caffe2 / operators / conv_pool_op_base . h " <nl> + # include " caffe2 / operators / op_utils_cudnn . h " <nl> <nl> namespace caffe2 { <nl> <nl> - / / Earlier in the days Caffe sets the default cudnn workspace to 8MB . We bump <nl> - / / it up to 64MB in Caffe2 , as this enables the use of Winograd in many cases , <nl> - / / something very beneficial to more recent CNN models . <nl> - static constexpr size_t kCONV_CUDNN_WORKSPACE_LIMIT_BYTES = 64 * 1024 * 1024 ; <nl> - <nl> - / / Manually specified number of algorithms implemented in CuDNN . <nl> - / / This does not have any performance implications , as we will always find the <nl> - / / fastest algorithm ; setting them to the right number of algorithms will enable <nl> - / / us to best report the statistics when doing an exhaustive search , though . <nl> - # if CUDNN_VERSION_MIN ( 7 , 0 , 0 ) <nl> - / / Note : Double each of these due to potential <nl> - / / tensorcode + non - tensorcore versions <nl> - / / which are treated as seperate returned algos <nl> - static constexpr size_t kNUM_CUDNN_FWD_ALGS = <nl> - 2 * CUDNN_CONVOLUTION_FWD_ALGO_COUNT ; <nl> - static constexpr size_t kNUM_CUDNN_BWD_FILTER_ALGS = <nl> - 2 * CUDNN_CONVOLUTION_BWD_FILTER_ALGO_COUNT ; <nl> - static constexpr size_t kNUM_CUDNN_BWD_DATA_ALGS = <nl> - 2 * CUDNN_CONVOLUTION_BWD_DATA_ALGO_COUNT ; <nl> - # else <nl> - static constexpr size_t kNUM_CUDNN_FWD_ALGS = 7 ; <nl> - static constexpr size_t kNUM_CUDNN_BWD_FILTER_ALGS = 4 ; <nl> - static constexpr size_t kNUM_CUDNN_BWD_DATA_ALGS = 5 ; <nl> - # endif <nl> - <nl> - namespace { <nl> - template < typename ArrayOfcudnnConvolutionAlgoPerf_t > <nl> - inline void LogCuDNNPerfStats ( <nl> - const ArrayOfcudnnConvolutionAlgoPerf_t & perf_stat , <nl> - int returned_algo_count ) { <nl> - VLOG ( 1 ) < < " Perf result : ( algo : stat , time , memory ) " ; <nl> - for ( int i = 0 ; i < returned_algo_count ; + + i ) { <nl> - const auto & stat = perf_stat [ i ] ; <nl> - VLOG ( 1 ) < < stat . algo < < " : " < < stat . status < < " " < < stat . time < < " " <nl> - < < stat . memory ; <nl> - } <nl> - } <nl> - <nl> - / / Easier indexing into force_algo_ vector <nl> - enum { <nl> - ALGO_FWD = 0 , <nl> - ALGO_WGRAD = 1 , <nl> - ALGO_DGRAD = 2 <nl> - } algoIndex_t ; <nl> - <nl> - } / / namespace <nl> - <nl> class CudnnConvOpBase : public ConvPoolOpBase < CUDAContext > { <nl> public : <nl> CudnnConvOpBase ( const OperatorDef & operator_def , Workspace * ws ) <nl> class CudnnConvOpBase : public ConvPoolOpBase < CUDAContext > { <nl> " The cudnn convolution does not support dilation yet . " ) ; <nl> # endif <nl> <nl> + # if CUDNN_VERSION_MIN ( 7 , 0 , 0 ) <nl> + / / verify TensorCore math is supported <nl> + enable_tensor_core_ & = TensorCoreAvailable ( ) ; <nl> + # else <nl> + enable_tensor_core_ = false ; <nl> + # endif <nl> + <nl> bool individual_force_algo = OperatorBase : : HasArgument ( " force_algo_fwd " ) | | <nl> OperatorBase : : HasArgument ( " force_algo_dgrad " ) | | <nl> OperatorBase : : HasArgument ( " force_algo_wgrad " ) ; <nl> class CudnnConvOpBase : public ConvPoolOpBase < CUDAContext > { <nl> template < typename T > <nl> void SetTensorNdDescriptorWithGroup ( <nl> int size , <nl> - cudnnTensorDescriptor_t desc_ , <nl> + cudnnTensorDescriptor_t tensorDesc , <nl> int N , <nl> int C , <nl> int H , <nl> class CudnnConvOpBase : public ConvPoolOpBase < CUDAContext > { <nl> case StorageOrder : : NHWC : <nl> if ( size = = 4 ) { <nl> CUDNN_ENFORCE ( cudnnSetTensor4dDescriptorEx ( <nl> - desc_ , <nl> + tensorDesc , <nl> cudnnTypeWrapper < T > : : type , <nl> N , <nl> CC , <nl> class CudnnConvOpBase : public ConvPoolOpBase < CUDAContext > { <nl> vector < int > dims = { N , H , W , D , CC } ; <nl> vector < int > strides = { H * W * D * CC , W * D * CC , D * CC , CC , 1 } ; <nl> CUDNN_ENFORCE ( cudnnSetTensorNdDescriptor ( <nl> - desc_ , <nl> + tensorDesc , <nl> cudnnTypeWrapper < T > : : type , <nl> size > 3 ? size : 4 , <nl> dims . data ( ) , <nl> class CudnnConvOpBase : public ConvPoolOpBase < CUDAContext > { <nl> case StorageOrder : : NCHW : <nl> if ( size = = 4 ) { <nl> CUDNN_ENFORCE ( cudnnSetTensor4dDescriptorEx ( <nl> - desc_ , <nl> + tensorDesc , <nl> cudnnTypeWrapper < T > : : type , <nl> N , <nl> CC , <nl> class CudnnConvOpBase : public ConvPoolOpBase < CUDAContext > { <nl> vector < int > dims = { N , CC , H , W , D } ; <nl> vector < int > strides = { CC * H * W * D , H * W * D , W * D , D , 1 } ; <nl> CUDNN_ENFORCE ( cudnnSetTensorNdDescriptor ( <nl> - desc_ , <nl> + tensorDesc , <nl> cudnnTypeWrapper < T > : : type , <nl> size > 3 ? size : 4 , <nl> dims . data ( ) , <nl> class CudnnConvOpBase : public ConvPoolOpBase < CUDAContext > { <nl> } <nl> } <nl> <nl> + void DuplicateConvDesc ( <nl> + cudnnConvolutionDescriptor_t input , <nl> + size_t kernelDims , <nl> + size_t dilationDims , <nl> + cudnnConvolutionDescriptor_t copy ) { <nl> + if ( kernelDims = = 2 ) { <nl> + cudnnConvolutionMode_t mode ; <nl> + cudnnDataType_t dataType ; <nl> + int pad_height = 0 ; <nl> + int pad_width = 0 ; <nl> + int stride_height = 0 ; <nl> + int stride_width = 0 ; <nl> + int dilation_height = 0 ; <nl> + int dilation_width = 0 ; <nl> + <nl> + CUDNN_ENFORCE ( cudnnGetConvolution2dDescriptor ( <nl> + input , <nl> + & pad_height , <nl> + & pad_width , <nl> + & stride_height , <nl> + & stride_width , <nl> + & dilation_height , <nl> + & dilation_width , <nl> + & mode , <nl> + & dataType ) ) ; <nl> + <nl> + CUDNN_ENFORCE ( cudnnSetConvolution2dDescriptor ( <nl> + copy , <nl> + pad_height , <nl> + pad_width , <nl> + stride_height , <nl> + stride_width , <nl> + dilation_height , <nl> + dilation_width , <nl> + mode , <nl> + dataType ) ) ; <nl> + } else { <nl> + cudnnConvolutionMode_t mode ; <nl> + cudnnDataType_t dataType ; <nl> + int arrayLength = 0 ; <nl> + vector < int > ones ( dilationDims , 1 ) ; <nl> + CUDNN_ENFORCE ( cudnnGetConvolutionNdDescriptor ( <nl> + input , <nl> + kernel_ . size ( ) , <nl> + & arrayLength , <nl> + pads_ . data ( ) , <nl> + stride_ . data ( ) , <nl> + ones . data ( ) , <nl> + & mode , <nl> + & dataType ) ) ; <nl> + <nl> + CUDNN_ENFORCE ( cudnnSetConvolutionNdDescriptor ( <nl> + copy , <nl> + kernel_ . size ( ) , <nl> + pads_ . data ( ) , <nl> + stride_ . data ( ) , <nl> + ones . data ( ) , <nl> + mode , <nl> + dataType ) ) ; <nl> + } <nl> + } <nl> + <nl> + template < typename T > <nl> + cudnnDataType_t DetermineComputeTypeFromInput ( const T & X ) { <nl> + const cudaDeviceProp & prop = GetDeviceProperty ( 0 ) ; <nl> + cudnnDataType_t computeType = CUDNN_DATA_FLOAT ; <nl> + if ( X . template IsType < float16 > ( ) ) { <nl> + if ( float16_compute_ & & prop . major > = 6 ) { <nl> + VLOG ( 1 ) < < " CUDNN Convolution : float16_compute specified and " <nl> + < < " supported , input data is float16 - using float16 " <nl> + < < " compute . " ; <nl> + computeType = CUDNN_DATA_HALF ; <nl> + } else if ( float16_compute_ ) { <nl> + VLOG ( 1 ) < < " CUDNN Convolution : float16_compute specified but " <nl> + < < " not supported , input data is float16 - using float32 " <nl> + < < " compute . " ; <nl> + } else { <nl> + VLOG ( 1 ) < < " CUDNN Convolution : float16_compute not specified but " <nl> + < < " input data is float16 - using float32 compute . " ; <nl> + } <nl> + } else { <nl> + VLOG ( 1 ) < < " CUDNN Convolution : using float32 compute . " ; <nl> + } <nl> + return computeType ; <nl> + } <nl> + <nl> + void SetConvDescFromArguments ( ) { <nl> + # if CUDNN_VERSION_MIN ( 6 , 0 , 0 ) <nl> + if ( kernel_ . size ( ) = = 2 ) { <nl> + CUDNN_ENFORCE ( cudnnSetConvolution2dDescriptor ( <nl> + conv_desc_ , <nl> + pad_t ( ) , <nl> + pad_l ( ) , <nl> + stride_h ( ) , <nl> + stride_w ( ) , <nl> + dilation_h ( ) , <nl> + dilation_w ( ) , <nl> + CUDNN_CROSS_CORRELATION , <nl> + compute_type_ ) ) ; <nl> + } else { <nl> + CUDNN_ENFORCE ( cudnnSetConvolutionNdDescriptor ( <nl> + conv_desc_ , <nl> + kernel_ . size ( ) , <nl> + pads_ . data ( ) , <nl> + stride_ . data ( ) , <nl> + dilation_ . data ( ) , <nl> + CUDNN_CROSS_CORRELATION , <nl> + compute_type_ ) ) ; <nl> + } <nl> + # else <nl> + if ( kernel_ . size ( ) = = 2 ) { <nl> + CUDNN_ENFORCE ( cudnnSetConvolution2dDescriptor ( <nl> + conv_desc_ , <nl> + pad_t ( ) , <nl> + pad_l ( ) , <nl> + stride_h ( ) , <nl> + stride_w ( ) , <nl> + 1 , <nl> + 1 , <nl> + CUDNN_CROSS_CORRELATION , <nl> + compute_type_ ) ) ; <nl> + } else { <nl> + vector < int > ones ( dilation_ . size ( ) , 1 ) ; <nl> + CUDNN_ENFORCE ( cudnnSetConvolutionNdDescriptor ( <nl> + conv_desc_ , <nl> + kernel_ . size ( ) , <nl> + pads_ . data ( ) , <nl> + stride_ . data ( ) , <nl> + ones . data ( ) , <nl> + CUDNN_CROSS_CORRELATION , <nl> + compute_type_ ) ) ; <nl> + } <nl> + # endif <nl> + } <nl> + <nl> + void SetConvDescComputeType ( <nl> + cudnnConvolutionDescriptor_t conv_desc , <nl> + cudnnDataType_t math ) { <nl> + if ( kernel_ . size ( ) = = 2 ) { <nl> + cudnnConvolutionMode_t mode ; <nl> + cudnnDataType_t dataType ; <nl> + int pad_height = 0 ; <nl> + int pad_width = 0 ; <nl> + int stride_height = 0 ; <nl> + int stride_width = 0 ; <nl> + int dilation_height = 0 ; <nl> + int dilation_width = 0 ; <nl> + <nl> + CUDNN_ENFORCE ( cudnnGetConvolution2dDescriptor ( <nl> + conv_desc , <nl> + & pad_height , <nl> + & pad_width , <nl> + & stride_height , <nl> + & stride_width , <nl> + & dilation_height , <nl> + & dilation_width , <nl> + & mode , <nl> + & dataType ) ) ; <nl> + <nl> + CUDNN_ENFORCE ( cudnnSetConvolution2dDescriptor ( <nl> + conv_desc , <nl> + pad_height , <nl> + pad_width , <nl> + stride_height , <nl> + stride_width , <nl> + dilation_height , <nl> + dilation_width , <nl> + mode , <nl> + math ) ) ; <nl> + } else { <nl> + cudnnConvolutionMode_t mode ; <nl> + cudnnDataType_t dataType ; <nl> + int arrayLength = 0 ; <nl> + vector < int > ones ( dilation_ . size ( ) , 1 ) ; <nl> + CUDNN_ENFORCE ( cudnnGetConvolutionNdDescriptor ( <nl> + conv_desc , <nl> + kernel_ . size ( ) , <nl> + & arrayLength , <nl> + pads_ . data ( ) , <nl> + stride_ . data ( ) , <nl> + ones . data ( ) , <nl> + & mode , <nl> + & dataType ) ) ; <nl> + <nl> + CUDNN_ENFORCE ( cudnnSetConvolutionNdDescriptor ( <nl> + conv_desc , <nl> + kernel_ . size ( ) , <nl> + pads_ . data ( ) , <nl> + stride_ . data ( ) , <nl> + ones . data ( ) , <nl> + mode , <nl> + math ) ) ; <nl> + } <nl> + } <nl> + <nl> vector < TIndex > cudnn_input_dims_ ; <nl> vector < TIndex > cudnn_filter_dims_ ; <nl> <nl> class CudnnConvOpBase : public ConvPoolOpBase < CUDAContext > { <nl> size_t cudnn_state_ ; <nl> vector < int > force_algo_ ; / / stored as FWD , dFILTER , dDATA <nl> bool enable_tensor_core_ ; <nl> + cudnnDataType_t compute_type_ ; <nl> } ; <nl> <nl> - <nl> class CudnnConvOp final : public CudnnConvOpBase { <nl> public : <nl> CudnnConvOp ( const OperatorDef & operator_def , Workspace * ws ) <nl> - : CudnnConvOpBase ( operator_def , ws ) { } <nl> + : CudnnConvOpBase ( operator_def , ws ) { } <nl> <nl> ~ CudnnConvOp ( ) { } <nl> <nl> - template < typename T_X , typename T_W , typename T_B , typename MATH , typename T_Y > <nl> + template < typename T_X , typename T_W , typename T_B , typename T_Y > <nl> bool DoRunWithType ( ) ; <nl> <nl> bool RunOnDevice ( ) override ; <nl> <nl> private : <nl> cudnnConvolutionFwdAlgo_t algo_ ; <nl> - AlgorithmsCache < cudnnConvolutionFwdAlgo_t > algo_cache_ ; <nl> + using ConvFwdAlgorithmWithCost = std : : tuple < cudnnConvolutionFwdAlgo_t , float > ; <nl> + AlgorithmsCache < ConvFwdAlgorithmWithCost > algo_cache_ ; <nl> / / Input : X , W , b <nl> / / Output : Y <nl> INPUT_TAGS ( INPUT , FILTER , BIAS ) ; <nl> class CudnnConvGradientOp final : public CudnnConvOpBase { <nl> CAFFE_ENFORCE ( <nl> ! ( no_bias_ & & OutputSize ( ) = = 3 ) , <nl> " If bias is not present , you should not have 3 grad output . " ) ; <nl> + <nl> + CUDNN_ENFORCE ( cudnnCreateConvolutionDescriptor ( & bwd_data_conv_desc_ ) ) ; <nl> + CUDNN_ENFORCE ( cudnnCreateConvolutionDescriptor ( & bwd_filter_conv_desc_ ) ) ; <nl> } <nl> <nl> - ~ CudnnConvGradientOp ( ) { } <nl> + ~ CudnnConvGradientOp ( ) { <nl> + CUDNN_ENFORCE ( cudnnDestroyConvolutionDescriptor ( bwd_data_conv_desc_ ) ) ; <nl> + CUDNN_ENFORCE ( cudnnDestroyConvolutionDescriptor ( bwd_filter_conv_desc_ ) ) ; <nl> + } <nl> <nl> - template < typename T_X , typename T_DY , typename T_W , typename T_B , <nl> - typename MATH , <nl> - typename T_DX , typename T_DW , typename T_DB > <nl> + template < <nl> + typename T_X , <nl> + typename T_DY , <nl> + typename T_W , <nl> + typename T_B , <nl> + typename T_DX , <nl> + typename T_DW , <nl> + typename T_DB > <nl> bool DoRunWithType ( ) ; <nl> <nl> bool RunOnDevice ( ) override ; <nl> <nl> private : <nl> + cudnnConvolutionDescriptor_t bwd_filter_conv_desc_ ; <nl> + cudnnConvolutionDescriptor_t bwd_data_conv_desc_ ; <nl> cudnnConvolutionBwdFilterAlgo_t bwd_filter_algo_ ; <nl> cudnnConvolutionBwdDataAlgo_t bwd_data_algo_ ; <nl> - AlgorithmsCache < cudnnConvolutionBwdFilterAlgo_t > filter_algo_cache_ ; <nl> - AlgorithmsCache < cudnnConvolutionBwdDataAlgo_t > data_algo_cache_ ; <nl> + using ConvBwdFilterAlgorithmWithCost = <nl> + std : : tuple < cudnnConvolutionBwdFilterAlgo_t , float > ; <nl> + using ConvBwdDataAlgorithmWithCost = <nl> + std : : tuple < cudnnConvolutionBwdDataAlgo_t , float > ; <nl> + AlgorithmsCache < ConvBwdFilterAlgorithmWithCost > filter_algo_cache_ ; <nl> + AlgorithmsCache < ConvBwdDataAlgorithmWithCost > data_algo_cache_ ; <nl> bool no_bias_ ; <nl> / / input : X , W , dY <nl> / / output : dW , db , and optionally dX <nl> class CudnnConvGradientOp final : public CudnnConvOpBase { <nl> / / Implementations <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> - template < typename T_X , typename T_W , typename T_B , typename MATH , typename T_Y > <nl> + static constexpr std : : array < cudnnDataType_t , 2 > kComputeTypesToTry = { <nl> + CUDNN_DATA_FLOAT , <nl> + CUDNN_DATA_HALF } ; <nl> + static constexpr std : : array < const char * , 2 > kComputePassNames = { <nl> + " fp32 compute " , <nl> + " fp16 compute " } ; <nl> + <nl> + template < typename T_X , typename T_W , typename T_B , typename T_Y > <nl> bool CudnnConvOp : : DoRunWithType ( ) { <nl> auto & X = Input ( INPUT ) ; <nl> auto & filter = Input ( FILTER ) ; <nl> bool CudnnConvOp : : DoRunWithType ( ) { <nl> } else { <nl> vector < int > dims ( filter . dims ( ) . begin ( ) , filter . dims ( ) . end ( ) ) ; <nl> dims [ 0 ] / = group_ ; <nl> - # if ! CUDNN_VERSION_MIN ( 7 , 0 , 0 ) <nl> + # if ! CUDNN_VERSION_MIN ( 7 , 0 , 0 ) <nl> order_ = = StorageOrder : : NCHW ? dims [ 1 ] / = group_ <nl> : dims [ filter . ndim ( ) - 1 ] / = group_ ; <nl> # endif <nl> bool CudnnConvOp : : DoRunWithType ( ) { <nl> dims . data ( ) , <nl> strides . data ( ) ) ) ; <nl> } <nl> - / / Set the convolution descriptor <nl> - # if CUDNN_VERSION_MIN ( 6 , 0 , 0 ) <nl> - if ( kernel_ . size ( ) = = 2 ) { <nl> - CUDNN_ENFORCE ( cudnnSetConvolution2dDescriptor ( <nl> - conv_desc_ , <nl> - pad_t ( ) , <nl> - pad_l ( ) , <nl> - stride_h ( ) , <nl> - stride_w ( ) , <nl> - dilation_h ( ) , <nl> - dilation_w ( ) , <nl> - CUDNN_CROSS_CORRELATION , <nl> - cudnnTypeWrapper < MATH > : : type ) ) ; <nl> - } else { <nl> - CUDNN_ENFORCE ( cudnnSetConvolutionNdDescriptor ( <nl> - conv_desc_ , <nl> - kernel_ . size ( ) , <nl> - pads_ . data ( ) , <nl> - stride_ . data ( ) , <nl> - dilation_ . data ( ) , <nl> - CUDNN_CROSS_CORRELATION , <nl> - cudnnTypeWrapper < MATH > : : type ) ) ; <nl> - } <nl> - # else <nl> - if ( kernel_ . size ( ) = = 2 ) { <nl> - CUDNN_ENFORCE ( cudnnSetConvolution2dDescriptor ( <nl> - conv_desc_ , <nl> - pad_t ( ) , <nl> - pad_l ( ) , <nl> - stride_h ( ) , <nl> - stride_w ( ) , <nl> - 1 , <nl> - 1 , <nl> - CUDNN_CROSS_CORRELATION ) ) ; <nl> - } else { <nl> - vector < int > ones ( dilation_ . size ( ) , 1 ) ; <nl> - CUDNN_ENFORCE ( cudnnSetConvolutionNdDescriptor ( <nl> - conv_desc_ , <nl> - kernel_ . size ( ) , <nl> - pads_ . data ( ) , <nl> - stride_ . data ( ) , <nl> - ones . data ( ) , <nl> - CUDNN_CROSS_CORRELATION , <nl> - cudnnTypeWrapper < MATH > : : type ) ) ; <nl> - } <nl> - # endif <nl> <nl> - # if CUDNN_VERSION_MIN ( 7 , 0 , 0 ) <nl> - / / enable TensorCore math if desired <nl> - enable_tensor_core_ & = TensorCoreAvailable ( ) ; <nl> + compute_type_ = DetermineComputeTypeFromInput ( X ) ; <nl> + SetConvDescFromArguments ( ) ; <nl> + <nl> + # if CUDNN_VERSION_MIN ( 7 , 0 , 0 ) <nl> if ( enable_tensor_core_ ) { <nl> - CUDNN_ENFORCE ( cudnnSetConvolutionMathType ( <nl> - conv_desc_ , CUDNN_TENSOR_OP_MATH ) ) ; <nl> + CUDNN_ENFORCE ( <nl> + cudnnSetConvolutionMathType ( conv_desc_ , CUDNN_TENSOR_OP_MATH ) ) ; <nl> } <nl> <nl> / / enable cuDNN conv groups <nl> bool CudnnConvOp : : DoRunWithType ( ) { <nl> } else if ( deterministic_ ) { <nl> algo_ = CUDNN_CONVOLUTION_FWD_ALGO_IMPLICIT_PRECOMP_GEMM ; <nl> } else if ( exhaustive_search_ ) { <nl> - algo_ = algo_cache_ . getAlgorithm ( X . dims ( ) , filter . dims ( ) , [ & ] ( ) { <nl> - VLOG ( 1 ) < < " CUDNN Convolution : doing exhaustive search . " ; <nl> - / / When we do an exhaustive search , we will ignore the workspace size <nl> - / / limit and simply go for the fastest algorithm . If you happen to run <nl> - / / out of memory later , you will be on your own . . . <nl> - int returned_algo_count ; <nl> - std : : array < cudnnConvolutionFwdAlgoPerf_t , kNUM_CUDNN_FWD_ALGS > <nl> - perf_stat ; <nl> - <nl> - / / no need to clean up workspace , <nl> - cudnn_wrapper_ . with_cudnn_state ( cudnn_state_ , [ & ] ( CuDNNState * state ) { <nl> - / / Actually run the search . <nl> - CUDNN_ENFORCE ( cudnnFindConvolutionForwardAlgorithmEx ( <nl> - state - > cudnn_handle ( ) , <nl> - bottom_desc_ , <nl> - X . template data < T_X > ( ) , <nl> - filter_desc_ , <nl> - filter . template data < T_W > ( ) , <nl> - conv_desc_ , <nl> - top_desc_ , <nl> - Y - > template mutable_data < T_Y > ( ) , <nl> - kNUM_CUDNN_FWD_ALGS , <nl> - & returned_algo_count , <nl> - perf_stat . data ( ) , <nl> - state - > workspace ( ) . get ( cudnn_ws_nbytes_limit_ ) , <nl> - cudnn_ws_nbytes_limit_ ) ) ; <nl> - } ) ; <nl> - LogCuDNNPerfStats ( perf_stat , returned_algo_count ) ; <nl> - return perf_stat [ 0 ] . algo ; <nl> - } ) ; <nl> + / / Even when FP16 compute is supported and requested , try FP32 <nl> + / / because it may be faster . However , if FP32 compute is specified , <nl> + / / FP16 is not a suitable alternative - early out from the loop . <nl> + std : : array < ConvFwdAlgorithmWithCost , 2 > algosToCompare ; <nl> + for ( int i = 0 ; i < 2 ; i + + ) { <nl> + SetConvDescComputeType ( conv_desc_ , kComputeTypesToTry [ i ] ) ; <nl> + <nl> + algosToCompare [ i ] = algo_cache_ . getAlgorithm ( <nl> + X . dims ( ) , filter . dims ( ) , kComputeTypesToTry [ i ] , [ & ] ( ) { <nl> + VLOG ( 1 ) < < " CUDNN Convolution fwd : doing exhaustive " <nl> + < < " search for " < < kComputePassNames [ i ] ; <nl> + / / When we do an exhaustive search , we will ignore the workspace <nl> + / / size limit and simply go for the fastest algorithm . If you <nl> + / / happen to run out of memory later , you will be on your own . . . <nl> + int returned_algo_count ; <nl> + std : : array < cudnnConvolutionFwdAlgoPerf_t , kNUM_CUDNN_FWD_ALGS > <nl> + fwd_perf_stat ; <nl> + <nl> + / / no need to clean up workspace , <nl> + cudnn_wrapper_ . with_cudnn_state ( <nl> + cudnn_state_ , [ & ] ( CuDNNState * state ) { <nl> + / / Actually run the search . <nl> + CUDNN_ENFORCE ( cudnnFindConvolutionForwardAlgorithmEx ( <nl> + state - > cudnn_handle ( ) , <nl> + bottom_desc_ , <nl> + X . template data < T_X > ( ) , <nl> + filter_desc_ , <nl> + filter . template data < T_W > ( ) , <nl> + conv_desc_ , <nl> + top_desc_ , <nl> + Y - > template mutable_data < T_Y > ( ) , <nl> + kNUM_CUDNN_FWD_ALGS , <nl> + & returned_algo_count , <nl> + fwd_perf_stat . data ( ) , <nl> + state - > workspace ( ) . get ( cudnn_ws_nbytes_limit_ ) , <nl> + cudnn_ws_nbytes_limit_ ) ) ; <nl> + } ) ; <nl> + LogCuDNNPerfStats ( fwd_perf_stat , returned_algo_count ) ; <nl> + float algo_time = fwd_perf_stat [ 0 ] . status = = CUDNN_STATUS_SUCCESS <nl> + ? fwd_perf_stat [ 0 ] . time <nl> + : 1e10 ; <nl> + return ConvFwdAlgorithmWithCost ( fwd_perf_stat [ 0 ] . algo , algo_time ) ; <nl> + } ) ; <nl> + <nl> + / / When set to fp32 compute , don ' t try fp16 <nl> + if ( compute_type_ = = CUDNN_DATA_FLOAT ) { <nl> + break ; <nl> + } <nl> + } <nl> + <nl> + if ( compute_type_ = = CUDNN_DATA_FLOAT ) { <nl> + / / For FP32 compute , just use the best FP32 algorithm <nl> + algo_ = std : : get < 0 > ( algosToCompare [ 0 ] ) ; <nl> + } else { <nl> + / / For FP16 compute , choose algo with fastest execution <nl> + int bestAlgoIndex = <nl> + ( std : : get < 1 > ( algosToCompare [ 0 ] ) < std : : get < 1 > ( algosToCompare [ 1 ] ) ) <nl> + ? 0 <nl> + : 1 ; <nl> + algo_ = std : : get < 0 > ( algosToCompare [ bestAlgoIndex ] ) ; <nl> + SetConvDescComputeType ( conv_desc_ , kComputeTypesToTry [ bestAlgoIndex ] ) ; <nl> + } <nl> } else { <nl> / / Get the convolution algorithm based on the workspace limit . <nl> CUDNN_ENFORCE ( cudnnGetConvolutionForwardAlgorithm ( <nl> bool CudnnConvOp : : DoRunWithType ( ) { <nl> } <nl> <nl> bool CudnnConvOp : : RunOnDevice ( ) { <nl> - <nl> if ( Input ( 0 ) . IsType < float > ( ) ) { <nl> - return DoRunWithType < float , / / X <nl> - float , / / W <nl> - float , / / B <nl> - float , / / Math <nl> - float > ( ) ; / / Y <nl> + return DoRunWithType < <nl> + float , / / X <nl> + float , / / W <nl> + float , / / B <nl> + float > ( ) ; / / Y <nl> } else if ( Input ( 0 ) . IsType < float16 > ( ) ) { <nl> - return DoRunWithType < float16 , / / X <nl> - float16 , / / W <nl> - float16 , / / B <nl> - float , / / Math <nl> - float16 > ( ) ; / / Y <nl> + return DoRunWithType < <nl> + float16 , / / X <nl> + float16 , / / W <nl> + float16 , / / B <nl> + float16 > ( ) ; / / Y <nl> } else { <nl> LOG ( FATAL ) < < " Only float ( 32bit ) and float16 are supported by " <nl> < < " cudnn convolution , but input " < < debug_def ( ) . input ( 0 ) <nl> bool CudnnConvOp : : RunOnDevice ( ) { <nl> return true ; <nl> } <nl> <nl> - template < typename T_X , typename T_DY , typename T_W , typename T_B , <nl> - typename MATH , <nl> - typename T_DX , typename T_DW , typename T_DB > <nl> + template < <nl> + typename T_X , <nl> + typename T_DY , <nl> + typename T_W , <nl> + typename T_B , <nl> + typename T_DX , <nl> + typename T_DW , <nl> + typename T_DB > <nl> bool CudnnConvGradientOp : : DoRunWithType ( ) { <nl> auto & X = Input ( INPUT ) ; <nl> auto & filter = Input ( FILTER ) ; <nl> bool CudnnConvGradientOp : : DoRunWithType ( ) { <nl> kernel_w ( ) ) ) ; <nl> } else { <nl> vector < int > dims ( filter . dims ( ) . begin ( ) , filter . dims ( ) . end ( ) ) ; <nl> - # if ! CUDNN_VERSION_MIN ( 7 , 0 , 0 ) <nl> + # if ! CUDNN_VERSION_MIN ( 7 , 0 , 0 ) <nl> dims [ 0 ] / = group_ ; <nl> # endif <nl> order_ = = StorageOrder : : NCHW ? dims [ 1 ] / = group_ <nl> bool CudnnConvGradientOp : : DoRunWithType ( ) { <nl> dims . data ( ) , <nl> strides . data ( ) ) ) ; <nl> } <nl> - / / Set the convolution descriptor <nl> - # if CUDNN_VERSION_MIN ( 6 , 0 , 0 ) <nl> - if ( kernel_ . size ( ) = = 2 ) { <nl> - CUDNN_ENFORCE ( cudnnSetConvolution2dDescriptor ( <nl> - conv_desc_ , <nl> - pad_t ( ) , <nl> - pad_l ( ) , <nl> - stride_h ( ) , <nl> - stride_w ( ) , <nl> - dilation_h ( ) , <nl> - dilation_w ( ) , <nl> - CUDNN_CROSS_CORRELATION , <nl> - cudnnTypeWrapper < MATH > : : type ) ) ; <nl> - } else { <nl> - CUDNN_ENFORCE ( cudnnSetConvolutionNdDescriptor ( <nl> - conv_desc_ , <nl> - kernel_ . size ( ) , <nl> - pads_ . data ( ) , <nl> - stride_ . data ( ) , <nl> - dilation_ . data ( ) , <nl> - CUDNN_CROSS_CORRELATION , <nl> - cudnnTypeWrapper < MATH > : : type ) ) ; <nl> - } <nl> - # else <nl> - if ( kernel_ . size ( ) = = 2 ) { <nl> - CUDNN_ENFORCE ( cudnnSetConvolution2dDescriptor ( <nl> - conv_desc_ , <nl> - pad_t ( ) , <nl> - pad_l ( ) , <nl> - stride_h ( ) , <nl> - stride_w ( ) , <nl> - 1 , <nl> - 1 , <nl> - CUDNN_CROSS_CORRELATION ) ) ; <nl> - } else { <nl> - vector < int > ones ( dilation_ . size ( ) , 1 ) ; <nl> - CUDNN_ENFORCE ( cudnnSetConvolutionNdDescriptor ( <nl> - conv_desc_ , <nl> - kernel_ . size ( ) , <nl> - pads_ . data ( ) , <nl> - stride_ . data ( ) , <nl> - ones . data ( ) , <nl> - CUDNN_CROSS_CORRELATION , <nl> - cudnnTypeWrapper < MATH > : : type ) ) ; <nl> - } <nl> - # endif <nl> <nl> - # if CUDNN_VERSION_MIN ( 7 , 0 , 0 ) <nl> - / / enable TensorCore math if desired <nl> - enable_tensor_core_ & = TensorCoreAvailable ( ) ; <nl> + compute_type_ = DetermineComputeTypeFromInput ( X ) ; <nl> + SetConvDescFromArguments ( ) ; <nl> + <nl> + DuplicateConvDesc ( <nl> + conv_desc_ , kernel_ . size ( ) , dilation_ . size ( ) , bwd_filter_conv_desc_ ) ; <nl> + DuplicateConvDesc ( <nl> + conv_desc_ , kernel_ . size ( ) , dilation_ . size ( ) , bwd_data_conv_desc_ ) ; <nl> + <nl> + # if CUDNN_VERSION_MIN ( 7 , 0 , 0 ) <nl> if ( enable_tensor_core_ ) { <nl> CUDNN_ENFORCE ( cudnnSetConvolutionMathType ( <nl> - conv_desc_ , CUDNN_TENSOR_OP_MATH ) ) ; <nl> + bwd_filter_conv_desc_ , CUDNN_TENSOR_OP_MATH ) ) ; <nl> + CUDNN_ENFORCE ( cudnnSetConvolutionMathType ( <nl> + bwd_data_conv_desc_ , CUDNN_TENSOR_OP_MATH ) ) ; <nl> } <nl> <nl> / / set cuDNN groups if appropriate <nl> - CUDNN_CHECK ( cudnnSetConvolutionGroupCount ( conv_desc_ , group_ ) ) ; <nl> + CUDNN_CHECK ( cudnnSetConvolutionGroupCount ( bwd_filter_conv_desc_ , group_ ) ) ; <nl> + CUDNN_CHECK ( cudnnSetConvolutionGroupCount ( bwd_data_conv_desc_ , group_ ) ) ; <nl> # endif <nl> <nl> - / / Set the workspace <nl> - size_t bwd_filter_ws_size , bwd_data_ws_size ; <nl> - <nl> / / Choose dW algorithm <nl> if ( force_algo_ [ ALGO_WGRAD ] > = 0 ) { <nl> - bwd_filter_algo_ = ( cudnnConvolutionBwdFilterAlgo_t ) force_algo_ [ ALGO_WGRAD ] ; <nl> + bwd_filter_algo_ = <nl> + ( cudnnConvolutionBwdFilterAlgo_t ) force_algo_ [ ALGO_WGRAD ] ; <nl> } else if ( deterministic_ ) { <nl> bwd_filter_algo_ = CUDNN_CONVOLUTION_BWD_FILTER_ALGO_1 ; <nl> } else if ( exhaustive_search_ ) { <nl> - bwd_filter_algo_ = <nl> - filter_algo_cache_ . getAlgorithm ( X . dims ( ) , filter . dims ( ) , [ & ] ( ) { <nl> - VLOG ( 1 ) < < " CUDNN Convolution bwd : doing filter exhaustive search . " ; <nl> - / / When we do an exhaustive search , we will ignore the workspace <nl> - / / size <nl> - / / limit and simply go for the fastest algorithm . If you happen to <nl> - / / run <nl> - / / out of memory later , you will be on your own . . . <nl> - int returned_algo_count ; <nl> - / / We clean up the current workspace memory so that the forward <nl> - / / algorithm is free to allocate memory . <nl> - / / Actually run the search . <nl> - std : : array < <nl> - cudnnConvolutionBwdFilterAlgoPerf_t , <nl> - kNUM_CUDNN_BWD_FILTER_ALGS > <nl> - filter_perf_stat ; <nl> - <nl> - cudnn_wrapper_ . with_cudnn_state ( <nl> - cudnn_state_ , [ & ] ( CuDNNState * state ) { <nl> - CUDNN_ENFORCE ( cudnnFindConvolutionBackwardFilterAlgorithmEx ( <nl> - state - > cudnn_handle ( ) , <nl> - bottom_desc_ , <nl> - X . template data < T_X > ( ) , <nl> - top_desc_ , <nl> - dY . template data < T_DY > ( ) , <nl> - conv_desc_ , <nl> - filter_desc_ , <nl> - dfilter - > template mutable_data < T_DW > ( ) , <nl> - kNUM_CUDNN_BWD_FILTER_ALGS , <nl> - & returned_algo_count , <nl> - filter_perf_stat . data ( ) , <nl> - state - > workspace ( ) . get ( cudnn_ws_nbytes_limit_ ) , <nl> - cudnn_ws_nbytes_limit_ ) ) ; <nl> - } ) ; <nl> - LogCuDNNPerfStats ( filter_perf_stat , returned_algo_count ) ; <nl> - return filter_perf_stat [ 0 ] . algo ; <nl> - } ) ; <nl> + / / Even when FP16 compute is supported and requested , try FP32 <nl> + / / because it may be faster . However , if FP32 compute is specified , <nl> + / / FP16 is not a suitable alternative - early out from the loop . <nl> + std : : array < ConvBwdFilterAlgorithmWithCost , 2 > algosToCompare ; <nl> + for ( int i = 0 ; i < 2 ; i + + ) { <nl> + SetConvDescComputeType ( bwd_filter_conv_desc_ , kComputeTypesToTry [ i ] ) ; <nl> + <nl> + algosToCompare [ i ] = filter_algo_cache_ . getAlgorithm ( <nl> + X . dims ( ) , filter . dims ( ) , kComputeTypesToTry [ i ] , [ & ] ( ) { <nl> + VLOG ( 1 ) < < " CUDNN Convolution bwd : doing filter exhaustive " <nl> + < < " search for " < < kComputePassNames [ i ] ; <nl> + / / When we do an exhaustive search , we will ignore the workspace <nl> + / / size limit and simply go for the fastest algorithm . If you <nl> + / / happen to run out of memory later , you will be on your own . . . <nl> + int returned_algo_count ; <nl> + / / We clean up the current workspace memory so that the forward <nl> + / / algorithm is free to allocate memory . <nl> + / / Actually run the search . <nl> + std : : array < <nl> + cudnnConvolutionBwdFilterAlgoPerf_t , <nl> + kNUM_CUDNN_BWD_FILTER_ALGS > <nl> + filter_perf_stat ; <nl> + <nl> + cudnn_wrapper_ . with_cudnn_state ( <nl> + cudnn_state_ , [ & ] ( CuDNNState * state ) { <nl> + CUDNN_ENFORCE ( cudnnFindConvolutionBackwardFilterAlgorithmEx ( <nl> + state - > cudnn_handle ( ) , <nl> + bottom_desc_ , <nl> + X . template data < T_X > ( ) , <nl> + top_desc_ , <nl> + dY . template data < T_DY > ( ) , <nl> + bwd_filter_conv_desc_ , <nl> + filter_desc_ , <nl> + dfilter - > template mutable_data < T_DW > ( ) , <nl> + kNUM_CUDNN_BWD_FILTER_ALGS , <nl> + & returned_algo_count , <nl> + filter_perf_stat . data ( ) , <nl> + state - > workspace ( ) . get ( cudnn_ws_nbytes_limit_ ) , <nl> + cudnn_ws_nbytes_limit_ ) ) ; <nl> + } ) ; <nl> + LogCuDNNPerfStats ( filter_perf_stat , returned_algo_count ) ; <nl> + float algo_time = <nl> + filter_perf_stat [ 0 ] . status = = CUDNN_STATUS_SUCCESS <nl> + ? filter_perf_stat [ 0 ] . time <nl> + : 1e10 ; <nl> + return ConvBwdFilterAlgorithmWithCost ( <nl> + filter_perf_stat [ 0 ] . algo , algo_time ) ; <nl> + } ) ; <nl> + <nl> + / / When set to fp32 compute , don ' t try fp16 <nl> + if ( compute_type_ = = CUDNN_DATA_FLOAT ) { <nl> + break ; <nl> + } <nl> + } <nl> + <nl> + if ( compute_type_ = = CUDNN_DATA_FLOAT ) { <nl> + / / For FP32 compute , just use the best FP32 algorithm <nl> + bwd_filter_algo_ = std : : get < 0 > ( algosToCompare [ 0 ] ) ; <nl> + } else { <nl> + / / For FP16 compute , choose algo with fastest execution <nl> + int bestAlgoIndex = <nl> + ( std : : get < 1 > ( algosToCompare [ 0 ] ) < std : : get < 1 > ( algosToCompare [ 1 ] ) ) <nl> + ? 0 <nl> + : 1 ; <nl> + bwd_filter_algo_ = std : : get < 0 > ( algosToCompare [ bestAlgoIndex ] ) ; <nl> + SetConvDescComputeType ( <nl> + bwd_filter_conv_desc_ , kComputeTypesToTry [ bestAlgoIndex ] ) ; <nl> + } <nl> } else { <nl> / / choose backward algorithm for filter <nl> CUDNN_ENFORCE ( cudnnGetConvolutionBackwardFilterAlgorithm ( <nl> cudnn_wrapper_ . inline_cudnn_handle ( ) , <nl> bottom_desc_ , <nl> top_desc_ , <nl> - conv_desc_ , <nl> + bwd_filter_conv_desc_ , <nl> filter_desc_ , <nl> CUDNN_CONVOLUTION_BWD_FILTER_SPECIFY_WORKSPACE_LIMIT , <nl> cudnn_ws_nbytes_limit_ , <nl> bool CudnnConvGradientOp : : DoRunWithType ( ) { <nl> } else if ( deterministic_ ) { <nl> bwd_data_algo_ = CUDNN_CONVOLUTION_BWD_DATA_ALGO_1 ; <nl> } else if ( exhaustive_search_ ) { <nl> - bwd_data_algo_ = <nl> - data_algo_cache_ . getAlgorithm ( X . dims ( ) , filter . dims ( ) , [ & ] ( ) { <nl> - VLOG ( 1 ) < < " CUDNN Convolution bwd : doing data exhaustive search . " ; <nl> - int returned_algo_count ; <nl> - <nl> - std : : array < <nl> - cudnnConvolutionBwdDataAlgoPerf_t , <nl> - kNUM_CUDNN_BWD_DATA_ALGS > <nl> - data_perf_stat ; <nl> - cudnn_wrapper_ . with_cudnn_state ( <nl> - cudnn_state_ , [ & ] ( CuDNNState * state ) { <nl> - auto * dX = <nl> - Output ( no_bias_ ? BIAS_OR_INPUT_GRAD : INPUT_GRAD ) ; <nl> - dX - > ResizeLike ( X ) ; <nl> - const T_W * filter_data = filter . template data < T_W > ( ) ; <nl> - const T_DY * dYdata = dY . template data < T_DY > ( ) ; <nl> - T_DX * dXdata = dX - > template mutable_data < T_DX > ( ) ; <nl> - CUDNN_ENFORCE ( cudnnFindConvolutionBackwardDataAlgorithmEx ( <nl> - state - > cudnn_handle ( ) , <nl> - filter_desc_ , <nl> - filter_data , <nl> - top_desc_ , <nl> - dYdata , <nl> - conv_desc_ , <nl> - bottom_desc_ , <nl> - dXdata , <nl> - kNUM_CUDNN_BWD_DATA_ALGS , <nl> - & returned_algo_count , <nl> - data_perf_stat . data ( ) , <nl> - state - > workspace ( ) . get ( cudnn_ws_nbytes_limit_ ) , <nl> - cudnn_ws_nbytes_limit_ ) ) ; <nl> - } ) ; <nl> + / / Even when FP16 compute is supported and requested , try FP32 <nl> + / / because it may be faster . However , if FP32 compute is specified , <nl> + / / FP16 is not a suitable alternative - early out from the loop . <nl> + std : : array < ConvBwdDataAlgorithmWithCost , 2 > algosToCompare ; <nl> + for ( int i = 0 ; i < 2 ; i + + ) { <nl> + SetConvDescComputeType ( bwd_data_conv_desc_ , kComputeTypesToTry [ i ] ) ; <nl> + <nl> + algosToCompare [ i ] = data_algo_cache_ . getAlgorithm ( <nl> + X . dims ( ) , filter . dims ( ) , kComputeTypesToTry [ i ] , [ & ] ( ) { <nl> + VLOG ( 1 ) < < " CUDNN Convolution bwd : doing data exhaustive " <nl> + < < " search for " < < kComputePassNames [ i ] ; <nl> + int returned_algo_count ; <nl> + <nl> + std : : array < <nl> + cudnnConvolutionBwdDataAlgoPerf_t , <nl> + kNUM_CUDNN_BWD_DATA_ALGS > <nl> + data_perf_stat ; <nl> + cudnn_wrapper_ . with_cudnn_state ( <nl> + cudnn_state_ , [ & ] ( CuDNNState * state ) { <nl> + auto * dX = <nl> + Output ( no_bias_ ? BIAS_OR_INPUT_GRAD : INPUT_GRAD ) ; <nl> + dX - > ResizeLike ( X ) ; <nl> + const T_W * filter_data = filter . template data < T_W > ( ) ; <nl> + const T_DY * dYdata = dY . template data < T_DY > ( ) ; <nl> + T_DX * dXdata = dX - > template mutable_data < T_DX > ( ) ; <nl> + CUDNN_ENFORCE ( cudnnFindConvolutionBackwardDataAlgorithmEx ( <nl> + state - > cudnn_handle ( ) , <nl> + filter_desc_ , <nl> + filter_data , <nl> + top_desc_ , <nl> + dYdata , <nl> + bwd_data_conv_desc_ , <nl> + bottom_desc_ , <nl> + dXdata , <nl> + kNUM_CUDNN_BWD_DATA_ALGS , <nl> + & returned_algo_count , <nl> + data_perf_stat . data ( ) , <nl> + state - > workspace ( ) . get ( cudnn_ws_nbytes_limit_ ) , <nl> + cudnn_ws_nbytes_limit_ ) ) ; <nl> + } ) ; <nl> + <nl> + LogCuDNNPerfStats ( data_perf_stat , returned_algo_count ) ; <nl> + float algo_time = <nl> + data_perf_stat [ 0 ] . status = = CUDNN_STATUS_SUCCESS <nl> + ? data_perf_stat [ 0 ] . time <nl> + : 1e10 ; <nl> + return ConvBwdDataAlgorithmWithCost ( <nl> + data_perf_stat [ 0 ] . algo , algo_time ) ; <nl> + } ) ; <nl> + <nl> + / / When set to fp32 compute , don ' t try fp16 <nl> + if ( compute_type_ = = CUDNN_DATA_FLOAT ) { <nl> + break ; <nl> + } <nl> + } <nl> <nl> - LogCuDNNPerfStats ( data_perf_stat , returned_algo_count ) ; <nl> - return data_perf_stat [ 0 ] . algo ; <nl> - } ) ; <nl> + if ( compute_type_ = = CUDNN_DATA_FLOAT ) { <nl> + / / For FP32 compute , just use the best FP32 algorithm <nl> + bwd_data_algo_ = std : : get < 0 > ( algosToCompare [ 0 ] ) ; <nl> + } else { <nl> + / / For FP16 compute , choose algo with fastest execution <nl> + int bestAlgoIndex = <nl> + ( std : : get < 1 > ( algosToCompare [ 0 ] ) < std : : get < 1 > ( algosToCompare [ 1 ] ) ) <nl> + ? 0 <nl> + : 1 ; <nl> + bwd_data_algo_ = std : : get < 0 > ( algosToCompare [ bestAlgoIndex ] ) ; <nl> + SetConvDescComputeType ( <nl> + bwd_data_conv_desc_ , kComputeTypesToTry [ bestAlgoIndex ] ) ; <nl> + } <nl> } else { <nl> CUDNN_ENFORCE ( cudnnGetConvolutionBackwardDataAlgorithm ( <nl> cudnn_wrapper_ . inline_cudnn_handle ( ) , <nl> filter_desc_ , <nl> top_desc_ , <nl> - conv_desc_ , <nl> + bwd_data_conv_desc_ , <nl> bottom_desc_ , <nl> CUDNN_CONVOLUTION_BWD_DATA_SPECIFY_WORKSPACE_LIMIT , <nl> cudnn_ws_nbytes_limit_ , <nl> bool CudnnConvGradientOp : : DoRunWithType ( ) { <nl> } <nl> } <nl> <nl> - / / get workspace for backwards filter algorithm <nl> + / / get workspace size for backwards filter algorithm <nl> + size_t bwd_filter_ws_size , bwd_data_ws_size ; <nl> + <nl> CUDNN_ENFORCE ( cudnnGetConvolutionBackwardFilterWorkspaceSize ( <nl> cudnn_wrapper_ . inline_cudnn_handle ( ) , <nl> bottom_desc_ , <nl> top_desc_ , <nl> - conv_desc_ , <nl> + bwd_filter_conv_desc_ , <nl> filter_desc_ , <nl> bwd_filter_algo_ , <nl> & bwd_filter_ws_size ) ) ; <nl> if ( OutputSize ( ) = = 3 | | ( no_bias_ & & ( OutputSize ( ) = = 2 ) ) ) { <nl> - / / get workspace for backwards data algorithm <nl> + / / get workspace size for backwards data algorithm <nl> CUDNN_ENFORCE ( cudnnGetConvolutionBackwardDataWorkspaceSize ( <nl> cudnn_wrapper_ . inline_cudnn_handle ( ) , <nl> filter_desc_ , <nl> top_desc_ , <nl> - conv_desc_ , <nl> + bwd_data_conv_desc_ , <nl> bottom_desc_ , <nl> bwd_data_algo_ , <nl> & bwd_data_ws_size ) ) ; <nl> bool CudnnConvGradientOp : : DoRunWithType ( ) { <nl> } <nl> cudnn_ws_nbytes_ = std : : max ( bwd_filter_ws_size , bwd_data_ws_size ) ; <nl> <nl> - VLOG ( 1 ) < < " CuDNN bwd algorithm : " < < bwd_filter_algo_ < < " , " <nl> - < < bwd_data_algo_ ; <nl> + VLOG ( 1 ) < < " CuDNN bwd data & filter algorithm : " < < bwd_data_algo_ < < " , " <nl> + < < bwd_filter_algo_ ; <nl> VLOG ( 1 ) < < " CuDNN workspace size : " < < cudnn_ws_nbytes_ ; <nl> } <nl> <nl> bool CudnnConvGradientOp : : DoRunWithType ( ) { <nl> dbias - > template mutable_data < T_DB > ( ) ) ) ; <nl> } <nl> <nl> - # if CUDNN_VERSION_MIN ( 7 , 0 , 0 ) <nl> + # if CUDNN_VERSION_MIN ( 7 , 0 , 0 ) <nl> cudnn_wrapper_ . with_cudnn_state ( cudnn_state_ , [ & ] ( CuDNNState * state ) { <nl> CUDNN_ENFORCE ( cudnnConvolutionBackwardFilter ( <nl> state - > cudnn_handle ( ) , <nl> bool CudnnConvGradientOp : : DoRunWithType ( ) { <nl> X . template data < T_X > ( ) , <nl> top_desc_ , <nl> dY . template data < T_DY > ( ) , <nl> - conv_desc_ , <nl> + bwd_filter_conv_desc_ , <nl> bwd_filter_algo_ , <nl> state - > workspace ( ) . get ( cudnn_ws_nbytes_ ) , <nl> cudnn_ws_nbytes_ , <nl> bool CudnnConvGradientOp : : DoRunWithType ( ) { <nl> filter . template data < T_W > ( ) , <nl> top_desc_ , <nl> dY . template data < T_DY > ( ) , <nl> - conv_desc_ , <nl> + bwd_data_conv_desc_ , <nl> bwd_data_algo_ , <nl> state - > workspace ( ) . get ( cudnn_ws_nbytes_ ) , <nl> cudnn_ws_nbytes_ , <nl> bool CudnnConvGradientOp : : DoRunWithType ( ) { <nl> X . template data < T_X > ( ) + i * group_offset_X , <nl> top_desc_ , <nl> dY . template data < T_DY > ( ) + i * group_offset_Y , <nl> - conv_desc_ , <nl> + bwd_filter_conv_desc_ , <nl> bwd_filter_algo_ , <nl> state - > workspace ( ) . get ( cudnn_ws_nbytes_ ) , <nl> cudnn_ws_nbytes_ , <nl> bool CudnnConvGradientOp : : DoRunWithType ( ) { <nl> filter . template data < T_W > ( ) + i * group_offset_filter , <nl> top_desc_ , <nl> dY . template data < T_DY > ( ) + i * group_offset_Y , <nl> - conv_desc_ , <nl> + bwd_data_conv_desc_ , <nl> bwd_data_algo_ , <nl> state - > workspace ( ) . get ( cudnn_ws_nbytes_ ) , <nl> cudnn_ws_nbytes_ , <nl> bool CudnnConvGradientOp : : DoRunWithType ( ) { <nl> / / consolidating them . <nl> bool CudnnConvGradientOp : : RunOnDevice ( ) { <nl> if ( Input ( 0 ) . IsType < float > ( ) ) { <nl> - return DoRunWithType < float , / / X <nl> - float , / / dY <nl> - float , / / W <nl> - float , / / b <nl> - float , / / Math <nl> - float , / / dX <nl> - float , / / dW <nl> - float > ( ) ; / / db <nl> - } <nl> - else if ( Input ( 0 ) . IsType < float16 > ( ) ) { <nl> - return DoRunWithType < float16 , / / X <nl> - float16 , / / dY <nl> - float16 , / / W <nl> - float16 , / / b <nl> - float , / / Math <nl> - float16 , / / dX <nl> - float16 , / / dW <nl> - float16 > ( ) ; / / db <nl> + return DoRunWithType < <nl> + float , / / X <nl> + float , / / dY <nl> + float , / / W <nl> + float , / / b <nl> + float , / / dX <nl> + float , / / dW <nl> + float > ( ) ; / / db <nl> + } else if ( Input ( 0 ) . IsType < float16 > ( ) ) { <nl> + return DoRunWithType < <nl> + float16 , / / X <nl> + float16 , / / dY <nl> + float16 , / / W <nl> + float16 , / / b <nl> + float16 , / / dX <nl> + float16 , / / dW <nl> + float16 > ( ) ; / / db <nl> } else { <nl> LOG ( FATAL ) < < " Unsupported input types " ; <nl> } <nl> REGISTER_CUDNN_OPERATOR ( Conv2DGradient , CudnnConvGradientOp ) ; <nl> REGISTER_CUDNN_OPERATOR ( Conv3D , CudnnConvOp ) ; <nl> REGISTER_CUDNN_OPERATOR ( Conv3DGradient , CudnnConvGradientOp ) ; <nl> <nl> - } / / namespace caffe2 <nl> + } / / namespace caffe2 <nl> mmm a / caffe2 / operators / conv_pool_op_base . h <nl> ppp b / caffe2 / operators / conv_pool_op_base . h <nl> class ConvPoolOpBase : public Operator < Context > { <nl> dilation_ ( OperatorBase : : GetRepeatedArgument < int > ( " dilations " ) ) , <nl> stride_ ( OperatorBase : : GetRepeatedArgument < int > ( " strides " ) ) , <nl> pads_ ( OperatorBase : : GetRepeatedArgument < int > ( " pads " ) ) , <nl> + float16_compute_ ( <nl> + OperatorBase : : GetSingleArgument < bool > ( " float16_compute " , false ) ) , <nl> group_ ( OperatorBase : : GetSingleArgument < int > ( " group " , 1 ) ) , <nl> order_ ( StringToStorageOrder ( <nl> OperatorBase : : GetSingleArgument < string > ( " order " , " NCHW " ) ) ) , <nl> class ConvPoolOpBase : public Operator < Context > { <nl> vector < int > stride_ ; <nl> vector < int > pads_ ; <nl> <nl> + bool float16_compute_ ; <nl> + <nl> / / We need the above parameters to be available for the devices . <nl> Tensor < Context > kernel_device_ ; <nl> Tensor < Context > dilation_device_ ; <nl> mmm a / caffe2 / operators / conv_transpose_op_cudnn . cc <nl> ppp b / caffe2 / operators / conv_transpose_op_cudnn . cc <nl> <nl> # include " caffe2 / core / cudnn_wrappers . h " <nl> # include " caffe2 / operators / conv_op_cache_cudnn . h " <nl> # include " caffe2 / operators / conv_transpose_op . h " <nl> + # include " caffe2 / operators / op_utils_cudnn . h " <nl> <nl> namespace caffe2 { <nl> <nl> - / / Earlier in the days Caffe sets the default cudnn workspace to 8MB . We bump <nl> - / / it up to 64MB in Caffe2 , as this enables the use of Winograd in many cases , <nl> - / / something very beneficial to more recent CNN models . <nl> - static constexpr size_t kCONV_CUDNN_WORKSPACE_LIMIT_BYTES = 64 * 1024 * 1024 ; <nl> - <nl> - / / Manually specified number of algorithms implemented in CuDNN . <nl> - / / This does not have any performance implications , as we will always find the <nl> - / / fastest algorithm ; setting them to the right number of algorithms will enable <nl> - / / us to best report the statistics when doing an exhaustive search , though . <nl> - static constexpr size_t kNUM_CUDNN_FWD_ALGS = 7 ; <nl> - static constexpr size_t kNUM_CUDNN_BWD_FILTER_ALGS = 4 ; <nl> - static constexpr size_t kNUM_CUDNN_BWD_DATA_ALGS = 5 ; <nl> - <nl> - namespace { <nl> - template < typename ArrayOfcudnnConvolutionAlgoPerf_t > <nl> - inline void LogCuDNNPerfStats ( <nl> - const ArrayOfcudnnConvolutionAlgoPerf_t & perf_stat , <nl> - int returned_algo_count ) { <nl> - LOG ( INFO ) < < " Perf result : ( algo : stat , time , memory ) " ; <nl> - for ( int i = 0 ; i < returned_algo_count ; + + i ) { <nl> - const auto & stat = perf_stat [ i ] ; <nl> - LOG ( INFO ) < < stat . algo < < " : " < < stat . status < < " " < < stat . time < < " " <nl> - < < stat . memory ; <nl> - } <nl> - } <nl> - } / / namespace <nl> - <nl> class CudnnConvTransposeOpBase : public ConvTransposeUnpoolBase < CUDAContext > { <nl> public : <nl> CudnnConvTransposeOpBase ( const OperatorDef & operator_def , Workspace * ws ) <nl> class CudnnConvTransposeOpBase : public ConvTransposeUnpoolBase < CUDAContext > { <nl> OperatorBase : : GetSingleArgument < int > ( " exhaustive_search " , 0 ) ) , <nl> deterministic_ ( <nl> OperatorBase : : GetSingleArgument < int > ( " deterministic " , 0 ) ) , <nl> - cudnn_state_ ( OperatorBase : : GetSingleArgument < int > ( " cudnn_state " , 0 ) ) { <nl> + cudnn_state_ ( OperatorBase : : GetSingleArgument < int > ( " cudnn_state " , 0 ) ) , <nl> + force_algo_ ( OperatorBase : : GetRepeatedArgument < int > ( <nl> + " force_algo " , <nl> + vector < int > { - 1 , - 1 , - 1 } ) ) , <nl> + enable_tensor_core_ ( <nl> + OperatorBase : : GetSingleArgument < bool > ( " enable_tensor_core " , 1 ) ) { <nl> CAFFE_ENFORCE ( ! deterministic_ | | ! exhaustive_search_ ) ; <nl> + <nl> + bool individual_force_algo = OperatorBase : : HasArgument ( " force_algo_fwd " ) | | <nl> + OperatorBase : : HasArgument ( " force_algo_dgrad " ) | | <nl> + OperatorBase : : HasArgument ( " force_algo_wgrad " ) ; <nl> + if ( OperatorBase : : HasArgument ( " force_algo " ) ) { <nl> + CAFFE_ENFORCE ( <nl> + ! individual_force_algo , <nl> + " Cannot specify both force_algo and any of " , <nl> + " force_algo_fwd , force_algo_dgrad , force_algo_wgrad " ) ; <nl> + } else { <nl> + force_algo_ = std : : vector < int > { - 1 , - 1 , - 1 } ; <nl> + force_algo_ [ ALGO_FWD ] = <nl> + OperatorBase : : GetSingleArgument < int > ( " force_algo_fwd " , - 1 ) ; <nl> + force_algo_ [ ALGO_DGRAD ] = <nl> + OperatorBase : : GetSingleArgument < int > ( " force_algo_dgrad " , - 1 ) ; <nl> + force_algo_ [ ALGO_WGRAD ] = <nl> + OperatorBase : : GetSingleArgument < int > ( " force_algo_wgrad " , - 1 ) ; <nl> + } <nl> + <nl> CUDNN_ENFORCE ( cudnnCreateTensorDescriptor ( & bottom_desc_ ) ) ; <nl> CUDNN_ENFORCE ( cudnnCreateFilterDescriptor ( & filter_desc_ ) ) ; <nl> if ( InputSize ( ) = = 3 ) { <nl> class CudnnConvTransposeOpBase : public ConvTransposeUnpoolBase < CUDAContext > { <nl> bool exhaustive_search_ ; <nl> bool deterministic_ ; <nl> size_t cudnn_state_ ; <nl> + vector < int > force_algo_ ; / / stored as FWD , dFILTER , dDATA <nl> + bool enable_tensor_core_ ; <nl> } ; <nl> <nl> template < typename T > <nl> bool CudnnConvTransposeOp < T > : : RunOnDevice ( ) { <nl> pad_r ( ) , <nl> " The current padding scheme leads to unequal padding on the left " <nl> " and right , which is not supported by cudnn . " ) ; <nl> + / / Set the convolution descriptor <nl> # if CUDNN_VERSION_MIN ( 6 , 0 , 0 ) <nl> CUDNN_ENFORCE ( cudnnSetConvolution2dDescriptor ( <nl> conv_desc_ , <nl> bool CudnnConvTransposeOp < T > : : RunOnDevice ( ) { <nl> 1 , <nl> CUDNN_CROSS_CORRELATION ) ) ; <nl> # endif <nl> - if ( deterministic_ ) { <nl> + # if CUDNN_VERSION_MIN ( 7 , 0 , 0 ) <nl> + / / enable TensorCore math if desired <nl> + enable_tensor_core_ & = TensorCoreAvailable ( ) ; <nl> + if ( enable_tensor_core_ ) { <nl> + CUDNN_ENFORCE ( <nl> + cudnnSetConvolutionMathType ( conv_desc_ , CUDNN_TENSOR_OP_MATH ) ) ; <nl> + } <nl> + # endif <nl> + if ( force_algo_ [ ALGO_DGRAD ] > = 0 ) { <nl> + bwd_data_algo_ = ( cudnnConvolutionBwdDataAlgo_t ) force_algo_ [ ALGO_DGRAD ] ; <nl> + } else if ( deterministic_ ) { <nl> bwd_data_algo_ = CUDNN_CONVOLUTION_BWD_DATA_ALGO_1 ; <nl> } else if ( exhaustive_search_ ) { <nl> bwd_data_algo_ = <nl> - data_algo_cache_ . getAlgorithm ( X . dims ( ) , filter . dims ( ) , [ & ] ( ) { <nl> + data_algo_cache_ . getAlgorithm ( X . dims ( ) , filter . dims ( ) , 0 , [ & ] ( ) { <nl> int returned_algo_count ; <nl> std : : array < <nl> cudnnConvolutionBwdDataAlgoPerf_t , <nl> bool CudnnConvTransposeGradientOp < T > : : RunOnDevice ( ) { <nl> 1 , <nl> CUDNN_CROSS_CORRELATION ) ) ; <nl> # endif <nl> - / / Set the workspace <nl> - <nl> - size_t bwd_filter_ws_size , fwd_ws_size ; <nl> - <nl> - if ( deterministic_ ) { <nl> + # if CUDNN_VERSION_MIN ( 7 , 0 , 0 ) <nl> + / / enable TensorCore math if desired <nl> + enable_tensor_core_ & = TensorCoreAvailable ( ) ; <nl> + if ( enable_tensor_core_ ) { <nl> + CUDNN_ENFORCE ( <nl> + cudnnSetConvolutionMathType ( conv_desc_ , CUDNN_TENSOR_OP_MATH ) ) ; <nl> + } <nl> + # endif <nl> + if ( force_algo_ [ ALGO_WGRAD ] > = 0 ) { <nl> + bwd_filter_algo_ = <nl> + ( cudnnConvolutionBwdFilterAlgo_t ) force_algo_ [ ALGO_WGRAD ] ; <nl> + } else if ( deterministic_ ) { <nl> algo_ = CUDNN_CONVOLUTION_FWD_ALGO_IMPLICIT_PRECOMP_GEMM ; <nl> bwd_filter_algo_ = CUDNN_CONVOLUTION_BWD_FILTER_ALGO_1 ; <nl> } else if ( exhaustive_search_ ) { <nl> bwd_filter_algo_ = <nl> - filter_algo_cache_ . getAlgorithm ( X . dims ( ) , filter . dims ( ) , [ & ] ( ) { <nl> - <nl> + filter_algo_cache_ . getAlgorithm ( X . dims ( ) , filter . dims ( ) , 0 , [ & ] ( ) { <nl> LOG ( INFO ) < < " CUDNN Convolution bwd : doing exhaustive search . " ; <nl> / / When we do an exhaustive search , we will ignore the workspace <nl> / / size <nl> bool CudnnConvTransposeGradientOp < T > : : RunOnDevice ( ) { <nl> return filter_perf_stat [ 0 ] . algo ; <nl> } ) ; <nl> <nl> - algo_ = forward_algo_cache_ . getAlgorithm ( X . dims ( ) , filter . dims ( ) , [ & ] ( ) { <nl> - int returned_algo_count ; <nl> - std : : array < cudnnConvolutionFwdAlgoPerf_t , kNUM_CUDNN_FWD_ALGS > <nl> - fwd_perf_stat ; <nl> - cudnn_wrapper_ . with_cudnn_state ( cudnn_state_ , [ & ] ( CuDNNState * state ) { <nl> - state - > workspace ( ) . reset ( ) ; <nl> - CUDNN_ENFORCE ( cudnnFindConvolutionForwardAlgorithm ( <nl> - state - > cudnn_handle ( ) , <nl> - top_desc_ , <nl> - filter_desc_ , <nl> - conv_desc_ , <nl> - bottom_desc_ , <nl> - kNUM_CUDNN_BWD_DATA_ALGS , <nl> - & returned_algo_count , <nl> - fwd_perf_stat . data ( ) ) ) ; <nl> - } ) ; <nl> - <nl> - LogCuDNNPerfStats ( fwd_perf_stat , returned_algo_count ) ; <nl> - return fwd_perf_stat [ 0 ] . algo ; <nl> - } ) ; <nl> + algo_ = <nl> + forward_algo_cache_ . getAlgorithm ( X . dims ( ) , filter . dims ( ) , 0 , [ & ] ( ) { <nl> + int returned_algo_count ; <nl> + std : : array < cudnnConvolutionFwdAlgoPerf_t , kNUM_CUDNN_FWD_ALGS > <nl> + fwd_perf_stat ; <nl> + cudnn_wrapper_ . with_cudnn_state ( <nl> + cudnn_state_ , [ & ] ( CuDNNState * state ) { <nl> + state - > workspace ( ) . reset ( ) ; <nl> + CUDNN_ENFORCE ( cudnnFindConvolutionForwardAlgorithm ( <nl> + state - > cudnn_handle ( ) , <nl> + top_desc_ , <nl> + filter_desc_ , <nl> + conv_desc_ , <nl> + bottom_desc_ , <nl> + kNUM_CUDNN_BWD_DATA_ALGS , <nl> + & returned_algo_count , <nl> + fwd_perf_stat . data ( ) ) ) ; <nl> + } ) ; <nl> + <nl> + LogCuDNNPerfStats ( fwd_perf_stat , returned_algo_count ) ; <nl> + return fwd_perf_stat [ 0 ] . algo ; <nl> + } ) ; <nl> } else { <nl> / / choose backward algorithm for filter <nl> CUDNN_ENFORCE ( cudnnGetConvolutionBackwardFilterAlgorithm ( <nl> bool CudnnConvTransposeGradientOp < T > : : RunOnDevice ( ) { <nl> & algo_ ) ) ; <nl> } <nl> / / get workspace for backwards filter algorithm <nl> + size_t bwd_filter_ws_size , fwd_ws_size ; <nl> CUDNN_ENFORCE ( cudnnGetConvolutionBackwardFilterWorkspaceSize ( <nl> cudnn_wrapper_ . inline_cudnn_handle ( ) , <nl> top_desc_ , <nl> new file mode 100644 <nl> index 000000000000 . . e0012b929657 <nl> mmm / dev / null <nl> ppp b / caffe2 / operators / op_utils_cudnn . h <nl> <nl> + / * * <nl> + * Copyright ( c ) 2016 - present , Facebook , Inc . <nl> + * <nl> + * Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + * you may not use this file except in compliance with the License . <nl> + * You may obtain a copy of the License at <nl> + * <nl> + * http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + * <nl> + * Unless required by applicable law or agreed to in writing , software <nl> + * distributed under the License is distributed on an " AS IS " BASIS , <nl> + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + * See the License for the specific language governing permissions and <nl> + * limitations under the License . <nl> + * / <nl> + <nl> + # ifndef CAFFE2_OPERATORS_CUDNN_OP_UTILS_H_ <nl> + # define CAFFE2_OPERATORS_CUDNN_OP_UTILS_H_ <nl> + <nl> + # include " caffe2 / core / cudnn_wrappers . h " <nl> + <nl> + namespace caffe2 { <nl> + <nl> + / / Earlier in the days Caffe sets the default cudnn workspace to 8MB . We bump <nl> + / / it up to 64MB in Caffe2 , as this enables the use of Winograd in many cases , <nl> + / / something very beneficial to more recent CNN models . <nl> + static constexpr size_t kCONV_CUDNN_WORKSPACE_LIMIT_BYTES = 64 * 1024 * 1024 ; <nl> + <nl> + / / Manually specified number of algorithms implemented in CuDNN . <nl> + / / This does not have any performance implications , as we will always find the <nl> + / / fastest algorithm ; setting them to the right number of algorithms will enable <nl> + / / us to best report the statistics when doing an exhaustive search , though . <nl> + # if CUDNN_VERSION_MIN ( 7 , 0 , 0 ) <nl> + / / Note : Double each of these due to potential <nl> + / / tensorcore + non - tensorcore versions <nl> + / / which are treated as separate returned algos <nl> + static constexpr size_t kNUM_CUDNN_FWD_ALGS = <nl> + 2 * CUDNN_CONVOLUTION_FWD_ALGO_COUNT ; <nl> + static constexpr size_t kNUM_CUDNN_BWD_FILTER_ALGS = <nl> + 2 * CUDNN_CONVOLUTION_BWD_FILTER_ALGO_COUNT ; <nl> + static constexpr size_t kNUM_CUDNN_BWD_DATA_ALGS = <nl> + 2 * CUDNN_CONVOLUTION_BWD_DATA_ALGO_COUNT ; <nl> + # else <nl> + static constexpr size_t kNUM_CUDNN_FWD_ALGS = 7 ; <nl> + static constexpr size_t kNUM_CUDNN_BWD_FILTER_ALGS = 4 ; <nl> + static constexpr size_t kNUM_CUDNN_BWD_DATA_ALGS = 5 ; <nl> + # endif <nl> + <nl> + namespace { <nl> + template < typename ArrayOfcudnnConvolutionAlgoPerf_t > <nl> + inline void LogCuDNNPerfStats ( <nl> + const ArrayOfcudnnConvolutionAlgoPerf_t & perf_stat , <nl> + int returned_algo_count ) { <nl> + VLOG ( 1 ) < < " Perf result : ( algo : stat , time , memory ) " ; <nl> + for ( int i = 0 ; i < returned_algo_count ; + + i ) { <nl> + const auto & stat = perf_stat [ i ] ; <nl> + VLOG ( 1 ) < < stat . algo < < " : " < < stat . status < < " " < < stat . time < < " " <nl> + < < stat . memory ; <nl> + } <nl> + } <nl> + } / / namespace <nl> + <nl> + / / Easier indexing into force_algo_ vector , <nl> + / / shared by CudnnConvTransposeOpBase and CudnnConvOpBase to force <nl> + / / usage of a particular algortihm instead of searching <nl> + enum { ALGO_FWD = 0 , ALGO_WGRAD = 1 , ALGO_DGRAD = 2 } algoIndex_t ; <nl> + <nl> + } / / namespace caffe2 <nl> + <nl> + # endif / / CAFFE2_OPERATORS_CUDNN_OP_UTILS_H_ <nl> mmm a / caffe2 / python / helpers / conv . py <nl> ppp b / caffe2 / python / helpers / conv . py <nl> def _ConvBase ( <nl> order = " NCHW " , <nl> cudnn_exhaustive_search = False , <nl> ws_nbytes_limit = None , <nl> + float16_compute = False , <nl> * * kwargs <nl> ) : <nl> kernels = [ ] <nl> def _ConvBase ( <nl> if transform_inputs is not None : <nl> transform_inputs ( model , blob_out , inputs ) <nl> <nl> + # Enable float 16 compute kernel ( relevant for CUDA ) <nl> + if float16_compute : <nl> + kwargs [ ' float16_compute ' ] = True <nl> + <nl> # For the operator , we no longer need to provide the no_bias field <nl> # because it can automatically figure this out from the number of <nl> # inputs . <nl>
|
Work on fp16 conv op
|
pytorch/pytorch
|
b4b2f0d2ccdde17a3c565a70b3579aea8edeb122
|
2018-03-06T05:13:03Z
|
mmm a / modules / planning / common / planning_gflags . cc <nl> ppp b / modules / planning / common / planning_gflags . cc <nl> DEFINE_double ( prepare_rerouting_time , 2 . 0 , <nl> DEFINE_bool ( enable_smooth_reference_line , true , <nl> " enable smooth the map reference line " ) ; <nl> <nl> - DEFINE_double ( spiral_smoother_max_deviation , 0 . 1 , <nl> - " The max deviation of spiral reference line smoother . " ) ; <nl> - DEFINE_int32 ( spiral_smoother_num_iteration , 1000 , <nl> - " The iteration num of spiral reference line smoother . " ) ; <nl> - DEFINE_double ( spiral_smoother_piecewise_length , 10 . 0 , <nl> - " The piecewise length of spiral smoother . " ) ; <nl> - DEFINE_double ( spiral_reference_line_resolution , 0 . 02 , <nl> - " The output resolution for reference line . " ) ; <nl> DEFINE_bool ( prioritize_change_lane , false , <nl> " change lane strategy has higher priority , always use a valid " <nl> " change lane path if such path exists " ) ; <nl> DEFINE_double ( lattice_stop_buffer , 0 . 02 , <nl> / / navigation mode <nl> DEFINE_double ( navigation_fallback_cruise_time , 8 . 0 , <nl> " The time range of fallback cruise under navigation mode . " ) ; <nl> - <nl> - / / spiral reference line smoother <nl> - DEFINE_double ( spiral_opt_tol , 1 . 0e - 8 , <nl> - " The desired convergence tol for spiral opt " ) ; <nl> - DEFINE_double ( spiral_opt_acceptable_tol , 1 . 0e - 6 , <nl> - " The acceptable convergence tol for spiral opt " ) ; <nl> - DEFINE_double ( spiral_opt_acceptable_iter , 15 , <nl> - " The number of acceptable iters " <nl> - " before termination for spiral opt " ) ; <nl> - <nl> - DEFINE_double ( spiral_opt_weight_curve_length , 0 . 0 , <nl> - " The weight of curve length term in objective function " ) ; <nl> - DEFINE_double ( spiral_opt_weight_kappa , 1 . 5 , <nl> - " The weight of kappa term in objective function " ) ; <nl> - DEFINE_double ( spiral_opt_weight_dkappa , 1 . 0 , <nl> - " The weight of dkappa term in objective function " ) ; <nl> - DEFINE_double ( spiral_opt_weight_d2kappa , 0 . 0 , <nl> - " The weight of d2kappa term in objective function " ) ; <nl> mmm a / modules / planning / common / planning_gflags . h <nl> ppp b / modules / planning / common / planning_gflags . h <nl> DECLARE_double ( reference_line_lateral_buffer ) ; <nl> DECLARE_double ( prepare_rerouting_time ) ; <nl> <nl> DECLARE_bool ( enable_smooth_reference_line ) ; <nl> - DECLARE_double ( spiral_smoother_max_deviation ) ; <nl> - DECLARE_int32 ( spiral_smoother_num_iteration ) ; <nl> - DECLARE_double ( spiral_smoother_piecewise_length ) ; <nl> - DECLARE_double ( spiral_reference_line_resolution ) ; <nl> <nl> DECLARE_bool ( prioritize_change_lane ) ; <nl> DECLARE_bool ( reckless_change_lane ) ; <nl> DECLARE_double ( lattice_stop_buffer ) ; <nl> / / navigation mode <nl> DECLARE_double ( navigation_fallback_cruise_time ) ; <nl> <nl> - / / Spiral reference line smoother <nl> - DECLARE_double ( spiral_opt_tol ) ; <nl> - DECLARE_double ( spiral_opt_acceptable_tol ) ; <nl> - DECLARE_double ( spiral_opt_acceptable_iter ) ; <nl> - <nl> - DECLARE_double ( spiral_opt_weight_curve_length ) ; <nl> - DECLARE_double ( spiral_opt_weight_kappa ) ; <nl> - DECLARE_double ( spiral_opt_weight_dkappa ) ; <nl> - DECLARE_double ( spiral_opt_weight_d2kappa ) ; <nl> - <nl> # endif / / MODULES_PLANNING_COMMON_PLANNING_GFLAGS_H_ <nl> mmm a / modules / planning / conf / planning_config . pb . txt <nl> ppp b / modules / planning / conf / planning_config . pb . txt <nl> em_planner_config { <nl> } <nl> } <nl> } <nl> - <nl> - smoother_type : QP_SPLINE_SMOOTHER <nl> mmm a / modules / planning / conf / planning_config_navi . pb . txt <nl> ppp b / modules / planning / conf / planning_config_navi . pb . txt <nl> em_planner_config { <nl> } <nl> } <nl> } <nl> - <nl> - smoother_type : QP_SPLINE_SMOOTHER <nl> mmm a / modules / planning / conf / smoother_config . pb . txt <nl> ppp b / modules / planning / conf / smoother_config . pb . txt <nl> <nl> - spline_order : 5 <nl> - max_spline_length : 25 . 0 <nl> max_constraint_interval : 5 . 0 <nl> - longitudinal_boundary_bound : 2 . 0 <nl> - lateral_boundary_bound : 0 . 25 <nl> - second_derivative_weight : 200 . 0 <nl> - third_derivative_weight : 1000 . 0 <nl> - num_of_total_points : 500 <nl> - regularization_weight : 1 . 0e - 5 <nl> - curb_shift : 0 . 2 <nl> - driving_side : RIGHT <nl> - wide_lane_threshold_factor : 2 . 0 <nl> - wide_lane_shift_remain_factor : 0 . 5 <nl> + longitudinal_boundary_bound : 2 . 0 <nl> + lateral_boundary_bound : 0 . 25 <nl> + num_of_total_points : 500 <nl> + curb_shift : 0 . 2 <nl> + driving_side : RIGHT <nl> + wide_lane_threshold_factor : 2 . 0 <nl> + wide_lane_shift_remain_factor : 0 . 5 <nl> + <nl> + qp_spline { <nl> + spline_order : 5 <nl> + max_spline_length : 25 . 0 <nl> + regularization_weight : 1 . 0e - 5 <nl> + second_derivative_weight : 200 . 0 <nl> + third_derivative_weight : 1000 . 0 <nl> + } <nl> + <nl> + # spiral { <nl> + # max_deviation : 0 . 1 <nl> + # piecewise_length : 10 . 0 <nl> + # max_iteration : 1000 <nl> + # opt_tol : 1 . 0e - 8 <nl> + # opt_acceptable_tol : 1e - 6 <nl> + # opt_acceptable_iteration : 15 <nl> + # opt_weight_curve_length : 0 . 0 <nl> + # opt_weight_kappa : 1 . 5 <nl> + # opt_weight_dkappa : 1 . 0 <nl> + # opt_weight_d2kappa : 0 . 0 <nl> + # } <nl> mmm a / modules / planning / planning . cc <nl> ppp b / modules / planning / planning . cc <nl> Status Planning : : Init ( ) { <nl> hdmap_ = HDMapUtil : : BaseMapPtr ( ) ; <nl> CHECK ( hdmap_ ) < < " Failed to load map " ; <nl> reference_line_provider_ = std : : unique_ptr < ReferenceLineProvider > ( <nl> - new ReferenceLineProvider ( hdmap_ , config_ . smoother_type ( ) ) ) ; <nl> + new ReferenceLineProvider ( hdmap_ ) ) ; <nl> } <nl> <nl> RegisterPlanners ( ) ; <nl> void Planning : : RunOnce ( ) { <nl> / / recreate reference line provider in every cycle <nl> hdmap_ = HDMapUtil : : BaseMapPtr ( ) ; <nl> reference_line_provider_ = std : : unique_ptr < ReferenceLineProvider > ( <nl> - new ReferenceLineProvider ( hdmap_ , config_ . smoother_type ( ) ) ) ; <nl> + new ReferenceLineProvider ( hdmap_ ) ) ; <nl> } <nl> <nl> / / localization <nl> mmm a / modules / planning / proto / planning_config . proto <nl> ppp b / modules / planning / proto / planning_config . proto <nl> message PlanningConfig { <nl> } ; <nl> optional PlannerType planner_type = 1 [ default = EM ] ; <nl> <nl> - enum ReferenceLineSmootherType { <nl> - SPIRAL_SMOOTHER = 1 ; / / generate by spiral path <nl> - QP_SPLINE_SMOOTHER = 2 ; / / generate by quadratic programming <nl> - TRACE_SMOOTHER = 3 ; / / leverage human driving trace <nl> - } <nl> optional EMPlannerConfig em_planner_config = 2 ; <nl> - optional ReferenceLineSmootherType smoother_type = 3 <nl> - [ default = QP_SPLINE_SMOOTHER ] ; <nl> } <nl> mmm a / modules / planning / proto / reference_line_smoother_config . proto <nl> ppp b / modules / planning / proto / reference_line_smoother_config . proto <nl> syntax = " proto2 " ; <nl> <nl> package apollo . planning ; <nl> <nl> + message QpSplineSmootherConfig { <nl> + optional uint32 spline_order = 1 [ default = 5 ] ; <nl> + optional double max_spline_length = 2 [ default = 25 ] ; <nl> + optional double regularization_weight = 3 [ default = 0 . 1 ] ; <nl> + optional double second_derivative_weight = 4 [ default = 0 . 0 ] ; <nl> + optional double third_derivative_weight = 5 [ default = 100 ] ; <nl> + } <nl> + <nl> + message SpiralSmootherConfig { <nl> + / / The max deviation of spiral reference line smoother . <nl> + optional double max_deviation = 1 [ default = 0 . 1 ] ; <nl> + <nl> + / / The piecewise length of spiral smoother . <nl> + optional double piecewise_length = 2 [ default = 10 . 0 ] ; <nl> + <nl> + / / The iteration num of spiral reference line smoother . " ) ; <nl> + optional int32 max_iteration = 3 [ default = 1000 ] ; <nl> + <nl> + / / The desired convergence tol for spiral opt ; <nl> + optional double opt_tol = 4 [ default = 1 . 0e - 8 ] ; <nl> + <nl> + / / The acceptable convergence tol for spiral opt <nl> + optional double opt_acceptable_tol = 5 [ default = 1e - 6 ] ; <nl> + <nl> + / / The number of acceptable iters before termination for spiral opt ; <nl> + optional int32 opt_acceptable_iteration = 6 [ default = 15 ] ; <nl> + <nl> + / / The weight of curve length term in objective function <nl> + optional double opt_weight_curve_length = 7 [ default = 0 . 0 ] ; <nl> + <nl> + / / The weight of kappa term in objective function <nl> + optional double opt_weight_kappa = 8 [ default = 1 . 5 ] ; <nl> + <nl> + / / The weight of dkappa term in objective function <nl> + optional double opt_weight_dkappa = 9 [ default = 1 . 0 ] ; <nl> + <nl> + / / The weight of d2kappa term in objective function <nl> + optional double opt_weight_d2kappa = 10 [ default = 0 . 0 ] ; <nl> + } <nl> + <nl> + <nl> message ReferenceLineSmootherConfig { <nl> enum DrivingSide { <nl> - LEFT = 1 ; / / left hand driving country like UK and JP <nl> - RIGHT = 2 ; / / right hand driving country like CN and US <nl> + LEFT = 1 ; / / left hand driving country like UK and JP <nl> + RIGHT = 2 ; / / right hand driving country like CN and US <nl> + } <nl> + optional double max_constraint_interval = 1 [ default = 5 ] ; <nl> + optional double longitudinal_boundary_bound = 2 [ default = 1 . 0 ] ; <nl> + optional double lateral_boundary_bound = 3 [ default = 0 . 1 ] ; <nl> + optional uint32 num_of_total_points = 4 [ default = 500 ] ; <nl> + optional double curb_shift = 5 [ default = 0 . 2 ] ; <nl> + optional DrivingSide driving_side = 6 [ default = RIGHT ] ; <nl> + / / If a lane width larger than this value times adc width , this lane is <nl> + / / considered as a wide lane <nl> + optional double wide_lane_threshold_factor = 7 [ default = 2 . 0 ] ; <nl> + / / In a wide lane case , leave the left side ( or right side on a left - handed <nl> + / / driving map ) this amount times adc width <nl> + optional double wide_lane_shift_remain_factor = 8 [ default = 0 . 5 ] ; <nl> + <nl> + / / The output resolution for reference line . <nl> + optional double resolution = 9 [ default = 0 . 02 ] ; <nl> + <nl> + oneof SmootherConfig { <nl> + QpSplineSmootherConfig qp_spline = 20 ; <nl> + SpiralSmootherConfig spiral = 21 ; <nl> } <nl> - optional uint32 spline_order = 1 [ default = 5 ] ; <nl> - optional double max_spline_length = 2 [ default = 25 ] ; <nl> - optional double max_constraint_interval = 3 [ default = 5 ] ; <nl> - optional double longitudinal_boundary_bound = 4 [ default = 1 . 0 ] ; <nl> - optional double lateral_boundary_bound = 5 [ default = 0 . 1 ] ; <nl> - optional double second_derivative_weight = 6 [ default = 0 . 0 ] ; <nl> - optional double third_derivative_weight = 7 [ default = 100 ] ; <nl> - optional uint32 num_of_total_points = 8 [ default = 500 ] ; <nl> - optional double regularization_weight = 9 [ default = 0 . 1 ] ; <nl> - optional double curb_shift = 10 [ default = 0 . 2 ] ; <nl> - optional DrivingSide driving_side = 11 [ default = RIGHT ] ; <nl> - / / If a lane width larger than this value times adc width , this lane is considered as a wide lane <nl> - optional double wide_lane_threshold_factor = 12 [ default = 2 . 0 ] ; <nl> - / / In a wide lane case , leave the left side ( or right side on a left - handed driving map ) this amount times adc width <nl> - optional double wide_lane_shift_remain_factor = 13 [ default = 0 . 5 ] ; <nl> } <nl> mmm a / modules / planning / reference_line / qp_spline_reference_line_smoother . cc <nl> ppp b / modules / planning / reference_line / qp_spline_reference_line_smoother . cc <nl> namespace planning { <nl> QpSplineReferenceLineSmoother : : QpSplineReferenceLineSmoother ( <nl> const ReferenceLineSmootherConfig & config ) <nl> : ReferenceLineSmoother ( config ) { <nl> - spline_solver_ . reset ( new Spline2dSolver ( t_knots_ , config . spline_order ( ) ) ) ; <nl> + spline_solver_ . reset ( <nl> + new Spline2dSolver ( t_knots_ , config . qp_spline ( ) . spline_order ( ) ) ) ; <nl> } <nl> <nl> void QpSplineReferenceLineSmoother : : Clear ( ) { t_knots_ . clear ( ) ; } <nl> bool QpSplineReferenceLineSmoother : : Smooth ( <nl> return false ; <nl> } <nl> <nl> - spline_solver_ - > Reset ( t_knots_ , config_ . spline_order ( ) ) ; <nl> + spline_solver_ - > Reset ( t_knots_ , config_ . qp_spline ( ) . spline_order ( ) ) ; <nl> <nl> if ( ! AddConstraint ( ) ) { <nl> AERROR < < " Add constraint for spline smoother failed " ; <nl> bool QpSplineReferenceLineSmoother : : Smooth ( <nl> bool QpSplineReferenceLineSmoother : : Sampling ( ) { <nl> const double length = anchor_points_ . back ( ) . path_point . s ( ) - <nl> anchor_points_ . front ( ) . path_point . s ( ) ; <nl> - uint32_t num_spline = std : : max ( <nl> - 1u , static_cast < uint32_t > ( length / config_ . max_spline_length ( ) + 0 . 5 ) ) ; <nl> + uint32_t num_spline = <nl> + std : : max ( 1u , static_cast < uint32_t > ( <nl> + length / config_ . qp_spline ( ) . max_spline_length ( ) + 0 . 5 ) ) ; <nl> for ( std : : uint32_t i = 0 ; i < = num_spline ; + + i ) { <nl> t_knots_ . push_back ( i * 1 . 0 ) ; <nl> } <nl> bool QpSplineReferenceLineSmoother : : AddKernel ( ) { <nl> Spline2dKernel * kernel = spline_solver_ - > mutable_kernel ( ) ; <nl> <nl> / / add spline kernel <nl> - if ( config_ . second_derivative_weight ( ) > 0 . 0 ) { <nl> - kernel - > AddSecondOrderDerivativeMatrix ( config_ . second_derivative_weight ( ) ) ; <nl> + if ( config_ . qp_spline ( ) . second_derivative_weight ( ) > 0 . 0 ) { <nl> + kernel - > AddSecondOrderDerivativeMatrix ( <nl> + config_ . qp_spline ( ) . second_derivative_weight ( ) ) ; <nl> } <nl> - if ( config_ . third_derivative_weight ( ) > 0 . 0 ) { <nl> - kernel - > AddThirdOrderDerivativeMatrix ( config_ . third_derivative_weight ( ) ) ; <nl> + if ( config_ . qp_spline ( ) . third_derivative_weight ( ) > 0 . 0 ) { <nl> + kernel - > AddThirdOrderDerivativeMatrix ( <nl> + config_ . qp_spline ( ) . third_derivative_weight ( ) ) ; <nl> } <nl> <nl> - kernel - > AddRegularization ( config_ . regularization_weight ( ) ) ; <nl> + kernel - > AddRegularization ( config_ . qp_spline ( ) . regularization_weight ( ) ) ; <nl> return true ; <nl> } <nl> <nl> mmm a / modules / planning / reference_line / qp_spline_reference_line_smoother_test . cc <nl> ppp b / modules / planning / reference_line / qp_spline_reference_line_smoother_test . cc <nl> namespace planning { <nl> class QpSplineReferenceLineSmootherTest : public : : testing : : Test { <nl> public : <nl> virtual void SetUp ( ) { <nl> - config_ . set_spline_order ( 5 ) ; <nl> + config_ . mutable_qp_spline ( ) - > set_spline_order ( 5 ) ; <nl> smoother_ . reset ( new QpSplineReferenceLineSmoother ( config_ ) ) ; <nl> hdmap_ . LoadMapFromFile ( map_file ) ; <nl> const std : : string lane_id = " 1_ - 1 " ; <nl> mmm a / modules / planning / reference_line / reference_line_provider . cc <nl> ppp b / modules / planning / reference_line / reference_line_provider . cc <nl> using apollo : : hdmap : : LaneWaypoint ; <nl> using apollo : : hdmap : : MapPathPoint ; <nl> using apollo : : hdmap : : RouteSegments ; <nl> <nl> - apollo : : common : : util : : Factory < <nl> - PlanningConfig : : ReferenceLineSmootherType , ReferenceLineSmoother , <nl> - ReferenceLineSmoother * ( * ) ( const ReferenceLineSmootherConfig & config ) > <nl> - ReferenceLineProvider : : s_smoother_factory_ ; <nl> - <nl> ReferenceLineProvider : : ~ ReferenceLineProvider ( ) { <nl> if ( thread_ & & thread_ - > joinable ( ) ) { <nl> thread_ - > join ( ) ; <nl> } <nl> } <nl> <nl> - void ReferenceLineProvider : : RegisterSmoothers ( ) { <nl> - s_smoother_factory_ . Register ( <nl> - PlanningConfig : : SPIRAL_SMOOTHER , <nl> - [ ] ( const ReferenceLineSmootherConfig & config ) - > ReferenceLineSmoother * { <nl> - return new SpiralReferenceLineSmoother ( config ) ; <nl> - } ) ; <nl> - s_smoother_factory_ . Register ( <nl> - PlanningConfig : : QP_SPLINE_SMOOTHER , <nl> - [ ] ( const ReferenceLineSmootherConfig & config ) - > ReferenceLineSmoother * { <nl> - return new QpSplineReferenceLineSmoother ( config ) ; <nl> - } ) ; <nl> - } <nl> - <nl> - ReferenceLineProvider : : ReferenceLineProvider ( <nl> - const hdmap : : HDMap * base_map , <nl> - PlanningConfig : : ReferenceLineSmootherType smoother_type ) { <nl> + ReferenceLineProvider : : ReferenceLineProvider ( const hdmap : : HDMap * base_map ) { <nl> if ( ! FLAGS_use_navigation_mode ) { <nl> pnc_map_ . reset ( new hdmap : : PncMap ( base_map ) ) ; <nl> } <nl> - if ( s_smoother_factory_ . Empty ( ) ) { <nl> - RegisterSmoothers ( ) ; <nl> - } <nl> CHECK ( common : : util : : GetProtoFromFile ( FLAGS_smoother_config_filename , <nl> & smoother_config_ ) ) <nl> < < " Failed to load smoother config file " <nl> < < FLAGS_smoother_config_filename ; <nl> - smoother_ = s_smoother_factory_ . CreateObject ( smoother_type , smoother_config_ ) ; <nl> + if ( smoother_config_ . has_qp_spline ( ) ) { <nl> + smoother_ . reset ( new QpSplineReferenceLineSmoother ( smoother_config_ ) ) ; <nl> + } else if ( smoother_config_ . has_spiral ( ) ) { <nl> + smoother_ . reset ( new SpiralReferenceLineSmoother ( smoother_config_ ) ) ; <nl> + } else { <nl> + CHECK ( false ) < < " unknown smoother config " <nl> + < < smoother_config_ . DebugString ( ) ; <nl> + } <nl> is_initialized_ = true ; <nl> } / / namespace planning <nl> <nl> mmm a / modules / planning / reference_line / reference_line_provider . h <nl> ppp b / modules / planning / reference_line / reference_line_provider . h <nl> class ReferenceLineProvider { <nl> * / <nl> ~ ReferenceLineProvider ( ) ; <nl> <nl> - ReferenceLineProvider ( <nl> - const hdmap : : HDMap * base_map , <nl> - PlanningConfig : : ReferenceLineSmootherType smoother_type ) ; <nl> + explicit ReferenceLineProvider ( const hdmap : : HDMap * base_map ) ; <nl> <nl> bool UpdateRoutingResponse ( const routing : : RoutingResponse & routing ) ; <nl> <nl> class ReferenceLineProvider { <nl> std : : list < ReferenceLine > * reference_line , <nl> std : : list < hdmap : : RouteSegments > * segments ) ; <nl> <nl> - static void RegisterSmoothers ( ) ; <nl> - <nl> private : <nl> bool is_initialized_ = false ; <nl> bool is_stop_ = false ; <nl> class ReferenceLineProvider { <nl> std : : list < ReferenceLine > reference_lines_ ; <nl> std : : list < hdmap : : RouteSegments > route_segments_ ; <nl> double last_calculation_time_ = 0 . 0 ; <nl> - <nl> - static apollo : : common : : util : : Factory < <nl> - PlanningConfig : : ReferenceLineSmootherType , ReferenceLineSmoother , <nl> - ReferenceLineSmoother * ( * ) ( const ReferenceLineSmootherConfig & config ) > <nl> - s_smoother_factory_ ; <nl> } ; <nl> <nl> } / / namespace planning <nl> mmm a / modules / planning / reference_line / spiral_reference_line_smoother . cc <nl> ppp b / modules / planning / reference_line / spiral_reference_line_smoother . cc <nl> using apollo : : common : : time : : Clock ; <nl> SpiralReferenceLineSmoother : : SpiralReferenceLineSmoother ( <nl> const ReferenceLineSmootherConfig & config ) <nl> : ReferenceLineSmoother ( config ) { <nl> - default_max_point_deviation_ = FLAGS_spiral_smoother_max_deviation ; <nl> + default_max_point_deviation_ = config . spiral ( ) . max_deviation ( ) ; <nl> } <nl> <nl> bool SpiralReferenceLineSmoother : : Smooth ( <nl> bool SpiralReferenceLineSmoother : : Smooth ( <nl> std : : vector < double > opt_s ; <nl> <nl> if ( anchor_points_ . empty ( ) ) { <nl> - const double piecewise_length = FLAGS_spiral_smoother_piecewise_length ; <nl> + const double piecewise_length = config_ . spiral ( ) . piecewise_length ( ) ; <nl> const double length = raw_reference_line . Length ( ) ; <nl> ADEBUG < < " Length = " < < length ; <nl> uint32_t num_of_pieces = <nl> bool SpiralReferenceLineSmoother : : Smooth ( <nl> <nl> std : : vector < common : : PathPoint > smoothed_point2d = <nl> Interpolate ( opt_theta , opt_kappa , opt_dkappa , opt_s , opt_x , opt_y , <nl> - FLAGS_spiral_reference_line_resolution ) ; <nl> + config_ . resolution ( ) ) ; <nl> <nl> std : : vector < ReferencePoint > ref_points ; <nl> for ( const auto & p : smoothed_point2d ) { <nl> bool SpiralReferenceLineSmoother : : Smooth ( std : : vector < Eigen : : Vector2d > point2d , <nl> } <nl> <nl> ptop - > set_end_point_position ( fixed_end_x_ , fixed_end_y_ ) ; <nl> - ptop - > set_element_weight_curve_length ( FLAGS_spiral_opt_weight_curve_length ) ; <nl> - ptop - > set_element_weight_kappa ( FLAGS_spiral_opt_weight_kappa ) ; <nl> - ptop - > set_element_weight_dkappa ( FLAGS_spiral_opt_weight_dkappa ) ; <nl> - ptop - > set_element_weight_d2kappa ( FLAGS_spiral_opt_weight_d2kappa ) ; <nl> + ptop - > set_element_weight_curve_length ( <nl> + config_ . spiral ( ) . opt_weight_curve_length ( ) ) ; <nl> + ptop - > set_element_weight_kappa ( config_ . spiral ( ) . opt_weight_kappa ( ) ) ; <nl> + ptop - > set_element_weight_dkappa ( config_ . spiral ( ) . opt_weight_dkappa ( ) ) ; <nl> + ptop - > set_element_weight_d2kappa ( config_ . spiral ( ) . opt_weight_d2kappa ( ) ) ; <nl> <nl> Ipopt : : SmartPtr < Ipopt : : TNLP > problem = ptop ; <nl> <nl> bool SpiralReferenceLineSmoother : : Smooth ( std : : vector < Eigen : : Vector2d > point2d , <nl> <nl> app - > Options ( ) - > SetStringValue ( " hessian_approximation " , " limited - memory " ) ; <nl> app - > Options ( ) - > SetIntegerValue ( " print_level " , 0 ) ; <nl> - app - > Options ( ) - > SetIntegerValue ( " max_iter " , <nl> - FLAGS_spiral_smoother_num_iteration ) ; <nl> + app - > Options ( ) - > SetIntegerValue ( " max_iter " , config_ . spiral ( ) . max_iteration ( ) ) ; <nl> app - > Options ( ) - > SetIntegerValue ( " acceptable_iter " , <nl> - FLAGS_spiral_opt_acceptable_iter ) ; <nl> - app - > Options ( ) - > SetNumericValue ( " tol " , FLAGS_spiral_opt_tol ) ; <nl> + config_ . spiral ( ) . opt_acceptable_iteration ( ) ) ; <nl> + app - > Options ( ) - > SetNumericValue ( " tol " , config_ . spiral ( ) . opt_tol ( ) ) ; <nl> app - > Options ( ) - > SetNumericValue ( " acceptable_tol " , <nl> - FLAGS_spiral_opt_acceptable_tol ) ; <nl> + config_ . spiral ( ) . opt_acceptable_tol ( ) ) ; <nl> <nl> Ipopt : : ApplicationReturnStatus status = app - > Initialize ( ) ; <nl> if ( status ! = Ipopt : : Solve_Succeeded ) { <nl>
|
refactor reference line config for different algorithms
|
ApolloAuto/apollo
|
1fb593b80944858c84b98dae606dc07ca55f1684
|
2018-04-10T23:41:41Z
|
mmm a / folly / Makefile . am <nl> ppp b / folly / Makefile . am <nl> libfolly_la_SOURCES = \ <nl> FingerprintTables . cpp \ <nl> futures / Barrier . cpp \ <nl> futures / Future . cpp \ <nl> - futures / InlineExecutor . cpp \ <nl> futures / ManualExecutor . cpp \ <nl> futures / QueuedImmediateExecutor . cpp \ <nl> futures / ThreadWheelTimekeeper . cpp \ <nl> deleted file mode 100644 <nl> index bcae8e223b6 . . 00000000000 <nl> mmm a / folly / futures / InlineExecutor . cpp <nl> ppp / dev / null <nl> <nl> - / * <nl> - * Copyright 2017 Facebook , Inc . <nl> - * <nl> - * Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> - * you may not use this file except in compliance with the License . <nl> - * You may obtain a copy of the License at <nl> - * <nl> - * http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> - * <nl> - * Unless required by applicable law or agreed to in writing , software <nl> - * distributed under the License is distributed on an " AS IS " BASIS , <nl> - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> - * See the License for the specific language governing permissions and <nl> - * limitations under the License . <nl> - * / <nl>
|
Remove InlineExecutor . cpp
|
facebook/folly
|
49399f7cf36dfdda58e1bc01f2c9a1bc7a4ed400
|
2017-06-01T18:55:28Z
|
mmm a / tensorflow / contrib / tpu / ops / cross_replica_ops . cc <nl> ppp b / tensorflow / contrib / tpu / ops / cross_replica_ops . cc <nl> output : The sum of all the distributed inputs . <nl> T : The type of elements to be summed . <nl> ) doc " ) ; <nl> <nl> + REGISTER_OP ( " CollectivePermute " ) <nl> + . Input ( " input : T " ) <nl> + . Input ( " source_target_pairs : int32 " ) <nl> + . Output ( " output : T " ) <nl> + . Attr ( " T : numbertype " ) <nl> + . SetShapeFn ( shape_inference : : UnchangedShape ) <nl> + . Doc ( R " doc ( <nl> + An Op to permute tensors across replicated TPU instances . Each instance <nl> + supplies its own input . <nl> + <nl> + For example , suppose there are 4 TPU instances : ` [ A , B , C , D ] ` . Passing <nl> + source_target_pairs = ` [ [ 0 , 1 ] , [ 1 , 2 ] , [ 2 , 3 ] , [ 3 , 0 ] ] ` gets the outputs : <nl> + ` [ D , A , B , C ] ` . <nl> + <nl> + input : The local input to be permuted . Currently only supports float and <nl> + bfloat16 . <nl> + source_target_pairs : A tensor with shape [ num_pairs , 2 ] . <nl> + output : The permuted input . <nl> + T : The type of elements to be exchanged . <nl> + ) doc " ) ; <nl> } / / namespace tensorflow <nl> mmm a / tensorflow / contrib / tpu / python / ops / tpu_ops . py <nl> ppp b / tensorflow / contrib / tpu / python / ops / tpu_ops . py <nl> def _all_to_all_grad ( op , grad ) : <nl> ] <nl> <nl> def cross_replica_sum ( x , group_assignment = None , name = None ) : <nl> - " " " Sum the input tensor accorss replicas according to group_assignment . <nl> + " " " Sum the input tensor across replicas according to group_assignment . <nl> <nl> Args : <nl> x : The local tensor to the sum . <nl> def cross_replica_sum ( x , group_assignment = None , name = None ) : <nl> <nl> return gen_tpu_ops . cross_replica_sum ( x , group_assignment , name = name ) <nl> <nl> + def collective_permute ( x , source_target_pairs , name = None ) : <nl> + " " " Permute the input tensor across replicas given source_target_pairs . <nl> + <nl> + For each source_target_pair < a , b > , we send replica a ' s input to replica b . <nl> + Each replica id must only appear once in the source column . Also it must <nl> + only appear once in the target column . <nl> + For the replica id not in the target column , this op returns a zero tensor <nl> + with the same shape and dtype of the input x . <nl> + <nl> + For example , suppose there are 4 TPU instances : ` [ A , B , C , D ] ` . Passing <nl> + source_target_pairs = ` [ [ 0 , 1 ] , [ 1 , 2 ] , [ 2 , 3 ] ] ` gets the outputs : <nl> + ` [ 0 , A , B , C ] ` . <nl> + <nl> + Args : <nl> + x : The local tensor to be permuted . <nl> + source_target_pairs : 2d int lists with shape [ num_pairs , 2 ] . <nl> + source_target_pairs [ i ] [ 0 ] represents the source replica id and <nl> + source_target_pairs [ i ] [ 1 ] represents the target replica id . <nl> + name : Optional op name . <nl> + <nl> + Returns : <nl> + A ` Tensor ` which is permuted . <nl> + " " " <nl> + return gen_tpu_ops . collective_permute ( x , source_target_pairs , name = name ) <nl> + <nl> @ ops . RegisterGradient ( " CrossReplicaSum " ) <nl> def _cross_replica_sum_grad ( op , grad ) : <nl> # The gradient of a cross replica sum is also a cross - replica sum . <nl>
|
[ TF : XLA ] Introduce CollectivePermute op .
|
tensorflow/tensorflow
|
e9cdf9f412a3aea324a4a1655d3bffb87abaff0d
|
2018-09-25T02:52:14Z
|
mmm a / lib / SILGen / SILGenApply . cpp <nl> ppp b / lib / SILGen / SILGenApply . cpp <nl> SmallVector < ManagedValue , 4 > SILGenFunction : : emitKeyPathSubscriptOperands ( <nl> - > getCanonicalType ( ) ) <nl> : cast < FunctionType > ( interfaceType - > getCanonicalType ( ) ) ; <nl> AbstractionPattern origFnType ( substFnType ) ; <nl> - auto fnType = getLoweredType ( origFnType , substFnType ) . castTo < SILFunctionType > ( ) ; <nl> + auto fnType = <nl> + getLoweredType ( origFnType , substFnType ) . castTo < SILFunctionType > ( ) ; <nl> SmallVector < ManagedValue , 4 > argValues ; <nl> SmallVector < DelayedArgument , 2 > delayedArgs ; <nl> ArgEmitter emitter ( <nl> SmallVector < ManagedValue , 4 > SILGenFunction : : emitKeyPathSubscriptOperands ( <nl> ClaimedParamsRef ( fnType , fnType . getPointer ( ) - > getParameters ( ) ) , argValues , <nl> delayedArgs , <nl> / * foreign error * / None , ImportAsMemberStatus ( ) ) ; <nl> - <nl> + <nl> auto prepared = <nl> prepareSubscriptIndices ( subscript , subs , <nl> / / Strategy doesn ' t matter <nl>
|
Format properly
|
apple/swift
|
08244697d11f760deea9f13aeba0d83b119ee3c2
|
2019-11-12T21:24:49Z
|
mmm a / lib / Sema / CSSimplify . cpp <nl> ppp b / lib / Sema / CSSimplify . cpp <nl> ConstraintSystem : : matchTypes ( Type type1 , Type type2 , ConstraintKind kind , <nl> <nl> / / If either ( or both ) types are type variables , unify the type variables . <nl> if ( typeVar1 | | typeVar2 ) { <nl> + / / Handle the easy case of both being type variables , and being <nl> + / / identical , first . <nl> + if ( typeVar1 & & typeVar2 ) { <nl> + auto rep1 = getRepresentative ( typeVar1 ) ; <nl> + auto rep2 = getRepresentative ( typeVar2 ) ; <nl> + if ( rep1 = = rep2 ) { <nl> + / / We already merged these two types , so this constraint is <nl> + / / trivially solved . <nl> + return SolutionKind : : Solved ; <nl> + } <nl> + } <nl> + <nl> switch ( kind ) { <nl> case ConstraintKind : : Bind : <nl> case ConstraintKind : : BindToPointerType : <nl> ConstraintSystem : : matchTypes ( Type type1 , Type type2 , ConstraintKind kind , <nl> if ( typeVar1 & & typeVar2 ) { <nl> auto rep1 = getRepresentative ( typeVar1 ) ; <nl> auto rep2 = getRepresentative ( typeVar2 ) ; <nl> - if ( rep1 = = rep2 ) { <nl> - / / We already merged these two types , so this constraint is <nl> - / / trivially solved . <nl> - return SolutionKind : : Solved ; <nl> - } <nl> <nl> / / If exactly one of the type variables can bind to an lvalue , we <nl> / / can ' t merge these two type variables . <nl> ConstraintSystem : : matchTypes ( Type type1 , Type type2 , ConstraintKind kind , <nl> assignFixedType ( typeVar1 , type2 ) ; <nl> } <nl> return SolutionKind : : Solved ; <nl> - } else if ( typeVar1 & & typeVar2 ) { <nl> - auto rep1 = getRepresentative ( typeVar1 ) ; <nl> - auto rep2 = getRepresentative ( typeVar2 ) ; <nl> - if ( rep1 = = rep2 ) { <nl> - return SolutionKind : : Solved ; <nl> - } <nl> } <nl> <nl> return formUnsolvedResult ( ) ; <nl> ConstraintSystem : : matchTypes ( Type type1 , Type type2 , ConstraintKind kind , <nl> <nl> case ConstraintKind : : ArgumentTupleConversion : <nl> case ConstraintKind : : Conversion : <nl> - if ( typeVar1 & & typeVar2 ) { <nl> - auto rep1 = getRepresentative ( typeVar1 ) ; <nl> - auto rep2 = getRepresentative ( typeVar2 ) ; <nl> - if ( rep1 = = rep2 ) { <nl> - / / We already merged these two types , so this constraint is <nl> - / / trivially solved . <nl> - return SolutionKind : : Solved ; <nl> - } <nl> - } <nl> LLVM_FALLTHROUGH ; <nl> <nl> case ConstraintKind : : Subtype : <nl> ConstraintSystem : : matchTypes ( Type type1 , Type type2 , ConstraintKind kind , <nl> case ConstraintKind : : OperatorArgumentConversion : <nl> / / We couldn ' t solve this constraint . If only one of the types is a type <nl> / / variable , perhaps we can do something with it below . <nl> - if ( typeVar1 & & typeVar2 ) { <nl> - if ( typeVar1 = = typeVar2 ) return SolutionKind : : Solved ; <nl> - <nl> + if ( typeVar1 & & typeVar2 ) <nl> return formUnsolvedResult ( ) ; <nl> - } <nl> - <nl> break ; <nl> <nl> case ConstraintKind : : ApplicableFunction : <nl> mmm a / lib / Sema / ConstraintGraph . cpp <nl> ppp b / lib / Sema / ConstraintGraph . cpp <nl> bool ConstraintGraph : : contractEdges ( ) { <nl> / / being present in this case , so it can generate the appropriate lvalue <nl> / / wrapper for the argument type . <nl> if ( isParamBindingConstraint ) { <nl> - auto node = tyvar1 - > getImpl ( ) . getGraphNode ( ) ; <nl> - auto hasDependentConstraint = false ; <nl> - <nl> - for ( auto t1Constraint : node - > getConstraints ( ) ) { <nl> - if ( isStrictInoutSubtypeConstraint ( t1Constraint ) ) { <nl> - hasDependentConstraint = true ; <nl> - break ; <nl> - } <nl> - } <nl> - <nl> - if ( hasDependentConstraint ) <nl> + auto * node = tyvar1 - > getImpl ( ) . getGraphNode ( ) ; <nl> + auto constraints = node - > getConstraints ( ) ; <nl> + if ( llvm : : any_of ( constraints , [ ] ( Constraint * constraint ) { <nl> + return isStrictInoutSubtypeConstraint ( constraint ) ; <nl> + } ) ) { <nl> continue ; <nl> + } <nl> } <nl> <nl> auto rep1 = CS . getRepresentative ( tyvar1 ) ; <nl>
|
Merge remote - tracking branch ' origin / master ' into master - next
|
apple/swift
|
87a3ef8bfd14baf3ae426cd84f10c7cd59cd1cec
|
2017-09-13T23:09:57Z
|
mmm a / include / swift / AST / Decl . h <nl> ppp b / include / swift / AST / Decl . h <nl> inline bool Decl : : isPotentiallyOverridable ( ) const { <nl> isa < SubscriptDecl > ( this ) | | <nl> isa < FuncDecl > ( this ) | | <nl> isa < DestructorDecl > ( this ) ) { <nl> - return getDeclContext ( ) - > getSelfClassDecl ( ) ; <nl> + return getDeclContext ( ) - > getSelfClassDecl ( ) | | <nl> + isa < ProtocolDecl > ( getDeclContext ( ) ) ; <nl> } else { <nl> return false ; <nl> } <nl> mmm a / lib / AST / ASTDumper . cpp <nl> ppp b / lib / AST / ASTDumper . cpp <nl> namespace { <nl> < < getAccessLevelSpelling ( VD - > getFormalAccess ( ) ) ; <nl> } <nl> <nl> - if ( auto Overridden = VD - > getOverriddenDecl ( ) ) { <nl> - PrintWithColorRAII ( OS , OverrideColor ) < < " override = " ; <nl> - Overridden - > dumpRef ( PrintWithColorRAII ( OS , OverrideColor ) . getOS ( ) ) ; <nl> + if ( VD - > overriddenDeclsComputed ( ) ) { <nl> + auto overridden = VD - > getOverriddenDecls ( ) ; <nl> + if ( ! overridden . empty ( ) ) { <nl> + PrintWithColorRAII ( OS , OverrideColor ) < < " override = " ; <nl> + interleave ( overridden , <nl> + [ & ] ( ValueDecl * overridden ) { <nl> + overridden - > dumpRef ( <nl> + PrintWithColorRAII ( OS , OverrideColor ) . getOS ( ) ) ; <nl> + } , [ & ] ( ) { <nl> + OS < < " , " ; <nl> + } ) ; <nl> + } <nl> } <nl> <nl> if ( VD - > isFinal ( ) ) <nl> mmm a / lib / AST / ASTVerifier . cpp <nl> ppp b / lib / AST / ASTVerifier . cpp <nl> class Verifier : public ASTWalker { <nl> D - > getAttrs ( ) . hasAttribute < OverrideAttr > ( ) ) { <nl> if ( ! D - > isInvalid ( ) & & D - > hasInterfaceType ( ) & & <nl> ! isa < ClassDecl > ( D - > getDeclContext ( ) ) & & <nl> + ! isa < ProtocolDecl > ( D - > getDeclContext ( ) ) & & <nl> ! isa < ExtensionDecl > ( D - > getDeclContext ( ) ) ) { <nl> PrettyStackTraceDecl debugStack ( " verifying override " , D ) ; <nl> - Out < < " ' override ' attribute outside of a class \ n " ; <nl> + Out < < " ' override ' attribute outside of a class or protocol \ n " ; <nl> D - > dump ( Out ) ; <nl> abort ( ) ; <nl> } <nl> mmm a / lib / AST / SubstitutionMap . cpp <nl> ppp b / lib / AST / SubstitutionMap . cpp <nl> SubstitutionMap : : getProtocolSubstitutions ( ProtocolDecl * protocol , <nl> } <nl> <nl> SubstitutionMap <nl> - SubstitutionMap : : getOverrideSubstitutions ( const ValueDecl * baseDecl , <nl> - const ValueDecl * derivedDecl , <nl> - Optional < SubstitutionMap > derivedSubs ) { <nl> + SubstitutionMap : : getOverrideSubstitutions ( <nl> + const ValueDecl * baseDecl , <nl> + const ValueDecl * derivedDecl , <nl> + Optional < SubstitutionMap > derivedSubs ) { <nl> + / / For overrides within a protocol hierarchy , substitute the Self type . <nl> + if ( auto baseProto = baseDecl - > getDeclContext ( ) - > getSelfProtocolDecl ( ) ) { <nl> + if ( auto derivedProtoSelf = <nl> + derivedDecl - > getDeclContext ( ) - > getProtocolSelfType ( ) ) { <nl> + return SubstitutionMap : : getProtocolSubstitutions ( <nl> + baseProto , <nl> + derivedProtoSelf , <nl> + ProtocolConformanceRef ( baseProto ) ) ; <nl> + } <nl> + <nl> + return SubstitutionMap ( ) ; <nl> + } <nl> + <nl> auto * baseClass = baseDecl - > getDeclContext ( ) - > getSelfClassDecl ( ) ; <nl> auto * derivedClass = derivedDecl - > getDeclContext ( ) - > getSelfClassDecl ( ) ; <nl> <nl> mmm a / lib / AST / Type . cpp <nl> ppp b / lib / AST / Type . cpp <nl> Type TypeBase : : adjustSuperclassMemberDeclType ( const ValueDecl * baseDecl , <nl> <nl> auto type = memberType . subst ( subs , SubstFlags : : UseErrorType ) ; <nl> <nl> - if ( isa < AbstractFunctionDecl > ( baseDecl ) ) { <nl> + if ( isa < AbstractFunctionDecl > ( baseDecl ) & & <nl> + ! baseDecl - > getDeclContext ( ) - > getSelfProtocolDecl ( ) ) { <nl> type = type - > replaceSelfParameterType ( this ) ; <nl> if ( auto func = dyn_cast < FuncDecl > ( baseDecl ) ) { <nl> if ( func - > hasDynamicSelf ( ) ) { <nl> mmm a / lib / SILOptimizer / IPO / DeadFunctionElimination . cpp <nl> ppp b / lib / SILOptimizer / IPO / DeadFunctionElimination . cpp <nl> class FunctionLivenessComputation { <nl> / / / Gets the base implementation of a method . <nl> / / / We always use the most overridden function to describe a method . <nl> AbstractFunctionDecl * getBase ( AbstractFunctionDecl * FD ) { <nl> + / / FIXME : We currently don ' t use the most overridden function in <nl> + / / witness tables . <nl> + if ( isa < ProtocolDecl > ( FD - > getDeclContext ( ) ) ) <nl> + return FD ; <nl> + <nl> while ( FD - > getOverriddenDecl ( ) ) { <nl> FD = FD - > getOverriddenDecl ( ) ; <nl> } <nl> mmm a / lib / Sema / TypeCheckDeclOverride . cpp <nl> ppp b / lib / Sema / TypeCheckDeclOverride . cpp <nl> static bool areOverrideCompatibleSimple ( ValueDecl * decl , <nl> parentDecl - > getFullName ( ) . getArgumentNames ( ) . size ( ) ) <nl> return false ; <nl> <nl> - / / If the parent declaration is not in a class ( or extension thereof ) , we <nl> - / / cannot override it . <nl> - if ( ! parentDecl - > getDeclContext ( ) - > getSelfClassDecl ( ) ) <nl> + / / If the parent declaration is not in a class ( or extension thereof ) or <nl> + / / a protocol , we cannot override it . <nl> + if ( decl - > getDeclContext ( ) - > getSelfClassDecl ( ) & & <nl> + parentDecl - > getDeclContext ( ) - > getSelfClassDecl ( ) ) { <nl> + / / Okay : class override <nl> + } else if ( isa < ProtocolDecl > ( decl - > getDeclContext ( ) ) & & <nl> + isa < ProtocolDecl > ( parentDecl - > getDeclContext ( ) ) ) { <nl> + / / Okay : protocol override . <nl> + } else { <nl> + / / Cannot be an override . <nl> return false ; <nl> + } <nl> <nl> / / The declarations must be of the same kind . <nl> if ( decl - > getKind ( ) ! = parentDecl - > getKind ( ) ) <nl> namespace { <nl> struct OverrideMatch { <nl> ValueDecl * Decl ; <nl> bool IsExact ; <nl> - Type SubstType ; <nl> } ; <nl> } <nl> <nl> namespace { <nl> / / / The type of the declaration , cached here once it has been computed . <nl> Type cachedDeclType ; <nl> <nl> + / / / Whether this is an override of a class member . <nl> + bool isClassOverride ( ) const { <nl> + return decl - > getDeclContext ( ) - > getSelfClassDecl ( ) ! = nullptr ; <nl> + } <nl> + <nl> + / / / Whether this is an override of a protocol member . <nl> + bool isProtocolOverride ( ) const { <nl> + return decl - > getDeclContext ( ) - > getSelfProtocolDecl ( ) ! = nullptr ; <nl> + } <nl> + <nl> public : <nl> OverrideMatcher ( ValueDecl * decl ) ; <nl> <nl> namespace { <nl> / / / using the heuristics appropriate for the given \ c attempt . <nl> SmallVector < OverrideMatch , 2 > match ( OverrideCheckingAttempt attempt ) ; <nl> <nl> + / / / Check each of the given matches , returning only those that <nl> + / / / succeeded . <nl> + TinyPtrVector < ValueDecl * > checkPotentialOverrides ( <nl> + SmallVectorImpl < OverrideMatch > & matches , <nl> + OverrideCheckingAttempt attempt ) ; <nl> + <nl> + private : <nl> / / / We have determined that we have an override of the given \ c baseDecl . <nl> / / / <nl> / / / Check that the override itself is valid . <nl> bool checkOverride ( ValueDecl * baseDecl , <nl> OverrideCheckingAttempt attempt ) ; <nl> <nl> - private : <nl> / / / Retrieve the type of the declaration , to be used in comparisons . <nl> Type getDeclComparisonType ( ) { <nl> if ( ! cachedDeclType ) { <nl> namespace { <nl> / / / Adjust the interface of the given declaration , which is found in <nl> / / / a supertype of the given type . <nl> Type getSuperMemberDeclType ( ValueDecl * baseDecl ) const { <nl> - Type superclass = <nl> - decl - > getDeclContext ( ) - > getSelfInterfaceType ( ) - > getSuperclass ( ) ; <nl> - assert ( superclass & & " No superclass type ? " ) ; <nl> - return superclass - > adjustSuperclassMemberDeclType ( <nl> + auto selfType = decl - > getDeclContext ( ) - > getSelfInterfaceType ( ) ; <nl> + if ( selfType - > getClassOrBoundGenericClass ( ) ) { <nl> + selfType = selfType - > getSuperclass ( ) ; <nl> + assert ( selfType & & " No superclass type ? " ) ; <nl> + } <nl> + <nl> + return selfType - > adjustSuperclassMemberDeclType ( <nl> baseDecl , decl , baseDecl - > getInterfaceType ( ) ) ; <nl> } <nl> } ; <nl> OverrideMatcher : : OverrideMatcher ( ValueDecl * decl ) <nl> if ( auto classDecl = dc - > getSelfClassDecl ( ) ) { <nl> if ( auto superclassDecl = classDecl - > getSuperclassDecl ( ) ) <nl> superContexts . push_back ( superclassDecl ) ; <nl> + } else if ( auto protocol = dyn_cast < ProtocolDecl > ( dc ) ) { <nl> + auto inheritedProtocols = protocol - > getInheritedProtocols ( ) ; <nl> + superContexts . insert ( superContexts . end ( ) , inheritedProtocols . begin ( ) , <nl> + inheritedProtocols . end ( ) ) ; <nl> } <nl> } <nl> <nl> SmallVector < OverrideMatch , 2 > OverrideMatcher : : match ( <nl> / / If we don ' t have members available yet , or we looked them up based on a <nl> / / different name , look them up now . <nl> if ( members . empty ( ) | | name ! = membersName ) { <nl> - auto lookupOptions = defaultMemberLookupOptions ; <nl> - <nl> - / / Class methods cannot override declarations only <nl> - / / visible as protocol requirements or protocol <nl> - / / extension members . <nl> - lookupOptions - = NameLookupFlags : : ProtocolMembers ; <nl> - lookupOptions - = NameLookupFlags : : PerformConformanceCheck ; <nl> - <nl> membersName = name ; <nl> members . clear ( ) ; <nl> dc - > lookupQualified ( superContexts , membersName , <nl> SmallVector < OverrideMatch , 2 > OverrideMatcher : : match ( <nl> <nl> Type declTy = getDeclComparisonType ( ) ; <nl> if ( isOverrideBasedOnType ( decl , declTy , parentDecl , parentDeclTy ) ) { <nl> - matches . push_back ( { parentDecl , true , parentDeclTy } ) ; <nl> + matches . push_back ( { parentDecl , true } ) ; <nl> continue ; <nl> } <nl> <nl> / / If this is a property , we accept the match and then reject it below <nl> / / if the types don ' t line up , since you can ' t overload properties based <nl> / / on types . <nl> - if ( isa < VarDecl > ( parentDecl ) | | <nl> + if ( ( isa < VarDecl > ( parentDecl ) & & isClassOverride ( ) ) | | <nl> attempt = = OverrideCheckingAttempt : : MismatchedTypes ) { <nl> - matches . push_back ( { parentDecl , false , parentDeclTy } ) ; <nl> + matches . push_back ( { parentDecl , false } ) ; <nl> continue ; <nl> } <nl> <nl> SmallVector < OverrideMatch , 2 > OverrideMatcher : : match ( <nl> <nl> if ( declFnTy - > matchesFunctionType ( parentDeclFnTy , matchMode , <nl> paramsAndResultMatch ) ) { <nl> - matches . push_back ( { parentDecl , false , parentDeclTy } ) ; <nl> + matches . push_back ( { parentDecl , false } ) ; <nl> continue ; <nl> } <nl> } else if ( getDeclComparisonType ( ) - > matches ( parentDeclTy , matchMode ) ) { <nl> - matches . push_back ( { parentDecl , false , parentDeclTy } ) ; <nl> + matches . push_back ( { parentDecl , false } ) ; <nl> continue ; <nl> } <nl> } <nl> bool OverrideMatcher : : checkOverride ( ValueDecl * baseDecl , <nl> if ( ! isAccessor & & <nl> ! baseHasOpenAccess & & <nl> baseDecl - > getModuleContext ( ) ! = decl - > getModuleContext ( ) & & <nl> - ! isa < ConstructorDecl > ( decl ) ) { <nl> + ! isa < ConstructorDecl > ( decl ) & & <nl> + ! isa < ProtocolDecl > ( decl - > getDeclContext ( ) ) ) { <nl> diags . diagnose ( decl , diag : : override_of_non_open , <nl> decl - > getDescriptiveKind ( ) ) ; <nl> <nl> bool OverrideMatcher : : checkOverride ( ValueDecl * baseDecl , <nl> } <nl> diags . diagnose ( baseDecl , diag : : overridden_here ) ; <nl> <nl> - } else if ( ! isa < ConstructorDecl > ( decl ) ) { <nl> + } else if ( ! isa < ConstructorDecl > ( decl ) & & <nl> + ! isa < ProtocolDecl > ( decl - > getDeclContext ( ) ) ) { <nl> auto matchAccessScope = <nl> baseDecl - > getFormalAccessScope ( dc ) ; <nl> auto classAccessScope = <nl> bool OverrideMatcher : : checkOverride ( ValueDecl * baseDecl , <nl> <nl> / / Catch - all to make sure we don ' t silently accept something we shouldn ' t . <nl> if ( attempt ! = OverrideCheckingAttempt : : PerfectMatch ) { <nl> - OverrideMatch match { decl , / * isExact = * / false , declTy } ; <nl> + OverrideMatch match { decl , / * isExact = * / false } ; <nl> diagnoseGeneralOverrideFailure ( decl , match , attempt ) ; <nl> } <nl> <nl> static void invalidateOverrideAttribute ( ValueDecl * decl ) { <nl> overrideAttr - > setInvalid ( ) ; <nl> } <nl> <nl> + TinyPtrVector < ValueDecl * > OverrideMatcher : : checkPotentialOverrides ( <nl> + SmallVectorImpl < OverrideMatch > & matches , <nl> + OverrideCheckingAttempt attempt ) { <nl> + / / If we override more than one declaration from a class , complain . <nl> + if ( matches . size ( ) > 1 & & decl - > getDeclContext ( ) - > getSelfClassDecl ( ) ) { <nl> + diagnoseGeneralOverrideFailure ( decl , matches , attempt ) ; <nl> + return { } ; <nl> + } <nl> + <nl> + / / Check the matches . If any are ill - formed , drop them . <nl> + TinyPtrVector < ValueDecl * > overridden ; <nl> + for ( const auto & match : matches ) { <nl> + if ( checkOverride ( match . Decl , attempt ) ) <nl> + continue ; <nl> + <nl> + overridden . push_back ( match . Decl ) ; <nl> + } <nl> + <nl> + / / If there were no overrides , invalidate the " override " attribute . <nl> + if ( overridden . empty ( ) ) <nl> + invalidateOverrideAttribute ( decl ) ; <nl> + <nl> + return overridden ; <nl> + } <nl> + <nl> / / / Determine which method or subscript this method or subscript overrides <nl> / / / ( if any ) . <nl> / / / <nl> bool swift : : checkOverrides ( ValueDecl * decl ) { <nl> <nl> assert ( ! matches . empty ( ) ) ; <nl> <nl> - / / If we override more than one declaration , complain . <nl> - if ( matches . size ( ) > 1 ) { <nl> - diagnoseGeneralOverrideFailure ( decl , matches , attempt ) ; <nl> - invalidateOverrideAttribute ( decl ) ; <nl> - return true ; <nl> - } <nl> - <nl> - / / Check the single match . If it ' s ill - formed , invalidate the override <nl> - / / attribute so we don ' t try again . <nl> - if ( matcher . checkOverride ( matches . front ( ) . Decl , attempt ) ) { <nl> - invalidateOverrideAttribute ( decl ) ; <nl> - return true ; <nl> - } <nl> - <nl> / / FIXME : Check for missing ' override ' keyword here ? <nl> <nl> - / / We performed override checking , so record the override . <nl> + / / We performed override checking , so record the overrides . <nl> / / FIXME : It ' s weird to be pushing state here , but how do we say that <nl> / / this check subsumes the normal ' override ' check ? <nl> - decl - > setOverriddenDecl ( matches . front ( ) . Decl ) ; <nl> + auto overridden = matcher . checkPotentialOverrides ( matches , attempt ) ; <nl> + if ( overridden . empty ( ) ) <nl> + invalidateOverrideAttribute ( decl ) ; <nl> + decl - > setOverriddenDecls ( overridden ) ; <nl> return false ; <nl> } <nl> <nl> namespace { <nl> <nl> / / / Determine whether overriding the given declaration requires a keyword . <nl> bool swift : : overrideRequiresKeyword ( ValueDecl * overridden ) { <nl> + if ( isa < AccessorDecl > ( overridden ) ) <nl> + return false ; <nl> + <nl> + if ( isa < ProtocolDecl > ( overridden - > getDeclContext ( ) ) ) <nl> + return false ; <nl> + <nl> if ( auto ctor = dyn_cast < ConstructorDecl > ( overridden ) ) { <nl> return ctor - > isDesignatedInit ( ) & & ! ctor - > isRequired ( ) ; <nl> } <nl> <nl> - if ( isa < AccessorDecl > ( overridden ) ) <nl> - return false ; <nl> - <nl> return true ; <nl> } <nl> <nl> OverriddenDeclsRequest : : evaluate ( Evaluator & evaluator , ValueDecl * decl ) const { <nl> / / Value to return in error cases <nl> auto noResults = llvm : : TinyPtrVector < ValueDecl * > ( ) ; <nl> <nl> - / / Only members of classes can override other declarations . <nl> - if ( ! decl - > getDeclContext ( ) - > getSelfClassDecl ( ) ) <nl> + / / Only members of classes or protocols can override other declarations . <nl> + if ( ! decl - > getDeclContext ( ) - > getSelfClassDecl ( ) & & <nl> + ! isa < ProtocolDecl > ( decl - > getDeclContext ( ) ) ) <nl> return noResults ; <nl> <nl> / / Types that aren ' t associated types cannot be overridden . <nl> OverriddenDeclsRequest : : evaluate ( Evaluator & evaluator , ValueDecl * decl ) const { <nl> if ( auto accessor = dyn_cast < AccessorDecl > ( decl ) ) { <nl> auto overridingASD = accessor - > getStorage ( ) ; <nl> <nl> - / / Find the overidden storage declaration . If there isn ' t one , we ' re done . <nl> - auto baseASD = overridingASD - > getOverriddenDecl ( ) ; <nl> - if ( ! baseASD ) return noResults ; <nl> + / / Check the various overridden storage declarations . <nl> + SmallVector < OverrideMatch , 2 > matches ; <nl> + for ( auto overridden : overridingASD - > getOverriddenDecls ( ) ) { <nl> + auto baseASD = cast < AbstractStorageDecl > ( overridden ) ; <nl> + auto kind = accessor - > getAccessorKind ( ) ; <nl> <nl> - auto kind = accessor - > getAccessorKind ( ) ; <nl> + / / If the base doesn ' t consider this an opaque accessor , <nl> + / / this isn ' t really an override . <nl> + if ( ! baseASD - > requiresOpaqueAccessor ( kind ) ) <nl> + continue ; <nl> <nl> - / / If the base doesn ' t consider this an opaque accessor , <nl> - / / this isn ' t really an override . <nl> - if ( ! baseASD - > requiresOpaqueAccessor ( kind ) ) <nl> - return noResults ; <nl> + / / Find the base accessor ; if there isn ' t one , we ' re done . <nl> + auto baseAccessor = baseASD - > getAccessor ( kind ) ; <nl> + if ( ! baseAccessor ) continue ; <nl> <nl> - switch ( kind ) { <nl> - case AccessorKind : : Read : <nl> - if ( baseASD - > getReadCoroutine ( ) - > hasForcedStaticDispatch ( ) ) <nl> - return noResults ; <nl> - LLVM_FALLTHROUGH ; <nl> - case AccessorKind : : Get : <nl> - break ; <nl> + switch ( kind ) { <nl> + case AccessorKind : : Read : <nl> + if ( baseASD - > getReadCoroutine ( ) - > hasForcedStaticDispatch ( ) ) <nl> + continue ; <nl> + LLVM_FALLTHROUGH ; <nl> <nl> - case AccessorKind : : Modify : <nl> - if ( baseASD - > getModifyCoroutine ( ) - > hasForcedStaticDispatch ( ) ) <nl> - return noResults ; <nl> - LLVM_FALLTHROUGH ; <nl> - case AccessorKind : : Set : <nl> - / / For setter accessors , we need the base ' s setter to be <nl> - / / accessible from the overriding context , or it ' s not an override . <nl> - if ( ! baseASD - > isSetterAccessibleFrom ( overridingASD - > getDeclContext ( ) ) ) <nl> - return noResults ; <nl> - break ; <nl> + case AccessorKind : : Get : <nl> + break ; <nl> + <nl> + case AccessorKind : : Modify : <nl> + if ( baseASD - > getModifyCoroutine ( ) - > hasForcedStaticDispatch ( ) ) <nl> + continue ; <nl> + <nl> + LLVM_FALLTHROUGH ; <nl> + <nl> + case AccessorKind : : Set : <nl> + / / For setter accessors , we need the base ' s setter to be <nl> + / / accessible from the overriding context , or it ' s not an override . <nl> + if ( ! baseASD - > isSetterAccessibleFrom ( overridingASD - > getDeclContext ( ) ) ) <nl> + continue ; <nl> + break ; <nl> <nl> # define OPAQUE_ACCESSOR ( ID , KEYWORD ) <nl> # define ACCESSOR ( ID ) \ <nl> - case AccessorKind : : ID : <nl> + case AccessorKind : : ID : <nl> # include " swift / AST / AccessorKinds . def " <nl> - llvm_unreachable ( " non - opaque accessor was required as opaque by base " ) ; <nl> - } <nl> + llvm_unreachable ( " non - opaque accessor was required as opaque by base " ) ; <nl> + } <nl> <nl> - / / We are overriding the base accessor . <nl> - auto baseAccessor = baseASD - > getAccessor ( kind ) ; <nl> - assert ( baseAccessor ) ; <nl> + / / We are overriding the base accessor . <nl> + matches . push_back ( { baseAccessor , / * IsExact = * / true } ) ; <nl> + } <nl> <nl> - / / Check the correctness of the override . <nl> - OverrideMatcher matcher ( accessor ) ; <nl> - if ( matcher . checkOverride ( baseAccessor , <nl> - OverrideCheckingAttempt : : PerfectMatch ) ) { <nl> - invalidateOverrideAttribute ( decl ) ; <nl> + if ( matches . empty ( ) ) <nl> return noResults ; <nl> - } <nl> <nl> - return llvm : : TinyPtrVector < ValueDecl * > { baseAccessor } ; <nl> + / / Check the correctness of the overrides . <nl> + OverrideMatcher matcher ( accessor ) ; <nl> + return matcher . checkPotentialOverrides ( <nl> + matches , <nl> + OverrideCheckingAttempt : : PerfectMatch ) ; <nl> } <nl> <nl> - / / Only initializers and declarations marked with the ' override ' declaration <nl> - / / modifier can override declarations . <nl> + / / Only initializers , declarations marked with the ' override ' declaration <nl> + / / modifier , and members of protocols can override declarations . <nl> if ( ! isa < ConstructorDecl > ( decl ) & & <nl> + ! isa < ProtocolDecl > ( decl - > getDeclContext ( ) ) & & <nl> ! decl - > getAttrs ( ) . hasAttribute < OverrideAttr > ( ) ) <nl> return noResults ; <nl> <nl> OverriddenDeclsRequest : : evaluate ( Evaluator & evaluator , ValueDecl * decl ) const { <nl> return noResults ; <nl> } <nl> <nl> - / / If we have more than one potential match , diagnose the ambiguity and <nl> - / / fail . <nl> - if ( matches . size ( ) > 1 ) { <nl> + / / If we have more than one potential match from a class , diagnose the <nl> + / / ambiguity and fail . <nl> + if ( matches . size ( ) > 1 & & decl - > getDeclContext ( ) - > getSelfClassDecl ( ) ) { <nl> diagnoseGeneralOverrideFailure ( decl , matches , <nl> OverrideCheckingAttempt : : PerfectMatch ) ; <nl> invalidateOverrideAttribute ( decl ) ; <nl> return noResults ; <nl> } <nl> <nl> - / / Check the correctness of the override . <nl> - if ( matcher . checkOverride ( matches . front ( ) . Decl , <nl> - OverrideCheckingAttempt : : PerfectMatch ) ) { <nl> - invalidateOverrideAttribute ( decl ) ; <nl> - return noResults ; <nl> - } <nl> - <nl> - return llvm : : TinyPtrVector < ValueDecl * > { matches . front ( ) . Decl } ; <nl> + / / Check the matches . If any are ill - formed , invalidate the override attribute <nl> + / / so we don ' t try again . <nl> + return matcher . checkPotentialOverrides ( matches , <nl> + OverrideCheckingAttempt : : PerfectMatch ) ; <nl> } <nl> mmm a / test / IDE / complete_associated_types . swift <nl> ppp b / test / IDE / complete_associated_types . swift <nl> struct StructWithBrokenConformance : FooProtocolWithAssociatedTypes { <nl> func testBrokenConformances1 ( ) { <nl> StructWithBrokenConformance . # ^ BROKEN_CONFORMANCE_1 ^ # <nl> } <nl> - / / BROKEN_CONFORMANCE_1 : Begin completions , 35 items <nl> + / / BROKEN_CONFORMANCE_1 : Begin completions , 33 items <nl> / / BROKEN_CONFORMANCE_1 - DAG : Decl [ TypeAlias ] / CurrNominal : DefaultedTypeCommonA [ # StructWithBrokenConformance . DefaultedTypeCommonA # ] ; name = DefaultedTypeCommonA <nl> / / BROKEN_CONFORMANCE_1 - DAG : Decl [ TypeAlias ] / CurrNominal : DefaultedTypeCommonB [ # StructWithBrokenConformance . DefaultedTypeCommonB # ] ; name = DefaultedTypeCommonB <nl> / / BROKEN_CONFORMANCE_1 - DAG : Decl [ TypeAlias ] / CurrNominal : FooBaseDefaultedTypeB [ # StructWithBrokenConformance . FooBaseDefaultedTypeB # ] ; name = FooBaseDefaultedTypeB <nl> func testBrokenConformances1 ( ) { <nl> / / BROKEN_CONFORMANCE_1 - DAG : Decl [ TypeAlias ] / CurrNominal : FooBaseDefaultedTypeC [ # StructWithBrokenConformance . FooBaseDefaultedTypeC # ] ; name = FooBaseDefaultedTypeC <nl> / / BROKEN_CONFORMANCE_1 - DAG : Decl [ TypeAlias ] / CurrNominal : DeducedTypeCommonC [ # StructWithBrokenConformance . DeducedTypeCommonC # ] ; name = DeducedTypeCommonC <nl> / / BROKEN_CONFORMANCE_1 - DAG : Decl [ TypeAlias ] / CurrNominal : DeducedTypeCommonD [ # StructWithBrokenConformance . DeducedTypeCommonD # ] ; name = DeducedTypeCommonD <nl> - / / BROKEN_CONFORMANCE_1 - DAG : Decl [ InstanceMethod ] / Super : deduceCommonA ( { # self : StructWithBrokenConformance # } ) [ # ( ) - > StructWithBrokenConformance . DeducedTypeCommonA # ] { { ; name = . + $ } } <nl> - / / BROKEN_CONFORMANCE_1 - DAG : Decl [ InstanceMethod ] / Super : deduceCommonB ( { # self : StructWithBrokenConformance # } ) [ # ( ) - > StructWithBrokenConformance . DeducedTypeCommonB # ] { { ; name = . + $ } } <nl> / / BROKEN_CONFORMANCE_1 - DAG : Decl [ InstanceMethod ] / Super : deduceCommonC ( { # self : StructWithBrokenConformance # } ) [ # ( ) - > StructWithBrokenConformance . DeducedTypeCommonC # ] { { ; name = . + $ } } <nl> / / BROKEN_CONFORMANCE_1 - DAG : Decl [ InstanceMethod ] / Super : deduceCommonD ( { # self : StructWithBrokenConformance # } ) [ # ( ) - > StructWithBrokenConformance . DeducedTypeCommonD # ] { { ; name = . + $ } } <nl> / / BROKEN_CONFORMANCE_1 - DAG : Decl [ TypeAlias ] / CurrNominal : FooBaseDeducedTypeA [ # StructWithBrokenConformance . FooBaseDeducedTypeA # ] ; name = FooBaseDeducedTypeA <nl> mmm a / test / Index / conformances . swift <nl> ppp b / test / Index / conformances . swift <nl> class SubMultiConf : BaseMultiConf , P2 , P1 , P3 { / / CHECK : [ [ @ LINE ] ] : 7 | class / Swift <nl> } <nl> <nl> protocol InheritingP : P1 { / / CHECK : [ [ @ LINE ] ] : 10 | protocol / Swift | InheritingP | [ [ InheritingP_USR : . * ] ] | Def <nl> - / / FIXME : Should have override relation with P1 . foo ( ) <nl> - func foo ( ) / / CHECK : [ [ @ LINE ] ] : 8 | instance - method / Swift | foo ( ) | [ [ InheritingP_foo_USR : . * ] ] | Def , Dyn , RelChild | rel : 1 <nl> + func foo ( ) / / CHECK : [ [ @ LINE ] ] : 8 | instance - method / Swift | foo ( ) | [ [ InheritingP_foo_USR : . * ] ] | Def , Dyn , RelChild , RelOver | rel : 2 <nl> + / / CHECK - NEXT : RelOver | instance - method / Swift | foo ( ) | s : 14swift_ide_test2P1P3fooyyF <nl> / / CHECK - NEXT : RelChild | protocol / Swift | InheritingP | [ [ InheritingP_USR ] ] <nl> } <nl> <nl> struct DirectConf2 : InheritingP { / / CHECK : [ [ @ LINE ] ] : 8 | struct / Swift | DirectC <nl> } <nl> <nl> extension InheritingP { / / CHECK : [ [ @ LINE ] ] : 11 | extension / ext - protocol / Swift | InheritingP | [ [ InheritingP_USR : . * ] ] | Def <nl> - / / FIXME : Should only override InheritingP . foo ( ) <nl> - func foo ( ) { } / / CHECK : [ [ @ LINE ] ] : 8 | instance - method / Swift | foo ( ) | [ [ InheritingP_ext_foo_USR : . * ] ] | Def , Dyn , RelChild , RelOver | rel : 3 <nl> + func foo ( ) { } / / CHECK : [ [ @ LINE ] ] : 8 | instance - method / Swift | foo ( ) | [ [ InheritingP_ext_foo_USR : . * ] ] | Def , Dyn , RelChild , RelOver | rel : 2 <nl> / / CHECK - NEXT : RelOver | instance - method / Swift | foo ( ) | [ [ InheritingP_foo_USR ] ] <nl> - / / CHECK - NEXT : RelOver | instance - method / Swift | foo ( ) | [ [ P1_foo_USR ] ] <nl> / / CHECK - NEXT : RelChild | extension / ext - protocol / Swift | InheritingP | [ [ InheritingP_USR ] ] <nl> } <nl> mmm a / test / Index / roles . swift <nl> ppp b / test / Index / roles . swift <nl> protocol ProtRoot { <nl> <nl> protocol ProtDerived : ProtRoot { <nl> func fooCommon ( ) <nl> + / / CHECK : [ [ @ LINE - 1 ] ] : 8 | instance - method / Swift | fooCommon ( ) | s : 14swift_ide_test11ProtDerivedP9fooCommonyyF | Def , Dyn , RelChild , RelOver | rel : 2 <nl> + <nl> func bar1 ( ) <nl> func bar2 ( ) <nl> func bar3 ( _ : Int ) <nl> protocol ProtDerived : ProtRoot { <nl> <nl> extension ProtDerived { <nl> func fooCommon ( ) { } <nl> - / / CHECK : [ [ @ LINE - 1 ] ] : 8 | instance - method / Swift | fooCommon ( ) | s : 14swift_ide_test11ProtDerivedPAAE9fooCommonyyF | Def , Dyn , RelChild , RelOver | rel : 3 <nl> + / / CHECK : [ [ @ LINE - 1 ] ] : 8 | instance - method / Swift | fooCommon ( ) | s : 14swift_ide_test11ProtDerivedPAAE9fooCommonyyF | Def , Dyn , RelChild , RelOver | rel : 2 <nl> / / CHECK - NEXT : RelOver | instance - method / Swift | fooCommon ( ) | s : 14swift_ide_test11ProtDerivedP9fooCommonyyF <nl> - / / CHECK - NEXT : RelOver | instance - method / Swift | fooCommon ( ) | s : 14swift_ide_test8ProtRootP9fooCommonyyF <nl> <nl> func foo1 ( ) { } <nl> / / CHECK : [ [ @ LINE - 1 ] ] : 8 | instance - method / Swift | foo1 ( ) | s : 14swift_ide_test11ProtDerivedPAAE4foo1yyF | Def , Dyn , RelChild , RelOver | rel : 2 <nl> new file mode 100644 <nl> index 000000000000 . . 90adb62f0a50 <nl> mmm / dev / null <nl> ppp b / test / decl / protocol / override . swift <nl> <nl> + / / RUN : % target - typecheck - verify - swift - dump - ast > % t . ast 2 > & 1 <nl> + / / RUN : % FileCheck % s < % t . ast <nl> + <nl> + / / Test overriding of protocol members . <nl> + <nl> + protocol P0 { <nl> + func foo ( ) <nl> + } <nl> + <nl> + protocol P1 : P0 { <nl> + / / CHECK : func_decl { { . * } } foo ( ) { { . * } } Self : P1 { { . * } } override = { { . * } } P0 . foo <nl> + func foo ( ) <nl> + } <nl> + <nl> + protocol P2 { <nl> + func foo ( ) <nl> + } <nl> + <nl> + protocol P3 : P1 , P2 { <nl> + / / CHECK : func_decl { { . * } } foo ( ) { { . * } } Self : P3 { { . * } } override = { { . * } } P2 . foo { { . * , . * } } P1 . foo <nl> + func foo ( ) <nl> + } <nl> + <nl> + protocol P4 : P0 { <nl> + / / CHECK : func_decl { { . * } } foo ( ) { { . * } } Self : P4 <nl> + / / CHECK - NOT : override = <nl> + / / CHECK - SAME : ) <nl> + func foo ( ) - > Int <nl> + } <nl>
|
[ Type checker ] Start tracking overrides of protocol requirements .
|
apple/swift
|
0972111c6086b8d3874b6fceac0ef495101742ed
|
2018-09-04T23:42:06Z
|
mmm a / docs / LangRef . html <nl> ppp b / docs / LangRef . html <nl> < h3 id = " identifier " > Identifier Tokens < / h3 > <nl> < br > < br > < b > [ 2 ] < / b > The ' - > ' token is < a href = " # reserved_punctuation " > reserved punctuation < / a > , <nl> and cannot be used as an operator identifier . <nl> <nl> - < br > < br > < b > [ 3 ] < / b > The ' / / ' , ' / * ' , and ' * / ' tokens are < a href = " # whitespace " > reserved for comments < / a > , <nl> + < br > < br > < b > [ 3 ] < / b > The unary ' & ' token is < a href = " # reserved_punctuation " > reserved punctuation < / a > , <nl> + and cannot be used as an operator identifier . <nl> + <nl> + < br > < br > < b > [ 4 ] < / b > The ' / / ' , ' / * ' , and ' * / ' tokens are < a href = " # whitespace " > reserved for comments < / a > , <nl> and cannot be used as operator identifiers . <nl> < / div > <nl> <nl> < h3 id = " identifier " > Identifier Tokens < / h3 > <nl> <nl> Note : excludes ' = ' , see < b > [ 1 ] < / b > <nl> excludes ' - > ' , see < b > [ 2 ] < / b > <nl> - excludes ' / / ' , ' / * ' , and ' * / ' , see < b > [ 3 ] < / b > <nl> + excludes unary ' & ' , see < b > [ 3 ] < / b > <nl> + excludes ' / / ' , ' / * ' , and ' * / ' , see < b > [ 4 ] < / b > <nl> ' . . ' is an operator , not two ' . ' s . <nl> <nl> operator - binary : : = operator <nl>
|
Document that unary ' & ' is reserved
|
apple/swift
|
60eb51b85bea96198e3385be8d5125c02f962386
|
2013-01-24T17:36:35Z
|
mmm a / algorithms / cpp / minimumPathSum / minimumPathSum . cpp <nl> ppp b / algorithms / cpp / minimumPathSum / minimumPathSum . cpp <nl> <nl> # include < vector > <nl> using namespace std ; <nl> <nl> - int minPathSum ( vector < vector < int > > & grid ) { <nl> - if ( grid . size ( ) < = 0 ) { <nl> - return 0 ; <nl> - } <nl> - int i , j ; <nl> - for ( i = 0 ; i < grid . size ( ) ; i + + ) { <nl> - for ( j = 0 ; j < grid [ i ] . size ( ) ; j + + ) { <nl> - int top = i - 1 < 0 ? INT_MAX : grid [ i - 1 ] [ j ] ; <nl> - int left = j - 1 < 0 ? INT_MAX : grid [ i ] [ j - 1 ] ; <nl> - if ( top = = INT_MAX & & left = = INT_MAX ) { <nl> - continue ; <nl> - } <nl> - grid [ i ] [ j ] + = ( top < left ? top : left ) ; <nl> - <nl> + int minPathSum ( vector < vector < int > > & grid ) { <nl> + for ( int i = 0 ; i < grid . size ( ) ; i + + ) { <nl> + for ( int j = 0 ; j < grid [ 0 ] . size ( ) ; j + + ) { <nl> + if ( i = = 0 & & j = = 0 ) continue ; <nl> + else if ( i = = 0 ) grid [ 0 ] [ j ] + = grid [ 0 ] [ j - 1 ] ; <nl> + else if ( j = = 0 ) grid [ i ] [ 0 ] + = grid [ i - 1 ] [ j ] ; <nl> + else grid [ i ] [ j ] + = min ( grid [ i - 1 ] [ j ] , grid [ i ] [ j - 1 ] ) ; <nl> } <nl> } <nl> - <nl> return grid [ grid . size ( ) - 1 ] [ grid [ 0 ] . size ( ) - 1 ] ; <nl> } <nl> <nl> - <nl> int main ( ) <nl> { <nl> int a [ 6 ] [ 2 ] = { { 7 , 2 } , { 6 , 6 } , { 8 , 6 } , { 8 , 7 } , { 5 , 0 } , { 6 , 0 } } ; <nl> int main ( ) <nl> } <nl> grid . push_back ( v ) ; <nl> } <nl> - <nl> + <nl> cout < < " minPathSum = " < < minPathSum ( grid ) < < endl ; <nl> <nl> return 0 ; <nl>
|
more clean implementation
|
haoel/leetcode
|
270faa0b2e27d0fd1c0922442d7782c0b3227688
|
2019-04-02T16:28:49Z
|
mmm a / configure . ac <nl> ppp b / configure . ac <nl> AC_ARG_ENABLE ( [ debug ] , <nl> [ enable_debug = no ] ) <nl> <nl> if test " x $ enable_debug " = xyes ; then <nl> + CPPFLAGS = " $ CPPFLAGS - DDEBUG - DDEBUG_LOCKORDER " <nl> if test " x $ GCC " = xyes ; then <nl> - CFLAGS = " - g3 - O0 - DDEBUG " <nl> + CFLAGS = " $ CFLAGS - g3 - O0 " <nl> fi <nl> <nl> if test " x $ GXX " = xyes ; then <nl> - CXXFLAGS = " - g3 - O0 - DDEBUG " <nl> + CXXFLAGS = " $ CXXFLAGS - g3 - O0 " <nl> fi <nl> fi <nl> <nl>
|
Merge pull request
|
bitcoin/bitcoin
|
059b3525c444ea35f5c017425b75ac2254a3f5f2
|
2015-07-17T06:42:19Z
|
mmm a / cocos / 2d / CCFontAtlas . cpp <nl> ppp b / cocos / 2d / CCFontAtlas . cpp <nl> NS_CC_BEGIN <nl> const int FontAtlas : : CacheTextureWidth = 1024 ; <nl> const int FontAtlas : : CacheTextureHeight = 1024 ; <nl> <nl> - FontAtlas : : FontAtlas ( Font & theFont ) : <nl> - _font ( & theFont ) , <nl> - _currentPageData ( nullptr ) <nl> + FontAtlas : : FontAtlas ( Font & theFont ) <nl> + : _font ( & theFont ) <nl> + , _currentPageData ( nullptr ) <nl> + , _fontAscender ( 0 ) <nl> { <nl> _font - > retain ( ) ; <nl> <nl> FontFreeType * fontTTf = dynamic_cast < FontFreeType * > ( _font ) ; <nl> if ( fontTTf ) <nl> { <nl> - _currentPageLineHeight = _font - > getFontMaxHeight ( ) ; <nl> - _commonLineHeight = _currentPageLineHeight * 0 . 8f ; <nl> + _commonLineHeight = _font - > getFontMaxHeight ( ) ; <nl> + _fontAscender = fontTTf - > getFontAscender ( ) ; <nl> auto texture = new Texture2D ; <nl> _currentPage = 0 ; <nl> _currentPageOrigX = 0 ; <nl> bool FontAtlas : : prepareLetterDefinitions ( unsigned short * utf16String ) <nl> tempDef . width = tempRect . size . width + _letterPadding ; <nl> tempDef . height = tempRect . size . height + _letterPadding ; <nl> tempDef . offsetX = tempRect . origin . x + offsetAdjust ; <nl> - tempDef . offsetY = _commonLineHeight + tempRect . origin . y - offsetAdjust ; <nl> + tempDef . offsetY = _fontAscender + tempRect . origin . y - offsetAdjust ; <nl> <nl> if ( _currentPageOrigX + tempDef . width > CacheTextureWidth ) <nl> { <nl> - _currentPageOrigY + = _currentPageLineHeight ; <nl> + _currentPageOrigY + = _commonLineHeight ; <nl> _currentPageOrigX = 0 ; <nl> - if ( _currentPageOrigY + _currentPageLineHeight > = CacheTextureHeight ) <nl> + if ( _currentPageOrigY + _commonLineHeight > = CacheTextureHeight ) <nl> { <nl> _atlasTextures [ _currentPage ] - > initWithData ( _currentPageData , _currentPageDataSize , pixelFormat , CacheTextureWidth , CacheTextureHeight , contentSize ) ; <nl> _currentPageOrigY = 0 ; <nl> mmm a / cocos / 2d / CCFontAtlas . h <nl> ppp b / cocos / 2d / CCFontAtlas . h <nl> class CC_DLL FontAtlas : public Ref <nl> int _currentPageDataSize ; <nl> float _currentPageOrigX ; <nl> float _currentPageOrigY ; <nl> - float _currentPageLineHeight ; <nl> float _letterPadding ; <nl> bool _makeDistanceMap ; <nl> + <nl> + int _fontAscender ; <nl> } ; <nl> <nl> <nl> mmm a / cocos / 2d / CCFontFreeType . cpp <nl> ppp b / cocos / 2d / CCFontFreeType . cpp <nl> FontAtlas * FontFreeType : : createFontAtlas ( ) <nl> <nl> int * FontFreeType : : getHorizontalKerningForTextUTF16 ( unsigned short * text , int & outNumLetters ) const <nl> { <nl> - if ( ! text ) <nl> - return 0 ; <nl> + if ( ! text | | ! _fontRef ) <nl> + return nullptr ; <nl> <nl> outNumLetters = cc_wcslen ( text ) ; <nl> <nl> if ( ! outNumLetters ) <nl> - return 0 ; <nl> + return nullptr ; <nl> <nl> int * sizes = new int [ outNumLetters ] ; <nl> if ( ! sizes ) <nl> - return 0 ; <nl> - <nl> - for ( int c = 0 ; c < outNumLetters ; + + c ) <nl> + return nullptr ; <nl> + memset ( sizes , 0 , outNumLetters * sizeof ( int ) ) ; <nl> + <nl> + bool hasKerning = FT_HAS_KERNING ( _fontRef ) ! = 0 ; <nl> + if ( hasKerning ) <nl> { <nl> - if ( c < ( outNumLetters - 1 ) ) <nl> - sizes [ c ] = getHorizontalKerningForChars ( text [ c ] , text [ c + 1 ] ) ; <nl> - else <nl> - sizes [ c ] = 0 ; <nl> + for ( int c = 1 ; c < outNumLetters ; + + c ) <nl> + { <nl> + sizes [ c ] = getHorizontalKerningForChars ( text [ c - 1 ] , text [ c ] ) ; <nl> + } <nl> } <nl> <nl> return sizes ; <nl> int * FontFreeType : : getHorizontalKerningForTextUTF16 ( unsigned short * text , int & <nl> <nl> int FontFreeType : : getHorizontalKerningForChars ( unsigned short firstChar , unsigned short secondChar ) const <nl> { <nl> - if ( ! _fontRef ) <nl> - return 0 ; <nl> - <nl> - bool hasKerning = FT_HAS_KERNING ( _fontRef ) ! = 0 ; <nl> - <nl> - if ( ! hasKerning ) <nl> - return 0 ; <nl> - <nl> / / get the ID to the char we need <nl> int glyphIndex1 = FT_Get_Char_Index ( _fontRef , firstChar ) ; <nl> <nl> int FontFreeType : : getFontMaxHeight ( ) const <nl> return ( static_cast < int > ( _fontRef - > size - > metrics . height > > 6 ) ) ; <nl> } <nl> <nl> + int FontFreeType : : getFontAscender ( ) const <nl> + { <nl> + return ( static_cast < int > ( _fontRef - > size - > metrics . ascender > > 6 ) ) ; <nl> + } <nl> + <nl> unsigned char * FontFreeType : : getGlyphBitmap ( unsigned short theChar , int & outWidth , int & outHeight , Rect & outRect , int & xAdvance ) <nl> { <nl> bool invalidChar = true ; <nl> mmm a / cocos / 2d / CCFontFreeType . h <nl> ppp b / cocos / 2d / CCFontFreeType . h <nl> class CC_DLL FontFreeType : public Font <nl> unsigned char * getGlyphBitmap ( unsigned short theChar , int & outWidth , int & outHeight , Rect & outRect , int & xAdvance ) ; <nl> <nl> virtual int getFontMaxHeight ( ) const override ; <nl> + virtual int getFontAscender ( ) const ; <nl> <nl> protected : <nl> <nl>
|
Merge pull request from Dhilan007 / develop_label
|
cocos2d/cocos2d-x
|
e0e9e1723cbc419c1f472ce8c603889ffa581d9e
|
2014-03-07T06:09:39Z
|
mmm a / src / library . js <nl> ppp b / src / library . js <nl> LibraryManager . library = { <nl> llvm_floor_f64 : ' Math_floor ' , <nl> <nl> llvm_copysign_f32 : function ( x , y ) { <nl> - return y < 0 ? - Math_abs ( x ) : Math_abs ( x ) ; <nl> + return y < 0 | | ( y = = = 0 & & 1 / y < 0 ) ? - Math_abs ( x ) : Math_abs ( x ) ; <nl> } , <nl> <nl> llvm_copysign_f64 : function ( x , y ) { <nl> - return y < 0 ? - Math_abs ( x ) : Math_abs ( x ) ; <nl> + return y < 0 | | ( y = = = 0 & & 1 / y < 0 ) ? - Math_abs ( x ) : Math_abs ( x ) ; <nl> } , <nl> <nl> round__asm : true , <nl>
|
handle negative zero in copysign
|
emscripten-core/emscripten
|
989e8ddcc0600f53a1cb2bae8ec4dc34647771ed
|
2016-08-05T21:09:16Z
|
mmm a / buildroot / share / tests / megaatmega2560 - tests <nl> ppp b / buildroot / share / tests / megaatmega2560 - tests <nl> opt_enable AUTO_BED_LEVELING_UBL RESTORE_LEVELING_AFTER_G28 DEBUG_LEVELING_FEATU <nl> MULTI_NOZZLE_DUPLICATION CLASSIC_JERK LIN_ADVANCE QUICK_HOME \ <nl> LCD_SET_PROGRESS_MANUALLY PRINT_PROGRESS_SHOW_DECIMALS SHOW_REMAINING_TIME \ <nl> BABYSTEPPING BABYSTEP_XY NANODLP_Z_SYNC I2C_POSITION_ENCODERS M114_DETAIL <nl> - exec_test $ 1 $ 2 " Azteeg X3 Pro | EXTRUDERS 5 | RRDFGSC | UBL Manual | LIN_ADVANCE . . . " <nl> + exec_test $ 1 $ 2 " Azteeg X3 Pro | EXTRUDERS 5 | RRDFGSC | UBL | LIN_ADVANCE . . . " <nl> <nl> # <nl> # Add a Sled Z Probe , use UBL Cartesian moves , use Japanese language <nl> opt_enable AUTO_BED_LEVELING_UBL RESTORE_LEVELING_AFTER_G28 DEBUG_LEVELING_FEATU <nl> opt_set LCD_LANGUAGE jp_kana <nl> opt_disable SEGMENT_LEVELED_MOVES <nl> opt_enable BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET DOUBLECLICK_FOR_Z_BABYSTEPPING BABYSTEP_HOTEND_Z_OFFSET BABYSTEP_DISPLAY_TOTAL M114_DETAIL <nl> - exec_test $ 1 $ 2 " Azteeg X3 Pro | EXTRUDERS 5 | RRDFGSC | UBL Manual | LIN_ADVANCE | Sled Probe | Skew | UBL Cartes . | JP - Kana | Babystep offsets . . . " <nl> + exec_test $ 1 $ 2 " Azteeg X3 Pro | EXTRUDERS 5 | RRDFGSC | UBL | LIN_ADVANCE | Sled Probe | Skew | JP - Kana | Babystep offsets . . . " <nl> <nl> # <nl> # Test a Servo Probe <nl>
|
Tweak test labels
|
MarlinFirmware/Marlin
|
bdd0517a5b06b313494eedbc205220e272b35632
|
2019-12-02T03:12:38Z
|
new file mode 100644 <nl> index 000000000000 . . cd28a478e69a <nl> mmm / dev / null <nl> ppp b / validation - test / IDE / crashers / 066 - swift - conformancelookuptable - expandimpliedconformances . swift <nl> <nl> + / / RUN : not - - crash % target - swift - ide - test - code - completion - code - completion - token = A - source - filename = % s <nl> + / / REQUIRES : asserts <nl> + class # ^ A ^ # { <nl> + protocol e : A <nl> + protocol A : A <nl> + protocol c : e <nl> \ No newline at end of file <nl>
|
Merge pull request from practicalswift / sourcekit - 066 - swift - conformancelookuptable - expandimpliedconformances
|
apple/swift
|
8227033f5f48cb46e36e1fef0badfde844925652
|
2016-01-01T21:24:43Z
|
mmm a / ccutil / boxread . cpp <nl> ppp b / ccutil / boxread . cpp <nl> bool read_next_box ( int target_page , FILE * box_file , char * utf8_str , <nl> UNICHAR ch ( uch + used , uch_len - used ) ; <nl> int new_used = ch . utf8_len ( ) ; <nl> if ( new_used = = 0 ) { <nl> - tprintf ( " Bad utf - 8 char starting with 0x % x at line % d , col % d , \ n " , <nl> - uch [ used ] , used + 1 , line ) ; <nl> + tprintf ( " Bad UTF - 8 str % s starts with 0x % 02x at line % d , col % d , \ n " , <nl> + uch + used , uch [ used ] , line , used + 1 ) ; <nl> count = 0 ; <nl> break ; <nl> } <nl>
|
Fixed Issue 254
|
tesseract-ocr/tesseract
|
04aeb741afcf3ed2eb0cb512e3392b3d88e88814
|
2010-05-17T21:10:20Z
|
mmm a / COPYRIGHT . txt <nl> ppp b / COPYRIGHT . txt <nl> License : Expat and Zlib <nl> <nl> Files : . / thirdparty / assimp / <nl> Comment : Open Asset Import Library ( assimp ) <nl> - Copyright : 2006 - 2020 , assimp team <nl> + Copyright : 2006 - 2016 , assimp team <nl> License : BSD - 3 - clause <nl> <nl> Files : . / thirdparty / basis_universal / <nl> mmm a / thirdparty / README . md <nl> ppp b / thirdparty / README . md <nl> Subcategories ( ` # # # ` level ) where needed are separated by a single empty line . <nl> # # assimp <nl> <nl> - Upstream : http : / / github . com / assimp / assimp <nl> - - Version : git ( 0201fc57dca48910ca7f9fdf7457534ea6a57efc , 2020 ) <nl> + - Version : git ( 308db73d0b3c2d1870cd3e465eaa283692a4cf23 , 2019 ) <nl> - License : BSD - 3 - Clause <nl> <nl> Files extracted from upstream source : <nl> mmm a / thirdparty / assimp / LICENSE <nl> ppp b / thirdparty / assimp / LICENSE <nl> <nl> Open Asset Import Library ( assimp ) <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2016 , assimp team <nl> All rights reserved . <nl> <nl> Redistribution and use of this software in source and binary forms , <nl> mmm a / thirdparty / assimp / code / CApi / AssimpCExport . cpp <nl> ppp b / thirdparty / assimp / code / CApi / AssimpCExport . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / code / CApi / CInterfaceIOWrapper . cpp <nl> ppp b / thirdparty / assimp / code / CApi / CInterfaceIOWrapper . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / code / CApi / CInterfaceIOWrapper . h <nl> ppp b / thirdparty / assimp / code / CApi / CInterfaceIOWrapper . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / code / Common / Assimp . cpp <nl> ppp b / thirdparty / assimp / code / Common / Assimp . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / code / Common / BaseImporter . cpp <nl> ppp b / thirdparty / assimp / code / Common / BaseImporter . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> void BaseImporter : : GetExtensionList ( std : : set < std : : string > & extensions ) { <nl> } <nl> <nl> std : : unique_ptr < IOStream > pStream ( pIOHandler - > Open ( pFile ) ) ; <nl> - if ( pStream ) { <nl> + if ( pStream . get ( ) ) { <nl> / / read 200 characters from the file <nl> std : : unique_ptr < char [ ] > _buffer ( new char [ searchBytes + 1 / * for the ' \ 0 ' * / ] ) ; <nl> char * buffer ( _buffer . get ( ) ) ; <nl> std : : string BaseImporter : : GetExtension ( const std : : string & file ) { <nl> return " " ; <nl> } <nl> <nl> + <nl> / / thanks to Andy Maloney for the hint <nl> std : : string ret = file . substr ( pos + 1 ) ; <nl> std : : transform ( ret . begin ( ) , ret . end ( ) , ret . begin ( ) , ToLower < char > ) ; <nl> std : : string BaseImporter : : GetExtension ( const std : : string & file ) { <nl> } ; <nl> magic = reinterpret_cast < const char * > ( _magic ) ; <nl> std : : unique_ptr < IOStream > pStream ( pIOHandler - > Open ( pFile ) ) ; <nl> - if ( pStream ) { <nl> + if ( pStream . get ( ) ) { <nl> <nl> / / skip to offset <nl> pStream - > Seek ( offset , aiOrigin_SET ) ; <nl> unsigned int BatchLoader : : AddLoadRequest ( const std : : string & file , <nl> } <nl> <nl> / / no , we don ' t have it . So add it to the queue . . . <nl> - m_data - > requests . emplace_back ( file , steps , map , m_data - > next_id ) ; <nl> + m_data - > requests . push_back ( LoadRequest ( file , steps , map , m_data - > next_id ) ) ; <nl> return m_data - > next_id + + ; <nl> } <nl> <nl> mmm a / thirdparty / assimp / code / Common / BaseProcess . cpp <nl> ppp b / thirdparty / assimp / code / Common / BaseProcess . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / code / Common / BaseProcess . h <nl> ppp b / thirdparty / assimp / code / Common / BaseProcess . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / Common / Bitmap . cpp <nl> ppp b / thirdparty / assimp / code / Common / Bitmap . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / code / Common / CreateAnimMesh . cpp <nl> ppp b / thirdparty / assimp / code / Common / CreateAnimMesh . cpp <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> Copyright ( C ) 2016 The Qt Company Ltd . <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2012 , assimp team <nl> <nl> All rights reserved . <nl> <nl> mmm a / thirdparty / assimp / code / Common / DefaultIOStream . cpp <nl> ppp b / thirdparty / assimp / code / Common / DefaultIOStream . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> <nl> using namespace Assimp ; <nl> <nl> - namespace <nl> - { <nl> - template < size_t sizeOfPointer > <nl> - size_t select_ftell ( FILE * file ) <nl> - { <nl> - return : : ftell ( file ) ; <nl> - } <nl> - <nl> - template < size_t sizeOfPointer > <nl> - int select_fseek ( FILE * file , int64_t offset , int origin ) <nl> - { <nl> - return : : fseek ( file , static_cast < long > ( offset ) , origin ) ; <nl> - } <nl> - <nl> - # if defined _WIN32 & & ( ! defined __GNUC__ | | __MSVCRT_VERSION__ > = 0x0601 ) <nl> - template < > <nl> - size_t select_ftell < 8 > ( FILE * file ) <nl> - { <nl> - return : : _ftelli64 ( file ) ; <nl> - } <nl> - <nl> - template < > <nl> - int select_fseek < 8 > ( FILE * file , int64_t offset , int origin ) <nl> - { <nl> - return : : _fseeki64 ( file , offset , origin ) ; <nl> - } <nl> - # endif <nl> - } <nl> - <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> DefaultIOStream : : ~ DefaultIOStream ( ) <nl> { <nl> aiReturn DefaultIOStream : : Seek ( size_t pOffset , <nl> aiOrigin_END = = SEEK_END & & aiOrigin_SET = = SEEK_SET " ) ; <nl> <nl> / / do the seek <nl> - return ( 0 = = select_fseek < sizeof ( void * ) > ( mFile , ( int64_t ) pOffset , ( int ) pOrigin ) ? AI_SUCCESS : AI_FAILURE ) ; <nl> + return ( 0 = = : : fseek ( mFile , ( long ) pOffset , ( int ) pOrigin ) ? AI_SUCCESS : AI_FAILURE ) ; <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> size_t DefaultIOStream : : Tell ( ) const <nl> if ( ! mFile ) { <nl> return 0 ; <nl> } <nl> - return select_ftell < sizeof ( void * ) > ( mFile ) ; <nl> + return : : ftell ( mFile ) ; <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> mmm a / thirdparty / assimp / code / Common / DefaultIOSystem . cpp <nl> ppp b / thirdparty / assimp / code / Common / DefaultIOSystem . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / code / Common / DefaultLogger . cpp <nl> ppp b / thirdparty / assimp / code / Common / DefaultLogger . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> LogStream * LogStream : : createDefaultStream ( aiDefaultLogStream streams , <nl> return nullptr ; <nl> # endif <nl> <nl> - / / Platform - independent default streams <nl> + / / Platform - independent default streams <nl> case aiDefaultLogStream_STDERR : <nl> return new StdOStreamLogStream ( std : : cerr ) ; <nl> case aiDefaultLogStream_STDOUT : <nl> LogStream * LogStream : : createDefaultStream ( aiDefaultLogStream streams , <nl> } ; <nl> <nl> / / For compilers without dead code path detection <nl> - return nullptr ; <nl> + return NULL ; <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> mmm a / thirdparty / assimp / code / Common / DefaultProgressHandler . h <nl> ppp b / thirdparty / assimp / code / Common / DefaultProgressHandler . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / Common / Exporter . cpp <nl> ppp b / thirdparty / assimp / code / Common / Exporter . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> void ExportSceneFBX ( const char * , IOSystem * , const aiScene * , const ExportProperti <nl> void ExportSceneFBXA ( const char * , IOSystem * , const aiScene * , const ExportProperties * ) ; <nl> void ExportScene3MF ( const char * , IOSystem * , const aiScene * , const ExportProperties * ) ; <nl> void ExportSceneM3D ( const char * , IOSystem * , const aiScene * , const ExportProperties * ) ; <nl> - void ExportSceneM3DA ( const char * , IOSystem * , const aiScene * , const ExportProperties * ) ; <nl> + void ExportSceneA3D ( const char * , IOSystem * , const aiScene * , const ExportProperties * ) ; <nl> void ExportAssimp2Json ( const char * , IOSystem * , const aiScene * , const Assimp : : ExportProperties * ) ; <nl> <nl> - <nl> - static void setupExporterArray ( std : : vector < Exporter : : ExportFormatEntry > & exporters ) { <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> + / / global array of all export formats which Assimp supports in its current build <nl> + Exporter : : ExportFormatEntry gExporters [ ] = <nl> + { <nl> # ifndef ASSIMP_BUILD_NO_COLLADA_EXPORTER <nl> - exporters . push_back ( Exporter : : ExportFormatEntry ( " collada " , " COLLADA - Digital Asset Exchange Schema " , " dae " , & ExportSceneCollada ) ) ; <nl> + Exporter : : ExportFormatEntry ( " collada " , " COLLADA - Digital Asset Exchange Schema " , " dae " , & ExportSceneCollada ) , <nl> # endif <nl> <nl> # ifndef ASSIMP_BUILD_NO_X_EXPORTER <nl> - exporters . push_back ( Exporter : : ExportFormatEntry ( " x " , " X Files " , " x " , & ExportSceneXFile , <nl> - aiProcess_MakeLeftHanded | aiProcess_FlipWindingOrder | aiProcess_FlipUVs ) ) ; <nl> + Exporter : : ExportFormatEntry ( " x " , " X Files " , " x " , & ExportSceneXFile , <nl> + aiProcess_MakeLeftHanded | aiProcess_FlipWindingOrder | aiProcess_FlipUVs ) , <nl> # endif <nl> <nl> # ifndef ASSIMP_BUILD_NO_STEP_EXPORTER <nl> - exporters . push_back ( Exporter : : ExportFormatEntry ( " stp " , " Step Files " , " stp " , & ExportSceneStep , 0 ) ) ; <nl> + Exporter : : ExportFormatEntry ( " stp " , " Step Files " , " stp " , & ExportSceneStep , 0 ) , <nl> # endif <nl> <nl> # ifndef ASSIMP_BUILD_NO_OBJ_EXPORTER <nl> - exporters . push_back ( Exporter : : ExportFormatEntry ( " obj " , " Wavefront OBJ format " , " obj " , & ExportSceneObj , <nl> - aiProcess_GenSmoothNormals / * | aiProcess_PreTransformVertices * / ) ) ; <nl> - exporters . push_back ( Exporter : : ExportFormatEntry ( " objnomtl " , " Wavefront OBJ format without material file " , " obj " , & ExportSceneObjNoMtl , <nl> - aiProcess_GenSmoothNormals / * | aiProcess_PreTransformVertices * / ) ) ; <nl> + Exporter : : ExportFormatEntry ( " obj " , " Wavefront OBJ format " , " obj " , & ExportSceneObj , <nl> + aiProcess_GenSmoothNormals / * | aiProcess_PreTransformVertices * / ) , <nl> + Exporter : : ExportFormatEntry ( " objnomtl " , " Wavefront OBJ format without material file " , " obj " , & ExportSceneObjNoMtl , <nl> + aiProcess_GenSmoothNormals / * | aiProcess_PreTransformVertices * / ) , <nl> # endif <nl> <nl> # ifndef ASSIMP_BUILD_NO_STL_EXPORTER <nl> - exporters . push_back ( Exporter : : ExportFormatEntry ( " stl " , " Stereolithography " , " stl " , & ExportSceneSTL , <nl> - aiProcess_Triangulate | aiProcess_GenNormals | aiProcess_PreTransformVertices ) ) ; <nl> - exporters . push_back ( Exporter : : ExportFormatEntry ( " stlb " , " Stereolithography ( binary ) " , " stl " , & ExportSceneSTLBinary , <nl> - aiProcess_Triangulate | aiProcess_GenNormals | aiProcess_PreTransformVertices ) ) ; <nl> + Exporter : : ExportFormatEntry ( " stl " , " Stereolithography " , " stl " , & ExportSceneSTL , <nl> + aiProcess_Triangulate | aiProcess_GenNormals | aiProcess_PreTransformVertices <nl> + ) , <nl> + Exporter : : ExportFormatEntry ( " stlb " , " Stereolithography ( binary ) " , " stl " , & ExportSceneSTLBinary , <nl> + aiProcess_Triangulate | aiProcess_GenNormals | aiProcess_PreTransformVertices <nl> + ) , <nl> # endif <nl> <nl> # ifndef ASSIMP_BUILD_NO_PLY_EXPORTER <nl> - exporters . push_back ( Exporter : : ExportFormatEntry ( " ply " , " Stanford Polygon Library " , " ply " , & ExportScenePly , <nl> - aiProcess_PreTransformVertices ) ) ; <nl> - exporters . push_back ( Exporter : : ExportFormatEntry ( " plyb " , " Stanford Polygon Library ( binary ) " , " ply " , & ExportScenePlyBinary , <nl> - aiProcess_PreTransformVertices ) ) ; <nl> + Exporter : : ExportFormatEntry ( " ply " , " Stanford Polygon Library " , " ply " , & ExportScenePly , <nl> + aiProcess_PreTransformVertices <nl> + ) , <nl> + Exporter : : ExportFormatEntry ( " plyb " , " Stanford Polygon Library ( binary ) " , " ply " , & ExportScenePlyBinary , <nl> + aiProcess_PreTransformVertices <nl> + ) , <nl> # endif <nl> <nl> # ifndef ASSIMP_BUILD_NO_3DS_EXPORTER <nl> - exporters . push_back ( Exporter : : ExportFormatEntry ( " 3ds " , " Autodesk 3DS ( legacy ) " , " 3ds " , & ExportScene3DS , <nl> - aiProcess_Triangulate | aiProcess_SortByPType | aiProcess_JoinIdenticalVertices ) ) ; <nl> + Exporter : : ExportFormatEntry ( " 3ds " , " Autodesk 3DS ( legacy ) " , " 3ds " , & ExportScene3DS , <nl> + aiProcess_Triangulate | aiProcess_SortByPType | aiProcess_JoinIdenticalVertices ) , <nl> # endif <nl> <nl> # ifndef ASSIMP_BUILD_NO_GLTF_EXPORTER <nl> - exporters . push_back ( Exporter : : ExportFormatEntry ( " gltf2 " , " GL Transmission Format v . 2 " , " gltf " , & ExportSceneGLTF2 , <nl> - aiProcess_JoinIdenticalVertices | aiProcess_Triangulate | aiProcess_SortByPType ) ) ; <nl> - exporters . push_back ( Exporter : : ExportFormatEntry ( " glb2 " , " GL Transmission Format v . 2 ( binary ) " , " glb " , & ExportSceneGLB2 , <nl> - aiProcess_JoinIdenticalVertices | aiProcess_Triangulate | aiProcess_SortByPType ) ) ; <nl> - exporters . push_back ( Exporter : : ExportFormatEntry ( " gltf " , " GL Transmission Format " , " gltf " , & ExportSceneGLTF , <nl> - aiProcess_JoinIdenticalVertices | aiProcess_Triangulate | aiProcess_SortByPType ) ) ; <nl> - exporters . push_back ( Exporter : : ExportFormatEntry ( " glb " , " GL Transmission Format ( binary ) " , " glb " , & ExportSceneGLB , <nl> - aiProcess_JoinIdenticalVertices | aiProcess_Triangulate | aiProcess_SortByPType ) ) ; <nl> + Exporter : : ExportFormatEntry ( " gltf2 " , " GL Transmission Format v . 2 " , " gltf " , & ExportSceneGLTF2 , <nl> + aiProcess_JoinIdenticalVertices | aiProcess_Triangulate | aiProcess_SortByPType ) , <nl> + Exporter : : ExportFormatEntry ( " glb2 " , " GL Transmission Format v . 2 ( binary ) " , " glb " , & ExportSceneGLB2 , <nl> + aiProcess_JoinIdenticalVertices | aiProcess_Triangulate | aiProcess_SortByPType ) , <nl> + Exporter : : ExportFormatEntry ( " gltf " , " GL Transmission Format " , " gltf " , & ExportSceneGLTF , <nl> + aiProcess_JoinIdenticalVertices | aiProcess_Triangulate | aiProcess_SortByPType ) , <nl> + Exporter : : ExportFormatEntry ( " glb " , " GL Transmission Format ( binary ) " , " glb " , & ExportSceneGLB , <nl> + aiProcess_JoinIdenticalVertices | aiProcess_Triangulate | aiProcess_SortByPType ) , <nl> # endif <nl> <nl> # ifndef ASSIMP_BUILD_NO_ASSBIN_EXPORTER <nl> - exporters . push_back ( Exporter : : ExportFormatEntry ( " assbin " , " Assimp Binary File " , " assbin " , & ExportSceneAssbin , 0 ) ) ; <nl> + Exporter : : ExportFormatEntry ( " assbin " , " Assimp Binary File " , " assbin " , & ExportSceneAssbin , 0 ) , <nl> # endif <nl> <nl> # ifndef ASSIMP_BUILD_NO_ASSXML_EXPORTER <nl> - exporters . push_back ( Exporter : : ExportFormatEntry ( " assxml " , " Assimp XML Document " , " assxml " , & ExportSceneAssxml , 0 ) ) ; <nl> + Exporter : : ExportFormatEntry ( " assxml " , " Assimp XML Document " , " assxml " , & ExportSceneAssxml , 0 ) , <nl> # endif <nl> <nl> # ifndef ASSIMP_BUILD_NO_X3D_EXPORTER <nl> - exporters . push_back ( Exporter : : ExportFormatEntry ( " x3d " , " Extensible 3D " , " x3d " , & ExportSceneX3D , 0 ) ) ; <nl> + Exporter : : ExportFormatEntry ( " x3d " , " Extensible 3D " , " x3d " , & ExportSceneX3D , 0 ) , <nl> # endif <nl> <nl> # ifndef ASSIMP_BUILD_NO_FBX_EXPORTER <nl> - exporters . push_back ( Exporter : : ExportFormatEntry ( " fbx " , " Autodesk FBX ( binary ) " , " fbx " , & ExportSceneFBX , 0 ) ) ; <nl> - exporters . push_back ( Exporter : : ExportFormatEntry ( " fbxa " , " Autodesk FBX ( ascii ) " , " fbx " , & ExportSceneFBXA , 0 ) ) ; <nl> + Exporter : : ExportFormatEntry ( " fbx " , " Autodesk FBX ( binary ) " , " fbx " , & ExportSceneFBX , 0 ) , <nl> + Exporter : : ExportFormatEntry ( " fbxa " , " Autodesk FBX ( ascii ) " , " fbx " , & ExportSceneFBXA , 0 ) , <nl> # endif <nl> <nl> # ifndef ASSIMP_BUILD_NO_M3D_EXPORTER <nl> - exporters . push_back ( Exporter : : ExportFormatEntry ( " m3d " , " Model 3D ( binary ) " , " m3d " , & ExportSceneM3D , 0 ) ) ; <nl> - exporters . push_back ( Exporter : : ExportFormatEntry ( " m3da " , " Model 3D ( ascii ) " , " a3d " , & ExportSceneM3DA , 0 ) ) ; <nl> + Exporter : : ExportFormatEntry ( " m3d " , " Model 3D ( binary ) " , " m3d " , & ExportSceneM3D , 0 ) , <nl> + Exporter : : ExportFormatEntry ( " a3d " , " Model 3D ( ascii ) " , " m3d " , & ExportSceneA3D , 0 ) , <nl> # endif <nl> <nl> # ifndef ASSIMP_BUILD_NO_3MF_EXPORTER <nl> - exporters . push_back ( Exporter : : ExportFormatEntry ( " 3mf " , " The 3MF - File - Format " , " 3mf " , & ExportScene3MF , 0 ) ) ; <nl> + Exporter : : ExportFormatEntry ( " 3mf " , " The 3MF - File - Format " , " 3mf " , & ExportScene3MF , 0 ) , <nl> # endif <nl> <nl> # ifndef ASSIMP_BUILD_NO_ASSJSON_EXPORTER <nl> - exporters . push_back ( Exporter : : ExportFormatEntry ( " assjson " , " Assimp JSON Document " , " json " , & ExportAssimp2Json , 0 ) ) ; <nl> + Exporter : : ExportFormatEntry ( " assjson " , " Assimp JSON Document " , " json " , & ExportAssimp2Json , 0 ) <nl> # endif <nl> - } <nl> + } ; <nl> + <nl> + # define ASSIMP_NUM_EXPORTERS ( sizeof ( gExporters ) / sizeof ( gExporters [ 0 ] ) ) <nl> + <nl> <nl> class ExporterPimpl { <nl> public : <nl> class ExporterPimpl { <nl> GetPostProcessingStepInstanceList ( mPostProcessingSteps ) ; <nl> <nl> / / grab all built - in exporters <nl> - setupExporterArray ( mExporters ) ; <nl> + if ( 0 ! = ( ASSIMP_NUM_EXPORTERS ) ) { <nl> + mExporters . resize ( ASSIMP_NUM_EXPORTERS ) ; <nl> + std : : copy ( gExporters , gExporters + ASSIMP_NUM_EXPORTERS , mExporters . begin ( ) ) ; <nl> + } <nl> } <nl> <nl> ~ ExporterPimpl ( ) { <nl> Exporter : : Exporter ( ) <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> Exporter : : ~ Exporter ( ) { <nl> - ai_assert ( nullptr ! = pimpl ) ; <nl> - FreeBlob ( ) ; <nl> + FreeBlob ( ) ; <nl> delete pimpl ; <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> void Exporter : : SetIOHandler ( IOSystem * pIOHandler ) { <nl> - ai_assert ( nullptr ! = pimpl ) ; <nl> - pimpl - > mIsDefaultIOHandler = ! pIOHandler ; <nl> + pimpl - > mIsDefaultIOHandler = ! pIOHandler ; <nl> pimpl - > mIOSystem . reset ( pIOHandler ) ; <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> IOSystem * Exporter : : GetIOHandler ( ) const { <nl> - ai_assert ( nullptr ! = pimpl ) ; <nl> - return pimpl - > mIOSystem . get ( ) ; <nl> + return pimpl - > mIOSystem . get ( ) ; <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> bool Exporter : : IsDefaultIOHandler ( ) const { <nl> - ai_assert ( nullptr ! = pimpl ) ; <nl> - return pimpl - > mIsDefaultIOHandler ; <nl> + return pimpl - > mIsDefaultIOHandler ; <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> void Exporter : : SetProgressHandler ( ProgressHandler * pHandler ) { <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> const aiExportDataBlob * Exporter : : ExportToBlob ( const aiScene * pScene , const char * pFormatId , <nl> unsigned int pPreprocessing , const ExportProperties * pProperties ) { <nl> - ai_assert ( nullptr ! = pimpl ) ; <nl> if ( pimpl - > blob ) { <nl> delete pimpl - > blob ; <nl> pimpl - > blob = nullptr ; <nl> const aiExportDataBlob * Exporter : : ExportToBlob ( const aiScene * pScene , const cha <nl> aiReturn Exporter : : Export ( const aiScene * pScene , const char * pFormatId , const char * pPath , <nl> unsigned int pPreprocessing , const ExportProperties * pProperties ) { <nl> ASSIMP_BEGIN_EXCEPTION_REGION ( ) ; <nl> - ai_assert ( nullptr ! = pimpl ) ; <nl> + <nl> / / when they create scenes from scratch , users will likely create them not in verbose <nl> / / format . They will likely not be aware that there is a flag in the scene to indicate <nl> / / this , however . To avoid surprises and bug reports , we check for duplicates in <nl> aiReturn Exporter : : Export ( const aiScene * pScene , const char * pFormatId , const c <nl> <nl> ExportProperties emptyProperties ; / / Never pass NULL ExportProperties so Exporters don ' t have to worry . <nl> ExportProperties * pProp = pProperties ? ( ExportProperties * ) pProperties : & emptyProperties ; <nl> - pProp - > SetPropertyBool ( " bJoinIdenticalVertices " , pp & aiProcess_JoinIdenticalVertices ) ; <nl> + pProp - > SetPropertyBool ( " bJoinIdenticalVertices " , must_join_again ) ; <nl> + exp . mExportFunction ( pPath , pimpl - > mIOSystem . get ( ) , scenecopy . get ( ) , pProp ) ; <nl> exp . mExportFunction ( pPath , pimpl - > mIOSystem . get ( ) , scenecopy . get ( ) , pProp ) ; <nl> <nl> pimpl - > mProgressHandler - > UpdateFileWrite ( 4 , 4 ) ; <nl> aiReturn Exporter : : Export ( const aiScene * pScene , const char * pFormatId , const c <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> const char * Exporter : : GetErrorString ( ) const { <nl> - ai_assert ( nullptr ! = pimpl ) ; <nl> return pimpl - > mError . c_str ( ) ; <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> void Exporter : : FreeBlob ( ) { <nl> - ai_assert ( nullptr ! = pimpl ) ; <nl> delete pimpl - > blob ; <nl> pimpl - > blob = nullptr ; <nl> <nl> void Exporter : : FreeBlob ( ) { <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> const aiExportDataBlob * Exporter : : GetBlob ( ) const { <nl> - ai_assert ( nullptr ! = pimpl ) ; <nl> - return pimpl - > blob ; <nl> + return pimpl - > blob ; <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> const aiExportDataBlob * Exporter : : GetOrphanedBlob ( ) const { <nl> - ai_assert ( nullptr ! = pimpl ) ; <nl> - const aiExportDataBlob * tmp = pimpl - > blob ; <nl> + const aiExportDataBlob * tmp = pimpl - > blob ; <nl> pimpl - > blob = nullptr ; <nl> return tmp ; <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> size_t Exporter : : GetExportFormatCount ( ) const { <nl> - ai_assert ( nullptr ! = pimpl ) ; <nl> return pimpl - > mExporters . size ( ) ; <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> const aiExportFormatDesc * Exporter : : GetExportFormatDescription ( size_t index ) const { <nl> - ai_assert ( nullptr ! = pimpl ) ; <nl> - if ( index > = GetExportFormatCount ( ) ) { <nl> + if ( index > = GetExportFormatCount ( ) ) { <nl> return nullptr ; <nl> } <nl> <nl> / / Return from static storage if the requested index is built - in . <nl> - if ( index < pimpl - > mExporters . size ( ) ) { <nl> - return & pimpl - > mExporters [ index ] . mDescription ; <nl> + if ( index < sizeof ( gExporters ) / sizeof ( gExporters [ 0 ] ) ) { <nl> + return & gExporters [ index ] . mDescription ; <nl> } <nl> <nl> return & pimpl - > mExporters [ index ] . mDescription ; <nl> const aiExportFormatDesc * Exporter : : GetExportFormatDescription ( size_t index ) c <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> aiReturn Exporter : : RegisterExporter ( const ExportFormatEntry & desc ) { <nl> - ai_assert ( nullptr ! = pimpl ) ; <nl> - for ( const ExportFormatEntry & e : pimpl - > mExporters ) { <nl> + for ( const ExportFormatEntry & e : pimpl - > mExporters ) { <nl> if ( ! strcmp ( e . mDescription . id , desc . mDescription . id ) ) { <nl> return aiReturn_FAILURE ; <nl> } <nl> aiReturn Exporter : : RegisterExporter ( const ExportFormatEntry & desc ) { <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> void Exporter : : UnregisterExporter ( const char * id ) { <nl> - ai_assert ( nullptr ! = pimpl ) ; <nl> - for ( std : : vector < ExportFormatEntry > : : iterator it = pimpl - > mExporters . begin ( ) ; <nl> + for ( std : : vector < ExportFormatEntry > : : iterator it = pimpl - > mExporters . begin ( ) ; <nl> it ! = pimpl - > mExporters . end ( ) ; + + it ) { <nl> if ( ! strcmp ( ( * it ) . mDescription . id , id ) ) { <nl> pimpl - > mExporters . erase ( it ) ; <nl> mmm a / thirdparty / assimp / code / Common / FileLogStream . h <nl> ppp b / thirdparty / assimp / code / Common / FileLogStream . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> All rights reserved . <nl> <nl> mmm a / thirdparty / assimp / code / Common / FileSystemFilter . h <nl> ppp b / thirdparty / assimp / code / Common / FileSystemFilter . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2008 , assimp team <nl> All rights reserved . <nl> <nl> Redistribution and use of this software in source and binary forms , <nl> mmm a / thirdparty / assimp / code / Common / Importer . cpp <nl> ppp b / thirdparty / assimp / code / Common / Importer . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> + <nl> + <nl> <nl> All rights reserved . <nl> <nl> OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> # include < assimp / TinyFormatter . h > <nl> # include < assimp / Exceptional . h > <nl> # include < assimp / Profiler . h > <nl> - # include < assimp / commonMetaData . h > <nl> - <nl> # include < set > <nl> # include < memory > <nl> # include < cctype > <nl> void * AllocateFromAssimpHeap : : operator new ( size_t num_bytes , const std : : nothro <nl> return AllocateFromAssimpHeap : : operator new ( num_bytes ) ; <nl> } <nl> catch ( . . . ) { <nl> - return nullptr ; <nl> + return NULL ; <nl> } <nl> } <nl> <nl> void * AllocateFromAssimpHeap : : operator new [ ] ( size_t num_bytes ) { <nl> void * AllocateFromAssimpHeap : : operator new [ ] ( size_t num_bytes , const std : : nothrow_t & ) throw ( ) { <nl> try { <nl> return AllocateFromAssimpHeap : : operator new [ ] ( num_bytes ) ; <nl> - } catch ( . . . ) { <nl> - return nullptr ; <nl> + } <nl> + catch ( . . . ) { <nl> + return NULL ; <nl> } <nl> } <nl> <nl> void AllocateFromAssimpHeap : : operator delete [ ] ( void * data ) { <nl> / / Importer constructor . <nl> Importer : : Importer ( ) <nl> : pimpl ( new ImporterPimpl ) { <nl> - pimpl - > mScene = nullptr ; <nl> + pimpl - > mScene = NULL ; <nl> pimpl - > mErrorString = " " ; <nl> <nl> / / Allocate a default IO handler <nl> Importer : : Importer ( ) <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Destructor of Importer <nl> - Importer : : ~ Importer ( ) { <nl> + Importer : : ~ Importer ( ) <nl> + { <nl> / / Delete all import plugins <nl> DeleteImporterInstanceList ( pimpl - > mImporter ) ; <nl> <nl> / / Delete all post - processing plug - ins <nl> - for ( unsigned int a = 0 ; a < pimpl - > mPostProcessingSteps . size ( ) ; + + a ) { <nl> + for ( unsigned int a = 0 ; a < pimpl - > mPostProcessingSteps . size ( ) ; a + + ) <nl> delete pimpl - > mPostProcessingSteps [ a ] ; <nl> - } <nl> <nl> / / Delete the assigned IO and progress handler <nl> delete pimpl - > mIOHandler ; <nl> Importer : : ~ Importer ( ) { <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Register a custom post - processing step <nl> - aiReturn Importer : : RegisterPPStep ( BaseProcess * pImp ) { <nl> - ai_assert ( nullptr ! = pImp ) ; <nl> - <nl> + aiReturn Importer : : RegisterPPStep ( BaseProcess * pImp ) <nl> + { <nl> + ai_assert ( NULL ! = pImp ) ; <nl> ASSIMP_BEGIN_EXCEPTION_REGION ( ) ; <nl> <nl> pimpl - > mPostProcessingSteps . push_back ( pImp ) ; <nl> aiReturn Importer : : RegisterPPStep ( BaseProcess * pImp ) { <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Register a custom loader plugin <nl> - aiReturn Importer : : RegisterLoader ( BaseImporter * pImp ) { <nl> - ai_assert ( nullptr ! = pImp ) ; <nl> - <nl> + aiReturn Importer : : RegisterLoader ( BaseImporter * pImp ) <nl> + { <nl> + ai_assert ( NULL ! = pImp ) ; <nl> ASSIMP_BEGIN_EXCEPTION_REGION ( ) ; <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> aiReturn Importer : : RegisterLoader ( BaseImporter * pImp ) { <nl> pimpl - > mImporter . push_back ( pImp ) ; <nl> ASSIMP_LOG_INFO_F ( " Registering custom importer for these file extensions : " , baked ) ; <nl> ASSIMP_END_EXCEPTION_REGION ( aiReturn ) ; <nl> - <nl> return AI_SUCCESS ; <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Unregister a custom loader plugin <nl> - aiReturn Importer : : UnregisterLoader ( BaseImporter * pImp ) { <nl> + aiReturn Importer : : UnregisterLoader ( BaseImporter * pImp ) <nl> + { <nl> if ( ! pImp ) { <nl> / / unregistering a NULL importer is no problem for us . . . really ! <nl> return AI_SUCCESS ; <nl> aiReturn Importer : : UnregisterLoader ( BaseImporter * pImp ) { <nl> } <nl> ASSIMP_LOG_WARN ( " Unable to remove custom importer : I can ' t find you . . . " ) ; <nl> ASSIMP_END_EXCEPTION_REGION ( aiReturn ) ; <nl> - <nl> return AI_FAILURE ; <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Unregister a custom loader plugin <nl> - aiReturn Importer : : UnregisterPPStep ( BaseProcess * pImp ) { <nl> + aiReturn Importer : : UnregisterPPStep ( BaseProcess * pImp ) <nl> + { <nl> if ( ! pImp ) { <nl> / / unregistering a NULL ppstep is no problem for us . . . really ! <nl> return AI_SUCCESS ; <nl> aiReturn Importer : : UnregisterPPStep ( BaseProcess * pImp ) { <nl> } <nl> ASSIMP_LOG_WARN ( " Unable to remove custom post - processing step : I can ' t find you . . " ) ; <nl> ASSIMP_END_EXCEPTION_REGION ( aiReturn ) ; <nl> - <nl> return AI_FAILURE ; <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Supplies a custom IO handler to the importer to open and access files . <nl> - void Importer : : SetIOHandler ( IOSystem * pIOHandler ) { <nl> - ai_assert ( nullptr ! = pimpl ) ; <nl> - <nl> + void Importer : : SetIOHandler ( IOSystem * pIOHandler ) <nl> + { <nl> ASSIMP_BEGIN_EXCEPTION_REGION ( ) ; <nl> / / If the new handler is zero , allocate a default IO implementation . <nl> - if ( ! pIOHandler ) { <nl> + if ( ! pIOHandler ) <nl> + { <nl> / / Release pointer in the possession of the caller <nl> pimpl - > mIOHandler = new DefaultIOSystem ( ) ; <nl> pimpl - > mIsDefaultHandler = true ; <nl> - } else if ( pimpl - > mIOHandler ! = pIOHandler ) { / / Otherwise register the custom handler <nl> + } <nl> + / / Otherwise register the custom handler <nl> + else if ( pimpl - > mIOHandler ! = pIOHandler ) <nl> + { <nl> delete pimpl - > mIOHandler ; <nl> pimpl - > mIOHandler = pIOHandler ; <nl> pimpl - > mIsDefaultHandler = false ; <nl> void Importer : : SetIOHandler ( IOSystem * pIOHandler ) { <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Get the currently set IO handler <nl> IOSystem * Importer : : GetIOHandler ( ) const { <nl> - ai_assert ( nullptr ! = pimpl ) ; <nl> - <nl> return pimpl - > mIOHandler ; <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Check whether a custom IO handler is currently set <nl> bool Importer : : IsDefaultIOHandler ( ) const { <nl> - ai_assert ( nullptr ! = pimpl ) ; <nl> - <nl> return pimpl - > mIsDefaultHandler ; <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Supplies a custom progress handler to get regular callbacks during importing <nl> void Importer : : SetProgressHandler ( ProgressHandler * pHandler ) { <nl> - ai_assert ( nullptr ! = pimpl ) ; <nl> - <nl> ASSIMP_BEGIN_EXCEPTION_REGION ( ) ; <nl> - <nl> / / If the new handler is zero , allocate a default implementation . <nl> - if ( ! pHandler ) { <nl> + if ( ! pHandler ) <nl> + { <nl> / / Release pointer in the possession of the caller <nl> pimpl - > mProgressHandler = new DefaultProgressHandler ( ) ; <nl> pimpl - > mIsDefaultProgressHandler = true ; <nl> - } else if ( pimpl - > mProgressHandler ! = pHandler ) { / / Otherwise register the custom handler <nl> + } <nl> + / / Otherwise register the custom handler <nl> + else if ( pimpl - > mProgressHandler ! = pHandler ) <nl> + { <nl> delete pimpl - > mProgressHandler ; <nl> pimpl - > mProgressHandler = pHandler ; <nl> pimpl - > mIsDefaultProgressHandler = false ; <nl> void Importer : : SetProgressHandler ( ProgressHandler * pHandler ) { <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Get the currently set progress handler <nl> ProgressHandler * Importer : : GetProgressHandler ( ) const { <nl> - ai_assert ( nullptr ! = pimpl ) ; <nl> - <nl> return pimpl - > mProgressHandler ; <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Check whether a custom progress handler is currently set <nl> bool Importer : : IsDefaultProgressHandler ( ) const { <nl> - ai_assert ( nullptr ! = pimpl ) ; <nl> - <nl> return pimpl - > mIsDefaultProgressHandler ; <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Validate post process step flags <nl> - bool _ValidateFlags ( unsigned int pFlags ) { <nl> + bool _ValidateFlags ( unsigned int pFlags ) <nl> + { <nl> if ( pFlags & aiProcess_GenSmoothNormals & & pFlags & aiProcess_GenNormals ) { <nl> ASSIMP_LOG_ERROR ( " # aiProcess_GenSmoothNormals and # aiProcess_GenNormals are incompatible " ) ; <nl> return false ; <nl> bool _ValidateFlags ( unsigned int pFlags ) { <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Free the current scene <nl> - void Importer : : FreeScene ( ) { <nl> - ai_assert ( nullptr ! = pimpl ) ; <nl> - <nl> + void Importer : : FreeScene ( ) <nl> + { <nl> ASSIMP_BEGIN_EXCEPTION_REGION ( ) ; <nl> <nl> delete pimpl - > mScene ; <nl> - pimpl - > mScene = nullptr ; <nl> + pimpl - > mScene = NULL ; <nl> <nl> pimpl - > mErrorString = " " ; <nl> ASSIMP_END_EXCEPTION_REGION ( void ) ; <nl> void Importer : : FreeScene ( ) { <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Get the current error string , if any <nl> - const char * Importer : : GetErrorString ( ) const { <nl> - ai_assert ( nullptr ! = pimpl ) ; <nl> - <nl> - / / Must remain valid as long as ReadFile ( ) or FreeFile ( ) are not called <nl> + const char * Importer : : GetErrorString ( ) const <nl> + { <nl> + / * Must remain valid as long as ReadFile ( ) or FreeFile ( ) are not called * / <nl> return pimpl - > mErrorString . c_str ( ) ; <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Enable extra - verbose mode <nl> - void Importer : : SetExtraVerbose ( bool bDo ) { <nl> - ai_assert ( nullptr ! = pimpl ) ; <nl> - <nl> + void Importer : : SetExtraVerbose ( bool bDo ) <nl> + { <nl> pimpl - > bExtraVerbose = bDo ; <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Get the current scene <nl> - const aiScene * Importer : : GetScene ( ) const { <nl> - ai_assert ( nullptr ! = pimpl ) ; <nl> - <nl> + const aiScene * Importer : : GetScene ( ) const <nl> + { <nl> return pimpl - > mScene ; <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Orphan the current scene and return it . <nl> - aiScene * Importer : : GetOrphanedScene ( ) { <nl> - ai_assert ( nullptr ! = pimpl ) ; <nl> - <nl> + aiScene * Importer : : GetOrphanedScene ( ) <nl> + { <nl> aiScene * s = pimpl - > mScene ; <nl> <nl> ASSIMP_BEGIN_EXCEPTION_REGION ( ) ; <nl> - pimpl - > mScene = nullptr ; <nl> + pimpl - > mScene = NULL ; <nl> <nl> - pimpl - > mErrorString = " " ; / / reset error string <nl> + pimpl - > mErrorString = " " ; / * reset error string * / <nl> ASSIMP_END_EXCEPTION_REGION ( aiScene * ) ; <nl> - <nl> return s ; <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Validate post - processing flags <nl> - bool Importer : : ValidateFlags ( unsigned int pFlags ) const { <nl> + bool Importer : : ValidateFlags ( unsigned int pFlags ) const <nl> + { <nl> ASSIMP_BEGIN_EXCEPTION_REGION ( ) ; <nl> / / run basic checks for mutually exclusive flags <nl> if ( ! _ValidateFlags ( pFlags ) ) { <nl> bool Importer : : ValidateFlags ( unsigned int pFlags ) const { <nl> const aiScene * Importer : : ReadFileFromMemory ( const void * pBuffer , <nl> size_t pLength , <nl> unsigned int pFlags , <nl> - const char * pHint / * = " " * / ) { <nl> - ai_assert ( nullptr ! = pimpl ) ; <nl> - <nl> + const char * pHint / * = " " * / ) <nl> + { <nl> ASSIMP_BEGIN_EXCEPTION_REGION ( ) ; <nl> if ( ! pHint ) { <nl> pHint = " " ; <nl> const aiScene * Importer : : ReadFileFromMemory ( const void * pBuffer , <nl> <nl> if ( ! pBuffer | | ! pLength | | strlen ( pHint ) > MaxLenHint ) { <nl> pimpl - > mErrorString = " Invalid parameters passed to ReadFileFromMemory ( ) " ; <nl> - return nullptr ; <nl> + return NULL ; <nl> } <nl> <nl> / / prevent deletion of the previous IOHandler <nl> IOSystem * io = pimpl - > mIOHandler ; <nl> - pimpl - > mIOHandler = nullptr ; <nl> + pimpl - > mIOHandler = NULL ; <nl> <nl> SetIOHandler ( new MemoryIOSystem ( ( const uint8_t * ) pBuffer , pLength , io ) ) ; <nl> <nl> const aiScene * Importer : : ReadFileFromMemory ( const void * pBuffer , <nl> ReadFile ( fbuff , pFlags ) ; <nl> SetIOHandler ( io ) ; <nl> <nl> - ASSIMP_END_EXCEPTION_REGION_WITH_ERROR_STRING ( const aiScene * , pimpl - > mErrorString ) ; <nl> + ASSIMP_END_EXCEPTION_REGION ( const aiScene * ) ; <nl> return pimpl - > mScene ; <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> - void WriteLogOpening ( const std : : string & file ) { <nl> - <nl> + void WriteLogOpening ( const std : : string & file ) <nl> + { <nl> ASSIMP_LOG_INFO_F ( " Load " , file ) ; <nl> <nl> / / print a full version dump . This is nice because we don ' t <nl> void WriteLogOpening ( const std : : string & file ) { <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Reads the given file and returns its contents if successful . <nl> - const aiScene * Importer : : ReadFile ( const char * _pFile , unsigned int pFlags ) { <nl> - ai_assert ( nullptr ! = pimpl ) ; <nl> - <nl> + const aiScene * Importer : : ReadFile ( const char * _pFile , unsigned int pFlags ) <nl> + { <nl> ASSIMP_BEGIN_EXCEPTION_REGION ( ) ; <nl> const std : : string pFile ( _pFile ) ; <nl> <nl> const aiScene * Importer : : ReadFile ( const char * _pFile , unsigned int pFlags ) { <nl> <nl> pimpl - > mErrorString = " Unable to open file \ " " + pFile + " \ " . " ; <nl> ASSIMP_LOG_ERROR ( pimpl - > mErrorString ) ; <nl> - return nullptr ; <nl> + return NULL ; <nl> } <nl> <nl> std : : unique_ptr < Profiler > profiler ( GetPropertyInteger ( AI_CONFIG_GLOB_MEASURE_TIME , 0 ) ? new Profiler ( ) : NULL ) ; <nl> const aiScene * Importer : : ReadFile ( const char * _pFile , unsigned int pFlags ) { <nl> } <nl> <nl> / / Find an worker class which can handle the file <nl> - BaseImporter * imp = nullptr ; <nl> + BaseImporter * imp = NULL ; <nl> SetPropertyInteger ( " importerIndex " , - 1 ) ; <nl> for ( unsigned int a = 0 ; a < pimpl - > mImporter . size ( ) ; a + + ) { <nl> <nl> const aiScene * Importer : : ReadFile ( const char * _pFile , unsigned int pFlags ) { <nl> if ( ! imp ) { <nl> pimpl - > mErrorString = " No suitable reader found for the file format of file \ " " + pFile + " \ " . " ; <nl> ASSIMP_LOG_ERROR ( pimpl - > mErrorString ) ; <nl> - return nullptr ; <nl> + return NULL ; <nl> } <nl> } <nl> <nl> const aiScene * Importer : : ReadFile ( const char * _pFile , unsigned int pFlags ) { <nl> / / Dispatch the reading to the worker class for this format <nl> const aiImporterDesc * desc ( imp - > GetInfo ( ) ) ; <nl> std : : string ext ( " unknown " ) ; <nl> - if ( nullptr ! = desc ) { <nl> + if ( NULL ! = desc ) { <nl> ext = desc - > mName ; <nl> } <nl> ASSIMP_LOG_INFO ( " Found a matching importer for this file format : " + ext + " . " ) ; <nl> const aiScene * Importer : : ReadFile ( const char * _pFile , unsigned int pFlags ) { <nl> <nl> / / If successful , apply all active post processing steps to the imported data <nl> if ( pimpl - > mScene ) { <nl> - if ( ! pimpl - > mScene - > mMetaData | | ! pimpl - > mScene - > mMetaData - > HasKey ( AI_METADATA_SOURCE_FORMAT ) ) { <nl> - if ( ! pimpl - > mScene - > mMetaData ) { <nl> - pimpl - > mScene - > mMetaData = new aiMetadata ; <nl> - } <nl> - pimpl - > mScene - > mMetaData - > Add ( AI_METADATA_SOURCE_FORMAT , aiString ( ext ) ) ; <nl> - } <nl> <nl> # ifndef ASSIMP_BUILD_NO_VALIDATEDS_PROCESS <nl> / / The ValidateDS process is an exception . It is executed first , even before ScenePreprocessor is called . <nl> - if ( pFlags & aiProcess_ValidateDataStructure ) { <nl> + if ( pFlags & aiProcess_ValidateDataStructure ) <nl> + { <nl> ValidateDSProcess ds ; <nl> ds . ExecuteOnScene ( this ) ; <nl> if ( ! pimpl - > mScene ) { <nl> - return nullptr ; <nl> + return NULL ; <nl> } <nl> } <nl> # endif / / no validation <nl> const aiScene * Importer : : ReadFile ( const char * _pFile , unsigned int pFlags ) { <nl> } <nl> } <nl> # ifdef ASSIMP_CATCH_GLOBAL_EXCEPTIONS <nl> - catch ( std : : exception & e ) { <nl> + catch ( std : : exception & e ) <nl> + { <nl> # if ( defined _MSC_VER ) & & ( defined _CPPRTTI ) <nl> / / if we have RTTI get the full name of the exception that occurred <nl> pimpl - > mErrorString = std : : string ( typeid ( e ) . name ( ) ) + " : " + e . what ( ) ; <nl> const aiScene * Importer : : ReadFile ( const char * _pFile , unsigned int pFlags ) { <nl> # endif <nl> <nl> ASSIMP_LOG_ERROR ( pimpl - > mErrorString ) ; <nl> - delete pimpl - > mScene ; pimpl - > mScene = nullptr ; <nl> + delete pimpl - > mScene ; pimpl - > mScene = NULL ; <nl> } <nl> # endif / / ! ASSIMP_CATCH_GLOBAL_EXCEPTIONS <nl> <nl> / / either successful or failure - the pointer expresses it anyways <nl> - ASSIMP_END_EXCEPTION_REGION_WITH_ERROR_STRING ( const aiScene * , pimpl - > mErrorString ) ; <nl> - <nl> + ASSIMP_END_EXCEPTION_REGION ( const aiScene * ) ; <nl> return pimpl - > mScene ; <nl> } <nl> <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Apply post - processing to the currently bound scene <nl> - const aiScene * Importer : : ApplyPostProcessing ( unsigned int pFlags ) { <nl> - ai_assert ( nullptr ! = pimpl ) ; <nl> - <nl> + const aiScene * Importer : : ApplyPostProcessing ( unsigned int pFlags ) <nl> + { <nl> ASSIMP_BEGIN_EXCEPTION_REGION ( ) ; <nl> / / Return immediately if no scene is active <nl> if ( ! pimpl - > mScene ) { <nl> - return nullptr ; <nl> + return NULL ; <nl> } <nl> <nl> / / If no flags are given , return the current scene with no further action <nl> const aiScene * Importer : : ApplyPostProcessing ( unsigned int pFlags ) { <nl> # ifndef ASSIMP_BUILD_NO_VALIDATEDS_PROCESS <nl> / / The ValidateDS process plays an exceptional role . It isn ' t contained in the global <nl> / / list of post - processing steps , so we need to call it manually . <nl> - if ( pFlags & aiProcess_ValidateDataStructure ) { <nl> + if ( pFlags & aiProcess_ValidateDataStructure ) <nl> + { <nl> ValidateDSProcess ds ; <nl> ds . ExecuteOnScene ( this ) ; <nl> if ( ! pimpl - > mScene ) { <nl> - return nullptr ; <nl> + return NULL ; <nl> } <nl> } <nl> # endif / / no validation <nl> const aiScene * Importer : : ApplyPostProcessing ( unsigned int pFlags ) { <nl> <nl> std : : unique_ptr < Profiler > profiler ( GetPropertyInteger ( AI_CONFIG_GLOB_MEASURE_TIME , 0 ) ? new Profiler ( ) : NULL ) ; <nl> for ( unsigned int a = 0 ; a < pimpl - > mPostProcessingSteps . size ( ) ; a + + ) { <nl> + <nl> BaseProcess * process = pimpl - > mPostProcessingSteps [ a ] ; <nl> pimpl - > mProgressHandler - > UpdatePostProcess ( static_cast < int > ( a ) , static_cast < int > ( pimpl - > mPostProcessingSteps . size ( ) ) ) ; <nl> if ( process - > IsActive ( pFlags ) ) { <nl> + <nl> if ( profiler ) { <nl> profiler - > BeginRegion ( " postprocess " ) ; <nl> } <nl> const aiScene * Importer : : ApplyPostProcessing ( unsigned int pFlags ) { <nl> static_cast < int > ( pimpl - > mPostProcessingSteps . size ( ) ) ) ; <nl> <nl> / / update private scene flags <nl> - if ( pimpl - > mScene ) { <nl> + if ( pimpl - > mScene ) <nl> ScenePriv ( pimpl - > mScene ) - > mPPStepsApplied | = pFlags ; <nl> - } <nl> <nl> / / clear any data allocated by post - process steps <nl> pimpl - > mPPShared - > Clean ( ) ; <nl> ASSIMP_LOG_INFO ( " Leaving post processing pipeline " ) ; <nl> <nl> ASSIMP_END_EXCEPTION_REGION ( const aiScene * ) ; <nl> - <nl> return pimpl - > mScene ; <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> const aiScene * Importer : : ApplyCustomizedPostProcessing ( BaseProcess * rootProcess , bool requestValidation ) { <nl> - ai_assert ( nullptr ! = pimpl ) ; <nl> - <nl> ASSIMP_BEGIN_EXCEPTION_REGION ( ) ; <nl> <nl> / / Return immediately if no scene is active <nl> - if ( nullptr = = pimpl - > mScene ) { <nl> - return nullptr ; <nl> + if ( NULL = = pimpl - > mScene ) { <nl> + return NULL ; <nl> } <nl> <nl> / / If no flags are given , return the current scene with no further action <nl> const aiScene * Importer : : ApplyCustomizedPostProcessing ( BaseProcess * rootProcess <nl> ValidateDSProcess ds ; <nl> ds . ExecuteOnScene ( this ) ; <nl> if ( ! pimpl - > mScene ) { <nl> - return nullptr ; <nl> + return NULL ; <nl> } <nl> } <nl> # endif / / no validation <nl> const aiScene * Importer : : ApplyCustomizedPostProcessing ( BaseProcess * rootProcess <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Helper function to check whether an extension is supported by ASSIMP <nl> - bool Importer : : IsExtensionSupported ( const char * szExtension ) const { <nl> + bool Importer : : IsExtensionSupported ( const char * szExtension ) const <nl> + { <nl> return nullptr ! = GetImporter ( szExtension ) ; <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> - size_t Importer : : GetImporterCount ( ) const { <nl> - ai_assert ( nullptr ! = pimpl ) ; <nl> - <nl> + size_t Importer : : GetImporterCount ( ) const <nl> + { <nl> return pimpl - > mImporter . size ( ) ; <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> - const aiImporterDesc * Importer : : GetImporterInfo ( size_t index ) const { <nl> - ai_assert ( nullptr ! = pimpl ) ; <nl> - <nl> + const aiImporterDesc * Importer : : GetImporterInfo ( size_t index ) const <nl> + { <nl> if ( index > = pimpl - > mImporter . size ( ) ) { <nl> - return nullptr ; <nl> + return NULL ; <nl> } <nl> return pimpl - > mImporter [ index ] - > GetInfo ( ) ; <nl> } <nl> <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> - BaseImporter * Importer : : GetImporter ( size_t index ) const { <nl> - ai_assert ( nullptr ! = pimpl ) ; <nl> - <nl> + BaseImporter * Importer : : GetImporter ( size_t index ) const <nl> + { <nl> if ( index > = pimpl - > mImporter . size ( ) ) { <nl> - return nullptr ; <nl> + return NULL ; <nl> } <nl> return pimpl - > mImporter [ index ] ; <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Find a loader plugin for a given file extension <nl> - BaseImporter * Importer : : GetImporter ( const char * szExtension ) const { <nl> - ai_assert ( nullptr ! = pimpl ) ; <nl> - <nl> + BaseImporter * Importer : : GetImporter ( const char * szExtension ) const <nl> + { <nl> return GetImporter ( GetImporterIndex ( szExtension ) ) ; <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Find a loader plugin for a given file extension <nl> size_t Importer : : GetImporterIndex ( const char * szExtension ) const { <nl> - ai_assert ( nullptr ! = pimpl ) ; <nl> ai_assert ( nullptr ! = szExtension ) ; <nl> <nl> ASSIMP_BEGIN_EXCEPTION_REGION ( ) ; <nl> size_t Importer : : GetImporterIndex ( const char * szExtension ) const { <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Helper function to build a list of all file extensions supported by ASSIMP <nl> - void Importer : : GetExtensionList ( aiString & szOut ) const { <nl> - ai_assert ( nullptr ! = pimpl ) ; <nl> - <nl> + void Importer : : GetExtensionList ( aiString & szOut ) const <nl> + { <nl> ASSIMP_BEGIN_EXCEPTION_REGION ( ) ; <nl> std : : set < std : : string > str ; <nl> for ( std : : vector < BaseImporter * > : : const_iterator i = pimpl - > mImporter . begin ( ) ; i ! = pimpl - > mImporter . end ( ) ; + + i ) { <nl> void Importer : : GetExtensionList ( aiString & szOut ) const { <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Set a configuration property <nl> - bool Importer : : SetPropertyInteger ( const char * szName , int iValue ) { <nl> - ai_assert ( nullptr ! = pimpl ) ; <nl> - <nl> + bool Importer : : SetPropertyInteger ( const char * szName , int iValue ) <nl> + { <nl> bool existing ; <nl> ASSIMP_BEGIN_EXCEPTION_REGION ( ) ; <nl> existing = SetGenericProperty < int > ( pimpl - > mIntProperties , szName , iValue ) ; <nl> bool Importer : : SetPropertyInteger ( const char * szName , int iValue ) { <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Set a configuration property <nl> - bool Importer : : SetPropertyFloat ( const char * szName , ai_real iValue ) { <nl> - ai_assert ( nullptr ! = pimpl ) ; <nl> - <nl> + bool Importer : : SetPropertyFloat ( const char * szName , ai_real iValue ) <nl> + { <nl> bool existing ; <nl> ASSIMP_BEGIN_EXCEPTION_REGION ( ) ; <nl> existing = SetGenericProperty < ai_real > ( pimpl - > mFloatProperties , szName , iValue ) ; <nl> bool Importer : : SetPropertyFloat ( const char * szName , ai_real iValue ) { <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Set a configuration property <nl> - bool Importer : : SetPropertyString ( const char * szName , const std : : string & value ) { <nl> - ai_assert ( nullptr ! = pimpl ) ; <nl> - <nl> + bool Importer : : SetPropertyString ( const char * szName , const std : : string & value ) <nl> + { <nl> bool existing ; <nl> ASSIMP_BEGIN_EXCEPTION_REGION ( ) ; <nl> existing = SetGenericProperty < std : : string > ( pimpl - > mStringProperties , szName , value ) ; <nl> bool Importer : : SetPropertyString ( const char * szName , const std : : string & value ) { <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Set a configuration property <nl> - bool Importer : : SetPropertyMatrix ( const char * szName , const aiMatrix4x4 & value ) { <nl> - ai_assert ( nullptr ! = pimpl ) ; <nl> - <nl> + bool Importer : : SetPropertyMatrix ( const char * szName , const aiMatrix4x4 & value ) <nl> + { <nl> bool existing ; <nl> ASSIMP_BEGIN_EXCEPTION_REGION ( ) ; <nl> existing = SetGenericProperty < aiMatrix4x4 > ( pimpl - > mMatrixProperties , szName , value ) ; <nl> bool Importer : : SetPropertyMatrix ( const char * szName , const aiMatrix4x4 & value ) { <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Get a configuration property <nl> - int Importer : : GetPropertyInteger ( const char * szName , int iErrorReturn / * = 0xffffffff * / ) const { <nl> - ai_assert ( nullptr ! = pimpl ) ; <nl> - <nl> + int Importer : : GetPropertyInteger ( const char * szName , <nl> + int iErrorReturn / * = 0xffffffff * / ) const <nl> + { <nl> return GetGenericProperty < int > ( pimpl - > mIntProperties , szName , iErrorReturn ) ; <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Get a configuration property <nl> - ai_real Importer : : GetPropertyFloat ( const char * szName , ai_real iErrorReturn / * = 10e10 * / ) const { <nl> - ai_assert ( nullptr ! = pimpl ) ; <nl> - <nl> + ai_real Importer : : GetPropertyFloat ( const char * szName , <nl> + ai_real iErrorReturn / * = 10e10 * / ) const <nl> + { <nl> return GetGenericProperty < ai_real > ( pimpl - > mFloatProperties , szName , iErrorReturn ) ; <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Get a configuration property <nl> - std : : string Importer : : GetPropertyString ( const char * szName , const std : : string & iErrorReturn / * = " " * / ) const { <nl> - ai_assert ( nullptr ! = pimpl ) ; <nl> - <nl> + const std : : string Importer : : GetPropertyString ( const char * szName , <nl> + const std : : string & iErrorReturn / * = " " * / ) const <nl> + { <nl> return GetGenericProperty < std : : string > ( pimpl - > mStringProperties , szName , iErrorReturn ) ; <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Get a configuration property <nl> - aiMatrix4x4 Importer : : GetPropertyMatrix ( const char * szName , const aiMatrix4x4 & iErrorReturn / * = aiMatrix4x4 ( ) * / ) const { <nl> - ai_assert ( nullptr ! = pimpl ) ; <nl> - <nl> + const aiMatrix4x4 Importer : : GetPropertyMatrix ( const char * szName , <nl> + const aiMatrix4x4 & iErrorReturn / * = aiMatrix4x4 ( ) * / ) const <nl> + { <nl> return GetGenericProperty < aiMatrix4x4 > ( pimpl - > mMatrixProperties , szName , iErrorReturn ) ; <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Get the memory requirements of a single node <nl> - inline <nl> - void AddNodeWeight ( unsigned int & iScene , const aiNode * pcNode ) { <nl> - if ( nullptr = = pcNode ) { <nl> - return ; <nl> - } <nl> + inline void AddNodeWeight ( unsigned int & iScene , const aiNode * pcNode ) <nl> + { <nl> iScene + = sizeof ( aiNode ) ; <nl> iScene + = sizeof ( unsigned int ) * pcNode - > mNumMeshes ; <nl> iScene + = sizeof ( void * ) * pcNode - > mNumChildren ; <nl> void AddNodeWeight ( unsigned int & iScene , const aiNode * pcNode ) { <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Get the memory requirements of the scene <nl> - void Importer : : GetMemoryRequirements ( aiMemoryInfo & in ) const { <nl> - ai_assert ( nullptr ! = pimpl ) ; <nl> - <nl> + void Importer : : GetMemoryRequirements ( aiMemoryInfo & in ) const <nl> + { <nl> in = aiMemoryInfo ( ) ; <nl> aiScene * mScene = pimpl - > mScene ; <nl> <nl> / / return if we have no scene loaded <nl> - if ( ! mScene ) <nl> + if ( ! pimpl - > mScene ) <nl> return ; <nl> <nl> + <nl> in . total = sizeof ( aiScene ) ; <nl> <nl> / / add all meshes <nl> - for ( unsigned int i = 0 ; i < mScene - > mNumMeshes ; + + i ) { <nl> + for ( unsigned int i = 0 ; i < mScene - > mNumMeshes ; + + i ) <nl> + { <nl> in . meshes + = sizeof ( aiMesh ) ; <nl> if ( mScene - > mMeshes [ i ] - > HasPositions ( ) ) { <nl> in . meshes + = sizeof ( aiVector3D ) * mScene - > mMeshes [ i ] - > mNumVertices ; <nl> void Importer : : GetMemoryRequirements ( aiMemoryInfo & in ) const { <nl> for ( unsigned int a = 0 ; a < AI_MAX_NUMBER_OF_COLOR_SETS ; + + a ) { <nl> if ( mScene - > mMeshes [ i ] - > HasVertexColors ( a ) ) { <nl> in . meshes + = sizeof ( aiColor4D ) * mScene - > mMeshes [ i ] - > mNumVertices ; <nl> - } else { <nl> - break ; <nl> } <nl> + else break ; <nl> } <nl> for ( unsigned int a = 0 ; a < AI_MAX_NUMBER_OF_TEXTURECOORDS ; + + a ) { <nl> if ( mScene - > mMeshes [ i ] - > HasTextureCoords ( a ) ) { <nl> in . meshes + = sizeof ( aiVector3D ) * mScene - > mMeshes [ i ] - > mNumVertices ; <nl> - } else { <nl> - break ; <nl> } <nl> + else break ; <nl> } <nl> if ( mScene - > mMeshes [ i ] - > HasBones ( ) ) { <nl> in . meshes + = sizeof ( void * ) * mScene - > mMeshes [ i ] - > mNumBones ; <nl> void Importer : : GetMemoryRequirements ( aiMemoryInfo & in ) const { <nl> in . textures + = sizeof ( aiTexture ) ; <nl> if ( pc - > mHeight ) { <nl> in . textures + = 4 * pc - > mHeight * pc - > mWidth ; <nl> - } else { <nl> - in . textures + = pc - > mWidth ; <nl> } <nl> + else in . textures + = pc - > mWidth ; <nl> } <nl> in . total + = in . textures ; <nl> <nl> void Importer : : GetMemoryRequirements ( aiMemoryInfo & in ) const { <nl> in . materials + = pc - > mProperties [ a ] - > mDataLength ; <nl> } <nl> } <nl> - <nl> in . total + = in . materials ; <nl> } <nl> mmm a / thirdparty / assimp / code / Common / Importer . h <nl> ppp b / thirdparty / assimp / code / Common / Importer . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / Common / ImporterRegistry . cpp <nl> ppp b / thirdparty / assimp / code / Common / ImporterRegistry . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / code / Common / PolyTools . h <nl> ppp b / thirdparty / assimp / code / Common / PolyTools . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / Common / PostStepRegistry . cpp <nl> ppp b / thirdparty / assimp / code / Common / PostStepRegistry . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / code / Common / RemoveComments . cpp <nl> ppp b / thirdparty / assimp / code / Common / RemoveComments . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / Common / SGSpatialSort . cpp <nl> ppp b / thirdparty / assimp / code / Common / SGSpatialSort . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / code / Common / SceneCombiner . cpp <nl> ppp b / thirdparty / assimp / code / Common / SceneCombiner . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> void SceneCombiner : : Copy ( aiMetadata * * _dest , const aiMetadata * src ) { <nl> aiMetadata * dest = * _dest = aiMetadata : : Alloc ( src - > mNumProperties ) ; <nl> std : : copy ( src - > mKeys , src - > mKeys + src - > mNumProperties , dest - > mKeys ) ; <nl> <nl> + dest - > mValues = new aiMetadataEntry [ src - > mNumProperties ] ; <nl> for ( unsigned int i = 0 ; i < src - > mNumProperties ; + + i ) { <nl> aiMetadataEntry & in = src - > mValues [ i ] ; <nl> aiMetadataEntry & out = dest - > mValues [ i ] ; <nl> mmm a / thirdparty / assimp / code / Common / ScenePreprocessor . cpp <nl> ppp b / thirdparty / assimp / code / Common / ScenePreprocessor . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> void ScenePreprocessor : : ProcessAnimation ( aiAnimation * anim ) <nl> <nl> / / No rotation keys ? Generate a dummy track <nl> if ( ! channel - > mNumRotationKeys ) { <nl> - ai_assert ( ! channel - > mRotationKeys ) ; <nl> channel - > mNumRotationKeys = 1 ; <nl> channel - > mRotationKeys = new aiQuatKey [ 1 ] ; <nl> aiQuatKey & q = channel - > mRotationKeys [ 0 ] ; <nl> void ScenePreprocessor : : ProcessAnimation ( aiAnimation * anim ) <nl> q . mValue = rotation ; <nl> <nl> ASSIMP_LOG_DEBUG ( " ScenePreprocessor : Dummy rotation track has been generated " ) ; <nl> - } else { <nl> - ai_assert ( channel - > mRotationKeys ) ; <nl> } <nl> <nl> / / No scaling keys ? Generate a dummy track <nl> if ( ! channel - > mNumScalingKeys ) { <nl> - ai_assert ( ! channel - > mScalingKeys ) ; <nl> channel - > mNumScalingKeys = 1 ; <nl> channel - > mScalingKeys = new aiVectorKey [ 1 ] ; <nl> aiVectorKey & q = channel - > mScalingKeys [ 0 ] ; <nl> void ScenePreprocessor : : ProcessAnimation ( aiAnimation * anim ) <nl> q . mValue = scaling ; <nl> <nl> ASSIMP_LOG_DEBUG ( " ScenePreprocessor : Dummy scaling track has been generated " ) ; <nl> - } else { <nl> - ai_assert ( channel - > mScalingKeys ) ; <nl> } <nl> <nl> / / No position keys ? Generate a dummy track <nl> if ( ! channel - > mNumPositionKeys ) { <nl> - ai_assert ( ! channel - > mPositionKeys ) ; <nl> channel - > mNumPositionKeys = 1 ; <nl> channel - > mPositionKeys = new aiVectorKey [ 1 ] ; <nl> aiVectorKey & q = channel - > mPositionKeys [ 0 ] ; <nl> void ScenePreprocessor : : ProcessAnimation ( aiAnimation * anim ) <nl> q . mValue = position ; <nl> <nl> ASSIMP_LOG_DEBUG ( " ScenePreprocessor : Dummy position track has been generated " ) ; <nl> - } else { <nl> - ai_assert ( channel - > mPositionKeys ) ; <nl> } <nl> } <nl> } <nl> mmm a / thirdparty / assimp / code / Common / ScenePreprocessor . h <nl> ppp b / thirdparty / assimp / code / Common / ScenePreprocessor . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / Common / ScenePrivate . h <nl> ppp b / thirdparty / assimp / code / Common / ScenePrivate . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / Common / SkeletonMeshBuilder . cpp <nl> ppp b / thirdparty / assimp / code / Common / SkeletonMeshBuilder . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / Common / SpatialSort . cpp <nl> ppp b / thirdparty / assimp / code / Common / SpatialSort . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / code / Common / SplitByBoneCountProcess . cpp <nl> ppp b / thirdparty / assimp / code / Common / SplitByBoneCountProcess . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> <nl> # include < limits > <nl> # include < assimp / TinyFormatter . h > <nl> - # include < assimp / Exceptional . h > <nl> <nl> using namespace Assimp ; <nl> using namespace Assimp : : Formatter ; <nl> void SplitByBoneCountProcess : : Execute ( aiScene * pScene ) <nl> bool isNecessary = false ; <nl> for ( unsigned int a = 0 ; a < pScene - > mNumMeshes ; + + a ) <nl> if ( pScene - > mMeshes [ a ] - > mNumBones > mMaxBoneCount ) <nl> - { <nl> isNecessary = true ; <nl> - break ; <nl> - } <nl> <nl> if ( ! isNecessary ) <nl> { <nl> void SplitByBoneCountProcess : : SplitMesh ( const aiMesh * pMesh , std : : vector < aiMesh <nl> { <nl> / / skip if not necessary <nl> if ( pMesh - > mNumBones < = mMaxBoneCount ) <nl> - { <nl> return ; <nl> - } <nl> <nl> / / necessary optimisation : build a list of all affecting bones for each vertex <nl> / / TODO : ( thom ) maybe add a custom allocator here to avoid allocating tens of thousands of small arrays <nl> void SplitByBoneCountProcess : : SplitMesh ( const aiMesh * pMesh , std : : vector < aiMesh <nl> { <nl> const aiBone * bone = pMesh - > mBones [ a ] ; <nl> for ( unsigned int b = 0 ; b < bone - > mNumWeights ; + + b ) <nl> - { <nl> vertexBones [ bone - > mWeights [ b ] . mVertexId ] . push_back ( BoneWeight ( a , bone - > mWeights [ b ] . mWeight ) ) ; <nl> - } <nl> } <nl> <nl> unsigned int numFacesHandled = 0 ; <nl> void SplitByBoneCountProcess : : SplitMesh ( const aiMesh * pMesh , std : : vector < aiMesh <nl> { <nl> / / skip if the face is already stored in a submesh <nl> if ( isFaceHandled [ a ] ) <nl> - { <nl> continue ; <nl> - } <nl> <nl> const aiFace & face = pMesh - > mFaces [ a ] ; <nl> / / check every vertex if its bones would still fit into the current submesh <nl> void SplitByBoneCountProcess : : SplitMesh ( const aiMesh * pMesh , std : : vector < aiMesh <nl> unsigned int boneIndex = vb [ c ] . first ; <nl> / / if the bone is already used in this submesh , it ' s ok <nl> if ( isBoneUsed [ boneIndex ] ) <nl> - { <nl> continue ; <nl> - } <nl> <nl> / / if it ' s not used , yet , we would need to add it . Store its bone index <nl> if ( std : : find ( newBonesAtCurrentFace . begin ( ) , newBonesAtCurrentFace . end ( ) , boneIndex ) = = newBonesAtCurrentFace . end ( ) ) <nl> - { <nl> newBonesAtCurrentFace . push_back ( boneIndex ) ; <nl> - } <nl> } <nl> } <nl> <nl> - if ( newBonesAtCurrentFace . size ( ) > mMaxBoneCount ) <nl> - { <nl> - throw DeadlyImportError ( " SplitByBoneCountProcess : Single face requires more bones than specified max bone count ! " ) ; <nl> - } <nl> / / leave out the face if the new bones required for this face don ' t fit the bone count limit anymore <nl> if ( numBones + newBonesAtCurrentFace . size ( ) > mMaxBoneCount ) <nl> - { <nl> continue ; <nl> - } <nl> <nl> / / mark all new bones as necessary <nl> while ( ! newBonesAtCurrentFace . empty ( ) ) <nl> void SplitByBoneCountProcess : : SplitMesh ( const aiMesh * pMesh , std : : vector < aiMesh <nl> unsigned int newIndex = newBonesAtCurrentFace . back ( ) ; <nl> newBonesAtCurrentFace . pop_back ( ) ; / / this also avoids the deallocation which comes with a clear ( ) <nl> if ( isBoneUsed [ newIndex ] ) <nl> - { <nl> continue ; <nl> - } <nl> <nl> isBoneUsed [ newIndex ] = true ; <nl> numBones + + ; <nl> void SplitByBoneCountProcess : : SplitMesh ( const aiMesh * pMesh , std : : vector < aiMesh <nl> / / create a new mesh to hold this subset of the source mesh <nl> aiMesh * newMesh = new aiMesh ; <nl> if ( pMesh - > mName . length > 0 ) <nl> - { <nl> newMesh - > mName . Set ( format ( ) < < pMesh - > mName . data < < " _sub " < < poNewMeshes . size ( ) ) ; <nl> - } <nl> newMesh - > mMaterialIndex = pMesh - > mMaterialIndex ; <nl> newMesh - > mPrimitiveTypes = pMesh - > mPrimitiveTypes ; <nl> poNewMeshes . push_back ( newMesh ) ; <nl> void SplitByBoneCountProcess : : SplitMesh ( const aiMesh * pMesh , std : : vector < aiMesh <nl> newMesh - > mNumFaces = static_cast < unsigned int > ( subMeshFaces . size ( ) ) ; <nl> newMesh - > mVertices = new aiVector3D [ newMesh - > mNumVertices ] ; <nl> if ( pMesh - > HasNormals ( ) ) <nl> - { <nl> newMesh - > mNormals = new aiVector3D [ newMesh - > mNumVertices ] ; <nl> - } <nl> if ( pMesh - > HasTangentsAndBitangents ( ) ) <nl> { <nl> newMesh - > mTangents = new aiVector3D [ newMesh - > mNumVertices ] ; <nl> void SplitByBoneCountProcess : : SplitMesh ( const aiMesh * pMesh , std : : vector < aiMesh <nl> for ( unsigned int a = 0 ; a < AI_MAX_NUMBER_OF_TEXTURECOORDS ; + + a ) <nl> { <nl> if ( pMesh - > HasTextureCoords ( a ) ) <nl> - { <nl> newMesh - > mTextureCoords [ a ] = new aiVector3D [ newMesh - > mNumVertices ] ; <nl> - } <nl> newMesh - > mNumUVComponents [ a ] = pMesh - > mNumUVComponents [ a ] ; <nl> } <nl> for ( unsigned int a = 0 ; a < AI_MAX_NUMBER_OF_COLOR_SETS ; + + a ) <nl> { <nl> if ( pMesh - > HasVertexColors ( a ) ) <nl> - { <nl> newMesh - > mColors [ a ] = new aiColor4D [ newMesh - > mNumVertices ] ; <nl> - } <nl> } <nl> <nl> / / and copy over the data , generating faces with linear indices along the way <nl> void SplitByBoneCountProcess : : SplitMesh ( const aiMesh * pMesh , std : : vector < aiMesh <nl> <nl> newMesh - > mVertices [ nvi ] = pMesh - > mVertices [ srcIndex ] ; <nl> if ( pMesh - > HasNormals ( ) ) <nl> - { <nl> newMesh - > mNormals [ nvi ] = pMesh - > mNormals [ srcIndex ] ; <nl> - } <nl> if ( pMesh - > HasTangentsAndBitangents ( ) ) <nl> { <nl> newMesh - > mTangents [ nvi ] = pMesh - > mTangents [ srcIndex ] ; <nl> void SplitByBoneCountProcess : : SplitMesh ( const aiMesh * pMesh , std : : vector < aiMesh <nl> for ( unsigned int c = 0 ; c < AI_MAX_NUMBER_OF_TEXTURECOORDS ; + + c ) <nl> { <nl> if ( pMesh - > HasTextureCoords ( c ) ) <nl> - { <nl> newMesh - > mTextureCoords [ c ] [ nvi ] = pMesh - > mTextureCoords [ c ] [ srcIndex ] ; <nl> - } <nl> } <nl> for ( unsigned int c = 0 ; c < AI_MAX_NUMBER_OF_COLOR_SETS ; + + c ) <nl> { <nl> if ( pMesh - > HasVertexColors ( c ) ) <nl> - { <nl> newMesh - > mColors [ c ] [ nvi ] = pMesh - > mColors [ c ] [ srcIndex ] ; <nl> - } <nl> } <nl> <nl> nvi + + ; <nl> void SplitByBoneCountProcess : : SplitMesh ( const aiMesh * pMesh , std : : vector < aiMesh <nl> for ( unsigned int a = 0 ; a < pMesh - > mNumBones ; + + a ) <nl> { <nl> if ( ! isBoneUsed [ a ] ) <nl> - { <nl> continue ; <nl> - } <nl> <nl> / / create the new bone <nl> const aiBone * srcBone = pMesh - > mBones [ a ] ; <nl> void SplitByBoneCountProcess : : SplitMesh ( const aiMesh * pMesh , std : : vector < aiMesh <nl> { <nl> unsigned int newBoneIndex = mappedBoneIndex [ bonesOnThisVertex [ b ] . first ] ; <nl> if ( newBoneIndex ! = std : : numeric_limits < unsigned int > : : max ( ) ) <nl> - { <nl> newMesh - > mBones [ newBoneIndex ] - > mNumWeights + + ; <nl> - } <nl> } <nl> } <nl> <nl> mmm a / thirdparty / assimp / code / Common / SplitByBoneCountProcess . h <nl> ppp b / thirdparty / assimp / code / Common / SplitByBoneCountProcess . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / Common / StandardShapes . cpp <nl> ppp b / thirdparty / assimp / code / Common / StandardShapes . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / Common / StdOStreamLogStream . h <nl> ppp b / thirdparty / assimp / code / Common / StdOStreamLogStream . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / code / Common / Subdivision . cpp <nl> ppp b / thirdparty / assimp / code / Common / Subdivision . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / Common / TargetAnimation . cpp <nl> ppp b / thirdparty / assimp / code / Common / TargetAnimation . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / Common / TargetAnimation . h <nl> ppp b / thirdparty / assimp / code / Common / TargetAnimation . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / Common / Version . cpp <nl> ppp b / thirdparty / assimp / code / Common / Version . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> static const char * LEGAL_INFORMATION = <nl> " Open Asset Import Library ( Assimp ) . \ n " <nl> " A free C / C + + library to import various 3D file formats into applications \ n \ n " <nl> <nl> - " ( c ) 2006 - 2020 , assimp team \ n " <nl> + " ( c ) 2006 - 2019 , assimp team \ n " <nl> " License under the terms and conditions of the 3 - clause BSD license \ n " <nl> " http : / / assimp . org \ n " <nl> ; <nl> ASSIMP_API const char * aiGetLegalString ( ) { <nl> return LEGAL_INFORMATION ; <nl> } <nl> <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> - / / Get Assimp patch version <nl> - ASSIMP_API unsigned int aiGetVersionPatch ( ) { <nl> - return VER_PATCH ; <nl> - } <nl> - <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Get Assimp minor version <nl> ASSIMP_API unsigned int aiGetVersionMinor ( ) { <nl> mmm a / thirdparty / assimp / code / Common / VertexTriangleAdjacency . cpp <nl> ppp b / thirdparty / assimp / code / Common / VertexTriangleAdjacency . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> VertexTriangleAdjacency : : VertexTriangleAdjacency ( aiFace * pcFaces , <nl> { <nl> / / compute the number of referenced vertices if it wasn ' t specified by the caller <nl> const aiFace * const pcFaceEnd = pcFaces + iNumFaces ; <nl> - if ( 0 = = iNumVertices ) { <nl> + if ( ! iNumVertices ) { <nl> for ( aiFace * pcFace = pcFaces ; pcFace ! = pcFaceEnd ; + + pcFace ) { <nl> ai_assert ( nullptr ! = pcFace ) ; <nl> ai_assert ( 3 = = pcFace - > mNumIndices ) ; <nl> VertexTriangleAdjacency : : VertexTriangleAdjacency ( aiFace * pcFaces , <nl> } <nl> } <nl> <nl> - mNumVertices = iNumVertices + 1 ; <nl> + mNumVertices = iNumVertices ; <nl> <nl> unsigned int * pi ; <nl> <nl> mmm a / thirdparty / assimp / code / Common / VertexTriangleAdjacency . h <nl> ppp b / thirdparty / assimp / code / Common / VertexTriangleAdjacency . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / Common / Win32DebugLogStream . h <nl> ppp b / thirdparty / assimp / code / Common / Win32DebugLogStream . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / code / Common / assbin_chunks . h <nl> ppp b / thirdparty / assimp / code / Common / assbin_chunks . h <nl> The ASSBIN file format is composed of chunks to represent the hierarchical aiSce <nl> This makes the format extensible and allows backward - compatibility with future data structure <nl> versions . The < tt > & lt ; root & gt ; / code / assbin_chunks . h < / tt > header contains some magic constants <nl> for use by stand - alone ASSBIN loaders . Also , Assimp ' s own file writer can be found <nl> - in < tt > & lt ; root & gt ; / tools / assimp_cmd / WriteDump . cpp < / tt > ( yes , the ' b ' is no typo . . . ) . <nl> + in < tt > & lt ; root & gt ; / tools / assimp_cmd / WriteDumb . cpp < / tt > ( yes , the ' b ' is no typo . . . ) . <nl> <nl> @ verbatim <nl> <nl> deleted file mode 100644 <nl> index f4a29dacfc4 . . 00000000000 <nl> mmm a / thirdparty / assimp / code / Common / material . cpp <nl> ppp / dev / null <nl> <nl> - / * <nl> - Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> - <nl> - <nl> - All rights reserved . <nl> - <nl> - Redistribution and use of this software in source and binary forms , <nl> - with or without modification , are permitted provided that the <nl> - following conditions are met : <nl> - <nl> - * Redistributions of source code must retain the above <nl> - copyright notice , this list of conditions and the <nl> - following disclaimer . <nl> - <nl> - * Redistributions in binary form must reproduce the above <nl> - copyright notice , this list of conditions and the <nl> - following disclaimer in the documentation and / or other <nl> - materials provided with the distribution . <nl> - <nl> - * Neither the name of the assimp team , nor the names of its <nl> - contributors may be used to endorse or promote products <nl> - derived from this software without specific prior <nl> - written permission of the assimp team . <nl> - <nl> - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> - " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> - LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> - A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> - SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> - LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> - DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> - THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> - ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> - OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> - <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - * / <nl> - <nl> - / / / @ file material . cpp <nl> - / * * Implement common material related functions . * / <nl> - <nl> - # include < assimp / ai_assert . h > <nl> - # include < assimp / material . h > <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - const char * TextureTypeToString ( aiTextureType in ) <nl> - { <nl> - switch ( in ) <nl> - { <nl> - case aiTextureType_NONE : <nl> - return " n / a " ; <nl> - case aiTextureType_DIFFUSE : <nl> - return " Diffuse " ; <nl> - case aiTextureType_SPECULAR : <nl> - return " Specular " ; <nl> - case aiTextureType_AMBIENT : <nl> - return " Ambient " ; <nl> - case aiTextureType_EMISSIVE : <nl> - return " Emissive " ; <nl> - case aiTextureType_OPACITY : <nl> - return " Opacity " ; <nl> - case aiTextureType_NORMALS : <nl> - return " Normals " ; <nl> - case aiTextureType_HEIGHT : <nl> - return " Height " ; <nl> - case aiTextureType_SHININESS : <nl> - return " Shininess " ; <nl> - case aiTextureType_DISPLACEMENT : <nl> - return " Displacement " ; <nl> - case aiTextureType_LIGHTMAP : <nl> - return " Lightmap " ; <nl> - case aiTextureType_REFLECTION : <nl> - return " Reflection " ; <nl> - case aiTextureType_BASE_COLOR : <nl> - return " BaseColor " ; <nl> - case aiTextureType_NORMAL_CAMERA : <nl> - return " NormalCamera " ; <nl> - case aiTextureType_EMISSION_COLOR : <nl> - return " EmissionColor " ; <nl> - case aiTextureType_METALNESS : <nl> - return " Metalness " ; <nl> - case aiTextureType_DIFFUSE_ROUGHNESS : <nl> - return " DiffuseRoughness " ; <nl> - case aiTextureType_AMBIENT_OCCLUSION : <nl> - return " AmbientOcclusion " ; <nl> - case aiTextureType_UNKNOWN : <nl> - return " Unknown " ; <nl> - default : <nl> - break ; <nl> - } <nl> - ai_assert ( false ) ; <nl> - return " BUG " ; <nl> - } <nl> mmm a / thirdparty / assimp / code / Common / scene . cpp <nl> ppp b / thirdparty / assimp / code / Common / scene . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / code / Common / simd . cpp <nl> ppp b / thirdparty / assimp / code / Common / simd . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / code / Common / simd . h <nl> ppp b / thirdparty / assimp / code / Common / simd . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / code / FBX / FBXAnimation . cpp <nl> ppp b / thirdparty / assimp / code / FBX / FBXAnimation . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / FBX / FBXBinaryTokenizer . cpp <nl> ppp b / thirdparty / assimp / code / FBX / FBXBinaryTokenizer . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / FBX / FBXCommon . h <nl> ppp b / thirdparty / assimp / code / FBX / FBXCommon . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> All rights reserved . <nl> <nl> OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> namespace Assimp { <nl> namespace FBX <nl> { <nl> - const std : : string NULL_RECORD = { / / 25 null bytes in 64 - bit and 13 null bytes in 32 - bit <nl> - ' \ 0 ' , ' \ 0 ' , ' \ 0 ' , ' \ 0 ' , ' \ 0 ' , ' \ 0 ' , ' \ 0 ' , ' \ 0 ' , ' \ 0 ' , ' \ 0 ' , ' \ 0 ' , ' \ 0 ' , ' \ 0 ' , <nl> - ' \ 0 ' , ' \ 0 ' , ' \ 0 ' , ' \ 0 ' , ' \ 0 ' , ' \ 0 ' , ' \ 0 ' , ' \ 0 ' , ' \ 0 ' , ' \ 0 ' , ' \ 0 ' , ' \ 0 ' <nl> - } ; / / who knows why , it looks like two integers 32 / 64 bit ( compressed and uncompressed sizes ? ) + 1 byte ( might be compression type ? ) <nl> + const std : : string NULL_RECORD = { / / 13 null bytes <nl> + ' \ 0 ' , ' \ 0 ' , ' \ 0 ' , ' \ 0 ' , ' \ 0 ' , ' \ 0 ' , ' \ 0 ' , ' \ 0 ' , ' \ 0 ' , ' \ 0 ' , ' \ 0 ' , ' \ 0 ' , ' \ 0 ' <nl> + } ; / / who knows why <nl> const std : : string SEPARATOR = { ' \ x00 ' , ' \ x01 ' } ; / / for use inside strings <nl> const std : : string MAGIC_NODE_TAG = " _ $ AssimpFbx $ " ; / / from import <nl> const int64_t SECOND = 46186158000 ; / / FBX ' s kTime unit <nl> mmm a / thirdparty / assimp / code / FBX / FBXCompileConfig . h <nl> ppp b / thirdparty / assimp / code / FBX / FBXCompileConfig . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / FBX / FBXConverter . cpp <nl> ppp b / thirdparty / assimp / code / FBX / FBXConverter . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> # include < assimp / scene . h > <nl> <nl> # include < assimp / CreateAnimMesh . h > <nl> - # include < assimp / commonMetaData . h > <nl> - # include < assimp / StringUtils . h > <nl> <nl> # include < tuple > <nl> # include < memory > <nl> namespace Assimp { <nl> <nl> bone_map . clear ( ) ; <nl> } <nl> - catch ( std : : exception & ) { <nl> + catch ( std : : exception & e ) { <nl> std : : for_each ( bones . begin ( ) , bones . end ( ) , Util : : delete_fun < aiBone > ( ) ) ; <nl> throw ; <nl> } <nl> namespace Assimp { <nl> aiBone * bone = nullptr ; <nl> <nl> if ( bone_map . count ( deformer_name ) ) { <nl> - ASSIMP_LOG_DEBUG_F ( " retrieved bone from lookup " , bone_name . C_Str ( ) , " . Deformer : " , deformer_name ) ; <nl> - bone = bone_map [ deformer_name ] ; <nl> - } else { <nl> - ASSIMP_LOG_DEBUG_F ( " created new bone " , bone_name . C_Str ( ) , " . Deformer : " , deformer_name ) ; <nl> - bone = new aiBone ( ) ; <nl> + std : : cout < < " retrieved bone from lookup " < < bone_name . C_Str ( ) < < " . Deformer : " < < deformer_name <nl> + < < std : : endl ; <nl> + bone = bone_map [ deformer_name ] ; <nl> + } else { <nl> + std : : cout < < " created new bone " < < bone_name . C_Str ( ) < < " . Deformer : " < < deformer_name < < std : : endl ; <nl> + bone = new aiBone ( ) ; <nl> bone - > mName = bone_name ; <nl> <nl> / / store local transform link for post processing <nl> namespace Assimp { <nl> bone_map . insert ( std : : pair < const std : : string , aiBone * > ( deformer_name , bone ) ) ; <nl> } <nl> <nl> - ASSIMP_LOG_DEBUG_F ( " bone research : Indicies size : " , out_indices . size ( ) ) ; <nl> + std : : cout < < " bone research : Indicies size : " < < out_indices . size ( ) < < std : : endl ; <nl> <nl> / / lookup must be populated in case something goes wrong <nl> / / this also allocates bones to mesh instance outside <nl> namespace Assimp { <nl> TrySetTextureProperties ( out_mat , textures , " Maya | TEX_emissive_map | file " , aiTextureType_EMISSION_COLOR , mesh ) ; <nl> TrySetTextureProperties ( out_mat , textures , " Maya | TEX_metallic_map | file " , aiTextureType_METALNESS , mesh ) ; <nl> TrySetTextureProperties ( out_mat , textures , " Maya | TEX_roughness_map | file " , aiTextureType_DIFFUSE_ROUGHNESS , mesh ) ; <nl> - TrySetTextureProperties ( out_mat , textures , " Maya | TEX_ao_map | file " , aiTextureType_AMBIENT_OCCLUSION , mesh ) ; <nl> - <nl> - / / 3DSMax PBR <nl> - TrySetTextureProperties ( out_mat , textures , " 3dsMax | Parameters | base_color_map " , aiTextureType_BASE_COLOR , mesh ) ; <nl> - TrySetTextureProperties ( out_mat , textures , " 3dsMax | Parameters | bump_map " , aiTextureType_NORMAL_CAMERA , mesh ) ; <nl> - TrySetTextureProperties ( out_mat , textures , " 3dsMax | Parameters | emission_map " , aiTextureType_EMISSION_COLOR , mesh ) ; <nl> - TrySetTextureProperties ( out_mat , textures , " 3dsMax | Parameters | metalness_map " , aiTextureType_METALNESS , mesh ) ; <nl> - TrySetTextureProperties ( out_mat , textures , " 3dsMax | Parameters | roughness_map " , aiTextureType_DIFFUSE_ROUGHNESS , mesh ) ; <nl> + TrySetTextureProperties ( out_mat , textures , " Maya | TEX_ao_map | file " , aiTextureType_AMBIENT_OCCLUSION , mesh ) ; <nl> } <nl> <nl> void FBXConverter : : SetTextureProperties ( aiMaterial * out_mat , const LayeredTextureMap & layeredTextures , const MeshGeometry * const mesh ) <nl> void FBXConverter : : SetShadingPropertiesRaw ( aiMaterial * out_mat , const PropertyTa <nl> return ; <nl> } <nl> <nl> - const bool hasGenerator = ! doc . Creator ( ) . empty ( ) ; <nl> - <nl> - out - > mMetaData = aiMetadata : : Alloc ( 16 + ( hasGenerator ? 1 : 0 ) ) ; <nl> + out - > mMetaData = aiMetadata : : Alloc ( 15 ) ; <nl> out - > mMetaData - > Set ( 0 , " UpAxis " , doc . GlobalSettings ( ) . UpAxis ( ) ) ; <nl> out - > mMetaData - > Set ( 1 , " UpAxisSign " , doc . GlobalSettings ( ) . UpAxisSign ( ) ) ; <nl> out - > mMetaData - > Set ( 2 , " FrontAxis " , doc . GlobalSettings ( ) . FrontAxis ( ) ) ; <nl> void FBXConverter : : SetShadingPropertiesRaw ( aiMaterial * out_mat , const PropertyTa <nl> out - > mMetaData - > Set ( 12 , " TimeSpanStart " , doc . GlobalSettings ( ) . TimeSpanStart ( ) ) ; <nl> out - > mMetaData - > Set ( 13 , " TimeSpanStop " , doc . GlobalSettings ( ) . TimeSpanStop ( ) ) ; <nl> out - > mMetaData - > Set ( 14 , " CustomFrameRate " , doc . GlobalSettings ( ) . CustomFrameRate ( ) ) ; <nl> - out - > mMetaData - > Set ( 15 , AI_METADATA_SOURCE_FORMAT_VERSION , aiString ( to_string ( doc . FBXVersion ( ) ) ) ) ; <nl> - if ( hasGenerator ) <nl> - { <nl> - out - > mMetaData - > Set ( 16 , AI_METADATA_SOURCE_GENERATOR , aiString ( doc . Creator ( ) ) ) ; <nl> - } <nl> } <nl> <nl> void FBXConverter : : TransferDataToScene ( ) <nl> mmm a / thirdparty / assimp / code / FBX / FBXConverter . h <nl> ppp b / thirdparty / assimp / code / FBX / FBXConverter . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> class FBXConverter { <nl> double & minTime , <nl> Model : : RotOrder order ) ; <nl> <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> - / / Copy global geometric data and some information about the source asset into scene metadata . <nl> void ConvertGlobalSettings ( ) ; <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> mmm a / thirdparty / assimp / code / FBX / FBXDeformer . cpp <nl> ppp b / thirdparty / assimp / code / FBX / FBXDeformer . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / FBX / FBXDocument . cpp <nl> ppp b / thirdparty / assimp / code / FBX / FBXDocument . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / FBX / FBXDocument . h <nl> ppp b / thirdparty / assimp / code / FBX / FBXDocument . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / FBX / FBXDocumentUtil . cpp <nl> ppp b / thirdparty / assimp / code / FBX / FBXDocumentUtil . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / FBX / FBXDocumentUtil . h <nl> ppp b / thirdparty / assimp / code / FBX / FBXDocumentUtil . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2012 , assimp team <nl> All rights reserved . <nl> <nl> Redistribution and use of this software in source and binary forms , <nl> mmm a / thirdparty / assimp / code / FBX / FBXExportNode . cpp <nl> ppp b / thirdparty / assimp / code / FBX / FBXExportNode . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> All rights reserved . <nl> <nl> void FBX : : Node : : BeginBinary ( Assimp : : StreamWriterLE & s ) <nl> this - > start_pos = s . Tell ( ) ; <nl> <nl> / / placeholders for end pos and property section info <nl> - s . PutU8 ( 0 ) ; / / end pos <nl> - s . PutU8 ( 0 ) ; / / number of properties <nl> - s . PutU8 ( 0 ) ; / / total property section length <nl> + s . PutU4 ( 0 ) ; / / end pos <nl> + s . PutU4 ( 0 ) ; / / number of properties <nl> + s . PutU4 ( 0 ) ; / / total property section length <nl> <nl> / / node name <nl> s . PutU1 ( uint8_t ( name . size ( ) ) ) ; / / length of node name <nl> void FBX : : Node : : EndPropertiesBinary ( <nl> size_t pos = s . Tell ( ) ; <nl> ai_assert ( pos > property_start ) ; <nl> size_t property_section_size = pos - property_start ; <nl> - s . Seek ( start_pos + 8 ) ; / / 8 bytes of uint64_t of end_pos <nl> - s . PutU8 ( num_properties ) ; <nl> - s . PutU8 ( property_section_size ) ; <nl> + s . Seek ( start_pos + 4 ) ; <nl> + s . PutU4 ( uint32_t ( num_properties ) ) ; <nl> + s . PutU4 ( uint32_t ( property_section_size ) ) ; <nl> s . Seek ( pos ) ; <nl> } <nl> <nl> void FBX : : Node : : EndBinary ( <nl> / / now go back and write initial pos <nl> this - > end_pos = s . Tell ( ) ; <nl> s . Seek ( start_pos ) ; <nl> - s . PutU8 ( end_pos ) ; <nl> + s . PutU4 ( uint32_t ( end_pos ) ) ; <nl> s . Seek ( end_pos ) ; <nl> } <nl> <nl> mmm a / thirdparty / assimp / code / FBX / FBXExportNode . h <nl> ppp b / thirdparty / assimp / code / FBX / FBXExportNode . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> All rights reserved . <nl> <nl> mmm a / thirdparty / assimp / code / FBX / FBXExportProperty . cpp <nl> ppp b / thirdparty / assimp / code / FBX / FBXExportProperty . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> All rights reserved . <nl> <nl> mmm a / thirdparty / assimp / code / FBX / FBXExportProperty . h <nl> ppp b / thirdparty / assimp / code / FBX / FBXExportProperty . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> All rights reserved . <nl> <nl> mmm a / thirdparty / assimp / code / FBX / FBXExporter . cpp <nl> ppp b / thirdparty / assimp / code / FBX / FBXExporter . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> All rights reserved . <nl> <nl> using namespace Assimp : : FBX ; <nl> / / some constants that we ' ll use for writing metadata <nl> namespace Assimp { <nl> namespace FBX { <nl> - const std : : string EXPORT_VERSION_STR = " 7 . 5 . 0 " ; <nl> - const uint32_t EXPORT_VERSION_INT = 7500 ; / / 7 . 5 = = 2016 + <nl> + const std : : string EXPORT_VERSION_STR = " 7 . 4 . 0 " ; <nl> + const uint32_t EXPORT_VERSION_INT = 7400 ; / / 7 . 4 = = 2014 / 2015 <nl> / / FBX files have some hashed values that depend on the creation time field , <nl> / / but for now we don ' t actually know how to generate these . <nl> / / what we can do is set them to a known - working version . <nl> void FBXExporter : : WriteObjects ( ) <nl> sdnode . AddChild ( " Version " , int32_t ( 100 ) ) ; <nl> sdnode . AddChild ( " UserData " , " " , " " ) ; <nl> <nl> - std : : set < int32_t > setWeightedVertex ; <nl> / / add indices and weights , if any <nl> if ( b ) { <nl> std : : vector < int32_t > subdef_indices ; <nl> void FBXExporter : : WriteObjects ( ) <nl> int32_t last_index = - 1 ; <nl> for ( size_t wi = 0 ; wi < b - > mNumWeights ; + + wi ) { <nl> int32_t vi = vertex_indices [ b - > mWeights [ wi ] . mVertexId ] ; <nl> - bool bIsWeightedAlready = ( setWeightedVertex . find ( vi ) ! = setWeightedVertex . end ( ) ) ; <nl> - if ( vi = = last_index | | bIsWeightedAlready ) { <nl> + if ( vi = = last_index ) { <nl> / / only for vertices we exported to fbx <nl> / / TODO , FIXME : this assumes identically - located vertices <nl> / / will always deform in the same way . <nl> void FBXExporter : : WriteObjects ( ) <nl> / / identical vertex . <nl> continue ; <nl> } <nl> - setWeightedVertex . insert ( vi ) ; <nl> subdef_indices . push_back ( vi ) ; <nl> subdef_weights . push_back ( b - > mWeights [ wi ] . mWeight ) ; <nl> last_index = vi ; <nl> mmm a / thirdparty / assimp / code / FBX / FBXExporter . h <nl> ppp b / thirdparty / assimp / code / FBX / FBXExporter . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> All rights reserved . <nl> <nl> mmm a / thirdparty / assimp / code / FBX / FBXImportSettings . h <nl> ppp b / thirdparty / assimp / code / FBX / FBXImportSettings . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / FBX / FBXImporter . cpp <nl> ppp b / thirdparty / assimp / code / FBX / FBXImporter . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / FBX / FBXImporter . h <nl> ppp b / thirdparty / assimp / code / FBX / FBXImporter . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / FBX / FBXMaterial . cpp <nl> ppp b / thirdparty / assimp / code / FBX / FBXMaterial . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / FBX / FBXMeshGeometry . cpp <nl> ppp b / thirdparty / assimp / code / FBX / FBXMeshGeometry . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> void ResolveVertexDataArray ( std : : vector < T > & data_out , const Scope & source , <nl> return ; <nl> } <nl> std : : vector < T > tempData ; <nl> - ParseVectorDataArray ( tempData , GetRequiredElement ( source , dataElementName ) ) ; <nl> - <nl> - if ( tempData . size ( ) ! = mapping_offsets . size ( ) ) { <nl> - FBXImporter : : LogError ( Formatter : : format ( " length of input data unexpected for ByVertice mapping : " ) <nl> - < < tempData . size ( ) < < " , expected " < < mapping_offsets . size ( ) ) ; <nl> - return ; <nl> - } <nl> + ParseVectorDataArray ( tempData , GetRequiredElement ( source , dataElementName ) ) ; <nl> <nl> data_out . resize ( vertex_count ) ; <nl> - for ( size_t i = 0 , e = tempData . size ( ) ; i < e ; + + i ) { <nl> + for ( size_t i = 0 , e = tempData . size ( ) ; i < e ; + + i ) { <nl> + <nl> const unsigned int istart = mapping_offsets [ i ] , iend = istart + mapping_counts [ i ] ; <nl> for ( unsigned int j = istart ; j < iend ; + + j ) { <nl> - data_out [ mappings [ j ] ] = tempData [ i ] ; <nl> + data_out [ mappings [ j ] ] = tempData [ i ] ; <nl> } <nl> } <nl> } <nl> void ResolveVertexDataArray ( std : : vector < T > & data_out , const Scope & source , <nl> std : : vector < T > tempData ; <nl> ParseVectorDataArray ( tempData , GetRequiredElement ( source , dataElementName ) ) ; <nl> <nl> - std : : vector < int > uvIndices ; <nl> - ParseVectorDataArray ( uvIndices , GetRequiredElement ( source , indexDataElementName ) ) ; <nl> - <nl> - if ( uvIndices . size ( ) ! = vertex_count ) { <nl> - FBXImporter : : LogError ( Formatter : : format ( " length of input data unexpected for ByVertice mapping : " ) <nl> - < < uvIndices . size ( ) < < " , expected " < < vertex_count ) ; <nl> - return ; <nl> - } <nl> - <nl> data_out . resize ( vertex_count ) ; <nl> <nl> + std : : vector < int > uvIndices ; <nl> + ParseVectorDataArray ( uvIndices , GetRequiredElement ( source , indexDataElementName ) ) ; <nl> for ( size_t i = 0 , e = uvIndices . size ( ) ; i < e ; + + i ) { <nl> <nl> const unsigned int istart = mapping_offsets [ i ] , iend = istart + mapping_counts [ i ] ; <nl> void ResolveVertexDataArray ( std : : vector < T > & data_out , const Scope & source , <nl> std : : vector < T > tempData ; <nl> ParseVectorDataArray ( tempData , GetRequiredElement ( source , dataElementName ) ) ; <nl> <nl> + data_out . resize ( vertex_count ) ; <nl> + <nl> std : : vector < int > uvIndices ; <nl> ParseVectorDataArray ( uvIndices , GetRequiredElement ( source , indexDataElementName ) ) ; <nl> <nl> if ( uvIndices . size ( ) ! = vertex_count ) { <nl> - FBXImporter : : LogError ( Formatter : : format ( " length of input data unexpected for ByPolygonVertex mapping : " ) <nl> - < < uvIndices . size ( ) < < " , expected " < < vertex_count ) ; <nl> + FBXImporter : : LogError ( " length of input data unexpected for ByPolygonVertex mapping " ) ; <nl> return ; <nl> } <nl> <nl> - data_out . resize ( vertex_count ) ; <nl> - <nl> const T empty ; <nl> unsigned int next = 0 ; <nl> for ( int i : uvIndices ) { <nl> mmm a / thirdparty / assimp / code / FBX / FBXMeshGeometry . h <nl> ppp b / thirdparty / assimp / code / FBX / FBXMeshGeometry . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / FBX / FBXModel . cpp <nl> ppp b / thirdparty / assimp / code / FBX / FBXModel . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / FBX / FBXNodeAttribute . cpp <nl> ppp b / thirdparty / assimp / code / FBX / FBXNodeAttribute . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / FBX / FBXParser . cpp <nl> ppp b / thirdparty / assimp / code / FBX / FBXParser . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> float ParseTokenAsFloat ( const Token & t , const char * & err_out ) <nl> / / first - next in the fbx token stream comes ' , ' , <nl> / / which fast_atof could interpret as decimal point . <nl> # define MAX_FLOAT_LENGTH 31 <nl> - const size_t length = static_cast < size_t > ( t . end ( ) - t . begin ( ) ) ; <nl> - if ( length > MAX_FLOAT_LENGTH ) { <nl> - return 0 . f ; <nl> - } <nl> - <nl> char temp [ MAX_FLOAT_LENGTH + 1 ] ; <nl> - std : : copy ( t . begin ( ) , t . end ( ) , temp ) ; <nl> + const size_t length = static_cast < size_t > ( t . end ( ) - t . begin ( ) ) ; <nl> + std : : copy ( t . begin ( ) , t . end ( ) , temp ) ; <nl> temp [ std : : min ( static_cast < size_t > ( MAX_FLOAT_LENGTH ) , length ) ] = ' \ 0 ' ; <nl> <nl> return fast_atof ( temp ) ; <nl> mmm a / thirdparty / assimp / code / FBX / FBXParser . h <nl> ppp b / thirdparty / assimp / code / FBX / FBXParser . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / FBX / FBXProperties . cpp <nl> ppp b / thirdparty / assimp / code / FBX / FBXProperties . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / FBX / FBXProperties . h <nl> ppp b / thirdparty / assimp / code / FBX / FBXProperties . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / FBX / FBXTokenizer . cpp <nl> ppp b / thirdparty / assimp / code / FBX / FBXTokenizer . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / FBX / FBXTokenizer . h <nl> ppp b / thirdparty / assimp / code / FBX / FBXTokenizer . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / FBX / FBXUtil . cpp <nl> ppp b / thirdparty / assimp / code / FBX / FBXUtil . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / FBX / FBXUtil . h <nl> ppp b / thirdparty / assimp / code / FBX / FBXUtil . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / Material / MaterialSystem . cpp <nl> ppp b / thirdparty / assimp / code / Material / MaterialSystem . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> aiReturn aiGetMaterialColor ( const aiMaterial * pMat , <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> - / / Get a aiUVTransform ( 5 floats ) from the material <nl> + / / Get a aiUVTransform ( 4 floats ) from the material <nl> aiReturn aiGetMaterialUVTransform ( const aiMaterial * pMat , <nl> const char * pKey , <nl> unsigned int type , <nl> unsigned int index , <nl> aiUVTransform * pOut ) <nl> { <nl> - unsigned int iMax = 5 ; <nl> + unsigned int iMax = 4 ; <nl> return aiGetMaterialFloatArray ( pMat , pKey , type , index , ( ai_real * ) pOut , & iMax ) ; <nl> } <nl> <nl> aiReturn aiMaterial : : AddBinaryProperty ( const void * pInput , <nl> aiPropertyTypeInfo pType <nl> ) <nl> { <nl> - ai_assert ( pInput ! = nullptr ) ; <nl> - ai_assert ( pKey ! = nullptr ) ; <nl> + ai_assert ( pInput ! = NULL ) ; <nl> + ai_assert ( pKey ! = NULL ) ; <nl> ai_assert ( 0 ! = pSizeInBytes ) ; <nl> <nl> if ( 0 = = pSizeInBytes ) { <nl> - return AI_FAILURE ; <nl> + <nl> } <nl> <nl> / / first search the list whether there is already an entry with this key <nl> aiReturn aiMaterial : : AddBinaryProperty ( const void * pInput , <nl> pcNew - > mData = new char [ pSizeInBytes ] ; <nl> memcpy ( pcNew - > mData , pInput , pSizeInBytes ) ; <nl> <nl> - pcNew - > mKey . length = ( ai_uint32 ) : : strlen ( pKey ) ; <nl> + pcNew - > mKey . length = : : strlen ( pKey ) ; <nl> ai_assert ( MAXLEN > pcNew - > mKey . length ) ; <nl> strcpy ( pcNew - > mKey . data , pKey ) ; <nl> <nl> mmm a / thirdparty / assimp / code / Material / MaterialSystem . h <nl> ppp b / thirdparty / assimp / code / Material / MaterialSystem . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / PostProcessing / ArmaturePopulate . cpp <nl> ppp b / thirdparty / assimp / code / PostProcessing / ArmaturePopulate . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> + <nl> <nl> All rights reserved . <nl> <nl> DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> + <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> * / <nl> # include " ArmaturePopulate . h " <nl> OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> namespace Assimp { <nl> <nl> / / / The default class constructor . <nl> - ArmaturePopulate : : ArmaturePopulate ( ) : <nl> - BaseProcess ( ) { <nl> - / / do nothing <nl> - } <nl> + ArmaturePopulate : : ArmaturePopulate ( ) : BaseProcess ( ) <nl> + { } <nl> <nl> / / / The class destructor . <nl> - ArmaturePopulate : : ~ ArmaturePopulate ( ) { <nl> - / / do nothing <nl> - } <nl> + ArmaturePopulate : : ~ ArmaturePopulate ( ) <nl> + { } <nl> <nl> bool ArmaturePopulate : : IsActive ( unsigned int pFlags ) const { <nl> - return ( pFlags & aiProcess_PopulateArmatureData ) ! = 0 ; <nl> + return ( pFlags & aiProcess_PopulateArmatureData ) ! = 0 ; <nl> } <nl> <nl> void ArmaturePopulate : : SetupProperties ( const Importer * pImp ) { <nl> - / / do nothing <nl> + / / do nothing <nl> } <nl> <nl> void ArmaturePopulate : : Execute ( aiScene * out ) { <nl> <nl> - / / Now convert all bone positions to the correct mOffsetMatrix <nl> - std : : vector < aiBone * > bones ; <nl> - std : : vector < aiNode * > nodes ; <nl> - std : : map < aiBone * , aiNode * > bone_stack ; <nl> - BuildBoneList ( out - > mRootNode , out - > mRootNode , out , bones ) ; <nl> - BuildNodeList ( out - > mRootNode , nodes ) ; <nl> + / / Now convert all bone positions to the correct mOffsetMatrix <nl> + std : : vector < aiBone * > bones ; <nl> + std : : vector < aiNode * > nodes ; <nl> + std : : map < aiBone * , aiNode * > bone_stack ; <nl> + BuildBoneList ( out - > mRootNode , out - > mRootNode , out , bones ) ; <nl> + BuildNodeList ( out - > mRootNode , nodes ) ; <nl> <nl> - BuildBoneStack ( out - > mRootNode , out - > mRootNode , out , bones , bone_stack , nodes ) ; <nl> + BuildBoneStack ( out - > mRootNode , out - > mRootNode , out , bones , bone_stack , nodes ) ; <nl> <nl> - ASSIMP_LOG_DEBUG_F ( " Bone stack size : " , bone_stack . size ( ) ) ; <nl> + ASSIMP_LOG_DEBUG_F ( " Bone stack size : " , bone_stack . size ( ) ) ; <nl> <nl> - for ( std : : pair < aiBone * , aiNode * > kvp : bone_stack ) { <nl> - aiBone * bone = kvp . first ; <nl> - aiNode * bone_node = kvp . second ; <nl> - ASSIMP_LOG_DEBUG_F ( " active node lookup : " , bone - > mName . C_Str ( ) ) ; <nl> - / / lcl transform grab - done in generate_nodes : ) <nl> + for ( std : : pair < aiBone * , aiNode * > kvp : bone_stack ) { <nl> + aiBone * bone = kvp . first ; <nl> + aiNode * bone_node = kvp . second ; <nl> + ASSIMP_LOG_DEBUG_F ( " active node lookup : " , bone - > mName . C_Str ( ) ) ; <nl> + / / lcl transform grab - done in generate_nodes : ) <nl> <nl> - / / bone - > mOffsetMatrix = bone_node - > mTransformation ; <nl> - aiNode * armature = GetArmatureRoot ( bone_node , bones ) ; <nl> + / / bone - > mOffsetMatrix = bone_node - > mTransformation ; <nl> + aiNode * armature = GetArmatureRoot ( bone_node , bones ) ; <nl> <nl> - ai_assert ( armature ) ; <nl> + ai_assert ( armature ) ; <nl> <nl> - / / set up bone armature id <nl> - bone - > mArmature = armature ; <nl> + / / set up bone armature id <nl> + bone - > mArmature = armature ; <nl> <nl> - / / set this bone node to be referenced properly <nl> - ai_assert ( bone_node ) ; <nl> - bone - > mNode = bone_node ; <nl> - } <nl> + / / set this bone node to be referenced properly <nl> + ai_assert ( bone_node ) ; <nl> + bone - > mNode = bone_node ; <nl> + } <nl> } <nl> <nl> <nl> - / / Reprocess all nodes to calculate bone transforms properly based on the REAL <nl> - / / mOffsetMatrix not the local . <nl> - / / Before this would use mesh transforms which is wrong for bone transforms <nl> - / / Before this would work for simple character skeletons but not complex meshes <nl> - / / with multiple origins <nl> - / / Source : sketch fab log cutter fbx <nl> + / * Reprocess all nodes to calculate bone transforms properly based on the REAL <nl> + * mOffsetMatrix not the local . * / <nl> + / * Before this would use mesh transforms which is wrong for bone transforms * / <nl> + / * Before this would work for simple character skeletons but not complex meshes <nl> + * with multiple origins * / <nl> + / * Source : sketch fab log cutter fbx * / <nl> void ArmaturePopulate : : BuildBoneList ( aiNode * current_node , <nl> const aiNode * root_node , <nl> const aiScene * scene , <nl> std : : vector < aiBone * > & bones ) { <nl> - ai_assert ( scene ) ; <nl> - for ( unsigned int nodeId = 0 ; nodeId < current_node - > mNumChildren ; + + nodeId ) { <nl> - aiNode * child = current_node - > mChildren [ nodeId ] ; <nl> - ai_assert ( child ) ; <nl> - <nl> - / / check for bones <nl> - for ( unsigned int meshId = 0 ; meshId < child - > mNumMeshes ; + + meshId ) { <nl> - ai_assert ( child - > mMeshes ) ; <nl> - unsigned int mesh_index = child - > mMeshes [ meshId ] ; <nl> - aiMesh * mesh = scene - > mMeshes [ mesh_index ] ; <nl> - ai_assert ( mesh ) ; <nl> - <nl> - for ( unsigned int boneId = 0 ; boneId < mesh - > mNumBones ; + + boneId ) { <nl> - aiBone * bone = mesh - > mBones [ boneId ] ; <nl> - ai_assert ( bone ) ; <nl> - <nl> - / / duplicate mehes exist with the same bones sometimes : ) <nl> - / / so this must be detected <nl> - if ( std : : find ( bones . begin ( ) , bones . end ( ) , bone ) = = bones . end ( ) ) { <nl> - / / add the element once <nl> - bones . push_back ( bone ) ; <nl> - } <nl> - } <nl> - <nl> - / / find mesh and get bones <nl> - / / then do recursive lookup for bones in root node hierarchy <nl> + ai_assert ( scene ) ; <nl> + for ( unsigned int nodeId = 0 ; nodeId < current_node - > mNumChildren ; + + nodeId ) { <nl> + aiNode * child = current_node - > mChildren [ nodeId ] ; <nl> + ai_assert ( child ) ; <nl> + <nl> + / / check for bones <nl> + for ( unsigned int meshId = 0 ; meshId < child - > mNumMeshes ; + + meshId ) { <nl> + ai_assert ( child - > mMeshes ) ; <nl> + unsigned int mesh_index = child - > mMeshes [ meshId ] ; <nl> + aiMesh * mesh = scene - > mMeshes [ mesh_index ] ; <nl> + ai_assert ( mesh ) ; <nl> + <nl> + for ( unsigned int boneId = 0 ; boneId < mesh - > mNumBones ; + + boneId ) { <nl> + aiBone * bone = mesh - > mBones [ boneId ] ; <nl> + ai_assert ( bone ) ; <nl> + <nl> + / / duplicate meshes exist with the same bones sometimes : ) <nl> + / / so this must be detected <nl> + if ( std : : find ( bones . begin ( ) , bones . end ( ) , bone ) = = bones . end ( ) ) { <nl> + / / add the element once <nl> + bones . push_back ( bone ) ; <nl> } <nl> + } <nl> <nl> - BuildBoneList ( child , root_node , scene , bones ) ; <nl> + / / find mesh and get bones <nl> + / / then do recursive lookup for bones in root node hierarchy <nl> } <nl> + <nl> + BuildBoneList ( child , root_node , scene , bones ) ; <nl> + } <nl> } <nl> <nl> - / / Prepare flat node list which can be used for non recursive lookups later <nl> + / * Prepare flat node list which can be used for non recursive lookups later * / <nl> void ArmaturePopulate : : BuildNodeList ( const aiNode * current_node , <nl> std : : vector < aiNode * > & nodes ) { <nl> - ai_assert ( current_node ) ; <nl> + ai_assert ( current_node ) ; <nl> <nl> - for ( unsigned int nodeId = 0 ; nodeId < current_node - > mNumChildren ; + + nodeId ) { <nl> - aiNode * child = current_node - > mChildren [ nodeId ] ; <nl> - ai_assert ( child ) ; <nl> + for ( unsigned int nodeId = 0 ; nodeId < current_node - > mNumChildren ; + + nodeId ) { <nl> + aiNode * child = current_node - > mChildren [ nodeId ] ; <nl> + ai_assert ( child ) ; <nl> <nl> - if ( child - > mNumMeshes = = 0 ) { <nl> - nodes . push_back ( child ) ; <nl> - } <nl> + nodes . push_back ( child ) ; <nl> <nl> - BuildNodeList ( child , nodes ) ; <nl> + BuildNodeList ( child , nodes ) ; <nl> } <nl> } <nl> <nl> - / / A bone stack allows us to have multiple armatures , with the same bone names <nl> - / / A bone stack allows us also to retrieve bones true transform even with <nl> - / / duplicate names : ) <nl> + / * A bone stack allows us to have multiple armatures , with the same bone names <nl> + * A bone stack allows us also to retrieve bones true transform even with <nl> + * duplicate names : ) <nl> + * / <nl> void ArmaturePopulate : : BuildBoneStack ( aiNode * current_node , <nl> const aiNode * root_node , <nl> const aiScene * scene , <nl> const std : : vector < aiBone * > & bones , <nl> std : : map < aiBone * , aiNode * > & bone_stack , <nl> - std : : vector < aiNode * > & node_stack ) { <nl> - ai_assert ( scene ) ; <nl> - ai_assert ( root_node ) ; <nl> - ai_assert ( ! node_stack . empty ( ) ) ; <nl> - <nl> - for ( aiBone * bone : bones ) { <nl> - ai_assert ( bone ) ; <nl> - aiNode * node = GetNodeFromStack ( bone - > mName , node_stack ) ; <nl> - if ( node = = nullptr ) { <nl> - node_stack . clear ( ) ; <nl> - BuildNodeList ( root_node , node_stack ) ; <nl> - ASSIMP_LOG_DEBUG_F ( " Resetting bone stack : nullptr element " , bone - > mName . C_Str ( ) ) ; <nl> - <nl> - node = GetNodeFromStack ( bone - > mName , node_stack ) ; <nl> - <nl> - if ( ! node ) { <nl> - ASSIMP_LOG_ERROR ( " serious import issue node for bone was not detected " ) ; <nl> - continue ; <nl> - } <nl> - } <nl> + std : : vector < aiNode * > & node_stack ) { <nl> + ai_assert ( scene ) ; <nl> + ai_assert ( root_node ) ; <nl> + ai_assert ( ! node_stack . empty ( ) ) ; <nl> + <nl> + for ( aiBone * bone : bones ) { <nl> + ai_assert ( bone ) ; <nl> + aiNode * node = GetNodeFromStack ( bone - > mName , node_stack ) ; <nl> + if ( node = = nullptr ) { <nl> + node_stack . clear ( ) ; <nl> + BuildNodeList ( root_node , node_stack ) ; <nl> + ASSIMP_LOG_DEBUG_F ( " Resetting bone stack : nullptr element " , bone - > mName . C_Str ( ) ) ; <nl> + <nl> + node = GetNodeFromStack ( bone - > mName , node_stack ) ; <nl> + <nl> + if ( ! node ) { <nl> + ASSIMP_LOG_ERROR ( " serious import issue node for bone was not detected " ) ; <nl> + continue ; <nl> + } <nl> + } <nl> <nl> - ASSIMP_LOG_DEBUG_F ( " Successfully added bone [ " , bone - > mName . C_Str ( ) , " ] to stack and bone node is : " , node - > mName . C_Str ( ) ) ; <nl> + ASSIMP_LOG_DEBUG_F ( " Successfully added bone [ " , bone - > mName . C_Str ( ) , " ] to stack and bone node is : " , node - > mName . C_Str ( ) ) ; <nl> <nl> - bone_stack . insert ( std : : pair < aiBone * , aiNode * > ( bone , node ) ) ; <nl> - } <nl> + bone_stack . insert ( std : : pair < aiBone * , aiNode * > ( bone , node ) ) ; <nl> + } <nl> } <nl> <nl> - / / Returns the armature root node <nl> - / / This is required to be detected for a bone initially , it will recurse up <nl> - / / until it cannot find another bone and return the node No known failure <nl> - / / points . ( yet ) <nl> + <nl> + / * Returns the armature root node * / <nl> + / * This is required to be detected for a bone initially , it will recurse up <nl> + * until it cannot find another bone and return the node No known failure <nl> + * points . ( yet ) <nl> + * / <nl> aiNode * ArmaturePopulate : : GetArmatureRoot ( aiNode * bone_node , <nl> std : : vector < aiBone * > & bone_list ) { <nl> - while ( bone_node ) { <nl> - if ( ! IsBoneNode ( bone_node - > mName , bone_list ) ) { <nl> - ASSIMP_LOG_DEBUG_F ( " GetArmatureRoot ( ) Found valid armature : " , bone_node - > mName . C_Str ( ) ) ; <nl> - return bone_node ; <nl> - } <nl> - <nl> - bone_node = bone_node - > mParent ; <nl> + while ( bone_node ) { <nl> + if ( ! IsBoneNode ( bone_node - > mName , bone_list ) ) { <nl> + ASSIMP_LOG_DEBUG_F ( " GetArmatureRoot ( ) Found valid armature : " , bone_node - > mName . C_Str ( ) ) ; <nl> + return bone_node ; <nl> } <nl> <nl> - ASSIMP_LOG_ERROR ( " GetArmatureRoot ( ) can ' t find armature ! " ) ; <nl> - <nl> - return nullptr ; <nl> + bone_node = bone_node - > mParent ; <nl> + } <nl> + <nl> + ASSIMP_LOG_ERROR ( " GetArmatureRoot ( ) can ' t find armature ! " ) ; <nl> + <nl> + return nullptr ; <nl> } <nl> <nl> - / / Simple IsBoneNode check if this could be a bone <nl> + <nl> + <nl> + / * Simple IsBoneNode check if this could be a bone * / <nl> bool ArmaturePopulate : : IsBoneNode ( const aiString & bone_name , <nl> std : : vector < aiBone * > & bones ) { <nl> - for ( aiBone * bone : bones ) { <nl> - if ( bone - > mName = = bone_name ) { <nl> - return true ; <nl> - } <nl> + for ( aiBone * bone : bones ) { <nl> + if ( bone - > mName = = bone_name ) { <nl> + return true ; <nl> } <nl> + } <nl> <nl> - return false ; <nl> + return false ; <nl> } <nl> <nl> - / / Pop this node by name from the stack if found <nl> - / / Used in multiple armature situations with duplicate node / bone names <nl> - / / Known flaw : cannot have nodes with bone names , will be fixed in later release <nl> - / / ( serious to be fixed ) Known flaw : nodes which have more than one bone could <nl> - / / be prematurely dropped from stack <nl> + / * Pop this node by name from the stack if found * / <nl> + / * Used in multiple armature situations with duplicate node / bone names * / <nl> + / * Known flaw : cannot have nodes with bone names , will be fixed in later release <nl> + * / <nl> + / * ( serious to be fixed ) Known flaw : nodes which have more than one bone could <nl> + * be prematurely dropped from stack * / <nl> aiNode * ArmaturePopulate : : GetNodeFromStack ( const aiString & node_name , <nl> std : : vector < aiNode * > & nodes ) { <nl> - std : : vector < aiNode * > : : iterator iter ; <nl> - aiNode * found = nullptr ; <nl> - for ( iter = nodes . begin ( ) ; iter < nodes . end ( ) ; + + iter ) { <nl> - aiNode * element = * iter ; <nl> - ai_assert ( element ) ; <nl> - / / node valid and node name matches <nl> - if ( element - > mName = = node_name ) { <nl> - found = element ; <nl> - break ; <nl> - } <nl> + std : : vector < aiNode * > : : iterator iter ; <nl> + aiNode * found = nullptr ; <nl> + for ( iter = nodes . begin ( ) ; iter < nodes . end ( ) ; + + iter ) { <nl> + aiNode * element = * iter ; <nl> + ai_assert ( element ) ; <nl> + / / node valid and node name matches <nl> + if ( element - > mName = = node_name ) { <nl> + found = element ; <nl> + break ; <nl> } <nl> + } <nl> <nl> - if ( found ! = nullptr ) { <nl> - ASSIMP_LOG_INFO_F ( " Removed node from stack : " , found - > mName . C_Str ( ) ) ; <nl> - / / now pop the element from the node list <nl> - nodes . erase ( iter ) ; <nl> + if ( found ! = nullptr ) { <nl> + ASSIMP_LOG_INFO_F ( " Removed node from stack : " , found - > mName . C_Str ( ) ) ; <nl> + / / now pop the element from the node list <nl> + nodes . erase ( iter ) ; <nl> <nl> - return found ; <nl> - } <nl> + return found ; <nl> + } <nl> <nl> - / / unique names can cause this problem <nl> - ASSIMP_LOG_ERROR ( " [ Serious ] GetNodeFromStack ( ) can ' t find node from stack ! " ) ; <nl> + / / unique names can cause this problem <nl> + ASSIMP_LOG_ERROR ( " [ Serious ] GetNodeFromStack ( ) can ' t find node from stack ! " ) ; <nl> <nl> - return nullptr ; <nl> + return nullptr ; <nl> } <nl> <nl> + <nl> + <nl> + <nl> } / / Namespace Assimp <nl> mmm a / thirdparty / assimp / code / PostProcessing / ArmaturePopulate . h <nl> ppp b / thirdparty / assimp / code / PostProcessing / ArmaturePopulate . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / PostProcessing / CalcTangentsProcess . cpp <nl> ppp b / thirdparty / assimp / code / PostProcessing / CalcTangentsProcess . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / code / PostProcessing / CalcTangentsProcess . h <nl> ppp b / thirdparty / assimp / code / PostProcessing / CalcTangentsProcess . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / PostProcessing / ComputeUVMappingProcess . cpp <nl> ppp b / thirdparty / assimp / code / PostProcessing / ComputeUVMappingProcess . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / PostProcessing / ComputeUVMappingProcess . h <nl> ppp b / thirdparty / assimp / code / PostProcessing / ComputeUVMappingProcess . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / PostProcessing / ConvertToLHProcess . cpp <nl> ppp b / thirdparty / assimp / code / PostProcessing / ConvertToLHProcess . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / code / PostProcessing / ConvertToLHProcess . h <nl> ppp b / thirdparty / assimp / code / PostProcessing / ConvertToLHProcess . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> class FlipWindingOrderProcess : public BaseProcess <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> void Execute ( aiScene * pScene ) ; <nl> <nl> - public : <nl> - / * * Some other types of post - processing require winding order flips * / <nl> - static void ProcessMesh ( aiMesh * pMesh ) ; <nl> + protected : <nl> + void ProcessMesh ( aiMesh * pMesh ) ; <nl> } ; <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> mmm a / thirdparty / assimp / code / PostProcessing / DeboneProcess . cpp <nl> ppp b / thirdparty / assimp / code / PostProcessing / DeboneProcess . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / PostProcessing / DeboneProcess . h <nl> ppp b / thirdparty / assimp / code / PostProcessing / DeboneProcess . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / PostProcessing / DropFaceNormalsProcess . cpp <nl> ppp b / thirdparty / assimp / code / PostProcessing / DropFaceNormalsProcess . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / code / PostProcessing / DropFaceNormalsProcess . h <nl> ppp b / thirdparty / assimp / code / PostProcessing / DropFaceNormalsProcess . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / PostProcessing / EmbedTexturesProcess . cpp <nl> ppp b / thirdparty / assimp / code / PostProcessing / EmbedTexturesProcess . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> bool EmbedTexturesProcess : : addTexture ( aiScene * pScene , std : : string path ) const { <nl> auto oldTextures = pScene - > mTextures ; <nl> pScene - > mTextures = new aiTexture * [ pScene - > mNumTextures ] ; <nl> : : memmove ( pScene - > mTextures , oldTextures , sizeof ( aiTexture * ) * ( pScene - > mNumTextures - 1u ) ) ; <nl> - delete [ ] oldTextures ; <nl> - <nl> + <nl> / / Add the new texture <nl> auto pTexture = new aiTexture ; <nl> pTexture - > mHeight = 0 ; / / Means that this is still compressed <nl> mmm a / thirdparty / assimp / code / PostProcessing / EmbedTexturesProcess . h <nl> ppp b / thirdparty / assimp / code / PostProcessing / EmbedTexturesProcess . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / PostProcessing / FindDegenerates . cpp <nl> ppp b / thirdparty / assimp / code / PostProcessing / FindDegenerates . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / code / PostProcessing / FindDegenerates . h <nl> ppp b / thirdparty / assimp / code / PostProcessing / FindDegenerates . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / PostProcessing / FindInstancesProcess . cpp <nl> ppp b / thirdparty / assimp / code / PostProcessing / FindInstancesProcess . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / code / PostProcessing / FindInstancesProcess . h <nl> ppp b / thirdparty / assimp / code / PostProcessing / FindInstancesProcess . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / PostProcessing / FindInvalidDataProcess . cpp <nl> ppp b / thirdparty / assimp / code / PostProcessing / FindInvalidDataProcess . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / code / PostProcessing / FindInvalidDataProcess . h <nl> ppp b / thirdparty / assimp / code / PostProcessing / FindInvalidDataProcess . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / PostProcessing / FixNormalsStep . cpp <nl> ppp b / thirdparty / assimp / code / PostProcessing / FixNormalsStep . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / code / PostProcessing / FixNormalsStep . h <nl> ppp b / thirdparty / assimp / code / PostProcessing / FixNormalsStep . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / PostProcessing / GenBoundingBoxesProcess . cpp <nl> ppp b / thirdparty / assimp / code / PostProcessing / GenBoundingBoxesProcess . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> All rights reserved . <nl> <nl> mmm a / thirdparty / assimp / code / PostProcessing / GenBoundingBoxesProcess . h <nl> ppp b / thirdparty / assimp / code / PostProcessing / GenBoundingBoxesProcess . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> All rights reserved . <nl> <nl> mmm a / thirdparty / assimp / code / PostProcessing / GenFaceNormalsProcess . cpp <nl> ppp b / thirdparty / assimp / code / PostProcessing / GenFaceNormalsProcess . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / code / PostProcessing / GenFaceNormalsProcess . h <nl> ppp b / thirdparty / assimp / code / PostProcessing / GenFaceNormalsProcess . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / PostProcessing / GenVertexNormalsProcess . cpp <nl> ppp b / thirdparty / assimp / code / PostProcessing / GenVertexNormalsProcess . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / code / PostProcessing / GenVertexNormalsProcess . h <nl> ppp b / thirdparty / assimp / code / PostProcessing / GenVertexNormalsProcess . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / PostProcessing / ImproveCacheLocality . cpp <nl> ppp b / thirdparty / assimp / code / PostProcessing / ImproveCacheLocality . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / code / PostProcessing / ImproveCacheLocality . h <nl> ppp b / thirdparty / assimp / code / PostProcessing / ImproveCacheLocality . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / PostProcessing / JoinVerticesProcess . cpp <nl> ppp b / thirdparty / assimp / code / PostProcessing / JoinVerticesProcess . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / code / PostProcessing / JoinVerticesProcess . h <nl> ppp b / thirdparty / assimp / code / PostProcessing / JoinVerticesProcess . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / PostProcessing / LimitBoneWeightsProcess . cpp <nl> ppp b / thirdparty / assimp / code / PostProcessing / LimitBoneWeightsProcess . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / PostProcessing / LimitBoneWeightsProcess . h <nl> ppp b / thirdparty / assimp / code / PostProcessing / LimitBoneWeightsProcess . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / PostProcessing / MakeVerboseFormat . cpp <nl> ppp b / thirdparty / assimp / code / PostProcessing / MakeVerboseFormat . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / code / PostProcessing / MakeVerboseFormat . h <nl> ppp b / thirdparty / assimp / code / PostProcessing / MakeVerboseFormat . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / PostProcessing / OptimizeGraph . cpp <nl> ppp b / thirdparty / assimp / code / PostProcessing / OptimizeGraph . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> All rights reserved . <nl> <nl> OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> * @ brief Implementation of the aiProcess_OptimizGraph step <nl> * / <nl> <nl> + <nl> # ifndef ASSIMP_BUILD_NO_OPTIMIZEGRAPH_PROCESS <nl> <nl> # include " OptimizeGraph . h " <nl> # include " ProcessHelper . h " <nl> - # include " ConvertToLHProcess . h " <nl> - # include < assimp / Exceptional . h > <nl> # include < assimp / SceneCombiner . h > <nl> + # include < assimp / Exceptional . h > <nl> # include < stdio . h > <nl> <nl> using namespace Assimp ; <nl> using namespace Assimp ; <nl> * The unhashed variant should be faster , except for * very * large data sets <nl> * / <nl> # ifdef AI_OG_USE_HASHING <nl> - / / Use our standard hashing function to compute the hash <nl> - # define AI_OG_GETKEY ( str ) SuperFastHash ( str . data , str . length ) <nl> + / / Use our standard hashing function to compute the hash <nl> + # define AI_OG_GETKEY ( str ) SuperFastHash ( str . data , str . length ) <nl> # else <nl> - / / Otherwise hope that std : : string will utilize a static buffer <nl> - / / for shorter node names . This would avoid endless heap copying . <nl> - # define AI_OG_GETKEY ( str ) std : : string ( str . data ) <nl> + / / Otherwise hope that std : : string will utilize a static buffer <nl> + / / for shorter node names . This would avoid endless heap copying . <nl> + # define AI_OG_GETKEY ( str ) std : : string ( str . data ) <nl> # endif <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Constructor to be privately used by Importer <nl> - OptimizeGraphProcess : : OptimizeGraphProcess ( ) : <nl> - mScene ( ) , <nl> - nodes_in ( ) , <nl> - nodes_out ( ) , <nl> - count_merged ( ) { <nl> - / / empty <nl> + OptimizeGraphProcess : : OptimizeGraphProcess ( ) <nl> + : mScene ( ) <nl> + , nodes_in ( ) <nl> + , nodes_out ( ) <nl> + , count_merged ( ) { <nl> + / / empty <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Destructor , private as well <nl> OptimizeGraphProcess : : ~ OptimizeGraphProcess ( ) { <nl> - / / empty <nl> + / / empty <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Returns whether the processing step is present in the given flag field . <nl> - bool OptimizeGraphProcess : : IsActive ( unsigned int pFlags ) const { <nl> - return ( 0 ! = ( pFlags & aiProcess_OptimizeGraph ) ) ; <nl> + bool OptimizeGraphProcess : : IsActive ( unsigned int pFlags ) const { <nl> + return ( 0 ! = ( pFlags & aiProcess_OptimizeGraph ) ) ; <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Setup properties for the post - processing step <nl> - void OptimizeGraphProcess : : SetupProperties ( const Importer * pImp ) { <nl> - / / Get value of AI_CONFIG_PP_OG_EXCLUDE_LIST <nl> - std : : string tmp = pImp - > GetPropertyString ( AI_CONFIG_PP_OG_EXCLUDE_LIST , " " ) ; <nl> - AddLockedNodeList ( tmp ) ; <nl> + void OptimizeGraphProcess : : SetupProperties ( const Importer * pImp ) { <nl> + / / Get value of AI_CONFIG_PP_OG_EXCLUDE_LIST <nl> + std : : string tmp = pImp - > GetPropertyString ( AI_CONFIG_PP_OG_EXCLUDE_LIST , " " ) ; <nl> + AddLockedNodeList ( tmp ) ; <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Collect new children <nl> - void OptimizeGraphProcess : : CollectNewChildren ( aiNode * nd , std : : list < aiNode * > & nodes ) { <nl> - nodes_in + = nd - > mNumChildren ; <nl> - <nl> - / / Process children <nl> - std : : list < aiNode * > child_nodes ; <nl> - for ( unsigned int i = 0 ; i < nd - > mNumChildren ; + + i ) { <nl> - CollectNewChildren ( nd - > mChildren [ i ] , child_nodes ) ; <nl> - nd - > mChildren [ i ] = nullptr ; <nl> - } <nl> - <nl> - / / Check whether we need this node ; if not we can replace it by our own children ( warn , danger of incest ) . <nl> - if ( locked . find ( AI_OG_GETKEY ( nd - > mName ) ) = = locked . end ( ) ) { <nl> - for ( std : : list < aiNode * > : : iterator it = child_nodes . begin ( ) ; it ! = child_nodes . end ( ) ; ) { <nl> - <nl> - if ( locked . find ( AI_OG_GETKEY ( ( * it ) - > mName ) ) = = locked . end ( ) ) { <nl> - ( * it ) - > mTransformation = nd - > mTransformation * ( * it ) - > mTransformation ; <nl> - nodes . push_back ( * it ) ; <nl> - <nl> - it = child_nodes . erase ( it ) ; <nl> - continue ; <nl> - } <nl> - + + it ; <nl> - } <nl> - <nl> - if ( nd - > mNumMeshes | | ! child_nodes . empty ( ) ) { <nl> - nodes . push_back ( nd ) ; <nl> - } else { <nl> - delete nd ; / * bye , node * / <nl> - return ; <nl> - } <nl> - } else { <nl> - <nl> - / / Retain our current position in the hierarchy <nl> - nodes . push_back ( nd ) ; <nl> - <nl> - / / Now check for possible optimizations in our list of child nodes . join as many as possible <nl> - aiNode * join_master = nullptr ; <nl> - aiMatrix4x4 inv ; <nl> - <nl> - const LockedSetType : : const_iterator end = locked . end ( ) ; <nl> - <nl> - std : : list < aiNode * > join ; <nl> - for ( std : : list < aiNode * > : : iterator it = child_nodes . begin ( ) ; it ! = child_nodes . end ( ) ; ) { <nl> - aiNode * child = * it ; <nl> - if ( child - > mNumChildren = = 0 & & locked . find ( AI_OG_GETKEY ( child - > mName ) ) = = end ) { <nl> - <nl> - / / There may be no instanced meshes <nl> - unsigned int n = 0 ; <nl> - for ( ; n < child - > mNumMeshes ; + + n ) { <nl> - if ( meshes [ child - > mMeshes [ n ] ] > 1 ) { <nl> - break ; <nl> - } <nl> - } <nl> - if ( n = = child - > mNumMeshes ) { <nl> - if ( ! join_master ) { <nl> - join_master = child ; <nl> - inv = join_master - > mTransformation ; <nl> - inv . Inverse ( ) ; <nl> - } else { <nl> - child - > mTransformation = inv * child - > mTransformation ; <nl> - <nl> - join . push_back ( child ) ; <nl> - it = child_nodes . erase ( it ) ; <nl> - continue ; <nl> - } <nl> - } <nl> - } <nl> - + + it ; <nl> - } <nl> - if ( join_master & & ! join . empty ( ) ) { <nl> - join_master - > mName . length = : : ai_snprintf ( join_master - > mName . data , MAXLEN , " $ MergedNode_ % i " , count_merged + + ) ; <nl> - <nl> - unsigned int out_meshes = 0 ; <nl> - for ( std : : list < aiNode * > : : const_iterator it = join . cbegin ( ) ; it ! = join . cend ( ) ; + + it ) { <nl> - out_meshes + = ( * it ) - > mNumMeshes ; <nl> - } <nl> - <nl> - / / copy all mesh references in one array <nl> - if ( out_meshes ) { <nl> - unsigned int * meshes = new unsigned int [ out_meshes + join_master - > mNumMeshes ] , * tmp = meshes ; <nl> - for ( unsigned int n = 0 ; n < join_master - > mNumMeshes ; + + n ) { <nl> - * tmp + + = join_master - > mMeshes [ n ] ; <nl> - } <nl> - <nl> - for ( const aiNode * join_node : join ) { <nl> - for ( unsigned int n = 0 ; n < join_node - > mNumMeshes ; + + n ) { <nl> - <nl> - * tmp = join_node - > mMeshes [ n ] ; <nl> - aiMesh * mesh = mScene - > mMeshes [ * tmp + + ] ; <nl> - <nl> - / / Assume the transformation is affine <nl> - / / manually move the mesh into the right coordinate system <nl> - <nl> - / / Check for odd negative scale ( mirror ) <nl> - if ( join_node - > mTransformation . Determinant ( ) < 0 ) { <nl> - / / Reverse the mesh face winding order <nl> - FlipWindingOrderProcess : : ProcessMesh ( mesh ) ; <nl> - } <nl> - <nl> - / / Update positions , normals and tangents <nl> - const aiMatrix3x3 IT = aiMatrix3x3 ( join_node - > mTransformation ) . Inverse ( ) . Transpose ( ) ; <nl> - for ( unsigned int a = 0 ; a < mesh - > mNumVertices ; + + a ) { <nl> - <nl> - mesh - > mVertices [ a ] * = join_node - > mTransformation ; <nl> - <nl> - if ( mesh - > HasNormals ( ) ) <nl> - mesh - > mNormals [ a ] * = IT ; <nl> - <nl> - if ( mesh - > HasTangentsAndBitangents ( ) ) { <nl> - mesh - > mTangents [ a ] * = IT ; <nl> - mesh - > mBitangents [ a ] * = IT ; <nl> - } <nl> - } <nl> - } <nl> - delete join_node ; / / bye , node <nl> - } <nl> - delete [ ] join_master - > mMeshes ; <nl> - join_master - > mMeshes = meshes ; <nl> - join_master - > mNumMeshes + = out_meshes ; <nl> - } <nl> - } <nl> - } <nl> - / / reassign children if something changed <nl> - if ( child_nodes . empty ( ) | | child_nodes . size ( ) > nd - > mNumChildren ) { <nl> - <nl> - delete [ ] nd - > mChildren ; <nl> - <nl> - if ( ! child_nodes . empty ( ) ) { <nl> - nd - > mChildren = new aiNode * [ child_nodes . size ( ) ] ; <nl> - } else <nl> - nd - > mChildren = nullptr ; <nl> - } <nl> - <nl> - nd - > mNumChildren = static_cast < unsigned int > ( child_nodes . size ( ) ) ; <nl> - <nl> - if ( nd - > mChildren ) { <nl> - aiNode * * tmp = nd - > mChildren ; <nl> - for ( std : : list < aiNode * > : : iterator it = child_nodes . begin ( ) ; it ! = child_nodes . end ( ) ; + + it ) { <nl> - aiNode * node = * tmp + + = * it ; <nl> - node - > mParent = nd ; <nl> - } <nl> - } <nl> - <nl> - nodes_out + = static_cast < unsigned int > ( child_nodes . size ( ) ) ; <nl> + void OptimizeGraphProcess : : CollectNewChildren ( aiNode * nd , std : : list < aiNode * > & nodes ) { <nl> + nodes_in + = nd - > mNumChildren ; <nl> + <nl> + / / Process children <nl> + std : : list < aiNode * > child_nodes ; <nl> + for ( unsigned int i = 0 ; i < nd - > mNumChildren ; + + i ) { <nl> + CollectNewChildren ( nd - > mChildren [ i ] , child_nodes ) ; <nl> + nd - > mChildren [ i ] = nullptr ; <nl> + } <nl> + <nl> + / / Check whether we need this node ; if not we can replace it by our own children ( warn , danger of incest ) . <nl> + if ( locked . find ( AI_OG_GETKEY ( nd - > mName ) ) = = locked . end ( ) ) { <nl> + for ( std : : list < aiNode * > : : iterator it = child_nodes . begin ( ) ; it ! = child_nodes . end ( ) ; ) { <nl> + <nl> + if ( locked . find ( AI_OG_GETKEY ( ( * it ) - > mName ) ) = = locked . end ( ) ) { <nl> + ( * it ) - > mTransformation = nd - > mTransformation * ( * it ) - > mTransformation ; <nl> + nodes . push_back ( * it ) ; <nl> + <nl> + it = child_nodes . erase ( it ) ; <nl> + continue ; <nl> + } <nl> + + + it ; <nl> + } <nl> + <nl> + if ( nd - > mNumMeshes | | ! child_nodes . empty ( ) ) { <nl> + nodes . push_back ( nd ) ; <nl> + } else { <nl> + delete nd ; / * bye , node * / <nl> + return ; <nl> + } <nl> + } else { <nl> + <nl> + / / Retain our current position in the hierarchy <nl> + nodes . push_back ( nd ) ; <nl> + <nl> + / / Now check for possible optimizations in our list of child nodes . join as many as possible <nl> + aiNode * join_master = NULL ; <nl> + aiMatrix4x4 inv ; <nl> + <nl> + const LockedSetType : : const_iterator end = locked . end ( ) ; <nl> + <nl> + std : : list < aiNode * > join ; <nl> + for ( std : : list < aiNode * > : : iterator it = child_nodes . begin ( ) ; it ! = child_nodes . end ( ) ; ) { <nl> + aiNode * child = * it ; <nl> + if ( child - > mNumChildren = = 0 & & locked . find ( AI_OG_GETKEY ( child - > mName ) ) = = end ) { <nl> + <nl> + / / There may be no instanced meshes <nl> + unsigned int n = 0 ; <nl> + for ( ; n < child - > mNumMeshes ; + + n ) { <nl> + if ( meshes [ child - > mMeshes [ n ] ] > 1 ) { <nl> + break ; <nl> + } <nl> + } <nl> + if ( n = = child - > mNumMeshes ) { <nl> + if ( ! join_master ) { <nl> + join_master = child ; <nl> + inv = join_master - > mTransformation ; <nl> + inv . Inverse ( ) ; <nl> + } else { <nl> + child - > mTransformation = inv * child - > mTransformation ; <nl> + <nl> + join . push_back ( child ) ; <nl> + it = child_nodes . erase ( it ) ; <nl> + continue ; <nl> + } <nl> + } <nl> + } <nl> + + + it ; <nl> + } <nl> + if ( join_master & & ! join . empty ( ) ) { <nl> + join_master - > mName . length = : : ai_snprintf ( join_master - > mName . data , MAXLEN , " $ MergedNode_ % i " , count_merged + + ) ; <nl> + <nl> + unsigned int out_meshes = 0 ; <nl> + for ( std : : list < aiNode * > : : iterator it = join . begin ( ) ; it ! = join . end ( ) ; + + it ) { <nl> + out_meshes + = ( * it ) - > mNumMeshes ; <nl> + } <nl> + <nl> + / / copy all mesh references in one array <nl> + if ( out_meshes ) { <nl> + unsigned int * meshes = new unsigned int [ out_meshes + join_master - > mNumMeshes ] , * tmp = meshes ; <nl> + for ( unsigned int n = 0 ; n < join_master - > mNumMeshes ; + + n ) { <nl> + * tmp + + = join_master - > mMeshes [ n ] ; <nl> + } <nl> + <nl> + for ( std : : list < aiNode * > : : iterator it = join . begin ( ) ; it ! = join . end ( ) ; + + it ) { <nl> + for ( unsigned int n = 0 ; n < ( * it ) - > mNumMeshes ; + + n ) { <nl> + <nl> + * tmp = ( * it ) - > mMeshes [ n ] ; <nl> + aiMesh * mesh = mScene - > mMeshes [ * tmp + + ] ; <nl> + <nl> + / / manually move the mesh into the right coordinate system <nl> + const aiMatrix3x3 IT = aiMatrix3x3 ( ( * it ) - > mTransformation ) . Inverse ( ) . Transpose ( ) ; <nl> + for ( unsigned int a = 0 ; a < mesh - > mNumVertices ; + + a ) { <nl> + <nl> + mesh - > mVertices [ a ] * = ( * it ) - > mTransformation ; <nl> + <nl> + if ( mesh - > HasNormals ( ) ) <nl> + mesh - > mNormals [ a ] * = IT ; <nl> + <nl> + if ( mesh - > HasTangentsAndBitangents ( ) ) { <nl> + mesh - > mTangents [ a ] * = IT ; <nl> + mesh - > mBitangents [ a ] * = IT ; <nl> + } <nl> + } <nl> + } <nl> + delete * it ; / / bye , node <nl> + } <nl> + delete [ ] join_master - > mMeshes ; <nl> + join_master - > mMeshes = meshes ; <nl> + join_master - > mNumMeshes + = out_meshes ; <nl> + } <nl> + } <nl> + } <nl> + / / reassign children if something changed <nl> + if ( child_nodes . empty ( ) | | child_nodes . size ( ) > nd - > mNumChildren ) { <nl> + <nl> + delete [ ] nd - > mChildren ; <nl> + <nl> + if ( ! child_nodes . empty ( ) ) { <nl> + nd - > mChildren = new aiNode * [ child_nodes . size ( ) ] ; <nl> + } <nl> + else nd - > mChildren = nullptr ; <nl> + } <nl> + <nl> + nd - > mNumChildren = static_cast < unsigned int > ( child_nodes . size ( ) ) ; <nl> + <nl> + if ( nd - > mChildren ) { <nl> + aiNode * * tmp = nd - > mChildren ; <nl> + for ( std : : list < aiNode * > : : iterator it = child_nodes . begin ( ) ; it ! = child_nodes . end ( ) ; + + it ) { <nl> + aiNode * node = * tmp + + = * it ; <nl> + node - > mParent = nd ; <nl> + } <nl> + } <nl> + <nl> + nodes_out + = static_cast < unsigned int > ( child_nodes . size ( ) ) ; <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Execute the post - processing step on the given scene <nl> - void OptimizeGraphProcess : : Execute ( aiScene * pScene ) { <nl> - ASSIMP_LOG_DEBUG ( " OptimizeGraphProcess begin " ) ; <nl> - nodes_in = nodes_out = count_merged = 0 ; <nl> - mScene = pScene ; <nl> + void OptimizeGraphProcess : : Execute ( aiScene * pScene ) { <nl> + ASSIMP_LOG_DEBUG ( " OptimizeGraphProcess begin " ) ; <nl> + nodes_in = nodes_out = count_merged = 0 ; <nl> + mScene = pScene ; <nl> <nl> - meshes . resize ( pScene - > mNumMeshes , 0 ) ; <nl> - FindInstancedMeshes ( pScene - > mRootNode ) ; <nl> + meshes . resize ( pScene - > mNumMeshes , 0 ) ; <nl> + FindInstancedMeshes ( pScene - > mRootNode ) ; <nl> <nl> - / / build a blacklist of identifiers . If the name of a node matches one of these , we won ' t touch it <nl> - locked . clear ( ) ; <nl> - for ( std : : list < std : : string > : : const_iterator it = locked_nodes . begin ( ) ; it ! = locked_nodes . end ( ) ; + + it ) { <nl> + / / build a blacklist of identifiers . If the name of a node matches one of these , we won ' t touch it <nl> + locked . clear ( ) ; <nl> + for ( std : : list < std : : string > : : const_iterator it = locked_nodes . begin ( ) ; it ! = locked_nodes . end ( ) ; + + it ) { <nl> # ifdef AI_OG_USE_HASHING <nl> - locked . insert ( SuperFastHash ( ( * it ) . c_str ( ) ) ) ; <nl> + locked . insert ( SuperFastHash ( ( * it ) . c_str ( ) ) ) ; <nl> # else <nl> - locked . insert ( * it ) ; <nl> + locked . insert ( * it ) ; <nl> # endif <nl> - } <nl> - <nl> - for ( unsigned int i = 0 ; i < pScene - > mNumAnimations ; + + i ) { <nl> - for ( unsigned int a = 0 ; a < pScene - > mAnimations [ i ] - > mNumChannels ; + + a ) { <nl> - aiNodeAnim * anim = pScene - > mAnimations [ i ] - > mChannels [ a ] ; <nl> - locked . insert ( AI_OG_GETKEY ( anim - > mNodeName ) ) ; <nl> - } <nl> - } <nl> - <nl> - for ( unsigned int i = 0 ; i < pScene - > mNumMeshes ; + + i ) { <nl> - for ( unsigned int a = 0 ; a < pScene - > mMeshes [ i ] - > mNumBones ; + + a ) { <nl> - <nl> - aiBone * bone = pScene - > mMeshes [ i ] - > mBones [ a ] ; <nl> - locked . insert ( AI_OG_GETKEY ( bone - > mName ) ) ; <nl> - <nl> - / / HACK : Meshes referencing bones may not be transformed ; we need to look them . <nl> - / / The easiest way to do this is to increase their reference counters . . . <nl> - meshes [ i ] + = 2 ; <nl> - } <nl> - } <nl> - <nl> - for ( unsigned int i = 0 ; i < pScene - > mNumCameras ; + + i ) { <nl> - aiCamera * cam = pScene - > mCameras [ i ] ; <nl> - locked . insert ( AI_OG_GETKEY ( cam - > mName ) ) ; <nl> - } <nl> - <nl> - for ( unsigned int i = 0 ; i < pScene - > mNumLights ; + + i ) { <nl> - aiLight * lgh = pScene - > mLights [ i ] ; <nl> - locked . insert ( AI_OG_GETKEY ( lgh - > mName ) ) ; <nl> - } <nl> - <nl> - / / Insert a dummy master node and make it read - only <nl> - aiNode * dummy_root = new aiNode ( AI_RESERVED_NODE_NAME ) ; <nl> - locked . insert ( AI_OG_GETKEY ( dummy_root - > mName ) ) ; <nl> - <nl> - const aiString prev = pScene - > mRootNode - > mName ; <nl> - pScene - > mRootNode - > mParent = dummy_root ; <nl> - <nl> - dummy_root - > mChildren = new aiNode * [ dummy_root - > mNumChildren = 1 ] ; <nl> - dummy_root - > mChildren [ 0 ] = pScene - > mRootNode ; <nl> - <nl> - / / Do our recursive processing of scenegraph nodes . For each node collect <nl> - / / a fully new list of children and allow their children to place themselves <nl> - / / on the same hierarchy layer as their parents . <nl> - std : : list < aiNode * > nodes ; <nl> - CollectNewChildren ( dummy_root , nodes ) ; <nl> - <nl> - ai_assert ( nodes . size ( ) = = 1 ) ; <nl> - <nl> - if ( dummy_root - > mNumChildren = = 0 ) { <nl> - pScene - > mRootNode = nullptr ; <nl> - throw DeadlyImportError ( " After optimizing the scene graph , no data remains " ) ; <nl> - } <nl> - <nl> - if ( dummy_root - > mNumChildren > 1 ) { <nl> - pScene - > mRootNode = dummy_root ; <nl> - <nl> - / / Keep the dummy node but assign the name of the old root node to it <nl> - pScene - > mRootNode - > mName = prev ; <nl> - } else { <nl> - <nl> - / / Remove the dummy root node again . <nl> - pScene - > mRootNode = dummy_root - > mChildren [ 0 ] ; <nl> - <nl> - dummy_root - > mChildren [ 0 ] = nullptr ; <nl> - delete dummy_root ; <nl> - } <nl> - <nl> - pScene - > mRootNode - > mParent = nullptr ; <nl> - if ( ! DefaultLogger : : isNullLogger ( ) ) { <nl> - if ( nodes_in ! = nodes_out ) { <nl> - ASSIMP_LOG_INFO_F ( " OptimizeGraphProcess finished ; Input nodes : " , nodes_in , " , Output nodes : " , nodes_out ) ; <nl> - } else { <nl> - ASSIMP_LOG_DEBUG ( " OptimizeGraphProcess finished " ) ; <nl> - } <nl> - } <nl> - meshes . clear ( ) ; <nl> - locked . clear ( ) ; <nl> + } <nl> + <nl> + for ( unsigned int i = 0 ; i < pScene - > mNumAnimations ; + + i ) { <nl> + for ( unsigned int a = 0 ; a < pScene - > mAnimations [ i ] - > mNumChannels ; + + a ) { <nl> + aiNodeAnim * anim = pScene - > mAnimations [ i ] - > mChannels [ a ] ; <nl> + locked . insert ( AI_OG_GETKEY ( anim - > mNodeName ) ) ; <nl> + } <nl> + } <nl> + <nl> + for ( unsigned int i = 0 ; i < pScene - > mNumMeshes ; + + i ) { <nl> + for ( unsigned int a = 0 ; a < pScene - > mMeshes [ i ] - > mNumBones ; + + a ) { <nl> + <nl> + aiBone * bone = pScene - > mMeshes [ i ] - > mBones [ a ] ; <nl> + locked . insert ( AI_OG_GETKEY ( bone - > mName ) ) ; <nl> + <nl> + / / HACK : Meshes referencing bones may not be transformed ; we need to look them . <nl> + / / The easiest way to do this is to increase their reference counters . . . <nl> + meshes [ i ] + = 2 ; <nl> + } <nl> + } <nl> + <nl> + for ( unsigned int i = 0 ; i < pScene - > mNumCameras ; + + i ) { <nl> + aiCamera * cam = pScene - > mCameras [ i ] ; <nl> + locked . insert ( AI_OG_GETKEY ( cam - > mName ) ) ; <nl> + } <nl> + <nl> + for ( unsigned int i = 0 ; i < pScene - > mNumLights ; + + i ) { <nl> + aiLight * lgh = pScene - > mLights [ i ] ; <nl> + locked . insert ( AI_OG_GETKEY ( lgh - > mName ) ) ; <nl> + } <nl> + <nl> + / / Insert a dummy master node and make it read - only <nl> + aiNode * dummy_root = new aiNode ( AI_RESERVED_NODE_NAME ) ; <nl> + locked . insert ( AI_OG_GETKEY ( dummy_root - > mName ) ) ; <nl> + <nl> + const aiString prev = pScene - > mRootNode - > mName ; <nl> + pScene - > mRootNode - > mParent = dummy_root ; <nl> + <nl> + dummy_root - > mChildren = new aiNode * [ dummy_root - > mNumChildren = 1 ] ; <nl> + dummy_root - > mChildren [ 0 ] = pScene - > mRootNode ; <nl> + <nl> + / / Do our recursive processing of scenegraph nodes . For each node collect <nl> + / / a fully new list of children and allow their children to place themselves <nl> + / / on the same hierarchy layer as their parents . <nl> + std : : list < aiNode * > nodes ; <nl> + CollectNewChildren ( dummy_root , nodes ) ; <nl> + <nl> + ai_assert ( nodes . size ( ) = = 1 ) ; <nl> + <nl> + if ( dummy_root - > mNumChildren = = 0 ) { <nl> + pScene - > mRootNode = NULL ; <nl> + throw DeadlyImportError ( " After optimizing the scene graph , no data remains " ) ; <nl> + } <nl> + <nl> + if ( dummy_root - > mNumChildren > 1 ) { <nl> + pScene - > mRootNode = dummy_root ; <nl> + <nl> + / / Keep the dummy node but assign the name of the old root node to it <nl> + pScene - > mRootNode - > mName = prev ; <nl> + } <nl> + else { <nl> + <nl> + / / Remove the dummy root node again . <nl> + pScene - > mRootNode = dummy_root - > mChildren [ 0 ] ; <nl> + <nl> + dummy_root - > mChildren [ 0 ] = NULL ; <nl> + delete dummy_root ; <nl> + } <nl> + <nl> + pScene - > mRootNode - > mParent = NULL ; <nl> + if ( ! DefaultLogger : : isNullLogger ( ) ) { <nl> + if ( nodes_in ! = nodes_out ) { <nl> + ASSIMP_LOG_INFO_F ( " OptimizeGraphProcess finished ; Input nodes : " , nodes_in , " , Output nodes : " , nodes_out ) ; <nl> + } else { <nl> + ASSIMP_LOG_DEBUG ( " OptimizeGraphProcess finished " ) ; <nl> + } <nl> + } <nl> + meshes . clear ( ) ; <nl> + locked . clear ( ) ; <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Build a LUT of all instanced meshes <nl> - void OptimizeGraphProcess : : FindInstancedMeshes ( aiNode * pNode ) { <nl> - for ( unsigned int i = 0 ; i < pNode - > mNumMeshes ; + + i ) { <nl> - + + meshes [ pNode - > mMeshes [ i ] ] ; <nl> - } <nl> - <nl> - for ( unsigned int i = 0 ; i < pNode - > mNumChildren ; + + i ) <nl> - FindInstancedMeshes ( pNode - > mChildren [ i ] ) ; <nl> + void OptimizeGraphProcess : : FindInstancedMeshes ( aiNode * pNode ) <nl> + { <nl> + for ( unsigned int i = 0 ; i < pNode - > mNumMeshes ; + + i ) { <nl> + + + meshes [ pNode - > mMeshes [ i ] ] ; <nl> + } <nl> + <nl> + for ( unsigned int i = 0 ; i < pNode - > mNumChildren ; + + i ) <nl> + FindInstancedMeshes ( pNode - > mChildren [ i ] ) ; <nl> } <nl> <nl> # endif / / ! ! ASSIMP_BUILD_NO_OPTIMIZEGRAPH_PROCESS <nl> mmm a / thirdparty / assimp / code / PostProcessing / OptimizeGraph . h <nl> ppp b / thirdparty / assimp / code / PostProcessing / OptimizeGraph . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> class OptimizeGraphProcess : public BaseProcess { <nl> ~ OptimizeGraphProcess ( ) ; <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - bool IsActive ( unsigned int pFlags ) const override ; <nl> + bool IsActive ( unsigned int pFlags ) const ; <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - void Execute ( aiScene * pScene ) override ; <nl> + void Execute ( aiScene * pScene ) ; <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - void SetupProperties ( const Importer * pImp ) override ; <nl> + void SetupProperties ( const Importer * pImp ) ; <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> / * * @ brief Add a list of node names to be locked and not modified . <nl> mmm a / thirdparty / assimp / code / PostProcessing / OptimizeMeshes . cpp <nl> ppp b / thirdparty / assimp / code / PostProcessing / OptimizeMeshes . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / code / PostProcessing / OptimizeMeshes . h <nl> ppp b / thirdparty / assimp / code / PostProcessing / OptimizeMeshes . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / PostProcessing / PretransformVertices . cpp <nl> ppp b / thirdparty / assimp / code / PostProcessing / PretransformVertices . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> * @ brief Implementation of the " PretransformVertices " post processing step <nl> * / <nl> <nl> + <nl> # include " PretransformVertices . h " <nl> - # include " ConvertToLHProcess . h " <nl> # include " ProcessHelper . h " <nl> - # include < assimp / Exceptional . h > <nl> # include < assimp / SceneCombiner . h > <nl> + # include < assimp / Exceptional . h > <nl> <nl> using namespace Assimp ; <nl> <nl> using namespace Assimp ; <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Constructor to be privately used by Importer <nl> - PretransformVertices : : PretransformVertices ( ) : <nl> - configKeepHierarchy ( false ) , <nl> - configNormalize ( false ) , <nl> - configTransform ( false ) , <nl> - configTransformation ( ) , <nl> - mConfigPointCloud ( false ) { <nl> - / / empty <nl> + PretransformVertices : : PretransformVertices ( ) <nl> + : configKeepHierarchy ( false ) <nl> + , configNormalize ( false ) <nl> + , configTransform ( false ) <nl> + , configTransformation ( ) <nl> + , mConfigPointCloud ( false ) { <nl> + / / empty <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Destructor , private as well <nl> PretransformVertices : : ~ PretransformVertices ( ) { <nl> - / / nothing to do here <nl> + / / nothing to do here <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Returns whether the processing step is present in the given flag field . <nl> - bool PretransformVertices : : IsActive ( unsigned int pFlags ) const { <nl> - return ( pFlags & aiProcess_PreTransformVertices ) ! = 0 ; <nl> + bool PretransformVertices : : IsActive ( unsigned int pFlags ) const <nl> + { <nl> + return ( pFlags & aiProcess_PreTransformVertices ) ! = 0 ; <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Setup import configuration <nl> - void PretransformVertices : : SetupProperties ( const Importer * pImp ) { <nl> - / / Get the current value of AI_CONFIG_PP_PTV_KEEP_HIERARCHY , AI_CONFIG_PP_PTV_NORMALIZE , <nl> - / / AI_CONFIG_PP_PTV_ADD_ROOT_TRANSFORMATION and AI_CONFIG_PP_PTV_ROOT_TRANSFORMATION <nl> - configKeepHierarchy = ( 0 ! = pImp - > GetPropertyInteger ( AI_CONFIG_PP_PTV_KEEP_HIERARCHY , 0 ) ) ; <nl> - configNormalize = ( 0 ! = pImp - > GetPropertyInteger ( AI_CONFIG_PP_PTV_NORMALIZE , 0 ) ) ; <nl> - configTransform = ( 0 ! = pImp - > GetPropertyInteger ( AI_CONFIG_PP_PTV_ADD_ROOT_TRANSFORMATION , 0 ) ) ; <nl> + void PretransformVertices : : SetupProperties ( const Importer * pImp ) <nl> + { <nl> + / / Get the current value of AI_CONFIG_PP_PTV_KEEP_HIERARCHY , AI_CONFIG_PP_PTV_NORMALIZE , <nl> + / / AI_CONFIG_PP_PTV_ADD_ROOT_TRANSFORMATION and AI_CONFIG_PP_PTV_ROOT_TRANSFORMATION <nl> + configKeepHierarchy = ( 0 ! = pImp - > GetPropertyInteger ( AI_CONFIG_PP_PTV_KEEP_HIERARCHY , 0 ) ) ; <nl> + configNormalize = ( 0 ! = pImp - > GetPropertyInteger ( AI_CONFIG_PP_PTV_NORMALIZE , 0 ) ) ; <nl> + configTransform = ( 0 ! = pImp - > GetPropertyInteger ( AI_CONFIG_PP_PTV_ADD_ROOT_TRANSFORMATION , 0 ) ) ; <nl> <nl> - configTransformation = pImp - > GetPropertyMatrix ( AI_CONFIG_PP_PTV_ROOT_TRANSFORMATION , aiMatrix4x4 ( ) ) ; <nl> + configTransformation = pImp - > GetPropertyMatrix ( AI_CONFIG_PP_PTV_ROOT_TRANSFORMATION , aiMatrix4x4 ( ) ) ; <nl> <nl> - mConfigPointCloud = pImp - > GetPropertyBool ( AI_CONFIG_EXPORT_POINT_CLOUDS ) ; <nl> + mConfigPointCloud = pImp - > GetPropertyBool ( AI_CONFIG_EXPORT_POINT_CLOUDS ) ; <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Count the number of nodes <nl> - unsigned int PretransformVertices : : CountNodes ( const aiNode * pcNode ) const { <nl> - unsigned int iRet = 1 ; <nl> - for ( unsigned int i = 0 ; i < pcNode - > mNumChildren ; + + i ) { <nl> - iRet + = CountNodes ( pcNode - > mChildren [ i ] ) ; <nl> - } <nl> - return iRet ; <nl> + unsigned int PretransformVertices : : CountNodes ( aiNode * pcNode ) <nl> + { <nl> + unsigned int iRet = 1 ; <nl> + for ( unsigned int i = 0 ; i < pcNode - > mNumChildren ; + + i ) <nl> + { <nl> + iRet + = CountNodes ( pcNode - > mChildren [ i ] ) ; <nl> + } <nl> + return iRet ; <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Get a bitwise combination identifying the vertex format of a mesh <nl> - unsigned int PretransformVertices : : GetMeshVFormat ( aiMesh * pcMesh ) const { <nl> - / / the vertex format is stored in aiMesh : : mBones for later retrieval . <nl> - / / there isn ' t a good reason to compute it a few hundred times <nl> - / / from scratch . The pointer is unused as animations are lost <nl> - / / during PretransformVertices . <nl> - if ( pcMesh - > mBones ) <nl> - return ( unsigned int ) ( uint64_t ) pcMesh - > mBones ; <nl> - <nl> - const unsigned int iRet = GetMeshVFormatUnique ( pcMesh ) ; <nl> - <nl> - / / store the value for later use <nl> - pcMesh - > mBones = ( aiBone * * ) ( uint64_t ) iRet ; <nl> - return iRet ; <nl> + unsigned int PretransformVertices : : GetMeshVFormat ( aiMesh * pcMesh ) <nl> + { <nl> + / / the vertex format is stored in aiMesh : : mBones for later retrieval . <nl> + / / there isn ' t a good reason to compute it a few hundred times <nl> + / / from scratch . The pointer is unused as animations are lost <nl> + / / during PretransformVertices . <nl> + if ( pcMesh - > mBones ) <nl> + return ( unsigned int ) ( uint64_t ) pcMesh - > mBones ; <nl> + <nl> + <nl> + const unsigned int iRet = GetMeshVFormatUnique ( pcMesh ) ; <nl> + <nl> + / / store the value for later use <nl> + pcMesh - > mBones = ( aiBone * * ) ( uint64_t ) iRet ; <nl> + return iRet ; <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Count the number of vertices in the whole scene and a given <nl> / / material index <nl> - void PretransformVertices : : CountVerticesAndFaces ( const aiScene * pcScene , const aiNode * pcNode , unsigned int iMat , <nl> - unsigned int iVFormat , unsigned int * piFaces , unsigned int * piVertices ) const { <nl> - for ( unsigned int i = 0 ; i < pcNode - > mNumMeshes ; + + i ) { <nl> - aiMesh * pcMesh = pcScene - > mMeshes [ pcNode - > mMeshes [ i ] ] ; <nl> - if ( iMat = = pcMesh - > mMaterialIndex & & iVFormat = = GetMeshVFormat ( pcMesh ) ) { <nl> - * piVertices + = pcMesh - > mNumVertices ; <nl> - * piFaces + = pcMesh - > mNumFaces ; <nl> - } <nl> - } <nl> - for ( unsigned int i = 0 ; i < pcNode - > mNumChildren ; + + i ) { <nl> - CountVerticesAndFaces ( pcScene , pcNode - > mChildren [ i ] , iMat , <nl> - iVFormat , piFaces , piVertices ) ; <nl> - } <nl> + void PretransformVertices : : CountVerticesAndFaces ( aiScene * pcScene , aiNode * pcNode , unsigned int iMat , <nl> + unsigned int iVFormat , unsigned int * piFaces , unsigned int * piVertices ) <nl> + { <nl> + for ( unsigned int i = 0 ; i < pcNode - > mNumMeshes ; + + i ) <nl> + { <nl> + aiMesh * pcMesh = pcScene - > mMeshes [ pcNode - > mMeshes [ i ] ] ; <nl> + if ( iMat = = pcMesh - > mMaterialIndex & & iVFormat = = GetMeshVFormat ( pcMesh ) ) <nl> + { <nl> + * piVertices + = pcMesh - > mNumVertices ; <nl> + * piFaces + = pcMesh - > mNumFaces ; <nl> + } <nl> + } <nl> + for ( unsigned int i = 0 ; i < pcNode - > mNumChildren ; + + i ) <nl> + { <nl> + CountVerticesAndFaces ( pcScene , pcNode - > mChildren [ i ] , iMat , <nl> + iVFormat , piFaces , piVertices ) ; <nl> + } <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Collect vertex / face data <nl> - void PretransformVertices : : CollectData ( const aiScene * pcScene , const aiNode * pcNode , unsigned int iMat , <nl> - unsigned int iVFormat , aiMesh * pcMeshOut , <nl> - unsigned int aiCurrent [ 2 ] , unsigned int * num_refs ) const { <nl> - / / No need to multiply if there ' s no transformation <nl> - const bool identity = pcNode - > mTransformation . IsIdentity ( ) ; <nl> - for ( unsigned int i = 0 ; i < pcNode - > mNumMeshes ; + + i ) { <nl> - aiMesh * pcMesh = pcScene - > mMeshes [ pcNode - > mMeshes [ i ] ] ; <nl> - if ( iMat = = pcMesh - > mMaterialIndex & & iVFormat = = GetMeshVFormat ( pcMesh ) ) { <nl> - / / Decrement mesh reference counter <nl> - unsigned int & num_ref = num_refs [ pcNode - > mMeshes [ i ] ] ; <nl> - ai_assert ( 0 ! = num_ref ) ; <nl> - - - num_ref ; <nl> - / / Save the name of the last mesh <nl> - if ( num_ref = = 0 ) { <nl> - pcMeshOut - > mName = pcMesh - > mName ; <nl> - } <nl> - <nl> - if ( identity ) { <nl> - / / copy positions without modifying them <nl> - : : memcpy ( pcMeshOut - > mVertices + aiCurrent [ AI_PTVS_VERTEX ] , <nl> - pcMesh - > mVertices , <nl> - pcMesh - > mNumVertices * sizeof ( aiVector3D ) ) ; <nl> - <nl> - if ( iVFormat & 0x2 ) { <nl> - / / copy normals without modifying them <nl> - : : memcpy ( pcMeshOut - > mNormals + aiCurrent [ AI_PTVS_VERTEX ] , <nl> - pcMesh - > mNormals , <nl> - pcMesh - > mNumVertices * sizeof ( aiVector3D ) ) ; <nl> - } <nl> - if ( iVFormat & 0x4 ) { <nl> - / / copy tangents without modifying them <nl> - : : memcpy ( pcMeshOut - > mTangents + aiCurrent [ AI_PTVS_VERTEX ] , <nl> - pcMesh - > mTangents , <nl> - pcMesh - > mNumVertices * sizeof ( aiVector3D ) ) ; <nl> - / / copy bitangents without modifying them <nl> - : : memcpy ( pcMeshOut - > mBitangents + aiCurrent [ AI_PTVS_VERTEX ] , <nl> - pcMesh - > mBitangents , <nl> - pcMesh - > mNumVertices * sizeof ( aiVector3D ) ) ; <nl> - } <nl> - } else { <nl> - / / copy positions , transform them to worldspace <nl> - for ( unsigned int n = 0 ; n < pcMesh - > mNumVertices ; + + n ) { <nl> - pcMeshOut - > mVertices [ aiCurrent [ AI_PTVS_VERTEX ] + n ] = pcNode - > mTransformation * pcMesh - > mVertices [ n ] ; <nl> - } <nl> - aiMatrix4x4 mWorldIT = pcNode - > mTransformation ; <nl> - mWorldIT . Inverse ( ) . Transpose ( ) ; <nl> - <nl> - / / TODO : implement Inverse ( ) for aiMatrix3x3 <nl> - aiMatrix3x3 m = aiMatrix3x3 ( mWorldIT ) ; <nl> - <nl> - if ( iVFormat & 0x2 ) { <nl> - / / copy normals , transform them to worldspace <nl> - for ( unsigned int n = 0 ; n < pcMesh - > mNumVertices ; + + n ) { <nl> - pcMeshOut - > mNormals [ aiCurrent [ AI_PTVS_VERTEX ] + n ] = <nl> - ( m * pcMesh - > mNormals [ n ] ) . Normalize ( ) ; <nl> - } <nl> - } <nl> - if ( iVFormat & 0x4 ) { <nl> - / / copy tangents and bitangents , transform them to worldspace <nl> - for ( unsigned int n = 0 ; n < pcMesh - > mNumVertices ; + + n ) { <nl> - pcMeshOut - > mTangents [ aiCurrent [ AI_PTVS_VERTEX ] + n ] = ( m * pcMesh - > mTangents [ n ] ) . Normalize ( ) ; <nl> - pcMeshOut - > mBitangents [ aiCurrent [ AI_PTVS_VERTEX ] + n ] = ( m * pcMesh - > mBitangents [ n ] ) . Normalize ( ) ; <nl> - } <nl> - } <nl> - } <nl> - unsigned int p = 0 ; <nl> - while ( iVFormat & ( 0x100 < < p ) ) { <nl> - / / copy texture coordinates <nl> - memcpy ( pcMeshOut - > mTextureCoords [ p ] + aiCurrent [ AI_PTVS_VERTEX ] , <nl> - pcMesh - > mTextureCoords [ p ] , <nl> - pcMesh - > mNumVertices * sizeof ( aiVector3D ) ) ; <nl> - + + p ; <nl> - } <nl> - p = 0 ; <nl> - while ( iVFormat & ( 0x1000000 < < p ) ) { <nl> - / / copy vertex colors <nl> - memcpy ( pcMeshOut - > mColors [ p ] + aiCurrent [ AI_PTVS_VERTEX ] , <nl> - pcMesh - > mColors [ p ] , <nl> - pcMesh - > mNumVertices * sizeof ( aiColor4D ) ) ; <nl> - + + p ; <nl> - } <nl> - / / now we need to copy all faces . since we will delete the source mesh afterwards , <nl> - / / we don ' t need to reallocate the array of indices except if this mesh is <nl> - / / referenced multiple times . <nl> - for ( unsigned int planck = 0 ; planck < pcMesh - > mNumFaces ; + + planck ) { <nl> - aiFace & f_src = pcMesh - > mFaces [ planck ] ; <nl> - aiFace & f_dst = pcMeshOut - > mFaces [ aiCurrent [ AI_PTVS_FACE ] + planck ] ; <nl> - <nl> - const unsigned int num_idx = f_src . mNumIndices ; <nl> - <nl> - f_dst . mNumIndices = num_idx ; <nl> - <nl> - unsigned int * pi ; <nl> - if ( ! num_ref ) { / * if last time the mesh is referenced - > no reallocation * / <nl> - pi = f_dst . mIndices = f_src . mIndices ; <nl> - <nl> - / / offset all vertex indices <nl> - for ( unsigned int hahn = 0 ; hahn < num_idx ; + + hahn ) { <nl> - pi [ hahn ] + = aiCurrent [ AI_PTVS_VERTEX ] ; <nl> - } <nl> - } else { <nl> - pi = f_dst . mIndices = new unsigned int [ num_idx ] ; <nl> - <nl> - / / copy and offset all vertex indices <nl> - for ( unsigned int hahn = 0 ; hahn < num_idx ; + + hahn ) { <nl> - pi [ hahn ] = f_src . mIndices [ hahn ] + aiCurrent [ AI_PTVS_VERTEX ] ; <nl> - } <nl> - } <nl> - <nl> - / / Update the mPrimitiveTypes member of the mesh <nl> - switch ( pcMesh - > mFaces [ planck ] . mNumIndices ) { <nl> - case 0x1 : <nl> - pcMeshOut - > mPrimitiveTypes | = aiPrimitiveType_POINT ; <nl> - break ; <nl> - case 0x2 : <nl> - pcMeshOut - > mPrimitiveTypes | = aiPrimitiveType_LINE ; <nl> - break ; <nl> - case 0x3 : <nl> - pcMeshOut - > mPrimitiveTypes | = aiPrimitiveType_TRIANGLE ; <nl> - break ; <nl> - default : <nl> - pcMeshOut - > mPrimitiveTypes | = aiPrimitiveType_POLYGON ; <nl> - break ; <nl> - } ; <nl> - } <nl> - aiCurrent [ AI_PTVS_VERTEX ] + = pcMesh - > mNumVertices ; <nl> - aiCurrent [ AI_PTVS_FACE ] + = pcMesh - > mNumFaces ; <nl> - } <nl> - } <nl> - <nl> - / / append all children of us <nl> - for ( unsigned int i = 0 ; i < pcNode - > mNumChildren ; + + i ) { <nl> - CollectData ( pcScene , pcNode - > mChildren [ i ] , iMat , <nl> - iVFormat , pcMeshOut , aiCurrent , num_refs ) ; <nl> - } <nl> + void PretransformVertices : : CollectData ( aiScene * pcScene , aiNode * pcNode , unsigned int iMat , <nl> + unsigned int iVFormat , aiMesh * pcMeshOut , <nl> + unsigned int aiCurrent [ 2 ] , unsigned int * num_refs ) <nl> + { <nl> + / / No need to multiply if there ' s no transformation <nl> + const bool identity = pcNode - > mTransformation . IsIdentity ( ) ; <nl> + for ( unsigned int i = 0 ; i < pcNode - > mNumMeshes ; + + i ) <nl> + { <nl> + aiMesh * pcMesh = pcScene - > mMeshes [ pcNode - > mMeshes [ i ] ] ; <nl> + if ( iMat = = pcMesh - > mMaterialIndex & & iVFormat = = GetMeshVFormat ( pcMesh ) ) <nl> + { <nl> + / / Decrement mesh reference counter <nl> + unsigned int & num_ref = num_refs [ pcNode - > mMeshes [ i ] ] ; <nl> + ai_assert ( 0 ! = num_ref ) ; <nl> + - - num_ref ; <nl> + / / Save the name of the last mesh <nl> + if ( num_ref = = 0 ) <nl> + { <nl> + pcMeshOut - > mName = pcMesh - > mName ; <nl> + } <nl> + <nl> + if ( identity ) { <nl> + / / copy positions without modifying them <nl> + : : memcpy ( pcMeshOut - > mVertices + aiCurrent [ AI_PTVS_VERTEX ] , <nl> + pcMesh - > mVertices , <nl> + pcMesh - > mNumVertices * sizeof ( aiVector3D ) ) ; <nl> + <nl> + if ( iVFormat & 0x2 ) { <nl> + / / copy normals without modifying them <nl> + : : memcpy ( pcMeshOut - > mNormals + aiCurrent [ AI_PTVS_VERTEX ] , <nl> + pcMesh - > mNormals , <nl> + pcMesh - > mNumVertices * sizeof ( aiVector3D ) ) ; <nl> + } <nl> + if ( iVFormat & 0x4 ) <nl> + { <nl> + / / copy tangents without modifying them <nl> + : : memcpy ( pcMeshOut - > mTangents + aiCurrent [ AI_PTVS_VERTEX ] , <nl> + pcMesh - > mTangents , <nl> + pcMesh - > mNumVertices * sizeof ( aiVector3D ) ) ; <nl> + / / copy bitangents without modifying them <nl> + : : memcpy ( pcMeshOut - > mBitangents + aiCurrent [ AI_PTVS_VERTEX ] , <nl> + pcMesh - > mBitangents , <nl> + pcMesh - > mNumVertices * sizeof ( aiVector3D ) ) ; <nl> + } <nl> + } <nl> + else <nl> + { <nl> + / / copy positions , transform them to worldspace <nl> + for ( unsigned int n = 0 ; n < pcMesh - > mNumVertices ; + + n ) { <nl> + pcMeshOut - > mVertices [ aiCurrent [ AI_PTVS_VERTEX ] + n ] = pcNode - > mTransformation * pcMesh - > mVertices [ n ] ; <nl> + } <nl> + aiMatrix4x4 mWorldIT = pcNode - > mTransformation ; <nl> + mWorldIT . Inverse ( ) . Transpose ( ) ; <nl> + <nl> + / / TODO : implement Inverse ( ) for aiMatrix3x3 <nl> + aiMatrix3x3 m = aiMatrix3x3 ( mWorldIT ) ; <nl> + <nl> + if ( iVFormat & 0x2 ) <nl> + { <nl> + / / copy normals , transform them to worldspace <nl> + for ( unsigned int n = 0 ; n < pcMesh - > mNumVertices ; + + n ) { <nl> + pcMeshOut - > mNormals [ aiCurrent [ AI_PTVS_VERTEX ] + n ] = <nl> + ( m * pcMesh - > mNormals [ n ] ) . Normalize ( ) ; <nl> + } <nl> + } <nl> + if ( iVFormat & 0x4 ) <nl> + { <nl> + / / copy tangents and bitangents , transform them to worldspace <nl> + for ( unsigned int n = 0 ; n < pcMesh - > mNumVertices ; + + n ) { <nl> + pcMeshOut - > mTangents [ aiCurrent [ AI_PTVS_VERTEX ] + n ] = ( m * pcMesh - > mTangents [ n ] ) . Normalize ( ) ; <nl> + pcMeshOut - > mBitangents [ aiCurrent [ AI_PTVS_VERTEX ] + n ] = ( m * pcMesh - > mBitangents [ n ] ) . Normalize ( ) ; <nl> + } <nl> + } <nl> + } <nl> + unsigned int p = 0 ; <nl> + while ( iVFormat & ( 0x100 < < p ) ) <nl> + { <nl> + / / copy texture coordinates <nl> + memcpy ( pcMeshOut - > mTextureCoords [ p ] + aiCurrent [ AI_PTVS_VERTEX ] , <nl> + pcMesh - > mTextureCoords [ p ] , <nl> + pcMesh - > mNumVertices * sizeof ( aiVector3D ) ) ; <nl> + + + p ; <nl> + } <nl> + p = 0 ; <nl> + while ( iVFormat & ( 0x1000000 < < p ) ) <nl> + { <nl> + / / copy vertex colors <nl> + memcpy ( pcMeshOut - > mColors [ p ] + aiCurrent [ AI_PTVS_VERTEX ] , <nl> + pcMesh - > mColors [ p ] , <nl> + pcMesh - > mNumVertices * sizeof ( aiColor4D ) ) ; <nl> + + + p ; <nl> + } <nl> + / / now we need to copy all faces . since we will delete the source mesh afterwards , <nl> + / / we don ' t need to reallocate the array of indices except if this mesh is <nl> + / / referenced multiple times . <nl> + for ( unsigned int planck = 0 ; planck < pcMesh - > mNumFaces ; + + planck ) <nl> + { <nl> + aiFace & f_src = pcMesh - > mFaces [ planck ] ; <nl> + aiFace & f_dst = pcMeshOut - > mFaces [ aiCurrent [ AI_PTVS_FACE ] + planck ] ; <nl> + <nl> + const unsigned int num_idx = f_src . mNumIndices ; <nl> + <nl> + f_dst . mNumIndices = num_idx ; <nl> + <nl> + unsigned int * pi ; <nl> + if ( ! num_ref ) { / * if last time the mesh is referenced - > no reallocation * / <nl> + pi = f_dst . mIndices = f_src . mIndices ; <nl> + <nl> + / / offset all vertex indices <nl> + for ( unsigned int hahn = 0 ; hahn < num_idx ; + + hahn ) { <nl> + pi [ hahn ] + = aiCurrent [ AI_PTVS_VERTEX ] ; <nl> + } <nl> + } <nl> + else { <nl> + pi = f_dst . mIndices = new unsigned int [ num_idx ] ; <nl> + <nl> + / / copy and offset all vertex indices <nl> + for ( unsigned int hahn = 0 ; hahn < num_idx ; + + hahn ) { <nl> + pi [ hahn ] = f_src . mIndices [ hahn ] + aiCurrent [ AI_PTVS_VERTEX ] ; <nl> + } <nl> + } <nl> + <nl> + / / Update the mPrimitiveTypes member of the mesh <nl> + switch ( pcMesh - > mFaces [ planck ] . mNumIndices ) <nl> + { <nl> + case 0x1 : <nl> + pcMeshOut - > mPrimitiveTypes | = aiPrimitiveType_POINT ; <nl> + break ; <nl> + case 0x2 : <nl> + pcMeshOut - > mPrimitiveTypes | = aiPrimitiveType_LINE ; <nl> + break ; <nl> + case 0x3 : <nl> + pcMeshOut - > mPrimitiveTypes | = aiPrimitiveType_TRIANGLE ; <nl> + break ; <nl> + default : <nl> + pcMeshOut - > mPrimitiveTypes | = aiPrimitiveType_POLYGON ; <nl> + break ; <nl> + } ; <nl> + } <nl> + aiCurrent [ AI_PTVS_VERTEX ] + = pcMesh - > mNumVertices ; <nl> + aiCurrent [ AI_PTVS_FACE ] + = pcMesh - > mNumFaces ; <nl> + } <nl> + } <nl> + <nl> + / / append all children of us <nl> + for ( unsigned int i = 0 ; i < pcNode - > mNumChildren ; + + i ) { <nl> + CollectData ( pcScene , pcNode - > mChildren [ i ] , iMat , <nl> + iVFormat , pcMeshOut , aiCurrent , num_refs ) ; <nl> + } <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Get a list of all vertex formats that occur for a given material index <nl> / / The output list contains duplicate elements <nl> - void PretransformVertices : : GetVFormatList ( const aiScene * pcScene , unsigned int iMat , <nl> - std : : list < unsigned int > & aiOut ) const { <nl> - for ( unsigned int i = 0 ; i < pcScene - > mNumMeshes ; + + i ) { <nl> - aiMesh * pcMesh = pcScene - > mMeshes [ i ] ; <nl> - if ( iMat = = pcMesh - > mMaterialIndex ) { <nl> - aiOut . push_back ( GetMeshVFormat ( pcMesh ) ) ; <nl> - } <nl> - } <nl> + void PretransformVertices : : GetVFormatList ( aiScene * pcScene , unsigned int iMat , <nl> + std : : list < unsigned int > & aiOut ) <nl> + { <nl> + for ( unsigned int i = 0 ; i < pcScene - > mNumMeshes ; + + i ) <nl> + { <nl> + aiMesh * pcMesh = pcScene - > mMeshes [ i ] ; <nl> + if ( iMat = = pcMesh - > mMaterialIndex ) { <nl> + aiOut . push_back ( GetMeshVFormat ( pcMesh ) ) ; <nl> + } <nl> + } <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Compute the absolute transformation matrices of each node <nl> - void PretransformVertices : : ComputeAbsoluteTransform ( aiNode * pcNode ) { <nl> - if ( pcNode - > mParent ) { <nl> - pcNode - > mTransformation = pcNode - > mParent - > mTransformation * pcNode - > mTransformation ; <nl> - } <nl> - <nl> - for ( unsigned int i = 0 ; i < pcNode - > mNumChildren ; + + i ) { <nl> - ComputeAbsoluteTransform ( pcNode - > mChildren [ i ] ) ; <nl> - } <nl> + void PretransformVertices : : ComputeAbsoluteTransform ( aiNode * pcNode ) <nl> + { <nl> + if ( pcNode - > mParent ) { <nl> + pcNode - > mTransformation = pcNode - > mParent - > mTransformation * pcNode - > mTransformation ; <nl> + } <nl> + <nl> + for ( unsigned int i = 0 ; i < pcNode - > mNumChildren ; + + i ) { <nl> + ComputeAbsoluteTransform ( pcNode - > mChildren [ i ] ) ; <nl> + } <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Apply the node transformation to a mesh <nl> - void PretransformVertices : : ApplyTransform ( aiMesh * mesh , const aiMatrix4x4 & mat ) const { <nl> - / / Check whether we need to transform the coordinates at all <nl> - if ( ! mat . IsIdentity ( ) ) { <nl> - <nl> - / / Check for odd negative scale ( mirror ) <nl> - if ( mesh - > HasFaces ( ) & & mat . Determinant ( ) < 0 ) { <nl> - / / Reverse the mesh face winding order <nl> - FlipWindingOrderProcess : : ProcessMesh ( mesh ) ; <nl> - } <nl> - <nl> - / / Update positions <nl> - if ( mesh - > HasPositions ( ) ) { <nl> - for ( unsigned int i = 0 ; i < mesh - > mNumVertices ; + + i ) { <nl> - mesh - > mVertices [ i ] = mat * mesh - > mVertices [ i ] ; <nl> - } <nl> - } <nl> - <nl> - / / Update normals and tangents <nl> - if ( mesh - > HasNormals ( ) | | mesh - > HasTangentsAndBitangents ( ) ) { <nl> - const aiMatrix3x3 m = aiMatrix3x3 ( mat ) . Inverse ( ) . Transpose ( ) ; <nl> - <nl> - if ( mesh - > HasNormals ( ) ) { <nl> - for ( unsigned int i = 0 ; i < mesh - > mNumVertices ; + + i ) { <nl> - mesh - > mNormals [ i ] = ( m * mesh - > mNormals [ i ] ) . Normalize ( ) ; <nl> - } <nl> - } <nl> - if ( mesh - > HasTangentsAndBitangents ( ) ) { <nl> - for ( unsigned int i = 0 ; i < mesh - > mNumVertices ; + + i ) { <nl> - mesh - > mTangents [ i ] = ( m * mesh - > mTangents [ i ] ) . Normalize ( ) ; <nl> - mesh - > mBitangents [ i ] = ( m * mesh - > mBitangents [ i ] ) . Normalize ( ) ; <nl> - } <nl> - } <nl> - } <nl> - } <nl> + void PretransformVertices : : ApplyTransform ( aiMesh * mesh , const aiMatrix4x4 & mat ) <nl> + { <nl> + / / Check whether we need to transform the coordinates at all <nl> + if ( ! mat . IsIdentity ( ) ) { <nl> + <nl> + if ( mesh - > HasPositions ( ) ) { <nl> + for ( unsigned int i = 0 ; i < mesh - > mNumVertices ; + + i ) { <nl> + mesh - > mVertices [ i ] = mat * mesh - > mVertices [ i ] ; <nl> + } <nl> + } <nl> + if ( mesh - > HasNormals ( ) | | mesh - > HasTangentsAndBitangents ( ) ) { <nl> + aiMatrix4x4 mWorldIT = mat ; <nl> + mWorldIT . Inverse ( ) . Transpose ( ) ; <nl> + <nl> + / / TODO : implement Inverse ( ) for aiMatrix3x3 <nl> + aiMatrix3x3 m = aiMatrix3x3 ( mWorldIT ) ; <nl> + <nl> + if ( mesh - > HasNormals ( ) ) { <nl> + for ( unsigned int i = 0 ; i < mesh - > mNumVertices ; + + i ) { <nl> + mesh - > mNormals [ i ] = ( m * mesh - > mNormals [ i ] ) . Normalize ( ) ; <nl> + } <nl> + } <nl> + if ( mesh - > HasTangentsAndBitangents ( ) ) { <nl> + for ( unsigned int i = 0 ; i < mesh - > mNumVertices ; + + i ) { <nl> + mesh - > mTangents [ i ] = ( m * mesh - > mTangents [ i ] ) . Normalize ( ) ; <nl> + mesh - > mBitangents [ i ] = ( m * mesh - > mBitangents [ i ] ) . Normalize ( ) ; <nl> + } <nl> + } <nl> + } <nl> + } <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Simple routine to build meshes in worldspace , no further optimization <nl> - void PretransformVertices : : BuildWCSMeshes ( std : : vector < aiMesh * > & out , aiMesh * * in , <nl> - unsigned int numIn , aiNode * node ) const { <nl> - / / NOTE : <nl> - / / aiMesh : : mNumBones store original source mesh , or UINT_MAX if not a copy <nl> - / / aiMesh : : mBones store reference to abs . transform we multiplied with <nl> - <nl> - / / process meshes <nl> - for ( unsigned int i = 0 ; i < node - > mNumMeshes ; + + i ) { <nl> - aiMesh * mesh = in [ node - > mMeshes [ i ] ] ; <nl> - <nl> - / / check whether we can operate on this mesh <nl> - if ( ! mesh - > mBones | | * reinterpret_cast < aiMatrix4x4 * > ( mesh - > mBones ) = = node - > mTransformation ) { <nl> - / / yes , we can . <nl> - mesh - > mBones = reinterpret_cast < aiBone * * > ( & node - > mTransformation ) ; <nl> - mesh - > mNumBones = UINT_MAX ; <nl> - } else { <nl> - <nl> - / / try to find us in the list of newly created meshes <nl> - for ( unsigned int n = 0 ; n < out . size ( ) ; + + n ) { <nl> - aiMesh * ctz = out [ n ] ; <nl> - if ( ctz - > mNumBones = = node - > mMeshes [ i ] & & * reinterpret_cast < aiMatrix4x4 * > ( ctz - > mBones ) = = node - > mTransformation ) { <nl> - <nl> - / / ok , use this one . Update node mesh index <nl> - node - > mMeshes [ i ] = numIn + n ; <nl> - } <nl> - } <nl> - if ( node - > mMeshes [ i ] < numIn ) { <nl> - / / Worst case . Need to operate on a full copy of the mesh <nl> - ASSIMP_LOG_INFO ( " PretransformVertices : Copying mesh due to mismatching transforms " ) ; <nl> - aiMesh * ntz ; <nl> - <nl> - const unsigned int tmp = mesh - > mNumBones ; / / <nl> - mesh - > mNumBones = 0 ; <nl> - SceneCombiner : : Copy ( & ntz , mesh ) ; <nl> - mesh - > mNumBones = tmp ; <nl> - <nl> - ntz - > mNumBones = node - > mMeshes [ i ] ; <nl> - ntz - > mBones = reinterpret_cast < aiBone * * > ( & node - > mTransformation ) ; <nl> - <nl> - out . push_back ( ntz ) ; <nl> - <nl> - node - > mMeshes [ i ] = static_cast < unsigned int > ( numIn + out . size ( ) - 1 ) ; <nl> - } <nl> - } <nl> - } <nl> - <nl> - / / call children <nl> - for ( unsigned int i = 0 ; i < node - > mNumChildren ; + + i ) <nl> - BuildWCSMeshes ( out , in , numIn , node - > mChildren [ i ] ) ; <nl> + void PretransformVertices : : BuildWCSMeshes ( std : : vector < aiMesh * > & out , aiMesh * * in , <nl> + unsigned int numIn , aiNode * node ) <nl> + { <nl> + / / NOTE : <nl> + / / aiMesh : : mNumBones store original source mesh , or UINT_MAX if not a copy <nl> + / / aiMesh : : mBones store reference to abs . transform we multiplied with <nl> + <nl> + / / process meshes <nl> + for ( unsigned int i = 0 ; i < node - > mNumMeshes ; + + i ) { <nl> + aiMesh * mesh = in [ node - > mMeshes [ i ] ] ; <nl> + <nl> + / / check whether we can operate on this mesh <nl> + if ( ! mesh - > mBones | | * reinterpret_cast < aiMatrix4x4 * > ( mesh - > mBones ) = = node - > mTransformation ) { <nl> + / / yes , we can . <nl> + mesh - > mBones = reinterpret_cast < aiBone * * > ( & node - > mTransformation ) ; <nl> + mesh - > mNumBones = UINT_MAX ; <nl> + } <nl> + else { <nl> + <nl> + / / try to find us in the list of newly created meshes <nl> + for ( unsigned int n = 0 ; n < out . size ( ) ; + + n ) { <nl> + aiMesh * ctz = out [ n ] ; <nl> + if ( ctz - > mNumBones = = node - > mMeshes [ i ] & & * reinterpret_cast < aiMatrix4x4 * > ( ctz - > mBones ) = = node - > mTransformation ) { <nl> + <nl> + / / ok , use this one . Update node mesh index <nl> + node - > mMeshes [ i ] = numIn + n ; <nl> + } <nl> + } <nl> + if ( node - > mMeshes [ i ] < numIn ) { <nl> + / / Worst case . Need to operate on a full copy of the mesh <nl> + ASSIMP_LOG_INFO ( " PretransformVertices : Copying mesh due to mismatching transforms " ) ; <nl> + aiMesh * ntz ; <nl> + <nl> + const unsigned int tmp = mesh - > mNumBones ; / / <nl> + mesh - > mNumBones = 0 ; <nl> + SceneCombiner : : Copy ( & ntz , mesh ) ; <nl> + mesh - > mNumBones = tmp ; <nl> + <nl> + ntz - > mNumBones = node - > mMeshes [ i ] ; <nl> + ntz - > mBones = reinterpret_cast < aiBone * * > ( & node - > mTransformation ) ; <nl> + <nl> + out . push_back ( ntz ) ; <nl> + <nl> + node - > mMeshes [ i ] = static_cast < unsigned int > ( numIn + out . size ( ) - 1 ) ; <nl> + } <nl> + } <nl> + } <nl> + <nl> + / / call children <nl> + for ( unsigned int i = 0 ; i < node - > mNumChildren ; + + i ) <nl> + BuildWCSMeshes ( out , in , numIn , node - > mChildren [ i ] ) ; <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Reset transformation matrices to identity <nl> - void PretransformVertices : : MakeIdentityTransform ( aiNode * nd ) const { <nl> - nd - > mTransformation = aiMatrix4x4 ( ) ; <nl> + void PretransformVertices : : MakeIdentityTransform ( aiNode * nd ) <nl> + { <nl> + nd - > mTransformation = aiMatrix4x4 ( ) ; <nl> <nl> - / / call children <nl> - for ( unsigned int i = 0 ; i < nd - > mNumChildren ; + + i ) <nl> - MakeIdentityTransform ( nd - > mChildren [ i ] ) ; <nl> + / / call children <nl> + for ( unsigned int i = 0 ; i < nd - > mNumChildren ; + + i ) <nl> + MakeIdentityTransform ( nd - > mChildren [ i ] ) ; <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Build reference counters for all meshes <nl> - void PretransformVertices : : BuildMeshRefCountArray ( const aiNode * nd , unsigned int * refs ) const { <nl> - for ( unsigned int i = 0 ; i < nd - > mNumMeshes ; + + i ) <nl> - refs [ nd - > mMeshes [ i ] ] + + ; <nl> - <nl> - / / call children <nl> - for ( unsigned int i = 0 ; i < nd - > mNumChildren ; + + i ) <nl> - BuildMeshRefCountArray ( nd - > mChildren [ i ] , refs ) ; <nl> + void PretransformVertices : : BuildMeshRefCountArray ( aiNode * nd , unsigned int * refs ) <nl> + { <nl> + for ( unsigned int i = 0 ; i < nd - > mNumMeshes ; + + i ) <nl> + refs [ nd - > mMeshes [ i ] ] + + ; <nl> + <nl> + / / call children <nl> + for ( unsigned int i = 0 ; i < nd - > mNumChildren ; + + i ) <nl> + BuildMeshRefCountArray ( nd - > mChildren [ i ] , refs ) ; <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Executes the post processing step on the given imported data . <nl> - void PretransformVertices : : Execute ( aiScene * pScene ) { <nl> - ASSIMP_LOG_DEBUG ( " PretransformVerticesProcess begin " ) ; <nl> - <nl> - / / Return immediately if we have no meshes <nl> - if ( ! pScene - > mNumMeshes ) <nl> - return ; <nl> - <nl> - const unsigned int iOldMeshes = pScene - > mNumMeshes ; <nl> - const unsigned int iOldAnimationChannels = pScene - > mNumAnimations ; <nl> - const unsigned int iOldNodes = CountNodes ( pScene - > mRootNode ) ; <nl> - <nl> - if ( configTransform ) { <nl> - pScene - > mRootNode - > mTransformation = configTransformation ; <nl> - } <nl> - <nl> - / / first compute absolute transformation matrices for all nodes <nl> - ComputeAbsoluteTransform ( pScene - > mRootNode ) ; <nl> - <nl> - / / Delete aiMesh : : mBones for all meshes . The bones are <nl> - / / removed during this step and we need the pointer as <nl> - / / temporary storage <nl> - for ( unsigned int i = 0 ; i < pScene - > mNumMeshes ; + + i ) { <nl> - aiMesh * mesh = pScene - > mMeshes [ i ] ; <nl> - <nl> - for ( unsigned int a = 0 ; a < mesh - > mNumBones ; + + a ) <nl> - delete mesh - > mBones [ a ] ; <nl> - <nl> - delete [ ] mesh - > mBones ; <nl> - mesh - > mBones = NULL ; <nl> - } <nl> - <nl> - / / now build a list of output meshes <nl> - std : : vector < aiMesh * > apcOutMeshes ; <nl> - <nl> - / / Keep scene hierarchy ? It ' s an easy job in this case . . . <nl> - / / we go on and transform all meshes , if one is referenced by nodes <nl> - / / with different absolute transformations a depth copy of the mesh <nl> - / / is required . <nl> - if ( configKeepHierarchy ) { <nl> - <nl> - / / Hack : store the matrix we ' re transforming a mesh with in aiMesh : : mBones <nl> - BuildWCSMeshes ( apcOutMeshes , pScene - > mMeshes , pScene - > mNumMeshes , pScene - > mRootNode ) ; <nl> - <nl> - / / . . . if new meshes have been generated , append them to the end of the scene <nl> - if ( apcOutMeshes . size ( ) > 0 ) { <nl> - aiMesh * * npp = new aiMesh * [ pScene - > mNumMeshes + apcOutMeshes . size ( ) ] ; <nl> - <nl> - memcpy ( npp , pScene - > mMeshes , sizeof ( aiMesh * ) * pScene - > mNumMeshes ) ; <nl> - memcpy ( npp + pScene - > mNumMeshes , & apcOutMeshes [ 0 ] , sizeof ( aiMesh * ) * apcOutMeshes . size ( ) ) ; <nl> - <nl> - pScene - > mNumMeshes + = static_cast < unsigned int > ( apcOutMeshes . size ( ) ) ; <nl> - delete [ ] pScene - > mMeshes ; <nl> - pScene - > mMeshes = npp ; <nl> - } <nl> - <nl> - / / now iterate through all meshes and transform them to worldspace <nl> - for ( unsigned int i = 0 ; i < pScene - > mNumMeshes ; + + i ) { <nl> - ApplyTransform ( pScene - > mMeshes [ i ] , * reinterpret_cast < aiMatrix4x4 * > ( pScene - > mMeshes [ i ] - > mBones ) ) ; <nl> - <nl> - / / prevent improper destruction <nl> - pScene - > mMeshes [ i ] - > mBones = NULL ; <nl> - pScene - > mMeshes [ i ] - > mNumBones = 0 ; <nl> - } <nl> - } else { <nl> - apcOutMeshes . reserve ( pScene - > mNumMaterials < < 1u ) ; <nl> - std : : list < unsigned int > aiVFormats ; <nl> - <nl> - std : : vector < unsigned int > s ( pScene - > mNumMeshes , 0 ) ; <nl> - BuildMeshRefCountArray ( pScene - > mRootNode , & s [ 0 ] ) ; <nl> - <nl> - for ( unsigned int i = 0 ; i < pScene - > mNumMaterials ; + + i ) { <nl> - / / get the list of all vertex formats for this material <nl> - aiVFormats . clear ( ) ; <nl> - GetVFormatList ( pScene , i , aiVFormats ) ; <nl> - aiVFormats . sort ( ) ; <nl> - aiVFormats . unique ( ) ; <nl> - for ( std : : list < unsigned int > : : const_iterator j = aiVFormats . begin ( ) ; j ! = aiVFormats . end ( ) ; + + j ) { <nl> - unsigned int iVertices = 0 ; <nl> - unsigned int iFaces = 0 ; <nl> - CountVerticesAndFaces ( pScene , pScene - > mRootNode , i , * j , & iFaces , & iVertices ) ; <nl> - if ( 0 ! = iFaces & & 0 ! = iVertices ) { <nl> - apcOutMeshes . push_back ( new aiMesh ( ) ) ; <nl> - aiMesh * pcMesh = apcOutMeshes . back ( ) ; <nl> - pcMesh - > mNumFaces = iFaces ; <nl> - pcMesh - > mNumVertices = iVertices ; <nl> - pcMesh - > mFaces = new aiFace [ iFaces ] ; <nl> - pcMesh - > mVertices = new aiVector3D [ iVertices ] ; <nl> - pcMesh - > mMaterialIndex = i ; <nl> - if ( ( * j ) & 0x2 ) pcMesh - > mNormals = new aiVector3D [ iVertices ] ; <nl> - if ( ( * j ) & 0x4 ) { <nl> - pcMesh - > mTangents = new aiVector3D [ iVertices ] ; <nl> - pcMesh - > mBitangents = new aiVector3D [ iVertices ] ; <nl> - } <nl> - iFaces = 0 ; <nl> - while ( ( * j ) & ( 0x100 < < iFaces ) ) { <nl> - pcMesh - > mTextureCoords [ iFaces ] = new aiVector3D [ iVertices ] ; <nl> - if ( ( * j ) & ( 0x10000 < < iFaces ) ) <nl> - pcMesh - > mNumUVComponents [ iFaces ] = 3 ; <nl> - else <nl> - pcMesh - > mNumUVComponents [ iFaces ] = 2 ; <nl> - iFaces + + ; <nl> - } <nl> - iFaces = 0 ; <nl> - while ( ( * j ) & ( 0x1000000 < < iFaces ) ) <nl> - pcMesh - > mColors [ iFaces + + ] = new aiColor4D [ iVertices ] ; <nl> - <nl> - / / fill the mesh . . . <nl> - unsigned int aiTemp [ 2 ] = { 0 , 0 } ; <nl> - CollectData ( pScene , pScene - > mRootNode , i , * j , pcMesh , aiTemp , & s [ 0 ] ) ; <nl> - } <nl> - } <nl> - } <nl> - <nl> - / / If no meshes are referenced in the node graph it is possible that we get no output meshes . <nl> - if ( apcOutMeshes . empty ( ) ) { <nl> - <nl> - throw DeadlyImportError ( " No output meshes : all meshes are orphaned and are not referenced by any nodes " ) ; <nl> - } else { <nl> - / / now delete all meshes in the scene and build a new mesh list <nl> - for ( unsigned int i = 0 ; i < pScene - > mNumMeshes ; + + i ) { <nl> - aiMesh * mesh = pScene - > mMeshes [ i ] ; <nl> - mesh - > mNumBones = 0 ; <nl> - mesh - > mBones = NULL ; <nl> - <nl> - / / we ' re reusing the face index arrays . avoid destruction <nl> - for ( unsigned int a = 0 ; a < mesh - > mNumFaces ; + + a ) { <nl> - mesh - > mFaces [ a ] . mNumIndices = 0 ; <nl> - mesh - > mFaces [ a ] . mIndices = NULL ; <nl> - } <nl> - <nl> - delete mesh ; <nl> - <nl> - / / Invalidate the contents of the old mesh array . We will most <nl> - / / likely have less output meshes now , so the last entries of <nl> - / / the mesh array are not overridden . We set them to NULL to <nl> - / / make sure the developer gets notified when his application <nl> - / / attempts to access these fields . . . <nl> - mesh = NULL ; <nl> - } <nl> - <nl> - / / It is impossible that we have more output meshes than <nl> - / / input meshes , so we can easily reuse the old mesh array <nl> - pScene - > mNumMeshes = ( unsigned int ) apcOutMeshes . size ( ) ; <nl> - for ( unsigned int i = 0 ; i < pScene - > mNumMeshes ; + + i ) { <nl> - pScene - > mMeshes [ i ] = apcOutMeshes [ i ] ; <nl> - } <nl> - } <nl> - } <nl> - <nl> - / / remove all animations from the scene <nl> - for ( unsigned int i = 0 ; i < pScene - > mNumAnimations ; + + i ) <nl> - delete pScene - > mAnimations [ i ] ; <nl> - delete [ ] pScene - > mAnimations ; <nl> - <nl> - pScene - > mAnimations = NULL ; <nl> - pScene - > mNumAnimations = 0 ; <nl> - <nl> - / / mmm we need to keep all cameras and lights <nl> - for ( unsigned int i = 0 ; i < pScene - > mNumCameras ; + + i ) { <nl> - aiCamera * cam = pScene - > mCameras [ i ] ; <nl> - const aiNode * nd = pScene - > mRootNode - > FindNode ( cam - > mName ) ; <nl> - ai_assert ( NULL ! = nd ) ; <nl> - <nl> - / / multiply all properties of the camera with the absolute <nl> - / / transformation of the corresponding node <nl> - cam - > mPosition = nd - > mTransformation * cam - > mPosition ; <nl> - cam - > mLookAt = aiMatrix3x3 ( nd - > mTransformation ) * cam - > mLookAt ; <nl> - cam - > mUp = aiMatrix3x3 ( nd - > mTransformation ) * cam - > mUp ; <nl> - } <nl> - <nl> - for ( unsigned int i = 0 ; i < pScene - > mNumLights ; + + i ) { <nl> - aiLight * l = pScene - > mLights [ i ] ; <nl> - const aiNode * nd = pScene - > mRootNode - > FindNode ( l - > mName ) ; <nl> - ai_assert ( NULL ! = nd ) ; <nl> - <nl> - / / multiply all properties of the camera with the absolute <nl> - / / transformation of the corresponding node <nl> - l - > mPosition = nd - > mTransformation * l - > mPosition ; <nl> - l - > mDirection = aiMatrix3x3 ( nd - > mTransformation ) * l - > mDirection ; <nl> - l - > mUp = aiMatrix3x3 ( nd - > mTransformation ) * l - > mUp ; <nl> - } <nl> - <nl> - if ( ! configKeepHierarchy ) { <nl> - <nl> - / / now delete all nodes in the scene and build a new <nl> - / / flat node graph with a root node and some level 1 children <nl> - aiNode * newRoot = new aiNode ( ) ; <nl> - newRoot - > mName = pScene - > mRootNode - > mName ; <nl> - delete pScene - > mRootNode ; <nl> - pScene - > mRootNode = newRoot ; <nl> - <nl> - if ( 1 = = pScene - > mNumMeshes & & ! pScene - > mNumLights & & ! pScene - > mNumCameras ) { <nl> - pScene - > mRootNode - > mNumMeshes = 1 ; <nl> - pScene - > mRootNode - > mMeshes = new unsigned int [ 1 ] ; <nl> - pScene - > mRootNode - > mMeshes [ 0 ] = 0 ; <nl> - } else { <nl> - pScene - > mRootNode - > mNumChildren = pScene - > mNumMeshes + pScene - > mNumLights + pScene - > mNumCameras ; <nl> - aiNode * * nodes = pScene - > mRootNode - > mChildren = new aiNode * [ pScene - > mRootNode - > mNumChildren ] ; <nl> - <nl> - / / generate mesh nodes <nl> - for ( unsigned int i = 0 ; i < pScene - > mNumMeshes ; + + i , + + nodes ) { <nl> - aiNode * pcNode = new aiNode ( ) ; <nl> - * nodes = pcNode ; <nl> - pcNode - > mParent = pScene - > mRootNode ; <nl> - pcNode - > mName = pScene - > mMeshes [ i ] - > mName ; <nl> - <nl> - / / setup mesh indices <nl> - pcNode - > mNumMeshes = 1 ; <nl> - pcNode - > mMeshes = new unsigned int [ 1 ] ; <nl> - pcNode - > mMeshes [ 0 ] = i ; <nl> - } <nl> - / / generate light nodes <nl> - for ( unsigned int i = 0 ; i < pScene - > mNumLights ; + + i , + + nodes ) { <nl> - aiNode * pcNode = new aiNode ( ) ; <nl> - * nodes = pcNode ; <nl> - pcNode - > mParent = pScene - > mRootNode ; <nl> - pcNode - > mName . length = ai_snprintf ( pcNode - > mName . data , MAXLEN , " light_ % u " , i ) ; <nl> - pScene - > mLights [ i ] - > mName = pcNode - > mName ; <nl> - } <nl> - / / generate camera nodes <nl> - for ( unsigned int i = 0 ; i < pScene - > mNumCameras ; + + i , + + nodes ) { <nl> - aiNode * pcNode = new aiNode ( ) ; <nl> - * nodes = pcNode ; <nl> - pcNode - > mParent = pScene - > mRootNode ; <nl> - pcNode - > mName . length = : : ai_snprintf ( pcNode - > mName . data , MAXLEN , " cam_ % u " , i ) ; <nl> - pScene - > mCameras [ i ] - > mName = pcNode - > mName ; <nl> - } <nl> - } <nl> - } else { <nl> - / / . . . and finally set the transformation matrix of all nodes to identity <nl> - MakeIdentityTransform ( pScene - > mRootNode ) ; <nl> - } <nl> - <nl> - if ( configNormalize ) { <nl> - / / compute the boundary of all meshes <nl> - aiVector3D min , max ; <nl> - MinMaxChooser < aiVector3D > ( ) ( min , max ) ; <nl> - <nl> - for ( unsigned int a = 0 ; a < pScene - > mNumMeshes ; + + a ) { <nl> - aiMesh * m = pScene - > mMeshes [ a ] ; <nl> - for ( unsigned int i = 0 ; i < m - > mNumVertices ; + + i ) { <nl> - min = std : : min ( m - > mVertices [ i ] , min ) ; <nl> - max = std : : max ( m - > mVertices [ i ] , max ) ; <nl> - } <nl> - } <nl> - <nl> - / / find the dominant axis <nl> - aiVector3D d = max - min ; <nl> - const ai_real div = std : : max ( d . x , std : : max ( d . y , d . z ) ) * ai_real ( 0 . 5 ) ; <nl> - <nl> - d = min + d * ( ai_real ) 0 . 5 ; <nl> - for ( unsigned int a = 0 ; a < pScene - > mNumMeshes ; + + a ) { <nl> - aiMesh * m = pScene - > mMeshes [ a ] ; <nl> - for ( unsigned int i = 0 ; i < m - > mNumVertices ; + + i ) { <nl> - m - > mVertices [ i ] = ( m - > mVertices [ i ] - d ) / div ; <nl> - } <nl> - } <nl> - } <nl> - <nl> - / / print statistics <nl> - if ( ! DefaultLogger : : isNullLogger ( ) ) { <nl> - ASSIMP_LOG_DEBUG ( " PretransformVerticesProcess finished " ) ; <nl> - <nl> - ASSIMP_LOG_INFO_F ( " Removed " , iOldNodes , " nodes and " , iOldAnimationChannels , " animation channels ( " , <nl> - CountNodes ( pScene - > mRootNode ) , " output nodes ) " ) ; <nl> - ASSIMP_LOG_INFO_F ( " Kept " , pScene - > mNumLights , " lights and " , pScene - > mNumCameras , " cameras . " ) ; <nl> - ASSIMP_LOG_INFO_F ( " Moved " , iOldMeshes , " meshes to WCS ( number of output meshes : " , pScene - > mNumMeshes , " ) " ) ; <nl> - } <nl> + void PretransformVertices : : Execute ( aiScene * pScene ) <nl> + { <nl> + ASSIMP_LOG_DEBUG ( " PretransformVerticesProcess begin " ) ; <nl> + <nl> + / / Return immediately if we have no meshes <nl> + if ( ! pScene - > mNumMeshes ) <nl> + return ; <nl> + <nl> + const unsigned int iOldMeshes = pScene - > mNumMeshes ; <nl> + const unsigned int iOldAnimationChannels = pScene - > mNumAnimations ; <nl> + const unsigned int iOldNodes = CountNodes ( pScene - > mRootNode ) ; <nl> + <nl> + if ( configTransform ) { <nl> + pScene - > mRootNode - > mTransformation = configTransformation ; <nl> + } <nl> + <nl> + / / first compute absolute transformation matrices for all nodes <nl> + ComputeAbsoluteTransform ( pScene - > mRootNode ) ; <nl> + <nl> + / / Delete aiMesh : : mBones for all meshes . The bones are <nl> + / / removed during this step and we need the pointer as <nl> + / / temporary storage <nl> + for ( unsigned int i = 0 ; i < pScene - > mNumMeshes ; + + i ) { <nl> + aiMesh * mesh = pScene - > mMeshes [ i ] ; <nl> + <nl> + for ( unsigned int a = 0 ; a < mesh - > mNumBones ; + + a ) <nl> + delete mesh - > mBones [ a ] ; <nl> + <nl> + delete [ ] mesh - > mBones ; <nl> + mesh - > mBones = NULL ; <nl> + } <nl> + <nl> + / / now build a list of output meshes <nl> + std : : vector < aiMesh * > apcOutMeshes ; <nl> + <nl> + / / Keep scene hierarchy ? It ' s an easy job in this case . . . <nl> + / / we go on and transform all meshes , if one is referenced by nodes <nl> + / / with different absolute transformations a depth copy of the mesh <nl> + / / is required . <nl> + if ( configKeepHierarchy ) { <nl> + <nl> + / / Hack : store the matrix we ' re transforming a mesh with in aiMesh : : mBones <nl> + BuildWCSMeshes ( apcOutMeshes , pScene - > mMeshes , pScene - > mNumMeshes , pScene - > mRootNode ) ; <nl> + <nl> + / / . . . if new meshes have been generated , append them to the end of the scene <nl> + if ( apcOutMeshes . size ( ) > 0 ) { <nl> + aiMesh * * npp = new aiMesh * [ pScene - > mNumMeshes + apcOutMeshes . size ( ) ] ; <nl> + <nl> + memcpy ( npp , pScene - > mMeshes , sizeof ( aiMesh * ) * pScene - > mNumMeshes ) ; <nl> + memcpy ( npp + pScene - > mNumMeshes , & apcOutMeshes [ 0 ] , sizeof ( aiMesh * ) * apcOutMeshes . size ( ) ) ; <nl> + <nl> + pScene - > mNumMeshes + = static_cast < unsigned int > ( apcOutMeshes . size ( ) ) ; <nl> + delete [ ] pScene - > mMeshes ; pScene - > mMeshes = npp ; <nl> + } <nl> + <nl> + / / now iterate through all meshes and transform them to worldspace <nl> + for ( unsigned int i = 0 ; i < pScene - > mNumMeshes ; + + i ) { <nl> + ApplyTransform ( pScene - > mMeshes [ i ] , * reinterpret_cast < aiMatrix4x4 * > ( pScene - > mMeshes [ i ] - > mBones ) ) ; <nl> + <nl> + / / prevent improper destruction <nl> + pScene - > mMeshes [ i ] - > mBones = NULL ; <nl> + pScene - > mMeshes [ i ] - > mNumBones = 0 ; <nl> + } <nl> + } else { <nl> + apcOutMeshes . reserve ( pScene - > mNumMaterials < < 1u ) ; <nl> + std : : list < unsigned int > aiVFormats ; <nl> + <nl> + std : : vector < unsigned int > s ( pScene - > mNumMeshes , 0 ) ; <nl> + BuildMeshRefCountArray ( pScene - > mRootNode , & s [ 0 ] ) ; <nl> + <nl> + for ( unsigned int i = 0 ; i < pScene - > mNumMaterials ; + + i ) { <nl> + / / get the list of all vertex formats for this material <nl> + aiVFormats . clear ( ) ; <nl> + GetVFormatList ( pScene , i , aiVFormats ) ; <nl> + aiVFormats . sort ( ) ; <nl> + aiVFormats . unique ( ) ; <nl> + for ( std : : list < unsigned int > : : const_iterator j = aiVFormats . begin ( ) ; j ! = aiVFormats . end ( ) ; + + j ) { <nl> + unsigned int iVertices = 0 ; <nl> + unsigned int iFaces = 0 ; <nl> + CountVerticesAndFaces ( pScene , pScene - > mRootNode , i , * j , & iFaces , & iVertices ) ; <nl> + if ( 0 ! = iFaces & & 0 ! = iVertices ) <nl> + { <nl> + apcOutMeshes . push_back ( new aiMesh ( ) ) ; <nl> + aiMesh * pcMesh = apcOutMeshes . back ( ) ; <nl> + pcMesh - > mNumFaces = iFaces ; <nl> + pcMesh - > mNumVertices = iVertices ; <nl> + pcMesh - > mFaces = new aiFace [ iFaces ] ; <nl> + pcMesh - > mVertices = new aiVector3D [ iVertices ] ; <nl> + pcMesh - > mMaterialIndex = i ; <nl> + if ( ( * j ) & 0x2 ) pcMesh - > mNormals = new aiVector3D [ iVertices ] ; <nl> + if ( ( * j ) & 0x4 ) <nl> + { <nl> + pcMesh - > mTangents = new aiVector3D [ iVertices ] ; <nl> + pcMesh - > mBitangents = new aiVector3D [ iVertices ] ; <nl> + } <nl> + iFaces = 0 ; <nl> + while ( ( * j ) & ( 0x100 < < iFaces ) ) <nl> + { <nl> + pcMesh - > mTextureCoords [ iFaces ] = new aiVector3D [ iVertices ] ; <nl> + if ( ( * j ) & ( 0x10000 < < iFaces ) ) pcMesh - > mNumUVComponents [ iFaces ] = 3 ; <nl> + else pcMesh - > mNumUVComponents [ iFaces ] = 2 ; <nl> + iFaces + + ; <nl> + } <nl> + iFaces = 0 ; <nl> + while ( ( * j ) & ( 0x1000000 < < iFaces ) ) <nl> + pcMesh - > mColors [ iFaces + + ] = new aiColor4D [ iVertices ] ; <nl> + <nl> + / / fill the mesh . . . <nl> + unsigned int aiTemp [ 2 ] = { 0 , 0 } ; <nl> + CollectData ( pScene , pScene - > mRootNode , i , * j , pcMesh , aiTemp , & s [ 0 ] ) ; <nl> + } <nl> + } <nl> + } <nl> + <nl> + / / If no meshes are referenced in the node graph it is possible that we get no output meshes . <nl> + if ( apcOutMeshes . empty ( ) ) { <nl> + <nl> + throw DeadlyImportError ( " No output meshes : all meshes are orphaned and are not referenced by any nodes " ) ; <nl> + } <nl> + else <nl> + { <nl> + / / now delete all meshes in the scene and build a new mesh list <nl> + for ( unsigned int i = 0 ; i < pScene - > mNumMeshes ; + + i ) <nl> + { <nl> + aiMesh * mesh = pScene - > mMeshes [ i ] ; <nl> + mesh - > mNumBones = 0 ; <nl> + mesh - > mBones = NULL ; <nl> + <nl> + / / we ' re reusing the face index arrays . avoid destruction <nl> + for ( unsigned int a = 0 ; a < mesh - > mNumFaces ; + + a ) { <nl> + mesh - > mFaces [ a ] . mNumIndices = 0 ; <nl> + mesh - > mFaces [ a ] . mIndices = NULL ; <nl> + } <nl> + <nl> + delete mesh ; <nl> + <nl> + / / Invalidate the contents of the old mesh array . We will most <nl> + / / likely have less output meshes now , so the last entries of <nl> + / / the mesh array are not overridden . We set them to NULL to <nl> + / / make sure the developer gets notified when his application <nl> + / / attempts to access these fields . . . <nl> + mesh = NULL ; <nl> + } <nl> + <nl> + / / It is impossible that we have more output meshes than <nl> + / / input meshes , so we can easily reuse the old mesh array <nl> + pScene - > mNumMeshes = ( unsigned int ) apcOutMeshes . size ( ) ; <nl> + for ( unsigned int i = 0 ; i < pScene - > mNumMeshes ; + + i ) { <nl> + pScene - > mMeshes [ i ] = apcOutMeshes [ i ] ; <nl> + } <nl> + } <nl> + } <nl> + <nl> + / / remove all animations from the scene <nl> + for ( unsigned int i = 0 ; i < pScene - > mNumAnimations ; + + i ) <nl> + delete pScene - > mAnimations [ i ] ; <nl> + delete [ ] pScene - > mAnimations ; <nl> + <nl> + pScene - > mAnimations = NULL ; <nl> + pScene - > mNumAnimations = 0 ; <nl> + <nl> + / / mmm we need to keep all cameras and lights <nl> + for ( unsigned int i = 0 ; i < pScene - > mNumCameras ; + + i ) <nl> + { <nl> + aiCamera * cam = pScene - > mCameras [ i ] ; <nl> + const aiNode * nd = pScene - > mRootNode - > FindNode ( cam - > mName ) ; <nl> + ai_assert ( NULL ! = nd ) ; <nl> + <nl> + / / multiply all properties of the camera with the absolute <nl> + / / transformation of the corresponding node <nl> + cam - > mPosition = nd - > mTransformation * cam - > mPosition ; <nl> + cam - > mLookAt = aiMatrix3x3 ( nd - > mTransformation ) * cam - > mLookAt ; <nl> + cam - > mUp = aiMatrix3x3 ( nd - > mTransformation ) * cam - > mUp ; <nl> + } <nl> + <nl> + for ( unsigned int i = 0 ; i < pScene - > mNumLights ; + + i ) <nl> + { <nl> + aiLight * l = pScene - > mLights [ i ] ; <nl> + const aiNode * nd = pScene - > mRootNode - > FindNode ( l - > mName ) ; <nl> + ai_assert ( NULL ! = nd ) ; <nl> + <nl> + / / multiply all properties of the camera with the absolute <nl> + / / transformation of the corresponding node <nl> + l - > mPosition = nd - > mTransformation * l - > mPosition ; <nl> + l - > mDirection = aiMatrix3x3 ( nd - > mTransformation ) * l - > mDirection ; <nl> + l - > mUp = aiMatrix3x3 ( nd - > mTransformation ) * l - > mUp ; <nl> + } <nl> + <nl> + if ( ! configKeepHierarchy ) { <nl> + <nl> + / / now delete all nodes in the scene and build a new <nl> + / / flat node graph with a root node and some level 1 children <nl> + aiNode * newRoot = new aiNode ( ) ; <nl> + newRoot - > mName = pScene - > mRootNode - > mName ; <nl> + delete pScene - > mRootNode ; <nl> + pScene - > mRootNode = newRoot ; <nl> + <nl> + if ( 1 = = pScene - > mNumMeshes & & ! pScene - > mNumLights & & ! pScene - > mNumCameras ) <nl> + { <nl> + pScene - > mRootNode - > mNumMeshes = 1 ; <nl> + pScene - > mRootNode - > mMeshes = new unsigned int [ 1 ] ; <nl> + pScene - > mRootNode - > mMeshes [ 0 ] = 0 ; <nl> + } <nl> + else <nl> + { <nl> + pScene - > mRootNode - > mNumChildren = pScene - > mNumMeshes + pScene - > mNumLights + pScene - > mNumCameras ; <nl> + aiNode * * nodes = pScene - > mRootNode - > mChildren = new aiNode * [ pScene - > mRootNode - > mNumChildren ] ; <nl> + <nl> + / / generate mesh nodes <nl> + for ( unsigned int i = 0 ; i < pScene - > mNumMeshes ; + + i , + + nodes ) <nl> + { <nl> + aiNode * pcNode = new aiNode ( ) ; <nl> + * nodes = pcNode ; <nl> + pcNode - > mParent = pScene - > mRootNode ; <nl> + pcNode - > mName = pScene - > mMeshes [ i ] - > mName ; <nl> + <nl> + / / setup mesh indices <nl> + pcNode - > mNumMeshes = 1 ; <nl> + pcNode - > mMeshes = new unsigned int [ 1 ] ; <nl> + pcNode - > mMeshes [ 0 ] = i ; <nl> + } <nl> + / / generate light nodes <nl> + for ( unsigned int i = 0 ; i < pScene - > mNumLights ; + + i , + + nodes ) <nl> + { <nl> + aiNode * pcNode = new aiNode ( ) ; <nl> + * nodes = pcNode ; <nl> + pcNode - > mParent = pScene - > mRootNode ; <nl> + pcNode - > mName . length = ai_snprintf ( pcNode - > mName . data , MAXLEN , " light_ % u " , i ) ; <nl> + pScene - > mLights [ i ] - > mName = pcNode - > mName ; <nl> + } <nl> + / / generate camera nodes <nl> + for ( unsigned int i = 0 ; i < pScene - > mNumCameras ; + + i , + + nodes ) <nl> + { <nl> + aiNode * pcNode = new aiNode ( ) ; <nl> + * nodes = pcNode ; <nl> + pcNode - > mParent = pScene - > mRootNode ; <nl> + pcNode - > mName . length = : : ai_snprintf ( pcNode - > mName . data , MAXLEN , " cam_ % u " , i ) ; <nl> + pScene - > mCameras [ i ] - > mName = pcNode - > mName ; <nl> + } <nl> + } <nl> + } <nl> + else { <nl> + / / . . . and finally set the transformation matrix of all nodes to identity <nl> + MakeIdentityTransform ( pScene - > mRootNode ) ; <nl> + } <nl> + <nl> + if ( configNormalize ) { <nl> + / / compute the boundary of all meshes <nl> + aiVector3D min , max ; <nl> + MinMaxChooser < aiVector3D > ( ) ( min , max ) ; <nl> + <nl> + for ( unsigned int a = 0 ; a < pScene - > mNumMeshes ; + + a ) { <nl> + aiMesh * m = pScene - > mMeshes [ a ] ; <nl> + for ( unsigned int i = 0 ; i < m - > mNumVertices ; + + i ) { <nl> + min = std : : min ( m - > mVertices [ i ] , min ) ; <nl> + max = std : : max ( m - > mVertices [ i ] , max ) ; <nl> + } <nl> + } <nl> + <nl> + / / find the dominant axis <nl> + aiVector3D d = max - min ; <nl> + const ai_real div = std : : max ( d . x , std : : max ( d . y , d . z ) ) * ai_real ( 0 . 5 ) ; <nl> + <nl> + d = min + d * ( ai_real ) 0 . 5 ; <nl> + for ( unsigned int a = 0 ; a < pScene - > mNumMeshes ; + + a ) { <nl> + aiMesh * m = pScene - > mMeshes [ a ] ; <nl> + for ( unsigned int i = 0 ; i < m - > mNumVertices ; + + i ) { <nl> + m - > mVertices [ i ] = ( m - > mVertices [ i ] - d ) / div ; <nl> + } <nl> + } <nl> + } <nl> + <nl> + / / print statistics <nl> + if ( ! DefaultLogger : : isNullLogger ( ) ) { <nl> + ASSIMP_LOG_DEBUG ( " PretransformVerticesProcess finished " ) ; <nl> + <nl> + ASSIMP_LOG_INFO_F ( " Removed " , iOldNodes , " nodes and " , iOldAnimationChannels , " animation channels ( " , <nl> + CountNodes ( pScene - > mRootNode ) , " output nodes ) " ) ; <nl> + ASSIMP_LOG_INFO_F ( " Kept " , pScene - > mNumLights , " lights and " , pScene - > mNumCameras , " cameras . " ) ; <nl> + ASSIMP_LOG_INFO_F ( " Moved " , iOldMeshes , " meshes to WCS ( number of output meshes : " , pScene - > mNumMeshes , " ) " ) ; <nl> + } <nl> } <nl> mmm a / thirdparty / assimp / code / PostProcessing / PretransformVertices . h <nl> ppp b / thirdparty / assimp / code / PostProcessing / PretransformVertices . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> struct aiNode ; <nl> <nl> class PretransformVerticesTest ; <nl> <nl> - namespace Assimp { <nl> + namespace Assimp { <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / * * The PretransformVertices pre - transforms all vertices in the node tree <nl> namespace Assimp { <nl> * / <nl> class ASSIMP_API PretransformVertices : public BaseProcess { <nl> public : <nl> - PretransformVertices ( ) ; <nl> - ~ PretransformVertices ( ) ; <nl> + PretransformVertices ( ) ; <nl> + ~ PretransformVertices ( ) ; <nl> <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - / / Check whether step is active <nl> - bool IsActive ( unsigned int pFlags ) const override ; <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + / / Check whether step is active <nl> + bool IsActive ( unsigned int pFlags ) const ; <nl> <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - / / Execute step on a given scene <nl> - void Execute ( aiScene * pScene ) override ; <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + / / Execute step on a given scene <nl> + void Execute ( aiScene * pScene ) ; <nl> <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - / / Setup import settings <nl> - void SetupProperties ( const Importer * pImp ) override ; <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + / / Setup import settings <nl> + void SetupProperties ( const Importer * pImp ) ; <nl> <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - / * * @ brief Toggle the ' keep hierarchy ' option <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + / * * @ brief Toggle the ' keep hierarchy ' option <nl> * @ param keep true for keep configuration . <nl> * / <nl> - void KeepHierarchy ( bool keep ) { <nl> - configKeepHierarchy = keep ; <nl> - } <nl> + void KeepHierarchy ( bool keep ) { <nl> + configKeepHierarchy = keep ; <nl> + } <nl> <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - / * * @ brief Check whether ' keep hierarchy ' is currently enabled . <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + / * * @ brief Check whether ' keep hierarchy ' is currently enabled . <nl> * @ return . . . <nl> * / <nl> - bool IsHierarchyKept ( ) const { <nl> - return configKeepHierarchy ; <nl> - } <nl> + bool IsHierarchyKept ( ) const { <nl> + return configKeepHierarchy ; <nl> + } <nl> <nl> private : <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - / / Count the number of nodes <nl> - unsigned int CountNodes ( const aiNode * pcNode ) const ; <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - / / Get a bitwise combination identifying the vertex format of a mesh <nl> - unsigned int GetMeshVFormat ( aiMesh * pcMesh ) const ; <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - / / Count the number of vertices in the whole scene and a given <nl> - / / material index <nl> - void CountVerticesAndFaces ( const aiScene * pcScene , const aiNode * pcNode , <nl> - unsigned int iMat , <nl> - unsigned int iVFormat , <nl> - unsigned int * piFaces , <nl> - unsigned int * piVertices ) const ; <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - / / Collect vertex / face data <nl> - void CollectData ( const aiScene * pcScene , const aiNode * pcNode , <nl> - unsigned int iMat , <nl> - unsigned int iVFormat , <nl> - aiMesh * pcMeshOut , <nl> - unsigned int aiCurrent [ 2 ] , <nl> - unsigned int * num_refs ) const ; <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - / / Get a list of all vertex formats that occur for a given material <nl> - / / The output list contains duplicate elements <nl> - void GetVFormatList ( const aiScene * pcScene , unsigned int iMat , <nl> - std : : list < unsigned int > & aiOut ) const ; <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - / / Compute the absolute transformation matrices of each node <nl> - void ComputeAbsoluteTransform ( aiNode * pcNode ) ; <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - / / Simple routine to build meshes in worldspace , no further optimization <nl> - void BuildWCSMeshes ( std : : vector < aiMesh * > & out , aiMesh * * in , <nl> - unsigned int numIn , aiNode * node ) const ; <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - / / Apply the node transformation to a mesh <nl> - void ApplyTransform ( aiMesh * mesh , const aiMatrix4x4 & mat ) const ; <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - / / Reset transformation matrices to identity <nl> - void MakeIdentityTransform ( aiNode * nd ) const ; <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - / / Build reference counters for all meshes <nl> - void BuildMeshRefCountArray ( const aiNode * nd , unsigned int * refs ) const ; <nl> - <nl> - / / ! Configuration option : keep scene hierarchy as long as possible <nl> - bool configKeepHierarchy ; <nl> - bool configNormalize ; <nl> - bool configTransform ; <nl> - aiMatrix4x4 configTransformation ; <nl> - bool mConfigPointCloud ; <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + / / Count the number of nodes <nl> + unsigned int CountNodes ( aiNode * pcNode ) ; <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + / / Get a bitwise combination identifying the vertex format of a mesh <nl> + unsigned int GetMeshVFormat ( aiMesh * pcMesh ) ; <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + / / Count the number of vertices in the whole scene and a given <nl> + / / material index <nl> + void CountVerticesAndFaces ( aiScene * pcScene , aiNode * pcNode , <nl> + unsigned int iMat , <nl> + unsigned int iVFormat , <nl> + unsigned int * piFaces , <nl> + unsigned int * piVertices ) ; <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + / / Collect vertex / face data <nl> + void CollectData ( aiScene * pcScene , aiNode * pcNode , <nl> + unsigned int iMat , <nl> + unsigned int iVFormat , <nl> + aiMesh * pcMeshOut , <nl> + unsigned int aiCurrent [ 2 ] , <nl> + unsigned int * num_refs ) ; <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + / / Get a list of all vertex formats that occur for a given material <nl> + / / The output list contains duplicate elements <nl> + void GetVFormatList ( aiScene * pcScene , unsigned int iMat , <nl> + std : : list < unsigned int > & aiOut ) ; <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + / / Compute the absolute transformation matrices of each node <nl> + void ComputeAbsoluteTransform ( aiNode * pcNode ) ; <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + / / Simple routine to build meshes in worldspace , no further optimization <nl> + void BuildWCSMeshes ( std : : vector < aiMesh * > & out , aiMesh * * in , <nl> + unsigned int numIn , aiNode * node ) ; <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + / / Apply the node transformation to a mesh <nl> + void ApplyTransform ( aiMesh * mesh , const aiMatrix4x4 & mat ) ; <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + / / Reset transformation matrices to identity <nl> + void MakeIdentityTransform ( aiNode * nd ) ; <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + / / Build reference counters for all meshes <nl> + void BuildMeshRefCountArray ( aiNode * nd , unsigned int * refs ) ; <nl> + <nl> + / / ! Configuration option : keep scene hierarchy as long as possible <nl> + bool configKeepHierarchy ; <nl> + bool configNormalize ; <nl> + bool configTransform ; <nl> + aiMatrix4x4 configTransformation ; <nl> + bool mConfigPointCloud ; <nl> } ; <nl> <nl> } / / end of namespace Assimp <nl> mmm a / thirdparty / assimp / code / PostProcessing / ProcessHelper . cpp <nl> ppp b / thirdparty / assimp / code / PostProcessing / ProcessHelper . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> VertexWeightTable * ComputeVertexBoneWeightTable ( const aiMesh * pMesh ) <nl> return avPerVertexWeights ; <nl> } <nl> <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + const char * TextureTypeToString ( aiTextureType in ) <nl> + { <nl> + switch ( in ) <nl> + { <nl> + case aiTextureType_NONE : <nl> + return " n / a " ; <nl> + case aiTextureType_DIFFUSE : <nl> + return " Diffuse " ; <nl> + case aiTextureType_SPECULAR : <nl> + return " Specular " ; <nl> + case aiTextureType_AMBIENT : <nl> + return " Ambient " ; <nl> + case aiTextureType_EMISSIVE : <nl> + return " Emissive " ; <nl> + case aiTextureType_OPACITY : <nl> + return " Opacity " ; <nl> + case aiTextureType_NORMALS : <nl> + return " Normals " ; <nl> + case aiTextureType_HEIGHT : <nl> + return " Height " ; <nl> + case aiTextureType_SHININESS : <nl> + return " Shininess " ; <nl> + case aiTextureType_DISPLACEMENT : <nl> + return " Displacement " ; <nl> + case aiTextureType_LIGHTMAP : <nl> + return " Lightmap " ; <nl> + case aiTextureType_REFLECTION : <nl> + return " Reflection " ; <nl> + case aiTextureType_UNKNOWN : <nl> + return " Unknown " ; <nl> + default : <nl> + break ; <nl> + } <nl> + <nl> + ai_assert ( false ) ; <nl> + return " BUG " ; <nl> + } <nl> + <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> const char * MappingTypeToString ( aiTextureMapping in ) <nl> { <nl> mmm a / thirdparty / assimp / code / PostProcessing / ProcessHelper . h <nl> ppp b / thirdparty / assimp / code / PostProcessing / ProcessHelper . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> typedef std : : vector < PerVertexWeight > VertexWeightTable ; <nl> / / Compute a per - vertex bone weight table <nl> VertexWeightTable * ComputeVertexBoneWeightTable ( const aiMesh * pMesh ) ; <nl> <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + / / Get a string for a given aiTextureType <nl> + const char * TextureTypeToString ( aiTextureType in ) ; <nl> + <nl> + <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> / / Get a string for a given aiTextureMapping <nl> const char * MappingTypeToString ( aiTextureMapping in ) ; <nl> mmm a / thirdparty / assimp / code / PostProcessing / RemoveRedundantMaterials . cpp <nl> ppp b / thirdparty / assimp / code / PostProcessing / RemoveRedundantMaterials . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / code / PostProcessing / RemoveRedundantMaterials . h <nl> ppp b / thirdparty / assimp / code / PostProcessing / RemoveRedundantMaterials . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / PostProcessing / RemoveVCProcess . cpp <nl> ppp b / thirdparty / assimp / code / PostProcessing / RemoveVCProcess . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / code / PostProcessing / RemoveVCProcess . h <nl> ppp b / thirdparty / assimp / code / PostProcessing / RemoveVCProcess . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / PostProcessing / ScaleProcess . cpp <nl> ppp b / thirdparty / assimp / code / PostProcessing / ScaleProcess . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / PostProcessing / ScaleProcess . h <nl> ppp b / thirdparty / assimp / code / PostProcessing / ScaleProcess . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / PostProcessing / SortByPTypeProcess . cpp <nl> ppp b / thirdparty / assimp / code / PostProcessing / SortByPTypeProcess . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / code / PostProcessing / SortByPTypeProcess . h <nl> ppp b / thirdparty / assimp / code / PostProcessing / SortByPTypeProcess . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / PostProcessing / SplitLargeMeshes . cpp <nl> ppp b / thirdparty / assimp / code / PostProcessing / SplitLargeMeshes . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / PostProcessing / SplitLargeMeshes . h <nl> ppp b / thirdparty / assimp / code / PostProcessing / SplitLargeMeshes . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> All rights reserved . <nl> <nl> mmm a / thirdparty / assimp / code / PostProcessing / TextureTransform . cpp <nl> ppp b / thirdparty / assimp / code / PostProcessing / TextureTransform . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> void TextureTransformStep : : PreProcessUVTransform ( STransformVecInfo & info ) <nl> * are applied is - as always - scaling , rotation , translation . <nl> * / <nl> <nl> - int rounded ; <nl> - char szTemp [ 512 ] ; <nl> + char szTemp [ 512 ] ; <nl> + int rounded = 0 ; <nl> + <nl> <nl> / * Optimize the rotation angle . That ' s slightly difficult as <nl> * we have an inprecise floating - point number ( when comparing <nl> void TextureTransformStep : : PreProcessUVTransform ( STransformVecInfo & info ) <nl> info . mTranslation . y = out ; <nl> } <nl> } <nl> + return ; <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> void TextureTransformStep : : Execute ( aiScene * pScene ) <nl> / / at the end of the list <nl> bool ref [ AI_MAX_NUMBER_OF_TEXTURECOORDS ] ; <nl> for ( unsigned int n = 0 ; n < AI_MAX_NUMBER_OF_TEXTURECOORDS ; + + n ) <nl> - ref [ n ] = ! mesh - > mTextureCoords [ n ] ; <nl> + ref [ n ] = ( ! mesh - > mTextureCoords [ n ] ? true : false ) ; <nl> <nl> for ( it = trafo . begin ( ) ; it ! = trafo . end ( ) ; + + it ) <nl> ref [ ( * it ) . uvIndex ] = true ; <nl> mmm a / thirdparty / assimp / code / PostProcessing / TextureTransform . h <nl> ppp b / thirdparty / assimp / code / PostProcessing / TextureTransform . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / PostProcessing / TriangulateProcess . cpp <nl> ppp b / thirdparty / assimp / code / PostProcessing / TriangulateProcess . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> All rights reserved . <nl> <nl> mmm a / thirdparty / assimp / code / PostProcessing / TriangulateProcess . h <nl> ppp b / thirdparty / assimp / code / PostProcessing / TriangulateProcess . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / code / PostProcessing / ValidateDataStructure . cpp <nl> ppp b / thirdparty / assimp / code / PostProcessing / ValidateDataStructure . cpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> void ValidateDSProcess : : SearchForInvalidTextures ( const aiMaterial * pMaterial , <nl> ReportError ( " % s # % i is set , but there are only % i % s textures " , <nl> szType , iIndex , iNumIndices , szType ) ; <nl> } <nl> - if ( ! iNumIndices ) { <nl> - return ; <nl> - } <nl> + if ( ! iNumIndices ) return ; <nl> std : : vector < aiTextureMapping > mappings ( iNumIndices ) ; <nl> <nl> / / Now check whether all UV indices are valid . . . <nl> bool bNoSpecified = true ; <nl> - for ( unsigned int i = 0 ; i < pMaterial - > mNumProperties ; + + i ) { <nl> + for ( unsigned int i = 0 ; i < pMaterial - > mNumProperties ; + + i ) <nl> + { <nl> aiMaterialProperty * prop = pMaterial - > mProperties [ i ] ; <nl> - if ( prop - > mSemantic ! = type ) { <nl> - continue ; <nl> - } <nl> + if ( prop - > mSemantic ! = type ) continue ; <nl> <nl> if ( ( int ) prop - > mIndex > = iNumIndices ) <nl> { <nl> void ValidateDSProcess : : SearchForInvalidTextures ( const aiMaterial * pMaterial , <nl> ReportError ( " Material property % s % i is expected to be 5 floats large ( size is % i ) " , <nl> prop - > mKey . data , prop - > mIndex , prop - > mDataLength ) ; <nl> } <nl> - / / mappings [ prop - > mIndex ] = ( ( aiUVTransform * ) prop - > mData ) ; <nl> + mappings [ prop - > mIndex ] = * ( ( aiTextureMapping * ) prop - > mData ) ; <nl> } <nl> else if ( ! : : strcmp ( prop - > mKey . data , " $ tex . uvwsrc " ) ) { <nl> if ( aiPTI_Integer ! = prop - > mType | | sizeof ( int ) > prop - > mDataLength ) <nl> void ValidateDSProcess : : Validate ( const aiMaterial * pMaterial ) <nl> SearchForInvalidTextures ( pMaterial , aiTextureType_DISPLACEMENT ) ; <nl> SearchForInvalidTextures ( pMaterial , aiTextureType_LIGHTMAP ) ; <nl> SearchForInvalidTextures ( pMaterial , aiTextureType_REFLECTION ) ; <nl> - SearchForInvalidTextures ( pMaterial , aiTextureType_BASE_COLOR ) ; <nl> - SearchForInvalidTextures ( pMaterial , aiTextureType_NORMAL_CAMERA ) ; <nl> - SearchForInvalidTextures ( pMaterial , aiTextureType_EMISSION_COLOR ) ; <nl> - SearchForInvalidTextures ( pMaterial , aiTextureType_METALNESS ) ; <nl> - SearchForInvalidTextures ( pMaterial , aiTextureType_DIFFUSE_ROUGHNESS ) ; <nl> - SearchForInvalidTextures ( pMaterial , aiTextureType_AMBIENT_OCCLUSION ) ; <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> void ValidateDSProcess : : Validate ( const aiTexture * pTexture ) <nl> if ( ! pTexture - > mWidth ) { <nl> ReportError ( " aiTexture : : mWidth is zero ( compressed texture ) " ) ; <nl> } <nl> - if ( ' \ 0 ' ! = pTexture - > achFormatHint [ HINTMAXTEXTURELEN - 1 ] ) { <nl> + if ( ' \ 0 ' ! = pTexture - > achFormatHint [ 3 ] ) { <nl> ReportWarning ( " aiTexture : : achFormatHint must be zero - terminated " ) ; <nl> } <nl> else if ( ' . ' = = pTexture - > achFormatHint [ 0 ] ) { <nl> mmm a / thirdparty / assimp / code / PostProcessing / ValidateDataStructure . h <nl> ppp b / thirdparty / assimp / code / PostProcessing / ValidateDataStructure . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / include / assimp / BaseImporter . h <nl> ppp b / thirdparty / assimp / include / assimp / BaseImporter . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / include / assimp / Bitmap . h <nl> ppp b / thirdparty / assimp / include / assimp / Bitmap . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / include / assimp / BlobIOSystem . h <nl> ppp b / thirdparty / assimp / include / assimp / BlobIOSystem . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / include / assimp / ByteSwapper . h <nl> ppp b / thirdparty / assimp / include / assimp / ByteSwapper . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / include / assimp / CreateAnimMesh . h <nl> ppp b / thirdparty / assimp / include / assimp / CreateAnimMesh . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / include / assimp / DefaultIOStream . h <nl> ppp b / thirdparty / assimp / include / assimp / DefaultIOStream . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / include / assimp / DefaultIOSystem . h <nl> ppp b / thirdparty / assimp / include / assimp / DefaultIOSystem . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / include / assimp / DefaultLogger . hpp <nl> ppp b / thirdparty / assimp / include / assimp / DefaultLogger . hpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / include / assimp / Defines . h <nl> ppp b / thirdparty / assimp / include / assimp / Defines . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2012 , assimp team <nl> All rights reserved . <nl> <nl> Redistribution and use of this software in source and binary forms , <nl> mmm a / thirdparty / assimp / include / assimp / Exceptional . h <nl> ppp b / thirdparty / assimp / include / assimp / Exceptional . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2008 , assimp team <nl> All rights reserved . <nl> <nl> Redistribution and use of this software in source and binary forms , <nl> struct ExceptionSwallower < void > { <nl> { \ <nl> try { <nl> <nl> - # define ASSIMP_END_EXCEPTION_REGION_WITH_ERROR_STRING ( type , ASSIMP_END_EXCEPTION_REGION_errorString ) \ <nl> - } catch ( const DeadlyImportError & e ) { \ <nl> - ASSIMP_END_EXCEPTION_REGION_errorString = e . what ( ) ; \ <nl> - return ExceptionSwallower < type > ( ) ( ) ; \ <nl> - } catch ( . . . ) { \ <nl> - ASSIMP_END_EXCEPTION_REGION_errorString = " Unknown exception " ; \ <nl> - return ExceptionSwallower < type > ( ) ( ) ; \ <nl> - } \ <nl> - } <nl> - <nl> # define ASSIMP_END_EXCEPTION_REGION ( type ) \ <nl> } catch ( . . . ) { \ <nl> return ExceptionSwallower < type > ( ) ( ) ; \ <nl> mmm a / thirdparty / assimp / include / assimp / Exporter . hpp <nl> ppp b / thirdparty / assimp / include / assimp / Exporter . hpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> + <nl> + <nl> <nl> All rights reserved . <nl> <nl> mmm a / thirdparty / assimp / include / assimp / GenericProperty . h <nl> ppp b / thirdparty / assimp / include / assimp / GenericProperty . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / include / assimp / Hash . h <nl> ppp b / thirdparty / assimp / include / assimp / Hash . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / include / assimp / IOStream . hpp <nl> ppp b / thirdparty / assimp / include / assimp / IOStream . hpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / include / assimp / IOStreamBuffer . h <nl> ppp b / thirdparty / assimp / include / assimp / IOStreamBuffer . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / include / assimp / IOSystem . hpp <nl> ppp b / thirdparty / assimp / include / assimp / IOSystem . hpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / include / assimp / Importer . hpp <nl> ppp b / thirdparty / assimp / include / assimp / Importer . hpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> class ASSIMP_API Importer { <nl> * The return value remains valid until the property is modified . <nl> * @ see GetPropertyInteger ( ) <nl> * / <nl> - std : : string GetPropertyString ( const char * szName , <nl> + const std : : string GetPropertyString ( const char * szName , <nl> const std : : string & sErrorReturn = " " ) const ; <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> class ASSIMP_API Importer { <nl> * The return value remains valid until the property is modified . <nl> * @ see GetPropertyInteger ( ) <nl> * / <nl> - aiMatrix4x4 GetPropertyMatrix ( const char * szName , <nl> + const aiMatrix4x4 GetPropertyMatrix ( const char * szName , <nl> const aiMatrix4x4 & sErrorReturn = aiMatrix4x4 ( ) ) const ; <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> mmm a / thirdparty / assimp / include / assimp / LineSplitter . h <nl> ppp b / thirdparty / assimp / include / assimp / LineSplitter . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> for ( LineSplitter splitter ( stream ) ; splitter ; + + splitter ) { <nl> if ( strtol ( splitter [ 2 ] ) > 5 ) { . . } <nl> } <nl> <nl> - ASSIMP_LOG_DEBUG_F ( " Current line is : " , splitter . get_index ( ) ) ; <nl> + std : : cout < < " Current line is : " < < splitter . get_index ( ) < < std : : endl ; <nl> } <nl> @ endcode <nl> * / <nl> mmm a / thirdparty / assimp / include / assimp / LogAux . h <nl> ppp b / thirdparty / assimp / include / assimp / LogAux . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / include / assimp / LogStream . hpp <nl> ppp b / thirdparty / assimp / include / assimp / LogStream . hpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / include / assimp / Logger . hpp <nl> ppp b / thirdparty / assimp / include / assimp / Logger . hpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / include / assimp / MathFunctions . h <nl> ppp b / thirdparty / assimp / include / assimp / MathFunctions . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2016 , assimp team <nl> <nl> All rights reserved . <nl> <nl> mmm a / thirdparty / assimp / include / assimp / MemoryIOWrapper . h <nl> ppp b / thirdparty / assimp / include / assimp / MemoryIOWrapper . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / include / assimp / NullLogger . hpp <nl> ppp b / thirdparty / assimp / include / assimp / NullLogger . hpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / include / assimp / ParsingUtils . h <nl> ppp b / thirdparty / assimp / include / assimp / ParsingUtils . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / include / assimp / Profiler . h <nl> ppp b / thirdparty / assimp / include / assimp / Profiler . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / include / assimp / ProgressHandler . hpp <nl> ppp b / thirdparty / assimp / include / assimp / ProgressHandler . hpp <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / include / assimp / RemoveComments . h <nl> ppp b / thirdparty / assimp / include / assimp / RemoveComments . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> All rights reserved . <nl> <nl> mmm a / thirdparty / assimp / include / assimp / SGSpatialSort . h <nl> ppp b / thirdparty / assimp / include / assimp / SGSpatialSort . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / include / assimp / SceneCombiner . h <nl> ppp b / thirdparty / assimp / include / assimp / SceneCombiner . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / include / assimp / SkeletonMeshBuilder . h <nl> ppp b / thirdparty / assimp / include / assimp / SkeletonMeshBuilder . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / include / assimp / SmoothingGroups . h <nl> ppp b / thirdparty / assimp / include / assimp / SmoothingGroups . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / include / assimp / SmoothingGroups . inl <nl> ppp b / thirdparty / assimp / include / assimp / SmoothingGroups . inl <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2012 , assimp team <nl> <nl> All rights reserved . <nl> <nl> mmm a / thirdparty / assimp / include / assimp / SpatialSort . h <nl> ppp b / thirdparty / assimp / include / assimp / SpatialSort . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / include / assimp / StandardShapes . h <nl> ppp b / thirdparty / assimp / include / assimp / StandardShapes . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / include / assimp / StreamReader . h <nl> ppp b / thirdparty / assimp / include / assimp / StreamReader . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / include / assimp / StreamWriter . h <nl> ppp b / thirdparty / assimp / include / assimp / StreamWriter . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / include / assimp / StringComparison . h <nl> ppp b / thirdparty / assimp / include / assimp / StringComparison . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / include / assimp / StringUtils . h <nl> ppp b / thirdparty / assimp / include / assimp / StringUtils . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / include / assimp / Subdivision . h <nl> ppp b / thirdparty / assimp / include / assimp / Subdivision . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / include / assimp / TinyFormatter . h <nl> ppp b / thirdparty / assimp / include / assimp / TinyFormatter . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / include / assimp / Vertex . h <nl> ppp b / thirdparty / assimp / include / assimp / Vertex . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / include / assimp / XMLTools . h <nl> ppp b / thirdparty / assimp / include / assimp / XMLTools . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / include / assimp / aabb . h <nl> ppp b / thirdparty / assimp / include / assimp / aabb . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> All rights reserved . <nl> <nl> mmm a / thirdparty / assimp / include / assimp / ai_assert . h <nl> ppp b / thirdparty / assimp / include / assimp / ai_assert . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / include / assimp / anim . h <nl> ppp b / thirdparty / assimp / include / assimp / anim . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / include / assimp / camera . h <nl> ppp b / thirdparty / assimp / include / assimp / camera . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> All rights reserved . <nl> <nl> mmm a / thirdparty / assimp / include / assimp / cexport . h <nl> ppp b / thirdparty / assimp / include / assimp / cexport . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> All rights reserved . <nl> <nl> mmm a / thirdparty / assimp / include / assimp / cfileio . h <nl> ppp b / thirdparty / assimp / include / assimp / cfileio . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / include / assimp / cimport . h <nl> ppp b / thirdparty / assimp / include / assimp / cimport . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / include / assimp / color4 . h <nl> ppp b / thirdparty / assimp / include / assimp / color4 . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / include / assimp / color4 . inl <nl> ppp b / thirdparty / assimp / include / assimp / color4 . inl <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> deleted file mode 100644 <nl> index f3f7d170ae6 . . 00000000000 <nl> mmm a / thirdparty / assimp / include / assimp / commonMetaData . h <nl> ppp / dev / null <nl> <nl> - / * <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> - <nl> - <nl> - <nl> - All rights reserved . <nl> - <nl> - Redistribution and use of this software in source and binary forms , <nl> - with or without modification , are permitted provided that the following <nl> - conditions are met : <nl> - <nl> - * Redistributions of source code must retain the above <nl> - copyright notice , this list of conditions and the <nl> - following disclaimer . <nl> - <nl> - * Redistributions in binary form must reproduce the above <nl> - copyright notice , this list of conditions and the <nl> - following disclaimer in the documentation and / or other <nl> - materials provided with the distribution . <nl> - <nl> - * Neither the name of the assimp team , nor the names of its <nl> - contributors may be used to endorse or promote products <nl> - derived from this software without specific prior <nl> - written permission of the assimp team . <nl> - <nl> - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> - " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> - LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> - A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> - SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> - LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> - DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> - THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> - ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> - OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - * / <nl> - <nl> - / * * @ file commonMetaData . h <nl> - * @ brief Defines a set of common scene metadata keys . <nl> - * / <nl> - # pragma once <nl> - # ifndef AI_COMMONMETADATA_H_INC <nl> - # define AI_COMMONMETADATA_H_INC <nl> - <nl> - / / / Scene metadata holding the name of the importer which loaded the source asset . <nl> - / / / This is always present if the scene was created from an imported asset . <nl> - # define AI_METADATA_SOURCE_FORMAT " SourceAsset_Format " <nl> - <nl> - / / / Scene metadata holding the version of the source asset as a string , if available . <nl> - / / / Not all formats add this metadata . <nl> - # define AI_METADATA_SOURCE_FORMAT_VERSION " SourceAsset_FormatVersion " <nl> - <nl> - / / / Scene metadata holding the name of the software which generated the source asset , if available . <nl> - / / / Not all formats add this metadata . <nl> - # define AI_METADATA_SOURCE_GENERATOR " SourceAsset_Generator " <nl> - <nl> - / / / Scene metadata holding the source asset copyright statement , if available . <nl> - / / / Not all formats add this metadata . <nl> - # define AI_METADATA_SOURCE_COPYRIGHT " SourceAsset_Copyright " <nl> - <nl> - # endif <nl> mmm a / thirdparty / assimp / include / assimp / config . h <nl> ppp b / thirdparty / assimp / include / assimp / config . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2018 , assimp team <nl> <nl> <nl> All rights reserved . <nl> enum aiComponent <nl> # define AI_CONFIG_IMPORT_SMD_KEYFRAME " IMPORT_SMD_KEYFRAME " <nl> # define AI_CONFIG_IMPORT_UNREAL_KEYFRAME " IMPORT_UNREAL_KEYFRAME " <nl> <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> - / * * @ brief Set whether the MDL ( HL1 ) importer will read animations . <nl> - * <nl> - * The default value is true ( 1 ) <nl> - * Property type : bool <nl> - * / <nl> - # define AI_CONFIG_IMPORT_MDL_HL1_READ_ANIMATIONS " IMPORT_MDL_HL1_READ_ANIMATIONS " <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> - / * * @ brief Set whether the MDL ( HL1 ) importer will read animation events . <nl> - * \ note This property requires AI_CONFIG_IMPORT_MDL_HL1_READ_ANIMATIONS to be set to true . <nl> - * <nl> - * The default value is true ( 1 ) <nl> - * Property type : bool <nl> - * / <nl> - # define AI_CONFIG_IMPORT_MDL_HL1_READ_ANIMATION_EVENTS " IMPORT_MDL_HL1_READ_ANIMATION_EVENTS " <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> - / * * @ brief Set whether the MDL ( HL1 ) importer will read blend controllers . <nl> - * \ note This property requires AI_CONFIG_IMPORT_MDL_HL1_READ_ANIMATIONS to be set to true . <nl> - * <nl> - * The default value is true ( 1 ) <nl> - * Property type : bool <nl> - * / <nl> - # define AI_CONFIG_IMPORT_MDL_HL1_READ_BLEND_CONTROLLERS " IMPORT_MDL_HL1_READ_BLEND_CONTROLLERS " <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> - / * * @ brief Set whether the MDL ( HL1 ) importer will read sequence transition graph . <nl> - * \ note This property requires AI_CONFIG_IMPORT_MDL_HL1_READ_ANIMATIONS to be set to true . <nl> - * <nl> - * The default value is true ( 1 ) <nl> - * Property type : bool <nl> - * / <nl> - # define AI_CONFIG_IMPORT_MDL_HL1_READ_SEQUENCE_TRANSITIONS " IMPORT_MDL_HL1_READ_SEQUENCE_TRANSITIONS " <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> - / * * @ brief Set whether the MDL ( HL1 ) importer will read attachments info . <nl> - * <nl> - * The default value is true ( 1 ) <nl> - * Property type : bool <nl> - * / <nl> - # define AI_CONFIG_IMPORT_MDL_HL1_READ_ATTACHMENTS " IMPORT_MDL_HL1_READ_ATTACHMENTS " <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> - / * * @ brief Set whether the MDL ( HL1 ) importer will read bone controllers info . <nl> - * <nl> - * The default value is true ( 1 ) <nl> - * Property type : bool <nl> - * / <nl> - # define AI_CONFIG_IMPORT_MDL_HL1_READ_BONE_CONTROLLERS " IMPORT_MDL_HL1_READ_BONE_CONTROLLERS " <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> - / * * @ brief Set whether the MDL ( HL1 ) importer will read hitboxes info . <nl> - * <nl> - * The default value is true ( 1 ) <nl> - * Property type : bool <nl> - * / <nl> - # define AI_CONFIG_IMPORT_MDL_HL1_READ_HITBOXES " IMPORT_MDL_HL1_READ_HITBOXES " <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> - / * * @ brief Set whether the MDL ( HL1 ) importer will read miscellaneous global model info . <nl> - * <nl> - * The default value is true ( 1 ) <nl> - * Property type : bool <nl> - * / <nl> - # define AI_CONFIG_IMPORT_MDL_HL1_READ_MISC_GLOBAL_INFO " IMPORT_MDL_HL1_READ_MISC_GLOBAL_INFO " <nl> - <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / * * Smd load multiple animations <nl> * <nl> mmm a / thirdparty / assimp / include / assimp / config . h . in <nl> ppp b / thirdparty / assimp / include / assimp / config . h . in <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2018 , assimp team <nl> <nl> <nl> All rights reserved . <nl> enum aiComponent <nl> # define AI_CONFIG_IMPORT_SMD_KEYFRAME " IMPORT_SMD_KEYFRAME " <nl> # define AI_CONFIG_IMPORT_UNREAL_KEYFRAME " IMPORT_UNREAL_KEYFRAME " <nl> <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> - / * * @ brief Set whether the MDL ( HL1 ) importer will read animations . <nl> - * <nl> - * The default value is true ( 1 ) <nl> - * Property type : bool <nl> - * / <nl> - # define AI_CONFIG_IMPORT_MDL_HL1_READ_ANIMATIONS " IMPORT_MDL_HL1_READ_ANIMATIONS " <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> - / * * @ brief Set whether the MDL ( HL1 ) importer will read animation events . <nl> - * \ note This property requires AI_CONFIG_IMPORT_MDL_HL1_READ_ANIMATIONS to be set to true . <nl> - * <nl> - * The default value is true ( 1 ) <nl> - * Property type : bool <nl> - * / <nl> - # define AI_CONFIG_IMPORT_MDL_HL1_READ_ANIMATION_EVENTS " IMPORT_MDL_HL1_READ_ANIMATION_EVENTS " <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> - / * * @ brief Set whether the MDL ( HL1 ) importer will read blend controllers . <nl> - * \ note This property requires AI_CONFIG_IMPORT_MDL_HL1_READ_ANIMATIONS to be set to true . <nl> - * <nl> - * The default value is true ( 1 ) <nl> - * Property type : bool <nl> - * / <nl> - # define AI_CONFIG_IMPORT_MDL_HL1_READ_BLEND_CONTROLLERS " IMPORT_MDL_HL1_READ_BLEND_CONTROLLERS " <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> - / * * @ brief Set whether the MDL ( HL1 ) importer will read sequence transition graph . <nl> - * \ note This property requires AI_CONFIG_IMPORT_MDL_HL1_READ_ANIMATIONS to be set to true . <nl> - * <nl> - * The default value is true ( 1 ) <nl> - * Property type : bool <nl> - * / <nl> - # define AI_CONFIG_IMPORT_MDL_HL1_READ_SEQUENCE_TRANSITIONS " IMPORT_MDL_HL1_READ_SEQUENCE_TRANSITIONS " <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> - / * * @ brief Set whether the MDL ( HL1 ) importer will read attachments info . <nl> - * <nl> - * The default value is true ( 1 ) <nl> - * Property type : bool <nl> - * / <nl> - # define AI_CONFIG_IMPORT_MDL_HL1_READ_ATTACHMENTS " IMPORT_MDL_HL1_READ_ATTACHMENTS " <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> - / * * @ brief Set whether the MDL ( HL1 ) importer will read bone controllers info . <nl> - * <nl> - * The default value is true ( 1 ) <nl> - * Property type : bool <nl> - * / <nl> - # define AI_CONFIG_IMPORT_MDL_HL1_READ_BONE_CONTROLLERS " IMPORT_MDL_HL1_READ_BONE_CONTROLLERS " <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> - / * * @ brief Set whether the MDL ( HL1 ) importer will read hitboxes info . <nl> - * <nl> - * The default value is true ( 1 ) <nl> - * Property type : bool <nl> - * / <nl> - # define AI_CONFIG_IMPORT_MDL_HL1_READ_HITBOXES " IMPORT_MDL_HL1_READ_HITBOXES " <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> - / * * @ brief Set whether the MDL ( HL1 ) importer will read miscellaneous global model info . <nl> - * <nl> - * The default value is true ( 1 ) <nl> - * Property type : bool <nl> - * / <nl> - # define AI_CONFIG_IMPORT_MDL_HL1_READ_MISC_GLOBAL_INFO " IMPORT_MDL_HL1_READ_MISC_GLOBAL_INFO " <nl> - <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / * * Smd load multiple animations <nl> * <nl> mmm a / thirdparty / assimp / include / assimp / defs . h <nl> ppp b / thirdparty / assimp / include / assimp / defs . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> All rights reserved . <nl> <nl> static const ai_real ai_epsilon = ( ai_real ) 0 . 00001 ; <nl> # define AI_MAX_ALLOC ( type ) ( ( 256U * 1024 * 1024 ) / sizeof ( type ) ) <nl> <nl> # ifndef _MSC_VER <nl> - # if __cplusplus > = 201103L / / C + + 11 <nl> - # define AI_NO_EXCEPT noexcept <nl> - # else <nl> - # define AI_NO_EXCEPT <nl> - # endif <nl> + # define AI_NO_EXCEPT noexcept <nl> # else <nl> # if ( _MSC_VER > = 1915 ) <nl> # define AI_NO_EXCEPT noexcept <nl> mmm a / thirdparty / assimp / include / assimp / importerdesc . h <nl> ppp b / thirdparty / assimp / include / assimp / importerdesc . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / include / assimp / light . h <nl> ppp b / thirdparty / assimp / include / assimp / light . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / include / assimp / material . h <nl> ppp b / thirdparty / assimp / include / assimp / material . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> enum aiTextureType <nl> <nl> # define AI_TEXTURE_TYPE_MAX aiTextureType_UNKNOWN <nl> <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - / / Get a string for a given aiTextureType <nl> - ASSIMP_API const char * TextureTypeToString ( enum aiTextureType in ) ; <nl> - <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / * * @ brief Defines all shading models supported by the library <nl> * <nl> mmm a / thirdparty / assimp / include / assimp / material . inl <nl> ppp b / thirdparty / assimp / include / assimp / material . inl <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / include / assimp / matrix3x3 . h <nl> ppp b / thirdparty / assimp / include / assimp / matrix3x3 . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / include / assimp / matrix3x3 . inl <nl> ppp b / thirdparty / assimp / include / assimp / matrix3x3 . inl <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / include / assimp / matrix4x4 . h <nl> ppp b / thirdparty / assimp / include / assimp / matrix4x4 . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / include / assimp / matrix4x4 . inl <nl> ppp b / thirdparty / assimp / include / assimp / matrix4x4 . inl <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> All rights reserved . <nl> <nl> mmm a / thirdparty / assimp / include / assimp / mesh . h <nl> ppp b / thirdparty / assimp / include / assimp / mesh . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / include / assimp / metadata . h <nl> ppp b / thirdparty / assimp / include / assimp / metadata . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> struct aiMetadata { <nl> new_values [ i ] = mValues [ i ] ; <nl> } <nl> <nl> - delete [ ] mKeys ; <nl> - delete [ ] mValues ; <nl> + delete mKeys ; <nl> + delete mValues ; <nl> <nl> mKeys = new_keys ; <nl> mValues = new_values ; <nl> struct aiMetadata { <nl> return true ; <nl> } <nl> <nl> - / / / Check whether there is a metadata entry for the given key . <nl> - / / / \ param [ in ] Key - the key value value to check for . <nl> - inline <nl> - bool HasKey ( const char * key ) { <nl> - if ( nullptr = = key ) { <nl> - return false ; <nl> - } <nl> - <nl> - / / Search for the given key <nl> - for ( unsigned int i = 0 ; i < mNumProperties ; + + i ) { <nl> - if ( 0 = = strncmp ( mKeys [ i ] . C_Str ( ) , key , mKeys [ i ] . length ) ) { <nl> - return true ; <nl> - } <nl> - } <nl> - return false ; <nl> - } <nl> - <nl> # endif / / __cplusplus <nl> <nl> } ; <nl> mmm a / thirdparty / assimp / include / assimp / pbrmaterial . h <nl> ppp b / thirdparty / assimp / include / assimp / pbrmaterial . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> All rights reserved . <nl> <nl> mmm a / thirdparty / assimp / include / assimp / port / AndroidJNI / AndroidJNIIOSystem . h <nl> ppp b / thirdparty / assimp / include / assimp / port / AndroidJNI / AndroidJNIIOSystem . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2016 , assimp team <nl> All rights reserved . <nl> <nl> Redistribution and use of this software in source and binary forms , <nl> mmm a / thirdparty / assimp / include / assimp / postprocess . h <nl> ppp b / thirdparty / assimp / include / assimp / postprocess . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / include / assimp / qnan . h <nl> ppp b / thirdparty / assimp / include / assimp / qnan . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / include / assimp / quaternion . h <nl> ppp b / thirdparty / assimp / include / assimp / quaternion . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> All rights reserved . <nl> mmm a / thirdparty / assimp / include / assimp / quaternion . inl <nl> ppp b / thirdparty / assimp / include / assimp / quaternion . inl <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / include / assimp / scene . h <nl> ppp b / thirdparty / assimp / include / assimp / scene . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / include / assimp / texture . h <nl> ppp b / thirdparty / assimp / include / assimp / texture . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> All rights reserved . <nl> <nl> struct aiTexture { <nl> , mHeight ( 0 ) <nl> , pcData ( nullptr ) <nl> , mFilename ( ) { <nl> - memset ( achFormatHint , 0 , sizeof ( achFormatHint ) ) ; <nl> + achFormatHint [ 0 ] = achFormatHint [ 1 ] = 0 ; <nl> + achFormatHint [ 2 ] = achFormatHint [ 3 ] = 0 ; <nl> } <nl> <nl> / / Destruction <nl> mmm a / thirdparty / assimp / include / assimp / types . h <nl> ppp b / thirdparty / assimp / include / assimp / types . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / include / assimp / vector2 . h <nl> ppp b / thirdparty / assimp / include / assimp / vector2 . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / include / assimp / vector2 . inl <nl> ppp b / thirdparty / assimp / include / assimp / vector2 . inl <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / include / assimp / vector3 . h <nl> ppp b / thirdparty / assimp / include / assimp / vector3 . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / include / assimp / vector3 . inl <nl> ppp b / thirdparty / assimp / include / assimp / vector3 . inl <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> mmm a / thirdparty / assimp / include / assimp / version . h <nl> ppp b / thirdparty / assimp / include / assimp / version . h <nl> <nl> Open Asset Import Library ( assimp ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> - Copyright ( c ) 2006 - 2020 , assimp team <nl> + Copyright ( c ) 2006 - 2019 , assimp team <nl> <nl> <nl> <nl> extern " C " { <nl> * / <nl> ASSIMP_API const char * aiGetLegalString ( void ) ; <nl> <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> - / * * @ brief Returns the current patch version number of Assimp . <nl> - * @ return Patch version of the Assimp runtime the application was <nl> - * linked / built against <nl> - * / <nl> - ASSIMP_API unsigned int aiGetVersionPatch ( void ) ; <nl> - <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / * * @ brief Returns the current minor version number of Assimp . <nl> * @ return Minor version of the Assimp runtime the application was <nl> mmm a / thirdparty / assimp / revision . h <nl> ppp b / thirdparty / assimp / revision . h <nl> <nl> # ifndef ASSIMP_REVISION_H_INC <nl> # define ASSIMP_REVISION_H_INC <nl> <nl> - # define GitVersion 0x0201fc57 <nl> + # define GitVersion 0x308db73d <nl> # define GitBranch " master " <nl> <nl> # define VER_MAJOR 5 <nl> # define VER_MINOR 0 <nl> - # define VER_PATCH 1 <nl> + # define VER_PATCH 0 <nl> # define VER_BUILD 0 <nl> <nl> # define STR_HELP ( x ) # x <nl> <nl> # if ( GitVersion = = 0 ) <nl> # define VER_FILEVERSION_STR STR ( VER_MAJOR ) " . " STR ( VER_MINOR ) " . " STR ( VER_PATCH ) " . " STR ( VER_BUILD ) <nl> # else <nl> - # define VER_FILEVERSION_STR STR ( VER_MAJOR ) " . " STR ( VER_MINOR ) " . " STR ( VER_PATCH ) " . " STR ( VER_BUILD ) " ( Commit 0201fc57 ) " <nl> + # define VER_FILEVERSION_STR STR ( VER_MAJOR ) " . " STR ( VER_MINOR ) " . " STR ( VER_PATCH ) " . " STR ( VER_BUILD ) " ( Commit 308db73d ) " <nl> # endif <nl> <nl> # ifdef NDEBUG <nl>
|
Revert " assimp : Sync with upstream 0201fc5 "
|
godotengine/godot
|
da1f80c1f2d71aeaee9f57fd19fc2ea4f76c487d
|
2020-03-09T09:42:18Z
|
mmm a / src / compiler / expression / binary_op_expression . cpp <nl> ppp b / src / compiler / expression / binary_op_expression . cpp <nl> ExpressionPtr BinaryOpExpression : : postOptimize ( AnalysisResultPtr ar ) { <nl> return ExpressionPtr ( ) ; <nl> } <nl> <nl> - static ExpressionPtr makeIsNull ( LocationPtr loc , ExpressionPtr exp ) { <nl> - / * Replace " $ x = = = null " with an is_null call ; this requires slightly <nl> - * less work at runtime . * / <nl> - ExpressionListPtr expList = <nl> - ExpressionListPtr ( new ExpressionList ( loc , <nl> - Expression : : KindOfExpressionList ) ) ; <nl> - expList - > insertElement ( exp ) ; <nl> - <nl> - SimpleFunctionCallPtr call <nl> - ( new SimpleFunctionCall ( loc , Expression : : KindOfSimpleFunctionCall , <nl> - " is_null " , expList , ExpressionPtr ( ) ) ) ; <nl> - <nl> - call - > setValid ( ) ; <nl> - call - > setActualType ( Type : : Boolean ) ; <nl> - <nl> - return call ; <nl> - } <nl> - <nl> ExpressionPtr BinaryOpExpression : : foldConst ( AnalysisResultPtr ar ) { <nl> ExpressionPtr optExp ; <nl> Variant v1 ; <nl> Variant v2 ; <nl> <nl> - if ( ! m_exp2 - > getScalarValue ( v2 ) ) { <nl> - if ( m_exp1 - > isScalar ( ) & & m_exp1 - > getScalarValue ( v1 ) ) { <nl> - switch ( m_op ) { <nl> - case T_IS_IDENTICAL : <nl> - if ( v1 . isNull ( ) ) return makeIsNull ( getLocation ( ) , m_exp2 ) ; <nl> - break ; <nl> - default : <nl> - break ; <nl> - } <nl> - } <nl> - <nl> - return ExpressionPtr ( ) ; <nl> - } <nl> + if ( ! m_exp2 - > getScalarValue ( v2 ) ) return ExpressionPtr ( ) ; <nl> <nl> if ( m_exp1 - > isScalar ( ) ) { <nl> if ( ! m_exp1 - > getScalarValue ( v1 ) ) return ExpressionPtr ( ) ; <nl> ExpressionPtr BinaryOpExpression : : foldConst ( AnalysisResultPtr ar ) { <nl> optExp = foldConstRightAssoc ( ar ) ; <nl> if ( optExp ) return optExp ; <nl> break ; <nl> - case T_IS_IDENTICAL : <nl> - if ( v2 . isNull ( ) ) return makeIsNull ( getLocation ( ) , m_exp1 ) ; <nl> - break ; <nl> default : <nl> break ; <nl> } <nl>
|
Revert " Replace " $ x = = = null " and " null = = = $ x " with calls to is_null ( ) . "
|
facebook/hhvm
|
ba23617629a18d2f893f2748c7e46729731ec9f5
|
2010-06-07T21:39:56Z
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.