diff options
| -rw-r--r-- | src/Fl.cxx | 130 |
1 files changed, 69 insertions, 61 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx index 25b6b696f..78b954852 100644 --- a/src/Fl.cxx +++ b/src/Fl.cxx @@ -119,29 +119,29 @@ bool Fl::cfg_sys_win32 = 0; Fl_Widget *fl_selection_requestor; #ifndef FL_DOXYGEN -Fl_Widget *Fl::belowmouse_, - *Fl::pushed_, - *Fl::focus_, - *Fl::selection_owner_; -int Fl::damage_, - Fl::e_number, - Fl::e_x, - Fl::e_y, - Fl::e_x_root, - Fl::e_y_root, - Fl::e_dx, - Fl::e_dy, - Fl::e_state, - Fl::e_clicks, - Fl::e_is_click, - Fl::e_keysym, - Fl::e_original_keysym, - Fl::scrollbar_size_ = 16; - -char *Fl::e_text = (char *)""; -int Fl::e_length; -const char* Fl::e_clipboard_type = ""; -void * Fl::e_clipboard_data = NULL; +Fl_Widget *Fl::belowmouse_, + *Fl::pushed_, + *Fl::focus_, + *Fl::selection_owner_; +int Fl::damage_, + Fl::e_number, + Fl::e_x, + Fl::e_y, + Fl::e_x_root, + Fl::e_y_root, + Fl::e_dx, + Fl::e_dy, + Fl::e_state, + Fl::e_clicks, + Fl::e_is_click, + Fl::e_keysym, + Fl::e_original_keysym, + Fl::scrollbar_size_ = 16; + +char *Fl::e_text = (char *) ""; +int Fl::e_length; +const char *Fl::e_clipboard_type = ""; +void *Fl::e_clipboard_data = NULL; Fl_Event_Dispatch Fl::e_dispatch = 0; @@ -149,10 +149,10 @@ unsigned char Fl::options_[] = { 0, 0 }; unsigned char Fl::options_read_ = 0; -Fl_Window *fl_xfocus = NULL; // which window X thinks has focus -Fl_Window *fl_xmousewin;// which window X thinks has FL_ENTER -Fl_Window *Fl::grab_; // most recent Fl::grab() -Fl_Window *Fl::modal_; // topmost modal() window +Fl_Window *fl_xfocus = NULL; // which window X thinks has focus +Fl_Window *fl_xmousewin; // which window X thinks has FL_ENTER +Fl_Window *Fl::grab_; // most recent Fl::grab() +Fl_Window *Fl::modal_; // topmost modal() window #endif // FL_DOXYGEN @@ -186,7 +186,7 @@ Fl_System_Driver *Fl::system_driver() Returns the compiled-in value of the FL_VERSION constant. This is useful for checking the version of a shared library. - \deprecated Use int Fl::api_version() instead. + \deprecated Use int Fl::api_version() instead. */ double Fl::version() { return FL_VERSION; @@ -244,8 +244,8 @@ void Fl::scrollbar_size(int W) { To find out, whether the event is inside a child widget of the current window, you can use Fl::event_inside(const Fl_Widget *). - \param[in] xx,yy,ww,hh bounding box - \return non-zero, if mouse event is inside + \param[in] xx,yy,ww,hh bounding box + \return non-zero, if mouse event is inside */ int Fl::event_inside(int xx,int yy,int ww,int hh) /*const*/ { int mx = e_x - xx; @@ -277,8 +277,8 @@ int Fl::event_inside(int xx,int yy,int ww,int hh) /*const*/ { \see Fl::event_inside(int, int, int, int) - \param[in] o child widget to be tested - \return non-zero, if mouse event is inside the widget + \param[in] o child widget to be tested + \return non-zero, if mouse event is inside the widget */ int Fl::event_inside(const Fl_Widget *o) /*const*/ { int mx = e_x - o->x(); @@ -311,8 +311,8 @@ int Fl::has_timeout(Fl_Timeout_Handler cb, void *argp) { Removes a timeout callback. It is harmless to remove a timeout callback that no longer exists. - \note This version removes all matching timeouts, not just the first one. - This may change in the future. + \note This version removes all matching timeouts, not just the first one. + This may change in the future. */ void Fl::remove_timeout(Fl_Timeout_Handler cb, void *argp) { Fl::screen_driver()->remove_timeout(cb, argp); @@ -634,7 +634,7 @@ Fl_Window* Fl::first_window() { /** Returns the next top-level window in the list of shown() windows. You can use this call to iterate through all the windows that are shown(). - \param[in] window must be shown and not NULL + \param[in] window must be shown and not NULL */ Fl_Window* Fl::next_window(const Fl_Window* window) { Fl_X* i = Fl_X::i(window)->next; @@ -984,16 +984,16 @@ void fl_fix_focus() { if (Fl::modal()) w = Fl::modal(); if (!w->contains(Fl::belowmouse())) { int old_event = Fl::e_number; - w->handle(Fl::e_number = FL_ENTER); - Fl::e_number = old_event; - if (!w->contains(Fl::belowmouse())) Fl::belowmouse(w); + w->handle(Fl::e_number = FL_ENTER); + Fl::e_number = old_event; + if (!w->contains(Fl::belowmouse())) Fl::belowmouse(w); } else { - // send a FL_MOVE event so the enter/leave state is up to date - Fl::e_x = Fl::e_x_root-fl_xmousewin->x(); - Fl::e_y = Fl::e_y_root-fl_xmousewin->y(); + // send a FL_MOVE event so the enter/leave state is up to date + Fl::e_x = Fl::e_x_root - fl_xmousewin->x(); + Fl::e_y = Fl::e_y_root - fl_xmousewin->y(); int old_event = Fl::e_number; - w->handle(Fl::e_number = FL_MOVE); - Fl::e_number = old_event; + w->handle(Fl::e_number = FL_MOVE); + Fl::e_number = old_event; } } else { Fl::belowmouse(0); @@ -1286,7 +1286,7 @@ int Fl::handle_(int e, Fl_Window* window) // "close enough". for (wi = grab() ? grab() : focus(); wi; wi = wi->parent()) { if (send_event(FL_KEYUP, wi, window)) - return 1; + return 1; } return 0; @@ -1461,7 +1461,7 @@ void Fl_Widget::redraw_label() { // FIXME: // This assumes that measure() returns the correct outline, which it does - // not in all possible cases of alignment combinedwith image and symbols. + // not in all possible cases of alignment combined with image and symbols. switch (align() & 0x0f) { case FL_ALIGN_TOP_LEFT: window()->damage(FL_DAMAGE_EXPOSE, x(), y()-H, W, H); break; @@ -1561,8 +1561,8 @@ void Fl_Widget::damage(uchar fl, int X, int Y, int W, int H) { // -static int num_dwidgets = 0, alloc_dwidgets = 0; -static Fl_Widget **dwidgets = 0; +static int num_dwidgets = 0, alloc_dwidgets = 0; +static Fl_Widget **dwidgets = 0; /** @@ -1605,7 +1605,7 @@ void Fl::delete_widget(Fl_Widget *wi) { } if (num_dwidgets >= alloc_dwidgets) { - Fl_Widget **temp; + Fl_Widget **temp; temp = new Fl_Widget *[alloc_dwidgets + 10]; if (alloc_dwidgets) { @@ -1666,19 +1666,19 @@ static int max_widget_watch = 0; Example for a button that is clicked (from its handle() method): \code - Fl_Widget *wp = this; // save 'this' in a pointer variable - Fl::watch_widget_pointer(wp); // add the pointer to the watch list - set_changed(); // set the changed flag - do_callback(); // call the callback - if (!wp) { // the widget has been deleted + Fl_Widget *wp = this; // save 'this' in a pointer variable + Fl::watch_widget_pointer(wp); // add the pointer to the watch list + set_changed(); // set the changed flag + do_callback(); // call the callback + if (!wp) { // the widget has been deleted // DO NOT ACCESS THE DELETED WIDGET ! - } else { // the widget still exists - clear_changed(); // reset the changed flag + } else { // the widget still exists + clear_changed(); // reset the changed flag } - Fl::release_widget_pointer(wp); // remove the pointer from the watch list + Fl::release_widget_pointer(wp); // remove the pointer from the watch list \endcode This works, because all widgets call Fl::clear_widget_pointer() in their @@ -1735,7 +1735,7 @@ void Fl::release_widget_pointer(Fl_Widget *&w) #ifdef DEBUG_WATCH else { // found widget pointer printf ("release_widget_pointer: (%d/%d) %8p => %8p\n", - i+1,num_widget_watch,wp,*wp); + i+1,num_widget_watch,wp,*wp); } #endif //DEBUG_WATCH } @@ -1916,10 +1916,18 @@ int Fl::dnd() #if !defined(FL_DOXYGEN) // FIXME - silence Doxygen warnings /** - Resets marked text. - - \todo Please explain what exactly this does and how to use it. -*/ + * Resets marked text. + * + * In many languages, typing a character involves multiple keystrokes. For + * example, the A-Umlaut can be composed of two dots (") on top of the + * character, followed by the letter A (on a Mac with U.S. keyboard, you'd + * type Alt-U, Shift-A. To inform the user, that the dots may be followed by + * another character, the position of the " is marked on screen with a yellow + * background color. + * + * Call this function if character composition needs to be aborted fro some + * reason. One such example would be the text input widget losing focus. + */ void Fl::reset_marked_text() { Fl::screen_driver()->reset_marked_text(); } |
