Patches: Browse | Submit New | Admin

[#26953] Add the wxMemoryFSHandler and associated functions to wxRuby. Used to load XRC from memory

Date:
2009-08-19 12:52
Priority:
3
Submitted By:
Pascal Hurni (phi)
Assigned To:
Nobody (None)
Category:
None
State:
Open
Summary:
Add the wxMemoryFSHandler and associated functions to wxRuby. Used to load XRC from memory

Detailed description
Using XRC is great, we may design dialog layouts in a WYSIWYG editor.

Now, loading the layout is currently only supported from real files. This is a huge limitation.

Think of receiving a layout from a network connection. Currently you'll have to store it in a temp file, load the design
with XmlResource, delete the temp file.
This is overkill since WxWidgets has an in-house virtual file system.

The patch I propose adds the ability to wxRuby to manage those 'memory' files.

I chose to add some global functions that delegates to the real wxMemoryFSHandler static methods. This is to avoid from
having to swig the entire wxMemoryFSHandler class (and its parents).

Please review the patch and let me know if anything should be changed.

BTW, may this patch be applied (if approved) before the next public release (2.0.1?), Thanx.

Regards,

Pascal

Add A Comment: Notepad

Please login


Followup

Message
Date: 2009-08-23 15:50
Sender: Pascal Hurni

I updated the patch.
Fixes some issue with string encoding (add_memory_file
should consider the string argument like a buffer and must
not do any conversion)
Removed the C++ method overload that dealt with a void*
buffer which ruby can't handle.

Attached Files:

Name Description Download
memoryfs.patch Download
memoryfs2.patch Download

Changes:

Field Old Value Date By
File Added4698: memoryfs2.patch2009-08-23 15:50phi
File Added4691: memoryfs.patch2009-08-19 12:52phi