File: art-gtype.c

package info (click to toggle)
gnome-python-desktop 2.32.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 4,548 kB
  • sloc: sh: 10,214; xml: 8,851; ansic: 3,428; python: 1,457; makefile: 664
file content (143 lines) | stat: -rw-r--r-- 2,465 bytes parent folder | download | duplicates (6)
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
/* -*- Mode: C; c-basic-offset: 4 -*- */
#include <string.h>
#include "art-gtype.h"


static ArtDRect*
_art_drect_copy (ArtDRect *drect)
{
    ArtDRect *new = g_new(ArtDRect, 1);
    art_drect_copy(new, drect);
    return new;
}


GType
art_drect_get_type(void)
{
    static GType type = 0;
	
    if (type == 0)
	type = g_boxed_type_register_static
	    ("ArtDRect",
	     (GBoxedCopyFunc) _art_drect_copy,
	     (GBoxedFreeFunc) g_free);
    return type;
}


ArtDRect *
art_drect_new(double x0, double y0, double x1, double y1)
{
    ArtDRect *drect = g_new(ArtDRect, 1);
    drect->x0 = x0;
    drect->y0 = y0;
    drect->x1 = x1;
    drect->y1 = y1;
    return drect;
}


static ArtPoint*
_art_point_copy (ArtPoint *point)
{
    ArtPoint *new = g_new(ArtPoint, 1);
    new->x = point->x;
    new->y = point->y;
    return new;
}


GType
art_point_get_type(void)
{
    static GType type = 0;
	
    if (type == 0)
	type = g_boxed_type_register_static
	    ("ArtPoint",
	     (GBoxedCopyFunc) _art_point_copy,
	     (GBoxedFreeFunc) g_free);
    return type;
}


ArtPoint *
art_point_new(double x, double y)
{
    ArtPoint *point = g_new(ArtPoint, 1);
    point->x = x;
    point->y = y;
    return point;
}


static ArtBpath*
_art_bpath_copy (ArtBpath *bpath)
{
    ArtBpath *new = g_new(ArtBpath, 1);
    memcpy(new, bpath, sizeof(ArtBpath));
    return new;
}

GType
art_bpath_get_type(void)
{
    static GType type = 0;
	
    if (type == 0)
	type = g_boxed_type_register_static
	    ("ArtBpath",
	     (GBoxedCopyFunc) _art_bpath_copy,
	     (GBoxedFreeFunc) g_free);
    return type;
}

ArtBpath*
art_bpath_new (ArtPathcode code,
	       double x1, double y1,
	       double x2, double y2,
	       double x3, double y3)
{
    ArtBpath *bpath = g_new(ArtBpath, 1);
    bpath->x1 = x1;
    bpath->y1 = y1;
    bpath->x2 = x2;
    bpath->y2 = y2;
    bpath->x3 = x3;
    bpath->y3 = y3;
    return bpath;
}


static ArtVpath*
_art_vpath_copy (ArtVpath *vpath)
{
    ArtVpath *new = g_new(ArtVpath, 1);
    memcpy(new, vpath, sizeof(ArtVpath));
    return new;
}

GType
art_vpath_get_type(void)
{
    static GType type = 0;
	
    if (type == 0)
	type = g_boxed_type_register_static
	    ("ArtVpath",
	     (GBoxedCopyFunc) _art_vpath_copy,
	     (GBoxedFreeFunc) g_free);
    return type;
}

ArtVpath*
art_vpath_new (ArtPathcode code,
	       double x, double y)
{
    ArtVpath *vpath = g_new(ArtVpath, 1);
    vpath->x = x;
    vpath->y = y;
    return vpath;
}