Enlightenment CVS committal
Author : rbdpngn
Project : e17
Module : libs/ewl
Dir : e17/libs/ewl/src
Modified Files:
Ewl.h
Log Message:
Some more documentation on inheritance in C and how it is used in EWL.
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/Ewl.h,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -3 -r1.50 -r1.51
--- Ewl.h 3 May 2004 05:46:12 -0000 1.50
+++ Ewl.h 5 May 2004 04:58:34 -0000 1.51
@@ -34,7 +34,23 @@
* class can also operate on the inheriting class. For example, in EWL the
* class Ewl_Button inherits from Ewl_Box, which inherits from Ewl_Container.
* This means you can add widgets to the button, just like you could to the
- * box or any other container by using ewl_container_append.
+ * box or any other container by using ewl_container_append. Since EWL is
+ * written in C, it uses a very simple single inheritance system. The first
+ * field of the inheriting struct must be the inherited struct, and note, it's
+ * not a pointer to the inherited struct. For example:
+ *
+ * @code
+ * struct Ewl_Foo
+ * {
+ * Ewl_Bar bar;
+ * int baz;
+ * };
+ * @endcode
+ *
+ * Creates a new class of objects, Foo, which inherits from the Bar class and
+ * extends it by adding an integer baz. If the first line of the struct had
+ * been Ewl_Bar *bar; it would most likely result in some buffer overflows
+ * when initializing the widget.
*
* @image html e_mini.png
*
-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g.
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs