]> git.sur5r.net Git - i3/i3/blobdiff - include/util.h
Merge branch 'master' into next
[i3/i3] / include / util.h
index 4a5920d2fbfa692627f17a09bc34a3fe5e8d1b97..61a38f3ec030537f184cf9a84c1f23b96373efa2 100644 (file)
@@ -8,8 +8,8 @@
  *         also libi3).
  *
  */
-#ifndef _UTIL_H
-#define _UTIL_H
+#ifndef I3_UTIL_H
+#define I3_UTIL_H
 
 #include <err.h>
 
@@ -91,15 +91,6 @@ void exec_i3_utility(char *name, char *argv[]);
 void check_error(xcb_connection_t *conn, xcb_void_cookie_t cookie,
                  char *err_message);
 
-/**
- * Converts the given string to UCS-2 big endian for use with
- * xcb_image_text_16(). The amount of real glyphs is stored in real_strlen, a
- * buffer containing the UCS-2 encoded string (16 bit per glyph) is
- * returned. It has to be freed when done.
- *
- */
-char *convert_utf8_to_ucs2(char *input, int *real_strlen);
-
 /**
  * This function resolves ~ in pathnames.
  * It may resolve wildcards in the first part of the path, but if no match
@@ -114,13 +105,6 @@ char *resolve_tilde(const char *path);
  */
 bool path_exists(const char *path);
 
-
-/**
- * Returns the name of a temporary file with the specified prefix.
- *
- */
-char *get_process_filename(const char *prefix);
-
 /**
  * Restart i3 in-place
  * appends -a to argument list to disable autostart
@@ -139,4 +123,23 @@ void *memmem(const void *l, size_t l_len, const void *s, size_t s_len);
 
 #endif
 
+/**
+ * Starts an i3-nagbar instance with the given parameters. Takes care of
+ * handling SIGCHLD and killing i3-nagbar when i3 exits.
+ *
+ * The resulting PID will be stored in *nagbar_pid and can be used with
+ * kill_nagbar() to kill the bar later on.
+ *
+ */
+void start_nagbar(pid_t *nagbar_pid, char *argv[]);
+
+/**
+ * Kills the i3-nagbar process, if *nagbar_pid != -1.
+ *
+ * If wait_for_it is set (restarting i3), this function will waitpid(),
+ * otherwise, ev is assumed to handle it (reloading).
+ *
+ */
+void kill_nagbar(pid_t *nagbar_pid, bool wait_for_it);
+
 #endif