From a0bf29354d69ce5e62c6cc258632e4602434c54d Mon Sep 17 00:00:00 2001 From: Matthew Wilber Date: Thu, 12 Dec 2002 03:53:49 +0000 Subject: [PATCH] added a few comments git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2231 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../tgatranslator/StreamBuffer.cpp | 6 +++- .../translators/tgatranslator/StreamBuffer.h | 6 +++- .../translators/tgatranslator/TGAMain.cpp | 2 +- .../tgatranslator/TGATranslator.cpp | 2 ++ .../translators/tgatranslator/TGATranslator.h | 2 ++ .../tgatranslator/TGATranslatorSettings.h | 21 ++++++++++++- .../translators/tgatranslator/TGAView.cpp | 30 ++++++++++++++++++- .../translators/tgatranslator/TGAView.h | 4 +++ .../translators/tgatranslator/TGAWindow.cpp | 2 ++ .../translators/tgatranslator/TGAWindow.h | 2 ++ 10 files changed, 72 insertions(+), 5 deletions(-) diff --git a/src/add-ons/translators/tgatranslator/StreamBuffer.cpp b/src/add-ons/translators/tgatranslator/StreamBuffer.cpp index 7468c8c9d5..62150a1088 100644 --- a/src/add-ons/translators/tgatranslator/StreamBuffer.cpp +++ b/src/add-ons/translators/tgatranslator/StreamBuffer.cpp @@ -1,8 +1,12 @@ /*****************************************************************************/ // StreamBuffer +// Written by Michael Wilber, OBOS Translation Kit Team +// // StreamBuffer.cpp // -// The description goes here. +// This class is for buffering data from a BPositionIO object in order to +// improve performance for cases when small amounts of data are frequently +// read from a BPositionIO object. // // // Copyright (c) 2002 OpenBeOS Project diff --git a/src/add-ons/translators/tgatranslator/StreamBuffer.h b/src/add-ons/translators/tgatranslator/StreamBuffer.h index 2193344cf3..4e39106e9b 100644 --- a/src/add-ons/translators/tgatranslator/StreamBuffer.h +++ b/src/add-ons/translators/tgatranslator/StreamBuffer.h @@ -1,8 +1,12 @@ /*****************************************************************************/ // StreamBuffer +// Written by Michael Wilber, OBOS Translation Kit Team +// // StreamBuffer.h // -// The description goes here. +// This class is for buffering data from a BPositionIO object in order to +// improve performance for cases when small amounts of data are frequently +// read from a BPositionIO object. // // // Copyright (c) 2002 OpenBeOS Project diff --git a/src/add-ons/translators/tgatranslator/TGAMain.cpp b/src/add-ons/translators/tgatranslator/TGAMain.cpp index 31829d11dd..c664a5e2f7 100644 --- a/src/add-ons/translators/tgatranslator/TGAMain.cpp +++ b/src/add-ons/translators/tgatranslator/TGAMain.cpp @@ -1,6 +1,6 @@ /*****************************************************************************/ // TGATranslator -// +// Written by Michael Wilber, OBOS Translation Kit Team // Version: 1.0.0 Beta // // This translator opens and writes TGA files. diff --git a/src/add-ons/translators/tgatranslator/TGATranslator.cpp b/src/add-ons/translators/tgatranslator/TGATranslator.cpp index 105b6c3bf0..8f21cdb225 100644 --- a/src/add-ons/translators/tgatranslator/TGATranslator.cpp +++ b/src/add-ons/translators/tgatranslator/TGATranslator.cpp @@ -1,5 +1,7 @@ /*****************************************************************************/ // TGATranslator +// Written by Michael Wilber, OBOS Translation Kit Team +// // TGATranslator.cpp // // This BTranslator based object is for opening and writing TGA files. diff --git a/src/add-ons/translators/tgatranslator/TGATranslator.h b/src/add-ons/translators/tgatranslator/TGATranslator.h index 121c5b9a40..0f7155802a 100644 --- a/src/add-ons/translators/tgatranslator/TGATranslator.h +++ b/src/add-ons/translators/tgatranslator/TGATranslator.h @@ -1,5 +1,7 @@ /*****************************************************************************/ // TGATranslator +// Written by Michael Wilber, OBOS Translation Kit Team +// // TGATranslator.h // // This BTranslator based object is for opening and writing TGA files. diff --git a/src/add-ons/translators/tgatranslator/TGATranslatorSettings.h b/src/add-ons/translators/tgatranslator/TGATranslatorSettings.h index 9f76022639..59f4878f0d 100644 --- a/src/add-ons/translators/tgatranslator/TGATranslatorSettings.h +++ b/src/add-ons/translators/tgatranslator/TGATranslatorSettings.h @@ -1,8 +1,11 @@ /*****************************************************************************/ // TGATranslatorSettings +// Written by Michael Wilber, OBOS Translation Kit Team +// // TGATranslatorSettings.h // -// The description goes here. +// This class manages (saves/loads/locks/unlocks) the settings +// for the TGATranslator. // // // Copyright (c) 2002 OpenBeOS Project @@ -43,7 +46,12 @@ public: TGATranslatorSettings(); TGATranslatorSettings *Acquire(); + // increments the reference count, returns this TGATranslatorSettings *Release(); + // decrements the reference count, deletes this + // when count reaches zero, returns this when + // ref count is greater than zero, NULL when + // ref count is zero status_t LoadSettings(); status_t LoadSettings(BMessage *pmsg); @@ -51,8 +59,17 @@ public: status_t GetConfigurationMessage(BMessage *pmsg); bool SetGetHeaderOnly(bool *pbHeaderOnly = NULL); + // sets / gets HeaderOnly setting + // specifies if only the image header should be + // outputted bool SetGetDataOnly(bool *pbDataOnly = NULL); + // sets / gets DataOnly setting + // specifiees if only the image data should be + // outputted bool SetGetRLE(bool *pbRLE = NULL); + // sets /gets RLE setting + // specifies if RLE compression will be used + // when the TGATranslator creates TGA images private: ~TGATranslatorSettings(); @@ -62,6 +79,8 @@ private: BLocker flock; int32 frefCount; BPath fsettingsPath; + // where the settings file will be loaded from / + // saved to BMessage fmsgSettings; // the actual settings diff --git a/src/add-ons/translators/tgatranslator/TGAView.cpp b/src/add-ons/translators/tgatranslator/TGAView.cpp index 31cb2e099b..e9b087a556 100644 --- a/src/add-ons/translators/tgatranslator/TGAView.cpp +++ b/src/add-ons/translators/tgatranslator/TGAView.cpp @@ -1,5 +1,7 @@ /*****************************************************************************/ // TGAView +// Written by Michael Wilber, OBOS Translation Kit Team +// // TGAView.cpp // // This BView based object displays information about the TGATranslator. @@ -83,6 +85,19 @@ TGAView::~TGAView() fpsettings->Release(); } +// --------------------------------------------------------------- +// AllAttached +// +// +// +// Preconditions: +// +// Parameters: +// +// Postconditions: +// +// Returns: +// --------------------------------------------------------------- void TGAView::AllAttached() { @@ -90,6 +105,19 @@ TGAView::AllAttached() fpchkRLE->SetTarget(msgr); } +// --------------------------------------------------------------- +// MessageReceived +// +// Handles state changes of the RLE setting checkbox +// +// Preconditions: +// +// Parameters: message the actual BMessage that was received +// +// Postconditions: +// +// Returns: +// --------------------------------------------------------------- void TGAView::MessageReceived(BMessage *message) { @@ -147,4 +175,4 @@ TGAView::Draw(BRect area) */ char writtenby[] = "Written by the OBOS Translation Kit Team"; DrawString(writtenby, BPoint(xbold, yplain * 7 + ybold)); -} \ No newline at end of file +} diff --git a/src/add-ons/translators/tgatranslator/TGAView.h b/src/add-ons/translators/tgatranslator/TGAView.h index 4972250b78..3a51fd0c6d 100644 --- a/src/add-ons/translators/tgatranslator/TGAView.h +++ b/src/add-ons/translators/tgatranslator/TGAView.h @@ -1,5 +1,7 @@ /*****************************************************************************/ // TGAView +// Written by Michael Wilber, OBOS Translation Kit Team +// // TGAView.h // // This BView based object displays information about the TGATranslator. @@ -53,6 +55,8 @@ private: BCheckBox *fpchkRLE; TGATranslatorSettings *fpsettings; + // the actual settings for the translator, + // shared with the translator }; #endif // #ifndef TGAVIEW_H diff --git a/src/add-ons/translators/tgatranslator/TGAWindow.cpp b/src/add-ons/translators/tgatranslator/TGAWindow.cpp index 82629478b2..063cf91d1b 100644 --- a/src/add-ons/translators/tgatranslator/TGAWindow.cpp +++ b/src/add-ons/translators/tgatranslator/TGAWindow.cpp @@ -1,5 +1,7 @@ /*****************************************************************************/ // TGAWindow +// Written by Michael Wilber, OBOS Translation Kit Team +// // TGAWindow.cpp // // This BWindow based object is used to hold the TGAView object when the diff --git a/src/add-ons/translators/tgatranslator/TGAWindow.h b/src/add-ons/translators/tgatranslator/TGAWindow.h index 5edf3a6b52..802f6f8b4b 100644 --- a/src/add-ons/translators/tgatranslator/TGAWindow.h +++ b/src/add-ons/translators/tgatranslator/TGAWindow.h @@ -1,5 +1,7 @@ /*****************************************************************************/ // TGAWindow +// Written by Michael Wilber, OBOS Translation Kit Team +// // TGAWindow.h // // This BWindow based object is used to hold the TGAView object when the