X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-window.h;h=441e12af3f2454eaa7c3aae16e5fba181e9343b7;hb=4a8a4cd81b9d7d9e6b757be4d0a8a62b48325051;hp=835cef0b1fecf9a21cc459a9913ecc7d6fc40691;hpb=4398d3a1a881c6cafaeb0cbd11f56bd51d904c51;p=pspp-builds.git diff --git a/src/ui/gui/psppire-window.h b/src/ui/gui/psppire-window.h index 835cef0b..441e12af 100644 --- a/src/ui/gui/psppire-window.h +++ b/src/ui/gui/psppire-window.h @@ -1,5 +1,5 @@ /* PSPPIRE - a graphical user interface for PSPP. - Copyright (C) 2008 Free Software Foundation + Copyright (C) 2008, 2009 Free Software Foundation 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 @@ -24,22 +24,38 @@ #include #include #include +#include G_BEGIN_DECLS -#define PSPPIRE_WINDOW_TYPE (psppire_window_get_type ()) -#define PSPPIRE_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PSPPIRE_WINDOW_TYPE, PsppireWindow)) +#define PSPPIRE_TYPE_WINDOW (psppire_window_get_type ()) + +#define PSPPIRE_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ + PSPPIRE_TYPE_WINDOW, PsppireWindow)) + #define PSPPIRE_WINDOW_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \ - PSPPIRE_WINDOW_TYPE, PsppireWindowClass)) + PSPPIRE_TYPE_WINDOW, PsppireWindowClass)) + #define PSPPIRE_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ - PSPPIRE_WINDOW_TYPE)) + PSPPIRE_TYPE_WINDOW)) + #define PSPPIRE_IS_WINDOW_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \ - PSPPIRE_WINDOW_TYPE)) + PSPPIRE_TYPE_WINDOW)) + + + +#define PSPPIRE_TYPE_WINDOW_MODEL (psppire_window_model_get_type ()) + +#define PSPPIRE_IS_WINDOW_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PSPPIRE_TYPE_WINDOW_MODEL)) + +#define PSPPIRE_WINDOW_MODEL_GET_IFACE(obj) \ + (G_TYPE_INSTANCE_GET_INTERFACE ((obj), PSPPIRE_TYPE_WINDOW_MODEL, PsppireWindowIface)) typedef struct _PsppireWindow PsppireWindow; typedef struct _PsppireWindowClass PsppireWindowClass; +typedef struct _PsppireWindowIface PsppireWindowIface; struct _PsppireWindow @@ -56,15 +72,29 @@ struct _PsppireWindow guint insert_handler; guint remove_handler; + + gboolean dirty; + GTimeVal savetime; }; + struct _PsppireWindowClass { GtkWindowClass parent_class; }; + +struct _PsppireWindowIface +{ + GTypeInterface g_iface; + + void (*save) (PsppireWindow *w); + gboolean (*load) (PsppireWindow *w, const gchar *); +}; + + GType psppire_window_get_type (void); -GtkWidget* psppire_window_new (void); +GType psppire_window_model_get_type (void); const gchar * psppire_window_get_filename (PsppireWindow *); @@ -72,6 +102,15 @@ void psppire_window_set_filename (PsppireWindow *w, const gchar *filename); void psppire_window_minimise_all (void); +void psppire_window_set_unsaved (PsppireWindow *); + +gboolean psppire_window_get_unsaved (PsppireWindow *); + +gint psppire_window_query_save (PsppireWindow *); + +void psppire_window_save (PsppireWindow *w); +gboolean psppire_window_load (PsppireWindow *w, const gchar *file); + G_END_DECLS