paragui-users
[Top][All Lists]
Advanced

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

Re: [paragui-users] want to run my dll idea for pg past anyone who cares


From: Alexander Pipelka
Subject: Re: [paragui-users] want to run my dll idea for pg past anyone who cares to look
Date: 04 Jun 2002 22:32:54 +0200

Yeah. Just noticed the flaw in the concept :)

Ok. 2 opportunities:

- the previous solution with the following extension:
typedef struct {
  const char* tag;      // name of my tag in the head section
  const char** atts;    // list of attributes in the tag
} PG_XMLTagAtts

PARAGUI_CALLBACK(my_xmlhandler) {
  PG_XMLTagAtts* atts = (PG_XMLTagAtts*)data;

  char+ mytag = atts->tag;

  if(strcmp(mytag, "mytag") == 0) {
    char* mystring = PG_Layout::GetParamStr(atts, "customtagname");
    int myint = PG_Layout::GetParamInt(atts, "customint");
  }
}

<head>
  <mytag customtagname="mystring" customint="666"/>
</head>

- register a simple callback function
bool ProcessHeadAtts(PG_XMLTagAtts* atts);


Alex


Am Die, 2002-06-04 um 22.17 schrieb Andrew Ford:
> Seems good to me, except for the char**.  How does
> GetParamStr work, and how do we know which
> "customtagname" to ask for in the handler?
> I was thinking of registering a handler with a custom
> tag that it handles.
> 
> --- Alexander Pipelka <address@hidden> wrote:
> > Yep. I would also prefer some kind of hook-system.
> > 
> > What about adding a new messagetype (e.g.
> > MSG_XMLHEADATTS).
> > With this it would be possible to add a
> > messagehandler (e.g. to a
> > PG_Application object) to process the event.
> > 
> > app.SetCallback(MSG_XMLHEADATTS, &my_xmlhandler);
> > 
> > PARAGUI_CALLBACK(my_xmlhandler) {
> >     atts = (const char**)data;
> > 
> >     char* val = PG_Layout::GetParamStr(atts,
> > "customtagname");
> > }
> > 
> > Maybe a solution ? 
> > 
> > Alex
> > 
> > Am Die, 2002-06-04 um 21.05 schrieb Andrew Ford:
> > > I don't know how many people would use that
> > feature
> > > regularly.  Seems a bit bloaty to me.  How about
> > > adding hooks to the layout parser to enable
> > > application specific tag processing?  Or how about
> > a
> > > plugin-like system for the layout parser?  Is this
> > > possible?
> > > 
> > > Andrew.
> > > 
> > > --- Keith Swyer <address@hidden> wrote:
> > > > well, i have been asking a few questions about
> > dlls
> > > > and pg etc latley, so i
> > > > thought i'd run my idea by you...
> > > > 
> > > > - make changes to the loadlayout to incorporate
> > a
> > > > tag in the head for any
> > > > dlls you want to dynamically load
> > > > in your app at runtime. somthing like...
> > > > 
> > > >     <DLL name proxyname baseclass>
> > > > 
> > > >     name - the name of the dll
> > > >     proxyname - the name of the exported
> > function
> > > > that will instantiate your
> > > > new class
> > > >     baseclass - the baseclass that your new
> > class
> > > > uses (maybe not needed)
> > > > 
> > > > - in the loadlayout function all of the dlls
> > will be
> > > > loaded and instantiated
> > > > into a list held in the PG_Application class
> > > >          map <string, baseclass *, less<string>
> > >
> > > > _map;
> > > > 
> > > >     we can then load the dll and insert a new
> > class:
> > > >         _map[name] = instantiate(proxyname)
> > > > 
> > > >  of coarse one limitation is easily seen.....you
> > can
> > > > only use one baseclass
> > > > type for ALL dlls used
> > > > 
> > > > - now, back in your main program you will be
> > able to
> > > > access the _map with
> > > > all of the classes and since they are
> > > > all derived from your baseclass, you don't need
> > to
> > > > know the names of them to
> > > > call functions. and with the map, you can get
> > the
> > > > name of the new class.
> > > > 
> > > > PG_Application will possibly need a few new
> > members.
> > > > ??
> > > > 
> > > > - personally, what i am trying to accomplish is
> > the
> > > > following.
> > > > 
> > > > the main app loads a layout which is the 'main
> > menu'
> > > > and given any dlls in
> > > > the <head> new buttons are added
> > > > to the menu. I am not worried about doing this
> > > > dynamically, whenever new
> > > > dlls are added, you change this main
> > > > layout to add new buttons.  now with the new
> > buttons
> > > > attached to their dlls,
> > > > pressing a button will bring you to
> > > > a new 'area', hiding the main menu and showing
> > all
> > > > of the new 'area' by
> > > > calling a member such as ShowArea() in the dll.
> > THe
> > > > class in the dll in turn
> > > > holds a list of all of its widgets so that we
> > can
> > > > show/hide all of them
> > > > witout have to destroy then create them again by
> > > > moving b/w 'areas'.
> > > > 
> > > > anyway, can anyone see any major flaws or see
> > > > anything that should be
> > > > added.?
> > > > 
> > > > -Keith
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > _______________________________________________
> > > > paragui-users mailing list
> > > > address@hidden
> > > >
> > >
> >
> http://mail.freesoftware.fsf.org/mailman/listinfo/paragui-users
> > > 
> > > 
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Yahoo! - Official partner of 2002 FIFA World Cup
> > > http://fifaworldcup.yahoo.com
> > > 
> > > _______________________________________________
> > > paragui-users mailing list
> > > address@hidden
> > >
> >
> http://mail.freesoftware.fsf.org/mailman/listinfo/paragui-users
> > 
> > 
> > 
> > 
> > _______________________________________________
> > paragui-users mailing list
> > address@hidden
> >
> http://mail.freesoftware.fsf.org/mailman/listinfo/paragui-users
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! - Official partner of 2002 FIFA World Cup
> http://fifaworldcup.yahoo.com
> 
> _______________________________________________
> paragui-users mailing list
> address@hidden
> http://mail.freesoftware.fsf.org/mailman/listinfo/paragui-users






reply via email to

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