annotate src/name/blackcap/imageprep/Osdep.kt.mac.osdep @ 25:a495f9ea498b mac-open

Initial attempts to make it respond to MacOS open message (not working).
author David Barts <n5jrn@me.com>
date Sun, 13 Dec 2020 10:29:08 -0800
parents 5fa5d15b4a7b
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
1 /*
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
2 * OS-dependent code, Mac version.
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
3 */
1
0bded24f746e Compiles, still untested.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
4 package name.blackcap.imageprep
0
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
5
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
6 import com.apple.eawt.AboutHandler
25
a495f9ea498b Initial attempts to make it respond to MacOS open message (not working).
David Barts <n5jrn@me.com>
parents: 19
diff changeset
7 import com.apple.eawt.OpenFilesHandler
0
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
8 import com.apple.eawt.PreferencesHandler
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
9 import com.apple.eawt.QuitStrategy
25
a495f9ea498b Initial attempts to make it respond to MacOS open message (not working).
David Barts <n5jrn@me.com>
parents: 19
diff changeset
10 import java.util.logging.Level
a495f9ea498b Initial attempts to make it respond to MacOS open message (not working).
David Barts <n5jrn@me.com>
parents: 19
diff changeset
11 import java.util.logging.Logger
0
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
12
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
13 fun setMacMenus() {
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
14 com.apple.eawt.Application.getApplication().run {
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
15 setAboutHandler(AboutHandler { showAboutDialog() })
25
a495f9ea498b Initial attempts to make it respond to MacOS open message (not working).
David Barts <n5jrn@me.com>
parents: 19
diff changeset
16 setOpenFileHandler(OpenFilesHandler {
a495f9ea498b Initial attempts to make it respond to MacOS open message (not working).
David Barts <n5jrn@me.com>
parents: 19
diff changeset
17 LOGGER.log(Level.INFO, "got open request")
a495f9ea498b Initial attempts to make it respond to MacOS open message (not working).
David Barts <n5jrn@me.com>
parents: 19
diff changeset
18 for (file in it.files) {
a495f9ea498b Initial attempts to make it respond to MacOS open message (not working).
David Barts <n5jrn@me.com>
parents: 19
diff changeset
19 LOGGER.log(Level.INFO, "opening: ${file.toString()}")
a495f9ea498b Initial attempts to make it respond to MacOS open message (not working).
David Barts <n5jrn@me.com>
parents: 19
diff changeset
20 RotateDialog.makeDialog(file, Application.settingsDialog.maxDimension)
a495f9ea498b Initial attempts to make it respond to MacOS open message (not working).
David Barts <n5jrn@me.com>
parents: 19
diff changeset
21 }
a495f9ea498b Initial attempts to make it respond to MacOS open message (not working).
David Barts <n5jrn@me.com>
parents: 19
diff changeset
22 })
19
5fa5d15b4a7b Attempt to make it a std. app. Builds, sorta runs, needs more work.
David Barts <n5jrn@me.com>
parents: 1
diff changeset
23 setPreferencesHandler(
5fa5d15b4a7b Attempt to make it a std. app. Builds, sorta runs, needs more work.
David Barts <n5jrn@me.com>
parents: 1
diff changeset
24 PreferencesHandler { Application.settingsDialog.setVisible(true) })
0
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
25 setQuitStrategy(QuitStrategy.CLOSE_ALL_WINDOWS)
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
26 }
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
27 }