File: goocanvas-perl.h

package info (click to toggle)
libgoo-canvas-perl 0.06-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 592 kB
  • ctags: 779
  • sloc: perl: 6,868; ansic: 38; makefile: 7
file content (51 lines) | stat: -rw-r--r-- 2,312 bytes parent folder | download | duplicates (2)
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
/* @(#)goocanvas-perl.h
 */

#ifndef _GOOCANVAS_PERL_H
#define _GOOCANVAS_PERL_H 1

#include "gperl.h"
#include "gtk2perl.h"
#include "cairo-perl.h"
#include "goocanvas.h"

/* FIXME: How to avoid compile error in autogen.h */
#define GooCairoPattern cairo_pattern_t
#define GooCairoMatrix cairo_matrix_t

#include "goocanvas-perl-version.h"
#include "goocanvas-perl-autogen.h"

#define GOOCANVAS_PERL_VALUE_GET(pspec, value)
       

#define GOOCANVAS_PERL_ADD_PROPETIES(narg)                            \
    {                                                                 \
        GValue value = {0, };                                         \
        int i;                                                        \
        if ( 0 != (items-(narg)) % 2 )                                \
            croak ("set method expects name => value pairs "          \
		       "(odd number of arguments detected)");                 \
        for (i = (narg); i < items; i += 2) {                         \
            char *name = SvPV_nolen (ST (i));                         \
            SV *newval = ST (i + 1);                                  \
            GParamSpec *pspec;                                        \
            pspec = g_object_class_find_property(G_OBJECT_GET_CLASS(G_OBJECT(RETVAL)), name); \
            if ( !pspec ) {                                           \
                const char * classname =                              \
                    gperl_object_package_from_type(G_OBJECT_TYPE (G_OBJECT(RETVAL))); \
                if (!classname)                                       \
                    classname = G_OBJECT_TYPE_NAME(G_OBJECT(RETVAL)); \
                croak ("type %s does not support property '%s'",      \
                       classname, name);                              \
            }                                                         \
            g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (pspec));   \
            gperl_value_from_sv (&value, newval);                     \
            g_object_set_property (G_OBJECT(RETVAL), name, &value);   \
            g_value_unset (&value);                                   \
        }                                                             \
    }
    

#endif /* _GOOCANVAS_PERL_H */