Rename matrix.h to libweston/matrix.h
authorPekka Paalanen <pekka.paalanen@collabora.com>
Thu, 4 Apr 2019 10:47:40 +0000 (13:47 +0300)
committerPekka Paalanen <pekka.paalanen@collabora.com>
Thu, 18 Apr 2019 09:31:46 +0000 (12:31 +0300)
matrix.h is a public installed header and even used by libweston.h.

See "Rename compositor.h to libweston/libweston.h" for rationale.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
clients/calibrator.c
clients/touch-calibrator.c
include/libweston/libweston.h
include/libweston/matrix.h [new file with mode: 0644]
include/libweston/meson.build
libweston/meson.build
shared/matrix.c
shared/matrix.h [deleted file]
shared/meson.build
tests/matrix-test.c
tests/meson.build

index 778c23cfaec526ea880f16522ca820d8bc38871d..2439fc94ca38954c1f826fe60d3aec013960563f 100644 (file)
@@ -38,7 +38,7 @@
 
 #include "window.h"
 #include "shared/helpers.h"
-#include "shared/matrix.h"
+#include <libweston/matrix.h>
 
 /* Our points for the calibration must be not be on a line */
 static const struct {
@@ -286,7 +286,7 @@ main(int argc, char *argv[])
                        break;
                }
        }
-       
+
        display = display_create(&argc, argv);
 
        if (display == NULL) {
index 3c7e6ece604f43675cb3dda4a9f4d55f430aebab..96f8c5a56dfaabbf36c21eb844cb80be7acdf357 100644 (file)
@@ -40,7 +40,7 @@
 
 #include "clients/window.h"
 #include "shared/helpers.h"
-#include "shared/matrix.h"
+#include <libweston/matrix.h>
 
 #include "weston-touch-calibration-client-protocol.h"
 
index 16ad495ba285b1a574da5929c308456e491d9d3f..e4ebc71d04dc62503b8033e6971fa7eb1b3fafe6 100644 (file)
@@ -41,7 +41,7 @@ extern "C" {
 #define WL_HIDE_DEPRECATED
 #include <wayland-server.h>
 
-#include "matrix.h"
+#include <libweston/matrix.h>
 #include "config-parser.h"
 #include "zalloc.h"
 #include <libweston/timeline-object.h>
diff --git a/include/libweston/matrix.h b/include/libweston/matrix.h
new file mode 100644 (file)
index 0000000..be4d4eb
--- /dev/null
@@ -0,0 +1,85 @@
+/*
+ * Copyright © 2008-2011 Kristian Høgsberg
+ * Copyright © 2012 Collabora, Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#ifndef WESTON_MATRIX_H
+#define WESTON_MATRIX_H
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+enum weston_matrix_transform_type {
+       WESTON_MATRIX_TRANSFORM_TRANSLATE       = (1 << 0),
+       WESTON_MATRIX_TRANSFORM_SCALE           = (1 << 1),
+       WESTON_MATRIX_TRANSFORM_ROTATE          = (1 << 2),
+       WESTON_MATRIX_TRANSFORM_OTHER           = (1 << 3),
+};
+
+struct weston_matrix {
+       float d[16];
+       unsigned int type;
+};
+
+struct weston_vector {
+       float f[4];
+};
+
+void
+weston_matrix_init(struct weston_matrix *matrix);
+void
+weston_matrix_multiply(struct weston_matrix *m, const struct weston_matrix *n);
+void
+weston_matrix_scale(struct weston_matrix *matrix, float x, float y, float z);
+void
+weston_matrix_translate(struct weston_matrix *matrix,
+                       float x, float y, float z);
+void
+weston_matrix_rotate_xy(struct weston_matrix *matrix, float cos, float sin);
+void
+weston_matrix_transform(struct weston_matrix *matrix, struct weston_vector *v);
+
+int
+weston_matrix_invert(struct weston_matrix *inverse,
+                    const struct weston_matrix *matrix);
+
+#ifdef UNIT_TEST
+#  define MATRIX_TEST_EXPORT WL_EXPORT
+
+int
+matrix_invert(double *A, unsigned *p, const struct weston_matrix *matrix);
+
+void
+inverse_transform(const double *LU, const unsigned *p, float *v);
+
+#else
+#  define MATRIX_TEST_EXPORT static
+#endif
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif /* WESTON_MATRIX_H */
index f6b55febad221cd5071e9d8fbbf70e0a43a7a435..e631e1d13141a162c908e0ad654a90a28926de99 100644 (file)
@@ -1,5 +1,6 @@
 install_headers(
        'libweston.h',
+       'matrix.h',
        'plugin-registry.h',
        'timeline-object.h',
        'windowed-output-api.h',
index 31ad923fd43fadcaeee5d4b0cd1792baad8c4bb6..de6c9397575befc3de73c33483a1b2fb1cc2e5bf 100644 (file)
@@ -58,7 +58,6 @@ srcs_libweston = [
 
 install_headers(
        '../shared/config-parser.h',
-       '../shared/matrix.h',
        '../shared/zalloc.h',
        subdir: dir_include_libweston
 )
index 605db83c9026eaf83c012ac080562dc22a87d74e..4e8d6b40b63e4e9ae8efc86d00344db1e386e14f 100644 (file)
@@ -37,7 +37,7 @@
 #include <wayland-server.h>
 #endif
 
-#include "matrix.h"
+#include <libweston/matrix.h>
 
 
 /*
diff --git a/shared/matrix.h b/shared/matrix.h
deleted file mode 100644 (file)
index be4d4eb..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright © 2008-2011 Kristian Høgsberg
- * Copyright © 2012 Collabora, Ltd.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial
- * portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#ifndef WESTON_MATRIX_H
-#define WESTON_MATRIX_H
-
-#ifdef  __cplusplus
-extern "C" {
-#endif
-
-enum weston_matrix_transform_type {
-       WESTON_MATRIX_TRANSFORM_TRANSLATE       = (1 << 0),
-       WESTON_MATRIX_TRANSFORM_SCALE           = (1 << 1),
-       WESTON_MATRIX_TRANSFORM_ROTATE          = (1 << 2),
-       WESTON_MATRIX_TRANSFORM_OTHER           = (1 << 3),
-};
-
-struct weston_matrix {
-       float d[16];
-       unsigned int type;
-};
-
-struct weston_vector {
-       float f[4];
-};
-
-void
-weston_matrix_init(struct weston_matrix *matrix);
-void
-weston_matrix_multiply(struct weston_matrix *m, const struct weston_matrix *n);
-void
-weston_matrix_scale(struct weston_matrix *matrix, float x, float y, float z);
-void
-weston_matrix_translate(struct weston_matrix *matrix,
-                       float x, float y, float z);
-void
-weston_matrix_rotate_xy(struct weston_matrix *matrix, float cos, float sin);
-void
-weston_matrix_transform(struct weston_matrix *matrix, struct weston_vector *v);
-
-int
-weston_matrix_invert(struct weston_matrix *inverse,
-                    const struct weston_matrix *matrix);
-
-#ifdef UNIT_TEST
-#  define MATRIX_TEST_EXPORT WL_EXPORT
-
-int
-matrix_invert(double *A, unsigned *p, const struct weston_matrix *matrix);
-
-void
-inverse_transform(const double *LU, const unsigned *p, float *v);
-
-#else
-#  define MATRIX_TEST_EXPORT static
-#endif
-
-#ifdef  __cplusplus
-}
-#endif
-
-#endif /* WESTON_MATRIX_H */
index 5b0d8d1300befd6b3ddfb6e8591bb2d8c837e02c..c3fd932aeeef173cc76a7bdd67f574d7c7c26ebf 100644 (file)
@@ -17,6 +17,7 @@ lib_libshared = static_library(
 )
 dep_libshared = declare_dependency(
        link_with: lib_libshared,
+       include_directories: public_inc,
        dependencies: deps_libshared
 )
 
index 520e12eb1c98154b381130bca2aa89c93d416536..03b92162bfcd925939306110a07c8bb1201d95f1 100644 (file)
@@ -32,7 +32,7 @@
 #include <signal.h>
 #include <time.h>
 
-#include "shared/matrix.h"
+#include <libweston/matrix.h>
 
 struct inverse_matrix {
        double LU[16];          /* column-major */
index 03692f4777810407132ee68bf44578da7bf2851e..5274d8dd3da06caea92e4b7666b12361bfcf5829 100644 (file)
@@ -97,7 +97,7 @@ dep_zucmain = declare_dependency(
 
 tests_standalone = [
        ['config-parser', [], [ dep_zucmain ]],
-       ['matrix', [ '../shared/matrix.c' ], [ dep_libm ]],
+       ['matrix', [ '../shared/matrix.c' ], [ dep_libm, dep_libshared.partial_dependency(includes: true) ]],
        ['string'],
        [
                'vertex-clip',