From d32524e211f7af301845b5db518d818b77831205 Mon Sep 17 00:00:00 2001 From: Robert Tari Date: Tue, 6 Sep 2022 03:21:41 +0200 Subject: Rewrite to indicator-ng: Code and build changes --- src/main.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 src/main.c (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..6cc5103 --- /dev/null +++ b/src/main.c @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Robert Tari + * + * Authors: + * 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 + * 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 . + */ + +#include +#include +#include +#include "indicator-printers-service.h" + +static void onNameLost (gpointer pInstance G_GNUC_UNUSED, gpointer pLoop) +{ + g_message("Exiting: service couldn't acquire or lost ownership of busname"); + g_main_loop_quit ((GMainLoop*) pLoop); +} + +int main (int argc G_GNUC_UNUSED, char **argv G_GNUC_UNUSED) +{ + setlocale (LC_ALL, ""); + bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); + textdomain (GETTEXT_PACKAGE); + + IndicatorPrintersService *pService = indicator_printers_service_new (NULL); + GMainLoop *pLoop = g_main_loop_new (NULL, FALSE); + g_signal_connect (pService, "name-lost", G_CALLBACK (onNameLost), pLoop); + g_main_loop_run (pLoop); + + g_main_loop_unref (pLoop); + g_clear_object (&pService); + + return 0; +} -- cgit v1.2.3