wxruby-dev
[Top][All Lists]
Advanced

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

Re: [Wxruby-dev] Request for non-coding assistance


From: Richard Kilmer
Subject: Re: [Wxruby-dev] Request for non-coding assistance
Date: Sat, 31 May 2003 18:41:01 -0400

OK...so here you go. It was a bit nasty to parse out some of the destructors and stuff...but here the jist of it. I have a file (attached) named 'parse_wxdoc.rb'. Drop it in the doc/latex/wx dir. It actually builds an object structure:

WxClass
  name
  constructors (array of WxMethods)
  methods (array of WxMethods)

WxMethod
  return_type
  name
  params (array of WxParams)

WxParam
  ptype
  pname

If you run with a parameter "ruby parse_wxdoc.rb frame.tex" it will output the class/methods+params. If you just run this file with "ruby parse_wxdoc.rb" it will iterate over all of the .tex files and try and parse them. There is a whole slew it cannot parse (and it lists those), but it gets the majority of them. It then outputs the class/methods+params. Its easy from this point to generate whatever you want insofar as a format goes.

Let me know if this works for you.

Best,

Rich

Attachment: parse_wxdoc.rb
Description: Binary data


On Saturday, May 31, 2003, at 04:56  PM, Kevin Smith wrote:

Awesome!

The format itself is quite flexible, so let me know what the absolute
easiest extraction looks like, and I can let you know if it's sufficient
or if it needs more tweaking.

Thanks,

Kevin


On Sat, 2003-05-31 at 12:27, Richard Kilmer wrote:
OK...this will be pretty easy...I am going to parse the latex source
with a Ruby script and build whatever nice documentation you want.
Should have to a script soon that you can run against the docs/latex/wx
.tex files to generate something that mirrors your hand-generated
version below in an hour or so.

-rich

On Saturday, May 31, 2003, at 02:05  PM, Kevin Smith wrote:

As I templatize each class, I need to insert a list of method
signatures. Theoretically I could grab these out of the wxXxx.h files,
but it turns out they are really ugly if I do that. (See the ugly
example below).

I could grab them out of the online wxWindows reference doc, but they
are spread out so I would have to cut and paste them individually.
Someone could write a little app that extracts the signatures from each
html help page, I suppose.

Or perhaps there's a tool (doxygen? gcc itself?) that can parse a .h
file and spit back a nice consise list of methods for that class?

Anyway, if anyone can figure out how to get me those lists, it will
save
me a bunch of time. If nothing else comes up, I'm probably going to
have
to do it manually myself, so if you want to volunteer to do some manual
cut and pasting, that would be great too.

I'll probably want to use the results of this next weekend.

Kevin


====SAMPLE UGLY LIST, COPIED FROM wx/frame.h====
    virtual void SendSizeEvent() { }
    void SetStatusBarPane(int n) { m_statusBarPane = n; }
    int GetStatusBarPane() const { return m_statusBarPane; }
    void SetStatusBar(wxStatusBar *statBar) { m_frameStatusBar =
statBar; }
    virtual wxStatusBar *GetStatusBar() const { return
m_frameStatusBar;
}
    virtual void SetStatusText(const wxString &text, int number = 0);
    virtual void SetMenuBar(wxMenuBar *menubar);
    virtual wxMenuBar *GetMenuBar() const { return m_frameMenuBar; }
    void PushStatusText(const wxString &text, int number = 0);
    void PopStatusText(int number = 0);
    virtual void SetToolBar(wxToolBar *toolbar) { m_frameToolBar =
toolbar; }
    virtual wxToolBar *GetToolBar() const { return m_frameToolBar; }
    virtual wxStatusBar* CreateStatusBar(int number = 1, long style =
wxST_SIZEGRIP, wxWindowID id = 0, const wxString& name =
wxStatusLineNameStr);
    virtual wxToolBar* CreateToolBar(long style =
wxNO_BORDER|wxTB_HORIZONTAL, wxWindowID id = -1, const wxString& name =
wxToolBarNameStr);

virtual void SetIcon(const wxIcon& icon) { m_icons = wxIconBundle(
icon ); }
    virtual void SetStatusWidths(int widths[])

====PRETTIER VERSION OF THE SAME LIST, BUILT MANUALLY====

    wxStatusBar* CreateStatusBar(int number=1, long
style=wxST_SIZEGRIP,
wxWindowID id=0, const wxString& name=wxStatusLineNameStr);
    wxToolBar* CreateToolBar(long style=wxNO_BORDER|wxTB_HORIZONTAL,
wxWindowID id=-1, const wxString& name=wxToolBarNameStr);
    wxMenuBar *GetMenuBar();
    int GetStatusBarPane();
    wxToolBar *GetToolBar();
    void PopStatusText(int number = 0);
    void PushStatusText(const wxString &text, int number = 0);
    void SendSizeEvent();
    void SetIcon(const wxIcon& icon);
    void SetMenuBar(wxMenuBar *menubar);
    void SetStatusBarPane(int n);
    void SetStatusBar(wxStatusBar *statBar);
    wxStatusBar *GetStatusBar();
    void SetStatusText(const wxString &text, int number = 0);
    void SetStatusWidths(int widths[])
    void SetToolBar(wxToolBar *toolbar);
====




_______________________________________________
Wxruby-dev mailing list
address@hidden
http://mail.nongnu.org/mailman/listinfo/wxruby-dev




_______________________________________________
Wxruby-dev mailing list
address@hidden
http://mail.nongnu.org/mailman/listinfo/wxruby-dev





_______________________________________________
Wxruby-dev mailing list
address@hidden
http://mail.nongnu.org/mailman/listinfo/wxruby-dev


reply via email to

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