r5364 vince - in /branches/vince/netsurf-fb/framebuffer: fb_cursor.c fb_init_able.c fb_init_linux.c res/pointer.png

netsurf at semichrome.net netsurf at semichrome.net
Wed Sep 17 17:12:21 BST 2008


Author: vince
Date: Wed Sep 17 11:12:21 2008
New Revision: 5364

URL: http://source.netsurf-browser.org?rev=5364&view=rev
Log:
add reasonable pointer

Added:
    branches/vince/netsurf-fb/framebuffer/res/pointer.png   (with props)
Modified:
    branches/vince/netsurf-fb/framebuffer/fb_cursor.c
    branches/vince/netsurf-fb/framebuffer/fb_init_able.c
    branches/vince/netsurf-fb/framebuffer/fb_init_linux.c

Modified: branches/vince/netsurf-fb/framebuffer/fb_cursor.c
URL: http://source.netsurf-browser.org/branches/vince/netsurf-fb/framebuffer/fb_cursor.c?rev=5364&r1=5363&r2=5364&view=diff
==============================================================================
--- branches/vince/netsurf-fb/framebuffer/fb_cursor.c (original)
+++ branches/vince/netsurf-fb/framebuffer/fb_cursor.c Wed Sep 17 11:12:21 2008
@@ -24,6 +24,125 @@
         struct bitmap *bitmap; /* pointer bitmap */
 
         uint8_t *savedata; /* save under area */
+};
+
+static const struct {
+  unsigned int 	 width;
+  unsigned int 	 height;
+  unsigned int 	 bytes_per_pixel; /* 3:RGB, 4:RGBA */ 
+  unsigned char	 pixel_data[10 * 10 * 4 + 1];
+} pointer_image = {
+        10, 10, 4,
+        "\207\0\0\0"
+        "\377\0\0\0"
+        "\377\0\0\0"
+        "\0\377\377\377"
+        "\0\377\377\377"
+        "\0\377\377\377"
+        "\0\377\377\377"
+        "\0\377\377\377"
+        "\0\377\377\377"
+        "\0\377\377\377"
+
+        "\377\0\0\0"
+        "\377\0\0\0"
+        "\377\0\0\0"
+        "\377\0\0\0"
+        "\377\0\0\0"
+        "\377\0\0\0"
+        "\177\0\0\0"
+        "N\0\0\0"
+        "\0\377\377\377"
+        "\0\377\377\377"
+
+        "\377\0\0\0"
+        "\377\0\0\0"
+        "\377\0\0\0"
+        "\377\0\0\0"
+        "\377\0\0\0"
+        "\377\0\0\0"
+        "\377\0\0\0"
+        "\377\0\0\0"
+        "\377\0\0\0"
+        "\377\0\0\0"
+
+        "\0\377\377\377"
+        "\377\0\0\0"
+        "\377\0\0\0"
+        "\377\0\0\0"
+        "\377\0\0\0"
+        "\377\0\0\0"
+        "\0\377\377\377"
+        "\0\377\377\377"
+        "\0\377\377\377"
+        "\0\377\377\377"
+
+        "\0\377\377\377"
+        "\377\0\0\0"
+        "\377\0\0\0"
+        "\377\0\0\0"
+        "\377\0\0\0"
+        "\203\0\0\0"
+        "\0\377\377\377"
+        "\0\377\377\377"
+        "\0\377\377\377"
+        "\0\377\377\377"
+
+        "\0\377\377\377"
+        "\377\0\0\0"
+        "\377\0\0\0"
+        "\377\0\0\0"
+        "\203\0\0\0"
+        "\377\0\0\0"
+        "\207\0\0\0"
+        "\0\377\377\377"
+        "\0\377\377\377"
+        "\0\377\377\377"
+
+        "\0\377\377\377"
+        "\177\0\0\0"
+        "\377\0\0\0"
+        "\0\377\377\377"
+        "\0\377\377\377"
+        "\207\0\0\0"
+        "\377\0\0\0"
+        "\207\0\0\0"
+        "\0\377\377\377"
+        "\0\377\377\377"
+
+        "\0\377\377\377"
+        "N\0\0\0"
+        "\377\0\0\0"
+        "\0\377\377\377"
+        "\0\377\377\377"
+        "\0\377\377\377"
+        "\207\0\0\0"
+        "\377\0\0\0"
+        "\207\0\0\0"
+        "\0\377\377\377"
+
+        "\0\377\377\377"
+        "\0\377\377\377"
+        "\377\0\0\0"
+        "\0\377\377\377"
+        "\0\377\377\377"
+        "\0\377\377\377"
+        "\0\377\377\377"
+        "\207\0\0\0"
+        "\377\0\0\0"
+        "\207\0\0\0"
+
+        "\0\377\377\377"
+        "\0\377\377\377"
+        "\377\0\0\0"
+        "\0\377\377\377"
+        "\0\377\377\377"
+        "\0\377\377\377"
+        "\0\377\377\377"
+        "\0\377\377\377"
+        "\207\0\0\0"
+        "\377\0\0\0",
+
 };
 
 void
@@ -60,6 +179,7 @@
         fb_plot_ctx = saved_plot_ctx;
 }
 
+
 fb_cursor_t *
 fb_cursor_init(framebuffer_t *fb)
 {
@@ -69,10 +189,13 @@
         cursor->x = fb->width / 2;
         cursor->y = fb->height / 2;
 
-        cursor->width = 16;
-        cursor->height = 16;
+        cursor->width = pointer_image.width;
+        cursor->height = pointer_image.height;
         cursor->bitmap = bitmap_create(cursor->width, cursor->height, 0);
-        memset(cursor->bitmap->pixdata, 0xff, cursor->width * 4);
+
+        memcpy(cursor->bitmap->pixdata, 
+               pointer_image.pixel_data, 
+               pointer_image.width * pointer_image.height * pointer_image.bytes_per_pixel);
 
         return cursor;
 }

Modified: branches/vince/netsurf-fb/framebuffer/fb_init_able.c
URL: http://source.netsurf-browser.org/branches/vince/netsurf-fb/framebuffer/fb_init_able.c?rev=5364&r1=5363&r2=5364&view=diff
==============================================================================
--- branches/vince/netsurf-fb/framebuffer/fb_init_able.c (original)
+++ branches/vince/netsurf-fb/framebuffer/fb_init_able.c Wed Sep 17 11:12:21 2008
@@ -13,7 +13,7 @@
 int devfd;
 static const char *fbdevname = "(fb0)";
 
-framebuffer_t *fb_init_os(int argc, char** argv)
+framebuffer_t *fb_os_init(int argc, char** argv)
 {
         framebuffer_t *newfb;
         struct fb_info_s *fbinfo;
@@ -68,11 +68,11 @@
         return newfb;
 }
 
-void fb_quit_os(framebuffer_t *fb)
+void fb_os_quit(framebuffer_t *fb)
 {
 }
 
-static void fb_service_input(struct gui_window *g) 
+void fb_os_input(struct gui_window *g) 
 {
         ssize_t amt;
         char key;

Modified: branches/vince/netsurf-fb/framebuffer/fb_init_linux.c
URL: http://source.netsurf-browser.org/branches/vince/netsurf-fb/framebuffer/fb_init_linux.c?rev=5364&r1=5363&r2=5364&view=diff
==============================================================================
--- branches/vince/netsurf-fb/framebuffer/fb_init_linux.c (original)
+++ branches/vince/netsurf-fb/framebuffer/fb_init_linux.c Wed Sep 17 11:12:21 2008
@@ -608,9 +608,9 @@
                                 return;
 
                         if (event.code == 0) {
+                                fb_cursor_move(framebuffer, event.value, 0);
+                        } else { 
                                 fb_cursor_move(framebuffer, 0, event.value);
-                        } else { 
-                                fb_cursor_move(framebuffer, event.value, 0);
                         }
                 }
         }

Added: branches/vince/netsurf-fb/framebuffer/res/pointer.png
URL: http://source.netsurf-browser.org/branches/vince/netsurf-fb/framebuffer/res/pointer.png?rev=5364&view=auto
==============================================================================
Binary file - no diff available.

Propchange: branches/vince/netsurf-fb/framebuffer/res/pointer.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream




More information about the netsurf-commits mailing list