Add gtk141

This commit is contained in:
daleclack 2022-10-12 17:24:28 +08:00
parent 89a0f11feb
commit f454ce62ad
19 changed files with 1575 additions and 0 deletions

View File

@ -0,0 +1,72 @@
set(CMAKE_CXX_STANDARD 17)
cmake_minimum_required(VERSION 3.0.0)
project(gtk141_minesweeper2 VERSION 1.0.0)
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/../../GCR_CMake/macros)
include(GlibCompileResourcesSupport)
include(CTest)
enable_testing()
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)
include_directories(.)
include_directories(..)
#Find PkgConfig to use gtkmm3
find_package (PkgConfig REQUIRED)
pkg_check_modules (GTKMM3 REQUIRED gtkmm-3.0)
include_directories (${GTKMM3_INCLUDE_DIRS})
link_directories (${GTKMM3_LIBRARY_DIRS})
#Find Gettext
find_package (Gettext REQUIRED)
set(PO_DIR ${CMAKE_BINARY_DIR}/po/zh_CN/LC_MESSAGES)
#Source files
set(SOURCE_FILE src/main.cc src/MineSweeper.cc)
#Compile Resource
# set(RESOURCE_LIST
# text_menu.xml)
# compile_gresources(RESOURCE_FILE
# XML_OUT
# TYPE EMBED_C
# RESOURCES ${RESOURCE_LIST}
# PREFIX "/org/gtk/daleclack"
# SOURCE_DIR ${PROJECT_SOURCE_DIR}/res)
# Add a custom target to the makefile. Now make builds our resource file.
# It depends on the output RESOURCE_FILE.
# add_custom_target(resource ALL DEPENDS ${RESOURCE_FILE})
#For win32 platform,use rc resource and .ico icon
if(WIN32)
SET(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)
set(app_WINRC ../icon.rc)
set_property(SOURCE ../icon.rc APPEND PROPERTY
OBJECT_DEPENDS ${PROJECT_SOURCE_DIR}/../icon.ico
)
add_executable(${PROJECT_NAME} WIN32 ${app_WINRC} ${SOURCE_FILE})
add_custom_command( TARGET ${PROJECT_NAME}
COMMAND echo * > ${CMAKE_BINARY_DIR}/.gitignore
COMMAND echo **/* > ${CMAKE_BINARY_DIR}/.hgignore)
else()
add_executable(${PROJECT_NAME} ${SOURCE_FILE})
add_custom_command( TARGET ${PROJECT_NAME}
COMMAND echo \"*\" > ${CMAKE_BINARY_DIR}/.gitignore
COMMAND echo \"**/*\" > ${CMAKE_BINARY_DIR}/.hgignore)
endif(WIN32)
#Add command to generate .gitignore and .mo files
# add_custom_command( TARGET ${PROJECT_NAME}
# COMMAND mkdir -p ${PO_DIR}
# COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} ${CMAKE_SOURCE_DIR}/po/zh_CN.po -o ${PO_DIR}/${PROJECT_NAME}.mo)
SET (CMAKE_EXTRA_CXX_FLAGS ${GTKMM3_CFLAGS_OTHER})
target_link_libraries (${PROJECT_NAME} ${GTKMM3_LIBRARIES} -lpthread)

View File

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="64"
height="64"
id="svg3767"
version="1.1"
inkscape:version="0.48.4 r9939"
sodipodi:docname="New document 3">
<defs
id="defs3769" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="5.6"
inkscape:cx="33.68578"
inkscape:cy="31.76782"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1120"
inkscape:window-height="647"
inkscape:window-x="0"
inkscape:window-y="66"
inkscape:window-maximized="0" />
<metadata
id="metadata3772">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-988.36218)">
<text
xml:space="preserve"
style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Cantarell;-inkscape-font-specification:Cantarell"
x="28.284271"
y="32.685272"
id="text4299"
sodipodi:linespacing="125%"
transform="translate(0,988.36218)"><tspan
sodipodi:role="line"
id="tspan4301"
x="28.284271"
y="32.685272" /></text>
<text
xml:space="preserve"
style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#2e3436;fill-opacity:1;stroke:none;font-family:Cantarell;-inkscape-font-specification:Cantarell"
x="8.7441406"
y="1046.6063"
id="text4303"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan4305"
x="8.7441406"
y="1046.6063"
style="font-size:72px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;fill:#2e3436;font-family:Monospace;-inkscape-font-specification:Monospace Bold">1</tspan></text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="64"
height="64"
id="svg3767"
version="1.1"
inkscape:version="0.48.4 r9939"
sodipodi:docname="2mines.svg">
<defs
id="defs3769" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="5.6"
inkscape:cx="33.68578"
inkscape:cy="31.76782"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1120"
inkscape:window-height="647"
inkscape:window-x="0"
inkscape:window-y="66"
inkscape:window-maximized="0" />
<metadata
id="metadata3772">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-988.36218)">
<text
xml:space="preserve"
style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Cantarell;-inkscape-font-specification:Cantarell"
x="28.284271"
y="32.685272"
id="text4299"
sodipodi:linespacing="125%"
transform="translate(0,988.36218)"><tspan
sodipodi:role="line"
id="tspan4301"
x="28.284271"
y="32.685272" /></text>
<text
xml:space="preserve"
style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#2e3436;fill-opacity:1;stroke:none;font-family:Cantarell;-inkscape-font-specification:Cantarell"
x="11.292969"
y="1047.0809"
id="text4303"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan4305"
x="11.292969"
y="1047.0809"
style="font-size:72px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;fill:#2e3436;font-family:Monospace;-inkscape-font-specification:Monospace Bold">2</tspan></text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="64"
height="64"
id="svg3767"
version="1.1"
inkscape:version="0.48.4 r9939"
sodipodi:docname="3mines.svg">
<defs
id="defs3769" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="5.6"
inkscape:cx="33.68578"
inkscape:cy="31.76782"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1120"
inkscape:window-height="647"
inkscape:window-x="0"
inkscape:window-y="66"
inkscape:window-maximized="0" />
<metadata
id="metadata3772">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-988.36218)">
<text
xml:space="preserve"
style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Cantarell;-inkscape-font-specification:Cantarell"
x="28.284271"
y="32.685272"
id="text4299"
sodipodi:linespacing="125%"
transform="translate(0,988.36218)"><tspan
sodipodi:role="line"
id="tspan4301"
x="28.284271"
y="32.685272" /></text>
<text
xml:space="preserve"
style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#2e3436;fill-opacity:1;stroke:none;font-family:Cantarell;-inkscape-font-specification:Cantarell"
x="10.466797"
y="1046.5712"
id="text4303"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan4305"
x="10.466797"
y="1046.5712"
style="font-size:72px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;fill:#2e3436;font-family:Monospace;-inkscape-font-specification:Monospace Bold">3</tspan></text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="64"
height="64"
id="svg3767"
version="1.1"
inkscape:version="0.48.4 r9939"
sodipodi:docname="4mines.svg">
<defs
id="defs3769" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="5.6"
inkscape:cx="33.68578"
inkscape:cy="32.791013"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1120"
inkscape:window-height="647"
inkscape:window-x="0"
inkscape:window-y="66"
inkscape:window-maximized="0" />
<metadata
id="metadata3772">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-988.36218)">
<text
xml:space="preserve"
style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Cantarell;-inkscape-font-specification:Cantarell"
x="28.284271"
y="32.685272"
id="text4299"
sodipodi:linespacing="125%"
transform="translate(0,988.36218)"><tspan
sodipodi:role="line"
id="tspan4301"
x="28.284271"
y="32.685272" /></text>
<text
xml:space="preserve"
style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#2e3436;fill-opacity:1;stroke:none;font-family:Cantarell;-inkscape-font-specification:Cantarell"
x="10.150391"
y="1046.6063"
id="text4303"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan4305"
x="10.150391"
y="1046.6063"
style="font-size:72px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;fill:#2e3436;font-family:Monospace;-inkscape-font-specification:Monospace Bold">4</tspan></text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="64"
height="64"
id="svg3767"
version="1.1"
inkscape:version="0.48.4 r9939"
sodipodi:docname="5mines.svg">
<defs
id="defs3769" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="5.6"
inkscape:cx="33.68578"
inkscape:cy="32.791013"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1120"
inkscape:window-height="647"
inkscape:window-x="0"
inkscape:window-y="66"
inkscape:window-maximized="0" />
<metadata
id="metadata3772">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-988.36218)">
<text
xml:space="preserve"
style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Cantarell;-inkscape-font-specification:Cantarell"
x="28.284271"
y="32.685272"
id="text4299"
sodipodi:linespacing="125%"
transform="translate(0,988.36218)"><tspan
sodipodi:role="line"
id="tspan4301"
x="28.284271"
y="32.685272" /></text>
<text
xml:space="preserve"
style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#2e3436;fill-opacity:1;stroke:none;font-family:Cantarell;-inkscape-font-specification:Cantarell"
x="10.255859"
y="1046.0966"
id="text4303"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan4305"
x="10.255859"
y="1046.0966"
style="font-size:72px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;fill:#2e3436;font-family:Monospace;-inkscape-font-specification:Monospace Bold">5</tspan></text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="64"
height="64"
id="svg3767"
version="1.1"
inkscape:version="0.48.4 r9939"
sodipodi:docname="6mines.svg">
<defs
id="defs3769" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="5.6"
inkscape:cx="33.68578"
inkscape:cy="33.265622"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1120"
inkscape:window-height="647"
inkscape:window-x="0"
inkscape:window-y="66"
inkscape:window-maximized="0" />
<metadata
id="metadata3772">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-988.36218)">
<text
xml:space="preserve"
style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Cantarell;-inkscape-font-specification:Cantarell"
x="28.284271"
y="32.685272"
id="text4299"
sodipodi:linespacing="125%"
transform="translate(0,988.36218)"><tspan
sodipodi:role="line"
id="tspan4301"
x="28.284271"
y="32.685272" /></text>
<text
xml:space="preserve"
style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#2e3436;fill-opacity:1;stroke:none;font-family:Cantarell;-inkscape-font-specification:Cantarell"
x="9.9746094"
y="1046.5009"
id="text4303"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan4305"
x="9.9746094"
y="1046.5009"
style="font-size:72px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;fill:#2e3436;font-family:Monospace;-inkscape-font-specification:Monospace Bold">6</tspan></text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="64"
height="64"
id="svg3767"
version="1.1"
inkscape:version="0.48.4 r9939"
sodipodi:docname="7mines.svg">
<defs
id="defs3769" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="5.6"
inkscape:cx="33.68578"
inkscape:cy="33.265622"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1120"
inkscape:window-height="647"
inkscape:window-x="0"
inkscape:window-y="66"
inkscape:window-maximized="0" />
<metadata
id="metadata3772">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-988.36218)">
<text
xml:space="preserve"
style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Cantarell;-inkscape-font-specification:Cantarell"
x="28.284271"
y="32.685272"
id="text4299"
sodipodi:linespacing="125%"
transform="translate(0,988.36218)"><tspan
sodipodi:role="line"
id="tspan4301"
x="28.284271"
y="32.685272" /></text>
<text
xml:space="preserve"
style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#2e3436;fill-opacity:1;stroke:none;font-family:Cantarell;-inkscape-font-specification:Cantarell"
x="10.660156"
y="1046.6063"
id="text4303"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan4305"
x="10.660156"
y="1046.6063"
style="font-size:72px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;fill:#2e3436;font-family:Monospace;-inkscape-font-specification:Monospace Bold">7</tspan></text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="64"
height="64"
id="svg3767"
version="1.1"
inkscape:version="0.48.4 r9939"
sodipodi:docname="8mines.svg">
<defs
id="defs3769" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="5.6"
inkscape:cx="33.68578"
inkscape:cy="33.265622"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1120"
inkscape:window-height="647"
inkscape:window-x="0"
inkscape:window-y="66"
inkscape:window-maximized="0" />
<metadata
id="metadata3772">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-988.36218)">
<text
xml:space="preserve"
style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Cantarell;-inkscape-font-specification:Cantarell"
x="28.284271"
y="32.685272"
id="text4299"
sodipodi:linespacing="125%"
transform="translate(0,988.36218)"><tspan
sodipodi:role="line"
id="tspan4301"
x="28.284271"
y="32.685272" /></text>
<text
xml:space="preserve"
style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#2e3436;fill-opacity:1;stroke:none;font-family:Cantarell;-inkscape-font-specification:Cantarell"
x="10.326172"
y="1046.5712"
id="text4303"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan4305"
x="10.326172"
y="1046.5712"
style="font-size:72px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;fill:#2e3436;font-family:Monospace;-inkscape-font-specification:Monospace Bold">8</tspan></text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@ -0,0 +1,125 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
width="64"
height="64"
id="svg1"
sodipodi:version="0.32"
inkscape:version="0.48.4 r9939"
sodipodi:docname="bang.svg">
<defs
id="defs24" />
<metadata
id="metadata23">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="2.8284271"
inkscape:cx="48.730753"
inkscape:cy="40.238815"
inkscape:window-width="1600"
inkscape:window-height="834"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:current-layer="svg1"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:window-maximized="1"
inkscape:snap-nodes="true"
inkscape:snap-bbox="false">
<inkscape:grid
type="xygrid"
id="grid3007"
empspacing="5"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true" />
</sodipodi:namedview>
<linearGradient
id="paint"
gradientUnits="userSpaceOnUse"
x1="14.5"
y1="99"
x2="119.5"
y2="99">
<stop
offset="0"
style="stop-color:#DA1800"
id="stop17" />
<stop
offset="0.33"
style="stop-color:#B42D2D"
id="stop18" />
<stop
offset="0.66"
style="stop-color:#FA1818"
id="stop19" />
<stop
offset="1"
style="stop-color:#B42D2D"
id="stop20" />
</linearGradient>
<path
transform="matrix(1.4,0,0,1.4,-1074,-577)"
d="m 805,435 a 15,15 0 1 1 -30,0 15,15 0 1 1 30,0 z"
sodipodi:ry="15"
sodipodi:rx="15"
sodipodi:cy="435"
sodipodi:cx="790"
id="path2999"
style="fill:#cc0000;fill-opacity:1;stroke:none"
sodipodi:type="arc" />
<rect
style="fill:#cc0000;fill-opacity:1;stroke:none"
id="rect3001"
width="8"
height="64"
x="28"
y="0"
rx="4.5999999"
ry="4.5999999" />
<rect
ry="4.5999999"
rx="4.5999999"
y="-43.712814"
x="39.712811"
height="64"
width="8"
id="rect3013"
style="fill:#cc0000;fill-opacity:1;stroke:none"
transform="matrix(0.5,0.8660254,-0.8660254,0.5,0,0)" />
<rect
transform="matrix(-0.5,0.8660254,-0.8660254,-0.5,0,0)"
style="fill:#cc0000;fill-opacity:1;stroke:none"
id="rect3015"
width="8"
height="64"
x="7.7128115"
y="-75.712807"
rx="4.5999999"
ry="4.5999999" />
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
width="64"
height="64"
id="svg9373"
inkscape:version="0.48.4 r9939"
sodipodi:docname="flag.svg">
<metadata
id="metadata9418">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs9416" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1600"
inkscape:window-height="834"
id="namedview9414"
showgrid="false"
inkscape:snap-nodes="false"
inkscape:snap-bbox="true"
inkscape:zoom="1"
inkscape:cx="37.101481"
inkscape:cy="14.748665"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
inkscape:current-layer="svg9373">
<inkscape:grid
type="xygrid"
id="grid9641"
empspacing="5"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true" />
</sodipodi:namedview>
<linearGradient
id="paint"
gradientUnits="userSpaceOnUse"
x1="14.5"
y1="99"
x2="119.5"
y2="99">
<stop
offset="0"
style="stop-color:#DA1800"
id="stop9404" />
<stop
offset="0.33"
style="stop-color:#B42D2D"
id="stop9406" />
<stop
offset="0.66"
style="stop-color:#FA1818"
id="stop9408" />
<stop
offset="1"
style="stop-color:#B42D2D"
id="stop9410" />
</linearGradient>
<path
style="fill:#2e3436;fill-opacity:1;stroke-width:1;stroke-miterlimit:4"
d="M 8.086319,0.175024 17.084785,0 l 0,3.104056 L 58.104384,20.741065 17.040446,38.378074 16.99727,64 8,64 z"
id="path9621"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccc" />
</svg>

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
width="64"
height="64"
id="svg9373"
inkscape:version="0.48.4 r9939"
sodipodi:docname="flag.svg">
<metadata
id="metadata9418">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs9416" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1600"
inkscape:window-height="834"
id="namedview9414"
showgrid="false"
inkscape:snap-nodes="false"
inkscape:snap-bbox="true"
inkscape:zoom="1"
inkscape:cx="37.101481"
inkscape:cy="14.748665"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
inkscape:current-layer="svg9373">
<inkscape:grid
type="xygrid"
id="grid9641"
empspacing="5"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true" />
</sodipodi:namedview>
<linearGradient
id="paint"
gradientUnits="userSpaceOnUse"
x1="14.5"
y1="99"
x2="119.5"
y2="99">
<stop
offset="0"
style="stop-color:#DA1800"
id="stop9404" />
<stop
offset="0.33"
style="stop-color:#B42D2D"
id="stop9406" />
<stop
offset="0.66"
style="stop-color:#FA1818"
id="stop9408" />
<stop
offset="1"
style="stop-color:#B42D2D"
id="stop9410" />
</linearGradient>
<path
style="fill:#2e3436;fill-opacity:1;stroke-width:1;stroke-miterlimit:4"
d="M 8.086319,0.175024 17.084785,0 l 0,3.104056 L 58.104384,20.741065 17.040446,38.378074 16.99727,64 8,64 z"
id="path9621"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccc" />
</svg>

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@ -0,0 +1,101 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
width="64"
height="64"
id="svg9373"
inkscape:version="0.48.4 r9939"
sodipodi:docname="flag-question.svg">
<metadata
id="metadata9418">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs9416" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1600"
inkscape:window-height="834"
id="namedview9414"
showgrid="true"
inkscape:snap-nodes="false"
inkscape:snap-bbox="true"
inkscape:zoom="1"
inkscape:cx="47.542826"
inkscape:cy="16.424223"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
inkscape:current-layer="svg9373">
<inkscape:grid
type="xygrid"
id="grid9641"
empspacing="5"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true" />
</sodipodi:namedview>
<linearGradient
id="paint"
gradientUnits="userSpaceOnUse"
x1="14.5"
y1="99"
x2="119.5"
y2="99">
<stop
offset="0"
style="stop-color:#DA1800"
id="stop9404" />
<stop
offset="0.33"
style="stop-color:#B42D2D"
id="stop9406" />
<stop
offset="0.66"
style="stop-color:#FA1818"
id="stop9408" />
<stop
offset="1"
style="stop-color:#B42D2D"
id="stop9410" />
</linearGradient>
<path
style="fill:#2e3436;fill-opacity:1;stroke-width:1;stroke-miterlimit:4"
d="M 8.086319,0.175024 17.084785,0 l 0,3.104056 L 58.104384,20.741065 17.040446,38.378074 16.99727,64 8,64 z"
id="path9621"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccc" />
<g
style="fill:#2e3436;fill-opacity:1"
transform="matrix(2.7979138,0,0,2.7979138,-223.48821,-253.48342)"
id="g15007">
<path
style="color:#bebebe;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible"
d="m 97.348014,103.46875 c 1.64243,-0.092 3.095496,1.17008 3.187496,2.8125 -1e-4,1.40136 -0.37771,1.92177 -1.593746,2.84375 -0.19093,0.14364 -0.3256,0.2506 -0.375,0.3125 -0.0494,0.0621 -0.0312,0.0332 -0.0312,0.0312 0.007,0.52831 -0.47163,1 -1,1 -0.52837,0 -1.007,-0.47169 -1,-1 0,-0.50239 0.22424,-0.94342 0.46875,-1.25 0.24451,-0.30663 0.4913,-0.51638 0.71875,-0.6875 0.20405,-0.16056 0.46083,-0.38454 0.6875,-0.65625 0.0935,-0.1121 0.129,-0.30766 0.125,-0.4375 l 0,-0.0312 c -0.0316,-0.56324 -0.49926,-0.9691 -1.0625,-0.9375 -0.56324,0.0316 -0.9691,0.43676 -0.9375,1 l -2,0 c -0.092,-1.64243 1.17007,-2.9079 2.8125,-3 z m 0.1875,8 c 0.55228,0 1,0.44772 1,1 0,0.55228 -0.44772,1 -1,1 -0.55228,0 -1,-0.44772 -1,-1 0,-0.55228 0.44772,-1 1,-1 z"
id="path15009"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccsccccccsccccsssss" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@ -0,0 +1,125 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
width="64"
height="64"
id="svg1"
sodipodi:version="0.32"
inkscape:version="0.48.4 r9939"
sodipodi:docname="mine.svg">
<defs
id="defs24" />
<metadata
id="metadata23">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="2.8284271"
inkscape:cx="48.730753"
inkscape:cy="40.238815"
inkscape:window-width="1600"
inkscape:window-height="834"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:current-layer="svg1"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:window-maximized="1"
inkscape:snap-nodes="true"
inkscape:snap-bbox="false">
<inkscape:grid
type="xygrid"
id="grid3007"
empspacing="5"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true" />
</sodipodi:namedview>
<linearGradient
id="paint"
gradientUnits="userSpaceOnUse"
x1="14.5"
y1="99"
x2="119.5"
y2="99">
<stop
offset="0"
style="stop-color:#DA1800"
id="stop17" />
<stop
offset="0.33"
style="stop-color:#B42D2D"
id="stop18" />
<stop
offset="0.66"
style="stop-color:#FA1818"
id="stop19" />
<stop
offset="1"
style="stop-color:#B42D2D"
id="stop20" />
</linearGradient>
<path
transform="matrix(1.4,0,0,1.4,-1074,-577)"
d="m 805,435 a 15,15 0 1 1 -30,0 15,15 0 1 1 30,0 z"
sodipodi:ry="15"
sodipodi:rx="15"
sodipodi:cy="435"
sodipodi:cx="790"
id="path2999"
style="fill:#2e3436;fill-opacity:1;stroke:none"
sodipodi:type="arc" />
<rect
style="fill:#2e3436;fill-opacity:1;stroke:none"
id="rect3001"
width="8"
height="64"
x="28"
y="0"
rx="4.5999999"
ry="4.5999999" />
<rect
ry="4.5999999"
rx="4.5999999"
y="-43.712814"
x="39.712811"
height="64"
width="8"
id="rect3013"
style="fill:#2e3436;fill-opacity:1;stroke:none"
transform="matrix(0.5,0.8660254,-0.8660254,0.5,0,0)" />
<rect
transform="matrix(-0.5,0.8660254,-0.8660254,-0.5,0,0)"
style="fill:#2e3436;fill-opacity:1;stroke:none"
id="rect3015"
width="8"
height="64"
x="7.7128115"
y="-75.712807"
rx="4.5999999"
ry="4.5999999" />
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -0,0 +1,19 @@
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<!DOCTYPE cambalache-project SYSTEM "cambalache-project.dtd">
<cambalache-project version="0.11.2" target_tk="gtk+-3.0">
<ui>
(1,None,"minesweeper.ui","minesweeper.ui",None,None,None,None,None,None,None)
</ui>
<object>
(1,1,"GtkWindow","minesweeper",None,None,None,None,None,None),
(1,2,"GtkStack","main_stack",1,None,None,None,-1,None),
(1,3,"GtkGrid","start_page",2,None,None,None,-1,None)
</object>
<object_property>
(1,1,"GtkContainer","resize-mode","queue",None,None,None,None,None),
(1,1,"GtkWindow","default-height","400",None,None,None,None,None),
(1,1,"GtkWindow","default-width","700",None,None,None,None,None),
(1,2,"GtkStack","transition-type","slide-right",None,None,None,None,None),
(1,2,"GtkWidget","halign","baseline",None,None,None,None,None)
</object_property>
</cambalache-project>

View File

@ -0,0 +1,72 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.40.0 -->
<!-- Created with Cambalache 0.11.2 -->
<interface>
<requires lib="gtk+" version="3.24"/>
<object class="GtkWindow" id="minesweeper">
<property name="can-focus">False</property>
<property name="default-width">700</property>
<property name="default-height">400</property>
<child>
<object class="GtkStack" id="main_stack">
<property name="can-focus">False</property>
<property name="halign">baseline</property>
<property name="transition-type">slide-right</property>
<child>
<!-- n-columns=3 n-rows=3 -->
<object class="GtkGrid" id="start_page">
<property name="can-focus">False</property>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
</child>
<child>
<object class="GtkBox" id="main_box">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="name">page0</property>
<property name="title" translatable="yes">page0</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
</interface>

View File

@ -0,0 +1,190 @@
#include "MineSweeper.hh"
#include <string>
MineSweeper::MineSweeper()
: main_box(Gtk::ORIENTATION_VERTICAL, 5),
btn_box(Gtk::ORIENTATION_HORIZONTAL, 5)
{
// Initalize Window
set_title("Gtkmm MineSweeper");
set_icon_name("org.gtk.daleclack");
// Append buttons to grid
for (int i = 0; i < 7; i++)
{
for (int j = 0; j < 7; j++)
{
// cell[i * 7 + j].set_label("?");
cell[i * 7 + j].signal_clicked().connect(sigc::bind(
sigc::mem_fun(*this, &MineSweeper::cell_clicked), &cell[i * 7 + j]));
mine_grid.attach(cell[i * 7 + j], j, i);
}
}
// Default setting
reset_game();
// Buttons
btnstart.set_label("Start/Reset");
btnshow.set_label("Show All");
btnexit.set_label("Exit");
btn_box.pack_start(btnstart, Gtk::PACK_SHRINK);
btn_box.pack_start(btnshow, Gtk::PACK_SHRINK);
btn_box.pack_start(btnexit, Gtk::PACK_SHRINK);
btnstart.signal_clicked().connect(sigc::mem_fun(*this, &MineSweeper::reset_game));
btnshow.signal_clicked().connect(sigc::mem_fun(*this, &MineSweeper::show_mines));
btnexit.signal_clicked().connect(sigc::mem_fun(*this, &MineSweeper::hide));
// Pack widgets
status_label.set_halign(Gtk::ALIGN_CENTER);
btn_box.set_halign(Gtk::ALIGN_CENTER);
main_box.pack_start(status_label, Gtk::PACK_SHRINK);
main_box.pack_start(mine_grid);
main_box.pack_start(btn_box, Gtk::PACK_SHRINK);
// Show everything
add(main_box);
show_all_children();
}
void MineSweeper::reset_game()
{
// Reset timer
mytimer.disconnect();
timer_count = 0;
mytimer = Glib::signal_timeout().connect(sigc::mem_fun(*this, &MineSweeper::timer_func), 1000);
mine_count = 0;
// Reset all data
for (int i = 0; i < 7; i++)
{
for (int j = 0; j < 7; j++)
{
cell[i * 7 + j].set_label("?");
cell[i * 7 + j].mines_around = 0;
cell[i * 7 + j].has_mine = false;
cell[i * 7 + j].cleared = false;
}
}
// Reset mines
while (mine_count < 9)
{
int index = g_random_int_range(0, 49);
if (!(cell[index].has_mine))
{
cell[index].has_mine = true;
// cell[index].set_label("x");
mine_count++;
}
}
// std::cout << mine_count << std::endl;
game_ended = false;
winned = true;
status_label.set_label(" ");
calc_mines();
}
void MineSweeper::calc_mines()
{
for (int i = 0; i < 7; i++)
{
for (int j = 0; j < 7; j++)
{
// std::fstream outfile;
// outfile.open("test.txt", std::ios_base::app);
// if (outfile.is_open())
// {
// outfile << "Start:" << i << " " << j << std::endl;
// outfile << "index1:" << MAX(0, i - 1) << " " << MIN(i + 1, 6) << std::endl;
// outfile << "index2:" << MAX(0, j - 1) << " " << MIN(j + 1, 6) << std::endl;
// }
// outfile.close();
int index1, index2;
for (index1 = MAX(0, i - 1); index1 < MIN(i + 1, 6) + 1; index1++)
{
for (index2 = MAX(0, j - 1); index2 < MIN(j + 1, 6) + 1; index2++)
{
if ((cell[index1 * 7 + index2].has_mine))
{
// std::fstream outfile;
// outfile.open("test.txt", std::ios_base::app);
// if (outfile.is_open())
// {
// outfile << index1 << " " << index2 << "Has mine!" << std::endl;
// }
// outfile.close();
cell[i * 7 + j].mines_around++;
}
}
}
// if (!cell[i * 7 + j].has_mine)
// {
//
// }
}
}
}
void MineSweeper::show_mines(){
for(int i = 0; i < 49; i++){
if(cell[i].has_mine){
cell[i].set_label("x");
}
}
}
bool MineSweeper::timer_func(){
// Set timer
char tmp[50];
timer_count++;
sprintf(tmp, "Time:%d", timer_count);
status_label.set_label(tmp);
return true;
}
void MineSweeper::cell_clicked(MineCell *cell)
{
if (!game_ended && !cell->cleared)
{
cell->cleared = true;
// If get mine, the game will end now
if (cell->has_mine)
{
// Set game to stop
winned = false;
show_mines();
status_label.set_label("You lost!");
game_ended = true;
mytimer.disconnect();
}
else
{
mines_clear++;
// std::cout << mines_clear << std::endl;
if (cell->mines_around == 0)
{
cell->set_label(" ");
}
else
{
char *label = g_strdup_printf("%d", cell->mines_around);
cell->set_label(label);
g_free(label);
}
}
// If all the mines has cleared, you has winned
if (mines_clear == 40)
{
// Stop the game
status_label.set_label("You winned!");
winned = true;
game_ended = true;
mytimer.disconnect();
// Save the time of game
}
}
}

View File

@ -0,0 +1,43 @@
#pragma once
#include <gtkmm.h>
class MineCell : public Gtk::Button
{
public:
bool has_mine = false;
bool cleared = false;
int mines_around;
MineCell(){
// Set button style
set_relief(Gtk::RELIEF_NONE);
mines_around = 0;
}
};
class MineSweeper : public Gtk::ApplicationWindow
{
public:
MineSweeper();
private:
// Child widgets
Gtk::Grid mine_grid;
Gtk::Label status_label;
Gtk::Box main_box, btn_box;
Gtk::Button btnstart, btnshow, btnexit;
MineCell cell[49];
bool winned, game_ended;
int mines_clear, mine_count;
// Timer
int timer_count;
sigc::connection mytimer;
// Signal Handlers
void reset_game();
void calc_mines();
void show_mines();
void cell_clicked(MineCell *cell);
bool timer_func();
};

View File

@ -0,0 +1,8 @@
#include "MineSweeper.hh"
int main(int argc, char **argv){
// Create a application and run
auto app = Gtk::Application::create(argc,argv,"org.gtk.daleclack");
MineSweeper window;
return app->run(window);
}