diff --git a/application/AboutWindow.cpp b/application/AboutWindow.cpp index 70adaa2..631016b 100644 --- a/application/AboutWindow.cpp +++ b/application/AboutWindow.cpp @@ -17,7 +17,7 @@ AboutWindow::AboutWindow(const char* appName, const char** holders, - const char** authors, const char* extraInfo) + const char** authors, const char* extraInfo) { fAppName = new BString(appName); diff --git a/application/AboutWindow.h b/application/AboutWindow.h index 2d57b24..8f4c380 100644 --- a/application/AboutWindow.h +++ b/application/AboutWindow.h @@ -11,7 +11,7 @@ class AboutWindow { public: AboutWindow(const char* appName, const char** holders, - const char** authors, const char* extraInfo = NULL); + const char** authors, const char* extraInfo = NULL); virtual ~AboutWindow(); void Show(); diff --git a/application/Account.cpp b/application/Account.cpp index 75d74b3..81a4c7a 100644 --- a/application/Account.cpp +++ b/application/Account.cpp @@ -17,8 +17,9 @@ Account::Account(bigtime_t instanceId, CayaProtocol* cayap, - const char* name, BHandler* target) - : fIdentifier(instanceId), + const char* name, BHandler* target) + : + fIdentifier(instanceId), fName(name), fProtocol(cayap), fMessenger(target), @@ -59,9 +60,9 @@ Account::Name() const } -status_t +status_t Account::SendMessage(BMessage* message) { message->AddInt64("instance", fIdentifier); - return fMessenger.SendMessage(message); + return fMessenger.SendMessage(message); } diff --git a/application/AccountManager.cpp b/application/AccountManager.cpp index ec38cd8..94a5c0e 100644 --- a/application/AccountManager.cpp +++ b/application/AccountManager.cpp @@ -17,7 +17,8 @@ static AccountManager* fInstance = NULL; AccountManager::AccountManager() - : fStatus(CAYA_OFFLINE) + : + fStatus(CAYA_OFFLINE) { TheApp* theApp = reinterpret_cast(be_app); RegisterObserver(theApp->GetMainWindow()); diff --git a/application/CayaProtocolAddOn.cpp b/application/CayaProtocolAddOn.cpp index 3e08b61..0a46d52 100644 --- a/application/CayaProtocolAddOn.cpp +++ b/application/CayaProtocolAddOn.cpp @@ -16,7 +16,8 @@ CayaProtocolAddOn::CayaProtocolAddOn(image_id image, const char* path) - : fImage(image), + : + fImage(image), fPath(path), fIcon(NULL) { diff --git a/application/ChatWindow.cpp b/application/ChatWindow.cpp index 498e244..924751b 100644 --- a/application/ChatWindow.cpp +++ b/application/ChatWindow.cpp @@ -33,7 +33,8 @@ ChatWindow::ChatWindow(ContactLinker* cl) - : BWindow(BRect(200, 200, 500, 500), + : + BWindow(BRect(200, 200, 500, 500), cl->GetName().String(), B_DOCUMENT_WINDOW, 0), fContactLinker(cl) { @@ -77,7 +78,7 @@ ChatWindow::QuitRequested() void ChatWindow::MessageReceived(BMessage* message) { - switch(message->what) { + switch (message->what) { case CAYA_CHAT: { BString message = fSendView->Text(); @@ -122,10 +123,10 @@ ChatWindow::ImMessage(BMessage* msg) } -void +void ChatWindow::ObserveString(int32 what, BString str) { - switch(what) { + switch (what) { case STR_CONTACT_NAME: if (Lock()){ SetTitle(str); @@ -139,7 +140,7 @@ ChatWindow::ObserveString(int32 what, BString str) } -void +void ChatWindow::ObservePointer(int32 what, void* ptr) { switch (what) { @@ -149,7 +150,7 @@ ChatWindow::ObservePointer(int32 what, void* ptr) } -void +void ChatWindow::ObserveInteger(int32 what, int32 val) { switch (what) { @@ -168,25 +169,25 @@ ChatWindow::AppendStatus(CayaStatus status) { BString message(fContactLinker->GetName()); - switch (status) { + switch (status) { case CAYA_ONLINE: message << " is available"; - break; - case CAYA_EXTENDED_AWAY: - case CAYA_AWAY: + break; + case CAYA_EXTENDED_AWAY: + case CAYA_AWAY: message << " is away"; - break; - case CAYA_DO_NOT_DISTURB: + break; + case CAYA_DO_NOT_DISTURB: message << " is busy, please do not disturb!"; - break; - case CAYA_OFFLINE: + break; + case CAYA_OFFLINE: message << " is offline"; - break; + break; default: - break; + break; } - fReceiveView->Append(message.String(), COL_TEXT, COL_TEXT, R_TEXT); + fReceiveView->Append(message.String(), COL_TEXT, COL_TEXT, R_TEXT); fReceiveView->Append("\n", COL_TEXT, COL_TEXT, R_TEXT); fReceiveView->ScrollToSelection(); } diff --git a/application/ContactLinker.cpp b/application/ContactLinker.cpp index ce7a25d..8a5d121 100644 --- a/application/ContactLinker.cpp +++ b/application/ContactLinker.cpp @@ -20,7 +20,8 @@ #include "CayaPreferences.h" ContactLinker::ContactLinker(BString id, BMessenger msgn) - : fChatWindow(NULL), + : + fChatWindow(NULL), fID(id), fName(id), fMessenger(msgn), diff --git a/application/EditingFilter.cpp b/application/EditingFilter.cpp index aa14238..23f333b 100644 --- a/application/EditingFilter.cpp +++ b/application/EditingFilter.cpp @@ -15,7 +15,8 @@ EditingFilter::EditingFilter(BTextView* view) - : BMessageFilter(B_ANY_DELIVERY, B_ANY_SOURCE, B_KEY_DOWN, NULL), + : + BMessageFilter(B_ANY_DELIVERY, B_ANY_SOURCE, B_KEY_DOWN, NULL), _view(view) { } diff --git a/application/ImageCache.cpp b/application/ImageCache.cpp index 371c980..da030ea 100644 --- a/application/ImageCache.cpp +++ b/application/ImageCache.cpp @@ -23,8 +23,8 @@ ImageCache::ImageCache() ImageCache::~ImageCache() { - while(m_bitmaps.CountItems()) { - BBitmap* bit=m_bitmaps.ValueFor(0); + while (m_bitmaps.CountItems()) { + BBitmap* bit = m_bitmaps.ValueFor(0); delete bit; } } diff --git a/application/Main.cpp b/application/Main.cpp index 0b72571..a44d3f3 100644 --- a/application/Main.cpp +++ b/application/Main.cpp @@ -8,6 +8,7 @@ #include "TheApp.h" + int main(int argc, char* argv[]) { diff --git a/application/MainWindow.cpp b/application/MainWindow.cpp index 37077a7..ca520d0 100644 --- a/application/MainWindow.cpp +++ b/application/MainWindow.cpp @@ -44,14 +44,15 @@ #include "Server.h" #include "StatusView.h" -const uint32 kLogin = 'LOGI'; +const uint32 kLogin = 'LOGI'; const uint32 kSearchContact = 'SRCH'; -const uint32 kPreferences = 'WPRF'; +const uint32 kPreferences = 'WPRF'; MainWindow::MainWindow() - : BWindow(BRect(0, 0, 300, 400), "Caya", B_DOCUMENT_WINDOW, 0) + : + BWindow(BRect(0, 0, 300, 400), "Caya", B_DOCUMENT_WINDOW, 0) { fStatusView = new StatusView("statusView"); @@ -184,7 +185,7 @@ MainWindow::MessageReceived(BMessage* message) void MainWindow::ImError(BMessage* msg) { - //FIXME: better error handling.. + // FIXME: better error handling.. BAlert* alert = new BAlert("Error", msg->FindString("error"), "Ouch!"); alert->Go(); } diff --git a/application/Notifier.cpp b/application/Notifier.cpp index 2e50ac5..d80a51c 100644 --- a/application/Notifier.cpp +++ b/application/Notifier.cpp @@ -26,7 +26,7 @@ Notifier::UnregisterObserver(Observer* obs) } -void +void Notifier::NotifyString(int32 what, BString str) { for (int i = 0; i < fObserverList.CountItems(); i++) @@ -34,14 +34,15 @@ Notifier::NotifyString(int32 what, BString str) } -void +void Notifier::NotifyInteger(int32 what, int32 value) { for (int i = 0; i < fObserverList.CountItems(); i++) fObserverList.ItemAt(i)->ObserveInteger(what, value); } -void + +void Notifier::NotifyPointer(int32 what, void* ptr) { for (int i = 0; i < fObserverList.CountItems(); i++) diff --git a/application/ProtocolLooper.cpp b/application/ProtocolLooper.cpp index 762a174..86fa9f0 100644 --- a/application/ProtocolLooper.cpp +++ b/application/ProtocolLooper.cpp @@ -15,7 +15,8 @@ ProtocolLooper::ProtocolLooper(CayaProtocol* protocol) - : BLooper(), + : + BLooper(), fProtocol(protocol) { Account* account = reinterpret_cast( diff --git a/application/ProtocolSettings.cpp b/application/ProtocolSettings.cpp index 9893923..7ca0265 100644 --- a/application/ProtocolSettings.cpp +++ b/application/ProtocolSettings.cpp @@ -43,7 +43,8 @@ const float kDividerWidth = 1.0f; ProtocolSettings::ProtocolSettings(CayaProtocolAddOn* addOn) - : fAddOn(addOn), + : + fAddOn(addOn), fTemplate(new BMessage()) { _Init(); @@ -149,9 +150,10 @@ ProtocolSettings::Load(const char* account, BView* parent) freeText = false; menu = new BPopUpMenu(name); - for (int j = 0; curr.FindString("valid_value", j); j++) { + for (int j = 0; curr.FindString("valid_value", j); j++) { BMenuItem* item - = new BMenuItem(curr.FindString("valid_value", j), NULL); + = new BMenuItem(curr.FindString("valid_value", j), + NULL); menu->AddItem(item); } @@ -246,11 +248,14 @@ ProtocolSettings::Load(const char* account, BView* parent) control = new BTextControl(name, _T(desc), value, NULL); if (secret) { dynamic_cast(control)->TextView()->HideTyping(true); - dynamic_cast(control)->SetText(_T(value)); + dynamic_cast(control)->SetText( + _T(value)); } - dynamic_cast(control)->SetDivider(kDividerWidth); + dynamic_cast(control)->SetDivider( + kDividerWidth); } else { - BStringView* label = new BStringView("NA", _T(desc), B_WILL_DRAW); + BStringView* label = new BStringView("NA", _T(desc), + B_WILL_DRAW); layout.Add(label); NotifyingTextView* textView diff --git a/application/Server.cpp b/application/Server.cpp index 4db2c2f..5279742 100644 --- a/application/Server.cpp +++ b/application/Server.cpp @@ -28,12 +28,13 @@ Server::Server() - : BMessageFilter(B_ANY_DELIVERY, B_ANY_SOURCE) + : + BMessageFilter(B_ANY_DELIVERY, B_ANY_SOURCE) { } -void +void Server::Quit() { ContactLinker* linker = NULL; @@ -74,15 +75,6 @@ Server::LoginAll() } -#if 0 -void -Server::UpdateSettings(BMessage settings) -{ - fProtocol->Protocol()->UpdateSettings(settings); -} -#endif - - void Server::SendProtocolMessage(BMessage* msg) { @@ -123,7 +115,7 @@ Server::Filter(BMessage* message, BHandler **target) { filter_result result = B_DISPATCH_MESSAGE; - switch(message->what) { + switch (message->what) { case IM_MESSAGE_RECEIVED: { BString id = message->FindString("id"); @@ -249,8 +241,9 @@ Server::ImMessage(BMessage* msg) entry_ref ref; if (linker) { if (msg->FindRef("ref", &ref) == B_OK) { - //BPath fullPath(&ref); - //BBitmap *bitmap = ImageCache::GetImage(BString(fullPath.Path()), BString(fullPath.Path())); + // BPath fullPath(&ref); + // BBitmap* bitmap = ImageCache::GetImage( + // BString(fullPath.Path()), BString(fullPath.Path())); BBitmap *bitmap = BTranslationUtils::GetBitmap(&ref); linker->SetNotifyAvatarBitmap(bitmap); } else diff --git a/application/TheApp.cpp b/application/TheApp.cpp index 5d24a64..45154c0 100644 --- a/application/TheApp.cpp +++ b/application/TheApp.cpp @@ -27,7 +27,8 @@ TheApp::TheApp() - : BApplication(CAYA_SIGNATURE), + : + BApplication(CAYA_SIGNATURE), fMainWin(NULL) { } diff --git a/application/WindowsManager.cpp b/application/WindowsManager.cpp index 68f2add..95364fc 100644 --- a/application/WindowsManager.cpp +++ b/application/WindowsManager.cpp @@ -10,6 +10,7 @@ WindowsManager* WindowsManager::fInstance = NULL; + WindowsManager::WindowsManager() { fCurrentPoint.Set(40.0f, 40.0f);