1 /* === S I N F G =========================================================== */
2 /*! \file layer_mime.cpp
3 ** \brief Template File
5 ** $Id: layer_mime.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
8 ** Copyright (c) 2002 Robert B. Quattlebaum Jr.
10 ** This software and associated documentation
11 ** are CONFIDENTIAL and PROPRIETARY property of
12 ** the above-mentioned copyright holder.
14 ** You may not copy, print, publish, or in any
15 ** other way distribute this software without
16 ** a prior written agreement with
17 ** the copyright holder.
20 /* ========================================================================= */
22 /* === H E A D E R S ======================================================= */
31 #include "layer_mime.h"
46 #include "paramdesc.h"
50 /* === U S I N G =========================================================== */
54 using namespace sinfg;
56 /* === M A C R O S ========================================================= */
58 /* === G L O B A L S ======================================================= */
60 /* === P R O C E D U R E S ================================================= */
62 /* === M E T H O D S ======================================================= */
64 Layer_Mime::Layer_Mime(String x):name(x)
66 // Throw a bogus default version onto the parameter list.
67 param_list["Version"]="9";
71 Layer_Mime::get_version()const
73 return get_param("Version").get(String());
77 Layer_Mime::set_version(const String &ver)
79 return set_param("Version",ver);
83 Layer_Mime::get_local_name()const
85 return _("[MIME]")+get_name();
89 Layer_Mime::set_param(const String ¶m, const ValueBase &value)
91 // Don't try to set the name
92 if(param=="name" || param=="Name" || param=="name__")
95 // Otherwise, remember this parameter's value
96 param_list[param]=value;
101 Layer_Mime::get_param(const String ¶m)const
103 // If they are requesting the name of
104 // the layer, just return it
105 if(param=="name" || param=="Name" || param=="name__")
106 return ValueBase(name);
108 // Otherwise, return the stored parameter value
109 map<string,ValueBase>::const_iterator iter=param_list.find(param);
110 if(iter!=param_list.end())
116 Layer_Mime::get_color(Context context, const Point &pos)const
118 // A Layer_Mime layer should do nothing at all.
119 return context.get_color(pos);
123 Layer_Mime::accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const
125 // A Layer_Mime layer should do nothing at all.
126 return context.accelerated_render(surface,quality,renddesc,cb);
130 Layer_Mime::get_param_vocab()const
133 map<string,ValueBase>::const_iterator iter;
135 // Construct the vocabulary from the stored
137 for(iter=param_list.begin();iter!=param_list.end();iter++)
139 // Make sure that we don't add the version
140 // into the vocabulary
141 if(iter->first!="Version")
142 ret.push_back(ParamDesc(iter->first));