blob: 2acf4b386d6c751734d5c69a3d2c41fb67034aa0 [file] [log] [blame]
Robert Hak4db2ded2002-08-13 09:19:21 +00001/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Robert E. Hak <rhak@ramapo.edu>
11 *
12 * Windows Copyright (C) 2002 by Felix Arends
13 * X11 Copyright (C) 2002 by Daniel Stenberg <daniel@haxx.se>
14 *
Daniel Stenberg2acc0ac2008-06-28 18:10:04 +000015 * 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.
Robert Hak4db2ded2002-08-13 09:19:21 +000019 *
20 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 * KIND, either express or implied.
22 *
23 ****************************************************************************/
24
Thomas Martitzd85c3ec2009-10-20 21:54:59 +000025#include <stdbool.h>
Thomas Martitza7f4e1f2009-04-29 22:24:40 +000026#include "config.h"
Thomas Martitzd85c3ec2009-10-20 21:54:59 +000027#include "system.h"
Robert Hake7a6a822002-08-13 09:32:56 +000028#include "lcd.h"
Thomas Martitza7f4e1f2009-04-29 22:24:40 +000029
30#ifdef HAVE_LCD_ENABLE
31static bool lcd_enabled = false;
32#endif
33#ifdef HAVE_LCD_SLEEP
34static bool lcd_sleeping = true;
35#endif
Daniel Stenberg41cfe302003-12-15 10:25:51 +000036
Jörg Hohensohna5e1d062003-12-20 10:00:37 +000037void lcd_set_flip(bool yesno)
38{
39 (void)yesno;
Jens Arnolde8bb31e2004-04-21 09:44:07 +000040}
41
Daniel Stenbergac31e6a2005-05-23 16:23:25 +000042void lcd_set_invert_display(bool invert)
43{
44 (void)invert;
45}
46
Jens Arnold9051afa2006-07-25 11:15:50 +000047int lcd_default_contrast(void)
Daniel Stenbergac31e6a2005-05-23 16:23:25 +000048{
Jens Arnold9051afa2006-07-25 11:15:50 +000049 return 28;
Daniel Stenbergac31e6a2005-05-23 16:23:25 +000050}
51
52#ifdef HAVE_REMOTE_LCD
53void lcd_remote_set_contrast(int val)
54{
55 (void)val;
56}
57void lcd_remote_backlight_on(int val)
58{
59 (void)val;
60}
61void lcd_remote_backlight_off(int val)
62{
63 (void)val;
64}
Jens Arnold22c15b72005-06-17 22:03:56 +000065
66void lcd_remote_set_flip(bool yesno)
67{
68 (void)yesno;
69}
Jens Arnold9051afa2006-07-25 11:15:50 +000070
71void lcd_remote_set_invert_display(bool invert)
72{
73 (void)invert;
74}
Daniel Stenbergac31e6a2005-05-23 16:23:25 +000075#endif
Thomas Martitza7f4e1f2009-04-29 22:24:40 +000076
77#ifdef HAVE_LCD_SLEEP
78void lcd_sleep(void)
79{
80 lcd_sleeping = true;
81}
82
83void lcd_awake(void)
84{
85 if (lcd_sleeping)
86 {
Thomas Martitzd85c3ec2009-10-20 21:54:59 +000087 send_event(LCD_EVENT_ACTIVATION, NULL);
Thomas Martitza7f4e1f2009-04-29 22:24:40 +000088 lcd_sleeping = false;
89 }
90}
91#endif
92#ifdef HAVE_LCD_ENABLE
93void lcd_enable(bool on)
94{
95 if (on && !lcd_enabled)
96 {
97#ifdef HAVE_LCD_SLEEP
98 /* lcd_awake will handle the activation call */
99 lcd_awake();
100#else
Thomas Martitzd85c3ec2009-10-20 21:54:59 +0000101 send_event(LCD_EVENT_ACTIVATION, NULL);
Thomas Martitza7f4e1f2009-04-29 22:24:40 +0000102#endif
103 }
104 lcd_enabled = on;
105}
106#endif
107
108#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
109bool lcd_active(void)
110{
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;
120}
121#endif