mirror of https://github.com/BOINC/boinc.git
MGR: Implement Mac accessibility for Statistics and Disk tabs
svn path=/trunk/boinc/; revision=19706
This commit is contained in:
parent
e47b17ae82
commit
9f4d6a14b1
|
@ -9497,3 +9497,25 @@ Rom 24 Nov 2009
|
||||||
|
|
||||||
client/
|
client/
|
||||||
boinc_log.cpp
|
boinc_log.cpp
|
||||||
|
|
||||||
|
Charlie 25 Nov 2009
|
||||||
|
- MGR: Implement Mac accessibility for Statistics and Disk tabs,
|
||||||
|
eliminate screen reader saying "unknown" for intermediate panels,
|
||||||
|
general cleanup of accessibility code and operation.
|
||||||
|
- Mac Sandbox: attempt to fix bug where Manager reports that admin user
|
||||||
|
is not authorized to run BOINC. I haven't been able to reproduce
|
||||||
|
this bug, so this fix is a shot in the dark.
|
||||||
|
|
||||||
|
client/
|
||||||
|
check_security.cpp
|
||||||
|
clientgui/
|
||||||
|
AdvancedFrame.cpp
|
||||||
|
BOINCBaseView.h
|
||||||
|
BOINCListCtrl.cpp, .h
|
||||||
|
BOINCTaskCtrl.cpp
|
||||||
|
ProjectListCtrl.cpp. .h
|
||||||
|
ViewStatistics.cpp, .h
|
||||||
|
common/
|
||||||
|
wxPieCtrl.cpp, .h
|
||||||
|
Mac/
|
||||||
|
MacAccessibility.cpp
|
||||||
|
|
|
@ -679,6 +679,11 @@ bool CAdvancedFrame::CreateNotebook( bool /* bRPCsSafe */ ) {
|
||||||
pPanel->SetSizer(pPanelSizer);
|
pPanel->SetSizer(pPanelSizer);
|
||||||
pPanel->Layout();
|
pPanel->Layout();
|
||||||
|
|
||||||
|
#ifdef __WXMAC__
|
||||||
|
//Accessibility
|
||||||
|
HIObjectSetAccessibilityIgnored((HIObjectRef)pPanel->GetHandle(), true);
|
||||||
|
#endif
|
||||||
|
|
||||||
wxLogTrace(wxT("Function Start/End"), wxT("CAdvancedFrame::CreateNotebook - Function End"));
|
wxLogTrace(wxT("Function Start/End"), wxT("CAdvancedFrame::CreateNotebook - Function End"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,8 +56,17 @@ class CTaskItemGroup : wxObject {
|
||||||
public:
|
public:
|
||||||
CTaskItemGroup();
|
CTaskItemGroup();
|
||||||
CTaskItemGroup( wxString strName ) :
|
CTaskItemGroup( wxString strName ) :
|
||||||
m_strName(strName), m_pStaticBox(NULL), m_pStaticBoxSizer(NULL) { m_Tasks.clear(); };
|
m_strName(strName), m_pStaticBox(NULL), m_pStaticBoxSizer(NULL) {
|
||||||
~CTaskItemGroup() {};
|
m_Tasks.clear();
|
||||||
|
#ifdef __WXMAC__
|
||||||
|
m_pTaskGroupAccessibilityEventHandlerRef = NULL;
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
~CTaskItemGroup() {
|
||||||
|
#ifdef __WXMAC__
|
||||||
|
RemoveMacAccessibilitySupport();
|
||||||
|
#endif
|
||||||
|
};
|
||||||
wxButton* button(int i) {return m_Tasks[i]->m_pButton;}
|
wxButton* button(int i) {return m_Tasks[i]->m_pButton;}
|
||||||
|
|
||||||
wxString m_strName;
|
wxString m_strName;
|
||||||
|
@ -65,7 +74,15 @@ public:
|
||||||
wxStaticBox* m_pStaticBox;
|
wxStaticBox* m_pStaticBox;
|
||||||
wxStaticBoxSizer* m_pStaticBoxSizer;
|
wxStaticBoxSizer* m_pStaticBoxSizer;
|
||||||
|
|
||||||
std::vector<CTaskItem*> m_Tasks;
|
std::vector<CTaskItem*> m_Tasks;
|
||||||
|
|
||||||
|
#ifdef __WXMAC__
|
||||||
|
void SetupMacAccessibilitySupport();
|
||||||
|
void RemoveMacAccessibilitySupport();
|
||||||
|
|
||||||
|
private:
|
||||||
|
EventHandlerRef m_pTaskGroupAccessibilityEventHandlerRef;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef bool (*ListSortCompareFunc)(int, int);
|
typedef bool (*ListSortCompareFunc)(int, int);
|
||||||
|
|
|
@ -57,7 +57,7 @@ CBOINCListCtrl::CBOINCListCtrl(
|
||||||
m_bProgressBarEventPending = false;
|
m_bProgressBarEventPending = false;
|
||||||
#else
|
#else
|
||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
SetupMacListControlAccessibilitySupport();
|
SetupMacAccessibilitySupport();
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ CBOINCListCtrl::~CBOINCListCtrl()
|
||||||
{
|
{
|
||||||
m_iRowsNeedingProgressBars.Clear();
|
m_iRowsNeedingProgressBars.Clear();
|
||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
RemoveMacListControlAccessibilitySupport();
|
RemoveMacAccessibilitySupport();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -92,8 +92,8 @@ private:
|
||||||
wxScrolledWindow* GetMainWin(void) { return (wxScrolledWindow*) m_mainWin; }
|
wxScrolledWindow* GetMainWin(void) { return (wxScrolledWindow*) m_mainWin; }
|
||||||
wxCoord GetHeaderHeight(void) { return m_headerHeight; }
|
wxCoord GetHeaderHeight(void) { return m_headerHeight; }
|
||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
void SetupMacListControlAccessibilitySupport();
|
void SetupMacAccessibilitySupport();
|
||||||
void RemoveMacListControlAccessibilitySupport();
|
void RemoveMacAccessibilitySupport();
|
||||||
CBOINCBaseView* GetParentView() { return m_pParentView; }
|
CBOINCBaseView* GetParentView() { return m_pParentView; }
|
||||||
|
|
||||||
HIViewRef m_headerView;
|
HIViewRef m_headerView;
|
||||||
|
|
|
@ -39,6 +39,14 @@ CBOINCTaskCtrl::CBOINCTaskCtrl(CBOINCBaseView* pView, wxWindowID iTaskWindowID,
|
||||||
SetVirtualSize( 200, 1000 );
|
SetVirtualSize( 200, 1000 );
|
||||||
EnableScrolling(false, true);
|
EnableScrolling(false, true);
|
||||||
SetScrollRate( 0, 10 );
|
SetScrollRate( 0, 10 );
|
||||||
|
|
||||||
|
#ifdef __WXMAC__
|
||||||
|
//Accessibility
|
||||||
|
HIObjectSetAccessibilityIgnored((HIObjectRef)GetHandle(), true);
|
||||||
|
HIViewRef parentView = (HIViewRef)m_pParent->GetHandle();
|
||||||
|
HIObjectSetAccessibilityIgnored((HIObjectRef)parentView, true);
|
||||||
|
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -162,6 +170,9 @@ wxInt32 CBOINCTaskCtrl::UpdateControls() {
|
||||||
pGroup->m_pStaticBox = new wxStaticBox(this, wxID_ANY, pGroup->m_strName);
|
pGroup->m_pStaticBox = new wxStaticBox(this, wxID_ANY, pGroup->m_strName);
|
||||||
pGroup->m_pStaticBoxSizer = new wxStaticBoxSizer(pGroup->m_pStaticBox, wxVERTICAL);
|
pGroup->m_pStaticBoxSizer = new wxStaticBoxSizer(pGroup->m_pStaticBox, wxVERTICAL);
|
||||||
m_pSizer->Add(pGroup->m_pStaticBoxSizer, 0, wxEXPAND|wxALL, 5);
|
m_pSizer->Add(pGroup->m_pStaticBoxSizer, 0, wxEXPAND|wxALL, 5);
|
||||||
|
#ifdef __WXMAC__
|
||||||
|
pGroup->SetupMacAccessibilitySupport();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -189,7 +200,7 @@ wxInt32 CBOINCTaskCtrl::UpdateControls() {
|
||||||
// Force update layout and scrollbars, since nothing we do here
|
// Force update layout and scrollbars, since nothing we do here
|
||||||
// necessarily generates a size event which would do it for us.
|
// necessarily generates a size event which would do it for us.
|
||||||
FitInside();
|
FitInside();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,12 +36,12 @@
|
||||||
|
|
||||||
CProjectListCtrlAccessible::CProjectListCtrlAccessible(wxWindow* win) {
|
CProjectListCtrlAccessible::CProjectListCtrlAccessible(wxWindow* win) {
|
||||||
mp_win = win;
|
mp_win = win;
|
||||||
SetupMacListControlAccessibilitySupport();
|
SetupMacAccessibilitySupport();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
CProjectListCtrlAccessible::~CProjectListCtrlAccessible() {
|
CProjectListCtrlAccessible::~CProjectListCtrlAccessible() {
|
||||||
RemoveMacListControlAccessibilitySupport();
|
RemoveMacAccessibilitySupport();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -121,8 +121,8 @@ public:
|
||||||
EventHandlerRef m_plistAccessibilityEventHandlerRef;
|
EventHandlerRef m_plistAccessibilityEventHandlerRef;
|
||||||
|
|
||||||
wxWindow *GetWindow() { return mp_win; }
|
wxWindow *GetWindow() { return mp_win; }
|
||||||
void SetupMacListControlAccessibilitySupport();
|
void SetupMacAccessibilitySupport();
|
||||||
void RemoveMacListControlAccessibilitySupport();
|
void RemoveMacAccessibilitySupport();
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1806,10 +1806,17 @@ CViewStatistics::CViewStatistics(wxNotebook* pNotebook) :
|
||||||
m_pTaskPane->UpdateControls();
|
m_pTaskPane->UpdateControls();
|
||||||
|
|
||||||
UpdateSelection();
|
UpdateSelection();
|
||||||
|
|
||||||
|
#ifdef __WXMAC__
|
||||||
|
SetupMacAccessibilitySupport();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
CViewStatistics::~CViewStatistics() {
|
CViewStatistics::~CViewStatistics() {
|
||||||
EmptyTasks();
|
EmptyTasks();
|
||||||
|
#ifdef __WXMAC__
|
||||||
|
RemoveMacAccessibilitySupport();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString& CViewStatistics::GetViewName() {
|
wxString& CViewStatistics::GetViewName() {
|
||||||
|
|
|
@ -226,7 +226,14 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
CPaintStatistics* m_PaintStatistics;
|
CPaintStatistics* m_PaintStatistics;
|
||||||
|
|
||||||
|
#ifdef __WXMAC__
|
||||||
|
void SetupMacAccessibilitySupport();
|
||||||
|
void RemoveMacAccessibilitySupport();
|
||||||
|
|
||||||
|
EventHandlerRef m_pStatisticsAccessibilityEventHandlerRef;
|
||||||
|
#endif
|
||||||
|
|
||||||
virtual bool OnSaveState( wxConfigBase* pConfig );
|
virtual bool OnSaveState( wxConfigBase* pConfig );
|
||||||
virtual bool OnRestoreState( wxConfigBase* pConfig );
|
virtual bool OnRestoreState( wxConfigBase* pConfig );
|
||||||
|
|
|
@ -69,6 +69,16 @@ wxPieCtrl::wxPieCtrl(wxWindow * parent, wxWindowID id, wxPoint pos,
|
||||||
SetSize(sz);
|
SetSize(sz);
|
||||||
m_CanvasBitmap.Create(1,1);
|
m_CanvasBitmap.Create(1,1);
|
||||||
RecreateCanvas();
|
RecreateCanvas();
|
||||||
|
|
||||||
|
#ifdef __WXMAC__
|
||||||
|
SetupMacAccessibilitySupport();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
wxPieCtrl::~wxPieCtrl() {
|
||||||
|
#ifdef __WXMAC__
|
||||||
|
RemoveMacAccessibilitySupport();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* getter and setter */
|
/* getter and setter */
|
||||||
|
|
|
@ -105,6 +105,8 @@ public:
|
||||||
wxPieCtrl(wxWindow * parent, wxWindowID id = wxID_ANY, wxPoint pos = wxDefaultPosition,
|
wxPieCtrl(wxWindow * parent, wxWindowID id = wxID_ANY, wxPoint pos = wxDefaultPosition,
|
||||||
wxSize sz = wxDefaultSize, long style = 0, wxString name = wxT("wxPieCtrl"));
|
wxSize sz = wxDefaultSize, long style = 0, wxString name = wxT("wxPieCtrl"));
|
||||||
|
|
||||||
|
~wxPieCtrl();
|
||||||
|
|
||||||
wxColour GetBackColour();
|
wxColour GetBackColour();
|
||||||
void SetBackColour(wxColour colour);
|
void SetBackColour(wxColour colour);
|
||||||
|
|
||||||
|
@ -148,6 +150,15 @@ public:
|
||||||
void OnSize(wxSizeEvent & event);
|
void OnSize(wxSizeEvent & event);
|
||||||
void OnMouseMove(wxMouseEvent& ev);
|
void OnMouseMove(wxMouseEvent& ev);
|
||||||
void OnEraseBackground(wxEraseEvent & /*event*/);
|
void OnEraseBackground(wxEraseEvent & /*event*/);
|
||||||
|
|
||||||
|
#ifdef __WXMAC__
|
||||||
|
private:
|
||||||
|
void SetupMacAccessibilitySupport();
|
||||||
|
void RemoveMacAccessibilitySupport();
|
||||||
|
|
||||||
|
EventHandlerRef m_pPieCtrlAccessibilityEventHandlerRef;
|
||||||
|
#endif
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -27,6 +27,8 @@
|
||||||
#include "AdvancedFrame.h"
|
#include "AdvancedFrame.h"
|
||||||
#include "BOINCListCtrl.h"
|
#include "BOINCListCtrl.h"
|
||||||
#include "ProjectListCtrl.h"
|
#include "ProjectListCtrl.h"
|
||||||
|
#include "ViewStatistics.h"
|
||||||
|
#include "wxPieCtrl.h"
|
||||||
#include "sg_BoincSimpleGUI.h"
|
#include "sg_BoincSimpleGUI.h"
|
||||||
#include "Events.h"
|
#include "Events.h"
|
||||||
#include "macAccessiblity.h"
|
#include "macAccessiblity.h"
|
||||||
|
@ -82,27 +84,27 @@ pascal OSStatus AttachListAccessibilityEventHandler( EventHandlerCallRef inHandl
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
static EventTypeSpec sg_AccessibilityEvents[] = {
|
static EventTypeSpec Simple_AccessibilityEvents[] = {
|
||||||
{ kEventClassAccessibility, kEventAccessibleGetNamedAttribute }
|
{ kEventClassAccessibility, kEventAccessibleGetNamedAttribute }
|
||||||
};
|
};
|
||||||
|
|
||||||
extern pascal OSStatus SimpleGUIAccessibilityEventHandler( EventHandlerCallRef inHandlerCallRef,
|
pascal OSStatus SimpleAccessibilityEventHandler( EventHandlerCallRef inHandlerCallRef,
|
||||||
|
EventRef inEvent, void* pData);
|
||||||
|
|
||||||
|
pascal OSStatus PieCtrlAccessibilityEventHandler( EventHandlerCallRef inHandlerCallRef,
|
||||||
EventRef inEvent, void* pData);
|
EventRef inEvent, void* pData);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void CBOINCListCtrl::SetupMacListControlAccessibilitySupport() {
|
void CBOINCListCtrl::SetupMacAccessibilitySupport() {
|
||||||
#if !USE_NATIVE_LISTCONTROL
|
#if !USE_NATIVE_LISTCONTROL
|
||||||
HIViewRef listControlView;
|
HIViewRef listControlView;
|
||||||
OSErr err;
|
OSErr err;
|
||||||
|
|
||||||
// For accessibility support
|
|
||||||
listControlView = (HIViewRef)GetHandle();
|
listControlView = (HIViewRef)GetHandle();
|
||||||
m_headerView = HIViewGetFirstSubview(listControlView);
|
m_headerView = HIViewGetFirstSubview(listControlView);
|
||||||
m_bodyView = HIViewGetNextView(m_headerView);
|
m_bodyView = HIViewGetNextView(m_headerView);
|
||||||
|
|
||||||
err = HIViewSetEnabled(m_headerView, true);
|
err = HIViewSetEnabled(m_headerView, true);
|
||||||
|
|
||||||
err = InstallHIObjectEventHandler((HIObjectRef)m_headerView, NewEventHandlerUPP(BOINCListHeaderAccessibilityEventHandler),
|
err = InstallHIObjectEventHandler((HIObjectRef)m_headerView, NewEventHandlerUPP(BOINCListHeaderAccessibilityEventHandler),
|
||||||
sizeof(myAccessibilityEvents) / sizeof(EventTypeSpec), myAccessibilityEvents,
|
sizeof(myAccessibilityEvents) / sizeof(EventTypeSpec), myAccessibilityEvents,
|
||||||
this, &m_pHeaderAccessibilityEventHandlerRef);
|
this, &m_pHeaderAccessibilityEventHandlerRef);
|
||||||
|
@ -114,7 +116,7 @@ void CBOINCListCtrl::SetupMacListControlAccessibilitySupport() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CBOINCListCtrl::RemoveMacListControlAccessibilitySupport() {
|
void CBOINCListCtrl::RemoveMacAccessibilitySupport() {
|
||||||
#if !USE_NATIVE_LISTCONTROL
|
#if !USE_NATIVE_LISTCONTROL
|
||||||
::RemoveEventHandler(m_pHeaderAccessibilityEventHandlerRef);
|
::RemoveEventHandler(m_pHeaderAccessibilityEventHandlerRef);
|
||||||
::RemoveEventHandler(m_pBodyAccessibilityEventHandlerRef);
|
::RemoveEventHandler(m_pBodyAccessibilityEventHandlerRef);
|
||||||
|
@ -122,7 +124,7 @@ void CBOINCListCtrl::RemoveMacListControlAccessibilitySupport() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CProjectListCtrlAccessible::SetupMacListControlAccessibilitySupport() {
|
void CProjectListCtrlAccessible::SetupMacAccessibilitySupport() {
|
||||||
OSErr err;
|
OSErr err;
|
||||||
|
|
||||||
CProjectListCtrl* pCtrl = wxDynamicCast(mp_win, CProjectListCtrl);
|
CProjectListCtrl* pCtrl = wxDynamicCast(mp_win, CProjectListCtrl);
|
||||||
|
@ -142,9 +144,10 @@ void CProjectListCtrlAccessible::SetupMacListControlAccessibilitySupport() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CProjectListCtrlAccessible::RemoveMacListControlAccessibilitySupport() {
|
void CProjectListCtrlAccessible::RemoveMacAccessibilitySupport() {
|
||||||
if (m_plistAccessibilityEventHandlerRef) {
|
if (m_plistAccessibilityEventHandlerRef) {
|
||||||
::RemoveEventHandler(m_plistAccessibilityEventHandlerRef);
|
::RemoveEventHandler(m_plistAccessibilityEventHandlerRef);
|
||||||
|
m_plistAccessibilityEventHandlerRef = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -159,8 +162,8 @@ void CSimplePanel::SetupMacAccessibilitySupport() {
|
||||||
HIObjectSetAuxiliaryAccessibilityAttribute((HIObjectRef)simple, 0, kAXDescriptionAttribute, description);
|
HIObjectSetAuxiliaryAccessibilityAttribute((HIObjectRef)simple, 0, kAXDescriptionAttribute, description);
|
||||||
CFRelease( description );
|
CFRelease( description );
|
||||||
|
|
||||||
err = InstallHIObjectEventHandler((HIObjectRef)simple, NewEventHandlerUPP(SimpleGUIAccessibilityEventHandler),
|
err = InstallHIObjectEventHandler((HIObjectRef)simple, NewEventHandlerUPP(SimpleAccessibilityEventHandler),
|
||||||
sizeof(sg_AccessibilityEvents) / sizeof(EventTypeSpec), sg_AccessibilityEvents,
|
sizeof(Simple_AccessibilityEvents) / sizeof(EventTypeSpec), Simple_AccessibilityEvents,
|
||||||
this, &m_pSGAccessibilityEventHandlerRef);
|
this, &m_pSGAccessibilityEventHandlerRef);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,6 +171,68 @@ void CSimplePanel::SetupMacAccessibilitySupport() {
|
||||||
void CSimplePanel::RemoveMacAccessibilitySupport() {
|
void CSimplePanel::RemoveMacAccessibilitySupport() {
|
||||||
if (m_pSGAccessibilityEventHandlerRef) {
|
if (m_pSGAccessibilityEventHandlerRef) {
|
||||||
::RemoveEventHandler(m_pSGAccessibilityEventHandlerRef);
|
::RemoveEventHandler(m_pSGAccessibilityEventHandlerRef);
|
||||||
|
m_pSGAccessibilityEventHandlerRef = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CTaskItemGroup::SetupMacAccessibilitySupport() {
|
||||||
|
OSStatus err;
|
||||||
|
HIViewRef boxView = (HIViewRef)m_pStaticBox->GetHandle();
|
||||||
|
|
||||||
|
if (m_pTaskGroupAccessibilityEventHandlerRef == NULL) {
|
||||||
|
err = InstallHIObjectEventHandler((HIObjectRef)boxView, NewEventHandlerUPP(SimpleAccessibilityEventHandler),
|
||||||
|
sizeof(Simple_AccessibilityEvents) / sizeof(EventTypeSpec), Simple_AccessibilityEvents,
|
||||||
|
this, &m_pTaskGroupAccessibilityEventHandlerRef);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CTaskItemGroup::RemoveMacAccessibilitySupport() {
|
||||||
|
if (m_pTaskGroupAccessibilityEventHandlerRef) {
|
||||||
|
::RemoveEventHandler(m_pTaskGroupAccessibilityEventHandlerRef);
|
||||||
|
m_pTaskGroupAccessibilityEventHandlerRef = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CViewStatistics::SetupMacAccessibilitySupport() {
|
||||||
|
OSStatus err;
|
||||||
|
HIViewRef paintPanelView = (HIViewRef)m_PaintStatistics->GetHandle();
|
||||||
|
wxString str = _("This panel contains graphs showing user totals for projects");
|
||||||
|
CFStringRef description = CFStringCreateWithCString(NULL, str.char_str(), kCFStringEncodingUTF8);
|
||||||
|
|
||||||
|
// Have the screen reader tell user to switch to advanced view.
|
||||||
|
HIObjectSetAuxiliaryAccessibilityAttribute((HIObjectRef)paintPanelView, 0, kAXDescriptionAttribute, description);
|
||||||
|
CFRelease( description );
|
||||||
|
|
||||||
|
err = InstallHIObjectEventHandler((HIObjectRef)paintPanelView, NewEventHandlerUPP(SimpleAccessibilityEventHandler),
|
||||||
|
sizeof(Simple_AccessibilityEvents) / sizeof(EventTypeSpec), Simple_AccessibilityEvents,
|
||||||
|
this, &m_pStatisticsAccessibilityEventHandlerRef);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CViewStatistics::RemoveMacAccessibilitySupport() {
|
||||||
|
::RemoveEventHandler(m_pStatisticsAccessibilityEventHandlerRef);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void wxPieCtrl::SetupMacAccessibilitySupport() {
|
||||||
|
OSStatus err;
|
||||||
|
HIViewRef pieControlView = (HIViewRef)GetHandle();
|
||||||
|
|
||||||
|
HIObjectSetAuxiliaryAccessibilityAttribute((HIObjectRef)pieControlView, 0, kAXDescriptionAttribute, CFSTR(""));
|
||||||
|
|
||||||
|
err = InstallHIObjectEventHandler((HIObjectRef)pieControlView, NewEventHandlerUPP(PieCtrlAccessibilityEventHandler),
|
||||||
|
sizeof(Simple_AccessibilityEvents) / sizeof(EventTypeSpec), Simple_AccessibilityEvents,
|
||||||
|
this, &m_pPieCtrlAccessibilityEventHandlerRef);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void wxPieCtrl::RemoveMacAccessibilitySupport() {
|
||||||
|
if (m_pPieCtrlAccessibilityEventHandlerRef) {
|
||||||
|
::RemoveEventHandler(m_pPieCtrlAccessibilityEventHandlerRef);
|
||||||
|
m_pPieCtrlAccessibilityEventHandlerRef = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -293,7 +358,6 @@ OSStatus BOINCListAccessibilityEventHandler( EventHandlerCallRef inHandlerCallRe
|
||||||
// size, position, parent window, top level element and isFocused attributes.
|
// size, position, parent window, top level element and isFocused attributes.
|
||||||
CFArrayAppendValue( namesArray, kAXWindowAttribute );
|
CFArrayAppendValue( namesArray, kAXWindowAttribute );
|
||||||
CFArrayAppendValue( namesArray, kAXTopLevelUIElementAttribute );
|
CFArrayAppendValue( namesArray, kAXTopLevelUIElementAttribute );
|
||||||
CFArrayAppendValue( namesArray, kAXDescriptionAttribute );
|
|
||||||
CFArrayAppendValue( namesArray, kAXSizeAttribute );
|
CFArrayAppendValue( namesArray, kAXSizeAttribute );
|
||||||
CFArrayAppendValue( namesArray, kAXPositionAttribute );
|
CFArrayAppendValue( namesArray, kAXPositionAttribute );
|
||||||
if (isHeader) {
|
if (isHeader) {
|
||||||
|
@ -305,6 +369,7 @@ OSStatus BOINCListAccessibilityEventHandler( EventHandlerCallRef inHandlerCallRe
|
||||||
CFArrayAppendValue( namesArray, kAXFocusedAttribute );
|
CFArrayAppendValue( namesArray, kAXFocusedAttribute );
|
||||||
CFArrayAppendValue( namesArray, kAXRoleAttribute );
|
CFArrayAppendValue( namesArray, kAXRoleAttribute );
|
||||||
CFArrayAppendValue( namesArray, kAXRoleDescriptionAttribute );
|
CFArrayAppendValue( namesArray, kAXRoleDescriptionAttribute );
|
||||||
|
CFArrayAppendValue( namesArray, kAXDescriptionAttribute );
|
||||||
CFArrayAppendValue( namesArray, kAXParentAttribute );
|
CFArrayAppendValue( namesArray, kAXParentAttribute );
|
||||||
|
|
||||||
return noErr;
|
return noErr;
|
||||||
|
@ -390,16 +455,28 @@ OSStatus BOINCListAccessibilityEventHandler( EventHandlerCallRef inHandlerCallRe
|
||||||
|
|
||||||
} else if ( CFStringCompare( attribute, kAXRoleDescriptionAttribute, 0 ) == kCFCompareEqualTo ) {
|
} else if ( CFStringCompare( attribute, kAXRoleDescriptionAttribute, 0 ) == kCFCompareEqualTo ) {
|
||||||
// Return a string indicating the role of this part.
|
// Return a string indicating the role of this part.
|
||||||
wxString str;
|
|
||||||
|
|
||||||
str = _("list of ");
|
CFStringRef roleDesc = CFSTR("");
|
||||||
str += pView->GetViewName();
|
|
||||||
|
|
||||||
CFStringRef roleDesc = CFStringCreateWithCString(NULL, str.char_str(), kCFStringEncodingUTF8);
|
|
||||||
SetEventParameter( inEvent, kEventParamAccessibleAttributeValue, typeCFTypeRef, sizeof( roleDesc ), &roleDesc );
|
SetEventParameter( inEvent, kEventParamAccessibleAttributeValue, typeCFTypeRef, sizeof( roleDesc ), &roleDesc );
|
||||||
CFRelease( roleDesc );
|
CFRelease( roleDesc );
|
||||||
return noErr;
|
return noErr;
|
||||||
|
|
||||||
|
} else if ( CFStringCompare( attribute, kAXDescriptionAttribute, 0 ) == kCFCompareEqualTo ) {
|
||||||
|
// Return a string indicating the role of this part.
|
||||||
|
wxString str;
|
||||||
|
|
||||||
|
if (isHeader) {
|
||||||
|
str = _("list of ");
|
||||||
|
str += pView->GetViewName();
|
||||||
|
} else {
|
||||||
|
str = _("blank");
|
||||||
|
}
|
||||||
|
|
||||||
|
CFStringRef description = CFStringCreateWithCString(NULL, str.char_str(), kCFStringEncodingUTF8);
|
||||||
|
SetEventParameter( inEvent, kEventParamAccessibleAttributeValue, typeCFTypeRef, sizeof( description ), &description );
|
||||||
|
CFRelease( description );
|
||||||
|
return noErr;
|
||||||
|
|
||||||
} else if ( CFStringCompare( attribute, kAXParentAttribute, 0 ) == kCFCompareEqualTo ) {
|
} else if ( CFStringCompare( attribute, kAXParentAttribute, 0 ) == kCFCompareEqualTo ) {
|
||||||
AXUIElementRef parent;
|
AXUIElementRef parent;
|
||||||
HIViewRef parentView;
|
HIViewRef parentView;
|
||||||
|
@ -450,6 +527,7 @@ OSStatus BOINCListAccessibilityEventHandler( EventHandlerCallRef inHandlerCallRe
|
||||||
|
|
||||||
if ( CFStringCompare( attribute, kAXDescriptionAttribute, 0 ) == kCFCompareEqualTo ) {
|
if ( CFStringCompare( attribute, kAXDescriptionAttribute, 0 ) == kCFCompareEqualTo ) {
|
||||||
wxString str, buf;
|
wxString str, buf;
|
||||||
|
int rowCount;
|
||||||
|
|
||||||
if (isHeader) {
|
if (isHeader) {
|
||||||
wxListItem headerItem;
|
wxListItem headerItem;
|
||||||
|
@ -462,7 +540,7 @@ OSStatus BOINCListAccessibilityEventHandler( EventHandlerCallRef inHandlerCallRe
|
||||||
currentTabView = pFrame->GetCurrentViewPage();
|
currentTabView = pFrame->GetCurrentViewPage();
|
||||||
|
|
||||||
pList->GetColumn(col, headerItem);
|
pList->GetColumn(col, headerItem);
|
||||||
buf.Printf(_("%d of %d "), col+1, pList->GetColumnCount());
|
buf.Printf(_("%d of %d; "), col+1, pList->GetColumnCount());
|
||||||
if (col == pView->m_iSortColumn) {
|
if (col == pView->m_iSortColumn) {
|
||||||
str = _("current sort column ");
|
str = _("current sort column ");
|
||||||
str += buf;
|
str += buf;
|
||||||
|
@ -473,27 +551,31 @@ OSStatus BOINCListAccessibilityEventHandler( EventHandlerCallRef inHandlerCallRe
|
||||||
}
|
}
|
||||||
str += headerItem.GetText();
|
str += headerItem.GetText();
|
||||||
} else { // ! isHeader
|
} else { // ! isHeader
|
||||||
if (pList->GetItemState(row, wxLIST_STATE_SELECTED) & wxLIST_STATE_SELECTED) {
|
rowCount = pList->GetItemCount();
|
||||||
str = _("selected ");
|
if (rowCount <= 0) {
|
||||||
|
str = _("blank");
|
||||||
} else {
|
} else {
|
||||||
str = wxEmptyString;
|
if (pList->GetItemState(row, wxLIST_STATE_SELECTED) & wxLIST_STATE_SELECTED) {
|
||||||
}
|
str = _("selected ");
|
||||||
|
} else {
|
||||||
|
str = wxEmptyString;
|
||||||
|
}
|
||||||
|
|
||||||
buf.Printf(_("row %d "), row+1);
|
buf.Printf(_("row %d "), row+1);
|
||||||
str += buf;
|
str += buf;
|
||||||
if (col == 0) {
|
if (col == 0) {
|
||||||
buf.Printf(_("of %d "), pList->GetItemCount());
|
buf.Printf(_("of %d; "), rowCount);
|
||||||
|
str += buf;
|
||||||
|
}
|
||||||
|
buf.Printf(_("column %d; "), col+1);
|
||||||
|
str += buf;
|
||||||
|
buf = pView->FireOnListGetItemText(row, col);
|
||||||
|
if (buf.IsEmpty()) {
|
||||||
|
buf = _("blank");
|
||||||
|
}
|
||||||
str += buf;
|
str += buf;
|
||||||
}
|
|
||||||
buf.Printf(_("column %d "), col+1);
|
|
||||||
str += buf;
|
|
||||||
buf = pView->FireOnListGetItemText(row, col);
|
|
||||||
if (buf.IsEmpty()) {
|
|
||||||
buf = _("blank");
|
|
||||||
}
|
}
|
||||||
str += buf;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CFStringRef description = CFStringCreateWithCString(NULL, str.char_str(), kCFStringEncodingUTF8);
|
CFStringRef description = CFStringCreateWithCString(NULL, str.char_str(), kCFStringEncodingUTF8);
|
||||||
SetEventParameter( inEvent, kEventParamAccessibleAttributeValue, typeCFTypeRef, sizeof( description ), &description );
|
SetEventParameter( inEvent, kEventParamAccessibleAttributeValue, typeCFTypeRef, sizeof( description ), &description );
|
||||||
CFRelease( description );
|
CFRelease( description );
|
||||||
|
@ -1055,7 +1137,7 @@ pascal OSStatus AttachListAccessibilityEventHandler( EventHandlerCallRef inHandl
|
||||||
} else {
|
} else {
|
||||||
str = wxEmptyString;
|
str = wxEmptyString;
|
||||||
}
|
}
|
||||||
buf.Printf(_("row %d of %d "), row, n);
|
buf.Printf(_("row %d of %d; "), row, n);
|
||||||
str += buf;
|
str += buf;
|
||||||
|
|
||||||
err = pAccessible->GetDescription(row, &buf);
|
err = pAccessible->GetDescription(row, &buf);
|
||||||
|
@ -1259,7 +1341,7 @@ pascal OSStatus AttachListAccessibilityEventHandler( EventHandlerCallRef inHandl
|
||||||
return eventNotHandledErr;
|
return eventNotHandledErr;
|
||||||
}
|
}
|
||||||
|
|
||||||
pascal OSStatus SimpleGUIAccessibilityEventHandler( EventHandlerCallRef inHandlerCallRef,
|
pascal OSStatus SimpleAccessibilityEventHandler( EventHandlerCallRef inHandlerCallRef,
|
||||||
EventRef inEvent, void* pData) {
|
EventRef inEvent, void* pData) {
|
||||||
const UInt32 eventClass = GetEventClass(inEvent);
|
const UInt32 eventClass = GetEventClass(inEvent);
|
||||||
const UInt32 eventKind = GetEventKind(inEvent);
|
const UInt32 eventKind = GetEventKind(inEvent);
|
||||||
|
@ -1279,19 +1361,82 @@ pascal OSStatus SimpleGUIAccessibilityEventHandler( EventHandlerCallRef inHandle
|
||||||
if (err) return err;
|
if (err) return err;
|
||||||
|
|
||||||
if ( CFStringCompare( attribute, kAXRoleAttribute, 0 ) == kCFCompareEqualTo ) {
|
if ( CFStringCompare( attribute, kAXRoleAttribute, 0 ) == kCFCompareEqualTo ) {
|
||||||
CFStringRef role = kAXStaticTextRole; // kAXRowRole;
|
CFStringRef role = kAXStaticTextRole;
|
||||||
|
|
||||||
SetEventParameter( inEvent, kEventParamAccessibleAttributeValue, typeCFTypeRef, sizeof( role ), &role );
|
SetEventParameter( inEvent, kEventParamAccessibleAttributeValue, typeCFTypeRef, sizeof( role ), &role );
|
||||||
return noErr;
|
return noErr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return CallNextEventHandler( inHandlerCallRef, inEvent );
|
||||||
return eventNotHandledErr;
|
return eventNotHandledErr;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
return CallNextEventHandler( inHandlerCallRef, inEvent );
|
||||||
|
|
||||||
return eventNotHandledErr;
|
return eventNotHandledErr;
|
||||||
}
|
}
|
||||||
|
|
||||||
return eventNotHandledErr;
|
return eventNotHandledErr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
pascal OSStatus PieCtrlAccessibilityEventHandler( EventHandlerCallRef inHandlerCallRef,
|
||||||
|
EventRef inEvent, void* pData) {
|
||||||
|
const UInt32 eventClass = GetEventClass(inEvent);
|
||||||
|
const UInt32 eventKind = GetEventKind(inEvent);
|
||||||
|
OSStatus err;
|
||||||
|
wxPieCtrl* pPieCtrl = (wxPieCtrl*)pData;
|
||||||
|
|
||||||
|
if (eventClass != kEventClassAccessibility) {
|
||||||
|
return eventNotHandledErr;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (eventKind) {
|
||||||
|
|
||||||
|
case kEventAccessibleGetNamedAttribute:
|
||||||
|
CFStringRef attribute;
|
||||||
|
|
||||||
|
err = GetEventParameter (inEvent, kEventParamAccessibleAttributeName,
|
||||||
|
typeCFStringRef, NULL, sizeof(typeCFStringRef), NULL, &attribute);
|
||||||
|
if (err) return err;
|
||||||
|
|
||||||
|
if ( CFStringCompare( attribute, kAXRoleAttribute, 0 ) == kCFCompareEqualTo ) {
|
||||||
|
CFStringRef role = kAXStaticTextRole;
|
||||||
|
|
||||||
|
SetEventParameter( inEvent, kEventParamAccessibleAttributeValue, typeCFTypeRef, sizeof( role ), &role );
|
||||||
|
return noErr;
|
||||||
|
|
||||||
|
} else if ( CFStringCompare( attribute, kAXDescriptionAttribute, 0 ) == kCFCompareEqualTo ) {
|
||||||
|
// Return a string indicating the role of this part.
|
||||||
|
wxString str;
|
||||||
|
CFStringRef description;
|
||||||
|
unsigned int i;
|
||||||
|
|
||||||
|
str = pPieCtrl->GetLabel();
|
||||||
|
for(i=0; i<pPieCtrl->m_Series.Count(); i++) {
|
||||||
|
str += wxT("; ");
|
||||||
|
str += pPieCtrl->m_Series[i].GetLabel();
|
||||||
|
}
|
||||||
|
|
||||||
|
description = CFStringCreateWithCString(NULL, str.char_str(), kCFStringEncodingUTF8);
|
||||||
|
SetEventParameter( inEvent, kEventParamAccessibleAttributeValue, typeCFTypeRef, sizeof( description ), &description );
|
||||||
|
CFRelease( description );
|
||||||
|
return noErr;
|
||||||
|
}
|
||||||
|
|
||||||
|
return CallNextEventHandler( inHandlerCallRef, inEvent );
|
||||||
|
return eventNotHandledErr;
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
default:
|
||||||
|
return CallNextEventHandler( inHandlerCallRef, inEvent );
|
||||||
|
|
||||||
|
return eventNotHandledErr;
|
||||||
|
}
|
||||||
|
|
||||||
|
return eventNotHandledErr;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue