aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Phillips <david@sighup.nz>2018-06-20 14:21:46 +1200
committerDavid Phillips <david@sighup.nz>2018-06-20 14:21:46 +1200
commita22145376cf84960800237eb4669787d637a192a (patch)
treec640bdf395597578e750edc22ae65c3783588e26
parent9ddb79b8c53393be5b15170089201b2592533ba4 (diff)
downloadparamano-a22145376cf84960800237eb4669787d637a192a.tar.xz
Port to Gtk3
-rw-r--r--bat_tray.c2
-rw-r--r--config.mk6
-rw-r--r--tray.c10
3 files changed, 9 insertions, 9 deletions
diff --git a/bat_tray.c b/bat_tray.c
index 70d3abd..e4f7c39 100644
--- a/bat_tray.c
+++ b/bat_tray.c
@@ -208,7 +208,7 @@ void bat_tray_init()
snprintf(icon_file, sizeof(icon_file), "%s/bat-charged.png", DEFAULT_THEME);
gtk_status_icon_set_from_file(tray, icon_file);
gtk_status_icon_set_has_tooltip (tray, TRUE);
- g_signal_connect(G_OBJECT(tray), "query-tooltip", GTK_SIGNAL_FUNC(show_tooltip), NULL);
+ g_signal_connect(G_OBJECT(tray), "query-tooltip", G_CALLBACK(show_tooltip), NULL);
g_timeout_add(10000, update, NULL);
/* trigger icon refresh in update() below */
diff --git a/config.mk b/config.mk
index 21ce002..9b68792 100644
--- a/config.mk
+++ b/config.mk
@@ -39,8 +39,8 @@ DEPS += bat_tray.h \
tray.h \
paramano_set_interface.h
-CFLAGS += -I/usr/include/gtk-2.0 \
- -I/usr/lib/gtk-2.0/include \
+CFLAGS += -I/usr/include/gtk-3.0 \
+ -I/usr/lib/gtk-3.0/include \
-I/usr/include/pango-1.0 \
-I/usr/include/cairo \
-I/usr/include/gdk-pixbuf-2.0 \
@@ -51,6 +51,6 @@ CFLAGS += -I/usr/include/gtk-2.0 \
-D_=gettext \
$(DEFS)
-LDFLAGS += -lgtk-x11-2.0 \
+LDFLAGS += -lgtk-3 \
-lgobject-2.0 \
-lglib-2.0
diff --git a/tray.c b/tray.c
index edbe355..a682b86 100644
--- a/tray.c
+++ b/tray.c
@@ -107,14 +107,14 @@ static void tray_generate_menu()
if (g_strcmp0(current_governor, "userspace") == 0 && gf_freqi(0, i) == current_frequency)
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item), TRUE);
- g_signal_connect(G_OBJECT(item), "toggled", GTK_SIGNAL_FUNC(freq_menu_item_toggled), GINT_TO_POINTER(gf_freqi(0, i)));
+ g_signal_connect(G_OBJECT(item), "toggled", G_CALLBACK(freq_menu_item_toggled), GINT_TO_POINTER(gf_freqi(0, i)));
gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
}
/* Add a seperator */
GtkWidget* seperator = gtk_separator_menu_item_new();
- gtk_menu_append(menu, seperator);
+ gtk_menu_shell_append(menu, seperator);
/* Add available governors */
for (i = 0; i < gg_number(); i++)
@@ -128,7 +128,7 @@ static void tray_generate_menu()
if (g_strcmp0(gg_gov(0, i), current_governor) == 0)
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item), TRUE);
- g_signal_connect(G_OBJECT(item), "toggled", GTK_SIGNAL_FUNC(gov_menu_item_toggled), gg_gov(0, i));
+ g_signal_connect(G_OBJECT(item), "toggled", G_CALLBACK(gov_menu_item_toggled), gg_gov(0, i));
gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
}
@@ -303,8 +303,8 @@ void tray_init()
gtk_status_icon_set_from_file(tray, icon_file);
gtk_status_icon_set_has_tooltip(tray, TRUE);
- g_signal_connect(G_OBJECT(tray), "query-tooltip", GTK_SIGNAL_FUNC(show_tooltip), NULL);
- g_signal_connect(G_OBJECT(tray), "popup-menu", GTK_SIGNAL_FUNC(popup_menu), NULL);
+ g_signal_connect(G_OBJECT(tray), "query-tooltip", G_CALLBACK(show_tooltip), NULL);
+ g_signal_connect(G_OBJECT(tray), "popup-menu", G_CALLBACK(popup_menu), NULL);
g_timeout_add(1000, update, NULL);