Ecere SDK - Overview
Fork me on GitHub

Overview

A quick look at the features the Ecere SDK provides

Free Open Source Software

The Ecere SDK is released under a revised BSD license, also including the eC compiler.

Documentation

  1. Samples (some prebuilt and described here)
  2. The Ecere Tao of Programming
      (Programmer's guide, work in progress)
  3. Coursework
      (Exercises and lab suggestions)
  4. An Introduction to building an eC application with the Ecere SDK
      (Building a simple Tic Tac Toe game)

Cross-Platform API

The Ecere SDK provides you with a uniform object-oriented API allowing you to write an application once and deploy it across multiple platforms. The API is accessible through the eC programming language, and we hope to eventually provide bindings to other languages as well. Code written in eC can easily be mixed with other languages such as C and C++ in the same application, and as such it is also currently possible to write bindings to most languages through an eC glue file which can export C functions. Supported platforms include Windows, Linux, OS X, FreeBSD and Android. Support for iOS and the web is planned as well, and development towards that goal has started.

In addition to a comprehensive API for displaying 2D and 3D graphics, building Graphical User Interfaces and network communications, the SDK abstracts platform functionality such as file access (where paths can be files on the local system but can also be embedded resources, files within archives, pipes or HTTP web URLs), multithreading and synchronization, JSON parser/serializer, persistent settings, date and time utilities.

On Windows and Linux, the SDK also features an audio library making it simple to output audio either with direct access to the sound buffer, or through its mixing API. It has built-in support for loading WAV sound files in 8 or 16 bit, and can be used in conjunction with FFmpeg libraries to play back other sound and music formats.

The SDK also offers a built-in internationalization system and the entire API expects character strings to be Unicode encoded as UTF-8.

Graphical User Interface

Our GUI toolkit allows you to build interfaces with clear and concise object-oriented code. Layout and styling is done through setting object properties. Look and feel can be implemented and customized by overriding objects' virtual methods. Handling notifications from controls (widgets) to their owner (typically the form) is done through overriding events, a special type of virtual methods. Events can be specified directly on the control without a need to create a sub-class, thanks to eC's support for instance-levels virtual methods.

Controls can be floating or anchored to the parent's edges, either through a relative or absolute offset. A Stacker class featuring automatic layout of content in either direction is also provided.

A Rapid Application Development (RAD) GUI designer is integrated within the Ecere IDE. GUI objects along with their properties and methods will show up in the sheet panel. The form designer view will provide instant feedback, allow control drag and drop, layout, generate and update code and will allow code edition.

The toolkit features a compact but comprehensive and flexible library of common controls, including powerful data oriented controls such as a list view, tree view, grid view, edit box. These controls all support the display and edition of arbitrary data types in their fields, integrated with eC's type system as well as with the SDK's database support through EDA. The Ecere GUI toolkit is built on top of the SDK's graphics support and will run on all supported drivers.




2D Graphics

Our 2D graphics API centers around a simple Surface class, offering support for easily drawing pixels, lines, areas, bitmaps and text. For integration with the GUI toolkit, a Surface object is automatically passed in the OnRedraw callback for a control or form. It will run on a number of drivers including the GDI, DirectDraw and Direct3D on Windows; X11 on Linux/Unix as well as OpenGL / OpenGL ES on all supported platforms.

International text can be displayed, including complex scripts with graphemes morphing (through the HarfBuzz library), and right to left text. Bitmaps can be loaded from and saved to PNG, JPG, BMP, PCX or GIF formats, and a plugin architecture allows extending support to additional formats.

A rendering Surface can be obtained on a Bitmap, functioning as a Linear Frame Buffer (LFB). The graphics API also supports Windows printers as a target, as well as text consoles.

The SDK features bitmap and fonts resources management to automatically load, free and recover from a lost context (such as is common on mobile devices and is DirectX), but also allowing applications built with the SDK to switch from one graphics mode to another without restarting (e.g. a game Display settings could switch from OpenGL to DirectX without exiting).

3D Graphics

The SDK also provides a 3D rendering API, which works on top of either OpenGL, OpenGL ES or DirectX. The library provides a linear algebra mathematics library including vectors, quaternions, matrices and planes.

The Object class allows to build hierarchichal objects where a transformation can be applied to each node, and leaf nodes can feature a mesh. Meshes are made up of PrimitiveGroups which can feature basic primitives such as points, lines, triangles, triangle strips and triangle fans, and make use of Vertex Buffer Objects (VBO) and Index Buffer Objects (IBO) to store geometry in GPU memory. The Material class controls the appearance (textures, colors, opacity, light interaction) of objects, while the Light class controls lighting.

A Camera class is used to position the viewer within the scene to render and update his position, according to a variety of modes (fixed position, attached to a position, looking at a position). Activating a Camera on a Surface turns the graphics system's Display class into 3D perspective mode.

Models can be loaded and saved through an extensible plugin architecture, with built-in .3DS format support. Materials, lights and cameras can also be loaded from 3DS files. The 3DS keyframed animation system is supported and loaded scenes' objects, cameras and lights can be animated.

Custom OpenGL code can be intertwined with the Ecere 3D graphics calls for further flexibility, or can be used exclusively while the Ecere graphics subsystem is only used for the GUI and setting up the platform specific OpenGL context.




Networking

A Socket class is included for writing low-level networking code, supporting either TCP/IP or UDP. The Service class is used for listening on a TCP/IP port. Incoming data will automatically be buffered until enough bytes have been received and it is ready for processing. The sockets processing code also optionally queues all incoming communication to the main application thread, while running in a global communication thread, or can be processed individually and manually by the user (e.g. in its own thread).

The Secured Socket Layer is also supported through the use of the SSLSocket class (requires OpenSSL and an Ecere runtime library built with the support).

In addition to the core socket functionality, support for retrieving data through the HTTP protocol is implemented and integrated with the core File class API, so that a web URL is a valid path anywhere a file path is expected by the SDK.

A distributed objects system effectively allows writing network applications without writing any networking or socket code. Remote instances of a class can be created, and communication is implemented through method calls (virtual methods for notifications from the server). Parameters of any eC types are automatically serialized and deserialized.

Database Access

The Ecere Data Access (EDA) API offers an object-oriented approach to interacting with databases in Ecere applications. A database schema can be laid out in code which will automatically initialize a database and provide the mapping to any eC data types. An object-oriented syntax (record.field) can be used in eC code to access fields of a table, and walk across tables through chained foreign keys.

EDA is an abstraction layer with a driver-based architecture to implement support for different RDBMS. The SQLite driver is fully functional, with support for SQL queries. Previously EDA featured its own minimalist embedded RDBMS, EDB (still included, but more limited than the SQLite driver). Support for other DB systems has also been initiated, including Oracle, PostgreSQL and MySQL.

A DataSource class provides a connection to a RDBMS, while a DataBase represents a particular database from that source. Tables can be accessed from databases and their contents from the Row (record) by specifying a Field (column).




Development Environment

The Ecere IDE is a complete development environment for editing code, managing and building projects, as well as debugging applications. It is written in eC with the Ecere GUI toolkit. It is a general purpose text/code editor, but at the moment it is mainly geared towards C, C++ and eC development. We hope to improve support for additional languages, as well as extend its level of customization. The IDE can run in either GDI/X11 or OpenGL mode, and is available in English, Chinese and Spanish, nearly fully translated to Brazilian Portugese, and partial translations in a number of other languages have also begun.

ide


Code Editor

The code editor features syntax highlighting, context sensing, auto-completion, auto-indenting, parameters and instance members tooltips. One of its interesting auto completion feature is automatic method overriding completion with prototype correction. Space errors in code are also highlighted so as to keep git repositories happy and clean, with a menu command to clear all trailing spaces.



Projects

A Project view will let you add source code and resource files, as well as organize everything in folders (either mapping to the file system or virtual). Multiple configurations are supported, e.g. for Debug and Release mode. Build options can be specified per project, configuration and platform. Additional projects can also be added to the workspace, e.g. for dependencies. When building a project, the IDE will report errors in its build log where double-clicking or hitting enter on a error will bring you the problematic line in the code. The build system is described in more details below.



Designer

A property and method sheet accompanies the Object Designer, which is used for the RAD Ecere GUI Designer, but is also an extensible framework which could offer IDE integration (within property/method sheet and Object Designer) for other toolkits, including your own. Methods can be overridden, detached, attached and deleted from the method sheets, while properties can be edited in the property sheet with instant visual feedback within the Designer. Similarly, editing through interaction with the Designer will have its changes reflected in both the property sheet and the code editor.



Debugger

The integrated debugger is currently a frontend to the GNU Debugger (GDB). It supports comprehensive stepping options, breakpoints, expression watches, an output view, a call stack panel with frame selection and a thread selection panel. Additional library projects used by an executable can be added to the workspace for seamlessly resolving paths according to the selected configurations. The debugger also supports breaking and resuming at errors reported by Valgrind under Linux.


Documentor / API Browser

The IDE provides integration with the Ecere Documentor / API Browser (F1 from the IDE), a tool for documenting and browsing documentation of eC class libraries' APIs. Classes within modules are automatically organized by namespaces, and an hyperlinked interface for browsing through types (classes), data members, properties and methods is automatically generated. In Documentation mode, text can be added to document all descriptions, parameters, members with sections for usage, remarks, examples and 'See Also'. The IDE integration and Documentor itself will see a lot of upcoming improvements, including Search support and F1 lookup on keywords within the text editor, generating HTML documentation, and highlighting documentation differences against newer code revisions (removed/deprecated API, as well as new APIs). All documentation information is kept separate from the code (typically header files in C/C++), first because eC libraries are self-contained and are not packaged with header files, to avoid cluttering the code and as a mean to facilitate contribution to the documentation by a wider range of people, including technical writers and API users, while at the same time staying in sync with the code.



Utilities

The IDE also features some useful utilities such as a Find/Replace in Files tool, a color picker, an image viewer/converter, a 3DS model viewer and even a built-in rubber duck for Ruber Duck Debugging.



ide




Build System

The Ecere SDK offers a comprehensive cross-platform build system, evolved from the Ecere IDE's project files (.epj). The .epj format is based upon JSON and describes all source code and resources files required to build the project. It also describes a project's multiple configurations and their associated build settings. A matrix of files, configuration and platform, with strict inheritance and overriding rules, establish the build options for each file node. The project settings also offer pre-build and post-build rules as well as install commands.

A cross-platform Makefile is generated from a project file, either automatically by the IDE or manually through the 'epj2make' command-line tool provided with the SDK. These Makefiles can then be used to build the project from the command-line using GNU make, including on Windows with only MinGW or MinGW-w64 (with or without MSYS).

The build system supports building projects including any combination of C, C++ and eC, and will likely be extended to support other languages.

The IDE offers a special bit depth configuration for compilers supporting multiple bit depths (e.g. gcc -m32), as a convenient way to build a project for both 32 and 64 bit architectures. Multiple compilers are also supported, with support for cross-compiling. Each compiler can be fully configured, with its own set of paths for include, library and executables files, preprocessor directives, flags and library exclusions. We find this very useful for testing different compiler versions, building with GCC vs. Clang, cross-compiling to Android or Windows, or targeting the web through Emscripten. Targets and object files for different combinations of configuration, platforms or compiler are built in separate build directories. The IDE supports instructing make to build using parallel build jobs, so as to build faster on multiple cores CPUs (e.g. -j8).