You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
PDCursesMod/fb
Bill-Gray 8aba2b42f1
Updated README.md for framebuffer/DRM port. Clarified a comment about the 'common' mouse handling code. Updated PDC_VER_DAY and HISTORY.md.
5 days ago
..
Makefile Makefiles for x11new and framebuffer/DRM port were based on the VT makefile. The references to Microsoft Windows NT make no sense here. 1 month ago
README.md Updated README.md for framebuffer/DRM port. Clarified a comment about the 'common' mouse handling code. Updated PDC_VER_DAY and HISTORY.md. 5 days ago
cursor.c Follow-up to preceding commit : code to generate the bitmap used for the mouse cursor in the framebuffer/DRM port 1 month ago
drm.c Removed a // (C++-style) comment. Follow-up to previous 88000094 fixes of C90 compliance issues. 1 month ago
pdcclip.c Clipboard handling is identical for DOS, DOSVGA, VT, and the framebuffer port, so it's all in the 'common' directory now 3 years ago
pdcdisp.c DRM/framebuffer port's only console code use is to shut off the hardware cursor and turn it back on. We don't really need PDC_puts_to_stdout(). 1 month ago
pdcfb.h DRM/framebuffer port's only console code use is to shut off the hardware cursor and turn it back on. We don't really need PDC_puts_to_stdout(). 1 month ago
pdcgetsc.c First attempt at Linux framebuffer port. 4 years ago
pdckbd.c Framebuffer/DRM ports now have full mouse support 5 days ago
pdcmouse.c Framebuffer/DRM ports now have full mouse support 5 days ago
pdcscrn.c DRM/framebuffer port's only console code use is to shut off the hardware cursor and turn it back on. We don't really need PDC_puts_to_stdout(). 1 month ago
pdcsetsc.c First attempt at Linux framebuffer port. 4 years ago
pdcutil.c Framebuffer port now has blinking text and cursor. 4 years ago
psf.c If using a CP437 font (assumed to be any font lacking Unicode info) in a wide build, we need Unicode info to convert U+(point) to a CP437 glyph number. 4 years ago
psf.h Framebuffer port now supports PSF1, PSF2, vgafonts. 4 years ago
psf_wide.h Default PSF font : added some comments/documentation (no actual changes to code) 3 years ago

README.md

PDCursesMod for DRM and Linux framebuffer

This directory contains source code to support PDCursesMod using either the 'traditional', now-deprecated Linux framebuffer library, or the newer Direct Rendering Manager (DRM) library, which works on Linux and *BSD. Much of the VT port is recycled; for example, the input routines are identical. You will see that some source files simply #include a file from the VT port.

Shortcomings (which should be addressable) are :

  • It assumes 8 or 32 bits/pixel. It should be relatively easy to support other bit depths with suitable changes to the PDC_transform_line() function in pdcdisp.c, but I don't currently have a system that supports 15-, 16-, or 24-bits per pixel. (Fortunately, such displays appear to be getting rare. I had to dig out an elderly laptop to test the 8-bit display.)
  • Italic and bold fonts are synthesized from the given font, but it would be relatively easy to let specific fonts be used for that purpose.

The default font, borrowed from DOSVGA, is fixed at 8x14. Set the environment variable PDC_FONT to point to the name of a PSF1, PSF2, or VGA font to use that font instead. (See psf.c for comments on these font formats.) Hit Alt-Minus to toggle between the built-in and the PDC_FONT-specified fonts. Add more fonts with PDC_FONT2, PDC_FONT3, etc; Alt-Minus will then cycle among all specified fonts and the built-in one.

Alt-/ (Alt-Slash) will rotate the screen 90 degrees clockwise; repeat for 180- and 270-degree rotation. This may be useful on phones and other handheld, hand-rotatable displays. It also can help if you have a monitor set up in portrait mode.

With the Linux framebuffer, all monitors will be used. With DRM, the default one will normally be used. But you can set PDC_SCREEN=1, PDC_SCREEN=2, PDC_SCREEN=3, etc. as an environment variable to specify a particular display.

Also with DRM, you can cycle among available displays with Alt-=. On my system, at least, this only works when one is root. I've yet to figure out why.

Possible 'to do' items

In no order :

  • Fix the above shortcomings.
  • Fallback fonts.
  • Fullwidth characters. For these, we may need one font that is, say, 8 pixels wide (for most characters) and one that is 16 pixels wide for the fullwidth characters. That may be an extension of the above task of having fallback fonts : "Didn't find the desired glyph in the 'normal' font? Maybe it's in a fallback font." Alternatively, we can make use of the fact that the Unicode-to-glyph table can have the same Unicode value twice. The first one would point to a 'left' glyph; the second to a 'right' glyph. Probably the way I'll go...
  • Programmatic resizing through resize_term(), both before and after calling initscr().
  • User-resizing and moving of windows.
  • Reserve a line at the top wherein the application title and close/full-screen/minimize buttons can go. The ripoffline() function may be useful here.

Building

Run make, make WIDE=Y, or make UTF8=Y. Add DLL=Y to get a shared library (.so) on *nix builds. On Linux, add DRM=Y to get a DRM version; otherwise, you'll get a Linux framebuffer version. On *BSD, use gmake, and you get DRM no matter what (as the name implies, the Linux framebuffer is Linux-only). Add HAVE_MOUSE=Y for mouse support (this uses the evdev library). Run make install (you'll probably need to be root or use sudo for this) to install the shared library.

Permissions

Access to either the framebuffer or to DRM requires that a user be in the video group.

Caveats

See above. This all works nicely and stably, but it lacks support for 15 and (possibly) 16-bit and 24-bit displays.

Distribution Status

The files in this directory are released to the Public Domain.