From 0969685787592e3142b224a5b6def388844e70f7 Mon Sep 17 00:00:00 2001 From: Olliver Schinagl Date: Fri, 19 Jun 2015 13:32:51 +0200 Subject: split up menu data defines into its own widget.h, the actually entries still need to be moved here Signed-off-by: Olliver Schinagl --- src/eulogium.c | 1 + src/eulogium.h | 47 +------------------------------------- src/widget_data.h | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 70 insertions(+), 46 deletions(-) create mode 100644 src/widget_data.h diff --git a/src/eulogium.c b/src/eulogium.c index 5485719..ea62afe 100644 --- a/src/eulogium.c +++ b/src/eulogium.c @@ -18,6 +18,7 @@ #include "eulogium_private.h" #include "gettext.h" #include "procedures.h" +#include "widget_data.h" #define COPYRIGHT "Copyright © 2015 Olliver Schinagl and various contributors (see AUTHORS)." diff --git a/src/eulogium.h b/src/eulogium.h index c516b27..ee29cfe 100644 --- a/src/eulogium.h +++ b/src/eulogium.h @@ -17,6 +17,7 @@ #include "eulogium_item_list.h" #include "procedures.h" +#include "widget_data.h" enum screen_type { NONE, @@ -100,48 +101,6 @@ struct eulogium_data { struct procedure_data *procedures; }; -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 menu_entry_def { - const char *icon; - const char *label; - struct list_item item; - 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; -}; - -struct dir_entry_def { - void *data; - char *path; -}; - -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[]; -}; - struct multi_text { uint_fast8_t count; const char *button_text; @@ -167,10 +126,6 @@ Evas_Object *eulogium_generic_error(struct eulogium_data *eulogium, uint8_t eulo void eulogium_print_data_set(struct eulogium_data *eulogium, char *filepath); -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); - Evas_Object *eulogium_main_menu(Evas_Object *window, struct eulogium_data *eulogium); Evas_Object *eulogium_split_screen(Evas_Object *parent, Evas_Object *top, Evas_Object *bottom); Evas_Object *eulogium_tripple_button_menu(Evas_Object *parent, const struct button_def *left, const struct button_def *right, const struct button_def *bottom); 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 + * + * SPDX-License-Identifier: AGPL-3.0+ + */ + +#ifndef _WIDGET_DATA_H +#define _WIDGET_DATA_H + +#include +#include +#include +#include + +#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 */ -- cgit v0.12