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/Makefile.am | 13 +++-- bindings/vala/appindicator-0.1-custom.vala | 31 ---------- bindings/vala/ayatana-appindicator-0.1-custom.vala | 31 ++++++++++ bindings/vala/examples/Makefile.am | 23 ++++---- .../vala/examples/ayatana-indicator-example.vala | 66 ++++++++++++++++++++++ bindings/vala/examples/indicator-example.vala | 66 ---------------------- 6 files changed, 116 insertions(+), 114 deletions(-) delete mode 100644 bindings/vala/appindicator-0.1-custom.vala create mode 100644 bindings/vala/ayatana-appindicator-0.1-custom.vala create mode 100644 bindings/vala/examples/ayatana-indicator-example.vala delete mode 100644 bindings/vala/examples/indicator-example.vala (limited to 'bindings/vala') diff --git a/bindings/vala/Makefile.am b/bindings/vala/Makefile.am index 703e7a5..2763bc3 100644 --- a/bindings/vala/Makefile.am +++ b/bindings/vala/Makefile.am @@ -16,25 +16,26 @@ VER= endif vapidir = $(datadir)/vala/vapi -vapiprefix = appindicator$(VER)-0.1 +vapiprefix = ayatana-appindicator$(VER)-0.1 vapi_DATA = $(vapiprefix).vapi $(vapiprefix).deps DEPS = $(GTKVAPI) $(vapiprefix).deps: echo $(DEPS) > $@ -$(vapiprefix).vapi: $(top_builddir)/src/AppIndicator$(VER)-0.1.gir \ - $(top_builddir)/src/AppIndicator$(VER)-0.1.metadata \ - appindicator-0.1-custom.vala \ +$(vapiprefix).vapi: $(top_builddir)/src/AyatanaAppIndicator$(VER)-0.1.gir \ + $(top_builddir)/src/AyatanaAppIndicator$(VER)-0.1.metadata \ + ayatana-appindicator-0.1-custom.vala \ $(vapiprefix).deps $(VALA_API_GEN) --library=$(vapiprefix) --girdir=$(srcdir)/src \ - $< $(srcdir)/appindicator-0.1-custom.vala + $< $(srcdir)/ayatana-appindicator-0.1-custom.vala CLEANFILES = $(vapi_DATA) +DISTCLEANFILES = Makefile.in endif endif EXTRA_DIST = \ - appindicator-0.1-custom.vala + ayatana-appindicator-0.1-custom.vala diff --git a/bindings/vala/appindicator-0.1-custom.vala b/bindings/vala/appindicator-0.1-custom.vala deleted file mode 100644 index 9fa51eb..0000000 --- a/bindings/vala/appindicator-0.1-custom.vala +++ /dev/null @@ -1,31 +0,0 @@ -/* - Copyright (C) 2011 Canonical, Ltd. - - This program is free software: you can redistribute it and/or modify it - under the terms of either or both of the following licenses: - - 1) the GNU Lesser General Public License version 3, as published by the - Free Software Foundation; and/or - 2) the GNU Lesser General Public License version 2.1, 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 applicable version of the GNU Lesser General Public - License for more details. - - You should have received a copy of both the GNU Lesser General Public - License version 3 and version 2.1 along with this program. If not, see - - - Authored by Michal Hruby -*/ - -namespace AppIndicator { - [CCode (type_check_function = "IS_APP_INDICATOR", type_id = "app_indicator_get_type ()")] - public class Indicator : GLib.Object { - } -} - -// vim:et:ai:cindent:ts=2 sts=2 sw=2: diff --git a/bindings/vala/ayatana-appindicator-0.1-custom.vala b/bindings/vala/ayatana-appindicator-0.1-custom.vala new file mode 100644 index 0000000..9fa51eb --- /dev/null +++ b/bindings/vala/ayatana-appindicator-0.1-custom.vala @@ -0,0 +1,31 @@ +/* + Copyright (C) 2011 Canonical, Ltd. + + This program is free software: you can redistribute it and/or modify it + under the terms of either or both of the following licenses: + + 1) the GNU Lesser General Public License version 3, as published by the + Free Software Foundation; and/or + 2) the GNU Lesser General Public License version 2.1, 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 applicable version of the GNU Lesser General Public + License for more details. + + You should have received a copy of both the GNU Lesser General Public + License version 3 and version 2.1 along with this program. If not, see + + + Authored by Michal Hruby +*/ + +namespace AppIndicator { + [CCode (type_check_function = "IS_APP_INDICATOR", type_id = "app_indicator_get_type ()")] + public class Indicator : GLib.Object { + } +} + +// vim:et:ai:cindent:ts=2 sts=2 sw=2: 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