Re: Edditting - Re: Generic Embeddable plugins

From: <msevior_at_physics.unimelb.edu.au>
Date: Thu Jan 13 2005 - 04:38:20 CET

> On Wed, 2005-01-12 at 14:10 +1100, msevior@physics.unimelb.edu.au wrote:
>> HI Everyone,
>>
>> I just realized that it is easy to add editting to plugins by have
>> having
>> a single extra method to the pluginManager class.
>>
>> virtual bool editMe(UT_sint32 uid);
>>
>> Executing this method edits the object. This can be a simple fork/exec
>> with the contents of the description passed to the external program.
>> After
>> a save operation the altered contents are re-rendered on screen via a
>> changeObject(..) call to the PD_Document. This causes the object and
>> surrounding text to be re-rendered.
>
> neato, except for your function names :-P
>
> s/createMe/construct
> s/editMe/edit or s/editMe/modify
>
 Spoilsport :-)

OK current API is.....

class GR_Graphics;
class UT_ByteBuf;
class PD_Document;
class ABI_EXPORT GR_EmbedView
{
public:
  GR_EmbedView(PD_Document * pDoc, PT_AttrPropIndex api );
  virtual ~GR_EmbedView(void);
  PD_Document * m_pDoc;
  PT_AttrPropIndex m_iAPI;
  bool m_bHasSVGSnapshot;
  bool m_bHasPNGSnapshot;
  UT_ByteBuf m_SVGBuf;
  UT_ByteBuf m_PNGBuf;
}

class ABI_EXPORT GR_Abi_EmbedManager
{
public:
    GR_Abi_EmbedManager(GR_Graphics * pG);
    virtual ~GR_Abi_EmbedManager();
    const char * getObjectType(void) const;
    GR_Abi_EmbedManager * create(GR_Graphics * pG);
    virtual void initialize(void);
    GR_Graphics * getGraphics(void);
    virtual void setGraphics(GR_Graphics * pG);
    virtual UT_sint32 makeEmbedView(PD_Document * pDoc,
PT_AttrPropIndex api) ;
    virtual void setColor(UT_sint32 uid, UT_RGBColor c);
    virtual UT_sint32 getWidth(UT_sint32 uid);
    virtual UT_sint32 getAscent(UT_sint32 uid) ;
    virtual UT_sint32 getDescent(UT_sint32 uid) ;
    virtual void loadEmbedData(UT_sint32 uid);
    virtual void setDefaultFontSize(UT_sint32 uid, UT_sint32);
    virtual void render(UT_sint32 uid, UT_sint32 x, UT_sint32 y);
    virtual void releaseEmbedView(UT_sint32 uid);
    virtual void initializeEmbedView(UT_sint32 uid);
    virtual void makeSnapShot(UT_sint32 uid);
    virtual bool isDefault(void);
    virtual bool modify(UT_sint32 uid);
private:
    GR_Graphics * m_pG;
    UT_Vector<GR_EmbedView *> m_vecSnapshots;
};

I'll look up the netscape plugin API soon.

Cheers

Martin

> ... or something like that ;-)
>
> Rock on,
> Marc
>
>
Received on Thu Jan 13 04:39:29 2005

This archive was generated by hypermail 2.1.8 : Thu Jan 13 2005 - 04:39:30 CET