<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Cross-Platform Programming with wxWidgets &#187; Libraries</title>
	<atom:link href="http://wxwidgets.info/category/libraries/feed/" rel="self" type="application/rss+xml" />
	<link>http://wxwidgets.info</link>
	<description>Just Make It Cross-Platform</description>
	<lastBuildDate>Tue, 09 Mar 2010 20:50:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>wxJSON 1.1.0 Released</title>
		<link>http://wxwidgets.info/wxjson-1-1-0-released/</link>
		<comments>http://wxwidgets.info/wxjson-1-1-0-released/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 14:07:08 +0000</pubDate>
		<dc:creator>T-Rex</dc:creator>
				<category><![CDATA[Libraries]]></category>
		<category><![CDATA[wxWidgets]]></category>
		<category><![CDATA[wxJSON]]></category>

		<guid isPermaLink="false">http://wxwidgets.info/?p=580</guid>
		<description><![CDATA[JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. It is based on a subset of the JavaScript Programming Language, Standard ECMA-262 3rd Edition &#8211; December 1999. JSON is a text format that is completely language independent [...]]]></description>
			<content:encoded><![CDATA[<p>JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. It is based on a subset of the JavaScript Programming Language, Standard ECMA-262 3rd Edition &#8211; December 1999. JSON is a text format that is completely language independent but uses conventions that are familiar to programmers of the C-family of languages, including C, C++, C#, Java, JavaScript, Perl, Python, and many others. These properties make JSON an ideal data-interchange language.</p>
<p>The wxJSON library is a complete implementation of the JSON data-interchange format. All JSON specifications are implemented in this library plus some extensions in the writer and in the parser class.</p>
<p>Today <strong>wxJSON 1.1.0</strong> was announced. This release is compatible with both wxWidgets 2.8 and 2.9. It is also compatible with wxWidgets SVN HEAD. N<span>ow JSON reader and writer only process UTF-8 encoded text as a stream.<br />
Also added a new wxJSONValue&#8217;s member function to get values and fixed the bugs in wxJSONValue::IsSameAs()</span></p>
<ul>
<li><a href="http://wxcode.sourceforge.net/docs/wxjson/" target="_blank">Official home page of wxJSON</a></li>
<li><span><a title="wxJSON 1.1 Release Notes" href="http://luccat.users.sourceforge.net/wxjson/docs/wxjson_whatsnew.html" target="_blank">Read complete list of changes in this version</a><br />
</span></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://wxwidgets.info/wxjson-1-1-0-released/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Cross-Platform Way of Obtaining MAC Address of Your Machine</title>
		<link>http://wxwidgets.info/cross-platform-way-of-obtaining-mac-address-of-your-machine/</link>
		<comments>http://wxwidgets.info/cross-platform-way-of-obtaining-mac-address-of-your-machine/#comments</comments>
		<pubDate>Sun, 30 Aug 2009 12:04:45 +0000</pubDate>
		<dc:creator>T-Rex</dc:creator>
				<category><![CDATA[Components]]></category>
		<category><![CDATA[Libraries]]></category>
		<category><![CDATA[wxWidgets]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[wxWinCE]]></category>

		<guid isPermaLink="false">http://wxwidgets.info/?p=557</guid>
		<description><![CDATA[In one of my current projects I had to implement client-server communication and protection by MAC address when client machine can&#8217;t connect to server if its MAC address is not allowed, regardless of network or broadband connection. But what was a surprise that wxWidgets does not have API which allows obtaining MAC address in cross-platform [...]]]></description>
			<content:encoded><![CDATA[<p>In one of my current projects I had to implement client-server communication and protection by MAC address when client machine can&#8217;t connect to server if its MAC address is not allowed, regardless of network or <a href="http://www.o2.co.uk/">broadband</a> connection. But what was a surprise that wxWidgets does not have API which allows obtaining MAC address in cross-platform way. So, I decided to write a small class which allows obtainig MAC address for Windows, Linux, Mac OS and Windows Mobile. Here it is:<br />
<span id="more-557"></span><br />
<strong>MACAddressUtility.h</strong></p>
<pre class="brush: cpp;">
#ifndef _MACADDRESS_UTILITY_H
#define _MACADDRESS_UTILITY_H

class MACAddressUtility
{
public:
	static long GetMACAddress(unsigned char * result);
private:
#if defined(WIN32) || defined(UNDER_CE)
	static long GetMACAddressMSW(unsigned char * result);
#elif defined(__APPLE__)
	static long GetMACAddressMAC(unsigned char * result);
#elif defined(LINUX) || defined(linux)
	static long GetMACAddressLinux(unsigned char * result);
#endif
};

#endif
</pre>
<p><strong>MACAddressUtility.cpp</strong></p>
<pre class="brush: cpp;">
#include &quot;MACAddressUtility.h&quot;

#include &lt;stdio.h&gt;

#if defined(WIN32) || defined(UNDER_CE)
#	include &lt;windows.h&gt;
#	if defined(UNDER_CE)
#		include &lt;Iphlpapi.h&gt;
#	endif
#elif defined(__APPLE__)
#	include &lt;CoreFoundation/CoreFoundation.h&gt;
#	include &lt;IOKit/IOKitLib.h&gt;
#	include &lt;IOKit/network/IOEthernetInterface.h&gt;
#	include &lt;IOKit/network/IONetworkInterface.h&gt;
#	include &lt;IOKit/network/IOEthernetController.h&gt;
#elif defined(LINUX) || defined(linux)
#	include &lt;string.h&gt;
#	include &lt;net/if.h&gt;
#	include &lt;sys/ioctl.h&gt;
#   include &lt;sys/socket.h&gt;
#   include &lt;arpa/inet.h&gt;
#endif

long MACAddressUtility::GetMACAddress(unsigned char * result)
{
	// Fill result with zeroes
	memset(result, 0, 6);
	// Call appropriate function for each platform
#if defined(WIN32) || defined(UNDER_CE)
	return GetMACAddressMSW(result);
#elif defined(__APPLE__)
	return GetMACAddressMAC(result);
#elif defined(LINUX) || defined(linux)
	return GetMACAddressLinux(result);
#endif
	// If platform is not supported then return error code
	return -1;
}

#if defined(WIN32) || defined(UNDER_CE)

inline long MACAddressUtility::GetMACAddressMSW(unsigned char * result)
{

#if defined(UNDER_CE)
	IP_ADAPTER_INFO AdapterInfo[16]; // Allocate information
	DWORD dwBufLen = sizeof(AdapterInfo); // Save memory size of buffer
	if(GetAdaptersInfo(AdapterInfo, &amp;dwBufLen) == ERROR_SUCCESS)
	{
		memcpy(result, AdapterInfo-&gt;Address, 6);
	}
	else return -1;
#else
	UUID uuid;
	if(UuidCreateSequential(&amp;uuid) == RPC_S_UUID_NO_ADDRESS) return -1;
	memcpy(result, (char*)(uuid.Data4+2), 6);
#endif
	return 0;
}

#elif defined(__APPLE__)

static kern_return_t FindEthernetInterfaces(io_iterator_t *matchingServices)
{
    kern_return_t		kernResult;
    CFMutableDictionaryRef	matchingDict;
    CFMutableDictionaryRef	propertyMatchDict;

    matchingDict = IOServiceMatching(kIOEthernetInterfaceClass);

    if (NULL != matchingDict)
	{
        propertyMatchDict =
			CFDictionaryCreateMutable(kCFAllocatorDefault, 0,
				&amp;kCFTypeDictionaryKeyCallBacks,
				&amp;kCFTypeDictionaryValueCallBacks);

        if (NULL != propertyMatchDict)
		{
            CFDictionarySetValue(propertyMatchDict,
				CFSTR(kIOPrimaryInterface), kCFBooleanTrue);
            CFDictionarySetValue(matchingDict,
				CFSTR(kIOPropertyMatchKey), propertyMatchDict);
            CFRelease(propertyMatchDict);
        }
    }
    kernResult = IOServiceGetMatchingServices(kIOMasterPortDefault,
		matchingDict, matchingServices);
    return kernResult;
}

static kern_return_t GetMACAddress(io_iterator_t intfIterator,
								   UInt8 *MACAddress, UInt8 bufferSize)
{
    io_object_t		intfService;
    io_object_t		controllerService;
    kern_return_t	kernResult = KERN_FAILURE;

	if (bufferSize &lt; kIOEthernetAddressSize) {
		return kernResult;
	}

    bzero(MACAddress, bufferSize);

    while (intfService = IOIteratorNext(intfIterator))
    {
        CFTypeRef	MACAddressAsCFData;        

        // IONetworkControllers can't be found directly by the IOServiceGetMatchingServices call,
        // since they are hardware nubs and do not participate in driver matching. In other words,
        // registerService() is never called on them. So we've found the IONetworkInterface and will
        // get its parent controller by asking for it specifically.

        // IORegistryEntryGetParentEntry retains the returned object,
		// so release it when we're done with it.
        kernResult =
			IORegistryEntryGetParentEntry(intfService,
				kIOServicePlane,
				&amp;controllerService);

        if (KERN_SUCCESS != kernResult) {
            printf(&quot;IORegistryEntryGetParentEntry returned 0x%08x\n&quot;, kernResult);
        }
        else {
            // Retrieve the MAC address property from the I/O Registry in the form of a CFData
            MACAddressAsCFData =
				IORegistryEntryCreateCFProperty(controllerService,
					CFSTR(kIOMACAddress),
					kCFAllocatorDefault,
					0);
            if (MACAddressAsCFData) {
                CFShow(MACAddressAsCFData); // for display purposes only; output goes to stderr

                // Get the raw bytes of the MAC address from the CFData
                CFDataGetBytes((CFDataRef)MACAddressAsCFData,
					CFRangeMake(0, kIOEthernetAddressSize), MACAddress);
                CFRelease(MACAddressAsCFData);
            }

            // Done with the parent Ethernet controller object so we release it.
            (void) IOObjectRelease(controllerService);
        }

        // Done with the Ethernet interface object so we release it.
        (void) IOObjectRelease(intfService);
    }

    return kernResult;
}

long MACAddressUtility::GetMACAddressMAC(unsigned char * result)
{
	io_iterator_t	intfIterator;
	kern_return_t	kernResult = KERN_FAILURE;
	do
	{
		kernResult = ::FindEthernetInterfaces(&amp;intfIterator);
		if (KERN_SUCCESS != kernResult) break;
	    kernResult = ::GetMACAddress(intfIterator, (UInt8*)result, 6);
    }
	while(false);
    (void) IOObjectRelease(intfIterator);
}

#elif defined(LINUX) || defined(linux)

long MACAddressUtility::GetMACAddressLinux(unsigned char * result)
{
	struct ifreq ifr;
    struct ifreq *IFR;
    struct ifconf ifc;
    char buf[1024];
    int s, i;
    int ok = 0;

    s = socket(AF_INET, SOCK_DGRAM, 0);
    if (s == -1)
	{
        return -1;
    }

    ifc.ifc_len = sizeof(buf);
    ifc.ifc_buf = buf;
    ioctl(s, SIOCGIFCONF, &amp;ifc);

    IFR = ifc.ifc_req;
    for (i = ifc.ifc_len / sizeof(struct ifreq); --i &gt;= 0; IFR++)
	{
        strcpy(ifr.ifr_name, IFR-&gt;ifr_name);
        if (ioctl(s, SIOCGIFFLAGS, &amp;ifr) == 0)
		{
            if (! (ifr.ifr_flags &amp; IFF_LOOPBACK))
			{
                if (ioctl(s, SIOCGIFHWADDR, &amp;ifr) == 0)
				{
                    ok = 1;
                    break;
                }
            }
        }
    }

    shutdown(s, SHUT_RDWR);
    if (ok)
	{
        bcopy( ifr.ifr_hwaddr.sa_data, result, 6);
    }
    else
	{
        return -1;
    }
    return 0;
}

#endif
</pre>
<p><strong>wxMACAddressUtility.h</strong></p>
<pre class="brush: cpp;">
#ifndef _WX_MACADDRESS_UTILITY_H
#define _WX_MACADDRESS_UTILITY_H

#include &quot;MACAddressUtility.h&quot;
#include &lt;wx/wx.h&gt;

class wxMACAddressUtility
{
public:
	static wxString GetMACAddress()
	{
		unsigned char result[6];
		if(MACAddressUtility::GetMACAddress(result) == 0)
		{
			return wxString::Format(wxT(&quot;%02X:%02X:%02X:%02X:%02X:%02X&quot;),
				(unsigned int)result[0], (unsigned int)result[1], (unsigned int)result[2],
				(unsigned int)result[3], (unsigned int)result[4], (unsigned int)result[5]);
		}
		return wxEmptyString;
	}
};

#endif
</pre>
<p><strong>Sample of usage:</strong></p>
<pre class="brush: cpp;">
m_MACAddress = wxMACAddressUtility::GetMACAddress();
</pre>
<p><a href="http://wxwidgets.info//wp-content/uploads/2009/08/macaddr.jpg"><img src="http://wxwidgets.info//wp-content/uploads/2009/08/macaddr.jpg" alt="Get MAC address programmatically" title="Get MAC address programmatically" width="226" height="67" class="alignnone size-full wp-image-558" /></a></p>
<p>As you can see, core class does not depend on wxWidgets and can be used in native applications written without wxWidgets.</p>
<p><a href="http://wxwidgets.info//wp-content/uploads/2009/08/wxMACAddressUtility.7z" title="How to get MAC address in C++: Windows, Linux, Mac OS, Windows Mobile">Download sample application</a></p>
]]></content:encoded>
			<wfw:commentRss>http://wxwidgets.info/cross-platform-way-of-obtaining-mac-address-of-your-machine/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Taking Screenshots with wxWidgets under Mac OS is Really Tricky.</title>
		<link>http://wxwidgets.info/taking-screenshots-with-wxwidgets-under-mac-os-is-really-tricky/</link>
		<comments>http://wxwidgets.info/taking-screenshots-with-wxwidgets-under-mac-os-is-really-tricky/#comments</comments>
		<pubDate>Thu, 21 May 2009 21:30:00 +0000</pubDate>
		<dc:creator>T-Rex</dc:creator>
				<category><![CDATA[Components]]></category>
		<category><![CDATA[Libraries]]></category>
		<category><![CDATA[Articles]]></category>
		<category><![CDATA[wxWidgets]]></category>

		<guid isPermaLink="false">http://wxwidgets.info/?p=550</guid>
		<description><![CDATA[Taking screenshots is a very common task and it was a must for one of my current projects. What was a surprise when I understood that my favourite toolkit can&#8217;t do that in cross-platform manner. It is official bug that wxScreenDC does not work properly under Mac OS and you can&#8217;t use Blit() message for [...]]]></description>
			<content:encoded><![CDATA[<p>Taking screenshots is a very common task and it was a must for one of my current projects. What was a surprise when I understood that my favourite toolkit can&#8217;t do that in cross-platform manner.</p>
<p>It is <a href="http://trac.wxwidgets.org/ticket/9486">official bug</a> that wxScreenDC does not work properly under Mac OS and you can&#8217;t use Blit() message for copying screen onto wxMemoryDC.</p>
<p>After digging the Internet I found a kind of solution which used OpenGL and created wxWidgets-based class which takes screenshots also under Mac OS. It was really hard task for me because I haven&#8217;t used neither Carbon nor Cocoa before. However everything works now and I&#8217;m happy.</p>
<p>Here it is:<br />
<span id="more-550"></span><br />
<strong>wxScreenshotMaker.h</strong></p>
<pre class="brush: cpp;">
#pragma once

#include &lt;wx/wx.h&gt;
#ifdef __WXMAC__
#include &lt;OpenGL/OpenGL.h&gt;
#endif

class wxScreenshotMaker
{
public:
	wxScreenshotMaker();
	~wxScreenshotMaker();
	wxBitmap GetScreenshot();
private:
#ifdef __WXMAC__

	int screenWidth;
	int screenHeight;

	CGLContextObj glContextObj;
	int rowSize;
	unsigned char * glBitmapData;
	unsigned char * glRowData;

	void InitOpenGL();
	void GrabGLScreen();
	void SwizzleBitmap();
	void FinalizeOpenGL();
#endif
};
</pre>
<p><strong>wxScreenshotMaker.cpp</strong></p>
<pre class="brush: cpp;">
#include &quot;wxScreenshotMaker.h&quot;
#ifndef __WXMAC__
#include &lt;wx/dcscreen.h&gt;
#else
#include &lt;CoreFoundation/CoreFoundation.h&gt;
#include &lt;ApplicationServices/ApplicationServices.h&gt;
#include &lt;OpenGL/gl.h&gt;
#endif

wxScreenshotMaker::wxScreenshotMaker()
#ifdef __WXMAC__
: screenWidth(0), screenHeight(0), glBitmapData(NULL), glRowData(NULL)
#endif
{
#ifdef __WXMAC__
	wxSize size = wxGetDisplaySize();
	screenWidth = size.GetWidth();
	screenHeight = size.GetHeight();
	InitOpenGL();
#endif
}

wxScreenshotMaker::~wxScreenshotMaker()
{
#ifdef __WXMAC__
	FinalizeOpenGL();
#endif
}

wxBitmap wxScreenshotMaker::GetScreenshot()
{
#ifndef __WXMAC__
	wxScreenDC screenDC;
	wxBitmap bmp(screenDC.GetSize().GetWidth(), screenDC.GetSize().GetHeight());
	wxMemoryDC mdc(bmp);
	mdc.Blit(0, 0, bmp.GetWidth(), bmp.GetHeight(), &amp;screenDC, 0, 0);
	mdc.SelectObject(wxNullBitmap);
	return bmp;
#else
	if(glBitmapData)
	{
		GrabGLScreen();
		wxImage img = wxImage(screenWidth, screenHeight, glBitmapData, true);
		return wxBitmap(img.Copy());
	}
#endif
}

#ifdef __WXMAC__

void wxScreenshotMaker::InitOpenGL()
{
	do
	{
		rowSize = screenWidth * 3;
		rowSize = (rowSize + 2) &amp; ~2;

		glRowData = (unsigned char *)realloc(glRowData, rowSize);
		glBitmapData = (unsigned char *)realloc(glBitmapData, rowSize * screenHeight);

		bzero(glRowData, rowSize);
		bzero(glBitmapData, rowSize * screenHeight);

		CGDirectDisplayID display = CGMainDisplayID();
		CGLPixelFormatObj pixelFormatObj ;
		GLint numPixelFormats;
		CGLPixelFormatAttribute attribs[] =
		{
			kCGLPFAFullScreen,
			kCGLPFADisplayMask,
			(CGLPixelFormatAttribute)0,    /* Display mask bit goes here */
			(CGLPixelFormatAttribute)0
		};

		attribs[2] = (CGLPixelFormatAttribute) CGDisplayIDToOpenGLDisplayMask(display);

		/* Build a full-screen GL context */
		CGLChoosePixelFormat( attribs, &amp;pixelFormatObj, &amp;numPixelFormats );
		if ( pixelFormatObj == NULL ) break;
		CGLCreateContext( pixelFormatObj, NULL, &amp;glContextObj ) ;
		CGLDestroyPixelFormat( pixelFormatObj ) ;
		if ( glContextObj == NULL ) break;
		CGLSetCurrentContext( glContextObj ) ;
		CGLSetFullScreen( glContextObj ) ;
	}
	while(false);
}

void wxScreenshotMaker::FinalizeOpenGL()
{
    CGLSetCurrentContext( NULL );
    CGLClearDrawable( glContextObj );
    CGLDestroyContext( glContextObj );
	free(glRowData);
	free(glBitmapData);
}

void wxScreenshotMaker::GrabGLScreen()
{
	glReadBuffer(GL_FRONT);
    /* Read framebuffer into our bitmap */
    glFinish();
    glPixelStorei(GL_PACK_ALIGNMENT, 3);
    glPixelStorei(GL_PACK_ROW_LENGTH, 0);
    glPixelStorei(GL_PACK_SKIP_ROWS, 0);
    glPixelStorei(GL_PACK_SKIP_PIXELS, 0);
    /*
      * Fetch the data in RGB format, matching the bitmap context.
      */
    glReadPixels((GLint)0, (GLint)0, (GLint)screenWidth, (GLint)screenHeight,
		GL_RGB, GL_BYTE, glBitmapData);

	SwizzleBitmap();
}

void wxScreenshotMaker::SwizzleBitmap()
{
	int top, bottom;
	top = 0;
    bottom = screenHeight - 1;
	void * base = glBitmapData;
	void * topP = NULL;
	void * bottomP = NULL;

	while(top &lt; bottom)
	{
		topP = (void *)((top * rowSize) + (intptr_t)base);
        bottomP = (void *)((bottom * rowSize) + (intptr_t)base);

		bcopy( topP, glRowData, rowSize );
        bcopy( bottomP, topP, rowSize );
        bcopy( glRowData, bottomP, rowSize );

        ++top;
        --bottom;
	}
}

#endif
</pre>
<p><strong>Sample</strong></p>
<pre class="brush: cpp;">
wxScreenshotMaker screenshot;
m_Canvas-&gt;SetBitmap(screenshot.GetScreenshot());
m_Canvas-&gt;Refresh();
</pre>
<p><a title="Download source code: Take screenshot with wxWidgets under Mac OS" href="http://wxwidgets.info//wp-content/uploads/2009/05/wxscreenshotmaker.zip">Download wxScreenshotMaker and sample project</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://wxwidgets.info/taking-screenshots-with-wxwidgets-under-mac-os-is-really-tricky/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>AxTk: An Accessibility Toolkit for wxWidgets</title>
		<link>http://wxwidgets.info/axtk-an-accessibility-toolkit-for-wxwidgets/</link>
		<comments>http://wxwidgets.info/axtk-an-accessibility-toolkit-for-wxwidgets/#comments</comments>
		<pubDate>Thu, 07 May 2009 16:07:54 +0000</pubDate>
		<dc:creator>T-Rex</dc:creator>
				<category><![CDATA[Components]]></category>
		<category><![CDATA[Libraries]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[wxWidgets]]></category>

		<guid isPermaLink="false">http://wxwidgets.info/?p=546</guid>
		<description><![CDATA[http://code.google.com/p/axtk/ What is AxTk? AxTk (pronounced Ay Ex Tee Kay) is an open source, C++ add-on for wxWidgets that helps developers create highly accessible, talking applications for users with impaired vision. It may also be useful for other impairments that benefit from a simplified user interface. AxTk features a new menu-based system that is easy [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://code.google.com/p/axtk/" target="_blank">http://code.google.com/p/axtk/</a></p>
<h4>What is AxTk?</h4>
<p><strong>AxTk</strong> (pronounced Ay Ex Tee Kay) <strong>is an open source, C++ add-on for wxWidgets that helps developers create highly accessible, talking applications for users with impaired vision</strong>. It may also be useful for other impairments that benefit from a simplified user interface.</p>
<p>AxTk features a new menu-based system that is easy to learn and use, in addition to providing adaptation for some existing GUI controls and dialogs. The developer can choose whether to use the menu system, or to adapt an existing application UI, or use a combination of methods.</p>
<p>AxTk is cross-platform (tested so far on Windows XP, Linux and Mac OS X 10.5), and includes text-to-speech classes with the ability to drive SAPI 5, Apple Speech Synthesis Manager, eSpeak, and Cepstral. Other speech engines can be driven by writing additional handlers.</p>
<p>Note that AxTk is a work in progress and the API is subject to change.<br />
<span id="more-546"></span></p>
<h4>What else is AxTk?</h4>
<p>There is an additional, higher-level layer for building applications that help the user maintain &#8216;resource libraries&#8217; for all kinds of files and services. The motivation is to provided simplified access to many resources and activities that are currently spread amongst many applications and web sites. By making this part of AxTk, we increase the chances of providing a really useful, accessible application platform that can be customised in interesting ways for individuals or government sectors. However, this is currently a less well-developed aspect of AxTk and one which you can ignore fo now. The resource demo shows playing of audio albums and reading Epub books (having converted the XHTML content to plain text first).</p>
<h4>What about Braille output?</h4>
<p>Although nothing is specifically coded yet for Braille devices, they could be supported relatively easily by adding handlers to the wxTextToSpeech system, to output to the device instead of a speech engine.</p>
<h4>Why not just use a screen reader?</h4>
<p>Screen readers don&#8217;t have an in-depth knowledge of the application; in theory, an AxTk application can make use of knowledge of its own structure to make speech more helpful and less verbose. Also, an application&#8217;s custom controls are not accessible to screen readers. In additon, AxTk provides an alternative, menu-based user interface that is not so prone to the problems of accessing conventional layouts via a screen reader. Finally, an AxTk application provides support for application-wide colour and text size changes that are harder to achieve in an ad-hoc way.</p>
<h4>Is this anything to do with MSAA (Microsoft Active Accessibility)?</h4>
<p>No; a different approach is used. Although wxWidgets has some basic MSAA support, other ports have no similar support and it may be hard to create a comprehensive cross-platform solution to accessibility based on OS-level accessibility support. It would still leave applications and users at the mercy of particular screen readers and it would not solve other problems that AxTk sets out to solve: visual adaptation, fine control over speech (such as content voicing), customisable shortcut support, and more.</p>
<p>Having said that, work on integrating MSAA equivalents for other platforms would be very welcome, either as part of AxTk or built into wxWidgets.</p>
<h4>How hard is it to use?</h4>
<p>Apart from some housekeeping that you can pinch from the sample, the amount of extra code can be small if you&#8217;re just adapting existing UIs. For example, to make a dialog self-voicing and responsive to visual appearance changes (assuming the dialog&#8217;s controls are in the set of controls currently handled by AxTk):</p>
<pre class="brush: cpp;">
#include &quot;ax/ax_ui_adaptation.h&quot;
...
class MyDialog: public wxDialog
{
    ...
    AxSelfVoicing m_adapter;
};

MyDialog::MyDialog(...)
{
    ...
    m_adapter.Adapt(this);
}
</pre>
<p>If you have controls that are not currently handled by AxTk, you can write adapter classes and also handler classes that detect the appropriate controls and create their adapters.</p>
<p>Using the new menu system is also pretty straightforward as you can see from the sample (mainframe.cpp). There are some new concepts such as AxActivator, which handles menu item activation, but there&#8217;s plenty in common with conventional wxWidgets programming.</p>
<h4>Where and how do I get it?</h4>
<p>AxTk is hosted at Google Code and is available via SVN or as a source tarball or zip file.</p>
<p><a href="http://code.google.com/p/axtk/" target="_blank">http://code.google.com/p/axtk/</a></p>
<p>The discussion group is axtk-dev_at_googlegroups.com.</p>
<p>The documentation is available here:</p>
<p><a href="http://www.anthemion.co.uk/axtk/html/index.html" target="_blank">http://www.anthemion.co.uk/axtk/html/index.html</a></p>
<h4>Are there demos?</h4>
<p>Yes; you can download axsample binaries for Windows, Linux and Mac from:</p>
<p><a href="http://www.anthemion.co.uk/axtk/" target="_blank">http://www.anthemion.co.uk/axtk/</a></p>
<p>You can ignore axresourcesample unless you&#8217;re interested in the higher-level resource library layer mentioned previously.</p>
<h4>Can I contribute?</h4>
<p>Please do! See docs/todo.txt for some of the things left to do. You&#8217;ll probably find things to do yourself. You can supply patches in the AxTk&#8217;s Issue Tracker, or you can ask to be added to the list of project members in order to make changes in SVN.</p>
<h4>What&#8217;s the build system?</h4>
<p>None to speak of. This would make a good contribution. Currently you can use DialogBlocks to generate projects and makefiles for the two samples, which simply include all the AxTk code.</p>
<h4>What is the license?</h4>
<p>The license is the New BSD License, which is very brief, easy to understand, and industry-friendly. Please see license.txt in the source tarball for details.</p>
<p>I hope you find AxTk useful &#8211; or at least, fun to play with.</p>
]]></content:encoded>
			<wfw:commentRss>http://wxwidgets.info/axtk-an-accessibility-toolkit-for-wxwidgets/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
