/* Terminality - a portable terminal handling library * Copyright (C) 1998-2002, Emil Mikulic. * This is LGPL - look at COPYING.LIB */ /* Project: Terminality * File: tn.c * Author: Emil Mikulic * Description: Provide a wrapper around different Terminality frontends */ /* TN interface */ #include "tn.h" #include "keyhndl.h" #include "register.h" #include "elements.h" const char tn_rcsid[] = "$Id: tn.c,v 1.12 2002/07/26 08:18:13 darkmoon Exp $"; /* COLOR array */ int COLOR[16][8]; /* Global cursor */ cursor glb_cursor = none; /* Updates */ static int update_enabled = 1; /* Platform-dependent includes */ #ifdef __unix # include "tn_c_nc.h" #endif #ifdef _WIN32 # include "tn_c_w32.h" #endif /* Safeguard */ #ifndef TN_C_IMPLEMENTED # error Unrecognised platform #endif /* Enable / disable screen updates */ int update_set(int want) { int old = update_enabled; update_enabled = want; return old; } /* Color scheme functions & vars: */ #include "dscheme.h" color *colorscheme = default_color_scheme; /* Returns color by constant */ color get_scheme_color(int name) { assert(MAX_SCHEME_COLOR_NUM == DEFAULT_SCHEME_COLORS); if (name<0 || name>MAX_SCHEME_COLOR_NUM) return 0; return colorscheme[name]; } /* Sets color scheme */ void set_scheme(color *scheme) { colorscheme = scheme; elements_change_scheme(); elements_redraw(0); } /* Sets default color scheme */ void default_scheme(void) { colorscheme = default_color_scheme; elements_change_scheme(); elements_redraw(0); } /* Gets cursor */ cursor get_cursor(void) { return glb_cursor; }