1 /* 2 * Common LCD device functionality. 3 * 4 * Copyright (C) 2018, 2023 Paul Boddie <paul@boddie.org.uk> 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License as 8 * published by the Free Software Foundation; either version 2 of 9 * the License, or (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 * Boston, MA 02110-1301, USA 20 */ 21 22 #include "lcd-device.h" 23 24 25 26 /* Display activation. */ 27 28 void Lcd_device::disable_display() 29 { 30 if (_display != NULL) 31 _display->disable(); 32 } 33 34 void Lcd_device::enable_display() 35 { 36 if (_display != NULL) 37 _display->enable(); 38 } 39 40 41 42 /* C language interface. */ 43 44 void *lcd_get_device() 45 { 46 return (void *) Lcd_device::get_device(); 47 } 48 49 l4_addr_t lcd_get_framebuffer(void *lcd) 50 { 51 return static_cast<Lcd_device *>(lcd)->get_framebuffer(); 52 } 53 54 l4_size_t lcd_get_framebuffer_size(void *lcd) 55 { 56 return static_cast<Lcd_device *>(lcd)->get_framebuffer_size(); 57 } 58 59 void lcd_get_view_info(void *lcd, l4re_video_view_info_t *view_info) 60 { 61 return static_cast<Lcd_device *>(lcd)->get_view_info(view_info); 62 } 63 64 void lcd_disable(void *lcd) 65 { 66 static_cast<Lcd_device *>(lcd)->disable(); 67 } 68 69 void lcd_enable(void *lcd) 70 { 71 static_cast<Lcd_device *>(lcd)->enable(); 72 }