summaryrefslogtreecommitdiffstats
path: root/src/ui_widgets.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui_widgets.h')
-rw-r--r--src/ui_widgets.h75
1 files changed, 75 insertions, 0 deletions
diff --git a/src/ui_widgets.h b/src/ui_widgets.h
new file mode 100644
index 0000000..2cab4bc
--- /dev/null
+++ b/src/ui_widgets.h
@@ -0,0 +1,75 @@
+/*
+ * 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_common.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 wifi_entry_def {
+ void *data;
+ char *ssid;
+};
+
+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,
+ LIST_WIFI,
+};
+
+struct menu_def {
+ const char *title;
+ enum list_type type;
+ void *data;
+ struct dir_entry_def dir;
+ struct wifi_entry_def wifi; /* TODO see if we can put this into a union somehow */
+ 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 */