#include <sys/time.h>#include "scbconfig.h"#include "scbpoint.h"#include <liberdm/erdm.h>#include <glib.h>

Go to the source code of this file.
Classes | |
| struct | _DrvPointInfo |
| struct | _DrvPointsBuf |
| struct | _FastDrawContext |
Typedefs | |
| typedef struct _DrvPointInfo | DrvPointInfo |
| typedef struct _DrvPointsBuf | DrvPointsBuf |
| typedef DrvPointsBuf * | DrvPointsBufPtr |
| typedef struct _FastDrawContext | FastDrawContext |
Functions | |
| void | scb_driver_init () |
| void | scb_driver_close () |
| void | scb_driver_draw (DrvPointsBufPtr ptr) |
| void | scb_fast_draw_reset_context () |
| gboolean | scb_fast_draw_now () |
| void | scb_fast_draw_record (const ScbDevPointPtr ptr, const unsigned char size, const unsigned char color, const unsigned char pen_down) |
| void | scb_fast_draw () |
| void | scb_fast_draw_points (DrvPointsBufPtr ptr) |
| typedef struct _DrvPointInfo DrvPointInfo |
Copyright (C) 2005-2008 iRex Technologies B.V. All rights reserved.
| typedef struct _DrvPointsBuf DrvPointsBuf |
| typedef DrvPointsBuf* DrvPointsBufPtr |
| typedef struct _FastDrawContext FastDrawContext |
| void scb_driver_close | ( | ) |
| void scb_driver_draw | ( | DrvPointsBufPtr | ptr | ) |
Definition at line 58 of file driver.c.
00059 { 00060 if (ptr) 00061 { 00062 if (0 != ioctl (fbdev, FBIO_DRAWPIXELS, ptr)) 00063 { 00064 SCB_ERROR("ioctl request error!"); 00065 } 00066 } 00067 }
| void scb_driver_init | ( | ) |
| void scb_fast_draw | ( | ) |
Definition at line 125 of file driver.c.
00126 { 00127 scb_driver_draw(&s_fast_draw_ctx.points); 00128 }

| gboolean scb_fast_draw_now | ( | ) |
SCB_TRACE("Should draw now time!");
Definition at line 81 of file driver.c.
00082 { 00083 // check points 00084 if (s_fast_draw_ctx.points.count > SCB_DEF_FAST_DRAW_COUNT) 00085 { 00086 //SCB_TRACE("Should draw now points!"); 00087 return TRUE; 00088 } 00089 00090 // check time 00091 static const long usec = 1000 * 1000; 00092 long elapsed = ( s_fast_draw_ctx.t2.tv_sec - s_fast_draw_ctx.t1.tv_sec ) * usec; 00093 elapsed += s_fast_draw_ctx.t2.tv_usec - s_fast_draw_ctx.t1.tv_usec; 00094 00095 if (elapsed >= SCB_DEF_FAST_DRAW_TIME) 00096 { 00098 return TRUE; 00099 } 00100 //SCB_TRACE("No, not yet. Waiting for..."); 00101 return FALSE; 00102 }
| void scb_fast_draw_points | ( | DrvPointsBufPtr | ptr | ) |
Definition at line 131 of file driver.c.
00132 { 00133 scb_driver_draw(ptr); 00134 }

| void scb_fast_draw_record | ( | const ScbDevPointPtr | ptr, | |
| const unsigned char | size, | |||
| const unsigned char | color, | |||
| const unsigned char | pen_down | |||
| ) |
Definition at line 106 of file driver.c.
00110 { 00111 // make a check 00112 if (s_fast_draw_ctx.points.count < SCB_DEF_FAST_DRAW_BUF_LEN && ptr) 00113 { 00114 s_fast_draw_ctx.points.points[s_fast_draw_ctx.points.count].x = ptr->x; 00115 s_fast_draw_ctx.points.points[s_fast_draw_ctx.points.count].y = ptr->y; 00116 s_fast_draw_ctx.points.points[s_fast_draw_ctx.points.count].size = size; 00117 s_fast_draw_ctx.points.points[s_fast_draw_ctx.points.count].color = color; 00118 s_fast_draw_ctx.points.points[s_fast_draw_ctx.points.count].pen_down = pen_down; 00119 ++s_fast_draw_ctx.points.count; 00120 gettimeofday(&s_fast_draw_ctx.t2, NULL); 00121 } 00122 }
| void scb_fast_draw_reset_context | ( | ) |
Definition at line 72 of file driver.c.
00073 { 00074 s_fast_draw_ctx.points.count = 0; 00075 gettimeofday(&s_fast_draw_ctx.t1, NULL); 00076 s_fast_draw_ctx.t2.tv_sec = s_fast_draw_ctx.t1.tv_sec; 00077 s_fast_draw_ctx.t2.tv_usec = s_fast_draw_ctx.t1.tv_usec; 00078 }
1.5.6