/* * fontMenu * creates (and handles) a hierarchical font menu * * v. 1.00 (22 August 1991) * * © 1991-1998 Straylight */ /*----- Licensing note ----------------------------------------------------* * * This file is part of Straylight's Steel library. * * Steel is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * Steel 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Steel. If not, write to the Free Software Foundation, * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __fontMenu_h #define __fontMenu_h #ifndef __menu_h #include "menu.h" #endif #ifndef __event_h #include "event.h" #endif /* * menu fontMenu_createFontMenu(BOOL includeSystem) * * Use * Creates a hierarchical font menu and returns a handle. If the menu is * out-of-date it will be recreated, if not the old handle will be * returned. You must call this before using routines such as * fontMenu_make() (so that the system knows whether you want to use a * menu containing the system font or not). The returned pointer will be * NULL if there are no fonts. * * Parameters * BOOL includeSystem == whether you want to include a 'System font' item * * Returns * A menu handle for the menu. */ menu fontMenu_createFontMenu(BOOL includeSystem); /* * menu fontMenu(BOOL includeSystem) * * Use * Compatibility. Don't use this function. */ menu fontMenu(BOOL includeSystem); /* * char *fontMenu_fontname(int item1,int item2) * * Use * Returns the font name given by the the menu hit passed. Example code: * * switch (hit[n]) * { * ... * case FONTMENU: * { * char *fontname=fontMenu_fontname(hit[n+1],hit[n+2]); * ... * } * break; * ... * } * * Type promotion does the rest! If the hits give a silly result, then a * null string (not a null pointer!) is returned. * * You should check for the system font yourself (hit[n+1]==1). * * Parameters * int item1 == the item number in the main menu * int item2 == the item number in the submenu * * Returns * A pointer to a read-only string. */ char *fontMenu_fontname(int item1,int item2); /* * void fontMenu_submenu(BOOL includeSystem) * * Use * Opens a font menu as the submenu of another menu. * * Parameters * BOOL includeSystem == whether we need to include a system font item. */ void fontMenu_submenu(BOOL includeSystem); /* * void fontMenu_findFont(char *name,int *item1,int *item2) * * Use * Finds a font in the font list. Returns the result in two integers, * which are the menu item numbers in the main font menu and the submenu * respectively. -1 is returned as the first item number if the font * wasn't found. * * Parameters * char *name == the (case sensitive) name of the font. * int *item1 == where to store the first item number. * int *item2 == where to store the second item number. */ void fontMenu_findFont(char *name,int *item1,int *item2); /* * void fontMenu_tick(int item1,int item2) * * Use * Ticks the item specified. Only one font may be ticked at a time. If * the menu item specified is silly, no item will be ticked. No range * checking is performed. * * Parameters * int item1 == the item number in the main menu * int item2 == the item number in the submenu */ void fontMenu_tick(int item1,int item2); /* * void fontMenu_tickGivenName(char *name) * * Use * Ticks the item specified by it's name. If the name is silly, no item * will be ticked. * * Parameters * char *name == the font name to tick */ void fontMenu_tickGivenName(char *name); #endif