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/mono/examples/AyatanaIndicatorExample.cs | 61 ++++++++++++++++++++++ bindings/mono/examples/IndicatorExample.cs | 61 ---------------------- bindings/mono/examples/Makefile.am | 7 +-- .../mono/examples/ayatana-indicator-example.in | 2 + bindings/mono/examples/indicator-example.in | 2 - 5 files changed, 67 insertions(+), 66 deletions(-) create mode 100644 bindings/mono/examples/AyatanaIndicatorExample.cs delete mode 100644 bindings/mono/examples/IndicatorExample.cs create mode 100755 bindings/mono/examples/ayatana-indicator-example.in delete mode 100755 bindings/mono/examples/indicator-example.in (limited to 'bindings/mono/examples') diff --git a/bindings/mono/examples/AyatanaIndicatorExample.cs b/bindings/mono/examples/AyatanaIndicatorExample.cs new file mode 100644 index 0000000..35f3c79 --- /dev/null +++ b/bindings/mono/examples/AyatanaIndicatorExample.cs @@ -0,0 +1,61 @@ +/* + * Copyright 2009 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: + * Cody Russell + */ + +using Gtk; +using AyatanaAppIndicator; + +public class IndicatorExample +{ + public static void Main () + { + Application.Init (); + + Window win = new Window ("Test"); + win.Resize (200, 200); + + Label label = new Label (); + label.Text = "Hello, world!"; + + win.Add (label); + + ApplicationIndicator indicator = new ApplicationIndicator ("Example", + "applications-microblogging-panel", + AppIndicatorCategory.ApplicationStatus); + + indicator.AppIndicatorStatus = AppIndicatorStatus.Attention; + + Menu menu = new Menu (); + var foo = new MenuItem ("Foo"); + menu.Append (foo); + foo.Activated += delegate { + System.Console.WriteLine ("Foo item has been activated"); + }; + + menu.Append (new MenuItem ("Bar")); + + indicator.Menu = menu; + indicator.Menu.ShowAll (); + + indicator.SecondaryActivateTarget = foo; + + win.ShowAll (); + + Application.Run (); + } +} diff --git a/bindings/mono/examples/IndicatorExample.cs b/bindings/mono/examples/IndicatorExample.cs deleted file mode 100644 index 7413c54..0000000 --- a/bindings/mono/examples/IndicatorExample.cs +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2009 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: - * Cody Russell - */ - -using Gtk; -using AppIndicator; - -public class IndicatorExample -{ - public static void Main () - { - Application.Init (); - - Window win = new Window ("Test"); - win.Resize (200, 200); - - Label label = new Label (); - label.Text = "Hello, world!"; - - win.Add (label); - - ApplicationIndicator indicator = new ApplicationIndicator ("Example", - "applications-microblogging-panel", - Category.ApplicationStatus); - - indicator.Status = Status.Attention; - - Menu menu = new Menu (); - var foo = new MenuItem ("Foo"); - menu.Append (foo); - foo.Activated += delegate { - System.Console.WriteLine ("Foo item has been activated"); - }; - - menu.Append (new MenuItem ("Bar")); - - indicator.Menu = menu; - indicator.Menu.ShowAll (); - - indicator.SecondaryActivateTarget = foo; - - win.ShowAll (); - - Application.Run (); - } -} diff --git a/bindings/mono/examples/Makefile.am b/bindings/mono/examples/Makefile.am index b929492..de93b20 100644 --- a/bindings/mono/examples/Makefile.am +++ b/bindings/mono/examples/Makefile.am @@ -1,10 +1,11 @@ -ASSEMBLY = IndicatorExample.exe -CSFILES = IndicatorExample.cs +ASSEMBLY = AyatanaIndicatorExample.exe +CSFILES = AyatanaIndicatorExample.cs CLEANFILES = $(ASSEMBLY) +DISTCLEANFILES = Makefile.in EXTRA_DIST = $(CSFILES) -references = $(GTK_SHARP_LIBS) -r:$(top_builddir)/bindings/mono/appindicator-sharp.dll +references = $(GTK_SHARP_LIBS) -r:$(top_builddir)/bindings/mono/ayatana-appindicator-sharp.dll $(ASSEMBLY): $(CSFILES) Makefile.am $(CSC) $(CSFLAGS) -out:$(ASSEMBLY) -target:exe $(references) $(srcdir)/$(CSFILES) diff --git a/bindings/mono/examples/ayatana-indicator-example.in b/bindings/mono/examples/ayatana-indicator-example.in new file mode 100755 index 0000000..07d1473 --- /dev/null +++ b/bindings/mono/examples/ayatana-indicator-example.in @@ -0,0 +1,2 @@ +#!/bin/sh +MONO_PATH=@top_builddir@/bindings/mono @top_builddir@/bindings/mono/examples/AyatanaIndicatorExample.exe diff --git a/bindings/mono/examples/indicator-example.in b/bindings/mono/examples/indicator-example.in deleted file mode 100755 index 3eca155..0000000 --- a/bindings/mono/examples/indicator-example.in +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -MONO_PATH=@top_builddir@/bindings/mono @top_builddir@/bindings/mono/examples/IndicatorExample.exe -- cgit v1.2.3