libgnomedb r1722 - in trunk: . control-center doc/C doc/C/tmpl extra extra/demos glade3 libgnomedb libgnomedb-graph libgnomedb/plugins samples/SimpleExample testing
- From: vivien svn gnome org
- To: svn-commits-list gnome org
- Subject: libgnomedb r1722 - in trunk: . control-center doc/C doc/C/tmpl extra extra/demos glade3 libgnomedb libgnomedb-graph libgnomedb/plugins samples/SimpleExample testing
- Date: Wed, 30 Apr 2008 21:19:19 +0100 (BST)
Author: vivien
Date: Wed Apr 30 20:19:18 2008
New Revision: 1722
URL: http://svn.gnome.org/viewvc/libgnomedb?rev=1722&view=rev
Log:
2008-04-30 Vivien Malerba <malerba gnome-db org>
* libgnomedb/gnome-db-raw-grid.c: clocking on a column header now orders the contents
based on this column
* extra/demos/graph.c:
* libgnomedb-graph/*: renamed all Goo to Canvas
* libgnomedb/plugins/gnome-db-entry-pict.c: type correction
* control-center/main.c:
* glade3/glade3-gnomedb.c:
* libgnomedb-graph/goo-canvas-test.c:
* doc/C/libgnomedb-4.0-sections.txt:
* doc/C/tmpl/libgnomedb.sgml:
* doc/C/tmpl/gnome-db-init.sgml:
* doc/C/example.c:
* testing/test-provider-schemas.c:
* testing/test-dyn-widgets.c:
* testing/test-handlers.c:
* extra/demos/main.c:
* extra/gnome-db-browser.c:
* libgnomedb/libgnomedb.h.in:
* libgnomedb/gnome-db-data-store.c:
* libgnomedb/gnome-db-raw-grid.c:
* libgnomedb/gnome-db-init.c:
* samples/SimpleExample/example.c: changed the gnome_db_init() signature to
void gnome_db_init (void), and removed the gnome_db_main_run() and gnome_db_main_quit()
functions.
WARNING: you have to call gtk_init() yourself as gnome_db_init() does not do
it anymore
Added:
trunk/libgnomedb-graph/gnome-db-canvas-column.c
- copied, changed from r1721, /trunk/libgnomedb-graph/gnome-db-goo-column.c
trunk/libgnomedb-graph/gnome-db-canvas-column.h
- copied, changed from r1721, /trunk/libgnomedb-graph/gnome-db-goo-column.h
trunk/libgnomedb-graph/gnome-db-canvas-cursor.c
- copied, changed from r1721, /trunk/libgnomedb-graph/gnome-db-goo-cursor.c
trunk/libgnomedb-graph/gnome-db-canvas-cursor.h
- copied, changed from r1721, /trunk/libgnomedb-graph/gnome-db-goo-cursor.h
trunk/libgnomedb-graph/gnome-db-canvas-db-relations.c
- copied, changed from r1721, /trunk/libgnomedb-graph/gnome-db-goo-db-relations.c
trunk/libgnomedb-graph/gnome-db-canvas-db-relations.h
- copied, changed from r1721, /trunk/libgnomedb-graph/gnome-db-goo-db-relations.h
trunk/libgnomedb-graph/gnome-db-canvas-decl.h
- copied, changed from r1721, /trunk/libgnomedb-graph/gnome-db-goo-decl.h
trunk/libgnomedb-graph/gnome-db-canvas-fkey.c
- copied, changed from r1721, /trunk/libgnomedb-graph/gnome-db-goo-fkey.c
trunk/libgnomedb-graph/gnome-db-canvas-fkey.h
- copied, changed from r1721, /trunk/libgnomedb-graph/gnome-db-goo-fkey.h
trunk/libgnomedb-graph/gnome-db-canvas-item.c
- copied, changed from r1721, /trunk/libgnomedb-graph/gnome-db-goo-item.c
trunk/libgnomedb-graph/gnome-db-canvas-item.h
- copied, changed from r1721, /trunk/libgnomedb-graph/gnome-db-goo-item.h
trunk/libgnomedb-graph/gnome-db-canvas-print.c
- copied, changed from r1721, /trunk/libgnomedb-graph/gnome-db-goo-print.c
trunk/libgnomedb-graph/gnome-db-canvas-print.h
- copied, changed from r1721, /trunk/libgnomedb-graph/gnome-db-goo-print.h
trunk/libgnomedb-graph/gnome-db-canvas-table.c
- copied, changed from r1721, /trunk/libgnomedb-graph/gnome-db-goo-table.c
trunk/libgnomedb-graph/gnome-db-canvas-table.h
- copied, changed from r1721, /trunk/libgnomedb-graph/gnome-db-goo-table.h
trunk/libgnomedb-graph/gnome-db-canvas-text.c
- copied, changed from r1721, /trunk/libgnomedb-graph/gnome-db-goo-text.c
trunk/libgnomedb-graph/gnome-db-canvas-text.h
- copied, changed from r1721, /trunk/libgnomedb-graph/gnome-db-goo-text.h
trunk/libgnomedb-graph/gnome-db-canvas-tip.c
- copied, changed from r1721, /trunk/libgnomedb-graph/gnome-db-goo-tip.c
trunk/libgnomedb-graph/gnome-db-canvas-tip.h
- copied, changed from r1721, /trunk/libgnomedb-graph/gnome-db-goo-tip.h
trunk/libgnomedb-graph/gnome-db-canvas-utility.c
- copied, changed from r1721, /trunk/libgnomedb-graph/gnome-db-goo-utility.c
trunk/libgnomedb-graph/gnome-db-canvas-utility.h
- copied, changed from r1721, /trunk/libgnomedb-graph/gnome-db-goo-utility.h
trunk/libgnomedb-graph/gnome-db-canvas.c
- copied, changed from r1721, /trunk/libgnomedb-graph/gnome-db-goo.c
trunk/libgnomedb-graph/gnome-db-canvas.h
- copied, changed from r1721, /trunk/libgnomedb-graph/gnome-db-goo.h
trunk/libgnomedb-graph/libgnomedb-graph.h
- copied, changed from r1721, /trunk/libgnomedb-graph/libgnomedb-goo.h
Removed:
trunk/libgnomedb-graph/gnome-db-goo-column.c
trunk/libgnomedb-graph/gnome-db-goo-column.h
trunk/libgnomedb-graph/gnome-db-goo-cursor.c
trunk/libgnomedb-graph/gnome-db-goo-cursor.h
trunk/libgnomedb-graph/gnome-db-goo-db-relations.c
trunk/libgnomedb-graph/gnome-db-goo-db-relations.h
trunk/libgnomedb-graph/gnome-db-goo-decl.h
trunk/libgnomedb-graph/gnome-db-goo-fkey.c
trunk/libgnomedb-graph/gnome-db-goo-fkey.h
trunk/libgnomedb-graph/gnome-db-goo-item.c
trunk/libgnomedb-graph/gnome-db-goo-item.h
trunk/libgnomedb-graph/gnome-db-goo-print.c
trunk/libgnomedb-graph/gnome-db-goo-print.h
trunk/libgnomedb-graph/gnome-db-goo-table.c
trunk/libgnomedb-graph/gnome-db-goo-table.h
trunk/libgnomedb-graph/gnome-db-goo-text.c
trunk/libgnomedb-graph/gnome-db-goo-text.h
trunk/libgnomedb-graph/gnome-db-goo-tip.c
trunk/libgnomedb-graph/gnome-db-goo-tip.h
trunk/libgnomedb-graph/gnome-db-goo-utility.c
trunk/libgnomedb-graph/gnome-db-goo-utility.h
trunk/libgnomedb-graph/gnome-db-goo.c
trunk/libgnomedb-graph/gnome-db-goo.h
trunk/libgnomedb-graph/libgnomedb-goo.h
Modified:
trunk/ChangeLog
trunk/control-center/main.c
trunk/doc/C/example.c
trunk/doc/C/libgnomedb-4.0-sections.txt
trunk/doc/C/tmpl/gnome-db-init.sgml
trunk/doc/C/tmpl/libgnomedb.sgml
trunk/extra/demos/demo_db.db
trunk/extra/demos/form_pict.c
trunk/extra/demos/graph.c
trunk/extra/demos/grid_pict.c
trunk/extra/demos/linked_grid_form.c
trunk/extra/demos/linked_model_param.c
trunk/extra/demos/main.c
trunk/extra/gnome-db-browser.c
trunk/glade3/glade3-gnomedb.c
trunk/libgnomedb-graph/Makefile.am
trunk/libgnomedb-graph/gnome-db-graph-item.h
trunk/libgnomedb-graph/gnome-db-graph.h
trunk/libgnomedb-graph/goo-canvas-test.c
trunk/libgnomedb/gnome-db-basic-form.c
trunk/libgnomedb/gnome-db-data-store.c
trunk/libgnomedb/gnome-db-init.c
trunk/libgnomedb/gnome-db-raw-grid.c
trunk/libgnomedb/libgnomedb.h.in
trunk/libgnomedb/plugins/gnome-db-entry-pict.c
trunk/samples/SimpleExample/example.c
trunk/testing/test-dyn-widgets.c
trunk/testing/test-handlers.c
trunk/testing/test-provider-schemas.c
Modified: trunk/control-center/main.c
==============================================================================
--- trunk/control-center/main.c (original)
+++ trunk/control-center/main.c Wed Apr 30 20:19:18 2008
@@ -117,7 +117,7 @@
static void
window_closed_cb (GtkAction *action, gpointer user_data)
{
- gnome_db_main_quit ();
+ gtk_main_quit ();
}
static void
@@ -235,7 +235,7 @@
static void
-create_main_window (gpointer user_data)
+create_main_window (void)
{
GtkWidget *window, *vbox;
GtkWidget *nb;
@@ -287,10 +287,13 @@
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
- gnome_db_init ("gnome-database-properties", PACKAGE_VERSION, argc, argv);
+ gnome_db_init ();
+ gtk_init (&argc, &argv);
+
+ create_main_window ();
/* application loop */
- gnome_db_main_run ((GdaInitFunc) create_main_window, NULL);
+ gtk_main ();
return 0;
}
Modified: trunk/doc/C/example.c
==============================================================================
--- trunk/doc/C/example.c (original)
+++ trunk/doc/C/example.c Wed Apr 30 20:19:18 2008
@@ -33,8 +33,9 @@
gchar *str;
MainData *data;
- /* Libgnomedb inittalization */
- gnome_db_init ("SimpleExample", "3.1.1", argc, argv);
+ /* Libgnomedb & GTK+ inittalization */
+ gnome_db_init ();
+ gtk_init (&argc, &argv);
/* open a connection */
client = gda_client_new ();
Modified: trunk/doc/C/libgnomedb-4.0-sections.txt
==============================================================================
--- trunk/doc/C/libgnomedb-4.0-sections.txt (original)
+++ trunk/doc/C/libgnomedb-4.0-sections.txt Wed Apr 30 20:19:18 2008
@@ -1,8 +1,6 @@
<SECTION>
<FILE>libgnomedb</FILE>
gnome_db_init
-gnome_db_main_run
-gnome_db_main_quit
gnome_db_get_application_exec_path
</SECTION>
Modified: trunk/doc/C/tmpl/gnome-db-init.sgml
==============================================================================
--- trunk/doc/C/tmpl/gnome-db-init.sgml (original)
+++ trunk/doc/C/tmpl/gnome-db-init.sgml Wed Apr 30 20:19:18 2008
@@ -22,25 +22,5 @@
</para>
- app_id:
- version:
- nargs:
- args:
-
-
-<!-- ##### FUNCTION gnome_db_main_run ##### -->
-<para>
-
-</para>
-
- init_func:
- user_data:
-
-
-<!-- ##### FUNCTION gnome_db_main_quit ##### -->
-<para>
-
-</para>
-
Modified: trunk/doc/C/tmpl/libgnomedb.sgml
==============================================================================
--- trunk/doc/C/tmpl/libgnomedb.sgml (original)
+++ trunk/doc/C/tmpl/libgnomedb.sgml Wed Apr 30 20:19:18 2008
@@ -22,26 +22,6 @@
</para>
- app_id:
- version:
- nargs:
- args:
-
-
-<!-- ##### FUNCTION gnome_db_main_run ##### -->
-<para>
-
-</para>
-
- init_func:
- user_data:
-
-
-<!-- ##### FUNCTION gnome_db_main_quit ##### -->
-<para>
-
-</para>
-
<!-- ##### FUNCTION gnome_db_get_application_exec_path ##### -->
Modified: trunk/extra/demos/demo_db.db
==============================================================================
Binary files trunk/extra/demos/demo_db.db (original) and trunk/extra/demos/demo_db.db Wed Apr 30 20:19:18 2008 differ
Modified: trunk/extra/demos/form_pict.c
==============================================================================
--- trunk/extra/demos/form_pict.c (original)
+++ trunk/extra/demos/form_pict.c Wed Apr 30 20:19:18 2008
@@ -61,6 +61,8 @@
g_object_set (G_OBJECT (param), "plugin", "picture", NULL);
gtk_box_pack_start (GTK_BOX (vbox), form, TRUE, TRUE, 0);
+
+ gtk_widget_set_size_request (window, 500, 500);
}
if (!GTK_WIDGET_VISIBLE (window))
Modified: trunk/extra/demos/graph.c
==============================================================================
--- trunk/extra/demos/graph.c (original)
+++ trunk/extra/demos/graph.c Wed Apr 30 20:19:18 2008
@@ -1,6 +1,6 @@
/* Graph
*
- * The GnomeDbGooDbRelation graph widget can be used to display
+ * The GnomeDbCanvasDbRelation graph widget can be used to display
* parts of a database structure which is held (among other information
* in the meta data associated to the connection).
*
@@ -9,7 +9,7 @@
*/
#include <libgnomedb/libgnomedb.h>
-#include <libgnomedb-graph/libgnomedb-goo.h>
+#include <libgnomedb-graph/libgnomedb-graph.h>
extern GdaConnection *demo_cnc;
static GtkWidget *window = NULL;
@@ -17,7 +17,7 @@
static void
auto_layout_clicked_cb (GtkButton *button, GtkWidget *canvas)
{
- gnome_db_goo_perform_auto_layout (GNOME_DB_GOO (canvas), TRUE, GNOME_DB_GOO_LAYOUT_DEFAULT);
+ gnome_db_canvas_perform_auto_layout (GNOME_DB_CANVAS (canvas), TRUE, GNOME_DB_CANVAS_LAYOUT_DEFAULT);
}
GtkWidget *
@@ -46,34 +46,34 @@
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, TRUE, TRUE, 0);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
- label = gtk_label_new ("The following GnomeDbGooDbRelation widget displays\n"
+ label = gtk_label_new ("The following GnomeDbCanvasDbRelation widget displays\n"
"a part of the database structure.\n\n"
"Right click in it for more...");
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
/* Create the demo widget */
- graphwidget = gnome_db_goo_db_relations_new (gda_connection_get_meta_store (demo_cnc));
- sw = gnome_db_goo_set_in_scrolled_window (GNOME_DB_GOO (graphwidget));
+ graphwidget = gnome_db_canvas_db_relations_new (gda_connection_get_meta_store (demo_cnc));
+ sw = gnome_db_canvas_set_in_scrolled_window (GNOME_DB_CANVAS (graphwidget));
gtk_widget_set_size_request (graphwidget, 320, 320);
gtk_box_pack_start (GTK_BOX (vbox), sw, TRUE, TRUE, 0);
/* add some tables to the graph */
g_value_set_string ((tname = gda_value_new (G_TYPE_STRING)), "customers");
- gnome_db_goo_db_relations_add_table_item (GNOME_DB_GOO_DB_RELATIONS (graphwidget), NULL, NULL, tname);
+ gnome_db_canvas_db_relations_add_table_item (GNOME_DB_CANVAS_DB_RELATIONS (graphwidget), NULL, NULL, tname);
g_value_set_string (tname, "orders");
- gnome_db_goo_db_relations_add_table_item (GNOME_DB_GOO_DB_RELATIONS (graphwidget), NULL, NULL, tname);
+ gnome_db_canvas_db_relations_add_table_item (GNOME_DB_CANVAS_DB_RELATIONS (graphwidget), NULL, NULL, tname);
g_value_set_string (tname, "order_contents");
- gnome_db_goo_db_relations_add_table_item (GNOME_DB_GOO_DB_RELATIONS (graphwidget), NULL, NULL, tname);
+ gnome_db_canvas_db_relations_add_table_item (GNOME_DB_CANVAS_DB_RELATIONS (graphwidget), NULL, NULL, tname);
g_value_set_string (tname, "products");
- gnome_db_goo_db_relations_add_table_item (GNOME_DB_GOO_DB_RELATIONS (graphwidget), NULL, NULL, tname);
+ gnome_db_canvas_db_relations_add_table_item (GNOME_DB_CANVAS_DB_RELATIONS (graphwidget), NULL, NULL, tname);
g_value_set_string (tname, "warehouses");
- gnome_db_goo_db_relations_add_table_item (GNOME_DB_GOO_DB_RELATIONS (graphwidget), NULL, NULL, tname);
+ gnome_db_canvas_db_relations_add_table_item (GNOME_DB_CANVAS_DB_RELATIONS (graphwidget), NULL, NULL, tname);
gda_value_free (tname);
- if (gnome_db_goo_auto_layout_enabled (GNOME_DB_GOO (graphwidget))) {
+ if (gnome_db_canvas_auto_layout_enabled (GNOME_DB_CANVAS (graphwidget))) {
/* apply auto layout */
- gnome_db_goo_perform_auto_layout (GNOME_DB_GOO (graphwidget), FALSE,
- GNOME_DB_GOO_LAYOUT_DEFAULT);
+ gnome_db_canvas_perform_auto_layout (GNOME_DB_CANVAS (graphwidget), FALSE,
+ GNOME_DB_CANVAS_LAYOUT_DEFAULT);
/* button to perform auto layout */
GtkWidget *button;
button = gtk_button_new_with_label ("Auto layout");
@@ -84,7 +84,7 @@
/* we need to display the widget so it is possible to set a correct zoom factor */
gtk_widget_show_all (window);
- gnome_db_goo_fit_zoom_factor (GNOME_DB_GOO (graphwidget));
+ gnome_db_canvas_fit_zoom_factor (GNOME_DB_CANVAS (graphwidget));
}
else {
if (!GTK_WIDGET_VISIBLE (window))
Modified: trunk/extra/demos/grid_pict.c
==============================================================================
--- trunk/extra/demos/grid_pict.c (original)
+++ trunk/extra/demos/grid_pict.c Wed Apr 30 20:19:18 2008
@@ -61,6 +61,8 @@
g_object_set (G_OBJECT (param), "plugin", "picture", NULL);
gtk_box_pack_start (GTK_BOX (vbox), grid, TRUE, TRUE, 0);
+
+ gtk_widget_set_size_request (window, 500, 500);
}
if (!GTK_WIDGET_VISIBLE (window))
Modified: trunk/extra/demos/linked_grid_form.c
==============================================================================
--- trunk/extra/demos/linked_grid_form.c (original)
+++ trunk/extra/demos/linked_grid_form.c Wed Apr 30 20:19:18 2008
@@ -23,7 +23,7 @@
GdaHolder *param;
iter = gnome_db_data_widget_get_current_data (data_widget);
- param = gda_set_get_holder (GDA_SET (iter), "SalesRep");
+ param = GDA_HOLDER (g_slist_nth_data (GDA_SET (iter)->holders, 2));
g_assert (gda_holder_set_source_model (param, restrict_with, restrict_col, NULL));
}
Modified: trunk/extra/demos/linked_model_param.c
==============================================================================
--- trunk/extra/demos/linked_model_param.c (original)
+++ trunk/extra/demos/linked_model_param.c Wed Apr 30 20:19:18 2008
@@ -57,7 +57,7 @@
"SELECT c.id, c.name, s.name AS \"SalesRep\""
"FROM customers c "
"LEFT JOIN salesrep s ON (s.id=c.default_served_by) "
- "WHERE s.id=##/*name:'SalesRep' type:gint descr:'Sales person'*/ "
+ "WHERE s.id = ##/*name:'SalesRep' type:gint descr:'Sales person'*/ "
"OR s.id IS NULL", NULL, NULL);
cust_model = gda_data_model_query_new (demo_cnc, stmt);
g_object_unref (stmt);
Modified: trunk/extra/demos/main.c
==============================================================================
--- trunk/extra/demos/main.c (original)
+++ trunk/extra/demos/main.c Wed Apr 30 20:19:18 2008
@@ -750,8 +750,9 @@
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
- /* Initialize libgnomedb */
- gnome_db_init ("gnome-db-demo", PACKAGE_VERSION, argc, argv);
+ /* Initialize libgnomedb & GTK+ */
+ gnome_db_init ();
+ gtk_init (&argc, &argv);
/* Initialize GdaConnection object */
full_filename = demo_find_file ("demo_db.db", &error);
Modified: trunk/extra/gnome-db-browser.c
==============================================================================
--- trunk/extra/gnome-db-browser.c (original)
+++ trunk/extra/gnome-db-browser.c Wed Apr 30 20:19:18 2008
@@ -82,7 +82,8 @@
textdomain (GETTEXT_PACKAGE);
/* Initialize the widget set */
- gnome_db_init ("gnome-db-browser", PACKAGE_VERSION, argc, argv);
+ gnome_db_init ();
+ gtk_init (&argc, &argv);
/* Browser config */
config = g_new0 (BrowserConfig, 1);
Modified: trunk/glade3/glade3-gnomedb.c
==============================================================================
--- trunk/glade3/glade3-gnomedb.c (original)
+++ trunk/glade3/glade3-gnomedb.c Wed Apr 30 20:19:18 2008
@@ -41,11 +41,9 @@
void GLADEGNOMEDB_API
glade_gnome_db_init (void)
{
- gchar *argv[2] = {"libgnomedb-glade3", NULL};
-
//Initation of the libgnomedb library
- gnome_db_init ("libgnomedb-glade3", "1.0", 1, argv);
+ gnome_db_init ();
}
/* Widgets' post init functions */
Modified: trunk/libgnomedb-graph/Makefile.am
==============================================================================
--- trunk/libgnomedb-graph/Makefile.am (original)
+++ trunk/libgnomedb-graph/Makefile.am Wed Apr 30 20:19:18 2008
@@ -1,5 +1,5 @@
lib_LTLIBRARIES = libgnomedb_graph-4.0.la
-noinst_PROGRAMS = graph-canvas-test
+noinst_PROGRAMS = goo-canvas-test
SUBDIRS =
@@ -16,20 +16,20 @@
-DDATADIR=\""$(datadir)"\" \
-DLIBDIR=\""$(libdir)"\"
-global_header = libgnomedb-goo.h
+global_header = libgnomedb-graph.h
libgnomedb_graph_headers = \
$(global_header) \
- gnome-db-goo.h \
- gnome-db-goo-cursor.h \
- gnome-db-goo-db-relations.h \
- gnome-db-goo-table.h \
- gnome-db-goo-column.h \
- gnome-db-goo-fkey.h \
- gnome-db-goo-item.h \
- gnome-db-goo-print.h \
- gnome-db-goo-text.h \
- gnome-db-goo-tip.h \
- gnome-db-goo-utility.h \
+ gnome-db-canvas.h \
+ gnome-db-canvas-cursor.h \
+ gnome-db-canvas-db-relations.h \
+ gnome-db-canvas-table.h \
+ gnome-db-canvas-column.h \
+ gnome-db-canvas-fkey.h \
+ gnome-db-canvas-item.h \
+ gnome-db-canvas-print.h \
+ gnome-db-canvas-text.h \
+ gnome-db-canvas-tip.h \
+ gnome-db-canvas-utility.h \
gnome-db-graph.h \
gnome-db-graph-item.h
@@ -39,22 +39,22 @@
libgnomedb_graph_4_0_la_SOURCES = \
$(global_header) \
$(libgnomedb_graph_headers) \
- gnome-db-goo.c \
- gnome-db-goo-cursor.c \
- gnome-db-goo-db-relations.c \
- gnome-db-goo-table.c \
- gnome-db-goo-column.c \
- gnome-db-goo-fkey.c \
- gnome-db-goo-item.c \
- gnome-db-goo-print.c \
- gnome-db-goo-text.c \
- gnome-db-goo-tip.c \
- gnome-db-goo-utility.c \
+ gnome-db-canvas.c \
+ gnome-db-canvas-cursor.c \
+ gnome-db-canvas-db-relations.c \
+ gnome-db-canvas-table.c \
+ gnome-db-canvas-column.c \
+ gnome-db-canvas-fkey.c \
+ gnome-db-canvas-item.c \
+ gnome-db-canvas-print.c \
+ gnome-db-canvas-text.c \
+ gnome-db-canvas-tip.c \
+ gnome-db-canvas-utility.c \
gnome-db-graph.c \
gnome-db-graph-item.c
libgnomedb_graph_4_0_la_LDFLAGS = -version-info $(GNOMEDB_CURRENT):$(GNOMEDB_REVISION):$(GNOMEDB_AGE) $(NO_UNDEFINED)
libgnomedb_graph_4_0_la_LIBADD = ../libgnomedb/libgnomedb-4.0.la $(LIBGNOMEDB_LIBS) $(GOOCANVAS_LIBS) $(GRAPHVIZ_LIBS)
-graph_canvas_test_SOURCES = goo-canvas-test.c
-graph_canvas_test_LDADD = libgnomedb_graph-4.0.la
+goo_canvas_test_SOURCES = goo-canvas-test.c
+goo_canvas_test_LDADD = libgnomedb_graph-4.0.la
Copied: trunk/libgnomedb-graph/gnome-db-canvas-column.c (from r1721, /trunk/libgnomedb-graph/gnome-db-goo-column.c)
==============================================================================
--- /trunk/libgnomedb-graph/gnome-db-goo-column.c (original)
+++ trunk/libgnomedb-graph/gnome-db-canvas-column.c Wed Apr 30 20:19:18 2008
@@ -1,4 +1,4 @@
-/* gnome-db-goo-column.c
+/* gnome-db-canvas-column.c
*
* Copyright (C) 2002 - 2008 Vivien Malerba
*
@@ -20,31 +20,31 @@
#include <libgda/libgda.h>
#include <glib/gi18n-lib.h>
-#include "gnome-db-goo.h"
-#include "gnome-db-goo-column.h"
-#include "gnome-db-goo-table.h"
-
-static void gnome_db_goo_column_class_init (GnomeDbGooColumnClass * class);
-static void gnome_db_goo_column_init (GnomeDbGooColumn * drag);
-static void gnome_db_goo_column_dispose (GObject *object);
+#include "gnome-db-canvas.h"
+#include "gnome-db-canvas-column.h"
+#include "gnome-db-canvas-table.h"
+
+static void gnome_db_canvas_column_class_init (GnomeDbCanvasColumnClass * class);
+static void gnome_db_canvas_column_init (GnomeDbCanvasColumn * drag);
+static void gnome_db_canvas_column_dispose (GObject *object);
-static void gnome_db_goo_column_set_property (GObject *object,
+static void gnome_db_canvas_column_set_property (GObject *object,
guint param_id,
const GValue *value,
GParamSpec *pspec);
-static void gnome_db_goo_column_get_property (GObject *object,
+static void gnome_db_canvas_column_get_property (GObject *object,
guint param_id,
GValue *value,
GParamSpec *pspec);
-static void gnome_db_goo_column_extra_event (GnomeDbGooItem * citem, GdkEventType event_type);
+static void gnome_db_canvas_column_extra_event (GnomeDbCanvasItem * citem, GdkEventType event_type);
enum
{
PROP_0,
PROP_COLUMN,
};
-struct _GnomeDbGooColumnPrivate
+struct _GnomeDbCanvasColumnPrivate
{
GdaMetaTableColumn *column;
};
@@ -53,24 +53,24 @@
static GObjectClass *column_parent_class = NULL;
GType
-gnome_db_goo_column_get_type (void)
+gnome_db_canvas_column_get_type (void)
{
static GType type = 0;
if (G_UNLIKELY (type == 0)) {
static const GTypeInfo info = {
- sizeof (GnomeDbGooColumnClass),
+ sizeof (GnomeDbCanvasColumnClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
- (GClassInitFunc) gnome_db_goo_column_class_init,
+ (GClassInitFunc) gnome_db_canvas_column_class_init,
NULL,
NULL,
- sizeof (GnomeDbGooColumn),
+ sizeof (GnomeDbCanvasColumn),
0,
- (GInstanceInitFunc) gnome_db_goo_column_init
+ (GInstanceInitFunc) gnome_db_canvas_column_init
};
- type = g_type_register_static (GNOME_DB_TYPE_GOO_TEXT, "GnomeDbGooColumn", &info, 0);
+ type = g_type_register_static (GNOME_DB_TYPE_CANVAS_TEXT, "GnomeDbCanvasColumn", &info, 0);
}
return type;
@@ -79,18 +79,18 @@
static void
-gnome_db_goo_column_class_init (GnomeDbGooColumnClass * class)
+gnome_db_canvas_column_class_init (GnomeDbCanvasColumnClass * class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
column_parent_class = g_type_class_peek_parent (class);
- object_class->dispose = gnome_db_goo_column_dispose;
- GNOME_DB_GOO_ITEM_CLASS (class)->extra_event = gnome_db_goo_column_extra_event;
+ object_class->dispose = gnome_db_canvas_column_dispose;
+ GNOME_DB_CANVAS_ITEM_CLASS (class)->extra_event = gnome_db_canvas_column_extra_event;
/* Properties */
- object_class->set_property = gnome_db_goo_column_set_property;
- object_class->get_property = gnome_db_goo_column_get_property;
+ object_class->set_property = gnome_db_canvas_column_set_property;
+ object_class->get_property = gnome_db_canvas_column_get_property;
g_object_class_install_property
(object_class, PROP_COLUMN,
@@ -99,20 +99,20 @@
}
static void
-gnome_db_goo_column_init (GnomeDbGooColumn * column)
+gnome_db_canvas_column_init (GnomeDbCanvasColumn * column)
{
- column->priv = g_new0 (GnomeDbGooColumnPrivate, 1);
+ column->priv = g_new0 (GnomeDbCanvasColumnPrivate, 1);
column->priv->column = NULL;
}
static void
-gnome_db_goo_column_dispose (GObject * object)
+gnome_db_canvas_column_dispose (GObject * object)
{
- GnomeDbGooColumn *cf;
+ GnomeDbCanvasColumn *cf;
g_return_if_fail (object != NULL);
- g_return_if_fail (GNOME_DB_IS_GOO_COLUMN (object));
+ g_return_if_fail (GNOME_DB_IS_CANVAS_COLUMN (object));
- cf = GNOME_DB_GOO_COLUMN (object);
+ cf = GNOME_DB_CANVAS_COLUMN (object);
if (cf->priv) {
if (cf->priv->column)
cf->priv->column = NULL;
@@ -125,16 +125,16 @@
}
static void
-gnome_db_goo_column_set_property (GObject *object,
+gnome_db_canvas_column_set_property (GObject *object,
guint param_id,
const GValue *value,
GParamSpec *pspec)
{
- GnomeDbGooColumn *cf = NULL;
+ GnomeDbCanvasColumn *cf = NULL;
GdaMetaTableColumn* column = NULL;
GString *string = NULL;
- cf = GNOME_DB_GOO_COLUMN (object);
+ cf = GNOME_DB_CANVAS_COLUMN (object);
switch (param_id) {
case PROP_COLUMN:
@@ -150,7 +150,7 @@
g_string_append_printf (string, _("Type: %s"), column->column_type);
g_object_set (object,
- "highlight_color", GNOME_DB_GOO_DB_TABLE_COLOR,
+ "highlight_color", GNOME_DB_CANVAS_DB_TABLE_COLOR,
"text_underline", !column->nullok,
"text_bold", column->pkey,
NULL);
@@ -165,14 +165,14 @@
}
static void
-gnome_db_goo_column_get_property (GObject *object,
+gnome_db_canvas_column_get_property (GObject *object,
guint param_id,
GValue *value,
GParamSpec *pspec)
{
- GnomeDbGooColumn *cf;
+ GnomeDbCanvasColumn *cf;
- cf = GNOME_DB_GOO_COLUMN (object);
+ cf = GNOME_DB_CANVAS_COLUMN (object);
switch (param_id) {
case PROP_COLUMN:
@@ -182,33 +182,33 @@
}
static void
-gnome_db_goo_column_extra_event (GnomeDbGooItem *citem, GdkEventType event_type)
+gnome_db_canvas_column_extra_event (GnomeDbCanvasItem *citem, GdkEventType event_type)
{
if (event_type == GDK_LEAVE_NOTIFY)
- gnome_db_goo_text_set_highlight (GNOME_DB_GOO_TEXT (citem), FALSE);
+ gnome_db_canvas_text_set_highlight (GNOME_DB_CANVAS_TEXT (citem), FALSE);
}
/**
- * gnome_db_goo_column_new
+ * gnome_db_canvas_column_new
* @parent: the parent item, or %NULL
* @column: the represented entity's column
* @x: the x coordinate of the text
* @y: the y coordinate of the text
* @...: optional pairs of property names and values, and a terminating %NULL.
*
- * Creates a new #GnomeDbGooColumn object
+ * Creates a new #GnomeDbCanvasColumn object
*/
GooCanvasItem*
-gnome_db_goo_column_new (GooCanvasItem *parent, GdaMetaTableColumn *column,
+gnome_db_canvas_column_new (GooCanvasItem *parent, GdaMetaTableColumn *column,
gdouble x, gdouble y, ...)
{
GooCanvasItem *item;
- GnomeDbGooColumn *goocolumn;
+ GnomeDbCanvasColumn *goocolumn;
const char *first_property;
va_list var_args;
- item = g_object_new (GNOME_DB_TYPE_GOO_COLUMN, NULL);
- goocolumn = (GnomeDbGooColumn*) item;
+ item = g_object_new (GNOME_DB_TYPE_CANVAS_COLUMN, NULL);
+ goocolumn = (GnomeDbCanvasColumn*) item;
if (parent) {
goo_canvas_item_add_child (parent, item, -1);
@@ -229,17 +229,17 @@
/**
- * gnome_db_goo_column_get_column
- * @column: a #GnomeDbGooColumn object
+ * gnome_db_canvas_column_get_column
+ * @column: a #GnomeDbCanvasColumn object
*
* Get the #GdaMetaTableColumn which @column represents
*
* Returns: the object implementing the #GdaMetaTableColumn interface
*/
GdaMetaTableColumn *
-gnome_db_goo_column_get_column (GnomeDbGooColumn *column)
+gnome_db_canvas_column_get_column (GnomeDbCanvasColumn *column)
{
- g_return_val_if_fail (GNOME_DB_IS_GOO_COLUMN (column), NULL);
+ g_return_val_if_fail (GNOME_DB_IS_CANVAS_COLUMN (column), NULL);
g_return_val_if_fail (column->priv, NULL);
return column->priv->column;
@@ -247,22 +247,22 @@
/**
- * gnome_db_goo_column_get_parent_item
- * @column: a #GnomeDbGooColumn object
+ * gnome_db_canvas_column_get_parent_item
+ * @column: a #GnomeDbCanvasColumn object
*
- * Get the #GnomeDbGooTable in which @column is
+ * Get the #GnomeDbCanvasTable in which @column is
*
- * Returns: the #GnomeDbGooTable in which @column is, or %NULL
+ * Returns: the #GnomeDbCanvasTable in which @column is, or %NULL
*/
-GnomeDbGooTable *
-gnome_db_goo_column_get_parent_item (GnomeDbGooColumn *column)
+GnomeDbCanvasTable *
+gnome_db_canvas_column_get_parent_item (GnomeDbCanvasColumn *column)
{
GooCanvasItem *ci;
- g_return_val_if_fail (GNOME_DB_IS_GOO_COLUMN (column), NULL);
+ g_return_val_if_fail (GNOME_DB_IS_CANVAS_COLUMN (column), NULL);
for (ci = goo_canvas_item_get_parent (GOO_CANVAS_ITEM (column));
- ci && !GNOME_DB_IS_GOO_TABLE (ci);
+ ci && !GNOME_DB_IS_CANVAS_TABLE (ci);
ci = goo_canvas_item_get_parent (ci));
- return (GnomeDbGooTable *) ci;
+ return (GnomeDbCanvasTable *) ci;
}
Copied: trunk/libgnomedb-graph/gnome-db-canvas-column.h (from r1721, /trunk/libgnomedb-graph/gnome-db-goo-column.h)
==============================================================================
--- /trunk/libgnomedb-graph/gnome-db-goo-column.h (original)
+++ trunk/libgnomedb-graph/gnome-db-canvas-column.h Wed Apr 30 20:19:18 2008
@@ -1,4 +1,4 @@
-/* gnome-db-goo-column.h
+/* gnome-db-canvas-column.h
*
* Copyright (C) 2004 Vivien Malerba
*
@@ -18,47 +18,47 @@
* USA
*/
-#ifndef __GNOME_DB_GOO_COLUMN__
-#define __GNOME_DB_GOO_COLUMN__
+#ifndef __GNOME_DB_CANVAS_COLUMN__
+#define __GNOME_DB_CANVAS_COLUMN__
#include <libgnomedb/gnome-db-decl.h>
-#include "gnome-db-goo-text.h"
+#include "gnome-db-canvas-text.h"
G_BEGIN_DECLS
/*
*
- * "Drag item" GooCanvas item: a GnomeDbGooItem item which is used to represent
+ * "Drag item" GooCanvas item: a GnomeDbCanvasItem item which is used to represent
* an element being dragged, and destroys itself when the mouse button is released
*
*/
-#define GNOME_DB_TYPE_GOO_COLUMN (gnome_db_goo_column_get_type())
-#define GNOME_DB_GOO_COLUMN(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, gnome_db_goo_column_get_type(), GnomeDbGooColumn)
-#define GNOME_DB_GOO_COLUMN_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, gnome_db_goo_column_get_type (), GnomeDbGooColumnClass)
-#define GNOME_DB_IS_GOO_COLUMN(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, gnome_db_goo_column_get_type ())
+#define GNOME_DB_TYPE_CANVAS_COLUMN (gnome_db_canvas_column_get_type())
+#define GNOME_DB_CANVAS_COLUMN(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, gnome_db_canvas_column_get_type(), GnomeDbCanvasColumn)
+#define GNOME_DB_CANVAS_COLUMN_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, gnome_db_canvas_column_get_type (), GnomeDbCanvasColumnClass)
+#define GNOME_DB_IS_CANVAS_COLUMN(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, gnome_db_canvas_column_get_type ())
/* struct for the object's data */
-struct _GnomeDbGooColumn
+struct _GnomeDbCanvasColumn
{
- GnomeDbGooText object;
+ GnomeDbCanvasText object;
- GnomeDbGooColumnPrivate *priv;
+ GnomeDbCanvasColumnPrivate *priv;
};
/* struct for the object's class */
-struct _GnomeDbGooColumnClass
+struct _GnomeDbCanvasColumnClass
{
- GnomeDbGooTextClass parent_class;
+ GnomeDbCanvasTextClass parent_class;
};
/* generic widget's functions */
-GType gnome_db_goo_column_get_type (void) G_GNUC_CONST;
-GooCanvasItem* gnome_db_goo_column_new (GooCanvasItem *parent, GdaMetaTableColumn *column,
+GType gnome_db_canvas_column_get_type (void) G_GNUC_CONST;
+GooCanvasItem* gnome_db_canvas_column_new (GooCanvasItem *parent, GdaMetaTableColumn *column,
gdouble x, gdouble y, ...);
-GdaMetaTableColumn *gnome_db_goo_column_get_column (GnomeDbGooColumn *column);
-GnomeDbGooTable *gnome_db_goo_column_get_parent_item (GnomeDbGooColumn *column);
+GdaMetaTableColumn *gnome_db_canvas_column_get_column (GnomeDbCanvasColumn *column);
+GnomeDbCanvasTable *gnome_db_canvas_column_get_parent_item (GnomeDbCanvasColumn *column);
G_END_DECLS
Copied: trunk/libgnomedb-graph/gnome-db-canvas-cursor.c (from r1721, /trunk/libgnomedb-graph/gnome-db-goo-cursor.c)
==============================================================================
--- /trunk/libgnomedb-graph/gnome-db-goo-cursor.c (original)
+++ trunk/libgnomedb-graph/gnome-db-canvas-cursor.c Wed Apr 30 20:19:18 2008
@@ -1,4 +1,4 @@
-/* gnome-db-goo-cursor.c
+/* gnome-db-canvas-cursor.c
*
* Copyright (C) 2002 - 2007 Vivien Malerba
*
@@ -19,18 +19,18 @@
*/
#include "gnome-db-decl.h"
-#include "gnome-db-goo-cursor.h"
+#include "gnome-db-canvas-cursor.h"
#include <libgnomedb/marshal.h>
-static void gnome_db_goo_cursor_class_init (GnomeDbGooCursorClass * class);
-static void gnome_db_goo_cursor_init (GnomeDbGooCursor * drag);
-static void gnome_db_goo_cursor_dispose (GObject * object);
+static void gnome_db_canvas_cursor_class_init (GnomeDbCanvasCursorClass * class);
+static void gnome_db_canvas_cursor_init (GnomeDbCanvasCursor * drag);
+static void gnome_db_canvas_cursor_dispose (GObject * object);
-static void gnome_db_goo_cursor_set_property (GObject *object,
+static void gnome_db_canvas_cursor_set_property (GObject *object,
guint param_id,
const GValue *value,
GParamSpec *pspec);
-static void gnome_db_goo_cursor_get_property (GObject *object,
+static void gnome_db_canvas_cursor_get_property (GObject *object,
guint param_id,
GValue *value,
GParamSpec *pspec);
@@ -52,24 +52,24 @@
static GObjectClass *cursor_parent_class = NULL;
GType
-gnome_db_goo_cursor_get_type (void)
+gnome_db_canvas_cursor_get_type (void)
{
static GType type = 0;
if (G_UNLIKELY (type == 0)) {
static const GTypeInfo info = {
- sizeof (GnomeDbGooCursorClass),
+ sizeof (GnomeDbCanvasCursorClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
- (GClassInitFunc) gnome_db_goo_cursor_class_init,
+ (GClassInitFunc) gnome_db_canvas_cursor_class_init,
NULL,
NULL,
- sizeof (GnomeDbGooCursor),
+ sizeof (GnomeDbCanvasCursor),
0,
- (GInstanceInitFunc) gnome_db_goo_cursor_init
+ (GInstanceInitFunc) gnome_db_canvas_cursor_init
};
- type = g_type_register_static (GNOME_DB_TYPE_GOO_ITEM, "GnomeDbGooCursor", &info, 0);
+ type = g_type_register_static (GNOME_DB_TYPE_CANVAS_ITEM, "GnomeDbCanvasCursor", &info, 0);
}
return type;
@@ -78,17 +78,17 @@
static void
-gnome_db_goo_cursor_class_init (GnomeDbGooCursorClass * class)
+gnome_db_canvas_cursor_class_init (GnomeDbCanvasCursorClass * class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
cursor_parent_class = g_type_class_peek_parent (class);
- object_class->dispose = gnome_db_goo_cursor_dispose;
+ object_class->dispose = gnome_db_canvas_cursor_dispose;
/* Properties */
- object_class->set_property = gnome_db_goo_cursor_set_property;
- object_class->get_property = gnome_db_goo_cursor_get_property;
+ object_class->set_property = gnome_db_canvas_cursor_set_property;
+ object_class->get_property = gnome_db_canvas_cursor_get_property;
g_object_class_install_property
(object_class, PROP_FILLCOLOR,
@@ -111,7 +111,7 @@
GdkEventButton *event, gpointer data);
static void
-gnome_db_goo_cursor_init (GnomeDbGooCursor * cursor)
+gnome_db_canvas_cursor_init (GnomeDbCanvasCursor * cursor)
{
cursor->item = NULL;
@@ -129,27 +129,27 @@
}
static void
-gnome_db_goo_cursor_dispose (GObject * object)
+gnome_db_canvas_cursor_dispose (GObject * object)
{
g_return_if_fail (object != NULL);
- g_return_if_fail (GNOME_DB_IS_GOO_CURSOR (object));
+ g_return_if_fail (GNOME_DB_IS_CANVAS_CURSOR (object));
/* for the parent class */
cursor_parent_class->dispose (object);
}
-static void post_init (GnomeDbGooCursor * cursor);
+static void post_init (GnomeDbCanvasCursor * cursor);
static void
-gnome_db_goo_cursor_set_property (GObject *object,
+gnome_db_canvas_cursor_set_property (GObject *object,
guint param_id,
const GValue *value,
GParamSpec *pspec)
{
- GnomeDbGooCursor *cd;
+ GnomeDbCanvasCursor *cd;
gchar *str;
- cd = GNOME_DB_GOO_CURSOR (object);
+ cd = GNOME_DB_CANVAS_CURSOR (object);
if (!cd->item)
post_init (cd);
@@ -175,16 +175,16 @@
}
static void
-gnome_db_goo_cursor_get_property (GObject *object,
+gnome_db_canvas_cursor_get_property (GObject *object,
guint param_id,
GValue *value,
GParamSpec *pspec)
{
- GnomeDbGooCursor *cd;
+ GnomeDbCanvasCursor *cd;
gchar *str;
gdouble dval;
- cd = GNOME_DB_GOO_CURSOR (object);
+ cd = GNOME_DB_CANVAS_CURSOR (object);
if (!cd->item)
post_init (cd);
@@ -215,7 +215,7 @@
static void
-post_init (GnomeDbGooCursor * cursor)
+post_init (GnomeDbCanvasCursor * cursor)
{
cursor->item = goo_canvas_rect_new (GOO_CANVAS_ITEM (cursor),
0., 0., 20., 8.,
@@ -223,7 +223,7 @@
}
/**
- * gnome_db_goo_cursor_new
+ * gnome_db_canvas_cursor_new
* @parent: the parent item, or NULL.
* @...: optional pairs of property names and values, and a terminating NULL.
*
@@ -232,13 +232,13 @@
* Returns: a new #GooCanvasItem object
*/
GooCanvasItem *
-gnome_db_goo_cursor_new (GooCanvasItem *parent, ...)
+gnome_db_canvas_cursor_new (GooCanvasItem *parent, ...)
{
GooCanvasItem *item;
const char *first_property;
va_list var_args;
- item = g_object_new (GNOME_DB_TYPE_GOO_CURSOR, NULL);
+ item = g_object_new (GNOME_DB_TYPE_CANVAS_CURSOR, NULL);
if (parent) {
goo_canvas_item_add_child (parent, item, -1);
Copied: trunk/libgnomedb-graph/gnome-db-canvas-cursor.h (from r1721, /trunk/libgnomedb-graph/gnome-db-goo-cursor.h)
==============================================================================
--- /trunk/libgnomedb-graph/gnome-db-goo-cursor.h (original)
+++ trunk/libgnomedb-graph/gnome-db-canvas-cursor.h Wed Apr 30 20:19:18 2008
@@ -1,4 +1,4 @@
-/* gnome-db-goo-cursor.h
+/* gnome-db-canvas-cursor.h
*
* Copyright (C) 2002 - 2004 Vivien Malerba
*
@@ -18,47 +18,47 @@
* USA
*/
-#ifndef __GNOME_DB_GOO_CURSOR__
-#define __GNOME_DB_GOO_CURSOR__
+#ifndef __GNOME_DB_CANVAS_CURSOR__
+#define __GNOME_DB_CANVAS_CURSOR__
-#include "gnome-db-goo-item.h"
+#include "gnome-db-canvas-item.h"
G_BEGIN_DECLS
/*
*
- * "Drag item" GooCanvas item: a GnomeDbGooItem item which is used to represent
+ * "Drag item" GooCanvas item: a GnomeDbCanvasItem item which is used to represent
* an element being dragged, and destroys itself when the mouse button is released
*
*/
-#define GNOME_DB_TYPE_GOO_CURSOR (gnome_db_goo_cursor_get_type())
-#define GNOME_DB_GOO_CURSOR(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, gnome_db_goo_cursor_get_type(), GnomeDbGooCursor)
-#define GNOME_DB_GOO_CURSOR_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, gnome_db_goo_cursor_get_type (), GnomeDbGooCursorClass)
-#define GNOME_DB_IS_GOO_CURSOR(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, gnome_db_goo_cursor_get_type ())
+#define GNOME_DB_TYPE_CANVAS_CURSOR (gnome_db_canvas_cursor_get_type())
+#define GNOME_DB_CANVAS_CURSOR(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, gnome_db_canvas_cursor_get_type(), GnomeDbCanvasCursor)
+#define GNOME_DB_CANVAS_CURSOR_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, gnome_db_canvas_cursor_get_type (), GnomeDbCanvasCursorClass)
+#define GNOME_DB_IS_CANVAS_CURSOR(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, gnome_db_canvas_cursor_get_type ())
-typedef struct _GnomeDbGooCursor GnomeDbGooCursor;
-typedef struct _GnomeDbGooCursorClass GnomeDbGooCursorClass;
+typedef struct _GnomeDbCanvasCursor GnomeDbCanvasCursor;
+typedef struct _GnomeDbCanvasCursorClass GnomeDbCanvasCursorClass;
/* struct for the object's data */
-struct _GnomeDbGooCursor
+struct _GnomeDbCanvasCursor
{
- GnomeDbGooItem object;
+ GnomeDbCanvasItem object;
GooCanvasItem *item;
};
/* struct for the object's class */
-struct _GnomeDbGooCursorClass
+struct _GnomeDbCanvasCursorClass
{
- GnomeDbGooItemClass parent_class;
+ GnomeDbCanvasItemClass parent_class;
};
/* generic widget's functions */
-GType gnome_db_goo_cursor_get_type (void) G_GNUC_CONST;
-GooCanvasItem *gnome_db_goo_cursor_new (GooCanvasItem *parent, ...);
+GType gnome_db_canvas_cursor_get_type (void) G_GNUC_CONST;
+GooCanvasItem *gnome_db_canvas_cursor_new (GooCanvasItem *parent, ...);
G_END_DECLS
Copied: trunk/libgnomedb-graph/gnome-db-canvas-db-relations.c (from r1721, /trunk/libgnomedb-graph/gnome-db-goo-db-relations.c)
==============================================================================
--- /trunk/libgnomedb-graph/gnome-db-goo-db-relations.c (original)
+++ trunk/libgnomedb-graph/gnome-db-canvas-db-relations.c Wed Apr 30 20:19:18 2008
@@ -1,4 +1,4 @@
-/* gnome-db-goo-db-relations.c
+/* gnome-db-canvas-db-relations.c
*
* Copyright (C) 2002 - 2007 Vivien Malerba
* Copyright (C) 2002 Fernando Martins
@@ -23,38 +23,38 @@
#include <libgnomedb/marshal.h>
#include <libgda/libgda.h>
#include <glib/gi18n-lib.h>
-#include "gnome-db-goo-db-relations.h"
-#include "gnome-db-goo-table.h"
-#include "gnome-db-goo-column.h"
-#include "gnome-db-goo-fkey.h"
+#include "gnome-db-canvas-db-relations.h"
+#include "gnome-db-canvas-table.h"
+#include "gnome-db-canvas-column.h"
+#include "gnome-db-canvas-fkey.h"
#include "gnome-db-graph.h"
#include "gnome-db-graph-item.h"
-static void gnome_db_goo_db_relations_class_init (GnomeDbGooDbRelationsClass *class);
-static void gnome_db_goo_db_relations_init (GnomeDbGooDbRelations *canvas);
-static void gnome_db_goo_db_relations_dispose (GObject *object);
+static void gnome_db_canvas_db_relations_class_init (GnomeDbCanvasDbRelationsClass *class);
+static void gnome_db_canvas_db_relations_init (GnomeDbCanvasDbRelations *canvas);
+static void gnome_db_canvas_db_relations_dispose (GObject *object);
-static void gnome_db_goo_db_relations_set_property (GObject *object,
+static void gnome_db_canvas_db_relations_set_property (GObject *object,
guint param_id,
const GValue *value,
GParamSpec *pspec);
-static void gnome_db_goo_db_relations_get_property (GObject *object,
+static void gnome_db_canvas_db_relations_get_property (GObject *object,
guint param_id,
GValue *value,
GParamSpec *pspec);
/* virtual functions */
-static void create_canvas_items (GnomeDbGoo *canvas);
-static void clean_canvas_items (GnomeDbGoo *canvas);
-static void graph_item_added (GnomeDbGoo *canvas, GnomeDbGraphItem *item);
-static void graph_item_dropped (GnomeDbGoo *canvas, GnomeDbGraphItem *item);
-static GtkWidget *build_context_menu (GnomeDbGoo *canvas);
+static void create_canvas_items (GnomeDbCanvas *canvas);
+static void clean_canvas_items (GnomeDbCanvas *canvas);
+static void graph_item_added (GnomeDbCanvas *canvas, GnomeDbGraphItem *item);
+static void graph_item_dropped (GnomeDbCanvas *canvas, GnomeDbGraphItem *item);
+static GtkWidget *build_context_menu (GnomeDbCanvas *canvas);
-static GdaMetaStruct *get_mstruct (GnomeDbGooDbRelations *canvas);
-static void drag_action_dcb (GnomeDbGoo *canvas, GnomeDbGooItem *from_item, GnomeDbGooItem *to_item);
+static GdaMetaStruct *get_mstruct (GnomeDbCanvasDbRelations *canvas);
+static void drag_action_dcb (GnomeDbCanvas *canvas, GnomeDbCanvasItem *from_item, GnomeDbCanvasItem *to_item);
-static void meta_store_changed_cb (GdaMetaStore *store, GSList *changes, GnomeDbGooDbRelations *canvas);
-static void meta_store_reset_cb (GdaMetaStore *store, GnomeDbGooDbRelations *canvas);
+static void meta_store_changed_cb (GdaMetaStore *store, GSList *changes, GnomeDbCanvasDbRelations *canvas);
+static void meta_store_reset_cb (GdaMetaStore *store, GnomeDbCanvasDbRelations *canvas);
/* get a pointer to the parents to be able to call their destructor */
static GObjectClass *parent_class = NULL;
@@ -66,43 +66,43 @@
PROP_META_STRUCT
};
-struct _GnomeDbGooDbRelationsPrivate
+struct _GnomeDbCanvasDbRelationsPrivate
{
- GHashTable *hash_tables; /* key = GdaMetaTable, value = GnomeDbGooMetaTable (and the reverse) */
- GHashTable *hash_fkeys; /* key = GdaMetaTableForeignKey, value = GnomeDbGooFkey */
- GSList *all_items; /* list of all the GnomeDbGooItem objects */
+ GHashTable *hash_tables; /* key = GdaMetaTable, value = GnomeDbCanvasMetaTable (and the reverse) */
+ GHashTable *hash_fkeys; /* key = GdaMetaTableForeignKey, value = GnomeDbCanvasFkey */
+ GSList *all_items; /* list of all the GnomeDbCanvasItem objects */
GdaMetaStore *store;
GdaMetaStruct *mstruct; /* re-computed when @store changes */
};
GType
-gnome_db_goo_db_relations_get_type (void)
+gnome_db_canvas_db_relations_get_type (void)
{
static GType type = 0;
if (G_UNLIKELY (type == 0)) {
static const GTypeInfo info = {
- sizeof (GnomeDbGooDbRelationsClass),
+ sizeof (GnomeDbCanvasDbRelationsClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
- (GClassInitFunc) gnome_db_goo_db_relations_class_init,
+ (GClassInitFunc) gnome_db_canvas_db_relations_class_init,
NULL,
NULL,
- sizeof (GnomeDbGooDbRelations),
+ sizeof (GnomeDbCanvasDbRelations),
0,
- (GInstanceInitFunc) gnome_db_goo_db_relations_init
+ (GInstanceInitFunc) gnome_db_canvas_db_relations_init
};
- type = g_type_register_static (GNOME_DB_TYPE_GOO, "GnomeDbGooDbRelations", &info, 0);
+ type = g_type_register_static (GNOME_DB_TYPE_CANVAS, "GnomeDbCanvasDbRelations", &info, 0);
}
return type;
}
static void
-gnome_db_goo_db_relations_init (GnomeDbGooDbRelations * canvas)
+gnome_db_canvas_db_relations_init (GnomeDbCanvasDbRelations * canvas)
{
- canvas->priv = g_new0 (GnomeDbGooDbRelationsPrivate, 1);
+ canvas->priv = g_new0 (GnomeDbCanvasDbRelationsPrivate, 1);
canvas->priv->hash_tables = g_hash_table_new (NULL, NULL);
canvas->priv->hash_fkeys = g_hash_table_new (NULL, NULL);
canvas->priv->store = NULL;
@@ -110,25 +110,25 @@
}
static void
-gnome_db_goo_db_relations_class_init (GnomeDbGooDbRelationsClass * class)
+gnome_db_canvas_db_relations_class_init (GnomeDbCanvasDbRelationsClass * class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
parent_class = g_type_class_peek_parent (class);
- /* GnomeDbGoo virtual functions */
- GNOME_DB_GOO_CLASS (class)->create_canvas_items = create_canvas_items;
- GNOME_DB_GOO_CLASS (class)->clean_canvas_items = clean_canvas_items;
- GNOME_DB_GOO_CLASS (class)->graph_item_added = graph_item_added;
- GNOME_DB_GOO_CLASS (class)->graph_item_dropped = graph_item_dropped;
- GNOME_DB_GOO_CLASS (class)->build_context_menu = build_context_menu;
+ /* GnomeDbCanvas virtual functions */
+ GNOME_DB_CANVAS_CLASS (class)->create_canvas_items = create_canvas_items;
+ GNOME_DB_CANVAS_CLASS (class)->clean_canvas_items = clean_canvas_items;
+ GNOME_DB_CANVAS_CLASS (class)->graph_item_added = graph_item_added;
+ GNOME_DB_CANVAS_CLASS (class)->graph_item_dropped = graph_item_dropped;
+ GNOME_DB_CANVAS_CLASS (class)->build_context_menu = build_context_menu;
- GNOME_DB_GOO_CLASS (class)->drag_action = drag_action_dcb;
+ GNOME_DB_CANVAS_CLASS (class)->drag_action = drag_action_dcb;
- object_class->dispose = gnome_db_goo_db_relations_dispose;
+ object_class->dispose = gnome_db_canvas_db_relations_dispose;
/* properties */
- object_class->set_property = gnome_db_goo_db_relations_set_property;
- object_class->get_property = gnome_db_goo_db_relations_get_property;
+ object_class->set_property = gnome_db_canvas_db_relations_set_property;
+ object_class->get_property = gnome_db_canvas_db_relations_get_property;
g_object_class_install_property (object_class, PROP_META_STORE,
g_param_spec_object ("meta-store", "GdaMetaStore", NULL,
GDA_TYPE_META_STORE,
@@ -140,17 +140,17 @@
}
static void
-gnome_db_goo_db_relations_dispose (GObject *object)
+gnome_db_canvas_db_relations_dispose (GObject *object)
{
- GnomeDbGooDbRelations *canvas;
+ GnomeDbCanvasDbRelations *canvas;
g_return_if_fail (object != NULL);
- g_return_if_fail (GNOME_DB_IS_GOO_DB_RELATIONS (object));
+ g_return_if_fail (GNOME_DB_IS_CANVAS_DB_RELATIONS (object));
- canvas = GNOME_DB_GOO_DB_RELATIONS (object);
+ canvas = GNOME_DB_CANVAS_DB_RELATIONS (object);
if (canvas->priv) {
- clean_canvas_items (GNOME_DB_GOO (canvas));
+ clean_canvas_items (GNOME_DB_CANVAS (canvas));
if (canvas->priv->store) {
g_signal_handlers_disconnect_by_func (G_OBJECT (canvas->priv->store),
G_CALLBACK (meta_store_changed_cb), canvas);
@@ -177,26 +177,26 @@
}
static void
-meta_store_changed_cb (GdaMetaStore *store, GSList *changes, GnomeDbGooDbRelations *canvas)
+meta_store_changed_cb (GdaMetaStore *store, GSList *changes, GnomeDbCanvasDbRelations *canvas)
{
meta_store_reset_cb (store, canvas);
}
static void
-meta_store_reset_cb (GdaMetaStore *store, GnomeDbGooDbRelations *canvas)
+meta_store_reset_cb (GdaMetaStore *store, GnomeDbCanvasDbRelations *canvas)
{
TO_IMPLEMENT;
}
static void
-gnome_db_goo_db_relations_set_property (GObject *object,
+gnome_db_canvas_db_relations_set_property (GObject *object,
guint param_id,
const GValue *value,
GParamSpec *pspec)
{
- GnomeDbGooDbRelations *canvas;
+ GnomeDbCanvasDbRelations *canvas;
- canvas = GNOME_DB_GOO_DB_RELATIONS (object);
+ canvas = GNOME_DB_CANVAS_DB_RELATIONS (object);
if (canvas->priv) {
switch (param_id) {
case PROP_META_STORE:
@@ -219,14 +219,14 @@
}
static void
-gnome_db_goo_db_relations_get_property (GObject *object,
+gnome_db_canvas_db_relations_get_property (GObject *object,
guint param_id,
GValue *value,
GParamSpec *pspec)
{
- GnomeDbGooDbRelations *canvas;
+ GnomeDbCanvasDbRelations *canvas;
- canvas = GNOME_DB_GOO_DB_RELATIONS (object);
+ canvas = GNOME_DB_CANVAS_DB_RELATIONS (object);
if (canvas->priv) {
switch (param_id) {
case PROP_META_STORE:
@@ -240,28 +240,28 @@
}
static void
-drag_action_dcb (GnomeDbGoo *canvas, GnomeDbGooItem *from_item, GnomeDbGooItem *to_item)
+drag_action_dcb (GnomeDbCanvas *canvas, GnomeDbCanvasItem *from_item, GnomeDbCanvasItem *to_item)
{
TO_IMPLEMENT;
}
/**
- * gnome_db_goo_db_relations_new
+ * gnome_db_canvas_db_relations_new
* @dict: a #GdaDict object
*
* Creates a new canvas widget to display the relations between the database's tables.
* The database is the one managed by the #GdaDict object which @graph refers.
*
- * After the #GnomeDbGooDbRelations has been created, it is possible to display
+ * After the #GnomeDbCanvasDbRelations has been created, it is possible to display
* the tables as listed in a #GdaGdaph by setting the "graph" property (using g_object_set()).
*
- * Returns: a new #GnomeDbGooDbRelations widget
+ * Returns: a new #GnomeDbCanvasDbRelations widget
*/
GtkWidget *
-gnome_db_goo_db_relations_new (GdaMetaStore *store)
+gnome_db_canvas_db_relations_new (GdaMetaStore *store)
{
g_return_val_if_fail (!store || GDA_IS_META_STORE (store), NULL);
- return GTK_WIDGET (g_object_new (GNOME_DB_TYPE_GOO_DB_RELATIONS, "meta-store", store, NULL));
+ return GTK_WIDGET (g_object_new (GNOME_DB_TYPE_CANVAS_DB_RELATIONS, "meta-store", store, NULL));
}
@@ -269,10 +269,10 @@
* Add all the required GooCanvasItem objects for the associated #GnomeDbGraph object
*/
static void
-create_canvas_items (GnomeDbGoo *canvas)
+create_canvas_items (GnomeDbCanvas *canvas)
{
GSList *list, *graph_items;
- GnomeDbGraph *graph = gnome_db_goo_get_graph (canvas);
+ GnomeDbGraph *graph = gnome_db_canvas_get_graph (canvas);
graph_items = gnome_db_graph_get_items (graph);
list = graph_items;
@@ -284,9 +284,9 @@
}
static void
-clean_canvas_items (GnomeDbGoo *canvas)
+clean_canvas_items (GnomeDbCanvas *canvas)
{
- GnomeDbGooDbRelations *dbrel = GNOME_DB_GOO_DB_RELATIONS (canvas);
+ GnomeDbCanvasDbRelations *dbrel = GNOME_DB_CANVAS_DB_RELATIONS (canvas);
/* clean memory */
g_hash_table_destroy (dbrel->priv->hash_tables);
@@ -300,7 +300,7 @@
}
static GdaMetaStruct *
-get_mstruct (GnomeDbGooDbRelations *canvas)
+get_mstruct (GnomeDbCanvasDbRelations *canvas)
{
if (!canvas->priv->mstruct) {
if (!canvas->priv->store)
@@ -312,19 +312,19 @@
}
-static GtkWidget *canvas_entity_popup_func (GnomeDbGooTable *ce);
+static GtkWidget *canvas_entity_popup_func (GnomeDbCanvasTable *ce);
/*
- * Add the GnomeDbGooMetaTable corresponding to the graph item
+ * Add the GnomeDbCanvasMetaTable corresponding to the graph item
*/
static void
-graph_item_added (GnomeDbGoo *canvas, GnomeDbGraphItem *item)
+graph_item_added (GnomeDbCanvas *canvas, GnomeDbGraphItem *item)
{
GValue *table_catalog;
GValue *table_schema;
GValue *table_name;
GdaMetaTable *mtable;
- GnomeDbGooDbRelations *dbrel = GNOME_DB_GOO_DB_RELATIONS (canvas);
+ GnomeDbCanvasDbRelations *dbrel = GNOME_DB_CANVAS_DB_RELATIONS (canvas);
table_catalog = g_object_get_data (G_OBJECT (item), "tcat");
table_schema = g_object_get_data (G_OBJECT (item), "tschema");
@@ -339,7 +339,7 @@
gdouble x, y;
GooCanvasItem *table_item;
gnome_db_graph_item_get_position (item, &x, &y);
- table_item = gnome_db_goo_table_new (goo_canvas_get_root_item (GOO_CANVAS (canvas)),
+ table_item = gnome_db_canvas_table_new (goo_canvas_get_root_item (GOO_CANVAS (canvas)),
mtable, x, y, NULL);
g_hash_table_insert (dbrel->priv->hash_tables, mtable, table_item);
g_hash_table_insert (dbrel->priv->hash_tables,table_item, mtable);
@@ -347,7 +347,7 @@
g_object_set (G_OBJECT (table_item),
"graph-item", item,
"popup_menu_func", canvas_entity_popup_func, NULL);
- gnome_db_goo_declare_item (canvas, GNOME_DB_GOO_ITEM (table_item));
+ gnome_db_canvas_declare_item (canvas, GNOME_DB_CANVAS_ITEM (table_item));
/* if there are some FK links, then also add them */
GSList *list;
@@ -357,8 +357,8 @@
ref_table_item = g_hash_table_lookup (dbrel->priv->hash_tables, fk->depend_on);
if (ref_table_item) {
GooCanvasItem *fk_item;
- fk_item = gnome_db_goo_fkey_new (goo_canvas_get_root_item (GOO_CANVAS (canvas)), fk, NULL);
- gnome_db_goo_declare_item (canvas, GNOME_DB_GOO_ITEM (fk_item));
+ fk_item = gnome_db_canvas_fkey_new (goo_canvas_get_root_item (GOO_CANVAS (canvas)), fk, NULL);
+ gnome_db_canvas_declare_item (canvas, GNOME_DB_CANVAS_ITEM (fk_item));
g_hash_table_insert (dbrel->priv->hash_fkeys, fk, fk_item);
}
}
@@ -368,8 +368,8 @@
ref_table_item = g_hash_table_lookup (dbrel->priv->hash_tables, fk->meta_table);
if (ref_table_item) {
GooCanvasItem *fk_item;
- fk_item = gnome_db_goo_fkey_new (goo_canvas_get_root_item (GOO_CANVAS (canvas)), fk, NULL);
- gnome_db_goo_declare_item (canvas, GNOME_DB_GOO_ITEM (fk_item));
+ fk_item = gnome_db_canvas_fkey_new (goo_canvas_get_root_item (GOO_CANVAS (canvas)), fk, NULL);
+ gnome_db_canvas_declare_item (canvas, GNOME_DB_CANVAS_ITEM (fk_item));
g_hash_table_insert (dbrel->priv->hash_fkeys, fk, fk_item);
}
}
@@ -380,10 +380,10 @@
}
}
-static void popup_func_delete_cb (GtkMenuItem *mitem, GnomeDbGooTable *ce);
-static void popup_func_add_depend_cb (GtkMenuItem *mitem, GnomeDbGooTable *ce);
+static void popup_func_delete_cb (GtkMenuItem *mitem, GnomeDbCanvasTable *ce);
+static void popup_func_add_depend_cb (GtkMenuItem *mitem, GnomeDbCanvasTable *ce);
static GtkWidget *
-canvas_entity_popup_func (GnomeDbGooTable *ce)
+canvas_entity_popup_func (GnomeDbCanvasTable *ce)
{
GtkWidget *menu, *entry;
@@ -401,21 +401,21 @@
}
static void
-popup_func_delete_cb (GtkMenuItem *mitem, GnomeDbGooTable *ce)
+popup_func_delete_cb (GtkMenuItem *mitem, GnomeDbCanvasTable *ce)
{
GnomeDbGraphItem *gitem;
- gitem = gnome_db_goo_item_get_graph_item (GNOME_DB_GOO_ITEM (ce));
+ gitem = gnome_db_canvas_item_get_graph_item (GNOME_DB_CANVAS_ITEM (ce));
gnome_db_graph_del_item (gnome_db_graph_item_get_graph (gitem), gitem);
}
static void
-popup_func_add_depend_cb (GtkMenuItem *mitem, GnomeDbGooTable *ce)
+popup_func_add_depend_cb (GtkMenuItem *mitem, GnomeDbCanvasTable *ce)
{
- GnomeDbGooDbRelations *dbrel;
+ GnomeDbCanvasDbRelations *dbrel;
GdaMetaDbObject *dbo;
- dbrel = GNOME_DB_GOO_DB_RELATIONS (goo_canvas_item_get_canvas (GOO_CANVAS_ITEM (ce)));
+ dbrel = GNOME_DB_CANVAS_DB_RELATIONS (goo_canvas_item_get_canvas (GOO_CANVAS_ITEM (ce)));
dbo = g_hash_table_lookup (dbrel->priv->hash_tables, ce);
if (!dbo || (dbo->obj_type != GDA_META_DB_TABLE))
return;
@@ -442,7 +442,7 @@
GnomeDbGraphItem *gitem;
GnomeDbGraph *graph;
- graph = gnome_db_goo_get_graph (GNOME_DB_GOO (dbrel));
+ graph = gnome_db_canvas_get_graph (GNOME_DB_CANVAS (dbrel));
gitem = gnome_db_graph_item_new (graph);
gnome_db_graph_item_set_position (gitem, bounds.x2 + 20., bounds.y1);
@@ -456,27 +456,27 @@
gnome_db_graph_add_item (graph, gitem);
g_object_unref (G_OBJECT (gitem));
- GnomeDbGooTable *new_item;
- new_item = gnome_db_goo_db_relations_get_table_item (dbrel, GDA_META_TABLE (fk->depend_on));
+ GnomeDbCanvasTable *new_item;
+ new_item = gnome_db_canvas_db_relations_get_table_item (dbrel, GDA_META_TABLE (fk->depend_on));
goo_canvas_item_get_bounds (GOO_CANVAS_ITEM (new_item), &bounds);
}
}
/*
- * Remove the GnomeDbGooTable corresponding to the graph item
+ * Remove the GnomeDbCanvasTable corresponding to the graph item
*/
static void
-graph_item_dropped (GnomeDbGoo *canvas, GnomeDbGraphItem *item)
+graph_item_dropped (GnomeDbCanvas *canvas, GnomeDbGraphItem *item)
{
GdaMetaTable *mtable;
- GnomeDbGooItem *citem = NULL;
+ GnomeDbCanvasItem *citem = NULL;
GSList *list;
- GnomeDbGooDbRelations *dbrel = GNOME_DB_GOO_DB_RELATIONS (canvas);
+ GnomeDbCanvasDbRelations *dbrel = GNOME_DB_CANVAS_DB_RELATIONS (canvas);
for (list = dbrel->priv->all_items; list; list = list->next) {
- if (gnome_db_goo_item_get_graph_item ((GnomeDbGooItem*) list->data) == item) {
- citem = (GnomeDbGooItem*) list->data;
+ if (gnome_db_canvas_item_get_graph_item ((GnomeDbCanvasItem*) list->data) == item) {
+ citem = (GnomeDbCanvasItem*) list->data;
break;
}
}
@@ -490,13 +490,13 @@
}
}
-static void popup_add_table_cb (GtkMenuItem *mitem, GnomeDbGooDbRelations *canvas);
+static void popup_add_table_cb (GtkMenuItem *mitem, GnomeDbCanvasDbRelations *canvas);
static GtkWidget *
-build_context_menu (GnomeDbGoo *canvas)
+build_context_menu (GnomeDbCanvas *canvas)
{
GtkWidget *menu, *mitem, *submenu, *submitem;
GSList *list;
- GnomeDbGooDbRelations *dbrel = GNOME_DB_GOO_DB_RELATIONS (canvas);
+ GnomeDbCanvasDbRelations *dbrel = GNOME_DB_CANVAS_DB_RELATIONS (canvas);
if (!get_mstruct (dbrel))
return NULL;
@@ -546,7 +546,7 @@
}
static void
-popup_add_table_cb (GtkMenuItem *mitem, GnomeDbGooDbRelations *canvas)
+popup_add_table_cb (GtkMenuItem *mitem, GnomeDbCanvasDbRelations *canvas)
{
GdaMetaTable *mtable;
GValue *table_catalog;
@@ -565,10 +565,10 @@
GnomeDbGraphItem *gitem;
GnomeDbGraph *graph;
- graph = gnome_db_goo_get_graph (GNOME_DB_GOO (canvas));
+ graph = gnome_db_canvas_get_graph (GNOME_DB_CANVAS (canvas));
gitem = gnome_db_graph_item_new (graph);
- gnome_db_graph_item_set_position (gitem, GNOME_DB_GOO (canvas)->xmouse,
- GNOME_DB_GOO (canvas)->ymouse);
+ gnome_db_graph_item_set_position (gitem, GNOME_DB_CANVAS (canvas)->xmouse,
+ GNOME_DB_CANVAS (canvas)->ymouse);
g_object_set_data_full (G_OBJECT (gitem), "tcat", gda_value_copy (table_catalog),
(GDestroyNotify) gda_value_free);
g_object_set_data_full (G_OBJECT (gitem), "tschema", gda_value_copy (table_schema),
@@ -583,26 +583,26 @@
}
/**
- * gnome_db_goo_db_relations_get_table_item
+ * gnome_db_canvas_db_relations_get_table_item
* @canvas:
* @table:
*
* Returns:
*/
-GnomeDbGooTable *
-gnome_db_goo_db_relations_get_table_item (GnomeDbGooDbRelations *canvas, GdaMetaTable *table)
+GnomeDbCanvasTable *
+gnome_db_canvas_db_relations_get_table_item (GnomeDbCanvasDbRelations *canvas, GdaMetaTable *table)
{
- GnomeDbGooTable *table_item;
- g_return_val_if_fail (GNOME_DB_IS_GOO_DB_RELATIONS (canvas), NULL);
+ GnomeDbCanvasTable *table_item;
+ g_return_val_if_fail (GNOME_DB_IS_CANVAS_DB_RELATIONS (canvas), NULL);
g_return_val_if_fail (canvas->priv, NULL);
table_item = g_hash_table_lookup (canvas->priv->hash_tables, table);
- return GNOME_DB_GOO_TABLE (table_item);
+ return GNOME_DB_CANVAS_TABLE (table_item);
}
/**
- * gnome_db_goo_db_relations_add_table_item
- * @canvas: a #GnomeDbGooDbRelations canvas
+ * gnome_db_canvas_db_relations_add_table_item
+ * @canvas: a #GnomeDbCanvasDbRelations canvas
* @table_catalog: the catalog in which the table is, or %NULL
* @table_schema: the schema in which the table is, or %NULL
* @table_name: the table's name
@@ -611,12 +611,12 @@
*
* Returns: the corresponding canvas item, or %NULL if the table was not found.
*/
-GnomeDbGooTable *
-gnome_db_goo_db_relations_add_table_item (GnomeDbGooDbRelations *canvas,
+GnomeDbCanvasTable *
+gnome_db_canvas_db_relations_add_table_item (GnomeDbCanvasDbRelations *canvas,
const GValue *table_catalog, const GValue *table_schema,
const GValue *table_name)
{
- g_return_val_if_fail (GNOME_DB_IS_GOO_DB_RELATIONS (canvas), NULL);
+ g_return_val_if_fail (GNOME_DB_IS_CANVAS_DB_RELATIONS (canvas), NULL);
g_return_val_if_fail (canvas->priv, NULL);
GdaMetaTable *mtable;
@@ -629,10 +629,10 @@
GnomeDbGraphItem *gitem;
GnomeDbGraph *graph;
- graph = gnome_db_goo_get_graph (GNOME_DB_GOO (canvas));
+ graph = gnome_db_canvas_get_graph (GNOME_DB_CANVAS (canvas));
gitem = gnome_db_graph_item_new (graph);
- gnome_db_graph_item_set_position (gitem, GNOME_DB_GOO (canvas)->xmouse,
- GNOME_DB_GOO (canvas)->ymouse);
+ gnome_db_graph_item_set_position (gitem, GNOME_DB_CANVAS (canvas)->xmouse,
+ GNOME_DB_CANVAS (canvas)->ymouse);
if (table_catalog)
g_object_set_data_full (G_OBJECT (gitem), "tcat", gda_value_copy (table_catalog),
(GDestroyNotify) gda_value_free);
@@ -644,7 +644,7 @@
gnome_db_graph_add_item (graph, gitem);
g_object_unref (G_OBJECT (gitem));
- return gnome_db_goo_db_relations_get_table_item (canvas, mtable);
+ return gnome_db_canvas_db_relations_get_table_item (canvas, mtable);
}
else
return NULL;
Copied: trunk/libgnomedb-graph/gnome-db-canvas-db-relations.h (from r1721, /trunk/libgnomedb-graph/gnome-db-goo-db-relations.h)
==============================================================================
--- /trunk/libgnomedb-graph/gnome-db-goo-db-relations.h (original)
+++ trunk/libgnomedb-graph/gnome-db-canvas-db-relations.h Wed Apr 30 20:19:18 2008
@@ -1,4 +1,4 @@
-/* gnome-db-goo-db-relations.h
+/* gnome-db-canvas-db-relations.h
*
* Copyright (C) 2004 - 2007 Vivien Malerba
*
@@ -18,45 +18,45 @@
* USA
*/
-#ifndef __GNOME_DB_GOO_DB_RELATIONS__
-#define __GNOME_DB_GOO_DB_RELATIONS__
+#ifndef __GNOME_DB_CANVAS_DB_RELATIONS__
+#define __GNOME_DB_CANVAS_DB_RELATIONS__
-#include "gnome-db-goo.h"
+#include "gnome-db-canvas.h"
G_BEGIN_DECLS
-#define GNOME_DB_TYPE_GOO_DB_RELATIONS (gnome_db_goo_db_relations_get_type())
-#define GNOME_DB_GOO_DB_RELATIONS(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, gnome_db_goo_db_relations_get_type(), GnomeDbGooDbRelations)
-#define GNOME_DB_GOO_DB_RELATIONS_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, gnome_db_goo_db_relations_get_type (), GnomeDbGooDbRelationsClass)
-#define GNOME_DB_IS_GOO_DB_RELATIONS(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, gnome_db_goo_db_relations_get_type ())
+#define GNOME_DB_TYPE_CANVAS_DB_RELATIONS (gnome_db_canvas_db_relations_get_type())
+#define GNOME_DB_CANVAS_DB_RELATIONS(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, gnome_db_canvas_db_relations_get_type(), GnomeDbCanvasDbRelations)
+#define GNOME_DB_CANVAS_DB_RELATIONS_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, gnome_db_canvas_db_relations_get_type (), GnomeDbCanvasDbRelationsClass)
+#define GNOME_DB_IS_CANVAS_DB_RELATIONS(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, gnome_db_canvas_db_relations_get_type ())
-typedef struct _GnomeDbGooDbRelations GnomeDbGooDbRelations;
-typedef struct _GnomeDbGooDbRelationsClass GnomeDbGooDbRelationsClass;
-typedef struct _GnomeDbGooDbRelationsPrivate GnomeDbGooDbRelationsPrivate;
+typedef struct _GnomeDbCanvasDbRelations GnomeDbCanvasDbRelations;
+typedef struct _GnomeDbCanvasDbRelationsClass GnomeDbCanvasDbRelationsClass;
+typedef struct _GnomeDbCanvasDbRelationsPrivate GnomeDbCanvasDbRelationsPrivate;
/* struct for the object's data */
-struct _GnomeDbGooDbRelations
+struct _GnomeDbCanvasDbRelations
{
- GnomeDbGoo widget;
+ GnomeDbCanvas widget;
- GnomeDbGooDbRelationsPrivate *priv;
+ GnomeDbCanvasDbRelationsPrivate *priv;
};
/* struct for the object's class */
-struct _GnomeDbGooDbRelationsClass
+struct _GnomeDbCanvasDbRelationsClass
{
- GnomeDbGooClass parent_class;
+ GnomeDbCanvasClass parent_class;
};
/* generic widget's functions */
-GType gnome_db_goo_db_relations_get_type (void) G_GNUC_CONST;
+GType gnome_db_canvas_db_relations_get_type (void) G_GNUC_CONST;
-GtkWidget *gnome_db_goo_db_relations_new (GdaMetaStore *store);
+GtkWidget *gnome_db_canvas_db_relations_new (GdaMetaStore *store);
-GnomeDbGooTable *gnome_db_goo_db_relations_get_table_item (GnomeDbGooDbRelations *canvas, GdaMetaTable *table);
-GnomeDbGooTable *gnome_db_goo_db_relations_add_table_item (GnomeDbGooDbRelations *canvas,
+GnomeDbCanvasTable *gnome_db_canvas_db_relations_get_table_item (GnomeDbCanvasDbRelations *canvas, GdaMetaTable *table);
+GnomeDbCanvasTable *gnome_db_canvas_db_relations_add_table_item (GnomeDbCanvasDbRelations *canvas,
const GValue *table_catalog, const GValue *table_schema,
const GValue *table_name);
Copied: trunk/libgnomedb-graph/gnome-db-canvas-decl.h (from r1721, /trunk/libgnomedb-graph/gnome-db-goo-decl.h)
==============================================================================
--- /trunk/libgnomedb-graph/gnome-db-goo-decl.h (original)
+++ trunk/libgnomedb-graph/gnome-db-canvas-decl.h Wed Apr 30 20:19:18 2008
@@ -1,4 +1,4 @@
-/* gnome-db-goo-decl.h
+/* gnome-db-canvas-decl.h
*
* Copyright (C) 2008 Vivien Malerba
*
@@ -18,24 +18,24 @@
* USA
*/
-#ifndef __GNOME_DB_GOO_DECL_H_
-#define __GNOME_DB_GOO_DECL_H_
+#ifndef __GNOME_DB_CANVAS_DECL_H_
+#define __GNOME_DB_CANVAS_DECL_H_
-typedef struct _GnomeDbGoo GnomeDbGoo;
-typedef struct _GnomeDbGooClass GnomeDbGooClass;
-typedef struct _GnomeDbGooPrivate GnomeDbGooPrivate;
-
-typedef struct _GnomeDbGooItem GnomeDbGooItem;
-typedef struct _GnomeDbGooItemClass GnomeDbGooItemClass;
-typedef struct _GnomeDbGooItemPrivate GnomeDbGooItemPrivate;
-
-typedef struct _GnomeDbGooTable GnomeDbGooTable;
-typedef struct _GnomeDbGooTableClass GnomeDbGooTableClass;
-typedef struct _GnomeDbGooTablePrivate GnomeDbGooTablePrivate;
-
-typedef struct _GnomeDbGooColumn GnomeDbGooColumn;
-typedef struct _GnomeDbGooColumnClass GnomeDbGooColumnClass;
-typedef struct _GnomeDbGooColumnPrivate GnomeDbGooColumnPrivate;
+typedef struct _GnomeDbCanvas GnomeDbCanvas;
+typedef struct _GnomeDbCanvasClass GnomeDbCanvasClass;
+typedef struct _GnomeDbCanvasPrivate GnomeDbCanvasPrivate;
+
+typedef struct _GnomeDbCanvasItem GnomeDbCanvasItem;
+typedef struct _GnomeDbCanvasItemClass GnomeDbCanvasItemClass;
+typedef struct _GnomeDbCanvasItemPrivate GnomeDbCanvasItemPrivate;
+
+typedef struct _GnomeDbCanvasTable GnomeDbCanvasTable;
+typedef struct _GnomeDbCanvasTableClass GnomeDbCanvasTableClass;
+typedef struct _GnomeDbCanvasTablePrivate GnomeDbCanvasTablePrivate;
+
+typedef struct _GnomeDbCanvasColumn GnomeDbCanvasColumn;
+typedef struct _GnomeDbCanvasColumnClass GnomeDbCanvasColumnClass;
+typedef struct _GnomeDbCanvasColumnPrivate GnomeDbCanvasColumnPrivate;
typedef struct _GnomeDbGraph GnomeDbGraph;
typedef struct _GnomeDbGraphClass GnomeDbGraphClass;
Copied: trunk/libgnomedb-graph/gnome-db-canvas-fkey.c (from r1721, /trunk/libgnomedb-graph/gnome-db-goo-fkey.c)
==============================================================================
--- /trunk/libgnomedb-graph/gnome-db-goo-fkey.c (original)
+++ trunk/libgnomedb-graph/gnome-db-canvas-fkey.c Wed Apr 30 20:19:18 2008
@@ -1,4 +1,4 @@
-/* gnome-db-goo-fkey.c
+/* gnome-db-canvas-fkey.c
*
* Copyright (C) 2004 - 2007 Vivien Malerba
*
@@ -22,33 +22,33 @@
#include <math.h>
#include <libgda/libgda.h>
#include <glib/gi18n-lib.h>
-#include "gnome-db-goo.h"
-#include "gnome-db-goo-fkey.h"
-#include "gnome-db-goo-table.h"
-#include "gnome-db-goo-text.h"
-#include "gnome-db-goo-utility.h"
-#include "gnome-db-goo-db-relations.h"
-
-static void gnome_db_goo_fkey_class_init (GnomeDbGooFkeyClass * class);
-static void gnome_db_goo_fkey_init (GnomeDbGooFkey * cc);
-static void gnome_db_goo_fkey_dispose (GObject *object);
-static void gnome_db_goo_fkey_finalize (GObject *object);
+#include "gnome-db-canvas.h"
+#include "gnome-db-canvas-fkey.h"
+#include "gnome-db-canvas-table.h"
+#include "gnome-db-canvas-text.h"
+#include "gnome-db-canvas-utility.h"
+#include "gnome-db-canvas-db-relations.h"
+
+static void gnome_db_canvas_fkey_class_init (GnomeDbCanvasFkeyClass * class);
+static void gnome_db_canvas_fkey_init (GnomeDbCanvasFkey * cc);
+static void gnome_db_canvas_fkey_dispose (GObject *object);
+static void gnome_db_canvas_fkey_finalize (GObject *object);
-static void gnome_db_goo_fkey_set_property (GObject *object,
+static void gnome_db_canvas_fkey_set_property (GObject *object,
guint param_id,
const GValue *value,
GParamSpec *pspec);
-static void gnome_db_goo_fkey_get_property (GObject *object,
+static void gnome_db_canvas_fkey_get_property (GObject *object,
guint param_id,
GValue *value,
GParamSpec *pspec);
-static void gnome_db_goo_fkey_get_edge_nodes (GnomeDbGooItem *citem,
- GnomeDbGooItem **from, GnomeDbGooItem **to);
+static void gnome_db_canvas_fkey_get_edge_nodes (GnomeDbCanvasItem *citem,
+ GnomeDbCanvasItem **from, GnomeDbCanvasItem **to);
-static void clean_items (GnomeDbGooFkey *cc);
-static void create_items (GnomeDbGooFkey *cc);
-static void update_items (GnomeDbGooFkey *cc);
+static void clean_items (GnomeDbCanvasFkey *cc);
+static void create_items (GnomeDbCanvasFkey *cc);
+static void update_items (GnomeDbCanvasFkey *cc);
enum
{
@@ -56,56 +56,56 @@
PROP_FK_CONSTRAINT
};
-struct _GnomeDbGooFkeyPrivate
+struct _GnomeDbCanvasFkeyPrivate
{
GdaMetaTableForeignKey *fk;
- GnomeDbGooTable *fk_table_item;
- GnomeDbGooTable *ref_pk_table_item;
- GSList *shapes; /* list of GnomeDbGooCanvasShape structures */
+ GnomeDbCanvasTable *fk_table_item;
+ GnomeDbCanvasTable *ref_pk_table_item;
+ GSList *shapes; /* list of GnomeDbCanvasCanvasShape structures */
};
/* get a pointer to the parents to be able to call their destructor */
static GObjectClass *parent_class = NULL;
GType
-gnome_db_goo_fkey_get_type (void)
+gnome_db_canvas_fkey_get_type (void)
{
static GType type = 0;
if (G_UNLIKELY (type == 0)) {
static const GTypeInfo info = {
- sizeof (GnomeDbGooFkeyClass),
+ sizeof (GnomeDbCanvasFkeyClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
- (GClassInitFunc) gnome_db_goo_fkey_class_init,
+ (GClassInitFunc) gnome_db_canvas_fkey_class_init,
NULL,
NULL,
- sizeof (GnomeDbGooFkey),
+ sizeof (GnomeDbCanvasFkey),
0,
- (GInstanceInitFunc) gnome_db_goo_fkey_init
+ (GInstanceInitFunc) gnome_db_canvas_fkey_init
};
- type = g_type_register_static (GNOME_DB_TYPE_GOO_ITEM, "GnomeDbGooFkey", &info, 0);
+ type = g_type_register_static (GNOME_DB_TYPE_CANVAS_ITEM, "GnomeDbCanvasFkey", &info, 0);
}
return type;
}
static void
-gnome_db_goo_fkey_class_init (GnomeDbGooFkeyClass * class)
+gnome_db_canvas_fkey_class_init (GnomeDbCanvasFkeyClass * class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
parent_class = g_type_class_peek_parent (class);
- GNOME_DB_GOO_ITEM_CLASS (class)->get_edge_nodes = gnome_db_goo_fkey_get_edge_nodes;
+ GNOME_DB_CANVAS_ITEM_CLASS (class)->get_edge_nodes = gnome_db_canvas_fkey_get_edge_nodes;
- object_class->dispose = gnome_db_goo_fkey_dispose;
- object_class->finalize = gnome_db_goo_fkey_finalize;
+ object_class->dispose = gnome_db_canvas_fkey_dispose;
+ object_class->finalize = gnome_db_canvas_fkey_finalize;
/* Properties */
- object_class->set_property = gnome_db_goo_fkey_set_property;
- object_class->get_property = gnome_db_goo_fkey_get_property;
+ object_class->set_property = gnome_db_canvas_fkey_set_property;
+ object_class->get_property = gnome_db_canvas_fkey_get_property;
g_object_class_install_property (object_class, PROP_FK_CONSTRAINT,
g_param_spec_pointer ("fk_constraint", "FK constraint",
NULL,
@@ -114,9 +114,9 @@
}
static void
-gnome_db_goo_fkey_init (GnomeDbGooFkey *cc)
+gnome_db_canvas_fkey_init (GnomeDbCanvasFkey *cc)
{
- cc->priv = g_new0 (GnomeDbGooFkeyPrivate, 1);
+ cc->priv = g_new0 (GnomeDbCanvasFkeyPrivate, 1);
cc->priv->fk = NULL;
cc->priv->fk_table_item = NULL;
cc->priv->ref_pk_table_item = NULL;
@@ -124,13 +124,13 @@
}
static void
-gnome_db_goo_fkey_dispose (GObject *object)
+gnome_db_canvas_fkey_dispose (GObject *object)
{
- GnomeDbGooFkey *cc;
+ GnomeDbCanvasFkey *cc;
g_return_if_fail (object != NULL);
- g_return_if_fail (GNOME_DB_IS_GOO_FKEY (object));
+ g_return_if_fail (GNOME_DB_IS_CANVAS_FKEY (object));
- cc = GNOME_DB_GOO_FKEY (object);
+ cc = GNOME_DB_CANVAS_FKEY (object);
clean_items (cc);
cc->priv->fk = NULL;
@@ -143,13 +143,13 @@
static void
-gnome_db_goo_fkey_finalize (GObject *object)
+gnome_db_canvas_fkey_finalize (GObject *object)
{
- GnomeDbGooFkey *cc;
+ GnomeDbCanvasFkey *cc;
g_return_if_fail (object != NULL);
- g_return_if_fail (GNOME_DB_IS_GOO_FKEY (object));
+ g_return_if_fail (GNOME_DB_IS_CANVAS_FKEY (object));
- cc = GNOME_DB_GOO_FKEY (object);
+ cc = GNOME_DB_CANVAS_FKEY (object);
if (cc->priv) {
g_slist_free (cc->priv->shapes);
g_free (cc->priv);
@@ -161,14 +161,14 @@
}
static void
-gnome_db_goo_fkey_set_property (GObject *object,
+gnome_db_canvas_fkey_set_property (GObject *object,
guint param_id,
const GValue *value,
GParamSpec *pspec)
{
- GnomeDbGooFkey *cc;
+ GnomeDbCanvasFkey *cc;
- cc = GNOME_DB_GOO_FKEY (object);
+ cc = GNOME_DB_CANVAS_FKEY (object);
switch (param_id) {
case PROP_FK_CONSTRAINT:
@@ -182,14 +182,14 @@
}
static void
-gnome_db_goo_fkey_get_property (GObject *object,
+gnome_db_canvas_fkey_get_property (GObject *object,
guint param_id,
GValue *value,
GParamSpec *pspec)
{
- GnomeDbGooFkey *cc;
+ GnomeDbCanvasFkey *cc;
- cc = GNOME_DB_GOO_FKEY (object);
+ cc = GNOME_DB_CANVAS_FKEY (object);
switch (param_id) {
default:
@@ -199,33 +199,33 @@
}
static void
-gnome_db_goo_fkey_get_edge_nodes (GnomeDbGooItem *citem,
- GnomeDbGooItem **from, GnomeDbGooItem **to)
+gnome_db_canvas_fkey_get_edge_nodes (GnomeDbCanvasItem *citem,
+ GnomeDbCanvasItem **from, GnomeDbCanvasItem **to)
{
- GnomeDbGooFkey *cc;
+ GnomeDbCanvasFkey *cc;
- cc = GNOME_DB_GOO_FKEY (citem);
+ cc = GNOME_DB_CANVAS_FKEY (citem);
if (from)
- *from = (GnomeDbGooItem*) cc->priv->fk_table_item;
+ *from = (GnomeDbCanvasItem*) cc->priv->fk_table_item;
if (to)
- *to = (GnomeDbGooItem*) cc->priv->ref_pk_table_item;
+ *to = (GnomeDbCanvasItem*) cc->priv->ref_pk_table_item;
}
static gboolean single_item_enter_notify_event_cb (GooCanvasItem *ci, GooCanvasItem *target_item,
- GdkEventCrossing *event, GnomeDbGooFkey *cc);
+ GdkEventCrossing *event, GnomeDbCanvasFkey *cc);
static gboolean single_item_leave_notify_event_cb (GooCanvasItem *ci, GooCanvasItem *target_item,
- GdkEventCrossing *event, GnomeDbGooFkey *cc);
+ GdkEventCrossing *event, GnomeDbCanvasFkey *cc);
static gboolean single_item_button_press_event_cb (GooCanvasItem *ci, GooCanvasItem *target_item,
- GdkEventButton *event, GnomeDbGooFkey *cc);
-static void table_item_moved_cb (GooCanvasItem *table, GnomeDbGooFkey *cc);
-static void table_destroy_cb (GnomeDbGooTable *table, GnomeDbGooFkey *cc);
+ GdkEventButton *event, GnomeDbCanvasFkey *cc);
+static void table_item_moved_cb (GooCanvasItem *table, GnomeDbCanvasFkey *cc);
+static void table_destroy_cb (GnomeDbCanvasTable *table, GnomeDbCanvasFkey *cc);
/*
* destroy any existing GooCanvasItem objects
*/
static void
-clean_items (GnomeDbGooFkey *cc)
+clean_items (GnomeDbCanvasFkey *cc)
{
if (cc->priv->fk_table_item) {
g_signal_handlers_disconnect_by_func (G_OBJECT (cc->priv->fk_table_item),
@@ -244,7 +244,7 @@
}
/* remove all the GooCanvasItem objects */
- gnome_db_goo_canvas_shapes_remove_all (cc->priv->shapes);
+ gnome_db_canvas_canvas_shapes_remove_all (cc->priv->shapes);
cc->priv->shapes = NULL;
}
@@ -252,16 +252,16 @@
* create new GooCanvasItem objects
*/
static void
-create_items (GnomeDbGooFkey *cc)
+create_items (GnomeDbCanvasFkey *cc)
{
GSList *list, *canvas_shapes;
- GnomeDbGooTable *table_item;
- GnomeDbGoo *canvas = gnome_db_goo_item_get_canvas (GNOME_DB_GOO_ITEM (cc));
+ GnomeDbCanvasTable *table_item;
+ GnomeDbCanvas *canvas = gnome_db_canvas_item_get_canvas (GNOME_DB_CANVAS_ITEM (cc));
g_assert (cc->priv->fk);
/* Analyse FK constraint */
- table_item = gnome_db_goo_db_relations_get_table_item (GNOME_DB_GOO_DB_RELATIONS (canvas),
+ table_item = gnome_db_canvas_db_relations_get_table_item (GNOME_DB_CANVAS_DB_RELATIONS (canvas),
GDA_META_TABLE (cc->priv->fk->meta_table));
cc->priv->fk_table_item = table_item;
g_return_if_fail (table_item);
@@ -274,7 +274,7 @@
g_signal_connect (G_OBJECT (table_item), "destroy",
G_CALLBACK (table_destroy_cb), cc);
- table_item = gnome_db_goo_db_relations_get_table_item (GNOME_DB_GOO_DB_RELATIONS (canvas),
+ table_item = gnome_db_canvas_db_relations_get_table_item (GNOME_DB_CANVAS_DB_RELATIONS (canvas),
GDA_META_TABLE (cc->priv->fk->depend_on));
cc->priv->ref_pk_table_item = table_item;
g_return_if_fail (table_item);
@@ -289,14 +289,14 @@
/* actual line(s) */
g_assert (!cc->priv->shapes);
- canvas_shapes = gnome_db_goo_util_compute_anchor_shapes (GOO_CANVAS_ITEM (cc), NULL,
+ canvas_shapes = gnome_db_canvas_util_compute_anchor_shapes (GOO_CANVAS_ITEM (cc), NULL,
cc->priv->fk_table_item,
cc->priv->ref_pk_table_item,
MAX (cc->priv->fk->cols_nb, 1), 0, TRUE);
- cc->priv->shapes = gnome_db_goo_canvas_shapes_remove_obsolete_shapes (canvas_shapes);
+ cc->priv->shapes = gnome_db_canvas_canvas_shapes_remove_obsolete_shapes (canvas_shapes);
for (list = canvas_shapes; list; list = list->next) {
- GooCanvasItem *item = GNOME_DB_GOO_CANVAS_SHAPE (list->data)->item;
+ GooCanvasItem *item = GNOME_DB_CANVAS_CANVAS_SHAPE (list->data)->item;
gchar *color = "black";
g_object_set (G_OBJECT (item),
"stroke-color", color,
@@ -330,43 +330,43 @@
* update GooCanvasItem objects
*/
static void
-update_items (GnomeDbGooFkey *cc)
+update_items (GnomeDbCanvasFkey *cc)
{
- cc->priv->shapes = gnome_db_goo_util_compute_anchor_shapes (GOO_CANVAS_ITEM (cc), cc->priv->shapes,
+ cc->priv->shapes = gnome_db_canvas_util_compute_anchor_shapes (GOO_CANVAS_ITEM (cc), cc->priv->shapes,
cc->priv->fk_table_item,
cc->priv->ref_pk_table_item,
MAX (cc->priv->fk->cols_nb, 1), 0, TRUE);
- cc->priv->shapes = gnome_db_goo_canvas_shapes_remove_obsolete_shapes (cc->priv->shapes);
+ cc->priv->shapes = gnome_db_canvas_canvas_shapes_remove_obsolete_shapes (cc->priv->shapes);
}
-static void popup_delete_cb (GtkMenuItem *mitem, GnomeDbGooFkey *cc);
+static void popup_delete_cb (GtkMenuItem *mitem, GnomeDbCanvasFkey *cc);
/*
* item is for a single FK constraint
*/
static gboolean
single_item_enter_notify_event_cb (GooCanvasItem *ci, GooCanvasItem *target_item,
- GdkEventCrossing *event, GnomeDbGooFkey *cc)
+ GdkEventCrossing *event, GnomeDbCanvasFkey *cc)
{
gint i;
for (i = 0; i < cc->priv->fk->cols_nb; i++) {
GdaMetaTableColumn *tcol;
- GnomeDbGooColumn *column;
+ GnomeDbCanvasColumn *column;
/* fk column */
tcol = g_slist_nth_data (GDA_META_TABLE (cc->priv->fk->meta_table)->columns,
cc->priv->fk->fk_cols_array[i]);
- column = gnome_db_goo_table_get_column_item (cc->priv->fk_table_item, tcol);
- gnome_db_goo_text_set_highlight (GNOME_DB_GOO_TEXT (column), TRUE);
+ column = gnome_db_canvas_table_get_column_item (cc->priv->fk_table_item, tcol);
+ gnome_db_canvas_text_set_highlight (GNOME_DB_CANVAS_TEXT (column), TRUE);
/* ref pk column */
tcol = g_slist_nth_data (GDA_META_TABLE (cc->priv->fk->depend_on)->columns,
cc->priv->fk->ref_pk_cols_array[i]);
- column = gnome_db_goo_table_get_column_item (cc->priv->ref_pk_table_item, tcol);
- gnome_db_goo_text_set_highlight (GNOME_DB_GOO_TEXT (column), TRUE);
+ column = gnome_db_canvas_table_get_column_item (cc->priv->ref_pk_table_item, tcol);
+ gnome_db_canvas_text_set_highlight (GNOME_DB_CANVAS_TEXT (column), TRUE);
}
return FALSE;
@@ -374,27 +374,27 @@
static gboolean
single_item_leave_notify_event_cb (GooCanvasItem *ci, GooCanvasItem *target_item,
- GdkEventCrossing *event, GnomeDbGooFkey *cc)
+ GdkEventCrossing *event, GnomeDbCanvasFkey *cc)
{
gint i;
for (i = 0; i < cc->priv->fk->cols_nb; i++) {
GdaMetaTableColumn *tcol;
- GnomeDbGooColumn *column;
+ GnomeDbCanvasColumn *column;
/* fk column */
tcol = g_slist_nth_data (GDA_META_TABLE (cc->priv->fk->meta_table)->columns,
cc->priv->fk->fk_cols_array[i]);
- column = gnome_db_goo_table_get_column_item (cc->priv->fk_table_item, tcol);
- gnome_db_goo_text_set_highlight (GNOME_DB_GOO_TEXT (column), FALSE);
+ column = gnome_db_canvas_table_get_column_item (cc->priv->fk_table_item, tcol);
+ gnome_db_canvas_text_set_highlight (GNOME_DB_CANVAS_TEXT (column), FALSE);
/* ref pk column */
tcol = g_slist_nth_data (GDA_META_TABLE (cc->priv->fk->depend_on)->columns,
cc->priv->fk->ref_pk_cols_array[i]);
- column = gnome_db_goo_table_get_column_item (cc->priv->ref_pk_table_item, tcol);
- gnome_db_goo_text_set_highlight (GNOME_DB_GOO_TEXT (column), FALSE);
+ column = gnome_db_canvas_table_get_column_item (cc->priv->ref_pk_table_item, tcol);
+ gnome_db_canvas_text_set_highlight (GNOME_DB_CANVAS_TEXT (column), FALSE);
}
return FALSE;
@@ -402,7 +402,7 @@
static gboolean
single_item_button_press_event_cb (GooCanvasItem *ci, GooCanvasItem *target_item,
- GdkEventButton *event, GnomeDbGooFkey *cc)
+ GdkEventButton *event, GnomeDbCanvasFkey *cc)
{
GdaMetaTableForeignKey *fkcons = g_object_get_data (G_OBJECT (ci), "fkcons");
GtkWidget *menu, *entry;
@@ -421,25 +421,25 @@
static void
-popup_delete_cb (GtkMenuItem *mitem, GnomeDbGooFkey *cc)
+popup_delete_cb (GtkMenuItem *mitem, GnomeDbCanvasFkey *cc)
{
TO_IMPLEMENT;
}
static void
-table_item_moved_cb (GooCanvasItem *table, GnomeDbGooFkey *cc)
+table_item_moved_cb (GooCanvasItem *table, GnomeDbCanvasFkey *cc)
{
update_items (cc);
}
static void
-table_destroy_cb (GnomeDbGooTable *table, GnomeDbGooFkey *cc)
+table_destroy_cb (GnomeDbCanvasTable *table, GnomeDbCanvasFkey *cc)
{
goo_canvas_item_remove (GOO_CANVAS_ITEM (cc));
}
/**
- * gnome_db_goo_fkey_new
+ * gnome_db_canvas_fkey_new
* @parent: the parent item, or NULL.
* @fkcons: the #GdaMetaTableForeignKey to represent
* @...: optional pairs of property names and values, and a terminating NULL.
@@ -449,13 +449,13 @@
* Returns: a new #GooCanvasItem object
*/
GooCanvasItem *
-gnome_db_goo_fkey_new (GooCanvasItem *parent, GdaMetaTableForeignKey *fkcons, ...)
+gnome_db_canvas_fkey_new (GooCanvasItem *parent, GdaMetaTableForeignKey *fkcons, ...)
{
GooCanvasItem *item;
const char *first_property;
va_list var_args;
- item = g_object_new (GNOME_DB_TYPE_GOO_FKEY, NULL);
+ item = g_object_new (GNOME_DB_TYPE_CANVAS_FKEY, NULL);
if (parent) {
goo_canvas_item_add_child (parent, item, -1);
Copied: trunk/libgnomedb-graph/gnome-db-canvas-fkey.h (from r1721, /trunk/libgnomedb-graph/gnome-db-goo-fkey.h)
==============================================================================
--- /trunk/libgnomedb-graph/gnome-db-goo-fkey.h (original)
+++ trunk/libgnomedb-graph/gnome-db-canvas-fkey.h Wed Apr 30 20:19:18 2008
@@ -1,4 +1,4 @@
-/* gnome-db-goo-fkey.h
+/* gnome-db-canvas-fkey.h
*
* Copyright (C) 2005 Vivien Malerba
*
@@ -18,46 +18,46 @@
* USA
*/
-#ifndef __GNOME_DB_GOO_FKEY__
-#define __GNOME_DB_GOO_FKEY__
+#ifndef __GNOME_DB_CANVAS_FKEY__
+#define __GNOME_DB_CANVAS_FKEY__
-#include "gnome-db-goo-item.h"
+#include "gnome-db-canvas-item.h"
G_BEGIN_DECLS
/*
*
- * "Drag item" GooCanvas item: a GnomeDbGooItem item which is used to represent
+ * "Drag item" GooCanvas item: a GnomeDbCanvasItem item which is used to represent
* an element being dragged, and destroys itself when the mouse button is released
*
*/
-#define GNOME_DB_TYPE_GOO_FKEY (gnome_db_goo_fkey_get_type())
-#define GNOME_DB_GOO_FKEY(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, gnome_db_goo_fkey_get_type(), GnomeDbGooFkey)
-#define GNOME_DB_GOO_FKEY_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, gnome_db_goo_fkey_get_type (), GnomeDbGooFkeyClass)
-#define GNOME_DB_IS_GOO_FKEY(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, gnome_db_goo_fkey_get_type ())
+#define GNOME_DB_TYPE_CANVAS_FKEY (gnome_db_canvas_fkey_get_type())
+#define GNOME_DB_CANVAS_FKEY(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, gnome_db_canvas_fkey_get_type(), GnomeDbCanvasFkey)
+#define GNOME_DB_CANVAS_FKEY_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, gnome_db_canvas_fkey_get_type (), GnomeDbCanvasFkeyClass)
+#define GNOME_DB_IS_CANVAS_FKEY(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, gnome_db_canvas_fkey_get_type ())
-typedef struct _GnomeDbGooFkey GnomeDbGooFkey;
-typedef struct _GnomeDbGooFkeyClass GnomeDbGooFkeyClass;
-typedef struct _GnomeDbGooFkeyPrivate GnomeDbGooFkeyPrivate;
+typedef struct _GnomeDbCanvasFkey GnomeDbCanvasFkey;
+typedef struct _GnomeDbCanvasFkeyClass GnomeDbCanvasFkeyClass;
+typedef struct _GnomeDbCanvasFkeyPrivate GnomeDbCanvasFkeyPrivate;
/* struct for the object's data */
-struct _GnomeDbGooFkey
+struct _GnomeDbCanvasFkey
{
- GnomeDbGooItem object;
- GnomeDbGooFkeyPrivate *priv;
+ GnomeDbCanvasItem object;
+ GnomeDbCanvasFkeyPrivate *priv;
};
/* struct for the object's class */
-struct _GnomeDbGooFkeyClass
+struct _GnomeDbCanvasFkeyClass
{
- GnomeDbGooItemClass parent_class;
+ GnomeDbCanvasItemClass parent_class;
};
-GType gnome_db_goo_fkey_get_type (void) G_GNUC_CONST;
-GooCanvasItem *gnome_db_goo_fkey_new (GooCanvasItem *parent, GdaMetaTableForeignKey *fk, ...);
+GType gnome_db_canvas_fkey_get_type (void) G_GNUC_CONST;
+GooCanvasItem *gnome_db_canvas_fkey_new (GooCanvasItem *parent, GdaMetaTableForeignKey *fk, ...);
G_END_DECLS
Copied: trunk/libgnomedb-graph/gnome-db-canvas-item.c (from r1721, /trunk/libgnomedb-graph/gnome-db-goo-item.c)
==============================================================================
--- /trunk/libgnomedb-graph/gnome-db-goo-item.c (original)
+++ trunk/libgnomedb-graph/gnome-db-canvas-item.c Wed Apr 30 20:19:18 2008
@@ -1,4 +1,4 @@
-/* gnome-db-goo-item.c
+/* gnome-db-canvas-item.c
*
* Copyright (C) 2007 Vivien Malerba
*
@@ -22,26 +22,26 @@
#include <libgda/libgda.h>
#include <libgnomedb/marshal.h>
#include "gnome-db-graph-item.h"
-#include "gnome-db-goo-item.h"
-#include "gnome-db-goo-tip.h"
-#include "gnome-db-goo-cursor.h"
+#include "gnome-db-canvas-item.h"
+#include "gnome-db-canvas-tip.h"
+#include "gnome-db-canvas-cursor.h"
-static void gnome_db_goo_item_class_init (GnomeDbGooItemClass * class);
-static void gnome_db_goo_item_init (GnomeDbGooItem * item);
-static void gnome_db_goo_item_dispose (GObject *object);
+static void gnome_db_canvas_item_class_init (GnomeDbCanvasItemClass * class);
+static void gnome_db_canvas_item_init (GnomeDbCanvasItem * item);
+static void gnome_db_canvas_item_dispose (GObject *object);
-static void gnome_db_goo_item_set_property (GObject *object,
+static void gnome_db_canvas_item_set_property (GObject *object,
guint param_id,
const GValue *value,
GParamSpec *pspec);
-static void gnome_db_goo_item_get_property (GObject *object,
+static void gnome_db_canvas_item_get_property (GObject *object,
guint param_id,
GValue *value,
GParamSpec *pspec);
-static void m_drag_action (GnomeDbGooItem *citem, GnomeDbGooItem *dragged_from, GnomeDbGooItem * dragged_to);
+static void m_drag_action (GnomeDbCanvasItem *citem, GnomeDbCanvasItem *dragged_from, GnomeDbCanvasItem * dragged_to);
-struct _GnomeDbGooItemPrivate
+struct _GnomeDbCanvasItemPrivate
{
gboolean moving;
double xstart;
@@ -71,29 +71,29 @@
PROP_GRAPH_ITEM
};
-static gint gnome_db_goo_item_signals[LAST_SIGNAL] = { 0, 0, 0, 0, 0 };
+static gint gnome_db_canvas_item_signals[LAST_SIGNAL] = { 0, 0, 0, 0, 0 };
/* get a pointer to the parents to be able to call their destructor */
static GObjectClass *base_parent_class = NULL;
GType
-gnome_db_goo_item_get_type (void)
+gnome_db_canvas_item_get_type (void)
{
static GType type = 0;
if (G_UNLIKELY (type == 0)) {
static const GTypeInfo info = {
- sizeof (GnomeDbGooItemClass),
+ sizeof (GnomeDbCanvasItemClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
- (GClassInitFunc) gnome_db_goo_item_class_init,
+ (GClassInitFunc) gnome_db_canvas_item_class_init,
NULL,
NULL,
- sizeof (GnomeDbGooItem),
+ sizeof (GnomeDbCanvasItem),
0,
- (GInstanceInitFunc) gnome_db_goo_item_init
+ (GInstanceInitFunc) gnome_db_canvas_item_init
};
- type = g_type_register_static (GOO_TYPE_CANVAS_GROUP, "GnomeDbGooItem", &info, 0);
+ type = g_type_register_static (GOO_TYPE_CANVAS_GROUP, "GnomeDbCanvasItem", &info, 0);
}
return type;
@@ -101,49 +101,49 @@
static void
-gnome_db_goo_item_class_init (GnomeDbGooItemClass * class)
+gnome_db_canvas_item_class_init (GnomeDbCanvasItemClass * class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
base_parent_class = g_type_class_peek_parent (class);
- gnome_db_goo_item_signals[MOVED] =
+ gnome_db_canvas_item_signals[MOVED] =
g_signal_new ("moved",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (GnomeDbGooItemClass, moved),
+ G_STRUCT_OFFSET (GnomeDbCanvasItemClass, moved),
NULL, NULL,
gnome_db_marshal_VOID__VOID, G_TYPE_NONE,
0);
- gnome_db_goo_item_signals[MOVING] =
+ gnome_db_canvas_item_signals[MOVING] =
g_signal_new ("moving",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (GnomeDbGooItemClass, moving),
+ G_STRUCT_OFFSET (GnomeDbCanvasItemClass, moving),
NULL, NULL,
gnome_db_marshal_VOID__VOID, G_TYPE_NONE,
0);
- gnome_db_goo_item_signals[SHIFTED] =
+ gnome_db_canvas_item_signals[SHIFTED] =
g_signal_new ("shifted",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (GnomeDbGooItemClass, shifted),
+ G_STRUCT_OFFSET (GnomeDbCanvasItemClass, shifted),
NULL, NULL,
gnome_db_marshal_VOID__VOID, G_TYPE_NONE,
0);
- gnome_db_goo_item_signals[DRAG_ACTION] =
+ gnome_db_canvas_item_signals[DRAG_ACTION] =
g_signal_new ("drag_action",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (GnomeDbGooItemClass, drag_action),
+ G_STRUCT_OFFSET (GnomeDbCanvasItemClass, drag_action),
NULL, NULL,
gnome_db_marshal_VOID__POINTER_POINTER,
G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_POINTER);
- gnome_db_goo_item_signals[DESTROY] =
+ gnome_db_canvas_item_signals[DESTROY] =
g_signal_new ("destroy",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (GnomeDbGooItemClass, destroy),
+ G_STRUCT_OFFSET (GnomeDbCanvasItemClass, destroy),
NULL, NULL,
gnome_db_marshal_VOID__VOID, G_TYPE_NONE,
0);
@@ -154,14 +154,14 @@
class->shifted = NULL;
class->drag_action = m_drag_action;
class->destroy = NULL;
- object_class->dispose = gnome_db_goo_item_dispose;
+ object_class->dispose = gnome_db_canvas_item_dispose;
/* virtual funstionc */
class->extra_event = NULL;
/* Properties */
- object_class->set_property = gnome_db_goo_item_set_property;
- object_class->get_property = gnome_db_goo_item_get_property;
+ object_class->set_property = gnome_db_canvas_item_set_property;
+ object_class->get_property = gnome_db_canvas_item_get_property;
g_object_class_install_property
(object_class, PROP_ALLOW_MOVE,
@@ -178,19 +178,19 @@
}
static void
-m_drag_action (GnomeDbGooItem *citem, GnomeDbGooItem *dragged_from, GnomeDbGooItem *dragged_to)
+m_drag_action (GnomeDbCanvasItem *citem, GnomeDbCanvasItem *dragged_from, GnomeDbCanvasItem *dragged_to)
{
GooCanvasItem *parent;
- /* make sure the parent GnomeDbGooItem forwards the DND info... */
+ /* make sure the parent GnomeDbCanvasItem forwards the DND info... */
g_object_get (G_OBJECT (citem), "parent", &parent, NULL);
if (parent)
g_object_unref (parent); /* we don't want to keep a reference on @parent */
- if (GNOME_DB_IS_GOO_ITEM (parent)) {
+ if (GNOME_DB_IS_CANVAS_ITEM (parent)) {
#ifdef debug_signal
g_print (">> 'DRAG_ACTION' from %s::%s()\n", __FILE__, __FUNCTION__);
#endif
- g_signal_emit (G_OBJECT (parent), gnome_db_goo_item_signals[DRAG_ACTION], 0,
+ g_signal_emit (G_OBJECT (parent), gnome_db_canvas_item_signals[DRAG_ACTION], 0,
dragged_from, dragged_to);
#ifdef debug_signal
g_print ("<< 'DRAG_ACTION' from %s::%s()\n", __FILE__, __FUNCTION__);
@@ -198,22 +198,22 @@
}
}
-static gboolean enter_notify_event (GnomeDbGooItem *citem, GooCanvasItem *target_item,
+static gboolean enter_notify_event (GnomeDbCanvasItem *citem, GooCanvasItem *target_item,
GdkEventCrossing *event, gpointer data);
-static gboolean leave_notify_event (GnomeDbGooItem *citem, GooCanvasItem *target_item,
+static gboolean leave_notify_event (GnomeDbCanvasItem *citem, GooCanvasItem *target_item,
GdkEventCrossing *event, gpointer data);
-static gboolean button_press_event (GnomeDbGooItem *citem, GooCanvasItem *target_item,
+static gboolean button_press_event (GnomeDbCanvasItem *citem, GooCanvasItem *target_item,
GdkEventButton *event, gpointer data);
-static gboolean button_release_event (GnomeDbGooItem *citem, GooCanvasItem *target_item,
+static gboolean button_release_event (GnomeDbCanvasItem *citem, GooCanvasItem *target_item,
GdkEventButton *event, gpointer data);
-static gboolean motion_notify_event (GnomeDbGooItem *citem, GooCanvasItem *target_item,
+static gboolean motion_notify_event (GnomeDbCanvasItem *citem, GooCanvasItem *target_item,
GdkEventMotion *event, gpointer data);
static void
-gnome_db_goo_item_init (GnomeDbGooItem * item)
+gnome_db_canvas_item_init (GnomeDbCanvasItem * item)
{
- item->priv = g_new0 (GnomeDbGooItemPrivate, 1);
+ item->priv = g_new0 (GnomeDbCanvasItemPrivate, 1);
item->priv->moving = FALSE;
item->priv->xstart = 0;
item->priv->ystart = 0;
@@ -235,19 +235,19 @@
}
-static void release_graph_item (GnomeDbGooItem *citem, GnomeDbGraphItem *item);
-static void graph_item_moved_cb (GnomeDbGraphItem *item, GnomeDbGooItem *citem);
+static void release_graph_item (GnomeDbCanvasItem *citem, GnomeDbGraphItem *item);
+static void graph_item_moved_cb (GnomeDbGraphItem *item, GnomeDbCanvasItem *citem);
static void
-gnome_db_goo_item_dispose (GObject *object)
+gnome_db_canvas_item_dispose (GObject *object)
{
- GnomeDbGooItem *citem;
+ GnomeDbCanvasItem *citem;
g_return_if_fail (object != NULL);
- g_return_if_fail (GNOME_DB_IS_GOO_ITEM (object));
+ g_return_if_fail (GNOME_DB_IS_CANVAS_ITEM (object));
- citem = GNOME_DB_GOO_ITEM (object);
+ citem = GNOME_DB_CANVAS_ITEM (object);
if (citem->priv) {
- g_signal_emit (object, gnome_db_goo_item_signals[DESTROY], 0);
+ g_signal_emit (object, gnome_db_canvas_item_signals[DESTROY], 0);
if (citem->priv->graph_item) {
g_object_weak_unref (G_OBJECT (citem->priv->graph_item),
@@ -267,16 +267,16 @@
}
static void
-gnome_db_goo_item_set_property (GObject *object,
+gnome_db_canvas_item_set_property (GObject *object,
guint param_id,
const GValue *value,
GParamSpec *pspec)
{
- GnomeDbGooItem *citem = NULL;
+ GnomeDbCanvasItem *citem = NULL;
const gchar *str = NULL;
GObject* propobject = NULL;
- citem = GNOME_DB_GOO_ITEM (object);
+ citem = GNOME_DB_CANVAS_ITEM (object);
switch (param_id) {
case PROP_ALLOW_MOVE:
@@ -321,14 +321,14 @@
}
static void
-gnome_db_goo_item_get_property (GObject *object,
+gnome_db_canvas_item_get_property (GObject *object,
guint param_id,
GValue *value,
GParamSpec *pspec)
{
- GnomeDbGooItem *citem = NULL;
+ GnomeDbCanvasItem *citem = NULL;
- citem = GNOME_DB_GOO_ITEM (object);
+ citem = GNOME_DB_CANVAS_ITEM (object);
switch (param_id) {
case PROP_ALLOW_MOVE:
g_value_set_boolean (value, citem->priv->allow_move);
@@ -350,40 +350,40 @@
}
/**
- * gnome_db_goo_item_get_canvas
- * @item: a #GnomeDbGooItem object
+ * gnome_db_canvas_item_get_canvas
+ * @item: a #GnomeDbCanvasItem object
*
- * Get the #GnomeDbGoo on which @item is drawn
+ * Get the #GnomeDbCanvas on which @item is drawn
*
- * Returns: the #GnomeDbGoo widget
+ * Returns: the #GnomeDbCanvas widget
*/
-GnomeDbGoo *
-gnome_db_goo_item_get_canvas (GnomeDbGooItem *item)
+GnomeDbCanvas *
+gnome_db_canvas_item_get_canvas (GnomeDbCanvasItem *item)
{
- g_return_val_if_fail (GNOME_DB_IS_GOO_ITEM (item), NULL);
- return (GnomeDbGoo *) goo_canvas_item_get_canvas (GOO_CANVAS_ITEM (item));
+ g_return_val_if_fail (GNOME_DB_IS_CANVAS_ITEM (item), NULL);
+ return (GnomeDbCanvas *) goo_canvas_item_get_canvas (GOO_CANVAS_ITEM (item));
}
/**
- * gnome_db_goo_item_get_graph_item
- * @item: a #GnomeDbGooItem object
+ * gnome_db_canvas_item_get_graph_item
+ * @item: a #GnomeDbCanvasItem object
*
* Get the associated #GnomeDbGraphItem to @item.
*
* Returns: the #GnomeDbGraphItem, or %NULL
*/
GnomeDbGraphItem *
-gnome_db_goo_item_get_graph_item (GnomeDbGooItem *item)
+gnome_db_canvas_item_get_graph_item (GnomeDbCanvasItem *item)
{
- g_return_val_if_fail (GNOME_DB_IS_GOO_ITEM (item), NULL);
+ g_return_val_if_fail (GNOME_DB_IS_CANVAS_ITEM (item), NULL);
g_return_val_if_fail (item->priv, NULL);
return item->priv->graph_item;
}
/**
- * gnome_db_goo_item_get_edge_nodes
- * @item: a #GnomeDbGooItem object
+ * gnome_db_canvas_item_get_edge_nodes
+ * @item: a #GnomeDbCanvasItem object
* @from: a place to store the FROM part of the edge, or %NULL
* @to: a place to store the TO part of the edge, or %NULL
*
@@ -391,15 +391,15 @@
* set @from and @to to those items.
*/
void
-gnome_db_goo_item_get_edge_nodes (GnomeDbGooItem *item,
- GnomeDbGooItem **from, GnomeDbGooItem **to)
+gnome_db_canvas_item_get_edge_nodes (GnomeDbCanvasItem *item,
+ GnomeDbCanvasItem **from, GnomeDbCanvasItem **to)
{
- GnomeDbGooItemClass *class;
+ GnomeDbCanvasItemClass *class;
- g_return_if_fail (GNOME_DB_IS_GOO_ITEM (item));
+ g_return_if_fail (GNOME_DB_IS_CANVAS_ITEM (item));
g_return_if_fail (item->priv);
- class = GNOME_DB_GOO_ITEM_CLASS (G_OBJECT_GET_CLASS (item));
+ class = GNOME_DB_CANVAS_ITEM_CLASS (G_OBJECT_GET_CLASS (item));
if (class->get_edge_nodes)
(class->get_edge_nodes) (item, from, to);
else {
@@ -412,7 +412,7 @@
static void
-release_graph_item (GnomeDbGooItem *citem, GnomeDbGraphItem *item)
+release_graph_item (GnomeDbCanvasItem *citem, GnomeDbGraphItem *item)
{
g_assert (citem->priv->graph_item == item);
g_signal_handlers_disconnect_by_func (G_OBJECT (item),
@@ -421,7 +421,7 @@
}
static void
-graph_item_moved_cb (GnomeDbGraphItem *item, GnomeDbGooItem *citem)
+graph_item_moved_cb (GnomeDbGraphItem *item, GnomeDbCanvasItem *citem)
{
gdouble x, y;
GooCanvasBounds bounds;
@@ -435,19 +435,19 @@
#ifdef debug_signal
g_print (">> 'SHIFTED' from %s::graph_item_moved_cb()\n", __FILE__);
#endif
- g_signal_emit (G_OBJECT (citem), gnome_db_goo_item_signals[SHIFTED], 0);
+ g_signal_emit (G_OBJECT (citem), gnome_db_canvas_item_signals[SHIFTED], 0);
#ifdef debug_signal
g_print ("<< 'SHIFTED' from %s::graph_item_moved_cb()\n", __FILE__);
#endif
}
-static void end_of_drag_cb (GnomeDbGooItem *citem, GObject *cursor);
-static void end_of_drag_cb_d (GooCanvasItem *ci, GnomeDbGooItem *citem);
-static gboolean add_tip_timeout (GnomeDbGooItem *citem);
-static gboolean display_tip_timeout (GnomeDbGooItem *citem);
+static void end_of_drag_cb (GnomeDbCanvasItem *citem, GObject *cursor);
+static void end_of_drag_cb_d (GooCanvasItem *ci, GnomeDbCanvasItem *citem);
+static gboolean add_tip_timeout (GnomeDbCanvasItem *citem);
+static gboolean display_tip_timeout (GnomeDbCanvasItem *citem);
static gboolean
-enter_notify_event (GnomeDbGooItem *citem, GooCanvasItem *target_item,
+enter_notify_event (GnomeDbCanvasItem *citem, GooCanvasItem *target_item,
GdkEventCrossing *event, gpointer data)
{
GooCanvasItem *root;
@@ -456,11 +456,11 @@
/* Drag management */
root = goo_canvas_get_root_item (goo_canvas_item_get_canvas (GOO_CANVAS_ITEM (citem)));
ci = g_object_get_data (G_OBJECT (root), "dragged_from");
- if (ci && GNOME_DB_IS_GOO_ITEM (ci)) {
+ if (ci && GNOME_DB_IS_CANVAS_ITEM (ci)) {
#ifdef debug_signal
g_print (">> 'DRAG_ACTION' from %s::%s()\n", __FILE__, __FUNCTION__);
#endif
- g_signal_emit (G_OBJECT (citem), gnome_db_goo_item_signals[DRAG_ACTION], 0, ci, citem);
+ g_signal_emit (G_OBJECT (citem), gnome_db_canvas_item_signals[DRAG_ACTION], 0, ci, citem);
#ifdef debug_signal
g_print ("<< 'DRAG_ACTION' from %s::%s()\n", __FILE__, __FUNCTION__);
#endif
@@ -470,7 +470,7 @@
}
static gboolean
-leave_notify_event (GnomeDbGooItem *citem, GooCanvasItem *target_item,
+leave_notify_event (GnomeDbCanvasItem *citem, GooCanvasItem *target_item,
GdkEventCrossing *event, gpointer data)
{
GObject *obj;
@@ -498,10 +498,10 @@
}
static gboolean
-button_press_event (GnomeDbGooItem *citem, GooCanvasItem *target_item,
+button_press_event (GnomeDbCanvasItem *citem, GooCanvasItem *target_item,
GdkEventButton *event, gpointer data)
{
- GnomeDbGooItemClass *class = GNOME_DB_GOO_ITEM_CLASS (G_OBJECT_GET_CLASS (citem));
+ GnomeDbCanvasItemClass *class = GNOME_DB_CANVAS_ITEM_CLASS (G_OBJECT_GET_CLASS (citem));
gboolean done = FALSE;
GooCanvasItem *ci;
GObject *obj;
@@ -544,7 +544,7 @@
if (class->extra_event)
(class->extra_event) (citem, GDK_LEAVE_NOTIFY);
- ci = gnome_db_goo_cursor_new (goo_canvas_get_root_item (canvas),
+ ci = gnome_db_canvas_cursor_new (goo_canvas_get_root_item (canvas),
"x", bounds.x1,
"y", bounds.y1,
"width", bounds.x2 - bounds.x1,
@@ -557,9 +557,9 @@
/* this weak ref is in case citem is destroyed before ci */
g_object_weak_ref (G_OBJECT (citem), (GWeakNotify) end_of_drag_cb_d, ci);
- GNOME_DB_GOO_ITEM (ci)->priv->xstart = bounds.x1 + event->x;
- GNOME_DB_GOO_ITEM (ci)->priv->ystart = bounds.y1 + event->y;
- GNOME_DB_GOO_ITEM (ci)->priv->moving = TRUE;
+ GNOME_DB_CANVAS_ITEM (ci)->priv->xstart = bounds.x1 + event->x;
+ GNOME_DB_CANVAS_ITEM (ci)->priv->ystart = bounds.y1 + event->y;
+ GNOME_DB_CANVAS_ITEM (ci)->priv->moving = TRUE;
goo_canvas_item_raise (GOO_CANVAS_ITEM (ci), NULL);
goo_canvas_pointer_grab (canvas, GOO_CANVAS_ITEM (ci),
GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK,
@@ -575,7 +575,7 @@
}
static gboolean
-button_release_event (GnomeDbGooItem *citem, GooCanvasItem *target_item,
+button_release_event (GnomeDbCanvasItem *citem, GooCanvasItem *target_item,
GdkEventButton *event, gpointer data)
{
if (citem->priv->allow_move) {
@@ -588,7 +588,7 @@
#ifdef debug_signal
g_print (">> 'MOVED' from %s::item_event()\n", __FILE__);
#endif
- g_signal_emit (G_OBJECT (citem), gnome_db_goo_item_signals[MOVED], 0);
+ g_signal_emit (G_OBJECT (citem), gnome_db_canvas_item_signals[MOVED], 0);
#ifdef debug_signal
g_print ("<< 'MOVED' from %s::item_event()\n", __FILE__);
#endif
@@ -598,7 +598,7 @@
}
static gboolean
-motion_notify_event (GnomeDbGooItem *citem, GooCanvasItem *target_item,
+motion_notify_event (GnomeDbCanvasItem *citem, GooCanvasItem *target_item,
GdkEventMotion *event, gpointer data)
{
guint id;
@@ -606,11 +606,11 @@
gboolean retval = FALSE;
if (citem->priv->moving && (event->state & GDK_BUTTON1_MASK)) {
- g_assert (GNOME_DB_IS_GOO_ITEM (citem));
+ g_assert (GNOME_DB_IS_CANVAS_ITEM (citem));
goo_canvas_item_translate (GOO_CANVAS_ITEM (citem),
(gdouble) event->x - citem->priv->xstart,
(gdouble) event->y - citem->priv->ystart);
- g_signal_emit (G_OBJECT (citem), gnome_db_goo_item_signals[MOVING], 0);
+ g_signal_emit (G_OBJECT (citem), gnome_db_canvas_item_signals[MOVING], 0);
retval = TRUE;
}
else {
@@ -644,7 +644,7 @@
}
static void
-end_of_drag_cb (GnomeDbGooItem *citem, GObject *cursor)
+end_of_drag_cb (GnomeDbCanvasItem *citem, GObject *cursor)
{
GooCanvasItem *root;
@@ -655,12 +655,12 @@
}
static void
-end_of_drag_cb_d (GooCanvasItem *ci, GnomeDbGooItem *citem)
+end_of_drag_cb_d (GooCanvasItem *ci, GnomeDbCanvasItem *citem)
{
g_object_weak_unref (G_OBJECT (ci), (GWeakNotify) end_of_drag_cb, citem);
}
-static gboolean add_tip_timeout (GnomeDbGooItem *citem)
+static gboolean add_tip_timeout (GnomeDbCanvasItem *citem)
{
guint id;
@@ -671,8 +671,8 @@
}
-static void tip_destroy (GnomeDbGooItem *citem, GObject *tip);
-static gboolean display_tip_timeout (GnomeDbGooItem *citem)
+static void tip_destroy (GnomeDbCanvasItem *citem, GObject *tip);
+static gboolean display_tip_timeout (GnomeDbCanvasItem *citem)
{
GooCanvasItem *tip;
gdouble x, y;
@@ -683,7 +683,7 @@
x = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (citem), "mousex"));
y = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (citem), "mousey"));
- tip = gnome_db_goo_tip_new (goo_canvas_get_root_item (goo_canvas_item_get_canvas (GOO_CANVAS_ITEM (citem))),
+ tip = gnome_db_canvas_tip_new (goo_canvas_get_root_item (goo_canvas_item_get_canvas (GOO_CANVAS_ITEM (citem))),
citem->priv->tooltip_text, x + 7., y + 3., NULL);
goo_canvas_item_raise (tip, NULL);
g_object_weak_ref (G_OBJECT (tip), (GWeakNotify) tip_destroy, citem);
@@ -693,7 +693,7 @@
return FALSE;
}
-static void tip_destroy (GnomeDbGooItem *citem, GObject *tip)
+static void tip_destroy (GnomeDbCanvasItem *citem, GObject *tip)
{
g_object_set_data (G_OBJECT (citem), "tip", NULL);
}
Copied: trunk/libgnomedb-graph/gnome-db-canvas-item.h (from r1721, /trunk/libgnomedb-graph/gnome-db-goo-item.h)
==============================================================================
--- /trunk/libgnomedb-graph/gnome-db-goo-item.h (original)
+++ trunk/libgnomedb-graph/gnome-db-canvas-item.h Wed Apr 30 20:19:18 2008
@@ -1,4 +1,4 @@
-/* gnome-db-goo-item.h
+/* gnome-db-canvas-item.h
*
* Copyright (C) 2007 - 2008 Vivien Malerba
*
@@ -18,17 +18,17 @@
* USA
*/
-#ifndef __GNOME_DB_GOO_ITEM__
-#define __GNOME_DB_GOO_ITEM__
+#ifndef __GNOME_DB_CANVAS_ITEM__
+#define __GNOME_DB_CANVAS_ITEM__
#include <goocanvas.h>
-#include <libgnomedb-graph/gnome-db-goo-decl.h>
+#include <libgnomedb-graph/gnome-db-canvas-decl.h>
G_BEGIN_DECLS
/*
*
- * GnomeDbGooItem item: an item with the following capabilities:
+ * GnomeDbCanvasItem item: an item with the following capabilities:
* - can be moved around and emits the "moved" signal after the move.
* - is being put on top when the user clicks on it (button 1)
* - manage dragging operation (if allowed to)
@@ -46,43 +46,43 @@
*
*/
-#define GNOME_DB_TYPE_GOO_ITEM (gnome_db_goo_item_get_type())
-#define GNOME_DB_GOO_ITEM(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, gnome_db_goo_item_get_type(), GnomeDbGooItem)
-#define GNOME_DB_GOO_ITEM_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, gnome_db_goo_item_get_type (), GnomeDbGooItemClass)
-#define GNOME_DB_IS_GOO_ITEM(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, gnome_db_goo_item_get_type ())
+#define GNOME_DB_TYPE_CANVAS_ITEM (gnome_db_canvas_item_get_type())
+#define GNOME_DB_CANVAS_ITEM(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, gnome_db_canvas_item_get_type(), GnomeDbCanvasItem)
+#define GNOME_DB_CANVAS_ITEM_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, gnome_db_canvas_item_get_type (), GnomeDbCanvasItemClass)
+#define GNOME_DB_IS_CANVAS_ITEM(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, gnome_db_canvas_item_get_type ())
/* struct for the object's data */
-struct _GnomeDbGooItem
+struct _GnomeDbCanvasItem
{
GooCanvasGroup object;
- GnomeDbGooItemPrivate *priv;
+ GnomeDbCanvasItemPrivate *priv;
};
/* struct for the object's class */
-struct _GnomeDbGooItemClass
+struct _GnomeDbCanvasItemClass
{
GooCanvasGroupClass parent_class;
/* signals */
- void (*moved) (GnomeDbGooItem *citem);
- void (*moving) (GnomeDbGooItem *citem);
- void (*shifted) (GnomeDbGooItem *citem);
- void (*drag_action) (GnomeDbGooItem *citem, GnomeDbGooItem * dragged_from, GnomeDbGooItem * dragged_to);
- void (*destroy) (GnomeDbGooItem *citem);
+ void (*moved) (GnomeDbCanvasItem *citem);
+ void (*moving) (GnomeDbCanvasItem *citem);
+ void (*shifted) (GnomeDbCanvasItem *citem);
+ void (*drag_action) (GnomeDbCanvasItem *citem, GnomeDbCanvasItem * dragged_from, GnomeDbCanvasItem * dragged_to);
+ void (*destroy) (GnomeDbCanvasItem *citem);
/* virtual functions */
- void (*extra_event) (GnomeDbGooItem *citem, GdkEventType event_type);
- void (*get_edge_nodes)(GnomeDbGooItem *citem, GnomeDbGooItem **from, GnomeDbGooItem **to);
+ void (*extra_event) (GnomeDbCanvasItem *citem, GdkEventType event_type);
+ void (*get_edge_nodes)(GnomeDbCanvasItem *citem, GnomeDbCanvasItem **from, GnomeDbCanvasItem **to);
};
-GType gnome_db_goo_item_get_type (void) G_GNUC_CONST;
+GType gnome_db_canvas_item_get_type (void) G_GNUC_CONST;
-GnomeDbGoo *gnome_db_goo_item_get_canvas (GnomeDbGooItem *item);
-GnomeDbGraphItem *gnome_db_goo_item_get_graph_item (GnomeDbGooItem *item);
-void gnome_db_goo_item_get_edge_nodes (GnomeDbGooItem *item,
- GnomeDbGooItem **from, GnomeDbGooItem **to);
+GnomeDbCanvas *gnome_db_canvas_item_get_canvas (GnomeDbCanvasItem *item);
+GnomeDbGraphItem *gnome_db_canvas_item_get_graph_item (GnomeDbCanvasItem *item);
+void gnome_db_canvas_item_get_edge_nodes (GnomeDbCanvasItem *item,
+ GnomeDbCanvasItem **from, GnomeDbCanvasItem **to);
G_END_DECLS
Copied: trunk/libgnomedb-graph/gnome-db-canvas-print.c (from r1721, /trunk/libgnomedb-graph/gnome-db-goo-print.c)
==============================================================================
--- /trunk/libgnomedb-graph/gnome-db-goo-print.c (original)
+++ trunk/libgnomedb-graph/gnome-db-canvas-print.c Wed Apr 30 20:19:18 2008
@@ -1,4 +1,4 @@
-/* gnome-db-goo-print.c
+/* gnome-db-canvas-print.c
*
* Copyright (C) 2007 Vivien Malerba
*
@@ -20,7 +20,7 @@
#include <glib/gi18n-lib.h>
#include <gtk/gtk.h>
-#include "gnome-db-goo.h"
+#include "gnome-db-canvas.h"
#include <cairo.h>
#ifdef HAVE_GTKTWOTEN
@@ -44,7 +44,7 @@
static GtkPageSetup *page_setup = NULL;
static gboolean show_page_numbers = TRUE;
-void gnome_db_goo_print (GnomeDbGoo *canvas)
+void gnome_db_canvas_print (GnomeDbCanvas *canvas)
{
GtkPrintOperation *print;
GtkPrintOperationResult res;
Copied: trunk/libgnomedb-graph/gnome-db-canvas-print.h (from r1721, /trunk/libgnomedb-graph/gnome-db-goo-print.h)
==============================================================================
--- /trunk/libgnomedb-graph/gnome-db-goo-print.h (original)
+++ trunk/libgnomedb-graph/gnome-db-canvas-print.h Wed Apr 30 20:19:18 2008
@@ -1,4 +1,4 @@
-/* gnome-db-goo-print.h
+/* gnome-db-canvas-print.h
*
* Copyright (C) 2007 Vivien Malerba <malerba gnome-db org>
*
@@ -22,6 +22,6 @@
G_BEGIN_DECLS
-void gnome_db_goo_print (GnomeDbGoo *canvas);
+void gnome_db_canvas_print (GnomeDbCanvas *canvas);
G_END_DECLS
Copied: trunk/libgnomedb-graph/gnome-db-canvas-table.c (from r1721, /trunk/libgnomedb-graph/gnome-db-goo-table.c)
==============================================================================
--- /trunk/libgnomedb-graph/gnome-db-goo-table.c (original)
+++ trunk/libgnomedb-graph/gnome-db-canvas-table.c Wed Apr 30 20:19:18 2008
@@ -1,4 +1,4 @@
-/* gnome-db-goo-table.c
+/* gnome-db-canvas-table.c
*
* Copyright (C) 2002 - 2007 Vivien Malerba
*
@@ -20,21 +20,21 @@
#include <gtk/gtk.h>
#include <libgda/libgda.h>
-#include "gnome-db-goo.h"
-#include "gnome-db-goo-table.h"
-#include "gnome-db-goo-column.h"
+#include "gnome-db-canvas.h"
+#include "gnome-db-canvas-table.h"
+#include "gnome-db-canvas-column.h"
#include <glib/gi18n-lib.h>
-static void gnome_db_goo_table_class_init (GnomeDbGooTableClass * class);
-static void gnome_db_goo_table_init (GnomeDbGooTable * drag);
-static void gnome_db_goo_table_dispose (GObject *object);
-static void gnome_db_goo_table_finalize (GObject *object);
+static void gnome_db_canvas_table_class_init (GnomeDbCanvasTableClass * class);
+static void gnome_db_canvas_table_init (GnomeDbCanvasTable * drag);
+static void gnome_db_canvas_table_dispose (GObject *object);
+static void gnome_db_canvas_table_finalize (GObject *object);
-static void gnome_db_goo_table_set_property (GObject *object,
+static void gnome_db_canvas_table_set_property (GObject *object,
guint param_id,
const GValue *value,
GParamSpec *pspec);
-static void gnome_db_goo_table_get_property (GObject *object,
+static void gnome_db_canvas_table_get_property (GObject *object,
guint param_id,
GValue *value,
GParamSpec *pspec);
@@ -46,7 +46,7 @@
PROP_MENU_FUNC
};
-struct _GnomeDbGooTablePrivate
+struct _GnomeDbCanvasTablePrivate
{
GdaMetaTable *table;
@@ -54,7 +54,7 @@
GSList *column_items; /* list of GooCanvasItem for the columns */
GSList *other_items; /* list of GooCanvasItem for other purposes */
gdouble *column_ypos; /* array for each column's Y position in this canvas group */
- GtkWidget *(*popup_menu_func) (GnomeDbGooTable *ce);
+ GtkWidget *(*popup_menu_func) (GnomeDbCanvasTable *ce);
/* presentation parameters */
gdouble x_text_space;
@@ -65,24 +65,24 @@
static GObjectClass *table_parent_class = NULL;
GType
-gnome_db_goo_table_get_type (void)
+gnome_db_canvas_table_get_type (void)
{
static GType type = 0;
if (G_UNLIKELY (type == 0)) {
static const GTypeInfo info = {
- sizeof (GnomeDbGooTableClass),
+ sizeof (GnomeDbCanvasTableClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
- (GClassInitFunc) gnome_db_goo_table_class_init,
+ (GClassInitFunc) gnome_db_canvas_table_class_init,
NULL,
NULL,
- sizeof (GnomeDbGooTable),
+ sizeof (GnomeDbCanvasTable),
0,
- (GInstanceInitFunc) gnome_db_goo_table_init
+ (GInstanceInitFunc) gnome_db_canvas_table_init
};
- type = g_type_register_static (GNOME_DB_TYPE_GOO_ITEM, "GnomeDbGooTable", &info, 0);
+ type = g_type_register_static (GNOME_DB_TYPE_CANVAS_ITEM, "GnomeDbCanvasTable", &info, 0);
}
return type;
@@ -90,18 +90,18 @@
static void
-gnome_db_goo_table_class_init (GnomeDbGooTableClass * class)
+gnome_db_canvas_table_class_init (GnomeDbCanvasTableClass * class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
table_parent_class = g_type_class_peek_parent (class);
- object_class->dispose = gnome_db_goo_table_dispose;
- object_class->finalize = gnome_db_goo_table_finalize;
+ object_class->dispose = gnome_db_canvas_table_dispose;
+ object_class->finalize = gnome_db_canvas_table_finalize;
/* Properties */
- object_class->set_property = gnome_db_goo_table_set_property;
- object_class->get_property = gnome_db_goo_table_get_property;
+ object_class->set_property = gnome_db_canvas_table_set_property;
+ object_class->get_property = gnome_db_canvas_table_get_property;
g_object_class_install_property
(object_class, PROP_TABLE,
@@ -110,17 +110,17 @@
g_object_class_install_property
(object_class, PROP_MENU_FUNC,
g_param_spec_pointer ("popup_menu_func", "Popup menu function",
- "Function to create a popup menu on each GnomeDbGooTable",
+ "Function to create a popup menu on each GnomeDbCanvasTable",
G_PARAM_WRITABLE));
}
-static gboolean button_press_event_cb (GnomeDbGooTable *ce, GooCanvasItem *target_item, GdkEventButton *event,
+static gboolean button_press_event_cb (GnomeDbCanvasTable *ce, GooCanvasItem *target_item, GdkEventButton *event,
gpointer unused_data);
static void
-gnome_db_goo_table_init (GnomeDbGooTable *table)
+gnome_db_canvas_table_init (GnomeDbCanvasTable *table)
{
- table->priv = g_new0 (GnomeDbGooTablePrivate, 1);
+ table->priv = g_new0 (GnomeDbCanvasTablePrivate, 1);
table->priv->table = NULL;
table->priv->column_ypos = NULL;
table->priv->popup_menu_func = NULL;
@@ -132,17 +132,17 @@
G_CALLBACK (button_press_event_cb), NULL);
}
-static void clean_items (GnomeDbGooTable *ce);
-static void create_items (GnomeDbGooTable *ce);
+static void clean_items (GnomeDbCanvasTable *ce);
+static void create_items (GnomeDbCanvasTable *ce);
static void
-gnome_db_goo_table_dispose (GObject *object)
+gnome_db_canvas_table_dispose (GObject *object)
{
- GnomeDbGooTable *ce;
+ GnomeDbCanvasTable *ce;
- g_return_if_fail (GNOME_DB_IS_GOO_TABLE (object));
+ g_return_if_fail (GNOME_DB_IS_CANVAS_TABLE (object));
- ce = GNOME_DB_GOO_TABLE (object);
+ ce = GNOME_DB_CANVAS_TABLE (object);
/* REM: let the GooCanvas library destroy the items itself */
ce->priv->table = NULL;
@@ -153,13 +153,13 @@
static void
-gnome_db_goo_table_finalize (GObject * object)
+gnome_db_canvas_table_finalize (GObject * object)
{
- GnomeDbGooTable *ce;
+ GnomeDbCanvasTable *ce;
g_return_if_fail (object != NULL);
- g_return_if_fail (GNOME_DB_IS_GOO_TABLE (object));
+ g_return_if_fail (GNOME_DB_IS_CANVAS_TABLE (object));
- ce = GNOME_DB_GOO_TABLE (object);
+ ce = GNOME_DB_CANVAS_TABLE (object);
if (ce->priv) {
g_slist_free (ce->priv->column_items);
g_slist_free (ce->priv->other_items);
@@ -175,14 +175,14 @@
}
static void
-gnome_db_goo_table_set_property (GObject *object,
+gnome_db_canvas_table_set_property (GObject *object,
guint param_id,
const GValue *value,
GParamSpec *pspec)
{
- GnomeDbGooTable *ce = NULL;
+ GnomeDbCanvasTable *ce = NULL;
- ce = GNOME_DB_GOO_TABLE (object);
+ ce = GNOME_DB_CANVAS_TABLE (object);
switch (param_id) {
case PROP_TABLE: {
@@ -203,13 +203,13 @@
break;
}
case PROP_MENU_FUNC:
- ce->priv->popup_menu_func = (GtkWidget *(*) (GnomeDbGooTable *ce)) g_value_get_pointer (value);
+ ce->priv->popup_menu_func = (GtkWidget *(*) (GnomeDbCanvasTable *ce)) g_value_get_pointer (value);
break;
}
}
static void
-gnome_db_goo_table_get_property (GObject *object,
+gnome_db_canvas_table_get_property (GObject *object,
guint param_id,
GValue *value,
GParamSpec *pspec)
@@ -221,7 +221,7 @@
* destroy any existing GooCanvasItem obejcts
*/
static void
-clean_items (GnomeDbGooTable *ce)
+clean_items (GnomeDbCanvasTable *ce)
{
GSList *list;
/* destroy all the items in the group */
@@ -244,7 +244,7 @@
* create new GooCanvasItem objects
*/
static void
-create_items (GnomeDbGooTable *ce)
+create_items (GnomeDbCanvasTable *ce)
{
GooCanvasItem *item, *frame, *title;
gdouble y, ysep;
@@ -295,7 +295,7 @@
/* columns */
for (column_nb = 0, list = columns; list; list = list->next, column_nb++) {
ce->priv->column_ypos [column_nb] = y;
- item = gnome_db_goo_column_new (GOO_CANVAS_ITEM (ce),
+ item = gnome_db_canvas_column_new (GOO_CANVAS_ITEM (ce),
GDA_META_TABLE_COLUMN (list->data),
X_PAD, ce->priv->column_ypos [column_nb], NULL);
ce->priv->column_items = g_slist_append (ce->priv->column_items, item);
@@ -335,7 +335,7 @@
}
static gboolean
-button_press_event_cb (GnomeDbGooTable *ce, GooCanvasItem *target_item, GdkEventButton *event,
+button_press_event_cb (GnomeDbCanvasTable *ce, GooCanvasItem *target_item, GdkEventButton *event,
gpointer unused_data)
{
if (ce->priv->popup_menu_func) {
@@ -351,21 +351,21 @@
}
/**
- * gnome_db_goo_table_get_column_item
- * @ce: a #GnomeDbGooTable object
+ * gnome_db_canvas_table_get_column_item
+ * @ce: a #GnomeDbCanvasTable object
* @column: a #GdaMetaTableColumn object
*
- * Get the #GnomeDbGooColumn object representing @column
+ * Get the #GnomeDbCanvasColumn object representing @column
* in @ce.
*
- * Returns: the corresponding #GnomeDbGooColumn
+ * Returns: the corresponding #GnomeDbCanvasColumn
*/
-GnomeDbGooColumn *
-gnome_db_goo_table_get_column_item (GnomeDbGooTable *ce, GdaMetaTableColumn *column)
+GnomeDbCanvasColumn *
+gnome_db_canvas_table_get_column_item (GnomeDbCanvasTable *ce, GdaMetaTableColumn *column)
{
gint pos;
- g_return_val_if_fail (ce && GNOME_DB_IS_GOO_TABLE (ce), NULL);
+ g_return_val_if_fail (ce && GNOME_DB_IS_CANVAS_TABLE (ce), NULL);
g_return_val_if_fail (ce->priv, NULL);
g_return_val_if_fail (ce->priv->table, NULL);
@@ -377,21 +377,21 @@
/**
- * gnome_db_goo_table_get_column_ypos
- * @ce: a #GnomeDbGooTable object
+ * gnome_db_canvas_table_get_column_ypos
+ * @ce: a #GnomeDbCanvasTable object
* @column: a #GdaMetaTableColumn object
*
- * Get the Y position of the middle of the #GnomeDbGooColumn object representing @column
+ * Get the Y position of the middle of the #GnomeDbCanvasColumn object representing @column
* in @ce, in @ce's coordinates.
*
* Returns: the Y coordinate.
*/
gdouble
-gnome_db_goo_table_get_column_ypos (GnomeDbGooTable *ce, GdaMetaTableColumn *column)
+gnome_db_canvas_table_get_column_ypos (GnomeDbCanvasTable *ce, GdaMetaTableColumn *column)
{
gint pos;
- g_return_val_if_fail (ce && GNOME_DB_IS_GOO_TABLE (ce), 0.);
+ g_return_val_if_fail (ce && GNOME_DB_IS_CANVAS_TABLE (ce), 0.);
g_return_val_if_fail (ce->priv, 0.);
g_return_val_if_fail (ce->priv->table, 0.);
g_return_val_if_fail (ce->priv->column_ypos, 0.);
@@ -403,7 +403,7 @@
/**
- * gnome_db_goo_table_new
+ * gnome_db_canvas_table_new
* @parent: the parent item, or NULL.
* @table: a #GdaMetaTable to display
* @x: the x coordinate
@@ -415,14 +415,14 @@
* Returns: a new #GooCanvasItem object
*/
GooCanvasItem *
-gnome_db_goo_table_new (GooCanvasItem *parent, GdaMetaTable *table,
+gnome_db_canvas_table_new (GooCanvasItem *parent, GdaMetaTable *table,
gdouble x, gdouble y, ...)
{
GooCanvasItem *item;
const char *first_property;
va_list var_args;
- item = g_object_new (GNOME_DB_TYPE_GOO_TABLE, NULL);
+ item = g_object_new (GNOME_DB_TYPE_CANVAS_TABLE, NULL);
if (parent) {
goo_canvas_item_add_child (parent, item, -1);
Copied: trunk/libgnomedb-graph/gnome-db-canvas-table.h (from r1721, /trunk/libgnomedb-graph/gnome-db-goo-table.h)
==============================================================================
--- /trunk/libgnomedb-graph/gnome-db-goo-table.h (original)
+++ trunk/libgnomedb-graph/gnome-db-canvas-table.h Wed Apr 30 20:19:18 2008
@@ -1,4 +1,4 @@
-/* gnome-db-goo-table.h
+/* gnome-db-canvas-table.h
*
* Copyright (C) 2007 - 2008 Vivien Malerba
*
@@ -18,48 +18,48 @@
* USA
*/
-#ifndef __GNOME_DB_GOO_TABLE__
-#define __GNOME_DB_GOO_TABLE__
+#ifndef __GNOME_DB_CANVAS_TABLE__
+#define __GNOME_DB_CANVAS_TABLE__
-#include "gnome-db-goo-item.h"
-#include <libgnomedb-graph/gnome-db-goo-decl.h>
+#include "gnome-db-canvas-item.h"
+#include <libgnomedb-graph/gnome-db-canvas-decl.h>
#include <libgda/gda-meta-struct.h>
G_BEGIN_DECLS
/*
*
- * "Drag item" GooCanvas item: a GnomeDbGooItem item which is used to represent
+ * "Drag item" GooCanvas item: a GnomeDbCanvasItem item which is used to represent
* an element being dragged, and destroys itself when the mouse button is released
*
*/
-#define GNOME_DB_TYPE_GOO_TABLE (gnome_db_goo_table_get_type())
-#define GNOME_DB_GOO_TABLE(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, gnome_db_goo_table_get_type(), GnomeDbGooTable)
-#define GNOME_DB_GOO_TABLE_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, gnome_db_goo_table_get_type (), GnomeDbGooTableClass)
-#define GNOME_DB_IS_GOO_TABLE(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, gnome_db_goo_table_get_type ())
+#define GNOME_DB_TYPE_CANVAS_TABLE (gnome_db_canvas_table_get_type())
+#define GNOME_DB_CANVAS_TABLE(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, gnome_db_canvas_table_get_type(), GnomeDbCanvasTable)
+#define GNOME_DB_CANVAS_TABLE_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, gnome_db_canvas_table_get_type (), GnomeDbCanvasTableClass)
+#define GNOME_DB_IS_CANVAS_TABLE(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, gnome_db_canvas_table_get_type ())
/* struct for the object's data */
-struct _GnomeDbGooTable
+struct _GnomeDbCanvasTable
{
- GnomeDbGooItem object;
+ GnomeDbCanvasItem object;
- GnomeDbGooTablePrivate *priv;
+ GnomeDbCanvasTablePrivate *priv;
};
/* struct for the object's class */
-struct _GnomeDbGooTableClass
+struct _GnomeDbCanvasTableClass
{
- GnomeDbGooItemClass parent_class;
+ GnomeDbCanvasItemClass parent_class;
};
/* generic widget's functions */
-GType gnome_db_goo_table_get_type (void) G_GNUC_CONST;
-GooCanvasItem *gnome_db_goo_table_new (GooCanvasItem *parent, GdaMetaTable *table,
+GType gnome_db_canvas_table_get_type (void) G_GNUC_CONST;
+GooCanvasItem *gnome_db_canvas_table_new (GooCanvasItem *parent, GdaMetaTable *table,
gdouble x, gdouble y, ...);
-GnomeDbGooColumn *gnome_db_goo_table_get_column_item (GnomeDbGooTable *ce, GdaMetaTableColumn *column);
-gdouble gnome_db_goo_table_get_column_ypos (GnomeDbGooTable *ce, GdaMetaTableColumn *column);
+GnomeDbCanvasColumn *gnome_db_canvas_table_get_column_item (GnomeDbCanvasTable *ce, GdaMetaTableColumn *column);
+gdouble gnome_db_canvas_table_get_column_ypos (GnomeDbCanvasTable *ce, GdaMetaTableColumn *column);
G_END_DECLS
Copied: trunk/libgnomedb-graph/gnome-db-canvas-text.c (from r1721, /trunk/libgnomedb-graph/gnome-db-goo-text.c)
==============================================================================
--- /trunk/libgnomedb-graph/gnome-db-goo-text.c (original)
+++ trunk/libgnomedb-graph/gnome-db-canvas-text.c Wed Apr 30 20:19:18 2008
@@ -1,4 +1,4 @@
-/* gnome-db-goo-text.c
+/* gnome-db-canvas-text.c
*
* Copyright (C) 2002 - 2007 Vivien Malerba
*
@@ -19,25 +19,25 @@
*/
#include <libgda/libgda.h>
-#include "gnome-db-goo.h"
-#include "gnome-db-goo-text.h"
+#include "gnome-db-canvas.h"
+#include "gnome-db-canvas-text.h"
-static void gnome_db_goo_text_class_init (GnomeDbGooTextClass * class);
-static void gnome_db_goo_text_init (GnomeDbGooText * drag);
-static void gnome_db_goo_text_dispose (GObject * object);
-static void gnome_db_goo_text_finalize (GObject * object);
+static void gnome_db_canvas_text_class_init (GnomeDbCanvasTextClass * class);
+static void gnome_db_canvas_text_init (GnomeDbCanvasText * drag);
+static void gnome_db_canvas_text_dispose (GObject * object);
+static void gnome_db_canvas_text_finalize (GObject * object);
-static void gnome_db_goo_text_set_property (GObject *object,
+static void gnome_db_canvas_text_set_property (GObject *object,
guint param_id,
const GValue *value,
GParamSpec *pspec);
-static void gnome_db_goo_text_get_property (GObject *object,
+static void gnome_db_canvas_text_get_property (GObject *object,
guint param_id,
GValue *value,
GParamSpec *pspec);
-static gboolean enter_notify_cb (GooCanvasItem *item, GooCanvasItem *target_item, GdkEventCrossing *event, GnomeDbGooText *ct);
-static gboolean leave_notify_cb (GooCanvasItem *item, GooCanvasItem *target_item, GdkEventCrossing *event, GnomeDbGooText *ct);
+static gboolean enter_notify_cb (GooCanvasItem *item, GooCanvasItem *target_item, GdkEventCrossing *event, GnomeDbCanvasText *ct);
+static gboolean leave_notify_cb (GooCanvasItem *item, GooCanvasItem *target_item, GdkEventCrossing *event, GnomeDbCanvasText *ct);
enum
{
@@ -50,7 +50,7 @@
PROP_BOLD
};
-struct _GnomeDbGooTextPrivate
+struct _GnomeDbCanvasTextPrivate
{
gchar *text;
@@ -74,42 +74,42 @@
static GObjectClass *text_parent_class = NULL;
GType
-gnome_db_goo_text_get_type (void)
+gnome_db_canvas_text_get_type (void)
{
static GType type = 0;
if (G_UNLIKELY (type == 0)) {
static const GTypeInfo info = {
- sizeof (GnomeDbGooTextClass),
+ sizeof (GnomeDbCanvasTextClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
- (GClassInitFunc) gnome_db_goo_text_class_init,
+ (GClassInitFunc) gnome_db_canvas_text_class_init,
NULL,
NULL,
- sizeof (GnomeDbGooText),
+ sizeof (GnomeDbCanvasText),
0,
- (GInstanceInitFunc) gnome_db_goo_text_init
+ (GInstanceInitFunc) gnome_db_canvas_text_init
};
- type = g_type_register_static (GNOME_DB_TYPE_GOO_ITEM, "GnomeDbGooText", &info, 0);
+ type = g_type_register_static (GNOME_DB_TYPE_CANVAS_ITEM, "GnomeDbCanvasText", &info, 0);
}
return type;
}
static void
-gnome_db_goo_text_class_init (GnomeDbGooTextClass * class)
+gnome_db_canvas_text_class_init (GnomeDbCanvasTextClass * class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
text_parent_class = g_type_class_peek_parent (class);
- object_class->dispose = gnome_db_goo_text_dispose;
- object_class->finalize = gnome_db_goo_text_finalize;
+ object_class->dispose = gnome_db_canvas_text_dispose;
+ object_class->finalize = gnome_db_canvas_text_finalize;
/* Properties */
- object_class->set_property = gnome_db_goo_text_set_property;
- object_class->get_property = gnome_db_goo_text_get_property;
+ object_class->set_property = gnome_db_canvas_text_set_property;
+ object_class->get_property = gnome_db_canvas_text_get_property;
g_object_class_install_property
(object_class, PROP_WIDTH,
@@ -137,11 +137,11 @@
}
static void
-gnome_db_goo_text_init (GnomeDbGooText *text)
+gnome_db_canvas_text_init (GnomeDbCanvasText *text)
{
- text->priv = g_new0 (GnomeDbGooTextPrivate, 1);
+ text->priv = g_new0 (GnomeDbCanvasTextPrivate, 1);
text->priv->text = NULL;
- text->priv->highlight_color = g_strdup (GNOME_DB_GOO_ENTITY_COLOR);
+ text->priv->highlight_color = g_strdup (GNOME_DB_CANVAS_ENTITY_COLOR);
g_signal_connect (G_OBJECT (text), "enter-notify-event",
G_CALLBACK (enter_notify_cb), text);
@@ -150,13 +150,13 @@
}
static void
-gnome_db_goo_text_dispose (GObject *object)
+gnome_db_canvas_text_dispose (GObject *object)
{
- GnomeDbGooText *ct;
+ GnomeDbCanvasText *ct;
g_return_if_fail (object != NULL);
- g_return_if_fail (GNOME_DB_IS_GOO_TEXT (object));
+ g_return_if_fail (GNOME_DB_IS_CANVAS_TEXT (object));
- ct = GNOME_DB_GOO_TEXT (object);
+ ct = GNOME_DB_CANVAS_TEXT (object);
/* animation */
if (ct->priv->anim_id) {
@@ -170,13 +170,13 @@
static void
-gnome_db_goo_text_finalize (GObject *object)
+gnome_db_canvas_text_finalize (GObject *object)
{
- GnomeDbGooText *ct;
+ GnomeDbCanvasText *ct;
g_return_if_fail (object != NULL);
- g_return_if_fail (GNOME_DB_IS_GOO_TEXT (object));
+ g_return_if_fail (GNOME_DB_IS_CANVAS_TEXT (object));
- ct = GNOME_DB_GOO_TEXT (object);
+ ct = GNOME_DB_CANVAS_TEXT (object);
if (ct->priv) {
g_free (ct->priv->text);
@@ -191,11 +191,11 @@
text_parent_class->finalize (object);
}
-static void clean_items (GnomeDbGooText *ct);
-static void create_items (GnomeDbGooText *ct);
+static void clean_items (GnomeDbCanvasText *ct);
+static void create_items (GnomeDbCanvasText *ct);
static void
-adjust_text_pango_attributes (GnomeDbGooText *ct)
+adjust_text_pango_attributes (GnomeDbCanvasText *ct)
{
if (! ct->priv->text_item)
return;
@@ -222,18 +222,18 @@
}
static void
-gnome_db_goo_text_set_property (GObject *object,
+gnome_db_canvas_text_set_property (GObject *object,
guint param_id,
const GValue *value,
GParamSpec *pspec)
{
- GnomeDbGooText *ct = NULL;
+ GnomeDbCanvasText *ct = NULL;
const gchar *cstr = NULL;
gchar *str;
gdouble size = 0;
gboolean bool = FALSE;
- ct = GNOME_DB_GOO_TEXT (object);
+ ct = GNOME_DB_CANVAS_TEXT (object);
switch (param_id) {
case PROP_TEXT:
@@ -266,7 +266,7 @@
if (cstr)
ct->priv->highlight_color = g_strdup (cstr);
else
- ct->priv->highlight_color = g_strdup (GNOME_DB_GOO_ENTITY_COLOR);
+ ct->priv->highlight_color = g_strdup (GNOME_DB_CANVAS_ENTITY_COLOR);
break;
case PROP_UNDERLINE:
bool = g_value_get_boolean (value);
@@ -294,14 +294,14 @@
}
static void
-gnome_db_goo_text_get_property (GObject *object,
+gnome_db_canvas_text_get_property (GObject *object,
guint param_id,
GValue *value,
GParamSpec *pspec)
{
- GnomeDbGooText *ct;
+ GnomeDbCanvasText *ct;
- ct = GNOME_DB_GOO_TEXT (object);
+ ct = GNOME_DB_CANVAS_TEXT (object);
switch (param_id) {
default:
@@ -314,7 +314,7 @@
* destroy any existing GooCanvasItem obejcts
*/
static void
-clean_items (GnomeDbGooText *ct)
+clean_items (GnomeDbCanvasText *ct)
{
if (ct->priv->bg_item) {
goo_canvas_item_remove (GOO_CANVAS_ITEM (ct->priv->bg_item));
@@ -330,7 +330,7 @@
* create new GooCanvasItem objects
*/
static void
-create_items (GnomeDbGooText *ct)
+create_items (GnomeDbCanvasText *ct)
{
GooCanvasItem *item, *text;
GooCanvasBounds bounds;
@@ -370,16 +370,16 @@
}
static gboolean
-enter_notify_cb (GooCanvasItem *item, GooCanvasItem *target_item, GdkEventCrossing *event, GnomeDbGooText *ct)
+enter_notify_cb (GooCanvasItem *item, GooCanvasItem *target_item, GdkEventCrossing *event, GnomeDbCanvasText *ct)
{
- gnome_db_goo_text_set_highlight (ct, TRUE);
+ gnome_db_canvas_text_set_highlight (ct, TRUE);
return FALSE;
}
static gboolean
-leave_notify_cb (GooCanvasItem *item, GooCanvasItem *target_item, GdkEventCrossing *event, GnomeDbGooText *ct)
+leave_notify_cb (GooCanvasItem *item, GooCanvasItem *target_item, GdkEventCrossing *event, GnomeDbCanvasText *ct)
{
- gnome_db_goo_text_set_highlight (ct, FALSE);
+ gnome_db_canvas_text_set_highlight (ct, FALSE);
return FALSE;
}
@@ -396,7 +396,7 @@
}
static gboolean
-anim_cb (GnomeDbGooText *ct)
+anim_cb (GnomeDbCanvasText *ct)
{
guint current, end, value;
guint rgba = 0;
@@ -437,19 +437,19 @@
}
/**
- * gnome_db_goo_text_set_highlight
- * @ct: a #GnomeDbGooText object
+ * gnome_db_canvas_text_set_highlight
+ * @ct: a #GnomeDbCanvasText object
* @highlight:
*
* Turns ON or OFF the highlighting of @ct
*/
void
-gnome_db_goo_text_set_highlight (GnomeDbGooText *ct, gboolean highlight)
+gnome_db_canvas_text_set_highlight (GnomeDbCanvasText *ct, gboolean highlight)
{
gchar *str_color;
GdkColor gdk_color;
- g_return_if_fail (ct && GNOME_DB_IS_GOO_TEXT (ct));
+ g_return_if_fail (ct && GNOME_DB_IS_CANVAS_TEXT (ct));
g_return_if_fail (ct->priv);
if (! ct->priv->bg_item)
@@ -485,7 +485,7 @@
}
/**
- * gnome_db_goo_text_new
+ * gnome_db_canvas_text_new
* @parent: the parent item, or NULL.
* @txt: text to display
* @x: the x coordinate of the text.
@@ -497,7 +497,7 @@
* Returns: a new #GooCanvasItem object
*/
GooCanvasItem *
-gnome_db_goo_text_new (GooCanvasItem *parent,
+gnome_db_canvas_text_new (GooCanvasItem *parent,
const gchar *txt,
gdouble x,
gdouble y,
@@ -507,7 +507,7 @@
const char *first_property;
va_list var_args;
- item = g_object_new (GNOME_DB_TYPE_GOO_TEXT, NULL);
+ item = g_object_new (GNOME_DB_TYPE_CANVAS_TEXT, NULL);
if (parent) {
goo_canvas_item_add_child (parent, item, -1);
Copied: trunk/libgnomedb-graph/gnome-db-canvas-text.h (from r1721, /trunk/libgnomedb-graph/gnome-db-goo-text.h)
==============================================================================
--- /trunk/libgnomedb-graph/gnome-db-goo-text.h (original)
+++ trunk/libgnomedb-graph/gnome-db-canvas-text.h Wed Apr 30 20:19:18 2008
@@ -1,4 +1,4 @@
-/* gnome-db-goo-text.h
+/* gnome-db-canvas-text.h
*
* Copyright (C) 2007 Vivien Malerba
*
@@ -18,53 +18,53 @@
* USA
*/
-#ifndef __GNOME_DB_GOO_TEXT__
-#define __GNOME_DB_GOO_TEXT__
+#ifndef __GNOME_DB_CANVAS_TEXT__
+#define __GNOME_DB_CANVAS_TEXT__
-#include "gnome-db-goo-item.h"
+#include "gnome-db-canvas-item.h"
G_BEGIN_DECLS
/*
*
- * "Drag item" GooCanvas item: a GnomeDbGooItem item which is used to represent
+ * "Drag item" GooCanvas item: a GnomeDbCanvasItem item which is used to represent
* an element being dragged, and destroys itself when the mouse button is released
*
*/
-#define GNOME_DB_TYPE_GOO_TEXT (gnome_db_goo_text_get_type())
-#define GNOME_DB_GOO_TEXT(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, gnome_db_goo_text_get_type(), GnomeDbGooText)
-#define GNOME_DB_GOO_TEXT_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, gnome_db_goo_text_get_type (), GnomeDbGooTextClass)
-#define GNOME_DB_IS_GOO_TEXT(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, gnome_db_goo_text_get_type ())
+#define GNOME_DB_TYPE_CANVAS_TEXT (gnome_db_canvas_text_get_type())
+#define GNOME_DB_CANVAS_TEXT(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, gnome_db_canvas_text_get_type(), GnomeDbCanvasText)
+#define GNOME_DB_CANVAS_TEXT_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, gnome_db_canvas_text_get_type (), GnomeDbCanvasTextClass)
+#define GNOME_DB_IS_CANVAS_TEXT(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, gnome_db_canvas_text_get_type ())
-typedef struct _GnomeDbGooText GnomeDbGooText;
-typedef struct _GnomeDbGooTextClass GnomeDbGooTextClass;
-typedef struct _GnomeDbGooTextPrivate GnomeDbGooTextPrivate;
+typedef struct _GnomeDbCanvasText GnomeDbCanvasText;
+typedef struct _GnomeDbCanvasTextClass GnomeDbCanvasTextClass;
+typedef struct _GnomeDbCanvasTextPrivate GnomeDbCanvasTextPrivate;
/* struct for the object's data */
-struct _GnomeDbGooText
+struct _GnomeDbCanvasText
{
- GnomeDbGooItem object;
+ GnomeDbCanvasItem object;
- GnomeDbGooTextPrivate *priv;
+ GnomeDbCanvasTextPrivate *priv;
};
/* struct for the object's class */
-struct _GnomeDbGooTextClass
+struct _GnomeDbCanvasTextClass
{
- GnomeDbGooItemClass parent_class;
+ GnomeDbCanvasItemClass parent_class;
};
/* generic widget's functions */
-GType gnome_db_goo_text_get_type (void) G_GNUC_CONST;
-GooCanvasItem* gnome_db_goo_text_new (GooCanvasItem *parent,
+GType gnome_db_canvas_text_get_type (void) G_GNUC_CONST;
+GooCanvasItem* gnome_db_canvas_text_new (GooCanvasItem *parent,
const gchar *txt,
gdouble x,
gdouble y,
...);
-void gnome_db_goo_text_set_highlight (GnomeDbGooText *ct, gboolean highlight);
+void gnome_db_canvas_text_set_highlight (GnomeDbCanvasText *ct, gboolean highlight);
G_END_DECLS
Copied: trunk/libgnomedb-graph/gnome-db-canvas-tip.c (from r1721, /trunk/libgnomedb-graph/gnome-db-goo-tip.c)
==============================================================================
--- /trunk/libgnomedb-graph/gnome-db-goo-tip.c (original)
+++ trunk/libgnomedb-graph/gnome-db-canvas-tip.c Wed Apr 30 20:19:18 2008
@@ -1,4 +1,4 @@
-/* gnome-db-goo-tip.c
+/* gnome-db-canvas-tip.c
*
* Copyright (C) 2002 - 2004 Vivien Malerba
*
@@ -19,26 +19,26 @@
*/
#include "gnome-db-decl.h"
-#include "gnome-db-goo-tip.h"
+#include "gnome-db-canvas-tip.h"
#include <libgnomedb/marshal.h>
#include <libgda/gda-debug-macros.h>
-static void gnome_db_goo_tip_class_init (GnomeDbGooTipClass * class);
-static void gnome_db_goo_tip_init (GnomeDbGooTip * tip);
-static void gnome_db_goo_tip_finalize (GObject * object);
+static void gnome_db_canvas_tip_class_init (GnomeDbCanvasTipClass * class);
+static void gnome_db_canvas_tip_init (GnomeDbCanvasTip * tip);
+static void gnome_db_canvas_tip_finalize (GObject * object);
-static void gnome_db_goo_tip_set_property (GObject *object,
+static void gnome_db_canvas_tip_set_property (GObject *object,
guint param_id,
const GValue *value,
GParamSpec *pspec);
-static void gnome_db_goo_tip_get_property (GObject *object,
+static void gnome_db_canvas_tip_get_property (GObject *object,
guint param_id,
GValue *value,
GParamSpec *pspec);
-static void gnome_db_goo_tip_post_init (GnomeDbGooTip * tip);
+static void gnome_db_canvas_tip_post_init (GnomeDbCanvasTip * tip);
-struct _GnomeDbGooTipPrivate
+struct _GnomeDbCanvasTipPrivate
{
gchar *text;
@@ -59,41 +59,41 @@
GType
-gnome_db_goo_tip_get_type (void)
+gnome_db_canvas_tip_get_type (void)
{
static GType type = 0;
if (G_UNLIKELY (type == 0)) {
static const GTypeInfo info = {
- sizeof (GnomeDbGooTipClass),
+ sizeof (GnomeDbCanvasTipClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
- (GClassInitFunc) gnome_db_goo_tip_class_init,
+ (GClassInitFunc) gnome_db_canvas_tip_class_init,
NULL,
NULL,
- sizeof (GnomeDbGooTip),
+ sizeof (GnomeDbCanvasTip),
0,
- (GInstanceInitFunc) gnome_db_goo_tip_init
+ (GInstanceInitFunc) gnome_db_canvas_tip_init
};
- type = g_type_register_static (GOO_TYPE_CANVAS_GROUP, "GnomeDbGooTip", &info, 0);
+ type = g_type_register_static (GOO_TYPE_CANVAS_GROUP, "GnomeDbCanvasTip", &info, 0);
}
return type;
}
static void
-gnome_db_goo_tip_class_init (GnomeDbGooTipClass * class)
+gnome_db_canvas_tip_class_init (GnomeDbCanvasTipClass * class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
tip_parent_class = g_type_class_peek_parent (class);
- object_class->finalize = gnome_db_goo_tip_finalize;
+ object_class->finalize = gnome_db_canvas_tip_finalize;
/* Properties */
- object_class->set_property = gnome_db_goo_tip_set_property;
- object_class->get_property = gnome_db_goo_tip_get_property;
+ object_class->set_property = gnome_db_canvas_tip_set_property;
+ object_class->get_property = gnome_db_canvas_tip_get_property;
g_object_class_install_property (object_class, PROP_TEXT,
g_param_spec_string ("tip_text", NULL, NULL, NULL,
@@ -101,9 +101,9 @@
}
static void
-gnome_db_goo_tip_init (GnomeDbGooTip * tip)
+gnome_db_canvas_tip_init (GnomeDbCanvasTip * tip)
{
- tip->priv = g_new0 (GnomeDbGooTipPrivate, 1);
+ tip->priv = g_new0 (GnomeDbCanvasTipPrivate, 1);
tip->priv->text = NULL;
tip->priv->x_text_space = 3.;
tip->priv->y_text_space = 3.;
@@ -111,13 +111,13 @@
static void
-gnome_db_goo_tip_finalize (GObject * object)
+gnome_db_canvas_tip_finalize (GObject * object)
{
- GnomeDbGooTip *tip;
+ GnomeDbCanvasTip *tip;
g_return_if_fail (object != NULL);
- g_return_if_fail (GNOME_DB_IS_GOO_TIP (object));
+ g_return_if_fail (GNOME_DB_IS_CANVAS_TIP (object));
- tip = GNOME_DB_GOO_TIP (object);
+ tip = GNOME_DB_CANVAS_TIP (object);
if (tip->priv) {
if (tip->priv->text)
g_free (tip->priv->text);
@@ -130,15 +130,15 @@
}
static void
-gnome_db_goo_tip_set_property (GObject *object,
+gnome_db_canvas_tip_set_property (GObject *object,
guint param_id,
const GValue *value,
GParamSpec *pspec)
{
- GnomeDbGooTip *tip;
+ GnomeDbCanvasTip *tip;
const gchar *str;
- tip = GNOME_DB_GOO_TIP (object);
+ tip = GNOME_DB_CANVAS_TIP (object);
switch (param_id) {
case PROP_TEXT:
@@ -153,11 +153,11 @@
}
if (tip->priv->text)
- gnome_db_goo_tip_post_init (tip);
+ gnome_db_canvas_tip_post_init (tip);
}
static void
-gnome_db_goo_tip_get_property (GObject *object,
+gnome_db_canvas_tip_get_property (GObject *object,
guint param_id,
GValue *value,
GParamSpec *pspec)
@@ -167,7 +167,7 @@
static void
-gnome_db_goo_tip_post_init (GnomeDbGooTip * tip)
+gnome_db_canvas_tip_post_init (GnomeDbCanvasTip * tip)
{
GooCanvasItem *text, *bg;
GooCanvasBounds bounds;
@@ -194,7 +194,7 @@
}
/**
- * gnome_db_goo_tip_new
+ * gnome_db_canvas_tip_new
* @parent: the parent item, or NULL.
* @txt: text to display in the tooltip
* @x: the x coordinate of the text.
@@ -206,13 +206,13 @@
* Returns: a new #GooCanvasItem object
*/
GooCanvasItem *
-gnome_db_goo_tip_new (GooCanvasItem *parent, const gchar *txt, gdouble x, gdouble y, ...)
+gnome_db_canvas_tip_new (GooCanvasItem *parent, const gchar *txt, gdouble x, gdouble y, ...)
{
GooCanvasItem *item;
const char *first_property;
va_list var_args;
- item = g_object_new (GNOME_DB_TYPE_GOO_TIP, NULL);
+ item = g_object_new (GNOME_DB_TYPE_CANVAS_TIP, NULL);
if (parent) {
goo_canvas_item_add_child (parent, item, -1);
Copied: trunk/libgnomedb-graph/gnome-db-canvas-tip.h (from r1721, /trunk/libgnomedb-graph/gnome-db-goo-tip.h)
==============================================================================
--- /trunk/libgnomedb-graph/gnome-db-goo-tip.h (original)
+++ trunk/libgnomedb-graph/gnome-db-canvas-tip.h Wed Apr 30 20:19:18 2008
@@ -1,4 +1,4 @@
-/* gnome-db-goo-tip.h
+/* gnome-db-canvas-tip.h
*
* Copyright (C) 2007 Vivien Malerba
*
@@ -18,8 +18,8 @@
* USA
*/
-#ifndef __GNOME_DB_GOO_TIP__
-#define __GNOME_DB_GOO_TIP__
+#ifndef __GNOME_DB_CANVAS_TIP__
+#define __GNOME_DB_CANVAS_TIP__
#include <goocanvas.h>
@@ -33,33 +33,33 @@
*
*/
-#define GNOME_DB_TYPE_GOO_TIP (gnome_db_goo_tip_get_type())
-#define GNOME_DB_GOO_TIP(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, gnome_db_goo_tip_get_type(), GnomeDbGooTip)
-#define GNOME_DB_GOO_TIP_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, gnome_db_goo_tip_get_type (), GnomeDbGooTipClass)
-#define GNOME_DB_IS_GOO_TIP(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, gnome_db_goo_tip_get_type ())
+#define GNOME_DB_TYPE_CANVAS_TIP (gnome_db_canvas_tip_get_type())
+#define GNOME_DB_CANVAS_TIP(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, gnome_db_canvas_tip_get_type(), GnomeDbCanvasTip)
+#define GNOME_DB_CANVAS_TIP_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, gnome_db_canvas_tip_get_type (), GnomeDbCanvasTipClass)
+#define GNOME_DB_IS_CANVAS_TIP(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, gnome_db_canvas_tip_get_type ())
-typedef struct _GnomeDbGooTip GnomeDbGooTip;
-typedef struct _GnomeDbGooTipClass GnomeDbGooTipClass;
-typedef struct _GnomeDbGooTipPrivate GnomeDbGooTipPrivate;
+typedef struct _GnomeDbCanvasTip GnomeDbCanvasTip;
+typedef struct _GnomeDbCanvasTipClass GnomeDbCanvasTipClass;
+typedef struct _GnomeDbCanvasTipPrivate GnomeDbCanvasTipPrivate;
/* struct for the object's data */
-struct _GnomeDbGooTip
+struct _GnomeDbCanvasTip
{
GooCanvasGroup object;
- GnomeDbGooTipPrivate *priv;
+ GnomeDbCanvasTipPrivate *priv;
};
/* struct for the object's class */
-struct _GnomeDbGooTipClass
+struct _GnomeDbCanvasTipClass
{
GooCanvasGroupClass parent_class;
};
-GType gnome_db_goo_tip_get_type (void) G_GNUC_CONST;
-GooCanvasItem *gnome_db_goo_tip_new (GooCanvasItem *parent, const gchar *txt, gdouble x, gdouble y, ...);
+GType gnome_db_canvas_tip_get_type (void) G_GNUC_CONST;
+GooCanvasItem *gnome_db_canvas_tip_new (GooCanvasItem *parent, const gchar *txt, gdouble x, gdouble y, ...);
G_END_DECLS
Copied: trunk/libgnomedb-graph/gnome-db-canvas-utility.c (from r1721, /trunk/libgnomedb-graph/gnome-db-goo-utility.c)
==============================================================================
--- /trunk/libgnomedb-graph/gnome-db-goo-utility.c (original)
+++ trunk/libgnomedb-graph/gnome-db-canvas-utility.c Wed Apr 30 20:19:18 2008
@@ -17,7 +17,7 @@
* Boston, MA 02111-1307, USA.
*/
-#include "gnome-db-goo-utility.h"
+#include "gnome-db-canvas-utility.h"
#include <math.h>
#include <string.h>
@@ -30,11 +30,11 @@
static void compute_text_marks_offsets (gdouble x1, gdouble y1, gdouble x2, gdouble y2,
gdouble *xoff, gdouble *yoff, GtkAnchorType *anchor_type);
-static GSList *gnome_db_goo_util_compute_handle_shapes (GooCanvasItem *parent, GSList *shapes, gint index,
+static GSList *gnome_db_canvas_util_compute_handle_shapes (GooCanvasItem *parent, GSList *shapes, gint index,
gdouble x1, gdouble y1, gdouble x2, gdouble y2);
-static GSList *gnome_db_goo_canvas_shape_add_to_list (GSList *list, gchar *swallow_id, GooCanvasItem *item);
-static GnomeDbGooCanvasShape *gnome_db_goo_canvas_shape_find (GSList *list, const gchar *id);
+static GSList *gnome_db_canvas_canvas_shape_add_to_list (GSList *list, gchar *swallow_id, GooCanvasItem *item);
+static GnomeDbCanvasCanvasShape *gnome_db_canvas_canvas_shape_find (GSList *list, const gchar *id);
/*
@@ -44,11 +44,11 @@
* if @shapes is not NULL, then the shapes in the list are reused, and the ones which don't need
* to exist anymore are removed
*
- * Returns a list of GnomeDbGooCanvasShapes structures
+ * Returns a list of GnomeDbCanvasCanvasShapes structures
*/
GSList *
-gnome_db_goo_util_compute_anchor_shapes (GooCanvasItem *parent, GSList *shapes,
- GnomeDbGooTable *fk_ent, GnomeDbGooTable *ref_pk_ent,
+gnome_db_canvas_util_compute_anchor_shapes (GooCanvasItem *parent, GSList *shapes,
+ GnomeDbCanvasTable *fk_ent, GnomeDbCanvasTable *ref_pk_ent,
guint nb_anchors, guint ext, gboolean with_handle)
{
GSList *retval = shapes;
@@ -56,7 +56,7 @@
gdouble fx1, fy1, fx2, fy2; /* FK entity item (bounds) */
gdouble rx1, ry1, rx2, ry2; /* REF PK entity item (bounds) */
- GnomeDbGooCanvasShape *shape;
+ GnomeDbCanvasCanvasShape *shape;
gchar *id;
gdouble rcx, rcy; /* center of ref_pk entity item */
@@ -143,7 +143,7 @@
}
id = g_strdup_printf ("a%d", i);
- shape = gnome_db_goo_canvas_shape_find (retval, id);
+ shape = gnome_db_canvas_canvas_shape_find (retval, id);
if (shape) {
g_object_set (shape->item, "points", points, NULL);
shape->_used = TRUE;
@@ -155,14 +155,14 @@
points->coords[2], points->coords [3],
"close-path", FALSE,
"points", points, NULL);
- retval = gnome_db_goo_canvas_shape_add_to_list (retval, id, item);
+ retval = gnome_db_canvas_canvas_shape_add_to_list (retval, id, item);
}
goo_canvas_points_unref (ap);
/* extension marks as text */
if (ext & CANVAS_SHAPE_EXT_JOIN_OUTER_1) {
id = g_strdup_printf ("a%de1", i);
- shape = gnome_db_goo_canvas_shape_find (retval, id);
+ shape = gnome_db_canvas_canvas_shape_find (retval, id);
if (shape) {
g_object_set (shape->item,
"x", points->coords[2] + 5.,
@@ -175,7 +175,7 @@
points->coords[2] + 5.,
points->coords[3] - 5., -1,
GTK_ANCHOR_SOUTH, NULL);
- retval = gnome_db_goo_canvas_shape_add_to_list (retval, id, item);
+ retval = gnome_db_canvas_canvas_shape_add_to_list (retval, id, item);
}
}
@@ -193,13 +193,13 @@
points->coords[4] + 5.,
points->coords[5] + 5., -1,
GTK_ANCHOR_NORTH, NULL);
- retval = gnome_db_goo_canvas_shape_add_to_list (retval, id, item);
+ retval = gnome_db_canvas_canvas_shape_add_to_list (retval, id, item);
}
}
/* handle in the middle */
if (with_handle)
- retval = gnome_db_goo_util_compute_handle_shapes (parent, retval, i,
+ retval = gnome_db_canvas_util_compute_handle_shapes (parent, retval, i,
points->coords[2],
points->coords[3],
points->coords[4],
@@ -278,7 +278,7 @@
}
id = g_strdup_printf ("a%d", i);
- shape = gnome_db_goo_canvas_shape_find (retval, id);
+ shape = gnome_db_canvas_canvas_shape_find (retval, id);
if (shape) {
g_object_set (shape->item, "points", points, NULL);
shape->_used = TRUE;
@@ -290,7 +290,7 @@
points->coords[2], points->coords [3],
"close-path", FALSE,
"points", points, NULL);
- retval = gnome_db_goo_canvas_shape_add_to_list (retval, id, item);
+ retval = gnome_db_canvas_canvas_shape_add_to_list (retval, id, item);
}
goo_canvas_points_unref (ap);
@@ -303,7 +303,7 @@
points->coords[2], points->coords[3],
&mxoff, &myoff, &atype);
id = g_strdup_printf ("a%de1", i);
- shape = gnome_db_goo_canvas_shape_find (retval, id);
+ shape = gnome_db_canvas_canvas_shape_find (retval, id);
if (shape) {
g_object_set (shape->item,
"x", points->coords[2] + mxoff,
@@ -317,7 +317,7 @@
points->coords[2] + mxoff,
points->coords[3] + myoff, -1,
atype, NULL);
- retval = gnome_db_goo_canvas_shape_add_to_list (retval, id, item);
+ retval = gnome_db_canvas_canvas_shape_add_to_list (retval, id, item);
}
}
@@ -343,13 +343,13 @@
points->coords[0] + mxoff,
points->coords[1] + myoff, -1,
atype, NULL);
- retval = gnome_db_goo_canvas_shape_add_to_list (retval, id, item);
+ retval = gnome_db_canvas_canvas_shape_add_to_list (retval, id, item);
}
}
/* handle in the middle */
if (with_handle)
- retval = gnome_db_goo_util_compute_handle_shapes (parent, retval, i,
+ retval = gnome_db_canvas_util_compute_handle_shapes (parent, retval, i,
points->coords[0],
points->coords[1],
points->coords[2],
@@ -527,12 +527,12 @@
* if @shapes is not NULL, then the shapes in the list are reused, and the ones which don't need
* to exist anymore are removed
*
- * Returns a list of GnomeDbGooCanvasShapes structures
+ * Returns a list of GnomeDbCanvasCanvasShapes structures
*/
GSList *
-gnome_db_goo_util_compute_connect_shapes (GooCanvasItem *parent, GSList *shapes,
- GnomeDbGooTable *ent1, GdaMetaTableColumn *field1,
- GnomeDbGooTable *ent2, GdaMetaTableColumn *field2,
+gnome_db_canvas_util_compute_connect_shapes (GooCanvasItem *parent, GSList *shapes,
+ GnomeDbCanvasTable *ent1, GdaMetaTableColumn *field1,
+ GnomeDbCanvasTable *ent2, GdaMetaTableColumn *field2,
guint nb_connect, guint ext)
{
GSList *retval = shapes;
@@ -545,11 +545,11 @@
double eps = 0.5;
GooCanvasBounds bounds;
- GnomeDbGooCanvasShape *shape;
+ GnomeDbCanvasCanvasShape *shape;
gchar *id;
if (!field1 || !field2)
- return gnome_db_goo_util_compute_anchor_shapes (parent, shapes, ent1, ent2, 1, ext, FALSE);
+ return gnome_db_canvas_util_compute_anchor_shapes (parent, shapes, ent1, ent2, 1, ext, FALSE);
/* line made of 4 points */
points = goo_canvas_points_new (4);
@@ -592,19 +592,19 @@
}
points->coords[0] = x1;
- points->coords[1] = gnome_db_goo_table_get_column_ypos (ent1, field1) + yt1;
+ points->coords[1] = gnome_db_canvas_table_get_column_ypos (ent1, field1) + yt1;
points->coords[2] = x1 + x1offset;
points->coords[3] = points->coords[1];
points->coords[4] = x2 + x2offset;
- points->coords[5] = gnome_db_goo_table_get_column_ypos (ent2, field2) + yt2;
+ points->coords[5] = gnome_db_canvas_table_get_column_ypos (ent2, field2) + yt2;
points->coords[6] = x2;
points->coords[7] = points->coords[5];
id = g_strdup_printf ("c%d", nb_connect);
- shape = gnome_db_goo_canvas_shape_find (retval, id);
+ shape = gnome_db_canvas_canvas_shape_find (retval, id);
if (shape) {
g_object_set (shape->item, "points", points, NULL);
shape->_used = TRUE;
@@ -616,7 +616,7 @@
points->coords[2], points->coords [3],
"close-path", FALSE,
"points", points, NULL);
- retval = gnome_db_goo_canvas_shape_add_to_list (retval, id, item);
+ retval = gnome_db_canvas_canvas_shape_add_to_list (retval, id, item);
}
/* extension marks as text */
@@ -629,7 +629,7 @@
&mxoff, &myoff, &atype);
id = g_strdup_printf ("ce%d1", nb_connect);
- shape = gnome_db_goo_canvas_shape_find (retval, id);
+ shape = gnome_db_canvas_canvas_shape_find (retval, id);
if (shape) {
g_object_set (shape->item,
"x", points->coords[2] + mxoff,
@@ -643,7 +643,7 @@
points->coords[2] + mxoff,
points->coords[3] + myoff, -1,
atype, NULL);
- retval = gnome_db_goo_canvas_shape_add_to_list (retval, id, item);
+ retval = gnome_db_canvas_canvas_shape_add_to_list (retval, id, item);
}
}
@@ -656,7 +656,7 @@
&mxoff, &myoff, &atype);
id = g_strdup_printf ("ce%d2", nb_connect);
- shape = gnome_db_goo_canvas_shape_find (retval, id);
+ shape = gnome_db_canvas_canvas_shape_find (retval, id);
if (shape) {
g_object_set (shape->item,
"x", points->coords[2] + mxoff,
@@ -670,13 +670,13 @@
points->coords[2] + mxoff,
points->coords[3] + myoff, -1,
atype, NULL);
- retval = gnome_db_goo_canvas_shape_add_to_list (retval, id, item);
+ retval = gnome_db_canvas_canvas_shape_add_to_list (retval, id, item);
}
}
/* handle in the middle */
- /*retval = gnome_db_goo_util_compute_handle_shapes (parent, retval, nb_connect,
+ /*retval = gnome_db_canvas_util_compute_handle_shapes (parent, retval, nb_connect,
points->coords[2], points->coords[3],
points->coords[4], points->coords[5]);*/
goo_canvas_points_unref (points);
@@ -690,7 +690,7 @@
* Warning: the obsolete shapes in @shapes are _not_ removed.
*/
GSList *
-gnome_db_goo_util_compute_handle_shapes (GooCanvasItem *parent, GSList *shapes, gint index,
+gnome_db_canvas_util_compute_handle_shapes (GooCanvasItem *parent, GSList *shapes, gint index,
gdouble x1, gdouble y1, gdouble x2, gdouble y2)
{
/* don't add anything... */
@@ -699,7 +699,7 @@
GSList *retval = shapes;
gdouble x, y, sq = 5.;
GooCanvasItem *item;
- GnomeDbGooCanvasShape *shape;
+ GnomeDbCanvasCanvasShape *shape;
gchar *id;
/* circle in the middle */
@@ -707,7 +707,7 @@
y = (y1 + y2) / 2.;
id = g_strdup_printf ("h%d", index);
- shape = gnome_db_goo_canvas_shape_find (retval, id);
+ shape = gnome_db_canvas_canvas_shape_find (retval, id);
if (shape) {
g_object_set (shape->item,
"center-x", x, "center-y", y,
@@ -720,7 +720,7 @@
"fill-color", "black",
"visibility", GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD,
"visibility-threshold", .9, NULL);
- retval = gnome_db_goo_canvas_shape_add_to_list (retval, id, item);
+ retval = gnome_db_canvas_canvas_shape_add_to_list (retval, id, item);
}
return retval;
@@ -749,9 +749,9 @@
}
static GSList *
-gnome_db_goo_canvas_shape_add_to_list (GSList *list, gchar *swallow_id, GooCanvasItem *item)
+gnome_db_canvas_canvas_shape_add_to_list (GSList *list, gchar *swallow_id, GooCanvasItem *item)
{
- GnomeDbGooCanvasShape *shape = g_new (GnomeDbGooCanvasShape, 1);
+ GnomeDbCanvasCanvasShape *shape = g_new (GnomeDbCanvasCanvasShape, 1);
g_assert (swallow_id);
g_assert (item);
@@ -765,33 +765,33 @@
return g_slist_append (list, shape);
}
-static GnomeDbGooCanvasShape *
-gnome_db_goo_canvas_shape_find (GSList *list, const gchar *id)
+static GnomeDbCanvasCanvasShape *
+gnome_db_canvas_canvas_shape_find (GSList *list, const gchar *id)
{
- GnomeDbGooCanvasShape *shape = NULL;
+ GnomeDbCanvasCanvasShape *shape = NULL;
GSList *l;
for (l = list; l && !shape; l = l->next)
- if (!strcmp (((GnomeDbGooCanvasShape*) l->data)->id, id))
- shape = (GnomeDbGooCanvasShape*) l->data;
+ if (!strcmp (((GnomeDbCanvasCanvasShape*) l->data)->id, id))
+ shape = (GnomeDbCanvasCanvasShape*) l->data;
/*g_print ("Looking for shape %s: %s\n", id, shape ? "Found" : "Not found");*/
return shape;
}
GSList *
-gnome_db_goo_canvas_shapes_remove_obsolete_shapes (GSList *list)
+gnome_db_canvas_canvas_shapes_remove_obsolete_shapes (GSList *list)
{
GSList *l, *ret = list;
for (l = list; l; ) {
- if (((GnomeDbGooCanvasShape*)(l->data))->_used) {
- ((GnomeDbGooCanvasShape*)(l->data))->_used = FALSE;
+ if (((GnomeDbCanvasCanvasShape*)(l->data))->_used) {
+ ((GnomeDbCanvasCanvasShape*)(l->data))->_used = FALSE;
l=l->next;
}
else {
GSList *tmp;
- GnomeDbGooCanvasShape *shape = (GnomeDbGooCanvasShape*) l->data;
+ GnomeDbCanvasCanvasShape *shape = (GnomeDbCanvasCanvasShape*) l->data;
g_free (shape->id);
goo_canvas_item_remove (shape->item);
@@ -807,12 +807,12 @@
}
void
-gnome_db_goo_canvas_shapes_remove_all (GSList *list)
+gnome_db_canvas_canvas_shapes_remove_all (GSList *list)
{
GSList *l;
for (l = list; l; l = l->next) {
- GnomeDbGooCanvasShape *shape = (GnomeDbGooCanvasShape*) l->data;
+ GnomeDbCanvasCanvasShape *shape = (GnomeDbCanvasCanvasShape*) l->data;
g_free (shape->id);
goo_canvas_item_remove (shape->item);
@@ -823,14 +823,14 @@
}
void
-gnome_db_goo_canvas_shapes_dump (GSList *list)
+gnome_db_canvas_canvas_shapes_dump (GSList *list)
{
GSList *l;
g_print ("Canvas shapes...\n");
for (l = list; l; l = l->next)
- g_print ("\tShape %s @%p (%s: %p) %s\n", GNOME_DB_GOO_CANVAS_SHAPE (l->data)->id,
- GNOME_DB_GOO_CANVAS_SHAPE (l->data),
- G_OBJECT_TYPE_NAME (GNOME_DB_GOO_CANVAS_SHAPE (l->data)->item),
- GNOME_DB_GOO_CANVAS_SHAPE (l->data)->item,
- GNOME_DB_GOO_CANVAS_SHAPE (l->data)->_used ? "Used": "Not used");
+ g_print ("\tShape %s @%p (%s: %p) %s\n", GNOME_DB_CANVAS_CANVAS_SHAPE (l->data)->id,
+ GNOME_DB_CANVAS_CANVAS_SHAPE (l->data),
+ G_OBJECT_TYPE_NAME (GNOME_DB_CANVAS_CANVAS_SHAPE (l->data)->item),
+ GNOME_DB_CANVAS_CANVAS_SHAPE (l->data)->item,
+ GNOME_DB_CANVAS_CANVAS_SHAPE (l->data)->_used ? "Used": "Not used");
}
Copied: trunk/libgnomedb-graph/gnome-db-canvas-utility.h (from r1721, /trunk/libgnomedb-graph/gnome-db-goo-utility.h)
==============================================================================
--- /trunk/libgnomedb-graph/gnome-db-goo-utility.h (original)
+++ trunk/libgnomedb-graph/gnome-db-canvas-utility.h Wed Apr 30 20:19:18 2008
@@ -1,4 +1,4 @@
-/* gnome-db-goo-utility.h
+/* gnome-db-canvas-utility.h
* Copyright (C) 2007 Vivien Malerba <malerba gnome-db org>
*
* This library is free software; you can redistribute it and/or
@@ -18,7 +18,7 @@
*/
#include <goocanvas.h>
-#include "gnome-db-goo-table.h"
+#include "gnome-db-canvas-table.h"
G_BEGIN_DECLS
@@ -32,20 +32,20 @@
GooCanvasItem *item;
gboolean _used;
gboolean is_new;
-} GnomeDbGooCanvasShape;
+} GnomeDbCanvasCanvasShape;
-GSList *gnome_db_goo_util_compute_anchor_shapes (GooCanvasItem *parent, GSList *shapes,
- GnomeDbGooTable *fk_ent, GnomeDbGooTable *ref_pk_ent,
+GSList *gnome_db_canvas_util_compute_anchor_shapes (GooCanvasItem *parent, GSList *shapes,
+ GnomeDbCanvasTable *fk_ent, GnomeDbCanvasTable *ref_pk_ent,
guint nb_anchors, guint ext, gboolean with_handle);
-GSList *gnome_db_goo_util_compute_connect_shapes (GooCanvasItem *parent, GSList *shapes,
- GnomeDbGooTable *ent1, GdaMetaTableColumn *field1,
- GnomeDbGooTable *ent2, GdaMetaTableColumn *field2,
+GSList *gnome_db_canvas_util_compute_connect_shapes (GooCanvasItem *parent, GSList *shapes,
+ GnomeDbCanvasTable *ent1, GdaMetaTableColumn *field1,
+ GnomeDbCanvasTable *ent2, GdaMetaTableColumn *field2,
guint nb_connect, guint ext);
-void gnome_db_goo_canvas_shapes_dump (GSList *list);
-void gnome_db_goo_canvas_shapes_remove_all (GSList *list);
-GSList *gnome_db_goo_canvas_shapes_remove_obsolete_shapes (GSList *list);
+void gnome_db_canvas_canvas_shapes_dump (GSList *list);
+void gnome_db_canvas_canvas_shapes_remove_all (GSList *list);
+GSList *gnome_db_canvas_canvas_shapes_remove_obsolete_shapes (GSList *list);
-#define GNOME_DB_GOO_CANVAS_SHAPE(x) ((GnomeDbGooCanvasShape *)(x))
+#define GNOME_DB_CANVAS_CANVAS_SHAPE(x) ((GnomeDbCanvasCanvasShape *)(x))
G_END_DECLS
Copied: trunk/libgnomedb-graph/gnome-db-canvas.c (from r1721, /trunk/libgnomedb-graph/gnome-db-goo.c)
==============================================================================
--- /trunk/libgnomedb-graph/gnome-db-goo.c (original)
+++ trunk/libgnomedb-graph/gnome-db-canvas.c Wed Apr 30 20:19:18 2008
@@ -1,4 +1,4 @@
-/* gnome-db-goo.c
+/* gnome-db-canvas.c
*
* Copyright (C) 2007 - 2008 Vivien Malerba
*
@@ -21,10 +21,10 @@
#include <glib/gi18n-lib.h>
#include <gtk/gtk.h>
#include <libgnomedb/marshal.h>
-#include "gnome-db-goo.h"
-#include "gnome-db-goo-tip.h"
-#include "gnome-db-goo-cursor.h"
-#include "gnome-db-goo-print.h"
+#include "gnome-db-canvas.h"
+#include "gnome-db-canvas-tip.h"
+#include "gnome-db-canvas-cursor.h"
+#include "gnome-db-canvas-print.h"
#include "gnome-db-graph.h"
#include "gnome-db-graph-item.h"
#include <libgda/libgda.h>
@@ -38,17 +38,17 @@
#include <cairo-svg.h>
#include <math.h>
-static void gnome_db_goo_class_init (GnomeDbGooClass * class);
-static void gnome_db_goo_init (GnomeDbGoo * canvas);
-static void gnome_db_goo_dispose (GObject * object);
-static void gnome_db_goo_finalize (GObject * object);
-static void gnome_db_goo_post_init (GnomeDbGoo * canvas);
+static void gnome_db_canvas_class_init (GnomeDbCanvasClass * class);
+static void gnome_db_canvas_init (GnomeDbCanvas * canvas);
+static void gnome_db_canvas_dispose (GObject * object);
+static void gnome_db_canvas_finalize (GObject * object);
+static void gnome_db_canvas_post_init (GnomeDbCanvas * canvas);
-static void gnome_db_goo_set_property (GObject *object,
+static void gnome_db_canvas_set_property (GObject *object,
guint param_id,
const GValue *value,
GParamSpec *pspec);
-static void gnome_db_goo_get_property (GObject *object,
+static void gnome_db_canvas_get_property (GObject *object,
guint param_id,
GValue *value,
GParamSpec *pspec);
@@ -57,10 +57,10 @@
static GObjectClass *parent_class = NULL;
-struct _GnomeDbGooPrivate
+struct _GnomeDbCanvasPrivate
{
GnomeDbGraph *graph;
- GSList *items; /* GnomeDbGooItem objects, non ordered */
+ GSList *items; /* GnomeDbCanvasItem objects, non ordered */
gboolean force_center;
};
@@ -80,30 +80,30 @@
static gint canvas_signals[LAST_SIGNAL] = { 0 };
GType
-gnome_db_goo_get_type (void)
+gnome_db_canvas_get_type (void)
{
static GType type = 0;
if (G_UNLIKELY (type == 0)) {
static const GTypeInfo info = {
- sizeof (GnomeDbGooClass),
+ sizeof (GnomeDbCanvasClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
- (GClassInitFunc) gnome_db_goo_class_init,
+ (GClassInitFunc) gnome_db_canvas_class_init,
NULL,
NULL,
- sizeof (GnomeDbGoo),
+ sizeof (GnomeDbCanvas),
0,
- (GInstanceInitFunc) gnome_db_goo_init
+ (GInstanceInitFunc) gnome_db_canvas_init
};
- type = g_type_register_static (GOO_TYPE_CANVAS, "GnomeDbGoo", &info, 0);
+ type = g_type_register_static (GOO_TYPE_CANVAS, "GnomeDbCanvas", &info, 0);
}
return type;
}
static void
-gnome_db_goo_class_init (GnomeDbGooClass * class)
+gnome_db_canvas_class_init (GnomeDbCanvasClass * class)
{
GtkWidgetClass *widget_class;
GObjectClass *object_class = G_OBJECT_CLASS (class);
@@ -115,7 +115,7 @@
g_signal_new ("drag_action",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (GnomeDbGooClass, drag_action),
+ G_STRUCT_OFFSET (GnomeDbCanvasClass, drag_action),
NULL, NULL,
gnome_db_marshal_VOID__POINTER_POINTER, G_TYPE_NONE, 2,
G_TYPE_POINTER, G_TYPE_POINTER);
@@ -123,8 +123,8 @@
class->drag_action = NULL;
/* properties */
- object_class->set_property = gnome_db_goo_set_property;
- object_class->get_property = gnome_db_goo_get_property;
+ object_class->set_property = gnome_db_canvas_set_property;
+ object_class->get_property = gnome_db_canvas_get_property;
g_object_class_install_property (object_class, PROP_GRAPH,
g_param_spec_object ("graph", NULL, NULL, GNOME_DB_TYPE_GRAPH,
@@ -137,15 +137,15 @@
class->graph_item_dropped = NULL;
class->build_context_menu = NULL;
- object_class->dispose = gnome_db_goo_dispose;
- object_class->finalize = gnome_db_goo_finalize;
+ object_class->dispose = gnome_db_canvas_dispose;
+ object_class->finalize = gnome_db_canvas_finalize;
}
-static int canvas_event (GooCanvas *gcanvas, GdkEvent *event, GnomeDbGoo *canvas);
+static int canvas_event (GooCanvas *gcanvas, GdkEvent *event, GnomeDbCanvas *canvas);
static void
-gnome_db_goo_init (GnomeDbGoo * canvas)
+gnome_db_canvas_init (GnomeDbCanvas * canvas)
{
- canvas->priv = g_new0 (GnomeDbGooPrivate, 1);
+ canvas->priv = g_new0 (GnomeDbCanvasPrivate, 1);
canvas->priv->graph = NULL;
canvas->priv->items = NULL;
canvas->priv->force_center = FALSE;
@@ -161,19 +161,19 @@
"anchor", GTK_ANCHOR_CENTER, NULL);
}
-static void popup_zoom_in_cb (GtkMenuItem *mitem, GnomeDbGoo *canvas);
-static void popup_zoom_out_cb (GtkMenuItem *mitem, GnomeDbGoo *canvas);
-static void popup_zoom_fit_cb (GtkMenuItem *mitem, GnomeDbGoo *canvas);
-static void popup_export_cb (GtkMenuItem *mitem, GnomeDbGoo *canvas);
+static void popup_zoom_in_cb (GtkMenuItem *mitem, GnomeDbCanvas *canvas);
+static void popup_zoom_out_cb (GtkMenuItem *mitem, GnomeDbCanvas *canvas);
+static void popup_zoom_fit_cb (GtkMenuItem *mitem, GnomeDbCanvas *canvas);
+static void popup_export_cb (GtkMenuItem *mitem, GnomeDbCanvas *canvas);
#ifdef HAVE_GTKTWOTEN
-static void popup_print_cb (GtkMenuItem *mitem, GnomeDbGoo *canvas);
+static void popup_print_cb (GtkMenuItem *mitem, GnomeDbCanvas *canvas);
#endif
static int
-canvas_event (GooCanvas *gcanvas, GdkEvent *event, GnomeDbGoo *canvas)
+canvas_event (GooCanvas *gcanvas, GdkEvent *event, GnomeDbCanvas *canvas)
{
gboolean done = TRUE;
GooCanvasItem *item;
- GnomeDbGooClass *class = GNOME_DB_GOO_CLASS (G_OBJECT_GET_CLASS (canvas));
+ GnomeDbCanvasClass *class = GNOME_DB_CANVAS_CLASS (G_OBJECT_GET_CLASS (canvas));
gdouble x, y;
/*
@@ -255,25 +255,25 @@
}
static void
-popup_zoom_in_cb (GtkMenuItem *mitem, GnomeDbGoo *canvas)
+popup_zoom_in_cb (GtkMenuItem *mitem, GnomeDbCanvas *canvas)
{
- gnome_db_goo_set_zoom_factor (canvas, gnome_db_goo_get_zoom_factor (canvas) + .05);
+ gnome_db_canvas_set_zoom_factor (canvas, gnome_db_canvas_get_zoom_factor (canvas) + .05);
}
static void
-popup_zoom_out_cb (GtkMenuItem *mitem, GnomeDbGoo *canvas)
+popup_zoom_out_cb (GtkMenuItem *mitem, GnomeDbCanvas *canvas)
{
- gnome_db_goo_set_zoom_factor (canvas, gnome_db_goo_get_zoom_factor (canvas) - .05);
+ gnome_db_canvas_set_zoom_factor (canvas, gnome_db_canvas_get_zoom_factor (canvas) - .05);
}
static void
-popup_zoom_fit_cb (GtkMenuItem *mitem, GnomeDbGoo *canvas)
+popup_zoom_fit_cb (GtkMenuItem *mitem, GnomeDbCanvas *canvas)
{
- gnome_db_goo_fit_zoom_factor (canvas);
+ gnome_db_canvas_fit_zoom_factor (canvas);
}
static void
-popup_export_cb (GtkMenuItem *mitem, GnomeDbGoo *canvas)
+popup_export_cb (GtkMenuItem *mitem, GnomeDbCanvas *canvas)
{
GtkWidget *dlg;
gint result;
@@ -392,28 +392,28 @@
#ifdef HAVE_GTKTWOTEN
static void
-popup_print_cb (GtkMenuItem *mitem, GnomeDbGoo *canvas)
+popup_print_cb (GtkMenuItem *mitem, GnomeDbCanvas *canvas)
{
- gnome_db_goo_print (canvas);
+ gnome_db_canvas_print (canvas);
}
#endif /* HAVE_GTKTWOTEN */
-static void release_graph (GnomeDbGraph *graph, GnomeDbGoo *canvas);
-static void graph_item_added_cb (GnomeDbGraph *graph, GnomeDbGraphItem *item, GnomeDbGoo *canvas);
-static void graph_item_dropped_cb (GnomeDbGraph *graph, GnomeDbGraphItem *item, GnomeDbGoo *canvas);
-static void item_destroyed_cb (GnomeDbGooItem *item, GnomeDbGoo *canvas);
-static void drag_action_cb (GnomeDbGooItem *citem, GnomeDbGooItem *drag_from,
- GnomeDbGooItem *drag_to, GnomeDbGoo *canvas);
+static void release_graph (GnomeDbGraph *graph, GnomeDbCanvas *canvas);
+static void graph_item_added_cb (GnomeDbGraph *graph, GnomeDbGraphItem *item, GnomeDbCanvas *canvas);
+static void graph_item_dropped_cb (GnomeDbGraph *graph, GnomeDbGraphItem *item, GnomeDbCanvas *canvas);
+static void item_destroyed_cb (GnomeDbCanvasItem *item, GnomeDbCanvas *canvas);
+static void drag_action_cb (GnomeDbCanvasItem *citem, GnomeDbCanvasItem *drag_from,
+ GnomeDbCanvasItem *drag_to, GnomeDbCanvas *canvas);
static void
-gnome_db_goo_dispose (GObject * object)
+gnome_db_canvas_dispose (GObject * object)
{
- GnomeDbGoo *canvas;
+ GnomeDbCanvas *canvas;
g_return_if_fail (object != NULL);
- g_return_if_fail (GNOME_DB_IS_GOO (object));
+ g_return_if_fail (GNOME_DB_IS_CANVAS (object));
- canvas = GNOME_DB_GOO (object);
+ canvas = GNOME_DB_CANVAS (object);
if (canvas->priv->graph)
release_graph (canvas->priv->graph, canvas);
@@ -435,13 +435,13 @@
static void
-gnome_db_goo_finalize (GObject * object)
+gnome_db_canvas_finalize (GObject * object)
{
- GnomeDbGoo *canvas;
+ GnomeDbCanvas *canvas;
g_return_if_fail (object != NULL);
- g_return_if_fail (GNOME_DB_IS_GOO (object));
- canvas = GNOME_DB_GOO (object);
+ g_return_if_fail (GNOME_DB_IS_CANVAS (object));
+ canvas = GNOME_DB_CANVAS (object);
if (canvas->priv) {
g_free (canvas->priv);
@@ -454,15 +454,15 @@
static void
-gnome_db_goo_set_property (GObject *object,
+gnome_db_canvas_set_property (GObject *object,
guint param_id,
const GValue *value,
GParamSpec *pspec)
{
- GnomeDbGoo *canvas;
+ GnomeDbCanvas *canvas;
GObject *ptr;
- canvas = GNOME_DB_GOO (object);
+ canvas = GNOME_DB_CANVAS (object);
switch (param_id) {
case PROP_GRAPH:
@@ -488,18 +488,18 @@
}
if (canvas->priv->graph)
- gnome_db_goo_post_init (canvas);
+ gnome_db_canvas_post_init (canvas);
}
static void
-gnome_db_goo_get_property (GObject *object,
+gnome_db_canvas_get_property (GObject *object,
guint param_id,
GValue *value,
GParamSpec *pspec)
{
- GnomeDbGoo *canvas;
+ GnomeDbCanvas *canvas;
- canvas = GNOME_DB_GOO (object);
+ canvas = GNOME_DB_CANVAS (object);
switch (param_id) {
case PROP_GRAPH:
@@ -509,7 +509,7 @@
}
static void
-release_graph (GnomeDbGraph *graph, GnomeDbGoo *canvas)
+release_graph (GnomeDbGraph *graph, GnomeDbCanvas *canvas)
{
g_return_if_fail (canvas->priv->graph == graph);
@@ -527,25 +527,25 @@
}
static void
-graph_item_added_cb (GnomeDbGraph *graph, GnomeDbGraphItem *item, GnomeDbGoo *canvas)
+graph_item_added_cb (GnomeDbGraph *graph, GnomeDbGraphItem *item, GnomeDbCanvas *canvas)
{
- GnomeDbGooClass *class = GNOME_DB_GOO_CLASS (G_OBJECT_GET_CLASS (canvas));
+ GnomeDbCanvasClass *class = GNOME_DB_CANVAS_CLASS (G_OBJECT_GET_CLASS (canvas));
if (class->graph_item_added)
(class->graph_item_added) (canvas, item);
}
static void
-graph_item_dropped_cb (GnomeDbGraph *graph, GnomeDbGraphItem *item, GnomeDbGoo *canvas)
+graph_item_dropped_cb (GnomeDbGraph *graph, GnomeDbGraphItem *item, GnomeDbCanvas *canvas)
{
- GnomeDbGooClass *class = GNOME_DB_GOO_CLASS (G_OBJECT_GET_CLASS (canvas));
+ GnomeDbCanvasClass *class = GNOME_DB_CANVAS_CLASS (G_OBJECT_GET_CLASS (canvas));
if (class->graph_item_dropped)
(class->graph_item_dropped) (canvas, item);
}
static void
-gnome_db_goo_post_init (GnomeDbGoo *canvas)
+gnome_db_canvas_post_init (GnomeDbCanvas *canvas)
{
- GnomeDbGooClass *class = GNOME_DB_GOO_CLASS (G_OBJECT_GET_CLASS (canvas));
+ GnomeDbCanvasClass *class = GNOME_DB_CANVAS_CLASS (G_OBJECT_GET_CLASS (canvas));
/* some clean-up if there are already some canvas items */
if (class->clean_canvas_items)
@@ -560,9 +560,9 @@
}
GnomeDbGraph *
-gnome_db_goo_get_graph (GnomeDbGoo *canvas)
+gnome_db_canvas_get_graph (GnomeDbCanvas *canvas)
{
- g_return_val_if_fail (GNOME_DB_IS_GOO (canvas), NULL);
+ g_return_val_if_fail (GNOME_DB_IS_CANVAS (canvas), NULL);
g_return_val_if_fail (canvas->priv, NULL);
if (!canvas->priv->graph) {
@@ -576,23 +576,23 @@
}
/**
- * gnome_db_goo_declare_item
- * @canvas: a #GnomeDbGoo widget
- * @item: a #GnomeDbGooItem object
+ * gnome_db_canvas_declare_item
+ * @canvas: a #GnomeDbCanvas widget
+ * @item: a #GnomeDbCanvasItem object
*
* Declares @item to be listed by @canvas as one of its items.
- * This functions should be called after each #GnomeDbGooItem is added to
+ * This functions should be called after each #GnomeDbCanvasItem is added to
* @canvas.
*
* If it was not called for one item, then that item won't be used
* in @canvas's computations (no drag and drop, cleanup, etc).
*/
void
-gnome_db_goo_declare_item (GnomeDbGoo *canvas, GnomeDbGooItem *item)
+gnome_db_canvas_declare_item (GnomeDbCanvas *canvas, GnomeDbCanvasItem *item)
{
- g_return_if_fail (GNOME_DB_IS_GOO (canvas));
+ g_return_if_fail (GNOME_DB_IS_CANVAS (canvas));
g_return_if_fail (canvas->priv);
- g_return_if_fail (item && GNOME_DB_IS_GOO_ITEM (item));
+ g_return_if_fail (item && GNOME_DB_IS_CANVAS_ITEM (item));
if (g_slist_find (canvas->priv->items, item))
return;
@@ -605,7 +605,7 @@
}
static void
-item_destroyed_cb (GnomeDbGooItem *item, GnomeDbGoo *canvas)
+item_destroyed_cb (GnomeDbCanvasItem *item, GnomeDbCanvas *canvas)
{
g_return_if_fail (g_slist_find (canvas->priv->items, item));
g_signal_handlers_disconnect_by_func (G_OBJECT (item), G_CALLBACK (drag_action_cb), canvas);
@@ -614,7 +614,7 @@
}
static void
-drag_action_cb (GnomeDbGooItem *citem, GnomeDbGooItem *drag_from, GnomeDbGooItem *drag_to, GnomeDbGoo *canvas)
+drag_action_cb (GnomeDbCanvasItem *citem, GnomeDbCanvasItem *drag_from, GnomeDbCanvasItem *drag_to, GnomeDbCanvas *canvas)
{
#ifdef debug_signal
g_print (">> 'DRAG_ACTION' from %s, %s\n", __FILE__, __FUNCTION__);
@@ -627,8 +627,8 @@
/**
- * gnome_db_goo_set_in_scrolled_window
- * @canvas: a #GnomeDbGoo widget
+ * gnome_db_canvas_set_in_scrolled_window
+ * @canvas: a #GnomeDbCanvas widget
*
* Creates a new #GtkScrolledWindow object and put @canvas
* in it. @canvas can be retrieved using a "canvas" user property of
@@ -637,10 +637,10 @@
* Returns: the new scrolled window.
*/
GtkWidget *
-gnome_db_goo_set_in_scrolled_window (GnomeDbGoo *canvas)
+gnome_db_canvas_set_in_scrolled_window (GnomeDbCanvas *canvas)
{
GtkWidget *sw;
- g_return_val_if_fail (GNOME_DB_IS_GOO (canvas), NULL);
+ g_return_val_if_fail (GNOME_DB_IS_CANVAS (canvas), NULL);
g_return_val_if_fail (canvas->priv, NULL);
sw = gtk_scrolled_window_new (NULL, NULL);
@@ -655,8 +655,8 @@
}
/**
- * gnome_db_goo_set_zoom_factor
- * @canvas: a #GnomeDbGoo widget
+ * gnome_db_canvas_set_zoom_factor
+ * @canvas: a #GnomeDbCanvas widget
* @n: the zoom factor
*
* Sets the zooming factor of a canvas by specifying the number of pixels that correspond
@@ -664,34 +664,34 @@
* and lower than 1.0 makes a zoom out.
*/
void
-gnome_db_goo_set_zoom_factor (GnomeDbGoo *canvas, gdouble n)
+gnome_db_canvas_set_zoom_factor (GnomeDbCanvas *canvas, gdouble n)
{
- g_return_if_fail (GNOME_DB_IS_GOO (canvas));
+ g_return_if_fail (GNOME_DB_IS_CANVAS (canvas));
g_return_if_fail (canvas->priv);
goo_canvas_set_scale (GOO_CANVAS (canvas), n);
}
/**
- * gnome_db_goo_get_zoom_factor
- * @canvas: a #GnomeDbGoo widget
+ * gnome_db_canvas_get_zoom_factor
+ * @canvas: a #GnomeDbCanvas widget
*
* Get the current zooming factor of a canvas.
*
* Returns: the zooming factor.
*/
gdouble
-gnome_db_goo_get_zoom_factor (GnomeDbGoo *canvas)
+gnome_db_canvas_get_zoom_factor (GnomeDbCanvas *canvas)
{
- g_return_val_if_fail (GNOME_DB_IS_GOO (canvas), 1.);
+ g_return_val_if_fail (GNOME_DB_IS_CANVAS (canvas), 1.);
g_return_val_if_fail (canvas->priv, 1.);
return goo_canvas_get_scale (GOO_CANVAS (canvas));
}
/**
- * gnome_db_goo_fit_zoom_factor
- * @canvas: a #GnomeDbGoo widget
+ * gnome_db_canvas_fit_zoom_factor
+ * @canvas: a #GnomeDbCanvas widget
*
* Compute and set the correct zoom factor so that all the items on @canvas can be displayed
* at once.
@@ -699,12 +699,12 @@
* Returns: the new zooming factor.
*/
gdouble
-gnome_db_goo_fit_zoom_factor (GnomeDbGoo *canvas)
+gnome_db_canvas_fit_zoom_factor (GnomeDbCanvas *canvas)
{
gdouble zoom, xall, yall;
GooCanvasBounds bounds;
- g_return_val_if_fail (GNOME_DB_IS_GOO (canvas), 1.);
+ g_return_val_if_fail (GNOME_DB_IS_CANVAS (canvas), 1.);
g_return_val_if_fail (canvas->priv, 1.);
xall = GTK_WIDGET (canvas)->allocation.width;
@@ -722,19 +722,19 @@
if (zoom > 1.0)
zoom = 1.0;
- gnome_db_goo_set_zoom_factor (GNOME_DB_GOO (canvas), zoom);
+ gnome_db_canvas_set_zoom_factor (GNOME_DB_CANVAS (canvas), zoom);
return zoom;
}
/**
- * gnome_db_goo_center
- * @canvas: a #GnomeDbGoo widget
+ * gnome_db_canvas_center
+ * @canvas: a #GnomeDbCanvas widget
*
* Centers the display on the layout
*/
void
-gnome_db_goo_center (GnomeDbGoo *canvas)
+gnome_db_canvas_center (GnomeDbCanvas *canvas)
{
/* remove top and left margins if we are running out of space */
if (GOO_CANVAS (canvas)->hadjustment && GOO_CANVAS (canvas)->vadjustment) {
@@ -768,8 +768,8 @@
}
/**
- * gnome_db_goo_auto_layout_enabled
- * @canvas: a #GnomeDbGoo widget
+ * gnome_db_canvas_auto_layout_enabled
+ * @canvas: a #GnomeDbCanvas widget
*
* Tells if @canvas has the possibility to automatically adjust its layout
* using the GraphViz library.
@@ -777,9 +777,9 @@
* Returns: TRUE if @canvas can automatically adjust its layout
*/
gboolean
-gnome_db_goo_auto_layout_enabled (GnomeDbGoo *canvas)
+gnome_db_canvas_auto_layout_enabled (GnomeDbCanvas *canvas)
{
- g_return_val_if_fail (GNOME_DB_IS_GOO (canvas), FALSE);
+ g_return_val_if_fail (GNOME_DB_IS_CANVAS (canvas), FALSE);
g_return_val_if_fail (canvas->priv, FALSE);
#ifdef HAVE_GRAPHVIZ
@@ -791,13 +791,13 @@
#ifdef HAVE_GRAPHVIZ
typedef struct {
- GnomeDbGoo *canvas;
+ GnomeDbCanvas *canvas;
Agraph_t *graph;
GSList *nodes_list; /* list of NodeLayout structures */
} GraphLayout;
typedef struct {
- GnomeDbGooItem *item; /* item to be moved */
+ GnomeDbCanvasItem *item; /* item to be moved */
GnomeDbGraphItem *graph_item;
Agnode_t *node;
gdouble start_x;
@@ -814,16 +814,16 @@
#endif
/**
- * gnome_db_goo_auto_layout
- * @canvas: a #GnomeDbGoo widget
+ * gnome_db_canvas_auto_layout
+ * @canvas: a #GnomeDbCanvas widget
*
* Re-organizes the layout of the @canvas' items using the GraphViz
* layout engine.
*/
void
-gnome_db_goo_perform_auto_layout (GnomeDbGoo *canvas, gboolean animate, GnomeDbGooLayoutAlgorithm algorithm)
+gnome_db_canvas_perform_auto_layout (GnomeDbCanvas *canvas, gboolean animate, GnomeDbCanvasLayoutAlgorithm algorithm)
{
- g_return_if_fail (GNOME_DB_IS_GOO (canvas));
+ g_return_if_fail (GNOME_DB_IS_CANVAS (canvas));
g_return_if_fail (canvas->priv);
#define GV_SCALE 72.
@@ -834,7 +834,7 @@
#else
GSList *list;
Agraph_t *graph;
- GHashTable *nodes_hash; /* key = GnomeDbGooItem, value = Agnode_t *node */
+ GHashTable *nodes_hash; /* key = GnomeDbCanvasItem, value = Agnode_t *node */
GSList *nodes_list = NULL; /* list of NodeLayout structures */
if (!gvc)
@@ -851,9 +851,9 @@
/* Graph nodes creation */
nodes_hash = g_hash_table_new (NULL, NULL);
for (list = canvas->priv->items; list; list = list->next) {
- GnomeDbGooItem *item = GNOME_DB_GOO_ITEM (list->data);
+ GnomeDbCanvasItem *item = GNOME_DB_CANVAS_ITEM (list->data);
- if (gnome_db_goo_item_get_graph_item (item)) {
+ if (gnome_db_canvas_item_get_graph_item (item)) {
Agnode_t *node;
gchar *tmp;
double val;
@@ -862,7 +862,7 @@
NodeLayout *nl;
nl = g_new0 (NodeLayout, 1);
nl->item = item;
- nl->graph_item = gnome_db_goo_item_get_graph_item (item);
+ nl->graph_item = gnome_db_canvas_item_get_graph_item (item);
gnome_db_graph_item_get_position (nl->graph_item, &(nl->start_x), &(nl->start_y));
nodes_list = g_slist_prepend (nodes_list, nl);
@@ -893,9 +893,9 @@
}
/* Graph edges creation */
for (list = canvas->priv->items; list; list = list->next) {
- GnomeDbGooItem *item = GNOME_DB_GOO_ITEM (list->data);
- GnomeDbGooItem *from, *to;
- gnome_db_goo_item_get_edge_nodes (item, &from, &to);
+ GnomeDbCanvasItem *item = GNOME_DB_CANVAS_ITEM (list->data);
+ GnomeDbCanvasItem *from, *to;
+ gnome_db_canvas_item_get_edge_nodes (item, &from, &to);
if (from && to) {
Agnode_t *from_node, *to_node;
from_node = (Agnode_t*) g_hash_table_lookup (nodes_hash, from);
@@ -907,10 +907,10 @@
switch (algorithm) {
default:
- case GNOME_DB_GOO_LAYOUT_DEFAULT:
+ case GNOME_DB_CANVAS_LAYOUT_DEFAULT:
gvLayout (gvc, graph, "dot");
break;
- case GNOME_DB_GOO_LAYOUT_RADIAL:
+ case GNOME_DB_CANVAS_LAYOUT_RADIAL:
gvLayout (gvc, graph, "circo");
break;
}
Copied: trunk/libgnomedb-graph/gnome-db-canvas.h (from r1721, /trunk/libgnomedb-graph/gnome-db-goo.h)
==============================================================================
--- /trunk/libgnomedb-graph/gnome-db-goo.h (original)
+++ trunk/libgnomedb-graph/gnome-db-canvas.h Wed Apr 30 20:19:18 2008
@@ -1,4 +1,4 @@
-/* gnome-db-goo.h
+/* gnome-db-canvas.h
*
* Copyright (C) 2007 - 2008 Vivien Malerba
*
@@ -18,27 +18,27 @@
* USA
*/
-#ifndef __GNOME_DB_GOO__
-#define __GNOME_DB_GOO__
+#ifndef __GNOME_DB_CANVAS__
+#define __GNOME_DB_CANVAS__
#include <goocanvas.h>
#include <libgda/gda-decl.h>
-#include <libgnomedb-graph/gnome-db-goo-decl.h>
+#include <libgnomedb-graph/gnome-db-canvas-decl.h>
G_BEGIN_DECLS
-#define GNOME_DB_TYPE_GOO (gnome_db_goo_get_type())
-#define GNOME_DB_GOO(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, gnome_db_goo_get_type(), GnomeDbGoo)
-#define GNOME_DB_GOO_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, gnome_db_goo_get_type (), GnomeDbGooClass)
-#define GNOME_DB_IS_GOO(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, gnome_db_goo_get_type ())
+#define GNOME_DB_TYPE_CANVAS (gnome_db_canvas_get_type())
+#define GNOME_DB_CANVAS(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, gnome_db_canvas_get_type(), GnomeDbCanvas)
+#define GNOME_DB_CANVAS_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, gnome_db_canvas_get_type (), GnomeDbCanvasClass)
+#define GNOME_DB_IS_CANVAS(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, gnome_db_canvas_get_type ())
typedef enum {
- GNOME_DB_GOO_LAYOUT_DEFAULT,
- GNOME_DB_GOO_LAYOUT_RADIAL
-} GnomeDbGooLayoutAlgorithm;
+ GNOME_DB_CANVAS_LAYOUT_DEFAULT,
+ GNOME_DB_CANVAS_LAYOUT_RADIAL
+} GnomeDbCanvasLayoutAlgorithm;
/* struct for the object's data */
-struct _GnomeDbGoo
+struct _GnomeDbCanvas
{
GooCanvas widget;
@@ -46,45 +46,45 @@
gdouble xmouse;
gdouble ymouse;
/* private */
- GnomeDbGooPrivate *priv;
+ GnomeDbCanvasPrivate *priv;
};
/* struct for the object's class */
-struct _GnomeDbGooClass
+struct _GnomeDbCanvasClass
{
GooCanvasClass parent_class;
/* virtual functions */
- void (*create_canvas_items) (GnomeDbGoo *canvas); /* create individual GnomeDbGooItem objects */
- void (*clean_canvas_items) (GnomeDbGoo *canvas); /* clean any extra structure, not the individual items */
+ void (*create_canvas_items) (GnomeDbCanvas *canvas); /* create individual GnomeDbCanvasItem objects */
+ void (*clean_canvas_items) (GnomeDbCanvas *canvas); /* clean any extra structure, not the individual items */
- void (*graph_item_added) (GnomeDbGoo *canvas, GnomeDbGraphItem *item);
- void (*graph_item_dropped) (GnomeDbGoo *canvas, GnomeDbGraphItem *item);
+ void (*graph_item_added) (GnomeDbCanvas *canvas, GnomeDbGraphItem *item);
+ void (*graph_item_dropped) (GnomeDbCanvas *canvas, GnomeDbGraphItem *item);
- GtkWidget *(*build_context_menu) (GnomeDbGoo *canvas);
+ GtkWidget *(*build_context_menu) (GnomeDbCanvas *canvas);
/* signals */
- void (*drag_action) (GnomeDbGoo *canvas, GnomeDbGooItem *from_item, GnomeDbGooItem *to_item);
+ void (*drag_action) (GnomeDbCanvas *canvas, GnomeDbCanvasItem *from_item, GnomeDbCanvasItem *to_item);
};
/* generic widget's functions */
-GType gnome_db_goo_get_type (void) G_GNUC_CONST;
+GType gnome_db_canvas_get_type (void) G_GNUC_CONST;
-GnomeDbGraph *gnome_db_goo_get_graph (GnomeDbGoo *canvas);
-GtkWidget *gnome_db_goo_set_in_scrolled_window (GnomeDbGoo *canvas);
-void gnome_db_goo_declare_item (GnomeDbGoo *canvas, GnomeDbGooItem *item);
-
-void gnome_db_goo_set_zoom_factor (GnomeDbGoo *canvas, gdouble n);
-gdouble gnome_db_goo_get_zoom_factor (GnomeDbGoo *canvas);
-gdouble gnome_db_goo_fit_zoom_factor (GnomeDbGoo *canvas);
-gboolean gnome_db_goo_auto_layout_enabled (GnomeDbGoo *canvas);
-void gnome_db_goo_perform_auto_layout (GnomeDbGoo *canvas, gboolean animate,
- GnomeDbGooLayoutAlgorithm algorithm);
-void gnome_db_goo_center (GnomeDbGoo *canvas);
-
-#define GNOME_DB_GOO_ENTITY_COLOR "yellow"
-#define GNOME_DB_GOO_DB_TABLE_COLOR "lightblue"
-#define GNOME_DB_GOO_QUERY_COLOR "lightgreen"
+GnomeDbGraph *gnome_db_canvas_get_graph (GnomeDbCanvas *canvas);
+GtkWidget *gnome_db_canvas_set_in_scrolled_window (GnomeDbCanvas *canvas);
+void gnome_db_canvas_declare_item (GnomeDbCanvas *canvas, GnomeDbCanvasItem *item);
+
+void gnome_db_canvas_set_zoom_factor (GnomeDbCanvas *canvas, gdouble n);
+gdouble gnome_db_canvas_get_zoom_factor (GnomeDbCanvas *canvas);
+gdouble gnome_db_canvas_fit_zoom_factor (GnomeDbCanvas *canvas);
+gboolean gnome_db_canvas_auto_layout_enabled (GnomeDbCanvas *canvas);
+void gnome_db_canvas_perform_auto_layout (GnomeDbCanvas *canvas, gboolean animate,
+ GnomeDbCanvasLayoutAlgorithm algorithm);
+void gnome_db_canvas_center (GnomeDbCanvas *canvas);
+
+#define GNOME_DB_CANVAS_ENTITY_COLOR "yellow"
+#define GNOME_DB_CANVAS_DB_TABLE_COLOR "lightblue"
+#define GNOME_DB_CANVAS_QUERY_COLOR "lightgreen"
G_END_DECLS
Modified: trunk/libgnomedb-graph/gnome-db-graph-item.h
==============================================================================
--- trunk/libgnomedb-graph/gnome-db-graph-item.h (original)
+++ trunk/libgnomedb-graph/gnome-db-graph-item.h Wed Apr 30 20:19:18 2008
@@ -23,7 +23,7 @@
#define __GNOME_DB_GRAPH_ITEM_H_
#include <glib-object.h>
-#include <libgnomedb-graph/gnome-db-goo-decl.h>
+#include <libgnomedb-graph/gnome-db-canvas-decl.h>
G_BEGIN_DECLS
Modified: trunk/libgnomedb-graph/gnome-db-graph.h
==============================================================================
--- trunk/libgnomedb-graph/gnome-db-graph.h (original)
+++ trunk/libgnomedb-graph/gnome-db-graph.h Wed Apr 30 20:19:18 2008
@@ -23,7 +23,7 @@
#define __GNOME_DB_GRAPH_H_
#include <glib-object.h>
-#include <libgnomedb-graph/gnome-db-goo-decl.h>
+#include <libgnomedb-graph/gnome-db-canvas-decl.h>
#include <libgda/libgda.h>
G_BEGIN_DECLS
Modified: trunk/libgnomedb-graph/goo-canvas-test.c
==============================================================================
--- trunk/libgnomedb-graph/goo-canvas-test.c (original)
+++ trunk/libgnomedb-graph/goo-canvas-test.c Wed Apr 30 20:19:18 2008
@@ -1,13 +1,13 @@
#include <stdlib.h>
#include <goocanvas.h>
#include <libgnomedb/libgnomedb.h>
-#include <gnome-db-goo-text.h>
-#include <gnome-db-goo-table.h>
-#include <gnome-db-goo-db-relations.h>
+#include <gnome-db-canvas-text.h>
+#include <gnome-db-canvas-table.h>
+#include <gnome-db-canvas-db-relations.h>
static gboolean on_delete_event (GtkWidget *window, GdkEvent *event, gpointer unused_data);
-static void auto_layout_cb (GtkButton *button, GnomeDbGoo *canvas);
-static void center_display_cb (GtkButton *button, GnomeDbGoo *canvas);
+static void auto_layout_cb (GtkButton *button, GnomeDbCanvas *canvas);
+static void center_display_cb (GtkButton *button, GnomeDbCanvas *canvas);
static void destroy_widget_cb (GtkButton *button, GtkWidget *wid);
int
@@ -23,7 +23,8 @@
/* Initialize GTK+. */
gtk_set_locale ();
- gnome_db_init ("Goo Canvas test", "1.0", argc, argv);
+ gnome_db_init ();
+ gtk_init (&argc, &argv);
/* connection */
cnc = gda_connection_open_from_string (NULL, "Sqlite://DB_DIR=../extra/demos;DB_NAME=demo_db",
@@ -64,10 +65,10 @@
root = goo_canvas_get_root_item (GOO_CANVAS (canvas));
- /* GnomeDbGooText */
- item = gnome_db_goo_text_new (root, "GnomeDbGooText", 100., 100., NULL);
- item = gnome_db_goo_text_new (root, "GnomeDbGooText", 100., 120., NULL);
- item = gnome_db_goo_text_new (root, "GnomeDbGooText", 100., 140., NULL);
+ /* GnomeDbCanvasText */
+ item = gnome_db_canvas_text_new (root, "GnomeDbCanvasText", 100., 100., NULL);
+ item = gnome_db_canvas_text_new (root, "GnomeDbCanvasText", 100., 120., NULL);
+ item = gnome_db_canvas_text_new (root, "GnomeDbCanvasText", 100., 140., NULL);
/* Entity: table */
mstruct = gda_meta_struct_new (GDA_META_STRUCT_FEATURE_FOREIGN_KEYS);
@@ -77,10 +78,10 @@
mtable = gda_meta_struct_complement (mstruct, store, GDA_META_DB_TABLE,
NULL, NULL, value, NULL);
if (mtable)
- item = gnome_db_goo_table_new (root, mtable, 200., 200., NULL);
+ item = gnome_db_canvas_table_new (root, mtable, 200., 200., NULL);
/*
- * test GnomeDbGooDbRelations
+ * test GnomeDbCanvasDbRelations
*/
vb = gtk_vbox_new (FALSE, 5);
gtk_notebook_append_page (GTK_NOTEBOOK (nb), vb, gtk_label_new ("DbRelations"));
@@ -90,7 +91,7 @@
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
gtk_box_pack_start (GTK_BOX (vb), scrolled_win, TRUE, TRUE, 0);
- canvas = gnome_db_goo_db_relations_new (store);
+ canvas = gnome_db_canvas_db_relations_new (store);
//gtk_widget_set_size_request (canvas, 600, 450);
gtk_container_add (GTK_CONTAINER (scrolled_win), canvas);
//g_object_set (canvas, "graph", graph, NULL);
@@ -116,7 +117,7 @@
#define ALLBUILD_NO
#ifdef ALLBUILD
/*
- * test GnomeDbGooDbRelations side by side
+ * test GnomeDbCanvasDbRelations side by side
*/
GtkWidget *paned;
@@ -131,7 +132,7 @@
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
gtk_paned_add1 (GTK_PANED (paned), scrolled_win);
- canvas = gnome_db_goo_db_relations_new (dict);
+ canvas = gnome_db_canvas_db_relations_new (dict);
gtk_widget_set_size_request (canvas, 400, 450);
gtk_container_add (GTK_CONTAINER (scrolled_win), canvas);
g_object_set (canvas, "graph", graph, NULL);
@@ -141,7 +142,7 @@
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
gtk_paned_add2 (GTK_PANED (paned), scrolled_win);
- canvas = gnome_db_goo_db_relations_new (dict);
+ canvas = gnome_db_canvas_db_relations_new (dict);
gtk_widget_set_size_request (canvas, 400, 450);
gtk_container_add (GTK_CONTAINER (scrolled_win), canvas);
g_object_set (canvas, "graph", graph, NULL);
@@ -156,15 +157,15 @@
}
static void
-auto_layout_cb (GtkButton *button, GnomeDbGoo *canvas)
+auto_layout_cb (GtkButton *button, GnomeDbCanvas *canvas)
{
- gnome_db_goo_perform_auto_layout (canvas, TRUE, GNOME_DB_GOO_LAYOUT_DEFAULT);
+ gnome_db_canvas_perform_auto_layout (canvas, TRUE, GNOME_DB_CANVAS_LAYOUT_DEFAULT);
}
static void
-center_display_cb (GtkButton *button, GnomeDbGoo *canvas)
+center_display_cb (GtkButton *button, GnomeDbCanvas *canvas)
{
- gnome_db_goo_center (canvas);
+ gnome_db_canvas_center (canvas);
}
static void
Copied: trunk/libgnomedb-graph/libgnomedb-graph.h (from r1721, /trunk/libgnomedb-graph/libgnomedb-goo.h)
==============================================================================
--- /trunk/libgnomedb-graph/libgnomedb-goo.h (original)
+++ trunk/libgnomedb-graph/libgnomedb-graph.h Wed Apr 30 20:19:18 2008
@@ -23,14 +23,18 @@
#ifndef __LIBGNOME_DB_GRAPH_H_
#define __LIBGNOME_DB_GRAPH_H_
-#include <libgnomedb-graph/gnome-db-goo-cursor.h>
-#include <libgnomedb-graph/gnome-db-goo-db-relations.h>
-#include <libgnomedb-graph/gnome-db-goo-table.h>
-#include <libgnomedb-graph/gnome-db-goo-column.h>
-#include <libgnomedb-graph/gnome-db-goo-fkey.h>
-#include <libgnomedb-graph/gnome-db-goo-item.h>
-#include <libgnomedb-graph/gnome-db-goo-text.h>
-#include <libgnomedb-graph/gnome-db-goo-tip.h>
-#include <libgnomedb-graph/gnome-db-goo.h>
+#include <libgnomedb-graph/gnome-db-canvas-cursor.h>
+#include <libgnomedb-graph/gnome-db-canvas-db-relations.h>
+#include <libgnomedb-graph/gnome-db-canvas-table.h>
+#include <libgnomedb-graph/gnome-db-canvas-column.h>
+#include <libgnomedb-graph/gnome-db-canvas-fkey.h>
+#include <libgnomedb-graph/gnome-db-canvas-item.h>
+#include <libgnomedb-graph/gnome-db-canvas-text.h>
+#include <libgnomedb-graph/gnome-db-canvas-tip.h>
+#include <libgnomedb-graph/gnome-db-canvas.h>
+
+#include <libgnomedb-graph/gnome-db-graph.h>
+#include <libgnomedb-graph/gnome-db-graph-item.h>
+
#endif
Modified: trunk/libgnomedb/gnome-db-basic-form.c
==============================================================================
--- trunk/libgnomedb/gnome-db-basic-form.c (original)
+++ trunk/libgnomedb/gnome-db-basic-form.c Wed Apr 30 20:19:18 2008
@@ -883,10 +883,9 @@
gtk_widget_show (label);
entry_label = evbox;
- g_object_get (G_OBJECT (group->nodes_source->data_model), "descr", &title, NULL);
+ title = g_object_get_data (G_OBJECT (group->nodes_source->data_model), "descr");
if (title && *title)
gtk_tooltips_set_tip (form->priv->tooltips, evbox, title, NULL);
- g_free (title);
}
/* add the entry itself to the table */
Modified: trunk/libgnomedb/gnome-db-data-store.c
==============================================================================
--- trunk/libgnomedb/gnome-db-data-store.c (original)
+++ trunk/libgnomedb/gnome-db-data-store.c Wed Apr 30 20:19:18 2008
@@ -160,8 +160,6 @@
GtkTreePath *path;
GtkTreeIter iter;
- g_print ("I %d\n", row);
- gda_data_model_dump (((GnomeDbDataStore*) store)->priv->proxy, stdout);
((GnomeDbDataStore*) store)->priv->nrows ++;
((GnomeDbDataStore*) store)->priv->stamp = g_random_int ();
path = gtk_tree_path_new ();
@@ -177,8 +175,6 @@
GtkTreePath *path;
GtkTreeIter iter;
- g_print ("U %d\n", row);
- gda_data_model_dump (((GnomeDbDataStore*) store)->priv->proxy, stdout);
((GnomeDbDataStore*) store)->priv->stamp = g_random_int ();
path = gtk_tree_path_new ();
gtk_tree_path_append_index (path, row);
@@ -192,8 +188,6 @@
{
GtkTreePath *path;
- g_print ("R %d\n", row);
- gda_data_model_dump (((GnomeDbDataStore*) store)->priv->proxy, stdout);
((GnomeDbDataStore*) store)->priv->nrows --;
((GnomeDbDataStore*) store)->priv->stamp = g_random_int ();
path = gtk_tree_path_new ();
@@ -207,7 +201,6 @@
{
gint i, nrows;
- g_print ("RESET\n");
while (((GnomeDbDataStore*) store)->priv->nrows > 0)
row_removed_cb (proxy, ((GnomeDbDataStore*) store)->priv->nrows - 1, store);
Modified: trunk/libgnomedb/gnome-db-init.c
==============================================================================
--- trunk/libgnomedb/gnome-db-init.c (original)
+++ trunk/libgnomedb/gnome-db-init.c Wed Apr 30 20:19:18 2008
@@ -39,21 +39,17 @@
/**
* gnome_db_init
- * @app_id:
- * @version:
- * @nargs:
- * @args:
*
- * Initialization of the libgnomedb library
+ * Initialization of the libgnomedb library, must be called before any usage of the library.
*/
void
-gnome_db_init (const gchar *app_id, const gchar *version, gint nargs, gchar *args[])
+gnome_db_init (void)
{
static gboolean initialized = FALSE;
gchar *str;
if (initialized) {
- gda_log_error (_("Attempt to initialize an already initialized client"));
+ gda_log_error (_("Attempt to initialize an already initialized library"));
return;
}
@@ -64,8 +60,7 @@
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
- gda_init (app_id, version, nargs, args);
- gtk_init (&nargs, &args);
+ gda_init ();
#ifdef HAVE_LIBGLADE
glade_init ();
@@ -81,64 +76,6 @@
initialized = TRUE;
}
-typedef struct {
- GdaInitFunc init_func;
- gpointer user_data;
-} InitCbData;
-
-static gboolean
-idle_cb (gpointer user_data)
-{
- InitCbData *cb_data = (InitCbData *) user_data;
-
- g_return_val_if_fail (cb_data != NULL, FALSE);
-
- if (cb_data->init_func)
- cb_data->init_func (cb_data->user_data);
-
- g_free (cb_data);
-
- return FALSE;
-}
-
-/**
- * gnome_db_main_run
- * @init_func: function to be called when everything has been initialized
- * @user_data: data to be passed to the init function
- *
- * This function is a convenience function to specify a function to be called
- * after everything has been correctly
- * initialized (that is, for initializing your own stuff), in an idle callback.
- *
- * Using it is not mandatory, and usually gtk_main() can be used.
- */
-void
-gnome_db_main_run (GdaInitFunc init_func, gpointer user_data)
-{
- if (init_func) {
- InitCbData *cb_data;
-
- cb_data = g_new (InitCbData, 1);
- cb_data->init_func = init_func;
- cb_data->user_data = user_data;
-
- g_idle_add ((GSourceFunc) idle_cb, cb_data);
- }
-
- gtk_main ();
-}
-
-/**
- * gnome_db_main_quit
- *
- * Convenience function, simply calls gtk_main_quit()
- */
-void
-gnome_db_main_quit (void)
-{
- gtk_main_quit ();
-}
-
/**
* gnome_db_get_application_exec_path
* @app_name: the name of the application to find
Modified: trunk/libgnomedb/gnome-db-raw-grid.c
==============================================================================
--- trunk/libgnomedb/gnome-db-raw-grid.c (original)
+++ trunk/libgnomedb/gnome-db-raw-grid.c Wed Apr 30 20:19:18 2008
@@ -977,39 +977,23 @@
static void
treeview_column_clicked_cb (GtkTreeViewColumn *tree_column, GnomeDbRawGrid *grid)
{
- /*
- const gchar *filter;
- gchar *newfilter = NULL;
GdaSetGroup *group;
+ GSList *nodes;
group = g_object_get_data (G_OBJECT (tree_column), "group");
g_assert (group);
- filter = gda_data_proxy_get_filter_expr (grid->priv->proxy);
- if (filter) {
- TO_IMPLEMENT;
- }
- else {
- GString *string;
- GSList *nodes;
- string = g_string_new ("ORDER BY ");
- for (nodes = group->nodes; nodes; nodes = nodes->next) {
- GdaHolder *param = ((GdaSetNode*) nodes->data)->param;
- g_assert (param);
- if (nodes != group->nodes)
- g_string_append (string, ", ");
- g_string_append (string, gda_object_get_name (GDA_OBJECT (param)));
- }
- newfilter = string->str;
- g_string_free (string, FALSE);
- }
-
- if (newfilter) {
- g_print ("FILTER: %s\n", newfilter);
- g_free (newfilter);
+ for (nodes = group->nodes; nodes; nodes = nodes->next) {
+ GdaHolder *param = ((GdaSetNode*) nodes->data)->holder;
+ gint pos;
+ g_assert (param);
+
+ pos = g_slist_index (GDA_SET (grid->priv->iter)->holders, param);
+ if (pos >= 0) {
+ gda_data_proxy_set_ordering_column (grid->priv->proxy, pos, NULL);
+ break;
+ }
}
- */
- TO_IMPLEMENT;
}
/*
Modified: trunk/libgnomedb/libgnomedb.h.in
==============================================================================
--- trunk/libgnomedb/libgnomedb.h.in (original)
+++ trunk/libgnomedb/libgnomedb.h.in Wed Apr 30 20:19:18 2008
@@ -75,13 +75,8 @@
G_BEGIN_DECLS
-void gnome_db_init (const gchar *app_id, const gchar *version, gint nargs, gchar *args[]);
-void gnome_db_main_run (GdaInitFunc init_func, gpointer user_data);
-void gnome_db_main_quit (void);
-
-#define GNOME_DB_DATABASE_PROPERTIES_APP "gnome-database-properties"
-gchar *gnome_db_get_application_exec_path (const gchar *app_name);
-
+void gnome_db_init (void);
+gchar *gnome_db_get_application_exec_path (const gchar *app_name);
G_END_DECLS
Modified: trunk/libgnomedb/plugins/gnome-db-entry-pict.c
==============================================================================
--- trunk/libgnomedb/plugins/gnome-db-entry-pict.c (original)
+++ trunk/libgnomedb/plugins/gnome-db-entry-pict.c Wed Apr 30 20:19:18 2008
@@ -397,7 +397,7 @@
}
else {
stock = GTK_STOCK_MISSING_IMAGE;
- notice_msg = g_strdup (_("Empty Adata"));
+ notice_msg = g_strdup (_("Empty data"));
}
}
Modified: trunk/samples/SimpleExample/example.c
==============================================================================
--- trunk/samples/SimpleExample/example.c (original)
+++ trunk/samples/SimpleExample/example.c Wed Apr 30 20:19:18 2008
@@ -33,8 +33,9 @@
gchar *str;
MainData *data;
- /* Libgnomedb inittalization */
- gnome_db_init ("SimpleExample", "3.1.1", argc, argv);
+ /* Libgnomedb inittalization & GTK+ */
+ gnome_db_init ();
+ gtk_init (&argc, &argv);
/* open a connection */
client = gda_client_new ();
Modified: trunk/testing/test-dyn-widgets.c
==============================================================================
--- trunk/testing/test-dyn-widgets.c (original)
+++ trunk/testing/test-dyn-widgets.c Wed Apr 30 20:19:18 2008
@@ -222,7 +222,8 @@
g_option_context_free (context);
/* Initialize the widget set */
- gnome_db_init ("test-dyn-widgets", "", argc, argv);
+ gnome_db_init ();
+ gtk_init (&argc, &argv);
/* Test Configuration */
config = g_new0 (MainConfig, 1);
Modified: trunk/testing/test-handlers.c
==============================================================================
--- trunk/testing/test-handlers.c (original)
+++ trunk/testing/test-handlers.c Wed Apr 30 20:19:18 2008
@@ -123,7 +123,8 @@
g_option_context_free (context);
/* Initialize the widget set */
- gnome_db_init ("test-handlers", "", argc, argv);
+ gnome_db_init ();
+ gtk_init (&argc, &argv);
gnome_db_util_init_plugins ();
/* init main conf */
Modified: trunk/testing/test-provider-schemas.c
==============================================================================
--- trunk/testing/test-provider-schemas.c (original)
+++ trunk/testing/test-provider-schemas.c Wed Apr 30 20:19:18 2008
@@ -36,7 +36,8 @@
static void test_dsn (GdaDataSourceInfo *dsn);
-gint main (int argc, char **argv) {
+gint
+main (int argc, char **argv) {
GError *error = NULL;
GOptionContext *context;
@@ -56,7 +57,8 @@
if (!table_fields && !with_dt && !with_func && !with_agg && !with_tables && !with_views)
with_dt = with_func = with_agg = with_tables = with_views = TRUE;
- gnome_db_init ("test-provider-schemas", PACKAGE_VERSION, argc, argv);
+ gnome_db_init ();
+ gtk_init (&argc, &argv);
if (argc == 2) {
GdaDataSourceInfo *dsn;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]