Update of /cvsroot/mahogany/M/src/gui
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8632/src/gui

Modified Files:
        wxBrowseButton.cpp wxComposeView.cpp wxFolderTree.cpp 
        wxFolderView.cpp wxSpamOptions.cpp 
Log Message:
removed the miscutil files; use the new ColourNames.h for the only useful functions 
which remained there

Index: wxBrowseButton.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxBrowseButton.cpp,v
retrieving revision 1.38
retrieving revision 1.39
diff -b -u -2 -r1.38 -r1.39
--- wxBrowseButton.cpp  10 Jan 2004 18:49:23 -0000      1.38
+++ wxBrowseButton.cpp  14 Mar 2004 22:51:36 -0000      1.39
@@ -42,8 +42,7 @@
 
 #include "gui/wxDialogLayout.h"
-
 #include "gui/wxBrowseButton.h"
 
-#include "miscutil.h" // for ParseColorString and GetColorName
+#include "ColourNames.h"
 
 // ----------------------------------------------------------------------------

Index: wxComposeView.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxComposeView.cpp,v
retrieving revision 1.358
retrieving revision 1.359
diff -b -u -2 -r1.358 -r1.359
--- wxComposeView.cpp   10 Jan 2004 18:49:23 -0000      1.358
+++ wxComposeView.cpp   14 Mar 2004 22:51:36 -0000      1.359
@@ -96,4 +96,5 @@
 #include "Message.h"
 #include "Collect.h"
+#include "ColourNames.h"
 
 #include "modules/Calendar.h"
@@ -800,6 +801,6 @@
 
    // colours
-   GetColourByName(&m_fg, READ_CONFIG(profile, MP_CVIEW_FGCOLOUR), _T("black"));
-   GetColourByName(&m_bg, READ_CONFIG(profile, MP_CVIEW_BGCOLOUR), _T("white"));
+   ReadColour(&m_fg, profile, MP_CVIEW_FGCOLOUR);
+   ReadColour(&m_bg, profile, MP_CVIEW_BGCOLOUR);
 
    // font

Index: wxFolderTree.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxFolderTree.cpp,v
retrieving revision 1.228
retrieving revision 1.229
diff -b -u -2 -r1.228 -r1.229
--- wxFolderTree.cpp    13 Mar 2004 18:58:39 -0000      1.228
+++ wxFolderTree.cpp    14 Mar 2004 22:51:37 -0000      1.229
@@ -41,5 +41,5 @@
 #include "FolderView.h"
 
-#include "miscutil.h" // for ParseColourString()
+#include "ColourNames.h"               // for ParseColourString()
 
 #include <wx/tokenzr.h>

Index: wxFolderView.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxFolderView.cpp,v
retrieving revision 1.651
retrieving revision 1.652
diff -b -u -2 -r1.651 -r1.652
--- wxFolderView.cpp    26 Dec 2003 00:32:21 -0000      1.651
+++ wxFolderView.cpp    14 Mar 2004 22:51:37 -0000      1.652
@@ -98,4 +98,6 @@
 #include "MDialogs.h"
 
+#include "ColourNames.h"
+
 // use XPMs under MSW as well as it's the simplest way to have transparent
 // bitmaps like we need here
@@ -3598,25 +3600,11 @@
    settings->dateGMT = READ_CONFIG_BOOL(profile, MP_DATE_GMT);
 
-   GetColourByName(&settings->FgCol,
-                   READ_CONFIG(profile, MP_FVIEW_FGCOLOUR),
-                   GetStringDefault(MP_FVIEW_FGCOLOUR));
-   GetColourByName(&settings->BgCol,
-                   READ_CONFIG(profile, MP_FVIEW_BGCOLOUR),
-                   GetStringDefault(MP_FVIEW_BGCOLOUR));
-   GetColourByName(&settings->FlaggedCol,
-                   READ_CONFIG(profile, MP_FVIEW_FLAGGEDCOLOUR),
-                   GetStringDefault(MP_FVIEW_FLAGGEDCOLOUR));
-   GetColourByName(&settings->NewCol,
-                   READ_CONFIG(profile, MP_FVIEW_NEWCOLOUR),
-                   GetStringDefault(MP_FVIEW_NEWCOLOUR));
-   GetColourByName(&settings->RecentCol,
-                   READ_CONFIG(profile, MP_FVIEW_RECENTCOLOUR),
-                   GetStringDefault(MP_FVIEW_RECENTCOLOUR));
-   GetColourByName(&settings->DeletedCol,
-                   READ_CONFIG(profile, MP_FVIEW_DELETEDCOLOUR),
-                   GetStringDefault(MP_FVIEW_DELETEDCOLOUR));
-   GetColourByName(&settings->UnreadCol,
-                   READ_CONFIG(profile, MP_FVIEW_UNREADCOLOUR),
-                   GetStringDefault(MP_FVIEW_UNREADCOLOUR));
+   ReadColour(&settings->FgCol, profile, MP_FVIEW_FGCOLOUR);
+   ReadColour(&settings->BgCol, profile, MP_FVIEW_BGCOLOUR);
+   ReadColour(&settings->FlaggedCol, profile, MP_FVIEW_FLAGGEDCOLOUR);
+   ReadColour(&settings->NewCol, profile, MP_FVIEW_NEWCOLOUR);
+   ReadColour(&settings->RecentCol, profile, MP_FVIEW_RECENTCOLOUR);
+   ReadColour(&settings->DeletedCol, profile, MP_FVIEW_DELETEDCOLOUR);
+   ReadColour(&settings->UnreadCol, profile, MP_FVIEW_UNREADCOLOUR);
 
    settings->font = READ_CONFIG_TEXT(profile, MP_FVIEW_FONT_DESC);

Index: wxSpamOptions.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxSpamOptions.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -b -u -2 -r1.11 -r1.12
--- wxSpamOptions.cpp   12 Oct 2003 13:14:48 -0000      1.11
+++ wxSpamOptions.cpp   14 Mar 2004 22:51:37 -0000      1.12
@@ -43,4 +43,53 @@
 DECLARE_REF_COUNTER(Profile)
 
+/**
+   A fixed-size array.
+ */
+class BoundArrayCommon
+{
+public:
+   BoundArrayCommon() : m_size(0) {}
+
+   size_t Size() const { return m_size; }
+
+protected:
+   size_t m_size;
+};
+
+#define BOUND_ARRAY(type,name) \
+   class name : public BoundArrayCommon \
+   { \
+   public: \
+      typedef type HostType; \
+   \
+      name() : m_array(NULL) {} \
+      ~name() { Destroy(); } \
+   \
+      void Initialize(size_t count); \
+      type *Get() { return m_array; } \
+      type& At(size_t offset); \
+      type& operator[](size_t offset) { return At(offset); } \
+   \
+   private: \
+      void Destroy(); \
+   \
+      type *m_array; \
+   }
+
+#define IMPLEMENT_BOUND_ARRAY(name) \
+   void name::Destroy() { delete[] m_array; } \
+   \
+   void name::Initialize(size_t count) \
+   { \
+      ASSERT( !m_array ); \
+      m_array = new name::HostType[m_size = count]; \
+   } \
+   \
+   name::HostType& name::At(size_t offset) \
+   { \
+      ASSERT( offset < m_size ); \
+      return m_array[offset]; \
+   }
+
 class SpamOption
 {



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to