bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Patch to add get_dimensions to the console-client


From: marco
Subject: Patch to add get_dimensions to the console-client
Date: Sat, 17 May 2003 00:48:48 +0200 (CEST)

Hi,

Included with this mail is a patch to add a new interface for display drivers
and the the implementation for the VGA and ncurses driver.

I need this for adding support for non 80x25 resolutions and it is
extremely usefull for screensaver support.

Thanks,
Marco

2003-05-17  Marco Gerards  <address@hidden>

        * display.h (display_ops): Add get_dimensions interface.
        * ncursesw.c (ncurses_get_dimensions): New function.
        (ncursesw_displ): Add ncurses_get_dimensions.
        * vga.c (vga_display_get_dimensions): New function.
        (ncursesw_displ): Add vga_display_get_dimensions.


diff -up /home/marco/console-client/display.h console-client/display.h
--- /home/marco/console-client/display.h        2003-05-11
23:13:00.000000000 +0200
+++ console-client/display.h    2003-05-17 01:31:13.000000000 +0200
@@ -133,6 +133,10 @@ struct display_ops

   /* Do not use, do not remove.  */
   void (*deprecated) (void *handle, int key);
+
+  /* Get the dimensions of the physical screen and store them in WIDTH
+     and HEIGHT.  */
+  void (*get_dimensions) (void *handle, int *width, int *height);
 };

 #endif /* _DISPLAY_H_ */
Only in console-client: display.h~
diff -up /home/marco/console-client/ncursesw.c console-client/ncursesw.c
--- /home/marco/console-client/ncursesw.c       2003-05-11
23:13:01.000000000 +0200
+++ console-client/ncursesw.c   2003-05-17 01:37:37.000000000 +0200
@@ -508,6 +508,12 @@ ncursesw_beep (void *handle)
   return 0;
 }

+void
+ncurses_get_dimensions (void *handle, int *width, int *height)
+{
+  *width = COLS;
+  *height = LINES;
+}



 static error_t
@@ -596,7 +602,8 @@ static struct display_ops ncursesw_displ
     ncursesw_write,
     ncursesw_update,
     ncursesw_flash,
-    NULL
+    NULL,
+    ncurses_get_dimensions
   };

 static struct input_ops ncursesw_input_ops =
Only in console-client: ncursesw.c~
diff -up /home/marco/console-client/vga.c console-client/vga.c
--- /home/marco/console-client/vga.c    2003-05-11 23:13:02.000000000 +0200
+++ console-client/vga.c        2003-05-17 01:33:46.000000000 +0200
@@ -552,6 +552,15 @@ vga_display_write (void *handle, conchar
   return 0;
 }

+void
+vga_display_get_dimensions (void *handle, int *width, int *height)
+{
+  struct vga_display *disp = handle;
+
+  *width = disp->width;
+  *height = disp->height;
+}
+


 struct driver_ops driver_vga_ops =
   {
@@ -569,5 +578,6 @@ static struct display_ops vga_display_op
     vga_display_write,
     NULL,
     vga_display_flash,
-    NULL
+    NULL,
+    vga_display_get_dimensions
   };







reply via email to

[Prev in Thread] Current Thread [Next in Thread]