summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryce Harrington <bryce@canonical.com>2012-02-15 18:23:29 -0800
committerBryce Harrington <bryce@canonical.com>2012-02-15 18:23:29 -0800
commitfb7e32df98c64ac3d3179e432dbb954c73416f83 (patch)
tree77313f5330bb361337bc2a4a44b555cd165f817b
parent7a9883cb1932a2f978ce84aabb01bd4b936930d4 (diff)
Fix syntax errors and get tests to build, run, and pass.devel
-rw-r--r--examples/xrandr.c6
-rw-r--r--include/X11/extensions/XrandrUtils.h16
-rw-r--r--src/Makefile.am4
-rw-r--r--test/names.c30
4 files changed, 31 insertions, 25 deletions
diff --git a/examples/xrandr.c b/examples/xrandr.c
index 68b2835..9f892a8 100644
--- a/examples/xrandr.c
+++ b/examples/xrandr.c
@@ -373,7 +373,7 @@ find_output (XRUName *name)
for (output = outputs; output; output = output->next)
{
- if (XRUNameEqual (name, output->output))
+ if (XRUNameEqual (name, &(output->output)))
break;
}
return output;
@@ -408,7 +408,7 @@ find_crtc (XRUName *name)
for (c = 0; c < num_crtcs; c++)
{
crtc = &crtcs[c];
- if (XRUNameEqual (name, crtc->crtc))
+ if (XRUNameEqual (name, &(crtc->crtc)))
break;
crtc = NULL;
}
@@ -522,7 +522,7 @@ find_mode_for_output (XRUOutput *output, XRUName *name)
}
static XRRModeInfo *
-preferred_mode (XRUOoutput *output)
+preferred_mode (XRUOutput *output)
{
XRROutputInfo *output_info = output->output_info;
int m;
diff --git a/include/X11/extensions/XrandrUtils.h b/include/X11/extensions/XrandrUtils.h
index ed2ef18..dc22556 100644
--- a/include/X11/extensions/XrandrUtils.h
+++ b/include/X11/extensions/XrandrUtils.h
@@ -30,6 +30,7 @@
#include <X11/Xdefs.h>
#include <X11/extensions/randr.h>
+#include <X11/extensions/Xrandr.h>
typedef enum {
relation_left_of,
@@ -135,6 +136,9 @@ XRUSetTransform (XRUTransform *dest,
XFixed *params,
int nparams);
+void
+XRUCopyTransform (XRUTransform *dest, XRUTransform *src);
+
Bool
XRUEqualTransform (XRUTransform *a, XRUTransform *b);
@@ -159,7 +163,7 @@ typedef enum {
typedef struct _output XRUOutput;
-struct {
+typedef struct {
XRUName crtc;
Bool changing;
XRRCrtcInfo *crtc_info;
@@ -186,8 +190,8 @@ struct _output {
XRROutputInfo *output_info;
XRUName crtc;
- crtc_t *crtc_info;
- crtc_t *current_crtc_info;
+ XRUCrtc *crtc_info;
+ XRUCrtc *current_crtc_info;
XRUName mode;
double refresh;
@@ -224,13 +228,15 @@ typedef enum {
umode_create, umode_destroy, umode_add, umode_delete
} XRUUmodeAction;
+typedef struct _umode XRUUmode;
+
struct _umode {
struct _umode *next;
- umode_action_t action;
+ XRUUmodeAction action;
XRRModeInfo mode;
XRUName output;
XRUName name;
-} XRUUmode;
+};
#endif /* _XRANDR_UTILS_H_ */
diff --git a/src/Makefile.am b/src/Makefile.am
index a11f772..ebfb932 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -2,7 +2,9 @@ lib_LTLIBRARIES = libXrandrUtils.la
libXrandrUtils_la_SOURCES = \
geometry.c \
- names.c
+ names.c \
+ output.c \
+ transform.c
libXrandrUtils_la_LIBADD = @RANDR_UTILS_LIBS@
diff --git a/test/names.c b/test/names.c
index c757cf7..7d7f389 100644
--- a/test/names.c
+++ b/test/names.c
@@ -25,6 +25,7 @@
* Verify the name structures and APIs
*/
+#include <string.h>
#include <assert.h>
#include "XrandrUtils.h"
@@ -34,13 +35,11 @@
*/
static void names_kind(void)
{
- XRUNameKind k;
-
assert(name_none == 0);
assert(name_string == 1);
assert(name_xid == 2);
assert(name_index == 4);
- assert(name_preferred == 16);
+ assert(name_preferred == 8);
}
/**
@@ -63,7 +62,7 @@ static void names_set_string(void)
XRUInitName(&n); // TODO: What if it's not init'd?
XRUSetNameString(&n, str);
- assert(n.kind == name_xid);
+ assert(n.kind == name_string);
assert(n.string != NULL);
assert(strncmp(n.string, str, 6) == 0);
}
@@ -116,7 +115,7 @@ static void names_set_sequential(void)
assert(strncmp(n.string, str, 5) == 0);
assert(n.xid == xid);
assert(n.index == 4);
- assert(n.kind == name_xid|name_string|name_index|name_preferred);
+ assert(n.kind == (name_xid|name_string|name_index|name_preferred));
}
static void names_set_all(void)
@@ -138,7 +137,7 @@ static void names_set_all(void)
assert(strncmp(n.string, str, 5) == 0);
assert(n.xid == xid);
assert(n.index == 4);
- assert(n.kind == name_xid|name_string|name_index|name_preferred);
+ assert(n.kind == (name_xid|name_string|name_index|name_preferred));
}
static void names_equal(void)
@@ -157,7 +156,7 @@ static void names_equal(void)
XRUInitName(&n);
XRUSetNameAll(&n, &o);
- assert(XRUNameEqual(n, o));
+ assert(XRUNameEqual(&n, &o));
}
static void names_not_equal(void)
@@ -165,33 +164,32 @@ static void names_not_equal(void)
XRUName n;
XRUName o;
XID xid = 9;
- char str[] = "equal";
XRUInitName(&o);
XRUSetNameXid(&o, xid);
- XRUSetNameString(&o, str);
+ XRUSetNameString(&o, "first");
XRUSetNameIndex(&o, 8);
XRUSetNamePreferred(&o);
XRUInitName(&n);
- XRUSetNameXid(&n, xid);
+ XRUSetNameString(&n, "second");
XRUSetNameIndex(&n, 10);
- assert(! XRUNameEqual(n, o));
+ assert(! XRUNameEqual(&n, &o));
}
-void names_equal_xid(void)
+static void names_equal_xid(void)
{
XRUName n;
- XID xid = 11
+ XID xid = 11;
XRUInitName(&n);
XRUSetNameXid(&n, xid);
- assert(XRUNameEqualXid (n, 11));
+ assert(XRUNameEqualXid (&n, 11));
}
-void names_equal_string(void)
+static void names_equal_string(void)
{
XRUName n;
char str[] = "equal string";
@@ -199,7 +197,7 @@ void names_equal_string(void)
XRUInitName(&n);
XRUSetNameString(&n, str);
- assert(XRUNameEqualString (n, "equal string"));
+ assert(XRUNameEqualString (&n, "equal string"));
}
int main(int argc, char** argv)