diff options
Diffstat (limited to 'bindings')
-rw-r--r-- | bindings/vala/ayatana-appindicator-0.1-custom.vala | 9 | ||||
-rw-r--r-- | bindings/vala/examples/CMakeLists.txt | 2 | ||||
-rw-r--r-- | bindings/vala/examples/ayatana-indicator-example.vala | 66 |
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; + } } |