CK Core Apps
CK Core Apps

Shared architecture and persistence

Every program in ck-core-apps builds directly against the matched native desktop stack—CK Core Motif (libXm.so.9, ABI 9) and CK Core CDE (libDtSvc, libDtWidget, libtt)—and shares a small set of C modules under src/shared/ for session state, user configuration, palette inspection, About dialogs, and layout/table widgets.

Flowchart

For toolkit-level appearance/density resources and widget internals, see the CK Core Motif documentation. For dtwm open-window icons, session management daemons, and desktop integration, see the CK Core CDE documentation (and ck-core-fs-lib for the shared headless filesystem engine used by CDE).

Shared modules (src/shared/)

ModuleFilesRole
Session utilitiessession_utils.c, session_utils.hParses -session <id>, resolves /proc/self/exe for WM_COMMAND, clamping restored geometry to screen bounds, and reads/writes key-value state via DtSessionRestorePath and DtSessionSavePath.
Config utilitiesconfig_utils.c, config_utils.hReads and writes lightweight key-value preference files beneath $XDG_CONFIG_HOME/ck-core/ (or ~/.config/ck-core/ with mode 0700).
About dialogabout_dialog.c, about_dialog.h, ck-core.l.pmBuilds the standard XmNotebook About dialog (App, CK-Core, CDE, Motif, and OS via lsb_release) and sets XPM window icons.
CDE palette readercde_palette.c, cde_palette.hQueries active CDE/Motif ColorObj pixel sets (XmeGetColorObjData and XQueryColors) so custom controls such as ck-calc buttons match the active desktop theme.
Grid layoutgridlayout/gridlayout.c, gridlayout.hPercentage-positioned multi-row XmForm grid builder (fractionBase = columns * 10) with column-span support.
Sortable & virtual tablestable/table_widget.c, ck-table/ck_table.cProvides both widget-per-row sortable tables (CK_TABLE_MODE_STANDARD) and viewport-virtualized tables (CK_TABLE_MODE_VIRTUAL) used by ck-tasks for large /proc process lists.

CDE session integration

Applications that link session_utils.c (ck-about, ck-calc, ck-character-map, ck-grab, ck-tasks, ck-load, ck-eyes, ck-coins, ck-browser, ck-nibbles, and ck-plasma-1) register a WM_SAVE_YOURSELF protocol callback on their top-level shell:

  1. When dtsession checkpoints or ends a desktop session, DtSessionSavePath allocates a session state file under ~/.dt/sessions/ and XSetCommand records <binary> -session <file>.
  2. On the next login, dtsession relaunches each saved command with -session <file>, restoring clamped screen coordinates (x, y, w, h) and tool-specific state (such as open browser tabs, active notebook pages, calculator mode, or selected cryptocurrency).

User configuration and cache paths

Outside CDE session checkpoints, persistent user settings and caches live under standard XDG base directories:

Path (default under ~)Owning toolStored data
~/.config/ck-core/ck-calc.viewck-calcshow_thousands, mode (Basic/Scientific), trig_mode
~/.config/ck-core/ck-grab.viewck-grabtarget, delay, include_frame, include_cursor, hide_window, format
~/.config/ck-core/ck-grab.pathsck-grablast_dir for screenshot save dialogs
~/.config/ck-core/ck-mixer.viewck-mixershow_device_combo and per-channel column visibility flags
~/.config/ck-core/ck-mines.confck-minesDifficulty preset, board size/scale, question-mark toggle, and fastest times
~/.config/ck-core/bookmarks.htmlck-browserNetscape-format bookmarks with inline base64 PNG favicons
~/.config/ck-core/ck-browser.homepageck-browserCustom browser homepage URL
~/.config/ck-core/ck-browser.lastsessionck-browserLast closed tab list for Navigate → Restore Session
~/.cache/ck-coins/cache-<hash>.jsonck-coinsflock-synchronized 15-minute CoinGecko price response cache