Correct the slight misalignment of the clock (FS#10334 by Andre Lupa)
[kugel-rb.git] / uisimulator / common / lcd-common.c
blob52db7768568442495cefc293fc50f0de68d8db00
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2002 by Robert E. Hak <rhak@ramapo.edu>
12 * Windows Copyright (C) 2002 by Felix Arends
13 * X11 Copyright (C) 2002 by Daniel Stenberg <daniel@haxx.se>
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version 2
18 * of the License, or (at your option) any later version.
20 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 * KIND, either express or implied.
23 ****************************************************************************/
25 #include "config.h"
26 #include "lcd.h"
28 #ifdef HAVE_LCD_ENABLE
29 static bool lcd_enabled = false;
30 #endif
31 #ifdef HAVE_LCD_SLEEP
32 static bool lcd_sleeping = true;
33 #endif
35 void lcd_set_flip(bool yesno)
37 (void)yesno;
40 void lcd_set_invert_display(bool invert)
42 (void)invert;
45 int lcd_default_contrast(void)
47 return 28;
50 #ifdef HAVE_REMOTE_LCD
51 void lcd_remote_set_contrast(int val)
53 (void)val;
55 void lcd_remote_backlight_on(int val)
57 (void)val;
59 void lcd_remote_backlight_off(int val)
61 (void)val;
64 void lcd_remote_set_flip(bool yesno)
66 (void)yesno;
69 void lcd_remote_set_invert_display(bool invert)
71 (void)invert;
73 #endif
75 #ifdef HAVE_LCD_SLEEP
76 void lcd_sleep(void)
78 lcd_sleeping = true;
81 void lcd_awake(void)
83 if (lcd_sleeping)
85 lcd_activation_call_hook();
86 lcd_sleeping = false;
89 #endif
90 #ifdef HAVE_LCD_ENABLE
91 void lcd_enable(bool on)
93 if (on && !lcd_enabled)
95 #ifdef HAVE_LCD_SLEEP
96 /* lcd_awake will handle the activation call */
97 lcd_awake();
98 #else
99 lcd_activation_call_hook();
100 #endif
102 lcd_enabled = on;
104 #endif
106 #if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
107 bool lcd_active(void)
109 bool retval = false;
110 #ifdef HAVE_LCD_ENABLE
111 retval = lcd_enabled;
112 #endif
113 #ifdef HAVE_LCD_SLEEP
114 if (!retval)
115 retval = !lcd_sleeping;
116 #endif
117 return retval;
119 #endif