The Gnome Chemistry Utils  0.14.0
Public Member Functions | Protected Attributes | List of all members
gcugtk::Chem3dApplication Class Reference

#include <gcugtk/chem3dapplication.h>

Inheritance diagram for gcugtk::Chem3dApplication:
gcugtk::Application gcu::Application gcu::DialogOwner

Public Member Functions

 Chem3dApplication (gcu::Display3DMode display3d=gcu::BALL_AND_STICK, char const *bg="black")
virtual ~Chem3dApplication ()
virtual Chem3dDocOnFileNew ()=0
void OnFileOpen (Chem3dDoc *doc)
void OnSaveAsImage (Chem3dDoc *doc)
bool FileProcess (const gchar *filename, const gchar *mime_type, bool bSave, GtkWindow *window, gcu::Document *pDoc=NULL)
void OnQuit ()
gcu::Display3DMode GetDisplay3D (void)
float GetRed (void)
float GetGreen (void)
float GetBlue (void)
- Public Member Functions inherited from gcugtk::Application
 Application (std::string name, std::string datadir=DATADIR, char const *help_name=NULL, char const *icon_name=NULL, CmdContextGtk *cc=NULL)
virtual ~Application ()
GtkWidget * GetImageResolutionWidget ()
GtkWidget * GetImageSizeWidget ()
virtual void ReceiveTargets (G_GNUC_UNUSED GtkClipboard *clipboard, G_GNUC_UNUSED GtkSelectionData *selection_data)
void ShowURI (GdkScreen *screen, std::string &uri)
void OnBug (GdkScreen *screen, char const *uri=PACKAGE_BUGREPORT)
void OnWeb (GdkScreen *screen, char const *uri="http://gchemutils.nongnu.org/")
void OnMail (GdkScreen *screen, char const *MailAddress="mailto:gchemutils-main@nongnu.org")
void OnLiveAssistance (GdkScreen *screen)
GtkRecentManager * GetRecentManager (void) const
- Public Member Functions inherited from gcu::Application
 Application (std::string name, std::string datadir=DATADIR, char const *help_name=NULL, char const *icon_name=NULL, CmdContext *cc=NULL)
void OnHelp (std::string s="")
bool HasHelp ()
std::string const & GetName () const
virtual GtkWindow * GetWindow ()
virtual bool FileProcess (G_GNUC_UNUSED const gchar *filename, G_GNUC_UNUSED const gchar *mime_type, G_GNUC_UNUSED bool bSave, G_GNUC_UNUSED GtkWindow *window, G_GNUC_UNUSED Document *pDoc=NULL)
char const * GetCurDir ()
void SetCurDir (char const *dir)
void SetCurDir (std::string const &dir)
std::map< std::string,
GdkPixbufFormat * > & 
GetSupportedPixbufFormats ()
char const * GetPixbufTypeName (std::string &filename, char const *mime_type)
ContentType Load (std::string const &uri, const char *mime_type, Document *Doc, const char *options=NULL)
ContentType Load (GsfInput *input, const char *mime_type, Document *Doc, const char *options=NULL)
bool Save (std::string const &uri, const char *mime_type, Object const *Obj, ContentType type, const char *options=NULL)
bool Save (GsfOutput *output, const char *mime_type, Object const *Obj, ContentType type, const char *options=NULL)
virtual DocumentCreateNewDocument ()
std::string const & GetIconName ()
void RegisterOptions (GOptionEntry const *entries, char const *translation_domain=GETTEXT_PACKAGE)
void AddOptions (GOptionContext *context)
TypeId AddType (std::string TypeName, Object *(*CreateFunc)(), TypeId id=OtherType)
ObjectCreateObject (const std::string &TypeName, Object *parent=NULL)
void AddRule (TypeId type1, RuleId rule, TypeId type2)
void AddRule (const std::string &type1, RuleId rule, const std::string &type2)
const std::set< TypeId > & GetRules (TypeId type, RuleId rule)
const std::set< TypeId > & GetRules (const std::string &type, RuleId rule)
void SetCreationLabel (TypeId Id, std::string Label)
const std::string & GetCreationLabel (TypeId Id)
bool BuildObjectContextualMenu (Object *target, UIManager *uim, Object *object, double x, double y)
void AddMenuCallback (TypeId Id, BuildMenuCb cb)
const std::string & GetCreationLabel (const std::string &TypeName)
CmdContextGetCmdContext ()
char * ConvertToCML (std::string const &uri, const char *mime_type, const char *options=NULL)
char * ConvertToCML (GsfInput *input, const char *mime_type, const char *options=NULL)
void ConvertFromCML (const char *cml, std::string const &uri, const char *mime_type, const char *options=NULL)
void ConvertFromCML (const char *cml, GsfOutput *output, const char *mime_type, const char *options=NULL)
std::list< Database > const & GetDatabases (char const *classname)
std::set< Document * > GetDocs (void)
unsigned GetScreenResolution (void)
void SetImageResolution (unsigned val)
unsigned GetImageResolution (void) const
unsigned & GetRefImageResolution (void)
void SetImageWidth (unsigned val)
unsigned GetImageWidth (void) const
unsigned & GetRefImageWidth (void)
void SetImageHeight (unsigned val)
unsigned GetImageHeight (void) const
unsigned & GetRefImageHeight (void)
void SetTransparentBackground (bool val)
bool GetTransparentBackground (void) const
bool & GetRefTransparentBackground (void)
- Public Member Functions inherited from gcu::DialogOwner
 DialogOwner ()
virtual ~DialogOwner ()
DialogGetDialog (std::string name) const
void ClearDialogs ()

Protected Attributes

gcu::Display3DMode m_Display3D
float m_Red
float m_Green
float m_Blue

Additional Inherited Members

- Static Public Member Functions inherited from gcugtk::Application
static WindowState GetDefaultWindowState ()
static void OnReceiveTargets (GtkClipboard *clipboard, GtkSelectionData *selection_data, Application *App)
- Protected Member Functions inherited from gcugtk::Application
virtual void NoMoreDocsEvent ()
void CreateDefaultCmdContext ()
bool LoopRunning ()

Detailed Description

Application class for the molecule 3d viewer.

Definition at line 41 of file chem3dapplication.h.

Constructor & Destructor Documentation

gcugtk::Chem3dApplication::Chem3dApplication ( gcu::Display3DMode  display3d = gcu::BALL_AND_STICK,
char const *  bg = "black" 
)
Parameters
display3dthe default display mode for the application.
bgthe default background color name, accetpted values are "white", "black", and "#rrggbb". Defaults to 'black'.

The constructor.

virtual gcugtk::Chem3dApplication::~Chem3dApplication ( )
virtual

Default destructor.

Member Function Documentation

bool gcugtk::Chem3dApplication::FileProcess ( const gchar *  filename,
const gchar *  mime_type,
bool  bSave,
GtkWindow *  window,
gcu::Document pDoc = NULL 
)
Parameters
filenamethe uri of the file.
mime_typethe mime type of the file if known.
bSavetrue if saving, and false if loading.
windowthe current top level window.
pDocan optional document.

Called by the FileChooser when a file name has been selected. Saves or loads the document according to bSave.

Returns
true if no error occured.
gcugtk::Chem3dApplication::GetBlue ( void  )
inline
Returns
the current blue component of the default background color.

Definition at line 127 of file chem3dapplication.h.

gcugtk::Chem3dApplication::GetDisplay3D ( void  )
inline
Returns
the current default display mode.

Definition at line 106 of file chem3dapplication.h.

gcugtk::Chem3dApplication::GetGreen ( void  )
inline
Returns
the current green component of the default background color.

Definition at line 120 of file chem3dapplication.h.

gcugtk::Chem3dApplication::GetRed ( void  )
inline
Returns
the current red component of the default background color.

Definition at line 113 of file chem3dapplication.h.

virtual Chem3dDoc* gcugtk::Chem3dApplication::OnFileNew ( )
pure virtual

Pure virtual function used to create a new document of the appropriate type.

Returns
the newly created document.
void gcugtk::Chem3dApplication::OnFileOpen ( Chem3dDoc doc)
Parameters
doca Chem3dDoc

Displays a file open dialog and when a file is selected, loads it's contents inside doc if it's empty or inside a nex document.

void gcugtk::Chem3dApplication::OnQuit ( )

Called when the user selects the 'Quit' menu item.

void gcugtk::Chem3dApplication::OnSaveAsImage ( Chem3dDoc doc)
Parameters
docthe document to save as an image.

Displays a file selctor and saves the image insode the selected file if any. The framework will ask the user to overwrite or not if the file already exists.

Member Data Documentation

gcugtk::Chem3dApplication::m_Blue
protected

The current blue component of the default background color.

Definition at line 127 of file chem3dapplication.h.

gcugtk::Chem3dApplication::m_Display3D
protected

The current default display mode.

Definition at line 106 of file chem3dapplication.h.

gcugtk::Chem3dApplication::m_Green
protected

The current green component of the default background color.

Definition at line 120 of file chem3dapplication.h.

gcugtk::Chem3dApplication::m_Red
protected

The current red component of the default background color.

Definition at line 113 of file chem3dapplication.h.


The documentation for this class was generated from the following file: