summaryrefslogtreecommitdiffstats
path: root/CategoriesPanel.c
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2008-03-09 08:58:38 +0000
committerHisham Muhammad <hisham@gobolinux.org>2008-03-09 08:58:38 +0000
commitda23c8c5a188324455c8f417293c10d85f65cb63 (patch)
treed7a4b8cb0af705de6650e20e00ba3da04d84b27f /CategoriesPanel.c
parent12f4f09e6ed288bdedc86e4ef22f3cc34f0e787a (diff)
Clean up headers by using 'static' whenever possible.
Reduces resulting code size.
Diffstat (limited to 'CategoriesPanel.c')
-rw-r--r--CategoriesPanel.c84
1 files changed, 42 insertions, 42 deletions
diff --git a/CategoriesPanel.c b/CategoriesPanel.c
index 9d471217..8b9d6636 100644
--- a/CategoriesPanel.c
+++ b/CategoriesPanel.c
@@ -35,31 +35,40 @@ static char* ColorsFunctions[10] = {" ", " ", " ", " ", "
static char* AvailableColumnsFunctions[10] = {" ", " ", " ", " ", "Add ", " ", " ", " ", " ", "Done "};
-CategoriesPanel* CategoriesPanel_new(Settings* settings, ScreenManager* scr) {
- CategoriesPanel* this = (CategoriesPanel*) malloc(sizeof(CategoriesPanel));
- Panel* super = (Panel*) this;
- Panel_init(super, 1, 1, 1, 1, LISTITEM_CLASS, true);
- ((Object*)this)->delete = CategoriesPanel_delete;
-
- this->settings = settings;
- this->scr = scr;
- super->eventHandler = CategoriesPanel_eventHandler;
- Panel_setHeader(super, "Setup");
- Panel_add(super, (Object*) ListItem_new("Meters", 0));
- Panel_add(super, (Object*) ListItem_new("Display options", 0));
- Panel_add(super, (Object*) ListItem_new("Colors", 0));
- Panel_add(super, (Object*) ListItem_new("Columns", 0));
- return this;
-}
-
-void CategoriesPanel_delete(Object* object) {
+static void CategoriesPanel_delete(Object* object) {
Panel* super = (Panel*) object;
CategoriesPanel* this = (CategoriesPanel*) object;
Panel_done(super);
free(this);
}
-HandlerResult CategoriesPanel_eventHandler(Panel* super, int ch) {
+void CategoriesPanel_makeMetersPage(CategoriesPanel* this) {
+ Panel* leftMeters = (Panel*) MetersPanel_new(this->settings, "Left column", this->settings->header->leftMeters, this->scr);
+ Panel* rightMeters = (Panel*) MetersPanel_new(this->settings, "Right column", this->settings->header->rightMeters, this->scr);
+ Panel* availableMeters = (Panel*) AvailableMetersPanel_new(this->settings, leftMeters, rightMeters, this->scr);
+ ScreenManager_add(this->scr, leftMeters, FunctionBar_new(10, MetersFunctions, NULL, NULL), 20);
+ ScreenManager_add(this->scr, rightMeters, FunctionBar_new(10, MetersFunctions, NULL, NULL), 20);
+ ScreenManager_add(this->scr, availableMeters, FunctionBar_new(10, AvailableMetersFunctions, NULL, NULL), -1);
+}
+
+static void CategoriesPanel_makeDisplayOptionsPage(CategoriesPanel* this) {
+ Panel* displayOptions = (Panel*) DisplayOptionsPanel_new(this->settings, this->scr);
+ ScreenManager_add(this->scr, displayOptions, FunctionBar_new(10, DisplayOptionsFunctions, NULL, NULL), -1);
+}
+
+static void CategoriesPanel_makeColorsPage(CategoriesPanel* this) {
+ Panel* colors = (Panel*) ColorsPanel_new(this->settings, this->scr);
+ ScreenManager_add(this->scr, colors, FunctionBar_new(10, ColorsFunctions, NULL, NULL), -1);
+}
+
+static void CategoriesPanel_makeColumnsPage(CategoriesPanel* this) {
+ Panel* columns = (Panel*) ColumnsPanel_new(this->settings, this->scr);
+ Panel* availableColumns = (Panel*) AvailableColumnsPanel_new(this->settings, columns, this->scr);
+ ScreenManager_add(this->scr, columns, FunctionBar_new(10, ColumnsFunctions, NULL, NULL), 20);
+ ScreenManager_add(this->scr, availableColumns, FunctionBar_new(10, AvailableColumnsFunctions, NULL, NULL), -1);
+}
+
+static HandlerResult CategoriesPanel_eventHandler(Panel* super, int ch) {
CategoriesPanel* this = (CategoriesPanel*) super;
HandlerResult result = IGNORED;
@@ -107,28 +116,19 @@ HandlerResult CategoriesPanel_eventHandler(Panel* super, int ch) {
return result;
}
-void CategoriesPanel_makeMetersPage(CategoriesPanel* this) {
- Panel* leftMeters = (Panel*) MetersPanel_new(this->settings, "Left column", this->settings->header->leftMeters, this->scr);
- Panel* rightMeters = (Panel*) MetersPanel_new(this->settings, "Right column", this->settings->header->rightMeters, this->scr);
- Panel* availableMeters = (Panel*) AvailableMetersPanel_new(this->settings, leftMeters, rightMeters, this->scr);
- ScreenManager_add(this->scr, leftMeters, FunctionBar_new(10, MetersFunctions, NULL, NULL), 20);
- ScreenManager_add(this->scr, rightMeters, FunctionBar_new(10, MetersFunctions, NULL, NULL), 20);
- ScreenManager_add(this->scr, availableMeters, FunctionBar_new(10, AvailableMetersFunctions, NULL, NULL), -1);
-}
-
-void CategoriesPanel_makeDisplayOptionsPage(CategoriesPanel* this) {
- Panel* displayOptions = (Panel*) DisplayOptionsPanel_new(this->settings, this->scr);
- ScreenManager_add(this->scr, displayOptions, FunctionBar_new(10, DisplayOptionsFunctions, NULL, NULL), -1);
-}
-
-void CategoriesPanel_makeColorsPage(CategoriesPanel* this) {
- Panel* colors = (Panel*) ColorsPanel_new(this->settings, this->scr);
- ScreenManager_add(this->scr, colors, FunctionBar_new(10, ColorsFunctions, NULL, NULL), -1);
-}
+CategoriesPanel* CategoriesPanel_new(Settings* settings, ScreenManager* scr) {
+ CategoriesPanel* this = (CategoriesPanel*) malloc(sizeof(CategoriesPanel));
+ Panel* super = (Panel*) this;
+ Panel_init(super, 1, 1, 1, 1, LISTITEM_CLASS, true);
+ ((Object*)this)->delete = CategoriesPanel_delete;
-void CategoriesPanel_makeColumnsPage(CategoriesPanel* this) {
- Panel* columns = (Panel*) ColumnsPanel_new(this->settings, this->scr);
- Panel* availableColumns = (Panel*) AvailableColumnsPanel_new(this->settings, columns, this->scr);
- ScreenManager_add(this->scr, columns, FunctionBar_new(10, ColumnsFunctions, NULL, NULL), 20);
- ScreenManager_add(this->scr, availableColumns, FunctionBar_new(10, AvailableColumnsFunctions, NULL, NULL), -1);
+ this->settings = settings;
+ this->scr = scr;
+ super->eventHandler = CategoriesPanel_eventHandler;
+ Panel_setHeader(super, "Setup");
+ Panel_add(super, (Object*) ListItem_new("Meters", 0));
+ Panel_add(super, (Object*) ListItem_new("Display options", 0));
+ Panel_add(super, (Object*) ListItem_new("Colors", 0));
+ Panel_add(super, (Object*) ListItem_new("Columns", 0));
+ return this;
}

© 2014-2024 Faster IT GmbH | imprint | privacy policy