Commit cb69ca99 authored by Juan Pablo Ugarte's avatar Juan Pablo Ugarte

Implemented Glade UI in Glade, side effect status bar started working again

src/glade-window.c:
 Use GtkBuilder and GResources to build GladeWindow contents
 Implemented menu with GtkActions
 Push tooltip for rencet manager and project actions

src/main.c: Register glade GResources

src/glade-resources.gresources.xml: Glade Gresource file

src/glade.glade: Glade UI GladeWindow, about and preferences dialog

src/glade-callbacks.h: callbacks declarations

src/Makefile.am: added glade-resource.c to source list

configure.ac:
 bumped version to 3.13
 added glib-compile-resources path program

glade-rules.mk: added common rules for GResources files
parent f3264535
......@@ -3,7 +3,7 @@ dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.52)
m4_define(glade_major_version, 3)
m4_define(glade_minor_version, 11)
m4_define(glade_minor_version, 13)
m4_define(glade_micro_version, 0)
m4_define(glade_version, glade_major_version.glade_minor_version.glade_micro_version)
......@@ -42,6 +42,7 @@ AC_PROG_MAKE_SET
LT_PREREQ([2.2.6])
LT_INIT([dlopen win32-dll disable-static])
AC_PATH_PROG(GLIB_COMPILE_RESOURCES, glib-compile-resources)
AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
AC_PATH_PROG(DLLTOOL, dlltool)
......@@ -134,6 +135,9 @@ PKG_CHECK_MODULES([GTK],[
libxml-2.0 >= 2.4.0
])
PKG_CHECK_MODULES([GMODULE_EXPORT],[
gmodule-export-2.0
])
dnl ================================================================
dnl Check for the unix print widgets in gtk+
......@@ -245,6 +249,11 @@ if test "x$_gdk_tgt" = xquartz; then
AC_SUBST(GTK_MAC_CFLAGS)
fi
dnl ================================================================
dnl Check for extra functions
dnl ================================================================
AC_CHECK_FUNCS(gtk_builder_add_from_resource)
AC_SUBST([GLADE_PREFIX])
......
# In this file you will find generic and usefull rules to
# GResource rules:
# These rules will create source and header files for any file ending with .gresource.xml
# You will have to manually load the resourse unless the file name ends with
# .static.gresource.xml in which case it will be loaded automatically
%.h: %.gresource.xml
$(GLIB_COMPILE_RESOURCES) --manual-register --generate $< --target=$@
%.c: %.gresource.xml
$(GLIB_COMPILE_RESOURCES) --manual-register --generate $< --target=$@
# rule for static resources
%.h: %.static.gresource.xml
$(GLIB_COMPILE_RESOURCES) --generate $< --target=$@
%.c: %.static.gresource.xml
$(GLIB_COMPILE_RESOURCES) --generate $< --target=$@
## Process this file with automake to produce Makefile.in
include $(top_srcdir)/glade-rules.mk
bin_PROGRAMS = glade
......@@ -12,19 +13,32 @@ glade_CPPFLAGS = \
$(AM_CPPFLAGS)
glade_CFLAGS = \
$(GMODULE_EXPORT_CFLAGS) \
$(AM_CFLAGS)
glade_LDFLAGS = $(AM_LDFLAGS)
glade_LDFLAGS = $(AM_LDFLAGS) $(GMODULE_EXPORT_LDFLAGS)
glade_LDADD = $(top_builddir)/gladeui/libgladeui-2.la $(GTK_MAC_LIBS)
BUILT_SOURCES = glade-resources.c glade-resources.h
glade_SOURCES = \
glade-window.c \
glade-window.h \
glade-close-button.c \
glade-close-button.h \
glade-resources.c \
glade-callbacks.h \
main.c
noinst_HEADERS = \
glade-resources.h
# This could be split in two, but its better to rebuild both, sources and header
# each time the xml or the actual resources files change, just in case.
glade-resources.c glade-resources.h: glade-resources.gresource.xml \
$(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies glade-resources.gresource.xml)
if NATIVE_WIN32
glade_LDADD += glade-win32-res.o
if !GLADE_UNSTABLE
......
/*
* Copyright (C) 2012 Juan Pablo Ugarte.
*
* 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 Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Authors:
* Juan Pablo Ugarte <juanpablougarte@gmail.com>
*/
#ifndef __GLADE_CALLBACKS_H__
#define __GLADE_CALLBACKS_H__
#include "glade-window.h"
#include <gladeui/glade-design-view.h>
void on_open_action_activate (GtkAction *action, GladeWindow *window);
void on_save_action_activate (GtkAction *action, GladeWindow *window);
void on_save_as_action_activate (GtkAction *action, GladeWindow *window);
void on_close_action_activate (GtkAction *action, GladeWindow *window);
void on_copy_action_activate (GtkAction *action, GladeWindow *window);
void on_cut_action_activate (GtkAction *action, GladeWindow *window);
void on_paste_action_activate (GtkAction *action, GladeWindow *window);
void on_delete_action_activate (GtkAction *action, GladeWindow *window);
void on_properties_action_activate (GtkAction *action, GladeWindow *window);
void on_undo_action_activate (GtkAction *action, GladeWindow *window);
void on_redo_action_activate (GtkAction *action, GladeWindow *window);
void on_quit_action_activate (GtkAction *action, GladeWindow *window);
void on_about_action_activate (GtkAction *action, GladeWindow *window);
void on_reference_action_activate (GtkAction *action, GladeWindow *window);
void on_open_recent_action_item_activated (GtkRecentChooser *chooser,
GladeWindow *window);
void on_use_small_icons_action_toggled (GtkAction *action, GladeWindow *window);
void on_dock_action_toggled (GtkAction *action, GladeWindow *window);
void on_toolbar_visible_action_toggled (GtkAction *action, GladeWindow *window);
void on_statusbar_visible_action_toggled (GtkAction *action, GladeWindow *window);
void on_project_tabs_visible_action_toggled (GtkAction *action, GladeWindow *window);
void on_palette_appearance_radioaction_changed (GtkRadioAction *action,
GtkRadioAction *current,
GladeWindow *window);
void on_selector_radioaction_changed (GtkRadioAction *action,
GtkRadioAction *current,
GladeWindow *window);
void on_actiongroup_connect_proxy (GtkActionGroup *action_group,
GtkAction *action,
GtkWidget *proxy,
GladeWindow *window);
void on_actiongroup_disconnect_proxy (GtkActionGroup *action_group,
GtkAction *action,
GtkWidget *proxy,
GladeWindow *window);
void on_notebook_switch_page (GtkNotebook *notebook,
GtkWidget *page,
guint page_num,
GladeWindow *window);
void on_notebook_tab_added (GtkNotebook *notebook,
GladeDesignView *view,
guint page_num,
GladeWindow *window);
void on_notebook_tab_removed (GtkNotebook *notebook,
GladeDesignView *view,
guint page_num,
GladeWindow *window);
void on_recent_menu_insert (GtkMenuShell *menu_shell,
GtkWidget *child,
gint position,
GladeWindow *window);
void on_recent_menu_remove (GtkContainer *container,
GtkWidget *widget,
GladeWindow *window);
#endif
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/glade">
<file compressed="true" preprocess="xml-stripblanks">glade.glade</file>
</gresource>
</gresources>
This diff is collapsed.
/*
* Copyright (C) 2001 Ximian, Inc.
* Copyright (C) 2007 Vincent Geddes.
* Copyright (C) 2012 Juan Pablo Ugarte.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
......
This diff is collapsed.
......@@ -23,6 +23,7 @@
#include <config.h>
#include "glade-window.h"
#include "glade-resources.h"
#include <gladeui/glade.h>
#include <gladeui/glade-app.h>
......@@ -155,6 +156,8 @@ main (int argc, char *argv[])
glade_setup_log_handlers ();
/* Load resources needed at initialization */
glade_resources_register_resource ();
window = GLADE_WINDOW (glade_window_new ());
......@@ -201,6 +204,9 @@ main (int argc, char *argv[])
if (!opened_project)
glade_window_new_project (window);
/* Free resources before entering the main loop */
glade_resources_unregister_resource ();
gtk_main ();
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