I++ has the programming subsystem - win+. The projects for this book may be found in \iplusplus\samples. This directory contains projects for win+. The subdirectories contain the actual projects. Depending upon which chapter is being studied, the reader should navigate the projects directories to load the project corresponding to the discussion. The chapter that is being discussed needs to be known in advance.
The win+ interface is a modern C/C++ interface for programming windows. It is an Operating System Abstraction Layer. It abstracts the operating system to a C++ Code Layer. This code layer provides an improved interface for programming windows, and it may eventually lead to new, improved operating systems. The API is defined in the forwarding layer Layer.lib and layer.dll. Layer.dll doesn't contain any code, just forwarding references to the original windows dlls. So only the code defined in the iplusplus.ixx files remains. This makes iplusplus.ixx a candidate for replacing the existing Win32 headers - which are extremely dated.
win+ is packaged using name spaces, and the names chosen for programming identifiers within the names spaces has been carefully thought through. win+ applies corrections to the original Win32 name space. Functions names like GetDC have been expanded to get_device_context. Another example is DefDlgProc, which has been renamed to default_dialog_procedure. Thousands of constants that previously were defined as macros have been redefined as enumerators. For example, in the existing Win32 interface, window styles are defined as follows:
#define WS_OVERLAPPED 0x00000000L #define WS_POPUP 0x80000000L #define WS_CHILD 0x40000000L ...
whereas, in i++ and win+, the window styles are part of the structure style - a portion of which is shown below.
struct style { enum { window = 0x00000000, popup = 0x80000000, child = 0x40000000, ...
Note that macros are part of the preprocessor and have no place in common programming. Macros are of global scope, whereas the enumeration for styles is part of the core namespace. win+ repositions all of the constants of Win32 in this way. In doing so, all the acronyms (like WS_) are banished. Note that Intellisense is available on all constants using the scope operator. For example, to refer to the child style the following is used style::child. When the scope operator is used, Intellisense prompts the user with a list of options. The entire operating system has been restructured (from Version 6 to Version 7) to ensure optimum use of Intellisense.
Additionally, no use is made of terms that:
Notice in the above declaration of window styles, Win32 contains the acronym WS_. This pattern is repeated throughout the Win32 interface, making the entire interface acronymic. win+ undoes by packaging constants in structures. When the constants are defined in structures, the burden of uniqueness is lifted, thereby enabling the prefixes to be dropped. This provides an optimal definition of the windows operating system.
The main unsigned integer data type of Win32 is DWORD (short for double word). In 64 bit windows, a DWORD is 32 bits - a half word. DWORD has its origins in 16 bit windows, where a word was 16 bits and thus a double word was 32 bits. Clearly DWORD is a hardware dependent term and the hardware it refers to is fourty years in the past. A DWORD becomes simply an unsigned in win+. So Win32 is hardware dependent and win+ is hardware independent.
The API naming conventions of Win32 are the best portion of the namespace. The API uses a mixed case naming convention with uppercase used to separate words. In win+, the mixed case naming convention has been reduced to lower case and extended to classes and constants. In Win32, constants are in solid uppercase with words run together (quite ugly). win+ remedies this unsightly code with the lower case naming convention. The end result is that constants, functions and classes all use the same, consistent naming convention.
The windows interface of i++ is contained in the name space core.This leads to win+ code containing the statements:
import iplusplus; using namespace core;
The system is contained in the C++ module named iplusplus. This accounts for the import statement, which imports the module. The use of name spaces and the careful selection of elements of the name space lead to the win+ C interface being a modern, clean method of accessing the services of the windows operating system.
I++ is released as a single, standalone C++ module containing a 4 .ixx files. Each .ixx file is quite large. Note that including headers into C++ modules is probably bad form. Using the preprocessor at all is probably bad form. While C++ has surged ahead, Win32 remains frozen back in the 1980's. I++ has been in constant development since the late 80's to the present point. The current version of I++ is a port of I# - a system written in the C# language. All the lower case constants were created as C# enumerators. Pure and Applied Calculus was created first in C#. Pure Calclulus was created in C# in 2006, Applied Calculus was created in C# in 2016. I++ currently contains Pure and Applied Calculus in C++. Pure Calculus is the theory of AVL Trees in C++, Applied Calculus is the theory of AVL Databses in C++.