2015-05-14 08:43:25 -05:00
// 6 april 2015
2018-04-17 20:04:04 -05:00
// note: this file should not include ui.h, as the OS-specific ui_*.h files are included between that one and this one in the OS-specific uipriv_*.h* files
2018-04-15 14:49:45 -05:00
# include <stdarg.h>
# include <string.h>
# include "controlsigs.h"
2017-01-20 02:24:06 -06:00
# include "utf.h"
2015-11-17 18:18:55 -06:00
# ifdef __cplusplus
extern " C " {
# endif
2018-04-15 20:46:08 -05:00
// OS-specific init.* or main.* files
2018-04-15 14:49:45 -05:00
extern uiInitOptions uiprivOptions ;
2015-05-14 08:43:25 -05:00
2018-04-15 20:46:08 -05:00
// OS-specific alloc.* files
2018-04-15 14:53:27 -05:00
extern void * uiprivAlloc ( size_t , const char * ) ;
# define uiprivNew(T) ((T *) uiprivAlloc(sizeof (T), #T))
extern void * uiprivRealloc ( void * , size_t , const char * ) ;
extern void uiprivFree ( void * ) ;
2015-05-14 08:43:25 -05:00
2018-04-15 20:46:08 -05:00
// debug.c and OS-specific debug.* files
// TODO get rid of this mess...
// ugh, __func__ was only introduced in MSVC 2015...
2016-05-13 22:29:41 -05:00
# ifdef _MSC_VER
2018-04-15 20:46:08 -05:00
# define uiprivMacro__func__ __FUNCTION__
# else
# define uiprivMacro__func__ __func__
2016-05-13 22:29:41 -05:00
# endif
2018-04-15 20:46:08 -05:00
extern void uiprivRealBug ( const char * file , const char * line , const char * func , const char * prefix , const char * format , va_list ap ) ;
# define uiprivMacro_ns2(s) #s
# define uiprivMacro_ns(s) uiprivMacro_ns2(s)
extern void uiprivDoImplBug ( const char * file , const char * line , const char * func , const char * format , . . . ) ;
# define uiprivImplBug(...) uiprivDoImplBug(__FILE__, uiprivMacro_ns(__LINE__), uiprivMacro__func__, __VA_ARGS__)
extern void uiprivDoUserBug ( const char * file , const char * line , const char * func , const char * format , . . . ) ;
# define uiprivUserBug(...) uiprivDoUserBug(__FILE__, uiprivMacro_ns(__LINE__), uiprivMacro__func__, __VA_ARGS__)
2015-05-14 08:43:25 -05:00
// shouldquit.c
2018-04-15 20:54:46 -05:00
extern int uiprivShouldQuit ( void ) ;
2015-05-29 13:56:11 -05:00
2015-10-08 17:24:09 -05:00
// areaevents.c
2018-04-15 21:26:51 -05:00
typedef struct uiprivClickCounter uiprivClickCounter ;
2015-10-08 17:24:09 -05:00
// you should call Reset() to zero-initialize a new instance
// it doesn't matter that all the non-count fields are zero: the first click will fail the curButton test straightaway, so it'll return 1 and set the rest of the structure accordingly
2018-04-15 21:26:51 -05:00
struct uiprivClickCounter {
2016-06-13 20:37:50 -05:00
int curButton ;
int rectX0 ;
int rectY0 ;
int rectX1 ;
int rectY1 ;
2015-10-08 17:24:09 -05:00
uintptr_t prevTime ;
2016-06-13 20:37:50 -05:00
int count ;
2015-10-08 17:24:09 -05:00
} ;
2018-04-15 21:26:51 -05:00
extern int uiprivClickCounterClick ( uiprivClickCounter * c , int button , int x , int y , uintptr_t time , uintptr_t maxTime , int32_t xdist , int32_t ydist ) ;
extern void uiprivClickCounterReset ( uiprivClickCounter * ) ;
2018-04-15 21:31:17 -05:00
extern int uiprivFromScancode ( uintptr_t , uiAreaKeyEvent * ) ;
2015-10-11 10:13:01 -05:00
// matrix.c
2018-04-15 21:39:34 -05:00
extern void uiprivFallbackSkew ( uiDrawMatrix * , double , double , double , double ) ;
extern void uiprivScaleCenter ( double , double , double * , double * ) ;
extern void uiprivFallbackTransformSize ( uiDrawMatrix * , double * , double * ) ;
2015-11-17 18:18:55 -06:00
2018-03-17 22:21:54 -05:00
// OS-specific text.* files
extern int uiprivStricmp ( const char * a , const char * b ) ;
2015-11-17 18:18:55 -06:00
# ifdef __cplusplus
}
# endif