aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile37
-rw-r--r--src/comet.c (renamed from comet.c)8
-rw-r--r--src/connect.c (renamed from connection.c)10
-rw-r--r--src/connect.h (renamed from connection.h)12
-rw-r--r--src/draw.c (renamed from draw.c)0
-rw-r--r--src/draw.h (renamed from draw.h)0
-rw-r--r--src/log.c (renamed from log.c)0
-rw-r--r--src/log.h (renamed from log.h)0
-rw-r--r--src/state.c (renamed from state.c)0
-rw-r--r--src/state.h (renamed from state.h)0
-rw-r--r--src/window.c (renamed from window.c)0
-rw-r--r--src/window.h (renamed from window.h)2
12 files changed, 38 insertions, 31 deletions
diff --git a/Makefile b/Makefile
index 70f37f6..b79cacc 100644
--- a/Makefile
+++ b/Makefile
@@ -1,21 +1,26 @@
-SRC = $(wildcard *.c)
+SRC = $(wildcard src/*.c)
OBJ = $(SRC:.c=.o)
BIN = comet.bin
-DEPS = \
- xcb \
- xcb-aux \
- xcb-icccm \
- xcb-ewmh \
- xcb-xrm \
- xcb-shape \
- xcb-errors \
- "xcb-randr >= 1.5" \
- "glib-2.0 >= 2.44" \
- pangocairo
-
-CFLAGS := $(shell pkg-config --cflags $(DEPS)) -ggdb
-LDFLAGS := $(shell pkg-config --libs $(DEPS)) -lm
+PCDEP = xcb \
+ xcb-aux \
+ xcb-icccm \
+ xcb-ewmh \
+ xcb-xrm \
+ xcb-shape \
+ xcb-errors \
+ "xcb-randr >= 1.5" \
+ "glib-2.0 >= 2.44" \
+ pangocairo
+
+CFLAGS := $(shell pkg-config --cflags $(PCDEP))
+LDFLAGS := $(shell pkg-config --libs $(PCDEP)) -lm
+
+ifdef RELEASE
+CFLAGS += -O2
+else
+CFLAGS += -ggdb
+endif
all: $(BIN)
@@ -27,3 +32,5 @@ $(BIN): $(OBJ)
clean:
rm -rf $(BIN) $(OBJ)
+
+# vim: ts=4 sw=4
diff --git a/comet.c b/src/comet.c
index a21b83a..9733d4b 100644
--- a/comet.c
+++ b/src/comet.c
@@ -5,7 +5,7 @@
#include "window.h"
#include "log.h"
#include "draw.h"
-#include "connection.h"
+#include "connect.h"
#include "state.h"
#define EVEN(n) ((int)(n) - ((int)(n) % 2 != 0))
@@ -29,7 +29,7 @@ int main(int argc, char **argv)
GMainLoop *mainloop = g_main_loop_new(NULL, FALSE);
- Connection *con = connection_create();
+ Connection *con = connect_create();
Window *win = window_create(con);
@@ -45,8 +45,8 @@ int main(int argc, char **argv)
Drawable *draw = draw_create("Hack 12", height, x_padding, x_padding, y_padding, 1);
State *state = state_create(win, draw);
- connection_attach_state(con, state);
- connection_attach_source(con);
+ connect_attach_state(con, state);
+ connect_attach_source(con);
guint source_term = g_unix_signal_add(SIGTERM, mainloop_quit, mainloop);
guint source_int = g_unix_signal_add(SIGINT, mainloop_quit, mainloop);
diff --git a/connection.c b/src/connect.c
index d3eedda..0ef12f9 100644
--- a/connection.c
+++ b/src/connect.c
@@ -7,7 +7,7 @@
#include <xcb/randr.h>
#include "log.h"
-#include "connection.h"
+#include "connect.h"
#include "state.h"
static bool query_xrm(Connection *con, const char *res, char **value)
@@ -182,7 +182,7 @@ static void attach_source(Connection *con)
g_source_attach(con->source, NULL);
}
-Connection *connection_create()
+Connection *connect_create()
{
Connection *con = g_malloc0(sizeof(Connection));
g_assert_nonnull(con);
@@ -265,7 +265,7 @@ Connection *connection_create()
return con;
}
-void connection_attach_source(Connection *con)
+void connect_attach_source(Connection *con)
{
g_assert_null(con->source);
@@ -273,14 +273,14 @@ void connection_attach_source(Connection *con)
log_debug("Xcb event loop attached");
}
-void connection_attach_state(Connection *con, State *state)
+void connect_attach_state(Connection *con, State *state)
{
g_assert_nonnull(state);
g_ptr_array_add(con->states, state);
log_debug("Attached state to event loop");
}
-void connection_destroy(Connection *con)
+void connect_destroy(Connection *con)
{
g_ptr_array_free(con->states, true);
diff --git a/connection.h b/src/connect.h
index 21cbf3f..e348bcf 100644
--- a/connection.h
+++ b/src/connect.h
@@ -1,5 +1,5 @@
-#ifndef COMET_CONNECTION_H
-#define COMET_CONNECTION_H
+#ifndef COMET_CONNEC_H
+#define COMET_CONNEC_H
#include <glib.h>
#include <xcb/xcb.h>
@@ -28,13 +28,13 @@ struct Connection {
GPtrArray *states;
};
-Connection *connection_create();
+Connection *connect_create();
-void connection_attach_source(Connection *con);
+void connect_attach_source(Connection *con);
-void connection_attach_state(Connection *con, State *state);
+void connect_attach_state(Connection *con, State *state);
-void connection_destroy(Connection *con);
+void connect_destroy(Connection *con);
#endif
diff --git a/draw.c b/src/draw.c
index aed4da0..aed4da0 100644
--- a/draw.c
+++ b/src/draw.c
diff --git a/draw.h b/src/draw.h
index 3e83146..3e83146 100644
--- a/draw.h
+++ b/src/draw.h
diff --git a/log.c b/src/log.c
index f4c529f..f4c529f 100644
--- a/log.c
+++ b/src/log.c
diff --git a/log.h b/src/log.h
index c96536b..c96536b 100644
--- a/log.h
+++ b/src/log.h
diff --git a/state.c b/src/state.c
index bb31fa6..bb31fa6 100644
--- a/state.c
+++ b/src/state.c
diff --git a/state.h b/src/state.h
index 696b657..696b657 100644
--- a/state.h
+++ b/src/state.h
diff --git a/window.c b/src/window.c
index 734761a..734761a 100644
--- a/window.c
+++ b/src/window.c
diff --git a/window.h b/src/window.h
index 5ee075f..e6172ac 100644
--- a/window.h
+++ b/src/window.h
@@ -3,7 +3,7 @@
#include <cairo.h>
-#include "connection.h"
+#include "connect.h"
typedef struct Window Window;