11 #ifndef __AP_Interface__
12 #define __AP_Interface__
57 const char *
const *names,
74 void wireInterface(UI_Manager *uims);
77 void unwireInterface(UI_Manager *uims);
81 bool readUIFile(
const char *ui_filename,
87 static FILE *createPreferenceFile(
const char *
filename);
92 bool readPreferenceFile(
const char *pref_filename,
103 UI_Value *findValueSymbol(
const char *symbol)
const;
108 UI_Value *getValueSymbol(
const char *symbol,
int create = 1);
119 void setObjectSymbol(
const char *symbol,
UI_Object *who,
124 UI_Object *getObjectSymbol(
const char *symbol)
const;
128 UI_Feel *getFeelSymbol(
const char *symbol)
const;
143 void setKeyDelegateSymbol(
const char *symbol,
148 bool hasKeyDelegateSymbol(
const char *symbol)
const;
160 void removeObjectSymbol(
const char *symbol);
163 void removeValueSymbol(
const char *symbol);
170 return dynamic_cast<T *
>(getObjectSymbol(name));
178 return dynamic_cast<T *
>(findValueSymbol(name));
193 void setKeyBindingProxySrc(
const char *symbol, UI_Feel *
src,
195 void addKeyBindingProxyRef(
const char *symbol, UI_Feel *
ref,
203 virtual void initApplication(UI_Manager *uims,
210 virtual void outputUsage(
int argc,
const char **argv)
const;
214 void resetApplication();
221 virtual int saveAppData(
const char *
filename);
222 virtual int loadAppState();
223 virtual int saveAppState();
224 virtual void saveOnCoreDump();
229 bool loadUIInitPrefs();
232 void saveUIInitPrefs(
233 const char * layout_level,
239 bool restoreUIInitPrefs();
242 static const std::pair<const char *, int> theFileChooserStyleMap[];
245 static int mapStrToInt(
const char *
label,
246 const std::pair<const char *, int> *map);
247 static const char * mapIntToStr(
int index,
248 const std::pair<const char *, int> *map);
259 static void setAppExitCode(
int exit_code);
260 static int getAppExitCode();
263 static bool isAppExiting();
267 static const char *getStartupDesktop();
270 class InstallSignalHandlersHelper;
275 static void clearTheMainApplication();
286 void processKeyBindingProxyRequests();
289 static void loadWindowGeometry(
291 bool default_maximized,
296 static bool getWindowGeometry(
int &
width,
int &
height,
300 static bool getSaveWindowGeoPref();
301 static void saveWindowGeoPref();
302 static bool loadWindowGeoPref(
307 class si_CrashHandler;
308 friend class si_CrashHandler;
312 static void installSignalHandlers();
315 void assignUIInitPrefs();
317 static const char *mainApplicationName();
320 const char *appname,
const char *
filename);
324 static void installCallbacks();
326 static void powerFailHandler(
329 static void terminationWarning(
uint nseconds);
336 ProxyRequest() : myTarget(nullptr) {}
347 NamedProxyRequestMap *myKeyBindingProxyRequestTable;
373 static void setAppForeground();
379 template <
typename APP_T>
384 {
return UTmakeUnique<APP_T>(); }
399 template<
class ObjectClass>
inline
405 template<
class ValueClass>
inline
ValueClass * SIgetValue(const AP_Interface *app, const char *name)
GT_API const UT_StringHolder filename
GLuint GLsizei const GLchar * label
T * findValue(const char *name) const
AP_InterfaceUPtr createApplication() override
void APregister(AP_Interface *app)
UT_SymbolMap< UI_Value * > UI_NamedValueMap
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
virtual void handleEvent(UI_Event *event)
GLint GLsizei GLsizei height
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
const UT_String & getName() const
Return the name passed in the constructor.
UT_UniquePtr< AP_Interface > AP_InterfaceUPtr
static AP_Interface * getMainApplication()
const char *const * myValueNames
UI_EventMethod const * myMethods
GLuint const GLchar * name
UT_SymbolMap< UI_Object * > UI_NamedObjectMap
UI_NamedObjectMap * getObjectTable() const
UI_Object * getObjectSymbol(const char *symbol) const
GLfloat GLfloat GLfloat GLfloat h
GLenum GLsizei GLsizei GLint * values
T * findObject(const char *name) const
void(UI_Object::* UI_EventMethod)(UI_Event *)
virtual const char * className() const
GLubyte GLubyte GLubyte GLubyte w
UI_Value * findValueSymbol(const char *symbol) const
Find the UI_Value for the given named value symbol.
UT_SymbolMap< UI_KeyDelegateSPtr > UI_NamedKeyDelegateMap
void APderegister(AP_Interface *app)
UI_NamedValueMap * getValueTable() const
UT_SharedPtr< UI_KeyDelegate > UI_KeyDelegateSPtr
ObjectClass * SIgetObject(const AP_Interface *app, const char *name)