From dda60bf93afacc987a3a08e1e2fc7aa2a4234546 Mon Sep 17 00:00:00 2001 From: Alex Smith Date: Fri, 7 Dec 2012 11:12:14 +0000 Subject: [PATCH 01/57] Added ftp to x86_64 image. --- build/jam/Haiku64Image | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/jam/Haiku64Image b/build/jam/Haiku64Image index 5dfd762ce2..b7935ac47c 100644 --- a/build/jam/Haiku64Image +++ b/build/jam/Haiku64Image @@ -23,8 +23,8 @@ SYSTEM_BIN = "[" addattr base64 basename bash beep cal cat catattr checkfs chgrp chmod chown chroot cksum clear clockconfig cmp collectcatkeys comm compress copyattr cp csplit cut date dd diff diff3 dircolors dirname df du dumpcatalog echo eject env error expand expr factor false find finddir - fmt fold fortune gawk gdb gzip gzexe getlimits grep groups head hostname id - ifconfig install isvolume join kernel_debugger kill less lessecho + fmt fold fortune ftp gawk gdb gzip gzexe getlimits grep groups head hostname + id ifconfig install isvolume join kernel_debugger kill less lessecho lesskey link linkcatkeys listdev ln locale locate logger logname ls makebootable md5sum mimeset mkdir mkfifo mkfs mktemp mount mountvolume mv nl nohup notify nproc od paste patch pathchk ping pr printenv printf From f2ebf00cc2a6e773e229d20654f8cb9425327c9f Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Thu, 6 Dec 2012 20:31:02 -0500 Subject: [PATCH 02/57] Fix delete vs release issues in BMessageValueNode. --- .../debugger/value/value_nodes/BMessageValueNode.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/apps/debugger/value/value_nodes/BMessageValueNode.cpp b/src/apps/debugger/value/value_nodes/BMessageValueNode.cpp index d53f87093a..816fb8965e 100644 --- a/src/apps/debugger/value/value_nodes/BMessageValueNode.cpp +++ b/src/apps/debugger/value/value_nodes/BMessageValueNode.cpp @@ -183,66 +183,62 @@ BMessageValueNode::ResolvedLocationAndValue(ValueLoader* valueLoader, if (strcmp(member->Name(), "fHeader") == 0) { error = baseType->ResolveDataMemberLocation(member, *location, memberLocation); + BReference locationRef(memberLocation, true); if (error != B_OK) { TRACE_LOCALS( "BMessageValueNode::ResolvedLocationAndValue(): " "failed to resolve location of header member: %s\n", strerror(error)); - delete memberLocation; return error; } error = valueLoader->LoadValue(memberLocation, valueType, false, headerAddress); - delete memberLocation; if (error != B_OK) return error; } else if (strcmp(member->Name(), "what") == 0) { error = baseType->ResolveDataMemberLocation(member, *location, memberLocation); + BReference locationRef(memberLocation, true); if (error != B_OK) { TRACE_LOCALS( "BMessageValueNode::ResolvedLocationAndValue(): " "failed to resolve location of header member: %s\n", strerror(error)); - delete memberLocation; return error; } error = valueLoader->LoadValue(memberLocation, valueType, false, what); - delete memberLocation; if (error != B_OK) return error; } else if (strcmp(member->Name(), "fFields") == 0) { error = baseType->ResolveDataMemberLocation(member, *location, memberLocation); + BReference locationRef(memberLocation, true); if (error != B_OK) { TRACE_LOCALS( "BMessageValueNode::ResolvedLocationAndValue(): " "failed to resolve location of field member: %s\n", strerror(error)); - delete memberLocation; return error; } error = valueLoader->LoadValue(memberLocation, valueType, false, fieldAddress); - delete memberLocation; if (error != B_OK) return error; } else if (strcmp(member->Name(), "fData") == 0) { error = baseType->ResolveDataMemberLocation(member, *location, memberLocation); + BReference locationRef(memberLocation, true); if (error != B_OK) { TRACE_LOCALS( "BMessageValueNode::ResolvedLocationAndValue(): " "failed to resolve location of data member: %s\n", strerror(error)); - delete memberLocation; return error; } error = valueLoader->LoadValue(memberLocation, valueType, false, fDataLocation); - delete memberLocation; if (error != B_OK) return error; } From 093b89ba6e00a18b6b634a354e32820ce5532432 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Fri, 7 Dec 2012 17:34:00 -0500 Subject: [PATCH 03/57] Fix uninitialized variable that could lead to crashes. - Fixes first part of #9273. --- .../debugger/user_interface/gui/team_window/BreakpointsView.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/apps/debugger/user_interface/gui/team_window/BreakpointsView.cpp b/src/apps/debugger/user_interface/gui/team_window/BreakpointsView.cpp index f7e58e2ba1..599113b99e 100644 --- a/src/apps/debugger/user_interface/gui/team_window/BreakpointsView.cpp +++ b/src/apps/debugger/user_interface/gui/team_window/BreakpointsView.cpp @@ -28,6 +28,7 @@ BreakpointsView::BreakpointsView(Team* team, Listener* listener) BGroupView(B_HORIZONTAL, 4.0f), fTeam(team), fBreakpoint(NULL), + fWatchpoint(NULL), fListView(NULL), fToggleBreakpointButton(NULL), fRemoveBreakpointButton(NULL), From e206ff5692fbe64225d6a4a48f1152462788016b Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Fri, 7 Dec 2012 17:34:25 -0500 Subject: [PATCH 04/57] Fix crash in TeamDebugger. - TeamDebugger's destructor was assuming the report generator object had always been created, which might not be the case. Fixes second part of #9273. --- src/apps/debugger/controllers/TeamDebugger.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/apps/debugger/controllers/TeamDebugger.cpp b/src/apps/debugger/controllers/TeamDebugger.cpp index 6c8f43ecd2..a84a3205ad 100644 --- a/src/apps/debugger/controllers/TeamDebugger.cpp +++ b/src/apps/debugger/controllers/TeamDebugger.cpp @@ -277,13 +277,17 @@ TeamDebugger::~TeamDebugger() thread = next; } } + + if (fReportGenerator != NULL) { + fReportGenerator->Lock(); + fReportGenerator->Quit(); + } + delete fImageInfoPendingThreads; delete fBreakpointManager; delete fWatchpointManager; delete fMemoryBlockManager; - fReportGenerator->Lock(); - fReportGenerator->Quit(); delete fWorker; delete fTeam; delete fFileManager; From dc1456f662de373745f3623c83dc7a6b239e0e1a Mon Sep 17 00:00:00 2001 From: John Scipione Date: Fri, 7 Dec 2012 03:45:40 -0500 Subject: [PATCH 05/57] Add font sizes to Font Size menu in addition to in settings --- src/apps/terminal/AppearPrefView.cpp | 10 ++- src/apps/terminal/AppearPrefView.h | 2 +- src/apps/terminal/TermView.cpp | 4 +- src/apps/terminal/TermWindow.cpp | 122 +++++++++++++++++++++++---- src/apps/terminal/TermWindow.h | 5 +- 5 files changed, 117 insertions(+), 26 deletions(-) diff --git a/src/apps/terminal/AppearPrefView.cpp b/src/apps/terminal/AppearPrefView.cpp index 06b11900f4..f3d4a5f7e9 100644 --- a/src/apps/terminal/AppearPrefView.cpp +++ b/src/apps/terminal/AppearPrefView.cpp @@ -94,11 +94,11 @@ AppearancePrefView::AppearancePrefView(const char* name, PrefHandler::Default()->getString(PREF_HALF_FONT_FAMILY), PrefHandler::Default()->getString(PREF_HALF_FONT_STYLE)); - BMenu* sizeMenu = _MakeSizeMenu(MSG_HALF_SIZE_CHANGED, + BMenu* fontSizeMenu = _MakeFontSizeMenu(MSG_HALF_SIZE_CHANGED, PrefHandler::Default()->getInt32(PREF_HALF_FONT_SIZE)); fFont = new BMenuField(B_TRANSLATE("Font:"), fontMenu); - fFontSize = new BMenuField(B_TRANSLATE("Size:"), sizeMenu); + fFontSize = new BMenuField(B_TRANSLATE("Font size:"), fontSizeMenu); BPopUpMenu* schemesPopUp = _MakeColorSchemeMenu(MSG_COLOR_SCHEME_CHANGED, gPredefinedColorSchemes, gPredefinedColorSchemes[0]); @@ -456,7 +456,7 @@ AppearancePrefView::_MakeFontMenu(uint32 command, /*static*/ BMenu* -AppearancePrefView::_MakeSizeMenu(uint32 command, uint8 defaultSize) +AppearancePrefView::_MakeFontSizeMenu(uint32 command, uint8 defaultSize) { BPopUpMenu* menu = new BPopUpMenu("size"); int32 sizes[] = {9, 10, 11, 12, 14, 16, 18, 0}; @@ -467,7 +467,8 @@ AppearancePrefView::_MakeSizeMenu(uint32 command, uint8 defaultSize) BString string; string << sizes[i]; - BMenuItem* item = new BMenuItem(string.String(), new BMessage(command)); + BMenuItem* item = new BMenuItem(string.String(), + new BMessage(command)); menu->AddItem(item); if (sizes[i] == defaultSize) { @@ -475,6 +476,7 @@ AppearancePrefView::_MakeSizeMenu(uint32 command, uint8 defaultSize) found = true; } } + if (!found) { for (uint32 i = 0; sizes[i]; i++) { if (sizes[i] > defaultSize) { diff --git a/src/apps/terminal/AppearPrefView.h b/src/apps/terminal/AppearPrefView.h index 75da50cc3c..e76dab6355 100644 --- a/src/apps/terminal/AppearPrefView.h +++ b/src/apps/terminal/AppearPrefView.h @@ -62,7 +62,7 @@ private: static BMenu* _MakeFontMenu(uint32 command, const char* defaultFamily, const char* defaultStyle); - static BMenu* _MakeSizeMenu(uint32 command, + static BMenu* _MakeFontSizeMenu(uint32 command, uint8 defaultSize); static BPopUpMenu* _MakeMenu(uint32 msg, const char** items, diff --git a/src/apps/terminal/TermView.cpp b/src/apps/terminal/TermView.cpp index 2346a591b7..8da3c92dc7 100644 --- a/src/apps/terminal/TermView.cpp +++ b/src/apps/terminal/TermView.cpp @@ -945,8 +945,8 @@ TermView::SetTermFont(const BFont *font) fHalfFont.SetSpacing(B_FIXED_SPACING); // calculate half font's max width - // Not Bounding, check only A-Z(For case of fHalfFont is KanjiFont. ) - for (int c = 0x20 ; c <= 0x7e; c++){ + // Not Bounding, check only A-Z (For case of fHalfFont is KanjiFont.) + for (int c = 0x20; c <= 0x7e; c++) { char buf[4]; sprintf(buf, "%c", c); int tmpWidth = (int)fHalfFont.StringWidth(buf); diff --git a/src/apps/terminal/TermWindow.cpp b/src/apps/terminal/TermWindow.cpp index c38805f692..b01dab238a 100644 --- a/src/apps/terminal/TermWindow.cpp +++ b/src/apps/terminal/TermWindow.cpp @@ -11,6 +11,7 @@ #include #include +#include #include #include @@ -449,6 +450,16 @@ TermWindow::_MakeEncodingMenu() void TermWindow::_SetupMenu() { + fFontSizeMenu = _MakeFontSizeMenu(MSG_HALF_SIZE_CHANGED, + PrefHandler::Default()->getInt32(PREF_HALF_FONT_SIZE)); + fIncreaseFontSizeMenuItem = new BMenuItem(B_TRANSLATE("Increase"), + new BMessage(kIncreaseFontSize), '+', B_COMMAND_KEY); + fDecreaseFontSizeMenuItem = new BMenuItem(B_TRANSLATE("Decrease"), + new BMessage(kDecreaseFontSize), '-', B_COMMAND_KEY); + fFontSizeMenu->AddSeparatorItem(); + fFontSizeMenu->AddItem(fIncreaseFontSizeMenuItem); + fFontSizeMenu->AddItem(fDecreaseFontSizeMenuItem); + BLayoutBuilder::Menu<>(fMenuBar = new BMenuBar(Bounds(), "mbar")) // Terminal .AddMenu(B_TRANSLATE_SYSTEM_NAME("Terminal")) @@ -491,14 +502,7 @@ TermWindow::_SetupMenu() .AddMenu(B_TRANSLATE("Settings")) .AddItem(_MakeWindowSizeMenu()) .AddItem(fEncodingMenu = _MakeEncodingMenu()) - .AddMenu(B_TRANSLATE("Text size")) - .AddItem(B_TRANSLATE("Increase"), kIncreaseFontSize, '+', - B_COMMAND_KEY) - .GetItem(fIncreaseFontSizeMenuItem) - .AddItem(B_TRANSLATE("Decrease"), kDecreaseFontSize, '-', - B_COMMAND_KEY) - .GetItem(fDecreaseFontSizeMenuItem) - .End() + .AddItem(fFontSizeMenu) .AddSeparator() .AddItem(B_TRANSLATE("Settings" B_UTF8_ELLIPSIS), MENU_PREF_OPEN) .AddSeparator() @@ -779,10 +783,9 @@ TermWindow::MessageReceived(BMessage *message) _ResizeView(_ActiveTermView()); break; } + case MSG_HALF_FONT_CHANGED: case MSG_FULL_FONT_CHANGED: - case MSG_HALF_SIZE_CHANGED: - case MSG_FULL_SIZE_CHANGED: { BFont font; _GetPreferredFont(font); @@ -792,6 +795,36 @@ TermWindow::MessageReceived(BMessage *message) break; } + case MSG_HALF_SIZE_CHANGED: + case MSG_FULL_SIZE_CHANGED: + { + TermView* view = _ActiveTermView(); + BFont font; + view->GetTermFont(&font); + + int32 size; + if (message->FindInt32("font size", &size) != B_OK) + break; + + // mark the font size menu item + for (int32 i = 0; i < fFontSizeMenu->CountItems(); i++) { + BMenuItem* item = fFontSizeMenu->ItemAt(i); + if (item == NULL) + continue; + + item->SetMarked(false); + if (atoi(item->Label()) == size) + item->SetMarked(true); + } + + font.SetSize(size); + view->SetTermFont(&font); + PrefHandler::Default()->setInt32(PREF_HALF_FONT_SIZE, (int32)size); + + _ResizeView(view); + break; + } + case FULLSCREEN: if (!fSavedFrame.IsValid()) { // go fullscreen _ActiveTermView()->DisableResizeView(); @@ -960,19 +993,30 @@ TermWindow::MessageReceived(BMessage *message) TermView* view = _ActiveTermView(); BFont font; view->GetTermFont(&font); - float size = font.Size(); - if (message->what == kIncreaseFontSize) - size += 1; - else - size -= 1; - // limit the font size + if (message->what == kIncreaseFontSize) + size < 12 ? size += 1 : size += 2; + else + size < 14 ? size -= 1 : size -= 2; + + // constrain the font size if (size < 9) size = 9; if (size > 18) size = 18; + // mark the font size menu item + for (int32 i = 0; i < fFontSizeMenu->CountItems(); i++) { + BMenuItem* item = fFontSizeMenu->ItemAt(i); + if (item == NULL) + continue; + + item->SetMarked(false); + if (atoi(item->Label()) == size) + item->SetMarked(true); + } + font.SetSize(size); view->SetTermFont(&font); PrefHandler::Default()->setInt32(PREF_HALF_FONT_SIZE, (int32)size); @@ -1546,8 +1590,7 @@ TermWindow::_ResizeView(TermView *view) } -/* static */ -BMenu* +/* static */ BMenu* TermWindow::_MakeWindowSizeMenu() { BMenu* menu = new (std::nothrow) BMenu(B_TRANSLATE("Window size")); @@ -1581,6 +1624,49 @@ TermWindow::_MakeWindowSizeMenu() } +/*static*/ BMenu* +TermWindow::_MakeFontSizeMenu(uint32 command, uint8 defaultSize) +{ + BMenu* menu = new (std::nothrow) BMenu(B_TRANSLATE("Font size")); + if (menu == NULL) + return NULL; + + int32 sizes[] = {9, 10, 11, 12, 14, 16, 18, 0}; + + bool found = false; + + for (uint32 i = 0; sizes[i]; i++) { + BString string; + string << sizes[i]; + BMessage* message = new BMessage(command); + message->AddInt32("font size", sizes[i]); + BMenuItem* item = new BMenuItem(string.String(), message); + menu->AddItem(item); + if (sizes[i] == defaultSize) { + item->SetMarked(true); + found = true; + } + } + + if (!found) { + for (uint32 i = 0; sizes[i]; i++) { + if (sizes[i] > defaultSize) { + BString string; + string << defaultSize; + BMessage* message = new BMessage(command); + message->AddInt32("font size", sizes[i]); + BMenuItem* item = new BMenuItem(string.String(), message); + item->SetMarked(true); + menu->AddItem(item, i); + break; + } + } + } + + return menu; +} + + void TermWindow::_UpdateSwitchTerminalsMenuItem() { diff --git a/src/apps/terminal/TermWindow.h b/src/apps/terminal/TermWindow.h index 1f9d9891cb..542603a6ef 100644 --- a/src/apps/terminal/TermWindow.h +++ b/src/apps/terminal/TermWindow.h @@ -136,6 +136,8 @@ private: void _SetupMenu(); static BMenu* _MakeEncodingMenu(); static BMenu* _MakeWindowSizeMenu(); + static BMenu* _MakeFontSizeMenu(uint32 command, + uint8 defaultSize); void _UpdateSwitchTerminalsMenuItem(); status_t _GetWindowPositionFile(BFile* file, @@ -198,6 +200,7 @@ private: BMenuBar* fMenuBar; BMenuItem* fSwitchTerminalsMenuItem; BMenu* fEncodingMenu; + BMenu* fFontSizeMenu; BMessage* fPrintSettings; PrefWindow* fPrefWindow; @@ -212,7 +215,7 @@ private: // Saved search parameters BString fFindString; BMenuItem* fFindNextMenuItem; - BMenuItem * fFindPreviousMenuItem; + BMenuItem* fFindPreviousMenuItem; BMenuItem* fIncreaseFontSizeMenuItem; BMenuItem* fDecreaseFontSizeMenuItem; From 9e4281adaf91955c39ab518b331fe317dd78a216 Mon Sep 17 00:00:00 2001 From: John Scipione Date: Fri, 7 Dec 2012 17:44:34 -0500 Subject: [PATCH 06/57] Make font size dropdown in settings windows work again --- src/apps/terminal/AppearPrefView.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/apps/terminal/AppearPrefView.cpp b/src/apps/terminal/AppearPrefView.cpp index f3d4a5f7e9..f78494cc0d 100644 --- a/src/apps/terminal/AppearPrefView.cpp +++ b/src/apps/terminal/AppearPrefView.cpp @@ -108,8 +108,7 @@ AppearancePrefView::AppearancePrefView(const char* name, BPopUpMenu* colorsPopUp = _MakeMenu(MSG_COLOR_FIELD_CHANGED, kColorTable, kColorTable[0]); - fColorField = new BMenuField(B_TRANSLATE("Color:"), - colorsPopUp); + fColorField = new BMenuField(B_TRANSLATE("Color:"), colorsPopUp); fColorField->SetEnabled(false); fTabTitle = new BTextControl("tabTitle", B_TRANSLATE("Tab title:"), "", @@ -264,6 +263,8 @@ AppearancePrefView::MessageReceived(BMessage* msg) fFontSize->Menu()->FindMarked()->Label()) != 0) { PrefHandler::Default()->setString(PREF_HALF_FONT_SIZE, fFontSize->Menu()->FindMarked()->Label()); + msg->AddInt32("font size", + atoi(fFontSize->Menu()->FindMarked()->Label())); modified = true; } break; @@ -272,21 +273,20 @@ AppearancePrefView::MessageReceived(BMessage* msg) { rgb_color oldColor = PrefHandler::Default()->getRGB( fColorField->Menu()->FindMarked()->Label()); - if (oldColor != fColorControl->ValueAsColor()) { - PrefHandler::Default()->setRGB( - fColorField->Menu()->FindMarked()->Label(), - fColorControl->ValueAsColor()); - modified = true; - } + if (oldColor != fColorControl->ValueAsColor()) { + PrefHandler::Default()->setRGB( + fColorField->Menu()->FindMarked()->Label(), + fColorControl->ValueAsColor()); + modified = true; } break; + } case MSG_COLOR_SCHEME_CHANGED: { color_scheme* newScheme = NULL; if (msg->FindPointer("color_scheme", - (void**)&newScheme) == B_OK) { - + (void**)&newScheme) == B_OK) { if (newScheme == &gCustomColorScheme) _EnableCustomColors(true); else From bfbcec141efc619ecadbc11f5cc7047437f6fa1d Mon Sep 17 00:00:00 2001 From: John Scipione Date: Fri, 7 Dec 2012 19:51:54 -0500 Subject: [PATCH 07/57] Unify the Font menu and Font size menu into one. The Font size menu becomes a submenu of Font so that you can set both the font and font size at once. This fixes #4198 --- src/apps/terminal/AppearPrefView.cpp | 152 +++++++++++++++++---------- src/apps/terminal/AppearPrefView.h | 13 ++- src/apps/terminal/TermWindow.cpp | 6 +- 3 files changed, 106 insertions(+), 65 deletions(-) diff --git a/src/apps/terminal/AppearPrefView.cpp b/src/apps/terminal/AppearPrefView.cpp index f78494cc0d..0e548c439b 100644 --- a/src/apps/terminal/AppearPrefView.cpp +++ b/src/apps/terminal/AppearPrefView.cpp @@ -93,12 +93,7 @@ AppearancePrefView::AppearancePrefView(const char* name, BMenu* fontMenu = _MakeFontMenu(MSG_HALF_FONT_CHANGED, PrefHandler::Default()->getString(PREF_HALF_FONT_FAMILY), PrefHandler::Default()->getString(PREF_HALF_FONT_STYLE)); - - BMenu* fontSizeMenu = _MakeFontSizeMenu(MSG_HALF_SIZE_CHANGED, - PrefHandler::Default()->getInt32(PREF_HALF_FONT_SIZE)); - - fFont = new BMenuField(B_TRANSLATE("Font:"), fontMenu); - fFontSize = new BMenuField(B_TRANSLATE("Font size:"), fontSizeMenu); + fFontField = new BMenuField(B_TRANSLATE("Font:"), fontMenu); BPopUpMenu* schemesPopUp = _MakeColorSchemeMenu(MSG_COLOR_SCHEME_CHANGED, gPredefinedColorSchemes, gPredefinedColorSchemes[0]); @@ -134,14 +129,12 @@ AppearancePrefView::AppearancePrefView(const char* name, .Add(fTabTitle->CreateTextViewLayoutItem(), 1, 0) .Add(fWindowTitle->CreateLabelLayoutItem(), 0, 1) .Add(fWindowTitle->CreateTextViewLayoutItem(), 1, 1) - .Add(fFont->CreateLabelLayoutItem(), 0, 2) - .Add(fFont->CreateMenuBarLayoutItem(), 1, 2) - .Add(fFontSize->CreateLabelLayoutItem(), 0, 3) - .Add(fFontSize->CreateMenuBarLayoutItem(), 1, 3) - .Add(fColorSchemeField->CreateLabelLayoutItem(), 0, 4) - .Add(fColorSchemeField->CreateMenuBarLayoutItem(), 1, 4) - .Add(fColorField->CreateLabelLayoutItem(), 0, 5) - .Add(fColorField->CreateMenuBarLayoutItem(), 1, 5) + .Add(fFontField->CreateLabelLayoutItem(), 0, 2) + .Add(fFontField->CreateMenuBarLayoutItem(), 1, 2) + .Add(fColorSchemeField->CreateLabelLayoutItem(), 0, 3) + .Add(fColorSchemeField->CreateMenuBarLayoutItem(), 1, 3) + .Add(fColorField->CreateLabelLayoutItem(), 0, 4) + .Add(fColorField->CreateMenuBarLayoutItem(), 1, 4) .End() .AddGlue() .Add(fColorControl = new BColorControl(BPoint(10, 10), @@ -151,8 +144,7 @@ AppearancePrefView::AppearancePrefView(const char* name, fTabTitle->SetAlignment(B_ALIGN_RIGHT, B_ALIGN_LEFT); fWindowTitle->SetAlignment(B_ALIGN_RIGHT, B_ALIGN_LEFT); - fFont->SetAlignment(B_ALIGN_RIGHT); - fFontSize->SetAlignment(B_ALIGN_RIGHT); + fFontField->SetAlignment(B_ALIGN_RIGHT); fColorField->SetAlignment(B_ALIGN_RIGHT); fColorSchemeField->SetAlignment(B_ALIGN_RIGHT); @@ -190,20 +182,23 @@ AppearancePrefView::GetPreferredSize(float* _width, float* _height) void AppearancePrefView::Revert() { - fTabTitle->SetText(PrefHandler::Default()->getString(PREF_TAB_TITLE)); - fWindowTitle->SetText(PrefHandler::Default()->getString(PREF_WINDOW_TITLE)); + PrefHandler* pref = PrefHandler::Default(); - fWarnOnExit->SetValue(PrefHandler::Default()->getBool( + fTabTitle->SetText(pref->getString(PREF_TAB_TITLE)); + fWindowTitle->SetText(pref->getString(PREF_WINDOW_TITLE)); + + fWarnOnExit->SetValue(pref->getBool( PREF_WARN_ON_EXIT)); fColorSchemeField->Menu()->ItemAt(0)->SetMarked(true); - fColorControl->SetValue(PrefHandler::Default()-> + fColorControl->SetValue(pref-> getRGB(PREF_TEXT_FORE_COLOR)); - fFont->Menu()->FindItem(PrefHandler::Default()->getString( - PREF_HALF_FONT_FAMILY))->SetMarked(true); - fFontSize->Menu()->FindItem(PrefHandler::Default()->getString( - PREF_HALF_FONT_FAMILY))->SetMarked(true); + const char* family = pref->getString(PREF_HALF_FONT_FAMILY); + const char* style = pref->getString(PREF_HALF_FONT_STYLE); + const char* size = pref->getString(PREF_HALF_FONT_SIZE); + + _MarkSelectedFont(family, style, size); } @@ -215,8 +210,14 @@ AppearancePrefView::AttachedToWindow() fBlinkCursor->SetTarget(this); fWarnOnExit->SetTarget(this); - fFontSize->Menu()->SetTargetForItems(this); - fFont->Menu()->SetTargetForItems(this); + fFontField->Menu()->SetTargetForItems(this); + for (int32 i = 0; i < fFontField->Menu()->CountItems(); i++) { + BMenu* fontSizeMenu = fFontField->Menu()->SubmenuAt(i); + if (fontSizeMenu == NULL) + continue; + + fontSizeMenu->SetTargetForItems(this); + } fColorControl->SetTarget(this); fColorField->Menu()->SetTargetForItems(this); @@ -232,6 +233,7 @@ AppearancePrefView::AttachedToWindow() void + AppearancePrefView::MessageReceived(BMessage* msg) { bool modified = false; @@ -241,34 +243,33 @@ AppearancePrefView::MessageReceived(BMessage* msg) { const char* family = NULL; const char* style = NULL; - msg->FindString("font_family", &family); - msg->FindString("font_style", &style); + const char* size = NULL; + if (msg->FindString("font_family", &family) != B_OK + || msg->FindString("font_style", &style) != B_OK + || msg->FindString("font_size", &size) != B_OK) { + break; + } PrefHandler* pref = PrefHandler::Default(); const char* currentFamily = pref->getString(PREF_HALF_FONT_FAMILY); const char* currentStyle = pref->getString(PREF_HALF_FONT_STYLE); + const char* currentSize + = pref->getString(PREF_HALF_FONT_SIZE); + if (currentFamily == NULL || strcmp(currentFamily, family) != 0 - || currentStyle == NULL || strcmp(currentStyle, style) != 0) { + || currentStyle == NULL || strcmp(currentStyle, style) != 0 + || currentSize == NULL || strcmp(currentSize, size) != 0) { pref->setString(PREF_HALF_FONT_FAMILY, family); pref->setString(PREF_HALF_FONT_STYLE, style); + pref->setString(PREF_HALF_FONT_SIZE, size); + _MarkSelectedFont(family, style, size); modified = true; } break; } - case MSG_HALF_SIZE_CHANGED: - if (strcmp(PrefHandler::Default()->getString(PREF_HALF_FONT_SIZE), - fFontSize->Menu()->FindMarked()->Label()) != 0) { - PrefHandler::Default()->setString(PREF_HALF_FONT_SIZE, - fFontSize->Menu()->FindMarked()->Label()); - msg->AddInt32("font size", - atoi(fFontSize->Menu()->FindMarked()->Label())); - modified = true; - } - break; - case MSG_COLOR_CHANGED: { rgb_color oldColor = PrefHandler::Default()->getRGB( @@ -431,13 +432,17 @@ AppearancePrefView::_MakeFontMenu(uint32 command, font.SetFamilyAndStyle(family, style); if (IsFontUsable(font)) { BMessage* message = new BMessage(command); + const char* size + = PrefHandler::Default()->getString(PREF_HALF_FONT_SIZE); message->AddString("font_family", family); message->AddString("font_style", style); - char itemLabel[134]; - snprintf(itemLabel, sizeof(itemLabel), + message->AddString("font_size", size); + char fontMenuLabel[134]; + snprintf(fontMenuLabel, sizeof(fontMenuLabel), "%s - %s", family, style); - BMenuItem* item = new BMenuItem(itemLabel, - message); + BMenu* fontSizeMenu = _MakeFontSizeMenu(fontMenuLabel, + MSG_HALF_FONT_CHANGED, family, style, size); + BMenuItem* item = new BMenuItem(fontSizeMenu, message); menu->AddItem(item); if (strcmp(defaultFamily, family) == 0 && strcmp(defaultStyle, style) == 0) @@ -456,22 +461,27 @@ AppearancePrefView::_MakeFontMenu(uint32 command, /*static*/ BMenu* -AppearancePrefView::_MakeFontSizeMenu(uint32 command, uint8 defaultSize) +AppearancePrefView::_MakeFontSizeMenu(const char* label, uint32 command, + const char* family, const char* style, const char* size) { - BPopUpMenu* menu = new BPopUpMenu("size"); + BMenu* menu = new BMenu(label); + menu->SetRadioMode(true); + menu->SetLabelFromMarked(false); + int32 sizes[] = {9, 10, 11, 12, 14, 16, 18, 0}; bool found = false; for (uint32 i = 0; sizes[i]; i++) { - BString string; - string << sizes[i]; - - BMenuItem* item = new BMenuItem(string.String(), - new BMessage(command)); + BString fontSize; + fontSize << sizes[i]; + BMessage* message = new BMessage(command); + message->AddString("font_family", family); + message->AddString("font_style", style); + message->AddString("font_size", fontSize.String()); + BMenuItem* item = new BMenuItem(fontSize.String(), message); menu->AddItem(item); - - if (sizes[i] == defaultSize) { + if (sizes[i] == atoi(size)) { item->SetMarked(true); found = true; } @@ -479,11 +489,12 @@ AppearancePrefView::_MakeFontSizeMenu(uint32 command, uint8 defaultSize) if (!found) { for (uint32 i = 0; sizes[i]; i++) { - if (sizes[i] > defaultSize) { - BString string; - string << defaultSize; - BMenuItem* item = new BMenuItem(string.String(), - new BMessage(command)); + if (sizes[i] > atoi(size)) { + BMessage* message = new BMessage(command); + message->AddString("font_family", family); + message->AddString("font_style", style); + message->AddString("font_size", size); + BMenuItem* item = new BMenuItem(size, message); item->SetMarked(true); menu->AddItem(item, i); break; @@ -543,3 +554,28 @@ AppearancePrefView::_MakeColorSchemeMenu(uint32 msg, const color_scheme** items, } return menu; } + + +void +AppearancePrefView::_MarkSelectedFont(const char* family, const char* style, + const char* size) +{ + char fontMenuLabel[134]; + snprintf(fontMenuLabel, sizeof(fontMenuLabel), "%s - %s", family, style); + + // mark the selected font + BMenuItem* selectedFont = fFontField->Menu()->FindItem(fontMenuLabel); + if (selectedFont != NULL) + selectedFont->SetMarked(true); + + // mark the selected font size on all font menus + for (int32 i = 0; i < fFontField->Menu()->CountItems(); i++) { + BMenu* fontSizeMenu = fFontField->Menu()->SubmenuAt(i); + if (fontSizeMenu == NULL) + continue; + + BMenuItem* item = fontSizeMenu->FindItem(size); + if (item != NULL) + item->SetMarked(true); + } +} diff --git a/src/apps/terminal/AppearPrefView.h b/src/apps/terminal/AppearPrefView.h index e76dab6355..7f9f170fd6 100644 --- a/src/apps/terminal/AppearPrefView.h +++ b/src/apps/terminal/AppearPrefView.h @@ -62,8 +62,11 @@ private: static BMenu* _MakeFontMenu(uint32 command, const char* defaultFamily, const char* defaultStyle); - static BMenu* _MakeFontSizeMenu(uint32 command, - uint8 defaultSize); + static BMenu* _MakeFontSizeMenu(const char* label, + uint32 command, + const char* family, + const char* style, + const char* size); static BPopUpMenu* _MakeMenu(uint32 msg, const char** items, const char* defaultItem); @@ -72,10 +75,12 @@ private: const color_scheme** schemes, const color_scheme* defaultItemName); + void _MarkSelectedFont(const char* family, + const char* style, const char* size); + BCheckBox* fBlinkCursor; BCheckBox* fWarnOnExit; - BMenuField* fFont; - BMenuField* fFontSize; + BMenuField* fFontField; BMenuField* fColorSchemeField; BMenuField* fColorField; diff --git a/src/apps/terminal/TermWindow.cpp b/src/apps/terminal/TermWindow.cpp index b01dab238a..e93d4c5392 100644 --- a/src/apps/terminal/TermWindow.cpp +++ b/src/apps/terminal/TermWindow.cpp @@ -803,7 +803,7 @@ TermWindow::MessageReceived(BMessage *message) view->GetTermFont(&font); int32 size; - if (message->FindInt32("font size", &size) != B_OK) + if (message->FindInt32("font_size", &size) != B_OK) break; // mark the font size menu item @@ -1639,7 +1639,7 @@ TermWindow::_MakeFontSizeMenu(uint32 command, uint8 defaultSize) BString string; string << sizes[i]; BMessage* message = new BMessage(command); - message->AddInt32("font size", sizes[i]); + message->AddInt32("font_size", sizes[i]); BMenuItem* item = new BMenuItem(string.String(), message); menu->AddItem(item); if (sizes[i] == defaultSize) { @@ -1654,7 +1654,7 @@ TermWindow::_MakeFontSizeMenu(uint32 command, uint8 defaultSize) BString string; string << defaultSize; BMessage* message = new BMessage(command); - message->AddInt32("font size", sizes[i]); + message->AddInt32("font_size", sizes[i]); BMenuItem* item = new BMenuItem(string.String(), message); item->SetMarked(true); menu->AddItem(item, i); From 1bb31e64730404b1a13638b329c61be81ff47c51 Mon Sep 17 00:00:00 2001 From: John Scipione Date: Fri, 7 Dec 2012 21:00:13 -0500 Subject: [PATCH 08/57] When you set the Font size in the settings, mark the menu Also store the font size as a string instead of an int32 in the message, consistent with the setting window. --- src/apps/terminal/TermWindow.cpp | 36 ++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/src/apps/terminal/TermWindow.cpp b/src/apps/terminal/TermWindow.cpp index e93d4c5392..fffe2d2c23 100644 --- a/src/apps/terminal/TermWindow.cpp +++ b/src/apps/terminal/TermWindow.cpp @@ -617,15 +617,25 @@ TermWindow::_GetPreferredFont(BFont& font) // Default to be_fixed_font font = be_fixed_font; - const char* family = PrefHandler::Default()->getString(PREF_HALF_FONT_FAMILY); - const char* style = PrefHandler::Default()->getString(PREF_HALF_FONT_STYLE); + const char* family + = PrefHandler::Default()->getString(PREF_HALF_FONT_FAMILY); + const char* style + = PrefHandler::Default()->getString(PREF_HALF_FONT_STYLE); + const char* size = PrefHandler::Default()->getString(PREF_HALF_FONT_SIZE); font.SetFamilyAndStyle(family, style); + font.SetSize(atoi(size)); - float size = PrefHandler::Default()->getFloat(PREF_HALF_FONT_SIZE); - if (size < 6.0f) - size = 6.0f; - font.SetSize(size); + // mark the font size menu item + for (int32 i = 0; i < fFontSizeMenu->CountItems(); i++) { + BMenuItem* item = fFontSizeMenu->ItemAt(i); + if (item == NULL) + continue; + + item->SetMarked(false); + if (strcmp(item->Label(), size) == 0) + item->SetMarked(true); + } } @@ -802,8 +812,8 @@ TermWindow::MessageReceived(BMessage *message) BFont font; view->GetTermFont(&font); - int32 size; - if (message->FindInt32("font_size", &size) != B_OK) + const char* size = NULL; + if (message->FindString("font_size", &size) != B_OK) break; // mark the font size menu item @@ -813,13 +823,13 @@ TermWindow::MessageReceived(BMessage *message) continue; item->SetMarked(false); - if (atoi(item->Label()) == size) + if (strcmp(item->Label(), size) == 0) item->SetMarked(true); } - font.SetSize(size); + font.SetSize(atoi(size)); view->SetTermFont(&font); - PrefHandler::Default()->setInt32(PREF_HALF_FONT_SIZE, (int32)size); + PrefHandler::Default()->setInt32(PREF_HALF_FONT_SIZE, (int32)atoi(size)); _ResizeView(view); break; @@ -1639,7 +1649,7 @@ TermWindow::_MakeFontSizeMenu(uint32 command, uint8 defaultSize) BString string; string << sizes[i]; BMessage* message = new BMessage(command); - message->AddInt32("font_size", sizes[i]); + message->AddString("font_size", string); BMenuItem* item = new BMenuItem(string.String(), message); menu->AddItem(item); if (sizes[i] == defaultSize) { @@ -1654,7 +1664,7 @@ TermWindow::_MakeFontSizeMenu(uint32 command, uint8 defaultSize) BString string; string << defaultSize; BMessage* message = new BMessage(command); - message->AddInt32("font_size", sizes[i]); + message->AddString("font_size", string); BMenuItem* item = new BMenuItem(string.String(), message); item->SetMarked(true); menu->AddItem(item, i); From cce0076a72a6004d9041ad4a938e631b9ef7e031 Mon Sep 17 00:00:00 2001 From: John Scipione Date: Fri, 7 Dec 2012 23:28:40 -0500 Subject: [PATCH 09/57] When you change the font size, update all tabs... on the window, not just the active tab. Also fix window resizing with tabs open. It wasn't taking into account the height of the tab bar. This fixes #8108 --- src/apps/terminal/TermWindow.cpp | 70 +++++++++++++++++++------------- 1 file changed, 42 insertions(+), 28 deletions(-) diff --git a/src/apps/terminal/TermWindow.cpp b/src/apps/terminal/TermWindow.cpp index fffe2d2c23..d63d0f4ac4 100644 --- a/src/apps/terminal/TermWindow.cpp +++ b/src/apps/terminal/TermWindow.cpp @@ -785,12 +785,16 @@ TermWindow::MessageReceived(BMessage *message) case MSG_COLS_CHANGED: { int32 columns, rows; - message->FindInt32("columns", &columns); - message->FindInt32("rows", &rows); + if (message->FindInt32("columns", &columns) != B_OK + || message->FindInt32("rows", &rows) != B_OK) { + break; + } - _ActiveTermView()->SetTermSize(rows, columns); - - _ResizeView(_ActiveTermView()); + for (int32 i = 0; i < fTabView->CountTabs(); i++) { + TermView* view = _TermViewAt(i); + view->SetTermSize(rows, columns); + _ResizeView(view); + } break; } @@ -799,19 +803,17 @@ TermWindow::MessageReceived(BMessage *message) { BFont font; _GetPreferredFont(font); - _ActiveTermView()->SetTermFont(&font); - - _ResizeView(_ActiveTermView()); + for (int32 i = 0; i < fTabView->CountTabs(); i++) { + TermView* view = _TermViewAt(i); + view->SetTermFont(&font); + _ResizeView(view); + } break; } case MSG_HALF_SIZE_CHANGED: case MSG_FULL_SIZE_CHANGED: { - TermView* view = _ActiveTermView(); - BFont font; - view->GetTermFont(&font); - const char* size = NULL; if (message->FindString("font_size", &size) != B_OK) break; @@ -827,11 +829,16 @@ TermWindow::MessageReceived(BMessage *message) item->SetMarked(true); } + BFont font; + _ActiveTermView()->GetTermFont(&font); font.SetSize(atoi(size)); - view->SetTermFont(&font); - PrefHandler::Default()->setInt32(PREF_HALF_FONT_SIZE, (int32)atoi(size)); - - _ResizeView(view); + PrefHandler::Default()->setInt32(PREF_HALF_FONT_SIZE, + (int32)atoi(size)); + for (int32 i = 0; i < fTabView->CountTabs(); i++) { + TermView* view = _TermViewAt(i); + _TermViewAt(i)->SetTermFont(&font); + _ResizeView(view); + } break; } @@ -1000,9 +1007,8 @@ TermWindow::MessageReceived(BMessage *message) case kIncreaseFontSize: case kDecreaseFontSize: { - TermView* view = _ActiveTermView(); BFont font; - view->GetTermFont(&font); + _ActiveTermView()->GetTermFont(&font); float size = font.Size(); if (message->what == kIncreaseFontSize) @@ -1028,10 +1034,12 @@ TermWindow::MessageReceived(BMessage *message) } font.SetSize(size); - view->SetTermFont(&font); PrefHandler::Default()->setInt32(PREF_HALF_FONT_SIZE, (int32)size); - - _ResizeView(view); + for (int32 i = 0; i < fTabView->CountTabs(); i++) { + TermView* view = _TermViewAt(i); + _TermViewAt(i)->SetTermFont(&font); + _ResizeView(view); + } break; } @@ -1198,10 +1206,12 @@ TermWindow::_AddTab(Arguments* args, const BString& currentDirectory) view->GetFontSize(&width, &height); float minimumHeight = -1; - if (fMenuBar) + if (fMenuBar != NULL) minimumHeight += fMenuBar->Bounds().Height() + 1; - if (fTabView && fTabView->CountTabs() > 0) + + if (fTabView != NULL && fTabView->CountTabs() > 0) minimumHeight += fTabView->TabHeight() + 1; + SetSizeLimits(MIN_COLS * width - 1, MAX_COLS * width - 1, minimumHeight + MIN_ROWS * height - 1, minimumHeight + MAX_ROWS * height - 1); @@ -1209,7 +1219,7 @@ TermWindow::_AddTab(Arguments* args, const BString& currentDirectory) // the terminal can be resized smaller than MIN_ROWS/MIN_COLS! // If it's the first time we're called, setup the window - if (fTabView->CountTabs() == 0) { + if (fTabView != NULL && fTabView->CountTabs() == 0) { float viewWidth, viewHeight; containerView->GetPreferredSize(&viewWidth, &viewHeight); @@ -1577,9 +1587,10 @@ TermWindow::_ResizeView(TermView *view) view->GetFontSize(&fontWidth, &fontHeight); float minimumHeight = -1; - if (fMenuBar) + if (fMenuBar != NULL) minimumHeight += fMenuBar->Bounds().Height() + 1; - if (fTabView && fTabView->CountTabs() > 1) + + if (fTabView != NULL && fTabView->CountTabs() > 1) minimumHeight += fTabView->TabHeight() + 1; SetSizeLimits(MIN_COLS * fontWidth - 1, MAX_COLS * fontWidth - 1, @@ -1589,13 +1600,16 @@ TermWindow::_ResizeView(TermView *view) float width; float height; view->Parent()->GetPreferredSize(&width, &height); + width += B_V_SCROLL_BAR_WIDTH; // NOTE: Width is one pixel too small, since the scroll view // is one pixel wider than its parent. - height += fMenuBar->Bounds().Height() + 1; + if (fMenuBar != NULL) + height += fMenuBar->Bounds().Height() + 1; + if (fTabView != NULL && fTabView->CountTabs() > 1) + height += fTabView->TabHeight() + 1; ResizeTo(width, height); - view->Invalidate(); } From 5cbd6771cd858abe057744728d69e03a983b1255 Mon Sep 17 00:00:00 2001 From: Niels Sascha Reedijk Date: Sat, 8 Dec 2012 06:41:00 +0100 Subject: [PATCH 10/57] Update translations from Pootle --- data/catalogs/apps/expander/be.catkeys | 3 +- data/catalogs/apps/expander/de.catkeys | 3 +- data/catalogs/apps/expander/el.catkeys | 3 +- data/catalogs/apps/expander/fi.catkeys | 3 +- data/catalogs/apps/expander/fr.catkeys | 3 +- data/catalogs/apps/expander/hi.catkeys | 3 +- data/catalogs/apps/expander/hu.catkeys | 6 ++-- data/catalogs/apps/expander/ja.catkeys | 3 +- data/catalogs/apps/expander/lt.catkeys | 3 +- data/catalogs/apps/expander/nl.catkeys | 3 +- data/catalogs/apps/expander/pl.catkeys | 3 +- data/catalogs/apps/expander/pt_BR.catkeys | 3 +- data/catalogs/apps/expander/ro.catkeys | 3 +- data/catalogs/apps/expander/ru.catkeys | 3 +- data/catalogs/apps/expander/sk.catkeys | 3 +- data/catalogs/apps/expander/sv.catkeys | 3 +- data/catalogs/apps/expander/uk.catkeys | 3 +- data/catalogs/apps/expander/zh_Hans.catkeys | 3 +- data/catalogs/apps/powerstatus/hu.catkeys | 36 ++++++++++----------- 19 files changed, 39 insertions(+), 54 deletions(-) diff --git a/data/catalogs/apps/expander/be.catkeys b/data/catalogs/apps/expander/be.catkeys index dadd46bdba..06df50042b 100644 --- a/data/catalogs/apps/expander/be.catkeys +++ b/data/catalogs/apps/expander/be.catkeys @@ -1,4 +1,4 @@ -1 belarusian x-vnd.Haiku-Expander 2398100010 +1 belarusian x-vnd.Haiku-Expander 282517174 Expand ExpanderMenu Распакаваць Close window when done expanding ExpanderPreferences Закрыць вакно пасля распакоўкі Set destination… ExpanderMenu Задаць прызначэнне… @@ -17,7 +17,6 @@ Automatically expand files ExpanderPreferences Распакоўваць фай Creating listing for '%s' ExpanderWindow Стварэнне спіса для '%s' Continue ExpanderWindow Працягваць Destination folder ExpanderPreferences Тэчка прызначэння -The destination folder does not exist. ExpanderWindow Тэчка прызначэння не існуе. Other ExpanderPreferences Іншы Cancel ExpanderPreferences Адмена Expansion ExpanderPreferences Пашырэньне diff --git a/data/catalogs/apps/expander/de.catkeys b/data/catalogs/apps/expander/de.catkeys index 92a0e8814d..81ead2ea34 100644 --- a/data/catalogs/apps/expander/de.catkeys +++ b/data/catalogs/apps/expander/de.catkeys @@ -1,4 +1,4 @@ -1 german x-vnd.Haiku-Expander 2398100010 +1 german x-vnd.Haiku-Expander 282517174 Expand ExpanderMenu Entpacken Close window when done expanding ExpanderPreferences Fenster nach dem Entpacken schließen Set destination… ExpanderMenu Ziel wählen… @@ -17,7 +17,6 @@ Automatically expand files ExpanderPreferences Archiv automatisch entpacken Creating listing for '%s' ExpanderWindow Dateiliste für '%s' wird erstellt Continue ExpanderWindow Fortsetzen Destination folder ExpanderPreferences Zielordner -The destination folder does not exist. ExpanderWindow Der Zielordner existiert nicht. Other ExpanderPreferences Allgemeines Cancel ExpanderPreferences Abbrechen Expansion ExpanderPreferences Entpacken diff --git a/data/catalogs/apps/expander/el.catkeys b/data/catalogs/apps/expander/el.catkeys index 1ee38000cf..789d7d33f6 100644 --- a/data/catalogs/apps/expander/el.catkeys +++ b/data/catalogs/apps/expander/el.catkeys @@ -1,4 +1,4 @@ -1 greek, modern (1453-) x-vnd.Haiku-Expander 386826896 +1 greek, modern (1453-) x-vnd.Haiku-Expander 2566211356 Expand ExpanderMenu Επέκταση Close window when done expanding ExpanderPreferences Κλείσιμο παραθύρου μετά το πέρας Set destination… ExpanderMenu Ορισμός προορισμού... @@ -15,7 +15,6 @@ Cancel ExpanderWindow Άκυρο Automatically expand files ExpanderPreferences Αυτόματη επέκταση αρχείων Creating listing for '%s' ExpanderWindow Δημιούργησε την καταχώρηση για '%s' Continue ExpanderWindow Συνέχεια -The destination folder does not exist. ExpanderWindow Ο φάκελος προορισμού δεν υπάρχει. Cancel ExpanderPreferences Άκυρο Are you sure you want to stop expanding this\narchive? The expanded items may not be complete. ExpanderWindow Είστε σίγουρος ότι θέλετε να σταματήσετε την επέκταση αυτού του \nαρχείου; Τα επεκταμένα στοιχεία μπορεί να μην είναι ολοκληρωμένα. Select DirectoryFilePanel Επιλογή diff --git a/data/catalogs/apps/expander/fi.catkeys b/data/catalogs/apps/expander/fi.catkeys index 2e4586adbf..67298b5ba5 100644 --- a/data/catalogs/apps/expander/fi.catkeys +++ b/data/catalogs/apps/expander/fi.catkeys @@ -1,4 +1,4 @@ -1 finnish x-vnd.Haiku-Expander 2398100010 +1 finnish x-vnd.Haiku-Expander 282517174 Expand ExpanderMenu Laajenna Close window when done expanding ExpanderPreferences Sulje ikkuna kun laajentaminen on tehty Set destination… ExpanderMenu Aseta kohde… @@ -17,7 +17,6 @@ Automatically expand files ExpanderPreferences Laajenna tiedostot automaattises Creating listing for '%s' ExpanderWindow Luodaan luettelo kohteelle ’%s’ Continue ExpanderWindow Jatka Destination folder ExpanderPreferences Kohdekansio -The destination folder does not exist. ExpanderWindow Kohdekansiota ei ole olemassa. Other ExpanderPreferences Muut Cancel ExpanderPreferences Peru Expansion ExpanderPreferences Laajentaminen diff --git a/data/catalogs/apps/expander/fr.catkeys b/data/catalogs/apps/expander/fr.catkeys index b25cfd5ade..27837b39e2 100644 --- a/data/catalogs/apps/expander/fr.catkeys +++ b/data/catalogs/apps/expander/fr.catkeys @@ -1,4 +1,4 @@ -1 french x-vnd.Haiku-Expander 2398100010 +1 french x-vnd.Haiku-Expander 282517174 Expand ExpanderMenu Décompresser Close window when done expanding ExpanderPreferences Fermer la fenêtre après l'extraction Set destination… ExpanderMenu Choisir la destination… @@ -17,7 +17,6 @@ Automatically expand files ExpanderPreferences Décompresser les fichiers autom Creating listing for '%s' ExpanderWindow Créer un inventaire pour « %s » Continue ExpanderWindow Continuer Destination folder ExpanderPreferences Dossier de destination -The destination folder does not exist. ExpanderWindow Le dossier de destination n'existe pas. Other ExpanderPreferences Autre Cancel ExpanderPreferences Annuler Expansion ExpanderPreferences Décompression diff --git a/data/catalogs/apps/expander/hi.catkeys b/data/catalogs/apps/expander/hi.catkeys index 9efb3f6c3c..c4b0ec53c4 100644 --- a/data/catalogs/apps/expander/hi.catkeys +++ b/data/catalogs/apps/expander/hi.catkeys @@ -1,4 +1,4 @@ -1 hindi x-vnd.Haiku-Expander 386826896 +1 hindi x-vnd.Haiku-Expander 2566211356 Expand ExpanderMenu विस्तार Close window when done expanding ExpanderPreferences विस्तार करने के बाद विंडो बंद करें Set destination… ExpanderMenu गंतव्य सेट कीजिए... @@ -15,7 +15,6 @@ Cancel ExpanderWindow रद्द Automatically expand files ExpanderPreferences अपने आप फाइलें विस्तार करें Creating listing for '%s' ExpanderWindow '%s' के लिए सूचीकरण बना रहा है Continue ExpanderWindow जारी रखें -The destination folder does not exist. ExpanderWindow गंतव्य फ़ोल्डर मौजूद नहीं है. Cancel ExpanderPreferences रद्द करे Are you sure you want to stop expanding this\narchive? The expanded items may not be complete. ExpanderWindow आप सुनिश्चित हैं कि आप इस आरकाइव के विस्तार को बंद करना चाहते हैं?\nविस्तारित आइटम सम्भव्तीय पूरे नहीं हो Select DirectoryFilePanel चुनें diff --git a/data/catalogs/apps/expander/hu.catkeys b/data/catalogs/apps/expander/hu.catkeys index a557ac38bd..27c5bbfba7 100644 --- a/data/catalogs/apps/expander/hu.catkeys +++ b/data/catalogs/apps/expander/hu.catkeys @@ -1,4 +1,4 @@ -1 hungarian x-vnd.Haiku-Expander 2398100010 +1 hungarian x-vnd.Haiku-Expander 2603318510 Expand ExpanderMenu Kicsomagol Close window when done expanding ExpanderPreferences A kicsomagolás végeztével zárja be az ablakot Set destination… ExpanderMenu Célmappa megadása… @@ -17,12 +17,12 @@ Automatically expand files ExpanderPreferences Fájlok automatikus kicsomagolá Creating listing for '%s' ExpanderWindow '%s' lista létrehozása Continue ExpanderWindow Folytatás Destination folder ExpanderPreferences Célmappa -The destination folder does not exist. ExpanderWindow A célmappa nem létezik. Other ExpanderPreferences Egyéb Cancel ExpanderPreferences Mégse Expansion ExpanderPreferences Kicsomagolás Are you sure you want to stop expanding this\narchive? The expanded items may not be complete. ExpanderWindow Biztosan le szeretné állítani?\nA kicsomagolás még nem fejeződött be. Select DirectoryFilePanel Kiválaszt +Destination folder doesn't exist. Would you like to create it? ExpanderWindow A célmappa nem létezik. Létre szeretné hozni? Same directory as source (archive) file ExpanderPreferences A mappa amiben a forrásfájl (archívum) van Expanding '%s' ExpanderWindow '%s' kicsomagolása Settings ExpanderMenu Beállítások @@ -33,6 +33,8 @@ Show contents ExpanderWindow Tartalom megjelenítése Automatically show contents listing ExpanderPreferences Tartalom listázása automatikusan OK ExpanderPreferences Rendben Leave destination folder path empty ExpanderPreferences Hagyja üresen a célmappa útvonalát +Failed to create the destination folder. ExpanderWindow Nem sikerült létrehozni a célmappát. +Create ExpanderWindow Létrehozás The folder was either moved, renamed or not\nsupported. ExpanderWindow A mappa el lett mozgatva, át lett nevezve vagy nem\ntámogatott. The file doesn't exist ExpanderWindow A fájl nem létezik Stop ExpanderMenu Leállítás diff --git a/data/catalogs/apps/expander/ja.catkeys b/data/catalogs/apps/expander/ja.catkeys index 95dd9fe74b..26d59ec66c 100644 --- a/data/catalogs/apps/expander/ja.catkeys +++ b/data/catalogs/apps/expander/ja.catkeys @@ -1,4 +1,4 @@ -1 japanese x-vnd.Haiku-Expander 2398100010 +1 japanese x-vnd.Haiku-Expander 282517174 Expand ExpanderMenu 解凍 Close window when done expanding ExpanderPreferences 解凍終了後ウィンドウを閉じる Set destination… ExpanderMenu 解凍先を指定… @@ -17,7 +17,6 @@ Automatically expand files ExpanderPreferences 自動的にファイルを解 Creating listing for '%s' ExpanderWindow '%s' のリストを作成中 Continue ExpanderWindow 続ける Destination folder ExpanderPreferences 解凍先フォルダー -The destination folder does not exist. ExpanderWindow 解凍先フォルダーは存在しません。 Other ExpanderPreferences その他 Cancel ExpanderPreferences キャンセル Expansion ExpanderPreferences 解凍 diff --git a/data/catalogs/apps/expander/lt.catkeys b/data/catalogs/apps/expander/lt.catkeys index 3158266c82..d59a8503c7 100644 --- a/data/catalogs/apps/expander/lt.catkeys +++ b/data/catalogs/apps/expander/lt.catkeys @@ -1,4 +1,4 @@ -1 lithuanian x-vnd.Haiku-Expander 2398100010 +1 lithuanian x-vnd.Haiku-Expander 282517174 Expand ExpanderMenu Išskleisti Close window when done expanding ExpanderPreferences Viską išskleidus, užverti langą Set destination… ExpanderMenu Paskirties vieta… @@ -17,7 +17,6 @@ Automatically expand files ExpanderPreferences Automatiškai išskleisti failus Creating listing for '%s' ExpanderWindow Generuojamas „%s“ turinio sąrašas Continue ExpanderWindow Tęsti Destination folder ExpanderPreferences Paskirties aplankas -The destination folder does not exist. ExpanderWindow Paskirties aplankas neegzistuoja. Other ExpanderPreferences Kita Cancel ExpanderPreferences Atsisakyti Expansion ExpanderPreferences Išskleidimas diff --git a/data/catalogs/apps/expander/nl.catkeys b/data/catalogs/apps/expander/nl.catkeys index 561415d6af..02d38ede31 100644 --- a/data/catalogs/apps/expander/nl.catkeys +++ b/data/catalogs/apps/expander/nl.catkeys @@ -1,4 +1,4 @@ -1 dutch; flemish x-vnd.Haiku-Expander 2398100010 +1 dutch; flemish x-vnd.Haiku-Expander 282517174 Expand ExpanderMenu Uitpakken Close window when done expanding ExpanderPreferences Sluit dit venster wanneer het uitpakken klaar is Set destination… ExpanderMenu Bepaal doel… @@ -17,7 +17,6 @@ Automatically expand files ExpanderPreferences Bestanden automatisch uitpakken Creating listing for '%s' ExpanderWindow Creëren van een overzicht voor '%s' Continue ExpanderWindow Doorgaan Destination folder ExpanderPreferences Doelmap -The destination folder does not exist. ExpanderWindow De doelmap bestaat niet. Other ExpanderPreferences Andere Cancel ExpanderPreferences Annuleren Expansion ExpanderPreferences Uitpakken diff --git a/data/catalogs/apps/expander/pl.catkeys b/data/catalogs/apps/expander/pl.catkeys index b52b00d593..1af058d503 100644 --- a/data/catalogs/apps/expander/pl.catkeys +++ b/data/catalogs/apps/expander/pl.catkeys @@ -1,4 +1,4 @@ -1 polish x-vnd.Haiku-Expander 2398100010 +1 polish x-vnd.Haiku-Expander 282517174 Expand ExpanderMenu Rozpakuj Close window when done expanding ExpanderPreferences Zamknij okno po zakończeniu rozpakowywania Set destination… ExpanderMenu Wybierz miejsce docelowe… @@ -17,7 +17,6 @@ Automatically expand files ExpanderPreferences Automatycznie rozpakuj pliki Creating listing for '%s' ExpanderWindow Tworzenie listy dla '%s' Continue ExpanderWindow Kontynuuj Destination folder ExpanderPreferences Katalog docelowy -The destination folder does not exist. ExpanderWindow Folder docelowy nie istnieje. Other ExpanderPreferences Inne Cancel ExpanderPreferences Anuluj Expansion ExpanderPreferences Rozpakowywanie diff --git a/data/catalogs/apps/expander/pt_BR.catkeys b/data/catalogs/apps/expander/pt_BR.catkeys index 727b190acc..08a95f17df 100644 --- a/data/catalogs/apps/expander/pt_BR.catkeys +++ b/data/catalogs/apps/expander/pt_BR.catkeys @@ -1,4 +1,4 @@ -1 portuguese (brazil) x-vnd.Haiku-Expander 2398100010 +1 portuguese (brazil) x-vnd.Haiku-Expander 282517174 Expand ExpanderMenu Expandir Close window when done expanding ExpanderPreferences Fechar a janela quando concluída a expansão Set destination… ExpanderMenu Selecionar destino… @@ -17,7 +17,6 @@ Automatically expand files ExpanderPreferences Expandir arquivos automaticament Creating listing for '%s' ExpanderWindow Criando lista para '%s' Continue ExpanderWindow Continuar Destination folder ExpanderPreferences Pasta de destino -The destination folder does not exist. ExpanderWindow A pasta de destino não existe. Other ExpanderPreferences Outro Cancel ExpanderPreferences Cancelar Expansion ExpanderPreferences Expansão diff --git a/data/catalogs/apps/expander/ro.catkeys b/data/catalogs/apps/expander/ro.catkeys index cce308dfac..54cb144d24 100644 --- a/data/catalogs/apps/expander/ro.catkeys +++ b/data/catalogs/apps/expander/ro.catkeys @@ -1,4 +1,4 @@ -1 romanian x-vnd.Haiku-Expander 386826896 +1 romanian x-vnd.Haiku-Expander 2566211356 Expand ExpanderMenu Extinde Close window when done expanding ExpanderPreferences Închide fereastra atunci când s-a încheiat extinderea Set destination… ExpanderMenu Setează destinația… @@ -15,7 +15,6 @@ Cancel ExpanderWindow Renunță Automatically expand files ExpanderPreferences Extinde fișiere automat Creating listing for '%s' ExpanderWindow Se creează enumerarea pentru „%s” Continue ExpanderWindow Continuă -The destination folder does not exist. ExpanderWindow Dosarul destinație nu există. Cancel ExpanderPreferences Anulează Are you sure you want to stop expanding this\narchive? The expanded items may not be complete. ExpanderWindow Ești sigur că vrei să oprești extinderea\nacestei arhive? Elementele dezarhivate pot fi incomplete. Select DirectoryFilePanel Selectează diff --git a/data/catalogs/apps/expander/ru.catkeys b/data/catalogs/apps/expander/ru.catkeys index 84fea94411..aa4cfd4bbb 100644 --- a/data/catalogs/apps/expander/ru.catkeys +++ b/data/catalogs/apps/expander/ru.catkeys @@ -1,4 +1,4 @@ -1 russian x-vnd.Haiku-Expander 2398100010 +1 russian x-vnd.Haiku-Expander 282517174 Expand ExpanderMenu Распаковать Close window when done expanding ExpanderPreferences Закрывать окно после распаковки Set destination… ExpanderMenu Путь назначения для извлечения… @@ -17,7 +17,6 @@ Automatically expand files ExpanderPreferences Автоматически ра Creating listing for '%s' ExpanderWindow Создается список файлов для '%s' Continue ExpanderWindow Продолжить Destination folder ExpanderPreferences Путь для извлечения -The destination folder does not exist. ExpanderWindow Папка назначения не существует. Other ExpanderPreferences Другое Cancel ExpanderPreferences Отмена Expansion ExpanderPreferences Извлечение diff --git a/data/catalogs/apps/expander/sk.catkeys b/data/catalogs/apps/expander/sk.catkeys index 8c8e2ca517..443c1abe90 100644 --- a/data/catalogs/apps/expander/sk.catkeys +++ b/data/catalogs/apps/expander/sk.catkeys @@ -1,4 +1,4 @@ -1 slovak x-vnd.Haiku-Expander 2398100010 +1 slovak x-vnd.Haiku-Expander 282517174 Expand ExpanderMenu Rozbaliť Close window when done expanding ExpanderPreferences Zatvoriť okno po dokončení rozbaľovania Set destination… ExpanderMenu Nastaviť cieľ… @@ -17,7 +17,6 @@ Automatically expand files ExpanderPreferences Automaticky rozbaľovať súbory Creating listing for '%s' ExpanderWindow Vytvára sa zoznam pre „%s“ Continue ExpanderWindow Pokračovať Destination folder ExpanderPreferences Cieľový priečinok -The destination folder does not exist. ExpanderWindow Cieľový priečinok neexistuje. Other ExpanderPreferences Ďalšie Cancel ExpanderPreferences Zrušiť Expansion ExpanderPreferences Rozpínanie diff --git a/data/catalogs/apps/expander/sv.catkeys b/data/catalogs/apps/expander/sv.catkeys index 451963d799..18d1709cad 100644 --- a/data/catalogs/apps/expander/sv.catkeys +++ b/data/catalogs/apps/expander/sv.catkeys @@ -1,4 +1,4 @@ -1 swedish x-vnd.Haiku-Expander 2398100010 +1 swedish x-vnd.Haiku-Expander 282517174 Expand ExpanderMenu Expandera Close window when done expanding ExpanderPreferences Stäng fönstret när expandering är klar Set destination… ExpanderMenu Ange mål… @@ -17,7 +17,6 @@ Automatically expand files ExpanderPreferences Expandera filer automatiskt Creating listing for '%s' ExpanderWindow Skapar innehållslista för '%s' Continue ExpanderWindow Fortsätt Destination folder ExpanderPreferences Målmapp -The destination folder does not exist. ExpanderWindow Målmappen existerar inte. Other ExpanderPreferences Andra Cancel ExpanderPreferences Avbryt Expansion ExpanderPreferences Expansion diff --git a/data/catalogs/apps/expander/uk.catkeys b/data/catalogs/apps/expander/uk.catkeys index fcf342766a..edf14bcd81 100644 --- a/data/catalogs/apps/expander/uk.catkeys +++ b/data/catalogs/apps/expander/uk.catkeys @@ -1,4 +1,4 @@ -1 ukrainian x-vnd.Haiku-Expander 386826896 +1 ukrainian x-vnd.Haiku-Expander 2566211356 Expand ExpanderMenu Розпакувати Close window when done expanding ExpanderPreferences Закрити вікно після розпаковки Set destination… ExpanderMenu Встановити ціль… @@ -15,7 +15,6 @@ Cancel ExpanderWindow Відмінити Automatically expand files ExpanderPreferences Автоматично розпакувати файли Creating listing for '%s' ExpanderWindow Створення списку для '%s' Continue ExpanderWindow Продовжити -The destination folder does not exist. ExpanderWindow Цільова папка відсутня. Cancel ExpanderPreferences Відміна Are you sure you want to stop expanding this\narchive? The expanded items may not be complete. ExpanderWindow Ви впевнені, що хочете зупинити розпаковку цього архіва? Розпаковка елементів може бути неповною. Select DirectoryFilePanel Вибрати diff --git a/data/catalogs/apps/expander/zh_Hans.catkeys b/data/catalogs/apps/expander/zh_Hans.catkeys index a5ddf32087..f66069ca8c 100644 --- a/data/catalogs/apps/expander/zh_Hans.catkeys +++ b/data/catalogs/apps/expander/zh_Hans.catkeys @@ -1,4 +1,4 @@ -1 english x-vnd.Haiku-Expander 2398100010 +1 english x-vnd.Haiku-Expander 282517174 Expand ExpanderMenu 解压缩 Close window when done expanding ExpanderPreferences 完成解压后,关闭窗口。 Set destination… ExpanderMenu 目标文件… @@ -17,7 +17,6 @@ Automatically expand files ExpanderPreferences 自动解压文件 Creating listing for '%s' ExpanderWindow 为 '%s' 创建列表 Continue ExpanderWindow 继续 Destination folder ExpanderPreferences 目标目录 -The destination folder does not exist. ExpanderWindow 目标文件夹不存在。 Other ExpanderPreferences 其他 Cancel ExpanderPreferences 取消 Expansion ExpanderPreferences 展开 diff --git a/data/catalogs/apps/powerstatus/hu.catkeys b/data/catalogs/apps/powerstatus/hu.catkeys index e563e9ed39..8898164639 100644 --- a/data/catalogs/apps/powerstatus/hu.catkeys +++ b/data/catalogs/apps/powerstatus/hu.catkeys @@ -1,37 +1,37 @@ 1 hungarian x-vnd.Haiku-PowerStatus 3224068645 -Design capacity low warning: PowerStatus Figyelmeztetés alacsony tervezett kapacitásnál: +Design capacity low warning: PowerStatus Figyelmeztetés alacsony tervezett kapacitásnál: Show percent PowerStatus Százalék megjelenítése -Design capacity: PowerStatus Tervezett kapacitás: - mW PowerStatus mW -Type: PowerStatus Típus: +Design capacity: PowerStatus Tervezett kapacitás: + mW PowerStatus mW +Type: PowerStatus Típus: non-rechargeable PowerStatus Nem újratölthető Empty battery slot PowerStatus Nincs akku behelyezve - mV PowerStatus mV + mV PowerStatus mV Run in window PowerStatus Futtatás ablakban PowerStatus System name Energiaállapot - mWh PowerStatus mWh + mWh PowerStatus mWh Battery info… PowerStatus Akku infó… Damaged battery PowerStatus Sérült akku Show time PowerStatus Idő kijelzése -Last full charge: PowerStatus Utolsó teljes feltöltés: +Last full charge: PowerStatus Utolsó teljes feltöltés: Battery unused PowerStatus Használatlan akku Extended battery info PowerStatus Bővebb akku információ - mA PowerStatus mA -Current rate: PowerStatus Jelenlegi gyakoriság: + mA PowerStatus mA +Current rate: PowerStatus Jelenlegi gyakoriság: discharging PowerStatus használatban Show text label PowerStatus Szöveges címke megjelenítése About… PowerStatus Névjegy… -Model number: PowerStatus Típusszám: +Model number: PowerStatus Típusszám: Install in Deskbar PowerStatus Telepítés az Asztalsávra - mAh PowerStatus mAh -Capacity: PowerStatus Kapacitás: + mAh PowerStatus mAh +Capacity: PowerStatus Kapacitás: Battery discharging PowerStatus Akku használatban -Serial number: PowerStatus Szériaszám: -Capacity granularity 1: PowerStatus Kapacitás granularitás 1: -OEM info: PowerStatus OEM információk: -Design voltage: PowerStatus Tervezett feszültség: +Serial number: PowerStatus Szériaszám: +Capacity granularity 1: PowerStatus Kapacitás granularitás 1: +OEM info: PowerStatus OEM információk: +Design voltage: PowerStatus Tervezett feszültség: Battery charging PowerStatus Akku töltődik -Design capacity warning: PowerStatus Tervezett kapacitás figyelmeztetés: +Design capacity warning: PowerStatus Tervezett kapacitás figyelmeztetés: Battery info PowerStatus Akku infó Quit PowerStatus Kilépés rechargeable PowerStatus újratölthető @@ -39,6 +39,6 @@ charging PowerStatus töltődik You can run PowerStatus in a window or install it in the Deskbar. PowerStatus Futatthatja az Energiaállapotot egy ablakban, vagy az Asztalsávra telepítheti azt. Power status box PowerStatus Energiaállapot doboza Show status icon PowerStatus Állapotikon megjelenítése -Capacity granularity 2: PowerStatus Kapacitás granularitás 2: +Capacity granularity 2: PowerStatus Kapacitás granularitás 2: Technology: PowerStatus Technológia: no battery PowerStatus nincs akku From 5eb2d70fa786defcfd712bcf9d596af01288a08f Mon Sep 17 00:00:00 2001 From: Vlad Slepukhin Date: Sat, 8 Dec 2012 08:07:32 +0100 Subject: [PATCH 11/57] Preserve font size on changing font family of selection. This task was completed during GCI 2012 Fixes #6453 Signed-off-by: Siarzhuk Zharski --- src/apps/stylededit/StyledEditWindow.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/apps/stylededit/StyledEditWindow.cpp b/src/apps/stylededit/StyledEditWindow.cpp index 3ba782cd57..7b8ddd7fdf 100644 --- a/src/apps/stylededit/StyledEditWindow.cpp +++ b/src/apps/stylededit/StyledEditWindow.cpp @@ -1599,7 +1599,20 @@ StyledEditWindow::_SetFontStyle(const char* fontFamily, const char* fontStyle) font.SetFace(face); - fTextView->SetFontAndColor(&font); + int32 start = 0, finish = 0; + fTextView->GetSelection(&start, &finish); + + if (start != finish) { + text_run_array* runArray = fTextView->RunArray(start, finish);; + + for (int i = 0; i < runArray->count; i++) { + runArray->runs[i].font.SetFamilyAndStyle(fontFamily, fontStyle); + runArray->runs[i].font.SetFace(face); + } + + fTextView->SetRunArray(start, finish, runArray); + } else + fTextView->SetFontAndColor(&font); BMenuItem* superItem; superItem = fFontMenu->FindItem(fontFamily); From 6993d26c7abec2a48764a85260b0190933dd179b Mon Sep 17 00:00:00 2001 From: Siarzhuk Zharski Date: Sat, 8 Dec 2012 09:43:56 +0100 Subject: [PATCH 12/57] Revert of hrev44979 and real fix for #6453 Thanks Stefano Ceccherini for opening my eyes. ;-) --- src/apps/stylededit/StyledEditWindow.cpp | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/apps/stylededit/StyledEditWindow.cpp b/src/apps/stylededit/StyledEditWindow.cpp index 7b8ddd7fdf..6df62ebb76 100644 --- a/src/apps/stylededit/StyledEditWindow.cpp +++ b/src/apps/stylededit/StyledEditWindow.cpp @@ -1599,20 +1599,7 @@ StyledEditWindow::_SetFontStyle(const char* fontFamily, const char* fontStyle) font.SetFace(face); - int32 start = 0, finish = 0; - fTextView->GetSelection(&start, &finish); - - if (start != finish) { - text_run_array* runArray = fTextView->RunArray(start, finish);; - - for (int i = 0; i < runArray->count; i++) { - runArray->runs[i].font.SetFamilyAndStyle(fontFamily, fontStyle); - runArray->runs[i].font.SetFace(face); - } - - fTextView->SetRunArray(start, finish, runArray); - } else - fTextView->SetFontAndColor(&font); + fTextView->SetFontAndColor(&font, B_FONT_FAMILY_AND_STYLE); BMenuItem* superItem; superItem = fFontMenu->FindItem(fontFamily); From abe053eb0332e522bb8be19b1dcbaadc1fd66250 Mon Sep 17 00:00:00 2001 From: Alex Smith Date: Sat, 8 Dec 2012 12:49:15 +0000 Subject: [PATCH 13/57] Added missing libbsd.so and a bunch of optional packages for x86_64 from scottmc. --- build/jam/Haiku64Image | 4 +- build/jam/OptionalPackages | 82 +++++++++++++++++++++++++------------- 2 files changed, 56 insertions(+), 30 deletions(-) diff --git a/build/jam/Haiku64Image b/build/jam/Haiku64Image index b7935ac47c..88936e7aab 100644 --- a/build/jam/Haiku64Image +++ b/build/jam/Haiku64Image @@ -47,8 +47,8 @@ SYSTEM_PREFERENCES = Appearance Backgrounds Deskbar FileTypes SYSTEM_DEMOS = Sudoku ; -SYSTEM_LIBS = libbe.so libbnetapi.so libdebug.so libmedia.so libnetwork.so - libroot.so libroot-addon-icu.so +SYSTEM_LIBS = libbe.so libbsd.so libbnetapi.so libdebug.so libmedia.so + libnetwork.so libroot.so libroot-addon-icu.so libtextencoding.so libtiff.so libtracker.so libtranslation.so $(HAIKU_SHARED_LIBSTDC++) $(HAIKU_SHARED_LIBSUPC++) ; diff --git a/build/jam/OptionalPackages b/build/jam/OptionalPackages index c48b94b274..2cd405b284 100644 --- a/build/jam/OptionalPackages +++ b/build/jam/OptionalPackages @@ -531,9 +531,7 @@ if [ IsOptionalHaikuImagePackageAdded Colors! ] { # Ctags if [ IsOptionalHaikuImagePackageAdded Ctags ] { - if $(TARGET_ARCH) != x86 { - Echo "No optional package Ctags available for $(TARGET_ARCH)" ; - } else { + if $(TARGET_ARCH) = x86 { if $(HAIKU_GCC_VERSION[1]) >= 4 { InstallOptionalHaikuImagePackage ctags-5.8-r1a4-x86-gcc4-2012-08-30.zip @@ -545,6 +543,13 @@ if [ IsOptionalHaikuImagePackageAdded Ctags ] { : $(baseURL)/ctags-5.8-r1a4-x86-gcc2-2012-09-03.zip : : true ; } + } else if $(TARGET_ARCH) = x86_64 { + InstallOptionalHaikuImagePackage + ctags-5.8-x86_64-2012-12-08.zip + : $(baseURL)/ctags-5.8-x86_64-2012-12-08.zip + : : true ; + } else { + Echo "No optional package Ctags available for $(TARGET_ARCH)" ; } } @@ -996,9 +1001,7 @@ if [ IsOptionalHaikuImagePackageAdded Droid ] { # Expat if [ IsOptionalHaikuImagePackageAdded Expat ] { - if $(TARGET_ARCH) != x86 { - Echo "No optional package Expat available for $(TARGET_ARCH)" ; - } else { + if $(TARGET_ARCH) = x86 { if $(HAIKU_GCC_VERSION[1]) >= 4 { InstallOptionalHaikuImagePackage expat-2.0.1-r1a4-x86-gcc4-2012-08-30.zip @@ -1010,6 +1013,13 @@ if [ IsOptionalHaikuImagePackageAdded Expat ] { : $(baseURL)/expat-2.0.1-r1a4-x86-gcc2-2012-08-28.zip : : true ; } + } else if $(TARGET_ARCH) = x86_64 { + InstallOptionalHaikuImagePackage + expat-2.0.1-x86_64-2012-12-08.zip + : $(baseURL)/expat-2.0.1-x86_64-2012-12-08.zip + : : true ; + } else { + Echo "No optional package Expat available for $(TARGET_ARCH)" ; } } @@ -1334,9 +1344,7 @@ if [ IsOptionalHaikuImagePackageAdded Libmng ] { # LibXML2 if [ IsOptionalHaikuImagePackageAdded LibXML2 ] { - if $(TARGET_ARCH) != x86 { - Echo "No optional package LibXML2 available for $(TARGET_ARCH)" ; - } else { + if $(TARGET_ARCH) = x86 { if $(HAIKU_GCC_VERSION[1]) >= 4 { InstallOptionalHaikuImagePackage libxml2-2.8.0-r1a4-x86-gcc4-2012-08-28.zip @@ -1346,6 +1354,12 @@ if [ IsOptionalHaikuImagePackageAdded LibXML2 ] { libxml2-2.8.0-r1a4-x86-gcc2-2012-08-30.zip : $(baseURL)/libxml2-2.8.0-r1a4-x86-gcc2-2012-08-30.zip ; } + } else if $(TARGET_ARCH) = x86_64 { + InstallOptionalHaikuImagePackage + libxml2-2.8.0-x86_64-2012-12-08.zip + : $(baseURL)/libxml2-2.8.0-x86_64-2012-12-08.zip ; + } else { + Echo "No optional package LibXML2 available for $(TARGET_ARCH)" ; } } @@ -1622,23 +1636,29 @@ if [ IsOptionalHaikuImagePackageAdded OpenSSL ] { # P7zip if [ IsOptionalHaikuImagePackageAdded P7zip ] { - if $(TARGET_ARCH) != x86 { - Echo "No optional package P7zip available for $(TARGET_ARCH)" ; - } else { - if $(HAIKU_GCC_VERSION[1]) >= 4 { + if $(TARGET_ARCH) = x86 || $(TARGET_ARCH) = x86_64 { + if $(TARGET_ARCH) = x86 { + if $(HAIKU_GCC_VERSION[1]) >= 4 { + InstallOptionalHaikuImagePackage + p7zip-9.20.1-r1a4-x86-gcc4-2012-08-30.zip + : $(baseURL)/p7zip-9.20.1-r1a4-x86-gcc4-2012-08-30.zip ; + } else { + InstallOptionalHaikuImagePackage + p7zip-9.20.1-r1a4-x86-gcc2-2012-08-29.zip + : $(baseURL)/p7zip-9.20.1-r1a4-x86-gcc2-2012-08-29.zip ; + } + } else if $(TARGET_ARCH) = x86_64 { InstallOptionalHaikuImagePackage - p7zip-9.20.1-r1a4-x86-gcc4-2012-08-30.zip - : $(baseURL)/p7zip-9.20.1-r1a4-x86-gcc4-2012-08-30.zip ; - } else { - InstallOptionalHaikuImagePackage - p7zip-9.20.1-r1a4-x86-gcc2-2012-08-29.zip - : $(baseURL)/p7zip-9.20.1-r1a4-x86-gcc2-2012-08-29.zip ; + p7zip-9.20.1-x86_64-2012-12-08.zip + : $(baseURL)/p7zip-9.20.1-x86_64-2012-12-08.zip ; } + AddExpanderRuleToHaikuImage "application/x-7z-compressed" : .7z : "7za l \\0045s" : "7za x -y \\0045s" ; - + } else { + Echo "No optional package P7zip available for $(TARGET_ARCH)" ; } } @@ -2205,15 +2225,21 @@ if [ IsOptionalHaikuImagePackageAdded XZ-Utils ] { # Yasm if [ IsOptionalHaikuImagePackageAdded Yasm ] { - if $(TARGET_ARCH) != x86 { - Echo "No optional package Yasm available for $(TARGET_ARCH)" ; - } else if $(HAIKU_GCC_VERSION[1]) >= 4 { + if $(TARGET_ARCH) = x86 { + if $(HAIKU_GCC_VERSION[1]) >= 4 { + InstallOptionalHaikuImagePackage + yasm-1.2.0-r1a4-x86-gcc4-2012-08-29.zip + : $(baseURL)/yasm-1.2.0-r1a4-x86-gcc4-2012-08-29.zip ; + } else { + InstallOptionalHaikuImagePackage + yasm-1.2.0-r1a4-x86-gcc2-2012-08-27.zip + : $(baseURL)/yasm-1.2.0-r1a4-x86-gcc2-2012-08-27.zip ; + } + } else if $(TARGET_ARCH) = x86_64 { InstallOptionalHaikuImagePackage - yasm-1.2.0-r1a4-x86-gcc4-2012-08-29.zip - : $(baseURL)/yasm-1.2.0-r1a4-x86-gcc4-2012-08-29.zip ; + yasm-1.2.0-x86_64-2012-12-08.zip + : $(baseURL)/yasm-1.2.0-x86_64-2012-12-08.zip ; } else { - InstallOptionalHaikuImagePackage - yasm-1.2.0-r1a4-x86-gcc2-2012-08-27.zip - : $(baseURL)/yasm-1.2.0-r1a4-x86-gcc2-2012-08-27.zip ; + Echo "No optional package Yasm available for $(TARGET_ARCH)" ; } } From 1eccdc25feba35a3f3312dd18e014a883e99ef1d Mon Sep 17 00:00:00 2001 From: John Scipione Date: Sat, 8 Dec 2012 15:19:15 -0500 Subject: [PATCH 14/57] Increase the font size options in Terminal Sizes range from 8 to 36 but not all sizes are represented. The progression is not linear, the font size increases first by 1, then 2, and finally by 4. Works by keying command-(plus)/command-(minus) or selecting from Font size menu, or from selecting from Font menu in Terminal settings. If you alter the settings file to put in some other font size it should still work, but the menu item won't be checked. Fixes #8849 --- src/apps/terminal/AppearPrefView.cpp | 4 ++- src/apps/terminal/TermWindow.cpp | 38 ++++++++++++++++++++-------- 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/src/apps/terminal/AppearPrefView.cpp b/src/apps/terminal/AppearPrefView.cpp index 0e548c439b..78b0cfcad0 100644 --- a/src/apps/terminal/AppearPrefView.cpp +++ b/src/apps/terminal/AppearPrefView.cpp @@ -468,7 +468,9 @@ AppearancePrefView::_MakeFontSizeMenu(const char* label, uint32 command, menu->SetRadioMode(true); menu->SetLabelFromMarked(false); - int32 sizes[] = {9, 10, 11, 12, 14, 16, 18, 0}; + int32 sizes[] = { + 8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 28, 32, 36, 0 + }; bool found = false; diff --git a/src/apps/terminal/TermWindow.cpp b/src/apps/terminal/TermWindow.cpp index d63d0f4ac4..cd2701fdf6 100644 --- a/src/apps/terminal/TermWindow.cpp +++ b/src/apps/terminal/TermWindow.cpp @@ -59,6 +59,9 @@ const static int32 kMaxTabs = 6; const static int32 kTermViewOffset = 3; +const static int32 kMinimumFontSize = 8; +const static int32 kMaximumFontSize = 36; + // messages constants static const uint32 kNewTab = 'NTab'; static const uint32 kCloseView = 'ClVw'; @@ -403,8 +406,8 @@ TermWindow::MenusBeginning() float size = font.Size(); - fDecreaseFontSizeMenuItem->SetEnabled(size > 9); - fIncreaseFontSizeMenuItem->SetEnabled(size < 18); + fDecreaseFontSizeMenuItem->SetEnabled(size > kMinimumFontSize); + fIncreaseFontSizeMenuItem->SetEnabled(size < kMaximumFontSize); BWindow::MenusBeginning(); } @@ -1011,16 +1014,27 @@ TermWindow::MessageReceived(BMessage *message) _ActiveTermView()->GetTermFont(&font); float size = font.Size(); - if (message->what == kIncreaseFontSize) - size < 12 ? size += 1 : size += 2; - else - size < 14 ? size -= 1 : size -= 2; + if (message->what == kIncreaseFontSize) { + if (size < 12) + size += 1; + else if (size < 24) + size += 2; + else + size += 4; + } else { + if (size <= 12) + size -= 1; + else if (size <= 24) + size -= 2; + else + size -= 4; + } // constrain the font size - if (size < 9) - size = 9; - if (size > 18) - size = 18; + if (size < kMinimumFontSize) + size = kMinimumFontSize; + if (size > kMaximumFontSize) + size = kMaximumFontSize; // mark the font size menu item for (int32 i = 0; i < fFontSizeMenu->CountItems(); i++) { @@ -1655,7 +1669,9 @@ TermWindow::_MakeFontSizeMenu(uint32 command, uint8 defaultSize) if (menu == NULL) return NULL; - int32 sizes[] = {9, 10, 11, 12, 14, 16, 18, 0}; + int32 sizes[] = { + 8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 28, 32, 36, 0 + }; bool found = false; From a154553c0bb0d718344d13fa645dbd8e8f8583ed Mon Sep 17 00:00:00 2001 From: Janus Date: Fri, 30 Nov 2012 21:52:35 +0000 Subject: [PATCH 15/57] Fix #8963. Fixes Sounds focus cycling using Tab Signed-off-by: Matt Madia --- src/preferences/sounds/HEventList.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/preferences/sounds/HEventList.cpp b/src/preferences/sounds/HEventList.cpp index 8c178ffd29..ad971f4014 100644 --- a/src/preferences/sounds/HEventList.cpp +++ b/src/preferences/sounds/HEventList.cpp @@ -57,7 +57,7 @@ HEventRow::Remove(const char* type) HEventList::HEventList(const char* name) : - BColumnListView(name, 0, B_PLAIN_BORDER, true), + BColumnListView(name, B_NAVIGABLE, B_PLAIN_BORDER, true), fType(NULL) { AddColumn(new BStringColumn(B_TRANSLATE("Event"), 180, 50, 500, From 0ce4c23d22fae64d10e5575687490fbdf8ee52b8 Mon Sep 17 00:00:00 2001 From: luroh Date: Sun, 14 Oct 2012 22:56:43 +0200 Subject: [PATCH 16/57] Bump vmx files to virtualHW.version = "6", to allow USB 2.0 Signed-off-by: Matt Madia --- 3rdparty/vmware/haiku-alpha.vmx | 2 +- 3rdparty/vmware/haiku-nightly.vmx | 2 +- 3rdparty/vmware/haiku.vmx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/3rdparty/vmware/haiku-alpha.vmx b/3rdparty/vmware/haiku-alpha.vmx index 6df7597e36..e50c2f7315 100644 --- a/3rdparty/vmware/haiku-alpha.vmx +++ b/3rdparty/vmware/haiku-alpha.vmx @@ -1,6 +1,6 @@ #!/usr/bin/vmware config.version = "8" -virtualHW.version = "3" +virtualHW.version = "6" MemAllowAutoScaleDown = "false" MemTrimRate = "-1" diff --git a/3rdparty/vmware/haiku-nightly.vmx b/3rdparty/vmware/haiku-nightly.vmx index 80ef6e159a..6f331d8098 100644 --- a/3rdparty/vmware/haiku-nightly.vmx +++ b/3rdparty/vmware/haiku-nightly.vmx @@ -1,6 +1,6 @@ #!/usr/bin/vmware config.version = "8" -virtualHW.version = "3" +virtualHW.version = "6" MemAllowAutoScaleDown = "false" MemTrimRate = "-1" diff --git a/3rdparty/vmware/haiku.vmx b/3rdparty/vmware/haiku.vmx index b6b1119674..67774c668e 100644 --- a/3rdparty/vmware/haiku.vmx +++ b/3rdparty/vmware/haiku.vmx @@ -1,6 +1,6 @@ #!/usr/bin/vmware config.version = "8" -virtualHW.version = "3" +virtualHW.version = "6" MemAllowAutoScaleDown = "false" MemTrimRate = "-1" From e01243816e799220d359622b5130a31de4488e37 Mon Sep 17 00:00:00 2001 From: Jeremy Clifford Date: Sat, 25 Aug 2012 15:40:41 +0100 Subject: [PATCH 17/57] Add Geforce 7900 GS to nvidia driver & accelerant. Tested with DELL U2312UM 1920x1080x32 @60Hz on gcc2hybrid nightly 44579. Signed-off-by: Matt Madia --- src/add-ons/accelerants/nvidia/engine/nv_general.c | 1 + src/add-ons/kernel/drivers/graphics/nvidia/driver.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/add-ons/accelerants/nvidia/engine/nv_general.c b/src/add-ons/accelerants/nvidia/engine/nv_general.c index 59ca452208..4dc24e673c 100644 --- a/src/add-ons/accelerants/nvidia/engine/nv_general.c +++ b/src/add-ons/accelerants/nvidia/engine/nv_general.c @@ -900,6 +900,7 @@ status_t nv_general_powerup() break; case 0x029010de: /* Nvidia Geforce 7900 GTX */ case 0x029110de: /* Nvidia Geforce 7900 GT */ + case 0x029210de: /* Nvidia Geforce 7900 GS */ case 0x029310de: /* Nvidia Geforce 7900 GX2 */ si->ps.card_type = G71; si->ps.card_arch = NV40A; diff --git a/src/add-ons/kernel/drivers/graphics/nvidia/driver.c b/src/add-ons/kernel/drivers/graphics/nvidia/driver.c index 6f18ac995f..9420b76c43 100644 --- a/src/add-ons/kernel/drivers/graphics/nvidia/driver.c +++ b/src/add-ons/kernel/drivers/graphics/nvidia/driver.c @@ -256,6 +256,7 @@ static uint16 nvidia_device_list[] = { 0x028c, /* Nvidia Quadro4 700 GoGL */ 0x0290, /* Nvidia Geforce 7900 GTX */ 0x0291, /* Nvidia Geforce 7900 GT */ + 0x0292, /* Nvidia Geforce 7900 GS */ 0x0293, /* Nvidia Geforce 7900 GX2 */ 0x0294, /* Nvidia Geforce 7950 GX2 */ 0x0295, /* Nvidia Geforce 7950 GT */ From a3674601c04675b28aa3fcaf4101ca361d021d9c Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sun, 9 Dec 2012 03:44:16 +0100 Subject: [PATCH 18/57] HelperRules: Add FSetConditionsHold A rule to check simple element containment conditions on sets. --- build/jam/HelperRules | 56 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/build/jam/HelperRules b/build/jam/HelperRules index 3d1efce667..5cce26dc7d 100644 --- a/build/jam/HelperRules +++ b/build/jam/HelperRules @@ -96,6 +96,62 @@ rule FSplitPath return $(components) ; } + +rule FSetConditionsHold conditions : set +{ + # FSetConditionsHold : ; + # Checks whether the conditions are satisfied by the list of + # elements and returns a respective result (if so: "1", if not: empty + # list). The conditions are satisfied when is not empty and + # * none of the negative conditions it contains hold and + # * if contains any positive conditions, at least one one of + # those holds. + # A positive condition is an element not starting with a "!". It holds when + # the element is contained in . + # A negative condition is an element that starts with a "!". It holds when + # the string resulting from removing the leading "!" is not contained in + # . + # + # - The list of conditions. + # - The elements against which the conditions are tested. + # + # Examples: + # For set { a b c } the following conditions hold: + # { a }, { a d }, { !d }, { !d !e }, { a !d }, { b !e !f } + # The following conditions don't hold: + # { }, { d }, { d e }, { !a }, { !a b }, { !d e } { a b !c !d } + + local hasPositive ; + local hasNegative ; + local positiveMatch ; + local condition ; + for condition in $(conditions) { + switch $(condition) { + case !* : + { + hasNegative = 1 ; + condition = [ Match "!(.*)" : $(condition) ] ; + if $(condition) in $(set) { + return ; + } + } + case * : + { + hasPositive = 1 ; + if $(condition) in $(set) { + positiveMatch = 1 ; + } + } + } + } + + if $(hasPositive) { + return $(positiveMatch) ; + } + return $(hasNegative) ; +} + + rule SetPlatformCompatibilityFlagVariables { # SetPlatformCompatibilityFlagVariables : From ffa0014b8e5fcb12082546572d21e50ef4fd187a Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sun, 9 Dec 2012 03:46:26 +0100 Subject: [PATCH 19/57] MiscRule: Add new rules to deal with build features * EnableBuildFeatures: Enables build features. * FIsBuildFeatureEnabled: Checks whether a build feature is enabled. * FMatchesBuildFeatures: Checks more complex build feature specifications. * FFilterByBuildFeatures: Filters lists annotated with build feature specifications. --- build/jam/MiscRules | 163 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 163 insertions(+) diff --git a/build/jam/MiscRules b/build/jam/MiscRules index 973c368e08..32195453f9 100644 --- a/build/jam/MiscRules +++ b/build/jam/MiscRules @@ -417,3 +417,166 @@ rule DefineBuildProfile name : type : path { return 1 ; } + + +# pragma mark - Build Features + + +rule FIsBuildFeatureEnabled feature +{ + # FIsBuildFeatureEnabled ; + # Returns whether the given build feature is enabled (if so: "1", + # if not: empty list). + # + # - The name of the build feature (all lower case). + + if $(feature) in $(HAIKU_BUILD_FEATURES) { + return 1 ; + } + + return ; +} + + +rule FMatchesBuildFeatures specification +{ + # FMatchesBuildFeatures ; + # Returns whether the given build feature specification + # holds. consists of positive and negative build feature + # conditions. Conditions can be individual list elements and multiple + # conditions can be joined, separated by ",", in a single list element. The + # effect is the same; they are considered as single set of conditions. + # A positive condition does not start with a "!". It holds when the build + # feature named by the element is enabled. + # A negative condition starts with a "!". It holds when the build feature + # named by the string resulting from removing the leading "!" is not + # enabled. + # holds when it is not empty and + # * none of the negative conditions it contains hold and + # * if it contains any positive conditions, at least one one of them holds. + # + # - The build feature specification. A list of individual + # conditions or conditions joined by ",". + + local splitSpecification ; + local element ; + for element in $(specification) { + splitSpecification += [ FSplitString $(element) : "," ] ; + } + return [ FSetConditionsHold $(splitSpecification) + : $(HAIKU_BUILD_FEATURES) ] ; +} + + +rule FFilterByBuildFeatures list +{ + # FFilterByBuildFeatures ; + # Filters the list annotated by build feature specifications and returns the + # resulting list. The list can be annotated in two different ways: + # * A single list element can be annotated by appending "@" + # to it, with being a build feature specification (a + # single comma-separated string). The element appears in the resulting + # list, only if holds. + # * A sublist can be annotated by enclosing it in " @{" (two + # separate list elements) and "}@", with being a build + # feature specification (a single comma-separated string). The enclosed + # sublist appears in the resulting list, only if holds. + # The sublist annotations can be nested. The annotations themselves don't + # appear in the resulting list. + # + # - A list annotated with build feature specifications. + + local filteredList ; + + # Since we must look ahead one element to be able to decide whether an + # element is a regular list element or a features specification for a + # subsequent "@{". Hence we always process an element other than "@{" and + # "}@" in the next iteration. We append a dummy element to the list so we + # don't need special handling for the last element. + local evaluationStack = 1 ; + local previousElement ; + local element ; + for element in $(list) dummy { + local stackTop = $(evaluationStack[1]) ; + local processElement = $(previousElement) ; + switch $(element) { + case }@ : + { + # Pop the topmost specificaton off the stack. + evaluationStack = $(evaluationStack[2-]) ; + if ! $(evaluationStack) { + Exit "FFilterByBuildFeatures: Unbalanced @( in: " $(list) ; + } + + processElement = $(previousElement) ; + previousElement = ; + } + case @{ : + { + if ! $(previousElement) { + Exit "FFilterByBuildFeatures: No feature specification" + "after )@ in: " $(list) ; + } + + if $(evaluationStack[1]) = 1 + && [ FMatchesBuildFeatures $(previousElement) ] { + evaluationStack = 1 $(evaluationStack) ; + } else { + evaluationStack = 0 $(evaluationStack) ; + } + + processElement = ; + previousElement = ; + } + case * : + { + processElement = $(previousElement) ; + previousElement = $(element) ; + } + } + + if $(processElement) && $(stackTop) = 1 { + local splitElement = [ Match "(.*)@([^@]*)" : $(processElement) ] ; + if $(splitElement) { + if [ FMatchesBuildFeatures $(splitElement[2]) ] { + filteredList += $(splitElement[1]) ; + } + } else { + filteredList += $(processElement) ; + } + } + } + + if $(evaluationStack[2-]) { + Exit "FFilterByBuildFeatures: Unbalanced )@ in: " $(list) ; + } + + return $(filteredList) ; +} + + +rule EnableBuildFeatures features : specification +{ + # EnableBuildFeatures : ; + # Enables the build features , if the build features specification + # holds. If is omitted, the features are + # enabled unconditionally. + # The rule enables a build feature by adding its given lower case name to + # the build variable HAIKU_BUILD_FEATURES and defining a build variable + # HAIKU_BUILD_FEATURE__ENABLED ( being the upper case name + # of the build feature) to "1". + # + # - A list of build feature names (lower case). + # - An optional build features specification (cf. + # FMatchesBuildFeatures). + + if ! $(specification) + || [ FMatchesBuildFeatures $(specification) + : $(HAIKU_BUILD_FEATURES) ] { + local feature ; + for feature in $(features) { + HAIKU_BUILD_FEATURES += $(feature) ; + HAIKU_BUILD_FEATURE_$(feature:U)_ENABLED = 1 ; + } + } +} From 33c254876cb7daf07831ee896efba3c5364915a7 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sun, 9 Dec 2012 03:50:31 +0100 Subject: [PATCH 20/57] ImageRules: Allow build feature annotated params in Add* rules More precisely in the rules that take multiple targets. It doesn't make that much sense e.g. for AddSymlinkTo*. --- build/jam/ImageRules | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/build/jam/ImageRules b/build/jam/ImageRules index 34f90ae832..7e27bc54e5 100644 --- a/build/jam/ImageRules +++ b/build/jam/ImageRules @@ -160,6 +160,8 @@ rule AddFilesToContainer container : directoryTokens : targets : destName : $(directoryTokens) ] ; local containerGrist = [ on $(container) return $(HAIKU_CONTAINER_GRIST) ] ; + targets = [ FFilterByBuildFeatures $(targets) ] ; + # If the image shall only be updated, we filter out all targets not marked # accordingly. if [ on $(container) return $(HAIKU_CONTAINER_UPDATE_ONLY) ] @@ -303,6 +305,8 @@ rule AddDriversToContainer container : relativeDirectoryTokens : targets local directoryTokens = system add-ons kernel drivers dev $(relativeDirectoryTokens) ; + targets = [ FFilterByBuildFeatures $(targets) ] ; + AddFilesToContainer $(container) : system add-ons kernel drivers bin : $(targets) ; @@ -335,6 +339,8 @@ rule AddNewDriversToContainer container : relativeDirectoryTokens local directoryTokens = system add-ons kernel drivers $(relativeDirectoryTokens) ; + targets = [ FFilterByBuildFeatures $(targets) ] ; + AddFilesToContainer $(container) : $(directoryTokens) : $(targets) ; } @@ -350,6 +356,8 @@ rule AddBootModuleSymlinksToContainer container : targets return ; } + targets = [ FFilterByBuildFeatures $(targets) ] ; + # add the symlinks local installTargetsVar = [ on $(container) return $(HAIKU_INSTALL_TARGETS_VAR) ] ; @@ -1272,6 +1280,8 @@ rule AddLibrariesToHaikuHybridImage directory : libs # Installs libraries with the appropriate links onto the image. # + libs = [ FFilterByBuildFeatures $(libs) ] ; + local lib ; for lib in $(libs) { local abiVersion = [ on $(lib) return $(HAIKU_LIB_ABI_VERSION) ] ; From f0cacbb32ba55d1fb4bdbd71152e57a3da3f290e Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sun, 9 Dec 2012 04:07:29 +0100 Subject: [PATCH 21/57] OptionalBuildFeatures -> BuildFeatures, make use of new rules Got rid of X86_ONLY and friends in HaikuImage, FloppyBootImage, etc. Instead we use build feature specification annotated lists with FFilterByBuildFeatures (either explicitly or implicitly where passing the list directly to the image rules). I just translated the variables to the respective annotatation in most cases, though in some cases different annotation would be more correct (e.g. for the OpenGL stuff). Provides a simple framework for addressing #3798. The interested reader may add the build features and add/adjust the annotations accordingly. --- Jamfile | 4 +- .../{OptionalBuildFeatures => BuildFeatures} | 55 ++++- build/jam/FloppyBootImage | 51 ++--- build/jam/Haiku64Image | 24 +-- build/jam/HaikuImage | 200 ++++++++---------- build/jam/NetBootArchive | 61 ++---- .../inbound_protocols/imap/Jamfile | 2 +- .../inbound_protocols/pop3/Jamfile | 2 +- .../outbound_protocols/smtp/Jamfile | 2 +- src/bin/network/wget/Jamfile | 2 +- src/kits/mail/Jamfile | 2 +- src/kits/network/libnetapi/Jamfile | 2 +- 12 files changed, 191 insertions(+), 216 deletions(-) rename build/jam/{OptionalBuildFeatures => BuildFeatures} (95%) diff --git a/Jamfile b/Jamfile index 9a446f8ad0..942323c29e 100644 --- a/Jamfile +++ b/Jamfile @@ -135,13 +135,13 @@ if $(HAIKU_ADD_OPTIONAL_PACKAGES) { } # Prepare the optional build features before parsing the Jamfile tree. -include [ FDirName $(HAIKU_BUILD_RULES_DIR) OptionalBuildFeatures ] ; +include [ FDirName $(HAIKU_BUILD_RULES_DIR) BuildFeatures ] ; # Include packages that are required by all images. AddOptionalHaikuImagePackages MandatoryPackages ; # If enabled, make sure that OpenSSL is added to the image. -if $(HAIKU_OPENSSL_ENABLED) { +if $(HAIKU_BUILD_FEATURE_OPENSSL_ENABLED) { AddOptionalHaikuImagePackages OpenSSL ; } diff --git a/build/jam/OptionalBuildFeatures b/build/jam/BuildFeatures similarity index 95% rename from build/jam/OptionalBuildFeatures rename to build/jam/BuildFeatures index 4a13618df9..3a3873a111 100644 --- a/build/jam/OptionalBuildFeatures +++ b/build/jam/BuildFeatures @@ -1,6 +1,12 @@ -# This file contains setup for features that can optionally be used for the -# build. For features that require downloading a zip file from somewhere it is -# likely the same file use for an optional package. +# This file contains setup for build features that are not available for all +# architectures/setups or that are optional for the build. For features that +# require downloading a zip file from somewhere it is likely the same file used +# for an optional package. + + +# Add the target architecture as a build feature. +EnableBuildFeatures $(HAIKU_ARCH) ; + # Detect a hybrid GCC2/GCC4 image and disable the checks for unavailable GCC4 # packages. (It does not matter if a package was built with either compiler, @@ -56,9 +62,10 @@ if $(HAIKU_BUILD_FEATURE_SSL) { : extracted-openssl ] ; - HAIKU_OPENSSL_ENABLED = 1 ; HAIKU_OPENSSL_HEADERS = [ FDirName $(HAIKU_OPENSSL_DIR) common include ] ; + + EnableBuildFeatures openssl ; } } @@ -72,7 +79,7 @@ HAIKU_ICU_PPC_PACKAGE = icu-4.8.1-ppc-2011-08-20.zip ; HAIKU_ICU_ARM_PACKAGE = icu-4.8.1.1-arm-2012-11-21.zip ; HAIKU_ICU_X86_64_PACKAGE = icu-4.8.1.1-x86_64-2012-07-30.zip ; -if $(TARGET_ARCH) = ppc || $(TARGET_ARCH) = x86 || $(TARGET_ARCH) = arm || $(TARGET_ARCH) = x86_64 { +if $(TARGET_ARCH) in arm ppc x86 x86_64 { local icu_package ; if $(TARGET_ARCH) = ppc { icu_package = $(HAIKU_ICU_PPC_PACKAGE) ; @@ -140,6 +147,8 @@ if $(TARGET_ARCH) = ppc || $(TARGET_ARCH) = x86 || $(TARGET_ARCH) = arm || $(TAR HAIKU_ICU_HEADERS = [ FDirName $(HAIKU_ICU_DEVEL_DIR) develop headers 3rdparty ] ; + + EnableBuildFeatures icu ; } else { Echo "ICU not available for $(TARGET_ARCH)" ; } @@ -184,6 +193,8 @@ if $(HAIKU_BUILD_FEATURE_CLUCENE) { HAIKU_CLUCENE_HEADERS = [ FDirName $(HAIKU_CLUCENE_DIR) common include ] ; + + EnableBuildFeatures clucene ; } } @@ -206,6 +217,8 @@ if $(TARGET_ARCH) = x86 { HAIKU_GLU_LIBS = [ ExtractArchive $(HAIKU_GLU_DIR) : system/lib/libGLU.a : $(zipFile) : extracted-glu ] ; HAIKU_GLU_HEADERS = [ FDirName $(HAIKU_GLU_DIR) develop headers os opengl ] ; + + EnableBuildFeatures glu ; } else { Echo "GLU not yet available on $(TARGET_ARCH)" ; } @@ -247,6 +260,7 @@ if $(TARGET_ARCH) = x86 { Depends $(HAIKU_MESA_HEADERS_DEPENDENCY) : $(HAIKU_GLU_HEADERS_DEPENDENCY) ; Depends $(HAIKU_MESA_LIBS) : $(HAIKU_GLU_LIBS) ; + EnableBuildFeatures mesa ; } else { Echo "Mesa 3D rendering support not available on $(TARGET_ARCH)" ; } @@ -369,6 +383,7 @@ if $(TARGET_ARCH) = x86 { HAIKU_LIBOGG_HEADERS = [ FDirName $(HAIKU_LIBOGG_DIR) common include ] ; HAIKU_LIBVPX_HEADERS = [ FDirName $(HAIKU_LIBVPX_DIR) common include ] ; + EnableBuildFeatures ffmpeg ; } else { Echo "FFMpeg support not available on $(TARGET_ARCH)" ; } @@ -401,6 +416,7 @@ if $(TARGET_ARCH) = x86 { HAIKU_MIKMOD_HEADERS = [ FDirName $(HAIKU_MIKMOD_DIR) common include ] ; + EnableBuildFeatures mikmod ; } else { Echo "MikMod support not available on $(TARGET_ARCH)" ; } @@ -448,6 +464,8 @@ if $(TARGET_ARCH) = ppc || $(TARGET_ARCH) = x86 || $(TARGET_ARCH) = x86_64 || $( HAIKU_FREETYPE_HEADERS = [ FDirName $(HAIKU_FREETYPE_DIR) develop headers 3rdparty ] [ FDirName $(HAIKU_FREETYPE_DIR) develop headers 3rdparty freetype2 ] ; + + EnableBuildFeatures freetype ; } else { Echo "Freetype support not available on $(TARGET_ARCH)" ; } @@ -492,6 +510,8 @@ if $(HAIKU_BUILD_FEATURE_TAGLIB) { HAIKU_TAGLIB_HEADERS = [ FDirName $(HAIKU_TAGLIB_DIR) common include taglib ] ; + + EnableBuildFeatures taglib ; } } @@ -535,6 +555,8 @@ if $(HAIKU_BUILD_FEATURE_WEBKIT) { ] ; HAIKU_WEBKIT_HEADERS = [ FDirName $(HAIKU_WEBKIT_DIR) include ] ; + + EnableBuildFeatures webkit ; } } @@ -578,13 +600,15 @@ if $(TARGET_ARCH) = ppc || $(TARGET_ARCH) = x86 || $(TARGET_ARCH) = x86_64 || $( HAIKU_LIBPNG_CURRENT_LINK = libpng15.so.15 ; HAIKU_LIBPNG_HEADERS = [ FDirName $(HAIKU_LIBPNG_DIR) common include ] ; + + EnableBuildFeatures libpng ; } else { Echo "libpng support not available on $(TARGET_ARCH)" ; } # jpeg local jpegBaseURL = $(baseURL)/lib ; -if $(TARGET_ARCH) = ppc || $(TARGET_ARCH) = x86 || $(TARGET_ARCH) = x86_64 || $(TARGET_ARCH) = arm { +if $(TARGET_ARCH) in arm ppc x86 x86_64 { if $(TARGET_ARCH) = arm { HAIKU_JPEG_FILE = jpeg-8d-arm-2012-11-21.zip ; } else if $(TARGET_ARCH) = ppc { @@ -622,6 +646,8 @@ if $(TARGET_ARCH) = ppc || $(TARGET_ARCH) = x86 || $(TARGET_ARCH) = x86_64 || $( HAIKU_JPEG_CURRENT_LINK = libjpeg.so.8 ; HAIKU_JPEG_HEADERS = [ FDirName $(HAIKU_JPEG_DIR) common include ] ; + + EnableBuildFeatures libjpeg ; } else { Echo "jpeg support not available on $(TARGET_ARCH)" ; } @@ -666,6 +692,23 @@ if $(TARGET_ARCH) = ppc || $(TARGET_ARCH) = x86 || $(TARGET_ARCH) = x86_64 || $( HAIKU_ZLIB_CURRENT_LINK = libz.so.1 ; HAIKU_ZLIB_HEADERS = [ FDirName $(HAIKU_ZLIB_DIR) common include ] ; + + EnableBuildFeatures zlib ; } else { Echo "zlib support not available on $(TARGET_ARCH)" ; } + + +# GPL add-ons +if $(HAIKU_INCLUDE_GPL_ADDONS) = 1 { + EnableBuildFeatures gpl ; +} + + +# ATA vs. IDE +#HACK: remove when old ide code is removed! +if $(HAIKU_ATA_STACK) = 1 { + EnableBuildFeatures ata ; +} else { + EnableBuildFeatures ide ; +} diff --git a/build/jam/FloppyBootImage b/build/jam/FloppyBootImage index 7ecd4872c0..a0b64f0063 100644 --- a/build/jam/FloppyBootImage +++ b/build/jam/FloppyBootImage @@ -1,32 +1,8 @@ # This file defines what ends up in the floppy boot image and it executes the # rules building the image. -local X86_ONLY = ; -local PPC_ONLY = ; -local ARM_ONLY = ; -if $(TARGET_ARCH) = x86 || $(TARGET_ARCH) = x86_64 { - X86_ONLY = "" ; -} else if $(TARGET_ARCH) = ppc { - X86_ONLY = ; -} else if $(TARGET_ARCH) = m68k { - X86_ONLY = ; -} else if $(TARGET_ARCH) = arm { - ARM_ONLY = "" ; -} - -local GPL_ONLY = ; -if $(HAIKU_INCLUDE_GPL_ADDONS) = 1 { - GPL_ONLY = "" ; -} #HACK: remove when old ide code is removed! -local ATA_ONLY = ; -local IDE_ONLY = ; -if $(HAIKU_ATA_STACK) = 1 { - ATA_ONLY = "" ; -} else { - IDE_ONLY = "" ; -} local NET_BOOT = 0 ; local USB_BOOT = 1 ; @@ -49,9 +25,10 @@ if $(NET_BOOT) = 1 { ; } -SYSTEM_ADD_ONS_BUS_MANAGERS = $(X86_ONLY)acpi $(ATA_ONLY)ata config_manager dpc pci - $(IDE_ONLY)ide $(X86_ONLY)isa scsi $(USB_ONLY)usb -; +SYSTEM_ADD_ONS_BUS_MANAGERS = [ FFilterByBuildFeatures + acpi@x86 ata@ata config_manager dpc pci + ide@ide isa@x86 scsi $(USB_ONLY)usb +] ; SYSTEM_ADD_ONS_FILE_SYSTEMS = bfs iso9660 attribute_overlay write_overlay ; @@ -87,11 +64,11 @@ if $(TARGET_ARCH) = x86_64 { if $(HAIKU_ATA_STACK) = 1 { AddFilesToFloppyBootArchive system add-ons kernel busses ata - : generic_ide_pci $(X86_ONLY)ide_isa silicon_image_3112 legacy_sata + : generic_ide_pci ide_isa@x86 silicon_image_3112 legacy_sata it8211 ; } else { AddFilesToFloppyBootArchive system add-ons kernel busses ide - : generic_ide_pci $(X86_ONLY)ide_isa silicon_image_3112 legacy_sata + : generic_ide_pci ide_isa@x86 silicon_image_3112 legacy_sata it8211 ; } @@ -101,11 +78,11 @@ if $(TARGET_ARCH) = x86_64 { AddFilesToFloppyBootArchive system add-ons kernel file_systems : $(SYSTEM_ADD_ONS_FILE_SYSTEMS) ; AddFilesToFloppyBootArchive system add-ons kernel generic - : $(ATA_ONLY)ata_adapter $(IDE_ONLY)ide_adapter locked_pool scsi_periph ; + : ata_adapter@ata ide_adapter@ide locked_pool scsi_periph ; AddFilesToFloppyBootArchive system add-ons kernel partitioning_systems : intel session ; AddFilesToFloppyBootArchive system add-ons kernel interrupt_controllers - : $(PPC_ONLY)openpic ; + : openpic@ppc ; if $(USB_BOOT) = 1 { AddFilesToFloppyBootArchive system add-ons kernel busses usb @@ -118,7 +95,7 @@ if $(TARGET_ARCH) = x86_64 { # drivers AddNewDriversToFloppyBootArchive disk scsi : scsi_cd scsi_disk ; - AddNewDriversToFloppyBootArchive disk : $(ARM_ONLY)norflash ; + AddNewDriversToFloppyBootArchive disk : norflash@arm ; if $(USB_BOOT) = 1 { AddDriversToFloppyBootArchive disk usb : usb_disk ; } @@ -166,13 +143,13 @@ if $(TARGET_ARCH) = x86_64 { } else { AddBootModuleSymlinksToFloppyBootArchive $(SYSTEM_ADD_ONS_BUS_MANAGERS) - $(PPC_ONLY)openpic - $(ATA_ONLY)ata_adapter $(IDE_ONLY)ide_adapter locked_pool scsi_periph - $(X86_ONLY)generic_x86 - ahci generic_ide_pci $(X86_ONLY)ide_isa silicon_image_3112 legacy_sata + openpic@ppc + ata_adapter@ata ide_adapter@ide locked_pool scsi_periph + generic_x86@x86 + ahci generic_ide_pci ide_isa@x86 silicon_image_3112 legacy_sata it8211 $(USB_ONLY)uhci $(USB_ONLY)ohci $(USB_ONLY)ehci - scsi_cd scsi_disk $(USB_ONLY)usb_disk $(ARM_ONLY)norflash + scsi_cd scsi_disk $(USB_ONLY)usb_disk norflash@arm intel session $(SYSTEM_ADD_ONS_FILE_SYSTEMS) $(BOOT_ADD_ONS_NET) diff --git a/build/jam/Haiku64Image b/build/jam/Haiku64Image index 88936e7aab..70878d2559 100644 --- a/build/jam/Haiku64Image +++ b/build/jam/Haiku64Image @@ -5,19 +5,6 @@ # This is only temporary while x86_64 is still a work in progress, so I can # easily add things to the image as I port them. -local GPL_ONLY = ; -if $(HAIKU_INCLUDE_GPL_ADDONS) = 1 { - GPL_ONLY = "" ; -} - -#HACK: remove when old ide code is removed! -local ATA_ONLY = ; -local IDE_ONLY = ; -if $(HAIKU_ATA_STACK) = 1 { - ATA_ONLY = "" ; -} else { - IDE_ONLY = "" ; -} SYSTEM_BIN = "[" addattr base64 basename bash beep cal cat catattr checkfs chgrp chmod chown chroot cksum clear clockconfig cmp collectcatkeys comm @@ -85,8 +72,9 @@ SYSTEM_ADD_ONS_DRIVERS_NET = 3com atheros813x ar81xx attansic_l1 attansic_l2 via_rhine wb840 ; -SYSTEM_ADD_ONS_BUS_MANAGERS = $(ATA_ONLY)ata pci ps2 isa scsi config_manager - usb ; +SYSTEM_ADD_ONS_BUS_MANAGERS = [ FFilterByBuildFeatures + ata@ata pci ps2 isa scsi config_manager usb +] ; SYSTEM_ADD_ONS_FILE_SYSTEMS = bfs iso9660 attribute_overlay write_overlay ; # modules @@ -107,7 +95,7 @@ AddFilesToHaikuImage system add-ons kernel debugger AddFilesToHaikuImage system add-ons kernel file_systems : $(SYSTEM_ADD_ONS_FILE_SYSTEMS) ; AddFilesToHaikuImage system add-ons kernel generic - : $(ATA_ONLY)ata_adapter bios dpc locked_pool scsi_periph tty ; + : ata_adapter@ata bios dpc locked_pool scsi_periph tty ; AddFilesToHaikuImage system add-ons kernel partitioning_systems : intel session ; @@ -174,7 +162,7 @@ AddFilesToHaikuImage system bin : install-wifi-firmwares.sh ; # Add the files to be used by installoptionalpackage. AddDirectoryToHaikuImage common data optional-packages ; -local optional-pkg-files = OptionalBuildFeatures OptionalPackageDependencies +local optional-pkg-files = BuildFeatures OptionalPackageDependencies OptionalPackages OptionalLibPackages ; for name in $(optional-pkg-files) { local file = [ FDirName $(HAIKU_TOP) build jam $(name) ] ; @@ -358,7 +346,7 @@ AddFilesToHaikuImage system : haiku_loader ; # boot module links AddBootModuleSymlinksToHaikuImage - $(ATA_ONLY)ata pci config_manager dpc scsi usb $(ATA_ONLY)ata_adapter + ata@ata pci config_manager dpc scsi usb ata_adapter@ata locked_pool scsi_periph ahci generic_ide_pci legacy_sata uhci ohci ehci scsi_cd scsi_disk usb_disk diff --git a/build/jam/HaikuImage b/build/jam/HaikuImage index b04d140172..54fe50607a 100644 --- a/build/jam/HaikuImage +++ b/build/jam/HaikuImage @@ -2,35 +2,9 @@ # installation directory) and it executes the rules building the image # (respectively installing the files in the installation directory). -local X86_ONLY = ; -local PPC_ONLY = ; -local M68K_ONLY = ; -local ARM_ONLY = ; -if $(TARGET_ARCH) = x86 { - X86_ONLY = "" ; -} else if $(TARGET_ARCH) = ppc { - PPC_ONLY = "" ; -} else if $(TARGET_ARCH) = m68k { - M68K_ONLY = "" ; -} else if $(TARGET_ARCH) = arm { - ARM_ONLY = "" ; -} -local GPL_ONLY = ; -if $(HAIKU_INCLUDE_GPL_ADDONS) = 1 { - GPL_ONLY = "" ; -} - -#HACK: remove when old ide code is removed! -local ATA_ONLY = ; -local IDE_ONLY = ; -if $(HAIKU_ATA_STACK) = 1 { - ATA_ONLY = "" ; -} else { - IDE_ONLY = "" ; -} - -SYSTEM_BIN = "[" addattr alert arp base64 basename bash bc beep bfsinfo +SYSTEM_BIN = [ FFilterByBuildFeatures + "[" addattr alert arp base64 basename bash bc beep bfsinfo cal cat catattr checkfs checkitout chgrp chmod chop chown chroot cksum clear clockconfig cmp collectcatkeys comm compress copyattr CortexAddOnHost cp csplit cut date dc dd desklink df diff diff3 dircolors dirname @@ -38,10 +12,10 @@ SYSTEM_BIN = "[" addattr alert arp base64 basename bash bc beep bfsinfo echo eject env error expand expr factor false fdinfo ffm filepanel find finddir fmt fold fortune frcode ftp ftpd funzip fwcontrol - gawk $(X86_ONLY)gdb getlimits grep groups gzip gzexe + gawk gdb@x86 getlimits grep groups gzip gzexe hd head hey hostname id ident ifconfig install installsound iroster isvolume - $(IDE_ONLY)ideinfo $(IDE_ONLY)idestatus + ideinfo@ide idestatus@ide join kernel_debugger keymap kill less lessecho lesskey link linkcatkeys listarea listattr listimage listdev listport listres listsem listusb ln locale locate logger login logname ls @@ -64,38 +38,41 @@ SYSTEM_BIN = "[" addattr alert arp base64 basename bash bc beep bfsinfo uname unchop unexpand unmount uniq unlink unrar unshar unzip unzipsfx updatedb uptime urlwrapper useradd uudecode uuencode vdir version vmstat - waitfor watch wc wget whoami $(X86_ONLY)writembr xargs xres yes + waitfor watch wc wget whoami writembr@x86 xargs xres yes zdiff zforce zgrep zip zipcloak zipgrep zipnote zipsplit zmore znew -; +] ; -SYSTEM_APPS = AboutSystem ActivityMonitor $(X86_ONLY)BootManager CharacterMap +SYSTEM_APPS = [ FFilterByBuildFeatures + AboutSystem ActivityMonitor BootManager@x86 CharacterMap CodyCam DeskCalc Devices DiskProbe DiskUsage DriveSetup CDPlayer Expander - $(X86_ONLY)GLInfo Icon-O-Matic Installer LaunchBox Magnify Mail + GLInfo@x86 Icon-O-Matic Installer LaunchBox Magnify Mail MediaConverter MediaPlayer MidiPlayer NetworkStatus PackageInstaller People PoorMan PowerStatus ProcessController Screenshot ShowImage SoundRecorder StyledEdit Terminal TextSearch TV WebWatch Workspaces -; -SYSTEM_PREFERENCES = Appearance Backgrounds CPUFrequency DataTranslations +] ; +SYSTEM_PREFERENCES = [ FFilterByBuildFeatures + Appearance Backgrounds CPUFrequency DataTranslations Deskbar E-mail FileTypes Keyboard Keymap Locale Media Mouse Network Notifications Printers Screen ScreenSaver Shortcuts Sounds Time Touchpad Tracker VirtualMemory -; -SYSTEM_DEMOS = BSnow Chart Clock Cortex FontDemo $(X86_ONLY)GLTeapot - $(HAIKU_INCLUDE_TRADEMARKS)$(X86_ONLY)Haiku3d Mandelbrot OverlayImage Pairs +] ; +SYSTEM_DEMOS = [ FFilterByBuildFeatures + BSnow Chart Clock Cortex FontDemo GLTeapot@x86 + $(HAIKU_INCLUDE_TRADEMARKS)Haiku3d@x86 Mandelbrot OverlayImage Pairs Playground Pulse Sudoku -; -SYSTEM_LIBS = +] ; +SYSTEM_LIBS = [ FFilterByBuildFeatures libbe.so libbsd.so libbnetapi.so libdebug.so libdevice.so - libgame.so $(X86_ONLY)libGL.so $(X86_ONLY)libglut.so + libgame.so libGL.so@x86 libglut.so@x86 libgnu.so libmail.so libmedia.so libmidi.so libmidi2.so libnetwork.so libroot.so libroot-addon-icu.so libscreensaver.so libtextencoding.so libtiff.so libtracker.so libtranslation.so $(HAIKU_SHARED_LIBSTDC++) $(HAIKU_SHARED_LIBSUPC++) -; -PRIVATE_SYSTEM_LIBS = +] ; +PRIVATE_SYSTEM_LIBS = [ FFilterByBuildFeatures $(HAIKU_JPEG_CURRENT_LIB) $(HAIKU_LIBPNG_CURRENT_LIB) $(HAIKU_ZLIB_CURRENT_LIB) @@ -103,11 +80,13 @@ PRIVATE_SYSTEM_LIBS = libalm.so libfluidsynth.so libilmimf.so -; -SYSTEM_SERVERS = app_server cddb_daemon debug_server input_server mail_daemon +] ; +SYSTEM_SERVERS = [ FFilterByBuildFeatures + app_server cddb_daemon debug_server input_server mail_daemon media_addon_server media_server midi_server mount_server net_server - notification_server power_daemon print_server print_addon_server registrar syslog_daemon -; + notification_server power_daemon print_server print_addon_server registrar + syslog_daemon +] ; SYSTEM_NETWORK_DEVICES = ethernet loopback ; SYSTEM_NETWORK_DATALINK_PROTOCOLS = ethernet_frame arp loopback_frame @@ -115,17 +94,14 @@ SYSTEM_NETWORK_DATALINK_PROTOCOLS = ethernet_frame arp loopback_frame #SYSTEM_NETWORK_PPP = ipcp modem pap pppoe ; SYSTEM_NETWORK_PROTOCOLS = ipv4 tcp udp icmp unix icmp6 ipv6 ; -SYSTEM_ADD_ONS_ACCELERANTS = $(X86_ONLY)radeon.accelerant - $(X86_ONLY)nvidia.accelerant $(X86_ONLY)matrox.accelerant - $(X86_ONLY)neomagic.accelerant $(X86_ONLY)intel_extreme.accelerant - $(X86_ONLY)s3.accelerant $(X86_ONLY)vesa.accelerant - $(X86_ONLY)ati.accelerant - $(X86_ONLY)3dfx.accelerant - $(X86_ONLY)radeon_hd.accelerant - $(X86_ONLY)intel_810.accelerant - #$(X86_ONLY)via.accelerant - #$(X86_ONLY)vmware.accelerant -; +SYSTEM_ADD_ONS_ACCELERANTS = [ FFilterByBuildFeatures + x86 @{ + 3dfx.accelerant ati.accelerant matrox.accelerant neomagic.accelerant + nvidia.accelerant intel_810.accelerant intel_extreme.accelerant + radeon.accelerant radeon_hd.accelerant s3.accelerant vesa.accelerant + #via.accelerant vmware.accelerant + }@ # x86 +] ; SYSTEM_ADD_ONS_TRANSLATORS = BMPTranslator EXRTranslator GIFTranslator HVIFTranslator ICOTranslator JPEGTranslator JPEG2000Translator PCXTranslator PNGTranslator PPMTranslator @@ -133,9 +109,10 @@ SYSTEM_ADD_ONS_TRANSLATORS = BMPTranslator EXRTranslator GIFTranslator TIFFTranslator WebPTranslator WonderBrushTranslator ICNSTranslator ; SYSTEM_ADD_ONS_LOCALE_CATALOGS = plaintext ; -SYSTEM_ADD_ONS_MEDIA = cortex_audioadapter.media_addon +SYSTEM_ADD_ONS_MEDIA = [ FFilterByBuildFeatures + cortex_audioadapter.media_addon cortex_flanger.media_addon - $(X86_ONLY)dvb.media_addon + dvb.media_addon@x86 hmulti_audio.media_addon mixer.media_addon opensound.media_addon @@ -147,8 +124,10 @@ SYSTEM_ADD_ONS_MEDIA = cortex_audioadapter.media_addon #legacy.media_addon equalizer.media_addon vst_host.media_addon -; -SYSTEM_ADD_ONS_MEDIA_PLUGINS = $(X86_ONLY)ffmpeg raw_decoder ; +] ; +SYSTEM_ADD_ONS_MEDIA_PLUGINS = [ FFilterByBuildFeatures + ffmpeg@ffmpeg raw_decoder +] ; SYSTEM_ADD_ONS_PRINT = Canon\ LIPS3\ Compatible Canon\ LIPS4\ Compatible @@ -163,40 +142,45 @@ SYSTEM_ADD_ONS_PRINT_TRANSPORT = HP\ JetDirect IPP LPR # Parallel\ Port Print\ To\ File Serial\ Port USB\ Port ; -SYSTEM_ADD_ONS_SCREENSAVERS = Butterfly DebugNow $(X86_ONLY)Flurry - $(X86_ONLY)GLife $(HAIKU_INCLUDE_TRADEMARKS)Haiku Icons IFS Leaves - Message Spider ; +SYSTEM_ADD_ONS_SCREENSAVERS = [ FFilterByBuildFeatures + Butterfly DebugNow Flurry@x86 + GLife@x86 $(HAIKU_INCLUDE_TRADEMARKS)Haiku Icons IFS Leaves + Message Spider +] ; SYSTEM_ADD_ONS_DRIVERS_AUDIO = auich auvia echo3g emuxki hda ice1712 sis7018 ; SYSTEM_ADD_ONS_DRIVERS_AUDIO_OLD = ; #cmedia usb_audio ; -SYSTEM_ADD_ONS_DRIVERS_GRAPHICS = $(X86_ONLY)radeon $(X86_ONLY)nvidia - $(X86_ONLY)neomagic $(X86_ONLY)matrox $(X86_ONLY)intel_extreme - $(X86_ONLY)s3 $(X86_ONLY)vesa #$(X86_ONLY)via #$(X86_ONLY)vmware - $(X86_ONLY)ati $(X86_ONLY)3dfx $(X86_ONLY)radeon_hd - $(X86_ONLY)intel_810 -; +SYSTEM_ADD_ONS_DRIVERS_GRAPHICS = [ FFilterByBuildFeatures + x86 @{ + ati 3dfx intel_810 intel_extreme matrox neomagic nvidia radeon radeon_hd + s3 vesa #via vmware + }@ # x86 +] ; SYSTEM_ADD_ONS_DRIVERS_MIDI = emuxki ice1712 usb_midi ; -SYSTEM_ADD_ONS_DRIVERS_NET = $(X86_ONLY)3com $(X86_ONLY)atheros813x - $(X86_ONLY)ar81xx $(X86_ONLY)attansic_l1 $(X86_ONLY)attansic_l2 - $(X86_ONLY)broadcom440x $(X86_ONLY)broadcom570x $(X86_ONLY)dec21xxx etherpci - $(X86_ONLY)ipro100 $(X86_ONLY)ipro1000 $(X86_ONLY)jmicron2x0 - $(X86_ONLY)marvell_yukon $(X86_ONLY)nforce $(X86_ONLY)pcnet pegasus - $(X86_ONLY)rtl8139 $(X86_ONLY)rtl81xx $(X86_ONLY)sis19x sis900 - $(X86_ONLY)syskonnect usb_davicom usb_asix usb_ecm $(X86_ONLY)via_rhine - $(X86_ONLY)vt612x wb840 +SYSTEM_ADD_ONS_DRIVERS_NET = [ FFilterByBuildFeatures + x86 @{ + 3com atheros813x ar81xx attansic_l1 attansic_l2 broadcom440x + broadcom570x dec21xxx ipro100 ipro1000 jmicron2x0 marvell_yukon nforce + pcnet rtl8139 rtl81xx sis19x syskonnect via_rhine vt612x + }@ # x86 + + etherpci pegasus sis900 usb_davicom usb_asix usb_ecm wb840 # WLAN drivers - $(X86_ONLY)aironetwifi $(X86_ONLY)atheroswifi $(X86_ONLY)broadcom43xx - $(X86_ONLY)iprowifi2100 $(X86_ONLY)iprowifi2200 $(X86_ONLY)iprowifi3945 - $(X86_ONLY)iprowifi4965 $(X86_ONLY)marvell88w8363 $(X86_ONLY)marvell88w8335 - $(X86_ONLY)ralink2860 $(X86_ONLY)ralinkwifi $(X86_ONLY)wavelanwifi + x86 @{ + aironetwifi atheroswifi broadcom43xx + iprowifi2100 iprowifi2200 iprowifi3945 + iprowifi4965 marvell88w8363 marvell88w8335 + ralink2860 ralinkwifi wavelanwifi + }@ # x86 # WWAN drivers - #$(GPL_ONLY)usb_beceemwmx -; -SYSTEM_ADD_ONS_DRIVERS_POWER = $(X86_ONLY)acpi_button ; -SYSTEM_ADD_ONS_BUS_MANAGERS = $(ATA_ONLY)ata pci $(X86_ONLY)ps2 $(X86_ONLY)isa - $(IDE_ONLY)ide scsi config_manager agp_gart usb firewire $(X86_ONLY)acpi -; + #usb_beceemwmx@gpl +] ; +SYSTEM_ADD_ONS_DRIVERS_POWER = [ FFilterByBuildFeatures acpi_button@x86 ] ; +SYSTEM_ADD_ONS_BUS_MANAGERS = [ FFilterByBuildFeatures + ata@ata pci ps2@x86 isa@x86 + ide@ide scsi config_manager agp_gart usb firewire acpi@x86 +] ; SYSTEM_ADD_ONS_FILE_SYSTEMS = bfs btrfs cdda exfat ext2 fat iso9660 nfs attribute_overlay write_overlay ntfs reiserfs udf googlefs ; @@ -223,16 +207,14 @@ for driver in $(SYSTEM_ADD_ONS_DRIVERS_NET) { AddFilesToHaikuImage system add-ons kernel bus_managers : $(SYSTEM_ADD_ONS_BUS_MANAGERS) ; AddFilesToHaikuImage system add-ons kernel busses agp_gart - : $(X86_ONLY)intel ; + : intel@x86 ; if $(HAIKU_ATA_STACK) = 1 { AddFilesToHaikuImage system add-ons kernel busses ata - : generic_ide_pci it8211 legacy_sata silicon_image_3112 - $(X86_ONLY)ide_isa ; + : generic_ide_pci it8211 legacy_sata silicon_image_3112 ide_isa@x86 ; } else { AddFilesToHaikuImage system add-ons kernel busses ide - : generic_ide_pci it8211 legacy_sata silicon_image_3112 - $(X86_ONLY)ide_isa ; + : generic_ide_pci it8211 legacy_sata silicon_image_3112 ide_isa@x86 ; } AddFilesToHaikuImage system add-ons kernel busses scsi @@ -241,18 +223,18 @@ AddFilesToHaikuImage system add-ons kernel busses usb : uhci ohci ehci ; AddFilesToHaikuImage system add-ons kernel console : vga_text ; AddFilesToHaikuImage system add-ons kernel debugger - : demangle $(X86_ONLY)disasm hangman + : demangle disasm@x86 hangman invalidate_on_exit usb_keyboard qrencode run_on_exit ; AddFilesToHaikuImage system add-ons kernel file_systems : $(SYSTEM_ADD_ONS_FILE_SYSTEMS) ; AddFilesToHaikuImage system add-ons kernel generic - : $(ATA_ONLY)ata_adapter $(X86_ONLY)bios dpc $(IDE_ONLY)ide_adapter - locked_pool mpu401 scsi_periph tty ; #$(X86_ONLY)cpuidle ; + : ata_adapter@ata bios@x86 dpc ide_adapter@ide + locked_pool mpu401 scsi_periph tty ; #cpuidle@x86 ; AddFilesToHaikuImage system add-ons kernel partitioning_systems : amiga_rdb apple efi_gpt intel session ; AddFilesToHaikuImage system add-ons kernel interrupt_controllers - : $(PPC_ONLY)openpic ; + : openpic@ppc ; if $(TARGET_ARCH) = x86 { AddFilesToHaikuImage system add-ons kernel cpu : generic_x86 ; @@ -260,9 +242,9 @@ if $(TARGET_ARCH) = x86 { # drivers AddNewDriversToHaikuImage disk scsi : scsi_cd scsi_disk ; -AddNewDriversToHaikuImage power : $(X86_ONLY)enhanced_speedstep ; -AddNewDriversToHaikuImage power : $(X86_ONLY)acpi_battery ; -#AddNewDriversToHaikuImage power : $(X86_ONLY)x86_cpuidle ; +AddNewDriversToHaikuImage power : enhanced_speedstep@x86 ; +AddNewDriversToHaikuImage power : acpi_battery@x86 ; +#AddNewDriversToHaikuImage power : x86_cpuidle@x86 ; # legacy drivers AddDriversToHaikuImage : console dprintf null @@ -271,7 +253,7 @@ AddDriversToHaikuImage audio hmulti : $(SYSTEM_ADD_ONS_DRIVERS_AUDIO) ; AddDriversToHaikuImage audio old : $(SYSTEM_ADD_ONS_DRIVERS_AUDIO_OLD) ; AddDriversToHaikuImage midi : $(SYSTEM_ADD_ONS_DRIVERS_MIDI) ; AddDriversToHaikuImage bus : usb_raw fw_raw ; -AddDriversToHaikuImage disk floppy : $(X86_ONLY)pc_floppy ; +AddDriversToHaikuImage disk floppy : pc_floppy@x86 ; AddDriversToHaikuImage disk usb : usb_disk ; AddDriversToHaikuImage disk usb : usb_floppy ; AddDriversToHaikuImage printer usb : usb_printer ; @@ -393,7 +375,7 @@ AddSymlinkToHaikuImage home Desktop # Add the files to be used by installoptionalpackage. AddDirectoryToHaikuImage common data optional-packages ; -local optional-pkg-files = OptionalBuildFeatures OptionalPackageDependencies +local optional-pkg-files = BuildFeatures OptionalPackageDependencies OptionalPackages OptionalLibPackages ; for name in $(optional-pkg-files) { local file = [ FDirName $(HAIKU_TOP) build jam $(name) ] ; @@ -622,12 +604,12 @@ AddFilesToHaikuImage system : haiku_loader ; # boot module links AddBootModuleSymlinksToHaikuImage - $(X86_ONLY)acpi $(ATA_ONLY)ata pci $(X86_ONLY)isa config_manager dpc - $(IDE_ONLY)ide scsi usb - $(PPC_ONLY)openpic - $(ATA_ONLY)ata_adapter $(IDE_ONLY)ide_adapter locked_pool scsi_periph + acpi@x86 ata@ata pci isa@x86 config_manager dpc + ide@ide scsi usb + openpic@ppc + ata_adapter@ata ide_adapter@ide locked_pool scsi_periph ahci generic_ide_pci it8211 legacy_sata silicon_image_3112 - $(X86_ONLY)ide_isa + ide_isa@x86 uhci ohci ehci scsi_cd scsi_disk usb_disk efi_gpt diff --git a/build/jam/NetBootArchive b/build/jam/NetBootArchive index 449674e4a1..5371289185 100644 --- a/build/jam/NetBootArchive +++ b/build/jam/NetBootArchive @@ -1,43 +1,28 @@ # This file defines what ends up in the network boot archive and it executes the # rules building the archive. -local X86_ONLY = ; -local PPC_ONLY = ; -if $(TARGET_ARCH) = x86 { - X86_ONLY = "" ; -} else if $(TARGET_ARCH) = ppc { - X86_ONLY = ; -} - -local GPL_ONLY = ; -if $(HAIKU_INCLUDE_GPL_ADDONS) = 1 { - GPL_ONLY = "" ; -} - -#HACK: remove when old ide code is removed! -local ATA_ONLY = ; -local IDE_ONLY = ; -if $(HAIKU_ATA_STACK) = 1 { - ATA_ONLY = "" ; -} else { - IDE_ONLY = "" ; -} SYSTEM_NETWORK_DEVICES = ethernet loopback ; SYSTEM_NETWORK_DATALINK_PROTOCOLS = ethernet_frame arp loopback_frame ; SYSTEM_NETWORK_PROTOCOLS = ipv4 tcp udp icmp unix ; -SYSTEM_ADD_ONS_DRIVERS_NET = $(X86_ONLY)3com $(X86_ONLY)atheros813x - $(X86_ONLY)broadcom440x $(X86_ONLY)broadcom570x etherpci $(X86_ONLY)ipro1000 - pegasus $(X86_ONLY)rtl8139 rtl8169 $(X86_ONLY)rtl81xx sis900 - $(X86_ONLY)via_rhine wb840 $(X86_ONLY)ipro100 $(X86_ONLY)nforce +SYSTEM_ADD_ONS_DRIVERS_NET = [ FFilterByBuildFeatures + x86 @{ + 3com atheros813x + broadcom440x broadcom570x ipro1000 + rtl8139 rtl81xx + via_rhine ipro100 nforce + marvell_yukon syskonnect + attansic_l2 ar81xx + }@ # x86 + + etherpci pegasus rtl8169 sis900 usb_ecm wb840 #vlance - $(X86_ONLY)marvell_yukon $(X86_ONLY)syskonnect - $(X86_ONLY)attansic_l2 $(X86_ONLY)ar81xx usb_ecm -; -SYSTEM_ADD_ONS_BUS_MANAGERS = pci $(X86_ONLY)isa $(IDE_ONLY)ide $(ATA_ONLY)ata +] ; +SYSTEM_ADD_ONS_BUS_MANAGERS = [ FFilterByBuildFeatures + pci isa@x86 ide@ide ata@ata scsi config_manager agp_gart -; +] ; SYSTEM_ADD_ONS_FILE_SYSTEMS = bfs fat iso9660 ; @@ -45,20 +30,20 @@ SYSTEM_ADD_ONS_FILE_SYSTEMS = bfs fat iso9660 ; AddFilesToNetBootArchive system add-ons kernel bus_managers : $(SYSTEM_ADD_ONS_BUS_MANAGERS) ; AddFilesToNetBootArchive system add-ons kernel busses agp_gart - : $(X86_ONLY)intel ; + : intel@x86 ; AddFilesToNetBootArchive system add-ons kernel busses ide - : generic_ide_pci $(X86_ONLY)ide_isa silicon_image_3112 ; + : generic_ide_pci ide_isa@x86 silicon_image_3112 ; AddFilesToNetBootArchive system add-ons kernel busses scsi : ahci ; AddFilesToNetBootArchive system add-ons kernel console : vga_text ; AddFilesToNetBootArchive system add-ons kernel file_systems : $(SYSTEM_ADD_ONS_FILE_SYSTEMS) ; AddFilesToNetBootArchive system add-ons kernel generic - : $(IDE_ONLY)ide_adapter $(ATA_ONLY)ata_adapter locked_pool scsi_periph ; + : ide_adapter@ide ata_adapter@ata locked_pool scsi_periph ; AddFilesToNetBootArchive system add-ons kernel partitioning_systems : intel session ; AddFilesToNetBootArchive system add-ons kernel interrupt_controllers - : $(PPC_ONLY)openpic ; + : openpic@ppc ; if $(TARGET_ARCH) = x86 { AddFilesToNetBootArchive system add-ons kernel cpu : generic_x86 ; @@ -96,12 +81,12 @@ AddFilesToNetBootArchive system add-ons kernel network protocols # boot module links AddBootModuleSymlinksToNetBootArchive $(SYSTEM_ADD_ONS_BUS_MANAGERS) - ahci generic_ide_pci $(X86_ONLY)ide_isa silicon_image_3112 + ahci generic_ide_pci ide_isa@x86 silicon_image_3112 $(SYSTEM_ADD_ONS_FILE_SYSTEMS) - $(IDE_ONLY)ide_adapter $(ATA_ONLY)ata_adapter locked_pool scsi_periph + ide_adapter@ide ata_adapter@ata locked_pool scsi_periph intel session - $(PPC_ONLY)openpic - $(X86_ONLY)generic_x86 + openpic@ppc + generic_x86@x86 # nbd remote_disk $(SYSTEM_ADD_ONS_DRIVERS_NET) diff --git a/src/add-ons/mail_daemon/inbound_protocols/imap/Jamfile b/src/add-ons/mail_daemon/inbound_protocols/imap/Jamfile index 38b5377d0e..1c8d5b9b07 100644 --- a/src/add-ons/mail_daemon/inbound_protocols/imap/Jamfile +++ b/src/add-ons/mail_daemon/inbound_protocols/imap/Jamfile @@ -31,7 +31,7 @@ local sources = AddResources IMAP : IMAP.rdef ; -if $(HAIKU_OPENSSL_ENABLED) { +if $(HAIKU_BUILD_FEATURE_OPENSSL_ENABLED) { SubDirC++Flags -DUSE_SSL ; SetupFeatureObjectsDir ssl ; } else { diff --git a/src/add-ons/mail_daemon/inbound_protocols/pop3/Jamfile b/src/add-ons/mail_daemon/inbound_protocols/pop3/Jamfile index 527a778b0e..51644d27b6 100644 --- a/src/add-ons/mail_daemon/inbound_protocols/pop3/Jamfile +++ b/src/add-ons/mail_daemon/inbound_protocols/pop3/Jamfile @@ -17,7 +17,7 @@ local sources = ; # use OpenSSL, if enabled -if $(HAIKU_OPENSSL_ENABLED) { +if $(HAIKU_BUILD_FEATURE_OPENSSL_ENABLED) { SubDirC++Flags -DUSE_SSL ; SubDirSysHdrs $(HAIKU_OPENSSL_HEADERS) ; Includes [ FGristFiles $(sources) ] : $(HAIKU_OPENSSL_HEADERS_DEPENDENCY) ; diff --git a/src/add-ons/mail_daemon/outbound_protocols/smtp/Jamfile b/src/add-ons/mail_daemon/outbound_protocols/smtp/Jamfile index 91e2bf4cf5..425d4ad838 100644 --- a/src/add-ons/mail_daemon/outbound_protocols/smtp/Jamfile +++ b/src/add-ons/mail_daemon/outbound_protocols/smtp/Jamfile @@ -13,7 +13,7 @@ local sources = ; # use OpenSSL, if enabled -if $(HAIKU_OPENSSL_ENABLED) { +if $(HAIKU_BUILD_FEATURE_OPENSSL_ENABLED) { SubDirC++Flags -DUSE_SSL ; SubDirSysHdrs $(HAIKU_OPENSSL_HEADERS) ; Includes [ FGristFiles $(sources) ] : $(HAIKU_OPENSSL_HEADERS_DEPENDENCY) ; diff --git a/src/bin/network/wget/Jamfile b/src/bin/network/wget/Jamfile index 7b970521f8..a9d1f7b0ac 100644 --- a/src/bin/network/wget/Jamfile +++ b/src/bin/network/wget/Jamfile @@ -12,7 +12,7 @@ SubDirSysHdrs [ FDirName $(SUBDIR) md5 ] ; # use OpenSSL, if enabled local sslSources ; -if $(HAIKU_OPENSSL_ENABLED) { +if $(HAIKU_BUILD_FEATURE_OPENSSL_ENABLED) { SubDirCcFlags -DHAVE_LIBSSL ; SubDirSysHdrs $(HAIKU_OPENSSL_HEADERS) ; sslSources = openssl.c ; diff --git a/src/kits/mail/Jamfile b/src/kits/mail/Jamfile index 2df71fb5d2..cbe5947953 100644 --- a/src/kits/mail/Jamfile +++ b/src/kits/mail/Jamfile @@ -36,7 +36,7 @@ local sources = # use OpenSSL, if enabled -if $(HAIKU_OPENSSL_ENABLED) { +if $(HAIKU_BUILD_FEATURE_OPENSSL_ENABLED) { SubDirC++Flags -DUSE_SSL ; SubDirSysHdrs $(HAIKU_OPENSSL_HEADERS) ; Includes [ FGristFiles $(sources) ] : $(HAIKU_OPENSSL_HEADERS_DEPENDENCY) ; diff --git a/src/kits/network/libnetapi/Jamfile b/src/kits/network/libnetapi/Jamfile index 30f5efef1c..ab598f94e2 100644 --- a/src/kits/network/libnetapi/Jamfile +++ b/src/kits/network/libnetapi/Jamfile @@ -7,7 +7,7 @@ UseHeaders [ FDirName $(HAIKU_TOP) src libs compat freebsd_network compat ] UseHeaders [ FDirName $(HAIKU_TOP) src libs compat freebsd_wlan ] : true ; local sslSources ; -if $(HAIKU_OPENSSL_ENABLED) { +if $(HAIKU_BUILD_FEATURE_OPENSSL_ENABLED) { SubDirC++Flags -DOPENSSL_ENABLED ; SubDirSysHdrs $(HAIKU_OPENSSL_HEADERS) ; sslSources = SSL.cpp ; From a6f39df3f76c9b7b5d851803c6644c24c673c051 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Coursi=C3=A8re?= Date: Sun, 9 Dec 2012 03:45:16 +0000 Subject: [PATCH 22/57] Poorman : avoid a double free in ls method. Should fix #8617. Signed-off-by: Matt Madia --- src/apps/poorman/libhttpd/libhttpd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apps/poorman/libhttpd/libhttpd.c b/src/apps/poorman/libhttpd/libhttpd.c index b982d1529d..dd9f5f68bd 100644 --- a/src/apps/poorman/libhttpd/libhttpd.c +++ b/src/apps/poorman/libhttpd/libhttpd.c @@ -2713,6 +2713,7 @@ ls( httpd_conn* hc ) send_mime( hc, 200, ok200title, "", "", "text/html; charset=%s", (off_t) -1, hc->sb.st_mtime ); + free(de); } else if ( hc->method == METHOD_GET ) { @@ -2947,7 +2948,6 @@ ls( httpd_conn* hc ) free(de); return -1; } - free(de); return 0; } From 46cf7a5a73679c6e4fde91710e4a4885242e49d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Buczkowski?= Date: Wed, 14 Nov 2012 10:48:33 +0100 Subject: [PATCH 23/57] Fix typos: super block -> superblock (#8974) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Przemysław Buczkowski Signed-off-by: Matt Madia --- .../kernel/boot/boot_process_specs_x86.html | 4 ++-- .../kernel/file_systems/bfs/BlockAllocator.cpp | 4 ++-- src/add-ons/kernel/file_systems/bfs/Inode.cpp | 2 +- src/add-ons/kernel/file_systems/bfs/Journal.cpp | 10 +++++----- src/add-ons/kernel/file_systems/bfs/Volume.cpp | 14 +++++++------- src/add-ons/kernel/file_systems/btrfs/Volume.cpp | 6 +++--- src/add-ons/kernel/file_systems/exfat/Volume.cpp | 6 +++--- src/add-ons/kernel/file_systems/ext2/Volume.cpp | 8 ++++---- .../kernel/file_systems/reiserfs/SuperBlock.cpp | 8 ++++---- .../kernel/file_systems/reiserfs/Volume.cpp | 10 +++++----- .../kernel/file_systems/reiserfs/reiserfs.h | 4 ++-- .../kernel/file_systems/userlandfs/userlandfs | 2 +- src/bin/bfs_tools/bfsinfo.cpp | 4 ++-- src/bin/bfs_tools/bfswhich.cpp | 4 ++-- src/bin/bfs_tools/lib/Disk.h | 2 +- src/bin/bfs_tools/recover.cpp | 10 +++++----- src/bin/coreutils/man/sync.1 | 2 +- src/bin/coreutils/src/sync.c | 4 ++-- src/system/boot/loader/file_systems/bfs/bfs.cpp | 2 +- src/system/boot/platform/atari_m68k/devices.cpp | 2 +- src/system/boot/platform/bios_ia32/devices.cpp | 2 +- .../kernel/file_systems/bfs/dump_log/dump_log.cpp | 6 +++--- .../kernel/file_systems/bfs/r5/BlockAllocator.cpp | 2 +- .../add-ons/kernel/file_systems/bfs/r5/Inode.cpp | 2 +- .../add-ons/kernel/file_systems/bfs/r5/Journal.cpp | 6 +++--- src/tests/add-ons/kernel/file_systems/bfs/r5/ToDo | 2 +- .../userlandfs/r5/src/test/reiserfs/SuperBlock.cpp | 8 ++++---- .../userlandfs/r5/src/test/reiserfs/Volume.cpp | 8 ++++---- .../userlandfs/r5/src/test/reiserfs/reiserfs.h | 4 ++-- .../file_systems/userlandfs/r5/userlandfs.sample | 2 +- .../kernel/file_corruption/fs/BlockAllocator.cpp | 2 +- .../system/kernel/file_corruption/fs/Volume.cpp | 4 ++-- 32 files changed, 78 insertions(+), 78 deletions(-) diff --git a/docs/develop/kernel/boot/boot_process_specs_x86.html b/docs/develop/kernel/boot/boot_process_specs_x86.html index a986bf1407..a4f0f2a85c 100644 --- a/docs/develop/kernel/boot/boot_process_specs_x86.html +++ b/docs/develop/kernel/boot/boot_process_specs_x86.html @@ -28,11 +28,11 @@

It resides in the first first 1024 bytes of a BFS disk which usually refers to the - first two sectors of the partition in question. Since the BFS super block is located + first two sectors of the partition in question. Since the BFS superblock is located at byte offset 512, and about 170 bytes large, this section is already reserved, and thus cannot be used by the loader itself.
The MBR only loads the first sector of a partition into memory, so it has to load - the super block (and the rest of its implementation) by itself. + the superblock (and the rest of its implementation) by itself.

The loader must be able to load the real boot loader from a certain path, and diff --git a/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp b/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp index feebed32c6..68c4e0353b 100644 --- a/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp +++ b/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp @@ -597,7 +597,7 @@ BlockAllocator::InitializeAndClearBitmap(Transaction& transaction) memset(buffer, 0, numBits >> 3); off_t offset = 1; - // the bitmap starts directly after the super block + // the bitmap starts directly after the superblock // initialize the AllocationGroup objects and clear the on-disk bitmap @@ -926,7 +926,7 @@ BlockAllocator::AllocateBlocks(Transaction& transaction, int32 groupIndex, fVolume->SuperBlock().used_blocks = HOST_ENDIAN_TO_BFS_INT64(fVolume->UsedBlocks() + bestLength); - // We are not writing back the disk's super block - it's + // We are not writing back the disk's superblock - it's // either done by the journaling code, or when the disk // is unmounted. // If the value is not correct at mount time, it will be diff --git a/src/add-ons/kernel/file_systems/bfs/Inode.cpp b/src/add-ons/kernel/file_systems/bfs/Inode.cpp index 8abf77c3e9..ff1ddca93d 100644 --- a/src/add-ons/kernel/file_systems/bfs/Inode.cpp +++ b/src/add-ons/kernel/file_systems/bfs/Inode.cpp @@ -2556,7 +2556,7 @@ Inode::Remove(Transaction& transaction, const char* name, ino_t* _id, adds the created inode to that parent directory. If an attribute directory is created, it will also automatically be added to the \a parent inode as such. However, the indices root node, and the regular root node won't be - added to the super block. + added to the superblock. It will also create the initial B+tree for the inode if it's a directory of any kind. \a name may be \c NULL, but only if no \a parent is given. diff --git a/src/add-ons/kernel/file_systems/bfs/Journal.cpp b/src/add-ons/kernel/file_systems/bfs/Journal.cpp index a10f76ff84..fa62b52afe 100644 --- a/src/add-ons/kernel/file_systems/bfs/Journal.cpp +++ b/src/add-ons/kernel/file_systems/bfs/Journal.cpp @@ -499,10 +499,10 @@ Journal::_ReplayRunArray(int32* _start) // TODO: eventually check other well known offsets, like the // root and index dirs if (offset == 0) { - // This log entry writes over the super block - check if + // This log entry writes over the superblock - check if // it's valid! if (Volume::CheckSuperBlock(data) != B_OK) { - FATAL(("Log contains invalid super block!\n")); + FATAL(("Log contains invalid superblock!\n")); RETURN_ERROR(B_BAD_DATA); } } @@ -663,7 +663,7 @@ Journal::_TransactionWritten(int32 transactionID, int32 event, void* _logEntry) delete logEntry; - // update the super block, and change the disk's state, if necessary + // update the superblock, and change the disk's state, if necessary if (update) { if (superBlock.log_start == superBlock.log_end) @@ -671,7 +671,7 @@ Journal::_TransactionWritten(int32 transactionID, int32 event, void* _logEntry) status_t status = journal->fVolume->WriteSuperBlock(); if (status != B_OK) { - FATAL(("_TransactionWritten: could not write back super block: %s\n", + FATAL(("_TransactionWritten: could not write back superblock: %s\n", strerror(status))); } @@ -864,7 +864,7 @@ Journal::_WriteTransactionToLog() logEntry->SetTransactionID(fTransactionID); #endif - // Update the log end pointer in the super block + // Update the log end pointer in the superblock fVolume->SuperBlock().flags = SUPER_BLOCK_DISK_DIRTY; fVolume->SuperBlock().log_end = HOST_ENDIAN_TO_BFS_INT64(logPosition); diff --git a/src/add-ons/kernel/file_systems/bfs/Volume.cpp b/src/add-ons/kernel/file_systems/bfs/Volume.cpp index 42b9bea63d..2ce9f5fce2 100644 --- a/src/add-ons/kernel/file_systems/bfs/Volume.cpp +++ b/src/add-ons/kernel/file_systems/bfs/Volume.cpp @@ -4,7 +4,7 @@ */ -//! super block, mounting, etc. +//! superblock, mounting, etc. #include "Attribute.h" @@ -342,13 +342,13 @@ Volume::Mount(const char* deviceName, uint32 flags) if (opener.IsReadOnly()) fFlags |= VOLUME_READ_ONLY; - // read the super block + // read the superblock if (Identify(fDevice, &fSuperBlock) != B_OK) { - FATAL(("invalid super block!\n")); + FATAL(("invalid superblock!\n")); return B_BAD_VALUE; } - // initialize short hands to the super block (to save byte swapping) + // initialize short hands to the superblock (to save byte swapping) fBlockSize = fSuperBlock.BlockSize(); fBlockShift = fSuperBlock.BlockShift(); fAllocationGroupShift = fSuperBlock.AllocationGroupShift(); @@ -633,7 +633,7 @@ Volume::CheckSuperBlock(const uint8* data, uint32* _offset) } #ifndef BFS_LITTLE_ENDIAN_ONLY - // For PPC, the super block might be located at offset 0 + // For PPC, the superblock might be located at offset 0 superBlock = (disk_super_block*)data; if (superBlock->IsValid()) { if (_offset != NULL) @@ -692,11 +692,11 @@ Volume::Initialize(int fd, const char* name, uint32 blockSize, off_t numBlocks = deviceSize / blockSize; - // create valid super block + // create valid superblock fSuperBlock.Initialize(name, numBlocks, blockSize); - // initialize short hands to the super block (to save byte swapping) + // initialize short hands to the superblock (to save byte swapping) fBlockSize = fSuperBlock.BlockSize(); fBlockShift = fSuperBlock.BlockShift(); fAllocationGroupShift = fSuperBlock.AllocationGroupShift(); diff --git a/src/add-ons/kernel/file_systems/btrfs/Volume.cpp b/src/add-ons/kernel/file_systems/btrfs/Volume.cpp index 13fc4823aa..0afac4c96f 100644 --- a/src/add-ons/kernel/file_systems/btrfs/Volume.cpp +++ b/src/add-ons/kernel/file_systems/btrfs/Volume.cpp @@ -5,7 +5,7 @@ */ -//! Super block, mounting, etc. +//! Superblock, mounting, etc. #include "Volume.h" @@ -270,7 +270,7 @@ Volume::Mount(const char* deviceName, uint32 flags) if (opener.IsReadOnly()) fFlags |= VOLUME_READ_ONLY; - // read the super block + // read the superblock status_t status = Identify(fDevice, &fSuperBlock); if (status != B_OK) { ERROR("Volume::Mount(): Identify() failed\n"); @@ -526,7 +526,7 @@ Volume::Identify(int fd, btrfs_super_block* superBlock) return B_IO_ERROR; if (!superBlock->IsValid()) { - ERROR("invalid super block!\n"); + ERROR("invalid superblock!\n"); return B_BAD_VALUE; } diff --git a/src/add-ons/kernel/file_systems/exfat/Volume.cpp b/src/add-ons/kernel/file_systems/exfat/Volume.cpp index 528ecb43cc..1881909751 100644 --- a/src/add-ons/kernel/file_systems/exfat/Volume.cpp +++ b/src/add-ons/kernel/file_systems/exfat/Volume.cpp @@ -5,7 +5,7 @@ */ -//! Super block, mounting, etc. +//! Superblock, mounting, etc. #include "Volume.h" @@ -310,7 +310,7 @@ Volume::Mount(const char* deviceName, uint32 flags) if (opener.IsReadOnly()) fFlags |= VOLUME_READ_ONLY; - // read the super block + // read the superblock status_t status = Identify(fDevice, &fSuperBlock); if (status != B_OK) { ERROR("Volume::Mount(): Identify() failed\n"); @@ -502,7 +502,7 @@ Volume::Identify(int fd, exfat_super_block* superBlock) return B_IO_ERROR; if (!superBlock->IsValid()) { - ERROR("invalid super block!\n"); + ERROR("invalid superblock!\n"); return B_BAD_VALUE; } diff --git a/src/add-ons/kernel/file_systems/ext2/Volume.cpp b/src/add-ons/kernel/file_systems/ext2/Volume.cpp index 3ff776ae40..b833eee746 100644 --- a/src/add-ons/kernel/file_systems/ext2/Volume.cpp +++ b/src/add-ons/kernel/file_systems/ext2/Volume.cpp @@ -5,7 +5,7 @@ */ -//! Super block, mounting, etc. +//! Superblock, mounting, etc. #include "Volume.h" @@ -300,7 +300,7 @@ Volume::Mount(const char* deviceName, uint32 flags) fSuperBlock.CompatibleFeatures(), fSuperBlock.IncompatibleFeatures(), fSuperBlock.ReadOnlyFeatures()); - // read the super block + // read the superblock status_t status = Identify(fDevice, &fSuperBlock); if (status != B_OK) { FATAL("Volume::Mount(): Identify() failed\n"); @@ -311,7 +311,7 @@ Volume::Mount(const char* deviceName, uint32 flags) if (!IsReadOnly() && _UnsupportedReadOnlyFeatures(fSuperBlock) != 0) return B_UNSUPPORTED; - // initialize short hands to the super block (to save byte swapping) + // initialize short hands to the superblock (to save byte swapping) fBlockShift = fSuperBlock.BlockShift(); if (fBlockShift < 10 || fBlockShift > 16) return B_ERROR; @@ -930,7 +930,7 @@ Volume::Identify(int fd, ext2_super_block* superBlock) return B_IO_ERROR; if (!superBlock->IsValid()) { - FATAL("invalid super block!\n"); + FATAL("invalid superblock!\n"); return B_BAD_VALUE; } diff --git a/src/add-ons/kernel/file_systems/reiserfs/SuperBlock.cpp b/src/add-ons/kernel/file_systems/reiserfs/SuperBlock.cpp index 6fe15076e1..0051223d0f 100644 --- a/src/add-ons/kernel/file_systems/reiserfs/SuperBlock.cpp +++ b/src/add-ons/kernel/file_systems/reiserfs/SuperBlock.cpp @@ -30,12 +30,12 @@ using std::nothrow; /*! \class DirEntry - \brief Represents the on-disk structure for super block of the FS. + \brief Represents the on-disk structure for superblock of the FS. There exist two versions of the structure and this class can deal with both of them. This class can also handle a very old layout that puts the super block in a different location. The Init() methods tries to find and read - the super block from disk. + the superblock from disk. */ // read_super_block @@ -47,13 +47,13 @@ read_super_block(int device, off_t offset, const char *magic, { super_block_t *superBlock = NULL; status_t error = B_OK; - // allocate memory for the super block + // allocate memory for the superblock if (error == B_OK) { superBlock = new(nothrow) super_block_t; if (!superBlock) error = B_NO_MEMORY; } - // read the super block + // read the superblock if (error == B_OK) { size_t size = sizeof(super_block_t); if (read_pos(device, offset, superBlock, size) != (int32)size) diff --git a/src/add-ons/kernel/file_systems/reiserfs/Volume.cpp b/src/add-ons/kernel/file_systems/reiserfs/Volume.cpp index f40ff2fbd6..5c848966ca 100644 --- a/src/add-ons/kernel/file_systems/reiserfs/Volume.cpp +++ b/src/add-ons/kernel/file_systems/reiserfs/Volume.cpp @@ -57,7 +57,7 @@ static inline C max(const C &a, const C &b) { return (a > b ? a : b); } \brief Represents a volume. The Volume class bundles all functionality related to a volume. - It knows the super block and has some basic functionality needed + It knows the superblock and has some basic functionality needed for handling VNodes. Actually it should be the layer that provides the abstraction from VNodes. The design is not strict in this respect (the whole thing evolved while I was in the process of understanding @@ -97,7 +97,7 @@ Volume::Identify(int fd, partition_data *partition) if (fDevice < 0) return B_ERROR; - // read and analyze super block + // read and analyze superblock return _ReadSuperBlock(); } @@ -130,7 +130,7 @@ Volume::Mount(fs_volume *fsVolume, const char *path) if (fDevice < 0) SET_ERROR(error, errno); } - // read and analyze super block + // read and analyze superblock if (error == B_OK) error = _ReadSuperBlock(); @@ -534,12 +534,12 @@ Volume::_ReadSuperBlock() error = B_NO_MEMORY; // check FS state if (error == B_OK && fSuperBlock->GetState() != REISERFS_VALID_FS) { - FATAL(("The super block indicates a non-valid FS! Bailing out.")); + FATAL(("The superblock indicates a non-valid FS! Bailing out.")); error = B_ERROR; } // check FS version if (error == B_OK && fSuperBlock->GetVersion() > REISERFS_VERSION_2) { - FATAL(("The super block indicates a version greater than 2 (%u)! " + FATAL(("The superblock indicates a version greater than 2 (%u)! " "Bailing out.", fSuperBlock->GetVersion())); error = B_ERROR; } diff --git a/src/add-ons/kernel/file_systems/reiserfs/reiserfs.h b/src/add-ons/kernel/file_systems/reiserfs/reiserfs.h index d51315fe2b..35aa36af70 100644 --- a/src/add-ons/kernel/file_systems/reiserfs/reiserfs.h +++ b/src/add-ons/kernel/file_systems/reiserfs/reiserfs.h @@ -220,7 +220,7 @@ struct reiserfs_de_head // // -// super block's field values +// superblock's field values // #define REISERFS_VERSION_0 0 /* undistributed bitmap */ #define REISERFS_VERSION_1 1 /* distributed bitmap and resizer*/ @@ -232,7 +232,7 @@ struct reiserfs_de_head #define R5_HASH 3 #define DEFAULT_HASH R5_HASH -/* this is the on disk super block */ +/* this is the on disk superblock */ struct reiserfs_super_block { diff --git a/src/add-ons/kernel/file_systems/userlandfs/userlandfs b/src/add-ons/kernel/file_systems/userlandfs/userlandfs index aef6d9e556..050f4e35d2 100644 --- a/src/add-ons/kernel/file_systems/userlandfs/userlandfs +++ b/src/add-ons/kernel/file_systems/userlandfs/userlandfs @@ -39,7 +39,7 @@ file_system obfs { is_buffer false } - # dump super block + # dump superblock ioctl 56743 { buffer_size 0 write_buffer_size 0 diff --git a/src/bin/bfs_tools/bfsinfo.cpp b/src/bin/bfs_tools/bfsinfo.cpp index 6b7438b8f6..44b64ccda4 100644 --- a/src/bin/bfs_tools/bfsinfo.cpp +++ b/src/bin/bfs_tools/bfsinfo.cpp @@ -118,7 +118,7 @@ main(int argc, char **argv) if (argc < 2 || !strcmp(argv[1], "--help")) { char *filename = strrchr(argv[0],'/'); fprintf(stderr,"usage: %s [-srib] [allocation_group start]\n" - "\t-s\tdump super block\n" + "\t-s\tdump superblock\n" "\t-r\tdump root node\n" " the following options need the allocation_group/start " "parameters:\n" @@ -214,7 +214,7 @@ main(int argc, char **argv) } if (disk.ValidateSuperBlock() < B_OK) { - fprintf(stderr, "The disk's super block is corrupt (or it's not a BFS " + fprintf(stderr, "The disk's superblock is corrupt (or it's not a BFS " "device)!\n"); return 0; } diff --git a/src/bin/bfs_tools/bfswhich.cpp b/src/bin/bfs_tools/bfswhich.cpp index 973cdce6eb..61b870a9e4 100644 --- a/src/bin/bfs_tools/bfswhich.cpp +++ b/src/bin/bfs_tools/bfswhich.cpp @@ -286,7 +286,7 @@ main(int argc, char** argv) } if (disk.ValidateSuperBlock() != B_OK) { - fprintf(stderr, "The disk's super block is corrupt!\n"); + fprintf(stderr, "The disk's superblock is corrupt!\n"); return -1; } @@ -307,7 +307,7 @@ main(int argc, char** argv) disk.Log().allocation_group, disk.Log().start, disk.Log().length); } else if (block < 1) { - printf("Super Block intersects\n"); + printf("Superblock intersects\n"); } else if (block < 1 + disk.BitmapSize()) { printf("Block bitmap intersects (start %d, end %lu)\n", 1, disk.BitmapSize()); diff --git a/src/bin/bfs_tools/lib/Disk.h b/src/bin/bfs_tools/lib/Disk.h index 890a14e5e7..37aa51cad7 100644 --- a/src/bin/bfs_tools/lib/Disk.h +++ b/src/bin/bfs_tools/lib/Disk.h @@ -1,6 +1,6 @@ #ifndef DISK_H #define DISK_H -/* Disk - handles BFS super block, disk access etc. +/* Disk - handles BFS superblock, disk access etc. ** ** Copyright (c) 2001-2003 pinc Software. All Rights Reserved. */ diff --git a/src/bin/bfs_tools/recover.cpp b/src/bin/bfs_tools/recover.cpp index 9a2677e1ec..a556c9e02b 100644 --- a/src/bin/bfs_tools/recover.cpp +++ b/src/bin/bfs_tools/recover.cpp @@ -709,7 +709,7 @@ usage(char *name) "\t-i\trecreate indices on target disk\n" "\t-d\tdump missing and recreated i-nodes\n" "\t-r\tdisk access in raw mode (use only if the partition table is invalid)\n" - "\t-s\trecreate super block and exit (for experts only, don't use this\n" + "\t-s\trecreate superblock and exit (for experts only, don't use this\n" "\t\tif you don't know what you're doing)\n" "\t-v\tverbose output\n", name); exit(-1); @@ -804,15 +804,15 @@ main(int argc, char **argv) bool recreatedSuperBlock = false; if (disk.ValidateSuperBlock() < B_OK) { - fprintf(stderr, "The disk's super block is corrupt!\n"); + fprintf(stderr, "The disk's superblock is corrupt!\n"); if (disk.RecreateSuperBlock() < B_OK) { - fprintf(stderr, "Can't recreate the disk's super block, sorry!\n"); + fprintf(stderr, "Can't recreate the disk's superblock, sorry!\n"); return -1; } recreatedSuperBlock = true; } if (gVerbose) { - puts("\n*** The super block:\n"); + puts("\n*** The superblock:\n"); dump_super_block(disk.SuperBlock()); } @@ -825,7 +825,7 @@ main(int argc, char **argv) status_t status = disk.WriteAt(512, disk.SuperBlock(), sizeof(disk_super_block)); if (status < B_OK) { - fprintf(stderr, "Could not write super block: %s!\n", + fprintf(stderr, "Could not write superblock: %s!\n", strerror(status)); return 1; } diff --git a/src/bin/coreutils/man/sync.1 b/src/bin/coreutils/man/sync.1 index ac699123fa..3c17ffe78e 100644 --- a/src/bin/coreutils/man/sync.1 +++ b/src/bin/coreutils/man/sync.1 @@ -8,7 +8,7 @@ sync \- flush file system buffers .SH DESCRIPTION .\" Add any additional description here .PP -Force changed blocks to disk, update the super block. +Force changed blocks to disk, update the superblock. .TP \fB\-\-help\fR display this help and exit diff --git a/src/bin/coreutils/src/sync.c b/src/bin/coreutils/src/sync.c index 730df10ba9..81a5fa9afd 100644 --- a/src/bin/coreutils/src/sync.c +++ b/src/bin/coreutils/src/sync.c @@ -1,4 +1,4 @@ -/* sync - update the super block +/* sync - update the superblock Copyright (C) 1994-2004, 2008-2010 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -40,7 +40,7 @@ usage (int status) { printf (_("Usage: %s [OPTION]\n"), program_name); fputs (_("\ -Force changed blocks to disk, update the super block.\n\ +Force changed blocks to disk, update the superblock.\n\ \n\ "), stdout); fputs (HELP_OPTION_DESCRIPTION, stdout); diff --git a/src/system/boot/loader/file_systems/bfs/bfs.cpp b/src/system/boot/loader/file_systems/bfs/bfs.cpp index 26da30fe8c..f6cfd3b36a 100644 --- a/src/system/boot/loader/file_systems/bfs/bfs.cpp +++ b/src/system/boot/loader/file_systems/bfs/bfs.cpp @@ -54,7 +54,7 @@ Volume::Volume(boot::Partition *partition) #endif } - TRACE(("bfs: we do have a valid super block (name = %s)!\n", fSuperBlock.name)); + TRACE(("bfs: we do have a valid superblock (name = %s)!\n", fSuperBlock.name)); fRootNode = new(nothrow) BFS::Directory(*this, Root()); if (fRootNode == NULL) diff --git a/src/system/boot/platform/atari_m68k/devices.cpp b/src/system/boot/platform/atari_m68k/devices.cpp index 93f9c5bf56..002467c7e8 100644 --- a/src/system/boot/platform/atari_m68k/devices.cpp +++ b/src/system/boot/platform/atari_m68k/devices.cpp @@ -317,7 +317,7 @@ fill_disk_identifier_v2(disk_identifier &disk, const drive_parameters ¶meter static off_t get_next_check_sum_offset(int32 index, off_t maxSize) { - // The boot block often contains the disk super block, and should be + // The boot block often contains the disk superblock, and should be // unique enough for most cases if (index < 2) return index * 512; diff --git a/src/system/boot/platform/bios_ia32/devices.cpp b/src/system/boot/platform/bios_ia32/devices.cpp index 5c50c47f11..3a93f2f885 100644 --- a/src/system/boot/platform/bios_ia32/devices.cpp +++ b/src/system/boot/platform/bios_ia32/devices.cpp @@ -368,7 +368,7 @@ fill_disk_identifier_v2(disk_identifier &disk, const drive_parameters ¶meter static off_t get_next_check_sum_offset(int32 index, off_t maxSize) { - // The boot block often contains the disk super block, and should be + // The boot block often contains the disk superblock, and should be // unique enough for most cases if (index < 2) return index * 512; diff --git a/src/tests/add-ons/kernel/file_systems/bfs/dump_log/dump_log.cpp b/src/tests/add-ons/kernel/file_systems/bfs/dump_log/dump_log.cpp index 2bdfe1e72d..42e99cbecd 100644 --- a/src/tests/add-ons/kernel/file_systems/bfs/dump_log/dump_log.cpp +++ b/src/tests/add-ons/kernel/file_systems/bfs/dump_log/dump_log.cpp @@ -147,7 +147,7 @@ dumpLogEntry(int device, disk_super_block &superBlock, int32 &start, uint8 *bloc break; off_t value = array[arrayIndex]; - printf("%7ld: %Ld%s\n", index, value, value == 0 ? " (super block)" : + printf("%7ld: %Ld%s\n", index, value, value == 0 ? " (superblock)" : value < bitmapSize + 1 ? " (bitmap block)" : ""); if (data != NULL) { @@ -208,12 +208,12 @@ main(int argc, char **argv) disk_super_block superBlock; if (read_pos(device, 512, &superBlock, sizeof(disk_super_block)) < (ssize_t)sizeof(disk_super_block)) { - fprintf(stderr, "%s: could not read super block.\n", sProgramName); + fprintf(stderr, "%s: could not read superblock.\n", sProgramName); return -1; } if (!superBlock.IsValid()) { - fprintf(stderr, "%s: invalid super block!\n", sProgramName); + fprintf(stderr, "%s: invalid superblock!\n", sProgramName); return -1; } diff --git a/src/tests/add-ons/kernel/file_systems/bfs/r5/BlockAllocator.cpp b/src/tests/add-ons/kernel/file_systems/bfs/r5/BlockAllocator.cpp index bd55c4c984..b2c558f3d7 100644 --- a/src/tests/add-ons/kernel/file_systems/bfs/r5/BlockAllocator.cpp +++ b/src/tests/add-ons/kernel/file_systems/bfs/r5/BlockAllocator.cpp @@ -568,7 +568,7 @@ BlockAllocator::AllocateBlocks(Transaction *transaction, int32 group, uint16 sta fVolume->SuperBlock().used_blocks = HOST_ENDIAN_TO_BFS_INT64(fVolume->UsedBlocks() + numBlocks); - // We are not writing back the disk's super block - it's + // We are not writing back the disk's superblock - it's // either done by the journaling code, or when the disk // is unmounted. // If the value is not correct at mount time, it will be diff --git a/src/tests/add-ons/kernel/file_systems/bfs/r5/Inode.cpp b/src/tests/add-ons/kernel/file_systems/bfs/r5/Inode.cpp index 93460d90c2..b0cfe63f78 100644 --- a/src/tests/add-ons/kernel/file_systems/bfs/r5/Inode.cpp +++ b/src/tests/add-ons/kernel/file_systems/bfs/r5/Inode.cpp @@ -1928,7 +1928,7 @@ Inode::Remove(Transaction *transaction, const char *name, off_t *_id, bool isDir * adds the created inode to that parent directory. If an attribute directory * is created, it will also automatically added to the parent inode as such. * However, the indices root node, and the regular root node won't be added - * to the super block. + * to the superblock. * It will also create the initial B+tree for the inode if it's a directory * of any kind. * If the "_id" or "_inode" variable is given and non-NULL to store the inode's diff --git a/src/tests/add-ons/kernel/file_systems/bfs/r5/Journal.cpp b/src/tests/add-ons/kernel/file_systems/bfs/r5/Journal.cpp index b5cadf57e0..1656afae5d 100644 --- a/src/tests/add-ons/kernel/file_systems/bfs/r5/Journal.cpp +++ b/src/tests/add-ons/kernel/file_systems/bfs/r5/Journal.cpp @@ -307,7 +307,7 @@ Journal::blockNotify(off_t blockNumber, size_t numBlocks, void *arg) free(logEntry); - // update the super block, and change the disk's state, if necessary + // update the superblock, and change the disk's state, if necessary if (update) { journal->fVolume->LogStart() = superBlock.log_start; @@ -317,7 +317,7 @@ Journal::blockNotify(off_t blockNumber, size_t numBlocks, void *arg) status_t status = journal->fVolume->WriteSuperBlock(); if (status != B_OK) - FATAL(("blockNotify: could not write back super block: %s\n", strerror(status))); + FATAL(("blockNotify: could not write back superblock: %s\n", strerror(status))); } } @@ -421,7 +421,7 @@ Journal::WriteLogEntry() fUsed += array->CountItems(); - // Update the log end pointer in the super block + // Update the log end pointer in the superblock fVolume->SuperBlock().flags = HOST_ENDIAN_TO_BFS_INT32(SUPER_BLOCK_DISK_DIRTY); fVolume->SuperBlock().log_end = HOST_ENDIAN_TO_BFS_INT64(logPosition); fVolume->LogEnd() = logPosition; diff --git a/src/tests/add-ons/kernel/file_systems/bfs/r5/ToDo b/src/tests/add-ons/kernel/file_systems/bfs/r5/ToDo index 8a4f8be104..0ab920b6a9 100644 --- a/src/tests/add-ons/kernel/file_systems/bfs/r5/ToDo +++ b/src/tests/add-ons/kernel/file_systems/bfs/r5/ToDo @@ -76,7 +76,7 @@ kernel_interface general stuff - There are also some comments with a leading "ToDo:" directly in the code which may not be mentioned here. - - implement mkbfs (try to do it in OpenBeOS style directly - only write the super block from user space) + - implement mkbfs (try to do it in OpenBeOS style directly - only write the superblock from user space) ----- diff --git a/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/SuperBlock.cpp b/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/SuperBlock.cpp index 24fcc099be..ca33dc327d 100644 --- a/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/SuperBlock.cpp +++ b/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/SuperBlock.cpp @@ -30,10 +30,10 @@ using std::nothrow; /*! \class DirEntry - \brief Represents the on-disk structure for super block of the FS. + \brief Represents the on-disk structure for superblock of the FS. There exist two versions of the structure and this class can deal with - both of them. The Init() methods tries to find and read the super block + both of them. The Init() methods tries to find and read the superblock from disk. */ @@ -46,13 +46,13 @@ read_super_block(int device, off_t offset, const char *magic, { super_block_t *superBlock = NULL; status_t error = B_OK; - // allocate memory for the super block + // allocate memory for the superblock if (error == B_OK) { superBlock = new(nothrow) super_block_t; if (!superBlock) error = B_NO_MEMORY; } - // read the super block + // read the superblock if (error == B_OK) { size_t size = sizeof(super_block_t); if (read_pos(device, offset, superBlock, size) != (int32)size) diff --git a/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/Volume.cpp b/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/Volume.cpp index a63c0c2e99..661fee970d 100644 --- a/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/Volume.cpp +++ b/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/Volume.cpp @@ -53,7 +53,7 @@ static inline C max(const C &a, const C &b) { return (a > b ? a : b); } \brief Represents a volume. The Volume class bundles all functionality related to a volume. - It knows the super block and has some basic functionality needed + It knows the superblock and has some basic functionality needed for handling VNodes. Actually it should be the layer that provides the abstraction from VNodes. The design is not strict in this respect (the whole thing evolved while I was in the process of understanding @@ -111,7 +111,7 @@ Volume::Mount(nspace_id id, const char *path) if (fDevice < 0) SET_ERROR(error, errno); } - // read and analyze super block + // read and analyze superblock if (error == B_OK) error = _ReadSuperBlock(); // create and init block cache @@ -497,12 +497,12 @@ Volume::_ReadSuperBlock() error = B_NO_MEMORY; // check FS state if (error == B_OK && fSuperBlock->GetState() != REISERFS_VALID_FS) { - FATAL(("The super block indicates a non-valid FS! Bailing out.")); + FATAL(("The superblock indicates a non-valid FS! Bailing out.")); error = B_ERROR; } // check FS version if (error == B_OK && fSuperBlock->GetVersion() > REISERFS_VERSION_2) { - FATAL(("The super block indicates a version greater than 2 (%u)! " + FATAL(("The superblock indicates a version greater than 2 (%u)! " "Bailing out.", fSuperBlock->GetVersion())); error = B_ERROR; } diff --git a/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/reiserfs.h b/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/reiserfs.h index 4fe1ab027a..53cbb0631e 100644 --- a/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/reiserfs.h +++ b/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/reiserfs.h @@ -220,7 +220,7 @@ struct reiserfs_de_head // // -// super block's field values +// superblock's field values // #define REISERFS_VERSION_0 0 /* undistributed bitmap */ #define REISERFS_VERSION_1 1 /* distributed bitmap and resizer*/ @@ -232,7 +232,7 @@ struct reiserfs_de_head #define R5_HASH 3 #define DEFAULT_HASH R5_HASH -/* this is the on disk super block */ +/* this is the on disk superblock */ struct reiserfs_super_block { diff --git a/src/tests/add-ons/kernel/file_systems/userlandfs/r5/userlandfs.sample b/src/tests/add-ons/kernel/file_systems/userlandfs/r5/userlandfs.sample index aef6d9e556..050f4e35d2 100644 --- a/src/tests/add-ons/kernel/file_systems/userlandfs/r5/userlandfs.sample +++ b/src/tests/add-ons/kernel/file_systems/userlandfs/r5/userlandfs.sample @@ -39,7 +39,7 @@ file_system obfs { is_buffer false } - # dump super block + # dump superblock ioctl 56743 { buffer_size 0 write_buffer_size 0 diff --git a/src/tests/system/kernel/file_corruption/fs/BlockAllocator.cpp b/src/tests/system/kernel/file_corruption/fs/BlockAllocator.cpp index 4b9ce59640..79e26b4995 100644 --- a/src/tests/system/kernel/file_corruption/fs/BlockAllocator.cpp +++ b/src/tests/system/kernel/file_corruption/fs/BlockAllocator.cpp @@ -722,7 +722,7 @@ BlockAllocator::_FreeInBitmapBlock(uint64 base, uint32 count, status_t BlockAllocator::_UpdateSuperBlock(Transaction& transaction) { - // write the super block + // write the superblock Block block; if (!block.GetWritable(fVolume, kCheckSumFSSuperBlockOffset / B_PAGE_SIZE, transaction)) { diff --git a/src/tests/system/kernel/file_corruption/fs/Volume.cpp b/src/tests/system/kernel/file_corruption/fs/Volume.cpp index ff642e8f4b..82d32dd877 100644 --- a/src/tests/system/kernel/file_corruption/fs/Volume.cpp +++ b/src/tests/system/kernel/file_corruption/fs/Volume.cpp @@ -209,7 +209,7 @@ Volume::Initialize(const char* name) transaction.KeepNode(fRootDirectory); fRootDirectory->SetHardLinks(1); - // write the super block + // write the superblock Block block; if (!block.GetZero(this, kCheckSumFSSuperBlockOffset / B_PAGE_SIZE, transaction)) { @@ -432,7 +432,7 @@ Volume::SetName(const char* name) // we lock the volume now, to keep the locking order (transaction -> volume) MutexLocker locker(fLock); - // update the super block + // update the superblock Block block; if (!block.GetWritable(this, kCheckSumFSSuperBlockOffset / B_PAGE_SIZE, transaction)) { From 5644d283b63aa82f578848dd04eaf1f27cb4c060 Mon Sep 17 00:00:00 2001 From: Matt Madia Date: Sun, 9 Dec 2012 08:51:58 -0500 Subject: [PATCH 24/57] Manually applied: Fix typos: super block -> superblock (#8974) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit by: Przemysław Buczkowski --- .../kernel/file_systems/ext2/Journal.cpp | 72 +++++++++---------- src/bin/bfs_tools/chkindex.cpp | 24 +++---- src/bin/bfs_tools/lib/Disk.cpp | 12 ++-- src/system/boot/platform/bios_ia32/stage1.S | 4 +- .../bfs/fragmenter/fragmenter.cpp | 18 ++--- .../kernel/file_systems/bfs/r5/Volume.cpp | 40 +++++------ .../kernel/file_systems/fs_shell/mount.c | 40 +++++------ 7 files changed, 105 insertions(+), 105 deletions(-) diff --git a/src/add-ons/kernel/file_systems/ext2/Journal.cpp b/src/add-ons/kernel/file_systems/ext2/Journal.cpp index d7f2d4c345..ab65174a46 100644 --- a/src/add-ons/kernel/file_systems/ext2/Journal.cpp +++ b/src/add-ons/kernel/file_systems/ext2/Journal.cpp @@ -114,7 +114,7 @@ Journal::Journal(Volume* fsVolume, Volume* jVolume) fInitStatus = B_NO_MEMORY; else { fInitStatus = revokeManager->Init(); - + if (fInitStatus == B_OK) { fRevokeManager = revokeManager; fInitStatus = _LoadSuperBlock(); @@ -270,7 +270,7 @@ Journal::Unlock(Transaction* owner, bool success) { TRACE("Journal::Unlock(): Lock recursion: %ld\n", recursive_lock_get_recursion(&fLock)); - if (fSeparateSubTransactions + if (fSeparateSubTransactions || recursive_lock_get_recursion(&fLock) == 1) { // we only end the transaction if we unlock it if (owner != NULL) { @@ -309,7 +309,7 @@ Journal::MapBlock(off_t logical, fsblock_t& physical) { TRACE("Journal::MapBlock()\n"); physical = logical; - + return B_OK; } @@ -340,7 +340,7 @@ Journal::TransactionID() const status_t -Journal::_WritePartialTransactionToLog(JournalHeader* descriptorBlock, +Journal::_WritePartialTransactionToLog(JournalHeader* descriptorBlock, bool detached, uint8** _escapedData, uint32 &logBlock, off_t& blockNumber, long& cookie, ArrayDeleter& escapedDataDeleter, uint32& blockCount, bool& finished) @@ -353,7 +353,7 @@ Journal::_WritePartialTransactionToLog(JournalHeader* descriptorBlock, JournalBlockTag* tag = (JournalBlockTag*)descriptorBlock->data; JournalBlockTag* lastTag = (JournalBlockTag*)((uint8*)descriptorBlock + fBlockSize - sizeof(JournalHeader)); - + finished = false; status_t status = B_OK; @@ -430,11 +430,11 @@ Journal::_WritePartialTransactionToLog(JournalHeader* descriptorBlock, } finished = status != B_OK; - + // Write descriptor block --tag; tag->SetLastTagFlag(); - + fsblock_t physicalBlock; status = MapBlock(descriptorBlockPos, physicalBlock); if (status != B_OK) @@ -493,14 +493,14 @@ Journal::_WriteTransactionToLog() if (size > FreeLogBlocks()) { TRACE("Journal::_WriteTransactionToLog(): Syncing block cache\n"); cache_sync_transaction(fFilesystemBlockCache, fTransactionID); - + if (size > FreeLogBlocks()) { panic("Transaction fits, but sync didn't result in enough" "free space.\n\tGot %ld when at least %ld was expected.", FreeLogBlocks(), size); } } - + TRACE("Journal::_WriteTransactionToLog(): finished managing space for " "the transaction\n"); @@ -511,7 +511,7 @@ Journal::_WriteTransactionToLog() // Prepare Descriptor block TRACE("Journal::_WriteTransactionToLog(): attempting to allocate space for " "the descriptor block, block size %lu\n", fBlockSize); - JournalHeader* descriptorBlock = + JournalHeader* descriptorBlock = (JournalHeader*)new(std::nothrow) uint8[fBlockSize]; if (descriptorBlock == NULL) { TRACE("Journal::_WriteTransactionToLog(): Failed to allocate a buffer " @@ -525,7 +525,7 @@ Journal::_WriteTransactionToLog() // Prepare Commit block TRACE("Journal::_WriteTransactionToLog(): attempting to allocate space for " "the commit block, block size %lu\n", fBlockSize); - JournalHeader* commitBlock = + JournalHeader* commitBlock = (JournalHeader*)new(std::nothrow) uint8[fBlockSize]; if (descriptorBlock == NULL) { TRACE("Journal::_WriteTransactionToLog(): Failed to allocate a buffer " @@ -555,7 +555,7 @@ Journal::_WriteTransactionToLog() uint32 blockCount = 0; uint32 logBlock = _WrapAroundLog(fLogEnd); - + bool finished = false; status = _WritePartialTransactionToLog(descriptorBlock, detached, @@ -574,10 +574,10 @@ Journal::_WriteTransactionToLog() blockCount, finished); if (!finished && status != B_OK) return status; - + // It is okay to write the commit blocks of the partial transactions // as long as the commit block of the first partial transaction isn't - // written. When it recovery reaches where the first commit should be + // written. When it recovery reaches where the first commit should be // and doesn't find it, it considers it found the end of the log. fsblock_t physicalBlock; @@ -586,7 +586,7 @@ Journal::_WriteTransactionToLog() return status; off_t logOffset = physicalBlock * fBlockSize; - + TRACE("Journal::_WriteTransactionToLog(): Writting commit block to " "%lld\n", logOffset); off_t written = write_pos(fJournalVolume->Device(), logOffset, @@ -598,7 +598,7 @@ Journal::_WriteTransactionToLog() commitBlock->IncrementSequence(); blockCount++; - + logBlock = _WrapAroundLog(logBlock + 1); } @@ -617,7 +617,7 @@ Journal::_WriteTransactionToLog() TRACE("Failed to write journal commit block.\n"); return B_IO_ERROR; } - + blockCount++; fLogEnd = _WrapAroundLog(fLogEnd + blockCount); @@ -670,7 +670,7 @@ Journal::_SaveSuperBlock() off_t superblockPos = physicalBlock * fBlockSize; JournalSuperBlock superblock; - size_t bytesRead = read_pos(fJournalVolume->Device(), superblockPos, + size_t bytesRead = read_pos(fJournalVolume->Device(), superblockPos, &superblock, sizeof(superblock)); if (bytesRead != sizeof(superblock)) @@ -678,7 +678,7 @@ Journal::_SaveSuperBlock() superblock.SetFirstCommitID(fFirstCommitID); superblock.SetLogStart(fLogStart); - + TRACE("Journal::SaveSuperBlock(): Write to %lld\n", superblockPos); size_t bytesWritten = write_pos(fJournalVolume->Device(), superblockPos, &superblock, sizeof(superblock)); @@ -701,10 +701,10 @@ Journal::_LoadSuperBlock() status_t status = MapBlock(0, superblockPos); if (status != B_OK) return status; - - TRACE("Journal::_LoadSuperBlock(): super block physical block: %llu\n", + + TRACE("Journal::_LoadSuperBlock(): superblock physical block: %llu\n", superblockPos); - + JournalSuperBlock superblock; size_t bytesRead = read_pos(fJournalVolume->Device(), superblockPos * fJournalVolume->BlockSize(), &superblock, sizeof(superblock)); @@ -803,7 +803,7 @@ Journal::_CountTags(JournalHeader* descriptorBlock) if ((tags->Flags() & JOURNAL_FLAG_LAST_TAG) != 0) count++; - + TRACE("Journal::_CountTags(): counted tags: %lu\n", count); return count; @@ -824,7 +824,7 @@ Journal::Recover() status_t status = _RecoverPassScan(lastCommitID); if (status != B_OK) return status; - + status = _RecoverPassRevoke(lastCommitID); if (status != B_OK) return status; @@ -978,7 +978,7 @@ Journal::_RecoverPassReplay(uint32 lastCommitID) "data\n"); return B_NO_MEMORY; } - + ArrayDeleter dataDeleter(data); while (nextCommitID < lastCommitID) { @@ -994,7 +994,7 @@ Journal::_RecoverPassReplay(uint32 lastCommitID) JournalBlockTag* last_tag = (JournalBlockTag*)((uint8*)header + fBlockSize - sizeof(JournalBlockTag)); - for (JournalBlockTag* tag = (JournalBlockTag*)header->data; + for (JournalBlockTag* tag = (JournalBlockTag*)header->data; tag <= last_tag; ++tag) { nextBlock = _WrapAroundLog(nextBlock + 1); @@ -1002,7 +1002,7 @@ Journal::_RecoverPassReplay(uint32 lastCommitID) if (status != B_OK) return status; - if (!fRevokeManager->Lookup(tag->BlockNumber(), + if (!fRevokeManager->Lookup(tag->BlockNumber(), nextCommitID)) { // Block isn't revoked size_t read = read_pos(fJournalVolume->Device(), @@ -1111,7 +1111,7 @@ Journal::_FlushLog(bool canWait, bool flushBlocks) TRACE("Journal::_FlushLog(): Finished. Releasing lock\n"); recursive_lock_unlock(&fLock); - + TRACE("Journal::_FlushLog(): Done, final status: %s\n", strerror(status)); return status; } @@ -1160,9 +1160,9 @@ Journal::_FullTransactionSize() const size_t count = cache_blocks_in_transaction(fFilesystemBlockCache, fTransactionID); - + TRACE("\tFull transaction size: %ld\n", count); - + return count; } @@ -1174,9 +1174,9 @@ Journal::_MainTransactionSize() const size_t count = cache_blocks_in_main_transaction(fFilesystemBlockCache, fTransactionID); - + TRACE("\tMain transaction size: %ld\n", count); - + return count; } @@ -1200,7 +1200,7 @@ Journal::_TransactionDone(bool success) TRACE("Journal::_TransactionDone(): returning B_OK\n"); return B_OK; } - + // If possible, delay flushing the transaction uint32 size = _FullTransactionSize(); TRACE("Journal::_TransactionDone(): full transaction size: %lu, max " @@ -1209,11 +1209,11 @@ Journal::_TransactionDone(bool success) if (fMaxTransactionSize > 0 && size < fMaxTransactionSize) { TRACE("Journal::_TransactionDone(): delaying flush of transaction " "%ld\n", fTransactionID); - + // Make sure the transaction fits in the log if (size < FreeLogBlocks()) cache_sync_transaction(fFilesystemBlockCache, fTransactionID); - + fUnwrittenTransactions++; TRACE("Journal::_TransactionDone(): returning B_OK\n"); return B_OK; @@ -1253,7 +1253,7 @@ Journal::_TransactionWritten(int32 transactionID, int32 event, void* _logEntry) if (journal->_SaveSuperBlock() != B_OK) panic("ext2: Failed to write journal superblock\n"); } - + TRACE("Journal::_TransactionWritten(): Removing log entry\n"); journal->fLogEntries.Remove(logEntry); diff --git a/src/bin/bfs_tools/chkindex.cpp b/src/bin/bfs_tools/chkindex.cpp index e31a827fda..8c141b6bf1 100644 --- a/src/bin/bfs_tools/chkindex.cpp +++ b/src/bin/bfs_tools/chkindex.cpp @@ -52,10 +52,10 @@ class BlockRunHashtable : public Hashtable return false; memcpy(value,&run,sizeof(block_run)); - + if (Hashtable::Put(value,value)) return true; - + free(value); return false; } @@ -133,7 +133,7 @@ collectFiles(Disk &disk) return; } collectFiles(disk,root); - + printf(" %7Ld files found.\n",gCount); delete root; @@ -201,7 +201,7 @@ checkFiles(Disk &disk,BPlusTree &tree,char *attribute) { runs[index++] = *run; } - + // sort array to speed up disk access qsort(runs,index,sizeof(block_run),(int (*)(const void *,const void *))compareBlockRuns); @@ -227,7 +227,7 @@ checkFiles(Disk &disk,BPlusTree &tree,char *attribute) delete inode; continue; } - + // check indices not based on standard attributes if (sizeIndex) { @@ -422,7 +422,7 @@ main(int argc,char **argv) printUsage(toolName); return -1; } - + while (*++argv) { char *arg = *argv; @@ -447,7 +447,7 @@ main(int argc,char **argv) else break; } - + char *attribute = argv[0]; if (!gCheckAll && attribute == NULL) { @@ -476,13 +476,13 @@ main(int argc,char **argv) fprintf(stderr,"Could not open device or file \"%s\": %s\n",info.device_name,strerror(status)); return -1; } - + if (disk.ValidateSuperBlock() < B_OK) { - fprintf(stderr,"The disk's super block is corrupt!\n"); + fprintf(stderr,"The disk's superblock is corrupt!\n"); return -1; } - + Directory *indices = (Directory *)Inode::Factory(&disk,disk.Indices()); if (indices == NULL || (status = indices->InitCheck()) < B_OK) { @@ -497,7 +497,7 @@ main(int argc,char **argv) delete indices; return -1; } - + block_run run; if (gCheckAll) @@ -515,7 +515,7 @@ main(int argc,char **argv) fprintf(stderr," Could not find index directory for \"%s\"!\n",attribute); delete indices; - + gHashtable.MakeEmpty(HASH_EMPTY_NONE,HASH_EMPTY_FREE); return 0; diff --git a/src/bin/bfs_tools/lib/Disk.cpp b/src/bin/bfs_tools/lib/Disk.cpp index 5571a29dfb..5d0fd07f73 100644 --- a/src/bin/bfs_tools/lib/Disk.cpp +++ b/src/bin/bfs_tools/lib/Disk.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2001-2008 pinc Software. All Rights Reserved. */ -//! Handles BFS super block, disk access etc. +//! Handles BFS superblock, disk access etc. #include "Disk.h" #include "dump.h" @@ -157,7 +157,7 @@ Disk::Disk(const char *deviceName, bool rawMode, off_t start, off_t stop) if (fBufferedFile->ReadAt(512 + fRawDiskOffset, &fSuperBlock, sizeof(disk_super_block)) < 1) - fprintf(stderr,"Disk: Could not read super block\n"); + fprintf(stderr,"Disk: Could not read superblock\n"); //dump_super_block(&fSuperBlock); } @@ -277,21 +277,21 @@ Disk::ScanForSuperBlock(off_t start, off_t stop) printf("\n(%ld) *** BFS superblock found at: %Ld\n",superBlocks.CountItems() + 1,offset); dump_super_block(super); - // add a copy of the super block to the list + // add a copy of the superblock to the list bfs_disk_info *info = (bfs_disk_info *)malloc(sizeof(bfs_disk_info)); if (info == NULL) return B_NO_MEMORY; memcpy(&info->super_block, super, sizeof(disk_super_block)); info->offset = offset + i - 512; - /* location off the BFS super block is 512 bytes after the partition start */ + /* location off the BFS superblock is 512 bytes after the partition start */ superBlocks.AddItem(info); } } } if (superBlocks.CountItems() == 0) { - puts("\nCouldn't find any BFS super blocks!"); + puts("\nCouldn't find any BFS superblocks!"); return B_ENTRY_NOT_FOUND; } @@ -411,7 +411,7 @@ Disk::RecreateSuperBlock() bfs_inode indexDir; bfs_inode rootDir; if (ScanForIndexAndRoot(&indexDir,&rootDir) < B_OK) { - fprintf(stderr,"ERROR: Could not find root directory! Trying to recreate the super block will have no effect!\n\tSetting standard values for the root dir.\n"); + fprintf(stderr,"ERROR: Could not find root directory! Trying to recreate the superblock will have no effect!\n\tSetting standard values for the root dir.\n"); rootDir.inode_num.allocation_group = 8; rootDir.inode_num.start = 0; rootDir.inode_num.length = 1; diff --git a/src/system/boot/platform/bios_ia32/stage1.S b/src/system/boot/platform/bios_ia32/stage1.S index d8ce1181a2..af463698ed 100644 --- a/src/system/boot/platform/bios_ia32/stage1.S +++ b/src/system/boot/platform/bios_ia32/stage1.S @@ -130,7 +130,7 @@ struc BlockRun .length resw 1 endstruc -; BFS super block +; BFS superblock struc SuperBlock .name resb 32 .magic1 resd 1 @@ -665,7 +665,7 @@ kBootBlockSignature dw 0xaa55 second_boot_block: -; first comes the BFS super block +; first comes the BFS superblock superblock: %rep sizeof(SuperBlock) db 0 diff --git a/src/tests/add-ons/kernel/file_systems/bfs/fragmenter/fragmenter.cpp b/src/tests/add-ons/kernel/file_systems/bfs/fragmenter/fragmenter.cpp index 74e016a8a9..8d9a20da5a 100644 --- a/src/tests/add-ons/kernel/file_systems/bfs/fragmenter/fragmenter.cpp +++ b/src/tests/add-ons/kernel/file_systems/bfs/fragmenter/fragmenter.cpp @@ -90,7 +90,7 @@ count_bits(int value) count++; value >>= 1; } - + return count; } @@ -102,7 +102,7 @@ main(int argc, const char *const *argv) exit(1); } - const char *fileName = argv[1]; + const char *fileName = argv[1]; const char *patternString = (argc >= 3 ? argv[2] : "0f"); // skip leading "0x" in the pattern string @@ -151,12 +151,12 @@ main(int argc, const char *const *argv) exit(1); } - // read super block + // read superblock disk_super_block superBlock; read_from(fd, 512, &superBlock, sizeof(superBlock)); if (superBlock.magic1 != SUPER_BLOCK_MAGIC1) { - fprintf(stderr, "Error: Bad super block magic. This is probably not a " + fprintf(stderr, "Error: Bad superblock magic. This is probably not a " "BFS image.\n"); exit(1); } @@ -172,12 +172,12 @@ main(int argc, const char *const *argv) int64 blockCount = st.st_size / blockSize; if (blockCount != superBlock.num_blocks) { fprintf(stderr, "Error: Number of blocks in image and the number in " - "the super block differ: %lld vs. %lld\n", blockCount, + "the superblock differ: %lld vs. %lld\n", blockCount, superBlock.num_blocks); exit(1); } - - + + // iterate through the block bitmap blocks and or the bytes with 0x0f uint8 *block = new uint8[blockSize]; int64 occupiedBlocks = 0; @@ -206,10 +206,10 @@ main(int argc, const char *const *argv) printf("bfs_fragmenter: marked %lld blocks used\n", occupiedBlocks); - // write back the super block + // write back the superblock superBlock.used_blocks += occupiedBlocks; write_to(fd, 512, &superBlock, sizeof(superBlock)); - + return 0; } diff --git a/src/tests/add-ons/kernel/file_systems/bfs/r5/Volume.cpp b/src/tests/add-ons/kernel/file_systems/bfs/r5/Volume.cpp index 3eb82e2c04..a5d6f9e8ff 100644 --- a/src/tests/add-ons/kernel/file_systems/bfs/r5/Volume.cpp +++ b/src/tests/add-ons/kernel/file_systems/bfs/r5/Volume.cpp @@ -3,7 +3,7 @@ * This file may be used under the terms of the MIT License. */ -//! super block, mounting, etc. +//! superblock, mounting, etc. #include "Debug.h" @@ -73,7 +73,7 @@ DeviceOpener::~DeviceOpener() } -int +int DeviceOpener::Open(const char *device, int mode) { fDevice = open(device, mode); @@ -93,7 +93,7 @@ DeviceOpener::InitCache(off_t numBlocks) } -void +void DeviceOpener::RemoveCache(int mode) { if (!fCached) @@ -104,7 +104,7 @@ DeviceOpener::RemoveCache(int mode) } -void +void DeviceOpener::Keep() { fDevice = -1; @@ -115,7 +115,7 @@ DeviceOpener::Keep() * to compute the size, or fstat() if that failed. */ -status_t +status_t DeviceOpener::GetSize(off_t *_size, uint32 *_blockSize) { device_geometry geometry; @@ -257,7 +257,7 @@ Volume::IsValidSuperBlock() } -void +void Volume::Panic() { FATAL(("we have to panic... switch to read-only mode!\n")); @@ -313,13 +313,13 @@ Volume::Mount(const char *deviceName, uint32 flags) } #endif - // read the super block + // read the superblock if (Identify(fDevice, &fSuperBlock) != B_OK) { - FATAL(("invalid super block!\n")); + FATAL(("invalid superblock!\n")); return B_BAD_VALUE; } - // initialize short hands to the super block (to save byte swapping) + // initialize short hands to the superblock (to save byte swapping) fBlockSize = fSuperBlock.BlockSize(); fBlockShift = fSuperBlock.BlockShift(); fAllocationGroupShift = fSuperBlock.AllocationGroupShift(); @@ -409,7 +409,7 @@ Volume::Unmount() } -status_t +status_t Volume::Sync() { return fJournal->FlushLogAndBlocks(); @@ -431,7 +431,7 @@ Volume::ValidateBlockRun(block_run run) } -block_run +block_run Volume::ToBlockRun(off_t block) const { block_run run; @@ -456,14 +456,14 @@ Volume::CreateIndicesRoot(Transaction *transaction) } -status_t +status_t Volume::AllocateForInode(Transaction *transaction, const Inode *parent, mode_t type, block_run &run) { return fBlockAllocator.AllocateForInode(transaction, &parent->BlockRun(), type, run); } -status_t +status_t Volume::WriteSuperBlock() { if (write_pos(fDevice, 512, &fSuperBlock, sizeof(disk_super_block)) != sizeof(disk_super_block)) @@ -494,7 +494,7 @@ Volume::UpdateLiveQueries(Inode *inode, const char *attribute, int32 type, const * the queries - it wouldn't safe you anything in this case. */ -bool +bool Volume::CheckForLiveQuery(const char *attribute) { // ToDo: check for a live query that depends on the specified attribute @@ -502,7 +502,7 @@ Volume::CheckForLiveQuery(const char *attribute) } -void +void Volume::AddQuery(Query *query) { if (fQueryLock.Lock() < B_OK) @@ -514,7 +514,7 @@ Volume::AddQuery(Query *query) } -void +void Volume::RemoveQuery(Query *query) { if (fQueryLock.Lock() < B_OK) @@ -537,7 +537,7 @@ Volume::Identify(int fd, disk_super_block *superBlock) if (read_pos(fd, 0, buffer, sizeof(buffer)) != sizeof(buffer)) return B_IO_ERROR; - // Note: that does work only for x86, for PowerPC, the super block + // Note: that does work only for x86, for PowerPC, the superblock // may be located at offset 0! memcpy(superBlock, buffer + 512, sizeof(disk_super_block)); if (!superBlock->IsValid()) { @@ -583,11 +583,11 @@ Volume::Initialize(const char *device, const char *name, uint32 blockSize, uint3 off_t numBlocks = deviceSize / blockSize; - // create valid super block + // create valid superblock fSuperBlock.Initialize(name, numBlocks, blockSize); - - // initialize short hands to the super block (to save byte swapping) + + // initialize short hands to the superblock (to save byte swapping) fBlockSize = fSuperBlock.BlockSize(); fBlockShift = fSuperBlock.BlockShift(); fAllocationGroupShift = fSuperBlock.AllocationGroupShift(); diff --git a/src/tests/add-ons/kernel/file_systems/fs_shell/mount.c b/src/tests/add-ons/kernel/file_systems/fs_shell/mount.c index 6f8e4b7486..9ab66ca28a 100644 --- a/src/tests/add-ons/kernel/file_systems/fs_shell/mount.c +++ b/src/tests/add-ons/kernel/file_systems/fs_shell/mount.c @@ -1,8 +1,8 @@ /* This file contains the code that will create a file system, mount a file system and unmount a file system. - - THIS CODE COPYRIGHT DOMINIC GIAMPAOLO. NO WARRANTY IS EXPRESSED + + THIS CODE COPYRIGHT DOMINIC GIAMPAOLO. NO WARRANTY IS EXPRESSED OR IMPLIED. YOU MAY USE THIS CODE AND FREELY DISTRIBUTE IT FOR NON-COMMERCIAL USE AS LONG AS THIS NOTICE REMAINS ATTACHED. @@ -62,7 +62,7 @@ myfs_create_fs(char *device, char *name, int block_size, char *opts) printf("block_size %d is not a power of two!\n", block_size); return NULL; } - + myfs = (myfs_info *)calloc(1, sizeof(myfs_info)); if (myfs == NULL) { @@ -73,7 +73,7 @@ myfs_create_fs(char *device, char *name, int block_size, char *opts) myfs->fd = -1; myfs->nsid = (nspace_id)myfs; /* we can only do this when creating */ - + myfs->dsb.magic1 = SUPER_BLOCK_MAGIC1; myfs->dsb.magic2 = SUPER_BLOCK_MAGIC2; myfs->dsb.magic3 = SUPER_BLOCK_MAGIC3; @@ -84,7 +84,7 @@ myfs_create_fs(char *device, char *name, int block_size, char *opts) printf("can't create semaphore!\n"); goto cleanup; } - + myfs->fd = open(device, O_RDWR); if (myfs->fd < 0) { @@ -126,7 +126,7 @@ myfs_create_fs(char *device, char *name, int block_size, char *opts) printf("create storage map failed\n"); goto cleanup; } - + if (myfs_create_inodes(myfs) != 0) { printf("create inodes failed\n"); goto cleanup; @@ -150,7 +150,7 @@ myfs_create_fs(char *device, char *name, int block_size, char *opts) printf("creating superblock failed\n"); goto cleanup; } - + return myfs; @@ -174,7 +174,7 @@ cleanup: delete_sem(myfs->sem); free(myfs); - } + } return NULL; @@ -191,13 +191,13 @@ super_block_is_sane(myfs_info *myfs) myfs->dsb.magic2 != SUPER_BLOCK_MAGIC2 || myfs->dsb.magic3 != SUPER_BLOCK_MAGIC3) { - printf("warning: super block magic numbers are wrong:\n"); + printf("warning: superblock magic numbers are wrong:\n"); printf("0x%x (0x%x) 0x%x (0x%x) 0x%x (0x%x)\n", myfs->dsb.magic1, SUPER_BLOCK_MAGIC1, myfs->dsb.magic2, SUPER_BLOCK_MAGIC2, myfs->dsb.magic3, SUPER_BLOCK_MAGIC3); return 0; - + } if ((myfs->dsb.block_size % myfs->dev_block_size) != 0) { @@ -214,7 +214,7 @@ super_block_is_sane(myfs_info *myfs) return 0; } - /* make sure that the partition is as big as the super block + /* make sure that the partition is as big as the superblock says it is */ num_dev_blocks = get_num_device_blocks(myfs->fd); if (myfs->dsb.num_blocks * myfs->dsb.block_size > @@ -227,7 +227,7 @@ super_block_is_sane(myfs_info *myfs) if (myfs->dsb.block_size != (1 << myfs->dsb.block_shift)) { int i; - + printf("warning: block_shift %d does not match block size %d\n", myfs->dsb.block_shift, myfs->dsb.block_size); @@ -279,7 +279,7 @@ myfs_mount(nspace_id nsid, const char *device, ulong flags, ret = ENOMEM; goto error0; } - + myfs->fd = open(device, oflags); if (myfs->fd < 0) { printf("could not open %s to try and mount a myfs\n", device); @@ -288,13 +288,13 @@ myfs_mount(nspace_id nsid, const char *device, ulong flags, } if (read_super_block(myfs) != 0) { - printf("could not read super block on device %s\n", device); + printf("could not read superblock on device %s\n", device); ret = EBADF; goto error2; } - + if (super_block_is_sane(myfs) == 0) { - printf("bad super block\n"); + printf("bad superblock\n"); ret = EBADF; goto error2; } @@ -377,15 +377,15 @@ myfs_mount(nspace_id nsid, const char *device, ulong flags, /* note that the order in which things are done here is *very* important. don't mess with it unless you know what you're doing -*/ +*/ int myfs_unmount(void *ns) { myfs_info *myfs = (myfs_info *)ns; - + if (myfs == NULL) return EINVAL; - + sync_journal(myfs); myfs_shutdown_storage_map(myfs); @@ -405,7 +405,7 @@ myfs_unmount(void *ns) shutdown_tmp_blocks(myfs); close(myfs->fd); - + if (myfs->sem > 0) delete_sem(myfs->sem); From 47f015cc947856a92105ba00962233e28fecd75d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Buczkowski?= Date: Sat, 6 Oct 2012 21:11:30 +0200 Subject: [PATCH 25/57] Polish default keymap change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Swapped Polish typist's keymap with much more frequently used programmer's keymap. Signed-off-by: Przemysław Buczkowski Signed-off-by: Matt Madia --- ...r's).keymap => Polish (Typewriter).keymap} | 194 +++++++++++------- src/data/keymaps/Polish.keymap | 194 +++++++----------- 2 files changed, 194 insertions(+), 194 deletions(-) rename src/data/keymaps/{Polish (programmer's).keymap => Polish (Typewriter).keymap} (63%) diff --git a/src/data/keymaps/Polish (programmer's).keymap b/src/data/keymaps/Polish (Typewriter).keymap similarity index 63% rename from src/data/keymaps/Polish (programmer's).keymap rename to src/data/keymaps/Polish (Typewriter).keymap index 655b281373..e1c26735a6 100644 --- a/src/data/keymaps/Polish (programmer's).keymap +++ b/src/data/keymaps/Polish (Typewriter).keymap @@ -1,7 +1,5 @@ #!/bin/keymap -l # -# Polish Programmer's keymap -# # Raw key numbering for 101 keyboard... # [sys] [brk] # 0x7e 0x7f @@ -78,21 +76,20 @@ Key 0x0d = 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 Key 0x0e = 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 Key 0x0f = 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 Key 0x10 = 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 -# "universal" dead key -Key 0x11 = '`' '~' '' ' ' '' '`' '~' ' ' '' -Key 0x12 = '1' '!' '' ' ' '' '1' '!' ' ' '' -Key 0x13 = '2' '@' 0x00 ' ' '' '2' '@' ' ' '' -Key 0x14 = '3' '#' '' ' ' '' '3' '#' ' ' '' -Key 0x15 = '4' '$' '' ' ' '' '4' '$' ' ' '' -Key 0x16 = '5' '%' '' ' ' '' '5' '%' ' ' '' -Key 0x17 = '6' '^' 0x1e ' ' '' '6' '^' ' ' '' -Key 0x18 = '7' '&' '' ' ' '' '7' '&' ' ' '' -Key 0x19 = '8' '*' '' ' ' '' '8' '*' ' ' '' -Key 0x1a = '9' '(' '' ' ' '' '9' '(' ' ' '' -Key 0x1b = '0' ')' '' ' ' '' '0' ')' ' ' '' -Key 0x1c = '-' '_' 0x1f ' ' '' '-' '_' ' ' '' -Key 0x1d = '=' '+' '' ' ' '' '=' '+' ' ' '' -Key 0x1e = 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 +Key 0x11 = 0xcca8 '~' '' ' ' '' 0xcca8 '~' ' ' '' +Key 0x12 = '1' '!' '' '~' '' '1' '!' '~' '' +Key 0x13 = '2' '"' '' 0xcb87 '' '2' '"' 0xcb87 '' +Key 0x14 = '3' '#' '' '^' '' '3' '#' '^' '' +Key 0x15 = '4' '$' '' 0xcb98 '' '4' '$' 0xcb98 '' +Key 0x16 = '5' '%' '' 0xc2b0 '' '5' '%' 0xc2b0 '' +Key 0x17 = '6' '&' '' 0xcb9b '' '6' '&' 0xcb9b '' +Key 0x18 = '7' '/' '' '`' '' '7' '/' '`' '' +Key 0x19 = '8' '(' '' 0xcb99 '' '8' '(' 0xcb99 '' +Key 0x1a = '9' ')' '' 0xc2b4 '' '9' ')' 0xc2b4 '' +Key 0x1b = '0' '=' '' 0xcb9d '' '0' '=' 0xcb9d '' +Key 0x1c = '+' '?' '' 0xc2a8 '' '+' '?' 0xc2a8 '' +Key 0x1d = '\'' '*' '' 0xc2b8 '' '\'' '*' 0xc2b8 '' +Key 0x1e = 0x08 0x08 0x1c 0x08 0x08 0x08 0x08 0x08 0x08 Key 0x1f = 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 Key 0x20 = 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 Key 0x21 = 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b @@ -101,20 +98,19 @@ Key 0x23 = '/' '/' '/' '/' '/' '/' '/' '/' Key 0x24 = '*' '*' '*' '*' '*' '*' '*' '*' '*' Key 0x25 = '-' '-' '-' '-' '-' '-' '-' '-' '-' Key 0x26 = 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 -Key 0x27 = 'q' 'Q' 0x11 ' ' '' 'Q' 'q' ' ' '' -Key 0x28 = 'w' 'W' 0x17 ' ' '' 'W' 'w' ' ' '' -Key 0x29 = 'e' 'E' 0x05 0xc499 0xc498 'E' 'e' 0xc498 0xc499 +Key 0x27 = 'q' 'Q' 0x11 '\\' '' 'Q' 'q' '\\' '' +Key 0x28 = 'w' 'W' 0x17 '|' '' 'W' 'w' '|' '' +Key 0x29 = 'e' 'E' 0x05 ' ' '' 'E' 'e' ' ' '' Key 0x2a = 'r' 'R' 0x12 ' ' '' 'R' 'r' ' ' '' Key 0x2b = 't' 'T' 0x14 ' ' '' 'T' 't' ' ' '' -Key 0x2c = 'y' 'Y' 0x19 ' ' '' 'Y' 'y' ' ' '' -# EURO SIGN +Key 0x2c = 'z' 'Z' 0x1a ' ' '' 'Z' 'z' ' ' '' Key 0x2d = 'u' 'U' 0x15 0xe282ac '' 'U' 'u' 0xe282ac '' Key 0x2e = 'i' 'I' 0x09 ' ' '' 'I' 'i' ' ' '' -Key 0x2f = 'o' 'O' 0x0f 0xc3b3 0xc393 'O' 'o' 0xc393 0xc3b3 +Key 0x2f = 'o' 'O' 0x0f ' ' '' 'O' 'o' ' ' '' Key 0x30 = 'p' 'P' 0x10 ' ' '' 'P' 'p' ' ' '' -Key 0x31 = '[' '{' 0x1b ' ' '' '[' '{' ' ' '' -Key 0x32 = ']' '}' 0x1d ' ' '' ']' '}' ' ' '' -Key 0x33 = '\\' '|' 0x1c ' ' '' '\\' '|' ' ' '' +Key 0x31 = 0xc5bc 0xc584 '' 0xc3b7 '' 0xc5bc 0xc584 0xc3b7 '' +Key 0x32 = 0xc59b 0xc487 '' 0xc397 '' 0xc59b 0xc487 0xc397 '' +Key 0x33 = 0xc3b3 0xc5ba '' ' ' '' 0xc3b3 0xc5ba ' ' '' Key 0x34 = 0x7f 0x7f 0x7f 0x7f 0x7f 0x7f 0x7f 0x7f 0x7f Key 0x35 = 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 Key 0x36 = 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c @@ -123,32 +119,32 @@ Key 0x38 = 0x1e '8' 0x1e 0x1e '8' 0x1e '8' 0x1e Key 0x39 = 0x0b '9' 0x0b 0x0b '9' 0x0b '9' 0x0b '9' Key 0x3a = '+' '+' '+' '+' '+' '+' '+' '+' '+' Key 0x3b = '' '' '' '' '' '' '' '' '' -Key 0x3c = 'a' 'A' 0x01 0xc485 0xc484 'A' 'a' 0xc484 0xc485 -Key 0x3d = 's' 'S' 0x13 0xc59b 0xc59a 'S' 's' 0xc59a 0xc59b -Key 0x3e = 'd' 'D' 0x04 ' ' '' 'D' 'd' ' ' '' -Key 0x3f = 'f' 'F' 0x06 ' ' '' 'F' 'f' ' ' '' -Key 0x40 = 'g' 'G' 0x07 ' ' '' 'G' 'g' ' ' '' +Key 0x3c = 'a' 'A' 0x01 ' ' '' 'A' 'a' ' ' '' +Key 0x3d = 's' 'S' 0x13 0xc491 '' 'S' 's' 0xc491 '' +Key 0x3e = 'd' 'D' 0x04 0xc490 '' 'D' 'd' 0xc490 '' +Key 0x3f = 'f' 'F' 0x06 '[' '' 'F' 'f' '[' '' +Key 0x40 = 'g' 'G' 0x07 ']' '' 'G' 'g' ']' '' Key 0x41 = 'h' 'H' 0x08 ' ' '' 'H' 'h' ' ' '' Key 0x42 = 'j' 'J' 0x0a ' ' '' 'J' 'j' ' ' '' Key 0x43 = 'k' 'K' 0x0b ' ' '' 'K' 'k' ' ' '' -Key 0x44 = 'l' 'L' 0x0c 0xc582 0xc581 'L' 'l' 0xc581 0xc582 -Key 0x45 = ';' ':' '' ' ' '' ';' ':' ' ' '' -Key 0x46 = '\'' '"' '' ' ' '' '\'' '"' ' ' '' +Key 0x44 = 'l' 'L' 0x0c ' ' '' 'L' 'l' ' ' '' +Key 0x45 = 0xc582 0xc581 '' '$' '' 0xc581 0xc582 '$' '' +Key 0x46 = 0xc485 0xc499 '' 0xc39f '' 0xc485 0xc499 0xc39f '' Key 0x47 = 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a Key 0x48 = 0x1c '4' 0x1c 0x1c '4' 0x1c '4' 0x1c '4' Key 0x49 = '' '5' '' '' '5' '' '5' '' '5' Key 0x4a = 0x1d '6' 0x1d 0x1d '6' 0x1d '6' 0x1d '6' Key 0x4b = '' '' '' '' '' '' '' '' '' -Key 0x4c = 'z' 'Z' 0x1a 0xc5bc 0xc5bb 'Z' 'z' 0xc5bb 0xc5bc -Key 0x4d = 'x' 'X' 0x18 0xc5ba 0xc5b9 'X' 'x' 0xc5b9 0xc5ba -Key 0x4e = 'c' 'C' 0x03 0xc487 0xc486 'C' 'c' 0xc486 0xc487 -Key 0x4f = 'v' 'V' 0x16 ' ' '' 'V' 'v' ' ' '' -Key 0x50 = 'b' 'B' 0x02 ' ' '' 'B' 'b' ' ' '' -Key 0x51 = 'n' 'N' 0x0e 0xc584 0xc583 'N' 'n' 0xc583 0xc584 -Key 0x52 = 'm' 'M' 0x0d ' ' '' 'M' 'm' ' ' '' -Key 0x53 = ',' '<' '' ' ' '' ',' '<' ' ' '' -Key 0x54 = '.' '>' '' ' ' '' '.' '>' ' ' '' -Key 0x55 = '/' '?' '' ' ' '' '/' '?' ' ' '' +Key 0x4c = 'y' 'Y' 0x19 ' ' '' 'Y' 'y' ' ' '' +Key 0x4d = 'x' 'X' 0x18 ' ' '' 'X' 'x' ' ' '' +Key 0x4e = 'c' 'C' 0x03 ' ' '' 'C' 'c' ' ' '' +Key 0x4f = 'v' 'V' 0x16 '@' '' 'V' 'v' '@' '' +Key 0x50 = 'b' 'B' 0x02 '{' '' 'B' 'b' '{' '' +Key 0x51 = 'n' 'N' 0x0e '}' '' 'N' 'n' '}' '' +Key 0x52 = 'm' 'M' 0x0d 0xc2a7 '' 'M' 'm' 0xc2a7 '' +Key 0x53 = ',' ';' '' '<' '' ',' ';' '<' '' +Key 0x54 = '.' ':' '' '>' '' '.' ':' '>' '' +Key 0x55 = '-' '_' 0x1f ' ' '' '-' '_' ' ' '' Key 0x56 = '' '' '' '' '' '' '' '' '' Key 0x57 = 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e Key 0x58 = 0x04 '1' 0x04 0x04 '1' 0x04 '1' 0x04 '1' @@ -168,7 +164,7 @@ Key 0x65 = 0x7f ',' 0x7f 0x7f ',' 0x7f ',' 0x7f Key 0x66 = '' '' '' '' '' '' '' '' '' Key 0x67 = '' '' '' '' '' '' '' '' '' Key 0x68 = '' '' '' '' '' '' '' '' '' -Key 0x69 = '\\' '|' 0x1c ' ' '' '\\' '|' ' ' '' +Key 0x69 = '<' '>' 0x1c ' ' '' '<' '>' ' ' '' Key 0x6a = '' '' '' '' '' '' '' '' '' Key 0x6b = '' '' '' '' '' '' '' '' '' Key 0x6c = '' '' '' '' '' '' '' '' '' @@ -191,30 +187,88 @@ Key 0x7c = '' '' '' '' '' '' '' '' Key 0x7d = '' '' '' '' '' '' '' '' '' Key 0x7e = '' '' '' '' '' '' '' '' '' Key 0x7f = '' '' '' '' '' '' '' '' '' -AcuteTab = +Acute ' ' = 0xc2b4 +Acute 'A' = 0xc381 +Acute 'E' = 0xc389 +Acute 'I' = 0xc38d +Acute 'O' = 0xc393 +Acute 'U' = 0xc39a +Acute 'Y' = 0xc39d +Acute 'a' = 0xc3a1 +Acute 'e' = 0xc3a9 +Acute 'i' = 0xc3ad +Acute 'o' = 0xc3b3 +Acute 'u' = 0xc3ba +Acute 'y' = 0xc3bd +Acute '' = '' +Acute '' = '' +Acute '' = '' +AcuteTab = Option Option-Shift CapsLock-Option CapsLock-Option-Shift +Grave ' ' = '`' +Grave 'A' = 0xc380 +Grave 'E' = 0xc388 +Grave 'I' = 0xc38c +Grave 'O' = 0xc392 +Grave 'U' = 0xc399 +Grave 'a' = 0xc3a0 +Grave 'e' = 0xc3a8 +Grave 'i' = 0xc3ac +Grave 'o' = 0xc3b2 +Grave 'u' = 0xc3b9 +Grave '' = '' +Grave '' = '' +Grave '' = '' +Grave '' = '' +Grave '' = '' GraveTab = -CircumflexTab = -DiaeresisTab = -# Tilde is used as "universal" diacritic -# for acute, dot above, stroke and ogonek -# Only 16 entries are too few! -Tilde ' ' = '~' # U+007E -#Tilde 'A' = 0xc484 # U+0104 LATIN CAPITAL LETTER A WITH OGONEK -#Tilde 'E' = 0xc498 # U+0118 LATIN CAPITAL LETTER E WITH OGONEK -Tilde 'L' = 0xc581 # U+0141 LATIN CAPITAL LETTER L WITH STROKE -Tilde 'C' = 0xc486 # U+0106 LATIN CAPITAL LETTER C WITH ACUTE -Tilde 'N' = 0xc583 # U+0143 LATIN CAPITAL LETTER N WITH ACUTE -#Tilde 'O' = 0xc393 # U+00D3 LATIN CAPITAL LETTER O WITH ACUTE -Tilde 'S' = 0xc59a # U+015A LATIN CAPITAL LETTER S WITH ACUTE -Tilde 'X' = 0xc5b9 # U+0179 LATIN CAPITAL LETTER Z WITH ACUTE -Tilde 'Z' = 0xc5bb # U+017B LATIN CAPITAL LETTER Z WITH DOT ABOVE -Tilde 'a' = 0xc485 # U+0105 LATIN SMALL LETTER A WITH OGONEK -Tilde 'e' = 0xc499 # U+0119 LATIN SMALL LETTER E WITH OGONEK -Tilde 'l' = 0xc582 # U+0142 LATIN SMALL LETTER L WITH STROKE -Tilde 'c' = 0xc487 # U+0107 LATIN SMALL LETTER C WITH ACUTE -Tilde 'n' = 0xc584 # U+0144 LATIN SMALL LETTER N WITH ACUTE -Tilde 'o' = 0xc3b3 # U+00F3 LATIN SMALL LETTER O WITH ACUTE -Tilde 's' = 0xc59b # U+015B LATIN SMALL LETTER S WITH ACUTE -Tilde 'x' = 0xc5ba # U+017A LATIN SMALL LETTER Z WITH ACUTE -Tilde 'z' = 0xc5bc # U+017C LATIN SMALL LETTER Z WITH DOT ABOVE +Circumflex ' ' = '^' +Circumflex 'A' = 0xc382 +Circumflex 'E' = 0xc38a +Circumflex 'I' = 0xc38e +Circumflex 'O' = 0xc394 +Circumflex 'U' = 0xc39b +Circumflex 'a' = 0xc3a2 +Circumflex 'e' = 0xc3aa +Circumflex 'i' = 0xc3ae +Circumflex 'o' = 0xc3b4 +Circumflex 'u' = 0xc3bb +Circumflex '' = '' +Circumflex '' = '' +Circumflex '' = '' +Circumflex '' = '' +Circumflex '' = '' +CircumflexTab = Option Option-Shift CapsLock-Option CapsLock-Option-Shift +Diaeresis ' ' = 0xc2a8 +Diaeresis 'A' = 0xc384 +Diaeresis 'E' = 0xc38b +Diaeresis 'I' = 0xc38f +Diaeresis 'O' = 0xc396 +Diaeresis 'U' = 0xc39c +Diaeresis 'Y' = 0xc5b8 +Diaeresis 'a' = 0xc3a4 +Diaeresis 'e' = 0xc3ab +Diaeresis 'i' = 0xc3af +Diaeresis 'o' = 0xc3b6 +Diaeresis 'u' = 0xc3bc +Diaeresis 'y' = 0xc3bf +Diaeresis '' = '' +Diaeresis '' = '' +Diaeresis '' = '' +DiaeresisTab = Normal Shift Option Option-Shift CapsLock CapsLock-Shift CapsLock-Option CapsLock-Option-Shift +Tilde ' ' = '~' +Tilde 'L' = 0xc581 +Tilde 'C' = 0xc486 +Tilde 'N' = 0xc583 +Tilde 'S' = 0xc59a +Tilde 'X' = 0xc5b9 +Tilde 'Z' = 0xc5bb +Tilde 'a' = 0xc485 +Tilde 'e' = 0xc499 +Tilde 'l' = 0xc582 +Tilde 'c' = 0xc487 +Tilde 'n' = 0xc584 +Tilde 'o' = 0xc3b3 +Tilde 's' = 0xc59b +Tilde 'x' = 0xc5ba +Tilde 'z' = 0xc5bc TildeTab = Normal Shift Control CapsLock CapsLock-Shift diff --git a/src/data/keymaps/Polish.keymap b/src/data/keymaps/Polish.keymap index e1c26735a6..655b281373 100644 --- a/src/data/keymaps/Polish.keymap +++ b/src/data/keymaps/Polish.keymap @@ -1,5 +1,7 @@ #!/bin/keymap -l # +# Polish Programmer's keymap +# # Raw key numbering for 101 keyboard... # [sys] [brk] # 0x7e 0x7f @@ -76,20 +78,21 @@ Key 0x0d = 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 Key 0x0e = 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 Key 0x0f = 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 Key 0x10 = 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 -Key 0x11 = 0xcca8 '~' '' ' ' '' 0xcca8 '~' ' ' '' -Key 0x12 = '1' '!' '' '~' '' '1' '!' '~' '' -Key 0x13 = '2' '"' '' 0xcb87 '' '2' '"' 0xcb87 '' -Key 0x14 = '3' '#' '' '^' '' '3' '#' '^' '' -Key 0x15 = '4' '$' '' 0xcb98 '' '4' '$' 0xcb98 '' -Key 0x16 = '5' '%' '' 0xc2b0 '' '5' '%' 0xc2b0 '' -Key 0x17 = '6' '&' '' 0xcb9b '' '6' '&' 0xcb9b '' -Key 0x18 = '7' '/' '' '`' '' '7' '/' '`' '' -Key 0x19 = '8' '(' '' 0xcb99 '' '8' '(' 0xcb99 '' -Key 0x1a = '9' ')' '' 0xc2b4 '' '9' ')' 0xc2b4 '' -Key 0x1b = '0' '=' '' 0xcb9d '' '0' '=' 0xcb9d '' -Key 0x1c = '+' '?' '' 0xc2a8 '' '+' '?' 0xc2a8 '' -Key 0x1d = '\'' '*' '' 0xc2b8 '' '\'' '*' 0xc2b8 '' -Key 0x1e = 0x08 0x08 0x1c 0x08 0x08 0x08 0x08 0x08 0x08 +# "universal" dead key +Key 0x11 = '`' '~' '' ' ' '' '`' '~' ' ' '' +Key 0x12 = '1' '!' '' ' ' '' '1' '!' ' ' '' +Key 0x13 = '2' '@' 0x00 ' ' '' '2' '@' ' ' '' +Key 0x14 = '3' '#' '' ' ' '' '3' '#' ' ' '' +Key 0x15 = '4' '$' '' ' ' '' '4' '$' ' ' '' +Key 0x16 = '5' '%' '' ' ' '' '5' '%' ' ' '' +Key 0x17 = '6' '^' 0x1e ' ' '' '6' '^' ' ' '' +Key 0x18 = '7' '&' '' ' ' '' '7' '&' ' ' '' +Key 0x19 = '8' '*' '' ' ' '' '8' '*' ' ' '' +Key 0x1a = '9' '(' '' ' ' '' '9' '(' ' ' '' +Key 0x1b = '0' ')' '' ' ' '' '0' ')' ' ' '' +Key 0x1c = '-' '_' 0x1f ' ' '' '-' '_' ' ' '' +Key 0x1d = '=' '+' '' ' ' '' '=' '+' ' ' '' +Key 0x1e = 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 Key 0x1f = 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 Key 0x20 = 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 Key 0x21 = 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b @@ -98,19 +101,20 @@ Key 0x23 = '/' '/' '/' '/' '/' '/' '/' '/' Key 0x24 = '*' '*' '*' '*' '*' '*' '*' '*' '*' Key 0x25 = '-' '-' '-' '-' '-' '-' '-' '-' '-' Key 0x26 = 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 -Key 0x27 = 'q' 'Q' 0x11 '\\' '' 'Q' 'q' '\\' '' -Key 0x28 = 'w' 'W' 0x17 '|' '' 'W' 'w' '|' '' -Key 0x29 = 'e' 'E' 0x05 ' ' '' 'E' 'e' ' ' '' +Key 0x27 = 'q' 'Q' 0x11 ' ' '' 'Q' 'q' ' ' '' +Key 0x28 = 'w' 'W' 0x17 ' ' '' 'W' 'w' ' ' '' +Key 0x29 = 'e' 'E' 0x05 0xc499 0xc498 'E' 'e' 0xc498 0xc499 Key 0x2a = 'r' 'R' 0x12 ' ' '' 'R' 'r' ' ' '' Key 0x2b = 't' 'T' 0x14 ' ' '' 'T' 't' ' ' '' -Key 0x2c = 'z' 'Z' 0x1a ' ' '' 'Z' 'z' ' ' '' +Key 0x2c = 'y' 'Y' 0x19 ' ' '' 'Y' 'y' ' ' '' +# EURO SIGN Key 0x2d = 'u' 'U' 0x15 0xe282ac '' 'U' 'u' 0xe282ac '' Key 0x2e = 'i' 'I' 0x09 ' ' '' 'I' 'i' ' ' '' -Key 0x2f = 'o' 'O' 0x0f ' ' '' 'O' 'o' ' ' '' +Key 0x2f = 'o' 'O' 0x0f 0xc3b3 0xc393 'O' 'o' 0xc393 0xc3b3 Key 0x30 = 'p' 'P' 0x10 ' ' '' 'P' 'p' ' ' '' -Key 0x31 = 0xc5bc 0xc584 '' 0xc3b7 '' 0xc5bc 0xc584 0xc3b7 '' -Key 0x32 = 0xc59b 0xc487 '' 0xc397 '' 0xc59b 0xc487 0xc397 '' -Key 0x33 = 0xc3b3 0xc5ba '' ' ' '' 0xc3b3 0xc5ba ' ' '' +Key 0x31 = '[' '{' 0x1b ' ' '' '[' '{' ' ' '' +Key 0x32 = ']' '}' 0x1d ' ' '' ']' '}' ' ' '' +Key 0x33 = '\\' '|' 0x1c ' ' '' '\\' '|' ' ' '' Key 0x34 = 0x7f 0x7f 0x7f 0x7f 0x7f 0x7f 0x7f 0x7f 0x7f Key 0x35 = 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 Key 0x36 = 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c @@ -119,32 +123,32 @@ Key 0x38 = 0x1e '8' 0x1e 0x1e '8' 0x1e '8' 0x1e Key 0x39 = 0x0b '9' 0x0b 0x0b '9' 0x0b '9' 0x0b '9' Key 0x3a = '+' '+' '+' '+' '+' '+' '+' '+' '+' Key 0x3b = '' '' '' '' '' '' '' '' '' -Key 0x3c = 'a' 'A' 0x01 ' ' '' 'A' 'a' ' ' '' -Key 0x3d = 's' 'S' 0x13 0xc491 '' 'S' 's' 0xc491 '' -Key 0x3e = 'd' 'D' 0x04 0xc490 '' 'D' 'd' 0xc490 '' -Key 0x3f = 'f' 'F' 0x06 '[' '' 'F' 'f' '[' '' -Key 0x40 = 'g' 'G' 0x07 ']' '' 'G' 'g' ']' '' +Key 0x3c = 'a' 'A' 0x01 0xc485 0xc484 'A' 'a' 0xc484 0xc485 +Key 0x3d = 's' 'S' 0x13 0xc59b 0xc59a 'S' 's' 0xc59a 0xc59b +Key 0x3e = 'd' 'D' 0x04 ' ' '' 'D' 'd' ' ' '' +Key 0x3f = 'f' 'F' 0x06 ' ' '' 'F' 'f' ' ' '' +Key 0x40 = 'g' 'G' 0x07 ' ' '' 'G' 'g' ' ' '' Key 0x41 = 'h' 'H' 0x08 ' ' '' 'H' 'h' ' ' '' Key 0x42 = 'j' 'J' 0x0a ' ' '' 'J' 'j' ' ' '' Key 0x43 = 'k' 'K' 0x0b ' ' '' 'K' 'k' ' ' '' -Key 0x44 = 'l' 'L' 0x0c ' ' '' 'L' 'l' ' ' '' -Key 0x45 = 0xc582 0xc581 '' '$' '' 0xc581 0xc582 '$' '' -Key 0x46 = 0xc485 0xc499 '' 0xc39f '' 0xc485 0xc499 0xc39f '' +Key 0x44 = 'l' 'L' 0x0c 0xc582 0xc581 'L' 'l' 0xc581 0xc582 +Key 0x45 = ';' ':' '' ' ' '' ';' ':' ' ' '' +Key 0x46 = '\'' '"' '' ' ' '' '\'' '"' ' ' '' Key 0x47 = 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a Key 0x48 = 0x1c '4' 0x1c 0x1c '4' 0x1c '4' 0x1c '4' Key 0x49 = '' '5' '' '' '5' '' '5' '' '5' Key 0x4a = 0x1d '6' 0x1d 0x1d '6' 0x1d '6' 0x1d '6' Key 0x4b = '' '' '' '' '' '' '' '' '' -Key 0x4c = 'y' 'Y' 0x19 ' ' '' 'Y' 'y' ' ' '' -Key 0x4d = 'x' 'X' 0x18 ' ' '' 'X' 'x' ' ' '' -Key 0x4e = 'c' 'C' 0x03 ' ' '' 'C' 'c' ' ' '' -Key 0x4f = 'v' 'V' 0x16 '@' '' 'V' 'v' '@' '' -Key 0x50 = 'b' 'B' 0x02 '{' '' 'B' 'b' '{' '' -Key 0x51 = 'n' 'N' 0x0e '}' '' 'N' 'n' '}' '' -Key 0x52 = 'm' 'M' 0x0d 0xc2a7 '' 'M' 'm' 0xc2a7 '' -Key 0x53 = ',' ';' '' '<' '' ',' ';' '<' '' -Key 0x54 = '.' ':' '' '>' '' '.' ':' '>' '' -Key 0x55 = '-' '_' 0x1f ' ' '' '-' '_' ' ' '' +Key 0x4c = 'z' 'Z' 0x1a 0xc5bc 0xc5bb 'Z' 'z' 0xc5bb 0xc5bc +Key 0x4d = 'x' 'X' 0x18 0xc5ba 0xc5b9 'X' 'x' 0xc5b9 0xc5ba +Key 0x4e = 'c' 'C' 0x03 0xc487 0xc486 'C' 'c' 0xc486 0xc487 +Key 0x4f = 'v' 'V' 0x16 ' ' '' 'V' 'v' ' ' '' +Key 0x50 = 'b' 'B' 0x02 ' ' '' 'B' 'b' ' ' '' +Key 0x51 = 'n' 'N' 0x0e 0xc584 0xc583 'N' 'n' 0xc583 0xc584 +Key 0x52 = 'm' 'M' 0x0d ' ' '' 'M' 'm' ' ' '' +Key 0x53 = ',' '<' '' ' ' '' ',' '<' ' ' '' +Key 0x54 = '.' '>' '' ' ' '' '.' '>' ' ' '' +Key 0x55 = '/' '?' '' ' ' '' '/' '?' ' ' '' Key 0x56 = '' '' '' '' '' '' '' '' '' Key 0x57 = 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e Key 0x58 = 0x04 '1' 0x04 0x04 '1' 0x04 '1' 0x04 '1' @@ -164,7 +168,7 @@ Key 0x65 = 0x7f ',' 0x7f 0x7f ',' 0x7f ',' 0x7f Key 0x66 = '' '' '' '' '' '' '' '' '' Key 0x67 = '' '' '' '' '' '' '' '' '' Key 0x68 = '' '' '' '' '' '' '' '' '' -Key 0x69 = '<' '>' 0x1c ' ' '' '<' '>' ' ' '' +Key 0x69 = '\\' '|' 0x1c ' ' '' '\\' '|' ' ' '' Key 0x6a = '' '' '' '' '' '' '' '' '' Key 0x6b = '' '' '' '' '' '' '' '' '' Key 0x6c = '' '' '' '' '' '' '' '' '' @@ -187,88 +191,30 @@ Key 0x7c = '' '' '' '' '' '' '' '' Key 0x7d = '' '' '' '' '' '' '' '' '' Key 0x7e = '' '' '' '' '' '' '' '' '' Key 0x7f = '' '' '' '' '' '' '' '' '' -Acute ' ' = 0xc2b4 -Acute 'A' = 0xc381 -Acute 'E' = 0xc389 -Acute 'I' = 0xc38d -Acute 'O' = 0xc393 -Acute 'U' = 0xc39a -Acute 'Y' = 0xc39d -Acute 'a' = 0xc3a1 -Acute 'e' = 0xc3a9 -Acute 'i' = 0xc3ad -Acute 'o' = 0xc3b3 -Acute 'u' = 0xc3ba -Acute 'y' = 0xc3bd -Acute '' = '' -Acute '' = '' -Acute '' = '' -AcuteTab = Option Option-Shift CapsLock-Option CapsLock-Option-Shift -Grave ' ' = '`' -Grave 'A' = 0xc380 -Grave 'E' = 0xc388 -Grave 'I' = 0xc38c -Grave 'O' = 0xc392 -Grave 'U' = 0xc399 -Grave 'a' = 0xc3a0 -Grave 'e' = 0xc3a8 -Grave 'i' = 0xc3ac -Grave 'o' = 0xc3b2 -Grave 'u' = 0xc3b9 -Grave '' = '' -Grave '' = '' -Grave '' = '' -Grave '' = '' -Grave '' = '' +AcuteTab = GraveTab = -Circumflex ' ' = '^' -Circumflex 'A' = 0xc382 -Circumflex 'E' = 0xc38a -Circumflex 'I' = 0xc38e -Circumflex 'O' = 0xc394 -Circumflex 'U' = 0xc39b -Circumflex 'a' = 0xc3a2 -Circumflex 'e' = 0xc3aa -Circumflex 'i' = 0xc3ae -Circumflex 'o' = 0xc3b4 -Circumflex 'u' = 0xc3bb -Circumflex '' = '' -Circumflex '' = '' -Circumflex '' = '' -Circumflex '' = '' -Circumflex '' = '' -CircumflexTab = Option Option-Shift CapsLock-Option CapsLock-Option-Shift -Diaeresis ' ' = 0xc2a8 -Diaeresis 'A' = 0xc384 -Diaeresis 'E' = 0xc38b -Diaeresis 'I' = 0xc38f -Diaeresis 'O' = 0xc396 -Diaeresis 'U' = 0xc39c -Diaeresis 'Y' = 0xc5b8 -Diaeresis 'a' = 0xc3a4 -Diaeresis 'e' = 0xc3ab -Diaeresis 'i' = 0xc3af -Diaeresis 'o' = 0xc3b6 -Diaeresis 'u' = 0xc3bc -Diaeresis 'y' = 0xc3bf -Diaeresis '' = '' -Diaeresis '' = '' -Diaeresis '' = '' -DiaeresisTab = Normal Shift Option Option-Shift CapsLock CapsLock-Shift CapsLock-Option CapsLock-Option-Shift -Tilde ' ' = '~' -Tilde 'L' = 0xc581 -Tilde 'C' = 0xc486 -Tilde 'N' = 0xc583 -Tilde 'S' = 0xc59a -Tilde 'X' = 0xc5b9 -Tilde 'Z' = 0xc5bb -Tilde 'a' = 0xc485 -Tilde 'e' = 0xc499 -Tilde 'l' = 0xc582 -Tilde 'c' = 0xc487 -Tilde 'n' = 0xc584 -Tilde 'o' = 0xc3b3 -Tilde 's' = 0xc59b -Tilde 'x' = 0xc5ba -Tilde 'z' = 0xc5bc +CircumflexTab = +DiaeresisTab = +# Tilde is used as "universal" diacritic +# for acute, dot above, stroke and ogonek +# Only 16 entries are too few! +Tilde ' ' = '~' # U+007E +#Tilde 'A' = 0xc484 # U+0104 LATIN CAPITAL LETTER A WITH OGONEK +#Tilde 'E' = 0xc498 # U+0118 LATIN CAPITAL LETTER E WITH OGONEK +Tilde 'L' = 0xc581 # U+0141 LATIN CAPITAL LETTER L WITH STROKE +Tilde 'C' = 0xc486 # U+0106 LATIN CAPITAL LETTER C WITH ACUTE +Tilde 'N' = 0xc583 # U+0143 LATIN CAPITAL LETTER N WITH ACUTE +#Tilde 'O' = 0xc393 # U+00D3 LATIN CAPITAL LETTER O WITH ACUTE +Tilde 'S' = 0xc59a # U+015A LATIN CAPITAL LETTER S WITH ACUTE +Tilde 'X' = 0xc5b9 # U+0179 LATIN CAPITAL LETTER Z WITH ACUTE +Tilde 'Z' = 0xc5bb # U+017B LATIN CAPITAL LETTER Z WITH DOT ABOVE +Tilde 'a' = 0xc485 # U+0105 LATIN SMALL LETTER A WITH OGONEK +Tilde 'e' = 0xc499 # U+0119 LATIN SMALL LETTER E WITH OGONEK +Tilde 'l' = 0xc582 # U+0142 LATIN SMALL LETTER L WITH STROKE +Tilde 'c' = 0xc487 # U+0107 LATIN SMALL LETTER C WITH ACUTE +Tilde 'n' = 0xc584 # U+0144 LATIN SMALL LETTER N WITH ACUTE +Tilde 'o' = 0xc3b3 # U+00F3 LATIN SMALL LETTER O WITH ACUTE +Tilde 's' = 0xc59b # U+015B LATIN SMALL LETTER S WITH ACUTE +Tilde 'x' = 0xc5ba # U+017A LATIN SMALL LETTER Z WITH ACUTE +Tilde 'z' = 0xc5bc # U+017C LATIN SMALL LETTER Z WITH DOT ABOVE TildeTab = Normal Shift Control CapsLock CapsLock-Shift From 1c3ccf8d397b42084f1ad09db1ae980e8c480938 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sun, 9 Dec 2012 17:54:48 +0100 Subject: [PATCH 26/57] usb_floppy: handle B_GET_DEVICE_{NAME,SIZE} --- .../drivers/disk/usb/usb_floppy/usb_disk.cpp | 81 +++++++++++++++++-- .../drivers/disk/usb/usb_floppy/usb_disk.h | 4 + 2 files changed, 79 insertions(+), 6 deletions(-) diff --git a/src/add-ons/kernel/drivers/disk/usb/usb_floppy/usb_disk.cpp b/src/add-ons/kernel/drivers/disk/usb/usb_floppy/usb_disk.cpp index a6bb7d2b42..0f19f99826 100644 --- a/src/add-ons/kernel/drivers/disk/usb/usb_floppy/usb_disk.cpp +++ b/src/add-ons/kernel/drivers/disk/usb/usb_floppy/usb_disk.cpp @@ -484,14 +484,30 @@ usb_disk_inquiry(device_lun *lun) return result; } - TRACE("peripherial_device_type 0x%02x\n", parameter.peripherial_device_type); - TRACE("peripherial_qualifier 0x%02x\n", parameter.peripherial_qualifier); - TRACE("removable_medium %s\n", parameter.removable_medium ? "yes" : "no"); + TRACE("peripherial_device_type 0x%02x\n", + parameter.peripherial_device_type); + TRACE("peripherial_qualifier 0x%02x\n", + parameter.peripherial_qualifier); + TRACE("removable_medium %s\n", + parameter.removable_medium ? "yes" : "no"); TRACE("version 0x%02x\n", parameter.version); TRACE("response_data_format 0x%02x\n", parameter.response_data_format); - TRACE_ALWAYS("vendor_identification \"%.8s\"\n", parameter.vendor_identification); - TRACE_ALWAYS("product_identification \"%.16s\"\n", parameter.product_identification); - TRACE_ALWAYS("product_revision_level \"%.4s\"\n", parameter.product_revision_level); + TRACE_ALWAYS("vendor_identification \"%.8s\"\n", + parameter.vendor_identification); + TRACE_ALWAYS("product_identification \"%.16s\"\n", + parameter.product_identification); + TRACE_ALWAYS("product_revision_level \"%.4s\"\n", + parameter.product_revision_level); + + memcpy(lun->vendor_name, parameter.vendor_identification, + MIN(sizeof(lun->vendor_name), sizeof(parameter.vendor_identification))); + memcpy(lun->product_name, parameter.product_identification, + MIN(sizeof(lun->product_name), + sizeof(parameter.product_identification))); + memcpy(lun->product_revision, parameter.product_revision_level, + MIN(sizeof(lun->product_revision), + sizeof(parameter.product_revision_level))); + lun->device_type = parameter.peripherial_device_type; /* 1:1 mapping */ lun->removable = (parameter.removable_medium == 1); return B_OK; @@ -992,6 +1008,27 @@ usb_disk_free(void *cookie) } +static inline void +normalize_name(char *name, size_t nameLength) +{ + bool wasSpace = false; + size_t insertIndex = 0; + for (size_t i = 0; i < nameLength; i++) { + bool isSpace = name[i] == ' '; + if (isSpace && wasSpace) + continue; + + name[insertIndex++] = name[i]; + wasSpace = isSpace; + } + + if (insertIndex > 0 && name[insertIndex - 1] == ' ') + insertIndex--; + + name[insertIndex] = 0; +} + + static status_t usb_disk_ioctl(void *cookie, uint32 op, void *buffer, size_t length) { @@ -1005,6 +1042,19 @@ usb_disk_ioctl(void *cookie, uint32 op, void *buffer, size_t length) status_t result = B_DEV_INVALID_IOCTL; switch (op) { + case B_GET_DEVICE_SIZE: { + if (lun->media_changed) { + result = usb_disk_update_capacity(lun); + if (result != B_OK) + break; + } + + size_t size = lun->block_size * lun->block_count; + result = user_memcpy(buffer, &size, sizeof(size)); + + break; + } + case B_GET_MEDIA_STATUS: { *(status_t *)buffer = usb_disk_test_unit_ready(lun); TRACE("B_GET_MEDIA_STATUS: 0x%08lx\n", *(status_t *)buffer); @@ -1100,6 +1150,25 @@ usb_disk_ioctl(void *cookie, uint32 op, void *buffer, size_t length) result = user_memcpy(buffer, &iconData, sizeof(device_icon)); break; } + + case B_GET_DEVICE_NAME: + { + size_t nameLength = sizeof(lun->vendor_name) + + sizeof(lun->product_name) + sizeof(lun->product_revision) + 3; + + char name[nameLength]; + snprintf(name, nameLength, "%.8s %.16s %.4s", lun->vendor_name, + lun->product_name, lun->product_revision); + + normalize_name(name, nameLength); + + result = user_strlcpy((char *)buffer, name, length); + if (result > 0) + result = B_OK; + + TRACE_ALWAYS("got device name: \"%s\" = %s\n", name, strerror(result)); + break; + } #endif default: diff --git a/src/add-ons/kernel/drivers/disk/usb/usb_floppy/usb_disk.h b/src/add-ons/kernel/drivers/disk/usb/usb_floppy/usb_disk.h index 90fd1a6e95..edfe2f2ffb 100644 --- a/src/add-ons/kernel/drivers/disk/usb/usb_floppy/usb_disk.h +++ b/src/add-ons/kernel/drivers/disk/usb/usb_floppy/usb_disk.h @@ -78,6 +78,10 @@ struct device_lun_s { uint8 device_type; bool removable; bool write_protected; + + char vendor_name[8]; + char product_name[16]; + char product_revision[4]; }; From adf4c44437c52c3654290af5fe0a33728e7aa7f4 Mon Sep 17 00:00:00 2001 From: Matt Madia Date: Sun, 9 Dec 2012 12:16:37 -0500 Subject: [PATCH 27/57] Added more {OpenGrok sites, with owner information. --- ReadMe.IntroductionToHaiku | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ReadMe.IntroductionToHaiku b/ReadMe.IntroductionToHaiku index 24f69e7193..f67c8e8f5f 100644 --- a/ReadMe.IntroductionToHaiku +++ b/ReadMe.IntroductionToHaiku @@ -56,8 +56,10 @@ This is the Haiku project's development tracker. {OpenGrok --------- http://haiku.it.su.se:8180/source +http://grok.bikemonkey.org/source +http://code.metager.de/source/xref/haiku -Graciously provided by . +Graciously provided by Janne Johansson, Landon Fuller and MetaGer respectively. This allows you to quickly and easily search Haiku's source code. From c1034c63fbb8debcff35b726c9aa3c48bbd8d2b2 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Fri, 7 Dec 2012 21:15:38 -0500 Subject: [PATCH 28/57] Pull a ValueNodeManager class out of VariableTableModel. - The intention is to have a class which handles the actual management of the variable node graph, creating child nodes and such. This way the GUI, CLI and report generator don't have to each reimplement these low-level parts and can instead concentrate on their relevant representations thereof. --- src/apps/debugger/Jamfile | 1 + .../debug_managers/ValueNodeManager.cpp | 234 ++++++++++++++++++ .../debug_managers/ValueNodeManager.h | 54 ++++ 3 files changed, 289 insertions(+) create mode 100644 src/apps/debugger/debug_managers/ValueNodeManager.cpp create mode 100644 src/apps/debugger/debug_managers/ValueNodeManager.h diff --git a/src/apps/debugger/Jamfile b/src/apps/debugger/Jamfile index ac597c6973..1eb7571b33 100644 --- a/src/apps/debugger/Jamfile +++ b/src/apps/debugger/Jamfile @@ -263,6 +263,7 @@ Application Debugger : ValueLoader.cpp ValueNode.cpp ValueNodeContainer.cpp + ValueNodeManager.cpp # value/type_handlers BListTypeHandler.cpp diff --git a/src/apps/debugger/debug_managers/ValueNodeManager.cpp b/src/apps/debugger/debug_managers/ValueNodeManager.cpp new file mode 100644 index 0000000000..4dce046445 --- /dev/null +++ b/src/apps/debugger/debug_managers/ValueNodeManager.cpp @@ -0,0 +1,234 @@ +/* + * Copyright 2012, Rene Gollent, rene@gollent.com. + * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. + * Distributed under the terms of the MIT License. + */ + +#include "ValueNodeManager.h" + +#include "AutoLocker.h" + +#include "StackFrame.h" +#include "Thread.h" +#include "TypeHandlerRoster.h" +#include "ValueNode.h" +#include "Variable.h" +#include "VariableValueNodeChild.h" + + +ValueNodeManager::ValueNodeManager() + : + fContainer(NULL), + fStackFrame(NULL), + fThread(NULL) +{ +} + + +ValueNodeManager::~ValueNodeManager() +{ + SetStackFrame(NULL, NULL); +} + + +status_t +ValueNodeManager::SetStackFrame(Thread* thread, + StackFrame* stackFrame) +{ + if (fContainer != NULL) { + AutoLocker containerLocker(fContainer); + + fContainer->RemoveListener(this); + + fContainer->RemoveAllChildren(); + containerLocker.Unlock(); + fContainer->ReleaseReference(); + fContainer = NULL; + } + + fStackFrame = stackFrame; + fThread = thread; + + if (fStackFrame != NULL) { + fContainer = new(std::nothrow) ValueNodeContainer; + if (fContainer == NULL) + return B_NO_MEMORY; + + status_t error = fContainer->Init(); + if (error != B_OK) { + delete fContainer; + fContainer = NULL; + return error; + } + + AutoLocker containerLocker(fContainer); + + fContainer->AddListener(this); + + for (int32 i = 0; Variable* variable = fStackFrame->ParameterAt(i); + i++) { + _AddNode(variable); + } + + for (int32 i = 0; Variable* variable + = fStackFrame->LocalVariableAt(i); i++) { + _AddNode(variable); + } + } + + return B_OK; +} + + +bool +ValueNodeManager::AddListener(ValueNodeContainer::Listener* listener) +{ + return fListeners.AddItem(listener); +} + + +void +ValueNodeManager::RemoveListener(ValueNodeContainer::Listener* listener) +{ + fListeners.RemoveItem(listener); +} + + +void +ValueNodeManager::ValueNodeChanged(ValueNodeChild* nodeChild, + ValueNode* oldNode, ValueNode* newNode) +{ + if (fContainer == NULL) + return; + + AutoLocker containerLocker(fContainer); + + if (oldNode != NULL) + newNode->CreateChildren(); + + for (int32 i = fListeners.CountItems() - 1; i >= 0; i--) + fListeners.ItemAt(i)->ValueNodeChanged(nodeChild, oldNode, newNode); +} + + +void +ValueNodeManager::ValueNodeChildrenCreated(ValueNode* node) +{ + if (fContainer == NULL) + return; + + for (int32 i = fListeners.CountItems() - 1; i >= 0; i--) + fListeners.ItemAt(i)->ValueNodeChildrenCreated(node); +} + + +void +ValueNodeManager::ValueNodeChildrenDeleted(ValueNode* node) +{ + if (fContainer == NULL) + return; + + for (int32 i = fListeners.CountItems() - 1; i >= 0; i--) + fListeners.ItemAt(i)->ValueNodeChildrenDeleted(node); +} + + +void +ValueNodeManager::ValueNodeValueChanged(ValueNode* valueNode) +{ + if (fContainer == NULL) + return; + + AutoLocker containerLocker(fContainer); + + // check whether we know the node + ValueNodeChild* nodeChild = valueNode->NodeChild(); + if (nodeChild == NULL) + return; + + if (valueNode->ChildCreationNeedsValue() + && !valueNode->ChildrenCreated()) { + status_t error = valueNode->CreateChildren(); + if (error != B_OK) + return; + + for (int32 i = 0; i < valueNode->CountChildren(); i++) { + ValueNodeChild* child = valueNode->ChildAt(i); + _CreateValueNode(child); + AddChildNodes(child); + } + } + + for (int32 i = fListeners.CountItems() - 1; i >= 0; i--) + fListeners.ItemAt(i)->ValueNodeValueChanged(valueNode); +} + + +void +ValueNodeManager::_AddNode(Variable* variable) +{ + // create the node child for the variable + ValueNodeChild* nodeChild = new (std::nothrow) VariableValueNodeChild( + variable); + BReference nodeChildReference(nodeChild, true); + if (nodeChild == NULL || !fContainer->AddChild(nodeChild)) { + delete nodeChild; + return; + } + + // automatically add child nodes for the top level nodes + AddChildNodes(nodeChild); +} + + +status_t +ValueNodeManager::_CreateValueNode(ValueNodeChild* nodeChild) +{ + if (nodeChild->Node() != NULL) + return B_OK; + + // create the node + ValueNode* valueNode; + status_t error; + if (nodeChild->IsInternal()) { + error = nodeChild->CreateInternalNode(valueNode); + } else { + error = TypeHandlerRoster::Default()->CreateValueNode(nodeChild, + nodeChild->GetType(), valueNode); + } + + if (error != B_OK) + return error; + + nodeChild->SetNode(valueNode); + valueNode->ReleaseReference(); + + return B_OK; +} + + +status_t +ValueNodeManager::AddChildNodes(ValueNodeChild* nodeChild) +{ + AutoLocker containerLocker(fContainer); + + // create a value node for the value node child, if doesn't have one yet + ValueNode* valueNode = nodeChild->Node(); + if (valueNode == NULL) { + status_t error = _CreateValueNode(nodeChild); + if (error != B_OK) + return error; + valueNode = nodeChild->Node(); + } + + // check if this node requires child creation + // to be deferred until after its location/value have been resolved + if (valueNode->ChildCreationNeedsValue()) + return B_OK; + + // create the children, if not done yet + if (valueNode->ChildrenCreated()) + return B_OK; + + return valueNode->CreateChildren(); +} diff --git a/src/apps/debugger/debug_managers/ValueNodeManager.h b/src/apps/debugger/debug_managers/ValueNodeManager.h new file mode 100644 index 0000000000..603648affb --- /dev/null +++ b/src/apps/debugger/debug_managers/ValueNodeManager.h @@ -0,0 +1,54 @@ +/* + * Copyright 2012, Rene Gollent, rene@gollent.com. + * Distributed under the terms of the MIT License. + */ +#ifndef VALUE_NODE_MANAGER_H +#define VALUE_NODE_MANAGER_H + +#include + +#include "ValueNodeContainer.h" + +class StackFrame; +class Thread; +class Variable; + + +class ValueNodeManager : public BReferenceable, + private ValueNodeContainer::Listener { +public: + ValueNodeManager(); + virtual ~ValueNodeManager(); + + status_t SetStackFrame(Thread* thread, + StackFrame* frame); + + bool AddListener( + ValueNodeContainer::Listener* listener); + void RemoveListener( + ValueNodeContainer::Listener* listener); + + virtual void ValueNodeChanged(ValueNodeChild* nodeChild, + ValueNode* oldNode, ValueNode* newNode); + virtual void ValueNodeChildrenCreated(ValueNode* node); + virtual void ValueNodeChildrenDeleted(ValueNode* node); + virtual void ValueNodeValueChanged(ValueNode* node); + + ValueNodeContainer* GetContainer() const { return fContainer; }; + + status_t AddChildNodes(ValueNodeChild* nodeChild); + +private: + typedef BObjectList ListenerList; + + void _AddNode(Variable* variable); + status_t _CreateValueNode(ValueNodeChild* nodeChild); + +private: + ValueNodeContainer* fContainer; + StackFrame* fStackFrame; + Thread* fThread; + ListenerList fListeners; +}; + +#endif // VALUE_NODE_MANAGER_H From 13c04a36b0f40ffc7c6684ce09b51ce5a8ab596e Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Sat, 8 Dec 2012 16:13:39 -0500 Subject: [PATCH 29/57] Adapt VariablesView to use the ValueNodeManager. --- .../gui/team_window/VariablesView.cpp | 278 +++--------------- .../value_nodes/VariableValueNodeChild.h | 2 + 2 files changed, 42 insertions(+), 238 deletions(-) diff --git a/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp b/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp index 8bf73631d2..7a6f7d9dab 100644 --- a/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp +++ b/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp @@ -50,7 +50,7 @@ #include "ValueHandlerRoster.h" #include "ValueLocation.h" #include "ValueNode.h" -#include "ValueNodeContainer.h" +#include "ValueNodeManager.h" #include "Variable.h" #include "VariableValueNodeChild.h" #include "VariablesViewState.h" @@ -451,17 +451,10 @@ private: ValueNodeChild* nodeChild, bool isPresentationNode = false, bool isOnlyChild = false); - void _AddNode(Variable* variable); - status_t _CreateValueNode(ValueNodeChild* nodeChild); - status_t _AddChildNodes(ValueNodeChild* nodeChild); - -// ModelNode* _GetNode(Variable* variable, -// TypeComponentPath* path) const; private: Thread* fThread; - StackFrame* fStackFrame; - ValueNodeContainer* fContainer; + ValueNodeManager* fNodeManager; ContainerListener* fContainerListener; NodeList fNodes; NodeTable fNodeTable; @@ -841,8 +834,8 @@ VariablesView::ContainerListener::ModelNodeRestoreViewStateRequested( VariablesView::VariableTableModel::VariableTableModel() : - fStackFrame(NULL), - fContainer(NULL), + fThread(NULL), + fNodeManager(NULL), fContainerListener(NULL), fNodeTable() { @@ -851,13 +844,18 @@ VariablesView::VariableTableModel::VariableTableModel() VariablesView::VariableTableModel::~VariableTableModel() { - SetStackFrame(NULL, NULL); + if (fNodeManager != NULL) + fNodeManager->ReleaseReference(); } status_t VariablesView::VariableTableModel::Init() { + fNodeManager = new(std::nothrow) ValueNodeManager(); + if (fNodeManager == NULL) + return B_NO_MEMORY; + return fNodeTable.Init(); } @@ -870,10 +868,8 @@ VariablesView::VariableTableModel::SetContainerListener( return; if (fContainerListener != NULL) { - if (fContainer != NULL) { - AutoLocker containerLocker(fContainer); - fContainer->RemoveListener(fContainerListener); - } + if (fNodeManager != NULL) + fNodeManager->RemoveListener(fContainerListener); fContainerListener->SetModel(NULL); } @@ -883,10 +879,8 @@ VariablesView::VariableTableModel::SetContainerListener( if (fContainerListener != NULL) { fContainerListener->SetModel(this); - if (fContainer != NULL) { - AutoLocker containerLocker(fContainer); - fContainer->AddListener(fContainerListener); - } + if (fNodeManager != NULL) + fNodeManager->AddListener(fContainerListener); } } @@ -895,17 +889,9 @@ void VariablesView::VariableTableModel::SetStackFrame(Thread* thread, StackFrame* stackFrame) { - if (fContainer != NULL) { - AutoLocker containerLocker(fContainer); + fThread = thread; - if (fContainerListener != NULL) - fContainer->RemoveListener(fContainerListener); - - fContainer->RemoveAllChildren(); - containerLocker.Unlock(); - fContainer->ReleaseReference(); - fContainer = NULL; - } + fNodeManager->SetStackFrame(thread, stackFrame); fNodeTable.Clear(true); @@ -917,38 +903,19 @@ VariablesView::VariableTableModel::SetStackFrame(Thread* thread, NotifyNodesRemoved(TreeTablePath(), 0, count); } - fStackFrame = stackFrame; - fThread = thread; + if (stackFrame == NULL) + return; - if (fStackFrame != NULL) { - fContainer = new(std::nothrow) ValueNodeContainer; - if (fContainer == NULL) - return; + ValueNodeContainer* container = fNodeManager->GetContainer(); + AutoLocker containerLocker(container); - status_t error = fContainer->Init(); - if (error != B_OK) { - delete fContainer; - fContainer = NULL; - return; - } - - AutoLocker containerLocker(fContainer); - - if (fContainerListener != NULL) - fContainer->AddListener(fContainerListener); - - for (int32 i = 0; Variable* variable = fStackFrame->ParameterAt(i); - i++) { - _AddNode(variable); - } - - for (int32 i = 0; Variable* variable - = fStackFrame->LocalVariableAt(i); i++) { - _AddNode(variable); - } - -// if (!fNodes.IsEmpty()) -// NotifyNodesAdded(TreeTablePath(), 0, fNodes.CountItems()); + for (int32 i = 0; i < container->CountChildren(); i++) { + VariableValueNodeChild* child = dynamic_cast( + container->ChildAt(i)); + _AddNode(child->GetVariable(), NULL, child); + // top level nodes get their children added immediately + // so those won't invoke our callback hook. Add them directly here. + ValueNodeChildrenCreated(child->Node()); } } @@ -957,19 +924,14 @@ void VariablesView::VariableTableModel::ValueNodeChanged(ValueNodeChild* nodeChild, ValueNode* oldNode, ValueNode* newNode) { - if (fContainer == NULL) - return; - - AutoLocker containerLocker(fContainer); + AutoLocker containerLocker( + fNodeManager->GetContainer()); ModelNode* modelNode = fNodeTable.Lookup(nodeChild); if (modelNode == NULL) return; - if (oldNode != NULL) { - ValueNodeChildrenDeleted(oldNode); - newNode->CreateChildren(); + if (oldNode != NULL) NotifyNodeChanged(modelNode); - } } @@ -977,10 +939,8 @@ void VariablesView::VariableTableModel::ValueNodeChildrenCreated( ValueNode* valueNode) { - if (fContainer == NULL) - return; - - AutoLocker containerLocker(fContainer); + AutoLocker containerLocker( + fNodeManager->GetContainer()); // check whether we know the node ValueNodeChild* nodeChild = valueNode->NodeChild(); @@ -1016,10 +976,8 @@ VariablesView::VariableTableModel::ValueNodeChildrenCreated( void VariablesView::VariableTableModel::ValueNodeChildrenDeleted(ValueNode* node) { - if (fContainer == NULL) - return; - - AutoLocker containerLocker(fContainer); + AutoLocker containerLocker( + fNodeManager->GetContainer()); // check whether we know the node ValueNodeChild* nodeChild = node->NodeChild(); @@ -1058,10 +1016,8 @@ VariablesView::VariableTableModel::ValueNodeChildrenDeleted(ValueNode* node) void VariablesView::VariableTableModel::ValueNodeValueChanged(ValueNode* valueNode) { - if (fContainer == NULL) - return; - - AutoLocker containerLocker(fContainer); + AutoLocker containerLocker( + fNodeManager->GetContainer()); // check whether we know the node ValueNodeChild* nodeChild = valueNode->NodeChild(); @@ -1072,19 +1028,6 @@ VariablesView::VariableTableModel::ValueNodeValueChanged(ValueNode* valueNode) if (modelNode == NULL) return; - if (valueNode->ChildCreationNeedsValue() - && !valueNode->ChildrenCreated()) { - status_t error = valueNode->CreateChildren(); - if (error != B_OK) - return; - - for (int32 i = 0; i < valueNode->CountChildren(); i++) { - ValueNodeChild* child = valueNode->ChildAt(i); - _CreateValueNode(child); - _AddChildNodes(child); - } - } - // check whether the value actually changed Value* value = valueNode->GetValue(); if (value == modelNode->GetValue()) @@ -1214,11 +1157,8 @@ VariablesView::VariableTableModel::GetValueAt(void* object, int32 columnIndex, void VariablesView::VariableTableModel::NodeExpanded(ModelNode* node) { - if (fContainer == NULL) - return; - - AutoLocker containerLocker(fContainer); - + AutoLocker containerLocker( + fNodeManager->GetContainer()); // add children of all children // If the node only has a hidden child, add the child's children instead. @@ -1230,7 +1170,7 @@ VariablesView::VariableTableModel::NodeExpanded(ModelNode* node) // add the children for (int32 i = 0; ModelNode* child = node->ChildAt(i); i++) - _AddChildNodes(child->NodeChild()); + fNodeManager->AddChildNodes(child->NodeChild()); } @@ -1365,150 +1305,12 @@ VariablesView::VariableTableModel::_AddNode(Variable* variable, // if the node is hidden, add its children if (node->IsHidden()) - _AddChildNodes(nodeChild); + fNodeManager->AddChildNodes(nodeChild); return B_OK; } -void -VariablesView::VariableTableModel::_AddNode(Variable* variable) -{ - // create the node child for the variable - ValueNodeChild* nodeChild = new (std::nothrow) VariableValueNodeChild( - variable); - BReference nodeChildReference(nodeChild, true); - if (nodeChild == NULL || !fContainer->AddChild(nodeChild)) { - delete nodeChild; - return; - } - - // create the model node - status_t error = _AddNode(variable, NULL, nodeChild, false); - if (error != B_OK) - return; - - // automatically add child nodes for the top level nodes - _AddChildNodes(nodeChild); -} - - -status_t -VariablesView::VariableTableModel::_CreateValueNode(ValueNodeChild* nodeChild) -{ - if (nodeChild->Node() != NULL) - return B_OK; - - // create the node - ValueNode* valueNode; - status_t error; - if (nodeChild->IsInternal()) { - error = nodeChild->CreateInternalNode(valueNode); - } else { - error = TypeHandlerRoster::Default()->CreateValueNode(nodeChild, - nodeChild->GetType(), valueNode); - } - - if (error != B_OK) - return error; - - nodeChild->SetNode(valueNode); - valueNode->ReleaseReference(); - - return B_OK; -} - - -status_t -VariablesView::VariableTableModel::_AddChildNodes(ValueNodeChild* nodeChild) -{ - // create a value node for the value node child, if doesn't have one yet - ValueNode* valueNode = nodeChild->Node(); - if (valueNode == NULL) { - status_t error = _CreateValueNode(nodeChild); - if (error != B_OK) - return error; - valueNode = nodeChild->Node(); - } - - // check if this node requires child creation - // to be deferred until after its location/value have been resolved - if (valueNode->ChildCreationNeedsValue()) - return B_OK; - - // create the children, if not done yet - if (valueNode->ChildrenCreated()) - return B_OK; - - return valueNode->CreateChildren(); -} - - -//VariablesView::ModelNode* -//VariablesView::VariableTableModel::_GetNode(Variable* variable, -// TypeComponentPath* path) const -//{ -// // find the variable node -// ModelNode* node; -// for (int32 i = 0; (node = fNodes.ItemAt(i)) != NULL; i++) { -// if (node->GetVariable() == variable) -// break; -// } -// if (node == NULL) -// return NULL; -// -// // Now walk along the path, finding the respective child node for each -// // component (might be several components at once). -// int32 componentCount = path->CountComponents(); -// for (int32 i = 0; i < componentCount;) { -// ModelNode* childNode = NULL; -// -// for (int32 k = 0; (childNode = node->ChildAt(k)) != NULL; k++) { -// TypeComponentPath* childPath = childNode->Path(); -// int32 childComponentCount = childPath->CountComponents(); -// if (childComponentCount > componentCount) -// continue; -// -// for (int32 componentIndex = i; -// componentIndex < childComponentCount; componentIndex++) { -// TypeComponent childComponent -// = childPath->ComponentAt(componentIndex); -// TypeComponent pathComponent -// = path->ComponentAt(componentIndex); -// if (childComponent != pathComponent) { -// if (componentIndex + 1 == childComponentCount -// && pathComponent.HasPrefix(childComponent)) { -// // The last child component is a prefix of the -// // corresponding path component. We consider this a -// // match, but need to recheck the component with the -// // next node level. -// childComponentCount--; -// break; -// } -// -// // mismatch -- skip the child -// childNode = NULL; -// break; -// } -// } -// -// if (childNode != NULL) { -// // got a match -- skip the matched children components -// i = childComponentCount; -// break; -// } -// } -// -// if (childNode == NULL) -// return NULL; -// -// node = childNode; -// } -// -// return node; -//} - - bool VariablesView::VariableTableModel::GetTreePath(ModelNode* node, TreeTablePath& _path) const diff --git a/src/apps/debugger/value/value_nodes/VariableValueNodeChild.h b/src/apps/debugger/value/value_nodes/VariableValueNodeChild.h index efa05fe211..372057ecb6 100644 --- a/src/apps/debugger/value/value_nodes/VariableValueNodeChild.h +++ b/src/apps/debugger/value/value_nodes/VariableValueNodeChild.h @@ -21,6 +21,8 @@ public: virtual Type* GetType() const; virtual ValueNode* Parent() const; + Variable* GetVariable() const { return fVariable; }; + virtual status_t ResolveLocation(ValueLoader* valueLoader, ValueLocation*& _location); From 2c32e7436061bec593041522f1419875aaa27660 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Sat, 8 Dec 2012 18:19:12 -0500 Subject: [PATCH 30/57] 64-bit fixes. --- .../user_interface/gui/team_window/VariablesView.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp b/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp index 7a6f7d9dab..dfde0f0658 100644 --- a/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp +++ b/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp @@ -1139,7 +1139,7 @@ VariablesView::VariableTableModel::GetValueAt(void* object, int32 columnIndex, if (piece.type != VALUE_PIECE_LOCATION_MEMORY) return false; - data.SetToFormat("[@ 0x%llx]", piece.address); + data.SetToFormat("[@ %#" B_PRIx64 "]", piece.address); _value.SetTo(data); return true; } @@ -1212,13 +1212,13 @@ VariablesView::VariableTableModel::GetToolTipForTablePath( BString pieceData; switch (piece.type) { case VALUE_PIECE_LOCATION_MEMORY: - pieceData.SetToFormat("(%ld): Address: 0x%llx, Size: " - "%lld bytes", i, piece.address, piece.size); + pieceData.SetToFormat("(%" B_PRId32 "): Address: %#" B_PRIx64 + ", Size: %" B_PRId64 " bytes", i, piece.address, piece.size); break; case VALUE_PIECE_LOCATION_REGISTER: { Architecture* architecture = fThread->GetTeam()->GetArchitecture(); - pieceData.SetToFormat("(%ld): Register (%s)", + pieceData.SetToFormat("(%" B_PRId32 "): Register (%s)", i, architecture->Registers()[piece.reg].Name()); break; From 84a00bf8879f6d8e2158e301aff8e3f94d11afa9 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Sat, 8 Dec 2012 18:29:12 -0500 Subject: [PATCH 31/57] Make string size available in value location. --- src/apps/debugger/value/value_nodes/CStringValueNode.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/apps/debugger/value/value_nodes/CStringValueNode.cpp b/src/apps/debugger/value/value_nodes/CStringValueNode.cpp index 3b5f90ce9d..f3e4a09792 100644 --- a/src/apps/debugger/value/value_nodes/CStringValueNode.cpp +++ b/src/apps/debugger/value/value_nodes/CStringValueNode.cpp @@ -84,6 +84,12 @@ CStringValueNode::ResolvedLocationAndValue(ValueLoader* valueLoader, ValuePieceLocation piece; piece.SetToMemory(addressData.ToUInt64()); + error = valueLoader->LoadStringValue(addressData, maxSize, valueData); + if (error != B_OK) + return error; + + piece.size = valueData.Length(); + ValueLocation* stringLocation = new(std::nothrow) ValueLocation( valueLoader->GetArchitecture()->IsBigEndian(), piece); From ad99f882d332df8e2ad38587380eaa73f0b63be2 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Sat, 8 Dec 2012 22:30:40 -0500 Subject: [PATCH 32/57] Print parameters/local variables if available.. - If debug information is present, then for each stack frame we now also dump all function parameters and local variables and their respective values, as well as their first level of children if applicable. --- .../controllers/DebugReportGenerator.cpp | 137 +++++++++++++++++- .../controllers/DebugReportGenerator.h | 14 ++ 2 files changed, 150 insertions(+), 1 deletion(-) diff --git a/src/apps/debugger/controllers/DebugReportGenerator.cpp b/src/apps/debugger/controllers/DebugReportGenerator.cpp index 996e67f631..d8a16d7cf8 100644 --- a/src/apps/debugger/controllers/DebugReportGenerator.cpp +++ b/src/apps/debugger/controllers/DebugReportGenerator.cpp @@ -26,7 +26,13 @@ #include "StringUtils.h" #include "Team.h" #include "Thread.h" +#include "Type.h" #include "UiUtils.h" +#include "Value.h" +#include "ValueLoader.h" +#include "ValueLocation.h" +#include "ValueNode.h" +#include "ValueNodeManager.h" DebugReportGenerator::DebugReportGenerator(::Team* team) @@ -34,7 +40,8 @@ DebugReportGenerator::DebugReportGenerator(::Team* team) BLooper("DebugReportGenerator"), fTeam(team), fArchitecture(team->GetArchitecture()), - fTeamDataSem(-1) + fTeamDataSem(-1), + fNodeManager(NULL) { fTeam->AddListener(this); fArchitecture->AcquireReference(); @@ -45,6 +52,8 @@ DebugReportGenerator::~DebugReportGenerator() { fTeam->RemoveListener(this); fArchitecture->ReleaseReference(); + if (fNodeManager != NULL) + fNodeManager->ReleaseReference(); } @@ -55,6 +64,10 @@ DebugReportGenerator::Init() if (fTeamDataSem < B_OK) return fTeamDataSem; + fNodeManager = new(std::nothrow) ValueNodeManager(); + if (fNodeManager == NULL) + return B_NO_MEMORY; + Run(); return B_OK; @@ -285,6 +298,23 @@ DebugReportGenerator::_DumpDebuggedThreadInfo(BString& _output, sizeof(functionName))); _output << data; + if (frame->CountParameters() == 0 + && frame->CountLocalVariables() == 0) { + continue; + } + + _output << "\t\t\tVariables:\n"; + status_t result = fNodeManager->SetStackFrame(thread, frame); + if (result != B_OK) + continue; + + ValueNodeContainer* container = fNodeManager->GetContainer(); + AutoLocker containerLocker(container); + for (int32 i = 0; i < container->CountChildren(); i++) { + ValueNodeChild* child = container->ChildAt(i); + _DumpValueNode(_output, frame, child); + } + _output << "\n"; } _output << "\n\t\tRegisters:\n"; @@ -304,3 +334,108 @@ DebugReportGenerator::_DumpDebuggedThreadInfo(BString& _output, return B_OK; } + + +status_t +DebugReportGenerator::_DumpValueNode(BString& _output, StackFrame* frame, + ValueNodeChild* child, bool recurse) +{ + status_t result = _ResolveLocationIfNeeded(child, frame); + if (result != B_OK) + return result; + + _output << "\t\t\t"; + if (!recurse) + _output << "\t"; + _output << child->Name() << ": "; + + ValueNode* node = child->Node(); + if (node->LocationAndValueResolutionState() == VALUE_NODE_UNRESOLVED) { + if (_ResolveValueIfNeeded(node, frame) == B_OK) { + Value* value = node->GetValue(); + if (value != NULL) { + BString valueData; + value->ToString(valueData); + _output << valueData; + } else + _output << "Unavailable"; + } else + _output << "Unknown"; + } + if (recurse && node->CountChildren() != 0) + _output << " {"; + + _output << "\n"; + + if (recurse) { + if (node->CountChildren() == 0) + return B_OK; + + if (node->CountChildren() == 1 + && node->GetType()->Kind() == TYPE_ADDRESS + && node->ChildAt(0)->GetType()->Kind() == TYPE_COMPOUND) { + // for the case of a pointer to a compound type, + // we want to hide the intervening compound node and print + // the children directly. + status_t result = fNodeManager->AddChildNodes(node->ChildAt(0)); + if (result == B_OK) { + result = _ResolveLocationIfNeeded(node->ChildAt(0), frame); + if (result == B_OK) { + node = node->ChildAt(0)->Node(); + // attempt to resolve the value here since the node's + // representation may requires its value to be resolved + // before its children can be created + result = _ResolveValueIfNeeded(node, frame); + } + } + } + + for (int32 i = 0; i < node->CountChildren(); i++) { + if (fNodeManager->AddChildNodes(node->ChildAt(i)) != B_OK) + continue; + + // don't dump compound nodes since we won't traverse into + // them anyways and their top level node has no interesting + // information. + if (node->ChildAt(i)->GetType()->Kind() != TYPE_COMPOUND) + _DumpValueNode(_output, frame, node->ChildAt(i), false); + } + _output << "\t\t\t}\n"; + } + + return B_OK; +} + + +status_t +DebugReportGenerator::_ResolveValueIfNeeded(ValueNode* node, StackFrame* frame) +{ + ValueLocation* location = NULL; + Value* value = NULL; + ValueLoader loader(fTeam->GetArchitecture(), fTeam->GetTeamMemory(), + fTeam->GetTeamTypeInformation(), frame->GetCpuState()); + status_t result = node->ResolvedLocationAndValue(&loader, location, + value); + node->SetLocationAndValue(location, value, result); + if (location != NULL) + location->ReleaseReference(); + if (value != NULL) + value->ReleaseReference(); + + return result; +} + + +status_t +DebugReportGenerator::_ResolveLocationIfNeeded(ValueNodeChild* child, + StackFrame* frame) +{ + ValueLocation* location = NULL; + ValueLoader loader(fTeam->GetArchitecture(), fTeam->GetTeamMemory(), + fTeam->GetTeamTypeInformation(), frame->GetCpuState()); + status_t result = child->ResolveLocation(&loader, location); + child->SetLocation(location, result); + if (location != NULL) + location->ReleaseReference(); + return result; +} diff --git a/src/apps/debugger/controllers/DebugReportGenerator.h b/src/apps/debugger/controllers/DebugReportGenerator.h index 1ea4dff8e0..03d7f5c6db 100644 --- a/src/apps/debugger/controllers/DebugReportGenerator.h +++ b/src/apps/debugger/controllers/DebugReportGenerator.h @@ -14,8 +14,13 @@ class entry_ref; class Architecture; class BString; +class StackFrame; class Team; class Thread; +class Value; +class ValueNode; +class ValueNodeChild; +class ValueNodeManager; class DebugReportGenerator : public BLooper, public Team::Listener { @@ -39,11 +44,20 @@ private: status_t _DumpRunningThreads(BString& output); status_t _DumpDebuggedThreadInfo(BString& output, ::Thread* thread); + status_t _DumpValueNode(BString& output, + StackFrame* frame, ValueNodeChild* child, + bool recurse = true); + + status_t _ResolveLocationIfNeeded(ValueNodeChild* child, + StackFrame* frame); + status_t _ResolveValueIfNeeded(ValueNode* node, + StackFrame* frame); private: ::Team* fTeam; Architecture* fArchitecture; sem_id fTeamDataSem; + ValueNodeManager* fNodeManager; }; #endif // DEBUG_REPORT_GENERATOR_H From 1d95a50e0506fbbb9a2e090d4efed5e43b5793c7 Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Mon, 10 Dec 2012 02:37:30 +0000 Subject: [PATCH 33/57] Haiku: Fix check of bitmap size. * We now have basic Gallium software rendering! * Still lots more work to do. --- src/add-ons/opengl/swpipe/SoftwareRenderer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/add-ons/opengl/swpipe/SoftwareRenderer.cpp b/src/add-ons/opengl/swpipe/SoftwareRenderer.cpp index 77cd669742..fc60df28bb 100644 --- a/src/add-ons/opengl/swpipe/SoftwareRenderer.cpp +++ b/src/add-ons/opengl/swpipe/SoftwareRenderer.cpp @@ -174,9 +174,10 @@ SoftwareRenderer::SwapBuffers(bool vsync) // check the bitmap size still matches the size if (fInfo->window_bounds.bottom - fInfo->window_bounds.top - != fBitmap->Bounds().IntegerHeight() + 1 + != fBitmap->Bounds().IntegerHeight() || fInfo->window_bounds.right - fInfo->window_bounds.left - != fBitmap->Bounds().IntegerWidth() + 1) { + != fBitmap->Bounds().IntegerWidth()) { + ERROR("%s: Bitmap size doesn't match size!\n", __func__); return; } uint8 bytesPerPixel = fInfo->bits_per_pixel / 8; From 0cc8d8ab3e4ac684e0ac1c8d6b5b45046b8f6bea Mon Sep 17 00:00:00 2001 From: Siarzhuk Zharski Date: Mon, 10 Dec 2012 16:25:06 +0100 Subject: [PATCH 34/57] Node monitoring and on-the-fly textencoding change This work is based on the draft node monitoring implementation created by Vlad Slepukhin during GCI 2012 and includes following: * Refactoring of the document "Reload" feature - it replaces "Revert to saved" one because do the same things and a bit more. Looks like we have to keep "Reload" menu entry alive until StyledEdit will get more functional Undo/Redo features. Reload functionality is also heavily used in node monitoring and on-the-fly text encoding changing. Fixes #6887; * Support for text encoding on-the-fly switching. This make life easier for those who lives in countires with multiple popular 8-bit encodings. Russia is the sample of such de facto standards' clash (KOI-8R vs CP1251 etc.); * Node Monitoring support with alerting user in case the file size or modification time were changed. Another alert is shown in case edited file was removed or moved outside of the current volume. Moving file inside of current volume silently changes references. Choosing "Ignore" will supress new change alerts until next Reload or Save user request; * Do not nag user on quiting window with zero-length untitled document. Not a Big Deal but annoys in some cases using this editor session as temporary storage. --- src/apps/stylededit/Constants.h | 2 +- src/apps/stylededit/StyledEditView.cpp | 36 ++- src/apps/stylededit/StyledEditView.h | 3 +- src/apps/stylededit/StyledEditWindow.cpp | 355 +++++++++++++++++++++-- src/apps/stylededit/StyledEditWindow.h | 42 ++- 5 files changed, 388 insertions(+), 50 deletions(-) diff --git a/src/apps/stylededit/Constants.h b/src/apps/stylededit/Constants.h index 7863a1a60f..bebe360c40 100644 --- a/src/apps/stylededit/Constants.h +++ b/src/apps/stylededit/Constants.h @@ -25,7 +25,7 @@ const uint32 MENU_NEW = 'MFnw'; const uint32 MENU_OPEN = 'MFop'; const uint32 MENU_SAVE = 'MSav'; const uint32 MENU_SAVEAS = 'MEsa'; -const uint32 MENU_REVERT = 'MFre'; +const uint32 MENU_RELOAD = 'MFrl'; const uint32 MENU_CLOSE = 'MFcl'; const uint32 MENU_PAGESETUP = 'MFps'; const uint32 MENU_PRINT = 'MFpr'; diff --git a/src/apps/stylededit/StyledEditView.cpp b/src/apps/stylededit/StyledEditView.cpp index 10258247e6..166eb992be 100644 --- a/src/apps/stylededit/StyledEditView.cpp +++ b/src/apps/stylededit/StyledEditView.cpp @@ -73,8 +73,11 @@ StyledEditView::SetSuppressChanges(bool suppressChanges) status_t -StyledEditView::GetStyledText(BPositionIO* stream) +StyledEditView::GetStyledText(BPositionIO* stream, const char* forceEncoding) { + if (forceEncoding != NULL) + fEncoding = strcmp(forceEncoding, "auto") != 0 ? forceEncoding : ""; + fSuppressChanges = true; status_t result = BTranslationUtils::GetStyledText(stream, this, fEncoding.String()); @@ -85,24 +88,25 @@ StyledEditView::GetStyledText(BPositionIO* stream) BNode* node = dynamic_cast(stream); if (node != NULL) { - // get encoding - if (node->ReadAttrString("be:encoding", &fEncoding) != B_OK) { - // try to read as "int32" - int32 encoding; - ssize_t bytesRead = node->ReadAttr("be:encoding", B_INT32_TYPE, 0, - &encoding, sizeof(encoding)); - if (bytesRead == (ssize_t)sizeof(encoding)) { - if (encoding == 65535) { - fEncoding = "UTF-8"; - } else { - const BCharacterSet* characterSet - = BCharacterSetRoster::GetCharacterSetByConversionID(encoding); - if (characterSet != NULL) - fEncoding = characterSet->GetName(); + if (forceEncoding == NULL) { + // get encoding + if (node->ReadAttrString("be:encoding", &fEncoding) != B_OK) { + // try to read as "int32" + int32 encoding; + ssize_t bytesRead = node->ReadAttr("be:encoding", B_INT32_TYPE, 0, + &encoding, sizeof(encoding)); + if (bytesRead == (ssize_t)sizeof(encoding)) { + if (encoding == 65535) { + fEncoding = "UTF-8"; + } else { + const BCharacterSet* characterSet + = BCharacterSetRoster::GetCharacterSetByConversionID(encoding); + if (characterSet != NULL) + fEncoding = characterSet->GetName(); + } } } } - // TODO: move those into BTranslationUtils::GetStyledText() as well? // restore alignment diff --git a/src/apps/stylededit/StyledEditView.h b/src/apps/stylededit/StyledEditView.h index b0482fb13e..272f193bf2 100644 --- a/src/apps/stylededit/StyledEditView.h +++ b/src/apps/stylededit/StyledEditView.h @@ -34,7 +34,8 @@ class StyledEditView : public BTextView { void Reset(); void SetSuppressChanges(bool suppressChanges); - status_t GetStyledText(BPositionIO* stream); + status_t GetStyledText(BPositionIO* stream, + const char* forceEncoding = NULL); status_t WriteStyledEditFile(BFile* file); void SetEncoding(uint32 encoding); diff --git a/src/apps/stylededit/StyledEditWindow.cpp b/src/apps/stylededit/StyledEditWindow.cpp index 6df62ebb76..bf6675d180 100644 --- a/src/apps/stylededit/StyledEditWindow.cpp +++ b/src/apps/stylededit/StyledEditWindow.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010, Haiku, Inc. All Rights Reserved. + * Copyright 2002-2012, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -8,6 +8,8 @@ * Philippe Saint-Pierre * Jonas Sundström * Ryan Leavengood + * Vlad Slepukhin + * Sarzhuk Zharski */ @@ -33,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -107,6 +110,8 @@ StyledEditWindow::~StyledEditWindow() void StyledEditWindow::Quit() { + _SwitchNodeMonitor(false); + _SaveAttrs(); if (StyledEditApp* app = dynamic_cast(be_app)) app->CloseDocument(); @@ -124,6 +129,9 @@ StyledEditWindow::QuitRequested() if (fClean) return true; + if (fTextView->TextLength() == 0 && fSaveMessage == NULL) + return true; + BString alertText; bs_printf(&alertText, B_TRANSLATE("Save changes to the document \"%s\"? "), Title()); @@ -179,8 +187,8 @@ StyledEditWindow::MessageReceived(BMessage* message) Quit(); break; - case MENU_REVERT: - _RevertToSaved(); + case MENU_RELOAD: + _ReloadDocument(message); break; case MENU_CLOSE: @@ -294,6 +302,10 @@ StyledEditWindow::MessageReceived(BMessage* message) break; } + case B_NODE_MONITOR: + _HandleNodeMonitorEvent(message); + break; + // Font menu case FONT_SIZE: @@ -485,12 +497,12 @@ StyledEditWindow::MessageReceived(BMessage* message) fRedoFlag = false; } if (fClean) { - fRevertItem->SetEnabled(false); fSaveItem->SetEnabled(fSaveMessage == NULL); } else { - fRevertItem->SetEnabled(fSaveMessage != NULL); fSaveItem->SetEnabled(true); } + fReloadItem->SetEnabled(fSaveMessage != NULL); + fEncodingItem->SetEnabled(fSaveMessage != NULL); break; case SAVE_AS_ENCODING: @@ -646,6 +658,21 @@ StyledEditWindow::MenusBeginning() fAlignRight->SetMarked(true); break; } + + // text encoding + const BCharacterSet* charset + = BCharacterSetRoster::GetCharacterSetByFontID(fTextView->GetEncoding()); + BMenu* encodingMenu = fEncodingItem->Submenu(); + if (charset != NULL && encodingMenu != NULL) { + const char* mime = charset->GetMIMEName(); + BString name(charset->GetPrintName()); + if (mime) + name << " (" << mime << ")"; + + BMenuItem* item = encodingMenu->FindItem(name); + if (item != NULL) + item->SetMarked(true); + } } @@ -656,6 +683,8 @@ StyledEditWindow::MenusBeginning() status_t StyledEditWindow::Save(BMessage* message) { + _NodeMonitorSuspender nodeMonitorSuspender(this); + if (!message) message = fSaveMessage; @@ -722,10 +751,11 @@ StyledEditWindow::Save(BMessage* message) // clear clean modes fSaveItem->SetEnabled(false); - fRevertItem->SetEnabled(false); fUndoCleans = false; fRedoCleans = false; fClean = true; + fNagOnNodeChange = true; + return status; } @@ -811,6 +841,11 @@ StyledEditWindow::OpenFile(entry_ref* ref) _LoadAttrs(); } + + _SwitchNodeMonitor(true, ref); + + fReloadItem->SetEnabled(fSaveMessage != NULL); + fEncodingItem->SetEnabled(fSaveMessage != NULL); fTextView->Select(0, 0); } @@ -841,7 +876,7 @@ StyledEditWindow::Print(const char* documentName) printJob.SetSettings(new BMessage(*fPrintSettings)); if (printJob.ConfigJob() != B_OK) - return; + return; delete fPrintSettings; fPrintSettings = printJob.Settings(); @@ -890,7 +925,9 @@ StyledEditWindow::Print(const char* documentName) while (printLine <= lastLine) { float currentHeight = 0; int32 firstLineOnPage = printLine; - while (currentHeight < printableRect.Height() && printLine <= lastLine) { + while (currentHeight < printableRect.Height() + && printLine <= lastLine) + { currentHeight += fTextView->LineHeight(printLine); if (currentHeight < printableRect.Height()) printLine++; @@ -993,6 +1030,8 @@ StyledEditWindow::_InitWindow(uint32 encoding) fWrapAround = false; fBackSearch = false; + fNagOnNodeChange = true; + // add menubar fMenuBar = new BMenuBar(BRect(0, 0, 0, 0), "menubar"); AddChild(fMenuBar); @@ -1043,10 +1082,11 @@ StyledEditWindow::_InitWindow(uint32 encoding) menuItem->SetShortcut('S', B_SHIFT_KEY); menuItem->SetEnabled(true); - menu->AddItem(fRevertItem - = new BMenuItem(B_TRANSLATE("Revert to saved" B_UTF8_ELLIPSIS), - new BMessage(MENU_REVERT))); - fRevertItem->SetEnabled(false); + menu->AddItem(fReloadItem + = new BMenuItem(B_TRANSLATE("Reload" B_UTF8_ELLIPSIS), + new BMessage(MENU_RELOAD), 'L')); + fReloadItem->SetEnabled(false); + menu->AddItem(new BMenuItem(B_TRANSLATE("Close"), new BMessage(MENU_CLOSE), 'W')); @@ -1107,7 +1147,7 @@ StyledEditWindow::_InitWindow(uint32 encoding) fFontMenu = new BMenu(B_TRANSLATE("Font")); fMenuBar->AddItem(fFontMenu); - //"Size"-subMenu + // "Size"-subMenu fFontSizeMenu = new BMenu(B_TRANSLATE("Size")); fFontSizeMenu->SetRadioMode(true); fFontMenu->AddItem(fFontSizeMenu); @@ -1210,6 +1250,9 @@ StyledEditWindow::_InitWindow(uint32 encoding) fWrapItem->SetMarked(true); fWrapItem->SetShortcut('W', B_OPTION_KEY); + menu->AddItem(fEncodingItem = _MakeEncodingMenuItem()); + fEncodingItem->SetEnabled(false); + menu->AddSeparatorItem(); menu->AddItem(new BMenuItem(B_TRANSLATE("Statistics" B_UTF8_ELLIPSIS), new BMessage(SHOW_STATISTICS))); @@ -1286,7 +1329,7 @@ StyledEditWindow::_SaveAttrs() status_t -StyledEditWindow::_LoadFile(entry_ref* ref) +StyledEditWindow::_LoadFile(entry_ref* ref, const char* forceEncoding) { BEntry entry(ref, true); // traverse an eventual link @@ -1299,7 +1342,7 @@ StyledEditWindow::_LoadFile(entry_ref* ref) if (status == B_OK) status = file.SetTo(&entry, B_READ_ONLY); if (status == B_OK) - status = fTextView->GetStyledText(&file); + status = fTextView->GetStyledText(&file, forceEncoding); if (status == B_ENTRY_NOT_FOUND) { // Treat non-existing files consideratley; we just want to get an @@ -1351,11 +1394,14 @@ StyledEditWindow::_LoadFile(entry_ref* ref) void -StyledEditWindow::_RevertToSaved() +StyledEditWindow::_ReloadDocument(BMessage* message) { entry_ref ref; const char* name; + if (fSaveMessage == NULL || message == NULL) + return; + fSaveMessage->FindRef("directory", &ref); fSaveMessage->FindString("name", &name); @@ -1376,15 +1422,40 @@ StyledEditWindow::_RevertToSaved() return; } - BString alertText; - bs_printf(&alertText, - B_TRANSLATE("Revert to the last version of \"%s\"? "), Title()); - if (_ShowAlert(alertText, B_TRANSLATE("Cancel"), B_TRANSLATE("OK"), - "", B_WARNING_ALERT) != 1) - return; + if (!fClean) { + BString alertText; + bs_printf(&alertText, + B_TRANSLATE("\"%s\" has unsaved changes.\n" + "Revert it to the last saved version? "), Title()); + if (_ShowAlert(alertText, B_TRANSLATE("Cancel"), B_TRANSLATE("OK"), + "", B_WARNING_ALERT) != 1) + return; + } + + const char* forceEncoding = NULL; + if (message->FindString("encoding", &forceEncoding) != B_OK) { + const BCharacterSet* charset + = BCharacterSetRoster::GetCharacterSetByFontID( + fTextView->GetEncoding()); + if (charset != NULL) + forceEncoding = charset->GetName(); + } + + BScrollBar* vertBar = fScrollView->ScrollBar(B_VERTICAL); + float vertPos = vertBar != NULL ? vertBar->Value() : 0.f; + + DisableUpdates(); fTextView->Reset(); - if (_LoadFile(&ref) != B_OK) + + status = _LoadFile(&ref, forceEncoding); + + if (vertBar != NULL) + vertBar->SetValue(vertPos); + + EnableUpdates(); + + if (status != B_OK) return; #undef B_TRANSLATION_CONTEXT @@ -1400,10 +1471,12 @@ StyledEditWindow::_RevertToSaved() // clear clean modes fSaveItem->SetEnabled(false); - fRevertItem->SetEnabled(false); + fUndoCleans = false; fRedoCleans = false; fClean = true; + + fNagOnNodeChange = true; } @@ -1656,7 +1729,8 @@ StyledEditWindow::_UpdateCleanUndoRedoSaveRevert() fClean = false; fUndoCleans = false; fRedoCleans = false; - fRevertItem->SetEnabled(fSaveMessage != NULL); + fReloadItem->SetEnabled(fSaveMessage != NULL); + fEncodingItem->SetEnabled(fSaveMessage != NULL); fSaveItem->SetEnabled(true); fUndoItem->SetLabel(B_TRANSLATE("Can't undo")); fUndoItem->SetEnabled(false); @@ -1686,3 +1760,234 @@ StyledEditWindow::_ShowAlert(const BString& text, const BString& label, return alert->Go(); } + + +BMenuItem* +StyledEditWindow::_MakeEncodingMenuItem() +{ + BMenu* menu = new BMenu(B_TRANSLATE("Text encoding")); + + BCharacterSetRoster roster; + BCharacterSet charset; + while (roster.GetNextCharacterSet(&charset) == B_OK) { + const char* mime = charset.GetMIMEName(); + BString name(charset.GetPrintName()); + + if (mime) + name << " (" << mime << ")"; + + BMessage *message = new BMessage(MENU_RELOAD); + if (message != NULL) { + message->AddString("encoding", charset.GetName()); + menu->AddItem(new BMenuItem(name, message)); + } + } + + menu->AddSeparatorItem(); + BMessage *message = new BMessage(MENU_RELOAD); + message->AddString("encoding", "auto"); + menu->AddItem(new BMenuItem(B_TRANSLATE("Autodetect"), message)); + + menu->SetRadioMode(true); + + return new BMenuItem(menu, new BMessage(MENU_RELOAD)); +} + + +#undef B_TRANSLATION_CONTEXT +#define B_TRANSLATION_CONTEXT "NodeMonitorAlerts" + + +void +StyledEditWindow::_ShowNodeChangeAlert(const char* name, bool removed) +{ + if (!fNagOnNodeChange) + return; + + BString alertText(removed ? B_TRANSLATE("File \"%file%\" was removed by " + "another application, recover it?") + : B_TRANSLATE("File \"%file%\" was modified by " + "another application, reload it?")); + alertText.ReplaceAll("%file%", name); + + if (_ShowAlert(alertText, removed ? B_TRANSLATE("Recover") + : B_TRANSLATE("Reload"), B_TRANSLATE("Ignore"), "", + B_WARNING_ALERT) == 0) + { + if (!removed) { + // supress the warning - user has already agreed + fClean = true; + BMessage msg(MENU_RELOAD); + _ReloadDocument(&msg); + } else + Save(); + } else + fNagOnNodeChange = false; + + fSaveItem->SetEnabled(!fClean); +} + + +void +StyledEditWindow::_HandleNodeMonitorEvent(BMessage *message) +{ + int32 opcode = 0; + if (message->FindInt32("opcode", &opcode) != B_OK) + return; + + if (opcode != B_ENTRY_CREATED + && message->FindInt64("node") != fNodeRef.node) + // bypass foreign nodes' event + return; + + switch (opcode) { + case B_STAT_CHANGED: + { + int32 fields = 0; + if (message->FindInt32("fields", &fields) == B_OK + && (fields & (B_STAT_SIZE | B_STAT_MODIFICATION_TIME)) == 0) + break; + + const char* name = NULL; + if (fSaveMessage->FindString("name", &name) != B_OK) + break; + + _ShowNodeChangeAlert(name, false); + } + break; + + case B_ENTRY_MOVED: + { + int32 device = 0; + int64 srcFolder = 0; + int64 dstFolder = 0; + const char* name = NULL; + if (message->FindInt32("device", &device) != B_OK + || message->FindInt64("to directory", &dstFolder) != B_OK + || message->FindInt64("from directory", &srcFolder) != B_OK + || message->FindString("name", &name) != B_OK) + break; + + entry_ref newRef(device, dstFolder, name); + BEntry entry(&newRef); + + BEntry dirEntry; + entry.GetParent(&dirEntry); + + entry_ref ref; + dirEntry.GetRef(&ref); + fSaveMessage->ReplaceRef("directory", &ref); + fSaveMessage->ReplaceString("name", name); + + // store previous name - it may be useful in case + // we have just moved to temporary copy of file (vim case) + const char* sourceName = NULL; + if (message->FindString("from name", &sourceName) == B_OK) { + fSaveMessage->RemoveName("org.name"); + fSaveMessage->AddString("org.name", sourceName); + fSaveMessage->RemoveName("move time"); + fSaveMessage->AddInt64("move time", system_time()); + } + + SetTitle(name); + be_roster->AddToRecentDocuments(&newRef, APP_SIGNATURE); + + if (srcFolder != dstFolder) { + _SwitchNodeMonitor(false); + _SwitchNodeMonitor(true); + } + } + break; + + case B_ENTRY_REMOVED: + { + _SwitchNodeMonitor(false); + + fClean = false; + + // some editors like vim save files in following way: + // 1) move t.txt -> t.txt~ + // 2) re-create t.txt and write data to it + // 3) remove t.txt~ + // go to catch this case + int32 device = 0; + int64 directory = 0; + BString orgName; + if (fSaveMessage->FindString("org.name", &orgName) == B_OK + && message->FindInt32("device", &device) == B_OK + && message->FindInt64("directory", &directory) == B_OK) + { + // reuse the source name if it is not too old + bigtime_t time = fSaveMessage->FindInt64("move time"); + if ((system_time() - time) < 1000000) { + entry_ref ref(device, directory, orgName); + BEntry entry(&ref); + if (entry.InitCheck() == B_OK) { + _SwitchNodeMonitor(true, &ref); + } + + fSaveMessage->ReplaceString("name", orgName); + fSaveMessage->RemoveName("org.name"); + fSaveMessage->RemoveName("move time"); + + SetTitle(orgName); + _ShowNodeChangeAlert(orgName, false); + break; + } + } + + const char* name = NULL; + if (message->FindString("name", &name) != B_OK + && fSaveMessage->FindString("name", &name) != B_OK) + name = "Unknown"; + + _ShowNodeChangeAlert(name, true); + } + break; + + default: + break; + } +} + + +void +StyledEditWindow::_SwitchNodeMonitor(bool on, entry_ref* ref) +{ + if (!on) { + watch_node(&fNodeRef, B_STOP_WATCHING, this); + watch_node(&fFolderNodeRef, B_STOP_WATCHING, this); + fNodeRef = node_ref(); + fFolderNodeRef = node_ref(); + return; + } + + BEntry entry, folderEntry; + + if (ref != NULL) { + entry.SetTo(ref, true); + entry.GetParent(&folderEntry); + + } else if (fSaveMessage != NULL) { + entry_ref ref; + const char* name = NULL; + if (fSaveMessage->FindRef("directory", &ref) != B_OK + || fSaveMessage->FindString("name", &name) != B_OK) + return; + + BDirectory dir(&ref); + entry.SetTo(&dir, name); + folderEntry.SetTo(&ref); + + } else + return; + + if (entry.InitCheck() != B_OK || folderEntry.InitCheck() != B_OK) + return; + + entry.GetNodeRef(&fNodeRef); + folderEntry.GetNodeRef(&fFolderNodeRef); + + watch_node(&fNodeRef, B_WATCH_STAT, this); + watch_node(&fFolderNodeRef, B_WATCH_DIRECTORY, this); +} diff --git a/src/apps/stylededit/StyledEditWindow.h b/src/apps/stylededit/StyledEditWindow.h index 19f0ad8bf8..ad5db0fe2f 100644 --- a/src/apps/stylededit/StyledEditWindow.h +++ b/src/apps/stylededit/StyledEditWindow.h @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010, Haiku, Inc. All Rights Reserved. + * Copyright 2002-2012, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -15,15 +15,15 @@ #include #include #include - +#include struct entry_ref; +class BFilePanel; class BMenu; -class BMessage; class BMenuBar; class BMenuItem; -class BFilePanel; +class BMessage; class BScrollView; class StyledEditView; @@ -52,10 +52,12 @@ public: private: void _InitWindow(uint32 encoding = 0); + BMenuItem* _MakeEncodingMenuItem(); void _LoadAttrs(); void _SaveAttrs(); - status_t _LoadFile(entry_ref* ref); - void _RevertToSaved(); + status_t _LoadFile(entry_ref* ref, + const char* forceEncoding = NULL); + void _ReloadDocument(BMessage *message); bool _Search(BString searchFor, bool caseSensitive, bool wrap, bool backSearch, bool scrollToOccurence = true); @@ -76,6 +78,27 @@ private: const BString& label3, alert_type type) const; + // node monitoring helper + class _NodeMonitorSuspender { + StyledEditWindow *fWindow; + public: + _NodeMonitorSuspender(StyledEditWindow *w) : fWindow(w) { + fWindow->_SwitchNodeMonitor(false); + } + + ~_NodeMonitorSuspender() { + fWindow->_SwitchNodeMonitor(true); + } + }; + + friend class _NodeMonitorSuspender; + + void _HandleNodeMonitorEvent(BMessage *message); + void _ShowNodeChangeAlert(const char* name, + bool removed); + void _SwitchNodeMonitor(bool on, + entry_ref* ref = NULL); + private: BMenuBar* fMenuBar; BMessage* fPrintSettings; @@ -89,7 +112,7 @@ private: BMenuItem* fCurrentStyleItem; BMenuItem* fSaveItem; - BMenuItem* fRevertItem; + BMenuItem* fReloadItem; BMenuItem* fUndoItem; BMenuItem* fCutItem; @@ -113,6 +136,7 @@ private: BMenuItem* fAlignLeft; BMenuItem* fAlignCenter; BMenuItem* fAlignRight; + BMenuItem* fEncodingItem; BString fStringToFind; BString fReplaceString; @@ -139,6 +163,10 @@ private: BFilePanel* fSavePanel; BMenu* fSavePanelEncodingMenu; + // node monitoring + node_ref fNodeRef; + node_ref fFolderNodeRef; + bool fNagOnNodeChange; }; From e8a837faaccabb23e9862e58fc96ee2cc8f356cd Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Mon, 10 Dec 2012 23:12:53 -0500 Subject: [PATCH 35/57] Fix crash in BListValueNode. - Don't try to create children if location resolution failed. --- src/apps/debugger/value/value_nodes/BListValueNode.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/apps/debugger/value/value_nodes/BListValueNode.cpp b/src/apps/debugger/value/value_nodes/BListValueNode.cpp index bd0073f931..86f3c8e4c9 100644 --- a/src/apps/debugger/value/value_nodes/BListValueNode.cpp +++ b/src/apps/debugger/value/value_nodes/BListValueNode.cpp @@ -307,6 +307,9 @@ BListValueNode::CreateChildren() if (fChildrenCreated) return B_OK; + if (fLocationResolutionState != B_OK) + return fLocationResolutionState; + if (fItemCountType != NULL) { BListItemCountNodeChild* countChild = new(std::nothrow) BListItemCountNodeChild(fItemCountLocation, this, fItemCountType); From 2f50903e1daa7772c20c3d7b30d09f3a1b4721af Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Mon, 10 Dec 2012 23:13:40 -0500 Subject: [PATCH 36/57] Factor out a PrintValueNodeGraph() helper from DebugReportGenerator. - Intended to also be used by CLI to print variables there. --- .../debugger/user_interface/util/UiUtils.cpp | 67 +++++++++++++++++++ .../debugger/user_interface/util/UiUtils.h | 10 ++- 2 files changed, 76 insertions(+), 1 deletion(-) diff --git a/src/apps/debugger/user_interface/util/UiUtils.cpp b/src/apps/debugger/user_interface/util/UiUtils.cpp index 72aa28120c..28fcd89431 100644 --- a/src/apps/debugger/user_interface/util/UiUtils.cpp +++ b/src/apps/debugger/user_interface/util/UiUtils.cpp @@ -11,6 +11,7 @@ #include #include +#include #include #include "FunctionInstance.h" @@ -18,6 +19,9 @@ #include "StackFrame.h" #include "Team.h" #include "Thread.h" +#include "Type.h" +#include "Value.h" +#include "ValueNode.h" /*static*/ const char* @@ -156,3 +160,66 @@ UiUtils::ReportNameForTeam(::Team* team, char* buffer, size_t bufferSize) return buffer; } + + +/*static*/ void +UiUtils::PrintValueNodeGraph(BString& _output, StackFrame* frame, + ValueNodeChild* child, int32 indentLevel, int32 maxDepth) +{ + _output.Append('\t', indentLevel); + _output << child->Name(); + + ValueNode* node = child->Node(); + if (node == NULL) { + _output << ": Unavailable\n"; + return; + } + + if (node->GetType()->Kind() != TYPE_COMPOUND) { + _output << ": "; + status_t resolutionState = node->LocationAndValueResolutionState(); + if (resolutionState == VALUE_NODE_UNRESOLVED) + _output << "Unresolved"; + else if (resolutionState == B_OK) { + Value* value = node->GetValue(); + if (value != NULL) { + BString valueData; + value->ToString(valueData); + _output << valueData; + } else + _output << "Unavailable"; + } else + _output << strerror(resolutionState); + } + + if (maxDepth == 0 || node->CountChildren() == 0) { + _output << "\n"; + return; + } + + _output << " {\n"; + + if (node->CountChildren() == 1 + && node->GetType()->Kind() == TYPE_ADDRESS + && node->ChildAt(0)->GetType()->Kind() == TYPE_COMPOUND) { + // for the case of a pointer to a compound type, + // we want to hide the intervening compound node and print + // the children directly. + node = node->ChildAt(0)->Node(); + } + + for (int32 i = 0; i < node->CountChildren(); i++) { + // don't dump compound nodes if our depth limit won't allow + // us to traverse into their children anyways, and the top + // level node contains no data of intereest. + if (node->ChildAt(i)->GetType()->Kind() != TYPE_COMPOUND + || maxDepth > 1) { + PrintValueNodeGraph(_output, frame, node->ChildAt(i), + indentLevel + 1, maxDepth - 1); + } + } + _output.Append('\t', indentLevel); + _output << "}\n"; + + return; +} diff --git a/src/apps/debugger/user_interface/util/UiUtils.h b/src/apps/debugger/user_interface/util/UiUtils.h index 81ed46df90..3e81de83de 100644 --- a/src/apps/debugger/user_interface/util/UiUtils.h +++ b/src/apps/debugger/user_interface/util/UiUtils.h @@ -10,10 +10,11 @@ #include +class BString; class BVariant; class StackFrame; class Team; - +class ValueNodeChild; class UiUtils { public: @@ -29,6 +30,13 @@ public: static const char* ReportNameForTeam(::Team* team, char* buffer, size_t bufferSize); + + // this function assumes the value nodes have already been resolved + // (if possible). + static void PrintValueNodeGraph(BString& _output, + StackFrame* frame, + ValueNodeChild* child, + int32 indentLevel, int32 maxDepth); }; From 154b1dd2bf42a534b7099bcc9e2f47cd71199576 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Mon, 10 Dec 2012 23:17:05 -0500 Subject: [PATCH 37/57] Refactor DebugReportGenerator to use PrintValueNodeGraph. --- .../controllers/DebugReportGenerator.cpp | 93 ++++--------------- .../controllers/DebugReportGenerator.h | 7 +- 2 files changed, 22 insertions(+), 78 deletions(-) diff --git a/src/apps/debugger/controllers/DebugReportGenerator.cpp b/src/apps/debugger/controllers/DebugReportGenerator.cpp index d8a16d7cf8..6bcfa1f3af 100644 --- a/src/apps/debugger/controllers/DebugReportGenerator.cpp +++ b/src/apps/debugger/controllers/DebugReportGenerator.cpp @@ -312,7 +312,9 @@ DebugReportGenerator::_DumpDebuggedThreadInfo(BString& _output, AutoLocker containerLocker(container); for (int32 i = 0; i < container->CountChildren(); i++) { ValueNodeChild* child = container->ChildAt(i); - _DumpValueNode(_output, frame, child); + _ResolveLocationIfNeeded(child, frame); + _ResolveValueIfNeeded(child->Node(), frame, 4); + UiUtils::PrintValueNodeGraph(_output, frame, child, 3, 2); } _output << "\n"; } @@ -337,78 +339,8 @@ DebugReportGenerator::_DumpDebuggedThreadInfo(BString& _output, status_t -DebugReportGenerator::_DumpValueNode(BString& _output, StackFrame* frame, - ValueNodeChild* child, bool recurse) -{ - status_t result = _ResolveLocationIfNeeded(child, frame); - if (result != B_OK) - return result; - - _output << "\t\t\t"; - if (!recurse) - _output << "\t"; - _output << child->Name() << ": "; - - ValueNode* node = child->Node(); - if (node->LocationAndValueResolutionState() == VALUE_NODE_UNRESOLVED) { - if (_ResolveValueIfNeeded(node, frame) == B_OK) { - Value* value = node->GetValue(); - if (value != NULL) { - BString valueData; - value->ToString(valueData); - _output << valueData; - } else - _output << "Unavailable"; - } else - _output << "Unknown"; - } - if (recurse && node->CountChildren() != 0) - _output << " {"; - - _output << "\n"; - - if (recurse) { - if (node->CountChildren() == 0) - return B_OK; - - if (node->CountChildren() == 1 - && node->GetType()->Kind() == TYPE_ADDRESS - && node->ChildAt(0)->GetType()->Kind() == TYPE_COMPOUND) { - // for the case of a pointer to a compound type, - // we want to hide the intervening compound node and print - // the children directly. - status_t result = fNodeManager->AddChildNodes(node->ChildAt(0)); - if (result == B_OK) { - result = _ResolveLocationIfNeeded(node->ChildAt(0), frame); - if (result == B_OK) { - node = node->ChildAt(0)->Node(); - // attempt to resolve the value here since the node's - // representation may requires its value to be resolved - // before its children can be created - result = _ResolveValueIfNeeded(node, frame); - } - } - } - - for (int32 i = 0; i < node->CountChildren(); i++) { - if (fNodeManager->AddChildNodes(node->ChildAt(i)) != B_OK) - continue; - - // don't dump compound nodes since we won't traverse into - // them anyways and their top level node has no interesting - // information. - if (node->ChildAt(i)->GetType()->Kind() != TYPE_COMPOUND) - _DumpValueNode(_output, frame, node->ChildAt(i), false); - } - _output << "\t\t\t}\n"; - } - - return B_OK; -} - - -status_t -DebugReportGenerator::_ResolveValueIfNeeded(ValueNode* node, StackFrame* frame) +DebugReportGenerator::_ResolveValueIfNeeded(ValueNode* node, StackFrame* frame, + int32 maxDepth) { ValueLocation* location = NULL; Value* value = NULL; @@ -422,6 +354,21 @@ DebugReportGenerator::_ResolveValueIfNeeded(ValueNode* node, StackFrame* frame) if (value != NULL) value->ReleaseReference(); + if (result == B_OK && maxDepth > 0) { + for (int32 i = 0; i < node->CountChildren(); i++) { + ValueNodeChild* child = node->ChildAt(i); + result = _ResolveLocationIfNeeded(child, frame); + if (result != B_OK) + continue; + + result = fNodeManager->AddChildNodes(child); + if (result != B_OK) + continue; + + _ResolveValueIfNeeded(child->Node(), frame, maxDepth - 1); + } + } + return result; } diff --git a/src/apps/debugger/controllers/DebugReportGenerator.h b/src/apps/debugger/controllers/DebugReportGenerator.h index 03d7f5c6db..17b1a54f5a 100644 --- a/src/apps/debugger/controllers/DebugReportGenerator.h +++ b/src/apps/debugger/controllers/DebugReportGenerator.h @@ -3,7 +3,7 @@ * Distributed under the terms of the MIT License. */ #ifndef DEBUG_REPORT_GENERATOR_H -#define DEBUG_GENERATOR_H +#define DEBUG_REPORT_GENERATOR_H #include @@ -44,14 +44,11 @@ private: status_t _DumpRunningThreads(BString& output); status_t _DumpDebuggedThreadInfo(BString& output, ::Thread* thread); - status_t _DumpValueNode(BString& output, - StackFrame* frame, ValueNodeChild* child, - bool recurse = true); status_t _ResolveLocationIfNeeded(ValueNodeChild* child, StackFrame* frame); status_t _ResolveValueIfNeeded(ValueNode* node, - StackFrame* frame); + StackFrame* frame, int32 maxDepth); private: ::Team* fTeam; From 3cdae65125db9d867f328391d69970197e4b9556 Mon Sep 17 00:00:00 2001 From: Sam Toyer Date: Fri, 30 Nov 2012 08:57:10 +1000 Subject: [PATCH 38/57] sem_timedwait: fix errno, return value and NULL behaviour * Takes into account remarks from Ingo. Signed-off-by: Jerome Duval Signed-off-by: Ingo Weinhold --- src/system/libroot/posix/semaphore.cpp | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/system/libroot/posix/semaphore.cpp b/src/system/libroot/posix/semaphore.cpp index b96b8358f7..fb57ced9c3 100644 --- a/src/system/libroot/posix/semaphore.cpp +++ b/src/system/libroot/posix/semaphore.cpp @@ -112,11 +112,25 @@ sem_post(sem_t* semaphore) int sem_timedwait(sem_t* semaphore, const struct timespec* timeout) { - bigtime_t timeoutMicros = ((bigtime_t)timeout->tv_sec) * 1000000 - + timeout->tv_nsec / 1000; + if (timeout != NULL && (timeout->tv_nsec < 0 || + timeout->tv_nsec >= 1000000000)) { + status_t err = _kern_realtime_sem_wait(semaphore->id, 0); + if (err == B_WOULD_BLOCK) + err = EINVAL; + // do nothing, return err as it is. + RETURN_AND_SET_ERRNO_TEST_CANCEL(err); + } - RETURN_AND_SET_ERRNO_TEST_CANCEL( - _kern_realtime_sem_wait(semaphore->id, timeoutMicros)); + bigtime_t timeoutMicros = B_INFINITE_TIMEOUT; + if (timeout != NULL) { + timeoutMicros = ((bigtime_t)timeout->tv_sec) * 1000000 + + timeout->tv_nsec / 1000; + } + status_t err = _kern_realtime_sem_wait(semaphore->id, timeoutMicros); + if (err == B_WOULD_BLOCK) + err = ETIMEDOUT; + + RETURN_AND_SET_ERRNO_TEST_CANCEL(err); } From f1a3e05d8c26328f345d29afb705dc828b631bf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Tue, 11 Dec 2012 23:21:45 +0100 Subject: [PATCH 39/57] style fix as suggested by axeld and jscipione. --- src/system/libroot/posix/semaphore.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/system/libroot/posix/semaphore.cpp b/src/system/libroot/posix/semaphore.cpp index fb57ced9c3..33cb768443 100644 --- a/src/system/libroot/posix/semaphore.cpp +++ b/src/system/libroot/posix/semaphore.cpp @@ -112,8 +112,8 @@ sem_post(sem_t* semaphore) int sem_timedwait(sem_t* semaphore, const struct timespec* timeout) { - if (timeout != NULL && (timeout->tv_nsec < 0 || - timeout->tv_nsec >= 1000000000)) { + if (timeout != NULL + && (timeout->tv_nsec < 0 || timeout->tv_nsec >= 1000000000)) { status_t err = _kern_realtime_sem_wait(semaphore->id, 0); if (err == B_WOULD_BLOCK) err = EINVAL; From 8f06ba2f84c10028d76529f65511b8e9edb525ca Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Wed, 12 Dec 2012 03:03:24 +0000 Subject: [PATCH 40/57] swpipe: Improve llvmpipe environment * Only call correct public llvmpipe includes * Clean up tracing --- src/add-ons/opengl/swpipe/GalliumContext.cpp | 10 +++------- src/add-ons/opengl/swpipe/Jamfile | 6 ++++-- src/add-ons/opengl/swpipe/SoftwareWinsys.cpp | 10 +++++----- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/add-ons/opengl/swpipe/GalliumContext.cpp b/src/add-ons/opengl/swpipe/GalliumContext.cpp index 6e91cd08e0..f06c7b96b7 100644 --- a/src/add-ons/opengl/swpipe/GalliumContext.cpp +++ b/src/add-ons/opengl/swpipe/GalliumContext.cpp @@ -26,13 +26,9 @@ extern "C" { #include "state_tracker/st_gl_api.h" #include "state_tracker/st_manager.h" #include "state_tracker/sw_winsys.h" -#include "softpipe/sp_context.h" #include "softpipe/sp_public.h" -#include "softpipe/sp_texture.h" -#ifdef USE_LLVMPIPE -#include "llvmpipe/lp_context.h" +#ifdef HAVE_LLVM #include "llvmpipe/lp_public.h" -#include "llvmpipe/lp_texture.h" #endif } @@ -209,7 +205,7 @@ GalliumContext::CreateScreen() return B_ERROR; } - #if USE_LLVMPIPE + #ifdef HAVE_LLVM fScreen = llvmpipe_create_screen(winsys); #endif @@ -223,7 +219,7 @@ GalliumContext::CreateScreen() } const char* driverName = fScreen->get_name(fScreen); - TRACE("%s: Using %s driver.\n", __func__, driverName); + ERROR("%s: Using %s driver.\n", __func__, driverName); return B_OK; } diff --git a/src/add-ons/opengl/swpipe/Jamfile b/src/add-ons/opengl/swpipe/Jamfile index 38fe42a683..6283699f9a 100644 --- a/src/add-ons/opengl/swpipe/Jamfile +++ b/src/add-ons/opengl/swpipe/Jamfile @@ -15,8 +15,10 @@ local sources = if $(HAIKU_LLVM_PRESENT) { # TODO: Add LLVM OptionalBuildPackage - SubDirC++Flags [ FDefines USE_LLVMPIPE ] ; - SubDirSysHdrs $(HAIKU_LLVM_HEADERS) ; + SubDirC++Flags [ FDefines HAVE_LLVM=0x0302 ] ; + + # TODO: This is a hack for now + SubDirSysHdrs /boot/common/include ; } diff --git a/src/add-ons/opengl/swpipe/SoftwareWinsys.cpp b/src/add-ons/opengl/swpipe/SoftwareWinsys.cpp index 1cdee94824..cd4e24b19c 100644 --- a/src/add-ons/opengl/swpipe/SoftwareWinsys.cpp +++ b/src/add-ons/opengl/swpipe/SoftwareWinsys.cpp @@ -22,15 +22,15 @@ extern "C" { } -#define TRACE_CONTEXT -#ifdef TRACE_CONTEXT -# define TRACE(x...) printf("GalliumContext: " x) +#define TRACE_WINSYS +#ifdef TRACE_WINSYS +# define TRACE(x...) printf("GalliumWinsys: " x) # define CALLED() TRACE("CALLED: %s\n", __PRETTY_FUNCTION__) #else # define TRACE(x...) # define CALLED() #endif -#define ERROR(x...) printf("GalliumContext: " x) +#define ERROR(x...) printf("GalliumWinsys: " x) // Cast @@ -209,4 +209,4 @@ winsys_connect_hooks() winsys->displaytarget_destroy = hook_winsys_displaytarget_destroy; return winsys; -} \ No newline at end of file +} From 9403439347067e749e5fd4e7ec8ad2af40ea82e8 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Tue, 11 Dec 2012 22:49:28 -0500 Subject: [PATCH 41/57] Ensure that node pointer is valid before traversing. --- .../debugger/user_interface/util/UiUtils.cpp | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/apps/debugger/user_interface/util/UiUtils.cpp b/src/apps/debugger/user_interface/util/UiUtils.cpp index 28fcd89431..9559f9f772 100644 --- a/src/apps/debugger/user_interface/util/UiUtils.cpp +++ b/src/apps/debugger/user_interface/util/UiUtils.cpp @@ -197,8 +197,6 @@ UiUtils::PrintValueNodeGraph(BString& _output, StackFrame* frame, return; } - _output << " {\n"; - if (node->CountChildren() == 1 && node->GetType()->Kind() == TYPE_ADDRESS && node->ChildAt(0)->GetType()->Kind() == TYPE_COMPOUND) { @@ -208,18 +206,22 @@ UiUtils::PrintValueNodeGraph(BString& _output, StackFrame* frame, node = node->ChildAt(0)->Node(); } - for (int32 i = 0; i < node->CountChildren(); i++) { - // don't dump compound nodes if our depth limit won't allow - // us to traverse into their children anyways, and the top - // level node contains no data of intereest. - if (node->ChildAt(i)->GetType()->Kind() != TYPE_COMPOUND - || maxDepth > 1) { - PrintValueNodeGraph(_output, frame, node->ChildAt(i), - indentLevel + 1, maxDepth - 1); + if (node != NULL) { + _output << " {\n"; + + for (int32 i = 0; i < node->CountChildren(); i++) { + // don't dump compound nodes if our depth limit won't allow + // us to traverse into their children anyways, and the top + // level node contains no data of intereest. + if (node->ChildAt(i)->GetType()->Kind() != TYPE_COMPOUND + || maxDepth > 1) { + PrintValueNodeGraph(_output, frame, node->ChildAt(i), + indentLevel + 1, maxDepth - 1); + } } + _output.Append('\t', indentLevel); + _output << "}\n"; } - _output.Append('\t', indentLevel); - _output << "}\n"; return; } From 00e7e607efe93e7ea322d17bbdde22157ec5e127 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Tue, 11 Dec 2012 22:50:01 -0500 Subject: [PATCH 42/57] Always forward ValueChanged() event. - If creating children failed, we wouldn't forward the event on to the listeners. --- .../debugger/debug_managers/ValueNodeManager.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/apps/debugger/debug_managers/ValueNodeManager.cpp b/src/apps/debugger/debug_managers/ValueNodeManager.cpp index 4dce046445..03399d1110 100644 --- a/src/apps/debugger/debug_managers/ValueNodeManager.cpp +++ b/src/apps/debugger/debug_managers/ValueNodeManager.cpp @@ -149,13 +149,12 @@ ValueNodeManager::ValueNodeValueChanged(ValueNode* valueNode) if (valueNode->ChildCreationNeedsValue() && !valueNode->ChildrenCreated()) { status_t error = valueNode->CreateChildren(); - if (error != B_OK) - return; - - for (int32 i = 0; i < valueNode->CountChildren(); i++) { - ValueNodeChild* child = valueNode->ChildAt(i); - _CreateValueNode(child); - AddChildNodes(child); + if (error == B_OK) { + for (int32 i = 0; i < valueNode->CountChildren(); i++) { + ValueNodeChild* child = valueNode->ChildAt(i); + _CreateValueNode(child); + AddChildNodes(child); + } } } From be56273bbb3af34010db4251513ee5efe0dc79dd Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Tue, 11 Dec 2012 22:50:49 -0500 Subject: [PATCH 43/57] Refactor DebugReportGenerator to use jobs. - Instead of asking nodes to resolve themselves directly, DebugReportGenerator now uses the interface listener to ask the debugger's workers to resolve them on its behalf. --- .../controllers/DebugReportGenerator.cpp | 75 +++++++++++++------ .../controllers/DebugReportGenerator.h | 16 +++- .../debugger/controllers/TeamDebugger.cpp | 2 +- 3 files changed, 67 insertions(+), 26 deletions(-) diff --git a/src/apps/debugger/controllers/DebugReportGenerator.cpp b/src/apps/debugger/controllers/DebugReportGenerator.cpp index 6bcfa1f3af..a5b985c4a4 100644 --- a/src/apps/debugger/controllers/DebugReportGenerator.cpp +++ b/src/apps/debugger/controllers/DebugReportGenerator.cpp @@ -28,6 +28,7 @@ #include "Thread.h" #include "Type.h" #include "UiUtils.h" +#include "UserInterface.h" #include "Value.h" #include "ValueLoader.h" #include "ValueLocation.h" @@ -35,13 +36,17 @@ #include "ValueNodeManager.h" -DebugReportGenerator::DebugReportGenerator(::Team* team) +DebugReportGenerator::DebugReportGenerator(::Team* team, + UserInterfaceListener* listener) : BLooper("DebugReportGenerator"), fTeam(team), fArchitecture(team->GetArchitecture()), fTeamDataSem(-1), - fNodeManager(NULL) + fNodeManager(NULL), + fListener(listener), + fWaitingNode(NULL), + fTraceWaitingThread(NULL) { fTeam->AddListener(this); fArchitecture->AcquireReference(); @@ -52,8 +57,10 @@ DebugReportGenerator::~DebugReportGenerator() { fTeam->RemoveListener(this); fArchitecture->ReleaseReference(); - if (fNodeManager != NULL) + if (fNodeManager != NULL) { + fNodeManager->RemoveListener(this); fNodeManager->ReleaseReference(); + } } @@ -68,6 +75,8 @@ DebugReportGenerator::Init() if (fNodeManager == NULL) return B_NO_MEMORY; + fNodeManager->AddListener(this); + Run(); return B_OK; @@ -75,9 +84,9 @@ DebugReportGenerator::Init() DebugReportGenerator* -DebugReportGenerator::Create(::Team* team) +DebugReportGenerator::Create(::Team* team, UserInterfaceListener* listener) { - DebugReportGenerator* self = new DebugReportGenerator(team); + DebugReportGenerator* self = new DebugReportGenerator(team, listener); try { self->Init(); @@ -145,7 +154,20 @@ DebugReportGenerator::MessageReceived(BMessage* message) void DebugReportGenerator::ThreadStackTraceChanged(const ::Team::ThreadEvent& event) { - release_sem(fTeamDataSem); + if (fTraceWaitingThread == event.GetThread()) { + fTraceWaitingThread = NULL; + release_sem(fTeamDataSem); + } +} + + +void +DebugReportGenerator::ValueNodeValueChanged(ValueNode* node) +{ + if (node == fWaitingNode) { + fWaitingNode = NULL; + release_sem(fTeamDataSem); + } } @@ -280,6 +302,7 @@ DebugReportGenerator::_DumpDebuggedThreadInfo(BString& _output, break; locker.Unlock(); + fTraceWaitingThread = thread; status_t result = acquire_sem(fTeamDataSem); if (result != B_OK) return result; @@ -312,9 +335,10 @@ DebugReportGenerator::_DumpDebuggedThreadInfo(BString& _output, AutoLocker containerLocker(container); for (int32 i = 0; i < container->CountChildren(); i++) { ValueNodeChild* child = container->ChildAt(i); - _ResolveLocationIfNeeded(child, frame); - _ResolveValueIfNeeded(child->Node(), frame, 4); - UiUtils::PrintValueNodeGraph(_output, frame, child, 3, 2); + containerLocker.Unlock(); + _ResolveValueIfNeeded(child->Node(), frame, 1); + containerLocker.Lock(); + UiUtils::PrintValueNodeGraph(_output, frame, child, 3, 1); } _output << "\n"; } @@ -342,21 +366,20 @@ status_t DebugReportGenerator::_ResolveValueIfNeeded(ValueNode* node, StackFrame* frame, int32 maxDepth) { - ValueLocation* location = NULL; - Value* value = NULL; - ValueLoader loader(fTeam->GetArchitecture(), fTeam->GetTeamMemory(), - fTeam->GetTeamTypeInformation(), frame->GetCpuState()); - status_t result = node->ResolvedLocationAndValue(&loader, location, - value); - node->SetLocationAndValue(location, value, result); - if (location != NULL) - location->ReleaseReference(); - if (value != NULL) - value->ReleaseReference(); + status_t result = B_OK; + if (node->LocationAndValueResolutionState() == VALUE_NODE_UNRESOLVED) { + fWaitingNode = node; + fListener->ValueNodeValueRequested(frame->GetCpuState(), + fNodeManager->GetContainer(), node); + result = acquire_sem(fTeamDataSem); + } - if (result == B_OK && maxDepth > 0) { + if (node->LocationAndValueResolutionState() == B_OK && maxDepth > 0) { + AutoLocker containerLocker( + fNodeManager->GetContainer()); for (int32 i = 0; i < node->CountChildren(); i++) { ValueNodeChild* child = node->ChildAt(i); + containerLocker.Unlock(); result = _ResolveLocationIfNeeded(child, frame); if (result != B_OK) continue; @@ -365,7 +388,15 @@ DebugReportGenerator::_ResolveValueIfNeeded(ValueNode* node, StackFrame* frame, if (result != B_OK) continue; - _ResolveValueIfNeeded(child->Node(), frame, maxDepth - 1); + // since in the case of a pointer to a compound we hide + // the intervening compound, don't consider the hidden node + // a level for the purposes of depth traversal + if (node->GetType()->Kind() == TYPE_ADDRESS + && child->GetType()->Kind() == TYPE_COMPOUND) { + _ResolveValueIfNeeded(child->Node(), frame, maxDepth); + } else + _ResolveValueIfNeeded(child->Node(), frame, maxDepth - 1); + containerLocker.Lock(); } } diff --git a/src/apps/debugger/controllers/DebugReportGenerator.h b/src/apps/debugger/controllers/DebugReportGenerator.h index 17b1a54f5a..677334cfd5 100644 --- a/src/apps/debugger/controllers/DebugReportGenerator.h +++ b/src/apps/debugger/controllers/DebugReportGenerator.h @@ -9,6 +9,7 @@ #include #include "Team.h" +#include "ValueNodeContainer.h" class entry_ref; @@ -17,26 +18,32 @@ class BString; class StackFrame; class Team; class Thread; +class UserInterfaceListener; class Value; class ValueNode; class ValueNodeChild; class ValueNodeManager; -class DebugReportGenerator : public BLooper, public Team::Listener { +class DebugReportGenerator : public BLooper, private Team::Listener, + private ValueNodeContainer::Listener { public: - DebugReportGenerator(::Team* team); + DebugReportGenerator(::Team* team, + UserInterfaceListener* listener); ~DebugReportGenerator(); status_t Init(); - static DebugReportGenerator* Create(::Team* team); + static DebugReportGenerator* Create(::Team* team, + UserInterfaceListener* listener); virtual void MessageReceived(BMessage* message); virtual void ThreadStackTraceChanged( const Team::ThreadEvent& event); + virtual void ValueNodeValueChanged(ValueNode* node); + private: status_t _GenerateReport(const entry_ref& outputPath); status_t _GenerateReportHeader(BString& output); @@ -55,6 +62,9 @@ private: Architecture* fArchitecture; sem_id fTeamDataSem; ValueNodeManager* fNodeManager; + UserInterfaceListener* fListener; + ValueNode* fWaitingNode; + ::Thread* fTraceWaitingThread; }; #endif // DEBUG_REPORT_GENERATOR_H diff --git a/src/apps/debugger/controllers/TeamDebugger.cpp b/src/apps/debugger/controllers/TeamDebugger.cpp index a84a3205ad..634eba0d0d 100644 --- a/src/apps/debugger/controllers/TeamDebugger.cpp +++ b/src/apps/debugger/controllers/TeamDebugger.cpp @@ -416,7 +416,7 @@ TeamDebugger::Init(team_id teamID, thread_id threadID, bool stopInMain) return error; // create the debug report generator - fReportGenerator = new(std::nothrow) DebugReportGenerator(fTeam); + fReportGenerator = new(std::nothrow) DebugReportGenerator(fTeam, this); if (fReportGenerator == NULL) return B_NO_MEMORY; From a51eefdd081b909876a0f196d6af1d4819daee44 Mon Sep 17 00:00:00 2001 From: Gleb Posobin Date: Wed, 12 Dec 2012 10:43:01 +0100 Subject: [PATCH 44/57] Hint to layout manager for window width estimation Fixes #5289 Signed-off-by: Siarzhuk Zharski --- src/apps/expander/ExpanderWindow.cpp | 35 ++++++++++++++++++++++------ src/apps/expander/ExpanderWindow.h | 1 + 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/src/apps/expander/ExpanderWindow.cpp b/src/apps/expander/ExpanderWindow.cpp index 2b3a6e8b81..5d642717e8 100644 --- a/src/apps/expander/ExpanderWindow.cpp +++ b/src/apps/expander/ExpanderWindow.cpp @@ -43,6 +43,8 @@ const uint32 MSG_SOURCETEXT = 'mSTX'; const uint32 MSG_DESTTEXT = 'mDTX'; const uint32 MSG_SHOWCONTENTS = 'mSCT'; +const int32 MAX_STATUS_LENGTH = 35; + #undef B_TRANSLATION_CONTEXT #define B_TRANSLATION_CONTEXT "ExpanderWindow" @@ -92,6 +94,12 @@ ExpanderWindow::ExpanderWindow(BRect frame, const entry_ref* ref, BScrollView* scrollView = new BScrollView("", fListingText, B_INVALIDATE_AFTER_LAYOUT, true, true); + // workaround to let the layout manager estimate + // the width of status view and fix the #5289 + // we assume that spaces are twice narrower than normal chars + BString statusPlaceholderString; + statusPlaceholderString.SetTo(' ', MAX_STATUS_LENGTH * 2); + BView* topView = layout->View(); const float spacing = be_control_look->DefaultItemSpacing(); topView->AddChild(BGroupLayoutBuilder(B_VERTICAL, spacing) @@ -110,7 +118,8 @@ ExpanderWindow::ExpanderWindow(BRect frame, const entry_ref* ref, .Add(fShowContents = new BCheckBox( B_TRANSLATE("Show contents"), new BMessage(MSG_SHOWCONTENTS))) - .Add(fStatusView = new BStringView(NULL, NULL)) + .Add(fStatusView = new BStringView(NULL, + statusPlaceholderString)) .End() .End() .End() @@ -412,7 +421,7 @@ ExpanderWindow::MessageReceived(BMessage* msg) // thread has finished (finished, quit, killed, we don't know) // reset window state if (fExpandingStarted) { - fStatusView->SetText(B_TRANSLATE("File expanded")); + SetStatus(B_TRANSLATE("File expanded")); StopExpanding(); OpenDestFolder(); CloseWindowOrKeepOpen(); @@ -421,13 +430,13 @@ ExpanderWindow::MessageReceived(BMessage* msg) StopListing(); _ExpandListingText(); } else - fStatusView->SetText(""); + SetStatus(""); break; case 'exrr': // thread has finished // reset window state - fStatusView->SetText(B_TRANSLATE("Error when expanding archive")); + SetStatus(B_TRANSLATE("Error when expanding archive")); CloseWindowOrKeepOpen(); break; @@ -614,7 +623,7 @@ ExpanderWindow::StartExpanding() BPath path(&entry); BString text(B_TRANSLATE("Expanding '%s'")); text.ReplaceFirst("%s", path.Leaf()); - fStatusView->SetText(text.String()); + SetStatus(text.String()); fExpandingThread = new ExpanderThread(&message, new BMessenger(this)); fExpandingThread->Start(); @@ -713,6 +722,18 @@ ExpanderWindow::_UpdateWindowSize(bool showContents) } +void +ExpanderWindow::SetStatus(BString text) +{ + if (text.Length() >= MAX_STATUS_LENGTH) { + text.Truncate(MAX_STATUS_LENGTH - 1); + text << B_UTF8_ELLIPSIS; + } + + fStatusView->SetText(text); +} + + void ExpanderWindow::StartListing() { @@ -750,7 +771,7 @@ ExpanderWindow::StartListing() BPath path(&entry); BString text(B_TRANSLATE("Creating listing for '%s'")); text.ReplaceFirst("%s", path.Leaf()); - fStatusView->SetText(text.String()); + SetStatus(text.String()); fListingText->SetText(""); fListingThread = new ExpanderThread(&message, new BMessenger(this)); @@ -781,7 +802,7 @@ ExpanderWindow::StopListing(void) fSourceButton->SetEnabled(true); fDestButton->SetEnabled(true); fExpandButton->SetEnabled(true); - fStatusView->SetText(""); + SetStatus(""); } diff --git a/src/apps/expander/ExpanderWindow.h b/src/apps/expander/ExpanderWindow.h index ddf366715d..dcc56d0bb2 100644 --- a/src/apps/expander/ExpanderWindow.h +++ b/src/apps/expander/ExpanderWindow.h @@ -54,6 +54,7 @@ private: void _ExpandListingText(); void StartListing(); void StopListing(); + void SetStatus(BString text); bool ValidateDest(); private: From f7c33e7ff9af71bdeefe9506bfbff7431e1df1ee Mon Sep 17 00:00:00 2001 From: Humdinger Date: Wed, 12 Dec 2012 18:33:05 +0100 Subject: [PATCH 45/57] Fixes case style of a label, "Sound file:" --- src/preferences/sounds/HWindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/preferences/sounds/HWindow.cpp b/src/preferences/sounds/HWindow.cpp index 13b8503724..cf08aa08a9 100644 --- a/src/preferences/sounds/HWindow.cpp +++ b/src/preferences/sounds/HWindow.cpp @@ -110,8 +110,8 @@ HWindow::InitGUI() menu->AddItem(new BMenuItem(B_TRANSLATE("Other" B_UTF8_ELLIPSIS), new BMessage(M_OTHER_MESSAGE))); BMenuField* menuField = new BMenuField("filemenu", - B_TRANSLATE("Sound File:"), menu); - menuField->SetDivider(menuField->StringWidth(B_TRANSLATE("Sound File:")) + B_TRANSLATE("Sound file:"), menu); + menuField->SetDivider(menuField->StringWidth(B_TRANSLATE("Sound file:")) + 10); BButton* stopbutton = new BButton("stop", B_TRANSLATE("Stop"), From 748378c82683178e55f06b4c2d711d4aea7a1b06 Mon Sep 17 00:00:00 2001 From: Humdinger Date: Wed, 12 Dec 2012 18:50:13 +0100 Subject: [PATCH 46/57] Renamed cusor colour settings. "Cursor text" and "Cursor background" in the Color popup menu are a bit unintuitive. Changed to "Text under cursor" and "Cursor". --- src/apps/terminal/AppearPrefView.cpp | 4 ++-- src/apps/terminal/TermConst.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/apps/terminal/AppearPrefView.cpp b/src/apps/terminal/AppearPrefView.cpp index 78b0cfcad0..3c3d23bc78 100644 --- a/src/apps/terminal/AppearPrefView.cpp +++ b/src/apps/terminal/AppearPrefView.cpp @@ -75,8 +75,8 @@ AppearancePrefView::AppearancePrefView(const char* name, const char* kColorTable[] = { B_TRANSLATE("Text"), B_TRANSLATE("Background"), - B_TRANSLATE("Cursor text"), - B_TRANSLATE("Cursor background"), + B_TRANSLATE("Cursor"), + B_TRANSLATE("Text under cursor"), B_TRANSLATE("Selected text"), B_TRANSLATE("Selected background"), NULL diff --git a/src/apps/terminal/TermConst.h b/src/apps/terminal/TermConst.h index 05174b11c5..c40872de54 100644 --- a/src/apps/terminal/TermConst.h +++ b/src/apps/terminal/TermConst.h @@ -103,8 +103,8 @@ static const char* const PREF_HALF_FONT_SIZE = "Half Font Size"; static const char* const PREF_TEXT_FORE_COLOR = "Text"; static const char* const PREF_TEXT_BACK_COLOR = "Background"; -static const char* const PREF_CURSOR_FORE_COLOR = "Cursor text"; -static const char* const PREF_CURSOR_BACK_COLOR = "Cursor background"; +static const char* const PREF_CURSOR_FORE_COLOR = "Text under cursor"; +static const char* const PREF_CURSOR_BACK_COLOR = "Cursor"; static const char* const PREF_SELECT_FORE_COLOR = "Selected text"; static const char* const PREF_SELECT_BACK_COLOR = "Selected background"; From d7250540e0615eb680ca6064a22a5d5446a79a35 Mon Sep 17 00:00:00 2001 From: Humdinger Date: Wed, 12 Dec 2012 21:25:10 +0100 Subject: [PATCH 47/57] Using a variable instead of translating a string twice. Thanks John for the guidance. --- src/preferences/sounds/HWindow.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/preferences/sounds/HWindow.cpp b/src/preferences/sounds/HWindow.cpp index cf08aa08a9..b982eca025 100644 --- a/src/preferences/sounds/HWindow.cpp +++ b/src/preferences/sounds/HWindow.cpp @@ -109,10 +109,10 @@ HWindow::InitGUI() new BMessage(M_NONE_MESSAGE))); menu->AddItem(new BMenuItem(B_TRANSLATE("Other" B_UTF8_ELLIPSIS), new BMessage(M_OTHER_MESSAGE))); - BMenuField* menuField = new BMenuField("filemenu", - B_TRANSLATE("Sound file:"), menu); - menuField->SetDivider(menuField->StringWidth(B_TRANSLATE("Sound file:")) - + 10); + + BString label(B_TRANSLATE("Sound file:")); + BMenuField* menuField = new BMenuField("filemenu", label, menu); + menuField->SetDivider(menuField->StringWidth(label) + 10); BButton* stopbutton = new BButton("stop", B_TRANSLATE("Stop"), new BMessage(M_STOP_MESSAGE)); From 4d6bb87ea72eebfcda0c1733788503aa91f067f1 Mon Sep 17 00:00:00 2001 From: Philippe Saint-Pierre Date: Wed, 12 Dec 2012 18:03:31 -0500 Subject: [PATCH 48/57] LaunchBox: finish saving settings before closing the window (#6347) --- src/apps/launchbox/App.cpp | 10 ++++++---- src/apps/launchbox/MainWindow.cpp | 28 ++++++++++++++++------------ 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/src/apps/launchbox/App.cpp b/src/apps/launchbox/App.cpp index c13756b2d2..fcf5447852 100644 --- a/src/apps/launchbox/App.cpp +++ b/src/apps/launchbox/App.cpp @@ -145,11 +145,13 @@ App::_StoreSettingsIfNeeded() BMessage settings('sett'); for (int32 i = 0; BWindow* window = WindowAt(i); i++) { if (MainWindow* padWindow = dynamic_cast(window)) { - BMessage* windowSettings = padWindow->Settings(); - if (windowSettings && padWindow->Lock()) { - padWindow->SaveSettings(windowSettings); + if (padWindow->Lock()) { + BMessage* windowSettings = padWindow->Settings(); + if (windowSettings) { + padWindow->SaveSettings(windowSettings); + settings.AddMessage("window", windowSettings); + } padWindow->Unlock(); - settings.AddMessage("window", windowSettings); } } } diff --git a/src/apps/launchbox/MainWindow.cpp b/src/apps/launchbox/MainWindow.cpp index 3d3edd8af8..690fd90717 100644 --- a/src/apps/launchbox/MainWindow.cpp +++ b/src/apps/launchbox/MainWindow.cpp @@ -90,19 +90,23 @@ MainWindow::QuitRequested() if (dynamic_cast(window)) padWindowCount++; } - if (padWindowCount == 1) { - be_app->PostMessage(B_QUIT_REQUESTED); - return false; - } else { - BAlert* alert = new BAlert(B_TRANSLATE("last chance"), - B_TRANSLATE("Really close this pad?\n" - "(The pad will not be remembered.)"), - B_TRANSLATE("Close"), B_TRANSLATE("Cancel"), NULL); - alert->SetShortcut(1, B_ESCAPE); - if (alert->Go() == 1) - return false; + bool canClose = true; + if (Lock()) { + if (padWindowCount == 1) { + be_app->PostMessage(B_QUIT_REQUESTED); + canClose = false; + } else { + BAlert* alert = new BAlert(B_TRANSLATE("last chance"), + B_TRANSLATE("Really close this pad?\n" + "(The pad will not be remembered.)"), + B_TRANSLATE("Close"), B_TRANSLATE("Cancel"), NULL); + alert->SetShortcut(1, B_ESCAPE); + if (alert->Go() == 1) + canClose = false; + } + Unlock(); } - return true; + return canClose; } From 55ef15c45a831152b1544a28c34de4aa71e151ff Mon Sep 17 00:00:00 2001 From: Philippe Saint-Pierre Date: Wed, 12 Dec 2012 19:41:57 -0500 Subject: [PATCH 49/57] Mail: use B_FILE_NAME_LENGTH as limit when saving drafts --- src/apps/mail/MailWindow.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/apps/mail/MailWindow.cpp b/src/apps/mail/MailWindow.cpp index 7151aa5fe7..1c246e892b 100644 --- a/src/apps/mail/MailWindow.cpp +++ b/src/apps/mail/MailWindow.cpp @@ -2548,14 +2548,10 @@ TMailWindow::SaveAsDraft() return status; case B_OK: { - char fileName[512], *eofn; - int32 i; - + char fileName[B_FILE_NAME_LENGTH], *eofn; // save as some version of the message's subject - strncpy(fileName, fHeaderView->fSubject->Text(), - sizeof(fileName)-10); - fileName[sizeof(fileName)-10]='\0'; - // terminate like strncpy doesn't + strlcpy(fileName, fHeaderView->fSubject->Text(), + sizeof(fileName)); eofn = fileName + strlen(fileName); // convert /, \ and : to - @@ -2568,7 +2564,7 @@ TMailWindow::SaveAsDraft() // Create the file; if the name exists, find a unique name flags = B_WRITE_ONLY | B_CREATE_FILE | B_FAIL_IF_EXISTS; - for (i = 1; (status = draft.SetTo(&dir, fileName, flags)) + for (int32 i = 1; (status = draft.SetTo(&dir, fileName, flags)) != B_OK; i++) { if (status != B_FILE_EXISTS) return status; From 53b234eb1c4b0d191c9d8c84d7801b63776f9939 Mon Sep 17 00:00:00 2001 From: Philippe Saint-Pierre Date: Wed, 12 Dec 2012 21:49:20 -0500 Subject: [PATCH 50/57] Mail: Reworking of the unique filename discovery (drafts) --- src/apps/mail/MailWindow.cpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/apps/mail/MailWindow.cpp b/src/apps/mail/MailWindow.cpp index 1c246e892b..5b0c6bcbc9 100644 --- a/src/apps/mail/MailWindow.cpp +++ b/src/apps/mail/MailWindow.cpp @@ -2548,11 +2548,11 @@ TMailWindow::SaveAsDraft() return status; case B_OK: { - char fileName[B_FILE_NAME_LENGTH], *eofn; + char fileName[B_FILE_NAME_LENGTH]; // save as some version of the message's subject strlcpy(fileName, fHeaderView->fSubject->Text(), sizeof(fileName)); - eofn = fileName + strlen(fileName); + uint32 originalLength = strlen(fileName); // convert /, \ and : to - for (char *bad = fileName; (bad = strchr(bad, '/')) != NULL; @@ -2564,12 +2564,19 @@ TMailWindow::SaveAsDraft() // Create the file; if the name exists, find a unique name flags = B_WRITE_ONLY | B_CREATE_FILE | B_FAIL_IF_EXISTS; - for (int32 i = 1; (status = draft.SetTo(&dir, fileName, flags)) - != B_OK; i++) { - if (status != B_FILE_EXISTS) - return status; - sprintf(eofn, "%ld", i); - } + int32 i = 1; + do { + status = draft.SetTo(&dir, fileName, flags); + if (status == B_OK) + break; + char appendix[B_FILE_NAME_LENGTH]; + sprintf(appendix, " %ld", i++); + int32 pos = min_c(sizeof(fileName) - strlen(appendix), + originalLength); + sprintf(fileName + pos, "%s", appendix); + } while (status == B_FILE_EXISTS); + if (status != B_OK) + return status; // Cache the ref if (fRef == NULL) From 4b84a0b5c8a8c87b2601a735d13cbf258a32fc92 Mon Sep 17 00:00:00 2001 From: Philippe Saint-Pierre Date: Wed, 12 Dec 2012 23:10:02 -0500 Subject: [PATCH 51/57] Mail: don't require a subject to save a draft (#9218) Also : * if the body of message changes, ask to save draft when closing window * disable save button when successfully saving draft --- src/apps/mail/MailWindow.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/apps/mail/MailWindow.cpp b/src/apps/mail/MailWindow.cpp index 5b0c6bcbc9..0537456fbc 100644 --- a/src/apps/mail/MailWindow.cpp +++ b/src/apps/mail/MailWindow.cpp @@ -1691,6 +1691,8 @@ TMailWindow::QuitRequested() || strlen(fHeaderView->fSubject->Text()) || (fHeaderView->fCc && strlen(fHeaderView->fCc->Text())) || (fHeaderView->fBcc && strlen(fHeaderView->fBcc->Text())) + || (fContentView->fTextView + && strlen(fContentView->fTextView->Text())) || (fEnclosuresView != NULL && fEnclosuresView->fList->CountItems()))) { if (fResending) { @@ -2550,8 +2552,13 @@ TMailWindow::SaveAsDraft() { char fileName[B_FILE_NAME_LENGTH]; // save as some version of the message's subject - strlcpy(fileName, fHeaderView->fSubject->Text(), - sizeof(fileName)); + if (strlen(fHeaderView->fSubject->Text()) == 0) + strlcpy(fileName, B_TRANSLATE("Untitled"), + sizeof(fileName)); + else + strlcpy(fileName, fHeaderView->fSubject->Text(), + sizeof(fileName)); + uint32 originalLength = strlen(fileName); // convert /, \ and : to - @@ -2648,6 +2655,8 @@ TMailWindow::SaveAsDraft() fDraft = true; fChanged = false; + fSaveButton->SetEnabled(false); + return B_OK; } From bafbb929015db8c950ae898e990d840c8236995f Mon Sep 17 00:00:00 2001 From: Tri-Edge AI Date: Thu, 13 Dec 2012 22:45:35 +0000 Subject: [PATCH 52/57] WebPositive: Smart URL handling improvements (GCI task) - Fixed: WebPositive now successfuly detects foreign protocols and launches their respective applications. - Improved: The decision whether to use a search engine or a DNS lookup for the text entered in the address bar, including for internationalized names (IDN) (though we do not handle them correctly later on yet). - TODO: escape the query string before passing it to webkit (for example for: "3+4") --- src/apps/webpositive/BrowserWindow.cpp | 96 +++++++++++++++++++++++--- src/apps/webpositive/BrowserWindow.h | 6 +- 2 files changed, 90 insertions(+), 12 deletions(-) diff --git a/src/apps/webpositive/BrowserWindow.cpp b/src/apps/webpositive/BrowserWindow.cpp index 3e4da40d18..616334e70d 100644 --- a/src/apps/webpositive/BrowserWindow.cpp +++ b/src/apps/webpositive/BrowserWindow.cpp @@ -652,11 +652,10 @@ BrowserWindow::MessageReceived(BMessage* message) BString url; if (message->FindString("url", &url) != B_OK) url = fURLInputGroup->Text(); + _SetPageIcon(CurrentWebView(), NULL); - BString newUrl = _SmartURLHandler(url); - if (newUrl != url) - fURLInputGroup->TextView()->SetText(newUrl); - CurrentWebView()->LoadURL(newUrl.String()); + _SmartURLHandler(url); + break; } case GO_BACK: @@ -2149,18 +2148,93 @@ BrowserWindow::_NewTabURL(bool isNewWindow) const } -BString -BrowserWindow::_SmartURLHandler(const BString& url) const +void +BrowserWindow::_VisitURL(const BString& url) { - BString result = url; + //fURLInputGroup->TextView()->SetText(url); + CurrentWebView()->LoadURL(url.String()); +} + +void +BrowserWindow::_VisitSearchEngine(const BString& search) +{ + // TODO: Google Code-In Task to make default search + // engine modifiable from Settings? :) + + BString engine = "http://www.google.com/search?q="; + engine += search; + // WebKit takes care of URL encoding here. + + _VisitURL(engine); +} + + +inline bool +BrowserWindow::_IsValidDomainChar(char ch) +{ + // TODO: Currenlty, only a whitespace character + // breaks a domain name. It might be + // a good idea (or a bad one) to make + // character filtering based on the + // IDNA 2008 standard. + + return ch != ' '; +} + + +void +BrowserWindow::_SmartURLHandler(const BString& url) +{ // Only process if this doesn't look like a full URL (http:// or // file://, etc.) - if (url.FindFirst("://") == B_ERROR) { - if (url.FindFirst(".") == B_ERROR || url.FindFirst(" ") != B_ERROR) - result.Prepend("http://www.google.com/search?q="); + + BString temp; + int32 at = url.FindFirst(":"); + + if (at != B_ERROR) { + BString proto; + url.CopyInto(proto, 0, at); + + if (proto == "http" || proto == "https" || proto == "file") + _VisitURL(url); + else { + temp = "application/x-vnd.Be.URL."; + temp += proto; + + char* argv[1] = { (char*)url.String() }; + + if (be_roster->Launch(temp.String(), 1, argv) != B_OK) + _VisitSearchEngine(url); + } + } else if (url == "localhost") + _VisitURL("http://localhost/"); + else { + const char* localhostPrefix = "localhost/"; + + if(url.Compare(localhostPrefix, strlen(localhostPrefix)) == 0) + _VisitURL(url); + else { + bool isURL = false; + + for (int32 i = 0; i < url.CountChars(); i++) { + if (url[i] == '.') + isURL = true; + else if (url[i] == '/') + break; + else if (!_IsValidDomainChar(url[i])) { + isURL = false; + + break; + } + } + + if (isURL) + _VisitURL(url); + else + _VisitSearchEngine(url); + } } - return result; } diff --git a/src/apps/webpositive/BrowserWindow.h b/src/apps/webpositive/BrowserWindow.h index 36605aaaeb..59a0982af4 100644 --- a/src/apps/webpositive/BrowserWindow.h +++ b/src/apps/webpositive/BrowserWindow.h @@ -190,7 +190,11 @@ private: void _InvokeButtonVisibly(BButton* button); BString _NewTabURL(bool isNewWindow) const; - BString _SmartURLHandler(const BString& url) const; + + void _VisitURL(const BString& url); + void _VisitSearchEngine(const BString& search); + inline bool _IsValidDomainChar(char ch); + void _SmartURLHandler(const BString& url); void _HandlePageSourceResult( const BMessage* message); From 8a24526e3fa84674a58568f204acafc08bffd219 Mon Sep 17 00:00:00 2001 From: Philippe Saint-Pierre Date: Thu, 13 Dec 2012 19:35:51 -0500 Subject: [PATCH 53/57] LaunchBox: remove redundant Locking. Thanks Stippi! --- src/apps/launchbox/MainWindow.cpp | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/apps/launchbox/MainWindow.cpp b/src/apps/launchbox/MainWindow.cpp index 690fd90717..18b931600b 100644 --- a/src/apps/launchbox/MainWindow.cpp +++ b/src/apps/launchbox/MainWindow.cpp @@ -91,20 +91,18 @@ MainWindow::QuitRequested() padWindowCount++; } bool canClose = true; - if (Lock()) { - if (padWindowCount == 1) { - be_app->PostMessage(B_QUIT_REQUESTED); + + if (padWindowCount == 1) { + be_app->PostMessage(B_QUIT_REQUESTED); + canClose = false; + } else { + BAlert* alert = new BAlert(B_TRANSLATE("last chance"), + B_TRANSLATE("Really close this pad?\n" + "(The pad will not be remembered.)"), + B_TRANSLATE("Close"), B_TRANSLATE("Cancel"), NULL); + alert->SetShortcut(1, B_ESCAPE); + if (alert->Go() == 1) canClose = false; - } else { - BAlert* alert = new BAlert(B_TRANSLATE("last chance"), - B_TRANSLATE("Really close this pad?\n" - "(The pad will not be remembered.)"), - B_TRANSLATE("Close"), B_TRANSLATE("Cancel"), NULL); - alert->SetShortcut(1, B_ESCAPE); - if (alert->Go() == 1) - canClose = false; - } - Unlock(); } return canClose; } From fbcad4e5e5bfe0b21a0a160ad342969a596e5b26 Mon Sep 17 00:00:00 2001 From: Alex Smith Date: Fri, 14 Dec 2012 17:20:03 +0000 Subject: [PATCH 54/57] Added some more x86_64 optional packages from scottmc. --- build/jam/OptionalPackages | 137 ++++++++++++++++++++++++------------- 1 file changed, 91 insertions(+), 46 deletions(-) diff --git a/build/jam/OptionalPackages b/build/jam/OptionalPackages index 2cd405b284..9950e588e2 100644 --- a/build/jam/OptionalPackages +++ b/build/jam/OptionalPackages @@ -124,36 +124,50 @@ if [ IsOptionalHaikuImagePackageAdded ABI-compliance-checker ] { # APR if [ IsOptionalHaikuImagePackageAdded APR ] { - if $(TARGET_ARCH) != x86 { - Echo "No optional package APR available for $(TARGET_ARCH)" ; - } else if $(HAIKU_GCC_VERSION[1]) >= 4 { + if $(TARGET_ARCH) = x86 { + if $(HAIKU_GCC_VERSION[1]) >= 4 { + InstallOptionalHaikuImagePackage + apr-1.4.6-r1a4-x86-gcc4-2012-08-30.zip + : $(baseURL)/apr-1.4.6-r1a4-x86-gcc4-2012-08-30.zip + : : true ; + } else { + InstallOptionalHaikuImagePackage + apr-1.4.6-r1a4-x86-gcc2-2012-08-27.zip + : $(baseURL)/apr-1.4.6-r1a4-x86-gcc2-2012-08-27.zip + : : true ; + } + } else if $(TARGET_ARCH) = x86_64 { InstallOptionalHaikuImagePackage - apr-1.4.6-r1a4-x86-gcc4-2012-08-30.zip - : $(baseURL)/apr-1.4.6-r1a4-x86-gcc4-2012-08-30.zip + apr-1.4.6-x86_64-2012-12-08.zip + : $(baseURL)/apr-1.4.6-x86_64-2012-12-08.zip : : true ; } else { - InstallOptionalHaikuImagePackage - apr-1.4.6-r1a4-x86-gcc2-2012-08-27.zip - : $(baseURL)/apr-1.4.6-r1a4-x86-gcc2-2012-08-27.zip - : : true ; + Echo "No optional package APR available for $(TARGET_ARCH)" ; } } # APR-util if [ IsOptionalHaikuImagePackageAdded APR-util ] { - if $(TARGET_ARCH) != x86 { - Echo "No optional package APR-util available for $(TARGET_ARCH)" ; - } else if $(HAIKU_GCC_VERSION[1]) >= 4 { + if $(TARGET_ARCH) = x86 { + if $(HAIKU_GCC_VERSION[1]) >= 4 { + InstallOptionalHaikuImagePackage + apr-util-1.4.1-r1a4-x86-gcc4-2012-08-30.zip + : $(baseURL)/apr-util-1.4.1-r1a4-x86-gcc4-2012-08-30.zip + : : true ; + } else { + InstallOptionalHaikuImagePackage + apr-util-1.4.1-r1a4-x86-gcc2-2012-08-27.zip + : $(baseURL)/apr-util-1.4.1-r1a4-x86-gcc2-2012-08-27.zip + : : true ; + } + } else if $(TARGET_ARCH) = x86_64 { InstallOptionalHaikuImagePackage - apr-util-1.4.1-r1a4-x86-gcc4-2012-08-30.zip - : $(baseURL)/apr-util-1.4.1-r1a4-x86-gcc4-2012-08-30.zip + apr-util-1.4.1-x86_64-2012-12-08.zip + : $(baseURL)/apr-util-1.4.1-x86_64-2012-12-08.zip : : true ; } else { - InstallOptionalHaikuImagePackage - apr-util-1.4.1-r1a4-x86-gcc2-2012-08-27.zip - : $(baseURL)/apr-util-1.4.1-r1a4-x86-gcc2-2012-08-27.zip - : : true ; + Echo "No optional package APR-util available for $(TARGET_ARCH)" ; } } @@ -410,16 +424,22 @@ if [ IsOptionalHaikuImagePackageAdded Caya ] { # CCache if [ IsOptionalHaikuImagePackageAdded CCache ] { - if $(TARGET_ARCH) != x86 { - Echo "No optional package CCache available for $(TARGET_ARCH)" ; - } else if $(HAIKU_GCC_VERSION[1]) >= 4 { + if $(TARGET_ARCH) = x86 { + if $(HAIKU_GCC_VERSION[1]) >= 4 { + InstallOptionalHaikuImagePackage + ccache-3.0.1-r1a4-x86-gcc4-2012-08-30.zip + : $(baseURL)/ccache-3.0.1-r1a4-x86-gcc4-2012-08-30.zip ; + } else { + InstallOptionalHaikuImagePackage + ccache-3.0.1-r1a4-x86-gcc2-2012-08-27.zip + : $(baseURL)/ccache-3.0.1-r1a4-x86-gcc2-2012-08-27.zip ; + } + } else if $(TARGET_ARCH) = x86_64 { InstallOptionalHaikuImagePackage - ccache-3.0.1-r1a4-x86-gcc4-2012-08-30.zip - : $(baseURL)/ccache-3.0.1-r1a4-x86-gcc4-2012-08-30.zip ; + ccache-3.0.1-x86_64-2012-12-08.zip + : $(baseURL)/ccache-3.0.1-x86_64-2012-12-08.zip ; } else { - InstallOptionalHaikuImagePackage - ccache-3.0.1-r1a4-x86-gcc2-2012-08-27.zip - : $(baseURL)/ccache-3.0.1-r1a4-x86-gcc2-2012-08-27.zip ; + Echo "No optional package CCache available for $(TARGET_ARCH)" ; } } @@ -1026,16 +1046,22 @@ if [ IsOptionalHaikuImagePackageAdded Expat ] { # Fastdep if [ IsOptionalHaikuImagePackageAdded Fastdep ] { - if $(TARGET_ARCH) != x86 { - Echo "No optional package Fastdep available for $(TARGET_ARCH)" ; - } else if $(HAIKU_GCC_VERSION[1]) >= 4 { + if $(TARGET_ARCH) = x86 { + if $(HAIKU_GCC_VERSION[1]) >= 4 { + InstallOptionalHaikuImagePackage + fastdep-0.16-r1a4-x86-gcc4-2012-08-30.zip + : $(baseURL)/fastdep-0.16-r1a4-x86-gcc4-2012-08-30.zip ; + } else { + InstallOptionalHaikuImagePackage + fastdep-0.16-r1a4-x86-gcc2-2012-08-28.zip + : $(baseURL)/fastdep-0.16-r1a4-x86-gcc2-2012-08-28.zip ; + } + } else if $(TARGET_ARCH) = x86_64 { InstallOptionalHaikuImagePackage - fastdep-0.16-r1a4-x86-gcc4-2012-08-30.zip - : $(baseURL)/fastdep-0.16-r1a4-x86-gcc4-2012-08-30.zip ; + fastdep-0.16-x86_64-2012-12-08.zip + : $(baseURL)/fastdep-0.16-x86_64-2012-12-08.zip ; } else { - InstallOptionalHaikuImagePackage - fastdep-0.16-r1a4-x86-gcc2-2012-08-28.zip - : $(baseURL)/fastdep-0.16-r1a4-x86-gcc2-2012-08-28.zip ; + Echo "No optional package Fastdep available for $(TARGET_ARCH)" ; } } @@ -1127,9 +1153,7 @@ if [ IsOptionalHaikuImagePackageAdded GitDoc ] { # GPerf if [ IsOptionalHaikuImagePackageAdded GPerf ] { - if $(TARGET_ARCH) != x86 { - Echo "No optional package GPerf available for $(TARGET_ARCH)" ; - } else { + if $(TARGET_ARCH) = x86 { if $(HAIKU_GCC_VERSION[1]) >= 4 { InstallOptionalHaikuImagePackage gperf-3.0.4-r1a4-x86-gcc4-2012-08-30.zip @@ -1141,15 +1165,20 @@ if [ IsOptionalHaikuImagePackageAdded GPerf ] { : $(baseURL)/gperf-3.0.4-r1a4-x86-gcc2-2012-08-28.zip : : true ; } + } else if $(TARGET_ARCH) = x86_64 { + InstallOptionalHaikuImagePackage + gperf-3.0.4-x86_64-2012-12-08.zip + : $(baseURL)/gperf-3.0.4-x86_64-2012-12-08.zip + : : true ; + } else { + Echo "No optional package GPerf available for $(TARGET_ARCH)" ; } } # Groff if [ IsOptionalHaikuImagePackageAdded Groff ] { - if $(TARGET_ARCH) != x86 { - Echo "No optional package Groff available for $(TARGET_ARCH)" ; - } else { + if $(TARGET_ARCH) = x86 { if $(HAIKU_GCC_VERSION[1]) >= 4 { InstallOptionalHaikuImagePackage groff-1.20.1-r1a4-x86-gcc4-2012-08-30.zip @@ -1161,6 +1190,13 @@ if [ IsOptionalHaikuImagePackageAdded Groff ] { : $(baseURL)/groff-1.20.1-r1a4-x86-gcc2-2012-08-28.zip : : true ; } + } else if $(TARGET_ARCH) = x86_64 { + InstallOptionalHaikuImagePackage + groff-1.20.1-x86_64-2012-12-08.zip + : $(baseURL)/groff-1.20.1-x86_64-2012-12-08.zip + : : true ; + } else { + Echo "No optional package Groff available for $(TARGET_ARCH)" ; } } @@ -1276,9 +1312,7 @@ if [ IsOptionalHaikuImagePackageAdded LGrep ] { # LibEvent if [ IsOptionalHaikuImagePackageAdded LibEvent ] { - if $(TARGET_ARCH) != x86 { - Echo "No optional package LibEvent available for $(TARGET_ARCH)" ; - } else { + if $(TARGET_ARCH) = x86 { if $(HAIKU_GCC_VERSION[1]) >= 4 { InstallOptionalHaikuImagePackage libevent-2.0.10-r1a4-x86-gcc4-2012-08-30.zip @@ -1290,6 +1324,13 @@ if [ IsOptionalHaikuImagePackageAdded LibEvent ] { : $(baseURL)/libevent-2.0.10-r1a4-x86-gcc2-2012-08-28.zip : : true ; } + } else if $(TARGET_ARCH) = x86_64 { + InstallOptionalHaikuImagePackage + libevent-2.0.10-x86_64-2012-12-08.zip + : $(baseURL)/libevent-2.0.10-x86_64-2012-12-08.zip + : : true ; + } else { + Echo "No optional package LibEvent available for $(TARGET_ARCH)" ; } } @@ -1852,9 +1893,7 @@ if [ IsOptionalHaikuImagePackageAdded Sed ] { # SQLite if [ IsOptionalHaikuImagePackageAdded SQLite ] { - if $(TARGET_ARCH) != x86 { - Echo "No optional package SQLite available for $(TARGET_ARCH)" ; - } else { + if $(TARGET_ARCH) = x86 { if $(HAIKU_GCC_VERSION[1]) >= 4 { InstallOptionalHaikuImagePackage sqlite-3.7.13-r1a4-x86-gcc4-2012-08-30.zip @@ -1864,6 +1903,12 @@ if [ IsOptionalHaikuImagePackageAdded SQLite ] { sqlite-3.7.13-r1a4-x86-gcc2-2012-08-27.zip : $(baseURL)/sqlite-3.7.13-r1a4-x86-gcc2-2012-08-27.zip ; } + } else if $(TARGET_ARCH) = x86_64 { + InstallOptionalHaikuImagePackage + sqlite-3.7.13-x86_64-2012-12-08.zip + : $(baseURL)/sqlite-3.7.13-x86_64-2012-12-08.zip ; + } else { + Echo "No optional package SQLite available for $(TARGET_ARCH)" ; } } From 9e265b3329b9bcf0b3fcaacdef03125a2699bc2f Mon Sep 17 00:00:00 2001 From: Janus Date: Fri, 14 Dec 2012 20:46:19 +0100 Subject: [PATCH 55/57] Fixes #7639 - the redraw issue in ColumListView. Signed-off-by: Siarzhuk Zharski --- src/kits/interface/ColumnListView.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kits/interface/ColumnListView.cpp b/src/kits/interface/ColumnListView.cpp index 09168c7fc3..91bf16a430 100644 --- a/src/kits/interface/ColumnListView.cpp +++ b/src/kits/interface/ColumnListView.cpp @@ -3259,7 +3259,7 @@ OutlineView::Draw(BRect invalidBounds) tintedLine = !tintedLine; float rowHeight = row->Height(); - if (line > invalidBounds.top - rowHeight) { + if (line >= invalidBounds.top - rowHeight) { bool isFirstColumn = true; float fieldLeftEdge = MAX(kLeftMargin, fMasterView->LatchWidth()); From 6084a1e1a4df74cf4a915fb0a14e2ca63ee80f6a Mon Sep 17 00:00:00 2001 From: John Scipione Date: Fri, 14 Dec 2012 19:28:05 -0500 Subject: [PATCH 56/57] Update the about window of WebPositive. Also update the version number to 1.1-alpha in the rdef file matching the text on the old about window. --- src/apps/webpositive/BrowserApp.cpp | 48 +++++++++++++++++++-------- src/apps/webpositive/BrowserApp.h | 4 +++ src/apps/webpositive/Jamfile | 5 +-- src/apps/webpositive/WebPositive.rdef | 8 ++--- 4 files changed, 46 insertions(+), 19 deletions(-) diff --git a/src/apps/webpositive/BrowserApp.cpp b/src/apps/webpositive/BrowserApp.cpp index 02616b8bba..e4a0627776 100644 --- a/src/apps/webpositive/BrowserApp.cpp +++ b/src/apps/webpositive/BrowserApp.cpp @@ -28,6 +28,7 @@ #include "BrowserApp.h" +#include #include #include #include @@ -75,7 +76,8 @@ BrowserApp::BrowserApp() fCookies(NULL), fCookieJar(NULL), fDownloadWindow(NULL), - fSettingsWindow(NULL) + fSettingsWindow(NULL), + fAboutWindow(NULL) { } @@ -86,25 +88,45 @@ BrowserApp::~BrowserApp() delete fSettings; delete fCookies; delete fCookieJar; + + if (fAboutWindow != NULL) + fAboutWindow->Quit(); } void BrowserApp::AboutRequested() { - BString aboutText("WebPositive\n\nby Ryan Leavengood, Andrea Anzani, " - "Maxime Simon, Michael Lotz, Rene Gollent, Stephan Aßmus and " - "Alexandre Deckner"); - aboutText << "\n\nWebPositive 1.1"; - aboutText << "\n\nHaikuWebKit " << WebKitInfo::HaikuWebKitVersion(); - aboutText << " (" << WebKitInfo::HaikuWebKitRevision() << ")"; - aboutText << "\nWebKit " << WebKitInfo::WebKitVersion(); - aboutText << " (" << WebKitInfo::WebKitRevision() << ")"; + if (fAboutWindow == NULL) { + // create the about window - BAlert* alert = new BAlert("About WebPositive", aboutText.String(), - "Sweet!"); - alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE); - alert->Go(NULL); + const char* authors[] = { + "Andrea Anzani", + "Stephan Aßmus", + "Alexandre Deckner", + "Rene Gollent", + "Ryan Leavengood", + "Michael Lotz", + "Maxime Simon", + NULL + }; + + BString aboutText(""); + aboutText << "HaikuWebKit " << WebKitInfo::HaikuWebKitVersion(); + aboutText << " (" << WebKitInfo::HaikuWebKitRevision() << ")"; + aboutText << "\nWebKit " << WebKitInfo::WebKitVersion(); + aboutText << " (" << WebKitInfo::WebKitRevision() << ")"; + + fAboutWindow = new BAboutWindow(kApplicationName, + kApplicationSignature); + fAboutWindow->AddCopyright(2007, "Haiku, Inc."); + fAboutWindow->AddAuthors(authors); + fAboutWindow->AddExtraInfo(aboutText.String()); + fAboutWindow->Show(); + } else if (fAboutWindow->IsHidden()) + fAboutWindow->Show(); + else + fAboutWindow->Activate(); } diff --git a/src/apps/webpositive/BrowserApp.h b/src/apps/webpositive/BrowserApp.h index 05885583f6..19e4860969 100644 --- a/src/apps/webpositive/BrowserApp.h +++ b/src/apps/webpositive/BrowserApp.h @@ -33,6 +33,8 @@ #include #include + +class BAboutWindow; class BNetworkCookieJar; class DownloadWindow; class BrowserWindow; @@ -77,6 +79,8 @@ private: DownloadWindow* fDownloadWindow; SettingsWindow* fSettingsWindow; + + BAboutWindow* fAboutWindow; }; diff --git a/src/apps/webpositive/Jamfile b/src/apps/webpositive/Jamfile index bba0c66f86..df45942fea 100644 --- a/src/apps/webpositive/Jamfile +++ b/src/apps/webpositive/Jamfile @@ -50,7 +50,6 @@ local sources = URLInputGroup.cpp ; - Includes [ FGristFiles $(sources) ] : $(HAIKU_WEBKIT_HEADERS_DEPENDENCY) ; # Dependency needed to trigger downloading/unzipping the package before # compiling the files. @@ -60,12 +59,14 @@ Includes [ FGristFiles $(sources) ] : $(HAIKU_WEBKIT_HEADERS_DEPENDENCY) ; #MakeLocate $(svnRevisionFile) : $(LOCATE_TARGET) ; #CreateSVNRevisionFile $(svnRevisionFile) ; +UsePrivateHeaders shared ; + Application WebPositive : $(sources) : $(HAIKU_WEBKIT_LIBS) $(TARGET_LIBSTDC++) $(HAIKU_LOCALE_LIBS) - be network tracker translation + be libshared.a network tracker translation : WebPositive.rdef ; diff --git a/src/apps/webpositive/WebPositive.rdef b/src/apps/webpositive/WebPositive.rdef index 9b475b34d1..15d1b92913 100644 --- a/src/apps/webpositive/WebPositive.rdef +++ b/src/apps/webpositive/WebPositive.rdef @@ -1,13 +1,13 @@ resource app_signature "application/x-vnd.Haiku-WebPositive"; resource app_version { - major = 0, - middle = 0, - minor = 1, + major = 1, + middle = 1, + minor = 0, variety = B_APPV_ALPHA, internal = 0, short_info = "WebPositive", - long_info = "WebPositive ©2007-2010 The WebKit Haiku Project" + long_info = "WebPositive ©2007-2012 The WebKit Haiku Project" }; resource app_flags B_SINGLE_LAUNCH; From 69eca701553dee17683df2e8a0440d61da4d0fc4 Mon Sep 17 00:00:00 2001 From: Tri-Edge AI Date: Fri, 14 Dec 2012 20:09:23 +0200 Subject: [PATCH 57/57] WebPositive: Search engine string now gets encoded. --- src/apps/webpositive/BrowserWindow.cpp | 25 +++++++++++++++++++++++-- src/apps/webpositive/BrowserWindow.h | 1 + 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/apps/webpositive/BrowserWindow.cpp b/src/apps/webpositive/BrowserWindow.cpp index 616334e70d..9f5e3e7e5e 100644 --- a/src/apps/webpositive/BrowserWindow.cpp +++ b/src/apps/webpositive/BrowserWindow.cpp @@ -2147,6 +2147,25 @@ BrowserWindow::_NewTabURL(bool isNewWindow) const return url; } +BString +BrowserWindow::_EncodeURIComponent(const BString& search) +{ + const BString escCharList = " $&`:<>[]{}\"+#%@/;=?\\^|~\',"; + BString result = search; + char hexcode[4]; + + for (int32 i = 0; i < result.Length(); i++) { + if (escCharList.FindFirst(result[i]) != B_ERROR) { + sprintf(hexcode, "%02X", (unsigned int)result[i]); + result[i] = '%'; + result.Insert(hexcode, i + 1); + i += 2; + } + } + + return result; +} + void BrowserWindow::_VisitURL(const BString& url) @@ -2163,8 +2182,10 @@ BrowserWindow::_VisitSearchEngine(const BString& search) // engine modifiable from Settings? :) BString engine = "http://www.google.com/search?q="; - engine += search; - // WebKit takes care of URL encoding here. + engine += _EncodeURIComponent(search); + // We have to take care of some of the escaping before + // we hand over the string to WebKit, if we want queries + // like "4+3" to not be searched as "4 3". _VisitURL(engine); } diff --git a/src/apps/webpositive/BrowserWindow.h b/src/apps/webpositive/BrowserWindow.h index 59a0982af4..bf80d75396 100644 --- a/src/apps/webpositive/BrowserWindow.h +++ b/src/apps/webpositive/BrowserWindow.h @@ -191,6 +191,7 @@ private: BString _NewTabURL(bool isNewWindow) const; + BString _EncodeURIComponent(const BString& search); void _VisitURL(const BString& url); void _VisitSearchEngine(const BString& search); inline bool _IsValidDomainChar(char ch);