summaryrefslogtreecommitdiffstats
path: root/include/client
diff options
context:
space:
mode:
Diffstat (limited to 'include/client')
-rw-r--r--include/client/buffer.h8
-rw-r--r--include/client/cairo.h17
-rw-r--r--include/client/pango.h16
-rw-r--r--include/client/registry.h75
-rw-r--r--include/client/window.h67
5 files changed, 0 insertions, 183 deletions
diff --git a/include/client/buffer.h b/include/client/buffer.h
deleted file mode 100644
index eb9973ed..00000000
--- a/include/client/buffer.h
+++ /dev/null
@@ -1,8 +0,0 @@
1#ifndef _BUFFER_H
2#define _BUFFER_H
3
4#include "client/window.h"
5
6struct buffer *get_next_buffer(struct window *state);
7
8#endif
diff --git a/include/client/cairo.h b/include/client/cairo.h
deleted file mode 100644
index e7ef7c7e..00000000
--- a/include/client/cairo.h
+++ /dev/null
@@ -1,17 +0,0 @@
1#ifndef _SWAY_CAIRO_H
2#define _SWAY_CAIRO_H
3
4#include <stdint.h>
5#include <cairo/cairo.h>
6
7void cairo_set_source_u32(cairo_t *cairo, uint32_t color);
8
9cairo_surface_t *cairo_image_surface_scale(cairo_surface_t *image, int width, int height);
10
11#ifdef WITH_GDK_PIXBUF
12#include <gdk-pixbuf/gdk-pixbuf.h>
13
14cairo_surface_t* gdk_cairo_image_surface_create_from_pixbuf(const GdkPixbuf *gdkbuf);
15#endif //WITH_GDK_PIXBUF
16
17#endif
diff --git a/include/client/pango.h b/include/client/pango.h
deleted file mode 100644
index dd2f53c3..00000000
--- a/include/client/pango.h
+++ /dev/null
@@ -1,16 +0,0 @@
1#ifndef _SWAY_CLIENT_PANGO_H
2#define _SWAY_CLIENT_PANGO_H
3
4#include <cairo/cairo.h>
5#include <pango/pangocairo.h>
6#include <stdarg.h>
7#include <stdbool.h>
8#include <stdint.h>
9
10PangoLayout *get_pango_layout(cairo_t *cairo, const char *font, const char *text,
11 int32_t scale, bool markup);
12void get_text_size(cairo_t *cairo, const char *font, int *width, int *height,
13 int32_t scale, bool markup, const char *fmt, ...);
14void pango_printf(cairo_t *cairo, const char *font, int32_t scale, bool markup, const char *fmt, ...);
15
16#endif
diff --git a/include/client/registry.h b/include/client/registry.h
deleted file mode 100644
index 9dfbd835..00000000
--- a/include/client/registry.h
+++ /dev/null
@@ -1,75 +0,0 @@
1#ifndef _SWAY_CLIENT_REGISTRY_H
2#define _SWAY_CLIENT_REGISTRY_H
3
4#include <wayland-client.h>
5#include <xkbcommon/xkbcommon.h>
6#include "wayland-desktop-shell-client-protocol.h"
7#include "wayland-swaylock-client-protocol.h"
8#include "list.h"
9
10enum mod_bit {
11 MOD_SHIFT = 1<<0,
12 MOD_CAPS = 1<<1,
13 MOD_CTRL = 1<<2,
14 MOD_ALT = 1<<3,
15 MOD_MOD2 = 1<<4,
16 MOD_MOD3 = 1<<5,
17 MOD_LOGO = 1<<6,
18 MOD_MOD5 = 1<<7,
19};
20
21enum mask {
22 MASK_SHIFT,
23 MASK_CAPS,
24 MASK_CTRL,
25 MASK_ALT,
26 MASK_MOD2,
27 MASK_MOD3,
28 MASK_LOGO,
29 MASK_MOD5,
30 MASK_LAST
31};
32
33struct output_state {
34 struct wl_output *output;
35 uint32_t flags;
36 uint32_t width, height;
37 uint32_t scale;
38};
39
40struct xkb {
41 struct xkb_state *state;
42 struct xkb_context *context;
43 struct xkb_keymap *keymap;
44 xkb_mod_mask_t masks[MASK_LAST];
45};
46
47struct input {
48 struct xkb xkb;
49
50 xkb_keysym_t sym;
51 uint32_t code;
52 uint32_t last_code;
53 uint32_t modifiers;
54
55 void (*notify)(enum wl_keyboard_key_state state, xkb_keysym_t sym, uint32_t code, uint32_t codepoint);
56};
57
58struct registry {
59 struct wl_compositor *compositor;
60 struct wl_display *display;
61 struct wl_pointer *pointer;
62 struct wl_keyboard *keyboard;
63 struct wl_seat *seat;
64 struct wl_shell *shell;
65 struct wl_shm *shm;
66 struct desktop_shell *desktop_shell;
67 struct lock *swaylock;
68 struct input *input;
69 list_t *outputs;
70};
71
72struct registry *registry_poll(void);
73void registry_teardown(struct registry *registry);
74
75#endif
diff --git a/include/client/window.h b/include/client/window.h
deleted file mode 100644
index 8af8225c..00000000
--- a/include/client/window.h
+++ /dev/null
@@ -1,67 +0,0 @@
1#ifndef _CLIENT_H
2#define _CLIENT_H
3
4#include <wayland-client.h>
5#include "wayland-desktop-shell-client-protocol.h"
6#include <cairo/cairo.h>
7#include <pango/pangocairo.h>
8#include <stdbool.h>
9#include "list.h"
10#include "client/registry.h"
11
12struct window;
13
14struct buffer {
15 struct wl_buffer *buffer;
16 cairo_surface_t *surface;
17 cairo_t *cairo;
18 PangoContext *pango;
19 uint32_t width, height;
20 bool busy;
21};
22
23struct cursor {
24 struct wl_surface *surface;
25 struct wl_cursor_theme *cursor_theme;
26 struct wl_cursor *cursor;
27 struct wl_pointer *pointer;
28};
29
30enum scroll_direction {
31 SCROLL_UP,
32 SCROLL_DOWN,
33 SCROLL_LEFT,
34 SCROLL_RIGHT,
35};
36
37struct pointer_input {
38 int last_x;
39 int last_y;
40
41 void (*notify_button)(struct window *window, int x, int y, uint32_t button, uint32_t state_w);
42 void (*notify_scroll)(struct window *window, enum scroll_direction direction);
43};
44
45struct window {
46 struct registry *registry;
47 struct buffer buffers[2];
48 struct buffer *buffer;
49 struct wl_surface *surface;
50 struct wl_shell_surface *shell_surface;
51 struct wl_callback *frame_cb;
52 struct cursor cursor;
53 uint32_t width, height;
54 int32_t scale;
55 char *font;
56 cairo_t *cairo;
57 struct pointer_input pointer_input;
58};
59
60struct window *window_setup(struct registry *registry, uint32_t width, uint32_t height,
61 int32_t scale, bool shell_surface);
62void window_teardown(struct window *state);
63int window_prerender(struct window *state);
64int window_render(struct window *state);
65void window_make_shell(struct window *window);
66
67#endif