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