summaryrefslogtreecommitdiff
path: root/xfce4-session/xfsm-error.c
blob: f4d9c695f98c52a5684d3fdc387fd99d06a7a1ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
 *  Copyright (c) 2008 Brian Tarricone <bjt23@cornell.edu>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; version 2 of the License ONLY.
 *
 *  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 General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *  MA 02110-1301 USA.
 */

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <dbus/dbus-glib.h>

#include <xfce4-session/xfsm-error.h>


GQuark
xfsm_error_get_quark (void)
{
  static GQuark xfsm_error_quark = 0;

  if (G_UNLIKELY (xfsm_error_quark == 0))
    xfsm_error_quark = g_quark_from_static_string ("xfsm-error-quark");

  return xfsm_error_quark;
}


GType
xfsm_error_get_type (void)
{
  static GType xfsm_error_type = 0;

  if (G_UNLIKELY (xfsm_error_type == 0))
    {
      static const GEnumValue values[] = {
        { XFSM_ERROR_BAD_STATE, "XFSM_ERROR_BAD_STATE", "BadState" },
        { XFSM_ERROR_BAD_VALUE, "XFSM_ERROR_BAD_VALUE", "BadValue" },
        { XFSM_ERROR_UNSUPPORTED, "XFSM_ERROR_UNSUPPORTED", "Unsupported" },
        { 0, NULL, NULL },
      };

      xfsm_error_type = g_enum_register_static ("XfsmError", values);
    }

  return xfsm_error_type;
}

void
xfsm_error_dbus_init (void)
{
  dbus_g_error_domain_register (XFSM_ERROR, "org.xfce.Session.Manager",
                                XFSM_TYPE_ERROR);
}