18 #define _uappli_hpp_ 1 21 #include <ubit/udisp.hpp> 22 #include <ubit/uconf.hpp> 27 typedef std::vector<UEventFlow*> UFlowList;
32 typedef std::vector<UDisp*> UDispList;
91 UAppli(
int& argc,
char** argv,
92 UOption* command_line_options = null,
93 const char* configuration_file = null);
165 static void remove(
UWin& win,
bool auto_delete =
true);
175 static void remove(
UWin*,
bool auto_delete =
true);
183 static void quit(
int status = 0);
223 static void error(
const char* funcname,
const char* format, ...);
226 static void warning(
const char* funcname,
const char* format, ...);
229 static void fatalError(
const char* funcname,
const char* format, ...);
234 const char* funcname,
const char* format, ...);
251 const char* funcname,
const char* format, va_list);
257 static unsigned long getTime();
260 static void setMotionLag(
unsigned long app_lag,
unsigned long nat_lag);
266 static void addTimeout(
unsigned long msec_delay,
int ntimes,
UCall& callback);
303 static const UDispList& getDispList();
394 static void internalError(
const char* fun,
const char* format, ...);
424 virtual void setOutputStream(std::ostream*);
427 virtual void setOutputBuffer(
UStr*);
433 virtual void warning(
const char* funcname,
const char* format, ...)
const;
436 virtual void error(
const char* funcname,
const char* format, ...)
const;
439 virtual void error(
int errnum,
const UObject*,
const char* funcname,
440 const char* format, ...)
const;
443 virtual void parserError(
int errnum,
const UChar* text_buffer,
444 const char* msg_start,
const UStr& name,
445 const char* msg_end,
const UChar* line)
const;
449 const char* format, va_list)
const;
463 virtual const char* getErrorName(
int errnum)
const;
464 virtual void formatMessage(
UError&,
const char* format, va_list)
const;
465 virtual void printOnStream(
const UError&)
const;
466 virtual void printOnBuffer(
const UError&)
const;
UMenu * getOpenedMenu()
[impl] returns the menu that is currently opened (null otherwise).
Definition: uappli.cpp:537
specification and retreiving of non standard options on the command line.
Definition: uconf.hpp:51
static void onMessage(const UStr &port_name, UCall &callback)
adds a callback that is fired when data is received on this port.
Definition: uappli.cpp:596
static UEventFlow * getFlow(int ID=0)
returns the Event Flow corresponding to this ID (null if not found).
Definition: uappli.cpp:522
static void raiseError(int errnum, const UObject *, const char *funcname, const char *format,...)
raises an error: prints out a message and/or generate an exception.
static void closeDisp(UDisp *)
closes a connection with another X display.
Definition: uappli.cpp:507
static const UUpdate layoutAndPaint
layout then paint: prefined constant for UUpdate(LAYOUT|PAINT);
Definition: uupdate.hpp:50
text selection.
Definition: uselection.hpp:25
static UAppli * getAppli()
returns a pointer the UAppli instance of the program.
Definition: uappli.cpp:148
UFrame: toplevel and main window.
Definition: udialogs.hpp:117
Error management.
Definition: uappli.hpp:410
static USelection * getSelection(int ID=0)
returns the text selection manager.
Definition: uappli.cpp:529
UStr & label()
returns the label property of this UErrorHandler.
Definition: uappli.hpp:430
Definition: uappliImpl.hpp:40
static const UStr & getName()
returns argv[0], the name of the application.
Definition: uappli.cpp:160
static int start()
starts the event main loop of the application.
Definition: uappli.cpp:240
static UMessagePort * findMessagePort(const UStr &name)
Ubit Messages:
Definition: uappli.cpp:586
static UMessagePort & getMessagePort(const UStr &name)
Ubit Messages:
Definition: uappli.cpp:591
Display Context.
Definition: udisp.hpp:44
static void fatalError(const char *funcname, const char *format,...)
raises a fatal error; shortcut for raiseError(UError::FATAL_ERROR, ...).
Definition: uappli.cpp:618
static void error(const char *funcname, const char *format,...)
raises an error; shortcut for raiseError(UError::ERROR ...).
Definition: uappli.cpp:604
static void setImaPath(const UStr &pathname)
get/set the default image path.
Definition: uappli.cpp:546
static UDisp * getDisp()
returns the default display of the appplication.
Definition: uappli.cpp:487
static void setErrorHandler(UErrorHandler &)
changes the current error handler (see UErrorHandler).
Definition: uappli.cpp:660
static bool isRunning()
returns true if the main loop is running.
Definition: uappli.cpp:156
static void updateAll(const UUpdate &mode=UUpdate::layoutAndPaint)
updates all windows.
Definition: uappli.cpp:231
static void quit(int status=0)
quits the main loop of the application.
Definition: uappli.cpp:260
static void setFocus(UView *)
gives the input focus to this view.
Definition: uappli.cpp:184
UStr & initConf(int &argc, char **argv, UOption *, const char *confile)
[impl] parses the config specs, inits the global data of the appli, returns the display name...
Definition: uappli.cpp:75
static const UStyle & getDefaultStyle()
returns the default element style.
Definition: uappli.cpp:169
Impl.
Definition: umessage.hpp:50
specifies how to update UElem, UBox, UWin objects and subclasses.
Definition: uupdate.hpp:25
static UConf conf
configuration of the application, must be set BEFORE the UAppli is created.
Definition: uappli.hpp:81
static bool isUsingGL()
returns true if OpenGL is used for rendering graphics.
Definition: uappli.hpp:135
static UErrorHandler & getErrorHandler()
returns the current error handler (see UErrorHandler).
Definition: uappli.cpp:647
static bool isExiting()
returns true if the applicating is exiting.
Definition: uappli.cpp:150
The Application Context.
Definition: uappli.hpp:79
lightweight general purpose container.
Definition: uelem.hpp:44
static UAppli & appli()
returns a reference to the UAppli instance of the program.
Definition: uappli.cpp:142
static void setMotionLag(unsigned long app_lag, unsigned long nat_lag)
changes the motion lag.
Definition: uappli.cpp:562
static void setTitle(const UStr &title)
changes the title of the Main Frame (
Definition: uappli.cpp:180
static UConf & getConf()
returns the configuration of the application,
Definition: uappli.hpp:129
base class of callback objects for firing functions or methods.
Definition: ucall.hpp:144
static const UFlowList & getFlowList()
returns the list of all event flows on all displays (see getFlow()).
Definition: uappli.cpp:517
static void add(UWin &)
adds a window (UFrame, UDialog, etc) to the UAppli.
Event Flow.
Definition: ueventflow.hpp:34
static void deleteNotify(UDisp *)
[impl] notifies that a display is being destroyed.
static UFrame * getMainFrame()
returns the Main Frame (if any, null otherwise).
Definition: uappli.cpp:158
static class UAppliImpl & impl
[impl] reference to the object that stores the application data.
Definition: uappli.hpp:388
Box View.
Definition: uview.hpp:65
configuration of the UAppli.
Definition: uconf.hpp:68
static UStyleSheet & getStyleSheet()
returns the style sheet of the application.
Definition: uappli.cpp:165
Ubit exception.
Definition: uobject.hpp:27
Definition: uclassImpl.hpp:155
static UMessagePortMap * getMessagePortMap()
[impl] Ubit Messages.
Definition: uappli.cpp:584
Ubit Message Port.
Definition: umessage.hpp:36
Definition: uhardfont.hpp:31
static UDisp * openDisp(const UStr &display_name)
opens a connection on another X display.
Definition: uappli.cpp:497
static UStr getTitle()
returns the title of the Main Frame (
Definition: uappli.cpp:175
static void addTimeout(unsigned long msec_delay, int ntimes, UCall &callback)
fire this callback after a given delay.
Definition: uappli.cpp:576
static unsigned long getTime()
returns the current time.
Definition: uappli.cpp:567
static const UStr & getImaPath()
see setImaPath().
Definition: uappli.cpp:542
static void warning(const char *funcname, const char *format,...)
raises a warning; shortcut for raiseError(UError::WARNING, ...).
Definition: uappli.cpp:611
Base class for windows and menus.
Definition: uwin.hpp:47
UAppli(int &argc, char **argv, UOption *command_line_options=null, const char *configuration_file=null)
constructor for creating the Application Context.
Definition: uappli.cpp:90
static bool hasTelePointers()
[impl] returns true if the appli has telepointers.
Definition: uappli.cpp:511
Compiled Object Style.
Definition: ustyle.hpp:44
Ubit String.
Definition: ustr.hpp:72
static const char * getVersion()
returns the version of the Ubit toolkit (for instance "6.0.0").
Definition: uappli.cpp:152
static void postpone(UCall &callback)
fire this callback when the main loop becomes idle.
Definition: uappli.cpp:569
Base class of most Ubit objects (SEE DETAILS!).
Definition: uobject.hpp:113