]> git.sur5r.net Git - i3/i3/blob - i3bar/include/child.h
Merge branch 'next'
[i3/i3] / i3bar / include / child.h
1 /*
2  * vim:ts=4:sw=4:expandtab
3  *
4  * i3bar - an xcb-based status- and ws-bar for i3
5  * © 2010-2012 Axel Wagner and contributors (see also: LICENSE)
6  *
7  * child.c: Getting Input for the statusline
8  *
9  */
10 #ifndef CHILD_H_
11 #define CHILD_H_
12
13 #include <stdbool.h>
14
15 #define STDIN_CHUNK_SIZE 1024
16
17 typedef struct {
18     pid_t pid;
19
20     /**
21      * The version number is an uint32_t to avoid machines with different sizes of
22      * 'int' to allow different values here. It’s highly unlikely we ever exceed
23      * even an int8_t, but still…
24      */
25     uint32_t version;
26
27     bool stopped;
28     /**
29      * The signal requested by the client to inform it of the hidden state of i3bar
30      */
31     int stop_signal;
32     /**
33      * The signal requested by the client to inform it of theun hidden state of i3bar
34      */
35     int cont_signal;
36
37     /**
38      * Enable click events
39      */
40     bool click_events;
41     bool click_events_init;
42 } i3bar_child;
43
44 /*
45  * Start a child-process with the specified command and reroute stdin.
46  * We actually start a $SHELL to execute the command so we don't have to care
47  * about arguments and such
48  *
49  */
50 void start_child(char *command);
51
52 /*
53  * kill()s the child-process (if any). Called when exit()ing.
54  *
55  */
56 void kill_child_at_exit(void);
57
58 /*
59  * kill()s the child-process (if any) and closes and
60  * free()s the stdin- and sigchild-watchers
61  *
62  */
63 void kill_child(void);
64
65 /*
66  * Sends a SIGSTOP to the child-process (if existent)
67  *
68  */
69 void stop_child(void);
70
71 /*
72  * Sends a SIGCONT to the child-process (if existent)
73  *
74  */
75 void cont_child(void);
76
77 /*
78  * Generates a click event, if enabled.
79  *
80  */
81 void send_block_clicked(int button, const char *name, const char *instance, int x, int y);
82
83 #endif