JFLib

plat/apple_mac_app.rs (Apple)#

Source: lib/plat/apple_mac_app.rs

apple_mac_app -- the app in macOS (docs/APPLE.md AP7a): its menu, its delegate, the system's events,
tool windows as panels, the print dialog

  gui_once()                (win_create, the first window) the main menu: the app menu (About, Hide,
                            Hide Others, Show All, Quit: Cmd+Q) and the Window menu (Minimize: Cmd+M,
                            Zoom, Bring All to Front), in German or English after the system's first
                            language; SIGTERM becomes E_SESSION_END (a dispatch source on the main
                            queue: the run loop delivers it)
  observe(obs)              (init) the observer (a delegate object of ours, index -1) is NSApp's
                            delegate and hears NSWorkspace: will sleep / did wake -> E_POWER 1 / 0,
                            will power off -> E_SESSION_END
  delegate methods          applicationShouldTerminate: (Cmd+Q, the Dock's Quit, logging out): E_CLOSE
                            of the main window, the app decides (NSTerminateCancel); without a main
                            window the app ends.  applicationShouldHandleReopen:hasVisibleWindows:
                            (a click on the Dock icon) brings the main window back
  panel_class()             PWF_TOOL windows are panels of our class JFPanel: they become the key
                            window only for a click into a text field (the hit hook's HB_TEXT), as on
                            Windows (MA_NOACTIVATE); JFPanel's sendEvent: notes the event
                            needsPanelToBecomeKey looks at
  print_dialog(job)         (apple_disp.rs print) NSPrintPanel: printer, paper, orientation, copies
                            (without a window of the app -- headless runs -- ERR_UNSUPPORTED);
                            the job laid out on the chosen paper and its printable area as a one-page
                            PDF (print.rs), printed through PDFKit without a second panel
  print_dialog_autoclose(ms) (test aid) the next print panel is cancelled after ms (NSApp abortModal)
  • fn print_dialog_autoclose(ms: u32) (test aid) the next print panel is cancelled after ms

Source: docs/API.md in the JFLib repository.