/* * GuiLoader examples * Copyright (c) 2006 Maxim Udushlivy * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef EXAMPLE_APPLICATION_H #define EXAMPLE_APPLICATION_H #ifdef _WIN32 #include #endif #include #include typedef struct _Application Application; struct _Application { GuiLoader * loader; gchar * file; gboolean modified; gboolean lock; GtkWindow * window; GtkActionGroup * actions; GtkTextView * textView; GtkStatusbar * statusbar; GtkFileChooserDialog * openDialog; GtkFileChooserDialog * saveDialog; GtkDialog * proceedDialog; }; void ApplicationInit(Application * app); void ApplicationDone(Application * app); void UpdateUi(Application * app); void SetText(Application * app, const gchar * text); gchar * GetText(Application * app); void SetFile(Application * app, gchar * str); void OnChanged(GtkTextBuffer * textbuffer, Application * app); void OnMarkSet(GtkTextBuffer * textbuffer, GtkTextIter * arg1, GtkTextMark * arg2, Application * app); void OnNew(GtkAction * action, Application * app); void OnOpen(GtkAction * action, Application * app); void OnSave(GtkAction * action, Application * app); void OnSaveAs(GtkAction * action, Application * app); void OnQuit(GtkAction * action, Application * app); void OnCut(GtkAction * action, Application * app); void OnCopy(GtkAction * action, Application * app); void OnPaste(GtkAction * action, Application * app); void OnDelete(GtkAction * action, Application * app); void OnAbout(GtkAction * action, Application * app); gboolean OnDeleteEvent(GtkWidget * widget, GdkEvent * event, Application * app); gchar * LoadFile(Application * app, const gchar * name); gboolean SaveFile(Application * app, const gchar * name, const gchar * data); gchar * AskFilename(Application * app, GtkFileChooserAction action); gboolean AskProceed(Application * app); void ShowMessage(Application * app, const gchar * message); #endif