summaryrefslogtreecommitdiff
path: root/src/privateoption.h
blob: bdbcad2a903ea947d6d258f3d626b27e341ffe05 (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#ifndef _PRIVATEOPTION_H
#define _PRIVATEOPTION_H

#include <vector>

#include <compaction.h>
#include <compmatch.h>
#include <compdisplay.h>
#include <compscreen.h>

typedef struct _CompOptionIntRestriction {
    int min;
    int max;
} IntRestriction;

typedef struct _CompOptionFloatRestriction {
    float min;
    float max;
    float precision;
} FloatRestriction;

typedef union {
    IntRestriction    i;
    FloatRestriction  f;
} RestrictionUnion;

class PrivateRestriction {
    public:
	CompOption::Type type;
	RestrictionUnion rest;
};

typedef union {
    bool	   b;
    int		   i;
    float	   f;
    unsigned short c[4];
} ValueUnion;

class PrivateValue {
    public:
	PrivateValue ();
	PrivateValue (const PrivateValue&);

	void reset ();
	
	CompOption::Type          type;
	ValueUnion                value;
	CompString                string;
	CompAction                action;
	CompMatch                 match;
	CompOption::Type          listType;
	CompOption::Value::Vector list;
};

class PrivateOption
{
    public:
	PrivateOption ();
	PrivateOption (const PrivateOption &);
	
	CompString              name;
	CompOption::Type        type;
	CompOption::Value       value;
	CompOption::Restriction rest;
};

#endif