Theme Editor: Added rendering support for some more tags
[kugel-rb.git] / uisimulator / common / lcd-common.c
blob2acf4b386d6c751734d5c69a3d2c41fb67034aa0
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 <stdbool.h>
26 #include "config.h"
27 #include "system.h"
28 #include "lcd.h"
30 #ifdef HAVE_LCD_ENABLE
31 static bool lcd_enabled = false;
32 #endif
33 #ifdef HAVE_LCD_SLEEP
34 static bool lcd_sleeping = true;
35 #endif
37 void lcd_set_flip(bool yesno)
39 (void)yesno;
42 void lcd_set_invert_display(bool invert)
44 (void)invert;
47 int lcd_default_contrast(void)
49 return 28;
52 #ifdef HAVE_REMOTE_LCD
53 void lcd_remote_set_contrast(int val)
55 (void)val;
57 void lcd_remote_backlight_on(int val)
59 (void)val;
61 void lcd_remote_backlight_off(int val)
63 (void)val;
66 void lcd_remote_set_flip(bool yesno)
68 (void)yesno;
71 void lcd_remote_set_invert_display(bool invert)
73 (void)invert;
75 #endif
77 #ifdef HAVE_LCD_SLEEP
78 void lcd_sleep(void)
80 lcd_sleeping = true;
83 void lcd_awake(void)
85 if (lcd_sleeping)
87 send_event(LCD_EVENT_ACTIVATION, NULL);
88 lcd_sleeping = false;
91 #endif
92 #ifdef HAVE_LCD_ENABLE
93 void lcd_enable(bool on)
95 if (on && !lcd_enabled)
97 #ifdef HAVE_LCD_SLEEP
98 /* lcd_awake will handle the activation call */
99 lcd_awake();
100 #else
101 send_event(LCD_EVENT_ACTIVATION, NULL);
102 #endif
104 lcd_enabled = on;
106 #endif
108 #if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
109 bool lcd_active(void)
111 bool retval = false;
112 #ifdef HAVE_LCD_ENABLE
113 retval = lcd_enabled;
114 #endif
115 #ifdef HAVE_LCD_SLEEP
116 if (!retval)
117 retval = !lcd_sleeping;
118 #endif
119 return retval;
121 #endif