libyui
3.0.13
|
#include <YUI.h>
Public Member Functions | |
virtual | ~YUI () |
void | shutdownThreads () |
virtual void | blockEvents (bool block=true) |
void | unblockEvents () |
virtual bool | eventsBlocked () const |
virtual void | deleteNotify (YWidget *widget) |
void | topmostConstructorHasFinished () |
bool | runningWithThreads () const |
void | uiThreadMainLoop () |
YBuiltinCaller * | builtinCaller () const |
void | setBuiltinCaller (YBuiltinCaller *caller) |
virtual YEvent * | runPkgSelection (YWidget *packageSelector)=0 |
Static Public Member Functions | |
static YUI * | ui () |
static YWidgetFactory * | widgetFactory () |
static YOptionalWidgetFactory * | optionalWidgetFactory () |
static YApplication * | app () |
static YApplication * | application () |
static YApplication * | yApp () |
static void | ensureUICreated () |
Protected Member Functions | |
YUI (bool withThreads) | |
virtual YWidgetFactory * | createWidgetFactory ()=0 |
virtual YOptionalWidgetFactory * | createOptionalWidgetFactory ()=0 |
virtual YApplication * | createApplication ()=0 |
virtual void | idleLoop (int fd_ycp)=0 |
void | terminateUIThread () |
void | createUIThread () |
virtual void | uiThreadDestructor () |
void | signalUIThread () |
bool | waitForUIThread () |
void | signalYCPThread () |
bool | waitForYCPThread () |
void | setButtonOrderFromEnvironment () |
Protected Attributes | |
bool | _withThreads |
pthread_t | _uiThread |
YBuiltinCaller * | _builtinCaller |
int | pipe_to_ui [2] |
int | pipe_from_ui [2] |
bool | _terminate_ui_thread |
bool | _eventsBlocked |
Friends | |
class | YUIFunction |
class | YUITerminator |
void * | start_ui_thread (void *ui_int) |
|
virtual |
|
static |
Return the global YApplication object.
This will create the YApplication upon the first call and return a pointer to the one and only (singleton) YApplication upon each subsequent call. This may throw exceptions if the YApplication cannot be created.
Definition at line 156 of file YUI.cc.
|
inlinestatic |
Aliases for YUI::app()
Definition at line 112 of file YUI.h.
|
inlinevirtual |
Block (or unblock) events. If events are blocked, any event sent should be ignored until events are unblocked again.
This default implementation keeps track of a simple internal flag that can be queried with eventsBlocked(), so if you reimplement blockEvents(), be sure to reimplement eventsBlocked() as well.
|
inline |
|
protectedpure virtual |
Create the YApplication object that provides global methods.
Derived classes are required to implement this.
|
protectedpure virtual |
Create the widget factory that provides all the createXY() methods for optional ("special") widgets and the corresponding hasXYWidget() methods.
Derived classes are required to implement this.
|
protected |
|
protectedpure virtual |
Create the widget factory that provides all the createXY() methods for standard (mandatory, i.e. non-optional) widgets.
Derived classes are required to implement this.
|
inlinevirtual |
|
static |
|
inlinevirtual |
Returns 'true' if events are currently blocked.
Reimplement this if you reimplement blockEvents().
|
protectedpure virtual |
This virtual method is called when threads are activated in case the execution control is currently on the side of the module. This means that no UserInput() or PollInput() is pending. The module just does some work. The UI <-> module protocol is in the "UI waits for the next command" state. The UI can override this method when it wants to react to user input or other external events such as repaint requests from the X server.
'fd_ycp' file descriptor that should be used to determine when to leave the idle loop. As soon as it is readable, the loop must be left. In order to avoid polling you can combine it with other ui-specific fds and do a common select() call.
|
static |
Return the widget factory that provides all the createXY() methods for optional ("special") widgets and the corresponding hasXYWidget() methods.
This will create the factory upon the first call and return a pointer to the one and only (singleton) factory upon each subsequent call. This may throw exceptions if the factory cannot be created.
Definition at line 141 of file YUI.cc.
|
inline |
UI-specific runPkgSelection method.
Derived classes are required to implement this.
The packageSelector's dialog will take care of the event and delete it when appropriate. The returned pointer is valid until the next call to YDialog::userInput(), YDialog::pollInput(), or YUI::runPkgSelection() or until the dialog with the packageSelector is destroyed.
|
inline |
Set the transparent inter-thread communication. Built-ins are only really called if there is a valid YBuiltinCaller set.
|
protected |
Set the button order (in YButtonBox widgets) from environment variables:
$Y2_BUTTON_ORDER="KDE" $Y2_BUTTON_ORDER="Gnome"
(all case insensitive)
Definition at line 386 of file YUI.cc.
void YUI::shutdownThreads | ( | ) |
|
protected |
|
protected |
|
protected |
void YUI::topmostConstructorHasFinished | ( | ) |
|
static |
|
protectedvirtual |
void YUI::uiThreadMainLoop | ( | ) |
This method implements the UI thread in case it is existing. The loop consists of calling idleLoop, getting the next command from the YCPUIComponent, evaluating it, which possibly invovles calling userInput() or pollInput() and writes the answer back to the other thread where the request came from.
Definition at line 353 of file YUI.cc.
|
inline |
|
protected |
|
protected |
|
static |
Return the widget factory that provides all the createXY() methods for standard (mandatory, i.e. non-optional) widgets.
This will create the factory upon the first call and return a pointer to the one and only (singleton) factory upon each subsequent call. This may throw exceptions if the factory cannot be created.
Definition at line 126 of file YUI.cc.
|
protected |
Inter-thread communication between the YCP thread and the UI thread: The YCP thread supplies data here and signals the UI thread, the UI thread picks up the data, executes the function, puts the result here and signals the YCP thread that waits until the result is available.
|
protected |
Flag that keeps track of blocked events. Never query this directly, use eventsBlocked() instead.
|
protected |
|
protected |
|
protected |
|
protected |