File: execcontext.h

package info (click to toggle)
fvwm 1%3A2.6.8-1
  • links: PTS
  • area: main
  • in suites: bullseye, buster
  • size: 15,804 kB
  • sloc: ansic: 145,770; xml: 17,093; perl: 7,302; sh: 4,921; makefile: 1,094; yacc: 688; lex: 187; sed: 11
file content (115 lines) | stat: -rw-r--r-- 2,734 bytes parent folder | download | duplicates (8)
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/* -*-c-*- */

#ifndef EXECCONTEXT_H
#define EXECCONTEXT_H

/* ---------------------------- included header files ---------------------- */

/* ---------------------------- global definitions ------------------------- */

/* ---------------------------- global macros ------------------------------ */

/* ---------------------------- type definitions --------------------------- */

/* Inernal types */
typedef struct
{
	XEvent te;
} exec_context_privileged_t;

/* Interface types */
typedef enum
{
	EXCT_NULL = '-',
	EXCT_INIT = 'I',
	EXCT_RESTART = 'R',
	EXCT_QUIT = 'Q',
	EXCT_TORESTART = 'r',
	EXCT_EVENT ='E',
	EXCT_MODULE ='M',
	EXCT_MENULOOP ='m',
	EXCT_PAGING = 'P',
	EXCT_SCHEDULE = 'S'
} exec_context_type_t;

typedef struct
{
	XEvent *etrigger;
	XEvent *elast;
} x_context_t;

typedef struct
{
	FvwmWindow *fw;
	Window w;
	unsigned long wcontext;
} window_context_t;

struct fmodule;
typedef struct
{
	struct fmodule *module;
} module_context_t;

typedef struct
{
	exec_context_type_t type;
	x_context_t x;
	window_context_t w;
	module_context_t m;
	/* for internal use *only*. *Never* acces this from outside! */
	exec_context_privileged_t private_data;
} exec_context_t;

typedef enum
{
	ECC_TYPE = 0x1,
	ECC_ETRIGGER = 0x2,
	ECC_FW = 0x4,
	ECC_W = 0x8,
	ECC_WCONTEXT = 0x10,
	ECC_MODULE = 0x20
} exec_context_change_mask_t;

typedef struct
{
	exec_context_type_t type;
	x_context_t x;
	window_context_t w;
	module_context_t m;
} exec_context_changes_t;

/* ---------------------------- forward declarations ----------------------- */

/* ---------------------------- exported variables (globals) --------------- */

/* ---------------------------- interface functions ------------------------ */

/* Creates a new exec_context from the passed in arguments in malloc'ed memory.
 * The context must later be destroyed with exc_destroy_context().
 *
 * Args:
 *   ecc
 *     Pointer to a structure which specifies the initial values of the struct
 *     members.
 *   mask
 *     The mask of members in ecc to use.
 */
const exec_context_t *exc_create_context(
	exec_context_changes_t *ecc, exec_context_change_mask_t mask);

/* Similar to exc_create_context(), but the created context contains only dummy
 * information. */
const exec_context_t *exc_create_null_context(void);

/* Works like exc_create_context(), but initialises all values with the data
 * from excin.  The ecc/mask pair overrides these values. */
const exec_context_t *exc_clone_context(
	const exec_context_t *excin, exec_context_changes_t *ecc,
	exec_context_change_mask_t mask);

/* Destroys an exec_context structure that was created with
 * exc_create_context(). */
void exc_destroy_context(const exec_context_t *exc);

#endif /* EXECCONTEXT_H */