1 /* $Id$ */
2 /*-
3  * Copyright (c) 2003-2006 Benedikt Meurer <benny@xfce.org>
4  * All rights reserved.
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free
18  * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA 02110-1301 USA
20  */
21 
22 /**
23  * SECTION: xfce-license
24  * @title: Software Licenses
25  * @short_description: Software Licenses
26  *
27  */
28 #ifdef HAVE_CONFIG_H
29 #include <config.h>
30 #endif
31 
32 #include <libxfce4util/libxfce4util-private.h>
33 #include <libxfce4util/libxfce4util-alias.h>
34 
35 #ifdef __SUNPRO_C
36 #pragma align 4 (xfce_builtin_license_BSD)
37 #endif
38 #ifdef __GNUC__
39 static const char xfce_builtin_license_BSD[] __attribute__ ((__aligned__ (4))) =
40 #else
41 static const char xfce_builtin_license_BSD[] =
42 #endif
43   N_ (" Redistribution and use in source and binary forms, with or without\n"
44       " modification, are permitted provided that the following conditions\n"
45       " are met:\n"
46       "\n"
47       " 1. Redistributions of source code must retain the above copyright\n"
48       "    notice, this list of conditions and the following disclaimer.\n"
49       " 2. Redistributions in binary form must reproduce the above copyright\n"
50       "    notice, this list of conditions and the following disclaimer in the\n"
51       "    documentation and/or other materials provided with the distribution.\n"
52       "\n"
53       " THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n"
54       " IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n"
55       " OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n"
56       " IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n"
57       " INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n"
58       " NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n"
59       " DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n"
60       " THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n"
61       " (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n"
62       " THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n");
63 
64 #ifdef __SUNPRO_C
65 #pragma align 4 (xfce_builtin_license_GPL)
66 #endif
67 #ifdef __GNUC__
68 static const char xfce_builtin_license_GPL[] __attribute__ ((__aligned__ (4))) =
69 #else
70 static const char xfce_builtin_license_GPL[] =
71 #endif
72   N_ ("This program is free software; you can redistribute it and/or modify it\n"
73       "under the terms of the GNU General Public License as published by the Free\n"
74       "Software Foundation; either version 2 of the License, or (at your option)\n"
75       "any later version.\n"
76       "\n"
77       "This program is distributed in the hope that it will be useful, but WITHOUT\n"
78       "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n"
79       "FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for\n"
80       "more details.\n"
81       "\n"
82       "You should have received a copy of the GNU General Public License along with\n"
83       "this program; if not, write to the Free Software Foundation, Inc., 51 Franklin\n"
84       "Street, Fifth Floor, Boston, MA 02110-1301, USA.\n");
85 
86 #ifdef __SUNPRO_C
87 #pragma align 4 (xfce_builtin_license_LGPL)
88 #endif
89 #ifdef __GNUC__
90 static const char xfce_builtin_license_LGPL[] __attribute__ ((__aligned__ (4))) =
91 #else
92 static const char xfce_builtin_license_LGPL[] =
93 #endif
94   N_ ("This library is free software; you can redistribute it and/or\n"
95       "modify it under the terms of the GNU Library General Public\n"
96       "License as published by the Free Software Foundation; either\n"
97       "version 2 of the License, or (at your option) any later version.\n"
98       "\n"
99       "This library is distributed in the hope that it will be useful,\n"
100       "but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
101       "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n"
102       "Library General Public License for more details.\n"
103       "\n"
104       "You should have received a copy of the GNU Library General Public\n"
105       "License along with this library; if not, write to the \n"
106       "Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, \n"
107       "Boston, MA 02110-1301  USA.\n");
108 
109 
110 
111 /**
112  * xfce_get_license_text:
113  * @license_type : an #XfceLicenseTextType.
114  *
115  * Returns the text of the software license specified in the
116  * @license_type translated to the current language. If no
117  * translation is available, the english license text will
118  * be returned.
119  *
120  * Return value: the license text for @license_type.
121  **/
122 const gchar*
xfce_get_license_text(XfceLicenseTextType license_type)123 xfce_get_license_text (XfceLicenseTextType license_type)
124 {
125   /* make sure to initialize the i18n support */
126   _xfce_i18n_init ();
127 
128   /* return the appropriate license */
129   switch (license_type)
130     {
131     case XFCE_LICENSE_TEXT_BSD: return _(xfce_builtin_license_BSD);
132     case XFCE_LICENSE_TEXT_GPL: return _(xfce_builtin_license_GPL);
133     default:                    return _(xfce_builtin_license_LGPL);
134     }
135 }
136 
137 
138 
139 #define __XFCE_LICENSE_C__
140 #include <libxfce4util/libxfce4util-aliasdef.c>
141