Category:EC: Difference between revisions

From Rosetta Code
Content added Content deleted
No edit summary
No edit summary
Line 1: Line 1:
=={{header|eC}}==

[[Image:EcereSDK.png|thumb|left|A screenshot of the Ecere IDE and samples, running on Linux.]]
[[Image:EcereSDK.png|thumb|left|A screenshot of the Ecere IDE and samples, running on Linux.]]


Line 21: Line 19:


== Sample Code ==
== Sample Code ==
''Hello, World!! in eC''

'''class''' HelloApp : Application
{
'''void''' Main()
{
printf("Hello, World!!\n");
}
}

''Properties & Conversions in eC''
''Properties & Conversions in eC''


Line 54: Line 42:
pen.color = ColorLab { 53, 79, 66 };
pen.color = ColorLab { 53, 79, 66 };
pen.color = ColorCMYK { 0, 100, 100, 0 };
pen.color = ColorCMYK { 0, 100, 100, 0 };

''Hello, World!! in a GUI''

<pre>import "ecere"

class HelloForm : Window
{
text = “Hello, World!! Application";
hasClose = true;
hasMaximize = true;
hasMinimize = true;
size = { 640, 480 };

void OnRedraw(Surface surface)
{
surface.WriteTextf(10, 10, "Hello, World!!");
}
}

HelloForm helloForm {};</pre>


==External links==
==External links==

Revision as of 03:51, 22 July 2008

File:EcereSDK.png
A screenshot of the Ecere IDE and samples, running on Linux.

eC (Ecere C) is an object-oriented language derived from and compatible with C designed and developed by Ecere Corporation. It aims at being fast, light and easy to write.

It is supported by a cross-platform runtime library including its own GUI toolkit, 2D/3D graphics engine as well as networking support.

The Ecere SDK is completely free and includes a full-featured Integrated Development Environment as well as a compiling tools for the eC language.

Some of eC Features

  • Full C compatibility (Only exception: few additional reserved keywords such as 'class')
  • Object oriented class definitions supporting single inheritance
  • Per instance virtual methods
  • Import feature removing the need for header files
  • Properties
  • Automatic conversions
  • Context sensitive enumerations
  • Component object model enabling dynamic lookup of classes, methods, objects serialization and broking, runtime code class aggregation

Sample Code

Properties & Conversions in eC

class Pen
{
   Color color;
   public property Color color
   {
      get { return color; }
      set { color = value; }
   }
}

// Example Usage
Pen pen { red };
Pen pen { color = red };
pen.color = ~pen.color; 
pen.color += 10;
pen.color.r = 255;
pen.color = 0xFF0000;
pen.color = { 255, 0, 0 };
pen.color = ColorHSV { 0, 100, 100 };
pen.color = ColorLab { 53, 79, 66 };
pen.color = ColorCMYK { 0, 100, 100, 0 };

External links

Subcategories

This category has the following 3 subcategories, out of 3 total.

Pages in category "EC"

The following 7 pages are in this category, out of 7 total.