Annotation of parser3/src/types/pa_vimage.h, revision 1.34

1.9       paf         1: /** @file
1.1       paf         2:        Parser: @b image parser type decl.
                      3: 
1.34    ! paf         4:        Copyright (c) 2001, 2003 ArtLebedev Group (http://www.artlebedev.com)
1.24      paf         5:        Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru)
1.1       paf         6: */
                      7: 
                      8: #ifndef PA_VIMAGE_H
                      9: #define PA_VIMAGE_H
1.26      paf        10: 
1.34    ! paf        11: static const char* IDENT_VIMAGE_H="$Date: 2002/11/22 16:16:34 $";
1.1       paf        12: 
1.12      paf        13: #include "classes.h"
1.1       paf        14: #include "pa_common.h"
                     15: #include "pa_vstateless_object.h"
                     16: 
1.20      parser     17: // defines
                     18: 
                     19: #define VIMAGE_TYPE "image"
1.33      paf        20: #define EXIF_ELEMENT_NAME "exif"
1.20      parser     21: 
                     22: // forwards
                     23: 
1.7       paf        24: class gdImage; class Font;
1.10      paf        25: 
1.20      parser     26: // externs
                     27: 
1.10      paf        28: extern Methoded *image_class;
1.7       paf        29: 
1.8       paf        30: /** holds img attributes 
1.1       paf        31:        and [image itself]
                     32: */
                     33: class VImage : public VStateless_object {
                     34: public: // Value
                     35:        
1.20      parser     36:        const char *type() const { return VIMAGE_TYPE; }
1.25      paf        37:        VStateless_class *get_class() { return image_class; }
1.1       paf        38: 
                     39:        /// VImage: true
1.17      parser     40:        bool as_bool() const { return true; }
1.19      parser     41: 
                     42:        /// VImage: true
                     43:        Value *as_expr_result(bool return_string_as_is=false) { return NEW VBool(pool(), as_bool()); }
1.1       paf        44: 
                     45:        /// VImage: method,field
1.33      paf        46:        /*override*/ Value *get_element(const String& aname, Value& aself, bool looking_up);
1.15      parser     47: 
                     48:        /// VImage: field
1.29      paf        49:        /*override*/ bool put_element(const String& aname, Value *avalue, bool replace);
1.1       paf        50: 
                     51: public: // usage
                     52: 
1.25      paf        53:        VImage::VImage(Pool& apool) : VStateless_object(apool),
1.7       paf        54:                ffields(apool),
1.33      paf        55:                fexif(0), image(0), font(0) {
1.1       paf        56:        }
                     57: 
1.3       paf        58:        void set(const String *src, int width, int height,
1.33      paf        59:                gdImage *aimage=0,
                     60:                Value *aexif=0);
1.1       paf        61: 
1.33      paf        62:        Hash& fields() { return ffields; }
1.3       paf        63: 
                     64: public:
                     65: 
1.7       paf        66:        gdImage *image; Font *font;
1.1       paf        67: 
                     68: private:
                     69: 
                     70:        Hash ffields;
1.33      paf        71:        Value *fexif;
1.1       paf        72: 
                     73: };
                     74: 
                     75: #endif

E-mail: