Be more strict with encapsulation
I.e. move the xcb-event-handling into xcb.c and the child-process-communications into newly created child.c. Also change some includes.
This commit is contained in:
9
i3bar/include/child.h
Normal file
9
i3bar/include/child.h
Normal file
@ -0,0 +1,9 @@
|
||||
#ifndef CHILD_H_
|
||||
#define CHILD_H_
|
||||
|
||||
#define STDIN_CHUNK_SIZE 1024
|
||||
|
||||
void start_child(char *command);
|
||||
void kill_child();
|
||||
|
||||
#endif
|
@ -1,8 +1,6 @@
|
||||
#ifndef COMMON_H_
|
||||
#define COMMON_H_
|
||||
|
||||
#include "util.h"
|
||||
|
||||
typedef struct rect_t rect;
|
||||
typedef int bool;
|
||||
|
||||
@ -17,4 +15,12 @@ struct rect_t {
|
||||
int h;
|
||||
};
|
||||
|
||||
#include "queue.h"
|
||||
#include "child.h"
|
||||
#include "ipc.h"
|
||||
#include "outputs.h"
|
||||
#include "util.h"
|
||||
#include "workspaces.h"
|
||||
#include "xcb.h"
|
||||
|
||||
#endif
|
||||
|
@ -1,7 +1,6 @@
|
||||
#ifndef IPC_H_
|
||||
#define IPC_H_
|
||||
|
||||
#include <ev.h>
|
||||
#include <stdint.h>
|
||||
|
||||
int init_connection(const char *socket_path);
|
||||
|
@ -4,7 +4,6 @@
|
||||
#include <xcb/xcb.h>
|
||||
|
||||
#include "common.h"
|
||||
#include "workspaces.h"
|
||||
|
||||
typedef struct i3_output i3_output;
|
||||
|
||||
|
@ -2,7 +2,6 @@
|
||||
#define WORKSPACES_H_
|
||||
|
||||
#include "common.h"
|
||||
#include "outputs.h"
|
||||
|
||||
typedef struct i3_ws i3_ws;
|
||||
|
||||
|
@ -1,22 +1,7 @@
|
||||
#ifndef XCB_H_
|
||||
#define XCB_H_
|
||||
|
||||
#include <xcb/xcb.h>
|
||||
|
||||
#define NUM_ATOMS 3
|
||||
|
||||
enum {
|
||||
#define ATOM_DO(name) name,
|
||||
#include "xcb_atoms.def"
|
||||
};
|
||||
|
||||
xcb_atom_t atoms[NUM_ATOMS];
|
||||
|
||||
xcb_connection_t *xcb_connection;
|
||||
xcb_screen_t *xcb_screens;
|
||||
xcb_window_t xcb_root;
|
||||
xcb_font_t xcb_font;
|
||||
int font_height;
|
||||
int font_height;
|
||||
|
||||
void init_xcb();
|
||||
void clean_xcb();
|
||||
@ -25,6 +10,5 @@ void destroy_windows();
|
||||
void create_windows();
|
||||
void draw_bars();
|
||||
int get_string_width(char *string);
|
||||
void handle_xcb_event(xcb_generic_event_t *event);
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user