From axeld at pinc-software.de Sat Mar 1 00:05:07 2008 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Sat, 01 Mar 2008 00:05:07 +0100 CET Subject: [Haiku-commits] r24143 - haiku/trunk/src/servers/app In-Reply-To: <20080229162824.M8028@mlotz.ch> Message-ID: <51790263594-BeMail@zon> "Michael Lotz" wrote: > On Fri, 29 Feb 2008 16:45:44 +0100 CET, Axel D?rfler wrote > > Alexandre Deckner wrote: > > > Strangely, as i noticed last week, this font (and only this one) > > > renders in gray in the Keymap preflet! Any idea? > > Are you eventually rendering at some sub-pixel position? At least > > that may affect the rendering AFAICT. > Probably the "extra condensed" version of the font is used. I saw > that the > text is also "gray" in StyledEdit with this font. Do we really need > all those > variations is the other question... Good catch! At least we needed it to find a bug in our font engine that apparently chooses the wrong font here ;-) Bye, Axel. From revol at free.fr Sat Mar 1 00:34:57 2008 From: revol at free.fr (=?windows-1252?q?Fran=E7ois?= Revol) Date: Sat, 01 Mar 2008 00:34:57 +0100 CET Subject: [Haiku-commits] =?windows-1252?q?r24179_-_in_haiku/trunk=3A_heade?= =?windows-1252?q?rs/build_src/build/libhaikucompat?= In-Reply-To: <200802291502.m1TF2D7Z032050@sheep.berlios.de> Message-ID: <10458560227-BeMail@laptop> > Author: axeld > Date: 2008-02-29 16:02:12 +0100 (Fri, 29 Feb 2008) > New Revision: 24179 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24179&view=rev > > Modified: > haiku/trunk/headers/build/HaikuBuildCompatibility.h > haiku/trunk/src/build/libhaikucompat/Jamfile > Log: > Hopefully final build fix for Dano; at least I build everything with > "-a" this > time and it worked :-) $ jam AboutSystem ...patience... ...patience... ...patience... ...patience... ...patience... ...found 5787 target(s)... ...updating 115 target(s)... C++ generated/objects/haiku/x86/release/apps/aboutsystem/AboutSystem.o C++ generated/objects/dano/x86/release/build/libhaikucompat/ AppFileInfo.o In file included from /work/haiku/trunk/headers/build/ HaikuBuildCompatibility.h:26, from /work/haiku/trunk/src/build/libbe/storage/ AppFileInfo.cpp:1: /work/haiku/trunk/headers/build/os/support/SupportDefs.h:125: syntax error before `atomic_set' /work/haiku/trunk/headers/build/os/support/SupportDefs.h:126: syntax error before `atomic_test_and_set' /work/haiku/trunk/headers/build/os/support/SupportDefs.h:127: syntax error before `atomic_add' it seems to fail at _IMPEXP_ROOT... Fran?ois. From axeld at mail.berlios.de Sat Mar 1 00:43:19 2008 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Sat, 1 Mar 2008 00:43:19 +0100 Subject: [Haiku-commits] r24184 - haiku/trunk/headers/build/os/support Message-ID: <200802292343.m1TNhJtj027421@sheep.berlios.de> Author: axeld Date: 2008-03-01 00:43:18 +0100 (Sat, 01 Mar 2008) New Revision: 24184 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24184&view=rev Modified: haiku/trunk/headers/build/os/support/SupportDefs.h Log: Updated our build SupportDefs.h to the same version as the current standard version. This gets rid of the _IMPEXP* definitions so it should not cause any trouble. Modified: haiku/trunk/headers/build/os/support/SupportDefs.h =================================================================== --- haiku/trunk/headers/build/os/support/SupportDefs.h 2008-02-29 19:09:59 UTC (rev 24183) +++ haiku/trunk/headers/build/os/support/SupportDefs.h 2008-02-29 23:43:18 UTC (rev 24184) @@ -1,49 +1,28 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2004-2005, Haiku -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the "Software"), -// to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. -// -// File Name: SupportDefs.h -// Author: Erik Jaesler (erik at cgsoftware.com) -// Description: Common type definitions. -//------------------------------------------------------------------------------ - +/* + * Copyright 2004-2007, Haiku, Inc. All Rights Reserved. + * Distributed under the terms of the MIT License. + * + * Author: + * Erik Jaesler (erik at cgsoftware.com) + */ #ifndef _SUPPORT_DEFS_H #define _SUPPORT_DEFS_H -/* this !must! be located before the include of sys/types.h */ + +/* this must be located before the include of sys/types.h */ #if !defined(_SYS_TYPES_H) && !defined(_SYS_TYPES_H_) typedef unsigned long ulong; typedef unsigned int uint; typedef unsigned short ushort; #endif - -// Standard Includes ----------------------------------------------------------- - -// System Includes ------------------------------------------------------------- #include -#include #include -// Shorthand type formats ------------------------------------------------------ +#include + +// Shorthand type formats typedef signed char int8; typedef unsigned char uint8; typedef volatile signed char vint8; @@ -59,9 +38,9 @@ typedef volatile long vint32; typedef volatile unsigned long vuint32; -typedef long long int64; -typedef unsigned long long uint64; -typedef volatile long long vint64; +typedef long long int64; +typedef unsigned long long uint64; +typedef volatile long long vint64; typedef volatile unsigned long long vuint64; typedef volatile long vlong; @@ -78,24 +57,20 @@ typedef unsigned short unichar; -// Descriptive formats --------------------------------------------------------- +// Descriptive formats typedef int32 status_t; typedef int64 bigtime_t; typedef uint32 type_code; typedef uint32 perform_code; -// Empty string ("") ----------------------------------------------------------- +// Empty string ("") #ifdef __cplusplus -extern _IMPEXP_BE const char *B_EMPTY_STRING; +extern const char *B_EMPTY_STRING; #endif -// min and max comparisons ----------------------------------------------------- -// min() and max() won't work in C++ -#define min_c(a,b) ((a)>(b)?(b):(a)) -#define max_c(a,b) ((a)>(b)?(a):(b)) - +// min and max comparisons #ifndef __cplusplus # ifndef min # define min(a,b) ((a)>(b)?(b):(a)) @@ -105,8 +80,12 @@ # endif #endif +// min() and max() won't work in C++ +#define min_c(a,b) ((a)>(b)?(b):(a)) +#define max_c(a,b) ((a)>(b)?(a):(b)) -// Grandfathering -------------------------------------------------------------- + +// Grandfathering #ifndef __cplusplus # include #endif @@ -116,34 +95,33 @@ #endif -//------------------------------------------------------------------------------ #ifdef __cplusplus extern "C" { #endif -//----- Atomic functions; old value is returned -------------------------------- -extern _IMPEXP_ROOT int32 atomic_set(vint32 *value, int32 newValue); -extern _IMPEXP_ROOT int32 atomic_test_and_set(vint32 *value, int32 newValue, int32 testAgainst); -extern _IMPEXP_ROOT int32 atomic_add(vint32 *value, int32 addValue); -extern _IMPEXP_ROOT int32 atomic_and(vint32 *value, int32 andValue); -extern _IMPEXP_ROOT int32 atomic_or(vint32 *value, int32 orValue); -extern _IMPEXP_ROOT int32 atomic_get(vint32 *value); +// Atomic functions; previous value is returned +extern int32 atomic_set(vint32 *value, int32 newValue); +extern int32 atomic_test_and_set(vint32 *value, int32 newValue, int32 testAgainst); +extern int32 atomic_add(vint32 *value, int32 addValue); +extern int32 atomic_and(vint32 *value, int32 andValue); +extern int32 atomic_or(vint32 *value, int32 orValue); +extern int32 atomic_get(vint32 *value); -extern _IMPEXP_ROOT int64 atomic_set64(vint64 *value, int64 newValue); -extern _IMPEXP_ROOT int64 atomic_test_and_set64(vint64 *value, int64 newValue, int64 testAgainst); -extern _IMPEXP_ROOT int64 atomic_add64(vint64 *value, int64 addValue); -extern _IMPEXP_ROOT int64 atomic_and64(vint64 *value, int64 andValue); -extern _IMPEXP_ROOT int64 atomic_or64(vint64 *value, int64 orValue); -extern _IMPEXP_ROOT int64 atomic_get64(vint64 *value); +extern int64 atomic_set64(vint64 *value, int64 newValue); +extern int64 atomic_test_and_set64(vint64 *value, int64 newValue, int64 testAgainst); +extern int64 atomic_add64(vint64 *value, int64 addValue); +extern int64 atomic_and64(vint64 *value, int64 andValue); +extern int64 atomic_or64(vint64 *value, int64 orValue); +extern int64 atomic_get64(vint64 *value); -// Other stuff ----------------------------------------------------------------- -extern _IMPEXP_ROOT void * get_stack_frame(void); +// Other stuff +extern void* get_stack_frame(void); #ifdef __cplusplus } #endif -//-------- Obsolete or discouraged API ----------------------------------------- +// Obsolete or discouraged API // use 'true' and 'false' #ifndef FALSE From axeld at pinc-software.de Sat Mar 1 00:43:56 2008 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Sat, 01 Mar 2008 00:43:56 +0100 CET Subject: [Haiku-commits] r24179 - in haiku/trunk: headers/build src/build/libhaikucompat In-Reply-To: <10458560227-BeMail@laptop> Message-ID: <54119194411-BeMail@zon> "Fran?ois Revol" wrote: > > Hopefully final build fix for Dano; at least I build everything > > with > > "-a" this > > time and it worked :-) > $ jam AboutSystem [...] > HaikuBuildCompatibility.h:26, > from /work/haiku/trunk/src/build/libbe/storage/ > AppFileInfo.cpp:1: > /work/haiku/trunk/headers/build/os/support/SupportDefs.h:125: syntax > error before `atomic_set' > /work/haiku/trunk/headers/build/os/support/SupportDefs.h:126: syntax > error before `atomic_test_and_set' > /work/haiku/trunk/headers/build/os/support/SupportDefs.h:127: syntax > error before `atomic_add' > > it seems to fail at _IMPEXP_ROOT... Since it builds fine over here, I guess I must have some local modifications in my Dano headers (which is very well possible). Anyway, please try r24184. If that doesn't help, someone else has to fix it, I'm afraid. Bye, Axel. From revol at free.fr Sat Mar 1 00:49:55 2008 From: revol at free.fr (=?windows-1252?q?Fran=E7ois?= Revol) Date: Sat, 01 Mar 2008 00:49:55 +0100 CET Subject: [Haiku-commits] r24184 - haiku/trunk/headers/build/os/support In-Reply-To: <200802292343.m1TNhJtj027421@sheep.berlios.de> Message-ID: <11356862685-BeMail@laptop> > Author: axeld > Date: 2008-03-01 00:43:18 +0100 (Sat, 01 Mar 2008) > New Revision: 24184 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24184&view=rev > > Modified: > haiku/trunk/headers/build/os/support/SupportDefs.h > Log: > Updated our build SupportDefs.h to the same version as the current > standard > version. This gets rid of the _IMPEXP* definitions so it should not > cause > any trouble. Thanks, seems to work now. Fran?ois. From anevilyak at mail.berlios.de Sat Mar 1 01:57:19 2008 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Sat, 1 Mar 2008 01:57:19 +0100 Subject: [Haiku-commits] r24185 - in haiku/trunk: headers/os/interface src/preferences/appearance Message-ID: <200803010057.m210vJ9K001961@sheep.berlios.de> Author: anevilyak Date: 2008-03-01 01:57:18 +0100 (Sat, 01 Mar 2008) New Revision: 24185 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24185&view=rev Modified: haiku/trunk/headers/os/interface/GraphicsDefs.h haiku/trunk/src/preferences/appearance/APRView.cpp haiku/trunk/src/preferences/appearance/APRView.h haiku/trunk/src/preferences/appearance/ColorSet.cpp haiku/trunk/src/preferences/appearance/ColorSet.h haiku/trunk/src/preferences/appearance/ColorWhichItem.cpp haiku/trunk/src/preferences/appearance/ColorWhichItem.h Log: - Added operator = implementation to rgb_color for convenience. - Major cleanup of Appearance prefs - colors are now dynamically read from the app_server, and updating them also works, but triggers a bug: the state of the current window somehow gets confused, i.e. if I update the panel background color, for some reason the color of the BButtons in the appearance pref change color and also the textviews begin misbehaving. Have not yet tracked down the cause of this, but newly created windows after making the change do show up with the updated color and behave properly. Also vastly simplified the pref and cleaned up some obsolete definitions. Modified: haiku/trunk/headers/os/interface/GraphicsDefs.h =================================================================== --- haiku/trunk/headers/os/interface/GraphicsDefs.h 2008-02-29 23:43:18 UTC (rev 24184) +++ haiku/trunk/headers/os/interface/GraphicsDefs.h 2008-03-01 00:57:18 UTC (rev 24185) @@ -101,6 +101,12 @@ { return *(const uint32 *)this != *(const uint32 *)&other; } + + inline rgb_color& + operator=(const rgb_color& other) + { + return set_to(other.red, other.green, other.blue, other.alpha); + } #endif } rgb_color; Modified: haiku/trunk/src/preferences/appearance/APRView.cpp =================================================================== --- haiku/trunk/src/preferences/appearance/APRView.cpp 2008-02-29 23:43:18 UTC (rev 24184) +++ haiku/trunk/src/preferences/appearance/APRView.cpp 2008-03-01 00:57:18 UTC (rev 24185) @@ -1,9 +1,10 @@ /* - * Copyright 2002-2006, Haiku. All rights reserved. + * Copyright 2002-2008, Haiku. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: * DarkWyrm (darkwyrm at earthlink.net) + * Rene Gollent (rene at gollent.com) */ #include #include @@ -33,6 +34,36 @@ #define COLOR_DROPPED 'cldp' #define DECORATOR_CHANGED 'dcch' +int32 sColorConsts[] = { + B_PANEL_BACKGROUND_COLOR, + B_PANEL_TEXT_COLOR, + B_DOCUMENT_BACKGROUND_COLOR, + B_DOCUMENT_TEXT_COLOR, + B_CONTROL_BACKGROUND_COLOR, + B_CONTROL_TEXT_COLOR, + B_CONTROL_BORDER_COLOR, + B_CONTROL_HIGHLIGHT_COLOR, + B_NAVIGATION_BASE_COLOR, + B_NAVIGATION_PULSE_COLOR, + B_SHINE_COLOR, + B_SHADOW_COLOR, + B_MENU_BACKGROUND_COLOR, + B_MENU_SELECTED_BACKGROUND_COLOR, + B_MENU_ITEM_TEXT_COLOR, + B_MENU_SELECTED_ITEM_TEXT_COLOR, + B_MENU_SELECTED_BORDER_COLOR, + B_TOOLTIP_BACKGROUND_COLOR, + B_TOOLTIP_TEXT_COLOR, + B_SUCCESS_COLOR, + B_FAILURE_COLOR, + B_WINDOW_TAB_COLOR, + B_WINDOW_TEXT_COLOR, + B_WINDOW_INACTIVE_TAB_COLOR, + B_WINDOW_INACTIVE_TEXT_COLOR, +}; + +const uint32 sColorCount = sizeof(sColorConsts) / sizeof(int32); + namespace BPrivate { int32 count_decorators(void); @@ -99,32 +130,12 @@ fAttrList->SetSelectionMessage(new BMessage(ATTRIBUTE_CHOSEN)); - fAttrList->AddItem(new ColorWhichItem(B_PANEL_BACKGROUND_COLOR)); - fAttrList->AddItem(new ColorWhichItem((color_which)B_PANEL_TEXT_COLOR)); - fAttrList->AddItem(new ColorWhichItem((color_which)B_DOCUMENT_BACKGROUND_COLOR)); - fAttrList->AddItem(new ColorWhichItem((color_which)B_DOCUMENT_TEXT_COLOR)); - fAttrList->AddItem(new ColorWhichItem((color_which)B_CONTROL_BACKGROUND_COLOR)); - fAttrList->AddItem(new ColorWhichItem((color_which)B_CONTROL_TEXT_COLOR)); - fAttrList->AddItem(new ColorWhichItem((color_which)B_CONTROL_BORDER_COLOR)); - fAttrList->AddItem(new ColorWhichItem((color_which)B_CONTROL_HIGHLIGHT_COLOR)); - fAttrList->AddItem(new ColorWhichItem((color_which)B_NAVIGATION_BASE_COLOR)); - fAttrList->AddItem(new ColorWhichItem((color_which)B_NAVIGATION_PULSE_COLOR)); - fAttrList->AddItem(new ColorWhichItem((color_which)B_SHINE_COLOR)); - fAttrList->AddItem(new ColorWhichItem((color_which)B_SHADOW_COLOR)); - fAttrList->AddItem(new ColorWhichItem(B_MENU_BACKGROUND_COLOR)); - fAttrList->AddItem(new ColorWhichItem((color_which)B_MENU_SELECTED_BACKGROUND_COLOR)); - fAttrList->AddItem(new ColorWhichItem(B_MENU_ITEM_TEXT_COLOR)); - fAttrList->AddItem(new ColorWhichItem(B_MENU_SELECTED_ITEM_TEXT_COLOR)); - fAttrList->AddItem(new ColorWhichItem((color_which)B_MENU_SELECTED_BORDER_COLOR)); - fAttrList->AddItem(new ColorWhichItem((color_which)B_TOOLTIP_BACKGROUND_COLOR)); - - fAttrList->AddItem(new ColorWhichItem((color_which)B_SUCCESS_COLOR)); - fAttrList->AddItem(new ColorWhichItem((color_which)B_FAILURE_COLOR)); - fAttrList->AddItem(new ColorWhichItem(B_WINDOW_TAB_COLOR)); - fAttrList->AddItem(new ColorWhichItem((color_which)B_WINDOW_TAB_TEXT_COLOR)); - fAttrList->AddItem(new ColorWhichItem((color_which)B_INACTIVE_WINDOW_TAB_COLOR)); - fAttrList->AddItem(new ColorWhichItem((color_which)B_INACTIVE_WINDOW_TAB_TEXT_COLOR)); + printf("Color count: %lu\n", sColorCount); + for (uint32 i = 0; i < sColorCount; i++) { + printf("Adding color item for which: %ld\n", sColorConsts[i]); + fAttrList->AddItem(new ColorWhichItem((color_which)sColorConsts[i])); + } BRect wellrect(0,0,50,50); wellrect.OffsetTo(rect.right + 30, rect.top + @@ -201,6 +212,7 @@ fPicker->SetValue(*col); fColorWell->SetColor(*col); fColorWell->Invalidate(); + UpdateCurrentColor(); } } @@ -220,10 +232,11 @@ fColorWell->SetColor(col); fColorWell->Invalidate(); - + // Update current fAttribute in the settings - fCurrentSet.SetColor(fAttrString.String(),col); - + fCurrentSet.SetColor(fAttribute, col); + UpdateCurrentColor(); + fDefaults->SetEnabled(fCurrentSet.IsDefaultable()); fRevert->SetEnabled(true); @@ -240,23 +253,26 @@ fAttrString=whichitem->Text(); UpdateControlsFromAttr(whichitem->Text()); - + fDefaults->SetEnabled(fCurrentSet.IsDefaultable()); break; } case REVERT_SETTINGS: { fCurrentSet=fPrevSet; UpdateControlsFromAttr(fAttrString.String()); + UpdateAllColors(); fRevert->SetEnabled(false); break; } case DEFAULT_SETTINGS: { - fCurrentSet.SetToDefaults(); + fCurrentSet = ColorSet::DefaultColorSet(); fDefaults->SetEnabled(false); UpdateControlsFromAttr(fAttrString.String()); + UpdateAllColors(); + BMenuItem *item = fDecorMenu->FindItem("Default"); if (item) { @@ -275,21 +291,31 @@ void APRView::LoadSettings(void) { - // Load the current GUI color settings from disk. This is done instead of - // getting them from the server at this point for testing purposes. - - // Query the server for the current settings - //BPrivate::get_system_colors(&fCurrentSet); - - // TODO: remove this and enable the get_system_colors() call - if (ColorSet::LoadColorSet("/boot/home/config/settings/app_server/system_colors",&fCurrentSet) != B_OK) { - fCurrentSet.SetToDefaults(); - ColorSet::SaveColorSet("/boot/home/config/settings/app_server/system_colors",fCurrentSet); + printf("Max colors: %lu\n", sColorCount); + for (uint32 i = 0; i < sColorCount; i++) { + printf("getting ui_color for index %lu, constant: %ld\n", i, sColorConsts[i]); + fCurrentSet.SetColor((color_which)sColorConsts[i], ui_color((color_which)sColorConsts[i])); } - + + fCurrentSet.PrintToStream(); + fPrevSet = fCurrentSet; } +void APRView::UpdateAllColors(void) +{ + for (uint32 i = 0; i < sColorCount; i++) + set_ui_color((color_which)sColorConsts[i], + fCurrentSet.AttributeToColor((color_which)sColorConsts[i])); +} + +void APRView::UpdateCurrentColor(void) +{ + rgb_color col=fPicker->ValueAsColor(); + ColorWhichItem *whichitem = (ColorWhichItem *)fAttrList->ItemAt(fAttrList->CurrentSelection()); + set_ui_color(whichitem->GetAttribute(), col); +} + void APRView::UpdateControlsFromAttr(const char *string) { if (!string) Modified: haiku/trunk/src/preferences/appearance/APRView.h =================================================================== --- haiku/trunk/src/preferences/appearance/APRView.h 2008-02-29 23:43:18 UTC (rev 24184) +++ haiku/trunk/src/preferences/appearance/APRView.h 2008-03-01 00:57:18 UTC (rev 24185) @@ -1,9 +1,10 @@ /* - * Copyright 2002-2006, Haiku. All rights reserved. + * Copyright 2002-2008, Haiku. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: * DarkWyrm (darkwyrm at earthlink.net) + * Rene Gollent (rene at gollent.com) */ #ifndef APR_VIEW_H_ #define APR_VIEW_H_ @@ -43,6 +44,8 @@ protected: void UpdateControlsFromAttr(const char *string); + void UpdateCurrentColor(); + void UpdateAllColors(); BColorControl *fPicker; Modified: haiku/trunk/src/preferences/appearance/ColorSet.cpp =================================================================== --- haiku/trunk/src/preferences/appearance/ColorSet.cpp 2008-02-29 23:43:18 UTC (rev 24184) +++ haiku/trunk/src/preferences/appearance/ColorSet.cpp 2008-03-01 00:57:18 UTC (rev 24185) @@ -1,10 +1,11 @@ /* - * Copyright 2001-2006, Haiku. + * Copyright 2001-2008, Haiku. * Distributed under the terms of the MIT License. * * Authors: * DarkWyrm * Stephan A?mus + * Rene Gollent */ #include @@ -16,17 +17,10 @@ #include #include "ColorSet.h" -static void -set_rgb_color(rgb_color& color, uint8 red, uint8 green, uint8 blue) -{ - color.red = red; - color.green = green; - color.blue = blue; - color.alpha = 255; -} +static ColorSet sDefaults = ColorSet::DefaultColorSet(); +static std::map sColorNames = ColorSet::DefaultColorNames(); - -static bool +bool match_rgb_color(rgb_color& color, uint8 red, uint8 green, uint8 blue) { return color.red == red @@ -71,148 +65,68 @@ void ColorSet::SetColors(const ColorSet &cs) { - panel_background=cs.panel_background; - panel_text=cs.panel_text; - - document_background=cs.document_background; - document_text=cs.document_text; - - control_background=cs.control_background; - control_text=cs.control_text; - control_highlight=cs.control_highlight; - control_border=cs.control_border; - - tooltip_background=cs.tooltip_background; - tooltip_text=cs.tooltip_text; - - menu_background=cs.menu_background; - menu_selected_background=cs.menu_selected_background; - menu_text=cs.menu_text; - menu_selected_text=cs.menu_selected_text; - menu_selected_border=cs.menu_selected_border; - - keyboard_navigation_base=cs.keyboard_navigation_base; - keyboard_navigation_pulse=cs.keyboard_navigation_pulse; - - success=cs.success; - failure=cs.failure; - shine=cs.shine; - shadow=cs.shadow; - - window_tab=cs.window_tab; - window_tab_text=cs.window_tab_text; - inactive_window_tab=cs.inactive_window_tab; - inactive_window_tab_text=cs.inactive_window_tab_text; + fColors = cs.fColors; } //! Prints all color set elements to stdout void ColorSet::PrintToStream(void) const { - printf("panel_background "); PrintMember(panel_background); - printf("panel_text "); PrintMember(panel_text); - - printf("document_background "); PrintMember(document_background); - printf("document_text "); PrintMember(document_text); - - printf("control_background "); PrintMember(control_background); - printf("control_text "); PrintMember(control_text); - printf("control_highlight "); PrintMember(control_highlight); - printf("control_border "); PrintMember(control_border); - - printf("tooltip_background "); PrintMember(tooltip_background); - printf("tooltip_text "); PrintMember(tooltip_text); - - printf("menu_background "); PrintMember(menu_background); - printf("menu_selected_background "); PrintMember(menu_selected_background); - printf("menu_text "); PrintMember(menu_text); - printf("menu_selected_text "); PrintMember(menu_selected_text); - printf("menu_selected_border "); PrintMember(menu_selected_border); - - printf("keyboard_navigation_base "); PrintMember(keyboard_navigation_base); - printf("keyboard_navigation_pulse "); PrintMember(keyboard_navigation_pulse); - - printf("success "); PrintMember(success); - printf("failure "); PrintMember(failure); - printf("shine "); PrintMember(shine); - printf("shadow "); PrintMember(shadow); - - printf("window_tab "); PrintMember(window_tab); - printf("window_tab_text "); PrintMember(window_tab_text); - - printf("inactive_window_tab "); PrintMember(inactive_window_tab); - printf("inactive_window_tab_text "); PrintMember(inactive_window_tab_text); + for (std::map::const_iterator it = sColorNames.begin(); it != sColorNames.end(); ++it) { + printf("%s ", it->second.String()); + PrintMember(it->first); + printf("\n"); + } } /*! \brief Assigns the default system colors to the passed ColorSet object \param set The ColorSet object to set to defaults */ -void -ColorSet::SetToDefaults(void) +ColorSet +ColorSet::DefaultColorSet(void) { #ifdef DEBUG_COLORSET printf("Initializing color settings to defaults\n"); #endif - set_rgb_color(panel_background, 216, 216, 216); - set_rgb_color(panel_text, 0, 0, 0); - set_rgb_color(document_background, 255, 255, 255); - set_rgb_color(document_text, 0, 0, 0); - set_rgb_color(control_background, 245, 245, 245); - set_rgb_color(control_text, 0, 0, 0); - set_rgb_color(control_border, 0, 0, 0); - set_rgb_color(control_highlight, 102, 152, 203); - set_rgb_color(keyboard_navigation_base, 0, 0, 229); - set_rgb_color(keyboard_navigation_pulse, 0, 0, 0); - set_rgb_color(shine, 255, 255, 255); - set_rgb_color(shadow, 0, 0, 0); - set_rgb_color(menu_background, 216, 216, 216); - set_rgb_color(menu_selected_background, 115, 120, 184); - set_rgb_color(menu_text, 0, 0, 0); - set_rgb_color(menu_selected_text, 255, 255, 255); - set_rgb_color(menu_selected_border, 0, 0, 0); - set_rgb_color(tooltip_background, 255, 255, 0); - set_rgb_color(tooltip_text, 0, 0, 0); - set_rgb_color(success, 0, 255, 0); - set_rgb_color(failure, 255, 0, 0); - set_rgb_color(window_tab, 255, 203, 0); - set_rgb_color(window_tab_text, 0, 0, 0); - set_rgb_color(inactive_window_tab, 232, 232, 232); - set_rgb_color(inactive_window_tab_text, 80, 80, 80); + ColorSet set; + set.fColors[B_PANEL_BACKGROUND_COLOR] = make_color(216, 216, 216); + set.fColors[B_PANEL_TEXT_COLOR] = make_color(0, 0, 0); + set.fColors[B_DOCUMENT_BACKGROUND_COLOR] = make_color(255,255, 255); + set.fColors[B_DOCUMENT_TEXT_COLOR] = make_color(0, 0, 0); + set.fColors[B_CONTROL_BACKGROUND_COLOR] = make_color(245, 245, 245); + set.fColors[B_CONTROL_TEXT_COLOR] = make_color(0, 0, 0); + set.fColors[B_CONTROL_BORDER_COLOR] = make_color(0, 0, 0); + set.fColors[B_CONTROL_HIGHLIGHT_COLOR] = make_color(102, 152, 203); + set.fColors[B_NAVIGATION_BASE_COLOR] = make_color(0, 0, 229); + set.fColors[B_NAVIGATION_PULSE_COLOR] = make_color(0, 0, 0); + set.fColors[B_SHINE_COLOR] = make_color(255, 255, 255); + set.fColors[B_SHADOW_COLOR] = make_color(0, 0, 0); + set.fColors[B_MENU_BACKGROUND_COLOR] = make_color(216, 216, 216); + set.fColors[B_MENU_SELECTED_BACKGROUND_COLOR] = make_color(115, 120, 184); + set.fColors[B_MENU_ITEM_TEXT_COLOR] = make_color(0, 0, 0); + set.fColors[B_MENU_SELECTED_ITEM_TEXT_COLOR] = make_color(255, 255, 255); + set.fColors[B_MENU_SELECTED_BORDER_COLOR] = make_color(0, 0, 0); + set.fColors[B_TOOLTIP_BACKGROUND_COLOR] = make_color(255, 255, 0); + set.fColors[B_TOOLTIP_TEXT_COLOR] = make_color(0, 0, 0); + set.fColors[B_SUCCESS_COLOR] = make_color(0, 255, 0); + set.fColors[B_FAILURE_COLOR] = make_color(255, 0, 0); + set.fColors[B_WINDOW_TAB_COLOR] = make_color(255, 203, 0); + set.fColors[B_WINDOW_TEXT_COLOR] = make_color(0, 0, 0); + set.fColors[B_WINDOW_INACTIVE_TAB_COLOR] = make_color(232, 232, 232); + set.fColors[B_WINDOW_INACTIVE_TEXT_COLOR] = make_color(80, 80, 80); + + return set; } + /*! \brief Checks if the ColorSet can be set to defaults. */ bool ColorSet::IsDefaultable() { - // TODO: Move all the default color values into constants - return !match_rgb_color(panel_background, 216, 216, 216) - || !match_rgb_color(panel_text, 0, 0, 0) - || !match_rgb_color(document_background, 255, 255, 255) - || !match_rgb_color(document_text, 0, 0, 0) - || !match_rgb_color(control_background, 245, 245, 245) - || !match_rgb_color(control_text, 0, 0, 0) - || !match_rgb_color(control_border, 0, 0, 0) - || !match_rgb_color(control_highlight, 102, 152, 203) - || !match_rgb_color(keyboard_navigation_base, 0, 0, 229) - || !match_rgb_color(keyboard_navigation_pulse, 0, 0, 0) - || !match_rgb_color(shine, 255, 255, 255) - || !match_rgb_color(shadow, 0, 0, 0) - || !match_rgb_color(menu_background, 216, 216, 216) - || !match_rgb_color(menu_selected_background, 115, 120, 184) - || !match_rgb_color(menu_text, 0, 0, 0) - || !match_rgb_color(menu_selected_text, 255, 255, 255) - || !match_rgb_color(menu_selected_border, 0, 0, 0) - || !match_rgb_color(tooltip_background, 255, 255, 0) - || !match_rgb_color(tooltip_text, 0, 0, 0) - || !match_rgb_color(success, 0, 255, 0) - || !match_rgb_color(failure, 255, 0, 0) - || !match_rgb_color(window_tab, 255, 203, 0) - || !match_rgb_color(window_tab_text, 0, 0, 0) - || !match_rgb_color(inactive_window_tab, 232, 232, 232) - || !match_rgb_color(inactive_window_tab_text, 80, 80, 80); + return (*this == sDefaults); } /*! @@ -226,46 +140,16 @@ return false; msg->MakeEmpty(); - - msg->AddData("Panel Background",(type_code)'RGBC',&panel_background, - sizeof(rgb_color) ); - msg->AddData("Panel Text",(type_code)'RGBC',&panel_text,sizeof(rgb_color)); - msg->AddData("Document Background",(type_code)'RGBC',&document_background, - sizeof(rgb_color)); - msg->AddData("Document Text",(type_code)'RGBC',&document_text,sizeof(rgb_color)); - msg->AddData("Control Background",(type_code)'RGBC',&control_background, - sizeof(rgb_color)); - msg->AddData("Control Text",(type_code)'RGBC',&control_text,sizeof(rgb_color)); - msg->AddData("Control Highlight",(type_code)'RGBC',&control_highlight, - sizeof(rgb_color)); - msg->AddData("Control Border",(type_code)'RGBC',&control_border,sizeof(rgb_color)); - msg->AddData("Tooltip Background",(type_code)'RGBC',&tooltip_background, - sizeof(rgb_color)); - msg->AddData("Tooltip Text",(type_code)'RGBC',&tooltip_text,sizeof(rgb_color)); - msg->AddData("Menu Background",(type_code)'RGBC',&menu_background, - sizeof(rgb_color)); - msg->AddData("Selected Menu Item Background",(type_code)'RGBC',&menu_selected_background, - sizeof(rgb_color)); - msg->AddData("Keyboard Navigation Base",(type_code)'RGBC',&keyboard_navigation_base, - sizeof(rgb_color)); - msg->AddData("Keyboard Navigation Pulse",(type_code)'RGBC', - &keyboard_navigation_pulse,sizeof(rgb_color)); - msg->AddData("Menu Item Text",(type_code)'RGBC',&menu_text,sizeof(rgb_color)); - msg->AddData("Selected Menu Item Text",(type_code)'RGBC',&menu_selected_text, - sizeof(rgb_color)); - msg->AddData("Selected Menu Item Border",(type_code)'RGBC',&menu_selected_border, - sizeof(rgb_color)); - msg->AddData("Success",(type_code)'RGBC',&success,sizeof(rgb_color)); - msg->AddData("Failure",(type_code)'RGBC',&failure,sizeof(rgb_color)); - msg->AddData("Shine",(type_code)'RGBC',&shine,sizeof(rgb_color)); - msg->AddData("Shadow",(type_code)'RGBC',&shadow,sizeof(rgb_color)); - msg->AddData("Window Tab",(type_code)'RGBC',&window_tab,sizeof(rgb_color)); - msg->AddData("Window Tab Text",(type_code)'RGBC',&window_tab_text, - sizeof(rgb_color)); - msg->AddData("Inactive Window Tab",(type_code)'RGBC',&inactive_window_tab, - sizeof(rgb_color)); - msg->AddData("Inactive Window Tab Text",(type_code)'RGBC', - &inactive_window_tab_text,sizeof(rgb_color)); + rgb_color color; + + for (std::map::const_iterator it = sColorNames.begin(); it != sColorNames.end(); ++it) { + std::map::const_iterator cit = fColors.find(it->first); + if (cit != fColors.end()) + msg->AddData(it->second.String(), (type_code)'RGBC', &(cit->second), sizeof(rgb_color)); + else + msg->AddData(it->second.String(), (type_code)'RGBC', &color, sizeof(rgb_color)); + } + return true; } @@ -284,286 +168,114 @@ ssize_t size; BString str; - if(msg->FindData("Panel Background",(type_code)'RGBC',(const void**)&col,&size)==B_OK) - panel_background=*col; - if(msg->FindData("Panel Text",(type_code)'RGBC',(const void**)&col,&size)==B_OK) - panel_text=*col; - if(msg->FindData("Document Background",(type_code)'RGBC',(const void**)&col,&size)==B_OK) - document_background=*col; - if(msg->FindData("Document Text",(type_code)'RGBC',(const void**)&col,&size)==B_OK) - document_text=*col; - if(msg->FindData("Control Background",(type_code)'RGBC',(const void**)&col,&size)==B_OK) - control_background=*col; - if(msg->FindData("Control Text",(type_code)'RGBC',(const void**)&col,&size)==B_OK) - control_text=*col; - if(msg->FindData("Control Highlight",(type_code)'RGBC',(const void**)&col,&size)==B_OK) - control_highlight=*col; - if(msg->FindData("Control Border",(type_code)'RGBC',(const void**)&col,&size)==B_OK) - control_border=*col; - if(msg->FindData("Tooltip Background",(type_code)'RGBC',(const void**)&col,&size)==B_OK) - tooltip_background=*col; - if(msg->FindData("Tooltip Text",(type_code)'RGBC',(const void**)&col,&size)==B_OK) - tooltip_text=*col; - if(msg->FindData("Menu Background",(type_code)'RGBC',(const void**)&col,&size)==B_OK) - menu_background=*col; - if(msg->FindData("Selected Menu Item Background",(type_code)'RGBC',(const void**)&col,&size)==B_OK) - menu_selected_background=*col; - if(msg->FindData("Navigation Base",(type_code)'RGBC',(const void**)&col,&size)==B_OK) - keyboard_navigation_base=*col; - if(msg->FindData("Navigation Pulse",(type_code)'RGBC',(const void**)&col,&size)==B_OK) - keyboard_navigation_pulse=*col; - if(msg->FindData("Menu Item Text",(type_code)'RGBC',(const void**)&col,&size)==B_OK) - menu_text=*col; - if(msg->FindData("Selected Menu Item Text",(type_code)'RGBC',(const void**)&col,&size)==B_OK) - menu_selected_text=*col; - if(msg->FindData("Selected Menu Item Border",(type_code)'RGBC',(const void**)&col,&size)==B_OK) - menu_selected_border=*col; - if(msg->FindData("Success",(type_code)'RGBC',(const void**)&col,&size)==B_OK) - success=*col; - if(msg->FindData("Failure",(type_code)'RGBC',(const void**)&col,&size)==B_OK) - failure=*col; - if(msg->FindData("Shine",(type_code)'RGBC',(const void**)&col,&size)==B_OK) - shine=*col; - if(msg->FindData("Shadow",(type_code)'RGBC',(const void**)&col,&size)==B_OK) - shadow=*col; - if(msg->FindData("Window Tab",(type_code)'RGBC',(const void**)&col,&size)==B_OK) - window_tab=*col; - if(msg->FindData("Window Tab Text",(type_code)'RGBC',(const void**)&col,&size)==B_OK) - window_tab_text=*col; - if(msg->FindData("Inactive Window Tab",(type_code)'RGBC',(const void**)&col,&size)==B_OK) - inactive_window_tab=*col; - if(msg->FindData("Inactive Window Tab Text",(type_code)'RGBC',(const void**)&col,&size)==B_OK) - inactive_window_tab_text=*col; + for (std::map::const_iterator it = sColorNames.begin(); + it != sColorNames.end(); ++it) { + if (msg->FindData(it->second.String(),(type_code)'RGBC',(const void**)&col,&size)==B_OK) + fColors[it->first] = *col; + } + return true; } +std::map +ColorSet::DefaultColorNames(void) +{ + std::map names; + + names[B_PANEL_BACKGROUND_COLOR] = "Panel Background"; + names[B_PANEL_TEXT_COLOR] = "Panel Text"; + names[B_DOCUMENT_BACKGROUND_COLOR] = "Document Background"; + names[B_DOCUMENT_TEXT_COLOR] = "Document Text"; + names[B_CONTROL_BACKGROUND_COLOR] = "Control Background"; + names[B_CONTROL_TEXT_COLOR] = "Control Text"; + names[B_CONTROL_BORDER_COLOR] = "Control Border"; + names[B_CONTROL_HIGHLIGHT_COLOR] = "Control Highlight"; + names[B_NAVIGATION_BASE_COLOR] = "Navigation Base"; + names[B_NAVIGATION_PULSE_COLOR] = "Navigation Pulse"; + names[B_SHINE_COLOR] = "Shine"; + names[B_SHADOW_COLOR] = "Shadow"; + names[B_MENU_BACKGROUND_COLOR] = "Menu Background"; + names[B_MENU_SELECTED_BACKGROUND_COLOR] = "Selected Menu Item Background"; + names[B_MENU_ITEM_TEXT_COLOR] = "Menu Item Text"; + names[B_MENU_SELECTED_ITEM_TEXT_COLOR] = "Selected Menu Item Text"; + names[B_MENU_SELECTED_BORDER_COLOR] = "Selected Menu Item Border"; + names[B_TOOLTIP_BACKGROUND_COLOR] = "Tooltip Background"; + names[B_TOOLTIP_TEXT_COLOR] = "Tooltip Text"; + names[B_SUCCESS_COLOR] = "Success"; + names[B_FAILURE_COLOR] = "Failure"; + names[B_WINDOW_TAB_COLOR] = "Window Tab"; + names[B_WINDOW_TEXT_COLOR] = "Window Tab Text"; + names[B_WINDOW_INACTIVE_TAB_COLOR] = "Inactive Window Tab"; + names[B_WINDOW_INACTIVE_TEXT_COLOR] = "Inactive Window Tab Text"; + return names; +} + /*! \brief Assigns a value to a named color member \param string name of the color to receive the value \param value An rgb_color which is the new value of the member */ status_t -ColorSet::SetColor(const char *string, rgb_color value) +ColorSet::SetColor(color_which which, rgb_color value) { - if(!string) - return B_BAD_VALUE; - - rgb_color *col=StringToMember(string); - if(!col) - return B_NAME_NOT_FOUND; - *col=value; + fColors[which] = value; return B_OK; } /*! - \brief Obtains a color based on a specified string - \param string name of the color to obtain - \return The set's color or (0,0,0,0) if not found + \brief Obtains the set's color member based on a specified string + \param string name of the color member to obtain + \return An RGBColor pointer or NULL if not found */ + rgb_color -ColorSet::StringToColor(const char *string) +ColorSet::StringToColor(const char *string) const { - rgb_color *col=StringToMember(string); - if(!col) { - rgb_color c; - return c; + rgb_color color; + + if (!string) + return color; + + color_which which = StringToWhich(string); + if (which != -1) { + std::map::const_iterator it = fColors.find(which); + if (it != fColors.end()) + return it->second; } - - return *col; + + return color; } -/*! - \brief Obtains the set's color member based on a specified string - \param string name of the color member to obtain - \return An RGBColor pointer or NULL if not found -*/ -rgb_color * -ColorSet::StringToMember(const char *string) +color_which +ColorSet::StringToWhich(const char *string) const { if(!string) - return NULL; + return (color_which)-1; - if(strcmp(string,"Panel Background")==0) - return &panel_background; - if(strcmp(string,"Panel Text")==0) - return &panel_text; - if(strcmp(string,"Document Background")==0) - return &document_background; - if(strcmp(string,"Document Text")==0) - return &document_text; - if(strcmp(string,"Control Background")==0) - return &control_background; - if(strcmp(string,"Control Text")==0) - return &control_text; - if(strcmp(string,"Control Highlight")==0) - return &control_highlight; - if(strcmp(string,"Control Border")==0) - return &control_border; - if(strcmp(string,"Tooltip Background")==0) - return &tooltip_background; - if(strcmp(string,"Tooltip Text")==0) - return &tooltip_text; - if(strcmp(string,"Menu Background")==0) - return &menu_background; - if(strcmp(string,"Selected Menu Item Background")==0) - return &menu_selected_background; - if(strcmp(string,"Navigation Base")==0) - return &keyboard_navigation_base; - if(strcmp(string,"Navigation Pulse")==0) - return &keyboard_navigation_pulse; - if(strcmp(string,"Menu Item Text")==0) - return &menu_text; - if(strcmp(string,"Selected Menu Item Text")==0) - return &menu_selected_text; - if(strcmp(string,"Selected Menu Item Border")==0) - return &menu_selected_border; - if(strcmp(string,"Success")==0) - return &success; - if(strcmp(string,"Failure")==0) - return &failure; - if(strcmp(string,"Shine")==0) - return &shine; - if(strcmp(string,"Shadow")==0) - return &shadow; - if(strcmp(string,"Window Tab")==0) - return &window_tab; - if(strcmp(string,"Window Tab Text")==0) - return &window_tab_text; - if(strcmp(string,"Inactive Window Tab")==0) - return &inactive_window_tab; - if(strcmp(string,"Inactive Window Tab Text")==0) - return &inactive_window_tab_text; + for (std::map::const_iterator it = sColorNames.begin(); it != sColorNames.end(); ++it) + if (it->second == string) + return it->first; - return NULL; + return (color_which)-1; } rgb_color ColorSet::AttributeToColor(int32 which) { - switch(which) { - case B_PANEL_BACKGROUND_COLOR: { - return panel_background; - break; - } - -#ifndef HAIKU_TARGET_PLATFORM_BEOS - case B_PANEL_TEXT_COLOR: { - return panel_text; - break; - } - case B_DOCUMENT_BACKGROUND_COLOR: { - return document_background; - break; - } - case B_DOCUMENT_TEXT_COLOR: { - return document_text; - break; - } - case B_CONTROL_BACKGROUND_COLOR: { - return control_background; - break; - } - case B_CONTROL_TEXT_COLOR: { - return control_text; - break; - } - case B_CONTROL_BORDER_COLOR: { - return control_border; - break; - } - case B_CONTROL_HIGHLIGHT_COLOR: { - return control_highlight; - break; - } - case B_NAVIGATION_BASE_COLOR: { - return keyboard_navigation_base; - break; - } - case B_NAVIGATION_PULSE_COLOR: { - return keyboard_navigation_pulse; - break; - } - case B_SHINE_COLOR: { - return shine; - break; - } - case B_SHADOW_COLOR: { - return shadow; - break; - } - case B_MENU_SELECTED_BACKGROUND_COLOR: { - return menu_selected_background; - break; - } - case B_MENU_SELECTED_BORDER_COLOR: { - return menu_selected_border; - break; - } - case B_TOOLTIP_BACKGROUND_COLOR: { - return tooltip_background; - break; - } - case B_TOOLTIP_TEXT_COLOR: { - return tooltip_text; - break; - } - case B_SUCCESS_COLOR: { - return success; - break; - } - case B_FAILURE_COLOR: { - return failure; - break; - } -#endif - case B_MENU_BACKGROUND_COLOR: { - return menu_background; - break; - } - case B_MENU_ITEM_TEXT_COLOR: { - return menu_text; - break; - } - case B_MENU_SELECTED_ITEM_TEXT_COLOR: { - return menu_selected_text; - break; - } - case B_WINDOW_TAB_COLOR: { - return window_tab; - break; - } - - // DANGER! DANGER, WILL ROBINSON!! - // These are magic numbers to work around compatibility difficulties while still keeping - // functionality. This __will__ break following R1 - case 22: { - return window_tab_text; - break; - } - case 23: { - return inactive_window_tab; - break; - } - case 24: { - return inactive_window_tab_text; - break; - } - - default: { - rgb_color c; - return c; - break; - } - } + return fColors[(color_which)which]; } void -ColorSet::PrintMember(const rgb_color &color) const +ColorSet::PrintMember(color_which which) const { - printf("rgb_color(%d, %d, %d, %d)",color.red,color.green,color.blue, - color.alpha); + std::map::const_iterator it = fColors.find(which); + if (it != fColors.end()) + printf("rgb_color(%d, %d, %d, %d)", it->second.red,it->second.green,it->second.blue, + it->second.alpha); + else + printf("color (%d) not found\n", which); } @@ -607,3 +319,4 @@ return msg.Flatten(&file); } + Modified: haiku/trunk/src/preferences/appearance/ColorSet.h =================================================================== --- haiku/trunk/src/preferences/appearance/ColorSet.h 2008-02-29 23:43:18 UTC (rev 24184) +++ haiku/trunk/src/preferences/appearance/ColorSet.h 2008-03-01 00:57:18 UTC (rev 24185) @@ -1,9 +1,10 @@ /* - * Copyright 2001-2006, Haiku. + * Copyright 2001-2008, Haiku. * Distributed under the terms of the MIT License. * * Authors: * DarkWyrm + * Rene Gollent */ #ifndef COLOR_SET_H #define COLOR_SET_H @@ -14,6 +15,7 @@ #include #include +#include /*! \class ColorSet ColorSet.h @@ -31,56 +33,28 @@ bool ConvertToMessage(BMessage *msg) const; bool ConvertFromMessage(const BMessage *msg); - void SetToDefaults(void); bool IsDefaultable(void); - rgb_color StringToColor(const char *string); + rgb_color StringToColor(const char *string) const; rgb_color AttributeToColor(int32 which); - status_t SetColor(const char *string, rgb_color value); + status_t SetColor(color_which which, rgb_color value); static status_t LoadColorSet(const char *path, ColorSet *set); static status_t SaveColorSet(const char *path, const ColorSet &set); + + static ColorSet DefaultColorSet(void); + static std::map DefaultColorNames(void); + + inline bool operator==(const ColorSet &other) + { + return (fColors == other.fColors); + } - rgb_color panel_background, - panel_text, - - document_background, - document_text, - - control_background, - control_text, - control_highlight, - control_border, - - tooltip_background, - tooltip_text, - - menu_background, - menu_selected_background, - menu_text, - menu_selected_text, - menu_selected_border, - - keyboard_navigation_base, - keyboard_navigation_pulse, - - success, - failure, - shine, - shadow, - window_tab, - - // Not all of these guys do exist in InterfaceDefs.h, - // but we keep them as part of the color set anyway - - // they're important nonetheless - window_tab_text, - inactive_window_tab, - inactive_window_tab_text; - private: - rgb_color *StringToMember(const char *string); - void PrintMember(const rgb_color &color) const; + color_which StringToWhich(const char *string) const; + void PrintMember(color_which which) const; + std::map fColors; }; #endif // COLOR_SET_H Modified: haiku/trunk/src/preferences/appearance/ColorWhichItem.cpp =================================================================== --- haiku/trunk/src/preferences/appearance/ColorWhichItem.cpp 2008-02-29 23:43:18 UTC (rev 24184) +++ haiku/trunk/src/preferences/appearance/ColorWhichItem.cpp 2008-03-01 00:57:18 UTC (rev 24185) @@ -1,9 +1,10 @@ /* - * Copyright 2002-2006, Haiku. All rights reserved. + * Copyright 2002-2008, Haiku. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: * DarkWyrm (darkwyrm at earthlink.net) + * Rene Gollent (rene at gollent.com) */ #include "ColorWhichItem.h" #include @@ -134,17 +135,17 @@ SetText("Window Tab"); break; } - case B_WINDOW_TAB_TEXT_COLOR: { + case B_WINDOW_TEXT_COLOR: { attribute=which; - SetText("Window Tab Text"); + SetText("Window Text"); break; [... truncated: 61 lines follow ...] From anevilyak at mail.berlios.de Sat Mar 1 02:12:23 2008 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Sat, 1 Mar 2008 02:12:23 +0100 Subject: [Haiku-commits] r24186 - haiku/trunk/src/preferences/appearance Message-ID: <200803010112.m211CNVa003171@sheep.berlios.de> Author: anevilyak Date: 2008-03-01 02:12:22 +0100 (Sat, 01 Mar 2008) New Revision: 24186 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24186&view=rev Modified: haiku/trunk/src/preferences/appearance/ColorSet.cpp Log: Fix gcc4 warning. Modified: haiku/trunk/src/preferences/appearance/ColorSet.cpp =================================================================== --- haiku/trunk/src/preferences/appearance/ColorSet.cpp 2008-03-01 00:57:18 UTC (rev 24185) +++ haiku/trunk/src/preferences/appearance/ColorSet.cpp 2008-03-01 01:12:22 UTC (rev 24186) @@ -233,6 +233,7 @@ ColorSet::StringToColor(const char *string) const { rgb_color color; + color.set_to(0,0,0); if (!string) return color; From axeld at mail.berlios.de Sat Mar 1 12:56:33 2008 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Sat, 1 Mar 2008 12:56:33 +0100 Subject: [Haiku-commits] r24187 - in haiku/trunk/src: add-ons/translators/stxt servers/registrar Message-ID: <200803011156.m21BuXF4003065@sheep.berlios.de> Author: axeld Date: 2008-03-01 12:56:30 +0100 (Sat, 01 Mar 2008) New Revision: 24187 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24187&view=rev Modified: haiku/trunk/src/add-ons/translators/stxt/STXTTranslator.cpp haiku/trunk/src/servers/registrar/TextSnifferAddon.cpp haiku/trunk/src/servers/registrar/names.h Log: * Added a more generic subtype for the source code files for automatic MIME type guessing. * Now, if the specific MIME type exists, it will be chosen, if it doesn't, the generic MIME type is chosen. If that does not exist either, the most generic is chosen (a.k.a. "text/plain"). Modified: haiku/trunk/src/add-ons/translators/stxt/STXTTranslator.cpp =================================================================== --- haiku/trunk/src/add-ons/translators/stxt/STXTTranslator.cpp 2008-03-01 01:12:22 UTC (rev 24186) +++ haiku/trunk/src/add-ons/translators/stxt/STXTTranslator.cpp 2008-03-01 11:56:30 UTC (rev 24187) @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007, Haiku, Inc. All Rights Reserved. + * Copyright 2002-2008, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -143,7 +143,20 @@ /* * ASCII magic -- file types that we know based on keywords * that can appear anywhere in the file. - * + * bool found = false; + if (subtypeMimeSpecific != NULL) { + mimeType->SetTo(subtypeMimeSpecific); + if (mimeType->IsInstalled()) + found = true; + } + if (!found && subtypeMimeGeneric != NULL) { + mimeType->SetTo(subtypeMimeGeneric); + if (mimeType->IsInstalled()) + found = true; + } + if (!found) + mimeType->SetTo("text/plain"); + * Extensively modified by Eric Fischer in July, 2000, * to handle character codes other than ASCII on a unified basis. * @@ -189,7 +202,8 @@ encoding = NULL; const char *type = NULL; const char *subtype = NULL; - const char *subtype_mime = NULL; + const char *subtypeMimeGeneric = NULL; + const char *subtypeMimeSpecific = NULL; int has_escapes = 0; int has_backspace = 0; @@ -291,14 +305,16 @@ isascii((unsigned char)tp[1]) && isalnum((unsigned char)tp[1]) && ISSPC(tp[2]))) { - subtype_mime = "text/troff"; + subtypeMimeGeneric = "text/x-source-code"; + subtypeMimeSpecific = "text/troff"; subtype = "troff or preprocessor input"; goto subtype_identified; } } if ((*buf == 'c' || *buf == 'C') && ISSPC(buf[1])) { - subtype_mime = "text/fortran"; + subtypeMimeGeneric = "text/x-source-code"; + subtypeMimeSpecific = "text/fortran"; subtype = "fortran program"; goto subtype_identified; } @@ -331,7 +347,8 @@ if (ascmatch((const unsigned char *)p->name, ubuf + i, end - i)) { subtype = types[p->type].human; - subtype_mime = types[p->type].mime; + subtypeMimeGeneric = types[p->type].generic_mime; + subtypeMimeSpecific = types[p->type].specific_mime; goto subtype_identified; } } @@ -383,9 +400,19 @@ if (rv) { // If we have identified the subtype, return it, otherwise just // text/plain. - if (subtype_mime) - mimeType->SetTo(subtype_mime); - else + + bool found = false; + if (subtypeMimeSpecific != NULL) { + mimeType->SetTo(subtypeMimeSpecific); + if (mimeType->IsInstalled()) + found = true; + } + if (!found && subtypeMimeGeneric != NULL) { + mimeType->SetTo(subtypeMimeGeneric); + if (mimeType->IsInstalled()) + found = true; + } + if (!found) mimeType->SetTo("text/plain"); } Modified: haiku/trunk/src/servers/registrar/TextSnifferAddon.cpp =================================================================== --- haiku/trunk/src/servers/registrar/TextSnifferAddon.cpp 2008-03-01 01:12:22 UTC (rev 24186) +++ haiku/trunk/src/servers/registrar/TextSnifferAddon.cpp 2008-03-01 11:56:30 UTC (rev 24187) @@ -135,7 +135,8 @@ const char *code_mime = NULL; const char *type = NULL; const char *subtype = NULL; - const char *subtype_mime = NULL; + const char *subtypeMimeGeneric = NULL; + const char *subtypeMimeSpecific = NULL; int has_escapes = 0; int has_backspace = 0; @@ -225,14 +226,16 @@ isascii((unsigned char)tp[1]) && isalnum((unsigned char)tp[1]) && ISSPC(tp[2]))) { - subtype_mime = "text/troff"; + subtypeMimeGeneric = "text/x-source-code"; + subtypeMimeSpecific = "text/troff"; subtype = "troff or preprocessor input"; goto subtype_identified; } } if ((*buf == 'c' || *buf == 'C') && ISSPC(buf[1])) { - subtype_mime = "text/fortran"; + subtypeMimeGeneric = "text/x-source-code"; + subtypeMimeSpecific = "text/fortran"; subtype = "fortran program"; goto subtype_identified; } @@ -265,7 +268,8 @@ if (ascmatch((const unsigned char *)p->name, ubuf + i, end - i)) { subtype = types[p->type].human; - subtype_mime = types[p->type].mime; + subtypeMimeGeneric = types[p->type].generic_mime; + subtypeMimeSpecific = types[p->type].specific_mime; goto subtype_identified; } } @@ -317,9 +321,19 @@ if (rv) { // If we have identified the subtype, return it, otherwise just // text/plain. - if (subtype_mime) - mimeType->SetTo(subtype_mime); - else + + bool found = false; + if (subtypeMimeSpecific != NULL) { + mimeType->SetTo(subtypeMimeSpecific); + if (mimeType->IsInstalled()) + found = true; + } + if (!found && subtypeMimeGeneric != NULL) { + mimeType->SetTo(subtypeMimeGeneric); + if (mimeType->IsInstalled()) + found = true; + } + if (!found) mimeType->SetTo("text/plain"); } Modified: haiku/trunk/src/servers/registrar/names.h =================================================================== --- haiku/trunk/src/servers/registrar/names.h 2008-03-01 01:12:22 UTC (rev 24186) +++ haiku/trunk/src/servers/registrar/names.h 2008-03-01 11:56:30 UTC (rev 24187) @@ -41,7 +41,7 @@ */ /* these types are used to index the table 'types': keep em in sync! */ -#define L_C 0 /* first and foremost on UNIX */ +#define L_C 0 /* first and foremost on UNIX */ #define L_CC 1 /* Bjarne's postincrement */ #define L_FORT 2 /* the oldest one */ #define L_MAKE 3 /* Makefiles */ @@ -59,25 +59,26 @@ static const struct { const char *human; - const char *mime; + const char *generic_mime; + const char *specific_mime; } types[] = { - { "C program", "text/x-c", }, - { "C++ program", "text/x-c++" }, - { "FORTRAN program", "text/x-fortran" }, - { "make commands", "text/x-makefile" }, - { "PL/1 program", "text/x-pl1" }, - { "assembler program", "text/x-asm" }, - { "English", "text/plain" }, - { "Pascal program", "text/x-pascal" }, - { "mail", "text/x-mail" }, - { "news", "text/x-news" }, - { "Java program", "text/x-java" }, - { "HTML document", "text/html", }, - { "BCPL program", "text/x-bcpl" }, - { "M4 macro language pre-processor", "text/x-m4" }, - { "PO (gettext message catalogue)", "text/x-po" }, - { "cannot happen error on names.h/types", "error/x-error" }, - { 0, 0} + { "C program", "text/x-source-code", "text/x-c", }, + { "C++ program", "text/x-source-code", "text/x-c++" }, + { "FORTRAN program", "text/x-source-code", "text/x-fortran" }, + { "make commands", "text/x-source-code", "text/x-makefile" }, + { "PL/1 program", "text/x-source-code", "text/x-pl1" }, + { "assembler program", "text/x-source-code", "text/x-asm" }, + { "English", "text/plain", NULL }, + { "Pascal program", "text/x-source-code", "text/x-pascal" }, + { "mail", "text/plain", "text/x-mail" }, + { "news", "text/plain", "text/x-news" }, + { "Java program", "text/x-source-code", "text/x-java" }, + { "HTML document", "text/x-source-code", "text/html", }, + { "BCPL program", "text/x-source-code", "text/x-bcpl" }, + { "M4 macro language pre-processor", "text/x-source-code", "text/x-m4" }, + { "PO (gettext message catalogue)", "text/plain", "text/x-po" }, + { "cannot happen error on names.h/types", "text/plain", "error/x-error" }, + { NULL, NULL, NULL } }; /* From axeld at mail.berlios.de Sat Mar 1 13:36:03 2008 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Sat, 1 Mar 2008 13:36:03 +0100 Subject: [Haiku-commits] r24188 - haiku/trunk/src/servers/registrar Message-ID: <200803011236.m21Ca3GQ021649@sheep.berlios.de> Author: axeld Date: 2008-03-01 13:36:03 +0100 (Sat, 01 Mar 2008) New Revision: 24188 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24188&view=rev Modified: haiku/trunk/src/servers/registrar/names.h Log: Added support for recognizing Jamfiles. Modified: haiku/trunk/src/servers/registrar/names.h =================================================================== --- haiku/trunk/src/servers/registrar/names.h 2008-03-01 11:56:30 UTC (rev 24187) +++ haiku/trunk/src/servers/registrar/names.h 2008-03-01 12:36:03 UTC (rev 24188) @@ -56,6 +56,7 @@ #define L_BCPL 12 /* BCPL */ #define L_M4 13 /* M4 */ #define L_PO 14 /* PO */ +#define L_JAM 15 /* Jamfiles */ static const struct { const char *human; @@ -77,6 +78,7 @@ { "BCPL program", "text/x-source-code", "text/x-bcpl" }, { "M4 macro language pre-processor", "text/x-source-code", "text/x-m4" }, { "PO (gettext message catalogue)", "text/plain", "text/x-po" }, + { "Jamfile", "text/x-source-code", "text/x-jamfile" }, { "cannot happen error on names.h/types", "text/plain", "error/x-error" }, { NULL, NULL, NULL } }; @@ -144,6 +146,9 @@ {"float", L_C}, {"struct", L_C}, {"union", L_C}, + {"SubDir", L_JAM}, + {"rule", L_JAM}, + {"actions", L_JAM}, {"CFLAGS", L_MAKE}, {"LDFLAGS", L_MAKE}, {"all:", L_MAKE}, From stefano.ceccherini at gmail.com Sat Mar 1 14:26:49 2008 From: stefano.ceccherini at gmail.com (Stefano Ceccherini) Date: Sat, 1 Mar 2008 14:26:49 +0100 Subject: [Haiku-commits] r24175 - haiku/trunk/headers/private/interface In-Reply-To: <20080229163221.M64585@mlotz.ch> References: <200802282304.m1SN4lFI000385@sheep.berlios.de> <20080229080834.M6488@mlotz.ch> <47C7C8D6.6060005@digintrans.com> <47C8191E.6060607@digintrans.com> <20080229163221.M64585@mlotz.ch> Message-ID: <894b9700803010526o359efdb5ne1300e95aafe224e@mail.gmail.com> 2008/2/29, Michael Lotz : > > > http://svn.berlios.de/viewcvs/*checkout*/haiku/haiku/trunk/data/etc/KanBe/default/.canna?rev=13558 > > > > It is encoded in EUC-JP. > Is bug #1735 related in any way to this ? From axeld at mail.berlios.de Sat Mar 1 18:23:41 2008 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Sat, 1 Mar 2008 18:23:41 +0100 Subject: [Haiku-commits] r24189 - haiku/trunk/src/add-ons/accelerants/common Message-ID: <200803011723.m21HNfQ8011914@sheep.berlios.de> Author: axeld Date: 2008-03-01 18:23:40 +0100 (Sat, 01 Mar 2008) New Revision: 24189 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24189&view=rev Modified: haiku/trunk/src/add-ons/accelerants/common/create_display_modes.cpp Log: Added modes for 1270x720 and 1400x1050 to the generic mode list. Modified: haiku/trunk/src/add-ons/accelerants/common/create_display_modes.cpp =================================================================== --- haiku/trunk/src/add-ons/accelerants/common/create_display_modes.cpp 2008-03-01 12:36:03 UTC (rev 24188) +++ haiku/trunk/src/add-ons/accelerants/common/create_display_modes.cpp 2008-03-01 17:23:40 UTC (rev 24189) @@ -1,5 +1,5 @@ /* - * Copyright 2007, Axel D?rfler, axeld at pinc-software.de. All rights reserved. + * Copyright 2007-2008, Axel D?rfler, axeld at pinc-software.de. All rights reserved. * Distributed under the terms of the MIT License. */ @@ -40,9 +40,11 @@ {{94200, 1152, 1184, 1280, 1472, 864, 865, 868, 914, POSITIVE_SYNC}, B_CMAP8, 1152, 864, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 70Hz_(1152X864X8.Z1) */ {{108000, 1152, 1216, 1344, 1600, 864, 865, 868, 900, POSITIVE_SYNC}, B_CMAP8, 1152, 864, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 75Hz_(1152X864X8.Z1) */ {{121500, 1152, 1216, 1344, 1568, 864, 865, 868, 911, POSITIVE_SYNC}, B_CMAP8, 1152, 864, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 85Hz_(1152X864X8.Z1) */ + {{74520, 1280, 1368, 1424, 1656, 720, 724, 730, 750, POSITIVE_SYNC}, B_CMAP8, 1280, 720, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 60Hz_(1280X720) */ {{108000, 1280, 1328, 1440, 1688, 1024, 1025, 1028, 1066, POSITIVE_SYNC}, B_CMAP8, 1280, 1024, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 60Hz_(1280X1024X8.Z1) */ {{135000, 1280, 1296, 1440, 1688, 1024, 1025, 1028, 1066, POSITIVE_SYNC}, B_CMAP8, 1280, 1024, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 75Hz_(1280X1024X8.Z1) */ {{157500, 1280, 1344, 1504, 1728, 1024, 1025, 1028, 1072, POSITIVE_SYNC}, B_CMAP8, 1280, 1024, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 85Hz_(1280X1024X8.Z1) */ + {{122600, 1400, 1488, 1640, 1880, 1050, 1051, 1054, 1087, POSITIVE_SYNC}, B_CMAP8, 1400, 1050, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 60Hz_(1400X1050) */ {{106500, 1440, 1520, 1672, 1904, 900, 901, 904, 932, POSITIVE_SYNC}, B_CMAP8, 1440, 900, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 60Hz_(1440X900) */ From axeld at mail.berlios.de Sat Mar 1 18:27:21 2008 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Sat, 1 Mar 2008 18:27:21 +0100 Subject: [Haiku-commits] r24190 - haiku/trunk/src/add-ons/accelerants/vesa Message-ID: <200803011727.m21HRLku012261@sheep.berlios.de> Author: axeld Date: 2008-03-01 18:27:20 +0100 (Sat, 01 Mar 2008) New Revision: 24190 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24190&view=rev Modified: haiku/trunk/src/add-ons/accelerants/vesa/Jamfile haiku/trunk/src/add-ons/accelerants/vesa/accelerant.cpp haiku/trunk/src/add-ons/accelerants/vesa/mode.cpp Log: * Now completely initializes the current_mode if it's in the mode list. * The mode list is now created by the common mode list creation code. * Minor cleanup. Modified: haiku/trunk/src/add-ons/accelerants/vesa/Jamfile =================================================================== --- haiku/trunk/src/add-ons/accelerants/vesa/Jamfile 2008-03-01 17:23:40 UTC (rev 24189) +++ haiku/trunk/src/add-ons/accelerants/vesa/Jamfile 2008-03-01 17:27:20 UTC (rev 24190) @@ -2,6 +2,7 @@ UsePrivateHeaders graphics ; UsePrivateHeaders [ FDirName graphics vesa ] ; +UsePrivateHeaders [ FDirName graphics common ] ; #AddResources vesa.accelerant : vesa.accelerant.rdef ; @@ -11,4 +12,5 @@ engine.cpp hooks.cpp mode.cpp + : libaccelerantscommon.a ; Modified: haiku/trunk/src/add-ons/accelerants/vesa/accelerant.cpp =================================================================== --- haiku/trunk/src/add-ons/accelerants/vesa/accelerant.cpp 2008-03-01 17:23:40 UTC (rev 24189) +++ haiku/trunk/src/add-ons/accelerants/vesa/accelerant.cpp 2008-03-01 17:27:20 UTC (rev 24190) @@ -1,5 +1,5 @@ /* - * Copyright 2005, Axel D?rfler, axeld at pinc-software.de. All rights reserved. + * Copyright 2005-2008, Axel D?rfler, axeld at pinc-software.de. All rights reserved. * Distributed under the terms of the MIT License. */ @@ -74,10 +74,9 @@ // #pragma mark - -/** This is the common accelerant_info initializer. It is called by - * both, the first accelerant and all clones. - */ - +/*! This is the common accelerant_info initializer. It is called by + both, the first accelerant and all clones. +*/ static status_t init_common(int device, bool isClone) { @@ -95,16 +94,16 @@ // get basic info from driver area_id sharedArea; - if (ioctl(device, VESA_GET_PRIVATE_DATA, &sharedArea, sizeof(area_id)) != 0) { + if (ioctl(device, VESA_GET_PRIVATE_DATA, &sharedArea, sizeof(area_id)) + != 0) { free(gInfo); return B_ERROR; } AreaCloner sharedCloner; gInfo->shared_info_area = sharedCloner.Clone("vesa shared info", - (void **)&gInfo->shared_info, B_ANY_ADDRESS, - B_READ_AREA | B_WRITE_AREA, - sharedArea); + (void **)&gInfo->shared_info, B_ANY_ADDRESS, + B_READ_AREA | B_WRITE_AREA, sharedArea); status_t status = sharedCloner.InitCheck(); if (status < B_OK) { free(gInfo); @@ -135,11 +134,10 @@ } -// #pragma mark - -// public accelerant functions +// #pragma mark - public accelerant functions -/** init primary accelerant */ +/*! Init primary accelerant */ status_t vesa_init_accelerant(int device) @@ -156,6 +154,8 @@ return status; } + // Initialize current mode completely from the mode list + vesa_propose_display_mode(&gInfo->shared_info->current_mode, NULL, NULL); return B_OK; } @@ -210,10 +210,9 @@ } -/** This function is called for both, the primary accelerant and all of - * its clones. - */ - +/*! This function is called for both, the primary accelerant and all of + its clones. +*/ void vesa_uninit_accelerant(void) { Modified: haiku/trunk/src/add-ons/accelerants/vesa/mode.cpp =================================================================== --- haiku/trunk/src/add-ons/accelerants/vesa/mode.cpp 2008-03-01 17:23:40 UTC (rev 24189) +++ haiku/trunk/src/add-ons/accelerants/vesa/mode.cpp 2008-03-01 17:27:20 UTC (rev 24190) @@ -1,10 +1,12 @@ /* - * Copyright 2005-2006, Axel D?rfler, axeld at pinc-software.de. All rights reserved. + * Copyright 2005-2008, Axel D?rfler, axeld at pinc-software.de. All rights reserved. * Distributed under the terms of the MIT License. */ #include +#include + #include "accelerant_protos.h" #include "accelerant.h" #include "utility.h" @@ -19,82 +21,22 @@ #endif -#define T_POSITIVE_SYNC (B_POSITIVE_HSYNC | B_POSITIVE_VSYNC) -#define MODE_FLAGS (B_8_BIT_DAC | B_HARDWARE_CURSOR | B_PARALLEL_ACCESS | B_DPMS /*| B_SUPPORTS_OVERLAYS*/) -static const display_mode kBaseModeList[] = { -{ { 25175, 640, 656, 752, 800, 350, 387, 389, 449, B_POSITIVE_HSYNC}, B_CMAP8, 640, 350, 0, 0, MODE_FLAGS}, /* 640x350 - www.epanorama.net/documents/pc/vga_timing.html) */ -{ { 25175, 640, 656, 752, 800, 400, 412, 414, 449, B_POSITIVE_VSYNC}, B_CMAP8, 640, 400, 0, 0, MODE_FLAGS}, /* 640x400 - www.epanorama.net/documents/pc/vga_timing.html) */ -{ { 25175, 640, 656, 752, 800, 480, 490, 492, 525, 0}, B_CMAP8, 640, 480, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 60Hz_(640X480X8.Z1) */ -{ { 27500, 640, 672, 768, 864, 480, 488, 494, 530, 0}, B_CMAP8, 640, 480, 0, 0, MODE_FLAGS}, /* 640X480X60Hz */ -{ { 30500, 640, 672, 768, 864, 480, 517, 523, 588, 0}, B_CMAP8, 640, 480, 0, 0, MODE_FLAGS}, /* SVGA_640X480X60HzNI */ -{ { 31500, 640, 664, 704, 832, 480, 489, 492, 520, 0}, B_CMAP8, 640, 480, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 70-72Hz_(640X480X8.Z1) */ -{ { 31500, 640, 656, 720, 840, 480, 481, 484, 500, 0}, B_CMAP8, 640, 480, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 75Hz_(640X480X8.Z1) */ -{ { 36000, 640, 696, 752, 832, 480, 481, 484, 509, 0}, B_CMAP8, 640, 480, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 85Hz_(640X480X8.Z1) */ -{ { 38100, 800, 832, 960, 1088, 600, 602, 606, 620, 0}, B_CMAP8, 800, 600, 0, 0, MODE_FLAGS}, /* SVGA_800X600X56HzNI */ -{ { 40000, 800, 840, 968, 1056, 600, 601, 605, 628, T_POSITIVE_SYNC}, B_CMAP8, 800, 600, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 60Hz_(800X600X8.Z1) */ -{ { 49500, 800, 816, 896, 1056, 600, 601, 604, 625, T_POSITIVE_SYNC}, B_CMAP8, 800, 600, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 75Hz_(800X600X8.Z1) */ -{ { 50000, 800, 856, 976, 1040, 600, 637, 643, 666, T_POSITIVE_SYNC}, B_CMAP8, 800, 600, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 70-72Hz_(800X600X8.Z1) */ -{ { 56250, 800, 832, 896, 1048, 600, 601, 604, 631, T_POSITIVE_SYNC}, B_CMAP8, 800, 600, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 85Hz_(800X600X8.Z1) */ -{ { 65000, 1024, 1048, 1184, 1344, 768, 771, 777, 806, 0}, B_CMAP8, 1024, 768, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 60Hz_(1024X768X8.Z1) */ -{ { 75000, 1024, 1048, 1184, 1328, 768, 771, 777, 806, 0}, B_CMAP8, 1024, 768, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 70-72Hz_(1024X768X8.Z1) */ -{ { 78750, 1024, 1040, 1136, 1312, 768, 769, 772, 800, T_POSITIVE_SYNC}, B_CMAP8, 1024, 768, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 75Hz_(1024X768X8.Z1) */ -{ { 94500, 1024, 1072, 1168, 1376, 768, 769, 772, 808, T_POSITIVE_SYNC}, B_CMAP8, 1024, 768, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 85Hz_(1024X768X8.Z1) */ -{ { 94200, 1152, 1184, 1280, 1472, 864, 865, 868, 914, T_POSITIVE_SYNC}, B_CMAP8, 1152, 864, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 70Hz_(1152X864X8.Z1) */ -{ { 108000, 1152, 1216, 1344, 1600, 864, 865, 868, 900, T_POSITIVE_SYNC}, B_CMAP8, 1152, 864, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 75Hz_(1152X864X8.Z1) */ -{ { 121500, 1152, 1216, 1344, 1568, 864, 865, 868, 911, T_POSITIVE_SYNC}, B_CMAP8, 1152, 864, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 85Hz_(1152X864X8.Z1) */ -{ { 108000, 1280, 1328, 1440, 1688, 1024, 1025, 1028, 1066, T_POSITIVE_SYNC}, B_CMAP8, 1280, 1024, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 60Hz_(1280X1024X8.Z1) */ -{ { 135000, 1280, 1296, 1440, 1688, 1024, 1025, 1028, 1066, T_POSITIVE_SYNC}, B_CMAP8, 1280, 1024, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 75Hz_(1280X1024X8.Z1) */ -{ { 157500, 1280, 1344, 1504, 1728, 1024, 1025, 1028, 1072, T_POSITIVE_SYNC}, B_CMAP8, 1280, 1024, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 85Hz_(1280X1024X8.Z1) */ -{ { 162000, 1600, 1664, 1856, 2160, 1200, 1201, 1204, 1250, T_POSITIVE_SYNC}, B_CMAP8, 1600, 1200, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 60Hz_(1600X1200X8.Z1) */ -{ { 175500, 1600, 1664, 1856, 2160, 1200, 1201, 1204, 1250, T_POSITIVE_SYNC}, B_CMAP8, 1600, 1200, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 65Hz_(1600X1200X8.Z1) */ -{ { 189000, 1600, 1664, 1856, 2160, 1200, 1201, 1204, 1250, T_POSITIVE_SYNC}, B_CMAP8, 1600, 1200, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 70Hz_(1600X1200X8.Z1) */ -{ { 202500, 1600, 1664, 1856, 2160, 1200, 1201, 1204, 1250, T_POSITIVE_SYNC}, B_CMAP8, 1600, 1200, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 75Hz_(1600X1200X8.Z1) */ -{ { 216000, 1600, 1664, 1856, 2160, 1200, 1201, 1204, 1250, T_POSITIVE_SYNC}, B_CMAP8, 1600, 1200, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 80Hz_(1600X1200X8.Z1) */ -{ { 229500, 1600, 1664, 1856, 2160, 1200, 1201, 1204, 1250, T_POSITIVE_SYNC}, B_CMAP8, 1600, 1200, 0, 0, MODE_FLAGS} /* Vesa_Monitor_ at 85Hz_(1600X1200X8.Z1) */ -}; -static const uint32 kNumBaseModes = sizeof(kBaseModeList) / sizeof(display_mode); -static const uint32 kMaxNumModes = kNumBaseModes * 4; - - -/** Creates the initial mode list of the primary accelerant. - * It's called from vesa_init_accelerant(). - */ - +/*! Creates the initial mode list of the primary accelerant. + It's called from vesa_init_accelerant(). +*/ status_t create_mode_list(void) { // ToDo: basically, the boot loader should pass a list of all supported // VESA modes to us. - color_space spaces[4] = {B_RGB32_LITTLE, B_RGB16_LITTLE, B_RGB15_LITTLE, B_CMAP8}; - size_t size = ROUND_TO_PAGE_SIZE(kMaxNumModes * sizeof(display_mode)); - display_mode *list; - - gInfo->mode_list_area = create_area("vesa modes", (void **)&list, B_ANY_ADDRESS, - size, B_NO_LOCK, B_READ_AREA | B_WRITE_AREA); + + gInfo->mode_list_area = create_display_modes("vesa modes", NULL, NULL, 0, + NULL, 0, NULL, &gInfo->mode_list, &gInfo->shared_info->mode_count); if (gInfo->mode_list_area < B_OK) return gInfo->mode_list_area; - // for now, just copy all of the modes with different color spaces - - const display_mode *source = kBaseModeList; - uint32 count = 0; - - for (uint32 i = 0; i < kNumBaseModes; i++) { - for (uint32 j = 0; j < (sizeof(spaces) / sizeof(color_space)); j++) { - list[count] = *source; - list[count].space = spaces[j]; - - count++; - } - - source++; - } - - gInfo->mode_list = list; gInfo->shared_info->mode_list_area = gInfo->mode_list_area; - gInfo->shared_info->mode_count = count; - return B_OK; } @@ -153,23 +95,6 @@ // ToDo: unless we have a VBE3 device, we can't change the display mode return B_UNSUPPORTED; -#if 0 - gInfo->shared_info->current_mode = mode; - - switch (mode.space) { - case B_RGB32_LITTLE: - gInfo->shared_info->bytes_per_row = mode.virtual_width * 4; - break; - case B_RGB16_LITTLE: - case B_RGB15_LITTLE: - gInfo->shared_info->bytes_per_row = mode.virtual_width * 2; - break; - case B_CMAP8: - gInfo->shared_info->bytes_per_row = mode.virtual_width; - break; - } - return B_OK; -#endif } From bga at bug-br.org.br Sat Mar 1 19:10:33 2008 From: bga at bug-br.org.br (Bruno Albuquerque) Date: Sat, 01 Mar 2008 15:10:33 -0300 Subject: [Haiku-commits] r24189 - haiku/trunk/src/add-ons/accelerants/common In-Reply-To: <200803011723.m21HNfQ8011914@sheep.berlios.de> References: <200803011723.m21HNfQ8011914@sheep.berlios.de> Message-ID: <47C99C19.5050504@bug-br.org.br> axeld at BerliOS escreveu: > Added modes for 1270x720 and 1400x1050 to the generic mode list. How about adding 1680x1050? That?s my monitor?s natove resolution. :) -Bruno From mmu_man at mail.berlios.de Sat Mar 1 19:46:21 2008 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Sat, 1 Mar 2008 19:46:21 +0100 Subject: [Haiku-commits] r24191 - haiku/trunk/src/apps/expander Message-ID: <200803011846.m21IkLhC004436@sheep.berlios.de> Author: mmu_man Date: 2008-03-01 19:46:20 +0100 (Sat, 01 Mar 2008) New Revision: 24191 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24191&view=rev Modified: haiku/trunk/src/apps/expander/ExpanderThread.cpp Log: lower the command priority since it is a background task. Modified: haiku/trunk/src/apps/expander/ExpanderThread.cpp =================================================================== --- haiku/trunk/src/apps/expander/ExpanderThread.cpp 2008-03-01 17:27:20 UTC (rev 24190) +++ haiku/trunk/src/apps/expander/ExpanderThread.cpp 2008-03-01 18:46:20 UTC (rev 24191) @@ -73,6 +73,9 @@ if (fThreadId < 0) return fThreadId; + // lower the command priority since it is a background task. + set_thread_priority(fThreadId, B_LOW_PRIORITY); + resume_thread(fThreadId); fExpanderOutput = fdopen(fStdOut, "r"); From anevilyak at gmail.com Sat Mar 1 20:05:56 2008 From: anevilyak at gmail.com (Rene Gollent) Date: Sat, 1 Mar 2008 13:05:56 -0600 Subject: [Haiku-commits] r24189 - haiku/trunk/src/add-ons/accelerants/common In-Reply-To: <47C99C19.5050504@bug-br.org.br> References: <200803011723.m21HNfQ8011914@sheep.berlios.de> <47C99C19.5050504@bug-br.org.br> Message-ID: 1680x1050 shows up in Screen prefs here? Rene On Sat, Mar 1, 2008 at 12:10 PM, Bruno Albuquerque wrote: > axeld at BerliOS escreveu: > > > > Added modes for 1270x720 and 1400x1050 to the generic mode list. > > How about adding 1680x1050? That?s my monitor?s natove resolution. :) > > -Bruno > > > > _______________________________________________ > Haiku-commits mailing list > Haiku-commits at lists.berlios.de > https://lists.berlios.de/mailman/listinfo/haiku-commits > From axeld at pinc-software.de Sat Mar 1 21:25:27 2008 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Sat, 01 Mar 2008 21:25:27 +0100 CET Subject: [Haiku-commits] =?iso-8859-15?q?r24189_-_haiku/trunk/src/add-ons/?= =?iso-8859-15?q?accelerants/common?= In-Reply-To: <47C99C19.5050504@bug-br.org.br> Message-ID: <38841923038-BeMail@zon> Bruno Albuquerque wrote: > axeld at BerliOS escreveu: > > Added modes for 1270x720 and 1400x1050 to the generic mode list. > How about adding 1680x1050? Thats my monitors natove resolution. :) That's already in that list - if it doesn't show up in VESA mode, your BIOS obviously does not support it. Bye, Axel.  From axeld at pinc-software.de Sat Mar 1 21:34:20 2008 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Sat, 01 Mar 2008 21:34:20 +0100 CET Subject: [Haiku-commits] r24175 - haiku/trunk/headers/private/interface In-Reply-To: <894b9700803010526o359efdb5ne1300e95aafe224e@mail.gmail.com> Message-ID: <39374470108-BeMail@zon> "Stefano Ceccherini" wrote: > 2008/2/29, Michael Lotz : > > http://svn.berlios.de/viewcvs/*checkout*/haiku/haiku/trunk/data/etc/KanBe/default/.canna?rev=13558 > > > > > It is encoded in EUC-JP. > Is bug #1735 related in any way to this ? I don't think so, at least I doubt that StyledEdit would automatically recognize that encoding - you might be able to select it afterwards, but that I don't know :-) Maybe we should just try to integrate this stuff?? :) Bye, Axel. From mmu_man at mail.berlios.de Sat Mar 1 22:24:48 2008 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Sat, 1 Mar 2008 22:24:48 +0100 Subject: [Haiku-commits] r24192 - in haiku/trunk/src/system/libroot/posix: glibc/misc stdlib Message-ID: <200803012124.m21LOm1Z018004@sheep.berlios.de> Author: mmu_man Date: 2008-03-01 22:24:48 +0100 (Sat, 01 Mar 2008) New Revision: 24192 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24192&view=rev Added: haiku/trunk/src/system/libroot/posix/glibc/misc/efgcvt.c haiku/trunk/src/system/libroot/posix/glibc/misc/efgcvt_r.c Removed: haiku/trunk/src/system/libroot/posix/stdlib/gcvt.c Modified: haiku/trunk/src/system/libroot/posix/glibc/misc/Jamfile haiku/trunk/src/system/libroot/posix/stdlib/Jamfile Log: Copied [efg]cvt() and *cvt_r() from glibc 2.3.2, this gets cdrecord running. Btw, why do we have _G_config.h in 2 places ? Modified: haiku/trunk/src/system/libroot/posix/glibc/misc/Jamfile =================================================================== --- haiku/trunk/src/system/libroot/posix/glibc/misc/Jamfile 2008-03-01 18:46:20 UTC (rev 24191) +++ haiku/trunk/src/system/libroot/posix/glibc/misc/Jamfile 2008-03-01 21:24:48 UTC (rev 24192) @@ -4,7 +4,7 @@ $(TARGET_ARCH) ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include arch generic ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include ; -#SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc libio ; +SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc libio ; #SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc wcsmbs ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc misc ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc locale ; @@ -14,4 +14,6 @@ MergeObject posix_gnu_misc.o : tsearch.c + efgcvt.c + efgcvt_r.c ; Added: haiku/trunk/src/system/libroot/posix/glibc/misc/efgcvt.c =================================================================== --- haiku/trunk/src/system/libroot/posix/glibc/misc/efgcvt.c 2008-03-01 18:46:20 UTC (rev 24191) +++ haiku/trunk/src/system/libroot/posix/glibc/misc/efgcvt.c 2008-03-01 21:24:48 UTC (rev 24192) @@ -0,0 +1,104 @@ +/* Compatibility functions for floating point formatting. + Copyright (C) 1995, 1996, 1997, 1999, 2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include +#include +#include +#include +#include +#include + +#ifndef FLOAT_TYPE +# define FLOAT_TYPE double +# define FUNC_PREFIX +# define FLOAT_FMT_FLAG +/* Actually we have to write (DBL_DIG + log10 (DBL_MAX_10_EXP)) but we + don't have log10 available in the preprocessor. */ +# define MAXDIG (NDIGIT_MAX + 3) +# define FCVT_MAXDIG (DBL_MAX_10_EXP + MAXDIG) +# if DBL_MANT_DIG == 53 +# define NDIGIT_MAX 17 +# elif DBL_MANT_DIG == 24 +# define NDIGIT_MAX 9 +# elif DBL_MANT_DIG == 56 +# define NDIGIT_MAX 18 +# else +/* See IEEE 854 5.6, table 2 for this formula. Unfortunately we need a + compile time constant here, so we cannot use it. */ +# error "NDIGIT_MAX must be precomputed" +# define NDIGIT_MAX (lrint (ceil (M_LN2 / M_LN10 * DBL_MANT_DIG + 1.0))) +# endif +#endif + +#define APPEND(a, b) APPEND2 (a, b) +#define APPEND2(a, b) a##b + + +#define FCVT_BUFFER APPEND (FUNC_PREFIX, fcvt_buffer) +#define FCVT_BUFPTR APPEND (FUNC_PREFIX, fcvt_bufptr) +#define ECVT_BUFFER APPEND (FUNC_PREFIX, ecvt_buffer) + + +static char FCVT_BUFFER[MAXDIG]; +static char ECVT_BUFFER[MAXDIG]; +libc_freeres_ptr (static char *FCVT_BUFPTR); + +char * +APPEND (FUNC_PREFIX, fcvt) (value, ndigit, decpt, sign) + FLOAT_TYPE value; + int ndigit, *decpt, *sign; +{ + if (FCVT_BUFPTR == NULL) + { + if (APPEND (FUNC_PREFIX, fcvt_r) (value, ndigit, decpt, sign, + FCVT_BUFFER, MAXDIG) != -1) + return FCVT_BUFFER; + + FCVT_BUFPTR = (char *) malloc (FCVT_MAXDIG); + if (FCVT_BUFPTR == NULL) + return FCVT_BUFFER; + } + + (void) APPEND (FUNC_PREFIX, fcvt_r) (value, ndigit, decpt, sign, + FCVT_BUFPTR, FCVT_MAXDIG); + + return FCVT_BUFPTR; +} + + +char * +APPEND (FUNC_PREFIX, ecvt) (value, ndigit, decpt, sign) + FLOAT_TYPE value; + int ndigit, *decpt, *sign; +{ + (void) APPEND (FUNC_PREFIX, ecvt_r) (value, ndigit, decpt, sign, + ECVT_BUFFER, MAXDIG); + + return ECVT_BUFFER; +} + +char * +APPEND (FUNC_PREFIX, gcvt) (value, ndigit, buf) + FLOAT_TYPE value; + int ndigit; + char *buf; +{ + sprintf (buf, "%.*" FLOAT_FMT_FLAG "g", MIN (ndigit, NDIGIT_MAX), value); + return buf; +} Added: haiku/trunk/src/system/libroot/posix/glibc/misc/efgcvt_r.c =================================================================== --- haiku/trunk/src/system/libroot/posix/glibc/misc/efgcvt_r.c 2008-03-01 18:46:20 UTC (rev 24191) +++ haiku/trunk/src/system/libroot/posix/glibc/misc/efgcvt_r.c 2008-03-01 21:24:48 UTC (rev 24192) @@ -0,0 +1,216 @@ +/* Compatibility functions for floating point formatting, reentrant versions. + Copyright (C) 1995,96,97,98,99,2000,01,02 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef FLOAT_TYPE +# define FLOAT_TYPE double +# define FUNC_PREFIX +# define FLOAT_FMT_FLAG +# define FLOAT_NAME_EXT +# if DBL_MANT_DIG == 53 +# define NDIGIT_MAX 17 +# elif DBL_MANT_DIG == 24 +# define NDIGIT_MAX 9 +# elif DBL_MANT_DIG == 56 +# define NDIGIT_MAX 18 +# else +/* See IEEE 854 5.6, table 2 for this formula. Unfortunately we need a + compile time constant here, so we cannot use it. */ +# error "NDIGIT_MAX must be precomputed" +# define NDIGIT_MAX (lrint (ceil (M_LN2 / M_LN10 * DBL_MANT_DIG + 1.0))) +# endif +#endif + +#define APPEND(a, b) APPEND2 (a, b) +#define APPEND2(a, b) a##b + +#define FLOOR APPEND(floor, FLOAT_NAME_EXT) +#define FABS APPEND(fabs, FLOAT_NAME_EXT) +#define LOG10 APPEND(log10, FLOAT_NAME_EXT) +#define EXP APPEND(exp, FLOAT_NAME_EXT) + + +int +APPEND (FUNC_PREFIX, fcvt_r) (value, ndigit, decpt, sign, buf, len) + FLOAT_TYPE value; + int ndigit, *decpt, *sign; + char *buf; + size_t len; +{ + ssize_t n; + ssize_t i; + int left; + + if (buf == NULL) + { + __set_errno (EINVAL); + return -1; + } + + left = 0; + if (isfinite (value)) + { + *sign = signbit (value) != 0; + if (*sign) + value = -value; + + if (ndigit < 0) + { + /* Rounding to the left of the decimal point. */ + while (ndigit < 0) + { + FLOAT_TYPE new_value = value * 0.1; + + if (new_value < 1.0) + { + ndigit = 0; + break; + } + + value = new_value; + ++left; + ++ndigit; + } + } + } + else + /* Value is Inf or NaN. */ + *sign = 0; + + n = __snprintf (buf, len, "%.*" FLOAT_FMT_FLAG "f", MIN (ndigit, NDIGIT_MAX), + value); + /* Check for a too small buffer. */ + if (n >= (ssize_t) len) + return -1; + + i = 0; + while (i < n && isdigit (buf[i])) + ++i; + *decpt = i; + + if (i == 0) + /* Value is Inf or NaN. */ + return 0; + + if (i < n) + { + do + ++i; + while (i < n && !isdigit (buf[i])); + + if (*decpt == 1 && buf[0] == '0' && value != 0.0) + { + /* We must not have leading zeroes. Strip them all out and + adjust *DECPT if necessary. */ + --*decpt; + while (i < n && buf[i] == '0') + { + --*decpt; + ++i; + } + } + + memmove (&buf[MAX (*decpt, 0)], &buf[i], n - i); + buf[n - (i - MAX (*decpt, 0))] = '\0'; + } + + if (left) + { + *decpt += left; + if ((ssize_t) --len > n) + { + while (left-- > 0 && n < (ssize_t) len) + buf[n++] = '0'; + buf[n] = '\0'; + } + } + + return 0; +} +libc_hidden_def (APPEND (FUNC_PREFIX, fcvt_r)) + +int +APPEND (FUNC_PREFIX, ecvt_r) (value, ndigit, decpt, sign, buf, len) + FLOAT_TYPE value; + int ndigit, *decpt, *sign; + char *buf; + size_t len; +{ + int exponent = 0; + + if (isfinite (value) && value != 0.0) + { + /* Slow code that doesn't require -lm functions. */ + FLOAT_TYPE d; + FLOAT_TYPE f = 1.0; + if (value < 0.0) + d = -value; + else + d = value; + if (d < 1.0) + { + do + { + f *= 10.0; + --exponent; + } + while (d * f < 1.0); + + value *= f; + } + else if (d >= 10.0) + { + do + { + f *= 10; + ++exponent; + } + while (d >= f * 10.0); + + value /= f; + } + } + else if (value == 0.0) + /* SUSv2 leaves it unspecified whether *DECPT is 0 or 1 for 0.0. + This could be changed to -1 if we want to return 0. */ + exponent = 0; + + if (ndigit <= 0 && len > 0) + { + buf[0] = '\0'; + *decpt = 1; + *sign = isfinite (value) ? signbit (value) != 0 : 0; + } + else + if (APPEND (FUNC_PREFIX, fcvt_r) (value, MIN (ndigit, NDIGIT_MAX) - 1, + decpt, sign, buf, len)) + return -1; + + *decpt += exponent; + return 0; +} +libc_hidden_def (APPEND (FUNC_PREFIX, ecvt_r)) Modified: haiku/trunk/src/system/libroot/posix/stdlib/Jamfile =================================================================== --- haiku/trunk/src/system/libroot/posix/stdlib/Jamfile 2008-03-01 18:46:20 UTC (rev 24191) +++ haiku/trunk/src/system/libroot/posix/stdlib/Jamfile 2008-03-01 21:24:48 UTC (rev 24192) @@ -12,7 +12,6 @@ div.c env.c exit.c - gcvt.c heapsort.c merge.c mktemp.c Deleted: haiku/trunk/src/system/libroot/posix/stdlib/gcvt.c From jackburton at mail.berlios.de Sat Mar 1 23:15:30 2008 From: jackburton at mail.berlios.de (jackburton at BerliOS) Date: Sat, 1 Mar 2008 23:15:30 +0100 Subject: [Haiku-commits] r24193 - in haiku/trunk: headers/os/interface src/kits/interface Message-ID: <200803012215.m21MFU40022335@sheep.berlios.de> Author: jackburton Date: 2008-03-01 23:15:23 +0100 (Sat, 01 Mar 2008) New Revision: 24193 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24193&view=rev Modified: haiku/trunk/headers/os/interface/Menu.h haiku/trunk/src/kits/interface/Menu.cpp Log: Applied patch by Denis Washington which implements "diagonal mouse support" for menus (see ticket #284). Thanks a lot! Modified: haiku/trunk/headers/os/interface/Menu.h =================================================================== --- haiku/trunk/headers/os/interface/Menu.h 2008-03-01 21:24:48 UTC (rev 24192) +++ haiku/trunk/headers/os/interface/Menu.h 2008-03-01 22:15:23 UTC (rev 24193) @@ -180,8 +180,13 @@ void _Hide(); BMenuItem* _Track(int* action, long start = -1); + void _UpdateNavigationArea(BPoint position, + BRect& navAreaRectAbove, BRect& navAreaBelow); + void _UpdateStateOpenSelect(BMenuItem* item, - bigtime_t& openTime, const int32 &mouseSpeed); + BPoint position, BRect& navAreaRectAbove, + BRect& navAreaBelow, bigtime_t& selectedTime, + bigtime_t& navigationAreaTime); void _UpdateStateClose(BMenuItem* item, const BPoint& where, const uint32& buttons); Modified: haiku/trunk/src/kits/interface/Menu.cpp =================================================================== --- haiku/trunk/src/kits/interface/Menu.cpp 2008-03-01 21:24:48 UTC (rev 24192) +++ haiku/trunk/src/kits/interface/Menu.cpp 2008-03-01 22:15:23 UTC (rev 24193) @@ -1384,6 +1384,8 @@ } +const static bigtime_t kOpenSubmenuDelay = 225000; +const static bigtime_t kNavigationAreaTimeout = 1000000; const static bigtime_t kHysteresis = 200000; // TODO: Test and reduce if needed. const static int32 kMouseMotionThreshold = 15; // TODO: Same as above. Actually, we could get rid of the kHysteresis @@ -1394,8 +1396,10 @@ { // TODO: cleanup BMenuItem *item = NULL; - bigtime_t openTime = system_time(); - + BRect navAreaRectAbove, navAreaRectBelow; + bigtime_t selectedTime = system_time(); + bigtime_t navigationAreaTime = 0; + fState = MENU_STATE_TRACKING; if (fSuper != NULL) fSuper->fState = MENU_STATE_TRACKING_SUBMENU; @@ -1432,6 +1436,9 @@ bool overSub = _OverSubmenu(fSelected, screenLocation); item = _HitTestItems(location, B_ORIGIN); if (overSub) { + navAreaRectAbove = BRect(); + navAreaRectBelow = BRect(); + // Since the submenu has its own looper, // we can unlock ours. Doing so also make sure // that our window gets any update message to @@ -1453,7 +1460,8 @@ if (!LockLooper()) break; } else if (item != NULL) { - _UpdateStateOpenSelect(item, openTime, mouseSpeed); + _UpdateStateOpenSelect(item, location, navAreaRectAbove, + navAreaRectBelow, selectedTime, navigationAreaTime); if (!releasedOnce) releasedOnce = true; } else if (_OverSuper(screenLocation)) { @@ -1528,26 +1536,164 @@ void -BMenu::_UpdateStateOpenSelect(BMenuItem* item, bigtime_t& openTime, - const int32 &mouseSpeed) +BMenu::_UpdateNavigationArea(BPoint position, BRect& navAreaRectAbove, + BRect& navAreaRectBelow) { +#define NAV_AREA_THRESHOLD 8 + + // The navigation area is a region in which mouse-overs won't select + // the item under the cursor. This makes it easier to navigate to + // submenus, as the cursor can be moved to submenu items directly instead + // of having to move it horizontally into the submenu first. The concept + // is illustrated below: + // + // +-------+----+---------+ + // | | /| | + // | | /*| | + // |[2]--> | /**| | + // | |/[4]| | + // |------------| | + // | [1] | [6] | + // |------------| | + // | |\[5]| | + // |[3]--> | \**| | + // | | \*| | + // | | \| | + // | +----|---------+ + // | | + // +------------+ + // + // [1] Selected item, cursor position ('position') + // [2] Upper navigation area rectangle ('navAreaRectAbove') + // [3] Lower navigation area rectangle ('navAreaRectBelow') + // [4] Upper navigation area + // [5] Lower navigation area + // [6] Submenu + // + // The rectangles are used to calculate if the cursor is in the actual + // navigation area (see _UpdateStateOpenSelect()). + + if (fSelected == NULL) + return; + + BMenu *submenu = fSelected->Submenu(); + + if (submenu != NULL) { + BRect menuBounds = ConvertToScreen(Bounds()); + + fSelected->Submenu()->LockLooper(); + BRect submenuBounds = fSelected->Submenu()->ConvertToScreen( + fSelected->Submenu()->Bounds()); + fSelected->Submenu()->UnlockLooper(); + + if (menuBounds.left < submenuBounds.left) { + navAreaRectAbove.Set(position.x + NAV_AREA_THRESHOLD, + submenuBounds.top, menuBounds.right, + position.y); + navAreaRectBelow.Set(position.x + NAV_AREA_THRESHOLD, + position.y, menuBounds.right, + submenuBounds.bottom); + } else { + navAreaRectAbove.Set(menuBounds.left, + submenuBounds.top, position.x - NAV_AREA_THRESHOLD, + position.y); + navAreaRectBelow.Set(menuBounds.left, + position.y, position.x - NAV_AREA_THRESHOLD, + submenuBounds.bottom); + } + } else { + navAreaRectAbove = BRect(); + navAreaRectBelow = BRect(); + } +} + +void +BMenu::_UpdateStateOpenSelect(BMenuItem* item, BPoint position, + BRect& navAreaRectAbove, BRect& navAreaRectBelow, bigtime_t& selectedTime, + bigtime_t& navigationAreaTime) +{ if (fState == MENU_STATE_CLOSED) return; + if (item != fSelected) { - if (mouseSpeed < kMouseMotionThreshold) { + if (navigationAreaTime == 0) + navigationAreaTime = system_time(); + + position = ConvertToScreen(position); + + bool inNavAreaRectAbove = navAreaRectAbove.Contains(position); + bool inNavAreaRectBelow = navAreaRectBelow.Contains(position); + + if (!inNavAreaRectAbove && !inNavAreaRectBelow) { _SelectItem(item, false); - openTime = system_time(); + navAreaRectAbove = BRect(); + navAreaRectBelow = BRect(); + selectedTime = system_time(); + navigationAreaTime = 0; + return; + } + + BRect menuBounds = ConvertToScreen(Bounds()); + + fSelected->Submenu()->LockLooper(); + BRect submenuBounds = fSelected->Submenu()->ConvertToScreen( + fSelected->Submenu()->Bounds()); + fSelected->Submenu()->UnlockLooper(); + + float x_offset; + + // navAreaRectAbove and navAreaRectBelow have the same X + // position and width, so it doesn't matter which one we use to + // calculate the X offset + if (menuBounds.left < submenuBounds.left) + x_offset = position.x - navAreaRectAbove.left; + else + x_offset = navAreaRectAbove.right - position.x; + + bool inNavArea; + + if (inNavAreaRectAbove) { + float y_offset = navAreaRectAbove.bottom - position.y; + float ratio = navAreaRectAbove.Width() / navAreaRectAbove.Height(); + + inNavArea = y_offset <= x_offset / ratio; } else { - //printf("Mouse moving too fast (%ld), ignoring...\n", mouseSpeed); + float y_offset = navAreaRectBelow.bottom - position.y; + float ratio = navAreaRectBelow.Width() / navAreaRectBelow.Height(); + + inNavArea = y_offset >= (navAreaRectBelow.Height() - x_offset / ratio); } - } else if (system_time() > kHysteresis + openTime && item->Submenu() != NULL - && item->Submenu()->Window() == NULL) { - // Open the submenu if it's not opened yet, but only if - // the mouse pointer stayed over there for some time - // (hysteresis) - _SelectItem(item); + + bigtime_t systime = system_time(); + + if (!inNavArea || (navigationAreaTime > 0 && systime - + navigationAreaTime > kNavigationAreaTimeout)) { + // Don't delay opening of submenu if the user had + // to wait for the navigation area timeout anyway + _SelectItem(item, inNavArea); + + if (inNavArea) { + _UpdateNavigationArea(position, navAreaRectAbove, + navAreaRectBelow); + } else { + navAreaRectAbove = BRect(); + navAreaRectBelow = BRect(); + } + + selectedTime = system_time(); + navigationAreaTime = 0; + } + } else if (fSelected->Submenu() != NULL && + system_time() - selectedTime > kOpenSubmenuDelay) { + _SelectItem(fSelected, true); + + if (!navAreaRectAbove.IsValid() && !navAreaRectBelow.IsValid()) { + position = ConvertToScreen(position); + _UpdateNavigationArea(position, navAreaRectAbove, navAreaRectBelow); + } } + if (fState != MENU_STATE_TRACKING) fState = MENU_STATE_TRACKING; } @@ -1561,9 +1707,14 @@ return; if (buttons != 0 && _IsStickyMode()) { - if (item == NULL) + if (item == NULL) { + if (item != fSelected) { + LockLooper(); + _SelectItem(item, false); + UnlockLooper(); + } fState = MENU_STATE_CLOSED; - else + } else _SetStickyMode(false); } else if (buttons == 0 && !_IsStickyMode()) { if (fExtraRect != NULL && fExtraRect->Contains(where)) { @@ -1571,8 +1722,14 @@ fExtraRect = NULL; // Setting this to NULL will prevent this code // to be executed next time - } else + } else { + if (item != fSelected) { + LockLooper(); + _SelectItem(item, false); + UnlockLooper(); + } fState = MENU_STATE_CLOSED; + } } } From jackburton at mail.berlios.de Sat Mar 1 23:17:43 2008 From: jackburton at mail.berlios.de (jackburton at BerliOS) Date: Sat, 1 Mar 2008 23:17:43 +0100 Subject: [Haiku-commits] r24194 - haiku/trunk/src/apps/aboutsystem Message-ID: <200803012217.m21MHh4h022478@sheep.berlios.de> Author: jackburton Date: 2008-03-01 23:17:42 +0100 (Sat, 01 Mar 2008) New Revision: 24194 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24194&view=rev Modified: haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp Log: Added Denis Washington to the contributors' list. Modified: haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp =================================================================== --- haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp 2008-03-01 22:15:23 UTC (rev 24193) +++ haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp 2008-03-01 22:17:42 UTC (rev 24194) @@ -453,6 +453,7 @@ "Oliver Tappe\n" "Jason Vandermark\n" "Sandor Vroemisse\n" + "Denis Washington\n" "Nathan Whitehorn\n" "Michael Wilber\n" "Ulrich Wimboeck\n" From koki at digintrans.com Sat Mar 1 22:45:57 2008 From: koki at digintrans.com (Jorge G. Mare (a.k.a. Koki)) Date: Sat, 01 Mar 2008 13:45:57 -0800 Subject: [Haiku-commits] r24175 - haiku/trunk/headers/private/interface In-Reply-To: <39374470108-BeMail@zon> References: <39374470108-BeMail@zon> Message-ID: <47C9CE95.8000308@digintrans.com> Axel D?rfler wrote: > "Stefano Ceccherini" wrote: >> 2008/2/29, Michael Lotz : >>> http://svn.berlios.de/viewcvs/*checkout*/haiku/haiku/trunk/data/etc/KanBe/default/.canna?rev=13558 >>>>> > It is encoded in EUC-JP. >> Is bug #1735 related in any way to this ? > > I don't think so, at least I doubt that StyledEdit would automatically > recognize that encoding - you might be able to select it afterwards, > but that I don't know :-) Per the screenshot linked below, the file open dialog in StyledEdit has an Encoding menu where you can select the encoding that you want to apply when opening a file: http://myhaiku.org/haiku/2008-03-29_se-encoding.png > Maybe we should just try to integrate this stuff?? :) It would be nice if StyledEdit automatically detected and used the right encoding of the text file it is opening. There is an editor for BeOS called KEdit which does exactly that, and may be a good reference. You can find binary and sources here: http://www.bebits.com/app/1323 FWIW Koki From marcusoverhagen at mail.berlios.de Sat Mar 1 23:33:38 2008 From: marcusoverhagen at mail.berlios.de (marcusoverhagen at BerliOS) Date: Sat, 1 Mar 2008 23:33:38 +0100 Subject: [Haiku-commits] r24195 - haiku/trunk/src/add-ons/media/media-add-ons/videowindow Message-ID: <200803012233.m21MXbDT023870@sheep.berlios.de> Author: marcusoverhagen Date: 2008-03-01 23:33:37 +0100 (Sat, 01 Mar 2008) New Revision: 24195 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24195&view=rev Modified: haiku/trunk/src/add-ons/media/media-add-ons/videowindow/VideoAddOn.cpp haiku/trunk/src/add-ons/media/media-add-ons/videowindow/VideoAddOn.h haiku/trunk/src/add-ons/media/media-add-ons/videowindow/VideoNode.cpp haiku/trunk/src/add-ons/media/media-add-ons/videowindow/VideoNode.h haiku/trunk/src/add-ons/media/media-add-ons/videowindow/VideoView.cpp haiku/trunk/src/add-ons/media/media-add-ons/videowindow/VideoView.h haiku/trunk/src/add-ons/media/media-add-ons/videowindow/VideoWindow.cpp haiku/trunk/src/add-ons/media/media-add-ons/videowindow/VideoWindow.h Log: Changed the license from GPL to MIT on request by Maurice. I'm the sole author of this code. Modified: haiku/trunk/src/add-ons/media/media-add-ons/videowindow/VideoAddOn.cpp =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/videowindow/VideoAddOn.cpp 2008-03-01 22:17:42 UTC (rev 24194) +++ haiku/trunk/src/add-ons/media/media-add-ons/videowindow/VideoAddOn.cpp 2008-03-01 22:33:37 UTC (rev 24195) @@ -1,20 +1,6 @@ /* - * VideoAddOn.cpp - "Video Window" media add-on. + * Copyright (C) 2006 Marcus Overhagen . All rights reserved. * - * Copyright (C) 2006 Marcus Overhagen - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * version 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * + * Distributed under the terms of the MIT License. */ #include "VideoAddOn.h" Modified: haiku/trunk/src/add-ons/media/media-add-ons/videowindow/VideoAddOn.h =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/videowindow/VideoAddOn.h 2008-03-01 22:17:42 UTC (rev 24194) +++ haiku/trunk/src/add-ons/media/media-add-ons/videowindow/VideoAddOn.h 2008-03-01 22:33:37 UTC (rev 24195) @@ -1,21 +1,7 @@ /* - * VideoAddOn.h - "Video Window" media add-on. + * Copyright (C) 2006 Marcus Overhagen . All rights reserved. * - * Copyright (C) 2006 Marcus Overhagen - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * version 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * + * Distributed under the terms of the MIT License. */ #ifndef __VIDEO_ADD_ON_H #define __VIDEO_ADD_ON_H Modified: haiku/trunk/src/add-ons/media/media-add-ons/videowindow/VideoNode.cpp =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/videowindow/VideoNode.cpp 2008-03-01 22:17:42 UTC (rev 24194) +++ haiku/trunk/src/add-ons/media/media-add-ons/videowindow/VideoNode.cpp 2008-03-01 22:33:37 UTC (rev 24195) @@ -1,21 +1,7 @@ /* - * VideoNode.cpp - "Video Window" media add-on. + * Copyright (C) 2006 Marcus Overhagen . All rights reserved. * - * Copyright (C) 2006 Marcus Overhagen - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * version 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * + * Distributed under the terms of the MIT License. */ #include #include Modified: haiku/trunk/src/add-ons/media/media-add-ons/videowindow/VideoNode.h =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/videowindow/VideoNode.h 2008-03-01 22:17:42 UTC (rev 24194) +++ haiku/trunk/src/add-ons/media/media-add-ons/videowindow/VideoNode.h 2008-03-01 22:33:37 UTC (rev 24195) @@ -1,21 +1,7 @@ /* - * VideoNode.h - "Video Window" media add-on. + * Copyright (C) 2006 Marcus Overhagen . All rights reserved. * - * Copyright (C) 2006 Marcus Overhagen - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * version 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * + * Distributed under the terms of the MIT License. */ #ifndef __VIDEO_NODE_H_ #define __VIDEO_NODE_H_ Modified: haiku/trunk/src/add-ons/media/media-add-ons/videowindow/VideoView.cpp =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/videowindow/VideoView.cpp 2008-03-01 22:17:42 UTC (rev 24194) +++ haiku/trunk/src/add-ons/media/media-add-ons/videowindow/VideoView.cpp 2008-03-01 22:33:37 UTC (rev 24195) @@ -1,21 +1,7 @@ /* - * VideoView.cpp - "Video Window" media add-on. + * Copyright (C) 2006 Marcus Overhagen . All rights reserved. * - * Copyright (C) 2006 Marcus Overhagen - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * version 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * + * Distributed under the terms of the MIT License. */ #include #include Modified: haiku/trunk/src/add-ons/media/media-add-ons/videowindow/VideoView.h =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/videowindow/VideoView.h 2008-03-01 22:17:42 UTC (rev 24194) +++ haiku/trunk/src/add-ons/media/media-add-ons/videowindow/VideoView.h 2008-03-01 22:33:37 UTC (rev 24195) @@ -1,21 +1,7 @@ /* - * VideoView.h - "Video Window" media add-on. + * Copyright (C) 2006 Marcus Overhagen . All rights reserved. * - * Copyright (C) 2006 Marcus Overhagen - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * version 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * + * Distributed under the terms of the MIT License. */ #ifndef __VIDEO_VIEW_H #define __VIDEO_VIEW_H Modified: haiku/trunk/src/add-ons/media/media-add-ons/videowindow/VideoWindow.cpp =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/videowindow/VideoWindow.cpp 2008-03-01 22:17:42 UTC (rev 24194) +++ haiku/trunk/src/add-ons/media/media-add-ons/videowindow/VideoWindow.cpp 2008-03-01 22:33:37 UTC (rev 24195) @@ -1,21 +1,7 @@ /* - * VideoWindow.cpp - "Video Window" media add-on. + * Copyright (C) 2006 Marcus Overhagen . All rights reserved. * - * Copyright (C) 2006 Marcus Overhagen - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * version 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * + * Distributed under the terms of the MIT License. */ #include "VideoView.h" #include "VideoNode.h" Modified: haiku/trunk/src/add-ons/media/media-add-ons/videowindow/VideoWindow.h =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/videowindow/VideoWindow.h 2008-03-01 22:17:42 UTC (rev 24194) +++ haiku/trunk/src/add-ons/media/media-add-ons/videowindow/VideoWindow.h 2008-03-01 22:33:37 UTC (rev 24195) @@ -1,21 +1,7 @@ /* - * VideoWindow.h - "Video Window" media add-on. + * Copyright (C) 2006 Marcus Overhagen . All rights reserved. * - * Copyright (C) 2006 Marcus Overhagen - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * version 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * + * Distributed under the terms of the MIT License. */ #ifndef __VIDEO_WINDOW_H #define __VIDEO_WINDOW_H From bga at bug-br.org.br Sun Mar 2 00:14:37 2008 From: bga at bug-br.org.br (Bruno Albuquerque) Date: Sat, 01 Mar 2008 20:14:37 -0300 Subject: [Haiku-commits] r24189 - haiku/trunk/src/add-ons/accelerants/common In-Reply-To: References: <200803011723.m21HNfQ8011914@sheep.berlios.de> <47C99C19.5050504@bug-br.org.br> Message-ID: <47C9E35D.8080304@bug-br.org.br> Rene Gollent escreveu: > 1680x1050 shows up in Screen prefs here? That?s because your card is supported. Mine is not so I am using VESA mode. -Bruno From julun at mail.berlios.de Sun Mar 2 01:06:46 2008 From: julun at mail.berlios.de (julun at BerliOS) Date: Sun, 2 Mar 2008 01:06:46 +0100 Subject: [Haiku-commits] r24196 - haiku/trunk/src/kits/app Message-ID: <200803020006.m2206kNl010746@sheep.berlios.de> Author: julun Date: 2008-03-02 01:06:45 +0100 (Sun, 02 Mar 2008) New Revision: 24196 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24196&view=rev Modified: haiku/trunk/src/kits/app/Message.cpp Log: * This fixes ticket #1865 * Allocate the buffer to flatten the message on the heap, if it's size is bigger then a given buffer on the stack. It seem's to exceed the stack size (this might count for AddFlat() too). Note: With this change one is able to copy the text into the clipboard (1mb), but it is still impossible to paste it somewhere, as in BClipboard::_DownloadFromSystem() SendMessage() fails transferring the data back in the reply msg because of the port size limit... Modified: haiku/trunk/src/kits/app/Message.cpp =================================================================== --- haiku/trunk/src/kits/app/Message.cpp 2008-03-01 22:33:37 UTC (rev 24195) +++ haiku/trunk/src/kits/app/Message.cpp 2008-03-02 00:06:45 UTC (rev 24196) @@ -2300,14 +2300,26 @@ copying an extra buffer. Functions can be added that return a direct pointer into the message. */ + char buf[4096] = { 0 }; ssize_t size = message->FlattenedSize(); - char buffer[size]; + bool freeBuffer = false; + char* buffer = NULL; + if (size > (ssize_t)sizeof(buffer)) { + freeBuffer = true; + buffer = static_cast(malloc(size)); + } else { + buffer = buf; + } + status_t error = message->Flatten(buffer, size); if (error >= B_OK) - error = AddData(name, B_MESSAGE_TYPE, &buffer, size, false); + error = AddData(name, B_MESSAGE_TYPE, buffer, size, false); + if (freeBuffer) + free(buffer); + return error; } From marcusoverhagen at arcor.de Sun Mar 2 03:45:18 2008 From: marcusoverhagen at arcor.de (Marcus Overhagen) Date: Sun, 2 Mar 2008 03:45:18 +0100 (CET) Subject: [Haiku-commits] r24196 - haiku/trunk/src/kits/app In-Reply-To: <200803020006.m2206kNl010746@sheep.berlios.de> References: <200803020006.m2206kNl010746@sheep.berlios.de> Message-ID: <16419283.1204425918989.JavaMail.ngmail@webmail16> julun at BerliOS wrote: > > + char buf[4096] = { 0 }; Why are you initializing the buffer with zeroes? > + char* buffer = NULL; Why are you initiazing the pointer? > + if (size > (ssize_t)sizeof(buffer)) { > + freeBuffer = true; > + buffer = static_cast(malloc(size)); You should check for out of memory error here regards Marcs Jetzt komfortabel bei Arcor-Digital TV einsteigen: Mehr Happy Ends, mehr Herzschmerz, mehr Fernsehen! Erleben Sie 50 digitale TV Programme und optional 60 Pay TV Sender, einen elektronischen Programmf?hrer mit Movie Star Bewertungen von TV Movie. Au?erdem, aktuelle Filmhits und prickelnde Erotik in der Arcor-Videothek. Infos unter www.arcor.de/tv From marcusoverhagen at mail.berlios.de Sun Mar 2 03:57:29 2008 From: marcusoverhagen at mail.berlios.de (marcusoverhagen at BerliOS) Date: Sun, 2 Mar 2008 03:57:29 +0100 Subject: [Haiku-commits] r24197 - haiku/trunk/src/apps/mediaplayer Message-ID: <200803020257.m222vTkD001897@sheep.berlios.de> Author: marcusoverhagen Date: 2008-03-02 03:57:28 +0100 (Sun, 02 Mar 2008) New Revision: 24197 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24197&view=rev Modified: haiku/trunk/src/apps/mediaplayer/VideoNode.cpp haiku/trunk/src/apps/mediaplayer/VideoNode.h Log: Changed license from GPL to MIT. I'm the sole author of this code. Modified: haiku/trunk/src/apps/mediaplayer/VideoNode.cpp =================================================================== --- haiku/trunk/src/apps/mediaplayer/VideoNode.cpp 2008-03-02 00:06:45 UTC (rev 24196) +++ haiku/trunk/src/apps/mediaplayer/VideoNode.cpp 2008-03-02 02:57:28 UTC (rev 24197) @@ -1,21 +1,7 @@ /* - * VideoNode.cpp - Media Player for the Haiku Operating System + * Copyright (C) 2006 Marcus Overhagen . All rights reserved. * - * Copyright (C) 2006 Marcus Overhagen - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * version 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * + * Distributed under the terms of the MIT License. */ #include #include Modified: haiku/trunk/src/apps/mediaplayer/VideoNode.h =================================================================== --- haiku/trunk/src/apps/mediaplayer/VideoNode.h 2008-03-02 00:06:45 UTC (rev 24196) +++ haiku/trunk/src/apps/mediaplayer/VideoNode.h 2008-03-02 02:57:28 UTC (rev 24197) @@ -1,21 +1,7 @@ /* - * VideoNode.h - Media Player for the Haiku Operating System + * Copyright (C) 2006 Marcus Overhagen . All rights reserved. * - * Copyright (C) 2006 Marcus Overhagen - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * version 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * + * Distributed under the terms of the MIT License. */ #ifndef __VIDEO_NODE_H_ #define __VIDEO_NODE_H_ From mmu_man at mail.berlios.de Sun Mar 2 04:05:25 2008 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Sun, 2 Mar 2008 04:05:25 +0100 Subject: [Haiku-commits] r24198 - in haiku/trunk: . build/jam Message-ID: <200803020305.m2235P4T003081@sheep.berlios.de> Author: mmu_man Date: 2008-03-02 04:05:23 +0100 (Sun, 02 Mar 2008) New Revision: 24198 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24198&view=rev Added: haiku/trunk/build/jam/FloppyBootImage Modified: haiku/trunk/Jamfile haiku/trunk/build/jam/BuildSetup haiku/trunk/build/jam/ImageRules Log: Add rules to create a boot floppy (use jam haiku-boot-floppy), in preparation for CD booting. Modified: haiku/trunk/Jamfile =================================================================== --- haiku/trunk/Jamfile 2008-03-02 02:57:28 UTC (rev 24197) +++ haiku/trunk/Jamfile 2008-03-02 03:05:23 UTC (rev 24198) @@ -151,6 +151,7 @@ # specify the Haiku image and network boot archive contents include [ FDirName $(HAIKU_BUILD_RULES_DIR) HaikuImage ] ; include [ FDirName $(HAIKU_BUILD_RULES_DIR) NetBootArchive ] ; +include [ FDirName $(HAIKU_BUILD_RULES_DIR) FloppyBootImage ] ; # Perform deferred SubIncludes. ExecuteDeferredSubIncludes ; Modified: haiku/trunk/build/jam/BuildSetup =================================================================== --- haiku/trunk/build/jam/BuildSetup 2008-03-02 02:57:28 UTC (rev 24197) +++ haiku/trunk/build/jam/BuildSetup 2008-03-02 03:05:23 UTC (rev 24198) @@ -29,7 +29,16 @@ HAIKU_INSTALL_TARGETS_VAR on $(HAIKU_NET_BOOT_ARCHIVE_CONTAINER_NAME) = HAIKU_NET_BOOT_ARCHIVE_INSTALL_TARGETS ; +# boot floppy +HAIKU_FLOPPY_BOOT_IMAGE_CONTAINER_NAME = haiku-boot-floppy-container ; +HAIKU_CONTAINER_GRIST on $(HAIKU_FLOPPY_BOOT_IMAGE_CONTAINER_NAME) = FloppyBootImage ; +# HAIKU_INCLUDE_IN_CONTAINER_VAR -- update only mode not supported +HAIKU_INSTALL_TARGETS_VAR on $(HAIKU_FLOPPY_BOOT_IMAGE_CONTAINER_NAME) + = HAIKU_FLOPPY_BOOT_IMAGE_INSTALL_TARGETS ; +# boot CD image +#TODO + # analyze an optionally replace jam's target parameters HAIKU_ORIGINAL_JAM_TARGETS = $(JAM_TARGETS) ; if $(JAM_TARGETS) { Added: haiku/trunk/build/jam/FloppyBootImage =================================================================== --- haiku/trunk/build/jam/FloppyBootImage 2008-03-02 02:57:28 UTC (rev 24197) +++ haiku/trunk/build/jam/FloppyBootImage 2008-03-02 03:05:23 UTC (rev 24198) @@ -0,0 +1,149 @@ +# 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 = ; +if $(TARGET_ARCH) = x86 { + X86_ONLY = "" ; +} else if $(TARGET_ARCH) = ppc { + X86_ONLY = ; +} + +local GPL_ONLY = ; +if $(INCLUDE_GPL_ADDONS) = 1 { + GPL_ONLY = "" ; +} + +BEOS_ADD_ONS_BUS_MANAGERS = pci $(X86_ONLY)isa ide scsi + config_manager agp_gart +; +BEOS_ADD_ONS_FILE_SYSTEMS = bfs ; +#cdda fat googlefs iso9660 nfs ; + + +# modules +AddFilesToFloppyBootArchive beos system add-ons kernel bus_managers + : $(BEOS_ADD_ONS_BUS_MANAGERS) ; +AddFilesToFloppyBootArchive beos system add-ons kernel busses agp_gart + : $(X86_ONLY)intel ; +AddFilesToFloppyBootArchive beos system add-ons kernel busses ide + : ahci generic_ide_pci $(X86_ONLY)ide_isa silicon_image_3112 ; +AddFilesToFloppyBootArchive beos system add-ons kernel console : vga_text ; +AddFilesToFloppyBootArchive beos system add-ons kernel file_systems + : $(BEOS_ADD_ONS_FILE_SYSTEMS) ; +AddFilesToFloppyBootArchive beos system add-ons kernel generic + : block_io fast_log ide_adapter locked_pool scsi_periph ; +AddFilesToFloppyBootArchive beos system add-ons kernel partitioning_systems + : intel session ; +AddFilesToFloppyBootArchive beos system add-ons kernel interrupt_controllers + : $(PPC_ONLY)openpic ; + +if $(TARGET_ARCH) = x86 { + AddFilesToFloppyBootArchive beos system add-ons kernel cpu : generic_x86 ; +} + +# drivers +AddDriversToFloppyBootArchive disk scsi : scsi_cd scsi_dsk ; +#AddDriversToFloppyBootArchive disk virtual : nbd ; +AddDriversToFloppyBootArchive disk virtual : remote_disk ; +AddDriversToFloppyBootArchive net : $(BEOS_ADD_ONS_DRIVERS_NET) ; + +# kernel +AddFilesToFloppyBootArchive beos system : kernel_$(TARGET_ARCH) ; + +# scripts and data files + +local driverSettingsFiles = kernel ; +SEARCH on $(driverSettingsFiles) + = [ FDirName $(HAIKU_TOP) data settings kernel drivers ] ; +AddFilesToFloppyBootArchive home config settings kernel drivers + : $(driverSettingsFiles) ; + +# add-ons +AddFilesToFloppyBootArchive beos system add-ons kernel network + : stack socket ; +AddFilesToFloppyBootArchive beos system add-ons kernel network devices + : $(BEOS_NETWORK_DEVICES) ; +AddFilesToFloppyBootArchive beos system add-ons kernel network datalink_protocols + : $(BEOS_NETWORK_DATALINK_PROTOCOLS) ; +AddFilesToFloppyBootArchive beos system add-ons kernel network ppp + : $(BEOS_NETWORK_PPP) ; +AddFilesToFloppyBootArchive beos system add-ons kernel network protocols + : $(BEOS_NETWORK_PROTOCOLS) ; + +# boot module links +AddBootModuleSymlinksToFloppyBootArchive + $(BEOS_ADD_ONS_BUS_MANAGERS) + ahci generic_ide_pci $(X86_ONLY)ide_isa silicon_image_3112 + $(BEOS_ADD_ONS_FILE_SYSTEMS) + block_io fast_log ide_adapter locked_pool scsi_periph + intel session + $(PPC_ONLY)openpic + $(X86_ONLY)generic_x86 +# nbd + remote_disk + $(BEOS_ADD_ONS_DRIVERS_NET) + stack socket + $(BEOS_NETWORK_DEVICES) + $(BEOS_NETWORK_DATALINK_PROTOCOLS) + $(BEOS_NETWORK_PPP) + $(BEOS_NETWORK_PROTOCOLS) +; + + +#pragma mark - Build The Archive + +# archive target +HAIKU_FLOPPY_BOOT_ARCHIVE = haiku-floppyboot.tgz ; +MakeLocate $(HAIKU_FLOPPY_BOOT_ARCHIVE) : $(HAIKU_OUTPUT_DIR) ; + +# the pseudo target all archive contents is attached to +NotFile $(HAIKU_BOOT_FLOPPY_CONTAINER_NAME) ; + +# prepare the script that initializes the shell variables +local initVarsScript = haiku-floppyboot-init-vars ; +local script = $(initVarsScript) ; +MakeLocate $(script) : $(HAIKU_OUTPUT_DIR) ; +Always $(script) ; + +AddVariableToScript $(script) : tmpDir : $(HAIKU_TMP_DIR) ; +AddVariableToScript $(script) : addBuildCompatibilityLibDir + : $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) ; +AddTargetVariableToScript $(script) : copyattr ; + +# create the other scripts +local makeDirsScript = haiku-floppyboot-make-dirs ; +local copyFilesScript = haiku-floppyboot-copy-files ; +MakeLocate $(makeDirsScript) $(copyFilesScript) : $(HAIKU_OUTPUT_DIR) ; + +CreateFloppyBootArchiveMakeDirectoriesScript $(makeDirsScript) ; +CreateFloppyBootArchiveCopyFilesScript $(copyFilesScript) ; + +# build the archive + +BuildFloppyBootArchive $(HAIKU_FLOPPY_BOOT_ARCHIVE) : + $(initVarsScript) + $(makeDirsScript) + $(copyFilesScript) +; + +# remove the scripts we have generated +RmTemps $(HAIKU_FLOPPY_BOOT_ARCHIVE) : + $(initVarsScript) + $(makeDirsScript) + $(copyFilesScript) +; + +NotFile haiku-floppyboot-archive ; +Depends haiku-floppyboot-archive : $(HAIKU_FLOPPY_BOOT_ARCHIVE) ; + +# floppy image target +HAIKU_BOOT_FLOPPY = haiku-boot-floppy.image ; +MakeLocate $(HAIKU_BOOT_FLOPPY) : $(HAIKU_OUTPUT_DIR) ; + +BuildFloppyBootImage $(HAIKU_BOOT_FLOPPY) : zbeos : $(HAIKU_FLOPPY_BOOT_ARCHIVE) ; + +NotFile haiku-boot-floppy ; +Depends haiku-boot-floppy : $(HAIKU_BOOT_FLOPPY) ; + + Modified: haiku/trunk/build/jam/ImageRules =================================================================== --- haiku/trunk/build/jam/ImageRules 2008-03-02 02:57:28 UTC (rev 24197) +++ haiku/trunk/build/jam/ImageRules 2008-03-02 03:05:23 UTC (rev 24198) @@ -763,3 +763,109 @@ { $(2[1]) $(1) $(2[2-]) } + + +#pragma mark - Floppy Boot Archive rules + +rule AddDirectoryToFloppyBootArchive directoryTokens +{ + # AddDirectoryToFloppyBootArchive + + return [ AddDirectoryToContainer $(HAIKU_FLOPPY_BOOT_IMAGE_CONTAINER_NAME) + : $(directoryTokens) ] ; +} + +rule AddFilesToFloppyBootArchive directory : targets : destName +{ + # AddFilesToFloppyBootArchive : [ : dest name ] + + AddFilesToContainer $(HAIKU_FLOPPY_BOOT_IMAGE_CONTAINER_NAME) : $(directory) + : $(targets) : $(destName) ; +} + +rule AddSymlinkToFloppyBootArchive directoryTokens : linkTarget : linkName +{ + # AddSymlinkToFloppyBootArchive : [ : ] ; + + AddSymlinkToContainer $(HAIKU_FLOPPY_BOOT_IMAGE_CONTAINER_NAME) + : $(directoryTokens) : $(linkTarget) : $(linkName) ; +} + +rule AddDriversToFloppyBootArchive relativeDirectoryTokens : targets +{ + # AddDriversToFloppyBootArchive : ; + + AddDriversToContainer $(HAIKU_FLOPPY_BOOT_IMAGE_CONTAINER_NAME) + : $(relativeDirectoryTokens) : $(targets) ; +} + +rule AddDriverRegistrationToFloppyBootArchive relativeDirectoryTokens : target + : links +{ + # AddDriverRegistrationToFloppyBootArchive : + # : ] ; + + AddDriverRegistrationToContainer $(HAIKU_FLOPPY_BOOT_IMAGE_CONTAINER_NAME) + : $(relativeDirectoryTokens) : $(target) : $(links) ; +} + +rule AddBootModuleSymlinksToFloppyBootArchive targets +{ + # AddBootModuleSymlinksToFloppyBootArchive ; + + AddBootModuleSymlinksToContainer $(HAIKU_FLOPPY_BOOT_IMAGE_CONTAINER_NAME) + : $(targets) ; +} + +rule CreateFloppyBootArchiveMakeDirectoriesScript script +{ + CreateContainerMakeDirectoriesScript + $(HAIKU_FLOPPY_BOOT_IMAGE_CONTAINER_NAME) : $(script) ; +} + +rule CreateFloppyBootArchiveCopyFilesScript script +{ + CreateContainerCopyFilesScript $(HAIKU_FLOPPY_BOOT_IMAGE_CONTAINER_NAME) + : $(script) ; +} + +rule BuildFloppyBootArchive archive : scripts +{ + # BuildHFloppyBootArchive : ; + + local mainScript = build_tgz_archive ; + SEARCH on $(mainScript) = [ FDirName $(HAIKU_TOP) build scripts ] ; + + Depends $(archive) : $(mainScript) $(scripts) ; + BuildFloppyBootArchive1 $(archive) : $(mainScript) $(scripts) ; +} + +actions BuildFloppyBootArchive1 +{ + $(2[1]) $(1) $(2[2-]) +} + +# warning: that is quite x86 dependant... + +rule BuildFloppyBootImage image : zbeos : archive +{ + Depends $(image) : $(zbeos) ; + Depends $(image) : $(archive) ; + #MakeLocateDebug $(image) ; + BuildFloppyBootImage1 $(image) : $(zbeos) $(archive) ; +} + +actions BuildFloppyBootImage1 +{ + rm -f $(<) + # make an empty image + dd if=/dev/zero of=$(<) bs=1k count=1440 + # add zbeos + dd if=$(>[1]) of=$(<) conv=notrunc + # add the boot drivers tgz archive + # keep the offset in sync with + # src/system/boot/loader/file_systems/tarfs/tarfs.cpp:kFloppyArchiveOffset + dd if=$(>[2]) of=$(<) bs=192k seek=1 conv=notrunc +} + + From mmu_man at mail.berlios.de Sun Mar 2 04:23:52 2008 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Sun, 2 Mar 2008 04:23:52 +0100 Subject: [Haiku-commits] r24199 - haiku/trunk/build/jam Message-ID: <200803020323.m223Nq8P005104@sheep.berlios.de> Author: mmu_man Date: 2008-03-02 04:23:51 +0100 (Sun, 02 Mar 2008) New Revision: 24199 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24199&view=rev Modified: haiku/trunk/build/jam/FloppyBootImage Log: Make network support disabled by default for boot floppy, it's not needed and doesn't fit 1.44M. Modified: haiku/trunk/build/jam/FloppyBootImage =================================================================== --- haiku/trunk/build/jam/FloppyBootImage 2008-03-02 03:05:23 UTC (rev 24198) +++ haiku/trunk/build/jam/FloppyBootImage 2008-03-02 03:23:51 UTC (rev 24199) @@ -14,6 +14,22 @@ GPL_ONLY = "" ; } +local NET_BOOT = 0 ; + +local BOOT_ADD_ONS_NET ; +if $(NET_BOOT) = 1 { +BOOT_ADD_ONS_NET = +# nbd +# remote_disk +# $(BEOS_ADD_ONS_DRIVERS_NET) +# stack socket +# $(BEOS_NETWORK_DEVICES) +# $(BEOS_NETWORK_DATALINK_PROTOCOLS) +# $(BEOS_NETWORK_PPP) +# $(BEOS_NETWORK_PROTOCOLS) +; +} + BEOS_ADD_ONS_BUS_MANAGERS = pci $(X86_ONLY)isa ide scsi config_manager agp_gart ; @@ -44,9 +60,11 @@ # drivers AddDriversToFloppyBootArchive disk scsi : scsi_cd scsi_dsk ; +if $(NET_BOOT) = 1 { #AddDriversToFloppyBootArchive disk virtual : nbd ; AddDriversToFloppyBootArchive disk virtual : remote_disk ; AddDriversToFloppyBootArchive net : $(BEOS_ADD_ONS_DRIVERS_NET) ; +} # kernel AddFilesToFloppyBootArchive beos system : kernel_$(TARGET_ARCH) ; @@ -59,6 +77,7 @@ AddFilesToFloppyBootArchive home config settings kernel drivers : $(driverSettingsFiles) ; +if $(NET_BOOT) = 1 { # add-ons AddFilesToFloppyBootArchive beos system add-ons kernel network : stack socket ; @@ -70,6 +89,7 @@ : $(BEOS_NETWORK_PPP) ; AddFilesToFloppyBootArchive beos system add-ons kernel network protocols : $(BEOS_NETWORK_PROTOCOLS) ; +} # boot module links AddBootModuleSymlinksToFloppyBootArchive @@ -80,14 +100,7 @@ intel session $(PPC_ONLY)openpic $(X86_ONLY)generic_x86 -# nbd - remote_disk - $(BEOS_ADD_ONS_DRIVERS_NET) - stack socket - $(BEOS_NETWORK_DEVICES) - $(BEOS_NETWORK_DATALINK_PROTOCOLS) - $(BEOS_NETWORK_PPP) - $(BEOS_NETWORK_PROTOCOLS) + $(BOOT_ADD_ONS_NET) ; From mmu_man at mail.berlios.de Sun Mar 2 05:35:47 2008 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Sun, 2 Mar 2008 05:35:47 +0100 Subject: [Haiku-commits] r24200 - in haiku/trunk/data: . boot_cd Message-ID: <200803020435.m224ZlZD008997@sheep.berlios.de> Author: mmu_man Date: 2008-03-02 05:35:46 +0100 (Sun, 02 Mar 2008) New Revision: 24200 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24200&view=rev Added: haiku/trunk/data/boot_cd/ haiku/trunk/data/boot_cd/README.html Log: Simple readme to put on a boot CD iso... Added: haiku/trunk/data/boot_cd/README.html =================================================================== --- haiku/trunk/data/boot_cd/README.html 2008-03-02 03:23:51 UTC (rev 24199) +++ haiku/trunk/data/boot_cd/README.html 2008-03-02 04:35:46 UTC (rev 24200) @@ -0,0 +1,25 @@ + + + +Welcome to the Haiku Operating System + + + + + + + + + + + +
+
Haiku is an open-source operating system currently in development designed from the ground up for desktop computing. Inspired by the BeOS, Haiku aims to provide users of all levels with a personal computing experience that is simple yet powerful, and free of any unnecessary complexities.
+
+Links: +
    +
  • Haiku website
  • +
      + + From mmu_man at mail.berlios.de Sun Mar 2 05:38:30 2008 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Sun, 2 Mar 2008 05:38:30 +0100 Subject: [Haiku-commits] r24201 - in haiku/trunk: . build/jam Message-ID: <200803020438.m224cUXl009100@sheep.berlios.de> Author: mmu_man Date: 2008-03-02 05:38:29 +0100 (Sun, 02 Mar 2008) New Revision: 24201 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24201&view=rev Added: haiku/trunk/build/jam/CDBootImage Modified: haiku/trunk/Jamfile haiku/trunk/build/jam/BuildSetup haiku/trunk/build/jam/ImageRules Log: Rules and targets to build a boot CD iso... use: jam haiku-boot-cd Modified: haiku/trunk/Jamfile =================================================================== --- haiku/trunk/Jamfile 2008-03-02 04:35:46 UTC (rev 24200) +++ haiku/trunk/Jamfile 2008-03-02 04:38:29 UTC (rev 24201) @@ -152,6 +152,7 @@ include [ FDirName $(HAIKU_BUILD_RULES_DIR) HaikuImage ] ; include [ FDirName $(HAIKU_BUILD_RULES_DIR) NetBootArchive ] ; include [ FDirName $(HAIKU_BUILD_RULES_DIR) FloppyBootImage ] ; +include [ FDirName $(HAIKU_BUILD_RULES_DIR) CDBootImage ] ; # Perform deferred SubIncludes. ExecuteDeferredSubIncludes ; Modified: haiku/trunk/build/jam/BuildSetup =================================================================== --- haiku/trunk/build/jam/BuildSetup 2008-03-02 04:35:46 UTC (rev 24200) +++ haiku/trunk/build/jam/BuildSetup 2008-03-02 04:38:29 UTC (rev 24201) @@ -37,7 +37,11 @@ = HAIKU_FLOPPY_BOOT_IMAGE_INSTALL_TARGETS ; # boot CD image -#TODO +HAIKU_CD_BOOT_IMAGE_CONTAINER_NAME = haiku-boot-cd-container ; +HAIKU_CONTAINER_GRIST on $(HAIKU_CD_BOOT_IMAGE_CONTAINER_NAME) = CDBootImage ; +# HAIKU_INCLUDE_IN_CONTAINER_VAR -- update only mode not supported +HAIKU_INSTALL_TARGETS_VAR on $(HAIKU_CD_BOOT_IMAGE_CONTAINER_NAME) + = HAIKU_CD_BOOT_IMAGE_INSTALL_TARGETS ; # analyze an optionally replace jam's target parameters HAIKU_ORIGINAL_JAM_TARGETS = $(JAM_TARGETS) ; Added: haiku/trunk/build/jam/CDBootImage =================================================================== --- haiku/trunk/build/jam/CDBootImage 2008-03-02 04:35:46 UTC (rev 24200) +++ haiku/trunk/build/jam/CDBootImage 2008-03-02 04:38:29 UTC (rev 24201) @@ -0,0 +1,24 @@ +# This file defines what ends up in the CD boot image and it executes the +# rules building the image. + +#HAIKU_BOOT_FLOPPY = haiku-boot-floppy.image ; +#MakeLocate $(HAIKU_BOOT_FLOPPY) : $(HAIKU_OUTPUT_DIR) ; + +# CD image target +HAIKU_CD_BOOT_IMAGE = haiku-boot-cd.iso ; +MakeLocate $(HAIKU_CD_BOOT_IMAGE) : $(HAIKU_OUTPUT_DIR) ; + +# the pseudo target all archive contents is attached to +NotFile $(HAIKU_CD_BOOT_IMAGE_CONTAINER_NAME) ; + +# extra files to put on the boot iso +local extras = README.html ; +SEARCH on $(extras) = [ FDirName $(HAIKU_TOP) data boot_cd ] ; + +BuildCDBootImage $(HAIKU_CD_BOOT_IMAGE) : $(HAIKU_BOOT_FLOPPY) : $(extras) ; + + +NotFile haiku-boot-cd ; +Depends haiku-boot-cd : $(HAIKU_CD_BOOT_IMAGE) ; + + Modified: haiku/trunk/build/jam/ImageRules =================================================================== --- haiku/trunk/build/jam/ImageRules 2008-03-02 04:35:46 UTC (rev 24200) +++ haiku/trunk/build/jam/ImageRules 2008-03-02 04:38:29 UTC (rev 24201) @@ -869,3 +869,21 @@ } +#pragma mark - CD Boot Image rules + +rule BuildCDBootImage image : bootfloppy : extrafiles +{ + Depends $(image) : $(bootfloppy) ; + Depends $(image) : $(extrafiles) ; + BOOTIMG on $(image) = $(bootfloppy) ; + + BuildCDBootImage1 $(image) : $(bootfloppy) $(extrafiles) ; +} + +actions BuildCDBootImage1 +{ + rm -f $(<) + mkisofs -b $(BOOTIMG) -r -J -V bootimg -o $(<) $(>[1]) $(>[2-]) +} + + From niels.reedijk at gmail.com Sun Mar 2 11:34:25 2008 From: niels.reedijk at gmail.com (Niels Reedijk) Date: Sun, 2 Mar 2008 11:34:25 +0100 Subject: [Haiku-commits] r24201 - in haiku/trunk: . build/jam In-Reply-To: <200803020438.m224cUXl009100@sheep.berlios.de> References: <200803020438.m224cUXl009100@sheep.berlios.de> Message-ID: <507d86c0803020234u175ebf80m4ca5f2851d248033@mail.gmail.com> 2008/3/2, mmu_man at BerliOS : > Author: mmu_man > Date: 2008-03-02 05:38:29 +0100 (Sun, 02 Mar 2008) > New Revision: 24201 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24201&view=rev > > Added: > haiku/trunk/build/jam/CDBootImage > Modified: > haiku/trunk/Jamfile > haiku/trunk/build/jam/BuildSetup > haiku/trunk/build/jam/ImageRules > Log: > Rules and targets to build a boot CD iso... use: > jam haiku-boot-cd Ah cool! If you are planning to perfect this, please take ticket #1268. Can I try this already, or is it WIP? N. From revol at free.fr Sun Mar 2 12:24:54 2008 From: revol at free.fr (=?windows-1252?q?Fran=E7ois?= Revol) Date: Sun, 02 Mar 2008 12:24:54 +0100 CET Subject: [Haiku-commits] r24201 - in haiku/trunk: . build/jam In-Reply-To: <507d86c0803020234u175ebf80m4ca5f2851d248033@mail.gmail.com> Message-ID: <4207306403-BeMail@laptop> > > Rules and targets to build a boot CD iso... use: > > jam haiku-boot-cd > > Ah cool! If you are planning to perfect this, please take ticket > #1268. Can I try this already, or is it WIP? It builds an image, but I don't know if it would boot on real hw. I tried in qemu (appending haiku.image to it and using qemu -cd foo - cdtoc 0,904 but I'm not sure it's how it works) but it gives the boot menu without anyway to continue. Fran?ois. From superstippi at gmx.de Sun Mar 2 12:53:44 2008 From: superstippi at gmx.de (Stephan Assmus) Date: Sun, 02 Mar 2008 12:53:44 +0100 Subject: [Haiku-commits] Build broken In-Reply-To: <200803020305.m2235P4T003081@sheep.berlios.de> References: <200803020305.m2235P4T003081@sheep.berlios.de> Message-ID: <20080302115344.273200@gmx.net> The build is currently broken since the changes to support cdrecord. I cannot check right now, but I think the error is that the new functions are exported multiple times. I am trying to do a GCC2 build in Linux. Best regards, -Stephan From stefano.ceccherini at gmail.com Sun Mar 2 13:57:40 2008 From: stefano.ceccherini at gmail.com (Stefano Ceccherini) Date: Sun, 2 Mar 2008 13:57:40 +0100 Subject: [Haiku-commits] Build broken In-Reply-To: <20080302115344.273200@gmx.net> References: <200803020305.m2235P4T003081@sheep.berlios.de> <20080302115344.273200@gmx.net> Message-ID: <894b9700803020457qc66e4ddtf72bf43cb17f1291@mail.gmail.com> 2008/3/2, Stephan Assmus : > The build is currently broken since the changes to support cdrecord. I cannot check right now, but I think the error is that the new functions are exported multiple times. I am trying to do a GCC2 build in Linux. > You might have to delete some objects manually. Try "rm generated/objects/haiku/x86/release/system/libroot/posix/stdlib" From axeld at mail.berlios.de Sun Mar 2 14:51:17 2008 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Sun, 2 Mar 2008 14:51:17 +0100 Subject: [Haiku-commits] r24202 - haiku/trunk/src/system/kernel/arch/x86 Message-ID: <200803021351.m22DpHu9026531@sheep.berlios.de> Author: axeld Date: 2008-03-02 14:51:17 +0100 (Sun, 02 Mar 2008) New Revision: 24202 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24202&view=rev Modified: haiku/trunk/src/system/kernel/arch/x86/arch_cpu.c Log: Applied patch by Olivier Coursi?\195?\168re: this should help rebooting on some machines, and fixes bug #1884, thanks! Modified: haiku/trunk/src/system/kernel/arch/x86/arch_cpu.c =================================================================== --- haiku/trunk/src/system/kernel/arch/x86/arch_cpu.c 2008-03-02 04:38:29 UTC (rev 24201) +++ haiku/trunk/src/system/kernel/arch/x86/arch_cpu.c 2008-03-02 13:51:17 UTC (rev 24202) @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007, Axel D?rfler, axeld at pinc-software.de. All rights reserved. + * Copyright 2002-2008, Axel D?rfler, axeld at pinc-software.de. All rights reserved. * Distributed under the terms of the MIT License. * * Copyright 2001-2002, Travis Geiselbrecht. All rights reserved. @@ -684,6 +684,9 @@ // try to reset the system using the keyboard controller out8(0xfe, 0x64); + // Give some time to the controller to do its job (0.5s) + snooze(500000); + // if that didn't help, try it this way reboot(); From axeld at mail.berlios.de Sun Mar 2 15:37:26 2008 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Sun, 2 Mar 2008 15:37:26 +0100 Subject: [Haiku-commits] r24203 - haiku/trunk/src/add-ons/kernel/file_systems/bfs Message-ID: <200803021437.m22EbQc9029811@sheep.berlios.de> Author: axeld Date: 2008-03-02 15:37:26 +0100 (Sun, 02 Mar 2008) New Revision: 24203 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24203&view=rev Modified: haiku/trunk/src/add-ons/kernel/file_systems/bfs/BPlusTree.cpp Log: Patch by Vasilis Kaoutsis to fix some warnings, thanks! Modified: haiku/trunk/src/add-ons/kernel/file_systems/bfs/BPlusTree.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/bfs/BPlusTree.cpp 2008-03-02 13:51:17 UTC (rev 24202) +++ haiku/trunk/src/add-ons/kernel/file_systems/bfs/BPlusTree.cpp 2008-03-02 14:37:26 UTC (rev 24203) @@ -476,8 +476,8 @@ | S_FLOAT_INDEX | S_DOUBLE_INDEX); if (fHeader->DataType() > BPLUSTREE_DOUBLE_TYPE - || (stream->Mode() & S_INDEX_DIR) - && toMode[fHeader->DataType()] != mode + || ((stream->Mode() & S_INDEX_DIR) != 0 + && toMode[fHeader->DataType()] != mode) || !stream->IsContainer()) { D( dump_bplustree_header(fHeader); dump_inode(&stream->Node()); @@ -1709,7 +1709,7 @@ // to a leaf node by dropping the overflow link, or, // if it's already a leaf node, just empty it if (nodeAndKey.nodeOffset == fHeader->RootNode() - && (node->NumKeys() == 0 || node->NumKeys() == 1 && node->IsLeaf())) { + && (node->NumKeys() == 0 || (node->NumKeys() == 1 && node->IsLeaf()))) { writableNode->overflow_link = HOST_ENDIAN_TO_BFS_INT64((uint64)BPLUSTREE_NULL); writableNode->all_key_count = 0; writableNode->all_key_length = 0; @@ -1730,7 +1730,7 @@ // it, we can just dump the node (index nodes still have // the overflow link, so we have to drop the last key) if (writableNode->NumKeys() > 1 - || !writableNode->IsLeaf() && writableNode->NumKeys() == 1) { + || (!writableNode->IsLeaf() && writableNode->NumKeys() == 1)) { _RemoveKey(writableNode, nodeAndKey.keyIndex); return B_OK; } From axeld at mail.berlios.de Sun Mar 2 15:47:03 2008 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Sun, 2 Mar 2008 15:47:03 +0100 Subject: [Haiku-commits] r24204 - haiku/trunk/src/kits/app Message-ID: <200803021447.m22El3Bt030426@sheep.berlios.de> Author: axeld Date: 2008-03-02 15:47:03 +0100 (Sun, 02 Mar 2008) New Revision: 24204 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24204&view=rev Modified: haiku/trunk/src/kits/app/Message.cpp Log: * Fixed a few problems in AddMessage() (most of them were pointed out by Marcus): - no need to initialize the buffer on stack - no need to initialize "buffer" to NULL - renamed "buf" to stackBuffer - enlarged buffer on stack to 16384 bytes (we have a minimum of 192 kB of stack per thread, anyway). - check the actual size of the stack buffer against the message's flattened size instead of the one of its pointer. - check if the allocation of the helper buffer failed, and return B_NO_MEMORY in this case. * Moved static helper functions to the top of the file. * Minor cleanup. Modified: haiku/trunk/src/kits/app/Message.cpp =================================================================== --- haiku/trunk/src/kits/app/Message.cpp 2008-03-02 14:37:26 UTC (rev 24203) +++ haiku/trunk/src/kits/app/Message.cpp 2008-03-02 14:47:03 UTC (rev 24204) @@ -1,10 +1,11 @@ /* - * Copyright 2005-2007, Haiku Inc. All rights reserved. + * Copyright 2005-2008, Haiku Inc. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: * Michael Lotz */ + #include #include #include @@ -51,13 +52,13 @@ const char *B_PROPERTY_NAME_ENTRY = "name"; -static status_t handle_reply(port_id replyPort, int32 *pCode, - bigtime_t timeout, BMessage *reply); +static status_t handle_reply(port_id replyPort, int32 *pCode, bigtime_t timeout, + BMessage *reply); extern "C" { - // private os function to set the owning team of an area - status_t _kern_transfer_area(area_id area, void **_address, - uint32 addressSpec, team_id target); + // private os function to set the owning team of an area + status_t _kern_transfer_area(area_id area, void **_address, + uint32 addressSpec, team_id target); } @@ -66,6 +67,57 @@ long BMessage::sReplyPortInUse[sNumReplyPorts]; +template static uint8 * +print_to_stream_type(uint8* pointer) +{ + Type *item = (Type *)pointer; + item->PrintToStream(); + return (uint8 *)(item+1); +} + + +template static uint8 * +print_type(const char* format, uint8* pointer) +{ + Type *item = (Type *)pointer; + printf(format, *item, *item); + return (uint8 *)(item+1); +} + + +static status_t +handle_reply(port_id replyPort, int32 *_code, bigtime_t timeout, + BMessage *reply) +{ + DEBUG_FUNCTION_ENTER2; + ssize_t size; + do { + size = port_buffer_size_etc(replyPort, B_RELATIVE_TIMEOUT, timeout); + } while (size == B_INTERRUPTED); + + if (size < B_OK) + return size; + + status_t result; + char *buffer = (char *)malloc(size); + do { + result = read_port(replyPort, _code, buffer, size); + } while (result == B_INTERRUPTED); + + if (result < B_OK || *_code != kPortMessageCode) { + free(buffer); + return result < B_OK ? result : B_ERROR; + } + + result = reply->Unflatten(buffer); + free(buffer); + return result; +} + + +// #pragma mark - + + BMessage::BMessage() { DEBUG_FUNCTION_ENTER; @@ -376,24 +428,6 @@ } -template static uint8 * -print_to_stream_type(uint8* pointer) -{ - Type *item = (Type *)pointer; - item->PrintToStream(); - return (uint8 *)(item+1); -} - - -template static uint8 * -print_type(const char* format, uint8* pointer) -{ - Type *item = (Type *)pointer; - printf(format, *item, *item); - return (uint8 *)(item+1); -} - - void BMessage::PrintToStream() const { @@ -2107,36 +2141,6 @@ } -static status_t -handle_reply(port_id replyPort, int32 *_code, bigtime_t timeout, - BMessage *reply) -{ - DEBUG_FUNCTION_ENTER2; - ssize_t size; - do { - size = port_buffer_size_etc(replyPort, B_RELATIVE_TIMEOUT, timeout); - } while (size == B_INTERRUPTED); - - if (size < B_OK) - return size; - - status_t result; - char *buffer = (char *)malloc(size); - do { - result = read_port(replyPort, _code, buffer, size); - } while (result == B_INTERRUPTED); - - if (result < B_OK || *_code != kPortMessageCode) { - free(buffer); - return result < B_OK ? result : B_ERROR; - } - - result = reply->Unflatten(buffer); - free(buffer); - return result; -} - - void BMessage::_ReservedMessage1(void) {}; void BMessage::_ReservedMessage2(void) {}; void BMessage::_ReservedMessage3(void) {}; @@ -2300,16 +2304,18 @@ copying an extra buffer. Functions can be added that return a direct pointer into the message. */ - char buf[4096] = { 0 }; + char stackBuffer[16384]; ssize_t size = message->FlattenedSize(); bool freeBuffer = false; - char* buffer = NULL; - if (size > (ssize_t)sizeof(buffer)) { + char* buffer; + if (size > (ssize_t)sizeof(stackBuffer)) { freeBuffer = true; buffer = static_cast(malloc(size)); + if (buffer == NULL) + return B_NO_MEMORY; } else { - buffer = buf; + buffer = stackBuffer; } status_t error = message->Flatten(buffer, size); From axeld at pinc-software.de Sun Mar 2 15:47:13 2008 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Sun, 02 Mar 2008 15:47:13 +0100 CET Subject: [Haiku-commits] r24196 - haiku/trunk/src/kits/app In-Reply-To: <16419283.1204425918989.JavaMail.ngmail@webmail16> Message-ID: <5676044310-BeMail@zon> Marcus Overhagen wrote: > julun at BerliOS wrote: > > + char buf[4096] = { 0 }; > Why are you initializing the buffer with zeroes? > > > + char* buffer = NULL; > Why are you initiazing the pointer? > > > + if (size > (ssize_t)sizeof(buffer)) { > > + freeBuffer = true; > > + buffer = static_cast(malloc(size)); > You should check for out of memory error here There were a few other problems so I took the liberty of fixing them in r24204. Bye, Axel. From revol at free.fr Sun Mar 2 17:13:12 2008 From: revol at free.fr (=?windows-1252?q?Fran=E7ois?= Revol) Date: Sun, 02 Mar 2008 17:13:12 +0100 CET Subject: [Haiku-commits] Build broken In-Reply-To: <894b9700803020457qc66e4ddtf72bf43cb17f1291@mail.gmail.com> Message-ID: <418276636-BeMail@laptop> > 2008/3/2, Stephan Assmus : > > The build is currently broken since the changes to support > > cdrecord. I cannot check right now, but I think the error is that the new functions are exported multiple times. I am trying to do a GCC2 build in Linux. > > > You might have to delete some objects manually. Try "rm > generated/objects/haiku/x86/release/system/libroot/posix/stdlib" rm generated/objects/haiku/x86/release/system/libroot/posix/stdlib/ posix_stdlib.o exactly. Since the file with sprintf-based version axel wrote got removed. Sorry, should have mentionned that. Fran?ois. From axeld at mail.berlios.de Sun Mar 2 17:18:08 2008 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Sun, 2 Mar 2008 17:18:08 +0100 Subject: [Haiku-commits] r24205 - haiku/trunk/src/apps/cortex/support Message-ID: <200803021618.m22GI8ce006286@sheep.berlios.de> Author: axeld Date: 2008-03-02 17:18:08 +0100 (Sun, 02 Mar 2008) New Revision: 24205 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24205&view=rev Modified: haiku/trunk/src/apps/cortex/support/MediaIcon.cpp Log: * Applied patch by Maurice to make Cortex behave nicer in case GetDormantFlavorInfoFor() fails. See bug #1763. * Minor cleanup. Modified: haiku/trunk/src/apps/cortex/support/MediaIcon.cpp =================================================================== --- haiku/trunk/src/apps/cortex/support/MediaIcon.cpp 2008-03-02 14:47:03 UTC (rev 24204) +++ haiku/trunk/src/apps/cortex/support/MediaIcon.cpp 2008-03-02 16:18:08 UTC (rev 24205) @@ -158,27 +158,35 @@ } } -void MediaIcon::_findIconFor( - const dormant_node_info &nodeInfo) { + +void +MediaIcon::_findIconFor(const dormant_node_info &nodeInfo) +{ D_INTERNAL(("MediaIcon::_findIconFor(dormant_node_info)\n")); dormant_flavor_info flavorInfo; BMediaRoster *roster = BMediaRoster::CurrentRoster(); status_t error = roster->GetDormantFlavorInfoFor(nodeInfo, &flavorInfo); - if (!error) { + if (error == B_OK) { m_nodeKind = flavorInfo.kinds; - bool audioIn = false, audioOut = false, videoIn = false, videoOut = false; + bool audioIn = false, audioOut = false; + bool videoIn = false, videoOut = false; _getMediaTypesFor(flavorInfo, &audioIn, &audioOut, &videoIn, &videoOut); _findDefaultIconFor(audioIn, audioOut, videoIn, videoOut); + } else { + // use generic icon in case we couldn't get any info + if (m_size == B_LARGE_ICON) + SetBits(M_GENERIC_ICON.large, 1024, 0, B_CMAP8); + else if (m_size == B_MINI_ICON) + SetBits(M_GENERIC_ICON.small, 256, 0, B_CMAP8); } } -void MediaIcon::_getMediaTypesFor( - const live_node_info &nodeInfo, - bool *audioIn, - bool *audioOut, - bool *videoIn, - bool *videoOut) { + +void +MediaIcon::_getMediaTypesFor(const live_node_info &nodeInfo, bool *audioIn, + bool *audioOut, bool *videoIn, bool *videoOut) +{ D_INTERNAL(("MediaIcon::_getMediaTypeFor(live_node_info)\n")); // get the media_types supported by this node From mmu_man at mail.berlios.de Sun Mar 2 17:27:52 2008 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Sun, 2 Mar 2008 17:27:52 +0100 Subject: [Haiku-commits] r24206 - haiku/trunk/src/apps/aboutsystem Message-ID: <200803021627.m22GRqEQ008446@sheep.berlios.de> Author: mmu_man Date: 2008-03-02 17:27:52 +0100 (Sun, 02 Mar 2008) New Revision: 24206 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24206&view=rev Modified: haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp Log: Added Maurice Kalinowski to the contributors' list. Modified: haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp =================================================================== --- haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp 2008-03-02 16:18:08 UTC (rev 24205) +++ haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp 2008-03-02 16:27:52 UTC (rev 24206) @@ -408,6 +408,7 @@ "Morgan Howe\n" "Erik Jaesler\n" "Carwyn Jones\n" + "Maurice Kalinowski\n" "Vasilis Kaoutsis\n" "James Kim\n" "Euan Kirkhope\n" From axeld at pinc-software.de Sun Mar 2 17:41:58 2008 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Sun, 02 Mar 2008 17:41:58 +0100 CET Subject: [Haiku-commits] r24175 - haiku/trunk/headers/private/interface In-Reply-To: <47C9CE95.8000308@digintrans.com> Message-ID: <12561896898-BeMail@zon> "Jorge G. Mare (a.k.a. Koki)" wrote: > Axel D?rfler wrote: > > I don't think so, at least I doubt that StyledEdit would > > automatically > > recognize that encoding - you might be able to select it > > afterwards, > > but that I don't know :-) > Per the screenshot linked below, the file open dialog in StyledEdit > has > an Encoding menu where you can select the encoding that you want to > apply when opening a file: > > http://myhaiku.org/haiku/2008-03-29_se-encoding.png So we already support that one - good to know :-) > > Maybe we should just try to integrate this stuff?? :) > It would be nice if StyledEdit automatically detected and used the > right > encoding of the text file it is opening. There is an editor for BeOS > called KEdit which does exactly that, and may be a good reference. > You > can find binary and sources here: > > http://www.bebits.com/app/1323 Thanks for the link! I've looked at it, but as detecting encodings is hard to do anyway, I was not surprised that this method is unfortunately not at all suitable for generic detection if you're not using Kanji + UTF-8/ASCII only. Bye, Axel. From umccullough at gmail.com Sun Mar 2 17:54:04 2008 From: umccullough at gmail.com (Urias McCullough) Date: Sun, 2 Mar 2008 08:54:04 -0800 Subject: [Haiku-commits] r24201 - in haiku/trunk: . build/jam In-Reply-To: <4207306403-BeMail@laptop> References: <507d86c0803020234u175ebf80m4ca5f2851d248033@mail.gmail.com> <4207306403-BeMail@laptop> Message-ID: <1e80d8750803020854o34b8fd5fid8afaca6f0773f6b@mail.gmail.com> On 02/03/2008, Fran?ois Revol wrote: > > > Rules and targets to build a boot CD iso... use: > > > jam haiku-boot-cd > > > > Ah cool! If you are planning to perfect this, please take ticket > > #1268. Can I try this already, or is it WIP? > > It builds an image, but I don't know if it would boot on real hw. > I tried in qemu (appending haiku.image to it and using qemu -cd foo - > cdtoc 0,904 but I'm not sure it's how it works) but it gives the boot > menu without anyway to continue. I tried on real hardware. I got an error about no boot partitions, and then the boot menu, but it couldn't find the image on the CD. It *was* able to find my HD Haiku partition and boot that. I used the following in a CUE to burn the disk with Nero on Windows (what I use for BeOS Max CDs, etc): FILE "haiku-boot-cd.iso" BINARY TRACK 01 MODE1/2048 INDEX 01 00:00:00 POSTGAP 00:02:00 FILE "haiku.image" BINARY TRACK 02 MODE1/2048 INDEX 01 00:00:00 POSTGAP 00:02:00 Assuming that this is correct, I would guess something is still missing. Perhaps I'll find some time to tinker with it today - we'll see.. From alex at zappotek.com Sun Mar 2 18:08:00 2008 From: alex at zappotek.com (Alexandre Deckner) Date: Sun, 02 Mar 2008 18:08:00 +0100 Subject: [Haiku-commits] r24201 - in haiku/trunk: . build/jam In-Reply-To: <1e80d8750803020854o34b8fd5fid8afaca6f0773f6b@mail.gmail.com> References: <507d86c0803020234u175ebf80m4ca5f2851d248033@mail.gmail.com> <4207306403-BeMail@laptop> <1e80d8750803020854o34b8fd5fid8afaca6f0773f6b@mail.gmail.com> Message-ID: <47CADEF0.3070607@zappotek.com> Urias McCullough a ?crit : > On 02/03/2008, Fran?ois Revol wrote: > >>>> Rules and targets to build a boot CD iso... use: >>>> >> > > jam haiku-boot-cd >> > >> > Ah cool! If you are planning to perfect this, please take ticket >> > #1268. Can I try this already, or is it WIP? >> >> It builds an image, but I don't know if it would boot on real hw. >> I tried in qemu (appending haiku.image to it and using qemu -cd foo - >> cdtoc 0,904 but I'm not sure it's how it works) but it gives the boot >> menu without anyway to continue. >> > > I tried on real hardware. I got an error about no boot partitions, and > then the boot menu, but it couldn't find the image on the CD. It *was* > able to find my HD Haiku partition and boot that. > Same here! http://dev.haiku-os.org/ticket/1364 . It used to work around summer 2006 iirc though. -Alex From leavengood at gmail.com Sun Mar 2 18:21:31 2008 From: leavengood at gmail.com (Ryan Leavengood) Date: Sun, 2 Mar 2008 12:21:31 -0500 Subject: [Haiku-commits] r24193 - in haiku/trunk: headers/os/interface src/kits/interface In-Reply-To: <200803012215.m21MFU40022335@sheep.berlios.de> References: <200803012215.m21MFU40022335@sheep.berlios.de> Message-ID: On Sat, Mar 1, 2008 at 5:15 PM, jackburton at BerliOS wrote: > Applied patch by Denis Washington which implements "diagonal mouse > support" for menus (see ticket #284). Thanks a lot! Awesome, good stuff Denis! He even included documentation of how it works, great! I can't wait to test this out, this was something that has been bugging me for a while. Regards, Ryan From zharik at gmx.li Sun Mar 2 21:09:17 2008 From: zharik at gmx.li (Siarzhuk Zharski) Date: Sun, 02 Mar 2008 21:09:17 +0100 Subject: [Haiku-commits] r24201 - in haiku/trunk: . build/jam In-Reply-To: <1e80d8750803020854o34b8fd5fid8afaca6f0773f6b@mail.gmail.com> References: <507d86c0803020234u175ebf80m4ca5f2851d248033@mail.gmail.com> <4207306403-BeMail@laptop> <1e80d8750803020854o34b8fd5fid8afaca6f0773f6b@mail.gmail.com> Message-ID: <47CB096D.8060603@gmx.li> Hi Urias McCullough wrote: >> It builds an image, but I don't know if it would boot on real hw. >> > I tried on real hardware. I got an error about no boot partitions, and > then the boot menu, but it couldn't find the image on the CD. It *was* > able to find my HD Haiku partition and boot that. > > I used the following in a CUE to burn the disk with Nero on Windows > (what I use for BeOS Max CDs, etc): > > FILE "haiku-boot-cd.iso" BINARY > TRACK 01 MODE1/2048 > 2048 > INDEX 01 00:00:00 > POSTGAP 00:02:00 > FILE "haiku.image" BINARY > TRACK 02 MODE1/2048 > 2048 > INDEX 01 00:00:00 > POSTGAP 00:02:00 > > Assuming that this is correct, I would guess something is still > missing. Perhaps I'll find some time to tinker with it today - we'll > see.. > Last time I looked in same problem the block size of build-created bfs image was 1024 by default. May be it is the source of your problem? Kind Regards, S.Z. From mmlr at mlotz.ch Sun Mar 2 21:48:46 2008 From: mmlr at mlotz.ch (Michael Lotz) Date: Sun, 02 Mar 2008 21:48:46 +0100 Subject: [Haiku-commits] r24201 - in haiku/trunk: . build/jam In-Reply-To: <4207306403-BeMail@laptop> Message-ID: <5041612089-BeMail@primary> > > > Rules and targets to build a boot CD iso... use: > > > jam haiku-boot-cd > > > > Ah cool! If you are planning to perfect this, please take ticket > > #1268. Can I try this already, or is it WIP? > > It builds an image, but I don't know if it would boot on real hw. > I tried in qemu (appending haiku.image to it and using qemu -cd foo - > cdtoc 0,904 but I'm not sure it's how it works) but it gives the boot > menu without anyway to continue. Note though that the "-cdtoc" option is only present in the BeOS version of QEMU, as I hacked that in specifically to allow booting multi session BeOS CDs... Regards Michael From mmlr at mlotz.ch Sun Mar 2 22:01:29 2008 From: mmlr at mlotz.ch (Michael Lotz) Date: Sun, 02 Mar 2008 22:01:29 +0100 Subject: [Haiku-commits] r24189 - haiku/trunk/src/add-ons/accelerants/common In-Reply-To: <200803011723.m21HNfQ8011914@sheep.berlios.de> Message-ID: <5804316622-BeMail@primary> > Author: axeld > Added modes for 1270x720 and 1400x1050 to the generic mode list. Also 1280x800 would be a nice resolution to add. It's used on many 12.1" laptops. I have it on my hp 2510p and I added this mode line (adapted from an X11 config) and it works (with a sligthly hacked intel_extreme driver): {{83564, 1280, 1344, 1480, 1680, 800, 801, 804, 828, POSITIVE_VSYNC}, B_CMAP8, 1280, 800, 0, 0, MODE_FLAGS}, /* WXGA (1280x800x60) */ Regards Michael From axeld at mail.berlios.de Sun Mar 2 22:08:34 2008 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Sun, 2 Mar 2008 22:08:34 +0100 Subject: [Haiku-commits] r24207 - haiku/trunk/src/apps/cortex/MediaRoutingView Message-ID: <200803022108.m22L8YMW024734@sheep.berlios.de> Author: axeld Date: 2008-03-02 22:08:33 +0100 (Sun, 02 Mar 2008) New Revision: 24207 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24207&view=rev Modified: haiku/trunk/src/apps/cortex/MediaRoutingView/MediaRoutingView.cpp haiku/trunk/src/apps/cortex/MediaRoutingView/MediaRoutingView.h Log: Applied patch by Maurice to fix Cortex' transport add-on selection, thanks! Modified: haiku/trunk/src/apps/cortex/MediaRoutingView/MediaRoutingView.cpp =================================================================== --- haiku/trunk/src/apps/cortex/MediaRoutingView/MediaRoutingView.cpp 2008-03-02 16:27:52 UTC (rev 24206) +++ haiku/trunk/src/apps/cortex/MediaRoutingView/MediaRoutingView.cpp 2008-03-02 21:08:33 UTC (rev 24207) @@ -273,7 +273,7 @@ void -MediaRoutingView::selectionChanged() +MediaRoutingView::SelectionChanged() { D_METHOD(("MediaRoutingView::selectionChanged()\n")); _broadcastSelection(); Modified: haiku/trunk/src/apps/cortex/MediaRoutingView/MediaRoutingView.h =================================================================== --- haiku/trunk/src/apps/cortex/MediaRoutingView/MediaRoutingView.h 2008-03-02 16:27:52 UTC (rev 24206) +++ haiku/trunk/src/apps/cortex/MediaRoutingView/MediaRoutingView.h 2008-03-02 21:08:33 UTC (rev 24207) @@ -181,7 +181,7 @@ BPoint point, BMessage *message); - virtual void selectionChanged(); + virtual void SelectionChanged(); public: // *** BView impl From axeld at pinc-software.de Sun Mar 2 22:10:35 2008 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Sun, 02 Mar 2008 22:10:35 +0100 CET Subject: [Haiku-commits] r24189 - haiku/trunk/src/add-ons/accelerants/common In-Reply-To: <5804316622-BeMail@primary> Message-ID: <28678198222-BeMail@zon> "Michael Lotz" wrote: > {{83564, 1280, 1344, 1480, 1680, 800, 801, 804, 828, POSITIVE_VSYNC}, > B_CMAP8, 1280, 800, 0, 0, MODE_FLAGS}, /* WXGA (1280x800x60) */ Is positive vsync wanted or accidental? (it would be either B_POSITIVE_VSYNC or POSITIVE_SYNC to have both, that's why I'm asking : -)) Bye, Axel. From mmlr at mlotz.ch Sun Mar 2 22:14:26 2008 From: mmlr at mlotz.ch (Michael Lotz) Date: Sun, 02 Mar 2008 22:14:26 +0100 Subject: [Haiku-commits] r24189 - haiku/trunk/src/add-ons/accelerants/common In-Reply-To: <28678198222-BeMail@zon> Message-ID: <6581902298-BeMail@primary> > "Michael Lotz" wrote: > > {{83564, 1280, 1344, 1480, 1680, 800, 801, 804, 828, > > POSITIVE_VSYNC}, > > B_CMAP8, 1280, 800, 0, 0, MODE_FLAGS}, /* WXGA (1280x800x60) */ > > Is positive vsync wanted or accidental? (it would be either > B_POSITIVE_VSYNC or POSITIVE_SYNC to have both, that's why I'm asking > : > -)) It's accidental. I first had B_POSITIVE_VSYNC there as HSYNC didn't seem necessary, but I have now tested that it works with it as well, so the POSITIVE_SYNC define should be save to use (for my display at least that is...). Regards Michael From anevilyak at mail.berlios.de Sun Mar 2 22:16:44 2008 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Sun, 2 Mar 2008 22:16:44 +0100 Subject: [Haiku-commits] r24208 - haiku/trunk/src/kits/tracker Message-ID: <200803022116.m22LGi3M025692@sheep.berlios.de> Author: anevilyak Date: 2008-03-02 22:16:43 +0100 (Sun, 02 Mar 2008) New Revision: 24208 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24208&view=rev Modified: haiku/trunk/src/kits/tracker/Navigator.cpp Log: Made Navigator color-sensitive. More to come. Modified: haiku/trunk/src/kits/tracker/Navigator.cpp =================================================================== --- haiku/trunk/src/kits/tracker/Navigator.cpp 2008-03-02 21:08:33 UTC (rev 24207) +++ haiku/trunk/src/kits/tracker/Navigator.cpp 2008-03-02 21:16:43 UTC (rev 24208) @@ -46,11 +46,6 @@ static const int32 kMaxHistory = 32; -static const rgb_color kBgColor = {220, 220, 220, 255}; -static const rgb_color kShineColor = {255, 255, 255, 255}; -static const rgb_color kHalfDarkColor = {200, 200, 200, 255}; -static const rgb_color kDarkColor = {166, 166, 166, 255}; - } // BPictureButton() will crash when giving zero pointers, @@ -67,9 +62,9 @@ { // Clear to background color to // avoid ugly border on click - SetViewColor(kBgColor); - SetHighColor(kBgColor); - SetLowColor(kBgColor); + SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + SetHighColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR)); } BNavigatorButton::~BNavigatorButton() @@ -104,7 +99,7 @@ BView view(bitmap->Bounds(), "", 0, 0); AddChild(&view); view.BeginPicture(&picture); - view.SetHighColor(kBgColor); + view.SetHighColor(ui_color(B_PANEL_BACKGROUND_COLOR)); view.FillRect(view.Bounds()); view.SetDrawingMode(B_OP_OVER); view.DrawBitmap(bitmap, BPoint(0, 0)); @@ -135,7 +130,7 @@ // Get initial path model->GetPath(&fPath); - SetViewColor(kBgColor); + SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); float top = 2 + (be_plain_font->Size() - 8) / 2; @@ -186,12 +181,16 @@ void BNavigator::Draw(BRect) { + rgb_color bgColor = ui_color(B_PANEL_BACKGROUND_COLOR); + rgb_color shineColor = ui_color(B_SHINE_COLOR); + rgb_color halfDarkColor = tint_color(bgColor, B_DARKEN_1_TINT); + rgb_color darkColor = tint_color(bgColor, B_DARKEN_2_TINT); // Draws a beveled smooth border BeginLineArray(4); - AddLine(Bounds().LeftTop(), Bounds().RightTop(), kShineColor); - AddLine(Bounds().LeftTop(), Bounds().LeftBottom() - BPoint(0, 1), kShineColor); - AddLine(Bounds().LeftBottom() - BPoint(-1, 1), Bounds().RightBottom() - BPoint(0, 1), kHalfDarkColor); - AddLine(Bounds().LeftBottom(), Bounds().RightBottom(), kDarkColor); + AddLine(Bounds().LeftTop(), Bounds().RightTop(), shineColor); + AddLine(Bounds().LeftTop(), Bounds().LeftBottom() - BPoint(0, 1), shineColor); + AddLine(Bounds().LeftBottom() - BPoint(-1, 1), Bounds().RightBottom() - BPoint(0, 1), halfDarkColor); + AddLine(Bounds().LeftBottom(), Bounds().RightBottom(), darkColor); EndLineArray(); } From axeld at mail.berlios.de Sun Mar 2 22:22:58 2008 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Sun, 2 Mar 2008 22:22:58 +0100 Subject: [Haiku-commits] r24209 - haiku/trunk/src/add-ons/accelerants/common Message-ID: <200803022122.m22LMwqg026528@sheep.berlios.de> Author: axeld Date: 2008-03-02 22:22:57 +0100 (Sun, 02 Mar 2008) New Revision: 24209 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24209&view=rev Modified: haiku/trunk/src/add-ons/accelerants/common/create_display_modes.cpp Log: * Added 1280x800x60, thanks Michael! * Also added 800x480x60. Modified: haiku/trunk/src/add-ons/accelerants/common/create_display_modes.cpp =================================================================== --- haiku/trunk/src/add-ons/accelerants/common/create_display_modes.cpp 2008-03-02 21:16:43 UTC (rev 24208) +++ haiku/trunk/src/add-ons/accelerants/common/create_display_modes.cpp 2008-03-02 21:22:57 UTC (rev 24209) @@ -28,6 +28,7 @@ {{31500, 640, 664, 704, 832, 480, 489, 492, 520, 0}, B_CMAP8, 640, 480, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 70-72Hz_(640X480X8.Z1) */ {{31500, 640, 656, 720, 840, 480, 481, 484, 500, 0}, B_CMAP8, 640, 480, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 75Hz_(640X480X8.Z1) */ {{36000, 640, 696, 752, 832, 480, 481, 484, 509, 0}, B_CMAP8, 640, 480, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 85Hz_(640X480X8.Z1) */ + {{29580, 800, 816, 896, 992, 480, 481, 484, 497, B_POSITIVE_VSYNC}, B_CMAP8, 800, 480, 0, 0, MODE_FLAGS}, /* 800x480x60Hz */ {{38100, 800, 832, 960, 1088, 600, 602, 606, 620, 0}, B_CMAP8, 800, 600, 0, 0, MODE_FLAGS}, /* SVGA_800X600X56HzNI */ {{40000, 800, 840, 968, 1056, 600, 601, 605, 628, POSITIVE_SYNC}, B_CMAP8, 800, 600, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 60Hz_(800X600X8.Z1) */ {{49500, 800, 816, 896, 1056, 600, 601, 604, 625, POSITIVE_SYNC}, B_CMAP8, 800, 600, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 75Hz_(800X600X8.Z1) */ @@ -41,6 +42,7 @@ {{108000, 1152, 1216, 1344, 1600, 864, 865, 868, 900, POSITIVE_SYNC}, B_CMAP8, 1152, 864, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 75Hz_(1152X864X8.Z1) */ {{121500, 1152, 1216, 1344, 1568, 864, 865, 868, 911, POSITIVE_SYNC}, B_CMAP8, 1152, 864, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 85Hz_(1152X864X8.Z1) */ {{74520, 1280, 1368, 1424, 1656, 720, 724, 730, 750, POSITIVE_SYNC}, B_CMAP8, 1280, 720, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 60Hz_(1280X720) */ + {{83460, 1280, 1344, 1480, 1680, 800, 801, 804, 828, B_POSITIVE_VSYNC}, B_CMAP8, 1280, 800, 0, 0, MODE_FLAGS}, /* WXGA (1280x800x60) */ {{108000, 1280, 1328, 1440, 1688, 1024, 1025, 1028, 1066, POSITIVE_SYNC}, B_CMAP8, 1280, 1024, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 60Hz_(1280X1024X8.Z1) */ {{135000, 1280, 1296, 1440, 1688, 1024, 1025, 1028, 1066, POSITIVE_SYNC}, B_CMAP8, 1280, 1024, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 75Hz_(1280X1024X8.Z1) */ {{157500, 1280, 1344, 1504, 1728, 1024, 1025, 1028, 1072, POSITIVE_SYNC}, B_CMAP8, 1280, 1024, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 85Hz_(1280X1024X8.Z1) */ From revol at free.fr Sun Mar 2 22:44:40 2008 From: revol at free.fr (=?windows-1252?q?Fran=E7ois?= Revol) Date: Sun, 02 Mar 2008 22:44:40 +0100 CET Subject: [Haiku-commits] r24201 - in haiku/trunk: . build/jam In-Reply-To: <5041612089-BeMail@primary> Message-ID: <20306371119-BeMail@laptop> > > > > Rules and targets to build a boot CD iso... use: > > > > jam haiku-boot-cd > > > > > > Ah cool! If you are planning to perfect this, please take ticket > > > #1268. Can I try this already, or is it WIP? > > > > It builds an image, but I don't know if it would boot on real hw. > > I tried in qemu (appending haiku.image to it and using qemu -cd foo > > - > > cdtoc 0,904 but I'm not sure it's how it works) but it gives the > > boot > > menu without anyway to continue. > > Note though that the "-cdtoc" option is only present in the BeOS > version of QEMU, as I hacked that in specifically to allow booting > multi session BeOS CDs... > Gahh, didn't notice... that'll need to be pushed to HEAD :) Fran?ois. From revol at free.fr Sun Mar 2 22:52:33 2008 From: revol at free.fr (=?windows-1252?q?Fran=E7ois?= Revol) Date: Sun, 02 Mar 2008 22:52:33 +0100 CET Subject: [Haiku-commits] r24201 - in haiku/trunk: . build/jam In-Reply-To: <20306371119-BeMail@laptop> Message-ID: <20779638638-BeMail@laptop> > > > > > Rules and targets to build a boot CD iso... use: > > > > > jam haiku-boot-cd > > > > > > > > Ah cool! If you are planning to perfect this, please take > > > > ticket > > > > #1268. Can I try this already, or is it WIP? > > > > > > It builds an image, but I don't know if it would boot on real hw. > > > I tried in qemu (appending haiku.image to it and using qemu -cd > > > foo > > > - > > > cdtoc 0,904 but I'm not sure it's how it works) but it gives the > > > boot > > > menu without anyway to continue. > > > > Note though that the "-cdtoc" option is only present in the BeOS > > version of QEMU, as I hacked that in specifically to allow booting > > multi session BeOS CDs... > > > > Gahh, didn't notice... > that'll need to be pushed to HEAD :) OTH, similar behaviour can be generated with qemu -cdrom generated/haiku.image -fda generated/haiku-boot- floppy.image Fran?ois. From mmlr at mlotz.ch Sun Mar 2 23:04:57 2008 From: mmlr at mlotz.ch (Michael Lotz) Date: Sun, 02 Mar 2008 23:04:57 +0100 Subject: [Haiku-commits] r24179 - in haiku/trunk: headers/build src/build/libhaikucompat In-Reply-To: <10458560227-BeMail@laptop> Message-ID: <9612247463-BeMail@primary> > > Author: axeld > > Date: 2008-02-29 16:02:12 +0100 (Fri, 29 Feb 2008) > > New Revision: 24179 > > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24179&view=rev > > > > Modified: > > haiku/trunk/headers/build/HaikuBuildCompatibility.h > > haiku/trunk/src/build/libhaikucompat/Jamfile > > Log: > > Hopefully final build fix for Dano; at least I build everything > > with > > "-a" this > > time and it worked :-) It seems that this broke the build for BONE. I had to add the following to the libhaikucompat jamfile to get it to work again over here: if $(HOST_PLATFORM) = bone { ObjectDefines $(libbePatchSources) : USING_HAIKU_TYPE_CONSTANTS_H= ; } Which is the same as the one for Dano except for the "IMPEX_BE=" part as this generates a lot of redefinition warnings under BONE. Regards Michael From revol at free.fr Sun Mar 2 23:10:14 2008 From: revol at free.fr (=?windows-1252?q?Fran=E7ois?= Revol) Date: Sun, 02 Mar 2008 23:10:14 +0100 CET Subject: [Haiku-commits] r24201 - in haiku/trunk: . build/jam In-Reply-To: <47CB096D.8060603@gmx.li> Message-ID: <21841030079-BeMail@laptop> > > > 2048 > > INDEX 01 00:00:00 > > POSTGAP 00:02:00 > > FILE "haiku.image" BINARY > > TRACK 02 MODE1/2048 > > > 2048 > > INDEX 01 00:00:00 > > POSTGAP 00:02:00 > > > > Assuming that this is correct, I would guess something is still > > missing. Perhaps I'll find some time to tinker with it today - > > we'll > > see.. > > > Last time I looked in same problem the block size of build-created > bfs > image was 1024 by default. May be it is the source of your problem? Good idea but it didnd't help. Added "block_size 2048" in the build_haiku_image script but it doesn't help. Fran?ois. From axeld at pinc-software.de Sun Mar 2 23:28:50 2008 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Sun, 02 Mar 2008 23:28:50 +0100 CET Subject: [Haiku-commits] r24189 - haiku/trunk/src/add-ons/accelerants/common In-Reply-To: <6581902298-BeMail@primary> Message-ID: <33373896644-BeMail@zon> "Michael Lotz" wrote: > > "Michael Lotz" wrote: > > > {{83564, 1280, 1344, 1480, 1680, 800, 801, 804, 828, > > > POSITIVE_VSYNC}, > > > B_CMAP8, 1280, 800, 0, 0, MODE_FLAGS}, /* WXGA (1280x800x60) */ > > Is positive vsync wanted or accidental? (it would be either > > B_POSITIVE_VSYNC or POSITIVE_SYNC to have both, that's why I'm > > asking > > :-)) > It's accidental. I first had B_POSITIVE_VSYNC there as HSYNC didn't > seem necessary, but I have now tested that it works with it as well, > so > the POSITIVE_SYNC define should be save to use (for my display at > least > that is...). I've used "gtf" to create that modeline for me, and it used -hsync + vsync, so I opted for B_POSITIVE_VSYNC. Shouldn't matter much, I would guess. Bye, Axel. From axeld at pinc-software.de Sun Mar 2 23:52:59 2008 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Sun, 02 Mar 2008 23:52:59 +0100 CET Subject: [Haiku-commits] r24179 - in haiku/trunk: headers/build src/build/libhaikucompat In-Reply-To: <9612247463-BeMail@primary> Message-ID: <34822732653-BeMail@zon> "Michael Lotz" wrote: > > > Log: > > > Hopefully final build fix for Dano; at least I build everything > > > with "-a" this time and it worked :-) > It seems that this broke the build for BONE. I had to add the > following > to the libhaikucompat jamfile to get it to work again over here: > > if $(HOST_PLATFORM) = bone { > ObjectDefines $(libbePatchSources) : > USING_HAIKU_TYPE_CONSTANTS_H= ; > } > > Which is the same as the one for Dano except for the "IMPEX_BE=" part > as this generates a lot of redefinition warnings under BONE. Sorry! I currently don't have any working R5 around anymore; I guess I need to set it up in VMware/Qemu to be able to continue to use it :-/ Can you commit this change? Bye, Axel. From mmlr at mail.berlios.de Mon Mar 3 00:13:50 2008 From: mmlr at mail.berlios.de (mmlr at BerliOS) Date: Mon, 3 Mar 2008 00:13:50 +0100 Subject: [Haiku-commits] r24210 - haiku/trunk/src/build/libhaikucompat Message-ID: <200803022313.m22NDou0011077@sheep.berlios.de> Author: mmlr Date: 2008-03-03 00:13:50 +0100 (Mon, 03 Mar 2008) New Revision: 24210 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24210&view=rev Modified: haiku/trunk/src/build/libhaikucompat/Jamfile Log: Use the USING_HAIKU_TYPE_CONSTANTS_H define also for the BONE platform. Maybe this needs to be extended to plain R5 as well, but I cannot currently test that. Modified: haiku/trunk/src/build/libhaikucompat/Jamfile =================================================================== --- haiku/trunk/src/build/libhaikucompat/Jamfile 2008-03-02 21:22:57 UTC (rev 24209) +++ haiku/trunk/src/build/libhaikucompat/Jamfile 2008-03-02 23:13:50 UTC (rev 24210) @@ -25,6 +25,10 @@ : [ FDirName $(HAIKU_TOP) headers build os support ] ; ObjectSysHdrs $(libbePatchSources) : [ FDirName $(HAIKU_TOP) headers build os storage ] ; + if $(HOST_PLATFORM) = bone { + ObjectDefines $(libbePatchSources) : + USING_HAIKU_TYPE_CONSTANTS_H= ; + } if $(HOST_PLATFORM) = dano { ObjectDefines $(libbePatchSources) : _IMPEXP_BE= USING_HAIKU_TYPE_CONSTANTS_H= ; From mmu_man at mail.berlios.de Mon Mar 3 00:14:55 2008 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Mon, 3 Mar 2008 00:14:55 +0100 Subject: [Haiku-commits] r24211 - in haiku/trunk/src/system/boot/platform: atari_m68k bios_ia32 Message-ID: <200803022314.m22NEttw011182@sheep.berlios.de> Author: mmu_man Date: 2008-03-03 00:14:54 +0100 (Mon, 03 Mar 2008) New Revision: 24211 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24211&view=rev Modified: haiku/trunk/src/system/boot/platform/atari_m68k/devices.cpp haiku/trunk/src/system/boot/platform/bios_ia32/devices.cpp Log: Setting a Bool when you actually Get a Bool might help... Modified: haiku/trunk/src/system/boot/platform/atari_m68k/devices.cpp =================================================================== --- haiku/trunk/src/system/boot/platform/atari_m68k/devices.cpp 2008-03-02 23:13:50 UTC (rev 24210) +++ haiku/trunk/src/system/boot/platform/atari_m68k/devices.cpp 2008-03-02 23:14:54 UTC (rev 24211) @@ -942,7 +942,7 @@ } TRACE(("boot drive size: %Ld bytes\n", drive->Size())); - gKernelArgs.boot_volume.SetInt32(BOOT_VOLUME_BOOTED_FROM_IMAGE, + gKernelArgs.boot_volume.SetBool(BOOT_VOLUME_BOOTED_FROM_IMAGE, gBootedFromImage); return B_OK; Modified: haiku/trunk/src/system/boot/platform/bios_ia32/devices.cpp =================================================================== --- haiku/trunk/src/system/boot/platform/bios_ia32/devices.cpp 2008-03-02 23:13:50 UTC (rev 24210) +++ haiku/trunk/src/system/boot/platform/bios_ia32/devices.cpp 2008-03-02 23:14:54 UTC (rev 24211) @@ -757,7 +757,7 @@ } TRACE(("boot drive size: %Ld bytes\n", drive->Size())); - gKernelArgs.boot_volume.SetInt32(BOOT_VOLUME_BOOTED_FROM_IMAGE, + gKernelArgs.boot_volume.SetBool(BOOT_VOLUME_BOOTED_FROM_IMAGE, gBootedFromImage); return B_OK; From axeld at mail.berlios.de Mon Mar 3 00:17:26 2008 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Mon, 3 Mar 2008 00:17:26 +0100 Subject: [Haiku-commits] r24212 - haiku/trunk/src/add-ons/kernel/file_systems/bfs Message-ID: <200803022317.m22NHQ8V011348@sheep.berlios.de> Author: axeld Date: 2008-03-03 00:17:26 +0100 (Mon, 03 Mar 2008) New Revision: 24212 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24212&view=rev Modified: haiku/trunk/src/add-ons/kernel/file_systems/bfs/Volume.cpp Log: * Ever since I added O_NOCACHE to the flags BFS is using to open its device, the read-only detection did not work anymore; I've now added handy methods to correctly check for this. This fixes bug #1829. * Volume::Initialize() now also checks if the device could really be opened read/write. * Minor cleanup. Modified: haiku/trunk/src/add-ons/kernel/file_systems/bfs/Volume.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/bfs/Volume.cpp 2008-03-02 23:14:54 UTC (rev 24211) +++ haiku/trunk/src/add-ons/kernel/file_systems/bfs/Volume.cpp 2008-03-02 23:17:26 UTC (rev 24212) @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007, Axel D?rfler, axeld at pinc-software.de. + * Copyright 2001-2008, Axel D?rfler, axeld at pinc-software.de. * This file may be used under the terms of the MIT License. */ @@ -40,10 +40,16 @@ int Device() const { return fDevice; } int Mode() const { return fMode; } + bool IsReadOnly() const { return _IsReadOnly(fMode); } status_t GetSize(off_t *_size, uint32 *_blockSize = NULL); private: + static bool _IsReadOnly(int mode) + { return (mode & O_RWMASK) == O_RDONLY;} + static bool _IsReadWrite(int mode) + { return (mode & O_RWMASK) == O_RDWR;} + int fDevice; int fMode; void *fBlockCache; @@ -82,7 +88,7 @@ if (fDevice < 0) fDevice = errno; - if (fDevice < 0 && mode == O_RDWR) { + if (fDevice < 0 && _IsReadWrite(mode)) { // try again to open read-only (don't rely on a specific error code) return Open(device, O_RDONLY | O_NOCACHE); } @@ -90,7 +96,7 @@ if (fDevice >= 0) { // opening succeeded fMode = mode; - if (mode == O_RDWR) { + if (_IsReadWrite(mode)) { // check out if the device really allows for read/write access device_geometry geometry; if (!ioctl(fDevice, B_GET_GEOMETRY, &geometry)) { @@ -145,10 +151,9 @@ } -/** Returns the size of the device in bytes. It uses B_GET_GEOMETRY - * to compute the size, or fstat() if that failed. - */ - +/*! Returns the size of the device in bytes. It uses B_GET_GEOMETRY + to compute the size, or fstat() if that failed. +*/ status_t DeviceOpener::GetSize(off_t *_size, uint32 *_blockSize) { @@ -319,7 +324,7 @@ if (fDevice < B_OK) RETURN_ERROR(fDevice); - if (opener.Mode() == O_RDONLY) + if (opener.IsReadOnly()) fFlags |= VOLUME_READ_ONLY; // check if it's a regular file, and if so, disable the cache for the @@ -513,8 +518,7 @@ } -/*! - Checks if there is a live query whose results depend on the presence +/*! Checks if there is a live query whose results depend on the presence or value of the specified attribute. Don't use it if you already have all the data together to evaluate the queries - it wouldn't safe you anything in this case. @@ -595,6 +599,9 @@ if (opener.Device() < B_OK) return B_BAD_VALUE; + if (opener.IsReadOnly()) + return B_READ_ONLY_DEVICE; + fDevice = opener.Device(); uint32 deviceBlockSize; From umccullough at gmail.com Mon Mar 3 00:30:59 2008 From: umccullough at gmail.com (Urias McCullough) Date: Sun, 2 Mar 2008 15:30:59 -0800 Subject: [Haiku-commits] r24179 - in haiku/trunk: headers/build src/build/libhaikucompat In-Reply-To: <34822732653-BeMail@zon> References: <9612247463-BeMail@primary> <34822732653-BeMail@zon> Message-ID: <1e80d8750803021530q4d58aab2g5ad02f7c2bb35343@mail.gmail.com> On 02/03/2008, Axel D?rfler wrote: > "Michael Lotz" wrote: > > > > Log: > > > > Hopefully final build fix for Dano; at least I build everything > > > > with "-a" this time and it worked :-) > > It seems that this broke the build for BONE. I had to add the > > following > > to the libhaikucompat jamfile to get it to work again over here: > > > > if $(HOST_PLATFORM) = bone { > > ObjectDefines $(libbePatchSources) : > > USING_HAIKU_TYPE_CONSTANTS_H= ; > > } > > > > Which is the same as the one for Dano except for the "IMPEX_BE=" part > > as this generates a lot of redefinition warnings under BONE. > > > Sorry! I currently don't have any working R5 around anymore; I guess I > need to set it up in VMware/Qemu to be able to continue to use it :-/ > Can you commit this change? Let me know if you need a VMWare image of BeOS Max V4b1 with vmware drivers installed and latest gcc from bebits... I just built one couple days ago for someone else. It doesn't work properly in VMWare server 1.0.x, but does work great in vmware player 2.0.2 From revol at free.fr Mon Mar 3 00:36:28 2008 From: revol at free.fr (=?windows-1252?q?Fran=E7ois?= Revol) Date: Mon, 03 Mar 2008 00:36:28 +0100 CET Subject: [Haiku-commits] r24201 - in haiku/trunk: . build/jam In-Reply-To: <47CADEF0.3070607@zappotek.com> Message-ID: <27014364638-BeMail@laptop> > Urias McCullough a ?crit : > > On 02/03/2008, Fran?ois Revol wrote: > > > >>>> Rules and targets to build a boot CD iso... use: > >>>> > >> > > jam haiku-boot-cd > >> > > >> > Ah cool! If you are planning to perfect this, please take > > > > ticket > >> > #1268. Can I try this already, or is it WIP? > >> > >> It builds an image, but I don't know if it would boot on real hw. > >> I tried in qemu (appending haiku.image to it and using qemu -cd > > > foo - > >> cdtoc 0,904 but I'm not sure it's how it works) but it gives the > > > boot > >> menu without anyway to continue. > >> > > > > I tried on real hardware. I got an error about no boot partitions, > > and > > then the boot menu, but it couldn't find the image on the CD. It * > > was* > > able to find my HD Haiku partition and boot that. > > > Same here! http://dev.haiku-os.org/ticket/1364 . It used to work > around > summer 2006 iirc though. Ok, it's not loading the tgz data, need to see if it works on a CD (doesn't work with -fda & -cdrom). Fran?ois. From axeld at pinc-software.de Mon Mar 3 00:41:25 2008 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Mon, 03 Mar 2008 00:41:25 +0100 CET Subject: [Haiku-commits] =?iso-8859-15?q?r24179_-_in_haiku/trunk=3A_header?= =?iso-8859-15?q?s/build_src/build/libhaikucompat?= In-Reply-To: <1e80d8750803021530q4d58aab2g5ad02f7c2bb35343@mail.gmail.com> Message-ID: <37728882644-BeMail@zon> "Urias McCullough" wrote: > On 02/03/2008, Axel D?rfler wrote: > > Sorry! I currently don't have any working R5 around anymore; I > > guess I > > need to set it up in VMware/Qemu to be able to continue to use it > > :-/ > > Can you commit this change? > Let me know if you need a VMWare image of BeOS Max V4b1 with vmware > drivers installed and latest gcc from bebits... I just built one > couple days ago for someone else. It doesn't work properly in VMWare > server 1.0.x, but does work great in vmware player 2.0.2 Does it use BONE or net_server? In any way, such an image might be helpful, thanks! :-) Bye, Axel. From umccullough at gmail.com Mon Mar 3 02:31:38 2008 From: umccullough at gmail.com (Urias McCullough) Date: Sun, 2 Mar 2008 17:31:38 -0800 Subject: [Haiku-commits] r24179 - in haiku/trunk: headers/build src/build/libhaikucompat In-Reply-To: <37728882644-BeMail@zon> References: <1e80d8750803021530q4d58aab2g5ad02f7c2bb35343@mail.gmail.com> <37728882644-BeMail@zon> Message-ID: <1e80d8750803021731h6456f1dclbc1fec14d1a0b058@mail.gmail.com> On 02/03/2008, Axel D?rfler wrote: > "Urias McCullough" wrote: > > On 02/03/2008, Axel D?rfler wrote: > > > > Sorry! I currently don't have any working R5 around anymore; I > > > guess I > > > need to set it up in VMware/Qemu to be able to continue to use it > > > :-/ > > > Can you commit this change? > > Let me know if you need a VMWare image of BeOS Max V4b1 with vmware > > drivers installed and latest gcc from bebits... I just built one > > couple days ago for someone else. It doesn't work properly in VMWare > > server 1.0.x, but does work great in vmware player 2.0.2 > > > Does it use BONE or net_server? In any way, such an image might be > helpful, thanks! :-) It's currently net_server... I believe it also has the athlon patch applied, and the memory-limited bootloader. I will put it on a server and email you the URL privately (to keep my bandwidth usage in check ;) From jackburton at mail.berlios.de Mon Mar 3 13:29:08 2008 From: jackburton at mail.berlios.de (jackburton at BerliOS) Date: Mon, 3 Mar 2008 13:29:08 +0100 Subject: [Haiku-commits] r24213 - haiku/trunk/src/kits/interface Message-ID: <200803031229.m23CT82b015530@sheep.berlios.de> Author: jackburton Date: 2008-03-03 13:29:07 +0100 (Mon, 03 Mar 2008) New Revision: 24213 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24213&view=rev Modified: haiku/trunk/src/kits/interface/Menu.cpp Log: x_offset -> xOffset Modified: haiku/trunk/src/kits/interface/Menu.cpp =================================================================== --- haiku/trunk/src/kits/interface/Menu.cpp 2008-03-02 23:17:26 UTC (rev 24212) +++ haiku/trunk/src/kits/interface/Menu.cpp 2008-03-03 12:29:07 UTC (rev 24213) @@ -1641,28 +1641,28 @@ fSelected->Submenu()->Bounds()); fSelected->Submenu()->UnlockLooper(); - float x_offset; + float xOffset; // navAreaRectAbove and navAreaRectBelow have the same X // position and width, so it doesn't matter which one we use to // calculate the X offset if (menuBounds.left < submenuBounds.left) - x_offset = position.x - navAreaRectAbove.left; + xOffset = position.x - navAreaRectAbove.left; else - x_offset = navAreaRectAbove.right - position.x; + xOffset = navAreaRectAbove.right - position.x; bool inNavArea; if (inNavAreaRectAbove) { - float y_offset = navAreaRectAbove.bottom - position.y; + float yOffset = navAreaRectAbove.bottom - position.y; float ratio = navAreaRectAbove.Width() / navAreaRectAbove.Height(); - inNavArea = y_offset <= x_offset / ratio; + inNavArea = yOffset <= xOffset / ratio; } else { - float y_offset = navAreaRectBelow.bottom - position.y; + float yOffset = navAreaRectBelow.bottom - position.y; float ratio = navAreaRectBelow.Width() / navAreaRectBelow.Height(); - inNavArea = y_offset >= (navAreaRectBelow.Height() - x_offset / ratio); + inNavArea = yOffset >= (navAreaRectBelow.Height() - xOffset / ratio); } bigtime_t systime = system_time(); From jackburton at mail.berlios.de Mon Mar 3 13:41:06 2008 From: jackburton at mail.berlios.de (jackburton at BerliOS) Date: Mon, 3 Mar 2008 13:41:06 +0100 Subject: [Haiku-commits] r24214 - haiku/trunk/src/kits/interface Message-ID: <200803031241.m23Cf6Yn016872@sheep.berlios.de> Author: jackburton Date: 2008-03-03 13:41:05 +0100 (Mon, 03 Mar 2008) New Revision: 24214 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24214&view=rev Modified: haiku/trunk/src/kits/interface/TabView.cpp Log: patch by Andrea Anzani (with a few style modification by me) which enables tab (as BTab) switching via mouse wheel. Thanks! Modified: haiku/trunk/src/kits/interface/TabView.cpp =================================================================== --- haiku/trunk/src/kits/interface/TabView.cpp 2008-03-03 12:29:07 UTC (rev 24213) +++ haiku/trunk/src/kits/interface/TabView.cpp 2008-03-03 12:41:05 UTC (rev 24214) @@ -508,37 +508,68 @@ void BTabView::MessageReceived(BMessage *message) { - if (message->what == B_GET_PROPERTY || message->what == B_SET_PROPERTY) { - BMessage reply(B_REPLY); - bool handled = false; + switch (message->what) { + case B_GET_PROPERTY: + case B_SET_PROPERTY: + { + BMessage reply(B_REPLY); + bool handled = false; - BMessage specifier; - int32 index; - int32 form; - const char *property; - if (message->GetCurrentSpecifier(&index, &specifier, &form, &property) == B_OK) { - if (strcmp(property, "Selection") == 0) { - if (message->what == B_GET_PROPERTY) { - reply.AddInt32("result", fSelection); - handled = true; - } else { - // B_GET_PROPERTY - int32 selection; - if (message->FindInt32("data", &selection) == B_OK) { - Select(selection); - reply.AddInt32("error", B_OK); + BMessage specifier; + int32 index; + int32 form; + const char *property; + if (message->GetCurrentSpecifier(&index, &specifier, &form, &property) == B_OK) { + if (strcmp(property, "Selection") == 0) { + if (message->what == B_GET_PROPERTY) { + reply.AddInt32("result", fSelection); handled = true; + } else { + // B_GET_PROPERTY + int32 selection; + if (message->FindInt32("data", &selection) == B_OK) { + Select(selection); + reply.AddInt32("error", B_OK); + handled = true; + } } } } + + if (handled) + message->SendReply(&reply); + else + BView::MessageReceived(message); + break; } - if (handled) { - message->SendReply(&reply); - return; + case B_MOUSE_WHEEL_CHANGED: + { + float deltaX = 0.0f; + float deltaY = 0.0f; + message->FindFloat("be:wheel_delta_x", &deltaX); + message->FindFloat("be:wheel_delta_y", &deltaY); + + if (deltaX == 0.0f && deltaY == 0.0f) + return; + + if (deltaY == 0.0f) + deltaY = deltaX; + + int32 selection = Selection(); + int32 numTabs = CountTabs(); + if (deltaY > 0 && selection < numTabs - 1) { + //move to the right tab. + Select(Selection() + 1); + } else if (deltaY < 0 && selection > 0 && numTabs > 1) { + //move to the left tab. + Select(selection - 1); + } } + default: + BView::MessageReceived(message); + break; } - BView::MessageReceived(message); } From axeld at mail.berlios.de Mon Mar 3 15:55:38 2008 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Mon, 3 Mar 2008 15:55:38 +0100 Subject: [Haiku-commits] r24215 - haiku/trunk/src/add-ons/kernel/drivers/audio/hda Message-ID: <200803031455.m23EtcLi003202@sheep.berlios.de> Author: axeld Date: 2008-03-03 15:55:37 +0100 (Mon, 03 Mar 2008) New Revision: 24215 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24215&view=rev Modified: haiku/trunk/src/add-ons/kernel/drivers/audio/hda/driver.h haiku/trunk/src/add-ons/kernel/drivers/audio/hda/hda_codec.cpp haiku/trunk/src/add-ons/kernel/drivers/audio/hda/hda_codec_defs.h Log: * Also print the codec's revision. * Only print [Output] if it's an output. * Further cleanup. Modified: haiku/trunk/src/add-ons/kernel/drivers/audio/hda/driver.h =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/audio/hda/driver.h 2008-03-03 12:41:05 UTC (rev 24214) +++ haiku/trunk/src/add-ons/kernel/drivers/audio/hda/driver.h 2008-03-03 14:55:37 UTC (rev 24215) @@ -114,7 +114,7 @@ } d; }; -/*! This structure describes a single Audio Function Group. An afg +/*! This structure describes a single Audio Function Group. An AFG is a group of audio widgets which can be used to configure multiple streams of audio either from the HDA Link to an output device (= playback) or from an input device to the HDA link (= recording). Modified: haiku/trunk/src/add-ons/kernel/drivers/audio/hda/hda_codec.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/audio/hda/hda_codec.cpp 2008-03-03 12:41:05 UTC (rev 24214) +++ haiku/trunk/src/add-ons/kernel/drivers/audio/hda/hda_codec.cpp 2008-03-03 14:55:37 UTC (rev 24215) @@ -128,7 +128,8 @@ corb_t verb; uint32 resp; - verb = MAKE_VERB(codec->addr, nodeID, VID_GET_PARAMETER, PID_OUTPUT_AMP_CAP); + verb = MAKE_VERB(codec->addr, nodeID, VID_GET_PARAMETER, + PID_OUTPUT_AMPLIFIER_CAP); rc = hda_send_verbs(codec, &verb, &resp, 1); if (rc == B_OK && resp != 0) { dprintf("\tAMP: Mute: %s, step size: %ld, # steps: %ld, offset: %ld\n", @@ -159,7 +160,7 @@ verbs[1] = MAKE_VERB(audioGroup->codec->addr, audioGroup->root_node_id, VID_GET_PARAMETER, PID_GPIO_COUNT); verbs[2] = MAKE_VERB(audioGroup->codec->addr, audioGroup->root_node_id, - VID_GET_PARAMETER, PID_SUBORD_NODE_COUNT); + VID_GET_PARAMETER, PID_SUBORDINATE_NODE_COUNT); if (hda_send_verbs(audioGroup->codec, verbs, resp, 3) != B_OK) return B_ERROR; @@ -266,7 +267,7 @@ dprintf("\t%s%s\n", audioGroup->widgets[widx].d.pin.input ? "[Input] " : "", - audioGroup->widgets[widx].d.pin.input ? "[Output]" : ""); + audioGroup->widgets[widx].d.pin.output ? "[Output]" : ""); } else { dprintf("%s: Error getting Pin Complex IO\n", __func__); } @@ -451,6 +452,7 @@ audioGroup->widgets[i].inputs[inputIndex], WT_AUDIO_OUTPUT, 0); } else { + // find and select output widget for (inputIndex = 0; (uint32)inputIndex < audioGroup->widgets[i].num_inputs; inputIndex++) { outputWidget = hda_codec_audio_group_find_path(audioGroup, @@ -485,11 +487,12 @@ verb[0] = MAKE_VERB(codec->addr, audioGroup->playback_stream->pin_widget, VID_SET_AMPLIFIER_GAIN_MUTE, - (1 << 15) | (1 << 13) | (1 << 12)); + AMP_SET_OUTPUT | AMP_SET_LEFT_CHANNEL + | AMP_SET_RIGHT_CHANNEL); verb[1] = MAKE_VERB(codec->addr, audioGroup->playback_stream->pin_widget, VID_SET_PIN_WIDGET_CONTROL, - (1 << 7) | (1 << 6)); + PIN_ENABLE_HEAD_PHONE | PIN_ENABLE_OUTPUT); hda_send_verbs(codec, verb, NULL, 2); dprintf("%s: Found output PIN (%s) connected to output " @@ -507,6 +510,7 @@ audioGroup->widgets[i].inputs[inputIndex], WT_PIN_COMPLEX, 0); } else { + // find and select input widget for (inputIndex = 0; (uint32)inputIndex < audioGroup->widgets[i].num_inputs; inputIndex++) { inputWidget = hda_codec_audio_group_find_path(audioGroup, @@ -541,9 +545,10 @@ verb = MAKE_VERB(codec->addr, audioGroup->record_stream->pin_widget, VID_SET_AMPLIFIER_GAIN_MUTE, - (1 << 15) | (1 << 13) | (1 << 12)); + AMP_SET_INPUT | AMP_SET_LEFT_CHANNEL + | AMP_SET_RIGHT_CHANNEL); hda_send_verbs(codec, &verb, NULL, 1); - } + } dprintf("%s: Found input PIN (%s) connected to input CONV " "wid:%ld\n", __func__, kDefaultDevice[audioGroup->widgets[ @@ -571,74 +576,86 @@ void hda_codec_delete(hda_codec* codec) { - if (codec == NULL) { - uint32 idx; + if (codec == NULL) + return; - delete_sem(codec->response_sem); + delete_sem(codec->response_sem); - for (idx = 0; idx < codec->num_audio_groups; idx++) { - hda_codec_delete_audio_group(codec->audio_groups[idx]); - codec->audio_groups[idx] = NULL; - } + for (uint32 i = 0; i < codec->num_audio_groups; i++) { + hda_codec_delete_audio_group(codec->audio_groups[i]); + codec->audio_groups[i] = NULL; + } - free(codec); - } + free(codec); } hda_codec* -hda_codec_new(hda_controller* controller, uint32 cad) +hda_codec_new(hda_controller* controller, uint32 codecAddress) { + if (codecAddress > HDA_MAX_CODECS) + return NULL; + hda_codec* codec = (hda_codec*)calloc(1, sizeof(hda_codec)); - uint32 responses[3]; - corb_t verbs[3]; - uint32 nodeID; - if (codec == NULL) - goto exit_new; + return NULL; codec->controller = controller; - codec->addr = cad; + codec->addr = codecAddress; codec->response_sem = create_sem(0, "hda_codec_response_sem"); - controller->codecs[cad] = codec; + controller->codecs[codecAddress] = codec; - verbs[0] = MAKE_VERB(cad, 0, VID_GET_PARAMETER, PID_VENDOR_ID); - verbs[1] = MAKE_VERB(cad, 0, VID_GET_PARAMETER, PID_REVISION_ID); - verbs[2] = MAKE_VERB(cad, 0, VID_GET_PARAMETER, PID_SUBORD_NODE_COUNT); + struct { + uint32 device : 16; + uint32 vendor : 16; + uint32 stepping : 8; + uint32 revision : 8; + uint32 minor : 4; + uint32 major : 4; + uint32 _reserved0 : 8; + uint32 count : 8; + uint32 _reserved1 : 8; + uint32 start : 8; + uint32 _reserved2 : 8; + } response; + corb_t verbs[3]; - if (hda_send_verbs(codec, verbs, responses, 3) != B_OK) - goto cmd_failed; + verbs[0] = MAKE_VERB(codecAddress, 0, VID_GET_PARAMETER, PID_VENDOR_ID); + verbs[1] = MAKE_VERB(codecAddress, 0, VID_GET_PARAMETER, PID_REVISION_ID); + verbs[2] = MAKE_VERB(codecAddress, 0, VID_GET_PARAMETER, + PID_SUBORDINATE_NODE_COUNT); - dprintf("Codec %ld Vendor: %04lx Product: %04lx\n", - cad, responses[0] >> 16, responses[0] & 0xffff); + if (hda_send_verbs(codec, verbs, (uint32*)&response, 3) != B_OK) + goto err; - for (nodeID = responses[2] >> 16; - nodeID < (responses[2] >> 16) + (responses[2] & 0xff); nodeID++) { - uint32 resp; - verbs[0] = MAKE_VERB(cad, nodeID, VID_GET_PARAMETER, + dprintf("Codec %ld Vendor: %04lx Product: %04lx, Revision: " + "%lu.%lu.%lu.%lu\n", codecAddress, response.vendor, response.device, + response.major, response.minor, response.revision, response.stepping); + + for (uint32 nodeID = response.start; nodeID < response.start + + response.count; nodeID++) { + uint32 groupType; + verbs[0] = MAKE_VERB(codecAddress, nodeID, VID_GET_PARAMETER, PID_FUNCTION_GROUP_TYPE); - if (hda_send_verbs(codec, verbs, &resp, 1) != B_OK) - goto cmd_failed; + if (hda_send_verbs(codec, verbs, &groupType, 1) != B_OK) + goto err; - if ((resp & 0xff) == 1) { + if ((groupType & 0xff) == 1) { /* Found an Audio Function Group! */ - status_t rc = hda_codec_new_audio_group(codec, nodeID); - if (rc != B_OK) { - dprintf("%s: Failed to setup new audio function group (%s)!\n", - __func__, strerror(rc)); - goto cmd_failed; + status_t status = hda_codec_new_audio_group(codec, nodeID); + if (status != B_OK) { + dprintf("hda: Failed to setup new audio function group (%s)!\n", + strerror(status)); + goto err; } } } - goto exit_new; + return codec; -cmd_failed: - controller->codecs[cad] = NULL; +err: + controller->codecs[codecAddress] = NULL; hda_codec_delete(codec); - codec = NULL; - -exit_new: - return codec; + return NULL; } Modified: haiku/trunk/src/add-ons/kernel/drivers/audio/hda/hda_codec_defs.h =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/audio/hda/hda_codec_defs.h 2008-03-03 12:41:05 UTC (rev 24214) +++ haiku/trunk/src/add-ons/kernel/drivers/audio/hda/hda_codec_defs.h 2008-03-03 14:55:37 UTC (rev 24215) @@ -101,8 +101,8 @@ #define VID_SET_GPIOSTICKY 0x71A00 #define VID_GET_BEEPGEN 0xF0A00 #define VID_SET_BEEPGEN 0x70A00 -#define VID_GET_VOLUMEKNOB 0xF0F00 -#define VID_SET_VOLUMEKNOB 0x70F00 +#define VID_GET_VOLUME_KNOB 0xf0f00 +#define VID_SET_VOLUME_KNOB 0x70f00 #define VID_GET_SUBSYSTEMID 0xF2000 #define VID_SET_SUBSYSTEMID1 0x72000 #define VID_SET_SUBSYSTEMID2 0x72100 @@ -113,38 +113,62 @@ #define VID_SET_CONFIGURATION_DEFAULT2 0x71d00 #define VID_SET_CONFIGURATION_DEFAULT3 0x71e00 #define VID_SET_CONFIGURATION_DEFAULT4 0x71f00 -#define VID_GET_STRIPECTRL 0xF2400 -#define VID_SET_STRIPECTRL 0x72000 -#define VID_FUNCTION_RESET 0x7FF00 +#define VID_GET_STRIPE_CONTROL 0xf2400 +#define VID_SET_STRIPE_CONTROL 0x72000 +#define VID_FUNCTION_RESET 0x7ff00 /* Parameter IDs */ -#define PID_VENDOR_ID 0x00 -#define PID_REVISION_ID 0x02 -#define PID_SUBORD_NODE_COUNT 0x04 -#define PID_FUNCTION_GROUP_TYPE 0x05 -#define PID_AUDIO_GROUP_CAP 0x08 -#define PID_AUDIO_WIDGET_CAP 0x09 -#define PID_PCM_SUPPORT 0x0A -#define PID_STREAM_SUPPORT 0x0B -#define PID_PIN_CAP 0x0C -#define PID_INPUT_AMP_CAP 0x0D -#define PID_CONNECTION_LIST_LENGTH 0x0E -#define PID_POWERSTATE_SUPPORT 0x0F -#define PID_PROCESSING_CAP 0x10 -#define PID_GPIO_COUNT 0x11 -#define PID_OUTPUT_AMP_CAP 0x12 -#define PID_VOLUMEKNOB_CAP 0x13 +#define PID_VENDOR_ID 0x00 +#define PID_REVISION_ID 0x02 +#define PID_SUBORDINATE_NODE_COUNT 0x04 +#define PID_FUNCTION_GROUP_TYPE 0x05 +#define PID_AUDIO_GROUP_CAP 0x08 +#define PID_AUDIO_WIDGET_CAP 0x09 +#define PID_PCM_SUPPORT 0x0a +#define PID_STREAM_SUPPORT 0x0b +#define PID_PIN_CAP 0x0c +#define PID_INPUT_AMPLIFIER_CAP 0x0d +#define PID_CONNECTION_LIST_LENGTH 0x0e +#define PID_POWERSTATE_SUPPORT 0x0f +#define PID_PROCESSING_CAP 0x10 +#define PID_GPIO_COUNT 0x11 +#define PID_OUTPUT_AMPLIFIER_CAP 0x12 +#define PID_VOLUME_KNOB_CAP 0x13 /* PCM support */ -#define PCM_8_BIT (1L << 16) -#define PCM_16_BIT (1L << 17) -#define PCM_20_BIT (1L << 18) -#define PCM_24_BIT (1L << 19) -#define PCM_32_BIT (1L << 20) +#define PCM_8_BIT (1L << 16) +#define PCM_16_BIT (1L << 17) +#define PCM_20_BIT (1L << 18) +#define PCM_24_BIT (1L << 19) +#define PCM_32_BIT (1L << 20) /* stream support */ -#define STREAM_AC3 0x00000004 -#define STREAM_FLOAT 0x00000002 -#define STREAM_PCM 0x00000001 +#define STREAM_AC3 0x00000004 +#define STREAM_FLOAT 0x00000002 +#define STREAM_PCM 0x00000001 +/* Amplifier Gain/Mute */ +#define AMP_GET_OUTPUT (1L << 15) +#define AMP_GET_INPUT (0L << 15) +#define AMP_GET_LEFT_CHANNEL (1L << 13) +#define AMP_GET_RIGHT_CHANNEL (0L << 13) +#define AMP_GET_INPUT_INDEX_MASK 0x0000000f +#define AMP_GET_INPUT_INDEX_SHIFT 0 + +#define AMP_SET_OUTPUT (1L << 15) +#define AMP_SET_INPUT (1L << 14) +#define AMP_SET_LEFT_CHANNEL (1L << 13) +#define AMP_SET_RIGHT_CHANNEL (1L << 12) +#define AMP_SET_INPUT_INDEX_MASK 0x00000f00 +#define AMP_SET_INPUT_INDEX_SHIFT 8 + +#define AMP_GAIN_MASK 0x0000007f +#define AMP_MUTE (1L << 8) + +/* Pin Widget Control */ +#define PIN_ENABLE_HEAD_PHONE (1L << 7) +#define PIN_ENABLE_OUTPUT (1L << 6) +#define PIN_ENABLE_INPUT (1L << 5) +#define PIN_ENABLE_VOLTAGE_REF_MASK 0x3 + #endif /* HDA_CODEC_H */ From stippi at mail.berlios.de Mon Mar 3 21:58:17 2008 From: stippi at mail.berlios.de (stippi at BerliOS) Date: Mon, 3 Mar 2008 21:58:17 +0100 Subject: [Haiku-commits] r24216 - haiku/trunk/src/apps/aboutsystem Message-ID: <200803032058.m23KwHE8026686@sheep.berlios.de> Author: stippi Date: 2008-03-03 21:58:16 +0100 (Mon, 03 Mar 2008) New Revision: 24216 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24216&view=rev Modified: haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp Log: Added James Urquhart to the list of contributors. Modified: haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp =================================================================== --- haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp 2008-03-03 14:55:37 UTC (rev 24215) +++ haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp 2008-03-03 20:58:16 UTC (rev 24216) @@ -452,6 +452,7 @@ "Daniel Switkin\n" "Atsushi Takamatsu\n" "Oliver Tappe\n" + "James Urquhart\n" "Jason Vandermark\n" "Sandor Vroemisse\n" "Denis Washington\n" From mmu_man at mail.berlios.de Mon Mar 3 22:16:30 2008 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Mon, 3 Mar 2008 22:16:30 +0100 Subject: [Haiku-commits] r24217 - haiku/trunk/src/apps/aboutsystem Message-ID: <200803032116.m23LGTCR028421@sheep.berlios.de> Author: mmu_man Date: 2008-03-03 22:16:29 +0100 (Mon, 03 Mar 2008) New Revision: 24217 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24217&view=rev Modified: haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp Log: Added Rene Gollent to the list of contributors, how come we forgot ? Modified: haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp =================================================================== --- haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp 2008-03-03 20:58:16 UTC (rev 24216) +++ haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp 2008-03-03 21:16:29 UTC (rev 24217) @@ -404,6 +404,7 @@ "Marc Flerackers\n" "Daniel Furrer\n" "Troeglazov Gerasim\n" + "Rene Gollent\n" "Matthijs Hollemans\n" "Morgan Howe\n" "Erik Jaesler\n" From superstippi at gmx.de Mon Mar 3 23:07:11 2008 From: superstippi at gmx.de (Stephan Assmus) Date: Mon, 03 Mar 2008 23:07:11 +0100 Subject: [Haiku-commits] r24217 - haiku/trunk/src/apps/aboutsystem In-Reply-To: <200803032116.m23LGTCR028421@sheep.berlios.de> References: <200803032116.m23LGTCR028421@sheep.berlios.de> Message-ID: <20080303230711.15943.9@stippis2.1204533653.fake> On 2008-03-03 at 22:16:30 [+0100], mmu_man at BerliOS wrote: > Author: mmu_man > Date: 2008-03-03 22:16:29 +0100 (Mon, 03 Mar 2008) New Revision: 24217 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24217&view=rev > > Modified: > haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp > Log: > Added Rene Gollent to the list of contributors, how come we forgot ? Actually, it should be the Developers list. Anyone with commit access is a developer. :-) Best regards, -Stephan From stippi at mail.berlios.de Mon Mar 3 23:25:17 2008 From: stippi at mail.berlios.de (stippi at BerliOS) Date: Mon, 3 Mar 2008 23:25:17 +0100 Subject: [Haiku-commits] r24218 - haiku/trunk/src/build/libhaikucompat Message-ID: <200803032225.m23MPH3c002451@sheep.berlios.de> Author: stippi Date: 2008-03-03 23:25:16 +0100 (Mon, 03 Mar 2008) New Revision: 24218 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24218&view=rev Modified: haiku/trunk/src/build/libhaikucompat/Jamfile Log: R5 host platform needs this too (for Haiku target platform). Modified: haiku/trunk/src/build/libhaikucompat/Jamfile =================================================================== --- haiku/trunk/src/build/libhaikucompat/Jamfile 2008-03-03 21:16:29 UTC (rev 24217) +++ haiku/trunk/src/build/libhaikucompat/Jamfile 2008-03-03 22:25:16 UTC (rev 24218) @@ -25,6 +25,10 @@ : [ FDirName $(HAIKU_TOP) headers build os support ] ; ObjectSysHdrs $(libbePatchSources) : [ FDirName $(HAIKU_TOP) headers build os storage ] ; + if $(HOST_PLATFORM) = r5 { + ObjectDefines $(libbePatchSources) : + USING_HAIKU_TYPE_CONSTANTS_H= ; + } if $(HOST_PLATFORM) = bone { ObjectDefines $(libbePatchSources) : USING_HAIKU_TYPE_CONSTANTS_H= ; From revol at free.fr Mon Mar 3 23:46:55 2008 From: revol at free.fr (=?windows-1252?q?Fran=E7ois?= Revol) Date: Mon, 03 Mar 2008 23:46:55 +0100 CET Subject: [Haiku-commits] r24217 - haiku/trunk/src/apps/aboutsystem In-Reply-To: <20080303230711.15943.9@stippis2.1204533653.fake> Message-ID: <7496226254-BeMail@laptop> > > Modified: > > haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp > > Log: > > Added Rene Gollent to the list of contributors, how come we forgot > > ? > > Actually, it should be the Developers list. Anyone with commit access > is a > developer. :-) I was actually wondering as I didn't recall of a policy on that :) Fran?ois. From anevilyak at mail.berlios.de Tue Mar 4 00:00:51 2008 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Tue, 4 Mar 2008 00:00:51 +0100 Subject: [Haiku-commits] r24219 - haiku/trunk/src/apps/aboutsystem Message-ID: <200803032300.m23N0pCU005810@sheep.berlios.de> Author: anevilyak Date: 2008-03-04 00:00:51 +0100 (Tue, 04 Mar 2008) New Revision: 24219 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24219&view=rev Modified: haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp Log: Corrected accent on name and moved it where stippi said :) Modified: haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp =================================================================== --- haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp 2008-03-03 22:25:16 UTC (rev 24218) +++ haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp 2008-03-03 23:00:51 UTC (rev 24219) @@ -375,6 +375,7 @@ "Stefano Ceccherini\n" "Rudolf Cornelissen\n" "J?r?me Duval\n" + "Ren? Golllnt\n" "Julun\n" "Waldemar Kornewald\n" "Ryan Leavengood\n" @@ -404,7 +405,6 @@ "Marc Flerackers\n" "Daniel Furrer\n" "Troeglazov Gerasim\n" - "Rene Gollent\n" "Matthijs Hollemans\n" "Morgan Howe\n" "Erik Jaesler\n" From anevilyak at mail.berlios.de Tue Mar 4 00:03:05 2008 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Tue, 4 Mar 2008 00:03:05 +0100 Subject: [Haiku-commits] r24220 - haiku/trunk/src/apps/aboutsystem Message-ID: <200803032303.m23N35Er005962@sheep.berlios.de> Author: anevilyak Date: 2008-03-04 00:03:04 +0100 (Tue, 04 Mar 2008) New Revision: 24220 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24220&view=rev Modified: haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp Log: Argh. Modified: haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp =================================================================== --- haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp 2008-03-03 23:00:51 UTC (rev 24219) +++ haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp 2008-03-03 23:03:04 UTC (rev 24220) @@ -375,7 +375,7 @@ "Stefano Ceccherini\n" "Rudolf Cornelissen\n" "J?r?me Duval\n" - "Ren? Golllnt\n" + "Ren? Goollent\n" "Julun\n" "Waldemar Kornewald\n" "Ryan Leavengood\n" From anevilyak at mail.berlios.de Tue Mar 4 00:06:47 2008 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Tue, 4 Mar 2008 00:06:47 +0100 Subject: [Haiku-commits] r24221 - haiku/trunk/src/apps/aboutsystem Message-ID: <200803032306.m23N6lTw006342@sheep.berlios.de> Author: anevilyak Date: 2008-03-04 00:06:46 +0100 (Tue, 04 Mar 2008) New Revision: 24221 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24221&view=rev Modified: haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp Log: Sorry about this, apparently my terminal kept getting confused by the UTF-8 char. Modified: haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp =================================================================== --- haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp 2008-03-03 23:03:04 UTC (rev 24220) +++ haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp 2008-03-03 23:06:46 UTC (rev 24221) @@ -375,7 +375,7 @@ "Stefano Ceccherini\n" "Rudolf Cornelissen\n" "J?r?me Duval\n" - "Ren? Goollent\n" + "Ren? Gollent\n" "Julun\n" "Waldemar Kornewald\n" "Ryan Leavengood\n" From mmu_man at mail.berlios.de Tue Mar 4 00:20:26 2008 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Tue, 4 Mar 2008 00:20:26 +0100 Subject: [Haiku-commits] r24222 - haiku/trunk Message-ID: <200803032320.m23NKQCB009105@sheep.berlios.de> Author: mmu_man Date: 2008-03-04 00:20:26 +0100 (Tue, 04 Mar 2008) New Revision: 24222 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24222&view=rev Modified: haiku/trunk/ReadMe Log: Added info on how to create a CD. Modified: haiku/trunk/ReadMe =================================================================== --- haiku/trunk/ReadMe 2008-03-03 23:06:46 UTC (rev 24221) +++ haiku/trunk/ReadMe 2008-03-03 23:20:26 UTC (rev 24222) @@ -72,6 +72,28 @@ Note that installing Haiku in a directory only works as expected under BeOS, but it is not yet supported under Linux and other non-BeOS platforms. +Bootable CD-ROM Image +--------------------- + +* UNSUPPORTED yet * + +Creating a bootable CD requires burning 2 tracks on a single CD. +The first track is an El-Torito bootable ISO file-system containing a boot +floppy image, and is created with: + + jam -q haiku-boot-cd + +This generates an image file named 'haiku-boot-cd.iso' in your output directory +under 'generated/'. +The second track is the raw BFS image 'haiku.image' in 'generated/' created +with: + + jam -q haiku-image + +Under Unix/Linux, and BeOS you can use cdrecord to create a CD with: + + cdrecord dev=x,y,z -v -eject -dao -data generated/haiku-boot-cd.iso generated/haiku.image + Building Components ------------------- From revol at free.fr Tue Mar 4 00:24:06 2008 From: revol at free.fr (=?windows-1252?q?Fran=E7ois?= Revol) Date: Tue, 04 Mar 2008 00:24:06 +0100 CET Subject: [Haiku-commits] r24219 - haiku/trunk/src/apps/aboutsystem In-Reply-To: <200803032300.m23N0pCU005810@sheep.berlios.de> Message-ID: <351970671-BeMail@laptop> > Author: anevilyak > Date: 2008-03-04 00:00:51 +0100 (Tue, 04 Mar 2008) > New Revision: 24219 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24219&view=rev > > Modified: > haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp > Log: > Corrected accent on name and moved it where stippi said :) > I was wondering but I didn't see any accent elsewhere :p > + "Ren? Golllnt\n" lll ? Fran?ois. From anevilyak at gmail.com Tue Mar 4 00:30:26 2008 From: anevilyak at gmail.com (Rene Gollent) Date: Mon, 3 Mar 2008 17:30:26 -0600 Subject: [Haiku-commits] r24219 - haiku/trunk/src/apps/aboutsystem In-Reply-To: <351970671-BeMail@laptop> References: <200803032300.m23N0pCU005810@sheep.berlios.de> <351970671-BeMail@laptop> Message-ID: > > + "Ren? Golllnt\n" > > lll ? > > Fran?ois. I fixed that, my terminal was set to 8859-1, moving the cursor around would overwrite characters when I passed the UTF-8 char, my mistake. Rene From mmu_man at mail.berlios.de Tue Mar 4 02:01:01 2008 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Tue, 4 Mar 2008 02:01:01 +0100 Subject: [Haiku-commits] r24223 - haiku/trunk/build/jam Message-ID: <200803040101.m24111vk005117@sheep.berlios.de> Author: mmu_man Date: 2008-03-04 02:01:00 +0100 (Tue, 04 Mar 2008) New Revision: 24223 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24223&view=rev Modified: haiku/trunk/build/jam/HaikuImage Log: Reorder the list of boot modules by logical layer to make it easier to catch the missing ones. Modified: haiku/trunk/build/jam/HaikuImage =================================================================== --- haiku/trunk/build/jam/HaikuImage 2008-03-03 23:20:26 UTC (rev 24222) +++ haiku/trunk/build/jam/HaikuImage 2008-03-04 01:01:00 UTC (rev 24223) @@ -367,10 +367,14 @@ AddFilesToHaikuImage beos system : zbeos ; # boot module links -AddBootModuleSymlinksToHaikuImage config_manager bfs block_io fast_log - generic_ide_pci $(X86_ONLY)isa ide ide_adapter $(X86_ONLY)ide_isa intel - locked_pool $(PPC_ONLY)openpic pci scsi scsi_cd scsi_dsk scsi_periph - silicon_image_3112 legacy_sata ahci +AddBootModuleSymlinksToHaikuImage + pci $(X86_ONLY)isa config_manager ide scsi + $(PPC_ONLY)openpic + block_io fast_log ide_adapter locked_pool scsi_periph + ahci generic_ide_pci $(X86_ONLY)ide_isa silicon_image_3112 legacy_sata + scsi_cd scsi_dsk + intel + bfs ; # add-ons From mmu_man at mail.berlios.de Tue Mar 4 02:05:54 2008 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Tue, 4 Mar 2008 02:05:54 +0100 Subject: [Haiku-commits] r24224 - haiku/trunk/build/jam Message-ID: <200803040105.m2415spp005319@sheep.berlios.de> Author: mmu_man Date: 2008-03-04 02:05:50 +0100 (Tue, 04 Mar 2008) New Revision: 24224 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24224&view=rev Modified: haiku/trunk/build/jam/FloppyBootImage Log: Reordered boot module list as well, it works much better when scsi_cd is here! Added legacy_sata just in case. At least now qemu finds the bfs track and tries to run Bootscript, but I get loads of ide timeouts so it ends up panicing anyway. Modified: haiku/trunk/build/jam/FloppyBootImage =================================================================== --- haiku/trunk/build/jam/FloppyBootImage 2008-03-04 01:01:00 UTC (rev 24223) +++ haiku/trunk/build/jam/FloppyBootImage 2008-03-04 01:05:50 UTC (rev 24224) @@ -43,7 +43,7 @@ AddFilesToFloppyBootArchive beos system add-ons kernel busses agp_gart : $(X86_ONLY)intel ; AddFilesToFloppyBootArchive beos system add-ons kernel busses ide - : ahci generic_ide_pci $(X86_ONLY)ide_isa silicon_image_3112 ; + : ahci generic_ide_pci $(X86_ONLY)ide_isa silicon_image_3112 legacy_sata ; AddFilesToFloppyBootArchive beos system add-ons kernel console : vga_text ; AddFilesToFloppyBootArchive beos system add-ons kernel file_systems : $(BEOS_ADD_ONS_FILE_SYSTEMS) ; @@ -94,12 +94,13 @@ # boot module links AddBootModuleSymlinksToFloppyBootArchive $(BEOS_ADD_ONS_BUS_MANAGERS) - ahci generic_ide_pci $(X86_ONLY)ide_isa silicon_image_3112 - $(BEOS_ADD_ONS_FILE_SYSTEMS) + $(PPC_ONLY)openpic block_io fast_log ide_adapter locked_pool scsi_periph + $(X86_ONLY)generic_x86 + ahci generic_ide_pci $(X86_ONLY)ide_isa silicon_image_3112 legacy_sata + scsi_cd scsi_dsk intel session - $(PPC_ONLY)openpic - $(X86_ONLY)generic_x86 + $(BEOS_ADD_ONS_FILE_SYSTEMS) $(BOOT_ADD_ONS_NET) ; From anevilyak at mail.berlios.de Tue Mar 4 02:19:05 2008 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Tue, 4 Mar 2008 02:19:05 +0100 Subject: [Haiku-commits] r24225 - in haiku/trunk: headers/private/app src/servers/app Message-ID: <200803040119.m241J5wq007335@sheep.berlios.de> Author: anevilyak Date: 2008-03-04 02:19:04 +0100 (Tue, 04 Mar 2008) New Revision: 24225 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24225&view=rev Modified: haiku/trunk/headers/private/app/ServerReadOnlyMemory.h haiku/trunk/src/servers/app/DesktopSettings.cpp Log: App Server now saves/restores ui_color settings. Modified: haiku/trunk/headers/private/app/ServerReadOnlyMemory.h =================================================================== --- haiku/trunk/headers/private/app/ServerReadOnlyMemory.h 2008-03-04 01:05:50 UTC (rev 24224) +++ haiku/trunk/headers/private/app/ServerReadOnlyMemory.h 2008-03-04 01:19:04 UTC (rev 24225) @@ -20,6 +20,8 @@ }; +// NOTE: these functions must be kept in sync with InterfaceDefs.h color_which! + static inline int32 color_which_to_index(color_which which) { @@ -32,4 +34,17 @@ return -1; } +static inline color_which +index_to_color_which(int32 index) +{ + if (index >= 0 && index < kNumColors) { + if ((color_which)index < B_WINDOW_INACTIVE_TEXT_COLOR) + return (color_which)(index + 1); + else + return (color_which)(index + B_SUCCESS_COLOR - B_WINDOW_INACTIVE_TEXT_COLOR); + } + + return (color_which)-1; +} + #endif /* SERVER_READ_ONLY_MEMORY_H */ Modified: haiku/trunk/src/servers/app/DesktopSettings.cpp =================================================================== --- haiku/trunk/src/servers/app/DesktopSettings.cpp 2008-03-04 01:05:50 UTC (rev 24224) +++ haiku/trunk/src/servers/app/DesktopSettings.cpp 2008-03-04 01:19:04 UTC (rev 24225) @@ -216,6 +216,13 @@ bool triggersAlwaysShown; if (settings.FindBool("triggers always shown", &triggersAlwaysShown) == B_OK) fMenuInfo.triggers_always_shown = triggersAlwaysShown; + + char colorName[12]; + + for (int32 i = 0; i < kNumColors; i++) { + snprintf(colorName, sizeof(colorName), "color%ld", index_to_color_which(i)); + settings.FindInt32(colorName, (int32*)&fShared.colors[i]); + } } } @@ -313,8 +320,14 @@ settings.AddInt32("separator", fMenuInfo.separator); settings.AddBool("click to open", fMenuInfo.click_to_open); settings.AddBool("triggers always shown", fMenuInfo.triggers_always_shown); - // TODO: more appearance settings + char colorName[12]; + + for (int32 i = 0; i < kNumColors; i++) { + snprintf(colorName, sizeof(colorName), "color%ld", index_to_color_which(i)); + settings.AddInt32(colorName, (const int32&)fShared.colors[i]); + } + BFile file; status = file.SetTo(path.Path(), B_CREATE_FILE | B_ERASE_FILE | B_READ_WRITE); if (status == B_OK) { From anevilyak at mail.berlios.de Tue Mar 4 02:21:00 2008 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Tue, 4 Mar 2008 02:21:00 +0100 Subject: [Haiku-commits] r24226 - in haiku/trunk/src: kits/interface servers/registrar Message-ID: <200803040121.m241L022007543@sheep.berlios.de> Author: anevilyak Date: 2008-03-04 02:21:00 +0100 (Tue, 04 Mar 2008) New Revision: 24226 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24226&view=rev Modified: haiku/trunk/src/kits/interface/Alert.cpp haiku/trunk/src/servers/registrar/ShutdownProcess.cpp Log: The registrar's shutdown window and BAlert both use a BTextView in order to be able to display multiline panel text (since BStringView can't handle this). However, while they correctly set the background panel color, they neglected to set the font style/color to that used by panel. Fixed. This makes shutdown/restart dialogs properly color sensitive. Modified: haiku/trunk/src/kits/interface/Alert.cpp =================================================================== --- haiku/trunk/src/kits/interface/Alert.cpp 2008-03-04 01:19:04 UTC (rev 24225) +++ haiku/trunk/src/kits/interface/Alert.cpp 2008-03-04 01:21:00 UTC (rev 24226) @@ -533,6 +533,8 @@ textViewRect.OffsetByCopy(B_ORIGIN), B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW); fTextView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + rgb_color textColor = ui_color(B_PANEL_TEXT_COLOR); + fTextView->SetFontAndColor(be_plain_font, B_FONT_ALL, &textColor); fTextView->SetText(text, strlen(text)); fTextView->MakeEditable(false); fTextView->MakeSelectable(false); Modified: haiku/trunk/src/servers/registrar/ShutdownProcess.cpp =================================================================== --- haiku/trunk/src/servers/registrar/ShutdownProcess.cpp 2008-03-04 01:19:04 UTC (rev 24225) +++ haiku/trunk/src/servers/registrar/ShutdownProcess.cpp 2008-03-04 01:21:00 UTC (rev 24226) @@ -264,6 +264,8 @@ if (!fTextView) return B_NO_MEMORY; fTextView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + rgb_color textColor = ui_color(B_PANEL_TEXT_COLOR); + fTextView->SetFontAndColor(be_plain_font, B_FONT_ALL, &textColor); fTextView->MakeEditable(false); fTextView->MakeSelectable(false); fTextView->SetWordWrap(true); From anevilyak at mail.berlios.de Tue Mar 4 02:43:57 2008 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Tue, 4 Mar 2008 02:43:57 +0100 Subject: [Haiku-commits] r24227 - haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon Message-ID: <200803040143.m241hvn6009190@sheep.berlios.de> Author: anevilyak Date: 2008-03-04 02:43:56 +0100 (Tue, 04 Mar 2008) New Revision: 24227 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24227&view=rev Modified: haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/detect.c Log: Add R430 (aka X800XL) to DMA blacklist, as it currently doesn't draw correctly with the DMA engine enabled (change suggested by Euan Kirkhope, pending him figuring out what's causing that problem). Modified: haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/detect.c =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/detect.c 2008-03-04 01:21:00 UTC (rev 24226) +++ haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/detect.c 2008-03-04 01:43:56 UTC (rev 24227) @@ -632,7 +632,8 @@ // rs410 case DEVICE_ID_RS410_5a61: case DEVICE_ID_RS410_5a62: - + // r430 + case DEVICE_ID_RADEON_UM: // rs480 case DEVICE_ID_RS480_5954: case DEVICE_ID_RS480_5955: From anevilyak at mail.berlios.de Tue Mar 4 07:08:22 2008 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Tue, 4 Mar 2008 07:08:22 +0100 Subject: [Haiku-commits] r24228 - haiku/trunk/src/kits/app Message-ID: <200803040608.m2468Mp8000615@sheep.berlios.de> Author: anevilyak Date: 2008-03-04 07:08:20 +0100 (Tue, 04 Mar 2008) New Revision: 24228 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24228&view=rev Modified: haiku/trunk/src/kits/app/Message.cpp Log: Fixed a crash that would happen sometimes with BInvoker: If an invoker was set up with a null replyTo, sometimes BMessage would crash calling IsSourceWaiting() after delivering the message. This appeared to be because fHeader was NULL, but I'm not entirely certain if this is actually supposed to be possible, so this may be masking a different bug. This was observable using the multiline paste spam BAlert in Vision, which would sometimes but not always crash in Haiku after hitting any of the buttons to dismiss it, though consistently when calling IsSourceWaiting() from the private BMessage::_SendMessage(). Modified: haiku/trunk/src/kits/app/Message.cpp =================================================================== --- haiku/trunk/src/kits/app/Message.cpp 2008-03-04 01:43:56 UTC (rev 24227) +++ haiku/trunk/src/kits/app/Message.cpp 2008-03-04 06:08:20 UTC (rev 24228) @@ -613,7 +613,7 @@ BMessage::IsSourceWaiting() const { DEBUG_FUNCTION_ENTER; - return (fHeader->flags & MESSAGE_FLAG_REPLY_REQUIRED) + return fHeader && (fHeader->flags & MESSAGE_FLAG_REPLY_REQUIRED) && !(fHeader->flags & MESSAGE_FLAG_REPLY_DONE); } @@ -622,7 +622,7 @@ BMessage::IsSourceRemote() const { DEBUG_FUNCTION_ENTER; - return (fHeader->flags & MESSAGE_FLAG_WAS_DELIVERED) + return fHeader && (fHeader->flags & MESSAGE_FLAG_WAS_DELIVERED) && (fHeader->reply_team != BPrivate::current_team()); } From stefano.ceccherini at gmail.com Tue Mar 4 08:45:42 2008 From: stefano.ceccherini at gmail.com (Stefano Ceccherini) Date: Tue, 4 Mar 2008 08:45:42 +0100 Subject: [Haiku-commits] r24224 - haiku/trunk/build/jam In-Reply-To: <200803040105.m2415spp005319@sheep.berlios.de> References: <200803040105.m2415spp005319@sheep.berlios.de> Message-ID: <894b9700803032345u679a5638x253774fdb63ef3ae@mail.gmail.com> 2008/3/4, mmu_man at BerliOS : > Author: mmu_man > Date: 2008-03-04 02:05:50 +0100 (Tue, 04 Mar 2008) > New Revision: 24224 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24224&view=rev > > Modified: > haiku/trunk/build/jam/FloppyBootImage > Log: > Reordered boot module list as well, it works much better when scsi_cd is here! > Added legacy_sata just in case. > At least now qemu finds the bfs track and tries to run Bootscript, but I get loads of ide timeouts so it ends up panicing anyway. Tried disabling ide dma ? From dlmcpaul at mail.berlios.de Tue Mar 4 10:55:49 2008 From: dlmcpaul at mail.berlios.de (dlmcpaul at BerliOS) Date: Tue, 4 Mar 2008 10:55:49 +0100 Subject: [Haiku-commits] r24229 - in haiku/trunk/src/add-ons/media/plugins/mp4_reader: . libMP4 Message-ID: <200803040955.m249tnRP001372@sheep.berlios.de> Author: dlmcpaul Date: 2008-03-04 10:55:49 +0100 (Tue, 04 Mar 2008) New Revision: 24229 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24229&view=rev Modified: haiku/trunk/src/add-ons/media/plugins/mp4_reader/libMP4/MP4FileReader.cpp haiku/trunk/src/add-ons/media/plugins/mp4_reader/libMP4/MP4FileReader.h haiku/trunk/src/add-ons/media/plugins/mp4_reader/libMP4/MP4Parser.cpp haiku/trunk/src/add-ons/media/plugins/mp4_reader/libMP4/MP4Parser.h haiku/trunk/src/add-ons/media/plugins/mp4_reader/libMP4/MP4TrakAtom.cpp haiku/trunk/src/add-ons/media/plugins/mp4_reader/mp4_reader.cpp Log: changes for aac decoder Modified: haiku/trunk/src/add-ons/media/plugins/mp4_reader/libMP4/MP4FileReader.cpp =================================================================== --- haiku/trunk/src/add-ons/media/plugins/mp4_reader/libMP4/MP4FileReader.cpp 2008-03-04 06:08:20 UTC (rev 24228) +++ haiku/trunk/src/add-ons/media/plugins/mp4_reader/libMP4/MP4FileReader.cpp 2008-03-04 09:55:49 UTC (rev 24229) @@ -275,15 +275,25 @@ uint32 MP4FileReader::getAudioFrameCount(uint32 streamIndex) { - if (IsAudio(streamIndex)) { - return uint32(((getAudioDuration(streamIndex) - * AudioFormat(streamIndex)->SampleRate) / 1000000L) + 0.5); - } + AtomBase *aAtomBase = GetChildAtom(uint32('trak'), streamIndex); - return 0; + if (aAtomBase && dynamic_cast(aAtomBase)->IsAudio()) + return dynamic_cast(aAtomBase)->FrameCount(); + + return 1; } +uint32 +MP4FileReader::getAudioChunkCount(uint32 streamIndex) +{ + AtomBase *aAtomBase = GetChildAtom(uint32('trak'), streamIndex); + if (aAtomBase && dynamic_cast(aAtomBase)->IsAudio()) + return dynamic_cast(aAtomBase)->getTotalChunks(); + + return 0; +} + bool MP4FileReader::IsVideo(uint32 streamIndex) { @@ -329,24 +339,19 @@ uint32 -MP4FileReader::getNoFramesInChunk(uint32 stream_index, uint32 pFrameNo) +MP4FileReader::getNoFramesInChunk(uint32 streamIndex, uint32 pFrameNo) { // Find Track - AtomBase *aAtomBase = GetChildAtom(uint32('trak'),stream_index); + AtomBase *aAtomBase = GetChildAtom(uint32('trak'),streamIndex); if (aAtomBase) { TRAKAtom *aTrakAtom = dynamic_cast(aAtomBase); uint32 ChunkNo = 1; - if (IsAudio(stream_index)) - ChunkNo = pFrameNo; + uint32 SampleNo = aTrakAtom->getSampleForFrame(pFrameNo); - if (IsVideo(stream_index)) { - uint32 SampleNo = aTrakAtom->getSampleForFrame(pFrameNo); + uint32 OffsetInChunk; + ChunkNo = aTrakAtom->getChunkForSample(SampleNo, &OffsetInChunk); - uint32 OffsetInChunk; - ChunkNo = aTrakAtom->getChunkForSample(SampleNo, &OffsetInChunk); - } - return aTrakAtom->getNoSamplesInChunk(ChunkNo); } @@ -355,48 +360,38 @@ uint64 -MP4FileReader::getOffsetForFrame(uint32 stream_index, uint32 pFrameNo) +MP4FileReader::getOffsetForFrame(uint32 streamIndex, uint32 pFrameNo) { // Find Track - AtomBase *aAtomBase = GetChildAtom(uint32('trak'),stream_index); + AtomBase *aAtomBase = GetChildAtom(uint32('trak'),streamIndex); if (aAtomBase) { TRAKAtom *aTrakAtom = dynamic_cast(aAtomBase); - if (IsAudio(stream_index)) { - // FrameNo is really chunk No for audio - uint32 ChunkNo = pFrameNo; - + if (pFrameNo < aTrakAtom->FrameCount()) { + // Get Sample for Frame + uint32 SampleNo = aTrakAtom->getSampleForFrame(pFrameNo); + // Get Chunk For Sample and the offset for the frame within that chunk + uint32 OffsetInChunk; + uint32 ChunkNo = aTrakAtom->getChunkForSample(SampleNo, &OffsetInChunk); // Get Offset For Chunk - return aTrakAtom->getOffsetForChunk(ChunkNo); - } + uint64 OffsetNo = aTrakAtom->getOffsetForChunk(ChunkNo); - if (IsVideo(stream_index)) { - if (pFrameNo < aTrakAtom->FrameCount()) { - // Get Sample for Frame - uint32 SampleNo = aTrakAtom->getSampleForFrame(pFrameNo); - // Get Chunk For Sample and the offset for the frame within that chunk - uint32 OffsetInChunk; - uint32 ChunkNo = aTrakAtom->getChunkForSample(SampleNo, &OffsetInChunk); - // Get Offset For Chunk - uint64 OffsetNo = aTrakAtom->getOffsetForChunk(ChunkNo); - - if (ChunkNo != 0) { - uint32 SizeForSample; - // Adjust the Offset for the Offset in the chunk - if (aTrakAtom->IsSingleSampleSize()) { - SizeForSample = aTrakAtom->getSizeForSample(SampleNo); - OffsetNo = OffsetNo + (OffsetInChunk * SizeForSample); - } else { - // This is bad news performance wise - for (uint32 i=1;i<=OffsetInChunk;i++) { - SizeForSample = aTrakAtom->getSizeForSample(SampleNo-i); - OffsetNo = OffsetNo + SizeForSample; - } + if (ChunkNo != 0) { + uint32 SizeForSample; + // Adjust the Offset for the Offset in the chunk + if (aTrakAtom->IsSingleSampleSize()) { + SizeForSample = aTrakAtom->getSizeForSample(SampleNo); + OffsetNo = OffsetNo + (OffsetInChunk * SizeForSample); + } else { + // This is bad news performance wise + for (uint32 i=1;i<=OffsetInChunk;i++) { + SizeForSample = aTrakAtom->getSizeForSample(SampleNo-i); + OffsetNo = OffsetNo + SizeForSample; } } - - return OffsetNo; } + + return OffsetNo; } } @@ -476,10 +471,10 @@ const AudioMetaData * -MP4FileReader::AudioFormat(uint32 stream_index, size_t *size) +MP4FileReader::AudioFormat(uint32 streamIndex, size_t *size) { - if (IsAudio(stream_index)) { - AtomBase *aAtomBase = GetChildAtom(uint32('trak'),stream_index); + if (IsAudio(streamIndex)) { + AtomBase *aAtomBase = GetChildAtom(uint32('trak'),streamIndex); if (aAtomBase) { TRAKAtom *aTrakAtom = dynamic_cast(aAtomBase); @@ -496,7 +491,7 @@ theAudio.NoOfChannels = aAudioDescription.theAudioSampleEntry.ChannelCount; theAudio.SampleSize = aAudioDescription.theAudioSampleEntry.SampleSize; theAudio.SampleRate = aAudioDescription.theAudioSampleEntry.SampleRate / 65536; // Convert from fixed point decimal to float - theAudio.PacketSize = uint32((theAudio.SampleRate * theAudio.NoOfChannels * theAudio.SampleSize) / 8); + theAudio.PacketSize = uint32((theAudio.SampleSize * theAudio.NoOfChannels * 1024) / 8); theAudio.theVOL = aAudioDescription.theVOL; theAudio.VOLSize = aAudioDescription.VOLSize; @@ -509,12 +504,11 @@ return NULL; } - const VideoMetaData* -MP4FileReader::VideoFormat(uint32 stream_index) +MP4FileReader::VideoFormat(uint32 streamIndex) { - if (IsVideo(stream_index)) { - AtomBase *aAtomBase = GetChildAtom(uint32('trak'),stream_index); + if (IsVideo(streamIndex)) { + AtomBase *aAtomBase = GetChildAtom(uint32('trak'),streamIndex); if (aAtomBase) { TRAKAtom *aTrakAtom = dynamic_cast(aAtomBase); @@ -556,26 +550,26 @@ const mp4_stream_header* -MP4FileReader::StreamFormat(uint32 stream_index) +MP4FileReader::StreamFormat(uint32 streamIndex) { // Fill In a Stream Header theStreamHeader.length = 0; - if (IsActive(stream_index) == false) { + if (IsActive(streamIndex) == false) { return NULL; } - if (IsVideo(stream_index)) { - theStreamHeader.rate = uint32(1000000L*VideoFormat(stream_index)->FrameRate); + if (IsVideo(streamIndex)) { + theStreamHeader.rate = uint32(1000000L*VideoFormat(streamIndex)->FrameRate); theStreamHeader.scale = 1000000L; - theStreamHeader.length = getVideoFrameCount(stream_index); + theStreamHeader.length = getVideoFrameCount(streamIndex); } - if (IsAudio(stream_index)) { - theStreamHeader.rate = uint32(AudioFormat(stream_index)->SampleRate); + if (IsAudio(streamIndex)) { + theStreamHeader.rate = uint32(AudioFormat(streamIndex)->SampleRate); theStreamHeader.scale = 1; - theStreamHeader.length = getAudioFrameCount(stream_index); - theStreamHeader.sample_size = AudioFormat(stream_index)->SampleSize; + theStreamHeader.length = getAudioFrameCount(streamIndex); + theStreamHeader.sample_size = AudioFormat(streamIndex)->SampleSize; theStreamHeader.suggested_buffer_size = theStreamHeader.rate * theStreamHeader.sample_size; } @@ -584,28 +578,16 @@ uint32 -MP4FileReader::getChunkSize(uint32 stream_index, uint32 pFrameNo) +MP4FileReader::getChunkSize(uint32 streamIndex, uint32 pFrameNo) { - AtomBase *aAtomBase = GetChildAtom(uint32('trak'),stream_index); + AtomBase *aAtomBase = GetChildAtom(uint32('trak'),streamIndex); if (aAtomBase) { TRAKAtom *aTrakAtom = dynamic_cast(aAtomBase); - if (IsAudio(stream_index)) { - // We read audio in chunk by chunk so chunk size is chunk size - uint32 ChunkNo = pFrameNo; - off_t Chunk_Start = aTrakAtom->getOffsetForChunk(ChunkNo); - uint32 ChunkSize = theChunkSuperIndex.getChunkSize(stream_index,ChunkNo,Chunk_Start); - - return ChunkSize; + if (pFrameNo < aTrakAtom->FrameCount()) { + uint32 SampleNo = aTrakAtom->getSampleForFrame(pFrameNo); + return aTrakAtom->getSizeForSample(SampleNo); } - - if (IsVideo(stream_index)) { - if (pFrameNo < aTrakAtom->FrameCount()) { - // We read video in Sample by Sample so we use get Sample Size - uint32 SampleNo = aTrakAtom->getSampleForFrame(pFrameNo); - return aTrakAtom->getSizeForSample(SampleNo); - } - } } return 0; @@ -613,9 +595,9 @@ bool -MP4FileReader::IsKeyFrame(uint32 stream_index, uint32 pFrameNo) +MP4FileReader::IsKeyFrame(uint32 streamIndex, uint32 pFrameNo) { - AtomBase *aAtomBase = GetChildAtom(uint32('trak'),stream_index); + AtomBase *aAtomBase = GetChildAtom(uint32('trak'),streamIndex); if (aAtomBase) { TRAKAtom *aTrakAtom = dynamic_cast(aAtomBase); @@ -628,14 +610,14 @@ bool -MP4FileReader::GetNextChunkInfo(uint32 stream_index, uint32 pFrameNo, +MP4FileReader::GetNextChunkInfo(uint32 streamIndex, uint32 pFrameNo, off_t *start, uint32 *size, bool *keyframe) { - *start = getOffsetForFrame(stream_index, pFrameNo); - *size = getChunkSize(stream_index, pFrameNo); + *start = getOffsetForFrame(streamIndex, pFrameNo); + *size = getChunkSize(streamIndex, pFrameNo); if ((*start > 0) && (*size > 0)) { - *keyframe = IsKeyFrame(stream_index, pFrameNo); + *keyframe = IsKeyFrame(streamIndex, pFrameNo); } // TODO need a better method for detecting End of Data Note ChunkSize of 0 seems to be it. @@ -645,9 +627,9 @@ bool -MP4FileReader::IsActive(uint32 stream_index) +MP4FileReader::IsActive(uint32 streamIndex) { - AtomBase *aAtomBase = GetChildAtom(uint32('trak'),stream_index); + AtomBase *aAtomBase = GetChildAtom(uint32('trak'),streamIndex); if (aAtomBase) { TRAKAtom *aTrakAtom = dynamic_cast(aAtomBase); return aTrakAtom->IsActive(); Modified: haiku/trunk/src/add-ons/media/plugins/mp4_reader/libMP4/MP4FileReader.h =================================================================== --- haiku/trunk/src/add-ons/media/plugins/mp4_reader/libMP4/MP4FileReader.h 2008-03-04 06:08:20 UTC (rev 24228) +++ haiku/trunk/src/add-ons/media/plugins/mp4_reader/libMP4/MP4FileReader.h 2008-03-04 09:55:49 UTC (rev 24229) @@ -81,45 +81,47 @@ // Duration defined by the movie header bigtime_t getMovieDuration(); - // The first video track duration indexed by stream_index - bigtime_t getVideoDuration(uint32 stream_index); - // the first audio track duration indexed by stream_index - bigtime_t getAudioDuration(uint32 stream_index); + // The first video track duration indexed by streamIndex + bigtime_t getVideoDuration(uint32 streamIndex); + // the first audio track duration indexed by streamIndex + bigtime_t getAudioDuration(uint32 streamIndex); // the max of all active audio or video durations bigtime_t getMaxDuration(); - // The no of frames in the video track indexed by stream_index - uint32 getVideoFrameCount(uint32 stream_index); - // The no of frames in the audio track indexed by stream_index - uint32 getAudioFrameCount(uint32 stream_index); - + // The no of frames in the video track indexed by streamIndex + // 1 frame = 1 chunk + uint32 getVideoFrameCount(uint32 streamIndex); + // The no of frames in the audio track indexed by streamIndex + uint32 getAudioFrameCount(uint32 streamIndex); + // The no of chunks in the audio track indexed by streamIndex + uint32 getAudioChunkCount(uint32 streamIndex); // Is stream (track) a video track - bool IsVideo(uint32 stream_index); + bool IsVideo(uint32 streamIndex); // Is stream (track) a audio track - bool IsAudio(uint32 stream_index); + bool IsAudio(uint32 streamIndex); - uint32 getNoFramesInChunk(uint32 stream_index, uint32 pFrameNo); - uint32 getFirstFrameInChunk(uint32 stream_index, uint32 pChunkID); + uint32 getNoFramesInChunk(uint32 streamIndex, uint32 pFrameNo); + uint32 getFirstFrameInChunk(uint32 streamIndex, uint32 pChunkID); - uint64 getOffsetForFrame(uint32 stream_index, uint32 pFrameNo); - uint32 getChunkSize(uint32 stream_index, uint32 pFrameNo); - bool IsKeyFrame(uint32 stream_index, uint32 pFrameNo); + uint64 getOffsetForFrame(uint32 streamIndex, uint32 pFrameNo); + uint32 getChunkSize(uint32 streamIndex, uint32 pFrameNo); + bool IsKeyFrame(uint32 streamIndex, uint32 pFrameNo); status_t ParseFile(); BPositionIO *Source() {return theStream;}; - bool IsActive(uint32 stream_index); + bool IsActive(uint32 streamIndex); - bool GetNextChunkInfo(uint32 stream_index, uint32 pFrameNo, off_t *start, uint32 *size, bool *keyframe); + bool GetNextChunkInfo(uint32 streamIndex, uint32 pFrameNo, off_t *start, uint32 *size, bool *keyframe); // Return all Audio Meta Data - const AudioMetaData *AudioFormat(uint32 stream_index, size_t *size = 0); + const AudioMetaData *AudioFormat(uint32 streamIndex, size_t *size = 0); // Return all Video Meta Data - const VideoMetaData *VideoFormat(uint32 stream_index); + const VideoMetaData *VideoFormat(uint32 streamIndex); // XXX these need work const mp4_main_header *MovMainHeader(); - const mp4_stream_header *StreamFormat(uint32 stream_index); + const mp4_stream_header *StreamFormat(uint32 streamIndex); }; #endif Modified: haiku/trunk/src/add-ons/media/plugins/mp4_reader/libMP4/MP4Parser.cpp =================================================================== --- haiku/trunk/src/add-ons/media/plugins/mp4_reader/libMP4/MP4Parser.cpp 2008-03-04 06:08:20 UTC (rev 24228) +++ haiku/trunk/src/add-ons/media/plugins/mp4_reader/libMP4/MP4Parser.cpp 2008-03-04 09:55:49 UTC (rev 24229) @@ -209,7 +209,7 @@ char *MOOVAtom::OnGetAtomName() { - return "Quicktime Movie"; + return "MPEG-4 Movie"; } CMOVAtom::CMOVAtom(BPositionIO *pStream, off_t pstreamOffset, uint32 patomType, uint64 patomSize) : AtomContainer(pStream, pstreamOffset, patomType, patomSize) @@ -322,7 +322,7 @@ char *CMOVAtom::OnGetAtomName() { - return "Compressed Quicktime Movie"; + return "Compressed MPEG-4 Movie"; } DCOMAtom::DCOMAtom(BPositionIO *pStream, off_t pstreamOffset, uint32 patomType, uint64 patomSize) : AtomBase(pStream, pstreamOffset, patomType, patomSize) @@ -438,7 +438,7 @@ char *MVHDAtom::OnGetAtomName() { - return "Quicktime Movie Header"; + return "MPEG-4 Movie Header"; } MVHDAtom *MOOVAtom::getMVHDAtom() @@ -908,7 +908,7 @@ return 0LL; } -ESDSAtom::ESDSAtom(BPositionIO *pStream, off_t pstreamOffset, uint32 patomType, uint64 patomSize) : AtomBase(pStream, pstreamOffset, patomType, patomSize) +ESDSAtom::ESDSAtom(BPositionIO *pStream, off_t pstreamOffset, uint32 patomType, uint64 patomSize) : FullAtom(pStream, pstreamOffset, patomType, patomSize) { theVOL = NULL; } @@ -920,17 +920,118 @@ } } +bool ESDSAtom::SkipTag(uint8 Tag, uint32 *offset) { + uint8 byte; + + byte = theVOL[(*offset)++]; + if (byte == Tag) { + uint8 numBytes = 0; + unsigned int length = 0; + + do { + byte = theVOL[(*offset)++]; + numBytes++; + length = (length << 7) | (byte & 0x7F); + } while ((byte & 0x80) && numBytes < 4); + + } else { + // go back Tag not found + (*offset)--; + printf("No Tag %d\n",Tag); + return false; + } + + return true; +} + void ESDSAtom::OnProcessMetaData() { - theVOL = (uint8 *)(malloc(getBytesRemaining())); - Read(theVOL,getBytesRemaining()); + FullAtom::OnProcessMetaData(); + + VOLSize = getBytesRemaining(); + uint32 offset = 0; + + theVOL = (uint8 *)(malloc(VOLSize)); + Read(theVOL,VOLSize); + + // Display the VOL + if (VOLSize > 0) { + if (SkipTag(0x03,&offset)) { + offset += 3; + } else { + offset += 2; + } + + if (SkipTag(0x04,&offset)) { + printf("type id is %d", theVOL[offset]); + switch (theVOL[offset]) { + case 1: printf("system v1"); break; + case 2: printf("system v2"); break; + case 32: printf("MPEG-4 video"); break; + case 33: printf("MPEG-4 AVC SPS"); break; + case 34: printf("MPEG-4 AVC PPS"); break; + case 64: printf("MPEG-4 audio"); break; + } + + offset+=2; + + uint32 a,b,c; + uint32 buff; + + a = theVOL[offset]; + b = theVOL[offset+1]; + c = theVOL[offset+2]; + + buff = (a << 16) | (b << 8) | c; + + printf(" buf size %ld ",buff); + printf(" max bit rate %ld",uint32(theVOL[offset+4])); + printf(" avg bit rate %ld\n",uint32(theVOL[offset+8])); + } + } else { + printf("VOL size is 0\n"); + } + } -uint8 *ESDSAtom::getVOL() +size_t ESDSAtom::getVOLSize(bool forAudio) { - return theVOL; + uint32 offset = 0; + if (forAudio) { + if (SkipTag(0x03,&offset)) { + offset += 3; + } else { + offset += 2; + } + if (SkipTag(0x04,&offset)) { + offset += 13; + } + + SkipTag(0x05,&offset); + } + + return ( VOLSize - offset); } +uint8 *ESDSAtom::getVOL(bool forAudio) +{ + uint32 offset = 0; + if (forAudio) { + if (SkipTag(0x03,&offset)) { + offset += 3; + } else { + offset += 2; + } + if (SkipTag(0x04,&offset)) { + offset += 13; + } + + SkipTag(0x05,&offset); + } + + return &theVOL[offset]; +} + char *ESDSAtom::OnGetAtomName() { return "Extended Sample Description Atom"; @@ -961,7 +1062,7 @@ return dynamic_cast(getParent())->getMediaHandlerType(); } -void STSDAtom::ReadESDS(uint8 **VOL, size_t *VOLSize) +void STSDAtom::ReadESDS(uint8 **VOL, size_t *VOLSize, bool forAudio) { // Check for a esds and if it exists read it into the VOL buffer // MPEG-4 video/audio use the esds to store the VOL (STUPID COMMITTEE IDEA) @@ -976,9 +1077,9 @@ if (dynamic_cast(aAtomBase)) { // ESDS atom good - *VOLSize = aAtomBase->getDataSize(); + *VOLSize = dynamic_cast(aAtomBase)->getVOLSize(forAudio); *VOL = (uint8 *)(malloc(*VOLSize)); - memcpy(*VOL,dynamic_cast(aAtomBase)->getVOL(),*VOLSize); + memcpy(*VOL,dynamic_cast(aAtomBase)->getVOL(forAudio),*VOLSize); delete aAtomBase; } else { @@ -997,8 +1098,8 @@ Read(&theAudioDescription.theAudioSampleEntry.pre_defined); Read(&theAudioDescription.theAudioSampleEntry.reserved); Read(&theAudioDescription.theAudioSampleEntry.SampleRate); - - ReadESDS(&theAudioDescription.theVOL,&theAudioDescription.VOLSize); + + ReadESDS(&theAudioDescription.theVOL,&theAudioDescription.VOLSize,true); } void STSDAtom::ReadVideoDescription() @@ -1028,7 +1129,7 @@ Read(&theVideoDescription.theVideoSampleEntry.Depth); Read(&theVideoDescription.theVideoSampleEntry.pre_defined3); - ReadESDS(&theVideoDescription.theVOL,&theVideoDescription.VOLSize); + ReadESDS(&theVideoDescription.theVOL,&theVideoDescription.VOLSize, false); } void STSDAtom::OnProcessMetaData() @@ -1253,7 +1354,7 @@ char *MINFAtom::OnGetAtomName() { - return "Quicktime Media Information Atom"; + return "MPEG-4 Media Information Atom"; } uint32 MINFAtom::getMediaHandlerType() @@ -1275,7 +1376,7 @@ char *STBLAtom::OnGetAtomName() { - return "Quicktime Sample Table Atom"; + return "MPEG-4 Sample Table Atom"; } uint32 STBLAtom::getMediaHandlerType() @@ -1297,7 +1398,7 @@ char *DINFAtom::OnGetAtomName() { - return "Quicktime Data Information Atom"; + return "MPEG-4 Data Information Atom"; } TKHDAtom::TKHDAtom(BPositionIO *pStream, off_t pstreamOffset, uint32 patomType, uint64 patomSize) : FullAtom(pStream, pstreamOffset, patomType, patomSize) @@ -1371,7 +1472,7 @@ char *TKHDAtom::OnGetAtomName() { - return "Quicktime Track Header"; + return "MPEG-4 Track Header"; } MDIAAtom::MDIAAtom(BPositionIO *pStream, off_t pstreamOffset, uint32 patomType, uint64 patomSize) : AtomContainer(pStream, pstreamOffset, patomType, patomSize) @@ -1388,7 +1489,7 @@ char *MDIAAtom::OnGetAtomName() { - return "Quicktime Media Atom"; + return "MPEG-4 Media Atom"; } uint32 MDIAAtom::getMediaHandlerType() @@ -1443,7 +1544,7 @@ char *MDHDAtom::OnGetAtomName() { - return "Quicktime Media Header"; + return "MPEG-4 Media Header"; } bigtime_t MDHDAtom::getDuration() @@ -1486,7 +1587,7 @@ char *HDLRAtom::OnGetAtomName() { printf("%s %s:",(char *)&(theHeader.handler_type),name); - return "Quicktime Handler Reference Atom "; + return "MPEG-4 Handler Reference Atom "; } bool HDLRAtom::IsVideoHandler() @@ -1524,7 +1625,7 @@ char *VMHDAtom::OnGetAtomName() { - return "Quicktime Video Media Header"; + return "MPEG-4 Video Media Header"; } SMHDAtom::SMHDAtom(BPositionIO *pStream, off_t pstreamOffset, uint32 patomType, uint64 patomSize) : FullAtom(pStream, pstreamOffset, patomType, patomSize) @@ -1545,5 +1646,5 @@ char *SMHDAtom::OnGetAtomName() { - return "Quicktime Sound Media Header"; + return "MPEG-4 Sound Media Header"; } Modified: haiku/trunk/src/add-ons/media/plugins/mp4_reader/libMP4/MP4Parser.h =================================================================== --- haiku/trunk/src/add-ons/media/plugins/mp4_reader/libMP4/MP4Parser.h 2008-03-04 06:08:20 UTC (rev 24228) +++ haiku/trunk/src/add-ons/media/plugins/mp4_reader/libMP4/MP4Parser.h 2008-03-04 09:55:49 UTC (rev 24229) @@ -300,16 +300,19 @@ off_t getEOF(); }; -class ESDSAtom : public AtomBase { +class ESDSAtom : public FullAtom { public: ESDSAtom(BPositionIO *pStream, off_t pstreamOffset, uint32 patomType, uint64 patomSize); virtual ~ESDSAtom(); void OnProcessMetaData(); char *OnGetAtomName(); - uint8 *getVOL(); + uint8 *getVOL(bool forAudio); + size_t getVOLSize(bool forAudio); private: + bool SkipTag(uint8 Tag, uint32 *offset); uint8 *theVOL; + size_t VOLSize; }; // Atom class for reading the sdst atom @@ -326,7 +329,7 @@ private: uint32 getMediaHandlerType(); - void ReadESDS(uint8 **VOL, size_t *VOLSize); + void ReadESDS(uint8 **VOL, size_t *VOLSize, bool forAudio); void ReadSoundDescription(); void ReadVideoDescription(); Modified: haiku/trunk/src/add-ons/media/plugins/mp4_reader/libMP4/MP4TrakAtom.cpp =================================================================== --- haiku/trunk/src/add-ons/media/plugins/mp4_reader/libMP4/MP4TrakAtom.cpp 2008-03-04 06:08:20 UTC (rev 24228) +++ haiku/trunk/src/add-ons/media/plugins/mp4_reader/libMP4/MP4TrakAtom.cpp 2008-03-04 09:55:49 UTC (rev 24229) @@ -42,7 +42,7 @@ char *TRAKAtom::OnGetAtomName() { - return "Quicktime Track Atom"; + return "MPEG-4 Track Atom"; } TKHDAtom *TRAKAtom::getTKHDAtom() Modified: haiku/trunk/src/add-ons/media/plugins/mp4_reader/mp4_reader.cpp =================================================================== --- haiku/trunk/src/add-ons/media/plugins/mp4_reader/mp4_reader.cpp 2008-03-04 06:08:20 UTC (rev 24228) +++ haiku/trunk/src/add-ons/media/plugins/mp4_reader/mp4_reader.cpp 2008-03-04 09:55:49 UTC (rev 24229) @@ -421,31 +421,56 @@ format->user_data_type = B_CODEC_TYPE_INFO; *(uint32 *)format->user_data = description.u.quicktime.codec; format->user_data[4] = 0; - format->u.encoded_video.max_bit_rate = 8 * theFileReader->MovMainHeader()->max_bytes_per_sec; - format->u.encoded_video.avg_bit_rate = format->u.encoded_video.max_bit_rate / 2; // XXX fix this +// format->u.encoded_video.max_bit_rate = 8 * theFileReader->MovMainHeader()->max_bytes_per_sec; +// format->u.encoded_video.avg_bit_rate = format->u.encoded_video.max_bit_rate / 2; // XXX fix this format->u.encoded_video.output.field_rate = cookie->frames_per_sec_rate / (float)cookie->frames_per_sec_scale; + + format->u.encoded_video.avg_bit_rate = 1; + format->u.encoded_video.max_bit_rate = 1; + + format->u.encoded_video.frame_size = video_format->width * video_format->height * video_format->planes / 8; + format->u.encoded_video.output.display.bytes_per_row = video_format->planes / 8 * video_format->width; + // align to 2 bytes + format->u.encoded_video.output.display.bytes_per_row += format->u.encoded_video.output.display.bytes_per_row & 1; + + switch (video_format->planes) { + case 16: + format->u.encoded_video.output.display.format = B_RGB15_BIG; + break; + case 24: + format->u.encoded_video.output.display.format = B_RGB24_BIG; + break; + case 32: + format->u.encoded_video.output.display.format = B_RGB32_BIG; + break; + default: + format->u.encoded_video.output.display.format = B_NO_COLOR_SPACE; + format->u.encoded_video.frame_size = video_format->width * video_format->height * 8 / 8; + } + + format->u.encoded_video.output.display.line_width = video_format->width; + format->u.encoded_video.output.display.line_count = video_format->height; + format->u.encoded_video.output.display.pixel_offset = 0; + format->u.encoded_video.output.display.line_offset = 0; + format->u.encoded_video.output.display.flags = 0; format->u.encoded_video.output.interlace = 1; // 1: progressive format->u.encoded_video.output.first_active = 0; - format->u.encoded_video.output.last_active = cookie->line_count - 1; + format->u.encoded_video.output.last_active = format->u.encoded_video.output.display.line_count - 1; format->u.encoded_video.output.orientation = B_VIDEO_TOP_LEFT_RIGHT; format->u.encoded_video.output.pixel_width_aspect = 1; format->u.encoded_video.output.pixel_height_aspect = 1; - // format->u.encoded_video.output.display.format = 0; - format->u.encoded_video.output.display.line_width = theFileReader->MovMainHeader()->width; - format->u.encoded_video.output.display.line_count = cookie->line_count; - format->u.encoded_video.output.display.bytes_per_row = 0; // format->u.encoded_video.output.display.line_width * 4; - format->u.encoded_video.output.display.pixel_offset = 0; - format->u.encoded_video.output.display.line_offset = 0; - format->u.encoded_video.output.display.flags = 0; TRACE("max_bit_rate %.3f\n", format->u.encoded_video.max_bit_rate); TRACE("field_rate %.3f\n", format->u.encoded_video.output.field_rate); // Set the VOL if (video_format->VOLSize > 0) { + TRACE("VOL Found Size is %ld\n",video_format->VOLSize); size_t size = video_format->VOLSize; const void *data = video_format->theVOL; - format->SetMetaData(data, size); + if (format->SetMetaData(data, size) != B_OK) { + printf("Failed to set VOL\n %d %d",(16 << 20),32000); + } #ifdef TRACE_MP4_READER if (data) { @@ -485,8 +510,17 @@ *frameCount = cookie->frame_count; *duration = cookie->duration; *format = cookie->format; - *infoBuffer = 0; - *infoSize = 0; + + // Copy metadata to infoBuffer + if (theFileReader->IsVideo(cookie->stream)) { + const VideoMetaData *video_format = theFileReader->VideoFormat(cookie->stream); + *infoBuffer = video_format->theVOL; + *infoSize = video_format->VOLSize; + } else { + const AudioMetaData *audio_format = theFileReader->AudioFormat(cookie->stream); + *infoBuffer = audio_format->theVOL; + *infoSize = audio_format->VOLSize; + } return B_OK; } @@ -578,6 +612,8 @@ mediaHeader->u.encoded_video.field_flags = keyframe ? B_MEDIA_KEY_FRAME : 0; mediaHeader->u.encoded_video.first_active_line = 0; mediaHeader->u.encoded_video.line_count = cookie->line_count; + mediaHeader->u.encoded_video.field_number = 0; + mediaHeader->u.encoded_video.field_sequence = cookie->frame_pos; cookie->frame_pos++; } From revol at free.fr Tue Mar 4 11:46:05 2008 From: revol at free.fr (=?windows-1252?q?Fran=E7ois?= Revol) Date: Tue, 04 Mar 2008 11:46:05 +0100 CET Subject: [Haiku-commits] r24224 - haiku/trunk/build/jam In-Reply-To: <894b9700803032345u679a5638x253774fdb63ef3ae@mail.gmail.com> Message-ID: <2517951514-BeMail@laptop> > 2008/3/4, mmu_man at BerliOS : > > Author: mmu_man > > Date: 2008-03-04 02:05:50 +0100 (Tue, 04 Mar 2008) > > New Revision: 24224 > > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24224&view=rev > > > > Modified: > > haiku/trunk/build/jam/FloppyBootImage > > Log: > > Reordered boot module list as well, it works much better when > > scsi_cd is here! > > Added legacy_sata just in case. > > At least now qemu finds the bfs track and tries to run Bootscript, > > but I get loads of ide timeouts so it ends up panicing anyway. > > Tried disabling ide dma ? Didn't help much, dont call the bios maybe... Still some timeouts at the beginning but it goes ok then. Fran?ois. From mmlr at mlotz.ch Tue Mar 4 12:44:48 2008 From: mmlr at mlotz.ch (Michael Lotz) Date: Tue, 4 Mar 2008 12:44:48 +0100 Subject: [Haiku-commits] r24228 - haiku/trunk/src/kits/app In-Reply-To: <200803040608.m2468Mp8000615@sheep.berlios.de> References: <200803040608.m2468Mp8000615@sheep.berlios.de> Message-ID: <20080304113447.M87610@mlotz.ch> On Tue, 4 Mar 2008 07:08:22 +0100, anevilyak at BerliOS wrote > Author: anevilyak > Date: 2008-03-04 07:08:20 +0100 (Tue, 04 Mar 2008) > New Revision: 24228 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24228&view=rev > > Modified: > haiku/trunk/src/kits/app/Message.cpp > Log: > Fixed a crash that would happen sometimes with BInvoker: If an > invoker was set up with a null replyTo, sometimes BMessage would > crash calling IsSourceWaiting() after delivering the message. This appeared > to be because fHeader was NULL, but I'm not entirely certain if this > is actually supposed to be possible, so this may be masking a different > bug. This was observable using the multiline paste spam BAlert in > Vision, which would sometimes but not always crash in Haiku after hitting > any of the buttons to dismiss it, though consistently when calling > IsSourceWaiting() from the private BMessage::_SendMessage(). This definitely hides some other bug. The fHeader field must _always_ be valid. And from quickly reviewing the code paths it also is always initialized correctly after being cleared. There are some possibilities: a thread safety issue, corruption of the message data or usage of a destroyed BMessage object. I'd tend to the first or the last. As there is no locking involved it could easily be a thread safety issue that happens when a BMessage is shared by multiple threads that do not properly synchronize themselves. I am not sure the R5 BMessage is thread safe, and I don't know if it should be at all. I thought I had read somewhere that it is not thread safe, but I can't find that source anymore. Anyway, I will look into it and try reproducing using the steps you mentioned above. Thanks for the pointers! Regards Michael From bga at bug-br.org.br Tue Mar 4 12:58:02 2008 From: bga at bug-br.org.br (Bruno Albuquerque) Date: Tue, 04 Mar 2008 08:58:02 -0300 Subject: [Haiku-commits] r24217 - haiku/trunk/src/apps/aboutsystem In-Reply-To: <20080303230711.15943.9@stippis2.1204533653.fake> References: <200803032116.m23LGTCR028421@sheep.berlios.de> <20080303230711.15943.9@stippis2.1204533653.fake> Message-ID: <47CD394A.9090405@bug-br.org.br> Stephan Assmus wrote: > Actually, it should be the Developers list. Anyone with commit access is a > developer. :-) Except for me, right? :P -Bruno From mmu_man at mail.berlios.de Tue Mar 4 13:28:23 2008 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Tue, 4 Mar 2008 13:28:23 +0100 Subject: [Haiku-commits] r24230 - in haiku/trunk/3rdparty: . nero Message-ID: <200803041228.m24CSNm7026079@sheep.berlios.de> Author: mmu_man Date: 2008-03-04 13:28:22 +0100 (Tue, 04 Mar 2008) New Revision: 24230 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24230&view=rev Added: haiku/trunk/3rdparty/nero/ haiku/trunk/3rdparty/nero/haiku-cd.cue Log: Added a cue file for windows users to make a CD. Added: haiku/trunk/3rdparty/nero/haiku-cd.cue =================================================================== --- haiku/trunk/3rdparty/nero/haiku-cd.cue 2008-03-04 09:55:49 UTC (rev 24229) +++ haiku/trunk/3rdparty/nero/haiku-cd.cue 2008-03-04 12:28:22 UTC (rev 24230) @@ -0,0 +1,8 @@ +FILE "haiku-boot-cd.iso" BINARY +TRACK 01 MODE1/2048 +INDEX 01 00:00:00 +POSTGAP 00:02:00 +FILE "haiku.image" BINARY +TRACK 02 MODE1/2048 +INDEX 01 00:00:00 +POSTGAP 00:02:00 From mmu_man at mail.berlios.de Tue Mar 4 13:32:07 2008 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Tue, 4 Mar 2008 13:32:07 +0100 Subject: [Haiku-commits] r24231 - haiku/trunk Message-ID: <200803041232.m24CW7Yn004639@sheep.berlios.de> Author: mmu_man Date: 2008-03-04 13:32:07 +0100 (Tue, 04 Mar 2008) New Revision: 24231 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24231&view=rev Modified: haiku/trunk/ReadMe Log: * note on dev id for cdrecord. * note about cue file. Modified: haiku/trunk/ReadMe =================================================================== --- haiku/trunk/ReadMe 2008-03-04 12:28:22 UTC (rev 24230) +++ haiku/trunk/ReadMe 2008-03-04 12:32:07 UTC (rev 24231) @@ -94,6 +94,11 @@ cdrecord dev=x,y,z -v -eject -dao -data generated/haiku-boot-cd.iso generated/haiku.image +Here x,y,z is the device number as found with cdrecord -scanbus, it can also +be a device path on Linux. + +Windows users will find '3rdparty/nero/haiku-cd.cue' useful. + Building Components ------------------- From superstippi at gmx.de Tue Mar 4 13:33:29 2008 From: superstippi at gmx.de (Stephan Assmus) Date: Tue, 04 Mar 2008 13:33:29 +0100 Subject: [Haiku-commits] r24217 - haiku/trunk/src/apps/aboutsystem In-Reply-To: <47CD394A.9090405@bug-br.org.br> References: <200803032116.m23LGTCR028421@sheep.berlios.de> <20080303230711.15943.9@stippis2.1204533653.fake> <47CD394A.9090405@bug-br.org.br> Message-ID: <20080304133329.34458.23@stippis2.1204533653.fake> On 2008-03-04 at 12:58:02 [+0100], Bruno Albuquerque wrote: > Stephan Assmus wrote: > > > Actually, it should be the Developers list. Anyone with commit access > > is a developer. :-) > > Except for me, right? :P Actually... see my forthcomming commit. I went through the list and tried to fix the About list to the best of my knowledge. But there are a couple of people on the list on Berlios who have not contributed in quite a while (IIRC, please forgive me any blunders): Andrew Bachmann Alexander G. M. Smith Daniel Furrer Bryan Varner Greg Crain Nathan Whitehorn Gabe Yoder Waldemar Kornewald Bryan and Andrew are known to be active with Java, so I think they should just stay in it. Waldemar left the project, but left before and came back, I don't know about this time, but at least he was active in Trac very recently. And as for yourself, BGA, you do the occasional commit (so you should definitely keep acces IMHO), but what about being able to spend 20% of your work time at Google on a project of your choice? That's one day per week! :-P Best regards, -Stephan From axeld at mail.berlios.de Tue Mar 4 13:36:53 2008 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Tue, 4 Mar 2008 13:36:53 +0100 Subject: [Haiku-commits] r24232 - haiku/trunk/src/system/kernel Message-ID: <200803041236.m24CarBV005044@sheep.berlios.de> Author: axeld Date: 2008-03-04 13:36:53 +0100 (Tue, 04 Mar 2008) New Revision: 24232 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24232&view=rev Modified: haiku/trunk/src/system/kernel/elf.cpp Log: * unload_elf_image() never unloaded any image because the ref_count check was wrong (never gets below zero if everything goes as intended). * Removed erroneous white space. Modified: haiku/trunk/src/system/kernel/elf.cpp =================================================================== --- haiku/trunk/src/system/kernel/elf.cpp 2008-03-04 12:32:07 UTC (rev 24231) +++ haiku/trunk/src/system/kernel/elf.cpp 2008-03-04 12:36:53 UTC (rev 24232) @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007, Axel D?rfler, axeld at pinc-software.de. All rights reserved. + * Copyright 2002-2008, Axel D?rfler, axeld at pinc-software.de. All rights reserved. * Distributed under the terms of the MIT License. * * Copyright 2001, Travis Geiselbrecht. All rights reserved. @@ -107,7 +107,7 @@ imageInfo.id = image->id; imageInfo.type = B_SYSTEM_IMAGE; strlcpy(imageInfo.name, image->name, sizeof(imageInfo.name)); - + imageInfo.text = (void *)image->text_region.start; imageInfo.text_size = image->text_region.size; imageInfo.data = (void *)image->data_region.start; @@ -144,7 +144,7 @@ } -static int +static int dump_address_info(int argc, char **argv) { const char *symbol, *imageName; @@ -273,7 +273,7 @@ if (argc > 1) { if (isdigit(argv[1][0])) { uint32 num = strtoul(argv[1], NULL, 0); - + if (IS_KERNEL_ADDRESS(num)) { // find image at address @@ -284,7 +284,7 @@ break; } hash_close(sImagesHash, &iterator, false); - + if (image == NULL) kprintf("No image covers 0x%lx in the kernel!\n", num); } else { @@ -669,13 +669,13 @@ elf_unlink_relocs(struct elf_image_info *image) { elf_linked_image *link, *next_link; - + for (link = image->linked_images; link; link = next_link) { next_link = link->next; elf_unload_image(link->image); free(link); } - + return B_NO_ERROR; } #endif @@ -684,9 +684,11 @@ static status_t unload_elf_image(struct elf_image_info *image) { - if (atomic_add(&image->ref_count, -1) > 0) - return B_NO_ERROR; + if (atomic_add(&image->ref_count, -1) > 1) + return B_OK; + TRACE(("unload image %ld, %s\n", image->id, image->name)); + //elf_unlink_relocs(image); // not yet used @@ -699,7 +701,7 @@ unregister_elf_image(image); free(image->elf_header); - free(image->name); + free(image->name); free(image); return B_NO_ERROR; @@ -904,7 +906,7 @@ // the tables referred to by the .dynamic section, also contain proper names // and sizes for those symbols. Therefore, to get completely satisfying // results, we would need to read those tables from the shared object. - + // get the image for the address image_t image; status_t error = _FindImageAtAddress(address, image); @@ -928,7 +930,7 @@ Elf32_Sym symbolFound; addr_t deltaFound = INT_MAX; bool exactMatch = false; - + for (uint32 i = 0; i < hashTabSize; i++) { uint32 bucket; if (!_Read(&hashBuckets[i], bucket)) @@ -936,11 +938,11 @@ for (uint32 j = bucket; j != STN_UNDEF; _Read(&hashChains[j], j) ? 0 : j = STN_UNDEF) { - + Elf32_Sym symbol; if (!_Read(image.syms + j, symbol)) continue; - + // The symbol table contains not only symbols referring to functions // and data symbols within the shared object, but also referenced // symbols of other shared objects, as well as section and file @@ -955,17 +957,17 @@ > textRegion.vmstart + textRegion.size) { continue; } - + // skip symbols starting after the given address addr_t symbolAddress = symbol.st_value + textRegion.delta; if (symbolAddress > address) continue; addr_t symbolDelta = address - symbolAddress; - + if (symbolDelta < deltaFound) { deltaFound = symbolDelta; symbolFound = symbol; - + if (symbolDelta >= 0 && symbolDelta < symbol.st_size) { // exact match exactMatch = true; @@ -974,10 +976,10 @@ } } } - + if (_imageName) *_imageName = fImageName; - + if (_symbolName) { *_symbolName = NULL; @@ -991,17 +993,17 @@ } } } - + if (_baseAddress) { if (deltaFound < INT_MAX) *_baseAddress = symbolFound.st_value + textRegion.delta; else *_baseAddress = textRegion.vmstart; } - + if (_exactMatch) *_exactMatch = exactMatch; - + return B_OK; } @@ -1024,7 +1026,7 @@ imageAddress = image.next; } - + return B_ENTRY_NOT_FOUND; } @@ -1093,7 +1095,7 @@ // ToDo: support the "sclass" parameter! - TRACE(("found: %lx (%lx + %lx)\n", symbol->st_value + image->text_region.delta, + TRACE(("found: %lx (%lx + %lx)\n", symbol->st_value + image->text_region.delta, symbol->st_value, image->text_region.delta)); *_symbol = (void *)(symbol->st_value + image->text_region.delta); @@ -1712,14 +1714,14 @@ mutex_lock(&sImageLoadMutex); mutex_lock(&sImageMutex); - + image = find_image(id); if (image != NULL) status = unload_elf_image(image); else status = B_BAD_IMAGE_ID; - mutex_unlock(&sImageMutex); + mutex_unlock(&sImageMutex); mutex_unlock(&sImageLoadMutex); return status; From stippi at mail.berlios.de Tue Mar 4 13:41:45 2008 From: stippi at mail.berlios.de (stippi at BerliOS) Date: Tue, 4 Mar 2008 13:41:45 +0100 Subject: [Haiku-commits] r24233 - haiku/trunk/src/apps/aboutsystem Message-ID: <200803041241.m24CfjTJ005600@sheep.berlios.de> Author: stippi Date: 2008-03-04 13:41:45 +0100 (Tue, 04 Mar 2008) New Revision: 24233 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24233&view=rev Modified: haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp Log: I have tried to bring the developer list up to date to the best of my knowledge. I compared it with the current commiters list on Berlios. Some people listed there are still in the contributors list, since they have been inactive for a long time. Any blunders are unintentional and I will fix those ASAP once pointed out! Modified: haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp =================================================================== --- haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp 2008-03-04 12:36:53 UTC (rev 24232) +++ haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp 2008-03-04 12:41:45 UTC (rev 24233) @@ -358,7 +358,6 @@ "Axel D?rfler\n" "Phil Greenway\n" "Philippe Houdoin\n" - "Waldemar Kornewald\n" "Marcus Overhagen\n" "Ingo Weinhold\n" "Jonathan Yoder\n" @@ -370,20 +369,29 @@ fCreditsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &kDarkGrey); fCreditsView->Insert( "Ithamar R. Adema\n" + "Bruno G. Albuquerque\n" "Stephan A?mus\n" "Andrew Bachmann\n" + "Salvatore Benedetto\n" "Stefano Ceccherini\n" "Rudolf Cornelissen\n" + "Alexandre Deckner\n" + "Oliver Ruiz Dorantes\n" "J?r?me Duval\n" + "Andre Alves Garzia\n" "Ren? Gollent\n" - "Julun\n" + "Karsten Heimrich\n" + "Euan Kirkhope\n" "Waldemar Kornewald\n" "Ryan Leavengood\n" "Michael Lotz\n" + "David McPaul\n" "Michael Pfeiffer\n" - "Niels Reedijk\n" + "Niels Sascha Reedijk\n" + "Jonas Sundstr?m\n" "Fran?ois Revol\n" "Hugo Santos\n" + "Gerasim Troeglazov\n" "Bryan Varner\n" "Siarzhuk Zharski\n" "\n"); @@ -393,18 +401,15 @@ fCreditsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &kDarkGrey); fCreditsView->Insert( - "Bruno G. Albuquerque\n" "Andrea Anzani\n" + "Andre Braga\n" "Bruce Cameron\n" "Greg Crain\n" "Tyler Dauwalder\n" - "Alexandre Deckner\n" - "Oliver Ruiz Dorantes\n" "John Drinkwater\n" "Cian Duffy\n" "Marc Flerackers\n" "Daniel Furrer\n" - "Troeglazov Gerasim\n" "Matthijs Hollemans\n" "Morgan Howe\n" "Erik Jaesler\n" @@ -412,10 +417,10 @@ "Maurice Kalinowski\n" "Vasilis Kaoutsis\n" "James Kim\n" - "Euan Kirkhope\n" "Jan Kl?tzke\n" "Marcin Konicki\n" "Kurtis Kopf\n" + "Waldemar Kornewald\n" "Tom?? Ku?era\n" "Lubo? Kuli?\n" "Thomas Kurschel\n" @@ -430,7 +435,6 @@ "Brian Matzon\n" "Christopher ML Zumwalt May\n" "Andrew McCall\n" - "David McPaul\n" "Michele (zuMi)\n" "Misza\n" "MrSiggler\n" @@ -449,7 +453,7 @@ "Rafael Romo\n" "Reznikov Sergei\n" "Zousar Shaker\n" - "Jonas Sundstr?m\n" + "Alexander G. M. Smith\n" "Daniel Switkin\n" "Atsushi Takamatsu\n" "Oliver Tappe\n" From axeld at mail.berlios.de Tue Mar 4 13:47:35 2008 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Tue, 4 Mar 2008 13:47:35 +0100 Subject: [Haiku-commits] r24234 - haiku/trunk/src/servers/app Message-ID: <200803041247.m24ClZ6n006256@sheep.berlios.de> Author: axeld Date: 2008-03-04 13:47:34 +0100 (Tue, 04 Mar 2008) New Revision: 24234 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24234&view=rev Modified: haiku/trunk/src/servers/app/Desktop.cpp haiku/trunk/src/servers/app/Desktop.h haiku/trunk/src/servers/app/WindowList.h Log: * Added a separate focus list that will contain all windows in the order of the last focus. * When choosing a new focus window, this list is now used to find the new focus window instead of just choosing the next window in the workspace list. * With the normal mode mouse, this shouldn't change anything, but with focus follows mouse turned on, this will behave much better if you don't actually move the mouse - and it also fixes bug #1886. Modified: haiku/trunk/src/servers/app/Desktop.cpp =================================================================== --- haiku/trunk/src/servers/app/Desktop.cpp 2008-03-04 12:41:45 UTC (rev 24233) +++ haiku/trunk/src/servers/app/Desktop.cpp 2008-03-04 12:47:34 UTC (rev 24234) @@ -316,6 +316,7 @@ fCurrentWorkspace(0), fAllWindows(kAllWindowList), fSubsetWindows(kSubsetList), + fFocusList(kFocusList), fWorkspacesLayer(NULL), fActiveScreen(NULL), @@ -670,7 +671,7 @@ for (WindowLayer* window = fAllWindows.FirstWindow(); window != NULL; window = window->NextWindow(kAllWindowList)) { - // if window is a normal window of the team, and not hidden, + // if window is a normal window of the team, and not hidden, // we've found our target if (!window->IsHidden() && window->IsNormal() && window->ServerWindow()->ClientTeam() == team) { @@ -685,8 +686,8 @@ /*! \brief Send a quick (no attachments) message to all applications - - Quite useful for notification for things like server shutdown, system + + Quite useful for notification for things like server shutdown, system color changes, etc. */ void @@ -1020,7 +1021,7 @@ if (!_Windows(index).HasWindow(FocusWindow()) || !FocusWindow()->IsFloating()) SetFocusWindow(FrontWindow()); - _WindowChanged(NULL); + _WindowChanged(NULL); MarkDirty(dirty); #if 0 @@ -1147,7 +1148,7 @@ _HideWindow(floating); if (FocusWindow() == floating) - SetFocusWindow(_CurrentWindows().LastWindow()); + SetFocusWindow(); } } } @@ -1324,21 +1325,16 @@ return; } - if (focus == NULL || hasModal) { - focus = FrontWindow(); - if (focus == NULL) { - // there might be no front window in case of only a single - // window with B_FLOATING_ALL_WINDOW_FEEL - focus = _CurrentWindows().LastWindow(); - } - } + if (focus == NULL || hasModal) + focus = fFocusList.LastWindow(); // make sure no window is chosen that doesn't want focus or cannot have it while (focus != NULL - && ((focus->Flags() & B_AVOID_FOCUS) != 0 + && (!focus->InWorkspace(fCurrentWorkspace) + || (focus->Flags() & B_AVOID_FOCUS) != 0 || _WindowHasModal(focus) || focus->IsHidden())) { - focus = focus->PreviousWindow(fCurrentWorkspace); + focus = focus->PreviousWindow(kFocusList); } if (fFocus == focus) { @@ -1360,6 +1356,10 @@ if (fFocus != NULL) { fFocus->SetFocus(true); newActiveApp = fFocus->ServerWindow()->App()->ClientTeam(); + + // move current focus to the end of the focus list + fFocusList.RemoveWindow(fFocus); + fFocusList.AddWindow(fFocus); } if (newActiveApp == -1) { @@ -1571,7 +1571,7 @@ MarkDirty(dirty); _UpdateFronts(); - SetFocusWindow(_CurrentWindows().LastWindow()); + SetFocusWindow(); _WindowChanged(window); UnlockAllWindows(); @@ -1587,6 +1587,7 @@ LockAllWindows(); window->SetHidden(false); + fFocusList.AddWindow(window); if (window->InWorkspace(fCurrentWorkspace)) { _ShowWindow(window, true); @@ -1625,6 +1626,8 @@ return; window->SetHidden(true); + fFocusList.RemoveWindow(window); + if (fMouseEventWindow == window) fMouseEventWindow = NULL; @@ -1634,7 +1637,7 @@ _UpdateFronts(); if (FocusWindow() == window) - SetFocusWindow(_CurrentWindows().LastWindow()); + SetFocusWindow(); } else _WindowChanged(window); @@ -1785,7 +1788,7 @@ // track the dirty region outside the window in case // it is shrunk in "previouslyOccupiedRegion" BRegion previouslyOccupiedRegion(window->VisibleRegion()); - + window->ResizeBy(x, y, &newDirtyRegion); BRegion background; @@ -1848,7 +1851,7 @@ BRegion stillAvailableOnScreen; _RebuildClippingForAllWindows(stillAvailableOnScreen); _SetBackground(stillAvailableOnScreen); - + _TriggerWindowRedrawing(dirty); } @@ -2157,7 +2160,7 @@ _UpdateFronts(); if (window == FocusWindow() && !window->IsVisible()) - SetFocusWindow(_CurrentWindows().LastWindow()); + SetFocusWindow(); UnlockAllWindows(); } @@ -2201,7 +2204,7 @@ BRegion stillAvailableOnScreen; _RebuildClippingForAllWindows(stillAvailableOnScreen); _SetBackground(stillAvailableOnScreen); - + _TriggerWindowRedrawing(dirty); } @@ -2448,7 +2451,7 @@ // moving windows // remember the region not covered by any windows - // and redraw the dirty background + // and redraw the dirty background BRegion dirtyBackground(background); dirtyBackground.Exclude(&fBackgroundRegion); dirtyBackground.IntersectWith(&background); Modified: haiku/trunk/src/servers/app/Desktop.h =================================================================== --- haiku/trunk/src/servers/app/Desktop.h 2008-03-04 12:41:45 UTC (rev 24233) +++ haiku/trunk/src/servers/app/Desktop.h 2008-03-04 12:47:34 UTC (rev 24234) @@ -1,5 +1,5 @@ /* - * Copyright 2001-2006, Haiku. + * Copyright 2001-2008, Haiku. * Distributed under the terms of the MIT License. * * Authors: @@ -153,7 +153,7 @@ void SetViewUnderMouse(const WindowLayer* window, int32 viewToken); int32 ViewUnderMouse(const WindowLayer* window); - void SetFocusWindow(WindowLayer* window); + void SetFocusWindow(WindowLayer* window = NULL); EventTarget* KeyboardEventTarget(); WindowLayer* FindWindowLayerByClientToken(int32 token, team_id teamID); @@ -253,6 +253,7 @@ WindowList fAllWindows; WindowList fSubsetWindows; + WindowList fFocusList; WorkspacesLayer* fWorkspacesLayer; Screen* fActiveScreen; Modified: haiku/trunk/src/servers/app/WindowList.h =================================================================== --- haiku/trunk/src/servers/app/WindowList.h 2008-03-04 12:41:45 UTC (rev 24233) +++ haiku/trunk/src/servers/app/WindowList.h 2008-03-04 12:47:34 UTC (rev 24234) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Haiku, Inc. + * Copyright (c) 2005-2008, Haiku, Inc. * Distributed under the terms of the MIT license. * * Authors: @@ -41,6 +41,7 @@ enum window_lists { kAllWindowList = 32, kSubsetList, + kFocusList, kWorkingList, kListCount From alex at zappotek.com Tue Mar 4 13:59:16 2008 From: alex at zappotek.com (Alexandre Deckner) Date: Tue, 04 Mar 2008 13:59:16 +0100 Subject: [Haiku-commits] r24230 - in haiku/trunk/3rdparty: . nero In-Reply-To: <200803041228.m24CSNm7026079@sheep.berlios.de> References: <200803041228.m24CSNm7026079@sheep.berlios.de> Message-ID: <47CD47A4.9010007@zappotek.com> mmu_man at BerliOS wrote : > > Added: > haiku/trunk/3rdparty/nero/ > haiku/trunk/3rdparty/nero/haiku-cd.cue > Log: > Added a cue file for windows users to make a CD. > > > Thanks! Actually, although most use it with nero nowadays, i just found out that the .cue format was first introduced by cdrwin. http://en.wikipedia.org/wiki/Disk_image Regards, Alex From anevilyak at gmail.com Tue Mar 4 14:39:12 2008 From: anevilyak at gmail.com (Rene Gollent) Date: Tue, 4 Mar 2008 07:39:12 -0600 Subject: [Haiku-commits] r24228 - haiku/trunk/src/kits/app In-Reply-To: <20080304113447.M87610@mlotz.ch> References: <200803040608.m2468Mp8000615@sheep.berlios.de> <20080304113447.M87610@mlotz.ch> Message-ID: > This definitely hides some other bug. The fHeader field must _always_ be > valid. And from quickly reviewing the code paths it also is always initialized > correctly after being cleared. There are some possibilities: a thread safety > issue, corruption of the message data or usage of a destroyed BMessage object. > I'd tend to the first or the last. As there is no locking involved it could > easily be a thread safety issue that happens when a BMessage is shared by > multiple threads that do not properly synchronize themselves. I am not sure > the R5 BMessage is thread safe, and I don't know if it should be at all. I > thought I had read somewhere that it is not thread safe, but I can't find that > source anymore. Anyway, I will look into it and try reproducing using the > steps you mentioned above. Thanks for the pointers! > Ah, thanks for the explanation. That confused me as well because I couldn't see any obvious path by which _InitObject() wouldn't be called, which seemed to always create the header. That message shouldn't be getting reused in any case, unless it's internally by the kit somewhere, as the code that sets up the BAlert in this case is as follows: BMessage *invokeMsg (new BMessage (msg)); BInvoker *invoker (new BInvoker (invokeMsg, msgr)); invokeMsg->AddPointer ("invoker", invoker); alert->Go (invoker); Neither variable is touched again before end of function, and the alert is likewise heap allocated. Let me know if any other information would be of use. Regards, Rene From mmu_man at mail.berlios.de Tue Mar 4 17:10:22 2008 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Tue, 4 Mar 2008 17:10:22 +0100 Subject: [Haiku-commits] r24235 - haiku/trunk Message-ID: <200803041610.m24GAMvN032023@sheep.berlios.de> Author: mmu_man Date: 2008-03-04 17:10:22 +0100 (Tue, 04 Mar 2008) New Revision: 24235 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24235&view=rev Modified: haiku/trunk/ReadMe Log: Added info for testing cd in Qemu. Modified: haiku/trunk/ReadMe =================================================================== --- haiku/trunk/ReadMe 2008-03-04 12:47:34 UTC (rev 24234) +++ haiku/trunk/ReadMe 2008-03-04 16:10:22 UTC (rev 24235) @@ -99,6 +99,14 @@ Windows users will find '3rdparty/nero/haiku-cd.cue' useful. +Since the CD has two tracks it is not easy to test it from an emulator. +Instead it is simpler to use the 'haiku.image' as CD image and the floppy +image 'haiku-boot-floppy.image' to boot from it. + +For Qemu: + +qemu -cdrom generated/haiku.image -fda generated/haiku-boot-floppy.image -boot a + Building Components ------------------- From mmlr at mlotz.ch Tue Mar 4 17:55:57 2008 From: mmlr at mlotz.ch (Michael Lotz) Date: Tue, 4 Mar 2008 17:55:57 +0100 Subject: [Haiku-commits] r24233 - haiku/trunk/src/apps/aboutsystem In-Reply-To: <200803041241.m24CfjTJ005600@sheep.berlios.de> References: <200803041241.m24CfjTJ005600@sheep.berlios.de> Message-ID: <20080304165350.M10647@mlotz.ch> On Tue, 4 Mar 2008 13:41:45 +0100, stippi at BerliOS wrote > Author: stippi > Date: 2008-03-04 13:41:45 +0100 (Tue, 04 Mar 2008) > New Revision: 24233 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24233&view=rev > > Modified: > haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp > Log: > I have tried to bring the developer list up to date to the best of my > knowledge. I compared it with the current commiters list on Berlios. > Some people listed there are still in the contributors list, since > they have been inactive for a long time. Any blunders are > unintentional and I will fix those ASAP once pointed out! Didn't we want to clean out the team leads section once? It doesn't represent the current structure anymore at least. Regards Michael From axeld at mail.berlios.de Tue Mar 4 18:00:00 2008 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Tue, 4 Mar 2008 18:00:00 +0100 Subject: [Haiku-commits] r24236 - haiku/trunk/src/system/kernel/fs Message-ID: <200803041700.m24H00jj003983@sheep.berlios.de> Author: axeld Date: 2008-03-04 17:59:59 +0100 (Tue, 04 Mar 2008) New Revision: 24236 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24236&view=rev Modified: haiku/trunk/src/system/kernel/fs/vfs.cpp Log: * Minor cleanup. Modified: haiku/trunk/src/system/kernel/fs/vfs.cpp =================================================================== --- haiku/trunk/src/system/kernel/fs/vfs.cpp 2008-03-04 16:10:22 UTC (rev 24235) +++ haiku/trunk/src/system/kernel/fs/vfs.cpp 2008-03-04 16:59:59 UTC (rev 24236) @@ -157,7 +157,7 @@ - the fields immutable after initialization of the fs_mount structures in sMountsTable will not be modified, - vnode::covered_by of any vnode in sVnodeTable will not be modified. - + The thread trying to lock the lock must not hold sVnodeMutex or sMountMutex. */ @@ -643,7 +643,7 @@ vnode->id = vnodeID; // add the vnode to the mount structure - mutex_lock(&sMountMutex); + mutex_lock(&sMountMutex); vnode->mount = find_mount(mountID); if (!vnode->mount || vnode->mount->unmounting) { mutex_unlock(&sMountMutex); @@ -1390,7 +1390,7 @@ } -/*! Disconnects all file descriptors that are associated with the +/*! Disconnects all file descriptors that are associated with the \a vnodeToDisconnect, or if this is NULL, all vnodes of the specified \a mount object. @@ -2606,7 +2606,7 @@ { struct hash_iterator iterator; struct vnode *vnode; - + if (argc > 2 || !strcmp(argv[1], "--help")) { kprintf("usage: %s [device]\n", argv[0]); return 0; @@ -2672,7 +2672,7 @@ kprintf(" cwd vnode:\t%p\n", context->cwd); kprintf(" used fds:\t%lu\n", context->num_used_fds); kprintf(" max fds:\t%lu\n", context->table_size); - + if (context->num_used_fds) kprintf(" no. type ops ref open mode pos cookie\n"); @@ -2816,7 +2816,7 @@ uint32 tempCount = 0; // size tracks how much of what is left of the current fileVec - // (fileLeft) has been assigned to tempVecs + // (fileLeft) has been assigned to tempVecs size = 0; // assign what is left of the current fileVec to the tempVecs @@ -3004,7 +3004,7 @@ } locker.Unlock(); - + if (remove) { // if the vnode hasn't been published yet, we delete it here atomic_add(&vnode->ref_count, -1); @@ -3973,15 +3973,15 @@ switch (resource) { case RLIMIT_NOFILE: /* TODO: check getuid() */ - if (rlp->rlim_max != RLIM_SAVED_MAX && - rlp->rlim_max != MAX_FD_TABLE_SIZE) + if (rlp->rlim_max != RLIM_SAVED_MAX + && rlp->rlim_max != MAX_FD_TABLE_SIZE) return EPERM; return vfs_resize_fd_table(get_current_io_context(false), rlp->rlim_cur); case RLIMIT_NOVMON: /* TODO: check getuid() */ - if (rlp->rlim_max != RLIM_SAVED_MAX && - rlp->rlim_max != MAX_NODE_MONITORS) + if (rlp->rlim_max != RLIM_SAVED_MAX + && rlp->rlim_max != MAX_NODE_MONITORS) return EPERM; return vfs_resize_monitor_table(get_current_io_context(false), rlp->rlim_cur); @@ -4089,7 +4089,7 @@ put_vnode(vnode); FS_CALL(directory, unlink)(directory->mount->cookie, directory->private_node, name); - + return status; } @@ -4180,7 +4180,7 @@ FUNCTION(("file_create_entry_ref: name = '%s', omode %x, perms %d, kernel %d\n", name, openMode, perms, kernel)); - // get directory to put the new file in + // get directory to put the new file in status = get_vnode(mountID, directoryID, &directory, true, false); if (status < B_OK) return status; @@ -4201,7 +4201,7 @@ FUNCTION(("file_create: path '%s', omode %x, perms %d, kernel %d\n", path, openMode, perms, kernel)); - // get directory to put the new file in + // get directory to put the new file in status = fd_and_path_to_dir_vnode(fd, path, &directory, name, kernel); if (status < 0) return status; @@ -4421,7 +4421,7 @@ return B_BAD_VALUE; FUNCTION(("dir_create_entry_ref(dev = %ld, ino = %Ld, name = '%s', perms = %d)\n", mountID, parentID, name, perms)); - + status = get_vnode(mountID, parentID, &vnode, true, false); if (status < B_OK) return status; @@ -4539,7 +4539,7 @@ } -static status_t +static status_t dir_read(struct file_descriptor *descriptor, struct dirent *buffer, size_t bufferSize, uint32 *_count) { return dir_read(descriptor->u.vnode, descriptor->cookie, buffer, bufferSize, _count); @@ -4589,7 +4589,7 @@ } -static status_t +static status_t dir_read(struct vnode *vnode, fs_cookie cookie, struct dirent *buffer, size_t bufferSize, uint32 *_count) { if (!FS_CALL(vnode, read_dir)) @@ -4609,7 +4609,7 @@ } -static status_t +static status_t dir_rewind(struct file_descriptor *descriptor) { struct vnode *vnode = descriptor->u.vnode; @@ -4641,7 +4641,7 @@ lastSlash--; } - if (!leaf[0] + if (!leaf[0] || !strcmp(leaf, ".")) { // "name/" -> "name", or "name/." -> "name" lastSlash[0] = '\0'; @@ -4680,7 +4680,7 @@ } -static status_t +static status_t common_fcntl(int fd, int op, uint32 argument, bool kernel) { struct file_descriptor *descriptor; @@ -5074,7 +5074,7 @@ common_write_stat(struct file_descriptor *descriptor, const struct stat *stat, int statMask) { struct vnode *vnode = descriptor->u.vnode; - + FUNCTION(("common_write_stat(vnode = %p, stat = %p, statMask = %d)\n", vnode, stat, statMask)); if (!FS_CALL(vnode, write_stat)) return EROFS; @@ -5179,7 +5179,7 @@ } -static status_t +static status_t attr_dir_read(struct file_descriptor *descriptor, struct dirent *buffer, size_t bufferSize, uint32 *_count) { struct vnode *vnode = descriptor->u.vnode; @@ -5193,7 +5193,7 @@ } -static status_t +static status_t attr_dir_rewind(struct file_descriptor *descriptor) { struct vnode *vnode = descriptor->u.vnode; @@ -5538,7 +5538,7 @@ } -static status_t +static status_t index_dir_read(struct file_descriptor *descriptor, struct dirent *buffer, size_t bufferSize, uint32 *_count) { struct fs_mount *mount = descriptor->u.mount; @@ -5550,7 +5550,7 @@ } -static status_t +static status_t index_dir_rewind(struct file_descriptor *descriptor) { struct fs_mount *mount = descriptor->u.mount; @@ -5729,7 +5729,7 @@ } -static status_t +static status_t query_read(struct file_descriptor *descriptor, struct dirent *buffer, size_t bufferSize, uint32 *_count) { struct fs_mount *mount = descriptor->u.mount; @@ -5741,7 +5741,7 @@ } -static status_t +static status_t query_rewind(struct file_descriptor *descriptor) { struct fs_mount *mount = descriptor->u.mount; @@ -6326,7 +6326,7 @@ struct fs_mount *mount = NULL; dev_t device = *_cookie; - mutex_lock(&sMountMutex); + mutex_lock(&sMountMutex); // Since device IDs are assigned sequentially, this algorithm // does work good enough. It makes sure that the device list @@ -6347,7 +6347,7 @@ device = B_BAD_VALUE; mutex_unlock(&sMountMutex); - + return device; } @@ -6369,7 +6369,7 @@ status = B_ERROR; mutex_unlock(&context->io_mutex); - return status; + return status; } @@ -6643,7 +6643,7 @@ } -status_t +status_t _kern_fcntl(int fd, int op, uint32 argument) { return common_fcntl(fd, op, argument, true); @@ -6746,7 +6746,7 @@ if (pathBuffer.InitCheck() != B_OK) return B_NO_MEMORY; - return common_read_link(fd, pathBuffer.LockBuffer(), + return common_read_link(fd, pathBuffer.LockBuffer(), buffer, _bufferSize, true); } @@ -6775,7 +6775,7 @@ if (pathBuffer.InitCheck() != B_OK) return B_NO_MEMORY; - return common_create_symlink(fd, pathBuffer.LockBuffer(), + return common_create_symlink(fd, pathBuffer.LockBuffer(), toPath, mode, true); } @@ -6788,7 +6788,7 @@ if (pathBuffer.InitCheck() != B_OK || toPathBuffer.InitCheck() != B_OK) return B_NO_MEMORY; - return common_create_link(pathBuffer.LockBuffer(), + return common_create_link(pathBuffer.LockBuffer(), toPathBuffer.LockBuffer(), true); } @@ -6843,7 +6843,7 @@ if (oldPathBuffer.InitCheck() != B_OK || newPathBuffer.InitCheck() != B_OK) return B_NO_MEMORY; - return common_rename(oldFD, oldPathBuffer.LockBuffer(), + return common_rename(oldFD, oldPathBuffer.LockBuffer(), newFD, newPathBuffer.LockBuffer(), true); } @@ -6901,7 +6901,7 @@ if (pathBuffer.InitCheck() != B_OK) return B_NO_MEMORY; - status = common_path_read_stat(fd, pathBuffer.LockBuffer(), + status = common_path_read_stat(fd, pathBuffer.LockBuffer(), traverseLeafLink, stat, true); } else { // no path given: get the FD and use the FD operation @@ -6970,7 +6970,7 @@ if (pathBuffer.InitCheck() != B_OK) return B_NO_MEMORY; - status = common_path_write_stat(fd, pathBuffer.LockBuffer(), + status = common_path_write_stat(fd, pathBuffer.LockBuffer(), traverseLeafLink, stat, statMask, true); } else { // no path given: get the FD and use the FD operation @@ -7385,7 +7385,7 @@ return len; if (len >= B_PATH_NAME_LENGTH) return B_BUFFER_OVERFLOW; - + return B_OK; } @@ -7537,7 +7537,7 @@ } -status_t +status_t _user_fcntl(int fd, int op, uint32 argument) { status_t status = common_fcntl(fd, op, argument, false); @@ -7555,7 +7555,7 @@ } -status_t +status_t _user_flock(int fd, int op) { struct file_descriptor *descriptor; @@ -7823,13 +7823,13 @@ // path given: get the stat of the node referred to by (fd, path) if (!IS_USER_ADDRESS(userPath)) return B_BAD_ADDRESS; - + KPath pathBuffer(B_PATH_NAME_LENGTH + 1); if (pathBuffer.InitCheck() != B_OK) return B_NO_MEMORY; - + char *path = pathBuffer.LockBuffer(); - + ssize_t length = user_strlcpy(path, userPath, B_PATH_NAME_LENGTH); if (length < B_OK) return length; @@ -7882,13 +7882,13 @@ // path given: write the stat of the node referred to by (fd, path) if (!IS_USER_ADDRESS(userPath)) return B_BAD_ADDRESS; - + KPath pathBuffer(B_PATH_NAME_LENGTH + 1); if (pathBuffer.InitCheck() != B_OK) return B_NO_MEMORY; - + char *path = pathBuffer.LockBuffer(); - + ssize_t length = user_strlcpy(path, userPath, B_PATH_NAME_LENGTH); if (length < B_OK) return length; @@ -8008,7 +8008,7 @@ _user_create_index(dev_t device, const char *userName, uint32 type, uint32 flags) { char name[B_FILE_NAME_LENGTH]; - + if (!IS_USER_ADDRESS(userName) || user_strlcpy(name, userName, B_FILE_NAME_LENGTH) < B_OK) return B_BAD_ADDRESS; @@ -8043,7 +8043,7 @@ _user_remove_index(dev_t device, const char *userName) { char name[B_FILE_NAME_LENGTH]; - + if (!IS_USER_ADDRESS(userName) || user_strlcpy(name, userName, B_FILE_NAME_LENGTH) < B_OK) return B_BAD_ADDRESS; From axeld at mail.berlios.de Tue Mar 4 18:03:25 2008 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Tue, 4 Mar 2008 18:03:25 +0100 Subject: [Haiku-commits] r24237 - haiku/trunk/src/system/kernel/fs Message-ID: <200803041703.m24H3P0J004607@sheep.berlios.de> Author: axeld Date: 2008-03-04 18:03:25 +0100 (Tue, 04 Mar 2008) New Revision: 24237 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24237&view=rev Modified: haiku/trunk/src/system/kernel/fs/devfs.cpp Log: * Since the device hooks can actually change when the driver is republished, we now update them. * This fixes occasional crashes with reloaded/repulished drivers. * Minor cleanup. Modified: haiku/trunk/src/system/kernel/fs/devfs.cpp =================================================================== --- haiku/trunk/src/system/kernel/fs/devfs.cpp 2008-03-04 16:59:59 UTC (rev 24236) +++ haiku/trunk/src/system/kernel/fs/devfs.cpp 2008-03-04 17:03:25 UTC (rev 24237) @@ -159,6 +159,8 @@ }; +static status_t get_node_for_path(struct devfs *fs, const char *path, + struct devfs_vnode **_node); static void get_device_name(struct devfs_vnode *vnode, char *buffer, size_t size); static status_t unpublish_node(struct devfs *fs, devfs_vnode *node, @@ -267,14 +269,23 @@ entry = currentNodes.GetNext(entry); } - if (present) - continue; - - // the device was not present before -> publish it now device_hooks *hooks = driver->find_device(devicePaths[0]); if (hooks == NULL) continue; + if (present) { + // update hooks + devfs_vnode *vnode; + status_t status = get_node_for_path(sDeviceFileSystem, + devicePaths[0], &vnode); + if (status != B_OK) + return status; + + vnode->stream.u.dev.ops = hooks; + continue; + } + + // the device was not present before -> publish it now TRACE(("devfs: publishing new device \"%s\"\n", devicePaths[0])); if (publish_device(sDeviceFileSystem, devicePaths[0], NULL, NULL, driver, hooks, driver->api_version) == B_OK) @@ -960,8 +971,8 @@ goto err1; } - // increase reference count of raw device - - // the partition device really needs it + // increase reference count of raw device - + // the partition device really needs it status = get_vnode(fs->id, device->id, (fs_vnode *)&partition->raw_device); if (status < B_OK) goto err1; @@ -1031,7 +1042,7 @@ info->read_pages = NULL; info->write_pages = NULL; // old devices can't know how to do physical page access - + if (version >= 2) { // According to Be newsletter, vol II, issue 36, // version 2 added readv/writev, which we don't support, but also @@ -1334,7 +1345,8 @@ // construct full path name - for (vnode = leaf; vnode->parent && vnode->parent != vnode; vnode = vnode->parent) { + for (vnode = leaf; vnode->parent && vnode->parent != vnode; + vnode = vnode->parent) { size_t length = strlen(vnode->name); size_t start = offset - length - 1; @@ -1344,7 +1356,7 @@ buffer[offset - 1] = '/'; } - offset = start; + offset = start; } } @@ -1357,19 +1369,39 @@ return 0; } - struct devfs_vnode *vnode = (struct devfs_vnode *)strtoul(argv[1], NULL, 0); + struct devfs_vnode *vnode = (struct devfs_vnode *)parse_expression(argv[1]); if (vnode == NULL) { kprintf("invalid node address\n"); return 0; } kprintf("DEVFS NODE: %p\n", vnode); - kprintf(" id: %Ld\n", vnode->id); - kprintf(" name: %s\n", vnode->name); - kprintf(" type: %x\n", vnode->stream.type); - kprintf(" parent: %p\n", vnode->parent); - kprintf(" dir_next: %p\n", vnode->dir_next); + kprintf(" id: %Ld\n", vnode->id); + kprintf(" name: \"%s\"\n", vnode->name); + kprintf(" type: %x\n", vnode->stream.type); + kprintf(" parent: %p\n", vnode->parent); + kprintf(" dir next: %p\n", vnode->dir_next); + if (S_ISDIR(vnode->stream.type)) { + kprintf(" dir scanned: %ld\n", vnode->stream.u.dir.scanned); + kprintf(" contents:\n"); + + devfs_vnode *children = vnode->stream.u.dir.dir_head; + while (children != NULL) { + kprintf(" %p, id %Ld\n", children, children->id); + children = children->dir_next; + } + } else if (S_ISLNK(vnode->stream.type)) { + kprintf(" symlink to: %s\n", vnode->stream.u.symlink.path); + } else { + kprintf(" device node: %p\n", vnode->stream.u.dev.node); + kprintf(" driver info: %p\n", vnode->stream.u.dev.info); + kprintf(" hooks: %p\n", vnode->stream.u.dev.ops); + kprintf(" partition: %p\n", vnode->stream.u.dev.partition); + kprintf(" scheduler: %p\n", vnode->stream.u.dev.scheduler); + kprintf(" driver: %p\n", vnode->stream.u.dev.driver); + } + return 0; } @@ -1611,7 +1643,7 @@ struct devfs_vnode *vnode = (struct devfs_vnode *)_vnode; TRACE(("devfs_get_vnode_name: vnode = %p\n", vnode)); - + strlcpy(buffer, vnode->name, bufferSize); return B_OK; } @@ -1952,7 +1984,7 @@ if (vnode != NULL) { return EEXIST; } - + vnode = devfs_create_vnode(fs, dir, name); if (vnode == NULL) { return B_NO_MEMORY; @@ -2480,7 +2512,7 @@ if (statMask & FS_WRITE_STAT_MTIME) vnode->modification_time = stat->st_mtime; - if (statMask & FS_WRITE_STAT_CRTIME) + if (statMask & FS_WRITE_STAT_CRTIME) vnode->creation_time = stat->st_crtime; notify_stat_changed(fs->id, vnode->id, statMask); @@ -2659,16 +2691,16 @@ { TRACE(("removing device %s from public list\n", device->name)); - --num_devices; + --num_devices; REMOVE_DL_LIST( device, devices, ); - + ++num_unpublished_devices; ADD_DL_LIST_HEAD( device, devices_to_unpublish, ); - + // (don't free it even if no handle is open - the device // info block contains the hook list which may just got passed - // to the devfs layer; we better wait until next - // publish_devices, so we are sure that devfs won't access + // to the devfs layer; we better wait until next + // publish_devices, so we are sure that devfs won't access // the hook list anymore) } #endif @@ -2686,13 +2718,13 @@ TRACE(("pnp_devfs_device_removed()\n")); #if 0 parent = sDeviceManager->get_parent(node); - + // don't use cookie - we don't use sDeviceManager loading scheme but // global data and keep care of everything ourself! ACQUIRE_BEN( &device_list_lock ); - + for( device = devices; device; device = device->next ) { - if( device->parent == parent ) + if( device->parent == parent ) break; } @@ -2702,9 +2734,9 @@ SHOW_ERROR( 0, "bug: node %p couldn't been found", node ); res = B_NAME_NOT_FOUND; } - + RELEASE_BEN( &device_list_lock ); - + //nudge(); #endif } From axeld at mail.berlios.de Tue Mar 4 22:28:11 2008 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Tue, 4 Mar 2008 22:28:11 +0100 Subject: [Haiku-commits] r24238 - haiku/trunk/src/add-ons/kernel/drivers/audio/hda Message-ID: <200803042128.m24LSBUP019990@sheep.berlios.de> Author: axeld Date: 2008-03-04 22:28:09 +0100 (Tue, 04 Mar 2008) New Revision: 24238 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24238&view=rev Modified: haiku/trunk/src/add-ons/kernel/drivers/audio/hda/hda_codec.cpp Log: * Fixed various errors in the widget debug output. * Further cleanup. Modified: haiku/trunk/src/add-ons/kernel/drivers/audio/hda/hda_codec.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/audio/hda/hda_codec.cpp 2008-03-04 17:03:25 UTC (rev 24237) +++ haiku/trunk/src/add-ons/kernel/drivers/audio/hda/hda_codec.cpp 2008-03-04 21:28:09 UTC (rev 24238) @@ -143,12 +143,39 @@ } +static const char* +get_widget_type_name(hda_widget_type type) +{ + switch (type) { + case WT_AUDIO_OUTPUT: + return "Audio Output"; + case WT_AUDIO_INPUT: + return "Audio Input"; + case WT_AUDIO_MIXER: + return "Audio Mixer"; + case WT_AUDIO_SELECTOR: + return "Audio Selector"; + case WT_PIN_COMPLEX: + return "Pin Complex"; + case WT_POWER: + return "Power"; + case WT_VOLUME_KNOB: + return "Volume Knob"; + case WT_BEEP_GENERATOR: + return "Beep Generator"; + case WT_VENDOR_DEFINED: + return "Vendor Defined"; + default: + return "Unknown"; + } +} + + static status_t hda_codec_parse_audio_group(hda_audio_group* audioGroup) { - corb_t verbs[6]; - uint32 resp[6]; - uint32 widx; + corb_t verbs[3]; + uint32 resp[3]; hda_widget_get_stream_support(audioGroup->codec, audioGroup->root_node_id, &audioGroup->supported_formats, &audioGroup->supported_rates); @@ -165,18 +192,21 @@ if (hda_send_verbs(audioGroup->codec, verbs, resp, 3) != B_OK) return B_ERROR; - dprintf("%s: Output delay: %ld samples, Input delay: %ld samples, " - "Beep Generator: %s\n", __func__, resp[0] & 0xf, + dprintf("hda: Audio Group: Output delay: %ld samples, Input delay: %ld " + "samples, Beep Generator: %s\n", resp[0] & 0xf, (resp[0] >> 8) & 0xf, (resp[0] & (1 << 16)) ? "yes" : "no"); - dprintf("%s: #GPIO: %ld, #GPO: %ld, #GPI: %ld, unsol: %s, wake: %s\n", - __func__, resp[4] & 0xFF, (resp[1] >> 8) & 0xFF, - (resp[1] >> 16) & 0xFF, (resp[1] & (1 << 30)) ? "yes" : "no", + dprintf("hda: #GPIO: %ld, #GPO: %ld, #GPI: %ld, unsol: %s, wake: %s\n", + resp[4] & 0xff, (resp[1] >> 8) & 0xff, + (resp[1] >> 16) & 0xff, (resp[1] & (1 << 30)) ? "yes" : "no", (resp[1] & (1 << 31)) ? "yes" : "no"); audioGroup->widget_start = resp[2] >> 16; - audioGroup->widget_count = resp[2] & 0xFF; + audioGroup->widget_count = resp[2] & 0xff; + dprintf("hda: widget start %lu, count %lu\n", audioGroup->widget_start, + audioGroup->widget_count); + audioGroup->widgets = (hda_widget*)calloc(audioGroup->widget_count, sizeof(*audioGroup->widgets)); if (audioGroup->widgets == NULL) { @@ -185,21 +215,26 @@ } /* Iterate over all Widgets and collect info */ - for (widx = 0; widx < audioGroup->widget_count; widx++) { - uint32 wid = audioGroup->widget_start + widx; - char buf[256]; - int off; + for (uint32 i = 0; i < audioGroup->widget_count; i++) { + uint32 widget = audioGroup->widget_start + i; - verbs[0] = MAKE_VERB(audioGroup->codec->addr, wid, VID_GET_PARAMETER, + verbs[0] = MAKE_VERB(audioGroup->codec->addr, widget, VID_GET_PARAMETER, PID_AUDIO_WIDGET_CAP); - verbs[1] = MAKE_VERB(audioGroup->codec->addr, wid, VID_GET_PARAMETER, + verbs[1] = MAKE_VERB(audioGroup->codec->addr, widget, VID_GET_PARAMETER, PID_CONNECTION_LIST_LENGTH); - hda_send_verbs(audioGroup->codec, verbs, resp, 2); + if (hda_send_verbs(audioGroup->codec, verbs, resp, 2) != B_OK) + return B_ERROR; - audioGroup->widgets[widx].type = (hda_widget_type)(resp[0] >> 20); - audioGroup->widgets[widx].num_inputs = resp[1] & 0x7F; + audioGroup->widgets[i].type = (hda_widget_type)(resp[0] >> 20); + audioGroup->widgets[i].num_inputs = resp[1] & 0x7f; - off = 0; + dprintf("%ld: %s\n", widget, + get_widget_type_name(audioGroup->widgets[i].type)); + + char buf[256]; + int off = 0; + buf[0] = '\0'; + if (resp[0] & (1 << 11)) off += sprintf(buf + off, "[L-R Swap] "); @@ -207,10 +242,10 @@ corb_t verb; uint32 resp; - off += sprintf(buf+off, "[Power] "); + off += sprintf(buf + off, "[Power] "); /* We support power; switch us on! */ - verb = MAKE_VERB(audioGroup->codec->addr, wid, + verb = MAKE_VERB(audioGroup->codec->addr, widget, VID_SET_POWER_STATE, 0); hda_send_verbs(audioGroup->codec, &verb, &resp, 1); } @@ -234,116 +269,104 @@ if (resp[0] & (1 << 0)) off += sprintf(buf + off, "[Stereo] "); - switch (audioGroup->widgets[widx].type) { + switch (audioGroup->widgets[i].type) { case WT_AUDIO_OUTPUT: - dprintf("%ld:\tAudio Output\n", wid); - hda_widget_get_stream_support(audioGroup->codec, wid, - &audioGroup->widgets[widx].d.input.formats, - &audioGroup->widgets[widx].d.input.rates); - hda_widget_get_amplifier_capabilities(audioGroup->codec, wid); + hda_widget_get_stream_support(audioGroup->codec, widget, + &audioGroup->widgets[i].d.input.formats, + &audioGroup->widgets[i].d.input.rates); + hda_widget_get_amplifier_capabilities(audioGroup->codec, widget); break; case WT_AUDIO_INPUT: - dprintf("%ld:\tAudio Input\n", wid); - hda_widget_get_stream_support(audioGroup->codec, wid, - &audioGroup->widgets[widx].d.input.formats, - &audioGroup->widgets[widx].d.input.rates); - hda_widget_get_amplifier_capabilities(audioGroup->codec, wid); + hda_widget_get_stream_support(audioGroup->codec, widget, + &audioGroup->widgets[i].d.input.formats, + &audioGroup->widgets[i].d.input.rates); + hda_widget_get_amplifier_capabilities(audioGroup->codec, widget); break; case WT_AUDIO_MIXER: - dprintf("%ld:\tAudio Mixer\n", wid); - hda_widget_get_amplifier_capabilities(audioGroup->codec, wid); + hda_widget_get_amplifier_capabilities(audioGroup->codec, widget); break; case WT_AUDIO_SELECTOR: - dprintf("%ld:\tAudio Selector\n", wid); - hda_widget_get_amplifier_capabilities(audioGroup->codec, wid); + hda_widget_get_amplifier_capabilities(audioGroup->codec, widget); break; case WT_PIN_COMPLEX: - dprintf("%ld:\tPin Complex\n", wid); - verbs[0] = MAKE_VERB(audioGroup->codec->addr, wid, VID_GET_PARAMETER, - PID_PIN_CAP); + verbs[0] = MAKE_VERB(audioGroup->codec->addr, widget, + VID_GET_PARAMETER, PID_PIN_CAP); if (hda_send_verbs(audioGroup->codec, verbs, resp, 1) == B_OK) { - audioGroup->widgets[widx].d.pin.input = resp[0] & (1 << 5); - audioGroup->widgets[widx].d.pin.output = resp[0] & (1 << 4); + audioGroup->widgets[i].d.pin.input = resp[0] & (1 << 5); + audioGroup->widgets[i].d.pin.output = resp[0] & (1 << 4); dprintf("\t%s%s\n", - audioGroup->widgets[widx].d.pin.input ? "[Input] " : "", - audioGroup->widgets[widx].d.pin.output ? "[Output]" : ""); + audioGroup->widgets[i].d.pin.input ? "[Input] " : "", + audioGroup->widgets[i].d.pin.output ? "[Output]" : ""); } else { dprintf("%s: Error getting Pin Complex IO\n", __func__); } - verbs[0] = MAKE_VERB(audioGroup->codec->addr, wid, + verbs[0] = MAKE_VERB(audioGroup->codec->addr, widget, VID_GET_CONFIGURATION_DEFAULT, 0); if (hda_send_verbs(audioGroup->codec, verbs, resp, 1) == B_OK) { - audioGroup->widgets[widx].d.pin.device = (pin_dev_type) + audioGroup->widgets[i].d.pin.device = (pin_dev_type) ((resp[0] >> 20) & 0xf); dprintf("\t%s, %s, %s, %s\n", kPortConnector[resp[0] >> 30], - kDefaultDevice[audioGroup->widgets[widx].d.pin.device], + kDefaultDevice[audioGroup->widgets[i].d.pin.device], kConnectionType[(resp[0] >> 16) & 0xF], kJackColor[(resp[0] >> 12) & 0xF]); } - hda_widget_get_amplifier_capabilities(audioGroup->codec, wid); + hda_widget_get_amplifier_capabilities(audioGroup->codec, widget); break; - case WT_POWER: - dprintf("%ld:\tPower\n", wid); + + default: break; - case WT_VOLUME_KNOB: - dprintf("%ld:\tVolume Knob\n", wid); - break; - case WT_BEEP_GENERATOR: - dprintf("%ld:\tBeep Generator\n", wid); - break; - case WT_VENDOR_DEFINED: - dprintf("%ld:\tVendor Defined\n", wid); - break; - default: /* Reserved */ - break; } - dprintf("\t%s\n", buf); + if (off) + dprintf("\t%s\n", buf); - hda_widget_get_pm_support(audioGroup->codec, wid, - &audioGroup->widgets[widx].pm); + hda_widget_get_pm_support(audioGroup->codec, widget, + &audioGroup->widgets[i].pm); - if (audioGroup->widgets[widx].num_inputs) { - if (audioGroup->widgets[widx].num_inputs > 1) { - verbs[0] = MAKE_VERB(audioGroup->codec->addr, wid, + if (audioGroup->widgets[i].num_inputs) { + if (audioGroup->widgets[i].num_inputs > 1) { + verbs[0] = MAKE_VERB(audioGroup->codec->addr, widget, VID_GET_CONNECTION_SELECT, 0); if (hda_send_verbs(audioGroup->codec, verbs, resp, 1) == B_OK) - audioGroup->widgets[widx].active_input = resp[0] & 0xFF; + audioGroup->widgets[i].active_input = resp[0] & 0xff; else - audioGroup->widgets[widx].active_input = -1; + audioGroup->widgets[i].active_input = -1; } else - audioGroup->widgets[widx].active_input = -1; + audioGroup->widgets[i].active_input = -1; + buf[0] = '\0'; off = 0; - for (uint32 i = 0; i < audioGroup->widgets[widx].num_inputs; i++) { - if (!(i % 4)) { - verbs[0] = MAKE_VERB(audioGroup->codec->addr, wid, - VID_GET_CONNECTION_LIST_ENTRY, i); - if (hda_send_verbs(audioGroup->codec, verbs, resp, 1) != B_OK) { - dprintf("%s: Error parsing inputs for widget %ld!\n", - __func__, wid); + for (uint32 inputIndex = 0; inputIndex + < audioGroup->widgets[i].num_inputs; inputIndex++) { + if ((inputIndex % 4) == 0) { + // we get 4 answers per call in short list mode + verbs[0] = MAKE_VERB(audioGroup->codec->addr, widget, + VID_GET_CONNECTION_LIST_ENTRY, inputIndex); + if (hda_send_verbs(audioGroup->codec, verbs, resp, 1) + != B_OK) { + dprintf("hda: Error parsing inputs for widget %ld!\n", + widget); break; } } - if ((int32)i != audioGroup->widgets[widx].active_input) { - off += sprintf(buf + off, "%ld ", - (resp[0] >> (8 * (i % 4))) & 0xff); - } else { - off += sprintf(buf + off, "(%ld) ", - (resp[0] >> (8 * (i % 4))) & 0xff); - } + uint32 input = (resp[0] >> (8 * (inputIndex % 4))) & 0xff; - audioGroup->widgets[widx].inputs[i] - = (resp[0] >> (8 * (i % 4))) & 0xff; + if ((int32)inputIndex != audioGroup->widgets[i].active_input) + off += sprintf(buf + off, "%ld ", input); + else + off += sprintf(buf + off, "(%ld) ", input); + + audioGroup->widgets[i].inputs[inputIndex] = input; } - dprintf("\t[ %s]\n", buf); + if (off != 0) + dprintf("\tConnections: %s\n", buf); } } @@ -351,7 +374,7 @@ } -/*! Find path from 'wid' to a widget of type \a widgetType, returning its +/*! Find path from 'widget' to a widget of type \a widgetType, returning its widget id. Returns 0 if not found. */ @@ -359,27 +382,27 @@ hda_codec_audio_group_find_path(hda_audio_group* audioGroup, uint32 widget, hda_widget_type widgetType, uint32 depth) { - int widx = widget - audioGroup->widget_start; + int groupIndex = widget - audioGroup->widget_start; - switch (audioGroup->widgets[widx].type) { + switch (audioGroup->widgets[groupIndex].type) { case WT_AUDIO_MIXER: - for (uint32 i = 0; i < audioGroup->widgets[widx].num_inputs; i++) { + for (uint32 i = 0; i < audioGroup->widgets[groupIndex].num_inputs; i++) { if (hda_codec_audio_group_find_path(audioGroup, - audioGroup->widgets[widx].inputs[i], widgetType, + audioGroup->widgets[groupIndex].inputs[i], widgetType, depth + 1)) { - if (audioGroup->widgets[widx].active_input == -1) - audioGroup->widgets[widx].active_input = i; + if (audioGroup->widgets[groupIndex].active_input == -1) + audioGroup->widgets[groupIndex].active_input = i; - return audioGroup->widgets[widx].inputs[i]; + return audioGroup->widgets[groupIndex].inputs[i]; } } break; case WT_AUDIO_SELECTOR: { - int32 i = audioGroup->widgets[widx].active_input; + int32 i = audioGroup->widgets[groupIndex].active_input; if (i != -1) { - widget = audioGroup->widgets[widx].inputs[i]; + widget = audioGroup->widgets[groupIndex].inputs[i]; if (hda_codec_audio_group_find_path(audioGroup, widget, widgetType, depth + 1)) { return widget; @@ -389,12 +412,12 @@ } default: - if (audioGroup->widgets[widx].type == widgetType) + if (audioGroup->widgets[groupIndex].type == widgetType) return widget; break; } - + return 0; } From axeld at mail.berlios.de Tue Mar 4 22:49:40 2008 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Tue, 4 Mar 2008 22:49:40 +0100 Subject: [Haiku-commits] r24239 - haiku/trunk/src/system/kernel Message-ID: <200803042149.m24LnebJ023637@sheep.berlios.de> Author: axeld Date: 2008-03-04 22:49:40 +0100 (Tue, 04 Mar 2008) New Revision: 24239 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24239&view=rev Modified: haiku/trunk/src/system/kernel/int.c Log: * This fixes the broken count of unhandled interrupts which caused some problems in the past (it only worked for level triggered interrupts). * Of course, the actual problem is that on current hardware we detect almost all interrupts as edge triggered... Modified: haiku/trunk/src/system/kernel/int.c =================================================================== --- haiku/trunk/src/system/kernel/int.c 2008-03-04 21:28:09 UTC (rev 24238) +++ haiku/trunk/src/system/kernel/int.c 2008-03-04 21:49:40 UTC (rev 24239) @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006, Axel D?rfler, axeld at pinc-software.de. All rights reserved. + * Copyright 2002-2008, Axel D?rfler, axeld at pinc-software.de. All rights reserved. * Distributed under the terms of the MIT License. * * Copyright 2001-2002, Travis Geiselbrecht. All rights reserved. @@ -126,12 +126,12 @@ io_vectors[i].vector_lock = 0; /* initialize spinlock */ io_vectors[i].enable_count = 0; io_vectors[i].no_lock_vector = false; - #ifdef DEBUG_INT - io_vectors[i].handled_count = 0; - io_vectors[i].unhandled_count = 0; - io_vectors[i].trigger_count = 0; - io_vectors[i].ignored_count = 0; - #endif +#ifdef DEBUG_INT + io_vectors[i].handled_count = 0; + io_vectors[i].unhandled_count = 0; + io_vectors[i].trigger_count = 0; + io_vectors[i].ignored_count = 0; +#endif initque(&io_vectors[i].handler_list); /* initialize handler queue */ } @@ -302,7 +302,7 @@ #ifdef DEBUG_INT io_vectors[vector].trigger_count++; - if (status != B_UNHANDLED_INTERRUPT) { + if (status != B_UNHANDLED_INTERRUPT || handled || invokeScheduler) { io_vectors[vector].handled_count++; } else { io_vectors[vector].unhandled_count++; From anevilyak at gmail.com Wed Mar 5 05:49:44 2008 From: anevilyak at gmail.com (Rene Gollent) Date: Tue, 4 Mar 2008 22:49:44 -0600 Subject: [Haiku-commits] r24228 - haiku/trunk/src/kits/app In-Reply-To: References: <200803040608.m2468Mp8000615@sheep.berlios.de> <20080304113447.M87610@mlotz.ch> Message-ID: Hi Michael, > > source anymore. Anyway, I will look into it and try reproducing using the > > steps you mentioned above. Thanks for the pointers! > > > If it helps, I've done some further debugging...what seems to happen confuses me though. Up until the following code, it executes correctly: if (direct->Queue()->IsNextMessage(copy) && port_count(port) <= 0) { // there is currently no message waiting, and we need to wakeup the looper write_port_etc(port, 0, NULL, 0, B_RELATIVE_TIMEOUT, 0); } However, as soon as it calls write_port_etc(), it suddenly ends up in IsSourceWaiting(), with the same this ptr, but a null fHeader, and never executes the rest of BMessage::_SendMessage() following that if block. Could something be going wrong at the kernel level here? Regards, Rene From bga at mail.berlios.de Wed Mar 5 15:37:02 2008 From: bga at mail.berlios.de (bga at BerliOS) Date: Wed, 5 Mar 2008 15:37:02 +0100 Subject: [Haiku-commits] r24240 - haiku/trunk/build/jam Message-ID: <200803051437.m25Eb2D5002683@sheep.berlios.de> Author: bga Date: 2008-03-05 15:37:01 +0100 (Wed, 05 Mar 2008) New Revision: 24240 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24240&view=rev Modified: haiku/trunk/build/jam/UserBuildConfig.sample Log: - Commented out all entries as this is a template file. When copying it to UserBuildConfig the user just have to uncomment whatever he/she wants. This is easier than commenting out almost everything. - Added entries for Pe and Links optional packages. Modified: haiku/trunk/build/jam/UserBuildConfig.sample =================================================================== --- haiku/trunk/build/jam/UserBuildConfig.sample 2008-03-04 21:49:40 UTC (rev 24239) +++ haiku/trunk/build/jam/UserBuildConfig.sample 2008-03-05 14:37:01 UTC (rev 24240) @@ -19,18 +19,18 @@ # Turn off warnings in directory src/system/kernel. As fourth (scope) parameter # "local" is specified, which means, that this setting applies only to the # given directory, but not any of its subdirectories. -SetConfigVar WARNINGS : HAIKU_TOP src system kernel : 0 : local ; +#SetConfigVar WARNINGS : HAIKU_TOP src system kernel : 0 : local ; # Set the debug level for directory src/system/boot/loader and recursively all # of its subdirectories (scope is "global") to 1. All affected generated files # will be put into another subtree of the "generated" directory, which allows # for fast switching between normal and debug builds. -SetConfigVar DEBUG : HAIKU_TOP src system boot loader : 1 : global ; +#SetConfigVar DEBUG : HAIKU_TOP src system boot loader : 1 : global ; # Add "RUN_WITHOUT_REGISTRAR" to the DEFINES for the directory src/kits and # all of its subdirectories. -AppendToConfigVar DEFINES : HAIKU_TOP src kits : RUN_WITHOUT_REGISTRAR - : global ; +#AppendToConfigVar DEFINES : HAIKU_TOP src kits : RUN_WITHOUT_REGISTRAR +# : global ; # Set the debug level for file src/bin/gdb/gdb/haiku-nat.c (note, that # the object file must be specified) to 1. It is worth mentioning, that the @@ -38,25 +38,25 @@ # generated/objects/.../release/... Only when setting DEBUG for the executable, # too, it will be placed in .../debug_1/.... Apart from that, the DEBUG variable # has no effect on executables or other shared objects. -DEBUG on haiku-nat.o = 1 ; +#DEBUG on haiku-nat.o = 1 ; # Haiku Image Related Modifications # Create a 100 MB image at /tmp/walter.image. -HAIKU_IMAGE_NAME = walter.image ; -HAIKU_IMAGE_DIR = /tmp ; -HAIKU_IMAGE_SIZE = 100 ; +#HAIKU_IMAGE_NAME = walter.image ; +#HAIKU_IMAGE_DIR = /tmp ; +#HAIKU_IMAGE_SIZE = 100 ; # Name the VMWare image walter.vmdk (in directory $(HAIKU_IMAGE_DIR)). -HAIKU_VMWARE_IMAGE_NAME = walter.vmdk ; +#HAIKU_VMWARE_IMAGE_NAME = walter.vmdk ; # Install Haiku in directory /Haiku. -HAIKU_INSTALL_DIR = /Haiku ; +#HAIKU_INSTALL_DIR = /Haiku ; # If the image does already exist it won't be zeroed out. It will nevertheless # freshly be initialized with BFS. Useful when installing Haiku on a partition. -HAIKU_DONT_CLEAR_IMAGE = 1 ; +#HAIKU_DONT_CLEAR_IMAGE = 1 ; # Affects the haiku-image, haiku-vmware-image, and install-haiku targets. Only @@ -64,49 +64,55 @@ # updated in the image file/installation directory. # The update-image, update-vmware-image, and update-install targets always invoke # this rule, so one likely doesn't ever need to do it manually. -SetUpdateHaikuImageOnly 1 ; +#SetUpdateHaikuImageOnly 1 ; # libbe.so and the kernel will be updated on image updates. Note that this # generally doesn't work for pseudo targets (it does where special support # has been added, like for "kernel"). -HAIKU_INCLUDE_IN_IMAGE on libbe.so kernel = 1 ; +#HAIKU_INCLUDE_IN_IMAGE on libbe.so kernel = 1 ; # Add "crashing_app" to the beos/bin directory of the Haiku image/installation. # Note, that this also makes the image depend on the target, i.e. it is # automatically updated when the image is built. -AddFilesToHaikuImage beos bin : crashing_app ; +#AddFilesToHaikuImage beos bin : crashing_app ; # Make a symlink to home/config/bin/crash. -AddSymlinkToHaikuImage home config bin : /beos/bin/crashing_app : crash ; +#AddSymlinkToHaikuImage home config bin : /beos/bin/crashing_app : crash ; # Adds the source directories src/kits/storage and src/tests/servers/debug # (recursively) to the image (as /boot/home/HaikuSources/src/kits/storage # and /boot/home/HaikuSources/src/tests/servers/debug respectively). # Note that the second directory will also be copied, if the image will only # be updated; the first one won't in that case. -AddSourceDirectoryToHaikuImage src/kits/storage ; -AddSourceDirectoryToHaikuImage src/tests/servers/debug : 1 ; +#AddSourceDirectoryToHaikuImage src/kits/storage ; +#AddSourceDirectoryToHaikuImage src/tests/servers/debug : 1 ; # Unzips the given zip archive onto the image under /boot/develop/tools. -UnzipArchiveToHaikuImage develop tools - : /home/bonefish/develop/haiku/misc/gcc-2.95.3-beos-070218/gcc-2.95.3_binutils-2.17_rel-070218.zip ; +#UnzipArchiveToHaikuImage develop tools +# : /home/bonefish/develop/haiku/misc/gcc-2.95.3-beos-070218/gcc-2.95.3_binutils-2.17_rel-070218.zip ; # Adds the optional package WonderBrush to the image. The package is downloaded # via wget (i.e. wget must be installed). -AddOptionalHaikuImagePackages WonderBrush ; +#AddOptionalHaikuImagePackages WonderBrush ; # Adds the optional package Vision to the image. See above. -AddOptionalHaikuImagePackages Vision ; +#AddOptionalHaikuImagePackages Vision ; +# Adds the optional package Pe to the image. See above. +#AddOptionalHaikuImagePackages Pe ; + +# Adds the optional package Links to the image. See above. +#AddOptionalHaikuImagePackages Links ; + # Add all available optional packages. -HAIKU_ADD_ALL_OPTIONAL_PACKAGES = 1 ; +#HAIKU_ADD_ALL_OPTIONAL_PACKAGES = 1 ; # Specify scripts that shall be run when populating the image/installation # directory. The "early" script is run before anything has been copied onto # the image/into the installation directory. The "late" script is run after # everything has been copied, but before the MIME database is installed. -HAIKU_IMAGE_EARLY_USER_SCRIPTS = $(HAIKU_TOP)/../early-image-script.sh ; -HAIKU_IMAGE_LATE_USER_SCRIPTS = $(HAIKU_TOP)/../late-image-script.sh ; +#HAIKU_IMAGE_EARLY_USER_SCRIPTS = $(HAIKU_TOP)/../early-image-script.sh ; +#HAIKU_IMAGE_LATE_USER_SCRIPTS = $(HAIKU_TOP)/../late-image-script.sh ; # Creating Sourceable Shell Scripts @@ -117,22 +123,22 @@ # General setup for the shell script to generate. Name is test.inc, located # in the output directory. -MakeLocate test.inc : $(HAIKU_OUTPUT_DIR) ; -Always test.inc ; +#MakeLocate test.inc : $(HAIKU_OUTPUT_DIR) ; +#Always test.inc ; # Define variable "outputDir" in the shell script, with the value of # HAIKU_OUTPUT_DIR. -AddVariableToScript test.inc : outputDir : $(HAIKU_OUTPUT_DIR) ; +#AddVariableToScript test.inc : outputDir : $(HAIKU_OUTPUT_DIR) ; # Define variables "bfsShell" and "fsShellCommand" referring to the # generated bfs_shell and fs_shell_command respectively. -AddTargetVariableToScript test.inc : bfs_shell : bfsShell ; -AddTargetVariableToScript test.inc : fs_shell_command : fsShellCommand ; +#AddTargetVariableToScript test.inc : bfs_shell : bfsShell ; +#AddTargetVariableToScript test.inc : fs_shell_command : fsShellCommand ; # If no variable name is given, the name (without grist) of the target is # used, i.e. a variable "rc" referring to the rc command built for the host # platform is defined in the script. -AddTargetVariableToScript test.inc : rc ; +#AddTargetVariableToScript test.inc : rc ; # Optimizing Jamfile Parsing Times @@ -140,16 +146,16 @@ # Setting this variable will prevent the root Jamfile to include the Jamfile # in the src directory. Instead only the directories required for building the # build tools are included. Only useful in combination with DeferredSubInclude. -HAIKU_DONT_INCLUDE_SRC = 1 ; +#HAIKU_DONT_INCLUDE_SRC = 1 ; # Schedule the given subdirectory for inclusion at the end of the root # Jamfile (directly using SubInclude here is not possible). Using this # feature together with HAIKU_DONT_INCLUDE_SRC allows developers working # only on a subproject to reduce Jamfile parsing times considerably. -DeferredSubInclude HAIKU_TOP src tests add-ons kernel file_systems - userlandfs ; +#DeferredSubInclude HAIKU_TOP src tests add-ons kernel file_systems +# userlandfs ; # Copy the posix test suite onto the image (or on the installation) into # "home/posixtestsuite" directory, including the run script. -HAIKU_ADD_POSIX_TEST_SUITE_TO_IMAGE = 1 ; +#HAIKU_ADD_POSIX_TEST_SUITE_TO_IMAGE = 1 ; From axeld at mail.berlios.de Wed Mar 5 15:43:47 2008 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Wed, 5 Mar 2008 15:43:47 +0100 Subject: [Haiku-commits] r24241 - haiku/trunk/src/add-ons/accelerants/nvidia Message-ID: <200803051443.m25Ehl9T003266@sheep.berlios.de> Author: axeld Date: 2008-03-05 15:43:46 +0100 (Wed, 05 Mar 2008) New Revision: 24241 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24241&view=rev Modified: haiku/trunk/src/add-ons/accelerants/nvidia/ProposeDisplayMode.c Log: * Effectively disabled the force_ws option: wide screen resolutions are pretty common these days, so having a not so crowded resolution menu is not really a good argument for making the driver unusable for the majority of potential users. Modified: haiku/trunk/src/add-ons/accelerants/nvidia/ProposeDisplayMode.c =================================================================== --- haiku/trunk/src/add-ons/accelerants/nvidia/ProposeDisplayMode.c 2008-03-05 14:37:01 UTC (rev 24240) +++ haiku/trunk/src/add-ons/accelerants/nvidia/ProposeDisplayMode.c 2008-03-05 14:43:46 UTC (rev 24241) @@ -217,15 +217,19 @@ } break; default: +#if 0 /* at least one analog monitor is connected, or nothing detected at all */ /* (if forcing widescreen type was requested don't block mode) */ if (target_aspect > 1.34 && !si->settings.force_ws) { LOG(4, ("PROPOSEMODE: not all output devices can display widescreen modes, aborted.\n")); return B_ERROR; } +#endif break; } +// Wide screen modes are pretty common these days... - better use EDID! +#if 0 /* only export widescreen panel-TV modes when an exact resolution match exists, * to prevent the modelist from becoming too crowded */ if (target_aspect > 1.61 && !si->settings.force_ws) { @@ -246,6 +250,7 @@ return B_ERROR; } } +#endif } /* check if panel(s) can display the requested resolution (if connected) */ From stefano.ceccherini at gmail.com Wed Mar 5 17:42:15 2008 From: stefano.ceccherini at gmail.com (Stefano Ceccherini) Date: Wed, 5 Mar 2008 17:42:15 +0100 Subject: [Haiku-commits] r24240 - haiku/trunk/build/jam In-Reply-To: <200803051437.m25Eb2D5002683@sheep.berlios.de> References: <200803051437.m25Eb2D5002683@sheep.berlios.de> Message-ID: <894b9700803050842l258c2373xb817270e60a9e119@mail.gmail.com> 2008/3/5, bga at BerliOS : > Author: bga > Date: 2008-03-05 15:37:01 +0100 (Wed, 05 Mar 2008) > New Revision: 24240 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24240&view=rev > > Modified: > haiku/trunk/build/jam/UserBuildConfig.sample > Log: > - Commented out all entries as this is a template file. When copying it to > UserBuildConfig the user just have to uncomment whatever he/she wants. This > is easier than commenting out almost everything. > - Added entries for Pe and Links optional packages. What about creating an optional package for firefox ? From bga at bug-br.org.br Wed Mar 5 17:46:01 2008 From: bga at bug-br.org.br (Bruno Albuquerque) Date: Wed, 05 Mar 2008 13:46:01 -0300 Subject: [Haiku-commits] r24240 - haiku/trunk/build/jam In-Reply-To: <894b9700803050842l258c2373xb817270e60a9e119@mail.gmail.com> References: <200803051437.m25Eb2D5002683@sheep.berlios.de> <894b9700803050842l258c2373xb817270e60a9e119@mail.gmail.com> Message-ID: <47CECE49.5070406@bug-br.org.br> Stefano Ceccherini wrote: > What about creating an optional package for firefox ? Last time I tried Firefox, it crashed in under 3 minutes. But I will check again. -Bruno From stefano.ceccherini at gmail.com Wed Mar 5 18:46:34 2008 From: stefano.ceccherini at gmail.com (Stefano Ceccherini) Date: Wed, 5 Mar 2008 18:46:34 +0100 Subject: [Haiku-commits] r24240 - haiku/trunk/build/jam In-Reply-To: <47CECE49.5070406@bug-br.org.br> References: <200803051437.m25Eb2D5002683@sheep.berlios.de> <894b9700803050842l258c2373xb817270e60a9e119@mail.gmail.com> <47CECE49.5070406@bug-br.org.br> Message-ID: <894b9700803050946m2ef54ca0oe9f0d46ab80846c5@mail.gmail.com> 2008/3/5, Bruno Albuquerque : > Stefano Ceccherini wrote: > > > What about creating an optional package for firefox ? > > > Last time I tried Firefox, it crashed in under 3 minutes. But I will > check again. Firefox 2.0.0.12 on current haiku only crashes on ssl sites :) From revol at free.fr Wed Mar 5 19:01:07 2008 From: revol at free.fr (=?windows-1252?q?Fran=E7ois?= Revol) Date: Wed, 05 Mar 2008 19:01:07 +0100 CET Subject: [Haiku-commits] r24240 - haiku/trunk/build/jam In-Reply-To: <894b9700803050946m2ef54ca0oe9f0d46ab80846c5@mail.gmail.com> Message-ID: <1427430017-BeMail@laptop> > 2008/3/5, Bruno Albuquerque : > > Stefano Ceccherini wrote: > > > > > What about creating an optional package for firefox ? > > > > > > Last time I tried Firefox, it crashed in under 3 minutes. But I > > will > > check again. > > Firefox 2.0.0.12 on current haiku only crashes on ssl sites :) Which reminds me we should have (open)ssl in as I had to put it along with im_kit. Didn't niels get it building yet ? Fran?ois. From niels.reedijk at gmail.com Wed Mar 5 19:02:49 2008 From: niels.reedijk at gmail.com (Niels Reedijk) Date: Wed, 5 Mar 2008 19:02:49 +0100 Subject: [Haiku-commits] r24240 - haiku/trunk/build/jam In-Reply-To: <1427430017-BeMail@laptop> References: <894b9700803050946m2ef54ca0oe9f0d46ab80846c5@mail.gmail.com> <1427430017-BeMail@laptop> Message-ID: <507d86c0803051002l44763e53g48abc3d870c14545@mail.gmail.com> 2008/3/5, Fran?ois Revol : > > 2008/3/5, Bruno Albuquerque : > > > Stefano Ceccherini wrote: > > > > > > > What about creating an optional package for firefox ? > > > > > > > > > Last time I tried Firefox, it crashed in under 3 minutes. But I > > > will > > > check again. > > > > Firefox 2.0.0.12 on current haiku only crashes on ssl sites :) > > > Which reminds me we should have (open)ssl in as I had to put it along > with im_kit. > > Didn't niels get it building yet ? I got it building, I just not gotten into the testing phase. On my list now, will do this weekend. Niels From mmu_man at mail.berlios.de Wed Mar 5 19:27:57 2008 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Wed, 5 Mar 2008 19:27:57 +0100 Subject: [Haiku-commits] r24242 - haiku/trunk/src/apps/mediaplayer Message-ID: <200803051827.m25IRvn1023937@sheep.berlios.de> Author: mmu_man Date: 2008-03-05 19:27:57 +0100 (Wed, 05 Mar 2008) New Revision: 24242 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24242&view=rev Modified: haiku/trunk/src/apps/mediaplayer/InfoWin.cpp Log: Tell if overlay is used or not. Modified: haiku/trunk/src/apps/mediaplayer/InfoWin.cpp =================================================================== --- haiku/trunk/src/apps/mediaplayer/InfoWin.cpp 2008-03-05 14:43:46 UTC (rev 24241) +++ haiku/trunk/src/apps/mediaplayer/InfoWin.cpp 2008-03-05 18:27:57 UTC (rev 24242) @@ -87,7 +87,7 @@ BRect rect = Bounds(); // accomodate for big fonts - float div = max_c(2 * 32, be_plain_font->StringWidth("Container") + 5); + float div = max_c(2 * 32, be_plain_font->StringWidth("Display Mode") + 10); fInfoView = new InfoView(rect, "background", div); fInfoView->SetViewColor(ui_color(B_DOCUMENT_BACKGROUND_COLOR)); @@ -310,7 +310,7 @@ // statistics if ((which & INFO_STATS) && fController->HasFile()) { - fLabelsView->Insert("Duration\n\n"); + fLabelsView->Insert("Duration\n"); BString s; bigtime_t d = fController->Duration(); bigtime_t v; @@ -333,13 +333,22 @@ s << " h"; else s << " min"; - s << "\n\n"; + s << "\n"; fContentsView->Insert(s.String()); // TODO: demux/video/audio/... perfs (Kb/s) + + fLabelsView->Insert("Display Mode\n"); + if (fController->IsOverlayActive()) + fContentsView->Insert("Overlay\n"); + else + fContentsView->Insert("DrawBitmap\n"); + + fLabelsView->Insert("\n"); + fContentsView->Insert("\n"); } if (which & INFO_TRANSPORT) { - // what is "Transport"? + // Transport protocol info (file, http, rtsp, ...) } if (which & INFO_FILE) { From axeld at mail.berlios.de Wed Mar 5 20:41:05 2008 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Wed, 5 Mar 2008 20:41:05 +0100 Subject: [Haiku-commits] r24243 - haiku/trunk/src/system/libroot/os Message-ID: <200803051941.m25Jf5CH031852@sheep.berlios.de> Author: axeld Date: 2008-03-05 20:41:05 +0100 (Wed, 05 Mar 2008) New Revision: 24243 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24243&view=rev Modified: haiku/trunk/src/system/libroot/os/debug.c Log: * _rtDebugFlag is supposed to default to true (is usually only used when DEBUG is defined, anyway). This fixes bug #1892. * _debugPrintf() and _sPrintf() are supposed to be silent when _rtDebugFlag is false. Modified: haiku/trunk/src/system/libroot/os/debug.c =================================================================== --- haiku/trunk/src/system/libroot/os/debug.c 2008-03-05 18:27:57 UTC (rev 24242) +++ haiku/trunk/src/system/libroot/os/debug.c 2008-03-05 19:41:05 UTC (rev 24243) @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006, Axel D?rfler, axeld at pinc-software.de. All rights reserved. + * Copyright 2002-2008, Axel D?rfler, axeld at pinc-software.de. All rights reserved. * Distributed under the terms of the MIT License. */ @@ -54,7 +54,9 @@ { NULL, 0 } }; +bool _rtDebugFlag = true; + void debugger(const char *message) { @@ -180,15 +182,9 @@ } -// #pragma mark - -// Debug.h functions +// #pragma mark - Debug.h functions -// TODO: verify these functions -// TODO: add implementations for printfs? - -bool _rtDebugFlag = false; - bool _debugFlag(void) { @@ -211,6 +207,9 @@ va_list ap; int ret; + if (!_rtDebugFlag) + return 0; + va_start(ap, fmt); ret = vfprintf(stdout, fmt, ap); va_end(ap); @@ -222,10 +221,13 @@ int _sPrintf(const char *fmt, ...) { - char buffer[1024]; + char buffer[512]; va_list ap; int ret; + if (!_rtDebugFlag) + return 0; + va_start(ap, fmt); ret = vsnprintf(buffer, sizeof(buffer), fmt, ap); va_end(ap); @@ -238,7 +240,7 @@ int -_xdebugPrintf(const char * fmt, ...) +_xdebugPrintf(const char *fmt, ...) { va_list ap; int ret; @@ -252,14 +254,15 @@ int -_debuggerAssert(const char * file, int line, char *message) +_debuggerAssert(const char *file, int line, char *message) { char buffer[1024]; snprintf(buffer, sizeof(buffer), "Assert failed: File: %s, Line: %d, %s", file, line, message); - - debug_printf("%ld: ASSERT: %s\n", find_thread(NULL), buffer); + + debug_printf("%ld: ASSERT: %s:%d %s\n", find_thread(NULL), file, line, + buffer); _kern_debugger(buffer); return 0; From korli at mail.berlios.de Wed Mar 5 21:06:19 2008 From: korli at mail.berlios.de (korli at BerliOS) Date: Wed, 5 Mar 2008 21:06:19 +0100 Subject: [Haiku-commits] r24244 - haiku/trunk/src/system/kernel/arch/x86 Message-ID: <200803052006.m25K6Jp3002422@sheep.berlios.de> Author: korli Date: 2008-03-05 21:06:18 +0100 (Wed, 05 Mar 2008) New Revision: 24244 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24244&view=rev Modified: haiku/trunk/src/system/kernel/arch/x86/arch_vm.cpp Log: here with 3GB of memory, a 4GB MTRR slot is being written, which triggers a reboot. we now split more than 2GB MTRR slot, we might improve this and split more and more. this could fix the bug #1711. Modified: haiku/trunk/src/system/kernel/arch/x86/arch_vm.cpp =================================================================== --- haiku/trunk/src/system/kernel/arch/x86/arch_vm.cpp 2008-03-05 19:41:05 UTC (rev 24243) +++ haiku/trunk/src/system/kernel/arch/x86/arch_vm.cpp 2008-03-05 20:06:18 UTC (rev 24244) @@ -91,21 +91,23 @@ if (type == 0) return B_OK; + uint32 newType; + switch (type) { case B_MTR_UC: - type = IA32_MTR_UNCACHED; + newType = IA32_MTR_UNCACHED; break; case B_MTR_WC: - type = IA32_MTR_WRITE_COMBINING; + newType = IA32_MTR_WRITE_COMBINING; break; case B_MTR_WT: - type = IA32_MTR_WRITE_THROUGH; + newType = IA32_MTR_WRITE_THROUGH; break; case B_MTR_WP: - type = IA32_MTR_WRITE_PROTECTED; + newType = IA32_MTR_WRITE_PROTECTED; break; case B_MTR_WB: - type = IA32_MTR_WRITE_BACK; + newType = IA32_MTR_WRITE_BACK; break; default: @@ -116,14 +118,19 @@ return B_NOT_SUPPORTED; // length must be a power of 2; just round it up to the next value - length = nearest_power(length); - if (length + base <= base) { + uint64 newLength = nearest_power(length); + + // avoids more than 2GB slots + if (newLength > 0x80000000) + newLength = 0x80000000; + + if (newLength + base <= base) { // 4GB overflow return B_BAD_VALUE; } // base must be aligned to the length - if (base & (length - 1)) + if (base & (newLength - 1)) return B_BAD_VALUE; index = allocate_mtrr(); @@ -131,11 +138,17 @@ return B_ERROR; TRACE(("allocate MTRR slot %ld, base = %Lx, length = %Lx\n", index, - base, length)); + base, newLength)); sMemoryTypeIDs[index] = id; - x86_set_mtrr(index, base, length, type); + x86_set_mtrr(index, base, newLength, newType); + // now handle remaining memory + if (length > newLength) { + // TODO iterate over smaller lengths to avoid the PCI hole after the physical memory. + set_memory_type(id, base + newLength, length - newLength, type); + } + return B_OK; } From korli at mail.berlios.de Wed Mar 5 22:05:14 2008 From: korli at mail.berlios.de (korli at BerliOS) Date: Wed, 5 Mar 2008 22:05:14 +0100 Subject: [Haiku-commits] r24245 - haiku/trunk/src/system/kernel Message-ID: <200803052105.m25L5Ehk007659@sheep.berlios.de> Author: korli Date: 2008-03-05 22:05:13 +0100 (Wed, 05 Mar 2008) New Revision: 24245 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24245&view=rev Modified: haiku/trunk/src/system/kernel/main.c Log: added traces Modified: haiku/trunk/src/system/kernel/main.c =================================================================== --- haiku/trunk/src/system/kernel/main.c 2008-03-05 20:06:18 UTC (rev 24244) +++ haiku/trunk/src/system/kernel/main.c 2008-03-05 21:05:13 UTC (rev 24245) @@ -264,8 +264,14 @@ // CPU specific modules may now be available cpu_init_post_modules(&sKernelArgs); + + TRACE("vm_init_post_modules\n"); vm_init_post_modules(&sKernelArgs); + + TRACE("debug_init_post_modules\n"); debug_init_post_modules(&sKernelArgs); + + TRACE("device_manager_init_post_modules\n"); device_manager_init_post_modules(&sKernelArgs); // start the init process From stippi at mail.berlios.de Wed Mar 5 22:21:59 2008 From: stippi at mail.berlios.de (stippi at BerliOS) Date: Wed, 5 Mar 2008 22:21:59 +0100 Subject: [Haiku-commits] r24246 - in haiku/trunk: data/artwork/icons src/preferences/mail Message-ID: <200803052121.m25LLxTC008884@sheep.berlios.de> Author: stippi Date: 2008-03-05 22:21:58 +0100 (Wed, 05 Mar 2008) New Revision: 24246 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24246&view=rev Added: haiku/trunk/data/artwork/icons/Prefs_Mail Modified: haiku/trunk/src/preferences/mail/ConfigWindow.cpp haiku/trunk/src/preferences/mail/e-mail.rdef Log: * Created an icon for the Mail preflet, based on the Mail app icon. * Added vector icon loading for the interface (Haiku build). Added: haiku/trunk/data/artwork/icons/Prefs_Mail =================================================================== (Binary files differ) Property changes on: haiku/trunk/data/artwork/icons/Prefs_Mail ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: haiku/trunk/src/preferences/mail/ConfigWindow.cpp =================================================================== --- haiku/trunk/src/preferences/mail/ConfigWindow.cpp 2008-03-05 21:05:13 UTC (rev 24245) +++ haiku/trunk/src/preferences/mail/ConfigWindow.cpp 2008-03-05 21:21:58 UTC (rev 24246) @@ -1,6 +1,6 @@ /* + * Copyright 2007-2008, Haiku Inc. All Rights Reserved. * Copyright 2001-2003 Dr. Zoidberg Enterprises. All rights reserved. - * Copyright 2007, Haiku Inc. All Rights Reserved. * * Distributed under the terms of the MIT License. */ @@ -32,19 +32,22 @@ #include #include +#include #include #include #include #include -#include #include +#include #include #include #include +using std::nothrow; + // define if you want to have an apply button //#define HAVE_APPLY_BUTTON @@ -53,7 +56,7 @@ const char *kBugsitePretty = "Bug-Tracker at SourceForge.net"; const char *kBugsite = "http://sourceforge.net/tracker/?func=add&group_id=26926&atid=388726"; const char *kWebsite = "http://www.haiku-os.org"; -const rgb_color kLinkColor = {40,40,180}; +const rgb_color kLinkColor = { 40, 40, 180, 255 }; const uint32 kMsgAccountSelected = 'acsl'; @@ -88,11 +91,13 @@ class BitmapView : public BView { public: - BitmapView(BBitmap *bitmap) : BView(bitmap->Bounds(),NULL,B_FOLLOW_NONE,B_WILL_DRAW) + BitmapView(BBitmap *bitmap) : BView(bitmap->Bounds(), NULL, + B_FOLLOW_NONE, B_WILL_DRAW) { fBitmap = bitmap; SetDrawingMode(B_OP_ALPHA); + SetBlendingMode(B_PIXEL_ALPHA, B_ALPHA_OVERLAY); } ~BitmapView() @@ -104,12 +109,13 @@ { SetViewColor(Parent()->ViewColor()); - MoveTo((Parent()->Bounds().Width() - Bounds().Width()) / 2,Frame().top); + MoveTo((Parent()->Bounds().Width() - Bounds().Width()) / 2, + Frame().top); } virtual void Draw(BRect updateRect) { - DrawBitmap(fBitmap,updateRect,updateRect); + DrawBitmap(fBitmap, updateRect, updateRect); } private: @@ -120,24 +126,22 @@ class AboutTextView : public BTextView { public: - AboutTextView(BRect rect) : BTextView(rect,NULL,rect.OffsetToCopy(B_ORIGIN),B_FOLLOW_NONE,B_WILL_DRAW) + AboutTextView(BRect rect) : BTextView(rect, NULL, + rect.OffsetToCopy(B_ORIGIN), B_FOLLOW_NONE, B_WILL_DRAW) { int32 major = 0,middle = 0,minor = 0,variety = 0,internal = 1; // get version information for app app_info appInfo; - if (be_app->GetAppInfo(&appInfo) == B_OK) - { - BFile file(&appInfo.ref,B_READ_ONLY); - if (file.InitCheck() == B_OK) - { + if (be_app->GetAppInfo(&appInfo) == B_OK) { + BFile file(&appInfo.ref, B_READ_ONLY); + if (file.InitCheck() == B_OK) { BAppFileInfo info(&file); - if (info.InitCheck() == B_OK) - { + if (info.InitCheck() == B_OK) { version_info versionInfo; - if (info.GetVersionInfo(&versionInfo,B_APP_VERSION_KIND) == B_OK) - { + if (info.GetVersionInfo(&versionInfo, + B_APP_VERSION_KIND) == B_OK) { major = versionInfo.major; middle = versionInfo.middle; minor = versionInfo.minor; @@ -440,12 +444,13 @@ void ConfigWindow::MakeHowToView() { +#ifndef HAIKU_TARGET_PLATFORM_HAIKU BResources *resources = BApplication::AppResources(); if (resources) { size_t length; char *buffer = (char *)resources->FindResource(B_LARGE_ICON_TYPE, 101, &length); if (buffer) { - BBitmap *bitmap = new BBitmap(BRect(0, 0, 63, 63), B_CMAP8); + BBitmap *bitmap = new (nothrow) BBitmap(BRect(0, 0, 63, 63), B_CMAP8); if (bitmap && bitmap->InitCheck() == B_OK) { // copy and enlarge a 32x32 8-bit bitmap char *bits = (char *)bitmap->Bits(); @@ -461,6 +466,20 @@ delete bitmap; } } +#else + app_info info; + if (be_app->GetAppInfo(&info) == B_OK) { + BFile appFile(&info.ref, B_READ_ONLY); + BAppFileInfo appFileInfo(&appFile); + if (appFileInfo.InitCheck() == B_OK) { + BBitmap *bitmap = new (nothrow) BBitmap(BRect(0, 0, 63, 63), B_RGBA32); + if (appFileInfo.GetIcon(bitmap, B_LARGE_ICON) == B_OK) { + fConfigView->AddChild(new BitmapView(bitmap)); + } else + delete bitmap; + } + } +#endif // HAIKU_TARGET_PLATFORM_HAIKU BRect rect = fConfigView->Bounds(); BTextView *text = new BTextView(rect, NULL, rect, B_FOLLOW_NONE, B_WILL_DRAW); Modified: haiku/trunk/src/preferences/mail/e-mail.rdef =================================================================== --- haiku/trunk/src/preferences/mail/e-mail.rdef 2008-03-05 21:05:13 UTC (rev 24245) +++ haiku/trunk/src/preferences/mail/e-mail.rdef 2008-03-05 21:21:58 UTC (rev 24246) @@ -15,9 +15,57 @@ internal = 3, short_info = "E-mail", - long_info = "E-mail ?2005-2006 Haiku" + long_info = "E-mail ?2005-2008 Haiku" }; +#ifdef HAIKU_TARGET_PLATFORM_HAIKU + +resource vector_icon { + $"6E63696619050004006A020006063C55F93D5C9ABF48EE3E484E4B6A43C35976" + $"495F849385EAF7FFA2A5B7C2C2A0BCCCDC748994FF829AB2020006033B9EE13B" + $"9EE1BB9EE13B9EE14A10E147F9EB00ACD3DB9FFFFFFFFF6492A8020006023A2A" + $"16B8F45D3AE2F43C1D5446BCF5477C2100F7FBFDFF31596B02000603BA68BD3A" + $"CB11BCBEBBBC5E184A35D549E60100343D412F364145FF566F7A020006023B4E" + $"07BA96743B15213BEFCE499B3D4A176700435563FF2D404802000602B275353A" + $"6F4ABC7EBAB484CB49DE564A6F2E00BED1DBFF8DADBA020006033C0E4E3CF575" + $"BF48EE3E484E4BCE1841BF59495F849385EAF7FFC4A0BCCC020006023A11DA3A" + $"5196BACC2E3A7F4848C35C4A23C100FFEEC0FFE7D6A80200060238DDE0B86563" + $"3B86F63C1C2A48AFCD493E7A00B4A06BFFA28B4E03826A310357697C03F20606" + $"020006022F146D3B80D3BC7FF03032974B85E5482BA200FFC7BAFFC31A1A0200" + $"06022F146D3B80D3BC7FF03032974B85E5482BA201E3E3E3FF59697A02000602" + $"2F146D3B80D3BC7FF03032974B75E5484BA200D6D9DCFF78899903FAA28E0200" + $"16023C9F493AEA2DBAABFF3C6759485B5A4A38E400FFFFDA0300337F02000603" + $"2E9D8036396AB97D97320D5448FDF84B9FEA00FFEECEE3F4A91AFFD78F05059E" + $"020006022E56F335D63CB97D683220C948CD3E4BB3CA00FFE2CEFFA67C620200" + $"1602320FFC35FEF8B8E7A334FFA04A967B4B950500F5FF94020006022E56F335" + $"D63CB97D683220C948ED3E4BB3CA00FFDBD5FFFCA98F190610AAAC2FFE465631" + $"5C2B5E31604A4D5E4D604D5C4A5CC2FC564C56C41E564E5653535155C788C71B" + $"C9764E5B5F48CB8147CB8147CC4D4460406043603D5C3B5E3C5C3B0204464745" + $"3BC291BE263C2DC189B9DE382B2F2D342B342D392F362DBFCBBADC0608FEAF5A" + $"405A345A345A2B4E23572649213F2545223F252E2D2E2DB7AFB8FEB6FDBC282A" + $"BA75B6FDBC282A49C1BCC81F0607FE1A5A405A345A345A2B4E23572649213F25" + $"45223F252E2D44455608022C3AC131C13E0404FE44564446444F443D382FC066" + $"BAE5BAE0B8222D2F302D2D2F0606EF03382F382FB89AB6FEB6FDBD5A2A30B6FD" + $"BD5A2A492B3A2B3A2B30382F2E2A382FBC910605EF03382F382FB89AB6FEB763" + $"BD5A2B30B763BD5A2B49C0BBBDBDC0BBBDBDC000BB9BBC912FBE9DBA00BC912F" + $"0605FE022C4A444D3B49444D44454445C156C041C0BBBDBDC122BEEAC0BBBDBD" + $"2A490A0844C7EB44442C3A2C4ABE31C68A3F4A434CBFEFC74D0A04BE31C68A3F" + $"4A434CBFEFC74D0A054EBA2B4E285623562C50310A044CB9BA4C274E284EBA20" + $"0A044C274E28562354220A044E404EBA2B4F324F3F0A044E404C3F4CB9C54EBA" + $"390A084C274C3F4E404F3F4F32562C562354220606B60E304246384CBB53C34B" + $"BDB7C5AF3C52404C3C48BF65C3B6BC53C1CB0A0E314534463549384A384B3B4B" + $"3B4D3E4C3C4B3B4939493847364734450606CA022B5A3058484A5A4A584A5C48" + $"5C300A0430584658465C305C0A032B5AB82DC9CAB838CA710A04B82DC9CA3058" + $"305CB838CA710A0446584858485C465C06032E48584A5A4A584A5C485C190A01" + $"0100000A000202131001178402040A020103000A030101000A00010510011784" + $"00040A040106000A050107000A060108000A070109000A0C010A000A08010410" + $"01178200040A0001101001178400040A0D010B000A0E010C000A11010D000A0F" + $"010E000A10010F000A0001111001178400040A120111000A1301120815FF0A14" + $"0114000A150115000A160116000A170117000A18011800" +}; + +#else // HAIKU_TARGET_PLATFORM_HAIKU + resource large_icon { $"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" $"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" @@ -72,4 +120,7 @@ $"FFFF00000F0F0F0F0FFFFFFFFFFFFFFF" }; +#endif // HAIKU_TARGET_PLATFORM_HAIKU + + resource(1, "BEOS:FILE_TYPES") message; From stippi at mail.berlios.de Wed Mar 5 23:25:33 2008 From: stippi at mail.berlios.de (stippi at BerliOS) Date: Wed, 5 Mar 2008 23:25:33 +0100 Subject: [Haiku-commits] r24247 - in haiku/trunk: build/jam data/settings data/system/boot Message-ID: <200803052225.m25MPXCp014676@sheep.berlios.de> Author: stippi Date: 2008-03-05 23:25:33 +0100 (Wed, 05 Mar 2008) New Revision: 24247 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24247&view=rev Added: haiku/trunk/data/settings/fresh_install Modified: haiku/trunk/build/jam/HaikuImage haiku/trunk/data/system/boot/Bootscript Log: * The HaikuImage script will put a file "fresh_install" into /boot/home/config/settings. * The Bootscript will check for the existance of this file and updates the mime database with all the applications and preflets that come with the install. Then it removes the indicator file. This fixes the problem that all the apps are not known to the system until you run them once. Ie "Open With..." and such stuff works out of the box. Feel free to find a more elegant way, I just found this simple and effective. :-) Modified: haiku/trunk/build/jam/HaikuImage =================================================================== --- haiku/trunk/build/jam/HaikuImage 2008-03-05 21:21:58 UTC (rev 24246) +++ haiku/trunk/build/jam/HaikuImage 2008-03-05 22:25:33 UTC (rev 24247) @@ -363,6 +363,10 @@ SEARCH on $(bisonFiles) = [ FDirName $(HAIKU_TOP) src bin bison data ] ; AddFilesToHaikuImage beos etc : $(bisonFiles) ; +# fresh install indicator file +SEARCH on fresh_install = [ FDirName $(HAIKU_TOP) data settings ] ; +AddFilesToHaikuImage home config settings : fresh_install ; + # boot loader AddFilesToHaikuImage beos system : zbeos ; Added: haiku/trunk/data/settings/fresh_install =================================================================== --- haiku/trunk/data/settings/fresh_install 2008-03-05 21:21:58 UTC (rev 24246) +++ haiku/trunk/data/settings/fresh_install 2008-03-05 22:25:33 UTC (rev 24247) @@ -0,0 +1 @@ +This file is only supposed to exist on fresh Haiku installations. Modified: haiku/trunk/data/system/boot/Bootscript =================================================================== --- haiku/trunk/data/system/boot/Bootscript 2008-03-05 21:21:58 UTC (rev 24246) +++ haiku/trunk/data/system/boot/Bootscript 2008-03-05 22:25:33 UTC (rev 24247) @@ -121,3 +121,15 @@ . $HOME/config/boot/UserBootscript fi fi + +# Check for fresh install and register all bundled app mimetypes +FRESH_INSTALL_INDICATOR_FILE=$HOME/config/settings/fresh_install +if [ -e $FRESH_INSTALL_INDICATOR_FILE ]; then + mimeset -all -f /boot/beos/apps + mimeset -all -f /boot/beos/preferences + mimeset -all -f /boot/beos/system/servers + mimeset -all -f /boot/apps + rm $FRESH_INSTALL_INDICATOR_FILE +fi + + From mmu_man at mail.berlios.de Wed Mar 5 23:39:36 2008 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Wed, 5 Mar 2008 23:39:36 +0100 Subject: [Haiku-commits] r24248 - haiku/trunk/src/kits/bluetooth Message-ID: <200803052239.m25Mda14016441@sheep.berlios.de> Author: mmu_man Date: 2008-03-05 23:39:35 +0100 (Wed, 05 Mar 2008) New Revision: 24248 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24248&view=rev Modified: haiku/trunk/src/kits/bluetooth/Jamfile Log: This gets libbluetooth.so building at least on zeta. Modified: haiku/trunk/src/kits/bluetooth/Jamfile =================================================================== --- haiku/trunk/src/kits/bluetooth/Jamfile 2008-03-05 22:25:33 UTC (rev 24247) +++ haiku/trunk/src/kits/bluetooth/Jamfile 2008-03-05 22:39:35 UTC (rev 24248) @@ -1,5 +1,11 @@ SubDir HAIKU_TOP src kits bluetooth ; +SetSubDirSupportedPlatformsBeOSCompatible ; + +if ! $(TARGET_PLATFORM_HAIKU_COMPATIBLE) { + UseHeaders [ FDirName $(HAIKU_TOP) headers os ] : true ; +} + UsePrivateHeaders bluetooth ; SharedLibrary libbluetooth.so : From mmu_man at mail.berlios.de Wed Mar 5 23:55:16 2008 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Wed, 5 Mar 2008 23:55:16 +0100 Subject: [Haiku-commits] r24249 - haiku/trunk/src/add-ons/kernel/drivers/bluetooth/h2/h2generic Message-ID: <200803052255.m25MtGLq018834@sheep.berlios.de> Author: mmu_man Date: 2008-03-05 23:55:15 +0100 (Wed, 05 Mar 2008) New Revision: 24249 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24249&view=rev Modified: haiku/trunk/src/add-ons/kernel/drivers/bluetooth/h2/h2generic/Jamfile Log: This gets h2generic building on dano, not sure it'd work though as it's messing with haiku and be headers and I'm not sure how it ends up. Why not just #include instead of using prefixes ?? :p Modified: haiku/trunk/src/add-ons/kernel/drivers/bluetooth/h2/h2generic/Jamfile =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/bluetooth/h2/h2generic/Jamfile 2008-03-05 22:39:35 UTC (rev 24248) +++ haiku/trunk/src/add-ons/kernel/drivers/bluetooth/h2/h2generic/Jamfile 2008-03-05 22:55:15 UTC (rev 24249) @@ -7,6 +7,13 @@ local r5_src = ; if ! $(TARGET_PLATFORM_HAIKU_COMPATIBLE) { UseHeaders [ FDirName $(HAIKU_TOP) headers os bluetooth ] : true ; + # HACKs HACKs HACKs... + # for ... + UseHeaders [ FDirName $(HAIKU_TOP) headers os ] : true ; + # for hmmm... + UseHeaders [ FDirName $(HAIKU_TOP) headers private ] : true ; + # for USB_spec.h from Haiku + UseHeaders [ FDirName $(HAIKU_TOP) headers os drivers ] : true ; r5_src = list.c ; } From oruizdorantes at mail.berlios.de Thu Mar 6 00:24:27 2008 From: oruizdorantes at mail.berlios.de (oruizdorantes at BerliOS) Date: Thu, 6 Mar 2008 00:24:27 +0100 Subject: [Haiku-commits] r24250 - haiku/trunk/src/bin Message-ID: <200803052324.m25NORnt020957@sheep.berlios.de> Author: oruizdorantes Date: 2008-03-06 00:24:26 +0100 (Thu, 06 Mar 2008) New Revision: 24250 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24250&view=rev Modified: haiku/trunk/src/bin/bt_dev_info.cpp Log: Update a bit the tool showing name/address Modified: haiku/trunk/src/bin/bt_dev_info.cpp =================================================================== --- haiku/trunk/src/bin/bt_dev_info.cpp 2008-03-05 22:55:15 UTC (rev 24249) +++ haiku/trunk/src/bin/bt_dev_info.cpp 2008-03-05 23:24:26 UTC (rev 24250) @@ -1,29 +1,28 @@ /* - * Copyright 2007 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com + * Copyright 2008 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com * * All rights reserved. Distributed under the terms of the MIT License. * */ - #include #include #include +#include -void -DumpInfo(LocalDevice* device) +static void +DumpInfo(LocalDevice &device) { + printf("[LocalDevice] %s\t%s\n", (device.GetFriendlyName()).String(), + bdaddrUtils::ToString(device.GetBluetoothAddress())); - - } static status_t LocalDeviceError(status_t status) { - // switch (status) {} fprintf(stderr,"No Device/s found"); return status; @@ -33,36 +32,33 @@ int main(int argc, char *argv[]) { - LocalDevice* ld = NULL; + if(argc == 2) { + // device specified + LocalDevice* ld = LocalDevice::GetLocalDevice(atoi(argv[0])); + if (ld == NULL) + return LocalDeviceError(ENODEV); - if(argc == 2) { - // device specified - ld = LocalDevice::GetLocalDevice(atoi(argv[0])); - if (ld == NULL) - return LocalDeviceError(ENODEV); + DumpInfo(*ld); - DumpInfo(ld); + } else if (argc == 1) { + // show all devices + LocalDevice* ld = NULL; - } else if (argc == 1) { - // show all devices - LocalDevice* firstLocalDevice = LocalDevice::GetLocalDevice(); + printf("Listing %ld Bluetooth Local Devices ...\n", LocalDevice::GetLocalDeviceCount()); - if (firstLocalDevice == NULL) - return LocalDeviceError(ENODEV); + for (uint32 index = 0 ; index < LocalDevice::GetLocalDeviceCount() ; index++) { - printf("Listing %ld Bluetooth devices ...\n", LocalDevice::GetLocalDeviceCount()); + ld = LocalDevice::GetLocalDevice(); + if (ld == NULL) + return LocalDeviceError(ENODEV); + DumpInfo(*ld); - ld = firstLocalDevice; - do { - DumpInfo(ld); - ld = LocalDevice::GetLocalDevice(); + } - } while (ld != firstLocalDevice); + return B_OK; - return B_OK; - - } else { - fprintf(stderr,"Usage: bt_dev_info [device]\n"); - return B_ERROR; - } + } else { + fprintf(stderr,"Usage: bt_dev_info [device]\n"); + return B_ERROR; + } } From oruizdorantes at mail.berlios.de Thu Mar 6 00:29:05 2008 From: oruizdorantes at mail.berlios.de (oruizdorantes at BerliOS) Date: Thu, 6 Mar 2008 00:29:05 +0100 Subject: [Haiku-commits] r24251 - in haiku/trunk/headers/os/bluetooth: . HCI Message-ID: <200803052329.m25NT5rU021167@sheep.berlios.de> Author: oruizdorantes Date: 2008-03-06 00:29:04 +0100 (Thu, 06 Mar 2008) New Revision: 24251 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24251&view=rev Modified: haiku/trunk/headers/os/bluetooth/HCI/btHCI_command.h haiku/trunk/headers/os/bluetooth/HCI/btHCI_module.h haiku/trunk/headers/os/bluetooth/HCI/btHCI_transport.h haiku/trunk/headers/os/bluetooth/LocalDevice.h Log: Remove prefixes and adapt the JSR82 api a bit more to the Be style Modified: haiku/trunk/headers/os/bluetooth/HCI/btHCI_command.h =================================================================== --- haiku/trunk/headers/os/bluetooth/HCI/btHCI_command.h 2008-03-05 23:24:26 UTC (rev 24250) +++ haiku/trunk/headers/os/bluetooth/HCI/btHCI_command.h 2008-03-05 23:29:04 UTC (rev 24251) @@ -100,9 +100,9 @@ #define OCF_WRITE_LOCAL_NAME 0x0013 #define OCF_READ_LOCAL_NAME 0x0014 - struct hci_read_local_name { + struct hci_rp_read_local_name { uint8 status; - char local_name[248]; + char local_name[HCI_DEVICE_NAME_SIZE]; } __attribute__ ((packed)); #define OCF_WRITE_CA_TIMEOUT 0x0016 Modified: haiku/trunk/headers/os/bluetooth/HCI/btHCI_module.h =================================================================== --- haiku/trunk/headers/os/bluetooth/HCI/btHCI_module.h 2008-03-05 23:24:26 UTC (rev 24250) +++ haiku/trunk/headers/os/bluetooth/HCI/btHCI_module.h 2008-03-05 23:29:04 UTC (rev 24251) @@ -12,7 +12,7 @@ #include #include -#include +#include /* defines */ #define BT_HCI_MODULE_NAME "bus_managers/hci/v1" Modified: haiku/trunk/headers/os/bluetooth/HCI/btHCI_transport.h =================================================================== --- haiku/trunk/headers/os/bluetooth/HCI/btHCI_transport.h 2008-03-05 23:24:26 UTC (rev 24250) +++ haiku/trunk/headers/os/bluetooth/HCI/btHCI_transport.h 2008-03-05 23:29:04 UTC (rev 24251) @@ -10,7 +10,7 @@ #include -#include +#include #include typedef enum { ANCILLYANT = 1, Modified: haiku/trunk/headers/os/bluetooth/LocalDevice.h =================================================================== --- haiku/trunk/headers/os/bluetooth/LocalDevice.h 2008-03-05 23:24:26 UTC (rev 24250) +++ haiku/trunk/headers/os/bluetooth/LocalDevice.h 2008-03-05 23:29:04 UTC (rev 24251) @@ -37,7 +37,7 @@ BString GetFriendlyName(); DeviceClass GetDeviceClass(); /* Possible throwing */ - bool SetDiscoverable(int mode); + status_t SetDiscoverable(int mode); BString GetProperty(const char* property); void GetProperty(const char* property, uint32* value); From oruizdorantes at mail.berlios.de Thu Mar 6 00:30:36 2008 From: oruizdorantes at mail.berlios.de (oruizdorantes at BerliOS) Date: Thu, 6 Mar 2008 00:30:36 +0100 Subject: [Haiku-commits] r24252 - haiku/trunk/src/kits/bluetooth Message-ID: <200803052330.m25NUax4021677@sheep.berlios.de> Author: oruizdorantes Date: 2008-03-06 00:30:34 +0100 (Thu, 06 Mar 2008) New Revision: 24252 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24252&view=rev Modified: haiku/trunk/src/kits/bluetooth/LocalDevice.cpp Log: Add FriendlyName and SimpleRequest interface implementation Modified: haiku/trunk/src/kits/bluetooth/LocalDevice.cpp =================================================================== --- haiku/trunk/src/kits/bluetooth/LocalDevice.cpp 2008-03-05 23:29:04 UTC (rev 24251) +++ haiku/trunk/src/kits/bluetooth/LocalDevice.cpp 2008-03-05 23:30:34 UTC (rev 24252) @@ -5,6 +5,9 @@ * */ + +#include + #include #include #include @@ -126,45 +129,6 @@ } -BString -LocalDevice::GetFriendlyName() -{ - if (RetrieveBluetoothMessenger() != B_OK) - return NULL; - - BString friendlyname; - BMessage request(BT_MSG_GET_FRIENDLY_NAME); - BMessage reply; - - /* ADD ID */ - request.AddInt32("hci_id", hid); - - if (fMessenger->SendMessage(&request, &reply) == B_OK && - reply.FindString("friendlyname", &friendlyname) == B_OK ){ - - return friendlyname; - } - - return BString("Unknown"); -} - - -DeviceClass -LocalDevice::GetDeviceClass() -{ - - return NULL; -} - - -bool -LocalDevice::SetDiscoverable(int mode) -{ - - return false; -} - - BString LocalDevice::GetProperty(const char* property) { @@ -190,6 +154,35 @@ } +status_t +LocalDevice::SetDiscoverable(int mode) +{ + if (RetrieveBluetoothMessenger() != B_OK) + return B_ERROR; + + + BMessage request(BT_MSG_HANDLE_SIMPLE_REQUEST); + BMessage reply; + int8 bt_status = BT_ERROR; + + /* ADD ID */ + request.AddInt32("hci_id", hid); + + /* Add command */ + + if (fMessenger->SendMessage(&request, &reply) == B_OK) { + if (reply.FindInt8("status", &bt_status ) == B_OK ) { + + + } + + } + + + return B_ERROR; +} + + bdaddr_t LocalDevice::GetBluetoothAddress() { @@ -200,6 +193,7 @@ BMessage request(BT_MSG_GET_ADDRESS); BMessage reply; ssize_t size; + /* ADD ID */ request.AddInt32("hci_id", hid); @@ -221,6 +215,37 @@ } +BString +LocalDevice::GetFriendlyName() +{ + if (RetrieveBluetoothMessenger() != B_OK) + return NULL; + + BString friendlyname; + BMessage request(BT_MSG_GET_FRIENDLY_NAME); + BMessage reply; + + /* ADD ID */ + request.AddInt32("hci_id", hid); + + if (fMessenger->SendMessage(&request, &reply) == B_OK && + reply.FindString("friendlyname", &friendlyname) == B_OK ){ + + return friendlyname; + } + + return BString("Unknown"); +} + + +DeviceClass +LocalDevice::GetDeviceClass() +{ + + return NULL; +} + + /* ServiceRecord LocalDevice::getRecord(Connection notifier) { @@ -232,6 +257,8 @@ } */ + + LocalDevice::LocalDevice(hci_id hid) : hid(hid) { From oruizdorantes at mail.berlios.de Thu Mar 6 00:32:17 2008 From: oruizdorantes at mail.berlios.de (oruizdorantes at BerliOS) Date: Thu, 6 Mar 2008 00:32:17 +0100 Subject: [Haiku-commits] r24253 - haiku/trunk/headers/private/bluetooth Message-ID: <200803052332.m25NWHhi023952@sheep.berlios.de> Author: oruizdorantes Date: 2008-03-06 00:32:16 +0100 (Thu, 06 Mar 2008) New Revision: 24253 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24253&view=rev Modified: haiku/trunk/headers/private/bluetooth/bluetoothserver_p.h Log: ADD kit<->server Messages ids Modified: haiku/trunk/headers/private/bluetooth/bluetoothserver_p.h =================================================================== --- haiku/trunk/headers/private/bluetooth/bluetoothserver_p.h 2008-03-05 23:30:34 UTC (rev 24252) +++ haiku/trunk/headers/private/bluetooth/bluetoothserver_p.h 2008-03-05 23:32:16 UTC (rev 24253) @@ -8,5 +8,8 @@ #define BT_MSG_ADQUIRE_LOCAL_DEVICE 'btAd' #define BT_MSG_GET_FRIENDLY_NAME 'btFn' #define BT_MSG_GET_ADDRESS 'btGa' +#define BT_MSG_HANDLE_SIMPLE_REQUEST 'btsR' +#define BT_MSG_ADD_DEVICE 'btDD' + #endif From oruizdorantes at mail.berlios.de Thu Mar 6 00:34:05 2008 From: oruizdorantes at mail.berlios.de (oruizdorantes at BerliOS) Date: Thu, 6 Mar 2008 00:34:05 +0100 Subject: [Haiku-commits] r24254 - haiku/trunk/src/add-ons/kernel/drivers/bluetooth/h2/h2generic Message-ID: <200803052334.m25NY5aC026357@sheep.berlios.de> Author: oruizdorantes Date: 2008-03-06 00:34:04 +0100 (Thu, 06 Mar 2008) New Revision: 24254 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24254&view=rev Modified: haiku/trunk/src/add-ons/kernel/drivers/bluetooth/h2/h2generic/h2generic.c haiku/trunk/src/add-ons/kernel/drivers/bluetooth/h2/h2generic/h2generic.h Log: Remove prefixed for the net private headers Modified: haiku/trunk/src/add-ons/kernel/drivers/bluetooth/h2/h2generic/h2generic.c =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/bluetooth/h2/h2generic/h2generic.c 2008-03-05 23:32:16 UTC (rev 24253) +++ haiku/trunk/src/add-ons/kernel/drivers/bluetooth/h2/h2generic/h2generic.c 2008-03-05 23:34:04 UTC (rev 24254) @@ -15,7 +15,6 @@ #include #include -#include #include "snet_buffer.h" #include Modified: haiku/trunk/src/add-ons/kernel/drivers/bluetooth/h2/h2generic/h2generic.h =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/bluetooth/h2/h2generic/h2generic.h 2008-03-05 23:32:16 UTC (rev 24253) +++ haiku/trunk/src/add-ons/kernel/drivers/bluetooth/h2/h2generic/h2generic.h 2008-03-05 23:34:04 UTC (rev 24254) @@ -15,7 +15,7 @@ #include #include -#include +#include #include "snet_buffer.h" From anevilyak at mail.berlios.de Thu Mar 6 01:03:02 2008 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Thu, 6 Mar 2008 01:03:02 +0100 Subject: [Haiku-commits] r24255 - haiku/trunk/headers/os/interface Message-ID: <200803060003.m26032tr031099@sheep.berlios.de> Author: anevilyak Date: 2008-03-06 01:03:02 +0100 (Thu, 06 Mar 2008) New Revision: 24255 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24255&view=rev Modified: haiku/trunk/headers/os/interface/Slider.h Log: BSlider had code for doing double buffered drawing, but was disabled by default. Appears to work correctly though, so enabling it since it produces far less flicker here. Modified: haiku/trunk/headers/os/interface/Slider.h =================================================================== --- haiku/trunk/headers/os/interface/Slider.h 2008-03-05 23:34:04 UTC (rev 24254) +++ haiku/trunk/headers/os/interface/Slider.h 2008-03-06 00:03:02 UTC (rev 24255) @@ -28,7 +28,7 @@ }; -#define USE_OFF_SCREEN_VIEW 0 +#define USE_OFF_SCREEN_VIEW 1 class BSlider : public BControl { From kirilla at mail.berlios.de Thu Mar 6 01:05:10 2008 From: kirilla at mail.berlios.de (kirilla at BerliOS) Date: Thu, 6 Mar 2008 01:05:10 +0100 Subject: [Haiku-commits] r24256 - haiku/trunk/src/apps/aboutsystem Message-ID: <200803060005.m2605AHm001286@sheep.berlios.de> Author: kirilla Date: 2008-03-06 01:05:09 +0100 (Thu, 06 Mar 2008) New Revision: 24256 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24256&view=rev Modified: haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp Log: Make text view not selectable. This fixes a problem where text is inserted not at the end of the text view but on the current page. This happens if you click the text view soon after having opened AboutSystem, to try to scroll or whatever, while it's still processing query results and calling AddCopyrightEntry() for each found application. It may not show on fast systems with few applications. Modified: haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp =================================================================== --- haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp 2008-03-06 00:03:02 UTC (rev 24255) +++ haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp 2008-03-06 00:05:09 UTC (rev 24256) @@ -321,6 +321,7 @@ fCreditsView->SetFlags(fCreditsView->Flags() | B_FRAME_EVENTS ); fCreditsView->SetStylable(true); fCreditsView->MakeEditable(false); + fCreditsView->MakeSelectable(false); fCreditsView->SetWordWrap(true); BScrollView *creditsScroller = new BScrollView("creditsScroller", From mmu_man at mail.berlios.de Thu Mar 6 01:22:54 2008 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Thu, 6 Mar 2008 01:22:54 +0100 Subject: [Haiku-commits] r24257 - haiku/trunk/src/apps/aboutsystem Message-ID: <200803060022.m260MshQ020988@sheep.berlios.de> Author: mmu_man Date: 2008-03-06 01:22:53 +0100 (Thu, 06 Mar 2008) New Revision: 24257 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24257&view=rev Modified: haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp Log: Make the text view selectable when the query is done, so one can select text, like urls to paste to a browser. Modified: haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp =================================================================== --- haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp 2008-03-06 00:05:09 UTC (rev 24256) +++ haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp 2008-03-06 00:22:53 UTC (rev 24257) @@ -690,6 +690,7 @@ BEntry ent; if (fAppsQuery.GetNextEntry(&ent) < B_OK) { fAppsQuery.Clear(); + fCreditsView->MakeSelectable(true); break; } BFile file; From anevilyak at mail.berlios.de Thu Mar 6 01:36:31 2008 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Thu, 6 Mar 2008 01:36:31 +0100 Subject: [Haiku-commits] r24258 - haiku/trunk/headers/private/app Message-ID: <200803060036.m260aVi4015839@sheep.berlios.de> Author: anevilyak Date: 2008-03-06 01:36:31 +0100 (Thu, 06 Mar 2008) New Revision: 24258 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24258&view=rev Modified: haiku/trunk/headers/private/app/DirectMessageTarget.h Log: Made DirectMessageTarget's destructor private to avoid potential future errors. This object should never be deleted directly as it's ref counted, only when its last ref is Release()'d. Modified: haiku/trunk/headers/private/app/DirectMessageTarget.h =================================================================== --- haiku/trunk/headers/private/app/DirectMessageTarget.h 2008-03-06 00:22:53 UTC (rev 24257) +++ haiku/trunk/headers/private/app/DirectMessageTarget.h 2008-03-06 00:36:31 UTC (rev 24258) @@ -17,7 +17,6 @@ class BDirectMessageTarget { public: BDirectMessageTarget(); - ~BDirectMessageTarget(); bool AddMessage(BMessage* message); @@ -28,6 +27,8 @@ BMessageQueue* Queue() { return &fQueue; } private: + ~BDirectMessageTarget(); + int32 fReferenceCount; BMessageQueue fQueue; bool fClosed; From mmu_man at mail.berlios.de Thu Mar 6 02:19:40 2008 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Thu, 6 Mar 2008 02:19:40 +0100 Subject: [Haiku-commits] r24259 - haiku/trunk/src/bin Message-ID: <200803060119.m261JePi021764@sheep.berlios.de> Author: mmu_man Date: 2008-03-06 02:19:35 +0100 (Thu, 06 Mar 2008) New Revision: 24259 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24259&view=rev Modified: haiku/trunk/src/bin/eject.c Log: * fix --help usage * when a path is given that isn't on devfs, use its device instead. Allows doing eject /foo without greppin the output of /bin/df. Modified: haiku/trunk/src/bin/eject.c =================================================================== --- haiku/trunk/src/bin/eject.c 2008-03-06 00:36:31 UTC (rev 24258) +++ haiku/trunk/src/bin/eject.c 2008-03-06 01:19:35 UTC (rev 24259) @@ -19,7 +19,9 @@ #include #include #include +#include + static int usage(char *prog) { printf("usage: eject [-q|-l|-s|-b|-u] /dev/disk/.../raw\n"); @@ -44,17 +46,18 @@ char operation = 'e'; int i; int ret; + for (i = 1; i < argc; i++) { - if (strncmp(argv[i], "-", 1) == 0) { + if (strncmp(argv[i], "--h", 3) == 0) { + return usage("eject"); + } else if (strncmp(argv[i], "-", 1) == 0) { if (strlen(argv[i]) > 1) operation = argv[i][1]; else { usage("eject"); return 1; } - } else if (strncmp(argv[i], "--h", 2) == 0) - return usage("eject"); - else { + } else { device = argv[i]; ret = do_eject(operation, device); if (ret != 0) @@ -72,6 +75,16 @@ bool bval; int fd; status_t devstatus; + fs_info info; + + // if the path is not on devfs, it's probably on + // the mountpoint of the device we want to act on. + // (should rather stat() for blk(char) device though). + if (fs_stat_dev(dev_for_path(device), &info) >= B_OK) { + if (strcmp(info.fsh_name, "devfs")) + device = info.device_name; + } + fd = open(device, O_RDONLY); if (fd < 0) { perror(device); From mmu_man at mail.berlios.de Thu Mar 6 02:20:09 2008 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Thu, 6 Mar 2008 02:20:09 +0100 Subject: [Haiku-commits] r24260 - haiku/trunk/data/system/boot Message-ID: <200803060120.m261K9jZ021861@sheep.berlios.de> Author: mmu_man Date: 2008-03-06 02:20:09 +0100 (Thu, 06 Mar 2008) New Revision: 24260 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=24260&view=rev Added: haiku/trunk/data/system/boot/Bootscript.cd Modified: haiku/trunk/data/system/boot/Bootscript Log: Untested Bootscript.cd Modified: haiku/trunk/data/system/boot/Bootscript =================================================================== --- haiku/trunk/data/system/boot/Bootscript 2008-03-06 01:19:35 UTC (rev 24259) +++ haiku/trunk/data/system/boot/Bootscript 2008-03-06 01:20:09 UTC (rev 24260) @@ -59,6 +59,13 @@ launchscript $SCRIPTS/SetupEnvironment +# If the boot volume is a CD we use another script +iw=`/bin/isvolume -readonly /boot` +if [ "$iw" = "yes" ]; then + launchscript $SCRIPTS/Bootscript.cd + exit 0 # and return +fi + # Sets timezone etc. runprog beos/bin/clockconfig Added: haiku/trunk/data/system/boot/Bootscript.cd =================================================================== --- haiku/trunk/data/system/boot/Bootscript.cd 2008-03-06 01:19:35 UTC (rev 24259) +++ haiku/trunk/data/system/boot/Bootscript.cd 2008-03-06 01:20:09 UTC (rev 24260) @@ -0,0 +1,99 @@ +## The system's main CD boot script. + +## +## Some functions used by the main script +## + +# launch [thread to wait for] + +launch() { + if [ -f "/boot/$1" ] + then + "/boot/$1" & + [ "$2" != "" ] && waitfor "$2" + return 1 + else + echo There is no "$1" + fi + return 0 +} + +# launchscript