mirror of https://github.com/BOINC/boinc.git
MGR: In Simple View, Mac screen reader tells user to switch to Advanced View
svn path=/trunk/boinc/; revision=19679
This commit is contained in:
parent
14fd0a3f33
commit
15f5c31e9b
|
@ -9434,3 +9434,22 @@ David 23 Nov 2009
|
|||
cpu_sched.cpp
|
||||
clientgui/
|
||||
ViewWork.cpp
|
||||
|
||||
Charlie 23 Nov 2009
|
||||
- MGR: In Simple View, have Mac screen reader tell user to switch to
|
||||
Advanced View.
|
||||
- Mac Installer: update ReadMe files to emphasize that installer may
|
||||
take longer than expected.
|
||||
|
||||
clientgui/
|
||||
BOINCSimpleGUI.cpp, .h
|
||||
ProjectListCtrl.cpp, .h
|
||||
Mac/
|
||||
MacAccessibility.cpp
|
||||
mac_build/
|
||||
boinc.xcodeproj/
|
||||
project.pbxproj
|
||||
mac_installer/
|
||||
GR-ReadMe.rtf
|
||||
PTP-ReadMe.rtf
|
||||
ReadMe.rtf
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
// mac_accessiblity.cpp
|
||||
// macAccessiblity.cpp
|
||||
|
||||
#include <Carbon/Carbon.h>
|
||||
|
||||
|
@ -27,10 +27,29 @@
|
|||
#include "AdvancedFrame.h"
|
||||
#include "BOINCListCtrl.h"
|
||||
#include "ProjectListCtrl.h"
|
||||
#include "sg_BoincSimpleGUI.h"
|
||||
#include "Events.h"
|
||||
#include "macAccessiblity.h"
|
||||
|
||||
#define MAX_LIST_COL 100
|
||||
|
||||
void AccessibilityIgnoreAllChildren(HIViewRef parent, int recursionLevel) {
|
||||
HIViewRef child;
|
||||
OSStatus err;
|
||||
|
||||
if (recursionLevel > 100) {
|
||||
fprintf(stderr, "Error: AccessibilityIgnoreAllChildren recursion level > 100\n");
|
||||
return;
|
||||
}
|
||||
|
||||
child = HIViewGetFirstSubview(parent);
|
||||
while (child) {
|
||||
err = HIObjectSetAccessibilityIgnored((HIObjectRef)child, true);
|
||||
AccessibilityIgnoreAllChildren(child, recursionLevel + 1);
|
||||
child = HIViewGetNextView(child);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
OSStatus BOINCListAccessibilityEventHandler( EventHandlerCallRef inHandlerCallRef,
|
||||
EventRef inEvent, void* pData, Boolean isHeader);
|
||||
|
@ -63,6 +82,15 @@ pascal OSStatus AttachListAccessibilityEventHandler( EventHandlerCallRef inHandl
|
|||
};
|
||||
|
||||
|
||||
static EventTypeSpec sg_AccessibilityEvents[] = {
|
||||
{ kEventClassAccessibility, kEventAccessibleGetNamedAttribute }
|
||||
};
|
||||
|
||||
extern pascal OSStatus SimpleGUIAccessibilityEventHandler( EventHandlerCallRef inHandlerCallRef,
|
||||
EventRef inEvent, void* pData);
|
||||
|
||||
|
||||
|
||||
void CBOINCListCtrl::SetupMacListControlAccessibilitySupport() {
|
||||
#if !USE_NATIVE_LISTCONTROL
|
||||
HIViewRef listControlView;
|
||||
|
@ -121,6 +149,29 @@ void CProjectListCtrlAccessible::RemoveMacListControlAccessibilitySupport() {
|
|||
}
|
||||
|
||||
|
||||
void CSimplePanel::SetupMacAccessibilitySupport() {
|
||||
OSStatus err;
|
||||
wxString str = _("for accessibility support, please select advanced from the view menu or type command shift a");
|
||||
HIViewRef simple = (HIViewRef)GetHandle();
|
||||
CFStringRef description = CFStringCreateWithCString(NULL, str.char_str(), kCFStringEncodingUTF8);
|
||||
|
||||
// Have the screen reader tell user to switch to advanced view.
|
||||
HIObjectSetAuxiliaryAccessibilityAttribute((HIObjectRef)simple, 0, kAXDescriptionAttribute, description);
|
||||
CFRelease( description );
|
||||
|
||||
err = InstallHIObjectEventHandler((HIObjectRef)simple, NewEventHandlerUPP(SimpleGUIAccessibilityEventHandler),
|
||||
sizeof(sg_AccessibilityEvents) / sizeof(EventTypeSpec), sg_AccessibilityEvents,
|
||||
this, &m_pSGAccessibilityEventHandlerRef);
|
||||
}
|
||||
|
||||
|
||||
void CSimplePanel::RemoveMacAccessibilitySupport() {
|
||||
if (m_pSGAccessibilityEventHandlerRef) {
|
||||
::RemoveEventHandler(m_pSGAccessibilityEventHandlerRef);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
OSStatus BOINCListAccessibilityEventHandler( EventHandlerCallRef inHandlerCallRef,
|
||||
EventRef inEvent, void* pData, Boolean isHeader) {
|
||||
const UInt32 eventClass = GetEventClass(inEvent);
|
||||
|
@ -1207,3 +1258,40 @@ pascal OSStatus AttachListAccessibilityEventHandler( EventHandlerCallRef inHandl
|
|||
|
||||
return eventNotHandledErr;
|
||||
}
|
||||
|
||||
pascal OSStatus SimpleGUIAccessibilityEventHandler( EventHandlerCallRef inHandlerCallRef,
|
||||
EventRef inEvent, void* pData) {
|
||||
const UInt32 eventClass = GetEventClass(inEvent);
|
||||
const UInt32 eventKind = GetEventKind(inEvent);
|
||||
OSStatus err;
|
||||
|
||||
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; // kAXRowRole;
|
||||
|
||||
SetEventParameter( inEvent, kEventParamAccessibleAttributeValue, typeCFTypeRef, sizeof( role ), &role );
|
||||
return noErr;
|
||||
}
|
||||
|
||||
return eventNotHandledErr;
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
return eventNotHandledErr;
|
||||
}
|
||||
|
||||
return eventNotHandledErr;
|
||||
}
|
|
@ -39,6 +39,7 @@
|
|||
#include "WizardAttachProject.h"
|
||||
#include "error_numbers.h"
|
||||
#include "version.h"
|
||||
#include "macAccessiblity.h"
|
||||
|
||||
#include "sg_BoincSimpleGUI.h"
|
||||
#include "sg_ImageLoader.h"
|
||||
|
@ -437,7 +438,6 @@ CSimplePanel::CSimplePanel() {
|
|||
wxLogTrace(wxT("Function Start/End"), wxT("CSimplePanel::CSimplePanel - Default Constructor Function End"));
|
||||
}
|
||||
|
||||
|
||||
CSimplePanel::CSimplePanel(wxWindow* parent) :
|
||||
wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER)
|
||||
{
|
||||
|
@ -454,6 +454,13 @@ CSimplePanel::CSimplePanel(wxWindow* parent) :
|
|||
|
||||
InitEmptyView();
|
||||
|
||||
#ifdef __WXMAC__
|
||||
// Have the screen reader tell user to switch to advanced view.
|
||||
oldSimpleGUIWorkCount = -1;
|
||||
|
||||
SetupMacAccessibilitySupport();
|
||||
#endif
|
||||
|
||||
wxLogTrace(wxT("Function Start/End"), wxT("CSimplePanel::CSimplePanel - Overloaded Constructor Function End"));
|
||||
}
|
||||
|
||||
|
@ -462,6 +469,10 @@ CSimplePanel::~CSimplePanel()
|
|||
{
|
||||
wxLogTrace(wxT("Function Start/End"), wxT("CSimplePanel::CSimplePanel - Destructor Function Begin"));
|
||||
|
||||
#ifdef __WXMAC__
|
||||
RemoveMacAccessibilitySupport();
|
||||
#endif
|
||||
|
||||
wxLogTrace(wxT("Function Start/End"), wxT("CSimplePanel::CSimplePanel - Destructor Function End"));
|
||||
}
|
||||
|
||||
|
@ -508,8 +519,9 @@ void CSimplePanel::OnProjectsAttachToProject() {
|
|||
|
||||
// called from CSimpleFrame::OnRefreshView()
|
||||
void CSimplePanel::OnFrameRender() {
|
||||
CMainDocument* pDoc = wxGetApp().GetDocument();
|
||||
CMainDocument* pDoc = wxGetApp().GetDocument();
|
||||
wxASSERT(pDoc);
|
||||
int workCount = pDoc->GetSimpleGUIWorkCount();
|
||||
|
||||
// OnFrameRender() may be called while SimpleGUI initialization is
|
||||
// in progress due to completion of a periodic get_messages RPC,
|
||||
|
@ -527,7 +539,7 @@ void CSimplePanel::OnFrameRender() {
|
|||
}
|
||||
|
||||
// Now check to see if we show the empty state or results
|
||||
if ( pDoc->GetSimpleGUIWorkCount() > 0 ) {
|
||||
if ( workCount > 0 ) {
|
||||
// State changes can cause the BSG to crash if a dialogue is open.
|
||||
// Defer state change until after the dialogue is closed
|
||||
if ( (emptyViewInitialized || !notebookViewInitialized) && dlgOpen ) {
|
||||
|
@ -543,6 +555,7 @@ void CSimplePanel::OnFrameRender() {
|
|||
InitNotebook();
|
||||
}
|
||||
wrkUnitNB->Update();
|
||||
|
||||
} else {
|
||||
// State changes can cause the BSG to crash if a dialogue is open.
|
||||
// Defer state change until after the dialogue is closed
|
||||
|
@ -558,6 +571,17 @@ void CSimplePanel::OnFrameRender() {
|
|||
}
|
||||
UpdateEmptyView();
|
||||
}
|
||||
|
||||
#ifdef __WXMAC__
|
||||
//Accessibility
|
||||
// Hide all but top level view from accessibility support so that
|
||||
// the screen reader will tell user to switch to advanced view.
|
||||
if (oldSimpleGUIWorkCount != workCount) {
|
||||
oldSimpleGUIWorkCount = workCount;
|
||||
HIViewRef simple = (HIViewRef)GetHandle();
|
||||
AccessibilityIgnoreAllChildren(simple, 1);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -92,6 +92,14 @@ public:
|
|||
|
||||
protected:
|
||||
void OnEraseBackground(wxEraseEvent& event);
|
||||
#ifdef __WXMAC__
|
||||
void SetupMacAccessibilitySupport();
|
||||
void RemoveMacAccessibilitySupport();
|
||||
|
||||
int oldSimpleGUIWorkCount;
|
||||
EventHandlerRef m_pSGAccessibilityEventHandlerRef;
|
||||
|
||||
#endif
|
||||
|
||||
private:
|
||||
bool dlgOpen;
|
||||
|
@ -128,7 +136,7 @@ protected:
|
|||
virtual int _GetCurrentViewPage();
|
||||
|
||||
#ifdef __WXMAC__
|
||||
wxMenuBar* m_pMenubar;
|
||||
wxMenuBar* m_pMenubar;
|
||||
#endif
|
||||
wxAcceleratorEntry m_Shortcuts[1];
|
||||
wxAcceleratorTable* m_pAccelTable;
|
||||
|
|
|
@ -630,6 +630,7 @@
|
|||
DD247AF70AEA308A0034104A /* SkinManager.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = SkinManager.cpp; path = ../clientgui/SkinManager.cpp; sourceTree = SOURCE_ROOT; };
|
||||
DD247AF80AEA308A0034104A /* SkinManager.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SkinManager.h; path = ../clientgui/SkinManager.h; sourceTree = SOURCE_ROOT; };
|
||||
DD252F3009E3E014006454D7 /* boinc_glut.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = boinc_glut.h; path = ../api/boinc_glut.h; sourceTree = SOURCE_ROOT; };
|
||||
DD29728E10BB657A00DF3C2E /* MacAccessiblity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MacAccessiblity.h; path = ../clientgui/mac/MacAccessiblity.h; sourceTree = SOURCE_ROOT; };
|
||||
DD2D25CB07FAB41700151141 /* DlgSelectComputer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = DlgSelectComputer.cpp; path = ../clientgui/DlgSelectComputer.cpp; sourceTree = SOURCE_ROOT; };
|
||||
DD2D25CC07FAB41700151141 /* DlgSelectComputer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = DlgSelectComputer.h; path = ../clientgui/DlgSelectComputer.h; sourceTree = SOURCE_ROOT; };
|
||||
DD2F32EF07F2A83E00645DDC /* MacSysMenu.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = MacSysMenu.h; path = ../clientgui/mac/MacSysMenu.h; sourceTree = SOURCE_ROOT; };
|
||||
|
@ -1673,6 +1674,7 @@
|
|||
DD30446A0864332D00D73756 /* config.h */,
|
||||
DD1F0ACD0822069E00AFC5FA /* MacGUI.pch */,
|
||||
DDA99BF31099AF18002F8E9B /* MacAccessiblity.cpp */,
|
||||
DD29728E10BB657A00DF3C2E /* MacAccessiblity.h */,
|
||||
DD2F32F707F2A88B00645DDC /* MacSysMenu.cpp */,
|
||||
DDA9D3BB09189A8C0060E7A7 /* Mac_GUI.cpp */,
|
||||
DD2F32EF07F2A83E00645DDC /* MacSysMenu.h */,
|
||||
|
|
|
@ -12,7 +12,9 @@
|
|||
\cf0 http://gridrepublic.org\
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural
|
||||
\cf0 \
|
||||
Installing GridRepublic Desktop may take several minutes; please be patient.\
|
||||
|
||||
\b Installing GridRepublic Desktop may take several minutes; please be patient.
|
||||
\b0 \
|
||||
\
|
||||
If you are upgrading from a version earlier than 6.8.0, you may see a message "Failed to convert file GridRepublic Desktop Preferences to Unicode." This is due to our addition of full Unicode support to the GridRepublic Desktop. If you get this message, you may need to readjust your column widths and other GridRepublic Desktop view options, but no other problems will result. When you quit GridRepublic Desktop, these settings will be saved in the new Unicode format.\
|
||||
\
|
||||
|
|
|
@ -12,7 +12,9 @@
|
|||
\cf0 http://gridrepublic.org\
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural
|
||||
\cf0 \
|
||||
Installing ProgressThruProcessors Desktop may take several minutes; please be patient.\
|
||||
|
||||
\b Installing ProgressThruProcessors Desktop may take several minutes; please be patient.
|
||||
\b0 \
|
||||
\
|
||||
If you are upgrading from a version earlier than 6.8.0, you may see a message "Failed to convert file ProgressThruProcessors Desktop Preferences to Unicode." This is due to our addition of full Unicode support to the ProgressThruProcessors Desktop. If you get this message, you may need to readjust your column widths and other ProgressThruProcessors Desktop view options, but no other problems will result. When you quit ProgressThruProcessors Desktop, these settings will be saved in the new Unicode format.\
|
||||
\
|
||||
|
|
|
@ -11,10 +11,11 @@
|
|||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\qc
|
||||
\cf0 http://boinc.berkeley.edu/\
|
||||
\
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640
|
||||
\cf0 Installing BOINC may take several minutes; please be patient.\
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural
|
||||
\cf0 \
|
||||
|
||||
\b \cf0 Installing BOINC may take several minutes; please be patient.
|
||||
\b0 \
|
||||
\
|
||||
If you are upgrading from a version earlier than 6.8.0, you may see a message "Failed to convert file BOINC Manager Preferences to Unicode." This is due to our addition of full Unicode support to the BOINC Manager. If you get this message, you may need to readjust your column widths and other BOINC Manager view options, but no other problems will result. When you quit BOINC Manager, these settings will be saved in the new Unicode format.\
|
||||
\
|
||||
Due to new restrictions imposed by OS 10.6 Snow Leopard, there has been a change in BOINC's security implementation. Non-administrative users can no longer run BOINC Manager unless they are added to group boinc_master. As of BOINC 6.10.5, the BOINC installer asks whether or not you wish to allow this.\
|
||||
|
|
Loading…
Reference in New Issue