summaryrefslogtreecommitdiff
path: root/src/fl_shortcut.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2016-02-11 12:02:36 +0000
committerMatthias Melcher <fltk@matthiasm.com>2016-02-11 12:02:36 +0000
commit50ee3bcd66c4baa6bb3388f5b955d726bfc6bdd8 (patch)
tree4b62978d21ee57df7027461b8ea2846c17308d11 /src/fl_shortcut.cxx
parenta3c0dac034c919c2714f3f129a9f5d9d26ae3de4 (diff)
Mark places that need to be refactored with // PORTME:
Searching for __APPLE, WIN32 or X11 did give me many false results. I instead marked most ifdef's that I would like to get rid of with the text // PORTME:, so they can be easily found by a global search. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11155 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/fl_shortcut.cxx')
-rw-r--r--src/fl_shortcut.cxx16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/fl_shortcut.cxx b/src/fl_shortcut.cxx
index 7cf12dd97..eda96793c 100644
--- a/src/fl_shortcut.cxx
+++ b/src/fl_shortcut.cxx
@@ -38,11 +38,11 @@
#include <FL/fl_draw.H>
#include <ctype.h>
#include "flstring.h"
-#if !defined(WIN32) && !defined(__APPLE__)
+#if !defined(WIN32) && !defined(__APPLE__) // PORTME: platform keyboard feel
#include <FL/x.H>
#endif
-#if defined(WIN32) || defined(__APPLE__)
+#if defined(WIN32) || defined(__APPLE__) // PORTME: platform keyboard feel
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement keyboard shortcut handling here"
#else
@@ -123,7 +123,7 @@ static Keyname table[] = {
{FL_Alt_R, "Alt_R"},
{FL_Delete, "Delete"}
};
-#elif defined(__APPLE__)
+#elif defined(__APPLE__) // PORTME: platform keyboard feel
static Keyname table[] = {
// v - this column contains UTF-8 characters
{' ', "Space"},
@@ -194,7 +194,7 @@ const char* fl_shortcut_label(unsigned int shortcut, const char **eom) {
if (((unsigned)fl_tolower(v))!=v) {
shortcut |= FL_SHIFT;
}
-#ifdef __APPLE__
+#ifdef __APPLE__ // PORTME: platform keyboard feel
// this column contains utf8 characters - v
if (shortcut & FL_SHIFT) {strcpy(p,"\xe2\x87\xa7"); p += 3;} // U+21E7 (upwards white arrow)
if (shortcut & FL_CTRL) {strcpy(p,"\xe2\x8c\x83"); p += 3;} // U+2303 (up arrowhead)
@@ -205,10 +205,10 @@ const char* fl_shortcut_label(unsigned int shortcut, const char **eom) {
if (shortcut & FL_ALT) {strcpy(p,"Alt+"); p += 4;}
if (shortcut & FL_SHIFT) {strcpy(p,"Shift+"); p += 6;}
if (shortcut & FL_CTRL) {strcpy(p,"Ctrl+"); p += 5;}
-#endif // __APPLE__
+#endif // __APPLE__ // PORTME: platform keyboard feel
if (eom) *eom = p;
unsigned int key = shortcut & FL_KEY_MASK;
-#if defined(WIN32) || defined(__APPLE__) // if not X
+#if defined(WIN32) || defined(__APPLE__) // if not X // PORTME: platform keyboard feel
if (key >= FL_F && key <= FL_F_Last) {
*p++ = 'F';
if (key > FL_F+9) *p++ = (key-FL_F)/10+'0';
@@ -401,7 +401,7 @@ int Fl_Widget::test_shortcut(const char *t, const bool require_alt) {
// for menubars etc. shortcuts must work only if the Alt modifier is pressed
if (require_alt && Fl::event_state(FL_ALT)==0) return 0;
unsigned int c = fl_utf8decode(Fl::event_text(), Fl::event_text()+Fl::event_length(), 0);
-#ifdef __APPLE__
+#ifdef __APPLE__ // PORTME: platform keyboard feel
// this line makes underline shortcuts work the same way they do on MSWindow
// and Linux.
if (c && Fl::event_state(FL_ALT))
@@ -411,7 +411,7 @@ int Fl_Widget::test_shortcut(const char *t, const bool require_alt) {
unsigned int ls = label_shortcut(t);
if (c == ls)
return 1;
-#ifdef __APPLE__
+#ifdef __APPLE__ // PORTME: platform keyboard feel
// On OS X, we need to simulate the upper case keystroke as well
if (Fl::event_state(FL_ALT) && c<128 && isalpha(c) && (unsigned)toupper(c)==ls)
return 1;