⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 backwardcompat.tex

📁 很牛的GUI源码wxWidgets-2.8.0.zip 可在多种平台下运行.
💻 TEX
字号:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Name:        backwardcompat.tex%% Purpose:     Explains how much and what kind of backward compatibility users%%              can expect%% Author:      M.J.Wetherell%% RCS-ID:      $Id: backwardcompat.tex,v 1.3 2005/08/13 20:47:25 MW Exp $%% Copyright:   2005 M.J.Wetherell%% License:     wxWindows license%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\section{Backward compatibility}\label{backwardcompatibility}Many of the GUIs and platforms supported by wxWidgets are continuouslyevolving, and some of the new platforms wxWidgets now supports were quiteunimaginable even a few years ago. In this environment wxWidgets must alsoevolve in order to support these new features and platforms.However the goal of wxWidgets is not only to provide a consistentprogramming interface across many platforms, but also to provide aninterface that is reasonably stable over time, to help protect its usersfrom some of the uncertainty of the future.\subsection{The version numbering scheme}\label{versionnumbering}wxWidgets version numbers can have up to four components, with trailingzeros sometimes omitted:\begin{verbatim}    major.minor.release.sub-release\end{verbatim}A {\em stable} release of wxWidgets will have an even number for {\ttminor}, e.g. {\tt 2.6.0}.Stable, in this context, means that the API is not changing. In truth, somechanges are permitted, but only those that are backward compatible. Forexample, you can expect later {\tt 2.6.x.x} releases, such as {\tt 2.6.1}and {\tt 2.6.2} to be backward compatible with their predecessor.When it becomes necessary to make changes which are not wholly backwardcompatible, the stable branch is forked, creating a new {\em development}branch of wxWidgets. This development branch will have an odd numberfor {\tt minor}, for example {\tt 2.7.x.x}. Releases from this branch areknown as {\em development snapshots}.The stable branch and the development branch will then be developed inparallel for some time. When it is no longer useful to continue developingthe stable branch, the development branch is renamed and becomes a newstable branch, for example {\tt 2.8.0}. And the process begins again.This is how the tension between keeping the interface stable, and allowingthe library to evolve is managed.You can expect the versions with the same major and {\em even} minorversion number to be compatible, but between minor versions there will beincompatibilities. Compatibility is not broken gratuitously however, somany applications will require no changes or only small changes to workwith the new version.\subsection{Source level compatibility}\label{sourcecompatibility}Later releases from a stable branch are backward compatible with earlierreleases from the same branch at the {\em source} level.This means that, for example, if you develop your application usingwxWidgets {\tt 2.6.0} then it should also compile fine with all later {\tt2.6.x} versions. The converse is also true providing you avoid any newfeatures not present in the earlier version. For example if you developusing {\tt 2.6.1} your program will compile fine with wxWidgets {\tt 2.6.0}providing you don't use any {\tt 2.6.1} specific features.For some platforms binary compatibility is also supported, see 'Librarybinary compatibility' below.Between minor versions, for example between {\tt 2.2.x}, {\tt 2.4.x} and {\tt2.6.x}, there will be some incompatibilities. Wherever possible the old wayof doing something is kept alongside the new for a time wrapped inside:\begin{verbatim}    #if WXWIN_COMPATIBILITY_2_4        /* deprecated feature */        ...    #endif\end{verbatim}By default the {\tt WXWIN\_COMPATIBILITY{\it \_X\_X}} macro is setto 1 for the previous stable branch, for examplein {\tt 2.6.x} {\tt WXWIN\_COMPATIBILITY\_2\_4 = 1}. For the next earlierstable branch the default is 0, so {\tt WXWIN\_COMPATIBILITY\_2\_2 = 0}for {\tt 2.6.x}. Earlier than that, obsolete features are removed.These macros can be changed in {\tt setup.h}. Or on UNIX-like systems you canset them using the {\tt --disable-compat24} and {\tt --enable-compat22}options to {\tt configure}.They can be useful in two ways:\begin{enumerate}\item Changing {\tt WXWIN\_COMPATIBILITY\_2\_4} to 0 can be useful tofind uses of deprecated features in your program.\item Changing {\tt WXWIN\_COMPATIBILITY\_2\_2} to 1 can be useful tocompile a program developed using {\tt 2.2.x} that no longer compileswith {\tt 2.6.x}.\end{enumerate}A program requiring one of these macros to be 1 will becomeincompatible with some future version of wxWidgets, and you should considerupdating it.\subsection{Library binary compatibility}\label{libbincompatibility}For some platforms, releases from a stable branch are not only source levelcompatible but can also be {\em binary compatible}.Binary compatibility makes it possible to get the maximum benefit fromusing shared libraries, also known as dynamic link libraries (DLLs) onWindows or dynamic shared libraries on OS X.For example, suppose several applications are installed on a system requiringwxWidgets {\tt 2.6.0}, {\tt 2.6.1} and {\tt 2.6.2}. Since {\tt 2.6.2} isbackward compatible with the earlier versions, it should be enough toinstall just wxWidgets {\tt 2.6.2} shared libraries, and all the applicationsshould be able to use them. If binary compatibility is not supported, then allthe required versions {\tt 2.6.0}, {\tt 2.6.1} and {\tt 2.6.2} must beinstalled side by side.Achieving this, without the user being required to have the source codeand recompile everything, places many extra constraints on the changesthat can be made within the stable branch. So it is not supported for allplatforms, and not for all versions of wxWidgets. To date it has mainlybeen supported by wxGTK for UNIX-like platforms.Another practical consideration is that for binary compatibility to work,all the applications and libraries must have been compiled with compilersthat are capable of producing compatible code; that is, they must use thesame ABI (Application Binary Interface). Unfortunately most different C++compilers do not produce code compatible with each other, and often evendifferent versions of the same compiler are not compatible.\subsection{Application binary compatibility}\label{appbincompatibility}The most important aspect of binary compatibility is that applicationscompiled with one version of wxWidgets, e.g. {\tt 2.6.1}, continue to workwith shared libraries of a later binary compatible version, for example {\tt2.6.2}.The converse can also be useful however. That is, it can be useful for adeveloper using a later version, e.g. {\tt 2.6.2} to be able to create binaryapplication packages that will work with all binary compatible versions ofthe shared library starting with, for example {\tt 2.6.0}.To do this the developer must, of course, avoid any features not availablein the earlier versions. However this is not necessarily enough; in somecases an application compiled with a later version may depend on it eventhough the same code would compile fine against an earlier version.% thinks: a situation we should try to avoid.To help with this, a preprocessor symbol {\tt wxABI\_VERSION} can be definedduring the compilation of the application (this would usually be done in theapplication's makefile or project settings). It should be set to the lowestversion that is being targeted, as a number with two decimal digits for eachcomponent, for example {\tt wxABI\_VERSION=20600} for {\tt 2.6.0}.Setting {\tt wxABI\_VERSION} should prevent the application from implicitlydepending on a later version of wxWidgets, and also disables any new featuresin the API, giving a compile time check that the source is compatible withthe versions of wxWidgets being targeted.Uses of {\tt wxABI\_VERSION} are stripped out of the wxWidgets sources wheneach new development branch is created. Therefore it is only useful to helpachieve compatibility with earlier versions with the same majorand {\em even} minor version numbers. It won't, for example, help you writecode compatible with {\tt 2.4.x} using wxWidgets {\tt 2.6.x}.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -