├── extraParams.hxml ├── lib ├── docs │ ├── CNAME │ ├── mkman.sh │ ├── manext.awk │ └── README.md ├── sdl2 │ ├── versions.mif │ ├── pdcutil.c │ ├── pdcgetsc.c │ ├── pdcsdl.h │ ├── sdltest.c │ ├── pdcclip.c │ ├── pdcsetsc.c │ ├── Makefile.vc │ └── Makefile ├── common │ ├── README.md │ ├── borland.lrf │ ├── pdcurses.rc │ ├── libobjs.mif │ ├── acsuni.h │ ├── acsgr.h │ ├── acs437.h │ ├── iconbmp.h │ ├── icon32.xpm │ └── watcom.mif ├── sdl1 │ ├── pdcutil.c │ ├── pdcgetsc.c │ ├── pdcsdl.h │ ├── sdltest.c │ ├── Makefile │ ├── pdcsetsc.c │ └── pdcclip.c ├── wincon │ ├── pdcutil.c │ ├── pdcwin.h │ ├── Makefile.wcc │ ├── pdcgetsc.c │ ├── Makefile.bcc │ ├── Makefile │ ├── README.md │ ├── Makefile.vc │ ├── pdcsetsc.c │ └── pdcclip.c ├── os2 │ ├── pdcos2.h │ ├── Makefile.wcc │ ├── pdcutil.c │ ├── README.md │ ├── pdcgetsc.c │ ├── Makefile.bcc │ ├── Makefile │ ├── pdcsetsc.c │ └── pdcdisp.c ├── x11 │ ├── pdcgetsc.c │ ├── pdcutil.c │ ├── config.h.in │ ├── scrlbox.h │ ├── xcurses-config.in │ ├── pdcx11.h │ └── pdcsetsc.c ├── pdcurses │ ├── README.md │ ├── beep.c │ ├── move.c │ ├── delch.c │ ├── scroll.c │ ├── debug.c │ ├── inch.c │ ├── printw.c │ ├── clear.c │ └── getyx.c ├── dos │ ├── Makefile.wcc │ ├── README.md │ ├── Makefile.bcc │ ├── pdcgetsc.c │ ├── Makefile │ ├── pdcutil.c │ ├── pdcsetsc.c │ ├── pdcclip.c │ └── pdcdisp.c ├── demos │ ├── README.md │ ├── nctests.mif │ ├── ncurses_cfg.h │ ├── tui.h │ └── firework.c ├── panel.h ├── README.md └── curspriv.h ├── .github ├── FUNDING.yml ├── images │ └── screen.png └── ISSUE_TEMPLATE.md ├── haxe └── ui │ └── backend │ ├── EventImpl.hx │ ├── pdcurses │ ├── _module │ │ └── styles │ │ │ ├── dark │ │ │ └── main.css │ │ │ ├── main.css │ │ │ └── default │ │ │ ├── main.css │ │ │ ├── textinputs.css │ │ │ ├── ranges.css │ │ │ ├── sidebars.css │ │ │ ├── frames.css │ │ │ ├── buttons.css │ │ │ ├── sliders.css │ │ │ ├── progressbars.css │ │ │ ├── splitters.css │ │ │ ├── checkboxes.css │ │ │ ├── tableviews.css │ │ │ ├── listviews.css │ │ │ ├── tabs.css │ │ │ ├── scrollviews.css │ │ │ ├── dropdowns.css │ │ │ ├── menus.css │ │ │ ├── scrollbars.css │ │ │ ├── dialogs.css │ │ │ └── steppers.css │ ├── lib │ │ ├── WINDOW.hx │ │ ├── MEVENT.hx │ │ └── Keys.hx │ ├── Mouse.hx │ ├── Keyboard.hx │ ├── BorderTypes.hx │ ├── Chars.hx │ ├── ppm │ │ └── PPMImage.hx │ └── Image.hx │ ├── ImageData.hx │ ├── TextInputImpl.hx │ ├── FontData.hx │ ├── ImageSurface.hx │ ├── ComponentGraphicsImpl.hx │ ├── ComponentSurface.hx │ ├── BackendImpl.hx │ ├── ToolkitOptions.hx │ ├── CallLaterImpl.hx │ ├── PlatformImpl.hx │ ├── ImageDisplayImpl.hx │ ├── AppImpl.hx │ ├── TimerImpl.hx │ ├── AssetsImpl.hx │ ├── module.xml │ └── TextDisplayImpl.hx ├── README.md ├── haxelib.json └── LICENSE.md /extraParams.hxml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/docs/CNAME: -------------------------------------------------------------------------------- 1 | pdcurses.org -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: [ianharrigan] 2 | patreon: haxeui 3 | -------------------------------------------------------------------------------- /lib/sdl2/versions.mif: -------------------------------------------------------------------------------- 1 | SDLBASE = C:\SDL2-2.0.10 2 | TTFBASE = C:\SDL2_ttf-2.0.15 3 | -------------------------------------------------------------------------------- /haxe/ui/backend/EventImpl.hx: -------------------------------------------------------------------------------- 1 | package haxe.ui.backend; 2 | 3 | class EventImpl extends EventBase { 4 | } -------------------------------------------------------------------------------- /.github/images/screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haxeui/haxeui-pdcurses/HEAD/.github/images/screen.png -------------------------------------------------------------------------------- /haxe/ui/backend/pdcurses/_module/styles/dark/main.css: -------------------------------------------------------------------------------- 1 | .default-background { 2 | background-color: black; 3 | } -------------------------------------------------------------------------------- /haxe/ui/backend/ImageData.hx: -------------------------------------------------------------------------------- 1 | package haxe.ui.backend; 2 | 3 | typedef ImageData = haxe.ui.backend.pdcurses.ppm.PPMImage; -------------------------------------------------------------------------------- /haxe/ui/backend/TextInputImpl.hx: -------------------------------------------------------------------------------- 1 | package haxe.ui.backend; 2 | 3 | class TextInputImpl extends TextDisplayImpl { 4 | } 5 | -------------------------------------------------------------------------------- /haxe/ui/backend/FontData.hx: -------------------------------------------------------------------------------- 1 | package haxe.ui.backend; 2 | 3 | class FontData { 4 | public function new() { 5 | } 6 | } -------------------------------------------------------------------------------- /haxe/ui/backend/ImageSurface.hx: -------------------------------------------------------------------------------- 1 | package haxe.ui.backend; 2 | 3 | class ImageSurface { 4 | public function new() { 5 | } 6 | } -------------------------------------------------------------------------------- /haxe/ui/backend/ComponentGraphicsImpl.hx: -------------------------------------------------------------------------------- 1 | package haxe.ui.backend; 2 | 3 | class ComponentGraphicsImpl extends ComponentGraphicsBase { 4 | } -------------------------------------------------------------------------------- /haxe/ui/backend/ComponentSurface.hx: -------------------------------------------------------------------------------- 1 | package haxe.ui.backend; 2 | 3 | class ComponentSurface { 4 | public function new() { 5 | } 6 | } -------------------------------------------------------------------------------- /haxe/ui/backend/BackendImpl.hx: -------------------------------------------------------------------------------- 1 | package haxe.ui.backend; 2 | 3 | class BackendImpl { 4 | public static var id:String = "pdcurses"; 5 | } 6 | -------------------------------------------------------------------------------- /haxe/ui/backend/pdcurses/lib/WINDOW.hx: -------------------------------------------------------------------------------- 1 | package haxe.ui.backend.pdcurses.lib; 2 | 3 | //@:include("Options.h") 4 | @:struct 5 | @:native("WINDOW") 6 | extern class WINDOW { 7 | } -------------------------------------------------------------------------------- /haxe/ui/backend/ToolkitOptions.hx: -------------------------------------------------------------------------------- 1 | package haxe.ui.backend; 2 | 3 | import haxe.ui.backend.pdcurses.CursesApp; 4 | 5 | typedef ToolkitOptions = { 6 | ?app:CursesApp 7 | } 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # haxeui-pdcurses 2 | pdcurses text only backend for haxeui 3 | 4 |

5 | 6 |

7 | -------------------------------------------------------------------------------- /haxe/ui/backend/pdcurses/_module/styles/main.css: -------------------------------------------------------------------------------- 1 | .box, .hbox { 2 | spacing: 1px; 3 | } 4 | 5 | .vbox { 6 | vertical-spacing: 0px; 7 | } 8 | 9 | .grid { 10 | vertical-spacing: 0; 11 | } -------------------------------------------------------------------------------- /haxe/ui/backend/CallLaterImpl.hx: -------------------------------------------------------------------------------- 1 | package haxe.ui.backend; 2 | 3 | class CallLaterImpl { 4 | private static var _fns:ArrayVoid> = []; 5 | 6 | public function new(fn:Void->Void) { 7 | _fns.push(fn); 8 | } 9 | } -------------------------------------------------------------------------------- /haxe/ui/backend/pdcurses/_module/styles/default/main.css: -------------------------------------------------------------------------------- 1 | .default-background { 2 | background-color: white; 3 | } 4 | 5 | .image { 6 | color: #000000; 7 | } 8 | 9 | .label { 10 | background-color: none; 11 | color: #000080; 12 | } -------------------------------------------------------------------------------- /haxe/ui/backend/pdcurses/_module/styles/default/textinputs.css: -------------------------------------------------------------------------------- 1 | .textfield { 2 | border: 1px single #000088; 3 | background-color: none; 4 | initial-width: 20px; 5 | filter: none; 6 | height: 3px; 7 | padding: 1px; 8 | color: #000000; 9 | } 10 | -------------------------------------------------------------------------------- /lib/docs/mkman.sh: -------------------------------------------------------------------------------- 1 | echo Definitions and Variables \(curses.h\) > MANUAL.md 2 | echo ==================================== >> MANUAL.md 3 | ./manext.awk ../curses.h >> MANUAL.md 4 | echo Functions >> MANUAL.md 5 | echo ========= >> MANUAL.md 6 | ./manext.awk ../pdcurses/*.c >> MANUAL.md 7 | ./manext.awk ../x11/*.c >> MANUAL.md 8 | -------------------------------------------------------------------------------- /lib/common/README.md: -------------------------------------------------------------------------------- 1 | PDCurses common files 2 | ===================== 3 | 4 | This directory is for files which are platform-specific, yet shared by 5 | more than one platform, in contrast to the "common core" in ../pdcurses. 6 | 7 | 8 | Distribution Status 9 | ------------------- 10 | 11 | The files in this directory are released to the public domain. 12 | -------------------------------------------------------------------------------- /lib/docs/manext.awk: -------------------------------------------------------------------------------- 1 | #!/usr/bin/awk -f 2 | BEGIN { 3 | inman=0; 4 | bar="\n\n--------------------------------------------------------------------------\n"; 5 | } 6 | { 7 | if (inman) { 8 | if ($0 ~ /^\*\*man-end/) { 9 | inman=0; 10 | print bar; 11 | } else 12 | print; 13 | } else if ($0 ~ /^\/\*man-start\*/) 14 | inman=1; 15 | } 16 | -------------------------------------------------------------------------------- /haxe/ui/backend/pdcurses/_module/styles/default/ranges.css: -------------------------------------------------------------------------------- 1 | .range { 2 | color: #888888; 3 | border: none; 4 | padding: 0; 5 | background-image: 'CKBOARD' 6 | } 7 | 8 | .range-value { 9 | background-color: #000088; 10 | border: none; 11 | } 12 | 13 | .range { 14 | filter: none; 15 | background-image: 'CKBOARD'; 16 | background-color: #FFFFFF; 17 | color: #000080; 18 | border: none; 19 | __height: 5px; 20 | } 21 | -------------------------------------------------------------------------------- /haxe/ui/backend/pdcurses/lib/MEVENT.hx: -------------------------------------------------------------------------------- 1 | package haxe.ui.backend.pdcurses.lib; 2 | 3 | import cpp.RawPointer; 4 | 5 | @:include("curses.h") 6 | @:struct 7 | @:native("MEVENT") 8 | extern class MEVENT { 9 | public var id:Int; 10 | public var x:Int; 11 | public var y:Int; 12 | public var z:Int; 13 | public var bstate:Int; 14 | 15 | @:native("new MEVENT") public static function create():RawPointer; 16 | } 17 | -------------------------------------------------------------------------------- /lib/sdl2/pdcutil.c: -------------------------------------------------------------------------------- 1 | /* PDCurses */ 2 | 3 | #include "pdcsdl.h" 4 | 5 | void PDC_beep(void) 6 | { 7 | PDC_LOG(("PDC_beep() - called\n")); 8 | } 9 | 10 | void PDC_napms(int ms) 11 | { 12 | PDC_LOG(("PDC_napms() - called: ms=%d\n", ms)); 13 | 14 | while (ms > 50) 15 | { 16 | PDC_pump_and_peep(); 17 | SDL_Delay(50); 18 | ms -= 50; 19 | } 20 | PDC_pump_and_peep(); 21 | SDL_Delay(ms); 22 | } 23 | 24 | const char *PDC_sysname(void) 25 | { 26 | return "SDL2"; 27 | } 28 | -------------------------------------------------------------------------------- /haxelib.json: -------------------------------------------------------------------------------- 1 | { 2 | "contributors": [ 3 | "haxeui", 4 | "ianharrigan" 5 | ], 6 | "version": "1.7.0", 7 | "dependencies": { 8 | "haxeui-core": "" 9 | }, 10 | "releasenote": "1.7.0 release", 11 | "tags": [ 12 | "ui", 13 | "gui", 14 | "pdcurses" 15 | ], 16 | "license": "MIT", 17 | "name": "haxeui-pdcurses", 18 | "description": "The pdcurses backend of the HaxeUI framework", 19 | "url": "https://github.com/haxeui/haxeui-pdcurses" 20 | } -------------------------------------------------------------------------------- /lib/sdl1/pdcutil.c: -------------------------------------------------------------------------------- 1 | /* PDCurses */ 2 | 3 | #include "pdcsdl.h" 4 | 5 | void PDC_beep(void) 6 | { 7 | PDC_LOG(("PDC_beep() - called\n")); 8 | } 9 | 10 | void PDC_napms(int ms) 11 | { 12 | PDC_LOG(("PDC_napms() - called: ms=%d\n", ms)); 13 | 14 | PDC_update_rects(); 15 | while (ms > 50) 16 | { 17 | SDL_PumpEvents(); 18 | SDL_Delay(50); 19 | ms -= 50; 20 | } 21 | SDL_PumpEvents(); 22 | SDL_Delay(ms); 23 | } 24 | 25 | const char *PDC_sysname(void) 26 | { 27 | return "SDL"; 28 | } 29 | -------------------------------------------------------------------------------- /lib/wincon/pdcutil.c: -------------------------------------------------------------------------------- 1 | /* PDCurses */ 2 | 3 | #include "pdcwin.h" 4 | 5 | void PDC_beep(void) 6 | { 7 | PDC_LOG(("PDC_beep() - called\n")); 8 | 9 | /* MessageBeep(MB_OK); */ 10 | MessageBeep(0XFFFFFFFF); 11 | } 12 | 13 | void PDC_napms(int ms) 14 | { 15 | PDC_LOG(("PDC_napms() - called: ms=%d\n", ms)); 16 | 17 | if ((SP->termattrs & A_BLINK) && (GetTickCount() >= pdc_last_blink + 500)) 18 | PDC_blink_text(); 19 | 20 | Sleep(ms); 21 | } 22 | 23 | const char *PDC_sysname(void) 24 | { 25 | return "Windows"; 26 | } 27 | -------------------------------------------------------------------------------- /lib/os2/pdcos2.h: -------------------------------------------------------------------------------- 1 | /* PDCurses */ 2 | 3 | #include 4 | #include 5 | 6 | #define INCL_DOS 7 | #define INCL_DOSMISC 8 | #define INCL_WIN 9 | #define INCL_VIO 10 | #define INCL_KBD 11 | #define INCL_MOU 12 | #include 13 | 14 | #include 15 | 16 | extern ULONG pdc_last_blink; 17 | extern short pdc_curstoreal[16]; 18 | extern int pdc_font; 19 | 20 | extern ULONG PDC_ms_count(void); 21 | extern void PDC_get_keyboard_info(void); 22 | extern void PDC_set_keyboard_default(void); 23 | extern void PDC_blink_text(void); 24 | -------------------------------------------------------------------------------- /lib/x11/pdcgetsc.c: -------------------------------------------------------------------------------- 1 | /* PDCurses */ 2 | 3 | #include "pdcx11.h" 4 | 5 | /* return width of screen/viewport */ 6 | 7 | int PDC_get_columns(void) 8 | { 9 | PDC_LOG(("PDC_get_columns() - called\n")); 10 | 11 | return pdc_wwidth / pdc_fwidth; 12 | } 13 | 14 | /* get the cursor size/shape */ 15 | 16 | int PDC_get_cursor_mode(void) 17 | { 18 | return 0; 19 | } 20 | 21 | /* return number of screen rows */ 22 | 23 | int PDC_get_rows(void) 24 | { 25 | PDC_LOG(("PDC_get_rows() - called\n")); 26 | 27 | return pdc_wheight / pdc_fheight; 28 | } 29 | -------------------------------------------------------------------------------- /haxe/ui/backend/pdcurses/_module/styles/default/sidebars.css: -------------------------------------------------------------------------------- 1 | .sidebar-modal-background { 2 | backdrop-filter: greyscale; 3 | background-color: none; 4 | } 5 | 6 | .sidebar { 7 | padding: 1px; 8 | filter: none; 9 | padding-left: 2px; 10 | padding-right: 2px; 11 | } 12 | 13 | .sidebar:left { 14 | border-right: 1px single #000080; 15 | } 16 | 17 | .sidebar:right { 18 | border-left: 1px single #000080; 19 | } 20 | 21 | .sidebar:top { 22 | border-bottom: 1px single #000080; 23 | } 24 | 25 | .sidebar:bottom { 26 | border-top: 1px single #000080; 27 | } 28 | -------------------------------------------------------------------------------- /lib/pdcurses/README.md: -------------------------------------------------------------------------------- 1 | PDCurses Portable Core 2 | ====================== 3 | 4 | This directory contains core PDCurses source code files common to all 5 | platforms. 6 | 7 | 8 | Building 9 | -------- 10 | 11 | These modules are built by the platform-specific makefiles, in the 12 | platform directories. 13 | 14 | 15 | Distribution Status 16 | ------------------- 17 | 18 | The files in this directory are released to the public domain. 19 | 20 | 21 | Acknowledgements 22 | ---------------- 23 | 24 | The panel library was originally provided by 25 | Warren Tucker 26 | -------------------------------------------------------------------------------- /lib/os2/Makefile.wcc: -------------------------------------------------------------------------------- 1 | # Watcom Makefile for PDCurses - OS/2 2 | # 3 | # Usage: wmake -f [path\]Makefile.wcc [DEBUG=Y] [target] 4 | # 5 | # where target can be any of: 6 | # [all|demos|pdcurses.lib|testcurs.exe...] 7 | 8 | !ifdef %PDCURSES_SRCDIR 9 | PDCURSES_SRCDIR = $(%PDCURSES_SRCDIR) 10 | !else 11 | PDCURSES_SRCDIR = .. 12 | !endif 13 | 14 | osdir = $(PDCURSES_SRCDIR)/os2 15 | 16 | CC = wcc386 17 | TARGET = os2v2 18 | 19 | CFLAGS = -bt=$(TARGET) -i=c:\watcom\h\os2 20 | 21 | !include $(PDCURSES_SRCDIR)/common/watcom.mif 22 | 23 | $(LIBCURSES) : $(LIBOBJS) $(PDCOBJS) 24 | $(LIBEXE) $@ $(LIBOBJS) $(PDCOBJS) 25 | -------------------------------------------------------------------------------- /haxe/ui/backend/pdcurses/_module/styles/default/frames.css: -------------------------------------------------------------------------------- 1 | .frame { 2 | border: 1px single #000080; 3 | padding-left: 1px; 4 | } 5 | 6 | .frame-contents { 7 | border-top: none; 8 | border-left: 1px single #000080; 9 | border-right: 1px single #000080; 10 | border-bottom: none; 11 | padding: 1px; 12 | padding-top: 0px; 13 | padding-left: 2px; 14 | padding-right: 2px; 15 | padding-bottom: 2px; 16 | } 17 | 18 | .frame-left-line, .frame-right-line { 19 | background-color: none; 20 | } 21 | 22 | .frame-title { 23 | background-color: none; 24 | color: #000080; 25 | } 26 | -------------------------------------------------------------------------------- /lib/sdl1/pdcgetsc.c: -------------------------------------------------------------------------------- 1 | /* PDCurses */ 2 | 3 | #include "pdcsdl.h" 4 | 5 | /* get the cursor size/shape */ 6 | 7 | int PDC_get_cursor_mode(void) 8 | { 9 | PDC_LOG(("PDC_get_cursor_mode() - called\n")); 10 | 11 | return 0; 12 | } 13 | 14 | /* return number of screen rows */ 15 | 16 | int PDC_get_rows(void) 17 | { 18 | PDC_LOG(("PDC_get_rows() - called\n")); 19 | 20 | return pdc_sheight / pdc_fheight; 21 | } 22 | 23 | /* return width of screen/viewport */ 24 | 25 | int PDC_get_columns(void) 26 | { 27 | PDC_LOG(("PDC_get_columns() - called\n")); 28 | 29 | return pdc_swidth / pdc_fwidth; 30 | } 31 | -------------------------------------------------------------------------------- /lib/sdl2/pdcgetsc.c: -------------------------------------------------------------------------------- 1 | /* PDCurses */ 2 | 3 | #include "pdcsdl.h" 4 | 5 | /* get the cursor size/shape */ 6 | 7 | int PDC_get_cursor_mode(void) 8 | { 9 | PDC_LOG(("PDC_get_cursor_mode() - called\n")); 10 | 11 | return 0; 12 | } 13 | 14 | /* return number of screen rows */ 15 | 16 | int PDC_get_rows(void) 17 | { 18 | PDC_LOG(("PDC_get_rows() - called\n")); 19 | 20 | return pdc_sheight / pdc_fheight; 21 | } 22 | 23 | /* return width of screen/viewport */ 24 | 25 | int PDC_get_columns(void) 26 | { 27 | PDC_LOG(("PDC_get_columns() - called\n")); 28 | 29 | return pdc_swidth / pdc_fwidth; 30 | } 31 | -------------------------------------------------------------------------------- /lib/common/borland.lrf: -------------------------------------------------------------------------------- 1 | +addch.obj +addchstr.obj +addstr.obj +attr.obj +beep.obj +bkgd.obj & 2 | +border.obj +clear.obj +color.obj +delch.obj +deleteln.obj & 3 | +getch.obj +getstr.obj +getyx.obj +inch.obj +inchstr.obj +initscr.obj & 4 | +inopts.obj +insch.obj +insstr.obj +instr.obj +kernel.obj +keyname.obj & 5 | +mouse.obj +move.obj +outopts.obj +overlay.obj +pad.obj +panel.obj & 6 | +printw.obj +refresh.obj +scanw.obj +scr_dump.obj +scroll.obj +slk.obj & 7 | +termattr.obj +touch.obj +util.obj +window.obj +debug.obj & 8 | +pdcclip.obj +pdcdisp.obj +pdcgetsc.obj +pdckbd.obj +pdcscrn.obj & 9 | +pdcsetsc.obj +pdcutil.obj ,lib.map 10 | -------------------------------------------------------------------------------- /haxe/ui/backend/PlatformImpl.hx: -------------------------------------------------------------------------------- 1 | package haxe.ui.backend; 2 | 3 | import haxe.ui.backend.pdcurses.lib.Keys.*; 4 | 5 | class PlatformImpl extends PlatformBase { 6 | public override function getKeyCode(keyId:String):Int { 7 | return switch (keyId) { 8 | case "tab": KEY_TAB; 9 | case "up": KEY_UP; 10 | case "down": KEY_DOWN; 11 | case "left": KEY_LEFT; 12 | case "right": KEY_RIGHT; 13 | case "space": KEY_SPACE; 14 | case "enter": KEY_ENTER; 15 | case "escape": KEY_ESCAPE; 16 | case _: keyId.charCodeAt(0); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /haxe/ui/backend/pdcurses/_module/styles/default/buttons.css: -------------------------------------------------------------------------------- 1 | .button { 2 | border: 1px thin #000088; 3 | padding: 1px 1px; 4 | color: #ffffff; 5 | background-color: #000088; 6 | filter: drop-shadow(.5, 1, #888888); 7 | spacing: 1px; 8 | } 9 | 10 | .button:hover { 11 | background-color: #0000FF; 12 | border-color: #0000FF; 13 | } 14 | 15 | .button:down { 16 | background-color: #000088; 17 | border-color: #000088; 18 | filter: drop-shadow(0, 0, #888888); 19 | } 20 | 21 | .button:active { 22 | background-color: #0000FF; 23 | border-color: #0000FF; 24 | } 25 | 26 | .button .image { 27 | color: #ffffff; 28 | } -------------------------------------------------------------------------------- /haxe/ui/backend/pdcurses/_module/styles/default/sliders.css: -------------------------------------------------------------------------------- 1 | .horizontal-slider { 2 | padding: 0; 3 | initial-width: 20px; 4 | } 5 | 6 | .horizontal-slider .slider-value { 7 | width: 100%; 8 | height: 1px; 9 | vertical-align: center; 10 | cursor: pointer; 11 | background-image: 'HLINE'; 12 | background-color: none; 13 | padding: 0; 14 | } 15 | 16 | .horizontal-slider .range-value { 17 | color: #000080; 18 | background-image: 'HLINE'; 19 | background-color: none; 20 | } 21 | 22 | .horizontal-slider .button { 23 | width: 1px; 24 | height: 1px; 25 | vertical-align: center; 26 | filter: none; 27 | border: none; 28 | } 29 | -------------------------------------------------------------------------------- /haxe/ui/backend/pdcurses/_module/styles/default/progressbars.css: -------------------------------------------------------------------------------- 1 | .horizontal-progress { 2 | height: 1px; 3 | initial-width: 20px; 4 | color: #888888; 5 | border: none; 6 | padding: 0; 7 | background-image: 'CKBOARD' 8 | } 9 | 10 | .horizontal-progress .progress-value { 11 | background-color: #000088; 12 | border: none; 13 | } 14 | 15 | .vertical-progress { 16 | width: 1px; 17 | initial-height: 10px; 18 | color: #888888; 19 | border: none; 20 | padding: 0; 21 | background-image: 'CKBOARD' 22 | } 23 | 24 | .vertical-progress .progress-value { 25 | background-color: #000088; 26 | border: none; 27 | } 28 | 29 | .horizontal-progress, .progress { 30 | filter: none; 31 | } 32 | -------------------------------------------------------------------------------- /haxe/ui/backend/pdcurses/_module/styles/default/splitters.css: -------------------------------------------------------------------------------- 1 | .vertical-splitter { 2 | spacing: 0; 3 | } 4 | 5 | .vertical-splitter-gripper { 6 | height: 1px; 7 | border: none; 8 | border-top: 1px single #C0C0C0; 9 | margin-left: 1px; 10 | margin-right: 1px; 11 | background-color: none; 12 | } 13 | 14 | .vertical-splitter-gripper:hover { 15 | background-color: none; 16 | } 17 | 18 | .horizontal-splitter { 19 | spacing: 0; 20 | } 21 | 22 | .horizontal-splitter-gripper { 23 | width: 1px; 24 | border: none; 25 | border-left: 1px single #C0C0C0; 26 | margin-top: 1px; 27 | margin-bottom: 1px; 28 | background-color: none; 29 | } 30 | 31 | .horizontal-splitter-gripper:hover { 32 | background-color: none; 33 | } -------------------------------------------------------------------------------- /lib/x11/pdcutil.c: -------------------------------------------------------------------------------- 1 | /* PDCurses */ 2 | 3 | #include "pdcx11.h" 4 | 5 | #if defined(HAVE_POLL) && !defined(HAVE_USLEEP) 6 | # include 7 | #endif 8 | 9 | void PDC_beep(void) 10 | { 11 | PDC_LOG(("PDC_beep() - called\n")); 12 | 13 | XBell(XtDisplay(pdc_toplevel), 50); 14 | } 15 | 16 | void PDC_napms(int ms) 17 | { 18 | PDC_LOG(("PDC_napms() - called: ms=%d\n", ms)); 19 | 20 | XSync(XtDisplay(pdc_toplevel), False); 21 | 22 | #if defined(HAVE_USLEEP) 23 | 24 | usleep(1000 * ms); 25 | 26 | #elif defined(HAVE_POLL) 27 | { 28 | struct pollfd fd; 29 | fd.fd = -1; 30 | fd.events = 0; 31 | poll(&fd, 1, ms); 32 | } 33 | #endif 34 | } 35 | 36 | const char *PDC_sysname(void) 37 | { 38 | return "X11"; 39 | } 40 | -------------------------------------------------------------------------------- /lib/os2/pdcutil.c: -------------------------------------------------------------------------------- 1 | /* PDCurses */ 2 | 3 | #include "pdcos2.h" 4 | 5 | #if defined(OS2) && !defined(__EMX__) 6 | APIRET APIENTRY DosSleep(ULONG ulTime); 7 | #endif 8 | 9 | void PDC_beep(void) 10 | { 11 | PDC_LOG(("PDC_beep() - called\n")); 12 | 13 | DosBeep(1380, 100); 14 | } 15 | 16 | ULONG PDC_ms_count(void) 17 | { 18 | ULONG now; 19 | 20 | DosQuerySysInfo(QSV_MS_COUNT, QSV_MS_COUNT, &now, sizeof(ULONG)); 21 | 22 | return now; 23 | } 24 | 25 | void PDC_napms(int ms) 26 | { 27 | PDC_LOG(("PDC_napms() - called: ms=%d\n", ms)); 28 | 29 | if ((SP->termattrs & A_BLINK) && (PDC_ms_count() >= pdc_last_blink + 500)) 30 | PDC_blink_text(); 31 | 32 | DosSleep(ms); 33 | } 34 | 35 | const char *PDC_sysname(void) 36 | { 37 | return "OS/2"; 38 | } 39 | -------------------------------------------------------------------------------- /lib/wincon/pdcwin.h: -------------------------------------------------------------------------------- 1 | /* PDCurses */ 2 | 3 | #if defined(PDC_WIDE) && !defined(UNICODE) 4 | # define UNICODE 5 | #endif 6 | 7 | #define WIN32_LEAN_AND_MEAN 8 | #include 9 | #undef MOUSE_MOVED 10 | #include 11 | 12 | #if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) 13 | # define _CRT_SECURE_NO_DEPRECATE 1 /* kill nonsense warnings */ 14 | #endif 15 | 16 | typedef struct {short r, g, b; bool mapped;} PDCCOLOR; 17 | 18 | extern PDCCOLOR pdc_color[PDC_MAXCOL]; 19 | 20 | extern HANDLE pdc_con_out, pdc_con_in; 21 | extern DWORD pdc_quick_edit; 22 | extern DWORD pdc_last_blink; 23 | extern short pdc_curstoreal[16], pdc_curstoansi[16]; 24 | extern short pdc_oldf, pdc_oldb, pdc_oldu; 25 | extern bool pdc_conemu, pdc_ansi; 26 | 27 | extern void PDC_blink_text(void); 28 | -------------------------------------------------------------------------------- /lib/dos/Makefile.wcc: -------------------------------------------------------------------------------- 1 | # Watcom Makefile for PDCurses - DOS 2 | # 3 | # Usage: wmake -f [path\]Makefile.wcc [DEBUG=Y] [MODEL=c|h|l|m|s|f] [target] 4 | # 5 | # where target can be any of: 6 | # [all|demos|pdcurses.lib|testcurs.exe...] 7 | 8 | !ifndef MODEL 9 | MODEL = l 10 | !endif 11 | 12 | !ifdef %PDCURSES_SRCDIR 13 | PDCURSES_SRCDIR = $(%PDCURSES_SRCDIR) 14 | !else 15 | PDCURSES_SRCDIR = .. 16 | !endif 17 | 18 | osdir = $(PDCURSES_SRCDIR)/dos 19 | 20 | !ifeq MODEL f 21 | CC = wcc386 22 | TARGET = dos4g 23 | !else 24 | CC = wcc 25 | TARGET = dos 26 | !endif 27 | 28 | CFLAGS = -bt=$(TARGET) -m$(MODEL) 29 | 30 | !include $(PDCURSES_SRCDIR)/common/watcom.mif 31 | 32 | $(LIBCURSES) : $(LIBOBJS) $(PDCOBJS) 33 | %write wccdos.lrf $(LIBOBJS) $(PDCOBJS) 34 | $(LIBEXE) $@ @wccdos.lrf 35 | -$(RM) wccdos.lrf 36 | -------------------------------------------------------------------------------- /lib/wincon/Makefile.wcc: -------------------------------------------------------------------------------- 1 | # Watcom Makefile for PDCurses - Windows console 2 | # 3 | # Usage: wmake -f [path\]Makefile.wcc [DEBUG=Y] [WIDE=Y] [UTF8=Y] 4 | # [INFOEX=N] [target] 5 | # 6 | # where target can be any of: 7 | # [all|demos|pdcurses.lib|testcurs.exe...] 8 | 9 | !ifdef %PDCURSES_SRCDIR 10 | PDCURSES_SRCDIR = $(%PDCURSES_SRCDIR) 11 | !else 12 | PDCURSES_SRCDIR = .. 13 | !endif 14 | 15 | osdir = $(PDCURSES_SRCDIR)/wincon 16 | 17 | CC = wcc386 18 | TARGET = nt 19 | 20 | CFLAGS = -bt=$(TARGET) 21 | 22 | !ifeq WIDE Y 23 | CFLAGS += -DPDC_WIDE 24 | !endif 25 | 26 | !ifeq UTF8 Y 27 | CFLAGS += -DPDC_FORCE_UTF8 28 | !endif 29 | 30 | !ifeq INFOEX N 31 | CFLAGS += -DHAVE_NO_INFOEX 32 | !endif 33 | 34 | !include $(PDCURSES_SRCDIR)/common/watcom.mif 35 | 36 | $(LIBCURSES) : $(LIBOBJS) $(PDCOBJS) 37 | $(LIBEXE) $@ $(LIBOBJS) $(PDCOBJS) 38 | -------------------------------------------------------------------------------- /haxe/ui/backend/pdcurses/lib/Keys.hx: -------------------------------------------------------------------------------- 1 | package haxe.ui.backend.pdcurses.lib; 2 | 3 | @:include("curses.h") 4 | extern class Keys { 5 | public static inline var KEY_TAB:Int = 9; 6 | public static inline var KEY_ESCAPE:Int = 27; 7 | public static inline var KEY_SPACE:Int = 32; 8 | public static inline var KEY_ENTER:Int = 10; 9 | 10 | @:native("KEY_BTAB") public static var KEY_BTAB:Int; 11 | @:native("KEY_MOUSE") public static var KEY_MOUSE:Int; 12 | @:native("KEY_DOWN") public static var KEY_DOWN:Int; 13 | @:native("KEY_UP") public static var KEY_UP:Int; 14 | @:native("KEY_LEFT") public static var KEY_LEFT:Int; 15 | @:native("KEY_RIGHT") public static var KEY_RIGHT:Int; 16 | } -------------------------------------------------------------------------------- /haxe/ui/backend/ImageDisplayImpl.hx: -------------------------------------------------------------------------------- 1 | package haxe.ui.backend; 2 | 3 | import haxe.ui.backend.pdcurses.Window; 4 | 5 | class ImageDisplayImpl extends ImageBase { 6 | public function print(window:Window, x:Int, y:Int, fg:Int, bg:Int) { 7 | var data = _imageInfo.data; 8 | 9 | var n = 0; 10 | for (yy in 0...data.height) { 11 | for (xx in 0...data.width) { 12 | var f = fg; 13 | var b = bg; 14 | 15 | var px:Int = Std.int(x + xx + _left); 16 | var py:Int = Std.int(y + yy + _top); 17 | var c = data.data[n]; 18 | if (c != -1) { 19 | f = c; 20 | b = c; 21 | } 22 | var ch = data.char; 23 | window.drawChar(px, py, f, b, ch, false); 24 | n++; 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/wincon/pdcgetsc.c: -------------------------------------------------------------------------------- 1 | /* PDCurses */ 2 | 3 | #include "pdcwin.h" 4 | 5 | /* get the cursor size/shape */ 6 | 7 | int PDC_get_cursor_mode(void) 8 | { 9 | CONSOLE_CURSOR_INFO ci; 10 | 11 | PDC_LOG(("PDC_get_cursor_mode() - called\n")); 12 | 13 | GetConsoleCursorInfo(pdc_con_out, &ci); 14 | 15 | return ci.dwSize; 16 | } 17 | 18 | /* return number of screen rows */ 19 | 20 | int PDC_get_rows(void) 21 | { 22 | CONSOLE_SCREEN_BUFFER_INFO scr; 23 | 24 | PDC_LOG(("PDC_get_rows() - called\n")); 25 | 26 | GetConsoleScreenBufferInfo(pdc_con_out, &scr); 27 | 28 | return scr.srWindow.Bottom - scr.srWindow.Top + 1; 29 | } 30 | 31 | /* return width of screen/viewport */ 32 | 33 | int PDC_get_columns(void) 34 | { 35 | CONSOLE_SCREEN_BUFFER_INFO scr; 36 | 37 | PDC_LOG(("PDC_get_columns() - called\n")); 38 | 39 | GetConsoleScreenBufferInfo(pdc_con_out, &scr); 40 | 41 | return scr.srWindow.Right - scr.srWindow.Left + 1; 42 | } 43 | -------------------------------------------------------------------------------- /lib/os2/README.md: -------------------------------------------------------------------------------- 1 | PDCurses for OS/2 2 | ================= 3 | 4 | This directory contains PDCurses source code files specific to OS/2. 5 | 6 | 7 | Building 8 | -------- 9 | 10 | - Choose the appropriate makefile for your compiler: 11 | 12 | Makefile - GCC/EMX 13 | Makefile.bcc - Borland C++ 14 | Makefile.wcc - Watcom 15 | 16 | - Optionally, you can build in a different directory than the platform 17 | directory by setting PDCURSES_SRCDIR to point to the directory where 18 | you unpacked PDCurses, and changing to your target directory: 19 | 20 | set PDCURSES_SRCDIR=c:\pdcurses 21 | 22 | - Build it: 23 | 24 | make -f makefilename 25 | 26 | (For Watcom, use "wmake" instead of "make".) You'll get the library 27 | (pdcurses.lib or .a, depending on your compiler) and a lot of object 28 | files. Add the target "demos" to build the sample programs. 29 | 30 | 31 | Distribution Status 32 | ------------------- 33 | 34 | The files in this directory are released to the public domain. 35 | -------------------------------------------------------------------------------- /lib/x11/config.h.in: -------------------------------------------------------------------------------- 1 | /* config.h.in. Generated from configure.ac by autoheader. */ 2 | 3 | /* Define if you have the header file */ 4 | #undef HAVE_DECKEYSYM_H 5 | 6 | /* Define to 1 if you have the `poll' function. */ 7 | #undef HAVE_POLL 8 | 9 | /* Define if you have the header file */ 10 | #undef HAVE_SUNKEYSYM_H 11 | 12 | /* Define to 1 if you have the header file. */ 13 | #undef HAVE_UNISTD_H 14 | 15 | /* Define to 1 if you have the `usleep' function. */ 16 | #undef HAVE_USLEEP 17 | 18 | /* Define to 1 if you have the `vsnprintf' function. */ 19 | #undef HAVE_VSNPRINTF 20 | 21 | /* Define to 1 if you have the `vsscanf' function. */ 22 | #undef HAVE_VSSCANF 23 | 24 | /* Define if you have the header file */ 25 | #undef HAVE_XPM_H 26 | 27 | /* Define if you want to use neXtaw library */ 28 | #undef USE_NEXTAW 29 | 30 | /* Define if you want to use Xaw3d library */ 31 | #undef USE_XAW3D 32 | 33 | /* Define XPointer is typedefed in X11/Xlib.h */ 34 | #undef XPOINTER_TYPEDEFED 35 | -------------------------------------------------------------------------------- /lib/demos/README.md: -------------------------------------------------------------------------------- 1 | PDCurses Demos 2 | ============== 3 | 4 | This directory contains demonstration programs to show and test the 5 | capabilities of curses libraries. Some of them predate PDCurses, 6 | PCcurses or even pcurses/ncurses. Although some PDCurses-specific code 7 | has been added, all programs remain portable to other implementations 8 | (at a minimum, to ncurses). 9 | 10 | 11 | Building 12 | -------- 13 | 14 | The demos are built by the platform-specific makefiles, in the platform 15 | directories. Alternatively, you can build them manually, individually, 16 | and link with any curses library; e.g., "cc -orain rain.c -lcurses". 17 | There are no dependencies besides curses and the standard C library, and 18 | no configuration is needed. 19 | 20 | 21 | Distribution Status 22 | ------------------- 23 | 24 | Public domain, except for rain.c and worm.c, which are under the ncurses 25 | license (MIT-like), and UTF-8-demo.txt, which is under Creative Commons 26 | Attribution ([CC BY]). 27 | 28 | [CC BY]: https://creativecommons.org/licenses/by/4.0/ 29 | -------------------------------------------------------------------------------- /lib/demos/nctests.mif: -------------------------------------------------------------------------------- 1 | # This provides for compiling and linking the ncurses test programs. 2 | 3 | ncurses_testdir = $(HOME)/ncurses-6.1/test 4 | 5 | NCURSES_TESTS = bs$(E) gdc$(E) hanoi$(E) knight$(E) tclock$(E) \ 6 | lrtest$(E) ncurses$(E) 7 | 8 | ncurses_tests: $(NCURSES_TESTS) 9 | 10 | ncurses_clean: 11 | -rm -f *.$(O) trace $(NCURSES_TESTS) 12 | 13 | NCFLAGS = $(DEMOFLAGS) -I$(demodir) -I$(ncurses_testdir) 14 | 15 | bs$(E): $(ncurses_testdir)/bs.c 16 | $(BUILD) $(NCFLAGS) -o $@ $< $(LDFLAGS) 17 | 18 | gdc$(E): $(ncurses_testdir)/gdc.c 19 | $(BUILD) $(NCFLAGS) -o $@ $< $(LDFLAGS) 20 | 21 | hanoi$(E): $(ncurses_testdir)/hanoi.c 22 | $(BUILD) $(NCFLAGS) -o $@ $< $(LDFLAGS) -lm 23 | 24 | knight$(E): $(ncurses_testdir)/knight.c 25 | $(BUILD) $(NCFLAGS) -o $@ $< $(LDFLAGS) 26 | 27 | tclock$(E): $(ncurses_testdir)/tclock.c 28 | $(BUILD) $(NCFLAGS) -o $@ $< $(LDFLAGS) -lm 29 | 30 | lrtest$(E): $(ncurses_testdir)/lrtest.c 31 | $(BUILD) $(NCFLAGS) -o $@ $< $(LDFLAGS) 32 | 33 | ncurses$(E): $(ncurses_testdir)/ncurses.c 34 | $(BUILD) $(NCFLAGS) -o $@ $< $(LDFLAGS) 35 | -------------------------------------------------------------------------------- /lib/common/pdcurses.rc: -------------------------------------------------------------------------------- 1 | #include 2 | #include "../curses.h" 3 | 4 | VS_VERSION_INFO VERSIONINFO 5 | FILEVERSION PDC_VER_MAJOR,PDC_VER_MINOR,0,0 6 | PRODUCTVERSION PDC_VER_MAJOR,PDC_VER_MINOR,0,0 7 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 8 | #ifdef _DEBUG 9 | FILEFLAGS VS_FF_DEBUG | VS_FF_PRERELEASE 10 | #else 11 | FILEFLAGS 0 12 | #endif 13 | FILEOS VOS_NT_WINDOWS32 14 | FILETYPE VFT_DLL 15 | FILESUBTYPE VFT2_UNKNOWN 16 | BEGIN 17 | BLOCK "StringFileInfo" 18 | BEGIN 19 | BLOCK "04090000" 20 | BEGIN 21 | VALUE "CompanyName", "PDCurses.org" 22 | VALUE "FileDescription", "PDCurses Library" 23 | VALUE "FileVersion", PDC_VERDOT ".0.0" 24 | VALUE "InternalName", "PDCurses" 25 | VALUE "LegalCopyright", "Public Domain" 26 | VALUE "OriginalFilename", "pdcurses.dll" 27 | VALUE "ProductName", "PDCurses" 28 | VALUE "ProductVersion", PDC_VERDOT ".0.0" 29 | END 30 | END 31 | BLOCK "VarFileInfo" 32 | BEGIN 33 | VALUE "Translation", 0x409, 0 34 | END 35 | END 36 | -------------------------------------------------------------------------------- /haxe/ui/backend/pdcurses/_module/styles/default/checkboxes.css: -------------------------------------------------------------------------------- 1 | .checkbox { 2 | spacing: 1px; 3 | color: #000080; 4 | } 5 | 6 | .checkbox:hover { 7 | color: #0000FF; 8 | } 9 | 10 | .checkbox-value { 11 | width: 3px; 12 | height: 1px; 13 | background-color: none; 14 | border: 1px square-brackets #000088; 15 | filter: none; 16 | icon: none; 17 | color: #0000FF; 18 | } 19 | 20 | .checkbox:hover .checkbox-value { 21 | border-color: #0000FF; 22 | } 23 | 24 | .checkbox-value:selected { 25 | background-image: 'X'; 26 | } 27 | 28 | .optionbox { 29 | spacing: 1px; 30 | color: #000080; 31 | } 32 | 33 | .optionbox:hover { 34 | color: #0000FF; 35 | } 36 | 37 | .optionbox-value { 38 | width: 3px; 39 | height: 1px; 40 | background-color: none; 41 | border: 1px round-brackets #000088; 42 | filter: none; 43 | icon: none; 44 | color: #0000FF; 45 | } 46 | 47 | .optionbox:hover .optionbox-value { 48 | border-color: #0000FF; 49 | } 50 | 51 | .optionbox-value:selected { 52 | background-image: 'DIAMOND'; 53 | } 54 | 55 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Ian Harrigan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /lib/common/libobjs.mif: -------------------------------------------------------------------------------- 1 | # Common elements for most of the DOS, OS/2 and Windows 2 | # makefiles (not Watcom) 3 | 4 | PDCURSES_CURSES_H = $(PDCURSES_SRCDIR)/curses.h 5 | PDCURSES_CURSPRIV_H = $(PDCURSES_SRCDIR)/curspriv.h 6 | PDCURSES_HEADERS = $(PDCURSES_CURSES_H) $(PDCURSES_CURSPRIV_H) 7 | PANEL_HEADER = $(PDCURSES_SRCDIR)/panel.h 8 | 9 | srcdir = $(PDCURSES_SRCDIR)/pdcurses 10 | demodir = $(PDCURSES_SRCDIR)/demos 11 | 12 | LIBOBJS = addch.$(O) addchstr.$(O) addstr.$(O) attr.$(O) beep.$(O) \ 13 | bkgd.$(O) border.$(O) clear.$(O) color.$(O) delch.$(O) deleteln.$(O) \ 14 | getch.$(O) getstr.$(O) getyx.$(O) inch.$(O) inchstr.$(O) \ 15 | initscr.$(O) inopts.$(O) insch.$(O) insstr.$(O) instr.$(O) kernel.$(O) \ 16 | keyname.$(O) mouse.$(O) move.$(O) outopts.$(O) overlay.$(O) pad.$(O) \ 17 | panel.$(O) printw.$(O) refresh.$(O) scanw.$(O) scr_dump.$(O) scroll.$(O) \ 18 | slk.$(O) termattr.$(O) touch.$(O) util.$(O) window.$(O) debug.$(O) 19 | 20 | PDCOBJS = pdcclip.$(O) pdcdisp.$(O) pdcgetsc.$(O) pdckbd.$(O) pdcscrn.$(O) \ 21 | pdcsetsc.$(O) pdcutil.$(O) 22 | 23 | DEMOS = testcurs$(E) ozdemo$(E) xmas$(E) tuidemo$(E) firework$(E) \ 24 | ptest$(E) rain$(E) worm$(E) 25 | -------------------------------------------------------------------------------- /haxe/ui/backend/pdcurses/_module/styles/default/tableviews.css: -------------------------------------------------------------------------------- 1 | .tableview { 2 | background-color: none; 3 | __padding-top: 2px; 4 | __border-top: 1px solid #000088; 5 | __padding-top: 2px; 6 | border: 1px tableview #000088; 7 | } 8 | 9 | .tableview .tableview-contents { 10 | spacing: 0; 11 | width: 100%; 12 | padding: 1px; 13 | padding-top: 0; 14 | padding-bottom: 0px; 15 | } 16 | 17 | .tableview .even { 18 | background-color: none; 19 | cursor: pointer; 20 | } 21 | 22 | .tableview .odd { 23 | background-color: none; 24 | cursor: pointer; 25 | } 26 | 27 | .tableview .compounditemrenderer .itemrenderer { 28 | height: auto; 29 | padding: 0px; 30 | } 31 | 32 | .tableview .compounditemrenderer .label { 33 | color: black; 34 | } 35 | 36 | .tableview .compounditemrenderer:selected { 37 | background-color: #0000FF; 38 | color: white; 39 | } 40 | 41 | .tableview .compounditemrenderer:selected .label { 42 | color: white; 43 | } 44 | 45 | .header { 46 | spacing: 0; 47 | __margin-top: -1px; 48 | } 49 | 50 | .header .button { 51 | filter: none; 52 | __border-top: 1px solid red; 53 | } -------------------------------------------------------------------------------- /lib/os2/pdcgetsc.c: -------------------------------------------------------------------------------- 1 | /* PDCurses */ 2 | 3 | #include "pdcos2.h" 4 | 5 | /* return width of screen/viewport */ 6 | 7 | int PDC_get_columns(void) 8 | { 9 | VIOMODEINFO modeInfo = {0}; 10 | int cols = 0; 11 | 12 | PDC_LOG(("PDC_get_columns() - called\n")); 13 | 14 | modeInfo.cb = sizeof(modeInfo); 15 | VioGetMode(&modeInfo, 0); 16 | cols = modeInfo.col; 17 | 18 | PDC_LOG(("PDC_get_columns() - returned: cols %d\n", cols)); 19 | 20 | return cols; 21 | } 22 | 23 | /* get the cursor size/shape */ 24 | 25 | int PDC_get_cursor_mode(void) 26 | { 27 | VIOCURSORINFO cursorInfo; 28 | 29 | PDC_LOG(("PDC_get_cursor_mode() - called\n")); 30 | 31 | VioGetCurType (&cursorInfo, 0); 32 | 33 | return (cursorInfo.yStart << 8) | cursorInfo.cEnd; 34 | } 35 | 36 | /* return number of screen rows */ 37 | 38 | int PDC_get_rows(void) 39 | { 40 | VIOMODEINFO modeInfo = {0}; 41 | int rows = 0; 42 | 43 | PDC_LOG(("PDC_get_rows() - called\n")); 44 | 45 | modeInfo.cb = sizeof(modeInfo); 46 | VioGetMode(&modeInfo, 0); 47 | rows = modeInfo.row; 48 | 49 | PDC_LOG(("PDC_get_rows() - returned: rows %d\n", rows)); 50 | 51 | return rows; 52 | } 53 | -------------------------------------------------------------------------------- /haxe/ui/backend/AppImpl.hx: -------------------------------------------------------------------------------- 1 | package haxe.ui.backend; 2 | 3 | import haxe.ui.backend.pdcurses.CursesApp; 4 | import haxe.ui.backend.pdcurses.lib.Curses; 5 | 6 | @:buildXml('') 7 | class AppImpl extends AppBase { 8 | 9 | private var _cursesApp:CursesApp; 10 | 11 | public function new() { 12 | _cursesApp = new CursesApp(); 13 | } 14 | 15 | private override function init(onReady:Void->Void, onEnd:Void->Void = null) { 16 | var title:String = Toolkit.backendProperties.getProp("haxe.ui.pdcurses.title", null); 17 | if (title != null) { 18 | Curses.PDC_set_title(title); 19 | } 20 | _cursesApp.init(); 21 | onReady(); 22 | } 23 | 24 | private override function getToolkitInit():ToolkitOptions { 25 | return { 26 | app: _cursesApp 27 | }; 28 | } 29 | 30 | public override function start() { 31 | _cursesApp.start(); 32 | } 33 | 34 | public function trace(s:String) { 35 | _cursesApp.addLog(s); 36 | } 37 | 38 | public override function exit() { 39 | _cursesApp.exit = true; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /haxe/ui/backend/pdcurses/_module/styles/default/listviews.css: -------------------------------------------------------------------------------- 1 | .listview { 2 | background-color: none; 3 | } 4 | 5 | .listview .itemrenderer { 6 | height: auto; 7 | padding: 0px; 8 | background-color: none; 9 | __padding-right: 1px; 10 | } 11 | 12 | .listview .itemrenderer .label { 13 | background-color: none; 14 | } 15 | 16 | .listview .even .label { 17 | } 18 | 19 | .listview .odd .label { 20 | } 21 | 22 | .listview .itemrenderer:selected { 23 | color: #ffffff; 24 | background-color: #000088; 25 | } 26 | 27 | .listview .itemrenderer:selected .basic-renderer-label { 28 | color: #ffffff; 29 | background-color: #000088; 30 | } 31 | 32 | 33 | 34 | 35 | 36 | 37 | .listview .listview-contents { 38 | spacing: 0; 39 | padding-left: 0px; 40 | __padding-right: -1px; 41 | } 42 | 43 | .listview .itemrenderer { 44 | ____padding-right: 2px; 45 | } 46 | 47 | .listview .itemrenderer:selected { 48 | color: #ffffff; 49 | background-color: #0000ff; 50 | } 51 | 52 | .listview .itemrenderer:selected .basic-renderer-label { 53 | color: #ffffff; 54 | background-color: #0000ff; 55 | } 56 | 57 | .listview .button { 58 | filter: none; 59 | } 60 | 61 | -------------------------------------------------------------------------------- /lib/docs/README.md: -------------------------------------------------------------------------------- 1 | PDCurses Documentation 2 | ====================== 3 | 4 | The main documentation for PDCurses is here: 5 | 6 | - [User's Guide] - Basic overview 7 | - [Implementor's Guide] - What you need to know to port PDCurses 8 | - [Manual] - Each function, etc. 9 | - [History] 10 | 11 | Also consult the README for each specific platform you'll be using: 12 | 13 | - [DOS] 14 | - [OS/2] 15 | - [SDL 1.x] 16 | - [SDL 2.x] 17 | - [Windows] 18 | - [X11] 19 | 20 | This directory also contains the files, CNAME and index.html, that 21 | create pdcurses.org, via GitHub. 22 | 23 | 24 | Building 25 | -------- 26 | 27 | - To rebuild MANUAL.md from the "man page" sections of the source code, 28 | type "./mkman.sh". Needs a Unix-like shell and a Python interpreter. 29 | 30 | 31 | Distribution Status 32 | ------------------- 33 | 34 | The files in this directory are released to the public domain. 35 | 36 | [User's Guide]: USERS.md 37 | [Implementor's Guide]: IMPLEMNT.md 38 | [Manual]: MANUAL.md 39 | [History]: HISTORY.md 40 | [DOS]: ../dos/README.md 41 | [OS/2]: ../os2/README.md 42 | [SDL 1.x]: ../sdl1/README.md 43 | [SDL 2.x]: ../sdl2/README.md 44 | [Windows]: ../wincon/README.md 45 | [X11]: ../x11/README.md 46 | -------------------------------------------------------------------------------- /haxe/ui/backend/TimerImpl.hx: -------------------------------------------------------------------------------- 1 | package haxe.ui.backend; 2 | 3 | class TimerImpl { 4 | static private var __timers:Array = []; 5 | 6 | static public function update() { 7 | var currentTime:Float = Sys.time(); 8 | var count:Int = __timers.length; 9 | for (i in 0...count) { 10 | var timer:TimerImpl = __timers[i]; 11 | if (!timer._stopped && currentTime > timer._end) { 12 | timer._end = currentTime + timer._delay; 13 | timer.callback(); 14 | } 15 | } 16 | 17 | while(--count >= 0) { 18 | var timer:TimerImpl = __timers[count]; 19 | if (timer._stopped) { 20 | __timers.remove(timer); 21 | } 22 | } 23 | } 24 | 25 | public var callback:Void->Void; 26 | private var _end:Float; 27 | private var _delay:Float; 28 | private var _stopped:Bool; 29 | 30 | public function new(delay:Int, callback:Void->Void) { 31 | this.callback = callback; 32 | _delay = delay / 1000; 33 | _end = Sys.time() + _delay; 34 | __timers.push(this); 35 | } 36 | 37 | public function stop() { 38 | _stopped = true; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /lib/common/acsuni.h: -------------------------------------------------------------------------------- 1 | /* ACS Unicode mapping */ 2 | 3 | chtype acs_map[128] = 4 | { 5 | PDC_ACS(0), PDC_ACS(1), PDC_ACS(2), PDC_ACS(3), PDC_ACS(4), 6 | PDC_ACS(5), PDC_ACS(6), PDC_ACS(7), PDC_ACS(8), PDC_ACS(9), 7 | PDC_ACS(10), PDC_ACS(11), PDC_ACS(12), PDC_ACS(13), PDC_ACS(14), 8 | PDC_ACS(15), PDC_ACS(16), PDC_ACS(17), PDC_ACS(18), PDC_ACS(19), 9 | PDC_ACS(20), PDC_ACS(21), PDC_ACS(22), PDC_ACS(23), PDC_ACS(24), 10 | PDC_ACS(25), PDC_ACS(26), PDC_ACS(27), PDC_ACS(28), PDC_ACS(29), 11 | PDC_ACS(30), PDC_ACS(31), ' ', '!', '"', '#', '$', '%', '&', '\'', 12 | '(', ')', '*', 13 | 14 | 0x2192, 0x2190, 0x2191, 0x2193, 15 | 16 | '/', 17 | 18 | 0x2588, 19 | 20 | '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', 21 | '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 22 | 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 23 | 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', 24 | 25 | 0x2666, 0x2592, 26 | 27 | 'b', 'c', 'd', 'e', 28 | 29 | 0x00b0, 0x00b1, 0x2591, 0x00a4, 0x2518, 0x2510, 0x250c, 0x2514, 30 | 0x253c, 0x23ba, 0x23bb, 0x2500, 0x23bc, 0x23bd, 0x251c, 0x2524, 31 | 0x2534, 0x252c, 0x2502, 0x2264, 0x2265, 0x03c0, 0x2260, 0x00a3, 32 | 0x00b7, 33 | 34 | PDC_ACS(127) 35 | }; 36 | -------------------------------------------------------------------------------- /haxe/ui/backend/AssetsImpl.hx: -------------------------------------------------------------------------------- 1 | package haxe.ui.backend; 2 | import haxe.Resource; 3 | import haxe.ui.assets.ImageInfo; 4 | import haxe.ui.backend.pdcurses.Image; 5 | import haxe.ui.backend.pdcurses.ppm.PPMImage; 6 | 7 | class AssetsImpl extends AssetsBase { 8 | private override function getImageInternal(resourceId:String, callback:ImageInfo->Void) { 9 | if (Resource.getString(resourceId) != null) { 10 | var ppm = PPMImage.fromString(Resource.getString(resourceId)); 11 | callback({ 12 | data: ppm, 13 | width: ppm.width, 14 | height: ppm.height 15 | }); 16 | return; 17 | } 18 | 19 | var ppm = PPMImage.fromChar(resourceId); 20 | if (ppm == null) { 21 | callback(null); 22 | } else { 23 | callback({ 24 | data: ppm, 25 | width: ppm.width, 26 | height: ppm.height 27 | }); 28 | } 29 | /* 30 | var char = Image.charFromString(resourceId); 31 | if (char == -1) { 32 | callback(null); 33 | } else { 34 | callback({ 35 | data: resourceId, 36 | width: 1, 37 | height: 1 38 | }); 39 | } 40 | */ 41 | } 42 | } -------------------------------------------------------------------------------- /lib/common/acsgr.h: -------------------------------------------------------------------------------- 1 | /* ACS Unicode mapping with punchouts for box characters et al. */ 2 | 3 | chtype acs_map[128] = 4 | { 5 | PDC_ACS(0), PDC_ACS(1), PDC_ACS(2), PDC_ACS(3), PDC_ACS(4), 6 | PDC_ACS(5), PDC_ACS(6), PDC_ACS(7), PDC_ACS(8), PDC_ACS(9), 7 | PDC_ACS(10), PDC_ACS(11), PDC_ACS(12), PDC_ACS(13), PDC_ACS(14), 8 | PDC_ACS(15), PDC_ACS(16), PDC_ACS(17), PDC_ACS(18), PDC_ACS(19), 9 | PDC_ACS(20), PDC_ACS(21), PDC_ACS(22), PDC_ACS(23), PDC_ACS(24), 10 | PDC_ACS(25), PDC_ACS(26), PDC_ACS(27), PDC_ACS(28), PDC_ACS(29), 11 | PDC_ACS(30), PDC_ACS(31), ' ', '!', '"', '#', '$', '%', '&', '\'', 12 | '(', ')', '*', 13 | 14 | 0x2192, 0x2190, 0x2191, 0x2193, 15 | 16 | '/', 17 | 18 | ACS_BLOCK, 19 | 20 | '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', 21 | '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 22 | 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 23 | 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', 24 | 25 | 0x2666, 0x2592, 26 | 27 | 'b', 'c', 'd', 'e', 28 | 29 | 0x00b0, 0x00b1, 0x2591, 0x00a4, ACS_LRCORNER, ACS_URCORNER, 30 | ACS_ULCORNER, ACS_LLCORNER, ACS_PLUS, ACS_S1, ACS_S3, ACS_HLINE, 31 | ACS_S7, ACS_S9, ACS_LTEE, ACS_RTEE, ACS_BTEE, ACS_TTEE, ACS_VLINE, 32 | 0x2264, 0x2265, 0x03c0, 0x2260, 0x00a3, 0x00b7, 33 | 34 | PDC_ACS(127) 35 | }; 36 | -------------------------------------------------------------------------------- /lib/common/acs437.h: -------------------------------------------------------------------------------- 1 | /* ACS definitions originally by jshumate@wrdis01.robins.af.mil -- these 2 | match code page 437 and compatible pages (CP850, CP852, etc.) */ 3 | 4 | chtype acs_map[128] = 5 | { 6 | PDC_ACS(0), PDC_ACS(1), PDC_ACS(2), PDC_ACS(3), PDC_ACS(4), 7 | PDC_ACS(5), PDC_ACS(6), PDC_ACS(7), PDC_ACS(8), PDC_ACS(9), 8 | PDC_ACS(10), PDC_ACS(11), PDC_ACS(12), PDC_ACS(13), PDC_ACS(14), 9 | PDC_ACS(15), PDC_ACS(16), PDC_ACS(17), PDC_ACS(18), PDC_ACS(19), 10 | PDC_ACS(20), PDC_ACS(21), PDC_ACS(22), PDC_ACS(23), PDC_ACS(24), 11 | PDC_ACS(25), PDC_ACS(26), PDC_ACS(27), PDC_ACS(28), PDC_ACS(29), 12 | PDC_ACS(30), PDC_ACS(31), ' ', '!', '"', '#', '$', '%', '&', '\'', 13 | '(', ')', '*', 14 | 15 | PDC_ACS(0x1a), PDC_ACS(0x1b), PDC_ACS(0x18), PDC_ACS(0x19), 16 | 17 | '/', 18 | 19 | 0xdb, 20 | 21 | '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', 22 | '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 23 | 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 24 | 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', 25 | 26 | PDC_ACS(0x04), 0xb1, 27 | 28 | 'b', 'c', 'd', 'e', 29 | 30 | 0xf8, 0xf1, 0xb0, PDC_ACS(0x0f), 0xd9, 0xbf, 0xda, 0xc0, 0xc5, 0x2d, 31 | 0x2d, 0xc4, 0x2d, 0x5f, 0xc3, 0xb4, 0xc1, 0xc2, 0xb3, 0xf3, 0xf2, 32 | 0xe3, 0xd8, 0x9c, 0xf9, 33 | 34 | PDC_ACS(127) 35 | }; 36 | -------------------------------------------------------------------------------- /haxe/ui/backend/pdcurses/Mouse.hx: -------------------------------------------------------------------------------- 1 | package haxe.ui.backend.pdcurses; 2 | 3 | class Mouse { 4 | public static inline var MOVE:String = "onmove"; 5 | public static inline var PRESSED:String = "onpressed"; 6 | public static inline var RELEASED:String = "onreleased"; 7 | public static inline var WHEEL_UP:String = "onwheelup"; 8 | public static inline var WHEEL_DOWN:String = "onwheeldown"; 9 | 10 | private static var _listeners:MapInt->Void>> = new MapInt->Void>>(); 11 | 12 | public static function listen(on:String, callback:Int->Int->Void) { 13 | var list = _listeners.get(on); 14 | if (list == null) { 15 | list = []; 16 | _listeners.set(on, list); 17 | } 18 | list.push(callback); 19 | } 20 | 21 | public static function unlisten(on:String, callback:Int->Int->Void) { 22 | var list = _listeners.get(on); 23 | if (list != null) { 24 | list.remove(callback); 25 | if (list.length == 0) { 26 | _listeners.remove(on); 27 | } 28 | } 29 | } 30 | 31 | public static function update(on:String, x:Int, y:Int) { 32 | var list = _listeners.get(on); 33 | if (list != null) { 34 | for (l in list) { 35 | l(x, y); 36 | } 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /lib/common/iconbmp.h: -------------------------------------------------------------------------------- 1 | /* The PDCurses logo as #include'able BMP (from icon32.xpm), 2 | for use by SDL. */ 3 | 4 | unsigned char iconbmp[] = 5 | { 6 | 0x42, 0x4d, 0xbe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 7 | 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 8 | 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 9 | 0x00, 0x80, 0x00, 0x00, 0x00, 0x13, 0x0b, 0x00, 0x00, 0x13, 0x0b, 10 | 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 11 | 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 12 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xce, 0x6f, 0x9c, 13 | 0xe7, 0xb5, 0xaf, 0x6b, 0x5b, 0xbd, 0xaf, 0xeb, 0xfb, 0xbd, 0xaf, 14 | 0x98, 0xe7, 0xbd, 0xaf, 0x7b, 0x5f, 0xb5, 0xa5, 0x6b, 0x5b, 0xcd, 15 | 0xab, 0x9c, 0xe7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 16 | 0xff, 0xcf, 0x03, 0xff, 0xff, 0xce, 0x03, 0xff, 0xff, 0xcc, 0x73, 17 | 0xff, 0xff, 0xcc, 0xf3, 0xff, 0xff, 0xcc, 0xf3, 0xff, 0xff, 0xcc, 18 | 0x73, 0xff, 0xff, 0xc6, 0x33, 0xff, 0xff, 0xc3, 0x13, 0xff, 0xff, 19 | 0xc1, 0x83, 0xff, 0xff, 0xc8, 0xc3, 0xff, 0xff, 0xcc, 0x63, 0xff, 20 | 0xff, 0xce, 0x33, 0xff, 0xff, 0xcf, 0x33, 0xff, 0xff, 0xcf, 0x33, 21 | 0xff, 0xff, 0xce, 0x33, 0xff, 0xff, 0xc0, 0x73, 0xff, 0xff, 0xc0, 22 | 0xf3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 23 | 0xff, 0xff, 0xff 24 | }; 25 | -------------------------------------------------------------------------------- /lib/sdl1/pdcsdl.h: -------------------------------------------------------------------------------- 1 | /* PDCurses */ 2 | 3 | #include 4 | #ifdef PDC_WIDE 5 | #include 6 | #endif 7 | 8 | #include 9 | 10 | #ifdef PDC_WIDE 11 | PDCEX TTF_Font *pdc_ttffont; 12 | PDCEX int pdc_font_size; 13 | #endif 14 | PDCEX SDL_Surface *pdc_screen, *pdc_font, *pdc_icon, *pdc_back; 15 | PDCEX int pdc_sheight, pdc_swidth, pdc_yoffset, pdc_xoffset; 16 | 17 | extern SDL_Surface *pdc_tileback; /* used to regenerate the background 18 | of "transparent" cells */ 19 | extern SDL_Color pdc_color[PDC_MAXCOL]; /* colors for font palette */ 20 | extern Uint32 pdc_mapped[PDC_MAXCOL]; /* colors for FillRect(), as 21 | used in _highlight() */ 22 | extern int pdc_fheight, pdc_fwidth; /* font height and width */ 23 | extern int pdc_fthick; /* thickness for highlights and 24 | rendered ACS glyphs */ 25 | extern int pdc_flastc; /* font palette's last color 26 | (treated as the foreground) */ 27 | extern bool pdc_own_screen; /* if pdc_screen was not set 28 | before initscr(), PDCurses is 29 | responsible for (owns) it */ 30 | 31 | PDCEX void PDC_update_rects(void); 32 | PDCEX void PDC_retile(void); 33 | 34 | extern void PDC_blink_text(void); 35 | -------------------------------------------------------------------------------- /lib/dos/README.md: -------------------------------------------------------------------------------- 1 | PDCurses for DOS 2 | ================ 3 | 4 | This directory contains PDCurses source code files specific to DOS. 5 | 6 | 7 | Building 8 | -------- 9 | 10 | - Choose the appropriate makefile for your compiler: 11 | 12 | Makefile - DJGPP 13 | Makefile.bcc - Borland C++ 14 | Makefile.wcc - Watcom 15 | 16 | - For 16-bit compilers, you can change the memory MODEL as a command- 17 | line option. (Large model is the default, and recommended.) With 18 | Watcom, specifying "MODEL=f" (flat) will automatically switch to a 19 | 32-bit build. 20 | 21 | - Optionally, you can build in a different directory than the platform 22 | directory by setting PDCURSES_SRCDIR to point to the directory where 23 | you unpacked PDCurses, and changing to your target directory: 24 | 25 | set PDCURSES_SRCDIR=c:\pdcurses 26 | 27 | - Build it: 28 | 29 | make -f makefile 30 | 31 | (For Watcom, use "wmake" instead of "make".) You'll get the library 32 | (pdcurses.lib or .a, depending on your compiler) and a lot of object 33 | files. Add the target "demos" to build the sample programs. 34 | 35 | 36 | Distribution Status 37 | ------------------- 38 | 39 | The files in this directory are released to the public domain. 40 | 41 | 42 | Acknowledgements 43 | ---------------- 44 | 45 | Watcom C port was provided by Pieter Kunst 46 | 47 | DJGPP port was provided by David Nugent 48 | -------------------------------------------------------------------------------- /haxe/ui/backend/pdcurses/_module/styles/default/tabs.css: -------------------------------------------------------------------------------- 1 | .tabbar { 2 | background-color: none; 3 | border-bottom: 1px thin-inverse #FFFFFF; 4 | } 5 | 6 | .tabbar:bottom { 7 | background-color: none; 8 | border-bottom: none; 9 | border-top: 1px thin-inverse #FFFFFF; 10 | } 11 | 12 | .tabbar > .tabbar-contents { 13 | spacing: 0; 14 | } 15 | 16 | .tabbar-button { 17 | background-color: #000088; 18 | border:1px thin #000088; 19 | filter: none; 20 | } 21 | 22 | .tabbar-button:hover { 23 | background-color: #0000FF; 24 | border: 1px thin #0000FF; 25 | filter: none; 26 | } 27 | 28 | .tabbar-button-selected { 29 | color: #000088; 30 | background-color: #FFFFFF; 31 | border-color: #FFFFFF; 32 | border-bottom: 1px thin #FFFFFF; 33 | } 34 | 35 | 36 | .tabview { 37 | padding-bottom: 1px; 38 | } 39 | 40 | .tabview > .tabview-tabs { 41 | margin-top: 0px; 42 | } 43 | 44 | .tabview > .tabview-content { 45 | margin-top: 0px; 46 | border: none; 47 | border-bottom: 1px thin #FFFFFF; 48 | filter: drop-shadow(.5, 1, #888888); 49 | padding-top: 0px; 50 | padding-left: 1px; 51 | padding-bottom: 1px; 52 | padding-right: 1px; 53 | } 54 | 55 | .tabview:bottom > .tabview-tabs { 56 | margin-top: 0px; 57 | } 58 | 59 | .tabview:bottom > .tabview-content { 60 | margin-top: 0px; 61 | border: none; 62 | border-top: 1px thin #FFFFFF; 63 | filter: drop-shadow(.5, 1, #888888); 64 | } 65 | -------------------------------------------------------------------------------- /lib/common/icon32.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char *icon32[] = { 3 | /* width height ncolors chars_per_pixel */ 4 | "32 32 3 1", 5 | /* colors */ 6 | " c #000", 7 | ". c #FFF", 8 | "X c None", 9 | /* pixels */ 10 | "................................", 11 | "................................", 12 | "................................", 13 | ".......... .... ..........", 14 | ".......... ... ..........", 15 | ".......... ... .. ..........", 16 | ".......... .... .. ..........", 17 | ".......... .... .. ..........", 18 | ".......... ... .. ..........", 19 | ".......... .. .. ..........", 20 | ".......... . .. ..........", 21 | ".......... .. ..........", 22 | ".......... .. . ..........", 23 | ".......... .. .. ..........", 24 | ".......... .. ... ..........", 25 | ".......... .. .... ..........", 26 | ".......... .. .... ..........", 27 | ".......... .. ... ..........", 28 | ".......... ... ..........", 29 | ".......... .... ..........", 30 | "................................", 31 | "................................", 32 | ".. .. .. . . ... ... ... ...", 33 | ". .. . .. . . . .. . .. . .. ..", 34 | ". .... .. . .... .... .. . .....", 35 | ". .... .. . ..... .. ... ...", 36 | ". .... .. . ....... . ....... ..", 37 | ". .. . .. . .... .. . .. . .. ..", 38 | ".. ... .. ..... ... ... ...", 39 | "................................", 40 | "................................", 41 | "................................" 42 | }; 43 | -------------------------------------------------------------------------------- /lib/sdl2/pdcsdl.h: -------------------------------------------------------------------------------- 1 | /* PDCurses */ 2 | 3 | #include 4 | #ifdef PDC_WIDE 5 | # include 6 | #endif 7 | 8 | #include 9 | 10 | #ifdef PDC_WIDE 11 | PDCEX TTF_Font *pdc_ttffont; 12 | PDCEX int pdc_font_size; 13 | #endif 14 | PDCEX SDL_Window *pdc_window; 15 | PDCEX SDL_Surface *pdc_screen, *pdc_font, *pdc_icon, *pdc_back; 16 | PDCEX int pdc_sheight, pdc_swidth, pdc_yoffset, pdc_xoffset; 17 | 18 | extern SDL_Surface *pdc_tileback; /* used to regenerate the background 19 | of "transparent" cells */ 20 | extern SDL_Color pdc_color[PDC_MAXCOL]; /* colors for font palette */ 21 | extern Uint32 pdc_mapped[PDC_MAXCOL]; /* colors for FillRect(), as 22 | used in _highlight() */ 23 | extern int pdc_fheight, pdc_fwidth; /* font height and width */ 24 | extern int pdc_fthick; /* thickness for highlights and 25 | rendered ACS glyphs */ 26 | extern int pdc_flastc; /* font palette's last color 27 | (treated as the foreground) */ 28 | extern bool pdc_own_window; /* if pdc_window was not set 29 | before initscr(), PDCurses is 30 | responsible for (owns) it */ 31 | 32 | PDCEX void PDC_update_rects(void); 33 | PDCEX void PDC_retile(void); 34 | 35 | extern void PDC_pump_and_peep(void); 36 | extern void PDC_blink_text(void); 37 | -------------------------------------------------------------------------------- /haxe/ui/backend/pdcurses/_module/styles/default/scrollviews.css: -------------------------------------------------------------------------------- 1 | .scrollview { 2 | border: 1px single #000088; 3 | background-color: none; 4 | padding-right: 1px; 5 | } 6 | 7 | .scrollview-contents { 8 | padding-left: 1px; 9 | padding-top: 0; 10 | padding-bottom: 0; 11 | padding-right: 0px; 12 | } 13 | 14 | .scrollview .horizontal-scroll { 15 | margin-top: 1px; 16 | margin-right: 1px; 17 | } 18 | 19 | .scrollview .vertical-scroll { 20 | margin-left: 2px; 21 | } 22 | 23 | .scrollview:active { 24 | border-color: #0000FF; 25 | } 26 | 27 | .scrollview:active .scroll { 28 | __background-color: #0000FF; 29 | color: #0000FF; 30 | __border-color: #0000FF; 31 | } 32 | 33 | .scrollview:active .scroll .thumb { 34 | background-color: #0000FF; 35 | __color: #0000FF; 36 | ___border-color: #0000FF; 37 | } 38 | 39 | /* 40 | 41 | .horizontal-scroll { 42 | height: 1px; 43 | border: none; 44 | padding: 0; 45 | 46 | 47 | filter: none; 48 | background-image: 'CKBOARD'; 49 | background-color: #FFFFFF; 50 | color: #000080; 51 | } 52 | 53 | .horizontal-scroll .thumb { 54 | background-color: red; 55 | filter: none; 56 | } 57 | 58 | .vertical-scroll .thumb { 59 | background-color: red; 60 | filter: none; 61 | } 62 | 63 | .vertical-scroll { 64 | width: 1px; 65 | border: none; 66 | padding: 0; 67 | 68 | 69 | filter: none; 70 | background-image: 'CKBOARD'; 71 | background-color: #FFFFFF; 72 | color: #000080; 73 | } 74 | */ -------------------------------------------------------------------------------- /lib/os2/Makefile.bcc: -------------------------------------------------------------------------------- 1 | # Borland Makefile for PDCurses - OS/2 2 | # 3 | # Usage: make -f [path\]Makefile.bcc [DEBUG=] [target] 4 | # 5 | # where target can be any of: 6 | # [all|demos|pdcurses.lib|testcurs.exe...] 7 | 8 | O = obj 9 | E = .exe 10 | RM = del 11 | 12 | !ifndef PDCURSES_SRCDIR 13 | PDCURSES_SRCDIR = .. 14 | !endif 15 | 16 | !include $(PDCURSES_SRCDIR)\common\libobjs.mif 17 | 18 | osdir = $(PDCURSES_SRCDIR)\os2 19 | 20 | CC = bcc 21 | 22 | !ifdef DEBUG 23 | CFLAGS = -N -v -y -DPDCDEBUG 24 | !else 25 | CFLAGS = -O 26 | !endif 27 | 28 | CPPFLAGS = -I$(PDCURSES_SRCDIR) 29 | 30 | BUILD = $(CC) -w-par -c $(CFLAGS) $(CPPFLAGS) 31 | 32 | LINK = tlink 33 | 34 | LIBEXE = tlib /C /E 35 | 36 | LIBCURSES = pdcurses.lib 37 | 38 | all: $(LIBCURSES) 39 | 40 | clean: 41 | -$(RM) *.obj 42 | -$(RM) *.lib 43 | -$(RM) *.map 44 | -$(RM) *.exe 45 | 46 | demos: $(LIBCURSES) $(DEMOS) 47 | 48 | $(LIBCURSES) : $(LIBOBJS) $(PDCOBJS) 49 | -$(RM) $@ 50 | $(LIBEXE) $@ @$(PDCURSES_SRCDIR)\common\borland.lrf 51 | 52 | .autodepend 53 | 54 | {$(srcdir)\}.c.obj: 55 | $(BUILD) $< 56 | 57 | {$(osdir)\}.c.obj: 58 | $(BUILD) $< 59 | 60 | {$(demodir)\}.c.obj: 61 | $(BUILD) $< 62 | 63 | .c.obj: 64 | $(BUILD) $< 65 | 66 | .obj.exe: 67 | $(CC) -e$@ $** $(LIBCURSES) 68 | 69 | tuidemo.exe: tuidemo.obj tui.obj $(LIBCURSES) 70 | $(CC) -e$@ $** 71 | 72 | tui.obj: $(demodir)\tui.c $(demodir)\tui.h $(PDCURSES_CURSES_H) 73 | $(BUILD) -I$(demodir) $(demodir)\tui.c 74 | 75 | tuidemo.obj: $(demodir)\tuidemo.c $(PDCURSES_CURSES_H) 76 | $(BUILD) -I$(demodir) $(demodir)\tuidemo.c 77 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Expected Behavior 4 | 5 | 6 | 7 | ## Current Behavior 8 | 9 | 10 | 11 | ## Possible Solution 12 | 13 | 14 | 15 | ## Steps to Reproduce (for bugs) 16 | 17 | 18 | 1. 19 | 2. 20 | 3. 21 | 4. 22 | 23 | ## Media 24 | 25 | 26 | ## Test app / minimal test case 27 | 28 | 29 | 30 | ## Context 31 | 32 | 33 | 34 | ## Your Environment 35 | 36 | * Version used: 37 | * Environment name and version (e.g. Chrome 39, node.js 5.4): 38 | * Operating System and version (desktop or mobile): 39 | * Link to your project: 40 | -------------------------------------------------------------------------------- /lib/dos/Makefile.bcc: -------------------------------------------------------------------------------- 1 | # Borland Makefile for PDCurses - DOS 2 | # 3 | # Usage: make -f [path\]Makefile.bcc [DEBUG=] [MODEL=c|h|l|m|s] [target] 4 | # 5 | # where target can be any of: 6 | # [all|demos|pdcurses.lib|testcurs.exe...] 7 | 8 | !ifndef MODEL 9 | MODEL = l 10 | !endif 11 | 12 | O = obj 13 | E = .exe 14 | RM = del 15 | 16 | !ifndef PDCURSES_SRCDIR 17 | PDCURSES_SRCDIR = .. 18 | !endif 19 | 20 | !include $(PDCURSES_SRCDIR)\common\libobjs.mif 21 | 22 | osdir = $(PDCURSES_SRCDIR)\dos 23 | 24 | !ifdef DEBUG 25 | CFLAGS = -N -v -y -DPDCDEBUG 26 | !else 27 | CFLAGS = -O 28 | !endif 29 | 30 | CPPFLAGS = -I$(PDCURSES_SRCDIR) 31 | 32 | BUILD = $(CC) -1- -G -d -w-par -c -m$(MODEL) $(CFLAGS) $(CPPFLAGS) 33 | 34 | LIBEXE = tlib /C /E 35 | 36 | LIBCURSES = pdcurses.lib 37 | 38 | all: $(LIBCURSES) 39 | 40 | clean: 41 | -$(RM) *.obj 42 | -$(RM) *.lib 43 | -$(RM) *.map 44 | -$(RM) *.exe 45 | 46 | demos: $(LIBCURSES) $(DEMOS) 47 | 48 | $(LIBCURSES) : $(LIBOBJS) $(PDCOBJS) 49 | -$(RM) $@ 50 | $(LIBEXE) $@ @$(PDCURSES_SRCDIR)\common\borland.lrf 51 | 52 | .autodepend 53 | 54 | {$(srcdir)\}.c.obj: 55 | $(BUILD) $< 56 | 57 | {$(osdir)\}.c.obj: 58 | $(BUILD) $< 59 | 60 | {$(demodir)\}.c.obj: 61 | $(BUILD) $< 62 | 63 | .c.obj: 64 | $(BUILD) $< 65 | 66 | .obj.exe: 67 | $(CC) -m$(MODEL) -e$@ $** $(LIBCURSES) 68 | 69 | tuidemo.exe: tuidemo.obj tui.obj $(LIBCURSES) 70 | $(CC) -m$(MODEL) -e$@ $** 71 | 72 | tui.obj: $(demodir)\tui.c $(demodir)\tui.h $(PDCURSES_CURSES_H) 73 | $(BUILD) -I$(demodir) $(demodir)\tui.c 74 | 75 | tuidemo.obj: $(demodir)\tuidemo.c $(PDCURSES_CURSES_H) 76 | $(BUILD) -I$(demodir) $(demodir)\tuidemo.c 77 | -------------------------------------------------------------------------------- /lib/panel.h: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------* 2 | * Panels for PDCurses * 3 | *----------------------------------------------------------------------*/ 4 | 5 | #ifndef __PDCURSES_PANEL_H__ 6 | #define __PDCURSES_PANEL_H__ 1 7 | 8 | #include 9 | 10 | #ifdef __cplusplus 11 | extern "C" 12 | { 13 | #endif 14 | 15 | typedef struct panelobs 16 | { 17 | struct panelobs *above; 18 | struct panel *pan; 19 | } PANELOBS; 20 | 21 | typedef struct panel 22 | { 23 | WINDOW *win; 24 | int wstarty; 25 | int wendy; 26 | int wstartx; 27 | int wendx; 28 | struct panel *below; 29 | struct panel *above; 30 | const void *user; 31 | struct panelobs *obscure; 32 | } PANEL; 33 | 34 | PDCEX int bottom_panel(PANEL *pan); 35 | PDCEX int del_panel(PANEL *pan); 36 | PDCEX int hide_panel(PANEL *pan); 37 | PDCEX int move_panel(PANEL *pan, int starty, int startx); 38 | PDCEX PANEL *new_panel(WINDOW *win); 39 | PDCEX PANEL *panel_above(const PANEL *pan); 40 | PDCEX PANEL *panel_below(const PANEL *pan); 41 | PDCEX int panel_hidden(const PANEL *pan); 42 | PDCEX const void *panel_userptr(const PANEL *pan); 43 | PDCEX WINDOW *panel_window(const PANEL *pan); 44 | PDCEX int replace_panel(PANEL *pan, WINDOW *win); 45 | PDCEX int set_panel_userptr(PANEL *pan, const void *uptr); 46 | PDCEX int show_panel(PANEL *pan); 47 | PDCEX int top_panel(PANEL *pan); 48 | PDCEX void update_panels(void); 49 | 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | 54 | #endif /* __PDCURSES_PANEL_H__ */ 55 | -------------------------------------------------------------------------------- /lib/dos/pdcgetsc.c: -------------------------------------------------------------------------------- 1 | /* PDCurses */ 2 | 3 | #include "pdcdos.h" 4 | 5 | #include 6 | 7 | /* return width of screen/viewport */ 8 | 9 | int PDC_get_columns(void) 10 | { 11 | PDCREGS regs; 12 | int cols; 13 | 14 | PDC_LOG(("PDC_get_columns() - called\n")); 15 | 16 | regs.h.ah = 0x0f; 17 | PDCINT(0x10, regs); 18 | cols = (int)regs.h.ah; 19 | 20 | PDC_LOG(("PDC_get_columns() - returned: cols %d\n", cols)); 21 | 22 | return cols; 23 | } 24 | 25 | /* get the cursor size/shape */ 26 | 27 | int PDC_get_cursor_mode(void) 28 | { 29 | PDC_LOG(("PDC_get_cursor_mode() - called\n")); 30 | 31 | return getdosmemword(0x460); 32 | } 33 | 34 | /* return number of screen rows */ 35 | 36 | int PDC_get_rows(void) 37 | { 38 | int rows; 39 | 40 | PDC_LOG(("PDC_get_rows() - called\n")); 41 | 42 | rows = getdosmembyte(0x484) + 1; 43 | 44 | if (rows == 1 && pdc_adapter == _MDS_GENIUS) 45 | rows = 66; 46 | if (rows == 1 && pdc_adapter == _MDA) 47 | rows = 25; 48 | 49 | if (rows == 1) 50 | { 51 | rows = 25; 52 | pdc_direct_video = FALSE; 53 | } 54 | 55 | switch (pdc_adapter) 56 | { 57 | case _EGACOLOR: 58 | case _EGAMONO: 59 | switch (rows) 60 | { 61 | case 25: 62 | case 43: 63 | break; 64 | default: 65 | rows = 25; 66 | } 67 | break; 68 | 69 | case _VGACOLOR: 70 | case _VGAMONO: 71 | break; 72 | 73 | default: 74 | rows = 25; 75 | break; 76 | } 77 | 78 | PDC_LOG(("PDC_get_rows() - returned: rows %d\n", rows)); 79 | 80 | return rows; 81 | } 82 | -------------------------------------------------------------------------------- /haxe/ui/backend/pdcurses/Keyboard.hx: -------------------------------------------------------------------------------- 1 | package haxe.ui.backend.pdcurses; 2 | 3 | import haxe.ui.backend.pdcurses.lib.Curses.*; 4 | import haxe.ui.backend.pdcurses.lib.Keys.*; 5 | 6 | class Keyboard { 7 | public static inline var PRESSED:String = "onpressed"; 8 | 9 | private static var _listeners:MapBool->Void>> = new MapBool->Void>>(); 10 | 11 | public static function listen(on:String, callback:Int->Bool->Void) { 12 | var list = _listeners.get(on); 13 | if (list == null) { 14 | list = []; 15 | _listeners.set(on, list); 16 | } 17 | list.push(callback); 18 | } 19 | 20 | public static function unlisten(on:String, callback:Int->Bool->Void) { 21 | var list = _listeners.get(on); 22 | if (list != null) { 23 | list.remove(callback); 24 | if (list.length == 0) { 25 | _listeners.remove(on); 26 | } 27 | } 28 | } 29 | 30 | public static function update(key:Int) { 31 | if (key != -1 && key != KEY_MOUSE) { 32 | var m = PDC_get_key_modifiers(); 33 | var shift = false; 34 | if (m != PDC_BUTTON_SHIFT) { 35 | shift = true; 36 | } 37 | if (shift == true) { 38 | if (key == KEY_BTAB) { 39 | key = KEY_TAB; 40 | } 41 | } 42 | var list = _listeners.get(PRESSED); 43 | if (list != null) { 44 | for (l in list) { 45 | l(key, shift); 46 | } 47 | } 48 | } 49 | } 50 | } -------------------------------------------------------------------------------- /lib/pdcurses/beep.c: -------------------------------------------------------------------------------- 1 | /* PDCurses */ 2 | 3 | #include 4 | 5 | /*man-start************************************************************** 6 | 7 | beep 8 | ---- 9 | 10 | ### Synopsis 11 | 12 | int beep(void); 13 | int flash(void); 14 | 15 | ### Description 16 | 17 | beep() sounds the audible bell on the terminal, if possible; if not, 18 | it calls flash(). 19 | 20 | flash() "flashes" the screen, by inverting the foreground and 21 | background of every cell, pausing, and then restoring the original 22 | attributes. 23 | 24 | ### Return Value 25 | 26 | These functions return ERR if called before initscr(), otherwise OK. 27 | 28 | ### Portability 29 | X/Open ncurses NetBSD 30 | beep Y Y Y 31 | flash Y Y Y 32 | 33 | **man-end****************************************************************/ 34 | 35 | int beep(void) 36 | { 37 | PDC_LOG(("beep() - called\n")); 38 | 39 | if (!SP) 40 | return ERR; 41 | 42 | if (SP->audible) 43 | PDC_beep(); 44 | else 45 | flash(); 46 | 47 | return OK; 48 | } 49 | 50 | int flash(void) 51 | { 52 | int z, y, x; 53 | 54 | PDC_LOG(("flash() - called\n")); 55 | 56 | if (!curscr) 57 | return ERR; 58 | 59 | /* Reverse each cell; wait; restore the screen */ 60 | 61 | for (z = 0; z < 2; z++) 62 | { 63 | for (y = 0; y < LINES; y++) 64 | for (x = 0; x < COLS; x++) 65 | curscr->_y[y][x] ^= A_REVERSE; 66 | 67 | wrefresh(curscr); 68 | 69 | if (!z) 70 | napms(50); 71 | } 72 | 73 | return OK; 74 | } 75 | -------------------------------------------------------------------------------- /haxe/ui/backend/pdcurses/_module/styles/default/dropdowns.css: -------------------------------------------------------------------------------- 1 | .dropdown { 2 | __border: 1px outset; 3 | icon: 'DARROW'; 4 | __filter: none; 5 | } 6 | 7 | .dropdown:down { 8 | __border: 1px outset; 9 | icon: 'UARROW' 10 | } 11 | 12 | .dropdown .image { 13 | background-color: none; 14 | color: white; 15 | border: none; 16 | } 17 | 18 | .dropdown-popup { 19 | __border: 1px dropdownpopup; 20 | __padding: 1px; 21 | __background-color: none; 22 | } 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | .dropdown { 43 | __border: 1px thin #000080; 44 | spacing: 2px; 45 | } 46 | 47 | .dropdown:down { 48 | background-color: #0000FF; 49 | border-color: #0000FF; 50 | } 51 | 52 | .dropdown-popup { 53 | background-color: #C0C0C0; 54 | filter: none; 55 | border: none; 56 | __padding: 1px; 57 | padding-left: 1px; 58 | padding-top: 1px; 59 | padding-right: 1px; 60 | padding-bottom: 1px; 61 | border-top: 1px thin #000080; 62 | border-bottom: 1px thin #000080; 63 | filter: drop-shadow(.5, 1, #888888); 64 | 65 | background-color: #000080; 66 | } 67 | 68 | .dropdown-popup .listview { 69 | padding: 0; 70 | border: none; 71 | __background-color: #C0C0C0; 72 | } 73 | 74 | .dropdown-popup .listview .listview-contents { 75 | __padding: 1px; 76 | } 77 | 78 | .dropdown-popup .listview .label { 79 | color: white; 80 | } 81 | 82 | .dropdown-popup .listview .vertical-scroll { 83 | margin-left: 0; 84 | color: white; 85 | } 86 | 87 | .dropdown-popup .listview .vertical-scroll .thumb { 88 | color: white; 89 | background-color: white; 90 | } 91 | -------------------------------------------------------------------------------- /lib/demos/ncurses_cfg.h: -------------------------------------------------------------------------------- 1 | /* This file is only used with the ncurses test programs. 2 | * 3 | * Have ncurses-6.1 unpacked in your $(HOME) (you don't need to build 4 | * it), or edit ncurses_testdir appropriately in the Makefile or 5 | * nctests.mif. Configure and build PDCurses, and: 6 | * 7 | * "make ncurses_tests" to start. 8 | * "make ncurses_clean" when you're done. 9 | * 10 | * Builds: bs gdc hanoi knight tclock ncurses 11 | */ 12 | 13 | #define PDC_NCMOUSE 14 | #define DATA_DIR "." 15 | #define NCURSES_CONST 16 | #define NCURSES_EXPORT(foo) foo 17 | #define popup_msg(bar, baz) 18 | 19 | #define RETSIGTYPE void 20 | #define TIME_WITH_SYS_TIME 1 21 | #define HAVE_SYS_TIME_H 1 22 | #define HAVE_SYS_TIME_SELECT 1 23 | #define HAVE_UNISTD_H 1 24 | #define HAVE_TERMATTRS 1 25 | 26 | #include 27 | 28 | #define ExitProgram exit 29 | 30 | #define HAVE_ASSUME_DEFAULT_COLORS 1 31 | #define HAVE_CURSES_VERSION 1 32 | #define HAVE_GETBEGX 1 33 | #define HAVE_GETCURX 1 34 | #define HAVE_GETMAXX 1 35 | #define HAVE_GETNSTR 1 36 | #define HAVE_GETTIMEOFDAY 1 37 | #define HAVE_GETWIN 1 38 | #define HAVE_HALFDELAY 1 39 | #define HAVE_LIBPANEL 1 40 | #define HAVE_LOCALE_H 1 41 | #define HAVE_MATH_H 1 42 | #define HAVE_NAPMS 1 43 | #define HAVE_NEWPAD 1 44 | #define HAVE_PANEL_H 1 45 | #define HAVE_PUTWIN 1 46 | #define HAVE_SLK_COLOR 1 47 | #define HAVE_SLK_INIT 1 48 | #define HAVE_USE_DEFAULT_COLORS 1 49 | #define HAVE_WRESIZE 1 50 | 51 | #ifdef PDC_WIDE 52 | # define USE_WIDEC_SUPPORT 1 53 | # define HAVE_WCSRTOMBS 1 54 | # define HAVE_MBSRTOWCS 1 55 | # define HAVE_MBRTOWC 1 56 | # define HAVE_MBRLEN 1 57 | #endif 58 | 59 | /* Fool ncurses.c so it gives us all the tests, and doesn't redefine 60 | ACS_ chars 61 | */ 62 | 63 | #define NCURSES_VERSION PDCURSES 64 | -------------------------------------------------------------------------------- /lib/README.md: -------------------------------------------------------------------------------- 1 | Welcome to PDCurses! 2 | ==================== 3 | 4 | PDCurses is an implementation of X/Open curses for multiple platforms. 5 | The latest version can be found at: 6 | 7 | https://pdcurses.org/ 8 | 9 | For changes, see the [History] file. The main documentation is now in 10 | the [docs] directory. 11 | 12 | 13 | Legal Stuff 14 | ----------- 15 | 16 | The core package is in the public domain, but small portions of PDCurses 17 | are subject to copyright under various licenses. Each directory 18 | contains a README.md file, with a section titled "Distribution Status" 19 | which describes the status of the files in that directory. 20 | 21 | If you use PDCurses in an application, an acknowledgement would be 22 | appreciated, but is not mandatory. If you make corrections or 23 | enhancements to PDCurses, please forward them to the current maintainer 24 | for the benefit of other users. 25 | 26 | This software is provided AS IS with NO WARRANTY whatsoever. 27 | 28 | 29 | Ports 30 | ----- 31 | 32 | PDCurses has been ported to DOS, OS/2, Windows, X11 and SDL. A directory 33 | containing the port-specific source files exists for each of these 34 | platforms. 35 | 36 | Build instructions are in the README.md file for each platform: 37 | 38 | - [DOS] 39 | - [OS/2] 40 | - [SDL 1.x] 41 | - [SDL 2.x] 42 | - [Windows] 43 | - [X11] 44 | 45 | 46 | Distribution Status 47 | ------------------- 48 | 49 | All files in this directory (not including subdirectories) are released 50 | to the public domain. 51 | 52 | 53 | Maintainer 54 | ---------- 55 | 56 | William McBrine 57 | 58 | [History]: docs/HISTORY.md 59 | [docs]: docs/README.md 60 | [DOS]: dos/README.md 61 | [OS/2]: os2/README.md 62 | [SDL 1.x]: sdl1/README.md 63 | [SDL 2.x]: sdl2/README.md 64 | [Windows]: wincon/README.md 65 | [X11]: x11/README.md 66 | -------------------------------------------------------------------------------- /lib/demos/tui.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 'textual user interface' 3 | * 4 | * Author : P.J. Kunst 5 | * Date : 1993-02-25 6 | */ 7 | 8 | #ifndef _TUI_H_ 9 | #define _TUI_H_ 10 | 11 | #include 12 | 13 | #ifdef A_COLOR 14 | #define A_ATTR (A_ATTRIBUTES ^ A_COLOR) /* A_BLINK, A_REVERSE, A_BOLD */ 15 | #else 16 | #define A_ATTR (A_ATTRIBUTES) /* standard UNIX attributes */ 17 | #endif 18 | 19 | #define MAXSTRLEN 256 20 | #define KEY_ESC 0x1b /* Escape */ 21 | 22 | typedef void (*FUNC)(void); 23 | 24 | typedef struct 25 | { 26 | char *name; /* item label */ 27 | FUNC func; /* (pointer to) function */ 28 | char *desc; /* function description */ 29 | } menu; 30 | 31 | /* ANSI C function prototypes: */ 32 | 33 | void clsbody(void); 34 | int bodylen(void); 35 | WINDOW *bodywin(void); 36 | 37 | void rmerror(void); 38 | void rmstatus(void); 39 | 40 | void titlemsg(char *msg); 41 | void bodymsg(char *msg); 42 | void errormsg(char *msg); 43 | void statusmsg(char *msg); 44 | 45 | bool keypressed(void); 46 | int getkey(void); 47 | int waitforkey(void); 48 | 49 | void DoExit(void); 50 | void startmenu(menu *mp, char *title); 51 | void domenu(menu *mp); 52 | 53 | int weditstr(WINDOW *win, char *buf, int field); 54 | WINDOW *winputbox(WINDOW *win, int nlines, int ncols); 55 | int getstrings(char *desc[], char *buf[], int field); 56 | 57 | #define editstr(s,f) (weditstr(stdscr,s,f)) 58 | #define mveditstr(y,x,s,f) (move(y,x)==ERR?ERR:editstr(s,f)) 59 | #define mvweditstr(w,y,x,s,f) (wmove(w,y,x)==ERR?ERR:weditstr(w,s,f)) 60 | 61 | #define inputbox(l,c) (winputbox(stdscr,l,c)) 62 | #define mvinputbox(y,x,l,c) (move(y,x)==ERR?w:inputbox(l,c)) 63 | #define mvwinputbox(w,y,x,l,c) (wmove(w,y,x)==ERR?w:winputbox(w,l,c)) 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /lib/dos/Makefile: -------------------------------------------------------------------------------- 1 | # GNU Makefile for PDCurses - DOS 2 | # 3 | # Usage: make [-f path\Makefile] [DEBUG=Y] [target] 4 | # 5 | # where target can be any of: 6 | # [all|libs|demos|pdcurses.a|testcurs.exe...] 7 | 8 | O = o 9 | E = .exe 10 | RM = del 11 | 12 | ifndef PDCURSES_SRCDIR 13 | PDCURSES_SRCDIR = .. 14 | endif 15 | 16 | include $(PDCURSES_SRCDIR)/common/libobjs.mif 17 | 18 | osdir = $(PDCURSES_SRCDIR)/dos 19 | 20 | PDCURSES_DOS_H = $(osdir)/pdcdos.h 21 | 22 | CC = gcc 23 | 24 | ifeq ($(DEBUG),Y) 25 | CFLAGS = -g -Wall -DPDCDEBUG 26 | LDFLAGS = -g 27 | else 28 | CFLAGS = -O2 -Wall 29 | LDFLAGS = 30 | endif 31 | 32 | CFLAGS += -I$(PDCURSES_SRCDIR) 33 | 34 | LINK = gcc 35 | 36 | LIBEXE = ar 37 | LIBFLAGS = rcv 38 | 39 | LIBCURSES = pdcurses.a 40 | 41 | .PHONY: all libs clean demos dist 42 | 43 | all: libs 44 | 45 | libs: $(LIBCURSES) 46 | 47 | clean: 48 | -$(RM) *.o 49 | -$(RM) *.a 50 | -$(RM) *.exe 51 | 52 | demos: $(DEMOS) 53 | ifneq ($(DEBUG),Y) 54 | strip *.exe 55 | endif 56 | 57 | $(LIBCURSES) : $(LIBOBJS) $(PDCOBJS) 58 | $(LIBEXE) $(LIBFLAGS) $@ $? 59 | 60 | $(LIBOBJS) $(PDCOBJS) : $(PDCURSES_HEADERS) 61 | $(PDCOBJS) : $(PDCURSES_DOS_H) 62 | $(DEMOS) : $(PDCURSES_CURSES_H) $(LIBCURSES) 63 | panel.o : $(PANEL_HEADER) 64 | 65 | $(LIBOBJS) : %.o: $(srcdir)/%.c 66 | $(CC) -c $(CFLAGS) $< 67 | 68 | $(PDCOBJS) : %.o: $(osdir)/%.c 69 | $(CC) -c $(CFLAGS) $< 70 | 71 | firework.exe ozdemo.exe rain.exe testcurs.exe worm.exe xmas.exe \ 72 | ptest.exe: %.exe: $(demodir)/%.c 73 | $(CC) $(CFLAGS) -o$@ $< $(LIBCURSES) 74 | 75 | tuidemo.exe: tuidemo.o tui.o 76 | $(LINK) $(LDFLAGS) -o$@ tuidemo.o tui.o $(LIBCURSES) 77 | 78 | tui.o: $(demodir)/tui.c $(demodir)/tui.h $(PDCURSES_CURSES_H) 79 | $(CC) -c $(CFLAGS) -I$(demodir) -o$@ $< 80 | 81 | tuidemo.o: $(demodir)/tuidemo.c $(PDCURSES_CURSES_H) 82 | $(CC) -c $(CFLAGS) -I$(demodir) -o$@ $< 83 | -------------------------------------------------------------------------------- /lib/wincon/Makefile.bcc: -------------------------------------------------------------------------------- 1 | # Borland Makefile for PDCurses - Windows console 2 | # 3 | # Usage: make -f [path\]Makefile.bcc [DEBUG=Y] [WIDE=Y] [UTF8=Y] 4 | # [INFOEX=N] [target] 5 | # 6 | # where target can be any of: 7 | # [all|demos|pdcurses.lib|testcurs.exe...] 8 | 9 | O = obj 10 | E = .exe 11 | RM = del 12 | 13 | !ifndef PDCURSES_SRCDIR 14 | PDCURSES_SRCDIR = .. 15 | !endif 16 | 17 | !include $(PDCURSES_SRCDIR)\common\libobjs.mif 18 | 19 | osdir = $(PDCURSES_SRCDIR)\wincon 20 | 21 | CC = bcc32c -q 22 | 23 | !ifdef DEBUG 24 | CFLAGS = -N -v -y -DPDCDEBUG 25 | !else 26 | CFLAGS = -O 27 | !endif 28 | 29 | !ifdef WIDE 30 | WIDEOPT = -DPDC_WIDE 31 | !endif 32 | 33 | !ifdef UTF8 34 | UTF8OPT = -DPDC_FORCE_UTF8 35 | !endif 36 | 37 | !ifdef INFOEX 38 | INFOPT = -DHAVE_NO_INFOEX 39 | !endif 40 | 41 | BUILD = $(CC) -I$(PDCURSES_SRCDIR) -c -Tpe $(CFLAGS) \ 42 | $(WIDEOPT) $(UTF8OPT) $(INFOPT) 43 | BUILD_OS = $(BUILD) -Xdriver -Wno-deprecated-declarations 44 | 45 | LIBEXE = tlib /C /E /0 /a 46 | 47 | LIBCURSES = pdcurses.lib 48 | 49 | all: $(LIBCURSES) 50 | 51 | clean: 52 | -$(RM) *.obj 53 | -$(RM) *.lib 54 | -$(RM) *.tds 55 | -$(RM) *.exe 56 | 57 | demos: $(LIBCURSES) $(DEMOS) 58 | 59 | $(LIBCURSES) : $(LIBOBJS) $(PDCOBJS) 60 | -$(RM) $@ 61 | $(LIBEXE) $@ $(LIBOBJS) $(PDCOBJS) 62 | 63 | .autodepend 64 | 65 | {$(srcdir)\}.c.obj: 66 | $(BUILD) $< 67 | 68 | {$(osdir)\}.c.obj: 69 | $(BUILD_OS) $< 70 | 71 | {$(demodir)\}.c.obj: 72 | $(BUILD) $< 73 | 74 | .c.obj: 75 | $(BUILD_OS) $< 76 | 77 | .obj.exe: 78 | $(CC) -e$@ $** $(LIBCURSES) 79 | 80 | tuidemo.exe: tuidemo.obj tui.obj $(LIBCURSES) 81 | $(CC) -e$@ $** 82 | 83 | tui.obj: $(demodir)\tui.c $(demodir)\tui.h $(PDCURSES_CURSES_H) 84 | $(BUILD) -I$(demodir) $(demodir)\tui.c 85 | 86 | tuidemo.obj: $(demodir)\tuidemo.c $(PDCURSES_CURSES_H) 87 | $(BUILD) -I$(demodir) $(demodir)\tuidemo.c 88 | -------------------------------------------------------------------------------- /lib/sdl1/sdltest.c: -------------------------------------------------------------------------------- 1 | /* Here's a simple example of combining SDL and PDCurses functionality. 2 | The top portion of the window is devoted to SDL, with a four-line 3 | (assuming the default 8x16 font) stdscr at the bottom. 4 | */ 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | /* You could #include pdcsdl.h, or just add the relevant declarations 12 | here: */ 13 | 14 | PDCEX SDL_Surface *pdc_screen; 15 | PDCEX int pdc_yoffset; 16 | 17 | int main(int argc, char **argv) 18 | { 19 | char inp[60]; 20 | int i, j, seed; 21 | 22 | seed = time((time_t *)0); 23 | srand(seed); 24 | 25 | /* Initialize SDL */ 26 | 27 | if (SDL_Init(SDL_INIT_VIDEO) < 0) 28 | exit(1); 29 | 30 | atexit(SDL_Quit); 31 | 32 | pdc_screen = SDL_SetVideoMode(640, 480, 0, SDL_SWSURFACE|SDL_ANYFORMAT); 33 | 34 | /* Initialize PDCurses */ 35 | 36 | pdc_yoffset = 416; /* 480 - 4 * 16 */ 37 | 38 | initscr(); 39 | start_color(); 40 | scrollok(stdscr, TRUE); 41 | 42 | PDC_set_title("PDCurses for SDL"); 43 | 44 | /* Do some SDL stuff */ 45 | 46 | for (i = 640, j = 416; j; i -= 2, j -= 2) 47 | { 48 | SDL_Rect dest; 49 | 50 | dest.x = (640 - i) / 2; 51 | dest.y = (416 - j) / 2; 52 | dest.w = i; 53 | dest.h = j; 54 | 55 | SDL_FillRect(pdc_screen, &dest, 56 | SDL_MapRGB(pdc_screen->format, rand() % 256, 57 | rand() % 256, rand() % 256)); 58 | } 59 | 60 | SDL_UpdateRect(pdc_screen, 0, 0, 640, 416); 61 | 62 | /* Do some curses stuff */ 63 | 64 | init_pair(1, COLOR_WHITE + 8, COLOR_BLUE); 65 | bkgd(COLOR_PAIR(1)); 66 | 67 | addstr("This is a demo of "); 68 | attron(A_UNDERLINE); 69 | addstr("PDCurses for SDL"); 70 | attroff(A_UNDERLINE); 71 | addstr(".\nYour comments here: "); 72 | getnstr(inp, 59); 73 | addstr("Press any key to exit."); 74 | 75 | getch(); 76 | endwin(); 77 | 78 | return 0; 79 | } 80 | -------------------------------------------------------------------------------- /lib/common/watcom.mif: -------------------------------------------------------------------------------- 1 | # Common elements for the Watcom makefiles 2 | 3 | CFLAGS += -wx -zq -i=$(PDCURSES_SRCDIR) 4 | 5 | !ifeq DEBUG Y 6 | CFLAGS += -d2 -DPDCDEBUG 7 | LDFLAGS = D W A op q sys $(TARGET) 8 | !else 9 | CFLAGS += -oneatx 10 | LDFLAGS = op q sys $(TARGET) 11 | !endif 12 | 13 | RM = del 14 | LIBEXE = wlib -q -n -b -c -t 15 | 16 | srcdir = $(PDCURSES_SRCDIR)/pdcurses 17 | demodir = $(PDCURSES_SRCDIR)/demos 18 | 19 | LIBOBJS = addch.obj addchstr.obj addstr.obj attr.obj beep.obj bkgd.obj & 20 | border.obj clear.obj color.obj delch.obj deleteln.obj & 21 | getch.obj getstr.obj getyx.obj inch.obj inchstr.obj initscr.obj inopts.obj & 22 | insch.obj insstr.obj instr.obj kernel.obj keyname.obj mouse.obj move.obj & 23 | outopts.obj overlay.obj pad.obj panel.obj printw.obj refresh.obj & 24 | scanw.obj scr_dump.obj scroll.obj slk.obj termattr.obj & 25 | touch.obj util.obj window.obj debug.obj 26 | 27 | PDCOBJS = pdcclip.obj pdcdisp.obj pdcgetsc.obj pdckbd.obj pdcscrn.obj & 28 | pdcsetsc.obj pdcutil.obj 29 | 30 | DEMOS = testcurs.exe ozdemo.exe xmas.exe tuidemo.exe firework.exe & 31 | ptest.exe rain.exe worm.exe 32 | 33 | LIBCURSES = pdcurses.lib 34 | 35 | LINK = wlink 36 | 37 | !ifdef __LOADDLL__ 38 | ! loaddll wcc wccd 39 | ! loaddll wcc386 wccd386 40 | ! loaddll wlink wlinkd 41 | ! loaddll wlib wlibd 42 | !endif 43 | 44 | all: $(LIBCURSES) 45 | 46 | clean 47 | -$(RM) *.obj 48 | -$(RM) *.lib 49 | -$(RM) *.exe 50 | -$(RM) *.err 51 | 52 | demos: $(DEMOS) 53 | 54 | .c: $(srcdir);$(osdir);$(demodir) 55 | .c.obj: .autodepend 56 | $(CC) $(CFLAGS) $< 57 | 58 | .obj.exe: 59 | $(LINK) $(LDFLAGS) n $@ f $*.obj l $(LIBCURSES) 60 | 61 | testcurs.exe: testcurs.obj $(LIBCURSES) 62 | ozdemo.exe: ozdemo.obj $(LIBCURSES) 63 | xmas.exe: xmas.obj $(LIBCURSES) 64 | firework.exe: firework.obj $(LIBCURSES) 65 | rain.exe: rain.obj $(LIBCURSES) 66 | worm.exe: worm.obj $(LIBCURSES) 67 | ptest.exe: ptest.obj $(LIBCURSES) 68 | 69 | tuidemo.exe: tuidemo.obj tui.obj $(LIBCURSES) 70 | $(LINK) $(LDFLAGS) n $@ f tuidemo.obj f tui.obj l $(LIBCURSES) 71 | 72 | dist: .symbolic 73 | -------------------------------------------------------------------------------- /lib/x11/scrlbox.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1989 O'Reilly and Associates, Inc. 3 | 4 | The X Consortium, and any party obtaining a copy of these files from 5 | the X Consortium, directly or indirectly, is granted, free of charge, a 6 | full and unrestricted irrevocable, world-wide, paid up, royalty-free, 7 | nonexclusive right and license to deal in this software and 8 | documentation files (the "Software"), including without limitation the 9 | rights to use, copy, modify, merge, publish, distribute, sublicense, 10 | and/or sell copies of the Software, and to permit persons who receive 11 | copies from any such party to do so. This license includes without 12 | limitation a license to do the foregoing actions under any patents of 13 | the party supplying this software to the X Consortium. 14 | */ 15 | 16 | #ifndef _XORAscrollBox_h 17 | #define _XORAscrollBox_h 18 | 19 | /* scrollBox Widget (subclass of CompositeClass) */ 20 | 21 | /* Parameters: 22 | 23 | Name Class RepType Default Value 24 | ---- ----- ------- ------------- 25 | background Background Pixel XtDefaultBackground 26 | border BorderColor Pixel XtDefaultForeground 27 | borderWidth BorderWidth Dimension 1 28 | destroyCallback Callback Pointer NULL 29 | hSpace HSpace Dimension 4 30 | height Height Dimension 0 31 | mappedWhenManaged MappedWhenManaged Boolean True 32 | vSpace VSpace Dimension 4 33 | width Width Dimension 0 34 | x Position Position 0 35 | y Position Position 0 36 | 37 | */ 38 | 39 | 40 | /* Class record constants */ 41 | 42 | extern WidgetClass scrollBoxWidgetClass; 43 | 44 | typedef struct _ScrollBoxClassRec *ScrollBoxWidgetClass; 45 | typedef struct _ScrollBoxRec *ScrollBoxWidget; 46 | 47 | #endif /* _XORAscrollBox_h */ 48 | -------------------------------------------------------------------------------- /haxe/ui/backend/module.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |