flat assembler
Message board for the users of flat assembler.
Index
> High Level Languages > Custom Multiple Document Interface and Visual Page Viewer |
Author |
|
soul_master 18 Sep 2023, 03:50
How to create a custom Multiple Document Interface (MDI). Written in pure C from scratch with no WinAPI/MFC/NET/etc. Easily portable to any system: Arduino, Android, RPI, ESP32.
Example: Multiple Document Viewer (MDV): https://github.com/starpow3r/mdv (Click "[<> Code]" > Download). See MULTIPLE_DOCUMENT_VIEWER.C for the program, and INCLUDE/DOCUMENT.H for the code. Requirements: Win95+. Resolution: HD 1920x1080x32. Compiler: TinyC. Setup: Just copy /TCC/ folder to C:/. Target: C:/TCC/TCC.EXE. Supports several document types: Text, Code, Binary, Image, Palette, Page. Initial beta release. Version -1. No links yet. No networking. Not quite an editor yet. No open or save. Not entirely functional. Here's how it works: INTERFACE is a dynamic ARRAY of DOCUMENTs which are files that are currently open with a name, tab, icon and close button. A DOCUMENT can be a TEXT_DOCUMENT, CODE_DOCUMENT, BINARY_DOCUMENT (as hexadecimal bytes), IMAGE_DOCUMENT, PALETTE_DOCUMENT, SOUL_DOCUMENT (PAGE), or any type. For each DOCUMENT type, there are functions that must be defined: open, draw, input and timer. It is upgradeable to support new file formats like .FONT, .SPRITE (animation, array of IMAGEs) and .ACTOR (array of SPRITE animations, a player with "actions" like walk, block, punch, kick). Code: DOCUMENT *open_document(text name); DOCUMENT *open_text_document(text name); DOCUMENT *open_code_document(text name); DOCUMENT *open_binary_document(text name); DOCUMENT *open_palette_document(text name); DOCUMENT *open_image_document(text name); DOCUMENT *open_soul_document(text name); int save_document(DOCUMENT *document, text as); int save_text_document(DOCUMENT *document, text as); int save_code_document(DOCUMENT *document, text as); int save_binary_document(DOCUMENT *document, text as); int save_palette_document(DOCUMENT *document, text as); int save_image_document(DOCUMENT *document, text as); int save_soul_document(DOCUMENT *document, text as); int draw_document(DOCUMENT *document); int draw_text_document(DOCUMENT *document); int draw_code_document(DOCUMENT *document); int draw_binary_document(DOCUMENT *document); int draw_palette_document(DOCUMENT *document); int draw_image_document(DOCUMENT *document); int draw_soul_document(DOCUMENT *document); int input_document(DOCUMENT *document); int input_text_document(DOCUMENT *document); int input_code_document(DOCUMENT *document); int input_binary_document(DOCUMENT *document); int input_palette_document(DOCUMENT *document); int input_image_document(DOCUMENT *document); int input_soul_document(DOCUMENT *document); int timer_document(DOCUMENT *document); int timer_text_document(DOCUMENT *document); int timer_code_document(DOCUMENT *document); int timer_binary_document(DOCUMENT *document); int timer_palette_document(DOCUMENT *document); int timer_image_document(DOCUMENT *document); int timer_soul_document(DOCUMENT *document); Soulscript. My custom PAGE script. Easy alternative to HTML/CSS. See INCLUDE/PAGE/PAGE.H. Code: ; Soulscript example <t>Example:<> <code> puts("Hello"); <> PAGE is a visual document, an ARRAY of ELEMENTs (text, code, images). See INCLUDE/PAGE/SCRIPT.H for load_page(PAGE *page, text name). Advantages of PAGE: Easiest, clearest, fastest, portable, efficient, modular, customizable, ultra lightweight compared to HTML/CSS, low memory usage, no browser required (PAGE.H is the browser), and raster fonts with real outline (not in HTML/CSS). Designed for tutorials, examples and help files. Disadvantages: Beta. Limited. No links or jumps within pages. No error checking. It expects code to be written perfectly, or it may crash instantly.
|
||||||||||
18 Sep 2023, 03:50 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.