aboutsummaryrefslogtreecommitdiffstats
path: root/src/cg-base.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2016-08-04 17:43:24 +0200
committerMattias Andrée <maandree@kth.se>2016-08-04 17:43:24 +0200
commit2806d5f7e1b5223d5b8524ae4770235fc69aa85b (patch)
tree99b2cb5264b682807e7c2288809b84754761e8ea /src/cg-base.h
parentm (diff)
downloadcg-tools-2806d5f7e1b5223d5b8524ae4770235fc69aa85b.tar.gz
cg-tools-2806d5f7e1b5223d5b8524ae4770235fc69aa85b.tar.bz2
cg-tools-2806d5f7e1b5223d5b8524ae4770235fc69aa85b.tar.xz
Work on cg-base
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src/cg-base.h')
-rw-r--r--src/cg-base.h80
1 files changed, 80 insertions, 0 deletions
diff --git a/src/cg-base.h b/src/cg-base.h
index 662f044..13667b7 100644
--- a/src/cg-base.h
+++ b/src/cg-base.h
@@ -20,6 +20,55 @@
/**
+ * Information (except asynchronous call context)
+ * required to update the gamma ramps on a CRTC.
+ */
+typedef struct filter_update
+{
+ /**
+ * The filter to update
+ *
+ * `.filter.crtc` and `.filter.priority`
+ * are preconfigured
+ */
+ libcoopgamma_filter_t filter;
+
+ /**
+ * Has the update been synchronised?
+ */
+ int synced;
+
+ /**
+ * Did the update fail?
+ */
+ int failed;
+
+ /**
+ * Error description if `.failed` is true
+ */
+ libcoopgamma_error_t error;
+
+ /**
+ * If zero, the ramps in `.filter` shall
+ * neither be modified nor freed.
+ */
+ int master;
+
+ /**
+ * 0-terminated list of elements in
+ * `.crtc_updates` which shares gamma
+ * ramps with this instance
+ *
+ * This will only be set if `.master`
+ * is true.
+ */
+ size_t* slaves;
+
+} filter_update_t;
+
+
+
+/**
* The process's name
*/
extern const char* argv0;
@@ -35,6 +84,11 @@ extern libcoopgamma_context_t cg;
extern char** crtcs;
/**
+ * Gamma ramp updates for each CRTC
+ */
+extern filter_update_t* crtc_updates;
+
+/**
* CRTC and monitor information about
* each selected CRTC and connect monitor
*/
@@ -48,6 +102,22 @@ extern size_t crtcs_n;
/**
+ * The default filter priority for the program
+ */
+extern const int64_t default_priority;
+
+
+
+/**
+ * Make elements in `crtc_updates` slaves where appropriate
+ *
+ * @return Zero on success, -1 on error
+ */
+int make_slaves(void);
+
+
+
+/**
* Print usage information and exit
*/
#if defined(__GNUC__)
@@ -90,3 +160,13 @@ __attribute__((__nonnull__(2)))
#endif
extern int handle_args(int argc, char* argv[], char* method, char* site, char** crtcs);
+/**
+ * The main function for the program-specific code
+ *
+ * @return 0: Success
+ * -1: Error, `errno` set
+ * -2: Error, `cg.error` set
+ * -3: Error, message already printed
+ */
+extern int start(void);
+