scribble/src/displayUpdate.c File Reference

#include <gdk/gdk.h>
#include "displayUpdate.h"
#include "erbusy.h"
#include "ScribbleLog.h"

Go to the source code of this file.

Functions

int display_update_get_level (void)
int display_update_reset_level (void)
static gboolean display_update_during_idle_handling (gpointer data)
gboolean display_update_request_screen_refresh (int level, gpointer data)
void display_update_increase_level (int level)

Variables

static int g_currentLevel = LOWEST_LEVEL


Function Documentation

static gboolean display_update_during_idle_handling ( gpointer  data  )  [static]

callback : called when GTK in idle mode

Parameters:
data - indicates where the update request came from (DEBUG reasons)
Returns:
0 (to remove the "idle mode" handler)

Definition at line 54 of file displayUpdate.c.

00055 {
00056     eDmQuality quality = (int) data;
00057 
00058     SB_TIMEDISPLAY("start...,quality=%d",quality);
00059     erbusy_blink();
00060     //usleep( 300 * 1000 );
00061     // full screen update,
00062     gdk_threads_enter();
00063     //gdk_flush();
00064     gdk_flush();
00065     gdk_threads_leave();
00066 
00067     SB_TIMEDISPLAY("dmDisplay...");
00068     // full screen update,
00069     //dmDisplay(dmCmdPriorUrgent, quality);//no wait
00070     dmDisplay(dmCmdPriorNormal,quality);//work,500ms wait.
00071     //dmDisplay(dmCmdPriorHigh,quality);doens't work
00072     erbusy_off();
00073 
00074     SB_TIMEDISPLAY("done.");
00075     // return FALSE to remove handler
00076     return FALSE;
00077 }

Here is the call graph for this function:

int display_update_get_level ( void   ) 

Definition at line 105 of file displayUpdate.c.

00106 {
00107     return g_currentLevel;
00108 }

void display_update_increase_level ( int  level  ) 

Increase the level value of the screen refresh. Meaning that the screen refresh will only be requested to the displayManager for levels equal or larger then this level value.

Parameters:
level screen refresh level
Returns:
TRUE on success

Definition at line 116 of file displayUpdate.c.

00117 {
00118     if (level > g_currentLevel)
00119     {
00120         g_currentLevel = level;
00121     }
00122 }

gboolean display_update_request_screen_refresh ( int  level,
gpointer  data 
)

set address of gtk idle callback, where the e-inkt display update is requested

Parameters:
status indicates whether or not not used
data is quality.see eDmquality in <liberdm/erdm.h> typedef enum { dmQFull = 0, dmQBW, dmQTyping, dmQUndefined } eDmQuality;
Returns:
TRUE on success

Definition at line 80 of file displayUpdate.c.

00081 {
00082     int     theCurrentLevel = display_update_get_level();
00083     int     quality = (int) data;
00084 
00085     SB_IPCPRINTF("quality:%d\n",quality);
00086     if (quality == 0)
00087     {
00088         quality = dmQFull;
00089     }
00090 
00091 
00092     if (level >= theCurrentLevel)
00093     {
00094         g_idle_add_full(G_PRIORITY_HIGH_IDLE,   
00095                         display_update_during_idle_handling,
00096                         (gpointer) quality,
00097                         NULL);
00098         //gtk_idle_add(display_update_during_idle_handling, (gpointer) quality);
00099         //reset the current level
00100         display_update_reset_level();
00101     }
00102     return TRUE;
00103 }

Here is the call graph for this function:

int display_update_reset_level ( void   ) 

Definition at line 110 of file displayUpdate.c.

00111 {
00112     g_currentLevel = LOWEST_LEVEL;
00113     return g_currentLevel;
00114 }


Variable Documentation

int g_currentLevel = LOWEST_LEVEL [static]

Definition at line 40 of file displayUpdate.c.


Generated on Sun Dec 14 17:14:31 2008 by  doxygen 1.5.6