summaryrefslogtreecommitdiffstats
path: root/src/ui_wizards.h
blob: 87a43fd6b0541da773c9354a2805145ce9f9d531 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
 * functions, callbacks and data types for wizards
 *
 * Copyright (c) 2015 Ultimaker B.V.
 * Author: Olliver Schinagl <o.schinagl@ultimaker.com>
 *
 * SPDX-License-Identifier:	AGPL-3.0+
 */

#ifndef _UI_WIZARDS_H
#define _UI_WIZARDS_H

#include <stdint.h>

#include "procedures.h"

enum wizard_type {
	WIZARD_NONE,
	WIZARD_PROGRESS,
	WIZARD_END, /* sentinel */
};

struct wizard_data {
	uint_fast8_t count; /* Calculated using wizard_init */
	const char *title;
	enum procedure_key proc_key;
	struct {
		enum wizard_type type;
		char *text;
		struct button_def prev_button;
		struct button_def next_button;
		void (*func)(uint_fast32_t nr);
		union {
			void *data;
			uint_fast32_t nr; /* XXX hack until we have a extrude-train object */
		};
		/* TODO consider adding a button_def for the buttons */
	} screens[];
};

extern struct wizard_data material_load;
extern struct wizard_data material_unload;

void wizard_init(struct wizard_data *wizard);
void wizard_init_all(void);

Evas_Object *wizard_add(Evas_Object *navi, struct wizard_data *wizard, uint_fast8_t pagenum, Eina_Bool pageindex);

#endif /* _UI_WIZARDS_H */