📄 hotspot.h
字号:
/* $Id: hotspot.h,v 1.7 2002/10/25 06:30:42 micahjd Exp $ * * pgserver/hotspot.h - This is an interface for managing hotspots. * The divtree is scanned for hotspot divnodes. * Their position is saved in a graph so it is easy * to, for example, find which hotspot is to the left * of a specified hotspot. This makes navigation with * arrow keys only possible. * * PicoGUI small and efficient client/server GUI * Copyright (C) 2000-2002 Micah Dowty <micahjd@users.sourceforge.net> * * This program 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 * of the License, or (at your option) any later version. * * This program 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 this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * Contributors: * * * */#ifndef __H_HOTSPOT#define __H_HOTSPOT#include <pgserver/divtree.h>#define HOTSPOT_LEFT 0 /* For arrow keys */#define HOTSPOT_RIGHT 1#define HOTSPOT_UP 2#define HOTSPOT_DOWN 3#define HOTSPOT_NEXT 4 /* Tab and shift-tab */#define HOTSPOT_PREV 5#define HOTSPOTNUM 6struct hotspot { /* Position */ s16 x,y; /* If this hotspot is attached to a specific divnode, this should be * a pointer to that divnode. This allows focusing and scrolling to work * automatically, but is not required. */ struct divnode *div; /* Links for the hotspot graph, indexed by direction */ struct hotspot *graph[HOTSPOTNUM]; /* Simple linked list including all hotspots */ struct hotspot *next;};/* Delete all hotspots */void hotspot_free(void);/* Hide the hotspot navigation cursor */void hotspot_hide(void);/* Add a new hotspot to the list, don't reconfigure graph */g_error hotspot_add(s16 x, s16 y, struct divnode *div);/* Recursively add hotspots for all applicable divnodes * If 'ntb' is non-NULL, only add hotspots outside it. */g_error hotspot_build(struct divnode *n, struct divnode *ntb);/* Return the closest hotspot to the given position */struct hotspot *hotspot_closest(s16 x,s16 y);/* Rebuild the hotspot graph */void hotspot_graph(void);/* This is the 'high level' hotspot function that will usually be called * by the widget code. * * It rebuilds the hotspot graph from the current divtree if necessary, finds * the hotspot closest to the mouse pointer, traverses the hotspot graph in * the indicated direction, and finds the new mouse pointer position. * * The direction is a HOTSPOT_* constant */void hotspot_traverse(short direction);/* Given a divnode, this will scroll the divnode's container so that * the divnode is completely visible. */void scroll_to_divnode(struct divnode *div);/* Return a preferred position for a hotspot within the specified divnode */void divnode_hotspot_position(struct divnode *div, int *hx, int *hy);/* Reloads global hotkey settings from the theme when it changes */void reload_hotkeys(void);extern u16 hotkey_left, hotkey_right, hotkey_up, hotkey_down;extern u16 hotkey_activate, hotkey_next;#endif /* __H_HOTSPOT *//* The End */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -