Skip to content

Commit

Permalink
#134: adds automation for easier screenshot creation
Browse files Browse the repository at this point in the history
  • Loading branch information
rladstaetter committed Aug 17, 2023
1 parent 759e80b commit 0564d8a
Show file tree
Hide file tree
Showing 19 changed files with 14,248 additions and 62 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ fact, when you get an error, you may simply want to see what happened as fast as
is a tool that does precisely that and provides you with a quick way to filter out critical events or other points of
interest.

![Screenshot of LogoRRR, version 23.1.0](docs/releases/23.1.0/screenshot-23.1.0.png?raw=true)
![Screenshot of LogoRRR, version 23.2.1](docs/releases/23.2.1/screenshot-23.2.1.png?raw=true)

## Usage

Expand Down
15 changes: 7 additions & 8 deletions app/src/main/scala/app/logorrr/LogoRRRAppLauncher.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,16 @@ object LogoRRRAppLauncher {
/** launcher for macos installer to circumvent module loading mechanism by javafx (dirty hack) */
def main(args: Array[String]): Unit = {

loadNativeLibraries()

LogoRRRApp.main(args)
}


def loadNativeLibraries(): Unit = {
if (OsUtil.isMac) {
System.loadLibrary("LogoRRRSwift")
System.loadLibrary("LogoRRR")
}

LogoRRRApp.main(args)
}

// private def test(): Unit = {
// OsxBridge.printHelloWorldImpl()
// OsxBridge.registerPath(Paths.get("/Users/lad/gh/LogoRRR/app/target/app-23.2.0-SNAPSHOT.jar").toAbsolutePath.toString)
// OsxBridge.releasePath(Paths.get("/Users/lad/gh/LogoRRR/app/target/app-23.2.0-SNAPSHOT.jar").toAbsolutePath.toString)
//}
}
2 changes: 1 addition & 1 deletion app/src/main/scala/app/logorrr/conf/SettingsIO.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ object SettingsIO extends CanLog {
logWarn(s"Could not load $settingsFilePath, using default settings ...")
Settings.Default
case Success(value) =>
logInfo(s"Loaded settings from ${settingsFilePath}.")
logInfo(s"Loaded settings from $settingsFilePath.")
value
}
}
Expand Down
23 changes: 4 additions & 19 deletions dist/dist-osx/installer-osx/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,36 +39,21 @@
<resource>
<directory>src/main/installer</directory>
<includes>
<include>res/**</include>
<include>icon/**</include>
<include>LogoRRR.entitlements.xml</include>
</includes>
<filtering>false</filtering>
<targetPath>${build.directory}</targetPath>
<targetPath>${project.build.directory}</targetPath>
</resource>
<resource>
<directory>src/main/installer</directory>
<includes>
<include>jpackage-commandline.options</include>
</includes>
<filtering>true</filtering>
<targetPath>${build.directory}</targetPath>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>sign-list.txt</include>
<include>res/Info.plist</include>
</includes>
<filtering>true</filtering>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>res/product-def.plist</include>
<include>jpackage-commandline.options</include>
<include>LogoRRR.entitlements.xml</include>
</includes>
<filtering>true</filtering>
<targetPath>${build.directory}</targetPath>
<targetPath>${project.build.directory}</targetPath>
</resource>
</resources>
<plugins>
Expand Down
Binary file added docs/releases/23.2.1/1280x800.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/releases/23.2.1/1440x900.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/releases/23.2.1/2560x1600.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/releases/23.2.1/2880x1800.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/releases/23.2.1/screenshot-23.2.1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14,003 changes: 14,003 additions & 0 deletions docs/src/main/resources/example.log

Large diffs are not rendered by default.

40 changes: 40 additions & 0 deletions docs/src/main/resources/screenshotter-1280-800.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"log-file-settings" : {
"/Users/lad/gh/LogoRRR/docs/src/main/resources/example.log" : {
"auto-scroll" : false,
"block-settings" : {
"width" : 6
},
"divider-position" : 0.5,
"filters" : [
{
"color" : "0x00ff00ff",
"pattern" : "LogoRRR"
},
{
"color" : "0xe6b34dff",
"pattern" : "WARN"
},
{
"color" : "0x82cabbff",
"pattern" : "create mode"
},
{
"color" : "0xff0000ff",
"pattern" : "Exception"
}
],
"first-opened" : 1692306222365,
"font-size" : 4,
"path-as-string" : "/Users/lad/gh/LogoRRR/docs/src/main/resources/example.log",
"selected-index" : 0
}
},
"some-active" : "/Users/lad/gh/LogoRRR/docs/src/main/resources/example.log",
"stage-settings" : {
"height" : 288,
"width" : 528,
"x" : 100.0,
"y" : 100.0
}
}
44 changes: 44 additions & 0 deletions docs/src/main/resources/screenshotter-1440-900.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"log-file-settings" : {
"/Users/lad/gh/LogoRRR/docs/src/main/resources/example.log" : {
"auto-scroll" : false,
"block-settings" : {
"width" : 22
},
"divider-position" : 0.5,
"filters" : [
{
"color" : "0x00ff00ff",
"pattern" : "LogoRRR"
},
{
"color" : "0xe6b34dff",
"pattern" : "WARN"
},
{
"color" : "0x82cabbff",
"pattern" : "create mode"
},
{
"color" : "0xff0000ff",
"pattern" : "Exception"
},
{
"color" : "0xff6666ff",
"pattern" : "at "
}
],
"first-opened" : 1692306222365,
"font-size" : 10,
"path-as-string" : "/Users/lad/gh/LogoRRR/docs/src/main/resources/example.log",
"selected-index" : 0
}
},
"some-active" : "/Users/lad/gh/LogoRRR/docs/src/main/resources/example.log",
"stage-settings" : {
"height" : 310,
"width" : 608,
"x" : 100.0,
"y" : 100.0
}
}
44 changes: 44 additions & 0 deletions docs/src/main/resources/screenshotter-2560-1600.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"log-file-settings" : {
"/Users/lad/gh/LogoRRR/docs/src/main/resources/example.log" : {
"auto-scroll" : false,
"block-settings" : {
"width" : 22
},
"divider-position" : 0.5,
"filters" : [
{
"color" : "0x00ff00ff",
"pattern" : "LogoRRR"
},
{
"color" : "0xe6b34dff",
"pattern" : "WARN"
},
{
"color" : "0x82cabbff",
"pattern" : "create mode"
},
{
"color" : "0xff0000ff",
"pattern" : "Exception"
},
{
"color" : "0xff6666ff",
"pattern" : "at "
}
],
"first-opened" : 1692306222365,
"font-size" : 10,
"path-as-string" : "/Users/lad/gh/LogoRRR/docs/src/main/resources/example.log",
"selected-index" : 0
}
},
"some-active" : "/Users/lad/gh/LogoRRR/docs/src/main/resources/example.log",
"stage-settings" : {
"height" : 688,
"width" : 1168,
"x" : 100.0,
"y" : 100.0
}
}
40 changes: 40 additions & 0 deletions docs/src/main/resources/screenshotter-2880-1800.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"log-file-settings" : {
"/Users/lad/gh/LogoRRR/docs/src/main/resources/example.log" : {
"auto-scroll" : false,
"block-settings" : {
"width" : 18
},
"divider-position" : 0.30346385542168675,
"filters" : [
{
"color" : "0x00ff00ff",
"pattern" : "LogoRRR"
},
{
"color" : "0xe6b34dff",
"pattern" : "WARN"
},
{
"color" : "0x82cabbff",
"pattern" : "create mode"
},
{
"color" : "0xff0000ff",
"pattern" : "Exception"
}
],
"first-opened" : 1692306222365,
"font-size" : 6,
"path-as-string" : "/Users/lad/gh/LogoRRR/docs/src/main/resources/example.log",
"selected-index" : 0
}
},
"some-active" : "/Users/lad/gh/LogoRRR/docs/src/main/resources/example.log",
"stage-settings" : {
"height" : 760,
"width" : 1328,
"x" : 296.0,
"y" : 60.0
}
}
22 changes: 17 additions & 5 deletions docs/src/main/scala/app/logorrr/docs/Area.scala
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
package app.logorrr.docs

object Area {
object R1280x800 extends Area(1280, 800)
object R1280x800 extends Area(1280, 800, 528, 288)

object R1440x900 extends Area(1440, 900)
object R1440x900 extends Area(1440, 900, 608, 338)

object R1920x1080 extends Area(1920, 1080)
object R2560x1600 extends Area(2560, 1600, 1168, 688)

val seq: Seq[Area] = Seq(R1280x800, R1440x900, R1920x1080)
object R2880x1800 extends Area(2880, 1800, 1328, 788)

val seq: Seq[Area] = Seq(R1280x800, R1440x900, R2560x1600, R2880x1800)
}

case class Area(width: Int, height: Int) extends Product
/**
*
* @param width
* @param height
* @param screenshotWidth width when using apples screenshot utility + retina display
* @param screenshotHeight height when using apples screenshot utility + retina display
*/
case class Area(width: Int
, height: Int
, screenshotWidth: Int
, screenshotHeight: Int) extends Product
6 changes: 3 additions & 3 deletions docs/src/main/scala/app/logorrr/docs/IconCreatorApp.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ object IconCreatorApp {

def writeIcons(canvases: Seq[(Area, Canvas)], path: Path): Unit = {
Fs.createDirectories(path)
for ((Area(s, _), c) <- canvases) {
for ((Area(s, _, _, _), c) <- canvases) {
val file = path.resolve(s"logorrr-icon-${s}.png")
writeIcon(c, file)
}
Expand All @@ -42,12 +42,12 @@ object IconCreatorApp {
class IconCreatorApp extends javafx.application.Application {

val iconSizes: Seq[Int] = Seq(512, 256, 128, 64, 32, 16)
val icons: Seq[Area] = iconSizes.map(i => Area(i, i))
val icons: Seq[Area] = iconSizes.map(i => Area(i, i,0,0))

def start(stage: Stage): Unit = {
val bp = new BorderPane()
val ics =
for (a@Area(w, h) <- icons) yield {
for (a@Area(w, h,_,_) <- icons) yield {
val canvas = new Canvas(w, h)
val gc2d = canvas.getGraphicsContext2D
LogorrrIcon.drawIcon(gc2d, w)
Expand Down
Loading

0 comments on commit 0564d8a

Please sign in to comment.