diff --git a/src/Makefile.am b/src/Makefile.am index dc10eef..bd3e616 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,4 +2,5 @@ bin_PROGRAMS = gradix gradix_SOURCES = gradix.c calculate.c gradix_LDADD = $(LIBSWE_LIBS) $(GTK_LIBS) +gradix_LDFLAGS = -rdynamic gradix_CFLAGS = $(CFLAGS) $(GTK_CFLAGS) -Wall diff --git a/src/gradix.c b/src/gradix.c index fa54530..c492e31 100644 --- a/src/gradix.c +++ b/src/gradix.c @@ -2,6 +2,7 @@ #include #include #include +#include #include "calculate.h" @@ -9,6 +10,7 @@ #define IMAGEDIR "/home/polesz/Projektek/c/gradix/images" #define EPHEDIR "/home/polesz/Projektek/c/gradix/swe/data" +#define UI_FILE "/home/polesz/Projektek/c/gradix/src/gradix.ui" const char *signTypeName[] = { NULL, @@ -53,7 +55,47 @@ const char *signName[] = { "Pisces" }; -//RsvgHandle *svgHandle[SE_CHIRON + SIGN_PISCES + 1]; +GtkBuilder *builder; + +void +about_action_activate_cb(GtkAction *action, gpointer user_data) +{ + GtkDialog *about_dialog; + + about_dialog = GTK_DIALOG(gtk_builder_get_object(builder, "dialog_about")); + + gtk_dialog_run(about_dialog); + + gtk_widget_destroy(GTK_WIDGET(about_dialog)); +} + +int +main(int argc, char *argv[]) +{ + GtkWidget *mainWindow; + GError *err = NULL; + + gtk_init(&argc, &argv); + + builder = gtk_builder_new(); + + if (gtk_builder_add_from_file(builder, UI_FILE, &err) == 0) { + g_print("Juj!\n"); + } + + mainWindow = GTK_WIDGET(gtk_builder_get_object(builder, "main_window")); + gtk_builder_connect_signals (builder, NULL); + + gtk_widget_show(mainWindow); + gtk_main(); + + g_object_unref(G_OBJECT(builder)); + + return 0; +} + +/* +RsvgHandle *svgHandle[SE_CHIRON + SIGN_PISCES + 1]; gboolean init_graphics(void) @@ -228,7 +270,6 @@ main(int argc, char *argv[]) return OK; } -/* static gboolean draw_clock (ClutterCanvas *canvas, cairo_t *cr, int width, int height) { diff --git a/src/gradix.ui b/src/gradix.ui new file mode 100644 index 0000000..1d29e91 --- /dev/null +++ b/src/gradix.ui @@ -0,0 +1,667 @@ + + + + + + accelgroup1 + + + gtk-new + + + + + gtk-about + help-about + + + + + + False + 5 + dialog + + + False + vertical + 2 + + + False + end + + + gtk-cancel + True + True + True + True + + + False + True + 0 + + + + + gtk-ok + True + True + True + True + True + True + + + False + True + 1 + + + + + False + True + end + 0 + + + + + True + False + + + True + False + Name + + + 0 + 0 + 1 + 1 + + + + + True + True + + + + 1 + 0 + 5 + 1 + + + + + True + False + Year + + + 0 + 1 + 1 + 1 + + + + + True + False + Month + + + 2 + 1 + 1 + 1 + + + + + True + False + Day + + + 4 + 1 + 1 + 1 + + + + + True + True + + 4 + True + + + 1 + 1 + 1 + 1 + + + + + True + True + + 2 + True + + + 3 + 1 + 1 + 1 + + + + + True + True + + 2 + True + + + 5 + 1 + 1 + 1 + + + + + True + False + Hour + + + 0 + 2 + 1 + 1 + + + + + True + False + Minute + + + 2 + 2 + 1 + 1 + + + + + True + False + Second + + + 4 + 2 + 1 + 1 + + + + + True + True + + 2 + True + + + 1 + 2 + 1 + 1 + + + + + True + True + + 2 + True + + + 3 + 2 + 1 + 1 + + + + + True + True + + 2 + True + + + 5 + 2 + 1 + 1 + + + + + True + False + Latitude + + + 0 + 3 + 1 + 2 + + + + + True + False + Longitude + + + 3 + 3 + 1 + 2 + + + + + True + True + + 6 + False + 4 + True + + + 2 + 3 + 1 + 2 + + + + + True + True + + 6 + False + 4 + True + + + 5 + 3 + 1 + 2 + + + + + North + True + True + False + 0 + True + True + radiobutton2 + + + 1 + 3 + 1 + 1 + + + + + South + True + True + False + 0 + True + True + + + 1 + 4 + 1 + 1 + + + + + East + True + True + False + 0 + True + True + radiobutton4 + + + 4 + 3 + 1 + 1 + + + + + West + True + True + False + 0 + True + True + + + 4 + 4 + 1 + 1 + + + + + False + True + 1 + + + + + + button1 + button2 + + + + False + 5 + dialog + GRadix + 1.0 + 2013 Gergely Polonkai + http://gergely.polonkai.eu/gradix/ + Gergely POLONKAI <gergely@polonkai.eu> + gpl-3-0 + + + False + vertical + 2 + + + False + end + + + False + True + end + 0 + + + + + + + + + + False + + + + True + False + vertical + + + True + False + + + True + False + _File + True + + + True + False + + + action1 + True + False + True + True + + + + + gtk-open + True + False + True + True + + + + + gtk-save + True + False + True + True + + + + + gtk-save-as + True + False + True + True + + + + + True + False + + + + + gtk-quit + True + False + True + True + + + + + + + + + True + False + _Edit + True + + + True + False + + + gtk-cut + True + False + True + True + + + + + gtk-copy + True + False + True + True + + + + + gtk-paste + True + False + True + True + + + + + gtk-delete + True + False + True + True + + + + + + + + + True + False + _View + True + + + + + True + False + _Help + True + + + True + False + + + about_action + True + False + True + + + + + + + + + False + True + 0 + + + + + True + False + + + action1 + True + False + toolbutton1 + True + + + False + True + + + + + False + True + 1 + + + + + True + False + + + True + False + + + + + True + True + 2 + + + + + True + False + vertical + 2 + + + False + True + 3 + + + + + +