Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members
|
Go to the source code of this file.
Namespaces | |
namespace | FX |
Defines | |
#define | TRUE 1 |
#define | FALSE 0 |
#define | MAYBE 2 |
#define | NULL 0 |
#define | PI 3.1415926535897932384626433833 |
#define | EULER 2.7182818284590452353602874713 |
#define | DTOR 0.0174532925199432957692369077 |
#define | RTOD 57.295779513082320876798154814 |
#define | PATHSEP '/' |
#define | PATHSEPSTRING "/" |
#define | PATHLISTSEP ':' |
#define | PATHLISTSEPSTRING ":" |
#define | ISPATHSEP(c) ((c)=='/') |
#define | ENDLINE "\n" |
#define | FXLOCAL |
#define | FXEXPORT |
#define | FXIMPORT |
#define | FXAPI |
#define | FX_PRINTF(fmt, arg) |
#define | FX_SCANF(fmt, arg) |
#define | FXABS(val) (((val)>=0)?(val):-(val)) |
#define | FXMAX(a, b) (((a)>(b))?(a):(b)) |
#define | FXMIN(a, b) (((a)>(b))?(b):(a)) |
#define | FXMIN3(x, y, z) ((x)<(y)?FXMIN(x,z):FXMIN(y,z)) |
#define | FXMAX3(x, y, z) ((x)>(y)?FXMAX(x,z):FXMAX(y,z)) |
#define | FXMIN4(x, y, z, w) (FXMIN(FXMIN(x,y),FXMIN(z,w))) |
#define | FXMAX4(x, y, z, w) (FXMAX(FXMAX(x,y),FXMAX(z,w))) |
#define | FXMINMAX(lo, hi, a, b) ((a)<(b)?((lo)=(a),(hi)=(b)):((lo)=(b),(hi)=(a))) |
#define | FXCLAMP(lo, x, hi) ((x)<(lo)?(lo):((x)>(hi)?(hi):(x))) |
#define | FXSWAP(a, b, t) ((t)=(a),(a)=(b),(b)=(t)) |
#define | FXLERP(a, b, f) ((a)+((b)-(a))*(f)) |
#define | STRUCTOFFSET(str, member) (((char *)(&(((str *)0)->member)))-((char *)0)) |
#define | ARRAYNUMBER(array) (sizeof(array)/sizeof(array[0])) |
#define | CONTAINER(ptr, str, mem) ((str*)(((char*)(ptr))-STRUCTOFFSET(str,mem))) |
#define | MKUINT(l, h) ((((FX::FXuint)(l))&0xffff) | (((FX::FXuint)(h))<<16)) |
#define | FXSEL(type, id) ((((FX::FXuint)(id))&0xffff) | (((FX::FXuint)(type))<<16)) |
#define | FXSELTYPE(s) ((FX::FXushort)(((s)>>16)&0xffff)) |
#define | FXSELID(s) ((FX::FXushort)((s)&0xffff)) |
#define | FXBITREVERSE(b) (((b&0x01)<<7)|((b&0x02)<<5)|((b&0x04)<<3)|((b&0x08)<<1)|((b&0x10)>>1)|((b&0x20)>>3)|((b&0x40)>>5)|((b&0x80)>>7)) |
#define | FXISUTF(c) (((c)&0xC0)!=0x80) |
#define | FXRGBA(r, g, b, a) (((FX::FXuint)(FX::FXuchar)(r)) | ((FX::FXuint)(FX::FXuchar)(g)<<8) | ((FX::FXuint)(FX::FXuchar)(b)<<16) | ((FX::FXuint)(FX::FXuchar)(a)<<24)) |
#define | FXRGB(r, g, b) (((FX::FXuint)(FX::FXuchar)(r)) | ((FX::FXuint)(FX::FXuchar)(g)<<8) | ((FX::FXuint)(FX::FXuchar)(b)<<16) | 0xff000000) |
#define | FXREDVAL(rgba) ((FX::FXuchar)((rgba)&0xff)) |
#define | FXGREENVAL(rgba) ((FX::FXuchar)(((rgba)>>8)&0xff)) |
#define | FXBLUEVAL(rgba) ((FX::FXuchar)(((rgba)>>16)&0xff)) |
#define | FXALPHAVAL(rgba) ((FX::FXuchar)(((rgba)>>24)&0xff)) |
#define | FXRGBACOMPVAL(rgba, comp) ((FX::FXuchar)(((rgba)>>((comp)<<3))&0xff)) |
#define | FXASSERT(exp) ((exp)?((void)0):(void)FX::fxassert(#exp,__FILE__,__LINE__)) |
#define | FXTRACE(arguments) FX::fxtrace arguments |
#define | FXMALLOC(ptr, type, no) (FX::fxmalloc((void **)(ptr),sizeof(type)*(no))) |
#define | FXCALLOC(ptr, type, no) (FX::fxcalloc((void **)(ptr),sizeof(type)*(no))) |
#define | FXRESIZE(ptr, type, no) (FX::fxresize((void **)(ptr),sizeof(type)*(no))) |
#define | FXMEMDUP(ptr, src, type, no) (FX::fxmemdup((void **)(ptr),(const void*)(src),sizeof(type)*(no))) |
#define | FXFREE(ptr) (FX::fxfree((void **)(ptr))) |
#define | fabsf(x) ((float)fabs((double)(x))) |
#define | ceilf(x) ((float)ceil((double)(x))) |
#define | floorf(x) ((float)floor((double)(x))) |
#define | fmodf(x, y) ((float)fmod((double)(x),(double)(y))) |
#define | sqrtf(x) ((float)sqrt((double)(x))) |
#define | sinf(x) ((float)sin((double)(x))) |
#define | cosf(x) ((float)cos((double)(x))) |
#define | tanf(x) ((float)tan((double)(x))) |
#define | asinf(x) ((float)asin((double)(x))) |
#define | acosf(x) ((float)acos((double)(x))) |
#define | atanf(x) ((float)atan((double)(x))) |
#define | atan2f(y, x) ((float)atan2((double)(y),(double)(x))) |
#define | powf(x, y) ((float)pow((double)(x),(double)(y))) |
#define | expf(x) ((float)exp((double)(x))) |
#define | logf(x) ((float)log((double)(x))) |
#define | log10f(x) ((float)log10((double)(x))) |
Typedefs | |
typedef char | FXchar |
typedef unsigned char | FXuchar |
typedef FXuchar | FXbool |
typedef unsigned short | FXushort |
typedef short | FXshort |
typedef unsigned int | FXuint |
typedef int | FXint |
typedef float | FXfloat |
typedef double | FXdouble |
typedef FXObject * | FXObjectPtr |
typedef wchar_t | FXwchar |
typedef unsigned short | FXnchar |
typedef long | FXival |
typedef unsigned long | FXuval |
typedef unsigned long | FXID |
typedef long | FXTime |
typedef unsigned long | FXPixel |
typedef FXuint | FXColor |
typedef FXuint | FXHotKey |
typedef FXID | FXDragType |
typedef FXint | FXInputHandle |
typedef _XEvent | FXRawEvent |
Enumerations | |
enum | FXSelType { SEL_NONE, SEL_KEYPRESS, SEL_KEYRELEASE, SEL_LEFTBUTTONPRESS, SEL_LEFTBUTTONRELEASE, SEL_MIDDLEBUTTONPRESS, SEL_MIDDLEBUTTONRELEASE, SEL_RIGHTBUTTONPRESS, SEL_RIGHTBUTTONRELEASE, SEL_MOTION, SEL_ENTER, SEL_LEAVE, SEL_FOCUSIN, SEL_FOCUSOUT, SEL_KEYMAP, SEL_UNGRABBED, SEL_PAINT, SEL_CREATE, SEL_DESTROY, SEL_UNMAP, SEL_MAP, SEL_CONFIGURE, SEL_SELECTION_LOST, SEL_SELECTION_GAINED, SEL_SELECTION_REQUEST, SEL_RAISED, SEL_LOWERED, SEL_CLOSE, SEL_DELETE, SEL_MINIMIZE, SEL_RESTORE, SEL_MAXIMIZE, SEL_UPDATE, SEL_COMMAND, SEL_CLICKED, SEL_DOUBLECLICKED, SEL_TRIPLECLICKED, SEL_MOUSEWHEEL, SEL_CHANGED, SEL_VERIFY, SEL_DESELECTED, SEL_SELECTED, SEL_INSERTED, SEL_REPLACED, SEL_DELETED, SEL_OPENED, SEL_CLOSED, SEL_EXPANDED, SEL_COLLAPSED, SEL_BEGINDRAG, SEL_ENDDRAG, SEL_DRAGGED, SEL_LASSOED, SEL_TIMEOUT, SEL_SIGNAL, SEL_CLIPBOARD_LOST, SEL_CLIPBOARD_GAINED, SEL_CLIPBOARD_REQUEST, SEL_CHORE, SEL_FOCUS_SELF, SEL_FOCUS_RIGHT, SEL_FOCUS_LEFT, SEL_FOCUS_DOWN, SEL_FOCUS_UP, SEL_FOCUS_NEXT, SEL_FOCUS_PREV, SEL_DND_ENTER, SEL_DND_LEAVE, SEL_DND_DROP, SEL_DND_MOTION, SEL_DND_REQUEST, SEL_IO_READ, SEL_IO_WRITE, SEL_IO_EXCEPT, SEL_PICKED, SEL_QUERY_TIP, SEL_QUERY_HELP, SEL_DOCKED, SEL_FLOATED, SEL_SESSION_NOTIFY, SEL_SESSION_CLOSED, SEL_LAST } |
enum | { SHIFTMASK = 0x001, CAPSLOCKMASK = 0x002, CONTROLMASK = 0x004, ALTMASK = 0x008, METAMASK = 0x040, NUMLOCKMASK = 0x010, SCROLLLOCKMASK = 0x0E0, LEFTBUTTONMASK = 0x100, MIDDLEBUTTONMASK = 0x200, RIGHTBUTTONMASK = 0x400 } |
enum | { LEFTBUTTON = 1, MIDDLEBUTTON = 2, RIGHTBUTTON = 3 } |
enum | { CROSSINGNORMAL, CROSSINGGRAB, CROSSINGUNGRAB } |
enum | { VISIBILITYTOTAL, VISIBILITYPARTIAL, VISIBILITYNONE } |
enum | { FILEMATCH_FILE_NAME = 1, FILEMATCH_NOESCAPE = 2, FILEMATCH_PERIOD = 4, FILEMATCH_LEADING_DIR = 8, FILEMATCH_CASEFOLD = 16 } |
enum | FXDragAction { DRAG_REJECT = 0, DRAG_ACCEPT = 1, DRAG_COPY = 2, DRAG_MOVE = 3, DRAG_LINK = 4, DRAG_PRIVATE = 5 } |
enum | FXDNDOrigin { FROM_SELECTION = 0, FROM_CLIPBOARD = 1, FROM_DRAGNDROP = 2 } |
enum | FXExponent { EXP_NEVER = FALSE, EXP_ALWAYS = TRUE, EXP_AUTO = MAYBE } |
enum | { SEARCH_FORWARD = 0, SEARCH_BACKWARD = 1, SEARCH_NOWRAP = 0, SEARCH_WRAP = 2, SEARCH_EXACT = 0, SEARCH_IGNORECASE = 4, SEARCH_REGEX = 8, SEARCH_PREFIX = 16 } |
Functions | |
FXuint | fxrandom (FXuint &seed) |
FXint | fxmalloc (void **ptr, unsigned long size) |
FXint | fxcalloc (void **ptr, unsigned long size) |
FXint | fxresize (void **ptr, unsigned long size) |
FXint | fxmemdup (void **ptr, const void *src, unsigned long size) |
void | fxfree (void **ptr) |
void | fxerror (const char *format,...) FX_PRINTF(1 |
void void | fxwarning (const char *format,...) FX_PRINTF(1 |
void void void | fxmessage (const char *format,...) FX_PRINTF(1 |
void void void void | fxassert (const char *expression, const char *filename, unsigned int lineno) |
void | fxtrace (unsigned int level, const char *format,...) FX_PRINTF(2 |
void void | fxsleep (unsigned int n) |
bool | fxfilematch (const char *pattern, const char *string, FXuint flags=(FILEMATCH_NOESCAPE|FILEMATCH_FILE_NAME)) |
FXColor | makeHiliteColor (FXColor clr) |
FXColor | makeShadowColor (FXColor clr) |
FXint | fxgetpid () |
bool | fxtoDOS (FXchar *&string, FXint &len) |
bool | fxfromDOS (FXchar *&string, FXint &len) |
FXchar * | fxstrdup (const FXchar *str) |
FXuint | fxstrhash (const FXchar *str) |
FXColor | fxcolorfromname (const FXchar *colorname) |
FXchar * | fxnamefromcolor (FXchar *colorname, FXColor color) |
void | fxrgb_to_hsv (FXfloat &h, FXfloat &s, FXfloat &v, FXfloat r, FXfloat g, FXfloat b) |
void | fxhsv_to_rgb (FXfloat &r, FXfloat &g, FXfloat &b, FXfloat h, FXfloat s, FXfloat v) |
FXint | fxieeefloatclass (FXfloat number) |
FXint | fxieeedoubleclass (FXdouble number) |
FXwchar | fxkeysym2ucs (FXwchar sym) |
FXwchar | fxucs2keysym (FXwchar ucs) |
FXint | fxparsegeometry (const FXchar *string, FXint &x, FXint &y, FXint &w, FXint &h) |
FXbool | fxisconsole (const FXchar *path) |
FXwchar | wc (const FXchar *ptr) |
FXwchar | wc (const FXnchar *ptr) |
FXint | wclen (const FXchar *ptr) |
FXint | wclen (const FXnchar *ptr) |
FXint | wcvalidate (const FXchar *string, FXint pos) |
FXint | wcvalidate (const FXnchar *string, FXint pos) |
FXint | wcinc (const FXchar *string, FXint pos) |
FXint | wcinc (const FXnchar *string, FXint pos) |
FXint | wcdec (const FXchar *string, FXint pos) |
FXint | wcdec (const FXnchar *string, FXint pos) |
FXint | utfslen (const FXwchar *str, FXint n) |
FXint | utfslen (const FXwchar *str) |
FXint | utfslen (const FXnchar *str, FXint n) |
FXint | utfslen (const FXnchar *str) |
FXint | wcslen (const FXchar *str, FXint n) |
FXint | wcslen (const FXchar *str) |
FXint | ncslen (const FXchar *str, FXint n) |
FXint | ncslen (const FXchar *str) |
FXint | utf2wcs (FXwchar *dst, const FXchar *src, FXint n) |
FXint | utf2wcs (FXwchar *dst, const FXchar *src) |
FXint | utf2ncs (FXnchar *dst, const FXchar *src, FXint n) |
FXint | utf2ncs (FXnchar *dst, const FXchar *src) |
FXint | wc2utfs (FXchar *dst, const FXwchar *src, FXint n) |
FXint | wc2utfs (FXchar *dst, const FXwchar *src) |
FXint | nc2utfs (FXchar *dst, const FXnchar *src, FXint n) |
FXint | nc2utfs (FXchar *dst, const FXnchar *src) |
Variables | |
const FXuchar | fxversion [3] |
unsigned int | fxTraceLevel |
|
|
|
|
|
|
|
|
|
Pi.
|
|
Euler constant.
|
|
Multiplier for degrees to radians.
|
|
Multiplier for radians to degrees.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Abolute value.
|
|
Return the maximum of a or b.
|
|
Return the minimum of a or b.
|
|
Return the minimum of x, y and z.
|
|
Return the maximum of x, y and z.
|
|
Return the minimum of x, y, z, and w.
|
|
Return the maximum of of x, y, z, and w.
|
|
Return minimum and maximum of a, b.
|
|
Clamp value x to range [lo..hi].
|
|
Swap a pair of numbers.
|
|
Linear interpolation between a and b, where 0<=f<=1.
|
|
Offset of member in a structure.
|
|
Number of elements in a static array.
|
|
Container class of a member class.
|
|
Make int out of two shorts.
|
|
Make selector from message type and message id.
|
|
Get type from selector.
|
|
Get ID from selector.
|
|
Reverse bits in byte.
|
|
Test if character c is at the start of a utf8 sequence.
|
|
Make RGBA color.
|
|
Make RGB color.
|
|
Get red value from RGBA color.
|
|
Get green value from RGBA color.
|
|
Get blue value from RGBA color.
|
|
Get alpha value from RGBA color.
|
|
Get component value of RGBA color.
|
|
FXASSERT() prints out a message when the expression fails, and nothing otherwise. Unlike assert(), FXASSERT() will not terminate the execution of the application. When compiling your application for release, all assertions are compiled out; thus there is no impact on execution speed. |
|
FXTRACE() allows you to trace the execution of your application with increasing levels of detail the higher the trace level. The trace level is determined by variable fxTraceLevel, which may be set from the command line with "-tracelevel <level>". When compiling your application for release, all trace statements are compiled out, just like FXASSERT. A statement like: FXTRACE((10,"The value of x=%d\n",x)) will generate output only if fxTraceLevel is set to 11 or greater. The default value fxTraceLevel=0 will block all trace outputs. Note the double parentheses! |
|
Allocate a memory block of no elements of type and store a pointer to it into the address pointed to by ptr. Return FALSE if size!=0 and allocation fails, TRUE otherwise. An allocation of a zero size block returns a NULL pointer. |
|
Allocate a zero-filled memory block no elements of type and store a pointer to it into the address pointed to by ptr. Return FALSE if size!=0 and allocation fails, TRUE otherwise. An allocation of a zero size block returns a NULL pointer. |
|
Resize the memory block referred to by the pointer at the address ptr, to a hold no elements of type. Returns FALSE if size!=0 and reallocation fails, TRUE otherwise. If reallocation fails, pointer is left to point to old block; a reallocation to a zero size block has the effect of freeing it. The ptr argument must be the address where the pointer to the allocated block is to be stored. |
|
Allocate and initialize memory from another block. Return FALSE if size!=0 and source!=NULL and allocation fails, TRUE otherwise. An allocation of a zero size block returns a NULL pointer. The ptr argument must be the address where the pointer to the allocated block is to be stored. |
|
Free a block of memory allocated with either FXMALLOC, FXCALLOC, FXRESIZE, or FXMEMDUP. It is OK to call free a NULL pointer. The argument must be the address of the pointer to the block to be released. The pointer is set to NULL to prevent any further references to the block after releasing it. |
|
These are some of the ISO C99 standard single-precision transcendental functions. On LINUX, specify _GNU_SOURCE or _ISOC99_SOURCE to enable native implementation; otherwise, these macros will be used. Apple OS-X implements fabsf(x), ceilf(x), floorf(x), and fmodf(x,y). Define FLOAT_MATH_FUNCTIONS if these functions are available in some other library you're linking to. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Simple, thread-safe, random number generator.
|
|
Allocate memory.
|
|
Allocate cleaned memory.
|
|
Resize memory.
|
|
Duplicate memory.
|
|
Free memory, resets ptr to NULL afterward.
|
|
Error routine.
|
|
Warning routine.
|
|
Log message to [typically] stderr.
|
|
Assert failed routine:- usually not called directly but called through FXASSERT.
|
|
Trace printout routine:- usually not called directly but called through FXTRACE.
|
|
Sleep n microseconds.
|
|
Match a file name with a pattern.
|
|
Get highlight color.
|
|
Get shadow color.
|
|
Get process id.
|
|
Convert string of length len to MSDOS; return new string and new length.
|
|
Convert string of length len from MSDOS; return new string and new length.
|
|
Duplicate string.
|
|
Calculate a hash value from a string.
|
|
Get RGB value from color name.
|
|
Get name of (closest) color to RGB.
|
|
Convert RGB to HSV.
|
|
Convert HSV to RGB.
|
|
Floating point number classification: 0=OK, +/-1=Inf, +/-2=NaN.
|
|
|
|
Convert keysym to unicode character.
|
|
Convert unicode character to keysym.
|
|
Parse geometry, a-la X11 geometry specification.
|
|
True if executable with given path is a console application.
|
|
Return wide character from utf8 string at ptr.
|
|
Return wide character from utf16 string at ptr.
|
|
Return number of FXchar's of wide character at ptr.
|
|
Return number of FXnchar's of narrow character at ptr.
|
|
Return start of utf8 character containing position.
|
|
Return start of utf16 character containing position.
|
|
Advance to next utf8 character start.
|
|
Advance to next utf16 character start.
|
|
Retreat to previous utf8 character start.
|
|
Retreat to previous utf16 character start.
|
|
Length of utf8 representation of wide characters string str of length n.
|
|
Length of utf8 representation of wide character string str.
|
|
Length of utf8 representation of narrow characters string str of length n.
|
|
Length of utf8 representation of narrow characters string str.
|
|
Length of wide character representation of utf8 string str of length n.
|
|
Length of wide character representation of utf8 string str.
|
|
Length of narrow character representation of utf8 string str of length n.
|
|
Length of narrow character representation of utf8 string str.
|
|
Copy utf8 string of length n to wide character string dst.
|
|
Copy utf8 string to wide character string dst.
|
|
Copy utf8 string of length n to narrow character string dst.
|
|
Copy utf8 string to narrow character string dst.
|
|
Copy wide character substring of length n to dst.
|
|
Copy wide character string to dst.
|
|
Copy narrow character substring of length n to dst.
|
|
Copy narrow character string to dst.
|
|
Version number that the library has been compiled with.
|
|
Controls tracing level.
|
Copyright © 1997-2005 Jeroen van der Zijp |