summaryrefslogtreecommitdiff
path: root/src/libical-glib/tools/source-structure-boilerplate-template
blob: 77d20aaea3a6cfe9f14a7abd883458238b333efe (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
G_DEFINE_TYPE (${upperCamel}, ${lowerSnake}, I_CAL_TYPE_OBJECT)

static void ${lowerSnake}_class_init (G_GNUC_UNUSED ${upperCamel}Class *klass)
{
}

static void ${lowerSnake}_init (G_GNUC_UNUSED ${upperCamel} *self)
{
}

/**
 * ${lowerSnake}_new_full: (skip)
 * @native: The native libical object.$^!${isBare}
 * @owner: The parent.^$$^${isPossibleGlobal}
 * @is_global_memory: Whether it is allocated in the global memory.^$
 *
 * Create a new libical-glib object from the native libical object and the owner.
 *
 * Returns: (transfer full): The newly create libical-glib object.
 *
 * Since: 1.0
 **/
${new_full}
{
    ${upperCamel} *object;$^${isBare}
    ${native} *clone;^$$^!${isBare}
    if (native == NULL)
        return NULL;^$
    ${new_full_extraCode}
    $^${isBare}
    clone = g_new (${native}, 1);
    *clone = native;^$
    object = i_cal_object_construct (${namespaceLowerSnake}_TYPE_${nameLowerSnake},
                            $^!${isBare}(gpointer) native^$$^${isBare}(gpointer) clone^$,
                            (GDestroyNotify) ${destroyFunc},
                            $^${isPossibleGlobal}is_global_memory^$$^!${isPossibleGlobal}FALSE^$,
                            $^!${isBare}owner^$$^${isBare}NULL^$);

    return object;
}

${body_declaration}