[glass] Add application icon
@@ -5,5 +5,5 @@ repositories {
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
implementation "edu.wpi.first:native-utils:2021.0.6"
|
||||
implementation "edu.wpi.first:native-utils:2021.1.0"
|
||||
}
|
||||
|
||||
5
glass/.styleguide
Normal file
@@ -0,0 +1,5 @@
|
||||
generatedFileExclude {
|
||||
src/app/native/resources/
|
||||
src/app/native/win/glass.ico
|
||||
src/app/native/mac/glass.icns
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
project(glass)
|
||||
|
||||
include(CompileWarnings)
|
||||
include(GenResources)
|
||||
include(LinkMacOSGUI)
|
||||
|
||||
#
|
||||
@@ -49,13 +50,26 @@ install(DIRECTORY src/libnt/native/include/ DESTINATION "${include_dest}/glass")
|
||||
# glass application
|
||||
#
|
||||
|
||||
GENERATE_RESOURCES(src/app/native/resources generated/app/cpp GLASS glass glass_resources_src)
|
||||
|
||||
file(GLOB glass_src src/app/native/cpp/*.cpp)
|
||||
|
||||
add_executable(glass ${glass_src})
|
||||
if (WIN32)
|
||||
set(glass_rc src/app/native/win/glass.rc)
|
||||
elseif(APPLE)
|
||||
set(MACOSX_BUNDLE_ICON_FILE glass.icns)
|
||||
set(APP_ICON_MACOSX src/app/native/mac/glass.icns)
|
||||
set_source_files_properties(${APP_ICON_MACOSX} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
|
||||
endif()
|
||||
|
||||
add_executable(glass ${glass_src} ${glass_resources_src} ${glass_rc} ${APP_ICON_MACOSX})
|
||||
wpilib_link_macos_gui(glass)
|
||||
target_link_libraries(glass libglassnt libglass)
|
||||
|
||||
if (WIN32)
|
||||
set_target_properties(glass PROPERTIES WIN32_EXECUTABLE YES)
|
||||
elseif(APPLE)
|
||||
set_target_properties(glass PROPERTIES MACOSX_BUNDLE YES OUTPUT_NAME "Glass")
|
||||
endif()
|
||||
|
||||
#if (MSVC OR FLAT_INSTALL_WPILIB)
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
<string>Glass</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>edu.wpi.first.tools.Glass</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>glass.icns</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleSupportedPlatforms</key>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import org.gradle.internal.os.OperatingSystem
|
||||
|
||||
if (!project.hasProperty('onlylinuxathena') && !project.hasProperty('onlylinuxraspbian') && !project.hasProperty('onlylinuxaarch64bionic')) {
|
||||
|
||||
description = "A different kind of dashboard"
|
||||
@@ -8,13 +10,23 @@ if (!project.hasProperty('onlylinuxathena') && !project.hasProperty('onlylinuxra
|
||||
apply plugin: 'visual-studio'
|
||||
apply plugin: 'edu.wpi.first.NativeUtils'
|
||||
|
||||
if (OperatingSystem.current().isWindows()) {
|
||||
apply plugin: 'windows-resources'
|
||||
}
|
||||
|
||||
ext {
|
||||
nativeName = 'glass'
|
||||
}
|
||||
|
||||
apply from: "${rootDir}/shared/resources.gradle"
|
||||
apply from: "${rootDir}/shared/config.gradle"
|
||||
|
||||
def generateTask = createGenerateResourcesTask('app', 'GLASS', 'glass', project)
|
||||
|
||||
project(':').libraryBuild.dependsOn build
|
||||
tasks.withType(CppCompile) {
|
||||
dependsOn generateTask
|
||||
}
|
||||
|
||||
nativeUtils.exportsConfigs {
|
||||
glass {
|
||||
@@ -35,7 +47,7 @@ if (!project.hasProperty('onlylinuxathena') && !project.hasProperty('onlylinuxra
|
||||
sources {
|
||||
cpp {
|
||||
source {
|
||||
srcDirs = ['src/lib/native/cpp']
|
||||
srcDirs 'src/lib/native/cpp'
|
||||
include '**/*.cpp'
|
||||
}
|
||||
exportedHeaders {
|
||||
@@ -96,13 +108,20 @@ if (!project.hasProperty('onlylinuxathena') && !project.hasProperty('onlylinuxra
|
||||
sources {
|
||||
cpp {
|
||||
source {
|
||||
srcDirs 'src/app/native/cpp'
|
||||
srcDirs 'src/app/native/cpp', "$buildDir/generated/app/cpp"
|
||||
include '**/*.cpp'
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDirs 'src/app/native/include'
|
||||
}
|
||||
}
|
||||
if (OperatingSystem.current().isWindows()) {
|
||||
rc {
|
||||
source {
|
||||
srcDirs 'src/app/native/win'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
binaries.all {
|
||||
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio || it.targetPlatform.name == nativeUtils.wpi.platforms.raspbian || it.targetPlatform.name == nativeUtils.wpi.platforms.aarch64bionic) {
|
||||
|
||||
@@ -14,6 +14,7 @@ model {
|
||||
// We are now in the binary that we want.
|
||||
// This is the default application path for the ZIP task.
|
||||
def applicationPath = binary.executable.file
|
||||
def icon = file("$project.projectDir/src/app/native/mac/glass.icns")
|
||||
|
||||
// Create the macOS bundle.
|
||||
def bundleTask = project.tasks.create("bundleGlassOsxApp", Copy) {
|
||||
@@ -21,6 +22,7 @@ model {
|
||||
from(file("$project.projectDir/Info.plist"))
|
||||
into(file("$project.buildDir/outputs/bundles/Glass.app/Contents"))
|
||||
into("MacOS") { with copySpec { from binary.executable.file } }
|
||||
into("Resources") { with copySpec { from icon } }
|
||||
|
||||
doLast {
|
||||
if (project.hasProperty("developerID")) {
|
||||
|
||||
@@ -23,6 +23,16 @@
|
||||
|
||||
namespace gui = wpi::gui;
|
||||
|
||||
namespace glass {
|
||||
wpi::StringRef GetResource_glass_16_png();
|
||||
wpi::StringRef GetResource_glass_32_png();
|
||||
wpi::StringRef GetResource_glass_48_png();
|
||||
wpi::StringRef GetResource_glass_64_png();
|
||||
wpi::StringRef GetResource_glass_128_png();
|
||||
wpi::StringRef GetResource_glass_256_png();
|
||||
wpi::StringRef GetResource_glass_512_png();
|
||||
} // namespace glass
|
||||
|
||||
static std::unique_ptr<glass::PlotProvider> gPlotProvider;
|
||||
static std::unique_ptr<glass::NetworkTablesProvider> gNtProvider;
|
||||
|
||||
@@ -88,6 +98,14 @@ int main() {
|
||||
gui::CreateContext();
|
||||
glass::CreateContext();
|
||||
|
||||
gui::AddIcon(glass::GetResource_glass_16_png());
|
||||
gui::AddIcon(glass::GetResource_glass_32_png());
|
||||
gui::AddIcon(glass::GetResource_glass_48_png());
|
||||
gui::AddIcon(glass::GetResource_glass_64_png());
|
||||
gui::AddIcon(glass::GetResource_glass_128_png());
|
||||
gui::AddIcon(glass::GetResource_glass_256_png());
|
||||
gui::AddIcon(glass::GetResource_glass_512_png());
|
||||
|
||||
gPlotProvider = std::make_unique<glass::PlotProvider>("Plot");
|
||||
gNtProvider = std::make_unique<glass::NetworkTablesProvider>("NTProvider");
|
||||
|
||||
|
||||
BIN
glass/src/app/native/mac/glass.icns
Normal file
BIN
glass/src/app/native/resources/glass-128.png
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
glass/src/app/native/resources/glass-16.png
Normal file
|
After Width: | Height: | Size: 476 B |
BIN
glass/src/app/native/resources/glass-256.png
Normal file
|
After Width: | Height: | Size: 8.3 KiB |
BIN
glass/src/app/native/resources/glass-32.png
Normal file
|
After Width: | Height: | Size: 820 B |
BIN
glass/src/app/native/resources/glass-48.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
glass/src/app/native/resources/glass-512.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
glass/src/app/native/resources/glass-64.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
glass/src/app/native/win/glass.ico
Normal file
|
After Width: | Height: | Size: 66 KiB |
1
glass/src/app/native/win/glass.rc
Normal file
@@ -0,0 +1 @@
|
||||
IDI_ICON1 ICON "glass.ico"
|
||||