mirror of
https://github.com/fltk/fltk.git
synced 2026-05-28 03:15:21 +08:00
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
This commit is contained in:
+5
-5
@@ -124,7 +124,7 @@ protected:
|
|||||||
\param[in] w, h size of the widget in pixels
|
\param[in] w, h size of the widget in pixels
|
||||||
\param[in] label optional text for the widget label
|
\param[in] label optional text for the widget label
|
||||||
*/
|
*/
|
||||||
Fl_Widget(int x, int y, int w, int h, Fl_CString label=0L);
|
Fl_Widget(int x, int y, int w, int h, const char *label=0L);
|
||||||
|
|
||||||
/** Internal use only. Use position(int,int), size(int,int) or resize(int,int,int,int) instead. */
|
/** Internal use only. Use position(int,int), size(int,int) or resize(int,int,int,int) instead. */
|
||||||
void x(int v) {x_ = v;}
|
void x(int v) {x_ = v;}
|
||||||
@@ -400,7 +400,7 @@ public:
|
|||||||
|
|
||||||
/** Gets the current label text.
|
/** Gets the current label text.
|
||||||
\return a pointer to the current label text
|
\return a pointer to the current label text
|
||||||
\see label(Fl_CString), copy_label(Fl_CString)
|
\see label(const char *), copy_label(const char *)
|
||||||
*/
|
*/
|
||||||
const char* label() const {return label_.value;}
|
const char* label() const {return label_.value;}
|
||||||
|
|
||||||
@@ -426,10 +426,10 @@ public:
|
|||||||
\param[in] new_label the new label text
|
\param[in] new_label the new label text
|
||||||
\see label()
|
\see label()
|
||||||
*/
|
*/
|
||||||
void copy_label(Fl_CString new_label);
|
void copy_label(const char *new_label);
|
||||||
|
|
||||||
/** Shortcut to set the label text and type in one call.
|
/** Shortcut to set the label text and type in one call.
|
||||||
\see label(FL_CString), labeltype(Fl_Labeltype)
|
\see label(const char *), labeltype(Fl_Labeltype)
|
||||||
*/
|
*/
|
||||||
void label(Fl_Labeltype a, const char* b) {label_.type = a; label_.value = b;}
|
void label(Fl_Labeltype a, const char* b) {label_.type = a; label_.value = b;}
|
||||||
|
|
||||||
@@ -842,7 +842,7 @@ public:
|
|||||||
/** Internal use only. */
|
/** Internal use only. */
|
||||||
int test_shortcut();
|
int test_shortcut();
|
||||||
/** Internal use only. */
|
/** Internal use only. */
|
||||||
static Fl_Shortcut label_shortcut(const char *t);
|
static unsigned int label_shortcut(const char *t);
|
||||||
/** Internal use only. */
|
/** Internal use only. */
|
||||||
static int test_shortcut(const char*);
|
static int test_shortcut(const char*);
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -216,7 +216,7 @@ FL_EXPORT double fl_width(const char* txt, int n);
|
|||||||
/** Return the typographical width of a single character :
|
/** Return the typographical width of a single character :
|
||||||
\note if a valid fl_gc is NOT found then it uses the first window gc,
|
\note if a valid fl_gc is NOT found then it uses the first window gc,
|
||||||
or the screen gc if no fltk window is available when called. */
|
or the screen gc if no fltk window is available when called. */
|
||||||
FL_EXPORT double fl_width(Fl_Char);
|
FL_EXPORT double fl_width(unsigned int);
|
||||||
/** Determine the minimum pixel dimensions of a nul-terminated string.
|
/** Determine the minimum pixel dimensions of a nul-terminated string.
|
||||||
|
|
||||||
Usage: given a string "txt" drawn using fl_draw(txt, x, y) you would determine
|
Usage: given a string "txt" drawn using fl_draw(txt, x, y) you would determine
|
||||||
@@ -441,8 +441,8 @@ FL_EXPORT int fl_measure_pixmap(const char* const* cdata, int &w, int &h);
|
|||||||
// other:
|
// other:
|
||||||
FL_EXPORT void fl_scroll(int X, int Y, int W, int H, int dx, int dy,
|
FL_EXPORT void fl_scroll(int X, int Y, int W, int H, int dx, int dy,
|
||||||
void (*draw_area)(void*, int,int,int,int), void* data);
|
void (*draw_area)(void*, int,int,int,int), void* data);
|
||||||
FL_EXPORT const char* fl_shortcut_label(Fl_Shortcut shortcut);
|
FL_EXPORT const char* fl_shortcut_label(unsigned int shortcut);
|
||||||
FL_EXPORT const char* fl_shortcut_label(Fl_Shortcut shortcut, const char **eom);
|
FL_EXPORT const char* fl_shortcut_label(unsigned int shortcut, const char **eom);
|
||||||
FL_EXPORT void fl_overlay_rect(int x,int y,int w,int h);
|
FL_EXPORT void fl_overlay_rect(int x,int y,int w,int h);
|
||||||
FL_EXPORT void fl_overlay_clear();
|
FL_EXPORT void fl_overlay_clear();
|
||||||
FL_EXPORT void fl_cursor(Fl_Cursor, Fl_Color fg=FL_BLACK, Fl_Color bg=FL_WHITE);
|
FL_EXPORT void fl_cursor(Fl_Cursor, Fl_Color fg=FL_BLACK, Fl_Color bg=FL_WHITE);
|
||||||
|
|||||||
+1
-1
@@ -1247,7 +1247,7 @@ int Fl_Input_::linesPerPage() {
|
|||||||
\param [in] i index into the value field
|
\param [in] i index into the value field
|
||||||
\return the character at index \p i
|
\return the character at index \p i
|
||||||
*/
|
*/
|
||||||
Fl_Char Fl_Input_::index(int i) const
|
unsigned int Fl_Input_::index(int i) const
|
||||||
{
|
{
|
||||||
int len = 0;
|
int len = 0;
|
||||||
return fl_utf8decode(value_+i, value_+size_, &len);
|
return fl_utf8decode(value_+i, value_+size_, &len);
|
||||||
|
|||||||
+1
-1
@@ -235,7 +235,7 @@ int Fl_Menu_Item::add(
|
|||||||
^ - Control
|
^ - Control
|
||||||
\endverbatim
|
\endverbatim
|
||||||
Text shortcuts are converted to integer shortcut by calling
|
Text shortcuts are converted to integer shortcut by calling
|
||||||
Fl_Shortcut fl_old_shortcut(const char*).
|
unsigned int fl_old_shortcut(const char*).
|
||||||
|
|
||||||
\par callback
|
\par callback
|
||||||
The callback to invoke when this menu item is selected.
|
The callback to invoke when this menu item is selected.
|
||||||
|
|||||||
+15
-15
@@ -58,10 +58,10 @@
|
|||||||
be confused with
|
be confused with
|
||||||
Fl_Widget::test_shortcut().
|
Fl_Widget::test_shortcut().
|
||||||
*/
|
*/
|
||||||
int Fl::test_shortcut(Fl_Shortcut shortcut) {
|
int Fl::test_shortcut(unsigned int shortcut) {
|
||||||
if (!shortcut) return 0;
|
if (!shortcut) return 0;
|
||||||
|
|
||||||
Fl_Char v = shortcut & FL_KEY_MASK;
|
unsigned int v = shortcut & FL_KEY_MASK;
|
||||||
if (fl_tolower(v)!=v) {
|
if (fl_tolower(v)!=v) {
|
||||||
shortcut |= FL_SHIFT;
|
shortcut |= FL_SHIFT;
|
||||||
}
|
}
|
||||||
@@ -74,13 +74,13 @@ int Fl::test_shortcut(Fl_Shortcut shortcut) {
|
|||||||
// these three must always be correct:
|
// these three must always be correct:
|
||||||
if (mismatch&(FL_META|FL_ALT|FL_CTRL)) return 0;
|
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 shift is also correct, check for exactly equal keysyms:
|
||||||
if (!(mismatch&(FL_SHIFT)) && key == Fl::event_key()) return 1;
|
if (!(mismatch&(FL_SHIFT)) && key == Fl::event_key()) return 1;
|
||||||
|
|
||||||
// try matching utf8, ignore shift:
|
// 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;
|
if (key==firstChar) return 1;
|
||||||
|
|
||||||
// kludge so that Ctrl+'_' works (as opposed to Ctrl+'^_'):
|
// 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
|
\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
|
\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);
|
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] 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
|
\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
|
\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];
|
static char buf[20];
|
||||||
char *p = buf;
|
char *p = buf;
|
||||||
if (eom) *eom = p;
|
if (eom) *eom = p;
|
||||||
if (!shortcut) {*p = 0; return buf;}
|
if (!shortcut) {*p = 0; return buf;}
|
||||||
// fix upper case shortcuts
|
// fix upper case shortcuts
|
||||||
Fl_Char v = shortcut & FL_KEY_MASK;
|
unsigned int v = shortcut & FL_KEY_MASK;
|
||||||
if (fl_tolower(v)!=v) {
|
if (fl_tolower(v)!=v) {
|
||||||
shortcut |= FL_SHIFT;
|
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;}
|
if (shortcut & FL_CTRL) {strcpy(p,"Ctrl+"); p += 5;}
|
||||||
#endif // __APPLE__
|
#endif // __APPLE__
|
||||||
if (eom) *eom = p;
|
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 defined(WIN32) || defined(__APPLE__) // if not X
|
||||||
if (key >= FL_F && key <= FL_F_Last) {
|
if (key >= FL_F && key <= FL_F_Last) {
|
||||||
*p++ = 'F';
|
*p++ = 'F';
|
||||||
@@ -270,9 +270,9 @@ const char* fl_shortcut_label(Fl_Shortcut shortcut, const char **eom) {
|
|||||||
/**
|
/**
|
||||||
Emulation of XForms named shortcuts.
|
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;
|
if (!s || !*s) return 0;
|
||||||
Fl_Shortcut n = 0;
|
unsigned int n = 0;
|
||||||
if (*s == '#') {n |= FL_ALT; s++;}
|
if (*s == '#') {n |= FL_ALT; s++;}
|
||||||
if (*s == '+') {n |= FL_SHIFT; s++;}
|
if (*s == '+') {n |= FL_SHIFT; s++;}
|
||||||
if (*s == '^') {n |= FL_CTRL; 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:
|
// 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;
|
if (!t) return 0;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (*t==0) return 0;
|
if (*t==0) return 0;
|
||||||
if (*t=='&') {
|
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;
|
if (s==0) return 0;
|
||||||
else if (s==(Fl_Char)'&') t++;
|
else if (s==(unsigned int)'&') t++;
|
||||||
else return s;
|
else return s;
|
||||||
}
|
}
|
||||||
t++;
|
t++;
|
||||||
@@ -302,7 +302,7 @@ int Fl_Widget::test_shortcut(const char *t) {
|
|||||||
if (Fl::event_state(FL_ALT)==0) return 0;
|
if (Fl::event_state(FL_ALT)==0) return 0;
|
||||||
#endif
|
#endif
|
||||||
if (!t) return 0;
|
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) return 0;
|
||||||
if (c == label_shortcut(t))
|
if (c == label_shortcut(t))
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
+2
-2
@@ -49,7 +49,7 @@
|
|||||||
\c NULL, only the length of the utf-8 sequence is calculated
|
\c NULL, only the length of the utf-8 sequence is calculated
|
||||||
\return length of the sequence in bytes
|
\return length of the sequence in bytes
|
||||||
*/
|
*/
|
||||||
/* FL_EXPORT int fl_unichar_to_utf8(Fl_Char uc, char *text); */
|
/* FL_EXPORT int fl_unichar_to_utf8(unsigned int uc, char *text); */
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
@@ -63,7 +63,7 @@
|
|||||||
\param[in] uc Unicode character
|
\param[in] uc Unicode character
|
||||||
\return length of the sequence in bytes
|
\return length of the sequence in bytes
|
||||||
*/
|
*/
|
||||||
/* FL_EXPORT int fl_utf8_size(Fl_Char uc); */
|
/* FL_EXPORT int fl_utf8_size(unsigned int uc); */
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
#endif /* 0 */
|
#endif /* 0 */
|
||||||
|
|||||||
+1
-1
@@ -289,7 +289,7 @@ void dobut(Fl_Widget *, long arg)
|
|||||||
} else {
|
} else {
|
||||||
sprintf(command, "open ../../../%s.app", cmd);
|
sprintf(command, "open ../../../%s.app", cmd);
|
||||||
}
|
}
|
||||||
puts(command);
|
// puts(command);
|
||||||
system(command);
|
system(command);
|
||||||
|
|
||||||
free(cmd);
|
free(cmd);
|
||||||
|
|||||||
Reference in New Issue
Block a user