OSDN Git Service

背景フラグ削除
authorqwerty2501 <riot313@gmail.com>
Thu, 9 Feb 2012 15:05:45 +0000 (00:05 +0900)
committerqwerty2501 <riot313@gmail.com>
Thu, 9 Feb 2012 15:05:45 +0000 (00:05 +0900)
nlite.suo
nlite/nlite_chatData.cpp
nlite/nlite_chatData.h
nlite/nlite_commentview.cpp
nlite/nlite_property.cpp
nlite/nlite_property.h

index 6fbcf6e..9250c4e 100644 (file)
Binary files a/nlite.suo and b/nlite.suo differ
index 3366ec7..36112f7 100644 (file)
@@ -10,15 +10,16 @@ CListenerList nlite::listenerList;
 //\83\8a\83X\83i\81[\8c\9f\8dõ\83I\83u\83W\83F\83N\83g
 struct ListenerPre{
 
-       LPCTSTR user_id;
+       ListenerData &user;
 
-       ListenerPre(LPCTSTR user_id_in):
-               user_id(user_id_in)
+       ListenerPre(ListenerData &in_user):
+               user(in_user)
        {}
 
        bool operator()(CListenerList::reference listenerData){
 
-               return _tcscmp(user_id,listenerData.user_id) == 0;
+               
+               return (user.user_id == listenerData.user_id) && (user.community == listenerData.community);
        }
 
 };
@@ -33,8 +34,8 @@ ListenerData::ListenerData():
 user_id(TEXT("")),
 name(TEXT("")),
 community(TEXT("")),
-bgcolor(PALETTERGB(0,0,0)),
-originBkFlag(FALSE),
+bgcolor(INIT_COLOR),
+//originBkFlag(FALSE),
 time(0)
 {}
 
@@ -52,7 +53,7 @@ CChatData::ViewData::ViewData():
                  height(0)
                {}
 
-VOID CChatData::SetChat(NicoLiveChat &chat_in){
+VOID CChatData::SetChat(NicoLiveChat &chat_in,ListenerData &listener){
        
        
        this->anonymity = _ttol(chat_in.anonymity);
@@ -73,7 +74,9 @@ VOID CChatData::SetChat(NicoLiveChat &chat_in){
 
        this->name = chat_in.name;
 
-       this->listenerData = &listenerList.Register(chat_in.user_id);
+
+       
+       this->listenerData = &listenerList.Register(listener);
 
        
        this->vpos = _ttol(chat_in.vpos);
@@ -145,10 +148,14 @@ INT_PTR CCommentList::GetCurSelNo(){
 }
 
 
-CCommentList::iterator CCommentList::OnChatReceve(NicoLiveChat_P chatData_in, UINT_PTR commnetCountSum,CCommentListWindow &listWindow){
+CCommentList::iterator CCommentList::OnChatReceve(NicoLiveChat_P chatData_in,LPCTSTR communityID, UINT_PTR commnetCountSum,CCommentListWindow &listWindow){
 
        CChatData chatData;
-       chatData.SetChat(*chatData_in);
+       ListenerData listenerData;
+       listenerData.user_id = chatData_in->user_id;
+       listenerData.time = time(NULL);
+       listenerData.community = communityID;
+       chatData.SetChat(*chatData_in,listenerData);
        iterator rslt;
        if(empty() == TRUE || back().date <= chatData.date){
                chatList.push_back(chatData);
@@ -282,9 +289,9 @@ VOID CListenerList::BkColorCollect(CListenerColorCollector &target){
        std::for_each(m_listenerList.begin(), end,target);
 }
 
-CListenerList::reference CListenerList::Register(LPCTSTR user_id){
+CListenerList::reference CListenerList::Register(ListenerData &listener){
 
-       ListenerPre listenerPre(user_id);
+       ListenerPre listenerPre(listener);
 
        iterator begin = m_listenerList.begin();
        iterator end = m_listenerList.end();
@@ -295,10 +302,8 @@ CListenerList::reference CListenerList::Register(LPCTSTR user_id){
 
        if(rslt == end){
 
-               ListenerData insertData;
-               insertData.user_id = user_id;
-               insertData.time = time(NULL);
-               m_listenerList.push_back(insertData);
+               
+               m_listenerList.push_back(listener);
 
                return m_listenerList.back();
 
index 2a17af5..a05a2ca 100644 (file)
@@ -27,8 +27,13 @@ namespace nlite{
                CNLiteString community;                                 //\93o\98^\82µ\82½\83R\83~\83\85\83j\83e\83B
                COLORREF bgcolor;                                               //\94w\8ci\90F
                time_t time;                                                    //\93o\98^\8e\9e\8aÔ
-               BOOL originBkFlag;                                              //\94w\8ci\90F\90Ý\92è\83t\83\89\83O
+//             BOOL originBkFlag;                                              //\94w\8ci\90F\90Ý\92è\83t\83\89\83O
        public:
+
+               enum {
+                       INIT_COLOR = -1
+
+               };
                
                ///
                ///\83R\83\93\83X\83g\83\89\83N\83^
@@ -65,7 +70,7 @@ namespace nlite{
                //\83t\83@\83\93\83N\83V\83\87\83i\83\8b
                void operator()(ListenerData &target){
 
-                       if(target.originBkFlag == TRUE){
+                       if(target.bgcolor != ListenerData::INIT_COLOR){
 
                                colorlist.push_back(target.bgcolor);
                        }
@@ -96,7 +101,7 @@ namespace nlite{
                ///
                ///\83\86\81[\83U\81[\93o\98^
                ///
-               reference Register(LPCTSTR user_id);
+               reference Register(ListenerData &listener);
 
                ///
                ///\94w\8ci\90F\82ð\8eû\8fW\82·\82é
@@ -146,7 +151,7 @@ namespace nlite{
                ///
                ///nlib\82Ì\83`\83\83\83b\83g\83f\81[\83^\82ð\83Z\83b\83g
                ///
-               VOID SetChat(NicoLiveChat &chat_in);
+               VOID SetChat(NicoLiveChat &chat_in,ListenerData &listener);
 
        };
 
@@ -259,7 +264,7 @@ namespace nlite{
                ///\83\8a\83X\83g\82ª\8bó\82©\81A\8eó\90M\82µ\82½\83`\83\83\83b\83g\83f\81[\83^\82Ìdate\82Ì\92l\82ª\83\8a\83X\83g\8dÅ\8cã\94ö\88È\8fã\82Ì\82à\82Ì\82¾\82Á\82½\8fê\8d\87\8dÅ\8cã\94ö\82É\91}\93ü\82³\82ê\82é
                ///\82»\82¤\82Å\82È\82©\82Á\82½\8fê\8d\87\82Í\83\8a\83X\83g\82Ì\8dÅ\8f\89\82©\82ç\88ø\90\94\82É\93n\82³\82ê\82½\83`\83\83\83b\83g\83f\81[\83^\82Ìdate\82æ\82è\91å\82«\82¢date\82ð\8e\9d\82Â\83f\81[\83^\82ð\92T\82µ\81A\82»\82Ì\83f\81[\83^\82Ì\92¼\91O\82É\91}\93ü\82·\82é
                ///
-               iterator OnChatReceve(NicoLiveChat_P chatData, UINT_PTR count,CCommentListWindow &listWindow);
+               iterator OnChatReceve(NicoLiveChat_P chatData,LPCTSTR communityID, UINT_PTR count,CCommentListWindow &listWindow);
 
                ///
                ///\8ew\92è\82µ\82½\94Ô\8d\86\82Ì\83R\83\81\83\93\83g\8eQ\8fÆ\82ð\8eæ\93¾
index 2785a8a..120fa6a 100644 (file)
@@ -173,7 +173,7 @@ namespace nlite{
                        
                                bkColor = comment.viewData.backColor;
 
-                       }else if(comment.listenerData->originBkFlag == TRUE){
+                       }else if(comment.listenerData->bgcolor != ListenerData::INIT_COLOR){
 
                                bkColor = comment.listenerData->bgcolor;
 
@@ -513,7 +513,7 @@ namespace nlite{
        VOID CCommentView::OnChatReceve(NicoLiveChat_P chat,UINT_PTR commnetCountSum){
 
 
-               commentlist.OnChatReceve(chat,commnetCountSum,this->m_commentListWindow);
+               commentlist.OnChatReceve(chat,stream.GetDefaultCommunity(),commnetCountSum,this->m_commentListWindow);
 
                return;
        }
@@ -1208,13 +1208,13 @@ overclientrect:
 
                        
 
-                       if(chatData.viewData.backColor != CChatData::ViewData::INIT_COLOR || chatData.listenerData->originBkFlag == TRUE){
+                       if(chatData.viewData.backColor != CChatData::ViewData::INIT_COLOR || chatData.listenerData->bgcolor != ListenerData::INIT_COLOR){
                        
                                if(chatData.viewData.backColor != CChatData::ViewData::INIT_COLOR){
                                        bkColor = chatData.viewData.backColor;
                                        originBkBrush.CreateSolidBrush(chatData.viewData.backColor);
                                
-                               }else if(chatData.listenerData->originBkFlag == TRUE){
+                               }else if(chatData.listenerData->bgcolor != ListenerData::INIT_COLOR){
 
                                        bkColor = chatData.listenerData->bgcolor;
                                        originBkBrush.CreateSolidBrush(chatData.listenerData->bgcolor);
@@ -1457,7 +1457,7 @@ end:
                
                
                        COLORREF bkColor;
-                       if(lineIte->listenerData->originBkFlag == FALSE){
+                       if(lineIte->listenerData->bgcolor == ListenerData::INIT_COLOR){
                                CListenerColorCollector colorCollector;
                                listenerList.BkColorCollect(colorCollector);
                                UCHAR red;
@@ -1474,12 +1474,12 @@ end:
 
                                }while(colorCollector.Find(bkColor));
 
-                               lineIte->listenerData->originBkFlag = TRUE;
+                               
                                lineIte->listenerData->SetBkColor(bkColor);
                        } else {
 
 
-                               lineIte->listenerData->originBkFlag = FALSE;
+                               lineIte->listenerData->bgcolor = ListenerData::INIT_COLOR;
                        }
                }
 
index 9bf41c6..aefe704 100644 (file)
@@ -184,17 +184,23 @@ namespace nlite{
                ::GetPrivateProfileString(sectionName,keyName,TEXT(""),propertyBuf,ARRAY_LENGTH(propertyBuf),iniFile);
 
                if((_tcslen(propertyBuf) == 0) || !((PathFileExists(propertyBuf) &&  !::PathIsDirectory( propertyBuf )))){
-                       propertyPath = appLocalPath;
-                       propertyPath += TEXT("\\qwerty_nico\\nlite\\property.xml");
-
-                       ::WritePrivateProfileString(sectionName,keyName,propertyPath,iniFile);
+                       
+                       propertyFolderPath = appLocalPath;
+                       propertyFolderPath += TEXT("\\qwerty_nico\\nlite");
+                       
+                       ::WritePrivateProfileString(sectionName,keyName,propertyFolderPath,iniFile);
                } else {
-                       propertyPath = propertyBuf;
+                       propertyFolderPath = propertyBuf;
 
                }
 
+               propertyPath = propertyFolderPath;
+               propertyPath += TEXT("\\property.xml");
+               userSettingPath = propertyFolderPath;
+               userSettingPath += TEXT("\\user_setting.xml");
+               SurelyCreate(propertyFolderPath,FALSE);
                SurelyCreate(propertyPath,TRUE);
-
+               SurelyCreate(userSettingPath,TRUE);
                
                return;
        }
index 048d462..f2ee46c 100644 (file)
@@ -126,8 +126,9 @@ namespace nlite{
                GeneralProperty gp;                                                     //\8b¤\97L\83v\83\8d\83p\83e\83B
                CommentReadProperty crp;                                        //\83R\83\81\83\93\83g\93Ç\82Ý\8fã\82°\83v\83\8d\83p\83e\83B
                CNLiteString appLocalPath;                                      //\83\8d\81[\83J\83\8b\83t\83H\83\8b\83_\83p\83X
-               CNLiteString propertyPath;                                      //\83v\83\8d\83p\83e\83B\94z\92u\83t\83H\83\8b\83_\83p\83X
-
+               CNLiteString propertyFolderPath;                        //\83v\83\8d\83p\83e\83B\94z\92u\83t\83H\83\8b\83_
+               CNLiteString propertyPath;                                      //\83v\83\8d\83p\83e\83B\83t\83@\83C\83\8b\83p\83X
+               CNLiteString userSettingPath;                           //\83\8a\83X\83i\81[\8fî\95ñ\90Ý\92è\83t\83@\83C\83\8b\83p\83X
                Property();
 
                ~Property();