') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); GitHub - JB-Lighting/UGUI: µGUI - Open Source GUI module for embedded systems · GitHub
Skip to content

Repository files navigation

Introduction

Fork Info

This repo has several changes from the original version. I added some commits from other forks, also I added some modifications I believe are valuable. A list can be found bellow.

What is µGUI?

µGUI is a free and open source graphic library for embedded systems. It is platform-independent and can be easily ported to almost any microcontroller system. As long as the display is capable of showing graphics, µGUI is not restricted to a certain display technology. Therefore, display technologies such as LCD, TFT, E-Paper, LED or OLED are supported. The whole module consists of three files: ugui.c, ugui.h and ugui_config.h.

µGUI Features

  • µGUI supports any color, grayscale or monochrome display
  • µGUI supports any display resolution
  • µGUI supports multiple different displays
  • µGUI supports any touch screen technology (e.g. AR, PCAP)
  • µGUI supports windows and objects (e.g. button, textbox, checkbox)
  • µGUI supports platform-specific hardware acceleration
  • 16 different fonts available
  • cyrillic fonts supported
  • TrueType font converter available (https://github.com/AriZuu)
  • integrated and free scalable system console
  • basic geometric functions (e.g. line, circle, frame etc.)
  • can be easily ported to almost any microcontroller system
  • no risky dynamic memory allocation required

µGUI 0x3333 Fork Features

  • Fonts, Components, Colors have been externalized to a separated file
  • Pseudo Theme created(See ugui_theme.h)
  • Added flush function. In case the display driver uses Framebuffer, this function will be called after UG_Update is called
  • Prefixed all defines with UGUI_
  • Touch support is optional using UGUI_USE_TOUCH define
  • Added UGUI_USE_COLOR_BW for monochromatic displays, also added theme support
  • Added X11 Simulator. Based on the fork https://github.com/MarioIvancic/UGUI. Tested only on MacOS 10.14.
  • Added Simulation config
  • Added Simulation example
  • Added Function to convert from RGB565 to RGB888
  • Added a check to UG_DrawRoundFrame, draw a rect frame in case radius 0
  • Added ProgressBar object
  • Console support is optional using UGUI_USE_CONSOLE define.
  • Created a UG_DEVICE struct to hold device information.

To Do List

A To Do List has been added.

Commits added from other forks

µGUI Requirements

µGUI is platform-independent, so there is no need to use a certain embedded system. In order to use µGUI, only 3 requirements are necessary:

  • a C-function which is able to control pixels of the target display.
  • a C-function which is able to flush the framebuffer to the target display(See µGUI 0x3333 Fork Features above).
  • integer types for the target platform have to be adjusted in ugui_config.h.

Simulator Screenshots

Simulator running with 4X multiplier with progress bars.

Alt text

Simulator running with 4X multiplier.

Alt text

Simulator running with 4X multiplier and Black/White color scheme.

Alt text

About

µGUI - Open Source GUI module for embedded systems

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages