diff options
-rw-r--r-- | src/CMakeLists.txt | 29 | ||||
-rw-r--r-- | src/main.c | 32 | ||||
-rw-r--r-- | src/main.vala | 14 |
3 files changed, 52 insertions, 23 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3ee6a65..ca1eb82 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -47,11 +47,6 @@ vala_add(indicator-sound-service accounts-service-user ) vala_add(indicator-sound-service - main.vala - DEPENDS - service -) -vala_add(indicator-sound-service volume-control.vala ) vala_add(indicator-sound-service @@ -110,16 +105,33 @@ set( ) ########################### -# Executable +# Lib ########################### add_definitions( -w ) +add_library( + indicator-sound-service-lib STATIC + ${INDICATOR_SOUND_SOURCES} +) + +target_link_libraries( + indicator-sound-service-lib + ${PULSEAUDIO_LIBRARIES} + ${SOUNDSERVICE_LIBRARIES} +) + +########################### +# Executable +########################### + +include_directories(${CMAKE_BINARY_DIR}) + add_executable( indicator-sound-service-bin - ${INDICATOR_SOUND_SOURCES} + main.c ) set_target_properties( @@ -130,8 +142,7 @@ set_target_properties( target_link_libraries( indicator-sound-service-bin - ${PULSEAUDIO_LIBRARIES} - ${SOUNDSERVICE_LIBRARIES} + indicator-sound-service-lib ) ########################### diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..f8635c8 --- /dev/null +++ b/src/main.c @@ -0,0 +1,32 @@ +/* main.c generated by valac 0.22.1, the Vala compiler + * generated from main.vala, do not modify */ + + +#include <glib.h> +#include <locale.h> +#include <libnotify/notify.h> + +#include "indicator-sound-service.h" +#include "config.h" + +int +main (int argc, char ** argv) { + gint result = 0; + IndicatorSoundService* service = NULL; + + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); + setlocale (LC_ALL, ""); + bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR); + + /* Initialize libnotify */ + notify_init ("indicator-sound"); + + + service = indicator_sound_service_new (); + result = indicator_sound_service_run (service); + g_object_unref(service); + + return result; +} + + diff --git a/src/main.vala b/src/main.vala deleted file mode 100644 index 4da9e58..0000000 --- a/src/main.vala +++ /dev/null @@ -1,14 +0,0 @@ - -[CCode (cheader_filename="libintl.h", type="char *")] -extern unowned string bind_textdomain_codeset (string domainname, string codeset); - -static int main (string[] args) { - bind_textdomain_codeset (Config.GETTEXT_PACKAGE, "UTF-8"); - Intl.setlocale (LocaleCategory.ALL, ""); - Intl.bindtextdomain (Config.GETTEXT_PACKAGE, Config.GNOMELOCALEDIR); - - Notify.init ("indicator-sound"); - - var service = new IndicatorSound.Service (); - return service.run (); -} |