From def21c26e7c517b3abd8db299b8601742bccbafd Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Mon, 9 Nov 2015 20:58:24 +0100 Subject: Fork from Ubuntu's libappindicator project. --- bindings/vala/examples/Makefile.am | 23 ++++---- .../vala/examples/ayatana-indicator-example.vala | 66 ++++++++++++++++++++++ bindings/vala/examples/indicator-example.vala | 66 ---------------------- 3 files changed, 78 insertions(+), 77 deletions(-) create mode 100644 bindings/vala/examples/ayatana-indicator-example.vala delete mode 100644 bindings/vala/examples/indicator-example.vala (limited to 'bindings/vala/examples') diff --git a/bindings/vala/examples/Makefile.am b/bindings/vala/examples/Makefile.am index 67ad932..315447c 100644 --- a/bindings/vala/examples/Makefile.am +++ b/bindings/vala/examples/Makefile.am @@ -4,36 +4,37 @@ else VER= endif -VALAFILES = indicator-example.vala +VALAFILES = ayatana-indicator-example.vala EXTRA_DIST = $(VALAFILES) VALAFLAGS = \ - --pkg appindicator$(VER)-0.1 \ + --pkg ayatana-appindicator$(VER)-0.1 \ --vapidir=$(top_builddir)/bindings/vala \ --save-temps if HAVE_VALAC -BUILT_SOURCES = indicator-example.c +BUILT_SOURCES = ayatana-indicator-example.c -indicator-example.c: $(VALAFILES) Makefile.am +ayatana-indicator-example.c: $(VALAFILES) Makefile.am $(VALAC) $(VALAFLAGS) -C $< -o $@ - $(SED) -i "s|#include\s*<\s*libappindicator/app-indicator.h\s*>||g" $@ + $(SED) -i "s|#include\s*<\s*libayatana-appindicator/app-indicator.h\s*>||g" $@ -nodist_indicator_example_SOURCES = indicator-example.c -indicator_example_CFLAGS = \ +nodist_ayatana_indicator_example_SOURCES = ayatana-indicator-example.c +ayatana_indicator_example_CFLAGS = \ $(LIBRARY_CFLAGS) \ -Wall \ -I$(top_srcdir)/src \ -include $(top_srcdir)/src/app-indicator.h -indicator_example_LDADD = \ +ayatana_indicator_example_LDADD = \ $(LIBRARY_LIBS) \ - $(top_builddir)/src/libappindicator$(VER).la + $(top_builddir)/src/libayatana-appindicator$(VER).la -check_PROGRAMS = indicator-example +check_PROGRAMS = ayatana-indicator-example CLEANFILES = \ *.c \ - indicator-example + ayatana-indicator-example +DISTCLEANFILES = Makefile.in endif diff --git a/bindings/vala/examples/ayatana-indicator-example.vala b/bindings/vala/examples/ayatana-indicator-example.vala new file mode 100644 index 0000000..764009f --- /dev/null +++ b/bindings/vala/examples/ayatana-indicator-example.vala @@ -0,0 +1,66 @@ +/* + * Copyright 2011 Canonical Ltd. + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 3, as published + * by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranties of + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + * + * Authors: + * Marco Trevisan (Treviño) + */ + +using Gtk; +using AppIndicator; + +public class IndicatorExample { + public static int main(string[] args) { + Gtk.init(ref args); + + var win = new Window(); + win.title = "Indicator Test"; + win.resize(200, 200); + win.destroy.connect(Gtk.main_quit); + + var label = new Label("Hello, world!"); + win.add(label); + + var indicator = new Indicator(win.title, "indicator-messages", + IndicatorCategory.APPLICATION_STATUS); + if (!(indicator is Indicator)) return -1; + + indicator.set_status(IndicatorStatus.ACTIVE); + indicator.set_attention_icon("indicator-messages-new"); + + var menu = new Gtk.Menu(); + + var item = new Gtk.MenuItem.with_label("Foo"); + item.activate.connect(() => { + indicator.set_status(IndicatorStatus.ATTENTION); + }); + item.show(); + menu.append(item); + + var bar = item = new Gtk.MenuItem.with_label("Bar"); + item.show(); + item.activate.connect(() => { + indicator.set_status(IndicatorStatus.ACTIVE); + }); + menu.append(item); + + indicator.set_menu(menu); + indicator.set_secondary_activate_target(bar); + + win.show_all(); + + Gtk.main(); + return 0; + } +} diff --git a/bindings/vala/examples/indicator-example.vala b/bindings/vala/examples/indicator-example.vala deleted file mode 100644 index 764009f..0000000 --- a/bindings/vala/examples/indicator-example.vala +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2011 Canonical Ltd. - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 3, as published - * by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranties of - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - * - * Authors: - * Marco Trevisan (Treviño) - */ - -using Gtk; -using AppIndicator; - -public class IndicatorExample { - public static int main(string[] args) { - Gtk.init(ref args); - - var win = new Window(); - win.title = "Indicator Test"; - win.resize(200, 200); - win.destroy.connect(Gtk.main_quit); - - var label = new Label("Hello, world!"); - win.add(label); - - var indicator = new Indicator(win.title, "indicator-messages", - IndicatorCategory.APPLICATION_STATUS); - if (!(indicator is Indicator)) return -1; - - indicator.set_status(IndicatorStatus.ACTIVE); - indicator.set_attention_icon("indicator-messages-new"); - - var menu = new Gtk.Menu(); - - var item = new Gtk.MenuItem.with_label("Foo"); - item.activate.connect(() => { - indicator.set_status(IndicatorStatus.ATTENTION); - }); - item.show(); - menu.append(item); - - var bar = item = new Gtk.MenuItem.with_label("Bar"); - item.show(); - item.activate.connect(() => { - indicator.set_status(IndicatorStatus.ACTIVE); - }); - menu.append(item); - - indicator.set_menu(menu); - indicator.set_secondary_activate_target(bar); - - win.show_all(); - - Gtk.main(); - return 0; - } -} -- cgit v1.2.3