Commit 741d228a authored by Vincent Geddes's avatar Vincent Geddes

New method glade_app_new().

	* gladeui/glade-app.h, gladeui/glade-app.c: New method glade_app_new().

	* src/glade-project-window.h, src/glade-project-window.c: Renamed
	  to glade-window.h and glade-window.c respectively. GladeWindow now
	  subclasses GtkWindow instead of GladeApp (#449928).

svn path=/trunk/; revision=1433
parent 79a959e4
......@@ -4,6 +4,12 @@
* bindings/python/glade-python.c: Run garbage collector before finalizing
interpreter. Use Py_InitializeEx() instead of Py_Initialize() (#453104).
* gladeui/glade-app.h, gladeui/glade-app.c: New method glade_app_new().
* src/glade-project-window.h, src/glade-project-window.c: Renamed
to glade-window.h and glade-window.c respectively. GladeWindow now
subclasses GtkWindow instead of GladeApp (#449928).
2007-07-03 Juan Pablo Ugarte <juanpablougarte@gmail.com>
......
......@@ -1673,3 +1673,10 @@ glade_app_selection_changed (void)
glade_project_selection_changed (project);
}
}
GladeApp*
glade_app_new (void)
{
return g_object_new (GLADE_TYPE_APP, NULL);
}
......@@ -86,6 +86,8 @@ struct _GladeAppClass
GType glade_app_get_type (void) G_GNUC_CONST;
GladeApp* glade_app_new (void);
GType glade_pointer_mode_get_type (void) G_GNUC_CONST;
GladeApp* glade_app_get (void);
......
......@@ -18,8 +18,8 @@ glade_3_LDFLAGS = $(AM_LDFLAGS)
glade_3_LDADD = $(top_builddir)/gladeui/libgladeui-1.la
glade_3_SOURCES = \
glade-project-window.c \
glade-project-window.h \
glade-window.c \
glade-window.h \
main.c
if NATIVE_WIN32
......
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* Copyright (C) 2007 The GNOME Foundation.
* Copyright (C) 2001 Ximian, Inc.
* Copyright (C) 2007 Vincent Geddes.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
......@@ -17,49 +18,47 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __GLADE_PROJECT_WINDOW_H__
#define __GLADE_PROJECT_WINDOW_H__
#ifndef __GLADE_WINDOW_H__
#define __GLADE_WINDOW_H__
#include <gladeui/glade-app.h>
#include <gtk/gtkwindow.h>
G_BEGIN_DECLS
#define GLADE_TYPE_PROJECT_WINDOW (glade_project_window_get_type())
#define GLADE_PROJECT_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GLADE_TYPE_PROJECT_WINDOW, GladeProjectWindow))
#define GLADE_PROJECT_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GLADE_TYPE_PROJECT_WINDOW, GladeProjectWindowClass))
#define GLADE_IS_PROJECT_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GLADE_TYPE_PROJECT_WINDOW))
#define GLADE_IS_PROJECT_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GLADE_TYPE_PROJECT_WINDOW))
#define GLADE_PROJECT_WINDOW_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GLADE_PROJECT_WINDOW, GladeProjectWindowClass))
#define GLADE_TYPE_WINDOW (glade_window_get_type())
#define GLADE_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GLADE_TYPE_WINDOW, GladeWindow))
#define GLADE_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GLADE_TYPE_WINDOW, GladeWindowClass))
#define GLADE_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GLADE_TYPE_WINDOW))
#define GLADE_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GLADE_TYPE_WINDOW))
#define GLADE_WINDOW_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GLADE_WINDOW, GladeWindowClass))
typedef struct _GladeProjectWindow GladeProjectWindow;
typedef struct _GladeProjectWindowClass GladeProjectWindowClass;
typedef struct _GladeProjectWindowPrivate GladeProjectWindowPrivate;
typedef struct _GladeWindow GladeWindow;
typedef struct _GladeWindowPrivate GladeWindowPrivate;
typedef struct _GladeWindowClass GladeWindowClass;
struct _GladeProjectWindow
struct _GladeWindow
{
GladeApp parent_instance;
GtkWindow parent_instance;
GladeProjectWindowPrivate *priv;
GladeWindowPrivate *priv;
};
struct _GladeProjectWindowClass
struct _GladeWindowClass
{
GladeAppClass parent_class;
GtkWindowClass parent_class;
};
GType glade_project_window_get_type (void) G_GNUC_CONST;
GType glade_window_get_type (void) G_GNUC_CONST;
GladeProjectWindow *glade_project_window_new (void);
GtkWidget *glade_window_new (void);
void glade_project_window_show_all (GladeProjectWindow *gpw);
void glade_window_new_project (GladeWindow *window);
void glade_project_window_new_project (GladeProjectWindow *gpw);
gboolean glade_window_open_project (GladeWindow *window,
const gchar *path);
gboolean glade_project_window_open_project (GladeProjectWindow *gpw,
const gchar *path);
void glade_project_window_check_devhelp (GladeProjectWindow *gpw);
void glade_window_check_devhelp (GladeWindow *window);
G_END_DECLS
#endif /* __GLADE_PROJECT_WINDOW_H__ */
#endif /* __GLADE_WINDOW_H__ */
......@@ -18,12 +18,12 @@
*
* Authors:
* Chema Celorio <chema@celorio.com>
* Vincent Geddes <vgeddes@metroweb.co.za>
* Vincent Geddes <vgeddes@gnome.org>
*/
#include <config.h>
#include "glade-project-window.h"
#include "glade-window.h"
#include <gladeui/glade.h>
#include <gladeui/glade-app.h>
......@@ -72,7 +72,7 @@ static GOptionEntry debug_option_entries[] =
int
main (int argc, char *argv[])
{
GladeProjectWindow *project_window;
GladeWindow *window;
GOptionContext *option_context;
GOptionGroup *option_group;
GError *error = NULL;
......@@ -152,10 +152,10 @@ main (int argc, char *argv[])
glade_setup_log_handlers ();
project_window = glade_project_window_new ();
window = GLADE_WINDOW (glade_window_new ());
if (without_devhelp == FALSE)
glade_project_window_check_devhelp (project_window);
glade_window_check_devhelp (window);
/* load files specified on commandline */
......@@ -166,7 +166,7 @@ main (int argc, char *argv[])
for (i=0; files[i] ; ++i)
{
if (g_file_test (files[i], G_FILE_TEST_EXISTS) != FALSE)
glade_project_window_open_project (project_window, files[i]);
glade_window_open_project (window, files[i]);
else
g_warning (_("Unable to open '%s', the file does not exist.\n"), files[i]);
}
......@@ -174,15 +174,12 @@ main (int argc, char *argv[])
}
if (glade_app_get_project () == NULL)
glade_project_window_new_project (project_window);
glade_window_new_project (window);
glade_project_window_show_all (project_window);
gtk_widget_show (GTK_WIDGET (window));
gtk_main ();
/* destroy GladeApp */
g_object_unref (project_window);
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment