aboutsummaryrefslogtreecommitdiff
path: root/bindings
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-02-02 09:58:36 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-02-02 09:58:36 +0100
commit4f9c4e93f3a7808cc838cba4cdb460d66d315786 (patch)
treed9a654fd20e9e75935c450b115076099eb99b857 /bindings
parentf225dccbd82f48bb1ab10767b9b074e24fedb0f3 (diff)
parent694ab4eec294a93358f78a349c6df94c3b666126 (diff)
downloadlibayatana-appindicator-4f9c4e93f3a7808cc838cba4cdb460d66d315786.tar.gz
libayatana-appindicator-4f9c4e93f3a7808cc838cba4cdb460d66d315786.tar.bz2
libayatana-appindicator-4f9c4e93f3a7808cc838cba4cdb460d66d315786.zip
Merge branch 'tari01-pr/fix-build-warnings'
Attributes GH PR #59: https://github.com/AyatanaIndicators/libayatana-appindicator/pull/59
Diffstat (limited to 'bindings')
-rw-r--r--bindings/vala/ayatana-appindicator-0.1-custom.vala9
-rw-r--r--bindings/vala/examples/CMakeLists.txt2
-rw-r--r--bindings/vala/examples/ayatana-indicator-example.vala66
3 files changed, 41 insertions, 36 deletions
diff --git a/bindings/vala/ayatana-appindicator-0.1-custom.vala b/bindings/vala/ayatana-appindicator-0.1-custom.vala
index 9fa51eb..4cf9e3e 100644
--- a/bindings/vala/ayatana-appindicator-0.1-custom.vala
+++ b/bindings/vala/ayatana-appindicator-0.1-custom.vala
@@ -1,5 +1,6 @@
/*
- Copyright (C) 2011 Canonical, Ltd.
+ Copyright 2011 Canonical, Ltd.
+ Copyright 2022 Robert Tari
This program is free software: you can redistribute it and/or modify it
under the terms of either or both of the following licenses:
@@ -19,11 +20,13 @@
License version 3 and version 2.1 along with this program. If not, see
<http://www.gnu.org/licenses/>
- Authored by Michal Hruby <michal.hruby@canonical.com>
+ Authors:
+ Michal Hruby <michal.hruby@canonical.com>
+ Robert Tari <robert@tari.in>
*/
namespace AppIndicator {
- [CCode (type_check_function = "IS_APP_INDICATOR", type_id = "app_indicator_get_type ()")]
+ [CCode (type_check_function = "APP_IS_INDICATOR", type_id = "app_indicator_get_type ()")]
public class Indicator : GLib.Object {
}
}
diff --git a/bindings/vala/examples/CMakeLists.txt b/bindings/vala/examples/CMakeLists.txt
index b747208..2751096 100644
--- a/bindings/vala/examples/CMakeLists.txt
+++ b/bindings/vala/examples/CMakeLists.txt
@@ -21,7 +21,7 @@ add_custom_command(
# ayatana-indicator-example
-set_source_files_properties("${CMAKE_CURRENT_BINARY_DIR}/ayatana-indicator-example.c" PROPERTIES COMPILE_FLAGS " -include ${CMAKE_SOURCE_DIR}/src/app-indicator.h")
+set_source_files_properties("${CMAKE_CURRENT_BINARY_DIR}/ayatana-indicator-example.c" PROPERTIES COMPILE_FLAGS " -include ${CMAKE_SOURCE_DIR}/src/app-indicator.h -Wno-incompatible-pointer-types")
add_executable("ayatana-indicator-example" "${CMAKE_CURRENT_BINARY_DIR}/ayatana-indicator-example.c")
target_include_directories("ayatana-indicator-example" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS})
target_link_libraries("ayatana-indicator-example" "${PROJECT_DEPS_LIBRARIES} -layatana-appindicator3 -L${CMAKE_BINARY_DIR}/src")
diff --git a/bindings/vala/examples/ayatana-indicator-example.vala b/bindings/vala/examples/ayatana-indicator-example.vala
index 764009f..55535ab 100644
--- a/bindings/vala/examples/ayatana-indicator-example.vala
+++ b/bindings/vala/examples/ayatana-indicator-example.vala
@@ -1,5 +1,6 @@
/*
* Copyright 2011 Canonical Ltd.
+ * Copyright 2022 Robert Tari
*
* 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
@@ -15,52 +16,53 @@
*
* Authors:
* Marco Trevisan (TreviƱo) <mail@3v1n0.net>
+ * Robert Tari <robert@tari.in>
*/
using Gtk;
using AppIndicator;
public class IndicatorExample {
- public static int main(string[] args) {
- Gtk.init(ref args);
+ 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 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 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;
+ 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");
+ indicator.set_status(IndicatorStatus.ACTIVE);
+ indicator.set_attention_icon_full("indicator-messages-new", null);
- var menu = new Gtk.Menu();
+ 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 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);
+ 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);
+ indicator.set_menu(menu);
+ indicator.set_secondary_activate_target(bar);
- win.show_all();
+ win.show_all();
- Gtk.main();
- return 0;
- }
+ Gtk.main();
+ return 0;
+ }
}