diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2012-12-05 15:12:20 +0000 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2012-12-05 15:12:20 +0000 |
commit | 00b324bfc162030b575e03795dcfcaac56bd0b4d (patch) | |
tree | fbaada243839b0b67351856e2d02a2e8184bf65f /FunctionBar.c | |
parent | 2a73405cd060b543d56987650327b18078a137d7 (diff) |
Changes in object model: separate class objects to store vtable. Also, nicer UTF-8 display of big numbers.
Diffstat (limited to 'FunctionBar.c')
-rw-r--r-- | FunctionBar.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/FunctionBar.c b/FunctionBar.c index dc4368ef..fb62823b 100644 --- a/FunctionBar.c +++ b/FunctionBar.c @@ -29,22 +29,18 @@ typedef struct FunctionBar_ { }*/ -#ifdef DEBUG -char* FUNCTIONBAR_CLASS = "FunctionBar"; -#else -#define FUNCTIONBAR_CLASS NULL -#endif - static const char* FunctionBar_FKeys[] = {"F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", NULL}; static const char* FunctionBar_FLabels[] = {" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", NULL}; static int FunctionBar_FEvents[] = {KEY_F(1), KEY_F(2), KEY_F(3), KEY_F(4), KEY_F(5), KEY_F(6), KEY_F(7), KEY_F(8), KEY_F(9), KEY_F(10)}; +ObjectClass FunctionBar_class = { + .delete = FunctionBar_delete +}; + FunctionBar* FunctionBar_new(const char** functions, const char** keys, int* events) { - FunctionBar* this = malloc(sizeof(FunctionBar)); - Object_setClass(this, FUNCTIONBAR_CLASS); - ((Object*) this)->delete = FunctionBar_delete; + FunctionBar* this = AllocThis(FunctionBar); this->functions = (char**) functions; if (keys && events) { this->staticData = false; |