sp-fespotlight.cpp revision e7333a0a54c8d33b7397406dd76938aa430836d5
#define __SP_FESPOTLIGHT_CPP__
/** \file
* SVG <fespotlight> implementation.
*/
/*
* Authors:
* Hugo Rodrigues <haa.rodrigues@gmail.com>
* Niko Kiirala <niko@kiirala.com>
* Jean-Rene Reinhard <jr@komite.net>
*
* Copyright (C) 2006,2007 Authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <glib.h>
#include "attributes.h"
#include "document.h"
#include "sp-fespotlight.h"
#include "sp-fediffuselighting-fns.h"
#include "sp-fespecularlighting-fns.h"
#define SP_MACROS_SILENT
#include "macros.h"
/* FeSpotLight class */
static void sp_fespotlight_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr);
static Inkscape::XML::Node *sp_fespotlight_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
static SPObjectClass *feSpotLight_parent_class;
{
static GType fespotlight_type = 0;
if (!fespotlight_type) {
sizeof(SPFeSpotLightClass),
sizeof(SPFeSpotLight),
16,
NULL, /* value_table */
};
fespotlight_type = g_type_register_static(SP_TYPE_OBJECT, "SPFeSpotLight", &fespotlight_info, (GTypeFlags)0);
}
return fespotlight_type;
}
static void
{
}
static void
{
fespotlight->x = 0;
fespotlight->y = 0;
fespotlight->z = 0;
fespotlight->pointsAtX = 0;
fespotlight->pointsAtY = 0;
fespotlight->pointsAtZ = 0;
}
/**
* Reads the Inkscape::XML::Node, and initializes SPPointLight variables. For this to get called,
* our name must be associated with a repr via "sp_object_type_register". Best done through
* sp-object-repr.cpp's repr_name_entries array.
*/
static void
{
}
//Read values of key attributes from XML nodes into object.
//is this necessary?
}
/**
* Drops any allocated memory.
*/
static void
{
//SPFeSpotLight *fespotlight = SP_FESPOTLIGHT(object);
if (SP_OBJECT_DOCUMENT(object)) {
/* Unregister ourselves */
}
//TODO: release resources here
}
/**
* Sets a specific value in the SPFeSpotLight.
*/
static void
{
switch (key) {
case SP_ATTR_X:
if (value) {
if (end_ptr)
}
fespotlight->x = 0;
}
}
break;
case SP_ATTR_Y:
if (value) {
if (end_ptr)
}
fespotlight->y = 0;
}
}
break;
case SP_ATTR_Z:
if (value) {
if (end_ptr)
}
fespotlight->z = 0;
}
}
break;
case SP_ATTR_POINTSATX:
if (value) {
if (end_ptr)
}
fespotlight->pointsAtX = 0;
}
}
break;
case SP_ATTR_POINTSATY:
if (value) {
if (end_ptr)
}
fespotlight->pointsAtY = 0;
}
}
break;
case SP_ATTR_POINTSATZ:
if (value) {
if (end_ptr)
}
fespotlight->pointsAtZ = 0;
}
}
break;
case SP_ATTR_SPECULAREXPONENT:
if (value) {
if (end_ptr)
}
}
}
break;
if (value) {
if (end_ptr)
}
}
}
break;
default:
// See if any parents need this value.
}
break;
}
}
/**
* * Receives update notifications.
* */
static void
{
(void)feSpotLight;
if (flags & SP_OBJECT_MODIFIED_FLAG) {
/* do something to trigger redisplay, updates? */
}
}
}
/**
* Writes its settings to an incoming repr object, if any.
*/
{
if (!repr) {
}
if (fespotlight->x_set)
if (fespotlight->y_set)
if (fespotlight->z_set)
if (fespotlight->pointsAtX_set)
if (fespotlight->pointsAtY_set)
if (fespotlight->pointsAtZ_set)
}
return repr;
}
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :