From 00d0c27c4e817e8dfa6fba679406408d0e2b8acc Mon Sep 17 00:00:00 2001 From: Gautier Hattenberger Date: Fri, 27 Mar 2020 00:40:38 +0100 Subject: [PATCH] [gtk] fix depreciated gtk2 elements --- sw/ground_segment/misc/Makefile | 2 +- sw/ground_segment/misc/sbs2ivy.c | 6 +++--- sw/ground_segment/misc/video_synchronizer.c | 4 ++-- sw/ground_segment/tmtc/Makefile | 2 +- sw/ground_segment/tmtc/ivy_serial_bridge.c | 6 +++--- sw/lib/ocaml/Makefile | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/sw/ground_segment/misc/Makefile b/sw/ground_segment/misc/Makefile index f74ce5c9ea..4fb66ffe36 100644 --- a/sw/ground_segment/misc/Makefile +++ b/sw/ground_segment/misc/Makefile @@ -36,7 +36,7 @@ else endif CFLAGS += -Wall -fPIC -g -GTK_CFLAGS = $(shell pkg-config gtk+-2.0 --cflags) +GTK_CFLAGS = $(shell pkg-config gtk+-2.0 --cflags) -DGTK_DISABLE_DEPRECATED GTK_LDFLAGS = $(shell pkg-config gtk+-2.0 --libs) $(shell pkg-config --libs ivy-glib) $(shell pcre-config --libs) -fPIC GLIBIVY_CFLAGS = $(shell pkg-config --cflags ivy-glib) diff --git a/sw/ground_segment/misc/sbs2ivy.c b/sw/ground_segment/misc/sbs2ivy.c index 14eff0ee48..391eb2c743 100644 --- a/sw/ground_segment/misc/sbs2ivy.c +++ b/sw/ground_segment/misc/sbs2ivy.c @@ -597,14 +597,14 @@ int main(int argc, char **argv) IvyStart(options.ivy_bus); // Add Timer - gtk_timeout_add(delay / 4, timeout_callback, NULL); + g_timeout_add(delay / 4, timeout_callback, NULL); // GTK Window GtkWidget *window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_title(GTK_WINDOW(window), "SBS2Ivy"); - gtk_signal_connect(GTK_OBJECT(window), "delete_event", - GTK_SIGNAL_FUNC(delete_event), NULL); + g_signal_connect(GTK_OBJECT(window), "delete_event", + G_CALLBACK(delete_event), NULL); GtkWidget *box = gtk_vbox_new(TRUE, 1); gtk_container_add(GTK_CONTAINER(window), box); diff --git a/sw/ground_segment/misc/video_synchronizer.c b/sw/ground_segment/misc/video_synchronizer.c index 99446fee2e..b844384d09 100644 --- a/sw/ground_segment/misc/video_synchronizer.c +++ b/sw/ground_segment/misc/video_synchronizer.c @@ -217,7 +217,7 @@ static void on_quit(GtkWidget *object, gpointer user_data) { static void on_video_sync_changed(GtkWidget *widget, gpointer data) { - startVideoAfter = gtk_spin_button_get_value_as_float((GtkSpinButton *)spinButton); + startVideoAfter = gtk_spin_button_get_value((GtkSpinButton *)spinButton); calcCurrentPlayingTime(); sendCurrentPlayingTime(); @@ -225,7 +225,7 @@ static void on_video_sync_changed(GtkWidget *widget, gpointer data) { static void on_video_time_tag_changed(GtkWidget *widget, gpointer data) { - timeTagInVideo = gtk_spin_button_get_value_as_float((GtkSpinButton *)spinButtonVideo); + timeTagInVideo = gtk_spin_button_get_value((GtkSpinButton *)spinButtonVideo); calcCurrentPlayingTime(); sendCurrentPlayingTime(); diff --git a/sw/ground_segment/tmtc/Makefile b/sw/ground_segment/tmtc/Makefile index 6b3c864bb5..fae05a79d4 100644 --- a/sw/ground_segment/tmtc/Makefile +++ b/sw/ground_segment/tmtc/Makefile @@ -112,7 +112,7 @@ settings.cmo : ../cockpit/page_settings.cmi CC = gcc -GTK_CFLAGS = $(shell pkg-config gtk+-2.0 --cflags) +GTK_CFLAGS = $(shell pkg-config gtk+-2.0 --cflags) -DGTK_DISABLE_DEPRECATED GTK_LDFLAGS = $(shell pkg-config gtk+-2.0 --libs) $(shell pcre-config --libs) GLIBIVY_CFLAGS = -Wall -fPIC $(shell pkg-config --cflags ivy-glib) diff --git a/sw/ground_segment/tmtc/ivy_serial_bridge.c b/sw/ground_segment/tmtc/ivy_serial_bridge.c index db71934816..693be8c22b 100644 --- a/sw/ground_segment/tmtc/ivy_serial_bridge.c +++ b/sw/ground_segment/tmtc/ivy_serial_bridge.c @@ -780,14 +780,14 @@ int main ( int argc, char** argv) IvyStart("127.255.255.255"); // Add Timer - gtk_timeout_add(delay / 4, timeout_callback, NULL); + g_timeout_add(delay / 4, timeout_callback, NULL); // GTK Window GtkWidget *window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (window), "IVY_Serial_Bridge"); - gtk_signal_connect (GTK_OBJECT (window), "delete_event", - GTK_SIGNAL_FUNC (delete_event), NULL); + g_signal_connect (GTK_OBJECT (window), "delete_event", + G_CALLBACK (delete_event), NULL); GtkWidget *box = gtk_vbox_new(TRUE, 1); gtk_container_add (GTK_CONTAINER (window), box); diff --git a/sw/lib/ocaml/Makefile b/sw/lib/ocaml/Makefile index 00d6b497ef..d7163ba359 100644 --- a/sw/lib/ocaml/Makefile +++ b/sw/lib/ocaml/Makefile @@ -131,7 +131,7 @@ tests : lib-pprz.cma $(TESTS_CMO) $(XCMO) $(XCMX): PKGCOMMON=$(XPKGCOMMON) -GTKCFLAGS := $(shell pkg-config --cflags gtk+-2.0) +GTKCFLAGS := $(shell pkg-config --cflags gtk+-2.0) -DGTK_DISABLE_DEPRECATED ml_gtk_drag.o : ml_gtk_drag.c @echo OC $< $(Q)$(OCAMLC) $(INCLUDES) -package $(PKGCOMMON) -c -ccopt "$(GTKCFLAGS)" $<