25 #ifndef GCHEMPAINT_APPLICATION_H 26 #define GCHEMPAINT_APPLICATION_H 30 #include <libxml/parser.h> 126 friend class ApplicationPrivate;
148 void ActivateTool (
const std::string& toolname,
bool activate);
164 void ActivateWindowsActionWidget (
const char *path,
bool activate);
168 virtual void ClearStatus ();
174 virtual void SetStatusText (
const char* text);
179 virtual GtkWindow* GetWindow () = 0;
206 void SetTool (
const std::string& toolname,
Tool* tool) {m_Tools[toolname] = tool;}
211 GtkWidget*
GetToolItem(
const std::string& name) {
return ToolItems[name];}
219 void SetToolItem (
const std::string& name, GtkWidget* w) {ToolItems[name] = w;}
245 bool FileProcess (
const gchar* filename,
const gchar* mime_type,
bool bSave, GtkWindow *window,
gcu::Document *pDoc = NULL);
252 void SaveGcp (std::string
const &filename,
gcp::Document* pDoc);
259 void OpenGcp (std::string
const &filename,
gcp::Document* pDoc);
268 void OnSaveAsImage ();
282 void Zoom (
double zoom);
288 void AddTools (
ToolDesc const *tools);
296 void RegisterToolbar (
char const *name,
int index);
302 void OnToolChanged (
char const *new_tool_name);
309 void AddTarget (
Target *target);
316 void DeleteTarget (
Target *target);
323 void NotifyIconification (
bool iconified);
331 void NotifyFocus (
bool has_focus,
Target *target = NULL);
347 void OnConfigChanged (GOConfNode *node, gchar
const *name);
352 std::list<std::string> &GetExtensions(std::string &mime_type);
358 void OnThemeNamesChanged ();
365 void AddMenuCallback (BuildMenuCb cb);
389 virtual void OnFileNew (
char const *
Theme = NULL) = 0;
396 GdkCursor *
GetCursor (CursorId
id) {
return m_Cursors[id];}
401 bool Have3DSupport () {
return m_HaveGhemical | m_HaveGChem3D | m_HaveAvogadro;}
408 void ReceiveTargets (GtkClipboard *clipboard, GtkSelectionData *selection_data);
424 void BuildTools ()
throw (std::runtime_error);
430 void ShowTools (
bool visible);
433 void TestSupportedType (
char const *mime_type,
char const* babel_type = NULL,
bool writeable =
false);
434 void AddMimeType (std::list<std::string> &l, std::string
const& mime_type);
435 void UpdateAllTargets ();
453 std::map <std::string, GtkWidget*> ToolItems;
454 std::map <std::string, GtkWidget*> Toolbars;
455 std::map <std::string, Tool*> m_Tools;
458 static bool m_Have_InChI;
460 GtkIconFactory *IconFactory;
461 std::list<char const*> UiDescs;
462 GtkRadioActionEntry* RadioActions;
464 std::map<int, std::string> ToolbarNames;
466 std::set<Target*> m_Targets;
468 std::list<std::string> m_SupportedMimeTypes;
469 std::list<std::string> m_WriteableMimeTypes;
470 GOConfNode *m_ConfNode;
471 guint m_NotificationId;
473 std::list<BuildMenuCb> m_MenuCbs;
475 std::list < ToolDesc const * > m_ToolDescriptions;
497 #endif //GCHEMPAINT_APPLICATION_H
GChemPaint specific C++ classes.
A Gtk+ using gcu::CmdContext implementation.
GdkCursor * GetCursor(CursorId id)
#define GCU_RO_PROP(type, member)
void SetActiveDocument(gcp::Document *pDoc)
gcp::Document * m_pActiveDoc
std::list< ToolDesc const *> const & GetToolDescriptions() const
std::list< std::string > & GetSupportedMimeTypes()
base class for a user interface manager
Gnome Chemistry Canvas library namespace.
The Gnome Chemistry Utils C++ classes.
gcp::Document * GetActiveDocument()
#define GCU_RO_STATIC_PROP(type, member)
void SetToolItem(const std::string &name, GtkWidget *w)
void SetTool(const std::string &toolname, Tool *tool)
GChemPaint application base class.
GtkWidget * GetToolItem(const std::string &name)
Tool * GetTool(const std::string &name)