| Revision | ddd88b4e891e77a6daf7e75270751670973486ec (tree) |
|---|---|
| Time | 2012-02-26 19:17:24 |
| Author | qwerty2501 <riot313@gmai...> |
| Commiter | qwerty2501 |
チャットクラスのアクセス修飾子を変更
| @@ -9,7 +9,7 @@ namespace nlite{ | ||
| 9 | 9 | class CListenerList; |
| 10 | 10 | struct Property; |
| 11 | 11 | struct GeneralProperty; |
| 12 | - struct ListenerData; | |
| 12 | + class CListenerData; | |
| 13 | 13 | |
| 14 | 14 | |
| 15 | 15 |
| @@ -9,16 +9,16 @@ namespace nlite{ | ||
| 9 | 9 | //リスナー検索オブジェクト |
| 10 | 10 | struct ListenerPre{ |
| 11 | 11 | |
| 12 | - ListenerData &user; | |
| 12 | + CListenerData &user; | |
| 13 | 13 | |
| 14 | - ListenerPre(ListenerData &in_user): | |
| 14 | + ListenerPre(CListenerData &in_user): | |
| 15 | 15 | user(in_user) |
| 16 | 16 | {} |
| 17 | 17 | |
| 18 | 18 | bool operator()(CListenerList::reference listenerData){ |
| 19 | 19 | |
| 20 | 20 | |
| 21 | - return (user.user_id == listenerData.user_id)/* && (user.community == listenerData.community)*/; | |
| 21 | + return (user.GetUserID() == listenerData.GetUserID())/* && (user.community == listenerData.community)*/; | |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | }; |
| @@ -29,7 +29,7 @@ struct ListenerPre{ | ||
| 29 | 29 | ///////////////////////////////////////////////////////////////////////////////////////////////// |
| 30 | 30 | |
| 31 | 31 | |
| 32 | -ListenerData::ListenerData(): | |
| 32 | +CListenerData::CListenerData(): | |
| 33 | 33 | user_id(TEXT("")), |
| 34 | 34 | name(TEXT("")), |
| 35 | 35 | community(TEXT("")), |
| @@ -39,26 +39,51 @@ onlyCommunityFlag(FALSE), | ||
| 39 | 39 | nameColor(INIT_COLOR) |
| 40 | 40 | {} |
| 41 | 41 | |
| 42 | -VOID ListenerData::SetNameColor(COLORREF nameColor_in){ | |
| 42 | +VOID CListenerData::SetNameColor(COLORREF nameColor_in){ | |
| 43 | 43 | |
| 44 | 44 | nameColor = nameColor_in; |
| 45 | 45 | |
| 46 | 46 | return; |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | -VOID ListenerData::SetBkColor(COLORREF bkColor_in){ | |
| 49 | +VOID CListenerData::SetBkColor(COLORREF bkColor_in){ | |
| 50 | 50 | bgcolor = bkColor_in; |
| 51 | 51 | |
| 52 | 52 | return; |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | -VOID ListenerData::SetUserName(LPCTSTR name){ | |
| 55 | +VOID CListenerData::SetUserName(LPCTSTR name){ | |
| 56 | 56 | |
| 57 | 57 | this->name = name; |
| 58 | 58 | |
| 59 | 59 | |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | +COLORREF CListenerData::GetBackColor()const { | |
| 63 | + | |
| 64 | + return this->bgcolor; | |
| 65 | + | |
| 66 | +} | |
| 67 | + | |
| 68 | +COLORREF CListenerData::GetNameColor()const{ | |
| 69 | + | |
| 70 | + return this->nameColor; | |
| 71 | +} | |
| 72 | + | |
| 73 | + | |
| 74 | +const CNLiteString &CListenerData::GetUserID()const{ | |
| 75 | + | |
| 76 | + return this->user_id; | |
| 77 | + | |
| 78 | +} | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | +const CNLiteString &CListenerData::GetName()const{ | |
| 83 | + | |
| 84 | + return this->name; | |
| 85 | + | |
| 86 | +} | |
| 62 | 87 | |
| 63 | 88 | CChatData::ViewData::ViewData(): |
| 64 | 89 | sellLineColor(INIT_COLOR), |
| @@ -68,7 +93,7 @@ CChatData::ViewData::ViewData(): | ||
| 68 | 93 | height(0) |
| 69 | 94 | {} |
| 70 | 95 | |
| 71 | -VOID CChatData::SetChat(NicoLiveChat &chat_in,ListenerData &listener){ | |
| 96 | +VOID CChatData::SetChat(NicoLiveChat &chat_in,CListenerData &listener){ | |
| 72 | 97 | |
| 73 | 98 | |
| 74 | 99 | this->anonymity = _ttol(chat_in.anonymity); |
| @@ -115,6 +140,66 @@ VOID CChatData::SetChat(NicoLiveChat &chat_in,ListenerData &listener){ | ||
| 115 | 140 | } |
| 116 | 141 | |
| 117 | 142 | |
| 143 | +VOID CChatData::SetHeight(UINT_PTR height){ | |
| 144 | + | |
| 145 | + this->viewData.height = height; | |
| 146 | + | |
| 147 | +} | |
| 148 | + | |
| 149 | +CListenerData &CChatData::GetListnerData() { | |
| 150 | + | |
| 151 | + | |
| 152 | + return *this->listenerData; | |
| 153 | +} | |
| 154 | + | |
| 155 | +const CNLiteString &CChatData::GetChatBuff()const{ | |
| 156 | + | |
| 157 | + return this->chatBuf; | |
| 158 | +} | |
| 159 | + | |
| 160 | +BOOL CChatData::IsSelect()const{ | |
| 161 | + | |
| 162 | + return this->viewData.selectFlag; | |
| 163 | +} | |
| 164 | + | |
| 165 | +COLORREF CChatData::GetBackColor()const{ | |
| 166 | + | |
| 167 | + return this->viewData.backColor; | |
| 168 | +} | |
| 169 | + | |
| 170 | +UINT_PTR CChatData::GetPremium()const{ | |
| 171 | + | |
| 172 | + return this->premium; | |
| 173 | + | |
| 174 | +} | |
| 175 | + | |
| 176 | +time_t CChatData::GetDate()const{ | |
| 177 | + | |
| 178 | + return this->date; | |
| 179 | + | |
| 180 | +} | |
| 181 | + | |
| 182 | +UINT_PTR CChatData::GetNo()const{ | |
| 183 | + | |
| 184 | + return this->no; | |
| 185 | +} | |
| 186 | + | |
| 187 | +COLORREF CChatData::GetStringColor()const{ | |
| 188 | + | |
| 189 | + return this->viewData.stringColor; | |
| 190 | + | |
| 191 | +} | |
| 192 | + | |
| 193 | +COLORREF CChatData::GetSellLineColor()const{ | |
| 194 | + | |
| 195 | + return this->viewData.sellLineColor; | |
| 196 | +} | |
| 197 | + | |
| 198 | +UINT_PTR CChatData::GetHeight()const{ | |
| 199 | + | |
| 200 | + return this->viewData.height; | |
| 201 | +} | |
| 202 | + | |
| 118 | 203 | // |
| 119 | 204 | // |
| 120 | 205 | //コメントリストクラス |
| @@ -131,7 +216,7 @@ struct GetCurSelFunc_t{ | ||
| 131 | 216 | |
| 132 | 217 | BOOL operator() (const CChatData &target){ |
| 133 | 218 | count++; |
| 134 | - return target.viewData.selectFlag; | |
| 219 | + return target.IsSelect(); | |
| 135 | 220 | } |
| 136 | 221 | |
| 137 | 222 | }; |
| @@ -144,7 +229,7 @@ struct SeartchSetPos_t{ | ||
| 144 | 229 | |
| 145 | 230 | bool operator()(const CChatData &target){ |
| 146 | 231 | |
| 147 | - return time > target.date; | |
| 232 | + return time > target.GetDate(); | |
| 148 | 233 | } |
| 149 | 234 | }; |
| 150 | 235 |
| @@ -177,7 +262,7 @@ INT_PTR CCommentList::GetCurSelNo(){ | ||
| 177 | 262 | CCommentList::iterator CCommentList::OnChatReceve(NicoLiveChat_P chatData_in,LPCTSTR communityID, UINT_PTR commnetCountSum,CCommentListWindow &listWindow){ |
| 178 | 263 | |
| 179 | 264 | CChatData chatData; |
| 180 | - ListenerData listenerData; | |
| 265 | + CListenerData listenerData; | |
| 181 | 266 | listenerData.user_id = chatData_in->user_id; |
| 182 | 267 | listenerData.time = time(NULL); |
| 183 | 268 | listenerData.community = communityID; |
| @@ -319,7 +404,7 @@ VOID CListenerList::BkColorCollect(CListenerColorCollector &target){ | ||
| 319 | 404 | std::for_each(m_listenerList.begin(), end,target); |
| 320 | 405 | } |
| 321 | 406 | |
| 322 | -CListenerList::reference CListenerList::Register(ListenerData &listener,BOOL bUpdate){ | |
| 407 | +CListenerList::reference CListenerList::Register(CListenerData &listener,BOOL bUpdate){ | |
| 323 | 408 | |
| 324 | 409 | //関数オブジェクト生成 |
| 325 | 410 | ListenerPre listenerPre(listener); |
| @@ -368,7 +453,7 @@ BOOL CListenerList::ReadProperty(LPCTSTR fileName){ | ||
| 368 | 453 | userSettingFile.Read(&userSettingBuf[0],userSettingBuf.size()); |
| 369 | 454 | LPSTR userSettingStart = strstr(&userSettingBuf[0],"<"); |
| 370 | 455 | if(userSettingStart != NULL){ |
| 371 | - ReadUserSettingXML rusx(nlite::listenerList); | |
| 456 | + CReadUserSettingXML rusx(nlite::listenerList); | |
| 372 | 457 | rusx.Parse(userSettingStart); |
| 373 | 458 | } |
| 374 | 459 |
| @@ -408,13 +493,13 @@ BOOL CListenerList::WriteProperty(LPCTSTR fileName){ | ||
| 408 | 493 | |
| 409 | 494 | //リスナーリストから保存対象のデータのみxml形式で保存 |
| 410 | 495 | for(;begin != end;++begin){ |
| 411 | - if(begin->name.Length() > 0 || begin->nameColor != ListenerData::INIT_COLOR || begin->bgcolor != ListenerData::INIT_COLOR){ | |
| 496 | + if(begin->name.Length() > 0 || begin->nameColor != CListenerData::INIT_COLOR || begin->bgcolor != CListenerData::INIT_COLOR){ | |
| 412 | 497 | pWriter->WriteStartElement(NULL,TEXT("user"),NULL); |
| 413 | 498 | if(begin->name.Length() > 0) NLITE_ATTRIBUTE_WRITE_STR(pWriter,(*begin).name); |
| 414 | 499 | if(begin->community.Length()> 0) NLITE_ATTRIBUTE_WRITE_STR(pWriter,(*begin).community); |
| 415 | 500 | NLITE_ATTRIBUTE_WRITE_INT(pWriter,(*begin).time); |
| 416 | - if(begin->bgcolor != ListenerData::INIT_COLOR)NLITE_ATTRIBUTE_WRITE_INT(pWriter,(*begin).bgcolor); | |
| 417 | - if(begin->nameColor != ListenerData::INIT_COLOR)NLITE_ATTRIBUTE_WRITE_INT(pWriter,(*begin).nameColor); | |
| 501 | + if(begin->bgcolor != CListenerData::INIT_COLOR)NLITE_ATTRIBUTE_WRITE_INT(pWriter,(*begin).bgcolor); | |
| 502 | + if(begin->nameColor != CListenerData::INIT_COLOR)NLITE_ATTRIBUTE_WRITE_INT(pWriter,(*begin).nameColor); | |
| 418 | 503 | pWriter->WriteString(begin->user_id); |
| 419 | 504 | pWriter->WriteEndElement(); |
| 420 | 505 | } |
| @@ -425,12 +510,12 @@ BOOL CListenerList::WriteProperty(LPCTSTR fileName){ | ||
| 425 | 510 | } |
| 426 | 511 | |
| 427 | 512 | |
| 428 | -ReadUserSettingXML::ReadUserSettingXML(CListenerList &in_listenerList):m_listenerList(in_listenerList),userNodeFlag(FALSE){} | |
| 513 | +CReadUserSettingXML::CReadUserSettingXML(CListenerList &in_listenerList):m_listenerList(in_listenerList),userNodeFlag(FALSE){} | |
| 429 | 514 | |
| 430 | 515 | #define NLITE_READ_USER_STRING(at,l,t) if(_tcscmp(at[0],TEXT(#t)) == 0)l.t = at[1] |
| 431 | 516 | #define NLITE_READ_USER_INT(at,l,t) if(_tcscmp(at[0],TEXT(#t))==0)l.t = _tcstol((const wchar_t*)at[1],NULL,10) |
| 432 | 517 | |
| 433 | - void ReadUserSettingXML::OnStartElement (const XML_Char *pszName, const XML_Char **papszAttrs){ | |
| 518 | + void CReadUserSettingXML::OnStartElement (const XML_Char *pszName, const XML_Char **papszAttrs){ | |
| 434 | 519 | |
| 435 | 520 | if(_tcscmp(pszName,TEXT("user")) == 0){ |
| 436 | 521 |
| @@ -452,21 +537,21 @@ ReadUserSettingXML::ReadUserSettingXML(CListenerList &in_listenerList):m_listene | ||
| 452 | 537 | return; |
| 453 | 538 | } |
| 454 | 539 | |
| 455 | - void ReadUserSettingXML::OnEndElement (const XML_Char *pszName){ | |
| 540 | + void CReadUserSettingXML::OnEndElement (const XML_Char *pszName){ | |
| 456 | 541 | |
| 457 | 542 | if(_tcscmp(pszName,TEXT("user")) == 0){ |
| 458 | 543 | |
| 459 | 544 | listenerList.Register(listenerBuff,TRUE); |
| 460 | 545 | this->userNodeFlag = FALSE; |
| 461 | - this->listenerBuff.~ListenerData(); | |
| 462 | - new(&listenerBuff) ListenerData(); | |
| 546 | + this->listenerBuff.~CListenerData(); | |
| 547 | + new(&listenerBuff) CListenerData(); | |
| 463 | 548 | |
| 464 | 549 | } |
| 465 | 550 | |
| 466 | 551 | return; |
| 467 | 552 | } |
| 468 | 553 | |
| 469 | - void ReadUserSettingXML::OnCharacterData (const XML_Char *pszData, int nLength){ | |
| 554 | + void CReadUserSettingXML::OnCharacterData (const XML_Char *pszData, int nLength){ | |
| 470 | 555 | |
| 471 | 556 | if(this->userNodeFlag == TRUE){ |
| 472 | 557 |
| @@ -4,6 +4,10 @@ namespace nlite{ | ||
| 4 | 4 | |
| 5 | 5 | //前方宣言 |
| 6 | 6 | class CCommentListWindow; |
| 7 | + class CListenerColorCollector; | |
| 8 | + class CCommentList; | |
| 9 | + class CListenerList; | |
| 10 | + class CReadUserSettingXML; | |
| 7 | 11 | |
| 8 | 12 | //国コード |
| 9 | 13 | namespace cuntry{ |
| @@ -19,10 +23,13 @@ namespace nlite{ | ||
| 19 | 23 | /// |
| 20 | 24 | ///リスナーデータ |
| 21 | 25 | /// |
| 22 | - struct ListenerData{ | |
| 26 | + class CListenerData{ | |
| 23 | 27 | private: |
| 28 | + friend CListenerColorCollector; | |
| 29 | + friend CCommentList; | |
| 30 | + friend CListenerList; | |
| 31 | + friend CReadUserSettingXML; | |
| 24 | 32 | |
| 25 | - public: | |
| 26 | 33 | CNLiteString user_id; //ユーザーID |
| 27 | 34 | CNLiteString name; //ユーザー名 |
| 28 | 35 | CNLiteString community; //登録したコミュニティ |
| @@ -36,11 +43,15 @@ namespace nlite{ | ||
| 36 | 43 | INIT_COLOR = -1 |
| 37 | 44 | |
| 38 | 45 | }; |
| 46 | + | |
| 47 | + | |
| 48 | + //セッター | |
| 49 | + public: | |
| 39 | 50 | |
| 40 | 51 | /// |
| 41 | 52 | ///コンストラクタ |
| 42 | 53 | /// |
| 43 | - ListenerData(); | |
| 54 | + CListenerData(); | |
| 44 | 55 | |
| 45 | 56 | /// |
| 46 | 57 | ///背景色設定 |
| @@ -56,6 +67,32 @@ namespace nlite{ | ||
| 56 | 67 | ///ユーザ名設定 |
| 57 | 68 | /// |
| 58 | 69 | VOID SetUserName(LPCTSTR name); |
| 70 | + | |
| 71 | + | |
| 72 | + //ゲッター | |
| 73 | + public: | |
| 74 | + | |
| 75 | + /// | |
| 76 | + ///背景色を取得 | |
| 77 | + /// | |
| 78 | + COLORREF GetBackColor() const; | |
| 79 | + | |
| 80 | + | |
| 81 | + /// | |
| 82 | + ///ニックネームの色を取得 | |
| 83 | + /// | |
| 84 | + COLORREF GetNameColor() const; | |
| 85 | + | |
| 86 | + /// | |
| 87 | + ///ユーザ名を取得 | |
| 88 | + /// | |
| 89 | + const CNLiteString &GetUserID() const; | |
| 90 | + | |
| 91 | + | |
| 92 | + /// | |
| 93 | + ///ユーザ名を取得 | |
| 94 | + /// | |
| 95 | + const CNLiteString &GetName() const; | |
| 59 | 96 | }; |
| 60 | 97 | |
| 61 | 98 | // |
| @@ -79,9 +116,9 @@ namespace nlite{ | ||
| 79 | 116 | } |
| 80 | 117 | |
| 81 | 118 | //ファンクショナル |
| 82 | - void operator()(ListenerData &target){ | |
| 119 | + void operator()(CListenerData &target){ | |
| 83 | 120 | |
| 84 | - if(target.bgcolor != ListenerData::INIT_COLOR){ | |
| 121 | + if(target.bgcolor != CListenerData::INIT_COLOR){ | |
| 85 | 122 | |
| 86 | 123 | colorlist.push_back(target.bgcolor); |
| 87 | 124 | } |
| @@ -97,7 +134,7 @@ namespace nlite{ | ||
| 97 | 134 | class CListenerList{ |
| 98 | 135 | |
| 99 | 136 | private: |
| 100 | - typedef ListenerData InternalType; | |
| 137 | + typedef CListenerData InternalType; | |
| 101 | 138 | typedef std::list<InternalType> ListenerList_Internal; |
| 102 | 139 | ListenerList_Internal m_listenerList; |
| 103 | 140 |
| @@ -112,7 +149,7 @@ namespace nlite{ | ||
| 112 | 149 | /// |
| 113 | 150 | ///ユーザー登録 |
| 114 | 151 | /// |
| 115 | - reference Register(ListenerData &listener,BOOL bUpdate); | |
| 152 | + reference Register(CListenerData &listener,BOOL bUpdate); | |
| 116 | 153 | |
| 117 | 154 | |
| 118 | 155 | /// |
| @@ -136,7 +173,7 @@ namespace nlite{ | ||
| 136 | 173 | |
| 137 | 174 | |
| 138 | 175 | class CChatData{ |
| 139 | - | |
| 176 | + friend CCommentList; | |
| 140 | 177 | |
| 141 | 178 | public: |
| 142 | 179 | struct ViewData{ |
| @@ -155,6 +192,7 @@ namespace nlite{ | ||
| 155 | 192 | ViewData(); |
| 156 | 193 | }; |
| 157 | 194 | |
| 195 | + private: | |
| 158 | 196 | ViewData viewData; //表示用データ |
| 159 | 197 | UINT_PTR premium; //プレミアム種別 |
| 160 | 198 | BOOL anonymity; //匿名フラグ |
| @@ -162,19 +200,79 @@ namespace nlite{ | ||
| 162 | 200 | UINT_PTR vpos; //コメント表示位置 |
| 163 | 201 | time_t date; //時間 |
| 164 | 202 | cuntry::LOCALE locale; //国コード |
| 165 | - ListenerData *listenerData; //ユーザ情報 | |
| 203 | + CListenerData *listenerData; //ユーザ情報 | |
| 166 | 204 | CNLiteString name; //名前。ついてこない時もある |
| 167 | 205 | CNLiteString chatBuf; //チャット本文 |
| 168 | 206 | std::vector<CNLiteString> mail; //メールコマンド |
| 169 | 207 | ULONG_PTR thread; //スレッド番号 |
| 170 | 208 | |
| 171 | - public: | |
| 172 | 209 | |
| 210 | + //セッター | |
| 211 | + public: | |
| 173 | 212 | |
| 174 | 213 | /// |
| 175 | 214 | ///nlibのチャットデータをセット |
| 176 | 215 | /// |
| 177 | - VOID SetChat(NicoLiveChat &chat_in,ListenerData &listener); | |
| 216 | + VOID SetChat(NicoLiveChat &chat_in,CListenerData &listener); | |
| 217 | + | |
| 218 | + /// | |
| 219 | + ///表示用高さを設定 | |
| 220 | + /// | |
| 221 | + VOID SetHeight(UINT_PTR height); | |
| 222 | + | |
| 223 | + //ゲッター | |
| 224 | + public: | |
| 225 | + | |
| 226 | + /// | |
| 227 | + ///リスナー情報クラスの参照を取得 | |
| 228 | + /// | |
| 229 | + CListenerData &GetListnerData(); | |
| 230 | + | |
| 231 | + /// | |
| 232 | + ///チャット本文取得 | |
| 233 | + /// | |
| 234 | + const CNLiteString &GetChatBuff()const; | |
| 235 | + | |
| 236 | + /// | |
| 237 | + ///選択状態判定フラグ取得 | |
| 238 | + /// | |
| 239 | + BOOL IsSelect()const; | |
| 240 | + | |
| 241 | + /// | |
| 242 | + ///背景色を取得 | |
| 243 | + /// | |
| 244 | + COLORREF GetBackColor()const; | |
| 245 | + | |
| 246 | + /// | |
| 247 | + ///プレミアム種別取得 | |
| 248 | + /// | |
| 249 | + UINT_PTR GetPremium()const; | |
| 250 | + | |
| 251 | + /// | |
| 252 | + ///コメント時間取得 | |
| 253 | + /// | |
| 254 | + time_t GetDate()const; | |
| 255 | + | |
| 256 | + /// | |
| 257 | + ///コメント番号取得 | |
| 258 | + /// | |
| 259 | + UINT_PTR GetNo()const; | |
| 260 | + | |
| 261 | + /// | |
| 262 | + ///文字列表示時の色を取得 | |
| 263 | + /// | |
| 264 | + COLORREF GetStringColor()const; | |
| 265 | + | |
| 266 | + /// | |
| 267 | + ///枠線色取得 | |
| 268 | + /// | |
| 269 | + COLORREF GetSellLineColor()const; | |
| 270 | + | |
| 271 | + /// | |
| 272 | + ///表示用の高さ取得 | |
| 273 | + /// | |
| 274 | + UINT_PTR GetHeight()const; | |
| 275 | + | |
| 178 | 276 | |
| 179 | 277 | }; |
| 180 | 278 |
| @@ -320,10 +418,10 @@ namespace nlite{ | ||
| 320 | 418 | /// |
| 321 | 419 | ///ユーザ設定ファイル読取クラス |
| 322 | 420 | /// |
| 323 | - class ReadUserSettingXML:public CXmlParser{ | |
| 421 | + class CReadUserSettingXML:public CXmlParser{ | |
| 324 | 422 | |
| 325 | 423 | private: |
| 326 | - ListenerData listenerBuff; | |
| 424 | + CListenerData listenerBuff; | |
| 327 | 425 | CListenerList &m_listenerList; |
| 328 | 426 | BOOL userNodeFlag; |
| 329 | 427 |
| @@ -333,7 +431,7 @@ namespace nlite{ | ||
| 333 | 431 | |
| 334 | 432 | public: |
| 335 | 433 | |
| 336 | - ReadUserSettingXML(CListenerList &in_listenerList); | |
| 434 | + CReadUserSettingXML(CListenerList &in_listenerList); | |
| 337 | 435 | |
| 338 | 436 | void OnStartElement (const XML_Char *pszName, const XML_Char **papszAttrs); |
| 339 | 437 |
| @@ -22,13 +22,13 @@ namespace nlite{ | ||
| 22 | 22 | BOOL rslt = FALSE; |
| 23 | 23 | try{ |
| 24 | 24 | |
| 25 | - tstring viewString(regex_replace(tstring(chat.chatBuf),nliteregex::TAGSTRING,nliteregex::text::NUTHINGSTRING)); | |
| 25 | + tstring viewString(regex_replace(tstring(chat.GetChatBuff()),nliteregex::TAGSTRING,nliteregex::text::NUTHINGSTRING)); | |
| 26 | 26 | rslt = __super::SetWindowText(viewString.c_str()); |
| 27 | 27 | |
| 28 | 28 | CHARFORMAT2 defaultFormat; |
| 29 | 29 | this->GetDefaultCharFormat(defaultFormat); |
| 30 | 30 | defaultFormat.dwMask |= CFM_COLOR; |
| 31 | - if(chat.premium == 2 || chat.premium == 3){ | |
| 31 | + if(chat.GetPremium() == 2 || chat.GetPremium() == 3){ | |
| 32 | 32 | |
| 33 | 33 | defaultFormat.crTextColor = m_master.viewproperty.ownerStringColor; |
| 34 | 34 | } |
| @@ -160,7 +160,7 @@ namespace nlite{ | ||
| 160 | 160 | |
| 161 | 161 | COLORREF bkColor; |
| 162 | 162 | |
| 163 | - if (comment.viewData.selectFlag == TRUE) | |
| 163 | + if (comment.IsSelect() == TRUE) | |
| 164 | 164 | { |
| 165 | 165 | bkColor = m_master.viewproperty.selectBackColor; |
| 166 | 166 |
| @@ -169,13 +169,13 @@ namespace nlite{ | ||
| 169 | 169 | { |
| 170 | 170 | |
| 171 | 171 | |
| 172 | - if(comment.viewData.backColor != CChatData::ViewData::INIT_COLOR){ | |
| 172 | + if(comment.GetBackColor() != CChatData::ViewData::INIT_COLOR){ | |
| 173 | 173 | |
| 174 | - bkColor = comment.viewData.backColor; | |
| 174 | + bkColor = comment.GetBackColor(); | |
| 175 | 175 | |
| 176 | - }else if(comment.listenerData->bgcolor != ListenerData::INIT_COLOR){ | |
| 176 | + }else if(comment.GetListnerData().GetBackColor() != CListenerData::INIT_COLOR){ | |
| 177 | 177 | |
| 178 | - bkColor = comment.listenerData->bgcolor; | |
| 178 | + bkColor = comment.GetListnerData().GetBackColor(); | |
| 179 | 179 | |
| 180 | 180 | |
| 181 | 181 | } else { |
| @@ -245,7 +245,7 @@ namespace nlite{ | ||
| 245 | 245 | for(;chatDataBegin != chatDataEnd && heightSum < listRect.bottom;++chatDataBegin){ |
| 246 | 246 | m_hMaster.m_commentListWindow.CalcItemHeight(*chatDataBegin); |
| 247 | 247 | counter++; |
| 248 | - heightSum += chatDataBegin->viewData.height; | |
| 248 | + heightSum += chatDataBegin->GetHeight(); | |
| 249 | 249 | } |
| 250 | 250 | |
| 251 | 251 |
| @@ -258,7 +258,7 @@ namespace nlite{ | ||
| 258 | 258 | |
| 259 | 259 | tmpRect = headerRect; |
| 260 | 260 | tmpRect.top += heightSum; |
| 261 | - tmpRect.bottom += heightSum + chatDataBegin->viewData.height; | |
| 261 | + tmpRect.bottom += heightSum + chatDataBegin->GetHeight(); | |
| 262 | 262 | |
| 263 | 263 | if(ctrlsBegin == ctrlsEnd)ctrlsBegin = Extend(); |
| 264 | 264 |
| @@ -459,7 +459,7 @@ namespace nlite{ | ||
| 459 | 459 | |
| 460 | 460 | for(;begin != end;++begin){ |
| 461 | 461 | |
| 462 | - begin->viewData.height = 0; | |
| 462 | + begin->SetHeight(0); | |
| 463 | 463 | |
| 464 | 464 | } |
| 465 | 465 |
| @@ -994,7 +994,7 @@ namespace nlite{ | ||
| 994 | 994 | for(;chatData != endData && listRect.top < clientRect.bottom;++chatData){ |
| 995 | 995 | CalcItemHeight(*chatData); |
| 996 | 996 | |
| 997 | - listRect.bottom += chatData->viewData.height; | |
| 997 | + listRect.bottom += chatData->GetHeight(); | |
| 998 | 998 | |
| 999 | 999 | headerRects[CCommentView::NO].top = listRect.top + SELL_SPACE_LENGTH; |
| 1000 | 1000 | headerRects[CCommentView::USERNAME].top = listRect.top + SELL_SPACE_LENGTH; |
| @@ -1008,7 +1008,7 @@ namespace nlite{ | ||
| 1008 | 1008 | headerRects[CCommentView::TIME].bottom = listRect.bottom - SELL_SPACE_LENGTH; |
| 1009 | 1009 | headerRects[CCommentView::INFO].bottom = listRect.bottom - SELL_SPACE_LENGTH; |
| 1010 | 1010 | |
| 1011 | - if(chatData->viewData.selectFlag == TRUE){ | |
| 1011 | + if(chatData->IsSelect() == TRUE){ | |
| 1012 | 1012 | selectFlag = TRUE; |
| 1013 | 1013 | selectData = chatData; |
| 1014 | 1014 | selectRect = listRect; |
| @@ -1114,7 +1114,7 @@ namespace nlite{ | ||
| 1114 | 1114 | CCommentList::reverse_iterator rend = self.commentlist.rend(); |
| 1115 | 1115 | for(;rbegin != rend;++rbegin){ |
| 1116 | 1116 | CalcItemHeight(*rbegin); |
| 1117 | - height += rbegin->viewData.height; | |
| 1117 | + height += rbegin->GetHeight(); | |
| 1118 | 1118 | rslt++; |
| 1119 | 1119 | if(height > clientRect.bottom)goto overclientrect; |
| 1120 | 1120 |
| @@ -1141,13 +1141,13 @@ overclientrect: | ||
| 1141 | 1141 | // |
| 1142 | 1142 | //コメント時間表示用文字列作成 |
| 1143 | 1143 | // |
| 1144 | - time_t chatTime = (time_t)difftime(chatData.date,self.stream.GetStartTime()); | |
| 1144 | + time_t chatTime = (time_t)difftime(chatData.GetDate(),self.stream.GetStartTime()); | |
| 1145 | 1145 | |
| 1146 | 1146 | |
| 1147 | 1147 | BOOL beforeStartFlag = chatTime < 0 ? TRUE : FALSE; |
| 1148 | - TCHAR noString[sizeof(chatData.no) * 8]; | |
| 1148 | + TCHAR noString[sizeof(UINT_PTR) * 8]; | |
| 1149 | 1149 | TCHAR dateString[LENGTH_16]; |
| 1150 | - if(chatData.no != 0)_stprintf(noString,TEXT("%u"),chatData.no); | |
| 1150 | + if(chatData.GetNo() != 0)_stprintf(noString,TEXT("%u"),chatData.GetNo()); | |
| 1151 | 1151 | else _tcscpy(noString,TEXT("")); |
| 1152 | 1152 | CNLiteString timeFormat; |
| 1153 | 1153 |
| @@ -1175,7 +1175,7 @@ overclientrect: | ||
| 1175 | 1175 | CBrush originBkBrush; //背景描画用ブラシ |
| 1176 | 1176 | |
| 1177 | 1177 | //選択状態かチェック |
| 1178 | - if (chatData.viewData.selectFlag == TRUE) | |
| 1178 | + if (chatData.IsSelect() == TRUE) | |
| 1179 | 1179 | { |
| 1180 | 1180 | bkColor = self.viewproperty.selectBackColor; |
| 1181 | 1181 |
| @@ -1185,27 +1185,27 @@ overclientrect: | ||
| 1185 | 1185 | else |
| 1186 | 1186 | { |
| 1187 | 1187 | |
| 1188 | - if(chatData.viewData.sellLineColor == CChatData::ViewData::INIT_COLOR){ | |
| 1188 | + if(chatData.GetSellLineColor() == CChatData::ViewData::INIT_COLOR){ | |
| 1189 | 1189 | dc.SelectPen(this->normalSellLinePen); |
| 1190 | 1190 | |
| 1191 | 1191 | } else { |
| 1192 | 1192 | |
| 1193 | - originSellLinePen.CreatePen(PS_SOLID,1,chatData.viewData.sellLineColor); | |
| 1193 | + originSellLinePen.CreatePen(PS_SOLID,1,chatData.GetSellLineColor()); | |
| 1194 | 1194 | dc.SelectPen(originSellLinePen); |
| 1195 | 1195 | } |
| 1196 | 1196 | |
| 1197 | 1197 | |
| 1198 | 1198 | |
| 1199 | - if(chatData.viewData.backColor != CChatData::ViewData::INIT_COLOR || chatData.listenerData->bgcolor != ListenerData::INIT_COLOR){ | |
| 1199 | + if(chatData.GetBackColor() != CChatData::ViewData::INIT_COLOR || chatData.GetListnerData().GetBackColor() != CListenerData::INIT_COLOR){ | |
| 1200 | 1200 | |
| 1201 | - if(chatData.viewData.backColor != CChatData::ViewData::INIT_COLOR){ | |
| 1202 | - bkColor = chatData.viewData.backColor; | |
| 1203 | - originBkBrush.CreateSolidBrush(chatData.viewData.backColor); | |
| 1201 | + if(chatData.GetBackColor() != CChatData::ViewData::INIT_COLOR){ | |
| 1202 | + bkColor = chatData.GetBackColor(); | |
| 1203 | + originBkBrush.CreateSolidBrush(chatData.GetBackColor()); | |
| 1204 | 1204 | |
| 1205 | - }else if(chatData.listenerData->bgcolor != ListenerData::INIT_COLOR){ | |
| 1205 | + }else if(chatData.GetListnerData().GetBackColor() != CListenerData::INIT_COLOR){ | |
| 1206 | 1206 | |
| 1207 | - bkColor = chatData.listenerData->bgcolor; | |
| 1208 | - originBkBrush.CreateSolidBrush(chatData.listenerData->bgcolor); | |
| 1207 | + bkColor = chatData.GetListnerData().GetBackColor(); | |
| 1208 | + originBkBrush.CreateSolidBrush(chatData.GetListnerData().GetBackColor()); | |
| 1209 | 1209 | |
| 1210 | 1210 | } |
| 1211 | 1211 |
| @@ -1232,16 +1232,16 @@ overclientrect: | ||
| 1232 | 1232 | |
| 1233 | 1233 | |
| 1234 | 1234 | |
| 1235 | - CComBSTR &viewUserName = chatData.listenerData->name.Length() == 0 ? chatData.listenerData->user_id : chatData.listenerData->name; | |
| 1235 | + const CNLiteString &viewUserName = chatData.GetListnerData().GetName().Length() == 0 ? chatData.GetListnerData().GetUserID() : chatData.GetListnerData().GetName(); | |
| 1236 | 1236 | dc.SelectFont(linkFont); |
| 1237 | - dc.SetTextColor(chatData.listenerData->nameColor != ListenerData::INIT_COLOR ? chatData.listenerData->nameColor : self.viewproperty.linkStringColor); | |
| 1237 | + dc.SetTextColor(chatData.GetListnerData().GetNameColor() != CListenerData::INIT_COLOR ? chatData.GetListnerData().GetNameColor() : self.viewproperty.linkStringColor); | |
| 1238 | 1238 | //テキスト描画 |
| 1239 | 1239 | dc.DrawTextW(noString,_tcslen(noString),&noViewRect,DT_WORD_ELLIPSIS); |
| 1240 | 1240 | |
| 1241 | 1241 | |
| 1242 | 1242 | dc.DrawTextW(viewUserName,viewUserName.Length(),&userNameViewRect,DT_WORD_ELLIPSIS); |
| 1243 | 1243 | dc.SelectFont(::AtlGetDefaultGuiFont()); |
| 1244 | - dc.SetTextColor(chatData.viewData.stringColor == CChatData::ViewData::INIT_COLOR ? chatData.viewData.stringColor :self.viewproperty.baseStringColor); | |
| 1244 | + dc.SetTextColor(chatData.GetStringColor() == CChatData::ViewData::INIT_COLOR ? chatData.GetStringColor() :self.viewproperty.baseStringColor); | |
| 1245 | 1245 | dc.DrawTextW(dateString,_tcslen(dateString),&timeViewRect,DT_WORD_ELLIPSIS); |
| 1246 | 1246 | |
| 1247 | 1247 | return; |
| @@ -1284,7 +1284,7 @@ end: | ||
| 1284 | 1284 | VOID CCommentListWindow::CalcItemHeight(CChatData &chatData){ |
| 1285 | 1285 | |
| 1286 | 1286 | |
| 1287 | - if(chatData.viewData.height == 0){ | |
| 1287 | + if(chatData.GetHeight() == 0){ | |
| 1288 | 1288 | RECT drowSize; |
| 1289 | 1289 | self.m_header.GetItemRect(CCommentView::COMMENT,&drowSize); |
| 1290 | 1290 |
| @@ -1300,7 +1300,7 @@ end: | ||
| 1300 | 1300 | cedit.DestroyWindow(); |
| 1301 | 1301 | drowSize.bottom += 12; |
| 1302 | 1302 | if(drowSize.bottom - drowSize.top > 120)drowSize.bottom = drowSize.top + 120; |
| 1303 | - chatData.viewData.height = drowSize.bottom - drowSize.top; | |
| 1303 | + chatData.SetHeight(drowSize.bottom - drowSize.top); | |
| 1304 | 1304 | } |
| 1305 | 1305 | |
| 1306 | 1306 | return ; |
| @@ -1324,7 +1324,7 @@ end: | ||
| 1324 | 1324 | |
| 1325 | 1325 | for(; chatData != end ;(++chatData)){ |
| 1326 | 1326 | CalcItemHeight(*chatData); |
| 1327 | - heightSum += chatData->viewData.height; | |
| 1327 | + heightSum += chatData->GetHeight(); | |
| 1328 | 1328 | |
| 1329 | 1329 | |
| 1330 | 1330 | if(heightSum >= height)break; |
| @@ -1351,24 +1351,24 @@ end: | ||
| 1351 | 1351 | auto endData = self.commentlist.end(); |
| 1352 | 1352 | for(;clickData != endData;++clickData){ |
| 1353 | 1353 | |
| 1354 | - heightsum += clickData->viewData.height; | |
| 1354 | + heightsum += clickData->GetHeight(); | |
| 1355 | 1355 | |
| 1356 | 1356 | if(heightsum > point.y){ |
| 1357 | 1357 | |
| 1358 | 1358 | CDC cdc = this->GetDC(); |
| 1359 | 1359 | |
| 1360 | - rc.top = heightsum -= clickData->viewData.height; | |
| 1360 | + rc.top = heightsum -= clickData->GetHeight(); | |
| 1361 | 1361 | RECT calcRect = {0}; |
| 1362 | 1362 | cdc.SelectFont(linkFont); |
| 1363 | 1363 | |
| 1364 | 1364 | |
| 1365 | 1365 | if(index == CCommentView::USERNAME){ |
| 1366 | - LPCTSTR viewStr = clickData->listenerData->name.Length() == 0 ? clickData->listenerData->user_id : clickData->listenerData->name; | |
| 1366 | + LPCTSTR viewStr = clickData->GetListnerData().GetName().Length() == 0 ? clickData->GetListnerData().GetUserID() : clickData->GetListnerData().GetName(); | |
| 1367 | 1367 | cdc.DrawTextW(viewStr ,_tcslen(viewStr),&calcRect,DT_CALCRECT); |
| 1368 | 1368 | |
| 1369 | 1369 | } else if(index == CCommentView::NO){ |
| 1370 | 1370 | TCHAR viewStr[sizeof(UINT_PTR) * 8]; |
| 1371 | - _stprintf(viewStr,TEXT("%d"),clickData->no); | |
| 1371 | + _stprintf(viewStr,TEXT("%d"),clickData->GetNo()); | |
| 1372 | 1372 | cdc.DrawTextW(viewStr,_tcslen(viewStr),&calcRect,DT_CALCRECT); |
| 1373 | 1373 | |
| 1374 | 1374 | } |
| @@ -1377,7 +1377,7 @@ end: | ||
| 1377 | 1377 | |
| 1378 | 1378 | //座標がリンク対象文字列内にある場合はtrueを設定する |
| 1379 | 1379 | rslt = (point.y >= rc.top && point.y <= rc.bottom && point.x >= rc.left && point.x <= rc.right) && |
| 1380 | - ((index ==CCommentView::NO && clickData->no != 0) ||index ==CCommentView::USERNAME); | |
| 1380 | + ((index ==CCommentView::NO && clickData->GetNo() != 0) ||index ==CCommentView::USERNAME); | |
| 1381 | 1381 | |
| 1382 | 1382 | break; |
| 1383 | 1383 |
| @@ -1441,7 +1441,7 @@ end: | ||
| 1441 | 1441 | |
| 1442 | 1442 | |
| 1443 | 1443 | COLORREF bkColor; |
| 1444 | - if(lineIte->listenerData->bgcolor == ListenerData::INIT_COLOR){ | |
| 1444 | + if(lineIte->GetListnerData().GetBackColor() == CListenerData::INIT_COLOR){ | |
| 1445 | 1445 | CListenerColorCollector colorCollector; |
| 1446 | 1446 | listenerList.BkColorCollect(colorCollector); |
| 1447 | 1447 | UCHAR red; |
| @@ -1459,11 +1459,11 @@ end: | ||
| 1459 | 1459 | }while(colorCollector.Find(bkColor)); |
| 1460 | 1460 | |
| 1461 | 1461 | |
| 1462 | - lineIte->listenerData->SetBkColor(bkColor); | |
| 1462 | + lineIte->GetListnerData().SetBkColor(bkColor); | |
| 1463 | 1463 | } else { |
| 1464 | 1464 | |
| 1465 | - | |
| 1466 | - lineIte->listenerData->bgcolor = ListenerData::INIT_COLOR; | |
| 1465 | + lineIte->GetListnerData().SetBkColor(CListenerData::INIT_COLOR); | |
| 1466 | + | |
| 1467 | 1467 | } |
| 1468 | 1468 | } |
| 1469 | 1469 |
| @@ -497,10 +497,10 @@ LRESULT CNliteMainFrame::OnClickChatNo(UINT uMsg,WPARAM wParam,LPARAM lParam){ | ||
| 497 | 497 | |
| 498 | 498 | auto &chatData = *(CChatData*)wParam; |
| 499 | 499 | CString setString; |
| 500 | - if(chatData.listenerData->name.Length() == 0){ | |
| 501 | - setString.Format(TEXT(">>%d "),chatData.no); | |
| 500 | + if(chatData.GetListnerData().GetName().Length() == 0){ | |
| 501 | + setString.Format(TEXT(">>%d "),chatData.GetNo()); | |
| 502 | 502 | }else{ |
| 503 | - setString.Format(TEXT(">>%s "),chatData.listenerData->name); | |
| 503 | + setString.Format(TEXT(">>%s "),chatData.GetListnerData().GetName()); | |
| 504 | 504 | } |
| 505 | 505 | |
| 506 | 506 | this->commentWriteWindow.SetText(setString); |
| @@ -512,7 +512,7 @@ LRESULT CNliteMainFrame::OnClickChatNo(UINT uMsg,WPARAM wParam,LPARAM lParam){ | ||
| 512 | 512 | LRESULT CNliteMainFrame::OnClickUserName(UINT uMsg,WPARAM wParam,LPARAM lParam){ |
| 513 | 513 | |
| 514 | 514 | auto &chatData = *(CChatData*)wParam; |
| 515 | - listenerSettingWindow.ShowSettingWindow(*chatData.listenerData); | |
| 515 | + listenerSettingWindow.ShowSettingWindow(chatData.GetListnerData()); | |
| 516 | 516 | |
| 517 | 517 | |
| 518 | 518 | return 0; |
| @@ -144,7 +144,7 @@ VOID CColorSettingButton::SetColor(COLORREF in_color){ | ||
| 144 | 144 | if(brush.IsNull() != TRUE){ |
| 145 | 145 | brush.DeleteObject(); |
| 146 | 146 | } |
| 147 | - if(color != ListenerData::INIT_COLOR){ | |
| 147 | + if(color != CListenerData::INIT_COLOR){ | |
| 148 | 148 | |
| 149 | 149 | brush.CreateSolidBrush(color); |
| 150 | 150 | this->SetWindowText(TEXT("")); |
| @@ -164,17 +164,18 @@ LRESULT CColorSettingButton::OnSetCursor(HWND wparam,UINT loLparam,UINT hiLparam | ||
| 164 | 164 | |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | -VOID CListenerSettingWindow::ShowSettingWindow(ListenerData &listenerData){ | |
| 167 | +VOID CListenerSettingWindow::ShowSettingWindow(CListenerData &listenerData){ | |
| 168 | 168 | |
| 169 | 169 | this->ShowWindow(SW_HIDE); |
| 170 | 170 | this->listenerData = &listenerData; |
| 171 | 171 | |
| 172 | 172 | |
| 173 | - backColorButton.SetColor(this->listenerData->bgcolor); | |
| 174 | - nameColorButton.SetColor(this->listenerData->nameColor); | |
| 173 | + backColorButton.SetColor(this->listenerData->GetBackColor()); | |
| 174 | + nameColorButton.SetColor(this->listenerData->GetNameColor()); | |
| 175 | + | |
| 176 | + idField.SetWindowText(listenerData.GetUserID()); | |
| 177 | + nameEdit.SetWindowText(listenerData.GetName()); | |
| 175 | 178 | |
| 176 | - idField.SetWindowText(listenerData.user_id); | |
| 177 | - nameEdit.SetWindowText(listenerData.name); | |
| 178 | 179 | |
| 179 | 180 | this->ShowWindow(SW_SHOW); |
| 180 | 181 | return; |
| @@ -243,11 +244,11 @@ VOID CListenerSettingWindow::OnButton(UINT hiWParam,INT_PTR loWParam,HWND lParam | ||
| 243 | 244 | |
| 244 | 245 | if(this->backColorReturnButton == lParam){ |
| 245 | 246 | |
| 246 | - backColorButton.SetColor(ListenerData::INIT_COLOR); | |
| 247 | + backColorButton.SetColor(CListenerData::INIT_COLOR); | |
| 247 | 248 | |
| 248 | 249 | } else if(this->nameColorReturnButton == lParam){ |
| 249 | 250 | |
| 250 | - nameColorButton.SetColor(ListenerData::INIT_COLOR); | |
| 251 | + nameColorButton.SetColor(CListenerData::INIT_COLOR); | |
| 251 | 252 | } |
| 252 | 253 | |
| 253 | 254 | return; |
| @@ -88,7 +88,7 @@ namespace nlite{ | ||
| 88 | 88 | CColorSettingButton backColorButton; //背景色編集ボタン |
| 89 | 89 | CButton backColorReturnButton; //背景色を戻すボタン |
| 90 | 90 | CStatic idField; //ID表示領域 |
| 91 | - ListenerData *listenerData; //対象のリスナーデータ | |
| 91 | + CListenerData *listenerData; //対象のリスナーデータ | |
| 92 | 92 | public: |
| 93 | 93 | enum { IDD = IDD_LISTENER_SETTING_DIALOG }; |
| 94 | 94 |
| @@ -104,7 +104,7 @@ namespace nlite{ | ||
| 104 | 104 | /// |
| 105 | 105 | ///設定ウィンドウ表示 |
| 106 | 106 | /// |
| 107 | - VOID ShowSettingWindow(ListenerData &listenerData); | |
| 107 | + VOID ShowSettingWindow(CListenerData &listenerData); | |
| 108 | 108 | |
| 109 | 109 | private: |
| 110 | 110 | /// |