📄 gal.c
字号:
//// $Id: gal.c,v 1.17 2000/11/26 07:18:59 ymwei Exp $// // The Graphics Abstract Layer of MiniGUI.//// Copyright (C) 2000, Wei Yongming.//// 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/11//// Modify records://// Who When Where For What Status//-----------------------------------------------------------------------------//// TODO:// // #include <stdio.h>#include <string.h>#ifdef _SVGALIB #include <vga.h> #include <vgagl.h> #ifdef _STDVGA #include <vgagl4.h> #endif#endif#ifdef _LIBGGI #include <ggi/ggi.h>#endif#include "common.h"#include "minigui.h"#include "gal.h"#ifdef _S3C44B0X #include "s3c44b0x.h"#endif#ifdef _NATIVE_GAL_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: gal.c,v 1.17 2000/11/26 07:18:59 ymwei Exp $";#endif#define LEN_ENGINE_NAME 8GFX gfxes [] = {#ifdef _SVGALIB {"SVGALib", InitSVGALib, TermSVGALib},#endif#ifdef _LIBGGI {"LibGGI", InitLibGGI, TermLibGGI},#endif#ifdef _EP7211 {"EP7211",InitEP7211, TermEP7211},#endif#ifdef _ADS {"ADS", InitADS, TermADS},#endif#ifdef _NATIVE_GAL_ENGINE {"Native", InitNative, TermNative}#endif#ifdef _S3C44B0X {"s3c44b0x", Inits3c44b0x, Terms3c44b0x}#endif};GFX* cur_gfx;#define NR_GFXES (sizeof (gfxes) / sizeof (GFX))int InitGAL (void){ int i; char buff [LEN_ENGINE_NAME + 1]; if (GetValueFromEtcFile (ETCFILEPATH, "system", "gal_engine", buff, LEN_ENGINE_NAME) < 0 ) return ERR_CONFIG_FILE; if (NR_GFXES == 0) return ERR_NO_ENGINE; for (i = 0; i < NR_GFXES; i++) { if ( strncasecmp (gfxes[i].id, buff, LEN_ENGINE_NAME) == 0) { cur_gfx = gfxes + i; break; } } if (cur_gfx == NULL) { fprintf (stderr, "GAL: Does not find matched engine.\n"); return ERR_NO_MATCH; } if (!GAL_InitGfx (cur_gfx)) { fprintf (stderr, "GAL: Init GAL engine failure.\n"); return ERR_GFX_ENGINE; } printf ("GAL: Use %s engine.\n", cur_gfx->id); return 0;}void TerminateGAL (void){ GAL_TermGfx (cur_gfx);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -