32 #include "YSettings.h"
50 friend class YUIFunction;
57 YUI(
bool withThreads );
271 friend void *start_ui_thread(
void *ui_int );
Author: Stefan Hundhammer sh@suse.de
Class for application-wide values and functions.
Abstract base class for transparently calling a built-in function.
A window in the desktop environment.
Abstract base class for events to be returned upon UI::UserInput() and related functions.
Abstract base class for macro player.
Abstract base class for macro recorders.
Class to load one of the concrete UI plug-ins: Qt, NCurses, Gtk.
Abstract base class of a libYUI user interface.
void topmostConstructorHasFinished()
Must be called after the constructor of the Qt/NCurses ui is ready.
YUI(bool withThreads)
Constructor.
virtual ~YUI()
Destructor.
bool runningWithThreads() const
Running with threads?
virtual void idleLoop(int fd_ycp)=0
This virtual method is called when threads are activated in case the execution control is currently o...
virtual void blockEvents(bool block=true)
Block (or unblock) events.
void unblockEvents()
Unblock events previously blocked.
static YUI * ui()
Access the global UI.
void uiThreadMainLoop()
This method implements the UI thread in case it is existing.
YBuiltinCaller * _builtinCaller
Inter-thread communication between the YCP thread and the UI thread: The YCP thread supplies data her...
bool waitForYCPThread()
Waits for the ycp thread to send one byte through the pipe to the ycp thread and reads this byte from...
int pipe_to_ui[2]
Used to synchronize data transfer with the ui thread.
static YApplication * app()
Return the global YApplication object.
static YApplication * application()
Aliases for YUI::app()
virtual bool eventsBlocked() const
Returns 'true' if events are currently blocked.
bool _terminate_ui_thread
This is a flag that signals the ui thread that it should terminate.
virtual void deleteNotify(YWidget *widget)
Notification that a widget is being deleted.
virtual YOptionalWidgetFactory * createOptionalWidgetFactory()=0
Create the widget factory that provides all the createXY() methods for optional ("special") widgets a...
bool _withThreads
true if a seperate UI thread is created
bool waitForUIThread()
Waits for the ui thread to send one byte through the pipe to the ycp thread and reads this byte from ...
static YWidgetFactory * widgetFactory()
Return the widget factory that provides all the createXY() methods for standard (mandatory,...
void signalUIThread()
Signals the ui thread by sending one byte through the pipe to it.
void terminateUIThread()
Tells the ui thread that it should terminate and waits until it does so.
virtual YWidgetFactory * createWidgetFactory()=0
Create the widget factory that provides all the createXY() methods for standard (mandatory,...
static YOptionalWidgetFactory * optionalWidgetFactory()
Return the widget factory that provides all the createXY() methods for optional ("special") widgets a...
bool _eventsBlocked
Flag that keeps track of blocked events.
void shutdownThreads()
Shut down multithreading.
void setButtonOrderFromEnvironment()
Set the button order (in YButtonBox widgets) from environment variables:
int pipe_from_ui[2]
Used to synchronize data transfer with the ui thread.
virtual YApplication * createApplication()=0
Create the YApplication object that provides global methods.
virtual void uiThreadDestructor()
Destructor for the UI thread.
static void ensureUICreated()
Make sure there is a UI (with a UI plug-in) created.
virtual YEvent * runPkgSelection(YWidget *packageSelector)=0
UI-specific runPkgSelection method.
void setBuiltinCaller(YBuiltinCaller *caller)
Set the transparent inter-thread communication.
void createUIThread()
Creates and launches the ui thread.
void signalYCPThread()
Signals the ycp thread by sending one byte through the pipe to it.
YWidget * sendWidgetID(const std::string &id)
Send a widget ID.
pthread_t _uiThread
Handle to the ui thread.
YBuiltinCaller * builtinCaller() const
Return the transparent inter-thread communication.