settings/src/displayStatus.c File Reference

#include <stdio.h>
#include <time.h>
#include <gtk/gtk.h>
#include <gdk/gdk.h>
#include <gdk/gdkx.h>
#include <glib.h>
#include "setupLog.h"
#include "displayStatus.h"
#include "liberdm/erdm.h"
#include "erbusy.h"

Go to the source code of this file.

Functions

gboolean display_update_during_idle_handling (gpointer data)
gboolean display_update_request_screen_refresh (int level, int waveform)
int display_update_get_level (void)
void display_update_increase_level (int level)
void display_update_decrease_level (int level)

Variables

static int g_currentLevel = LOWEST_LEVEL


Function Documentation

void display_update_decrease_level ( int  level  ) 

Definition at line 172 of file displayStatus.c.

00173 {
00174     ST_LOGPRINTF("new level %d - currentlevel %d", level, g_currentLevel);
00175 
00176     if (level < g_currentLevel)
00177     {
00178         g_currentLevel = level;
00179     }
00180 }

gboolean display_update_during_idle_handling ( gpointer  data  ) 

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 58 of file displayStatus.c.

00059 {
00060     int     level = (int) data;
00061     int     nQuality;
00062     eDmQuality quality;
00063     XImage *xi;
00064 
00065     // full screen update,
00066     gdk_threads_enter();
00067     xi = XGetImage(GDK_DISPLAY(), GDK_ROOT_WINDOW(), 0, 0, 1, 1, AllPlanes, XYPixmap);
00068     gdk_flush();
00069     XDestroyImage(xi);
00070     gdk_threads_leave();
00071 
00072     erbusy_off();
00073 
00074     // Extract 
00075     //   level from data
00076     //   waveform from data
00077 
00078     level = (int) data & 0x0000FFFF;
00079     nQuality = (int) data >> 16;
00080     
00081 #if (ST_SCREEN_ON)
00082     static int counter = 0;
00083     ST_WARNPRINTF(" **** (%d.%d) ***** [%d]", level, nQuality, counter++);
00084 #endif
00085 
00086     switch (nQuality)
00087     {
00088         case WAVEFORM_BW:
00089             ST_LOGPRINTF("Request for BW waveform");
00090             quality = dmQBW;
00091             break;
00092         case WAVEFORM_TYPING:
00093             ST_LOGPRINTF("Request for Typing waveform");
00094             quality = dmQTyping;
00095             break;
00096         default:
00097             quality = dmQFull;
00098     }
00099 
00100     if ((level == MAIN_WINDOW_EXPOSE_LEVEL) ||
00101         (level == SETUP_SCREEN_EXPOSE_LEVEL) ||
00102         (level == ONE_BUTTON_ITEM_CLICKED_LEVEL) || (level == SETUP_PAGE_LAYOUT_CHANGE) || (level == SETTING_ITEM_CHANGE))
00103     {
00104         // full screen update => should be done immediately
00105         dmDisplay(dmCmdPriorUrgent, quality);
00106     }
00107     else if ((level == BUTTON_FOCUS_IN_LEVEL) || (level == SELECTION_FOCUS_IN_LEVEL) || (level == TEXT_ENTRY_FOCUS_IN_LEVEL))
00108     {
00109         // with Hard key selecting items on the screen 
00110         dmDisplay(dmCmdPriorNormal, quality);
00111 
00112     }
00113     else if (level == TEXT_ENTRY_CHANGED_LEVEL)
00114     {
00115         //text entry
00116         dmDisplay(dmCmdPriorUrgent, quality);
00117     }
00118     else if (level == SELECTION_CLICKED_LEVEL)
00119     {
00120         // switch of a selection item 
00121         dmDisplay(dmCmdPriorUrgent, quality);
00122     }
00123     else
00124     {
00125         dmDisplay(dmCmdPriorUrgent, quality);
00126     }
00127 
00128     //reset the current level
00129     g_currentLevel = LOWEST_LEVEL;
00130 
00131     // return FALSE to remove handler
00132     return FALSE;
00133 }

Here is the call graph for this function:

int display_update_get_level ( void   ) 

Definition at line 155 of file displayStatus.c.

00156 {
00157     return g_currentLevel;
00158 }

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 161 of file displayStatus.c.

00162 {
00163     ST_LOGPRINTF("increase from %d to %d", g_currentLevel, level);
00164 
00165     if (level > g_currentLevel)
00166     {
00167         g_currentLevel = level;
00168     }
00169 }

gboolean display_update_request_screen_refresh ( int  level,
int  waveform 
)

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

Parameters:
status indicates whether or not not used
data corresponds to the e-ink waveform (value passed as integer). NULL corresponds to Full Update
Returns:
TRUE on success

Definition at line 136 of file displayStatus.c.

00137 {
00138     ST_LOGPRINTF("[%d] entry level %d currentlevel %d", counter++, level, g_currentLevel);
00139 
00140     if (level >= g_currentLevel)
00141     {
00142         if (waveform != 0)
00143         {
00144             ST_LOGPRINTF("Special waveform request");
00145             level += waveform << 16;
00146         }
00147 
00148         gtk_idle_add(display_update_during_idle_handling, (gpointer) level);
00149 
00150         g_currentLevel = level + 1;
00151     }
00152     return TRUE;
00153 }

Here is the call graph for this function:


Variable Documentation

int g_currentLevel = LOWEST_LEVEL [static]

Definition at line 44 of file displayStatus.c.


Generated on Sun Dec 14 17:16:55 2008 by  doxygen 1.5.6