From 339305f805a77773e2efff3fbc46370b312000d9 Mon Sep 17 00:00:00 2001 From: finanalyst Date: Sun, 20 Feb 2022 18:16:52 +0000 Subject: [PATCH] remove failing Windows Build, see CHANGELOG.md for other changes --- .github/workflows/test.yaml | 16 ++ .gitignore | 2 + .travis.yml | 13 -- Build.pm | 129 ------------- CHANGELOG.md | 33 ++++ CHANGELOG.rakudoc | 14 ++ META6.json | 175 ++++++++---------- README.md | 41 ++-- appveyor.yml | 15 -- ...01-hello-world.pl6 => 01-hello-world.raku} | 0 examples/{02-toggles.pl6 => 02-toggles.raku} | 0 examples/{03-grid.pl6 => 03-grid.raku} | 0 ...-marked-scale.pl6 => 04-marked-scale.raku} | 0 examples/{05-bars.pl6 => 05-bars.raku} | 0 examples/{06-combo.pl6 => 06-combo.raku} | 0 examples/{07-text.pl6 => 07-text.raku} | 0 examples/{08-spinner.pl6 => 08-spinner.raku} | 0 examples/{09-toolbar.pl6 => 09-toolbar.raku} | 0 .../{10-menu-bar.pl6 => 10-menu-bar.raku} | 0 ...button.pl6 => 11-file-chooser-button.raku} | 0 examples/{12-frame.pl6 => 12-frame.raku} | 0 ...s-siderbar.pl6 => 13-places-siderbar.raku} | 0 ...-radio-button.pl6 => 14-radio-button.raku} | 0 ...15-link-button.pl6 => 15-link-button.raku} | 0 .../{16-level-bar.pl6 => 16-level-bar.raku} | 0 ... => 17-scrolled-window-with-textview.raku} | 0 ...handler.pl6 => 18-cairo-draw-handler.raku} | 0 ...-progress-bar.pl6 => 19-progress-bar.raku} | 0 lib/GTK/{Simple.pm6 => Simple.rakumod} | 0 .../{ActionBar.pm6 => ActionBar.rakumod} | 0 lib/GTK/Simple/{App.pm6 => App.rakumod} | 0 lib/GTK/Simple/{Box.pm6 => Box.rakumod} | 0 lib/GTK/Simple/{Button.pm6 => Button.rakumod} | 0 .../Simple/{Calendar.pm6 => Calendar.rakumod} | 0 .../{CheckButton.pm6 => CheckButton.rakumod} | 0 ...{ComboBoxText.pm6 => ComboBoxText.rakumod} | 0 lib/GTK/Simple/{Common.pm6 => Common.rakumod} | 0 ...nHandler.pm6 => ConnectionHandler.rakumod} | 0 .../{Container.pm6 => Container.rakumod} | 0 .../{DrawingArea.pm6 => DrawingArea.rakumod} | 0 lib/GTK/Simple/{Entry.pm6 => Entry.rakumod} | 7 +- ...erButton.pm6 => FileChooserButton.rakumod} | 0 lib/GTK/Simple/{Frame.pm6 => Frame.rakumod} | 0 lib/GTK/Simple/{GDK.pm6 => GDK.rakumod} | 0 lib/GTK/Simple/{Grid.pm6 => Grid.rakumod} | 0 lib/GTK/Simple/{HBox.pm6 => HBox.rakumod} | 0 lib/GTK/Simple/{Label.pm6 => Label.rakumod} | 0 .../Simple/{LevelBar.pm6 => LevelBar.rakumod} | 0 .../{LinkButton.pm6 => LinkButton.rakumod} | 0 .../{MarkUpLabel.pm6 => MarkUpLabel.rakumod} | 0 lib/GTK/Simple/{Menu.pm6 => Menu.rakumod} | 0 .../Simple/{MenuBar.pm6 => MenuBar.rakumod} | 0 .../Simple/{MenuItem.pm6 => MenuItem.rakumod} | 0 ...uToolButton.pm6 => MenuToolButton.rakumod} | 0 .../{NativeLib.pm6 => NativeLib.rakumod} | 0 ...lacesSidebar.pm6 => PlacesSidebar.rakumod} | 0 .../{ProgressBar.pm6 => ProgressBar.rakumod} | 0 ...pertyFacade.pm6 => PropertyFacade.rakumod} | 0 .../{RadioButton.pm6 => RadioButton.rakumod} | 0 lib/GTK/Simple/{Raw.pm6 => Raw.rakumod} | 11 ++ lib/GTK/Simple/{Scale.pm6 => Scale.rakumod} | 0 .../{Scheduler.pm6 => Scheduler.rakumod} | 0 ...olledWindow.pm6 => ScrolledWindow.rakumod} | 0 .../{Separator.pm6 => Separator.rakumod} | 0 .../Simple/{Spinner.pm6 => Spinner.rakumod} | 0 .../{StatusBar.pm6 => StatusBar.rakumod} | 0 lib/GTK/Simple/{Switch.pm6 => Switch.rakumod} | 0 .../Simple/{TextView.pm6 => TextView.rakumod} | 0 ...{ToggleButton.pm6 => ToggleButton.rakumod} | 0 .../Simple/{Toolbar.pm6 => Toolbar.rakumod} | 0 lib/GTK/Simple/{VBox.pm6 => VBox.rakumod} | 0 lib/GTK/Simple/{Widget.pm6 => Widget.rakumod} | 0 lib/GTK/Simple/{Window.pm6 => Window.rakumod} | 0 migration/GTK3-4-migration.md | 133 +++++++++++++ migration/GTK3-4-migration.pod6 | 75 ++++++++ migration/files_with_deprecations.txt | 7 + migration/scan4deps.raku | 61 ++++++ t/{01-sanity.t => 01-sanity.rakutest} | 1 - ...-author-meta.t => 99-author-meta.rakutest} | 1 - 79 files changed, 454 insertions(+), 280 deletions(-) create mode 100644 .github/workflows/test.yaml delete mode 100644 .travis.yml delete mode 100644 Build.pm create mode 100644 CHANGELOG.md create mode 100644 CHANGELOG.rakudoc delete mode 100644 appveyor.yml rename examples/{01-hello-world.pl6 => 01-hello-world.raku} (100%) rename examples/{02-toggles.pl6 => 02-toggles.raku} (100%) rename examples/{03-grid.pl6 => 03-grid.raku} (100%) rename examples/{04-marked-scale.pl6 => 04-marked-scale.raku} (100%) rename examples/{05-bars.pl6 => 05-bars.raku} (100%) rename examples/{06-combo.pl6 => 06-combo.raku} (100%) rename examples/{07-text.pl6 => 07-text.raku} (100%) rename examples/{08-spinner.pl6 => 08-spinner.raku} (100%) rename examples/{09-toolbar.pl6 => 09-toolbar.raku} (100%) rename examples/{10-menu-bar.pl6 => 10-menu-bar.raku} (100%) rename examples/{11-file-chooser-button.pl6 => 11-file-chooser-button.raku} (100%) rename examples/{12-frame.pl6 => 12-frame.raku} (100%) rename examples/{13-places-siderbar.pl6 => 13-places-siderbar.raku} (100%) rename examples/{14-radio-button.pl6 => 14-radio-button.raku} (100%) rename examples/{15-link-button.pl6 => 15-link-button.raku} (100%) rename examples/{16-level-bar.pl6 => 16-level-bar.raku} (100%) rename examples/{17-scrolled-window-with-textview.pl6 => 17-scrolled-window-with-textview.raku} (100%) rename examples/{18-cairo-draw-handler.pl6 => 18-cairo-draw-handler.raku} (100%) rename examples/{19-progress-bar.pl6 => 19-progress-bar.raku} (100%) rename lib/GTK/{Simple.pm6 => Simple.rakumod} (100%) rename lib/GTK/Simple/{ActionBar.pm6 => ActionBar.rakumod} (100%) rename lib/GTK/Simple/{App.pm6 => App.rakumod} (100%) rename lib/GTK/Simple/{Box.pm6 => Box.rakumod} (100%) rename lib/GTK/Simple/{Button.pm6 => Button.rakumod} (100%) rename lib/GTK/Simple/{Calendar.pm6 => Calendar.rakumod} (100%) rename lib/GTK/Simple/{CheckButton.pm6 => CheckButton.rakumod} (100%) rename lib/GTK/Simple/{ComboBoxText.pm6 => ComboBoxText.rakumod} (100%) rename lib/GTK/Simple/{Common.pm6 => Common.rakumod} (100%) rename lib/GTK/Simple/{ConnectionHandler.pm6 => ConnectionHandler.rakumod} (100%) rename lib/GTK/Simple/{Container.pm6 => Container.rakumod} (100%) rename lib/GTK/Simple/{DrawingArea.pm6 => DrawingArea.rakumod} (100%) rename lib/GTK/Simple/{Entry.pm6 => Entry.rakumod} (86%) rename lib/GTK/Simple/{FileChooserButton.pm6 => FileChooserButton.rakumod} (100%) rename lib/GTK/Simple/{Frame.pm6 => Frame.rakumod} (100%) rename lib/GTK/Simple/{GDK.pm6 => GDK.rakumod} (100%) rename lib/GTK/Simple/{Grid.pm6 => Grid.rakumod} (100%) rename lib/GTK/Simple/{HBox.pm6 => HBox.rakumod} (100%) rename lib/GTK/Simple/{Label.pm6 => Label.rakumod} (100%) rename lib/GTK/Simple/{LevelBar.pm6 => LevelBar.rakumod} (100%) rename lib/GTK/Simple/{LinkButton.pm6 => LinkButton.rakumod} (100%) rename lib/GTK/Simple/{MarkUpLabel.pm6 => MarkUpLabel.rakumod} (100%) rename lib/GTK/Simple/{Menu.pm6 => Menu.rakumod} (100%) rename lib/GTK/Simple/{MenuBar.pm6 => MenuBar.rakumod} (100%) rename lib/GTK/Simple/{MenuItem.pm6 => MenuItem.rakumod} (100%) rename lib/GTK/Simple/{MenuToolButton.pm6 => MenuToolButton.rakumod} (100%) rename lib/GTK/Simple/{NativeLib.pm6 => NativeLib.rakumod} (100%) rename lib/GTK/Simple/{PlacesSidebar.pm6 => PlacesSidebar.rakumod} (100%) rename lib/GTK/Simple/{ProgressBar.pm6 => ProgressBar.rakumod} (100%) rename lib/GTK/Simple/{PropertyFacade.pm6 => PropertyFacade.rakumod} (100%) rename lib/GTK/Simple/{RadioButton.pm6 => RadioButton.rakumod} (100%) rename lib/GTK/Simple/{Raw.pm6 => Raw.rakumod} (98%) rename lib/GTK/Simple/{Scale.pm6 => Scale.rakumod} (100%) rename lib/GTK/Simple/{Scheduler.pm6 => Scheduler.rakumod} (100%) rename lib/GTK/Simple/{ScrolledWindow.pm6 => ScrolledWindow.rakumod} (100%) rename lib/GTK/Simple/{Separator.pm6 => Separator.rakumod} (100%) rename lib/GTK/Simple/{Spinner.pm6 => Spinner.rakumod} (100%) rename lib/GTK/Simple/{StatusBar.pm6 => StatusBar.rakumod} (100%) rename lib/GTK/Simple/{Switch.pm6 => Switch.rakumod} (100%) rename lib/GTK/Simple/{TextView.pm6 => TextView.rakumod} (100%) rename lib/GTK/Simple/{ToggleButton.pm6 => ToggleButton.rakumod} (100%) rename lib/GTK/Simple/{Toolbar.pm6 => Toolbar.rakumod} (100%) rename lib/GTK/Simple/{VBox.pm6 => VBox.rakumod} (100%) rename lib/GTK/Simple/{Widget.pm6 => Widget.rakumod} (100%) rename lib/GTK/Simple/{Window.pm6 => Window.rakumod} (100%) create mode 100644 migration/GTK3-4-migration.md create mode 100644 migration/GTK3-4-migration.pod6 create mode 100644 migration/files_with_deprecations.txt create mode 100644 migration/scan4deps.raku rename t/{01-sanity.t => 01-sanity.rakutest} (99%) rename t/{99-author-meta.t => 99-author-meta.rakutest} (99%) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..8ad9170 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,16 @@ +name: "Raku tests" +on: [ push, pull_request ] +jobs: + test: + runs-on: ubuntu-latest + permissions: + packages: read + container: + image: ghcr.io/jj/raku-zef-gha + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Install modules + run: zef install . + - name: Test + run: zef --debug test . diff --git a/.gitignore b/.gitignore index 5a7f3ad..550242f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ .precomp resources +/raku-gtk-simple.iml +/.idea/.gitignore diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f75e800..0000000 --- a/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -language: minimal - -before_install: - - sudo apt-get -qq update - - sudo apt-get -y install libgtk-3-dev - -services: - - docker - -install: - - docker pull jjmerelo/raku-test - -script: docker run -t -v $TRAVIS_BUILD_DIR:/test jjmerelo/raku-test diff --git a/Build.pm b/Build.pm deleted file mode 100644 index 0d14e4d..0000000 --- a/Build.pm +++ /dev/null @@ -1,129 +0,0 @@ - -use v6; -use NativeCall; -use LWP::Simple; -use Shell::Command; - -# test sub for system library -sub test() is native('libgtk-3-0.dll') { * } - -unit class Build; -method build($workdir) { - my $need-copy = False; - - # we only have .dll files bundled. Non-windows is assumed to have gtk already - if $*DISTRO.is-win { - test(); - CATCH { - default { - $need-copy = True if $_.payload ~~ m:s/Cannot locate/; - } - } - } - - my @files = ("libatk-1.0-0.dll", - "libcairo-2.dll", - "libcairo-gobject-2.dll", - "libffi-6.dll", - "libfontconfig-1.dll", - "libfreetype-6.dll", - "libgdk-3-0.dll", - "libgdk_pixbuf-2.0-0.dll", - "libgio-2.0-0.dll", - "libglib-2.0-0.dll", - "libgmodule-2.0-0.dll", - "libgobject-2.0-0.dll", - "libgtk-3-0.dll", - "libiconv-2.dll", - "libintl-8.dll", - "liblzma-5.dll", - "libpango-1.0-0.dll", - "libpangocairo-1.0-0.dll", - "libpangoft2-1.0-0.dll", - "libpangowin32-1.0-0.dll", - "libpixman-1-0.dll", - "libpng15-15.dll", - "libxml2-2.dll", - "zlib1.dll"); - - if $need-copy { - # to avoid a dependency (and because Digest::SHA is too slow), we do a hacked up powershell hash - # this should work all the way back to powershell v1 - # Otherwise we try to run CertUtil.exe which seems to be built into windowses. - my &ps-hash = -> $path { - my $hash; - try { - my $fn = 'function get-sha256 { param($file);[system.bitconverter]::tostring([System.Security.Cryptography.sha256]::create().computehash([system.io.file]::openread((resolve-path $file)))) -replace \"-\",\"\" } '; - $hash = shell( - :!err, :out, qq/powershell -noprofile -Command "$fn get-sha256 $path"/ - ).out.lines(:close).grep({$_.chars})[*-1].uc; - } - without $hash { - $hash = run("CertUtil.exe", "-hashfile", $path, "SHA256", :out) - .out.slurp(:close).subst(" ", "", :g) - .lines.first(/^ **64 $/).uc; - } - $hash - } - say 'No system gtk library detected. Installing bundled version.'; - my $basedir = $workdir ~ '\resources\blib\lib\GTK'; - mkdir($basedir); - my @hashes = ("1FF7464EDA0C7EC9B87D23A075F7486C13D74C02A3B5D83A267AD091424185D9", - "E127BF5D01CD9B2F82501E4AD8F867CE9310CE16A33CB71D5ED3F5AB906FD318", - "E963528E4B33A56DE4B6DB491394E56301E5BFA72E592FD39274143FB45DBD80", - "357A298222CE4C3540B4E99AD2547B634360808206E5E06214C7DD3135BE6CA8", - "1AC7BC02502D1D798662B3621B43637F33B07424C89E2E808945BD7133694EFA", - "7C54CB33D0247E3BB65974CAD1B7205590DF0E99460CF197E37B4CABDE265935", - "EE41FB133188717057126AF3021DDCEE3D23D8E262E9BF95F7E4DBD2BAC64E20", - "EECA1E63D7F692F147648BB7D738507B4EAAC31C1DD35E7B5E819EFEA3A7AB75", - "7DDD4AD2FA2979D612951F165FAD78D79944254AA254D5E366F3AE8B0EFF3B7E", - "BC4E7544BD384BB5F87E0C1B6640273922EF0BEE69CE9066C9F808230D80B4D2", - "D6BA07F2B392200350417F5B5750526A5F0477833BF2484D9A5AAEACA3777777", - "BF1CBC203938684EC93300CFB98F174B03B5165C9B7D8F8D6356CDAC2D2303A7", - "20C58683280EF1EE19BE641FF3399426A280923068F8237F9E285191C4AAF755", - "954B8740A7CBE3728B136D4F36229C599D1F51534137B16E48E3D7FF9C468FDC", - "9D37C194C49F3104F6326226744111886A9BFE7D18D5742C36C66F7418B62824", - "CE34910B43D5E4285AECDA0E4F64A1BA06C5D53E484F0B68D219C8D8473332AB", - "D24E2037215D5F439DC3180643BC2AF1F16FD03ED7C20B1DE6B5455DE8DD7DF3", - "E2B142B4219CF6DE7AECC1AA796B50D541E01BC20AB15330E7BA540FD03D3512", - "295FEE9BEF2D8255564B4FEDDE4A56FE993D9921DB7E76105A2913C0CD562A1C", - "D348A428FCA283CA30A1CFEE5BA4BD21B460F198DD23B0E26DFB0E06D9A350D8", - "A97EBE54ED31ED7D8A8317D831878CE82F3B94FE1E5A7466B78D0F0C90863302", - "40F6EDE85DB0A1E2F4BA67693B7DC8B74AFFBFAB3B92B99F6B2CEFACBBF7FF6D", - "4F1032F0D7F6F0C2046A96884FD48EC0F7C0A1E22C85E9076057756C4C48E0CB", - "5A697F89758B407EE85BAD35376546A80520E1F3092D07F1BC366A490443FAB5"); - for flat @files Z @hashes -> $f, $h { - say "Fetching $f"; - my $blob = LWP::Simple.get("http://gtk-dlls.p6c.org/$f"); - say "Writing $f"; - spurt("$basedir\\$f", $blob); - - say "Verifying $f"; - my $hash = ps-hash("$basedir\\$f"); - if ($hash ne $h) { - die "Bad download of $f (got: $hash; expected: $h)"; - } - say ""; - } - } - else { - say 'Found system gtk library.'; - - # Workaround: Write empty DLL files on non-windows platforms to stop - # panda from throwing meta6 not-found errors - my $basedir = $workdir ~ '/resources/blib/lib/GTK'; - mkdir($basedir); - for @files -> $f { - # write empty files for now - spurt("$basedir/$f", ""); - } - } - - return True; -} - -# only needed for older versions of panda -method isa($what) { - return True if $what.^name eq 'Panda::Builder'; - callsame; -} diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..a8bfec7 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,33 @@ + # CHANGELOG + +---- +---- + ## Table of Contents +[2022-02-20 v0.2.0](#2022-02-20-v020) + +---- +# 2022-02-20 v0.2.0 + + +* add CHANGELOG.rakudoc + +* add link to offical GTK explanation for adding GTK to a Windows system + + * remove the BUILD step and the *.dll files in the resources + + * Rationale: a) the Windows build process did not work; b) GTK now has a recommended way to do this. + +* Rename all modules / files to new Raku versions + +* Add placeholder method for Entry + +* Modify README to reflect these changes + +* change CI to github actions + + + + + +---- +Rendered from CHANGELOG at 2022-02-20T18:12:52Z \ No newline at end of file diff --git a/CHANGELOG.rakudoc b/CHANGELOG.rakudoc new file mode 100644 index 0000000..99fbb39 --- /dev/null +++ b/CHANGELOG.rakudoc @@ -0,0 +1,14 @@ +=begin pod + +=head1 2022-02-20 v0.2.0 +=item add CHANGELOG.rakudoc +=item add link to offical GTK explanation for adding GTK to a Windows system +=item2 remove the BUILD step and the *.dll files in the resources +=item2 Rationale: a) the Windows build process did not work; b) GTK now has a recommended +way to do this. +=item Rename all modules / files to new Raku versions +=item Add placeholder method for Entry +=item Modify README to reflect these changes +=item change CI to github actions + +=end pod \ No newline at end of file diff --git a/META6.json b/META6.json index eae81a6..8a047f8 100644 --- a/META6.json +++ b/META6.json @@ -1,97 +1,80 @@ { - "name" : "GTK::Simple", - "license" : "Artistic-2.0", - "version" : "0.1.14", - "perl" : "6.d", - "authors" : [ - "Jonathan Worthington", - "Moritz Lenz", - "Timo Paulssen", - "Ahmad M. Zawawi", - "Jonathan Stowe", - "ab5tract", - "momozor", - "Zoffix Znet", - "Nick Logan", - "finanalyst aka Richard Hainsworth" - ], - "description" : "Simple GTK 3 binding using NativeCall", - "build-depends" : [ "LWP::Simple", "Shell::Command" ], - "test-depends" : [ "Test", "Test::META"], - "tags" : [ "gui" ], - "provides" : { - "GTK::Simple::GDK" : "lib/GTK/Simple/GDK.pm6", - "GTK::Simple::NativeLib" : "lib/GTK/Simple/NativeLib.pm6", - "GTK::Simple" : "lib/GTK/Simple.pm6", - "GTK::Simple::ActionBar" : "lib/GTK/Simple/ActionBar.pm6", - "GTK::Simple::App" : "lib/GTK/Simple/App.pm6", - "GTK::Simple::Box" : "lib/GTK/Simple/Box.pm6", - "GTK::Simple::Button" : "lib/GTK/Simple/Button.pm6", - "GTK::Simple::Calendar" : "lib/GTK/Simple/Calendar.pm6", - "GTK::Simple::CheckButton" : "lib/GTK/Simple/CheckButton.pm6", - "GTK::Simple::ComboBoxText" : "lib/GTK/Simple/ComboBoxText.pm6", - "GTK::Simple::Common" : "lib/GTK/Simple/Common.pm6", - "GTK::Simple::ConnectionHandler" : "lib/GTK/Simple/ConnectionHandler.pm6", - "GTK::Simple::Container" : "lib/GTK/Simple/Container.pm6", - "GTK::Simple::DrawingArea" : "lib/GTK/Simple/DrawingArea.pm6", - "GTK::Simple::Entry" : "lib/GTK/Simple/Entry.pm6", - "GTK::Simple::FileChooserButton" : "lib/GTK/Simple/FileChooserButton.pm6", - "GTK::Simple::Frame" : "lib/GTK/Simple/Frame.pm6", - "GTK::Simple::Grid" : "lib/GTK/Simple/Grid.pm6", - "GTK::Simple::HBox" : "lib/GTK/Simple/HBox.pm6", - "GTK::Simple::Label" : "lib/GTK/Simple/Label.pm6", - "GTK::Simple::LevelBar" : "lib/GTK/Simple/LevelBar.pm6", - "GTK::Simple::LinkButton" : "lib/GTK/Simple/LinkButton.pm6", - "GTK::Simple::MarkUpLabel" : "lib/GTK/Simple/MarkUpLabel.pm6", - "GTK::Simple::Menu" : "lib/GTK/Simple/Menu.pm6", - "GTK::Simple::MenuBar" : "lib/GTK/Simple/MenuBar.pm6", - "GTK::Simple::MenuItem" : "lib/GTK/Simple/MenuItem.pm6", - "GTK::Simple::MenuToolButton" : "lib/GTK/Simple/MenuToolButton.pm6", - "GTK::Simple::PlacesSidebar" : "lib/GTK/Simple/PlacesSidebar.pm6", - "GTK::Simple::ProgressBar" : "lib/GTK/Simple/ProgressBar.pm6", - "GTK::Simple::PropertyFacade" : "lib/GTK/Simple/PropertyFacade.pm6", - "GTK::Simple::RadioButton" : "lib/GTK/Simple/RadioButton.pm6", - "GTK::Simple::Raw" : "lib/GTK/Simple/Raw.pm6", - "GTK::Simple::Scale" : "lib/GTK/Simple/Scale.pm6", - "GTK::Simple::Scheduler" : "lib/GTK/Simple/Scheduler.pm6", - "GTK::Simple::Separator" : "lib/GTK/Simple/Separator.pm6", - "GTK::Simple::Spinner" : "lib/GTK/Simple/Spinner.pm6", - "GTK::Simple::StatusBar" : "lib/GTK/Simple/StatusBar.pm6", - "GTK::Simple::Switch" : "lib/GTK/Simple/Switch.pm6", - "GTK::Simple::TextView" : "lib/GTK/Simple/TextView.pm6", - "GTK::Simple::ToggleButton" : "lib/GTK/Simple/ToggleButton.pm6", - "GTK::Simple::Toolbar" : "lib/GTK/Simple/Toolbar.pm6", - "GTK::Simple::VBox" : "lib/GTK/Simple/VBox.pm6", - "GTK::Simple::Widget" : "lib/GTK/Simple/Widget.pm6", - "GTK::Simple::Window" : "lib/GTK/Simple/Window.pm6", - "GTK::Simple::ScrolledWindow" : "lib/GTK/Simple/ScrolledWindow.pm6" - }, - "repo-type" : "git", - "source-url" : "git://github.com/perl6/GTK-Simple.git", - "resources" : [ - "blib/lib/GTK/libatk-1.0-0.dll", - "blib/lib/GTK/libcairo-2.dll", - "blib/lib/GTK/libcairo-gobject-2.dll", - "blib/lib/GTK/libffi-6.dll", - "blib/lib/GTK/libfontconfig-1.dll", - "blib/lib/GTK/libfreetype-6.dll", - "blib/lib/GTK/libgdk-3-0.dll", - "blib/lib/GTK/libgdk_pixbuf-2.0-0.dll", - "blib/lib/GTK/libgio-2.0-0.dll", - "blib/lib/GTK/libglib-2.0-0.dll", - "blib/lib/GTK/libgmodule-2.0-0.dll", - "blib/lib/GTK/libgobject-2.0-0.dll", - "blib/lib/GTK/libgtk-3-0.dll", - "blib/lib/GTK/libiconv-2.dll", - "blib/lib/GTK/libintl-8.dll", - "blib/lib/GTK/liblzma-5.dll", - "blib/lib/GTK/libpango-1.0-0.dll", - "blib/lib/GTK/libpangocairo-1.0-0.dll", - "blib/lib/GTK/libpangoft2-1.0-0.dll", - "blib/lib/GTK/libpangowin32-1.0-0.dll", - "blib/lib/GTK/libpixman-1-0.dll", - "blib/lib/GTK/libpng15-15.dll", - "blib/lib/GTK/libxml2-2.dll", - "blib/lib/GTK/zlib1.dll" - ] -} + "name": "GTK::Simple", + "description": "Simple GTK 3 binding using NativeCall", + "version": "0.2.0", + "perl": "6.d", + "authors": [ + "Jonathan Worthington", + "Moritz Lenz", + "Timo Paulssen", + "Ahmad M. Zawawi", + "Jonathan Stowe", + "ab5tract", + "momozor", + "Zoffix Znet", + "Nick Logan", + "finanalyst aka Richard Hainsworth" + ], + "test-depends": [ + "Test" + ], + "provides": { + "GTK::Simple": "lib/GTK/Simple.rakumod", + "GTK::Simple::ActionBar": "lib/GTK/Simple/ActionBar.rakumod", + "GTK::Simple::App": "lib/GTK/Simple/App.rakumod", + "GTK::Simple::Box": "lib/GTK/Simple/Box.rakumod", + "GTK::Simple::Button": "lib/GTK/Simple/Button.rakumod", + "GTK::Simple::Calendar": "lib/GTK/Simple/Calendar.rakumod", + "GTK::Simple::CheckButton": "lib/GTK/Simple/CheckButton.rakumod", + "GTK::Simple::ComboBoxText": "lib/GTK/Simple/ComboBoxText.rakumod", + "GTK::Simple::Common": "lib/GTK/Simple/Common.rakumod", + "GTK::Simple::ConnectionHandler": "lib/GTK/Simple/ConnectionHandler.rakumod", + "GTK::Simple::Container": "lib/GTK/Simple/Container.rakumod", + "GTK::Simple::DrawingArea": "lib/GTK/Simple/DrawingArea.rakumod", + "GTK::Simple::Entry": "lib/GTK/Simple/Entry.rakumod", + "GTK::Simple::FileChooserButton": "lib/GTK/Simple/FileChooserButton.rakumod", + "GTK::Simple::Frame": "lib/GTK/Simple/Frame.rakumod", + "GTK::Simple::GDK": "lib/GTK/Simple/GDK.rakumod", + "GTK::Simple::Grid": "lib/GTK/Simple/Grid.rakumod", + "GTK::Simple::HBox": "lib/GTK/Simple/HBox.rakumod", + "GTK::Simple::Label": "lib/GTK/Simple/Label.rakumod", + "GTK::Simple::LevelBar": "lib/GTK/Simple/LevelBar.rakumod", + "GTK::Simple::LinkButton": "lib/GTK/Simple/LinkButton.rakumod", + "GTK::Simple::MarkUpLabel": "lib/GTK/Simple/MarkUpLabel.rakumod", + "GTK::Simple::Menu": "lib/GTK/Simple/Menu.rakumod", + "GTK::Simple::MenuBar": "lib/GTK/Simple/MenuBar.rakumod", + "GTK::Simple::MenuItem": "lib/GTK/Simple/MenuItem.rakumod", + "GTK::Simple::MenuToolButton": "lib/GTK/Simple/MenuToolButton.rakumod", + "GTK::Simple::NativeLib": "lib/GTK/Simple/NativeLib.rakumod", + "GTK::Simple::PlacesSidebar": "lib/GTK/Simple/PlacesSidebar.rakumod", + "GTK::Simple::ProgressBar": "lib/GTK/Simple/ProgressBar.rakumod", + "GTK::Simple::PropertyFacade": "lib/GTK/Simple/PropertyFacade.rakumod", + "GTK::Simple::RadioButton": "lib/GTK/Simple/RadioButton.rakumod", + "GTK::Simple::Raw": "lib/GTK/Simple/Raw.rakumod", + "GTK::Simple::Scale": "lib/GTK/Simple/Scale.rakumod", + "GTK::Simple::Scheduler": "lib/GTK/Simple/Scheduler.rakumod", + "GTK::Simple::ScrolledWindow": "lib/GTK/Simple/ScrolledWindow.rakumod", + "GTK::Simple::Separator": "lib/GTK/Simple/Separator.rakumod", + "GTK::Simple::Spinner": "lib/GTK/Simple/Spinner.rakumod", + "GTK::Simple::StatusBar": "lib/GTK/Simple/StatusBar.rakumod", + "GTK::Simple::Switch": "lib/GTK/Simple/Switch.rakumod", + "GTK::Simple::TextView": "lib/GTK/Simple/TextView.rakumod", + "GTK::Simple::ToggleButton": "lib/GTK/Simple/ToggleButton.rakumod", + "GTK::Simple::Toolbar": "lib/GTK/Simple/Toolbar.rakumod", + "GTK::Simple::VBox": "lib/GTK/Simple/VBox.rakumod", + "GTK::Simple::Widget": "lib/GTK/Simple/Widget.rakumod", + "GTK::Simple::Window": "lib/GTK/Simple/Window.rakumod" + }, + "resources": [], + "support": { + "bugtracker": "https://github.com/finanalyst/GTK-Simple/issues", + "email": "rnhainsworth@gmail.com", + "source": "https://github.com/finanalyst/GTK-Simple.git" + }, + "license": "Artistic-2.0", + "tags": [ + "gui" + ], + "source-url": "git://github.com/finanalyst/GTK-Simple.git", + "repo-type": "git" +} \ No newline at end of file diff --git a/README.md b/README.md index 647a9ac..377acb6 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,10 @@ -## GTK::Simple [![Build Status](https://travis-ci.org/perl6/gtk-simple.svg?branch=master)](https://travis-ci.org/perl6/gtk-simple) [![Build status](https://ci.appveyor.com/api/projects/status/github/azawawi/gtk-simple?svg=true)](https://ci.appveyor.com/project/azawawi/gtk-simple/branch/master) +![badge](https://github.com/finanalyst/GTK-Simple/actions/workflows/test.yaml/badge.svg) +## GTK::Simple GTK::Simple is a set of simple [GTK 3](http://www.gtk.org/) bindings using -NativeCall. Only a few GTK widgets are currently implemented. However, these are +NativeCall. Only some GTK widgets are currently implemented. However, these are enough to create a reasonable interactive GUI for an idiomatic Raku program. -Widgets are gradually being added. These include the following: +The GTK Widgets in this distribution include the following: Widget | Description ----------------- | --------------------------------------------------------------- @@ -52,8 +53,14 @@ $second.clicked.tap({ $app.exit; }); $app.run; ``` -The first three or four examples were written as mini tutorials to show how the -system works. For more examples, please see the [examples](examples) folder. +The first four examples were written as mini tutorials to show how the +system works: +- [Hello world](https://github.com/finanalyst/GTK-Simple/blob/master/examples/01-hello-world.raku) +- [Toggles](https://github.com/finanalyst/GTK-Simple/blob/master/examples/02-toggles.raku) +- [A simple grid](https://github.com/finanalyst/GTK-Simple/blob/master/examples/03-grid.raku) +- [Marked Scales](https://github.com/finanalyst/GTK-Simple/blob/master/examples/04-marked-scale.raku) + +For more examples, please see the `examples/` folder. ## Limitations @@ -80,34 +87,20 @@ brew install gtk+3 ## Windows -Precompiled GTK3 DLLs are installed automatically with module installation. +The GTK team describes how to do this for Windows at +[Setting up GTK for Window](https://www.gtk.org/docs/installations/windows/) -## Installation +## Installation and sanity tests -To install it using [zef](https://github.com/ugexe/zef) (a module management -tool bundled with Rakudo Star): +Use the zef package manager ``` $ zef install GTK::Simple ``` -## Testing - -- To run tests: -``` -$ prove -e "perl6 -Ilib" -``` - -- To run all tests including author tests (Please make sure -[Test::Meta](https://github.com/jonathanstowe/Test-META) is installed): -``` -$ zef install Test::META -$ AUTHOR_TESTING=1 prove -e "perl6 -Ilib" -``` - ## Author -Jonathan Worthington, jnthn on #perl6, https://github.com/jnthn/ +Jonathan Worthington, jnthn on #raku, https://github.com/jnthn/ ## Contributors diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 1b062db..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,15 +0,0 @@ -os: Visual Studio 2017 - -platform: x64 - -install: - - vcpkg install gtk:x64-windows liblzma:x64-windows libxml2:x64-windows zstd:x64-windows - -build_script: - - echo "success" - -shallow_clone: true - -on_finish: - - 7z a C:/dlls_packaged.zip C:/Tools/vcpkg/installed/x64-windows/bin/*.dll C:/Tools/vcpkg/installed/x64-windows/bin/*.pdb - - appveyor PushArtifact C:/dlls_packaged.zip diff --git a/examples/01-hello-world.pl6 b/examples/01-hello-world.raku similarity index 100% rename from examples/01-hello-world.pl6 rename to examples/01-hello-world.raku diff --git a/examples/02-toggles.pl6 b/examples/02-toggles.raku similarity index 100% rename from examples/02-toggles.pl6 rename to examples/02-toggles.raku diff --git a/examples/03-grid.pl6 b/examples/03-grid.raku similarity index 100% rename from examples/03-grid.pl6 rename to examples/03-grid.raku diff --git a/examples/04-marked-scale.pl6 b/examples/04-marked-scale.raku similarity index 100% rename from examples/04-marked-scale.pl6 rename to examples/04-marked-scale.raku diff --git a/examples/05-bars.pl6 b/examples/05-bars.raku similarity index 100% rename from examples/05-bars.pl6 rename to examples/05-bars.raku diff --git a/examples/06-combo.pl6 b/examples/06-combo.raku similarity index 100% rename from examples/06-combo.pl6 rename to examples/06-combo.raku diff --git a/examples/07-text.pl6 b/examples/07-text.raku similarity index 100% rename from examples/07-text.pl6 rename to examples/07-text.raku diff --git a/examples/08-spinner.pl6 b/examples/08-spinner.raku similarity index 100% rename from examples/08-spinner.pl6 rename to examples/08-spinner.raku diff --git a/examples/09-toolbar.pl6 b/examples/09-toolbar.raku similarity index 100% rename from examples/09-toolbar.pl6 rename to examples/09-toolbar.raku diff --git a/examples/10-menu-bar.pl6 b/examples/10-menu-bar.raku similarity index 100% rename from examples/10-menu-bar.pl6 rename to examples/10-menu-bar.raku diff --git a/examples/11-file-chooser-button.pl6 b/examples/11-file-chooser-button.raku similarity index 100% rename from examples/11-file-chooser-button.pl6 rename to examples/11-file-chooser-button.raku diff --git a/examples/12-frame.pl6 b/examples/12-frame.raku similarity index 100% rename from examples/12-frame.pl6 rename to examples/12-frame.raku diff --git a/examples/13-places-siderbar.pl6 b/examples/13-places-siderbar.raku similarity index 100% rename from examples/13-places-siderbar.pl6 rename to examples/13-places-siderbar.raku diff --git a/examples/14-radio-button.pl6 b/examples/14-radio-button.raku similarity index 100% rename from examples/14-radio-button.pl6 rename to examples/14-radio-button.raku diff --git a/examples/15-link-button.pl6 b/examples/15-link-button.raku similarity index 100% rename from examples/15-link-button.pl6 rename to examples/15-link-button.raku diff --git a/examples/16-level-bar.pl6 b/examples/16-level-bar.raku similarity index 100% rename from examples/16-level-bar.pl6 rename to examples/16-level-bar.raku diff --git a/examples/17-scrolled-window-with-textview.pl6 b/examples/17-scrolled-window-with-textview.raku similarity index 100% rename from examples/17-scrolled-window-with-textview.pl6 rename to examples/17-scrolled-window-with-textview.raku diff --git a/examples/18-cairo-draw-handler.pl6 b/examples/18-cairo-draw-handler.raku similarity index 100% rename from examples/18-cairo-draw-handler.pl6 rename to examples/18-cairo-draw-handler.raku diff --git a/examples/19-progress-bar.pl6 b/examples/19-progress-bar.raku similarity index 100% rename from examples/19-progress-bar.pl6 rename to examples/19-progress-bar.raku diff --git a/lib/GTK/Simple.pm6 b/lib/GTK/Simple.rakumod similarity index 100% rename from lib/GTK/Simple.pm6 rename to lib/GTK/Simple.rakumod diff --git a/lib/GTK/Simple/ActionBar.pm6 b/lib/GTK/Simple/ActionBar.rakumod similarity index 100% rename from lib/GTK/Simple/ActionBar.pm6 rename to lib/GTK/Simple/ActionBar.rakumod diff --git a/lib/GTK/Simple/App.pm6 b/lib/GTK/Simple/App.rakumod similarity index 100% rename from lib/GTK/Simple/App.pm6 rename to lib/GTK/Simple/App.rakumod diff --git a/lib/GTK/Simple/Box.pm6 b/lib/GTK/Simple/Box.rakumod similarity index 100% rename from lib/GTK/Simple/Box.pm6 rename to lib/GTK/Simple/Box.rakumod diff --git a/lib/GTK/Simple/Button.pm6 b/lib/GTK/Simple/Button.rakumod similarity index 100% rename from lib/GTK/Simple/Button.pm6 rename to lib/GTK/Simple/Button.rakumod diff --git a/lib/GTK/Simple/Calendar.pm6 b/lib/GTK/Simple/Calendar.rakumod similarity index 100% rename from lib/GTK/Simple/Calendar.pm6 rename to lib/GTK/Simple/Calendar.rakumod diff --git a/lib/GTK/Simple/CheckButton.pm6 b/lib/GTK/Simple/CheckButton.rakumod similarity index 100% rename from lib/GTK/Simple/CheckButton.pm6 rename to lib/GTK/Simple/CheckButton.rakumod diff --git a/lib/GTK/Simple/ComboBoxText.pm6 b/lib/GTK/Simple/ComboBoxText.rakumod similarity index 100% rename from lib/GTK/Simple/ComboBoxText.pm6 rename to lib/GTK/Simple/ComboBoxText.rakumod diff --git a/lib/GTK/Simple/Common.pm6 b/lib/GTK/Simple/Common.rakumod similarity index 100% rename from lib/GTK/Simple/Common.pm6 rename to lib/GTK/Simple/Common.rakumod diff --git a/lib/GTK/Simple/ConnectionHandler.pm6 b/lib/GTK/Simple/ConnectionHandler.rakumod similarity index 100% rename from lib/GTK/Simple/ConnectionHandler.pm6 rename to lib/GTK/Simple/ConnectionHandler.rakumod diff --git a/lib/GTK/Simple/Container.pm6 b/lib/GTK/Simple/Container.rakumod similarity index 100% rename from lib/GTK/Simple/Container.pm6 rename to lib/GTK/Simple/Container.rakumod diff --git a/lib/GTK/Simple/DrawingArea.pm6 b/lib/GTK/Simple/DrawingArea.rakumod similarity index 100% rename from lib/GTK/Simple/DrawingArea.pm6 rename to lib/GTK/Simple/DrawingArea.rakumod diff --git a/lib/GTK/Simple/Entry.pm6 b/lib/GTK/Simple/Entry.rakumod similarity index 86% rename from lib/GTK/Simple/Entry.pm6 rename to lib/GTK/Simple/Entry.rakumod index addce10..7479fc4 100644 --- a/lib/GTK/Simple/Entry.pm6 +++ b/lib/GTK/Simple/Entry.rakumod @@ -19,7 +19,12 @@ method text() is gtk-property(>k_entry_get_text, >k_entry_set_text) { * } -method width-chars($num-chars) +method placeholder-text() + returns Str + is gtk-property(>k_entry_get_text, >k_entry_set_text) + { * } + +method width-chars() returns int32 is gtk-property(>k_entry_get_width_chars, >k_entry_set_width_chars) { * } diff --git a/lib/GTK/Simple/FileChooserButton.pm6 b/lib/GTK/Simple/FileChooserButton.rakumod similarity index 100% rename from lib/GTK/Simple/FileChooserButton.pm6 rename to lib/GTK/Simple/FileChooserButton.rakumod diff --git a/lib/GTK/Simple/Frame.pm6 b/lib/GTK/Simple/Frame.rakumod similarity index 100% rename from lib/GTK/Simple/Frame.pm6 rename to lib/GTK/Simple/Frame.rakumod diff --git a/lib/GTK/Simple/GDK.pm6 b/lib/GTK/Simple/GDK.rakumod similarity index 100% rename from lib/GTK/Simple/GDK.pm6 rename to lib/GTK/Simple/GDK.rakumod diff --git a/lib/GTK/Simple/Grid.pm6 b/lib/GTK/Simple/Grid.rakumod similarity index 100% rename from lib/GTK/Simple/Grid.pm6 rename to lib/GTK/Simple/Grid.rakumod diff --git a/lib/GTK/Simple/HBox.pm6 b/lib/GTK/Simple/HBox.rakumod similarity index 100% rename from lib/GTK/Simple/HBox.pm6 rename to lib/GTK/Simple/HBox.rakumod diff --git a/lib/GTK/Simple/Label.pm6 b/lib/GTK/Simple/Label.rakumod similarity index 100% rename from lib/GTK/Simple/Label.pm6 rename to lib/GTK/Simple/Label.rakumod diff --git a/lib/GTK/Simple/LevelBar.pm6 b/lib/GTK/Simple/LevelBar.rakumod similarity index 100% rename from lib/GTK/Simple/LevelBar.pm6 rename to lib/GTK/Simple/LevelBar.rakumod diff --git a/lib/GTK/Simple/LinkButton.pm6 b/lib/GTK/Simple/LinkButton.rakumod similarity index 100% rename from lib/GTK/Simple/LinkButton.pm6 rename to lib/GTK/Simple/LinkButton.rakumod diff --git a/lib/GTK/Simple/MarkUpLabel.pm6 b/lib/GTK/Simple/MarkUpLabel.rakumod similarity index 100% rename from lib/GTK/Simple/MarkUpLabel.pm6 rename to lib/GTK/Simple/MarkUpLabel.rakumod diff --git a/lib/GTK/Simple/Menu.pm6 b/lib/GTK/Simple/Menu.rakumod similarity index 100% rename from lib/GTK/Simple/Menu.pm6 rename to lib/GTK/Simple/Menu.rakumod diff --git a/lib/GTK/Simple/MenuBar.pm6 b/lib/GTK/Simple/MenuBar.rakumod similarity index 100% rename from lib/GTK/Simple/MenuBar.pm6 rename to lib/GTK/Simple/MenuBar.rakumod diff --git a/lib/GTK/Simple/MenuItem.pm6 b/lib/GTK/Simple/MenuItem.rakumod similarity index 100% rename from lib/GTK/Simple/MenuItem.pm6 rename to lib/GTK/Simple/MenuItem.rakumod diff --git a/lib/GTK/Simple/MenuToolButton.pm6 b/lib/GTK/Simple/MenuToolButton.rakumod similarity index 100% rename from lib/GTK/Simple/MenuToolButton.pm6 rename to lib/GTK/Simple/MenuToolButton.rakumod diff --git a/lib/GTK/Simple/NativeLib.pm6 b/lib/GTK/Simple/NativeLib.rakumod similarity index 100% rename from lib/GTK/Simple/NativeLib.pm6 rename to lib/GTK/Simple/NativeLib.rakumod diff --git a/lib/GTK/Simple/PlacesSidebar.pm6 b/lib/GTK/Simple/PlacesSidebar.rakumod similarity index 100% rename from lib/GTK/Simple/PlacesSidebar.pm6 rename to lib/GTK/Simple/PlacesSidebar.rakumod diff --git a/lib/GTK/Simple/ProgressBar.pm6 b/lib/GTK/Simple/ProgressBar.rakumod similarity index 100% rename from lib/GTK/Simple/ProgressBar.pm6 rename to lib/GTK/Simple/ProgressBar.rakumod diff --git a/lib/GTK/Simple/PropertyFacade.pm6 b/lib/GTK/Simple/PropertyFacade.rakumod similarity index 100% rename from lib/GTK/Simple/PropertyFacade.pm6 rename to lib/GTK/Simple/PropertyFacade.rakumod diff --git a/lib/GTK/Simple/RadioButton.pm6 b/lib/GTK/Simple/RadioButton.rakumod similarity index 100% rename from lib/GTK/Simple/RadioButton.pm6 rename to lib/GTK/Simple/RadioButton.rakumod diff --git a/lib/GTK/Simple/Raw.pm6 b/lib/GTK/Simple/Raw.rakumod similarity index 98% rename from lib/GTK/Simple/Raw.pm6 rename to lib/GTK/Simple/Raw.rakumod index 947e8c8..02a9a3e 100644 --- a/lib/GTK/Simple/Raw.pm6 +++ b/lib/GTK/Simple/Raw.rakumod @@ -519,6 +519,17 @@ sub gtk_entry_set_width_chars(GtkWidget $entry, int32 $num-chars) is export(:entry) {*} +sub gtk_entry_get_placeholder_text(GtkWidget $entry) + is native(>k-lib) + is export(:entry) + returns int32 +{*} + +sub gtk_entry_set_placeholder_text(GtkWidget $entry, Str $text) + is native(>k-lib) + is export(:entry) +{*} + # # Frame diff --git a/lib/GTK/Simple/Scale.pm6 b/lib/GTK/Simple/Scale.rakumod similarity index 100% rename from lib/GTK/Simple/Scale.pm6 rename to lib/GTK/Simple/Scale.rakumod diff --git a/lib/GTK/Simple/Scheduler.pm6 b/lib/GTK/Simple/Scheduler.rakumod similarity index 100% rename from lib/GTK/Simple/Scheduler.pm6 rename to lib/GTK/Simple/Scheduler.rakumod diff --git a/lib/GTK/Simple/ScrolledWindow.pm6 b/lib/GTK/Simple/ScrolledWindow.rakumod similarity index 100% rename from lib/GTK/Simple/ScrolledWindow.pm6 rename to lib/GTK/Simple/ScrolledWindow.rakumod diff --git a/lib/GTK/Simple/Separator.pm6 b/lib/GTK/Simple/Separator.rakumod similarity index 100% rename from lib/GTK/Simple/Separator.pm6 rename to lib/GTK/Simple/Separator.rakumod diff --git a/lib/GTK/Simple/Spinner.pm6 b/lib/GTK/Simple/Spinner.rakumod similarity index 100% rename from lib/GTK/Simple/Spinner.pm6 rename to lib/GTK/Simple/Spinner.rakumod diff --git a/lib/GTK/Simple/StatusBar.pm6 b/lib/GTK/Simple/StatusBar.rakumod similarity index 100% rename from lib/GTK/Simple/StatusBar.pm6 rename to lib/GTK/Simple/StatusBar.rakumod diff --git a/lib/GTK/Simple/Switch.pm6 b/lib/GTK/Simple/Switch.rakumod similarity index 100% rename from lib/GTK/Simple/Switch.pm6 rename to lib/GTK/Simple/Switch.rakumod diff --git a/lib/GTK/Simple/TextView.pm6 b/lib/GTK/Simple/TextView.rakumod similarity index 100% rename from lib/GTK/Simple/TextView.pm6 rename to lib/GTK/Simple/TextView.rakumod diff --git a/lib/GTK/Simple/ToggleButton.pm6 b/lib/GTK/Simple/ToggleButton.rakumod similarity index 100% rename from lib/GTK/Simple/ToggleButton.pm6 rename to lib/GTK/Simple/ToggleButton.rakumod diff --git a/lib/GTK/Simple/Toolbar.pm6 b/lib/GTK/Simple/Toolbar.rakumod similarity index 100% rename from lib/GTK/Simple/Toolbar.pm6 rename to lib/GTK/Simple/Toolbar.rakumod diff --git a/lib/GTK/Simple/VBox.pm6 b/lib/GTK/Simple/VBox.rakumod similarity index 100% rename from lib/GTK/Simple/VBox.pm6 rename to lib/GTK/Simple/VBox.rakumod diff --git a/lib/GTK/Simple/Widget.pm6 b/lib/GTK/Simple/Widget.rakumod similarity index 100% rename from lib/GTK/Simple/Widget.pm6 rename to lib/GTK/Simple/Widget.rakumod diff --git a/lib/GTK/Simple/Window.pm6 b/lib/GTK/Simple/Window.rakumod similarity index 100% rename from lib/GTK/Simple/Window.pm6 rename to lib/GTK/Simple/Window.rakumod diff --git a/migration/GTK3-4-migration.md b/migration/GTK3-4-migration.md new file mode 100644 index 0000000..dd5091c --- /dev/null +++ b/migration/GTK3-4-migration.md @@ -0,0 +1,133 @@ +# Migrating from GTK 3 to GTK 4 +> +---- +## Table of Contents +[Remove deprecated widgets](#remove-deprecated-widgets) + +---- +The main [migration source](https://developer.gnome.org/gtk4/unstable/gtk-migrating-3-to-4.html) suggests three stages, changing the GTK3 code to make migration easier, then changing, then steps after the migration. + +Steps before Migration [_] Verified not to exist in GTK::Simple [X] GTL::Simple ammended [?] GTK::Simple has problems, or not known for certain + +* [X] Do not use deprecated symbols + +* [_] Enable diagnostic warnings + +* [_] Do not use GTK-specific command line arguments + +* [_] Do not use widget style properties + +* [_] Review your window creation flags + +* [?] Stop using direct access to GdkEvent structs + +* [_] Stop using gdk_pointer_warp() + +* [_] Stop using non-RGBA visuals + +* [?] Stop using GtkBox padding, fill and expand child properties + +* [?] Stop using the state argument of GtkStyleContext getters + +* [?] Stop using gdk_pixbuf_get_from_window() and gdk_cairo_set_source_surface() + +* [?] Stop using GtkWidget event signals + +* [?] Set a proper application ID + +* [?] Stop using gtk_main() and related APIs + +* [?] Reduce the use of gtk_widget_destroy() + +* [?] Reduce the use of generic container APIs + +* [?] Review your use of icon resources + +## Remove deprecated widgets + + +* GtkSymbolicColor | Symbolic colors + + * GtkGradient | Gradients + + * Resource Files | Deprecated routines for handling resource files + +* GtkStyle | Deprecated object that holds style information for widgets + +* GtkHScale | A horizontal slider widget for selecting a value from a range + +* GtkVScale | A vertical slider widget for selecting a value from a range + +* GtkTearoffMenuItem | A menu item used to tear off and reattach its menu + +* GtkColorSelection | Deprecated widget used to select a color + +* GtkColorSelectionDialog | Deprecated dialog box for selecting a color + +* GtkHSV | A “color wheel” widget + +* GtkFontSelection | Deprecated widget for selecting fonts + +* GtkFontSelectionDialog | Deprecated dialog box for selecting fonts + +* GtkHBox | A horizontal container box + +* GtkVBox | A vertical container box + +* GtkHButtonBox | A container for arranging buttons horizontally + +* GtkVButtonBox | A container for arranging buttons vertically + +* GtkHPaned | A container with two panes arranged horizontally + +* GtkVPaned | A container with two panes arranged vertically + +* GtkTable | Pack widgets in regular patterns + +* GtkHSeparator | A horizontal separator + +* GtkVSeparator | A vertical separator + +* GtkHScrollbar | A horizontal scrollbar + +* GtkVScrollbar | A vertical scrollbar + +* GtkUIManager | Constructing menus and toolbars from an XML description + +* GtkActionGroup | A group of actions + +* GtkAction | A deprecated action which can be triggered by a menu or toolbar item + +* GtkToggleAction | An action which can be toggled between two states + +* GtkRadioAction | An action of which only one in a group can be active + +* GtkRecentAction | An action of which represents a list of recently used files + +* GtkActivatable | An interface for activatable widgets + +* GtkImageMenuItem | A deprecated widget for a menu item with an icon + +* GtkMisc | Base class for widgets with alignments and padding + +* Stock Items | Prebuilt common menu/toolbar items and corresponding icons + +* Themeable Stock Images | Manipulating stock icons + +* GtkNumerableIcon | A GIcon that allows numbered emblems + +* GtkArrow | Displays an arrow + +* GtkStatusIcon | Display an icon in the system tray + +* GtkThemingEngine | Theming renderers + +* GtkAlignment | A widget which controls the alignment and size of its child + + + + + + +---- +Rendered from migration/GTK3-4-migration at 2020-12-26T00:33:45Z \ No newline at end of file diff --git a/migration/GTK3-4-migration.pod6 b/migration/GTK3-4-migration.pod6 new file mode 100644 index 0000000..8e5b97d --- /dev/null +++ b/migration/GTK3-4-migration.pod6 @@ -0,0 +1,75 @@ +=begin pod +=TITLE Migrating from GTK 3 to GTK 4 + +The main L +suggests three stages, changing the GTK3 code to make migration easier, +then changing, then steps after the migration. + +Steps before Migration +[_] Verified not to exist in GTK::Simple +[X] GTL::Simple ammended +[?] GTK::Simple has problems, or not known for certain + +=item [X] Do not use deprecated symbols +=item [_] Enable diagnostic warnings +=item [_] Do not use GTK-specific command line arguments +=item [_] Do not use widget style properties +=item [_] Review your window creation flags +=item [?] Stop using direct access to GdkEvent structs + Seems to be OK + +=item [_] Stop using gdk_pointer_warp() +=item [_] Stop using non-RGBA visuals +=item [?] Stop using GtkBox padding, fill and expand child properties +=item [_] Stop using the state argument of GtkStyleContext getters +=item [?] Stop using gdk_pixbuf_get_from_window() and gdk_cairo_set_source_surface() +=item [?] Stop using GtkWidget event signals +=item [?] Set a proper application ID +=item [?] Stop using gtk_main() and related APIs +=item [?] Reduce the use of gtk_widget_destroy() +=item [?] Reduce the use of generic container APIs +=item [?] Review your use of icon resources + +=head2 Remove deprecated widgets + +=item GtkSymbolicColor | Symbolic colors +=item2 GtkGradient | Gradients +=item2 Resource Files | Deprecated routines for handling resource files +=item GtkStyle | Deprecated object that holds style information for widgets +=item GtkHScale | A horizontal slider widget for selecting a value from a range +=item GtkVScale | A vertical slider widget for selecting a value from a range +=item GtkTearoffMenuItem | A menu item used to tear off and reattach its menu +=item GtkColorSelection | Deprecated widget used to select a color +=item GtkColorSelectionDialog | Deprecated dialog box for selecting a color +=item GtkHSV | A “color wheel” widget +=item GtkFontSelection | Deprecated widget for selecting fonts +=item GtkFontSelectionDialog | Deprecated dialog box for selecting fonts +=item GtkHBox | A horizontal container box +=item GtkVBox | A vertical container box +=item GtkHButtonBox | A container for arranging buttons horizontally +=item GtkVButtonBox | A container for arranging buttons vertically +=item GtkHPaned | A container with two panes arranged horizontally +=item GtkVPaned | A container with two panes arranged vertically +=item GtkTable | Pack widgets in regular patterns +=item GtkHSeparator | A horizontal separator +=item GtkVSeparator | A vertical separator +=item GtkHScrollbar | A horizontal scrollbar +=item GtkVScrollbar | A vertical scrollbar +=item GtkUIManager | Constructing menus and toolbars from an XML description +=item GtkActionGroup | A group of actions +=item GtkAction | A deprecated action which can be triggered by a menu or toolbar item +=item GtkToggleAction | An action which can be toggled between two states +=item GtkRadioAction | An action of which only one in a group can be active +=item GtkRecentAction | An action of which represents a list of recently used files +=item GtkActivatable | An interface for activatable widgets +=item GtkImageMenuItem | A deprecated widget for a menu item with an icon +=item GtkMisc | Base class for widgets with alignments and padding +=item Stock Items | Prebuilt common menu/toolbar items and corresponding icons +=item Themeable Stock Images | Manipulating stock icons +=item GtkNumerableIcon | A GIcon that allows numbered emblems +=item GtkArrow | Displays an arrow +=item GtkStatusIcon | Display an icon in the system tray +=item GtkThemingEngine | Theming renderers +=item GtkAlignment | A widget which controls the alignment and size of its child + +=end pod \ No newline at end of file diff --git a/migration/files_with_deprecations.txt b/migration/files_with_deprecations.txt new file mode 100644 index 0000000..d6e48dc --- /dev/null +++ b/migration/files_with_deprecations.txt @@ -0,0 +1,7 @@ +lib/GTK/Simple/HBox.pm6 + $!gtk_widget = gtk_hbox_new($homogeneous, $spacing); +lib/GTK/Simple/Raw.pm6 + sub gtk_hbox_new(int32, int32) + sub gtk_vbox_new(int32, int32) +lib/GTK/Simple/VBox.pm6 + $!gtk_widget = gtk_vbox_new($homogeneous, $spacing); \ No newline at end of file diff --git a/migration/scan4deps.raku b/migration/scan4deps.raku new file mode 100644 index 0000000..2561713 --- /dev/null +++ b/migration/scan4deps.raku @@ -0,0 +1,61 @@ +#!/usr/bin/env perl6 +use v6.*; + +my @deps = < + GtkSymbolicColor + GtkGradient + GtkStyle + GtkHScale + GtkVScale + GtkTearoffMenuItem + GtkColorSelection + GtkColorSelectionDialog + GtkHSV + GtkFontSelection + GtkFontSelectionDialog + GtkHBox + GtkVBox + GtkHButtonBox + GtkVButtonBox + GtkHPaned + GtkVPaned + GtkTable + GtkHSeparator + GtkVSeparator + GtkHScrollbar + GtkVScrollbar + GtkUIManager + GtkActionGroup + GtkAction + GtkToggleAction + GtkRadioAction + GtkRecentAction + GtkActivatable + GtkImageMenuItem + GtkMisc + GtkNumerableIcon + GtkArrow + GtkStatusIcon + GtkThemingEngine + GtkAlignment +>; +@deps .= map({ 'gtk_' ~ .substr(3).lc}); +my @files = "lib/GTK".IO; +my @mod-files = gather while @files { + with @files.pop { + when :d { @files.append: .dir } + .take when .extension.lc eq 'pm6' + } +} +my @outp; +for @mod-files -> $fn { + my $taint = False; + for $fn.lines { + if $_ ~~ / @deps / { + @outp.append($fn) unless $taint; + $taint = True; + @outp.append: "\t$_" + } + } +} +'migration/files_with_deprecations.txt'.IO.spurt: @outp.join("\n"); diff --git a/t/01-sanity.t b/t/01-sanity.rakutest similarity index 99% rename from t/01-sanity.t rename to t/01-sanity.rakutest index f6c175d..fa597a1 100644 --- a/t/01-sanity.t +++ b/t/01-sanity.rakutest @@ -1,4 +1,3 @@ - use v6; use Test; use GTK::Simple; diff --git a/t/99-author-meta.t b/t/99-author-meta.rakutest similarity index 99% rename from t/99-author-meta.t rename to t/99-author-meta.rakutest index bfd2e58..49887e1 100644 --- a/t/99-author-meta.t +++ b/t/99-author-meta.rakutest @@ -1,4 +1,3 @@ - use v6; use Test;