aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-11-18 08:22:25 -0500
committerGitHub <noreply@github.com>2018-11-18 08:22:25 -0500
commitb87250425fe13149e41b346f15c5cf808f376438 (patch)
tree145fcb048cc3df3d04a8b6afb90de68dd2dd80a9 /include
parenteda3bfeed5097c71634332bfe998188b028abf02 (diff)
parentcad851805bea6b4777685df1c6adf8cb9fa71835 (diff)
Merge pull request #3147 from emersion/set10
Use #if instead of #ifdef
Diffstat (limited to 'include')
-rw-r--r--include/cairo.h12
-rw-r--r--include/sway/criteria.h2
-rw-r--r--include/sway/output.h2
-rw-r--r--include/sway/server.h6
-rw-r--r--include/sway/tree/root.h2
-rw-r--r--include/sway/tree/view.h12
6 files changed, 20 insertions, 16 deletions
diff --git a/include/cairo.h b/include/cairo.h
index 86530b60..f28c072f 100644
--- a/include/cairo.h
+++ b/include/cairo.h
@@ -1,8 +1,13 @@
#ifndef _SWAY_CAIRO_H
#define _SWAY_CAIRO_H
+
+#include "config.h"
#include <stdint.h>
#include <cairo/cairo.h>
#include <wlr/types/wlr_output.h>
+#if HAVE_GDK_PIXBUF
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#endif
void cairo_set_source_u32(cairo_t *cairo, uint32_t color);
cairo_subpixel_order_t to_cairo_subpixel_order(enum wl_output_subpixel subpixel);
@@ -10,12 +15,11 @@ cairo_subpixel_order_t to_cairo_subpixel_order(enum wl_output_subpixel subpixel)
cairo_surface_t *cairo_image_surface_scale(cairo_surface_t *image,
int width, int height);
-#include "config.h"
-#ifdef HAVE_GDK_PIXBUF
-#include <gdk-pixbuf/gdk-pixbuf.h>
+#if HAVE_GDK_PIXBUF
cairo_surface_t* gdk_cairo_image_surface_create_from_pixbuf(
const GdkPixbuf *gdkbuf);
-#endif //WITH_GDK_PIXBUF
+
+#endif // HAVE_GDK_PIXBUF
#endif
diff --git a/include/sway/criteria.h b/include/sway/criteria.h
index 323ba01d..3eb583d5 100644
--- a/include/sway/criteria.h
+++ b/include/sway/criteria.h
@@ -25,7 +25,7 @@ struct criteria {
pcre *app_id;
pcre *con_mark;
uint32_t con_id; // internal ID
-#ifdef HAVE_XWAYLAND
+#if HAVE_XWAYLAND
pcre *class;
uint32_t id; // X11 window ID
pcre *instance;
diff --git a/include/sway/output.h b/include/sway/output.h
index 5efe1660..43c1ab96 100644
--- a/include/sway/output.h
+++ b/include/sway/output.h
@@ -119,7 +119,7 @@ void output_layer_for_each_surface(struct sway_output *output,
struct wl_list *layer_surfaces, sway_surface_iterator_func_t iterator,
void *user_data);
-#ifdef HAVE_XWAYLAND
+#if HAVE_XWAYLAND
void output_unmanaged_for_each_surface(struct sway_output *output,
struct wl_list *unmanaged, sway_surface_iterator_func_t iterator,
void *user_data);
diff --git a/include/sway/server.h b/include/sway/server.h
index 5fced224..a3233d66 100644
--- a/include/sway/server.h
+++ b/include/sway/server.h
@@ -14,7 +14,7 @@
#include <wlr/types/wlr_xdg_shell.h>
#include "config.h"
#include "list.h"
-#ifdef HAVE_XWAYLAND
+#if HAVE_XWAYLAND
#include "sway/xwayland.h"
#endif
@@ -44,7 +44,7 @@ struct sway_server {
struct wlr_xdg_shell *xdg_shell;
struct wl_listener xdg_shell_surface;
-#ifdef HAVE_XWAYLAND
+#if HAVE_XWAYLAND
struct sway_xwayland xwayland;
struct wl_listener xwayland_surface;
struct wl_listener xwayland_ready;
@@ -80,7 +80,7 @@ void handle_idle_inhibitor_v1(struct wl_listener *listener, void *data);
void handle_layer_shell_surface(struct wl_listener *listener, void *data);
void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data);
void handle_xdg_shell_surface(struct wl_listener *listener, void *data);
-#ifdef HAVE_XWAYLAND
+#if HAVE_XWAYLAND
void handle_xwayland_surface(struct wl_listener *listener, void *data);
#endif
void handle_server_decoration(struct wl_listener *listener, void *data);
diff --git a/include/sway/tree/root.h b/include/sway/tree/root.h
index a2d464f9..ceccc920 100644
--- a/include/sway/tree/root.h
+++ b/include/sway/tree/root.h
@@ -16,7 +16,7 @@ struct sway_root {
struct wlr_output_layout *output_layout;
struct wl_listener output_layout_change;
-#ifdef HAVE_XWAYLAND
+#if HAVE_XWAYLAND
struct wl_list xwayland_unmanaged; // sway_xwayland_unmanaged::link
#endif
struct wl_list drag_icons; // sway_drag_icon::link
diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h
index 8f045c6a..4716c688 100644
--- a/include/sway/tree/view.h
+++ b/include/sway/tree/view.h
@@ -4,7 +4,7 @@
#include <wlr/types/wlr_surface.h>
#include <wlr/types/wlr_xdg_shell_v6.h>
#include "config.h"
-#ifdef HAVE_XWAYLAND
+#if HAVE_XWAYLAND
#include <wlr/xwayland.h>
#endif
#include "sway/input/input-manager.h"
@@ -16,7 +16,7 @@ struct sway_xdg_decoration;
enum sway_view_type {
SWAY_VIEW_XDG_SHELL_V6,
SWAY_VIEW_XDG_SHELL,
-#ifdef HAVE_XWAYLAND
+#if HAVE_XWAYLAND
SWAY_VIEW_XWAYLAND,
#endif
};
@@ -28,7 +28,7 @@ enum sway_view_prop {
VIEW_PROP_INSTANCE,
VIEW_PROP_WINDOW_TYPE,
VIEW_PROP_WINDOW_ROLE,
-#ifdef HAVE_XWAYLAND
+#if HAVE_XWAYLAND
VIEW_PROP_X11_WINDOW_ID,
VIEW_PROP_X11_PARENT_ID,
#endif
@@ -100,7 +100,7 @@ struct sway_view {
union {
struct wlr_xdg_surface_v6 *wlr_xdg_surface_v6;
struct wlr_xdg_surface *wlr_xdg_surface;
-#ifdef HAVE_XWAYLAND
+#if HAVE_XWAYLAND
struct wlr_xwayland_surface *wlr_xwayland_surface;
#endif
struct wlr_wl_shell_surface *wlr_wl_shell_surface;
@@ -144,7 +144,7 @@ struct sway_xdg_shell_view {
struct wl_listener unmap;
struct wl_listener destroy;
};
-#ifdef HAVE_XWAYLAND
+#if HAVE_XWAYLAND
struct sway_xwayland_view {
struct sway_view view;
@@ -323,7 +323,7 @@ struct sway_view *view_from_wlr_xdg_surface(
struct wlr_xdg_surface *xdg_surface);
struct sway_view *view_from_wlr_xdg_surface_v6(
struct wlr_xdg_surface_v6 *xdg_surface_v6);
-#ifdef HAVE_XWAYLAND
+#if HAVE_XWAYLAND
struct sway_view *view_from_wlr_xwayland_surface(
struct wlr_xwayland_surface *xsurface);
#endif