Err DIA_FrmEnableDIA(const DIA_Settings* diaSettings, FormType* form, Coord minH, Coord prefH, Coord maxH, Coord minW, Coord prefW, Coord maxW) { Err error; WinHandle wh; Assert(diaSettings); Assert(form); if (DIA_HasSonySilkLib(diaSettings)) DIA_HandleResizeEvent(); if (!DIA_HasPenInputMgr(diaSettings)) return errNone; error=FrmSetDIAPolicyAttr(form, frmDIAPolicyCustom); if (error) goto OnError; wh=FrmGetWindowHandle(form); Assert(wh); error=PINSetInputTriggerState(pinInputTriggerEnabled); error=WinSetConstraintsSize(wh, minH, prefH, maxH, minW, prefW, maxW); error=PINSetInputAreaState(pinInputAreaUser); error = errNone; OnError: if (error==pinErrNoSoftInputArea) error=errNone; return error; }
void SetDIAState( DIAStateType state ) { if ( DIA_HARDWARE_HANDERA == hardware && GetDIAState() == state ) return; switch ( hardware ) { #ifdef SUPPORT_DIA_SONY case DIA_HARDWARE_SONY1: switch ( state ) { case DIA_STATE_MAX: SilkLibResizeDispWin( sonyRefNum, silkResizeNormal ); break; case DIA_STATE_MIN: SilkLibResizeDispWin( sonyRefNum, silkResizeToStatus ); break; case DIA_STATE_NO_STATUS_BAR: SilkLibResizeDispWin( sonyRefNum, silkResizeMax ); break; default: break; } break; case DIA_HARDWARE_SONY2: switch ( state ) { case DIA_STATE_MAX: VskSetState( sonyRefNum, vskStateResize, vskResizeMax ); break; case DIA_STATE_MIN: VskSetState( sonyRefNum, vskStateResize, vskResizeMin ); break; case DIA_STATE_NO_STATUS_BAR: VskSetState( sonyRefNum, vskStateResize, vskResizeNone ); break; default: break; } break; #endif #ifdef SUPPORT_DIA_HANDERA case DIA_HARDWARE_HANDERA: switch ( state ) { case DIA_STATE_MAX: SilkMaximizeWindow(); break; case DIA_STATE_MIN: case DIA_STATE_NO_STATUS_BAR: SilkMinimizeWindow(); break; default: break; } break; #endif #ifdef HAVE_PALM_DIA_SDK case DIA_HARDWARE_PALM10: case DIA_HARDWARE_PALM11: switch ( state ) { case DIA_STATE_MAX: PINSetInputAreaState( pinInputAreaOpen ); break; case DIA_STATE_MIN: case DIA_STATE_NO_STATUS_BAR: PINSetInputAreaState( pinInputAreaClosed ); break; default: break; } break; #endif default: break; } }
void SetDIAState( DIAStateType state ) { if ( DIA_HARDWARE_HANDERA == hardware && GetDIAState() == state ) return; switch ( hardware ) { #ifdef SUPPORT_DIA_SONY case DIA_HARDWARE_SONY1: { Boolean oldAllow; oldAllow = sony1AllowResize; if ( ! oldAllow ) SetDIAAllowResize( true ); switch ( state ) { case DIA_STATE_MAX: SilkLibResizeDispWin( sonyRefNum, silkResizeNormal ); break; case DIA_STATE_MIN: SilkLibResizeDispWin( sonyRefNum, silkResizeToStatus ); break; case DIA_STATE_NO_STATUS_BAR: SilkLibResizeDispWin( sonyRefNum, silkResizeMax ); break; default: break; } break; if ( ! oldAllow ) SetDIAAllowResize( false ); } case DIA_HARDWARE_SONY2: { Boolean oldAllow; UInt16 allowState; if ( errNone == VskGetState( sonyRefNum, vskStateEnable, &allowState ) ) oldAllow = ( allowState != 0 ); else oldAllow = false; if ( ! oldAllow ) { SetDIAAllowResize( true ); } switch ( state ) { case DIA_STATE_MAX: VskSetState( sonyRefNum, vskStateResize, vskResizeMax ); break; case DIA_STATE_MIN: VskSetState( sonyRefNum, vskStateResize, vskResizeMin ); break; case DIA_STATE_NO_STATUS_BAR: VskSetState( sonyRefNum, vskStateResize, vskResizeNone ); break; default: break; } break; if ( ! oldAllow ) SetDIAAllowResize( false ); } #endif #ifdef SUPPORT_DIA_HANDERA case DIA_HARDWARE_HANDERA: switch ( state ) { case DIA_STATE_MAX: SilkMaximizeWindow(); break; case DIA_STATE_MIN: case DIA_STATE_NO_STATUS_BAR: SilkMinimizeWindow(); break; default: break; } break; #endif #ifdef HAVE_PALM_DIA_SDK case DIA_HARDWARE_PALM10: case DIA_HARDWARE_PALM11: switch ( state ) { case DIA_STATE_MAX: StatShow(); PINSetInputAreaState( pinInputAreaOpen ); break; case DIA_STATE_MIN: StatShow(); PINSetInputAreaState( pinInputAreaClosed ); break; case DIA_STATE_NO_STATUS_BAR: StatHide(); if ( pinInputAreaOpen == PINGetInputAreaState() ) PINSetInputAreaState( pinInputAreaClosed ); /* extra hide for some devices */ if ( GetDIAState() != DIA_STATE_NO_STATUS_BAR ) StatHide(); break; default: break; } break; #endif default: break; } }