]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - include/video_console.h
Fixup bug in PMIC TPS65217 register address definition
[people/ms/u-boot.git] / include / video_console.h
index eeba368d6391512ea49fbed561e7523d4e786be9..26047934da8c59b4646caa6cb9f8a631d1ce0561 100644 (file)
@@ -27,6 +27,8 @@
  * @y_charsize:        Character height in pixels
  * @tab_width_frac:    Tab width in fractional units
  * @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
  */
 struct vidconsole_priv {
        struct stdio_dev sdev;
@@ -38,6 +40,8 @@ struct vidconsole_priv {
        int y_charsize;
        int tab_width_frac;
        int xsize_frac;
+       int xstart_frac;
+       int last_ch;
 };
 
 /**
@@ -85,6 +89,32 @@ struct vidconsole_ops {
         * @return 0 if OK, -ve on error
         */
        int (*set_row)(struct udevice *dev, uint row, int clr);
+
+       /**
+        * entry_start() - Indicate that text entry is starting afresh
+        *
+        * Consoles which use proportional fonts need to track the position of
+        * each character output so that backspace will return to the correct
+        * place. This method signals to the console driver that a new entry
+        * line is being start (e.g. the user pressed return to start a new
+        * command). The driver can use this signal to empty its list of
+        * 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 */