Skip to content
Snippets Groups Projects
Commit 29e57691 authored by Lars Kanis's avatar Lars Kanis
Browse files

Release GVL for all FXApp#run* methods.

parent 9084a330
No related branches found
No related tags found
No related merge requests found
......@@ -41,6 +41,30 @@ inline void cls ## _create(cls *self){ \
inline FXint cls ## _run_gvl(cls *self){ \
return self->cls::run(); \
} \
inline FXint cls ## _runOneEvent_gvl(cls *self, bool blocking=true){ \
return self->cls::runOneEvent(blocking); \
} \
inline FXint cls ## _runUntil_gvl(cls *self, FXuint& condition){ \
return self->cls::runUntil(condition); \
} \
inline FXint cls ## _runWhileEvents_gvl(cls *self){ \
return self->cls::runWhileEvents(); \
} \
inline FXint cls ## _runModalWhileEvents_gvl(cls *self, FXWindow* window=NULL){ \
return self->cls::runModalWhileEvents(window); \
} \
inline FXint cls ## _runModal_gvl(cls *self){ \
return self->cls::runModal(); \
} \
inline FXint cls ## _runModalFor_gvl(cls *self, FXWindow* window){ \
return self->cls::runModalFor(window); \
} \
inline FXint cls ## _runModalWhileShown_gvl(cls *self, FXWindow* window){ \
return self->cls::runModalWhileShown(window); \
} \
inline FXint cls ## _runPopup_gvl(cls *self, FXWindow* owner){ \
return self->cls::runPopup(owner); \
} \
static void cls ## _init(cls* self,VALUE ary,bool connect){ \
int i; \
char **argv; \
......@@ -65,7 +89,6 @@ inline void cls ## _exit(cls *self,FXint code){ \
self->cls::exit(code); \
}
/**
* For C/C++ applications, the argument count (argc) will always be at least
* one, and the first element of the argument array (argv[0]) will contain
......
......@@ -154,6 +154,30 @@ extern __thread int g_fxrb_thread_has_gvl;
#define FOR_EACH_PARAM_OF_FXApp_run(param)
#define FOR_EACH_PARAM_OF_FXApp_runOneEvent(param) \
param(bool, , blocking)
#define FOR_EACH_PARAM_OF_FXApp_runUntil(param) \
param(FXuint, &, condition)
#define FOR_EACH_PARAM_OF_FXApp_runWhileEvents(param)
#define FOR_EACH_PARAM_OF_FXApp_runModalWhileEvents(param) \
param(FXWindow*, , window)
#define FOR_EACH_PARAM_OF_FXApp_runModal(param)
#define FOR_EACH_PARAM_OF_FXApp_runModalFor(param) \
param(FXWindow*, , window)
#define FOR_EACH_PARAM_OF_FXApp_runModalWhileShown(param) \
param(FXWindow*, , window)
#define FOR_EACH_PARAM_OF_FXApp_runPopup(param) \
param(FXWindow*, , owner)
/* function( class, name, baseclass, void_or_nonvoid, returntype, firstparamtype, firstparamname ) */
#define FOR_EACH_BLOCKING_FUNCTION(function) \
function(FXImage, loadPixels, FXImage, GVL_TYPE_NONVOID, bool, FXImage *, self) \
......@@ -222,6 +246,14 @@ extern __thread int g_fxrb_thread_has_gvl;
function(FXSearchDialog, execute, FXDialogBox, GVL_TYPE_NONVOID, FXuint, FXSearchDialog *, self) \
function(FXWizard, execute, FXDialogBox, GVL_TYPE_NONVOID, FXuint, FXWizard *, self) \
function(FXApp, run, FXApp, GVL_TYPE_NONVOID, FXint, FXApp *, self) \
function(FXApp, runOneEvent, FXApp, GVL_TYPE_NONVOID, bool, FXApp *, self) \
function(FXApp, runUntil, FXApp, GVL_TYPE_NONVOID, FXint, FXApp *, self) \
function(FXApp, runWhileEvents, FXApp, GVL_TYPE_NONVOID, FXint, FXApp *, self) \
function(FXApp, runModalWhileEvents, FXApp, GVL_TYPE_NONVOID, FXint, FXApp *, self) \
function(FXApp, runModal, FXApp, GVL_TYPE_NONVOID, FXint, FXApp *, self) \
function(FXApp, runModalFor, FXApp, GVL_TYPE_NONVOID, FXint, FXApp *, self) \
function(FXApp, runModalWhileShown, FXApp, GVL_TYPE_NONVOID, FXint, FXApp *, self) \
function(FXApp, runPopup, FXApp, GVL_TYPE_NONVOID, FXint, FXApp *, self) \
......
......@@ -394,56 +394,6 @@ public:
/// Peek to determine if there's an event
bool peekEvent();
/// Perform one event dispatch; return true if event was dispatched
bool runOneEvent(bool blocking=true);
/**
* Run an event loop till some flag becomes non-zero, and
* then return.
*/
FXint runUntil(FXuint& condition); // FIXME
/**
* Run event loop while events are available, non-modally.
* Return when no more events, timers, or chores are outstanding.
*/
FXint runWhileEvents();
/**
* Run event loop while there are events are available in the queue.
* Returns 1 when all events in the queue have been handled, and 0 when
* the event loop was terminated due to stop() or stopModal().
* Except for the modal window and its children, user input to all windows
* is blocked; if the modal window is NULL, all user input is blocked.
*/
FXint runModalWhileEvents(FXWindow* window=NULL);
/**
* Run modal event loop, blocking keyboard and mouse events to all windows
* until stopModal is called.
*/
FXint runModal();
/**
* Run a modal event loop for the given window, until stop() or stopModal() is
* called. Except for the modal window and its children, user input to all
* windows is blocked; if the modal window is NULL all user input is blocked.
*/
FXint runModalFor(FXWindow* window);
/**
* Run modal while window is shown, or until stop() or stopModal() is called.
* Except for the modal window and its children, user input to all windows
* is blocked; if the modal window is NULL all user input is blocked.
*/
FXint runModalWhileShown(FXWindow* window);
/**
* Run popup menu while shown, until stop() or stopModal() is called.
* Also returns when entering previous cascading popup menu.
*/
FXint runPopup(FXWindow* owner);
/// True if the window is modal
bool isModal(FXWindow* window) const;
......
......@@ -31,8 +31,62 @@
/// Detach application's windows
virtual void detach();
/**
* Run the main application event loop until stop() is called,
* and return the exit code passed as argument to stop().
*/
FXint run();
/// Perform one event dispatch; return true if event was dispatched
bool runOneEvent(bool blocking=true);
/**
* Run an event loop till some flag becomes non-zero, and
* then return.
*/
FXint runUntil(FXuint& condition); // FIXME
/**
* Run event loop while events are available, non-modally.
* Return when no more events, timers, or chores are outstanding.
*/
FXint runWhileEvents();
/**
* Run event loop while there are events are available in the queue.
* Returns 1 when all events in the queue have been handled, and 0 when
* the event loop was terminated due to stop() or stopModal().
* Except for the modal window and its children, user input to all windows
* is blocked; if the modal window is NULL, all user input is blocked.
*/
FXint runModalWhileEvents(FXWindow* window=NULL);
/**
* Run modal event loop, blocking keyboard and mouse events to all windows
* until stopModal is called.
*/
FXint runModal();
/**
* Run a modal event loop for the given window, until stop() or stopModal() is
* called. Except for the modal window and its children, user input to all
* windows is blocked; if the modal window is NULL all user input is blocked.
*/
FXint runModalFor(FXWindow* window);
/**
* Run modal while window is shown, or until stop() or stopModal() is called.
* Except for the modal window and its children, user input to all windows
* is blocked; if the modal window is NULL all user input is blocked.
*/
FXint runModalWhileShown(FXWindow* window);
/**
* Run popup menu while shown, until stop() or stopModal() is called.
* Also returns when entering previous cascading popup menu.
*/
FXint runPopup(FXWindow* owner);
/**
* Initialize application.
* Parses and removes common command line arguments, reads the registry.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment