站点：http://vcf-online.org以下内容转自http://vcf-online.org:What is the VCF?
The Visual Component Framework is a C++ application framework that offers a modern, clean, C++ architecture and is designed to be cross platform. The core framework is divided into three major libraries, the FoundationKit, the GraphicsKit, and the ApplicationKit. The FoundationKit provides basic services such as file access, streams, threads and synchronization primitives, and advanced RTTI features. The GraphicsKit provides a nice set of graphics classes for working with both image and vector graphics, and has built in support for the Anti-Grain Graphics library, as well as image loading services to facilitate loading various graphics formats. Finally, the ApplicationKit provides a rich set of GUI controls, use of the Model-View-Control pattern, property and component editors, undo/redo support, drag-and-drop, and clipboard services, application resources, and UI metrics and policy managers.
To facilitate cross platform functionality the VCF is is built using a system of peer interfaces that abstract away the various platform specific calls, with each peer tackling a specific service, such as as threading, file handling, windowing system controls, and so forth. These peer classes are also exposed, and can be used to get access to the lower level OS handles or primitives that they wrap, allowing the developer to write platform specific code if the need arises.
Finally, the VCF is flexible. While it is certainly designed to be a standalone application framework, it also aims, as much as possible, to cooperate with existing toolkits and/or frameworks. For example, if you have an MFC application, you can easily use just the GraphicsKit to make use of the more advanced features in it, as opposed to using the MFC CDC, CBrush, and CPen drawing classes.
Important Framework Features
The Visual Component Framework has a comprehensive set of features that includes:
- Modern C++ design - use of modern C++ techniques like exceptions, templates (where useful), name spaces, and heavy use of the Standard Template Library.
- Advanced RTTI features that allow for such things as dynamic object creation given a registered class name or a registered UUID string that represents the class, dynamic introspection of a given object's class and listing such data as the class name, super class, the properties of the class, member methods, and implemented interfaces.
- Modular - built across several libraries as opposed to one huge monolithic library that then becomes difficult to break apart. This means that while the VCF is incredibly powerful as a framework for writing GUI based applications, if you just want to use the core features, such as threads, file IO, and RTTI you can do so, without having to have dependencies on all the GUI code.
- Easy to use, and powerful event system, suitable for console as well as GUI based applications.
- Support for Thread, Mutexes, Semaphores, Files, Streaming data, error logging, string utility functions, and other basic services. All of this is part of the FoundationKit and has no dependencies on the graphics or UI code.
- Powerful and easy to use graphics classes, plus more advanced support for anti aliased vector graphics through the use the AntiGrain Graphics libraries.
- A simple to use image loading architecture that allows multiple formats to be registered dynamically, for loading up a variety of different graphics formats. On Win32 systems the default image loading support is limited to BMP files, but by using the ImageFormats library (also a part of the VCF) a wide variety of additional image types are also supported. Currently the ImageFormats library uses FreeImage to support a image types such as .TIFF, .TGA, .PSD, .PNG, .PCX, .SGI, .MNG, .RAS, .PBM, .PPM. and many others.
- More advanced classes for customizing the drawing process by extending Stroke and Fill classes.
- A complete set of powerful GUI classes, including a common set of base classes enabling advanced custom control creation. Some of the control classes include tree controls, list controls, check box and radio controls, push buttons, single line and multi line text controls, and many others.
- A standard set of application classes for things like resources, loading windows or forms dynamically at application startup, saving of application state, a registry class for common storage of system and application information.
- Other application classes include an Undo/Redo architecture based on commands that allows for undoing and redoing commands as well as notifying other objects of the events.
- GUI controls that support both alignment and anchoring. Any control may be aligned to the top, bottom, left or right of it's parent container control. Alternately controls may use their anchoring properties to anchor themselves to the left, right, top and/or bottom sides of their parent container control. In addition to control alignment, it is possible to write custom layout containers and assign them to a control to customize layout logic.
- The ApplicationKit provides a set of Model and View classes for using in MVC patterns. A series of models like the ListModel, TreeModel, and TextModel are used in controls to provide separation of the data from the UI presentation code. Because a View can be dynamically attached to a Control at runtime, it will be possible to develop "themes" in the future.
- Because of the RTTI features and the event handlers, the VCF easily supports component programming with in IDE that allow for visual development.
- The VCF tries to be as flexible as possible, allowing you to use the parts you want, and allowing for inter-operability with other frameworks. Thus VCF controls can be used inside of an MFC application if you like, or only use the graphics module for enhanced graphics features.
- No need of special preprocessor tools - if you have a reasonably complete C++ compiler then you're all set to go.
- The ability to access the low level handles for most native objects. For example, by accessing the Thread's peer class, you can get a handle to the native thread handle itself. For a control, you can access the control's peer and get a handle id that represents the windowing systems native handle for a window/widget. This allows you to use platform specific calls when necessary.