From 942365e0a1a0e689695f7d240fd12c318a9d0bcc Mon Sep 17 00:00:00 2001 From: ksamak Date: Mon, 2 May 2016 13:20:34 +0200 Subject: [PATCH 01/53] stretch release --- debian/changelog | 6 ------ 1 file changed, 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index d57d66f04..5a72290d7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,3 @@ -compiz (2:0.9.12.2-hyp7.2) UNRELEASED; urgency=medium - - * XPrimental - - -- ksamak Mon, 25 Apr 2016 11:03:43 +0200 - compiz (2:0.9.12.2-hyp7.1) stretch; urgency=medium * stretch release -- GitLab From 8e8daf26c4890f1c3471479469059509ad43eae9 Mon Sep 17 00:00:00 2001 From: ksamak Date: Mon, 2 May 2016 13:22:21 +0200 Subject: [PATCH 02/53] stretch release 2 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 5a72290d7..91faea56d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,6 @@ -compiz (2:0.9.12.2-hyp7.1) stretch; urgency=medium +compiz (2:0.9.12.2-hyp7.1.2) stretch; urgency=medium - * stretch release + * stretch release 2 -- ksamak Mon, 25 Apr 2016 11:00:55 +0200 -- GitLab From 4c5e0ab9ab9e535ecc112fd55b5be1d67c1067f1 Mon Sep 17 00:00:00 2001 From: ksamak Date: Mon, 30 May 2016 13:34:20 +0200 Subject: [PATCH 03/53] bump changelog - stretch release --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index 91faea56d..b80632b56 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +compiz (2:0.9.12.2-hyp7.1.2-2) stretch; urgency=medium + + * stretch release 4 + * fixes hypra(#319) + + -- ksamak Mon, 30 May 2016 13:31:32 +0200 + compiz (2:0.9.12.2-hyp7.1.2) stretch; urgency=medium * stretch release 2 -- GitLab From 683b157f3b0d6a4fac10f7e58848a52898ff41cc Mon Sep 17 00:00:00 2001 From: ksamak Date: Mon, 30 May 2016 16:33:35 +0200 Subject: [PATCH 04/53] bump changelog stretch release --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index b80632b56..03c85fea1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +compiz (2:0.9.12.2-hyp7.1.2-3) stretch; urgency=medium + + * added comix cursors + + -- ksamak Mon, 30 May 2016 16:33:14 +0200 + compiz (2:0.9.12.2-hyp7.1.2-2) stretch; urgency=medium * stretch release 4 -- GitLab From 45a71971f3a2ff4b6a780d28c5b1fafdaa47884b Mon Sep 17 00:00:00 2001 From: ksamak Date: Tue, 31 May 2016 22:39:09 +0200 Subject: [PATCH 05/53] bump changelog stretch release --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 03c85fea1..97c3ccac3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +compiz (2:0.9.12.2-hyp7.1.2-4) stretch; urgency=medium + + * added switch to remove smooth panning + + -- ksamak Tue, 31 May 2016 22:38:40 +0200 + compiz (2:0.9.12.2-hyp7.1.2-3) stretch; urgency=medium * added comix cursors -- GitLab From a8d4c4f8aa981a46554cda5b455f707bc2dd2545 Mon Sep 17 00:00:00 2001 From: ksamak Date: Thu, 16 Jun 2016 10:34:02 +0200 Subject: [PATCH 06/53] stretch release --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 97c3ccac3..95e9a90be 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +compiz (2:0.9.12.2-hyp7.1.2-5) stretch; urgency=medium + + * added filter for Focus events + + -- ksamak Thu, 16 Jun 2016 10:33:43 +0200 + compiz (2:0.9.12.2-hyp7.1.2-4) stretch; urgency=medium * added switch to remove smooth panning -- GitLab From 8bbbafc76a81b1ae1b565cc0de619a173edc6683 Mon Sep 17 00:00:00 2001 From: ksamak Date: Sat, 25 Jun 2016 13:46:30 +0200 Subject: [PATCH 07/53] bump changelog stretch release --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 95e9a90be..f29900dce 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +compiz (2:0.9.12.2-hyp7.1.2-6) UNRELEASED; urgency=medium + + * changed backend for a11y watching (fixes #319 #335 #306 #313 #315 #322 #317) + + -- ksamak Sat, 25 Jun 2016 13:44:33 +0200 + compiz (2:0.9.12.2-hyp7.1.2-5) stretch; urgency=medium * added filter for Focus events -- GitLab From 98d60075f2f8f3d31bf63b7f7d8857a4a6e19ebe Mon Sep 17 00:00:00 2001 From: ksamak Date: Mon, 27 Jun 2016 11:51:00 +0200 Subject: [PATCH 08/53] code cleanup --- plugins/ezoom/src/ezoom.cpp | 14 +------------- plugins/ezoom/src/ezoom.h | 3 --- plugins/mousepoll/src/accessibilitywatcher.cpp | 6 ------ 3 files changed, 1 insertion(+), 22 deletions(-) diff --git a/plugins/ezoom/src/ezoom.cpp b/plugins/ezoom/src/ezoom.cpp index e71c47bce..50b0a91da 100644 --- a/plugins/ezoom/src/ezoom.cpp +++ b/plugins/ezoom/src/ezoom.cpp @@ -1144,7 +1144,7 @@ void EZoomScreen::updateMousePosition(const CompPoint &p) { int focusX, focusY, focusW, focusH; std::tie(focusX, focusY, focusW, focusH) = last_focus_position.getBBox(); int out = screen->outputDeviceForPoint(last_focus_position.x, last_focus_position.y); - if (time(NULL) - lastMouseChange > optionGetFollowFocusDelay() && isLastEventLegitimate()) { + if (time(NULL) - lastMouseChange > optionGetFollowFocusDelay()) { int zoom_area_width = screen->outputDevs().at(out).width() * zooms.at(out).currentZoom; int zoom_area_height = screen->outputDevs().at(out).height() * zooms.at(out).currentZoom; int pos_x = focusX + focusW / 2; @@ -1165,18 +1165,6 @@ void EZoomScreen::updateMousePosition(const CompPoint &p) { cScreen->damageScreen(); } -/* - * This is a filter function, to avoid some bumps and twitches in events - */ -bool EZoomScreen::isLastEventLegitimate() { - auto last_focus_position = _focus_position_history.back(); - auto main_widget = FocusInfo(); - auto previous_main_widget = FocusInfo(); - - // add the next filters here - return true; -} - /* Timeout handler to poll the mouse. Returns false (and thereby does not * get re-added to the queue) when zoom is not active. */ void diff --git a/plugins/ezoom/src/ezoom.h b/plugins/ezoom/src/ezoom.h index 4b9db5388..7ee1930fb 100644 --- a/plugins/ezoom/src/ezoom.h +++ b/plugins/ezoom/src/ezoom.h @@ -288,9 +288,6 @@ class EZoomScreen : void updateMousePosition (const CompPoint &p); - bool - isLastEventLegitimate(); - void updateMouseInterval (const CompPoint &p); diff --git a/plugins/mousepoll/src/accessibilitywatcher.cpp b/plugins/mousepoll/src/accessibilitywatcher.cpp index 9a74e604d..fa922a0e2 100644 --- a/plugins/mousepoll/src/accessibilitywatcher.cpp +++ b/plugins/mousepoll/src/accessibilitywatcher.cpp @@ -133,7 +133,6 @@ void AccessibilityWatcher::register_event(const AtspiEvent *event, std::string t res.focusable = true; break; case ATSPI_STATE_FOCUSED: - std::cout << "FOCUSED" << std::endl; res.focused = true; break; case ATSPI_STATE_SHOWING: @@ -147,8 +146,6 @@ void AccessibilityWatcher::register_event(const AtspiEvent *event, std::string t } } - - if (filter_bad_events(res)) { return; } @@ -223,9 +220,6 @@ void AccessibilityWatcher::quit() { _initialized = false; } -void AccessibilityWatcher::check_and_process_queue() { -} - std::deque AccessibilityWatcher::get_focus_queue() { return _focus_list; } -- GitLab From 0e4947d9a1110dd999610ce5a7a894067e841c1a Mon Sep 17 00:00:00 2001 From: ksamak Date: Wed, 6 Jul 2016 13:04:19 +0200 Subject: [PATCH 09/53] bump stretch changelog --- debian/changelog | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index f29900dce..1ef22c3fc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,14 @@ -compiz (2:0.9.12.2-hyp7.1.2-6) UNRELEASED; urgency=medium +compiz (2:0.9.12.2-hyp7.2.2-1) stretch; urgency=medium + + * stretch release + + -- ksamak Wed, 06 Jul 2016 13:03:39 +0200 + +compiz (2:0.9.12.2-hyp7.1.2-6) stretch; urgency=medium * changed backend for a11y watching (fixes #319 #335 #306 #313 #315 #322 #317) - -- ksamak Sat, 25 Jun 2016 13:44:33 +0200 + -- ksamak Wed, 06 Jul 2016 13:02:55 +0200 compiz (2:0.9.12.2-hyp7.1.2-5) stretch; urgency=medium -- GitLab From a22fe67279a4aa558695eaa41bef27f0847ba1dc Mon Sep 17 00:00:00 2001 From: ksamak Date: Sat, 9 Jul 2016 22:44:18 +0200 Subject: [PATCH 10/53] stretch release 2:0.9.12.2-hyp7.2.2-2 --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 046e0403c..501c734e0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +compiz (2:0.9.12.2-hyp7.2.2-2) UNRELEASED; urgency=medium + + * stretch release + + -- ksamak Sat, 09 Jul 2016 22:43:45 +0200 + compiz (2:0.9.12.2-hyp7.2.2-1) stretch; urgency=medium * stretch release -- GitLab From 664c8595d93daec3b21fbe05d8820652cb41604d Mon Sep 17 00:00:00 2001 From: ksamak Date: Thu, 28 Jul 2016 11:47:41 +0200 Subject: [PATCH 11/53] bump changelog --- debian/changelog | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 501c734e0..5cb3355ef 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,14 @@ -compiz (2:0.9.12.2-hyp7.2.2-2) UNRELEASED; urgency=medium +compiz (2:0.9.12.2-hyp7.2.2-3) stretch; urgency=medium * stretch release - -- ksamak Sat, 09 Jul 2016 22:43:45 +0200 + -- ksamak Thu, 28 Jul 2016 11:47:11 +0200 + +compiz (2:0.9.12.2-hyp7.2.2-2) stretch; urgency=medium + + * stretch release + + -- ksamak Thu, 28 Jul 2016 11:46:51 +0200 compiz (2:0.9.12.2-hyp7.2.2-1) stretch; urgency=medium -- GitLab From 519270763ea5afc8afcebae4d96aead1a71c91df Mon Sep 17 00:00:00 2001 From: ksamak Date: Wed, 3 Aug 2016 15:35:07 +0200 Subject: [PATCH 12/53] bump stretch changelog --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 5cb3355ef..a6462f8ce 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +compiz (2:0.9.12.2-hyp7.2.2-4) stretch; urgency=medium + + * stretch release + + -- ksamak Wed, 03 Aug 2016 15:33:47 +0200 + compiz (2:0.9.12.2-hyp7.2.2-3) stretch; urgency=medium * stretch release -- GitLab From f4e875852a669e7bc00f1ce28a3f2afb2059bc5f Mon Sep 17 00:00:00 2001 From: ksamak Date: Tue, 4 Oct 2016 10:53:05 +0200 Subject: [PATCH 13/53] bump changelog --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index a6462f8ce..3d6bc9414 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +compiz (2:0.9.12.2-hyp7.2.2-5) stretch; urgency=medium + + * stretch release + + -- ksamak Tue, 04 Oct 2016 10:52:42 +0200 + compiz (2:0.9.12.2-hyp7.2.2-4) stretch; urgency=medium * stretch release -- GitLab From fc9502b83ce5fe307dab317f191882d6d5997c6b Mon Sep 17 00:00:00 2001 From: ksamak Date: Wed, 5 Oct 2016 17:25:24 +0200 Subject: [PATCH 14/53] bump changelog --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 3d6bc9414..50d50045a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +compiz (2:0.9.12.2-hyp7.2.2-6) stretch; urgency=medium + + * stretch release + + -- ksamak Wed, 05 Oct 2016 17:19:03 +0200 + compiz (2:0.9.12.2-hyp7.2.2-5) stretch; urgency=medium * stretch release -- GitLab From 6519f9f800dadf598d0a657f10c959c613e2131f Mon Sep 17 00:00:00 2001 From: ksamak Date: Fri, 7 Oct 2016 15:32:02 +0200 Subject: [PATCH 15/53] bumped changelog --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 50d50045a..3059a1375 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +compiz (2:0.9.12.2-hyp7.2.2-7) stretch; urgency=medium + + * stretch release + + -- ksamak Fri, 07 Oct 2016 15:29:59 +0200 + compiz (2:0.9.12.2-hyp7.2.2-6) stretch; urgency=medium * stretch release -- GitLab From c3b5649df55950b1dfe257d39f044f8b39bc9e6d Mon Sep 17 00:00:00 2001 From: ksamak Date: Fri, 14 Oct 2016 14:42:41 +0200 Subject: [PATCH 16/53] bump changelog --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 3059a1375..458089910 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +compiz (2:0.9.12.2-hyp7.2.2-8) stretch; urgency=medium + + * stretch release + + -- ksamak Fri, 14 Oct 2016 14:41:57 +0200 + compiz (2:0.9.12.2-hyp7.2.2-7) stretch; urgency=medium * stretch release -- GitLab From a418d9a8bda6344690e828807576efabd4308f35 Mon Sep 17 00:00:00 2001 From: ksamak Date: Sat, 15 Oct 2016 16:42:24 +0200 Subject: [PATCH 17/53] bumped changelog --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 458089910..f9e565343 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +compiz (2:0.9.12.2-hyp7.2.2-9) stretch; urgency=medium + + * stretch release + + -- ksamak Sat, 15 Oct 2016 16:42:12 +0200 + compiz (2:0.9.12.2-hyp7.2.2-8) stretch; urgency=medium * stretch release -- GitLab From 1c410e7d4b842b80749817693fb99b6249e087ea Mon Sep 17 00:00:00 2001 From: ksamak Date: Tue, 18 Oct 2016 19:56:13 +0200 Subject: [PATCH 18/53] bumped changelog --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index f9e565343..07010fabf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +compiz (2:0.9.12.2-hyp7.2.2-10) stretch; urgency=medium + + * stretch release + + -- ksamak Tue, 18 Oct 2016 19:56:03 +0200 + compiz (2:0.9.12.2-hyp7.2.2-9) stretch; urgency=medium * stretch release -- GitLab From 363d535ce9463e8874a4b27a9131277f7aaa5a03 Mon Sep 17 00:00:00 2001 From: ksamak Date: Mon, 24 Oct 2016 13:06:55 +0200 Subject: [PATCH 19/53] bumped changelog --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 07010fabf..5f43c058a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +compiz (2:0.9.12.2-hyp7.2.2-11) stretch; urgency=medium + + * stretch release + + -- ksamak Mon, 24 Oct 2016 13:05:43 +0200 + compiz (2:0.9.12.2-hyp7.2.2-10) stretch; urgency=medium * stretch release -- GitLab From a0a785b31f6af3472c3cf91f3a59518351542b44 Mon Sep 17 00:00:00 2001 From: ksamak Date: Fri, 28 Oct 2016 11:16:40 +0200 Subject: [PATCH 20/53] bump changelog --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 5f43c058a..f88bc7d66 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +compiz (2:0.9.12.2-hyp7.2.2-12) stretch; urgency=medium + + * stretch release + + -- ksamak Fri, 28 Oct 2016 11:16:34 +0200 + compiz (2:0.9.12.2-hyp7.2.2-11) stretch; urgency=medium * stretch release -- GitLab From cb698f3bf77bee4e466b5a7770609bd89c0a649c Mon Sep 17 00:00:00 2001 From: ksamak Date: Tue, 1 Nov 2016 10:45:36 +0100 Subject: [PATCH 21/53] bump changelog --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index f88bc7d66..4cb56946c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +compiz (2:0.9.12.2-hyp7.2.2-13) stretch; urgency=medium + + * stretch release + + -- ksamak Tue, 01 Nov 2016 10:45:33 +0100 + compiz (2:0.9.12.2-hyp7.2.2-12) stretch; urgency=medium * stretch release -- GitLab From fa674508126272e8398f5222651254a9af598eeb Mon Sep 17 00:00:00 2001 From: ksamak Date: Fri, 4 Nov 2016 12:41:38 +0100 Subject: [PATCH 22/53] bump changelog --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 4cb56946c..fb23b571b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +compiz (2:0.9.12.2-hyp7.2.2-14) stretch; urgency=medium + + * stretch release + + -- ksamak Fri, 04 Nov 2016 12:41:35 +0100 + compiz (2:0.9.12.2-hyp7.2.2-13) stretch; urgency=medium * stretch release -- GitLab From 0e5f486dd566a3532c34478c6fbabe8c6e013203 Mon Sep 17 00:00:00 2001 From: ksamak Date: Fri, 18 Nov 2016 10:31:21 +0100 Subject: [PATCH 23/53] bump changelog --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index fb23b571b..14425abc1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +compiz (2:0.9.12.2-hyp7.2.2-15) stretch; urgency=medium + + * stretch release + + -- ksamak Fri, 18 Nov 2016 10:31:14 +0100 + compiz (2:0.9.12.2-hyp7.2.2-14) stretch; urgency=medium * stretch release -- GitLab From be5a1302d37e937d59cf2cefbd13133f4a924bd6 Mon Sep 17 00:00:00 2001 From: ksamak Date: Wed, 23 Nov 2016 18:32:40 +0100 Subject: [PATCH 24/53] bump changelog --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 14425abc1..0af151276 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +compiz (2:0.9.12.2-hyp7.2.2-16) stretch; urgency=medium + + * stretch release + + -- ksamak Wed, 23 Nov 2016 18:32:35 +0100 + compiz (2:0.9.12.2-hyp7.2.2-15) stretch; urgency=medium * stretch release -- GitLab From 334c1ea15e19718aa3c972bb2add11a862147b0f Mon Sep 17 00:00:00 2001 From: ksamak Date: Fri, 25 Nov 2016 10:36:29 +0100 Subject: [PATCH 25/53] bump changelog --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 0af151276..63cc3fcb6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +compiz (2:0.9.12.2-hyp7.2.2-17) stretch; urgency=medium + + * stretch release + + -- ksamak Fri, 25 Nov 2016 10:36:25 +0100 + compiz (2:0.9.12.2-hyp7.2.2-16) stretch; urgency=medium * stretch release -- GitLab From 9c3965e78affc6bc3ae0aa517b969bad2597fe61 Mon Sep 17 00:00:00 2001 From: ksamak Date: Fri, 25 Nov 2016 15:25:03 +0100 Subject: [PATCH 26/53] bump changelog --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 63cc3fcb6..fb21caed0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +compiz (2:0.9.12.2-hyp7.2.2-18) stretch; urgency=medium + + * stretch release + + -- ksamak Fri, 25 Nov 2016 15:24:57 +0100 + compiz (2:0.9.12.2-hyp7.2.2-17) stretch; urgency=medium * stretch release -- GitLab From 90818e0e322e0e5c013a7f9c9a0b7aded53285ae Mon Sep 17 00:00:00 2001 From: ksamak Date: Tue, 6 Dec 2016 13:47:22 +0100 Subject: [PATCH 27/53] bump changelog --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index fb21caed0..e3c7a88d4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +compiz (2:0.9.12.2-hyp7.2.2-19) stretch; urgency=medium + + * stretch release + + -- ksamak Tue, 06 Dec 2016 13:47:18 +0100 + compiz (2:0.9.12.2-hyp7.2.2-18) stretch; urgency=medium * stretch release -- GitLab From 9aee89a4e13010edd1e534a23dd1a9e272cd0d10 Mon Sep 17 00:00:00 2001 From: ksamak Date: Tue, 6 Dec 2016 15:41:27 +0100 Subject: [PATCH 28/53] bump changelog --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index e3c7a88d4..40b11d16f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +compiz (2:0.9.12.2-hyp7.2.2-20) stretch; urgency=medium + + * stretch release + + -- ksamak Tue, 06 Dec 2016 15:41:25 +0100 + compiz (2:0.9.12.2-hyp7.2.2-19) stretch; urgency=medium * stretch release -- GitLab From 47b98117dfa61702ea220c15263d6bc2c82804c9 Mon Sep 17 00:00:00 2001 From: ksamak Date: Thu, 8 Dec 2016 13:10:22 +0100 Subject: [PATCH 29/53] bump changelog --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 40b11d16f..aa2f949eb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +compiz (2:0.9.12.2-hyp7.2.2-21) stretch; urgency=medium + + * stretch release + + -- ksamak Thu, 08 Dec 2016 13:10:12 +0100 + compiz (2:0.9.12.2-hyp7.2.2-20) stretch; urgency=medium * stretch release -- GitLab From 3b01325890f6ab03046b532a1a043a0bbcf58078 Mon Sep 17 00:00:00 2001 From: ksamak Date: Thu, 22 Dec 2016 08:38:31 +0100 Subject: [PATCH 30/53] bump changelog --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index aa2f949eb..0d5c1edfa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +compiz (2:0.9.12.2-hyp7.2.2-22) stretch; urgency=medium + + * stretch release + + -- ksamak Thu, 22 Dec 2016 08:38:27 +0100 + compiz (2:0.9.12.2-hyp7.2.2-21) stretch; urgency=medium * stretch release -- GitLab From 049ede1394ffa8e2a8433c62c105a097dcfa3e99 Mon Sep 17 00:00:00 2001 From: ksamak Date: Thu, 22 Dec 2016 08:55:47 +0100 Subject: [PATCH 31/53] bump changelog --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 0d5c1edfa..c937992af 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +compiz (2:0.9.12.2-hyp7.2.2-23) stretch; urgency=medium + + * stretch release + + -- ksamak Thu, 22 Dec 2016 08:55:42 +0100 + compiz (2:0.9.12.2-hyp7.2.2-22) stretch; urgency=medium * stretch release -- GitLab From fab66213aa67a7f78da3f80672af888cb8f0648b Mon Sep 17 00:00:00 2001 From: ksamak Date: Fri, 23 Dec 2016 09:00:43 +0100 Subject: [PATCH 32/53] bump changelog --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index c937992af..79feb37c2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +compiz (2:0.9.12.2-hyp7.2.2-24) stretch; urgency=medium + + * stretch release + + -- ksamak Fri, 23 Dec 2016 09:00:39 +0100 + compiz (2:0.9.12.2-hyp7.2.2-23) stretch; urgency=medium * stretch release -- GitLab From d2eee175fb413e6603dc74126f3b3e89037ef0d9 Mon Sep 17 00:00:00 2001 From: ksamak Date: Fri, 23 Dec 2016 14:39:10 +0100 Subject: [PATCH 33/53] bump changelog --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 79feb37c2..a2c01f65b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +compiz (2:0.9.12.2-hyp7.2.2-25) stretch; urgency=medium + + * stretch release + + -- ksamak Fri, 23 Dec 2016 14:39:07 +0100 + compiz (2:0.9.12.2-hyp7.2.2-24) stretch; urgency=medium * stretch release -- GitLab From ae4169d4f712ca9193440352bfcdeccd675a672d Mon Sep 17 00:00:00 2001 From: ksamak Date: Fri, 23 Dec 2016 17:14:48 +0100 Subject: [PATCH 34/53] bump changelog --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index a2c01f65b..b8041a9ff 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +compiz (2:0.9.12.2-hyp7.2.2-26) stretch; urgency=medium + + * stretch release + + -- ksamak Fri, 23 Dec 2016 17:14:46 +0100 + compiz (2:0.9.12.2-hyp7.2.2-25) stretch; urgency=medium * stretch release -- GitLab From 98ddae5dedfe59ce484c5875487bcf5709d13ff5 Mon Sep 17 00:00:00 2001 From: ksamak Date: Fri, 23 Dec 2016 17:52:10 +0100 Subject: [PATCH 35/53] bump changelog --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index b8041a9ff..776d823ed 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +compiz (2:0.9.12.2-hyp7.2.2-27) stretch; urgency=medium + + * stretch release + + -- ksamak Fri, 23 Dec 2016 17:52:07 +0100 + compiz (2:0.9.12.2-hyp7.2.2-26) stretch; urgency=medium * stretch release -- GitLab From 5223a9163a68f541c039fe1ffc44c9e23fc5dc11 Mon Sep 17 00:00:00 2001 From: ksamak Date: Sat, 24 Dec 2016 15:32:19 +0100 Subject: [PATCH 36/53] bump changelog --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 776d823ed..674dbea83 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +compiz (2:0.9.12.2-hyp7.2.2-28) stretch; urgency=medium + + * stretch release + + -- ksamak Sat, 24 Dec 2016 15:32:16 +0100 + compiz (2:0.9.12.2-hyp7.2.2-27) stretch; urgency=medium * stretch release -- GitLab From 876e067013b3a3a120b3f1b896e9d927421c7c56 Mon Sep 17 00:00:00 2001 From: ksamak Date: Wed, 28 Dec 2016 12:28:43 +0100 Subject: [PATCH 37/53] bump changelog --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 674dbea83..d60b09ad6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +compiz (2:0.9.12.2-hyp7.2.2-29) stretch; urgency=medium + + * stretch release + + -- ksamak Wed, 28 Dec 2016 12:28:29 +0100 + compiz (2:0.9.12.2-hyp7.2.2-28) stretch; urgency=medium * stretch release -- GitLab From 4da989e27981d95323feb1205398e6badc0413ae Mon Sep 17 00:00:00 2001 From: ksamak Date: Thu, 5 Jan 2017 17:30:43 +0100 Subject: [PATCH 38/53] bump changelog --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index d60b09ad6..6cb7fe00f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +compiz (2:0.9.12.2-hyp7.2.2-30) stretch; urgency=medium + + * stretch release + + -- ksamak Thu, 05 Jan 2017 17:30:39 +0100 + compiz (2:0.9.12.2-hyp7.2.2-29) stretch; urgency=medium * stretch release -- GitLab From c47f82982f3ce7812ffcd28535cd4c20a7e1299e Mon Sep 17 00:00:00 2001 From: ksamak Date: Tue, 10 Jan 2017 11:41:24 +0100 Subject: [PATCH 39/53] bump changelog --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 6cb7fe00f..32cd398a2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +compiz (2:0.9.12.2-hyp7.2.2-31) stretch; urgency=medium + + * stretch release + + -- ksamak Tue, 10 Jan 2017 11:41:20 +0100 + compiz (2:0.9.12.2-hyp7.2.2-30) stretch; urgency=medium * stretch release -- GitLab From 0069a63f560555d8d502a870b4e66b90e0907ffc Mon Sep 17 00:00:00 2001 From: ksamak Date: Thu, 12 Jan 2017 13:14:45 +0100 Subject: [PATCH 40/53] bump changelog --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 32cd398a2..097556fc8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +compiz (2:0.9.12.2-hyp7.2.2-32) stretch; urgency=medium + + * stretch release + + -- ksamak Thu, 12 Jan 2017 13:14:37 +0100 + compiz (2:0.9.12.2-hyp7.2.2-31) stretch; urgency=medium * stretch release -- GitLab From 6a266d75d9fd5b0914afa8ec093f340dc035e299 Mon Sep 17 00:00:00 2001 From: ksamak Date: Mon, 16 Jan 2017 10:40:48 +0100 Subject: [PATCH 41/53] bump changelog --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index a15936447..5e9c2b4f9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +compiz (2:0.9.12.2-hyp7.3.2) UNRELEASED; urgency=medium + + * stretch release + + -- ksamak Mon, 16 Jan 2017 10:38:49 +0100 + compiz (2:0.9.12.2-hyp7.3) jessie; urgency=medium * switcher: added size multiplier option -- GitLab From 4238129a2f0fd2c67a677ae1153a9501fc1b65dc Mon Sep 17 00:00:00 2001 From: ksamak Date: Tue, 4 Apr 2017 10:49:02 +0200 Subject: [PATCH 42/53] cherry-picked relevant changes from showmouse_ezoom_synchronization --- plugins/showmouse/showmouse.xml.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/showmouse/showmouse.xml.in b/plugins/showmouse/showmouse.xml.in index 6c4efc3e0..32e0d83e0 100644 --- a/plugins/showmouse/showmouse.xml.in +++ b/plugins/showmouse/showmouse.xml.in @@ -11,6 +11,9 @@ cube decor + + ezoom + opengl mousepoll -- GitLab From 569a73f0b8c4faf2b9adb4e2a4cc7a451e723f95 Mon Sep 17 00:00:00 2001 From: ksamak Date: Wed, 8 Feb 2017 12:46:11 +0100 Subject: [PATCH 43/53] WIP first targetting done, second underway --- plugins/ezoom/src/ezoom.cpp | 64 +++++++++++++++++++++++++++++ plugins/ezoom/src/ezoom.h | 3 ++ plugins/showmouse/CMakeLists.txt | 3 +- plugins/showmouse/showmouse.xml.in | 2 + plugins/showmouse/src/showmouse.cpp | 5 ++- 5 files changed, 75 insertions(+), 2 deletions(-) diff --git a/plugins/ezoom/src/ezoom.cpp b/plugins/ezoom/src/ezoom.cpp index 1628bd925..499323942 100644 --- a/plugins/ezoom/src/ezoom.cpp +++ b/plugins/ezoom/src/ezoom.cpp @@ -314,6 +314,70 @@ EZoomScreen::adjustXYVelocity (int out, (zooms.at (out).yVelocity * chunk) / cScreen->redrawTime (); } +// correct showmouse's targeting according to mouse centering algorythm +CompPoint +EZoomScreen::getModifiedMousePosition (const CompPoint &p) +{ + int out = screen->outputDeviceForPoint (pointerX, pointerY); + CompOutput *o = &screen->outputDevs ().at (out); + + if (zooms.at (out).newZoom == 1.0f) { + return p; + } + if (optionGetAlwaysCenterMouse()) { + if (optionGetRestrainZoomToScreen()) { + int x_shift = o->width() / 2; + if (o->width() * (0.5f + zooms.at (out).xTranslate) == 0) { + x_shift = static_cast(p.x() / zooms.at (out).newZoom); + } else if (o->width() * (0.5f + zooms.at (out).xTranslate) == o->width() ) { + x_shift = static_cast(o->width() - (o->width() - p.x()) / zooms.at (out).newZoom); + } + int y_shift = o->height() / 2; + if (o->height() * (0.5f + zooms.at (out).yTranslate) == 0) { + y_shift = static_cast(p.y() / zooms.at (out).newZoom); + } else if (o->height() * (0.5f + zooms.at (out).yTranslate) == o->height() ) { + y_shift = static_cast(o->height() - (o->height() - p.y()) / zooms.at (out).newZoom); + } + return {x_shift, y_shift}; + } + return {o->width() / 2, o->height() / 2}; + } + + //float zoomCorrection = 1.0f - zooms.at(out).newZoom; // this correction allows constant centering of the mouse + + // legaly centering algorythm + int x_shift = p.x(); + int y_shift = p.y(); + + // coordinate system conversion + // one lead: + //float x_2 = static_cast(x_shift) / o->width() * (0.92f) + 0.5f; + //float y_2 = static_cast(y_shift) / o->height() * (0.92f) + 0.5f; + + // working ok, but for one variable to find + //float x_2 = static_cast(x_shift) * 1.08f / (o->width()) * 0.92f / zooms.at(out).newZoom +0.5f; + //float y_2 = static_cast(y_shift) * 1.08f / (o->height()) * 0.92f / zooms.at(out).newZoom +0.5f; + //x_shift = (x_2 - 0.5f) * o->width() * (1 - zooms.at(out).newZoom); // + o->width() * 0.08 * (1 - zooms.at(out).newZoom); + //y_shift = (y_2 - 0.5f) * o->height() * (1 - zooms.at(out).newZoom); // + o->height() * 0.08 * (1 - zooms.at(out).newZoom); + + float x_2 = static_cast(x_shift) / (o->width()) * 0.92f / zooms.at(out).newZoom + 0.46f; + float y_2 = static_cast(y_shift) / (o->height()) * 0.92f / zooms.at(out).newZoom +0.46f; + + x_shift = (x_2 - 0.46f) * o->width() * (1 - zooms.at(out).newZoom) + o->width() / 2 * 0.08f; + y_shift = (y_2 - 0.46f) * o->height() * (1 - zooms.at(out).newZoom) + o->height() / 2 * 0.08f; + + std::cout << x_shift << std::endl; + std::cout << ":" << std::endl; + //if (x_shift < o->width()/2) { + // x_shift /= 0.92f; + //} + //if (y_shift < o->height()/2) { + // y_shift /= 0.92f; + //} + return {x_shift, y_shift}; + //return {static_cast((p.x() - o->width()/2) * 0.92f), static_cast((o->height() + p.y()) * 0.92 - o->height())}; +} + /* Animate the movement (if any) in preparation of a paint screen. */ void EZoomScreen::preparePaint (int msSinceLastPaint) diff --git a/plugins/ezoom/src/ezoom.h b/plugins/ezoom/src/ezoom.h index b04e9b250..db2aae11a 100644 --- a/plugins/ezoom/src/ezoom.h +++ b/plugins/ezoom/src/ezoom.h @@ -180,6 +180,9 @@ class EZoomScreen : public: + CompPoint + getModifiedMousePosition (const CompPoint &p); + void preparePaint (int); diff --git a/plugins/showmouse/CMakeLists.txt b/plugins/showmouse/CMakeLists.txt index 9c2897d1b..7ded6c871 100644 --- a/plugins/showmouse/CMakeLists.txt +++ b/plugins/showmouse/CMakeLists.txt @@ -1,5 +1,6 @@ find_package (Compiz REQUIRED) include (CompizPlugin) +include_directories (${CMAKE_SOURCE_DIR}/plugins/ezoom/src/) -compiz_plugin (showmouse PLUGINDEPS composite opengl mousepoll) +compiz_plugin (showmouse PLUGINDEPS composite opengl mousepoll INCDIRS LIBRARIES ezoom ) diff --git a/plugins/showmouse/showmouse.xml.in b/plugins/showmouse/showmouse.xml.in index 32e0d83e0..24175f3a4 100644 --- a/plugins/showmouse/showmouse.xml.in +++ b/plugins/showmouse/showmouse.xml.in @@ -8,6 +8,7 @@ opengl mousepoll + ezoom cube decor @@ -17,6 +18,7 @@ opengl mousepoll + ezoom diff --git a/plugins/showmouse/src/showmouse.cpp b/plugins/showmouse/src/showmouse.cpp index 928b8d9f6..385c71029 100644 --- a/plugins/showmouse/src/showmouse.cpp +++ b/plugins/showmouse/src/showmouse.cpp @@ -28,6 +28,8 @@ */ #include "showmouse.h" +#include "ezoom.h" +#include COMPIZ_PLUGIN_20090315 (showmouse, ShowmousePluginVTable); @@ -487,7 +489,8 @@ ShowmouseScreen::doDamageRegion () void ShowmouseScreen::positionUpdate (const CompPoint &p) { - mousePos = p; + ZOOM_SCREEN (screen); + mousePos = zs->getModifiedMousePosition(p); } void -- GitLab From 594dcf63dd032386d1df06e502e3b7b3b8b0c856 Mon Sep 17 00:00:00 2001 From: ksamak Date: Sun, 26 Mar 2017 13:12:37 +0200 Subject: [PATCH 44/53] changed relation type --- plugins/ezoom/src/ezoom.cpp | 64 ----------------------------- plugins/ezoom/src/ezoom.h | 3 -- plugins/showmouse/CMakeLists.txt | 3 +- plugins/showmouse/showmouse.xml.in | 2 - plugins/showmouse/src/showmouse.cpp | 5 +-- 5 files changed, 2 insertions(+), 75 deletions(-) diff --git a/plugins/ezoom/src/ezoom.cpp b/plugins/ezoom/src/ezoom.cpp index 499323942..1628bd925 100644 --- a/plugins/ezoom/src/ezoom.cpp +++ b/plugins/ezoom/src/ezoom.cpp @@ -314,70 +314,6 @@ EZoomScreen::adjustXYVelocity (int out, (zooms.at (out).yVelocity * chunk) / cScreen->redrawTime (); } -// correct showmouse's targeting according to mouse centering algorythm -CompPoint -EZoomScreen::getModifiedMousePosition (const CompPoint &p) -{ - int out = screen->outputDeviceForPoint (pointerX, pointerY); - CompOutput *o = &screen->outputDevs ().at (out); - - if (zooms.at (out).newZoom == 1.0f) { - return p; - } - if (optionGetAlwaysCenterMouse()) { - if (optionGetRestrainZoomToScreen()) { - int x_shift = o->width() / 2; - if (o->width() * (0.5f + zooms.at (out).xTranslate) == 0) { - x_shift = static_cast(p.x() / zooms.at (out).newZoom); - } else if (o->width() * (0.5f + zooms.at (out).xTranslate) == o->width() ) { - x_shift = static_cast(o->width() - (o->width() - p.x()) / zooms.at (out).newZoom); - } - int y_shift = o->height() / 2; - if (o->height() * (0.5f + zooms.at (out).yTranslate) == 0) { - y_shift = static_cast(p.y() / zooms.at (out).newZoom); - } else if (o->height() * (0.5f + zooms.at (out).yTranslate) == o->height() ) { - y_shift = static_cast(o->height() - (o->height() - p.y()) / zooms.at (out).newZoom); - } - return {x_shift, y_shift}; - } - return {o->width() / 2, o->height() / 2}; - } - - //float zoomCorrection = 1.0f - zooms.at(out).newZoom; // this correction allows constant centering of the mouse - - // legaly centering algorythm - int x_shift = p.x(); - int y_shift = p.y(); - - // coordinate system conversion - // one lead: - //float x_2 = static_cast(x_shift) / o->width() * (0.92f) + 0.5f; - //float y_2 = static_cast(y_shift) / o->height() * (0.92f) + 0.5f; - - // working ok, but for one variable to find - //float x_2 = static_cast(x_shift) * 1.08f / (o->width()) * 0.92f / zooms.at(out).newZoom +0.5f; - //float y_2 = static_cast(y_shift) * 1.08f / (o->height()) * 0.92f / zooms.at(out).newZoom +0.5f; - //x_shift = (x_2 - 0.5f) * o->width() * (1 - zooms.at(out).newZoom); // + o->width() * 0.08 * (1 - zooms.at(out).newZoom); - //y_shift = (y_2 - 0.5f) * o->height() * (1 - zooms.at(out).newZoom); // + o->height() * 0.08 * (1 - zooms.at(out).newZoom); - - float x_2 = static_cast(x_shift) / (o->width()) * 0.92f / zooms.at(out).newZoom + 0.46f; - float y_2 = static_cast(y_shift) / (o->height()) * 0.92f / zooms.at(out).newZoom +0.46f; - - x_shift = (x_2 - 0.46f) * o->width() * (1 - zooms.at(out).newZoom) + o->width() / 2 * 0.08f; - y_shift = (y_2 - 0.46f) * o->height() * (1 - zooms.at(out).newZoom) + o->height() / 2 * 0.08f; - - std::cout << x_shift << std::endl; - std::cout << ":" << std::endl; - //if (x_shift < o->width()/2) { - // x_shift /= 0.92f; - //} - //if (y_shift < o->height()/2) { - // y_shift /= 0.92f; - //} - return {x_shift, y_shift}; - //return {static_cast((p.x() - o->width()/2) * 0.92f), static_cast((o->height() + p.y()) * 0.92 - o->height())}; -} - /* Animate the movement (if any) in preparation of a paint screen. */ void EZoomScreen::preparePaint (int msSinceLastPaint) diff --git a/plugins/ezoom/src/ezoom.h b/plugins/ezoom/src/ezoom.h index db2aae11a..b04e9b250 100644 --- a/plugins/ezoom/src/ezoom.h +++ b/plugins/ezoom/src/ezoom.h @@ -180,9 +180,6 @@ class EZoomScreen : public: - CompPoint - getModifiedMousePosition (const CompPoint &p); - void preparePaint (int); diff --git a/plugins/showmouse/CMakeLists.txt b/plugins/showmouse/CMakeLists.txt index 7ded6c871..9c2897d1b 100644 --- a/plugins/showmouse/CMakeLists.txt +++ b/plugins/showmouse/CMakeLists.txt @@ -1,6 +1,5 @@ find_package (Compiz REQUIRED) include (CompizPlugin) -include_directories (${CMAKE_SOURCE_DIR}/plugins/ezoom/src/) -compiz_plugin (showmouse PLUGINDEPS composite opengl mousepoll INCDIRS LIBRARIES ezoom ) +compiz_plugin (showmouse PLUGINDEPS composite opengl mousepoll) diff --git a/plugins/showmouse/showmouse.xml.in b/plugins/showmouse/showmouse.xml.in index 24175f3a4..32e0d83e0 100644 --- a/plugins/showmouse/showmouse.xml.in +++ b/plugins/showmouse/showmouse.xml.in @@ -8,7 +8,6 @@ opengl mousepoll - ezoom cube decor @@ -18,7 +17,6 @@ opengl mousepoll - ezoom diff --git a/plugins/showmouse/src/showmouse.cpp b/plugins/showmouse/src/showmouse.cpp index 385c71029..928b8d9f6 100644 --- a/plugins/showmouse/src/showmouse.cpp +++ b/plugins/showmouse/src/showmouse.cpp @@ -28,8 +28,6 @@ */ #include "showmouse.h" -#include "ezoom.h" -#include COMPIZ_PLUGIN_20090315 (showmouse, ShowmousePluginVTable); @@ -489,8 +487,7 @@ ShowmouseScreen::doDamageRegion () void ShowmouseScreen::positionUpdate (const CompPoint &p) { - ZOOM_SCREEN (screen); - mousePos = zs->getModifiedMousePosition(p); + mousePos = p; } void -- GitLab From 192b8cde1e988f4fa9d8d356754560056dc2c91d Mon Sep 17 00:00:00 2001 From: ksamak Date: Wed, 5 Apr 2017 10:46:12 +0200 Subject: [PATCH 45/53] added colorfilter plugin reactivation (manual merge from b4n's repo) --- plugins/CMakeLists.txt | 2 - plugins/colorfilter/colorfilter.xml.in | 1 + .../colorfilter/data/filters/blackandwhite | 11 - .../data/filters/blackandwhite.frag | 4 + .../colorfilter/data/filters/blueish-filter | 10 - .../data/filters/blueish-filter.frag | 5 + plugins/colorfilter/data/filters/contrast | 21 - .../colorfilter/data/filters/contrast.frag | 9 + plugins/colorfilter/data/filters/deuteranopia | 43 -- .../data/filters/deuteranopia.frag | 31 + plugins/colorfilter/data/filters/grayscale | 6 - .../colorfilter/data/filters/grayscale.frag | 4 + plugins/colorfilter/data/filters/negative | 9 - .../colorfilter/data/filters/negative-green | 10 - .../data/filters/negative-green.frag | 3 + .../data/filters/negative-lightness.frag | 111 ++++ .../colorfilter/data/filters/negative.frag | 4 + plugins/colorfilter/data/filters/protanopia | 43 -- .../colorfilter/data/filters/protanopia.frag | 31 + plugins/colorfilter/data/filters/sepia | 9 - plugins/colorfilter/data/filters/sepia.frag | 7 + .../colorfilter/data/filters/swap-green-blue | 5 - .../data/filters/swap-green-blue.frag | 3 + .../colorfilter/data/filters/swap-red-blue | 5 - .../data/filters/swap-red-blue.frag | 3 + .../colorfilter/data/filters/swap-red-green | 5 - .../data/filters/swap-red-green.frag | 3 + plugins/colorfilter/src/colorfilter.cpp | 263 +++++---- plugins/colorfilter/src/colorfilter.h | 43 +- plugins/colorfilter/src/parser.cpp | 538 ------------------ plugins/colorfilter/src/parser.h | 105 ---- 31 files changed, 368 insertions(+), 979 deletions(-) delete mode 100644 plugins/colorfilter/data/filters/blackandwhite create mode 100644 plugins/colorfilter/data/filters/blackandwhite.frag delete mode 100644 plugins/colorfilter/data/filters/blueish-filter create mode 100644 plugins/colorfilter/data/filters/blueish-filter.frag delete mode 100644 plugins/colorfilter/data/filters/contrast create mode 100644 plugins/colorfilter/data/filters/contrast.frag delete mode 100644 plugins/colorfilter/data/filters/deuteranopia create mode 100644 plugins/colorfilter/data/filters/deuteranopia.frag delete mode 100644 plugins/colorfilter/data/filters/grayscale create mode 100644 plugins/colorfilter/data/filters/grayscale.frag delete mode 100644 plugins/colorfilter/data/filters/negative delete mode 100644 plugins/colorfilter/data/filters/negative-green create mode 100644 plugins/colorfilter/data/filters/negative-green.frag create mode 100644 plugins/colorfilter/data/filters/negative-lightness.frag create mode 100644 plugins/colorfilter/data/filters/negative.frag delete mode 100644 plugins/colorfilter/data/filters/protanopia create mode 100644 plugins/colorfilter/data/filters/protanopia.frag delete mode 100644 plugins/colorfilter/data/filters/sepia create mode 100644 plugins/colorfilter/data/filters/sepia.frag delete mode 100644 plugins/colorfilter/data/filters/swap-green-blue create mode 100644 plugins/colorfilter/data/filters/swap-green-blue.frag delete mode 100644 plugins/colorfilter/data/filters/swap-red-blue create mode 100644 plugins/colorfilter/data/filters/swap-red-blue.frag delete mode 100644 plugins/colorfilter/data/filters/swap-red-green create mode 100644 plugins/colorfilter/data/filters/swap-red-green.frag delete mode 100644 plugins/colorfilter/src/parser.cpp delete mode 100644 plugins/colorfilter/src/parser.h diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index 5e9215674..216c4de35 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -13,7 +13,6 @@ include_directories (${COMPIZ_INTERNAL_INCLUDES}) set (COMPIZ_DISABLE_PLUGIN_ANIMATIONADDON ON) set (COMPIZ_DISABLE_PLUGIN_BICUBIC ON) set (COMPIZ_DISABLE_PLUGIN_BLUR ON) -set (COMPIZ_DISABLE_PLUGIN_COLORFILTER ON) set (COMPIZ_DISABLE_PLUGIN_GROUP ON) set (COMPIZ_DISABLE_PLUGIN_LOGINOUT ON) set (COMPIZ_DISABLE_PLUGIN_REFLEX ON) @@ -26,7 +25,6 @@ if (BUILD_GLES) set (COMPIZ_DISABLE_PLUGIN_FREEWINS ON) set (COMPIZ_DISABLE_PLUGIN_GEARS ON) set (COMPIZ_DISABLE_PLUGIN_TD ON) - set (COMPIZ_DISABLE_PLUGIN_COLORFILTER ON) set (COMPIZ_DISABLE_PLUGIN_MBLUR ON) set (COMPIZ_DISABLE_PLUGIN_BENCH ON) set (COMPIZ_DISABLE_PLUGIN_WIDGET ON) diff --git a/plugins/colorfilter/colorfilter.xml.in b/plugins/colorfilter/colorfilter.xml.in index a762bffe5..152aae733 100644 --- a/plugins/colorfilter/colorfilter.xml.in +++ b/plugins/colorfilter/colorfilter.xml.in @@ -37,6 +37,7 @@ string negative + negative-lightness negative-green blueish-filter sepia diff --git a/plugins/colorfilter/data/filters/blackandwhite b/plugins/colorfilter/data/filters/blackandwhite deleted file mode 100644 index c72ad6cd0..000000000 --- a/plugins/colorfilter/data/filters/blackandwhite +++ /dev/null @@ -1,11 +0,0 @@ -!!ARBfp1.0 -TEMP tex, temp, black, white; -MOV black, {0, 0, 0, 0}; -MOV white, {1, 1, 1, 1}; -TEX tex, fragment.texcoord[0], texture[0], RECT; -DP3 temp.x, tex, {0.33333, 0.33333, 0.33333, 0}; -ADD temp.x, temp.x, -0.5; -CMP temp, temp.x, black, white; -MOV temp.a, tex.a; -MOV result.color, temp; -END diff --git a/plugins/colorfilter/data/filters/blackandwhite.frag b/plugins/colorfilter/data/filters/blackandwhite.frag new file mode 100644 index 000000000..bfbcec816 --- /dev/null +++ b/plugins/colorfilter/data/filters/blackandwhite.frag @@ -0,0 +1,4 @@ +void blackandwhite_fragment () { + float v = dot(gl_FragColor.rgb, vec3(0.33333, 0.33333, 0.33333)); + gl_FragColor.rgb = v > 0.5 ? vec3(1, 1, 1) : vec3(0, 0, 0); +} diff --git a/plugins/colorfilter/data/filters/blueish-filter b/plugins/colorfilter/data/filters/blueish-filter deleted file mode 100644 index 95c7b2153..000000000 --- a/plugins/colorfilter/data/filters/blueish-filter +++ /dev/null @@ -1,10 +0,0 @@ -!!ARBfp1.0 -TEMP temp, neg; -TEX temp, fragment.texcoord[0], texture[0], RECT; -RCP neg.a, temp.a; -MAD temp.rgb, -neg.a, temp, 1.0; -MUL temp.rgb, temp.a, temp; -MUL temp, fragment.color, temp; -SUB_SAT temp.b, 0.8, -temp.b; -MOV result.color, temp; -END \ No newline at end of file diff --git a/plugins/colorfilter/data/filters/blueish-filter.frag b/plugins/colorfilter/data/filters/blueish-filter.frag new file mode 100644 index 000000000..72ac9e14b --- /dev/null +++ b/plugins/colorfilter/data/filters/blueish-filter.frag @@ -0,0 +1,5 @@ +void blueish_filter_fragment () { + vec3 color = vec3(1.0, 1.0, 1.0) - gl_FragColor.rgb; + color.b = clamp(0.8 + color.b, 0.0, 1.0); + gl_FragColor.rgb = color; +} diff --git a/plugins/colorfilter/data/filters/contrast b/plugins/colorfilter/data/filters/contrast deleted file mode 100644 index 12cacc33e..000000000 --- a/plugins/colorfilter/data/filters/contrast +++ /dev/null @@ -1,21 +0,0 @@ -!!ARBfp1.0 -TEMP output; -TEMP input; -TEMP bright; -TEMP dark; - -TEX input, fragment.texcoord[0], texture[0], RECT; - -# Subtract color by 0.51 => everything with more then 0.51 will have at least 0 ; -SUB output.rgb, input, 0.51; - -# Create a dark color..; -SUB dark.rgb, input, 0.3; -# ..and a bright color ; -ADD bright.rgb, input, 0.3; - -# All colors which are < 0 (original color - 0.51 < 0) get a dark color and everything else a bright color ; -CMP output.rgb, output, dark, bright; - -MOV result.color, output; -END diff --git a/plugins/colorfilter/data/filters/contrast.frag b/plugins/colorfilter/data/filters/contrast.frag new file mode 100644 index 000000000..2da242dc7 --- /dev/null +++ b/plugins/colorfilter/data/filters/contrast.frag @@ -0,0 +1,9 @@ +void contrast_fragment () { + vec3 d; + + d.r = gl_FragColor.r < 0.51 ? -0.3 : +0.3; + d.g = gl_FragColor.g < 0.51 ? -0.3 : +0.3; + d.b = gl_FragColor.b < 0.51 ? -0.3 : +0.3; + + gl_FragColor.rgb += d; +} diff --git a/plugins/colorfilter/data/filters/deuteranopia b/plugins/colorfilter/data/filters/deuteranopia deleted file mode 100644 index d7de0984c..000000000 --- a/plugins/colorfilter/data/filters/deuteranopia +++ /dev/null @@ -1,43 +0,0 @@ -!!ARBfp1.0 -TEMP ab, ci, texv, temp1, temp2; -TEX texv, fragment.texcoord[0], texture[0], RECT; - -MOV ab, {-0.0615003999429, 0.058589396688, - 0.0827700165681, -0.0793451999536}; -MOV ci, {-0.01320014122, 0.013289415272, - 0.57638336864, 0.0}; - -POW texv.r, texv.r, {0.4761904, 0, 0, 0}.r; -POW texv.g, texv.g, {0.5, 0, 0, 0}.r; -POW texv.b, texv.b, {0.4761904, 0, 0, 0}.r; - -DP3 temp1.r, {0.05059983, 0.08585369, 0.00952420, 0.0}, texv; -DP3 temp1.g, {0.01893033, 0.08925308, 0.01370054, 0.0}, texv; -DP3 temp1.b, {0.00292202, 0.00975732, 0.07145979, 0.0}, texv; - -RCP temp2.r, temp1.r; -MAD temp2.r, temp2.r, temp1.b, -ci.b; - -MUL temp2.g, ab.r, temp1.r; -MAD temp2.g, ci.r, temp1.b, temp2.g; -RCP temp2.a, -ab.b; -MUL temp2.g, temp2.g, temp2.a; - -MUL temp2.b, ab.g, temp1.r; -MAD temp2.b, ci.g, temp1.b, temp2.b; -RCP temp2.a, -ab.a; -MUL temp2.b, temp2.b, temp2.a; - -CMP temp1.g, temp2.r, temp2.g, temp2.b; - -DP3 temp2.r, {30.830854, -29.832659, 1.610474, 0.0}, temp1; -DP3 temp2.g, {-6.481468, 17.715578, -2.532642, 0.0}, temp1; -DP3 temp2.b, {-0.375690, -1.199062, 14.273846, 0.0}, temp1; - -POW temp2.r, temp2.r, {2.1, 0, 0, 0}.r; -POW temp2.g, temp2.g, {2.0, 0, 0, 0}.r; -POW temp2.b, temp2.b, {2.1, 0, 0, 0}.r; - -MOV temp2.a, texv.a; -MOV result.color, temp2; -END diff --git a/plugins/colorfilter/data/filters/deuteranopia.frag b/plugins/colorfilter/data/filters/deuteranopia.frag new file mode 100644 index 000000000..4c865badb --- /dev/null +++ b/plugins/colorfilter/data/filters/deuteranopia.frag @@ -0,0 +1,31 @@ +void deuteranopia_fragment () { + vec3 color = gl_FragColor.rgb; + vec4 ab = vec4(-0.0615003999429, 0.058589396688, + 0.0827700165681, -0.0793451999536); + vec3 ci = vec3(-0.01320014122, 0.013289415272, 0.57638336864); + + color.r = pow(color.r, 0.4761904); + color.g = pow(color.g, 0.5); + color.b = pow(color.b, 0.4761904); + + vec3 temp1; + temp1.r = dot(vec3(0.05059983, 0.08585369, 0.00952420), color); + temp1.g = dot(vec3(0.01893033, 0.08925308, 0.01370054), color); + temp1.b = dot(vec3(0.00292202, 0.00975732, 0.07145979), color); + + if ((1.0/temp1.r) * temp1.b - ci.b < 0.0) { + temp1.g = (ab.r * temp1.r + ci.r * temp1.b) * (1.0/-ab.b); + } else { + temp1.g = (ab.g * temp1.r + ci.g * temp1.b) * (1.0/-ab.a); + } + + color.r = dot(vec3(30.830854, -29.832659, 1.610474), temp1); + color.g = dot(vec3(-6.481468, 17.715578, -2.532642), temp1); + color.b = dot(vec3(-0.375690, -1.199062, 14.273846), temp1); + + color.r = pow(color.r, 2.1); + color.g = pow(color.g, 2.0); + color.b = pow(color.b, 2.1); + + gl_FragColor.rgb = color; +} diff --git a/plugins/colorfilter/data/filters/grayscale b/plugins/colorfilter/data/filters/grayscale deleted file mode 100644 index cb582b029..000000000 --- a/plugins/colorfilter/data/filters/grayscale +++ /dev/null @@ -1,6 +0,0 @@ -!!ARBfp1.0 -TEMP tex; -TEX tex, fragment.texcoord[0], texture[0], RECT; -DP3 tex.r, tex, {0.33333, 0.33333, 0.33333, 0}; -MOV result.color, tex.rrra; -END diff --git a/plugins/colorfilter/data/filters/grayscale.frag b/plugins/colorfilter/data/filters/grayscale.frag new file mode 100644 index 000000000..92dc90a35 --- /dev/null +++ b/plugins/colorfilter/data/filters/grayscale.frag @@ -0,0 +1,4 @@ +void grayscale_fragment () { + float v = dot(gl_FragColor.rgb, vec3(0.33333, 0.33333, 0.33333)); + gl_FragColor.rgb = vec3(v, v, v); +} diff --git a/plugins/colorfilter/data/filters/negative b/plugins/colorfilter/data/filters/negative deleted file mode 100644 index e0b93bab4..000000000 --- a/plugins/colorfilter/data/filters/negative +++ /dev/null @@ -1,9 +0,0 @@ -!!ARBfp1.0 -TEMP temp, neg; -TEX temp, fragment.texcoord[0], texture[0], RECT; -RCP neg.a, temp.a; -MAD temp.rgb, -neg.a, temp, 1.0; -MUL temp.rgb, temp.a, temp; -MUL temp, fragment.color, temp; -MOV result.color, temp; -END diff --git a/plugins/colorfilter/data/filters/negative-green b/plugins/colorfilter/data/filters/negative-green deleted file mode 100644 index ed3eaed62..000000000 --- a/plugins/colorfilter/data/filters/negative-green +++ /dev/null @@ -1,10 +0,0 @@ -!!ARBfp1.0 -TEMP temp, neg; -TEX temp, fragment.texcoord[0], texture[0], RECT; -RCP neg.a, temp.a; -MAD temp.rgb, -neg.a, temp, 1.0; -MUL temp.rgb, temp.a, temp; -MUL temp, fragment.color, temp; -SUB temp.rb, temp, temp; -MOV result.color, temp; -END diff --git a/plugins/colorfilter/data/filters/negative-green.frag b/plugins/colorfilter/data/filters/negative-green.frag new file mode 100644 index 000000000..383d2f0ee --- /dev/null +++ b/plugins/colorfilter/data/filters/negative-green.frag @@ -0,0 +1,3 @@ +void negative_green_fragment () { + gl_FragColor.rgb = vec3(0, 1.0 - gl_FragColor.g, 0); +} diff --git a/plugins/colorfilter/data/filters/negative-lightness.frag b/plugins/colorfilter/data/filters/negative-lightness.frag new file mode 100644 index 000000000..1f2a5f92e --- /dev/null +++ b/plugins/colorfilter/data/filters/negative-lightness.frag @@ -0,0 +1,111 @@ +/* HSL/RGB conversion taken off GTK's _gtk_hsla_init_from_rgba() and + * _gdk_rgba_init_from_hsla(), GPLv2+, + * Copyright (C) 2012 Benjamin Otte */ + +/* hsl: .r = H, .g = S, .b = L */ +vec3 negative_lightness_rgb_to_hsl(vec3 rgb) { + vec3 hsl; + float min; + float max; + + max = max(max(rgb.r, rgb.g), rgb.b); + min = min(min(rgb.r, rgb.g), rgb.b); + + hsl.r = 0.0; // H + hsl.g = 0.0; // S + hsl.b = (max + min) / 2.0; // L + + if (max != min) + { + if (hsl.b <= 0.5) + hsl.g = (max - min) / (max + min); + else + hsl.g = (max - min) / (2.0 - max - min); + + float delta = max - min; + if (rgb.r == max) + hsl.r = (rgb.g - rgb.b) / delta; + else if (rgb.g == max) + hsl.r = 2.0 + (rgb.b - rgb.r) / delta; + else if (rgb.b == max) + hsl.r = 4.0 + (rgb.r - rgb.g) / delta; + + hsl.r *= 60.0; + if (hsl.r < 0.0) + hsl.r += 360.0; + } + + return hsl; +} + +/* hsl: .r = H, .g = S, .b = L */ +vec3 negative_lightness_hsl_to_rgb(vec3 hsl) { + vec3 rgb; + float m1, m2; + + if (hsl.b <= 0.5) // H + m2 = hsl.b * (1.0 + hsl.g); + else + m2 = hsl.b + hsl.g - hsl.b * hsl.g; + m1 = 2.0 * hsl.b - m2; + + if (hsl.g == 0.0) + rgb = vec3(hsl.b, hsl.b, hsl.b); + else + { + float hue; + + hue = hsl.r + 120.0; + while (hue > 360.0) + hue -= 360.0; + while (hue < 0.0) + hue += 360.0; + + if (hue < 60.0) + rgb.r = m1 + (m2 - m1) * hue / 60.0; + else if (hue < 180.0) + rgb.r = m2; + else if (hue < 240.0) + rgb.r = m1 + (m2 - m1) * (240.0 - hue) / 60.0; + else + rgb.r = m1; + + hue = hsl.r; + while (hue > 360.0) + hue -= 360.0; + while (hue < 0.0) + hue += 360.0; + + if (hue < 60.0) + rgb.g = m1 + (m2 - m1) * hue / 60.0; + else if (hue < 180.0) + rgb.g = m2; + else if (hue < 240.0) + rgb.g = m1 + (m2 - m1) * (240.0 - hue) / 60.0; + else + rgb.g = m1; + + hue = hsl.r - 120.0; + while (hue > 360.0) + hue -= 360.0; + while (hue < 0.0) + hue += 360.0; + + if (hue < 60.0) + rgb.b = m1 + (m2 - m1) * hue / 60.0; + else if (hue < 180.0) + rgb.b = m2; + else if (hue < 240.0) + rgb.b = m1 + (m2 - m1) * (240.0 - hue) / 60.0; + else + rgb.b = m1; + } + + return rgb; +} + +void negative_lightness_fragment() { + vec3 hsl = negative_lightness_rgb_to_hsl(gl_FragColor.rgb); + hsl.b = 1.0 - hsl.b; // invert L + gl_FragColor.rgb = negative_lightness_hsl_to_rgb(hsl); +} diff --git a/plugins/colorfilter/data/filters/negative.frag b/plugins/colorfilter/data/filters/negative.frag new file mode 100644 index 000000000..132c7ac19 --- /dev/null +++ b/plugins/colorfilter/data/filters/negative.frag @@ -0,0 +1,4 @@ +void negative_fragment () { + vec3 color = vec3(1.0, 1.0, 1.0) - gl_FragColor.rgb; + gl_FragColor.rgb = color; +} diff --git a/plugins/colorfilter/data/filters/protanopia b/plugins/colorfilter/data/filters/protanopia deleted file mode 100644 index 22e1490ed..000000000 --- a/plugins/colorfilter/data/filters/protanopia +++ /dev/null @@ -1,43 +0,0 @@ -!!ARBfp1.0 -TEMP ab, ci, texv, temp1, temp2; -TEX texv, fragment.texcoord[0], texture[0], RECT; - -MOV ab, {-0.0615003999429, 0.058589396688, - 0.0827700165681, -0.0793451999536}; -MOV ci, {-0.01320014122, 0.013289415272, - 0.57638336864, 0.0}; - -POW texv.r, texv.r, {0.4761904, 0, 0, 0}.r; -POW texv.g, texv.g, {0.5, 0, 0, 0}.r; -POW texv.b, texv.b, {0.4761904, 0, 0, 0}.r; - -DP3 temp1.r, {0.05059983, 0.08585369, 0.00952420, 0.0}, texv; -DP3 temp1.g, {0.01893033, 0.08925308, 0.01370054, 0.0}, texv; -DP3 temp1.b, {0.00292202, 0.00975732, 0.07145979, 0.0}, texv; - -RCP temp2.r, temp1.g; -MAD temp2.r, temp2.r, temp1.b, -ci.b; - -MUL temp2.g, ab.b, temp1.g; -MAD temp2.g, ci.r, temp1.b, temp2.g; -RCP temp2.a, -ab.r; -MUL temp2.g, temp2.g, temp2.a; - -MUL temp2.b, ab.a, temp1.g; -MAD temp2.b, ci.g, temp1.b, temp2.b; -RCP temp2.a, -ab.g; -MUL temp2.b, temp2.b, temp2.a; - -CMP temp1.r, temp2.r, temp2.g, temp2.b; - -DP3 temp2.r, {30.830854, -29.832659, 1.610474, 0.0}, temp1; -DP3 temp2.g, {-6.481468, 17.715578, -2.532642, 0.0}, temp1; -DP3 temp2.b, {-0.375690, -1.199062, 14.273846, 0.0}, temp1; - -POW temp2.r, temp2.r, {2.1, 0, 0, 0}.r; -POW temp2.g, temp2.g, {2.0, 0, 0, 0}.r; -POW temp2.b, temp2.b, {2.1, 0, 0, 0}.r; - -MOV temp2.a, texv.a; -MOV result.color, temp2; -END diff --git a/plugins/colorfilter/data/filters/protanopia.frag b/plugins/colorfilter/data/filters/protanopia.frag new file mode 100644 index 000000000..7faa11333 --- /dev/null +++ b/plugins/colorfilter/data/filters/protanopia.frag @@ -0,0 +1,31 @@ +void protanopia_fragment () { + vec3 color = gl_FragColor.rgb; + vec4 ab = vec4(-0.0615003999429, 0.058589396688, + 0.0827700165681, -0.0793451999536); + vec3 ci = vec3(-0.01320014122, 0.013289415272, 0.57638336864); + + color.r = pow(color.r, 0.4761904); + color.g = pow(color.g, 0.5); + color.b = pow(color.b, 0.4761904); + + vec3 temp1; + temp1.r = dot(vec3(0.05059983, 0.08585369, 0.00952420), color); + temp1.g = dot(vec3(0.01893033, 0.08925308, 0.01370054), color); + temp1.b = dot(vec3(0.00292202, 0.00975732, 0.07145979), color); + + if ((1.0/temp1.g) * temp1.b - ci.b < 0.0) { + temp1.r = (ab.b * temp1.g + ci.r * temp1.b) * (1.0/-ab.r); + } else { + temp1.r = (ab.a * temp1.g + ci.g * temp1.b) * (1.0/-ab.g); + } + + color.r = dot(vec3(30.830854, -29.832659, 1.610474), temp1); + color.g = dot(vec3(-6.481468, 17.715578, -2.532642), temp1); + color.b = dot(vec3(-0.375690, -1.199062, 14.273846), temp1); + + color.r = pow(color.r, 2.1); + color.g = pow(color.g, 2.0); + color.b = pow(color.b, 2.1); + + gl_FragColor.rgb = color; +} diff --git a/plugins/colorfilter/data/filters/sepia b/plugins/colorfilter/data/filters/sepia deleted file mode 100644 index 60f9438f4..000000000 --- a/plugins/colorfilter/data/filters/sepia +++ /dev/null @@ -1,9 +0,0 @@ -!!ARBfp1.0 -TEMP tex, temp; -TEX tex, fragment.texcoord[0], texture[0], RECT; -DP3 temp.r, tex, {0.393, 0.769, 0.189, 0}; -DP3 temp.g, tex, {0.349, 0.686, 0.168, 0}; -DP3 temp.b, tex, {0.272, 0.534, 0.131, 0}; -MOV temp.a, tex.a; -MOV result.color, temp; -END diff --git a/plugins/colorfilter/data/filters/sepia.frag b/plugins/colorfilter/data/filters/sepia.frag new file mode 100644 index 000000000..5337f3b8f --- /dev/null +++ b/plugins/colorfilter/data/filters/sepia.frag @@ -0,0 +1,7 @@ +void sepia_fragment () { + vec3 color = gl_FragColor.rgb; + color.r = dot(gl_FragColor.rgb, vec3(0.393, 0.769, 0.189)); + color.g = dot(gl_FragColor.rgb, vec3(0.349, 0.686, 0.168)); + color.b = dot(gl_FragColor.rgb, vec3(0.272, 0.534, 0.131)); + gl_FragColor.rgb = color.rgb; +} diff --git a/plugins/colorfilter/data/filters/swap-green-blue b/plugins/colorfilter/data/filters/swap-green-blue deleted file mode 100644 index ec04a89ff..000000000 --- a/plugins/colorfilter/data/filters/swap-green-blue +++ /dev/null @@ -1,5 +0,0 @@ -!!ARBfp1.0 -TEMP tex; -TEX tex, fragment.texcoord[0], texture[0], RECT; -MOV result.color, tex.rbga; -END diff --git a/plugins/colorfilter/data/filters/swap-green-blue.frag b/plugins/colorfilter/data/filters/swap-green-blue.frag new file mode 100644 index 000000000..bb21a7a36 --- /dev/null +++ b/plugins/colorfilter/data/filters/swap-green-blue.frag @@ -0,0 +1,3 @@ +void swap_green_blue_fragment () { + gl_FragColor.gb = gl_FragColor.bg; +} diff --git a/plugins/colorfilter/data/filters/swap-red-blue b/plugins/colorfilter/data/filters/swap-red-blue deleted file mode 100644 index 61fff3164..000000000 --- a/plugins/colorfilter/data/filters/swap-red-blue +++ /dev/null @@ -1,5 +0,0 @@ -!!ARBfp1.0 -TEMP tex; -TEX tex, fragment.texcoord[0], texture[0], RECT; -MOV result.color, tex.bgra; -END diff --git a/plugins/colorfilter/data/filters/swap-red-blue.frag b/plugins/colorfilter/data/filters/swap-red-blue.frag new file mode 100644 index 000000000..ac765bcea --- /dev/null +++ b/plugins/colorfilter/data/filters/swap-red-blue.frag @@ -0,0 +1,3 @@ +void swap_red_blue_fragment () { + gl_FragColor.rb = gl_FragColor.br; +} diff --git a/plugins/colorfilter/data/filters/swap-red-green b/plugins/colorfilter/data/filters/swap-red-green deleted file mode 100644 index 8bdcf1cff..000000000 --- a/plugins/colorfilter/data/filters/swap-red-green +++ /dev/null @@ -1,5 +0,0 @@ -!!ARBfp1.0 -TEMP tex; -TEX tex, fragment.texcoord[0], texture[0], RECT; -MOV result.color, tex.grba; -END diff --git a/plugins/colorfilter/data/filters/swap-red-green.frag b/plugins/colorfilter/data/filters/swap-red-green.frag new file mode 100644 index 000000000..4c2a97fdc --- /dev/null +++ b/plugins/colorfilter/data/filters/swap-red-green.frag @@ -0,0 +1,3 @@ +void swap_red_green_fragment () { + gl_FragColor.rg = gl_FragColor.gr; +} diff --git a/plugins/colorfilter/src/colorfilter.cpp b/plugins/colorfilter/src/colorfilter.cpp index 60bc36b62..4dd9cde1b 100644 --- a/plugins/colorfilter/src/colorfilter.cpp +++ b/plugins/colorfilter/src/colorfilter.cpp @@ -21,33 +21,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "colorfilter.h" -#include "parser.h" +#include +#include +#include COMPIZ_PLUGIN_20090315 (colorfilter, ColorfilterPluginVTable); -/* - * Find fragment function by id (imported from compiz-core/src/fragment.c) - */ -ColorfilterFunction * -ColorfilterScreen::findFragmentFunction (int id) -{ - foreach (ColorfilterFunction *function, filtersFunctions) - { - if (function->id == (unsigned int) id) - return function; - } - - return NULL; -} - /* Actions handling functions ----------------------------------------------- */ -void -toggleWindowFunctions (ColorfilterWindow *cfw, bool enabled) -{ - cfw->gWindow->glDrawTextureSetEnabled (cfw, enabled); -} - /* * Toggle filtering for a specific window */ @@ -65,7 +46,7 @@ ColorfilterWindow::toggle () /* Ensure window is going to be repainted */ cWindow->addDamage (); - toggleWindowFunctions (this, isFiltered); + gWindow->glDrawTextureSetEnabled (this, isFiltered); } /* @@ -89,9 +70,6 @@ ColorfilterScreen::toggle () void ColorfilterScreen::switchFilter () { - GLFragment::FunctionId id; - ColorfilterFunction *function; - /* % (count + 1) because of the cumulative filters mode */ currentFilter = (currentFilter + 1) % (filtersFunctions.size () + 1); if (currentFilter == 0) @@ -99,13 +77,12 @@ ColorfilterScreen::switchFilter () "Cumulative filters mode"); else { - id = filtersFunctions.at (currentFilter - 1)->id; - if (id) + std::shared_ptr func = filtersFunctions.at (currentFilter - 1); + if (func && func->loaded ()) { - function = findFragmentFunction (id); compLogMessage ("colorfilter", CompLogLevelInfo, "Single filter mode (using %s filter)", - function->name.c_str ()); + func->name.c_str ()); } else { @@ -135,7 +112,7 @@ ColorfilterScreen::toggleWindow (CompAction *action, CompWindow *w = screen->findWindow (CompOption::getIntOptionNamed (options, "window", 0)); - if (w && GL::fragmentProgram) + if (w && GL::shaders) ColorfilterWindow::get (w)->toggle (); return true; @@ -149,9 +126,7 @@ ColorfilterScreen::toggleScreen (CompAction *action, CompAction::State state, CompOption::Vector options) { - screen->findWindow (CompOption::getIntOptionNamed (options, "root", 0)); - - if (GL::fragmentProgram) + if (GL::shaders) toggle (); return true; @@ -165,7 +140,7 @@ ColorfilterScreen::filterSwitch (CompAction *action, CompAction::State state, CompOption::Vector options) { - if (GL::fragmentProgram) + if (GL::shaders) switchFilter (); return true; @@ -179,59 +154,114 @@ ColorfilterScreen::filterSwitch (CompAction *action, void ColorfilterScreen::unloadFilters () { - if (!filtersFunctions.empty ()) + filtersFunctions.clear (); + /* Reset current filter */ + currentFilter = 0; +} + +ColorfilterFunction::ColorfilterFunction (const CompString &name_) : + name(name_) +{ + programCleanName(name); +} + +/* + * Clean program name string + */ +void +ColorfilterFunction::programCleanName (CompString &name) +{ + std::replace_if (name.begin (), name.end (), + [] (char c) { return !isalnum (c); }, '_'); +} + +/* + * File reader function + */ +bool +ColorfilterFunction::load (CompString fname) +{ + std::ifstream fp; + int length; + char *buffer; + const char *home = getenv ("HOME"); + CompString path; + + if (!boost::algorithm::ends_with (fname, ".frag")) + fname += ".frag"; + + /* Try to open file fname as is */ + fp.open (fname.c_str ()); + + /* If failed, try as user filter file (in ~/.compiz/data/filters) */ + if (!fp.is_open () && home && home[0] != '\0') { - /* Destroy loaded filters one by one */ - while (!filtersFunctions.empty ()) - { - ColorfilterFunction *function = filtersFunctions.back (); - if (function->id) - GLFragment::destroyFragmentFunction (function->id); + path = CompString (home) + "/.compiz/data/filters/" + fname; + fp.open (path.c_str ()); + } - delete function; + /* If failed again, try as system wide data file + * (in PREFIX/share/compiz/filters) */ + if (!fp.is_open ()) + { + path = CompString (DATADIR) + "/data/filters/" + fname; + fp.open (path.c_str ()); + } - filtersFunctions.pop_back (); - } - /* Reset current filter */ - currentFilter = 0; + /* If failed again & again, abort */ + if (!fp.is_open ()) + { + return false; } + + /* get length of file: */ + fp.seekg (0, std::ios::end); + length = fp.tellg (); + length++; + fp.seekg (0, std::ios::beg); + + /* allocate memory */ + buffer = new char [length]; + + /* read data as a block: */ + fp.read (buffer, length - 1); + buffer[length - 1] = '\0'; + fp.close (); + + shader = buffer; + + delete[] buffer; + + return true; } /* * Load filters from a list of files for current screen */ int -ColorfilterScreen::loadFilters (GLTexture *texture) +ColorfilterScreen::loadFilters () { - int target, loaded, count; - GLFragment::FunctionId function; + int loaded, count; CompString name, file; CompOption::Value::Vector filters; - FragmentParser *parser = new FragmentParser (); - ColorfilterFunction *func; + std::shared_ptr func; /* Free previously loaded filters and malloc */ unloadFilters (); - filtersLoaded = true; - /* Fetch filters filenames */ filters = optionGetFilters (); count = filters.size (); //filtersFunctions.resize (count); - /* The texture target that will be used for some ops */ - if (texture->target () == GL_TEXTURE_2D) - target = COMP_FETCH_TARGET_2D; - else - target = COMP_FETCH_TARGET_RECT; - /* Load each filter one by one */ loaded = 0; for (int i = 0; i < count; i++) { name = CompString (basename (filters.at (i).s ().c_str ())); + if (boost::algorithm::ends_with (name, ".frag")) + name.erase (name.end () - 5, name.end ()); file = filters.at (i).s (); if (name.empty ()) { @@ -242,17 +272,15 @@ ColorfilterScreen::loadFilters (GLTexture *texture) compLogMessage ("colorfilter", CompLogLevelInfo, "Loading filter %s (item %s).", name.c_str (), file.c_str ()); - function = parser->loadFragmentProgram (file, name, target); - func = new ColorfilterFunction (); + func = std::shared_ptr (new ColorfilterFunction (name)); if (!func) continue; - func->name = name; - func->id = function; + func->load (file); filtersFunctions.push_back (func); - if (func && function) + if (func && func->loaded ()) loaded++; } @@ -270,8 +298,6 @@ ColorfilterScreen::loadFilters (GLTexture *texture) cfw->cWindow->addDamage (w); } - delete parser; - return loaded; } @@ -279,51 +305,41 @@ ColorfilterScreen::loadFilters (GLTexture *texture) * Wrapper that enables filters if the window is filtered */ void -ColorfilterWindow::glDrawTexture (GLTexture *texture, - GLFragment::Attrib &attrib, - unsigned int mask) +ColorfilterWindow::glDrawTexture (GLTexture *texture, + const GLMatrix &transform, + const GLWindowPaintAttrib &attrib, + unsigned int mask) { - GLFragment::FunctionId function; - FILTER_SCREEN (screen); - bool shouldFilter = isFiltered; + bool shouldFilter = false; - foreach (GLTexture *tex, gWindow->textures ()) + if (isFiltered && !cfs->filtersFunctions.empty ()) { - if (tex->name () != texture->name ()) - shouldFilter = false; + if (cfs->optionGetFilterDecorations ()) + shouldFilter = true; + else + { + foreach (GLTexture *tex, gWindow->textures ()) + { + if (tex->name () == texture->name ()) + { + shouldFilter = true; + break; + } + } + } } - /* We are filtering a decoration */ - if ((cfs->optionGetFilterDecorations () && - isFiltered && - !cfs->filtersFunctions.empty ())) - shouldFilter = true; - - /* Check if filters have to be loaded and load them if so - * Maybe should this check be done only if a filter is going to be applied - * for this texture? */ - if (!cfs->filtersLoaded) - cfs->loadFilters (texture); - - /* Filter texture if : - * o GL_ARB_fragment_program available - * o Filters are loaded - * o Texture's window is filtered */ - /* Note : if required, filter window contents only and not decorations - * (use that w->texture->name != texture->name for decorations) */ - if (shouldFilter) // ??? + if (shouldFilter) { - GLFragment::Attrib fa = attrib; if (cfs->currentFilter == 0) /* Cumulative filters mode */ { /* Enable each filter one by one */ - foreach (ColorfilterFunction *func, cfs->filtersFunctions) + foreach (std::shared_ptr func, cfs->filtersFunctions) { - function = func->id; - if (function) - fa.addFunction (function); + if (func->loaded ()) + gWindow->addShaders (func->name, "", func->shader); } } /* Single filter mode */ @@ -331,30 +347,13 @@ ColorfilterWindow::glDrawTexture (GLTexture *texture, { /* Enable the currently selected filter if possible (i.e. if it * was successfully loaded) */ - function = cfs->filtersFunctions.at (cfs->currentFilter - 1)->id; - if (function) - fa.addFunction (function); + std::shared_ptr func = cfs->filtersFunctions.at (cfs->currentFilter - 1); + if (func && func->loaded ()) + gWindow->addShaders (func->name, "", func->shader); } - gWindow->glDrawTexture (texture, fa, mask); - } - else /* Not filtering */ - { - gWindow->glDrawTexture (texture, attrib, mask); } -} -/* - * Filter windows when they are open if they match the filtering rules - */ -void -ColorfilterScreen::windowAdd (CompWindow *w) -{ - FILTER_WINDOW (w); - - /* cfw->isFiltered is initialized to false in InitWindow, so we only - have to toggle it to true if necessary */ - if (cfw->isFiltered && optionGetFilterMatch ().evaluate (w)) - cfw->toggle (); + gWindow->glDrawTexture (texture, transform, attrib, mask); } /* Internal stuff ----------------------------------------------------------- */ @@ -408,9 +407,7 @@ void ColorfilterScreen::filtersChanged (CompOption *opt, ColorfilterOptions::Options num) { - /* Just set the filtersLoaded boolean to false, unloadFilters will be - * called in loadFilters */ - filtersLoaded = false; + loadFilters (); } /* @@ -428,8 +425,7 @@ ColorfilterScreen::ColorfilterScreen (CompScreen *screen) : cScreen (CompositeScreen::get (screen)), gScreen (GLScreen::get (screen)), isFiltered (false), - currentFilter (0), - filtersLoaded (false) + currentFilter (0) { optionSetToggleWindowKeyInitiate (boost::bind ( &ColorfilterScreen::toggleWindow, this, _1, _2, @@ -453,11 +449,12 @@ ColorfilterScreen::ColorfilterScreen (CompScreen *screen) : optionSetFilterDecorationsNotify (boost::bind ( &ColorfilterScreen::damageDecorations, this, _1, _2)); + + loadFilters (); }; ColorfilterScreen::~ColorfilterScreen () { - writeSerializedData (); unloadFilters (); } @@ -469,17 +466,19 @@ ColorfilterWindow::ColorfilterWindow (CompWindow *window) : isFiltered (false) { GLWindowInterface::setHandler (gWindow, false); -} -ColorfilterWindow::~ColorfilterWindow () -{ - writeSerializedData (); + FILTER_SCREEN (screen); + + /* Filter windows when they are open if the screen is filtered and they + * match the filtering rules */ + if (cfs->isFiltered && cfs->optionGetFilterMatch ().evaluate (window)) + toggle (); } bool ColorfilterPluginVTable::init () { - if (!GL::fragmentProgram) + if (!GL::shaders) compLogMessage ("colorfilter", CompLogLevelWarn, "No fragment" \ "support, the plugin will continue to load but nothing"\ "will happen"); diff --git a/plugins/colorfilter/src/colorfilter.h b/plugins/colorfilter/src/colorfilter.h index 5c1232d5a..e1e5195b5 100644 --- a/plugins/colorfilter/src/colorfilter.h +++ b/plugins/colorfilter/src/colorfilter.h @@ -37,8 +37,17 @@ class ColorfilterFunction { public: - GLFragment::FunctionId id; - CompString name; + CompString shader; + CompString name; + + ColorfilterFunction (const CompString &name); + + bool load (CompString fname); + bool loaded () const { return !shader.empty (); } + + private: + + void programCleanName (CompString &name); }; class ColorfilterScreen : @@ -57,20 +66,11 @@ class ColorfilterScreen : int currentFilter; /* 0 : cumulative mode 0 < c <= count : single mode */ - /* The plugin can not immediately load the filters because it needs to - * know what texture target it will use : when required, this boolean - * is set to TRUE and filters will be loaded on next filtered window - * texture painting */ - - bool filtersLoaded; - std::vector filtersFunctions; + std::vector > filtersFunctions; - ColorfilterFunction * - findFragmentFunction (int id); - void toggle (); - + void switchFilter (); @@ -93,10 +93,7 @@ class ColorfilterScreen : unloadFilters (); int - loadFilters (GLTexture *texture); - - void - windowAdd (CompWindow *w); + loadFilters (); void matchsChanged (CompOption *opt, @@ -113,10 +110,6 @@ class ColorfilterScreen : void damageDecorations (CompOption *opt, ColorfilterOptions::Options num); - - - - }; #define FILTER_SCREEN(s) \ @@ -129,7 +122,6 @@ class ColorfilterWindow : public: ColorfilterWindow (CompWindow *); - ~ColorfilterWindow (); CompWindow *window; CompositeWindow *cWindow; @@ -138,9 +130,10 @@ class ColorfilterWindow : bool isFiltered; void - glDrawTexture (GLTexture *texture, - GLFragment::Attrib &attrib, - unsigned int mask); + glDrawTexture (GLTexture *texture, + const GLMatrix &transform, + const GLWindowPaintAttrib &attrib, + unsigned int mask); void toggle (); diff --git a/plugins/colorfilter/src/parser.cpp b/plugins/colorfilter/src/parser.cpp deleted file mode 100644 index fa317281e..000000000 --- a/plugins/colorfilter/src/parser.cpp +++ /dev/null @@ -1,538 +0,0 @@ -/* - * Compiz fragment program parser - * - * parser.cpp - * - * This should be usable on almost any plugin that wishes to parse fragment - * program files separately, maybe it should become a separate plugin? - * - * Author : Guillaume Seguin - * Email : guillaume@segu.in - * - * Copyright (c) 2007 Guillaume Seguin - * - * Port to std::string: - * Copyright (c) 2010 Canonical Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, - * Fifth Floor, Boston, MA 02110-1301, USA. - */ - - -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif - -#include -#include -#include -#include -#include "parser.h" - -/* - * Left trimming function - */ -CompString -FragmentParser::ltrim (const CompString &string) -{ - size_t pos = 0; - while (!(pos >= string.size ())) - { - if (isspace (string.at (pos))) - pos++; - else - break; - } - - return string.substr (pos); -} - -/* General fragment program related functions ----------------------- */ - -/* - * Clean program name string - */ -void -FragmentParser::programCleanName (CompString &name) -{ - unsigned int pos = 0; - - /* Replace every non alphanumeric char by '_' */ - while (!(pos >= name.size ())) - { - if (!isalnum (name.at (pos))) - name[pos] = '_'; - - pos++; - } -} - -/* - * File reader function - */ -CompString -FragmentParser::programReadSource (const CompString &fname) -{ - std::ifstream fp; - int length; - char *buffer; - CompString data, path, home = CompString (getenv ("HOME")); - - /* Try to open file fname as is */ - fp.open (fname.c_str ()); - - /* If failed, try as user filter file (in ~/.compiz/data/filters) */ - if (!fp.is_open () && !home.empty ()) - { - path = home + "/.compiz/data/filters/" + fname; - fp.open (path.c_str ()); - } - - /* If failed again, try as system wide data file - * (in PREFIX/share/compiz/filters) */ - if (!fp.is_open ()) - { - path = CompString (DATADIR) + "/data/filters/" + fname; - fp.open (path.c_str ()); - } - - /* If failed again & again, abort */ - if (!fp.is_open ()) - { - return CompString (""); - } - - /* get length of file: */ - fp.seekg (0, std::ios::end); - length = fp.tellg (); - length++; - fp.seekg (0, std::ios::beg); - - /* allocate memory */ - buffer = new char [length]; - - /* read data as a block: */ - fp.read (buffer, length - 1); - buffer[length - 1] = '\0'; - fp.close (); - - data = buffer; - - delete[] buffer; - - return data; -} - -/* - * Get the first "argument" in the given string, trimmed - * and move source string pointer after the end of the argument. - * For instance in string " foo, bar" this function will return "foo". - * - * This function returns NULL if no argument found - * or a malloc'ed string that will have to be freed later. - */ -CompString -FragmentParser::getFirstArgument (const CompString &line, - size_t &pos) -{ - CompString arg; - CompString string; - size_t next, orig; - int length; - CompString retArg; - - if (pos >= line.size ()) - return CompString (""); - - /* Left trim */ - string = FragmentParser::ltrim (line.substr (pos)); - - orig = pos; - pos = 0; - - /* Find next comma or semicolon (which isn't that useful since we - * are working on tokens delimited by semicolons) */ - if ((next = string.find (",", pos)) != std::string::npos || - (next = string.find (";", pos)) != std::string::npos) - { - size_t temp; - length = next - pos; - if (!length) - { - pos = orig + 1; - return getFirstArgument (line, pos); - } - if ((temp = string.find ("{", pos) != std::string::npos) && temp < next && - (temp = string.find ("}", pos) != std::string::npos) && temp > next) - { - if ((next = string.find (",", temp)) != std::string::npos || - (next = string.find (";", temp)) != std::string::npos) - length = next - pos; - else - length = string.substr (pos).size (); - } - } - else - length = string.substr (pos).size (); - - /* Allocate, copy and end string */ - arg = string.substr (pos, length); - - /* Increment source pointer */ - if ((orig + arg.size () + 1) <= line.size ()) - pos += orig + arg.size () + 1; - else - pos = std::string::npos; - - return arg; -} - -/* Texture offset related functions ----------------------------------*/ - -/* - * Add a new fragment offset to the offsets stack from an ADD op string - */ -FragmentParser::FragmentOffset * -FragmentParser::programAddOffsetFromAddOp (const CompString &source) -{ - FragmentOffset offset; - CompString op; - size_t pos = 0; - CompString name; - CompString offsetString; - CompString temp; - std::list ::iterator it = offsets.begin (); - - if (source.size () < 5) - return NULL; - - op = source; - pos += 3; - name = getFirstArgument (op, pos); - if (name.empty ()) - return NULL; - - temp = getFirstArgument (op, pos); - - /* If an offset with the same name is - * already registered, skip this one */ - if ((!offsets.empty () && - !programFindOffset (it, name).empty ()) || - temp.empty ()) - return &(*it); - - /* Just use the end of the op as the offset */ - pos += 1; - offsetString = ltrim (op.substr (pos)); - if (offsetString.empty ()) - return NULL; - - offset.name = name; - offset.offset = offsetString; - - offsets.push_back (offset); - - return &(offsets.back ()); -} - -/* - * Find an offset according to its name - */ -CompString -FragmentParser::programFindOffset (std::list::iterator it, - const CompString &name) -{ - if (it->name == name) - return (*it).offset; - - return programFindOffset ((it++), name); -} - -/* - * Recursively free offsets stack - */ -void -FragmentParser::programFreeOffset () -{ - offsets.clear (); -} - -/* Actual parsing/loading functions ----------------------------------*/ - -/* - * Parse the source buffer op by op and add each op to function data - * - * FIXME : I am more than 200 lines long, I feel so heavy! - */ -void -FragmentParser::programParseSource (GLFragment::FunctionData *data, - int target, CompString &source) -{ - CompString line, next; - CompString current; - CompString strtok; - size_t pos = 0, strippos = 0; - int length, oplength, type; - - CompString arg1, arg2, temp; - - /* Find the header, skip it, and start parsing from there */ - - pos = source.find ("!!ARBfp1.0", pos); - if (pos != std::string::npos) - { - pos += 9; - } - - /* Strip comments */ - while ((strippos = source.find ("#", strippos)) != std::string::npos) - { - size_t carriagepos = source.find ("\n", strippos); - - if (carriagepos != std::string::npos) - { - source.erase (strippos, carriagepos - strippos); - strippos = 0; - } - else - source = source.substr (0, strippos); - } - - strippos = 0; - - /* Strip linefeeds */ - while ((strippos = source.find ("\n", strippos)) != std::string::npos) - source[strippos] = ' '; - - /* Parse each instruction */ - while (!(pos >= (source.size () - 1))) - { - size_t nPos = source.find (";", pos + 1); - line = source.substr (pos + 1, nPos - pos); - CompString origcurrent = current = ltrim (line); - /* Find instruction type */ - type = NoOp; - - /* Data ops */ - if (current.substr (0, 3) == "END") - type = NoOp; - else if (current.substr (0, 3) == "ABS" || - current.substr (0, 3) == "CMP" || - current.substr (0, 3) == "COS" || - current.substr (0, 3) == "DP3" || - current.substr (0, 3) == "DP4" || - current.substr (0, 3) == "EX2" || - current.substr (0, 3) == "FLR" || - current.substr (0, 3) == "FRC" || - current.substr (0, 3) == "KIL" || - current.substr (0, 3) == "LG2" || - current.substr (0, 3) == "LIT" || - current.substr (0, 3) == "LRP" || - current.substr (0, 3) == "MAD" || - current.substr (0, 3) == "MAX" || - current.substr (0, 3) == "MIN" || - current.substr (0, 3) == "POW" || - current.substr (0, 3) == "RCP" || - current.substr (0, 3) == "RSQ" || - current.substr (0, 3) == "SCS" || - current.substr (0, 3) == "SIN" || - current.substr (0, 3) == "SGE" || - current.substr (0, 3) == "SLT" || - current.substr (0, 3) == "SUB" || - current.substr (0, 3) == "SWZ" || - current.substr (0, 3) == "TXP" || - current.substr (0, 3) == "TXB" || - current.substr (0, 3) == "XPD") - type = DataOp; - else if (current.substr (0, 4) == "TEMP") - type = TempOp; - else if (current.substr (0, 5) == "PARAM") - type = ParamOp; - else if (current.substr (0, 6) == "ATTRIB") - type = AttribOp; - else if (current.substr (0, 3) == "TEX") - type = FetchOp; - else if (current.substr (0, 3) == "ADD") - { - if (current.find ("fragment.texcoord", 0) != std::string::npos) - programAddOffsetFromAddOp (current.c_str ()); - else - type = DataOp; - } - else if (current.substr (0, 3) == "MUL") - { - if (current.find ("fragment.color", 0) != std::string::npos) - type = ColorOp; - else - type = DataOp; - } - else if (current.substr (0, 3) == "MOV") - { - if (current.find ("result.color", 0) != std::string::npos) - type = ColorOp; - else - type = DataOp; - } - size_t cpos = 0; - switch (type) - { - /* Data op : just copy paste the - * whole instruction plus a ";" */ - case DataOp: - data->addDataOp (current.c_str ()); - break; - /* Parse arguments one by one */ - case TempOp: - case AttribOp: - case ParamOp: - { - if (type == TempOp) oplength = 4; - else if (type == ParamOp) oplength = 5; - else if (type == AttribOp) oplength = 6; - length = current.size (); - if (length < oplength + 2) break; - - cpos = oplength + 1; - - while (current.size () && !(cpos >= current.size ()) && - (arg1 = getFirstArgument (current, cpos)).size ()) - { - /* "output" is a reserved word, skip it */ - if (arg1.substr (0, 6) == "output") - continue; - /* Add ops */ - if (type == TempOp) - data->addTempHeaderOp (arg1.c_str ()); - else if (type == ParamOp) - data->addParamHeaderOp (arg1.c_str ()); - else if (type == AttribOp) - data->addAttribHeaderOp (arg1.c_str ()); - } - } - break; - case FetchOp: - { - /* Example : TEX tmp, coord, texture[0], RECT; - * "tmp" is dest name, while "coord" is either - * fragment.texcoord[0] or an offset */ - cpos += 3; - - if ((arg1 = getFirstArgument (current, cpos)).size ()) - { - if (!(temp = getFirstArgument (current, cpos)).size ()) - break; - - if (temp == "fragment.texcoord[0]") - data->addFetchOp (arg1.c_str (), NULL, target); - else if (!offsets.empty ()) - { - arg2 = programFindOffset ( - offsets.begin (), - temp); - if (arg2.size ()) - data->addFetchOp (arg1.c_str (), - arg2.c_str (), target); - } - } - } - break; - case ColorOp: - { - if (current.substr (0, 3) == "MUL") /* MUL op, 2 ops */ - { - /* Example : MUL output, fragment.color, output; - * MOV arg1, fragment.color, arg2 */ - cpos += 3; - - if (!(arg1 = getFirstArgument (current, cpos)).size ()) - { - break; - } - - if (!(temp = getFirstArgument (current, cpos)).size ()) - break; - - if (!(arg2 = getFirstArgument (current, cpos)).size ()) - break; - - data->addColorOp (arg1.c_str (), arg2.c_str ()); - } - else /* MOV op, 1 op */ - { - /* Example : MOV result.color, output; - * MOV result.color, arg1; */ - cpos = current.find (",") + 1; - - if ((arg1 = getFirstArgument (current, cpos)).size ()) - data->addColorOp ("output", arg1.c_str ()); - } - break; - } - default: - break; - } - pos = nPos; - } - programFreeOffset (); -} - -/* - * Build a Compiz Fragment Function from a source string - */ -GLFragment::FunctionId -FragmentParser::buildFragmentProgram (CompString &source, - const CompString &name, - int target) -{ - GLFragment::FunctionData *data; - int handle; - /* Create the function data */ - data = new GLFragment::FunctionData (); - if (!data) - return 0; - /* Parse the source and fill the function data */ - programParseSource (data, target, source); - /* Create the function */ - handle = data->createFragmentFunction (name.c_str ()); - delete data; - return handle; -} - -/* - * Load a source file and build a Compiz Fragment Function from it - */ -GLFragment::FunctionId -FragmentParser::loadFragmentProgram (const CompString &file, - CompString &name, - int target) -{ - CompString source; - GLFragment::FunctionId handle; - - /* Clean fragment program name */ - programCleanName (name); - /* Read the source file */ - source = programReadSource (file); - if (source.empty ()) - { - return 0; - } - - /* Build the Compiz Fragment Program */ - handle = buildFragmentProgram (source, - name, target); - - return handle; -} diff --git a/plugins/colorfilter/src/parser.h b/plugins/colorfilter/src/parser.h deleted file mode 100644 index 3e87545ae..000000000 --- a/plugins/colorfilter/src/parser.h +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Compiz fragment program parser - * - * parser.h - * - * This should be usable on almost any plugin that wishes to parse fragment - * program files separately, maybe it should become a separate plugin? - * - * Author : Guillaume Seguin - * Email : guillaume@segu.in - * - * Copyright (c) 2007 Guillaume Seguin - * - * Port to std::string: - * Copyright (c) 2010 Canonical Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include "colorfilter.h" - -class FragmentParser -{ - private: - - enum - { - NoOp, - DataOp, - StoreDataOp, - OffsetDataOp, - BlendDataOp, - FetchOp, - ColorOp, - LoadOp, - TempOp, - ParamOp, - AttribOp, - } OpType; - - class FragmentOffset - { - public: - - CompString name; - CompString offset; - }; - - std::list offsets; - - CompString - getFirstArgument (const CompString &line, - size_t &pos); - - void - programCleanName (CompString &name); - - CompString - programReadSource (const CompString &fname); - - FragmentOffset * - programAddOffsetFromAddOp (const CompString &source); - - CompString - programFindOffset (std::list::iterator it, - const CompString &name); - - void - programFreeOffset (); - - void - programParseSource (GLFragment::FunctionData *data, - int target, CompString &source); - - public: - - friend class FragmentString; - - static CompString - ltrim (const CompString &string); - - GLFragment::FunctionId - buildFragmentProgram (CompString &, - const CompString &, - int target); - - GLFragment::FunctionId - loadFragmentProgram (const CompString &file, - CompString &name, - int target); - - -}; -- GitLab From b21ceb04a09fabfbaceb6a90bcc450a5cbd013f1 Mon Sep 17 00:00:00 2001 From: ksamak Date: Sun, 9 Apr 2017 18:55:21 +0200 Subject: [PATCH 46/53] added packaging for colorfilter Conflicts: debian/compiz-plugins-default.install --- debian/compiz-plugins-default.install | 3 +++ 1 file changed, 3 insertions(+) diff --git a/debian/compiz-plugins-default.install b/debian/compiz-plugins-default.install index 69d157407..6eddc31a6 100644 --- a/debian/compiz-plugins-default.install +++ b/debian/compiz-plugins-default.install @@ -28,6 +28,9 @@ usr/lib/*/compiz/*mousetheme.* usr/share/compiz/*mousetheme.* usr/lib/*/compiz/*mousepoll.* usr/share/compiz/*mousepoll.* +usr/lib/*/compiz/*colorfilter.* +usr/share/compiz/*colorfilter.* +usr/share/compiz/colorfilter usr/lib/*/compiz/*move.* usr/share/compiz/*move.* usr/lib/*/compiz/*opengl.* -- GitLab From a02e011c1d3e7100f2dbc7646c16bba0fcb73a06 Mon Sep 17 00:00:00 2001 From: ksamak Date: Thu, 13 Apr 2017 22:00:55 +0200 Subject: [PATCH 47/53] removed mousetheme plugin --- debian/compiz-dev.install | 1 - debian/compiz-plugins-default.install | 2 - debian/patches/03_add_mousetheme_plugin | 702 ------------------ debian/patches/series | 1 - plugins/mousetheme/CMakeLists.txt | 29 - plugins/mousetheme/compiz-mousetheme.pc.in | 12 - .../include/mousetheme/mousetheme.h | 58 -- plugins/mousetheme/mousetheme.xml.in | 87 --- plugins/mousetheme/src/mousetheme.cpp | 291 -------- plugins/mousetheme/src/private.h | 75 -- 10 files changed, 1258 deletions(-) delete mode 100644 debian/patches/03_add_mousetheme_plugin delete mode 100644 plugins/mousetheme/CMakeLists.txt delete mode 100644 plugins/mousetheme/compiz-mousetheme.pc.in delete mode 100644 plugins/mousetheme/include/mousetheme/mousetheme.h delete mode 100644 plugins/mousetheme/mousetheme.xml.in delete mode 100644 plugins/mousetheme/src/mousetheme.cpp delete mode 100644 plugins/mousetheme/src/private.h diff --git a/debian/compiz-dev.install b/debian/compiz-dev.install index ebad0152e..f6d6d0526 100644 --- a/debian/compiz-dev.install +++ b/debian/compiz-dev.install @@ -9,7 +9,6 @@ debian/tmp/usr/lib/*/pkgconfig/compiz-opengl.pc debian/tmp/usr/lib/*/pkgconfig/compiz.pc debian/tmp/usr/lib/*/pkgconfig/compiz-scale.pc debian/tmp/usr/lib/*/pkgconfig/compiz-text.pc -debian/tmp/usr/lib/*/pkgconfig/compiz-mousetheme.pc debian/tmp/usr/share/compiz/xslt debian/tmp/usr/share/cmake*/FindCompiz.cmake debian/tmp/usr/share/cmake*/Modules/FindCompiz.cmake diff --git a/debian/compiz-plugins-default.install b/debian/compiz-plugins-default.install index 6eddc31a6..f905b589c 100644 --- a/debian/compiz-plugins-default.install +++ b/debian/compiz-plugins-default.install @@ -24,8 +24,6 @@ usr/lib/*/compiz/*imgpng.* usr/share/compiz/*imgpng.* usr/lib/*/compiz/*matecompat.* usr/share/compiz/*matecompat.* -usr/lib/*/compiz/*mousetheme.* -usr/share/compiz/*mousetheme.* usr/lib/*/compiz/*mousepoll.* usr/share/compiz/*mousepoll.* usr/lib/*/compiz/*colorfilter.* diff --git a/debian/patches/03_add_mousetheme_plugin b/debian/patches/03_add_mousetheme_plugin deleted file mode 100644 index 36870cde5..000000000 --- a/debian/patches/03_add_mousetheme_plugin +++ /dev/null @@ -1,702 +0,0 @@ -commit 1686311973195c02b44f89dd82fed1dbbfe3e60c -Author: ksamak -Date: Sat Feb 27 22:38:59 2016 +0100 - - added mouse theme plugin - -diff --git a/plugins/mousetheme/CMakeLists.txt b/plugins/mousetheme/CMakeLists.txt -new file mode 100644 -index 0000000..9834f3b ---- /dev/null -+++ b/plugins/mousetheme/CMakeLists.txt -@@ -0,0 +1,29 @@ -+find_package (Compiz REQUIRED) -+ -+PKG_CHECK_MODULES (X11 x11) -+INCLUDE_DIRECTORIES ( -+ ${X11_INCLUDE_DIRS} -+) -+ -+include (CompizPlugin) -+ -+check_library_exists(Xcursor XcursorImageCreate "" CAN_XCURSOR) -+if(CAN_XCURSOR) -+ set(ALLEGRO_XWINDOWS_WITH_XCURSOR 1) -+ find_library(XCURSOR_LIB "Xcursor") -+ list(APPEND X11_LIBRARIES "${XCURSOR_LIB}") -+else(CAN_XCURSOR) -+ message(FATAL_ERROR "X11 support requires Xcursor library.") -+endif(CAN_XCURSOR) -+ -+find_package(Boost 1.45.0 COMPONENTS system filesystem) -+if(Boost_FOUND) -+ include_directories(${Boost_INCLUDE_DIRS}) -+endif() -+ -+compiz_plugin (mousetheme) -+ -+TARGET_LINK_LIBRARIES( -+ mousetheme -+ ${X11_LIBRARIES} ${Boost_LIBRARIES} -+) -diff --git a/plugins/mousetheme/compiz-mousetheme.pc.in b/plugins/mousetheme/compiz-mousetheme.pc.in -new file mode 100644 -index 0000000..3bde61e ---- /dev/null -+++ b/plugins/mousetheme/compiz-mousetheme.pc.in -@@ -0,0 +1,12 @@ -+prefix=@prefix@ -+exec_prefix=@exec_prefix@ -+libdir=@libdir@ -+includedir=@includedir@ -+ -+Name: compiz-mousetheme -+Description: Mousetheme plugin for compiz -+Version: @VERSION@ -+ -+Requires: compiz -+Libs: -L${libdir}/compiz -lmousetheme -+Cflags: @COMPIZ_CFLAGS@ -I${includedir}/compiz -diff --git a/plugins/mousetheme/include/mousetheme/mousetheme.h b/plugins/mousetheme/include/mousetheme/mousetheme.h -new file mode 100644 -index 0000000..d9159e1 ---- /dev/null -+++ b/plugins/mousetheme/include/mousetheme/mousetheme.h -@@ -0,0 +1,58 @@ -+/* -+ * -+ * Compiz mouse cursor theming plugin -+ * -+ * Copyright : (C) 2015 by Hypra -+ * http://hypra.fr -+ * -+ * Copyright : (C) 2008 by Dennis Kasprzyk -+ * E-mail : onestone@opencompositing.org -+ * -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License -+ * as published by the Free Software Foundation; either version 2 -+ * of the License, or (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ */ -+ -+#ifndef _COMPIZ_MOUSETHEME_H -+#define _COMPIZ_MOUSETHEME_H -+ -+#define COMPIZ_MOUSETHEME_ABI 1 -+ -+class MouseThemer -+{ -+ public: -+ -+ typedef boost::function CallBack; -+ -+ MouseThemer (); -+ ~MouseThemer (); -+ -+ void -+ setCallback (CallBack callback); -+ -+ void -+ start (); -+ -+ void -+ stop (); -+ -+ bool -+ active (); -+ -+ private: -+ -+ bool mActive; -+ CallBack mCallback; -+ -+ friend class MousethemeScreen; -+}; -+ -+#endif -diff --git a/plugins/mousetheme/mousetheme.xml.in b/plugins/mousetheme/mousetheme.xml.in -new file mode 100644 -index 0000000..2aea05d ---- /dev/null -+++ b/plugins/mousetheme/mousetheme.xml.in -@@ -0,0 +1,63 @@ -+ -+ -+ -+ <_short>Mouse cursor theme -+ <_long>Change how cursors look like -+ Desktop -+ -+ -+ -+ -+ <_short>Shell commands -+ -+ -+ -+ <_short>Internal dirty stuff -+ -+ -+ -+ -+ -diff --git a/plugins/mousetheme/src/mousetheme.cpp b/plugins/mousetheme/src/mousetheme.cpp -new file mode 100644 -index 0000000..5bf7d97 ---- /dev/null -+++ b/plugins/mousetheme/src/mousetheme.cpp -@@ -0,0 +1,279 @@ -+/* -+ * -+ * Compiz mouse cursor theming plugin -+ * -+ * mousetheme.cpp -+ * -+ * Copyright : (C) 2015 by Hypra -+ * http://hypra.fr -+ * -+ * Copyright : (C) 2008 by Dennis Kasprzyk -+ * E-mail : onestone@opencompositing.org -+ * -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License -+ * as published by the Free Software Foundation; either version 2 -+ * of the License, or (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ */ -+ -+#ifdef HAVE_CONFIG_H -+#include -+#endif -+ -+#include -+ -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+ -+#include "private.h" -+ -+COMPIZ_PLUGIN_20090315 (mousetheme, MousethemePluginVTable); -+ -+void -+MouseThemer::setCallback (MouseThemer::CallBack callback) -+{ -+ bool wasActive = mActive; -+ -+ if (mActive) -+ stop (); -+ -+ mCallback = callback; -+ -+ if (wasActive) -+ start (); -+} -+ -+void -+MouseThemer::start () -+{ -+ MOUSETHEME_SCREEN (screen); -+ -+ if (!ms) -+ { -+ compLogMessage ("mousetheme", CompLogLevelWarn, -+ "Plugin version mismatch, can't start mouse themer."); -+ -+ return; -+ } -+ -+ if (mCallback.empty ()) -+ { -+ compLogMessage ("mousetheme", CompLogLevelWarn, -+ "Can't start mouse themer without callback."); -+ return; -+ } -+ -+ //ms->availableThemesUpdate (); -+ ms->everythingUpdate (); -+ -+ mActive = true; -+} -+ -+void -+MouseThemer::stop () -+{ -+ MOUSETHEME_SCREEN (screen); -+ -+ /* Prevent broken plugins from calling stop () twice */ -+ -+ if (!mActive) -+ return; -+ -+ if (!ms) -+ { -+ compLogMessage ("mousetheme", -+ CompLogLevelWarn, -+ "Plugin version mismatch, can't stop mouse themer."); -+ return; -+ } -+ -+ mActive = false; -+} -+ -+bool -+MouseThemer::active () -+{ -+ return mActive; -+} -+ -+MouseThemer::MouseThemer () : -+ mActive (false), -+ mCallback (NULL) -+{ -+} -+ -+MouseThemer::~MouseThemer () -+{ -+ if (mActive) -+ stop (); -+} -+ -+template class PluginClassHandler ; -+ -+MousethemeScreen::MousethemeScreen (CompScreen *cscreen) : -+ PluginClassHandler (cscreen) -+ , previousTheme ("") // an intentionally invalid initial value -+{ -+ optionSetCursorThemeNotify (boost::bind (&MousethemeScreen::themeUpdate, this)); -+ optionSetCursorSizeNotify (boost::bind (&MousethemeScreen::everythingUpdate, this)); -+ optionSetCommandNotify (boost::bind (&MousethemeScreen::everythingUpdate, this)); -+} -+ -+const std::vector -+MousethemeScreen::availableThemes () -+{ -+ std::vector res; -+ char *path_from_variable = std::getenv ("XCURSOR_PATH"); -+ std::string path -+ = path_from_variable ? path_from_variable : "/usr/share/icons"; -+ boost::char_separator separator(":"); -+ boost::tokenizer > tokens(path, separator); -+ foreach (const std::string& directory, tokens) -+ { -+ if (! boost::filesystem::is_directory (directory)) -+ continue; -+ const boost::filesystem::directory_iterator end; -+ for (boost::filesystem::directory_iterator dir_itr (directory); -+ dir_itr != end; -+ ++dir_itr) -+ { -+ std::string candidate_path = dir_itr->path ().generic_string (); -+ std::string candidate_path_cursors = candidate_path + "/cursors"; -+ if (! boost::filesystem::exists (candidate_path_cursors) -+ || ! boost::filesystem::is_directory (candidate_path_cursors)) -+ continue; -+ res.push_back (dir_itr->path ().filename ().generic_string ()); -+ } // for -+ } -+ std::sort (res.begin(), res.end()); -+ return res; -+} -+ -+void -+MousethemeScreen::availableThemesUpdate () -+{ -+ // Check if the installed themes are still the same as the ones saved in -+ // the "available_themes" option (normalized by sorting). -+ std::string new_available_themes_as_string; -+ std::vector new_available_themes = availableThemes (); -+ foreach (const std::string &s, new_available_themes) -+ new_available_themes_as_string += s + ";"; -+ -+ // If they are still the same we have nothing to do. -+ if (optionGetAvailableThemes () == new_available_themes_as_string) -+ return; -+ -+ // The installed themes have changed since the last time. Update -+ // "available_themes" option so as not to redo this next time... -+ CompOption::Value value; -+ value.set (CompString(new_available_themes_as_string)); -+ screen->setOptionForPlugin ("mousetheme", "available_themes", value); -+ -+ // ...And propose the themes as alternatives among which to choose -+ // "theme". -+ CompOption::Value::Vector vector_value; -+ foreach (const std::string &s, new_available_themes) -+ vector_value.push_back (s); -+ value.set (CompOption::TypeString, vector_value); -+ screen->setOptionForPlugin ("mousetheme", "theme", value); -+} -+ -+void MousethemeScreen::actuallyUpdateCursorTheme (const std::string &theme, int cursor_size, const std::string &command) { -+ Display *display = screen->dpy (); -+ // FIXME: I'm assuming that Compiz manages *all* screens. -+ int screen_no = ScreenCount (display); -+ if (! XcursorSetTheme (display, theme.c_str ())) { -+ std::cerr << "Warning: ignoring invalid cursor theme \"" << theme -+ << "\"\n"; -+ if (! XcursorSetTheme (display, NULL)) { -+ std::cerr << "Warning: setting the default theme failed as well. " -+ << "Hell will break loose.\n"; -+ } -+ } -+ XcursorSetDefaultSize (display, cursor_size); -+ -+ Cursor normalCursor -+ = XcursorLibraryLoadCursor (display, "left_ptr"); -+ Cursor busyCursor -+ = XcursorLibraryLoadCursor (display, "watch"); -+ screen->setNormalCursor (normalCursor); -+ screen->setBusyCursor (busyCursor); -+ -+ int screen; -+ for (screen = 0; screen < screen_no; screen ++) -+ { -+ Window root = XRootWindow (display, screen); -+ int pointer_id; -+ XIGetClientPointer (display, None, &pointer_id); -+ XIDefineCursor (display, pointer_id, root, normalCursor); -+ } // for -+ XFlush (display); -+ -+ std::string complete_command -+ = "export THEME=\"" + theme + "\"; " -+ + std::string("export SIZE=\"") -+ + boost::lexical_cast (cursor_size) + "\"; " -+ + command; -+ int res = std::system (complete_command.c_str ()); -+ if (res != 0) -+ std::cerr << "WARNING: std::system failed!\n"; -+} -+ -+std::string MousethemeScreen::currentTheme() { -+ const int& theme = optionGetCursorTheme (); -+ switch(theme) { -+ case 0: -+ return std::string("default"); -+ case 1: -+ return std::string("ContrastHigh"); -+ default: -+ return std::string("default"); -+ } -+} -+ -+bool -+MousethemeScreen::everythingUpdate () -+{ -+ std::string theme = currentTheme (); -+ int cursor_size = optionGetCursorSize (); -+ std::string command = optionGetCommand (); -+ -+ actuallyUpdateCursorTheme (theme, cursor_size, command); -+ -+ return true; -+} -+ -+bool -+MousethemeScreen::themeUpdate () -+{ -+ // Do nothing unless the *first* item in the list changed. -+ std::string theme = currentTheme (); -+ if (previousTheme == theme) -+ return false; -+ -+ previousTheme = theme; -+ everythingUpdate (); -+ return true; -+} -+ -+bool -+MousethemePluginVTable::init () -+{ -+ if (CompPlugin::checkPluginABI ("core", CORE_ABIVERSION)) -+ return true; -+ -+ return false; -+} -diff --git a/plugins/mousetheme/src/private.h b/plugins/mousetheme/src/private.h -new file mode 100644 -index 0000000..95f097a ---- /dev/null -+++ b/plugins/mousetheme/src/private.h -@@ -0,0 +1,75 @@ -+/* -+ * -+ * Compiz mouse cursor theming plugin -+ * -+ * private.h -+ * -+ * Copyright : (C) 2015 by Hypra -+ * http://hypra.fr -+ * -+ * Copyright : (C) 2008 by Dennis Kasprzyk -+ * E-mail : onestone@opencompositing.org -+ * -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License -+ * as published by the Free Software Foundation; either version 2 -+ * of the License, or (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ */ -+ -+#include -+#include -+#include -+ -+#include -+ -+#include "mousetheme_options.h" -+ -+typedef enum _MousethemeOptions -+{ -+ MP_DISPLAY_OPTION_NUM -+} MousethemeDisplayOptions; -+ -+class MousethemeScreen; -+extern template class PluginClassHandler ; -+ -+class MousethemeScreen : -+ public PluginClassHandler , -+ public MousethemeOptions -+{ -+ public: -+ std::string previousTheme; -+ std::vector theAvailableThemes; -+ -+ const std::vector availableThemes (); -+ -+ void availableThemesUpdate (); -+ std::string currentTheme (); -+ void actuallyUpdateCursorTheme (const std::string &theme, -+ int cursor_size, -+ const std::string &command); -+ -+ MousethemeScreen (CompScreen *screen); -+ -+ bool everythingUpdate (); -+ bool themeUpdate (); -+}; -+ -+#define MOUSETHEME_SCREEN(s) \ -+ MousethemeScreen *ms = MousethemeScreen::get (s) -+ -+#define NUM_OPTIONS(s) (sizeof ((s)->opt) / sizeof (CompOption)) -+ -+class MousethemePluginVTable : -+ public CompPlugin::VTableForScreen -+{ -+ public: -+ -+ bool init (); -+}; - -commit 957020fec9e3f252db7255d6be673466186e926e -Author: ksamak -Date: Sun Feb 28 00:57:09 2016 +0100 - - bugfix incomplete function defs - -diff --git a/debian/compiz-dev.install b/debian/compiz-dev.install -index f6d6d05..ebad015 100644 ---- a/debian/compiz-dev.install -+++ b/debian/compiz-dev.install -@@ -9,6 +9,7 @@ debian/tmp/usr/lib/*/pkgconfig/compiz-opengl.pc - debian/tmp/usr/lib/*/pkgconfig/compiz.pc - debian/tmp/usr/lib/*/pkgconfig/compiz-scale.pc - debian/tmp/usr/lib/*/pkgconfig/compiz-text.pc -+debian/tmp/usr/lib/*/pkgconfig/compiz-mousetheme.pc - debian/tmp/usr/share/compiz/xslt - debian/tmp/usr/share/cmake*/FindCompiz.cmake - debian/tmp/usr/share/cmake*/Modules/FindCompiz.cmake -diff --git a/debian/compiz-plugins-default.install b/debian/compiz-plugins-default.install -index cdb3320..69d1574 100644 ---- a/debian/compiz-plugins-default.install -+++ b/debian/compiz-plugins-default.install -@@ -24,6 +24,8 @@ usr/lib/*/compiz/*imgpng.* - usr/share/compiz/*imgpng.* - usr/lib/*/compiz/*matecompat.* - usr/share/compiz/*matecompat.* -+usr/lib/*/compiz/*mousetheme.* -+usr/share/compiz/*mousetheme.* - usr/lib/*/compiz/*mousepoll.* - usr/share/compiz/*mousepoll.* - usr/lib/*/compiz/*move.* -diff --git a/debian/control b/debian/control -index c8827ae..7d1a58b 100644 ---- a/debian/control -+++ b/debian/control -@@ -16,6 +16,7 @@ Build-Depends: cmake (>= 2.8.5), - libegl1-mesa-dev [armhf armel], libgles2-mesa-dev [armhf armel], - libboost-dev, - libboost-serialization-dev, -+ libboost-filesystem-dev, - libglib2.0-dev, - libglibmm-2.4-dev, - libgtk-3-dev, -diff --git a/include/core/screen.h b/include/core/screen.h -index 4a7c847..213f897 100644 ---- a/include/core/screen.h -+++ b/include/core/screen.h -@@ -395,6 +395,8 @@ public: - virtual const char * displayString () = 0; - virtual CompRect getCurrentOutputExtents () = 0; - virtual Cursor normalCursor () = 0; -+ virtual void setNormalCursor (Cursor c) = 0; -+ virtual void setBusyCursor (Cursor c) = 0; - virtual Cursor cursorCache (unsigned int cursorName) = 0; - virtual bool grabbed () = 0; - virtual SnDisplay * snDisplay () = 0; -diff --git a/src/privatescreen.h b/src/privatescreen.h -index 94a826c..609beb2 100644 ---- a/src/privatescreen.h -+++ b/src/privatescreen.h -@@ -630,6 +630,10 @@ class PrivateScreen : - XButtonEvent *event, - CompOption::Vector &arguments); - -+ void setNormalCursor (Cursor c); -+ -+ void setBusyCursor (Cursor c); -+ - bool shouldTriggerKeyPressAction (CompAction *action, - XKeyEvent *event); - -@@ -779,6 +783,8 @@ public: - Window wmSnSelectionWindow; - - int clientPointerDeviceId; -+ Cursor normalCursor; -+ Cursor busyCursor; - Cursor invisibleCursor; - std::vector cursors; - CompRect workArea; -@@ -970,6 +976,8 @@ class CompScreenImpl : public CompScreen, - void unhookServerWindow (CompWindow *w); - - Cursor normalCursor (); -+ void setNormalCursor (Cursor c); -+ void setBusyCursor (Cursor c); - Cursor invisibleCursor (); - Cursor cursorCache (unsigned int cursorName); - -diff --git a/src/screen.cpp b/src/screen.cpp -index e17613f..7265d83 100644 ---- a/src/screen.cpp -+++ b/src/screen.cpp -@@ -47,6 +47,7 @@ - #include - #define foreach BOOST_FOREACH - -+#include // for None - #include - #include - #include -@@ -633,6 +634,22 @@ CompScreenImpl::displayString () - } - - void -+PrivateScreen::setNormalCursor (Cursor c) -+{ -+ if (normalCursor != None) -+ XFreeCursor (dpy, normalCursor); -+ normalCursor = c; -+} -+ -+void -+PrivateScreen::setBusyCursor (Cursor c) -+{ -+ if (busyCursor != None) -+ XFreeCursor (dpy, busyCursor); -+ busyCursor = c; -+} -+ -+void - PrivateScreen::updateScreenInfo () - { - if (xineramaExtension) -@@ -3089,6 +3106,18 @@ CompScreenImpl::normalCursor () - return privateScreen.cursorCache (normalCursorName); - } - -+void -+CompScreenImpl::setNormalCursor (Cursor c) -+{ -+ privateScreen.setNormalCursor (c); -+} -+ -+void -+CompScreenImpl::setBusyCursor (Cursor c) -+{ -+ privateScreen.setBusyCursor (c); -+} -+ - Cursor - CompScreenImpl::invisibleCursor () - { diff --git a/debian/patches/series b/debian/patches/series index 5f71d16b0..b55a9407a 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,4 +1,3 @@ 99_add_hypra_changelog -03_add_mousetheme_plugin 02_add_bell_plugin 01_add_vertical_guides_to_showMouse diff --git a/plugins/mousetheme/CMakeLists.txt b/plugins/mousetheme/CMakeLists.txt deleted file mode 100644 index 9834f3b89..000000000 --- a/plugins/mousetheme/CMakeLists.txt +++ /dev/null @@ -1,29 +0,0 @@ -find_package (Compiz REQUIRED) - -PKG_CHECK_MODULES (X11 x11) -INCLUDE_DIRECTORIES ( - ${X11_INCLUDE_DIRS} -) - -include (CompizPlugin) - -check_library_exists(Xcursor XcursorImageCreate "" CAN_XCURSOR) -if(CAN_XCURSOR) - set(ALLEGRO_XWINDOWS_WITH_XCURSOR 1) - find_library(XCURSOR_LIB "Xcursor") - list(APPEND X11_LIBRARIES "${XCURSOR_LIB}") -else(CAN_XCURSOR) - message(FATAL_ERROR "X11 support requires Xcursor library.") -endif(CAN_XCURSOR) - -find_package(Boost 1.45.0 COMPONENTS system filesystem) -if(Boost_FOUND) - include_directories(${Boost_INCLUDE_DIRS}) -endif() - -compiz_plugin (mousetheme) - -TARGET_LINK_LIBRARIES( - mousetheme - ${X11_LIBRARIES} ${Boost_LIBRARIES} -) diff --git a/plugins/mousetheme/compiz-mousetheme.pc.in b/plugins/mousetheme/compiz-mousetheme.pc.in deleted file mode 100644 index 3bde61e48..000000000 --- a/plugins/mousetheme/compiz-mousetheme.pc.in +++ /dev/null @@ -1,12 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: compiz-mousetheme -Description: Mousetheme plugin for compiz -Version: @VERSION@ - -Requires: compiz -Libs: -L${libdir}/compiz -lmousetheme -Cflags: @COMPIZ_CFLAGS@ -I${includedir}/compiz diff --git a/plugins/mousetheme/include/mousetheme/mousetheme.h b/plugins/mousetheme/include/mousetheme/mousetheme.h deleted file mode 100644 index d9159e125..000000000 --- a/plugins/mousetheme/include/mousetheme/mousetheme.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * - * Compiz mouse cursor theming plugin - * - * Copyright : (C) 2015 by Hypra - * http://hypra.fr - * - * Copyright : (C) 2008 by Dennis Kasprzyk - * E-mail : onestone@opencompositing.org - * - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - */ - -#ifndef _COMPIZ_MOUSETHEME_H -#define _COMPIZ_MOUSETHEME_H - -#define COMPIZ_MOUSETHEME_ABI 1 - -class MouseThemer -{ - public: - - typedef boost::function CallBack; - - MouseThemer (); - ~MouseThemer (); - - void - setCallback (CallBack callback); - - void - start (); - - void - stop (); - - bool - active (); - - private: - - bool mActive; - CallBack mCallback; - - friend class MousethemeScreen; -}; - -#endif diff --git a/plugins/mousetheme/mousetheme.xml.in b/plugins/mousetheme/mousetheme.xml.in deleted file mode 100644 index c9b3bc06e..000000000 --- a/plugins/mousetheme/mousetheme.xml.in +++ /dev/null @@ -1,87 +0,0 @@ - - - - <_short>Mouse cursor theme - <_long>Change how cursors look like - Desktop - - - - - <_short>Shell commands - - - - <_short>Internal dirty stuff - - - - - diff --git a/plugins/mousetheme/src/mousetheme.cpp b/plugins/mousetheme/src/mousetheme.cpp deleted file mode 100644 index 90b3a980a..000000000 --- a/plugins/mousetheme/src/mousetheme.cpp +++ /dev/null @@ -1,291 +0,0 @@ -/* - * - * Compiz mouse cursor theming plugin - * - * mousetheme.cpp - * - * Copyright : (C) 2015 by Hypra - * http://hypra.fr - * - * Copyright : (C) 2008 by Dennis Kasprzyk - * E-mail : onestone@opencompositing.org - * - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include - -#include -#include -#include - -#include -#include -#include -#include - -#include "private.h" - -COMPIZ_PLUGIN_20090315 (mousetheme, MousethemePluginVTable); - -void -MouseThemer::setCallback (MouseThemer::CallBack callback) -{ - bool wasActive = mActive; - - if (mActive) - stop (); - - mCallback = callback; - - if (wasActive) - start (); -} - -void -MouseThemer::start () -{ - MOUSETHEME_SCREEN (screen); - - if (!ms) - { - compLogMessage ("mousetheme", CompLogLevelWarn, - "Plugin version mismatch, can't start mouse themer."); - - return; - } - - if (mCallback.empty ()) - { - compLogMessage ("mousetheme", CompLogLevelWarn, - "Can't start mouse themer without callback."); - return; - } - - //ms->availableThemesUpdate (); - ms->everythingUpdate (); - - mActive = true; -} - -void -MouseThemer::stop () -{ - MOUSETHEME_SCREEN (screen); - - /* Prevent broken plugins from calling stop () twice */ - - if (!mActive) - return; - - if (!ms) - { - compLogMessage ("mousetheme", - CompLogLevelWarn, - "Plugin version mismatch, can't stop mouse themer."); - return; - } - - mActive = false; -} - -bool -MouseThemer::active () -{ - return mActive; -} - -MouseThemer::MouseThemer () : - mActive (false), - mCallback (NULL) -{ -} - -MouseThemer::~MouseThemer () -{ - if (mActive) - stop (); -} - -template class PluginClassHandler ; - -MousethemeScreen::MousethemeScreen (CompScreen *cscreen) : - PluginClassHandler (cscreen) - , previousTheme ("") // an intentionally invalid initial value -{ - optionSetCursorThemeNotify (boost::bind (&MousethemeScreen::themeUpdate, this)); - optionSetCursorSizeNotify (boost::bind (&MousethemeScreen::everythingUpdate, this)); - optionSetCommandNotify (boost::bind (&MousethemeScreen::everythingUpdate, this)); -} - -const std::vector -MousethemeScreen::availableThemes () -{ - std::vector res; - char *path_from_variable = std::getenv ("XCURSOR_PATH"); - std::string path - = path_from_variable ? path_from_variable : "/usr/share/icons"; - boost::char_separator separator(":"); - boost::tokenizer > tokens(path, separator); - foreach (const std::string& directory, tokens) - { - if (! boost::filesystem::is_directory (directory)) - continue; - const boost::filesystem::directory_iterator end; - for (boost::filesystem::directory_iterator dir_itr (directory); - dir_itr != end; - ++dir_itr) - { - std::string candidate_path = dir_itr->path ().generic_string (); - std::string candidate_path_cursors = candidate_path + "/cursors"; - if (! boost::filesystem::exists (candidate_path_cursors) - || ! boost::filesystem::is_directory (candidate_path_cursors)) - continue; - res.push_back (dir_itr->path ().filename ().generic_string ()); - } // for - } - std::sort (res.begin(), res.end()); - return res; -} - -void -MousethemeScreen::availableThemesUpdate () -{ - // Check if the installed themes are still the same as the ones saved in - // the "available_themes" option (normalized by sorting). - std::string new_available_themes_as_string; - std::vector new_available_themes = availableThemes (); - foreach (const std::string &s, new_available_themes) - new_available_themes_as_string += s + ";"; - - // If they are still the same we have nothing to do. - if (optionGetAvailableThemes () == new_available_themes_as_string) - return; - - // The installed themes have changed since the last time. Update - // "available_themes" option so as not to redo this next time... - CompOption::Value value; - value.set (CompString(new_available_themes_as_string)); - screen->setOptionForPlugin ("mousetheme", "available_themes", value); - - // ...And propose the themes as alternatives among which to choose - // "theme". - CompOption::Value::Vector vector_value; - foreach (const std::string &s, new_available_themes) - vector_value.push_back (s); - value.set (CompOption::TypeString, vector_value); - screen->setOptionForPlugin ("mousetheme", "theme", value); -} - -void MousethemeScreen::actuallyUpdateCursorTheme (const std::string &theme, int cursor_size, const std::string &command) { - Display *display = screen->dpy (); - // FIXME: I'm assuming that Compiz manages *all* screens. - int screen_no = ScreenCount (display); - if (! XcursorSetTheme (display, theme.c_str ())) { - std::cerr << "Warning: ignoring invalid cursor theme \"" << theme - << "\"\n"; - if (! XcursorSetTheme (display, NULL)) { - std::cerr << "Warning: setting the default theme failed as well. " - << "Hell will break loose.\n"; - } - } - XcursorSetDefaultSize (display, cursor_size); - - Cursor normalCursor - = XcursorLibraryLoadCursor (display, "left_ptr"); - Cursor busyCursor - = XcursorLibraryLoadCursor (display, "watch"); - screen->setNormalCursor (normalCursor); - screen->setBusyCursor (busyCursor); - - int screen; - for (screen = 0; screen < screen_no; screen ++) - { - Window root = XRootWindow (display, screen); - int pointer_id; - XIGetClientPointer (display, None, &pointer_id); - XIDefineCursor (display, pointer_id, root, normalCursor); - } // for - XFlush (display); - - std::string complete_command - = "export THEME=\"" + theme + "\"; " - + std::string("export SIZE=\"") - + boost::lexical_cast (cursor_size) + "\"; " - + command; - int res = std::system (complete_command.c_str ()); - if (res != 0) - std::cerr << "WARNING: std::system failed!\n"; -} - -std::string MousethemeScreen::currentTheme() { - const int& theme = optionGetCursorTheme (); - switch(theme) { - case 0: - return std::string("default"); - case 1: - return std::string("ContrastHigh"); - case 3: - return std::string("ComixCursors-Opaque-Green"); - case 4: - return std::string("ComixCursors-Opaque-Orange"); - case 5: - return std::string("ComixCursors-Opaque-Blue"); - case 6: - return std::string("ComixCursors-Opaque-Red"); - case 7: - return std::string("ComixCursors-Opaque-White"); - case 8: - return std::string("ComixCursors-Opaque-Black"); - default: - return std::string("default"); - } -} - -bool -MousethemeScreen::everythingUpdate () -{ - std::string theme = currentTheme (); - int cursor_size = optionGetCursorSize (); - std::string command = optionGetCommand (); - - actuallyUpdateCursorTheme (theme, cursor_size, command); - - return true; -} - -bool -MousethemeScreen::themeUpdate () -{ - // Do nothing unless the *first* item in the list changed. - std::string theme = currentTheme (); - if (previousTheme == theme) - return false; - - previousTheme = theme; - everythingUpdate (); - return true; -} - -bool -MousethemePluginVTable::init () -{ - if (CompPlugin::checkPluginABI ("core", CORE_ABIVERSION)) - return true; - - return false; -} diff --git a/plugins/mousetheme/src/private.h b/plugins/mousetheme/src/private.h deleted file mode 100644 index 95f097a96..000000000 --- a/plugins/mousetheme/src/private.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * - * Compiz mouse cursor theming plugin - * - * private.h - * - * Copyright : (C) 2015 by Hypra - * http://hypra.fr - * - * Copyright : (C) 2008 by Dennis Kasprzyk - * E-mail : onestone@opencompositing.org - * - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - */ - -#include -#include -#include - -#include - -#include "mousetheme_options.h" - -typedef enum _MousethemeOptions -{ - MP_DISPLAY_OPTION_NUM -} MousethemeDisplayOptions; - -class MousethemeScreen; -extern template class PluginClassHandler ; - -class MousethemeScreen : - public PluginClassHandler , - public MousethemeOptions -{ - public: - std::string previousTheme; - std::vector theAvailableThemes; - - const std::vector availableThemes (); - - void availableThemesUpdate (); - std::string currentTheme (); - void actuallyUpdateCursorTheme (const std::string &theme, - int cursor_size, - const std::string &command); - - MousethemeScreen (CompScreen *screen); - - bool everythingUpdate (); - bool themeUpdate (); -}; - -#define MOUSETHEME_SCREEN(s) \ - MousethemeScreen *ms = MousethemeScreen::get (s) - -#define NUM_OPTIONS(s) (sizeof ((s)->opt) / sizeof (CompOption)) - -class MousethemePluginVTable : - public CompPlugin::VTableForScreen -{ - public: - - bool init (); -}; -- GitLab From 16d632cca8e13c8d01d41927870cd4a1b3f36e3a Mon Sep 17 00:00:00 2001 From: Cyril Brulebois Date: Thu, 20 Apr 2017 22:37:27 +0200 Subject: [PATCH 48/53] Add Jenkinsfile for Multibranch Pipeline. --- Jenkinsfile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 000000000..c9842749d --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,25 @@ +node { + stage('Checkout') { + checkout scm + } + + stage('Source build') { + sh "hypra-build-source" + } + + stage('Binary amd64 build') { + sh "hypra-build-binaries amd64" + } + + stage('Binary i386 build') { + sh "hypra-build-binaries i386" + } + + stage('Publish to repository') { + sh "hypra-reprepro-include" + } + + stage('Archive build output') { + archiveArtifacts artifacts: '*' + } +} -- GitLab From bc963d3785434a4f9477fe1c3099e58046587b58 Mon Sep 17 00:00:00 2001 From: Cyril Brulebois Date: Fri, 21 Apr 2017 00:47:49 +0200 Subject: [PATCH 49/53] Switch to native versioning. This makes it possible to overcome big changes from the last known upstream tarball (which contains extra files), which would lead to an FTBFS since those extra files get in the way. The 0.9.12.2 tarball wouldn't be that great a reference anyway, since upstream infrequently releases snapshots from VCS. Conflicts: debian/changelog --- debian/changelog | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 5e9c2b4f9..2b7752dcd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ -compiz (2:0.9.12.2-hyp7.3.2) UNRELEASED; urgency=medium +compiz (2:0.9.12.2+hypra7.4) UNRELEASED; urgency=medium - * stretch release + * Switch to native versioning to overcome big changes from the + last known upstream tarball (which contains extra files). -- ksamak Mon, 16 Jan 2017 10:38:49 +0100 -- GitLab From 79fe2e4543d95bf6e490c76b4d3b8067d5758883 Mon Sep 17 00:00:00 2001 From: ksamak Date: Mon, 24 Apr 2017 19:40:16 +0200 Subject: [PATCH 50/53] adding Thunderbird (anciently Icedove) to list of supported apps --- plugins/mousepoll/src/accessibilitywatcher.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/mousepoll/src/accessibilitywatcher.cpp b/plugins/mousepoll/src/accessibilitywatcher.cpp index 987e4d75c..74bda1b3e 100644 --- a/plugins/mousepoll/src/accessibilitywatcher.cpp +++ b/plugins/mousepoll/src/accessibilitywatcher.cpp @@ -237,7 +237,7 @@ bool AccessibilityWatcher::app_specific_filter(FocusInfo& focus, const AtspiEven return true; } } - if (focus.application == "Icedove") { + if (focus.application == "Icedove" || focus.application == "Thunderbird") { if (focus.type == "caret") { auto text = atspi_accessible_get_text(event->source); // next if deals with a special newline char, that remained buggy. hypra issue #430 auto offset = atspi_text_get_caret_offset(text, NULL); -- GitLab From e77c099a55e1ccf1ebf0de25e3d806a16cba8515 Mon Sep 17 00:00:00 2001 From: Cyril Brulebois Date: Fri, 28 Apr 2017 09:14:08 +0200 Subject: [PATCH 51/53] Document changes since the last release. --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index 2b7752dcd..f360682de 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,15 @@ compiz (2:0.9.12.2+hypra7.4) UNRELEASED; urgency=medium + [ Cyril Brulebois ] * Switch to native versioning to overcome big changes from the last known upstream tarball (which contains extra files). + [ ksamak ] + * Add colorfilter support. + * Remove mousetheme support. + * Add a 'before' relationship on ezoom for showmouse. + * Add support for Thunderbird in addition to Icedove. + -- ksamak Mon, 16 Jan 2017 10:38:49 +0100 compiz (2:0.9.12.2-hyp7.3) jessie; urgency=medium -- GitLab From 6e7a46897589be0b0219c147b67ffb0b5c765167 Mon Sep 17 00:00:00 2001 From: Cyril Brulebois Date: Fri, 28 Apr 2017 09:14:46 +0200 Subject: [PATCH 52/53] releasing version 2:0.9.12.2+hypra7.4 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index f360682de..33328fcb2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -compiz (2:0.9.12.2+hypra7.4) UNRELEASED; urgency=medium +compiz (2:0.9.12.2+hypra7.4) jessie; urgency=medium [ Cyril Brulebois ] * Switch to native versioning to overcome big changes from the @@ -10,7 +10,7 @@ compiz (2:0.9.12.2+hypra7.4) UNRELEASED; urgency=medium * Add a 'before' relationship on ezoom for showmouse. * Add support for Thunderbird in addition to Icedove. - -- ksamak Mon, 16 Jan 2017 10:38:49 +0100 + -- Cyril Brulebois Fri, 28 Apr 2017 09:14:12 +0200 compiz (2:0.9.12.2-hyp7.3) jessie; urgency=medium -- GitLab From 59cdf3b4da4ecba911c52b05a24dee5d136c2e1b Mon Sep 17 00:00:00 2001 From: ksamak Date: Wed, 24 May 2017 12:10:26 +0200 Subject: [PATCH 53/53] bump changelog --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 33328fcb2..d92a4817f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +compiz (2:0.9.12.2+hypra7.5) UNRELEASED; urgency=medium + + * added focuspoll plugin + + -- ksamak Wed, 24 May 2017 12:09:10 +0200 + compiz (2:0.9.12.2+hypra7.4) jessie; urgency=medium [ Cyril Brulebois ] -- GitLab