2007-01-18 13:40:37 +03:00
|
|
|
//
|
|
|
|
// Event names header file for the Fast Light Tool Kit (FLTK).
|
|
|
|
//
|
2023-01-15 13:00:48 +03:00
|
|
|
// Copyright 1998-2023 by Bill Spitzak and others.
|
2007-01-18 13:40:37 +03:00
|
|
|
//
|
2011-07-19 08:49:30 +04:00
|
|
|
// This library is free software. Distribution and use rights are outlined in
|
|
|
|
// the file "COPYING" which should have been included with this file. If this
|
|
|
|
// file is missing or damaged, see the license at:
|
2007-01-18 13:40:37 +03:00
|
|
|
//
|
2020-07-01 19:03:10 +03:00
|
|
|
// https://www.fltk.org/COPYING.php
|
2007-01-18 13:40:37 +03:00
|
|
|
//
|
2020-07-01 19:03:10 +03:00
|
|
|
// Please see the following page on how to report bugs and issues:
|
2007-01-18 13:40:37 +03:00
|
|
|
//
|
2020-07-01 19:03:10 +03:00
|
|
|
// https://www.fltk.org/bugs.php
|
2007-01-18 13:40:37 +03:00
|
|
|
//
|
|
|
|
|
2008-03-27 20:59:44 +03:00
|
|
|
// Thanks to Greg Ercolano for this addition.
|
2007-01-18 13:40:37 +03:00
|
|
|
|
2023-01-15 13:00:48 +03:00
|
|
|
/**
|
|
|
|
\file names.h
|
|
|
|
This file defines arrays of human readable names for FLTK symbolic constants.
|
|
|
|
*/
|
|
|
|
|
2007-01-18 15:11:02 +03:00
|
|
|
#ifndef FL_NAMES_H
|
|
|
|
#define FL_NAMES_H
|
|
|
|
|
2010-02-26 20:25:32 +03:00
|
|
|
/** \defgroup fl_events Events handling functions
|
|
|
|
@{
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
This is an array of event names you can use to convert event numbers into names.
|
|
|
|
|
2010-02-26 21:10:54 +03:00
|
|
|
The array gets defined inline wherever your '\#include <FL/names.h>' appears.
|
2010-02-26 20:25:32 +03:00
|
|
|
|
|
|
|
\b Example:
|
|
|
|
\code
|
2020-07-01 19:03:10 +03:00
|
|
|
#include <FL/names.h> // array will be defined here
|
2010-02-26 20:49:19 +03:00
|
|
|
int MyClass::handle(int e) {
|
2010-02-26 20:25:32 +03:00
|
|
|
printf("Event was %s (%d)\n", fl_eventnames[e], e);
|
2010-02-26 20:49:19 +03:00
|
|
|
// ..resulting output might be e.g. "Event was FL_PUSH (1)"..
|
2010-02-26 20:25:32 +03:00
|
|
|
[..]
|
|
|
|
}
|
|
|
|
\endcode
|
|
|
|
*/
|
2009-04-01 02:41:10 +04:00
|
|
|
const char * const fl_eventnames[] =
|
2007-01-18 13:40:37 +03:00
|
|
|
{
|
|
|
|
"FL_NO_EVENT",
|
|
|
|
"FL_PUSH",
|
|
|
|
"FL_RELEASE",
|
|
|
|
"FL_ENTER",
|
|
|
|
"FL_LEAVE",
|
|
|
|
"FL_DRAG",
|
|
|
|
"FL_FOCUS",
|
|
|
|
"FL_UNFOCUS",
|
|
|
|
"FL_KEYDOWN",
|
|
|
|
"FL_KEYUP",
|
|
|
|
"FL_CLOSE",
|
|
|
|
"FL_MOVE",
|
|
|
|
"FL_SHORTCUT",
|
|
|
|
"FL_DEACTIVATE",
|
|
|
|
"FL_ACTIVATE",
|
|
|
|
"FL_HIDE",
|
|
|
|
"FL_SHOW",
|
|
|
|
"FL_PASTE",
|
|
|
|
"FL_SELECTIONCLEAR",
|
|
|
|
"FL_MOUSEWHEEL",
|
|
|
|
"FL_DND_ENTER",
|
|
|
|
"FL_DND_DRAG",
|
|
|
|
"FL_DND_LEAVE",
|
|
|
|
"FL_DND_RELEASE",
|
2011-10-10 12:34:27 +04:00
|
|
|
"FL_SCREEN_CONFIGURATION_CHANGED",
|
2015-07-23 02:34:32 +03:00
|
|
|
"FL_FULLSCREEN",
|
|
|
|
"FL_ZOOM_GESTURE",
|
2018-08-08 23:08:10 +03:00
|
|
|
"FL_ZOOM_EVENT",
|
2023-08-05 17:37:38 +03:00
|
|
|
"FL_EVENT_28", // not yet defined, just in case it /will/ be defined ...
|
2016-11-19 04:20:53 +03:00
|
|
|
"FL_EVENT_29", // not yet defined, just in case it /will/ be defined ...
|
2023-08-05 17:37:38 +03:00
|
|
|
"FL_EVENT_30" // not yet defined, just in case it /will/ be defined ...
|
2007-01-18 13:40:37 +03:00
|
|
|
};
|
2007-01-18 15:11:02 +03:00
|
|
|
|
2010-02-26 20:25:32 +03:00
|
|
|
/**
|
|
|
|
This is an array of font names you can use to convert font numbers into names.
|
|
|
|
|
2010-02-26 21:10:54 +03:00
|
|
|
The array gets defined inline wherever your '\#include <FL/names.h>' appears.
|
2010-02-26 20:25:32 +03:00
|
|
|
|
|
|
|
\b Example:
|
|
|
|
\code
|
2020-07-01 19:03:10 +03:00
|
|
|
#include <FL/names.h> // array will be defined here
|
2010-02-26 20:49:19 +03:00
|
|
|
int MyClass::my_callback(Fl_Widget *w, void*) {
|
2010-02-26 20:25:32 +03:00
|
|
|
int fnum = w->labelfont();
|
|
|
|
// Resulting output might be e.g. "Label's font is FL_HELVETICA (0)"
|
|
|
|
printf("Label's font is %s (%d)\n", fl_fontnames[fnum], fnum);
|
2010-02-26 20:49:19 +03:00
|
|
|
// ..resulting output might be e.g. "Label's font is FL_HELVETICA (0)"..
|
2010-02-26 20:25:32 +03:00
|
|
|
[..]
|
|
|
|
}
|
|
|
|
\endcode
|
|
|
|
*/
|
2009-04-01 02:41:10 +04:00
|
|
|
const char * const fl_fontnames[] =
|
2007-01-18 15:11:02 +03:00
|
|
|
{
|
|
|
|
"FL_HELVETICA",
|
|
|
|
"FL_HELVETICA_BOLD",
|
|
|
|
"FL_HELVETICA_ITALIC",
|
|
|
|
"FL_HELVETICA_BOLD_ITALIC",
|
|
|
|
"FL_COURIER",
|
|
|
|
"FL_COURIER_BOLD",
|
|
|
|
"FL_COURIER_ITALIC",
|
|
|
|
"FL_COURIER_BOLD_ITALIC",
|
|
|
|
"FL_TIMES",
|
|
|
|
"FL_TIMES_BOLD",
|
|
|
|
"FL_TIMES_ITALIC",
|
|
|
|
"FL_TIMES_BOLD_ITALIC",
|
|
|
|
"FL_SYMBOL",
|
|
|
|
"FL_SCREEN",
|
|
|
|
"FL_SCREEN_BOLD",
|
|
|
|
"FL_ZAPF_DINGBATS",
|
|
|
|
};
|
|
|
|
|
2023-01-05 15:51:30 +03:00
|
|
|
/**
|
|
|
|
This is an array of callback reason names you can use to convert font numbers into names.
|
|
|
|
|
|
|
|
The array gets defined inline wherever your '\#include <FL/names.h>' appears.
|
|
|
|
*/
|
|
|
|
const char * const fl_callback_reason_names[] =
|
|
|
|
{
|
|
|
|
"FL_REASON_UNKNOWN",
|
|
|
|
"FL_REASON_SELECTED",
|
|
|
|
"FL_REASON_DESELECTED",
|
|
|
|
"FL_REASON_RESELECTED",
|
|
|
|
"FL_REASON_OPENED",
|
|
|
|
"FL_REASON_CLOSED",
|
|
|
|
"FL_REASON_DRAGGED",
|
|
|
|
"FL_REASON_CANCELLED",
|
|
|
|
"FL_REASON_CHANGED",
|
|
|
|
"FL_REASON_GOT_FOCUS",
|
|
|
|
"FL_REASON_LOST_FOCUS",
|
|
|
|
"FL_REASON_RELEASED",
|
|
|
|
};
|
|
|
|
|
2010-02-26 20:25:32 +03:00
|
|
|
/** @} */
|
|
|
|
|
2007-01-18 15:11:02 +03:00
|
|
|
#endif /* FL_NAMES_H */
|