[genius] Wed Sep 08 00:47:50 2010 Jiri (George) Lebl <jirka 5z com>



commit 3faaef665b0ad9378d0538148694d8ea0ce47d01
Author: Jiri (George) Lebl <jirka 5z com>
Date:   Wed Sep 8 00:47:54 2010 -0700

    Wed Sep 08 00:47:50 2010  Jiri (George) Lebl <jirka 5z com>
    
    	* configure.in: require Gtk+ 2.14 and VTE 0.17.1
    
    	* src/gnome-genius.c, src/graphing.c, ve/ve-miscui.c: fix some
    	  sealing things.  Do note that we do not yet compile even without
    	  deprecated stuff since gtkextra is full of it.  Also use some newer
    	  things that required gtk+ 2.14 and vte 0.17.1
    
    	* src/graphing.c: fix zooming in 2D plots when moving mouse
    	  in any direction.

 ChangeLog           |   12 ++++
 NEWS                |    4 +
 configure.in        |    4 +-
 src/geniustests.txt |    6 +-
 src/gnome-genius.c  |  171 +++++++++++++--------------------------------------
 src/graphing.c      |   60 +++++++++++-------
 ve/ve-miscui.c      |    8 +-
 7 files changed, 104 insertions(+), 161 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index b724a5c..beb70a1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+Wed Sep 08 00:47:50 2010  Jiri (George) Lebl <jirka 5z com>
+
+	* configure.in: require Gtk+ 2.14 and VTE 0.17.1
+
+	* src/gnome-genius.c, src/graphing.c, ve/ve-miscui.c: fix some
+	  sealing things.  Do note that we do not yet compile even without
+	  deprecated stuff since gtkextra is full of it.  Also use some newer
+	  things that required gtk+ 2.14 and vte 0.17.1
+
+	* src/graphing.c: fix zooming in 2D plots when moving mouse
+	  in any direction.
+
 Mon Aug 30 22:33:08 2010  Jiri (George) Lebl <jirka 5z com>
 
 	* src/calc.h, ssrc/funclib.c, src/genius.c, src/gnome-genius.c:
diff --git a/NEWS b/NEWS
index 6ee97b7..e719ea2 100644
--- a/NEWS
+++ b/NEWS
@@ -12,8 +12,12 @@ Changes to 1.0.10
   out)
 * Fix some crashes in plotting code
 * Allow slopefield solutions to leave plot window by a small fudge factor.
+* Fix zooming plots so that we can zoom by moving mouse in any direction
 * Fix compilation with newer sealed vte (Vincent Untz)
 * Fix up some typos in the documentation (Christian Kirbach, me)
+* Translation updates (Christian Kirbach, Jorge González, Andrej ŽnidarÅ¡iÄ?,
+  Kjartan Maraas, Petr Kovar, Mario Blättermann, Fran Diéguez, Matej UrbanÄ?iÄ?,
+  Andrej ŽnidarÅ¡iÄ?, Marek Ä?ernocký, me)
 
 * For some of the changes the author (Jiri) was partially supported by
   NSF grant DMS 0900885 and the University of Illinois at Urbana-Champaign
diff --git a/configure.in b/configure.in
index bb2b1c7..45bb517 100644
--- a/configure.in
+++ b/configure.in
@@ -12,8 +12,8 @@ AC_PROG_INTLTOOL([0.21])
 
 dnl ================= Requirements ================================================
 
-VTE_REQUIRED=0.8.19
-GTK_REQUIRED=2.12.0
+VTE_REQUIRED=0.17.1
+GTK_REQUIRED=2.14.0
 GLIB_REQUIRED=2.12.0
 GTKSOURCEVIEW_REQUIRED=0.3.0
 GTKSOURCEVIEW2_REQUIRED=2.0.2
diff --git a/src/geniustests.txt b/src/geniustests.txt
index a51b2b6..c4926df 100644
--- a/src/geniustests.txt
+++ b/src/geniustests.txt
@@ -982,10 +982,10 @@ func=1;start=2;inc=3;round(100*InfiniteSum(`(n)=inc-func-start+2^(-n),1,1))	100
 [0,I(2);0]							[0,1,0;0,0,1;0,0,0]
 [0,I(2);null;1,2,3]						[0,1,0,0;0,0,1,0;1,2,2,3]
 [0,I(2);null;0,0,0]						[0,1,0,0;0,0,1,0;0,0,0,0]
-AuxilliaryUnitMatrix(3)						[0,1,0;0,0,1;0,0,0]
-AuxilliaryUnitMatrix(4)						[0,1,0,0;0,0,1,0;0,0,0,1;0,0,0,0]
+AuxiliaryUnitMatrix(3)						[0,1,0;0,0,1;0,0,0]
+AuxiliaryUnitMatrix(4)						[0,1,0,0;0,0,1,0;0,0,0,1;0,0,0,0]
 J(4,2)								[2,1,0,0;0,2,1,0;0,0,2,1;0,0,0,2]
-J(10,0)==AuxilliaryUnitMatrix (10)				true
+J(10,0)==AuxiliaryUnitMatrix (10)				true
 [1,2,3;4,5;6]							[1,2,3;4,5,0;6,0,0]
 a=[1,2,3;4,5,6;7,8,9];[a,10;11,12]				[1,2,3,10;4,5,6,10;7,8,9,10;11,11,11,12]
 null==1								false
diff --git a/src/gnome-genius.c b/src/gnome-genius.c
index 462fb88..f8ea6b5 100644
--- a/src/gnome-genius.c
+++ b/src/gnome-genius.c
@@ -669,16 +669,16 @@ void
 genius_setup_window_cursor (GtkWidget *win, GdkCursorType type)
 {
 	GdkCursor *cursor = gdk_cursor_new (type);
-	if (win != NULL && win->window != NULL)
-		gdk_window_set_cursor (win->window, cursor);
+	if (win != NULL && gtk_widget_get_window (win) != NULL)
+		gdk_window_set_cursor (gtk_widget_get_window (win), cursor);
 	gdk_cursor_unref (cursor);
 }
 
 void
 genius_unsetup_window_cursor (GtkWidget *win)
 {
-	if (win != NULL && win->window != NULL)
-		gdk_window_set_cursor (win->window, NULL);
+	if (win != NULL && gtk_widget_get_window (win) != NULL)
+		gdk_window_set_cursor (gtk_widget_get_window (win), NULL);
 }
 
 
@@ -759,7 +759,7 @@ gel_ask_buttons (const char *query, GSList *buttons)
 
 	box = gtk_vbox_new (FALSE, GENIUS_PAD);
 	gtk_container_set_border_width (GTK_CONTAINER (box), GENIUS_PAD);
-	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (d)->vbox),
+	gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (d))),
 			    box,
 			    TRUE, TRUE, 0);
 
@@ -800,7 +800,7 @@ gel_ask_string (const char *query, const char *def)
 
 	box = gtk_vbox_new (FALSE, GENIUS_PAD);
 	gtk_container_set_border_width (GTK_CONTAINER (box), GENIUS_PAD);
-	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (d)->vbox),
+	gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (d))),
 			    box,
 			    TRUE, TRUE, 0);
 
@@ -861,7 +861,7 @@ help_on_function (GtkWidget *menuitem, gpointer data)
 
 	box = gtk_vbox_new (FALSE, GENIUS_PAD);
 	gtk_container_set_border_width (GTK_CONTAINER (box), GENIUS_PAD);
-	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (d)->vbox),
+	gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (d))),
 			    box,
 			    TRUE, TRUE, 0);
 
@@ -975,7 +975,7 @@ geniusbox (gboolean error,
 		gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
 						GTK_POLICY_AUTOMATIC,
 						GTK_POLICY_AUTOMATIC);
-		gtk_box_pack_start (GTK_BOX (GTK_DIALOG (mb)->vbox),
+		gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (mb))),
 				    sw,
 				    TRUE, TRUE, 0);
 
@@ -1203,7 +1203,7 @@ show_user_vars (GtkWidget *menu_item, gpointer data)
 	gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
 					GTK_POLICY_AUTOMATIC,
 					GTK_POLICY_AUTOMATIC);
-	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (var_box)->vbox),
+	gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (var_box))),
 			    sw,
 			    TRUE, TRUE, 0);
 
@@ -1414,7 +1414,7 @@ run_monitor (const char *var)
 	gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
 					GTK_POLICY_AUTOMATIC,
 					GTK_POLICY_AUTOMATIC);
-	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (d)->vbox),
+	gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (d))),
 			    sw,
 			    TRUE, TRUE, 0);
 
@@ -1444,7 +1444,7 @@ run_monitor (const char *var)
 
 	md->updatecb = gtk_check_button_new_with_label
 		(_("Update continuously"));
-	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (d)->vbox),
+	gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (d))),
 			    md->updatecb,
 			    FALSE, FALSE, 0);
 	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (md->updatecb), TRUE);
@@ -1485,7 +1485,7 @@ monitor_user_var (GtkWidget *menu_item, gpointer data)
 
 	box = gtk_vbox_new (FALSE, GENIUS_PAD);
 	gtk_container_set_border_width (GTK_CONTAINER (box), GENIUS_PAD);
-	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (d)->vbox),
+	gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (d))),
 			    box,
 			    TRUE, TRUE, 0);
 
@@ -1681,9 +1681,6 @@ gel_printout_infos (void)
 static void
 actually_open_help (const char *id)
 {
-/* breaks binary back compatibility */
-#if 0
-/*#if GTK_CHECK_VERSION(2,14,0) */
 	GError *error = NULL;
 	char *str;
 
@@ -1704,67 +1701,6 @@ actually_open_help (const char *id)
 		g_free (str);
 		g_error_free (error);
 	}
-/*#else*/
-#endif
-	char *xdgopen;
-	char *uri;
-	char *file = NULL;
-	const char * const* langs;
-	int i;
-
-	langs = g_get_language_names ();
-
-	for (i = 0; langs[i] != NULL; i++) {
-		file = g_build_filename (genius_datadir,
-					 "gnome",
-					 "help",
-					 "genius",
-					 langs[i],
-					 "genius.xml",
-					 NULL);
-		if (access (file, R_OK) == 0) {
-			break;
-		}
-		g_free (file);
-		file = NULL;
-	}
-
-	if (file == NULL) {
-		genius_display_error (NULL /* parent */,
-				      _("Genius manual not found.  Perhaps the installation is not correct."));
-		return;
-	}
-
-	uri = g_strdup_printf ("ghelp://%s%s%s",
-			       file,
-			       /* FIXME: 1: not non-unix safe I guess */
-			       id ? "?" : "",
-			       id ? id : "");
-	g_free (file);
-
-	xdgopen = g_find_program_in_path ("xdg-open");
-	if G_LIKELY (xdgopen != NULL) {
-		char *argv[3];
-
-		argv[0] = xdgopen;
-		argv[1] = uri;
-		argv[2] = NULL;
-		g_spawn_async (NULL /* wd */,
-			       argv,
-			       NULL /* envp */,
-			       0 /* flags */,
-			       NULL /* child_setup */,
-			       NULL /* user_data */,
-			       NULL /* child_pid */,
-			       NULL /* error */);
-	} else {
-		genius_display_error (NULL /* parent */,
-				      _("Command 'xdg-open' is not found.  Cannot open help."));
-	}
-
-	g_free (xdgopen);
-	g_free (uri);
-/*#endif*/
 }
 
 void
@@ -1985,16 +1921,14 @@ genius_display_error (GtkWidget *parent, const char *err)
 	if (parent == NULL)
 		parent = genius_window;
 
-	w = gtk_message_dialog_new (parent ?
-				      GTK_WINDOW (parent) :
-				      NULL /* parent */,
-				    GTK_DIALOG_MODAL /* flags */,
-				    GTK_MESSAGE_ERROR,
-				    GTK_BUTTONS_CLOSE,
-				    "%s",
-				    err);
-	gtk_label_set_use_markup
-		(GTK_LABEL (GTK_MESSAGE_DIALOG (w)->label), TRUE);
+	w = gtk_message_dialog_new_with_markup (parent ?
+						GTK_WINDOW (parent) :
+						NULL /* parent */,
+						GTK_DIALOG_MODAL /* flags */,
+						GTK_MESSAGE_ERROR,
+						GTK_BUTTONS_CLOSE,
+						"%s",
+						err);
 
 	g_signal_connect (G_OBJECT (w), "destroy",
 			  G_CALLBACK (gtk_widget_destroyed),
@@ -2015,14 +1949,12 @@ display_warning (GtkWidget *parent, const char *warn)
 	if (parent == NULL)
 		parent = genius_window;
 
-	w = gtk_message_dialog_new (GTK_WINDOW (parent) /* parent */,
-				    GTK_DIALOG_MODAL /* flags */,
-				    GTK_MESSAGE_WARNING,
-				    GTK_BUTTONS_CLOSE,
-				    "%s",
-				    warn);
-	gtk_label_set_use_markup
-		(GTK_LABEL (GTK_MESSAGE_DIALOG (w)->label), TRUE);
+	w = gtk_message_dialog_new_with_markup (GTK_WINDOW (parent) /* parent */,
+						GTK_DIALOG_MODAL /* flags */,
+						GTK_MESSAGE_WARNING,
+						GTK_BUTTONS_CLOSE,
+						"%s",
+						warn);
 
 	g_signal_connect (G_OBJECT (w), "destroy",
 			  G_CALLBACK (gtk_widget_destroyed),
@@ -2044,14 +1976,12 @@ genius_ask_question (GtkWidget *parent, const char *question)
 	if (parent == NULL)
 		parent = genius_window;
 
-	req = gtk_message_dialog_new (GTK_WINDOW (parent) /* parent */,
-				      GTK_DIALOG_MODAL /* flags */,
-				      GTK_MESSAGE_QUESTION,
-				      GTK_BUTTONS_YES_NO,
-				      "%s",
-				      question);
-	gtk_label_set_use_markup
-		(GTK_LABEL (GTK_MESSAGE_DIALOG (req)->label), TRUE);
+	req = gtk_message_dialog_new_with_markup (GTK_WINDOW (parent) /* parent */,
+						  GTK_DIALOG_MODAL /* flags */,
+						  GTK_MESSAGE_QUESTION,
+						  GTK_BUTTONS_YES_NO,
+						  "%s",
+						  question);
 
 	g_signal_connect (G_OBJECT (req), "destroy",
 			  G_CALLBACK (gtk_widget_destroyed),
@@ -2127,19 +2057,19 @@ quitapp (GtkWidget * widget, gpointer data)
 
 /*exact answer callback*/
 static void
-intspincb(GtkAdjustment *adj, int *data)
+intspincb (GtkAdjustment *adj, int *data)
 {
-	*data=adj->value;
+	*data = gtk_adjustment_get_value (adj);
 }
 
 /*option callback*/
 static void
-optioncb(GtkWidget * widget, int *data)
+optioncb (GtkWidget * widget, int *data)
 {
-	if(GTK_TOGGLE_BUTTON(widget)->active)
-		*data=TRUE;
+	if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
+		*data = TRUE;
 	else
-		*data=FALSE;
+		*data = FALSE;
 }
 
 static void
@@ -2190,18 +2120,11 @@ setup_response (GtkWidget *widget, gint resp, gpointer data)
 			   default_console_font :
 			   genius_setup.font);
 		setup_term_color ();
-		/* breaks binary back compatibility */
-/*#if VTE_CHECK_VERSION(0,17,1)
 		vte_terminal_set_cursor_blink_mode
 			(VTE_TERMINAL (term),
 			 genius_setup.blinking_cursor ?
 			 VTE_CURSOR_BLINK_SYSTEM :
 			 VTE_CURSOR_BLINK_OFF);
-#else*/
-		vte_terminal_set_cursor_blinks
-			(VTE_TERMINAL (term),
-			genius_setup.blinking_cursor);
-/*#endif */
 
 
 		if (resp == GTK_RESPONSE_OK ||
@@ -2248,7 +2171,7 @@ setup_calc(GtkWidget *widget, gpointer data)
 	gtk_dialog_set_has_separator (GTK_DIALOG (setupdialog), FALSE);
 
 	notebook = gtk_notebook_new ();
-	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (setupdialog)->vbox),
+	gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (setupdialog))),
 			    notebook, TRUE, TRUE, 0);
 	
 	mainbox = gtk_vbox_new(FALSE, GENIUS_PAD);
@@ -3088,7 +3011,7 @@ build_program_menu (void)
 		prog_menu_items = g_list_remove_link (prog_menu_items, prog_menu_items);
 	}
 
-	menu = GTK_MENU_ITEM (gtk_ui_manager_get_widget (genius_ui, "/MenuBar/ProgramsMenu"))->submenu;
+	menu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (gtk_ui_manager_get_widget (genius_ui, "/MenuBar/ProgramsMenu")));
 
 	for (i = 1; i < n; i++) {
 		GtkWidget *item;
@@ -4761,10 +4684,9 @@ drag_data_received (GtkWidget *widget, GdkDragContext *context,
 	if (info != TARGET_URI_LIST)
 		return;
 			
-	uris = g_uri_list_extract_uris (selection_data->data);
+	uris = gtk_selection_data_get_uris (selection_data);
 
-	for (uri = uris[i]; uri != NULL; i++, uri = uris[i])
-	{
+	for (uri = uris[i]; uri != NULL; i++, uri = uris[i]) {
 		new_program (uri);
 	}
 	g_strfreev (uris);
@@ -4972,18 +4894,11 @@ main (int argc, char *argv[])
 					     default_console_font :
 					     genius_setup.font);
 	setup_term_color ();
-	/* breaks binary back compatibility */
-/* #if VTE_CHECK_VERSION(0,17,1)
 	vte_terminal_set_cursor_blink_mode
 		(VTE_TERMINAL (term),
 		 genius_setup.blinking_cursor ?
 		 VTE_CURSOR_BLINK_SYSTEM :
 		 VTE_CURSOR_BLINK_OFF);
-#else*/
-	vte_terminal_set_cursor_blinks
-		(VTE_TERMINAL (term),
-		 genius_setup.blinking_cursor);
-/*#endif*/
 	vte_terminal_set_encoding (VTE_TERMINAL (term), "UTF-8");
 
 	update_term_geometry ();
@@ -5002,7 +4917,7 @@ main (int argc, char *argv[])
 	if (gel_plugin_list != NULL) {
 		GSList *li;
 		int i;
-		GtkWidget *menu = GTK_MENU_ITEM (gtk_ui_manager_get_widget (genius_ui, "/MenuBar/PluginsMenu"))->submenu;
+		GtkWidget *menu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (gtk_ui_manager_get_widget (genius_ui, "/MenuBar/PluginsMenu")));
 
 		for (i = 0, li = gel_plugin_list;
 		     li != NULL;
diff --git a/src/graphing.c b/src/graphing.c
index 105a78d..8830ce8 100644
--- a/src/graphing.c
+++ b/src/graphing.c
@@ -587,7 +587,7 @@ rotate_cb (GtkWidget *item, gpointer data)
 	/* X dir */
 
 	hbox = gtk_hbox_new (FALSE, GENIUS_PAD);
-	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (req)->vbox),
+	gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (req))),
 			    hbox, TRUE, TRUE, 0);
 
 	tmp = g_strdup_printf (_("Rotate about %s axis: "),
@@ -616,7 +616,7 @@ rotate_cb (GtkWidget *item, gpointer data)
 	/* Y dir */
 
 	hbox = gtk_hbox_new (FALSE, GENIUS_PAD);
-	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (req)->vbox),
+	gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (req))),
 			    hbox, TRUE, TRUE, 0);
 
 	tmp = g_strdup_printf (_("Rotate about %s axis: "),
@@ -645,7 +645,7 @@ rotate_cb (GtkWidget *item, gpointer data)
 	/* Z dir */
 
 	hbox = gtk_hbox_new (FALSE, GENIUS_PAD);
-	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (req)->vbox),
+	gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (req))),
 			    hbox, TRUE, TRUE, 0);
 
 	w = gtk_label_new (_("Rotate about dependent axis: "));
@@ -770,7 +770,7 @@ plot_print_cb (void)
 	gtk_dialog_set_has_separator (GTK_DIALOG (req), FALSE);
 
 	hbox = gtk_hbox_new (FALSE, GENIUS_PAD);
-	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (req)->vbox),
+	gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (req))),
 			    hbox, TRUE, TRUE, 0);
 
 	w = gtk_label_new (_("Print command: "));
@@ -1409,6 +1409,18 @@ plot_select_region (GtkPlotCanvas *canvas,
 		ymax = 1.0 - oldymin;
 	}
 
+	if (xmin > xmax) {
+		double tmp = xmax;
+		xmax = xmin;
+		xmin = tmp;
+	}
+
+	if (ymin > ymax) {
+		double tmp = ymax;
+		ymax = ymin;
+		ymin = tmp;
+	}
+
 	if (plot_in_progress == 0 &&
 	    line_plot != NULL &&
 	    (plot_mode == MODE_LINEPLOT_SLOPEFIELD ||
@@ -1692,7 +1704,7 @@ solver_cb (GtkWidget *item, gpointer data)
 	gtk_dialog_set_has_separator (GTK_DIALOG (solver_dialog), FALSE);
 
 	box = gtk_vbox_new (FALSE, GENIUS_PAD);
-	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (solver_dialog)->vbox),
+	gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (solver_dialog))),
 			    box, TRUE, TRUE, 0);
 	gtk_container_set_border_width (GTK_CONTAINER (box), GENIUS_PAD);
 
@@ -1857,7 +1869,7 @@ ensure_window (gboolean do_window_present)
 			  NULL);
 
 	menubar = gtk_menu_bar_new ();
-	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (graph_window)->vbox),
+	gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (graph_window))),
 			    GTK_WIDGET (menubar), FALSE, TRUE, 0);
 
 	/*
@@ -1984,7 +1996,7 @@ ensure_window (gboolean do_window_present)
 	g_signal_connect (G_OBJECT (plot_canvas), "select_region",
 			  G_CALLBACK (plot_select_region),
 			  NULL);
-	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (graph_window)->vbox),
+	gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (graph_window))),
 			    GTK_WIDGET (plot_canvas), TRUE, TRUE, 0);
 
 
@@ -4022,16 +4034,16 @@ plot_surface_functions (gboolean do_window_present)
 
 /*exact answer callback*/
 static void
-double_spin_cb(GtkAdjustment *adj, double *data)
+double_spin_cb (GtkAdjustment *adj, double *data)
 {
-	*data = adj->value;
+	*data = gtk_adjustment_get_value (adj);
 }
 
 /*exact answer callback*/
 static void
-int_spin_cb(GtkAdjustment *adj, int *data)
+int_spin_cb (GtkAdjustment *adj, int *data)
 {
-	*data = (int)(adj->value);
+	*data = (int)(gtk_adjustment_get_value (adj));
 }
 
 static void
@@ -4241,7 +4253,7 @@ create_simple_expression_box (const char *label,
 static void
 optioncb (GtkWidget * widget, int *data)
 {
-	if (GTK_TOGGLE_BUTTON (widget)->active)
+	if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
 		*data = TRUE;
 	else
 		*data = FALSE;
@@ -4517,7 +4529,7 @@ change_lineplot_varnames (GtkWidget *button, gpointer data)
 	sg = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
 
 	errlabel = gtk_label_new (_("Some values were illegal"));
-	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (req)->vbox),
+	gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (req))),
 			    errlabel, FALSE, FALSE, 0);
 
 	b = create_simple_expression_box (_("independent variable (x):"),
@@ -4527,7 +4539,7 @@ change_lineplot_varnames (GtkWidget *button, gpointer data)
 	gtk_entry_set_text (GTK_ENTRY (xe), lp_x_name);
 	g_signal_connect (G_OBJECT (xe), "activate",
 			  G_CALLBACK (ok_dialog_entry_activate), req);
-	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (req)->vbox),
+	gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (req))),
 			    b, FALSE, FALSE, 0);
 
 	b = create_simple_expression_box (_("dependent variable (y):"),
@@ -4537,7 +4549,7 @@ change_lineplot_varnames (GtkWidget *button, gpointer data)
 	gtk_entry_set_text (GTK_ENTRY (ye), lp_y_name);
 	g_signal_connect (G_OBJECT (ye), "activate",
 			  G_CALLBACK (ok_dialog_entry_activate), req);
-	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (req)->vbox),
+	gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (req))),
 			    b, FALSE, FALSE, 0);
 
 	b = create_simple_expression_box (_("complex variable (z = x+iy):"),
@@ -4547,7 +4559,7 @@ change_lineplot_varnames (GtkWidget *button, gpointer data)
 	gtk_entry_set_text (GTK_ENTRY (ze), lp_z_name);
 	g_signal_connect (G_OBJECT (ze), "activate",
 			  G_CALLBACK (ok_dialog_entry_activate), req);
-	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (req)->vbox),
+	gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (req))),
 			    b, FALSE, FALSE, 0);
 
 	b = create_simple_expression_box (_("parameter variable (t):"),
@@ -4557,7 +4569,7 @@ change_lineplot_varnames (GtkWidget *button, gpointer data)
 	gtk_entry_set_text (GTK_ENTRY (te), lp_t_name);
 	g_signal_connect (G_OBJECT (te), "activate",
 			  G_CALLBACK (ok_dialog_entry_activate), req);
-	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (req)->vbox),
+	gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (req))),
 			    b, FALSE, FALSE, 0);
 
 	gtk_widget_show_all (req);
@@ -4637,7 +4649,7 @@ change_surface_varnames (GtkWidget *button, gpointer data)
 	sg = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
 
 	errlabel = gtk_label_new (_("Some values were illegal"));
-	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (req)->vbox),
+	gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (req))),
 			    errlabel, FALSE, FALSE, 0);
 
 	b = create_simple_expression_box (_("independent variable (x):"),
@@ -4647,7 +4659,7 @@ change_surface_varnames (GtkWidget *button, gpointer data)
 	gtk_entry_set_text (GTK_ENTRY (xe), sp_x_name);
 	g_signal_connect (G_OBJECT (xe), "activate",
 			  G_CALLBACK (ok_dialog_entry_activate), req);
-	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (req)->vbox),
+	gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (req))),
 			    b, FALSE, FALSE, 0);
 
 	b = create_simple_expression_box (_("independent variable (y):"),
@@ -4657,7 +4669,7 @@ change_surface_varnames (GtkWidget *button, gpointer data)
 	gtk_entry_set_text (GTK_ENTRY (ye), sp_y_name);
 	g_signal_connect (G_OBJECT (ye), "activate",
 			  G_CALLBACK (ok_dialog_entry_activate), req);
-	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (req)->vbox),
+	gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (req))),
 			    b, FALSE, FALSE, 0);
 
 	b = create_simple_expression_box (_("independent complex variable (z = x+iy):"),
@@ -4667,7 +4679,7 @@ change_surface_varnames (GtkWidget *button, gpointer data)
 	gtk_entry_set_text (GTK_ENTRY (ze), sp_z_name);
 	g_signal_connect (G_OBJECT (ze), "activate",
 			  G_CALLBACK (ok_dialog_entry_activate), req);
-	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (req)->vbox),
+	gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (req))),
 			    b, FALSE, FALSE, 0);
 
 	gtk_widget_show_all (req);
@@ -5292,7 +5304,7 @@ surface_from_dialog (void)
 	double x1, x2, y1, y2, z1, z2;
 	gboolean last_info;
 	gboolean last_error;
-	const char *error_to_print = NULL;
+	char *error_to_print = NULL;
 	gboolean ex;
 
 	plot_mode = MODE_SURFACE;
@@ -5448,7 +5460,7 @@ plot_from_dialog_lineplot (void)
 	int i, j;
 	gboolean last_info;
 	gboolean last_error;
-	const char *error_to_print = NULL;
+	char *error_to_print = NULL;
 
 	plot_mode = MODE_LINEPLOT;
 
@@ -5963,7 +5975,7 @@ genius_plot_dialog (void)
 
 	insides = create_plot_dialog ();
 
-	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (plot_dialog)->vbox),
+	gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (plot_dialog))),
 			    insides, TRUE, TRUE, 0);
 
 	gtk_widget_show_all (plot_dialog);
diff --git a/ve/ve-miscui.c b/ve/ve-miscui.c
index 47549ef..b80b05a 100644
--- a/ve/ve-miscui.c
+++ b/ve/ve-miscui.c
@@ -1,7 +1,7 @@
 /* Misc UI routines
  *
  * (c) 2000 Eazel, Inc.
- * (c) 2001 George Lebl
+ * (c) 2001, 2010 Jiri (George) Lebl
  * (c) 2003 Red Hat, Inc.
  *
  * This library is free software; you can redistribute it and/or
@@ -34,7 +34,7 @@ ve_entry_set_red (GtkWidget *w, gboolean state)
 		GtkStyle *ns;
 		GdkColor red = { 0, 65535, 0, 0 };
 
-		ns = gtk_style_copy (w->style);
+		ns = gtk_style_copy (gtk_widget_get_style (w));
 		g_object_ref (G_OBJECT (ns));
 
 		ns->fg[GTK_STATE_NORMAL] = red;
@@ -93,7 +93,7 @@ ve_hig_dialog_new (GtkWindow      *parent,
 	gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
 	gtk_window_set_title (GTK_WINDOW (dialog), "");
   
-	dialog_vbox = GTK_DIALOG (dialog)->vbox;
+	dialog_vbox = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
 	gtk_box_set_spacing (GTK_BOX (dialog_vbox), 12);
 
 	hbox = gtk_hbox_new (FALSE, 12);
@@ -141,7 +141,7 @@ ve_hig_dialog_new (GtkWindow      *parent,
 		gtk_widget_show (label);
 	}
 	
-	dialog_action_area = GTK_DIALOG (dialog)->action_area;
+	dialog_action_area = gtk_dialog_get_action_area (GTK_DIALOG (dialog));
 	gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area), GTK_BUTTONBOX_END);
 
 	switch (buttons) 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]