connectionMgr/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 <liberdm/erdm.h>
#include "connectionMgrLog.h"
#include "displayStatus.h"
#include "erbusy.h"

Go to the source code of this file.

Functions

void display_update_remove_idle_handler_id (void)
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
static guint g_idle_hander_id = 0


Function Documentation

void display_update_decrease_level ( int  level  ) 

Definition at line 190 of file displayStatus.c.

00191 {
00192     CN_DMPRINTF("decrease from %d to %d", g_currentLevel, level);
00193 
00194     if (level < g_currentLevel)
00195     {
00196         g_currentLevel = level;
00197     }
00198 }

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

00071 {
00072     int     level = (int) data;
00073     int     nQuality;
00074     eDmQuality quality;
00075 
00076     CN_DMPRINTF(" **** (%d) ***** [%d]", level, counter++);
00077 
00078     // full screen update,
00079     gdk_threads_enter();
00080     gdk_flush();
00081     gdk_threads_leave();
00082 
00083     erbusy_off();
00084     
00085     // Extract 
00086     //   level from data
00087     //   waveform from data
00088     level = (int) data & 0x0000FFFF;
00089     nQuality = (int) data >> 16;
00090     switch (nQuality)
00091     {
00092         case WAVEFORM_BW:
00093             CN_DMPRINTF("Request for BW waveform");
00094             quality = dmQBW;
00095             break;
00096         case WAVEFORM_TYPING:
00097             CN_DMPRINTF("Request for Typing waveform");
00098             quality = dmQTyping;
00099             break;
00100         default:
00101             quality = dmQFull;
00102     }
00103 
00104     if ((level == MAIN_WINDOW_EXPOSE_LEVEL)      ||
00105         (level == SETUP_SCREEN_EXPOSE_LEVEL)     ||
00106         (level == ONE_BUTTON_ITEM_CLICKED_LEVEL) ||
00107         (level == SETUP_PAGE_LAYOUT_CHANGE)      ||
00108         (level == SETTING_ITEM_CHANGE)           ||
00109         (level == STATUS_ITEM_CHANGE)              )
00110     {
00111         // full screen update => should be done immediately
00112         dmDisplay(dmCmdPriorUrgent, quality);
00113     }
00114     else if ((level == BUTTON_FOCUS_IN_LEVEL) ||
00115              (level == SELECTION_FOCUS_IN_LEVEL) ||
00116              (level == TEXT_ENTRY_FOCUS_IN_LEVEL)  )
00117     {
00118         // with Hard key selecting items on the screen 
00119         // dmDisplay(dmCmdPriorNormal, quality);
00120         dmDisplay(dmCmdPriorUrgent, quality);
00121 
00122     }
00123     else if (level == TEXT_ENTRY_CHANGED_LEVEL)
00124     {
00125         //text entry
00126         dmDisplay(dmCmdPriorNormal, quality);
00127         //dmDisplay(dmCmdPriorUrgent, quality);
00128     }
00129     else if (level == SELECTION_CLICKED_LEVEL)
00130     {
00131         // switch of a selection item 
00132         // dmDisplay(dmCmdPriorHigh, quality);
00133         dmDisplay(dmCmdPriorUrgent, quality);
00134     }
00135     else
00136     {
00137         //dmDisplay(dmCmdPriorNormal, quality);
00138         dmDisplay(dmCmdPriorUrgent, quality);
00139     }
00140 
00141     //reset the current level
00142     g_currentLevel = LOWEST_LEVEL;
00143 
00144     // return FALSE to remove handler
00145     g_idle_hander_id = 0;
00146     return FALSE;
00147 }

Here is the call graph for this function:

int display_update_get_level ( void   ) 

Definition at line 173 of file displayStatus.c.

00174 {
00175     return g_currentLevel;
00176 }

void display_update_increase_level ( int  level  ) 

Increase/decrease 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 179 of file displayStatus.c.

00180 {
00181     CN_DMPRINTF("increase from %d to %d", g_currentLevel, level);
00182 
00183     if (level > g_currentLevel)
00184     {
00185         g_currentLevel = level;
00186     }
00187 }

void display_update_remove_idle_handler_id ( void   ) 

Definition at line 52 of file displayStatus.c.

00053 {
00054     if (g_idle_hander_id)
00055     {
00056         CN_DMPRINTF("\nRemoving the old idle handler.\n");
00057         g_source_remove(g_idle_hander_id);
00058         g_idle_hander_id = 0;
00059     }
00060 }

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:
level - priority of this screen udpate request
waveform - requested e-ink waveform
Returns:
TRUE on success

Definition at line 150 of file displayStatus.c.

00151 {
00152     CN_DMPRINTF("[%d] entry level %d currentlevel %d", 
00153             counter++, level, g_currentLevel);
00154 
00155     if (level >= g_currentLevel)
00156     {
00157         g_currentLevel = level + 1;
00158 
00159         if (waveform != 0)
00160         {
00161             CN_DMPRINTF("Special waveform request");
00162             level += waveform << 16;
00163         }
00164 
00165         display_update_remove_idle_handler_id();
00166 
00167         g_idle_hander_id = gtk_idle_add(display_update_during_idle_handling,
00168                                         (gpointer) level);
00169     }
00170     return TRUE;
00171 }

Here is the call graph for this function:


Variable Documentation

int g_currentLevel = LOWEST_LEVEL [static]

Definition at line 43 of file displayStatus.c.

guint g_idle_hander_id = 0 [static]

Definition at line 45 of file displayStatus.c.


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