gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash/server Movie.h Sprite.h action.h gnash.h ...


From: strk
Subject: [Gnash-commit] gnash/server Movie.h Sprite.h action.h gnash.h ...
Date: Thu, 26 Jan 2006 00:15:58 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Branch:         
Changes by:     strk <address@hidden>   06/01/26 00:15:57

Modified files:
        server         : Movie.h Sprite.h action.h gnash.h impl.h 

Log message:
        Doxygen compatible comments (unfinished)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/server/Movie.h.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/server/Sprite.h.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/server/action.h.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/server/gnash.h.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/server/impl.h.diff?tr1=1.4&tr2=1.5&r1=text&r2=text

Patches:
Index: gnash/server/Movie.h
diff -u gnash/server/Movie.h:1.1 gnash/server/Movie.h:1.2
--- gnash/server/Movie.h:1.1    Wed Jan 25 18:03:25 2006
+++ gnash/server/Movie.h        Thu Jan 26 00:15:57 2006
@@ -61,14 +61,12 @@
        };
 
 
+       /// Immutable definition of a movie's contents.
        //
-       // movie_def_impl
-       //
-       // This class holds the immutable definition of a movie's
-       // contents.  It cannot be played directly, and does not hold
-       // current state; for that you need to call create_instance()
-       // to get a movie_instance.
-       //
+       /// It cannot be played directly, and does not hold
+       /// current state; for that you need to call create_instance()
+       /// to get a movie_instance.
+       ///
        struct movie_def_impl : public movie_definition_sub
        {
                hash<int, smart_ptr<character_def> >            m_characters;
@@ -76,26 +74,26 @@
                hash<int, smart_ptr<bitmap_character_def> >     
m_bitmap_characters;
                hash<int, smart_ptr<sound_sample> >             m_sound_samples;
 
-               // A list of movie control events for each frame.
+               /// A list of movie control events for each frame.
                array<array<execute_tag*> >                     m_playlist;
 
-               // Init actions for each frame.
+               /// Init actions for each frame.
                array<array<execute_tag*> >        m_init_action_list;
 
-               // 0-based frame #'s
+               /// 0-based frame #'s
                stringi_hash<int>                  m_named_frames;
 
                stringi_hash<smart_ptr<resource> > m_exports;
 
-               // Items we import.
+               /// Items we import.
                array<import_info>      m_imports;
 
-               // Movies we import from; hold a ref on these,
-               // to keep them alive
+               /// Movies we import from; hold a ref on these,
+               /// to keep them alive
                array<smart_ptr<movie_definition> >     m_import_source_movies;
 
-               // Bitmaps used in this movie; collected in one place to make
-               // it possible for the host to manage them as textures.
+               /// Bitmaps used in this movie; collected in one place to make
+               /// it possible for the host to manage them as textures.
                array<smart_ptr<bitmap_info> >  m_bitmap_list;
 
                create_bitmaps_flag     m_create_bitmaps;
@@ -148,28 +146,28 @@
 
                uint32  get_file_bytes() const { return m_file_length; }
 
-               // Returns DO_CREATE_BITMAPS if we're supposed to
-               // initialize our bitmap infos, or DO_NOT_INIT_BITMAPS
-               // if we're supposed to create blank placeholder
-               // bitmaps (to be init'd later explicitly by the host
-               // program).
+               /// Returns DO_CREATE_BITMAPS if we're supposed to
+               /// initialize our bitmap infos, or DO_NOT_INIT_BITMAPS
+               /// if we're supposed to create blank placeholder
+               /// bitmaps (to be init'd later explicitly by the host
+               /// program).
                virtual create_bitmaps_flag get_create_bitmaps() const
                {
                        return m_create_bitmaps;
                }
 
-               // Returns DO_LOAD_FONT_SHAPES if we're supposed to
-               // initialize our font shape info, or
-               // DO_NOT_LOAD_FONT_SHAPES if we're supposed to not
-               // create any (vector) font glyph shapes, and instead
-               // rely on precached textured fonts glyphs.
+               /// Returns DO_LOAD_FONT_SHAPES if we're supposed to
+               /// initialize our font shape info, or
+               /// DO_NOT_LOAD_FONT_SHAPES if we're supposed to not
+               /// create any (vector) font glyph shapes, and instead
+               /// rely on precached textured fonts glyphs.
                virtual create_font_shapes_flag get_create_font_shapes() const
                {
                    return m_create_font_shapes;
                }
 
-               // All bitmap_info's used by this movie should be
-               // registered with this API.
+               /// All bitmap_info's used by this movie should be
+               /// registered with this API.
                virtual void    add_bitmap_info(bitmap_info* bi)
                {
                    m_bitmap_list.push_back(bi);
@@ -185,8 +183,8 @@
                        return m_bitmap_list[i].get_ptr();
                }
 
-               // Expose one of our resources under the given symbol,
-               // for export.  Other movies can import it.
+               /// Expose one of our resources under the given symbol,
+               /// for export.  Other movies can import it.
                virtual void export_resource(const tu_string& symbol,
                                resource* res)
                {
@@ -194,8 +192,8 @@
                    m_exports.set(symbol, res);
                }
 
-               // Get the named exported resource, if we expose it.
-               // Otherwise return NULL.
+               /// Get the named exported resource, if we expose it.
+               /// Otherwise return NULL.
                virtual smart_ptr<resource> get_exported_resource(const 
tu_string& symbol)
                {
                    smart_ptr<resource> res;
@@ -203,11 +201,11 @@
                    return res;
                }
 
-               // Adds an entry to a table of resources that need to
-               // be imported from other movies.  Client code must
-               // call resolve_import() later, when the source movie
-               // has been loaded, so that the actual resource can be
-               // used.
+               /// Adds an entry to a table of resources that need to
+               /// be imported from other movies.  Client code must
+               /// call resolve_import() later, when the source movie
+               /// has been loaded, so that the actual resource can be
+               /// used.
                virtual void add_import(const char* source_url, int id, const 
char* symbol)
                {
                    assert(in_import_table(id) == false);
@@ -215,15 +213,15 @@
                    m_imports.push_back(import_info(source_url, id, symbol));
                }
 
-               // Debug helper; returns true if the given
-               // character_id is listed in the import table.
+               /// Debug helper; returns true if the given
+               /// character_id is listed in the import table.
                bool in_import_table(int character_id);
 
-               // Calls back the visitor for each movie that we
-               // import symbols from.
+               /// Calls back the visitor for each movie that we
+               /// import symbols from.
                virtual void visit_imported_movies(import_visitor* visitor);
 
-               // Grabs the stuff we want from the source movie.
+               /// Grabs the stuff we want from the source movie.
                virtual void resolve_import(const char* source_url,
                        movie_definition* source_movie);
 
@@ -231,7 +229,7 @@
 
                character_def*  get_character_def(int character_id);
 
-               // Returns 0-based frame #
+               /// Returns 0-based frame #
                bool get_labeled_frame(const char* label, int* frame_number)
                {
                        return m_named_frames.get(label, frame_number);
@@ -250,19 +248,19 @@
                    m_playlist[m_loading_frame].push_back(e);
                }
 
-               // Need to execute the given tag before entering the
-               // currently-loading frame for the first time.
-               //
-               // @@ AFAIK, the sprite_id is totally pointless -- correct?
+               /// Need to execute the given tag before entering the
+               /// currently-loading frame for the first time.
+               ///
+               /// @@ AFAIK, the sprite_id is totally pointless -- correct?
                void    add_init_action(int sprite_id, execute_tag* e)
                {
                    assert(e);
                    m_init_action_list[m_loading_frame].push_back(e);
                }
 
-               // Labels the frame currently being loaded with the
-               // given name.  A copy of the name string is made and
-               // kept in this object.
+               /// Labels the frame currently being loaded with the
+               /// given name.  A copy of the name string is made and
+               /// kept in this object.
                void    add_frame_name(const char* name)
                {
                    assert(m_loading_frame >= 0 && m_loading_frame < 
m_frame_count);
@@ -272,16 +270,16 @@
                    m_named_frames.add(n, m_loading_frame);     // stores 
0-based frame #
                }
 
-               // Set an input object for later loading DefineBits
-               // images (JPEG images without the table info).
+               /// Set an input object for later loading DefineBits
+               /// images (JPEG images without the table info).
                void    set_jpeg_loader(jpeg::input* j_in)
                {
                    assert(m_jpeg_in == NULL);
                    m_jpeg_in = j_in;
                }
 
-               // Get the jpeg input loader, to load a DefineBits
-               // image (one without table info).
+               /// Get the jpeg input loader, to load a DefineBits
+               /// image (one without table info).
                jpeg::input*    get_jpeg_loader()
                {
                    return m_jpeg_in;
@@ -291,33 +289,29 @@
 
                virtual const array<execute_tag*>*get_init_actions(int 
frame_number) { return &m_init_action_list[frame_number]; }
 
-               // Read a .SWF movie.
+               /// Read a .SWF movie.
                void read(tu_file *in);
 
-               // Fill up *fonts with fonts that we own.
+               /// Fill up *fonts with fonts that we own.
                void get_owned_fonts(array<font*>* fonts);
 
-               // Generate bitmaps for our fonts, if necessary.
+               /// Generate bitmaps for our fonts, if necessary.
                void generate_font_bitmaps();
 
-               // Dump our cached data into the given stream.
+               /// Dump our cached data into the given stream.
                void output_cached_data(tu_file* out,
                        const cache_options& options);
 
-               // Read in cached data and use it to prime our
-               // loaded characters.
+               /// Read in cached data and use it to prime our
+               /// loaded characters.
                void    input_cached_data(tu_file* in);
 
-               // Create a playable movie instance from a def.
+               /// Create a playable movie instance from a def.
                movie_interface* create_instance();
        };
 
 
-       //
-       // movie_root
-       //
-       // Global, shared root state for a movie and all its characters.
-       //
+       /// Global, shared root state for a movie and all its characters.
        struct movie_root : public movie_interface
        {
                smart_ptr<movie_def_impl>       m_def;
@@ -331,7 +325,7 @@
                int                     m_mouse_x, m_mouse_y, m_mouse_buttons;
                void *                  m_userdata;
 
-               // @@ fold this into m_mouse_button_state?
+               /// @@ fold this into m_mouse_button_state?
                movie::drag_state       m_drag_state;
 
                mouse_button_state      m_mouse_button_state;
@@ -347,25 +341,25 @@
 
                ~movie_root();
 
-               // @@ should these delegate to m_movie?  Probably...
+               /// @@ should these delegate to m_movie?  Probably...
                virtual void    set_member(const tu_stringi& name,
                        const as_value& val) {}
                virtual bool    get_member(const tu_stringi& name,
                        as_value* val) { return false; }
 
-               // @@ should this return m_movie.get_ptr()?
+               /// @@ should this return m_movie.get_ptr()?
                virtual movie*  to_movie() { assert(0); return 0; }
 
                void set_root_movie(movie* root_movie);
 
                void set_display_viewport(int x0, int y0, int w, int h);
 
-               // The host app uses this to tell the movie where the
-               // user's mouse pointer is.
+               /// The host app uses this to tell the movie where the
+               /// user's mouse pointer is.
                void notify_mouse_state(int x, int y, int buttons);
 
-               // Use this to retrieve the last state of the mouse, as set via
-               // notify_mouse_state().  Coordinates are in PIXELS, NOT TWIPS.
+               /// Use this to retrieve the last state of the mouse, as set via
+               /// notify_mouse_state().  Coordinates are in PIXELS, NOT TWIPS.
                virtual void    get_mouse_state(int* x, int* y, int* buttons);
 
                movie*  get_root_movie() { return m_movie.get_ptr(); }
@@ -384,17 +378,18 @@
                virtual void clear_interval_timer(int x);
                virtual void do_something(void *timer);
 
-               // 0-based!!
+               /// 0-based!!
                int get_current_frame() const {
                        return m_movie->get_current_frame();
                }
+
                float get_frame_rate() const {
                        return m_def->get_frame_rate();
                }
 
-               // Return the size of a logical movie pixel as
-               // displayed on-screen, with the current device
-               // coordinates.
+               /// Return the size of a logical movie pixel as
+               /// displayed on-screen, with the current device
+               /// coordinates.
                virtual float   get_pixel_scale() const
                {
                    return m_pixel_scale;
@@ -427,7 +422,7 @@
 
                void    advance(float delta_time);
 
-               // 0-based!!
+               /// 0-based!!
                void goto_frame(int target_frame_number) {
                        m_movie->goto_frame(target_frame_number);
                }
@@ -465,7 +460,7 @@
                        return m_movie->get_variable(path_to_var);
                }
 
-               // For ActionScript interfacing convenience.
+               /// For ActionScript interfacing convenience.
                virtual const char* call_method(const char* method_name,
                                const char* method_arg_fmt, ...);
                virtual const char* call_method_args(const char* method_name,
Index: gnash/server/Sprite.h
diff -u gnash/server/Sprite.h:1.1 gnash/server/Sprite.h:1.2
--- gnash/server/Sprite.h:1.1   Wed Jan 25 18:03:25 2006
+++ gnash/server/Sprite.h       Thu Jan 26 00:15:57 2006
@@ -244,11 +244,10 @@
        };
 
 
+       /// Sprite instance
        //
-       // sprite_instance
-       //
-
-
+       /// Stateful Sprite object. Also known as a MovieClip.
+       ///
        struct sprite_instance : public character
        {
                smart_ptr<movie_definition_sub> m_def;
Index: gnash/server/action.h
diff -u gnash/server/action.h:1.3 gnash/server/action.h:1.4
--- gnash/server/action.h:1.3   Tue Jan 24 01:33:02 2006
+++ gnash/server/action.h       Thu Jan 26 00:15:57 2006
@@ -526,11 +526,11 @@
        };
 
 
+       /// A generic bag of attributes. 
        //
-       // as_object
-       //
-       // A generic bag of attributes.  Base-class for ActionScript
-       // script-defined objects.
+       /// Base-class for ActionScript script-defined objects.
+       /// This would likely be ActionScript's 'Object' class.
+       ///
        struct as_object : public as_object_interface
        {
                stringi_hash<as_member> m_members;
@@ -631,8 +631,8 @@
                        return false;
                }
 
+               /// This object is not a movie; no conversion.
                virtual movie*  to_movie()
-               // This object is not a movie; no conversion.
                {
                        return NULL;
                }
Index: gnash/server/gnash.h
diff -u gnash/server/gnash.h:1.2 gnash/server/gnash.h:1.3
--- gnash/server/gnash.h:1.2    Thu Jan 19 23:50:11 2006
+++ gnash/server/gnash.h        Thu Jan 26 00:15:57 2006
@@ -62,65 +62,73 @@
        struct sound_handler;
        struct stream;
        
-       //
-       // Log & error reporting control.
-       //
+       ///
+       /// Log & error reporting control.
+       ///
        
-       // Supply a function pointer to receive log & error messages.
+       /// Supply a function pointer to receive log & error messages.
        void    register_log_callback(void (*callback)(bool error, const char* 
message));
        
-       // Control verbosity of specific categories.
+       /// Control verbosity of action processing
        void    set_verbose_action(bool verbose);
+
+       /// Control verbosity of SWF parsing
        void    set_verbose_parse(bool verbose);
        
-       // Get and set the render handler.  This is one of the first
-       // things you should do to initialise the player (assuming you
-       // want to display anything).
+       /// Set the render handler.  This is one of the first
+       /// things you should do to initialise the player (assuming you
+       /// want to display anything).
        void    set_render_handler(render_handler* s);
 
-       // Pass in a sound handler, so you can handle audio on behalf of
-       // gnash.  This is optional; if you don't set a handler, or set
-       // NULL, then sounds won't be played.
-       //
-       // If you want sound support, you should set this at startup,
-       // before loading or playing any movies!
+       /// Pass in a sound handler, so you can handle audio on behalf of
+       /// gnash.  This is optional; if you don't set a handler, or set
+       /// NULL, then sounds won't be played.
+       ///
+       /// If you want sound support, you should set this at startup,
+       /// before loading or playing any movies!
        void    set_sound_handler(sound_handler* s);
 
-       // You probably don't need this. (@@ make it private?)
+       /// You probably don't need this. (@@ make it private?)
        sound_handler*  get_sound_handler();
 
-       // Register a callback to the host, for providing a file,
-       // given a "URL" (i.e. a path name).  This is the only means
-       // by which the gnash library accesses file data, for
-       // loading movies, cache files, and so on.
-       //
-       // gnash will call this when it needs to open a file.
-       //
-       // NOTE: the returned tu_file* will be delete'd by gnash
-       // when it is done using it.  Your file_opener_function may
-       // return NULL in case the requested file can't be opened.
+       /// Signature of file opener callback function
        typedef tu_file* (*file_opener_callback)(const char* url_or_path);
+
+       /// Register a callback to the host, for providing a file,
+       /// given a "URL" (i.e. a path name).  This is the only means
+       /// by which the gnash library accesses file data, for
+       /// loading movies, cache files, and so on.
+       ///
+       /// gnash will call this when it needs to open a file.
+       ///
+       /// NOTE: the returned tu_file* will be delete'd by gnash
+       /// when it is done using it.  Your file_opener_function may
+       /// return NULL in case the requested file can't be opened.
        void    register_file_opener_callback(file_opener_callback opener);
 
-       // Register a callback for displaying SWF load progress.
+       /// Signature of progress callback function
        typedef void (*progress_callback)(unsigned int loaded_bytes, unsigned 
int total_bytes);
+
+       /// Register a callback for displaying SWF load progress.
        void    register_progress_callback(progress_callback progress_handle);
 
-       // ActionScripts embedded in a movie can use the built-in
-       // fscommand() function to send data back to the host
-       // application.  If you are interested in this data, register
-       // a handler, which will be called when the embedded scripts
-       // call fscommand().
-       //
-       // The handler gets the movie_interface* that the script is
-       // embedded in, and the two string arguments passed by the
-       // script to fscommand().
+       /// Signature of fscommand callback function
        typedef void (*fscommand_callback)(movie_interface* movie, const char* 
command, const char* arg);
+
+       /// ActionScripts embedded in a movie can use the built-in
+       /// fscommand() function to send data back to the host
+       /// application.  If you are interested in this data, register
+       /// a handler, which will be called when the embedded scripts
+       /// call fscommand().
+       ///
+       /// The handler gets the movie_interface* that the script is
+       /// embedded in, and the two string arguments passed by the
+       /// script to fscommand().
        void    register_fscommand_callback(fscommand_callback handler);
 
-       // Use this to control how finely curves are subdivided.  1.0
-       // is the default; it's a pretty good value.  Larger values
-       // result in coarser, more angular curves with fewer vertices.
+       /// Use this to control how finely curves are subdivided.  1.0
+       /// is the default; it's a pretty good value.  Larger values
+       /// result in coarser, more angular curves with fewer vertices.
        void    set_curve_max_pixel_error(float pixel_error);
        float   get_curve_max_pixel_error();
        
@@ -151,8 +159,8 @@
        struct character_def;
        struct sound_sample;
        
-       // An interface for casting to different types of
-       // resources.
+       /// An interface for casting to different types of
+       /// resources.
        struct resource : public ref_counted
        {
                virtual ~resource() {}
@@ -164,23 +172,29 @@
        };
 
 
-       // This is the base class for all ActionScript-able objects
-       // ("as_" stands for ActionScript).
+       /// This is the base class for all ActionScript-able objects
+       //
+       /// ("as_" stands for ActionScript).
+       ///
        struct as_object_interface : public resource
        {
                virtual ~as_object_interface() {}
 
-               // So that text_character's can return something reasonable.
+               /// So that text_character's can return something reasonable.
                virtual const char*     get_text_value() const { return 0; }
 
+               /// Set a member of this ActionScript object
                virtual void    set_member(const tu_stringi& name, const 
as_value& val) = 0;
+
+               /// Get a member of this ActionScript object
                virtual bool    get_member(const tu_stringi& name, as_value* 
val) = 0;
+               /// Convert this object to a movie
                virtual movie*  to_movie() = 0;
        };
 
 
-       // For caching precomputed stuff.  Generally of
-       // interest to gnash_processor and programs like it.
+       /// For caching precomputed stuff.  Generally of
+       /// interest to gnash_processor and programs like it.
        struct cache_options
        {
                bool    m_include_font_bitmaps;
@@ -193,12 +207,13 @@
        };
 
 
-       // A character_def is the immutable data representing the template of a
-       // movie element.
+       /// Immutable data representing the template of a movie element.
        //
-       // @@ This is not really a public interface.  It's here so it
-       // can be mixed into movie_definition, movie_definition_sub,
-       // and sprite_definition, without using multiple inheritance.
+       /// This is not really a public interface.  It's here so it
+       /// can be mixed into movie_definition, movie_definition_sub,
+       /// and sprite_definition, without using multiple inheritance.
+       ///
+       ///
        struct character_def : public resource
        {
        private:
@@ -218,7 +233,7 @@
                virtual float   get_height_local() { return 0.0f; }
                virtual float   get_width_local() { return 0.0f; }
 
-               // Should stick the result in a smart_ptr immediately.
+               /// Should stick the result in a smart_ptr immediately.
                virtual character*      create_character_instance(movie* 
parent, int id);       // default is to make a generic_character
 
                // From resource interface.
@@ -233,10 +248,10 @@
        };
 
 
+       /// Client program's interface to the definition of a movie
        //
-       // This is the client program's interface to the definition of
-       // a movie (i.e. the shared constant source info).
-       //
+       /// (i.e. the shared constant source info).
+       ///
        struct movie_definition : public character_def
        {
                virtual int     get_version() const = 0;
@@ -245,39 +260,39 @@
                virtual int     get_frame_count() const = 0;
                virtual float   get_frame_rate() const = 0;
 
-               // This calls add_ref() on the movie_interface internally.
-               // Call drop_ref() on the movie_interface when you're done with 
it.
-               // Or use smart_ptr<T> from base/smart_ptr.h if you want.
+               /// This calls add_ref() on the movie_interface internally.
+               /// Call drop_ref() on the movie_interface when you're done 
with it.
+               /// Or use smart_ptr<T> from base/smart_ptr.h if you want.
                virtual movie_interface*        create_instance() = 0;
 
                virtual void    output_cached_data(tu_file* out, const 
cache_options& options) = 0;
                virtual void    input_cached_data(tu_file* in) = 0;
 
-               // Causes this movie def to generate texture-mapped
-               // versions of all the fonts it owns.  This improves
-               // speed and quality of text rendering.  The
-               // texture-map data is serialized in the
-               // output/input_cached_data() calls, so you can
-               // preprocess this if you load cached data.
+               /// Causes this movie def to generate texture-mapped
+               /// versions of all the fonts it owns.  This improves
+               /// speed and quality of text rendering.  The
+               /// texture-map data is serialized in the
+               /// output/input_cached_data() calls, so you can
+               /// preprocess this if you load cached data.
                virtual void    generate_font_bitmaps() = 0;
 
                //
                // (optional) API to support gnash::create_movie_no_recurse().
                //
 
-               // Call visit_imported_movies() to retrieve a list of
-               // names of movies imported into this movie.
-               // visitor->visit() will be called back with the name
-               // of each imported movie.
+               /// Call visit_imported_movies() to retrieve a list of
+               /// names of movies imported into this movie.
+               /// visitor->visit() will be called back with the name
+               /// of each imported movie.
                struct import_visitor
                {
                        virtual void    visit(const char* 
imported_movie_filename) = 0;
                };
                virtual void    visit_imported_movies(import_visitor* visitor) 
= 0;
 
-               // Call this to resolve an import of the given movie.
-               // Replaces the dummy placeholder with the real
-               // movie_definition* given.
+               /// Call this to resolve an import of the given movie.
+               /// Replaces the dummy placeholder with the real
+               /// movie_definition* given.
                virtual void    resolve_import(const char* name, 
movie_definition* def) = 0;
 
                //
@@ -319,22 +334,23 @@
        };
 
 
+       /// An independent stateful live movie.
        //
-       // This is the client program's interface to an instance of a
-       // movie (i.e. an independent stateful live movie).
-       //
+       /// This is the client program's interface to an instance of a
+       /// movie. 
+       ///
        struct movie_interface : public as_object_interface
        {
                virtual movie_definition*       get_movie_definition() = 0;
 
-               // Frame counts in this API are 0-based (unlike ActionScript)
+               /// Frame counts in this API are 0-based (unlike ActionScript)
                virtual int     get_current_frame() const = 0;
                virtual bool    has_looped() const = 0;
                
                virtual void    restart() = 0;
                virtual void    advance(float delta_time) = 0;
                virtual void    goto_frame(int frame_number) = 0;
-               // Returns true if labeled frame is found.
+               /// Returns true if labeled frame is found.
                virtual bool    goto_labeled_frame(const char* label) = 0;
                virtual void    display() = 0;
 
@@ -343,69 +359,70 @@
                        PLAY,
                        STOP
                };
+
                virtual void    set_play_state(play_state s) = 0;
                virtual play_state      get_play_state() const = 0;
                
                virtual void    set_background_color(const rgba& bg_color) = 0;
 
-               // Set to 0 if you don't want the movie to render its
-               // background at all.  1 == full opacity.
+               /// Set to 0 if you don't want the movie to render its
+               /// background at all.  1 == full opacity.
                virtual void    set_background_alpha(float alpha) = 0;
                virtual float   get_background_alpha() const = 0;
                
-               // move/scale the movie...
+               /// move/scale the movie...
                virtual void    set_display_viewport(int x0, int y0, int w, int 
h) = 0;
                
-               // Input.
+               /// Input.
                virtual void    notify_mouse_state(int x, int y, int buttons) = 
0;
                
-               // Set an ActionScript variable within this movie.
-               // You can use this to set the value of text fields,
-               // ordinary variables, or properties of characters
-               // within the script.
-               //
-               // This version accepts UTF-8
+               /// Set an ActionScript variable within this movie.
+               /// You can use this to set the value of text fields,
+               /// ordinary variables, or properties of characters
+               /// within the script.
+               ///
+               /// This version accepts UTF-8
                virtual void    set_variable(const char* path_to_var, const 
char* new_value) = 0;
-               // This version accepts UCS-2 or UCS-4, depending on 
sizeof(wchar_t)
+               /// This version accepts UCS-2 or UCS-4, depending on 
sizeof(wchar_t)
                virtual void    set_variable(const char* path_to_var, const 
wchar_t* new_value) = 0;
                // @@ do we want versions that take a number?
 
-               // Get the value of an ActionScript variable.
-               //
-               // Value is ephemeral & not thread safe!!!  Use it or
-               // copy it immediately.
-               //
-               // Returns UTF-8
+               /// Get the value of an ActionScript variable.
+               ///
+               /// Value is ephemeral & not thread safe!!!  Use it or
+               /// copy it immediately.
+               ///
+               /// Returns UTF-8
                virtual const char*     get_variable(const char* path_to_var) 
const = 0;
                // @@ do we want a version that returns a number?
 
-               // ActionScript method call.  Return value points to a
-               // static string buffer with the result; caller should
-               // use the value immediately before making more calls
-               // to gnash.  NOT THREAD SAFE!!!
-               // 
-               // method_name is the name of the method (possibly namespaced).
-               //
-               // method_arg_fmt is a printf-style declaration of
-               // the method call, where the arguments are
-               // represented by { %d, %s, %f, %ls }, followed by the
-               // vararg list of actual arguments.
-               // 
-               // E.g.
-               //
-               // m->call_method("path.to.method_name", "%d, %s, %f", i, 
"hello", 2.7f);
-               //
-               // The format args are a small subset of printf, namely:
-               //
-               // %d -- integer arg
-               // %s -- 0-terminated char* string arg
-               // %ls -- 0-terminated wchar_t* string arg
-               // %f -- float/double arg
-               //
-               // Whitespace and commas in the format string are ignored.
-               //
-               // This is not an ActionScript language parser, it
-               // doesn't recognize expressions or anything tricky.
+               /// ActionScript method call.  Return value points to a
+               /// static string buffer with the result; caller should
+               /// use the value immediately before making more calls
+               /// to gnash.  NOT THREAD SAFE!!!
+               /// 
+               /// method_name is the name of the method (possibly namespaced).
+               ///
+               /// method_arg_fmt is a printf-style declaration of
+               /// the method call, where the arguments are
+               /// represented by { %d, %s, %f, %ls }, followed by the
+               /// vararg list of actual arguments.
+               /// 
+               /// E.g.
+               ///
+               /// m->call_method("path.to.method_name", "%d, %s, %f", i, 
"hello", 2.7f);
+               ///
+               /// The format args are a small subset of printf, namely:
+               ///
+               /// %d -- integer arg
+               /// %s -- 0-terminated char* string arg
+               /// %ls -- 0-terminated wchar_t* string arg
+               /// %f -- float/double arg
+               ///
+               /// Whitespace and commas in the format string are ignored.
+               ///
+               /// This is not an ActionScript language parser, it
+               /// doesn't recognize expressions or anything tricky.
 #ifdef __GNUC__
                // use the following to catch errors: (only with gcc)
                virtual const char*     call_method(const char* method_name, 
const char* method_arg_fmt, ...)
@@ -416,37 +433,42 @@
                virtual const char*     call_method_args(const char* 
method_name, const char* method_arg_fmt, va_list args) = 0;
 
 
-               // Make the movie visible/invisible.  An invisible
-               // movie does not advance and does not render.
+               /// Make the movie visible/invisible. 
+               //
+               /// An invisible
+               /// movie does not advance and does not render.
                virtual void    set_visible(bool visible) = 0;
 
-               // Return visibility status.
+               /// Return visibility status.
                virtual bool    get_visible() const = 0;
 
-               // Set and get userdata, that's useful for the fs_command 
handler.
+               /// Get userdata, that's useful for the fs_command handler.
                virtual void   *get_userdata() = 0;
+
+               /// Set userdata, that's useful for the fs_command handler.
                virtual void   set_userdata(void *) = 0;
 
-               // Display callbacks, for client rendering.  Callback
-               // is called after rendering the object it's attached
-               // to.
+               /// Display callbacks, for client rendering. 
                //
-               // Attach NULL to disable the callback.
+               /// Callback is called after rendering the object
+               /// it's attached to.
+               ///
+               /// Attach NULL to disable the callback.
                virtual void    attach_display_callback(const char* 
path_to_object, void (*callback)(void* user_ptr), void* user_ptr) = 0;
 
                virtual int add_interval_timer(void *timer) = 0;
                virtual void clear_interval_timer(int x) = 0;
 
-               // for external movies
+               /// for external movies
                virtual movie*  get_root_movie() = 0;
        };
 
-       // Try to grab movie info from the header of the given .swf
-       // file.
-       //
-       // Sets *version to 0 if info can't be extracted.
-       //
-       // You can pass NULL for any entries you're not interested in.
+       /// Try to grab movie info from the header of the given .swf
+       /// file.
+       ///
+       /// Sets *version to 0 if info can't be extracted.
+       ///
+       /// You can pass NULL for any entries you're not interested in.
        void    get_movie_info(
                const char*     filename,
                int*            version,
@@ -457,101 +479,105 @@
                int*            tag_count
                );
 
-       // Enable/disable attempts to read cache files (.gsc) when
-       // loading movies.
+       /// Enable/disable attempts to read cache files (.gsc) when
+       /// loading movies.
        void    set_use_cache_files(bool use_cache);
        
-       // @@ Hm, need to think about these creation API's.  Perhaps
-       // divide it into "low level" and "high level" calls.  Also,
-       // perhaps we need a "context" object that contains all
-       // global-ish flags, libraries, callback pointers, font
-       // library, etc.
-       //
-       // Create a gnash::movie_definition from the given file name.
-       // Normally, will also try to load any cached data file
-       // (".gsc") that corresponds to the given movie file.  This
-       // will still work even if there is no cache file.  You can
-       // disable the attempts to load cache files by calling
-       // gnash::use_cache_files(false).
-       //
-       // Uses the registered file-opener callback to read the files
-       // themselves.
-       //
-       // This calls add_ref() on the newly created definition; call
-       // drop_ref() when you're done with it.
-       // Or use smart_ptr<T> from base/smart_ptr.h if you want.
+       /// @@ Hm, need to think about these creation API's.  Perhaps
+       /// divide it into "low level" and "high level" calls.  Also,
+       /// perhaps we need a "context" object that contains all
+       /// global-ish flags, libraries, callback pointers, font
+       /// library, etc.
+       ///
+       /// Create a gnash::movie_definition from the given file name.
+       /// Normally, will also try to load any cached data file
+       /// (".gsc") that corresponds to the given movie file.  This
+       /// will still work even if there is no cache file.  You can
+       /// disable the attempts to load cache files by calling
+       /// gnash::use_cache_files(false).
+       ///
+       /// Uses the registered file-opener callback to read the files
+       /// themselves.
+       ///
+       /// This calls add_ref() on the newly created definition; call
+       /// drop_ref() when you're done with it.
+       /// Or use smart_ptr<T> from base/smart_ptr.h if you want.
        movie_definition*       create_movie(const char* filename);
 
-       // Creates the movie from the given input stream.  Only reads
-       // from the given stream; does not open files.  If the movie
-       // imports resources from other movies, the created movie
-       // inserts proxy stubs in place of those resources.  The list
-       // of imported movie filenames can be retrieved with
-       // movie_definition::visit_imported_movies().  The proxies can
-       // be replaced with actual movie_definition's via
-       // movie_definition::resolve_proxy(name,def).
-       //
-       // Use DO_NOT_LOAD_BITMAPS if you have pre-processed bitmaps
-       // stored externally somewhere, and you plan to install them
-       // via get_bitmap_info()->...
+       /// Creates the movie from the given input stream.  Only reads
+       /// from the given stream; does not open files.  If the movie
+       /// imports resources from other movies, the created movie
+       /// inserts proxy stubs in place of those resources.  The list
+       /// of imported movie filenames can be retrieved with
+       /// movie_definition::visit_imported_movies().  The proxies can
+       /// be replaced with actual movie_definition's via
+       /// movie_definition::resolve_proxy(name,def).
+       ///
+       /// Use DO_NOT_LOAD_BITMAPS if you have pre-processed bitmaps
+       /// stored externally somewhere, and you plan to install them
+       /// via get_bitmap_info()->...
        enum create_bitmaps_flag
        {
                DO_LOAD_BITMAPS,
                DO_NOT_LOAD_BITMAPS
        };
-       // Use DO_NOT_LOAD_FONT_SHAPES if you know you have
-       // precomputed texture glyphs (in cached data) and you know
-       // you always want to render text using texture glyphs.
+
+       /// Use DO_NOT_LOAD_FONT_SHAPES if you know you have
+       /// precomputed texture glyphs (in cached data) and you know
+       /// you always want to render text using texture glyphs.
        enum create_font_shapes_flag
        {
                DO_LOAD_FONT_SHAPES,
                DO_NOT_LOAD_FONT_SHAPES
        };
+
        movie_definition*       create_movie_no_recurse(
                tu_file*                input_stream,
                create_bitmaps_flag     cbf,
                create_font_shapes_flag cfs);
 
-       // Create a gnash::movie_definition from the given file name.
-       // This is just like create_movie(), except that it checks the
-       // "library" to see if a movie of this name has already been
-       // created, and returns that movie if so.  Also, if it creates
-       // a new movie, it adds it back into the library.
-       //
-       // The "library" is used when importing symbols from external
-       // movies, so this call might be useful if you want to
-       // explicitly load a movie that you know exports symbols
-       // (e.g. fonts) to other movies as well.
-       //
-       // @@ this explanation/functionality could be clearer!
-       //
-       // This calls add_ref() on the newly created definition; call
-       // drop_ref() when you're done with it.
-       // Or use smart_ptr<T> from base/smart_ptr.h if you want.
+       /// \brief
+       /// Create a gnash::movie_definition from the given file name.
+       ///
+       /// This is just like create_movie(), except that it checks the
+       /// "library" to see if a movie of this name has already been
+       /// created, and returns that movie if so.  Also, if it creates
+       /// a new movie, it adds it back into the library.
+       ///
+       /// The "library" is used when importing symbols from external
+       /// movies, so this call might be useful if you want to
+       /// explicitly load a movie that you know exports symbols
+       /// (e.g. fonts) to other movies as well.
+       ///
+       /// @@ this explanation/functionality could be clearer!
+       ///
+       /// This calls add_ref() on the newly created definition; call
+       /// drop_ref() when you're done with it.
+       /// Or use smart_ptr<T> from base/smart_ptr.h if you want.
        movie_definition*       create_library_movie(const char* filename);
        
 
-       // Helper to pregenerate cached data (basically, shape
-       // tesselations).  Does this by running through each frame of
-       // the movie and displaying the shapes with a null renderer.
-       // The pregenerated data is stored in the movie_definition
-       // object itself, and is included with the cached data written
-       // by movie_definition::output_cached_data().
-       //
-       // Note that this tesselates shapes to the resolution they
-       // explicitly appear in the linear frames of the movie.  Does
-       // not try very hard to run your ActionScript to account for
-       // dynamic scaling (that's more or less futile anyway due to
-       // the halting problem).
+       /// Helper to pregenerate cached data (basically, shape
+       /// tesselations).  Does this by running through each frame of
+       /// the movie and displaying the shapes with a null renderer.
+       /// The pregenerated data is stored in the movie_definition
+       /// object itself, and is included with the cached data written
+       /// by movie_definition::output_cached_data().
+       ///
+       /// Note that this tesselates shapes to the resolution they
+       /// explicitly appear in the linear frames of the movie.  Does
+       /// not try very hard to run your ActionScript to account for
+       /// dynamic scaling (that's more or less futile anyway due to
+       /// the halting problem).
        void    precompute_cached_data(movie_definition* movie_def);
 
-       // Maximum release of resources.  Calls clear_library() and
-       // fontlib::clear(), and also clears some extra internal stuff
-       // that may have been allocated (e.g. global ActionScript
-       // objects).  This should get all gnash structures off the
-       // heap, with the exception of any objects that are still
-       // referenced by the host program and haven't had drop_ref()
-       // called on them.
+       /// Maximum release of resources.  Calls clear_library() and
+       /// fontlib::clear(), and also clears some extra internal stuff
+       /// that may have been allocated (e.g. global ActionScript
+       /// objects).  This should get all gnash structures off the
+       /// heap, with the exception of any objects that are still
+       /// referenced by the host program and haven't had drop_ref()
+       /// called on them.
        void    clear();
 
 
@@ -559,8 +585,8 @@
        // Library management
        //
        
-       // Release any library movies we've cached.  Do this when you want
-       // maximum cleanup.
+       /// Release any library movies we've cached.  Do this when you want
+       /// maximum cleanup.
        void    clear_library();
        
        //
Index: gnash/server/impl.h
diff -u gnash/server/impl.h:1.4 gnash/server/impl.h:1.5
--- gnash/server/impl.h:1.4     Wed Jan 25 18:03:25 2006
+++ gnash/server/impl.h Thu Jan 26 00:15:57 2006
@@ -53,6 +53,7 @@
        void save_extern_movie(movie_interface* m);
 
        // Extra internal interfaces added to movie_definition
+       // @@@ why not adding to movie_definition instead ?
        struct movie_definition_sub : public movie_definition
        {
                virtual const array<execute_tag*>&      get_playlist(int 
frame_number) = 0;
@@ -91,13 +92,16 @@
        movie_interface*        
create_library_movie_inst_sub(movie_definition_sub* md);
 
 //v for extern movies
+
        movie_interface*        create_library_movie_inst(movie_definition* md);
+
        movie_interface*        get_current_root();
        void set_current_root(movie_interface* m);
        const char* get_workdir();
        void set_workdir(const char* dir);
        void delete_unused_root();
 
+       // @@@ another one ???
        struct movie : public movie_interface
        {
                virtual void set_extern_movie(movie_interface* m) { }
@@ -379,8 +383,10 @@
        };
 
 
-       // character is a live, stateful instance of a character_def.
-       // It represents a single active element in a movie.
+       /// Character is a live, stateful instance of a character_def.
+       //
+       /// It represents a single active element in a movie.
+       ///
        struct character : public movie
        {
                int             m_id;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]