]> git.sur5r.net Git - i3/i3/blobdiff - i3bar/include/outputs.h
Optionally change i3bar color on focused output, implements #2020
[i3/i3] / i3bar / include / outputs.h
index e6605e1f73da2b7892e6be88b7360c31118f94e4..08adefd9742f8ced77e035325caed4fc565c3db4 100644 (file)
 #pragma once
 
 #include <xcb/xcb.h>
+#include <cairo/cairo-xcb.h>
 
 #include "common.h"
+#include "draw_util.h"
 
 typedef struct i3_output i3_output;
 
@@ -36,6 +38,12 @@ void init_outputs(void);
  */
 i3_output* get_output_by_name(char* name);
 
+/*
+ * Returns true if the output has the currently focused workspace
+ *
+ */
+bool output_has_focus(i3_output* output);
+
 struct i3_output {
     char* name;   /* Name of the output */
     bool active;  /* If the output is active */
@@ -44,9 +52,16 @@ struct i3_output {
     int ws;       /* The number of the currently visible ws */
     rect rect;    /* The rect (relative to the root window) */
 
-    xcb_window_t bar;     /* The id of the bar of the output */
-    xcb_pixmap_t buffer;  /* An extra pixmap for double-buffering */
-    xcb_gcontext_t bargc; /* The graphical context of the bar */
+    /* Off-screen buffer for preliminary rendering of the bar. */
+    surface_t buffer;
+    /* Off-screen buffer for pre-rendering the statusline, separated to make clipping easier. */
+    surface_t statusline_buffer;
+    /* How much of statusline_buffer's horizontal space was used on last statusline render. */
+    int statusline_width;
+    /* Whether statusline block short texts where used on last statusline render. */
+    bool statusline_short_text;
+    /* The actual window on which we draw. */
+    surface_t bar;
 
     struct ws_head* workspaces;  /* The workspaces on this output */
     struct tc_head* trayclients; /* The tray clients on this output */