diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2009-12-07 22:04:55 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2009-12-07 22:04:55 +0000 |
| commit | 5bc48808b6aed5469c3e62e1402e10c797a5d02a (patch) | |
| tree | e8e5909aab83b58dd498df789d113d05730b02ae /src/fl_shortcut.cxx | |
| parent | 43f16de4dea0ca3589fe2088f1aa9ca2edd1b354 (diff) | |
Removed typedef that simply renamed char* to Fl_String, as discussed in the mailing list.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6955 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/fl_shortcut.cxx')
| -rw-r--r-- | src/fl_shortcut.cxx | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/fl_shortcut.cxx b/src/fl_shortcut.cxx index a189cfdba..1e07e9921 100644 --- a/src/fl_shortcut.cxx +++ b/src/fl_shortcut.cxx @@ -58,10 +58,10 @@ be confused with Fl_Widget::test_shortcut(). */ -int Fl::test_shortcut(Fl_Shortcut shortcut) { +int Fl::test_shortcut(unsigned int shortcut) { if (!shortcut) return 0; - Fl_Char v = shortcut & FL_KEY_MASK; + unsigned int v = shortcut & FL_KEY_MASK; if (fl_tolower(v)!=v) { shortcut |= FL_SHIFT; } @@ -74,13 +74,13 @@ int Fl::test_shortcut(Fl_Shortcut shortcut) { // these three must always be correct: if (mismatch&(FL_META|FL_ALT|FL_CTRL)) return 0; - Fl_Char key = shortcut & FL_KEY_MASK; + unsigned int key = shortcut & FL_KEY_MASK; // if shift is also correct, check for exactly equal keysyms: if (!(mismatch&(FL_SHIFT)) && key == Fl::event_key()) return 1; // try matching utf8, ignore shift: - Fl_Char firstChar = fl_utf8decode(Fl::event_text(), Fl::event_text()+Fl::event_length(), 0); + unsigned int firstChar = fl_utf8decode(Fl::event_text(), Fl::event_text()+Fl::event_length(), 0); if (key==firstChar) return 1; // kludge so that Ctrl+'_' works (as opposed to Ctrl+'^_'): @@ -174,7 +174,7 @@ static Keyname table[] = { \param [in] shortcut the integer value containing the ascii charcter or extended keystroke plus modifiers \return a pointer to a static buffer containing human readable text for the shortcut */ -const char* fl_shortcut_label(Fl_Shortcut shortcut) { +const char* fl_shortcut_label(unsigned int shortcut) { return fl_shortcut_label(shortcut, 0L); } @@ -184,15 +184,15 @@ const char* fl_shortcut_label(Fl_Shortcut shortcut) { \param [in] shortcut the integer value containing the ascii charcter or extended keystroke plus modifiers \param [in] eom if this pointer is set, it will receive a pointer to the end of the modifier text \return a pointer to a static buffer containing human readable text for the shortcut - \see fl_shortcut_label(Fl_Shortcut shortcut) + \see fl_shortcut_label(unsigned int shortcut) */ -const char* fl_shortcut_label(Fl_Shortcut shortcut, const char **eom) { +const char* fl_shortcut_label(unsigned int shortcut, const char **eom) { static char buf[20]; char *p = buf; if (eom) *eom = p; if (!shortcut) {*p = 0; return buf;} // fix upper case shortcuts - Fl_Char v = shortcut & FL_KEY_MASK; + unsigned int v = shortcut & FL_KEY_MASK; if (fl_tolower(v)!=v) { shortcut |= FL_SHIFT; } @@ -209,7 +209,7 @@ const char* fl_shortcut_label(Fl_Shortcut shortcut, const char **eom) { if (shortcut & FL_CTRL) {strcpy(p,"Ctrl+"); p += 5;} #endif // __APPLE__ if (eom) *eom = p; - Fl_Char key = shortcut & FL_KEY_MASK; + unsigned int key = shortcut & FL_KEY_MASK; #if defined(WIN32) || defined(__APPLE__) // if not X if (key >= FL_F && key <= FL_F_Last) { *p++ = 'F'; @@ -270,9 +270,9 @@ const char* fl_shortcut_label(Fl_Shortcut shortcut, const char **eom) { /** Emulation of XForms named shortcuts. */ -Fl_Shortcut fl_old_shortcut(const char* s) { +unsigned int fl_old_shortcut(const char* s) { if (!s || !*s) return 0; - Fl_Shortcut n = 0; + unsigned int n = 0; if (*s == '#') {n |= FL_ALT; s++;} if (*s == '+') {n |= FL_SHIFT; s++;} if (*s == '^') {n |= FL_CTRL; s++;} @@ -282,14 +282,14 @@ Fl_Shortcut fl_old_shortcut(const char* s) { // Tests for &x shortcuts in button labels: -Fl_Shortcut Fl_Widget::label_shortcut(const char *t) { +unsigned int Fl_Widget::label_shortcut(const char *t) { if (!t) return 0; for (;;) { if (*t==0) return 0; if (*t=='&') { - Fl_Shortcut s = fl_utf8decode(t+1, 0, 0); + unsigned int s = fl_utf8decode(t+1, 0, 0); if (s==0) return 0; - else if (s==(Fl_Char)'&') t++; + else if (s==(unsigned int)'&') t++; else return s; } t++; @@ -302,7 +302,7 @@ int Fl_Widget::test_shortcut(const char *t) { if (Fl::event_state(FL_ALT)==0) return 0; #endif if (!t) return 0; - Fl_Shortcut c = fl_utf8decode(Fl::event_text(), Fl::event_text()+Fl::event_length(), 0); + unsigned int c = fl_utf8decode(Fl::event_text(), Fl::event_text()+Fl::event_length(), 0); if (!c) return 0; if (c == label_shortcut(t)) return 1; |
