From 20f187196668513cbf220edeac99ed3cdc31e8d9 Mon Sep 17 00:00:00 2001 From: Samuel Gomes <47574584+a740g@users.noreply.github.com> Date: Fri, 29 Mar 2024 23:21:10 +0530 Subject: [PATCH] Add clipboard test and add clip license --- Makefile | 2 ++ licenses/README.md | 8 +++++++ licenses/license_clip.txt | 23 ++++++++++++++++++ .../clipboard/clipboard_test.bas | 24 +++++++++++++++++++ .../clipboard/clipboard_test.output | 3 +++ 5 files changed, 60 insertions(+) create mode 100644 licenses/license_clip.txt create mode 100644 tests/compile_tests/clipboard/clipboard_test.bas create mode 100644 tests/compile_tests/clipboard/clipboard_test.output diff --git a/Makefile b/Makefile index 0d726f139..a5c19d1ce 100644 --- a/Makefile +++ b/Makefile @@ -268,6 +268,8 @@ endif ifneq ($(filter y,$(DEP_SCREENIMAGE)),) CXXFLAGS += -DDEPENDENCY_SCREENIMAGE QBLIB_NAME := $(addsuffix 1,$(QBLIB_NAME)) + + LICENSE_IN_USE += clip else CXXFLAGS += -DDEPENDENCY_NO_SCREENIMAGE QBLIB_NAME := $(addsuffix 0,$(QBLIB_NAME)) diff --git a/licenses/README.md b/licenses/README.md index a449b01cd..eb995ca08 100644 --- a/licenses/README.md +++ b/licenses/README.md @@ -122,3 +122,11 @@ This is used by libqb to show alerts and also by the common dialog functions and | Library | License | License file | Location | | :------ | :-----: | :----------- | :------- | | tiny file dialogs | ZLIB | license_tinyfiledialogs.txt | internal/c/parts/gui/ | + +## Clipboard Image Support + +This is used if you make use of the `_CLIPBOARDIMAGE` function or statement. + +| Library | License | License file | Location | +| :------ | :-----: | :----------- | :------- | +| Clip Library | MIT | license_clip.txt | internal/c/parts/os/clipboard/clip/ | diff --git a/licenses/license_clip.txt b/licenses/license_clip.txt new file mode 100644 index 000000000..80b5c9d86 --- /dev/null +++ b/licenses/license_clip.txt @@ -0,0 +1,23 @@ +-------------------------------------------------------------------------------- +License of Clip Library: + +Copyright (c) 2015-2024 David Capello + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tests/compile_tests/clipboard/clipboard_test.bas b/tests/compile_tests/clipboard/clipboard_test.bas new file mode 100644 index 000000000..bfb561cd9 --- /dev/null +++ b/tests/compile_tests/clipboard/clipboard_test.bas @@ -0,0 +1,24 @@ +$CONSOLE:ONLY + +OPTION _EXPLICIT + +CONST TEXT_HELLO = "Hello" +CONST TEXT_WORLD = "world" +CONST TEXT_ASCII = CHR$(176) + CHR$(177) + CHR$(178) + " " + TEXT_HELLO + " " + TEXT_WORLD + " " + CHR$(178) + CHR$(177) + CHR$(176) + + +_CLIPBOARD$ = TEXT_HELLO +_CLIPBOARD$ = TEXT_WORLD + +PRINT "Set: "; TEXT_WORLD +PRINT "Got: "; _CLIPBOARD$ + +_CLIPBOARD$ = TEXT_ASCII + +IF TEXT_ASCII = _CLIPBOARD$ THEN + PRINT "Test passed" +ELSE + PRINT "Test failed" +END IF + +SYSTEM diff --git a/tests/compile_tests/clipboard/clipboard_test.output b/tests/compile_tests/clipboard/clipboard_test.output new file mode 100644 index 000000000..fa20c80e6 --- /dev/null +++ b/tests/compile_tests/clipboard/clipboard_test.output @@ -0,0 +1,3 @@ +Set: world +Got: world +Test passed