[gtranslator] Make GtrWindow to be a GtkApplicationWindow
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtranslator] Make GtrWindow to be a GtkApplicationWindow
- Date: Tue, 1 May 2012 20:16:11 +0000 (UTC)
commit fa6e70d4d3cd1a3c7772289f7704499e0504507b
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Tue May 1 22:16:08 2012 +0200
Make GtrWindow to be a GtkApplicationWindow
src/gtr-application.c | 2 +-
src/gtr-window.c | 2 +-
src/gtr-window.h | 25 ++++++-------------------
3 files changed, 8 insertions(+), 21 deletions(-)
---
diff --git a/src/gtr-application.c b/src/gtr-application.c
index 67ee033..bf7ce6c 100644
--- a/src/gtr-application.c
+++ b/src/gtr-application.c
@@ -382,7 +382,7 @@ gtr_application_create_window (GtrApplication *app)
g_return_val_if_fail (GTR_IS_APPLICATION (app), NULL);
- window = g_object_new (GTR_TYPE_WINDOW, NULL);
+ window = g_object_new (GTR_TYPE_WINDOW, "application", app, NULL);
set_active_window (app, window);
state = g_settings_get_int (app->priv->window_settings,
diff --git a/src/gtr-window.c b/src/gtr-window.c
index 754c534..5b26b39 100644
--- a/src/gtr-window.c
+++ b/src/gtr-window.c
@@ -70,7 +70,7 @@ static void gtr_window_cmd_edit_toolbar (GtkAction * action,
GtrWindow * window);
-G_DEFINE_TYPE (GtrWindow, gtr_window, GTK_TYPE_WINDOW)
+G_DEFINE_TYPE (GtrWindow, gtr_window, GTK_TYPE_APPLICATION_WINDOW)
struct _GtrWindowPrivate
{
diff --git a/src/gtr-window.h b/src/gtr-window.h
index 996c06d..d354a1b 100644
--- a/src/gtr-window.h
+++ b/src/gtr-window.h
@@ -33,44 +33,31 @@
#include "gtr-view.h"
G_BEGIN_DECLS
-/*
- * Type checking and casting macros
- */
+
#define GTR_TYPE_WINDOW (gtr_window_get_type ())
#define GTR_WINDOW(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GTR_TYPE_WINDOW, GtrWindow))
#define GTR_WINDOW_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GTR_TYPE_WINDOW, GtrWindowClass))
#define GTR_IS_WINDOW(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTR_TYPE_WINDOW))
#define GTR_IS_WINDOW_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GTR_TYPE_WINDOW))
#define GTR_WINDOW_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTR_TYPE_WINDOW, GtrWindowClass))
-/* Private structure type */
-typedef struct _GtrWindowPrivate GtrWindowPrivate;
-/*
- * Main object structure
- */
-typedef struct _GtrWindow GtrWindow;
+typedef struct _GtrWindow GtrWindow;
+typedef struct _GtrWindowClass GtrWindowClass;
+typedef struct _GtrWindowPrivate GtrWindowPrivate;
struct _GtrWindow
{
- GtkWindow parent_instance;
+ GtkApplicationWindow parent_instance;
/*< private > */
GtrWindowPrivate *priv;
};
-/*
- * Class definition
- */
-typedef struct _GtrWindowClass GtrWindowClass;
-
struct _GtrWindowClass
{
- GtkWindowClass parent_class;
+ GtkApplicationWindowClass parent_class;
};
-/*
- * Public methods
- */
GType gtr_window_get_type (void) G_GNUC_CONST;
GType gtr_window_register_type (GTypeModule * module);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]