2 * gamelistopt.c -- Game list window for WinBoard
4 * Copyright 1995,2009 Free Software Foundation, Inc.
6 * Enhancements Copyright 2005 Alessandro Scotti
8 * ------------------------------------------------------------------------
10 * GNU XBoard is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or (at
13 * your option) any later version.
15 * GNU XBoard is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see http://www.gnu.org/licenses/. *
23 *------------------------------------------------------------------------
24 ** See the file ChangeLog for a revision history. */
39 void GLT_DeSelectList();
40 void GLT_AddToList( char *name );
41 Boolean GLT_GetFromList( int index, char *name );
49 // back-end: translation table tag id-char <-> full tag name
50 static GLT_Item GLT_ItemInfo[] = {
51 { GLT_EVENT, "Event" },
54 { GLT_ROUND, "Round" },
55 { GLT_PLAYERS, "Players" },
56 { GLT_RESULT, "Result" },
57 { GLT_WHITE_ELO, "White Rating" },
58 { GLT_BLACK_ELO, "Black Rating" },
59 { GLT_TIME_CONTROL,"Time Control" },
60 { GLT_VARIANT, "Variant" },
61 { GLT_OUT_OF_BOOK,PGN_OUT_OF_BOOK },
62 { GLT_RESULT_COMMENT, "Result Comment" }, // [HGM] rescom
68 // back-end: convert the tag id-char to a full tag name
69 char * GLT_FindItem( char id )
73 GLT_Item * list = GLT_ItemInfo;
75 while( list->id != 0 ) {
76 if( list->id == id ) {
87 // back-end: build the list of tag names
89 GLT_TagsToList( char * tags )
96 GLT_AddToList( GLT_FindItem(*pc) );
100 GLT_AddToList( "\t --- Hidden tags ---" );
105 if( strchr( tags, *pc ) == 0 ) {
106 GLT_AddToList( GLT_FindItem(*pc) );
114 // back-end: retrieve item from dialog and translate to id-char
116 GLT_ListItemToTag( int index )
121 GLT_Item * list = GLT_ItemInfo;
123 if( GLT_GetFromList(index, name) ) {
124 while( list->id != 0 ) {
125 if( strcmp( list->name, name ) == 0 ) {
137 // back-end: add items id-chars one-by-one to temp tags string
141 char * pc = lpUserGLT;
146 id = GLT_ListItemToTag( idx );
149 } while( id != '\0' );