X-Git-Url: https://git.decadent.org.uk/gitweb/?p=ion3.git;a=blobdiff_plain;f=ioncore%2Fioncore.c;h=0675d0a83c6b8bcfdfd5daa58443ecc972eadd12;hp=49da6c715f4dc04d7f3c80fd8e1a416c31bfff41;hb=e3aec18706513a87eaa7839dfdaf7e0fcd0d8d2a;hpb=de22e45179cb3bafa490294d31d47f361047a30a diff --git a/ioncore/ioncore.c b/ioncore/ioncore.c index 49da6c7..0675d0a 100644 --- a/ioncore/ioncore.c +++ b/ioncore/ioncore.c @@ -1,12 +1,9 @@ /* * ion/ioncore/ioncore.c * - * Copyright (c) Tuomo Valkonen 1999-2007. + * Copyright (c) Tuomo Valkonen 1999-2009. * - * Ion 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.1 of the License, or - * (at your option) any later version. + * See the included file LICENSE for details. */ #include @@ -14,14 +11,18 @@ #include #include #include +#include #include #include #include #ifndef CF_NO_LOCALE #include #include +#endif +#ifndef CF_NO_GETTEXT #include #endif +#include #include #include @@ -58,6 +59,7 @@ #include "llist.h" #include "exec.h" #include "screen-notify.h" +#include "key.h" #include "../version.h" @@ -72,18 +74,18 @@ WGlobal ioncore_g; static const char *progname="ion"; static const char ioncore_copy[]= - "Ion " ION_VERSION ", copyright (c) Tuomo Valkonen 1999-2007."; + "Ion " ION_VERSION ", copyright (c) Tuomo Valkonen 1999-2009."; static const char ioncore_license[]=DUMMY_TR( - "This program is free software; you can redistribute it and/or\n" - "modify it under the terms of the GNU Lesser General Public\n" - "License as published by the Free Software Foundation; either\n" - "version 2.1 of the License, or (at your option) any later version.\n" + "This software is licensed under the GNU Lesser General Public License\n" + "(LGPL), version 2.1, extended with terms applying to the use of the name\n" + "of the project, Ion(tm), unless otherwise indicated in components taken\n" + "from elsewhere. For details, see the file LICENSE that you should have\n" + "received with this software.\n" "\n" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" - "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n" - "Lesser General Public License for more details.\n"); + "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"); static const char *ioncore_about=NULL; @@ -98,12 +100,23 @@ WHook *ioncore_deinit_hook=NULL; /*{{{ warn_nolog */ -void ioncore_warn_nolog(const char *str) +void ioncore_warn_nolog(const char *str, ...) { - fprintf(stderr, "%s: %s\n", libtu_progname(), str); + va_list args; + + va_start(args, str); + + if(ioncore_g.opmode==IONCORE_OPMODE_INIT){ + fprintf(stderr, "%s: ", libtu_progname()); + vfprintf(stderr, str, args); + fprintf(stderr, "\n"); + }else{ + warn_v(str, args); + } + + va_end(args); } - /*}}}*/ @@ -182,7 +195,7 @@ static bool check_encoding() } if(mbtowc(NULL, NULL, 0)!=0){ - warn("Statefull encodings are unsupported."); + warn(TR("Statefull encodings are unsupported.")); return FALSE; } @@ -192,11 +205,11 @@ static bool check_encoding() return TRUE; integr_err: - warn("Cannot verify locale encoding setting integrity " - "(LC_CTYPE=%s, nl_langinfo(CODESET)=%s). " - "The LC_CTYPE environment variable should be of the form " - "language_REGION.encoding (e.g. en_GB.UTF-8), and encoding " - "should match the nl_langinfo value above.", ctype, langi); + warn(TR("Cannot verify locale encoding setting integrity " + "(LC_CTYPE=%s, nl_langinfo(CODESET)=%s). " + "The LC_CTYPE environment variable should be of the form " + "language_REGION.encoding (e.g. en_GB.UTF-8), and encoding " + "should match the nl_langinfo value above."), ctype, langi); return FALSE; } @@ -230,6 +243,10 @@ static bool init_locale() return FALSE; } +#endif + +#ifndef CF_NO_GETTEXT + #define TEXTDOMAIN "ion3" static bool init_messages(const char *localedir) @@ -273,9 +290,9 @@ static bool init_hooks() INIT_HOOK_(clientwin_mapped_hook); INIT_HOOK_(clientwin_unmapped_hook); INIT_HOOK_(clientwin_property_change_hook); + INIT_HOOK_(ioncore_submap_ungrab_hook); INIT_HOOK_(region_notify_hook); - ADD_HOOK_(region_notify_hook, ioncore_frame_quasiactivation_notify); ADD_HOOK_(region_notify_hook, ioncore_screen_activity_notify); INIT_HOOK(clientwin_do_manage_alt, clientwin_do_manage_default); @@ -384,6 +401,8 @@ bool ioncore_init(const char *prog, int argc, char *argv[], #ifndef CF_NO_LOCALE init_locale(); +#endif +#ifndef CF_NO_GETTEXT init_messages(localedir); #endif @@ -504,6 +523,7 @@ static bool ioncore_init_x(const char *display, int stflags) ioncore_g.atom_wm_window_role=XInternAtom(dpy, "WM_WINDOW_ROLE", False); ioncore_g.atom_checkcode=XInternAtom(dpy, "_ION_CWIN_RESTART_CHECKCODE", False); ioncore_g.atom_selection=XInternAtom(dpy, "_ION_SELECTION_STRING", False); + ioncore_g.atom_dockapp_hack=XInternAtom(dpy, "_ION_DOCKAPP_HACK", False); ioncore_g.atom_mwm_hints=XInternAtom(dpy, "_MOTIF_WM_HINTS", False); ioncore_init_xim();