Ignore:
Timestamp:
2017-08-29T00:16:25+02:00 (7 years ago)
Author:
Don-vip
Message:

see #15182 - refactor PlatformHookOsx so that all GUI actions are performed in MainApplication and only macOS-specific stuff remains in platform hook

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/PlatformHook.java

    r12676 r12695  
    272272        }
    273273    }
     274
     275    /**
     276     * Called when interfacing with native OS functions. Currently only used with macOS.
     277     * The callback must perform all GUI-related tasks associated to an OS request.
     278     * The non-GUI, platform-specific tasks, are usually performed by the {@code PlatformHook}.
     279     * @since 12695
     280     */
     281    interface NativeOsCallback {
     282        /**
     283         * macOS: Called when JOSM is asked to open a list of files.
     284         * @param files list of files to open
     285         */
     286        void openFiles(List<File> files);
     287
     288        /**
     289         * macOS: Invoked when JOSM is asked to quit.
     290         * @return {@code true} if JOSM has been closed, {@code false} if the user has cancelled the operation.
     291         */
     292        boolean handleQuitRequest();
     293
     294        /**
     295         * macOS: Called when JOSM is asked to show it's about dialog.
     296         */
     297        void handleAbout();
     298
     299        /**
     300         * macOS: Called when JOSM is asked to show it's preferences UI.
     301         */
     302        void handlePreferences();
     303    }
     304
     305    /**
     306     * Registers the native OS callback. Currently only needed for macOS.
     307     * @param callback the native OS callback
     308     * @since 12695
     309     */
     310    default void setNativeOsCallback(NativeOsCallback callback) {
     311        // To be implemented if needed
     312    }
    274313}
Note: See TracChangeset for help on using the changeset viewer.