📄 ial.c
字号:
//// $Id: ial.c,v 1.16 2000/11/27 09:38:49 ymwei Exp $// // The Input Abstract Layer of MiniGUI.//// Copyright (C) 2000, Wei Yongming.// Copyright (C) 2000, BluePoint Software.//// Current maintainer: Wei Yongming.///*** This library is free software; you can redistribute it and/or** modify it under the terms of the GNU Library General Public** License as published by the Free Software Foundation; either** version 2 of the License, or (at your option) any later version.**** This library is distributed in the hope that it will be useful,** but WITHOUT ANY WARRANTY; without even the implied warranty of** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU** Library General Public License for more details.**** You should have received a copy of the GNU Library General Public** License along with this library; if not, write to the Free** Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,** MA 02111-1307, USA*/// Create date: 2000/06/13//// Modify records://// Who When Where For What Status//-----------------------------------------------------------------------------//// TODO:Support Keyboard state array....// // #include <stdio.h>#include <string.h>#ifdef _SVGALIB #include <vga.h> #include <vgamouse.h> #include <vgakeyboard.h>#endif#ifdef _LIBGGI #include <ggi/ggi.h>#endif#include "common.h"#include "minigui.h"#include "ial.h"#ifdef _DUMMY_IAL #include "dummy.h"#endif#ifdef _PCSIM_IAL #include "pcsim.h"#endif#ifdef _NATIVE_IAL_ENGINE#include "native/native.h"#endif#ifdef _SVGALIB #include "svgalib.h"#endif#ifdef _LIBGGI #include "libggi.h"#endif#ifdef _EP7211 #include "ep7211.h"#endif#ifdef _ADS #include "ads.h"#endif#ifndef lintstatic char fileid[] = "$Id: ial.c,v 1.16 2000/11/27 09:38:49 ymwei Exp $";#endif#define LEN_ENGINE_NAME 16#define LEN_TYPE_NAME 16INPUT inputs [] = {#ifdef _SVGALIB {"SVGALib", InitSVGALibInput, TermSVGALibInput},#endif#ifdef _LIBGGI {"LibGGI", InitLibGGIInput, TermLibGGIInput},#endif#ifdef _EP7211 {"EP7211", InitEP7211Input, TermEP7211Input},#endif#ifdef _ADS {"ADS", InitADSInput, TermADSInput},#endif#ifdef _NATIVE_IAL_ENGINE {"Native", InitNativeInput, TermNativeInput}#endif#ifdef _DUMMY_IAL {"Dummy", InitDummyInput, TermDummyInput},#endif#ifdef _PCSIM_IAL {"pcsim", InitpcsimInput, TermpcsimInput},#endif};INPUT* cur_input;#define NR_INPUTS (sizeof (inputs) / sizeof (INPUT))int InitIAL (void){ int i; char buff [LEN_ENGINE_NAME + 1]; char mdev [MAX_PATH + 1]; char mtype[LEN_TYPE_NAME + 1]; if (GetValueFromEtcFile (ETCFILEPATH, "system", "ial_engine", buff, LEN_ENGINE_NAME) < 0 ) return ERR_CONFIG_FILE; if (GetValueFromEtcFile (ETCFILEPATH, "system", "mdev", mdev, MAX_PATH) < 0 ) return ERR_CONFIG_FILE; if (GetValueFromEtcFile (ETCFILEPATH, "system", "mtype", mtype, LEN_TYPE_NAME) < 0 ) return ERR_CONFIG_FILE; for (i = 0; i < NR_INPUTS; i++) { if ( strncasecmp (buff, inputs[i].id, LEN_ENGINE_NAME) == 0) { cur_input = inputs + i; break; } } if (cur_input == NULL) { fprintf (stderr, "IAL: Does not find matched engine.\n"); return ERR_NO_MATCH; } if (!IAL_InitInput (cur_input, mdev, mtype)) { fprintf (stderr, "IAL: Init IAL engine failure.\n"); return ERR_INPUT_ENGINE; } fprintf (stderr, "IAL: Use %s engine.\n", cur_input->id); return 0;}void TerminateIAL (void){ IAL_TermInput ();}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -