JX Application Framework
Loading...
Searching...
No Matches
Functions
jGlobals.cpp File Reference
#include "jGlobals.h"
#include "jStringData.h"
#include "JTextUserNotification.h"
#include "JCreateTextPG.h"
#include "JThisProcess.h"
#include "JWebBrowser.h"
#include "jDirUtil.h"
#include "jFileUtil.h"
#include <stdlib.h>
#include <locale.h>
#include <ace/OS_NS_sys_socket.h>
#include "jAssert.h"
Include dependency graph for jGlobals.cpp:

Functions

void JInitCore (JAssertBase *ah, const JUtf8Byte *appSignature, const JUtf8Byte **defaultStringData, JUserNotification *un, JCreateProgressDisplay *cpg)
 
void JDeleteGlobals ()
 
bool JGetAssertHandler (JAssertBase **ah)
 
JStringManagerJGetStringManager ()
 
const JStringJGetString (const JUtf8Byte *id)
 
JString JGetString (const JUtf8Byte *id, const JUtf8Byte *map[], const JSize size)
 
JWebBrowserJGetWebBrowser ()
 
void JSetWebBrowser (JWebBrowser *webBrowser)
 
JUserNotificationJGetUserNotification ()
 
JCreateProgressDisplayJGetCreatePG ()
 
void JSetTaskScheduler (const std::function< void(const std::function< void()> &)> &sched)
 
void JScheduleTask (const std::function< void()> &task)
 

Function Documentation

◆ JDeleteGlobals()

void JDeleteGlobals ( )

Deletes all global objects and factories, in reverse order of creation.

◆ JGetAssertHandler()

bool JGetAssertHandler ( JAssertBase **  ah)

We cannot guarantee that JInitCore was called, so we cannot guarantee that we have an object that we can return. Since assert() may be called because of arbitrary system failures, we cannot allocate an object when this function is called. Thus, we return true if we have an object.

◆ JGetCreatePG()

JCreateProgressDisplay * JGetCreatePG ( )

◆ JGetString() [1/2]

const JString & JGetString ( const JUtf8Byte id)

Only return a string after globals have been initialized.

◆ JGetString() [2/2]

JString JGetString ( const JUtf8Byte id,
const JUtf8Byte map[],
const JSize  size 
)

◆ JGetStringManager()

JStringManager * JGetStringManager ( )

◆ JGetUserNotification()

JUserNotification * JGetUserNotification ( )

◆ JGetWebBrowser()

JWebBrowser * JGetWebBrowser ( )

◆ JInitCore()

void JInitCore ( JAssertBase ah,
const JUtf8Byte appSignature,
const JUtf8Byte **  defaultStringData,
JUserNotification un,
JCreateProgressDisplay cpg 
)

Initializes all global objects and factories. Calls atexit(JDeleteGlobals) to ensure that all objects are cleaned up when the program terminates.

We take ownership of all the objects that are passed in.
We make copies of the string data.

Passing in nullptr for ah,un,cpg means that you want the default text implementation.

Passing in nullptr for appSignature and defaultStringData means that you want to use the default U.S. string data.

Passing in nullptr for gcfm,gcc means that you get nothing, so we will explode via assert() if these objects are requested.

Passing in nullptr for the font names means that you get: defaultFontName = "Helvetica" greekFontName = "Symbol" monospaceFontName = "Courier"

◆ JScheduleTask()

void JScheduleTask ( const std::function< void()> &  task)

◆ JSetTaskScheduler()

void JSetTaskScheduler ( const std::function< void(const std::function< void()> &)> &  sched)

◆ JSetWebBrowser()

void JSetWebBrowser ( JWebBrowser webBrowser)