Files
mcde/programs/dtsystemsettings/panes.c
T
lotherk dc8dfd2cc7 MCDE dtsystemsettings: Appearance, the four groups and the fonts (t0099)
The pane is the reference's form now: Appearance (a menu of the palettes with
the chosen palette's eight colours as a strip under it, then "In use:"),
Highlight Color (the eight colours of the active palette, written as
*highlightColor and *selectColor for programs started later), the scroll
bars, the number of recent items, font smoothing -- and the fonts, which
lose their own pane (the "fonts" id still opens Appearance, the entry is
gone from the overview).

What the pane writes is what the session reads:

  *<screen>*ColorPalette, *highlightColor, *selectColor   _DtAddToResource
  Dtwm*mcdeTitleBarDoubleClick: none|minimize             then dtwm restarts
  ~/.dt/recent.conf: applications=N, documents=N, servers=N
  ~/.config/fontconfig/conf.d/60-mcde-antialias.conf      antialias=false

dtwm gained the title-bar double click: a new resource (WmResNames.h,
WmGlobal.h, WmResource.c, default "none") and, in CheckButtonPressBuiltin
(WmCEvent.c), the double-click branch on the title -- F_Minimize or
F_Maximize instead of the move.  dtbar's Recent Items and Connect to
Server's history now read their counts from ~/.dt/recent.conf
(ItemsPush/FillRecent, ReadLines/RecentAdd).

Two things the task itself said to drop are dropped, with the reason in the
pane: Motif has no separate arrow buttons at both ends of a scroll bar and no
smooth scrolling (an animation), and a click in a Motif scroll bar pages
while the middle button jumps to the place.

Font smoothing is a fontconfig rule, not *Xft.antialias: measured here, Xft
ignores that X resource (205 grey levels with and without it), while a
<match target="font"> antialias=false rule gives 2.  The rule reaches GTK and
Qt as well (one look).

Measured under Xvfb with xdotool:

  - "Off" + Apply -> the file is written and an Xft render test in the same
    session drops from 205 distinct grey levels to 2; with the size limit 20
    the same test (size 12) gives 2, with 4 it gives 205 -- the rule holds
    only up to the size.
  - the title-bar box + Apply writes Dtwm*mcdeTitleBarDoubleClick: minimize,
    dtwm restarts, and a double click on dtpad's title bar leaves its window
    "Map State: IsUnMapped" (IsViewable before).
  - a palette choice writes *0*ColorPalette: Camouflage.dp (and dtthemesync's
    colours), the strip and the Highlight menu follow it.
  - Documents=5 with eight entries in ~/.dt/recent shows five in the bar's
    Recent Items; Servers=0 leaves the Connect to Server field at "sftp://",
    Servers=10 prefills the stored address.

Pictures: docs/screenshots/leopard/System-Preferences-Appearance-mcde.png
(the four groups) and ...-Appearance-fonts-mcde.png (scrolled to the fonts).
make check: test_panes PASS.

Open: a highlight colour reaches programs started later, not the running
ones; "Applications" has no recent list to feed; the dtwm value takes effect
when the window manager restarts (the Apply button does it); the antialias
rule is read at program start; and the fonts list is six rows inside the
scrolled pane.
2026-11-14 09:59:02 +00:00

124 lines
4.3 KiB
C

/*
* panes.c -- dtsystemsettings: the panes and their categories (panes.h)
*
* Copyright (c) 2026 The Makronix project. GNU LGPL 2.0 or later, as CDE.
*
* One place for the computer's settings, in four rows. A pane is drawn
* here (sound, network, Bluetooth, date and time, about) when the setting
* goes through McdeSys; the panes that are CDE's own style manager open it
* until they are drawn here too.
*/
#include <string.h>
#include "panes.h"
const char *const categoryNames[CAT_COUNT] = {
"Personal",
"Hardware",
"Internet & Network",
"System"
};
const Pane panes[] = {
{ "appearance", "Appearance", CAT_PERSONAL, "DtColor.pm", PANE_OWN,
NULL, "appearance colours colors palette theme farben fonts "
"schrift schriften smoothing antialias" },
{ "desktop", "Desktop", CAT_PERSONAL, "DtBkdrp.pm", PANE_OWN, NULL,
"desktop background wallpaper hintergrund" },
{ "language", "Language", CAT_PERSONAL, "DtI18N.pm", PANE_OWN,
NULL, "language sprache locale region formats datum" },
{ "screensaver", "Screen Saver", CAT_PERSONAL, "DtScrn.pm",
PANE_OWN, NULL, "screensaver screen saver bildschirmschoner" },
{ "dock", "Dock", CAT_PERSONAL, "DtPanel.m.pm", PANE_LATER, NULL,
"dock leiste panel front panel" },
{ "security", "Security", CAT_PERSONAL, "Dtlockscrn.pm", PANE_LATER,
NULL, "security sicherheit firewall lock sperre" },
{ "sound", "Sound", CAT_HARDWARE, "Dtaudio.m.pm", PANE_OWN, NULL,
"sound audio lautstaerke volume ton" },
{ "displays", "Displays", CAT_HARDWARE, "DtScrn.pm", PANE_OWN,
NULL, "displays monitors resolution aufloesung bildschirm" },
{ "keyboard", "Keyboard", CAT_HARDWARE, "DtKeybd.pm", PANE_OWN, NULL,
"keyboard tastatur wiederholung repeat" },
{ "mouse", "Mouse", CAT_HARDWARE, "DtMouse.pm", PANE_OWN, NULL,
"mouse maus" },
{ "printers", "Printers", CAT_HARDWARE, "Dtprint.m.pm", PANE_COMMAND,
"dtprintinfo -all", "printers drucker print cups" },
{ "bluetooth", "Bluetooth", CAT_HARDWARE, "McdeBluetooth.m.pm",
PANE_OWN, NULL, "bluetooth" },
{ "cds", "CDs & DVDs", CAT_HARDWARE, "Dtmedia.m.pm", PANE_LATER, NULL,
"cds dvds medien media einlegen" },
{ "energy", "Energy Saver", CAT_HARDWARE, "Dtbattery.m.pm", PANE_LATER,
NULL, "energy energie sleep ruhezustand strom" },
{ "network", "Network", CAT_NETWORK, "McdeWired.m.pm", PANE_OWN, NULL,
"network netzwerk lan wlan wifi ethernet dhcp ip" },
{ "sharing", "Sharing", CAT_NETWORK, "Dtlink.m.pm", PANE_OWN, NULL,
"sharing freigaben smb afp nfs ssh dateien" },
{ "datetime", "Date & Time", CAT_SYSTEM, "Dtdate.m.pm", PANE_OWN, NULL,
"date time uhr zeit timezone zeitzone ntp" },
{ "startup", "Startup", CAT_SYSTEM, "DtStart.pm", PANE_OWN, NULL,
"startup boot" },
{ "accounts", "Accounts", CAT_SYSTEM, "DtStart.pm", PANE_OWN, NULL,
"accounts benutzer users password passwort" },
{ "update", "Software Update", CAT_SYSTEM, "Dtstyle.m.pm", PANE_OWN,
NULL, "update software aktualisierung pakete packages" },
{ "backup", "Backup", CAT_SYSTEM, "DtSystem.m.pm", PANE_OWN, NULL,
"backup sicherung" },
{ "startupdisk", "Startup Disk", CAT_SYSTEM, "Dtdisk.m.pm", PANE_LATER,
NULL, "startup disk startvolume" },
{ "accessibility", "Accessibility", CAT_SYSTEM, "Dtmouse.m.pm",
PANE_LATER, NULL, "accessibility bedienungshilfen" },
{ "about", "About", CAT_SYSTEM, "MakronixDtlogo.m.pm", PANE_OWN, NULL,
"about info systembericht" },
};
const int paneCount = (int) (sizeof panes / sizeof panes[0]);
static void
Lower(const char *in, char *out, size_t len)
{
size_t i;
for (i = 0; in[i] != '\0' && i + 1 < len; i++)
out[i] = (in[i] >= 'A' && in[i] <= 'Z') ? in[i] - 'A' + 'a' :
in[i];
out[i] = '\0';
}
int
PaneMatch(const Pane *p, const char *query)
{
char q[128], hay[512];
if (p == NULL)
return 0;
if (query == NULL || query[0] == '\0')
return 1;
Lower(query, q, sizeof q);
if (q[0] == '\0')
return 1;
(void)snprintf(hay, sizeof hay, "%s %s %s", p->id, p->label,
p->keywords != NULL ? p->keywords : "");
Lower(hay, hay, sizeof hay);
return strstr(hay, q) != NULL;
}
const Pane *
PaneFind(const char *id)
{
int i;
if (id == NULL)
return NULL;
/* the fonts are part of Appearance since t0099; the old id stays */
if (strcmp(id, "fonts") == 0)
id = "appearance";
for (i = 0; i < paneCount; i++)
if (strcmp(panes[i].id, id) == 0)
return &panes[i];
return NULL;
}