props_box moves out of main_window into a new top-level inspector_window (LightGUI - Object Inspector, 300x700); the canvas now fills the main window. Mirrors the palette-window pattern: show/hide, delete-event hides, View -> Object Inspector toggles, startup cascade parks it right of the palette (main -> palette -> inspector -> code). Canvas no longer shares space with the inspector, and the inspector no longer shares space with the layout window: 6 distinct top-level windows, verified under Xvfb. Also capture return values of fscanf/system/write (4 pre-existing -Wunused-result warnings); designer rebuilds with 0 warnings.
79 lines
2.6 KiB
Bash
Executable File
79 lines
2.6 KiB
Bash
Executable File
#!/bin/sh
|
|
# ./ide -- start the combined IDE.
|
|
# Starts the designer, the XFrame palette and the XFrame layout window as
|
|
# separate top-level windows on one X display:
|
|
# LightGUI -- C++/GTK -- <name> designer canvas (layout surface)
|
|
# LightGUI -- Widgets designer palette (36 tight buttons)
|
|
# LightGUI -- Object Inspector object inspector (properties, its own window)
|
|
# LightGUI -- Code code inspector (code + auto variables)
|
|
# LightGUI Palette - 547 widgets XFrame selector palette
|
|
# LightGUI Layout XFrame live layout surface
|
|
# The debugger opens from the designer (Debug -> Open Debugger...).
|
|
#
|
|
# Usage: ./ide [--build] [--no-xframe] [--help]
|
|
# --build rebuild both halves first
|
|
# --no-xframe designer only (skip the XFrame palette + layout windows)
|
|
# Requires an X display; under Xvfb: Xvfb :97 -screen 0 1920x1080x24 &
|
|
# DISPLAY=:97 ./ide
|
|
ROOT=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
|
|
|
|
BUILD=0
|
|
XFRAME=1
|
|
for a in "$@"; do
|
|
case "$a" in
|
|
--build) BUILD=1 ;;
|
|
--no-xframe|--designer-only) XFRAME=0 ;;
|
|
--help|-h)
|
|
echo "Usage: $0 [--build] [--no-xframe] [--help]"
|
|
echo "Starts the combined IDE: LightGUI + XFrame palette + layout,"
|
|
echo "each as its own top-level window. Needs an X display."
|
|
exit 0 ;;
|
|
*) echo "ide: unknown option: $a" >&2; exit 2 ;;
|
|
esac
|
|
done
|
|
|
|
if [ -z "$DISPLAY" ]; then
|
|
echo "ide: no X display (DISPLAY is unset)." >&2
|
|
echo "ide: run under Xvfb, e.g. Xvfb :97 -screen 0 1920x1080x24 &" >&2
|
|
echo "ide: DISPLAY=:97 ./ide" >&2
|
|
exit 1
|
|
fi
|
|
|
|
if [ "$BUILD" = 1 ] || [ ! -x "$ROOT/lightgui" ]; then
|
|
echo "ide: building designer..."
|
|
make -C "$ROOT" || exit 1
|
|
fi
|
|
if [ "$XFRAME" = 1 ]; then
|
|
if [ "$BUILD" = 1 ] || [ ! -x "$ROOT/widgets/build/palette/lightgui_palette" ] \
|
|
|| [ ! -x "$ROOT/widgets/build/layout/lightgui_layout" ]; then
|
|
echo "ide: building widgets..."
|
|
cmake -S "$ROOT/widgets" -B "$ROOT/widgets/build" || exit 1
|
|
cmake --build "$ROOT/widgets/build" -j"$(nproc 2>/dev/null || echo 4)" || exit 1
|
|
fi
|
|
fi
|
|
|
|
export LIGHTGUI_ICONS="$ROOT/widgets/icons"
|
|
|
|
PAL_PID=""
|
|
LAY_PID=""
|
|
cleanup() {
|
|
[ -n "$PAL_PID" ] && kill "$PAL_PID" 2>/dev/null
|
|
[ -n "$LAY_PID" ] && kill "$LAY_PID" 2>/dev/null
|
|
}
|
|
trap cleanup EXIT INT TERM
|
|
|
|
if [ "$XFRAME" = 1 ]; then
|
|
(cd "$ROOT" && ./widgets/build/palette/lightgui_palette) &
|
|
PAL_PID=$!
|
|
(cd "$ROOT" && ./widgets/build/layout/lightgui_layout) &
|
|
LAY_PID=$!
|
|
fi
|
|
|
|
(cd "$ROOT" && ./lightgui) &
|
|
DESIGNER_PID=$!
|
|
wait "$DESIGNER_PID"
|
|
STATUS=$?
|
|
cleanup
|
|
trap - EXIT INT TERM
|
|
exit "$STATUS"
|