static int SaveConfigToStream( TidyDocImpl* doc, StreamOut* out ) { int rc = 0; const TidyOptionImpl* option; for ( option=option_defs+1; 0==rc && option && option->name; ++option ) { const TidyOptionValue* val = &doc->config.value[ option->id ]; if ( option->parser == NULL ) continue; if ( OptionValueEqDefault( option, val ) && option->id != TidyDoctype) continue; if ( option->id == TidyDoctype ) /* Special case */ { ulong dtmode = cfg( doc, TidyDoctypeMode ); if ( dtmode == TidyDoctypeUser ) { tmbstr t; /* add 2 double quotes */ if (( t = (tmbstr)MemAlloc( tmbstrlen( val->p ) + 2 ) )) { t[0] = '\"'; t[1] = 0; tmbstrcat( t, val->p ); tmbstrcat( t, "\"" ); rc = WriteOptionString( option, t, out ); MemFree( t ); } } else if ( dtmode == option_defs[TidyDoctypeMode].dflt ) continue; else rc = WriteOptionPick( option, dtmode, out ); } else if ( option->pickList ) rc = WriteOptionPick( option, val->v, out ); else { switch ( option->type ) { case TidyString: rc = WriteOptionString( option, val->p, out ); break; case TidyInteger: rc = WriteOptionInt( option, val->v, out ); break; case TidyBoolean: rc = WriteOptionBool( option, val->v ? yes : no, out ); break; } } } return rc; }
void CGroupAssignToDoDlg::OnCaptureChanged(CWnd *pWnd) { CRect rWindow; GetWindowRect(&rWindow); if(!IsIconic()) WriteOptionString(IDS_OFSMESSENGER,IDS_GROUPASSIGNTODO,RectToString(rWindow)); COFSNcDlg2::OnCaptureChanged(pWnd); }
void CInviteChatDlg::OnCaptureChanged(CWnd *pWnd) { CRect rWindow; GetWindowRect(&rWindow); if(!IsIconic()) WriteOptionString(IDS_OFSMESSENGER,IDS_INVITE_CHAT,RectToString(rWindow)); CResizableDialog::OnCaptureChanged(pWnd); }
void CFileDescriptioDlg::OnCaptureChanged(CWnd *pWnd) { CRect rWindow; GetWindowRect(&rWindow); if(!IsIconic()) WriteOptionString(IDS_OFSMESSENGER,IDS_FILE_DESCRIPTION,RectToString(rWindow)); CResizableDialog::OnCaptureChanged(pWnd); }
void CAddUserRequest::OnCaptureChanged(CWnd *pWnd) { CRect rWindow; GetWindowRect(&rWindow); if(!IsIconic()) WriteOptionString(IDS_OFSMESSENGER,IDS_ADD_FRIEND,RectToString(rWindow)); CResizableDialog::OnCaptureChanged(pWnd); }
static int WriteOptionPick( const TidyOptionImpl* option, uint ival, StreamOut* out ) { uint ix; const ctmbstr* val = option->pickList; for ( ix=0; val[ix] && ix<ival; ++ix ) /**/; if ( ix==ival && val[ix] ) return WriteOptionString( option, val[ix], out ); return -1; }
void CLoginDlg::OnClickButtonLogin() { UpdateData(); m_LoginStr.TrimLeft(); m_LoginStr.TrimRight(); CString LoginStr = m_LoginStr; int StartPortPos = -1; if((StartPortPos = LoginStr.Find(_T(":")))!=-1) { CString strPort = LoginStr.Mid(StartPortPos+1); LoginStr = LoginStr.Left(StartPortPos); int lPort = _ttol(strPort); } // Check: Login is E-Mail [9/2/2002] if(CheckEmailString(LoginStr)) { if(GetDllVersion(_T("comctl32.dll")) >= PACKVERSION(5,8)) { ShowLoginTooltip(FALSE); } WriteOptionInt(IDS_NETOPTIONS, IDS_USESSL, m_btnSSL.GetPressed()); if(!m_btnSavePassword.GetPressed()) { WriteOptionString(IDS_LOGIN, IDS_NICKNAME, _T("")); //WriteOptionString(IDS_LOGIN,IDS_PASSWORD,""); WriteOptionInt(IDS_LOGIN,IDS_REMEMBER,FALSE); } else { #ifndef RADIUS #define CRYPT_PROV_CONTAINER_NAME _T("Mediachase") #else #define CRYPT_PROV_CONTAINER_NAME _T("Radius-Soft") #endif #define CRYPT_KEYLENGTH 0x00280000L #define ENCRYPT_ALGORITHM CALG_RC4 #define ENCRYPT_BLOCK_SIZE 1 //CString strHashData; CCryptProv m_hCryptProv; CCryptDerivedKey m_hKey; HRESULT m_CryptInitErrorCode = m_hCryptProv.Initialize(PROV_RSA_FULL,CRYPT_PROV_CONTAINER_NAME,MS_DEF_PROV,NULL); if(m_CryptInitErrorCode==0x80090016) { m_CryptInitErrorCode = m_hCryptProv.Initialize(PROV_RSA_FULL,CRYPT_PROV_CONTAINER_NAME,MS_DEF_PROV,CRYPT_NEWKEYSET); } if(m_CryptInitErrorCode==S_OK) { // Create Key [9/12/2002] CCryptMD5Hash hMD5Hash; m_CryptInitErrorCode = hMD5Hash.Initialize(m_hCryptProv,CRYPT_PROV_CONTAINER_NAME); if(m_CryptInitErrorCode==S_OK) { m_CryptInitErrorCode = m_hKey.Initialize(m_hCryptProv,hMD5Hash,ENCRYPT_ALGORITHM,CRYPT_KEYLENGTH); if(m_CryptInitErrorCode==S_OK) { LPTSTR strHashData = NULL; if(LoginPassword2HexSTR(m_hKey,m_LoginStr,m_PasswordStr,&strHashData)==S_OK) { WriteOptionString(IDS_LOGIN,IDS_NICKNAME,strHashData); delete [] strHashData; strHashData = NULL; } } } } //WriteOptionString(IDS_LOGIN,IDS_NICKNAME,m_LoginStr); //Pack(m_PasswordStr,CString("vTsfO")); //WriteOptionString(IDS_LOGIN,IDS_PASSWORD,m_PasswordStr); //UnPack(m_PasswordStr,CString("vTsfO")); WriteOptionInt(IDS_LOGIN,IDS_REMEMBER,TRUE); } if(::IsWindow(GetParent()->GetSafeHwnd())) GetParent()->PostMessage(WM_INETLOGIN,0,0); } else { // Error; Onvalide Login [9/2/2002] // Show Ballon Tooltip [9/9/2004] if(GetDllVersion(_T("comctl32.dll")) >= PACKVERSION(5,8)) { ShowLoginTooltip(TRUE); } else { _SHOW_IBN_ERROR_DLG_OK(IDS_INVALID_LOGIN_OR_PASSWORD); } } // [9/2/2002] }
static int WriteOptionBool( const TidyOptionImpl* option, Bool bval, StreamOut* out ) { ctmbstr sval = bval ? "yes" : "no"; return WriteOptionString( option, sval, out ); }
static int WriteOptionInt( const TidyOptionImpl* option, uint ival, StreamOut* out ) { tmbchar sval[ 32 ] = {0}; tmbsnprintf(sval, sizeof(sval), "%u", ival ); return WriteOptionString( option, sval, out ); }