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:
Matthias Melcher 2009-12-07 22:04:55 +00:00
parent 43f16de4de
commit 5bc48808b6
7 changed files with 28 additions and 28 deletions

View File

@ -124,7 +124,7 @@ protected:
\param[in] w, h size of the widget in pixels
\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. */
void x(int v) {x_ = v;}
@ -400,7 +400,7 @@ public:
/** Gets 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;}
@ -426,10 +426,10 @@ public:
\param[in] new_label the new label text
\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.
\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;}
@ -842,7 +842,7 @@ public:
/** Internal use only. */
int test_shortcut();
/** Internal use only. */
static Fl_Shortcut label_shortcut(const char *t);
static unsigned int label_shortcut(const char *t);
/** Internal use only. */
static int test_shortcut(const char*);

View File

@ -216,7 +216,7 @@ FL_EXPORT double fl_width(const char* txt, int n);
/** Return the typographical width of a single character :
\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. */
FL_EXPORT double fl_width(Fl_Char);
FL_EXPORT double fl_width(unsigned int);
/** 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
@ -441,8 +441,8 @@ FL_EXPORT int fl_measure_pixmap(const char* const* cdata, int &w, int &h);
// other:
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);
FL_EXPORT const char* fl_shortcut_label(Fl_Shortcut shortcut);
FL_EXPORT const char* fl_shortcut_label(Fl_Shortcut shortcut, const char **eom);
FL_EXPORT const char* fl_shortcut_label(unsigned int shortcut);
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_clear();
FL_EXPORT void fl_cursor(Fl_Cursor, Fl_Color fg=FL_BLACK, Fl_Color bg=FL_WHITE);

View File

@ -1247,7 +1247,7 @@ int Fl_Input_::linesPerPage() {
\param [in] i index into the value field
\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;
return fl_utf8decode(value_+i, value_+size_, &len);

View File

@ -235,7 +235,7 @@ int Fl_Menu_Item::add(
^ - Control
\endverbatim
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
The callback to invoke when this menu item is selected.

View File

@ -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;

View File

@ -49,7 +49,7 @@
\c NULL, only the length of the utf-8 sequence is calculated
\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
\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 */

View File

@ -289,7 +289,7 @@ void dobut(Fl_Widget *, long arg)
} else {
sprintf(command, "open ../../../%s.app", cmd);
}
puts(command);
// puts(command);
system(command);
free(cmd);