summaryrefslogtreecommitdiffstats
path: root/src/widget_data.h
diff options
context:
space:
mode:
authorOlliver Schinagl <o.schinagl@ultimaker.com>2015-06-19 11:32:51 (GMT)
committerOlliver Schinagl <o.schinagl@ultimaker.com>2015-06-19 11:32:51 (GMT)
commit0969685787592e3142b224a5b6def388844e70f7 (patch)
tree60075b8daa8a32f88f7432522c0edeadd463de86 /src/widget_data.h
parentb9a037ea154a14b53ebe8200574d29f72d7e7a89 (diff)
downloadeulogium-0969685787592e3142b224a5b6def388844e70f7.zip
eulogium-0969685787592e3142b224a5b6def388844e70f7.tar.gz
eulogium-0969685787592e3142b224a5b6def388844e70f7.tar.bz2
split up menu data defines into its own widget.h, the actually entries still need to be moved here
Signed-off-by: Olliver Schinagl <o.schinagl@ultimaker.com>
Diffstat (limited to 'src/widget_data.h')
-rw-r--r--src/widget_data.h68
1 files changed, 68 insertions, 0 deletions
diff --git a/src/widget_data.h b/src/widget_data.h
new file mode 100644
index 0000000..dd6c936
--- /dev/null
+++ b/src/widget_data.h
@@ -0,0 +1,68 @@
+/*
+ * function and data types for widgets
+ *
+ * Copyright (c) 2015 Ultimaker B.V.
+ * Author: Olliver Schinagl <o.schinagl@ultimaker.com>
+ *
+ * SPDX-License-Identifier: AGPL-3.0+
+ */
+
+#ifndef _WIDGET_DATA_H
+#define _WIDGET_DATA_H
+
+#include <Ecore.h>
+#include <Eina.h>
+#include <Evas.h>
+#include <stdint.h>
+
+#include "dbus_handlers.h"
+#include "eulogium_item_list.h"
+
+struct button_cb {
+ void (*func)(void *data, Evas_Object *object, void *event_info);
+ void *data;
+ const char *info;
+};
+
+struct button_def {
+ const char *text;
+ struct button_cb cb;
+ void *data;
+};
+
+struct dir_entry_def {
+ void *data;
+ char *path;
+};
+
+struct menu_entry_def {
+ const char *icon;
+ const char *label;
+ struct list_item item;
+ struct dbus_handle dbus;
+ Eina_Bool *end; /* remove me */
+ const char *footer; /* Primary footer */
+ const char *footer_alt; /* Alternating footer */
+ Ecore_Timer *toggle_timer;
+ void (*func)(void *data, Evas_Object *object, void *event_info);
+ void *data;
+};
+
+enum list_type {
+ LIST_MENU,
+ LIST_FILE,
+};
+
+struct menu_def {
+ const char *title;
+ enum list_type type;
+ void *data;
+ struct dir_entry_def dir;
+ struct menu_entry_def entry[];
+};
+
+void eulogium_button_cb_set(struct button_def *button, struct button_cb *cb);
+void eulogium_button_cb_data_set(struct button_def *button, void *data);
+void eulogium_button_data_set(struct button_def *button, void *data);
+
+#endif /* _WIDGET_DATA_H */