diff options
Diffstat (limited to 'bindings')
21 files changed, 366 insertions, 352 deletions
diff --git a/bindings/CMakeLists.txt b/bindings/CMakeLists.txt new file mode 100644 index 0000000..b4fa5de --- /dev/null +++ b/bindings/CMakeLists.txt @@ -0,0 +1,2 @@ +add_subdirectory(vala) +add_subdirectory(mono) diff --git a/bindings/Makefile.am b/bindings/Makefile.am deleted file mode 100644 index 804f729..0000000 --- a/bindings/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -if USE_GTK3 -SUBDIRS = \ - vala -else -SUBDIRS = \ - vala -endif - -if HAS_MONO -SUBDIRS += mono -endif - -DISTCLEANFILES = Makefile.in diff --git a/bindings/mono/ApplicationIndicator.custom b/bindings/mono/ApplicationIndicator.custom deleted file mode 100644 index 4992c08..0000000 --- a/bindings/mono/ApplicationIndicator.custom +++ /dev/null @@ -1,26 +0,0 @@ -[DllImport ("ayatana-appindicator.dll")] -static extern int app_indicator_get_status (IntPtr i); - -[DllImport ("ayatana-appindicator.dll")] -static extern int app_indicator_get_category (IntPtr i); - -[DllImport ("ayatana-appindicator.dll")] -static extern void app_indicator_set_status (IntPtr i, int s); - - [GLib.Property ("status")] - public AppIndicatorStatus AppIndicatorStatus { - get { - return (AppIndicatorStatus) app_indicator_get_status (Handle); - } - - set { - app_indicator_set_status (Handle, (int) value); - } - } - - [GLib.Property ("category")] - public AppIndicatorCategory AppIndicatorCategory { - get { - return (AppIndicatorCategory) app_indicator_get_category (Handle); - } - } diff --git a/bindings/mono/ApplicationIndicatorCustom.cs b/bindings/mono/ApplicationIndicatorCustom.cs new file mode 100644 index 0000000..372b1c1 --- /dev/null +++ b/bindings/mono/ApplicationIndicatorCustom.cs @@ -0,0 +1,40 @@ +using System; +using System.Runtime.InteropServices; + +namespace AyatanaAppIndicator +{ + public partial class ApplicationIndicator : GLib.Object + { + [DllImport ("ayatana-appindicator.dll")] + static extern int app_indicator_get_status (IntPtr i); + + [DllImport ("ayatana-appindicator.dll")] + static extern int app_indicator_get_category (IntPtr i); + + [DllImport ("ayatana-appindicator.dll")] + static extern void app_indicator_set_status (IntPtr i, int s); + + [GLib.Property ("status")] + public AppIndicatorStatus AppIndicatorStatus + { + get + { + return (AppIndicatorStatus) app_indicator_get_status (Handle); + } + + set + { + app_indicator_set_status (Handle, (int) value); + } + } + + [GLib.Property ("category")] + public AppIndicatorCategory AppIndicatorCategory + { + get + { + return (AppIndicatorCategory) app_indicator_get_category (Handle); + } + } + } +} diff --git a/bindings/mono/AssemblyInfo.cs b/bindings/mono/AssemblyInfo.cs index 297eda2..437ce53 100644 --- a/bindings/mono/AssemblyInfo.cs +++ b/bindings/mono/AssemblyInfo.cs @@ -24,7 +24,7 @@ using System.Reflection; [assembly: AssemblyConfiguration ("")] [assembly: AssemblyCompany ("Ayatana Project")] [assembly: AssemblyProduct ("Ayatana AppIndicators")] -[assembly: AssemblyCopyright ("© 2010 Canonical, Ltd.; © 2015 Mike Gabriel")] +[assembly: AssemblyCopyright ("© 2010 Canonical, Ltd.; © 2015 Mike Gabriel; © 2021 Robert Tari")] [assembly: AssemblyTrademark ("")] [assembly: AssemblyCulture ("")] -[assembly: AssemblyVersion ("0.5.5.0")] +[assembly: AssemblyVersion ("0.5.90.0")] diff --git a/bindings/mono/CMakeLists.txt b/bindings/mono/CMakeLists.txt new file mode 100644 index 0000000..2a9d990 --- /dev/null +++ b/bindings/mono/CMakeLists.txt @@ -0,0 +1,203 @@ +# ayatana-appindicator-sharp3-0.1.pc + +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ayatana-appindicator-sharp3-0.1.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/ayatana-appindicator-sharp3-0.1.pc" @ONLY) +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ayatana-appindicator-sharp3-0.1.pc" DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig") + +# ayatana-appindicator-sharp.dll.config + +file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/ayatana-appindicator-sharp.dll.config" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) +install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/ayatana-appindicator-sharp.dll.config" DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/cli/ayatana-appindicator-sharp3-0.1") + +# app-indicator.sources.xml + +file(RELATIVE_PATH REL_BIN ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_BINARY_DIR}) +file(RELATIVE_PATH REL_SRC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}) +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/app-indicator.sources.xml.in" "${CMAKE_CURRENT_BINARY_DIR}/app-indicator.sources.xml" @ONLY) + +# libayatana-appindicator-api.raw + +find_program(GAPI3_PARSER gapi3-parser) + +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator-api.raw" + DEPENDS "src" "${CMAKE_CURRENT_BINARY_DIR}/app-indicator.sources.xml" + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMAND + ${GAPI3_PARSER} + "${CMAKE_CURRENT_BINARY_DIR}/app-indicator.sources.xml" +) + +# libayatana-appindicator-api.middle + +find_program(GAPI3_FIXUP gapi3-fixup) + +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator-api.middle" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator-api.raw" + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMAND + ${CMAKE_COMMAND} + -E copy + "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator-api.raw" + "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator-api.middle" + COMMAND + ${GAPI3_FIXUP} + --api=libayatana-appindicator-api.middle + --metadata="${CMAKE_CURRENT_SOURCE_DIR}/libayatana-appindicator-api.metadata" +) + +# libayatana-appindicator-api.xml + +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator-api.xml" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator-api.middle" + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + VERBATIM + COMMAND + sed + -e "s|PROP_ID_S|id|" + -e "s|PROP_STATUS_S|Status|" + -e "s|PROP_STATUS_S|status|" + -e "s|PROP_CATEGORY_S|Category|" + -e "s|PROP_CATEGORY_S|category|" + -e "s|PROP_ICON_NAME_S|icon-name|" + -e "s|PROP_ICON_DESC_S|IconDesc|" + -e "s|PROP_ICON_DESC_S|icon-desc|" + -e "s|PROP_ATTENTION_ICON_NAME_S|AttentionIconName|" + -e "s|PROP_ATTENTION_ICON_NAME_S|attention-icon-name|" + -e "s|PROP_ATTENTION_ICON_DESC_S|AttentionIconDesc|" + -e "s|PROP_ATTENTION_ICON_DESC_S|attention-icon-desc|" + -e "s|PROP_ICON_THEME_PATH_S|icon-theme-path|" + -e "s|PROP_MENU_S|menu|" + -e "s|PROP_CONNECTED_S|connected|" + -e "s|PROP_LABEL_S|label|" + -e "s|PROP_LABEL_GUIDE_S|label-guide|" + -e "s|PROP_ORDERING_INDEX_S|ordering-index|" + -e "s|PROP_DBUS_MENU_SERVER_S|DbusMenuServer|" + -e "s|PROP_DBUS_MENU_SERVER_S|dbus-menu-server|" + -e "s|PROP_TITLE_S|Title|" + -e "s|PROP_TITLE_S|title|" + "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator-api.middle" > "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator-api.xml" +) + +# AppIndicatorCategory.cs +# NewAttentionIconHandler.cs +# NewStatusHandler.cs +# AppIndicatorStatus.cs +# NewIconHandler.cs +# ObjectManager.cs +# ApplicationIndicator.cs +# NewIconThemePathHandler.cs +# ScrollEventHandler.cs +# ConnectionChangedHandler.cs +# NewLabelHandler.cs + +pkg_check_modules(GTK_SHARP_3_0 REQUIRED gtk-sharp-3.0>=2.99) +string(REPLACE ":" ";-I:" GTK_SHARP_3_0_INCLUDE_DIRS ${GTK_SHARP_3_0_INCLUDE_DIRS}) +find_program(GAPI3_CODEGEN gapi3-codegen) + +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/GtkSharp/ObjectManager.cs" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator/AppIndicatorCategory.cs" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator/NewAttentionIconHandler.cs" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator/NewStatusHandler.cs" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator/AppIndicatorStatus.cs" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator/NewIconHandler.cs" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator/ApplicationIndicator.cs" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator/NewIconThemePathHandler.cs" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator/ScrollEventHandler.cs" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator/ConnectionChangedHandler.cs" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator/NewLabelHandler.cs" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator-api.xml" + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMAND + ${GAPI3_CODEGEN} + --generate libayatana-appindicator-api.xml + --outdir=${CMAKE_CURRENT_BINARY_DIR} + --assembly-name=ayatana-appindicator-sharp + ${GTK_SHARP_3_0_INCLUDE_DIRS} +) + +# ayatana-appindicator-sharp.dll + +pkg_check_modules(MONO REQUIRED mono>=5.18) +find_program(MCS mcs) + +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/ayatana-appindicator-sharp.dll" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/GtkSharp/ObjectManager.cs" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator/AppIndicatorCategory.cs" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator/NewAttentionIconHandler.cs" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator/NewStatusHandler.cs" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator/AppIndicatorStatus.cs" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator/NewIconHandler.cs" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator/ApplicationIndicator.cs" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator/NewIconThemePathHandler.cs" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator/ScrollEventHandler.cs" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator/ConnectionChangedHandler.cs" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator/NewLabelHandler.cs" + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMAND + ${MCS} + -keyfile:"${CMAKE_CURRENT_SOURCE_DIR}/ayatana-appindicator-sharp.snk" + -nowarn:0169,0612,0618 + -unsafe + -out:"${CMAKE_CURRENT_BINARY_DIR}/ayatana-appindicator-sharp.dll" + -target:library + ${GTK_SHARP_3_0_LDFLAGS} "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator/*.cs" "${CMAKE_CURRENT_BINARY_DIR}/GtkSharp/ObjectManager.cs" "${CMAKE_CURRENT_SOURCE_DIR}/AssemblyInfo.cs" "${CMAKE_CURRENT_SOURCE_DIR}/ApplicationIndicatorCustom.cs" +) + +find_program(GACUTIL gacutil) +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ayatana-appindicator-sharp.dll" DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/cli/ayatana-appindicator-sharp3-0.1") +install(CODE "execute_process(WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${GACUTIL} -i ${CMAKE_CURRENT_BINARY_DIR}/ayatana-appindicator-sharp.dll -package ayatana-appindicator-sharp -root ${CMAKE_INSTALL_FULL_LIBDIR})") + +# policy.0.0.ayatana-appindicator-sharp.config + +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/policy.0.0.ayatana-appindicator-sharp.config.in" "${CMAKE_CURRENT_BINARY_DIR}/policy.0.0.ayatana-appindicator-sharp.config" @ONLY) +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/policy.0.0.ayatana-appindicator-sharp.config" DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/cli/ayatana-appindicator-sharp3-0.1") + +# policy.0.0.ayatana-appindicator-sharp.dll + +find_program(AL al) + +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/policy.0.0.ayatana-appindicator-sharp.dll" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/ayatana-appindicator-sharp.dll" + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMAND + ${AL} + -link:"${CMAKE_CURRENT_BINARY_DIR}/policy.0.0.ayatana-appindicator-sharp.config" + -out:"${CMAKE_CURRENT_BINARY_DIR}/policy.0.0.ayatana-appindicator-sharp.dll" + -keyfile:"${CMAKE_CURRENT_SOURCE_DIR}/ayatana-appindicator-sharp.snk" +) + +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/policy.0.0.ayatana-appindicator-sharp.dll" DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/cli/ayatana-appindicator-sharp3-0.1") +install(CODE "execute_process(WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${GACUTIL} -i ${CMAKE_CURRENT_BINARY_DIR}/policy.0.0.ayatana-appindicator-sharp.dll -package ayatana-appindicator-sharp -root ${CMAKE_INSTALL_FULL_LIBDIR})") + +# policy.0.1.ayatana-appindicator-sharp.config + +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/policy.0.1.ayatana-appindicator-sharp.config.in" "${CMAKE_CURRENT_BINARY_DIR}/policy.0.1.ayatana-appindicator-sharp.config" @ONLY) +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/policy.0.1.ayatana-appindicator-sharp.config" DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/cli/ayatana-appindicator-sharp3-0.1") + +# policy.0.1.ayatana-appindicator-sharp.dll + +find_program(AL al) + +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/policy.0.1.ayatana-appindicator-sharp.dll" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/policy.0.0.ayatana-appindicator-sharp.dll" + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMAND + ${AL} + -link:"${CMAKE_CURRENT_BINARY_DIR}/policy.0.1.ayatana-appindicator-sharp.config" + -out:"${CMAKE_CURRENT_BINARY_DIR}/policy.0.1.ayatana-appindicator-sharp.dll" + -keyfile:"${CMAKE_CURRENT_SOURCE_DIR}/ayatana-appindicator-sharp.snk" +) + +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/policy.0.1.ayatana-appindicator-sharp.dll" DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/cli/ayatana-appindicator-sharp3-0.1") + +add_custom_target("bindings-mono" ALL DEPENDS "policy.0.1.ayatana-appindicator-sharp.dll") + +if (ENABLE_TESTS) + add_subdirectory(examples) +endif() diff --git a/bindings/mono/Makefile.am b/bindings/mono/Makefile.am deleted file mode 100644 index 3777e1b..0000000 --- a/bindings/mono/Makefile.am +++ /dev/null @@ -1,177 +0,0 @@ -SUBDIRS = . examples - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = ayatana-appindicator-sharp-0.1.pc - -if BUILD_MONO_TEST -TEST = AyatanaAppIndicator.Test.dll -endif - -API = libayatana-appindicator-api.xml -MIDDLE_API = libayatana-appindicator-api.middle -RAW_API = libayatana-appindicator-api.raw -METADATA = libayatana-appindicator-api.metadata -ASSEMBLY_NAME = ayatana-appindicator-sharp -ASSEMBLY_VERSION = 0.5.5.0 -ASSEMBLY = $(ASSEMBLY_NAME).dll -POLICY = policy.$(POLICY_VERSION).$(ASSEMBLY_NAME) -POLICY_VERSION = 0.0 -DLLPOLICY = $(POLICY).dll -POLICY1 = policy.$(POLICY1_VERSION).$(ASSEMBLY_NAME) -POLICY1_VERSION = 0.1 -DLLPOLICY1 = $(POLICY1).dll -WRAPPER_FREE_BINDING_SRC = $(top_srcdir)/src/app-indicator.c -WRAPPER_FREE_BINDING = app-indicator.c - -TARGET = \ - $(ASSEMBLY) \ - $(ASSEMBLY).config \ - $(DLLPOLICY) \ - $(POLICY).config \ - $(DLLPOLICY1) \ - $(POLICY1).config - -assemblydir = $(libdir)/cli/ayatana-appindicator-sharp-0.1 -assembly_DATA = $(TARGET) - -CLEANFILES = \ - $(ASSEMBLY) \ - $(ASSEMBLY).mdb \ - generated-stamp \ - generated/*.cs \ - $(API) \ - $(MIDDLE_API) \ - $(RAW_API) \ - $(DLLPOLICY) \ - $(DLLPOLICY1) \ - $(WRAPPER_FREE_BINDING) \ - $(POLICY).config \ - $(POLICY1).config - -if BUILD_MONO_TEST -CLEANFILES += $(TEST) -endif - -DISTCLEANFILES = $(ASSEMBLY).config - -if BUILD_MONO_TEST -TEST_SOURCES = TestAyatanaIndicator.cs -endif - -customs = ApplicationIndicator.custom - -EXTRA_DIST = \ - AssemblyInfo.cs \ - $(RAW_API) \ - $(METADATA) \ - ayatana-appindicator-sharp-0.1.pc.in \ - ayatana-appindicator-sharp.dll.config.in \ - app-indicator.sources.xml.in \ - $(ASSEMBLY_NAME).snk \ - $(POLICY).config.in \ - $(POLICY1).config.in \ - $(customs) - -if BUILD_MONO_TEST -EXTRA_DIST += $(TEST_SOURCES) -endif - -GACUTIL_FLAGS=-package $(ASSEMBLY_NAME) -root $(DESTDIR)$(prefix)/lib - -references = $(GTK_SHARP_LIBS) - -if BUILD_MONO_TEST -test_references = $(GTK_SHARP_LIBS) $(NUNIT_LIBS) $(MONO_NUNIT_LIBS) -r:$(ASSEMBLY) -endif - -$(RAW_API): app-indicator.sources.xml $(WRAPPER_FREE_BINDING) - $(GAPI_PARSER) app-indicator.sources.xml - -$(WRAPPER_FREE_BINDING): $(WRAPPER_FREE_BINDING_SRC) - sed '/signals\[X_NEW_LABEL\] /,+6d' $(WRAPPER_FREE_BINDING_SRC) > $(WRAPPER_FREE_BINDING) - -$(MIDDLE_API): $(METADATA) $(RAW_API) - cp $(RAW_API) $(MIDDLE_API) - chmod u+w $(MIDDLE_API) - @if test -n '$(METADATA)'; then \ - echo "$(GAPI_FIXUP) --api=$(MIDDLE_API) --metadata=$(srcdir)/$(METADATA)"; \ - $(GAPI_FIXUP) --api=$(MIDDLE_API) --metadata=$(srcdir)/$(METADATA); \ - fi - -$(API): $(MIDDLE_API) Makefile.am - sed -e "s|PROP_ID_S|id|" \ - -e "s|PROP_STATUS_S|Status|" \ - -e "s|PROP_STATUS_S|status|" \ - -e "s|PROP_CATEGORY_S|Category|" \ - -e "s|PROP_CATEGORY_S|category|" \ - -e "s|PROP_ICON_NAME_S|icon-name|" \ - -e "s|PROP_ICON_DESC_S|IconDesc|" \ - -e "s|PROP_ICON_DESC_S|icon-desc|" \ - -e "s|PROP_ATTENTION_ICON_NAME_S|AttentionIconName|" \ - -e "s|PROP_ATTENTION_ICON_NAME_S|attention-icon-name|" \ - -e "s|PROP_ATTENTION_ICON_DESC_S|AttentionIconDesc|" \ - -e "s|PROP_ATTENTION_ICON_DESC_S|attention-icon-desc|" \ - -e "s|PROP_ICON_THEME_PATH_S|icon-theme-path|" \ - -e "s|PROP_MENU_S|menu|" \ - -e "s|PROP_CONNECTED_S|connected|" \ - -e "s|PROP_LABEL_S|label|" \ - -e "s|PROP_LABEL_GUIDE_S|label-guide|" \ - -e "s|PROP_ORDERING_INDEX_S|ordering-index|" \ - -e "s|PROP_DBUS_MENU_SERVER_S|DbusMenuServer|" \ - -e "s|PROP_DBUS_MENU_SERVER_S|dbus-menu-server|" \ - -e "s|PROP_TITLE_S|Title|" \ - -e "s|PROP_TITLE_S|title|" \ - $< > $@ - -api_includes = $(GTK_SHARP_CFLAGS) - -build_customs = $(addprefix $(srcdir)/, $(customs)) - -generated-stamp: $(API) $(build_customs) - rm -f generated/* && \ - $(GAPI_CODEGEN) --generate $(API) $(api_includes) \ - --customdir=$(srcdir) \ - --outdir=generated --assembly-name=$(ASSEMBLY_NAME) \ - && touch generated-stamp - -$(ASSEMBLY): generated-stamp $(srcdir)/AssemblyInfo.cs - @rm -f $(ASSEMBLY).mdb - $(CSC) $(CSFLAGS) -keyfile:$(srcdir)/$(ASSEMBLY_NAME).snk -nowarn:0169,0612,0618 -unsafe -out:$(ASSEMBLY) -target:library $(references) $(builddir)/$(GENERATED_SOURCES) $(srcdir)/AssemblyInfo.cs - -install-data-local: - echo "$(GACUTIL) -i $(ASSEMBLY_NAME).dll $(GACUTIL_FLAGS)"; \ - $(GACUTIL) -i $(ASSEMBLY_NAME).dll $(GACUTIL_FLAGS) || exit 1; - echo "$(GACUTIL) -i $(DLLPOLICY) $(GACUTIL_FLAGS)"; \ - $(GACUTIL) -i $(DLLPOLICY) $(GACUTIL_FLAGS) || exit 1; - -uninstall-local: - echo "$(GACUTIL) -u $(ASSEMBLY_NAME) $(GACUTIL_FLAGS)"; \ - $(GACUTIL) -u $(ASSEMBLY_NAME) $(GACUTIL_FLAGS) || exit 1; - echo "$(GACUTIL) -u $(DLLPOLICY) $(GACUTIL_FLAGS)"; \ - $(GACUTIL) -u $(POLICY) $(GACUTIL_FLAGS) || exit 1; - -if BUILD_MONO_TEST -$(TEST): $(ASSEMBLY) $(TEST_SOURCES) - $(CSC) -out:$(TEST) -target:library $(test_references) $(srcdir)/$(TEST_SOURCES) - -check: $(TEST) -endif - -$(POLICY).config: $(POLICY).config.in Makefile - sed -e "s|@ASSEMBLY_NAME@|$(ASSEMBLY_NAME)|" \ - -e "s|@ASSEMBLY_VERSION@|$(ASSEMBLY_VERSION)|g" \ - $< > $@ - -$(DLLPOLICY): $(POLICY).config $(ASSEMBLY_NAME).snk Makefile - $(AL) -link:$(POLICY).config -out:$(DLLPOLICY) -keyfile:$(srcdir)/$(ASSEMBLY_NAME).snk - - -$(POLICY1).config: $(POLICY1).config.in Makefile - sed -e "s|@ASSEMBLY_NAME@|$(ASSEMBLY_NAME)|" \ - -e "s|@ASSEMBLY_VERSION@|$(ASSEMBLY_VERSION)|g" \ - $< > $@ - -$(DLLPOLICY1): $(POLICY1).config $(ASSEMBLY_NAME).snk Makefile - $(AL) -link:$(POLICY1).config -out:$(DLLPOLICY1) -keyfile:$(srcdir)/$(ASSEMBLY_NAME).snk - -DISTCLEANFILES += Makefile.in diff --git a/bindings/mono/app-indicator.sources.xml.in b/bindings/mono/app-indicator.sources.xml.in index 9a283ea..4746179 100644 --- a/bindings/mono/app-indicator.sources.xml.in +++ b/bindings/mono/app-indicator.sources.xml.in @@ -1,12 +1,12 @@ <gapi-parser-input> - <api filename="libayatana-appindicator-api.raw"> - <library name="ayatana-appindicator.dll"> - <namespace name="AyatanaAppIndicator"> - <file>@top_builddir@/bindings/mono/app-indicator.c</file> - <file>@top_builddir@/src/app-indicator-enum-types.c</file> - <file>@top_builddir@/src/app-indicator-enum-types.h</file> - <file>@top_srcdir@/src/app-indicator.h</file> - </namespace> - </library> - </api> + <api filename="libayatana-appindicator-api.raw"> + <library name="ayatana-appindicator.dll"> + <namespace name="AyatanaAppIndicator"> + <file>@REL_SRC@src/app-indicator.c</file> + <file>@REL_BIN@src/app-indicator-enum-types.c</file> + <file>@REL_BIN@src/app-indicator-enum-types.h</file> + <file>@REL_SRC@src/app-indicator.h</file> + </namespace> + </library> + </api> </gapi-parser-input> diff --git a/bindings/mono/ayatana-appindicator-sharp.dll.config b/bindings/mono/ayatana-appindicator-sharp.dll.config new file mode 100644 index 0000000..c8f653f --- /dev/null +++ b/bindings/mono/ayatana-appindicator-sharp.dll.config @@ -0,0 +1,7 @@ +<configuration> + <dllmap dll="ayatana-appindicator.dll" target="libayatana-appindicator3.so.1"/> + <dllmap dll="libgtk-3.0-0.dll" target="libgtk-3.0.so.0"/> + <dllmap dll="libglib-2.0-0.dll" target="libglib-2.0.so.0"/> + <dllmap dll="libgobject-2.0-0.dll" target="libgobject-2.0.so.0"/> + <dllmap dll="libgthread-2.0-0.dll" target="libgthread-2.0.so.0"/> +</configuration> diff --git a/bindings/mono/ayatana-appindicator-sharp.dll.config.in b/bindings/mono/ayatana-appindicator-sharp.dll.config.in deleted file mode 100644 index 7061914..0000000 --- a/bindings/mono/ayatana-appindicator-sharp.dll.config.in +++ /dev/null @@ -1,7 +0,0 @@ -<configuration> - <dllmap dll="ayatana-appindicator.dll" target="libayatana-appindicator@LIB_PREFIX@.1@LIB_SUFFIX@"/> - <dllmap dll="libgtk-2.0-0.dll" target="libgtk-2.0@LIB_PREFIX@.0@LIB_SUFFIX@"/> - <dllmap dll="libglib-2.0-0.dll" target="libglib-2.0@LIB_PREFIX@.0@LIB_SUFFIX@"/> - <dllmap dll="libgobject-2.0-0.dll" target="libgobject-2.0@LIB_PREFIX@.0@LIB_SUFFIX@"/> - <dllmap dll="libgthread-2.0-0.dll" target="libgthread-2.0@LIB_PREFIX@.0@LIB_SUFFIX@"/> -</configuration> diff --git a/bindings/mono/ayatana-appindicator-sharp-0.1.pc.in b/bindings/mono/ayatana-appindicator-sharp3-0.1.pc.in index 6c091ed..955e6ba 100644 --- a/bindings/mono/ayatana-appindicator-sharp-0.1.pc.in +++ b/bindings/mono/ayatana-appindicator-sharp3-0.1.pc.in @@ -1,12 +1,12 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -assemblies_dir=${prefix}/lib/cli/ayatana-appindicator-sharp-0.1 +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix} +libdir=@CMAKE_INSTALL_FULL_LIBDIR@ +assemblies_dir=@CMAKE_INSTALL_FULL_LIBDIR@/cli/ayatana-appindicator-sharp3-0.1 Name: ayatana-appindicator-sharp Description: application indicators for .NET -Version: @VERSION@ +Version: @PROJECT_VERSION@ Libraries: ${assemblies_dir}/ayatana-appindicator-sharp.dll ${assemblies_dir}/ayatana-appindicator-sharp.dll.config -Requires: gtk-sharp-2.0 +Requires: gtk-sharp-3.0 Cflags: Libs: -r:${assemblies_dir}/ayatana-appindicator-sharp.dll diff --git a/bindings/mono/examples/CMakeLists.txt b/bindings/mono/examples/CMakeLists.txt new file mode 100644 index 0000000..431a654 --- /dev/null +++ b/bindings/mono/examples/CMakeLists.txt @@ -0,0 +1,20 @@ +# ayatana-indicator-example + +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ayatana-indicator-example.in" "${CMAKE_CURRENT_BINARY_DIR}/ayatana-indicator-example" @ONLY) + +# AyatanaIndicatorExample.exe + +find_program(MONO mono) + +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AyatanaIndicatorExample.exe" + DEPENDS "bindings-mono" + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMAND + ${MCS} + -out:"${CMAKE_CURRENT_BINARY_DIR}/AyatanaIndicatorExample.exe" + -target:exe + ${GTK_SHARP_3_0_LDFLAGS} "-r:${CMAKE_BINARY_DIR}/bindings/mono/ayatana-appindicator-sharp.dll" "${CMAKE_CURRENT_SOURCE_DIR}/AyatanaIndicatorExample.cs" +) + +add_custom_target("bindings-mono-examples" ALL DEPENDS "AyatanaIndicatorExample.exe") diff --git a/bindings/mono/examples/Makefile.am b/bindings/mono/examples/Makefile.am deleted file mode 100644 index de93b20..0000000 --- a/bindings/mono/examples/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -ASSEMBLY = AyatanaIndicatorExample.exe -CSFILES = AyatanaIndicatorExample.cs -CLEANFILES = $(ASSEMBLY) -DISTCLEANFILES = Makefile.in - -EXTRA_DIST = $(CSFILES) - -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) - -all: $(ASSEMBLY) diff --git a/bindings/mono/examples/ayatana-indicator-example.in b/bindings/mono/examples/ayatana-indicator-example.in index 07d1473..3f63b3d 100755 --- a/bindings/mono/examples/ayatana-indicator-example.in +++ b/bindings/mono/examples/ayatana-indicator-example.in @@ -1,2 +1,2 @@ #!/bin/sh -MONO_PATH=@top_builddir@/bindings/mono @top_builddir@/bindings/mono/examples/AyatanaIndicatorExample.exe +MONO_PATH=@CMAKE_BINARY_DIR@/bindings/mono @CMAKE_CURRENT_BINARY_DIR@/AyatanaIndicatorExample.exe diff --git a/bindings/mono/policy.0.0.ayatana-appindicator-sharp.config.in b/bindings/mono/policy.0.0.ayatana-appindicator-sharp.config.in index e1fe0db..0801da0 100644 --- a/bindings/mono/policy.0.0.ayatana-appindicator-sharp.config.in +++ b/bindings/mono/policy.0.0.ayatana-appindicator-sharp.config.in @@ -1,10 +1,10 @@ <configuration> - <runtime> - <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> - <dependentAssembly> - <assemblyIdentity name="@ASSEMBLY_NAME@" publicKeyToken="bcae265d1c7ab4c2" /> - <bindingRedirect oldVersion="0.0.0.0-0.1.0.0" newVersion="@ASSEMBLY_VERSION@"/> - </dependentAssembly> - </assemblyBinding> - </runtime> + <runtime> + <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> + <dependentAssembly> + <assemblyIdentity name="ayatana-appindicator-sharp" publicKeyToken="bcae265d1c7ab4c2" /> + <bindingRedirect oldVersion="0.0.0.0-0.1.0.0" newVersion="@PROJECT_VERSION@.0"/> + </dependentAssembly> + </assemblyBinding> + </runtime> </configuration> diff --git a/bindings/mono/policy.0.1.ayatana-appindicator-sharp.config.in b/bindings/mono/policy.0.1.ayatana-appindicator-sharp.config.in index 0a8f9b1..f5a082d 100644 --- a/bindings/mono/policy.0.1.ayatana-appindicator-sharp.config.in +++ b/bindings/mono/policy.0.1.ayatana-appindicator-sharp.config.in @@ -1,10 +1,10 @@ <configuration> - <runtime> - <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> - <dependentAssembly> - <assemblyIdentity name="@ASSEMBLY_NAME@" publicKeyToken="bcae265d1c7ab4c2" /> - <bindingRedirect oldVersion="0.1.0.0-@ASSEMBLY_VERSION@" newVersion="@ASSEMBLY_VERSION@"/> - </dependentAssembly> - </assemblyBinding> - </runtime> + <runtime> + <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> + <dependentAssembly> + <assemblyIdentity name="ayatana-appindicator-sharp" publicKeyToken="bcae265d1c7ab4c2" /> + <bindingRedirect oldVersion="0.1.0.0-@PROJECT_VERSION@.0" newVersion="@PROJECT_VERSION@.0"/> + </dependentAssembly> + </assemblyBinding> + </runtime> </configuration> diff --git a/bindings/vala/CMakeLists.txt b/bindings/vala/CMakeLists.txt new file mode 100644 index 0000000..6d0aa5d --- /dev/null +++ b/bindings/vala/CMakeLists.txt @@ -0,0 +1,29 @@ +# ayatana-appindicator3-0.1.deps + +install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/ayatana-appindicator3-0.1.deps" DESTINATION "${CMAKE_INSTALL_FULL_DATADIR}/vala/vapi") + +# AyatanaAppIndicator3-0.1.vala + +find_package(Vala REQUIRED QUIET) + +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator3-0.1.vala" + DEPENDS "src" "${CMAKE_BINARY_DIR}/src/AyatanaAppIndicator3-0.1.typelib" + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMAND + ${VAPI_GEN} + --library=ayatana-appindicator3-0.1 + --pkg gtk+-3.0 + --girdir="${CMAKE_SOURCE_DIR}/src" + --metadatadir "${CMAKE_SOURCE_DIR}/src" + "${CMAKE_BINARY_DIR}/src/AyatanaAppIndicator3-0.1.gir" + "${CMAKE_CURRENT_SOURCE_DIR}/ayatana-appindicator-0.1-custom.vala" +) + +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ayatana-appindicator3-0.1.vapi" DESTINATION "${CMAKE_INSTALL_FULL_DATADIR}/vala/vapi") + +add_custom_target("bindings-vala" ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator3-0.1.vala") + +if (ENABLE_TESTS) + add_subdirectory(examples) +endif() diff --git a/bindings/vala/Makefile.am b/bindings/vala/Makefile.am deleted file mode 100644 index 2763bc3..0000000 --- a/bindings/vala/Makefile.am +++ /dev/null @@ -1,41 +0,0 @@ -if HAVE_INTROSPECTION -if HAVE_VAPIGEN - -SUBDIRS = . examples - -######################### -# VAPI Files -######################### - -if USE_GTK3 -GTKVAPI = gtk+-3.0 -VER=3 -else -GTKVAPI = gtk+-2.0 -VER= -endif - -vapidir = $(datadir)/vala/vapi -vapiprefix = ayatana-appindicator$(VER)-0.1 -vapi_DATA = $(vapiprefix).vapi $(vapiprefix).deps -DEPS = $(GTKVAPI) - -$(vapiprefix).deps: - echo $(DEPS) > $@ - -$(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)/ayatana-appindicator-0.1-custom.vala - - -CLEANFILES = $(vapi_DATA) -DISTCLEANFILES = Makefile.in - -endif -endif - -EXTRA_DIST = \ - ayatana-appindicator-0.1-custom.vala diff --git a/bindings/vala/ayatana-appindicator3-0.1.deps b/bindings/vala/ayatana-appindicator3-0.1.deps new file mode 100644 index 0000000..f48ab98 --- /dev/null +++ b/bindings/vala/ayatana-appindicator3-0.1.deps @@ -0,0 +1,3 @@ +gtk+-3.0 +glib-2.0 +Dbusmenu-0.4 diff --git a/bindings/vala/examples/CMakeLists.txt b/bindings/vala/examples/CMakeLists.txt new file mode 100644 index 0000000..f393939 --- /dev/null +++ b/bindings/vala/examples/CMakeLists.txt @@ -0,0 +1,27 @@ +# ayatana-indicator-example.c + +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/ayatana-indicator-example.c" + DEPENDS "bindings-vala" + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND + ${VALA_COMPILER} + --pkg ayatana-appindicator3-0.1 + --pkg gtk+-3.0 + --vapidir=${CMAKE_BINARY_DIR}/bindings/vala + -C ayatana-indicator-example.vala + --metadatadir "${CMAKE_SOURCE_DIR}/src" + --directory=${CMAKE_CURRENT_BINARY_DIR} + VERBATIM + COMMAND + sed + -i "s|#include\\s*<\\s*libayatana-appindicator/app-indicator.h\\s*>||g" + "${CMAKE_CURRENT_BINARY_DIR}/ayatana-indicator-example.c" +) + +# ayatana-indicator-example + +set_source_files_properties("${CMAKE_CURRENT_BINARY_DIR}/ayatana-indicator-example.c" PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} -include ${CMAKE_SOURCE_DIR}/src/app-indicator.h") +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/Makefile.am b/bindings/vala/examples/Makefile.am deleted file mode 100644 index 315447c..0000000 --- a/bindings/vala/examples/Makefile.am +++ /dev/null @@ -1,40 +0,0 @@ -if USE_GTK3 -VER=3 -else -VER= -endif - -VALAFILES = ayatana-indicator-example.vala -EXTRA_DIST = $(VALAFILES) - -VALAFLAGS = \ - --pkg ayatana-appindicator$(VER)-0.1 \ - --vapidir=$(top_builddir)/bindings/vala \ - --save-temps - -if HAVE_VALAC - -BUILT_SOURCES = ayatana-indicator-example.c - -ayatana-indicator-example.c: $(VALAFILES) Makefile.am - $(VALAC) $(VALAFLAGS) -C $< -o $@ - $(SED) -i "s|#include\s*<\s*libayatana-appindicator/app-indicator.h\s*>||g" $@ - -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 -ayatana_indicator_example_LDADD = \ - $(LIBRARY_LIBS) \ - $(top_builddir)/src/libayatana-appindicator$(VER).la - -check_PROGRAMS = ayatana-indicator-example - -CLEANFILES = \ - *.c \ - ayatana-indicator-example -DISTCLEANFILES = Makefile.in - -endif |