Remove references and calls to libgd in favour of Gtk 3.10 calls

This commit is contained in:
Gergely Polonkai 2014-02-25 22:32:54 +01:00
parent f7e4c451b4
commit aa339f5863
8 changed files with 21 additions and 37 deletions

3
.gitmodules vendored
View File

@ -1,3 +0,0 @@
[submodule "libgd"]
path = libgd
url = git://git.gnome.org/libgd

View File

@ -1,5 +1,5 @@
ACLOCAL_AMFLAGS = -I m4 ACLOCAL_AMFLAGS = -I m4
SUBDIRS = libgd src po data help SUBDIRS = src po data help
EXTRA_DIST = config.rpath ChangeLog EXTRA_DIST = config.rpath ChangeLog

View File

@ -5,7 +5,6 @@ srcdir=`dirname $0`
test -z "$srcdir" && srcdir=. test -z "$srcdir" && srcdir=.
PKG_NAME="astrognome" PKG_NAME="astrognome"
ACLOCAL_FLAGS="-I libgd $ACLOCAL_FLAGS"
(test -f $srcdir/configure.ac \ (test -f $srcdir/configure.ac \
&& test -f $srcdir/src/astrognome.c) || { && test -f $srcdir/src/astrognome.c) || {
@ -19,7 +18,5 @@ which gnome-autogen.sh || {
exit 1 exit 1
} }
git submodule update --init --recursive
REQUIRED_AUTOMAKE_VERSION=1.9 . gnome-autogen.sh REQUIRED_AUTOMAKE_VERSION=1.9 . gnome-autogen.sh

View File

@ -35,15 +35,8 @@ PKG_CHECK_MODULES([LIBXSLT], [libexslt])
PKG_CHECK_MODULES([WEBKIT], [webkitgtk-3.0]) PKG_CHECK_MODULES([WEBKIT], [webkitgtk-3.0])
PKG_CHECK_MODULES([SWE_GLIB], [swe-glib >= 2.0.0]) PKG_CHECK_MODULES([SWE_GLIB], [swe-glib >= 2.0.0])
LIBGD_INIT([
header-bar
stack
static
])
AC_CONFIG_FILES([ AC_CONFIG_FILES([
Makefile Makefile
libgd/Makefile
src/Makefile src/Makefile
help/Makefile help/Makefile
po/Makefile.in po/Makefile.in

1
libgd

@ -1 +0,0 @@
Subproject commit 62f9b8b92599b38d986bd26d5780edd400d318c9

View File

@ -28,9 +28,9 @@ AM_CPPFLAGS = -DG_LOG_DOMAIN=\"Astrognome\" -DLOCALEDIR=\"$(localedir)\" -DPKGDA
bin_PROGRAMS = astrognome bin_PROGRAMS = astrognome
astrognome_SOURCES = $(astrognome_source_files) $(BUILT_SOURCES) astrognome_SOURCES = $(astrognome_source_files) $(BUILT_SOURCES)
astrognome_LDADD = $(SWE_GLIB_LIBS) $(GTK_LIBS) $(LIBXML_LIBS) $(LIBXSLT_LIBS) $(WEBKIT_LIBS) $(top_builddir)/libgd/libgd.la astrognome_LDADD = $(SWE_GLIB_LIBS) $(GTK_LIBS) $(LIBXML_LIBS) $(LIBXSLT_LIBS) $(WEBKIT_LIBS)
astrognome_LDFLAGS = -rdynamic astrognome_LDFLAGS = -rdynamic
astrognome_CFLAGS = $(SWE_GLIB_CFLAGS) $(CFLAGS) $(GTK_CFLAGS) $(LIBXML_CFLAGS) $(LIBXSLT_CFLAGS) $(WEBKIT_CFLAGS) -Wall -I$(top_srcdir)/libgd astrognome_CFLAGS = $(SWE_GLIB_CFLAGS) $(CFLAGS) $(GTK_CFLAGS) $(LIBXML_CFLAGS) $(LIBXSLT_CFLAGS) $(WEBKIT_CFLAGS) -Wall
guidir = $(pkgdatadir) guidir = $(pkgdatadir)
gui_DATA = astrognome.ui gui_DATA = astrognome.ui

View File

@ -1,6 +1,5 @@
#include <string.h> #include <string.h>
#include <glib/gi18n.h> #include <glib/gi18n.h>
#include <libgd/gd.h>
#include <libxml/parser.h> #include <libxml/parser.h>
#include <libxml/tree.h> #include <libxml/tree.h>
#include <webkit/webkit.h> #include <webkit/webkit.h>
@ -254,9 +253,9 @@ recalculate_chart(AgWindow *window)
} }
static void static void
tab_changed_cb(GdStack *stack, GParamSpec *pspec, AgWindow *window) tab_changed_cb(GtkStack *stack, GParamSpec *pspec, AgWindow *window)
{ {
const gchar *active_tab_name = gd_stack_get_visible_child_name(stack); const gchar *active_tab_name = gtk_stack_get_visible_child_name(stack);
GtkWidget *active_tab; GtkWidget *active_tab;
g_debug("Active tab changed: %s", active_tab_name); g_debug("Active tab changed: %s", active_tab_name);
@ -265,7 +264,7 @@ tab_changed_cb(GdStack *stack, GParamSpec *pspec, AgWindow *window)
return; return;
} }
active_tab = gd_stack_get_visible_child(stack); active_tab = gtk_stack_get_visible_child(stack);
if (strcmp("chart", active_tab_name) == 0) { if (strcmp("chart", active_tab_name) == 0) {
gtk_widget_set_size_request(active_tab, 600, 600); gtk_widget_set_size_request(active_tab, 600, 600);
@ -285,7 +284,7 @@ ag_window_change_tab_action(GSimpleAction *action, GVariant *parameter, gpointer
AgWindow *window = user_data; AgWindow *window = user_data;
const gchar *target_tab = g_variant_get_string(parameter, NULL); const gchar *target_tab = g_variant_get_string(parameter, NULL);
gd_stack_set_visible_child_name(GD_STACK(window->priv->stack), target_tab); gtk_stack_set_visible_child_name(GTK_STACK(window->priv->stack), target_tab);
g_action_change_state(G_ACTION(action), parameter); g_action_change_state(G_ACTION(action), parameter);
} }
@ -460,34 +459,33 @@ window_populate(AgWindow *window)
GtkWidget *scroll; GtkWidget *scroll;
GObject *menu; GObject *menu;
priv->header_bar = gd_header_bar_new(); priv->header_bar = gtk_header_bar_new();
gtk_widget_set_hexpand(priv->header_bar, TRUE); gtk_widget_set_hexpand(priv->header_bar, TRUE);
menu_button = gd_header_menu_button_new(); menu_button = gtk_menu_button_new();
gd_header_button_set_symbolic_icon_name(GD_HEADER_BUTTON(menu_button), "emblem-system-symbolic");
gtk_actionable_set_action_name(GTK_ACTIONABLE(menu_button), "win.gear-menu"); gtk_actionable_set_action_name(GTK_ACTIONABLE(menu_button), "win.gear-menu");
gd_header_bar_pack_end(GD_HEADER_BAR(priv->header_bar), menu_button); gtk_header_bar_pack_end(GTK_HEADER_BAR(priv->header_bar), menu_button);
gtk_grid_attach(GTK_GRID(priv->grid), priv->header_bar, 0, 0, 1, 1); gtk_grid_attach(GTK_GRID(priv->grid), priv->header_bar, 0, 0, 1, 1);
menu = gtk_builder_get_object(priv->builder, "window-menu"); menu = gtk_builder_get_object(priv->builder, "window-menu");
gtk_menu_button_set_menu_model(GTK_MENU_BUTTON(menu_button), G_MENU_MODEL(menu)); gtk_menu_button_set_menu_model(GTK_MENU_BUTTON(menu_button), G_MENU_MODEL(menu));
priv->stack = gd_stack_new(); priv->stack = gtk_stack_new();
gtk_widget_set_hexpand(priv->stack, TRUE); gtk_widget_set_hexpand(priv->stack, TRUE);
gtk_widget_set_vexpand(priv->stack, TRUE); gtk_widget_set_vexpand(priv->stack, TRUE);
gtk_grid_attach(GTK_GRID(priv->grid), priv->stack, 0, 1, 1, 1); gtk_grid_attach(GTK_GRID(priv->grid), priv->stack, 0, 1, 1, 1);
g_signal_connect(priv->stack, "notify::visible-child", G_CALLBACK(tab_changed_cb), window); g_signal_connect(priv->stack, "notify::visible-child", G_CALLBACK(tab_changed_cb), window);
priv->stack_switcher = gd_stack_switcher_new(); priv->stack_switcher = gtk_stack_switcher_new();
gd_stack_switcher_set_stack(GD_STACK_SWITCHER(priv->stack_switcher), GD_STACK(priv->stack)); gtk_stack_switcher_set_stack(GTK_STACK_SWITCHER(priv->stack_switcher), GTK_STACK(priv->stack));
priv->tab_edit = notebook_edit(window); priv->tab_edit = notebook_edit(window);
gd_stack_add_titled(GD_STACK(priv->stack), priv->tab_edit, "edit", _("Edit")); gtk_stack_add_titled(GTK_STACK(priv->stack), priv->tab_edit, "edit", _("Edit"));
scroll = gtk_scrolled_window_new(NULL, NULL); scroll = gtk_scrolled_window_new(NULL, NULL);
g_object_set(scroll, "shadow-type", GTK_SHADOW_IN, NULL); g_object_set(scroll, "shadow-type", GTK_SHADOW_IN, NULL);
gd_stack_add_titled(GD_STACK(priv->stack), scroll, "chart", _("Chart")); gtk_stack_add_titled(GTK_STACK(priv->stack), scroll, "chart", _("Chart"));
priv->tab_chart = webkit_web_view_new(); priv->tab_chart = webkit_web_view_new();
g_signal_connect(priv->tab_chart, "context-menu", G_CALLBACK(ag_window_chart_context_cb), NULL); g_signal_connect(priv->tab_chart, "context-menu", G_CALLBACK(ag_window_chart_context_cb), NULL);
@ -496,16 +494,16 @@ window_populate(AgWindow *window)
gtk_widget_set_size_request(priv->tab_chart, 600, 600); gtk_widget_set_size_request(priv->tab_chart, 600, 600);
priv->tab_aspects = gtk_label_new("PLACEHOLDER FOR THE ASPECTS TABLE"); priv->tab_aspects = gtk_label_new("PLACEHOLDER FOR THE ASPECTS TABLE");
gd_stack_add_titled(GD_STACK(priv->stack), priv->tab_aspects, "aspects", _("Aspects")); gtk_stack_add_titled(GTK_STACK(priv->stack), priv->tab_aspects, "aspects", _("Aspects"));
priv->tab_points = gtk_label_new("PLACEHOLDER FOR THE POINTS TABLES"); priv->tab_points = gtk_label_new("PLACEHOLDER FOR THE POINTS TABLES");
gd_stack_add_titled(GD_STACK(priv->stack), priv->tab_points, "points", _("Points")); gtk_stack_add_titled(GTK_STACK(priv->stack), priv->tab_points, "points", _("Points"));
/* TODO: change to the Chart tab if we are opening an existing chart! */ /* TODO: change to the Chart tab if we are opening an existing chart! */
gd_stack_set_visible_child_name(GD_STACK(priv->stack), "edit"); gtk_stack_set_visible_child_name(GTK_STACK(priv->stack), "edit");
priv->current_tab = priv->tab_edit; priv->current_tab = priv->tab_edit;
gd_header_bar_set_custom_title(GD_HEADER_BAR(priv->header_bar), priv->stack_switcher); gtk_header_bar_set_custom_title(GTK_HEADER_BAR(priv->header_bar), priv->stack_switcher);
gtk_widget_show_all(priv->grid); gtk_widget_show_all(priv->grid);
} }

View File

@ -8,10 +8,10 @@
#include <libxslt/transform.h> #include <libxslt/transform.h>
#include <libexslt/exslt.h> #include <libexslt/exslt.h>
#include <libgd/gd.h>
#include <swe-glib.h> #include <swe-glib.h>
#include "config.h"
#include "ag-app.h" #include "ag-app.h"
#include "ag-window.h" #include "ag-window.h"