File: stub-object.c

package info (click to toggle)
telepathy-glib 0.24.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 34,628 kB
  • sloc: ansic: 124,643; xml: 34,410; sh: 11,299; python: 3,520; makefile: 1,727; cpp: 16
file content (68 lines) | stat: -rw-r--r-- 1,366 bytes parent folder | download | duplicates (4)
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
66
67
68
#include "config.h"

#include "stub-object.h"

G_DEFINE_TYPE (TpTestsStubObject, tp_tests_stub_object, G_TYPE_OBJECT)

enum {
    PROP_0,
    PROP_NAME,
    N_PROPS
};

static void
stub_object_get_property (GObject *object,
    guint prop_id,
    GValue *value,
    GParamSpec *param_spec)
{
  switch (prop_id)
    {
    case PROP_NAME:
      g_value_set_string (value, "Bruce");
      break;

    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, param_spec);
      break;
    }
}

static void
stub_object_set_property (GObject *object,
    guint prop_id,
    const GValue *value,
    GParamSpec *param_spec)
{
  switch (prop_id)
    {
    case PROP_NAME:
      /* do nothing */
      break;

    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, param_spec);
      break;
    }
}

static void
tp_tests_stub_object_class_init (TpTestsStubObjectClass *klass)
{
  GObjectClass *object_class = (GObjectClass *) klass;

  object_class->get_property = stub_object_get_property;
  object_class->set_property = stub_object_set_property;

  g_object_class_install_property (object_class, PROP_NAME,
      g_param_spec_string ("name",
          "Name",
          "The name of the stub object",
          "Bruce",
          G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE));
}

static void
tp_tests_stub_object_init (TpTestsStubObject *self)
{
}