2 \brief The core of the Dasher application
4 Core routines for the Dasher application
9 #include "../Common/Common.h"
11 #include <sys/types.h>
23 #include <X11/Xatom.h>
26 // C++ STL headers (ideally minimise the use of C++ outside of the control)
30 // GTK/GDK headers and friends
37 #include <libgnomeui/libgnomeui.h>
38 #include <libgnome/libgnome.h>
42 #include "gpesettings_store.h"
45 // Other Dasher components
50 #include "Preferences.h"
51 #include "FontDialogues.h"
53 #include "AppSettings.h"
54 #include "../DasherCore/Parameters.h"
55 #include "accessibility.h"
56 #include "dasher_lock_dialogue.h"
58 // We shouldn't need this - the functions which reference it are obsolete
59 //#include "../DasherCore/Event.h"
61 #include "GtkDasherControl.h"
63 // Pointers to various GTK widgets
68 GdkPixbuf
*p
; // Hmm... descriptive names
71 GtkAccelGroup
*dasher_accel
;
72 GtkWidget
*dasher_menu_bar
;
73 GtkWidget
*open_filesel
;
74 GtkWidget
*save_filesel
;
75 GtkWidget
*save_and_quit_filesel
;
76 GtkWidget
*import_filesel
;
77 GtkWidget
*append_filesel
;
79 GtkWidget
*g_pHiddenWindow
;
80 GtkWidget
*file_selector
;
82 GtkWidget
*pDasherWidget
= NULL
;
83 //GtkWidget *g_pEditPane = 0;
84 //GtkWidget *g_pActionPane = 0;
87 Window g_xOldIMWindow
;
90 //DasherAction *g_pAction = 0;
92 const gchar
*filename
= NULL
; // Filename of file currently being edited
94 // Apparently not obsolete, but should be sorted out
96 gboolean file_modified
= FALSE
; // Have unsaved changes been made to the current file
97 gint outputcharacters
;
99 const char *g_szAccessibleContext
= 0;
100 int g_iExpectedPosition
= -1;
101 int g_iOldPosition
= -1;
107 // "member" variables for main window "class"
109 int g_bOnTop
= true; // Whether the window should always be on top
110 int g_bDock
= true; // Whether to dock the window
111 int g_iDockType
; // Ignored for now - will determine how the window is docked to the side of the screen
112 double g_dXFraction
= 0.25; // Fraction of the width of the screen to use;
113 double g_dYFraction
= 0.25; // Fraction of the height of the screen to use;
117 /// Initialise the main window and child components
118 /// This is actually closer to 'initialise application', so name
119 /// should really be changed to reflect this
122 void InitialiseMainWindow(int argc
, char **argv
) {
124 pGladeXML
= dasher_main_get_glade(g_pDasherMain
);
126 dasher_accel
= gtk_accel_group_new(); //?
128 // widgets = pGladeXML; // obsolete? NO - used later in this file, but should be
129 // Grab some pointers to important GTK widgets from the Glade XML
130 // FIXME - do we actually need all of these?
132 window
= glade_xml_get_widget(pGladeXML
, "window");
134 vbox
= glade_xml_get_widget(pGladeXML
, "vbox1");
135 dasher_menu_bar
= glade_xml_get_widget(pGladeXML
, "dasher_menu_bar");
136 pDasherWidget
= glade_xml_get_widget(pGladeXML
, "DasherControl");
138 dasher_lock_dialogue_new(pGladeXML
, GTK_WINDOW(window
));
141 // Initialise the various components
143 initialise_edit(pGladeXML
);
145 PopulateMenus(pGladeXML
);
148 g_pPreferencesDialogue
= dasher_preferences_dialogue_new(pGladeXML
);
150 InitialiseFontDialogues(pGladeXML
);