![]() |
Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members
![]() |
00001 /******************************************************************************** 00002 * * 00003 * FOX Definitions, Types, and Macros * 00004 * * 00005 ********************************************************************************* 00006 * Copyright (C) 1997,2002 by Jeroen van der Zijp. All Rights Reserved. * 00007 ********************************************************************************* 00008 * This library is free software; you can redistribute it and/or * 00009 * modify it under the terms of the GNU Lesser General Public * 00010 * License as published by the Free Software Foundation; either * 00011 * version 2.1 of the License, or (at your option) any later version. * 00012 * * 00013 * This library is distributed in the hope that it will be useful, * 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00016 * Lesser General Public License for more details. * 00017 * * 00018 * You should have received a copy of the GNU Lesser General Public * 00019 * License along with this library; if not, write to the Free Software * 00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * 00021 ********************************************************************************* 00022 * $Id: fxdefs.h,v 1.95.4.2 2002/07/08 17:08:52 fox Exp $ * 00023 ********************************************************************************/ 00024 #ifndef FXDEFS_H 00025 #define FXDEFS_H 00026 00027 00028 /******************************** Definitions ********************************/ 00029 00030 // Truth values 00031 #ifndef TRUE 00032 #define TRUE 1 00033 #endif 00034 #ifndef FALSE 00035 #define FALSE 0 00036 #endif 00037 #ifndef MAYBE 00038 #define MAYBE 2 00039 #endif 00040 #ifndef NULL 00041 #define NULL 0 00042 #endif 00043 00044 #ifndef PI 00045 #define PI 3.1415926535897932384626433833 00046 #endif 00047 00048 /// Euler constant 00049 #define EULER 2.7182818284590452353602874713 00050 00051 /// Multiplier for degrees to radians 00052 #define DTOR 0.0174532925199432957692369077 00053 00054 /// Multipier for radians to degrees 00055 #define RTOD 57.295779513082320876798154814 00056 00057 00058 // Path separator 00059 #ifdef WIN32 00060 #define PATHSEP '\\' 00061 #define PATHSEPSTRING "\\" 00062 #define PATHLISTSEP ';' 00063 #define PATHLISTSEPSTRING ";" 00064 #define ISPATHSEP(c) ((c)=='/' || (c)=='\\') 00065 #else 00066 #define PATHSEP '/' 00067 #define PATHSEPSTRING "/" 00068 #define PATHLISTSEP ':' 00069 #define PATHLISTSEPSTRING ":" 00070 #define ISPATHSEP(c) ((c)=='/') 00071 #endif 00072 00073 00074 // For Windows 00075 #ifdef _DEBUG 00076 #ifndef DEBUG 00077 #define DEBUG 00078 #endif 00079 #endif 00080 #ifdef _NDEBUG 00081 #ifndef NDEBUG 00082 #define NDEBUG 00083 #endif 00084 #endif 00085 00086 00087 // Shared library support 00088 #ifdef WIN32 00089 #ifdef FOXDLL 00090 #ifdef FOXDLL_EXPORTS 00091 #define FXAPI __declspec(dllexport) 00092 #else 00093 #define FXAPI __declspec(dllimport) 00094 #endif 00095 #endif 00096 #endif 00097 00098 #ifndef FXAPI 00099 #define FXAPI 00100 #endif 00101 00102 00103 // Callback 00104 #ifdef WIN32 00105 #ifndef CALLBACK 00106 #define CALLBACK __stdcall 00107 #endif 00108 #endif 00109 00110 00111 // Checking printf and scanf format strings 00112 #if defined(_CC_GNU_) || defined(__GNUG__) || defined(__GNUC__) 00113 #define FX_PRINTF(fmt,arg) __attribute__((format(printf,fmt,arg))) 00114 #define FX_SCANF(fmt,arg) __attribute__((format(scanf,fmt,arg))) 00115 #else 00116 #define FX_PRINTF(fmt,arg) 00117 #define FX_SCANF(fmt,arg) 00118 #endif 00119 00120 00121 // FOX System Defined Selector Types 00122 enum FXSelType { 00123 SEL_NONE, 00124 SEL_KEYPRESS, // Key 00125 SEL_KEYRELEASE, 00126 SEL_LEFTBUTTONPRESS, // Buttons 00127 SEL_LEFTBUTTONRELEASE, 00128 SEL_MIDDLEBUTTONPRESS, 00129 SEL_MIDDLEBUTTONRELEASE, 00130 SEL_RIGHTBUTTONPRESS, 00131 SEL_RIGHTBUTTONRELEASE, 00132 SEL_MOTION, // Mouse motion 00133 SEL_ENTER, 00134 SEL_LEAVE, 00135 SEL_FOCUSIN, 00136 SEL_FOCUSOUT, 00137 SEL_KEYMAP, 00138 SEL_UNGRABBED, // Lost the grab (Windows) 00139 SEL_PAINT, // Must repaint window 00140 SEL_CREATE, 00141 SEL_DESTROY, 00142 SEL_UNMAP, 00143 SEL_MAP, 00144 SEL_CONFIGURE, // Resize 00145 SEL_SELECTION_LOST, // Widget lost selection 00146 SEL_SELECTION_GAINED, // Widget gained selection 00147 SEL_SELECTION_REQUEST, // Inquire selection data 00148 SEL_RAISED, 00149 SEL_LOWERED, 00150 SEL_CLOSE, // Close window 00151 SEL_CLOSEALL, // Close all windows 00152 SEL_DELETE, // Delete window 00153 SEL_MINIMIZE, // Iconified 00154 SEL_RESTORE, // No longer iconified or maximized 00155 SEL_MAXIMIZE, // Maximized 00156 SEL_UPDATE, // GUI update 00157 SEL_COMMAND, // GUI command 00158 SEL_CLICKED, // Clicked 00159 SEL_DOUBLECLICKED, // Double-clicked 00160 SEL_TRIPLECLICKED, // Triple-clicked 00161 SEL_MOUSEWHEEL, // Mouse wheel 00162 SEL_CHANGED, // GUI has changed 00163 SEL_VERIFY, // Verify change 00164 SEL_DESELECTED, // Deselected 00165 SEL_SELECTED, // Selected 00166 SEL_INSERTED, // Inserted 00167 SEL_REPLACED, // Replaced 00168 SEL_DELETED, // Deleted 00169 SEL_OPENED, // Opened 00170 SEL_CLOSED, // Closed 00171 SEL_EXPANDED, // Expanded 00172 SEL_COLLAPSED, // Collapsed 00173 SEL_BEGINDRAG, // Start a drag 00174 SEL_ENDDRAG, // End a drag 00175 SEL_DRAGGED, // Dragged 00176 SEL_LASSOED, // Lassoed 00177 SEL_TIMEOUT, // Timeout occurred 00178 SEL_SIGNAL, // Signal received 00179 SEL_CLIPBOARD_LOST, // Widget lost clipboard 00180 SEL_CLIPBOARD_GAINED, // Widget gained clipboard 00181 SEL_CLIPBOARD_REQUEST, // Inquire clipboard data 00182 SEL_CHORE, // Background chore 00183 SEL_FOCUS_SELF, // Focus on widget itself 00184 SEL_FOCUS_RIGHT, // Focus movements 00185 SEL_FOCUS_LEFT, 00186 SEL_FOCUS_DOWN, 00187 SEL_FOCUS_UP, 00188 SEL_FOCUS_NEXT, 00189 SEL_FOCUS_PREV, 00190 SEL_DND_ENTER, // Drag action entering potential drop target 00191 SEL_DND_LEAVE, // Drag action leaving potential drop target 00192 SEL_DND_DROP, // Drop on drop target 00193 SEL_DND_MOTION, // Drag position changed over potential drop target 00194 SEL_DND_REQUEST, // Inquire drag and drop data 00195 SEL_UNCHECK_OTHER, // Sent by child to parent to uncheck other children 00196 SEL_UNCHECK_RADIO, // Sent by parent to uncheck radio children 00197 SEL_IO_READ, // Read activity on a pipe 00198 SEL_IO_WRITE, // Write activity on a pipe 00199 SEL_IO_EXCEPT, // Except activity on a pipe 00200 SEL_PICKED, // Picked some location 00201 SEL_LAST // Last message 00202 }; 00203 00204 00205 /// FOX Keyboard and Button states 00206 enum { 00207 SHIFTMASK = 0x001, /// Shift key is down 00208 CAPSLOCKMASK = 0x002, /// Caps Lock key is down 00209 CONTROLMASK = 0x004, /// Ctrl key is down 00210 ALTMASK = 0x008, /// Alt key is down 00211 NUMLOCKMASK = 0x010, /// Num Lock key is down 00212 SCROLLLOCKMASK = 0x0E0, /// Scroll Lock key is down (seems to vary) 00213 LEFTBUTTONMASK = 0x100, /// Left mouse button is down 00214 MIDDLEBUTTONMASK = 0x200, /// Middle mouse button is down 00215 RIGHTBUTTONMASK = 0x400 /// Right mouse button is down 00216 }; 00217 00218 00219 /// FOX Mouse buttons 00220 enum { 00221 LEFTBUTTON = 1, 00222 MIDDLEBUTTON = 2, 00223 RIGHTBUTTON = 3 00224 }; 00225 00226 00227 /// FOX window crossing modes 00228 enum { 00229 CROSSINGNORMAL, /// Normal crossing event 00230 CROSSINGGRAB, /// Crossing due to mouse grab 00231 CROSSINGUNGRAB /// Crossing due to mouse ungrab 00232 }; 00233 00234 00235 /// FOX window visibility modes 00236 enum { 00237 VISIBILITYTOTAL, 00238 VISIBILITYPARTIAL, 00239 VISIBILITYNONE 00240 }; 00241 00242 00243 /// Options for fxfilematch 00244 enum { 00245 FILEMATCH_FILE_NAME = 1, /// No wildcard can ever match `/' 00246 FILEMATCH_NOESCAPE = 2, /// Backslashes don't quote special chars 00247 FILEMATCH_PERIOD = 4, /// Leading `.' is matched only explicitly 00248 FILEMATCH_LEADING_DIR = 8, /// Ignore `/...' after a match 00249 FILEMATCH_CASEFOLD = 16 /// Compare without regard to case 00250 }; 00251 00252 00253 /// Drag and drop actions 00254 enum FXDragAction { 00255 DRAG_REJECT = 0, /// Reject all drop actions 00256 DRAG_ACCEPT = 1, /// Accept any drop action 00257 DRAG_COPY = 2, /// Copy 00258 DRAG_MOVE = 3, /// Move 00259 DRAG_LINK = 4, /// Link 00260 DRAG_PRIVATE = 5 /// Private 00261 }; 00262 00263 00264 /// Origin of data 00265 enum FXDNDOrigin { 00266 FROM_SELECTION = 0, /// Primary selection 00267 FROM_CLIPBOARD = 1, /// Clipboard 00268 FROM_DRAGNDROP = 2 /// Drag and drop source 00269 }; 00270 00271 00272 /// Exponent display 00273 enum FXExponent { 00274 EXP_NEVER=FALSE, /// Never use exponential notation 00275 EXP_ALWAYS=TRUE, /// Always use exponential notation 00276 EXP_AUTO=MAYBE /// Use exponential notation if needed 00277 }; 00278 00279 00280 /// Search modes for search/replace dialogs 00281 enum { 00282 SEARCH_FORWARD = 0, /// Search forward (default) 00283 SEARCH_BACKWARD = 1, /// Search backward 00284 SEARCH_NOWRAP = 0, /// Don't wrap (default) 00285 SEARCH_WRAP = 2, /// Wrap around to start 00286 SEARCH_EXACT = 0, /// Exact match (default) 00287 SEARCH_IGNORECASE = 4, /// Ignore case 00288 SEARCH_REGEX = 8, /// Regular expression match 00289 SEARCH_PREFIX = 16 /// Prefix of subject string 00290 }; 00291 00292 00293 /********************************* Typedefs **********************************/ 00294 00295 00296 class FXObject; 00297 class FXStream; 00298 00299 // Streamable types; these are fixed size! 00300 typedef unsigned char FXuchar; 00301 typedef char FXchar; 00302 typedef FXuchar FXbool; 00303 typedef unsigned short FXushort; 00304 typedef short FXshort; 00305 typedef unsigned int FXuint; 00306 typedef int FXint; 00307 typedef float FXfloat; 00308 typedef double FXdouble; 00309 typedef FXObject *FXObjectPtr; 00310 #if defined(_MSC_VER) || (defined(__BCPLUSPLUS__) && __BORLANDC__ > 0x500) 00311 #define FX_LONG 00312 typedef unsigned __int64 FXulong; 00313 typedef __int64 FXlong; 00314 #elif defined(__GNUG__) || defined(__GNUC__) || defined(__SUNPRO_CC) || defined(__MWERKS__) || defined(__SC__) 00315 #define FX_LONG 00316 typedef unsigned long long int FXulong; 00317 typedef long long int FXlong; 00318 #endif 00319 00320 00321 // Handle to something in server 00322 #ifndef WIN32 00323 typedef unsigned int FXID; 00324 #else 00325 typedef void* FXID; 00326 #endif 00327 00328 // Time since January 1, 1970 (UTC) 00329 typedef long FXTime; 00330 00331 // Pixel type (could be color index) 00332 typedef unsigned long FXPixel; 00333 00334 // RGBA pixel value 00335 typedef FXuint FXColor; 00336 00337 // Hot key 00338 typedef FXuint FXHotKey; 00339 00340 // Drag type 00341 #ifndef WIN32 00342 typedef FXID FXDragType; 00343 #else 00344 typedef FXushort FXDragType; 00345 #endif 00346 00347 // Raw event type 00348 #ifndef WIN32 00349 union _XEvent; 00350 typedef _XEvent FXRawEvent; 00351 #else 00352 struct tagMSG; 00353 typedef tagMSG FXRawEvent; 00354 #endif 00355 00356 // Input source handle type 00357 #ifndef WIN32 00358 typedef FXint FXInputHandle; 00359 #else 00360 typedef void* FXInputHandle; 00361 #endif 00362 00363 /********************************** Macros ***********************************/ 00364 00365 00366 /// Abolute value 00367 #define FXABS(val) (((val)>=0)?(val):-(val)) 00368 00369 /// Return the maximum of a or b 00370 #define FXMAX(a,b) (((a)>(b))?(a):(b)) 00371 00372 /// Return the minimum of a or b 00373 #define FXMIN(a,b) (((a)>(b))?(b):(a)) 00374 00375 /// Return the minimum of x, y and z 00376 #define FXMIN3(x,y,z) ((x)<(y)?FXMIN(x,z):FXMIN(y,z)) 00377 00378 /// Return the maximum of x, y and z 00379 #define FXMAX3(x,y,z) ((x)>(y)?FXMAX(x,z):FXMAX(y,z)) 00380 00381 /// Return minimum and maximum of a, b 00382 #define FXMINMAX(lo,hi,a,b) ((a)<(b)?((lo)=(a),(hi)=(b)):((lo)=(b),(hi)=(a))) 00383 00384 /// Clamp value x to range [lo..hi] 00385 #define FXCLAMP(lo,x,hi) ((x)<(lo)?(lo):((x)>(hi)?(hi):(x))) 00386 00387 /// Swap a pair of numbers 00388 #define FXSWAP(a,b,t) ((t)=(a),(a)=(b),(b)=(t)) 00389 00390 /// Linear interpolation between a and b, where 0<=f<=1 00391 #define FXLERP(a,b,f) ((a)+((b)-(a))*(f)) 00392 00393 /// Offset of member in a structure 00394 #define STRUCTOFFSET(str,member) (((char *)(&(((str *)0)->member)))-((char *)0)) 00395 00396 /// Number of elements in a static array 00397 #define ARRAYNUMBER(array) (sizeof(array)/sizeof(array[0])) 00398 00399 /// Container class of a member class 00400 #define CONTAINER(ptr,str,mem) ((str*)(((char*)(ptr))-STRUCTOFFSET(str,mem))) 00401 00402 /// Make int out of two shorts 00403 #define MKUINT(l,h) ((((FXuint)(l))&0xffff) | (((FXuint)(h))<<16)) 00404 00405 /// Get type from selector 00406 #define SELTYPE(s) ((FXushort)(((s)>>16)&0xffff)) 00407 00408 /// Get ID from selector 00409 #define SELID(s) ((FXushort)((s)&0xffff)) 00410 00411 /// Reverse bits in byte 00412 #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)) 00413 00414 // The order in memory is [R G B A] matches that in FXColor 00415 00416 // Definitions for big-endian machines 00417 #if FOX_BIGENDIAN == 1 00418 00419 /// Make RGBA color 00420 #define FXRGBA(r,g,b,a) (((FXuint)(FXuchar)(r)<<24) | ((FXuint)(FXuchar)(g)<<16) | ((FXuint)(FXuchar)(b)<<8) | ((FXuint)(FXuchar)(a))) 00421 00422 /// Make RGB color 00423 #define FXRGB(r,g,b) (((FXuint)(FXuchar)(r)<<24) | ((FXuint)(FXuchar)(g)<<16) | ((FXuint)(FXuchar)(b)<<8) | 0x000000ff) 00424 00425 /// Get red value from RGBA color 00426 #define FXREDVAL(rgba) ((FXuchar)(((rgba)>>24)&0xff)) 00427 00428 /// Get green value from RGBA color 00429 #define FXGREENVAL(rgba) ((FXuchar)(((rgba)>>16)&0xff)) 00430 00431 /// Get blue value from RGBA color 00432 #define FXBLUEVAL(rgba) ((FXuchar)(((rgba)>>8)&0xff)) 00433 00434 /// Get alpha value from RGBA color 00435 #define FXALPHAVAL(rgba) ((FXuchar)((rgba)&0xff)) 00436 00437 /// Get component value of RGBA color 00438 #define FXRGBACOMPVAL(rgba,comp) ((FXuchar)(((rgba)>>((3-(comp))<<3))&0xff)) 00439 00440 #endif 00441 00442 // Definitions for little-endian machines 00443 #if FOX_BIGENDIAN == 0 00444 00445 /// Make RGBA color 00446 #define FXRGBA(r,g,b,a) (((FXuint)(FXuchar)(r)) | ((FXuint)(FXuchar)(g)<<8) | ((FXuint)(FXuchar)(b)<<16) | ((FXuint)(FXuchar)(a)<<24)) 00447 00448 /// Make RGB color 00449 #define FXRGB(r,g,b) (((FXuint)(FXuchar)(r)) | ((FXuint)(FXuchar)(g)<<8) | ((FXuint)(FXuchar)(b)<<16) | 0xff000000) 00450 00451 /// Get red value from RGBA color 00452 #define FXREDVAL(rgba) ((FXuchar)((rgba)&0xff)) 00453 00454 /// Get green value from RGBA color 00455 #define FXGREENVAL(rgba) ((FXuchar)(((rgba)>>8)&0xff)) 00456 00457 /// Get blue value from RGBA color 00458 #define FXBLUEVAL(rgba) ((FXuchar)(((rgba)>>16)&0xff)) 00459 00460 /// Get alpha value from RGBA color 00461 #define FXALPHAVAL(rgba) ((FXuchar)(((rgba)>>24)&0xff)) 00462 00463 /// Get component value of RGBA color 00464 #define FXRGBACOMPVAL(rgba,comp) ((FXuchar)(((rgba)>>((comp)<<3))&0xff)) 00465 00466 #endif 00467 00468 00469 /** 00470 * FXASSERT() prints out a message when the expression fails, 00471 * and nothing otherwise. Unlike assert(), FXASSERT() will not 00472 * terminate the execution of the application. 00473 * When compiling your application for release, all assertions 00474 * are compiled out; thus there is no impact on execution speed. 00475 */ 00476 #ifndef NDEBUG 00477 #define FXASSERT(exp) ((exp)?((void)0):(void)fxassert(#exp,__FILE__,__LINE__)) 00478 #else 00479 #define FXASSERT(exp) ((void)0) 00480 #endif 00481 00482 00483 /** 00484 * FXTRACE() allows you to trace the execution of your application 00485 * with increasing levels of detail the higher the trace level. 00486 * The trace level is determined by variable fxTraceLevel, which 00487 * may be set from the command line with "-tracelevel <level>". 00488 * When compiling your application for release, all trace statements 00489 * are compiled out, just like FXASSERT. 00490 * A statement like: FXTRACE((10,"The value of x=%d\n",x)) will 00491 * generate output only if fxTraceLevel is set to 11 or greater. 00492 * The default value fxTraceLevel=0 will block all trace outputs. 00493 * Note the double parentheses! 00494 */ 00495 #ifndef NDEBUG 00496 #define FXTRACE(arguments) fxtrace arguments 00497 #else 00498 #define FXTRACE(arguments) ((void)0) 00499 #endif 00500 00501 00502 /// Allocate no elements of type to the specified pointer 00503 #define FXMALLOC(ptr,type,no) (fxmalloc((void **)(ptr),sizeof(type)*(no))) 00504 00505 /// Allocate cleared memory 00506 #define FXCALLOC(ptr,type,no) (fxcalloc((void **)(ptr),sizeof(type)*(no))) 00507 00508 /// Resize a previously allocated block of memory 00509 #define FXRESIZE(ptr,type,no) (fxresize((void **)(ptr),sizeof(type)*(no))) 00510 00511 /// Allocate and initialize memory 00512 #define FXMEMDUP(ptr,type,src,no) (fxmemdup((void **)(ptr),sizeof(type)*(no),(const void*)(src))) 00513 00514 /// Free a block of memory allocated with either FXMALLOC or FXCALLOC 00515 #define FXFREE(ptr) (fxfree((void **)(ptr))) 00516 00517 00518 /********************************** Globals **********************************/ 00519 00520 00521 /// Simple, thread-safe, random number generator 00522 extern FXAPI FXuint fxrandom(FXuint& seed); 00523 00524 /// Allocate memory 00525 extern FXAPI FXint fxmalloc(void** ptr,unsigned long size); 00526 00527 /// Allocate cleaned memory 00528 extern FXAPI FXint fxcalloc(void** ptr,unsigned long size); 00529 00530 /// Resize memory 00531 extern FXAPI FXint fxresize(void** ptr,unsigned long size); 00532 00533 /// Duplicate memory 00534 extern FXAPI FXint fxmemdup(void** ptr,unsigned long size,const void* src); 00535 00536 /// Free memory, resets ptr to NULL afterward 00537 extern FXAPI void fxfree(void** ptr); 00538 00539 /// Error routine 00540 extern FXAPI void fxerror(const char* format,...) FX_PRINTF(1,2) ; 00541 00542 /// Warning routine 00543 extern FXAPI void fxwarning(const char* format,...) FX_PRINTF(1,2) ; 00544 00545 /// Log message to [typically] stderr 00546 extern FXAPI void fxmessage(const char* format,...) FX_PRINTF(1,2) ; 00547 00548 /// Assert failed routine:- usually not called directly but called through FXASSERT 00549 extern FXAPI void fxassert(const char* expression,const char* filename,unsigned int lineno); 00550 00551 /// Trace printout routine:- usually not called directly but called through FXTRACE 00552 extern FXAPI void fxtrace(unsigned int level,const char* format,...) FX_PRINTF(2,3) ; 00553 00554 /// Sleep n microseconds 00555 extern FXAPI void fxsleep(unsigned int n); 00556 00557 /// Match a file name with a pattern 00558 extern FXAPI FXint fxfilematch(const char *pattern,const char *string,FXuint flags=(FILEMATCH_NOESCAPE|FILEMATCH_FILE_NAME)); 00559 00560 /// Parse for accelerator key codes in a string 00561 extern FXAPI FXHotKey fxparseaccel(const FXchar* s); 00562 00563 /// Parse for hot key codes in a string 00564 extern FXAPI FXHotKey fxparsehotkey(const FXchar* s); 00565 00566 /// Locate hot key underline offset from begin of string 00567 extern FXAPI FXint fxfindhotkeyoffset(const FXchar* s); 00568 00569 /// Get highlight color 00570 extern FXAPI FXColor makeHiliteColor(FXColor clr); 00571 00572 /// Get shadow color 00573 extern FXAPI FXColor makeShadowColor(FXColor clr); 00574 00575 /// Get user name from uid 00576 extern FXAPI FXchar* fxgetusername(FXchar* result,FXuint uid); 00577 00578 /// Get group name from gid 00579 extern FXAPI FXchar* fxgetgroupname(FXchar* result,FXuint gid); 00580 00581 /// Get permissions string from mode. 00582 extern FXAPI FXchar* fxgetpermissions(FXchar* result,FXuint mode); 00583 00584 /// Get process id 00585 extern FXAPI FXint fxgetpid(); 00586 00587 /// Duplicate string 00588 extern FXAPI FXchar *fxstrdup(const FXchar* str); 00589 00590 /// Calculate a hash value from a string 00591 extern FXAPI FXint fxstrhash(const FXchar* str); 00592 00593 /// Get RGB value from color name 00594 extern FXAPI FXColor fxcolorfromname(const FXchar* colorname); 00595 00596 /// Get name of (closest) color to RGB 00597 extern FXAPI FXchar* fxnamefromcolor(FXchar *colorname,FXColor color); 00598 00599 /// Convert RGB to HSV 00600 extern FXAPI void fxrgb_to_hsv(FXfloat& h,FXfloat& s,FXfloat& v,FXfloat r,FXfloat g,FXfloat b); 00601 00602 /// Convert HSV to RGB 00603 extern FXAPI void fxhsv_to_rgb(FXfloat& r,FXfloat& g,FXfloat& b,FXfloat h,FXfloat s,FXfloat v); 00604 00605 /// Floating point number classification: 0=OK, +/-1=Inf, +/-2=NaN 00606 extern FXAPI FXint fxieeefloatclass(FXfloat number); 00607 extern FXAPI FXint fxieeedoubleclass(FXdouble number); 00608 00609 00610 /// Version number that the library has been compiled with 00611 extern FXAPI const FXuchar fxversion[3]; 00612 00613 00614 /// Controls tracing level 00615 extern FXAPI unsigned int fxTraceLevel; 00616 00617 00618 #endif