fork of PCE focusing on macplus, supporting DaynaPort SCSI network emulation
at master 113 lines 2.8 kB view raw
1/***************************************************************************** 2 * pce * 3 *****************************************************************************/ 4 5/***************************************************************************** 6 * File name: src/drivers/video/null.c * 7 * Created: 2003-10-18 by Hampa Hug <hampa@hampa.ch> * 8 * Copyright: (C) 2003-2015 Hampa Hug <hampa@hampa.ch> * 9 *****************************************************************************/ 10 11/***************************************************************************** 12 * This program is free software. You can redistribute it and / or modify it * 13 * under the terms of the GNU General Public License version 2 as published * 14 * by the Free Software Foundation. * 15 * * 16 * This program is distributed in the hope that it will be useful, but * 17 * WITHOUT ANY WARRANTY, without even the implied warranty of * 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * 19 * Public License for more details. * 20 *****************************************************************************/ 21 22 23#include <stdlib.h> 24#include <string.h> 25 26#include <drivers/video/terminal.h> 27#include <drivers/video/null.h> 28 29 30static 31void null_free (null_t *nt) 32{ 33} 34 35static 36void null_del (null_t *nt) 37{ 38 if (nt != NULL) { 39 null_free (nt); 40 free (nt); 41 } 42} 43 44static 45int null_open (null_t *nt, unsigned w, unsigned h) 46{ 47 return (0); 48} 49 50static 51int null_close (null_t *nt) 52{ 53 return (0); 54} 55 56static 57int null_set_msg_trm (null_t *nt, const char *msg, const char *val) 58{ 59 if (strcmp (msg, "term.grab") == 0) { 60 return (0); 61 } 62 else if (strcmp (msg, "term.release") == 0) { 63 return (0); 64 } 65 else if (strcmp (msg, "term.title") == 0) { 66 return (0); 67 } 68 else if (strcmp (msg, "term.fullscreen.toggle") == 0) { 69 return (0); 70 } 71 else if (strcmp (msg, "term.fullscreen") == 0) { 72 return (0); 73 } 74 75 return (-1); 76} 77 78static 79void null_update (null_t *vt) 80{ 81} 82 83static 84void null_check (null_t *vt) 85{ 86} 87 88static 89void null_init (null_t *nt, ini_sct_t *ini) 90{ 91 trm_init (&nt->trm, nt); 92 93 nt->trm.del = (void *) null_del; 94 nt->trm.open = (void *) null_open; 95 nt->trm.close = (void *) null_close; 96 nt->trm.set_msg_trm = (void *) null_set_msg_trm; 97 nt->trm.update = (void *) null_update; 98 nt->trm.check = (void *) null_check; 99} 100 101terminal_t *null_new (ini_sct_t *ini) 102{ 103 null_t *nt; 104 105 nt = malloc (sizeof (null_t)); 106 if (nt == NULL) { 107 return (NULL); 108 } 109 110 null_init (nt, ini); 111 112 return (&nt->trm); 113}