Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/widget/gtk/maiRedundantObjectFactory.c
Line
Count
Source (jump to first uncovered line)
1
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* vim:expandtab:shiftwidth=2:tabstop=2:
3
 */
4
/* This Source Code Form is subject to the terms of the Mozilla Public
5
 * License, v. 2.0. If a copy of the MPL was not distributed with this
6
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7
8
#include <atk/atk.h>
9
#include "maiRedundantObjectFactory.h"
10
11
static void mai_redundant_object_factory_class_init (
12
                              maiRedundantObjectFactoryClass *klass);
13
14
static AtkObject* mai_redundant_object_factory_create_accessible (
15
                              GObject *obj);
16
static GType mai_redundant_object_factory_get_accessible_type (void);
17
18
GType
19
mai_redundant_object_factory_get_type (void)
20
0
{
21
0
  static GType type = 0;
22
0
23
0
  if (!type)
24
0
  {
25
0
    static const GTypeInfo tinfo =
26
0
    {
27
0
      sizeof (maiRedundantObjectFactoryClass),
28
0
      (GBaseInitFunc) NULL, /* base init */
29
0
      (GBaseFinalizeFunc) NULL, /* base finalize */
30
0
      (GClassInitFunc) mai_redundant_object_factory_class_init, /* class init */
31
0
      (GClassFinalizeFunc) NULL, /* class finalize */
32
0
      NULL, /* class data */
33
0
      sizeof (maiRedundantObjectFactory), /* instance size */
34
0
      0, /* nb preallocs */
35
0
      (GInstanceInitFunc) NULL, /* instance init */
36
0
      NULL /* value table */
37
0
    };
38
0
    type = g_type_register_static (
39
0
                           ATK_TYPE_OBJECT_FACTORY,
40
0
                           "MaiRedundantObjectFactory" , &tinfo, 0);
41
0
  }
42
0
43
0
  return type;
44
0
}
45
46
static void
47
mai_redundant_object_factory_class_init (maiRedundantObjectFactoryClass *klass)
48
0
{
49
0
  AtkObjectFactoryClass *class = ATK_OBJECT_FACTORY_CLASS (klass);
50
0
51
0
  class->create_accessible = mai_redundant_object_factory_create_accessible;
52
0
  class->get_accessible_type = mai_redundant_object_factory_get_accessible_type;
53
0
}
54
55
/**
56
 * mai_redundant_object_factory_new:
57
 *
58
 * Creates an instance of an #AtkObjectFactory which generates primitive
59
 * (non-functioning) #AtkObjects.
60
 *
61
 * Returns: an instance of an #AtkObjectFactory
62
 **/
63
AtkObjectFactory*
64
mai_redundant_object_factory_new ()
65
{
66
  GObject *factory;
67
68
  factory = g_object_new (mai_redundant_object_factory_get_type(), NULL);
69
70
  g_return_val_if_fail (factory != NULL, NULL);
71
  return ATK_OBJECT_FACTORY (factory);
72
}
73
74
static AtkObject*
75
mai_redundant_object_factory_create_accessible (GObject   *obj)
76
{
77
  AtkObject *accessible;
78
79
  g_return_val_if_fail (obj != NULL, NULL);
80
81
  accessible = g_object_new (ATK_TYPE_OBJECT, NULL);
82
  g_return_val_if_fail (accessible != NULL, NULL);
83
84
  accessible->role = ATK_ROLE_REDUNDANT_OBJECT;
85
86
  return accessible;
87
}
88
89
static GType
90
mai_redundant_object_factory_get_accessible_type ()
91
0
{
92
0
  return mai_redundant_object_factory_get_type();
93
0
}