![]() |
![]() |
![]() |
adg-1 reference manual |
![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy |
AdgSegmentAdgSegment — A wrapper for CpmlSegment |
typedef AdgSegment; AdgSegment * adg_segment_deep_copy (AdgSegment *segment
,const AdgSegment *src
); AdgSegment * adg_segment_deep_dup (const AdgSegment *segment
); AdgSegment * adg_segment_dup (const AdgSegment *segment
);
AdgSegment is a wrapper in
typedef CpmlSegment AdgSegment;
Another name for
Since 1.0
AdgSegment * adg_segment_deep_copy (AdgSegment *segment
,const AdgSegment *src
);
Makes a deep copy of src
to segment
. For a shallow copy, check out
the cpml_segment_copy()
This could seem a somewhat unusual operation because segment
should
be "compatible" with src
: it is expected that they have the same
num_data
value. Anyway, it is convenient
in some situation, such as when restoring the original data from a
deep duplicated source:
AdgSegment *backup; backup = adg_segment_deep_dup(&segment); // Now &segment can be modified ... adg_segment_deep_copy(&segment, backup); g_free(backup);
The struct fields of segment
are left untouched and used only to
check if it is compatible with src
.
|
an AdgSegment structure |
|
the source segment to copy |
Returns : |
segment
|
Since 1.0
AdgSegment * adg_segment_deep_dup (const AdgSegment *segment
);
Duplicates segment
. This function makes a deep duplication,
that is it duplicates also the underlying data that defines
the segment. The path
field
is set to NULL
data
is no
more referring to the original cairo path.
All the data is allocated in the same chunk of memory so freeing the returned pointer releases all the occupied memory.
|
an AdgSegment structure |
Returns : |
a deep duplicate of segment : must be freed
with g_free() |
Since 1.0
AdgSegment * adg_segment_dup (const AdgSegment *segment
);
Duplicates segment
. This function makes a shallow duplication,
that is the internal pointers of the resulting segment struct
refer to the same memory as the original segment
. Check out
adg_segment_deep_dup()
if it is required also the content
duplication.
|
an AdgSegment structure |
Returns : |
a shallow duplicate of segment : must be freed
with g_free() |
Since 1.0