pcshareMgr/src/displayUpdate.c File Reference

control - application interface with the display manager More...

#include <config.h>
#include <stdio.h>
#include <gtk/gtk.h>
#include "liberdm/erdm.h"
#include "logging.h"
#include "displayUpdate.h"

Go to the source code of this file.

Functions

int display_update_get_level (void)
void display_update_reset_level (void)
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


Detailed Description

control - application interface with the display manager

Copyright (C) 2005-2008 iRex Technologies B.V. All rights reserved.

<File description>="">

Definition in file displayUpdate.c.


Function Documentation

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 53 of file displayUpdate.c.

00054 {
00055     int     level = (int) data;
00056     int     nQuality;
00057     eDmQuality quality;
00058 
00059     //XImage *xi;
00060 
00061     // Extract 
00062     //   level from data
00063     //   waveform from data
00064 
00065     level = (int) data & 0x0000FFFF;
00066     nQuality = (int) data >> 16;
00067     switch (nQuality)
00068     {
00069         case WAVEFORM_BW:
00070             DL_DMPRINTF("Request for BW waveform");
00071             quality = dmQBW;
00072             break;
00073         case WAVEFORM_TYPING:
00074             DL_DMPRINTF("Request for Typing waveform");
00075             quality = dmQTyping;
00076             break;
00077         default:
00078             quality = dmQFull;
00079     }
00080 
00081     DL_DMPRINTF("\n________________request screen update (%d - %d)_____________", level, quality);
00082 
00083     // full screen update,
00084 
00085     gdk_threads_enter();
00086     gdk_flush();
00087     gdk_threads_leave();
00088 
00089     // full screen update,
00090     dmDisplay(dmCmdPriorNormal, quality);
00091 
00092     // return FALSE to remove handler
00093     return FALSE;
00094 }

Here is the call graph for this function:

int display_update_get_level ( void   ) 

Definition at line 123 of file displayUpdate.c.

00124 {
00125     return g_currentLevel;
00126 }

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 133 of file displayUpdate.c.

00134 {
00135     if (level > g_currentLevel)
00136     {
00137         g_currentLevel = level;
00138     }
00139 }

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 not used
Returns:
TRUE on success

Definition at line 96 of file displayUpdate.c.

00097 {
00098     int     theCurrentLevel = display_update_get_level();
00099     int     waveform;
00100 
00101     waveform = (int) data;
00102 
00103     DL_DMPRINTF("entry level %d currentlevel %d", level, theCurrentLevel);
00104 
00105     if (level >= theCurrentLevel)
00106     {
00107         if (waveform != 0)
00108         {
00109             DL_DMPRINTF("Special waveform request");
00110             level += waveform << 16;
00111         }
00112 
00113 
00114         gtk_idle_add(display_update_during_idle_handling, (gpointer) level);
00115 
00116         //reset the current level
00117         display_update_reset_level();
00118 
00119     }
00120     return TRUE;
00121 }

Here is the call graph for this function:

void display_update_reset_level ( void   ) 

Definition at line 128 of file displayUpdate.c.

00129 {
00130     g_currentLevel = LOWEST_LEVEL;
00131 }


Variable Documentation

int g_currentLevel = LOWEST_LEVEL [static]

Definition at line 40 of file displayUpdate.c.


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