defs.h 116 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544
  1. /*
  2. * Name: wx/defs.h
  3. * Purpose: Declarations/definitions common to all wx source files
  4. * Author: Julian Smart and others
  5. * Modified by: Ryan Norton (Converted to C)
  6. * Created: 01/02/97
  7. * Copyright: (c) Julian Smart
  8. * Licence: wxWindows licence
  9. */
  10. /* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */
  11. #ifndef _WX_DEFS_H_
  12. #define _WX_DEFS_H_
  13. /*
  14. NOTE: this symbol will be replaced with "WXWIN_COMPATIBILITY_3_0" as soon
  15. as the development branch for 3.1 is created
  16. */
  17. #define FUTURE_WXWIN_COMPATIBILITY_3_0 1
  18. #define wxDEPRECATED_FUTURE( x ) x
  19. /* ---------------------------------------------------------------------------- */
  20. /* compiler and OS identification */
  21. /* ---------------------------------------------------------------------------- */
  22. #include "wx/platform.h"
  23. #ifdef __cplusplus
  24. /* Make sure the environment is set correctly */
  25. # if defined(__WXMSW__) && defined(__X__)
  26. # error "Target can't be both X and MSW"
  27. # elif !defined(__WXMOTIF__) && \
  28. !defined(__WXMSW__) && \
  29. !defined(__WXGTK__) && \
  30. !defined(__WXPM__) && \
  31. !defined(__WXOSX_CARBON__) && \
  32. !defined(__WXOSX_COCOA__) && \
  33. !defined(__WXOSX_IPHONE__) && \
  34. !defined(__WXCOCOA__) && \
  35. !defined(__X__) && \
  36. !defined(__WXDFB__) && \
  37. !defined(__WXX11__) && \
  38. wxUSE_GUI
  39. # ifdef __UNIX__
  40. # error "No Target! You should use wx-config program for compilation flags!"
  41. # else /* !Unix */
  42. # error "No Target! You should use supplied makefiles for compilation!"
  43. # endif /* Unix/!Unix */
  44. # endif
  45. #endif /*__cplusplus*/
  46. #ifndef __WXWINDOWS__
  47. #define __WXWINDOWS__ 1
  48. #endif
  49. #ifndef wxUSE_BASE
  50. /* by default consider that this is a monolithic build */
  51. #define wxUSE_BASE 1
  52. #endif
  53. #if !wxUSE_GUI && !defined(__WXBASE__)
  54. #define __WXBASE__
  55. #endif
  56. /* suppress some Visual C++ warnings */
  57. #ifdef __VISUALC__
  58. /* the only "real" warning here is 4244 but there are just too many of them */
  59. /* in our code... one day someone should go and fix them but until then... */
  60. # pragma warning(disable:4097) /* typedef used as class */
  61. # pragma warning(disable:4201) /* nonstandard extension used: nameless struct/union */
  62. # pragma warning(disable:4244) /* conversion from double to float */
  63. # pragma warning(disable:4355) /* 'this' used in base member initializer list */
  64. # pragma warning(disable:4511) /* copy ctor couldn't be generated */
  65. # pragma warning(disable:4512) /* operator=() couldn't be generated */
  66. # pragma warning(disable:4514) /* unreferenced inline func has been removed */
  67. # pragma warning(disable:4710) /* function not inlined */
  68. /*
  69. TODO: this warning should really be enabled as it can be genuinely
  70. useful, check where does it occur in wxWidgets
  71. */
  72. #pragma warning(disable: 4127) /* conditional expression is constant */
  73. /* There are too many false positivies for this one, particularly when
  74. using templates like wxVector<T> */
  75. /* class 'foo' needs to have dll-interface to be used by clients of
  76. class 'bar'" */
  77. # pragma warning(disable:4251)
  78. /*
  79. This is a similar warning which occurs when deriving from standard
  80. containers. MSDN even mentions that it can be ignored in this case
  81. (albeit only in debug build while the warning is the same in release
  82. too and seems equally harmless).
  83. */
  84. #if wxUSE_STD_CONTAINERS
  85. # pragma warning(disable:4275)
  86. #endif /* wxUSE_STD_CONTAINERS */
  87. # ifdef __VISUALC5__
  88. /* For VC++ 5.0 for release mode, the warning 'C4702: unreachable code */
  89. /* is buggy, and occurs for code that does actually get executed */
  90. # ifndef __WXDEBUG__
  91. # pragma warning(disable:4702) /* unreachable code */
  92. # endif
  93. /* The VC++ 5.0 warning 'C4003: not enough actual parameters for macro'
  94. * is incompatible with the wxWidgets headers since it is given when
  95. * parameters are empty but not missing. */
  96. # pragma warning(disable:4003) /* not enough actual parameters for macro */
  97. # endif
  98. /*
  99. VC6 insists on complaining about
  100. return type for 'wxVector<T>::reverse_iterator::operator ->' is 'T **'
  101. (ie; not a UDT or reference to a UDT. Will produce errors if applied
  102. using infix notation)
  103. which is perfectly fine because template classes do routinely define
  104. operators which don't make sense for all template parameter values
  105. (besides this warning was removed in subsequent versions).
  106. */
  107. #ifdef __VISUALC6__
  108. #pragma warning(disable: 4284)
  109. #endif /* VC6 */
  110. /*
  111. When compiling with VC++ 7 /Wp64 option we get thousands of warnings for
  112. conversion from size_t to int or long. Some precious few of them might
  113. be worth looking into but unfortunately it seems infeasible to fix all
  114. the other, harmless ones (e.g. inserting static_cast<int>(s.length())
  115. everywhere this method is used though we are quite sure that using >4GB
  116. strings is a bad idea anyhow) so just disable it globally for now.
  117. */
  118. #if wxCHECK_VISUALC_VERSION(7)
  119. /* conversion from 'size_t' to 'unsigned long', possible loss of data */
  120. #pragma warning(disable:4267)
  121. #endif /* VC++ 7 or later */
  122. /*
  123. VC++ 8 gives a warning when using standard functions such as sprintf,
  124. localtime, ... -- stop this madness, unless the user had already done it
  125. */
  126. #if wxCHECK_VISUALC_VERSION(8)
  127. #ifndef _CRT_SECURE_NO_DEPRECATE
  128. #define _CRT_SECURE_NO_DEPRECATE 1
  129. #endif
  130. #ifndef _CRT_NON_CONFORMING_SWPRINTFS
  131. #define _CRT_NON_CONFORMING_SWPRINTFS 1
  132. #endif
  133. #ifndef _SCL_SECURE_NO_WARNINGS
  134. #define _SCL_SECURE_NO_WARNINGS 1
  135. #endif
  136. #endif /* VC++ 8 */
  137. #endif /* __VISUALC__ */
  138. /* suppress some Borland C++ warnings */
  139. #ifdef __BORLANDC__
  140. # pragma warn -inl /* Functions containing reserved words and certain constructs are not expanded inline */
  141. #endif /* __BORLANDC__ */
  142. /*
  143. g++ gives a warning when a class has private dtor if it has no friends but
  144. this is a perfectly valid situation for a ref-counted class which destroys
  145. itself when its ref count drops to 0, so provide a macro to suppress this
  146. warning
  147. */
  148. #ifdef __GNUG__
  149. # define wxSUPPRESS_GCC_PRIVATE_DTOR_WARNING(name) \
  150. friend class wxDummyFriendFor ## name;
  151. #else /* !g++ */
  152. # define wxSUPPRESS_GCC_PRIVATE_DTOR_WARNING(name)
  153. #endif
  154. /*
  155. Clang Support
  156. */
  157. #ifndef WX_HAS_CLANG_FEATURE
  158. # ifndef __has_feature
  159. # define WX_HAS_CLANG_FEATURE(x) 0
  160. # else
  161. # define WX_HAS_CLANG_FEATURE(x) __has_feature(x)
  162. # endif
  163. #endif
  164. /* ---------------------------------------------------------------------------- */
  165. /* wxWidgets version and compatibility defines */
  166. /* ---------------------------------------------------------------------------- */
  167. #include "wx/version.h"
  168. /* ============================================================================ */
  169. /* non portable C++ features */
  170. /* ============================================================================ */
  171. /* ---------------------------------------------------------------------------- */
  172. /* compiler defects workarounds */
  173. /* ---------------------------------------------------------------------------- */
  174. /*
  175. Digital Unix C++ compiler only defines this symbol for .cxx and .hxx files,
  176. so define it ourselves (newer versions do it for all files, though, and
  177. don't allow it to be redefined)
  178. */
  179. #if defined(__DECCXX) && !defined(__VMS) && !defined(__cplusplus)
  180. #define __cplusplus
  181. #endif /* __DECCXX */
  182. /* Resolves linking problems under HP-UX when compiling with gcc/g++ */
  183. #if defined(__HPUX__) && defined(__GNUG__)
  184. #define va_list __gnuc_va_list
  185. #endif /* HP-UX */
  186. /* Prevents conflicts between sys/types.h and winsock.h with Cygwin, */
  187. /* when using Windows sockets. */
  188. #if defined(__CYGWIN__) && defined(__WINDOWS__)
  189. #define __USE_W32_SOCKETS
  190. #endif
  191. /* ---------------------------------------------------------------------------- */
  192. /* check for native bool type and TRUE/FALSE constants */
  193. /* ---------------------------------------------------------------------------- */
  194. /* for backwards compatibility, also define TRUE and FALSE */
  195. /* */
  196. /* note that these definitions should work both in C++ and C code, so don't */
  197. /* use true/false below */
  198. #ifndef TRUE
  199. #define TRUE 1
  200. #endif
  201. #ifndef FALSE
  202. #define FALSE 0
  203. #endif
  204. typedef short int WXTYPE;
  205. /* ---------------------------------------------------------------------------- */
  206. /* other feature tests */
  207. /* ---------------------------------------------------------------------------- */
  208. /* Every ride down a slippery slope begins with a single step.. */
  209. /* */
  210. /* Yes, using nested classes is indeed against our coding standards in */
  211. /* general, but there are places where you can use them to advantage */
  212. /* without totally breaking ports that cannot use them. If you do, then */
  213. /* wrap it in this guard, but such cases should still be relatively rare. */
  214. #define wxUSE_NESTED_CLASSES 1
  215. /* check for explicit keyword support */
  216. #ifndef HAVE_EXPLICIT
  217. #if defined(__VISUALC__) && (__VISUALC__ >= 1100)
  218. /* VC++ 6.0 and 5.0 have explicit (what about earlier versions?) */
  219. #define HAVE_EXPLICIT
  220. #elif ( defined(__MINGW32__) || defined(__CYGWIN32__) ) \
  221. && wxCHECK_GCC_VERSION(2, 95)
  222. /* GCC 2.95 has explicit, what about earlier versions? */
  223. #define HAVE_EXPLICIT
  224. #elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x0520)
  225. /* BC++ 4.52 doesn't support explicit, CBuilder 1 does */
  226. #define HAVE_EXPLICIT
  227. #elif defined(__DIGITALMARS__)
  228. #define HAVE_EXPLICIT
  229. #elif defined(__WATCOMC__)
  230. #define HAVE_EXPLICIT
  231. #endif
  232. #endif /* !HAVE_EXPLICIT */
  233. #ifdef HAVE_EXPLICIT
  234. #define wxEXPLICIT explicit
  235. #else /* !HAVE_EXPLICIT */
  236. #define wxEXPLICIT
  237. #endif /* HAVE_EXPLICIT/!HAVE_EXPLICIT */
  238. /* these macros are obsolete, use the standard C++ casts directly now */
  239. #define wx_static_cast(t, x) static_cast<t>(x)
  240. #define wx_const_cast(t, x) const_cast<t>(x)
  241. #define wx_reinterpret_cast(t, x) reinterpret_cast<t>(x)
  242. /*
  243. This one is a wx invention: like static cast but used when we intentionally
  244. truncate from a larger to smaller type, static_cast<> can't be used for it
  245. as it results in warnings when using some compilers (SGI mipspro for example)
  246. */
  247. #if defined(__INTELC__) && defined(__cplusplus)
  248. template <typename T, typename X>
  249. inline T wx_truncate_cast_impl(X x)
  250. {
  251. #pragma warning(push)
  252. /* implicit conversion of a 64-bit integral type to a smaller integral type */
  253. #pragma warning(disable: 1682)
  254. /* conversion from "X" to "T" may lose significant bits */
  255. #pragma warning(disable: 810)
  256. /* non-pointer conversion from "foo" to "bar" may lose significant bits */
  257. #pragma warning(disable: 2259)
  258. return x;
  259. #pragma warning(pop)
  260. }
  261. #define wx_truncate_cast(t, x) wx_truncate_cast_impl<t>(x)
  262. #elif defined(__cplusplus) && defined(__VISUALC__) && __VISUALC__ >= 1310
  263. template <typename T, typename X>
  264. inline T wx_truncate_cast_impl(X x)
  265. {
  266. #pragma warning(push)
  267. /* conversion from 'size_t' to 'type', possible loss of data */
  268. #pragma warning(disable: 4267)
  269. /* conversion from 'type1' to 'type2', possible loss of data */
  270. #pragma warning(disable: 4242)
  271. return x;
  272. #pragma warning(pop)
  273. }
  274. #define wx_truncate_cast(t, x) wx_truncate_cast_impl<t>(x)
  275. #else
  276. #define wx_truncate_cast(t, x) ((t)(x))
  277. #endif
  278. /* for consistency with wxStatic/DynamicCast defined in wx/object.h */
  279. #define wxConstCast(obj, className) wx_const_cast(className *, obj)
  280. #ifndef HAVE_STD_WSTRING
  281. #if defined(__VISUALC__) && (__VISUALC__ >= 1100)
  282. /* VC++ 6.0 and 5.0 have std::wstring (what about earlier versions?) */
  283. #define HAVE_STD_WSTRING
  284. #elif defined(__MINGW32__) && wxCHECK_GCC_VERSION(3, 3)
  285. /* GCC 3.1 has std::wstring; 3.0 never was in MinGW, 2.95 hasn't it */
  286. #define HAVE_STD_WSTRING
  287. #endif
  288. #endif
  289. #ifndef HAVE_STD_STRING_COMPARE
  290. #if defined(__VISUALC__) && (__VISUALC__ >= 1100)
  291. /* VC++ 6.0 and 5.0 have std::string::compare */
  292. /* (what about earlier versions?) */
  293. #define HAVE_STD_STRING_COMPARE
  294. #elif ( defined(__MINGW32__) || defined(__CYGWIN32__) ) \
  295. && wxCHECK_GCC_VERSION(3, 1)
  296. /* GCC 3.1 has std::string::compare; */
  297. /* 3.0 never was in MinGW, 2.95 hasn't it */
  298. #define HAVE_STD_STRING_COMPARE
  299. #endif
  300. #endif
  301. #ifndef HAVE_TR1_TYPE_TRAITS
  302. #if defined(__VISUALC__) && (_MSC_FULL_VER >= 150030729)
  303. #define HAVE_TR1_TYPE_TRAITS
  304. #endif
  305. #endif
  306. #if defined(__has_include)
  307. /*
  308. Notice that we trust our configure tests more than __has_include(),
  309. notably the latter can return true even if the header exists but isn't
  310. actually usable, as it happens with <type_traits> in non C++11 mode.
  311. So if configure already detected at least one working alternative,
  312. just use it.
  313. */
  314. #if !defined(HAVE_TYPE_TRAITS) && !defined(HAVE_TR1_TYPE_TRAITS)
  315. #if __has_include(<type_traits>)
  316. #define HAVE_TYPE_TRAITS
  317. #elif __has_include(<tr1/type_traits>)
  318. #define HAVE_TR1_TYPE_TRAITS
  319. #endif
  320. #endif
  321. #if !defined(HAVE_STD_UNORDERED_MAP) && !defined(HAVE_TR1_UNORDERED_MAP)
  322. #if __has_include(<unordered_map>)
  323. #define HAVE_STD_UNORDERED_MAP
  324. #elif __has_include(<tr1/unordered_map>)
  325. #define HAVE_TR1_UNORDERED_MAP
  326. #endif
  327. #endif
  328. #if !defined(HAVE_STD_UNORDERED_SET) && !defined(HAVE_TR1_UNORDERED_SET)
  329. #if __has_include(<unordered_set>)
  330. #define HAVE_STD_UNORDERED_SET
  331. #elif __has_include(<tr1/unordered_set>)
  332. #define HAVE_TR1_UNORDERED_SET
  333. #endif
  334. #endif
  335. #endif /* defined(__has_include) */
  336. /* provide replacement for C99 va_copy() if the compiler doesn't have it */
  337. /* could be already defined by configure or the user */
  338. #ifndef wxVaCopy
  339. /* if va_copy is a macro or configure detected that we have it, use it */
  340. #if defined(va_copy) || defined(HAVE_VA_COPY)
  341. #define wxVaCopy va_copy
  342. #else /* no va_copy, try to provide a replacement */
  343. /*
  344. configure tries to determine whether va_list is an array or struct
  345. type, but it may not be used under Windows, so deal with a few
  346. special cases.
  347. */
  348. #ifdef __WATCOMC__
  349. /* Watcom uses array type for va_list except for PPC and Alpha */
  350. #if !defined(__PPC__) && !defined(__AXP__)
  351. #define VA_LIST_IS_ARRAY
  352. #endif
  353. #endif /* __WATCOMC__ */
  354. #if defined(__PPC__) && (defined(_CALL_SYSV) || defined (_WIN32))
  355. /*
  356. PPC using SysV ABI and NT/PPC are special in that they use an
  357. extra level of indirection.
  358. */
  359. #define VA_LIST_IS_POINTER
  360. #endif /* SysV or Win32 on __PPC__ */
  361. /*
  362. note that we use memmove(), not memcpy(), in case anybody tries
  363. to do wxVaCopy(ap, ap)
  364. */
  365. #if defined(VA_LIST_IS_POINTER)
  366. #define wxVaCopy(d, s) memmove(*(d), *(s), sizeof(va_list))
  367. #elif defined(VA_LIST_IS_ARRAY)
  368. #define wxVaCopy(d, s) memmove((d), (s), sizeof(va_list))
  369. #else /* we can only hope that va_lists are simple lvalues */
  370. #define wxVaCopy(d, s) ((d) = (s))
  371. #endif
  372. #endif /* va_copy/!va_copy */
  373. #endif /* wxVaCopy */
  374. #ifndef HAVE_WOSTREAM
  375. /*
  376. Mingw <= 3.4 and all versions of Cygwin don't have std::wostream
  377. */
  378. #if (defined(__MINGW32__) && !wxCHECK_GCC_VERSION(4, 0)) || \
  379. defined(__CYGWIN__)
  380. #define wxNO_WOSTREAM
  381. #endif
  382. /* VC++ doesn't have it in the old iostream library */
  383. #if defined(__VISUALC__) && wxUSE_IOSTREAMH
  384. #define wxNO_WOSTREAM
  385. #endif
  386. #ifndef wxNO_WOSTREAM
  387. #define HAVE_WOSTREAM
  388. #endif
  389. #undef wxNO_WOSTREAM
  390. #endif /* HAVE_WOSTREAM */
  391. /* ---------------------------------------------------------------------------- */
  392. /* other C++ features */
  393. /* ---------------------------------------------------------------------------- */
  394. #ifndef HAVE_PARTIAL_SPECIALIZATION
  395. /* be optimistic by default */
  396. #define HAVE_PARTIAL_SPECIALIZATION
  397. #endif
  398. #ifdef __VISUALC__
  399. #if __VISUALC__ < 1310
  400. #undef HAVE_PARTIAL_SPECIALIZATION
  401. #endif
  402. #endif /* __VISUALC__ */
  403. #ifndef HAVE_TEMPLATE_OVERLOAD_RESOLUTION
  404. /* assume the compiler can use type or const expressions as template
  405. arguments if it supports partial specialization -- except if it's a
  406. Borland one which can't */
  407. #if defined(HAVE_PARTIAL_SPECIALIZATION) && !defined(__BORLANDC__)
  408. #define HAVE_TEMPLATE_OVERLOAD_RESOLUTION
  409. #endif /* (HAVE_PARTIAL_SPECIALIZATION) && !defined(__BORLANDC__) */
  410. #endif /* !defined(HAVE_TEMPLATE_OVERLOAD_RESOLUTION) */
  411. /* ---------------------------------------------------------------------------- */
  412. /* portable calling conventions macros */
  413. /* ---------------------------------------------------------------------------- */
  414. /* stdcall is used for all functions called by Windows under Windows */
  415. #if defined(__WINDOWS__)
  416. #if defined(__GNUWIN32__)
  417. #define wxSTDCALL __attribute__((stdcall))
  418. #else
  419. /* both VC++ and Borland understand this */
  420. #define wxSTDCALL _stdcall
  421. #endif
  422. #else /* Win */
  423. /* no such stupidness under Unix */
  424. #define wxSTDCALL
  425. #endif /* platform */
  426. /* LINKAGEMODE mode is empty for everything except OS/2 */
  427. #ifndef LINKAGEMODE
  428. #define LINKAGEMODE
  429. #endif /* LINKAGEMODE */
  430. /* wxCALLBACK should be used for the functions which are called back by */
  431. /* Windows (such as compare function for wxListCtrl) */
  432. #if defined(__WIN32__) && !defined(__WXMICROWIN__)
  433. #define wxCALLBACK wxSTDCALL
  434. #else
  435. /* no stdcall under Unix nor Win16 */
  436. #define wxCALLBACK
  437. #endif /* platform */
  438. /* generic calling convention for the extern "C" functions */
  439. #if defined(__VISUALC__)
  440. #define wxC_CALLING_CONV _cdecl
  441. #elif defined(__VISAGECPP__)
  442. #define wxC_CALLING_CONV _Optlink
  443. #else /* !Visual C++ */
  444. #define wxC_CALLING_CONV
  445. #endif /* compiler */
  446. /* callling convention for the qsort(3) callback */
  447. #define wxCMPFUNC_CONV wxC_CALLING_CONV
  448. /* compatibility :-( */
  449. #define CMPFUNC_CONV wxCMPFUNC_CONV
  450. /* DLL import/export declarations */
  451. #include "wx/dlimpexp.h"
  452. /* ---------------------------------------------------------------------------- */
  453. /* Very common macros */
  454. /* ---------------------------------------------------------------------------- */
  455. /* Printf-like attribute definitions to obtain warnings with GNU C/C++ */
  456. #ifndef WX_ATTRIBUTE_PRINTF
  457. # if defined(__GNUC__) && !wxUSE_UNICODE
  458. # define WX_ATTRIBUTE_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n)))
  459. # else
  460. # define WX_ATTRIBUTE_PRINTF(m, n)
  461. # endif
  462. # define WX_ATTRIBUTE_PRINTF_1 WX_ATTRIBUTE_PRINTF(1, 2)
  463. # define WX_ATTRIBUTE_PRINTF_2 WX_ATTRIBUTE_PRINTF(2, 3)
  464. # define WX_ATTRIBUTE_PRINTF_3 WX_ATTRIBUTE_PRINTF(3, 4)
  465. # define WX_ATTRIBUTE_PRINTF_4 WX_ATTRIBUTE_PRINTF(4, 5)
  466. # define WX_ATTRIBUTE_PRINTF_5 WX_ATTRIBUTE_PRINTF(5, 6)
  467. #endif /* !defined(WX_ATTRIBUTE_PRINTF) */
  468. #ifndef WX_ATTRIBUTE_NORETURN
  469. # if WX_HAS_CLANG_FEATURE(attribute_analyzer_noreturn)
  470. # define WX_ATTRIBUTE_NORETURN __attribute__((analyzer_noreturn))
  471. # elif defined( __GNUC__ )
  472. # define WX_ATTRIBUTE_NORETURN __attribute__ ((noreturn))
  473. # elif wxCHECK_VISUALC_VERSION(7)
  474. # define WX_ATTRIBUTE_NORETURN __declspec(noreturn)
  475. # else
  476. # define WX_ATTRIBUTE_NORETURN
  477. # endif
  478. #endif
  479. #if defined(__GNUC__)
  480. #define WX_ATTRIBUTE_UNUSED __attribute__ ((unused))
  481. #else
  482. #define WX_ATTRIBUTE_UNUSED
  483. #endif
  484. /*
  485. Macros for marking functions as being deprecated.
  486. The preferred macro in the new code is wxDEPRECATED_MSG() which allows to
  487. explain why is the function deprecated. Almost all the existing code uses
  488. the older wxDEPRECATED() or its variants currently, but this will hopefully
  489. change in the future.
  490. */
  491. /* The basic compiler-specific construct to generate a deprecation warning. */
  492. #ifdef __clang__
  493. #define wxDEPRECATED_DECL __attribute__((deprecated))
  494. #elif wxCHECK_GCC_VERSION(3, 1)
  495. #define wxDEPRECATED_DECL __attribute__((deprecated))
  496. #elif defined(__VISUALC__) && (__VISUALC__ >= 1300)
  497. #define wxDEPRECATED_DECL __declspec(deprecated)
  498. #else
  499. #define wxDEPRECATED_DECL
  500. #endif
  501. /*
  502. Macro taking the deprecation message. It applies to the next declaration.
  503. If the compiler doesn't support showing the message, this degrades to a
  504. simple wxDEPRECATED(), i.e. at least gives a warning, if possible.
  505. */
  506. #if defined(__clang__) && defined(__has_extension)
  507. #if __has_extension(attribute_deprecated_with_message)
  508. #define wxDEPRECATED_MSG(msg) __attribute__((deprecated(msg)))
  509. #else
  510. #define wxDEPRECATED_MSG(msg) __attribute__((deprecated))
  511. #endif
  512. #elif wxCHECK_GCC_VERSION(4, 5)
  513. #define wxDEPRECATED_MSG(msg) __attribute__((deprecated(msg)))
  514. #elif wxCHECK_VISUALC_VERSION(8)
  515. #define wxDEPRECATED_MSG(msg) __declspec(deprecated("deprecated: " msg))
  516. #else
  517. #define wxDEPRECATED_MSG(msg) wxDEPRECATED_DECL
  518. #endif
  519. /*
  520. Macro taking the declaration that it deprecates. Prefer to use
  521. wxDEPRECATED_MSG() instead as it's simpler (wrapping the entire declaration
  522. makes the code unclear) and allows to specify the explanation.
  523. */
  524. #define wxDEPRECATED(x) wxDEPRECATED_DECL x
  525. #if defined(__GNUC__) && !wxCHECK_GCC_VERSION(3, 4)
  526. /*
  527. We need to add dummy "inline" to allow gcc < 3.4 to handle the
  528. deprecation attribute on the constructors.
  529. */
  530. #define wxDEPRECATED_CONSTRUCTOR(x) wxDEPRECATED( inline x)
  531. #else
  532. #define wxDEPRECATED_CONSTRUCTOR(x) wxDEPRECATED(x)
  533. #endif
  534. /*
  535. Macro which marks the function as being deprecated but also defines it
  536. inline.
  537. Currently it's defined in the same trivial way in all cases but it could
  538. need a special definition with some other compilers in the future which
  539. explains why do we have it.
  540. */
  541. #define wxDEPRECATED_INLINE(func, body) wxDEPRECATED(func) { body }
  542. /*
  543. A macro to define a simple deprecated accessor.
  544. */
  545. #define wxDEPRECATED_ACCESSOR(func, what) wxDEPRECATED_INLINE(func, return what;)
  546. /*
  547. Special variant of the macro above which should be used for the functions
  548. which are deprecated but called by wx itself: this often happens with
  549. deprecated virtual functions which are called by the library.
  550. */
  551. #ifdef WXBUILDING
  552. # define wxDEPRECATED_BUT_USED_INTERNALLY(x) x
  553. #else
  554. # define wxDEPRECATED_BUT_USED_INTERNALLY(x) wxDEPRECATED(x)
  555. #endif
  556. /*
  557. Macros to suppress and restore gcc warnings, requires g++ >= 4.6 and don't
  558. do anything otherwise.
  559. Example of use:
  560. wxGCC_WARNING_SUPPRESS(float-equal)
  561. inline bool wxIsSameDouble(double x, double y) { return x == y; }
  562. wxGCC_WARNING_RESTORE(float-equal)
  563. */
  564. #if wxCHECK_GCC_VERSION(4, 6)
  565. # define wxGCC_WARNING_SUPPRESS(x) \
  566. _Pragma (wxSTRINGIZE(GCC diagnostic push)) \
  567. _Pragma (wxSTRINGIZE(GCC diagnostic ignored wxSTRINGIZE(wxCONCAT(-W,x))))
  568. # define wxGCC_WARNING_RESTORE(x) \
  569. _Pragma (wxSTRINGIZE(GCC diagnostic pop))
  570. #else /* gcc < 4.6 or not gcc at all */
  571. # define wxGCC_WARNING_SUPPRESS(x)
  572. # define wxGCC_WARNING_RESTORE(x)
  573. #endif
  574. /*
  575. Combination of the two variants above: should be used for deprecated
  576. functions which are defined inline and are used by wxWidgets itself.
  577. */
  578. #ifdef WXBUILDING
  579. # define wxDEPRECATED_BUT_USED_INTERNALLY_INLINE(func, body) func { body }
  580. #else
  581. # define wxDEPRECATED_BUT_USED_INTERNALLY_INLINE(func, body) \
  582. wxDEPRECATED(func) { body }
  583. #endif
  584. /* NULL declaration: it must be defined as 0 for C++ programs (in particular, */
  585. /* it must not be defined as "(void *)0" which is standard for C but completely */
  586. /* breaks C++ code) */
  587. #if !defined(__HANDHELDPC__)
  588. #include <stddef.h>
  589. #endif
  590. #ifdef __cplusplus
  591. // everybody gets the assert and other debug macros
  592. #include "wx/debug.h"
  593. // delete pointer if it is not NULL and NULL it afterwards
  594. template <typename T>
  595. inline void wxDELETE(T*& ptr)
  596. {
  597. typedef char TypeIsCompleteCheck[sizeof(T)] WX_ATTRIBUTE_UNUSED;
  598. if ( ptr != NULL )
  599. {
  600. delete ptr;
  601. ptr = NULL;
  602. }
  603. }
  604. // delete an array and NULL it (see comments above)
  605. template <typename T>
  606. inline void wxDELETEA(T*& ptr)
  607. {
  608. typedef char TypeIsCompleteCheck[sizeof(T)] WX_ATTRIBUTE_UNUSED;
  609. if ( ptr != NULL )
  610. {
  611. delete [] ptr;
  612. ptr = NULL;
  613. }
  614. }
  615. // trivial implementation of std::swap() for primitive types
  616. template <typename T>
  617. inline void wxSwap(T& first, T& second)
  618. {
  619. T tmp(first);
  620. first = second;
  621. second = tmp;
  622. }
  623. #endif /*__cplusplus*/
  624. /* size of statically declared array */
  625. #define WXSIZEOF(array) (sizeof(array)/sizeof(array[0]))
  626. /* symbolic constant used by all Find()-like functions returning positive */
  627. /* integer on success as failure indicator */
  628. #define wxNOT_FOUND (-1)
  629. /* the default value for some length parameters meaning that the string is */
  630. /* NUL-terminated */
  631. #define wxNO_LEN ((size_t)-1)
  632. /* ---------------------------------------------------------------------------- */
  633. /* macros dealing with comparison operators */
  634. /* ---------------------------------------------------------------------------- */
  635. /*
  636. Expands into m(op, args...) for each op in the set { ==, !=, <, <=, >, >= }.
  637. */
  638. #define wxFOR_ALL_COMPARISONS(m) \
  639. m(==) m(!=) m(>=) m(<=) m(>) m(<)
  640. #define wxFOR_ALL_COMPARISONS_1(m, x) \
  641. m(==,x) m(!=,x) m(>=,x) m(<=,x) m(>,x) m(<,x)
  642. #define wxFOR_ALL_COMPARISONS_2(m, x, y) \
  643. m(==,x,y) m(!=,x,y) m(>=,x,y) m(<=,x,y) m(>,x,y) m(<,x,y)
  644. #define wxFOR_ALL_COMPARISONS_3(m, x, y, z) \
  645. m(==,x,y,z) m(!=,x,y,z) m(>=,x,y,z) m(<=,x,y,z) m(>,x,y,z) m(<,x,y,z)
  646. /*
  647. These are only used with wxDEFINE_COMPARISON_[BY_]REV: they pass both the
  648. normal and the reversed comparison operators to the macro.
  649. */
  650. #define wxFOR_ALL_COMPARISONS_2_REV(m, x, y) \
  651. m(==,x,y,==) m(!=,x,y,!=) m(>=,x,y,<=) \
  652. m(<=,x,y,>=) m(>,x,y,<) m(<,x,y,>)
  653. #define wxFOR_ALL_COMPARISONS_3_REV(m, x, y, z) \
  654. m(==,x,y,z,==) m(!=,x,y,z,!=) m(>=,x,y,z,<=) \
  655. m(<=,x,y,z,>=) m(>,x,y,z,<) m(<,x,y,z,>)
  656. #define wxDEFINE_COMPARISON(op, T1, T2, cmp) \
  657. inline bool operator op(T1 x, T2 y) { return cmp(x, y, op); }
  658. #define wxDEFINE_COMPARISON_REV(op, T1, T2, cmp, oprev) \
  659. inline bool operator op(T2 y, T1 x) { return cmp(x, y, oprev); }
  660. #define wxDEFINE_COMPARISON_BY_REV(op, T1, T2, oprev) \
  661. inline bool operator op(T1 x, T2 y) { return y oprev x; }
  662. /*
  663. Define all 6 comparison operators (==, !=, <, <=, >, >=) for the given
  664. types in the specified order. The implementation is provided by the cmp
  665. macro. Normally wxDEFINE_ALL_COMPARISONS should be used as comparison
  666. operators are usually symmetric.
  667. */
  668. #define wxDEFINE_COMPARISONS(T1, T2, cmp) \
  669. wxFOR_ALL_COMPARISONS_3(wxDEFINE_COMPARISON, T1, T2, cmp)
  670. /*
  671. Define all 6 comparison operators (==, !=, <, <=, >, >=) for the given
  672. types in the specified order, implemented in terms of existing operators
  673. for the reverse order.
  674. */
  675. #define wxDEFINE_COMPARISONS_BY_REV(T1, T2) \
  676. wxFOR_ALL_COMPARISONS_2_REV(wxDEFINE_COMPARISON_BY_REV, T1, T2)
  677. /*
  678. This macro allows to define all 12 comparison operators (6 operators for
  679. both orders of arguments) for the given types using the provided "cmp"
  680. macro to implement the actual comparison: the macro is called with the 2
  681. arguments names, the first of type T1 and the second of type T2, and the
  682. comparison operator being implemented.
  683. */
  684. #define wxDEFINE_ALL_COMPARISONS(T1, T2, cmp) \
  685. wxFOR_ALL_COMPARISONS_3(wxDEFINE_COMPARISON, T1, T2, cmp) \
  686. wxFOR_ALL_COMPARISONS_3_REV(wxDEFINE_COMPARISON_REV, T1, T2, cmp)
  687. /* ---------------------------------------------------------------------------- */
  688. /* macros to avoid compiler warnings */
  689. /* ---------------------------------------------------------------------------- */
  690. /* Macro to cut down on compiler warnings. */
  691. #if 1 /* there should be no more any compilers needing the "#else" version */
  692. #define WXUNUSED(identifier) /* identifier */
  693. #else /* stupid, broken compiler */
  694. #define WXUNUSED(identifier) identifier
  695. #endif
  696. /* some arguments are not used in unicode mode */
  697. #if wxUSE_UNICODE
  698. #define WXUNUSED_IN_UNICODE(param) WXUNUSED(param)
  699. #else
  700. #define WXUNUSED_IN_UNICODE(param) param
  701. #endif
  702. /* some arguments are not used in WinCE build */
  703. #ifdef __WXWINCE__
  704. #define WXUNUSED_IN_WINCE(param) WXUNUSED(param)
  705. #else
  706. #define WXUNUSED_IN_WINCE(param) param
  707. #endif
  708. /* unused parameters in non stream builds */
  709. #if wxUSE_STREAMS
  710. #define WXUNUSED_UNLESS_STREAMS(param) param
  711. #else
  712. #define WXUNUSED_UNLESS_STREAMS(param) WXUNUSED(param)
  713. #endif
  714. /* some compilers give warning about a possibly unused variable if it is */
  715. /* initialized in both branches of if/else and shut up if it is initialized */
  716. /* when declared, but other compilers then give warnings about unused variable */
  717. /* value -- this should satisfy both of them */
  718. #if defined(__VISUALC__)
  719. #define wxDUMMY_INITIALIZE(val) = val
  720. #else
  721. #define wxDUMMY_INITIALIZE(val)
  722. #endif
  723. /* sometimes the value of a variable is *really* not used, to suppress the */
  724. /* resulting warning you may pass it to this function */
  725. #ifdef __cplusplus
  726. # ifdef __BORLANDC__
  727. # define wxUnusedVar(identifier) identifier
  728. # else
  729. template <class T>
  730. inline void wxUnusedVar(const T& WXUNUSED(t)) { }
  731. # endif
  732. #endif
  733. /* ---------------------------------------------------------------------------- */
  734. /* compiler specific settings */
  735. /* ---------------------------------------------------------------------------- */
  736. #if wxONLY_WATCOM_EARLIER_THAN(1,4)
  737. typedef short mode_t;
  738. #endif
  739. /* where should i put this? we need to make sure of this as it breaks */
  740. /* the <iostream> code. */
  741. #if !wxUSE_IOSTREAMH && defined(__WXDEBUG__)
  742. # ifdef wxUSE_DEBUG_NEW_ALWAYS
  743. # undef wxUSE_DEBUG_NEW_ALWAYS
  744. # define wxUSE_DEBUG_NEW_ALWAYS 0
  745. # endif
  746. #endif
  747. /* ---------------------------------------------------------------------------- */
  748. /* standard wxWidgets types */
  749. /* ---------------------------------------------------------------------------- */
  750. /* the type for screen and DC coordinates */
  751. typedef int wxCoord;
  752. enum { wxDefaultCoord = -1 };
  753. /* ---------------------------------------------------------------------------- */
  754. /* define fixed length types */
  755. /* ---------------------------------------------------------------------------- */
  756. #if defined(__MINGW32__)
  757. #include <sys/types.h>
  758. #endif
  759. /* chars are always one byte (by definition), shorts are always two (in */
  760. /* practice) */
  761. /* 8bit */
  762. typedef signed char wxInt8;
  763. typedef unsigned char wxUint8;
  764. typedef wxUint8 wxByte;
  765. /* 16bit */
  766. #ifdef SIZEOF_SHORT
  767. #if SIZEOF_SHORT != 2
  768. #error "wxWidgets assumes sizeof(short) == 2, please fix the code"
  769. #endif
  770. #else
  771. #define SIZEOF_SHORT 2
  772. #endif
  773. typedef signed short wxInt16;
  774. typedef unsigned short wxUint16;
  775. typedef wxUint16 wxWord;
  776. /*
  777. things are getting more interesting with ints, longs and pointers
  778. there are several different standard data models described by this table:
  779. +-----------+----------------------------+
  780. |type\model | LP64 ILP64 LLP64 ILP32 LP32|
  781. +-----------+----------------------------+
  782. |char | 8 8 8 8 8 |
  783. |short | 16 16 16 16 16 |
  784. |int | 32 64 32 32 16 |
  785. |long | 64 64 32 32 32 |
  786. |long long | 64 64 64 -- -- |
  787. |void * | 64 64 64 32 32 |
  788. +-----------+----------------------------+
  789. Win16 used LP32 (but we don't support it any longer), Win32 obviously used
  790. ILP32 and Win64 uses LLP64 (a.k.a. P64)
  791. Under Unix LP64 is the most widely used (the only I've ever seen, in fact)
  792. */
  793. /* 32bit */
  794. #if defined(__WINDOWS__)
  795. #if defined(__WIN32__)
  796. typedef int wxInt32;
  797. typedef unsigned int wxUint32;
  798. /*
  799. Win64 uses LLP64 model and so ints and longs have the same size as
  800. in Win32.
  801. */
  802. #ifndef SIZEOF_INT
  803. #define SIZEOF_INT 4
  804. #endif
  805. #ifndef SIZEOF_LONG
  806. #define SIZEOF_LONG 4
  807. #endif
  808. #ifndef SIZEOF_LONG_LONG
  809. #define SIZEOF_LONG_LONG 8
  810. #endif
  811. #ifndef SIZEOF_WCHAR_T
  812. /* Windows uses UTF-16 */
  813. #define SIZEOF_WCHAR_T 2
  814. #endif
  815. #ifndef SIZEOF_SIZE_T
  816. /*
  817. Under Win64 sizeof(size_t) == 8 and so it is neither unsigned
  818. int nor unsigned long!
  819. */
  820. #ifdef __WIN64__
  821. #define SIZEOF_SIZE_T 8
  822. #undef wxSIZE_T_IS_UINT
  823. #else /* Win32 */
  824. #define SIZEOF_SIZE_T 4
  825. #define wxSIZE_T_IS_UINT
  826. #endif
  827. #undef wxSIZE_T_IS_ULONG
  828. #endif
  829. #ifndef SIZEOF_VOID_P
  830. #ifdef __WIN64__
  831. #define SIZEOF_VOID_P 8
  832. #else /* Win32 */
  833. #define SIZEOF_VOID_P 4
  834. #endif /* Win64/32 */
  835. #endif
  836. #else
  837. #error "Unsupported Windows version"
  838. #endif
  839. #else /* !Windows */
  840. /* SIZEOF_XXX are normally defined by configure */
  841. #ifdef SIZEOF_INT
  842. #if SIZEOF_INT == 8
  843. /* must be ILP64 data model, there is normally a special 32 bit */
  844. /* type in it but we don't know what it is... */
  845. #error "No 32bit int type on this platform"
  846. #elif SIZEOF_INT == 4
  847. typedef int wxInt32;
  848. typedef unsigned int wxUint32;
  849. #elif SIZEOF_INT == 2
  850. /* must be LP32 */
  851. #if SIZEOF_LONG != 4
  852. #error "No 32bit int type on this platform"
  853. #endif
  854. typedef long wxInt32;
  855. typedef unsigned long wxUint32;
  856. #else
  857. /* wxWidgets is not ready for 128bit systems yet... */
  858. #error "Unknown sizeof(int) value, what are you compiling for?"
  859. #endif
  860. #else /* !defined(SIZEOF_INT) */
  861. /* assume default 32bit machine -- what else can we do? */
  862. wxCOMPILE_TIME_ASSERT( sizeof(int) == 4, IntMustBeExactly4Bytes);
  863. wxCOMPILE_TIME_ASSERT( sizeof(size_t) == 4, SizeTMustBeExactly4Bytes);
  864. wxCOMPILE_TIME_ASSERT( sizeof(void *) == 4, PtrMustBeExactly4Bytes);
  865. #define SIZEOF_INT 4
  866. #define SIZEOF_SIZE_T 4
  867. #define SIZEOF_VOID_P 4
  868. typedef int wxInt32;
  869. typedef unsigned int wxUint32;
  870. #if defined(__MACH__) && !defined(SIZEOF_WCHAR_T)
  871. #define SIZEOF_WCHAR_T 4
  872. #endif
  873. #if !defined(SIZEOF_WCHAR_T)
  874. /* also assume that sizeof(wchar_t) == 2 (under Unix the most */
  875. /* common case is 4 but there configure would have defined */
  876. /* SIZEOF_WCHAR_T for us) */
  877. /* the most common case */
  878. wxCOMPILE_TIME_ASSERT( sizeof(wchar_t) == 2,
  879. Wchar_tMustBeExactly2Bytes);
  880. #define SIZEOF_WCHAR_T 2
  881. #endif /* !defined(SIZEOF_WCHAR_T) */
  882. #endif
  883. #endif /* Win/!Win */
  884. #ifndef SIZEOF_WCHAR_T
  885. #error "SIZEOF_WCHAR_T must be defined, but isn't"
  886. #endif
  887. /* also define C99-like sized MIN/MAX constants */
  888. #define wxINT8_MIN CHAR_MIN
  889. #define wxINT8_MAX CHAR_MAX
  890. #define wxUINT8_MAX UCHAR_MAX
  891. #define wxINT16_MIN SHRT_MIN
  892. #define wxINT16_MAX SHRT_MAX
  893. #define wxUINT16_MAX USHRT_MAX
  894. #if SIZEOF_INT == 4
  895. #define wxINT32_MIN INT_MIN
  896. #define wxINT32_MAX INT_MAX
  897. #define wxUINT32_MAX UINT_MAX
  898. #elif SIZEOF_LONG == 4
  899. #define wxINT32_MIN LONG_MIN
  900. #define wxINT32_MAX LONG_MAX
  901. #define wxUINT32_MAX ULONG_MAX
  902. #else
  903. #error "Unknown 32 bit type"
  904. #endif
  905. typedef wxUint32 wxDword;
  906. #ifdef LLONG_MAX
  907. #define wxINT64_MIN LLONG_MIN
  908. #define wxINT64_MAX LLONG_MAX
  909. #define wxUINT64_MAX ULLONG_MAX
  910. #else
  911. #define wxINT64_MIN (wxLL(-9223372036854775807)-1)
  912. #define wxINT64_MAX wxLL(9223372036854775807)
  913. #define wxUINT64_MAX wxULL(0xFFFFFFFFFFFFFFFF)
  914. #endif
  915. /* 64 bit */
  916. /* NB: we #define and not typedef wxLongLong_t because we use "#ifdef */
  917. /* wxLongLong_t" in wx/longlong.h */
  918. /* wxULongLong_t is set later (usually to unsigned wxLongLong_t) */
  919. /* to avoid compilation problems on 64bit machines with ambiguous method calls */
  920. /* we will need to define this */
  921. #undef wxLongLongIsLong
  922. /*
  923. First check for specific compilers which have known 64 bit integer types,
  924. this avoids clashes with SIZEOF_LONG[_LONG] being defined incorrectly for
  925. e.g. MSVC builds (Python.h defines it as 8 even for MSVC).
  926. Also notice that we check for "long long" before checking for 64 bit long as
  927. we still want to use "long long" and not "long" for wxLongLong_t on 64 bit
  928. architectures to be able to pass wxLongLong_t to the standard functions
  929. prototyped as taking "long long" such as strtoll().
  930. */
  931. #if (defined(__VISUALC__) || defined(__INTELC__)) && defined(__WIN32__)
  932. #define wxLongLong_t __int64
  933. #define wxLongLongSuffix i64
  934. #define wxLongLongFmtSpec "I64"
  935. #elif defined(__BORLANDC__) && defined(__WIN32__) && (__BORLANDC__ >= 0x520)
  936. #define wxLongLong_t __int64
  937. #define wxLongLongSuffix i64
  938. #define wxLongLongFmtSpec "L"
  939. #elif (defined(__WATCOMC__) && (defined(__WIN32__) || defined(__DOS__) || defined(__OS2__)))
  940. #define wxLongLong_t __int64
  941. #define wxLongLongSuffix i64
  942. #define wxLongLongFmtSpec "L"
  943. #elif defined(__DIGITALMARS__)
  944. #define wxLongLong_t __int64
  945. #define wxLongLongSuffix LL
  946. #define wxLongLongFmtSpec "ll"
  947. #elif defined(__MINGW32__)
  948. #define wxLongLong_t long long
  949. #define wxLongLongSuffix ll
  950. #define wxLongLongFmtSpec "I64"
  951. #elif defined(__VISAGECPP__) && __IBMCPP__ >= 400
  952. #define wxLongLong_t long long
  953. #elif (defined(SIZEOF_LONG_LONG) && SIZEOF_LONG_LONG >= 8) || \
  954. defined(__GNUC__) || \
  955. defined(__CYGWIN__) || \
  956. defined(__WXMICROWIN__) || \
  957. (defined(__DJGPP__) && __DJGPP__ >= 2)
  958. #define wxLongLong_t long long
  959. #define wxLongLongSuffix ll
  960. #define wxLongLongFmtSpec "ll"
  961. #elif defined(SIZEOF_LONG) && (SIZEOF_LONG == 8)
  962. #define wxLongLong_t long
  963. #define wxLongLongSuffix l
  964. #define wxLongLongFmtSpec "l"
  965. #define wxLongLongIsLong
  966. #endif
  967. #ifdef wxLongLong_t
  968. #define wxULongLong_t unsigned wxLongLong_t
  969. /*
  970. wxLL() and wxULL() macros allow to define 64 bit constants in a
  971. portable way.
  972. */
  973. #ifndef wxCOMPILER_BROKEN_CONCAT_OPER
  974. #define wxLL(x) wxCONCAT(x, wxLongLongSuffix)
  975. #define wxULL(x) wxCONCAT(x, wxCONCAT(u, wxLongLongSuffix))
  976. #else
  977. /*
  978. Currently only Borland compiler has broken concatenation operator
  979. and this compiler is known to use [u]i64 suffix.
  980. */
  981. #define wxLL(x) wxAPPEND_i64(x)
  982. #define wxULL(x) wxAPPEND_ui64(x)
  983. #endif
  984. typedef wxLongLong_t wxInt64;
  985. typedef wxULongLong_t wxUint64;
  986. #define wxHAS_INT64 1
  987. #ifndef wxLongLongIsLong
  988. #define wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG
  989. #endif
  990. #elif wxUSE_LONGLONG
  991. /* these macros allow to define 64 bit constants in a portable way */
  992. #define wxLL(x) wxLongLong(x)
  993. #define wxULL(x) wxULongLong(x)
  994. #define wxInt64 wxLongLong
  995. #define wxUint64 wxULongLong
  996. #define wxHAS_INT64 1
  997. #else /* !wxUSE_LONGLONG */
  998. #define wxHAS_INT64 0
  999. #endif
  1000. /*
  1001. Helper macro for conditionally compiling some code only if wxLongLong_t is
  1002. available and is a type different from the other integer types (i.e. not
  1003. long).
  1004. */
  1005. #ifdef wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG
  1006. #define wxIF_LONG_LONG_TYPE(x) x
  1007. #else
  1008. #define wxIF_LONG_LONG_TYPE(x)
  1009. #endif
  1010. /* Make sure ssize_t is defined (a signed type the same size as size_t). */
  1011. /* (HAVE_SSIZE_T is not already defined by configure) */
  1012. #ifndef HAVE_SSIZE_T
  1013. #ifdef __MINGW32__
  1014. #if defined(_SSIZE_T_) || defined(_SSIZE_T_DEFINED)
  1015. #define HAVE_SSIZE_T
  1016. #endif
  1017. #elif wxCHECK_WATCOM_VERSION(1,4)
  1018. #define HAVE_SSIZE_T
  1019. #endif
  1020. #endif /* !HAVE_SSIZE_T */
  1021. /* If we really don't have ssize_t, provide our own version. */
  1022. #ifdef HAVE_SSIZE_T
  1023. #ifdef __UNIX__
  1024. #include <sys/types.h>
  1025. #endif
  1026. #else /* !HAVE_SSIZE_T */
  1027. #if SIZEOF_SIZE_T == 4
  1028. typedef wxInt32 ssize_t;
  1029. #elif SIZEOF_SIZE_T == 8
  1030. typedef wxInt64 ssize_t;
  1031. #else
  1032. #error "error defining ssize_t, size_t is not 4 or 8 bytes"
  1033. #endif
  1034. /* prevent ssize_t redefinitions in other libraries */
  1035. #define HAVE_SSIZE_T
  1036. #endif
  1037. /*
  1038. We can't rely on Windows _W64 being defined as windows.h may not be
  1039. included so define our own equivalent: this should be used with types
  1040. like WXLPARAM or WXWPARAM which are 64 bit under Win64 to avoid warnings
  1041. each time we cast it to a pointer or a handle (which results in hundreds
  1042. of warnings as Win32 API often passes pointers in them)
  1043. */
  1044. #if wxCHECK_VISUALC_VERSION(7)
  1045. #define wxW64 __w64
  1046. #else
  1047. #define wxW64
  1048. #endif
  1049. /*
  1050. Define signed and unsigned integral types big enough to contain all of long,
  1051. size_t and void *.
  1052. */
  1053. #if SIZEOF_LONG >= SIZEOF_VOID_P
  1054. /*
  1055. Normal case when long is the largest integral type.
  1056. */
  1057. typedef long wxIntPtr;
  1058. typedef unsigned long wxUIntPtr;
  1059. #elif SIZEOF_SIZE_T >= SIZEOF_VOID_P
  1060. /*
  1061. Win64 case: size_t is the only integral type big enough for "void *".
  1062. Notice that we must use __w64 to avoid warnings about casting pointers
  1063. to wxIntPtr (which we do often as this is what it is defined for) in 32
  1064. bit build with MSVC.
  1065. */
  1066. typedef wxW64 ssize_t wxIntPtr;
  1067. typedef size_t wxUIntPtr;
  1068. #else
  1069. /*
  1070. This should never happen for the current architectures but if you're
  1071. using one where it does, please contact wx-dev@lists.wxwidgets.org.
  1072. */
  1073. #error "Pointers can't be stored inside integer types."
  1074. #endif
  1075. #ifdef __cplusplus
  1076. /* And also define a couple of simple functions to cast pointer to/from it. */
  1077. inline wxUIntPtr wxPtrToUInt(const void *p)
  1078. {
  1079. /*
  1080. VC++ 7.1 gives warnings about casts such as below even when they're
  1081. explicit with /Wp64 option, suppress them as we really know what we're
  1082. doing here. Same thing with icc with -Wall.
  1083. */
  1084. #ifdef __VISUALC__
  1085. #if __VISUALC__ >= 1200
  1086. #pragma warning(push)
  1087. #endif
  1088. /* pointer truncation from '' to '' */
  1089. #pragma warning(disable: 4311)
  1090. #elif defined(__INTELC__)
  1091. #pragma warning(push)
  1092. /* conversion from pointer to same-sized integral type */
  1093. #pragma warning(disable: 1684)
  1094. #endif
  1095. return wx_reinterpret_cast(wxUIntPtr, p);
  1096. #if (defined(__VISUALC__) && __VISUALC__ >= 1200) || defined(__INTELC__)
  1097. #pragma warning(pop)
  1098. #endif
  1099. }
  1100. inline void *wxUIntToPtr(wxUIntPtr p)
  1101. {
  1102. #ifdef __VISUALC__
  1103. #if __VISUALC__ >= 1200
  1104. #pragma warning(push)
  1105. #endif
  1106. /* conversion to type of greater size */
  1107. #pragma warning(disable: 4312)
  1108. #elif defined(__INTELC__)
  1109. #pragma warning(push)
  1110. /* invalid type conversion: "wxUIntPtr={unsigned long}" to "void *" */
  1111. #pragma warning(disable: 171)
  1112. #endif
  1113. return wx_reinterpret_cast(void *, p);
  1114. #if (defined(__VISUALC__) && __VISUALC__ >= 1200) || defined(__INTELC__)
  1115. #pragma warning(pop)
  1116. #endif
  1117. }
  1118. #endif /*__cplusplus*/
  1119. /* base floating point types */
  1120. /* wxFloat32: 32 bit IEEE float ( 1 sign, 8 exponent bits, 23 fraction bits ) */
  1121. /* wxFloat64: 64 bit IEEE float ( 1 sign, 11 exponent bits, 52 fraction bits ) */
  1122. /* wxDouble: native fastest representation that has at least wxFloat64 */
  1123. /* precision, so use the IEEE types for storage, and this for */
  1124. /* calculations */
  1125. typedef float wxFloat32;
  1126. typedef double wxFloat64;
  1127. typedef double wxDouble;
  1128. /*
  1129. Some (non standard) compilers typedef wchar_t as an existing type instead
  1130. of treating it as a real fundamental type, set wxWCHAR_T_IS_REAL_TYPE to 0
  1131. for them and to 1 for all the others.
  1132. */
  1133. #ifndef wxWCHAR_T_IS_REAL_TYPE
  1134. /*
  1135. VC++ typedefs wchar_t as unsigned short by default until VC8, that is
  1136. unless /Za or /Zc:wchar_t option is used in which case _WCHAR_T_DEFINED
  1137. is defined.
  1138. */
  1139. # if defined(__VISUALC__) && !defined(_NATIVE_WCHAR_T_DEFINED)
  1140. # define wxWCHAR_T_IS_REAL_TYPE 0
  1141. # else /* compiler having standard-conforming wchar_t */
  1142. # define wxWCHAR_T_IS_REAL_TYPE 1
  1143. # endif
  1144. #endif /* !defined(wxWCHAR_T_IS_REAL_TYPE) */
  1145. /* Helper macro for doing something dependent on whether wchar_t is or isn't a
  1146. typedef inside another macro. */
  1147. #if wxWCHAR_T_IS_REAL_TYPE
  1148. #define wxIF_WCHAR_T_TYPE(x) x
  1149. #else /* !wxWCHAR_T_IS_REAL_TYPE */
  1150. #define wxIF_WCHAR_T_TYPE(x)
  1151. #endif /* wxWCHAR_T_IS_REAL_TYPE/!wxWCHAR_T_IS_REAL_TYPE */
  1152. /*
  1153. This constant should be used instead of NULL in vararg functions taking
  1154. wxChar* arguments: passing NULL (which is the same as 0, unless the compiler
  1155. defines it specially, e.g. like gcc does with its __null built-in) doesn't
  1156. work in this case as va_arg() wouldn't interpret the integer 0 correctly
  1157. when trying to convert it to a pointer on architectures where sizeof(int) is
  1158. strictly less than sizeof(void *).
  1159. Examples of places where this must be used include wxFileTypeInfo ctor.
  1160. */
  1161. #define wxNullPtr ((void *)NULL)
  1162. /* Define wxChar16 and wxChar32 */
  1163. #if SIZEOF_WCHAR_T == 2
  1164. #define wxWCHAR_T_IS_WXCHAR16
  1165. typedef wchar_t wxChar16;
  1166. #else
  1167. typedef wxUint16 wxChar16;
  1168. #endif
  1169. #if SIZEOF_WCHAR_T == 4
  1170. #define wxWCHAR_T_IS_WXCHAR32
  1171. typedef wchar_t wxChar32;
  1172. #else
  1173. typedef wxUint32 wxChar32;
  1174. #endif
  1175. /*
  1176. Helper macro expanding into the given "m" macro invoked with each of the
  1177. integer types as parameter (notice that this does not include char/unsigned
  1178. char and bool but does include wchar_t).
  1179. */
  1180. #define wxDO_FOR_INT_TYPES(m) \
  1181. m(short) \
  1182. m(unsigned short) \
  1183. m(int) \
  1184. m(unsigned int) \
  1185. m(long) \
  1186. m(unsigned long) \
  1187. wxIF_LONG_LONG_TYPE( m(wxLongLong_t) ) \
  1188. wxIF_LONG_LONG_TYPE( m(wxULongLong_t) ) \
  1189. wxIF_WCHAR_T_TYPE( m(wchar_t) )
  1190. /*
  1191. Same as wxDO_FOR_INT_TYPES() but does include char and unsigned char.
  1192. Notice that we use "char" and "unsigned char" here but not "signed char"
  1193. which would be more correct as "char" could be unsigned by default. But
  1194. wxWidgets code currently supposes that char is signed and we'd need to
  1195. clean up assumptions about it, notably in wx/unichar.h, to be able to use
  1196. "signed char" here.
  1197. */
  1198. #define wxDO_FOR_CHAR_INT_TYPES(m) \
  1199. m(char) \
  1200. m(unsigned char) \
  1201. wxDO_FOR_INT_TYPES(m)
  1202. /*
  1203. Same as wxDO_FOR_INT_TYPES() above except that m macro takes the
  1204. type as the first argument and some extra argument, passed from this macro
  1205. itself, as the second one.
  1206. */
  1207. #define wxDO_FOR_INT_TYPES_1(m, arg) \
  1208. m(short, arg) \
  1209. m(unsigned short, arg) \
  1210. m(int, arg) \
  1211. m(unsigned int, arg) \
  1212. m(long, arg) \
  1213. m(unsigned long, arg) \
  1214. wxIF_LONG_LONG_TYPE( m(wxLongLong_t, arg) ) \
  1215. wxIF_LONG_LONG_TYPE( m(wxULongLong_t, arg) ) \
  1216. wxIF_WCHAR_T_TYPE( m(wchar_t, arg) )
  1217. /*
  1218. Combination of wxDO_FOR_CHAR_INT_TYPES() and wxDO_FOR_INT_TYPES_1():
  1219. invokes the given macro with the specified argument as its second parameter
  1220. for all char and int types.
  1221. */
  1222. #define wxDO_FOR_CHAR_INT_TYPES_1(m, arg) \
  1223. m(char, arg) \
  1224. m(unsigned char, arg) \
  1225. wxDO_FOR_INT_TYPES_1(m, arg)
  1226. /* ---------------------------------------------------------------------------- */
  1227. /* byte ordering related definition and macros */
  1228. /* ---------------------------------------------------------------------------- */
  1229. /* byte sex */
  1230. #define wxBIG_ENDIAN 4321
  1231. #define wxLITTLE_ENDIAN 1234
  1232. #define wxPDP_ENDIAN 3412
  1233. #ifdef WORDS_BIGENDIAN
  1234. #define wxBYTE_ORDER wxBIG_ENDIAN
  1235. #else
  1236. #define wxBYTE_ORDER wxLITTLE_ENDIAN
  1237. #endif
  1238. /* byte swapping */
  1239. #define wxUINT16_SWAP_ALWAYS(val) \
  1240. ((wxUint16) ( \
  1241. (((wxUint16) (val) & (wxUint16) 0x00ffU) << 8) | \
  1242. (((wxUint16) (val) & (wxUint16) 0xff00U) >> 8)))
  1243. #define wxINT16_SWAP_ALWAYS(val) \
  1244. ((wxInt16) ( \
  1245. (((wxUint16) (val) & (wxUint16) 0x00ffU) << 8) | \
  1246. (((wxUint16) (val) & (wxUint16) 0xff00U) >> 8)))
  1247. #define wxUINT32_SWAP_ALWAYS(val) \
  1248. ((wxUint32) ( \
  1249. (((wxUint32) (val) & (wxUint32) 0x000000ffU) << 24) | \
  1250. (((wxUint32) (val) & (wxUint32) 0x0000ff00U) << 8) | \
  1251. (((wxUint32) (val) & (wxUint32) 0x00ff0000U) >> 8) | \
  1252. (((wxUint32) (val) & (wxUint32) 0xff000000U) >> 24)))
  1253. #define wxINT32_SWAP_ALWAYS(val) \
  1254. ((wxInt32) ( \
  1255. (((wxUint32) (val) & (wxUint32) 0x000000ffU) << 24) | \
  1256. (((wxUint32) (val) & (wxUint32) 0x0000ff00U) << 8) | \
  1257. (((wxUint32) (val) & (wxUint32) 0x00ff0000U) >> 8) | \
  1258. (((wxUint32) (val) & (wxUint32) 0xff000000U) >> 24)))
  1259. /* machine specific byte swapping */
  1260. #ifdef wxLongLong_t
  1261. #define wxUINT64_SWAP_ALWAYS(val) \
  1262. ((wxUint64) ( \
  1263. (((wxUint64) (val) & (wxUint64) wxULL(0x00000000000000ff)) << 56) | \
  1264. (((wxUint64) (val) & (wxUint64) wxULL(0x000000000000ff00)) << 40) | \
  1265. (((wxUint64) (val) & (wxUint64) wxULL(0x0000000000ff0000)) << 24) | \
  1266. (((wxUint64) (val) & (wxUint64) wxULL(0x00000000ff000000)) << 8) | \
  1267. (((wxUint64) (val) & (wxUint64) wxULL(0x000000ff00000000)) >> 8) | \
  1268. (((wxUint64) (val) & (wxUint64) wxULL(0x0000ff0000000000)) >> 24) | \
  1269. (((wxUint64) (val) & (wxUint64) wxULL(0x00ff000000000000)) >> 40) | \
  1270. (((wxUint64) (val) & (wxUint64) wxULL(0xff00000000000000)) >> 56)))
  1271. #define wxINT64_SWAP_ALWAYS(val) \
  1272. ((wxInt64) ( \
  1273. (((wxUint64) (val) & (wxUint64) wxULL(0x00000000000000ff)) << 56) | \
  1274. (((wxUint64) (val) & (wxUint64) wxULL(0x000000000000ff00)) << 40) | \
  1275. (((wxUint64) (val) & (wxUint64) wxULL(0x0000000000ff0000)) << 24) | \
  1276. (((wxUint64) (val) & (wxUint64) wxULL(0x00000000ff000000)) << 8) | \
  1277. (((wxUint64) (val) & (wxUint64) wxULL(0x000000ff00000000)) >> 8) | \
  1278. (((wxUint64) (val) & (wxUint64) wxULL(0x0000ff0000000000)) >> 24) | \
  1279. (((wxUint64) (val) & (wxUint64) wxULL(0x00ff000000000000)) >> 40) | \
  1280. (((wxUint64) (val) & (wxUint64) wxULL(0xff00000000000000)) >> 56)))
  1281. #elif wxUSE_LONGLONG /* !wxLongLong_t */
  1282. #define wxUINT64_SWAP_ALWAYS(val) \
  1283. ((wxUint64) ( \
  1284. ((wxULongLong(val) & wxULongLong(0L, 0x000000ffU)) << 56) | \
  1285. ((wxULongLong(val) & wxULongLong(0L, 0x0000ff00U)) << 40) | \
  1286. ((wxULongLong(val) & wxULongLong(0L, 0x00ff0000U)) << 24) | \
  1287. ((wxULongLong(val) & wxULongLong(0L, 0xff000000U)) << 8) | \
  1288. ((wxULongLong(val) & wxULongLong(0x000000ffL, 0U)) >> 8) | \
  1289. ((wxULongLong(val) & wxULongLong(0x0000ff00L, 0U)) >> 24) | \
  1290. ((wxULongLong(val) & wxULongLong(0x00ff0000L, 0U)) >> 40) | \
  1291. ((wxULongLong(val) & wxULongLong(0xff000000L, 0U)) >> 56)))
  1292. #define wxINT64_SWAP_ALWAYS(val) \
  1293. ((wxInt64) ( \
  1294. ((wxLongLong(val) & wxLongLong(0L, 0x000000ffU)) << 56) | \
  1295. ((wxLongLong(val) & wxLongLong(0L, 0x0000ff00U)) << 40) | \
  1296. ((wxLongLong(val) & wxLongLong(0L, 0x00ff0000U)) << 24) | \
  1297. ((wxLongLong(val) & wxLongLong(0L, 0xff000000U)) << 8) | \
  1298. ((wxLongLong(val) & wxLongLong(0x000000ffL, 0U)) >> 8) | \
  1299. ((wxLongLong(val) & wxLongLong(0x0000ff00L, 0U)) >> 24) | \
  1300. ((wxLongLong(val) & wxLongLong(0x00ff0000L, 0U)) >> 40) | \
  1301. ((wxLongLong(val) & wxLongLong(0xff000000L, 0U)) >> 56)))
  1302. #endif /* wxLongLong_t/!wxLongLong_t */
  1303. #ifdef WORDS_BIGENDIAN
  1304. #define wxUINT16_SWAP_ON_BE(val) wxUINT16_SWAP_ALWAYS(val)
  1305. #define wxINT16_SWAP_ON_BE(val) wxINT16_SWAP_ALWAYS(val)
  1306. #define wxUINT16_SWAP_ON_LE(val) (val)
  1307. #define wxINT16_SWAP_ON_LE(val) (val)
  1308. #define wxUINT32_SWAP_ON_BE(val) wxUINT32_SWAP_ALWAYS(val)
  1309. #define wxINT32_SWAP_ON_BE(val) wxINT32_SWAP_ALWAYS(val)
  1310. #define wxUINT32_SWAP_ON_LE(val) (val)
  1311. #define wxINT32_SWAP_ON_LE(val) (val)
  1312. #if wxHAS_INT64
  1313. #define wxUINT64_SWAP_ON_BE(val) wxUINT64_SWAP_ALWAYS(val)
  1314. #define wxUINT64_SWAP_ON_LE(val) (val)
  1315. #define wxINT64_SWAP_ON_BE(val) wxINT64_SWAP_ALWAYS(val)
  1316. #define wxINT64_SWAP_ON_LE(val) (val)
  1317. #endif
  1318. #else
  1319. #define wxUINT16_SWAP_ON_LE(val) wxUINT16_SWAP_ALWAYS(val)
  1320. #define wxINT16_SWAP_ON_LE(val) wxINT16_SWAP_ALWAYS(val)
  1321. #define wxUINT16_SWAP_ON_BE(val) (val)
  1322. #define wxINT16_SWAP_ON_BE(val) (val)
  1323. #define wxUINT32_SWAP_ON_LE(val) wxUINT32_SWAP_ALWAYS(val)
  1324. #define wxINT32_SWAP_ON_LE(val) wxINT32_SWAP_ALWAYS(val)
  1325. #define wxUINT32_SWAP_ON_BE(val) (val)
  1326. #define wxINT32_SWAP_ON_BE(val) (val)
  1327. #if wxHAS_INT64
  1328. #define wxUINT64_SWAP_ON_LE(val) wxUINT64_SWAP_ALWAYS(val)
  1329. #define wxUINT64_SWAP_ON_BE(val) (val)
  1330. #define wxINT64_SWAP_ON_LE(val) wxINT64_SWAP_ALWAYS(val)
  1331. #define wxINT64_SWAP_ON_BE(val) (val)
  1332. #endif
  1333. #endif
  1334. /* ---------------------------------------------------------------------------- */
  1335. /* template workarounds for buggy compilers */
  1336. /* ---------------------------------------------------------------------------- */
  1337. #if defined(__GNUC__) && !wxCHECK_GCC_VERSION( 3, 4 )
  1338. /* GCC <= 3.4 has buggy template support */
  1339. # define wxUSE_MEMBER_TEMPLATES 0
  1340. #endif
  1341. #if defined(_MSC_VER) && _MSC_VER <= 1200
  1342. /* MSVC <= 6.0 has buggy template support */
  1343. # define wxUSE_MEMBER_TEMPLATES 0
  1344. # define wxUSE_FUNC_TEMPLATE_POINTER 0
  1345. #endif
  1346. #ifndef wxUSE_MEMBER_TEMPLATES
  1347. # define wxUSE_MEMBER_TEMPLATES 1
  1348. #endif
  1349. #ifndef wxUSE_FUNC_TEMPLATE_POINTER
  1350. # define wxUSE_FUNC_TEMPLATE_POINTER 1
  1351. #endif
  1352. #if wxUSE_MEMBER_TEMPLATES
  1353. # define wxTEMPLATED_MEMBER_CALL( method, type ) method<type>()
  1354. # define wxTEMPLATED_MEMBER_FIX( type )
  1355. #else
  1356. # define wxTEMPLATED_MEMBER_CALL( method, type ) method((type*)NULL)
  1357. # define wxTEMPLATED_MEMBER_FIX( type ) type* =NULL
  1358. #endif
  1359. #if defined(_MSC_VER) && _MSC_VER <= 1200
  1360. # define wxTEMPLATED_FUNCTION_FIX( type ), wxTEMPLATED_MEMBER_FIX(type)
  1361. # define wxINFUNC_CLASS_TYPE_FIX( type ) typedef type type;
  1362. #else
  1363. # define wxTEMPLATED_FUNCTION_FIX( type )
  1364. # define wxINFUNC_CLASS_TYPE_FIX( type )
  1365. #endif
  1366. /* ---------------------------------------------------------------------------- */
  1367. /* Geometric flags */
  1368. /* ---------------------------------------------------------------------------- */
  1369. enum wxGeometryCentre
  1370. {
  1371. wxCENTRE = 0x0001,
  1372. wxCENTER = wxCENTRE
  1373. };
  1374. /* centering into frame rather than screen (obsolete) */
  1375. #define wxCENTER_FRAME 0x0000
  1376. /* centre on screen rather than parent */
  1377. #define wxCENTRE_ON_SCREEN 0x0002
  1378. #define wxCENTER_ON_SCREEN wxCENTRE_ON_SCREEN
  1379. enum wxOrientation
  1380. {
  1381. /* don't change the values of these elements, they are used elsewhere */
  1382. wxHORIZONTAL = 0x0004,
  1383. wxVERTICAL = 0x0008,
  1384. wxBOTH = wxVERTICAL | wxHORIZONTAL,
  1385. /* a mask to extract orientation from the combination of flags */
  1386. wxORIENTATION_MASK = wxBOTH
  1387. };
  1388. enum wxDirection
  1389. {
  1390. wxLEFT = 0x0010,
  1391. wxRIGHT = 0x0020,
  1392. wxUP = 0x0040,
  1393. wxDOWN = 0x0080,
  1394. wxTOP = wxUP,
  1395. wxBOTTOM = wxDOWN,
  1396. wxNORTH = wxUP,
  1397. wxSOUTH = wxDOWN,
  1398. wxWEST = wxLEFT,
  1399. wxEAST = wxRIGHT,
  1400. wxALL = (wxUP | wxDOWN | wxRIGHT | wxLEFT),
  1401. /* a mask to extract direction from the combination of flags */
  1402. wxDIRECTION_MASK = wxALL
  1403. };
  1404. enum wxAlignment
  1405. {
  1406. /*
  1407. 0 is a valid wxAlignment value (both wxALIGN_LEFT and wxALIGN_TOP
  1408. use it) so define a symbolic name for an invalid alignment value
  1409. which can be assumed to be different from anything else
  1410. */
  1411. wxALIGN_INVALID = -1,
  1412. wxALIGN_NOT = 0x0000,
  1413. wxALIGN_CENTER_HORIZONTAL = 0x0100,
  1414. wxALIGN_CENTRE_HORIZONTAL = wxALIGN_CENTER_HORIZONTAL,
  1415. wxALIGN_LEFT = wxALIGN_NOT,
  1416. wxALIGN_TOP = wxALIGN_NOT,
  1417. wxALIGN_RIGHT = 0x0200,
  1418. wxALIGN_BOTTOM = 0x0400,
  1419. wxALIGN_CENTER_VERTICAL = 0x0800,
  1420. wxALIGN_CENTRE_VERTICAL = wxALIGN_CENTER_VERTICAL,
  1421. wxALIGN_CENTER = (wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL),
  1422. wxALIGN_CENTRE = wxALIGN_CENTER,
  1423. /* a mask to extract alignment from the combination of flags */
  1424. wxALIGN_MASK = 0x0f00
  1425. };
  1426. /* misc. flags for wxSizer items */
  1427. enum wxSizerFlagBits
  1428. {
  1429. /*
  1430. wxADJUST_MINSIZE doesn't do anything any more but we still define
  1431. it for compatibility. Notice that it may be also predefined (as 0,
  1432. hopefully) in the user code in order to use it even in
  1433. !WXWIN_COMPATIBILITY_2_8 builds so don't redefine it in such case.
  1434. */
  1435. #if WXWIN_COMPATIBILITY_2_8 && !defined(wxADJUST_MINSIZE)
  1436. wxADJUST_MINSIZE = 0,
  1437. #endif
  1438. wxFIXED_MINSIZE = 0x8000,
  1439. wxRESERVE_SPACE_EVEN_IF_HIDDEN = 0x0002,
  1440. /* a mask to extract wxSizerFlagBits from combination of flags */
  1441. wxSIZER_FLAG_BITS_MASK = 0x8002
  1442. };
  1443. enum wxStretch
  1444. {
  1445. wxSTRETCH_NOT = 0x0000,
  1446. wxSHRINK = 0x1000,
  1447. wxGROW = 0x2000,
  1448. wxEXPAND = wxGROW,
  1449. wxSHAPED = 0x4000,
  1450. wxTILE = wxSHAPED | wxFIXED_MINSIZE,
  1451. /* a mask to extract stretch from the combination of flags */
  1452. wxSTRETCH_MASK = 0x7000 /* sans wxTILE */
  1453. };
  1454. /* border flags: the values are chosen for backwards compatibility */
  1455. enum wxBorder
  1456. {
  1457. /* this is different from wxBORDER_NONE as by default the controls do have */
  1458. /* border */
  1459. wxBORDER_DEFAULT = 0,
  1460. wxBORDER_NONE = 0x00200000,
  1461. wxBORDER_STATIC = 0x01000000,
  1462. wxBORDER_SIMPLE = 0x02000000,
  1463. wxBORDER_RAISED = 0x04000000,
  1464. wxBORDER_SUNKEN = 0x08000000,
  1465. wxBORDER_DOUBLE = 0x10000000, /* deprecated */
  1466. wxBORDER_THEME = wxBORDER_DOUBLE,
  1467. /* a mask to extract border style from the combination of flags */
  1468. wxBORDER_MASK = 0x1f200000
  1469. };
  1470. /* This makes it easier to specify a 'normal' border for a control */
  1471. #if defined(__SMARTPHONE__) || defined(__POCKETPC__)
  1472. #define wxDEFAULT_CONTROL_BORDER wxBORDER_SIMPLE
  1473. #else
  1474. #define wxDEFAULT_CONTROL_BORDER wxBORDER_SUNKEN
  1475. #endif
  1476. /* ---------------------------------------------------------------------------- */
  1477. /* Window style flags */
  1478. /* ---------------------------------------------------------------------------- */
  1479. /*
  1480. * Values are chosen so they can be |'ed in a bit list.
  1481. * Some styles are used across more than one group,
  1482. * so the values mustn't clash with others in the group.
  1483. * Otherwise, numbers can be reused across groups.
  1484. */
  1485. /*
  1486. Summary of the bits used by various styles.
  1487. High word, containing styles which can be used with many windows:
  1488. +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
  1489. |31|30|29|28|27|26|25|24|23|22|21|20|19|18|17|16|
  1490. +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
  1491. | | | | | | | | | | | | | | | |
  1492. | | | | | | | | | | | | | | | \_ wxFULL_REPAINT_ON_RESIZE
  1493. | | | | | | | | | | | | | | \____ wxPOPUP_WINDOW
  1494. | | | | | | | | | | | | | \_______ wxWANTS_CHARS
  1495. | | | | | | | | | | | | \__________ wxTAB_TRAVERSAL
  1496. | | | | | | | | | | | \_____________ wxTRANSPARENT_WINDOW
  1497. | | | | | | | | | | \________________ wxBORDER_NONE
  1498. | | | | | | | | | \___________________ wxCLIP_CHILDREN
  1499. | | | | | | | | \______________________ wxALWAYS_SHOW_SB
  1500. | | | | | | | \_________________________ wxBORDER_STATIC
  1501. | | | | | | \____________________________ wxBORDER_SIMPLE
  1502. | | | | | \_______________________________ wxBORDER_RAISED
  1503. | | | | \__________________________________ wxBORDER_SUNKEN
  1504. | | | \_____________________________________ wxBORDER_{DOUBLE,THEME}
  1505. | | \________________________________________ wxCAPTION/wxCLIP_SIBLINGS
  1506. | \___________________________________________ wxHSCROLL
  1507. \______________________________________________ wxVSCROLL
  1508. Low word style bits is class-specific meaning that the same bit can have
  1509. different meanings for different controls (e.g. 0x10 is wxCB_READONLY
  1510. meaning that the control can't be modified for wxComboBox but wxLB_SORT
  1511. meaning that the control should be kept sorted for wxListBox, while
  1512. wxLB_SORT has a different value -- and this is just fine).
  1513. */
  1514. /*
  1515. * Window (Frame/dialog/subwindow/panel item) style flags
  1516. */
  1517. #define wxVSCROLL 0x80000000
  1518. #define wxHSCROLL 0x40000000
  1519. #define wxCAPTION 0x20000000
  1520. /* New styles (border styles are now in their own enum) */
  1521. #define wxDOUBLE_BORDER wxBORDER_DOUBLE
  1522. #define wxSUNKEN_BORDER wxBORDER_SUNKEN
  1523. #define wxRAISED_BORDER wxBORDER_RAISED
  1524. #define wxBORDER wxBORDER_SIMPLE
  1525. #define wxSIMPLE_BORDER wxBORDER_SIMPLE
  1526. #define wxSTATIC_BORDER wxBORDER_STATIC
  1527. #define wxNO_BORDER wxBORDER_NONE
  1528. /* wxALWAYS_SHOW_SB: instead of hiding the scrollbar when it is not needed, */
  1529. /* disable it - but still show (see also wxLB_ALWAYS_SB style) */
  1530. /* */
  1531. /* NB: as this style is only supported by wxUniversal and wxMSW so far */
  1532. #define wxALWAYS_SHOW_SB 0x00800000
  1533. /* Clip children when painting, which reduces flicker in e.g. frames and */
  1534. /* splitter windows, but can't be used in a panel where a static box must be */
  1535. /* 'transparent' (panel paints the background for it) */
  1536. #define wxCLIP_CHILDREN 0x00400000
  1537. /* Note we're reusing the wxCAPTION style because we won't need captions */
  1538. /* for subwindows/controls */
  1539. #define wxCLIP_SIBLINGS 0x20000000
  1540. #define wxTRANSPARENT_WINDOW 0x00100000
  1541. /* Add this style to a panel to get tab traversal working outside of dialogs */
  1542. /* (on by default for wxPanel, wxDialog, wxScrolledWindow) */
  1543. #define wxTAB_TRAVERSAL 0x00080000
  1544. /* Add this style if the control wants to get all keyboard messages (under */
  1545. /* Windows, it won't normally get the dialog navigation key events) */
  1546. #define wxWANTS_CHARS 0x00040000
  1547. /* Make window retained (Motif only, see src/generic/scrolwing.cpp)
  1548. * This is non-zero only under wxMotif, to avoid a clash with wxPOPUP_WINDOW
  1549. * on other platforms
  1550. */
  1551. #ifdef __WXMOTIF__
  1552. #define wxRETAINED 0x00020000
  1553. #else
  1554. #define wxRETAINED 0x00000000
  1555. #endif
  1556. #define wxBACKINGSTORE wxRETAINED
  1557. /* set this flag to create a special popup window: it will be always shown on */
  1558. /* top of other windows, will capture the mouse and will be dismissed when the */
  1559. /* mouse is clicked outside of it or if it loses focus in any other way */
  1560. #define wxPOPUP_WINDOW 0x00020000
  1561. /* force a full repaint when the window is resized (instead of repainting just */
  1562. /* the invalidated area) */
  1563. #define wxFULL_REPAINT_ON_RESIZE 0x00010000
  1564. /* obsolete: now this is the default behaviour */
  1565. /* */
  1566. /* don't invalidate the whole window (resulting in a PAINT event) when the */
  1567. /* window is resized (currently, makes sense for wxMSW only) */
  1568. #define wxNO_FULL_REPAINT_ON_RESIZE 0
  1569. /* A mask which can be used to filter (out) all wxWindow-specific styles.
  1570. */
  1571. #define wxWINDOW_STYLE_MASK \
  1572. (wxVSCROLL|wxHSCROLL|wxBORDER_MASK|wxALWAYS_SHOW_SB|wxCLIP_CHILDREN| \
  1573. wxCLIP_SIBLINGS|wxTRANSPARENT_WINDOW|wxTAB_TRAVERSAL|wxWANTS_CHARS| \
  1574. wxRETAINED|wxPOPUP_WINDOW|wxFULL_REPAINT_ON_RESIZE)
  1575. /*
  1576. * Extra window style flags (use wxWS_EX prefix to make it clear that they
  1577. * should be passed to wxWindow::SetExtraStyle(), not SetWindowStyle())
  1578. */
  1579. /* by default, TransferDataTo/FromWindow() only work on direct children of the */
  1580. /* window (compatible behaviour), set this flag to make them recursively */
  1581. /* descend into all subwindows */
  1582. #define wxWS_EX_VALIDATE_RECURSIVELY 0x00000001
  1583. /* wxCommandEvents and the objects of the derived classes are forwarded to the */
  1584. /* parent window and so on recursively by default. Using this flag for the */
  1585. /* given window allows to block this propagation at this window, i.e. prevent */
  1586. /* the events from being propagated further upwards. The dialogs have this */
  1587. /* flag on by default. */
  1588. #define wxWS_EX_BLOCK_EVENTS 0x00000002
  1589. /* don't use this window as an implicit parent for the other windows: this must */
  1590. /* be used with transient windows as otherwise there is the risk of creating a */
  1591. /* dialog/frame with this window as a parent which would lead to a crash if the */
  1592. /* parent is destroyed before the child */
  1593. #define wxWS_EX_TRANSIENT 0x00000004
  1594. /* don't paint the window background, we'll assume it will */
  1595. /* be done by a theming engine. This is not yet used but could */
  1596. /* possibly be made to work in the future, at least on Windows */
  1597. #define wxWS_EX_THEMED_BACKGROUND 0x00000008
  1598. /* this window should always process idle events */
  1599. #define wxWS_EX_PROCESS_IDLE 0x00000010
  1600. /* this window should always process UI update events */
  1601. #define wxWS_EX_PROCESS_UI_UPDATES 0x00000020
  1602. /* Draw the window in a metal theme on Mac */
  1603. #define wxFRAME_EX_METAL 0x00000040
  1604. #define wxDIALOG_EX_METAL 0x00000040
  1605. /* Use this style to add a context-sensitive help to the window (currently for */
  1606. /* Win32 only and it doesn't work if wxMINIMIZE_BOX or wxMAXIMIZE_BOX are used) */
  1607. #define wxWS_EX_CONTEXTHELP 0x00000080
  1608. /* synonyms for wxWS_EX_CONTEXTHELP for compatibility */
  1609. #define wxFRAME_EX_CONTEXTHELP wxWS_EX_CONTEXTHELP
  1610. #define wxDIALOG_EX_CONTEXTHELP wxWS_EX_CONTEXTHELP
  1611. /* Create a window which is attachable to another top level window */
  1612. #define wxFRAME_DRAWER 0x0020
  1613. /*
  1614. * MDI parent frame style flags
  1615. * Can overlap with some of the above.
  1616. */
  1617. #define wxFRAME_NO_WINDOW_MENU 0x0100
  1618. /*
  1619. * wxMenuBar style flags
  1620. */
  1621. /* use native docking */
  1622. #define wxMB_DOCKABLE 0x0001
  1623. /*
  1624. * wxMenu style flags
  1625. */
  1626. #define wxMENU_TEAROFF 0x0001
  1627. /*
  1628. * Apply to all panel items
  1629. */
  1630. #define wxCOLOURED 0x0800
  1631. #define wxFIXED_LENGTH 0x0400
  1632. /*
  1633. * Styles for wxListBox
  1634. */
  1635. #define wxLB_SORT 0x0010
  1636. #define wxLB_SINGLE 0x0020
  1637. #define wxLB_MULTIPLE 0x0040
  1638. #define wxLB_EXTENDED 0x0080
  1639. /* wxLB_OWNERDRAW is Windows-only */
  1640. #define wxLB_NEEDED_SB 0x0000
  1641. #define wxLB_OWNERDRAW 0x0100
  1642. #define wxLB_ALWAYS_SB 0x0200
  1643. #define wxLB_NO_SB 0x0400
  1644. #define wxLB_HSCROLL wxHSCROLL
  1645. /* always show an entire number of rows */
  1646. #define wxLB_INT_HEIGHT 0x0800
  1647. #if WXWIN_COMPATIBILITY_2_6
  1648. /* deprecated synonyms */
  1649. #define wxPROCESS_ENTER 0x0400 /* wxTE_PROCESS_ENTER */
  1650. #define wxPASSWORD 0x0800 /* wxTE_PASSWORD */
  1651. #endif
  1652. /*
  1653. * wxComboBox style flags
  1654. */
  1655. #define wxCB_SIMPLE 0x0004
  1656. #define wxCB_SORT 0x0008
  1657. #define wxCB_READONLY 0x0010
  1658. #define wxCB_DROPDOWN 0x0020
  1659. /*
  1660. * wxRadioBox style flags
  1661. */
  1662. /* should we number the items from left to right or from top to bottom in a 2d */
  1663. /* radiobox? */
  1664. #define wxRA_LEFTTORIGHT 0x0001
  1665. #define wxRA_TOPTOBOTTOM 0x0002
  1666. /* New, more intuitive names to specify majorDim argument */
  1667. #define wxRA_SPECIFY_COLS wxHORIZONTAL
  1668. #define wxRA_SPECIFY_ROWS wxVERTICAL
  1669. /* Old names for compatibility */
  1670. #define wxRA_HORIZONTAL wxHORIZONTAL
  1671. #define wxRA_VERTICAL wxVERTICAL
  1672. /*
  1673. * wxRadioButton style flag
  1674. */
  1675. #define wxRB_GROUP 0x0004
  1676. #define wxRB_SINGLE 0x0008
  1677. /*
  1678. * wxScrollBar flags
  1679. */
  1680. #define wxSB_HORIZONTAL wxHORIZONTAL
  1681. #define wxSB_VERTICAL wxVERTICAL
  1682. /*
  1683. * wxSpinButton flags.
  1684. * Note that a wxSpinCtrl is sometimes defined as a wxTextCtrl, and so the
  1685. * flags shouldn't overlap with wxTextCtrl flags that can be used for a single
  1686. * line controls (currently we reuse wxTE_CHARWRAP and wxTE_RICH2 neither of
  1687. * which makes sense for them).
  1688. */
  1689. #define wxSP_HORIZONTAL wxHORIZONTAL /* 4 */
  1690. #define wxSP_VERTICAL wxVERTICAL /* 8 */
  1691. #define wxSP_ARROW_KEYS 0x4000
  1692. #define wxSP_WRAP 0x8000
  1693. /*
  1694. * wxTabCtrl flags
  1695. */
  1696. #define wxTC_RIGHTJUSTIFY 0x0010
  1697. #define wxTC_FIXEDWIDTH 0x0020
  1698. #define wxTC_TOP 0x0000 /* default */
  1699. #define wxTC_LEFT 0x0020
  1700. #define wxTC_RIGHT 0x0040
  1701. #define wxTC_BOTTOM 0x0080
  1702. #define wxTC_MULTILINE 0x0200 /* == wxNB_MULTILINE */
  1703. #define wxTC_OWNERDRAW 0x0400
  1704. /*
  1705. * wxStaticBitmap flags
  1706. */
  1707. #define wxBI_EXPAND wxEXPAND
  1708. /*
  1709. * wxStaticLine flags
  1710. */
  1711. #define wxLI_HORIZONTAL wxHORIZONTAL
  1712. #define wxLI_VERTICAL wxVERTICAL
  1713. /*
  1714. * extended dialog specifiers. these values are stored in a different
  1715. * flag and thus do not overlap with other style flags. note that these
  1716. * values do not correspond to the return values of the dialogs (for
  1717. * those values, look at the wxID_XXX defines).
  1718. */
  1719. /* wxCENTRE already defined as 0x00000001 */
  1720. #define wxYES 0x00000002
  1721. #define wxOK 0x00000004
  1722. #define wxNO 0x00000008
  1723. #define wxYES_NO (wxYES | wxNO)
  1724. #define wxCANCEL 0x00000010
  1725. #define wxAPPLY 0x00000020
  1726. #define wxCLOSE 0x00000040
  1727. #define wxOK_DEFAULT 0x00000000 /* has no effect (default) */
  1728. #define wxYES_DEFAULT 0x00000000 /* has no effect (default) */
  1729. #define wxNO_DEFAULT 0x00000080 /* only valid with wxYES_NO */
  1730. #define wxCANCEL_DEFAULT 0x80000000 /* only valid with wxCANCEL */
  1731. #define wxICON_EXCLAMATION 0x00000100
  1732. #define wxICON_HAND 0x00000200
  1733. #define wxICON_WARNING wxICON_EXCLAMATION
  1734. #define wxICON_ERROR wxICON_HAND
  1735. #define wxICON_QUESTION 0x00000400
  1736. #define wxICON_INFORMATION 0x00000800
  1737. #define wxICON_STOP wxICON_HAND
  1738. #define wxICON_ASTERISK wxICON_INFORMATION
  1739. #define wxHELP 0x00001000
  1740. #define wxFORWARD 0x00002000
  1741. #define wxBACKWARD 0x00004000
  1742. #define wxRESET 0x00008000
  1743. #define wxMORE 0x00010000
  1744. #define wxSETUP 0x00020000
  1745. #define wxICON_NONE 0x00040000
  1746. #define wxICON_AUTH_NEEDED 0x00080000
  1747. #define wxICON_MASK \
  1748. (wxICON_EXCLAMATION|wxICON_HAND|wxICON_QUESTION|wxICON_INFORMATION|wxICON_NONE|wxICON_AUTH_NEEDED)
  1749. /*
  1750. * Background styles. See wxWindow::SetBackgroundStyle
  1751. */
  1752. enum wxBackgroundStyle
  1753. {
  1754. /*
  1755. background is erased in the EVT_ERASE_BACKGROUND handler or using
  1756. the system default background if no such handler is defined (this
  1757. is the default style)
  1758. */
  1759. wxBG_STYLE_ERASE,
  1760. /*
  1761. background is erased by the system, no EVT_ERASE_BACKGROUND event
  1762. is generated at all
  1763. */
  1764. wxBG_STYLE_SYSTEM,
  1765. /*
  1766. background is erased in EVT_PAINT handler and not erased at all
  1767. before it, this should be used if the paint handler paints over
  1768. the entire window to avoid flicker
  1769. */
  1770. wxBG_STYLE_PAINT,
  1771. /*
  1772. Indicates that the window background is not erased, letting the parent
  1773. window show through.
  1774. */
  1775. wxBG_STYLE_TRANSPARENT,
  1776. /* this style is deprecated and doesn't do anything, don't use */
  1777. wxBG_STYLE_COLOUR,
  1778. /*
  1779. this style is deprecated and is synonymous with
  1780. wxBG_STYLE_PAINT, use the new name
  1781. */
  1782. wxBG_STYLE_CUSTOM = wxBG_STYLE_PAINT
  1783. };
  1784. /*
  1785. * Key types used by (old style) lists and hashes.
  1786. */
  1787. enum wxKeyType
  1788. {
  1789. wxKEY_NONE,
  1790. wxKEY_INTEGER,
  1791. wxKEY_STRING
  1792. };
  1793. /* ---------------------------------------------------------------------------- */
  1794. /* standard IDs */
  1795. /* ---------------------------------------------------------------------------- */
  1796. /* Standard menu IDs */
  1797. enum wxStandardID
  1798. {
  1799. /*
  1800. These ids delimit the range used by automatically-generated ids
  1801. (i.e. those used when wxID_ANY is specified during construction).
  1802. */
  1803. #if defined(__WXMSW__) || wxUSE_AUTOID_MANAGEMENT
  1804. /*
  1805. On MSW the range is always restricted no matter if id management
  1806. is used or not because the native window ids are limited to short
  1807. range. On other platforms the range is only restricted if id
  1808. management is used so the reference count buffer won't be so big.
  1809. */
  1810. wxID_AUTO_LOWEST = -32000,
  1811. wxID_AUTO_HIGHEST = -2000,
  1812. #else
  1813. wxID_AUTO_LOWEST = -1000000,
  1814. wxID_AUTO_HIGHEST = -2000,
  1815. #endif
  1816. /* no id matches this one when compared to it */
  1817. wxID_NONE = -3,
  1818. /* id for a separator line in the menu (invalid for normal item) */
  1819. wxID_SEPARATOR = -2,
  1820. /* any id: means that we don't care about the id, whether when installing
  1821. * an event handler or when creating a new window */
  1822. wxID_ANY = -1,
  1823. /* all predefined ids are between wxID_LOWEST and wxID_HIGHEST */
  1824. wxID_LOWEST = 4999,
  1825. wxID_OPEN,
  1826. wxID_CLOSE,
  1827. wxID_NEW,
  1828. wxID_SAVE,
  1829. wxID_SAVEAS,
  1830. wxID_REVERT,
  1831. wxID_EXIT,
  1832. wxID_UNDO,
  1833. wxID_REDO,
  1834. wxID_HELP,
  1835. wxID_PRINT,
  1836. wxID_PRINT_SETUP,
  1837. wxID_PAGE_SETUP,
  1838. wxID_PREVIEW,
  1839. wxID_ABOUT,
  1840. wxID_HELP_CONTENTS,
  1841. wxID_HELP_INDEX,
  1842. wxID_HELP_SEARCH,
  1843. wxID_HELP_COMMANDS,
  1844. wxID_HELP_PROCEDURES,
  1845. wxID_HELP_CONTEXT,
  1846. wxID_CLOSE_ALL,
  1847. wxID_PREFERENCES,
  1848. wxID_EDIT = 5030,
  1849. wxID_CUT,
  1850. wxID_COPY,
  1851. wxID_PASTE,
  1852. wxID_CLEAR,
  1853. wxID_FIND,
  1854. wxID_DUPLICATE,
  1855. wxID_SELECTALL,
  1856. wxID_DELETE,
  1857. wxID_REPLACE,
  1858. wxID_REPLACE_ALL,
  1859. wxID_PROPERTIES,
  1860. wxID_VIEW_DETAILS,
  1861. wxID_VIEW_LARGEICONS,
  1862. wxID_VIEW_SMALLICONS,
  1863. wxID_VIEW_LIST,
  1864. wxID_VIEW_SORTDATE,
  1865. wxID_VIEW_SORTNAME,
  1866. wxID_VIEW_SORTSIZE,
  1867. wxID_VIEW_SORTTYPE,
  1868. wxID_FILE = 5050,
  1869. wxID_FILE1,
  1870. wxID_FILE2,
  1871. wxID_FILE3,
  1872. wxID_FILE4,
  1873. wxID_FILE5,
  1874. wxID_FILE6,
  1875. wxID_FILE7,
  1876. wxID_FILE8,
  1877. wxID_FILE9,
  1878. /* Standard button and menu IDs */
  1879. wxID_OK = 5100,
  1880. wxID_CANCEL,
  1881. wxID_APPLY,
  1882. wxID_YES,
  1883. wxID_NO,
  1884. wxID_STATIC,
  1885. wxID_FORWARD,
  1886. wxID_BACKWARD,
  1887. wxID_DEFAULT,
  1888. wxID_MORE,
  1889. wxID_SETUP,
  1890. wxID_RESET,
  1891. wxID_CONTEXT_HELP,
  1892. wxID_YESTOALL,
  1893. wxID_NOTOALL,
  1894. wxID_ABORT,
  1895. wxID_RETRY,
  1896. wxID_IGNORE,
  1897. wxID_ADD,
  1898. wxID_REMOVE,
  1899. wxID_UP,
  1900. wxID_DOWN,
  1901. wxID_HOME,
  1902. wxID_REFRESH,
  1903. wxID_STOP,
  1904. wxID_INDEX,
  1905. wxID_BOLD,
  1906. wxID_ITALIC,
  1907. wxID_JUSTIFY_CENTER,
  1908. wxID_JUSTIFY_FILL,
  1909. wxID_JUSTIFY_RIGHT,
  1910. wxID_JUSTIFY_LEFT,
  1911. wxID_UNDERLINE,
  1912. wxID_INDENT,
  1913. wxID_UNINDENT,
  1914. wxID_ZOOM_100,
  1915. wxID_ZOOM_FIT,
  1916. wxID_ZOOM_IN,
  1917. wxID_ZOOM_OUT,
  1918. wxID_UNDELETE,
  1919. wxID_REVERT_TO_SAVED,
  1920. wxID_CDROM,
  1921. wxID_CONVERT,
  1922. wxID_EXECUTE,
  1923. wxID_FLOPPY,
  1924. wxID_HARDDISK,
  1925. wxID_BOTTOM,
  1926. wxID_FIRST,
  1927. wxID_LAST,
  1928. wxID_TOP,
  1929. wxID_INFO,
  1930. wxID_JUMP_TO,
  1931. wxID_NETWORK,
  1932. wxID_SELECT_COLOR,
  1933. wxID_SELECT_FONT,
  1934. wxID_SORT_ASCENDING,
  1935. wxID_SORT_DESCENDING,
  1936. wxID_SPELL_CHECK,
  1937. wxID_STRIKETHROUGH,
  1938. /* System menu IDs (used by wxUniv): */
  1939. wxID_SYSTEM_MENU = 5200,
  1940. wxID_CLOSE_FRAME,
  1941. wxID_MOVE_FRAME,
  1942. wxID_RESIZE_FRAME,
  1943. wxID_MAXIMIZE_FRAME,
  1944. wxID_ICONIZE_FRAME,
  1945. wxID_RESTORE_FRAME,
  1946. /* MDI window menu ids */
  1947. wxID_MDI_WINDOW_FIRST = 5230,
  1948. wxID_MDI_WINDOW_CASCADE = wxID_MDI_WINDOW_FIRST,
  1949. wxID_MDI_WINDOW_TILE_HORZ,
  1950. wxID_MDI_WINDOW_TILE_VERT,
  1951. wxID_MDI_WINDOW_ARRANGE_ICONS,
  1952. wxID_MDI_WINDOW_PREV,
  1953. wxID_MDI_WINDOW_NEXT,
  1954. wxID_MDI_WINDOW_LAST = wxID_MDI_WINDOW_NEXT,
  1955. /* OS X system menu ids */
  1956. wxID_OSX_MENU_FIRST = 5250,
  1957. wxID_OSX_HIDE = wxID_OSX_MENU_FIRST,
  1958. wxID_OSX_HIDEOTHERS,
  1959. wxID_OSX_SHOWALL,
  1960. #if wxABI_VERSION >= 30001
  1961. wxID_OSX_SERVICES,
  1962. wxID_OSX_MENU_LAST = wxID_OSX_SERVICES,
  1963. #else
  1964. wxID_OSX_MENU_LAST = wxID_OSX_SHOWALL,
  1965. #endif
  1966. /* IDs used by generic file dialog (13 consecutive starting from this value) */
  1967. wxID_FILEDLGG = 5900,
  1968. /* IDs used by generic file ctrl (4 consecutive starting from this value) */
  1969. wxID_FILECTRL = 5950,
  1970. wxID_HIGHEST = 5999
  1971. };
  1972. /* ---------------------------------------------------------------------------- */
  1973. /* wxWindowID type (after wxID_XYZ enum, platform detection, and dlimpexp.h) */
  1974. /* ---------------------------------------------------------------------------- */
  1975. /* special care should be taken with this type under Windows where the real */
  1976. /* window id is unsigned, so we must always do the cast before comparing them */
  1977. /* (or else they would be always different!). Using wxGetWindowId() which does */
  1978. /* the cast itself is recommended. Note that this type can't be unsigned */
  1979. /* because wxID_ANY == -1 is a valid (and largely used) value for window id. */
  1980. #if defined(__cplusplus) && wxUSE_GUI
  1981. #include "wx/windowid.h"
  1982. #endif
  1983. /* ---------------------------------------------------------------------------- */
  1984. /* other constants */
  1985. /* ---------------------------------------------------------------------------- */
  1986. /* menu and toolbar item kinds */
  1987. enum wxItemKind
  1988. {
  1989. wxITEM_SEPARATOR = -1,
  1990. wxITEM_NORMAL,
  1991. wxITEM_CHECK,
  1992. wxITEM_RADIO,
  1993. wxITEM_DROPDOWN,
  1994. wxITEM_MAX
  1995. };
  1996. /*
  1997. * The possible states of a 3-state checkbox (Compatible
  1998. * with the 2-state checkbox).
  1999. */
  2000. enum wxCheckBoxState
  2001. {
  2002. wxCHK_UNCHECKED,
  2003. wxCHK_CHECKED,
  2004. wxCHK_UNDETERMINED /* 3-state checkbox only */
  2005. };
  2006. /* hit test results */
  2007. enum wxHitTest
  2008. {
  2009. wxHT_NOWHERE,
  2010. /* scrollbar */
  2011. wxHT_SCROLLBAR_FIRST = wxHT_NOWHERE,
  2012. wxHT_SCROLLBAR_ARROW_LINE_1, /* left or upper arrow to scroll by line */
  2013. wxHT_SCROLLBAR_ARROW_LINE_2, /* right or down */
  2014. wxHT_SCROLLBAR_ARROW_PAGE_1, /* left or upper arrow to scroll by page */
  2015. wxHT_SCROLLBAR_ARROW_PAGE_2, /* right or down */
  2016. wxHT_SCROLLBAR_THUMB, /* on the thumb */
  2017. wxHT_SCROLLBAR_BAR_1, /* bar to the left/above the thumb */
  2018. wxHT_SCROLLBAR_BAR_2, /* bar to the right/below the thumb */
  2019. wxHT_SCROLLBAR_LAST,
  2020. /* window */
  2021. wxHT_WINDOW_OUTSIDE, /* not in this window at all */
  2022. wxHT_WINDOW_INSIDE, /* in the client area */
  2023. wxHT_WINDOW_VERT_SCROLLBAR, /* on the vertical scrollbar */
  2024. wxHT_WINDOW_HORZ_SCROLLBAR, /* on the horizontal scrollbar */
  2025. wxHT_WINDOW_CORNER, /* on the corner between 2 scrollbars */
  2026. wxHT_MAX
  2027. };
  2028. /* ---------------------------------------------------------------------------- */
  2029. /* Possible SetSize flags */
  2030. /* ---------------------------------------------------------------------------- */
  2031. /* Use internally-calculated width if -1 */
  2032. #define wxSIZE_AUTO_WIDTH 0x0001
  2033. /* Use internally-calculated height if -1 */
  2034. #define wxSIZE_AUTO_HEIGHT 0x0002
  2035. /* Use internally-calculated width and height if each is -1 */
  2036. #define wxSIZE_AUTO (wxSIZE_AUTO_WIDTH|wxSIZE_AUTO_HEIGHT)
  2037. /* Ignore missing (-1) dimensions (use existing). */
  2038. /* For readability only: test for wxSIZE_AUTO_WIDTH/HEIGHT in code. */
  2039. #define wxSIZE_USE_EXISTING 0x0000
  2040. /* Allow -1 as a valid position */
  2041. #define wxSIZE_ALLOW_MINUS_ONE 0x0004
  2042. /* Don't do parent client adjustments (for implementation only) */
  2043. #define wxSIZE_NO_ADJUSTMENTS 0x0008
  2044. /* Change the window position even if it seems to be already correct */
  2045. #define wxSIZE_FORCE 0x0010
  2046. /* Emit size event even if size didn't change */
  2047. #define wxSIZE_FORCE_EVENT 0x0020
  2048. /* ---------------------------------------------------------------------------- */
  2049. /* GDI descriptions */
  2050. /* ---------------------------------------------------------------------------- */
  2051. // Hatch styles used by both pen and brush styles.
  2052. //
  2053. // NB: Do not use these constants directly, they're for internal use only, use
  2054. // wxBRUSHSTYLE_XXX_HATCH and wxPENSTYLE_XXX_HATCH instead.
  2055. enum wxHatchStyle
  2056. {
  2057. wxHATCHSTYLE_INVALID = -1,
  2058. /*
  2059. The value of the first style is chosen to fit with
  2060. wxDeprecatedGUIConstants values below, don't change it.
  2061. */
  2062. wxHATCHSTYLE_FIRST = 111,
  2063. wxHATCHSTYLE_BDIAGONAL = wxHATCHSTYLE_FIRST,
  2064. wxHATCHSTYLE_CROSSDIAG,
  2065. wxHATCHSTYLE_FDIAGONAL,
  2066. wxHATCHSTYLE_CROSS,
  2067. wxHATCHSTYLE_HORIZONTAL,
  2068. wxHATCHSTYLE_VERTICAL,
  2069. wxHATCHSTYLE_LAST = wxHATCHSTYLE_VERTICAL
  2070. };
  2071. /*
  2072. WARNING: the following styles are deprecated; use the
  2073. wxFontFamily, wxFontStyle, wxFontWeight, wxBrushStyle,
  2074. wxPenStyle, wxPenCap, wxPenJoin enum values instead!
  2075. */
  2076. #if FUTURE_WXWIN_COMPATIBILITY_3_0
  2077. /* don't use any elements of this enum in the new code */
  2078. enum wxDeprecatedGUIConstants
  2079. {
  2080. /* Text font families */
  2081. wxDEFAULT = 70,
  2082. wxDECORATIVE,
  2083. wxROMAN,
  2084. wxSCRIPT,
  2085. wxSWISS,
  2086. wxMODERN,
  2087. wxTELETYPE, /* @@@@ */
  2088. /* Proportional or Fixed width fonts (not yet used) */
  2089. wxVARIABLE = 80,
  2090. wxFIXED,
  2091. wxNORMAL = 90,
  2092. wxLIGHT,
  2093. wxBOLD,
  2094. /* Also wxNORMAL for normal (non-italic text) */
  2095. wxITALIC,
  2096. wxSLANT,
  2097. /* Pen styles */
  2098. wxSOLID = 100,
  2099. wxDOT,
  2100. wxLONG_DASH,
  2101. wxSHORT_DASH,
  2102. wxDOT_DASH,
  2103. wxUSER_DASH,
  2104. wxTRANSPARENT,
  2105. /* Brush & Pen Stippling. Note that a stippled pen cannot be dashed!! */
  2106. /* Note also that stippling a Pen IS meaningful, because a Line is */
  2107. wxSTIPPLE_MASK_OPAQUE, /* mask is used for blitting monochrome using text fore and back ground colors */
  2108. wxSTIPPLE_MASK, /* mask is used for masking areas in the stipple bitmap (TO DO) */
  2109. /* drawn with a Pen, and without any Brush -- and it can be stippled. */
  2110. wxSTIPPLE = 110,
  2111. wxBDIAGONAL_HATCH = wxHATCHSTYLE_BDIAGONAL,
  2112. wxCROSSDIAG_HATCH = wxHATCHSTYLE_CROSSDIAG,
  2113. wxFDIAGONAL_HATCH = wxHATCHSTYLE_FDIAGONAL,
  2114. wxCROSS_HATCH = wxHATCHSTYLE_CROSS,
  2115. wxHORIZONTAL_HATCH = wxHATCHSTYLE_HORIZONTAL,
  2116. wxVERTICAL_HATCH = wxHATCHSTYLE_VERTICAL,
  2117. wxFIRST_HATCH = wxHATCHSTYLE_FIRST,
  2118. wxLAST_HATCH = wxHATCHSTYLE_LAST
  2119. };
  2120. #endif
  2121. /* ToolPanel in wxFrame (VZ: unused?) */
  2122. enum
  2123. {
  2124. wxTOOL_TOP = 1,
  2125. wxTOOL_BOTTOM,
  2126. wxTOOL_LEFT,
  2127. wxTOOL_RIGHT
  2128. };
  2129. /* the values of the format constants should be the same as corresponding */
  2130. /* CF_XXX constants in Windows API */
  2131. enum wxDataFormatId
  2132. {
  2133. wxDF_INVALID = 0,
  2134. wxDF_TEXT = 1, /* CF_TEXT */
  2135. wxDF_BITMAP = 2, /* CF_BITMAP */
  2136. wxDF_METAFILE = 3, /* CF_METAFILEPICT */
  2137. wxDF_SYLK = 4,
  2138. wxDF_DIF = 5,
  2139. wxDF_TIFF = 6,
  2140. wxDF_OEMTEXT = 7, /* CF_OEMTEXT */
  2141. wxDF_DIB = 8, /* CF_DIB */
  2142. wxDF_PALETTE = 9,
  2143. wxDF_PENDATA = 10,
  2144. wxDF_RIFF = 11,
  2145. wxDF_WAVE = 12,
  2146. wxDF_UNICODETEXT = 13,
  2147. wxDF_ENHMETAFILE = 14,
  2148. wxDF_FILENAME = 15, /* CF_HDROP */
  2149. wxDF_LOCALE = 16,
  2150. wxDF_PRIVATE = 20,
  2151. wxDF_HTML = 30, /* Note: does not correspond to CF_ constant */
  2152. wxDF_MAX
  2153. };
  2154. /* Key codes */
  2155. enum wxKeyCode
  2156. {
  2157. WXK_NONE = 0,
  2158. WXK_CONTROL_A = 1,
  2159. WXK_CONTROL_B,
  2160. WXK_CONTROL_C,
  2161. WXK_CONTROL_D,
  2162. WXK_CONTROL_E,
  2163. WXK_CONTROL_F,
  2164. WXK_CONTROL_G,
  2165. WXK_CONTROL_H,
  2166. WXK_CONTROL_I,
  2167. WXK_CONTROL_J,
  2168. WXK_CONTROL_K,
  2169. WXK_CONTROL_L,
  2170. WXK_CONTROL_M,
  2171. WXK_CONTROL_N,
  2172. WXK_CONTROL_O,
  2173. WXK_CONTROL_P,
  2174. WXK_CONTROL_Q,
  2175. WXK_CONTROL_R,
  2176. WXK_CONTROL_S,
  2177. WXK_CONTROL_T,
  2178. WXK_CONTROL_U,
  2179. WXK_CONTROL_V,
  2180. WXK_CONTROL_W,
  2181. WXK_CONTROL_X,
  2182. WXK_CONTROL_Y,
  2183. WXK_CONTROL_Z,
  2184. WXK_BACK = 8, /* backspace */
  2185. WXK_TAB = 9,
  2186. WXK_RETURN = 13,
  2187. WXK_ESCAPE = 27,
  2188. /* values from 33 to 126 are reserved for the standard ASCII characters */
  2189. WXK_SPACE = 32,
  2190. WXK_DELETE = 127,
  2191. /* values from 128 to 255 are reserved for ASCII extended characters
  2192. (note that there isn't a single fixed standard for the meaning
  2193. of these values; avoid them in portable apps!) */
  2194. /* These are not compatible with unicode characters.
  2195. If you want to get a unicode character from a key event, use
  2196. wxKeyEvent::GetUnicodeKey */
  2197. WXK_START = 300,
  2198. WXK_LBUTTON,
  2199. WXK_RBUTTON,
  2200. WXK_CANCEL,
  2201. WXK_MBUTTON,
  2202. WXK_CLEAR,
  2203. WXK_SHIFT,
  2204. WXK_ALT,
  2205. WXK_CONTROL,
  2206. WXK_MENU,
  2207. WXK_PAUSE,
  2208. WXK_CAPITAL,
  2209. WXK_END,
  2210. WXK_HOME,
  2211. WXK_LEFT,
  2212. WXK_UP,
  2213. WXK_RIGHT,
  2214. WXK_DOWN,
  2215. WXK_SELECT,
  2216. WXK_PRINT,
  2217. WXK_EXECUTE,
  2218. WXK_SNAPSHOT,
  2219. WXK_INSERT,
  2220. WXK_HELP,
  2221. WXK_NUMPAD0,
  2222. WXK_NUMPAD1,
  2223. WXK_NUMPAD2,
  2224. WXK_NUMPAD3,
  2225. WXK_NUMPAD4,
  2226. WXK_NUMPAD5,
  2227. WXK_NUMPAD6,
  2228. WXK_NUMPAD7,
  2229. WXK_NUMPAD8,
  2230. WXK_NUMPAD9,
  2231. WXK_MULTIPLY,
  2232. WXK_ADD,
  2233. WXK_SEPARATOR,
  2234. WXK_SUBTRACT,
  2235. WXK_DECIMAL,
  2236. WXK_DIVIDE,
  2237. WXK_F1,
  2238. WXK_F2,
  2239. WXK_F3,
  2240. WXK_F4,
  2241. WXK_F5,
  2242. WXK_F6,
  2243. WXK_F7,
  2244. WXK_F8,
  2245. WXK_F9,
  2246. WXK_F10,
  2247. WXK_F11,
  2248. WXK_F12,
  2249. WXK_F13,
  2250. WXK_F14,
  2251. WXK_F15,
  2252. WXK_F16,
  2253. WXK_F17,
  2254. WXK_F18,
  2255. WXK_F19,
  2256. WXK_F20,
  2257. WXK_F21,
  2258. WXK_F22,
  2259. WXK_F23,
  2260. WXK_F24,
  2261. WXK_NUMLOCK,
  2262. WXK_SCROLL,
  2263. WXK_PAGEUP,
  2264. WXK_PAGEDOWN,
  2265. #if WXWIN_COMPATIBILITY_2_6
  2266. WXK_PRIOR = WXK_PAGEUP,
  2267. WXK_NEXT = WXK_PAGEDOWN,
  2268. #endif
  2269. WXK_NUMPAD_SPACE,
  2270. WXK_NUMPAD_TAB,
  2271. WXK_NUMPAD_ENTER,
  2272. WXK_NUMPAD_F1,
  2273. WXK_NUMPAD_F2,
  2274. WXK_NUMPAD_F3,
  2275. WXK_NUMPAD_F4,
  2276. WXK_NUMPAD_HOME,
  2277. WXK_NUMPAD_LEFT,
  2278. WXK_NUMPAD_UP,
  2279. WXK_NUMPAD_RIGHT,
  2280. WXK_NUMPAD_DOWN,
  2281. WXK_NUMPAD_PAGEUP,
  2282. WXK_NUMPAD_PAGEDOWN,
  2283. #if WXWIN_COMPATIBILITY_2_6
  2284. WXK_NUMPAD_PRIOR = WXK_NUMPAD_PAGEUP,
  2285. WXK_NUMPAD_NEXT = WXK_NUMPAD_PAGEDOWN,
  2286. #endif
  2287. WXK_NUMPAD_END,
  2288. WXK_NUMPAD_BEGIN,
  2289. WXK_NUMPAD_INSERT,
  2290. WXK_NUMPAD_DELETE,
  2291. WXK_NUMPAD_EQUAL,
  2292. WXK_NUMPAD_MULTIPLY,
  2293. WXK_NUMPAD_ADD,
  2294. WXK_NUMPAD_SEPARATOR,
  2295. WXK_NUMPAD_SUBTRACT,
  2296. WXK_NUMPAD_DECIMAL,
  2297. WXK_NUMPAD_DIVIDE,
  2298. WXK_WINDOWS_LEFT,
  2299. WXK_WINDOWS_RIGHT,
  2300. WXK_WINDOWS_MENU ,
  2301. #ifdef __WXOSX__
  2302. WXK_RAW_CONTROL,
  2303. #else
  2304. WXK_RAW_CONTROL = WXK_CONTROL,
  2305. #endif
  2306. WXK_COMMAND = WXK_CONTROL,
  2307. /* Hardware-specific buttons */
  2308. WXK_SPECIAL1 = 193,
  2309. WXK_SPECIAL2,
  2310. WXK_SPECIAL3,
  2311. WXK_SPECIAL4,
  2312. WXK_SPECIAL5,
  2313. WXK_SPECIAL6,
  2314. WXK_SPECIAL7,
  2315. WXK_SPECIAL8,
  2316. WXK_SPECIAL9,
  2317. WXK_SPECIAL10,
  2318. WXK_SPECIAL11,
  2319. WXK_SPECIAL12,
  2320. WXK_SPECIAL13,
  2321. WXK_SPECIAL14,
  2322. WXK_SPECIAL15,
  2323. WXK_SPECIAL16,
  2324. WXK_SPECIAL17,
  2325. WXK_SPECIAL18,
  2326. WXK_SPECIAL19,
  2327. WXK_SPECIAL20
  2328. };
  2329. /* This enum contains bit mask constants used in wxKeyEvent */
  2330. enum wxKeyModifier
  2331. {
  2332. wxMOD_NONE = 0x0000,
  2333. wxMOD_ALT = 0x0001,
  2334. wxMOD_CONTROL = 0x0002,
  2335. wxMOD_ALTGR = wxMOD_ALT | wxMOD_CONTROL,
  2336. wxMOD_SHIFT = 0x0004,
  2337. wxMOD_META = 0x0008,
  2338. wxMOD_WIN = wxMOD_META,
  2339. #if defined(__WXMAC__) || defined(__WXCOCOA__)
  2340. wxMOD_RAW_CONTROL = 0x0010,
  2341. #else
  2342. wxMOD_RAW_CONTROL = wxMOD_CONTROL,
  2343. #endif
  2344. wxMOD_CMD = wxMOD_CONTROL,
  2345. wxMOD_ALL = 0xffff
  2346. };
  2347. /* Shortcut for easier dialog-unit-to-pixel conversion */
  2348. #define wxDLG_UNIT(parent, pt) parent->ConvertDialogToPixels(pt)
  2349. /* Paper types */
  2350. typedef enum
  2351. {
  2352. wxPAPER_NONE, /* Use specific dimensions */
  2353. wxPAPER_LETTER, /* Letter, 8 1/2 by 11 inches */
  2354. wxPAPER_LEGAL, /* Legal, 8 1/2 by 14 inches */
  2355. wxPAPER_A4, /* A4 Sheet, 210 by 297 millimeters */
  2356. wxPAPER_CSHEET, /* C Sheet, 17 by 22 inches */
  2357. wxPAPER_DSHEET, /* D Sheet, 22 by 34 inches */
  2358. wxPAPER_ESHEET, /* E Sheet, 34 by 44 inches */
  2359. wxPAPER_LETTERSMALL, /* Letter Small, 8 1/2 by 11 inches */
  2360. wxPAPER_TABLOID, /* Tabloid, 11 by 17 inches */
  2361. wxPAPER_LEDGER, /* Ledger, 17 by 11 inches */
  2362. wxPAPER_STATEMENT, /* Statement, 5 1/2 by 8 1/2 inches */
  2363. wxPAPER_EXECUTIVE, /* Executive, 7 1/4 by 10 1/2 inches */
  2364. wxPAPER_A3, /* A3 sheet, 297 by 420 millimeters */
  2365. wxPAPER_A4SMALL, /* A4 small sheet, 210 by 297 millimeters */
  2366. wxPAPER_A5, /* A5 sheet, 148 by 210 millimeters */
  2367. wxPAPER_B4, /* B4 sheet, 250 by 354 millimeters */
  2368. wxPAPER_B5, /* B5 sheet, 182-by-257-millimeter paper */
  2369. wxPAPER_FOLIO, /* Folio, 8-1/2-by-13-inch paper */
  2370. wxPAPER_QUARTO, /* Quarto, 215-by-275-millimeter paper */
  2371. wxPAPER_10X14, /* 10-by-14-inch sheet */
  2372. wxPAPER_11X17, /* 11-by-17-inch sheet */
  2373. wxPAPER_NOTE, /* Note, 8 1/2 by 11 inches */
  2374. wxPAPER_ENV_9, /* #9 Envelope, 3 7/8 by 8 7/8 inches */
  2375. wxPAPER_ENV_10, /* #10 Envelope, 4 1/8 by 9 1/2 inches */
  2376. wxPAPER_ENV_11, /* #11 Envelope, 4 1/2 by 10 3/8 inches */
  2377. wxPAPER_ENV_12, /* #12 Envelope, 4 3/4 by 11 inches */
  2378. wxPAPER_ENV_14, /* #14 Envelope, 5 by 11 1/2 inches */
  2379. wxPAPER_ENV_DL, /* DL Envelope, 110 by 220 millimeters */
  2380. wxPAPER_ENV_C5, /* C5 Envelope, 162 by 229 millimeters */
  2381. wxPAPER_ENV_C3, /* C3 Envelope, 324 by 458 millimeters */
  2382. wxPAPER_ENV_C4, /* C4 Envelope, 229 by 324 millimeters */
  2383. wxPAPER_ENV_C6, /* C6 Envelope, 114 by 162 millimeters */
  2384. wxPAPER_ENV_C65, /* C65 Envelope, 114 by 229 millimeters */
  2385. wxPAPER_ENV_B4, /* B4 Envelope, 250 by 353 millimeters */
  2386. wxPAPER_ENV_B5, /* B5 Envelope, 176 by 250 millimeters */
  2387. wxPAPER_ENV_B6, /* B6 Envelope, 176 by 125 millimeters */
  2388. wxPAPER_ENV_ITALY, /* Italy Envelope, 110 by 230 millimeters */
  2389. wxPAPER_ENV_MONARCH, /* Monarch Envelope, 3 7/8 by 7 1/2 inches */
  2390. wxPAPER_ENV_PERSONAL, /* 6 3/4 Envelope, 3 5/8 by 6 1/2 inches */
  2391. wxPAPER_FANFOLD_US, /* US Std Fanfold, 14 7/8 by 11 inches */
  2392. wxPAPER_FANFOLD_STD_GERMAN, /* German Std Fanfold, 8 1/2 by 12 inches */
  2393. wxPAPER_FANFOLD_LGL_GERMAN, /* German Legal Fanfold, 8 1/2 by 13 inches */
  2394. wxPAPER_ISO_B4, /* B4 (ISO) 250 x 353 mm */
  2395. wxPAPER_JAPANESE_POSTCARD, /* Japanese Postcard 100 x 148 mm */
  2396. wxPAPER_9X11, /* 9 x 11 in */
  2397. wxPAPER_10X11, /* 10 x 11 in */
  2398. wxPAPER_15X11, /* 15 x 11 in */
  2399. wxPAPER_ENV_INVITE, /* Envelope Invite 220 x 220 mm */
  2400. wxPAPER_LETTER_EXTRA, /* Letter Extra 9 \275 x 12 in */
  2401. wxPAPER_LEGAL_EXTRA, /* Legal Extra 9 \275 x 15 in */
  2402. wxPAPER_TABLOID_EXTRA, /* Tabloid Extra 11.69 x 18 in */
  2403. wxPAPER_A4_EXTRA, /* A4 Extra 9.27 x 12.69 in */
  2404. wxPAPER_LETTER_TRANSVERSE, /* Letter Transverse 8 \275 x 11 in */
  2405. wxPAPER_A4_TRANSVERSE, /* A4 Transverse 210 x 297 mm */
  2406. wxPAPER_LETTER_EXTRA_TRANSVERSE, /* Letter Extra Transverse 9\275 x 12 in */
  2407. wxPAPER_A_PLUS, /* SuperA/SuperA/A4 227 x 356 mm */
  2408. wxPAPER_B_PLUS, /* SuperB/SuperB/A3 305 x 487 mm */
  2409. wxPAPER_LETTER_PLUS, /* Letter Plus 8.5 x 12.69 in */
  2410. wxPAPER_A4_PLUS, /* A4 Plus 210 x 330 mm */
  2411. wxPAPER_A5_TRANSVERSE, /* A5 Transverse 148 x 210 mm */
  2412. wxPAPER_B5_TRANSVERSE, /* B5 (JIS) Transverse 182 x 257 mm */
  2413. wxPAPER_A3_EXTRA, /* A3 Extra 322 x 445 mm */
  2414. wxPAPER_A5_EXTRA, /* A5 Extra 174 x 235 mm */
  2415. wxPAPER_B5_EXTRA, /* B5 (ISO) Extra 201 x 276 mm */
  2416. wxPAPER_A2, /* A2 420 x 594 mm */
  2417. wxPAPER_A3_TRANSVERSE, /* A3 Transverse 297 x 420 mm */
  2418. wxPAPER_A3_EXTRA_TRANSVERSE, /* A3 Extra Transverse 322 x 445 mm */
  2419. wxPAPER_DBL_JAPANESE_POSTCARD,/* Japanese Double Postcard 200 x 148 mm */
  2420. wxPAPER_A6, /* A6 105 x 148 mm */
  2421. wxPAPER_JENV_KAKU2, /* Japanese Envelope Kaku #2 */
  2422. wxPAPER_JENV_KAKU3, /* Japanese Envelope Kaku #3 */
  2423. wxPAPER_JENV_CHOU3, /* Japanese Envelope Chou #3 */
  2424. wxPAPER_JENV_CHOU4, /* Japanese Envelope Chou #4 */
  2425. wxPAPER_LETTER_ROTATED, /* Letter Rotated 11 x 8 1/2 in */
  2426. wxPAPER_A3_ROTATED, /* A3 Rotated 420 x 297 mm */
  2427. wxPAPER_A4_ROTATED, /* A4 Rotated 297 x 210 mm */
  2428. wxPAPER_A5_ROTATED, /* A5 Rotated 210 x 148 mm */
  2429. wxPAPER_B4_JIS_ROTATED, /* B4 (JIS) Rotated 364 x 257 mm */
  2430. wxPAPER_B5_JIS_ROTATED, /* B5 (JIS) Rotated 257 x 182 mm */
  2431. wxPAPER_JAPANESE_POSTCARD_ROTATED,/* Japanese Postcard Rotated 148 x 100 mm */
  2432. wxPAPER_DBL_JAPANESE_POSTCARD_ROTATED,/* Double Japanese Postcard Rotated 148 x 200 mm */
  2433. wxPAPER_A6_ROTATED, /* A6 Rotated 148 x 105 mm */
  2434. wxPAPER_JENV_KAKU2_ROTATED, /* Japanese Envelope Kaku #2 Rotated */
  2435. wxPAPER_JENV_KAKU3_ROTATED, /* Japanese Envelope Kaku #3 Rotated */
  2436. wxPAPER_JENV_CHOU3_ROTATED, /* Japanese Envelope Chou #3 Rotated */
  2437. wxPAPER_JENV_CHOU4_ROTATED, /* Japanese Envelope Chou #4 Rotated */
  2438. wxPAPER_B6_JIS, /* B6 (JIS) 128 x 182 mm */
  2439. wxPAPER_B6_JIS_ROTATED, /* B6 (JIS) Rotated 182 x 128 mm */
  2440. wxPAPER_12X11, /* 12 x 11 in */
  2441. wxPAPER_JENV_YOU4, /* Japanese Envelope You #4 */
  2442. wxPAPER_JENV_YOU4_ROTATED, /* Japanese Envelope You #4 Rotated */
  2443. wxPAPER_P16K, /* PRC 16K 146 x 215 mm */
  2444. wxPAPER_P32K, /* PRC 32K 97 x 151 mm */
  2445. wxPAPER_P32KBIG, /* PRC 32K(Big) 97 x 151 mm */
  2446. wxPAPER_PENV_1, /* PRC Envelope #1 102 x 165 mm */
  2447. wxPAPER_PENV_2, /* PRC Envelope #2 102 x 176 mm */
  2448. wxPAPER_PENV_3, /* PRC Envelope #3 125 x 176 mm */
  2449. wxPAPER_PENV_4, /* PRC Envelope #4 110 x 208 mm */
  2450. wxPAPER_PENV_5, /* PRC Envelope #5 110 x 220 mm */
  2451. wxPAPER_PENV_6, /* PRC Envelope #6 120 x 230 mm */
  2452. wxPAPER_PENV_7, /* PRC Envelope #7 160 x 230 mm */
  2453. wxPAPER_PENV_8, /* PRC Envelope #8 120 x 309 mm */
  2454. wxPAPER_PENV_9, /* PRC Envelope #9 229 x 324 mm */
  2455. wxPAPER_PENV_10, /* PRC Envelope #10 324 x 458 mm */
  2456. wxPAPER_P16K_ROTATED, /* PRC 16K Rotated */
  2457. wxPAPER_P32K_ROTATED, /* PRC 32K Rotated */
  2458. wxPAPER_P32KBIG_ROTATED, /* PRC 32K(Big) Rotated */
  2459. wxPAPER_PENV_1_ROTATED, /* PRC Envelope #1 Rotated 165 x 102 mm */
  2460. wxPAPER_PENV_2_ROTATED, /* PRC Envelope #2 Rotated 176 x 102 mm */
  2461. wxPAPER_PENV_3_ROTATED, /* PRC Envelope #3 Rotated 176 x 125 mm */
  2462. wxPAPER_PENV_4_ROTATED, /* PRC Envelope #4 Rotated 208 x 110 mm */
  2463. wxPAPER_PENV_5_ROTATED, /* PRC Envelope #5 Rotated 220 x 110 mm */
  2464. wxPAPER_PENV_6_ROTATED, /* PRC Envelope #6 Rotated 230 x 120 mm */
  2465. wxPAPER_PENV_7_ROTATED, /* PRC Envelope #7 Rotated 230 x 160 mm */
  2466. wxPAPER_PENV_8_ROTATED, /* PRC Envelope #8 Rotated 309 x 120 mm */
  2467. wxPAPER_PENV_9_ROTATED, /* PRC Envelope #9 Rotated 324 x 229 mm */
  2468. wxPAPER_PENV_10_ROTATED, /* PRC Envelope #10 Rotated 458 x 324 m */
  2469. wxPAPER_A0, /* A0 Sheet 841 x 1189 mm */
  2470. wxPAPER_A1 /* A1 Sheet 594 x 841 mm */
  2471. } wxPaperSize;
  2472. /* Printing orientation */
  2473. enum wxPrintOrientation
  2474. {
  2475. wxPORTRAIT = 1,
  2476. wxLANDSCAPE
  2477. };
  2478. /* Duplex printing modes
  2479. */
  2480. enum wxDuplexMode
  2481. {
  2482. wxDUPLEX_SIMPLEX, /* Non-duplex */
  2483. wxDUPLEX_HORIZONTAL,
  2484. wxDUPLEX_VERTICAL
  2485. };
  2486. /* Print quality.
  2487. */
  2488. #define wxPRINT_QUALITY_HIGH -1
  2489. #define wxPRINT_QUALITY_MEDIUM -2
  2490. #define wxPRINT_QUALITY_LOW -3
  2491. #define wxPRINT_QUALITY_DRAFT -4
  2492. typedef int wxPrintQuality;
  2493. /* Print mode (currently PostScript only)
  2494. */
  2495. enum wxPrintMode
  2496. {
  2497. wxPRINT_MODE_NONE = 0,
  2498. wxPRINT_MODE_PREVIEW = 1, /* Preview in external application */
  2499. wxPRINT_MODE_FILE = 2, /* Print to file */
  2500. wxPRINT_MODE_PRINTER = 3, /* Send to printer */
  2501. wxPRINT_MODE_STREAM = 4 /* Send postscript data into a stream */
  2502. };
  2503. /* ---------------------------------------------------------------------------- */
  2504. /* UpdateWindowUI flags */
  2505. /* ---------------------------------------------------------------------------- */
  2506. enum wxUpdateUI
  2507. {
  2508. wxUPDATE_UI_NONE = 0x0000,
  2509. wxUPDATE_UI_RECURSE = 0x0001,
  2510. wxUPDATE_UI_FROMIDLE = 0x0002 /* Invoked from On(Internal)Idle */
  2511. };
  2512. /* ---------------------------------------------------------------------------- */
  2513. /* wxList types */
  2514. /* ---------------------------------------------------------------------------- */
  2515. /* type of compare function for list sort operation (as in 'qsort'): it should
  2516. return a negative value, 0 or positive value if the first element is less
  2517. than, equal or greater than the second */
  2518. typedef int (* LINKAGEMODE wxSortCompareFunction)(const void *elem1, const void *elem2);
  2519. /* wxList iterator function */
  2520. typedef int (* LINKAGEMODE wxListIterateFunction)(void *current);
  2521. /* ---------------------------------------------------------------------------- */
  2522. /* miscellaneous */
  2523. /* ---------------------------------------------------------------------------- */
  2524. /* define this macro if font handling is done using the X font names */
  2525. #if (defined(__WXGTK__) && !defined(__WXGTK20__)) || defined(__X__)
  2526. #define _WX_X_FONTLIKE
  2527. #endif
  2528. /* macro to specify "All Files" on different platforms */
  2529. #if defined(__WXMSW__) || defined(__WXPM__)
  2530. # define wxALL_FILES_PATTERN wxT("*.*")
  2531. # define wxALL_FILES gettext_noop("All files (*.*)|*.*")
  2532. #else
  2533. # define wxALL_FILES_PATTERN wxT("*")
  2534. # define wxALL_FILES gettext_noop("All files (*)|*")
  2535. #endif
  2536. #if defined(__CYGWIN__) && defined(__WXMSW__)
  2537. # if wxUSE_STD_CONTAINERS || defined(wxUSE_STD_STRING)
  2538. /*
  2539. NASTY HACK because the gethostname in sys/unistd.h which the gnu
  2540. stl includes and wx builds with by default clash with each other
  2541. (windows version 2nd param is int, sys/unistd.h version is unsigned
  2542. int).
  2543. */
  2544. # define gethostname gethostnameHACK
  2545. # include <unistd.h>
  2546. # undef gethostname
  2547. # endif
  2548. #endif
  2549. /* --------------------------------------------------------------------------- */
  2550. /* macros that enable wxWidgets apps to be compiled in absence of the */
  2551. /* system headers, although some platform specific types are used in the */
  2552. /* platform specific (implementation) parts of the headers */
  2553. /* --------------------------------------------------------------------------- */
  2554. #ifdef __DARWIN__
  2555. #define DECLARE_WXOSX_OPAQUE_CFREF( name ) typedef struct __##name* name##Ref;
  2556. #define DECLARE_WXOSX_OPAQUE_CONST_CFREF( name ) typedef const struct __##name* name##Ref;
  2557. #endif
  2558. #ifdef __WXMAC__
  2559. #define WX_OPAQUE_TYPE( name ) struct wxOpaque##name
  2560. typedef void* WXHBITMAP;
  2561. typedef void* WXHCURSOR;
  2562. typedef void* WXRECTPTR;
  2563. typedef void* WXPOINTPTR;
  2564. typedef void* WXHWND;
  2565. typedef void* WXEVENTREF;
  2566. typedef void* WXEVENTHANDLERREF;
  2567. typedef void* WXEVENTHANDLERCALLREF;
  2568. typedef void* WXAPPLEEVENTREF;
  2569. typedef unsigned int WXUINT;
  2570. typedef unsigned long WXDWORD;
  2571. typedef unsigned short WXWORD;
  2572. typedef WX_OPAQUE_TYPE(PicHandle ) * WXHMETAFILE ;
  2573. #if wxOSX_USE_CARBON
  2574. typedef struct OpaqueControlRef* WXWidget ;
  2575. typedef struct OpaqueWindowPtr* WXWindow ;
  2576. typedef struct __AGLPixelFormatRec *WXGLPixelFormat;
  2577. typedef struct __AGLContextRec *WXGLContext;
  2578. #endif
  2579. typedef void* WXDisplay;
  2580. /*
  2581. * core frameworks
  2582. */
  2583. typedef const void * CFTypeRef;
  2584. /* typedef const struct __CFString * CFStringRef; */
  2585. DECLARE_WXOSX_OPAQUE_CONST_CFREF( CFString )
  2586. typedef struct __CFString * CFMutableStringRef;
  2587. DECLARE_WXOSX_OPAQUE_CFREF( CFRunLoopSource )
  2588. DECLARE_WXOSX_OPAQUE_CONST_CFREF( CTFont )
  2589. DECLARE_WXOSX_OPAQUE_CONST_CFREF( CTFontDescriptor )
  2590. #define DECLARE_WXOSX_OPAQUE_CGREF( name ) typedef struct name* name##Ref;
  2591. DECLARE_WXOSX_OPAQUE_CGREF( CGColor )
  2592. DECLARE_WXOSX_OPAQUE_CGREF( CGImage )
  2593. DECLARE_WXOSX_OPAQUE_CGREF( CGContext )
  2594. DECLARE_WXOSX_OPAQUE_CGREF( CGFont )
  2595. typedef CGColorRef WXCOLORREF;
  2596. typedef CGImageRef WXCGIMAGEREF;
  2597. typedef CGContextRef WXHDC;
  2598. /*
  2599. * carbon
  2600. */
  2601. typedef const struct __HIShape * HIShapeRef;
  2602. typedef struct __HIShape * HIMutableShapeRef;
  2603. #define DECLARE_WXMAC_OPAQUE_REF( name ) typedef struct Opaque##name* name;
  2604. DECLARE_WXMAC_OPAQUE_REF( PasteboardRef )
  2605. DECLARE_WXMAC_OPAQUE_REF( IconRef )
  2606. DECLARE_WXMAC_OPAQUE_REF( MenuRef )
  2607. typedef IconRef WXHICON ;
  2608. typedef HIShapeRef WXHRGN;
  2609. #if wxOSX_USE_CARBON
  2610. typedef MenuRef WXHMENU;
  2611. #endif
  2612. #endif
  2613. #if defined( __WXCOCOA__ ) || defined(__WXMAC__)
  2614. /* Definitions of 32-bit/64-bit types
  2615. * These are typedef'd exactly the same way in newer OS X headers so
  2616. * redefinition when real headers are included should not be a problem. If
  2617. * it is, the types are being defined wrongly here.
  2618. * The purpose of these types is so they can be used from public wx headers.
  2619. * and also because the older (pre-Leopard) headers don't define them.
  2620. */
  2621. /* NOTE: We don't pollute namespace with CGFLOAT_MIN/MAX/IS_DOUBLE macros
  2622. * since they are unlikely to be needed in a public header.
  2623. */
  2624. #if defined(__LP64__) && __LP64__
  2625. typedef double CGFloat;
  2626. #else
  2627. typedef float CGFloat;
  2628. #endif
  2629. #if (defined(__LP64__) && __LP64__) || (defined(NS_BUILD_32_LIKE_64) && NS_BUILD_32_LIKE_64)
  2630. typedef long NSInteger;
  2631. typedef unsigned long NSUInteger;
  2632. #else
  2633. typedef int NSInteger;
  2634. typedef unsigned int NSUInteger;
  2635. #endif
  2636. /* Objective-C type declarations.
  2637. * These are to be used in public headers in lieu of NSSomething* because
  2638. * Objective-C class names are not available in C/C++ code.
  2639. */
  2640. /* NOTE: This ought to work with other compilers too, but I'm being cautious */
  2641. #if (defined(__GNUC__) && defined(__APPLE__))
  2642. /* It's desirable to have type safety for Objective-C(++) code as it does
  2643. at least catch typos of method names among other things. However, it
  2644. is not possible to declare an Objective-C class from plain old C or C++
  2645. code. Furthermore, because of C++ name mangling, the type name must
  2646. be the same for both C++ and Objective-C++ code. Therefore, we define
  2647. what should be a pointer to an Objective-C class as a pointer to a plain
  2648. old C struct with the same name. Unfortunately, because the compiler
  2649. does not see a struct as an Objective-C class we cannot declare it
  2650. as a struct in Objective-C(++) mode.
  2651. */
  2652. #if defined(__OBJC__)
  2653. #define DECLARE_WXCOCOA_OBJC_CLASS(klass) \
  2654. @class klass; \
  2655. typedef klass *WX_##klass
  2656. #else /* not defined(__OBJC__) */
  2657. #define DECLARE_WXCOCOA_OBJC_CLASS(klass) \
  2658. typedef struct klass *WX_##klass
  2659. #endif /* defined(__OBJC__) */
  2660. #else /* not Apple's gcc */
  2661. #warning "Objective-C types will not be checked by the compiler."
  2662. /* NOTE: typedef struct objc_object *id; */
  2663. /* IOW, we're declaring these using the id type without using that name, */
  2664. /* since "id" is used extensively not only within wxWidgets itself, but */
  2665. /* also in wxWidgets application code. The following works fine when */
  2666. /* compiling C(++) code, and works without typesafety for Obj-C(++) code */
  2667. #define DECLARE_WXCOCOA_OBJC_CLASS(klass) \
  2668. typedef struct objc_object *WX_##klass
  2669. #endif /* (defined(__GNUC__) && defined(__APPLE__)) */
  2670. DECLARE_WXCOCOA_OBJC_CLASS(NSApplication);
  2671. DECLARE_WXCOCOA_OBJC_CLASS(NSBitmapImageRep);
  2672. DECLARE_WXCOCOA_OBJC_CLASS(NSBox);
  2673. DECLARE_WXCOCOA_OBJC_CLASS(NSButton);
  2674. DECLARE_WXCOCOA_OBJC_CLASS(NSColor);
  2675. DECLARE_WXCOCOA_OBJC_CLASS(NSColorPanel);
  2676. DECLARE_WXCOCOA_OBJC_CLASS(NSControl);
  2677. DECLARE_WXCOCOA_OBJC_CLASS(NSCursor);
  2678. DECLARE_WXCOCOA_OBJC_CLASS(NSEvent);
  2679. DECLARE_WXCOCOA_OBJC_CLASS(NSFont);
  2680. DECLARE_WXCOCOA_OBJC_CLASS(NSFontDescriptor);
  2681. DECLARE_WXCOCOA_OBJC_CLASS(NSFontPanel);
  2682. DECLARE_WXCOCOA_OBJC_CLASS(NSImage);
  2683. DECLARE_WXCOCOA_OBJC_CLASS(NSLayoutManager);
  2684. DECLARE_WXCOCOA_OBJC_CLASS(NSMenu);
  2685. DECLARE_WXCOCOA_OBJC_CLASS(NSMenuExtra);
  2686. DECLARE_WXCOCOA_OBJC_CLASS(NSMenuItem);
  2687. DECLARE_WXCOCOA_OBJC_CLASS(NSMutableArray);
  2688. DECLARE_WXCOCOA_OBJC_CLASS(NSNotification);
  2689. DECLARE_WXCOCOA_OBJC_CLASS(NSObject);
  2690. DECLARE_WXCOCOA_OBJC_CLASS(NSPanel);
  2691. DECLARE_WXCOCOA_OBJC_CLASS(NSResponder);
  2692. DECLARE_WXCOCOA_OBJC_CLASS(NSScrollView);
  2693. DECLARE_WXCOCOA_OBJC_CLASS(NSSound);
  2694. DECLARE_WXCOCOA_OBJC_CLASS(NSStatusItem);
  2695. DECLARE_WXCOCOA_OBJC_CLASS(NSTableColumn);
  2696. DECLARE_WXCOCOA_OBJC_CLASS(NSTableView);
  2697. DECLARE_WXCOCOA_OBJC_CLASS(NSTextContainer);
  2698. DECLARE_WXCOCOA_OBJC_CLASS(NSTextField);
  2699. DECLARE_WXCOCOA_OBJC_CLASS(NSTextStorage);
  2700. DECLARE_WXCOCOA_OBJC_CLASS(NSThread);
  2701. DECLARE_WXCOCOA_OBJC_CLASS(NSWindow);
  2702. DECLARE_WXCOCOA_OBJC_CLASS(NSView);
  2703. DECLARE_WXCOCOA_OBJC_CLASS(NSOpenGLContext);
  2704. DECLARE_WXCOCOA_OBJC_CLASS(NSOpenGLPixelFormat);
  2705. DECLARE_WXCOCOA_OBJC_CLASS( NSPrintInfo );
  2706. #ifndef __WXMAC__
  2707. typedef WX_NSView WXWidget; /* wxWidgets BASE definition */
  2708. #endif
  2709. #endif /* __WXCOCOA__ || ( __WXMAC__ &__DARWIN__)*/
  2710. #ifdef __WXMAC__
  2711. DECLARE_WXCOCOA_OBJC_CLASS(NSString);
  2712. #if wxOSX_USE_COCOA
  2713. typedef WX_NSWindow WXWindow;
  2714. typedef WX_NSView WXWidget;
  2715. typedef WX_NSMenu WXHMENU;
  2716. typedef WX_NSOpenGLPixelFormat WXGLPixelFormat;
  2717. typedef WX_NSOpenGLContext WXGLContext;
  2718. #elif wxOSX_USE_IPHONE
  2719. DECLARE_WXCOCOA_OBJC_CLASS(UIWindow);
  2720. DECLARE_WXCOCOA_OBJC_CLASS(UIView);
  2721. DECLARE_WXCOCOA_OBJC_CLASS(UIFont);
  2722. DECLARE_WXCOCOA_OBJC_CLASS(UIImage);
  2723. DECLARE_WXCOCOA_OBJC_CLASS(UIEvent);
  2724. DECLARE_WXCOCOA_OBJC_CLASS(NSSet);
  2725. DECLARE_WXCOCOA_OBJC_CLASS(EAGLContext);
  2726. typedef WX_UIWindow WXWindow;
  2727. typedef WX_UIView WXWidget;
  2728. typedef WX_EAGLContext WXGLContext;
  2729. typedef WX_NSString* WXGLPixelFormat;
  2730. #endif
  2731. #endif /* __WXMAC__ */
  2732. /* ABX: check __WIN32__ instead of __WXMSW__ for the same MSWBase in any Win32 port */
  2733. #if defined(__WIN32__)
  2734. /* Stand-ins for Windows types to avoid #including all of windows.h */
  2735. #ifndef NO_STRICT
  2736. #define WX_MSW_DECLARE_HANDLE(type) typedef struct type##__ * WX##type
  2737. #else
  2738. #define WX_MSW_DECLARE_HANDLE(type) typedef void * WX##type
  2739. #endif
  2740. typedef void* WXHANDLE;
  2741. WX_MSW_DECLARE_HANDLE(HWND);
  2742. WX_MSW_DECLARE_HANDLE(HICON);
  2743. WX_MSW_DECLARE_HANDLE(HFONT);
  2744. WX_MSW_DECLARE_HANDLE(HMENU);
  2745. WX_MSW_DECLARE_HANDLE(HPEN);
  2746. WX_MSW_DECLARE_HANDLE(HBRUSH);
  2747. WX_MSW_DECLARE_HANDLE(HPALETTE);
  2748. WX_MSW_DECLARE_HANDLE(HCURSOR);
  2749. WX_MSW_DECLARE_HANDLE(HRGN);
  2750. WX_MSW_DECLARE_HANDLE(RECTPTR);
  2751. WX_MSW_DECLARE_HANDLE(HACCEL);
  2752. WX_MSW_DECLARE_HANDLE(HINSTANCE);
  2753. WX_MSW_DECLARE_HANDLE(HBITMAP);
  2754. WX_MSW_DECLARE_HANDLE(HIMAGELIST);
  2755. WX_MSW_DECLARE_HANDLE(HGLOBAL);
  2756. WX_MSW_DECLARE_HANDLE(HDC);
  2757. typedef WXHINSTANCE WXHMODULE;
  2758. #undef WX_MSW_DECLARE_HANDLE
  2759. typedef unsigned int WXUINT;
  2760. typedef unsigned long WXDWORD;
  2761. typedef unsigned short WXWORD;
  2762. typedef unsigned long WXCOLORREF;
  2763. typedef void * WXRGNDATA;
  2764. typedef struct tagMSG WXMSG;
  2765. typedef void * WXHCONV;
  2766. typedef void * WXHKEY;
  2767. typedef void * WXHTREEITEM;
  2768. typedef void * WXDRAWITEMSTRUCT;
  2769. typedef void * WXMEASUREITEMSTRUCT;
  2770. typedef void * WXLPCREATESTRUCT;
  2771. #ifdef __WXMSW__
  2772. typedef WXHWND WXWidget;
  2773. #endif
  2774. #ifdef __WIN64__
  2775. typedef wxUint64 WXWPARAM;
  2776. typedef wxInt64 WXLPARAM;
  2777. typedef wxInt64 WXLRESULT;
  2778. #else
  2779. typedef wxW64 unsigned int WXWPARAM;
  2780. typedef wxW64 long WXLPARAM;
  2781. typedef wxW64 long WXLRESULT;
  2782. #endif
  2783. #if defined(__GNUWIN32__) || defined(__WXMICROWIN__)
  2784. typedef int (*WXFARPROC)();
  2785. #else
  2786. typedef int (__stdcall *WXFARPROC)();
  2787. #endif
  2788. #endif /* __WIN32__ */
  2789. #if defined(__OS2__)
  2790. typedef unsigned long DWORD;
  2791. typedef unsigned short WORD;
  2792. #endif
  2793. #if defined(__WXPM__) || defined(__EMX__)
  2794. #ifdef __WXPM__
  2795. /* Stand-ins for OS/2 types, to avoid #including all of os2.h */
  2796. typedef unsigned long WXHWND;
  2797. typedef unsigned long WXHANDLE;
  2798. typedef unsigned long WXHICON;
  2799. typedef unsigned long WXHFONT;
  2800. typedef unsigned long WXHMENU;
  2801. typedef unsigned long WXHPEN;
  2802. typedef unsigned long WXHBRUSH;
  2803. typedef unsigned long WXHPALETTE;
  2804. typedef unsigned long WXHCURSOR;
  2805. typedef unsigned long WXHRGN;
  2806. typedef unsigned long WXHACCEL;
  2807. typedef unsigned long WXHINSTANCE;
  2808. typedef unsigned long WXHMODULE;
  2809. typedef unsigned long WXHBITMAP;
  2810. typedef unsigned long WXHDC;
  2811. typedef unsigned int WXUINT;
  2812. typedef unsigned long WXDWORD;
  2813. typedef unsigned short WXWORD;
  2814. typedef unsigned long WXCOLORREF;
  2815. typedef void * WXMSG;
  2816. typedef unsigned long WXHTREEITEM;
  2817. typedef void * WXDRAWITEMSTRUCT;
  2818. typedef void * WXMEASUREITEMSTRUCT;
  2819. typedef void * WXLPCREATESTRUCT;
  2820. typedef WXHWND WXWidget;
  2821. #endif
  2822. #ifdef __EMX__
  2823. /* Need a well-known type for WXFARPROC
  2824. below. MPARAM is typedef'ed too late. */
  2825. #define WXWPARAM void *
  2826. #define WXLPARAM void *
  2827. #else
  2828. #define WXWPARAM MPARAM
  2829. #define WXLPARAM MPARAM
  2830. #endif
  2831. #define RECT RECTL
  2832. #define LOGFONT FATTRS
  2833. #define LOWORD SHORT1FROMMP
  2834. #define HIWORD SHORT2FROMMP
  2835. typedef unsigned long WXMPARAM;
  2836. typedef unsigned long WXMSGID;
  2837. typedef void* WXRESULT;
  2838. /* typedef int (*WXFARPROC)(); */
  2839. /* some windows handles not defined by PM */
  2840. typedef unsigned long HANDLE;
  2841. typedef unsigned long HICON;
  2842. typedef unsigned long HFONT;
  2843. typedef unsigned long HMENU;
  2844. typedef unsigned long HPEN;
  2845. typedef unsigned long HBRUSH;
  2846. typedef unsigned long HPALETTE;
  2847. typedef unsigned long HCURSOR;
  2848. typedef unsigned long HINSTANCE;
  2849. typedef unsigned long HIMAGELIST;
  2850. typedef unsigned long HGLOBAL;
  2851. #endif /* WXPM || EMX */
  2852. #if defined (__WXPM__)
  2853. /* WIN32 graphics types for OS/2 GPI */
  2854. /* RGB under OS2 is more like a PALETTEENTRY struct under Windows so we need a real RGB def */
  2855. #define OS2RGB(r,g,b) ((DWORD)((unsigned char)(b) | ((unsigned char)(g) << 8)) | ((unsigned char)(r) << 16))
  2856. typedef unsigned long COLORREF;
  2857. #define GetRValue(rgb) ((unsigned char)((rgb) >> 16))
  2858. #define GetGValue(rgb) ((unsigned char)(((unsigned short)(rgb)) >> 8))
  2859. #define GetBValue(rgb) ((unsigned char)(rgb))
  2860. #define PALETTEINDEX(i) ((COLORREF)(0x01000000 | (DWORD)(WORD)(i)))
  2861. #define PALETTERGB(r,g,b) (0x02000000 | OS2RGB(r,g,b))
  2862. /* OS2's RGB/RGB2 is backwards from this */
  2863. typedef struct tagPALETTEENTRY
  2864. {
  2865. char bRed;
  2866. char bGreen;
  2867. char bBlue;
  2868. char bFlags;
  2869. } PALETTEENTRY;
  2870. typedef struct tagLOGPALETTE
  2871. {
  2872. WORD palVersion;
  2873. WORD palNumentries;
  2874. WORD PALETTEENTRY[1];
  2875. } LOGPALETTE;
  2876. #if (defined(__VISAGECPP__) && (__IBMCPP__ < 400)) || defined (__WATCOMC__)
  2877. /* VA 3.0 for some reason needs base data types when typedefing a proc proto??? */
  2878. typedef void* (_System *WXFARPROC)(unsigned long, unsigned long, void*, void*);
  2879. #else
  2880. #if defined(__EMX__) && !defined(_System)
  2881. #define _System
  2882. #endif
  2883. typedef WXRESULT (_System *WXFARPROC)(WXHWND, WXMSGID, WXWPARAM, WXLPARAM);
  2884. #endif
  2885. #endif /* __WXPM__ */
  2886. #if defined(__WXMOTIF__) || defined(__WXX11__)
  2887. /* Stand-ins for X/Xt/Motif types */
  2888. typedef void* WXWindow;
  2889. typedef void* WXWidget;
  2890. typedef void* WXAppContext;
  2891. typedef void* WXColormap;
  2892. typedef void* WXColor;
  2893. typedef void WXDisplay;
  2894. typedef void WXEvent;
  2895. typedef void* WXCursor;
  2896. typedef void* WXPixmap;
  2897. typedef void* WXFontStructPtr;
  2898. typedef void* WXGC;
  2899. typedef void* WXRegion;
  2900. typedef void* WXFont;
  2901. typedef void* WXImage;
  2902. typedef void* WXFontList;
  2903. typedef void* WXFontSet;
  2904. typedef void* WXRendition;
  2905. typedef void* WXRenderTable;
  2906. typedef void* WXFontType; /* either a XmFontList or XmRenderTable */
  2907. typedef void* WXString;
  2908. typedef unsigned long Atom; /* this might fail on a few architectures */
  2909. typedef long WXPixel; /* safety catch in src/motif/colour.cpp */
  2910. #endif /* Motif */
  2911. #ifdef __WXGTK__
  2912. /* Stand-ins for GLIB types */
  2913. typedef struct _GSList GSList;
  2914. /* Stand-ins for GDK types */
  2915. typedef struct _GdkColor GdkColor;
  2916. typedef struct _GdkCursor GdkCursor;
  2917. typedef struct _GdkDragContext GdkDragContext;
  2918. #if defined(__WXGTK20__)
  2919. typedef struct _GdkAtom* GdkAtom;
  2920. #else
  2921. typedef unsigned long GdkAtom;
  2922. #endif
  2923. #if !defined(__WXGTK3__)
  2924. typedef struct _GdkColormap GdkColormap;
  2925. typedef struct _GdkFont GdkFont;
  2926. typedef struct _GdkGC GdkGC;
  2927. typedef struct _GdkRegion GdkRegion;
  2928. #endif
  2929. #if defined(__WXGTK3__)
  2930. typedef struct _GdkWindow GdkWindow;
  2931. #elif defined(__WXGTK20__)
  2932. typedef struct _GdkDrawable GdkWindow;
  2933. typedef struct _GdkDrawable GdkPixmap;
  2934. #else
  2935. typedef struct _GdkWindow GdkWindow;
  2936. typedef struct _GdkWindow GdkBitmap;
  2937. typedef struct _GdkWindow GdkPixmap;
  2938. #endif
  2939. /* Stand-ins for GTK types */
  2940. typedef struct _GtkWidget GtkWidget;
  2941. typedef struct _GtkRcStyle GtkRcStyle;
  2942. typedef struct _GtkAdjustment GtkAdjustment;
  2943. typedef struct _GtkToolbar GtkToolbar;
  2944. typedef struct _GtkNotebook GtkNotebook;
  2945. typedef struct _GtkNotebookPage GtkNotebookPage;
  2946. typedef struct _GtkAccelGroup GtkAccelGroup;
  2947. typedef struct _GtkSelectionData GtkSelectionData;
  2948. typedef struct _GtkTextBuffer GtkTextBuffer;
  2949. typedef struct _GtkRange GtkRange;
  2950. typedef struct _GtkCellRenderer GtkCellRenderer;
  2951. typedef GtkWidget *WXWidget;
  2952. #ifndef __WXGTK20__
  2953. #define GTK_OBJECT_GET_CLASS(object) (GTK_OBJECT(object)->klass)
  2954. #define GTK_CLASS_TYPE(klass) ((klass)->type)
  2955. #endif
  2956. #endif /* __WXGTK__ */
  2957. #if defined(__WXGTK20__) || (defined(__WXX11__) && wxUSE_UNICODE)
  2958. #define wxUSE_PANGO 1
  2959. #else
  2960. #define wxUSE_PANGO 0
  2961. #endif
  2962. #if wxUSE_PANGO
  2963. /* Stand-ins for Pango types */
  2964. typedef struct _PangoContext PangoContext;
  2965. typedef struct _PangoLayout PangoLayout;
  2966. typedef struct _PangoFontDescription PangoFontDescription;
  2967. #endif
  2968. #ifdef __WXDFB__
  2969. /* DirectFB doesn't have the concept of non-TLW window, so use
  2970. something arbitrary */
  2971. typedef const void* WXWidget;
  2972. #endif /* DFB */
  2973. /* This is required because of clashing macros in windows.h, which may be */
  2974. /* included before or after wxWidgets classes, and therefore must be */
  2975. /* disabled here before any significant wxWidgets headers are included. */
  2976. #ifdef __cplusplus
  2977. #ifdef __WINDOWS__
  2978. #include "wx/msw/winundef.h"
  2979. #endif /* __WINDOWS__ */
  2980. #endif /* __cplusplus */
  2981. /* include the feature test macros */
  2982. #include "wx/features.h"
  2983. /* --------------------------------------------------------------------------- */
  2984. /* macros to define a class without copy ctor nor assignment operator */
  2985. /* --------------------------------------------------------------------------- */
  2986. #define wxDECLARE_NO_COPY_CLASS(classname) \
  2987. private: \
  2988. classname(const classname&); \
  2989. classname& operator=(const classname&)
  2990. #define wxDECLARE_NO_COPY_TEMPLATE_CLASS(classname, arg) \
  2991. private: \
  2992. classname(const classname<arg>&); \
  2993. classname& operator=(const classname<arg>&)
  2994. #define wxDECLARE_NO_COPY_TEMPLATE_CLASS_2(classname, arg1, arg2) \
  2995. private: \
  2996. classname(const classname<arg1, arg2>&); \
  2997. classname& operator=(const classname<arg1, arg2>&)
  2998. #define wxDECLARE_NO_ASSIGN_CLASS(classname) \
  2999. private: \
  3000. classname& operator=(const classname&)
  3001. /* deprecated variants _not_ requiring a semicolon after them */
  3002. #define DECLARE_NO_COPY_CLASS(classname) \
  3003. wxDECLARE_NO_COPY_CLASS(classname);
  3004. #define DECLARE_NO_COPY_TEMPLATE_CLASS(classname, arg) \
  3005. wxDECLARE_NO_COPY_TEMPLATE_CLASS(classname, arg);
  3006. #define DECLARE_NO_ASSIGN_CLASS(classname) \
  3007. wxDECLARE_NO_ASSIGN_CLASS(classname);
  3008. /* --------------------------------------------------------------------------- */
  3009. /* If a manifest is being automatically generated, add common controls 6 to it */
  3010. /* --------------------------------------------------------------------------- */
  3011. #if wxUSE_GUI && \
  3012. (!defined wxUSE_NO_MANIFEST || wxUSE_NO_MANIFEST == 0 ) && \
  3013. ( defined _MSC_FULL_VER && _MSC_FULL_VER >= 140040130 )
  3014. #define WX_CC_MANIFEST(cpu) \
  3015. "/manifestdependency:\"type='win32' \
  3016. name='Microsoft.Windows.Common-Controls' \
  3017. version='6.0.0.0' \
  3018. processorArchitecture='" cpu "' \
  3019. publicKeyToken='6595b64144ccf1df' \
  3020. language='*'\""
  3021. #if defined _M_IX86
  3022. #pragma comment(linker, WX_CC_MANIFEST("x86"))
  3023. #elif defined _M_X64
  3024. #pragma comment(linker, WX_CC_MANIFEST("amd64"))
  3025. #elif defined _M_IA64
  3026. #pragma comment(linker, WX_CC_MANIFEST("ia64"))
  3027. #else
  3028. #pragma comment(linker, WX_CC_MANIFEST("*"))
  3029. #endif
  3030. #endif /* !wxUSE_NO_MANIFEST && _MSC_FULL_VER >= 140040130 */
  3031. /* wxThread and wxProcess priorities */
  3032. enum
  3033. {
  3034. wxPRIORITY_MIN = 0u, /* lowest possible priority */
  3035. wxPRIORITY_DEFAULT = 50u, /* normal priority */
  3036. wxPRIORITY_MAX = 100u /* highest possible priority */
  3037. };
  3038. #endif
  3039. /* _WX_DEFS_H_ */