From 18e499686d1c9991b65dc79272038b291bc14c5d Mon Sep 17 00:00:00 2001 From: Przemyslaw Date: Mon, 1 Apr 2024 09:01:24 +0200 Subject: Init --- .classpath | 6 + .project | 17 ++ ColorsMemory.desktop | 14 ++ CzytajTo.docx | Bin 0 -> 4929 bytes DEBIAN/HOWTO.txt | 2 + DEBIAN/colorsmemory-0.210503-1.tar.gz | Bin 0 -> 59147 bytes DEBIAN/colorsmemory.dsc | 40 +++++ DEBIAN/debian.changelog | 5 + DEBIAN/debian.changelog.txt | 5 + DEBIAN/debian.control | 13 ++ DEBIAN/debian.control.txt | 13 ++ DEBIAN/debian.rules | 24 +++ DEBIAN/format.sh | 2 + Makefile | 19 +++ Makefile.aur | 20 +++ PKG/PKGBUILD | 23 +++ RPM/colorsmemory.spec | 66 ++++++++ build.xml | 25 +++ colorsmemory.png | Bin 0 -> 4582 bytes colorsmemory.xcf | Bin 0 -> 8999 bytes makefile | 19 +++ src/ColorsMemory.java | 310 ++++++++++++++++++++++++++++++++++ src/Field.java | 41 +++++ wrapper-icon/Icon.rc | 1 + wrapper-icon/Makefile.old.win | 33 ++++ wrapper-icon/Makefile.win | 36 ++++ wrapper-icon/config.txt | 1 + wrapper-icon/icon/Jttt.ico | Bin 0 -> 2686 bytes wrapper-icon/icon/Trefle.ico | Bin 0 -> 47826 bytes wrapper-icon/icon/colorsmemory.ico | Bin 0 -> 2686 bytes wrapper-icon/icon/ufo-small.ico | Bin 0 -> 2190 bytes wrapper-icon/wrapper.c | 71 ++++++++ 32 files changed, 806 insertions(+) create mode 100644 .classpath create mode 100644 .project create mode 100644 ColorsMemory.desktop create mode 100644 CzytajTo.docx create mode 100644 DEBIAN/HOWTO.txt create mode 100644 DEBIAN/colorsmemory-0.210503-1.tar.gz create mode 100644 DEBIAN/colorsmemory.dsc create mode 100644 DEBIAN/debian.changelog create mode 100644 DEBIAN/debian.changelog.txt create mode 100644 DEBIAN/debian.control create mode 100644 DEBIAN/debian.control.txt create mode 100644 DEBIAN/debian.rules create mode 100755 DEBIAN/format.sh create mode 100644 Makefile create mode 100644 Makefile.aur create mode 100644 PKG/PKGBUILD create mode 100644 RPM/colorsmemory.spec create mode 100644 build.xml create mode 100644 colorsmemory.png create mode 100644 colorsmemory.xcf create mode 100644 makefile create mode 100644 src/ColorsMemory.java create mode 100644 src/Field.java create mode 100644 wrapper-icon/Icon.rc create mode 100644 wrapper-icon/Makefile.old.win create mode 100644 wrapper-icon/Makefile.win create mode 100644 wrapper-icon/config.txt create mode 100644 wrapper-icon/icon/Jttt.ico create mode 100644 wrapper-icon/icon/Trefle.ico create mode 100644 wrapper-icon/icon/colorsmemory.ico create mode 100644 wrapper-icon/icon/ufo-small.ico create mode 100644 wrapper-icon/wrapper.c diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/.project b/.project new file mode 100644 index 0000000..f54e595 --- /dev/null +++ b/.project @@ -0,0 +1,17 @@ + + + colorsmemory + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/ColorsMemory.desktop b/ColorsMemory.desktop new file mode 100644 index 0000000..b19fbee --- /dev/null +++ b/ColorsMemory.desktop @@ -0,0 +1,14 @@ +#!/usr/bin/env xdg-open + +[Desktop Entry] +Encoding=UTF-8 +Type=Application +Categories=Game; + +Name=Colors Memory + +Exec=java -jar /usr/bin/ColorsMemory.jar +Terminal=false +Icon=/usr/share/colorsmemory/colorsmemory.png + +Name[pl_PL]=Colors Memory diff --git a/CzytajTo.docx b/CzytajTo.docx new file mode 100644 index 0000000..db0fc98 Binary files /dev/null and b/CzytajTo.docx differ diff --git a/DEBIAN/HOWTO.txt b/DEBIAN/HOWTO.txt new file mode 100644 index 0000000..a371e0b --- /dev/null +++ b/DEBIAN/HOWTO.txt @@ -0,0 +1,2 @@ +foramt zapisu nazwy pliku: + photocrop_0.221225-0~alpha.tar.gz diff --git a/DEBIAN/colorsmemory-0.210503-1.tar.gz b/DEBIAN/colorsmemory-0.210503-1.tar.gz new file mode 100644 index 0000000..7e0571c Binary files /dev/null and b/DEBIAN/colorsmemory-0.210503-1.tar.gz differ diff --git a/DEBIAN/colorsmemory.dsc b/DEBIAN/colorsmemory.dsc new file mode 100644 index 0000000..6fbe340 --- /dev/null +++ b/DEBIAN/colorsmemory.dsc @@ -0,0 +1,40 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA256 + +Format: 1.0 +Source: colorsmemory +Binary: colorsmemory +Architecture: all +Version: 0.210503-2 +Maintainer: Przemysław R. Pietraszczyk +Homepage: https://prymula.ct8.pl +DEBTRANSFORM-TAR: colorsmemory-0.210503-2.tar.gz + +Standards-Version: 0.210503-2 +Build-Depends: debhelper-compat (>= 12), default-jdk, default-jdk-headless, fakeroot, ant +Package-List: +colorsmemory deb x11 optional arch=all +Files: + b31649bc23b2b7bca9ab70ea3410711a 128820 colorsmemory-0.210503-2.tar.gz + 29e7e7e60bc81891e3da3871b9eeb549 764 colorsmemory-0.210503-2.debian.tar.xz + +-----BEGIN PGP SIGNATURE----- + +mQENBGEf/c4BCAC2d4ymW0pRZV36qLtlt/WGb83kos5UX5UbwvkQrbUjAbOPOY8w +DT3M1neYOAPZx38924aPTFKbZPcz+rK/7Wcv1kzgfux5zXQJTLeqpkhUYAgXUg2p +oK9ZXsai82fOicTrClOyJLLYQ8C1vj8yUh7e3ERljEyp5Nxg/lY92rwcZ4WYR193 +nGDInlDl5JlWUcLlk/RFnC5bB+T6ZZr5FBX/eDnKAPEl+N3MWpDs2JLDy7EUPhcG +U/60X0wuXHPTwMoNbB3ep/bWRxwEej0sFad5GXeCh7hKCroi/kLmLTDIxSD8lsRr +Y4H/8H2lBBsQq7bRL88N6ZDGCocPo11V83kFABEBAAG0NmhvbWU6cHJ6ZW0gT0JT +IFByb2plY3QgPGhvbWU6cHJ6ZW1AYnVpbGQub3BlbnN1c2Uub3JnPokBPgQTAQgA +KAUCYR/9zgIbAwUJBB6wAAYLCQgHAwIGFQgCCQoLBBYCAwECHgECF4AACgkQcXEc +NPcNefFEAAf+Kg4cs/C99kEIMv/PO85VW+p8rcTwCViOFUX5WrBhwsRyPAKrJPPG +KD6PdnvoplcNQwhQ8nRsRiiaiUtPcj8Bvi6EdPgSgXXObKKJtCyaAa1rURdlb9iW +CfvXA6oW+PGlii9BMnXOAtkeFIzZooO9oXd+wez66P+4VWFiFzxanLfLn/hwbWxQ +68rlO3QNGbrMeODBgwh9s83XGmAg47mn2fldTAmTbJDf9tMi1LhX2MmLyN9wjqsd +4IZ9JMri2JTnIhYfxWdKT9gsu7q0g8LqonaXMvlOEyHFRF1YQ0i7G6fFbvDcKCZN +W1Eja55FdN7smv5Eck6UTIIYyWPuAv45uohGBBMRAgAGBQJhH/3PAAoJEDswEbdr +nWUj4M0AniJ389dyvUjjgS91AcOb08E4moV9AJ9WDL3/7GYYUL/Azw43QucWPnXr +uw== +=+lfH +-----END PGP SIGNATURE----- diff --git a/DEBIAN/debian.changelog b/DEBIAN/debian.changelog new file mode 100644 index 0000000..2171d74 --- /dev/null +++ b/DEBIAN/debian.changelog @@ -0,0 +1,5 @@ +colorsmemory (0.210503-0) unstable; urgency=low + + * Last release + + -- Przemysław R. Pietraszczyk Sat, 25 Dec 2022 08:31:41 +0200 diff --git a/DEBIAN/debian.changelog.txt b/DEBIAN/debian.changelog.txt new file mode 100644 index 0000000..2171d74 --- /dev/null +++ b/DEBIAN/debian.changelog.txt @@ -0,0 +1,5 @@ +colorsmemory (0.210503-0) unstable; urgency=low + + * Last release + + -- Przemysław R. Pietraszczyk Sat, 25 Dec 2022 08:31:41 +0200 diff --git a/DEBIAN/debian.control b/DEBIAN/debian.control new file mode 100644 index 0000000..b452fcd --- /dev/null +++ b/DEBIAN/debian.control @@ -0,0 +1,13 @@ +Source: colorsmemory +Section: java +Priority: extra +Maintainer: Przemysław R. Pietraszczyk +Build-Depends: debhelper-compat (= 12), default-jdk, default-jdk-headless, fakeroot, ant +Standards-Version: 0.210503-2 +Homepage: https://prymula.ct8.pl + + +Package: colorsmemory +Architecture: all +Depends: ${misc:Depends}, default-jdk | default-jre +Description: My implementation Memory game diff --git a/DEBIAN/debian.control.txt b/DEBIAN/debian.control.txt new file mode 100644 index 0000000..7d5bc4c --- /dev/null +++ b/DEBIAN/debian.control.txt @@ -0,0 +1,13 @@ +Source: colorsmemory +Section: java +Priority: extra +Maintainer: Przemysław R. Pietraszczyk +Build-Depends: debhelper-compat (= 13), openjdk-11-jdk, openjdk-11-jdk-headless, fakeroot, ant +Standards-Version: 0.210503-1 +Homepage: https://prymula.ct8.pl + + +Package: colormemory +Architecture: all +Depends: ${misc:Depends}, openjdk-11-jdk | openjdk-11-jre +Description: My implementation Memory game diff --git a/DEBIAN/debian.rules b/DEBIAN/debian.rules new file mode 100644 index 0000000..20b6b3b --- /dev/null +++ b/DEBIAN/debian.rules @@ -0,0 +1,24 @@ +#!/usr/bin/make -f + +export DH_VERBOSE = 1 +#export PYBUILD_NAME = photocrop +#export PYBUILD_SYSTEM = custom + +clean: + ant clean + +build: + ant compile + ant jar + +binary: + mkdir -pm 0755 debian/colormemory + mkdir -pm 0755 debian/colorsmemory/usr/bin + mkdir -pm 0755 debian/colorsmemory/usr/share/colorsmemory + mkdir -pm 0755 debian/colorsmemory/usr/share/applications + cp build/jar/ColorsMemory.jar debian/colorsmemory/usr/bin + cp colorsmemory.png debian/colorsmemory/usr/share/colorsmemory + cp ColorsMemory.desktop debian/colorsmemory/usr/share/applications + dh_gencontrol + dh_builddeb + diff --git a/DEBIAN/format.sh b/DEBIAN/format.sh new file mode 100755 index 0000000..49e73ab --- /dev/null +++ b/DEBIAN/format.sh @@ -0,0 +1,2 @@ +mkdir ./exec +exec /usr/lib/build/debtransform ./ ./colorsmemory.dsc ./exec diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b9db164 --- /dev/null +++ b/Makefile @@ -0,0 +1,19 @@ +# Link command: +#choinka: engin.o +# gcc engin.o -o choinka + +# Compilation commands: +#engin.o: engin.c +# gcc -c engin.c -o engin.o + + +prefix=/usr + +install: build/jar/ColorsMemory.jar + install -m 0644 build/jar/ColorsMemory.jar $(prefix)/games + mkdir -pm 0755 $(prefix)/share/colorsmemory + mkdir -pm 0755 $(prefix)/share/colorsmemory/icons + install -m 0644 colorsmemory.png $(prefix)/share/colorsmemory/icons + install -m 0644 ColorsMemory.desktop /usr/share/applications + +.PHONY: install diff --git a/Makefile.aur b/Makefile.aur new file mode 100644 index 0000000..ceef523 --- /dev/null +++ b/Makefile.aur @@ -0,0 +1,20 @@ + +prefix=/usr + +all: + ant compile + ant jar + +clean: + ant clean + +install: build/jar/ColorsMemory.jar + mkdir -pm 0755 $(DESTDIR)$(prefix)/games + mkdir -pm 0755 $(DESTDIR)$(prefix)/share/applications + mkdir -pm 0755 $(DESTDIR)$(prefix)/share/colorsmemory + mkdir -pm 0755 $(DESTDIR)$(prefix)/share/colorsmemory/icons + install -m 0644 build/jar/ColorsMemory.jar $(DESTDIR)$(prefix)/games + install -m 0644 colorsmemory.png $(DESTDIR)$(prefix)/share/colorsmemory/icons + install -m 0644 ColorsMemory.desktop $(DESTDIR)$(prefix)/share/applications + +.PHONY: install diff --git a/PKG/PKGBUILD b/PKG/PKGBUILD new file mode 100644 index 0000000..8a2e21e --- /dev/null +++ b/PKG/PKGBUILD @@ -0,0 +1,23 @@ +# Maintainer: Przemyslaw R. Pietraszczyk + +pkgname=colorsmemory +pkgver=0.210503 +pkgrel=2 +pkgdesc="My implementation Memory game" +arch=('any') +url="prymula.ct8.pl" +license=('GPL3') +provides=('colorsmemory') +depends=('jdk-openjdk') +makedepends=('jdk-openjdk' 'ant') +source=("${pkgname}-${pkgver}-${pkgrel}.tar.gz::file://${pkgname}-${pkgver}-${pkgrel}.tar.gz") +sha256sums=('169cb0d635a2e231ab9a4f752a4c9e58409b48fe50895459107f7163bdfa3948') #generate with 'makepkg -g' || sha256sum +build() { + cd "$srcdir/${pkgname}-${pkgver}-${pkgrel}" + make -f Makefile.aur +} + +package() { + cd "$srcdir/${pkgname}-${pkgver}-${pkgrel}" + make -f Makefile.aur DESTDIR="${pkgdir}" install +} diff --git a/RPM/colorsmemory.spec b/RPM/colorsmemory.spec new file mode 100644 index 0000000..0a92fb1 --- /dev/null +++ b/RPM/colorsmemory.spec @@ -0,0 +1,66 @@ +# +# spec file for package colorsmemory +# +# Copyright (c) 2020 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + +%define unmangled_version 0.210503-2 +Name: colorsmemory +Version: 0.210503 +Release: 2 +Summary: My implementation Memory game +License: GPL +URL: https://prymula.ct8.pl +Source0: %{name}-%{unmangled_version}.tar.gz +%if 0%{?suse_version}==1530 +BuildRequires: java-11-openjdk, ant +Requires: java-11-openjdk +%else +BuildRequires: java-11-openjdk, ant +Requires: java-11-openjdk +%endif +BuildArch: noarch + +%description + + +%prep +%setup -n %{name}-%{unmangled_version} -n %{name}-%{unmangled_version} + +%build +ant compile +ant jar + +%install +mkdir -p %{buildroot}/usr +mkdir -p %{buildroot}/usr/bin +mkdir -p %{buildroot}/usr/share +mkdir -p %{buildroot}/usr/share/colorsmemory +mkdir -p %{buildroot}/usr/share/applications + +#%make_install + +install -m 0644 build/jar/ColorsMemory.jar %{buildroot}/usr/bin +install -m 0644 colorsmemory.png %{buildroot}/usr/share/colorsmemory +install -m 0644 ColorsMemory.desktop %{buildroot}/usr/share/applications + +%files +%defattr(0755,root,root) +%{_datadir}/colorsmemory +%defattr(0644,root,root) +/usr/bin/ColorsMemory.jar +%{_datadir}/colorsmemory/colorsmemory.png +%{_datadir}/applications/ColorsMemory.desktop + +%changelog diff --git a/build.xml b/build.xml new file mode 100644 index 0000000..c674970 --- /dev/null +++ b/build.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/colorsmemory.png b/colorsmemory.png new file mode 100644 index 0000000..c68f2df Binary files /dev/null and b/colorsmemory.png differ diff --git a/colorsmemory.xcf b/colorsmemory.xcf new file mode 100644 index 0000000..bcc9990 Binary files /dev/null and b/colorsmemory.xcf differ diff --git a/makefile b/makefile new file mode 100644 index 0000000..ed10fc2 --- /dev/null +++ b/makefile @@ -0,0 +1,19 @@ +# Link command: +#choinka: engin.o +# gcc engin.o -o choinka + +# Compilation commands: +#engin.o: engin.c +# gcc -c engin.c -o engin.o + + +prefix=/usr/local + +install: build/jar/ColorsMemory.jar + install -m 0755 build/jar/ColorsMemory.jar $(prefix)/games + mkdir -pm 0777 $(prefix)/share/colorsmemory_jar + mkdir -pm 0777 $(prefix)/share/colorsmemory_jar/icons + install -m 0755 colorsmemory.png $(prefix)/share/colorsmemory_jar/icons + install -m 0755 ColorsMemory.desktop /usr/share/applications + +.PHONY: install diff --git a/src/ColorsMemory.java b/src/ColorsMemory.java new file mode 100644 index 0000000..0e11fef --- /dev/null +++ b/src/ColorsMemory.java @@ -0,0 +1,310 @@ +import java.awt.*; // Toolkit +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JPanel; +//import javax.swing.JButton; +import javax.swing.JComponent; +import javax.swing.JMenuBar; +import javax.swing.JMenu; +import javax.swing.JMenuItem; +import javax.swing.JOptionPane; +import javax.swing.Box; + +import java.awt.event.ActionListener; +import java.awt.event.ActionEvent; +import java.util.Timer; +import java.util.*; //Timer +import java.lang.*; + +public class ColorsMemory extends JPanel + implements ActionListener { + static JMenuBar menuBar; + JMenu menu, info; + JMenuItem menuItem, menuExit, menuInfo; + static final int NW=4, NH=4; // weight - height + static JFrame frame; + static Timer timer; + static Field [][]field = new Field[NH][NW]; + static int []tmpi = new int[2]; + static int []tmpj = new int[2]; + static boolean showColor=false; + static boolean press=false; + static boolean lockClick=false; + static int nmove=0; + static int nFields; // ilosc pozostalych pol do odkrycia + static JLabel label = new JLabel("Witaj w Colors Memory!"); + + public ColorsMemory() { + super(new GridBagLayout()); + GridBagLayout gridbag = (GridBagLayout)getLayout(); + GridBagConstraints c = new GridBagConstraints(); + int i; + int j; + // int x, y; + int k=0; + + menuBar = new JMenuBar(); + menu = new JMenu("Plik"); + menuBar.add(menu); + // przenosi INFO na prawa strone + menuBar.add(Box.createHorizontalGlue()); + info = new JMenu("Info"); + info.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); + menuBar.add(info); + menuItem = new JMenuItem("Nowa Gra", null); + menuItem.setActionCommand("NewGame"); + menuItem.addActionListener(this); + menuItem.setToolTipText("Rozpoczyna nowa gre"); + menu.add(menuItem); + menu.addSeparator(); + menuItem = new JMenuItem("Zakoncz", null); + menuItem.setActionCommand("Exit"); + menuItem.addActionListener(this); + menuItem.setToolTipText("Wyjscie z programu"); + menu.add(menuItem); + menuItem = new JMenuItem("O Programie", null); + menuItem.setActionCommand("About"); + menuItem.addActionListener(this); + menuItem.setToolTipText("Informacje o programie"); + info.add(menuItem); + + for (i=0;i // printf +#include // exit +#include +#include // sleep access + +/* +char * current(char * name){ + char *file; + + if (!getenv("CD")) { + printf ("Zmienna srodowiskowa \"CD\" nie istnieje !\n"); + exit (1); + } + file=malloc(strlen(getenv("CD")+strlen(name)+1)); + strcpy(file, getenv("CD")); + strcat(file, name); + + return file; +} +*/ + +char * file_exist(){ + char * name = (char *)".\\config.txt"; + //char *file = current(name); + char *file = name; + + if (access(file, F_OK)==0){ + printf("PLIK istnieje %s\n",file); + free(file); + return file; + } + printf("PLIK nie istnieje %s\n",file); + free(file); + return NULL; +} + + + +void load(){ + + char * file = file_exist(); + char bufor1[128]; + char bufor2[128]; + char bufor3[128]; + char run[384]; + + if (!file) exit(1); + + FILE * f = fopen(file, "r"); + fscanf(f, "%s %s %s", bufor1,bufor2,bufor3); + fclose(f); + strcpy(run, bufor1); + strcat(run, " "); + strcat(run, bufor2); + strcat(run, " "); + strcat(run, bufor3); + printf("Uruchamiam %s \n",run); + free(file); + + system(run); + + + + +} + +int main (){ + load(); + + return 0; +} -- cgit v1.2.3