File: data.h

package info (click to toggle)
mlterm 3.1.2-1.3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 23,168 kB
  • sloc: ansic: 102,795; sh: 9,676; java: 2,018; perl: 1,601; makefile: 1,595; cpp: 771; sed: 16
file content (53 lines) | stat: -rw-r--r-- 836 bytes parent folder | download | duplicates (7)
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
50
51
52
53
#ifndef _DATA_H_

#define _DATA_H_

#define MAX_ENTRY 8

/*
 * typedefs
 */
typedef enum {
	ENT_NONE,
	ENT_STRING,
	ENT_NUMERIC,
	ENT_COLOR,
	ENT_BOOL,
	ENT_RADIO
} entry_type_t;


typedef struct {
	const char *name;
	const char *key;
	int modified;
	entry_type_t  type;
	void * data;
} entry_t;

typedef struct {
	const char *name;
	int size;
	int selected;
	int modified;
	int maxwidth;
	entry_t entry[MAX_ENTRY];
} section_t;

typedef enum {
	DS_CANCEL,
	DS_SELECT,
	DS_EDIT
} display_state_t;


int entry_free(entry_t *entry);
int entry_edit(window_t *window, entry_t *entry, int x, int y);
int entry_apply(entry_t *entry);
int entry_display(window_t *window, entry_t *entry, int x, int y, int state);
int entry_reset(entry_t *entry);
window_t * entry_window_new(window_t * section);

void section_free(section_t *section);
#endif