]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - include/video_console.h
rockchip: rk3288: Add TPL_LDSCRIPT
[people/ms/u-boot.git] / include / video_console.h
index 36c4e138122c70dac3f6080c1e81a02988b4b45b..9dce234bd928cf24372532c0923f868f44b1a326 100644 (file)
@@ -29,6 +29,9 @@
  * @xsize_frac:        Width of the display in fractional units
  * @xstart_frac:       Left margin for the text console in fractional units
  * @last_ch:   Last character written to the text console on this line
+ * @escape:    TRUE if currently accumulating an ANSI escape sequence
+ * @escape_len:        Length of accumulated escape sequence so far
+ * @escape_buf:        Buffer to accumulate escape sequence
  */
 struct vidconsole_priv {
        struct stdio_dev sdev;
@@ -42,6 +45,14 @@ struct vidconsole_priv {
        int xsize_frac;
        int xstart_frac;
        int last_ch;
+       /*
+        * ANSI escape sequences are accumulated character by character,
+        * starting after the ESC char (0x1b) until the entire sequence
+        * is consumed at which point it is acted upon.
+        */
+       int escape;
+       int escape_len;
+       char escape_buf[32];
 };
 
 /**
@@ -101,6 +112,20 @@ struct vidconsole_ops {
         * positions.
         */
        int (*entry_start)(struct udevice *dev);
+
+       /**
+        * backspace() - Handle erasing the last character
+        *
+        * With proportional fonts the vidconsole uclass cannot itself erase
+        * the previous character. This optional method will be called when
+        * a backspace is needed. The driver should erase the previous
+        * character and update the cursor position (xcur_frac, ycur) to the
+        * start of the previous character.
+        *
+        * If not implement, default behaviour will work for fixed-width
+        * characters.
+        */
+       int (*backspace)(struct udevice *dev);
 };
 
 /* Get a pointer to the driver operations for a video console device */