MCDE: the Solaris cursor theme (t0301)

programs/cursors holds the 27 .cursor files of Solaris 2.6; programs/dtcursor
reads the X11 cursor text format (Format_version=1, Width, Height,
Valid_bits_per_item=16, one or two bitmaps) into source and mask bitmaps,
makes the cursor with XCreatePixmapCursor and puts it on the root window
(XDefineCursor; the clients that set none inherit it).  The name is kept
in ~/.dt/cursor; 0079.dtcursor sets it at login.  The Appearance pane has
a "Pointer:" menu of the cursor names; a choice runs dtcursor -set NAME.
Measured under Xvfb: the menu lists black, bullseye, busy, ... gr_root;
choosing busy wrote ~/.dt/cursor and printed "dtcursor: busy".
This commit is contained in:
lotherk committed 2026-11-16 14:08:53 +00:00
1 parent f4ec4a1da1
commit 072d200303
35 files changed
+680 -2

No files matched your search

+3 -1
View File
@@ -179,7 +179,7 @@ dnl shell, make and the compiler. No value (an OS this case does not know)
dnl keeps config.h's own detection.
MCDE_TRADCPP_CPPFLAGS=
if test -n "$mcde_config_os_ident" ; then
MCDE_TRADCPP_CPPFLAGS="-DCONFIG_OS_IDENT=$mcde_config_os_ident"
MCDE_TRADCPP_CPPFLAGS="-DCONFIG_OS_IDENT=\\\"$mcde_config_os_ident\\\""
fi
AC_SUBST([MCDE_TRADCPP_CPPFLAGS])
@@ -954,6 +954,8 @@ programs/dtcmprefs/Makefile
programs/dtpaint/Makefile
programs/dttoolbox/Makefile
programs/mcdesoundd/Makefile
programs/dtcursor/Makefile
programs/cursors/Makefile
programs/dtappscan/Makefile
programs/dtkeys/Makefile
programs/dtthemesync/Makefile
+29
View File
@@ -2553,6 +2553,7 @@ dt/bin/dtcmprefs
${PLIST.appbuilder}dt/bin/dtcodegen
dt/bin/dtconsole
dt/bin/dtcreate
dt/bin/dtcursor
dt/bin/dtdbcache
dt/bin/dtdiskutility
dt/bin/dtdocbook2infolib
@@ -2661,6 +2662,7 @@ dt/config/Xsession.d/0072.dtkeys
dt/config/Xsession.d/0075.homefolders
dt/config/Xsession.d/0077.dtappscan
dt/config/Xsession.d/0078.dtthemesync
dt/config/Xsession.d/0079.dtcursor
dt/config/Xsetup
dt/config/Xstartup
dt/config/dtspcdenv
@@ -3616,6 +3618,33 @@ dt/share/cde/fontaliases/fixed.alias
dt/share/cde/fontaliases/fonts.alias
dt/share/cde/fontaliases/fonts.dir
dt/share/cde/fontaliases/mixed.alias
dt/share/cursors/black.cursor
dt/share/cursors/bullseye.cursor
dt/share/cursors/busy.cursor
dt/share/cursors/confirm.cursor
dt/share/cursors/copy.cursor
dt/share/cursors/copyletter.cursor
dt/share/cursors/copyletters.cursor
dt/share/cursors/document.cursor
dt/share/cursors/dup.cursor
dt/share/cursors/focus_right.cursor
dt/share/cursors/focus_up.cursor
dt/share/cursors/glass.cursor
dt/share/cursors/gr_25.cursor
dt/share/cursors/gr_50.cursor
dt/share/cursors/gr_75.cursor
dt/share/cursors/gr_root.cursor
dt/share/cursors/hglass.cursor
dt/share/cursors/ibeam.cursor
dt/share/cursors/none.cursor
dt/share/cursors/panning.cursor
dt/share/cursors/qmark.cursor
dt/share/cursors/stretchNE.cursor
dt/share/cursors/stretchNW.cursor
dt/share/cursors/stretchSE.cursor
dt/share/cursors/stretchSW.cursor
dt/share/cursors/stretch_h.cursor
dt/share/cursors/stretch_v.cursor
dt/share/dtphoto/dtphoto.menu
dt/share/palettes/Alpine.dp
dt/share/palettes/Arizona.dp
+1 -1
View File
@@ -6,7 +6,7 @@ SUBDIRS = backdrops icons dsdm dtmail dtpad dtfile dterror dtwm dtlogin \
palettes dtappintegrate dtprintegrate dtconfig \
dtcreate dtprintinfo fontaliases dtdspmsg dtimsstart \
dtpdm dtsr dtpdmd dtinfo types tttypes util dtopen localized \
dthelp dtdocbook dtlaunch dtbar dtsystemsettings dtdiskutility dtbackup dtappscan dtkeys dtthemesync dtphoto dtpaint dttoolbox mcdesoundd dtconsole dtnetutility dtimage dtcmprefs dtactivity dtscreenshot
dthelp dtdocbook dtlaunch dtbar dtsystemsettings dtdiskutility dtbackup dtappscan dtkeys dtthemesync dtphoto dtpaint dttoolbox mcdesoundd dtconsole dtnetutility dtimage dtcmprefs dtactivity dtscreenshot dtcursor cursors
# The application builder and ttsnoop, its demonstration, need dtcodegen, a
# program the build runs: not in a cross build (--disable-appbuilder; the native
+4
View File
@@ -0,0 +1,4 @@
MAINTAINERCLEANFILES = Makefile.in
cursordir = $(CDE_INSTALLATION_TOP)/share/cursors
dist_cursor_DATA = $(wildcard *.cursor)
+6
View File
@@ -0,0 +1,6 @@
/* @(#)black.cursor 85/08/19 1.1 SMI */
/* Format_version=1, Width=16, Height=16, Depth=1, Valid_bits_per_item=16
*/
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF
+4
View File
@@ -0,0 +1,4 @@
/* Format_version=1, Width=16, Height=16, Depth=1, Valid_bits_per_item=16
*/
0x0F00,0x30C0,0x4020,0x4020,0x8010,0x8610,0x8610,0x8010,
0x4020,0x4020,0x30C0,0x0F00,0x0000,0x0000,0x0000,0x0000
+18
View File
@@ -0,0 +1,18 @@
/* Format_version=1, Width=16, Height=16, Depth=1, Valid_bits_per_item=16
*/
0x07C6,
0x1FF7,
0x383B,
0x600C,
0x600C,
0xC006,
0xC006,
0xDF06,
0xC106,
0xC106,
0x610C,
0x610C,
0x3838,
0x1FF0,
0x07C0,
0x0000
+4
View File
@@ -0,0 +1,4 @@
/* Format_version=1, Width=16, Height=16, Depth=1, Valid_bits_per_item=16
*/
0x01F8, 0x0206, 0x7FF1, 0x8008, 0xB148, 0xB228, 0xB148, 0xB228,
0xB148, 0xB228, 0xB148, 0x8008, 0x8008, 0x8008, 0x8008, 0xFFF8
+8
View File
@@ -0,0 +1,8 @@
/* Format_version=1, Width=16, Height=16, Depth=1, Valid_bits_per_item=16
*/
0xC000,0xF000,0x7C00,0x7F80,0x3F80,0x3E3C,0x1F7C,0x1BDD,
0x199D,0x031D,0x061D,0x07FD,0x07FD,0x07FD,0x0001,0x01FF
+34
View File
@@ -0,0 +1,34 @@
/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
*/
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0xFFFF,0xFFFF,0xF000,0x0000,0xF000,0x0000,0x7800,
0x0000,0x8E00,0x0007,0x1800,0x0000,0x8180,0x0018,0x1800,
0x0000,0x8060,0x0060,0x1800,0x0000,0x801C,0x0380,0x1800,
0x0000,0x8003,0x0C00,0x1800,0x0000,0x8000,0xF000,0x1800,
0x0000,0x8000,0x0000,0x1800,0x0000,0x8000,0x0000,0x1800,
0x0000,0x8000,0x0030,0x1800,0x0000,0x8000,0x003C,0x1800,
0x0000,0x8000,0x001F,0x1800,0x0000,0x8000,0x001F,0xD800,
0x0000,0x8000,0x000F,0xF800,0x0000,0x8000,0x000F,0xF800,
0x0000,0x8000,0x0007,0xD800,0x0000,0x8000,0x0007,0xFBC0,
0x0000,0x8000,0x0003,0x7FC0,0x0000,0xFFFF,0xFFFF,0xFDD0,
0x0000,0x7FFF,0xFFFF,0xF9D0,0x0000,0x0000,0x0000,0x31D0,
0x0000,0x0000,0x0000,0x61D0,0x0000,0x0000,0x0000,0x7FD0,
0x0000,0x0000,0x0000,0x7FD0,0x0000,0x0000,0x0000,0x7FD0,
0x0000,0x0000,0x0000,0x0010,0x0000,0x0000,0x0000,0x1FF0,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
+34
View File
@@ -0,0 +1,34 @@
/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
*/
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x003F,0xFFFF,0xFFFC,0x0000,0x002F,0x0000,0x00F6,0x0000,
0x0020,0xE000,0x0706,0x0000,0x0027,0xFFFF,0xFFFF,0x8000,
0x0025,0x8000,0x0006,0xC000,0x0024,0x7000,0x0038,0xC000,
0x0024,0xFFFF,0xFFFF,0xF000,0x0024,0xF000,0x0000,0x7800,
0x0024,0x8E00,0x0007,0x1800,0x0024,0x8180,0x0018,0x1800,
0x0024,0x8060,0x0060,0x1800,0x0024,0x801C,0x0380,0x1800,
0x0024,0x8003,0x0C00,0x1800,0x0024,0x8000,0xF000,0x1800,
0x0024,0x8000,0x0000,0x1800,0x0024,0x8000,0x0000,0x1800,
0x0024,0x8000,0x0030,0x1800,0x0024,0x8000,0x003C,0x1800,
0x0024,0x8000,0x001F,0x1800,0x003C,0x8000,0x001F,0xD800,
0x001C,0x8000,0x000F,0xF800,0x0004,0x8000,0x000F,0xF800,
0x0007,0x8000,0x0007,0xD800,0x0003,0x8000,0x0007,0xFBC0,
0x0000,0x8000,0x0003,0x7FC0,0x0000,0xFFFF,0xFFFF,0xFDD0,
0x0000,0x7FFF,0xFFFF,0xF9D0,0x0000,0x0000,0x0000,0x31D0,
0x0000,0x0000,0x0000,0x61D0,0x0000,0x0000,0x0000,0x7FD0,
0x0000,0x0000,0x0000,0x7FD0,0x0000,0x0000,0x0000,0x7FD0,
0x0000,0x0000,0x0000,0x0010,0x0000,0x0000,0x0000,0x1FF0,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
+66
View File
@@ -0,0 +1,66 @@
/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
*/
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x03FF,0xFFC0,0x0000,
0x0000,0x0200,0x0060,0x0000,
0x0000,0x0200,0x0050,0x0000,
0x0000,0x0200,0x0048,0x0000,
0x0000,0x0200,0x0044,0x0000,
0x0000,0x0200,0x0042,0x0000,
0x0000,0x0200,0x007F,0x0000,
0x0000,0x0200,0x0003,0x0000,
0x0000,0x0200,0x0003,0x0000,
0x0000,0x0200,0x0003,0x0000,
0x0000,0x0200,0x0003,0x0000,
0x0000,0x0200,0x0003,0x0000,
0x0000,0x0200,0x0003,0x0000,
0x0000,0x0200,0x0003,0x0000,
0x0000,0x0200,0x0033,0x0000,
0x0000,0x0200,0x003F,0x0000,
0x0000,0x0200,0x001F,0x0000,
0x0000,0x0200,0x001F,0xC000,
0x0000,0x0200,0x000F,0xF000,
0x0000,0x0200,0x000F,0xF800,
0x0000,0x0200,0x0007,0xC000,
0x0000,0x0200,0x0007,0xFBC0,
0x0000,0x0200,0x0003,0x7FC0,
0x0000,0x0200,0x0003,0x7DC0,
0x0000,0x0200,0x0003,0x79C0,
0x0000,0x0200,0x0003,0x31C0,
0x0000,0x0200,0x0003,0x61C0,
0x0000,0x0200,0x0003,0x7FC0,
0x0000,0x03FF,0xFFFF,0x7FC0,
0x0000,0x01FF,0xFFFF,0x7FC0,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000
+4
View File
@@ -0,0 +1,4 @@
/* Format_version=1, Width=16, Height=16, Depth=1, Valid_bits_per_item=16
*/
0xFFF8,0xFFF8,0xC018,0xC018,0xCFFF,0xC801,0xC809,0xC801,
0xC809,0xC801,0xC809,0xF801,0xFAA9,0x0801,0x0801,0x0FFF
+18
View File
@@ -0,0 +1,18 @@
/* Format_version=1, Width=16, Height=16, Depth=1, Valid_bits_per_item=16
*/
0x0000,
0x6000,
0x7800,
0x7E00,
0x7F80,
0x7FE0,
0x7FF0,
0x7FE0,
0x7F80,
0x7E00,
0x7800,
0x6000,
0x0000,
0x0000,
0x0000,
0x0000
+18
View File
@@ -0,0 +1,18 @@
/* Format_version=1, Width=16, Height=16, Depth=1, Valid_bits_per_item=16
*/
0x0000,
0x0200,
0x0700,
0x0700,
0x0F80,
0x0F80,
0x1FC0,
0x1FC0,
0x3FE0,
0x3FE0,
0x7FF0,
0x7FF0,
0x0000,
0x0000,
0x0000,
0x0000
+4
View File
@@ -0,0 +1,4 @@
/* Format_version=1, Width=16, Height=16, Depth=1, Valid_bits_per_item=16
*/
0x1F80,0x7FC0,0x70E0,0xE070,0xC030,0xC030,0xC030,0xC030,
0xE060,0x70E0,0x3FF0,0x1F38,0x001C,0x000E,0x0007,0x0003
+4
View File
@@ -0,0 +1,4 @@
/* Format_version=1, Width=16, Height=16, Depth=1, Valid_bits_per_item=16
*/
0xFFFF, 0xA223, 0xC445, 0x9111, 0x8889, 0xA223, 0xC445, 0x9111,
0x8889, 0xA223, 0xC445, 0x9111, 0x8889, 0xA223, 0xC445, 0xFFFF
+4
View File
@@ -0,0 +1,4 @@
/* Format_version=1, Width=16, Height=16, Depth=1, Valid_bits_per_item=16
*/
0xFFFF, 0xD555, 0xAAAB, 0xD555, 0xAAAB, 0xD555, 0xAAAB, 0xD555,
0xAAAB, 0xD555, 0xAAAB, 0xD555, 0xAAAB, 0xD555, 0xAAAB, 0xFFFF
+4
View File
@@ -0,0 +1,4 @@
/* Format_version=1, Width=16, Height=16, Depth=1, Valid_bits_per_item=16
*/
0xFFFF, 0xDDDD, 0xBBBB, 0xEEEF, 0xF777, 0xDDDD, 0xBBBB, 0xEEEF,
0xF777, 0xDDDD, 0xBBBB, 0xEEEF, 0xF777, 0xDDDD, 0xBBBB, 0xFFFF
+4
View File
@@ -0,0 +1,4 @@
/* Format_version=1, Width=16, Height=16, Depth=1, Valid_bits_per_item=16
*/
0xFFFF, 0x8889, 0xA223, 0xA223, 0x8889, 0x8889, 0xA223, 0xA223,
0x8889, 0x8889, 0xA223, 0xA223, 0x8889, 0x8889, 0xA223, 0xFFFF
+4
View File
@@ -0,0 +1,4 @@
/* Format_version=1, Width=16, Height=16, Depth=1, Valid_bits_per_item=16
*/
0x7FFE,0x4002,0x200C,0x1A38,0x0FF0,0x07E0,0x03C0,0x0180,
0x0180,0x0240,0x0520,0x0810,0x1108,0x23C4,0x47E2,0x7FFE
+4
View File
@@ -0,0 +1,4 @@
/* Format_version=1, Width=16, Height=16, Depth=1, Valid_bits_per_item=16
*/
0x0C60,0x07C0,0x0100,0x0100,0x0100,0x0100,0x0100,0x0100,
0x0100,0x0100,0x0100,0x0100,0x0100,0x0100,0x07C0,0x0C60
+4
View File
@@ -0,0 +1,4 @@
/* Format_version=1, Width=16, Height=16, Depth=1, Valid_bits_per_item=16
*/
0x0000, 0x03E0, 0x0C18, 0x1004, 0x2006, 0x201A, 0x4021, 0x40C1,
0x4101, 0x4201, 0x4C01, 0x3002, 0x2002, 0x1004, 0x0C18, 0x03E0
+18
View File
@@ -0,0 +1,18 @@
/* Format_version=1, Width=16, Height=16, Depth=1, Valid_bits_per_item=16
*/
0x063F,
0x067F,
0x0EE0,
0x0FC0,
0x1F80,
0x1FF0,
0x3FF0,
0x3FC0,
0x7F00,
0x7C00,
0xF000,
0xC000,
0x0000,
0x0000,
0x0000,
0x0000
+18
View File
@@ -0,0 +1,18 @@
/* Format_version=1, Width=16, Height=16, Depth=1, Valid_bits_per_item=16
*/
0x03E0,
0x0670,
0x0030,
0x0030,
0x0060,
0x0180,
0x0300,
0x0300,
0x0300,
0x0000,
0x0000,
0x0300,
0x0300,
0x0000,
0x0000,
0x0000
+4
View File
@@ -0,0 +1,4 @@
/* Format_version=1, Width=16, Height=16, Depth=1, Valid_bits_per_item=16
*/
0x9249,0x0000,0x0000,0x3FF9,0x3FF8,0x0018,0x0019,0x0A98,
0x0018,0x0099,0x0018,0x0098,0x0019,0x0018,0x0000,0x0001
+4
View File
@@ -0,0 +1,4 @@
/* Format_version=1, Width=16, Height=16, Depth=1, Valid_bits_per_item=16
*/
0x9249,0x0000,0x0000,0x9FFC,0x1FFC,0x1800,0x9800,0x1950,
0x1800,0x9900,0x1800,0x1900,0x9800,0x1800,0x0000,0x8000
+4
View File
@@ -0,0 +1,4 @@
/* Format_version=1, Width=16, Height=16, Depth=1, Valid_bits_per_item=16
*/
0x0001,0x0000,0x0018,0x0019,0x0098,0x0018,0x0099,0x0018,
0x0A98,0x0019,0x0018,0x3FF8,0x3FF9,0x0000,0x0000,0x9249
+4
View File
@@ -0,0 +1,4 @@
/* Format_version=1, Width=16, Height=16, Depth=1, Valid_bits_per_item=16
*/
0x8000,0x0000,0x1800,0x9800,0x1900,0x1800,0x9900,0x1800,
0x1950,0x9800,0x1800,0x1FFC,0x9FFC,0x0000,0x0000,0x9249
+4
View File
@@ -0,0 +1,4 @@
/* Format_version=1, Width=16, Height=16, Depth=1, Valid_bits_per_item=16
*/
0x1248,0x0000,0x0000,0x3FFC,0x3FFC,0x0000,0x0000,0x1248,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
+4
View File
@@ -0,0 +1,4 @@
/* Format_version=1, Width=16, Height=16, Depth=1, Valid_bits_per_item=16
*/
0x0000,0x0000,0x1800,0x9900,0x1800,0x1800,0x9900,0x1800,
0x1800,0x9900,0x1800,0x1800,0x9900,0x1800,0x0000,0x0000
+10
View File
@@ -0,0 +1,10 @@
MAINTAINERCLEANFILES = Makefile.in
bin_PROGRAMS = dtcursor
dtcursor_CPPFLAGS = -I$(top_srcdir)/include \
-DCDE_INSTALLATION_TOP=\"$(CDE_INSTALLATION_TOP)\"
dtcursor_LDADD = $(XTOOLLIB)
dtcursor_SOURCES = dtcursor.c
+220
View File
@@ -0,0 +1,220 @@
/*
* dtcursor.c -- MCDE: set a Solaris cursor (.cursor) on the root window
*
* License: CNCL 1.0 (Could Not Care Less), see LICENSE at the top of the tree.
*
* A .cursor file of Solaris 2.6 is the X11 cursor text format:
*
* /* Format_version=1, Width=16, Height=16, Depth=1,
* Valid_bits_per_item=16 *\/
* 0x...., ... (Width*Height/Valid_bits_per_item source values)
* 0x...., ... (the same count for the mask)
*
* The source and mask become two bitmaps; XCreatePixmapCursor makes the
* cursor, XDefineCursor puts it on the root window (the clients that do
* not set one of their own inherit it). The choice is kept in
* ~/.dt/cursor; "dtcursor" without an argument sets the saved one.
*
* C99, POSIX and Xlib only (ext/src/mcde/AGENTS.md).
*/
#define _POSIX_C_SOURCE 200809L
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#define CURSOR_DIR CDE_INSTALLATION_TOP "/share/cursors"
#define MAX_SIDE 64
static void
Usage(void)
{
fprintf(stderr, "usage: dtcursor [-set NAME | NAME]\n");
}
/* read the .cursor file; 0 on success */
static int
ReadCursor(const char *path, unsigned short *src, unsigned short *mask,
int *wp, int *hp)
{
FILE *f;
char line[512];
int width = 0, height = 0, valid = 0;
int n = 0, total, i, count;
if ((f = fopen(path, "r")) == NULL)
return -1;
if (fgets(line, sizeof line, f) == NULL) {
fclose(f);
return -1;
}
if (sscanf(strstr(line, "Width=") != NULL ?
strstr(line, "Width=") : line, "Width=%d", &width) != 1 ||
sscanf(strstr(line, "Height=") != NULL ?
strstr(line, "Height=") : line, "Height=%d", &height) != 1 ||
sscanf(strstr(line, "Valid_bits_per_item=") != NULL ?
strstr(line, "Valid_bits_per_item=") : line,
"Valid_bits_per_item=%d", &valid) != 1) {
fclose(f);
return -1;
}
if (width < 1 || width > MAX_SIDE || height < 1 ||
height > MAX_SIDE || valid != 16) {
fclose(f);
return -1;
}
/* the values of one bitmap: width * height / 16 */
count = width * height / valid;
total = 2 * count; /* source, then the mask when the file has one */
while (n < total && fgets(line, sizeof line, f) != NULL) {
char *p = line;
while (n < total && (p = strstr(p, "0x")) != NULL) {
unsigned int v;
if (sscanf(p, "0x%x", &v) != 1)
break;
if (n < count)
src[n] = (unsigned short) v;
else
mask[n - count] = (unsigned short) v;
n++;
p += 2;
}
}
fclose(f);
if (n < count)
return -1;
/* a file without a mask: the form itself is the mask */
if (n < total)
for (i = 0; i < count; i++)
mask[i] = src[i];
*wp = width;
*hp = height;
return 0;
}
static Cursor
MakeCursor(Display *dpy, const char *path, int *wp, int *hp)
{
unsigned short src[MAX_SIDE], mask[MAX_SIDE];
unsigned char sbits[MAX_SIDE * MAX_SIDE / 8], mbits[MAX_SIDE * MAX_SIDE / 8];
Pixmap s, m;
XColor fg, bg;
Cursor c;
int w, h, i;
if (ReadCursor(path, src, mask, &w, &h) != 0)
return None;
memset(sbits, 0, sizeof sbits);
memset(mbits, 0, sizeof mbits);
for (i = 0; i < w * h / 16; i++) {
sbits[i * 2] = (unsigned char) (src[i] >> 8);
sbits[i * 2 + 1] = (unsigned char) (src[i] & 0xff);
mbits[i * 2] = (unsigned char) (mask[i] >> 8);
mbits[i * 2 + 1] = (unsigned char) (mask[i] & 0xff);
}
s = XCreateBitmapFromData(dpy, DefaultRootWindow(dpy),
(const char *) sbits, (unsigned) w, (unsigned) h);
m = XCreateBitmapFromData(dpy, DefaultRootWindow(dpy),
(const char *) mbits, (unsigned) w, (unsigned) h);
memset(&fg, 0, sizeof fg);
memset(&bg, 0, sizeof bg);
fg.flags = DoRed | DoGreen | DoBlue;
bg.flags = DoRed | DoGreen | DoBlue;
bg.red = bg.green = bg.blue = 0xffff;
c = XCreatePixmapCursor(dpy, s, m, &fg, &bg, w / 2, h / 2);
XFreePixmap(dpy, s);
XFreePixmap(dpy, m);
if (wp != NULL)
*wp = w;
if (hp != NULL)
*hp = h;
return c;
}
/* the saved cursor's name, or "" */
static void
SavedName(char *buf, size_t len)
{
const char *home = getenv("HOME");
char path[512];
FILE *f;
buf[0] = '\0';
if (home == NULL)
return;
snprintf(path, sizeof path, "%s/.dt/cursor", home);
if ((f = fopen(path, "r")) == NULL)
return;
if (fgets(buf, (int) len, f) != NULL) {
char *nl = strchr(buf, '\n');
if (nl != NULL)
*nl = '\0';
}
fclose(f);
}
static void
SaveName(const char *name)
{
const char *home = getenv("HOME");
char path[512];
FILE *f;
if (home == NULL)
return;
snprintf(path, sizeof path, "%s/.dt/cursor", home);
if ((f = fopen(path, "w")) != NULL) {
fprintf(f, "%s\n", name);
fclose(f);
}
}
int
main(int argc, char **argv)
{
Display *dpy;
const char *name = NULL;
char path[768], saved[128];
Cursor c;
if (argc > 1 && strcmp(argv[1], "-set") == 0 && argc > 2)
name = argv[2];
else if (argc > 1 && argv[1][0] != '-')
name = argv[1];
if (argc > 1 && argv[1][0] == '-' && strcmp(argv[1], "-set") != 0) {
Usage();
return 2;
}
if (name == NULL) {
SavedName(saved, sizeof saved);
if (saved[0] == '\0')
return 1;
name = saved;
}
if ((dpy = XOpenDisplay(NULL)) == NULL) {
fprintf(stderr, "dtcursor: no display\n");
return 1;
}
snprintf(path, sizeof path, "%s/%s.cursor", CURSOR_DIR, name);
c = MakeCursor(dpy, path, NULL, NULL);
if (c == None) {
fprintf(stderr, "dtcursor: cannot read %s\n", path);
XCloseDisplay(dpy);
return 1;
}
XDefineCursor(dpy, DefaultRootWindow(dpy), c);
XSync(dpy, False);
XFreeCursor(dpy, c);
XCloseDisplay(dpy);
SaveName(name);
printf("dtcursor: %s\n", name);
return 0;
}
+11
View File
@@ -0,0 +1,11 @@
#!/bin/ksh
#
# 0079.dtcursor -- MCDE: the pointer of the last session
#
# Sourced by Xsession (Xsession.d). The Appearance pane keeps the chosen
# Solaris cursor in ~/.dt/cursor; dtcursor sets it on the root window (the
# clients that do not set one of their own inherit it).
#
if [ -x "$DT_BINPATH/dtcursor" ] && [ -f "$HOME/.dt/cursor" ]; then
"$DT_BINPATH/dtcursor" > /dev/null 2>&1
fi
+96
View File
@@ -98,8 +98,40 @@ typedef struct {
static Palette pal[MAX_PALETTES];
static int npal;
/* the Solaris cursors of share/cursors */
#define MAX_CURSORS 64
static char *cursorNames[MAX_CURSORS];
static int ncursors;
static Opt cursorOpt;
static Widget appNote, appLogout, palNote, hiNote;
static void
ScanCursors(const char *dir)
{
DIR *d = opendir(dir);
struct dirent *de;
size_t n;
if (d == NULL)
return;
while ((de = readdir(d)) != NULL && ncursors < MAX_CURSORS) {
n = strlen(de->d_name);
if (n < 8 || strcmp(de->d_name + n - 7, ".cursor") != 0)
continue;
cursorNames[ncursors] = strdup(de->d_name);
cursorNames[ncursors][n - 7] = '\0';
ncursors++;
}
closedir(d);
}
static int
CursorCompare(const void *a, const void *b)
{
return strcmp(*(char *const *) a, *(char *const *) b);
}
static int
PaletteCompare(const void *a, const void *b)
{
@@ -429,6 +461,36 @@ PaletteChosen(Widget w, XtPointer data, XtPointer call)
/* the highlight colour: Motif's focus highlight and the select colour of the
* widgets that name one, for programs started after this */
/* set the chosen pointer: dtcursor -set NAME (sets the root window's
* cursor and keeps the name in ~/.dt/cursor) */
static void
CursorChosen(Widget w, XtPointer data, XtPointer call)
{
int i = (int) (long) data;
const char *home = getenv("HOME");
char path[600];
if (i < 0 || i >= ncursors)
return;
if (home != NULL) {
FILE *f;
snprintf(path, sizeof path, "%s/.dt/cursor", home);
if ((f = fopen(path, "w")) != NULL) {
fprintf(f, "%s\n", cursorNames[i]);
fclose(f);
}
}
if (fork() == 0) {
setsid();
execlp("dtcursor", "dtcursor", "-set", cursorNames[i],
(char *) NULL);
_exit(127);
}
(void) w;
(void) call;
}
static void
HighlightChosen(Widget w, XtPointer data, XtPointer call)
{
@@ -697,6 +759,11 @@ MakeAppearance(Widget parent)
ScanPalettes(CDE_INSTALLATION_TOP "/palettes");
qsort(pal, (size_t) npal, sizeof pal[0], PaletteCompare);
ncursors = 0;
ScanCursors(CDE_INSTALLATION_TOP "/share/cursors");
qsort(cursorNames, (size_t) ncursors, sizeof cursorNames[0],
CursorCompare);
/* what the colour server reads: Dtsession.<screen>.ColorPalette */
snprintf(name, sizeof name, "dtsession.%d.colorPalette", scr);
snprintf(class, sizeof class, "Dtsession.%d.ColorPalette", scr);
@@ -748,6 +815,35 @@ MakeAppearance(Widget parent)
(void) Note(box, "For selected text.");
hiNote = Note(box, "");
/* the pointer: the Solaris cursors of share/cursors (dtcursor) */
if (ncursors > 0) {
char saved[128];
int cur = 0;
FILE *f;
saved[0] = '\0';
if (home != NULL) {
snprintf(dir, sizeof dir, "%s/.dt/cursor", home);
if ((f = fopen(dir, "r")) != NULL) {
if (fgets(saved, sizeof saved, f) != NULL) {
char *nl = strchr(saved, '\n');
if (nl != NULL)
*nl = '\0';
}
fclose(f);
}
}
for (i = 0; i < ncursors; i++)
if (strcmp(cursorNames[i], saved) == 0)
cur = i;
row = Row(box, "Pointer:");
(void) OptMenu(row, "cursor",
(const char *const *) cursorNames, ncursors, cur,
CursorChosen, &cursorOpt);
(void) Note(box, "The pointer of the desktop (Solaris cursors).");
}
(void) Sep(box);
/* 2: the scroll bars and the title bar */