From 4dc5558f19f96858ec2a97d82b23b6401ed74a0b Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Mon, 2 Jan 2012 17:07:59 +0100 Subject: Bug #353743 - Add Print button to meeting notification dialog --- calendar/alarm-notify/notify-main.c | 110 ++++++++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 calendar/alarm-notify/notify-main.c (limited to 'calendar/alarm-notify/notify-main.c') diff --git a/calendar/alarm-notify/notify-main.c b/calendar/alarm-notify/notify-main.c new file mode 100644 index 0000000000..a6d9d53fc5 --- /dev/null +++ b/calendar/alarm-notify/notify-main.c @@ -0,0 +1,110 @@ +/* + * Evolution calendar - Alarm notification service main file + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with the program; if not, see + * + * + * Authors: + * Federico Mena-Quintero + * Rodrigo Moya + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +#include + +#include "alarm-notify.h" + +#ifdef G_OS_WIN32 +#include +#include +#ifndef PROCESS_DEP_ENABLE +#define PROCESS_DEP_ENABLE 0x00000001 +#endif +#ifndef PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION +#define PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION 0x00000002 +#endif +#endif + +#include "e-util/e-util-private.h" + +gint +main (gint argc, + gchar **argv) +{ + AlarmNotify *alarm_notify_service; + gint exit_status; + GError *error = NULL; +#ifdef G_OS_WIN32 + gchar *path; + + /* Reduce risks */ + { + typedef BOOL (WINAPI *t_SetDllDirectoryA) (LPCSTR lpPathName); + t_SetDllDirectoryA p_SetDllDirectoryA; + + p_SetDllDirectoryA = GetProcAddress (GetModuleHandle ("kernel32.dll"), "SetDllDirectoryA"); + if (p_SetDllDirectoryA) + (*p_SetDllDirectoryA) (""); + } +#ifndef _WIN64 + { + typedef BOOL (WINAPI *t_SetProcessDEPPolicy) (DWORD dwFlags); + t_SetProcessDEPPolicy p_SetProcessDEPPolicy; + + p_SetProcessDEPPolicy = GetProcAddress (GetModuleHandle ("kernel32.dll"), "SetProcessDEPPolicy"); + if (p_SetProcessDEPPolicy) + (*p_SetProcessDEPPolicy) (PROCESS_DEP_ENABLE | PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION); + } +#endif +#endif + + bindtextdomain (GETTEXT_PACKAGE, EVOLUTION_LOCALEDIR); + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); + textdomain (GETTEXT_PACKAGE); + + gtk_init (&argc, &argv); + + e_gdbus_templates_init_main_thread (); + +#ifdef G_OS_WIN32 + path = g_build_path (";", _e_get_bindir (), g_getenv ("PATH"), NULL); + + if (!g_setenv ("PATH", path, TRUE)) + g_warning ("Could not set PATH for Evolution Alarm Notifier"); +#endif + + alarm_notify_service = alarm_notify_new (NULL, &error); + + if (error != NULL) { + g_printerr ("%s\n", error->message); + g_error_free (error); + exit (EXIT_FAILURE); + } + + exit_status = g_application_run ( + G_APPLICATION (alarm_notify_service), argc, argv); + + g_object_unref (alarm_notify_service); + + return exit_status; +} -- cgit v1.2.3