1 #ifndef __fox_compat_H__ 2 #define __fox_compat_H__ 3 4 #include "../../config/common.h" 5 6 #if defined(HAVE_LIBFOX) 7 #include <fx.h> 8 #include <fxkeys.h> 9 #else 10 #error no HAVE_LIBFOX defined 11 #endif 12 13 14 #define REZ_FOX_VERSION ((FOX_MAJOR*10000)+(FOX_MINOR*100)+FOX_LEVEL) 15 16 #if FOX_MAJOR<1 17 // no control over ticks before 1.0 18 #define SLIDER_TICKS_LEFT 0 19 #define SLIDER_TICKS_RIGHT 0 20 #define SLIDER_TICKS_TOP 0 21 #define SLIDER_TICKS_BOTTOM 0 22 #endif 23 24 /* fox-1.1.39 change FXApp::runWhileEvents to FXApp::runModalWhileEvents */ 25 #if REZ_FOX_VERSION<10139 26 #define runModalWhileEvents runWhileEvents 27 #endif 28 29 /* 30 * FOX renamed some things at version 1.1.8 and added namespaces 31 * so if the version is older then I rename them back. 32 * Some few years and I can remove these defines 33 */ 34 #if REZ_FOX_VERSION<10108 35 36 #define FOX_NO_NAMESPACE 37 38 #define FXToolTip FXTooltip 39 #define FXToolBar FXToolbar 40 #define FXScrollBar FXScrollbar 41 #define FXMenuBar FXMenubar 42 #define FXStatusBar FXStatusbar 43 #define FXStatusLine FXStatusline 44 #define FXToolBarShell FXToolbarShell 45 #define FXToolBarGrip FXToolbarGrip 46 #define horizontalScrollBar horizontalScrollbar 47 #define verticalScrollBar verticalScrollbar 48 #define getRootWindow getRoot 49 #else 50 51 #define FOX_RESTORE_WINDOW_POSITIONS 52 53 #endif 54 55 #if REZ_FOX_VERSION<10110 56 #define getModality modalModality 57 #endif 58 59 #if REZ_FOX_VERSION<10117 60 #define FXSELID(x) SELID(x) 61 #define FXSELTYPE(x) SELTYPE(x) 62 #define FXSEL(x,y) MKUINT(y,x) 63 #define compat_setFont(f) setTextFont(f) 64 #else 65 #define compat_setFont(f) setFont(f) 66 #endif 67 68 #if REZ_FOX_VERSION<10125 69 #define addTimeout(tgt,sel,ms) addTimeout(ms,tgt,sel) 70 #endif 71 72 #if REZ_FOX_VERSION<10146 73 // 1.1.46 removed the nvis parameter, so I have to supply a zero if fox is older 74 // I always call setNumVisible() now after construction 75 #define FXList(p,tgt,sel,opts) FXList((p),0,(tgt),(sel),(opts)) 76 // ditto (but wasn't mentioned in the News about 1.1.46) 77 #define FXComboBox(p,cols,tgt,sel,opts) FXComboBox((p),(cols),0,(tgt),(sel),(opts)) 78 // ditto (but wasn't mentioned in the News about 1.1.46) 79 #define FXListBox(p,tgt,sel,opts) FXListBox((p),0,(tgt),(sel),(opts)) 80 #endif 81 82 #if REZ_FOX_VERSION>=10506 83 // ~1.5.6 changed the FONTWEIGHT_xxx defines to enums 84 #define FONTWEIGHT_BOLD FXFont::Bold 85 #define FONTWEIGHT_LIGHT FXFont::Light 86 #define FONTWEIGHT_NORMAL FXFont::Normal 87 #define FONTSLANT_REGULAR FXFont::Straight 88 #endif 89 90 91 #if REZ_FOX_VERSION<=10600 92 // ~1.6.0 changed fxparseAccel to just FX::parseAccel 93 #define parseAccel fxparseAccel 94 #define unparseAccel fxunparseAccel 95 #endif 96 97 #if REZ_FOX_VERSION<10600 98 // 1.6.0 changed FXbool to bool through the headesr 99 #define fx_bool FXbool 100 #else 101 #define fx_bool bool 102 #endif 103 104 105 106 107 #endif 108