Did you know ... Search Documentation:
swipl.rc -- Associate XPCE with SWI-Prolog
PublicShow source

This file initialises XPCE, the SWI-Prolog native GUI. XPCE is initialised if one of these conditions is true.

  • The Prolog flag xpce is true
  • There is a GUI. See has_display/0 below. In this case, XPCE is loaded if the Prolog flag xpce is true. Otherwise it is setup to be loaded lazily if one of the GUI IDE tools is invoked.

The source-location of this file is packages/xpce/swipl/swipl-rc. It is installed as <plbase>/<exe-base>.rc, where <exe-base> is swipl-win to associate with the SWI-Prolog gui application on Windows and swipl on Unix/X11 platforms.

Source gui_setup_[private]
We have a GUI. Prepare it. This loads hooks that may enable the gui and set the editor to PceEmacs if it is still default.
Source has_display is semidet[private]
True when we can run graphics. Graphics are always available on Windows or MacOS (although they may appear on the main console when invoked from a remote login). On Linux, we can detect DISPLAY (X11) or WAYLAND_DISPLAY (Wayland). We also assume we can run graphics if the SDL_VIDEO_DRIVER is set to dummy, implying we try to run headless.
Source pce_setup_ is det[private]
Setup xpce. There are these cases:
  • The flag xpce is false: do not setup xpce.
  • The flag xpce is true: load xpce and set it up.
  • The flag xpce is not present. Now
    • If we seem to have a gui, prepare xpce to be loaded lazily
    • If there is no gui, do not setup xpce.