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 8aa629c345
Documentation updates : HISTORY.md and MANUAL.md updated. Extended README.md for the framebuffer/DRM port to describe possible mechanisms for adding fullwidth characters and an application title bar.
7 months ago
..
Makefile The 'miscellaneous tests' from the 'tests' directory can now be made, for at least some platforms, with 'make tests'. 7 months ago
README.md Documentation updates : HISTORY.md and MANUAL.md updated. Extended README.md for the framebuffer/DRM port to describe possible mechanisms for adding fullwidth characters and an application title bar. 7 months ago
drm.c DRM platform : you can now set the PDC_SCREEN environment variable to a desired connector (HDMI, DVI, VGA, etc.) and have the display chosen accordingly. 7 months 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 Framebuffer/DRM port : when the screen is rotated (see preceding commit), the 'left line' may become a 'top line', the 'top line' a 'left line', etc. Also, the strikeout may be vertical instead of horizontal. 7 months ago
pdcfb.h Framebuffer version can now be built for Linux framebuffer (what we've had all along) or for DRM = Direct Rendering Manager (works on Linux and *BSD). 2 years ago
pdcgetsc.c First attempt at Linux framebuffer port. 3 years ago
pdckbd.c Hitting Alt-/ in the framebuffer and DRM ports now rotates the screen 90 degrees clockwise. This is in preparation for use of the library on phones, where the orientation may change. (It also helps if you have a monitor set up in portrait mode.) 7 months ago
pdcscrn.c DRM platform : you can now set the PDC_SCREEN environment variable to a desired connector (HDMI, DVI, VGA, etc.) and have the display chosen accordingly. 7 months ago
pdcsetsc.c First attempt at Linux framebuffer port. 3 years ago
pdcutil.c Framebuffer port now has blinking text and cursor. 3 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. 3 years ago
psf.h Framebuffer port now supports PSF1, PSF2, vgafonts. 3 years ago
psf_wide.h Default PSF font : added some comments/documentation (no actual changes to code) 2 years ago

README.md

PDCursesMod for 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.)
  • The mouse is not supported. It looks as if the uinput system allows one to access the mouse without needing X; I need to investigate. gpm may be a better choice.
  • 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=HDMI, PDC_SCREEN=VGA, PDC_SCREEN=DVI, etc. as an environment variable to specify a particular display.

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, if we can get the mouse to work.
  • 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). Run make install (you'll probably need to be root or use sudo for this) to install the shared library.

Caveats

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

Distribution Status

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