mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-07-01 13:50:36 +00:00
Merged in QLOUD functionality. Also adds cursor-style options and fixes some bugs (includes corrected _CONNECTIONADDRESS detection).
This commit is contained in:
parent
788a449d95
commit
d5befc30a8
BIN
internal/c/c_compiler/7z/7-zip.chm
Normal file
BIN
internal/c/c_compiler/7z/7-zip.chm
Normal file
Binary file not shown.
BIN
internal/c/c_compiler/7z/7za.exe
Normal file
BIN
internal/c/c_compiler/7z/7za.exe
Normal file
Binary file not shown.
29
internal/c/c_compiler/7z/license.txt
Normal file
29
internal/c/c_compiler/7z/license.txt
Normal file
|
@ -0,0 +1,29 @@
|
|||
7-Zip Command line version
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
License for use and distribution
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
7-Zip Copyright (C) 1999-2010 Igor Pavlov.
|
||||
|
||||
7za.exe is distributed under the GNU LGPL license
|
||||
|
||||
Notes:
|
||||
You can use 7-Zip on any computer, including a computer in a commercial
|
||||
organization. You don't need to register or pay for 7-Zip.
|
||||
|
||||
|
||||
GNU LGPL information
|
||||
--------------------
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You can receive a copy of the GNU Lesser General Public License from
|
||||
http://www.gnu.org/
|
41
internal/c/c_compiler/7z/readme.txt
Normal file
41
internal/c/c_compiler/7z/readme.txt
Normal file
|
@ -0,0 +1,41 @@
|
|||
7-Zip Command line version 9.20
|
||||
-------------------------------
|
||||
|
||||
7-Zip is a file archiver with high compression ratio.
|
||||
7za.exe is a standalone command line version of 7-Zip.
|
||||
|
||||
7-Zip Copyright (C) 1999-2010 Igor Pavlov.
|
||||
|
||||
Features of 7za.exe:
|
||||
- High compression ratio in new 7z format
|
||||
- Supported formats:
|
||||
- Packing / unpacking: 7z, xz, ZIP, GZIP, BZIP2 and TAR
|
||||
- Unpacking only: Z, lzma
|
||||
- Highest compression ratio for ZIP and GZIP formats.
|
||||
- Fast compression and decompression
|
||||
- Strong AES-256 encryption in 7z and ZIP formats.
|
||||
|
||||
7za.exe is a free software distributed under the GNU LGPL.
|
||||
Read license.txt for more information.
|
||||
|
||||
Source code of 7za.exe and 7-Zip can be found at
|
||||
http://www.7-zip.org/
|
||||
|
||||
7za.exe can work in Windows 95/98/ME/NT/2000/2003/2008/XP/Vista/7.
|
||||
|
||||
There is also port of 7za.exe for POSIX systems like Unix (Linux, Solaris, OpenBSD,
|
||||
FreeBSD, Cygwin, AIX, ...), MacOS X and BeOS:
|
||||
|
||||
http://p7zip.sourceforge.net/
|
||||
|
||||
|
||||
This distributive packet contains the following files:
|
||||
|
||||
7za.exe - 7-Zip standalone command line version.
|
||||
readme.txt - This file.
|
||||
license.txt - License information.
|
||||
7-zip.chm - User's Manual in HTML Help format.
|
||||
|
||||
|
||||
---
|
||||
End of document
|
File diff suppressed because it is too large
Load diff
|
@ -1,16 +1,17 @@
|
|||
//Note: Updated 16/1/2013: Switched to QB64.NET IP service
|
||||
//Note: Updated 15/7/2013: Switched to 223.27.25.123 because of DNS issues
|
||||
|
||||
/*
|
||||
PRINT whatismyip$
|
||||
|
||||
$CHECKING:OFF
|
||||
FUNCTION whatismyip$
|
||||
c = _OPENCLIENT("TCP/IP:80:www.qb64.net")
|
||||
c = _OPENCLIENT("TCP/IP:80:223.27.25.123")
|
||||
IF c = 0 THEN EXIT FUNCTION
|
||||
'send request
|
||||
e$ = CHR$(13) + CHR$(10)
|
||||
x$ = "GET /ip.php HTTP/1.1" + e$
|
||||
x$ = x$ + "Host: www.qb64.net" + e$
|
||||
x$ = x$ + "Host: 223.27.25.123" + e$
|
||||
x$ = x$ + "" + e$
|
||||
PUT #c, , x$
|
||||
'wait for reply
|
||||
|
@ -117,7 +118,7 @@ mem_lock *sf_mem_lock;
|
|||
new_mem_lock();
|
||||
sf_mem_lock=mem_lock_tmp;
|
||||
sf_mem_lock->type=3;
|
||||
*_FUNC_WHATISMYIP_SINGLE_C=func__openclient(qbs_new_txt_len("TCP/IP:80:www.qb64.net",22));
|
||||
*_FUNC_WHATISMYIP_SINGLE_C=func__openclient(qbs_new_txt_len("TCP/IP:80:223.27.25.123",23));
|
||||
qbs_cleanup(qbs_tmp_base,0);
|
||||
if ((-(*_FUNC_WHATISMYIP_SINGLE_C== 0 ))||new_error){
|
||||
goto exit_subfunc;
|
||||
|
@ -126,7 +127,7 @@ qbs_set(_FUNC_WHATISMYIP_STRING_E,qbs_add(func_chr( 13 ),func_chr( 10 )));
|
|||
qbs_cleanup(qbs_tmp_base,0);
|
||||
qbs_set(_FUNC_WHATISMYIP_STRING_X,qbs_add(qbs_new_txt_len("GET /ip.php HTTP/1.1",20),_FUNC_WHATISMYIP_STRING_E));
|
||||
qbs_cleanup(qbs_tmp_base,0);
|
||||
qbs_set(_FUNC_WHATISMYIP_STRING_X,qbs_add(qbs_add(_FUNC_WHATISMYIP_STRING_X,qbs_new_txt_len("Host: www.qb64.net",18)),_FUNC_WHATISMYIP_STRING_E));
|
||||
qbs_set(_FUNC_WHATISMYIP_STRING_X,qbs_add(qbs_add(_FUNC_WHATISMYIP_STRING_X,qbs_new_txt_len("Host: 223.27.25.123",19)),_FUNC_WHATISMYIP_STRING_E));
|
||||
qbs_cleanup(qbs_tmp_base,0);
|
||||
qbs_set(_FUNC_WHATISMYIP_STRING_X,qbs_add(qbs_add(_FUNC_WHATISMYIP_STRING_X,qbs_new_txt_len("",0)),_FUNC_WHATISMYIP_STRING_E));
|
||||
qbs_cleanup(qbs_tmp_base,0);
|
||||
|
|
|
@ -1,285 +1,285 @@
|
|||
#ifndef FREEGLUT_STATIC
|
||||
#define FREEGLUT_STATIC
|
||||
#endif
|
||||
/*
|
||||
* freeglut_cursor.c
|
||||
*
|
||||
* The mouse cursor related stuff.
|
||||
*
|
||||
* Copyright (c) 1999-2000 Pawel W. Olszta. All Rights Reserved.
|
||||
* Written by Pawel W. Olszta, <olszta@sourceforge.net>
|
||||
* Creation date: Thu Dec 16 1999
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "freeglut.h"
|
||||
#include "freeglut_internal.h"
|
||||
|
||||
/*
|
||||
* TODO BEFORE THE STABLE RELEASE:
|
||||
* glutSetCursor() -- Win32 mappings are incomplete.
|
||||
*
|
||||
* It would be good to use custom mouse cursor shapes, and introduce
|
||||
* an option to display them using glBitmap() and/or texture mapping,
|
||||
* apart from the windowing system version.
|
||||
*/
|
||||
|
||||
/* -- PRIVATE FUNCTIONS --------------------------------------------------- */
|
||||
|
||||
#if TARGET_HOST_POSIX_X11 || TARGET_HOST_MAC_OSX || TARGET_HOST_SOLARIS
|
||||
#include <X11/cursorfont.h>
|
||||
|
||||
/*
|
||||
* A factory method for an empty cursor
|
||||
*/
|
||||
static Cursor getEmptyCursor( void )
|
||||
{
|
||||
static Cursor cursorNone = None;
|
||||
if( cursorNone == None ) {
|
||||
char cursorNoneBits[ 32 ];
|
||||
XColor dontCare;
|
||||
Pixmap cursorNonePixmap;
|
||||
memset( cursorNoneBits, 0, sizeof( cursorNoneBits ) );
|
||||
memset( &dontCare, 0, sizeof( dontCare ) );
|
||||
cursorNonePixmap = XCreateBitmapFromData ( fgDisplay.Display,
|
||||
fgDisplay.RootWindow,
|
||||
cursorNoneBits, 16, 16 );
|
||||
if( cursorNonePixmap != None ) {
|
||||
cursorNone = XCreatePixmapCursor( fgDisplay.Display,
|
||||
cursorNonePixmap, cursorNonePixmap,
|
||||
&dontCare, &dontCare, 0, 0 );
|
||||
XFreePixmap( fgDisplay.Display, cursorNonePixmap );
|
||||
}
|
||||
}
|
||||
return cursorNone;
|
||||
}
|
||||
|
||||
typedef struct tag_cursorCacheEntry cursorCacheEntry;
|
||||
struct tag_cursorCacheEntry {
|
||||
unsigned int cursorShape; /* an XC_foo value */
|
||||
Cursor cachedCursor; /* None if the corresponding cursor has
|
||||
not been created yet */
|
||||
};
|
||||
|
||||
/*
|
||||
* Note: The arrangement of the table below depends on the fact that
|
||||
* the "normal" GLUT_CURSOR_* values start a 0 and are consecutive.
|
||||
*/
|
||||
static cursorCacheEntry cursorCache[] = {
|
||||
{ XC_arrow, None }, /* GLUT_CURSOR_RIGHT_ARROW */
|
||||
{ XC_top_left_arrow, None }, /* GLUT_CURSOR_LEFT_ARROW */
|
||||
{ XC_hand1, None }, /* GLUT_CURSOR_INFO */
|
||||
{ XC_pirate, None }, /* GLUT_CURSOR_DESTROY */
|
||||
{ XC_question_arrow, None }, /* GLUT_CURSOR_HELP */
|
||||
{ XC_exchange, None }, /* GLUT_CURSOR_CYCLE */
|
||||
{ XC_spraycan, None }, /* GLUT_CURSOR_SPRAY */
|
||||
{ XC_watch, None }, /* GLUT_CURSOR_WAIT */
|
||||
{ XC_xterm, None }, /* GLUT_CURSOR_TEXT */
|
||||
{ XC_crosshair, None }, /* GLUT_CURSOR_CROSSHAIR */
|
||||
{ XC_sb_v_double_arrow, None }, /* GLUT_CURSOR_UP_DOWN */
|
||||
{ XC_sb_h_double_arrow, None }, /* GLUT_CURSOR_LEFT_RIGHT */
|
||||
{ XC_top_side, None }, /* GLUT_CURSOR_TOP_SIDE */
|
||||
{ XC_bottom_side, None }, /* GLUT_CURSOR_BOTTOM_SIDE */
|
||||
{ XC_left_side, None }, /* GLUT_CURSOR_LEFT_SIDE */
|
||||
{ XC_right_side, None }, /* GLUT_CURSOR_RIGHT_SIDE */
|
||||
{ XC_top_left_corner, None }, /* GLUT_CURSOR_TOP_LEFT_CORNER */
|
||||
{ XC_top_right_corner, None }, /* GLUT_CURSOR_TOP_RIGHT_CORNER */
|
||||
{ XC_bottom_right_corner, None }, /* GLUT_CURSOR_BOTTOM_RIGHT_CORNER */
|
||||
{ XC_bottom_left_corner, None } /* GLUT_CURSOR_BOTTOM_LEFT_CORNER */
|
||||
};
|
||||
|
||||
static void fghSetCursor ( SFG_Window *window, int cursorID )
|
||||
{
|
||||
Cursor cursor;
|
||||
/*
|
||||
* XXX FULL_CROSSHAIR demotes to plain CROSSHAIR. Old GLUT allows
|
||||
* for this, but if there is a system that easily supports a full-
|
||||
* window (or full-screen) crosshair, we might consider it.
|
||||
*/
|
||||
int cursorIDToUse =
|
||||
( cursorID == GLUT_CURSOR_FULL_CROSSHAIR ) ? GLUT_CURSOR_CROSSHAIR : cursorID;
|
||||
|
||||
if( ( cursorIDToUse >= 0 ) &&
|
||||
( cursorIDToUse < sizeof( cursorCache ) / sizeof( cursorCache[0] ) ) ) {
|
||||
cursorCacheEntry *entry = &cursorCache[ cursorIDToUse ];
|
||||
if( entry->cachedCursor == None ) {
|
||||
entry->cachedCursor =
|
||||
XCreateFontCursor( fgDisplay.Display, entry->cursorShape );
|
||||
}
|
||||
cursor = entry->cachedCursor;
|
||||
} else {
|
||||
switch( cursorIDToUse )
|
||||
{
|
||||
case GLUT_CURSOR_NONE:
|
||||
cursor = getEmptyCursor( );
|
||||
break;
|
||||
|
||||
case GLUT_CURSOR_INHERIT:
|
||||
cursor = None;
|
||||
break;
|
||||
|
||||
default:
|
||||
fgError( "Unknown cursor type: %d", cursorIDToUse );
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if ( cursorIDToUse == GLUT_CURSOR_INHERIT ) {
|
||||
XUndefineCursor( fgDisplay.Display, window->Window.Handle );
|
||||
} else if ( cursor != None ) {
|
||||
XDefineCursor( fgDisplay.Display, window->Window.Handle, cursor );
|
||||
} else if ( cursorIDToUse != GLUT_CURSOR_NONE ) {
|
||||
fgError( "Failed to create cursor" );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void fghWarpPointer ( int x, int y )
|
||||
{
|
||||
XWarpPointer(
|
||||
fgDisplay.Display,
|
||||
None,
|
||||
fgStructure.CurrentWindow->Window.Handle,
|
||||
0, 0, 0, 0,
|
||||
x, y
|
||||
);
|
||||
/* Make the warp visible immediately. */
|
||||
XFlush( fgDisplay.Display );
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if TARGET_HOST_MS_WINDOWS
|
||||
static void fghSetCursor ( SFG_Window *window, int cursorID )
|
||||
{
|
||||
/*
|
||||
* Joe Krahn is re-writing the following code.
|
||||
*/
|
||||
/* Set the cursor AND change it for this window class. */
|
||||
#if !defined(__MINGW64__) && _MSC_VER <= 1200
|
||||
# define MAP_CURSOR(a,b) \
|
||||
case a: \
|
||||
SetCursor( LoadCursor( NULL, b ) ); \
|
||||
SetClassLong( window->Window.Handle, \
|
||||
GCL_HCURSOR, \
|
||||
( LONG )LoadCursor( NULL, b ) ); \
|
||||
break;
|
||||
/* Nuke the cursor AND change it for this window class. */
|
||||
# define ZAP_CURSOR(a,b) \
|
||||
case a: \
|
||||
SetCursor( NULL ); \
|
||||
SetClassLong( window->Window.Handle, \
|
||||
GCL_HCURSOR, ( LONG )NULL ); \
|
||||
break;
|
||||
#else
|
||||
# define MAP_CURSOR(a,b) \
|
||||
case a: \
|
||||
SetCursor( LoadCursor( NULL, b ) ); \
|
||||
SetClassLongPtr( window->Window.Handle, \
|
||||
GCLP_HCURSOR, \
|
||||
( LONG )( LONG_PTR )LoadCursor( NULL, b ) ); \
|
||||
break;
|
||||
/* Nuke the cursor AND change it for this window class. */
|
||||
# define ZAP_CURSOR(a,b) \
|
||||
case a: \
|
||||
SetCursor( NULL ); \
|
||||
SetClassLongPtr( window->Window.Handle, \
|
||||
GCLP_HCURSOR, ( LONG )( LONG_PTR )NULL ); \
|
||||
break;
|
||||
#endif
|
||||
|
||||
switch( cursorID )
|
||||
{
|
||||
MAP_CURSOR( GLUT_CURSOR_RIGHT_ARROW, IDC_ARROW );
|
||||
MAP_CURSOR( GLUT_CURSOR_LEFT_ARROW, IDC_ARROW );
|
||||
MAP_CURSOR( GLUT_CURSOR_INFO, IDC_HELP );
|
||||
MAP_CURSOR( GLUT_CURSOR_DESTROY, IDC_CROSS );
|
||||
MAP_CURSOR( GLUT_CURSOR_HELP, IDC_HELP );
|
||||
MAP_CURSOR( GLUT_CURSOR_CYCLE, IDC_SIZEALL );
|
||||
MAP_CURSOR( GLUT_CURSOR_SPRAY, IDC_CROSS );
|
||||
MAP_CURSOR( GLUT_CURSOR_WAIT, IDC_WAIT );
|
||||
MAP_CURSOR( GLUT_CURSOR_TEXT, IDC_IBEAM );
|
||||
MAP_CURSOR( GLUT_CURSOR_CROSSHAIR, IDC_CROSS );
|
||||
MAP_CURSOR( GLUT_CURSOR_UP_DOWN, IDC_SIZENS );
|
||||
MAP_CURSOR( GLUT_CURSOR_LEFT_RIGHT, IDC_SIZEWE );
|
||||
MAP_CURSOR( GLUT_CURSOR_TOP_SIDE, IDC_ARROW ); /* XXX ToDo */
|
||||
MAP_CURSOR( GLUT_CURSOR_BOTTOM_SIDE, IDC_ARROW ); /* XXX ToDo */
|
||||
MAP_CURSOR( GLUT_CURSOR_LEFT_SIDE, IDC_ARROW ); /* XXX ToDo */
|
||||
MAP_CURSOR( GLUT_CURSOR_RIGHT_SIDE, IDC_ARROW ); /* XXX ToDo */
|
||||
MAP_CURSOR( GLUT_CURSOR_TOP_LEFT_CORNER, IDC_SIZENWSE );
|
||||
MAP_CURSOR( GLUT_CURSOR_TOP_RIGHT_CORNER, IDC_SIZENESW );
|
||||
MAP_CURSOR( GLUT_CURSOR_BOTTOM_RIGHT_CORNER, IDC_SIZENWSE );
|
||||
MAP_CURSOR( GLUT_CURSOR_BOTTOM_LEFT_CORNER, IDC_SIZENESW );
|
||||
MAP_CURSOR( GLUT_CURSOR_INHERIT, IDC_ARROW ); /* XXX ToDo */
|
||||
ZAP_CURSOR( GLUT_CURSOR_NONE, NULL );
|
||||
MAP_CURSOR( GLUT_CURSOR_FULL_CROSSHAIR, IDC_CROSS ); /* XXX ToDo */
|
||||
|
||||
default:
|
||||
fgError( "Unknown cursor type: %d", cursorID );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void fghWarpPointer ( int x, int y )
|
||||
{
|
||||
POINT coords;
|
||||
coords.x = x;
|
||||
coords.y = y;
|
||||
|
||||
/* ClientToScreen() translates {coords} for us. */
|
||||
ClientToScreen( fgStructure.CurrentWindow->Window.Handle, &coords );
|
||||
SetCursorPos( coords.x, coords.y );
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/* -- INTERNAL FUNCTIONS ---------------------------------------------------- */
|
||||
void fgSetCursor ( SFG_Window *window, int cursorID )
|
||||
{
|
||||
fghSetCursor ( window, cursorID );
|
||||
}
|
||||
|
||||
|
||||
/* -- INTERFACE FUNCTIONS -------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* Set the cursor image to be used for the current window
|
||||
*/
|
||||
void FGAPIENTRY glutSetCursor( int cursorID )
|
||||
{
|
||||
FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutSetCursor" );
|
||||
FREEGLUT_EXIT_IF_NO_WINDOW ( "glutSetCursor" );
|
||||
|
||||
fghSetCursor ( fgStructure.CurrentWindow, cursorID );
|
||||
fgStructure.CurrentWindow->State.Cursor = cursorID;
|
||||
}
|
||||
|
||||
/*
|
||||
* Moves the mouse pointer to given window coordinates
|
||||
*/
|
||||
void FGAPIENTRY glutWarpPointer( int x, int y )
|
||||
{
|
||||
FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutWarpPointer" );
|
||||
FREEGLUT_EXIT_IF_NO_WINDOW ( "glutWarpPointer" );
|
||||
|
||||
fghWarpPointer ( x, y );
|
||||
}
|
||||
|
||||
/*** END OF FILE ***/
|
||||
/*
|
||||
* freeglut_cursor.c
|
||||
*
|
||||
* The mouse cursor related stuff.
|
||||
*
|
||||
* Copyright (c) 1999-2000 Pawel W. Olszta. All Rights Reserved.
|
||||
* Written by Pawel W. Olszta, <olszta@sourceforge.net>
|
||||
* Creation date: Thu Dec 16 1999
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "freeglut.h"
|
||||
#include "freeglut_internal.h"
|
||||
|
||||
/*
|
||||
* TODO BEFORE THE STABLE RELEASE:
|
||||
* glutSetCursor() -- Win32 mappings are incomplete.
|
||||
*
|
||||
* It would be good to use custom mouse cursor shapes, and introduce
|
||||
* an option to display them using glBitmap() and/or texture mapping,
|
||||
* apart from the windowing system version.
|
||||
*/
|
||||
|
||||
/* -- PRIVATE FUNCTIONS --------------------------------------------------- */
|
||||
|
||||
#if TARGET_HOST_POSIX_X11 || TARGET_HOST_MAC_OSX || TARGET_HOST_SOLARIS
|
||||
#include <X11/cursorfont.h>
|
||||
|
||||
/*
|
||||
* A factory method for an empty cursor
|
||||
*/
|
||||
static Cursor getEmptyCursor( void )
|
||||
{
|
||||
static Cursor cursorNone = None;
|
||||
if( cursorNone == None ) {
|
||||
char cursorNoneBits[ 32 ];
|
||||
XColor dontCare;
|
||||
Pixmap cursorNonePixmap;
|
||||
memset( cursorNoneBits, 0, sizeof( cursorNoneBits ) );
|
||||
memset( &dontCare, 0, sizeof( dontCare ) );
|
||||
cursorNonePixmap = XCreateBitmapFromData ( fgDisplay.Display,
|
||||
fgDisplay.RootWindow,
|
||||
cursorNoneBits, 16, 16 );
|
||||
if( cursorNonePixmap != None ) {
|
||||
cursorNone = XCreatePixmapCursor( fgDisplay.Display,
|
||||
cursorNonePixmap, cursorNonePixmap,
|
||||
&dontCare, &dontCare, 0, 0 );
|
||||
XFreePixmap( fgDisplay.Display, cursorNonePixmap );
|
||||
}
|
||||
}
|
||||
return cursorNone;
|
||||
}
|
||||
|
||||
typedef struct tag_cursorCacheEntry cursorCacheEntry;
|
||||
struct tag_cursorCacheEntry {
|
||||
unsigned int cursorShape; /* an XC_foo value */
|
||||
Cursor cachedCursor; /* None if the corresponding cursor has
|
||||
not been created yet */
|
||||
};
|
||||
|
||||
/*
|
||||
* Note: The arrangement of the table below depends on the fact that
|
||||
* the "normal" GLUT_CURSOR_* values start a 0 and are consecutive.
|
||||
*/
|
||||
static cursorCacheEntry cursorCache[] = {
|
||||
{ XC_arrow, None }, /* GLUT_CURSOR_RIGHT_ARROW */
|
||||
{ XC_top_left_arrow, None }, /* GLUT_CURSOR_LEFT_ARROW */
|
||||
{ XC_hand1, None }, /* GLUT_CURSOR_INFO */
|
||||
{ XC_pirate, None }, /* GLUT_CURSOR_DESTROY */
|
||||
{ XC_question_arrow, None }, /* GLUT_CURSOR_HELP */
|
||||
{ XC_exchange, None }, /* GLUT_CURSOR_CYCLE */
|
||||
{ XC_spraycan, None }, /* GLUT_CURSOR_SPRAY */
|
||||
{ XC_watch, None }, /* GLUT_CURSOR_WAIT */
|
||||
{ XC_xterm, None }, /* GLUT_CURSOR_TEXT */
|
||||
{ XC_crosshair, None }, /* GLUT_CURSOR_CROSSHAIR */
|
||||
{ XC_sb_v_double_arrow, None }, /* GLUT_CURSOR_UP_DOWN */
|
||||
{ XC_sb_h_double_arrow, None }, /* GLUT_CURSOR_LEFT_RIGHT */
|
||||
{ XC_top_side, None }, /* GLUT_CURSOR_TOP_SIDE */
|
||||
{ XC_bottom_side, None }, /* GLUT_CURSOR_BOTTOM_SIDE */
|
||||
{ XC_left_side, None }, /* GLUT_CURSOR_LEFT_SIDE */
|
||||
{ XC_right_side, None }, /* GLUT_CURSOR_RIGHT_SIDE */
|
||||
{ XC_top_left_corner, None }, /* GLUT_CURSOR_TOP_LEFT_CORNER */
|
||||
{ XC_top_right_corner, None }, /* GLUT_CURSOR_TOP_RIGHT_CORNER */
|
||||
{ XC_bottom_right_corner, None }, /* GLUT_CURSOR_BOTTOM_RIGHT_CORNER */
|
||||
{ XC_bottom_left_corner, None } /* GLUT_CURSOR_BOTTOM_LEFT_CORNER */
|
||||
};
|
||||
|
||||
static void fghSetCursor ( SFG_Window *window, int cursorID )
|
||||
{
|
||||
Cursor cursor;
|
||||
/*
|
||||
* XXX FULL_CROSSHAIR demotes to plain CROSSHAIR. Old GLUT allows
|
||||
* for this, but if there is a system that easily supports a full-
|
||||
* window (or full-screen) crosshair, we might consider it.
|
||||
*/
|
||||
int cursorIDToUse =
|
||||
( cursorID == GLUT_CURSOR_FULL_CROSSHAIR ) ? GLUT_CURSOR_CROSSHAIR : cursorID;
|
||||
|
||||
if( ( cursorIDToUse >= 0 ) &&
|
||||
( cursorIDToUse < sizeof( cursorCache ) / sizeof( cursorCache[0] ) ) ) {
|
||||
cursorCacheEntry *entry = &cursorCache[ cursorIDToUse ];
|
||||
if( entry->cachedCursor == None ) {
|
||||
entry->cachedCursor =
|
||||
XCreateFontCursor( fgDisplay.Display, entry->cursorShape );
|
||||
}
|
||||
cursor = entry->cachedCursor;
|
||||
} else {
|
||||
switch( cursorIDToUse )
|
||||
{
|
||||
case GLUT_CURSOR_NONE:
|
||||
cursor = getEmptyCursor( );
|
||||
break;
|
||||
|
||||
case GLUT_CURSOR_INHERIT:
|
||||
cursor = None;
|
||||
break;
|
||||
|
||||
default:
|
||||
fgError( "Unknown cursor type: %d", cursorIDToUse );
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if ( cursorIDToUse == GLUT_CURSOR_INHERIT ) {
|
||||
XUndefineCursor( fgDisplay.Display, window->Window.Handle );
|
||||
} else if ( cursor != None ) {
|
||||
XDefineCursor( fgDisplay.Display, window->Window.Handle, cursor );
|
||||
} else if ( cursorIDToUse != GLUT_CURSOR_NONE ) {
|
||||
fgError( "Failed to create cursor" );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void fghWarpPointer ( int x, int y )
|
||||
{
|
||||
XWarpPointer(
|
||||
fgDisplay.Display,
|
||||
None,
|
||||
fgStructure.CurrentWindow->Window.Handle,
|
||||
0, 0, 0, 0,
|
||||
x, y
|
||||
);
|
||||
/* Make the warp visible immediately. */
|
||||
XFlush( fgDisplay.Display );
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if TARGET_HOST_MS_WINDOWS
|
||||
static void fghSetCursor ( SFG_Window *window, int cursorID )
|
||||
{
|
||||
/*
|
||||
* Joe Krahn is re-writing the following code.
|
||||
*/
|
||||
/* Set the cursor AND change it for this window class. */
|
||||
#if !defined(__MINGW64__) && _MSC_VER <= 1200
|
||||
# define MAP_CURSOR(a,b) \
|
||||
case a: \
|
||||
SetCursor( LoadCursor( NULL, b ) ); \
|
||||
SetClassLong( window->Window.Handle, \
|
||||
GCL_HCURSOR, \
|
||||
( LONG )LoadCursor( NULL, b ) ); \
|
||||
break;
|
||||
/* Nuke the cursor AND change it for this window class. */
|
||||
# define ZAP_CURSOR(a,b) \
|
||||
case a: \
|
||||
SetCursor( NULL ); \
|
||||
SetClassLong( window->Window.Handle, \
|
||||
GCL_HCURSOR, ( LONG )NULL ); \
|
||||
break;
|
||||
#else
|
||||
# define MAP_CURSOR(a,b) \
|
||||
case a: \
|
||||
SetCursor( LoadCursor( NULL, b ) ); \
|
||||
SetClassLongPtr( window->Window.Handle, \
|
||||
GCLP_HCURSOR, \
|
||||
( LONG )( LONG_PTR )LoadCursor( NULL, b ) ); \
|
||||
break;
|
||||
/* Nuke the cursor AND change it for this window class. */
|
||||
# define ZAP_CURSOR(a,b) \
|
||||
case a: \
|
||||
SetCursor( NULL ); \
|
||||
SetClassLongPtr( window->Window.Handle, \
|
||||
GCLP_HCURSOR, ( LONG )( LONG_PTR )NULL ); \
|
||||
break;
|
||||
#endif
|
||||
|
||||
switch( cursorID )
|
||||
{
|
||||
MAP_CURSOR( GLUT_CURSOR_RIGHT_ARROW, IDC_ARROW );
|
||||
MAP_CURSOR( GLUT_CURSOR_LEFT_ARROW, IDC_ARROW );
|
||||
MAP_CURSOR( GLUT_CURSOR_INFO, IDC_HAND );
|
||||
MAP_CURSOR( GLUT_CURSOR_DESTROY, IDC_CROSS );
|
||||
MAP_CURSOR( GLUT_CURSOR_HELP, IDC_HELP );
|
||||
MAP_CURSOR( GLUT_CURSOR_CYCLE, IDC_SIZEALL );
|
||||
MAP_CURSOR( GLUT_CURSOR_SPRAY, IDC_CROSS );
|
||||
MAP_CURSOR( GLUT_CURSOR_WAIT, IDC_WAIT );
|
||||
MAP_CURSOR( GLUT_CURSOR_TEXT, IDC_IBEAM );
|
||||
MAP_CURSOR( GLUT_CURSOR_CROSSHAIR, IDC_CROSS );
|
||||
MAP_CURSOR( GLUT_CURSOR_UP_DOWN, IDC_SIZENS );
|
||||
MAP_CURSOR( GLUT_CURSOR_LEFT_RIGHT, IDC_SIZEWE );
|
||||
MAP_CURSOR( GLUT_CURSOR_TOP_SIDE, IDC_ARROW ); /* XXX ToDo */
|
||||
MAP_CURSOR( GLUT_CURSOR_BOTTOM_SIDE, IDC_ARROW ); /* XXX ToDo */
|
||||
MAP_CURSOR( GLUT_CURSOR_LEFT_SIDE, IDC_ARROW ); /* XXX ToDo */
|
||||
MAP_CURSOR( GLUT_CURSOR_RIGHT_SIDE, IDC_ARROW ); /* XXX ToDo */
|
||||
MAP_CURSOR( GLUT_CURSOR_TOP_LEFT_CORNER, IDC_SIZENWSE );
|
||||
MAP_CURSOR( GLUT_CURSOR_TOP_RIGHT_CORNER, IDC_SIZENESW );
|
||||
MAP_CURSOR( GLUT_CURSOR_BOTTOM_RIGHT_CORNER, IDC_SIZENWSE );
|
||||
MAP_CURSOR( GLUT_CURSOR_BOTTOM_LEFT_CORNER, IDC_SIZENESW );
|
||||
MAP_CURSOR( GLUT_CURSOR_INHERIT, IDC_ARROW ); /* XXX ToDo */
|
||||
ZAP_CURSOR( GLUT_CURSOR_NONE, NULL );
|
||||
MAP_CURSOR( GLUT_CURSOR_FULL_CROSSHAIR, IDC_CROSS ); /* XXX ToDo */
|
||||
|
||||
default:
|
||||
fgError( "Unknown cursor type: %d", cursorID );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void fghWarpPointer ( int x, int y )
|
||||
{
|
||||
POINT coords;
|
||||
coords.x = x;
|
||||
coords.y = y;
|
||||
|
||||
/* ClientToScreen() translates {coords} for us. */
|
||||
ClientToScreen( fgStructure.CurrentWindow->Window.Handle, &coords );
|
||||
SetCursorPos( coords.x, coords.y );
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/* -- INTERNAL FUNCTIONS ---------------------------------------------------- */
|
||||
void fgSetCursor ( SFG_Window *window, int cursorID )
|
||||
{
|
||||
fghSetCursor ( window, cursorID );
|
||||
}
|
||||
|
||||
|
||||
/* -- INTERFACE FUNCTIONS -------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* Set the cursor image to be used for the current window
|
||||
*/
|
||||
void FGAPIENTRY glutSetCursor( int cursorID )
|
||||
{
|
||||
FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutSetCursor" );
|
||||
FREEGLUT_EXIT_IF_NO_WINDOW ( "glutSetCursor" );
|
||||
|
||||
fghSetCursor ( fgStructure.CurrentWindow, cursorID );
|
||||
fgStructure.CurrentWindow->State.Cursor = cursorID;
|
||||
}
|
||||
|
||||
/*
|
||||
* Moves the mouse pointer to given window coordinates
|
||||
*/
|
||||
void FGAPIENTRY glutWarpPointer( int x, int y )
|
||||
{
|
||||
FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutWarpPointer" );
|
||||
FREEGLUT_EXIT_IF_NO_WINDOW ( "glutWarpPointer" );
|
||||
|
||||
fghWarpPointer ( x, y );
|
||||
}
|
||||
|
||||
/*** END OF FILE ***/
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
Copyright (c) 2010 Alex Diener
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
Alex Diener adiener@sacredsoftware.net
|
|
@ -0,0 +1,420 @@
|
|||
.PHONY: all
|
||||
all: library unittest testharness test include
|
||||
|
||||
UNAME = ${shell uname}
|
||||
ifeq (${UNAME},Linux)
|
||||
HOST_PLATFORM = linux
|
||||
else ifeq (${UNAME},Darwin)
|
||||
HOST_PLATFORM = macosx
|
||||
else
|
||||
HOST_PLATFORM = windows
|
||||
endif
|
||||
|
||||
TARGET_PLATFORMS_macosx = macosx
|
||||
TARGET_PLATFORMS_linux = linux
|
||||
TARGET_PLATFORMS_windows = windows
|
||||
|
||||
include version
|
||||
|
||||
PROJECT_NAME = gamepad
|
||||
|
||||
LIBRARY_TARGETS = library
|
||||
EXECUTABLE_TARGETS = unittest
|
||||
APPLICATION_TARGETS = testharness
|
||||
TARGETS = ${LIBRARY_TARGETS} ${EXECUTABLE_TARGETS} ${APPLICATION_TARGETS}
|
||||
CONFIGURATIONS = debug profile release
|
||||
PLATFORMS = ${filter ${TARGET_PLATFORMS_${HOST_PLATFORM}},macosx linux windows}
|
||||
ARCHS = ppc i386 i686 x86_64
|
||||
|
||||
TARGET_NAME_library = libstem_gamepad
|
||||
TARGET_NAME_unittest = unittest
|
||||
TARGET_NAME_testharness = GamepadTestHarness
|
||||
|
||||
#Per-target configurations
|
||||
CONFIGURATIONS_library = debug profile release
|
||||
CONFIGURATIONS_unittest = debug
|
||||
CONFIGURATIONS_testharness = debug profile
|
||||
|
||||
#Per-target platforms
|
||||
PLATFORMS_library = ${filter ${PLATFORMS},macosx linux windows}
|
||||
PLATFORMS_unittest = ${filter ${PLATFORMS},macosx linux windows}
|
||||
PLATFORMS_testharness = ${filter ${PLATFORMS},macosx linux windows}
|
||||
|
||||
#Per-target compile/link settings
|
||||
CCFLAGS_unittest = -I test_source -DSUITE_FILE_LIST='${foreach file,${SOURCES_unittest_suites},"${basename ${notdir ${file}}}",} NULL'
|
||||
|
||||
#Per-configuration compile/link settings
|
||||
CCFLAGS_debug = -g
|
||||
CCFLAGS_profile = -g -O3
|
||||
CCFLAGS_release = -O3
|
||||
|
||||
#Per-platform compile/link settings
|
||||
CC_macosx_ppc = /usr/bin/gcc-4.2 -arch ppc
|
||||
CC_macosx_i386 = /Developer/usr/bin/clang -arch i386
|
||||
CC_macosx_x86_64 = /Developer/usr/bin/clang -arch x86_64
|
||||
AR_macosx = /usr/bin/ar
|
||||
RANLIB_macosx = /usr/bin/ranlib
|
||||
SDKROOT_macosx = /Developer/SDKs/MacOSX10.5.sdk
|
||||
ARCHS_macosx = ppc i386 x86_64
|
||||
CCFLAGS_macosx = -isysroot ${SDKROOT_macosx} -mmacosx-version-min=10.5
|
||||
LINKFLAGS_macosx = -isysroot ${SDKROOT_macosx} -mmacosx-version-min=10.5 -framework IOKit -framework CoreFoundation -framework OpenGL -framework GLUT
|
||||
|
||||
CC_linux_i686 = /usr/bin/gcc
|
||||
AR_linux = /usr/bin/ar
|
||||
RANLIB_linux = /usr/bin/ranlib
|
||||
ARCHS_linux = i686
|
||||
CCFLAGS_linux =
|
||||
LINKFLAGS_linux = -lm -ldl -lglut -Wl,-E
|
||||
|
||||
CC_windows_i686 = \\MinGW\\bin\\gcc.exe
|
||||
AR_windows = \\MinGW\\bin\\ar.exe
|
||||
RANLIB_windows = \\MinGW\\bin\\ranlib.exe
|
||||
ARCHS_windows = i686
|
||||
CCFLAGS_windows = -DFREEGLUT_STATIC
|
||||
LINKFLAGS_windows = -lfreeglut_static -lopengl32 -lglu32 -lwinmm -lgdi32 -mwindows -mconsole
|
||||
|
||||
#General compile/link settings
|
||||
DEFINE_CCFLAGS = -DVERSION_MAJOR=${VERSION_MAJOR}u -DVERSION_MINOR=${VERSION_MINOR}u -DVERSION_TWEAK=${VERSION_TWEAK}u
|
||||
WARNING_CCFLAGS = -Wall -Wextra -Wno-unused-parameter -Werror
|
||||
INCLUDE_CCFLAGS = -I source -I include
|
||||
OTHER_CCFLAGS = -std=gnu99
|
||||
CCFLAGS = ${DEFINE_CCFLAGS} ${WARNING_CCFLAGS} ${INCLUDE_CCFLAGS} ${OTHER_CCFLAGS}
|
||||
|
||||
FRAMEWORK_LINKFLAGS =
|
||||
LIBRARY_LINKFLAGS =
|
||||
OTHER_LINKFLAGS =
|
||||
LINKFLAGS = ${FRAMEWORK_LINKFLAGS} ${LIBRARY_LINKFLAGS} ${OTHER_LINKFLAGS}
|
||||
|
||||
#Per-target depencies
|
||||
|
||||
LIBRARY_DEPENDENCIES_unittest =
|
||||
LIBRARY_DEPENDENCIES_testharness = utilities/libstem_utilities.a glutshell/libstemshell_glut.a
|
||||
|
||||
#Per-target source file lists
|
||||
|
||||
SOURCES_library = \
|
||||
source/gamepad/Gamepad_${HOST_PLATFORM}.c \
|
||||
source/utilities/EventDispatcher.c
|
||||
|
||||
SOURCES_unittest = \
|
||||
test_source/unittest/framework/unittest_main.c \
|
||||
test_source/unittest/framework/TestList.c \
|
||||
${SOURCES_unittest_suites}
|
||||
|
||||
SOURCES_unittest_suites = \
|
||||
test_source/unittest/suites/GamepadTest.c
|
||||
|
||||
SOURCES_testharness = \
|
||||
test_source/testharness/TestHarness_main.c
|
||||
|
||||
SOURCES = ${sort ${foreach target,${TARGETS},${SOURCES_${target}}}}
|
||||
|
||||
INCLUDES = \
|
||||
source/gamepad/Gamepad.h \
|
||||
source/utilities/EventDispatcher.h
|
||||
|
||||
|
||||
|
||||
define configuration_object_list_template #(target, configuration)
|
||||
${foreach platform,${PLATFORMS_${1}}, \
|
||||
${call platform_object_list_template,${1},${2},${platform}} \
|
||||
}
|
||||
endef
|
||||
|
||||
define platform_object_list_template #(target, configuration, platform)
|
||||
${foreach arch,${ARCHS_${3}}, \
|
||||
${call arch_object_list_template,${1},${2},${3},${arch}} \
|
||||
}
|
||||
endef
|
||||
|
||||
define arch_object_list_template #(target, configuration, platform, arch)
|
||||
${foreach source,${SOURCES_${1}}, \
|
||||
build/intermediate/${2}-${3}-${4}/${notdir ${basename ${source}}}.o \
|
||||
}
|
||||
endef
|
||||
|
||||
#Produces OBJECTS_${target}_${configuration} variables for each permutation of target and configuration in that target
|
||||
${foreach target,${TARGETS}, \
|
||||
${foreach configuration,${CONFIGURATIONS_${target}}, \
|
||||
${eval OBJECTS_${target}_${configuration} = ${call configuration_object_list_template,${target},${configuration}}} \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
|
||||
define compile_template #(target, configuration, platform, arch, source_file)
|
||||
build/intermediate/${2}-${3}-${4}/${notdir ${basename ${5}}}.o: ${5}
|
||||
mkdir -p build/intermediate/${2}-${3}-${4}
|
||||
${CC_${3}_${4}} ${CCFLAGS} ${CCFLAGS_${1}} ${CCFLAGS_${2}} ${CCFLAGS_${3}} -c -o $$@ $$^
|
||||
endef
|
||||
|
||||
#Produces object build targets for all source files in each configuration/platform/arch
|
||||
${foreach target,${TARGETS}, \
|
||||
${foreach configuration,${CONFIGURATIONS}, \
|
||||
${foreach platform,${PLATFORMS_${target}}, \
|
||||
${foreach arch,${ARCHS_${platform}}, \
|
||||
${foreach source,${SOURCES_${target}}, \
|
||||
${eval ${call compile_template,${target},${configuration},${platform},${arch},${source}}} \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
|
||||
define library_template #(target, configuration, platform, arch, output_file)
|
||||
build/intermediate/${2}-${3}-${4}/${5}: ${call arch_object_list_template,${1},${2},${3},${4}}
|
||||
${AR_${3}} rc $$@ $$^
|
||||
${RANLIB_${3}} $$@
|
||||
endef
|
||||
|
||||
#Produces static library build targets for each arch/platform/target for library targets
|
||||
${foreach target,${LIBRARY_TARGETS}, \
|
||||
${foreach configuration,${CONFIGURATIONS_${target}}, \
|
||||
${foreach platform,${PLATFORMS_${target}}, \
|
||||
${foreach arch,${ARCHS_${platform}}, \
|
||||
${eval ${call library_template,${target},${configuration},${platform},${arch},${TARGET_NAME_${target}}.a}} \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
|
||||
define executable_template #(target, configuration, platform, arch, output_file, dependent_libraries)
|
||||
build/intermediate/${2}-${3}-${4}/${5}: ${call arch_object_list_template,${1},${2},${3},${4}} ${6}
|
||||
${CC_${3}_${4}} -o $$@ $$^ ${LINKFLAGS} ${LINKFLAGS_${3}}
|
||||
endef
|
||||
|
||||
define library_dependency_template #(target, configuration, platform)
|
||||
build/library/debug-${3}/${TARGET_NAME_library}.a \
|
||||
${foreach library,${LIBRARY_DEPENDENCIES_${1}}, \
|
||||
lib/${dir ${library}}${configuration}-${platform}/${notdir ${library}} \
|
||||
}
|
||||
endef
|
||||
|
||||
#Produces executable build targets for each arch/platform/target for executable and application targets
|
||||
${foreach target,${EXECUTABLE_TARGETS} ${APPLICATION_TARGETS}, \
|
||||
${foreach configuration,${CONFIGURATIONS_${target}}, \
|
||||
${foreach platform,${PLATFORMS_${target}}, \
|
||||
${foreach arch,${ARCHS_${platform}}, \
|
||||
${eval ${call executable_template,${target},${configuration},${platform},${arch},${TARGET_NAME_${target}},${call library_dependency_template,${target},${configuration},${platform}}}} \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
|
||||
define thin_binary_list_template #(target_name, configuration, platform)
|
||||
${foreach arch,${ARCHS_${3}}, \
|
||||
build/intermediate/${2}-${3}-${arch}/${1} \
|
||||
}
|
||||
endef
|
||||
|
||||
#Produces THIN_BINARIES_${target}_${configuration}_${platform} variables for each target/configuration/platform for library targets
|
||||
${foreach target,${LIBRARY_TARGETS}, \
|
||||
${foreach configuration,${CONFIGURATIONS_${target}}, \
|
||||
${foreach platform,${PLATFORMS_${target}}, \
|
||||
${eval THIN_BINARIES_${target}_${configuration}_${platform} = ${call thin_binary_list_template,${TARGET_NAME_${target}}.a,${configuration},${platform}}} \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
#Produces THIN_BINARIES_${target}_${configuration}_${platform} variables for each target/configuration/platform for executable targets
|
||||
${foreach target,${EXECUTABLE_TARGETS}, \
|
||||
${foreach configuration,${CONFIGURATIONS_${target}}, \
|
||||
${foreach platform,${PLATFORMS_${target}}, \
|
||||
${eval THIN_BINARIES_${target}_${configuration}_${platform} = ${call thin_binary_list_template,${TARGET_NAME_${target}},${configuration},${platform}}} \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
#Produces THIN_BINARIES_${target}_${configuration}_${platform} variables for each target/configuration/platform for application targets
|
||||
${foreach target,${APPLICATION_TARGETS}, \
|
||||
${foreach configuration,${CONFIGURATIONS_${target}}, \
|
||||
${foreach platform,${PLATFORMS_${target}}, \
|
||||
${eval THIN_BINARIES_${target}_${configuration}_${platform} = ${call thin_binary_list_template,${TARGET_NAME_${target}},${configuration},${platform}}} \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
|
||||
define assemble_library_macosx #(target, configuration, platform)
|
||||
build/${1}/${2}-${3}/${TARGET_NAME_${1}}.a: ${THIN_BINARIES_${1}_${2}_${3}}
|
||||
mkdir -p $${dir $$@}
|
||||
lipo -create -output $$@ $$^
|
||||
endef
|
||||
|
||||
define assemble_library_linux #(target, configuration, platform)
|
||||
build/${1}/${2}-${3}/${TARGET_NAME_${1}}.a: ${THIN_BINARIES_${1}_${2}_${3}}
|
||||
mkdir -p $${dir $$@}
|
||||
cp $$^ $$@
|
||||
endef
|
||||
|
||||
define assemble_library_windows #(target, configuration, platform)
|
||||
build/${1}/${2}-${3}/${TARGET_NAME_${1}}.a: ${THIN_BINARIES_${1}_${2}_${3}}
|
||||
mkdir -p $${dir $$@}
|
||||
cp $$^ $$@
|
||||
endef
|
||||
|
||||
#Produces final library build targets
|
||||
${foreach target,${LIBRARY_TARGETS}, \
|
||||
${foreach configuration,${CONFIGURATIONS_${target}}, \
|
||||
${foreach platform,${PLATFORMS_${target}}, \
|
||||
${eval ${call assemble_library_${HOST_PLATFORM},${target},${configuration},${platform}}} \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
define assemble_executable_macosx #(target, configuration, platform)
|
||||
build/${1}/${2}-${3}/${TARGET_NAME_${1}}: ${THIN_BINARIES_${1}_${2}_${3}}
|
||||
mkdir -p $${dir $$@}
|
||||
lipo -create -output $$@ $$^
|
||||
endef
|
||||
|
||||
define assemble_executable_linux #(target, configuration, platform)
|
||||
build/${1}/${2}-${3}/${TARGET_NAME_${1}}: ${THIN_BINARIES_${1}_${2}_${3}}
|
||||
mkdir -p $${dir $$@}
|
||||
cp $$^ $$@
|
||||
endef
|
||||
|
||||
define assemble_executable_windows #(target, configuration, platform)
|
||||
build/${1}/${2}-${3}/${TARGET_NAME_${1}}.exe: ${THIN_BINARIES_${1}_${2}_${3}}
|
||||
mkdir -p $${dir $$@}
|
||||
cp $$^ $$@
|
||||
endef
|
||||
|
||||
#Produces final executable build targets
|
||||
${foreach target,${EXECUTABLE_TARGETS}, \
|
||||
${foreach configuration,${CONFIGURATIONS_${target}}, \
|
||||
${foreach platform,${PLATFORMS_${target}}, \
|
||||
${eval ${call assemble_executable_${HOST_PLATFORM},${target},${configuration},${platform}}} \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
PLIST_FILE_testharness_macosx = test_resources/Info_testharness_macosx.plist
|
||||
|
||||
define assemble_application_macosx #(target, configuration, platform)
|
||||
build/${1}/${2}-${3}/${TARGET_NAME_${1}}.app/Contents/MacOS/${TARGET_NAME_${1}}: ${THIN_BINARIES_${1}_${2}_${3}}
|
||||
mkdir -p $${dir $$@}
|
||||
mkdir -p $${dir $$@}../Resources
|
||||
sed -e "s/\$$$${PRODUCT_NAME}/${TARGET_NAME_${1}}/g" \
|
||||
-e "s/\$$$${VERSION}/${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_TWEAK}/g" \
|
||||
-e "s/\$$$${COPYRIGHT_YEAR}/"`date +%Y`"/g" \
|
||||
-e "s/\$$$${BUILD_NUMBER}/0/g" \
|
||||
-e "s/\$$$${PLATFORM_CASED}/${PLIST_PLATFORM_CASED_${3}}/g" \
|
||||
-e "s/\$$$${PLATFORM_LOWER}/${PLIST_PLATFORM_LOWER_${3}}/g" \
|
||||
-e "s/\$$$${SDK}/${PLIST_SDK_NAME_${3}}/g" \
|
||||
${PLIST_FILE_${1}_${3}} > $${dir $$@}/../Info.plist
|
||||
echo "APPL????" > $${dir $$@}../PkgInfo
|
||||
lipo -create -output $$@ $$^
|
||||
endef
|
||||
|
||||
define assemble_application_linux #(target, configuration, platform)
|
||||
build/${1}/${2}-${3}/${TARGET_NAME_${1}}: ${THIN_BINARIES_${1}_${2}_${3}}
|
||||
mkdir -p $${dir $$@}
|
||||
cp $$^ $$@
|
||||
endef
|
||||
|
||||
define assemble_application_windows #(target, configuration, platform)
|
||||
build/${1}/${2}-${3}/${TARGET_NAME_${1}}.exe: ${THIN_BINARIES_${1}_${2}_${3}}
|
||||
mkdir -p $${dir $$@}
|
||||
cp $$^ $$@
|
||||
endef
|
||||
|
||||
#Produces final application build targets
|
||||
${foreach target,${APPLICATION_TARGETS}, \
|
||||
${foreach configuration,${CONFIGURATIONS_${target}}, \
|
||||
${foreach platform,${PLATFORMS_${target}}, \
|
||||
${eval ${call assemble_application_${HOST_PLATFORM},${target},${configuration},${platform}}} \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
define library_target_template_macosx #(target)
|
||||
.PHONY: ${1}
|
||||
${1}: ${foreach configuration,${CONFIGURATIONS_${1}},${foreach platform,${PLATFORMS_${1}},build/${1}/${configuration}-${platform}/${TARGET_NAME_${1}}.a}}
|
||||
endef
|
||||
|
||||
define library_target_template_linux #(target)
|
||||
.PHONY: ${1}
|
||||
${1}: ${foreach configuration,${CONFIGURATIONS_${1}},${foreach platform,${PLATFORMS_${1}},build/${1}/${configuration}-${platform}/${TARGET_NAME_${1}}.a}}
|
||||
endef
|
||||
|
||||
define library_target_template_windows #(target)
|
||||
.PHONY: ${1}
|
||||
${1}: ${foreach configuration,${CONFIGURATIONS_${1}},${foreach platform,${PLATFORMS_${1}},build/${1}/${configuration}-${platform}/${TARGET_NAME_${1}}.a}}
|
||||
endef
|
||||
|
||||
define executable_target_template_macosx #(target)
|
||||
.PHONY: ${1}
|
||||
${1}: ${foreach configuration,${CONFIGURATIONS_${1}},${foreach platform,${PLATFORMS_${1}},build/${1}/${configuration}-${platform}/${TARGET_NAME_${1}}}}
|
||||
endef
|
||||
|
||||
define executable_target_template_linux #(target)
|
||||
.PHONY: ${1}
|
||||
${1}: ${foreach configuration,${CONFIGURATIONS_${1}},${foreach platform,${PLATFORMS_${1}},build/${1}/${configuration}-${platform}/${TARGET_NAME_${1}}}}
|
||||
endef
|
||||
|
||||
define executable_target_template_windows #(target)
|
||||
.PHONY: ${1}
|
||||
${1}: ${foreach configuration,${CONFIGURATIONS_${1}},${foreach platform,${PLATFORMS_${1}},build/${1}/${configuration}-${platform}/${TARGET_NAME_${1}}.exe}}
|
||||
endef
|
||||
|
||||
define application_target_template_macosx #(target)
|
||||
.PHONY: ${1}
|
||||
${1}: ${foreach configuration,${CONFIGURATIONS_${1}},${foreach platform,${PLATFORMS_${1}},build/${1}/${configuration}-${platform}/${TARGET_NAME_${1}}.app/Contents/MacOS/${TARGET_NAME_${1}}}}
|
||||
endef
|
||||
|
||||
define application_target_template_linux #(target)
|
||||
.PHONY: ${1}
|
||||
${1}: ${foreach configuration,${CONFIGURATIONS_${1}},${foreach platform,${PLATFORMS_${1}},build/${1}/${configuration}-${platform}/${TARGET_NAME_${1}}}}
|
||||
endef
|
||||
|
||||
define application_target_template_windows #(target)
|
||||
.PHONY: ${1}
|
||||
${1}: ${foreach configuration,${CONFIGURATIONS_${1}},${foreach platform,${PLATFORMS_${1}},build/${1}/${configuration}-${platform}/${TARGET_NAME_${1}}.exe}}
|
||||
endef
|
||||
|
||||
${foreach target,${LIBRARY_TARGETS}, \
|
||||
${eval ${call library_target_template_${HOST_PLATFORM},${target}}} \
|
||||
}
|
||||
|
||||
${foreach target,${EXECUTABLE_TARGETS}, \
|
||||
${eval ${call executable_target_template_${HOST_PLATFORM},${target}}} \
|
||||
}
|
||||
|
||||
${foreach target,${APPLICATION_TARGETS}, \
|
||||
${eval ${call application_target_template_${HOST_PLATFORM},${target}}} \
|
||||
}
|
||||
|
||||
.PHONY: test
|
||||
test: unittest ${foreach platform,${PLATFORMS_unittest},run_unittests_${platform}}
|
||||
|
||||
.PHONY: run_unittests_macosx
|
||||
run_unittests_macosx:
|
||||
./build/unittest/debug-macosx/unittest
|
||||
|
||||
.PHONY: run_unittests_linux
|
||||
run_unittests_linux:
|
||||
./build/unittest/debug-linux/unittest
|
||||
|
||||
.PHONY: run_unittests_windows
|
||||
run_unittests_windows:
|
||||
./build/unittest/debug-windows/unittest.exe
|
||||
|
||||
.PHONY: include
|
||||
include: ${INCLUDES}
|
||||
mkdir -p build/include
|
||||
cp $^ build/include
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -rf build
|
||||
rm -rf dist
|
||||
rm -rf dist_append
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
#ifndef __SHELL_H__
|
||||
#define __SHELL_H__
|
||||
|
||||
void Shell_mainLoop();
|
||||
void Shell_redisplay();
|
||||
|
||||
double Shell_getCurrentTime();
|
||||
const char * Shell_getResourcePath();
|
||||
|
||||
#endif
|
|
@ -0,0 +1,176 @@
|
|||
// Adapted from GameShell (http://onesadcookie.com/svn/GameShell/Source/Common/GSKeyCodesInternal.h). Thanks Keith!
|
||||
|
||||
#ifndef __SHELL_KEY_CODES_H__
|
||||
#define __SHELL_KEY_CODES_H__
|
||||
|
||||
#define KEYBOARD_A 0x04
|
||||
#define KEYBOARD_B 0x05
|
||||
#define KEYBOARD_C 0x06
|
||||
#define KEYBOARD_D 0x07
|
||||
#define KEYBOARD_E 0x08
|
||||
#define KEYBOARD_F 0x09
|
||||
#define KEYBOARD_G 0x0A
|
||||
#define KEYBOARD_H 0x0B
|
||||
#define KEYBOARD_I 0x0C
|
||||
#define KEYBOARD_J 0x0D
|
||||
#define KEYBOARD_K 0x0E
|
||||
#define KEYBOARD_L 0x0F
|
||||
#define KEYBOARD_M 0x10
|
||||
#define KEYBOARD_N 0x11
|
||||
#define KEYBOARD_O 0x12
|
||||
#define KEYBOARD_P 0x13
|
||||
#define KEYBOARD_Q 0x14
|
||||
#define KEYBOARD_R 0x15
|
||||
#define KEYBOARD_S 0x16
|
||||
#define KEYBOARD_T 0x17
|
||||
#define KEYBOARD_U 0x18
|
||||
#define KEYBOARD_V 0x19
|
||||
#define KEYBOARD_W 0x1A
|
||||
#define KEYBOARD_X 0x1B
|
||||
#define KEYBOARD_Y 0x1C
|
||||
#define KEYBOARD_Z 0x1D
|
||||
#define KEYBOARD_1 0x1E
|
||||
#define KEYBOARD_2 0x1F
|
||||
#define KEYBOARD_3 0x20
|
||||
#define KEYBOARD_4 0x21
|
||||
#define KEYBOARD_5 0x22
|
||||
#define KEYBOARD_6 0x23
|
||||
#define KEYBOARD_7 0x24
|
||||
#define KEYBOARD_8 0x25
|
||||
#define KEYBOARD_9 0x26
|
||||
#define KEYBOARD_0 0x27
|
||||
#define KEYBOARD_RETURN_OR_ENTER 0x28
|
||||
#define KEYBOARD_ESCAPE 0x29
|
||||
#define KEYBOARD_DELETE_OR_BACKSPACE 0x2A
|
||||
#define KEYBOARD_TAB 0x2B
|
||||
#define KEYBOARD_SPACEBAR 0x2C
|
||||
#define KEYBOARD_HYPHEN 0x2D
|
||||
#define KEYBOARD_EQUAL_SIGN 0x2E
|
||||
#define KEYBOARD_OPEN_BRACKET 0x2F
|
||||
#define KEYBOARD_CLOSE_BRACKET 0x30
|
||||
#define KEYBOARD_BACKSLASH 0x31
|
||||
#define KEYBOARD_NON_USPOUND 0x32
|
||||
#define KEYBOARD_SEMICOLON 0x33
|
||||
#define KEYBOARD_QUOTE 0x34
|
||||
#define KEYBOARD_GRAVE_ACCENT_AND_TILDE 0x35
|
||||
#define KEYBOARD_COMMA 0x36
|
||||
#define KEYBOARD_PERIOD 0x37
|
||||
#define KEYBOARD_SLASH 0x38
|
||||
#define KEYBOARD_CAPS_LOCK 0x39
|
||||
#define KEYBOARD_F1 0x3A
|
||||
#define KEYBOARD_F2 0x3B
|
||||
#define KEYBOARD_F3 0x3C
|
||||
#define KEYBOARD_F4 0x3D
|
||||
#define KEYBOARD_F5 0x3E
|
||||
#define KEYBOARD_F6 0x3F
|
||||
#define KEYBOARD_F7 0x40
|
||||
#define KEYBOARD_F8 0x41
|
||||
#define KEYBOARD_F9 0x42
|
||||
#define KEYBOARD_F10 0x43
|
||||
#define KEYBOARD_F11 0x44
|
||||
#define KEYBOARD_F12 0x45
|
||||
#define KEYBOARD_PRINT_SCREEN 0x46
|
||||
#define KEYBOARD_SCROLL_LOCK 0x47
|
||||
#define KEYBOARD_PAUSE 0x48
|
||||
#define KEYBOARD_INSERT 0x49
|
||||
#define KEYBOARD_HOME 0x4A
|
||||
#define KEYBOARD_PAGE_UP 0x4B
|
||||
#define KEYBOARD_DELETE_FORWARD 0x4C
|
||||
#define KEYBOARD_END 0x4D
|
||||
#define KEYBOARD_PAGE_DOWN 0x4E
|
||||
#define KEYBOARD_RIGHT_ARROW 0x4F
|
||||
#define KEYBOARD_LEFT_ARROW 0x50
|
||||
#define KEYBOARD_DOWN_ARROW 0x51
|
||||
#define KEYBOARD_UP_ARROW 0x52
|
||||
#define KEYPAD_NUM_LOCK 0x53
|
||||
#define KEYPAD_SLASH 0x54
|
||||
#define KEYPAD_ASTERISK 0x55
|
||||
#define KEYPAD_HYPHEN 0x56
|
||||
#define KEYPAD_PLUS 0x57
|
||||
#define KEYPAD_ENTER 0x58
|
||||
#define KEYPAD_1 0x59
|
||||
#define KEYPAD_2 0x5A
|
||||
#define KEYPAD_3 0x5B
|
||||
#define KEYPAD_4 0x5C
|
||||
#define KEYPAD_5 0x5D
|
||||
#define KEYPAD_6 0x5E
|
||||
#define KEYPAD_7 0x5F
|
||||
#define KEYPAD_8 0x60
|
||||
#define KEYPAD_9 0x61
|
||||
#define KEYPAD_0 0x62
|
||||
#define KEYPAD_PERIOD 0x63
|
||||
#define KEYBOARD_NON_US_BACKSLASH 0x64
|
||||
#define KEYBOARD_APPLICATION 0x65
|
||||
#define KEYBOARD_POWER 0x66
|
||||
#define KEYPAD_EQUAL_SIGN 0x67
|
||||
#define KEYBOARD_F13 0x68
|
||||
#define KEYBOARD_F14 0x69
|
||||
#define KEYBOARD_F15 0x6A
|
||||
#define KEYBOARD_F16 0x6B
|
||||
#define KEYBOARD_F17 0x6C
|
||||
#define KEYBOARD_F18 0x6D
|
||||
#define KEYBOARD_F19 0x6E
|
||||
#define KEYBOARD_F20 0x6F
|
||||
#define KEYBOARD_F21 0x70
|
||||
#define KEYBOARD_F22 0x71
|
||||
#define KEYBOARD_F23 0x72
|
||||
#define KEYBOARD_F24 0x73
|
||||
#define KEYBOARD_EXECUTE 0x74
|
||||
#define KEYBOARD_HELP 0x75
|
||||
#define KEYBOARD_MENU 0x76
|
||||
#define KEYBOARD_SELECT 0x77
|
||||
#define KEYBOARD_STOP 0x78
|
||||
#define KEYBOARD_AGAIN 0x79
|
||||
#define KEYBOARD_UNDO 0x7A
|
||||
#define KEYBOARD_CUT 0x7B
|
||||
#define KEYBOARD_COPY 0x7C
|
||||
#define KEYBOARD_PASTE 0x7D
|
||||
#define KEYBOARD_FIND 0x7E
|
||||
#define KEYBOARD_MUTE 0x7F
|
||||
#define KEYBOARD_VOLUME_UP 0x80
|
||||
#define KEYBOARD_VOLUME_DOWN 0x81
|
||||
#define KEYBOARD_LOCKING_CAPS_LOCK 0x82
|
||||
#define KEYBOARD_LOCKING_NUM_LOCK 0x83
|
||||
#define KEYBOARD_LOCKING_SCROLL_LOCK 0x84
|
||||
#define KEYPAD_COMMA 0x85
|
||||
#define KEYPAD_EQUAL_SIGN_AS400 0x86
|
||||
#define KEYBOARD_INTERNATIONAL_1 0x87
|
||||
#define KEYBOARD_INTERNATIONAL_2 0x88
|
||||
#define KEYBOARD_INTERNATIONAL_3 0x89
|
||||
#define KEYBOARD_INTERNATIONAL_4 0x8A
|
||||
#define KEYBOARD_INTERNATIONAL_5 0x8B
|
||||
#define KEYBOARD_INTERNATIONAL_6 0x8C
|
||||
#define KEYBOARD_INTERNATIONAL_7 0x8D
|
||||
#define KEYBOARD_INTERNATIONAL_8 0x8E
|
||||
#define KEYBOARD_INTERNATIONAL_9 0x8F
|
||||
#define KEYBOARD_LANG1 0x90
|
||||
#define KEYBOARD_LANG2 0x91
|
||||
#define KEYBOARD_LANG3 0x92
|
||||
#define KEYBOARD_LANG4 0x93
|
||||
#define KEYBOARD_LANG5 0x94
|
||||
#define KEYBOARD_LANG6 0x95
|
||||
#define KEYBOARD_LANG7 0x96
|
||||
#define KEYBOARD_LANG8 0x97
|
||||
#define KEYBOARD_LANG9 0x98
|
||||
#define KEYBOARD_ALTERNATE_ERASE 0x99
|
||||
#define KEYBOARD_SYS_REQ_OR_ATTENTION 0x9A
|
||||
#define KEYBOARD_CANCEL 0x9B
|
||||
#define KEYBOARD_CLEAR 0x9C
|
||||
#define KEYBOARD_PRIOR 0x9D
|
||||
#define KEYBOARD_RETURN 0x9E
|
||||
#define KEYBOARD_SEPARATOR 0x9F
|
||||
#define KEYBOARD_OUT 0xA0
|
||||
#define KEYBOARD_OPER 0xA1
|
||||
#define KEYBOARD_CLEAR_OR_AGAIN 0xA2
|
||||
#define KEYBOARD_CR_SEL_OR_PROPS 0xA3
|
||||
#define KEYBOARD_EX_SEL 0xA4
|
||||
#define KEYBOARD_LEFT_CONTROL 0xE0
|
||||
#define KEYBOARD_LEFT_SHIFT 0xE1
|
||||
#define KEYBOARD_LEFT_ALT 0xE2
|
||||
#define KEYBOARD_LEFT_GUI 0xE3
|
||||
#define KEYBOARD_RIGHT_CONTROL 0xE4
|
||||
#define KEYBOARD_RIGHT_SHIFT 0xE5
|
||||
#define KEYBOARD_RIGHT_ALT 0xE6
|
||||
#define KEYBOARD_RIGHT_GUI 0xE7
|
||||
|
||||
#endif
|
|
@ -0,0 +1,18 @@
|
|||
#ifndef __TARGET_H__
|
||||
#define __TARGET_H__
|
||||
|
||||
const char * Target_getName();
|
||||
|
||||
void Target_init(int argc, char ** argv);
|
||||
void Target_draw();
|
||||
|
||||
void Target_keyDown(int charCode, int keyCode);
|
||||
void Target_keyUp(int charCode, int keyCode);
|
||||
void Target_mouseDown(int buttonNumber, float x, float y);
|
||||
void Target_mouseUp(int buttonNumber, float x, float y);
|
||||
void Target_mouseMoved(float x, float y);
|
||||
void Target_mouseDragged(int buttonMask, float x, float y);
|
||||
|
||||
void Target_resized(int newWidth, int newHeight);
|
||||
|
||||
#endif
|
|
@ -0,0 +1,128 @@
|
|||
/*
|
||||
Copyright (c) 2010 Alex Diener
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
Alex Diener adiener@sacredsoftware.net
|
||||
*/
|
||||
|
||||
#ifndef __GAMEPAD_H__
|
||||
#define __GAMEPAD_H__
|
||||
|
||||
#include <stdbool.h>
|
||||
#include "utilities/EventDispatcher.h"
|
||||
|
||||
// eventData -> struct Gamepad_device
|
||||
#define GAMEPAD_EVENT_DEVICE_ATTACHED "GAMEPAD_EVENT_DEVICE_ATTACHED" // Only dispatched when Gamepad_init or Gamepad_detectDevices is called
|
||||
#define GAMEPAD_EVENT_DEVICE_REMOVED "GAMEPAD_EVENT_DEVICE_REMOVED" // Can be dispatched at any time
|
||||
|
||||
// eventData -> struct Gamepad_buttonEvent
|
||||
#define GAMEPAD_EVENT_BUTTON_DOWN "GAMEPAD_EVENT_BUTTON_DOWN" // Only dispatched when Gamepad_processEvents is called
|
||||
#define GAMEPAD_EVENT_BUTTON_UP "GAMEPAD_EVENT_BUTTON_UP" // Only dispatched when Gamepad_processEvents is called
|
||||
|
||||
// eventData -> struct Gamepad_axisEvent
|
||||
#define GAMEPAD_EVENT_AXIS_MOVED "GAMEPAD_EVENT_AXIS_MOVED" // Only dispatched when Gamepad_processEvents is called
|
||||
|
||||
struct Gamepad_buttonEvent {
|
||||
// Device that generated the event
|
||||
struct Gamepad_device * device;
|
||||
|
||||
// Relative time of the event, in seconds
|
||||
double timestamp;
|
||||
|
||||
// Button being pushed or released
|
||||
unsigned int buttonID;
|
||||
|
||||
// True if button is down
|
||||
bool down;
|
||||
};
|
||||
|
||||
struct Gamepad_axisEvent {
|
||||
// Device that generated the event
|
||||
struct Gamepad_device * device;
|
||||
|
||||
// Relative time of the event, in seconds
|
||||
double timestamp;
|
||||
|
||||
// Axis being moved
|
||||
unsigned int axisID;
|
||||
|
||||
// Axis position value, in the range [-1..1]
|
||||
float value;
|
||||
};
|
||||
|
||||
struct Gamepad_device {
|
||||
// Unique device identifier for application session. If a device is removed and subsequently reattached during the same application session, it will have a new deviceID.
|
||||
unsigned int deviceID;
|
||||
|
||||
// Human-readable device name
|
||||
const char * description;
|
||||
|
||||
// USB vendor/product IDs as returned by the driver. Can be used to determine the particular model of device represented.
|
||||
int vendorID;
|
||||
int productID;
|
||||
|
||||
// Number of axis elements belonging to the device
|
||||
unsigned int numAxes;
|
||||
|
||||
// Number of button elements belonging to the device
|
||||
unsigned int numButtons;
|
||||
|
||||
// Array[numAxes] of values representing the current state of each axis, in the range [-1..1]
|
||||
float * axisStates;
|
||||
|
||||
// Array[numButtons] of values representing the current state of each button
|
||||
bool * buttonStates;
|
||||
|
||||
// Broadcasts GAMEPAD_EVENT_BUTTON_DOWN, GAMEPAD_EVENT_BUTTON_UP, and GAMEPAD_EVENT_AXIS_MOVED
|
||||
EventDispatcher * eventDispatcher;
|
||||
|
||||
// Platform-specific device data storage; don't mess with it
|
||||
void * privateData;
|
||||
};
|
||||
|
||||
/* Initializes gamepad library and detects initial devices. Call this before any other Gamepad_*()
|
||||
function, EXCEPT Gamepad_eventDispatcher(). In order to get receive GAMEPAD_EVENT_DEVICE_ATTACHED
|
||||
events from devices detected in Gamepad_init(), you must register handlers for those events before
|
||||
calling Gamepad_init(). */
|
||||
void Gamepad_init();
|
||||
|
||||
/* Tears down all data structures created by the gamepad library and releases any memory that was
|
||||
allocated. It is not necessary to call this function at application termination. */
|
||||
void Gamepad_shutdown();
|
||||
|
||||
/* EventDispatcher used by gamepad library to broadcast GAMEPAD_EVENT_DEVICE_ATTACHED and
|
||||
GAMEPAD_EVENT_DEVICE_REMOVED events. */
|
||||
EventDispatcher * Gamepad_eventDispatcher();
|
||||
|
||||
/* Returns the number of currently attached gamepad devices. */
|
||||
unsigned int Gamepad_numDevices();
|
||||
|
||||
/* Returns the specified Gamepad_device struct, or NULL if deviceIndex is out of bounds. */
|
||||
struct Gamepad_device * Gamepad_deviceAtIndex(unsigned int deviceIndex);
|
||||
|
||||
/* Polls for any devices that have been attached since the last call to Gamepad_detectDevices() or
|
||||
Gamepad_init(). If any new devices are found, a GAMEPAD_EVENT_DEVICE_ATTACHED event will be
|
||||
broadcast via Gamepad_eventDispatcher() for each one. */
|
||||
void Gamepad_detectDevices();
|
||||
|
||||
/* Reads pending input from all attached devices and broadcasts GAMEPAD_EVENT_BUTTON_DOWN,
|
||||
GAMEPAD_EVENT_BUTTON_UP, and GAMEPAD_EVENT_AXIS_MOVED events through the eventDispatcher of the
|
||||
device that generated the event. */
|
||||
void Gamepad_processEvents();
|
||||
|
||||
#endif
|
|
@ -0,0 +1,440 @@
|
|||
/*
|
||||
Copyright (c) 2010 Alex Diener
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
Alex Diener adiener@sacredsoftware.net
|
||||
*/
|
||||
|
||||
#include "gamepad/Gamepad.h"
|
||||
#include <dirent.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <limits.h>
|
||||
#include <linux/input.h>
|
||||
#include <pthread.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
struct Gamepad_devicePrivate {
|
||||
pthread_t thread;
|
||||
int fd;
|
||||
char * path;
|
||||
int buttonMap[KEY_CNT - BTN_MISC];
|
||||
int axisMap[ABS_CNT];
|
||||
struct input_absinfo axisInfo[ABS_CNT];
|
||||
};
|
||||
|
||||
struct Gamepad_queuedEvent {
|
||||
EventDispatcher * dispatcher;
|
||||
const char * eventType;
|
||||
void * eventData;
|
||||
};
|
||||
|
||||
static struct Gamepad_device ** devices = NULL;
|
||||
static unsigned int numDevices = 0;
|
||||
static unsigned int nextDeviceID = 0;
|
||||
static pthread_mutex_t devicesMutex;
|
||||
|
||||
static struct Gamepad_queuedEvent * eventQueue = NULL;
|
||||
static size_t eventQueueSize = 0;
|
||||
static size_t eventCount = 0;
|
||||
static pthread_mutex_t eventQueueMutex;
|
||||
|
||||
static EventDispatcher * eventDispatcher = NULL;
|
||||
static bool inited = false;
|
||||
|
||||
#define test_bit(bitIndex, array) \
|
||||
((array[(bitIndex) / (sizeof(int) * 8)] >> ((bitIndex) % (sizeof(int) * 8))) & 0x1)
|
||||
|
||||
static char ** findGamepadPaths(unsigned int * outNumGamepads) {
|
||||
DIR * dev_input;
|
||||
struct dirent * entity;
|
||||
unsigned int numGamepads = 0;
|
||||
char ** gamepadDevs = NULL;
|
||||
unsigned int charsConsumed;
|
||||
int num;
|
||||
int fd;
|
||||
int evCapBits[(EV_CNT - 1) / sizeof(int) * 8 + 1];
|
||||
int evKeyBits[(KEY_CNT - 1) / sizeof(int) * 8 + 1];
|
||||
int evAbsBits[(ABS_CNT - 1) / sizeof(int) * 8 + 1];
|
||||
char fileName[PATH_MAX];
|
||||
|
||||
dev_input = opendir("/dev/input");
|
||||
if (dev_input != NULL) {
|
||||
for (entity = readdir(dev_input); entity != NULL; entity = readdir(dev_input)) {
|
||||
charsConsumed = 0;
|
||||
if (sscanf(entity->d_name, "event%d%n", &num, &charsConsumed) && charsConsumed == strlen(entity->d_name)) {
|
||||
snprintf(fileName, PATH_MAX, "/dev/input/%s", entity->d_name);
|
||||
fd = open(fileName, O_RDONLY, 0);
|
||||
memset(evCapBits, 0, sizeof(evCapBits));
|
||||
memset(evKeyBits, 0, sizeof(evKeyBits));
|
||||
memset(evAbsBits, 0, sizeof(evAbsBits));
|
||||
if (ioctl(fd, EVIOCGBIT(0, sizeof(evCapBits)), evCapBits) < 0 ||
|
||||
ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(evKeyBits)), evKeyBits) < 0 ||
|
||||
ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(evAbsBits)), evAbsBits) < 0) {
|
||||
close(fd);
|
||||
continue;
|
||||
}
|
||||
if (!test_bit(EV_KEY, evCapBits) || !test_bit(EV_ABS, evCapBits) ||
|
||||
!test_bit(ABS_X, evAbsBits) || !test_bit(ABS_Y, evAbsBits) ||
|
||||
(!test_bit(BTN_TRIGGER, evKeyBits) && !test_bit(BTN_A, evKeyBits) && !test_bit(BTN_1, evKeyBits))) {
|
||||
close(fd);
|
||||
continue;
|
||||
}
|
||||
close(fd);
|
||||
|
||||
numGamepads++;
|
||||
gamepadDevs = realloc(gamepadDevs, sizeof(char *) * numGamepads);
|
||||
gamepadDevs[numGamepads - 1] = malloc(strlen(fileName) + 1);
|
||||
strcpy(gamepadDevs[numGamepads - 1], fileName);
|
||||
}
|
||||
}
|
||||
closedir(dev_input);
|
||||
}
|
||||
|
||||
*outNumGamepads = numGamepads;
|
||||
return gamepadDevs;
|
||||
}
|
||||
|
||||
void Gamepad_init() {
|
||||
if (!inited) {
|
||||
pthread_mutex_init(&devicesMutex, NULL);
|
||||
pthread_mutex_init(&eventQueueMutex, NULL);
|
||||
inited = true;
|
||||
Gamepad_detectDevices();
|
||||
}
|
||||
}
|
||||
|
||||
static void disposeDevice(struct Gamepad_device * device) {
|
||||
device->eventDispatcher->dispose(device->eventDispatcher);
|
||||
|
||||
close(((struct Gamepad_devicePrivate *) device->privateData)->fd);
|
||||
free(((struct Gamepad_devicePrivate *) device->privateData)->path);
|
||||
free(device->privateData);
|
||||
|
||||
free((void *) device->description);
|
||||
free(device->axisStates);
|
||||
free(device->buttonStates);
|
||||
free(device->eventDispatcher);
|
||||
|
||||
free(device);
|
||||
}
|
||||
|
||||
void Gamepad_shutdown() {
|
||||
if (inited) {
|
||||
unsigned int eventIndex;
|
||||
unsigned int devicesLeft;
|
||||
unsigned int gamepadIndex;
|
||||
|
||||
do {
|
||||
pthread_mutex_lock(&devicesMutex);
|
||||
devicesLeft = numDevices;
|
||||
if (devicesLeft > 0) {
|
||||
pthread_t thread;
|
||||
|
||||
thread = ((struct Gamepad_devicePrivate *) devices[0]->privateData)->thread;
|
||||
pthread_cancel(thread);
|
||||
pthread_join(thread, NULL);
|
||||
|
||||
numDevices--;
|
||||
for (gamepadIndex = 0; gamepadIndex < numDevices; gamepadIndex++) {
|
||||
devices[gamepadIndex] = devices[gamepadIndex + 1];
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&devicesMutex);
|
||||
} while (devicesLeft > 0);
|
||||
|
||||
pthread_mutex_destroy(&devicesMutex);
|
||||
pthread_mutex_destroy(&eventQueueMutex);
|
||||
free(devices);
|
||||
devices = NULL;
|
||||
|
||||
for (eventIndex = 0; eventIndex < eventCount; eventIndex++) {
|
||||
if (!strcmp(eventQueue[eventIndex].eventType, GAMEPAD_EVENT_DEVICE_REMOVED)) {
|
||||
disposeDevice(eventQueue[eventIndex].eventData);
|
||||
}
|
||||
}
|
||||
|
||||
eventQueueSize = 0;
|
||||
eventCount = 0;
|
||||
free(eventQueue);
|
||||
eventQueue = NULL;
|
||||
|
||||
if (eventDispatcher != NULL) {
|
||||
eventDispatcher->dispose(eventDispatcher);
|
||||
free(eventDispatcher);
|
||||
eventDispatcher = NULL;
|
||||
}
|
||||
|
||||
inited = false;
|
||||
}
|
||||
}
|
||||
|
||||
EventDispatcher * Gamepad_eventDispatcher() {
|
||||
if (eventDispatcher == NULL) {
|
||||
eventDispatcher = EventDispatcher_create(NULL);
|
||||
}
|
||||
return eventDispatcher;
|
||||
}
|
||||
|
||||
unsigned int Gamepad_numDevices() {
|
||||
unsigned int result;
|
||||
|
||||
pthread_mutex_lock(&devicesMutex);
|
||||
result = numDevices;
|
||||
pthread_mutex_unlock(&devicesMutex);
|
||||
return result;
|
||||
}
|
||||
|
||||
struct Gamepad_device * Gamepad_deviceAtIndex(unsigned int deviceIndex) {
|
||||
struct Gamepad_device * result;
|
||||
|
||||
pthread_mutex_lock(&devicesMutex);
|
||||
if (deviceIndex >= numDevices) {
|
||||
result = NULL;
|
||||
} else {
|
||||
result = devices[deviceIndex];
|
||||
}
|
||||
pthread_mutex_unlock(&devicesMutex);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static void queueEvent(EventDispatcher * dispatcher, const char * eventType, void * eventData) {
|
||||
struct Gamepad_queuedEvent queuedEvent;
|
||||
|
||||
queuedEvent.dispatcher = dispatcher;
|
||||
queuedEvent.eventType = eventType;
|
||||
queuedEvent.eventData = eventData;
|
||||
|
||||
pthread_mutex_lock(&eventQueueMutex);
|
||||
if (eventCount >= eventQueueSize) {
|
||||
eventQueueSize = eventQueueSize == 0 ? 1 : eventQueueSize * 2;
|
||||
eventQueue = realloc(eventQueue, sizeof(struct Gamepad_queuedEvent) * eventQueueSize);
|
||||
}
|
||||
eventQueue[eventCount++] = queuedEvent;
|
||||
pthread_mutex_unlock(&eventQueueMutex);
|
||||
}
|
||||
|
||||
static void queueAxisEvent(struct Gamepad_device * device, double timestamp, unsigned int axisID, float value) {
|
||||
struct Gamepad_axisEvent * axisEvent;
|
||||
|
||||
axisEvent = malloc(sizeof(struct Gamepad_axisEvent));
|
||||
axisEvent->device = device;
|
||||
axisEvent->timestamp = timestamp;
|
||||
axisEvent->axisID = axisID;
|
||||
axisEvent->value = value;
|
||||
|
||||
queueEvent(device->eventDispatcher, GAMEPAD_EVENT_AXIS_MOVED, axisEvent);
|
||||
}
|
||||
|
||||
static void queueButtonEvent(struct Gamepad_device * device, double timestamp, unsigned int buttonID, bool down) {
|
||||
struct Gamepad_buttonEvent * buttonEvent;
|
||||
|
||||
buttonEvent = malloc(sizeof(struct Gamepad_buttonEvent));
|
||||
buttonEvent->device = device;
|
||||
buttonEvent->timestamp = timestamp;
|
||||
buttonEvent->buttonID = buttonID;
|
||||
buttonEvent->down = down;
|
||||
|
||||
queueEvent(device->eventDispatcher, down ? GAMEPAD_EVENT_BUTTON_DOWN : GAMEPAD_EVENT_BUTTON_UP, buttonEvent);
|
||||
}
|
||||
|
||||
static void * deviceThread(void * context) {
|
||||
unsigned int gamepadIndex;
|
||||
struct Gamepad_device * device;
|
||||
struct Gamepad_devicePrivate * devicePrivate;
|
||||
struct input_event event;
|
||||
|
||||
device = context;
|
||||
devicePrivate = device->privateData;
|
||||
|
||||
while (read(devicePrivate->fd, &event, sizeof(struct input_event)) > 0) {
|
||||
if (event.type == EV_ABS) {
|
||||
float value;
|
||||
|
||||
if (event.code > ABS_MAX || devicePrivate->axisMap[event.code] == -1) {
|
||||
continue;
|
||||
}
|
||||
|
||||
value = (event.value - devicePrivate->axisInfo[event.code].minimum) / (float) (devicePrivate->axisInfo[event.code].maximum - devicePrivate->axisInfo[event.code].minimum) * 2.0f - 1.0f;
|
||||
queueAxisEvent(device,
|
||||
event.time.tv_sec + event.time.tv_usec * 0.000001,
|
||||
devicePrivate->axisMap[event.code],
|
||||
value);
|
||||
|
||||
device->axisStates[devicePrivate->axisMap[event.code]] = value;
|
||||
|
||||
} else if (event.type == EV_KEY) {
|
||||
if (event.code < BTN_MISC || event.code > KEY_MAX || devicePrivate->buttonMap[event.code - BTN_MISC] == -1) {
|
||||
continue;
|
||||
}
|
||||
|
||||
queueButtonEvent(device,
|
||||
event.time.tv_sec + event.time.tv_usec * 0.000001,
|
||||
devicePrivate->buttonMap[event.code - BTN_MISC],
|
||||
!!event.value);
|
||||
|
||||
device->buttonStates[devicePrivate->buttonMap[event.code - BTN_MISC]] = !!event.value;
|
||||
}
|
||||
}
|
||||
|
||||
queueEvent(eventDispatcher, GAMEPAD_EVENT_DEVICE_REMOVED, device);
|
||||
|
||||
pthread_mutex_lock(&devicesMutex);
|
||||
for (gamepadIndex = 0; gamepadIndex < numDevices; gamepadIndex++) {
|
||||
if (devices[gamepadIndex] == device) {
|
||||
unsigned int gamepadIndex2;
|
||||
|
||||
numDevices--;
|
||||
for (gamepadIndex2 = gamepadIndex; gamepadIndex2 < numDevices; gamepadIndex2++) {
|
||||
devices[gamepadIndex2] = devices[gamepadIndex2 + 1];
|
||||
}
|
||||
gamepadIndex--;
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&devicesMutex);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void Gamepad_detectDevices() {
|
||||
unsigned int numPaths;
|
||||
char ** gamepadPaths;
|
||||
bool duplicate;
|
||||
unsigned int pathIndex, gamepadIndex;
|
||||
struct stat statBuf;
|
||||
struct Gamepad_device * deviceRecord;
|
||||
struct Gamepad_devicePrivate * deviceRecordPrivate;
|
||||
int fd;
|
||||
char name[128];
|
||||
char * description;
|
||||
int evKeyBits[(KEY_CNT - 1) / sizeof(int) * 8 + 1];
|
||||
int evAbsBits[(ABS_CNT - 1) / sizeof(int) * 8 + 1];
|
||||
int bit;
|
||||
struct input_id id;
|
||||
|
||||
if (!inited) {
|
||||
return;
|
||||
}
|
||||
|
||||
gamepadPaths = findGamepadPaths(&numPaths);
|
||||
|
||||
pthread_mutex_lock(&devicesMutex);
|
||||
for (pathIndex = 0; pathIndex < numPaths; pathIndex++) {
|
||||
duplicate = false;
|
||||
for (gamepadIndex = 0; gamepadIndex < numDevices; gamepadIndex++) {
|
||||
if (!strcmp(((struct Gamepad_devicePrivate *) devices[gamepadIndex]->privateData)->path, gamepadPaths[pathIndex])) {
|
||||
duplicate = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (duplicate) {
|
||||
free(gamepadPaths[pathIndex]);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!stat(gamepadPaths[pathIndex], &statBuf)) {
|
||||
deviceRecord = malloc(sizeof(struct Gamepad_device));
|
||||
deviceRecord->deviceID = nextDeviceID++;
|
||||
deviceRecord->eventDispatcher = EventDispatcher_create(deviceRecord);
|
||||
devices = realloc(devices, sizeof(struct Gamepad_device *) * (numDevices + 1));
|
||||
devices[numDevices++] = deviceRecord;
|
||||
|
||||
fd = open(gamepadPaths[pathIndex], O_RDONLY, 0);
|
||||
|
||||
deviceRecordPrivate = malloc(sizeof(struct Gamepad_devicePrivate));
|
||||
deviceRecordPrivate->fd = fd;
|
||||
deviceRecordPrivate->path = gamepadPaths[pathIndex];
|
||||
memset(deviceRecordPrivate->buttonMap, 0xFF, sizeof(deviceRecordPrivate->buttonMap));
|
||||
memset(deviceRecordPrivate->axisMap, 0xFF, sizeof(deviceRecordPrivate->axisMap));
|
||||
deviceRecord->privateData = deviceRecordPrivate;
|
||||
|
||||
if (ioctl(fd, EVIOCGNAME(sizeof(name)), name) > 0) {
|
||||
description = malloc(strlen(name + 1));
|
||||
strcpy(description, name);
|
||||
} else {
|
||||
description = malloc(strlen(gamepadPaths[pathIndex] + 1));
|
||||
strcpy(description, gamepadPaths[pathIndex]);
|
||||
}
|
||||
deviceRecord->description = description;
|
||||
|
||||
if (!ioctl(fd, EVIOCGID, &id)) {
|
||||
deviceRecord->vendorID = id.vendor;
|
||||
deviceRecord->productID = id.product;
|
||||
} else {
|
||||
deviceRecord->vendorID = deviceRecord->productID = 0;
|
||||
}
|
||||
|
||||
memset(evKeyBits, 0, sizeof(evKeyBits));
|
||||
memset(evAbsBits, 0, sizeof(evAbsBits));
|
||||
ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(evKeyBits)), evKeyBits);
|
||||
ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(evAbsBits)), evAbsBits);
|
||||
|
||||
deviceRecord->numAxes = 0;
|
||||
for (bit = 0; bit < ABS_CNT; bit++) {
|
||||
if (test_bit(bit, evAbsBits)) {
|
||||
if (ioctl(fd, EVIOCGABS(bit), &deviceRecordPrivate->axisInfo[bit]) < 0 ||
|
||||
deviceRecordPrivate->axisInfo[bit].minimum == deviceRecordPrivate->axisInfo[bit].maximum) {
|
||||
continue;
|
||||
}
|
||||
deviceRecordPrivate->axisMap[bit] = deviceRecord->numAxes;
|
||||
deviceRecord->numAxes++;
|
||||
}
|
||||
}
|
||||
deviceRecord->numButtons = 0;
|
||||
for (bit = BTN_MISC; bit < KEY_CNT; bit++) {
|
||||
if (test_bit(bit, evKeyBits)) {
|
||||
deviceRecordPrivate->buttonMap[bit - BTN_MISC] = deviceRecord->numButtons;
|
||||
deviceRecord->numButtons++;
|
||||
}
|
||||
}
|
||||
|
||||
deviceRecord->axisStates = calloc(sizeof(float), deviceRecord->numAxes);
|
||||
deviceRecord->buttonStates = calloc(sizeof(bool), deviceRecord->numButtons);
|
||||
|
||||
Gamepad_eventDispatcher()->dispatchEvent(Gamepad_eventDispatcher(), GAMEPAD_EVENT_DEVICE_ATTACHED, deviceRecord);
|
||||
|
||||
pthread_create(&deviceRecordPrivate->thread, NULL, deviceThread, deviceRecord);
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&devicesMutex);
|
||||
}
|
||||
|
||||
void Gamepad_processEvents() {
|
||||
unsigned int eventIndex;
|
||||
|
||||
if (!inited) {
|
||||
return;
|
||||
}
|
||||
|
||||
pthread_mutex_lock(&eventQueueMutex);
|
||||
for (eventIndex = 0; eventIndex < eventCount; eventIndex++) {
|
||||
eventQueue[eventIndex].dispatcher->dispatchEvent(eventQueue[eventIndex].dispatcher, eventQueue[eventIndex].eventType, eventQueue[eventIndex].eventData);
|
||||
if (!strcmp(eventQueue[eventIndex].eventType, GAMEPAD_EVENT_DEVICE_REMOVED)) {
|
||||
disposeDevice(eventQueue[eventIndex].eventData);
|
||||
}
|
||||
}
|
||||
eventCount = 0;
|
||||
pthread_mutex_unlock(&eventQueueMutex);
|
||||
}
|
||||
|
|
@ -0,0 +1,525 @@
|
|||
/*
|
||||
Copyright (c) 2010 Alex Diener
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
Alex Diener adiener@sacredsoftware.net
|
||||
*/
|
||||
|
||||
#include "gamepad/Gamepad.h"
|
||||
#include <IOKit/hid/IOHIDLib.h>
|
||||
#include <limits.h>
|
||||
#include <mach/mach.h>
|
||||
#include <mach/mach_time.h>
|
||||
|
||||
struct HIDGamepadAxis {
|
||||
IOHIDElementCookie cookie;
|
||||
CFIndex logicalMin;
|
||||
CFIndex logicalMax;
|
||||
bool hasNullState;
|
||||
bool isHatSwitch;
|
||||
bool isHatSwitchSecondAxis;
|
||||
};
|
||||
|
||||
struct HIDGamepadButton {
|
||||
IOHIDElementCookie cookie;
|
||||
};
|
||||
|
||||
struct Gamepad_devicePrivate {
|
||||
IOHIDDeviceRef deviceRef;
|
||||
struct HIDGamepadAxis * axisElements;
|
||||
struct HIDGamepadButton * buttonElements;
|
||||
};
|
||||
|
||||
struct Gamepad_queuedEvent {
|
||||
EventDispatcher * dispatcher;
|
||||
const char * eventType;
|
||||
void * eventData;
|
||||
};
|
||||
|
||||
static IOHIDManagerRef hidManager = NULL;
|
||||
static struct Gamepad_device ** devices = NULL;
|
||||
static unsigned int numDevices = 0;
|
||||
static unsigned int nextDeviceID = 0;
|
||||
|
||||
static struct Gamepad_queuedEvent * inputEventQueue = NULL;
|
||||
static size_t inputEventQueueSize = 0;
|
||||
static size_t inputEventCount = 0;
|
||||
|
||||
static struct Gamepad_queuedEvent * deviceEventQueue = NULL;
|
||||
static size_t deviceEventQueueSize = 0;
|
||||
static size_t deviceEventCount = 0;
|
||||
|
||||
static EventDispatcher * eventDispatcher = NULL;
|
||||
|
||||
static void hatValueToXY(CFIndex value, CFIndex range, int * outX, int * outY) {
|
||||
if (value == range) {
|
||||
*outX = *outY = 0;
|
||||
|
||||
} else {
|
||||
if (value > 0 && value < range / 2) {
|
||||
*outX = 1;
|
||||
|
||||
} else if (value > range / 2) {
|
||||
*outX = -1;
|
||||
|
||||
} else {
|
||||
*outX = 0;
|
||||
}
|
||||
|
||||
if (value > range / 4 * 3 || value < range / 4) {
|
||||
*outY = -1;
|
||||
|
||||
} else if (value > range / 4 && value < range / 4 * 3) {
|
||||
*outY = 1;
|
||||
|
||||
} else {
|
||||
*outY = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void queueInputEvent(EventDispatcher * dispatcher, const char * eventType, void * eventData) {
|
||||
struct Gamepad_queuedEvent queuedEvent;
|
||||
|
||||
queuedEvent.dispatcher = dispatcher;
|
||||
queuedEvent.eventType = eventType;
|
||||
queuedEvent.eventData = eventData;
|
||||
|
||||
if (inputEventCount >= inputEventQueueSize) {
|
||||
inputEventQueueSize = inputEventQueueSize == 0 ? 1 : inputEventQueueSize * 2;
|
||||
inputEventQueue = realloc(inputEventQueue, sizeof(struct Gamepad_queuedEvent) * inputEventQueueSize);
|
||||
}
|
||||
inputEventQueue[inputEventCount++] = queuedEvent;
|
||||
}
|
||||
|
||||
static void queueAxisEvent(struct Gamepad_device * device, double timestamp, unsigned int axisID, float value) {
|
||||
struct Gamepad_axisEvent * axisEvent;
|
||||
|
||||
axisEvent = malloc(sizeof(struct Gamepad_axisEvent));
|
||||
axisEvent->device = device;
|
||||
axisEvent->timestamp = timestamp;
|
||||
axisEvent->axisID = axisID;
|
||||
axisEvent->value = value;
|
||||
|
||||
queueInputEvent(device->eventDispatcher, GAMEPAD_EVENT_AXIS_MOVED, axisEvent);
|
||||
}
|
||||
|
||||
static void queueButtonEvent(struct Gamepad_device * device, double timestamp, unsigned int buttonID, bool down) {
|
||||
struct Gamepad_buttonEvent * buttonEvent;
|
||||
|
||||
buttonEvent = malloc(sizeof(struct Gamepad_buttonEvent));
|
||||
buttonEvent->device = device;
|
||||
buttonEvent->timestamp = timestamp;
|
||||
buttonEvent->buttonID = buttonID;
|
||||
buttonEvent->down = down;
|
||||
|
||||
queueInputEvent(device->eventDispatcher, down ? GAMEPAD_EVENT_BUTTON_DOWN : GAMEPAD_EVENT_BUTTON_UP, buttonEvent);
|
||||
}
|
||||
|
||||
static void onDeviceValueChanged(void * context, IOReturn result, void * sender, IOHIDValueRef value) {
|
||||
struct Gamepad_device * deviceRecord;
|
||||
struct Gamepad_devicePrivate * hidDeviceRecord;
|
||||
IOHIDElementRef element;
|
||||
IOHIDElementCookie cookie;
|
||||
unsigned int axisIndex, buttonIndex;
|
||||
static mach_timebase_info_data_t timebaseInfo;
|
||||
|
||||
if (timebaseInfo.denom == 0) {
|
||||
mach_timebase_info(&timebaseInfo);
|
||||
}
|
||||
|
||||
deviceRecord = context;
|
||||
hidDeviceRecord = deviceRecord->privateData;
|
||||
element = IOHIDValueGetElement(value);
|
||||
cookie = IOHIDElementGetCookie(element);
|
||||
|
||||
for (axisIndex = 0; axisIndex < deviceRecord->numAxes; axisIndex++) {
|
||||
if (!hidDeviceRecord->axisElements[axisIndex].isHatSwitchSecondAxis &&
|
||||
hidDeviceRecord->axisElements[axisIndex].cookie == cookie) {
|
||||
CFIndex integerValue;
|
||||
|
||||
if (IOHIDValueGetLength(value) > 4) {
|
||||
// Workaround for a strange crash that occurs with PS3 controller; was getting lengths of 39 (!)
|
||||
continue;
|
||||
}
|
||||
integerValue = IOHIDValueGetIntegerValue(value);
|
||||
|
||||
if (hidDeviceRecord->axisElements[axisIndex].isHatSwitch) {
|
||||
int x, y;
|
||||
|
||||
// Fix for Saitek X52
|
||||
hidDeviceRecord->axisElements[axisIndex].hasNullState = false;
|
||||
if (!hidDeviceRecord->axisElements[axisIndex].hasNullState) {
|
||||
if (integerValue < hidDeviceRecord->axisElements[axisIndex].logicalMin) {
|
||||
integerValue = hidDeviceRecord->axisElements[axisIndex].logicalMax - hidDeviceRecord->axisElements[axisIndex].logicalMin + 1;
|
||||
} else {
|
||||
integerValue--;
|
||||
}
|
||||
}
|
||||
|
||||
hatValueToXY(integerValue, hidDeviceRecord->axisElements[axisIndex].logicalMax - hidDeviceRecord->axisElements[axisIndex].logicalMin + 1, &x, &y);
|
||||
|
||||
if (x != deviceRecord->axisStates[axisIndex]) {
|
||||
queueAxisEvent(deviceRecord,
|
||||
IOHIDValueGetTimeStamp(value) * timebaseInfo.numer / timebaseInfo.denom * 0.000000001,
|
||||
axisIndex,
|
||||
x);
|
||||
|
||||
deviceRecord->axisStates[axisIndex] = x;
|
||||
}
|
||||
|
||||
if (y != deviceRecord->axisStates[axisIndex + 1]) {
|
||||
queueAxisEvent(deviceRecord,
|
||||
IOHIDValueGetTimeStamp(value) * timebaseInfo.numer / timebaseInfo.denom * 0.000000001,
|
||||
axisIndex + 1,
|
||||
y);
|
||||
|
||||
deviceRecord->axisStates[axisIndex + 1] = y;
|
||||
}
|
||||
|
||||
} else {
|
||||
float floatValue;
|
||||
|
||||
if (integerValue < hidDeviceRecord->axisElements[axisIndex].logicalMin) {
|
||||
hidDeviceRecord->axisElements[axisIndex].logicalMin = integerValue;
|
||||
}
|
||||
if (integerValue > hidDeviceRecord->axisElements[axisIndex].logicalMax) {
|
||||
hidDeviceRecord->axisElements[axisIndex].logicalMax = integerValue;
|
||||
}
|
||||
floatValue = (integerValue - hidDeviceRecord->axisElements[axisIndex].logicalMin) / (float) (hidDeviceRecord->axisElements[axisIndex].logicalMax - hidDeviceRecord->axisElements[axisIndex].logicalMin) * 2.0f - 1.0f;
|
||||
|
||||
queueAxisEvent(deviceRecord,
|
||||
IOHIDValueGetTimeStamp(value) * timebaseInfo.numer / timebaseInfo.denom * 0.000000001,
|
||||
axisIndex,
|
||||
floatValue);
|
||||
|
||||
deviceRecord->axisStates[axisIndex] = floatValue;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for (buttonIndex = 0; buttonIndex < deviceRecord->numButtons; buttonIndex++) {
|
||||
if (hidDeviceRecord->buttonElements[buttonIndex].cookie == cookie) {
|
||||
bool down;
|
||||
|
||||
down = IOHIDValueGetIntegerValue(value);
|
||||
queueButtonEvent(deviceRecord,
|
||||
IOHIDValueGetTimeStamp(value) * timebaseInfo.numer / timebaseInfo.denom * 0.000000001,
|
||||
buttonIndex,
|
||||
down);
|
||||
|
||||
deviceRecord->buttonStates[buttonIndex] = down;
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int IOHIDDeviceGetIntProperty(IOHIDDeviceRef deviceRef, CFStringRef key) {
|
||||
CFTypeRef typeRef;
|
||||
int value;
|
||||
|
||||
typeRef = IOHIDDeviceGetProperty(deviceRef, key);
|
||||
if (typeRef == NULL || CFGetTypeID(typeRef) != CFNumberGetTypeID()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
CFNumberGetValue((CFNumberRef) typeRef, kCFNumberSInt32Type, &value);
|
||||
return value;
|
||||
}
|
||||
|
||||
static int IOHIDDeviceGetVendorID(IOHIDDeviceRef deviceRef) {
|
||||
return IOHIDDeviceGetIntProperty(deviceRef, CFSTR(kIOHIDVendorIDKey));
|
||||
}
|
||||
|
||||
static int IOHIDDeviceGetProductID(IOHIDDeviceRef deviceRef) {
|
||||
return IOHIDDeviceGetIntProperty(deviceRef, CFSTR(kIOHIDProductIDKey));
|
||||
}
|
||||
|
||||
static void onDeviceMatched(void * context, IOReturn result, void * sender, IOHIDDeviceRef device) {
|
||||
CFArrayRef elements;
|
||||
CFIndex elementIndex;
|
||||
IOHIDElementRef element;
|
||||
CFStringRef cfProductName;
|
||||
struct Gamepad_device * deviceRecord;
|
||||
struct Gamepad_devicePrivate * hidDeviceRecord;
|
||||
IOHIDElementType type;
|
||||
char * description;
|
||||
struct Gamepad_queuedEvent queuedEvent;
|
||||
|
||||
deviceRecord = malloc(sizeof(struct Gamepad_device));
|
||||
deviceRecord->deviceID = nextDeviceID++;
|
||||
deviceRecord->vendorID = IOHIDDeviceGetVendorID(device);
|
||||
deviceRecord->productID = IOHIDDeviceGetProductID(device);
|
||||
deviceRecord->numAxes = 0;
|
||||
deviceRecord->numButtons = 0;
|
||||
deviceRecord->eventDispatcher = EventDispatcher_create(deviceRecord);
|
||||
devices = realloc(devices, sizeof(struct Gamepad_device *) * (numDevices + 1));
|
||||
devices[numDevices++] = deviceRecord;
|
||||
|
||||
hidDeviceRecord = malloc(sizeof(struct Gamepad_devicePrivate));
|
||||
hidDeviceRecord->deviceRef = device;
|
||||
hidDeviceRecord->axisElements = NULL;
|
||||
hidDeviceRecord->buttonElements = NULL;
|
||||
deviceRecord->privateData = hidDeviceRecord;
|
||||
|
||||
cfProductName = IOHIDDeviceGetProperty(device, CFSTR(kIOHIDProductKey));
|
||||
if (cfProductName == NULL || CFGetTypeID(cfProductName) != CFStringGetTypeID()) {
|
||||
description = malloc(strlen("[Unknown]" + 1));
|
||||
strcpy(description, "[Unknown]");
|
||||
|
||||
} else {
|
||||
const char * cStringPtr;
|
||||
|
||||
cStringPtr = CFStringGetCStringPtr(cfProductName, CFStringGetSmallestEncoding(cfProductName));
|
||||
description = malloc(strlen(cStringPtr + 1));
|
||||
strcpy(description, cStringPtr);
|
||||
}
|
||||
deviceRecord->description = description;
|
||||
|
||||
elements = IOHIDDeviceCopyMatchingElements(device, NULL, kIOHIDOptionsTypeNone);
|
||||
for (elementIndex = 0; elementIndex < CFArrayGetCount(elements); elementIndex++) {
|
||||
element = (IOHIDElementRef) CFArrayGetValueAtIndex(elements, elementIndex);
|
||||
type = IOHIDElementGetType(element);
|
||||
|
||||
// All of the axis elements I've ever detected have been kIOHIDElementTypeInput_Misc. kIOHIDElementTypeInput_Axis is only included for good faith...
|
||||
if (type == kIOHIDElementTypeInput_Misc ||
|
||||
type == kIOHIDElementTypeInput_Axis) {
|
||||
|
||||
hidDeviceRecord->axisElements = realloc(hidDeviceRecord->axisElements, sizeof(struct HIDGamepadAxis) * (deviceRecord->numAxes + 1));
|
||||
hidDeviceRecord->axisElements[deviceRecord->numAxes].cookie = IOHIDElementGetCookie(element);
|
||||
hidDeviceRecord->axisElements[deviceRecord->numAxes].logicalMin = IOHIDElementGetLogicalMin(element);
|
||||
hidDeviceRecord->axisElements[deviceRecord->numAxes].logicalMax = IOHIDElementGetLogicalMax(element);
|
||||
hidDeviceRecord->axisElements[deviceRecord->numAxes].hasNullState = !!IOHIDElementHasNullState(element);
|
||||
hidDeviceRecord->axisElements[deviceRecord->numAxes].isHatSwitch = IOHIDElementGetUsage(element) == kHIDUsage_GD_Hatswitch;
|
||||
hidDeviceRecord->axisElements[deviceRecord->numAxes].isHatSwitchSecondAxis = false;
|
||||
deviceRecord->numAxes++;
|
||||
|
||||
if (hidDeviceRecord->axisElements[deviceRecord->numAxes - 1].isHatSwitch) {
|
||||
hidDeviceRecord->axisElements = realloc(hidDeviceRecord->axisElements, sizeof(struct HIDGamepadAxis) * (deviceRecord->numAxes + 1));
|
||||
hidDeviceRecord->axisElements[deviceRecord->numAxes].isHatSwitchSecondAxis = true;
|
||||
deviceRecord->numAxes++;
|
||||
}
|
||||
|
||||
} else if (type == kIOHIDElementTypeInput_Button) {
|
||||
hidDeviceRecord->buttonElements = realloc(hidDeviceRecord->buttonElements, sizeof(struct HIDGamepadButton) * (deviceRecord->numButtons + 1));
|
||||
hidDeviceRecord->buttonElements[deviceRecord->numButtons].cookie = IOHIDElementGetCookie(element);
|
||||
deviceRecord->numButtons++;
|
||||
}
|
||||
}
|
||||
CFRelease(elements);
|
||||
|
||||
deviceRecord->axisStates = calloc(sizeof(float), deviceRecord->numAxes);
|
||||
deviceRecord->buttonStates = calloc(sizeof(bool), deviceRecord->numButtons);
|
||||
|
||||
IOHIDDeviceRegisterInputValueCallback(device, onDeviceValueChanged, deviceRecord);
|
||||
|
||||
queuedEvent.dispatcher = Gamepad_eventDispatcher();
|
||||
queuedEvent.eventType = GAMEPAD_EVENT_DEVICE_ATTACHED;
|
||||
queuedEvent.eventData = deviceRecord;
|
||||
|
||||
if (deviceEventCount >= deviceEventQueueSize) {
|
||||
deviceEventQueueSize = deviceEventQueueSize == 0 ? 1 : deviceEventQueueSize * 2;
|
||||
deviceEventQueue = realloc(deviceEventQueue, sizeof(struct Gamepad_queuedEvent) * deviceEventQueueSize);
|
||||
}
|
||||
deviceEventQueue[deviceEventCount++] = queuedEvent;
|
||||
}
|
||||
|
||||
static void disposeDevice(struct Gamepad_device * deviceRecord) {
|
||||
unsigned int inputEventIndex, deviceEventIndex;
|
||||
|
||||
IOHIDDeviceRegisterInputValueCallback(((struct Gamepad_devicePrivate *) deviceRecord->privateData)->deviceRef, NULL, NULL);
|
||||
|
||||
for (inputEventIndex = 0; inputEventIndex < inputEventCount; inputEventIndex++) {
|
||||
if (inputEventQueue[inputEventIndex].dispatcher == deviceRecord->eventDispatcher) {
|
||||
unsigned int inputEventIndex2;
|
||||
|
||||
free(inputEventQueue[inputEventIndex].eventData);
|
||||
inputEventCount--;
|
||||
for (inputEventIndex2 = inputEventIndex; inputEventIndex2 < inputEventCount; inputEventIndex2++) {
|
||||
inputEventQueue[inputEventIndex2] = inputEventQueue[inputEventIndex2 + 1];
|
||||
}
|
||||
inputEventIndex--;
|
||||
}
|
||||
}
|
||||
|
||||
for (deviceEventIndex = 0; deviceEventIndex < deviceEventCount; deviceEventIndex++) {
|
||||
if (deviceEventQueue[deviceEventIndex].dispatcher == deviceRecord->eventDispatcher) {
|
||||
unsigned int deviceEventIndex2;
|
||||
|
||||
deviceEventCount--;
|
||||
for (deviceEventIndex2 = deviceEventIndex; deviceEventIndex2 < deviceEventCount; deviceEventIndex2++) {
|
||||
deviceEventQueue[deviceEventIndex2] = deviceEventQueue[deviceEventIndex2 + 1];
|
||||
}
|
||||
deviceEventIndex--;
|
||||
}
|
||||
}
|
||||
|
||||
deviceRecord->eventDispatcher->dispose(deviceRecord->eventDispatcher);
|
||||
|
||||
free(((struct Gamepad_devicePrivate *) deviceRecord->privateData)->axisElements);
|
||||
free(((struct Gamepad_devicePrivate *) deviceRecord->privateData)->buttonElements);
|
||||
free(deviceRecord->privateData);
|
||||
|
||||
free((void *) deviceRecord->description);
|
||||
free(deviceRecord->axisStates);
|
||||
free(deviceRecord->buttonStates);
|
||||
free(deviceRecord->eventDispatcher);
|
||||
|
||||
free(deviceRecord);
|
||||
}
|
||||
|
||||
static void onDeviceRemoved(void * context, IOReturn result, void * sender, IOHIDDeviceRef device) {
|
||||
unsigned int deviceIndex;
|
||||
|
||||
for (deviceIndex = 0; deviceIndex < numDevices; deviceIndex++) {
|
||||
if (((struct Gamepad_devicePrivate *) devices[deviceIndex]->privateData)->deviceRef == device) {
|
||||
Gamepad_eventDispatcher()->dispatchEvent(Gamepad_eventDispatcher(), GAMEPAD_EVENT_DEVICE_REMOVED, devices[deviceIndex]);
|
||||
|
||||
disposeDevice(devices[deviceIndex]);
|
||||
numDevices--;
|
||||
for (; deviceIndex < numDevices; deviceIndex++) {
|
||||
devices[deviceIndex] = devices[deviceIndex + 1];
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Gamepad_init() {
|
||||
if (hidManager == NULL) {
|
||||
CFStringRef keys[2];
|
||||
int value;
|
||||
CFNumberRef values[2];
|
||||
CFDictionaryRef dictionaries[3];
|
||||
CFArrayRef array;
|
||||
|
||||
hidManager = IOHIDManagerCreate(kCFAllocatorDefault, kIOHIDOptionsTypeNone);
|
||||
IOHIDManagerOpen(hidManager, kIOHIDOptionsTypeNone);
|
||||
IOHIDManagerScheduleWithRunLoop(hidManager, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
|
||||
|
||||
keys[0] = CFSTR(kIOHIDDeviceUsagePageKey);
|
||||
keys[1] = CFSTR(kIOHIDDeviceUsageKey);
|
||||
|
||||
value = kHIDPage_GenericDesktop;
|
||||
values[0] = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &value);
|
||||
value = kHIDUsage_GD_Joystick;
|
||||
values[1] = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &value);
|
||||
dictionaries[0] = CFDictionaryCreate(kCFAllocatorDefault, (const void **) keys, (const void **) values, 2, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
|
||||
CFRelease(values[0]);
|
||||
CFRelease(values[1]);
|
||||
|
||||
value = kHIDPage_GenericDesktop;
|
||||
values[0] = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &value);
|
||||
value = kHIDUsage_GD_GamePad;
|
||||
values[1] = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &value);
|
||||
dictionaries[1] = CFDictionaryCreate(kCFAllocatorDefault, (const void **) keys, (const void **) values, 2, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
|
||||
CFRelease(values[0]);
|
||||
CFRelease(values[1]);
|
||||
|
||||
value = kHIDPage_GenericDesktop;
|
||||
values[0] = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &value);
|
||||
value = kHIDUsage_GD_MultiAxisController;
|
||||
values[1] = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &value);
|
||||
dictionaries[2] = CFDictionaryCreate(kCFAllocatorDefault, (const void **) keys, (const void **) values, 2, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
|
||||
CFRelease(values[0]);
|
||||
CFRelease(values[1]);
|
||||
|
||||
array = CFArrayCreate(kCFAllocatorDefault, (const void **) dictionaries, 3, &kCFTypeArrayCallBacks);
|
||||
CFRelease(dictionaries[0]);
|
||||
CFRelease(dictionaries[1]);
|
||||
CFRelease(dictionaries[2]);
|
||||
IOHIDManagerSetDeviceMatchingMultiple(hidManager, array);
|
||||
CFRelease(array);
|
||||
|
||||
IOHIDManagerRegisterDeviceMatchingCallback(hidManager, onDeviceMatched, NULL);
|
||||
IOHIDManagerRegisterDeviceRemovalCallback(hidManager, onDeviceRemoved, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
void Gamepad_shutdown() {
|
||||
if (hidManager != NULL) {
|
||||
unsigned int deviceIndex;
|
||||
|
||||
IOHIDManagerUnscheduleFromRunLoop(hidManager, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
|
||||
IOHIDManagerClose(hidManager, 0);
|
||||
CFRelease(hidManager);
|
||||
hidManager = NULL;
|
||||
|
||||
for (deviceIndex = 0; deviceIndex < numDevices; deviceIndex++) {
|
||||
disposeDevice(devices[deviceIndex]);
|
||||
}
|
||||
free(devices);
|
||||
devices = NULL;
|
||||
numDevices = 0;
|
||||
|
||||
if (eventDispatcher != NULL) {
|
||||
eventDispatcher->dispose(eventDispatcher);
|
||||
free(eventDispatcher);
|
||||
eventDispatcher = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EventDispatcher * Gamepad_eventDispatcher() {
|
||||
if (eventDispatcher == NULL) {
|
||||
eventDispatcher = EventDispatcher_create(NULL);
|
||||
}
|
||||
return eventDispatcher;
|
||||
}
|
||||
|
||||
unsigned int Gamepad_numDevices() {
|
||||
return numDevices;
|
||||
}
|
||||
|
||||
struct Gamepad_device * Gamepad_deviceAtIndex(unsigned int deviceIndex) {
|
||||
if (deviceIndex >= numDevices) {
|
||||
return NULL;
|
||||
}
|
||||
return devices[deviceIndex];
|
||||
}
|
||||
|
||||
void Gamepad_detectDevices() {
|
||||
unsigned int eventIndex;
|
||||
|
||||
if (hidManager == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (eventIndex = 0; eventIndex < deviceEventCount; eventIndex++) {
|
||||
deviceEventQueue[eventIndex].dispatcher->dispatchEvent(deviceEventQueue[eventIndex].dispatcher, deviceEventQueue[eventIndex].eventType, deviceEventQueue[eventIndex].eventData);
|
||||
}
|
||||
deviceEventCount = 0;
|
||||
}
|
||||
|
||||
void Gamepad_processEvents() {
|
||||
unsigned int eventIndex;
|
||||
|
||||
if (hidManager == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (eventIndex = 0; eventIndex < inputEventCount; eventIndex++) {
|
||||
inputEventQueue[eventIndex].dispatcher->dispatchEvent(inputEventQueue[eventIndex].dispatcher, inputEventQueue[eventIndex].eventType, inputEventQueue[eventIndex].eventData);
|
||||
free(inputEventQueue[eventIndex].eventData);
|
||||
}
|
||||
inputEventCount = 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,416 @@
|
|||
/*
|
||||
Copyright (c) 2010 Alex Diener
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
Alex Diener adiener@sacredsoftware.net
|
||||
*/
|
||||
|
||||
#include "gamepad/Gamepad.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <windows.h>
|
||||
#include <regstr.h>
|
||||
|
||||
struct Gamepad_devicePrivate {
|
||||
UINT joystickID;
|
||||
JOYINFOEX lastState;
|
||||
int xAxisIndex;
|
||||
int yAxisIndex;
|
||||
int zAxisIndex;
|
||||
int rAxisIndex;
|
||||
int uAxisIndex;
|
||||
int vAxisIndex;
|
||||
int povXAxisIndex;
|
||||
int povYAxisIndex;
|
||||
UINT (* axisRanges)[2];
|
||||
};
|
||||
|
||||
static struct Gamepad_device ** devices = NULL;
|
||||
static unsigned int numDevices = 0;
|
||||
static unsigned int nextDeviceID = 0;
|
||||
|
||||
static EventDispatcher * eventDispatcher = NULL;
|
||||
static bool inited = false;
|
||||
|
||||
void Gamepad_init() {
|
||||
if (!inited) {
|
||||
inited = true;
|
||||
Gamepad_detectDevices();
|
||||
}
|
||||
}
|
||||
|
||||
static void disposeDevice(struct Gamepad_device * deviceRecord) {
|
||||
deviceRecord->eventDispatcher->dispose(deviceRecord->eventDispatcher);
|
||||
|
||||
free(((struct Gamepad_devicePrivate *) deviceRecord->privateData)->axisRanges);
|
||||
free(deviceRecord->privateData);
|
||||
|
||||
free((void *) deviceRecord->description);
|
||||
free(deviceRecord->axisStates);
|
||||
free(deviceRecord->buttonStates);
|
||||
free(deviceRecord->eventDispatcher);
|
||||
|
||||
free(deviceRecord);
|
||||
}
|
||||
|
||||
void Gamepad_shutdown() {
|
||||
unsigned int deviceIndex;
|
||||
|
||||
if (inited) {
|
||||
for (deviceIndex = 0; deviceIndex < numDevices; deviceIndex++) {
|
||||
disposeDevice(devices[deviceIndex]);
|
||||
}
|
||||
free(devices);
|
||||
devices = NULL;
|
||||
numDevices = 0;
|
||||
if (eventDispatcher != NULL) {
|
||||
eventDispatcher->dispose(eventDispatcher);
|
||||
free(eventDispatcher);
|
||||
eventDispatcher = NULL;
|
||||
}
|
||||
inited = false;
|
||||
}
|
||||
}
|
||||
|
||||
EventDispatcher * Gamepad_eventDispatcher() {
|
||||
if (eventDispatcher == NULL) {
|
||||
eventDispatcher = EventDispatcher_create(NULL);
|
||||
}
|
||||
return eventDispatcher;
|
||||
}
|
||||
|
||||
unsigned int Gamepad_numDevices() {
|
||||
return numDevices;
|
||||
}
|
||||
|
||||
struct Gamepad_device * Gamepad_deviceAtIndex(unsigned int deviceIndex) {
|
||||
if (deviceIndex >= numDevices) {
|
||||
return NULL;
|
||||
}
|
||||
return devices[deviceIndex];
|
||||
}
|
||||
|
||||
#define REG_STRING_MAX 256
|
||||
|
||||
static char * getDeviceDescription(UINT joystickID, JOYCAPS caps) {
|
||||
char * description;
|
||||
char subkey[REG_STRING_MAX];
|
||||
HKEY topKey, key;
|
||||
LONG result;
|
||||
|
||||
snprintf(subkey, REG_STRING_MAX, "%s\\%s\\%s", REGSTR_PATH_JOYCONFIG, caps.szRegKey, REGSTR_KEY_JOYCURR);
|
||||
result = RegOpenKeyEx(topKey = HKEY_LOCAL_MACHINE, subkey, 0, KEY_READ, &key);
|
||||
if (result != ERROR_SUCCESS) {
|
||||
result = RegOpenKeyEx(topKey = HKEY_CURRENT_USER, subkey, 0, KEY_READ, &key);
|
||||
}
|
||||
if (result == ERROR_SUCCESS) {
|
||||
char value[REG_STRING_MAX];
|
||||
char name[REG_STRING_MAX];
|
||||
DWORD nameSize;
|
||||
|
||||
snprintf(value, REG_STRING_MAX, "Joystick%d%s", joystickID + 1, REGSTR_VAL_JOYOEMNAME);
|
||||
nameSize = sizeof(name);
|
||||
result = RegQueryValueEx(key, value, NULL, NULL, (LPBYTE) name, &nameSize);
|
||||
RegCloseKey(key);
|
||||
|
||||
if (result == ERROR_SUCCESS) {
|
||||
snprintf(subkey, REG_STRING_MAX, "%s\\%s", REGSTR_PATH_JOYOEM, name);
|
||||
result = RegOpenKeyEx(topKey, subkey, 0, KEY_READ, &key);
|
||||
|
||||
if (result == ERROR_SUCCESS) {
|
||||
nameSize = sizeof(name);
|
||||
result = RegQueryValueEx(key, REGSTR_VAL_JOYOEMNAME, NULL, NULL, NULL, &nameSize);
|
||||
|
||||
if (result == ERROR_SUCCESS) {
|
||||
description = malloc(nameSize);
|
||||
result = RegQueryValueEx(key, REGSTR_VAL_JOYOEMNAME, NULL, NULL, (LPBYTE) description, &nameSize);
|
||||
}
|
||||
RegCloseKey(key);
|
||||
|
||||
if (result == ERROR_SUCCESS) {
|
||||
return description;
|
||||
}
|
||||
free(description);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
description = malloc(strlen(caps.szPname) + 1);
|
||||
strcpy(description, caps.szPname);
|
||||
|
||||
return description;
|
||||
}
|
||||
|
||||
void Gamepad_detectDevices() {
|
||||
unsigned int numPadsSupported;
|
||||
unsigned int deviceIndex, deviceIndex2;
|
||||
JOYINFOEX info;
|
||||
JOYCAPS caps;
|
||||
bool duplicate;
|
||||
struct Gamepad_device * deviceRecord;
|
||||
struct Gamepad_devicePrivate * deviceRecordPrivate;
|
||||
UINT joystickID;
|
||||
int axisIndex;
|
||||
|
||||
if (!inited) {
|
||||
return;
|
||||
}
|
||||
|
||||
numPadsSupported = joyGetNumDevs();
|
||||
for (deviceIndex = 0; deviceIndex < numPadsSupported; deviceIndex++) {
|
||||
info.dwSize = sizeof(info);
|
||||
info.dwFlags = JOY_RETURNALL;
|
||||
joystickID = JOYSTICKID1 + deviceIndex;
|
||||
if (joyGetPosEx(joystickID, &info) == JOYERR_NOERROR &&
|
||||
joyGetDevCaps(joystickID, &caps, sizeof(JOYCAPS)) == JOYERR_NOERROR) {
|
||||
|
||||
duplicate = false;
|
||||
for (deviceIndex2 = 0; deviceIndex2 < numDevices; deviceIndex2++) {
|
||||
if (((struct Gamepad_devicePrivate *) devices[deviceIndex2]->privateData)->joystickID == joystickID) {
|
||||
duplicate = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (duplicate) {
|
||||
continue;
|
||||
}
|
||||
|
||||
deviceRecord = malloc(sizeof(struct Gamepad_device));
|
||||
deviceRecord->deviceID = nextDeviceID++;
|
||||
deviceRecord->description = getDeviceDescription(joystickID, caps);
|
||||
deviceRecord->vendorID = caps.wMid;
|
||||
deviceRecord->productID = caps.wPid;
|
||||
deviceRecord->numAxes = caps.wNumAxes + ((caps.wCaps & JOYCAPS_HASPOV) ? 2 : 0);
|
||||
deviceRecord->numButtons = caps.wNumButtons;
|
||||
deviceRecord->axisStates = calloc(sizeof(float), deviceRecord->numAxes);
|
||||
deviceRecord->buttonStates = calloc(sizeof(bool), deviceRecord->numButtons);
|
||||
deviceRecord->eventDispatcher = EventDispatcher_create(deviceRecord);
|
||||
devices = realloc(devices, sizeof(struct Gamepad_device *) * (numDevices + 1));
|
||||
devices[numDevices++] = deviceRecord;
|
||||
|
||||
deviceRecordPrivate = malloc(sizeof(struct Gamepad_devicePrivate));
|
||||
deviceRecordPrivate->joystickID = joystickID;
|
||||
deviceRecordPrivate->lastState = info;
|
||||
|
||||
deviceRecordPrivate->xAxisIndex = 0;
|
||||
deviceRecordPrivate->yAxisIndex = 1;
|
||||
axisIndex = 2;
|
||||
deviceRecordPrivate->zAxisIndex = (caps.wCaps & JOYCAPS_HASZ) ? axisIndex++ : -1;
|
||||
deviceRecordPrivate->rAxisIndex = (caps.wCaps & JOYCAPS_HASR) ? axisIndex++ : -1;
|
||||
deviceRecordPrivate->uAxisIndex = (caps.wCaps & JOYCAPS_HASU) ? axisIndex++ : -1;
|
||||
deviceRecordPrivate->vAxisIndex = (caps.wCaps & JOYCAPS_HASV) ? axisIndex++ : -1;
|
||||
|
||||
deviceRecordPrivate->axisRanges = malloc(sizeof(UINT[2]) * axisIndex);
|
||||
deviceRecordPrivate->axisRanges[0][0] = caps.wXmin;
|
||||
deviceRecordPrivate->axisRanges[0][1] = caps.wXmax;
|
||||
deviceRecordPrivate->axisRanges[1][0] = caps.wYmin;
|
||||
deviceRecordPrivate->axisRanges[1][1] = caps.wYmax;
|
||||
if (deviceRecordPrivate->zAxisIndex != -1) {
|
||||
deviceRecordPrivate->axisRanges[deviceRecordPrivate->zAxisIndex][0] = caps.wZmin;
|
||||
deviceRecordPrivate->axisRanges[deviceRecordPrivate->zAxisIndex][1] = caps.wZmax;
|
||||
}
|
||||
if (deviceRecordPrivate->rAxisIndex != -1) {
|
||||
deviceRecordPrivate->axisRanges[deviceRecordPrivate->rAxisIndex][0] = caps.wRmin;
|
||||
deviceRecordPrivate->axisRanges[deviceRecordPrivate->rAxisIndex][1] = caps.wRmax;
|
||||
}
|
||||
if (deviceRecordPrivate->uAxisIndex != -1) {
|
||||
deviceRecordPrivate->axisRanges[deviceRecordPrivate->uAxisIndex][0] = caps.wUmin;
|
||||
deviceRecordPrivate->axisRanges[deviceRecordPrivate->uAxisIndex][1] = caps.wUmax;
|
||||
}
|
||||
if (deviceRecordPrivate->vAxisIndex != -1) {
|
||||
deviceRecordPrivate->axisRanges[deviceRecordPrivate->vAxisIndex][0] = caps.wVmin;
|
||||
deviceRecordPrivate->axisRanges[deviceRecordPrivate->vAxisIndex][1] = caps.wVmax;
|
||||
}
|
||||
|
||||
deviceRecordPrivate->povXAxisIndex = (caps.wCaps & JOYCAPS_HASPOV) ? axisIndex++ : -1;
|
||||
deviceRecordPrivate->povYAxisIndex = (caps.wCaps & JOYCAPS_HASPOV) ? axisIndex++ : -1;
|
||||
|
||||
deviceRecord->privateData = deviceRecordPrivate;
|
||||
|
||||
Gamepad_eventDispatcher()->dispatchEvent(Gamepad_eventDispatcher(), GAMEPAD_EVENT_DEVICE_ATTACHED, deviceRecord);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static double currentTime() {
|
||||
// HACK: No timestamp data from joyGetInfoEx, so we make it up
|
||||
static LARGE_INTEGER frequency;
|
||||
LARGE_INTEGER currentTime;
|
||||
|
||||
if (frequency.QuadPart == 0) {
|
||||
QueryPerformanceFrequency(&frequency);
|
||||
}
|
||||
QueryPerformanceCounter(¤tTime);
|
||||
|
||||
return (double) currentTime.QuadPart / frequency.QuadPart;
|
||||
}
|
||||
|
||||
static void handleAxisChange(struct Gamepad_device * device, int axisIndex, DWORD value) {
|
||||
struct Gamepad_axisEvent axisEvent;
|
||||
struct Gamepad_devicePrivate * devicePrivate;
|
||||
|
||||
if (axisIndex < 0 || axisIndex >= (int) device->numAxes) {
|
||||
return;
|
||||
}
|
||||
|
||||
devicePrivate = device->privateData;
|
||||
|
||||
axisEvent.device = device;
|
||||
axisEvent.timestamp = currentTime();
|
||||
axisEvent.axisID = axisIndex;
|
||||
axisEvent.value = (value - devicePrivate->axisRanges[axisIndex][0]) / (float) (devicePrivate->axisRanges[axisIndex][1] - devicePrivate->axisRanges[axisIndex][0]) * 2.0f - 1.0f;
|
||||
|
||||
device->axisStates[axisIndex] = axisEvent.value;
|
||||
device->eventDispatcher->dispatchEvent(device->eventDispatcher, GAMEPAD_EVENT_AXIS_MOVED, &axisEvent);
|
||||
}
|
||||
|
||||
static void handleButtonChange(struct Gamepad_device * device, DWORD lastValue, DWORD value) {
|
||||
struct Gamepad_buttonEvent buttonEvent;
|
||||
unsigned int buttonIndex;
|
||||
|
||||
for (buttonIndex = 0; buttonIndex < device->numButtons; buttonIndex++) {
|
||||
if ((lastValue ^ value) & (1 << buttonIndex)) {
|
||||
buttonEvent.device = device;
|
||||
buttonEvent.timestamp = currentTime();
|
||||
buttonEvent.buttonID = buttonIndex;
|
||||
buttonEvent.down = !!(value & (1 << buttonIndex));
|
||||
|
||||
device->buttonStates[buttonIndex] = buttonEvent.down;
|
||||
device->eventDispatcher->dispatchEvent(device->eventDispatcher, buttonEvent.down ? GAMEPAD_EVENT_BUTTON_DOWN : GAMEPAD_EVENT_BUTTON_UP, &buttonEvent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void povToXY(DWORD pov, int * outX, int * outY) {
|
||||
if (pov == JOY_POVCENTERED) {
|
||||
*outX = *outY = 0;
|
||||
|
||||
} else {
|
||||
if (pov > JOY_POVFORWARD && pov < JOY_POVBACKWARD) {
|
||||
*outX = 1;
|
||||
|
||||
} else if (pov > JOY_POVBACKWARD) {
|
||||
*outX = -1;
|
||||
|
||||
} else {
|
||||
*outX = 0;
|
||||
}
|
||||
|
||||
if (pov > JOY_POVLEFT || pov < JOY_POVRIGHT) {
|
||||
*outY = -1;
|
||||
|
||||
} else if (pov > JOY_POVRIGHT && pov < JOY_POVLEFT) {
|
||||
*outY = 1;
|
||||
|
||||
} else {
|
||||
*outY = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void handlePOVChange(struct Gamepad_device * device, DWORD lastValue, DWORD value) {
|
||||
struct Gamepad_devicePrivate * devicePrivate;
|
||||
int lastX, lastY, newX, newY;
|
||||
struct Gamepad_axisEvent axisEvent;
|
||||
|
||||
devicePrivate = device->privateData;
|
||||
|
||||
if (devicePrivate->povXAxisIndex == -1 || devicePrivate->povYAxisIndex == -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
povToXY(lastValue, &lastX, &lastY);
|
||||
povToXY(value, &newX, &newY);
|
||||
|
||||
if (newX != lastX) {
|
||||
axisEvent.device = device;
|
||||
axisEvent.timestamp = currentTime();
|
||||
axisEvent.axisID = devicePrivate->povXAxisIndex;
|
||||
axisEvent.value = newX;
|
||||
|
||||
device->axisStates[devicePrivate->povXAxisIndex] = axisEvent.value;
|
||||
device->eventDispatcher->dispatchEvent(device->eventDispatcher, GAMEPAD_EVENT_AXIS_MOVED, &axisEvent);
|
||||
}
|
||||
if (newY != lastY) {
|
||||
axisEvent.device = device;
|
||||
axisEvent.timestamp = currentTime();
|
||||
axisEvent.axisID = devicePrivate->povYAxisIndex;
|
||||
axisEvent.value = newY;
|
||||
|
||||
device->axisStates[devicePrivate->povYAxisIndex] = axisEvent.value;
|
||||
device->eventDispatcher->dispatchEvent(device->eventDispatcher, GAMEPAD_EVENT_AXIS_MOVED, &axisEvent);
|
||||
}
|
||||
}
|
||||
|
||||
void Gamepad_processEvents() {
|
||||
unsigned int deviceIndex;
|
||||
JOYINFOEX info;
|
||||
MMRESULT result;
|
||||
struct Gamepad_device * device;
|
||||
struct Gamepad_devicePrivate * devicePrivate;
|
||||
|
||||
if (!inited) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (deviceIndex = 0; deviceIndex < numDevices; deviceIndex++) {
|
||||
device = devices[deviceIndex];
|
||||
devicePrivate = device->privateData;
|
||||
|
||||
info.dwSize = sizeof(info);
|
||||
info.dwFlags = JOY_RETURNALL;
|
||||
result = joyGetPosEx(devicePrivate->joystickID, &info);
|
||||
if (result == JOYERR_UNPLUGGED) {
|
||||
Gamepad_eventDispatcher()->dispatchEvent(Gamepad_eventDispatcher(), GAMEPAD_EVENT_DEVICE_REMOVED, device);
|
||||
|
||||
disposeDevice(device);
|
||||
numDevices--;
|
||||
for (; deviceIndex < numDevices; deviceIndex++) {
|
||||
devices[deviceIndex] = devices[deviceIndex + 1];
|
||||
}
|
||||
|
||||
} else if (result == JOYERR_NOERROR) {
|
||||
if (info.dwXpos != devicePrivate->lastState.dwXpos) {
|
||||
handleAxisChange(device, devicePrivate->xAxisIndex, info.dwXpos);
|
||||
}
|
||||
if (info.dwYpos != devicePrivate->lastState.dwYpos) {
|
||||
handleAxisChange(device, devicePrivate->yAxisIndex, info.dwYpos);
|
||||
}
|
||||
if (info.dwZpos != devicePrivate->lastState.dwZpos) {
|
||||
handleAxisChange(device, devicePrivate->zAxisIndex, info.dwZpos);
|
||||
}
|
||||
if (info.dwRpos != devicePrivate->lastState.dwRpos) {
|
||||
handleAxisChange(device, devicePrivate->rAxisIndex, info.dwRpos);
|
||||
}
|
||||
if (info.dwUpos != devicePrivate->lastState.dwUpos) {
|
||||
handleAxisChange(device, devicePrivate->uAxisIndex, info.dwUpos);
|
||||
}
|
||||
if (info.dwVpos != devicePrivate->lastState.dwVpos) {
|
||||
handleAxisChange(device, devicePrivate->vAxisIndex, info.dwVpos);
|
||||
}
|
||||
if (info.dwPOV != devicePrivate->lastState.dwPOV) {
|
||||
handlePOVChange(device, devicePrivate->lastState.dwPOV, info.dwPOV);
|
||||
}
|
||||
if (info.dwButtons != devicePrivate->lastState.dwButtons) {
|
||||
handleButtonChange(device, devicePrivate->lastState.dwButtons, info.dwButtons);
|
||||
}
|
||||
devicePrivate->lastState = info;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,122 @@
|
|||
/*
|
||||
Copyright (c) 2010 Alex Diener
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
Alex Diener adiener@sacredsoftware.net
|
||||
*/
|
||||
|
||||
#include "utilities/EventDispatcher.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
struct EventTarget {
|
||||
char * eventID;
|
||||
EventDispatcherCallback callback;
|
||||
void * context;
|
||||
};
|
||||
|
||||
EventDispatcher * EventDispatcher_create(void * owner) {
|
||||
EventDispatcher * self;
|
||||
|
||||
self = malloc(sizeof(EventDispatcher));
|
||||
EventDispatcher_init(self, owner);
|
||||
return self;
|
||||
}
|
||||
|
||||
void EventDispatcher_init(EventDispatcher * self, void * owner) {
|
||||
self->dispose = EventDispatcher_dispose;
|
||||
self->registerForEvent = EventDispatcher_registerForEvent;
|
||||
self->unregisterForEvent = EventDispatcher_unregisterForEvent;
|
||||
self->dispatchEvent = EventDispatcher_dispatchEvent;
|
||||
|
||||
self->owner = owner;
|
||||
self->numberOfTargets = 0;
|
||||
self->targetListSize = 1;
|
||||
self->targets = (struct EventTarget *) malloc(sizeof(struct EventTarget) * self->targetListSize);
|
||||
}
|
||||
|
||||
void EventDispatcher_dispose(void * selfPtr) {
|
||||
EventDispatcher * self = selfPtr;
|
||||
int targetIndex;
|
||||
|
||||
for (targetIndex = 0; targetIndex < self->numberOfTargets; targetIndex++) {
|
||||
free(self->targets[targetIndex].eventID);
|
||||
}
|
||||
free(self->targets);
|
||||
}
|
||||
|
||||
void EventDispatcher_registerForEvent(void * selfPtr, const char * eventID, EventDispatcherCallback callback, void * context) {
|
||||
EventDispatcher * self = selfPtr;
|
||||
size_t length;
|
||||
|
||||
if (self->numberOfTargets >= self->targetListSize) {
|
||||
self->targetListSize *= 2;
|
||||
self->targets = (struct EventTarget *) realloc(self->targets, sizeof(struct EventTarget) * self->targetListSize);
|
||||
}
|
||||
|
||||
length = strlen(eventID);
|
||||
self->targets[self->numberOfTargets].eventID = malloc(length + 1);
|
||||
strncpy(self->targets[self->numberOfTargets].eventID, eventID, length + 1);
|
||||
self->targets[self->numberOfTargets].callback = callback;
|
||||
self->targets[self->numberOfTargets].context = context;
|
||||
self->numberOfTargets++;
|
||||
}
|
||||
|
||||
void EventDispatcher_unregisterForEvent(void * selfPtr, const char * eventID, EventDispatcherCallback callback) {
|
||||
EventDispatcher * self = selfPtr;
|
||||
int targetIndex;
|
||||
|
||||
for (targetIndex = 0; targetIndex < self->numberOfTargets; targetIndex++) {
|
||||
if (!strcmp(eventID, self->targets[targetIndex].eventID) && self->targets[targetIndex].callback == callback) {
|
||||
free(self->targets[targetIndex].eventID);
|
||||
self->numberOfTargets--;
|
||||
for (; targetIndex < self->numberOfTargets; targetIndex++) {
|
||||
self->targets[targetIndex] = self->targets[targetIndex + 1];
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool EventDispatcher_dispatchEvent(void * selfPtr, const char * eventID, void * eventData) {
|
||||
EventDispatcher * self = selfPtr;
|
||||
int targetIndex;
|
||||
int numberOfTargetsCopy;
|
||||
struct EventTarget * targetsCopy;
|
||||
bool eventHandled, anyEventsHandled;
|
||||
|
||||
numberOfTargetsCopy = self->numberOfTargets;
|
||||
targetsCopy = malloc(sizeof(struct EventTarget) * numberOfTargetsCopy);
|
||||
memcpy(targetsCopy, self->targets, sizeof(struct EventTarget) * numberOfTargetsCopy);
|
||||
|
||||
anyEventsHandled = false;
|
||||
for (targetIndex = 0; targetIndex < numberOfTargetsCopy; targetIndex++) {
|
||||
if (!strcmp(eventID, self->targets[targetIndex].eventID)) {
|
||||
eventHandled = targetsCopy[targetIndex].callback(self->owner, eventID, eventData, targetsCopy[targetIndex].context);
|
||||
|
||||
if (eventHandled) {
|
||||
anyEventsHandled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
free(targetsCopy);
|
||||
|
||||
return anyEventsHandled;
|
||||
}
|
|
@ -0,0 +1,80 @@
|
|||
/*
|
||||
Copyright (c) 2010 Alex Diener
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
Alex Diener adiener@sacredsoftware.net
|
||||
*/
|
||||
|
||||
#ifndef __EVENT_DISPATCHER_H__
|
||||
#define __EVENT_DISPATCHER_H__
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
typedef struct EventDispatcher EventDispatcher;
|
||||
|
||||
/* Signature for event handler callbacks.
|
||||
|
||||
sender: Object that dispatched the event. More specifically, the object passed to EventDispatcher_create.
|
||||
eventID: Name of event that was triggered
|
||||
eventData: Arbitrary data passed by dispatcher. Its format is known by convention depending on the event ID being dispatched.
|
||||
context: Value passed as context to registerForEvent
|
||||
|
||||
This function should return true if the event was handled, or false if it was ignored. */
|
||||
typedef bool (* EventDispatcherCallback)(void * sender, const char * eventID, void * eventData, void * context);
|
||||
|
||||
struct EventTarget;
|
||||
|
||||
#define EventDispatcher_structContents \
|
||||
void * owner; \
|
||||
\
|
||||
int numberOfTargets; \
|
||||
int targetListSize; \
|
||||
struct EventTarget * targets; \
|
||||
\
|
||||
void (* dispose)(void * self); \
|
||||
void (* registerForEvent)(void * self, const char * eventID, EventDispatcherCallback callback, void * context); \
|
||||
void (* unregisterForEvent)(void * self, const char * eventID, EventDispatcherCallback callback); \
|
||||
bool (* dispatchEvent)(void * self, const char * eventID, void * eventData);
|
||||
|
||||
struct EventDispatcher {
|
||||
EventDispatcher_structContents
|
||||
};
|
||||
|
||||
/* Allocate and initialize a new EventDispatcher object. owner will be passed to event callbacks as
|
||||
the sender parameter. */
|
||||
EventDispatcher * EventDispatcher_create(void * owner);
|
||||
|
||||
/* Initialize an already allocated EventDispatcher. owner will be passed to event callbacks as the
|
||||
sender parameter. */
|
||||
void EventDispatcher_init(EventDispatcher * self, void * owner);
|
||||
|
||||
/* Free all memory allocated by EventDispatcher and remove all registered listeners. Does NOT free
|
||||
the EventDispatcher itself. */
|
||||
void EventDispatcher_dispose(void * selfPtr);
|
||||
|
||||
/* Register for notification of events of type eventID */
|
||||
void EventDispatcher_registerForEvent(void * selfPtr, const char * eventID, EventDispatcherCallback callback, void * context);
|
||||
|
||||
/* Remove a previous registration for events of type eventID */
|
||||
void EventDispatcher_unregisterForEvent(void * selfPtr, const char * eventID, EventDispatcherCallback callback);
|
||||
|
||||
/* Dispatch an event to all registered listeners for that event ID. Returns true if any listener is
|
||||
registered and returns true from its handler callback. */
|
||||
bool EventDispatcher_dispatchEvent(void * selfPtr, const char * eventID, void * eventData);
|
||||
|
||||
#endif
|
|
@ -0,0 +1,30 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>${PRODUCT_NAME} ${VERSION} Copyright © ${COPYRIGHT_YEAR} Alex Diener
|
||||
http://sacredsoftware.net/</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.sacredsoftware.${PRODUCT_NAME}</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>${PRODUCT_NAME} ${VERSION}</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © ${COPYRIGHT_YEAR} Alex Diener
|
||||
http://sacredsoftware.net/</string>
|
||||
</dict>
|
||||
</plist>
|
|
@ -0,0 +1,242 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include "gamepad/Gamepad.h"
|
||||
#include "shell/Shell.h"
|
||||
#include "shell/ShellKeyCodes.h"
|
||||
#include <string.h>
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <GLUT/glut.h>
|
||||
#include <OpenGL/gl.h>
|
||||
#else
|
||||
#include <GL/glut.h>
|
||||
#include <GL/gl.h>
|
||||
#endif
|
||||
|
||||
static bool verbose = false;
|
||||
|
||||
bool onButtonDown(void * sender, const char * eventID, void * eventData, void * context) {
|
||||
struct Gamepad_buttonEvent * event;
|
||||
|
||||
event = eventData;
|
||||
if (verbose) {
|
||||
printf("Button %u down (%d) on device %u at %f\n", event->buttonID, (int) event->down, event->device->deviceID, event->timestamp);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool onButtonUp(void * sender, const char * eventID, void * eventData, void * context) {
|
||||
struct Gamepad_buttonEvent * event;
|
||||
|
||||
event = eventData;
|
||||
if (verbose) {
|
||||
printf("Button %u up (%d) on device %u at %f\n", event->buttonID, (int) event->down, event->device->deviceID, event->timestamp);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool onAxisMoved(void * sender, const char * eventID, void * eventData, void * context) {
|
||||
struct Gamepad_axisEvent * event;
|
||||
|
||||
event = eventData;
|
||||
if (verbose) {
|
||||
printf("Axis %u moved to %f on device %u at %f\n", event->axisID, event->value, event->device->deviceID, event->timestamp);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool onDeviceAttached(void * sender, const char * eventID, void * eventData, void * context) {
|
||||
struct Gamepad_device * device;
|
||||
|
||||
device = eventData;
|
||||
if (verbose) {
|
||||
printf("Device ID %u attached (vendor = 0x%X; product = 0x%X)\n", device->deviceID, device->vendorID, device->productID);
|
||||
}
|
||||
device->eventDispatcher->registerForEvent(device->eventDispatcher, GAMEPAD_EVENT_BUTTON_DOWN, onButtonDown, device);
|
||||
device->eventDispatcher->registerForEvent(device->eventDispatcher, GAMEPAD_EVENT_BUTTON_UP, onButtonUp, device);
|
||||
device->eventDispatcher->registerForEvent(device->eventDispatcher, GAMEPAD_EVENT_AXIS_MOVED, onAxisMoved, device);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool onDeviceRemoved(void * sender, const char * eventID, void * eventData, void * context) {
|
||||
struct Gamepad_device * device;
|
||||
|
||||
device = eventData;
|
||||
if (verbose) {
|
||||
printf("Device ID %u removed\n", device->deviceID);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
const char * Target_getName() {
|
||||
return "Gamepad test harness";
|
||||
}
|
||||
|
||||
static unsigned int windowWidth = 800, windowHeight = 600;
|
||||
|
||||
static void initGamepad() {
|
||||
Gamepad_eventDispatcher()->registerForEvent(Gamepad_eventDispatcher(), GAMEPAD_EVENT_DEVICE_ATTACHED, onDeviceAttached, NULL);
|
||||
Gamepad_eventDispatcher()->registerForEvent(Gamepad_eventDispatcher(), GAMEPAD_EVENT_DEVICE_REMOVED, onDeviceRemoved, NULL);
|
||||
Gamepad_init();
|
||||
}
|
||||
|
||||
void Target_init(int argc, char ** argv) {
|
||||
int argIndex;
|
||||
|
||||
for (argIndex = 1; argIndex < argc; argIndex++) {
|
||||
if (!strcmp(argv[argIndex], "-v")) {
|
||||
verbose = true;
|
||||
}
|
||||
}
|
||||
|
||||
initGamepad();
|
||||
|
||||
glClearColor(1.0f, 1.0f, 1.0f, 0.0f);
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrtho(0.0f, windowWidth, windowHeight, 0.0f, -1.0f, 1.0f);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
|
||||
Shell_mainLoop();
|
||||
}
|
||||
|
||||
static void drawGlutString(int rasterPosX, int rasterPosY, const char * string) {
|
||||
size_t length, charIndex;
|
||||
|
||||
glRasterPos2i(rasterPosX, rasterPosY);
|
||||
length = strlen(string);
|
||||
for (charIndex = 0; charIndex < length; charIndex++) {
|
||||
glutBitmapCharacter(GLUT_BITMAP_8_BY_13, string[charIndex]);
|
||||
}
|
||||
}
|
||||
|
||||
#define POLL_ITERATION_INTERVAL 30
|
||||
|
||||
void Target_draw() {
|
||||
unsigned int gamepadIndex;
|
||||
struct Gamepad_device * device;
|
||||
unsigned int axesPerRow, buttonsPerRow;
|
||||
unsigned int axisRowIndex, axisIndex;
|
||||
unsigned int buttonRowIndex, buttonIndex;
|
||||
float axisState;
|
||||
char indexString[16];
|
||||
static unsigned int iterationsToNextPoll = POLL_ITERATION_INTERVAL;
|
||||
char descriptionString[256];
|
||||
|
||||
iterationsToNextPoll--;
|
||||
if (iterationsToNextPoll == 0) {
|
||||
Gamepad_detectDevices();
|
||||
iterationsToNextPoll = POLL_ITERATION_INTERVAL;
|
||||
}
|
||||
Gamepad_processEvents();
|
||||
|
||||
axesPerRow = (windowWidth - 10) / 60;
|
||||
buttonsPerRow = (windowWidth - 10) / 30;
|
||||
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
glLoadIdentity();
|
||||
glTranslatef(5.0f, 20.0f, 0.0f);
|
||||
for (gamepadIndex = 0; gamepadIndex < Gamepad_numDevices(); gamepadIndex++) {
|
||||
device = Gamepad_deviceAtIndex(gamepadIndex);
|
||||
|
||||
glColor3f(0.0f, 0.0f, 0.0f);
|
||||
snprintf(descriptionString, 256, "%s (0x%X 0x%X %u)", device->description, device->vendorID, device->productID, device->deviceID);
|
||||
drawGlutString(0, 0, descriptionString);
|
||||
|
||||
for (axisRowIndex = 0; axisRowIndex <= device->numAxes / axesPerRow; axisRowIndex++) {
|
||||
glPushMatrix();
|
||||
for (axisIndex = axisRowIndex * axesPerRow; axisIndex < (axisRowIndex + 1) * axesPerRow && axisIndex < device->numAxes; axisIndex++) {
|
||||
axisState = device->axisStates[axisIndex];
|
||||
|
||||
sprintf(indexString, "a%d", axisIndex);
|
||||
glColor3f(0.0f, 0.0f, 0.0f);
|
||||
drawGlutString(2, 28, indexString);
|
||||
|
||||
glBegin(GL_QUADS);
|
||||
glVertex2f(2.0f, 5.0f);
|
||||
glVertex2f(58.0f, 5.0f);
|
||||
glVertex2f(58.0f, 15.0f);
|
||||
glVertex2f(2.0f, 15.0f);
|
||||
glColor3f(0.5f, 1.0f, 0.5f);
|
||||
glVertex2f(29.0f + axisState * 26, 6.0f);
|
||||
glVertex2f(31.0f + axisState * 26, 6.0f);
|
||||
glVertex2f(31.0f + axisState * 26, 14.0f);
|
||||
glVertex2f(29.0f + axisState * 26, 14.0f);
|
||||
glEnd();
|
||||
glTranslatef(60.0f, 0.0f, 0.0f);
|
||||
}
|
||||
glPopMatrix();
|
||||
glTranslatef(0.0f, 32.0f, 0.0f);
|
||||
}
|
||||
|
||||
for (buttonRowIndex = 0; buttonRowIndex <= device->numButtons / buttonsPerRow; buttonRowIndex++) {
|
||||
glPushMatrix();
|
||||
for (buttonIndex = buttonRowIndex * buttonsPerRow; buttonIndex < (buttonRowIndex + 1) * buttonsPerRow && buttonIndex < device->numButtons; buttonIndex++) {
|
||||
sprintf(indexString, "b%d", buttonIndex);
|
||||
glColor3f(0.0f, 0.0f, 0.0f);
|
||||
drawGlutString(2, 32, indexString);
|
||||
|
||||
glBegin(GL_QUADS);
|
||||
glColor3f(0.0f, 0.0f, 0.0f);
|
||||
glVertex2f(2.0f, 2.0f);
|
||||
glVertex2f(28.0f, 2.0f);
|
||||
glVertex2f(28.0f, 18.0f);
|
||||
glVertex2f(2.0f, 18.0f);
|
||||
if (device->buttonStates[buttonIndex]) {
|
||||
glColor3f(0.5f, 1.0f, 0.5f);
|
||||
glVertex2f(3.0f, 3.0f);
|
||||
glVertex2f(27.0f, 3.0f);
|
||||
glVertex2f(27.0f, 17.0f);
|
||||
glVertex2f(3.0f, 17.0f);
|
||||
}
|
||||
glEnd();
|
||||
glTranslatef(30.0f, 0.0f, 0.0f);
|
||||
}
|
||||
glPopMatrix();
|
||||
glTranslatef(0.0f, 38.0f, 0.0f);
|
||||
}
|
||||
glTranslatef(0.0f, 40.0f, 0.0f);
|
||||
}
|
||||
|
||||
if (gamepadIndex == 0) {
|
||||
glLoadIdentity();
|
||||
glTranslatef(5.0f, 20.0f, 0.0f);
|
||||
glColor3f(0.0f, 0.0f, 0.0f);
|
||||
drawGlutString(0, 0, "No devices found; plug in a USB gamepad and it will be detected automatically");
|
||||
}
|
||||
|
||||
Shell_redisplay();
|
||||
}
|
||||
|
||||
void Target_keyDown(int charCode, int keyCode) {
|
||||
if (keyCode == KEYBOARD_R) {
|
||||
Gamepad_shutdown();
|
||||
initGamepad();
|
||||
}
|
||||
}
|
||||
|
||||
void Target_keyUp(int charCode, int keyCode) {
|
||||
}
|
||||
|
||||
void Target_mouseDown(int buttonNumber, float x, float y) {
|
||||
}
|
||||
|
||||
void Target_mouseUp(int buttonNumber, float x, float y) {
|
||||
}
|
||||
|
||||
void Target_mouseMoved(float x, float y) {
|
||||
}
|
||||
|
||||
void Target_mouseDragged(int buttonMask, float x, float y) {
|
||||
}
|
||||
|
||||
void Target_resized(int newWidth, int newHeight) {
|
||||
windowWidth = newWidth;
|
||||
windowHeight = newHeight;
|
||||
glViewport(0, 0, newWidth, newHeight);
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrtho(0.0f, windowWidth, windowHeight, 0.0f, -1.0f, 1.0f);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
#define _GNU_SOURCE
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#if defined(WIN32)
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include <dlfcn.h>
|
||||
#endif
|
||||
|
||||
#include "unittest/framework/TestSuite.h"
|
||||
|
||||
TestSuite ** getTestSuites() {
|
||||
static char * testFileNames[] = {SUITE_FILE_LIST};
|
||||
static TestSuite * testSuites[sizeof(testFileNames) / sizeof(char *)];
|
||||
char suiteFunctionName[256];
|
||||
unsigned int suiteIndex;
|
||||
struct TestSuite * (* suiteFunction)();
|
||||
#if defined(WIN32)
|
||||
HMODULE moduleHandle;
|
||||
|
||||
moduleHandle = GetModuleHandle(NULL);
|
||||
#endif
|
||||
|
||||
for (suiteIndex = 0; suiteIndex < sizeof(testFileNames) / sizeof(char *) - 1; suiteIndex++) {
|
||||
snprintf(suiteFunctionName, 256, "%s_suite", testFileNames[suiteIndex]);
|
||||
#if defined(WIN32)
|
||||
suiteFunction = (struct TestSuite * (*)()) GetProcAddress(moduleHandle, suiteFunctionName);
|
||||
#else
|
||||
suiteFunction = (struct TestSuite * (*)()) dlsym(RTLD_DEFAULT, suiteFunctionName);
|
||||
#endif
|
||||
if (suiteFunction == NULL) {
|
||||
fprintf(stderr, "Couldn't load test suite %s (no symbol named %s found)\n", testFileNames[suiteIndex], suiteFunctionName);
|
||||
abort();
|
||||
}
|
||||
testSuites[suiteIndex] = suiteFunction();
|
||||
}
|
||||
testSuites[suiteIndex] = NULL;
|
||||
|
||||
return testSuites;
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
#ifndef __TEST_SUITE_H__
|
||||
#define __TEST_SUITE_H__
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
typedef struct TestSuite TestSuite;
|
||||
|
||||
extern void (* g_unitTestFailureCallback)(const char * file, const char * function, int line, const char * format, ...) __attribute__((__noreturn__)) __attribute__((format(printf, 4, 5)));
|
||||
|
||||
struct TestSuite {
|
||||
char * description;
|
||||
unsigned int numberOfTestCases;
|
||||
void (** testCases)();
|
||||
};
|
||||
|
||||
#define TestCase_assert(condition, ...) \
|
||||
if (!(condition)) { \
|
||||
(*g_unitTestFailureCallback)(__FILE__, __FUNCTION__, __LINE__, __VA_ARGS__); \
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
#define DLLEXPORT __declspec(dllexport)
|
||||
#else
|
||||
#define DLLEXPORT
|
||||
#endif
|
||||
#define TEST_SUITE(name, ...) \
|
||||
DLLEXPORT TestSuite * name##_suite() { \
|
||||
return testSuite(#name, __VA_ARGS__, NULL); \
|
||||
}
|
||||
|
||||
static inline TestSuite * testSuite(const char * description, ...) __attribute__((sentinel));
|
||||
static inline TestSuite * testSuite(const char * description, ...) {
|
||||
TestSuite * suite;
|
||||
va_list args;
|
||||
unsigned int testCaseIndex;
|
||||
|
||||
suite = malloc(sizeof(TestSuite));
|
||||
|
||||
va_start(args, description);
|
||||
for (suite->numberOfTestCases = 0; va_arg(args, void (*)()) != NULL; suite->numberOfTestCases++);
|
||||
va_end(args);
|
||||
|
||||
suite->description = malloc(strlen(description) + 1);
|
||||
strcpy(suite->description, description);
|
||||
suite->testCases = malloc(sizeof(void (*)()) * suite->numberOfTestCases);
|
||||
va_start(args, description);
|
||||
for (testCaseIndex = 0; testCaseIndex < suite->numberOfTestCases; testCaseIndex++) {
|
||||
suite->testCases[testCaseIndex] = va_arg(args, void (*)());
|
||||
}
|
||||
va_end(args);
|
||||
|
||||
return suite;
|
||||
}
|
||||
|
||||
#endif
|
|
@ -0,0 +1,84 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <setjmp.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "unittest/framework/TestSuite.h"
|
||||
|
||||
extern TestSuite ** getTestSuites();
|
||||
|
||||
void (* g_unitTestFailureCallback)(const char * file, const char * function, int line, const char * format, ...) __attribute__((__noreturn__)) __attribute__((format(printf, 4, 5)));
|
||||
|
||||
static int failures = 0;
|
||||
static jmp_buf jmpEnv;
|
||||
|
||||
static int lengthOfSharedPrefix(const char * string1, const char * string2) {
|
||||
int charIndex;
|
||||
|
||||
for (charIndex = 0; string1[charIndex] != '\x00' && string2[charIndex] != '\x00'; charIndex++) {
|
||||
if (string1[charIndex] != string2[charIndex]) break;
|
||||
}
|
||||
return charIndex;
|
||||
}
|
||||
|
||||
static void assertFailureCallback(const char * file, const char * function, int line, const char * format, ...) __attribute__((__noreturn__)) __attribute__((format(printf, 4, 5)));
|
||||
static void assertFailureCallback(const char * file, const char * function, int line, const char * format, ...) {
|
||||
va_list args;
|
||||
static char * sourceRoot = NULL;
|
||||
|
||||
if (sourceRoot == NULL) {
|
||||
int charIndex;
|
||||
int length;
|
||||
|
||||
length = strlen(__FILE__);
|
||||
sourceRoot = malloc(length + 1);
|
||||
strcpy(sourceRoot, __FILE__);
|
||||
for (charIndex = 0; charIndex < length; charIndex++) {
|
||||
if (!strcmp(sourceRoot + charIndex, "unittest/unittest_main.c")) {
|
||||
sourceRoot[charIndex] = '\x00';
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
file += lengthOfSharedPrefix(sourceRoot, file);
|
||||
printf(" FAILURE in %s (%s:%d):\n ", function, file, line);
|
||||
va_start(args, format);
|
||||
vprintf(format, args);
|
||||
va_end(args);
|
||||
putchar('\n');
|
||||
|
||||
failures++;
|
||||
longjmp(jmpEnv, 1);
|
||||
}
|
||||
|
||||
int main(int argc, char ** argv) {
|
||||
TestSuite ** testSuites;
|
||||
unsigned int numberOfTestSuites;
|
||||
unsigned int testSuiteIndex, testCaseIndex;
|
||||
|
||||
if (argc > 1) {
|
||||
chdir(argv[1]);
|
||||
}
|
||||
|
||||
g_unitTestFailureCallback = assertFailureCallback;
|
||||
|
||||
testSuites = getTestSuites();
|
||||
for (numberOfTestSuites = 0; testSuites[numberOfTestSuites] != NULL; numberOfTestSuites++);
|
||||
|
||||
putchar('\n');
|
||||
for (testSuiteIndex = 0; testSuiteIndex < numberOfTestSuites; testSuiteIndex++) {
|
||||
printf("%s (%d/%d) running %d test%s...\n", testSuites[testSuiteIndex]->description, testSuiteIndex + 1, numberOfTestSuites, testSuites[testSuiteIndex]->numberOfTestCases, testSuites[testSuiteIndex]->numberOfTestCases == 1 ? "" : "s");
|
||||
for (testCaseIndex = 0; testCaseIndex < testSuites[testSuiteIndex]->numberOfTestCases; testCaseIndex++) {
|
||||
if (setjmp(jmpEnv) != 0) {
|
||||
continue;
|
||||
}
|
||||
testSuites[testSuiteIndex]->testCases[testCaseIndex]();
|
||||
}
|
||||
}
|
||||
printf("\nTests completed (%d failure%s)\n\n", failures, failures == 1 ? "" : "s");
|
||||
|
||||
return failures ? EXIT_FAILURE : EXIT_SUCCESS;
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
#include "unittest/framework/TestSuite.h"
|
||||
|
||||
static void blank() {
|
||||
// No tests
|
||||
}
|
||||
|
||||
TEST_SUITE(GamepadTest, blank)
|
|
@ -0,0 +1,3 @@
|
|||
VERSION_MAJOR=1
|
||||
VERSION_MINOR=1
|
||||
VERSION_TWEAK=0
|
299
internal/c/parts/input/game_controller/src.c
Normal file
299
internal/c/parts/input/game_controller/src.c
Normal file
|
@ -0,0 +1,299 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "../../../os.h"
|
||||
|
||||
#ifdef QB64_MACOSX
|
||||
#include <GLUT/glut.h>
|
||||
#include <OpenGL/gl.h>
|
||||
#else
|
||||
#include <GL/glut.h>
|
||||
#include <GL/gl.h>
|
||||
#endif
|
||||
|
||||
#ifdef QB64_WINDOWS
|
||||
#include "src/Gamepad_windows.c"
|
||||
#else
|
||||
#ifdef QB64_MACOSX
|
||||
#include "src/Gamepad_macosx.c"
|
||||
#else
|
||||
//assume LINUX
|
||||
#include "src/Gamepad_linux.c"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* these shouldn't be necessary
|
||||
#include "src/shell/Shell.h"
|
||||
#include "src/shell/ShellKeyCodes.h"
|
||||
*/
|
||||
|
||||
static int verbose = 1; //whether printf prints out information about events
|
||||
|
||||
//"It appears to define some callbacks here"
|
||||
|
||||
bool onButtonDown(void * sender, const char * eventID, void * eventData, void * context) {
|
||||
struct Gamepad_buttonEvent * event;
|
||||
|
||||
event = eventData;
|
||||
if (verbose) {
|
||||
printf("Button %u down (%d) on device %u at %f\n", event->buttonID, (int) event->down, event->device->deviceID, event->timestamp);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool onButtonUp(void * sender, const char * eventID, void * eventData, void * context) {
|
||||
struct Gamepad_buttonEvent * event;
|
||||
|
||||
event = eventData;
|
||||
if (verbose) {
|
||||
printf("Button %u up (%d) on device %u at %f\n", event->buttonID, (int) event->down, event->device->deviceID, event->timestamp);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool onAxisMoved(void * sender, const char * eventID, void * eventData, void * context) {
|
||||
struct Gamepad_axisEvent * event;
|
||||
|
||||
event = eventData;
|
||||
if (verbose) {
|
||||
printf("Axis %u moved to %f on device %u at %f\n", event->axisID, event->value, event->device->deviceID, event->timestamp);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool onDeviceAttached(void * sender, const char * eventID, void * eventData, void * context) {
|
||||
struct Gamepad_device * device;
|
||||
|
||||
device = eventData;
|
||||
if (verbose) {
|
||||
printf("Device ID %u attached (vendor = 0x%X; product = 0x%X)\n", device->deviceID, device->vendorID, device->productID);
|
||||
}
|
||||
device->eventDispatcher->registerForEvent(device->eventDispatcher, GAMEPAD_EVENT_BUTTON_DOWN, onButtonDown, device);
|
||||
device->eventDispatcher->registerForEvent(device->eventDispatcher, GAMEPAD_EVENT_BUTTON_UP, onButtonUp, device);
|
||||
device->eventDispatcher->registerForEvent(device->eventDispatcher, GAMEPAD_EVENT_AXIS_MOVED, onAxisMoved, device);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool onDeviceRemoved(void * sender, const char * eventID, void * eventData, void * context) {
|
||||
struct Gamepad_device * device;
|
||||
|
||||
device = eventData;
|
||||
if (verbose) {
|
||||
printf("Device ID %u removed\n", device->deviceID);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
const char * Target_getName() {
|
||||
return "Gamepad test harness";
|
||||
}
|
||||
|
||||
//"initialization code is here, in its own function..."
|
||||
static void initGamepad() {
|
||||
Gamepad_eventDispatcher()->registerForEvent(Gamepad_eventDispatcher(), GAMEPAD_EVENT_DEVICE_ATTACHED, onDeviceAttached, NULL);
|
||||
Gamepad_eventDispatcher()->registerForEvent(Gamepad_eventDispatcher(), GAMEPAD_EVENT_DEVICE_REMOVED, onDeviceRemoved, NULL);
|
||||
Gamepad_init();
|
||||
}
|
||||
|
||||
|
||||
void QB64_GameControllerInit(){
|
||||
initGamepad();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//----------------------EVERYTHING PAST HERE IS FLUFF ----------------------------
|
||||
// (and has been commented out!)
|
||||
/*
|
||||
|
||||
//"OMG wtf is this function????? some kind of glutty, shelly thing-a-me-bob"
|
||||
static unsigned int windowWidth = 800, windowHeight = 600;
|
||||
|
||||
void Target_init(int argc, char ** argv) {
|
||||
int argIndex;
|
||||
|
||||
for (argIndex = 1; argIndex < argc; argIndex++) {
|
||||
if (!strcmp(argv[argIndex], "-v")) {
|
||||
verbose = true;
|
||||
}
|
||||
}
|
||||
|
||||
initGamepad();
|
||||
|
||||
glClearColor(1.0f, 1.0f, 1.0f, 0.0f);
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrtho(0.0f, windowWidth, windowHeight, 0.0f, -1.0f, 1.0f);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
|
||||
Shell_mainLoop();
|
||||
}
|
||||
|
||||
//"why is this even here?"
|
||||
static void drawGlutString(int rasterPosX, int rasterPosY, const char * string) {
|
||||
size_t length, charIndex;
|
||||
|
||||
glRasterPos2i(rasterPosX, rasterPosY);
|
||||
length = strlen(string);
|
||||
for (charIndex = 0; charIndex < length; charIndex++) {
|
||||
glutBitmapCharacter(GLUT_BITMAP_8_BY_13, string[charIndex]);
|
||||
}
|
||||
}
|
||||
|
||||
#define POLL_ITERATION_INTERVAL 30
|
||||
|
||||
void Target_draw() {
|
||||
unsigned int gamepadIndex;
|
||||
struct Gamepad_device * device;
|
||||
unsigned int axesPerRow, buttonsPerRow;
|
||||
unsigned int axisRowIndex, axisIndex;
|
||||
unsigned int buttonRowIndex, buttonIndex;
|
||||
float axisState;
|
||||
char indexString[16];
|
||||
static unsigned int iterationsToNextPoll = POLL_ITERATION_INTERVAL;
|
||||
char descriptionString[256];
|
||||
|
||||
iterationsToNextPoll--;
|
||||
if (iterationsToNextPoll == 0) {
|
||||
Gamepad_detectDevices();
|
||||
iterationsToNextPoll = POLL_ITERATION_INTERVAL;
|
||||
}
|
||||
Gamepad_processEvents();
|
||||
|
||||
axesPerRow = (windowWidth - 10) / 60;
|
||||
buttonsPerRow = (windowWidth - 10) / 30;
|
||||
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
glLoadIdentity();
|
||||
glTranslatef(5.0f, 20.0f, 0.0f);
|
||||
for (gamepadIndex = 0; gamepadIndex < Gamepad_numDevices(); gamepadIndex++) {
|
||||
device = Gamepad_deviceAtIndex(gamepadIndex);
|
||||
|
||||
glColor3f(0.0f, 0.0f, 0.0f);
|
||||
snprintf(descriptionString, 256, "%s (0x%X 0x%X %u)", device->description, device->vendorID, device->productID, device->deviceID);
|
||||
drawGlutString(0, 0, descriptionString);
|
||||
|
||||
for (axisRowIndex = 0; axisRowIndex <= device->numAxes / axesPerRow; axisRowIndex++) {
|
||||
glPushMatrix();
|
||||
for (axisIndex = axisRowIndex * axesPerRow; axisIndex < (axisRowIndex + 1) * axesPerRow && axisIndex < device->numAxes; axisIndex++) {
|
||||
axisState = device->axisStates[axisIndex];
|
||||
|
||||
sprintf(indexString, "a%d", axisIndex);
|
||||
glColor3f(0.0f, 0.0f, 0.0f);
|
||||
drawGlutString(2, 28, indexString);
|
||||
|
||||
glBegin(GL_QUADS);
|
||||
glVertex2f(2.0f, 5.0f);
|
||||
glVertex2f(58.0f, 5.0f);
|
||||
glVertex2f(58.0f, 15.0f);
|
||||
glVertex2f(2.0f, 15.0f);
|
||||
glColor3f(0.5f, 1.0f, 0.5f);
|
||||
glVertex2f(29.0f + axisState * 26, 6.0f);
|
||||
glVertex2f(31.0f + axisState * 26, 6.0f);
|
||||
glVertex2f(31.0f + axisState * 26, 14.0f);
|
||||
glVertex2f(29.0f + axisState * 26, 14.0f);
|
||||
glEnd();
|
||||
glTranslatef(60.0f, 0.0f, 0.0f);
|
||||
}
|
||||
glPopMatrix();
|
||||
glTranslatef(0.0f, 32.0f, 0.0f);
|
||||
}
|
||||
|
||||
for (buttonRowIndex = 0; buttonRowIndex <= device->numButtons / buttonsPerRow; buttonRowIndex++) {
|
||||
glPushMatrix();
|
||||
for (buttonIndex = buttonRowIndex * buttonsPerRow; buttonIndex < (buttonRowIndex + 1) * buttonsPerRow && buttonIndex < device->numButtons; buttonIndex++) {
|
||||
sprintf(indexString, "b%d", buttonIndex);
|
||||
glColor3f(0.0f, 0.0f, 0.0f);
|
||||
drawGlutString(2, 32, indexString);
|
||||
|
||||
glBegin(GL_QUADS);
|
||||
glColor3f(0.0f, 0.0f, 0.0f);
|
||||
glVertex2f(2.0f, 2.0f);
|
||||
glVertex2f(28.0f, 2.0f);
|
||||
glVertex2f(28.0f, 18.0f);
|
||||
glVertex2f(2.0f, 18.0f);
|
||||
if (device->buttonStates[buttonIndex]) {
|
||||
glColor3f(0.5f, 1.0f, 0.5f);
|
||||
glVertex2f(3.0f, 3.0f);
|
||||
glVertex2f(27.0f, 3.0f);
|
||||
glVertex2f(27.0f, 17.0f);
|
||||
glVertex2f(3.0f, 17.0f);
|
||||
}
|
||||
glEnd();
|
||||
glTranslatef(30.0f, 0.0f, 0.0f);
|
||||
}
|
||||
glPopMatrix();
|
||||
glTranslatef(0.0f, 38.0f, 0.0f);
|
||||
}
|
||||
glTranslatef(0.0f, 40.0f, 0.0f);
|
||||
}
|
||||
|
||||
if (gamepadIndex == 0) {
|
||||
glLoadIdentity();
|
||||
glTranslatef(5.0f, 20.0f, 0.0f);
|
||||
glColor3f(0.0f, 0.0f, 0.0f);
|
||||
drawGlutString(0, 0, "No devices found; plug in a USB gamepad and it will be detected automatically");
|
||||
}
|
||||
|
||||
Shell_redisplay();
|
||||
}
|
||||
|
||||
void Target_keyDown(int charCode, int keyCode) {
|
||||
if (keyCode == KEYBOARD_R) {
|
||||
Gamepad_shutdown();
|
||||
initGamepad();
|
||||
}
|
||||
}
|
||||
|
||||
void Target_keyUp(int charCode, int keyCode) {
|
||||
}
|
||||
|
||||
void Target_mouseDown(int buttonNumber, float x, float y) {
|
||||
}
|
||||
|
||||
void Target_mouseUp(int buttonNumber, float x, float y) {
|
||||
}
|
||||
|
||||
void Target_mouseMoved(float x, float y) {
|
||||
}
|
||||
|
||||
void Target_mouseDragged(int buttonMask, float x, float y) {
|
||||
}
|
||||
|
||||
void Target_resized(int newWidth, int newHeight) {
|
||||
windowWidth = newWidth;
|
||||
windowHeight = newHeight;
|
||||
glViewport(0, 0, newWidth, newHeight);
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrtho(0.0f, windowWidth, windowHeight, 0.0f, -1.0f, 1.0f);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
}
|
||||
*/
|
440
internal/c/parts/input/game_controller/src/Gamepad_linux.c
Normal file
440
internal/c/parts/input/game_controller/src/Gamepad_linux.c
Normal file
|
@ -0,0 +1,440 @@
|
|||
/*
|
||||
Copyright (c) 2010 Alex Diener
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
Alex Diener adiener@sacredsoftware.net
|
||||
*/
|
||||
|
||||
#include "gamepad/Gamepad.h"
|
||||
#include <dirent.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <limits.h>
|
||||
#include <linux/input.h>
|
||||
#include <pthread.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
struct Gamepad_devicePrivate {
|
||||
pthread_t thread;
|
||||
int fd;
|
||||
char * path;
|
||||
int buttonMap[KEY_CNT - BTN_MISC];
|
||||
int axisMap[ABS_CNT];
|
||||
struct input_absinfo axisInfo[ABS_CNT];
|
||||
};
|
||||
|
||||
struct Gamepad_queuedEvent {
|
||||
EventDispatcher * dispatcher;
|
||||
const char * eventType;
|
||||
void * eventData;
|
||||
};
|
||||
|
||||
static struct Gamepad_device ** devices = NULL;
|
||||
static unsigned int numDevices = 0;
|
||||
static unsigned int nextDeviceID = 0;
|
||||
static pthread_mutex_t devicesMutex;
|
||||
|
||||
static struct Gamepad_queuedEvent * eventQueue = NULL;
|
||||
static size_t eventQueueSize = 0;
|
||||
static size_t eventCount = 0;
|
||||
static pthread_mutex_t eventQueueMutex;
|
||||
|
||||
static EventDispatcher * eventDispatcher = NULL;
|
||||
static bool inited = false;
|
||||
|
||||
#define test_bit(bitIndex, array) \
|
||||
((array[(bitIndex) / (sizeof(int) * 8)] >> ((bitIndex) % (sizeof(int) * 8))) & 0x1)
|
||||
|
||||
static char ** findGamepadPaths(unsigned int * outNumGamepads) {
|
||||
DIR * dev_input;
|
||||
struct dirent * entity;
|
||||
unsigned int numGamepads = 0;
|
||||
char ** gamepadDevs = NULL;
|
||||
unsigned int charsConsumed;
|
||||
int num;
|
||||
int fd;
|
||||
int evCapBits[(EV_CNT - 1) / sizeof(int) * 8 + 1];
|
||||
int evKeyBits[(KEY_CNT - 1) / sizeof(int) * 8 + 1];
|
||||
int evAbsBits[(ABS_CNT - 1) / sizeof(int) * 8 + 1];
|
||||
char fileName[PATH_MAX];
|
||||
|
||||
dev_input = opendir("/dev/input");
|
||||
if (dev_input != NULL) {
|
||||
for (entity = readdir(dev_input); entity != NULL; entity = readdir(dev_input)) {
|
||||
charsConsumed = 0;
|
||||
if (sscanf(entity->d_name, "event%d%n", &num, &charsConsumed) && charsConsumed == strlen(entity->d_name)) {
|
||||
snprintf(fileName, PATH_MAX, "/dev/input/%s", entity->d_name);
|
||||
fd = open(fileName, O_RDONLY, 0);
|
||||
memset(evCapBits, 0, sizeof(evCapBits));
|
||||
memset(evKeyBits, 0, sizeof(evKeyBits));
|
||||
memset(evAbsBits, 0, sizeof(evAbsBits));
|
||||
if (ioctl(fd, EVIOCGBIT(0, sizeof(evCapBits)), evCapBits) < 0 ||
|
||||
ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(evKeyBits)), evKeyBits) < 0 ||
|
||||
ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(evAbsBits)), evAbsBits) < 0) {
|
||||
close(fd);
|
||||
continue;
|
||||
}
|
||||
if (!test_bit(EV_KEY, evCapBits) || !test_bit(EV_ABS, evCapBits) ||
|
||||
!test_bit(ABS_X, evAbsBits) || !test_bit(ABS_Y, evAbsBits) ||
|
||||
(!test_bit(BTN_TRIGGER, evKeyBits) && !test_bit(BTN_A, evKeyBits) && !test_bit(BTN_1, evKeyBits))) {
|
||||
close(fd);
|
||||
continue;
|
||||
}
|
||||
close(fd);
|
||||
|
||||
numGamepads++;
|
||||
gamepadDevs = realloc(gamepadDevs, sizeof(char *) * numGamepads);
|
||||
gamepadDevs[numGamepads - 1] = malloc(strlen(fileName) + 1);
|
||||
strcpy(gamepadDevs[numGamepads - 1], fileName);
|
||||
}
|
||||
}
|
||||
closedir(dev_input);
|
||||
}
|
||||
|
||||
*outNumGamepads = numGamepads;
|
||||
return gamepadDevs;
|
||||
}
|
||||
|
||||
void Gamepad_init() {
|
||||
if (!inited) {
|
||||
pthread_mutex_init(&devicesMutex, NULL);
|
||||
pthread_mutex_init(&eventQueueMutex, NULL);
|
||||
inited = true;
|
||||
Gamepad_detectDevices();
|
||||
}
|
||||
}
|
||||
|
||||
static void disposeDevice(struct Gamepad_device * device) {
|
||||
device->eventDispatcher->dispose(device->eventDispatcher);
|
||||
|
||||
close(((struct Gamepad_devicePrivate *) device->privateData)->fd);
|
||||
free(((struct Gamepad_devicePrivate *) device->privateData)->path);
|
||||
free(device->privateData);
|
||||
|
||||
free((void *) device->description);
|
||||
free(device->axisStates);
|
||||
free(device->buttonStates);
|
||||
free(device->eventDispatcher);
|
||||
|
||||
free(device);
|
||||
}
|
||||
|
||||
void Gamepad_shutdown() {
|
||||
if (inited) {
|
||||
unsigned int eventIndex;
|
||||
unsigned int devicesLeft;
|
||||
unsigned int gamepadIndex;
|
||||
|
||||
do {
|
||||
pthread_mutex_lock(&devicesMutex);
|
||||
devicesLeft = numDevices;
|
||||
if (devicesLeft > 0) {
|
||||
pthread_t thread;
|
||||
|
||||
thread = ((struct Gamepad_devicePrivate *) devices[0]->privateData)->thread;
|
||||
pthread_cancel(thread);
|
||||
pthread_join(thread, NULL);
|
||||
|
||||
numDevices--;
|
||||
for (gamepadIndex = 0; gamepadIndex < numDevices; gamepadIndex++) {
|
||||
devices[gamepadIndex] = devices[gamepadIndex + 1];
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&devicesMutex);
|
||||
} while (devicesLeft > 0);
|
||||
|
||||
pthread_mutex_destroy(&devicesMutex);
|
||||
pthread_mutex_destroy(&eventQueueMutex);
|
||||
free(devices);
|
||||
devices = NULL;
|
||||
|
||||
for (eventIndex = 0; eventIndex < eventCount; eventIndex++) {
|
||||
if (!strcmp(eventQueue[eventIndex].eventType, GAMEPAD_EVENT_DEVICE_REMOVED)) {
|
||||
disposeDevice(eventQueue[eventIndex].eventData);
|
||||
}
|
||||
}
|
||||
|
||||
eventQueueSize = 0;
|
||||
eventCount = 0;
|
||||
free(eventQueue);
|
||||
eventQueue = NULL;
|
||||
|
||||
if (eventDispatcher != NULL) {
|
||||
eventDispatcher->dispose(eventDispatcher);
|
||||
free(eventDispatcher);
|
||||
eventDispatcher = NULL;
|
||||
}
|
||||
|
||||
inited = false;
|
||||
}
|
||||
}
|
||||
|
||||
EventDispatcher * Gamepad_eventDispatcher() {
|
||||
if (eventDispatcher == NULL) {
|
||||
eventDispatcher = EventDispatcher_create(NULL);
|
||||
}
|
||||
return eventDispatcher;
|
||||
}
|
||||
|
||||
unsigned int Gamepad_numDevices() {
|
||||
unsigned int result;
|
||||
|
||||
pthread_mutex_lock(&devicesMutex);
|
||||
result = numDevices;
|
||||
pthread_mutex_unlock(&devicesMutex);
|
||||
return result;
|
||||
}
|
||||
|
||||
struct Gamepad_device * Gamepad_deviceAtIndex(unsigned int deviceIndex) {
|
||||
struct Gamepad_device * result;
|
||||
|
||||
pthread_mutex_lock(&devicesMutex);
|
||||
if (deviceIndex >= numDevices) {
|
||||
result = NULL;
|
||||
} else {
|
||||
result = devices[deviceIndex];
|
||||
}
|
||||
pthread_mutex_unlock(&devicesMutex);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static void queueEvent(EventDispatcher * dispatcher, const char * eventType, void * eventData) {
|
||||
struct Gamepad_queuedEvent queuedEvent;
|
||||
|
||||
queuedEvent.dispatcher = dispatcher;
|
||||
queuedEvent.eventType = eventType;
|
||||
queuedEvent.eventData = eventData;
|
||||
|
||||
pthread_mutex_lock(&eventQueueMutex);
|
||||
if (eventCount >= eventQueueSize) {
|
||||
eventQueueSize = eventQueueSize == 0 ? 1 : eventQueueSize * 2;
|
||||
eventQueue = realloc(eventQueue, sizeof(struct Gamepad_queuedEvent) * eventQueueSize);
|
||||
}
|
||||
eventQueue[eventCount++] = queuedEvent;
|
||||
pthread_mutex_unlock(&eventQueueMutex);
|
||||
}
|
||||
|
||||
static void queueAxisEvent(struct Gamepad_device * device, double timestamp, unsigned int axisID, float value) {
|
||||
struct Gamepad_axisEvent * axisEvent;
|
||||
|
||||
axisEvent = malloc(sizeof(struct Gamepad_axisEvent));
|
||||
axisEvent->device = device;
|
||||
axisEvent->timestamp = timestamp;
|
||||
axisEvent->axisID = axisID;
|
||||
axisEvent->value = value;
|
||||
|
||||
queueEvent(device->eventDispatcher, GAMEPAD_EVENT_AXIS_MOVED, axisEvent);
|
||||
}
|
||||
|
||||
static void queueButtonEvent(struct Gamepad_device * device, double timestamp, unsigned int buttonID, bool down) {
|
||||
struct Gamepad_buttonEvent * buttonEvent;
|
||||
|
||||
buttonEvent = malloc(sizeof(struct Gamepad_buttonEvent));
|
||||
buttonEvent->device = device;
|
||||
buttonEvent->timestamp = timestamp;
|
||||
buttonEvent->buttonID = buttonID;
|
||||
buttonEvent->down = down;
|
||||
|
||||
queueEvent(device->eventDispatcher, down ? GAMEPAD_EVENT_BUTTON_DOWN : GAMEPAD_EVENT_BUTTON_UP, buttonEvent);
|
||||
}
|
||||
|
||||
static void * deviceThread(void * context) {
|
||||
unsigned int gamepadIndex;
|
||||
struct Gamepad_device * device;
|
||||
struct Gamepad_devicePrivate * devicePrivate;
|
||||
struct input_event event;
|
||||
|
||||
device = context;
|
||||
devicePrivate = device->privateData;
|
||||
|
||||
while (read(devicePrivate->fd, &event, sizeof(struct input_event)) > 0) {
|
||||
if (event.type == EV_ABS) {
|
||||
float value;
|
||||
|
||||
if (event.code > ABS_MAX || devicePrivate->axisMap[event.code] == -1) {
|
||||
continue;
|
||||
}
|
||||
|
||||
value = (event.value - devicePrivate->axisInfo[event.code].minimum) / (float) (devicePrivate->axisInfo[event.code].maximum - devicePrivate->axisInfo[event.code].minimum) * 2.0f - 1.0f;
|
||||
queueAxisEvent(device,
|
||||
event.time.tv_sec + event.time.tv_usec * 0.000001,
|
||||
devicePrivate->axisMap[event.code],
|
||||
value);
|
||||
|
||||
device->axisStates[devicePrivate->axisMap[event.code]] = value;
|
||||
|
||||
} else if (event.type == EV_KEY) {
|
||||
if (event.code < BTN_MISC || event.code > KEY_MAX || devicePrivate->buttonMap[event.code - BTN_MISC] == -1) {
|
||||
continue;
|
||||
}
|
||||
|
||||
queueButtonEvent(device,
|
||||
event.time.tv_sec + event.time.tv_usec * 0.000001,
|
||||
devicePrivate->buttonMap[event.code - BTN_MISC],
|
||||
!!event.value);
|
||||
|
||||
device->buttonStates[devicePrivate->buttonMap[event.code - BTN_MISC]] = !!event.value;
|
||||
}
|
||||
}
|
||||
|
||||
queueEvent(eventDispatcher, GAMEPAD_EVENT_DEVICE_REMOVED, device);
|
||||
|
||||
pthread_mutex_lock(&devicesMutex);
|
||||
for (gamepadIndex = 0; gamepadIndex < numDevices; gamepadIndex++) {
|
||||
if (devices[gamepadIndex] == device) {
|
||||
unsigned int gamepadIndex2;
|
||||
|
||||
numDevices--;
|
||||
for (gamepadIndex2 = gamepadIndex; gamepadIndex2 < numDevices; gamepadIndex2++) {
|
||||
devices[gamepadIndex2] = devices[gamepadIndex2 + 1];
|
||||
}
|
||||
gamepadIndex--;
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&devicesMutex);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void Gamepad_detectDevices() {
|
||||
unsigned int numPaths;
|
||||
char ** gamepadPaths;
|
||||
bool duplicate;
|
||||
unsigned int pathIndex, gamepadIndex;
|
||||
struct stat statBuf;
|
||||
struct Gamepad_device * deviceRecord;
|
||||
struct Gamepad_devicePrivate * deviceRecordPrivate;
|
||||
int fd;
|
||||
char name[128];
|
||||
char * description;
|
||||
int evKeyBits[(KEY_CNT - 1) / sizeof(int) * 8 + 1];
|
||||
int evAbsBits[(ABS_CNT - 1) / sizeof(int) * 8 + 1];
|
||||
int bit;
|
||||
struct input_id id;
|
||||
|
||||
if (!inited) {
|
||||
return;
|
||||
}
|
||||
|
||||
gamepadPaths = findGamepadPaths(&numPaths);
|
||||
|
||||
pthread_mutex_lock(&devicesMutex);
|
||||
for (pathIndex = 0; pathIndex < numPaths; pathIndex++) {
|
||||
duplicate = false;
|
||||
for (gamepadIndex = 0; gamepadIndex < numDevices; gamepadIndex++) {
|
||||
if (!strcmp(((struct Gamepad_devicePrivate *) devices[gamepadIndex]->privateData)->path, gamepadPaths[pathIndex])) {
|
||||
duplicate = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (duplicate) {
|
||||
free(gamepadPaths[pathIndex]);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!stat(gamepadPaths[pathIndex], &statBuf)) {
|
||||
deviceRecord = malloc(sizeof(struct Gamepad_device));
|
||||
deviceRecord->deviceID = nextDeviceID++;
|
||||
deviceRecord->eventDispatcher = EventDispatcher_create(deviceRecord);
|
||||
devices = realloc(devices, sizeof(struct Gamepad_device *) * (numDevices + 1));
|
||||
devices[numDevices++] = deviceRecord;
|
||||
|
||||
fd = open(gamepadPaths[pathIndex], O_RDONLY, 0);
|
||||
|
||||
deviceRecordPrivate = malloc(sizeof(struct Gamepad_devicePrivate));
|
||||
deviceRecordPrivate->fd = fd;
|
||||
deviceRecordPrivate->path = gamepadPaths[pathIndex];
|
||||
memset(deviceRecordPrivate->buttonMap, 0xFF, sizeof(deviceRecordPrivate->buttonMap));
|
||||
memset(deviceRecordPrivate->axisMap, 0xFF, sizeof(deviceRecordPrivate->axisMap));
|
||||
deviceRecord->privateData = deviceRecordPrivate;
|
||||
|
||||
if (ioctl(fd, EVIOCGNAME(sizeof(name)), name) > 0) {
|
||||
description = malloc(strlen(name + 1));
|
||||
strcpy(description, name);
|
||||
} else {
|
||||
description = malloc(strlen(gamepadPaths[pathIndex] + 1));
|
||||
strcpy(description, gamepadPaths[pathIndex]);
|
||||
}
|
||||
deviceRecord->description = description;
|
||||
|
||||
if (!ioctl(fd, EVIOCGID, &id)) {
|
||||
deviceRecord->vendorID = id.vendor;
|
||||
deviceRecord->productID = id.product;
|
||||
} else {
|
||||
deviceRecord->vendorID = deviceRecord->productID = 0;
|
||||
}
|
||||
|
||||
memset(evKeyBits, 0, sizeof(evKeyBits));
|
||||
memset(evAbsBits, 0, sizeof(evAbsBits));
|
||||
ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(evKeyBits)), evKeyBits);
|
||||
ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(evAbsBits)), evAbsBits);
|
||||
|
||||
deviceRecord->numAxes = 0;
|
||||
for (bit = 0; bit < ABS_CNT; bit++) {
|
||||
if (test_bit(bit, evAbsBits)) {
|
||||
if (ioctl(fd, EVIOCGABS(bit), &deviceRecordPrivate->axisInfo[bit]) < 0 ||
|
||||
deviceRecordPrivate->axisInfo[bit].minimum == deviceRecordPrivate->axisInfo[bit].maximum) {
|
||||
continue;
|
||||
}
|
||||
deviceRecordPrivate->axisMap[bit] = deviceRecord->numAxes;
|
||||
deviceRecord->numAxes++;
|
||||
}
|
||||
}
|
||||
deviceRecord->numButtons = 0;
|
||||
for (bit = BTN_MISC; bit < KEY_CNT; bit++) {
|
||||
if (test_bit(bit, evKeyBits)) {
|
||||
deviceRecordPrivate->buttonMap[bit - BTN_MISC] = deviceRecord->numButtons;
|
||||
deviceRecord->numButtons++;
|
||||
}
|
||||
}
|
||||
|
||||
deviceRecord->axisStates = calloc(sizeof(float), deviceRecord->numAxes);
|
||||
deviceRecord->buttonStates = calloc(sizeof(bool), deviceRecord->numButtons);
|
||||
|
||||
Gamepad_eventDispatcher()->dispatchEvent(Gamepad_eventDispatcher(), GAMEPAD_EVENT_DEVICE_ATTACHED, deviceRecord);
|
||||
|
||||
pthread_create(&deviceRecordPrivate->thread, NULL, deviceThread, deviceRecord);
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&devicesMutex);
|
||||
}
|
||||
|
||||
void Gamepad_processEvents() {
|
||||
unsigned int eventIndex;
|
||||
|
||||
if (!inited) {
|
||||
return;
|
||||
}
|
||||
|
||||
pthread_mutex_lock(&eventQueueMutex);
|
||||
for (eventIndex = 0; eventIndex < eventCount; eventIndex++) {
|
||||
eventQueue[eventIndex].dispatcher->dispatchEvent(eventQueue[eventIndex].dispatcher, eventQueue[eventIndex].eventType, eventQueue[eventIndex].eventData);
|
||||
if (!strcmp(eventQueue[eventIndex].eventType, GAMEPAD_EVENT_DEVICE_REMOVED)) {
|
||||
disposeDevice(eventQueue[eventIndex].eventData);
|
||||
}
|
||||
}
|
||||
eventCount = 0;
|
||||
pthread_mutex_unlock(&eventQueueMutex);
|
||||
}
|
||||
|
525
internal/c/parts/input/game_controller/src/Gamepad_macosx.c
Normal file
525
internal/c/parts/input/game_controller/src/Gamepad_macosx.c
Normal file
|
@ -0,0 +1,525 @@
|
|||
/*
|
||||
Copyright (c) 2010 Alex Diener
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
Alex Diener adiener@sacredsoftware.net
|
||||
*/
|
||||
|
||||
#include "gamepad/Gamepad.h"
|
||||
#include <IOKit/hid/IOHIDLib.h>
|
||||
#include <limits.h>
|
||||
#include <mach/mach.h>
|
||||
#include <mach/mach_time.h>
|
||||
|
||||
struct HIDGamepadAxis {
|
||||
IOHIDElementCookie cookie;
|
||||
CFIndex logicalMin;
|
||||
CFIndex logicalMax;
|
||||
bool hasNullState;
|
||||
bool isHatSwitch;
|
||||
bool isHatSwitchSecondAxis;
|
||||
};
|
||||
|
||||
struct HIDGamepadButton {
|
||||
IOHIDElementCookie cookie;
|
||||
};
|
||||
|
||||
struct Gamepad_devicePrivate {
|
||||
IOHIDDeviceRef deviceRef;
|
||||
struct HIDGamepadAxis * axisElements;
|
||||
struct HIDGamepadButton * buttonElements;
|
||||
};
|
||||
|
||||
struct Gamepad_queuedEvent {
|
||||
EventDispatcher * dispatcher;
|
||||
const char * eventType;
|
||||
void * eventData;
|
||||
};
|
||||
|
||||
static IOHIDManagerRef hidManager = NULL;
|
||||
static struct Gamepad_device ** devices = NULL;
|
||||
static unsigned int numDevices = 0;
|
||||
static unsigned int nextDeviceID = 0;
|
||||
|
||||
static struct Gamepad_queuedEvent * inputEventQueue = NULL;
|
||||
static size_t inputEventQueueSize = 0;
|
||||
static size_t inputEventCount = 0;
|
||||
|
||||
static struct Gamepad_queuedEvent * deviceEventQueue = NULL;
|
||||
static size_t deviceEventQueueSize = 0;
|
||||
static size_t deviceEventCount = 0;
|
||||
|
||||
static EventDispatcher * eventDispatcher = NULL;
|
||||
|
||||
static void hatValueToXY(CFIndex value, CFIndex range, int * outX, int * outY) {
|
||||
if (value == range) {
|
||||
*outX = *outY = 0;
|
||||
|
||||
} else {
|
||||
if (value > 0 && value < range / 2) {
|
||||
*outX = 1;
|
||||
|
||||
} else if (value > range / 2) {
|
||||
*outX = -1;
|
||||
|
||||
} else {
|
||||
*outX = 0;
|
||||
}
|
||||
|
||||
if (value > range / 4 * 3 || value < range / 4) {
|
||||
*outY = -1;
|
||||
|
||||
} else if (value > range / 4 && value < range / 4 * 3) {
|
||||
*outY = 1;
|
||||
|
||||
} else {
|
||||
*outY = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void queueInputEvent(EventDispatcher * dispatcher, const char * eventType, void * eventData) {
|
||||
struct Gamepad_queuedEvent queuedEvent;
|
||||
|
||||
queuedEvent.dispatcher = dispatcher;
|
||||
queuedEvent.eventType = eventType;
|
||||
queuedEvent.eventData = eventData;
|
||||
|
||||
if (inputEventCount >= inputEventQueueSize) {
|
||||
inputEventQueueSize = inputEventQueueSize == 0 ? 1 : inputEventQueueSize * 2;
|
||||
inputEventQueue = realloc(inputEventQueue, sizeof(struct Gamepad_queuedEvent) * inputEventQueueSize);
|
||||
}
|
||||
inputEventQueue[inputEventCount++] = queuedEvent;
|
||||
}
|
||||
|
||||
static void queueAxisEvent(struct Gamepad_device * device, double timestamp, unsigned int axisID, float value) {
|
||||
struct Gamepad_axisEvent * axisEvent;
|
||||
|
||||
axisEvent = malloc(sizeof(struct Gamepad_axisEvent));
|
||||
axisEvent->device = device;
|
||||
axisEvent->timestamp = timestamp;
|
||||
axisEvent->axisID = axisID;
|
||||
axisEvent->value = value;
|
||||
|
||||
queueInputEvent(device->eventDispatcher, GAMEPAD_EVENT_AXIS_MOVED, axisEvent);
|
||||
}
|
||||
|
||||
static void queueButtonEvent(struct Gamepad_device * device, double timestamp, unsigned int buttonID, bool down) {
|
||||
struct Gamepad_buttonEvent * buttonEvent;
|
||||
|
||||
buttonEvent = malloc(sizeof(struct Gamepad_buttonEvent));
|
||||
buttonEvent->device = device;
|
||||
buttonEvent->timestamp = timestamp;
|
||||
buttonEvent->buttonID = buttonID;
|
||||
buttonEvent->down = down;
|
||||
|
||||
queueInputEvent(device->eventDispatcher, down ? GAMEPAD_EVENT_BUTTON_DOWN : GAMEPAD_EVENT_BUTTON_UP, buttonEvent);
|
||||
}
|
||||
|
||||
static void onDeviceValueChanged(void * context, IOReturn result, void * sender, IOHIDValueRef value) {
|
||||
struct Gamepad_device * deviceRecord;
|
||||
struct Gamepad_devicePrivate * hidDeviceRecord;
|
||||
IOHIDElementRef element;
|
||||
IOHIDElementCookie cookie;
|
||||
unsigned int axisIndex, buttonIndex;
|
||||
static mach_timebase_info_data_t timebaseInfo;
|
||||
|
||||
if (timebaseInfo.denom == 0) {
|
||||
mach_timebase_info(&timebaseInfo);
|
||||
}
|
||||
|
||||
deviceRecord = context;
|
||||
hidDeviceRecord = deviceRecord->privateData;
|
||||
element = IOHIDValueGetElement(value);
|
||||
cookie = IOHIDElementGetCookie(element);
|
||||
|
||||
for (axisIndex = 0; axisIndex < deviceRecord->numAxes; axisIndex++) {
|
||||
if (!hidDeviceRecord->axisElements[axisIndex].isHatSwitchSecondAxis &&
|
||||
hidDeviceRecord->axisElements[axisIndex].cookie == cookie) {
|
||||
CFIndex integerValue;
|
||||
|
||||
if (IOHIDValueGetLength(value) > 4) {
|
||||
// Workaround for a strange crash that occurs with PS3 controller; was getting lengths of 39 (!)
|
||||
continue;
|
||||
}
|
||||
integerValue = IOHIDValueGetIntegerValue(value);
|
||||
|
||||
if (hidDeviceRecord->axisElements[axisIndex].isHatSwitch) {
|
||||
int x, y;
|
||||
|
||||
// Fix for Saitek X52
|
||||
hidDeviceRecord->axisElements[axisIndex].hasNullState = false;
|
||||
if (!hidDeviceRecord->axisElements[axisIndex].hasNullState) {
|
||||
if (integerValue < hidDeviceRecord->axisElements[axisIndex].logicalMin) {
|
||||
integerValue = hidDeviceRecord->axisElements[axisIndex].logicalMax - hidDeviceRecord->axisElements[axisIndex].logicalMin + 1;
|
||||
} else {
|
||||
integerValue--;
|
||||
}
|
||||
}
|
||||
|
||||
hatValueToXY(integerValue, hidDeviceRecord->axisElements[axisIndex].logicalMax - hidDeviceRecord->axisElements[axisIndex].logicalMin + 1, &x, &y);
|
||||
|
||||
if (x != deviceRecord->axisStates[axisIndex]) {
|
||||
queueAxisEvent(deviceRecord,
|
||||
IOHIDValueGetTimeStamp(value) * timebaseInfo.numer / timebaseInfo.denom * 0.000000001,
|
||||
axisIndex,
|
||||
x);
|
||||
|
||||
deviceRecord->axisStates[axisIndex] = x;
|
||||
}
|
||||
|
||||
if (y != deviceRecord->axisStates[axisIndex + 1]) {
|
||||
queueAxisEvent(deviceRecord,
|
||||
IOHIDValueGetTimeStamp(value) * timebaseInfo.numer / timebaseInfo.denom * 0.000000001,
|
||||
axisIndex + 1,
|
||||
y);
|
||||
|
||||
deviceRecord->axisStates[axisIndex + 1] = y;
|
||||
}
|
||||
|
||||
} else {
|
||||
float floatValue;
|
||||
|
||||
if (integerValue < hidDeviceRecord->axisElements[axisIndex].logicalMin) {
|
||||
hidDeviceRecord->axisElements[axisIndex].logicalMin = integerValue;
|
||||
}
|
||||
if (integerValue > hidDeviceRecord->axisElements[axisIndex].logicalMax) {
|
||||
hidDeviceRecord->axisElements[axisIndex].logicalMax = integerValue;
|
||||
}
|
||||
floatValue = (integerValue - hidDeviceRecord->axisElements[axisIndex].logicalMin) / (float) (hidDeviceRecord->axisElements[axisIndex].logicalMax - hidDeviceRecord->axisElements[axisIndex].logicalMin) * 2.0f - 1.0f;
|
||||
|
||||
queueAxisEvent(deviceRecord,
|
||||
IOHIDValueGetTimeStamp(value) * timebaseInfo.numer / timebaseInfo.denom * 0.000000001,
|
||||
axisIndex,
|
||||
floatValue);
|
||||
|
||||
deviceRecord->axisStates[axisIndex] = floatValue;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for (buttonIndex = 0; buttonIndex < deviceRecord->numButtons; buttonIndex++) {
|
||||
if (hidDeviceRecord->buttonElements[buttonIndex].cookie == cookie) {
|
||||
bool down;
|
||||
|
||||
down = IOHIDValueGetIntegerValue(value);
|
||||
queueButtonEvent(deviceRecord,
|
||||
IOHIDValueGetTimeStamp(value) * timebaseInfo.numer / timebaseInfo.denom * 0.000000001,
|
||||
buttonIndex,
|
||||
down);
|
||||
|
||||
deviceRecord->buttonStates[buttonIndex] = down;
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int IOHIDDeviceGetIntProperty(IOHIDDeviceRef deviceRef, CFStringRef key) {
|
||||
CFTypeRef typeRef;
|
||||
int value;
|
||||
|
||||
typeRef = IOHIDDeviceGetProperty(deviceRef, key);
|
||||
if (typeRef == NULL || CFGetTypeID(typeRef) != CFNumberGetTypeID()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
CFNumberGetValue((CFNumberRef) typeRef, kCFNumberSInt32Type, &value);
|
||||
return value;
|
||||
}
|
||||
|
||||
static int IOHIDDeviceGetVendorID(IOHIDDeviceRef deviceRef) {
|
||||
return IOHIDDeviceGetIntProperty(deviceRef, CFSTR(kIOHIDVendorIDKey));
|
||||
}
|
||||
|
||||
static int IOHIDDeviceGetProductID(IOHIDDeviceRef deviceRef) {
|
||||
return IOHIDDeviceGetIntProperty(deviceRef, CFSTR(kIOHIDProductIDKey));
|
||||
}
|
||||
|
||||
static void onDeviceMatched(void * context, IOReturn result, void * sender, IOHIDDeviceRef device) {
|
||||
CFArrayRef elements;
|
||||
CFIndex elementIndex;
|
||||
IOHIDElementRef element;
|
||||
CFStringRef cfProductName;
|
||||
struct Gamepad_device * deviceRecord;
|
||||
struct Gamepad_devicePrivate * hidDeviceRecord;
|
||||
IOHIDElementType type;
|
||||
char * description;
|
||||
struct Gamepad_queuedEvent queuedEvent;
|
||||
|
||||
deviceRecord = malloc(sizeof(struct Gamepad_device));
|
||||
deviceRecord->deviceID = nextDeviceID++;
|
||||
deviceRecord->vendorID = IOHIDDeviceGetVendorID(device);
|
||||
deviceRecord->productID = IOHIDDeviceGetProductID(device);
|
||||
deviceRecord->numAxes = 0;
|
||||
deviceRecord->numButtons = 0;
|
||||
deviceRecord->eventDispatcher = EventDispatcher_create(deviceRecord);
|
||||
devices = realloc(devices, sizeof(struct Gamepad_device *) * (numDevices + 1));
|
||||
devices[numDevices++] = deviceRecord;
|
||||
|
||||
hidDeviceRecord = malloc(sizeof(struct Gamepad_devicePrivate));
|
||||
hidDeviceRecord->deviceRef = device;
|
||||
hidDeviceRecord->axisElements = NULL;
|
||||
hidDeviceRecord->buttonElements = NULL;
|
||||
deviceRecord->privateData = hidDeviceRecord;
|
||||
|
||||
cfProductName = IOHIDDeviceGetProperty(device, CFSTR(kIOHIDProductKey));
|
||||
if (cfProductName == NULL || CFGetTypeID(cfProductName) != CFStringGetTypeID()) {
|
||||
description = malloc(strlen("[Unknown]" + 1));
|
||||
strcpy(description, "[Unknown]");
|
||||
|
||||
} else {
|
||||
const char * cStringPtr;
|
||||
|
||||
cStringPtr = CFStringGetCStringPtr(cfProductName, CFStringGetSmallestEncoding(cfProductName));
|
||||
description = malloc(strlen(cStringPtr + 1));
|
||||
strcpy(description, cStringPtr);
|
||||
}
|
||||
deviceRecord->description = description;
|
||||
|
||||
elements = IOHIDDeviceCopyMatchingElements(device, NULL, kIOHIDOptionsTypeNone);
|
||||
for (elementIndex = 0; elementIndex < CFArrayGetCount(elements); elementIndex++) {
|
||||
element = (IOHIDElementRef) CFArrayGetValueAtIndex(elements, elementIndex);
|
||||
type = IOHIDElementGetType(element);
|
||||
|
||||
// All of the axis elements I've ever detected have been kIOHIDElementTypeInput_Misc. kIOHIDElementTypeInput_Axis is only included for good faith...
|
||||
if (type == kIOHIDElementTypeInput_Misc ||
|
||||
type == kIOHIDElementTypeInput_Axis) {
|
||||
|
||||
hidDeviceRecord->axisElements = realloc(hidDeviceRecord->axisElements, sizeof(struct HIDGamepadAxis) * (deviceRecord->numAxes + 1));
|
||||
hidDeviceRecord->axisElements[deviceRecord->numAxes].cookie = IOHIDElementGetCookie(element);
|
||||
hidDeviceRecord->axisElements[deviceRecord->numAxes].logicalMin = IOHIDElementGetLogicalMin(element);
|
||||
hidDeviceRecord->axisElements[deviceRecord->numAxes].logicalMax = IOHIDElementGetLogicalMax(element);
|
||||
hidDeviceRecord->axisElements[deviceRecord->numAxes].hasNullState = !!IOHIDElementHasNullState(element);
|
||||
hidDeviceRecord->axisElements[deviceRecord->numAxes].isHatSwitch = IOHIDElementGetUsage(element) == kHIDUsage_GD_Hatswitch;
|
||||
hidDeviceRecord->axisElements[deviceRecord->numAxes].isHatSwitchSecondAxis = false;
|
||||
deviceRecord->numAxes++;
|
||||
|
||||
if (hidDeviceRecord->axisElements[deviceRecord->numAxes - 1].isHatSwitch) {
|
||||
hidDeviceRecord->axisElements = realloc(hidDeviceRecord->axisElements, sizeof(struct HIDGamepadAxis) * (deviceRecord->numAxes + 1));
|
||||
hidDeviceRecord->axisElements[deviceRecord->numAxes].isHatSwitchSecondAxis = true;
|
||||
deviceRecord->numAxes++;
|
||||
}
|
||||
|
||||
} else if (type == kIOHIDElementTypeInput_Button) {
|
||||
hidDeviceRecord->buttonElements = realloc(hidDeviceRecord->buttonElements, sizeof(struct HIDGamepadButton) * (deviceRecord->numButtons + 1));
|
||||
hidDeviceRecord->buttonElements[deviceRecord->numButtons].cookie = IOHIDElementGetCookie(element);
|
||||
deviceRecord->numButtons++;
|
||||
}
|
||||
}
|
||||
CFRelease(elements);
|
||||
|
||||
deviceRecord->axisStates = calloc(sizeof(float), deviceRecord->numAxes);
|
||||
deviceRecord->buttonStates = calloc(sizeof(bool), deviceRecord->numButtons);
|
||||
|
||||
IOHIDDeviceRegisterInputValueCallback(device, onDeviceValueChanged, deviceRecord);
|
||||
|
||||
queuedEvent.dispatcher = Gamepad_eventDispatcher();
|
||||
queuedEvent.eventType = GAMEPAD_EVENT_DEVICE_ATTACHED;
|
||||
queuedEvent.eventData = deviceRecord;
|
||||
|
||||
if (deviceEventCount >= deviceEventQueueSize) {
|
||||
deviceEventQueueSize = deviceEventQueueSize == 0 ? 1 : deviceEventQueueSize * 2;
|
||||
deviceEventQueue = realloc(deviceEventQueue, sizeof(struct Gamepad_queuedEvent) * deviceEventQueueSize);
|
||||
}
|
||||
deviceEventQueue[deviceEventCount++] = queuedEvent;
|
||||
}
|
||||
|
||||
static void disposeDevice(struct Gamepad_device * deviceRecord) {
|
||||
unsigned int inputEventIndex, deviceEventIndex;
|
||||
|
||||
IOHIDDeviceRegisterInputValueCallback(((struct Gamepad_devicePrivate *) deviceRecord->privateData)->deviceRef, NULL, NULL);
|
||||
|
||||
for (inputEventIndex = 0; inputEventIndex < inputEventCount; inputEventIndex++) {
|
||||
if (inputEventQueue[inputEventIndex].dispatcher == deviceRecord->eventDispatcher) {
|
||||
unsigned int inputEventIndex2;
|
||||
|
||||
free(inputEventQueue[inputEventIndex].eventData);
|
||||
inputEventCount--;
|
||||
for (inputEventIndex2 = inputEventIndex; inputEventIndex2 < inputEventCount; inputEventIndex2++) {
|
||||
inputEventQueue[inputEventIndex2] = inputEventQueue[inputEventIndex2 + 1];
|
||||
}
|
||||
inputEventIndex--;
|
||||
}
|
||||
}
|
||||
|
||||
for (deviceEventIndex = 0; deviceEventIndex < deviceEventCount; deviceEventIndex++) {
|
||||
if (deviceEventQueue[deviceEventIndex].dispatcher == deviceRecord->eventDispatcher) {
|
||||
unsigned int deviceEventIndex2;
|
||||
|
||||
deviceEventCount--;
|
||||
for (deviceEventIndex2 = deviceEventIndex; deviceEventIndex2 < deviceEventCount; deviceEventIndex2++) {
|
||||
deviceEventQueue[deviceEventIndex2] = deviceEventQueue[deviceEventIndex2 + 1];
|
||||
}
|
||||
deviceEventIndex--;
|
||||
}
|
||||
}
|
||||
|
||||
deviceRecord->eventDispatcher->dispose(deviceRecord->eventDispatcher);
|
||||
|
||||
free(((struct Gamepad_devicePrivate *) deviceRecord->privateData)->axisElements);
|
||||
free(((struct Gamepad_devicePrivate *) deviceRecord->privateData)->buttonElements);
|
||||
free(deviceRecord->privateData);
|
||||
|
||||
free((void *) deviceRecord->description);
|
||||
free(deviceRecord->axisStates);
|
||||
free(deviceRecord->buttonStates);
|
||||
free(deviceRecord->eventDispatcher);
|
||||
|
||||
free(deviceRecord);
|
||||
}
|
||||
|
||||
static void onDeviceRemoved(void * context, IOReturn result, void * sender, IOHIDDeviceRef device) {
|
||||
unsigned int deviceIndex;
|
||||
|
||||
for (deviceIndex = 0; deviceIndex < numDevices; deviceIndex++) {
|
||||
if (((struct Gamepad_devicePrivate *) devices[deviceIndex]->privateData)->deviceRef == device) {
|
||||
Gamepad_eventDispatcher()->dispatchEvent(Gamepad_eventDispatcher(), GAMEPAD_EVENT_DEVICE_REMOVED, devices[deviceIndex]);
|
||||
|
||||
disposeDevice(devices[deviceIndex]);
|
||||
numDevices--;
|
||||
for (; deviceIndex < numDevices; deviceIndex++) {
|
||||
devices[deviceIndex] = devices[deviceIndex + 1];
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Gamepad_init() {
|
||||
if (hidManager == NULL) {
|
||||
CFStringRef keys[2];
|
||||
int value;
|
||||
CFNumberRef values[2];
|
||||
CFDictionaryRef dictionaries[3];
|
||||
CFArrayRef array;
|
||||
|
||||
hidManager = IOHIDManagerCreate(kCFAllocatorDefault, kIOHIDOptionsTypeNone);
|
||||
IOHIDManagerOpen(hidManager, kIOHIDOptionsTypeNone);
|
||||
IOHIDManagerScheduleWithRunLoop(hidManager, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
|
||||
|
||||
keys[0] = CFSTR(kIOHIDDeviceUsagePageKey);
|
||||
keys[1] = CFSTR(kIOHIDDeviceUsageKey);
|
||||
|
||||
value = kHIDPage_GenericDesktop;
|
||||
values[0] = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &value);
|
||||
value = kHIDUsage_GD_Joystick;
|
||||
values[1] = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &value);
|
||||
dictionaries[0] = CFDictionaryCreate(kCFAllocatorDefault, (const void **) keys, (const void **) values, 2, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
|
||||
CFRelease(values[0]);
|
||||
CFRelease(values[1]);
|
||||
|
||||
value = kHIDPage_GenericDesktop;
|
||||
values[0] = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &value);
|
||||
value = kHIDUsage_GD_GamePad;
|
||||
values[1] = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &value);
|
||||
dictionaries[1] = CFDictionaryCreate(kCFAllocatorDefault, (const void **) keys, (const void **) values, 2, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
|
||||
CFRelease(values[0]);
|
||||
CFRelease(values[1]);
|
||||
|
||||
value = kHIDPage_GenericDesktop;
|
||||
values[0] = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &value);
|
||||
value = kHIDUsage_GD_MultiAxisController;
|
||||
values[1] = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &value);
|
||||
dictionaries[2] = CFDictionaryCreate(kCFAllocatorDefault, (const void **) keys, (const void **) values, 2, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
|
||||
CFRelease(values[0]);
|
||||
CFRelease(values[1]);
|
||||
|
||||
array = CFArrayCreate(kCFAllocatorDefault, (const void **) dictionaries, 3, &kCFTypeArrayCallBacks);
|
||||
CFRelease(dictionaries[0]);
|
||||
CFRelease(dictionaries[1]);
|
||||
CFRelease(dictionaries[2]);
|
||||
IOHIDManagerSetDeviceMatchingMultiple(hidManager, array);
|
||||
CFRelease(array);
|
||||
|
||||
IOHIDManagerRegisterDeviceMatchingCallback(hidManager, onDeviceMatched, NULL);
|
||||
IOHIDManagerRegisterDeviceRemovalCallback(hidManager, onDeviceRemoved, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
void Gamepad_shutdown() {
|
||||
if (hidManager != NULL) {
|
||||
unsigned int deviceIndex;
|
||||
|
||||
IOHIDManagerUnscheduleFromRunLoop(hidManager, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
|
||||
IOHIDManagerClose(hidManager, 0);
|
||||
CFRelease(hidManager);
|
||||
hidManager = NULL;
|
||||
|
||||
for (deviceIndex = 0; deviceIndex < numDevices; deviceIndex++) {
|
||||
disposeDevice(devices[deviceIndex]);
|
||||
}
|
||||
free(devices);
|
||||
devices = NULL;
|
||||
numDevices = 0;
|
||||
|
||||
if (eventDispatcher != NULL) {
|
||||
eventDispatcher->dispose(eventDispatcher);
|
||||
free(eventDispatcher);
|
||||
eventDispatcher = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EventDispatcher * Gamepad_eventDispatcher() {
|
||||
if (eventDispatcher == NULL) {
|
||||
eventDispatcher = EventDispatcher_create(NULL);
|
||||
}
|
||||
return eventDispatcher;
|
||||
}
|
||||
|
||||
unsigned int Gamepad_numDevices() {
|
||||
return numDevices;
|
||||
}
|
||||
|
||||
struct Gamepad_device * Gamepad_deviceAtIndex(unsigned int deviceIndex) {
|
||||
if (deviceIndex >= numDevices) {
|
||||
return NULL;
|
||||
}
|
||||
return devices[deviceIndex];
|
||||
}
|
||||
|
||||
void Gamepad_detectDevices() {
|
||||
unsigned int eventIndex;
|
||||
|
||||
if (hidManager == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (eventIndex = 0; eventIndex < deviceEventCount; eventIndex++) {
|
||||
deviceEventQueue[eventIndex].dispatcher->dispatchEvent(deviceEventQueue[eventIndex].dispatcher, deviceEventQueue[eventIndex].eventType, deviceEventQueue[eventIndex].eventData);
|
||||
}
|
||||
deviceEventCount = 0;
|
||||
}
|
||||
|
||||
void Gamepad_processEvents() {
|
||||
unsigned int eventIndex;
|
||||
|
||||
if (hidManager == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (eventIndex = 0; eventIndex < inputEventCount; eventIndex++) {
|
||||
inputEventQueue[eventIndex].dispatcher->dispatchEvent(inputEventQueue[eventIndex].dispatcher, inputEventQueue[eventIndex].eventType, inputEventQueue[eventIndex].eventData);
|
||||
free(inputEventQueue[eventIndex].eventData);
|
||||
}
|
||||
inputEventCount = 0;
|
||||
}
|
||||
|
416
internal/c/parts/input/game_controller/src/Gamepad_windows.c
Normal file
416
internal/c/parts/input/game_controller/src/Gamepad_windows.c
Normal file
|
@ -0,0 +1,416 @@
|
|||
/*
|
||||
Copyright (c) 2010 Alex Diener
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
Alex Diener adiener@sacredsoftware.net
|
||||
*/
|
||||
|
||||
#include "gamepad/Gamepad.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <windows.h>
|
||||
#include <regstr.h>
|
||||
|
||||
struct Gamepad_devicePrivate {
|
||||
UINT joystickID;
|
||||
JOYINFOEX lastState;
|
||||
int xAxisIndex;
|
||||
int yAxisIndex;
|
||||
int zAxisIndex;
|
||||
int rAxisIndex;
|
||||
int uAxisIndex;
|
||||
int vAxisIndex;
|
||||
int povXAxisIndex;
|
||||
int povYAxisIndex;
|
||||
UINT (* axisRanges)[2];
|
||||
};
|
||||
|
||||
static struct Gamepad_device ** devices = NULL;
|
||||
static unsigned int numDevices = 0;
|
||||
static unsigned int nextDeviceID = 0;
|
||||
|
||||
static EventDispatcher * eventDispatcher = NULL;
|
||||
static bool inited = false;
|
||||
|
||||
void Gamepad_init() {
|
||||
if (!inited) {
|
||||
inited = true;
|
||||
Gamepad_detectDevices();
|
||||
}
|
||||
}
|
||||
|
||||
static void disposeDevice(struct Gamepad_device * deviceRecord) {
|
||||
deviceRecord->eventDispatcher->dispose(deviceRecord->eventDispatcher);
|
||||
|
||||
free(((struct Gamepad_devicePrivate *) deviceRecord->privateData)->axisRanges);
|
||||
free(deviceRecord->privateData);
|
||||
|
||||
free((void *) deviceRecord->description);
|
||||
free(deviceRecord->axisStates);
|
||||
free(deviceRecord->buttonStates);
|
||||
free(deviceRecord->eventDispatcher);
|
||||
|
||||
free(deviceRecord);
|
||||
}
|
||||
|
||||
void Gamepad_shutdown() {
|
||||
unsigned int deviceIndex;
|
||||
|
||||
if (inited) {
|
||||
for (deviceIndex = 0; deviceIndex < numDevices; deviceIndex++) {
|
||||
disposeDevice(devices[deviceIndex]);
|
||||
}
|
||||
free(devices);
|
||||
devices = NULL;
|
||||
numDevices = 0;
|
||||
if (eventDispatcher != NULL) {
|
||||
eventDispatcher->dispose(eventDispatcher);
|
||||
free(eventDispatcher);
|
||||
eventDispatcher = NULL;
|
||||
}
|
||||
inited = false;
|
||||
}
|
||||
}
|
||||
|
||||
EventDispatcher * Gamepad_eventDispatcher() {
|
||||
if (eventDispatcher == NULL) {
|
||||
eventDispatcher = EventDispatcher_create(NULL);
|
||||
}
|
||||
return eventDispatcher;
|
||||
}
|
||||
|
||||
unsigned int Gamepad_numDevices() {
|
||||
return numDevices;
|
||||
}
|
||||
|
||||
struct Gamepad_device * Gamepad_deviceAtIndex(unsigned int deviceIndex) {
|
||||
if (deviceIndex >= numDevices) {
|
||||
return NULL;
|
||||
}
|
||||
return devices[deviceIndex];
|
||||
}
|
||||
|
||||
#define REG_STRING_MAX 256
|
||||
|
||||
static char * getDeviceDescription(UINT joystickID, JOYCAPS caps) {
|
||||
char * description;
|
||||
char subkey[REG_STRING_MAX];
|
||||
HKEY topKey, key;
|
||||
LONG result;
|
||||
|
||||
snprintf(subkey, REG_STRING_MAX, "%s\\%s\\%s", REGSTR_PATH_JOYCONFIG, caps.szRegKey, REGSTR_KEY_JOYCURR);
|
||||
result = RegOpenKeyEx(topKey = HKEY_LOCAL_MACHINE, subkey, 0, KEY_READ, &key);
|
||||
if (result != ERROR_SUCCESS) {
|
||||
result = RegOpenKeyEx(topKey = HKEY_CURRENT_USER, subkey, 0, KEY_READ, &key);
|
||||
}
|
||||
if (result == ERROR_SUCCESS) {
|
||||
char value[REG_STRING_MAX];
|
||||
char name[REG_STRING_MAX];
|
||||
DWORD nameSize;
|
||||
|
||||
snprintf(value, REG_STRING_MAX, "Joystick%d%s", joystickID + 1, REGSTR_VAL_JOYOEMNAME);
|
||||
nameSize = sizeof(name);
|
||||
result = RegQueryValueEx(key, value, NULL, NULL, (LPBYTE) name, &nameSize);
|
||||
RegCloseKey(key);
|
||||
|
||||
if (result == ERROR_SUCCESS) {
|
||||
snprintf(subkey, REG_STRING_MAX, "%s\\%s", REGSTR_PATH_JOYOEM, name);
|
||||
result = RegOpenKeyEx(topKey, subkey, 0, KEY_READ, &key);
|
||||
|
||||
if (result == ERROR_SUCCESS) {
|
||||
nameSize = sizeof(name);
|
||||
result = RegQueryValueEx(key, REGSTR_VAL_JOYOEMNAME, NULL, NULL, NULL, &nameSize);
|
||||
|
||||
if (result == ERROR_SUCCESS) {
|
||||
description = malloc(nameSize);
|
||||
result = RegQueryValueEx(key, REGSTR_VAL_JOYOEMNAME, NULL, NULL, (LPBYTE) description, &nameSize);
|
||||
}
|
||||
RegCloseKey(key);
|
||||
|
||||
if (result == ERROR_SUCCESS) {
|
||||
return description;
|
||||
}
|
||||
free(description);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
description = malloc(strlen(caps.szPname) + 1);
|
||||
strcpy(description, caps.szPname);
|
||||
|
||||
return description;
|
||||
}
|
||||
|
||||
void Gamepad_detectDevices() {
|
||||
unsigned int numPadsSupported;
|
||||
unsigned int deviceIndex, deviceIndex2;
|
||||
JOYINFOEX info;
|
||||
JOYCAPS caps;
|
||||
bool duplicate;
|
||||
struct Gamepad_device * deviceRecord;
|
||||
struct Gamepad_devicePrivate * deviceRecordPrivate;
|
||||
UINT joystickID;
|
||||
int axisIndex;
|
||||
|
||||
if (!inited) {
|
||||
return;
|
||||
}
|
||||
|
||||
numPadsSupported = joyGetNumDevs();
|
||||
for (deviceIndex = 0; deviceIndex < numPadsSupported; deviceIndex++) {
|
||||
info.dwSize = sizeof(info);
|
||||
info.dwFlags = JOY_RETURNALL;
|
||||
joystickID = JOYSTICKID1 + deviceIndex;
|
||||
if (joyGetPosEx(joystickID, &info) == JOYERR_NOERROR &&
|
||||
joyGetDevCaps(joystickID, &caps, sizeof(JOYCAPS)) == JOYERR_NOERROR) {
|
||||
|
||||
duplicate = false;
|
||||
for (deviceIndex2 = 0; deviceIndex2 < numDevices; deviceIndex2++) {
|
||||
if (((struct Gamepad_devicePrivate *) devices[deviceIndex2]->privateData)->joystickID == joystickID) {
|
||||
duplicate = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (duplicate) {
|
||||
continue;
|
||||
}
|
||||
|
||||
deviceRecord = malloc(sizeof(struct Gamepad_device));
|
||||
deviceRecord->deviceID = nextDeviceID++;
|
||||
deviceRecord->description = getDeviceDescription(joystickID, caps);
|
||||
deviceRecord->vendorID = caps.wMid;
|
||||
deviceRecord->productID = caps.wPid;
|
||||
deviceRecord->numAxes = caps.wNumAxes + ((caps.wCaps & JOYCAPS_HASPOV) ? 2 : 0);
|
||||
deviceRecord->numButtons = caps.wNumButtons;
|
||||
deviceRecord->axisStates = calloc(sizeof(float), deviceRecord->numAxes);
|
||||
deviceRecord->buttonStates = calloc(sizeof(bool), deviceRecord->numButtons);
|
||||
deviceRecord->eventDispatcher = EventDispatcher_create(deviceRecord);
|
||||
devices = realloc(devices, sizeof(struct Gamepad_device *) * (numDevices + 1));
|
||||
devices[numDevices++] = deviceRecord;
|
||||
|
||||
deviceRecordPrivate = malloc(sizeof(struct Gamepad_devicePrivate));
|
||||
deviceRecordPrivate->joystickID = joystickID;
|
||||
deviceRecordPrivate->lastState = info;
|
||||
|
||||
deviceRecordPrivate->xAxisIndex = 0;
|
||||
deviceRecordPrivate->yAxisIndex = 1;
|
||||
axisIndex = 2;
|
||||
deviceRecordPrivate->zAxisIndex = (caps.wCaps & JOYCAPS_HASZ) ? axisIndex++ : -1;
|
||||
deviceRecordPrivate->rAxisIndex = (caps.wCaps & JOYCAPS_HASR) ? axisIndex++ : -1;
|
||||
deviceRecordPrivate->uAxisIndex = (caps.wCaps & JOYCAPS_HASU) ? axisIndex++ : -1;
|
||||
deviceRecordPrivate->vAxisIndex = (caps.wCaps & JOYCAPS_HASV) ? axisIndex++ : -1;
|
||||
|
||||
deviceRecordPrivate->axisRanges = malloc(sizeof(UINT[2]) * axisIndex);
|
||||
deviceRecordPrivate->axisRanges[0][0] = caps.wXmin;
|
||||
deviceRecordPrivate->axisRanges[0][1] = caps.wXmax;
|
||||
deviceRecordPrivate->axisRanges[1][0] = caps.wYmin;
|
||||
deviceRecordPrivate->axisRanges[1][1] = caps.wYmax;
|
||||
if (deviceRecordPrivate->zAxisIndex != -1) {
|
||||
deviceRecordPrivate->axisRanges[deviceRecordPrivate->zAxisIndex][0] = caps.wZmin;
|
||||
deviceRecordPrivate->axisRanges[deviceRecordPrivate->zAxisIndex][1] = caps.wZmax;
|
||||
}
|
||||
if (deviceRecordPrivate->rAxisIndex != -1) {
|
||||
deviceRecordPrivate->axisRanges[deviceRecordPrivate->rAxisIndex][0] = caps.wRmin;
|
||||
deviceRecordPrivate->axisRanges[deviceRecordPrivate->rAxisIndex][1] = caps.wRmax;
|
||||
}
|
||||
if (deviceRecordPrivate->uAxisIndex != -1) {
|
||||
deviceRecordPrivate->axisRanges[deviceRecordPrivate->uAxisIndex][0] = caps.wUmin;
|
||||
deviceRecordPrivate->axisRanges[deviceRecordPrivate->uAxisIndex][1] = caps.wUmax;
|
||||
}
|
||||
if (deviceRecordPrivate->vAxisIndex != -1) {
|
||||
deviceRecordPrivate->axisRanges[deviceRecordPrivate->vAxisIndex][0] = caps.wVmin;
|
||||
deviceRecordPrivate->axisRanges[deviceRecordPrivate->vAxisIndex][1] = caps.wVmax;
|
||||
}
|
||||
|
||||
deviceRecordPrivate->povXAxisIndex = (caps.wCaps & JOYCAPS_HASPOV) ? axisIndex++ : -1;
|
||||
deviceRecordPrivate->povYAxisIndex = (caps.wCaps & JOYCAPS_HASPOV) ? axisIndex++ : -1;
|
||||
|
||||
deviceRecord->privateData = deviceRecordPrivate;
|
||||
|
||||
Gamepad_eventDispatcher()->dispatchEvent(Gamepad_eventDispatcher(), GAMEPAD_EVENT_DEVICE_ATTACHED, deviceRecord);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static double currentTime() {
|
||||
// HACK: No timestamp data from joyGetInfoEx, so we make it up
|
||||
static LARGE_INTEGER frequency;
|
||||
LARGE_INTEGER currentTime;
|
||||
|
||||
if (frequency.QuadPart == 0) {
|
||||
QueryPerformanceFrequency(&frequency);
|
||||
}
|
||||
QueryPerformanceCounter(¤tTime);
|
||||
|
||||
return (double) currentTime.QuadPart / frequency.QuadPart;
|
||||
}
|
||||
|
||||
static void handleAxisChange(struct Gamepad_device * device, int axisIndex, DWORD value) {
|
||||
struct Gamepad_axisEvent axisEvent;
|
||||
struct Gamepad_devicePrivate * devicePrivate;
|
||||
|
||||
if (axisIndex < 0 || axisIndex >= (int) device->numAxes) {
|
||||
return;
|
||||
}
|
||||
|
||||
devicePrivate = device->privateData;
|
||||
|
||||
axisEvent.device = device;
|
||||
axisEvent.timestamp = currentTime();
|
||||
axisEvent.axisID = axisIndex;
|
||||
axisEvent.value = (value - devicePrivate->axisRanges[axisIndex][0]) / (float) (devicePrivate->axisRanges[axisIndex][1] - devicePrivate->axisRanges[axisIndex][0]) * 2.0f - 1.0f;
|
||||
|
||||
device->axisStates[axisIndex] = axisEvent.value;
|
||||
device->eventDispatcher->dispatchEvent(device->eventDispatcher, GAMEPAD_EVENT_AXIS_MOVED, &axisEvent);
|
||||
}
|
||||
|
||||
static void handleButtonChange(struct Gamepad_device * device, DWORD lastValue, DWORD value) {
|
||||
struct Gamepad_buttonEvent buttonEvent;
|
||||
unsigned int buttonIndex;
|
||||
|
||||
for (buttonIndex = 0; buttonIndex < device->numButtons; buttonIndex++) {
|
||||
if ((lastValue ^ value) & (1 << buttonIndex)) {
|
||||
buttonEvent.device = device;
|
||||
buttonEvent.timestamp = currentTime();
|
||||
buttonEvent.buttonID = buttonIndex;
|
||||
buttonEvent.down = !!(value & (1 << buttonIndex));
|
||||
|
||||
device->buttonStates[buttonIndex] = buttonEvent.down;
|
||||
device->eventDispatcher->dispatchEvent(device->eventDispatcher, buttonEvent.down ? GAMEPAD_EVENT_BUTTON_DOWN : GAMEPAD_EVENT_BUTTON_UP, &buttonEvent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void povToXY(DWORD pov, int * outX, int * outY) {
|
||||
if (pov == JOY_POVCENTERED) {
|
||||
*outX = *outY = 0;
|
||||
|
||||
} else {
|
||||
if (pov > JOY_POVFORWARD && pov < JOY_POVBACKWARD) {
|
||||
*outX = 1;
|
||||
|
||||
} else if (pov > JOY_POVBACKWARD) {
|
||||
*outX = -1;
|
||||
|
||||
} else {
|
||||
*outX = 0;
|
||||
}
|
||||
|
||||
if (pov > JOY_POVLEFT || pov < JOY_POVRIGHT) {
|
||||
*outY = -1;
|
||||
|
||||
} else if (pov > JOY_POVRIGHT && pov < JOY_POVLEFT) {
|
||||
*outY = 1;
|
||||
|
||||
} else {
|
||||
*outY = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void handlePOVChange(struct Gamepad_device * device, DWORD lastValue, DWORD value) {
|
||||
struct Gamepad_devicePrivate * devicePrivate;
|
||||
int lastX, lastY, newX, newY;
|
||||
struct Gamepad_axisEvent axisEvent;
|
||||
|
||||
devicePrivate = device->privateData;
|
||||
|
||||
if (devicePrivate->povXAxisIndex == -1 || devicePrivate->povYAxisIndex == -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
povToXY(lastValue, &lastX, &lastY);
|
||||
povToXY(value, &newX, &newY);
|
||||
|
||||
if (newX != lastX) {
|
||||
axisEvent.device = device;
|
||||
axisEvent.timestamp = currentTime();
|
||||
axisEvent.axisID = devicePrivate->povXAxisIndex;
|
||||
axisEvent.value = newX;
|
||||
|
||||
device->axisStates[devicePrivate->povXAxisIndex] = axisEvent.value;
|
||||
device->eventDispatcher->dispatchEvent(device->eventDispatcher, GAMEPAD_EVENT_AXIS_MOVED, &axisEvent);
|
||||
}
|
||||
if (newY != lastY) {
|
||||
axisEvent.device = device;
|
||||
axisEvent.timestamp = currentTime();
|
||||
axisEvent.axisID = devicePrivate->povYAxisIndex;
|
||||
axisEvent.value = newY;
|
||||
|
||||
device->axisStates[devicePrivate->povYAxisIndex] = axisEvent.value;
|
||||
device->eventDispatcher->dispatchEvent(device->eventDispatcher, GAMEPAD_EVENT_AXIS_MOVED, &axisEvent);
|
||||
}
|
||||
}
|
||||
|
||||
void Gamepad_processEvents() {
|
||||
unsigned int deviceIndex;
|
||||
JOYINFOEX info;
|
||||
MMRESULT result;
|
||||
struct Gamepad_device * device;
|
||||
struct Gamepad_devicePrivate * devicePrivate;
|
||||
|
||||
if (!inited) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (deviceIndex = 0; deviceIndex < numDevices; deviceIndex++) {
|
||||
device = devices[deviceIndex];
|
||||
devicePrivate = device->privateData;
|
||||
|
||||
info.dwSize = sizeof(info);
|
||||
info.dwFlags = JOY_RETURNALL;
|
||||
result = joyGetPosEx(devicePrivate->joystickID, &info);
|
||||
if (result == JOYERR_UNPLUGGED) {
|
||||
Gamepad_eventDispatcher()->dispatchEvent(Gamepad_eventDispatcher(), GAMEPAD_EVENT_DEVICE_REMOVED, device);
|
||||
|
||||
disposeDevice(device);
|
||||
numDevices--;
|
||||
for (; deviceIndex < numDevices; deviceIndex++) {
|
||||
devices[deviceIndex] = devices[deviceIndex + 1];
|
||||
}
|
||||
|
||||
} else if (result == JOYERR_NOERROR) {
|
||||
if (info.dwXpos != devicePrivate->lastState.dwXpos) {
|
||||
handleAxisChange(device, devicePrivate->xAxisIndex, info.dwXpos);
|
||||
}
|
||||
if (info.dwYpos != devicePrivate->lastState.dwYpos) {
|
||||
handleAxisChange(device, devicePrivate->yAxisIndex, info.dwYpos);
|
||||
}
|
||||
if (info.dwZpos != devicePrivate->lastState.dwZpos) {
|
||||
handleAxisChange(device, devicePrivate->zAxisIndex, info.dwZpos);
|
||||
}
|
||||
if (info.dwRpos != devicePrivate->lastState.dwRpos) {
|
||||
handleAxisChange(device, devicePrivate->rAxisIndex, info.dwRpos);
|
||||
}
|
||||
if (info.dwUpos != devicePrivate->lastState.dwUpos) {
|
||||
handleAxisChange(device, devicePrivate->uAxisIndex, info.dwUpos);
|
||||
}
|
||||
if (info.dwVpos != devicePrivate->lastState.dwVpos) {
|
||||
handleAxisChange(device, devicePrivate->vAxisIndex, info.dwVpos);
|
||||
}
|
||||
if (info.dwPOV != devicePrivate->lastState.dwPOV) {
|
||||
handlePOVChange(device, devicePrivate->lastState.dwPOV, info.dwPOV);
|
||||
}
|
||||
if (info.dwButtons != devicePrivate->lastState.dwButtons) {
|
||||
handleButtonChange(device, devicePrivate->lastState.dwButtons, info.dwButtons);
|
||||
}
|
||||
devicePrivate->lastState = info;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
128
internal/c/parts/input/game_controller/src/gamepad/Gamepad.h
Normal file
128
internal/c/parts/input/game_controller/src/gamepad/Gamepad.h
Normal file
|
@ -0,0 +1,128 @@
|
|||
/*
|
||||
Copyright (c) 2010 Alex Diener
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
Alex Diener adiener@sacredsoftware.net
|
||||
*/
|
||||
|
||||
#ifndef __GAMEPAD_H__
|
||||
#define __GAMEPAD_H__
|
||||
|
||||
#include <stdbool.h>
|
||||
#include "utilities/EventDispatcher.h"
|
||||
|
||||
// eventData -> struct Gamepad_device
|
||||
#define GAMEPAD_EVENT_DEVICE_ATTACHED "GAMEPAD_EVENT_DEVICE_ATTACHED" // Only dispatched when Gamepad_init or Gamepad_detectDevices is called
|
||||
#define GAMEPAD_EVENT_DEVICE_REMOVED "GAMEPAD_EVENT_DEVICE_REMOVED" // Can be dispatched at any time
|
||||
|
||||
// eventData -> struct Gamepad_buttonEvent
|
||||
#define GAMEPAD_EVENT_BUTTON_DOWN "GAMEPAD_EVENT_BUTTON_DOWN" // Only dispatched when Gamepad_processEvents is called
|
||||
#define GAMEPAD_EVENT_BUTTON_UP "GAMEPAD_EVENT_BUTTON_UP" // Only dispatched when Gamepad_processEvents is called
|
||||
|
||||
// eventData -> struct Gamepad_axisEvent
|
||||
#define GAMEPAD_EVENT_AXIS_MOVED "GAMEPAD_EVENT_AXIS_MOVED" // Only dispatched when Gamepad_processEvents is called
|
||||
|
||||
struct Gamepad_buttonEvent {
|
||||
// Device that generated the event
|
||||
struct Gamepad_device * device;
|
||||
|
||||
// Relative time of the event, in seconds
|
||||
double timestamp;
|
||||
|
||||
// Button being pushed or released
|
||||
unsigned int buttonID;
|
||||
|
||||
// True if button is down
|
||||
bool down;
|
||||
};
|
||||
|
||||
struct Gamepad_axisEvent {
|
||||
// Device that generated the event
|
||||
struct Gamepad_device * device;
|
||||
|
||||
// Relative time of the event, in seconds
|
||||
double timestamp;
|
||||
|
||||
// Axis being moved
|
||||
unsigned int axisID;
|
||||
|
||||
// Axis position value, in the range [-1..1]
|
||||
float value;
|
||||
};
|
||||
|
||||
struct Gamepad_device {
|
||||
// Unique device identifier for application session. If a device is removed and subsequently reattached during the same application session, it will have a new deviceID.
|
||||
unsigned int deviceID;
|
||||
|
||||
// Human-readable device name
|
||||
const char * description;
|
||||
|
||||
// USB vendor/product IDs as returned by the driver. Can be used to determine the particular model of device represented.
|
||||
int vendorID;
|
||||
int productID;
|
||||
|
||||
// Number of axis elements belonging to the device
|
||||
unsigned int numAxes;
|
||||
|
||||
// Number of button elements belonging to the device
|
||||
unsigned int numButtons;
|
||||
|
||||
// Array[numAxes] of values representing the current state of each axis, in the range [-1..1]
|
||||
float * axisStates;
|
||||
|
||||
// Array[numButtons] of values representing the current state of each button
|
||||
bool * buttonStates;
|
||||
|
||||
// Broadcasts GAMEPAD_EVENT_BUTTON_DOWN, GAMEPAD_EVENT_BUTTON_UP, and GAMEPAD_EVENT_AXIS_MOVED
|
||||
EventDispatcher * eventDispatcher;
|
||||
|
||||
// Platform-specific device data storage; don't mess with it
|
||||
void * privateData;
|
||||
};
|
||||
|
||||
/* Initializes gamepad library and detects initial devices. Call this before any other Gamepad_*()
|
||||
function, EXCEPT Gamepad_eventDispatcher(). In order to get receive GAMEPAD_EVENT_DEVICE_ATTACHED
|
||||
events from devices detected in Gamepad_init(), you must register handlers for those events before
|
||||
calling Gamepad_init(). */
|
||||
void Gamepad_init();
|
||||
|
||||
/* Tears down all data structures created by the gamepad library and releases any memory that was
|
||||
allocated. It is not necessary to call this function at application termination. */
|
||||
void Gamepad_shutdown();
|
||||
|
||||
/* EventDispatcher used by gamepad library to broadcast GAMEPAD_EVENT_DEVICE_ATTACHED and
|
||||
GAMEPAD_EVENT_DEVICE_REMOVED events. */
|
||||
EventDispatcher * Gamepad_eventDispatcher();
|
||||
|
||||
/* Returns the number of currently attached gamepad devices. */
|
||||
unsigned int Gamepad_numDevices();
|
||||
|
||||
/* Returns the specified Gamepad_device struct, or NULL if deviceIndex is out of bounds. */
|
||||
struct Gamepad_device * Gamepad_deviceAtIndex(unsigned int deviceIndex);
|
||||
|
||||
/* Polls for any devices that have been attached since the last call to Gamepad_detectDevices() or
|
||||
Gamepad_init(). If any new devices are found, a GAMEPAD_EVENT_DEVICE_ATTACHED event will be
|
||||
broadcast via Gamepad_eventDispatcher() for each one. */
|
||||
void Gamepad_detectDevices();
|
||||
|
||||
/* Reads pending input from all attached devices and broadcasts GAMEPAD_EVENT_BUTTON_DOWN,
|
||||
GAMEPAD_EVENT_BUTTON_UP, and GAMEPAD_EVENT_AXIS_MOVED events through the eventDispatcher of the
|
||||
device that generated the event. */
|
||||
void Gamepad_processEvents();
|
||||
|
||||
#endif
|
10
internal/c/parts/input/game_controller/src/shell/Shell.h
Normal file
10
internal/c/parts/input/game_controller/src/shell/Shell.h
Normal file
|
@ -0,0 +1,10 @@
|
|||
#ifndef __SHELL_H__
|
||||
#define __SHELL_H__
|
||||
|
||||
void Shell_mainLoop();
|
||||
void Shell_redisplay();
|
||||
|
||||
double Shell_getCurrentTime();
|
||||
const char * Shell_getResourcePath();
|
||||
|
||||
#endif
|
176
internal/c/parts/input/game_controller/src/shell/ShellKeyCodes.h
Normal file
176
internal/c/parts/input/game_controller/src/shell/ShellKeyCodes.h
Normal file
|
@ -0,0 +1,176 @@
|
|||
// Adapted from GameShell (http://onesadcookie.com/svn/GameShell/Source/Common/GSKeyCodesInternal.h). Thanks Keith!
|
||||
|
||||
#ifndef __SHELL_KEY_CODES_H__
|
||||
#define __SHELL_KEY_CODES_H__
|
||||
|
||||
#define KEYBOARD_A 0x04
|
||||
#define KEYBOARD_B 0x05
|
||||
#define KEYBOARD_C 0x06
|
||||
#define KEYBOARD_D 0x07
|
||||
#define KEYBOARD_E 0x08
|
||||
#define KEYBOARD_F 0x09
|
||||
#define KEYBOARD_G 0x0A
|
||||
#define KEYBOARD_H 0x0B
|
||||
#define KEYBOARD_I 0x0C
|
||||
#define KEYBOARD_J 0x0D
|
||||
#define KEYBOARD_K 0x0E
|
||||
#define KEYBOARD_L 0x0F
|
||||
#define KEYBOARD_M 0x10
|
||||
#define KEYBOARD_N 0x11
|
||||
#define KEYBOARD_O 0x12
|
||||
#define KEYBOARD_P 0x13
|
||||
#define KEYBOARD_Q 0x14
|
||||
#define KEYBOARD_R 0x15
|
||||
#define KEYBOARD_S 0x16
|
||||
#define KEYBOARD_T 0x17
|
||||
#define KEYBOARD_U 0x18
|
||||
#define KEYBOARD_V 0x19
|
||||
#define KEYBOARD_W 0x1A
|
||||
#define KEYBOARD_X 0x1B
|
||||
#define KEYBOARD_Y 0x1C
|
||||
#define KEYBOARD_Z 0x1D
|
||||
#define KEYBOARD_1 0x1E
|
||||
#define KEYBOARD_2 0x1F
|
||||
#define KEYBOARD_3 0x20
|
||||
#define KEYBOARD_4 0x21
|
||||
#define KEYBOARD_5 0x22
|
||||
#define KEYBOARD_6 0x23
|
||||
#define KEYBOARD_7 0x24
|
||||
#define KEYBOARD_8 0x25
|
||||
#define KEYBOARD_9 0x26
|
||||
#define KEYBOARD_0 0x27
|
||||
#define KEYBOARD_RETURN_OR_ENTER 0x28
|
||||
#define KEYBOARD_ESCAPE 0x29
|
||||
#define KEYBOARD_DELETE_OR_BACKSPACE 0x2A
|
||||
#define KEYBOARD_TAB 0x2B
|
||||
#define KEYBOARD_SPACEBAR 0x2C
|
||||
#define KEYBOARD_HYPHEN 0x2D
|
||||
#define KEYBOARD_EQUAL_SIGN 0x2E
|
||||
#define KEYBOARD_OPEN_BRACKET 0x2F
|
||||
#define KEYBOARD_CLOSE_BRACKET 0x30
|
||||
#define KEYBOARD_BACKSLASH 0x31
|
||||
#define KEYBOARD_NON_USPOUND 0x32
|
||||
#define KEYBOARD_SEMICOLON 0x33
|
||||
#define KEYBOARD_QUOTE 0x34
|
||||
#define KEYBOARD_GRAVE_ACCENT_AND_TILDE 0x35
|
||||
#define KEYBOARD_COMMA 0x36
|
||||
#define KEYBOARD_PERIOD 0x37
|
||||
#define KEYBOARD_SLASH 0x38
|
||||
#define KEYBOARD_CAPS_LOCK 0x39
|
||||
#define KEYBOARD_F1 0x3A
|
||||
#define KEYBOARD_F2 0x3B
|
||||
#define KEYBOARD_F3 0x3C
|
||||
#define KEYBOARD_F4 0x3D
|
||||
#define KEYBOARD_F5 0x3E
|
||||
#define KEYBOARD_F6 0x3F
|
||||
#define KEYBOARD_F7 0x40
|
||||
#define KEYBOARD_F8 0x41
|
||||
#define KEYBOARD_F9 0x42
|
||||
#define KEYBOARD_F10 0x43
|
||||
#define KEYBOARD_F11 0x44
|
||||
#define KEYBOARD_F12 0x45
|
||||
#define KEYBOARD_PRINT_SCREEN 0x46
|
||||
#define KEYBOARD_SCROLL_LOCK 0x47
|
||||
#define KEYBOARD_PAUSE 0x48
|
||||
#define KEYBOARD_INSERT 0x49
|
||||
#define KEYBOARD_HOME 0x4A
|
||||
#define KEYBOARD_PAGE_UP 0x4B
|
||||
#define KEYBOARD_DELETE_FORWARD 0x4C
|
||||
#define KEYBOARD_END 0x4D
|
||||
#define KEYBOARD_PAGE_DOWN 0x4E
|
||||
#define KEYBOARD_RIGHT_ARROW 0x4F
|
||||
#define KEYBOARD_LEFT_ARROW 0x50
|
||||
#define KEYBOARD_DOWN_ARROW 0x51
|
||||
#define KEYBOARD_UP_ARROW 0x52
|
||||
#define KEYPAD_NUM_LOCK 0x53
|
||||
#define KEYPAD_SLASH 0x54
|
||||
#define KEYPAD_ASTERISK 0x55
|
||||
#define KEYPAD_HYPHEN 0x56
|
||||
#define KEYPAD_PLUS 0x57
|
||||
#define KEYPAD_ENTER 0x58
|
||||
#define KEYPAD_1 0x59
|
||||
#define KEYPAD_2 0x5A
|
||||
#define KEYPAD_3 0x5B
|
||||
#define KEYPAD_4 0x5C
|
||||
#define KEYPAD_5 0x5D
|
||||
#define KEYPAD_6 0x5E
|
||||
#define KEYPAD_7 0x5F
|
||||
#define KEYPAD_8 0x60
|
||||
#define KEYPAD_9 0x61
|
||||
#define KEYPAD_0 0x62
|
||||
#define KEYPAD_PERIOD 0x63
|
||||
#define KEYBOARD_NON_US_BACKSLASH 0x64
|
||||
#define KEYBOARD_APPLICATION 0x65
|
||||
#define KEYBOARD_POWER 0x66
|
||||
#define KEYPAD_EQUAL_SIGN 0x67
|
||||
#define KEYBOARD_F13 0x68
|
||||
#define KEYBOARD_F14 0x69
|
||||
#define KEYBOARD_F15 0x6A
|
||||
#define KEYBOARD_F16 0x6B
|
||||
#define KEYBOARD_F17 0x6C
|
||||
#define KEYBOARD_F18 0x6D
|
||||
#define KEYBOARD_F19 0x6E
|
||||
#define KEYBOARD_F20 0x6F
|
||||
#define KEYBOARD_F21 0x70
|
||||
#define KEYBOARD_F22 0x71
|
||||
#define KEYBOARD_F23 0x72
|
||||
#define KEYBOARD_F24 0x73
|
||||
#define KEYBOARD_EXECUTE 0x74
|
||||
#define KEYBOARD_HELP 0x75
|
||||
#define KEYBOARD_MENU 0x76
|
||||
#define KEYBOARD_SELECT 0x77
|
||||
#define KEYBOARD_STOP 0x78
|
||||
#define KEYBOARD_AGAIN 0x79
|
||||
#define KEYBOARD_UNDO 0x7A
|
||||
#define KEYBOARD_CUT 0x7B
|
||||
#define KEYBOARD_COPY 0x7C
|
||||
#define KEYBOARD_PASTE 0x7D
|
||||
#define KEYBOARD_FIND 0x7E
|
||||
#define KEYBOARD_MUTE 0x7F
|
||||
#define KEYBOARD_VOLUME_UP 0x80
|
||||
#define KEYBOARD_VOLUME_DOWN 0x81
|
||||
#define KEYBOARD_LOCKING_CAPS_LOCK 0x82
|
||||
#define KEYBOARD_LOCKING_NUM_LOCK 0x83
|
||||
#define KEYBOARD_LOCKING_SCROLL_LOCK 0x84
|
||||
#define KEYPAD_COMMA 0x85
|
||||
#define KEYPAD_EQUAL_SIGN_AS400 0x86
|
||||
#define KEYBOARD_INTERNATIONAL_1 0x87
|
||||
#define KEYBOARD_INTERNATIONAL_2 0x88
|
||||
#define KEYBOARD_INTERNATIONAL_3 0x89
|
||||
#define KEYBOARD_INTERNATIONAL_4 0x8A
|
||||
#define KEYBOARD_INTERNATIONAL_5 0x8B
|
||||
#define KEYBOARD_INTERNATIONAL_6 0x8C
|
||||
#define KEYBOARD_INTERNATIONAL_7 0x8D
|
||||
#define KEYBOARD_INTERNATIONAL_8 0x8E
|
||||
#define KEYBOARD_INTERNATIONAL_9 0x8F
|
||||
#define KEYBOARD_LANG1 0x90
|
||||
#define KEYBOARD_LANG2 0x91
|
||||
#define KEYBOARD_LANG3 0x92
|
||||
#define KEYBOARD_LANG4 0x93
|
||||
#define KEYBOARD_LANG5 0x94
|
||||
#define KEYBOARD_LANG6 0x95
|
||||
#define KEYBOARD_LANG7 0x96
|
||||
#define KEYBOARD_LANG8 0x97
|
||||
#define KEYBOARD_LANG9 0x98
|
||||
#define KEYBOARD_ALTERNATE_ERASE 0x99
|
||||
#define KEYBOARD_SYS_REQ_OR_ATTENTION 0x9A
|
||||
#define KEYBOARD_CANCEL 0x9B
|
||||
#define KEYBOARD_CLEAR 0x9C
|
||||
#define KEYBOARD_PRIOR 0x9D
|
||||
#define KEYBOARD_RETURN 0x9E
|
||||
#define KEYBOARD_SEPARATOR 0x9F
|
||||
#define KEYBOARD_OUT 0xA0
|
||||
#define KEYBOARD_OPER 0xA1
|
||||
#define KEYBOARD_CLEAR_OR_AGAIN 0xA2
|
||||
#define KEYBOARD_CR_SEL_OR_PROPS 0xA3
|
||||
#define KEYBOARD_EX_SEL 0xA4
|
||||
#define KEYBOARD_LEFT_CONTROL 0xE0
|
||||
#define KEYBOARD_LEFT_SHIFT 0xE1
|
||||
#define KEYBOARD_LEFT_ALT 0xE2
|
||||
#define KEYBOARD_LEFT_GUI 0xE3
|
||||
#define KEYBOARD_RIGHT_CONTROL 0xE4
|
||||
#define KEYBOARD_RIGHT_SHIFT 0xE5
|
||||
#define KEYBOARD_RIGHT_ALT 0xE6
|
||||
#define KEYBOARD_RIGHT_GUI 0xE7
|
||||
|
||||
#endif
|
18
internal/c/parts/input/game_controller/src/shell/Target.h
Normal file
18
internal/c/parts/input/game_controller/src/shell/Target.h
Normal file
|
@ -0,0 +1,18 @@
|
|||
#ifndef __TARGET_H__
|
||||
#define __TARGET_H__
|
||||
|
||||
const char * Target_getName();
|
||||
|
||||
void Target_init(int argc, char ** argv);
|
||||
void Target_draw();
|
||||
|
||||
void Target_keyDown(int charCode, int keyCode);
|
||||
void Target_keyUp(int charCode, int keyCode);
|
||||
void Target_mouseDown(int buttonNumber, float x, float y);
|
||||
void Target_mouseUp(int buttonNumber, float x, float y);
|
||||
void Target_mouseMoved(float x, float y);
|
||||
void Target_mouseDragged(int buttonMask, float x, float y);
|
||||
|
||||
void Target_resized(int newWidth, int newHeight);
|
||||
|
||||
#endif
|
|
@ -0,0 +1,122 @@
|
|||
/*
|
||||
Copyright (c) 2010 Alex Diener
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
Alex Diener adiener@sacredsoftware.net
|
||||
*/
|
||||
|
||||
#include "utilities/EventDispatcher.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
struct EventTarget {
|
||||
char * eventID;
|
||||
EventDispatcherCallback callback;
|
||||
void * context;
|
||||
};
|
||||
|
||||
EventDispatcher * EventDispatcher_create(void * owner) {
|
||||
EventDispatcher * self;
|
||||
|
||||
self = malloc(sizeof(EventDispatcher));
|
||||
EventDispatcher_init(self, owner);
|
||||
return self;
|
||||
}
|
||||
|
||||
void EventDispatcher_init(EventDispatcher * self, void * owner) {
|
||||
self->dispose = EventDispatcher_dispose;
|
||||
self->registerForEvent = EventDispatcher_registerForEvent;
|
||||
self->unregisterForEvent = EventDispatcher_unregisterForEvent;
|
||||
self->dispatchEvent = EventDispatcher_dispatchEvent;
|
||||
|
||||
self->owner = owner;
|
||||
self->numberOfTargets = 0;
|
||||
self->targetListSize = 1;
|
||||
self->targets = (struct EventTarget *) malloc(sizeof(struct EventTarget) * self->targetListSize);
|
||||
}
|
||||
|
||||
void EventDispatcher_dispose(void * selfPtr) {
|
||||
EventDispatcher * self = selfPtr;
|
||||
int targetIndex;
|
||||
|
||||
for (targetIndex = 0; targetIndex < self->numberOfTargets; targetIndex++) {
|
||||
free(self->targets[targetIndex].eventID);
|
||||
}
|
||||
free(self->targets);
|
||||
}
|
||||
|
||||
void EventDispatcher_registerForEvent(void * selfPtr, const char * eventID, EventDispatcherCallback callback, void * context) {
|
||||
EventDispatcher * self = selfPtr;
|
||||
size_t length;
|
||||
|
||||
if (self->numberOfTargets >= self->targetListSize) {
|
||||
self->targetListSize *= 2;
|
||||
self->targets = (struct EventTarget *) realloc(self->targets, sizeof(struct EventTarget) * self->targetListSize);
|
||||
}
|
||||
|
||||
length = strlen(eventID);
|
||||
self->targets[self->numberOfTargets].eventID = malloc(length + 1);
|
||||
strncpy(self->targets[self->numberOfTargets].eventID, eventID, length + 1);
|
||||
self->targets[self->numberOfTargets].callback = callback;
|
||||
self->targets[self->numberOfTargets].context = context;
|
||||
self->numberOfTargets++;
|
||||
}
|
||||
|
||||
void EventDispatcher_unregisterForEvent(void * selfPtr, const char * eventID, EventDispatcherCallback callback) {
|
||||
EventDispatcher * self = selfPtr;
|
||||
int targetIndex;
|
||||
|
||||
for (targetIndex = 0; targetIndex < self->numberOfTargets; targetIndex++) {
|
||||
if (!strcmp(eventID, self->targets[targetIndex].eventID) && self->targets[targetIndex].callback == callback) {
|
||||
free(self->targets[targetIndex].eventID);
|
||||
self->numberOfTargets--;
|
||||
for (; targetIndex < self->numberOfTargets; targetIndex++) {
|
||||
self->targets[targetIndex] = self->targets[targetIndex + 1];
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool EventDispatcher_dispatchEvent(void * selfPtr, const char * eventID, void * eventData) {
|
||||
EventDispatcher * self = selfPtr;
|
||||
int targetIndex;
|
||||
int numberOfTargetsCopy;
|
||||
struct EventTarget * targetsCopy;
|
||||
bool eventHandled, anyEventsHandled;
|
||||
|
||||
numberOfTargetsCopy = self->numberOfTargets;
|
||||
targetsCopy = malloc(sizeof(struct EventTarget) * numberOfTargetsCopy);
|
||||
memcpy(targetsCopy, self->targets, sizeof(struct EventTarget) * numberOfTargetsCopy);
|
||||
|
||||
anyEventsHandled = false;
|
||||
for (targetIndex = 0; targetIndex < numberOfTargetsCopy; targetIndex++) {
|
||||
if (!strcmp(eventID, self->targets[targetIndex].eventID)) {
|
||||
eventHandled = targetsCopy[targetIndex].callback(self->owner, eventID, eventData, targetsCopy[targetIndex].context);
|
||||
|
||||
if (eventHandled) {
|
||||
anyEventsHandled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
free(targetsCopy);
|
||||
|
||||
return anyEventsHandled;
|
||||
}
|
|
@ -0,0 +1,80 @@
|
|||
/*
|
||||
Copyright (c) 2010 Alex Diener
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
Alex Diener adiener@sacredsoftware.net
|
||||
*/
|
||||
|
||||
#ifndef __EVENT_DISPATCHER_H__
|
||||
#define __EVENT_DISPATCHER_H__
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
typedef struct EventDispatcher EventDispatcher;
|
||||
|
||||
/* Signature for event handler callbacks.
|
||||
|
||||
sender: Object that dispatched the event. More specifically, the object passed to EventDispatcher_create.
|
||||
eventID: Name of event that was triggered
|
||||
eventData: Arbitrary data passed by dispatcher. Its format is known by convention depending on the event ID being dispatched.
|
||||
context: Value passed as context to registerForEvent
|
||||
|
||||
This function should return true if the event was handled, or false if it was ignored. */
|
||||
typedef bool (* EventDispatcherCallback)(void * sender, const char * eventID, void * eventData, void * context);
|
||||
|
||||
struct EventTarget;
|
||||
|
||||
#define EventDispatcher_structContents \
|
||||
void * owner; \
|
||||
\
|
||||
int numberOfTargets; \
|
||||
int targetListSize; \
|
||||
struct EventTarget * targets; \
|
||||
\
|
||||
void (* dispose)(void * self); \
|
||||
void (* registerForEvent)(void * self, const char * eventID, EventDispatcherCallback callback, void * context); \
|
||||
void (* unregisterForEvent)(void * self, const char * eventID, EventDispatcherCallback callback); \
|
||||
bool (* dispatchEvent)(void * self, const char * eventID, void * eventData);
|
||||
|
||||
struct EventDispatcher {
|
||||
EventDispatcher_structContents
|
||||
};
|
||||
|
||||
/* Allocate and initialize a new EventDispatcher object. owner will be passed to event callbacks as
|
||||
the sender parameter. */
|
||||
EventDispatcher * EventDispatcher_create(void * owner);
|
||||
|
||||
/* Initialize an already allocated EventDispatcher. owner will be passed to event callbacks as the
|
||||
sender parameter. */
|
||||
void EventDispatcher_init(EventDispatcher * self, void * owner);
|
||||
|
||||
/* Free all memory allocated by EventDispatcher and remove all registered listeners. Does NOT free
|
||||
the EventDispatcher itself. */
|
||||
void EventDispatcher_dispose(void * selfPtr);
|
||||
|
||||
/* Register for notification of events of type eventID */
|
||||
void EventDispatcher_registerForEvent(void * selfPtr, const char * eventID, EventDispatcherCallback callback, void * context);
|
||||
|
||||
/* Remove a previous registration for events of type eventID */
|
||||
void EventDispatcher_unregisterForEvent(void * selfPtr, const char * eventID, EventDispatcherCallback callback);
|
||||
|
||||
/* Dispatch an event to all registered listeners for that event ID. Returns true if any listener is
|
||||
registered and returns true from its handler callback. */
|
||||
bool EventDispatcher_dispatchEvent(void * selfPtr, const char * eventID, void * eventData);
|
||||
|
||||
#endif
|
|
@ -0,0 +1,20 @@
|
|||
Copyright (C) 2004 Richard Wilson
|
||||
Copyright (C) 2008 Sean Fox
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
|
@ -0,0 +1,33 @@
|
|||
# Component settings
|
||||
COMPONENT := nsgif
|
||||
COMPONENT_VERSION := 0.0.3
|
||||
# Default to a static library
|
||||
COMPONENT_TYPE ?= lib-static
|
||||
|
||||
# Setup the tooling
|
||||
include build/makefiles/Makefile.tools
|
||||
|
||||
# Toolchain flags
|
||||
WARNFLAGS := -Wall -W -Wundef -Wpointer-arith -Wcast-align \
|
||||
-Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \
|
||||
-Wmissing-declarations -Wnested-externs -pedantic
|
||||
# BeOS/Haiku standard library headers create warnings
|
||||
ifneq ($(TARGET),beos)
|
||||
WARNFLAGS := $(WARNFLAGS) -Werror
|
||||
endif
|
||||
CFLAGS := -D_BSD_SOURCE -I$(CURDIR)/include/ \
|
||||
-I$(CURDIR)/src $(WARNFLAGS) $(CFLAGS)
|
||||
ifneq ($(GCCVER),2)
|
||||
CFLAGS := $(CFLAGS) -std=c99
|
||||
else
|
||||
# __inline__ is a GCCism
|
||||
CFLAGS := $(CFLAGS) -Dinline="__inline__"
|
||||
endif
|
||||
|
||||
include build/makefiles/Makefile.top
|
||||
|
||||
# Extra installation rules
|
||||
I := /include
|
||||
INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):include/libnsgif.h
|
||||
INSTALL_ITEMS := $(INSTALL_ITEMS) /lib/pkgconfig:lib$(COMPONENT).pc.in
|
||||
INSTALL_ITEMS := $(INSTALL_ITEMS) /lib:$(OUTPUT)
|
|
@ -0,0 +1,50 @@
|
|||
# Clang-specific toolchain setup
|
||||
# We assume that we're using a standard GCC/binutils environment, as well
|
||||
# as clang being mostly GCC-compatible on the command line
|
||||
|
||||
CCDEF := -D
|
||||
CCOPT := -O2
|
||||
CCNOOPT := -O0
|
||||
CCDBG := -g
|
||||
CCINC := -I
|
||||
CCLIB := -L
|
||||
CCAS := -xassembler-with-cpp
|
||||
CCSHR := -fPIC
|
||||
|
||||
CXXDEF := -D
|
||||
CXXOPT := -O2
|
||||
CXXNOOPT := -O0
|
||||
CXXDBG := -g
|
||||
CXXINC := -I
|
||||
CXXLIB := -L
|
||||
CXXSHR := -fPIC
|
||||
|
||||
LDDBG := -g
|
||||
# Reevaluation is required here
|
||||
LDSHR = -shared -Wl,-soname,$(SONAME)
|
||||
|
||||
ARFLG := cru
|
||||
|
||||
# Definitions of various attributes
|
||||
CFLAGS := $(CFLAGS) -D_ALIGNED=""
|
||||
|
||||
###############################################################################
|
||||
# Mac OS X Universal Binaries
|
||||
###############################################################################
|
||||
|
||||
ifeq ($(TARGET),Darwin)
|
||||
ifneq ($(UNIVERSAL),)
|
||||
UNIVERSAL_FLAGS := $(foreach arch,$(UNIVERSAL),-arch $(arch) )
|
||||
|
||||
CFLAGS := $(CFLAGS) $(UNIVERSAL_FLAGS)
|
||||
LDFLAGS := $(LDFLAGS) $(UNIVERSAL_FLAGS)
|
||||
CXXFLAGS := $(CXXFLAGS) $(UNIVERSAL_FLAGS)
|
||||
ARFLAGS := $(ARFLAGS) -s
|
||||
endif
|
||||
endif
|
||||
|
||||
###############################################################################
|
||||
# Other settings
|
||||
###############################################################################
|
||||
|
||||
CC_CAN_BUILD_AND_DEP ?= yes
|
|
@ -0,0 +1,95 @@
|
|||
# GCC specific toolchain setup
|
||||
# We assume that we're using a standard GCC/binutils environment
|
||||
|
||||
CCDEF := -D
|
||||
CCOPT := -O2
|
||||
CCNOOPT := -O0
|
||||
CCDBG := -g
|
||||
CCINC := -I
|
||||
CCLIB := -L
|
||||
CCAS := -xassembler-with-cpp
|
||||
CCSHR := -fPIC
|
||||
|
||||
CXXDEF := -D
|
||||
CXXOPT := -O2
|
||||
CXXNOOPT := -O0
|
||||
CXXDBG := -g
|
||||
CXXINC := -I
|
||||
CXXLIB := -L
|
||||
CXXSHR := -fPIC
|
||||
|
||||
LDDBG := -g
|
||||
# Reevaluation is required here
|
||||
LDSHR = -shared -Wl,-soname,$(SONAME)
|
||||
|
||||
ARFLG := cru
|
||||
|
||||
# Definitions for various attributes
|
||||
CFLAGS := $(CFLAGS) -D_ALIGNED="__attribute__((aligned))"
|
||||
|
||||
# Extensions for coverage target
|
||||
ifeq ($(MAKECMDGOALS),coverage)
|
||||
COVCFLAGS ?= -fprofile-arcs -ftest-coverage
|
||||
COVCXXFLAGS ?= -fprofile-arcs -ftest-coverage
|
||||
COVLDFLAGS ?= -lgcov
|
||||
|
||||
CFLAGS := $(CFLAGS) $(COVCFLAGS)
|
||||
CXXFLAGS := $(CXXFLAGS) $(COVCXXFLAGS)
|
||||
LDFLAGS := $(LDFLAGS) $(COVLDFLAGS)
|
||||
endif
|
||||
|
||||
# Extensions for profile target
|
||||
ifeq ($(MAKECMDGOALS),profile)
|
||||
PROFCFLAGS ?= -pg
|
||||
PROFCXXFLAGS ?= -pg
|
||||
PROFLDFLAGS ?= -pg
|
||||
|
||||
CFLAGS := $(CFLAGS) $(PROFCFLAGS)
|
||||
CXXFLAGS := $(CXXFLAGS) $(PROFCXXFLAGS)
|
||||
LDFLAGS := $(LDFLAGS) $(PROFLDFLAGS)
|
||||
endif
|
||||
|
||||
# RISC OS module extensions
|
||||
ifeq ($(COMPONENT_TYPE),riscos-module)
|
||||
ifneq ($(TARGET),riscos)
|
||||
$(error Attempting to build a RISC OS module for a non-RISC OS target)
|
||||
endif
|
||||
|
||||
CFLAGS := $(CFLAGS) -mmodule
|
||||
CXXFLAGS := $(CXXFLAGS) -mmodule
|
||||
LDFLAGS := $(LDFLAGS) -mmodule
|
||||
endif
|
||||
|
||||
###############################################################################
|
||||
# Mac OS X Universal Binaries
|
||||
###############################################################################
|
||||
|
||||
ifeq ($(TARGET),Darwin)
|
||||
ifneq ($(UNIVERSAL),)
|
||||
UNIVERSAL_FLAGS := $(foreach arch,$(UNIVERSAL),-arch $(arch) )
|
||||
CC_CAN_BUILD_AND_DEP := no
|
||||
CC_CANNOT_DEP := yes
|
||||
|
||||
CFLAGS := $(CFLAGS) $(UNIVERSAL_FLAGS)
|
||||
LDFLAGS := $(LDFLAGS) $(UNIVERSAL_FLAGS)
|
||||
CXXFLAGS := $(CXXFLAGS) $(UNIVERSAL_FLAGS)
|
||||
ARFLAGS := $(ARFLAGS) -s
|
||||
endif
|
||||
endif
|
||||
|
||||
###############################################################################
|
||||
# Other settings
|
||||
###############################################################################
|
||||
|
||||
# Determine if the compiler supports simultaneous build & dep.
|
||||
ccvsn := $(shell $(CC) -dumpversion)
|
||||
# ccvsn = x.y.z
|
||||
GCCVER := $(word 1,$(subst ., ,$(ccvsn)))
|
||||
# GCCVER = x
|
||||
|
||||
# If the major version (x, above) is not 2, then assume build & dep.
|
||||
# This will break if using a version of GCC < 2, but that's unlikely.
|
||||
ifneq ($(GCCVER),2)
|
||||
CC_CAN_BUILD_AND_DEP ?= yes
|
||||
endif
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
# Norcroft specific toolchain setup
|
||||
|
||||
CCDEF := -D
|
||||
CCOPT := -Otime
|
||||
CCNOOPT :=
|
||||
CCDBG := -g
|
||||
CCINC := -I
|
||||
CCLIB := -L
|
||||
# TODO: Norcroft CC cannot do assembler as C
|
||||
CCAS :=
|
||||
CCSHR :=
|
||||
|
||||
CXXDEF := -D
|
||||
CXXOPT := -O2
|
||||
CXXNOOPT := -O0
|
||||
CXXDBG := -g
|
||||
CXXINC := -I
|
||||
CXXLIB := -L
|
||||
CXXSHR := -fPIC
|
||||
|
||||
LDDBG := -g
|
||||
LDSHR :=
|
||||
|
||||
ARFLG := -c
|
||||
|
||||
# Definitions of various attributes
|
||||
CFLAGS := $(CFLAGS) -D_ALIGNED=""
|
||||
|
||||
# Extensions for coverage target
|
||||
ifeq ($(MAKECMDGOALS),coverage)
|
||||
$(error Coverage is not supported with Norcroft)
|
||||
endif
|
||||
|
||||
# Extensions for profile target
|
||||
ifeq ($(MAKECMDGOALS),profile)
|
||||
$(error Profile is not supported with Norcroft)
|
||||
endif
|
||||
|
||||
# RISC OS module extensions
|
||||
ifeq ($(COMPONENT_TYPE),riscos-module)
|
||||
ifneq ($(TARGET),riscos)
|
||||
$(error Attempting to build a RISC OS module for a non-RISC OS target)
|
||||
endif
|
||||
|
||||
CFLAGS := $(CFLAGS) -zM
|
||||
CXXFLAGS := $(CXXFLAGS) -zM
|
||||
LDFLAGS := $(LDFLAGS) -zM
|
||||
endif
|
||||
|
||||
###############################################################################
|
||||
# Other settings
|
||||
###############################################################################
|
||||
|
||||
# Determine if the compiler supports simultaneous build & dep.
|
||||
CC_CANNOT_DEP := yes
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
# General purpose pkg-config macros
|
||||
|
||||
# Determine if a package is available
|
||||
# 1: Name of variable to assign result into
|
||||
# 2: Name of package to search for
|
||||
define pkg_config_package_available
|
||||
ifeq ($$(PKGCONFIG),)
|
||||
$$(error pkg-config is required to auto-detect package availability)
|
||||
endif
|
||||
|
||||
ifeq ($$(shell $$(PKGCONFIG) --exists $(2) && echo yes),yes)
|
||||
$(1) := yes
|
||||
else
|
||||
$(1) := no
|
||||
endif
|
||||
|
||||
endef
|
||||
|
||||
# Retrieve the version of a package
|
||||
# 1: Name of variable to assign result into
|
||||
# 2: Name of package to search for
|
||||
define pkg_config_package_version
|
||||
ifeq ($$(PKGCONFIG),)
|
||||
$$(error pkg-config is required to auto-detect package version)
|
||||
endif
|
||||
|
||||
$(1) := $$(shell $$(PKGCONFIG) --version $(2))
|
||||
|
||||
endef
|
||||
|
||||
# Test the presence of a minimum version of a package
|
||||
# 1: Name of variable to assign result into
|
||||
# 2: Name of package to search for
|
||||
# 3: Lowest accepted version number
|
||||
define pkg_config_package_min_version
|
||||
ifeq ($$(PKGCONFIG),)
|
||||
$$(error pkg-config is required to auto-detect package version)
|
||||
endif
|
||||
|
||||
ifeq ($$(shell $$(PKGCONFIG) --atleast-version=$(3) $(2) && echo yes),yes)
|
||||
$(1) := yes
|
||||
else
|
||||
$(1) := no
|
||||
endif
|
||||
|
||||
endef
|
||||
|
||||
# Test the presence of a minimum version of a package
|
||||
# 1: Name of variable to assign result into
|
||||
# 2: Name of package to search for
|
||||
# 3: Lowest accepted version number
|
||||
# 4: Highest accepted version number
|
||||
define pkg_config_package_compare_version
|
||||
ifeq ($$(PKGCONFIG),)
|
||||
$$(error pkg-config is required to auto-detect package version)
|
||||
endif
|
||||
|
||||
ifeq ($$(shell $$(PKGCONFIG) --atleast-version=$(3) $(2) && echo yes),yes)
|
||||
ifeq ($$(shell $$(PKGCONFIG) --max-version=$(4) $(2) && echo yes),yes)
|
||||
$(1) := yes
|
||||
else
|
||||
$(1) := no
|
||||
endif
|
||||
else
|
||||
$(1) := no
|
||||
endif
|
||||
|
||||
endef
|
||||
|
||||
# Add package to compiler/linker flags
|
||||
# 1: Name of package to add details of
|
||||
# 2: CFLAGS variable to extend, or none
|
||||
# 3: LDFLAGS variable to extend, or none
|
||||
define pkg_config_package_add_flags
|
||||
ifeq ($$(PKGCONFIG),)
|
||||
$$(error pkg-config is required to auto-detect package version)
|
||||
endif
|
||||
|
||||
ifneq ($(2),)
|
||||
$(2) := $$($(2)) $$(shell $$(PKGCONFIG) --cflags $(1))
|
||||
endif
|
||||
|
||||
ifneq ($(3),)
|
||||
$(3) := $$($(3)) $$(shell $$(PKGCONFIG) --libs $(1))
|
||||
endif
|
||||
|
||||
endef
|
||||
|
|
@ -0,0 +1,132 @@
|
|||
# Child makefile fragment
|
||||
#
|
||||
# Inputs (reset on exit)
|
||||
#
|
||||
# DIR_SOURCES List of source files in this directory
|
||||
# DIR_TEST_ITEMS List of test items in this directory
|
||||
# DIR_INSTALL_ITEMS Items to install in form <destination>:<file1>;<file2>
|
||||
#
|
||||
# Toolchain is provided by top-level makefile
|
||||
#
|
||||
# Variables provided by top-level makefile
|
||||
#
|
||||
# BUILDDIR The location of the build tree root
|
||||
# COMPONENT The name of the component
|
||||
# CURDIR The location of the source tree root
|
||||
# EXPORTDIR The location of the export directory
|
||||
# WANT_TEST Whether to build testcases
|
||||
#
|
||||
# do_include Canned command sequence to include a child makefile
|
||||
#
|
||||
# Variables provided by parent makefile:
|
||||
#
|
||||
# DIR The name of the directory we're in, relative to CURDIR
|
||||
#
|
||||
# Variables we can manipulate:
|
||||
#
|
||||
# CLEAN_ITEMS The list of items to remove for "make clean"
|
||||
# DISTCLEAN_ITEMS The list of items to remove for "make distclean"
|
||||
# TEST_ITEMS The list of items to build for "make test"
|
||||
# TEST_TARGETS The list of target names to run for "make test"
|
||||
# INSTALL_ITEMS The list of items to (un)install
|
||||
#
|
||||
# SOURCES The list of sources to build for $(COMPONENT)
|
||||
#
|
||||
# Plus anything from the toolchain
|
||||
|
||||
# Push parent directory onto the directory stack
|
||||
sp := $(sp).x
|
||||
dirstack_$(sp) := $(d)
|
||||
d := $(DIR)
|
||||
|
||||
# Sources
|
||||
SRCS_$(d) := $(DIR_SOURCES)
|
||||
TEST_ITEMS_$(d) :=
|
||||
INSTALL_ITEMS_$(d) :=
|
||||
|
||||
# Append to sources for component
|
||||
SOURCES := $(SOURCES) $(addprefix $(d), $(SRCS_$(d)))
|
||||
|
||||
# Test sources
|
||||
ifeq ($(WANT_TEST),yes)
|
||||
ifneq ($(DIR_TEST_ITEMS),)
|
||||
# Extract the binary name from the ITEM
|
||||
binary = $(subst /,_,$(addprefix $(d),$(firstword $(subst :, ,$(ITEM)))))
|
||||
# Extract the list of sources from the ITEM
|
||||
sources = $(subst ;, ,$(lastword $(subst :, ,$(ITEM))))
|
||||
|
||||
# We can't simply use the output of foreach here,
|
||||
# as it space separates its output, which kinda defeats the point.
|
||||
define append_test_src
|
||||
TEST_ITEMS_$(d) := $$(TEST_ITEMS_$(d))$1;
|
||||
|
||||
endef
|
||||
|
||||
define append_test
|
||||
TEST_ITEMS_$(d) := $$(TEST_ITEMS_$(d)) $1:
|
||||
|
||||
$$(eval $$(foreach TSRC,$2, \
|
||||
$$(call append_test_src,$$(addprefix $$(d),$$(TSRC)))))
|
||||
|
||||
endef
|
||||
|
||||
# Append test items, prepending $(d) to each source file
|
||||
$(eval $(foreach ITEM,$(DIR_TEST_ITEMS), \
|
||||
$(call append_test,$(binary),$(sources))))
|
||||
|
||||
TEST_ITEMS := $(TEST_ITEMS) $(TEST_ITEMS_$(d))
|
||||
|
||||
TEST_TARGETS := $(TEST_TARGETS) test_$(d)
|
||||
|
||||
# Extract the binary name from the TEST
|
||||
binary_name = $(firstword $(subst :, ,$(TEST)))
|
||||
|
||||
# Target for tests in this directory
|
||||
test_$(d): $(d) $(addprefix $(BUILDDIR)/, \
|
||||
$(foreach TEST,$(TEST_ITEMS_$(d)),$(binary_name)))
|
||||
$(Q)$(SHAREDLDPATH) $(TESTRUNNER) $(BUILDDIR) \
|
||||
$(CURDIR)/$< $(subst /,_,$<) $(EXEEXT)
|
||||
endif
|
||||
endif
|
||||
|
||||
# Install items
|
||||
ifneq ($(DIR_INSTALL_ITEMS),)
|
||||
# Extract the destination directory from the variable
|
||||
dest_dir = $(firstword $(subst :, ,$(ITEM)))
|
||||
# Extract the list of files to install
|
||||
files = $(subst ;, ,$(lastword $(subst :, ,$(ITEM))))
|
||||
|
||||
define append_install_file
|
||||
INSTALL_ITEMS_$(d) := $$(INSTALL_ITEMS_$(d))$1;
|
||||
|
||||
endef
|
||||
|
||||
define append_install_item
|
||||
INSTALL_ITEMS_$(d) := $$(INSTALL_ITEMS_$(d)) $1:
|
||||
|
||||
$$(eval $$(foreach FILE,$2, \
|
||||
$$(call append_install_file,$$(addprefix $$(d),$$(FILE)))))
|
||||
|
||||
endef
|
||||
|
||||
# Append items to install (along with install location), prepending $(d)
|
||||
# to each item in the file list
|
||||
$(eval $(foreach ITEM,$(DIR_INSTALL_ITEMS), \
|
||||
$(call append_install_item,$(dest_dir),$(files))))
|
||||
|
||||
INSTALL_ITEMS := $(INSTALL_ITEMS) $(INSTALL_ITEMS_$(d))
|
||||
endif
|
||||
|
||||
# Reset the inputs
|
||||
DIR_SOURCES :=
|
||||
DIR_TEST_ITEMS :=
|
||||
DIR_INSTALL_ITEMS :=
|
||||
|
||||
# Now include any children we may have
|
||||
MAKE_INCLUDES := $(wildcard $(d)*/Makefile)
|
||||
$(eval $(foreach INC, $(MAKE_INCLUDES), $(call do_include,$(INC))))
|
||||
|
||||
# Pop off the directory stack
|
||||
d := $(dirstack_$(sp))
|
||||
sp := $(basename $(sp))
|
||||
|
|
@ -0,0 +1,469 @@
|
|||
# Tools Makefile fragment
|
||||
#
|
||||
# Expected inputs:
|
||||
#
|
||||
# COMPONENT_TYPE Type of component:
|
||||
# binary - Executable binary
|
||||
# lib-static - Static library
|
||||
# lib-shared - Shared library
|
||||
# riscos-module - RISC OS module
|
||||
#
|
||||
# Optional inputs:
|
||||
#
|
||||
# BUILD Type of build to perform:
|
||||
# release - Release build (default)
|
||||
# debug - Debug build
|
||||
# OPTCFLAGS Optional C compiler flags for $(BUILD)
|
||||
# OPTCXXFLAGS Optional C++ compiler flags for $(BUILD)
|
||||
# OPTLDFLAGS Optional linker flags for $(BUILD)
|
||||
# TARGET Target platform (defaults to host)
|
||||
# PREFIX Absolute installation path prefix
|
||||
# (defaults to /usr/local)
|
||||
#
|
||||
|
||||
###############################################################################
|
||||
# Sanity checks
|
||||
###############################################################################
|
||||
|
||||
ifeq ($(COMPONENT_TYPE),)
|
||||
$(error COMPONENT_TYPE not set)
|
||||
endif
|
||||
|
||||
# Default build to release
|
||||
ifeq ($(BUILD),)
|
||||
BUILD := release
|
||||
endif
|
||||
|
||||
###############################################################################
|
||||
# Host/target platform detection
|
||||
###############################################################################
|
||||
|
||||
# Autodetect host if necessary
|
||||
ifeq ($(HOST),)
|
||||
HOST := $(shell uname -s)
|
||||
endif
|
||||
|
||||
# Simple host sanitisation
|
||||
ifeq ($(HOST),)
|
||||
# Don't ask
|
||||
HOST := riscos
|
||||
else
|
||||
ifeq ($(HOST),RISC OS)
|
||||
HOST := riscos
|
||||
endif
|
||||
|
||||
ifeq ($(HOST),BeOS)
|
||||
HOST := beos
|
||||
endif
|
||||
ifeq ($(HOST),Haiku)
|
||||
HOST := haiku
|
||||
endif
|
||||
|
||||
ifeq ($(HOST),AmigaOS)
|
||||
HOST := amiga
|
||||
endif
|
||||
|
||||
ifeq ($(findstring MINGW,$(HOST)),MINGW)
|
||||
HOST := windows
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET),)
|
||||
# Default target to host. Please add exceptions as required.
|
||||
TARGET := $(HOST)
|
||||
|
||||
ifeq ($(HOST),haiku)
|
||||
# This isn't necessarily correct -- they have differences. However, in the
|
||||
# general case, this will work. If there are differences that are actually
|
||||
# important wrt the target platform (as opposed to the build host) then
|
||||
# we'll just have to introduce a haiku target, too.
|
||||
TARGET := beos
|
||||
endif
|
||||
endif
|
||||
|
||||
# Sanitise HOST and TARGET
|
||||
# TODO: Ideally, we want the equivalent of s/[^A-Za-z0-9]/_/g here
|
||||
HOST := $(subst .,_,$(subst -,_,$(subst /,_,$(HOST))))
|
||||
TARGET := $(subst .,_,$(subst -,_,$(subst /,_,$(TARGET))))
|
||||
|
||||
# Now setup our tooling
|
||||
ifeq ($(TARGET),riscos)
|
||||
ifeq ($(HOST),riscos)
|
||||
# Building on native RISC OS
|
||||
GCCSDK_INSTALL_ENV ?= <NSLibs$$Dir>
|
||||
|
||||
CC__ := gcc
|
||||
CXX__ := g++
|
||||
CMHG ?= cmunge
|
||||
GENHTML ?= echo
|
||||
LCOV ?= echo
|
||||
PKGCONFIG ?=
|
||||
# On certain versions of RISC OS (<>4 || kernel < 8.75),
|
||||
# the kernel will clean up the current redirection on
|
||||
# OS_Exit, including closing the associated file handles.
|
||||
# This is problematic for UnixLib, as it's invariably using
|
||||
# those filehandles in a pipe between parent and child processes.
|
||||
# This affects us as, anywhere where we shell out and want to
|
||||
# capture the output of the child process may fail.
|
||||
# Fortunately, if we know the child process is built against
|
||||
# UnixLib, then we also know that it won't call OS_Exit when it
|
||||
# exits, instead returning directly to our exit handler (and thus
|
||||
# preserving the redirection). This only works, however, if the
|
||||
# child application is specified using its absolute path, or
|
||||
# found in Run$Path. In the case of Perl, it does not appear in
|
||||
# Run$Path, so we must invoke it using its absolute path so that
|
||||
# the SharedUnixLibrary successfully detects it as a child process.
|
||||
PERL ?= <Perl$$Dir>.bin.perl
|
||||
|
||||
# This is nasty, but needed because $(CURDIR) will
|
||||
# contain colons, and thus confuse make mightily
|
||||
$(shell SetMacro Alias$$$(COMPONENT)pwd Set %0 <FileSwitch$$CurrentFilingSystem>:|<FileSwitch$$<FileSwitch$$CurrentFilingSystem>$$CSD>|mUnset Alias$$$(COMPONENT)pwd)
|
||||
$(shell $(COMPONENT)pwd $(COMPONENT)$$Dir)
|
||||
CURDIR := <$(COMPONENT)$$Dir>
|
||||
else
|
||||
# Cross compiling for RISC OS
|
||||
ifeq ($(origin GCCSDK_INSTALL_ENV),undefined)
|
||||
ifneq ($(realpath /opt/netsurf/arm-unknown-riscos/env),)
|
||||
GCCSDK_INSTALL_ENV := /opt/netsurf/arm-unknown-riscos/env
|
||||
else
|
||||
GCCSDK_INSTALL_ENV := /home/riscos/env
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(origin GCCSDK_INSTALL_CROSSBIN),undefined)
|
||||
ifneq ($(realpath /opt/netsurf/arm-unknown-riscos/cross/bin),)
|
||||
GCCSDK_INSTALL_CROSSBIN := /opt/netsurf/arm-unknown-riscos/cross/bin
|
||||
else
|
||||
GCCSDK_INSTALL_CROSSBIN := /home/riscos/cross/bin
|
||||
endif
|
||||
endif
|
||||
|
||||
AR__ := $(wildcard $(GCCSDK_INSTALL_CROSSBIN)/*ar)
|
||||
CC__ := $(wildcard $(GCCSDK_INSTALL_CROSSBIN)/*gcc)
|
||||
CXX__ := $(wildcard $(GCCSDK_INSTALL_CROSSBIN)/*g++)
|
||||
CMHG ?= PATH="$(GCCSDK_INSTALL_CROSSBIN):$(PATH)" $(GCCSDK_INSTALL_CROSSBIN)/cmunge
|
||||
GENHTML ?= echo
|
||||
LCOV ?= echo
|
||||
PKGCONFIG ?= PKG_CONFIG_LIBDIR="$(PREFIX)/lib/pkgconfig:$(GCCSDK_INSTALL_ENV)/lib/pkgconfig:$(GCCSDK_INSTALL_ENV)/share/pkgconfig" pkg-config
|
||||
|
||||
ifneq ($(COMPONENT_TYPE),riscos-module)
|
||||
ifeq ($(origin CC),default)
|
||||
ifneq ($(findstring arm-unknown-riscos-gcc,$(CC__)),)
|
||||
EXEEXT := ,e1f
|
||||
else
|
||||
EXEEXT := ,ff8
|
||||
endif
|
||||
else
|
||||
ifneq ($(findstring arm-unknown-riscos-gcc,$(CC)),)
|
||||
EXEEXT := ,e1f
|
||||
else
|
||||
EXEEXT := ,ff8
|
||||
endif
|
||||
endif
|
||||
else
|
||||
EXEEXT := ,ffa
|
||||
endif
|
||||
endif
|
||||
|
||||
# TODO: this assumes GCC
|
||||
CFLAGS := $(CFLAGS) -mpoke-function-name -I$(GCCSDK_INSTALL_ENV)/include
|
||||
CXXFLAGS := $(CXXFLAGS) -mpoke-function-name -I$(GCCSDK_INSTALL_ENV)/include
|
||||
LDFLAGS := $(LDFLAGS) -L$(GCCSDK_INSTALL_ENV)/lib
|
||||
|
||||
CMHGFLAGS := -p -tgcc -32bit -apcs 3/32/nonreent/fpe2/noswst/nofpr/nofp
|
||||
|
||||
# Default prefix
|
||||
PREFIX ?= $(GCCSDK_INSTALL_ENV)
|
||||
endif
|
||||
|
||||
# BeOS-like targets
|
||||
ifeq ($(TARGET),beos)
|
||||
ifeq ($(HOST),beos)
|
||||
# Building on BeOS
|
||||
CC__ := gcc
|
||||
|
||||
# No pkg-config
|
||||
PKGCONFIG ?=
|
||||
|
||||
# Default prefix
|
||||
BEOS_INSTALL_ENV ?= /boot/home/config
|
||||
else
|
||||
ifeq ($(HOST),haiku)
|
||||
# Building on Haiku
|
||||
|
||||
# Default prefix
|
||||
BEOS_INSTALL_ENV ?= /boot/common
|
||||
else
|
||||
# TODO: more sensible default
|
||||
BEOS_INSTALL_ENV ?= /home/jmb/haiku/env
|
||||
BEOS_INSTALL_CROSSBIN ?= /home/jmb/haiku/haiku/generated/cross-tools/bin
|
||||
|
||||
CC__ := $(wildcard $(BEOS_INSTALL_CROSSBIN)/*gcc)
|
||||
CXX__ := $(wildcard $(BEOS_INSTALL_CROSSBIN)/*g++)
|
||||
AR__ := $(wildcard $(BEOS_INSTALL_CROSSBIN)/*ar)
|
||||
|
||||
PKGCONFIG := PKG_CONFIG_LIBDIR="$(PREFIX)/lib/pkgconfig:$(BEOS_INSTALL_ENV)/lib/pkgconfig:$(BEOS_INSTALL_ENV)/share/pkgconfig" pkg-config
|
||||
endif
|
||||
endif
|
||||
|
||||
# TODO: this assumes GCC
|
||||
CFLAGS := $(CFLAGS) -I$(BEOS_INSTALL_ENV)/include
|
||||
CXXFLAGS := $(CXXFLAGS) -I$(BEOS_INSTALL_ENV)/include
|
||||
LDFLAGS := $(LDFLAGS) -L$(BEOS_INSTALL_ENV)/lib
|
||||
|
||||
PREFIX ?= $(BEOS_INSTALL_ENV)
|
||||
endif
|
||||
|
||||
# Windows
|
||||
ifeq ($(TARGET),windows)
|
||||
ifeq ($(HOST),windows)
|
||||
# Building on Windows
|
||||
CC__ := gcc
|
||||
CXX__ := g++
|
||||
AR__ := ar
|
||||
|
||||
PKGCONFIG ?=
|
||||
else
|
||||
# Cross compiling for Windows -- assumes mingw toolchain
|
||||
MINGW_INSTALL_ENV ?= /usr/local/mingw
|
||||
|
||||
CC__ := i586-mingw32msvc-gcc
|
||||
CXX__ := i586-mingw32msvc-g++
|
||||
AR__ := i586-mingw32msvc-ar
|
||||
|
||||
PKGCONFIG ?= PKG_CONFIG_LIBDIR="$(PREFIX)/lib/pkgconfig:$(MINGW_INSTALL_ENV)/lib/pkgconfig:$(MINGW_INSTALL_ENV)/share/pkgconfig" pkg-config
|
||||
endif
|
||||
|
||||
# TODO: this assumes GCC
|
||||
CFLAGS := $(CFLAGS) -U__STRICT_ANSI__ -I$(MINGW_INSTALL_ENV)/include
|
||||
CXXFLAGS := $(CXXFLAGS) -U__STRICT_ANSI__ -I$(MINGW_INSTALL_ENV)/include
|
||||
LDFLAGS := $(LDFLAGS) -L$(MINGW_INSTALL_ENV)/lib
|
||||
|
||||
# Default prefix
|
||||
PREFIX ?= $(MINGW_INSTALL_ENV)
|
||||
endif
|
||||
|
||||
# AmigaOS (3/4; m68k/ppc: we can treat them identically)
|
||||
ifeq ($(findstring amiga,$(TARGET)),amiga)
|
||||
ifeq ($(findstring amiga,$(HOST)),amiga)
|
||||
# Building on AmigaOS
|
||||
# Nothing to do, as we assume the default tooling works
|
||||
else
|
||||
# Cross compiling for AmigaOS
|
||||
|
||||
ifeq ($(TARGET),amigaos3)
|
||||
GCCSDK_INSTALL_ENV ?= /opt/netsurf/m68k-unknown-amigaos/env
|
||||
GCCSDK_INSTALL_CROSSBIN ?= /opt/netsurf/m68k-unknown-amigaos/cross/bin
|
||||
else
|
||||
GCCSDK_INSTALL_ENV ?= /opt/netsurf/ppc-amigaos/env
|
||||
GCCSDK_INSTALL_CROSSBIN ?= /opt/netsurf/ppc-amigaos/cross/bin
|
||||
endif
|
||||
|
||||
AR__ := $(wildcard $(GCCSDK_INSTALL_CROSSBIN)/*ar)
|
||||
CC__ := $(wildcard $(GCCSDK_INSTALL_CROSSBIN)/*gcc)
|
||||
CXX__ := $(wildcard $(GCCSDK_INSTALL_CROSSBIN)/*g++)
|
||||
|
||||
PKGCONFIG ?= PKG_CONFIG_LIBDIR="$(PREFIX)/lib/pkgconfig:$(MINGW_INSTALL_ENV)/lib/pkgconfig:$(MINGW_INSTALL_ENV)/share/pkgconfig" pkg-config
|
||||
|
||||
# TODO: this assumes GCC
|
||||
CFLAGS := $(CFLAGS) -U__STRICT_ANSI__ -I$(GCCSDK_INSTALL_ENV)/include
|
||||
CXXFLAGS := $(CXXFLAGS) -U__STRICT_ANSI__ -I$(GCCSDK_INSTALL_ENV)/include
|
||||
LDFLAGS := $(LDFLAGS) -L$(GCCSDK_INSTALL_ENV)/lib
|
||||
|
||||
PREFIX ?= $(GCCSDK_INSTALL_ENV)
|
||||
endif
|
||||
endif
|
||||
|
||||
# Default prefix
|
||||
PREFIX ?= /usr/local
|
||||
|
||||
###############################################################################
|
||||
# Tool defaults
|
||||
###############################################################################
|
||||
|
||||
CP ?= cp
|
||||
|
||||
DOXYGEN ?= doxygen
|
||||
|
||||
ECHO ?= echo
|
||||
|
||||
GENHTML ?= genhtml
|
||||
|
||||
ifeq ($(HOST),$(TARGET))
|
||||
HOST_CC ?= $(CC)
|
||||
|
||||
HOST_CXX ?= $(CXX)
|
||||
else
|
||||
HOST_CC ?= cc
|
||||
|
||||
HOST_CXX ?= c++
|
||||
endif
|
||||
|
||||
INSTALL ?= install
|
||||
|
||||
LCOV ?= lcov
|
||||
|
||||
LN ?= ln
|
||||
|
||||
MAKE ?= make
|
||||
|
||||
MKDIR ?= mkdir
|
||||
MKDIRFLAGS ?= -p
|
||||
|
||||
MV ?= mv
|
||||
|
||||
PERL ?= perl
|
||||
|
||||
PKGCONFIG ?= PKG_CONFIG_PATH="$(PREFIX)/lib/pkgconfig:$(PKG_CONFIG_PATH)" pkg-config
|
||||
|
||||
GREP ?= grep
|
||||
|
||||
SED ?= sed
|
||||
|
||||
TOUCH ?= touch
|
||||
|
||||
XSLTPROC ?= xsltproc
|
||||
|
||||
###############################################################################
|
||||
# Override defaulted tools
|
||||
###############################################################################
|
||||
|
||||
# CC
|
||||
ifeq ($(findstring ccc-analyzer,$(CC)),ccc-analyzer)
|
||||
# We're being invoked by scan-build, so export
|
||||
# the compiler we would have used such that
|
||||
# scan-build works with cross-compilation.
|
||||
# There's no need to do this if we would have
|
||||
# used the default compiler.
|
||||
ifdef CC__
|
||||
export CCC_CC := $(CC__)
|
||||
endif
|
||||
else
|
||||
# Only set CC if it's not already set in the
|
||||
# environment and we have a value for it.
|
||||
# Otherwise, leave it to be defaulted.
|
||||
ifeq ($(origin CC),default)
|
||||
ifdef CC__
|
||||
CC := $(CC__)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# CXX
|
||||
ifeq ($(origin CXX),default)
|
||||
ifdef CXX__
|
||||
CXX := $(CXX__)
|
||||
endif
|
||||
endif
|
||||
|
||||
# AR
|
||||
ifeq ($(origin AR),default)
|
||||
ifdef AR__
|
||||
AR := $(AR__)
|
||||
endif
|
||||
endif
|
||||
|
||||
###############################################################################
|
||||
# Auto-detect the toolchain
|
||||
###############################################################################
|
||||
|
||||
# Check for GCC first, as that's most likely
|
||||
# TODO: Using shell redirection like this probably hurts portability
|
||||
ccspecs := $(shell $(CC) -dumpspecs 2>&1)
|
||||
ifeq ($(findstring libgcc,$(ccspecs)),libgcc)
|
||||
# Looks like GCC
|
||||
toolchain := gcc
|
||||
else
|
||||
# Not GCC, so enquire further
|
||||
ccvsn := $(shell $(CC) --version 2>&1)
|
||||
ifeq ($(ccvsn),)
|
||||
# Version string is blank
|
||||
ifeq ($(HOST),riscos)
|
||||
# For some reason we never see the output of SCL apps, so might be
|
||||
# Norcroft. However it might also be a GCC linked against a buggy
|
||||
# UnixLib.
|
||||
# TODO: Something more useful than blindly assuming GCC.
|
||||
ccvsn := GCC
|
||||
# ccvsn := Norcroft
|
||||
endif
|
||||
endif
|
||||
|
||||
# "Norcroft ..."
|
||||
ifeq ($(word 1,$(ccvsn)),Norcroft)
|
||||
toolchain := norcroft
|
||||
endif
|
||||
# "GCC ..."
|
||||
ifeq ($(word 1,$(ccvsn)),GCC)
|
||||
toolchain := gcc
|
||||
endif
|
||||
# "clang ..."
|
||||
ifeq ($(word 1,$(ccvsn)),clang)
|
||||
toolchain := clang
|
||||
endif
|
||||
ifeq ($(word 1,$(ccvsn)),Apple)
|
||||
ifeq ($(word 2,$(ccvsn)),clang)
|
||||
# Apple clang
|
||||
toolchain := clang
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(toolchain),)
|
||||
$(error Unable to detect toolchain)
|
||||
endif
|
||||
|
||||
# TODO: It would be nice to avoid this hard-coded path
|
||||
include build/makefiles/Makefile.$(toolchain)
|
||||
|
||||
###############################################################################
|
||||
# Default assembler/compiler/linker/archiver flags
|
||||
###############################################################################
|
||||
|
||||
ifeq ($(BUILD),release)
|
||||
OPTCFLAGS ?= $(CCDEF)NDEBUG $(CCOPT)
|
||||
OPTCXXFLAGS ?= $(CXXDEF)NDEBUG $(CXXOPT)
|
||||
else
|
||||
OPTCFLAGS ?= $(CCDBG) $(CCNOOPT) $(CCDEF)DEBUG
|
||||
OPTCXXFLAGS ?= $(CXXDBG) $(CXXNOOPT) $(CXXDEF)DEBUG
|
||||
OPTLDFLAGS ?= $(LDDBG)
|
||||
endif
|
||||
|
||||
ifeq ($(origin ARFLAGS),default)
|
||||
ARFLAGS := $(ARFLG)
|
||||
endif
|
||||
|
||||
# TODO: This assumes that the C compiler can cope with assembler
|
||||
ASFLAGS ?= $(CCAS)
|
||||
|
||||
CFLAGS := $(CFLAGS) $(OPTCFLAGS) $(CCDEF)BUILD_TARGET_$(TARGET) $(CCDEF)BUILD_HOST_$(HOST)
|
||||
CXXFLAGS := $(CXXFLAGS) $(OPTCXXFLAGS) \
|
||||
$(CXXDEF)BUILD_TARGET_$(TARGET) $(CXXDEF)BUILD_HOST_$(HOST)
|
||||
|
||||
ASFLAGS := $(ASFLAGS) $(CFLAGS)
|
||||
LDFLAGS := $(LDFLAGS) $(OPTLDFLAGS)
|
||||
|
||||
###############################################################################
|
||||
# lib-shared defaults
|
||||
###############################################################################
|
||||
|
||||
# Default library extension
|
||||
ifeq ($(COMPONENT_TYPE),lib-static)
|
||||
LIBEXT ?= .a
|
||||
else
|
||||
LIBEXT ?= .so
|
||||
endif
|
||||
|
||||
# If we're building a shared library, modify the flags appropriately
|
||||
ifeq ($(COMPONENT_TYPE),lib-shared)
|
||||
# Default CFLAGS/LDFLAGS for shared libraries
|
||||
SHAREDCFLAGS ?= $(CCSHR) $(CCDEF)PIC
|
||||
SHAREDCXXFLAGS ?= $(CXXSHR) $(CCDEF)PIC
|
||||
SHAREDLDFLAGS ?= $(LDSHR)
|
||||
SHAREDLDPATH ?= LD_LIBRARY_PATH="$(BUILDDIR):$(LD_LIBRARY_PATH)"
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
# Package config macros
|
||||
################################################################################
|
||||
|
||||
include build/makefiles/Makefile.pkgconfig
|
|
@ -0,0 +1,603 @@
|
|||
# Top-level Makefile fragment
|
||||
#
|
||||
# Expected inputs:
|
||||
#
|
||||
# BUILD Type of build to perform:
|
||||
# release - Release build
|
||||
# debug - Debug build
|
||||
# COMPONENT Name of the component (sans leading "lib" iff a library)
|
||||
# COMPONENT_VERSION Component version number (x.y.z)
|
||||
# COMPONENT_TYPE Type of component:
|
||||
# binary - Executable binary
|
||||
# lib-static - Static library
|
||||
# lib-shared - Shared library
|
||||
# riscos-module - RISC OS module
|
||||
# TARGET Target platform identifier
|
||||
#
|
||||
# Optional inputs:
|
||||
#
|
||||
# BUILDDIR Directory to build into (defaults to
|
||||
# build-$(HOST)-$(TARGET)-$(BUILD)-$(COMPONENT_TYPE))
|
||||
# CC_CAN_BUILD_AND_DEP Flag whether $(CC) is capable of calculating dependency
|
||||
# information at the same time as compiling sources.
|
||||
# Set to "yes" if it can.
|
||||
# DESTDIR Sandboxed FS root (e.g. for packaging)
|
||||
# HOST Host platform identifier
|
||||
# REQUIRED_PKGS List of required pkg-config packages
|
||||
#
|
||||
# The client may also override all toolchain settings, including:
|
||||
#
|
||||
# ARFLAGS Archiver flags for the current compilation
|
||||
# CFLAGS C compiler flags for the current compilation
|
||||
# CXXFLAGS C++ compiler flags for the current compilation
|
||||
# LDFLAGS Linker flags for the current compilation
|
||||
#
|
||||
# TESTCFLAGS Any test-specific CFLAGS
|
||||
# TESTCXXFLAGS Any test-specific CXXFLAGS
|
||||
# TESTLDFLAGS Any test-specific LDFLAGS
|
||||
#
|
||||
# TESTRUNNER Test runner invocation command
|
||||
# The test runner takes a command line in the form
|
||||
# <build dir> <test dir> <testprefix> <exeext>
|
||||
#
|
||||
# Targets provided:
|
||||
#
|
||||
# all Default target. Builds component using current settings
|
||||
# test Build and run test suite, using current settings.
|
||||
# coverage Determine test suite coverage (requires lcov)
|
||||
# profile Build with profiling support enabled (requires gprof)
|
||||
# docs Produce documentation (requires doxygen)
|
||||
# clean Clean the build
|
||||
# distclean Remove distribution files, too
|
||||
# install Install component into prefix.
|
||||
# uninstall Remove component from prefix.
|
||||
#
|
||||
# Variables provided:
|
||||
#
|
||||
# major-version Extracts the major version (x) from COMPONENT_VERSION
|
||||
# minor-version Extracts the minor version (y) from COMPONENT_VERSION
|
||||
# patch-version Extracts the patch version (z) from COMPONENT_VERSION
|
||||
# OUTPUT Path + filename of build target
|
||||
|
||||
###############################################################################
|
||||
# Sanity checks
|
||||
###############################################################################
|
||||
|
||||
# Name of component must be defined by client
|
||||
ifeq ($(COMPONENT),)
|
||||
$(error COMPONENT not defined)
|
||||
endif
|
||||
|
||||
# As must the version
|
||||
ifeq ($(COMPONENT_VERSION),)
|
||||
$(error COMPONENT_VERSION not defined)
|
||||
endif
|
||||
|
||||
# As must the component type
|
||||
ifeq ($(COMPONENT_TYPE),)
|
||||
$(error COMPONENT_TYPE not defined)
|
||||
endif
|
||||
|
||||
# Target platform must be defined by the client
|
||||
ifeq ($(TARGET),)
|
||||
$(error TARGET not defined)
|
||||
endif
|
||||
|
||||
# Build type, too
|
||||
ifeq ($(BUILD),)
|
||||
$(error BUILD not defined)
|
||||
endif
|
||||
|
||||
##############################################################################
|
||||
# Makefile variables
|
||||
##############################################################################
|
||||
|
||||
Q ?= @
|
||||
VQ ?= @
|
||||
|
||||
##############################################################################
|
||||
# Exported variables (also OUTPUT, further down)
|
||||
##############################################################################
|
||||
|
||||
major-version := $(word 1,$(subst ., ,$(COMPONENT_VERSION)))
|
||||
minor-version := $(word 2,$(subst ., ,$(COMPONENT_VERSION)))
|
||||
patch-version := $(word 3,$(subst ., ,$(COMPONENT_VERSION)))
|
||||
|
||||
##############################################################################
|
||||
# Build environment
|
||||
##############################################################################
|
||||
|
||||
# Build directory
|
||||
BUILDDIR ?= build-$(HOST)-$(TARGET)-$(BUILD)-$(COMPONENT_TYPE)
|
||||
|
||||
# Build tree subdirs
|
||||
COVERAGEDIR := $(BUILDDIR)/coverage
|
||||
DOCDIR := $(BUILDDIR)/docs
|
||||
|
||||
# Determine if we want to build testcases
|
||||
ifeq ($(MAKECMDGOALS),test)
|
||||
WANT_TEST := yes
|
||||
else ifeq ($(MAKECMDGOALS),profile)
|
||||
WANT_TEST := yes
|
||||
else ifeq ($(MAKECMDGOALS),coverage)
|
||||
WANT_TEST := yes
|
||||
else
|
||||
WANT_TEST := no
|
||||
endif
|
||||
|
||||
# List of items to delete on clean
|
||||
CLEAN_ITEMS :=
|
||||
# List of items to delete on distclean
|
||||
DISTCLEAN_ITEMS :=
|
||||
|
||||
# List of items to build for testing
|
||||
TEST_ITEMS :=
|
||||
# List of targets to run for testing
|
||||
TEST_TARGETS :=
|
||||
# List of targets which are prerequisites for running tests
|
||||
TEST_PREREQS :=
|
||||
|
||||
# List of items to (un)install
|
||||
INSTALL_ITEMS :=
|
||||
|
||||
# List of targets to run before building $(OBJECT)
|
||||
PRE_TARGETS :=
|
||||
# List of targets to run after building $(OBJECT)
|
||||
POST_TARGETS :=
|
||||
|
||||
# Source files
|
||||
SOURCES :=
|
||||
|
||||
# Include configuration Makefile fragment
|
||||
-include Makefile.config
|
||||
|
||||
# Set the default target (before including any children)
|
||||
__default: all
|
||||
|
||||
# Include Makefile fragments in subdirectories
|
||||
define do_include
|
||||
DIR := $$(dir $(1))
|
||||
include $(1)
|
||||
|
||||
endef
|
||||
|
||||
MAKE_INCLUDES := $(wildcard */Makefile)
|
||||
$(eval $(foreach INC, $(MAKE_INCLUDES), $(call do_include,$(INC))))
|
||||
|
||||
# Calculate objects to build
|
||||
OBJECTS := $(addprefix $(BUILDDIR)/,$(filter %.o, \
|
||||
$(subst /,_,$(subst .c,.o,$(SOURCES))) \
|
||||
$(subst /,_,$(subst .cpp,.o,$(SOURCES))) \
|
||||
$(subst /,_,$(subst .cmhg,.o,$(SOURCES))) \
|
||||
$(subst /,_,$(subst .s,.o,$(SOURCES)))))
|
||||
|
||||
bin_for_test = $(addprefix $(BUILDDIR)/,$(firstword $(subst :, ,$(ITEM))))
|
||||
TEST_BINARIES := $(foreach ITEM,$(TEST_ITEMS),$(bin_for_test))
|
||||
|
||||
# Determine if we're building any C++ sources
|
||||
ifneq ($(filter %.cpp,$(SOURCES)),)
|
||||
CXX_IN_BUILD := yes
|
||||
else
|
||||
CXX_IN_BUILD := no
|
||||
endif
|
||||
|
||||
# Determine the output filename
|
||||
ifeq ($(findstring lib,$(COMPONENT_TYPE)),lib)
|
||||
ifeq ($(findstring lib-shared,$(COMPONENT_TYPE)),lib-shared)
|
||||
SHAREDLIBNAME := lib$(COMPONENT)$(LIBEXT)
|
||||
SONAME := $(SHAREDLIBNAME).$(major-version)
|
||||
OUTPUT := $(BUILDDIR)/$(SHAREDLIBNAME).$(COMPONENT_VERSION)
|
||||
else
|
||||
OUTPUT := $(BUILDDIR)/lib$(COMPONENT)$(LIBEXT)
|
||||
endif
|
||||
else
|
||||
OUTPUT := $(BUILDDIR)/$(COMPONENT)$(EXEEXT)
|
||||
endif
|
||||
|
||||
###############################################################################
|
||||
# Build targets
|
||||
###############################################################################
|
||||
|
||||
.PHONY: all test coverage profile docs clean distclean install uninstall \
|
||||
__default __precov __partial_clean __postshared
|
||||
|
||||
ifeq ($(COMPONENT_TYPE),lib-shared)
|
||||
POST_TARGETS := __postshared $(POST_TARGETS)
|
||||
|
||||
__postshared:
|
||||
$(Q)$(LN) $(LNFLAGS) -f -s $(notdir $(OUTPUT)) $(BUILDDIR)/$(SONAME)
|
||||
$(Q)$(LN) $(LNFLAGS) -f -s $(notdir $(OUTPUT)) $(BUILDDIR)/$(SHAREDLIBNAME)
|
||||
endif
|
||||
|
||||
# Default target
|
||||
all: $(PRE_TARGETS) $(OUTPUT) $(POST_TARGETS)
|
||||
|
||||
# Build and execute testsuite
|
||||
test: all $(TEST_PREREQS) $(TEST_BINARIES) $(TEST_TARGETS)
|
||||
$(VQ)$(ECHO) $(ECHOFLAGS) " TEST: Testing complete"
|
||||
|
||||
# Compute coverage
|
||||
__precov: __partial_clean
|
||||
$(Q)$(LCOV) --directory . --zerocounters
|
||||
|
||||
coverage: __precov test
|
||||
$(Q)$(LCOV) --directory $(BUILDDIR) --base-directory $(CURDIR) \
|
||||
--capture --output-file $(COVERAGEDIR)/$(COMPONENT)_tmp.info
|
||||
$(Q)$(LCOV) --extract $(COVERAGEDIR)/$(COMPONENT)_tmp.info \
|
||||
"$(CURDIR)/src*" -o $(COVERAGEDIR)/$(COMPONENT).info
|
||||
$(Q)$(RM) $(RMFLAGS) $(COVERAGEDIR)/$(COMPONENT)_tmp.info
|
||||
$(Q)$(GENHTML) -o $(COVERAGEDIR) --num-spaces 2 \
|
||||
$(COVERAGEDIR)/$(COMPONENT).info
|
||||
|
||||
# Build for profiling
|
||||
profile: __partial_clean test
|
||||
|
||||
# Compile documentation
|
||||
docs: $(BUILDDIR)/stamp
|
||||
$(Q)$(DOXYGEN) build/Doxyfile
|
||||
|
||||
# Clean build tree
|
||||
__partial_clean:
|
||||
-$(Q)$(RM) $(RMFLAGS) $(CLEAN_ITEMS)
|
||||
-$(Q)$(RM) $(RMFLAGS) gmon.out
|
||||
-$(Q)$(RM) $(RMFLAGS) $(wildcard $(BUILDDIR)/*.d)
|
||||
-$(Q)$(RM) $(RMFLAGS) $(wildcard $(BUILDDIR)/*.gcda)
|
||||
-$(Q)$(RM) $(RMFLAGS) $(wildcard $(BUILDDIR)/*.gcno)
|
||||
-$(Q)$(RM) $(RMFLAGS) $(wildcard $(BUILDDIR)/*.o)
|
||||
|
||||
clean: __partial_clean
|
||||
-$(Q)$(RM) $(RMFLAGS) -r build/docs
|
||||
-$(Q)$(RM) $(RMFLAGS) -r $(BUILDDIR)
|
||||
|
||||
# Remove auto-generated non-build-tree items
|
||||
distclean: clean
|
||||
-$(Q)$(RM) $(RMFLAGS) $(DISTCLEAN_ITEMS)
|
||||
|
||||
# The installation target, and associated canned command sequences.
|
||||
# For reference, the syntax of INSTALL_ITEMS is:
|
||||
#
|
||||
# <destination>:<file>[';'<file>]*
|
||||
#
|
||||
# We also permit a trailing ';' in the file list.
|
||||
|
||||
__comma := ,
|
||||
__empty :=
|
||||
__space := $(empty) $(empty)
|
||||
__required = $(if $(REQUIRED_PKGS),Requires: $(subst $(__space),$(__comma) ,$(strip $(REQUIRED_PKGS))),)
|
||||
|
||||
# Install a pkg-config control file ($1) to the specified location ($2)
|
||||
define install_pkgconfig
|
||||
$(Q)$(ECHO) $(ECHOFLAGS) "sed -e... $1 >$(BUILDDIR)/$(1:.in=)"
|
||||
$(Q)$(SED) \
|
||||
-e 's#PREFIX#$(PREFIX)#' \
|
||||
-e 's#MAJOR#$(major-version)#' \
|
||||
-e 's#MINOR#$(minor-version)#' \
|
||||
-e 's#PATCH#$(patch-version)#' \
|
||||
-e 's#VERSION#$(COMPONENT_VERSION)#' \
|
||||
-e 's#REQUIRED#$(__required)#' \
|
||||
$1 >$(BUILDDIR)/$(1:.in=)
|
||||
$(INSTALL) $(INSTALLFLAGS) -m 644 $(BUILDDIR)/$(1:.in=) \
|
||||
$2/$(1:.in=)
|
||||
|
||||
endef
|
||||
|
||||
# TODO: Is this scheme portable?
|
||||
define install_shared_lib
|
||||
$(INSTALL) $(INSTALLFLAGS) -m 755 $1 $2/$(notdir $1)
|
||||
$(LN) $(LNFLAGS) -f -s $(notdir $1) $2/$(SONAME)
|
||||
$(LN) $(LNFLAGS) -f -s $(notdir $1) $2/$(SHAREDLIBNAME)
|
||||
endef
|
||||
|
||||
# Install a file ($1) to the specified location ($2)
|
||||
define install_file
|
||||
$(if $1, \
|
||||
$(if $(findstring .pc.in,$1), \
|
||||
$(call install_pkgconfig,$1,$2), \
|
||||
$(if $(and $(filter lib-shared,$(COMPONENT_TYPE)), \
|
||||
$(filter $(OUTPUT),$1)), \
|
||||
$(call install_shared_lib,$1,$2), \
|
||||
$(INSTALL) $(INSTALLFLAGS) -m 644 $1 $2)))
|
||||
|
||||
endef
|
||||
|
||||
# Install a list of files ($2) to the specified location ($1)
|
||||
# We create the installation location if it doesn't already exist
|
||||
define install_to_dest
|
||||
$(Q)$(MKDIR) $(MKDIRFLAGS) $(DESTDIR)$(PREFIX)$1
|
||||
$(foreach FILE,$(strip $(subst ;, ,$2)), \
|
||||
$(call install_file,$(FILE),$(DESTDIR)$(PREFIX)$1))
|
||||
|
||||
endef
|
||||
|
||||
install: all
|
||||
$(foreach ITEM,$(INSTALL_ITEMS), \
|
||||
$(call install_to_dest,$(firstword $(subst :, ,$(ITEM))), \
|
||||
$(lastword $(subst :, ,$(ITEM)))))
|
||||
|
||||
# Uninstallation
|
||||
|
||||
# TODO: Work out how to safely remove symlinks
|
||||
define uninstall_shared_lib
|
||||
$(RM) $(RMFLAGS) $2/$(notdir $1).$(COMPONENT_VERSION)
|
||||
endef
|
||||
|
||||
# Uninstall a file ($1) from the specified location ($2)
|
||||
define uninstall_file
|
||||
$(if $1, \
|
||||
$(if $(findstring .pc.in,$1), \
|
||||
$(RM) $(RMFLAGS) $2/$(1:.pc.in=.pc), \
|
||||
$(if $(and $(filter lib-shared,$(COMPONENT_TYPE)), \
|
||||
$(filter $(OUTPUT),$1)), \
|
||||
$(call uninstall_shared_lib,$1,$2), \
|
||||
$(RM) $(RMFLAGS) $2/$(notdir $1))))
|
||||
|
||||
endef
|
||||
|
||||
# Uninstall a list of files ($2) from the specified location ($1)
|
||||
# TODO: Come up with a safe way of removing directories, too
|
||||
define uninstall_from_dest
|
||||
$(foreach FILE,$(strip $(subst ;, ,$2)), \
|
||||
$(call uninstall_file,$(FILE),$(DESTDIR)$(PREFIX)$1))
|
||||
|
||||
endef
|
||||
|
||||
uninstall:
|
||||
$(foreach ITEM,$(INSTALL_ITEMS), \
|
||||
$(call uninstall_from_dest,$(firstword $(subst :, ,$(ITEM))), \
|
||||
$(lastword $(subst :, ,$(ITEM)))))
|
||||
|
||||
###############################################################################
|
||||
# Actual rules
|
||||
###############################################################################
|
||||
|
||||
$(BUILDDIR)/stamp:
|
||||
$(Q)$(MKDIR) $(MKDIRFLAGS) $(BUILDDIR)
|
||||
$(Q)$(MKDIR) $(MKDIRFLAGS) $(COVERAGEDIR)
|
||||
$(Q)$(MKDIR) $(MKDIRFLAGS) $(DOCDIR)
|
||||
$(Q)$(TOUCH) $(TOUCHFLAGS) $(BUILDDIR)/stamp
|
||||
|
||||
$(OUTPUT): $(BUILDDIR)/stamp $(OBJECTS)
|
||||
ifeq ($(COMPONENT_TYPE),lib-static)
|
||||
$(VQ)$(ECHO) $(ECHOFLAGS) " AR: $@"
|
||||
$(Q)$(RM) $(RMFLAGS) $@
|
||||
$(Q)$(AR) $(ARFLAGS) $@ $(OBJECTS)
|
||||
else
|
||||
$(VQ)$(ECHO) $(ECHOFLAGS) " LINK: $@"
|
||||
ifeq ($(CXX_IN_BUILD),yes)
|
||||
$(Q)$(CXX) -o $@ $(OBJECTS) $(LDFLAGS) $(SHAREDLDFLAGS)
|
||||
else
|
||||
$(Q)$(CC) -o $@ $(OBJECTS) $(LDFLAGS) $(SHAREDLDFLAGS)
|
||||
endif
|
||||
endif
|
||||
|
||||
###############################################################################
|
||||
# Autogenerated, implied rules
|
||||
###############################################################################
|
||||
|
||||
DEPFILES :=
|
||||
BUILDFILES :=
|
||||
|
||||
ifeq ($(CC_CAN_BUILD_AND_DEP),yes)
|
||||
# C compiler can compile and dep simultaneously
|
||||
|
||||
define dep_c
|
||||
ifeq ($$(findstring $$(BUILDDIR)/$2,$$(DEPFILES)),)
|
||||
$$(BUILDDIR)/$2: $$(BUILDDIR)/stamp $1
|
||||
|
||||
DEPFILES += $$(BUILDDIR)/$2
|
||||
endif
|
||||
|
||||
endef
|
||||
|
||||
define dep_cxx
|
||||
ifeq ($$(findstring $$(BUILDDIR)/$2,$$(DEPFILES)),)
|
||||
$$(BUILDDIR)/$2: $$(BUILDDIR)/stamp $1
|
||||
|
||||
DEPFILES += $$(BUILDDIR)/$2
|
||||
endif
|
||||
|
||||
endef
|
||||
|
||||
define build_c
|
||||
ifeq ($$(findstring $$(BUILDDIR)/$2,$$(BUILDFILES)),)
|
||||
$$(BUILDDIR)/$2: $$(BUILDDIR)/stamp $1
|
||||
$$(VQ)$$(ECHO) $$(ECHOFLAGS) " COMPILE: $1"
|
||||
$$(Q)$$(CC) -MMD -MP $$($3) -o $$@ -c $1
|
||||
|
||||
BUILDFILES += $$(BUILDDIR)/$2
|
||||
endif
|
||||
|
||||
endef
|
||||
|
||||
define build_cxx
|
||||
ifeq ($$(findstring $$(BUILDDIR)/$2,$$(BUILDFILES)),)
|
||||
$$(BUILDDIR)/$2: $$(BUILDDIR)/stamp $1
|
||||
$$(VQ)$$(ECHO) $$(ECHOFLAGS) " COMPILE: $1"
|
||||
$$(Q)$$(CXX) -MMD -MP $$($3) -o $$@ -c $1
|
||||
|
||||
BUILDFILES += $$(BUILDDIR)/$2
|
||||
endif
|
||||
|
||||
endef
|
||||
else
|
||||
ifeq ($(CC_CANNOT_DEP),yes)
|
||||
# C compiler cannot calculate dependencies
|
||||
|
||||
define dep_c
|
||||
endef
|
||||
|
||||
define dep_cxx
|
||||
endef
|
||||
|
||||
define build_c
|
||||
ifeq ($$(findstring $$(BUILDDIR)/$2,$$(BUILDFILES)),)
|
||||
$$(BUILDDIR)/$2: $$(BUILDDIR)/stamp $1
|
||||
$$(VQ)$$(ECHO) $$(ECHOFLAGS) " COMPILE: $1"
|
||||
$$(Q)$$(CC) $$($3) -o $$@ -c $1
|
||||
|
||||
BUILDFILES += $$(BUILDDIR)/$2
|
||||
endif
|
||||
|
||||
endef
|
||||
|
||||
define build_cxx
|
||||
ifeq ($$(findstring $$(BUILDDIR)/$2,$$(BUILDFILES)),)
|
||||
$$(BUILDDIR)/$2: $$(BUILDDIR)/stamp $1
|
||||
$$(VQ)$$(ECHO) $$(ECHOFLAGS) " COMPILE: $1"
|
||||
$$(Q)$$(CXX) $$($3) -o $$@ -c $1
|
||||
|
||||
BUILDFILES += $$(BUILDDIR)/$2
|
||||
endif
|
||||
|
||||
endef
|
||||
else
|
||||
# C compiler must calculate dependencies first, then compile (default)
|
||||
|
||||
define dep_c
|
||||
ifeq ($$(findstring $$(BUILDDIR)/$2,$$(DEPFILES)),)
|
||||
$$(BUILDDIR)/$2: $$(BUILDDIR)/stamp $1
|
||||
$$(VQ)$$(ECHO) $$(ECHOFLAGS) " DEP: $1"
|
||||
$$(Q)$$(RM) $$(RMFLAGS) $($@)
|
||||
$$(Q)$$(CC) $$($3) -MM $1 > $$@.tmp
|
||||
$$(Q)$$(SED) $$(SEDFLAGS) 's,^.*:,$$@ $$(@:.d=.o):,' < $$@.tmp > $$@
|
||||
$$(Q)$$(RM) $$@.tmp
|
||||
|
||||
DEPFILES += $$(BUILDDIR)/$2
|
||||
endif
|
||||
|
||||
endef
|
||||
|
||||
define dep_cxx
|
||||
ifeq ($$(findstring $$(BUILDDIR)/$2,$$(DEPFILES)),)
|
||||
$$(BUILDDIR)/$2: $$(BUILDDIR)/stamp $1
|
||||
$$(VQ)$$(ECHO) $$(ECHOFLAGS) " DEP: $1"
|
||||
$$(Q)$$(RM) $$(RMFLAGS) $($@)
|
||||
$$(Q)$$(CXX) $$($3) -MM $1 > $$@.tmp
|
||||
$$(Q)$$(SED) $$(SEDFLAGS) 's,^.*:,$$@ $$(@:.d=.o):,' < $$@.tmp > $$@
|
||||
$$(Q)$$(RM) $$@.tmp
|
||||
|
||||
DEPFILES += $$(BUILDDIR)/$2
|
||||
endif
|
||||
|
||||
endef
|
||||
|
||||
define build_c
|
||||
ifeq ($$(findstring $$(BUILDDIR)/$2,$$(BUILDFILES)),)
|
||||
$$(BUILDDIR)/$2: $$(BUILDDIR)/stamp $1
|
||||
$$(VQ)$$(ECHO) $$(ECHOFLAGS) " COMPILE: $1"
|
||||
$$(Q)$$(CC) $$($3) -o $$@ -c $1
|
||||
|
||||
BUILDFILES += $$(BUILDDIR)/$2
|
||||
endif
|
||||
|
||||
endef
|
||||
|
||||
define build_cxx
|
||||
ifeq ($$(findstring $$(BUILDDIR)/$2,$$(BUILDFILES)),)
|
||||
$$(BUILDDIR)/$2: $$(BUILDDIR)/stamp $1
|
||||
$$(VQ)$$(ECHO) $$(ECHOFLAGS) " COMPILE: $1"
|
||||
$$(Q)$$(CXX) $$($3) -o $$@ -c $1
|
||||
|
||||
BUILDFILES += $$(BUILDDIR)/$2
|
||||
endif
|
||||
|
||||
endef
|
||||
endif
|
||||
endif
|
||||
|
||||
define build_cmhg
|
||||
ifeq ($$(findstring $$(BUILDDIR)/$2,$$(BUILDFILES)),)
|
||||
$$(BUILDDIR)/$2: $$(BUILDDIR)/stamp $1
|
||||
$$(VQ)$$(ECHO) $$(ECHOFLAGS) " CMHG: $1"
|
||||
$$(Q)$$(CMHG) $$(CMHGFLAGS) $1 -o $$@
|
||||
|
||||
BUILDFILES += $$(BUILDDIR)/$2
|
||||
endif
|
||||
|
||||
endef
|
||||
|
||||
define build_s
|
||||
ifeq ($$(findstring $$(BUILDDIR)/$2,$$(BUILDFILES)),)
|
||||
$$(BUILDDIR)/$2: $$(BUILDDIR)/stamp $1
|
||||
$$(VQ)$$(ECHO) $$(ECHOFLAGS) "ASSEMBLE: $1"
|
||||
$$(Q)$$(CC) $$($3) $1 -c -o $$@
|
||||
BUILDFILES += $$(BUILDDIR)/$2
|
||||
endif
|
||||
|
||||
endef
|
||||
|
||||
BUILDCFLAGS = $(CFLAGS) $(SHAREDCFLAGS)
|
||||
BUILDCXXFLAGS = $(CXXFLAGS) $(SHAREDCXXFLAGS)
|
||||
BUILDASFLAGS = $(ASFLAGS) $(SHAREDCFLAGS)
|
||||
|
||||
# Generate dependency rules
|
||||
$(eval $(foreach SOURCE,$(filter %.c,$(SOURCES)), \
|
||||
$(call dep_c,$(SOURCE),$(subst /,_,$(SOURCE:.c=.d)),BUILDCFLAGS)))
|
||||
$(eval $(foreach SOURCE,$(filter %.cpp,$(SOURCES)), \
|
||||
$(call dep_cxx,$(SOURCE),$(subst /,_,$(SOURCE:.cpp=.d)),BUILDCXXFLAGS)))
|
||||
|
||||
# Generate compilation rules
|
||||
$(eval $(foreach SOURCE,$(filter %.c,$(SOURCES)), \
|
||||
$(call build_c,$(SOURCE),$(subst /,_,$(SOURCE:.c=.o)),BUILDCFLAGS)))
|
||||
|
||||
$(eval $(foreach SOURCE,$(filter %.cpp,$(SOURCES)), \
|
||||
$(call build_cxx,$(SOURCE),$(subst /,_,$(SOURCE:.cpp=.o)),BUILDCXXFLAGS)))
|
||||
|
||||
$(eval $(foreach SOURCE,$(filter %.cmhg,$(SOURCES)), \
|
||||
$(call build_cmhg,$(SOURCE),$(subst /,_,$(SOURCE:.cmhg=.o)))))
|
||||
|
||||
$(eval $(foreach SOURCE,$(filter %.s,$(SOURCES)), \
|
||||
$(call build_s,$(SOURCE),$(subst /,_,$(SOURCE:.s=.o)),BUILDASFLAGS)))
|
||||
|
||||
# Similarly for test sources
|
||||
ifeq ($(WANT_TEST),yes)
|
||||
ifeq ($(findstring lib,$(COMPONENT_TYPE)),lib)
|
||||
TESTLIB := $(OUTPUT)
|
||||
TESTLDFLAGS += -L$(BUILDDIR)/ -l$(COMPONENT)
|
||||
endif
|
||||
|
||||
TESTCFLAGS := $(CFLAGS) $(TESTCFLAGS)
|
||||
TESTCXXFLAGS += $(CXXFLAGS)
|
||||
TESTLDFLAGS += $(LDFLAGS)
|
||||
|
||||
define link_test
|
||||
$2: $($3) $1
|
||||
$$(VQ)$$(ECHO) $$(ECHOFLAGS) " LINK: $2"
|
||||
ifeq ($$(CXX_IN_BUILD),yes)
|
||||
$$(Q)$$(CXX) -o $$@ $1 $$($4)
|
||||
else
|
||||
$$(Q)$$(CC) -o $$@ $1 $$($4)
|
||||
endif
|
||||
|
||||
endef
|
||||
|
||||
srcs_for_test = $(subst ;, ,$(lastword $(subst :, ,$(ITEM))))
|
||||
objs_for_test = $(addprefix $(BUILDDIR)/, \
|
||||
$(subst /,_,$(addsuffix .o,$(basename $(srcs_for_test)))))
|
||||
|
||||
$(eval $(foreach ITEM,$(TEST_ITEMS), \
|
||||
$(foreach SOURCE,$(filter %.c,$(srcs_for_test)), \
|
||||
$(call dep_c,$(SOURCE),$(subst /,_,$(SOURCE:.c=.d)),TESTCFLAGS))))
|
||||
|
||||
$(eval $(foreach ITEM,$(TEST_ITEMS), \
|
||||
$(foreach SOURCE,$(filter %.cpp,$(srcs_for_test)), \
|
||||
$(call dep_cxx,$(SOURCE),$(subst /,_,$(SOURCE:.cpp=.d)),TESTCXXFLAGS))))
|
||||
|
||||
$(eval $(foreach ITEM,$(TEST_ITEMS), \
|
||||
$(foreach SOURCE,$(filter %.c,$(srcs_for_test)), \
|
||||
$(call build_c,$(SOURCE),$(subst /,_,$(SOURCE:.c=.o)),TESTCFLAGS))))
|
||||
|
||||
$(eval $(foreach ITEM,$(TEST_ITEMS), \
|
||||
$(foreach SOURCE,$(filter %.cpp,$(srcs_for_test)), \
|
||||
$(call build_cxx,$(SOURCE),$(subst /,_,$(SOURCE:.cpp=.o)),TESTCXXFLAGS))))
|
||||
|
||||
$(eval $(foreach ITEM,$(TEST_ITEMS), \
|
||||
$(call link_test,$(objs_for_test),$(bin_for_test),TESTLIB,TESTLDFLAGS)))
|
||||
|
||||
endif
|
||||
|
||||
# Include dependency makefiles
|
||||
ifneq ($(findstring clean,$(MAKECMDGOALS)),clean)
|
||||
-include $(sort $(DEPFILES))
|
||||
endif
|
||||
|
|
@ -0,0 +1,211 @@
|
|||
/*
|
||||
* Copyright 2008 Sean Fox <dyntryx@gmail.com>
|
||||
* Copyright 2008 James Bursa <james@netsurf-browser.org>
|
||||
*
|
||||
* This file is part of NetSurf's libnsgif, http://www.netsurf-browser.org/
|
||||
* Licenced under the MIT License,
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
#include "../libnsgif.h"
|
||||
|
||||
unsigned char *load_file(const char *path, size_t *data_size);
|
||||
void warning(const char *context, int code);
|
||||
void *bitmap_create(int width, int height);
|
||||
void bitmap_set_opaque(void *bitmap, bool opaque);
|
||||
bool bitmap_test_opaque(void *bitmap);
|
||||
unsigned char *bitmap_get_buffer(void *bitmap);
|
||||
void bitmap_destroy(void *bitmap);
|
||||
void bitmap_modified(void *bitmap);
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
gif_bitmap_callback_vt bitmap_callbacks = {
|
||||
bitmap_create,
|
||||
bitmap_destroy,
|
||||
bitmap_get_buffer,
|
||||
bitmap_set_opaque,
|
||||
bitmap_test_opaque,
|
||||
bitmap_modified
|
||||
};
|
||||
gif_animation gif;
|
||||
size_t size;
|
||||
gif_result code;
|
||||
unsigned int i;
|
||||
|
||||
if (argc != 2) {
|
||||
fprintf(stderr, "Usage: %s image.gif\n", argv[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* create our gif animation */
|
||||
gif_create(&gif, &bitmap_callbacks);
|
||||
|
||||
/* load file into memory */
|
||||
unsigned char *data = load_file(argv[1], &size);
|
||||
|
||||
/* begin decoding */
|
||||
do {
|
||||
code = gif_initialise(&gif, size, data);
|
||||
if (code != GIF_OK && code != GIF_WORKING) {
|
||||
warning("gif_initialise", code);
|
||||
exit(1);
|
||||
}
|
||||
} while (code != GIF_OK);
|
||||
|
||||
printf("P3\n");
|
||||
printf("# %s\n", argv[1]);
|
||||
printf("# width %u \n", gif.width);
|
||||
printf("# height %u \n", gif.height);
|
||||
printf("# frame_count %u \n", gif.frame_count);
|
||||
printf("# frame_count_partial %u \n", gif.frame_count_partial);
|
||||
printf("# loop_count %u \n", gif.loop_count);
|
||||
printf("%u %u 256\n", gif.width, gif.height * gif.frame_count);
|
||||
|
||||
/* decode the frames */
|
||||
for (i = 0; i != gif.frame_count; i++) {
|
||||
unsigned int row, col;
|
||||
unsigned char *image;
|
||||
|
||||
code = gif_decode_frame(&gif, i);
|
||||
if (code != GIF_OK)
|
||||
warning("gif_decode_frame", code);
|
||||
|
||||
printf("# frame %u:\n", i);
|
||||
image = (unsigned char *) gif.frame_image;
|
||||
for (row = 0; row != gif.height; row++) {
|
||||
for (col = 0; col != gif.width; col++) {
|
||||
size_t z = (row * gif.width + col) * 4;
|
||||
printf("%u %u %u ",
|
||||
(unsigned char) image[z],
|
||||
(unsigned char) image[z + 1],
|
||||
(unsigned char) image[z + 2]);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
|
||||
/* clean up */
|
||||
gif_finalise(&gif);
|
||||
free(data);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
unsigned char *load_file(const char *path, size_t *data_size)
|
||||
{
|
||||
FILE *fd;
|
||||
struct stat sb;
|
||||
unsigned char *buffer;
|
||||
size_t size;
|
||||
size_t n;
|
||||
|
||||
fd = fopen(path, "rb");
|
||||
if (!fd) {
|
||||
perror(path);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (stat(path, &sb)) {
|
||||
perror(path);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
size = sb.st_size;
|
||||
|
||||
buffer = malloc(size);
|
||||
if (!buffer) {
|
||||
fprintf(stderr, "Unable to allocate %lld bytes\n",
|
||||
(long long) size);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
n = fread(buffer, 1, size, fd);
|
||||
if (n != size) {
|
||||
perror(path);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
fclose(fd);
|
||||
|
||||
*data_size = size;
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
||||
void warning(const char *context, gif_result code)
|
||||
{
|
||||
fprintf(stderr, "%s failed: ", context);
|
||||
switch (code)
|
||||
{
|
||||
case GIF_INSUFFICIENT_FRAME_DATA:
|
||||
fprintf(stderr, "GIF_INSUFFICIENT_FRAME_DATA");
|
||||
break;
|
||||
case GIF_FRAME_DATA_ERROR:
|
||||
fprintf(stderr, "GIF_FRAME_DATA_ERROR");
|
||||
break;
|
||||
case GIF_INSUFFICIENT_DATA:
|
||||
fprintf(stderr, "GIF_INSUFFICIENT_DATA");
|
||||
break;
|
||||
case GIF_DATA_ERROR:
|
||||
fprintf(stderr, "GIF_DATA_ERROR");
|
||||
break;
|
||||
case GIF_INSUFFICIENT_MEMORY:
|
||||
fprintf(stderr, "GIF_INSUFFICIENT_MEMORY");
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "unknown code %i", code);
|
||||
break;
|
||||
}
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
|
||||
|
||||
void *bitmap_create(int width, int height)
|
||||
{
|
||||
return calloc(width * height, 4);
|
||||
}
|
||||
|
||||
|
||||
void bitmap_set_opaque(void *bitmap, bool opaque)
|
||||
{
|
||||
(void) opaque; /* unused */
|
||||
assert(bitmap);
|
||||
}
|
||||
|
||||
|
||||
bool bitmap_test_opaque(void *bitmap)
|
||||
{
|
||||
assert(bitmap);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
unsigned char *bitmap_get_buffer(void *bitmap)
|
||||
{
|
||||
assert(bitmap);
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
|
||||
void bitmap_destroy(void *bitmap)
|
||||
{
|
||||
assert(bitmap);
|
||||
free(bitmap);
|
||||
}
|
||||
|
||||
|
||||
void bitmap_modified(void *bitmap)
|
||||
{
|
||||
assert(bitmap);
|
||||
return;
|
||||
}
|
||||
|
|
@ -0,0 +1,109 @@
|
|||
#!/usr/bin/perl
|
||||
#
|
||||
# Disassemble a GIF file and display the sections and chunks within.
|
||||
#
|
||||
# Warning: only part of the specification is implemented.
|
||||
#
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
die "Usage: $0 IMAGE\n" unless @ARGV == 1;
|
||||
my ($image) = @ARGV;
|
||||
|
||||
open IMAGE, '<', $image or die "$0: open $image: $!\n";
|
||||
undef $/;
|
||||
my $gif = <IMAGE>;
|
||||
close IMAGE;
|
||||
|
||||
print "$image: ", length $gif, " bytes\n\n";
|
||||
|
||||
my @gif = unpack 'C*', $gif;
|
||||
my $z = 0;
|
||||
|
||||
output_chunk('Header', 6);
|
||||
output_chunk('Logical Screen Descriptor', 7);
|
||||
|
||||
my $global_colors = $gif[10] & 0x80;
|
||||
my $color_table_size = 2 << ($gif[10] & 0x07);
|
||||
|
||||
if ($global_colors) {
|
||||
output_chunk('Global Color Table', $color_table_size * 3);
|
||||
}
|
||||
|
||||
while (1) {
|
||||
while ($gif[$z] == 0x21) {
|
||||
if ($gif[$z + 1] == 0xf9) {
|
||||
output_chunk('Graphic Control Extension', 5 + 2);
|
||||
} elsif ($gif[$z + 1] == 0xfe) {
|
||||
output_chunk('Comment Extension', 2);
|
||||
} elsif ($gif[$z + 1] == 0x01) {
|
||||
output_chunk('Plain Text Extension', 13 + 2);
|
||||
} elsif ($gif[$z + 1] == 0xff) {
|
||||
output_chunk('Application Extension', 12 + 2);
|
||||
} else {
|
||||
output_chunk((sprintf 'Unknown Extension 0x%.2x',
|
||||
$gif[$z + 1]), $gif[$z + 2] + 3);
|
||||
}
|
||||
|
||||
while ($gif[$z] != 0) {
|
||||
output_chunk('Data Sub-block', $gif[$z] + 1);
|
||||
}
|
||||
output_chunk('Block Terminator', 1);
|
||||
}
|
||||
|
||||
if ($gif[$z] == 0x3b) {
|
||||
output_chunk('Trailer', 1);
|
||||
last;
|
||||
}
|
||||
|
||||
if ($gif[$z] != 0x2c) {
|
||||
last;
|
||||
}
|
||||
|
||||
output_chunk('Image Descriptor', 10);
|
||||
|
||||
output_chunk('Table Based Image Data', 1);
|
||||
|
||||
while ($gif[$z] != 0) {
|
||||
output_chunk('Data Sub-block', $gif[$z] + 1);
|
||||
}
|
||||
output_chunk('Block Terminator', 1);
|
||||
}
|
||||
|
||||
if ($z != @gif) {
|
||||
output_chunk('*** Junk on End ***', @gif - $z);
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Output a chunk of data as hex and characters.
|
||||
#
|
||||
sub output_chunk
|
||||
{
|
||||
my ($description, $length) = @_;
|
||||
|
||||
print "$description";
|
||||
for (my $i = 0; $i != $length; $i++) {
|
||||
if ($i % 8 == 0) {
|
||||
print "\n";
|
||||
printf "%8i: ", $z + $i;
|
||||
}
|
||||
if ($z + $i == @gif) {
|
||||
print "EOF\n\n";
|
||||
print "Unexpected end of file\n";
|
||||
exit;
|
||||
}
|
||||
my $c = $gif[$z + $i];
|
||||
printf "%.2x ", $c;
|
||||
if (32 <= $c and $c <= 126) {
|
||||
printf "'%c'", $c;
|
||||
} else {
|
||||
print " ";
|
||||
}
|
||||
print " ";
|
||||
}
|
||||
print "\n\n";
|
||||
|
||||
$z += $length;
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
set -e
|
||||
make
|
||||
bin/decode_gif $1 | display
|
|
@ -0,0 +1,108 @@
|
|||
/*
|
||||
* Copyright 2004 Richard Wilson <richard.wilson@netsurf-browser.org>
|
||||
* Copyright 2008 Sean Fox <dyntryx@gmail.com>
|
||||
*
|
||||
* This file is part of NetSurf's libnsgif, http://www.netsurf-browser.org/
|
||||
* Licenced under the MIT License,
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
*/
|
||||
|
||||
/** \file
|
||||
* Progressive animated GIF file decoding (interface).
|
||||
*/
|
||||
|
||||
#ifndef _LIBNSGIF_H_
|
||||
#define _LIBNSGIF_H_
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
/* Error return values
|
||||
*/
|
||||
typedef enum {
|
||||
GIF_WORKING = 1,
|
||||
GIF_OK = 0,
|
||||
GIF_INSUFFICIENT_FRAME_DATA = -1,
|
||||
GIF_FRAME_DATA_ERROR = -2,
|
||||
GIF_INSUFFICIENT_DATA = -3,
|
||||
GIF_DATA_ERROR = -4,
|
||||
GIF_INSUFFICIENT_MEMORY = -5,
|
||||
GIF_FRAME_NO_DISPLAY = -6,
|
||||
GIF_END_OF_FRAME = -7
|
||||
} gif_result;
|
||||
|
||||
/* The GIF frame data
|
||||
*/
|
||||
typedef struct gif_frame {
|
||||
bool display; /**< whether the frame should be displayed/animated */
|
||||
unsigned int frame_delay; /**< delay (in cs) before animating the frame */
|
||||
/** Internal members are listed below
|
||||
*/
|
||||
unsigned int frame_pointer; /**< offset (in bytes) to the GIF frame data */
|
||||
bool virgin; /**< whether the frame has previously been used */
|
||||
bool opaque; /**< whether the frame is totally opaque */
|
||||
bool redraw_required; /**< whether a forcable screen redraw is required */
|
||||
unsigned char disposal_method; /**< how the previous frame should be disposed; affects plotting */
|
||||
bool transparency; /**< whether we acknoledge transparency */
|
||||
unsigned char transparency_index; /**< the index designating a transparent pixel */
|
||||
unsigned int redraw_x; /**< x co-ordinate of redraw rectangle */
|
||||
unsigned int redraw_y; /**< y co-ordinate of redraw rectangle */
|
||||
unsigned int redraw_width; /**< width of redraw rectangle */
|
||||
unsigned int redraw_height; /**< height of redraw rectangle */
|
||||
} gif_frame;
|
||||
|
||||
/* API for Bitmap callbacks
|
||||
*/
|
||||
typedef void* (*gif_bitmap_cb_create)(int width, int height);
|
||||
typedef void (*gif_bitmap_cb_destroy)(void *bitmap);
|
||||
typedef unsigned char* (*gif_bitmap_cb_get_buffer)(void *bitmap);
|
||||
typedef void (*gif_bitmap_cb_set_opaque)(void *bitmap, bool opaque);
|
||||
typedef bool (*gif_bitmap_cb_test_opaque)(void *bitmap);
|
||||
typedef void (*gif_bitmap_cb_modified)(void *bitmap);
|
||||
|
||||
/* The Bitmap callbacks function table
|
||||
*/
|
||||
typedef struct gif_bitmap_callback_vt {
|
||||
gif_bitmap_cb_create bitmap_create; /**< Create a bitmap. */
|
||||
gif_bitmap_cb_destroy bitmap_destroy; /**< Free a bitmap. */
|
||||
gif_bitmap_cb_get_buffer bitmap_get_buffer; /**< Return a pointer to the pixel data in a bitmap. */
|
||||
/** Members below are optional
|
||||
*/
|
||||
gif_bitmap_cb_set_opaque bitmap_set_opaque; /**< Sets whether a bitmap should be plotted opaque. */
|
||||
gif_bitmap_cb_test_opaque bitmap_test_opaque; /**< Tests whether a bitmap has an opaque alpha channel. */
|
||||
gif_bitmap_cb_modified bitmap_modified; /**< The bitmap image has changed, so flush any persistant cache. */
|
||||
} gif_bitmap_callback_vt;
|
||||
|
||||
/* The GIF animation data
|
||||
*/
|
||||
typedef struct gif_animation {
|
||||
gif_bitmap_callback_vt bitmap_callbacks; /**< callbacks for bitmap functions */
|
||||
unsigned char *gif_data; /**< pointer to GIF data */
|
||||
unsigned int width; /**< width of GIF (may increase during decoding) */
|
||||
unsigned int height; /**< heigth of GIF (may increase during decoding) */
|
||||
unsigned int frame_count; /**< number of frames decoded */
|
||||
unsigned int frame_count_partial; /**< number of frames partially decoded */
|
||||
gif_frame *frames; /**< decoded frames */
|
||||
int decoded_frame; /**< current frame decoded to bitmap */
|
||||
void *frame_image; /**< currently decoded image; stored as bitmap from bitmap_create callback */
|
||||
int loop_count; /**< number of times to loop animation */
|
||||
gif_result current_error; /**< current error type, or 0 for none*/
|
||||
/** Internal members are listed below
|
||||
*/
|
||||
unsigned int buffer_position; /**< current index into GIF data */
|
||||
unsigned int buffer_size; /**< total number of bytes of GIF data available */
|
||||
unsigned int frame_holders; /**< current number of frame holders */
|
||||
unsigned int background_index; /**< index in the colour table for the background colour */
|
||||
unsigned int aspect_ratio; /**< image aspect ratio (ignored) */
|
||||
unsigned int colour_table_size; /**< size of colour table (in entries) */
|
||||
bool global_colours; /**< whether the GIF has a global colour table */
|
||||
unsigned int *global_colour_table; /**< global colour table */
|
||||
unsigned int *local_colour_table; /**< local colour table */
|
||||
} gif_animation;
|
||||
|
||||
void gif_create(gif_animation *gif, gif_bitmap_callback_vt *bitmap_callbacks);
|
||||
gif_result gif_initialise(gif_animation *gif, size_t size, unsigned char *data);
|
||||
gif_result gif_decode_frame(gif_animation *gif, unsigned int frame);
|
||||
void gif_finalise(gif_animation *gif);
|
||||
|
||||
#endif
|
|
@ -0,0 +1,10 @@
|
|||
prefix=PREFIX
|
||||
exec_prefix=${prefix}
|
||||
libdir=${exec_prefix}/lib
|
||||
includedir=${prefix}/include
|
||||
|
||||
Name: libnsgif
|
||||
Description: Provides gif loading and conversion
|
||||
Version: VERSION
|
||||
Libs: -L${libdir} -lnsgif
|
||||
Cflags: -I${includedir}
|
|
@ -0,0 +1,4 @@
|
|||
# Sources
|
||||
DIR_SOURCES := libnsgif.c
|
||||
|
||||
include build/makefiles/Makefile.subdir
|
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
* Copyright 2003 James Bursa <bursa@users.sourceforge.net>
|
||||
* Copyright 2004 John Tytgat <John.Tytgat@aaug.net>
|
||||
*
|
||||
* This file is part of NetSurf, http://www.netsurf-browser.org/
|
||||
* Licenced under the MIT License,
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#ifndef _LIBNSGIF_LOG_H_
|
||||
#define _LIBNSGIF_LOG_H_
|
||||
|
||||
#ifdef NDEBUG
|
||||
# define LOG(x) ((void) 0)
|
||||
#else
|
||||
# define LOG(x) do { fprintf(stderr, x), fputc('\n', stderr); } while (0)
|
||||
#endif /* NDEBUG */
|
||||
|
||||
#endif /* _LIBNSGIF_LOG_H_ */
|
1
internal/c/parts/video/image/decode/gif/log.txt
Normal file
1
internal/c/parts/video/image/decode/gif/log.txt
Normal file
|
@ -0,0 +1 @@
|
|||
-Download from http://www.netsurf-browser.org/projects/libnsgif/
|
62
internal/c/parts/video/image/decode/gif/src.c
Normal file
62
internal/c/parts/video/image/decode/gif/src.c
Normal file
|
@ -0,0 +1,62 @@
|
|||
#ifdef QB64_BACKSLASH_FILESYSTEM
|
||||
#include "src\\libnsgif.c"
|
||||
#else
|
||||
#include "src/libnsgif.c"
|
||||
#endif
|
||||
|
||||
uint8 *image_decode_gif(uint8 *content,int32 bytes,int32 *result,int32 *x,int32 *y){
|
||||
//Result:bit 1=Success,bit 2=32bit[BGRA]
|
||||
*result=0;
|
||||
|
||||
int32 h,w;
|
||||
uint8 *out;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
*result=1+2;
|
||||
*x=w;
|
||||
*y=h;
|
||||
return out;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
BMP bm;
|
||||
|
||||
if(!bm.ReadFromMemory((char*)content, bytes)){
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
h=bm.TellHeight();
|
||||
w=bm.TellWidth();
|
||||
|
||||
uint8 *out;
|
||||
out=(uint8*)malloc(h*w*4);
|
||||
|
||||
uint8* o;
|
||||
int32 x2,y2;
|
||||
o=out;
|
||||
for (y2=0;y2<h;y2++){
|
||||
for (x2=0;x2<w;x2++){
|
||||
*o=bm(x2,y2)->Blue; o++;
|
||||
*o=bm(x2,y2)->Green; o++;
|
||||
*o=bm(x2,y2)->Red; o++;
|
||||
*o=255; o++;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
1285
internal/c/parts/video/image/decode/gif/src/libnsgif.c
Normal file
1285
internal/c/parts/video/image/decode/gif/src/libnsgif.c
Normal file
File diff suppressed because it is too large
Load diff
108
internal/c/parts/video/image/decode/gif/src/libnsgif.h
Normal file
108
internal/c/parts/video/image/decode/gif/src/libnsgif.h
Normal file
|
@ -0,0 +1,108 @@
|
|||
/*
|
||||
* Copyright 2004 Richard Wilson <richard.wilson@netsurf-browser.org>
|
||||
* Copyright 2008 Sean Fox <dyntryx@gmail.com>
|
||||
*
|
||||
* This file is part of NetSurf's libnsgif, http://www.netsurf-browser.org/
|
||||
* Licenced under the MIT License,
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
*/
|
||||
|
||||
/** \file
|
||||
* Progressive animated GIF file decoding (interface).
|
||||
*/
|
||||
|
||||
#ifndef _LIBNSGIF_H_
|
||||
#define _LIBNSGIF_H_
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
/* Error return values
|
||||
*/
|
||||
typedef enum {
|
||||
GIF_WORKING = 1,
|
||||
GIF_OK = 0,
|
||||
GIF_INSUFFICIENT_FRAME_DATA = -1,
|
||||
GIF_FRAME_DATA_ERROR = -2,
|
||||
GIF_INSUFFICIENT_DATA = -3,
|
||||
GIF_DATA_ERROR = -4,
|
||||
GIF_INSUFFICIENT_MEMORY = -5,
|
||||
GIF_FRAME_NO_DISPLAY = -6,
|
||||
GIF_END_OF_FRAME = -7
|
||||
} gif_result;
|
||||
|
||||
/* The GIF frame data
|
||||
*/
|
||||
typedef struct gif_frame {
|
||||
bool display; /**< whether the frame should be displayed/animated */
|
||||
unsigned int frame_delay; /**< delay (in cs) before animating the frame */
|
||||
/** Internal members are listed below
|
||||
*/
|
||||
unsigned int frame_pointer; /**< offset (in bytes) to the GIF frame data */
|
||||
bool virgin; /**< whether the frame has previously been used */
|
||||
bool opaque; /**< whether the frame is totally opaque */
|
||||
bool redraw_required; /**< whether a forcable screen redraw is required */
|
||||
unsigned char disposal_method; /**< how the previous frame should be disposed; affects plotting */
|
||||
bool transparency; /**< whether we acknoledge transparency */
|
||||
unsigned char transparency_index; /**< the index designating a transparent pixel */
|
||||
unsigned int redraw_x; /**< x co-ordinate of redraw rectangle */
|
||||
unsigned int redraw_y; /**< y co-ordinate of redraw rectangle */
|
||||
unsigned int redraw_width; /**< width of redraw rectangle */
|
||||
unsigned int redraw_height; /**< height of redraw rectangle */
|
||||
} gif_frame;
|
||||
|
||||
/* API for Bitmap callbacks
|
||||
*/
|
||||
typedef void* (*gif_bitmap_cb_create)(int width, int height);
|
||||
typedef void (*gif_bitmap_cb_destroy)(void *bitmap);
|
||||
typedef unsigned char* (*gif_bitmap_cb_get_buffer)(void *bitmap);
|
||||
typedef void (*gif_bitmap_cb_set_opaque)(void *bitmap, bool opaque);
|
||||
typedef bool (*gif_bitmap_cb_test_opaque)(void *bitmap);
|
||||
typedef void (*gif_bitmap_cb_modified)(void *bitmap);
|
||||
|
||||
/* The Bitmap callbacks function table
|
||||
*/
|
||||
typedef struct gif_bitmap_callback_vt {
|
||||
gif_bitmap_cb_create bitmap_create; /**< Create a bitmap. */
|
||||
gif_bitmap_cb_destroy bitmap_destroy; /**< Free a bitmap. */
|
||||
gif_bitmap_cb_get_buffer bitmap_get_buffer; /**< Return a pointer to the pixel data in a bitmap. */
|
||||
/** Members below are optional
|
||||
*/
|
||||
gif_bitmap_cb_set_opaque bitmap_set_opaque; /**< Sets whether a bitmap should be plotted opaque. */
|
||||
gif_bitmap_cb_test_opaque bitmap_test_opaque; /**< Tests whether a bitmap has an opaque alpha channel. */
|
||||
gif_bitmap_cb_modified bitmap_modified; /**< The bitmap image has changed, so flush any persistant cache. */
|
||||
} gif_bitmap_callback_vt;
|
||||
|
||||
/* The GIF animation data
|
||||
*/
|
||||
typedef struct gif_animation {
|
||||
gif_bitmap_callback_vt bitmap_callbacks; /**< callbacks for bitmap functions */
|
||||
unsigned char *gif_data; /**< pointer to GIF data */
|
||||
unsigned int width; /**< width of GIF (may increase during decoding) */
|
||||
unsigned int height; /**< heigth of GIF (may increase during decoding) */
|
||||
unsigned int frame_count; /**< number of frames decoded */
|
||||
unsigned int frame_count_partial; /**< number of frames partially decoded */
|
||||
gif_frame *frames; /**< decoded frames */
|
||||
int decoded_frame; /**< current frame decoded to bitmap */
|
||||
void *frame_image; /**< currently decoded image; stored as bitmap from bitmap_create callback */
|
||||
int loop_count; /**< number of times to loop animation */
|
||||
gif_result current_error; /**< current error type, or 0 for none*/
|
||||
/** Internal members are listed below
|
||||
*/
|
||||
unsigned int buffer_position; /**< current index into GIF data */
|
||||
unsigned int buffer_size; /**< total number of bytes of GIF data available */
|
||||
unsigned int frame_holders; /**< current number of frame holders */
|
||||
unsigned int background_index; /**< index in the colour table for the background colour */
|
||||
unsigned int aspect_ratio; /**< image aspect ratio (ignored) */
|
||||
unsigned int colour_table_size; /**< size of colour table (in entries) */
|
||||
bool global_colours; /**< whether the GIF has a global colour table */
|
||||
unsigned int *global_colour_table; /**< global colour table */
|
||||
unsigned int *local_colour_table; /**< local colour table */
|
||||
} gif_animation;
|
||||
|
||||
void gif_create(gif_animation *gif, gif_bitmap_callback_vt *bitmap_callbacks);
|
||||
gif_result gif_initialise(gif_animation *gif, size_t size, unsigned char *data);
|
||||
gif_result gif_decode_frame(gif_animation *gif, unsigned int frame);
|
||||
void gif_finalise(gif_animation *gif);
|
||||
|
||||
#endif
|
21
internal/c/parts/video/image/decode/gif/src/utils/log.h
Normal file
21
internal/c/parts/video/image/decode/gif/src/utils/log.h
Normal file
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
* Copyright 2003 James Bursa <bursa@users.sourceforge.net>
|
||||
* Copyright 2004 John Tytgat <John.Tytgat@aaug.net>
|
||||
*
|
||||
* This file is part of NetSurf, http://www.netsurf-browser.org/
|
||||
* Licenced under the MIT License,
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#ifndef _LIBNSGIF_LOG_H_
|
||||
#define _LIBNSGIF_LOG_H_
|
||||
|
||||
#ifdef NDEBUG
|
||||
# define LOG(x) ((void) 0)
|
||||
#else
|
||||
# define LOG(x) do { fprintf(stderr, x), fputc('\n', stderr); } while (0)
|
||||
#endif /* NDEBUG */
|
||||
|
||||
#endif /* _LIBNSGIF_LOG_H_ */
|
|
@ -517,7 +517,7 @@ extern void sub_rmdir(qbs *str);
|
|||
extern long double pow2(long double x,long double y);
|
||||
extern int32 func_freefile();
|
||||
extern void sub__mousehide();
|
||||
extern void sub__mouseshow();
|
||||
extern void sub__mouseshow(qbs *style, int32 passed);
|
||||
extern float func__mousex();
|
||||
extern float func__mousey();
|
||||
extern int32 func__mouseinput();
|
||||
|
@ -1016,7 +1016,8 @@ int32 run_from_line=0;
|
|||
//run_from_line's value is an index in a list of possible "run from" locations
|
||||
//when 0, the program runs from the beginning
|
||||
|
||||
void sub__icon(int32 i);
|
||||
void sub__icon(int32 i, int32 i2, int32 passed);
|
||||
|
||||
|
||||
void sub__display();
|
||||
void sub__autodisplay();
|
||||
|
|
|
@ -1,6 +1,66 @@
|
|||
if (__ARRAY_STRING_ONAME[2]&1){
|
||||
if (__ARRAY_STRING_ONAME[2]&2){
|
||||
tmp_long=__ARRAY_STRING_ONAME[5];
|
||||
while(tmp_long--){
|
||||
((qbs*)(((uint64*)(__ARRAY_STRING_ONAME[0]))[tmp_long]))->len=0;
|
||||
}
|
||||
}else{
|
||||
tmp_long=__ARRAY_STRING_ONAME[5];
|
||||
while(tmp_long--){
|
||||
qbs_free((qbs*)(((uint64*)(__ARRAY_STRING_ONAME[0]))[tmp_long]));
|
||||
}
|
||||
free((void*)(__ARRAY_STRING_ONAME[0]));
|
||||
__ARRAY_STRING_ONAME[2]^=1;
|
||||
__ARRAY_STRING_ONAME[4]=2147483647;
|
||||
__ARRAY_STRING_ONAME[5]=0;
|
||||
__ARRAY_STRING_ONAME[6]=0;
|
||||
__ARRAY_STRING_ONAME[0]=(ptrszint)¬hingstring;
|
||||
}
|
||||
}
|
||||
if (__ARRAY_INTEGER_PL[2]&1){
|
||||
if (__ARRAY_INTEGER_PL[2]&2){
|
||||
memset((void*)(__ARRAY_INTEGER_PL[0]),0,__ARRAY_INTEGER_PL[5]*2);
|
||||
}else{
|
||||
if (__ARRAY_INTEGER_PL[2]&4){
|
||||
cmem_dynamic_free((uint8*)(__ARRAY_INTEGER_PL[0]));
|
||||
}else{
|
||||
free((void*)(__ARRAY_INTEGER_PL[0]));
|
||||
}
|
||||
__ARRAY_INTEGER_PL[2]^=1;
|
||||
__ARRAY_INTEGER_PL[4]=2147483647;
|
||||
__ARRAY_INTEGER_PL[5]=0;
|
||||
__ARRAY_INTEGER_PL[6]=0;
|
||||
__ARRAY_INTEGER_PL[0]=(ptrszint)nothingvalue;
|
||||
}
|
||||
}
|
||||
if (__ARRAY_STRING_VARS[2]&1){
|
||||
if (__ARRAY_STRING_VARS[2]&2){
|
||||
tmp_long=__ARRAY_STRING_VARS[5];
|
||||
while(tmp_long--){
|
||||
((qbs*)(((uint64*)(__ARRAY_STRING_VARS[0]))[tmp_long]))->len=0;
|
||||
}
|
||||
}else{
|
||||
tmp_long=__ARRAY_STRING_VARS[5];
|
||||
while(tmp_long--){
|
||||
qbs_free((qbs*)(((uint64*)(__ARRAY_STRING_VARS[0]))[tmp_long]));
|
||||
}
|
||||
free((void*)(__ARRAY_STRING_VARS[0]));
|
||||
__ARRAY_STRING_VARS[2]^=1;
|
||||
__ARRAY_STRING_VARS[4]=2147483647;
|
||||
__ARRAY_STRING_VARS[5]=0;
|
||||
__ARRAY_STRING_VARS[6]=0;
|
||||
__ARRAY_STRING_VARS[0]=(ptrszint)¬hingstring;
|
||||
}
|
||||
}
|
||||
__STRING_FILENAME->len=0;
|
||||
__STRING_DIRNAME->len=0;
|
||||
*__INTEGER_QUICKRETURN=0;
|
||||
*__LONG_MAKEANDROID=0;
|
||||
*__LONG_ALLOWUPDATES=0;
|
||||
*__LONG_IDEBUILDMODECHANGED=0;
|
||||
__STRING_REFACTOR_SOURCE->len=0;
|
||||
__STRING_REFACTOR_DEST->len=0;
|
||||
*__LONG_FH=0;
|
||||
*__LONG_INCLUDE_GDB_DEBUGGING_INFO=0;
|
||||
*__LONG_DEPENDENCY_LAST=0;
|
||||
if (__ARRAY_LONG_DEPENDENCY[2]&1){
|
||||
|
@ -2130,7 +2190,6 @@ __STRING_FILE_NAMESPACE->len=0;
|
|||
*__LONG_A=0;
|
||||
*__LONG_EX_FH=0;
|
||||
*__LONG_CLOSEALL=0;
|
||||
*__LONG_FH=0;
|
||||
*__LONG_LASTUNRESOLVED=0;
|
||||
*__LONG_RESIZE=0;
|
||||
*__LONG_RESIZE_SCALE=0;
|
||||
|
@ -2148,6 +2207,7 @@ __STRING_MYLIBOPT->len=0;
|
|||
*__LONG_I2=0;
|
||||
*__LONG_I3=0;
|
||||
*__LONG_IDERECOMPILE=0;
|
||||
__STRING_WHOLESTV->len=0;
|
||||
__STRING_CWHOLELINE->len=0;
|
||||
*__LONG_WHOLELINEN=0;
|
||||
*__LONG_WHOLELINEI=0;
|
||||
|
@ -2174,6 +2234,22 @@ __STRING_HASHNAME->len=0;
|
|||
*__LONG_U=0;
|
||||
*__LONG_HASHFLAGS=0;
|
||||
*__LONG_ALLOW=0;
|
||||
*__LONG_ALTERED=0;
|
||||
*__LONG_FINISHED=0;
|
||||
*__LONG_L=0;
|
||||
__STRING_L->len=0;
|
||||
*__LONG_VP=0;
|
||||
*__LONG_FIRST=0;
|
||||
*__LONG_SECOND=0;
|
||||
*__LONG_THIRD=0;
|
||||
*__LONG_FOURTH=0;
|
||||
__STRING_RED->len=0;
|
||||
__STRING_GREEN->len=0;
|
||||
__STRING_BLUE->len=0;
|
||||
__STRING_ALPHA->len=0;
|
||||
__STRING_VAL->len=0;
|
||||
*__LONG_WI=0;
|
||||
*__LONG_CLR=0;
|
||||
*__LONG_PENDING=0;
|
||||
*__LONG_TYPEOVERRIDE=0;
|
||||
__STRING_S->len=0;
|
||||
|
@ -2232,7 +2308,6 @@ __STRING_E1->len=0;
|
|||
*__LONG_EXCEPT=0;
|
||||
__STRING_AA->len=0;
|
||||
*__LONG_LASTFUSE=0;
|
||||
__STRING_L->len=0;
|
||||
*__LONG_V1=0;
|
||||
*__LONG_V2=0;
|
||||
*__LONG_DEFININGTYPEERROR=0;
|
||||
|
|
|
@ -3,21 +3,6 @@ if(_SUB_HELP_PREVIEW_LONG_I==NULL){
|
|||
_SUB_HELP_PREVIEW_LONG_I=(int32*)mem_static_malloc(4);
|
||||
*_SUB_HELP_PREVIEW_LONG_I=0;
|
||||
}
|
||||
int64 fornext_value1915;
|
||||
int64 fornext_finalvalue1915;
|
||||
int64 fornext_step1915;
|
||||
uint8 fornext_step_negative1915;
|
||||
byte_element_struct *byte_element_1916=NULL;
|
||||
if (!byte_element_1916){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_1916=(byte_element_struct*)(mem_static_pointer-12); else byte_element_1916=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_SUB_HELP_PREVIEW_LONG_C=NULL;
|
||||
if(_SUB_HELP_PREVIEW_LONG_C==NULL){
|
||||
_SUB_HELP_PREVIEW_LONG_C=(int32*)mem_static_malloc(4);
|
||||
*_SUB_HELP_PREVIEW_LONG_C=0;
|
||||
}
|
||||
qbs *_SUB_HELP_PREVIEW_STRING_C=NULL;
|
||||
if (!_SUB_HELP_PREVIEW_STRING_C)_SUB_HELP_PREVIEW_STRING_C=qbs_new(0,0);
|
||||
int64 fornext_value1919;
|
||||
int64 fornext_finalvalue1919;
|
||||
int64 fornext_step1919;
|
||||
|
@ -26,6 +11,21 @@ byte_element_struct *byte_element_1920=NULL;
|
|||
if (!byte_element_1920){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_1920=(byte_element_struct*)(mem_static_pointer-12); else byte_element_1920=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_SUB_HELP_PREVIEW_LONG_C=NULL;
|
||||
if(_SUB_HELP_PREVIEW_LONG_C==NULL){
|
||||
_SUB_HELP_PREVIEW_LONG_C=(int32*)mem_static_malloc(4);
|
||||
*_SUB_HELP_PREVIEW_LONG_C=0;
|
||||
}
|
||||
qbs *_SUB_HELP_PREVIEW_STRING_C=NULL;
|
||||
if (!_SUB_HELP_PREVIEW_STRING_C)_SUB_HELP_PREVIEW_STRING_C=qbs_new(0,0);
|
||||
int64 fornext_value1923;
|
||||
int64 fornext_finalvalue1923;
|
||||
int64 fornext_step1923;
|
||||
uint8 fornext_step_negative1923;
|
||||
byte_element_struct *byte_element_1924=NULL;
|
||||
if (!byte_element_1924){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_1924=(byte_element_struct*)(mem_static_pointer-12); else byte_element_1924=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_SUB_HELP_PREVIEW_LONG_COL=NULL;
|
||||
if(_SUB_HELP_PREVIEW_LONG_COL==NULL){
|
||||
_SUB_HELP_PREVIEW_LONG_COL=(int32*)mem_static_malloc(4);
|
||||
|
|
|
@ -18,10 +18,10 @@ if(_FUNC_IDEHBAR_LONG_X2==NULL){
|
|||
_FUNC_IDEHBAR_LONG_X2=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDEHBAR_LONG_X2=0;
|
||||
}
|
||||
int64 fornext_value3989;
|
||||
int64 fornext_finalvalue3989;
|
||||
int64 fornext_step3989;
|
||||
uint8 fornext_step_negative3989;
|
||||
int64 fornext_value3996;
|
||||
int64 fornext_finalvalue3996;
|
||||
int64 fornext_step3996;
|
||||
uint8 fornext_step_negative3996;
|
||||
float *_FUNC_IDEHBAR_SINGLE_P=NULL;
|
||||
if(_FUNC_IDEHBAR_SINGLE_P==NULL){
|
||||
_FUNC_IDEHBAR_SINGLE_P=(float*)mem_static_malloc(4);
|
||||
|
|
|
@ -3,21 +3,21 @@ if(_FUNC_IDEHLEN_LONG_IDEHLEN==NULL){
|
|||
_FUNC_IDEHLEN_LONG_IDEHLEN=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDEHLEN_LONG_IDEHLEN=0;
|
||||
}
|
||||
qbs*oldstr3995=NULL;
|
||||
qbs*oldstr4002=NULL;
|
||||
if(_FUNC_IDEHLEN_STRING_A->tmp||_FUNC_IDEHLEN_STRING_A->fixed||_FUNC_IDEHLEN_STRING_A->readonly){
|
||||
oldstr3995=_FUNC_IDEHLEN_STRING_A;
|
||||
if (oldstr3995->cmem_descriptor){
|
||||
_FUNC_IDEHLEN_STRING_A=qbs_new_cmem(oldstr3995->len,0);
|
||||
oldstr4002=_FUNC_IDEHLEN_STRING_A;
|
||||
if (oldstr4002->cmem_descriptor){
|
||||
_FUNC_IDEHLEN_STRING_A=qbs_new_cmem(oldstr4002->len,0);
|
||||
}else{
|
||||
_FUNC_IDEHLEN_STRING_A=qbs_new(oldstr3995->len,0);
|
||||
_FUNC_IDEHLEN_STRING_A=qbs_new(oldstr4002->len,0);
|
||||
}
|
||||
memcpy(_FUNC_IDEHLEN_STRING_A->chr,oldstr3995->chr,oldstr3995->len);
|
||||
memcpy(_FUNC_IDEHLEN_STRING_A->chr,oldstr4002->chr,oldstr4002->len);
|
||||
}
|
||||
byte_element_struct *byte_element_3996=NULL;
|
||||
if (!byte_element_3996){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_3996=(byte_element_struct*)(mem_static_pointer-12); else byte_element_3996=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4003=NULL;
|
||||
if (!byte_element_4003){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4003=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4003=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_3997=NULL;
|
||||
if (!byte_element_3997){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_3997=(byte_element_struct*)(mem_static_pointer-12); else byte_element_3997=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4004=NULL;
|
||||
if (!byte_element_4004){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4004=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4004=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
|
|
|
@ -1,25 +1,25 @@
|
|||
qbs*oldstr3998=NULL;
|
||||
qbs*oldstr4005=NULL;
|
||||
if(_SUB_IDEHPRINT_STRING_A->tmp||_SUB_IDEHPRINT_STRING_A->fixed||_SUB_IDEHPRINT_STRING_A->readonly){
|
||||
oldstr3998=_SUB_IDEHPRINT_STRING_A;
|
||||
if (oldstr3998->cmem_descriptor){
|
||||
_SUB_IDEHPRINT_STRING_A=qbs_new_cmem(oldstr3998->len,0);
|
||||
oldstr4005=_SUB_IDEHPRINT_STRING_A;
|
||||
if (oldstr4005->cmem_descriptor){
|
||||
_SUB_IDEHPRINT_STRING_A=qbs_new_cmem(oldstr4005->len,0);
|
||||
}else{
|
||||
_SUB_IDEHPRINT_STRING_A=qbs_new(oldstr3998->len,0);
|
||||
_SUB_IDEHPRINT_STRING_A=qbs_new(oldstr4005->len,0);
|
||||
}
|
||||
memcpy(_SUB_IDEHPRINT_STRING_A->chr,oldstr3998->chr,oldstr3998->len);
|
||||
memcpy(_SUB_IDEHPRINT_STRING_A->chr,oldstr4005->chr,oldstr4005->len);
|
||||
}
|
||||
int32 *_SUB_IDEHPRINT_LONG_I=NULL;
|
||||
if(_SUB_IDEHPRINT_LONG_I==NULL){
|
||||
_SUB_IDEHPRINT_LONG_I=(int32*)mem_static_malloc(4);
|
||||
*_SUB_IDEHPRINT_LONG_I=0;
|
||||
}
|
||||
int64 fornext_value4000;
|
||||
int64 fornext_finalvalue4000;
|
||||
int64 fornext_step4000;
|
||||
uint8 fornext_step_negative4000;
|
||||
byte_element_struct *byte_element_4001=NULL;
|
||||
if (!byte_element_4001){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4001=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4001=(byte_element_struct*)mem_static_malloc(12);
|
||||
int64 fornext_value4007;
|
||||
int64 fornext_finalvalue4007;
|
||||
int64 fornext_step4007;
|
||||
uint8 fornext_step_negative4007;
|
||||
byte_element_struct *byte_element_4008=NULL;
|
||||
if (!byte_element_4008){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4008=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4008=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
qbs *_SUB_IDEHPRINT_STRING_C=NULL;
|
||||
if (!_SUB_IDEHPRINT_STRING_C)_SUB_IDEHPRINT_STRING_C=qbs_new(0,0);
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
qbs*oldstr4003=NULL;
|
||||
qbs*oldstr4010=NULL;
|
||||
if(_SUB_IDEINSLINE_STRING_TEXT->tmp||_SUB_IDEINSLINE_STRING_TEXT->fixed||_SUB_IDEINSLINE_STRING_TEXT->readonly){
|
||||
oldstr4003=_SUB_IDEINSLINE_STRING_TEXT;
|
||||
if (oldstr4003->cmem_descriptor){
|
||||
_SUB_IDEINSLINE_STRING_TEXT=qbs_new_cmem(oldstr4003->len,0);
|
||||
oldstr4010=_SUB_IDEINSLINE_STRING_TEXT;
|
||||
if (oldstr4010->cmem_descriptor){
|
||||
_SUB_IDEINSLINE_STRING_TEXT=qbs_new_cmem(oldstr4010->len,0);
|
||||
}else{
|
||||
_SUB_IDEINSLINE_STRING_TEXT=qbs_new(oldstr4003->len,0);
|
||||
_SUB_IDEINSLINE_STRING_TEXT=qbs_new(oldstr4010->len,0);
|
||||
}
|
||||
memcpy(_SUB_IDEINSLINE_STRING_TEXT->chr,oldstr4003->chr,oldstr4003->len);
|
||||
memcpy(_SUB_IDEINSLINE_STRING_TEXT->chr,oldstr4010->chr,oldstr4010->len);
|
||||
}
|
||||
int32 *_SUB_IDEINSLINE_LONG_B=NULL;
|
||||
if(_SUB_IDEINSLINE_LONG_B==NULL){
|
||||
_SUB_IDEINSLINE_LONG_B=(int32*)mem_static_malloc(4);
|
||||
*_SUB_IDEINSLINE_LONG_B=0;
|
||||
}
|
||||
int64 fornext_value4005;
|
||||
int64 fornext_finalvalue4005;
|
||||
int64 fornext_step4005;
|
||||
uint8 fornext_step_negative4005;
|
||||
int64 fornext_value4012;
|
||||
int64 fornext_finalvalue4012;
|
||||
int64 fornext_step4012;
|
||||
uint8 fornext_step_negative4012;
|
||||
int32 *_SUB_IDEINSLINE_LONG_Y=NULL;
|
||||
if(_SUB_IDEINSLINE_LONG_Y==NULL){
|
||||
_SUB_IDEINSLINE_LONG_Y=(int32*)mem_static_malloc(4);
|
||||
|
@ -27,11 +27,11 @@ if(_SUB_IDEINSLINE_LONG_TEXTLEN==NULL){
|
|||
_SUB_IDEINSLINE_LONG_TEXTLEN=(int32*)mem_static_malloc(4);
|
||||
*_SUB_IDEINSLINE_LONG_TEXTLEN=0;
|
||||
}
|
||||
byte_element_struct *byte_element_4006=NULL;
|
||||
if (!byte_element_4006){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4006=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4006=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4013=NULL;
|
||||
if (!byte_element_4013){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4013=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4013=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4007=NULL;
|
||||
if (!byte_element_4007){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4007=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4007=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4014=NULL;
|
||||
if (!byte_element_4014){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4014=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4014=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
qbs*oldstr4008=NULL;
|
||||
qbs*oldstr4015=NULL;
|
||||
if(_SUB_IDENEWSF_STRING_SF->tmp||_SUB_IDENEWSF_STRING_SF->fixed||_SUB_IDENEWSF_STRING_SF->readonly){
|
||||
oldstr4008=_SUB_IDENEWSF_STRING_SF;
|
||||
if (oldstr4008->cmem_descriptor){
|
||||
_SUB_IDENEWSF_STRING_SF=qbs_new_cmem(oldstr4008->len,0);
|
||||
oldstr4015=_SUB_IDENEWSF_STRING_SF;
|
||||
if (oldstr4015->cmem_descriptor){
|
||||
_SUB_IDENEWSF_STRING_SF=qbs_new_cmem(oldstr4015->len,0);
|
||||
}else{
|
||||
_SUB_IDENEWSF_STRING_SF=qbs_new(oldstr4008->len,0);
|
||||
_SUB_IDENEWSF_STRING_SF=qbs_new(oldstr4015->len,0);
|
||||
}
|
||||
memcpy(_SUB_IDENEWSF_STRING_SF->chr,oldstr4008->chr,oldstr4008->len);
|
||||
memcpy(_SUB_IDENEWSF_STRING_SF->chr,oldstr4015->chr,oldstr4015->len);
|
||||
}
|
||||
int32 *_SUB_IDENEWSF_LONG_FOCUS=NULL;
|
||||
if(_SUB_IDENEWSF_LONG_FOCUS==NULL){
|
||||
|
@ -59,29 +59,29 @@ if(_SUB_IDENEWSF_LONG_X==NULL){
|
|||
_SUB_IDENEWSF_LONG_X=(int32*)mem_static_malloc(4);
|
||||
*_SUB_IDENEWSF_LONG_X=0;
|
||||
}
|
||||
int64 fornext_value4010;
|
||||
int64 fornext_finalvalue4010;
|
||||
int64 fornext_step4010;
|
||||
uint8 fornext_step_negative4010;
|
||||
byte_element_struct *byte_element_4011=NULL;
|
||||
if (!byte_element_4011){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4011=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4011=(byte_element_struct*)mem_static_malloc(12);
|
||||
int64 fornext_value4017;
|
||||
int64 fornext_finalvalue4017;
|
||||
int64 fornext_step4017;
|
||||
uint8 fornext_step_negative4017;
|
||||
byte_element_struct *byte_element_4018=NULL;
|
||||
if (!byte_element_4018){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4018=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4018=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_SUB_IDENEWSF_LONG_I=NULL;
|
||||
if(_SUB_IDENEWSF_LONG_I==NULL){
|
||||
_SUB_IDENEWSF_LONG_I=(int32*)mem_static_malloc(4);
|
||||
*_SUB_IDENEWSF_LONG_I=0;
|
||||
}
|
||||
int32 pass4012;
|
||||
int32 pass4013;
|
||||
byte_element_struct *byte_element_4014=NULL;
|
||||
if (!byte_element_4014){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4014=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4014=(byte_element_struct*)mem_static_malloc(12);
|
||||
int32 pass4019;
|
||||
int32 pass4020;
|
||||
byte_element_struct *byte_element_4021=NULL;
|
||||
if (!byte_element_4021){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4021=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4021=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int64 fornext_value4016;
|
||||
int64 fornext_finalvalue4016;
|
||||
int64 fornext_step4016;
|
||||
uint8 fornext_step_negative4016;
|
||||
int64 fornext_value4023;
|
||||
int64 fornext_finalvalue4023;
|
||||
int64 fornext_step4023;
|
||||
uint8 fornext_step_negative4023;
|
||||
int32 *_SUB_IDENEWSF_LONG_F=NULL;
|
||||
if(_SUB_IDENEWSF_LONG_F==NULL){
|
||||
_SUB_IDENEWSF_LONG_F=(int32*)mem_static_malloc(4);
|
||||
|
@ -97,10 +97,10 @@ if(_SUB_IDENEWSF_LONG_CY==NULL){
|
|||
_SUB_IDENEWSF_LONG_CY=(int32*)mem_static_malloc(4);
|
||||
*_SUB_IDENEWSF_LONG_CY=0;
|
||||
}
|
||||
int64 fornext_value4019;
|
||||
int64 fornext_finalvalue4019;
|
||||
int64 fornext_step4019;
|
||||
uint8 fornext_step_negative4019;
|
||||
int64 fornext_value4026;
|
||||
int64 fornext_finalvalue4026;
|
||||
int64 fornext_step4026;
|
||||
uint8 fornext_step_negative4026;
|
||||
int32 *_SUB_IDENEWSF_LONG_LASTFOCUS=NULL;
|
||||
if(_SUB_IDENEWSF_LONG_LASTFOCUS==NULL){
|
||||
_SUB_IDENEWSF_LONG_LASTFOCUS=(int32*)mem_static_malloc(4);
|
||||
|
@ -133,9 +133,9 @@ _SUB_IDENEWSF_LONG_OLDALT=(int32*)mem_static_malloc(4);
|
|||
}
|
||||
qbs *_SUB_IDENEWSF_STRING_ALTLETTER=NULL;
|
||||
if (!_SUB_IDENEWSF_STRING_ALTLETTER)_SUB_IDENEWSF_STRING_ALTLETTER=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4021=NULL;
|
||||
if (!byte_element_4021){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4021=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4021=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4028=NULL;
|
||||
if (!byte_element_4028){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4028=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4028=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_SUB_IDENEWSF_LONG_K=NULL;
|
||||
if(_SUB_IDENEWSF_LONG_K==NULL){
|
||||
|
@ -147,10 +147,10 @@ if(_SUB_IDENEWSF_LONG_INFO==NULL){
|
|||
_SUB_IDENEWSF_LONG_INFO=(int32*)mem_static_malloc(4);
|
||||
*_SUB_IDENEWSF_LONG_INFO=0;
|
||||
}
|
||||
int64 fornext_value4023;
|
||||
int64 fornext_finalvalue4023;
|
||||
int64 fornext_step4023;
|
||||
uint8 fornext_step_negative4023;
|
||||
int64 fornext_value4030;
|
||||
int64 fornext_finalvalue4030;
|
||||
int64 fornext_step4030;
|
||||
uint8 fornext_step_negative4030;
|
||||
int32 *_SUB_IDENEWSF_LONG_T=NULL;
|
||||
if(_SUB_IDENEWSF_LONG_T==NULL){
|
||||
_SUB_IDENEWSF_LONG_T=(int32*)mem_static_malloc(4);
|
||||
|
|
|
@ -3,13 +3,13 @@ if(_FUNC_IDENEWTXT_LONG_IDENEWTXT==NULL){
|
|||
_FUNC_IDENEWTXT_LONG_IDENEWTXT=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDENEWTXT_LONG_IDENEWTXT=0;
|
||||
}
|
||||
qbs*oldstr4024=NULL;
|
||||
qbs*oldstr4031=NULL;
|
||||
if(_FUNC_IDENEWTXT_STRING_A->tmp||_FUNC_IDENEWTXT_STRING_A->fixed||_FUNC_IDENEWTXT_STRING_A->readonly){
|
||||
oldstr4024=_FUNC_IDENEWTXT_STRING_A;
|
||||
if (oldstr4024->cmem_descriptor){
|
||||
_FUNC_IDENEWTXT_STRING_A=qbs_new_cmem(oldstr4024->len,0);
|
||||
oldstr4031=_FUNC_IDENEWTXT_STRING_A;
|
||||
if (oldstr4031->cmem_descriptor){
|
||||
_FUNC_IDENEWTXT_STRING_A=qbs_new_cmem(oldstr4031->len,0);
|
||||
}else{
|
||||
_FUNC_IDENEWTXT_STRING_A=qbs_new(oldstr4024->len,0);
|
||||
_FUNC_IDENEWTXT_STRING_A=qbs_new(oldstr4031->len,0);
|
||||
}
|
||||
memcpy(_FUNC_IDENEWTXT_STRING_A->chr,oldstr4024->chr,oldstr4024->len);
|
||||
memcpy(_FUNC_IDENEWTXT_STRING_A->chr,oldstr4031->chr,oldstr4031->len);
|
||||
}
|
||||
|
|
|
@ -35,12 +35,12 @@ if(_SUB_IDENOMATCH_LONG_I==NULL){
|
|||
_SUB_IDENOMATCH_LONG_I=(int32*)mem_static_malloc(4);
|
||||
*_SUB_IDENOMATCH_LONG_I=0;
|
||||
}
|
||||
int32 pass4025;
|
||||
int32 pass4026;
|
||||
int64 fornext_value4028;
|
||||
int64 fornext_finalvalue4028;
|
||||
int64 fornext_step4028;
|
||||
uint8 fornext_step_negative4028;
|
||||
int32 pass4032;
|
||||
int32 pass4033;
|
||||
int64 fornext_value4035;
|
||||
int64 fornext_finalvalue4035;
|
||||
int64 fornext_step4035;
|
||||
uint8 fornext_step_negative4035;
|
||||
int32 *_SUB_IDENOMATCH_LONG_F=NULL;
|
||||
if(_SUB_IDENOMATCH_LONG_F==NULL){
|
||||
_SUB_IDENOMATCH_LONG_F=(int32*)mem_static_malloc(4);
|
||||
|
@ -56,10 +56,10 @@ if(_SUB_IDENOMATCH_LONG_CY==NULL){
|
|||
_SUB_IDENOMATCH_LONG_CY=(int32*)mem_static_malloc(4);
|
||||
*_SUB_IDENOMATCH_LONG_CY=0;
|
||||
}
|
||||
int64 fornext_value4031;
|
||||
int64 fornext_finalvalue4031;
|
||||
int64 fornext_step4031;
|
||||
uint8 fornext_step_negative4031;
|
||||
int64 fornext_value4038;
|
||||
int64 fornext_finalvalue4038;
|
||||
int64 fornext_step4038;
|
||||
uint8 fornext_step_negative4038;
|
||||
int32 *_SUB_IDENOMATCH_LONG_LASTFOCUS=NULL;
|
||||
if(_SUB_IDENOMATCH_LONG_LASTFOCUS==NULL){
|
||||
_SUB_IDENOMATCH_LONG_LASTFOCUS=(int32*)mem_static_malloc(4);
|
||||
|
@ -92,9 +92,9 @@ _SUB_IDENOMATCH_LONG_OLDALT=(int32*)mem_static_malloc(4);
|
|||
}
|
||||
qbs *_SUB_IDENOMATCH_STRING_ALTLETTER=NULL;
|
||||
if (!_SUB_IDENOMATCH_STRING_ALTLETTER)_SUB_IDENOMATCH_STRING_ALTLETTER=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4034=NULL;
|
||||
if (!byte_element_4034){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4034=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4034=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4041=NULL;
|
||||
if (!byte_element_4041){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4041=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4041=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_SUB_IDENOMATCH_LONG_K=NULL;
|
||||
if(_SUB_IDENOMATCH_LONG_K==NULL){
|
||||
|
@ -106,10 +106,10 @@ if(_SUB_IDENOMATCH_LONG_INFO==NULL){
|
|||
_SUB_IDENOMATCH_LONG_INFO=(int32*)mem_static_malloc(4);
|
||||
*_SUB_IDENOMATCH_LONG_INFO=0;
|
||||
}
|
||||
int64 fornext_value4036;
|
||||
int64 fornext_finalvalue4036;
|
||||
int64 fornext_step4036;
|
||||
uint8 fornext_step_negative4036;
|
||||
int64 fornext_value4043;
|
||||
int64 fornext_finalvalue4043;
|
||||
int64 fornext_step4043;
|
||||
uint8 fornext_step_negative4043;
|
||||
int32 *_SUB_IDENOMATCH_LONG_T=NULL;
|
||||
if(_SUB_IDENOMATCH_LONG_T==NULL){
|
||||
_SUB_IDENOMATCH_LONG_T=(int32*)mem_static_malloc(4);
|
||||
|
|
|
@ -43,15 +43,15 @@ if(_FUNC_IDEOPEN_LONG_I==NULL){
|
|||
_FUNC_IDEOPEN_LONG_I=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDEOPEN_LONG_I=0;
|
||||
}
|
||||
int32 pass4037;
|
||||
int32 pass4038;
|
||||
int64 fornext_value4040;
|
||||
int64 fornext_finalvalue4040;
|
||||
int64 fornext_step4040;
|
||||
uint8 fornext_step_negative4040;
|
||||
byte_element_struct *byte_element_4041=NULL;
|
||||
if (!byte_element_4041){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4041=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4041=(byte_element_struct*)mem_static_malloc(12);
|
||||
int32 pass4044;
|
||||
int32 pass4045;
|
||||
int64 fornext_value4047;
|
||||
int64 fornext_finalvalue4047;
|
||||
int64 fornext_step4047;
|
||||
uint8 fornext_step_negative4047;
|
||||
byte_element_struct *byte_element_4048=NULL;
|
||||
if (!byte_element_4048){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4048=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4048=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
qbs *_FUNC_IDEOPEN_STRING_F=NULL;
|
||||
if (!_FUNC_IDEOPEN_STRING_F)_FUNC_IDEOPEN_STRING_F=qbs_new(0,0);
|
||||
|
@ -70,10 +70,10 @@ if(_FUNC_IDEOPEN_LONG_CY==NULL){
|
|||
_FUNC_IDEOPEN_LONG_CY=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDEOPEN_LONG_CY=0;
|
||||
}
|
||||
int64 fornext_value4044;
|
||||
int64 fornext_finalvalue4044;
|
||||
int64 fornext_step4044;
|
||||
uint8 fornext_step_negative4044;
|
||||
int64 fornext_value4051;
|
||||
int64 fornext_finalvalue4051;
|
||||
int64 fornext_step4051;
|
||||
uint8 fornext_step_negative4051;
|
||||
int32 *_FUNC_IDEOPEN_LONG_LASTFOCUS=NULL;
|
||||
if(_FUNC_IDEOPEN_LONG_LASTFOCUS==NULL){
|
||||
_FUNC_IDEOPEN_LONG_LASTFOCUS=(int32*)mem_static_malloc(4);
|
||||
|
@ -86,9 +86,9 @@ if(_FUNC_IDEOPEN_LONG_W==NULL){
|
|||
_FUNC_IDEOPEN_LONG_W=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDEOPEN_LONG_W=0;
|
||||
}
|
||||
byte_element_struct *byte_element_4046=NULL;
|
||||
if (!byte_element_4046){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4046=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4046=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4053=NULL;
|
||||
if (!byte_element_4053){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4053=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4053=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_FUNC_IDEOPEN_LONG_CHANGE=NULL;
|
||||
if(_FUNC_IDEOPEN_LONG_CHANGE==NULL){
|
||||
|
@ -117,9 +117,9 @@ _FUNC_IDEOPEN_LONG_OLDALT=(int32*)mem_static_malloc(4);
|
|||
}
|
||||
qbs *_FUNC_IDEOPEN_STRING_ALTLETTER=NULL;
|
||||
if (!_FUNC_IDEOPEN_STRING_ALTLETTER)_FUNC_IDEOPEN_STRING_ALTLETTER=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4049=NULL;
|
||||
if (!byte_element_4049){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4049=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4049=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4056=NULL;
|
||||
if (!byte_element_4056){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4056=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4056=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_FUNC_IDEOPEN_LONG_K=NULL;
|
||||
if(_FUNC_IDEOPEN_LONG_K==NULL){
|
||||
|
@ -131,10 +131,10 @@ if(_FUNC_IDEOPEN_LONG_INFO==NULL){
|
|||
_FUNC_IDEOPEN_LONG_INFO=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDEOPEN_LONG_INFO=0;
|
||||
}
|
||||
int64 fornext_value4051;
|
||||
int64 fornext_finalvalue4051;
|
||||
int64 fornext_step4051;
|
||||
uint8 fornext_step_negative4051;
|
||||
int64 fornext_value4058;
|
||||
int64 fornext_finalvalue4058;
|
||||
int64 fornext_step4058;
|
||||
uint8 fornext_step_negative4058;
|
||||
int32 *_FUNC_IDEOPEN_LONG_T=NULL;
|
||||
if(_FUNC_IDEOPEN_LONG_T==NULL){
|
||||
_FUNC_IDEOPEN_LONG_T=(int32*)mem_static_malloc(4);
|
||||
|
@ -145,13 +145,13 @@ if(_FUNC_IDEOPEN_LONG_FOCUSOFFSET==NULL){
|
|||
_FUNC_IDEOPEN_LONG_FOCUSOFFSET=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDEOPEN_LONG_FOCUSOFFSET=0;
|
||||
}
|
||||
byte_element_struct *byte_element_4052=NULL;
|
||||
if (!byte_element_4052){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4052=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4052=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4059=NULL;
|
||||
if (!byte_element_4059){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4059=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4059=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4053=NULL;
|
||||
if (!byte_element_4053){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4053=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4053=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4060=NULL;
|
||||
if (!byte_element_4060){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4060=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4060=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_FUNC_IDEOPEN_LONG_I2=NULL;
|
||||
if(_FUNC_IDEOPEN_LONG_I2==NULL){
|
||||
|
@ -192,9 +192,9 @@ if(_FUNC_IDEOPEN_LONG_L==NULL){
|
|||
_FUNC_IDEOPEN_LONG_L=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDEOPEN_LONG_L=0;
|
||||
}
|
||||
byte_element_struct *byte_element_4055=NULL;
|
||||
if (!byte_element_4055){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4055=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4055=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4062=NULL;
|
||||
if (!byte_element_4062){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4062=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4062=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_FUNC_IDEOPEN_LONG_ASCA=NULL;
|
||||
if(_FUNC_IDEOPEN_LONG_ASCA==NULL){
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
qbs*oldstr4056=NULL;
|
||||
qbs*oldstr4063=NULL;
|
||||
if(_SUB_IDEPAR_STRING_TITLE->tmp||_SUB_IDEPAR_STRING_TITLE->fixed||_SUB_IDEPAR_STRING_TITLE->readonly){
|
||||
oldstr4056=_SUB_IDEPAR_STRING_TITLE;
|
||||
if (oldstr4056->cmem_descriptor){
|
||||
_SUB_IDEPAR_STRING_TITLE=qbs_new_cmem(oldstr4056->len,0);
|
||||
oldstr4063=_SUB_IDEPAR_STRING_TITLE;
|
||||
if (oldstr4063->cmem_descriptor){
|
||||
_SUB_IDEPAR_STRING_TITLE=qbs_new_cmem(oldstr4063->len,0);
|
||||
}else{
|
||||
_SUB_IDEPAR_STRING_TITLE=qbs_new(oldstr4056->len,0);
|
||||
_SUB_IDEPAR_STRING_TITLE=qbs_new(oldstr4063->len,0);
|
||||
}
|
||||
memcpy(_SUB_IDEPAR_STRING_TITLE->chr,oldstr4056->chr,oldstr4056->len);
|
||||
memcpy(_SUB_IDEPAR_STRING_TITLE->chr,oldstr4063->chr,oldstr4063->len);
|
||||
}
|
||||
byte_element_struct *byte_element_4057=NULL;
|
||||
if (!byte_element_4057){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4057=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4057=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4064=NULL;
|
||||
if (!byte_element_4064){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4064=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4064=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
|
|
|
@ -37,12 +37,12 @@ if(_FUNC_IDERESTORE_LONG_I==NULL){
|
|||
_FUNC_IDERESTORE_LONG_I=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDERESTORE_LONG_I=0;
|
||||
}
|
||||
int32 pass4058;
|
||||
int32 pass4059;
|
||||
int64 fornext_value4061;
|
||||
int64 fornext_finalvalue4061;
|
||||
int64 fornext_step4061;
|
||||
uint8 fornext_step_negative4061;
|
||||
int32 pass4065;
|
||||
int32 pass4066;
|
||||
int64 fornext_value4068;
|
||||
int64 fornext_finalvalue4068;
|
||||
int64 fornext_step4068;
|
||||
uint8 fornext_step_negative4068;
|
||||
int32 *_FUNC_IDERESTORE_LONG_F=NULL;
|
||||
if(_FUNC_IDERESTORE_LONG_F==NULL){
|
||||
_FUNC_IDERESTORE_LONG_F=(int32*)mem_static_malloc(4);
|
||||
|
@ -58,10 +58,10 @@ if(_FUNC_IDERESTORE_LONG_CY==NULL){
|
|||
_FUNC_IDERESTORE_LONG_CY=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDERESTORE_LONG_CY=0;
|
||||
}
|
||||
int64 fornext_value4064;
|
||||
int64 fornext_finalvalue4064;
|
||||
int64 fornext_step4064;
|
||||
uint8 fornext_step_negative4064;
|
||||
int64 fornext_value4071;
|
||||
int64 fornext_finalvalue4071;
|
||||
int64 fornext_step4071;
|
||||
uint8 fornext_step_negative4071;
|
||||
int32 *_FUNC_IDERESTORE_LONG_LASTFOCUS=NULL;
|
||||
if(_FUNC_IDERESTORE_LONG_LASTFOCUS==NULL){
|
||||
_FUNC_IDERESTORE_LONG_LASTFOCUS=(int32*)mem_static_malloc(4);
|
||||
|
@ -94,9 +94,9 @@ _FUNC_IDERESTORE_LONG_OLDALT=(int32*)mem_static_malloc(4);
|
|||
}
|
||||
qbs *_FUNC_IDERESTORE_STRING_ALTLETTER=NULL;
|
||||
if (!_FUNC_IDERESTORE_STRING_ALTLETTER)_FUNC_IDERESTORE_STRING_ALTLETTER=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4067=NULL;
|
||||
if (!byte_element_4067){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4067=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4067=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4074=NULL;
|
||||
if (!byte_element_4074){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4074=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4074=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_FUNC_IDERESTORE_LONG_K=NULL;
|
||||
if(_FUNC_IDERESTORE_LONG_K==NULL){
|
||||
|
@ -108,10 +108,10 @@ if(_FUNC_IDERESTORE_LONG_INFO==NULL){
|
|||
_FUNC_IDERESTORE_LONG_INFO=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDERESTORE_LONG_INFO=0;
|
||||
}
|
||||
int64 fornext_value4069;
|
||||
int64 fornext_finalvalue4069;
|
||||
int64 fornext_step4069;
|
||||
uint8 fornext_step_negative4069;
|
||||
int64 fornext_value4076;
|
||||
int64 fornext_finalvalue4076;
|
||||
int64 fornext_step4076;
|
||||
uint8 fornext_step_negative4076;
|
||||
int32 *_FUNC_IDERESTORE_LONG_T=NULL;
|
||||
if(_FUNC_IDERESTORE_LONG_T==NULL){
|
||||
_FUNC_IDERESTORE_LONG_T=(int32*)mem_static_malloc(4);
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
qbs*oldstr4070=NULL;
|
||||
qbs*oldstr4077=NULL;
|
||||
if(_SUB_IDESAVE_STRING_F->tmp||_SUB_IDESAVE_STRING_F->fixed||_SUB_IDESAVE_STRING_F->readonly){
|
||||
oldstr4070=_SUB_IDESAVE_STRING_F;
|
||||
if (oldstr4070->cmem_descriptor){
|
||||
_SUB_IDESAVE_STRING_F=qbs_new_cmem(oldstr4070->len,0);
|
||||
oldstr4077=_SUB_IDESAVE_STRING_F;
|
||||
if (oldstr4077->cmem_descriptor){
|
||||
_SUB_IDESAVE_STRING_F=qbs_new_cmem(oldstr4077->len,0);
|
||||
}else{
|
||||
_SUB_IDESAVE_STRING_F=qbs_new(oldstr4070->len,0);
|
||||
_SUB_IDESAVE_STRING_F=qbs_new(oldstr4077->len,0);
|
||||
}
|
||||
memcpy(_SUB_IDESAVE_STRING_F->chr,oldstr4070->chr,oldstr4070->len);
|
||||
memcpy(_SUB_IDESAVE_STRING_F->chr,oldstr4077->chr,oldstr4077->len);
|
||||
}
|
||||
int32 *_SUB_IDESAVE_LONG_I=NULL;
|
||||
if(_SUB_IDESAVE_LONG_I==NULL){
|
||||
_SUB_IDESAVE_LONG_I=(int32*)mem_static_malloc(4);
|
||||
*_SUB_IDESAVE_LONG_I=0;
|
||||
}
|
||||
int64 fornext_value4072;
|
||||
int64 fornext_finalvalue4072;
|
||||
int64 fornext_step4072;
|
||||
uint8 fornext_step_negative4072;
|
||||
int64 fornext_value4079;
|
||||
int64 fornext_finalvalue4079;
|
||||
int64 fornext_step4079;
|
||||
uint8 fornext_step_negative4079;
|
||||
qbs *_SUB_IDESAVE_STRING_A=NULL;
|
||||
if (!_SUB_IDESAVE_STRING_A)_SUB_IDESAVE_STRING_A=qbs_new(0,0);
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
qbs *_FUNC_IDESAVEAS_STRING_IDESAVEAS=NULL;
|
||||
if (!_FUNC_IDESAVEAS_STRING_IDESAVEAS)_FUNC_IDESAVEAS_STRING_IDESAVEAS=qbs_new(0,0);
|
||||
qbs*oldstr4074=NULL;
|
||||
qbs*oldstr4081=NULL;
|
||||
if(_FUNC_IDESAVEAS_STRING_PROGRAMNAME->tmp||_FUNC_IDESAVEAS_STRING_PROGRAMNAME->fixed||_FUNC_IDESAVEAS_STRING_PROGRAMNAME->readonly){
|
||||
oldstr4074=_FUNC_IDESAVEAS_STRING_PROGRAMNAME;
|
||||
if (oldstr4074->cmem_descriptor){
|
||||
_FUNC_IDESAVEAS_STRING_PROGRAMNAME=qbs_new_cmem(oldstr4074->len,0);
|
||||
oldstr4081=_FUNC_IDESAVEAS_STRING_PROGRAMNAME;
|
||||
if (oldstr4081->cmem_descriptor){
|
||||
_FUNC_IDESAVEAS_STRING_PROGRAMNAME=qbs_new_cmem(oldstr4081->len,0);
|
||||
}else{
|
||||
_FUNC_IDESAVEAS_STRING_PROGRAMNAME=qbs_new(oldstr4074->len,0);
|
||||
_FUNC_IDESAVEAS_STRING_PROGRAMNAME=qbs_new(oldstr4081->len,0);
|
||||
}
|
||||
memcpy(_FUNC_IDESAVEAS_STRING_PROGRAMNAME->chr,oldstr4074->chr,oldstr4074->len);
|
||||
memcpy(_FUNC_IDESAVEAS_STRING_PROGRAMNAME->chr,oldstr4081->chr,oldstr4081->len);
|
||||
}
|
||||
int32 *_FUNC_IDESAVEAS_LONG_FOCUS=NULL;
|
||||
if(_FUNC_IDESAVEAS_LONG_FOCUS==NULL){
|
||||
|
@ -51,16 +51,16 @@ if(_FUNC_IDESAVEAS_LONG_I==NULL){
|
|||
_FUNC_IDESAVEAS_LONG_I=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDESAVEAS_LONG_I=0;
|
||||
}
|
||||
int32 pass4075;
|
||||
int32 pass4076;
|
||||
byte_element_struct *byte_element_4077=NULL;
|
||||
if (!byte_element_4077){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4077=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4077=(byte_element_struct*)mem_static_malloc(12);
|
||||
int32 pass4082;
|
||||
int32 pass4083;
|
||||
byte_element_struct *byte_element_4084=NULL;
|
||||
if (!byte_element_4084){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4084=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4084=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int64 fornext_value4079;
|
||||
int64 fornext_finalvalue4079;
|
||||
int64 fornext_step4079;
|
||||
uint8 fornext_step_negative4079;
|
||||
int64 fornext_value4086;
|
||||
int64 fornext_finalvalue4086;
|
||||
int64 fornext_step4086;
|
||||
uint8 fornext_step_negative4086;
|
||||
int32 *_FUNC_IDESAVEAS_LONG_F=NULL;
|
||||
if(_FUNC_IDESAVEAS_LONG_F==NULL){
|
||||
_FUNC_IDESAVEAS_LONG_F=(int32*)mem_static_malloc(4);
|
||||
|
@ -76,10 +76,10 @@ if(_FUNC_IDESAVEAS_LONG_CY==NULL){
|
|||
_FUNC_IDESAVEAS_LONG_CY=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDESAVEAS_LONG_CY=0;
|
||||
}
|
||||
int64 fornext_value4082;
|
||||
int64 fornext_finalvalue4082;
|
||||
int64 fornext_step4082;
|
||||
uint8 fornext_step_negative4082;
|
||||
int64 fornext_value4089;
|
||||
int64 fornext_finalvalue4089;
|
||||
int64 fornext_step4089;
|
||||
uint8 fornext_step_negative4089;
|
||||
int32 *_FUNC_IDESAVEAS_LONG_LASTFOCUS=NULL;
|
||||
if(_FUNC_IDESAVEAS_LONG_LASTFOCUS==NULL){
|
||||
_FUNC_IDESAVEAS_LONG_LASTFOCUS=(int32*)mem_static_malloc(4);
|
||||
|
@ -92,9 +92,9 @@ if(_FUNC_IDESAVEAS_LONG_W==NULL){
|
|||
_FUNC_IDESAVEAS_LONG_W=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDESAVEAS_LONG_W=0;
|
||||
}
|
||||
byte_element_struct *byte_element_4084=NULL;
|
||||
if (!byte_element_4084){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4084=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4084=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4091=NULL;
|
||||
if (!byte_element_4091){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4091=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4091=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_FUNC_IDESAVEAS_LONG_CHANGE=NULL;
|
||||
if(_FUNC_IDESAVEAS_LONG_CHANGE==NULL){
|
||||
|
@ -123,9 +123,9 @@ _FUNC_IDESAVEAS_LONG_OLDALT=(int32*)mem_static_malloc(4);
|
|||
}
|
||||
qbs *_FUNC_IDESAVEAS_STRING_ALTLETTER=NULL;
|
||||
if (!_FUNC_IDESAVEAS_STRING_ALTLETTER)_FUNC_IDESAVEAS_STRING_ALTLETTER=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4087=NULL;
|
||||
if (!byte_element_4087){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4087=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4087=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4094=NULL;
|
||||
if (!byte_element_4094){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4094=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4094=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_FUNC_IDESAVEAS_LONG_K=NULL;
|
||||
if(_FUNC_IDESAVEAS_LONG_K==NULL){
|
||||
|
@ -137,10 +137,10 @@ if(_FUNC_IDESAVEAS_LONG_INFO==NULL){
|
|||
_FUNC_IDESAVEAS_LONG_INFO=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDESAVEAS_LONG_INFO=0;
|
||||
}
|
||||
int64 fornext_value4089;
|
||||
int64 fornext_finalvalue4089;
|
||||
int64 fornext_step4089;
|
||||
uint8 fornext_step_negative4089;
|
||||
int64 fornext_value4096;
|
||||
int64 fornext_finalvalue4096;
|
||||
int64 fornext_step4096;
|
||||
uint8 fornext_step_negative4096;
|
||||
int32 *_FUNC_IDESAVEAS_LONG_T=NULL;
|
||||
if(_FUNC_IDESAVEAS_LONG_T==NULL){
|
||||
_FUNC_IDESAVEAS_LONG_T=(int32*)mem_static_malloc(4);
|
||||
|
|
|
@ -37,12 +37,12 @@ if(_FUNC_IDESAVENOW_LONG_I==NULL){
|
|||
_FUNC_IDESAVENOW_LONG_I=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDESAVENOW_LONG_I=0;
|
||||
}
|
||||
int32 pass4090;
|
||||
int32 pass4091;
|
||||
int64 fornext_value4093;
|
||||
int64 fornext_finalvalue4093;
|
||||
int64 fornext_step4093;
|
||||
uint8 fornext_step_negative4093;
|
||||
int32 pass4097;
|
||||
int32 pass4098;
|
||||
int64 fornext_value4100;
|
||||
int64 fornext_finalvalue4100;
|
||||
int64 fornext_step4100;
|
||||
uint8 fornext_step_negative4100;
|
||||
int32 *_FUNC_IDESAVENOW_LONG_F=NULL;
|
||||
if(_FUNC_IDESAVENOW_LONG_F==NULL){
|
||||
_FUNC_IDESAVENOW_LONG_F=(int32*)mem_static_malloc(4);
|
||||
|
@ -58,10 +58,10 @@ if(_FUNC_IDESAVENOW_LONG_CY==NULL){
|
|||
_FUNC_IDESAVENOW_LONG_CY=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDESAVENOW_LONG_CY=0;
|
||||
}
|
||||
int64 fornext_value4096;
|
||||
int64 fornext_finalvalue4096;
|
||||
int64 fornext_step4096;
|
||||
uint8 fornext_step_negative4096;
|
||||
int64 fornext_value4103;
|
||||
int64 fornext_finalvalue4103;
|
||||
int64 fornext_step4103;
|
||||
uint8 fornext_step_negative4103;
|
||||
int32 *_FUNC_IDESAVENOW_LONG_LASTFOCUS=NULL;
|
||||
if(_FUNC_IDESAVENOW_LONG_LASTFOCUS==NULL){
|
||||
_FUNC_IDESAVENOW_LONG_LASTFOCUS=(int32*)mem_static_malloc(4);
|
||||
|
@ -94,9 +94,9 @@ _FUNC_IDESAVENOW_LONG_OLDALT=(int32*)mem_static_malloc(4);
|
|||
}
|
||||
qbs *_FUNC_IDESAVENOW_STRING_ALTLETTER=NULL;
|
||||
if (!_FUNC_IDESAVENOW_STRING_ALTLETTER)_FUNC_IDESAVENOW_STRING_ALTLETTER=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4099=NULL;
|
||||
if (!byte_element_4099){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4099=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4099=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4106=NULL;
|
||||
if (!byte_element_4106){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4106=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4106=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_FUNC_IDESAVENOW_LONG_K=NULL;
|
||||
if(_FUNC_IDESAVENOW_LONG_K==NULL){
|
||||
|
@ -108,10 +108,10 @@ if(_FUNC_IDESAVENOW_LONG_INFO==NULL){
|
|||
_FUNC_IDESAVENOW_LONG_INFO=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDESAVENOW_LONG_INFO=0;
|
||||
}
|
||||
int64 fornext_value4101;
|
||||
int64 fornext_finalvalue4101;
|
||||
int64 fornext_step4101;
|
||||
uint8 fornext_step_negative4101;
|
||||
int64 fornext_value4108;
|
||||
int64 fornext_finalvalue4108;
|
||||
int64 fornext_step4108;
|
||||
uint8 fornext_step_negative4108;
|
||||
int32 *_FUNC_IDESAVENOW_LONG_T=NULL;
|
||||
if(_FUNC_IDESAVENOW_LONG_T==NULL){
|
||||
_FUNC_IDESAVENOW_LONG_T=(int32*)mem_static_malloc(4);
|
||||
|
|
|
@ -1,23 +1,23 @@
|
|||
qbs*oldstr4102=NULL;
|
||||
qbs*oldstr4109=NULL;
|
||||
if(_SUB_IDESETLINE_STRING_TEXT->tmp||_SUB_IDESETLINE_STRING_TEXT->fixed||_SUB_IDESETLINE_STRING_TEXT->readonly){
|
||||
oldstr4102=_SUB_IDESETLINE_STRING_TEXT;
|
||||
if (oldstr4102->cmem_descriptor){
|
||||
_SUB_IDESETLINE_STRING_TEXT=qbs_new_cmem(oldstr4102->len,0);
|
||||
oldstr4109=_SUB_IDESETLINE_STRING_TEXT;
|
||||
if (oldstr4109->cmem_descriptor){
|
||||
_SUB_IDESETLINE_STRING_TEXT=qbs_new_cmem(oldstr4109->len,0);
|
||||
}else{
|
||||
_SUB_IDESETLINE_STRING_TEXT=qbs_new(oldstr4102->len,0);
|
||||
_SUB_IDESETLINE_STRING_TEXT=qbs_new(oldstr4109->len,0);
|
||||
}
|
||||
memcpy(_SUB_IDESETLINE_STRING_TEXT->chr,oldstr4102->chr,oldstr4102->len);
|
||||
memcpy(_SUB_IDESETLINE_STRING_TEXT->chr,oldstr4109->chr,oldstr4109->len);
|
||||
}
|
||||
int32 *_SUB_IDESETLINE_LONG_TEXTLEN=NULL;
|
||||
if(_SUB_IDESETLINE_LONG_TEXTLEN==NULL){
|
||||
_SUB_IDESETLINE_LONG_TEXTLEN=(int32*)mem_static_malloc(4);
|
||||
*_SUB_IDESETLINE_LONG_TEXTLEN=0;
|
||||
}
|
||||
byte_element_struct *byte_element_4103=NULL;
|
||||
if (!byte_element_4103){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4103=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4103=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4110=NULL;
|
||||
if (!byte_element_4110){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4110=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4110=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4104=NULL;
|
||||
if (!byte_element_4104){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4104=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4104=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4111=NULL;
|
||||
if (!byte_element_4111){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4111=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4111=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
|
|
|
@ -33,40 +33,66 @@ if(_SUB_IDESHOWTEXT_LONG_Y==NULL){
|
|||
_SUB_IDESHOWTEXT_LONG_Y=(int32*)mem_static_malloc(4);
|
||||
*_SUB_IDESHOWTEXT_LONG_Y=0;
|
||||
}
|
||||
int64 fornext_value4106;
|
||||
int64 fornext_finalvalue4106;
|
||||
int64 fornext_step4106;
|
||||
uint8 fornext_step_negative4106;
|
||||
int64 fornext_value4113;
|
||||
int64 fornext_finalvalue4113;
|
||||
int64 fornext_step4113;
|
||||
uint8 fornext_step_negative4113;
|
||||
qbs *_SUB_IDESHOWTEXT_STRING_A=NULL;
|
||||
if (!_SUB_IDESHOWTEXT_STRING_A)_SUB_IDESHOWTEXT_STRING_A=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4108=NULL;
|
||||
if (!byte_element_4108){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4108=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4108=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4115=NULL;
|
||||
if (!byte_element_4115){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4115=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4115=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
qbs *_SUB_IDESHOWTEXT_STRING_A2=NULL;
|
||||
if (!_SUB_IDESHOWTEXT_STRING_A2)_SUB_IDESHOWTEXT_STRING_A2=qbs_new(0,0);
|
||||
int32 *_SUB_IDESHOWTEXT_LONG_X=NULL;
|
||||
if(_SUB_IDESHOWTEXT_LONG_X==NULL){
|
||||
_SUB_IDESHOWTEXT_LONG_X=(int32*)mem_static_malloc(4);
|
||||
*_SUB_IDESHOWTEXT_LONG_X=0;
|
||||
int32 *_SUB_IDESHOWTEXT_LONG_INQUOTE=NULL;
|
||||
if(_SUB_IDESHOWTEXT_LONG_INQUOTE==NULL){
|
||||
_SUB_IDESHOWTEXT_LONG_INQUOTE=(int32*)mem_static_malloc(4);
|
||||
*_SUB_IDESHOWTEXT_LONG_INQUOTE=0;
|
||||
}
|
||||
int64 fornext_value4110;
|
||||
int64 fornext_finalvalue4110;
|
||||
int64 fornext_step4110;
|
||||
uint8 fornext_step_negative4110;
|
||||
byte_element_struct *byte_element_4111=NULL;
|
||||
if (!byte_element_4111){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4111=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4111=(byte_element_struct*)mem_static_malloc(12);
|
||||
int32 *_SUB_IDESHOWTEXT_LONG_COMMENT=NULL;
|
||||
if(_SUB_IDESHOWTEXT_LONG_COMMENT==NULL){
|
||||
_SUB_IDESHOWTEXT_LONG_COMMENT=(int32*)mem_static_malloc(4);
|
||||
*_SUB_IDESHOWTEXT_LONG_COMMENT=0;
|
||||
}
|
||||
int32 *_SUB_IDESHOWTEXT_LONG_K=NULL;
|
||||
if(_SUB_IDESHOWTEXT_LONG_K==NULL){
|
||||
_SUB_IDESHOWTEXT_LONG_K=(int32*)mem_static_malloc(4);
|
||||
*_SUB_IDESHOWTEXT_LONG_K=0;
|
||||
}
|
||||
int64 fornext_value4117;
|
||||
int64 fornext_finalvalue4117;
|
||||
int64 fornext_step4117;
|
||||
uint8 fornext_step_negative4117;
|
||||
static qbs *sc_4118=qbs_new(0,0);
|
||||
int32 *_SUB_IDESHOWTEXT_LONG_M=NULL;
|
||||
if(_SUB_IDESHOWTEXT_LONG_M==NULL){
|
||||
_SUB_IDESHOWTEXT_LONG_M=(int32*)mem_static_malloc(4);
|
||||
*_SUB_IDESHOWTEXT_LONG_M=0;
|
||||
}
|
||||
int64 fornext_value4120;
|
||||
int64 fornext_finalvalue4120;
|
||||
int64 fornext_step4120;
|
||||
uint8 fornext_step_negative4120;
|
||||
byte_element_struct *byte_element_4121=NULL;
|
||||
if (!byte_element_4121){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4121=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4121=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
static qbs *sc_4122=qbs_new(0,0);
|
||||
int32 *_SUB_IDESHOWTEXT_LONG_X2=NULL;
|
||||
if(_SUB_IDESHOWTEXT_LONG_X2==NULL){
|
||||
_SUB_IDESHOWTEXT_LONG_X2=(int32*)mem_static_malloc(4);
|
||||
*_SUB_IDESHOWTEXT_LONG_X2=0;
|
||||
}
|
||||
int64 fornext_value4114;
|
||||
int64 fornext_finalvalue4114;
|
||||
int64 fornext_step4114;
|
||||
uint8 fornext_step_negative4114;
|
||||
int32 *_SUB_IDESHOWTEXT_LONG_X=NULL;
|
||||
if(_SUB_IDESHOWTEXT_LONG_X==NULL){
|
||||
_SUB_IDESHOWTEXT_LONG_X=(int32*)mem_static_malloc(4);
|
||||
*_SUB_IDESHOWTEXT_LONG_X=0;
|
||||
}
|
||||
int64 fornext_value4125;
|
||||
int64 fornext_finalvalue4125;
|
||||
int64 fornext_step4125;
|
||||
uint8 fornext_step_negative4125;
|
||||
int32 *_SUB_IDESHOWTEXT_LONG_A=NULL;
|
||||
if(_SUB_IDESHOWTEXT_LONG_A==NULL){
|
||||
_SUB_IDESHOWTEXT_LONG_A=(int32*)mem_static_malloc(4);
|
||||
|
@ -77,35 +103,35 @@ if(_SUB_IDESHOWTEXT_LONG_C==NULL){
|
|||
_SUB_IDESHOWTEXT_LONG_C=(int32*)mem_static_malloc(4);
|
||||
*_SUB_IDESHOWTEXT_LONG_C=0;
|
||||
}
|
||||
int64 fornext_value4118;
|
||||
int64 fornext_finalvalue4118;
|
||||
int64 fornext_step4118;
|
||||
uint8 fornext_step_negative4118;
|
||||
byte_element_struct *byte_element_4119=NULL;
|
||||
if (!byte_element_4119){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4119=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4119=(byte_element_struct*)mem_static_malloc(12);
|
||||
int64 fornext_value4129;
|
||||
int64 fornext_finalvalue4129;
|
||||
int64 fornext_step4129;
|
||||
uint8 fornext_step_negative4129;
|
||||
byte_element_struct *byte_element_4130=NULL;
|
||||
if (!byte_element_4130){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4130=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4130=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_SUB_IDESHOWTEXT_LONG_B=NULL;
|
||||
if(_SUB_IDESHOWTEXT_LONG_B==NULL){
|
||||
_SUB_IDESHOWTEXT_LONG_B=(int32*)mem_static_malloc(4);
|
||||
*_SUB_IDESHOWTEXT_LONG_B=0;
|
||||
}
|
||||
int64 fornext_value4122;
|
||||
int64 fornext_finalvalue4122;
|
||||
int64 fornext_step4122;
|
||||
uint8 fornext_step_negative4122;
|
||||
int64 fornext_value4133;
|
||||
int64 fornext_finalvalue4133;
|
||||
int64 fornext_step4133;
|
||||
uint8 fornext_step_negative4133;
|
||||
int32 *_SUB_IDESHOWTEXT_LONG_Q=NULL;
|
||||
if(_SUB_IDESHOWTEXT_LONG_Q==NULL){
|
||||
_SUB_IDESHOWTEXT_LONG_Q=(int32*)mem_static_malloc(4);
|
||||
*_SUB_IDESHOWTEXT_LONG_Q=0;
|
||||
}
|
||||
int32 pass4124;
|
||||
int32 pass4125;
|
||||
int32 pass4126;
|
||||
int32 pass4127;
|
||||
int32 pass4128;
|
||||
int32 pass4129;
|
||||
byte_element_struct *byte_element_4133=NULL;
|
||||
if (!byte_element_4133){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4133=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4133=(byte_element_struct*)mem_static_malloc(12);
|
||||
int32 pass4135;
|
||||
int32 pass4136;
|
||||
int32 pass4137;
|
||||
int32 pass4138;
|
||||
int32 pass4139;
|
||||
int32 pass4140;
|
||||
byte_element_struct *byte_element_4144=NULL;
|
||||
if (!byte_element_4144){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4144=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4144=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
|
|
|
@ -41,10 +41,10 @@ if(_FUNC_IDESUBS_LONG_Y==NULL){
|
|||
_FUNC_IDESUBS_LONG_Y=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDESUBS_LONG_Y=0;
|
||||
}
|
||||
int64 fornext_value4136;
|
||||
int64 fornext_finalvalue4136;
|
||||
int64 fornext_step4136;
|
||||
uint8 fornext_step_negative4136;
|
||||
int64 fornext_value4147;
|
||||
int64 fornext_finalvalue4147;
|
||||
int64 fornext_step4147;
|
||||
uint8 fornext_step_negative4147;
|
||||
qbs *_FUNC_IDESUBS_STRING_A=NULL;
|
||||
if (!_FUNC_IDESUBS_STRING_A)_FUNC_IDESUBS_STRING_A=qbs_new(0,0);
|
||||
int32 *_FUNC_IDESUBS_LONG_SF=NULL;
|
||||
|
@ -56,17 +56,17 @@ qbs *_FUNC_IDESUBS_STRING_NCA=NULL;
|
|||
if (!_FUNC_IDESUBS_STRING_NCA)_FUNC_IDESUBS_STRING_NCA=qbs_new(0,0);
|
||||
qbs *_FUNC_IDESUBS_STRING_SF=NULL;
|
||||
if (!_FUNC_IDESUBS_STRING_SF)_FUNC_IDESUBS_STRING_SF=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4137=NULL;
|
||||
if (!byte_element_4137){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4137=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4137=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4148=NULL;
|
||||
if (!byte_element_4148){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4148=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4148=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4138=NULL;
|
||||
if (!byte_element_4138){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4138=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4138=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4149=NULL;
|
||||
if (!byte_element_4149){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4149=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4149=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4139=NULL;
|
||||
if (!byte_element_4139){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4139=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4139=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4150=NULL;
|
||||
if (!byte_element_4150){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4150=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4150=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_FUNC_IDESUBS_LONG_X=NULL;
|
||||
if(_FUNC_IDESUBS_LONG_X==NULL){
|
||||
|
@ -77,45 +77,45 @@ qbs *_FUNC_IDESUBS_STRING_N=NULL;
|
|||
if (!_FUNC_IDESUBS_STRING_N)_FUNC_IDESUBS_STRING_N=qbs_new(0,0);
|
||||
qbs *_FUNC_IDESUBS_STRING_ARGS=NULL;
|
||||
if (!_FUNC_IDESUBS_STRING_ARGS)_FUNC_IDESUBS_STRING_ARGS=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4140=NULL;
|
||||
if (!byte_element_4140){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4140=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4140=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4151=NULL;
|
||||
if (!byte_element_4151){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4151=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4151=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4141=NULL;
|
||||
if (!byte_element_4141){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4141=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4141=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4152=NULL;
|
||||
if (!byte_element_4152){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4152=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4152=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4142=NULL;
|
||||
if (!byte_element_4142){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4142=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4142=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4153=NULL;
|
||||
if (!byte_element_4153){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4153=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4153=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4143=NULL;
|
||||
if (!byte_element_4143){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4143=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4143=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4154=NULL;
|
||||
if (!byte_element_4154){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4154=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4154=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4144=NULL;
|
||||
if (!byte_element_4144){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4144=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4144=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4155=NULL;
|
||||
if (!byte_element_4155){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4155=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4155=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int64 fornext_value4146;
|
||||
int64 fornext_finalvalue4146;
|
||||
int64 fornext_step4146;
|
||||
uint8 fornext_step_negative4146;
|
||||
byte_element_struct *byte_element_4147=NULL;
|
||||
if (!byte_element_4147){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4147=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4147=(byte_element_struct*)mem_static_malloc(12);
|
||||
int64 fornext_value4157;
|
||||
int64 fornext_finalvalue4157;
|
||||
int64 fornext_step4157;
|
||||
uint8 fornext_step_negative4157;
|
||||
byte_element_struct *byte_element_4158=NULL;
|
||||
if (!byte_element_4158){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4158=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4158=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_FUNC_IDESUBS_LONG_I=NULL;
|
||||
if(_FUNC_IDESUBS_LONG_I==NULL){
|
||||
_FUNC_IDESUBS_LONG_I=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDESUBS_LONG_I=0;
|
||||
}
|
||||
int32 pass4148;
|
||||
int32 pass4149;
|
||||
int64 fornext_value4151;
|
||||
int64 fornext_finalvalue4151;
|
||||
int64 fornext_step4151;
|
||||
uint8 fornext_step_negative4151;
|
||||
int32 pass4159;
|
||||
int32 pass4160;
|
||||
int64 fornext_value4162;
|
||||
int64 fornext_finalvalue4162;
|
||||
int64 fornext_step4162;
|
||||
uint8 fornext_step_negative4162;
|
||||
int32 *_FUNC_IDESUBS_LONG_F=NULL;
|
||||
if(_FUNC_IDESUBS_LONG_F==NULL){
|
||||
_FUNC_IDESUBS_LONG_F=(int32*)mem_static_malloc(4);
|
||||
|
@ -131,10 +131,10 @@ if(_FUNC_IDESUBS_LONG_CY==NULL){
|
|||
_FUNC_IDESUBS_LONG_CY=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDESUBS_LONG_CY=0;
|
||||
}
|
||||
int64 fornext_value4154;
|
||||
int64 fornext_finalvalue4154;
|
||||
int64 fornext_step4154;
|
||||
uint8 fornext_step_negative4154;
|
||||
int64 fornext_value4165;
|
||||
int64 fornext_finalvalue4165;
|
||||
int64 fornext_step4165;
|
||||
uint8 fornext_step_negative4165;
|
||||
int32 *_FUNC_IDESUBS_LONG_LASTFOCUS=NULL;
|
||||
if(_FUNC_IDESUBS_LONG_LASTFOCUS==NULL){
|
||||
_FUNC_IDESUBS_LONG_LASTFOCUS=(int32*)mem_static_malloc(4);
|
||||
|
@ -167,9 +167,9 @@ _FUNC_IDESUBS_LONG_OLDALT=(int32*)mem_static_malloc(4);
|
|||
}
|
||||
qbs *_FUNC_IDESUBS_STRING_ALTLETTER=NULL;
|
||||
if (!_FUNC_IDESUBS_STRING_ALTLETTER)_FUNC_IDESUBS_STRING_ALTLETTER=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4156=NULL;
|
||||
if (!byte_element_4156){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4156=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4156=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4167=NULL;
|
||||
if (!byte_element_4167){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4167=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4167=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_FUNC_IDESUBS_LONG_K=NULL;
|
||||
if(_FUNC_IDESUBS_LONG_K==NULL){
|
||||
|
@ -181,10 +181,10 @@ if(_FUNC_IDESUBS_LONG_INFO==NULL){
|
|||
_FUNC_IDESUBS_LONG_INFO=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDESUBS_LONG_INFO=0;
|
||||
}
|
||||
int64 fornext_value4158;
|
||||
int64 fornext_finalvalue4158;
|
||||
int64 fornext_step4158;
|
||||
uint8 fornext_step_negative4158;
|
||||
int64 fornext_value4169;
|
||||
int64 fornext_finalvalue4169;
|
||||
int64 fornext_step4169;
|
||||
uint8 fornext_step_negative4169;
|
||||
int32 *_FUNC_IDESUBS_LONG_T=NULL;
|
||||
if(_FUNC_IDESUBS_LONG_T==NULL){
|
||||
_FUNC_IDESUBS_LONG_T=(int32*)mem_static_malloc(4);
|
||||
|
|
|
@ -42,21 +42,21 @@ if(_FUNC_IDELANGUAGEBOX_LONG_X==NULL){
|
|||
_FUNC_IDELANGUAGEBOX_LONG_X=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDELANGUAGEBOX_LONG_X=0;
|
||||
}
|
||||
int64 fornext_value4160;
|
||||
int64 fornext_finalvalue4160;
|
||||
int64 fornext_step4160;
|
||||
uint8 fornext_step_negative4160;
|
||||
int64 fornext_value4171;
|
||||
int64 fornext_finalvalue4171;
|
||||
int64 fornext_step4171;
|
||||
uint8 fornext_step_negative4171;
|
||||
int32 *_FUNC_IDELANGUAGEBOX_LONG_I=NULL;
|
||||
if(_FUNC_IDELANGUAGEBOX_LONG_I==NULL){
|
||||
_FUNC_IDELANGUAGEBOX_LONG_I=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDELANGUAGEBOX_LONG_I=0;
|
||||
}
|
||||
int32 pass4161;
|
||||
int32 pass4162;
|
||||
int64 fornext_value4164;
|
||||
int64 fornext_finalvalue4164;
|
||||
int64 fornext_step4164;
|
||||
uint8 fornext_step_negative4164;
|
||||
int32 pass4172;
|
||||
int32 pass4173;
|
||||
int64 fornext_value4175;
|
||||
int64 fornext_finalvalue4175;
|
||||
int64 fornext_step4175;
|
||||
uint8 fornext_step_negative4175;
|
||||
int32 *_FUNC_IDELANGUAGEBOX_LONG_F=NULL;
|
||||
if(_FUNC_IDELANGUAGEBOX_LONG_F==NULL){
|
||||
_FUNC_IDELANGUAGEBOX_LONG_F=(int32*)mem_static_malloc(4);
|
||||
|
@ -72,10 +72,10 @@ if(_FUNC_IDELANGUAGEBOX_LONG_CY==NULL){
|
|||
_FUNC_IDELANGUAGEBOX_LONG_CY=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDELANGUAGEBOX_LONG_CY=0;
|
||||
}
|
||||
int64 fornext_value4167;
|
||||
int64 fornext_finalvalue4167;
|
||||
int64 fornext_step4167;
|
||||
uint8 fornext_step_negative4167;
|
||||
int64 fornext_value4178;
|
||||
int64 fornext_finalvalue4178;
|
||||
int64 fornext_step4178;
|
||||
uint8 fornext_step_negative4178;
|
||||
int32 *_FUNC_IDELANGUAGEBOX_LONG_LASTFOCUS=NULL;
|
||||
if(_FUNC_IDELANGUAGEBOX_LONG_LASTFOCUS==NULL){
|
||||
_FUNC_IDELANGUAGEBOX_LONG_LASTFOCUS=(int32*)mem_static_malloc(4);
|
||||
|
@ -108,9 +108,9 @@ _FUNC_IDELANGUAGEBOX_LONG_OLDALT=(int32*)mem_static_malloc(4);
|
|||
}
|
||||
qbs *_FUNC_IDELANGUAGEBOX_STRING_ALTLETTER=NULL;
|
||||
if (!_FUNC_IDELANGUAGEBOX_STRING_ALTLETTER)_FUNC_IDELANGUAGEBOX_STRING_ALTLETTER=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4170=NULL;
|
||||
if (!byte_element_4170){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4170=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4170=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4181=NULL;
|
||||
if (!byte_element_4181){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4181=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4181=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_FUNC_IDELANGUAGEBOX_LONG_K=NULL;
|
||||
if(_FUNC_IDELANGUAGEBOX_LONG_K==NULL){
|
||||
|
@ -122,10 +122,10 @@ if(_FUNC_IDELANGUAGEBOX_LONG_INFO==NULL){
|
|||
_FUNC_IDELANGUAGEBOX_LONG_INFO=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDELANGUAGEBOX_LONG_INFO=0;
|
||||
}
|
||||
int64 fornext_value4172;
|
||||
int64 fornext_finalvalue4172;
|
||||
int64 fornext_step4172;
|
||||
uint8 fornext_step_negative4172;
|
||||
int64 fornext_value4183;
|
||||
int64 fornext_finalvalue4183;
|
||||
int64 fornext_step4183;
|
||||
uint8 fornext_step_negative4183;
|
||||
int32 *_FUNC_IDELANGUAGEBOX_LONG_T=NULL;
|
||||
if(_FUNC_IDELANGUAGEBOX_LONG_T==NULL){
|
||||
_FUNC_IDELANGUAGEBOX_LONG_T=(int32*)mem_static_malloc(4);
|
||||
|
@ -141,10 +141,10 @@ if(_FUNC_IDELANGUAGEBOX_LONG_Y==NULL){
|
|||
_FUNC_IDELANGUAGEBOX_LONG_Y=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDELANGUAGEBOX_LONG_Y=0;
|
||||
}
|
||||
int64 fornext_value4174;
|
||||
int64 fornext_finalvalue4174;
|
||||
int64 fornext_step4174;
|
||||
uint8 fornext_step_negative4174;
|
||||
int64 fornext_value4185;
|
||||
int64 fornext_finalvalue4185;
|
||||
int64 fornext_step4185;
|
||||
uint8 fornext_step_negative4185;
|
||||
int32 *_FUNC_IDELANGUAGEBOX_LONG_U=NULL;
|
||||
if(_FUNC_IDELANGUAGEBOX_LONG_U==NULL){
|
||||
_FUNC_IDELANGUAGEBOX_LONG_U=(int32*)mem_static_malloc(4);
|
||||
|
@ -155,7 +155,7 @@ if(_FUNC_IDELANGUAGEBOX_INTEGER_V==NULL){
|
|||
_FUNC_IDELANGUAGEBOX_INTEGER_V=(int16*)mem_static_malloc(2);
|
||||
*_FUNC_IDELANGUAGEBOX_INTEGER_V=0;
|
||||
}
|
||||
byte_element_struct *byte_element_4175=NULL;
|
||||
if (!byte_element_4175){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4175=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4175=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4186=NULL;
|
||||
if (!byte_element_4186){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4186=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4186=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
qbs*oldstr4176=NULL;
|
||||
qbs*oldstr4187=NULL;
|
||||
if(_SUB_IDEUPDATEOBJ_STRING_KK->tmp||_SUB_IDEUPDATEOBJ_STRING_KK->fixed||_SUB_IDEUPDATEOBJ_STRING_KK->readonly){
|
||||
oldstr4176=_SUB_IDEUPDATEOBJ_STRING_KK;
|
||||
if (oldstr4176->cmem_descriptor){
|
||||
_SUB_IDEUPDATEOBJ_STRING_KK=qbs_new_cmem(oldstr4176->len,0);
|
||||
oldstr4187=_SUB_IDEUPDATEOBJ_STRING_KK;
|
||||
if (oldstr4187->cmem_descriptor){
|
||||
_SUB_IDEUPDATEOBJ_STRING_KK=qbs_new_cmem(oldstr4187->len,0);
|
||||
}else{
|
||||
_SUB_IDEUPDATEOBJ_STRING_KK=qbs_new(oldstr4176->len,0);
|
||||
_SUB_IDEUPDATEOBJ_STRING_KK=qbs_new(oldstr4187->len,0);
|
||||
}
|
||||
memcpy(_SUB_IDEUPDATEOBJ_STRING_KK->chr,oldstr4176->chr,oldstr4176->len);
|
||||
memcpy(_SUB_IDEUPDATEOBJ_STRING_KK->chr,oldstr4187->chr,oldstr4187->len);
|
||||
}
|
||||
qbs*oldstr4177=NULL;
|
||||
qbs*oldstr4188=NULL;
|
||||
if(_SUB_IDEUPDATEOBJ_STRING_ALTLETTER->tmp||_SUB_IDEUPDATEOBJ_STRING_ALTLETTER->fixed||_SUB_IDEUPDATEOBJ_STRING_ALTLETTER->readonly){
|
||||
oldstr4177=_SUB_IDEUPDATEOBJ_STRING_ALTLETTER;
|
||||
if (oldstr4177->cmem_descriptor){
|
||||
_SUB_IDEUPDATEOBJ_STRING_ALTLETTER=qbs_new_cmem(oldstr4177->len,0);
|
||||
oldstr4188=_SUB_IDEUPDATEOBJ_STRING_ALTLETTER;
|
||||
if (oldstr4188->cmem_descriptor){
|
||||
_SUB_IDEUPDATEOBJ_STRING_ALTLETTER=qbs_new_cmem(oldstr4188->len,0);
|
||||
}else{
|
||||
_SUB_IDEUPDATEOBJ_STRING_ALTLETTER=qbs_new(oldstr4177->len,0);
|
||||
_SUB_IDEUPDATEOBJ_STRING_ALTLETTER=qbs_new(oldstr4188->len,0);
|
||||
}
|
||||
memcpy(_SUB_IDEUPDATEOBJ_STRING_ALTLETTER->chr,oldstr4177->chr,oldstr4177->len);
|
||||
memcpy(_SUB_IDEUPDATEOBJ_STRING_ALTLETTER->chr,oldstr4188->chr,oldstr4188->len);
|
||||
}
|
||||
qbs *_SUB_IDEUPDATEOBJ_STRING1_SEP=NULL;
|
||||
if(_SUB_IDEUPDATEOBJ_STRING1_SEP==NULL){
|
||||
|
@ -50,61 +50,6 @@ if(_SUB_IDEUPDATEOBJ_LONG_X==NULL){
|
|||
_SUB_IDEUPDATEOBJ_LONG_X=(int32*)mem_static_malloc(4);
|
||||
*_SUB_IDEUPDATEOBJ_LONG_X=0;
|
||||
}
|
||||
byte_element_struct *byte_element_4178=NULL;
|
||||
if (!byte_element_4178){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4178=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4178=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4179=NULL;
|
||||
if (!byte_element_4179){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4179=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4179=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4180=NULL;
|
||||
if (!byte_element_4180){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4180=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4180=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4181=NULL;
|
||||
if (!byte_element_4181){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4181=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4181=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_SUB_IDEUPDATEOBJ_LONG_K=NULL;
|
||||
if(_SUB_IDEUPDATEOBJ_LONG_K==NULL){
|
||||
_SUB_IDEUPDATEOBJ_LONG_K=(int32*)mem_static_malloc(4);
|
||||
*_SUB_IDEUPDATEOBJ_LONG_K=0;
|
||||
}
|
||||
qbs *_SUB_IDEUPDATEOBJ_STRING_A1=NULL;
|
||||
if (!_SUB_IDEUPDATEOBJ_STRING_A1)_SUB_IDEUPDATEOBJ_STRING_A1=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4182=NULL;
|
||||
if (!byte_element_4182){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4182=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4182=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
qbs *_SUB_IDEUPDATEOBJ_STRING_A2=NULL;
|
||||
if (!_SUB_IDEUPDATEOBJ_STRING_A2)_SUB_IDEUPDATEOBJ_STRING_A2=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4183=NULL;
|
||||
if (!byte_element_4183){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4183=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4183=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4184=NULL;
|
||||
if (!byte_element_4184){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4184=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4184=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4185=NULL;
|
||||
if (!byte_element_4185){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4185=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4185=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4186=NULL;
|
||||
if (!byte_element_4186){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4186=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4186=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4187=NULL;
|
||||
if (!byte_element_4187){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4187=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4187=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
qbs *_SUB_IDEUPDATEOBJ_STRING_CLIP=NULL;
|
||||
if (!_SUB_IDEUPDATEOBJ_STRING_CLIP)_SUB_IDEUPDATEOBJ_STRING_CLIP=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4188=NULL;
|
||||
if (!byte_element_4188){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4188=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4188=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4189=NULL;
|
||||
if (!byte_element_4189){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4189=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4189=(byte_element_struct*)mem_static_malloc(12);
|
||||
|
@ -121,10 +66,65 @@ byte_element_struct *byte_element_4192=NULL;
|
|||
if (!byte_element_4192){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4192=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4192=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_SUB_IDEUPDATEOBJ_LONG_K=NULL;
|
||||
if(_SUB_IDEUPDATEOBJ_LONG_K==NULL){
|
||||
_SUB_IDEUPDATEOBJ_LONG_K=(int32*)mem_static_malloc(4);
|
||||
*_SUB_IDEUPDATEOBJ_LONG_K=0;
|
||||
}
|
||||
qbs *_SUB_IDEUPDATEOBJ_STRING_A1=NULL;
|
||||
if (!_SUB_IDEUPDATEOBJ_STRING_A1)_SUB_IDEUPDATEOBJ_STRING_A1=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4193=NULL;
|
||||
if (!byte_element_4193){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4193=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4193=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
qbs *_SUB_IDEUPDATEOBJ_STRING_A2=NULL;
|
||||
if (!_SUB_IDEUPDATEOBJ_STRING_A2)_SUB_IDEUPDATEOBJ_STRING_A2=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4194=NULL;
|
||||
if (!byte_element_4194){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4194=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4194=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4195=NULL;
|
||||
if (!byte_element_4195){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4195=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4195=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4196=NULL;
|
||||
if (!byte_element_4196){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4196=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4196=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4197=NULL;
|
||||
if (!byte_element_4197){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4197=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4197=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4198=NULL;
|
||||
if (!byte_element_4198){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4198=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4198=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
qbs *_SUB_IDEUPDATEOBJ_STRING_CLIP=NULL;
|
||||
if (!_SUB_IDEUPDATEOBJ_STRING_CLIP)_SUB_IDEUPDATEOBJ_STRING_CLIP=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4199=NULL;
|
||||
if (!byte_element_4199){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4199=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4199=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4200=NULL;
|
||||
if (!byte_element_4200){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4200=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4200=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4201=NULL;
|
||||
if (!byte_element_4201){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4201=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4201=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4202=NULL;
|
||||
if (!byte_element_4202){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4202=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4202=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4203=NULL;
|
||||
if (!byte_element_4203){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4203=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4203=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4204=NULL;
|
||||
if (!byte_element_4204){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4204=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4204=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_SUB_IDEUPDATEOBJ_LONG_Y1=NULL;
|
||||
if(_SUB_IDEUPDATEOBJ_LONG_Y1==NULL){
|
||||
_SUB_IDEUPDATEOBJ_LONG_Y1=(int32*)mem_static_malloc(4);
|
||||
|
@ -150,10 +150,10 @@ if(_SUB_IDEUPDATEOBJ_LONG_Q==NULL){
|
|||
_SUB_IDEUPDATEOBJ_LONG_Q=(int32*)mem_static_malloc(4);
|
||||
*_SUB_IDEUPDATEOBJ_LONG_Q=0;
|
||||
}
|
||||
int32 pass4194;
|
||||
byte_element_struct *byte_element_4195=NULL;
|
||||
if (!byte_element_4195){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4195=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4195=(byte_element_struct*)mem_static_malloc(12);
|
||||
int32 pass4205;
|
||||
byte_element_struct *byte_element_4206=NULL;
|
||||
if (!byte_element_4206){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4206=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4206=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_SUB_IDEUPDATEOBJ_LONG_OLD_SEL=NULL;
|
||||
if(_SUB_IDEUPDATEOBJ_LONG_OLD_SEL==NULL){
|
||||
|
@ -165,9 +165,9 @@ if(_SUB_IDEUPDATEOBJ_LONG_N==NULL){
|
|||
_SUB_IDEUPDATEOBJ_LONG_N=(int32*)mem_static_malloc(4);
|
||||
*_SUB_IDEUPDATEOBJ_LONG_N=0;
|
||||
}
|
||||
byte_element_struct *byte_element_4196=NULL;
|
||||
if (!byte_element_4196){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4196=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4196=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4207=NULL;
|
||||
if (!byte_element_4207){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4207=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4207=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_SUB_IDEUPDATEOBJ_LONG_AGAIN=NULL;
|
||||
if(_SUB_IDEUPDATEOBJ_LONG_AGAIN==NULL){
|
||||
|
@ -176,9 +176,9 @@ _SUB_IDEUPDATEOBJ_LONG_AGAIN=(int32*)mem_static_malloc(4);
|
|||
}
|
||||
qbs *_SUB_IDEUPDATEOBJ_STRING_CA2=NULL;
|
||||
if (!_SUB_IDEUPDATEOBJ_STRING_CA2)_SUB_IDEUPDATEOBJ_STRING_CA2=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4198=NULL;
|
||||
if (!byte_element_4198){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4198=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4198=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4209=NULL;
|
||||
if (!byte_element_4209){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4209=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4209=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_SUB_IDEUPDATEOBJ_LONG_MATCH=NULL;
|
||||
if(_SUB_IDEUPDATEOBJ_LONG_MATCH==NULL){
|
||||
|
@ -190,48 +190,48 @@ if(_SUB_IDEUPDATEOBJ_LONG_AI==NULL){
|
|||
_SUB_IDEUPDATEOBJ_LONG_AI=(int32*)mem_static_malloc(4);
|
||||
*_SUB_IDEUPDATEOBJ_LONG_AI=0;
|
||||
}
|
||||
int64 fornext_value4200;
|
||||
int64 fornext_finalvalue4200;
|
||||
int64 fornext_step4200;
|
||||
uint8 fornext_step_negative4200;
|
||||
byte_element_struct *byte_element_4201=NULL;
|
||||
if (!byte_element_4201){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4201=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4201=(byte_element_struct*)mem_static_malloc(12);
|
||||
int64 fornext_value4211;
|
||||
int64 fornext_finalvalue4211;
|
||||
int64 fornext_step4211;
|
||||
uint8 fornext_step_negative4211;
|
||||
byte_element_struct *byte_element_4212=NULL;
|
||||
if (!byte_element_4212){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4212=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4212=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_SUB_IDEUPDATEOBJ_LONG_AA=NULL;
|
||||
if(_SUB_IDEUPDATEOBJ_LONG_AA==NULL){
|
||||
_SUB_IDEUPDATEOBJ_LONG_AA=(int32*)mem_static_malloc(4);
|
||||
*_SUB_IDEUPDATEOBJ_LONG_AA=0;
|
||||
}
|
||||
byte_element_struct *byte_element_4202=NULL;
|
||||
if (!byte_element_4202){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4202=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4202=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4213=NULL;
|
||||
if (!byte_element_4213){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4213=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4213=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_SUB_IDEUPDATEOBJ_LONG_I2=NULL;
|
||||
if(_SUB_IDEUPDATEOBJ_LONG_I2==NULL){
|
||||
_SUB_IDEUPDATEOBJ_LONG_I2=(int32*)mem_static_malloc(4);
|
||||
*_SUB_IDEUPDATEOBJ_LONG_I2=0;
|
||||
}
|
||||
int64 fornext_value4204;
|
||||
int64 fornext_finalvalue4204;
|
||||
int64 fornext_step4204;
|
||||
uint8 fornext_step_negative4204;
|
||||
byte_element_struct *byte_element_4205=NULL;
|
||||
if (!byte_element_4205){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4205=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4205=(byte_element_struct*)mem_static_malloc(12);
|
||||
int64 fornext_value4215;
|
||||
int64 fornext_finalvalue4215;
|
||||
int64 fornext_step4215;
|
||||
uint8 fornext_step_negative4215;
|
||||
byte_element_struct *byte_element_4216=NULL;
|
||||
if (!byte_element_4216){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4216=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4216=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_SUB_IDEUPDATEOBJ_LONG_C=NULL;
|
||||
if(_SUB_IDEUPDATEOBJ_LONG_C==NULL){
|
||||
_SUB_IDEUPDATEOBJ_LONG_C=(int32*)mem_static_malloc(4);
|
||||
*_SUB_IDEUPDATEOBJ_LONG_C=0;
|
||||
}
|
||||
int64 fornext_value4207;
|
||||
int64 fornext_finalvalue4207;
|
||||
int64 fornext_step4207;
|
||||
uint8 fornext_step_negative4207;
|
||||
byte_element_struct *byte_element_4208=NULL;
|
||||
if (!byte_element_4208){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4208=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4208=(byte_element_struct*)mem_static_malloc(12);
|
||||
int64 fornext_value4218;
|
||||
int64 fornext_finalvalue4218;
|
||||
int64 fornext_step4218;
|
||||
uint8 fornext_step_negative4218;
|
||||
byte_element_struct *byte_element_4219=NULL;
|
||||
if (!byte_element_4219){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4219=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4219=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_SUB_IDEUPDATEOBJ_LONG_W=NULL;
|
||||
if(_SUB_IDEUPDATEOBJ_LONG_W==NULL){
|
||||
|
@ -255,24 +255,24 @@ _SUB_IDEUPDATEOBJ_LONG_N2=(int32*)mem_static_malloc(4);
|
|||
}
|
||||
qbs *_SUB_IDEUPDATEOBJ_STRING_A3=NULL;
|
||||
if (!_SUB_IDEUPDATEOBJ_STRING_A3)_SUB_IDEUPDATEOBJ_STRING_A3=qbs_new(0,0);
|
||||
int64 fornext_value4210;
|
||||
int64 fornext_finalvalue4210;
|
||||
int64 fornext_step4210;
|
||||
uint8 fornext_step_negative4210;
|
||||
byte_element_struct *byte_element_4211=NULL;
|
||||
if (!byte_element_4211){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4211=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4211=(byte_element_struct*)mem_static_malloc(12);
|
||||
int64 fornext_value4221;
|
||||
int64 fornext_finalvalue4221;
|
||||
int64 fornext_step4221;
|
||||
uint8 fornext_step_negative4221;
|
||||
byte_element_struct *byte_element_4222=NULL;
|
||||
if (!byte_element_4222){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4222=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4222=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4212=NULL;
|
||||
if (!byte_element_4212){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4212=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4212=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4223=NULL;
|
||||
if (!byte_element_4223){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4223=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4223=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_SUB_IDEUPDATEOBJ_LONG_F2=NULL;
|
||||
if(_SUB_IDEUPDATEOBJ_LONG_F2==NULL){
|
||||
_SUB_IDEUPDATEOBJ_LONG_F2=(int32*)mem_static_malloc(4);
|
||||
*_SUB_IDEUPDATEOBJ_LONG_F2=0;
|
||||
}
|
||||
byte_element_struct *byte_element_4213=NULL;
|
||||
if (!byte_element_4213){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4213=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4213=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4224=NULL;
|
||||
if (!byte_element_4224){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4224=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4224=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
|
|
|
@ -18,10 +18,10 @@ if(_FUNC_IDEVBAR_LONG_Y2==NULL){
|
|||
_FUNC_IDEVBAR_LONG_Y2=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDEVBAR_LONG_Y2=0;
|
||||
}
|
||||
int64 fornext_value4217;
|
||||
int64 fornext_finalvalue4217;
|
||||
int64 fornext_step4217;
|
||||
uint8 fornext_step_negative4217;
|
||||
int64 fornext_value4228;
|
||||
int64 fornext_finalvalue4228;
|
||||
int64 fornext_step4228;
|
||||
uint8 fornext_step_negative4228;
|
||||
float *_FUNC_IDEVBAR_SINGLE_P=NULL;
|
||||
if(_FUNC_IDEVBAR_SINGLE_P==NULL){
|
||||
_FUNC_IDEVBAR_SINGLE_P=(float*)mem_static_malloc(4);
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
qbs*oldstr1924=NULL;
|
||||
qbs*oldstr1928=NULL;
|
||||
if(_SUB_WIKIPARSE_STRING_A->tmp||_SUB_WIKIPARSE_STRING_A->fixed||_SUB_WIKIPARSE_STRING_A->readonly){
|
||||
oldstr1924=_SUB_WIKIPARSE_STRING_A;
|
||||
if (oldstr1924->cmem_descriptor){
|
||||
_SUB_WIKIPARSE_STRING_A=qbs_new_cmem(oldstr1924->len,0);
|
||||
oldstr1928=_SUB_WIKIPARSE_STRING_A;
|
||||
if (oldstr1928->cmem_descriptor){
|
||||
_SUB_WIKIPARSE_STRING_A=qbs_new_cmem(oldstr1928->len,0);
|
||||
}else{
|
||||
_SUB_WIKIPARSE_STRING_A=qbs_new(oldstr1924->len,0);
|
||||
_SUB_WIKIPARSE_STRING_A=qbs_new(oldstr1928->len,0);
|
||||
}
|
||||
memcpy(_SUB_WIKIPARSE_STRING_A->chr,oldstr1924->chr,oldstr1924->len);
|
||||
memcpy(_SUB_WIKIPARSE_STRING_A->chr,oldstr1928->chr,oldstr1928->len);
|
||||
}
|
||||
int32 *_SUB_WIKIPARSE_LONG_LINK=NULL;
|
||||
if(_SUB_WIKIPARSE_LONG_LINK==NULL){
|
||||
|
@ -45,18 +45,18 @@ if(_SUB_WIKIPARSE_LONG_II==NULL){
|
|||
_SUB_WIKIPARSE_LONG_II=(int32*)mem_static_malloc(4);
|
||||
*_SUB_WIKIPARSE_LONG_II=0;
|
||||
}
|
||||
int64 fornext_value1926;
|
||||
int64 fornext_finalvalue1926;
|
||||
int64 fornext_step1926;
|
||||
uint8 fornext_step_negative1926;
|
||||
int64 fornext_value1930;
|
||||
int64 fornext_finalvalue1930;
|
||||
int64 fornext_step1930;
|
||||
uint8 fornext_step_negative1930;
|
||||
int32 *_SUB_WIKIPARSE_LONG_N=NULL;
|
||||
if(_SUB_WIKIPARSE_LONG_N==NULL){
|
||||
_SUB_WIKIPARSE_LONG_N=(int32*)mem_static_malloc(4);
|
||||
*_SUB_WIKIPARSE_LONG_N=0;
|
||||
}
|
||||
byte_element_struct *byte_element_1927=NULL;
|
||||
if (!byte_element_1927){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_1927=(byte_element_struct*)(mem_static_pointer-12); else byte_element_1927=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_1931=NULL;
|
||||
if (!byte_element_1931){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_1931=(byte_element_struct*)(mem_static_pointer-12); else byte_element_1931=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_SUB_WIKIPARSE_LONG_I=NULL;
|
||||
if(_SUB_WIKIPARSE_LONG_I==NULL){
|
||||
|
@ -75,37 +75,21 @@ if(_SUB_WIKIPARSE_LONG_I1==NULL){
|
|||
_SUB_WIKIPARSE_LONG_I1=(int32*)mem_static_malloc(4);
|
||||
*_SUB_WIKIPARSE_LONG_I1=0;
|
||||
}
|
||||
int64 fornext_value1930;
|
||||
int64 fornext_finalvalue1930;
|
||||
int64 fornext_step1930;
|
||||
uint8 fornext_step_negative1930;
|
||||
int64 fornext_value1934;
|
||||
int64 fornext_finalvalue1934;
|
||||
int64 fornext_step1934;
|
||||
uint8 fornext_step_negative1934;
|
||||
int32 *_SUB_WIKIPARSE_LONG_I2=NULL;
|
||||
if(_SUB_WIKIPARSE_LONG_I2==NULL){
|
||||
_SUB_WIKIPARSE_LONG_I2=(int32*)mem_static_malloc(4);
|
||||
*_SUB_WIKIPARSE_LONG_I2=0;
|
||||
}
|
||||
int64 fornext_value1932;
|
||||
int64 fornext_finalvalue1932;
|
||||
int64 fornext_step1932;
|
||||
uint8 fornext_step_negative1932;
|
||||
int64 fornext_value1936;
|
||||
int64 fornext_finalvalue1936;
|
||||
int64 fornext_step1936;
|
||||
uint8 fornext_step_negative1936;
|
||||
qbs *_SUB_WIKIPARSE_STRING_S=NULL;
|
||||
if (!_SUB_WIKIPARSE_STRING_S)_SUB_WIKIPARSE_STRING_S=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_1933=NULL;
|
||||
if (!byte_element_1933){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_1933=(byte_element_struct*)(mem_static_pointer-12); else byte_element_1933=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_1934=NULL;
|
||||
if (!byte_element_1934){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_1934=(byte_element_struct*)(mem_static_pointer-12); else byte_element_1934=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_1935=NULL;
|
||||
if (!byte_element_1935){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_1935=(byte_element_struct*)(mem_static_pointer-12); else byte_element_1935=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_1936=NULL;
|
||||
if (!byte_element_1936){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_1936=(byte_element_struct*)(mem_static_pointer-12); else byte_element_1936=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_1937=NULL;
|
||||
if (!byte_element_1937){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_1937=(byte_element_struct*)(mem_static_pointer-12); else byte_element_1937=(byte_element_struct*)mem_static_malloc(12);
|
||||
|
@ -146,10 +130,14 @@ byte_element_struct *byte_element_1946=NULL;
|
|||
if (!byte_element_1946){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_1946=(byte_element_struct*)(mem_static_pointer-12); else byte_element_1946=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int64 fornext_value1948;
|
||||
int64 fornext_finalvalue1948;
|
||||
int64 fornext_step1948;
|
||||
uint8 fornext_step_negative1948;
|
||||
byte_element_struct *byte_element_1947=NULL;
|
||||
if (!byte_element_1947){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_1947=(byte_element_struct*)(mem_static_pointer-12); else byte_element_1947=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_1948=NULL;
|
||||
if (!byte_element_1948){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_1948=(byte_element_struct*)(mem_static_pointer-12); else byte_element_1948=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_1949=NULL;
|
||||
if (!byte_element_1949){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_1949=(byte_element_struct*)(mem_static_pointer-12); else byte_element_1949=(byte_element_struct*)mem_static_malloc(12);
|
||||
|
@ -158,14 +146,14 @@ byte_element_struct *byte_element_1950=NULL;
|
|||
if (!byte_element_1950){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_1950=(byte_element_struct*)(mem_static_pointer-12); else byte_element_1950=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_1951=NULL;
|
||||
if (!byte_element_1951){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_1951=(byte_element_struct*)(mem_static_pointer-12); else byte_element_1951=(byte_element_struct*)mem_static_malloc(12);
|
||||
int64 fornext_value1952;
|
||||
int64 fornext_finalvalue1952;
|
||||
int64 fornext_step1952;
|
||||
uint8 fornext_step_negative1952;
|
||||
byte_element_struct *byte_element_1953=NULL;
|
||||
if (!byte_element_1953){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_1953=(byte_element_struct*)(mem_static_pointer-12); else byte_element_1953=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int64 fornext_value1953;
|
||||
int64 fornext_finalvalue1953;
|
||||
int64 fornext_step1953;
|
||||
uint8 fornext_step_negative1953;
|
||||
byte_element_struct *byte_element_1954=NULL;
|
||||
if (!byte_element_1954){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_1954=(byte_element_struct*)(mem_static_pointer-12); else byte_element_1954=(byte_element_struct*)mem_static_malloc(12);
|
||||
|
@ -174,98 +162,94 @@ byte_element_struct *byte_element_1955=NULL;
|
|||
if (!byte_element_1955){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_1955=(byte_element_struct*)(mem_static_pointer-12); else byte_element_1955=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_1956=NULL;
|
||||
if (!byte_element_1956){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_1956=(byte_element_struct*)(mem_static_pointer-12); else byte_element_1956=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_1957=NULL;
|
||||
if (!byte_element_1957){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_1957=(byte_element_struct*)(mem_static_pointer-12); else byte_element_1957=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int64 fornext_value1957;
|
||||
int64 fornext_finalvalue1957;
|
||||
int64 fornext_step1957;
|
||||
uint8 fornext_step_negative1957;
|
||||
byte_element_struct *byte_element_1958=NULL;
|
||||
if (!byte_element_1958){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_1958=(byte_element_struct*)(mem_static_pointer-12); else byte_element_1958=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_1959=NULL;
|
||||
if (!byte_element_1959){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_1959=(byte_element_struct*)(mem_static_pointer-12); else byte_element_1959=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_1960=NULL;
|
||||
if (!byte_element_1960){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_1960=(byte_element_struct*)(mem_static_pointer-12); else byte_element_1960=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_1961=NULL;
|
||||
if (!byte_element_1961){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_1961=(byte_element_struct*)(mem_static_pointer-12); else byte_element_1961=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_1962=NULL;
|
||||
if (!byte_element_1962){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_1962=(byte_element_struct*)(mem_static_pointer-12); else byte_element_1962=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
qbs *_SUB_WIKIPARSE_STRING_LINK=NULL;
|
||||
if (!_SUB_WIKIPARSE_STRING_LINK)_SUB_WIKIPARSE_STRING_LINK=qbs_new(0,0);
|
||||
qbs *_SUB_WIKIPARSE_STRING_TEXT=NULL;
|
||||
if (!_SUB_WIKIPARSE_STRING_TEXT)_SUB_WIKIPARSE_STRING_TEXT=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_1959=NULL;
|
||||
if (!byte_element_1959){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_1959=(byte_element_struct*)(mem_static_pointer-12); else byte_element_1959=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_1963=NULL;
|
||||
if (!byte_element_1963){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_1963=(byte_element_struct*)(mem_static_pointer-12); else byte_element_1963=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 pass1960;
|
||||
int32 pass1961;
|
||||
qbs *_SUB_WIKIPARSE_STRING_ELINK=NULL;
|
||||
if (!_SUB_WIKIPARSE_STRING_ELINK)_SUB_WIKIPARSE_STRING_ELINK=qbs_new(0,0);
|
||||
int32 pass1962;
|
||||
int32 pass1963;
|
||||
qbs *_SUB_WIKIPARSE_STRING_CB=NULL;
|
||||
if (!_SUB_WIKIPARSE_STRING_CB)_SUB_WIKIPARSE_STRING_CB=qbs_new(0,0);
|
||||
int32 pass1964;
|
||||
int32 pass1965;
|
||||
qbs *_SUB_WIKIPARSE_STRING_ELINK=NULL;
|
||||
if (!_SUB_WIKIPARSE_STRING_ELINK)_SUB_WIKIPARSE_STRING_ELINK=qbs_new(0,0);
|
||||
int32 pass1966;
|
||||
int32 pass1967;
|
||||
qbs *_SUB_WIKIPARSE_STRING_CB=NULL;
|
||||
if (!_SUB_WIKIPARSE_STRING_CB)_SUB_WIKIPARSE_STRING_CB=qbs_new(0,0);
|
||||
int32 pass1968;
|
||||
int32 pass1969;
|
||||
int32 pass1970;
|
||||
int32 pass1971;
|
||||
int32 *_SUB_WIKIPARSE_LONG_WS=NULL;
|
||||
if(_SUB_WIKIPARSE_LONG_WS==NULL){
|
||||
_SUB_WIKIPARSE_LONG_WS=(int32*)mem_static_malloc(4);
|
||||
*_SUB_WIKIPARSE_LONG_WS=0;
|
||||
}
|
||||
int64 fornext_value1969;
|
||||
int64 fornext_finalvalue1969;
|
||||
int64 fornext_step1969;
|
||||
uint8 fornext_step_negative1969;
|
||||
byte_element_struct *byte_element_1970=NULL;
|
||||
if (!byte_element_1970){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_1970=(byte_element_struct*)(mem_static_pointer-12); else byte_element_1970=(byte_element_struct*)mem_static_malloc(12);
|
||||
int64 fornext_value1973;
|
||||
int64 fornext_finalvalue1973;
|
||||
int64 fornext_step1973;
|
||||
uint8 fornext_step_negative1973;
|
||||
byte_element_struct *byte_element_1974=NULL;
|
||||
if (!byte_element_1974){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_1974=(byte_element_struct*)(mem_static_pointer-12); else byte_element_1974=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int64 fornext_value1972;
|
||||
int64 fornext_finalvalue1972;
|
||||
int64 fornext_step1972;
|
||||
uint8 fornext_step_negative1972;
|
||||
byte_element_struct *byte_element_1973=NULL;
|
||||
if (!byte_element_1973){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_1973=(byte_element_struct*)(mem_static_pointer-12); else byte_element_1973=(byte_element_struct*)mem_static_malloc(12);
|
||||
int64 fornext_value1976;
|
||||
int64 fornext_finalvalue1976;
|
||||
int64 fornext_step1976;
|
||||
uint8 fornext_step_negative1976;
|
||||
byte_element_struct *byte_element_1977=NULL;
|
||||
if (!byte_element_1977){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_1977=(byte_element_struct*)(mem_static_pointer-12); else byte_element_1977=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_SUB_WIKIPARSE_LONG_NL=NULL;
|
||||
if(_SUB_WIKIPARSE_LONG_NL==NULL){
|
||||
_SUB_WIKIPARSE_LONG_NL=(int32*)mem_static_malloc(4);
|
||||
*_SUB_WIKIPARSE_LONG_NL=0;
|
||||
}
|
||||
int32 pass1974;
|
||||
int32 pass1975;
|
||||
int32 pass1976;
|
||||
int32 pass1977;
|
||||
byte_element_struct *byte_element_1978=NULL;
|
||||
if (!byte_element_1978){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_1978=(byte_element_struct*)(mem_static_pointer-12); else byte_element_1978=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int64 fornext_value1980;
|
||||
int64 fornext_finalvalue1980;
|
||||
int64 fornext_step1980;
|
||||
uint8 fornext_step_negative1980;
|
||||
byte_element_struct *byte_element_1981=NULL;
|
||||
if (!byte_element_1981){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_1981=(byte_element_struct*)(mem_static_pointer-12); else byte_element_1981=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 pass1982;
|
||||
int32 pass1983;
|
||||
byte_element_struct *byte_element_1984=NULL;
|
||||
if (!byte_element_1984){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_1984=(byte_element_struct*)(mem_static_pointer-12); else byte_element_1984=(byte_element_struct*)mem_static_malloc(12);
|
||||
int32 pass1978;
|
||||
int32 pass1979;
|
||||
int32 pass1980;
|
||||
int32 pass1981;
|
||||
byte_element_struct *byte_element_1982=NULL;
|
||||
if (!byte_element_1982){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_1982=(byte_element_struct*)(mem_static_pointer-12); else byte_element_1982=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int64 fornext_value1984;
|
||||
int64 fornext_finalvalue1984;
|
||||
int64 fornext_step1984;
|
||||
uint8 fornext_step_negative1984;
|
||||
byte_element_struct *byte_element_1985=NULL;
|
||||
if (!byte_element_1985){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_1985=(byte_element_struct*)(mem_static_pointer-12); else byte_element_1985=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_1986=NULL;
|
||||
if (!byte_element_1986){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_1986=(byte_element_struct*)(mem_static_pointer-12); else byte_element_1986=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_1987=NULL;
|
||||
if (!byte_element_1987){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_1987=(byte_element_struct*)(mem_static_pointer-12); else byte_element_1987=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 pass1986;
|
||||
int32 pass1987;
|
||||
byte_element_struct *byte_element_1988=NULL;
|
||||
if (!byte_element_1988){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_1988=(byte_element_struct*)(mem_static_pointer-12); else byte_element_1988=(byte_element_struct*)mem_static_malloc(12);
|
||||
|
@ -274,18 +258,34 @@ byte_element_struct *byte_element_1989=NULL;
|
|||
if (!byte_element_1989){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_1989=(byte_element_struct*)(mem_static_pointer-12); else byte_element_1989=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int64 fornext_value1991;
|
||||
int64 fornext_finalvalue1991;
|
||||
int64 fornext_step1991;
|
||||
uint8 fornext_step_negative1991;
|
||||
byte_element_struct *byte_element_1990=NULL;
|
||||
if (!byte_element_1990){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_1990=(byte_element_struct*)(mem_static_pointer-12); else byte_element_1990=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_1991=NULL;
|
||||
if (!byte_element_1991){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_1991=(byte_element_struct*)(mem_static_pointer-12); else byte_element_1991=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_1992=NULL;
|
||||
if (!byte_element_1992){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_1992=(byte_element_struct*)(mem_static_pointer-12); else byte_element_1992=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 pass1993;
|
||||
int32 pass1994;
|
||||
int32 pass1995;
|
||||
int32 pass1996;
|
||||
byte_element_struct *byte_element_1993=NULL;
|
||||
if (!byte_element_1993){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_1993=(byte_element_struct*)(mem_static_pointer-12); else byte_element_1993=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int64 fornext_value1995;
|
||||
int64 fornext_finalvalue1995;
|
||||
int64 fornext_step1995;
|
||||
uint8 fornext_step_negative1995;
|
||||
byte_element_struct *byte_element_1996=NULL;
|
||||
if (!byte_element_1996){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_1996=(byte_element_struct*)(mem_static_pointer-12); else byte_element_1996=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 pass1997;
|
||||
int32 pass1998;
|
||||
int32 pass1999;
|
||||
int32 pass2000;
|
||||
int32 *_SUB_WIKIPARSE_LONG_FH=NULL;
|
||||
if(_SUB_WIKIPARSE_LONG_FH==NULL){
|
||||
_SUB_WIKIPARSE_LONG_FH=(int32*)mem_static_malloc(4);
|
||||
|
@ -296,10 +296,10 @@ if(_SUB_WIKIPARSE_LONG_CY==NULL){
|
|||
_SUB_WIKIPARSE_LONG_CY=(int32*)mem_static_malloc(4);
|
||||
*_SUB_WIKIPARSE_LONG_CY=0;
|
||||
}
|
||||
int64 fornext_value1998;
|
||||
int64 fornext_finalvalue1998;
|
||||
int64 fornext_step1998;
|
||||
uint8 fornext_step_negative1998;
|
||||
int64 fornext_value2002;
|
||||
int64 fornext_finalvalue2002;
|
||||
int64 fornext_step2002;
|
||||
uint8 fornext_step_negative2002;
|
||||
int32 *_SUB_WIKIPARSE_LONG_L=NULL;
|
||||
if(_SUB_WIKIPARSE_LONG_L==NULL){
|
||||
_SUB_WIKIPARSE_LONG_L=(int32*)mem_static_malloc(4);
|
||||
|
@ -350,10 +350,10 @@ if(_SUB_WIKIPARSE_LONG_LX==NULL){
|
|||
_SUB_WIKIPARSE_LONG_LX=(int32*)mem_static_malloc(4);
|
||||
*_SUB_WIKIPARSE_LONG_LX=0;
|
||||
}
|
||||
int64 fornext_value2001;
|
||||
int64 fornext_finalvalue2001;
|
||||
int64 fornext_step2001;
|
||||
uint8 fornext_step_negative2001;
|
||||
int64 fornext_value2005;
|
||||
int64 fornext_finalvalue2005;
|
||||
int64 fornext_step2005;
|
||||
uint8 fornext_step_negative2005;
|
||||
int32 *_SUB_WIKIPARSE_LONG_L2=NULL;
|
||||
if(_SUB_WIKIPARSE_LONG_L2==NULL){
|
||||
_SUB_WIKIPARSE_LONG_L2=(int32*)mem_static_malloc(4);
|
||||
|
@ -361,17 +361,17 @@ _SUB_WIKIPARSE_LONG_L2=(int32*)mem_static_malloc(4);
|
|||
}
|
||||
qbs *_SUB_WIKIPARSE_STRING_L=NULL;
|
||||
if (!_SUB_WIKIPARSE_STRING_L)_SUB_WIKIPARSE_STRING_L=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_2002=NULL;
|
||||
if (!byte_element_2002){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_2002=(byte_element_struct*)(mem_static_pointer-12); else byte_element_2002=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_2006=NULL;
|
||||
if (!byte_element_2006){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_2006=(byte_element_struct*)(mem_static_pointer-12); else byte_element_2006=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
qbs *_SUB_WIKIPARSE_STRING_A2=NULL;
|
||||
if (!_SUB_WIKIPARSE_STRING_A2)_SUB_WIKIPARSE_STRING_A2=qbs_new(0,0);
|
||||
qbs *_SUB_WIKIPARSE_STRING_A3=NULL;
|
||||
if (!_SUB_WIKIPARSE_STRING_A3)_SUB_WIKIPARSE_STRING_A3=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_2003=NULL;
|
||||
if (!byte_element_2003){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_2003=(byte_element_struct*)(mem_static_pointer-12); else byte_element_2003=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_2007=NULL;
|
||||
if (!byte_element_2007){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_2007=(byte_element_struct*)(mem_static_pointer-12); else byte_element_2007=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_SUB_WIKIPARSE_LONG_SKIP=NULL;
|
||||
if(_SUB_WIKIPARSE_LONG_SKIP==NULL){
|
||||
|
@ -383,19 +383,6 @@ if(_SUB_WIKIPARSE_LONG_CI==NULL){
|
|||
_SUB_WIKIPARSE_LONG_CI=(int32*)mem_static_malloc(4);
|
||||
*_SUB_WIKIPARSE_LONG_CI=0;
|
||||
}
|
||||
int64 fornext_value2005;
|
||||
int64 fornext_finalvalue2005;
|
||||
int64 fornext_step2005;
|
||||
uint8 fornext_step_negative2005;
|
||||
byte_element_struct *byte_element_2006=NULL;
|
||||
if (!byte_element_2006){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_2006=(byte_element_struct*)(mem_static_pointer-12); else byte_element_2006=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_SUB_WIKIPARSE_LONG_CA=NULL;
|
||||
if(_SUB_WIKIPARSE_LONG_CA==NULL){
|
||||
_SUB_WIKIPARSE_LONG_CA=(int32*)mem_static_malloc(4);
|
||||
*_SUB_WIKIPARSE_LONG_CA=0;
|
||||
}
|
||||
int64 fornext_value2009;
|
||||
int64 fornext_finalvalue2009;
|
||||
int64 fornext_step2009;
|
||||
|
@ -404,19 +391,24 @@ byte_element_struct *byte_element_2010=NULL;
|
|||
if (!byte_element_2010){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_2010=(byte_element_struct*)(mem_static_pointer-12); else byte_element_2010=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_SUB_WIKIPARSE_LONG_CA=NULL;
|
||||
if(_SUB_WIKIPARSE_LONG_CA==NULL){
|
||||
_SUB_WIKIPARSE_LONG_CA=(int32*)mem_static_malloc(4);
|
||||
*_SUB_WIKIPARSE_LONG_CA=0;
|
||||
}
|
||||
int64 fornext_value2013;
|
||||
int64 fornext_finalvalue2013;
|
||||
int64 fornext_step2013;
|
||||
uint8 fornext_step_negative2013;
|
||||
byte_element_struct *byte_element_2014=NULL;
|
||||
if (!byte_element_2014){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_2014=(byte_element_struct*)(mem_static_pointer-12); else byte_element_2014=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
qbs *_SUB_WIKIPARSE_STRING_OA2=NULL;
|
||||
if (!_SUB_WIKIPARSE_STRING_OA2)_SUB_WIKIPARSE_STRING_OA2=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_2012=NULL;
|
||||
if (!byte_element_2012){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_2012=(byte_element_struct*)(mem_static_pointer-12); else byte_element_2012=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int64 fornext_value2014;
|
||||
int64 fornext_finalvalue2014;
|
||||
int64 fornext_step2014;
|
||||
uint8 fornext_step_negative2014;
|
||||
byte_element_struct *byte_element_2015=NULL;
|
||||
if (!byte_element_2015){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_2015=(byte_element_struct*)(mem_static_pointer-12); else byte_element_2015=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_2016=NULL;
|
||||
if (!byte_element_2016){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_2016=(byte_element_struct*)(mem_static_pointer-12); else byte_element_2016=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int64 fornext_value2018;
|
||||
int64 fornext_finalvalue2018;
|
||||
|
@ -426,3 +418,11 @@ byte_element_struct *byte_element_2019=NULL;
|
|||
if (!byte_element_2019){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_2019=(byte_element_struct*)(mem_static_pointer-12); else byte_element_2019=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int64 fornext_value2022;
|
||||
int64 fornext_finalvalue2022;
|
||||
int64 fornext_step2022;
|
||||
uint8 fornext_step_negative2022;
|
||||
byte_element_struct *byte_element_2023=NULL;
|
||||
if (!byte_element_2023){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_2023=(byte_element_struct*)(mem_static_pointer-12); else byte_element_2023=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
qbs *_FUNC_IDEZFILENAME_STRING_IDEZFILENAME=NULL;
|
||||
if (!_FUNC_IDEZFILENAME_STRING_IDEZFILENAME)_FUNC_IDEZFILENAME_STRING_IDEZFILENAME=qbs_new(0,0);
|
||||
qbs*oldstr4223=NULL;
|
||||
qbs*oldstr4234=NULL;
|
||||
if(_FUNC_IDEZFILENAME_STRING_F->tmp||_FUNC_IDEZFILENAME_STRING_F->fixed||_FUNC_IDEZFILENAME_STRING_F->readonly){
|
||||
oldstr4223=_FUNC_IDEZFILENAME_STRING_F;
|
||||
if (oldstr4223->cmem_descriptor){
|
||||
_FUNC_IDEZFILENAME_STRING_F=qbs_new_cmem(oldstr4223->len,0);
|
||||
oldstr4234=_FUNC_IDEZFILENAME_STRING_F;
|
||||
if (oldstr4234->cmem_descriptor){
|
||||
_FUNC_IDEZFILENAME_STRING_F=qbs_new_cmem(oldstr4234->len,0);
|
||||
}else{
|
||||
_FUNC_IDEZFILENAME_STRING_F=qbs_new(oldstr4223->len,0);
|
||||
_FUNC_IDEZFILENAME_STRING_F=qbs_new(oldstr4234->len,0);
|
||||
}
|
||||
memcpy(_FUNC_IDEZFILENAME_STRING_F->chr,oldstr4223->chr,oldstr4223->len);
|
||||
memcpy(_FUNC_IDEZFILENAME_STRING_F->chr,oldstr4234->chr,oldstr4234->len);
|
||||
}
|
||||
|
|
|
@ -1,49 +1,49 @@
|
|||
qbs *_FUNC_IDEZCHANGEPATH_STRING_IDEZCHANGEPATH=NULL;
|
||||
if (!_FUNC_IDEZCHANGEPATH_STRING_IDEZCHANGEPATH)_FUNC_IDEZCHANGEPATH_STRING_IDEZCHANGEPATH=qbs_new(0,0);
|
||||
qbs*oldstr4224=NULL;
|
||||
qbs*oldstr4235=NULL;
|
||||
if(_FUNC_IDEZCHANGEPATH_STRING_PATH->tmp||_FUNC_IDEZCHANGEPATH_STRING_PATH->fixed||_FUNC_IDEZCHANGEPATH_STRING_PATH->readonly){
|
||||
oldstr4224=_FUNC_IDEZCHANGEPATH_STRING_PATH;
|
||||
if (oldstr4224->cmem_descriptor){
|
||||
_FUNC_IDEZCHANGEPATH_STRING_PATH=qbs_new_cmem(oldstr4224->len,0);
|
||||
oldstr4235=_FUNC_IDEZCHANGEPATH_STRING_PATH;
|
||||
if (oldstr4235->cmem_descriptor){
|
||||
_FUNC_IDEZCHANGEPATH_STRING_PATH=qbs_new_cmem(oldstr4235->len,0);
|
||||
}else{
|
||||
_FUNC_IDEZCHANGEPATH_STRING_PATH=qbs_new(oldstr4224->len,0);
|
||||
_FUNC_IDEZCHANGEPATH_STRING_PATH=qbs_new(oldstr4235->len,0);
|
||||
}
|
||||
memcpy(_FUNC_IDEZCHANGEPATH_STRING_PATH->chr,oldstr4224->chr,oldstr4224->len);
|
||||
memcpy(_FUNC_IDEZCHANGEPATH_STRING_PATH->chr,oldstr4235->chr,oldstr4235->len);
|
||||
}
|
||||
qbs*oldstr4225=NULL;
|
||||
qbs*oldstr4236=NULL;
|
||||
if(_FUNC_IDEZCHANGEPATH_STRING_NEWPATH->tmp||_FUNC_IDEZCHANGEPATH_STRING_NEWPATH->fixed||_FUNC_IDEZCHANGEPATH_STRING_NEWPATH->readonly){
|
||||
oldstr4225=_FUNC_IDEZCHANGEPATH_STRING_NEWPATH;
|
||||
if (oldstr4225->cmem_descriptor){
|
||||
_FUNC_IDEZCHANGEPATH_STRING_NEWPATH=qbs_new_cmem(oldstr4225->len,0);
|
||||
oldstr4236=_FUNC_IDEZCHANGEPATH_STRING_NEWPATH;
|
||||
if (oldstr4236->cmem_descriptor){
|
||||
_FUNC_IDEZCHANGEPATH_STRING_NEWPATH=qbs_new_cmem(oldstr4236->len,0);
|
||||
}else{
|
||||
_FUNC_IDEZCHANGEPATH_STRING_NEWPATH=qbs_new(oldstr4225->len,0);
|
||||
_FUNC_IDEZCHANGEPATH_STRING_NEWPATH=qbs_new(oldstr4236->len,0);
|
||||
}
|
||||
memcpy(_FUNC_IDEZCHANGEPATH_STRING_NEWPATH->chr,oldstr4225->chr,oldstr4225->len);
|
||||
memcpy(_FUNC_IDEZCHANGEPATH_STRING_NEWPATH->chr,oldstr4236->chr,oldstr4236->len);
|
||||
}
|
||||
int32 *_FUNC_IDEZCHANGEPATH_LONG_X=NULL;
|
||||
if(_FUNC_IDEZCHANGEPATH_LONG_X==NULL){
|
||||
_FUNC_IDEZCHANGEPATH_LONG_X=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDEZCHANGEPATH_LONG_X=0;
|
||||
}
|
||||
int64 fornext_value4227;
|
||||
int64 fornext_finalvalue4227;
|
||||
int64 fornext_step4227;
|
||||
uint8 fornext_step_negative4227;
|
||||
byte_element_struct *byte_element_4228=NULL;
|
||||
if (!byte_element_4228){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4228=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4228=(byte_element_struct*)mem_static_malloc(12);
|
||||
int64 fornext_value4238;
|
||||
int64 fornext_finalvalue4238;
|
||||
int64 fornext_step4238;
|
||||
uint8 fornext_step_negative4238;
|
||||
byte_element_struct *byte_element_4239=NULL;
|
||||
if (!byte_element_4239){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4239=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4239=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
qbs *_FUNC_IDEZCHANGEPATH_STRING_A=NULL;
|
||||
if (!_FUNC_IDEZCHANGEPATH_STRING_A)_FUNC_IDEZCHANGEPATH_STRING_A=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4229=NULL;
|
||||
if (!byte_element_4229){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4229=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4229=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4240=NULL;
|
||||
if (!byte_element_4240){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4240=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4240=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int64 fornext_value4231;
|
||||
int64 fornext_finalvalue4231;
|
||||
int64 fornext_step4231;
|
||||
uint8 fornext_step_negative4231;
|
||||
byte_element_struct *byte_element_4232=NULL;
|
||||
if (!byte_element_4232){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4232=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4232=(byte_element_struct*)mem_static_malloc(12);
|
||||
int64 fornext_value4242;
|
||||
int64 fornext_finalvalue4242;
|
||||
int64 fornext_step4242;
|
||||
uint8 fornext_step_negative4242;
|
||||
byte_element_struct *byte_element_4243=NULL;
|
||||
if (!byte_element_4243){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4243=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4243=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
qbs *_FUNC_IDEZFILELIST_STRING_IDEZFILELIST=NULL;
|
||||
if (!_FUNC_IDEZFILELIST_STRING_IDEZFILELIST)_FUNC_IDEZFILELIST_STRING_IDEZFILELIST=qbs_new(0,0);
|
||||
qbs*oldstr4233=NULL;
|
||||
qbs*oldstr4244=NULL;
|
||||
if(_FUNC_IDEZFILELIST_STRING_PATH->tmp||_FUNC_IDEZFILELIST_STRING_PATH->fixed||_FUNC_IDEZFILELIST_STRING_PATH->readonly){
|
||||
oldstr4233=_FUNC_IDEZFILELIST_STRING_PATH;
|
||||
if (oldstr4233->cmem_descriptor){
|
||||
_FUNC_IDEZFILELIST_STRING_PATH=qbs_new_cmem(oldstr4233->len,0);
|
||||
oldstr4244=_FUNC_IDEZFILELIST_STRING_PATH;
|
||||
if (oldstr4244->cmem_descriptor){
|
||||
_FUNC_IDEZFILELIST_STRING_PATH=qbs_new_cmem(oldstr4244->len,0);
|
||||
}else{
|
||||
_FUNC_IDEZFILELIST_STRING_PATH=qbs_new(oldstr4233->len,0);
|
||||
_FUNC_IDEZFILELIST_STRING_PATH=qbs_new(oldstr4244->len,0);
|
||||
}
|
||||
memcpy(_FUNC_IDEZFILELIST_STRING_PATH->chr,oldstr4233->chr,oldstr4233->len);
|
||||
memcpy(_FUNC_IDEZFILELIST_STRING_PATH->chr,oldstr4244->chr,oldstr4244->len);
|
||||
}
|
||||
qbs *_FUNC_IDEZFILELIST_STRING1_SEP=NULL;
|
||||
if(_FUNC_IDEZFILELIST_STRING1_SEP==NULL){
|
||||
|
@ -19,39 +19,39 @@ qbs *_FUNC_IDEZFILELIST_STRING_FILELIST=NULL;
|
|||
if (!_FUNC_IDEZFILELIST_STRING_FILELIST)_FUNC_IDEZFILELIST_STRING_FILELIST=qbs_new(0,0);
|
||||
qbs *_FUNC_IDEZFILELIST_STRING_A=NULL;
|
||||
if (!_FUNC_IDEZFILELIST_STRING_A)_FUNC_IDEZFILELIST_STRING_A=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4236=NULL;
|
||||
if (!byte_element_4236){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4236=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4236=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4247=NULL;
|
||||
if (!byte_element_4247){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4247=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4247=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_FUNC_IDEZFILELIST_LONG_I=NULL;
|
||||
if(_FUNC_IDEZFILELIST_LONG_I==NULL){
|
||||
_FUNC_IDEZFILELIST_LONG_I=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDEZFILELIST_LONG_I=0;
|
||||
}
|
||||
int64 fornext_value4238;
|
||||
int64 fornext_finalvalue4238;
|
||||
int64 fornext_step4238;
|
||||
uint8 fornext_step_negative4238;
|
||||
byte_element_struct *byte_element_4241=NULL;
|
||||
if (!byte_element_4241){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4241=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4241=(byte_element_struct*)mem_static_malloc(12);
|
||||
int64 fornext_value4249;
|
||||
int64 fornext_finalvalue4249;
|
||||
int64 fornext_step4249;
|
||||
uint8 fornext_step_negative4249;
|
||||
byte_element_struct *byte_element_4252=NULL;
|
||||
if (!byte_element_4252){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4252=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4252=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_FUNC_IDEZFILELIST_LONG_X=NULL;
|
||||
if(_FUNC_IDEZFILELIST_LONG_X==NULL){
|
||||
_FUNC_IDEZFILELIST_LONG_X=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDEZFILELIST_LONG_X=0;
|
||||
}
|
||||
int64 fornext_value4243;
|
||||
int64 fornext_finalvalue4243;
|
||||
int64 fornext_step4243;
|
||||
uint8 fornext_step_negative4243;
|
||||
byte_element_struct *byte_element_4244=NULL;
|
||||
if (!byte_element_4244){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4244=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4244=(byte_element_struct*)mem_static_malloc(12);
|
||||
int64 fornext_value4254;
|
||||
int64 fornext_finalvalue4254;
|
||||
int64 fornext_step4254;
|
||||
uint8 fornext_step_negative4254;
|
||||
byte_element_struct *byte_element_4255=NULL;
|
||||
if (!byte_element_4255){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4255=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4255=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
qbs *_FUNC_IDEZFILELIST_STRING_A2=NULL;
|
||||
if (!_FUNC_IDEZFILELIST_STRING_A2)_FUNC_IDEZFILELIST_STRING_A2=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4245=NULL;
|
||||
if (!byte_element_4245){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4245=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4245=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4256=NULL;
|
||||
if (!byte_element_4256){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4256=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4256=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
qbs *_FUNC_IDEZPATHLIST_STRING_IDEZPATHLIST=NULL;
|
||||
if (!_FUNC_IDEZPATHLIST_STRING_IDEZPATHLIST)_FUNC_IDEZPATHLIST_STRING_IDEZPATHLIST=qbs_new(0,0);
|
||||
qbs*oldstr4248=NULL;
|
||||
qbs*oldstr4259=NULL;
|
||||
if(_FUNC_IDEZPATHLIST_STRING_PATH->tmp||_FUNC_IDEZPATHLIST_STRING_PATH->fixed||_FUNC_IDEZPATHLIST_STRING_PATH->readonly){
|
||||
oldstr4248=_FUNC_IDEZPATHLIST_STRING_PATH;
|
||||
if (oldstr4248->cmem_descriptor){
|
||||
_FUNC_IDEZPATHLIST_STRING_PATH=qbs_new_cmem(oldstr4248->len,0);
|
||||
oldstr4259=_FUNC_IDEZPATHLIST_STRING_PATH;
|
||||
if (oldstr4259->cmem_descriptor){
|
||||
_FUNC_IDEZPATHLIST_STRING_PATH=qbs_new_cmem(oldstr4259->len,0);
|
||||
}else{
|
||||
_FUNC_IDEZPATHLIST_STRING_PATH=qbs_new(oldstr4248->len,0);
|
||||
_FUNC_IDEZPATHLIST_STRING_PATH=qbs_new(oldstr4259->len,0);
|
||||
}
|
||||
memcpy(_FUNC_IDEZPATHLIST_STRING_PATH->chr,oldstr4248->chr,oldstr4248->len);
|
||||
memcpy(_FUNC_IDEZPATHLIST_STRING_PATH->chr,oldstr4259->chr,oldstr4259->len);
|
||||
}
|
||||
qbs *_FUNC_IDEZPATHLIST_STRING1_SEP=NULL;
|
||||
if(_FUNC_IDEZPATHLIST_STRING1_SEP==NULL){
|
||||
|
@ -29,48 +29,48 @@ if(_FUNC_IDEZPATHLIST_LONG_X==NULL){
|
|||
_FUNC_IDEZPATHLIST_LONG_X=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDEZPATHLIST_LONG_X=0;
|
||||
}
|
||||
int64 fornext_value4252;
|
||||
int64 fornext_finalvalue4252;
|
||||
int64 fornext_step4252;
|
||||
uint8 fornext_step_negative4252;
|
||||
byte_element_struct *byte_element_4253=NULL;
|
||||
if (!byte_element_4253){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4253=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4253=(byte_element_struct*)mem_static_malloc(12);
|
||||
int64 fornext_value4263;
|
||||
int64 fornext_finalvalue4263;
|
||||
int64 fornext_step4263;
|
||||
uint8 fornext_step_negative4263;
|
||||
byte_element_struct *byte_element_4264=NULL;
|
||||
if (!byte_element_4264){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4264=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4264=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
qbs *_FUNC_IDEZPATHLIST_STRING_B=NULL;
|
||||
if (!_FUNC_IDEZPATHLIST_STRING_B)_FUNC_IDEZPATHLIST_STRING_B=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4254=NULL;
|
||||
if (!byte_element_4254){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4254=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4254=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4265=NULL;
|
||||
if (!byte_element_4265){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4265=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4265=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_FUNC_IDEZPATHLIST_LONG_I=NULL;
|
||||
if(_FUNC_IDEZPATHLIST_LONG_I==NULL){
|
||||
_FUNC_IDEZPATHLIST_LONG_I=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDEZPATHLIST_LONG_I=0;
|
||||
}
|
||||
int64 fornext_value4256;
|
||||
int64 fornext_finalvalue4256;
|
||||
int64 fornext_step4256;
|
||||
uint8 fornext_step_negative4256;
|
||||
byte_element_struct *byte_element_4257=NULL;
|
||||
if (!byte_element_4257){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4257=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4257=(byte_element_struct*)mem_static_malloc(12);
|
||||
int64 fornext_value4267;
|
||||
int64 fornext_finalvalue4267;
|
||||
int64 fornext_step4267;
|
||||
uint8 fornext_step_negative4267;
|
||||
byte_element_struct *byte_element_4268=NULL;
|
||||
if (!byte_element_4268){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4268=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4268=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4260=NULL;
|
||||
if (!byte_element_4260){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4260=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4260=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4271=NULL;
|
||||
if (!byte_element_4271){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4271=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4271=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int64 fornext_value4262;
|
||||
int64 fornext_finalvalue4262;
|
||||
int64 fornext_step4262;
|
||||
uint8 fornext_step_negative4262;
|
||||
byte_element_struct *byte_element_4263=NULL;
|
||||
if (!byte_element_4263){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4263=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4263=(byte_element_struct*)mem_static_malloc(12);
|
||||
int64 fornext_value4273;
|
||||
int64 fornext_finalvalue4273;
|
||||
int64 fornext_step4273;
|
||||
uint8 fornext_step_negative4273;
|
||||
byte_element_struct *byte_element_4274=NULL;
|
||||
if (!byte_element_4274){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4274=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4274=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
qbs *_FUNC_IDEZPATHLIST_STRING_A2=NULL;
|
||||
if (!_FUNC_IDEZPATHLIST_STRING_A2)_FUNC_IDEZPATHLIST_STRING_A2=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4264=NULL;
|
||||
if (!byte_element_4264){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4264=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4264=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4275=NULL;
|
||||
if (!byte_element_4275){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4275=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4275=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
qbs *_FUNC_IDEZTAKEPATH_STRING_IDEZTAKEPATH=NULL;
|
||||
if (!_FUNC_IDEZTAKEPATH_STRING_IDEZTAKEPATH)_FUNC_IDEZTAKEPATH_STRING_IDEZTAKEPATH=qbs_new(0,0);
|
||||
qbs*oldstr4265=NULL;
|
||||
qbs*oldstr4276=NULL;
|
||||
if(_FUNC_IDEZTAKEPATH_STRING_F->tmp||_FUNC_IDEZTAKEPATH_STRING_F->fixed||_FUNC_IDEZTAKEPATH_STRING_F->readonly){
|
||||
oldstr4265=_FUNC_IDEZTAKEPATH_STRING_F;
|
||||
if (oldstr4265->cmem_descriptor){
|
||||
_FUNC_IDEZTAKEPATH_STRING_F=qbs_new_cmem(oldstr4265->len,0);
|
||||
oldstr4276=_FUNC_IDEZTAKEPATH_STRING_F;
|
||||
if (oldstr4276->cmem_descriptor){
|
||||
_FUNC_IDEZTAKEPATH_STRING_F=qbs_new_cmem(oldstr4276->len,0);
|
||||
}else{
|
||||
_FUNC_IDEZTAKEPATH_STRING_F=qbs_new(oldstr4265->len,0);
|
||||
_FUNC_IDEZTAKEPATH_STRING_F=qbs_new(oldstr4276->len,0);
|
||||
}
|
||||
memcpy(_FUNC_IDEZTAKEPATH_STRING_F->chr,oldstr4265->chr,oldstr4265->len);
|
||||
memcpy(_FUNC_IDEZTAKEPATH_STRING_F->chr,oldstr4276->chr,oldstr4276->len);
|
||||
}
|
||||
qbs *_FUNC_IDEZTAKEPATH_STRING_P=NULL;
|
||||
if (!_FUNC_IDEZTAKEPATH_STRING_P)_FUNC_IDEZTAKEPATH_STRING_P=qbs_new(0,0);
|
||||
|
@ -17,29 +17,29 @@ if(_FUNC_IDEZTAKEPATH_LONG_I==NULL){
|
|||
_FUNC_IDEZTAKEPATH_LONG_I=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDEZTAKEPATH_LONG_I=0;
|
||||
}
|
||||
int64 fornext_value4267;
|
||||
int64 fornext_finalvalue4267;
|
||||
int64 fornext_step4267;
|
||||
uint8 fornext_step_negative4267;
|
||||
byte_element_struct *byte_element_4268=NULL;
|
||||
if (!byte_element_4268){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4268=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4268=(byte_element_struct*)mem_static_malloc(12);
|
||||
int64 fornext_value4278;
|
||||
int64 fornext_finalvalue4278;
|
||||
int64 fornext_step4278;
|
||||
uint8 fornext_step_negative4278;
|
||||
byte_element_struct *byte_element_4279=NULL;
|
||||
if (!byte_element_4279){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4279=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4279=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
qbs *_FUNC_IDEZTAKEPATH_STRING_A=NULL;
|
||||
if (!_FUNC_IDEZTAKEPATH_STRING_A)_FUNC_IDEZTAKEPATH_STRING_A=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4269=NULL;
|
||||
if (!byte_element_4269){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4269=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4269=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4280=NULL;
|
||||
if (!byte_element_4280){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4280=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4280=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int64 fornext_value4271;
|
||||
int64 fornext_finalvalue4271;
|
||||
int64 fornext_step4271;
|
||||
uint8 fornext_step_negative4271;
|
||||
byte_element_struct *byte_element_4272=NULL;
|
||||
if (!byte_element_4272){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4272=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4272=(byte_element_struct*)mem_static_malloc(12);
|
||||
int64 fornext_value4282;
|
||||
int64 fornext_finalvalue4282;
|
||||
int64 fornext_step4282;
|
||||
uint8 fornext_step_negative4282;
|
||||
byte_element_struct *byte_element_4283=NULL;
|
||||
if (!byte_element_4283){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4283=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4283=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4273=NULL;
|
||||
if (!byte_element_4273){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4273=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4273=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4284=NULL;
|
||||
if (!byte_element_4284){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4284=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4284=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
|
|
|
@ -1,34 +1,34 @@
|
|||
qbs *_FUNC_IDEZGETFILEPATH_STRING_IDEZGETFILEPATH=NULL;
|
||||
if (!_FUNC_IDEZGETFILEPATH_STRING_IDEZGETFILEPATH)_FUNC_IDEZGETFILEPATH_STRING_IDEZGETFILEPATH=qbs_new(0,0);
|
||||
qbs*oldstr4274=NULL;
|
||||
qbs*oldstr4285=NULL;
|
||||
if(_FUNC_IDEZGETFILEPATH_STRING_ROOT->tmp||_FUNC_IDEZGETFILEPATH_STRING_ROOT->fixed||_FUNC_IDEZGETFILEPATH_STRING_ROOT->readonly){
|
||||
oldstr4274=_FUNC_IDEZGETFILEPATH_STRING_ROOT;
|
||||
if (oldstr4274->cmem_descriptor){
|
||||
_FUNC_IDEZGETFILEPATH_STRING_ROOT=qbs_new_cmem(oldstr4274->len,0);
|
||||
oldstr4285=_FUNC_IDEZGETFILEPATH_STRING_ROOT;
|
||||
if (oldstr4285->cmem_descriptor){
|
||||
_FUNC_IDEZGETFILEPATH_STRING_ROOT=qbs_new_cmem(oldstr4285->len,0);
|
||||
}else{
|
||||
_FUNC_IDEZGETFILEPATH_STRING_ROOT=qbs_new(oldstr4274->len,0);
|
||||
_FUNC_IDEZGETFILEPATH_STRING_ROOT=qbs_new(oldstr4285->len,0);
|
||||
}
|
||||
memcpy(_FUNC_IDEZGETFILEPATH_STRING_ROOT->chr,oldstr4274->chr,oldstr4274->len);
|
||||
memcpy(_FUNC_IDEZGETFILEPATH_STRING_ROOT->chr,oldstr4285->chr,oldstr4285->len);
|
||||
}
|
||||
qbs*oldstr4275=NULL;
|
||||
qbs*oldstr4286=NULL;
|
||||
if(_FUNC_IDEZGETFILEPATH_STRING_F->tmp||_FUNC_IDEZGETFILEPATH_STRING_F->fixed||_FUNC_IDEZGETFILEPATH_STRING_F->readonly){
|
||||
oldstr4275=_FUNC_IDEZGETFILEPATH_STRING_F;
|
||||
if (oldstr4275->cmem_descriptor){
|
||||
_FUNC_IDEZGETFILEPATH_STRING_F=qbs_new_cmem(oldstr4275->len,0);
|
||||
oldstr4286=_FUNC_IDEZGETFILEPATH_STRING_F;
|
||||
if (oldstr4286->cmem_descriptor){
|
||||
_FUNC_IDEZGETFILEPATH_STRING_F=qbs_new_cmem(oldstr4286->len,0);
|
||||
}else{
|
||||
_FUNC_IDEZGETFILEPATH_STRING_F=qbs_new(oldstr4275->len,0);
|
||||
_FUNC_IDEZGETFILEPATH_STRING_F=qbs_new(oldstr4286->len,0);
|
||||
}
|
||||
memcpy(_FUNC_IDEZGETFILEPATH_STRING_F->chr,oldstr4275->chr,oldstr4275->len);
|
||||
memcpy(_FUNC_IDEZGETFILEPATH_STRING_F->chr,oldstr4286->chr,oldstr4286->len);
|
||||
}
|
||||
qbs *_FUNC_IDEZGETFILEPATH_STRING_P=NULL;
|
||||
if (!_FUNC_IDEZGETFILEPATH_STRING_P)_FUNC_IDEZGETFILEPATH_STRING_P=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4276=NULL;
|
||||
if (!byte_element_4276){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4276=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4276=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4287=NULL;
|
||||
if (!byte_element_4287){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4287=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4287=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
qbs *_FUNC_IDEZGETFILEPATH_STRING_P2=NULL;
|
||||
if (!_FUNC_IDEZGETFILEPATH_STRING_P2)_FUNC_IDEZGETFILEPATH_STRING_P2=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4278=NULL;
|
||||
if (!byte_element_4278){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4278=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4278=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4289=NULL;
|
||||
if (!byte_element_4289){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4289=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4289=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
|
|
|
@ -46,13 +46,13 @@ _FUNC_IDESEARCHEDBOX_LONG_FH=(int32*)mem_static_malloc(4);
|
|||
}
|
||||
qbs *_FUNC_IDESEARCHEDBOX_STRING_A=NULL;
|
||||
if (!_FUNC_IDESEARCHEDBOX_STRING_A)_FUNC_IDESEARCHEDBOX_STRING_A=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_2021=NULL;
|
||||
if (!byte_element_2021){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_2021=(byte_element_struct*)(mem_static_pointer-12); else byte_element_2021=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_2025=NULL;
|
||||
if (!byte_element_2025){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_2025=(byte_element_struct*)(mem_static_pointer-12); else byte_element_2025=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_2022=NULL;
|
||||
if (!byte_element_2022){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_2022=(byte_element_struct*)(mem_static_pointer-12); else byte_element_2022=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_2026=NULL;
|
||||
if (!byte_element_2026){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_2026=(byte_element_struct*)(mem_static_pointer-12); else byte_element_2026=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_FUNC_IDESEARCHEDBOX_LONG_AI=NULL;
|
||||
if(_FUNC_IDESEARCHEDBOX_LONG_AI==NULL){
|
||||
|
@ -61,17 +61,17 @@ _FUNC_IDESEARCHEDBOX_LONG_AI=(int32*)mem_static_malloc(4);
|
|||
}
|
||||
qbs *_FUNC_IDESEARCHEDBOX_STRING_F=NULL;
|
||||
if (!_FUNC_IDESEARCHEDBOX_STRING_F)_FUNC_IDESEARCHEDBOX_STRING_F=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_2024=NULL;
|
||||
if (!byte_element_2024){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_2024=(byte_element_struct*)(mem_static_pointer-12); else byte_element_2024=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_2028=NULL;
|
||||
if (!byte_element_2028){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_2028=(byte_element_struct*)(mem_static_pointer-12); else byte_element_2028=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_2025=NULL;
|
||||
if (!byte_element_2025){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_2025=(byte_element_struct*)(mem_static_pointer-12); else byte_element_2025=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_2029=NULL;
|
||||
if (!byte_element_2029){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_2029=(byte_element_struct*)(mem_static_pointer-12); else byte_element_2029=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_2026=NULL;
|
||||
if (!byte_element_2026){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_2026=(byte_element_struct*)(mem_static_pointer-12); else byte_element_2026=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_2030=NULL;
|
||||
if (!byte_element_2030){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_2030=(byte_element_struct*)(mem_static_pointer-12); else byte_element_2030=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_FUNC_IDESEARCHEDBOX_LONG_H=NULL;
|
||||
if(_FUNC_IDESEARCHEDBOX_LONG_H==NULL){
|
||||
|
@ -83,11 +83,11 @@ if(_FUNC_IDESEARCHEDBOX_LONG_I==NULL){
|
|||
_FUNC_IDESEARCHEDBOX_LONG_I=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDESEARCHEDBOX_LONG_I=0;
|
||||
}
|
||||
int32 pass2027;
|
||||
int64 fornext_value2029;
|
||||
int64 fornext_finalvalue2029;
|
||||
int64 fornext_step2029;
|
||||
uint8 fornext_step_negative2029;
|
||||
int32 pass2031;
|
||||
int64 fornext_value2033;
|
||||
int64 fornext_finalvalue2033;
|
||||
int64 fornext_step2033;
|
||||
uint8 fornext_step_negative2033;
|
||||
int32 *_FUNC_IDESEARCHEDBOX_LONG_F=NULL;
|
||||
if(_FUNC_IDESEARCHEDBOX_LONG_F==NULL){
|
||||
_FUNC_IDESEARCHEDBOX_LONG_F=(int32*)mem_static_malloc(4);
|
||||
|
@ -103,10 +103,10 @@ if(_FUNC_IDESEARCHEDBOX_LONG_CY==NULL){
|
|||
_FUNC_IDESEARCHEDBOX_LONG_CY=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDESEARCHEDBOX_LONG_CY=0;
|
||||
}
|
||||
int64 fornext_value2032;
|
||||
int64 fornext_finalvalue2032;
|
||||
int64 fornext_step2032;
|
||||
uint8 fornext_step_negative2032;
|
||||
int64 fornext_value2036;
|
||||
int64 fornext_finalvalue2036;
|
||||
int64 fornext_step2036;
|
||||
uint8 fornext_step_negative2036;
|
||||
int32 *_FUNC_IDESEARCHEDBOX_LONG_LASTFOCUS=NULL;
|
||||
if(_FUNC_IDESEARCHEDBOX_LONG_LASTFOCUS==NULL){
|
||||
_FUNC_IDESEARCHEDBOX_LONG_LASTFOCUS=(int32*)mem_static_malloc(4);
|
||||
|
@ -139,9 +139,9 @@ _FUNC_IDESEARCHEDBOX_LONG_OLDALT=(int32*)mem_static_malloc(4);
|
|||
}
|
||||
qbs *_FUNC_IDESEARCHEDBOX_STRING_ALTLETTER=NULL;
|
||||
if (!_FUNC_IDESEARCHEDBOX_STRING_ALTLETTER)_FUNC_IDESEARCHEDBOX_STRING_ALTLETTER=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_2034=NULL;
|
||||
if (!byte_element_2034){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_2034=(byte_element_struct*)(mem_static_pointer-12); else byte_element_2034=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_2038=NULL;
|
||||
if (!byte_element_2038){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_2038=(byte_element_struct*)(mem_static_pointer-12); else byte_element_2038=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_FUNC_IDESEARCHEDBOX_LONG_K=NULL;
|
||||
if(_FUNC_IDESEARCHEDBOX_LONG_K==NULL){
|
||||
|
@ -153,10 +153,10 @@ if(_FUNC_IDESEARCHEDBOX_LONG_INFO==NULL){
|
|||
_FUNC_IDESEARCHEDBOX_LONG_INFO=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDESEARCHEDBOX_LONG_INFO=0;
|
||||
}
|
||||
int64 fornext_value2036;
|
||||
int64 fornext_finalvalue2036;
|
||||
int64 fornext_step2036;
|
||||
uint8 fornext_step_negative2036;
|
||||
int64 fornext_value2040;
|
||||
int64 fornext_finalvalue2040;
|
||||
int64 fornext_step2040;
|
||||
uint8 fornext_step_negative2040;
|
||||
int32 *_FUNC_IDESEARCHEDBOX_LONG_T=NULL;
|
||||
if(_FUNC_IDESEARCHEDBOX_LONG_T==NULL){
|
||||
_FUNC_IDESEARCHEDBOX_LONG_T=(int32*)mem_static_malloc(4);
|
||||
|
|
|
@ -40,18 +40,18 @@ if(_FUNC_IDELAYOUTBOX_LONG_I==NULL){
|
|||
_FUNC_IDELAYOUTBOX_LONG_I=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDELAYOUTBOX_LONG_I=0;
|
||||
}
|
||||
int32 pass4280;
|
||||
int32 pass4281;
|
||||
int32 pass4291;
|
||||
int32 pass4292;
|
||||
qbs *_FUNC_IDELAYOUTBOX_STRING_A2=NULL;
|
||||
if (!_FUNC_IDELAYOUTBOX_STRING_A2)_FUNC_IDELAYOUTBOX_STRING_A2=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4282=NULL;
|
||||
if (!byte_element_4282){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4282=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4282=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4293=NULL;
|
||||
if (!byte_element_4293){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4293=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4293=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int64 fornext_value4284;
|
||||
int64 fornext_finalvalue4284;
|
||||
int64 fornext_step4284;
|
||||
uint8 fornext_step_negative4284;
|
||||
int64 fornext_value4295;
|
||||
int64 fornext_finalvalue4295;
|
||||
int64 fornext_step4295;
|
||||
uint8 fornext_step_negative4295;
|
||||
int32 *_FUNC_IDELAYOUTBOX_LONG_F=NULL;
|
||||
if(_FUNC_IDELAYOUTBOX_LONG_F==NULL){
|
||||
_FUNC_IDELAYOUTBOX_LONG_F=(int32*)mem_static_malloc(4);
|
||||
|
@ -67,10 +67,10 @@ if(_FUNC_IDELAYOUTBOX_LONG_CY==NULL){
|
|||
_FUNC_IDELAYOUTBOX_LONG_CY=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDELAYOUTBOX_LONG_CY=0;
|
||||
}
|
||||
int64 fornext_value4287;
|
||||
int64 fornext_finalvalue4287;
|
||||
int64 fornext_step4287;
|
||||
uint8 fornext_step_negative4287;
|
||||
int64 fornext_value4298;
|
||||
int64 fornext_finalvalue4298;
|
||||
int64 fornext_step4298;
|
||||
uint8 fornext_step_negative4298;
|
||||
int32 *_FUNC_IDELAYOUTBOX_LONG_LASTFOCUS=NULL;
|
||||
if(_FUNC_IDELAYOUTBOX_LONG_LASTFOCUS==NULL){
|
||||
_FUNC_IDELAYOUTBOX_LONG_LASTFOCUS=(int32*)mem_static_malloc(4);
|
||||
|
@ -103,9 +103,9 @@ _FUNC_IDELAYOUTBOX_LONG_OLDALT=(int32*)mem_static_malloc(4);
|
|||
}
|
||||
qbs *_FUNC_IDELAYOUTBOX_STRING_ALTLETTER=NULL;
|
||||
if (!_FUNC_IDELAYOUTBOX_STRING_ALTLETTER)_FUNC_IDELAYOUTBOX_STRING_ALTLETTER=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4289=NULL;
|
||||
if (!byte_element_4289){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4289=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4289=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4300=NULL;
|
||||
if (!byte_element_4300){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4300=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4300=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_FUNC_IDELAYOUTBOX_LONG_K=NULL;
|
||||
if(_FUNC_IDELAYOUTBOX_LONG_K==NULL){
|
||||
|
@ -117,10 +117,10 @@ if(_FUNC_IDELAYOUTBOX_LONG_INFO==NULL){
|
|||
_FUNC_IDELAYOUTBOX_LONG_INFO=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDELAYOUTBOX_LONG_INFO=0;
|
||||
}
|
||||
int64 fornext_value4291;
|
||||
int64 fornext_finalvalue4291;
|
||||
int64 fornext_step4291;
|
||||
uint8 fornext_step_negative4291;
|
||||
int64 fornext_value4302;
|
||||
int64 fornext_finalvalue4302;
|
||||
int64 fornext_step4302;
|
||||
uint8 fornext_step_negative4302;
|
||||
int32 *_FUNC_IDELAYOUTBOX_LONG_T=NULL;
|
||||
if(_FUNC_IDELAYOUTBOX_LONG_T==NULL){
|
||||
_FUNC_IDELAYOUTBOX_LONG_T=(int32*)mem_static_malloc(4);
|
||||
|
@ -133,43 +133,43 @@ _FUNC_IDELAYOUTBOX_LONG_FOCUSOFFSET=(int32*)mem_static_malloc(4);
|
|||
}
|
||||
qbs *_FUNC_IDELAYOUTBOX_STRING_A=NULL;
|
||||
if (!_FUNC_IDELAYOUTBOX_STRING_A)_FUNC_IDELAYOUTBOX_STRING_A=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4292=NULL;
|
||||
if (!byte_element_4292){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4292=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4292=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4303=NULL;
|
||||
if (!byte_element_4303){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4303=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4303=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int64 fornext_value4294;
|
||||
int64 fornext_finalvalue4294;
|
||||
int64 fornext_step4294;
|
||||
uint8 fornext_step_negative4294;
|
||||
byte_element_struct *byte_element_4295=NULL;
|
||||
if (!byte_element_4295){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4295=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4295=(byte_element_struct*)mem_static_malloc(12);
|
||||
int64 fornext_value4305;
|
||||
int64 fornext_finalvalue4305;
|
||||
int64 fornext_step4305;
|
||||
uint8 fornext_step_negative4305;
|
||||
byte_element_struct *byte_element_4306=NULL;
|
||||
if (!byte_element_4306){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4306=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4306=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_FUNC_IDELAYOUTBOX_LONG_A=NULL;
|
||||
if(_FUNC_IDELAYOUTBOX_LONG_A==NULL){
|
||||
_FUNC_IDELAYOUTBOX_LONG_A=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDELAYOUTBOX_LONG_A=0;
|
||||
}
|
||||
byte_element_struct *byte_element_4296=NULL;
|
||||
if (!byte_element_4296){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4296=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4296=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4307=NULL;
|
||||
if (!byte_element_4307){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4307=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4307=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int16 *_FUNC_IDELAYOUTBOX_INTEGER_V=NULL;
|
||||
if(_FUNC_IDELAYOUTBOX_INTEGER_V==NULL){
|
||||
_FUNC_IDELAYOUTBOX_INTEGER_V=(int16*)mem_static_malloc(2);
|
||||
*_FUNC_IDELAYOUTBOX_INTEGER_V=0;
|
||||
}
|
||||
byte_element_struct *byte_element_4297=NULL;
|
||||
if (!byte_element_4297){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4297=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4297=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4308=NULL;
|
||||
if (!byte_element_4308){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4308=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4308=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4298=NULL;
|
||||
if (!byte_element_4298){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4298=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4298=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4309=NULL;
|
||||
if (!byte_element_4309){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4309=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4309=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
qbs *_FUNC_IDELAYOUTBOX_STRING_V=NULL;
|
||||
if (!_FUNC_IDELAYOUTBOX_STRING_V)_FUNC_IDELAYOUTBOX_STRING_V=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4299=NULL;
|
||||
if (!byte_element_4299){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4299=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4299=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4310=NULL;
|
||||
if (!byte_element_4310){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4310=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4310=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
|
|
|
@ -40,18 +40,18 @@ if(_FUNC_IDEBACKUPBOX_LONG_I==NULL){
|
|||
_FUNC_IDEBACKUPBOX_LONG_I=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDEBACKUPBOX_LONG_I=0;
|
||||
}
|
||||
int32 pass4300;
|
||||
int32 pass4301;
|
||||
int32 pass4311;
|
||||
int32 pass4312;
|
||||
qbs *_FUNC_IDEBACKUPBOX_STRING_A2=NULL;
|
||||
if (!_FUNC_IDEBACKUPBOX_STRING_A2)_FUNC_IDEBACKUPBOX_STRING_A2=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4302=NULL;
|
||||
if (!byte_element_4302){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4302=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4302=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4313=NULL;
|
||||
if (!byte_element_4313){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4313=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4313=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int64 fornext_value4304;
|
||||
int64 fornext_finalvalue4304;
|
||||
int64 fornext_step4304;
|
||||
uint8 fornext_step_negative4304;
|
||||
int64 fornext_value4315;
|
||||
int64 fornext_finalvalue4315;
|
||||
int64 fornext_step4315;
|
||||
uint8 fornext_step_negative4315;
|
||||
int32 *_FUNC_IDEBACKUPBOX_LONG_F=NULL;
|
||||
if(_FUNC_IDEBACKUPBOX_LONG_F==NULL){
|
||||
_FUNC_IDEBACKUPBOX_LONG_F=(int32*)mem_static_malloc(4);
|
||||
|
@ -67,10 +67,10 @@ if(_FUNC_IDEBACKUPBOX_LONG_CY==NULL){
|
|||
_FUNC_IDEBACKUPBOX_LONG_CY=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDEBACKUPBOX_LONG_CY=0;
|
||||
}
|
||||
int64 fornext_value4307;
|
||||
int64 fornext_finalvalue4307;
|
||||
int64 fornext_step4307;
|
||||
uint8 fornext_step_negative4307;
|
||||
int64 fornext_value4318;
|
||||
int64 fornext_finalvalue4318;
|
||||
int64 fornext_step4318;
|
||||
uint8 fornext_step_negative4318;
|
||||
int32 *_FUNC_IDEBACKUPBOX_LONG_LASTFOCUS=NULL;
|
||||
if(_FUNC_IDEBACKUPBOX_LONG_LASTFOCUS==NULL){
|
||||
_FUNC_IDEBACKUPBOX_LONG_LASTFOCUS=(int32*)mem_static_malloc(4);
|
||||
|
@ -103,9 +103,9 @@ _FUNC_IDEBACKUPBOX_LONG_OLDALT=(int32*)mem_static_malloc(4);
|
|||
}
|
||||
qbs *_FUNC_IDEBACKUPBOX_STRING_ALTLETTER=NULL;
|
||||
if (!_FUNC_IDEBACKUPBOX_STRING_ALTLETTER)_FUNC_IDEBACKUPBOX_STRING_ALTLETTER=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4309=NULL;
|
||||
if (!byte_element_4309){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4309=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4309=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4320=NULL;
|
||||
if (!byte_element_4320){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4320=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4320=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_FUNC_IDEBACKUPBOX_LONG_K=NULL;
|
||||
if(_FUNC_IDEBACKUPBOX_LONG_K==NULL){
|
||||
|
@ -117,10 +117,10 @@ if(_FUNC_IDEBACKUPBOX_LONG_INFO==NULL){
|
|||
_FUNC_IDEBACKUPBOX_LONG_INFO=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDEBACKUPBOX_LONG_INFO=0;
|
||||
}
|
||||
int64 fornext_value4311;
|
||||
int64 fornext_finalvalue4311;
|
||||
int64 fornext_step4311;
|
||||
uint8 fornext_step_negative4311;
|
||||
int64 fornext_value4322;
|
||||
int64 fornext_finalvalue4322;
|
||||
int64 fornext_step4322;
|
||||
uint8 fornext_step_negative4322;
|
||||
int32 *_FUNC_IDEBACKUPBOX_LONG_T=NULL;
|
||||
if(_FUNC_IDEBACKUPBOX_LONG_T==NULL){
|
||||
_FUNC_IDEBACKUPBOX_LONG_T=(int32*)mem_static_malloc(4);
|
||||
|
@ -133,17 +133,17 @@ _FUNC_IDEBACKUPBOX_LONG_FOCUSOFFSET=(int32*)mem_static_malloc(4);
|
|||
}
|
||||
qbs *_FUNC_IDEBACKUPBOX_STRING_A=NULL;
|
||||
if (!_FUNC_IDEBACKUPBOX_STRING_A)_FUNC_IDEBACKUPBOX_STRING_A=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4312=NULL;
|
||||
if (!byte_element_4312){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4312=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4312=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4323=NULL;
|
||||
if (!byte_element_4323){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4323=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4323=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int64 fornext_value4314;
|
||||
int64 fornext_finalvalue4314;
|
||||
int64 fornext_step4314;
|
||||
uint8 fornext_step_negative4314;
|
||||
byte_element_struct *byte_element_4315=NULL;
|
||||
if (!byte_element_4315){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4315=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4315=(byte_element_struct*)mem_static_malloc(12);
|
||||
int64 fornext_value4325;
|
||||
int64 fornext_finalvalue4325;
|
||||
int64 fornext_step4325;
|
||||
uint8 fornext_step_negative4325;
|
||||
byte_element_struct *byte_element_4326=NULL;
|
||||
if (!byte_element_4326){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4326=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4326=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_FUNC_IDEBACKUPBOX_LONG_A=NULL;
|
||||
if(_FUNC_IDEBACKUPBOX_LONG_A==NULL){
|
||||
|
@ -157,7 +157,7 @@ if(_FUNC_IDEBACKUPBOX_LONG_V==NULL){
|
|||
_FUNC_IDEBACKUPBOX_LONG_V=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDEBACKUPBOX_LONG_V=0;
|
||||
}
|
||||
byte_element_struct *byte_element_4316=NULL;
|
||||
if (!byte_element_4316){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4316=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4316=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4327=NULL;
|
||||
if (!byte_element_4327){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4327=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4327=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
|
|
|
@ -40,18 +40,18 @@ if(_FUNC_IDEGOTOBOX_LONG_I==NULL){
|
|||
_FUNC_IDEGOTOBOX_LONG_I=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDEGOTOBOX_LONG_I=0;
|
||||
}
|
||||
int32 pass4317;
|
||||
int32 pass4318;
|
||||
int32 pass4328;
|
||||
int32 pass4329;
|
||||
qbs *_FUNC_IDEGOTOBOX_STRING_A2=NULL;
|
||||
if (!_FUNC_IDEGOTOBOX_STRING_A2)_FUNC_IDEGOTOBOX_STRING_A2=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4319=NULL;
|
||||
if (!byte_element_4319){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4319=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4319=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4330=NULL;
|
||||
if (!byte_element_4330){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4330=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4330=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int64 fornext_value4321;
|
||||
int64 fornext_finalvalue4321;
|
||||
int64 fornext_step4321;
|
||||
uint8 fornext_step_negative4321;
|
||||
int64 fornext_value4332;
|
||||
int64 fornext_finalvalue4332;
|
||||
int64 fornext_step4332;
|
||||
uint8 fornext_step_negative4332;
|
||||
int32 *_FUNC_IDEGOTOBOX_LONG_F=NULL;
|
||||
if(_FUNC_IDEGOTOBOX_LONG_F==NULL){
|
||||
_FUNC_IDEGOTOBOX_LONG_F=(int32*)mem_static_malloc(4);
|
||||
|
@ -67,10 +67,10 @@ if(_FUNC_IDEGOTOBOX_LONG_CY==NULL){
|
|||
_FUNC_IDEGOTOBOX_LONG_CY=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDEGOTOBOX_LONG_CY=0;
|
||||
}
|
||||
int64 fornext_value4324;
|
||||
int64 fornext_finalvalue4324;
|
||||
int64 fornext_step4324;
|
||||
uint8 fornext_step_negative4324;
|
||||
int64 fornext_value4335;
|
||||
int64 fornext_finalvalue4335;
|
||||
int64 fornext_step4335;
|
||||
uint8 fornext_step_negative4335;
|
||||
int32 *_FUNC_IDEGOTOBOX_LONG_LASTFOCUS=NULL;
|
||||
if(_FUNC_IDEGOTOBOX_LONG_LASTFOCUS==NULL){
|
||||
_FUNC_IDEGOTOBOX_LONG_LASTFOCUS=(int32*)mem_static_malloc(4);
|
||||
|
@ -103,9 +103,9 @@ _FUNC_IDEGOTOBOX_LONG_OLDALT=(int32*)mem_static_malloc(4);
|
|||
}
|
||||
qbs *_FUNC_IDEGOTOBOX_STRING_ALTLETTER=NULL;
|
||||
if (!_FUNC_IDEGOTOBOX_STRING_ALTLETTER)_FUNC_IDEGOTOBOX_STRING_ALTLETTER=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4326=NULL;
|
||||
if (!byte_element_4326){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4326=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4326=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4337=NULL;
|
||||
if (!byte_element_4337){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4337=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4337=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_FUNC_IDEGOTOBOX_LONG_K=NULL;
|
||||
if(_FUNC_IDEGOTOBOX_LONG_K==NULL){
|
||||
|
@ -117,10 +117,10 @@ if(_FUNC_IDEGOTOBOX_LONG_INFO==NULL){
|
|||
_FUNC_IDEGOTOBOX_LONG_INFO=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDEGOTOBOX_LONG_INFO=0;
|
||||
}
|
||||
int64 fornext_value4328;
|
||||
int64 fornext_finalvalue4328;
|
||||
int64 fornext_step4328;
|
||||
uint8 fornext_step_negative4328;
|
||||
int64 fornext_value4339;
|
||||
int64 fornext_finalvalue4339;
|
||||
int64 fornext_step4339;
|
||||
uint8 fornext_step_negative4339;
|
||||
int32 *_FUNC_IDEGOTOBOX_LONG_T=NULL;
|
||||
if(_FUNC_IDEGOTOBOX_LONG_T==NULL){
|
||||
_FUNC_IDEGOTOBOX_LONG_T=(int32*)mem_static_malloc(4);
|
||||
|
@ -133,17 +133,17 @@ _FUNC_IDEGOTOBOX_LONG_FOCUSOFFSET=(int32*)mem_static_malloc(4);
|
|||
}
|
||||
qbs *_FUNC_IDEGOTOBOX_STRING_A=NULL;
|
||||
if (!_FUNC_IDEGOTOBOX_STRING_A)_FUNC_IDEGOTOBOX_STRING_A=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4329=NULL;
|
||||
if (!byte_element_4329){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4329=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4329=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4340=NULL;
|
||||
if (!byte_element_4340){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4340=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4340=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int64 fornext_value4331;
|
||||
int64 fornext_finalvalue4331;
|
||||
int64 fornext_step4331;
|
||||
uint8 fornext_step_negative4331;
|
||||
byte_element_struct *byte_element_4332=NULL;
|
||||
if (!byte_element_4332){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4332=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4332=(byte_element_struct*)mem_static_malloc(12);
|
||||
int64 fornext_value4342;
|
||||
int64 fornext_finalvalue4342;
|
||||
int64 fornext_step4342;
|
||||
uint8 fornext_step_negative4342;
|
||||
byte_element_struct *byte_element_4343=NULL;
|
||||
if (!byte_element_4343){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4343=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4343=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_FUNC_IDEGOTOBOX_LONG_A=NULL;
|
||||
if(_FUNC_IDEGOTOBOX_LONG_A==NULL){
|
||||
|
|
|
@ -57,11 +57,11 @@ if(_FUNC_IDEADVANCEDBOX_LONG_Y==NULL){
|
|||
_FUNC_IDEADVANCEDBOX_LONG_Y=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDEADVANCEDBOX_LONG_Y=0;
|
||||
}
|
||||
int32 pass4333;
|
||||
int64 fornext_value4335;
|
||||
int64 fornext_finalvalue4335;
|
||||
int64 fornext_step4335;
|
||||
uint8 fornext_step_negative4335;
|
||||
int32 pass4344;
|
||||
int64 fornext_value4346;
|
||||
int64 fornext_finalvalue4346;
|
||||
int64 fornext_step4346;
|
||||
uint8 fornext_step_negative4346;
|
||||
int32 *_FUNC_IDEADVANCEDBOX_LONG_F=NULL;
|
||||
if(_FUNC_IDEADVANCEDBOX_LONG_F==NULL){
|
||||
_FUNC_IDEADVANCEDBOX_LONG_F=(int32*)mem_static_malloc(4);
|
||||
|
@ -77,22 +77,22 @@ if(_FUNC_IDEADVANCEDBOX_LONG_CY==NULL){
|
|||
_FUNC_IDEADVANCEDBOX_LONG_CY=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDEADVANCEDBOX_LONG_CY=0;
|
||||
}
|
||||
int64 fornext_value4338;
|
||||
int64 fornext_finalvalue4338;
|
||||
int64 fornext_step4338;
|
||||
uint8 fornext_step_negative4338;
|
||||
int64 fornext_value4349;
|
||||
int64 fornext_finalvalue4349;
|
||||
int64 fornext_step4349;
|
||||
uint8 fornext_step_negative4349;
|
||||
int32 *_FUNC_IDEADVANCEDBOX_LONG_LASTFOCUS=NULL;
|
||||
if(_FUNC_IDEADVANCEDBOX_LONG_LASTFOCUS==NULL){
|
||||
_FUNC_IDEADVANCEDBOX_LONG_LASTFOCUS=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDEADVANCEDBOX_LONG_LASTFOCUS=0;
|
||||
}
|
||||
int64 fornext_value4340;
|
||||
int64 fornext_finalvalue4340;
|
||||
int64 fornext_step4340;
|
||||
uint8 fornext_step_negative4340;
|
||||
byte_element_struct *byte_element_4341=NULL;
|
||||
if (!byte_element_4341){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4341=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4341=(byte_element_struct*)mem_static_malloc(12);
|
||||
int64 fornext_value4351;
|
||||
int64 fornext_finalvalue4351;
|
||||
int64 fornext_step4351;
|
||||
uint8 fornext_step_negative4351;
|
||||
byte_element_struct *byte_element_4352=NULL;
|
||||
if (!byte_element_4352){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4352=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4352=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_FUNC_IDEADVANCEDBOX_LONG_CHANGE=NULL;
|
||||
if(_FUNC_IDEADVANCEDBOX_LONG_CHANGE==NULL){
|
||||
|
@ -121,9 +121,9 @@ _FUNC_IDEADVANCEDBOX_LONG_OLDALT=(int32*)mem_static_malloc(4);
|
|||
}
|
||||
qbs *_FUNC_IDEADVANCEDBOX_STRING_ALTLETTER=NULL;
|
||||
if (!_FUNC_IDEADVANCEDBOX_STRING_ALTLETTER)_FUNC_IDEADVANCEDBOX_STRING_ALTLETTER=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4344=NULL;
|
||||
if (!byte_element_4344){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4344=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4344=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4355=NULL;
|
||||
if (!byte_element_4355){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4355=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4355=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_FUNC_IDEADVANCEDBOX_LONG_K=NULL;
|
||||
if(_FUNC_IDEADVANCEDBOX_LONG_K==NULL){
|
||||
|
@ -135,10 +135,10 @@ if(_FUNC_IDEADVANCEDBOX_LONG_INFO==NULL){
|
|||
_FUNC_IDEADVANCEDBOX_LONG_INFO=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDEADVANCEDBOX_LONG_INFO=0;
|
||||
}
|
||||
int64 fornext_value4346;
|
||||
int64 fornext_finalvalue4346;
|
||||
int64 fornext_step4346;
|
||||
uint8 fornext_step_negative4346;
|
||||
int64 fornext_value4357;
|
||||
int64 fornext_finalvalue4357;
|
||||
int64 fornext_step4357;
|
||||
uint8 fornext_step_negative4357;
|
||||
int32 *_FUNC_IDEADVANCEDBOX_LONG_T=NULL;
|
||||
if(_FUNC_IDEADVANCEDBOX_LONG_T==NULL){
|
||||
_FUNC_IDEADVANCEDBOX_LONG_T=(int32*)mem_static_malloc(4);
|
||||
|
@ -154,7 +154,7 @@ if(_FUNC_IDEADVANCEDBOX_INTEGER_V==NULL){
|
|||
_FUNC_IDEADVANCEDBOX_INTEGER_V=(int16*)mem_static_malloc(2);
|
||||
*_FUNC_IDEADVANCEDBOX_INTEGER_V=0;
|
||||
}
|
||||
byte_element_struct *byte_element_4347=NULL;
|
||||
if (!byte_element_4347){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4347=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4347=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4358=NULL;
|
||||
if (!byte_element_4358){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4358=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4358=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
|
|
|
@ -40,12 +40,12 @@ if(_FUNC_IDEUPDATEBOX_LONG_I==NULL){
|
|||
_FUNC_IDEUPDATEBOX_LONG_I=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDEUPDATEBOX_LONG_I=0;
|
||||
}
|
||||
int32 pass4348;
|
||||
int32 pass4349;
|
||||
int64 fornext_value4351;
|
||||
int64 fornext_finalvalue4351;
|
||||
int64 fornext_step4351;
|
||||
uint8 fornext_step_negative4351;
|
||||
int32 pass4359;
|
||||
int32 pass4360;
|
||||
int64 fornext_value4362;
|
||||
int64 fornext_finalvalue4362;
|
||||
int64 fornext_step4362;
|
||||
uint8 fornext_step_negative4362;
|
||||
int32 *_FUNC_IDEUPDATEBOX_LONG_F=NULL;
|
||||
if(_FUNC_IDEUPDATEBOX_LONG_F==NULL){
|
||||
_FUNC_IDEUPDATEBOX_LONG_F=(int32*)mem_static_malloc(4);
|
||||
|
@ -61,10 +61,10 @@ if(_FUNC_IDEUPDATEBOX_LONG_CY==NULL){
|
|||
_FUNC_IDEUPDATEBOX_LONG_CY=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDEUPDATEBOX_LONG_CY=0;
|
||||
}
|
||||
int64 fornext_value4354;
|
||||
int64 fornext_finalvalue4354;
|
||||
int64 fornext_step4354;
|
||||
uint8 fornext_step_negative4354;
|
||||
int64 fornext_value4365;
|
||||
int64 fornext_finalvalue4365;
|
||||
int64 fornext_step4365;
|
||||
uint8 fornext_step_negative4365;
|
||||
int32 *_FUNC_IDEUPDATEBOX_LONG_LASTFOCUS=NULL;
|
||||
if(_FUNC_IDEUPDATEBOX_LONG_LASTFOCUS==NULL){
|
||||
_FUNC_IDEUPDATEBOX_LONG_LASTFOCUS=(int32*)mem_static_malloc(4);
|
||||
|
@ -97,9 +97,9 @@ _FUNC_IDEUPDATEBOX_LONG_OLDALT=(int32*)mem_static_malloc(4);
|
|||
}
|
||||
qbs *_FUNC_IDEUPDATEBOX_STRING_ALTLETTER=NULL;
|
||||
if (!_FUNC_IDEUPDATEBOX_STRING_ALTLETTER)_FUNC_IDEUPDATEBOX_STRING_ALTLETTER=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4356=NULL;
|
||||
if (!byte_element_4356){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4356=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4356=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4367=NULL;
|
||||
if (!byte_element_4367){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4367=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4367=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_FUNC_IDEUPDATEBOX_LONG_K=NULL;
|
||||
if(_FUNC_IDEUPDATEBOX_LONG_K==NULL){
|
||||
|
@ -111,10 +111,10 @@ if(_FUNC_IDEUPDATEBOX_LONG_INFO==NULL){
|
|||
_FUNC_IDEUPDATEBOX_LONG_INFO=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDEUPDATEBOX_LONG_INFO=0;
|
||||
}
|
||||
int64 fornext_value4358;
|
||||
int64 fornext_finalvalue4358;
|
||||
int64 fornext_step4358;
|
||||
uint8 fornext_step_negative4358;
|
||||
int64 fornext_value4369;
|
||||
int64 fornext_finalvalue4369;
|
||||
int64 fornext_step4369;
|
||||
uint8 fornext_step_negative4369;
|
||||
int32 *_FUNC_IDEUPDATEBOX_LONG_T=NULL;
|
||||
if(_FUNC_IDEUPDATEBOX_LONG_T==NULL){
|
||||
_FUNC_IDEUPDATEBOX_LONG_T=(int32*)mem_static_malloc(4);
|
||||
|
@ -130,15 +130,15 @@ if(_FUNC_IDEUPDATEBOX_INTEGER_V==NULL){
|
|||
_FUNC_IDEUPDATEBOX_INTEGER_V=(int16*)mem_static_malloc(2);
|
||||
*_FUNC_IDEUPDATEBOX_INTEGER_V=0;
|
||||
}
|
||||
byte_element_struct *byte_element_4359=NULL;
|
||||
if (!byte_element_4359){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4359=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4359=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4370=NULL;
|
||||
if (!byte_element_4370){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4370=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4370=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4360=NULL;
|
||||
if (!byte_element_4360){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4360=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4360=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4371=NULL;
|
||||
if (!byte_element_4371){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4371=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4371=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4361=NULL;
|
||||
if (!byte_element_4361){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4361=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4361=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4372=NULL;
|
||||
if (!byte_element_4372){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4372=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4372=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
qbs*oldstr4362=NULL;
|
||||
qbs*oldstr4373=NULL;
|
||||
if(_SUB_IDEMESSAGEBOX_STRING_TITLESTR->tmp||_SUB_IDEMESSAGEBOX_STRING_TITLESTR->fixed||_SUB_IDEMESSAGEBOX_STRING_TITLESTR->readonly){
|
||||
oldstr4362=_SUB_IDEMESSAGEBOX_STRING_TITLESTR;
|
||||
if (oldstr4362->cmem_descriptor){
|
||||
_SUB_IDEMESSAGEBOX_STRING_TITLESTR=qbs_new_cmem(oldstr4362->len,0);
|
||||
oldstr4373=_SUB_IDEMESSAGEBOX_STRING_TITLESTR;
|
||||
if (oldstr4373->cmem_descriptor){
|
||||
_SUB_IDEMESSAGEBOX_STRING_TITLESTR=qbs_new_cmem(oldstr4373->len,0);
|
||||
}else{
|
||||
_SUB_IDEMESSAGEBOX_STRING_TITLESTR=qbs_new(oldstr4362->len,0);
|
||||
_SUB_IDEMESSAGEBOX_STRING_TITLESTR=qbs_new(oldstr4373->len,0);
|
||||
}
|
||||
memcpy(_SUB_IDEMESSAGEBOX_STRING_TITLESTR->chr,oldstr4362->chr,oldstr4362->len);
|
||||
memcpy(_SUB_IDEMESSAGEBOX_STRING_TITLESTR->chr,oldstr4373->chr,oldstr4373->len);
|
||||
}
|
||||
qbs*oldstr4363=NULL;
|
||||
qbs*oldstr4374=NULL;
|
||||
if(_SUB_IDEMESSAGEBOX_STRING_MESSAGESTR->tmp||_SUB_IDEMESSAGEBOX_STRING_MESSAGESTR->fixed||_SUB_IDEMESSAGEBOX_STRING_MESSAGESTR->readonly){
|
||||
oldstr4363=_SUB_IDEMESSAGEBOX_STRING_MESSAGESTR;
|
||||
if (oldstr4363->cmem_descriptor){
|
||||
_SUB_IDEMESSAGEBOX_STRING_MESSAGESTR=qbs_new_cmem(oldstr4363->len,0);
|
||||
oldstr4374=_SUB_IDEMESSAGEBOX_STRING_MESSAGESTR;
|
||||
if (oldstr4374->cmem_descriptor){
|
||||
_SUB_IDEMESSAGEBOX_STRING_MESSAGESTR=qbs_new_cmem(oldstr4374->len,0);
|
||||
}else{
|
||||
_SUB_IDEMESSAGEBOX_STRING_MESSAGESTR=qbs_new(oldstr4363->len,0);
|
||||
_SUB_IDEMESSAGEBOX_STRING_MESSAGESTR=qbs_new(oldstr4374->len,0);
|
||||
}
|
||||
memcpy(_SUB_IDEMESSAGEBOX_STRING_MESSAGESTR->chr,oldstr4363->chr,oldstr4363->len);
|
||||
memcpy(_SUB_IDEMESSAGEBOX_STRING_MESSAGESTR->chr,oldstr4374->chr,oldstr4374->len);
|
||||
}
|
||||
int32 *_SUB_IDEMESSAGEBOX_LONG_FOCUS=NULL;
|
||||
if(_SUB_IDEMESSAGEBOX_LONG_FOCUS==NULL){
|
||||
|
@ -60,24 +60,24 @@ if(_SUB_IDEMESSAGEBOX_LONG_W==NULL){
|
|||
_SUB_IDEMESSAGEBOX_LONG_W=(int32*)mem_static_malloc(4);
|
||||
*_SUB_IDEMESSAGEBOX_LONG_W=0;
|
||||
}
|
||||
byte_element_struct *byte_element_4364=NULL;
|
||||
if (!byte_element_4364){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4364=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4364=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4375=NULL;
|
||||
if (!byte_element_4375){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4375=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4375=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_SUB_IDEMESSAGEBOX_LONG_W2=NULL;
|
||||
if(_SUB_IDEMESSAGEBOX_LONG_W2==NULL){
|
||||
_SUB_IDEMESSAGEBOX_LONG_W2=(int32*)mem_static_malloc(4);
|
||||
*_SUB_IDEMESSAGEBOX_LONG_W2=0;
|
||||
}
|
||||
byte_element_struct *byte_element_4365=NULL;
|
||||
if (!byte_element_4365){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4365=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4365=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4376=NULL;
|
||||
if (!byte_element_4376){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4376=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4376=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 pass4366;
|
||||
int64 fornext_value4368;
|
||||
int64 fornext_finalvalue4368;
|
||||
int64 fornext_step4368;
|
||||
uint8 fornext_step_negative4368;
|
||||
int32 pass4377;
|
||||
int64 fornext_value4379;
|
||||
int64 fornext_finalvalue4379;
|
||||
int64 fornext_step4379;
|
||||
uint8 fornext_step_negative4379;
|
||||
int32 *_SUB_IDEMESSAGEBOX_LONG_F=NULL;
|
||||
if(_SUB_IDEMESSAGEBOX_LONG_F==NULL){
|
||||
_SUB_IDEMESSAGEBOX_LONG_F=(int32*)mem_static_malloc(4);
|
||||
|
@ -93,10 +93,10 @@ if(_SUB_IDEMESSAGEBOX_LONG_CY==NULL){
|
|||
_SUB_IDEMESSAGEBOX_LONG_CY=(int32*)mem_static_malloc(4);
|
||||
*_SUB_IDEMESSAGEBOX_LONG_CY=0;
|
||||
}
|
||||
int64 fornext_value4371;
|
||||
int64 fornext_finalvalue4371;
|
||||
int64 fornext_step4371;
|
||||
uint8 fornext_step_negative4371;
|
||||
int64 fornext_value4382;
|
||||
int64 fornext_finalvalue4382;
|
||||
int64 fornext_step4382;
|
||||
uint8 fornext_step_negative4382;
|
||||
int32 *_SUB_IDEMESSAGEBOX_LONG_LASTFOCUS=NULL;
|
||||
if(_SUB_IDEMESSAGEBOX_LONG_LASTFOCUS==NULL){
|
||||
_SUB_IDEMESSAGEBOX_LONG_LASTFOCUS=(int32*)mem_static_malloc(4);
|
||||
|
@ -129,9 +129,9 @@ _SUB_IDEMESSAGEBOX_LONG_OLDALT=(int32*)mem_static_malloc(4);
|
|||
}
|
||||
qbs *_SUB_IDEMESSAGEBOX_STRING_ALTLETTER=NULL;
|
||||
if (!_SUB_IDEMESSAGEBOX_STRING_ALTLETTER)_SUB_IDEMESSAGEBOX_STRING_ALTLETTER=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4374=NULL;
|
||||
if (!byte_element_4374){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4374=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4374=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4385=NULL;
|
||||
if (!byte_element_4385){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4385=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4385=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_SUB_IDEMESSAGEBOX_LONG_K=NULL;
|
||||
if(_SUB_IDEMESSAGEBOX_LONG_K==NULL){
|
||||
|
@ -143,10 +143,10 @@ if(_SUB_IDEMESSAGEBOX_LONG_INFO==NULL){
|
|||
_SUB_IDEMESSAGEBOX_LONG_INFO=(int32*)mem_static_malloc(4);
|
||||
*_SUB_IDEMESSAGEBOX_LONG_INFO=0;
|
||||
}
|
||||
int64 fornext_value4376;
|
||||
int64 fornext_finalvalue4376;
|
||||
int64 fornext_step4376;
|
||||
uint8 fornext_step_negative4376;
|
||||
int64 fornext_value4387;
|
||||
int64 fornext_finalvalue4387;
|
||||
int64 fornext_step4387;
|
||||
uint8 fornext_step_negative4387;
|
||||
int32 *_SUB_IDEMESSAGEBOX_LONG_T=NULL;
|
||||
if(_SUB_IDEMESSAGEBOX_LONG_T==NULL){
|
||||
_SUB_IDEMESSAGEBOX_LONG_T=(int32*)mem_static_malloc(4);
|
||||
|
|
|
@ -1,24 +1,24 @@
|
|||
qbs *_FUNC_IDEYESNOBOX_STRING_IDEYESNOBOX=NULL;
|
||||
if (!_FUNC_IDEYESNOBOX_STRING_IDEYESNOBOX)_FUNC_IDEYESNOBOX_STRING_IDEYESNOBOX=qbs_new(0,0);
|
||||
qbs*oldstr4377=NULL;
|
||||
qbs*oldstr4388=NULL;
|
||||
if(_FUNC_IDEYESNOBOX_STRING_TITLESTR->tmp||_FUNC_IDEYESNOBOX_STRING_TITLESTR->fixed||_FUNC_IDEYESNOBOX_STRING_TITLESTR->readonly){
|
||||
oldstr4377=_FUNC_IDEYESNOBOX_STRING_TITLESTR;
|
||||
if (oldstr4377->cmem_descriptor){
|
||||
_FUNC_IDEYESNOBOX_STRING_TITLESTR=qbs_new_cmem(oldstr4377->len,0);
|
||||
oldstr4388=_FUNC_IDEYESNOBOX_STRING_TITLESTR;
|
||||
if (oldstr4388->cmem_descriptor){
|
||||
_FUNC_IDEYESNOBOX_STRING_TITLESTR=qbs_new_cmem(oldstr4388->len,0);
|
||||
}else{
|
||||
_FUNC_IDEYESNOBOX_STRING_TITLESTR=qbs_new(oldstr4377->len,0);
|
||||
_FUNC_IDEYESNOBOX_STRING_TITLESTR=qbs_new(oldstr4388->len,0);
|
||||
}
|
||||
memcpy(_FUNC_IDEYESNOBOX_STRING_TITLESTR->chr,oldstr4377->chr,oldstr4377->len);
|
||||
memcpy(_FUNC_IDEYESNOBOX_STRING_TITLESTR->chr,oldstr4388->chr,oldstr4388->len);
|
||||
}
|
||||
qbs*oldstr4378=NULL;
|
||||
qbs*oldstr4389=NULL;
|
||||
if(_FUNC_IDEYESNOBOX_STRING_MESSAGESTR->tmp||_FUNC_IDEYESNOBOX_STRING_MESSAGESTR->fixed||_FUNC_IDEYESNOBOX_STRING_MESSAGESTR->readonly){
|
||||
oldstr4378=_FUNC_IDEYESNOBOX_STRING_MESSAGESTR;
|
||||
if (oldstr4378->cmem_descriptor){
|
||||
_FUNC_IDEYESNOBOX_STRING_MESSAGESTR=qbs_new_cmem(oldstr4378->len,0);
|
||||
oldstr4389=_FUNC_IDEYESNOBOX_STRING_MESSAGESTR;
|
||||
if (oldstr4389->cmem_descriptor){
|
||||
_FUNC_IDEYESNOBOX_STRING_MESSAGESTR=qbs_new_cmem(oldstr4389->len,0);
|
||||
}else{
|
||||
_FUNC_IDEYESNOBOX_STRING_MESSAGESTR=qbs_new(oldstr4378->len,0);
|
||||
_FUNC_IDEYESNOBOX_STRING_MESSAGESTR=qbs_new(oldstr4389->len,0);
|
||||
}
|
||||
memcpy(_FUNC_IDEYESNOBOX_STRING_MESSAGESTR->chr,oldstr4378->chr,oldstr4378->len);
|
||||
memcpy(_FUNC_IDEYESNOBOX_STRING_MESSAGESTR->chr,oldstr4389->chr,oldstr4389->len);
|
||||
}
|
||||
int32 *_FUNC_IDEYESNOBOX_LONG_FOCUS=NULL;
|
||||
if(_FUNC_IDEYESNOBOX_LONG_FOCUS==NULL){
|
||||
|
@ -62,24 +62,24 @@ if(_FUNC_IDEYESNOBOX_LONG_W==NULL){
|
|||
_FUNC_IDEYESNOBOX_LONG_W=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDEYESNOBOX_LONG_W=0;
|
||||
}
|
||||
byte_element_struct *byte_element_4379=NULL;
|
||||
if (!byte_element_4379){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4379=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4379=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4390=NULL;
|
||||
if (!byte_element_4390){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4390=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4390=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_FUNC_IDEYESNOBOX_LONG_W2=NULL;
|
||||
if(_FUNC_IDEYESNOBOX_LONG_W2==NULL){
|
||||
_FUNC_IDEYESNOBOX_LONG_W2=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDEYESNOBOX_LONG_W2=0;
|
||||
}
|
||||
byte_element_struct *byte_element_4380=NULL;
|
||||
if (!byte_element_4380){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4380=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4380=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4391=NULL;
|
||||
if (!byte_element_4391){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4391=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4391=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 pass4381;
|
||||
int64 fornext_value4383;
|
||||
int64 fornext_finalvalue4383;
|
||||
int64 fornext_step4383;
|
||||
uint8 fornext_step_negative4383;
|
||||
int32 pass4392;
|
||||
int64 fornext_value4394;
|
||||
int64 fornext_finalvalue4394;
|
||||
int64 fornext_step4394;
|
||||
uint8 fornext_step_negative4394;
|
||||
int32 *_FUNC_IDEYESNOBOX_LONG_F=NULL;
|
||||
if(_FUNC_IDEYESNOBOX_LONG_F==NULL){
|
||||
_FUNC_IDEYESNOBOX_LONG_F=(int32*)mem_static_malloc(4);
|
||||
|
@ -95,10 +95,10 @@ if(_FUNC_IDEYESNOBOX_LONG_CY==NULL){
|
|||
_FUNC_IDEYESNOBOX_LONG_CY=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDEYESNOBOX_LONG_CY=0;
|
||||
}
|
||||
int64 fornext_value4386;
|
||||
int64 fornext_finalvalue4386;
|
||||
int64 fornext_step4386;
|
||||
uint8 fornext_step_negative4386;
|
||||
int64 fornext_value4397;
|
||||
int64 fornext_finalvalue4397;
|
||||
int64 fornext_step4397;
|
||||
uint8 fornext_step_negative4397;
|
||||
int32 *_FUNC_IDEYESNOBOX_LONG_LASTFOCUS=NULL;
|
||||
if(_FUNC_IDEYESNOBOX_LONG_LASTFOCUS==NULL){
|
||||
_FUNC_IDEYESNOBOX_LONG_LASTFOCUS=(int32*)mem_static_malloc(4);
|
||||
|
@ -131,9 +131,9 @@ _FUNC_IDEYESNOBOX_LONG_OLDALT=(int32*)mem_static_malloc(4);
|
|||
}
|
||||
qbs *_FUNC_IDEYESNOBOX_STRING_ALTLETTER=NULL;
|
||||
if (!_FUNC_IDEYESNOBOX_STRING_ALTLETTER)_FUNC_IDEYESNOBOX_STRING_ALTLETTER=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4389=NULL;
|
||||
if (!byte_element_4389){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4389=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4389=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4400=NULL;
|
||||
if (!byte_element_4400){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4400=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4400=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_FUNC_IDEYESNOBOX_LONG_K=NULL;
|
||||
if(_FUNC_IDEYESNOBOX_LONG_K==NULL){
|
||||
|
@ -145,10 +145,10 @@ if(_FUNC_IDEYESNOBOX_LONG_INFO==NULL){
|
|||
_FUNC_IDEYESNOBOX_LONG_INFO=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDEYESNOBOX_LONG_INFO=0;
|
||||
}
|
||||
int64 fornext_value4391;
|
||||
int64 fornext_finalvalue4391;
|
||||
int64 fornext_step4391;
|
||||
uint8 fornext_step_negative4391;
|
||||
int64 fornext_value4402;
|
||||
int64 fornext_finalvalue4402;
|
||||
int64 fornext_step4402;
|
||||
uint8 fornext_step_negative4402;
|
||||
int32 *_FUNC_IDEYESNOBOX_LONG_T=NULL;
|
||||
if(_FUNC_IDEYESNOBOX_LONG_T==NULL){
|
||||
_FUNC_IDEYESNOBOX_LONG_T=(int32*)mem_static_malloc(4);
|
||||
|
|
|
@ -40,18 +40,18 @@ if(_FUNC_IDEANDROIDBOX_LONG_I==NULL){
|
|||
_FUNC_IDEANDROIDBOX_LONG_I=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDEANDROIDBOX_LONG_I=0;
|
||||
}
|
||||
int32 pass4392;
|
||||
int32 pass4393;
|
||||
int32 pass4403;
|
||||
int32 pass4404;
|
||||
qbs *_FUNC_IDEANDROIDBOX_STRING_A2=NULL;
|
||||
if (!_FUNC_IDEANDROIDBOX_STRING_A2)_FUNC_IDEANDROIDBOX_STRING_A2=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4394=NULL;
|
||||
if (!byte_element_4394){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4394=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4394=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4405=NULL;
|
||||
if (!byte_element_4405){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4405=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4405=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int64 fornext_value4396;
|
||||
int64 fornext_finalvalue4396;
|
||||
int64 fornext_step4396;
|
||||
uint8 fornext_step_negative4396;
|
||||
int64 fornext_value4407;
|
||||
int64 fornext_finalvalue4407;
|
||||
int64 fornext_step4407;
|
||||
uint8 fornext_step_negative4407;
|
||||
int32 *_FUNC_IDEANDROIDBOX_LONG_F=NULL;
|
||||
if(_FUNC_IDEANDROIDBOX_LONG_F==NULL){
|
||||
_FUNC_IDEANDROIDBOX_LONG_F=(int32*)mem_static_malloc(4);
|
||||
|
@ -67,10 +67,10 @@ if(_FUNC_IDEANDROIDBOX_LONG_CY==NULL){
|
|||
_FUNC_IDEANDROIDBOX_LONG_CY=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDEANDROIDBOX_LONG_CY=0;
|
||||
}
|
||||
int64 fornext_value4399;
|
||||
int64 fornext_finalvalue4399;
|
||||
int64 fornext_step4399;
|
||||
uint8 fornext_step_negative4399;
|
||||
int64 fornext_value4410;
|
||||
int64 fornext_finalvalue4410;
|
||||
int64 fornext_step4410;
|
||||
uint8 fornext_step_negative4410;
|
||||
int32 *_FUNC_IDEANDROIDBOX_LONG_LASTFOCUS=NULL;
|
||||
if(_FUNC_IDEANDROIDBOX_LONG_LASTFOCUS==NULL){
|
||||
_FUNC_IDEANDROIDBOX_LONG_LASTFOCUS=(int32*)mem_static_malloc(4);
|
||||
|
@ -103,9 +103,9 @@ _FUNC_IDEANDROIDBOX_LONG_OLDALT=(int32*)mem_static_malloc(4);
|
|||
}
|
||||
qbs *_FUNC_IDEANDROIDBOX_STRING_ALTLETTER=NULL;
|
||||
if (!_FUNC_IDEANDROIDBOX_STRING_ALTLETTER)_FUNC_IDEANDROIDBOX_STRING_ALTLETTER=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4406=NULL;
|
||||
if (!byte_element_4406){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4406=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4406=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4417=NULL;
|
||||
if (!byte_element_4417){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4417=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4417=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_FUNC_IDEANDROIDBOX_LONG_K=NULL;
|
||||
if(_FUNC_IDEANDROIDBOX_LONG_K==NULL){
|
||||
|
@ -117,10 +117,10 @@ if(_FUNC_IDEANDROIDBOX_LONG_INFO==NULL){
|
|||
_FUNC_IDEANDROIDBOX_LONG_INFO=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDEANDROIDBOX_LONG_INFO=0;
|
||||
}
|
||||
int64 fornext_value4408;
|
||||
int64 fornext_finalvalue4408;
|
||||
int64 fornext_step4408;
|
||||
uint8 fornext_step_negative4408;
|
||||
int64 fornext_value4419;
|
||||
int64 fornext_finalvalue4419;
|
||||
int64 fornext_step4419;
|
||||
uint8 fornext_step_negative4419;
|
||||
int32 *_FUNC_IDEANDROIDBOX_LONG_T=NULL;
|
||||
if(_FUNC_IDEANDROIDBOX_LONG_T==NULL){
|
||||
_FUNC_IDEANDROIDBOX_LONG_T=(int32*)mem_static_malloc(4);
|
||||
|
@ -133,13 +133,13 @@ _FUNC_IDEANDROIDBOX_LONG_FOCUSOFFSET=(int32*)mem_static_malloc(4);
|
|||
}
|
||||
qbs *_FUNC_IDEANDROIDBOX_STRING_A=NULL;
|
||||
if (!_FUNC_IDEANDROIDBOX_STRING_A)_FUNC_IDEANDROIDBOX_STRING_A=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4409=NULL;
|
||||
if (!byte_element_4409){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4409=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4409=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4420=NULL;
|
||||
if (!byte_element_4420){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4420=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4420=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4410=NULL;
|
||||
if (!byte_element_4410){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4410=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4410=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4421=NULL;
|
||||
if (!byte_element_4421){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4421=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4421=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int16 *_FUNC_IDEANDROIDBOX_INTEGER_V=NULL;
|
||||
if(_FUNC_IDEANDROIDBOX_INTEGER_V==NULL){
|
||||
|
@ -148,41 +148,41 @@ _FUNC_IDEANDROIDBOX_INTEGER_V=(int16*)mem_static_malloc(2);
|
|||
}
|
||||
qbs *_FUNC_IDEANDROIDBOX_STRING_V=NULL;
|
||||
if (!_FUNC_IDEANDROIDBOX_STRING_V)_FUNC_IDEANDROIDBOX_STRING_V=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4411=NULL;
|
||||
if (!byte_element_4411){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4411=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4411=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4422=NULL;
|
||||
if (!byte_element_4422){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4422=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4422=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4412=NULL;
|
||||
if (!byte_element_4412){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4412=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4412=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4423=NULL;
|
||||
if (!byte_element_4423){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4423=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4423=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4413=NULL;
|
||||
if (!byte_element_4413){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4413=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4413=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4424=NULL;
|
||||
if (!byte_element_4424){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4424=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4424=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
qbs *_FUNC_IDEANDROIDBOX_STRING_V3=NULL;
|
||||
if (!_FUNC_IDEANDROIDBOX_STRING_V3)_FUNC_IDEANDROIDBOX_STRING_V3=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4414=NULL;
|
||||
if (!byte_element_4414){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4414=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4414=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4425=NULL;
|
||||
if (!byte_element_4425){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4425=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4425=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4415=NULL;
|
||||
if (!byte_element_4415){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4415=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4415=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4426=NULL;
|
||||
if (!byte_element_4426){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4426=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4426=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4416=NULL;
|
||||
if (!byte_element_4416){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4416=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4416=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4427=NULL;
|
||||
if (!byte_element_4427){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4427=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4427=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4417=NULL;
|
||||
if (!byte_element_4417){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4417=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4417=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4428=NULL;
|
||||
if (!byte_element_4428){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4428=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4428=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4418=NULL;
|
||||
if (!byte_element_4418){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4418=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4418=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4429=NULL;
|
||||
if (!byte_element_4429){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4429=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4429=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4419=NULL;
|
||||
if (!byte_element_4419){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4419=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4419=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4430=NULL;
|
||||
if (!byte_element_4430){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4430=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4430=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
|
|
|
@ -42,27 +42,27 @@ _FUNC_IDEDISPLAYBOX_LONG_I=(int32*)mem_static_malloc(4);
|
|||
}
|
||||
qbs *_FUNC_IDEDISPLAYBOX_STRING_A2=NULL;
|
||||
if (!_FUNC_IDEDISPLAYBOX_STRING_A2)_FUNC_IDEDISPLAYBOX_STRING_A2=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4420=NULL;
|
||||
if (!byte_element_4420){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4420=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4420=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4431=NULL;
|
||||
if (!byte_element_4431){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4431=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4431=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 pass4421;
|
||||
byte_element_struct *byte_element_4422=NULL;
|
||||
if (!byte_element_4422){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4422=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4422=(byte_element_struct*)mem_static_malloc(12);
|
||||
int32 pass4432;
|
||||
byte_element_struct *byte_element_4433=NULL;
|
||||
if (!byte_element_4433){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4433=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4433=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4423=NULL;
|
||||
if (!byte_element_4423){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4423=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4423=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4434=NULL;
|
||||
if (!byte_element_4434){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4434=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4434=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4424=NULL;
|
||||
if (!byte_element_4424){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4424=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4424=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4435=NULL;
|
||||
if (!byte_element_4435){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4435=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4435=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int64 fornext_value4426;
|
||||
int64 fornext_finalvalue4426;
|
||||
int64 fornext_step4426;
|
||||
uint8 fornext_step_negative4426;
|
||||
int64 fornext_value4437;
|
||||
int64 fornext_finalvalue4437;
|
||||
int64 fornext_step4437;
|
||||
uint8 fornext_step_negative4437;
|
||||
int32 *_FUNC_IDEDISPLAYBOX_LONG_F=NULL;
|
||||
if(_FUNC_IDEDISPLAYBOX_LONG_F==NULL){
|
||||
_FUNC_IDEDISPLAYBOX_LONG_F=(int32*)mem_static_malloc(4);
|
||||
|
@ -78,10 +78,10 @@ if(_FUNC_IDEDISPLAYBOX_LONG_CY==NULL){
|
|||
_FUNC_IDEDISPLAYBOX_LONG_CY=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDEDISPLAYBOX_LONG_CY=0;
|
||||
}
|
||||
int64 fornext_value4429;
|
||||
int64 fornext_finalvalue4429;
|
||||
int64 fornext_step4429;
|
||||
uint8 fornext_step_negative4429;
|
||||
int64 fornext_value4440;
|
||||
int64 fornext_finalvalue4440;
|
||||
int64 fornext_step4440;
|
||||
uint8 fornext_step_negative4440;
|
||||
int32 *_FUNC_IDEDISPLAYBOX_LONG_LASTFOCUS=NULL;
|
||||
if(_FUNC_IDEDISPLAYBOX_LONG_LASTFOCUS==NULL){
|
||||
_FUNC_IDEDISPLAYBOX_LONG_LASTFOCUS=(int32*)mem_static_malloc(4);
|
||||
|
@ -114,9 +114,9 @@ _FUNC_IDEDISPLAYBOX_LONG_OLDALT=(int32*)mem_static_malloc(4);
|
|||
}
|
||||
qbs *_FUNC_IDEDISPLAYBOX_STRING_ALTLETTER=NULL;
|
||||
if (!_FUNC_IDEDISPLAYBOX_STRING_ALTLETTER)_FUNC_IDEDISPLAYBOX_STRING_ALTLETTER=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4433=NULL;
|
||||
if (!byte_element_4433){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4433=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4433=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4444=NULL;
|
||||
if (!byte_element_4444){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4444=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4444=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_FUNC_IDEDISPLAYBOX_LONG_K=NULL;
|
||||
if(_FUNC_IDEDISPLAYBOX_LONG_K==NULL){
|
||||
|
@ -128,10 +128,10 @@ if(_FUNC_IDEDISPLAYBOX_LONG_INFO==NULL){
|
|||
_FUNC_IDEDISPLAYBOX_LONG_INFO=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDEDISPLAYBOX_LONG_INFO=0;
|
||||
}
|
||||
int64 fornext_value4435;
|
||||
int64 fornext_finalvalue4435;
|
||||
int64 fornext_step4435;
|
||||
uint8 fornext_step_negative4435;
|
||||
int64 fornext_value4446;
|
||||
int64 fornext_finalvalue4446;
|
||||
int64 fornext_step4446;
|
||||
uint8 fornext_step_negative4446;
|
||||
int32 *_FUNC_IDEDISPLAYBOX_LONG_T=NULL;
|
||||
if(_FUNC_IDEDISPLAYBOX_LONG_T==NULL){
|
||||
_FUNC_IDEDISPLAYBOX_LONG_T=(int32*)mem_static_malloc(4);
|
||||
|
@ -144,47 +144,6 @@ _FUNC_IDEDISPLAYBOX_LONG_FOCUSOFFSET=(int32*)mem_static_malloc(4);
|
|||
}
|
||||
qbs *_FUNC_IDEDISPLAYBOX_STRING_A=NULL;
|
||||
if (!_FUNC_IDEDISPLAYBOX_STRING_A)_FUNC_IDEDISPLAYBOX_STRING_A=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4436=NULL;
|
||||
if (!byte_element_4436){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4436=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4436=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int64 fornext_value4438;
|
||||
int64 fornext_finalvalue4438;
|
||||
int64 fornext_step4438;
|
||||
uint8 fornext_step_negative4438;
|
||||
byte_element_struct *byte_element_4439=NULL;
|
||||
if (!byte_element_4439){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4439=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4439=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_FUNC_IDEDISPLAYBOX_LONG_A=NULL;
|
||||
if(_FUNC_IDEDISPLAYBOX_LONG_A==NULL){
|
||||
_FUNC_IDEDISPLAYBOX_LONG_A=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDEDISPLAYBOX_LONG_A=0;
|
||||
}
|
||||
byte_element_struct *byte_element_4440=NULL;
|
||||
if (!byte_element_4440){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4440=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4440=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4441=NULL;
|
||||
if (!byte_element_4441){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4441=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4441=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int64 fornext_value4443;
|
||||
int64 fornext_finalvalue4443;
|
||||
int64 fornext_step4443;
|
||||
uint8 fornext_step_negative4443;
|
||||
byte_element_struct *byte_element_4444=NULL;
|
||||
if (!byte_element_4444){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4444=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4444=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4445=NULL;
|
||||
if (!byte_element_4445){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4445=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4445=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4446=NULL;
|
||||
if (!byte_element_4446){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4446=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4446=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4447=NULL;
|
||||
if (!byte_element_4447){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4447=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4447=(byte_element_struct*)mem_static_malloc(12);
|
||||
|
@ -197,10 +156,51 @@ byte_element_struct *byte_element_4450=NULL;
|
|||
if (!byte_element_4450){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4450=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4450=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_FUNC_IDEDISPLAYBOX_LONG_A=NULL;
|
||||
if(_FUNC_IDEDISPLAYBOX_LONG_A==NULL){
|
||||
_FUNC_IDEDISPLAYBOX_LONG_A=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDEDISPLAYBOX_LONG_A=0;
|
||||
}
|
||||
byte_element_struct *byte_element_4451=NULL;
|
||||
if (!byte_element_4451){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4451=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4451=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4452=NULL;
|
||||
if (!byte_element_4452){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4452=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4452=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int64 fornext_value4454;
|
||||
int64 fornext_finalvalue4454;
|
||||
int64 fornext_step4454;
|
||||
uint8 fornext_step_negative4454;
|
||||
byte_element_struct *byte_element_4455=NULL;
|
||||
if (!byte_element_4455){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4455=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4455=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4456=NULL;
|
||||
if (!byte_element_4456){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4456=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4456=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4457=NULL;
|
||||
if (!byte_element_4457){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4457=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4457=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4458=NULL;
|
||||
if (!byte_element_4458){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4458=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4458=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int64 fornext_value4460;
|
||||
int64 fornext_finalvalue4460;
|
||||
int64 fornext_step4460;
|
||||
uint8 fornext_step_negative4460;
|
||||
byte_element_struct *byte_element_4461=NULL;
|
||||
if (!byte_element_4461){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4461=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4461=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4462=NULL;
|
||||
if (!byte_element_4462){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4462=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4462=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_FUNC_IDEDISPLAYBOX_LONG_X=NULL;
|
||||
if(_FUNC_IDEDISPLAYBOX_LONG_X==NULL){
|
||||
_FUNC_IDEDISPLAYBOX_LONG_X=(int32*)mem_static_malloc(4);
|
||||
|
@ -218,31 +218,31 @@ if(_FUNC_IDEDISPLAYBOX_LONG_OLDHANDLE==NULL){
|
|||
_FUNC_IDEDISPLAYBOX_LONG_OLDHANDLE=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_IDEDISPLAYBOX_LONG_OLDHANDLE=0;
|
||||
}
|
||||
byte_element_struct *byte_element_4452=NULL;
|
||||
if (!byte_element_4452){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4452=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4452=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4463=NULL;
|
||||
if (!byte_element_4463){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4463=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4463=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4453=NULL;
|
||||
if (!byte_element_4453){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4453=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4453=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4464=NULL;
|
||||
if (!byte_element_4464){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4464=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4464=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4454=NULL;
|
||||
if (!byte_element_4454){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4454=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4454=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4465=NULL;
|
||||
if (!byte_element_4465){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4465=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4465=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4455=NULL;
|
||||
if (!byte_element_4455){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4455=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4455=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4466=NULL;
|
||||
if (!byte_element_4466){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4466=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4466=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4456=NULL;
|
||||
if (!byte_element_4456){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4456=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4456=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4467=NULL;
|
||||
if (!byte_element_4467){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4467=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4467=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4457=NULL;
|
||||
if (!byte_element_4457){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4457=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4457=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4468=NULL;
|
||||
if (!byte_element_4468){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4468=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4468=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_4458=NULL;
|
||||
if (!byte_element_4458){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4458=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4458=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4469=NULL;
|
||||
if (!byte_element_4469){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4469=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4469=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
|
|
|
@ -3,24 +3,24 @@ if(_FUNC_HASHVALUE_LONG_HASHVALUE==NULL){
|
|||
_FUNC_HASHVALUE_LONG_HASHVALUE=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_HASHVALUE_LONG_HASHVALUE=0;
|
||||
}
|
||||
qbs*oldstr4459=NULL;
|
||||
qbs*oldstr4470=NULL;
|
||||
if(_FUNC_HASHVALUE_STRING_A->tmp||_FUNC_HASHVALUE_STRING_A->fixed||_FUNC_HASHVALUE_STRING_A->readonly){
|
||||
oldstr4459=_FUNC_HASHVALUE_STRING_A;
|
||||
if (oldstr4459->cmem_descriptor){
|
||||
_FUNC_HASHVALUE_STRING_A=qbs_new_cmem(oldstr4459->len,0);
|
||||
oldstr4470=_FUNC_HASHVALUE_STRING_A;
|
||||
if (oldstr4470->cmem_descriptor){
|
||||
_FUNC_HASHVALUE_STRING_A=qbs_new_cmem(oldstr4470->len,0);
|
||||
}else{
|
||||
_FUNC_HASHVALUE_STRING_A=qbs_new(oldstr4459->len,0);
|
||||
_FUNC_HASHVALUE_STRING_A=qbs_new(oldstr4470->len,0);
|
||||
}
|
||||
memcpy(_FUNC_HASHVALUE_STRING_A->chr,oldstr4459->chr,oldstr4459->len);
|
||||
memcpy(_FUNC_HASHVALUE_STRING_A->chr,oldstr4470->chr,oldstr4470->len);
|
||||
}
|
||||
int32 *_FUNC_HASHVALUE_LONG_L=NULL;
|
||||
if(_FUNC_HASHVALUE_LONG_L==NULL){
|
||||
_FUNC_HASHVALUE_LONG_L=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_HASHVALUE_LONG_L=0;
|
||||
}
|
||||
byte_element_struct *byte_element_4460=NULL;
|
||||
if (!byte_element_4460){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4460=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4460=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4471=NULL;
|
||||
if (!byte_element_4471){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4471=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4471=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_FUNC_HASHVALUE_LONG_A=NULL;
|
||||
if(_FUNC_HASHVALUE_LONG_A==NULL){
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
qbs*oldstr2037=NULL;
|
||||
qbs*oldstr2041=NULL;
|
||||
if(_SUB_IDEIMPORTBOOKMARKS_STRING_F2->tmp||_SUB_IDEIMPORTBOOKMARKS_STRING_F2->fixed||_SUB_IDEIMPORTBOOKMARKS_STRING_F2->readonly){
|
||||
oldstr2037=_SUB_IDEIMPORTBOOKMARKS_STRING_F2;
|
||||
if (oldstr2037->cmem_descriptor){
|
||||
_SUB_IDEIMPORTBOOKMARKS_STRING_F2=qbs_new_cmem(oldstr2037->len,0);
|
||||
oldstr2041=_SUB_IDEIMPORTBOOKMARKS_STRING_F2;
|
||||
if (oldstr2041->cmem_descriptor){
|
||||
_SUB_IDEIMPORTBOOKMARKS_STRING_F2=qbs_new_cmem(oldstr2041->len,0);
|
||||
}else{
|
||||
_SUB_IDEIMPORTBOOKMARKS_STRING_F2=qbs_new(oldstr2037->len,0);
|
||||
_SUB_IDEIMPORTBOOKMARKS_STRING_F2=qbs_new(oldstr2041->len,0);
|
||||
}
|
||||
memcpy(_SUB_IDEIMPORTBOOKMARKS_STRING_F2->chr,oldstr2037->chr,oldstr2037->len);
|
||||
memcpy(_SUB_IDEIMPORTBOOKMARKS_STRING_F2->chr,oldstr2041->chr,oldstr2041->len);
|
||||
}
|
||||
qbs *_SUB_IDEIMPORTBOOKMARKS_STRING_F=NULL;
|
||||
if (!_SUB_IDEIMPORTBOOKMARKS_STRING_F)_SUB_IDEIMPORTBOOKMARKS_STRING_F=qbs_new(0,0);
|
||||
|
@ -27,18 +27,18 @@ if(_SUB_IDEIMPORTBOOKMARKS_LONG_L==NULL){
|
|||
_SUB_IDEIMPORTBOOKMARKS_LONG_L=(int32*)mem_static_malloc(4);
|
||||
*_SUB_IDEIMPORTBOOKMARKS_LONG_L=0;
|
||||
}
|
||||
byte_element_struct *byte_element_2038=NULL;
|
||||
if (!byte_element_2038){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_2038=(byte_element_struct*)(mem_static_pointer-12); else byte_element_2038=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_2042=NULL;
|
||||
if (!byte_element_2042){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_2042=(byte_element_struct*)(mem_static_pointer-12); else byte_element_2042=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_SUB_IDEIMPORTBOOKMARKS_LONG_X1=NULL;
|
||||
if(_SUB_IDEIMPORTBOOKMARKS_LONG_X1==NULL){
|
||||
_SUB_IDEIMPORTBOOKMARKS_LONG_X1=(int32*)mem_static_malloc(4);
|
||||
*_SUB_IDEIMPORTBOOKMARKS_LONG_X1=0;
|
||||
}
|
||||
byte_element_struct *byte_element_2039=NULL;
|
||||
if (!byte_element_2039){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_2039=(byte_element_struct*)(mem_static_pointer-12); else byte_element_2039=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_2043=NULL;
|
||||
if (!byte_element_2043){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_2043=(byte_element_struct*)(mem_static_pointer-12); else byte_element_2043=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
qbs *_SUB_IDEIMPORTBOOKMARKS_STRING_D=NULL;
|
||||
if (!_SUB_IDEIMPORTBOOKMARKS_STRING_D)_SUB_IDEIMPORTBOOKMARKS_STRING_D=qbs_new(0,0);
|
||||
|
@ -52,10 +52,10 @@ if(_SUB_IDEIMPORTBOOKMARKS_LONG_I==NULL){
|
|||
_SUB_IDEIMPORTBOOKMARKS_LONG_I=(int32*)mem_static_malloc(4);
|
||||
*_SUB_IDEIMPORTBOOKMARKS_LONG_I=0;
|
||||
}
|
||||
int64 fornext_value2041;
|
||||
int64 fornext_finalvalue2041;
|
||||
int64 fornext_step2041;
|
||||
uint8 fornext_step_negative2041;
|
||||
int64 fornext_value2045;
|
||||
int64 fornext_finalvalue2045;
|
||||
int64 fornext_step2045;
|
||||
uint8 fornext_step_negative2045;
|
||||
int32 *_SUB_IDEIMPORTBOOKMARKS_LONG_BY=NULL;
|
||||
if(_SUB_IDEIMPORTBOOKMARKS_LONG_BY==NULL){
|
||||
_SUB_IDEIMPORTBOOKMARKS_LONG_BY=(int32*)mem_static_malloc(4);
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
qbs*oldstr4463=NULL;
|
||||
qbs*oldstr4474=NULL;
|
||||
if(_SUB_HASHADD_STRING_A->tmp||_SUB_HASHADD_STRING_A->fixed||_SUB_HASHADD_STRING_A->readonly){
|
||||
oldstr4463=_SUB_HASHADD_STRING_A;
|
||||
if (oldstr4463->cmem_descriptor){
|
||||
_SUB_HASHADD_STRING_A=qbs_new_cmem(oldstr4463->len,0);
|
||||
oldstr4474=_SUB_HASHADD_STRING_A;
|
||||
if (oldstr4474->cmem_descriptor){
|
||||
_SUB_HASHADD_STRING_A=qbs_new_cmem(oldstr4474->len,0);
|
||||
}else{
|
||||
_SUB_HASHADD_STRING_A=qbs_new(oldstr4463->len,0);
|
||||
_SUB_HASHADD_STRING_A=qbs_new(oldstr4474->len,0);
|
||||
}
|
||||
memcpy(_SUB_HASHADD_STRING_A->chr,oldstr4463->chr,oldstr4463->len);
|
||||
memcpy(_SUB_HASHADD_STRING_A->chr,oldstr4474->chr,oldstr4474->len);
|
||||
}
|
||||
int32 *_SUB_HASHADD_LONG_I=NULL;
|
||||
if(_SUB_HASHADD_LONG_I==NULL){
|
||||
|
|
|
@ -3,15 +3,15 @@ if(_FUNC_HASHFIND_LONG_HASHFIND==NULL){
|
|||
_FUNC_HASHFIND_LONG_HASHFIND=(int32*)mem_static_malloc(4);
|
||||
*_FUNC_HASHFIND_LONG_HASHFIND=0;
|
||||
}
|
||||
qbs*oldstr4464=NULL;
|
||||
qbs*oldstr4475=NULL;
|
||||
if(_FUNC_HASHFIND_STRING_A->tmp||_FUNC_HASHFIND_STRING_A->fixed||_FUNC_HASHFIND_STRING_A->readonly){
|
||||
oldstr4464=_FUNC_HASHFIND_STRING_A;
|
||||
if (oldstr4464->cmem_descriptor){
|
||||
_FUNC_HASHFIND_STRING_A=qbs_new_cmem(oldstr4464->len,0);
|
||||
oldstr4475=_FUNC_HASHFIND_STRING_A;
|
||||
if (oldstr4475->cmem_descriptor){
|
||||
_FUNC_HASHFIND_STRING_A=qbs_new_cmem(oldstr4475->len,0);
|
||||
}else{
|
||||
_FUNC_HASHFIND_STRING_A=qbs_new(oldstr4464->len,0);
|
||||
_FUNC_HASHFIND_STRING_A=qbs_new(oldstr4475->len,0);
|
||||
}
|
||||
memcpy(_FUNC_HASHFIND_STRING_A->chr,oldstr4464->chr,oldstr4464->len);
|
||||
memcpy(_FUNC_HASHFIND_STRING_A->chr,oldstr4475->chr,oldstr4475->len);
|
||||
}
|
||||
int32 *_FUNC_HASHFIND_LONG_I=NULL;
|
||||
if(_FUNC_HASHFIND_LONG_I==NULL){
|
||||
|
@ -20,9 +20,9 @@ _FUNC_HASHFIND_LONG_I=(int32*)mem_static_malloc(4);
|
|||
}
|
||||
qbs *_FUNC_HASHFIND_STRING_UA=NULL;
|
||||
if (!_FUNC_HASHFIND_STRING_UA)_FUNC_HASHFIND_STRING_UA=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_4465=NULL;
|
||||
if (!byte_element_4465){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4465=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4465=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_4476=NULL;
|
||||
if (!byte_element_4476){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_4476=(byte_element_struct*)(mem_static_pointer-12); else byte_element_4476=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
int32 *_FUNC_HASHFIND_LONG_F=NULL;
|
||||
if(_FUNC_HASHFIND_LONG_F==NULL){
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue