From mmlr at mail.berlios.de Sun Feb 1 00:04:10 2009
From: mmlr at mail.berlios.de (mmlr at mail.berlios.de)
Date: Sun, 1 Feb 2009 00:04:10 +0100
Subject: [Haiku-commits] r29106 -
haiku/trunk/src/add-ons/kernel/drivers/input/usb_hid
Message-ID: <200901312304.n0VN4Ano003618@sheep.berlios.de>
Author: mmlr
Date: 2009-02-01 00:04:09 +0100 (Sun, 01 Feb 2009)
New Revision: 29106
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29106&view=rev
Modified:
haiku/trunk/src/add-ons/kernel/drivers/input/usb_hid/KeyboardDevice.cpp
Log:
Don't exit early when encountering an empty slot in the report. There seem to
be keyboards that leave gaps. It's not really specified in the docs, they only
say that the ordering of keys is indetermined. So I guess intermixing empty
slots is equally valid.
Modified: haiku/trunk/src/add-ons/kernel/drivers/input/usb_hid/KeyboardDevice.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/drivers/input/usb_hid/KeyboardDevice.cpp 2009-01-31 22:55:49 UTC (rev 29105)
+++ haiku/trunk/src/add-ons/kernel/drivers/input/usb_hid/KeyboardDevice.cpp 2009-01-31 23:04:09 UTC (rev 29106)
@@ -324,51 +324,51 @@
uint8 *compare = fTransferBuffer;
for (int32 twice = 0; twice < 2; twice++) {
for (size_t i = 2; i < fTotalReportSize; i++) {
- if (current[i] != 0x00 && current[i] != 0x01) {
- bool found = false;
- for (size_t j = 2; j < fTotalReportSize; j++) {
- if (compare[j] == current[i]) {
- found = true;
- break;
- }
+ if (current[i] == 0x00 || current[i] == 0x01)
+ continue;
+
+ bool found = false;
+ for (size_t j = 2; j < fTotalReportSize; j++) {
+ if (compare[j] == current[i]) {
+ found = true;
+ break;
}
+ }
- if (found)
- continue;
+ if (found)
+ continue;
- // a change occured
- uint32 key = 0;
- if (current[i] < sKeyTableSize)
- key = sKeyTable[current[i]];
+ // a change occured
+ uint32 key = 0;
+ if (current[i] < sKeyTableSize)
+ key = sKeyTable[current[i]];
- if (key == KEY_Pause && (current[0] & 1))
- key = KEY_Break;
- else if (key == 0xe && (current[0] & 1))
- key = KEY_SysRq;
+ if (key == KEY_Pause && (current[0] & 1))
+ key = KEY_Break;
+ else if (key == 0xe && (current[0] & 1))
+ key = KEY_SysRq;
#if 0
- else if (keyDown && key == 0x0d) // ToDo: remove again
- panic("keyboard requested halt.\n");
+ else if (keyDown && key == 0x0d) // ToDo: remove again
+ panic("keyboard requested halt.\n");
#endif
- else if (key == 0) {
- // unmapped key
- key = 0x200000 + current[i];
- }
+ else if (key == 0) {
+ // unmapped key
+ key = 0x200000 + current[i];
+ }
- _WriteKey(key, keyDown);
+ _WriteKey(key, keyDown);
- if (keyDown) {
- // repeat handling
- fCurrentRepeatKey = key;
- fCurrentRepeatDelay = fRepeatDelay;
- } else {
- // cancel the repeats if they are for this key
- if (fCurrentRepeatKey == key) {
- fCurrentRepeatDelay = B_INFINITE_TIMEOUT;
- fCurrentRepeatKey = 0;
- }
+ if (keyDown) {
+ // repeat handling
+ fCurrentRepeatKey = key;
+ fCurrentRepeatDelay = fRepeatDelay;
+ } else {
+ // cancel the repeats if they are for this key
+ if (fCurrentRepeatKey == key) {
+ fCurrentRepeatDelay = B_INFINITE_TIMEOUT;
+ fCurrentRepeatKey = 0;
}
- } else
- break;
+ }
}
current = fTransferBuffer;
From ingo_weinhold at gmx.de Sun Feb 1 01:04:04 2009
From: ingo_weinhold at gmx.de (Ingo Weinhold)
Date: Sun, 01 Feb 2009 01:04:04 +0100
Subject: [Haiku-commits] r29007 - haiku/trunk/src/apps/terminal
In-Reply-To: <4984D4A0.20805@googlemail.com>
References: <200901251129.n0PBTeGJ018646@sheep.berlios.de>
<49849C94.8010200@googlemail.com>
<20090131200655.6400.2@bepc.1233406687.fake>
<4984BFA2.9050404@googlemail.com>
<1e80d8750901311437r2592faf6x726c857eb85fbdd2@mail.gmail.com>
<4984D4A0.20805@googlemail.com>
Message-ID: <20090201010404.362.1@knochen-vm.localdomain>
On 2009-01-31 at 23:45:52 [+0100], Humdinger
wrote:
> Urias McCullough wrote:
>
> > Semantics i suppose.
>
> Sure.
>
> > It's like saying the address to someone's house ends on a street
> > without specifying the actually house address :)
>
> From another POV it's like saying the path to your house includes your
> house.
>
> > As a user, I expect the filename to be part of the actual path.
>
> Then you'd have to include it in the Get Info panel under "Path:"... :)
> I don't mind terribly, just wanted to point it out...
IMHO, what is shown after the "Path" label is useful. The only issue is
that the label isn't quite correct. It should correctly say something like
"Containing Directory Path", "Directory Path", or just "Directory".
CU, Ingo
From ingo_weinhold at gmx.de Sun Feb 1 01:20:49 2009
From: ingo_weinhold at gmx.de (Ingo Weinhold)
Date: Sun, 01 Feb 2009 01:20:49 +0100
Subject: [Haiku-commits] r29101 - haiku/trunk/src/servers/app
In-Reply-To: <200901312011.n0VKBZA8018548@sheep.berlios.de>
References: <200901312011.n0VKBZA8018548@sheep.berlios.de>
Message-ID: <20090201012049.688.2@knochen-vm.localdomain>
On 2009-01-31 at 21:11:35 [+0100], stippi at BerliOS
wrote:
> Author: stippi
> Date: 2009-01-31 21:11:34 +0100 (Sat, 31 Jan 2009)
> New Revision: 29101
> ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29101&view=rev
>
> Modified:
> haiku/trunk/src/servers/app/Window.cpp
> Log:
> Exclude any dirty regions from scrolling or copybitting. The previous
> behavior,
> which was also the BeOS behavior IIRC, has annoyed me a bit as an
> application
> developer. It wasn't possible to avoid display artifacts, if for example
> scrolling a view which needed to be redrawn at the same time. It sounds
> strange, but makes perfect sense for the situation I have here.
Great! I noticed this annoying behavior when working on the Terminal. The
cursor artifacts that could be seen flashing up when scrolling heavily seem
to be gone now.
CU, Ingo
From anevilyak at mail.berlios.de Sun Feb 1 02:52:59 2009
From: anevilyak at mail.berlios.de (anevilyak at BerliOS)
Date: Sun, 1 Feb 2009 02:52:59 +0100
Subject: [Haiku-commits] r29107 - haiku/trunk/build/jam
Message-ID: <200902010152.n111qx4R017712@sheep.berlios.de>
Author: anevilyak
Date: 2009-02-01 02:52:59 +0100 (Sun, 01 Feb 2009)
New Revision: 29107
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29107&view=rev
Modified:
haiku/trunk/build/jam/OptionalPackages
Log:
(Long overdue) update of the gcc4 Vision package to bring it to version/feature parity with the gcc2 revision.
Modified: haiku/trunk/build/jam/OptionalPackages
===================================================================
--- haiku/trunk/build/jam/OptionalPackages 2009-01-31 23:04:09 UTC (rev 29106)
+++ haiku/trunk/build/jam/OptionalPackages 2009-02-01 01:52:59 UTC (rev 29107)
@@ -466,8 +466,8 @@
if $(TARGET_ARCH) != x86 {
Echo "No optional package Vision available for $(TARGET_ARCH)" ;
} else if $(HAIKU_GCC_VERSION[1]) >= 4 {
- InstallOptionalHaikuImagePackage Vision-0.9.7-H-21072008-gcc4
- : http://vision.sf.net/Vision-0.9.7-H-21072008-gcc4.zip
+ InstallOptionalHaikuImagePackage Vision-0.9.7-H-25012009-gcc4
+ : http://vision.sf.net/Vision-0.9.7-H-25012009-gcc4.zip
: apps
;
AddSymlinkToHaikuImage home config be Applications
From humdingerb at googlemail.com Sun Feb 1 08:13:54 2009
From: humdingerb at googlemail.com (Humdinger)
Date: Sun, 01 Feb 2009 08:13:54 +0100
Subject: [Haiku-commits] r29007 - haiku/trunk/src/apps/terminal
In-Reply-To: <20090201010404.362.1@knochen-vm.localdomain>
References: <200901251129.n0PBTeGJ018646@sheep.berlios.de> <49849C94.8010200@googlemail.com> <20090131200655.6400.2@bepc.1233406687.fake> <4984BFA2.9050404@googlemail.com> <1e80d8750901311437r2592faf6x726c857eb85fbdd2@mail.gmail.com> <4984D4A0.20805@googlemail.com>
<20090201010404.362.1@knochen-vm.localdomain>
Message-ID: <49854BB2.500@googlemail.com>
Ingo Weinhold wrote:
> IMHO, what is shown after the "Path" label is useful. The only issue is
> that the label isn't quite correct. It should correctly say something like
> "Containing Directory Path", "Directory Path", or just "Directory".
Not intending to refurbish another of our bikesheds here... :)
It odes make sense to define these things and to be consistent in the system. Also, it
should preferably be short, best one word. As we've seen, "path" can be interpreted both
ways, with and without the filename. So it's a matter of definition and the just sticking
to it.
My suggestion would be:
path with filename == "Path" ["The path of the file is ~/home/.profile"]
path w/ filename == "Location" ["The file is located in ~/home"]
In that case, the "Get Info" panel would be changed and the Terminal context menu is
correct. Which is the opposite of what I suggested in the beginning, but as I said, it's
just a matter of definition.
Regards,
Humdinger
--
--=-=--=-=--=-=--=-=--=-=--=-=--=-=--=-=--=-=--=-
Deutsche Haiku News @ http://www.haiku-gazette.de
From superstippi at gmx.de Sun Feb 1 11:51:41 2009
From: superstippi at gmx.de (Stephan Assmus)
Date: Sun, 01 Feb 2009 11:51:41 +0100
Subject: [Haiku-commits] r29101 - haiku/trunk/src/servers/app
In-Reply-To: <20090201012049.688.2@knochen-vm.localdomain>
References: <200901312011.n0VKBZA8018548@sheep.berlios.de>
<20090201012049.688.2@knochen-vm.localdomain>
Message-ID: <20090201115141.322.1@bepc.1233485126.fake>
Ingo Weinhold wrote:
>
> On 2009-01-31 at 21:11:35 [+0100], stippi at BerliOS
> wrote:
> > Author: stippi
> > Date: 2009-01-31 21:11:34 +0100 (Sat, 31 Jan 2009) New Revision: 29101
> > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29101&view=rev
> >
> > Modified:
> > haiku/trunk/src/servers/app/Window.cpp
> > Log:
> > Exclude any dirty regions from scrolling or copybitting. The previous
> > behavior,
> > which was also the BeOS behavior IIRC, has annoyed me a bit as an
> > application
> > developer. It wasn't possible to avoid display artifacts, if for
> > example scrolling a view which needed to be redrawn at the same time.
> > It sounds strange, but makes perfect sense for the situation I have
> > here.
>
> Great! I noticed this annoying behavior when working on the Terminal. The
> cursor artifacts that could be seen flashing up when scrolling heavily
> seem to be gone now.
Ah, so there are other annoying situations! :-) Plus I have not seen the
Tracker artifact when opening folders with files that are popuplated "out
of order", ie with a lot of CopyBits() action. That bug may have been
caused by a corner case where some dirty region was already inside an
update session perhaps, and would have had to be shifted alongside... but
who cares... :-)
Best regards,
-Stephan
From superstippi at gmx.de Sun Feb 1 11:57:24 2009
From: superstippi at gmx.de (Stephan Assmus)
Date: Sun, 01 Feb 2009 11:57:24 +0100
Subject: [Haiku-commits] r29007 - haiku/trunk/src/apps/terminal
In-Reply-To: <49854BB2.500@googlemail.com>
References: <200901251129.n0PBTeGJ018646@sheep.berlios.de>
<49849C94.8010200@googlemail.com>
<20090131200655.6400.2@bepc.1233406687.fake>
<4984BFA2.9050404@googlemail.com>
<1e80d8750901311437r2592faf6x726c857eb85fbdd2@mail.gmail.com>
<4984D4A0.20805@googlemail.com>
<20090201010404.362.1@knochen-vm.localdomain>
<49854BB2.500@googlemail.com>
Message-ID: <20090201115724.350.2@bepc.1233485126.fake>
Humdinger wrote:
> Ingo Weinhold wrote:
> > IMHO, what is shown after the "Path" label is useful. The only issue is
> > that the label isn't quite correct. It should correctly say something
> > like "Containing Directory Path", "Directory Path", or just "Directory".
>
> Not intending to refurbish another of our bikesheds here... :)
>
> It odes make sense to define these things and to be consistent in the
> system. Also, it should preferably be short, best one word. As we've
> seen, "path" can be interpreted both ways, with and without the filename.
> So it's a matter of definition and the just sticking to it.
>
> My suggestion would be:
> path with filename == "Path" ["The path of the file is ~/home/.profile"]
> path w/ filename == "Location" ["The file is located in ~/home"]
>
> In that case, the "Get Info" panel would be changed and the Terminal
> context menu is correct. Which is the opposite of what I suggested in the
> beginning, but as I said, it's just a matter of definition.
Location is quite good, although strictly speaking, it's kind of synonymous
to Path. What may work too is naming the Get Info label "Folder". Tracker
deals with Folders. It's also "New Folder". When you click on it, it opens
the Folder window. Problem is when showing Get Info for folders themselves.
And thus, I'd vote for Location. :-)
Best regards,
-Stephan
From alex at zappotek.com Sun Feb 1 13:51:50 2009
From: alex at zappotek.com (Alexandre Deckner)
Date: Sun, 01 Feb 2009 13:51:50 +0100
Subject: [Haiku-commits] r29101 - haiku/trunk/src/servers/app
In-Reply-To: <20090201115141.322.1@bepc.1233485126.fake>
References: <200901312011.n0VKBZA8018548@sheep.berlios.de> <20090201012049.688.2@knochen-vm.localdomain>
<20090201115141.322.1@bepc.1233485126.fake>
Message-ID: <49859AE6.6010502@zappotek.com>
Stephan Assmus wrote:
> Ah, so there are other annoying situations! :-) Plus I have not seen the
> Tracker artifact when opening folders with files that are popuplated "out
> of order", ie with a lot of CopyBits() action. That bug may have been
> caused by a corner case where some dirty region was already inside an
> update session perhaps, and would have had to be shifted alongside... but
> who cares... :-)
While you're at it, could you have an eye on #1849 and #2975?
I quickly rechecked #1849 but it doesn't seem to be fixed.
Best regards,
Alex
From alex at zappotek.com Sun Feb 1 13:55:22 2009
From: alex at zappotek.com (Alexandre Deckner)
Date: Sun, 01 Feb 2009 13:55:22 +0100
Subject: [Haiku-commits] r29101 - haiku/trunk/src/servers/app
In-Reply-To: <49859AE6.6010502@zappotek.com>
References: <200901312011.n0VKBZA8018548@sheep.berlios.de> <20090201012049.688.2@knochen-vm.localdomain> <20090201115141.322.1@bepc.1233485126.fake>
<49859AE6.6010502@zappotek.com>
Message-ID: <49859BBA.40208@zappotek.com>
Alexandre Deckner wrote:
> While you're at it, could you have an eye on #1849 and #2975?
> I quickly rechecked #1849 but it doesn't seem to be fixed.
>
>
>
Note #3037 too.
From stippi at mail.berlios.de Sun Feb 1 14:58:41 2009
From: stippi at mail.berlios.de (stippi at BerliOS)
Date: Sun, 1 Feb 2009 14:58:41 +0100
Subject: [Haiku-commits] r29108 -
haiku/trunk/src/add-ons/kernel/drivers/disk/scsi/scsi_cd
Message-ID: <200902011358.n11Dwflp031137@sheep.berlios.de>
Author: stippi
Date: 2009-02-01 14:58:40 +0100 (Sun, 01 Feb 2009)
New Revision: 29108
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29108&view=rev
Modified:
haiku/trunk/src/add-ons/kernel/drivers/disk/scsi/scsi_cd/scsi_cd.cpp
Log:
Specify direction flag in all calls of simple_exec(). Thanks, Marcus!
Modified: haiku/trunk/src/add-ons/kernel/drivers/disk/scsi/scsi_cd/scsi_cd.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/drivers/disk/scsi/scsi_cd/scsi_cd.cpp 2009-02-01 01:52:59 UTC (rev 29107)
+++ haiku/trunk/src/add-ons/kernel/drivers/disk/scsi/scsi_cd/scsi_cd.cpp 2009-02-01 13:58:40 UTC (rev 29108)
@@ -349,7 +349,7 @@
cmd.end_frame = position->end_f;
return sSCSIPeripheral->simple_exec(info->scsi_periph_device,
- &cmd, sizeof(cmd), NULL, 0, 0);
+ &cmd, sizeof(cmd), NULL, 0, SCSI_DIR_NONE);
}
@@ -414,7 +414,7 @@
cmd.opcode = SCSI_OP_STOP_PLAY;
return sSCSIPeripheral->simple_exec(info->scsi_periph_device,
- &cmd, sizeof(cmd), NULL, 0, 0);
+ &cmd, sizeof(cmd), NULL, 0, SCSI_DIR_NONE);
}
@@ -430,7 +430,7 @@
cmd.resume = resume;
return sSCSIPeripheral->simple_exec(info->scsi_periph_device,
- &cmd, sizeof(cmd), NULL, 0, 0);
+ &cmd, sizeof(cmd), NULL, 0, SCSI_DIR_NONE);
}
@@ -479,7 +479,7 @@
*/
return sSCSIPeripheral->simple_exec(info->scsi_periph_device,
- &cmd, sizeof(cmd), NULL, 0, 0);
+ &cmd, sizeof(cmd), NULL, 0, SCSI_DIR_NONE);
}
From humdingerb at googlemail.com Sun Feb 1 15:52:33 2009
From: humdingerb at googlemail.com (Humdinger)
Date: Sun, 01 Feb 2009 15:52:33 +0100
Subject: [Haiku-commits] r29007 - haiku/trunk/src/apps/terminal
In-Reply-To: <20090201115724.350.2@bepc.1233485126.fake>
References: <200901251129.n0PBTeGJ018646@sheep.berlios.de> <49849C94.8010200@googlemail.com> <20090131200655.6400.2@bepc.1233406687.fake> <4984BFA2.9050404@googlemail.com> <1e80d8750901311437r2592faf6x726c857eb85fbdd2@mail.gmail.com> <4984D4A0.20805@googlemail.com> <20090201010404.362.1@knochen-vm.localdomain> <49854BB2.500@googlemail.com>
<20090201115724.350.2@bepc.1233485126.fake>
Message-ID: <4985B731.50901@googlemail.com>
Stephan Assmus wrote:
> Location is quite good, although strictly speaking, it's kind of synonymous
> to Path. What may work too is naming the Get Info label "Folder". Tracker
> deals with Folders. It's also "New Folder". When you click on it, it opens
> the Folder window. Problem is when showing Get Info for folders themselves.
This is more or less exactly how I thought about that, too. :)
> And thus, I'd vote for Location. :-)
I made a diff of the InfoWindow.cpp that I've attached.
Since this is the first patch that I haven't sent privately to you, is that the correct
way to create a patch: I navigated to haiku/trunk/src/kits/tracker and did a "svn diff >
file.diff".
I know it's a ridiculously simple little diff, but if you feel the patch<->location
distinction has merit, feel free to apply it.
Regards,
Humdinger
--
--=-=--=-=--=-=--=-=--=-=--=-=--=-=--=-=--=-=--=-
Deutsche Haiku News @ http://www.haiku-gazette.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: InfoWindow.diff
Type: text/x-patch
Size: 522 bytes
Desc: not available
URL:
From anevilyak at mail.berlios.de Sun Feb 1 17:25:32 2009
From: anevilyak at mail.berlios.de (anevilyak at BerliOS)
Date: Sun, 1 Feb 2009 17:25:32 +0100
Subject: [Haiku-commits] r29109 - haiku/trunk/src/kits/tracker
Message-ID: <200902011625.n11GPWqu019634@sheep.berlios.de>
Author: anevilyak
Date: 2009-02-01 17:25:30 +0100 (Sun, 01 Feb 2009)
New Revision: 29109
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29109&view=rev
Modified:
haiku/trunk/src/kits/tracker/ContainerWindow.cpp
Log:
Fix Create Link from context menu.
Modified: haiku/trunk/src/kits/tracker/ContainerWindow.cpp
===================================================================
--- haiku/trunk/src/kits/tracker/ContainerWindow.cpp 2009-02-01 13:58:40 UTC (rev 29108)
+++ haiku/trunk/src/kits/tracker/ContainerWindow.cpp 2009-02-01 16:25:30 UTC (rev 29109)
@@ -1453,13 +1453,13 @@
if (model.InitCheck() != B_OK)
break;
- PoseView()->MoveSelectionInto(&model, this, false, true,
- message->what == kCreateRelativeLink);
+ PoseView()->MoveSelectionInto(&model, this, false, false,
+ message->what == kCreateLink, message->what == kCreateRelativeLink);
} else {
// no destination specified, create link in same dir as item
if (!TargetModel()->IsQuery())
- PoseView()->MoveSelectionInto(TargetModel(), this, false, true,
- (message->what == kCreateRelativeLink));
+ PoseView()->MoveSelectionInto(TargetModel(), this, false, false,
+ message->what == kCreateLink, message->what == kCreateRelativeLink);
}
break;
}
From mmlr at mail.berlios.de Sun Feb 1 18:29:45 2009
From: mmlr at mail.berlios.de (mmlr at mail.berlios.de)
Date: Sun, 1 Feb 2009 18:29:45 +0100
Subject: [Haiku-commits] r29110 - haiku/trunk/headers/private/bluetooth
Message-ID: <200902011729.n11HTjuK028469@sheep.berlios.de>
Author: mmlr
Date: 2009-02-01 18:29:42 +0100 (Sun, 01 Feb 2009)
New Revision: 29110
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29110&view=rev
Modified:
haiku/trunk/headers/private/bluetooth/ConnectionIncoming.h
Log:
Fix deprecated include.
Modified: haiku/trunk/headers/private/bluetooth/ConnectionIncoming.h
===================================================================
--- haiku/trunk/headers/private/bluetooth/ConnectionIncoming.h 2009-02-01 16:25:30 UTC (rev 29109)
+++ haiku/trunk/headers/private/bluetooth/ConnectionIncoming.h 2009-02-01 17:29:42 UTC (rev 29110)
@@ -13,7 +13,7 @@
#include
#include
#include
-#include
+#include
#include
#include
From bonefish at mail.berlios.de Sun Feb 1 19:16:48 2009
From: bonefish at mail.berlios.de (bonefish at BerliOS)
Date: Sun, 1 Feb 2009 19:16:48 +0100
Subject: [Haiku-commits] r29111 -
haiku/trunk/src/tests/system/runtime_loader/test_suite
Message-ID: <200902011816.n11IGmux021494@sheep.berlios.de>
Author: bonefish
Date: 2009-02-01 19:16:46 +0100 (Sun, 01 Feb 2009)
New Revision: 29111
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29111&view=rev
Modified:
haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_lookup_next1
haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_lookup_order1
haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_lookup_order2
haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_lookup_order3
haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_lookup_order4
haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_resolve_basic1
haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_resolve_basic2
haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_resolve_basic3
haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_resolve_order1
haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_resolve_order2
haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_resolve_order3
haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_resolve_order4
haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_resolve_order5
haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_resolve_order6
haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_resolve_order7
haiku/trunk/src/tests/system/runtime_loader/test_suite/load_lookup_next1
haiku/trunk/src/tests/system/runtime_loader/test_suite/load_resolve_basic1
haiku/trunk/src/tests/system/runtime_loader/test_suite/load_resolve_order1
haiku/trunk/src/tests/system/runtime_loader/test_suite/load_resolve_order2
haiku/trunk/src/tests/system/runtime_loader/test_suite/load_resolve_order3
haiku/trunk/src/tests/system/runtime_loader/test_suite/load_resolve_order4
Log:
* Link the test programs with --export-dynamic. This shows that my previous
assumption, that the program image is ignored when relocating symbols of
dlopen()ed objects, is incorrect.
* Adjusted the tests that were failing due to that.
* The RTLD_NEXT test also fails with openSuse 10.3 -- apparently the semantics
has changed between the Linux versions.
Modified: haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_lookup_next1
===================================================================
--- haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_lookup_next1 2009-02-01 17:29:42 UTC (rev 29110)
+++ haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_lookup_next1 2009-02-01 18:16:46 UTC (rev 29111)
@@ -93,7 +93,6 @@
void* liba;
void* libe;
void* self;
-// int (*a)();
libe = dlopen("./libe.so", RTLD_NOW | RTLD_GLOBAL);
if (libe == NULL) {
@@ -107,20 +106,12 @@
exit(117);
}
-/*
- a = (int (*)())dlsym(libe, "a");
- if (a == NULL) {
- fprintf(stderr, "Error getting symbol a: %s\n", dlerror());
- exit(116);
- }
-*/
-
return a();
}
EOI
# build
-gcc -o program program.c -D_GNU_SOURCE $libdl -Xlinker -rpath -Xlinker .
+gcc -o program program.c -D_GNU_SOURCE $libdl -Wl,-rpath,.,--export-dynamic
# run
test_run_ok ./program 31
Modified: haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_lookup_order1
===================================================================
--- haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_lookup_order1 2009-02-01 17:29:42 UTC (rev 29110)
+++ haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_lookup_order1 2009-02-01 18:16:46 UTC (rev 29111)
@@ -83,7 +83,7 @@
EOI
# build
-gcc -o program program.c $libdl -Xlinker -rpath -Xlinker .
+gcc -o program program.c $libdl -Wl,-rpath,.,--export-dynamic
# run
test_run_ok ./program 1
Modified: haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_lookup_order2
===================================================================
--- haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_lookup_order2 2009-02-01 17:29:42 UTC (rev 29110)
+++ haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_lookup_order2 2009-02-01 18:16:46 UTC (rev 29111)
@@ -83,7 +83,7 @@
EOI
# build
-gcc -o program program.c $libdl -Xlinker -rpath -Xlinker .
+gcc -o program program.c $libdl -Wl,-rpath,.,--export-dynamic
# run
test_run_ok ./program 2
Modified: haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_lookup_order3
===================================================================
--- haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_lookup_order3 2009-02-01 17:29:42 UTC (rev 29110)
+++ haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_lookup_order3 2009-02-01 18:16:46 UTC (rev 29111)
@@ -79,7 +79,7 @@
EOI
# build
-gcc -o program program.c $libdl -Xlinker -rpath -Xlinker .
+gcc -o program program.c $libdl -Wl,-rpath,.,--export-dynamic
# run
test_run_ok ./program 2
Modified: haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_lookup_order4
===================================================================
--- haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_lookup_order4 2009-02-01 17:29:42 UTC (rev 29110)
+++ haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_lookup_order4 2009-02-01 18:16:46 UTC (rev 29111)
@@ -83,7 +83,7 @@
EOI
# build
-gcc -o program program.c $libdl -Xlinker -rpath -Xlinker .
+gcc -o program program.c $libdl -Wl,-rpath,.,--export-dynamic
# run
test_run_ok ./program 1
Modified: haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_resolve_basic1
===================================================================
--- haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_resolve_basic1 2009-02-01 17:29:42 UTC (rev 29110)
+++ haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_resolve_basic1 2009-02-01 18:16:46 UTC (rev 29111)
@@ -5,8 +5,7 @@
# dlopen():
# liba.so
#
-# Expected: Undefined symbol in liba.so might resolve to symbol in program, but
-# the program image is ignored, so dlopen() on liba.so fails.
+# Expected: Undefined symbol in liba.so resolve to symbol in program.
. test_setup
@@ -54,7 +53,7 @@
EOI
# build
-gcc -o program program.c $libdl -Xlinker -rpath -Xlinker .
+gcc -o program program.c $libdl -Wl,-rpath,.,--export-dynamic
# run
-test_run_ok ./program 117
+test_run_ok ./program 1
Modified: haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_resolve_basic2
===================================================================
--- haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_resolve_basic2 2009-02-01 17:29:42 UTC (rev 29110)
+++ haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_resolve_basic2 2009-02-01 18:16:46 UTC (rev 29111)
@@ -60,7 +60,7 @@
EOI
# build
-gcc -o program program.c ./libb.so $libdl -Xlinker -rpath -Xlinker .
+gcc -o program program.c ./libb.so $libdl -Wl,-rpath,.,--export-dynamic
# run
test_run_ok ./program 1
Modified: haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_resolve_basic3
===================================================================
--- haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_resolve_basic3 2009-02-01 17:29:42 UTC (rev 29110)
+++ haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_resolve_basic3 2009-02-01 18:16:46 UTC (rev 29111)
@@ -70,7 +70,7 @@
EOI
# build
-gcc -o program program.c $libdl -Xlinker -rpath -Xlinker .
+gcc -o program program.c $libdl -Wl,-rpath,.,--export-dynamic
# run
test_run_ok ./program 1
Modified: haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_resolve_order1
===================================================================
--- haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_resolve_order1 2009-02-01 17:29:42 UTC (rev 29110)
+++ haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_resolve_order1 2009-02-01 18:16:46 UTC (rev 29111)
@@ -6,8 +6,8 @@
# libb.so
# liba.so
#
-# Expected: Undefined symbol in liba.so resolves to symbol in libb.so, not
-# to symbol in program, since program image is ignored.
+# Expected: Undefined symbol in liba.so resolves to symbol in program, not
+# to symbol in libb.so.
. test_setup
@@ -70,8 +70,8 @@
EOI
# build
-gcc -o program program.c $libdl -Xlinker -rpath -Xlinker .
+gcc -o program program.c $libdl -Wl,-rpath,.,--export-dynamic
# run
-test_run_ok ./program 2
+test_run_ok ./program 1
Modified: haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_resolve_order2
===================================================================
--- haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_resolve_order2 2009-02-01 17:29:42 UTC (rev 29110)
+++ haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_resolve_order2 2009-02-01 18:16:46 UTC (rev 29111)
@@ -80,7 +80,7 @@
EOI
# build
-gcc -o program program.c $libdl -Xlinker -rpath -Xlinker .
+gcc -o program program.c $libdl -Wl,-rpath,.,--export-dynamic
# run
test_run_ok ./program 2
Modified: haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_resolve_order3
===================================================================
--- haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_resolve_order3 2009-02-01 17:29:42 UTC (rev 29110)
+++ haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_resolve_order3 2009-02-01 18:16:46 UTC (rev 29111)
@@ -77,7 +77,7 @@
EOI
# build
-gcc -o program program.c $libdl -Xlinker -rpath -Xlinker .
+gcc -o program program.c $libdl -Wl,-rpath,.,--export-dynamic
# run
test_run_ok ./program 2
Modified: haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_resolve_order4
===================================================================
--- haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_resolve_order4 2009-02-01 17:29:42 UTC (rev 29110)
+++ haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_resolve_order4 2009-02-01 18:16:46 UTC (rev 29111)
@@ -87,7 +87,7 @@
EOI
# build
-gcc -o program program.c $libdl -Xlinker -rpath -Xlinker .
+gcc -o program program.c $libdl -Wl,-rpath,.,--export-dynamic
# run
test_run_ok ./program 2
Modified: haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_resolve_order5
===================================================================
--- haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_resolve_order5 2009-02-01 17:29:42 UTC (rev 29110)
+++ haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_resolve_order5 2009-02-01 18:16:46 UTC (rev 29111)
@@ -97,7 +97,7 @@
EOI
# build
-gcc -o program program.c $libdl -Xlinker -rpath -Xlinker .
+gcc -o program program.c $libdl -Wl,-rpath,.,--export-dynamic
# run
test_run_ok ./program 2
Modified: haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_resolve_order6
===================================================================
--- haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_resolve_order6 2009-02-01 17:29:42 UTC (rev 29110)
+++ haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_resolve_order6 2009-02-01 18:16:46 UTC (rev 29111)
@@ -105,7 +105,7 @@
EOI
# build
-gcc -o program program.c $libdl -Xlinker -rpath -Xlinker .
+gcc -o program program.c $libdl -Wl,-rpath,.,--export-dynamic
# run
test_run_ok ./program 1
Modified: haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_resolve_order7
===================================================================
--- haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_resolve_order7 2009-02-01 17:29:42 UTC (rev 29110)
+++ haiku/trunk/src/tests/system/runtime_loader/test_suite/dlopen_resolve_order7 2009-02-01 18:16:46 UTC (rev 29111)
@@ -77,7 +77,7 @@
EOI
# build
-gcc -o program program.c $libdl -Xlinker -rpath -Xlinker .
+gcc -o program program.c $libdl -Wl,-rpath,.,--export-dynamic
# run
test_run_ok ./program 1
Modified: haiku/trunk/src/tests/system/runtime_loader/test_suite/load_lookup_next1
===================================================================
--- haiku/trunk/src/tests/system/runtime_loader/test_suite/load_lookup_next1 2009-02-01 17:29:42 UTC (rev 29110)
+++ haiku/trunk/src/tests/system/runtime_loader/test_suite/load_lookup_next1 2009-02-01 18:16:46 UTC (rev 29111)
@@ -73,8 +73,8 @@
EOI
# build
-gcc -o program program.c -D_GNU_SOURCE ./liba.so $libdl -Xlinker -rpath \
- -Xlinker .
+gcc -o program program.c -D_GNU_SOURCE ./liba.so $libdl \
+ -Wl,-rpath,.,--export-dynamic
# run
test_run_ok ./program 15
Modified: haiku/trunk/src/tests/system/runtime_loader/test_suite/load_resolve_basic1
===================================================================
--- haiku/trunk/src/tests/system/runtime_loader/test_suite/load_resolve_basic1 2009-02-01 17:29:42 UTC (rev 29110)
+++ haiku/trunk/src/tests/system/runtime_loader/test_suite/load_resolve_basic1 2009-02-01 18:16:46 UTC (rev 29111)
@@ -37,7 +37,7 @@
EOI
# build
-gcc -o program program.c ./liba.so
+gcc -o program program.c ./liba.so -Wl,-rpath,.,--export-dynamic
# run
test_run_ok ./program 1
Modified: haiku/trunk/src/tests/system/runtime_loader/test_suite/load_resolve_order1
===================================================================
--- haiku/trunk/src/tests/system/runtime_loader/test_suite/load_resolve_order1 2009-02-01 17:29:42 UTC (rev 29110)
+++ haiku/trunk/src/tests/system/runtime_loader/test_suite/load_resolve_order1 2009-02-01 18:16:46 UTC (rev 29111)
@@ -50,7 +50,7 @@
EOI
# build
-gcc -o program program.c ./liba.so ./libb.so -Xlinker -rpath -Xlinker .
+gcc -o program program.c ./liba.so ./libb.so -Wl,-rpath,.,--export-dynamic
# run
test_run_ok ./program 1
Modified: haiku/trunk/src/tests/system/runtime_loader/test_suite/load_resolve_order2
===================================================================
--- haiku/trunk/src/tests/system/runtime_loader/test_suite/load_resolve_order2 2009-02-01 17:29:42 UTC (rev 29110)
+++ haiku/trunk/src/tests/system/runtime_loader/test_suite/load_resolve_order2 2009-02-01 18:16:46 UTC (rev 29111)
@@ -50,7 +50,7 @@
EOI
# build
-gcc -o program program.c ./libb.so ./liba.so -Xlinker -rpath -Xlinker .
+gcc -o program program.c ./libb.so ./liba.so -Wl,-rpath,.,--export-dynamic
# run
test_run_ok ./program 1
Modified: haiku/trunk/src/tests/system/runtime_loader/test_suite/load_resolve_order3
===================================================================
--- haiku/trunk/src/tests/system/runtime_loader/test_suite/load_resolve_order3 2009-02-01 17:29:42 UTC (rev 29110)
+++ haiku/trunk/src/tests/system/runtime_loader/test_suite/load_resolve_order3 2009-02-01 18:16:46 UTC (rev 29111)
@@ -51,7 +51,7 @@
EOI
# build
-gcc -o program program.c ./liba.so ./libb.so -Xlinker -rpath -Xlinker .
+gcc -o program program.c ./liba.so ./libb.so -Wl,-rpath,.,--export-dynamic
# run
test_run_ok ./program 1
Modified: haiku/trunk/src/tests/system/runtime_loader/test_suite/load_resolve_order4
===================================================================
--- haiku/trunk/src/tests/system/runtime_loader/test_suite/load_resolve_order4 2009-02-01 17:29:42 UTC (rev 29110)
+++ haiku/trunk/src/tests/system/runtime_loader/test_suite/load_resolve_order4 2009-02-01 18:16:46 UTC (rev 29111)
@@ -45,7 +45,7 @@
EOI
# build
-gcc -o program program.c ./libb.so -Xlinker -rpath -Xlinker .
+gcc -o program program.c ./libb.so -Wl,-rpath,.,--export-dynamic
# run
test_run_ok ./program 1
From bonefish at mail.berlios.de Sun Feb 1 19:40:42 2009
From: bonefish at mail.berlios.de (bonefish at BerliOS)
Date: Sun, 1 Feb 2009 19:40:42 +0100
Subject: [Haiku-commits] r29112 - haiku/trunk/src/system/runtime_loader
Message-ID: <200902011840.n11Ieg3T019417@sheep.berlios.de>
Author: bonefish
Date: 2009-02-01 19:40:42 +0100 (Sun, 01 Feb 2009)
New Revision: 29112
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29112&view=rev
Modified:
haiku/trunk/src/system/runtime_loader/elf.cpp
Log:
The assumption that the program image is not used for relocation of
dlopen()ed objects was incorrect. This should fix problems with ports of
software with a plugin/add-on interface.
Modified: haiku/trunk/src/system/runtime_loader/elf.cpp
===================================================================
--- haiku/trunk/src/system/runtime_loader/elf.cpp 2009-02-01 18:16:46 UTC (rev 29111)
+++ haiku/trunk/src/system/runtime_loader/elf.cpp 2009-02-01 18:40:42 UTC (rev 29112)
@@ -2141,10 +2141,9 @@
if (status < B_OK)
goto err;
- // Set RTLD_GLOBAL on all libraries, but clear it on the program image.
+ // Set RTLD_GLOBAL on all libraries including the program.
// This results in the desired symbol resolution for dlopen()ed libraries.
set_image_flags_recursively(sProgramImage, RTLD_GLOBAL);
- sProgramImage->flags &= ~RTLD_GLOBAL;
status = relocate_dependencies(sProgramImage);
if (status < B_OK)
From axeld at pinc-software.de Sun Feb 1 19:59:37 2009
From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=)
Date: Sun, 01 Feb 2009 19:59:37 +0100 CET
Subject: [Haiku-commits]
=?utf-8?q?r29103_-_in_haiku/trunk=3A_headers/os/i?=
=?utf-8?q?nterface_src/kits/interface?=
In-Reply-To: <200901312127.n0VLRpQ3023561@sheep.berlios.de>
Message-ID: <693556582-BeMail@zon>
julun at BerliOS wrote:
> - I'm still unsure if the behavior change introduced with the layout
> stuff is nice
What are you refering to specifically?
It's been some time, but I could have been working on that (or
BListView, I don't remember). Since it was a rather quick "fix" (so
much I do remember), it might not be what one would usually want.
Bye,
Axel.
From axeld at pinc-software.de Sun Feb 1 20:04:56 2009
From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=)
Date: Sun, 01 Feb 2009 20:04:56 +0100 CET
Subject: [Haiku-commits] r29007 - haiku/trunk/src/apps/terminal
In-Reply-To: <49854BB2.500@googlemail.com>
Message-ID: <1012076034-BeMail@zon>
Humdinger wrote:
> My suggestion would be:
> path with filename == "Path" ["The path of the file is ~/home/
> .profile"]
> path w/ filename == "Location" ["The file is located in ~/home"]
>
> In that case, the "Get Info" panel would be changed and the Terminal
> context menu is
> correct. Which is the opposite of what I suggested in the beginning,
> but as I said, it's
> just a matter of definition.
+1 :-)
Bye,
Axel.
From host.haiku at gmx.de Sun Feb 1 20:46:08 2009
From: host.haiku at gmx.de (Karsten Heimrich)
Date: Sun, 01 Feb 2009 20:46:08 +0100
Subject: [Haiku-commits] r29103 - in haiku/trunk: headers/os/interface
src/kits/interface
In-Reply-To: <693556582-BeMail@zon>
References: <693556582-BeMail@zon>
Message-ID: <4985FC00.7090608@gmx.de>
Hi Axel,
Axel D?rfler schrieb:
> julun at BerliOS wrote:
>> - I'm still unsure if the behavior change introduced with the layout
>> stuff is nice
>
> What are you refering to specifically?
> It's been some time, but I could have been working on that (or
> BListView, I don't remember). Since it was a rather quick "fix" (so
> much I do remember), it might not be what one would usually want.
at first i thought it would behave like the one without layout,
basically keeping the frame of the target at the same position. Now it
moves the target around and resizes it accordingly. Though it is not
possible to keep the old behavior.
I had extended my test locally and it gave even worse results when
having a view with layout, adding the scroll view and a target with
fixed size. Then the scrollbars where only partly visible etc.
There was some more stuff, i might extend the test app to be able to
show this. I guess also SetTarget(...) seems effected by the not added
1px space between the target and the scroll view.
Best regards,
Karsten
From mmlr at mail.berlios.de Sun Feb 1 21:48:15 2009
From: mmlr at mail.berlios.de (mmlr at mail.berlios.de)
Date: Sun, 1 Feb 2009 21:48:15 +0100
Subject: [Haiku-commits] r29113 - in haiku/trunk: headers/os/drivers
headers/private/kernel/util
src/bin/makebootable/platform/bios_ia32 src/system/kernel
src/system/kernel/arch/x86 src/system/kernel/cache
src/system/kernel/debug src/system/kernel/device_manager
src/system/kernel/fs src/system/kernel/slab src/system/kernel/vm
Message-ID: <200902012048.n11KmF9e028270@sheep.berlios.de>
Author: mmlr
Date: 2009-02-01 21:48:02 +0100 (Sun, 01 Feb 2009)
New Revision: 29113
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29113&view=rev
Modified:
haiku/trunk/headers/os/drivers/KernelExport.h
haiku/trunk/headers/private/kernel/util/khash.h
haiku/trunk/src/bin/makebootable/platform/bios_ia32/makebootable.cpp
haiku/trunk/src/system/kernel/Notifications.cpp
haiku/trunk/src/system/kernel/arch/x86/arch_debug.cpp
haiku/trunk/src/system/kernel/cache/block_cache.cpp
haiku/trunk/src/system/kernel/cache/file_map.cpp
haiku/trunk/src/system/kernel/debug/debug_commands.cpp
haiku/trunk/src/system/kernel/device_manager/IOScheduler.cpp
haiku/trunk/src/system/kernel/device_manager/devfs.cpp
haiku/trunk/src/system/kernel/device_manager/legacy_drivers.cpp
haiku/trunk/src/system/kernel/elf.cpp
haiku/trunk/src/system/kernel/fs/fifo.cpp
haiku/trunk/src/system/kernel/fs/socket.cpp
haiku/trunk/src/system/kernel/fs/vfs.cpp
haiku/trunk/src/system/kernel/kernel_daemon.cpp
haiku/trunk/src/system/kernel/module.cpp
haiku/trunk/src/system/kernel/slab/Slab.cpp
haiku/trunk/src/system/kernel/thread.cpp
haiku/trunk/src/system/kernel/vm/VMAnonymousCache.cpp
haiku/trunk/src/system/kernel/vm/vm.cpp
haiku/trunk/src/system/kernel/vm/vm_cache.cpp
haiku/trunk/src/system/kernel/vm/vm_page.cpp
haiku/trunk/src/system/kernel/wait_for_objects.cpp
Log:
Fixing warnings under GCC4 in preparation to enable -Werror there as well:
* Replaced the use of offsetof() for structs that aren't PODs. Add a
offset_of_member() macro to util/khash.h because that's what it's used for
in our cases.
* Change the signature of add_debugger_command()/remove_debugger_command() on
GCC > 2 to avoid the depricated conversion from string constants to char *.
* Adding some "suggested" parenthesis. I know that not everyone likes that, but
it pointed out at least one bug that is fixed here as well.
Modified: haiku/trunk/headers/os/drivers/KernelExport.h
===================================================================
--- haiku/trunk/headers/os/drivers/KernelExport.h 2009-02-01 18:40:42 UTC (rev 29112)
+++ haiku/trunk/headers/os/drivers/KernelExport.h 2009-02-01 20:48:02 UTC (rev 29113)
@@ -174,9 +174,16 @@
extern void kernel_debugger(const char *message);
extern uint64 parse_expression(const char *string);
+#if __GNUC__ > 2
+extern int add_debugger_command(const char *name,
+ debugger_command_hook hook, const char *help);
+extern int remove_debugger_command(const char *name,
+ debugger_command_hook hook);
+#else
extern int add_debugger_command(char *name, debugger_command_hook hook, char *help);
extern int remove_debugger_command(char *name,
debugger_command_hook hook);
+#endif
/* Miscellaneous */
extern void spin(bigtime_t microseconds);
Modified: haiku/trunk/headers/private/kernel/util/khash.h
===================================================================
--- haiku/trunk/headers/private/kernel/util/khash.h 2009-02-01 18:40:42 UTC (rev 29112)
+++ haiku/trunk/headers/private/kernel/util/khash.h 2009-02-01 20:48:02 UTC (rev 29113)
@@ -11,6 +11,12 @@
#include
+// The use of offsetof() on non-PODs is invalid. Since many structs use
+// templated members (i.e. DoublyLinkedList) which makes them non-PODs we
+// can't use offsetof() anymore. This macro does the same, but requires an
+// instance of the object in question.
+#define offset_of_member(OBJECT, MEMBER) \
+ ((size_t)((char*)&OBJECT.MEMBER - (char*)&OBJECT))
// can be allocated on the stack
typedef struct hash_iterator {
Modified: haiku/trunk/src/bin/makebootable/platform/bios_ia32/makebootable.cpp
===================================================================
--- haiku/trunk/src/bin/makebootable/platform/bios_ia32/makebootable.cpp 2009-02-01 18:40:42 UTC (rev 29112)
+++ haiku/trunk/src/bin/makebootable/platform/bios_ia32/makebootable.cpp 2009-02-01 20:48:02 UTC (rev 29113)
@@ -611,7 +611,7 @@
// write the boot code
printf("Writing boot code to \"%s\" (partition offset: %lld bytes, "
- "start offset = %d) "
+ "start offset = %lld) "
"...\n", fileName, partitionOffset, startOffset);
write_boot_code_part(fileName, fd, startOffset, bootCodeData, 0,
Modified: haiku/trunk/src/system/kernel/Notifications.cpp
===================================================================
--- haiku/trunk/src/system/kernel/Notifications.cpp 2009-02-01 18:40:42 UTC (rev 29112)
+++ haiku/trunk/src/system/kernel/Notifications.cpp 2009-02-01 20:48:02 UTC (rev 29113)
@@ -57,7 +57,7 @@
UserMessagingMessageSender::SendMessage(const KMessage* message, port_id port,
int32 token)
{
- if (message != fMessage && fMessage != NULL
+ if ((message != fMessage && fMessage != NULL)
|| fTargetCount == MAX_MESSAGING_TARGET_COUNT) {
FlushMessage();
}
Modified: haiku/trunk/src/system/kernel/arch/x86/arch_debug.cpp
===================================================================
--- haiku/trunk/src/system/kernel/arch/x86/arch_debug.cpp 2009-02-01 18:40:42 UTC (rev 29112)
+++ haiku/trunk/src/system/kernel/arch/x86/arch_debug.cpp 2009-02-01 20:48:02 UTC (rev 29113)
@@ -367,10 +367,10 @@
if (thread == NULL)
return IS_KERNEL_ADDRESS(address);
- return address >= thread->kernel_stack_base
- && address < thread->kernel_stack_top
- || thread->cpu != NULL
- && is_double_fault_stack_address(thread->cpu->cpu_num, address);
+ return (address >= thread->kernel_stack_base
+ && address < thread->kernel_stack_top)
+ || (thread->cpu != NULL
+ && is_double_fault_stack_address(thread->cpu->cpu_num, address));
}
@@ -508,7 +508,8 @@
threadIndex++;
}
- if (argc > threadIndex + 1 || argc == 2 && strcmp(argv[1], "--help") == 0) {
+ if (argc > threadIndex + 1
+ || (argc == 2 && strcmp(argv[1], "--help") == 0)) {
kprintf(usage, argv[0]);
return 0;
}
Modified: haiku/trunk/src/system/kernel/cache/block_cache.cpp
===================================================================
--- haiku/trunk/src/system/kernel/cache/block_cache.cpp 2009-02-01 18:40:42 UTC (rev 29112)
+++ haiku/trunk/src/system/kernel/cache/block_cache.cpp 2009-02-01 20:48:02 UTC (rev 29113)
@@ -47,7 +47,6 @@
// system, like out of memory situations - should only panic for debugging.
#define FATAL(x) panic x
-
static const bigtime_t kTransactionIdleTime = 2000000LL;
// a transaction is considered idle after 2 seconds of inactivity
@@ -605,8 +604,8 @@
while (iterator.HasNext()) {
cache_listener* listener = iterator.Next();
- bool remove = isClosing && !is_written_event(listener->events)
- || isWritten && is_written_event(listener->events);
+ bool remove = (isClosing && !is_written_event(listener->events))
+ || (isWritten && is_written_event(listener->events));
if (remove)
iterator.Remove();
@@ -804,12 +803,14 @@
if (buffer_cache == NULL)
return B_NO_MEMORY;
- hash = hash_init(1024, offsetof(cached_block, next), &cached_block::Compare,
- &cached_block::Hash);
+ cached_block dummyBlock;
+ hash = hash_init(1024, offset_of_member(dummyBlock, next),
+ &cached_block::Compare, &cached_block::Hash);
if (hash == NULL)
return B_NO_MEMORY;
- transaction_hash = hash_init(16, offsetof(cache_transaction, next),
+ cache_transaction dummyTransaction;
+ transaction_hash = hash_init(16, offset_of_member(dummyTransaction, next),
&transaction_compare, &::transaction_hash);
if (transaction_hash == NULL)
return B_NO_MEMORY;
Modified: haiku/trunk/src/system/kernel/cache/file_map.cpp
===================================================================
--- haiku/trunk/src/system/kernel/cache/file_map.cpp 2009-02-01 18:40:42 UTC (rev 29112)
+++ haiku/trunk/src/system/kernel/cache/file_map.cpp 2009-02-01 20:48:02 UTC (rev 29113)
@@ -242,7 +242,7 @@
if (lastExtent != NULL) {
if (lastExtent->disk.offset + lastExtent->disk.length
== vecs[i].offset
- || lastExtent->disk.offset == -1 && vecs[i].offset == -1) {
+ || (lastExtent->disk.offset == -1 && vecs[i].offset == -1)) {
lastExtent->disk.length += vecs[i].length;
offset += vecs[i].length;
start--;
@@ -368,8 +368,8 @@
MutexLocker _(fLock);
- if (mode == FILE_MAP_CACHE_ALL && fCacheAll
- || mode == FILE_MAP_CACHE_ON_DEMAND && !fCacheAll)
+ if ((mode == FILE_MAP_CACHE_ALL && fCacheAll)
+ || (mode == FILE_MAP_CACHE_ON_DEMAND && !fCacheAll))
return B_OK;
if (mode == FILE_MAP_CACHE_ALL) {
Modified: haiku/trunk/src/system/kernel/debug/debug_commands.cpp
===================================================================
--- haiku/trunk/src/system/kernel/debug/debug_commands.cpp 2009-02-01 18:40:42 UTC (rev 29112)
+++ haiku/trunk/src/system/kernel/debug/debug_commands.cpp 2009-02-01 20:48:02 UTC (rev 29113)
@@ -488,8 +488,8 @@
kprintf_unfiltered("usage: %s ", command->name);
kputs_unfiltered(command->usage);
} else {
- char* args[3] = { NULL, "--help", NULL };
- invoke_debugger_command(command, 2, args);
+ const char* args[3] = { NULL, "--help", NULL };
+ invoke_debugger_command(command, 2, (char**)args);
}
return true;
@@ -498,16 +498,24 @@
// #pragma mark - public API
-
int
+#if __GNUC__ > 2
+add_debugger_command(const char *name, int (*func)(int, char **),
+ const char *desc)
+#else
add_debugger_command(char *name, int (*func)(int, char **), char *desc)
+#endif
{
return add_debugger_command_etc(name, func, desc, NULL, 0);
}
int
+#if __GNUC__ > 2
+remove_debugger_command(const char * name, int (*func)(int, char **))
+#else
remove_debugger_command(char * name, int (*func)(int, char **))
+#endif
{
struct debugger_command *cmd = sCommands;
struct debugger_command *prev = NULL;
Modified: haiku/trunk/src/system/kernel/device_manager/IOScheduler.cpp
===================================================================
--- haiku/trunk/src/system/kernel/device_manager/IOScheduler.cpp 2009-02-01 18:40:42 UTC (rev 29112)
+++ haiku/trunk/src/system/kernel/device_manager/IOScheduler.cpp 2009-02-01 20:48:02 UTC (rev 29113)
@@ -513,7 +513,7 @@
off_t offsetA = a->Offset();
off_t offsetB = b->Offset();
return offsetA < offsetB
- || offsetA == offsetB && a->Length() > b->Length();
+ || (offsetA == offsetB && a->Length() > b->Length());
}
};
Modified: haiku/trunk/src/system/kernel/device_manager/devfs.cpp
===================================================================
--- haiku/trunk/src/system/kernel/device_manager/devfs.cpp 2009-02-01 18:40:42 UTC (rev 29112)
+++ haiku/trunk/src/system/kernel/device_manager/devfs.cpp 2009-02-01 20:48:02 UTC (rev 29113)
@@ -1746,8 +1746,8 @@
bool isWrite = request->IsWrite();
if (!S_ISCHR(vnode->stream.type)
- || ((isWrite && !vnode->stream.u.dev.device->HasWrite()
- || !isWrite && !vnode->stream.u.dev.device->HasRead())
+ || (((isWrite && !vnode->stream.u.dev.device->HasWrite())
+ || (!isWrite && !vnode->stream.u.dev.device->HasRead()))
&& !vnode->stream.u.dev.device->HasIO())
|| cookie == NULL) {
return B_NOT_ALLOWED;
Modified: haiku/trunk/src/system/kernel/device_manager/legacy_drivers.cpp
===================================================================
--- haiku/trunk/src/system/kernel/device_manager/legacy_drivers.cpp 2009-02-01 18:40:42 UTC (rev 29112)
+++ haiku/trunk/src/system/kernel/device_manager/legacy_drivers.cpp 2009-02-01 20:48:02 UTC (rev 29113)
@@ -481,7 +481,7 @@
while (true) {
driver = (legacy_driver *)hash_next(sDriverHash, &iterator);
if (driver == NULL
- || driver->device == device && driver->node == node)
+ || (driver->device == device && driver->node == node))
break;
}
@@ -1372,8 +1372,10 @@
extern "C" status_t
legacy_driver_init(void)
{
- sDriverHash = hash_init(DRIVER_HASH_SIZE, offsetof(legacy_driver, next),
- &driver_entry_compare, &driver_entry_hash);
+ legacy_driver dummyDriver;
+ sDriverHash = hash_init(DRIVER_HASH_SIZE,
+ offset_of_member(dummyDriver, next), &driver_entry_compare,
+ &driver_entry_hash);
if (sDriverHash == NULL)
return B_NO_MEMORY;
Modified: haiku/trunk/src/system/kernel/elf.cpp
===================================================================
--- haiku/trunk/src/system/kernel/elf.cpp 2009-02-01 18:40:42 UTC (rev 29112)
+++ haiku/trunk/src/system/kernel/elf.cpp 2009-02-01 20:48:02 UTC (rev 29113)
@@ -2049,9 +2049,9 @@
if (_symbolCount == NULL || _stringTableSize == NULL)
return B_BAD_VALUE;
if (!IS_USER_ADDRESS(_symbolCount) || !IS_USER_ADDRESS(_stringTableSize)
- || _imageDelta != NULL && !IS_USER_ADDRESS(_imageDelta)
- || symbolTable != NULL && !IS_USER_ADDRESS(symbolTable)
- || stringTable != NULL && !IS_USER_ADDRESS(stringTable)) {
+ || (_imageDelta != NULL && !IS_USER_ADDRESS(_imageDelta))
+ || (symbolTable != NULL && !IS_USER_ADDRESS(symbolTable))
+ || (stringTable != NULL && !IS_USER_ADDRESS(stringTable))) {
return B_BAD_ADDRESS;
}
@@ -2120,8 +2120,8 @@
if (user_memcpy(_symbolCount, &symbolCount, sizeof(symbolCount)) != B_OK
|| user_memcpy(_stringTableSize, &stringTableSize,
sizeof(stringTableSize)) != B_OK
- || _imageDelta != NULL && user_memcpy(_imageDelta, &imageDelta,
- sizeof(imageDelta)) != B_OK) {
+ || (_imageDelta != NULL && user_memcpy(_imageDelta, &imageDelta,
+ sizeof(imageDelta)) != B_OK)) {
return B_BAD_ADDRESS;
}
Modified: haiku/trunk/src/system/kernel/fs/fifo.cpp
===================================================================
--- haiku/trunk/src/system/kernel/fs/fifo.cpp 2009-02-01 18:40:42 UTC (rev 29112)
+++ haiku/trunk/src/system/kernel/fs/fifo.cpp 2009-02-01 20:48:02 UTC (rev 29113)
@@ -364,7 +364,7 @@
while (dataSize > 0) {
// Wait until enough space in the buffer is available.
while (!fActive
- || fBuffer.Writable() < minToWrite && fReaderCount > 0) {
+ || (fBuffer.Writable() < minToWrite && fReaderCount > 0)) {
if (nonBlocking)
return B_WOULD_BLOCK;
@@ -639,9 +639,9 @@
// signal right away, if the condition holds already
if (writer) {
- if (event == B_SELECT_WRITE
- && (fBuffer.Writable() > 0 || fReaderCount == 0)
- || event == B_SELECT_ERROR && fReaderCount == 0) {
+ if ((event == B_SELECT_WRITE
+ && (fBuffer.Writable() > 0 || fReaderCount == 0))
+ || (event == B_SELECT_ERROR && fReaderCount == 0)) {
return notify_select_event(sync, event);
}
} else {
Modified: haiku/trunk/src/system/kernel/fs/socket.cpp
===================================================================
--- haiku/trunk/src/system/kernel/fs/socket.cpp 2009-02-01 18:40:42 UTC (rev 29112)
+++ haiku/trunk/src/system/kernel/fs/socket.cpp 2009-02-01 20:48:02 UTC (rev 29113)
@@ -119,9 +119,9 @@
// copy address size and address back to userland
if (user_memcpy(userAddressLength, &addressLength,
sizeof(socklen_t)) != B_OK
- || userAddress != NULL
+ || (userAddress != NULL
&& user_memcpy(userAddress, address,
- min_c(addressLength, userAddressBufferSize)) != B_OK) {
+ min_c(addressLength, userAddressBufferSize)) != B_OK)) {
return B_BAD_ADDRESS;
}
@@ -973,10 +973,10 @@
message.msg_name = userAddress;
message.msg_iov = userVecs;
message.msg_control = userAncillary;
- if (userAddress != NULL && user_memcpy(userAddress, address,
- message.msg_namelen) != B_OK
- || userAncillary != NULL && user_memcpy(userAncillary, ancillary,
- message.msg_controllen) != B_OK
+ if ((userAddress != NULL && user_memcpy(userAddress, address,
+ message.msg_namelen) != B_OK)
+ || (userAncillary != NULL && user_memcpy(userAncillary, ancillary,
+ message.msg_controllen) != B_OK)
|| user_memcpy(userMessage, &message, sizeof(msghdr)) != B_OK) {
return B_BAD_ADDRESS;
}
Modified: haiku/trunk/src/system/kernel/fs/vfs.cpp
===================================================================
--- haiku/trunk/src/system/kernel/fs/vfs.cpp 2009-02-01 18:40:42 UTC (rev 29112)
+++ haiku/trunk/src/system/kernel/fs/vfs.cpp 2009-02-01 20:48:02 UTC (rev 29113)
@@ -1852,8 +1852,8 @@
if (vnodeToDisconnect != NULL) {
if (vnode == vnodeToDisconnect)
disconnect_fd(descriptor);
- } else if (vnode != NULL && vnode->mount == mount
- || vnode == NULL && descriptor->u.mount == mount)
+ } else if ((vnode != NULL && vnode->mount == mount)
+ || (vnode == NULL && descriptor->u.mount == mount))
disconnect_fd(descriptor);
put_fd(descriptor);
@@ -4842,15 +4842,17 @@
status_t
vfs_init(kernel_args *args)
{
- sVnodeTable = hash_init(VNODE_HASH_TABLE_SIZE, offsetof(struct vnode, next),
- &vnode_compare, &vnode_hash);
+ struct vnode dummyVnode;
+ sVnodeTable = hash_init(VNODE_HASH_TABLE_SIZE,
+ offset_of_member(dummyVnode, next), &vnode_compare, &vnode_hash);
if (sVnodeTable == NULL)
panic("vfs_init: error creating vnode hash table\n");
- list_init_etc(&sUnusedVnodeList, offsetof(struct vnode, unused_link));
+ list_init_etc(&sUnusedVnodeList, offset_of_member(dummyVnode, unused_link));
- sMountsTable = hash_init(MOUNTS_HASH_TABLE_SIZE, offsetof(struct fs_mount, next),
- &mount_compare, &mount_hash);
+ struct fs_mount dummyMount;
+ sMountsTable = hash_init(MOUNTS_HASH_TABLE_SIZE,
+ offset_of_member(dummyMount, next), &mount_compare, &mount_hash);
if (sMountsTable == NULL)
panic("vfs_init: error creating mounts hash table\n");
@@ -5752,10 +5754,10 @@
status = release_advisory_lock(vnode, &flock);
} else {
// the open mode must match the lock type
- if ((descriptor->open_mode & O_RWMASK) == O_RDONLY
- && flock.l_type == F_WRLCK
- || (descriptor->open_mode & O_RWMASK) == O_WRONLY
- && flock.l_type == F_RDLCK)
+ if (((descriptor->open_mode & O_RWMASK) == O_RDONLY
+ && flock.l_type == F_WRLCK)
+ || ((descriptor->open_mode & O_RWMASK) == O_WRONLY
+ && flock.l_type == F_RDLCK))
status = B_FILE_ERROR;
else {
status = acquire_advisory_lock(vnode, -1,
@@ -6725,7 +6727,7 @@
fs_mount(char* path, const char* device, const char* fsName, uint32 flags,
const char* args, bool kernel)
{
- struct fs_mount* mount;
+ struct ::fs_mount* mount;
status_t status = 0;
FUNCTION(("fs_mount: entry. path = '%s', fs_name = '%s'\n", path, fsName));
@@ -6840,7 +6842,7 @@
}
}
- mount = new(std::nothrow) struct ::fs_mount;
+ mount = new(std::nothrow) (struct ::fs_mount);
if (mount == NULL)
return B_NO_MEMORY;
@@ -8390,7 +8392,7 @@
return B_BAD_ADDRESS;
// open the parent dir
- int parentFD = dir_open(fd, "..", kernel);
+ int parentFD = dir_open(fd, (char*)"..", kernel);
if (parentFD < 0)
return parentFD;
FDCloser fdCloser(parentFD, kernel);
Modified: haiku/trunk/src/system/kernel/kernel_daemon.cpp
===================================================================
--- haiku/trunk/src/system/kernel/kernel_daemon.cpp 2009-02-01 18:40:42 UTC (rev 29112)
+++ haiku/trunk/src/system/kernel/kernel_daemon.cpp 2009-02-01 20:48:02 UTC (rev 29113)
@@ -83,7 +83,7 @@
if (function == NULL || frequency < 1)
return B_BAD_VALUE;
- struct daemon* daemon = new(std::nothrow) struct ::daemon;
+ struct ::daemon* daemon = new(std::nothrow) (struct ::daemon);
if (daemon == NULL)
return B_NO_MEMORY;
Modified: haiku/trunk/src/system/kernel/module.cpp
===================================================================
--- haiku/trunk/src/system/kernel/module.cpp 2009-02-01 18:40:42 UTC (rev 29112)
+++ haiku/trunk/src/system/kernel/module.cpp 2009-02-01 20:48:02 UTC (rev 29113)
@@ -2182,8 +2182,8 @@
module = (struct module*)hash_lookup(sModulesHash, path);
// if we don't have it cached yet, search for it
- if (module == NULL || (module->flags & B_BUILT_IN_MODULE) == 0
- && module->module_image == NULL) {
+ if (module == NULL || ((module->flags & B_BUILT_IN_MODULE) == 0
+ && module->module_image == NULL)) {
module = search_module(path, &moduleImage);
if (module == NULL) {
FATAL(("module: Search for %s failed.\n", path));
Modified: haiku/trunk/src/system/kernel/slab/Slab.cpp
===================================================================
--- haiku/trunk/src/system/kernel/slab/Slab.cpp 2009-02-01 18:40:42 UTC (rev 29112)
+++ haiku/trunk/src/system/kernel/slab/Slab.cpp 2009-02-01 20:48:02 UTC (rev 29113)
@@ -26,6 +26,7 @@
#include
#include
#include
+#include
#include
#include
@@ -597,8 +598,12 @@
static void
object_cache_return_object_wrapper(object_depot *depot, void *object)
{
+ // TODO: the offset calculation might be wrong because we hardcode a
+ // SmallObjectCache instead of a base object_cache. Also this must
+ // have an unacceptable overhead.
+ SmallObjectCache dummyCache;
object_cache *cache = (object_cache *)(((uint8 *)depot)
- - offsetof(object_cache, depot));
+ - offset_of_member(dummyCache, depot));
object_cache_free(cache, object);
}
Modified: haiku/trunk/src/system/kernel/thread.cpp
===================================================================
--- haiku/trunk/src/system/kernel/thread.cpp 2009-02-01 18:40:42 UTC (rev 29112)
+++ haiku/trunk/src/system/kernel/thread.cpp 2009-02-01 20:48:02 UTC (rev 29113)
@@ -2724,8 +2724,8 @@
thread_id threadID;
if (!IS_USER_ADDRESS(attributes.entry) || attributes.entry == NULL
- || attributes.stack_address != NULL
- && !IS_USER_ADDRESS(attributes.stack_address)
+ || (attributes.stack_address != NULL
+ && !IS_USER_ADDRESS(attributes.stack_address))
|| (attributes.name != NULL && (!IS_USER_ADDRESS(attributes.name)
|| user_strlcpy(name, attributes.name, B_OS_NAME_LENGTH) < 0)))
return B_BAD_ADDRESS;
Modified: haiku/trunk/src/system/kernel/vm/VMAnonymousCache.cpp
===================================================================
--- haiku/trunk/src/system/kernel/vm/VMAnonymousCache.cpp 2009-02-01 18:40:42 UTC (rev 29112)
+++ haiku/trunk/src/system/kernel/vm/VMAnonymousCache.cpp 2009-02-01 20:48:02 UTC (rev 29113)
@@ -611,7 +611,7 @@
}
// create our callback
- WriteCallback* callback = (flags & B_VIP_IO_REQUEST != 0)
+ WriteCallback* callback = (flags & B_VIP_IO_REQUEST) != 0
? new(vip_io_alloc) WriteCallback(this, _callback)
: new(std::nothrow) WriteCallback(this, _callback);
if (callback == NULL) {
@@ -1211,7 +1211,7 @@
close(fd);
- error = swap_file_add("/var/swap");
+ error = swap_file_add((char *)"/var/swap");
if (error != B_OK)
dprintf("Failed to add swap file /var/swap: %s\n", strerror(error));
}
Modified: haiku/trunk/src/system/kernel/vm/vm.cpp
===================================================================
--- haiku/trunk/src/system/kernel/vm/vm.cpp 2009-02-01 18:40:42 UTC (rev 29112)
+++ haiku/trunk/src/system/kernel/vm/vm.cpp 2009-02-01 20:48:02 UTC (rev 29113)
@@ -418,7 +418,7 @@
area = (vm_area *)hash_lookup(sAreaHash, &areaID);
if (area != NULL
&& (area->address_space->id == team
- || allowKernel && team == vm_kernel_address_space_id())) {
+ || (allowKernel && team == vm_kernel_address_space_id()))) {
fSpace = area->address_space;
atomic_add(&fSpace->ref_count, 1);
}
@@ -1358,9 +1358,9 @@
uint32 pageIndex = (pageAddress - area->base) / B_PAGE_SIZE;
uint8& entry = area->page_protections[pageIndex / 2];
if (pageIndex % 2 == 0)
- entry = entry & 0xf0 | protection;
+ entry = (entry & 0xf0) | protection;
else
- entry = entry & 0x0f | (protection << 4);
+ entry = (entry & 0x0f) | (protection << 4);
}
@@ -2280,9 +2280,9 @@
// The FD must open for reading at any rate. For shared mapping with write
// access, additionally the FD must be open for writing.
if ((openMode & O_ACCMODE) == O_WRONLY
- || mapping == REGION_NO_PRIVATE_MAP
+ || (mapping == REGION_NO_PRIVATE_MAP
&& (protection & (B_WRITE_AREA | B_KERNEL_WRITE_AREA)) != 0
- && (openMode & O_ACCMODE) == O_RDONLY) {
+ && (openMode & O_ACCMODE) == O_RDONLY)) {
return EACCES;
}
@@ -3459,7 +3459,7 @@
if (level == 0)
kprintf("/%lu", info.page_count);
- if (cache->type == CACHE_TYPE_RAM || level == 0 && info.committed > 0) {
+ if (cache->type == CACHE_TYPE_RAM || (level == 0 && info.committed > 0)) {
kprintf(", committed: %lld", cache->committed_size);
if (level == 0)
@@ -3704,9 +3704,9 @@
hash_open(sAreaHash, &iter);
while ((area = (vm_area *)hash_next(sAreaHash, &iter)) != NULL) {
if ((area->name != NULL && !strcmp(argv[index], area->name))
- || num != 0
+ || (num != 0
&& ((addr_t)area->id == num
- || area->base <= num && area->base + area->size > num)) {
+ || (area->base <= num && area->base + area->size > num)))) {
dump_area_struct(area, mappings);
found = true;
}
@@ -3736,8 +3736,8 @@
hash_open(sAreaHash, &iter);
while ((area = (vm_area *)hash_next(sAreaHash, &iter)) != NULL) {
- if (id != 0 && area->address_space->id != id
- || name != NULL && strstr(area->name, name) == NULL)
+ if ((id != 0 && area->address_space->id != id)
+ || (name != NULL && strstr(area->name, name) == NULL))
continue;
kprintf("%p %5lx %p\t%p %4lx\t%4d %s\n", area, area->id, (void *)area->base,
@@ -6347,7 +6347,7 @@
if (writeSync && writeAsync)
return B_BAD_VALUE;
- if (size == 0 || !writeSync && !writeAsync)
+ if (size == 0 || (!writeSync && !writeAsync))
return B_OK;
// iterate through the range and sync all concerned areas
Modified: haiku/trunk/src/system/kernel/vm/vm_cache.cpp
===================================================================
--- haiku/trunk/src/system/kernel/vm/vm_cache.cpp 2009-02-01 18:40:42 UTC (rev 29112)
+++ haiku/trunk/src/system/kernel/vm/vm_cache.cpp 2009-02-01 20:48:02 UTC (rev 29113)
@@ -389,7 +389,8 @@
VMCache::Init(uint32 cacheType)
{
mutex_init(&fLock, "vm_cache");
- list_init_etc(&consumers, offsetof(VMCache, consumer_link));
+ VMCache dummyCache;
+ list_init_etc(&consumers, offset_of_member(dummyCache, consumer_link));
areas = NULL;
fRefCount = 1;
source = NULL;
Modified: haiku/trunk/src/system/kernel/vm/vm_page.cpp
===================================================================
--- haiku/trunk/src/system/kernel/vm/vm_page.cpp 2009-02-01 18:40:42 UTC (rev 29112)
+++ haiku/trunk/src/system/kernel/vm/vm_page.cpp 2009-02-01 20:48:02 UTC (rev 29113)
@@ -1238,11 +1238,11 @@
// until we're low on pages. Also avoid writing temporary pages that
// are active.
if (page->wired_count > 0
- || cache->temporary
+ || (cache->temporary
#if ENABLE_SWAP_SUPPORT
&& (!lowOnPages /*|| page->usage_count > 0*/)
#endif
- ) {
+ )) {
continue;
}
@@ -1444,9 +1444,9 @@
InterruptsSpinLocker locker(sPageLock);
- if (reserve && sReservedPages <= free_page_queue_count()
+ if ((reserve && sReservedPages <= free_page_queue_count())
|| count == 0
- || !reserve && (sInactivePageQueue.count > 0
+ || ((!reserve && (sInactivePageQueue.count > 0))
|| free_page_queue_count() > sReservedPages))
return stolen;
Modified: haiku/trunk/src/system/kernel/wait_for_objects.cpp
===================================================================
--- haiku/trunk/src/system/kernel/wait_for_objects.cpp 2009-02-01 18:40:42 UTC (rev 29112)
+++ haiku/trunk/src/system/kernel/wait_for_objects.cpp 2009-02-01 20:48:02 UTC (rev 29113)
@@ -564,7 +564,7 @@
int fd = fds[i].fd;
// initialize events masks
- sync->set[i].selected_events = fds[i].events & ~POLLNVAL
+ sync->set[i].selected_events = (fds[i].events & ~POLLNVAL)
| POLLERR | POLLHUP;
sync->set[i].events = 0;
From anevilyak at mail.berlios.de Sun Feb 1 22:02:36 2009
From: anevilyak at mail.berlios.de (anevilyak at BerliOS)
Date: Sun, 1 Feb 2009 22:02:36 +0100
Subject: [Haiku-commits] r29114 - haiku/trunk/headers/os/app
Message-ID: <200902012102.n11L2axA029394@sheep.berlios.de>
Author: anevilyak
Date: 2009-02-01 22:02:36 +0100 (Sun, 01 Feb 2009)
New Revision: 29114
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29114&view=rev
Modified:
haiku/trunk/headers/os/app/PropertyInfo.h
Log:
On gcc4 these need to be declared const. Otherwise any and every app that simply sets up a bunch of property_info structs for its scripting directives triggers many many warnings with respect to deprecated string constant conversions.
Modified: haiku/trunk/headers/os/app/PropertyInfo.h
===================================================================
--- haiku/trunk/headers/os/app/PropertyInfo.h 2009-02-01 20:48:02 UTC (rev 29113)
+++ haiku/trunk/headers/os/app/PropertyInfo.h 2009-02-01 21:02:36 UTC (rev 29114)
@@ -48,10 +48,16 @@
};
struct property_info {
+#if __GNUC__ > 2
+ const
+#endif
char *name;
uint32 commands[10];
uint32 specifiers[10];
- char *usage;
+#if __GNUC__ > 2
+ const
+#endif
+ char *usage;
uint32 extra_data;
uint32 types[10];
compound_type ctypes[3];
From anevilyak at mail.berlios.de Sun Feb 1 22:05:32 2009
From: anevilyak at mail.berlios.de (anevilyak at BerliOS)
Date: Sun, 1 Feb 2009 22:05:32 +0100
Subject: [Haiku-commits] r29115 - haiku/trunk/headers/os/app
Message-ID: <200902012105.n11L5WN5029704@sheep.berlios.de>
Author: anevilyak
Date: 2009-02-01 22:05:31 +0100 (Sun, 01 Feb 2009)
New Revision: 29115
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29115&view=rev
Modified:
haiku/trunk/headers/os/app/PropertyInfo.h
Log:
value_info needs that change also.
Modified: haiku/trunk/headers/os/app/PropertyInfo.h
===================================================================
--- haiku/trunk/headers/os/app/PropertyInfo.h 2009-02-01 21:02:36 UTC (rev 29114)
+++ haiku/trunk/headers/os/app/PropertyInfo.h 2009-02-01 21:05:31 UTC (rev 29115)
@@ -70,9 +70,15 @@
};
struct value_info {
+#if __GNUC__ > 2
+ const
+#endif
char *name;
uint32 value;
value_kind kind;
+#if __GNUC__ > 2
+ const
+#endif
char *usage;
uint32 extra_data;
uint32 _reserved[10];
From anevilyak at mail.berlios.de Sun Feb 1 22:30:25 2009
From: anevilyak at mail.berlios.de (anevilyak at BerliOS)
Date: Sun, 1 Feb 2009 22:30:25 +0100
Subject: [Haiku-commits] r29116 - haiku/trunk/headers/os/app
Message-ID: <200902012130.n11LUPYD031713@sheep.berlios.de>
Author: anevilyak
Date: 2009-02-01 22:30:25 +0100 (Sun, 01 Feb 2009)
New Revision: 29116
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29116&view=rev
Modified:
haiku/trunk/headers/os/app/PropertyInfo.h
Log:
Remove trailing spaces and add one more needed const.
Modified: haiku/trunk/headers/os/app/PropertyInfo.h
===================================================================
--- haiku/trunk/headers/os/app/PropertyInfo.h 2009-02-01 21:05:31 UTC (rev 29115)
+++ haiku/trunk/headers/os/app/PropertyInfo.h 2009-02-01 21:30:25 UTC (rev 29116)
@@ -41,6 +41,9 @@
struct compound_type {
struct field_pair {
+#if __GNUC__ > 2
+ const
+#endif
char *name; // name of entry in message
type_code type; // type_code of entry in message
};
@@ -49,13 +52,13 @@
struct property_info {
#if __GNUC__ > 2
- const
+ const
#endif
char *name;
uint32 commands[10];
uint32 specifiers[10];
#if __GNUC__ > 2
- const
+ const
#endif
char *usage;
uint32 extra_data;
From nielx at mail.berlios.de Sun Feb 1 22:44:22 2009
From: nielx at mail.berlios.de (nielx at mail.berlios.de)
Date: Sun, 1 Feb 2009 22:44:22 +0100
Subject: [Haiku-commits] r29117 - haiku/trunk/docs/user
Message-ID: <200902012144.n11LiMdZ032488@sheep.berlios.de>
Author: nielx
Date: 2009-02-01 22:44:07 +0100 (Sun, 01 Feb 2009)
New Revision: 29117
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29117&view=rev
Modified:
haiku/trunk/docs/user/Doxyfile
haiku/trunk/docs/user/book.css
haiku/trunk/docs/user/footer.html
haiku/trunk/docs/user/header.html
Log:
Tweak looks of API documentation.
WIP:
* Only a first subset of CSS has been applied
* Look based on Humdinger's and other's work on user guide
* Navigation is still ugly. I need to work around the limitations of Doxygen. Maybe by a patch though.
* Needs a manual extra step: you need to copy the /trunk/docs/userguide/images/logo.png to the /trunk/generated/doxygen/html directory
Modified: haiku/trunk/docs/user/Doxyfile
===================================================================
--- haiku/trunk/docs/user/Doxyfile 2009-02-01 21:30:25 UTC (rev 29116)
+++ haiku/trunk/docs/user/Doxyfile 2009-02-01 21:44:07 UTC (rev 29117)
@@ -683,7 +683,7 @@
# each generated HTML page. If it is left blank doxygen will generate a
# standard header.
-HTML_HEADER =
+HTML_HEADER = header.html
# The HTML_FOOTER tag can be used to specify a personal HTML footer for
# each generated HTML page. If it is left blank doxygen will generate a
@@ -698,7 +698,7 @@
# the style sheet file to the HTML output directory, so don't put your own
# stylesheet in the HTML output directory as well, or it will be erased!
-HTML_STYLESHEET =
+HTML_STYLESHEET = book.css
# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
# files or namespaces will be aligned in HTML using tables. If set to
Modified: haiku/trunk/docs/user/book.css
===================================================================
--- haiku/trunk/docs/user/book.css 2009-02-01 21:30:25 UTC (rev 29116)
+++ haiku/trunk/docs/user/book.css 2009-02-01 21:44:07 UTC (rev 29117)
@@ -1,78 +1,281 @@
-H1 {
- text-align: center;
- font-family: Arial, Helvetica, sans-serif;
+/*
+ * Copyright 2008, Haiku. All rights reserved.
+ * Distributed under the terms of the MIT License.
+ *
+ * Authors:
+ * Fran?ois Revol
+ * Stephan A?mus
+ * Braden Ewing
+ * Humdinger
+ */
+
+/* This is the Doxygen standard (messy) CSS updated with Haiku stuff.
+ All tags which are lower case have custom CSS, all upper case tags are the original.
+ I did some reordering.
+ - nielx
+ */
+
+html {
+ margin: 0px;
+ padding: 0px;
}
-H2 {
- font-family: Arial, Helvetica, sans-serif;
+
+body {
+ font-family: "DejaVu Sans",Arial,Helvetica,sans-serif;
+ background: white;
+ color: #333333;
+ font-size: 90%;
+ margin: 0px;
+ padding: 0px;
}
+
+h1 {
+ font-size: 1.3em;
+ font-weight: normal;
+ color: #0c3762;
+ border-bottom: dotted thin #e0e0e0;
+}
+
+h2 {
+ font-size: 1.2em;
+ font-weight: normal;
+ color: #0c3762;
+ border-bottom: dotted thin #e0e0e0;
+ margin-top: 10px;
+}
+
+h3 {
+ font-size: 1.1em;
+ font-weight: normal;
+ color: #0c3762;
+ margin-top: 10px;
+}
+
+h4 {
+ font-size: 1.0em;
+ font-weight: lighter;
+ color: #0c3762;
+ margin-top: 10px;
+}
+
+p {
+ text-align: justify;
+ line-height: 1.3;
+}
+
+/* link colors and text decoration */
+
+a:link {
+ font-weight: bold;
+ text-decoration: none;
+ color: #dc3c01;
+}
+
+a:visited {
+ font-weight: bold;
+ text-decoration: none;
+ color: #892601;
+}
+
+a:hover, a:active {
+ text-decoration: underline;
+ color: #ff4500;
+}
+
+/* Some headers act as anchors, don't give them a hover effect */
+
+h1 a:hover, a:active {
+ text-decoration: none;
+ color: #0c3762;
+}
+
+h2 a:hover, a:active {
+ text-decoration: none;
+ color: #0c3762;
+}
+
+h3 a:hover, a:active {
+ text-decoration: none;
+ color: #0c3762;
+}
+
+h4 a:hover, a:active {
+ text-decoration: none;
+ color: #0c3762;
+}
+
+/* Custom Header */
+
+div.logo {
+ position: relative;
+ left: 0px;
+ top: 0px;
+ background: #efefef;
+}
+
+div.logo img {
+ margin-left: 20px;
+}
+
+div.title {
+ position: absolute;
+ top: 54px;
+ right: 40px;
+ font-size: 1.2em;
+}
+
+/* Navigation Tabs */
+div.tabs {
+ width: 100%;
+ background: #e0e0e0;
+}
+
+div.tabs ul {
+ margin: 0px;
+ padding-left: 10px;
+ list-style: none;
+}
+
+div.tabs li {
+ display: inline;
+ margin: 0px;
+ padding: 0px;
+ font-size: 0,8em;
+}
+
+div.tabs span {
+ display: inline;
+ padding: 5px 9px;
+ white-space: nowrap;
+}
+
+div.tabs li.current a {
+ color: black;
+ text-decoration: none;
+}
+
+/* Contents div */
+
+div.contents {
+ padding: 50px 40px;
+}
+
+/* Continue with the rest of the standard Doxygen stuff... */
+
CAPTION { font-weight: bold }
-DIV.qindex { width: 100%;
- font-family: Arial, Helvetica, sans-serif;
- background-color: white;
- border: 1px solid black;
- padding: 2px;
- text-align: center;
- margin-bottom: 2px
+DIV.qindex {
+ width: 100%;
+ background-color: #e8eef2;
+ border: 1px solid #84b0c7;
+ text-align: center;
+ margin: 2px;
+ padding: 2px;
+ line-height: 140%;
}
-A.qindex { text-decoration: none; font-weight: bold; color: #2222aa }
-A.qindex:visited { text-decoration: none; font-weight: bold; color: #2222aa }
-A.qindex:hover { text-decoration: none; background-color: #f0f0e0 }
-A.qindexHL { text-decoration: underlined; font-weight: bold;
- background-color: #e0e0d0 /*#111199;*/
- color: black; /*#cccccc*/
- }
-A.qindexHL:hover { text-decoration: none; background-color: #111199; color: #ffffff }
-/*A.qindexHL:visited { text-decoration: none; color: #000060 }*/
-A.el { text-decoration: underline; font-weight: bold; color: #2222aa }
+DIV.nav {
+ width: 100%;
+ background-color: #e8eef2;
+ border: 1px solid #84b0c7;
+ text-align: center;
+ margin: 2px;
+ padding: 2px;
+ line-height: 140%;
+}
+DIV.navtab {
+ background-color: #e8eef2;
+ border: 1px solid #84b0c7;
+ text-align: center;
+ margin: 2px;
+ margin-right: 15px;
+ padding: 2px;
+}
+TD.navtab {
+ font-size: 70%;
+}
+A.qindex {
+ text-decoration: none;
+ font-weight: bold;
+ color: #1A419D;
+}
+A.qindex:visited {
+ text-decoration: none;
+ font-weight: bold;
+ color: #1A419D
+}
+A.qindex:hover {
+ text-decoration: none;
+ background-color: #ddddff;
+}
+A.qindexHL {
+ text-decoration: none;
+ font-weight: bold;
+ background-color: #6666cc;
+ color: #ffffff;
+ border: 1px double #9295C2;
+}
+A.qindexHL:hover {
+ text-decoration: none;
+ background-color: #6666cc;
+ color: #ffffff;
+}
+A.qindexHL:visited { text-decoration: none; background-color: #6666cc; color: #ffffff }
A.elRef { font-weight: bold }
-A { text-decoration: underline; color: #2222aa }
-A.codeRef { text-decoration: underline; font-weight: normal; color: #2222aa }
-A:hover { text-decoration: underline; background-color: #e0e0d0 }
-A.el:visited { text-decoration: underline; color: #000060 }
+A.code:link { text-decoration: none; font-weight: normal; color: #0000FF}
+A.code:visited { text-decoration: none; font-weight: normal; color: #0000FF}
+A.codeRef:link { font-weight: normal; color: #0000FF}
+A.codeRef:visited { font-weight: normal; color: #0000FF}
DL.el { margin-left: -1cm }
-DIV.fragment {
- width: 98%;
+.fragment {
+ font-family: monospace, fixed;
+ font-size: 95%;
+}
+PRE.fragment {
border: 1px solid #CCCCCC;
background-color: #f5f5f5;
- padding-left: 4px;
- margin: 4px;
+ margin-top: 4px;
+ margin-bottom: 4px;
+ margin-left: 2px;
+ margin-right: 8px;
+ padding-left: 6px;
+ padding-right: 6px;
+ padding-top: 4px;
+ padding-bottom: 4px;
}
DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px }
-TD.md { background-color: #ffffff; font-weight: bold; }
-TD.mdname1 { background-color: #ffffff; font-weight: bold; color: #602020; }
-TD.mdname { background-color: #ffffff; font-weight: bold; color: #602020; width: 600px; }
-DIV.groupHeader { margin-left: 16px; margin-top: 12px; margin-bottom: 6px; font-weight: bold }
-DIV.groupText { margin-left: 16px; font-style: italic; font-size: smaller }
-BODY {
- font-family: Arial, Helvetica, sans-serif;
- background: white;
- color: black;
- margin-right: 20px;
- margin-left: 20px;
+
+DIV.groupHeader {
+ margin-left: 16px;
+ margin-top: 12px;
+ margin-bottom: 6px;
+ font-weight: bold;
}
-TD.indexkey {
- background-color: white;
- font-weight: bold;
- padding-right : 10px;
- padding-top : 2px;
- padding-left : 10px;
- padding-bottom : 2px;
- margin-left : 0px;
- margin-right : 0px;
- margin-top : 2px;
- margin-bottom : 2px
+DIV.groupText { margin-left: 16px; font-style: italic; font-size: 90% }
+
+TD.indexkey {
+ background-color: #e8eef2;
+ font-weight: bold;
+ padding-right : 10px;
+ padding-top : 2px;
+ padding-left : 10px;
+ padding-bottom : 2px;
+ margin-left : 0px;
+ margin-right : 0px;
+ margin-top : 2px;
+ margin-bottom : 2px;
+ border: 1px solid #CCCCCC;
}
-TD.indexvalue {
- background-color: white;
- font-style: italic;
- padding-right : 10px;
- padding-top : 2px;
- padding-left : 10px;
- padding-bottom : 2px;
- margin-left : 0px;
- margin-right : 0px;
- margin-top : 2px;
- margin-bottom : 2px
+TD.indexvalue {
+ background-color: #e8eef2;
+ font-style: italic;
+ padding-right : 10px;
+ padding-top : 2px;
+ padding-left : 10px;
+ padding-bottom : 2px;
+ margin-left : 0px;
+ margin-right : 0px;
+ margin-top : 2px;
+ margin-bottom : 2px;
+ border: 1px solid #CCCCCC;
}
TR.memlist {
background-color: #f0f0f0;
@@ -87,29 +290,11 @@
SPAN.preprocessor { color: #806020 }
SPAN.stringliteral { color: #002080 }
SPAN.charliteral { color: #008080 }
-
-/* this violates anything which is good style - but it seem to work... */
-EM.none { font-style: italic; }
-EM, SPAN.var {
- font-weight: bold;
- font-family: Arial, sans-serif;
- font-style: italic;
- color: #602020;
-}
-CODE { color: #3333aa; }
-
-.mdTable {
- border: 4px ridge #868686;
- background-color: #ffffff;
-}
-.mdRow {
- padding: 8px 20px;
-}
.mdescLeft {
- font-size: smaller;
- font-family: Arial, Helvetica, sans-serif;
+ padding: 0px 8px 4px 8px;
+ font-size: 80%;
+ font-style: italic;
background-color: #FAFAFA;
- padding-left: 8px;
border-top: 1px none #E0E0E0;
border-right: 1px none #E0E0E0;
border-bottom: 1px none #E0E0E0;
@@ -117,18 +302,15 @@
margin: 0px;
}
.mdescRight {
- font-size: smaller;
- font-family: Arial, Helvetica, sans-serif;
+ padding: 0px 8px 4px 8px;
+ font-size: 80%;
font-style: italic;
background-color: #FAFAFA;
- padding-left: 4px;
border-top: 1px none #E0E0E0;
border-right: 1px none #E0E0E0;
border-bottom: 1px none #E0E0E0;
border-left: 1px none #E0E0E0;
margin: 0px;
- padding-bottom: 0px;
- padding-right: 8px;
}
.memItemLeft {
padding: 1px 0px 0px 8px;
@@ -137,38 +319,91 @@
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
+ border-top-color: #E0E0E0;
+ border-right-color: #E0E0E0;
+ border-bottom-color: #E0E0E0;
+ border-left-color: #E0E0E0;
border-top-style: solid;
+ border-right-style: none;
+ border-bottom-style: none;
+ border-left-style: none;
+ background-color: #FAFAFA;
+ font-size: 80%;
+}
+.memItemRight {
+ padding: 1px 8px 0px 8px;
+ margin: 4px;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
border-top-color: #E0E0E0;
border-right-color: #E0E0E0;
border-bottom-color: #E0E0E0;
border-left-color: #E0E0E0;
+ border-top-style: solid;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
background-color: #FAFAFA;
- font-family: Arial, Helvetica, sans-serif;
- font-size: 12px;
+ font-size: 80%;
}
-.memItemRight {
+.memTemplItemLeft {
padding: 1px 0px 0px 8px;
margin: 4px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
- border-top-style: solid;
border-top-color: #E0E0E0;
border-right-color: #E0E0E0;
border-bottom-color: #E0E0E0;
border-left-color: #E0E0E0;
+ border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
background-color: #FAFAFA;
- font-family: Arial, Helvetica, sans-serif;
- font-size: 13px;
+ font-size: 80%;
}
-.search { color: #0000ee;
+.memTemplItemRight {
+ padding: 1px 8px 0px 8px;
+ margin: 4px;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ border-top-color: #E0E0E0;
+ border-right-color: #E0E0E0;
+ border-bottom-color: #E0E0E0;
+ border-left-color: #E0E0E0;
+ border-top-style: none;
+ border-right-style: none;
+ border-bottom-style: none;
+ border-left-style: none;
+ background-color: #FAFAFA;
+ font-size: 80%;
+}
+.memTemplParams {
+ padding: 1px 0px 0px 8px;
+ margin: 4px;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ border-top-color: #E0E0E0;
+ border-right-color: #E0E0E0;
+ border-bottom-color: #E0E0E0;
+ border-left-color: #E0E0E0;
+ border-top-style: solid;
+ border-right-style: none;
+ border-bottom-style: none;
+ border-left-style: none;
+ color: #606060;
+ background-color: #FAFAFA;
+ font-size: 80%;
+}
+.search { color: #003399;
font-weight: bold;
}
FORM.search {
@@ -178,7 +413,82 @@
INPUT.search { font-size: 75%;
color: #000080;
font-weight: normal;
- background-color: #eeeeff;
+ background-color: #e8eef2;
}
TD.tiny { font-size: 75%;
}
+
+.dirtab { padding: 4px;
+ border-collapse: collapse;
+ border: 1px solid #84b0c7;
+}
+TH.dirtab { background: #e8eef2;
+ font-weight: bold;
+}
+HR { height: 1px;
+ border: none;
+ border-top: 1px solid black;
+}
+
+/* Style for detailed member documentation */
+.memtemplate {
+ font-size: 80%;
+ color: #606060;
+ font-weight: normal;
+}
+.memnav {
+ background-color: #e8eef2;
+ border: 1px solid #84b0c7;
+ text-align: center;
+ margin: 2px;
+ margin-right: 15px;
+ padding: 2px;
+}
+.memitem {
+ padding: 4px;
+ background-color: #eef3f5;
+ border-width: 1px;
+ border-style: solid;
+ border-color: #dedeee;
+ -moz-border-radius: 8px 8px 8px 8px;
+}
+.memname {
+ white-space: nowrap;
+ font-weight: bold;
+}
+.memdoc{
+ padding-left: 10px;
+}
+.memproto {
+ background-color: #d5e1e8;
+ width: 100%;
+ border-width: 1px;
+ border-style: solid;
+ border-color: #84b0c7;
+ font-weight: bold;
+ -moz-border-radius: 8px 8px 8px 8px;
+}
+.paramkey {
+ text-align: right;
+}
+.paramtype {
+ white-space: nowrap;
+}
+.paramname {
+ color: #602020;
+ font-style: italic;
+ white-space: nowrap;
+}
+/* End Styling for detailed member documentation */
+
+/* for the tree view */
+.ftvtree {
+ font-family: sans-serif;
+ margin:0.5em;
+}
+.directory { font-size: 9pt; font-weight: bold; }
+.directory h3 { margin: 0px; margin-top: 1em; font-size: 11pt; }
+.directory > h3 { margin-top: 0; }
+.directory p { margin: 0px; white-space: nowrap; }
+.directory div { display: none; margin: 0px; }
+.directory img { vertical-align: -30%; }
Modified: haiku/trunk/docs/user/footer.html
===================================================================
--- haiku/trunk/docs/user/footer.html 2009-02-01 21:30:25 UTC (rev 29116)
+++ haiku/trunk/docs/user/footer.html 2009-02-01 21:44:07 UTC (rev 29117)
@@ -1,3 +1,4 @@
+
$projectname $projectnumber - $title
Modified: haiku/trunk/docs/user/header.html
===================================================================
--- haiku/trunk/docs/user/header.html 2009-02-01 21:30:25 UTC (rev 29116)
+++ haiku/trunk/docs/user/header.html 2009-02-01 21:44:07 UTC (rev 29117)
@@ -1,8 +1,12 @@
-
- $projectname: $title
+
+ $title
-
+
+
+
+
$title
+
From mmlr at mail.berlios.de Sun Feb 1 23:13:06 2009
From: mmlr at mail.berlios.de (mmlr at mail.berlios.de)
Date: Sun, 1 Feb 2009 23:13:06 +0100
Subject: [Haiku-commits] r29118 - in haiku/trunk: build/jam headers/os/app
headers/private/storage/sniffer src/kits/app
src/kits/interface src/kits/interface/textview_support
src/kits/storage src/kits/storage/disk_device
src/kits/storage/sniffer
Message-ID: <200902012213.n11MD6o2001641@sheep.berlios.de>
Author: mmlr
Date: 2009-02-01 23:12:55 +0100 (Sun, 01 Feb 2009)
New Revision: 29118
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29118&view=rev
Modified:
haiku/trunk/build/jam/BuildSetup
haiku/trunk/headers/os/app/PropertyInfo.h
haiku/trunk/headers/private/storage/sniffer/Parser.h
haiku/trunk/src/kits/app/Application.cpp
haiku/trunk/src/kits/app/Messenger.cpp
haiku/trunk/src/kits/app/PropertyInfo.cpp
haiku/trunk/src/kits/interface/ColorConversion.cpp
haiku/trunk/src/kits/interface/ListView.cpp
haiku/trunk/src/kits/interface/Menu.cpp
haiku/trunk/src/kits/interface/MenuItem.cpp
haiku/trunk/src/kits/interface/Slider.cpp
haiku/trunk/src/kits/interface/SplitLayout.cpp
haiku/trunk/src/kits/interface/Window.cpp
haiku/trunk/src/kits/interface/textview_support/TextGapBuffer.cpp
haiku/trunk/src/kits/storage/Entry.cpp
haiku/trunk/src/kits/storage/Path.cpp
haiku/trunk/src/kits/storage/PathMonitor.cpp
haiku/trunk/src/kits/storage/Resources.cpp
haiku/trunk/src/kits/storage/ResourcesContainer.cpp
haiku/trunk/src/kits/storage/Volume.cpp
haiku/trunk/src/kits/storage/disk_device/Partition.cpp
haiku/trunk/src/kits/storage/sniffer/Parser.cpp
Log:
* Resolve further warnings on GCC4.
* Enable -Werror on GCC4 builds as well (limited to the same selected targets).
Modified: haiku/trunk/build/jam/BuildSetup
===================================================================
--- haiku/trunk/build/jam/BuildSetup 2009-02-01 21:44:07 UTC (rev 29117)
+++ haiku/trunk/build/jam/BuildSetup 2009-02-01 22:12:55 UTC (rev 29118)
@@ -1033,15 +1033,12 @@
: $(scope) ;
}
} else {
-# TODO: Enable after updating to a newer gcc 4 version that supports -Wno-error!
# -Wuninitialized gives too many false positives.
-# rule EnableWerror dirTokens : scope {
-# AppendToConfigVar CCFLAGS : HAIKU_TOP $(dirTokens)
-# : -Werror -Wno-error=uninitialized : $(scope) ;
-# AppendToConfigVar C++FLAGS : HAIKU_TOP $(dirTokens)
-# : -Werror -Wno-error=uninitialized : $(scope) ;
-# }
rule EnableWerror dirTokens : scope {
+ AppendToConfigVar CCFLAGS : HAIKU_TOP $(dirTokens)
+ : -Werror -Wno-error=uninitialized : $(scope) ;
+ AppendToConfigVar C++FLAGS : HAIKU_TOP $(dirTokens)
+ : -Werror -Wno-error=uninitialized : $(scope) ;
}
}
Modified: haiku/trunk/headers/os/app/PropertyInfo.h
===================================================================
--- haiku/trunk/headers/os/app/PropertyInfo.h 2009-02-01 21:44:07 UTC (rev 29117)
+++ haiku/trunk/headers/os/app/PropertyInfo.h 2009-02-01 22:12:55 UTC (rev 29118)
@@ -42,7 +42,7 @@
struct compound_type {
struct field_pair {
#if __GNUC__ > 2
- const
+ const
#endif
char *name; // name of entry in message
type_code type; // type_code of entry in message
Modified: haiku/trunk/headers/private/storage/sniffer/Parser.h
===================================================================
--- haiku/trunk/headers/private/storage/sniffer/Parser.h 2009-02-01 21:44:07 UTC (rev 29117)
+++ haiku/trunk/headers/private/storage/sniffer/Parser.h 2009-02-01 22:12:55 UTC (rev 29118)
@@ -54,7 +54,7 @@
CharacterString,
Integer,
FloatingPoint
-};
+} TokenType;
/*! \brief Returns a NULL-terminated string contating the
name of the given token type
Modified: haiku/trunk/src/kits/app/Application.cpp
===================================================================
--- haiku/trunk/src/kits/app/Application.cpp 2009-02-01 21:44:07 UTC (rev 29117)
+++ haiku/trunk/src/kits/app/Application.cpp 2009-02-01 22:12:55 UTC (rev 29118)
@@ -1498,7 +1498,7 @@
uint32 count = gLooperList.CountLoopers();
for (uint32 i = 0; i < count && index < count; i++) {
BWindow* window = dynamic_cast(gLooperList.LooperAt(i));
- if (window == NULL || window != NULL && window->fOffscreen
+ if (window == NULL || (window != NULL && window->fOffscreen)
|| (!includeMenus && dynamic_cast(window) != NULL)) {
index++;
continue;
Modified: haiku/trunk/src/kits/app/Messenger.cpp
===================================================================
--- haiku/trunk/src/kits/app/Messenger.cpp 2009-02-01 21:44:07 UTC (rev 29117)
+++ haiku/trunk/src/kits/app/Messenger.cpp 2009-02-01 22:12:55 UTC (rev 29118)
@@ -572,11 +572,11 @@
// 3. fPreferredTarget
// fTeam is insignificant
return (a.Port() < b.Port()
- || a.Port() == b.Port()
+ || (a.Port() == b.Port()
&& (a.Token() < b.Token()
- || a.Token() == b.Token()
+ || (a.Token() == b.Token()
&& !a.IsPreferredTarget()
- && b.IsPreferredTarget()));
+ && b.IsPreferredTarget()))));
}
Modified: haiku/trunk/src/kits/app/PropertyInfo.cpp
===================================================================
--- haiku/trunk/src/kits/app/PropertyInfo.cpp 2009-02-01 21:44:07 UTC (rev 29117)
+++ haiku/trunk/src/kits/app/PropertyInfo.cpp 2009-02-01 22:12:55 UTC (rev 29118)
@@ -501,15 +501,15 @@
if (fPropInfo != NULL) {
for (i = 0; i < fPropCount; i++) {
- free(fPropInfo[i].name);
- free(fPropInfo[i].usage);
+ free((char *)fPropInfo[i].name);
+ free((char *)fPropInfo[i].usage);
for (j = 0; j < 3; j++) {
for (k = 0; k < 5; k++) {
if (fPropInfo[i].ctypes[j].pairs[k].name == NULL)
break;
- free(fPropInfo[i].ctypes[j].pairs[k].name);
+ free((char *)fPropInfo[i].ctypes[j].pairs[k].name);
}
if (fPropInfo[i].ctypes[j].pairs[0].name == NULL)
@@ -523,8 +523,8 @@
if (fValueInfo != NULL) {
for (i = 0; i < fValueCount; i++) {
- free(fValueInfo[i].name);
- free(fValueInfo[i].usage);
+ free((char *)fValueInfo[i].name);
+ free((char *)fValueInfo[i].usage);
}
free(fValueInfo);
fValueInfo = NULL;
Modified: haiku/trunk/src/kits/interface/ColorConversion.cpp
===================================================================
--- haiku/trunk/src/kits/interface/ColorConversion.cpp 2009-02-01 21:44:07 UTC (rev 29117)
+++ haiku/trunk/src/kits/interface/ColorConversion.cpp 2009-02-01 22:12:55 UTC (rev 29118)
@@ -250,7 +250,7 @@
uint8
PaletteConverter::IndexForRGB16(uint16 rgb) const
{
- return fColorMap->index_map[(rgb >> 1) & 0x7fe0 | rgb & 0x1f];
+ return fColorMap->index_map[((rgb >> 1) & 0x7fe0) | (rgb & 0x1f)];
}
@@ -487,7 +487,7 @@
void
WriteGray8(uint8 **dest, uint8 *data, int32 index)
{
- **dest = data[2] * 308 + data[1] * 600 + data[0] * 116 >> 10;
+ **dest = (data[2] * 308 + data[1] * 600 + data[0] * 116) >> 10;
// this would boost the speed but is less accurate:
//*dest = (data[2] << 8) + (data[1] << 9) + (data[0] << 8) >> 10;
(*dest)++;
@@ -584,9 +584,9 @@
}
srcBits = (srcByte*)((uint8*)srcBits + (srcOffsetY * srcBitsPerRow + srcOffsetX
- * srcBitsPerPixel >> 3));
+ * (srcBitsPerPixel >> 3)));
dstBits = (dstByte*)((uint8*)dstBits + (dstOffsetY * dstBitsPerRow + dstOffsetX
- * dstBitsPerPixel >> 3));
+ * (dstBitsPerPixel >> 3)));
// Ensure that the width fits
int32 srcWidth = (srcBitsPerRow - srcOffsetX * srcBitsPerPixel)
Modified: haiku/trunk/src/kits/interface/ListView.cpp
===================================================================
--- haiku/trunk/src/kits/interface/ListView.cpp 2009-02-01 21:44:07 UTC (rev 29117)
+++ haiku/trunk/src/kits/interface/ListView.cpp 2009-02-01 22:12:55 UTC (rev 29118)
@@ -1527,7 +1527,7 @@
bool
BListView::_TryInitiateDrag(BPoint where)
{
- if (!fTrack->try_drag | fTrack->item_index < 0)
+ if (!fTrack->try_drag || fTrack->item_index < 0)
return false;
BPoint offset = where - fTrack->drag_start;
Modified: haiku/trunk/src/kits/interface/Menu.cpp
===================================================================
--- haiku/trunk/src/kits/interface/Menu.cpp 2009-02-01 21:44:07 UTC (rev 29117)
+++ haiku/trunk/src/kits/interface/Menu.cpp 2009-02-01 22:12:55 UTC (rev 29118)
@@ -2626,8 +2626,8 @@
// TODO: I added the check for BMenuBar to solve a problem with Deskbar.
// BeOS seems to do something similar. This could also be a bug in Deskbar, though.
if ((buttons != 0 && stickyMode)
- || (dynamic_cast(this) == NULL
- && (buttons == 0 && !stickyMode) || _HitTestItems(where) != item))
+ || ((dynamic_cast(this) == NULL
+ && (buttons == 0 && !stickyMode)) || _HitTestItems(where) != item))
return false;
return true;
Modified: haiku/trunk/src/kits/interface/MenuItem.cpp
===================================================================
--- haiku/trunk/src/kits/interface/MenuItem.cpp 2009-02-01 21:44:07 UTC (rev 29117)
+++ haiku/trunk/src/kits/interface/MenuItem.cpp 2009-02-01 22:12:55 UTC (rev 29118)
@@ -755,7 +755,7 @@
where.x -= fBounds.Height() - 3;
const float ascent = MenuPrivate(fSuper).Ascent();
- if (fShortcutChar < B_SPACE && kUTF8ControlMap[fShortcutChar])
+ if (fShortcutChar < B_SPACE && kUTF8ControlMap[(int)fShortcutChar])
_DrawControlChar(fShortcutChar, where + BPoint(0, ascent));
else
fSuper->DrawChar(fShortcutChar, where + BPoint(0, ascent));
@@ -849,8 +849,8 @@
// TODO: If needed, take another font for the control characters
// (or have font overlays in the app_server!)
const char* symbol = " ";
- if (kUTF8ControlMap[fShortcutChar])
- symbol = kUTF8ControlMap[fShortcutChar];
+ if (kUTF8ControlMap[(int)fShortcutChar])
+ symbol = kUTF8ControlMap[(int)fShortcutChar];
fSuper->DrawString(symbol, where);
}
Modified: haiku/trunk/src/kits/interface/Slider.cpp
===================================================================
--- haiku/trunk/src/kits/interface/Slider.cpp 2009-02-01 21:44:07 UTC (rev 29117)
+++ haiku/trunk/src/kits/interface/Slider.cpp 2009-02-01 22:12:55 UTC (rev 29118)
@@ -874,10 +874,12 @@
barColor.red = (fBarColor.red + no_tint.red) / 2;
barColor.green = (fBarColor.green + no_tint.green) / 2;
barColor.blue = (fBarColor.blue + no_tint.blue) / 2;
+ barColor.alpha = 255;
fillColor.red = (fFillColor.red + no_tint.red) / 2;
fillColor.green = (fFillColor.green + no_tint.green) / 2;
fillColor.blue = (fFillColor.blue + no_tint.blue) / 2;
+ fillColor.alpha = 255;
}
// exclude the block thumb from the bar filling
@@ -1172,8 +1174,8 @@
const char* oldUpdateText = fUpdateText;
fUpdateText = UpdateText();
- bool updateTextOnOff = fUpdateText == NULL && oldUpdateText != NULL
- || fUpdateText != NULL && oldUpdateText == NULL;
+ bool updateTextOnOff = (fUpdateText == NULL && oldUpdateText != NULL)
+ || (fUpdateText != NULL && oldUpdateText == NULL);
float newWidth = 0.0;
if (fUpdateText != NULL)
Modified: haiku/trunk/src/kits/interface/SplitLayout.cpp
===================================================================
--- haiku/trunk/src/kits/interface/SplitLayout.cpp 2009-02-01 21:44:07 UTC (rev 29117)
+++ haiku/trunk/src/kits/interface/SplitLayout.cpp 2009-02-01 22:12:55 UTC (rev 29118)
@@ -563,8 +563,8 @@
// Things shouldn't be draggable, if we have a >= max layout.
BSize size = _SubtractInsets(View()->Frame().Size());
- if (fOrientation == B_HORIZONTAL && size.width >= fMax.width
- || fOrientation == B_VERTICAL && size.height >= fMax.height) {
+ if ((fOrientation == B_HORIZONTAL && size.width >= fMax.width)
+ || (fOrientation == B_VERTICAL && size.height >= fMax.height)) {
return false;
}
@@ -1133,8 +1133,8 @@
BSplitLayout::_InternalGetHeightForWidth(float width, bool realLayout,
float* minHeight, float* maxHeight, float* preferredHeight)
{
- if (realLayout && fHeightForWidthVerticalLayouterWidth != width
- || !realLayout && fCachedHeightForWidthWidth != width) {
+ if ((realLayout && fHeightForWidthVerticalLayouterWidth != width)
+ || (!realLayout && fCachedHeightForWidthWidth != width)) {
// The general strategy is to clone the vertical layouter, which only
// knows the general min/max constraints, do a horizontal layout for the
// given width, and add the children's height for width constraints to
Modified: haiku/trunk/src/kits/interface/Window.cpp
===================================================================
--- haiku/trunk/src/kits/interface/Window.cpp 2009-02-01 21:44:07 UTC (rev 29117)
+++ haiku/trunk/src/kits/interface/Window.cpp 2009-02-01 22:12:55 UTC (rev 29118)
@@ -1595,7 +1595,7 @@
BWindow::SetPulseRate(bigtime_t rate)
{
// TODO: What about locking?!?
- if (rate < 0 || (rate == fPulseRate && !(rate == 0 ^ fPulseRunner == NULL)))
+ if (rate < 0 || (rate == fPulseRate && !((rate == 0) ^ (fPulseRunner == NULL))))
return;
fPulseRate = rate;
Modified: haiku/trunk/src/kits/interface/textview_support/TextGapBuffer.cpp
===================================================================
--- haiku/trunk/src/kits/interface/textview_support/TextGapBuffer.cpp 2009-02-01 21:44:07 UTC (rev 29117)
+++ haiku/trunk/src/kits/interface/textview_support/TextGapBuffer.cpp 2009-02-01 22:12:55 UTC (rev 29118)
@@ -172,7 +172,7 @@
const char *
TextGapBuffer::GetString(int32 fromOffset, int32 *_numBytes)
{
- char *result = "";
+ char *result = (char *)"";
if (_numBytes == NULL)
return result;
Modified: haiku/trunk/src/kits/storage/Entry.cpp
===================================================================
--- haiku/trunk/src/kits/storage/Entry.cpp 2009-02-01 21:44:07 UTC (rev 29117)
+++ haiku/trunk/src/kits/storage/Entry.cpp 2009-02-01 22:12:55 UTC (rev 29118)
@@ -135,8 +135,8 @@
return (device == ref.device
&& directory == ref.directory
&& (name == ref.name
- || name != NULL && ref.name != NULL
- && strcmp(name, ref.name) == 0));
+ || (name != NULL && ref.name != NULL
+ && strcmp(name, ref.name) == 0)));
}
/*! \brief Compares the entry_ref with another entry_ref, returning true if they are not equal.
@@ -1095,11 +1095,7 @@
|| (a.device == b.device
&& (a.directory < b.directory
|| (a.directory == b.directory
- && (a.name == NULL && b.name != NULL
+ && ((a.name == NULL && b.name != NULL)
|| (a.name != NULL && b.name != NULL
&& strcmp(a.name, b.name) < 0))))));
}
-
-
-
-
Modified: haiku/trunk/src/kits/storage/Path.cpp
===================================================================
--- haiku/trunk/src/kits/storage/Path.cpp 2009-02-01 21:44:07 UTC (rev 29117)
+++ haiku/trunk/src/kits/storage/Path.cpp 2009-02-01 22:12:55 UTC (rev 29118)
@@ -390,8 +390,8 @@
bool
BPath::operator==(const char *path) const
{
- return (InitCheck() != B_OK && path == NULL
- || fName && path && strcmp(fName, path) == 0);
+ return ((InitCheck() != B_OK && path == NULL)
+ || (fName != NULL && path != NULL && strcmp(fName, path) == 0));
}
//! Performs a simple (string-wise) comparison of paths.
Modified: haiku/trunk/src/kits/storage/PathMonitor.cpp
===================================================================
--- haiku/trunk/src/kits/storage/PathMonitor.cpp 2009-02-01 21:44:07 UTC (rev 29117)
+++ haiku/trunk/src/kits/storage/PathMonitor.cpp 2009-02-01 22:12:55 UTC (rev 29118)
@@ -359,8 +359,8 @@
}
// a new directory to watch for us
- if (!entryContained && !_CloserToPath(entry)
- || parentContained && !_WatchRecursively()
+ if ((!entryContained && !_CloserToPath(entry))
+ || (parentContained && !_WatchRecursively())
|| _AddDirectory(entry, true) != B_OK
|| _WatchFilesOnly())
notify = parentContained;
@@ -446,7 +446,7 @@
&& (entryContained || _CloserToPath(entry))) {
// there is a new directory to watch for us
if (entryContained
- || parentContained && !_WatchRecursively()) {
+ || (parentContained && !_WatchRecursively())) {
_AddDirectory(entry, true);
// NOTE: entry is toast now!
} else if (_GetClosest(fPath.Path(), false,
Modified: haiku/trunk/src/kits/storage/Resources.cpp
===================================================================
--- haiku/trunk/src/kits/storage/Resources.cpp 2009-02-01 21:44:07 UTC (rev 29117)
+++ haiku/trunk/src/kits/storage/Resources.cpp 2009-02-01 22:12:55 UTC (rev 29118)
@@ -288,10 +288,10 @@
int32 cookie = 0;
while (get_next_image_info(B_CURRENT_TEAM, &cookie, &info) == B_OK) {
- if ((addr_t)info.text <= address
- && address - (addr_t)info.text < (addr_t)info.text_size
- || (addr_t)info.data <= address
- && address - (addr_t)info.data < (addr_t)info.data_size) {
+ if (((addr_t)info.text <= address
+ && address - (addr_t)info.text < (addr_t)info.text_size)
+ || ((addr_t)info.data <= address
+ && address - (addr_t)info.data < (addr_t)info.data_size)) {
return SetTo(info.name, clobber);
}
}
Modified: haiku/trunk/src/kits/storage/ResourcesContainer.cpp
===================================================================
--- haiku/trunk/src/kits/storage/ResourcesContainer.cpp 2009-02-01 21:44:07 UTC (rev 29117)
+++ haiku/trunk/src/kits/storage/ResourcesContainer.cpp 2009-02-01 22:12:55 UTC (rev 29118)
@@ -143,9 +143,9 @@
for (int32 i = 0; index == -1 && i < count; i++) {
ResourceItem *item = ResourceAt(i);
const char *itemName = item->Name();
- if (item->Type() == type && (name == NULL && itemName == NULL
- || name != NULL && itemName != NULL
- && !strcmp(name, itemName))) {
+ if (item->Type() == type && ((name == NULL && itemName == NULL)
+ || (name != NULL && itemName != NULL
+ && strcmp(name, itemName) == 0))) {
index = i;
}
}
Modified: haiku/trunk/src/kits/storage/Volume.cpp
===================================================================
--- haiku/trunk/src/kits/storage/Volume.cpp 2009-02-01 21:44:07 UTC (rev 29117)
+++ haiku/trunk/src/kits/storage/Volume.cpp 2009-02-01 22:12:55 UTC (rev 29118)
@@ -493,7 +493,7 @@
bool
BVolume::operator==(const BVolume &volume) const
{
- return (InitCheck() != B_OK && volume.InitCheck() != B_OK
+ return ((InitCheck() != B_OK && volume.InitCheck() != B_OK)
|| fDevice == volume.fDevice);
}
Modified: haiku/trunk/src/kits/storage/disk_device/Partition.cpp
===================================================================
--- haiku/trunk/src/kits/storage/disk_device/Partition.cpp 2009-02-01 21:44:07 UTC (rev 29117)
+++ haiku/trunk/src/kits/storage/disk_device/Partition.cpp 2009-02-01 22:12:55 UTC (rev 29118)
@@ -1543,7 +1543,7 @@
bool
BPartition::_SupportsChildOperation(const BPartition* child, uint32 flag) const
{
- if (!fDelegate || child && !child->fDelegate)
+ if (!fDelegate || (child && !child->fDelegate))
return false;
uint32 supported = fDelegate->SupportedChildOperations(
Modified: haiku/trunk/src/kits/storage/sniffer/Parser.cpp
===================================================================
--- haiku/trunk/src/kits/storage/sniffer/Parser.cpp 2009-02-01 21:44:07 UTC (rev 29117)
+++ haiku/trunk/src/kits/storage/sniffer/Parser.cpp 2009-02-01 22:12:55 UTC (rev 29118)
@@ -260,7 +260,7 @@
tsssEscapeOneOctal,
tsssEscapeTwoOctal,
tsssEscapeOneHex,
- };
+ } TokenStreamScannerState;
TokenStreamScannerState state = tsssStart;
TokenStreamScannerState escapedState = tsssStart;
From stippi at mail.berlios.de Sun Feb 1 23:15:30 2009
From: stippi at mail.berlios.de (stippi at mail.berlios.de)
Date: Sun, 1 Feb 2009 23:15:30 +0100
Subject: [Haiku-commits] r29119 - haiku/trunk/src/tests/kits/interface/look
Message-ID: <200902012215.n11MFUxs001834@sheep.berlios.de>
Author: stippi
Date: 2009-02-01 23:15:16 +0100 (Sun, 01 Feb 2009)
New Revision: 29119
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29119&view=rev
Modified:
haiku/trunk/src/tests/kits/interface/look/Look.cpp
Log:
Get a lot more views and controls on display.
Modified: haiku/trunk/src/tests/kits/interface/look/Look.cpp
===================================================================
--- haiku/trunk/src/tests/kits/interface/look/Look.cpp 2009-02-01 22:12:55 UTC (rev 29118)
+++ haiku/trunk/src/tests/kits/interface/look/Look.cpp 2009-02-01 22:15:16 UTC (rev 29119)
@@ -13,13 +13,16 @@
#include
#include
#include
+#include
#include
#include
#include
+#include
#include
#include
#include
#include
+#include
#include
#include
#include
@@ -46,6 +49,75 @@
}
+void
+add_menu_fields(BGridLayout* layout, int32& row)
+{
+ BPopUpMenu* menu1 = new BPopUpMenu("Selection");
+ BMenuField* control1 = new BMenuField("Enabled", menu1, NULL);
+ BPopUpMenu* menu2 = new BPopUpMenu("Selection");
+ BMenuField* control2 = new BMenuField("Disabled", menu2, NULL);
+ control2->SetEnabled(false);
+
+ layout->AddView(BGroupLayoutBuilder(B_HORIZONTAL, 5)
+ .Add(control1)
+ .Add(control2), 0, row, 3);
+
+ row++;
+}
+
+
+void
+add_text_controls(BGridLayout* layout, int32& row)
+{
+ BTextControl* control1 = new BTextControl("Enabled", "Some Text", NULL);
+ BTextControl* control2 = new BTextControl("Disabled", "More Text", NULL);
+ control2->SetEnabled(false);
+
+ layout->AddView(BGroupLayoutBuilder(B_HORIZONTAL, 5)
+ .Add(control1)
+ .Add(control2), 0, row, 3);
+
+ row++;
+}
+
+
+void
+add_sliders(BGridLayout* layout, int32& row)
+{
+ BSlider* control1 = new BSlider("slider 1", "Enabled", NULL, 1, 100,
+ B_HORIZONTAL);
+ BSlider* control2 = new BSlider("slider 2", "Disabled", NULL, 1, 100,
+ B_HORIZONTAL);
+ control2->SetEnabled(false);
+
+ control1->SetHashMarkCount(10);
+ control1->SetHashMarks(B_HASH_MARKS_BOTTOM);
+ control2->SetHashMarkCount(10);
+ control2->SetHashMarks(B_HASH_MARKS_BOTTOM);
+
+ layout->AddView(BGroupLayoutBuilder(B_HORIZONTAL, 5)
+ .Add(control1)
+ .Add(control2), 0, row, 3);
+
+ row++;
+
+ control1 = new BSlider("slider 3", "Enabled", NULL, 1, 100,
+ B_HORIZONTAL, B_TRIANGLE_THUMB);
+ control2 = new BSlider("slider 4", "Disabled", NULL, 1, 100,
+ B_HORIZONTAL, B_TRIANGLE_THUMB);
+ control2->SetEnabled(false);
+
+ control1->SetLimitLabels("Min", "Max");
+ control2->SetLimitLabels("1", "100");
+
+ layout->AddView(BGroupLayoutBuilder(B_HORIZONTAL, 5)
+ .Add(control1)
+ .Add(control2), 0, row, 3);
+
+ row++;
+}
+
+
int
main(int argc, char** argv)
{
@@ -60,18 +132,81 @@
// create some controls
- BGridView* view = new BGridView(5.0f, 5.0f);
- BGridLayout* layout = view->GridLayout();
- layout->SetInsets(5, 5, 5, 5);
- view->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNLIMITED));
+ BListView* listView = new BListView();
+ listView->AddItem(new BStringItem("List Item 1"));
+ listView->AddItem(new BStringItem("List Item 2"));
+ BScrollView* scrollView = new BScrollView("scroller", listView, 0,
+ true, true);
+ scrollView->SetExplicitMinSize(BSize(300, 80));
+ BGridView* controls = new BGridView(5.0f, 5.0f);
+ BGridLayout* layout = controls->GridLayout();
+ controls->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNLIMITED));
+
int32 row = 0;
add_controls(layout, row);
add_controls(layout, row);
add_controls(layout, row);
+ add_menu_fields(layout, row);
+ add_text_controls(layout, row);
+ add_sliders(layout, row);
- window->AddChild(view);
+ BStatusBar* statusBar = new BStatusBar("status bar", "Status",
+ "Completed");
+ statusBar->SetMaxValue(100);
+ statusBar->SetTo(40);
+ statusBar->SetBarHeight(12);
+ layout->AddView(statusBar, 0, row, 3);
+ row++;
+
+ BColorControl* colorControl = new BColorControl(B_ORIGIN, B_CELLS_32x8,
+ 8.0f, "color control");
+ layout->AddView(colorControl, 0, row, 3);
+
+ BTabView* tabView = new BTabView("tab view", B_WIDTH_FROM_WIDEST);
+ BView* content = BGroupLayoutBuilder(B_VERTICAL, 5)
+ .Add(scrollView)
+ .Add(controls)
+ .SetInsets(5, 5, 5, 5);
+
+ content->SetName("Tab 1");
+
+ tabView->AddTab(content);
+ tabView->AddTab(new BView("Tab 2", 0));
+ tabView->AddTab(new BView("Tab 3", 0));
+
+ BMenuBar* menuBar = new BMenuBar("menu bar");
+ BMenu* menu = new BMenu("File");
+ BMenuItem* item = new BMenuItem("Quit", new BMessage(B_QUIT_REQUESTED));
+ menu->AddItem(item);
+ menuBar->AddItem(menu);
+ menu = new BMenu("Edit");
+ menu->SetEnabled(false);
+ menu->AddItem(new BMenuItem("Cut", NULL));
+ menu->AddItem(new BMenuItem("Copy", NULL));
+ menu->AddSeparatorItem();
+ menu->AddItem(new BMenuItem("Past", NULL));
+ menuBar->AddItem(menu);
+
+ BButton* okButton = new BButton("Ok", new BMessage(B_QUIT_REQUESTED));
+
+ window->AddChild(BGroupLayoutBuilder(B_VERTICAL)
+ .Add(menuBar)
+ .Add(BGroupLayoutBuilder(B_VERTICAL, 5)
+ .Add(tabView)
+ .Add(BGroupLayoutBuilder(B_HORIZONTAL, 5)
+ .Add(new BButton("Revert", NULL))
+ .Add(BSpaceLayoutItem::CreateGlue())
+ .Add(new BButton("Cancel", NULL))
+ .Add(okButton)
+ )
+ .SetInsets(5, 5, 5, 5)
+ )
+ );
+
+ window->SetDefaultButton(okButton);
+
window->Show();
app.Run();
return 0;
From mmlr at mail.berlios.de Sun Feb 1 23:16:50 2009
From: mmlr at mail.berlios.de (mmlr at mail.berlios.de)
Date: Sun, 1 Feb 2009 23:16:50 +0100
Subject: [Haiku-commits] r29120 - haiku/trunk/src/kits/media
Message-ID: <200902012216.n11MGopq001901@sheep.berlios.de>
Author: mmlr
Date: 2009-02-01 23:16:49 +0100 (Sun, 01 Feb 2009)
New Revision: 29120
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29120&view=rev
Modified:
haiku/trunk/src/kits/media/SoundPlayer.cpp
Log:
Fix wrong check.
Modified: haiku/trunk/src/kits/media/SoundPlayer.cpp
===================================================================
--- haiku/trunk/src/kits/media/SoundPlayer.cpp 2009-02-01 22:15:16 UTC (rev 29119)
+++ haiku/trunk/src/kits/media/SoundPlayer.cpp 2009-02-01 22:16:49 UTC (rev 29120)
@@ -80,7 +80,7 @@
TRACE("BSoundPlayer::BSoundPlayer: multi audio format constructor used\n");
- if (toNode.kind & B_BUFFER_CONSUMER == 0)
+ if ((toNode.kind & B_BUFFER_CONSUMER) == 0)
debugger("BSoundPlayer: toNode must have B_BUFFER_CONSUMER kind!\n");
#if DEBUG > 0
From axeld at pinc-software.de Sun Feb 1 23:22:43 2009
From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=)
Date: Sun, 01 Feb 2009 23:22:43 +0100 CET
Subject: [Haiku-commits] r29114 - haiku/trunk/headers/os/app
In-Reply-To: <200902012102.n11L2axA029394@sheep.berlios.de>
Message-ID: <12825333406-BeMail@zon>
anevilyak at BerliOS wrote:
> Log:
> On gcc4 these need to be declared const. Otherwise any and every app
> that
> simply sets up a bunch of property_info structs for its scripting
> directives triggers
> many many warnings with respect to deprecated string constant
> conversions.
Since those are just structures, why would it hurt to make them const
with GCC2, too?
Bye,
Axel.
From anevilyak at gmail.com Sun Feb 1 23:24:19 2009
From: anevilyak at gmail.com (Rene Gollent)
Date: Sun, 1 Feb 2009 16:24:19 -0600
Subject: [Haiku-commits] r29114 - haiku/trunk/headers/os/app
In-Reply-To: <12825333406-BeMail@zon>
References: <200902012102.n11L2axA029394@sheep.berlios.de>
<12825333406-BeMail@zon>
Message-ID:
On Sun, Feb 1, 2009 at 4:22 PM, Axel D?rfler wrote:
> Since those are just structures, why would it hurt to make them const
> with GCC2, too?
Michael and I were uncertain if they'd be affected by name mangling or
not, as they're not extern "C"'d or anything, so I thought better safe
than sorry.
Regards,
Rene
From axeld at pinc-software.de Sun Feb 1 23:36:47 2009
From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=)
Date: Sun, 01 Feb 2009 23:36:47 +0100 CET
Subject: [Haiku-commits]
=?utf-8?q?r29113_-_in_haiku/trunk=3A_headers/os/d?=
=?utf-8?q?rivers_headers/private/kernel/util_src/bin/makebootable/platfor?=
=?utf-8?q?m/bios=5Fia32_src/system/kernel_src/system/kernel/arch/x86_src/?=
=?utf-8?q?system/kernel/cache_src/system/kernel/debug_src/system/kernel/d?=
=?utf-8?q?evice=5Fmanager_src/system/kernel/fs__src/system/kernel/slab_sr?=
=?utf-8?q?c/system/kernel/vm?=
In-Reply-To: <200902012048.n11KmF9e028270@sheep.berlios.de>
Message-ID: <13669650853-BeMail@zon>
mmlr at mail.berlios.de wrote:
> * Replaced the use of offsetof() for structs that aren't PODs. Add a
> offset_of_member() macro to util/khash.h because that's what it's
> used for
> in our cases.
Are you sure you cannot trick the compiler by using a cast to NULL or 1
or a similar bogus value? It's pretty ugly to need to create
potentially heavy objects on the stack just for that.
If that's really not possible, we should still remove that macro and
use C++ only for those things (like class OpenHashTable over the khash
stuff).
> * Change the signature of add_debugger_command()/
> remove_debugger_command() on
> GCC > 2 to avoid the depricated conversion from string constants to
> char *.
Since this is just a C function, why can't we just change it's
signature for all compilers? "char*" doesn't make more sense there with
GCC2.
> * Adding some "suggested" parenthesis. I know that not everyone likes
> that, but
> it pointed out at least one bug that is fixed here as well.
[...]
> +++ haiku/trunk/src/system/kernel/vm/VMAnonymousCache.cpp 2009-02-01
> 20:48:02 UTC (rev 29113)
> @@ -611,7 +611,7 @@
> - WriteCallback* callback = (flags & B_VIP_IO_REQUEST != 0)
> + WriteCallback* callback = (flags & B_VIP_IO_REQUEST) != 0
The above is the only potential problem I spotted, but it would be *
very* helpful if you could mention what exactly you fixed in your
commit message :-)
Bye,
Axel.
From mmlr at mlotz.ch Sun Feb 1 23:53:35 2009
From: mmlr at mlotz.ch (Michael Lotz)
Date: Sun, 1 Feb 2009 23:53:35 +0100
Subject: [Haiku-commits] r29113 - in haiku/trunk: headers/os/drivers
headers/private/kernel/util
src/bin/makebootable/platform/bios_ia32 src/system/kernel
src/system/kernel/arch/x86 src/system/kernel/cache
src/system/kernel/debug src/system/kernel/device_manager
src/system/kernel/fs src/system/kernel/slab src/system/kernel/vm
In-Reply-To: <13669650853-BeMail@zon>
References: <200902012048.n11KmF9e028270@sheep.berlios.de>
<13669650853-BeMail@zon>
Message-ID: <20090201224854.M88470@mlotz.ch>
On Sun, 01 Feb 2009 23:36:47 +0100 CET, Axel D?rfler wrote
> mmlr at mail.berlios.de wrote:
>> * Replaced the use of offsetof() for structs that aren't PODs. Add a
>> offset_of_member() macro to util/khash.h because that's what it's
>> used for
>> in our cases.
>
> Are you sure you cannot trick the compiler by using a cast to NULL
> or 1 or a similar bogus value? It's pretty ugly to need to create
> potentially heavy objects on the stack just for that. If that's
> really not possible, we should still remove that macro and use C++
> only for those things (like class OpenHashTable over the khash stuff).
The thing is that it explicitly states that it can't do that for a NULL
object. I guess you could trick it somehow, but since these things are done
only on hash_init() or list_init() I deemed it acceptable to create a
temporary object on the stack. It'd certainly be cleaner to not require that
at all by using the templated classes. Feel free to rework ;-)
>> * Change the signature of add_debugger_command()/
>> remove_debugger_command() on
>> GCC > 2 to avoid the depricated conversion from string constants to
>> char *.
>
> Since this is just a C function, why can't we just change it's
> signature for all compilers? "char*" doesn't make more sense there
> with GCC2.
I didn't want to touch it because of binary compatibility concerns. But now
that you point it out it won't be affected of course. Will change that to
always just be const char *.
>> * Adding some "suggested" parenthesis. I know that not everyone likes
>> that, but
>> it pointed out at least one bug that is fixed here as well.
>[...]
>> +++ haiku/trunk/src/system/kernel/vm/VMAnonymousCache.cpp 2009-02-01
>> 20:48:02 UTC (rev 29113)
>> @@ -611,7 +611,7 @@
>> - WriteCallback* callback = (flags & B_VIP_IO_REQUEST != 0)
>> + WriteCallback* callback = (flags & B_VIP_IO_REQUEST) != 0
>
> The above is the only potential problem I spotted, but it would be *
> very* helpful if you could mention what exactly you fixed in your
> commit message :-)
Hehe, yeah I'm usually a fan of that as well. Sorry about that, it got lost
among the other changes.
Regards
Michael
From mmlr at mail.berlios.de Mon Feb 2 00:25:04 2009
From: mmlr at mail.berlios.de (mmlr at mail.berlios.de)
Date: Mon, 2 Feb 2009 00:25:04 +0100
Subject: [Haiku-commits] r29121 - in haiku/trunk/src: add-ons/kernel/cpu/x86
add-ons/kernel/drivers/audio/echo
add-ons/kernel/network/protocols/udp
add-ons/print/drivers/pdf/source add-ons/translators/tga
apps/deskcalc bin/screen_blanker preferences/screen
system/boot/loader/file_systems/fat
Message-ID: <200902012325.n11NP47k006210@sheep.berlios.de>
Author: mmlr
Date: 2009-02-02 00:24:55 +0100 (Mon, 02 Feb 2009)
New Revision: 29121
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29121&view=rev
Modified:
haiku/trunk/src/add-ons/kernel/cpu/x86/generic_x86.cpp
haiku/trunk/src/add-ons/kernel/drivers/audio/echo/multi.cpp
haiku/trunk/src/add-ons/kernel/network/protocols/udp/udp.cpp
haiku/trunk/src/add-ons/print/drivers/pdf/source/PDFWriter.cpp
haiku/trunk/src/add-ons/translators/tga/TGATranslator.cpp
haiku/trunk/src/apps/deskcalc/CalcView.cpp
haiku/trunk/src/bin/screen_blanker/ScreenBlanker.cpp
haiku/trunk/src/preferences/screen/ScreenMode.cpp
haiku/trunk/src/system/boot/loader/file_systems/fat/Directory.cpp
haiku/trunk/src/system/boot/loader/file_systems/fat/Volume.cpp
Log:
Fix more operator precedence errors. These do not do what you'd expect at first
sight. The comparison operator takes precedence over the binary ones.
Modified: haiku/trunk/src/add-ons/kernel/cpu/x86/generic_x86.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/cpu/x86/generic_x86.cpp 2009-02-01 22:16:49 UTC (rev 29120)
+++ haiku/trunk/src/add-ons/kernel/cpu/x86/generic_x86.cpp 2009-02-01 23:24:55 UTC (rev 29121)
@@ -139,7 +139,7 @@
cpuid_info cpuInfo;
if (get_current_cpuid(&cpuInfo, 0x80000000) == B_OK
- && cpuInfo.eax_0.max_eax & 0xff >= 8) {
+ && (cpuInfo.eax_0.max_eax & 0xff) >= 8) {
get_current_cpuid(&cpuInfo, 0x80000008);
bits = cpuInfo.regs.eax & 0xff;
Modified: haiku/trunk/src/add-ons/kernel/drivers/audio/echo/multi.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/drivers/audio/echo/multi.cpp 2009-02-01 22:16:49 UTC (rev 29120)
+++ haiku/trunk/src/add-ons/kernel/drivers/audio/echo/multi.cpp 2009-02-01 23:24:55 UTC (rev 29121)
@@ -740,7 +740,7 @@
if ((stream->state & ECHO_STATE_STARTED) != 0)
continue;
echo_stream_start(stream,
- (stream->use & ECHO_USE_PLAY == 0) ? echo_record_inth : echo_play_inth, stream);
+ ((stream->use & ECHO_USE_PLAY) == 0) ? echo_record_inth : echo_play_inth, stream);
}
if (acquire_sem_etc(card->buffer_ready_sem, 1, B_RELATIVE_TIMEOUT | B_CAN_INTERRUPT, 50000)
Modified: haiku/trunk/src/add-ons/kernel/network/protocols/udp/udp.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/network/protocols/udp/udp.cpp 2009-02-01 22:16:49 UTC (rev 29120)
+++ haiku/trunk/src/add-ons/kernel/network/protocols/udp/udp.cpp 2009-02-01 23:24:55 UTC (rev 29121)
@@ -389,14 +389,14 @@
if (otherEndpoint->LocalAddress().EqualPorts(address)) {
// port is already bound, SO_REUSEADDR or SO_REUSEPORT is required:
- if (otherEndpoint->Socket()->options & (SO_REUSEADDR | SO_REUSEPORT) == 0
- || socketOptions & (SO_REUSEADDR | SO_REUSEPORT) == 0)
+ if ((otherEndpoint->Socket()->options & (SO_REUSEADDR | SO_REUSEPORT)) == 0
+ || (socketOptions & (SO_REUSEADDR | SO_REUSEPORT)) == 0)
return EADDRINUSE;
// if both addresses are the same, SO_REUSEPORT is required:
if (otherEndpoint->LocalAddress().EqualTo(address, false)
- && (otherEndpoint->Socket()->options & SO_REUSEPORT == 0
- || socketOptions & SO_REUSEPORT == 0))
+ && ((otherEndpoint->Socket()->options & SO_REUSEPORT) == 0
+ || (socketOptions & SO_REUSEPORT) == 0))
return EADDRINUSE;
}
}
Modified: haiku/trunk/src/add-ons/print/drivers/pdf/source/PDFWriter.cpp
===================================================================
--- haiku/trunk/src/add-ons/print/drivers/pdf/source/PDFWriter.cpp 2009-02-01 22:16:49 UTC (rev 29120)
+++ haiku/trunk/src/add-ons/print/drivers/pdf/source/PDFWriter.cpp 2009-02-01 23:24:55 UTC (rev 29121)
@@ -746,7 +746,7 @@
for (int8 y = 0; y <= 7; y ++, data ++) {
uint8 d = *data;
for (int8 x = 0; x <= 7; x ++, d >>= 1) {
- if (d & 1 == 1) { // foreground
+ if ((d & 1) == 1) { // foreground
if (pass != kPassForeground) continue;
} else { // background
if (pass != kPassBackground) continue;
@@ -1059,7 +1059,7 @@
// 01234567 01234567
// 01201234 00123434
// GGGBBBBB ARRRRRGG
- return in[1] & 1 == 0 || IsTransparentRGB15(in);
+ return (in[1] & 1) == 0 || IsTransparentRGB15(in);
}
@@ -1070,7 +1070,7 @@
// 01234567 01234567
// 00123434 01201234
// ARRRRRGG GGGBBBBB
- return in[0] & 1 == 0 || IsTransparentRGB15_BIG(in);
+ return (in[0] & 1) == 0 || IsTransparentRGB15_BIG(in);
}
Modified: haiku/trunk/src/add-ons/translators/tga/TGATranslator.cpp
===================================================================
--- haiku/trunk/src/add-ons/translators/tga/TGATranslator.cpp 2009-02-01 22:16:49 UTC (rev 29120)
+++ haiku/trunk/src/add-ons/translators/tga/TGATranslator.cpp 2009-02-01 23:24:55 UTC (rev 29121)
@@ -328,7 +328,7 @@
imagespec.descriptor = buf[17];
// images ordered from Right to Left (rather than Left to Right)
// are not supported
- if (imagespec.descriptor & TGA_ORIGIN_HORZ_BIT == TGA_ORIGIN_RIGHT)
+ if ((imagespec.descriptor & TGA_ORIGIN_HORZ_BIT) == TGA_ORIGIN_RIGHT)
return B_NO_TRANSLATOR;
// unused descriptor bits, these bits must be zero
if (imagespec.descriptor & TGA_DESC_BITS76)
@@ -336,23 +336,23 @@
if ((fileheader.imagetype == TGA_NOCOMP_TRUECOLOR ||
fileheader.imagetype == TGA_RLE_TRUECOLOR) &&
imagespec.depth == 32 &&
- imagespec.descriptor & TGA_DESC_ALPHABITS != 8 &&
- imagespec.descriptor & TGA_DESC_ALPHABITS != 0)
+ (imagespec.descriptor & TGA_DESC_ALPHABITS) != 8 &&
+ (imagespec.descriptor & TGA_DESC_ALPHABITS) != 0)
return B_NO_TRANSLATOR;
if ((fileheader.imagetype == TGA_NOCOMP_TRUECOLOR ||
fileheader.imagetype == TGA_RLE_TRUECOLOR) &&
imagespec.depth == 24 &&
- imagespec.descriptor & TGA_DESC_ALPHABITS != 0)
+ (imagespec.descriptor & TGA_DESC_ALPHABITS) != 0)
return B_NO_TRANSLATOR;
if ((fileheader.imagetype == TGA_NOCOMP_TRUECOLOR ||
fileheader.imagetype == TGA_RLE_TRUECOLOR) &&
imagespec.depth == 16 &&
- imagespec.descriptor & TGA_DESC_ALPHABITS != 1 &&
- imagespec.descriptor & TGA_DESC_ALPHABITS != 0)
+ (imagespec.descriptor & TGA_DESC_ALPHABITS) != 1 &&
+ (imagespec.descriptor & TGA_DESC_ALPHABITS) != 0)
if ((fileheader.imagetype == TGA_NOCOMP_TRUECOLOR ||
fileheader.imagetype == TGA_RLE_TRUECOLOR) &&
imagespec.depth == 15 &&
- imagespec.descriptor & TGA_DESC_ALPHABITS != 0)
+ (imagespec.descriptor & TGA_DESC_ALPHABITS) != 0)
return B_NO_TRANSLATOR;
// Fill in headers passed to this function
Modified: haiku/trunk/src/apps/deskcalc/CalcView.cpp
===================================================================
--- haiku/trunk/src/apps/deskcalc/CalcView.cpp 2009-02-01 22:16:49 UTC (rev 29120)
+++ haiku/trunk/src/apps/deskcalc/CalcView.cpp 2009-02-01 23:24:55 UTC (rev 29121)
@@ -335,7 +335,7 @@
FillRect(updateRect & keypadRect);
// render key main grid
- BeginLineArray((fColums + fRows) << 1 + 1);
+ BeginLineArray(((fColums + fRows) << 1) + 1);
// render cols
AddLine(BPoint(0.0, sizeDisp),
Modified: haiku/trunk/src/bin/screen_blanker/ScreenBlanker.cpp
===================================================================
--- haiku/trunk/src/bin/screen_blanker/ScreenBlanker.cpp 2009-02-01 22:16:49 UTC (rev 29120)
+++ haiku/trunk/src/bin/screen_blanker/ScreenBlanker.cpp 2009-02-01 23:24:55 UTC (rev 29121)
@@ -172,10 +172,10 @@
return;
if (fSettings.OffTime() == fSettings.SuspendTime()
- && (flags & (ENABLE_DPMS_OFF | ENABLE_DPMS_SUSPEND)) == ENABLE_DPMS_OFF | ENABLE_DPMS_SUSPEND)
+ && (flags & (ENABLE_DPMS_OFF | ENABLE_DPMS_SUSPEND)) == (ENABLE_DPMS_OFF | ENABLE_DPMS_SUSPEND))
flags &= ~ENABLE_DPMS_SUSPEND;
if (fSettings.SuspendTime() == fSettings.StandByTime()
- && (flags & (ENABLE_DPMS_SUSPEND | ENABLE_DPMS_STAND_BY)) == ENABLE_DPMS_SUSPEND | ENABLE_DPMS_STAND_BY)
+ && (flags & (ENABLE_DPMS_SUSPEND | ENABLE_DPMS_STAND_BY)) == (ENABLE_DPMS_SUSPEND | ENABLE_DPMS_STAND_BY))
flags &= ~ENABLE_DPMS_STAND_BY;
// start them off again
Modified: haiku/trunk/src/preferences/screen/ScreenMode.cpp
===================================================================
--- haiku/trunk/src/preferences/screen/ScreenMode.cpp 2009-02-01 22:16:49 UTC (rev 29120)
+++ haiku/trunk/src/preferences/screen/ScreenMode.cpp 2009-02-01 23:24:55 UTC (rev 29121)
@@ -31,7 +31,7 @@
static combine_mode
get_combine_mode(display_mode& mode)
{
- if (mode.flags & B_SCROLL == 0)
+ if ((mode.flags & B_SCROLL) == 0)
return kCombineDisable;
if (mode.virtual_width == mode.timing.h_display * 2)
Modified: haiku/trunk/src/system/boot/loader/file_systems/fat/Directory.cpp
===================================================================
--- haiku/trunk/src/system/boot/loader/file_systems/fat/Directory.cpp 2009-02-01 22:16:49 UTC (rev 29120)
+++ haiku/trunk/src/system/boot/loader/file_systems/fat/Directory.cpp 2009-02-01 23:24:55 UTC (rev 29121)
@@ -282,7 +282,7 @@
continue;
if (c->entry.Flags() == 0x0f) // LFN entry
continue;
- if (c->entry.Flags() & (FAT_VOLUME|FAT_SUBDIR) == FAT_VOLUME) {
+ if ((c->entry.Flags() & (FAT_VOLUME|FAT_SUBDIR)) == FAT_VOLUME) {
// TODO handle Volume name (set fVolume's name)
continue;
}
Modified: haiku/trunk/src/system/boot/loader/file_systems/fat/Volume.cpp
===================================================================
--- haiku/trunk/src/system/boot/loader/file_systems/fat/Volume.cpp 2009-02-01 22:16:49 UTC (rev 29120)
+++ haiku/trunk/src/system/boot/loader/file_systems/fat/Volume.cpp 2009-02-01 23:24:55 UTC (rev 29121)
@@ -253,7 +253,7 @@
bool
Volume::IsLastCluster(uint32 cluster) const
{
- if (cluster >= fTotalClusters && (cluster & 0xff8 == 0xff8))
+ if (cluster >= fTotalClusters && ((cluster & 0xff8) == 0xff8))
return true;
return false;
}
From mmlr at mail.berlios.de Mon Feb 2 00:25:42 2009
From: mmlr at mail.berlios.de (mmlr at mail.berlios.de)
Date: Mon, 2 Feb 2009 00:25:42 +0100
Subject: [Haiku-commits] r29122 - haiku/trunk/src/servers/registrar
Message-ID: <200902012325.n11NPgFJ006233@sheep.berlios.de>
Author: mmlr
Date: 2009-02-02 00:25:41 +0100 (Mon, 02 Feb 2009)
New Revision: 29122
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29122&view=rev
Modified:
haiku/trunk/src/servers/registrar/TRoster.cpp
Log:
This was most probably a typo.
Modified: haiku/trunk/src/servers/registrar/TRoster.cpp
===================================================================
--- haiku/trunk/src/servers/registrar/TRoster.cpp 2009-02-01 23:24:55 UTC (rev 29121)
+++ haiku/trunk/src/servers/registrar/TRoster.cpp 2009-02-01 23:25:41 UTC (rev 29122)
@@ -376,7 +376,7 @@
// check the parameters
// entry_ref
- if (error == B_OK & !BEntry(&ref).Exists())
+ if (error == B_OK && !BEntry(&ref).Exists())
SET_ERROR(error, B_ENTRY_NOT_FOUND);
// team/token
if (error == B_OK && team < 0 && token == 0)
From anevilyak at mail.berlios.de Mon Feb 2 00:28:37 2009
From: anevilyak at mail.berlios.de (anevilyak at BerliOS)
Date: Mon, 2 Feb 2009 00:28:37 +0100
Subject: [Haiku-commits] r29123 - haiku/trunk/headers/os/app
Message-ID: <200902012328.n11NSbCZ006482@sheep.berlios.de>
Author: anevilyak
Date: 2009-02-02 00:28:37 +0100 (Mon, 02 Feb 2009)
New Revision: 29123
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29123&view=rev
Modified:
haiku/trunk/headers/os/app/PropertyInfo.h
Log:
Adding const for gcc2 as well shouldn't cause any issues. Thanks Axel!
Modified: haiku/trunk/headers/os/app/PropertyInfo.h
===================================================================
--- haiku/trunk/headers/os/app/PropertyInfo.h 2009-02-01 23:25:41 UTC (rev 29122)
+++ haiku/trunk/headers/os/app/PropertyInfo.h 2009-02-01 23:28:37 UTC (rev 29123)
@@ -41,26 +41,17 @@
struct compound_type {
struct field_pair {
-#if __GNUC__ > 2
- const
-#endif
- char *name; // name of entry in message
+ const char *name; // name of entry in message
type_code type; // type_code of entry in message
};
field_pair pairs[5];
};
struct property_info {
-#if __GNUC__ > 2
- const
-#endif
- char *name;
+ const char *name;
uint32 commands[10];
uint32 specifiers[10];
-#if __GNUC__ > 2
- const
-#endif
- char *usage;
+ const char *usage;
uint32 extra_data;
uint32 types[10];
compound_type ctypes[3];
@@ -73,16 +64,10 @@
};
struct value_info {
-#if __GNUC__ > 2
- const
-#endif
- char *name;
+ const char *name;
uint32 value;
value_kind kind;
-#if __GNUC__ > 2
- const
-#endif
- char *usage;
+ const char *usage;
uint32 extra_data;
uint32 _reserved[10];
};
From mmlr at mail.berlios.de Mon Feb 2 00:32:28 2009
From: mmlr at mail.berlios.de (mmlr at mail.berlios.de)
Date: Mon, 2 Feb 2009 00:32:28 +0100
Subject: [Haiku-commits] r29124 - in haiku/trunk: headers/os/drivers
src/system/kernel/debug
Message-ID: <200902012332.n11NWSbb008841@sheep.berlios.de>
Author: mmlr
Date: 2009-02-02 00:32:25 +0100 (Mon, 02 Feb 2009)
New Revision: 29124
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29124&view=rev
Modified:
haiku/trunk/headers/os/drivers/KernelExport.h
haiku/trunk/src/system/kernel/debug/debug_commands.cpp
Log:
Remove separate GCC4 versions of add_debug_command()/remove_debug_command() and
add the const in any case. As Axel points out these are C functions and we do
not affect binary compatibility by changing their signature.
Modified: haiku/trunk/headers/os/drivers/KernelExport.h
===================================================================
--- haiku/trunk/headers/os/drivers/KernelExport.h 2009-02-01 23:28:37 UTC (rev 29123)
+++ haiku/trunk/headers/os/drivers/KernelExport.h 2009-02-01 23:32:25 UTC (rev 29124)
@@ -174,16 +174,10 @@
extern void kernel_debugger(const char *message);
extern uint64 parse_expression(const char *string);
-#if __GNUC__ > 2
extern int add_debugger_command(const char *name,
debugger_command_hook hook, const char *help);
extern int remove_debugger_command(const char *name,
debugger_command_hook hook);
-#else
-extern int add_debugger_command(char *name, debugger_command_hook hook, char *help);
-extern int remove_debugger_command(char *name,
- debugger_command_hook hook);
-#endif
/* Miscellaneous */
extern void spin(bigtime_t microseconds);
Modified: haiku/trunk/src/system/kernel/debug/debug_commands.cpp
===================================================================
--- haiku/trunk/src/system/kernel/debug/debug_commands.cpp 2009-02-01 23:28:37 UTC (rev 29123)
+++ haiku/trunk/src/system/kernel/debug/debug_commands.cpp 2009-02-01 23:32:25 UTC (rev 29124)
@@ -499,23 +499,15 @@
// #pragma mark - public API
int
-#if __GNUC__ > 2
add_debugger_command(const char *name, int (*func)(int, char **),
const char *desc)
-#else
-add_debugger_command(char *name, int (*func)(int, char **), char *desc)
-#endif
{
return add_debugger_command_etc(name, func, desc, NULL, 0);
}
int
-#if __GNUC__ > 2
remove_debugger_command(const char * name, int (*func)(int, char **))
-#else
-remove_debugger_command(char * name, int (*func)(int, char **))
-#endif
{
struct debugger_command *cmd = sCommands;
struct debugger_command *prev = NULL;
From mmlr at mail.berlios.de Mon Feb 2 00:47:47 2009
From: mmlr at mail.berlios.de (mmlr at mail.berlios.de)
Date: Mon, 2 Feb 2009 00:47:47 +0100
Subject: [Haiku-commits] r29125 - haiku/trunk/src/kits/interface
Message-ID: <200902012347.n11Nllqs025689@sheep.berlios.de>
Author: mmlr
Date: 2009-02-02 00:47:38 +0100 (Mon, 02 Feb 2009)
New Revision: 29125
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29125&view=rev
Modified:
haiku/trunk/src/kits/interface/ColorConversion.cpp
Log:
Should fix bug #3401. Put the parenthesis at the wrong spot resulting in wrong offsets.
Modified: haiku/trunk/src/kits/interface/ColorConversion.cpp
===================================================================
--- haiku/trunk/src/kits/interface/ColorConversion.cpp 2009-02-01 23:32:25 UTC (rev 29124)
+++ haiku/trunk/src/kits/interface/ColorConversion.cpp 2009-02-01 23:47:38 UTC (rev 29125)
@@ -583,10 +583,10 @@
dstOffsetY = 0;
}
- srcBits = (srcByte*)((uint8*)srcBits + (srcOffsetY * srcBitsPerRow + srcOffsetX
- * (srcBitsPerPixel >> 3)));
- dstBits = (dstByte*)((uint8*)dstBits + (dstOffsetY * dstBitsPerRow + dstOffsetX
- * (dstBitsPerPixel >> 3)));
+ srcBits = (srcByte*)((uint8*)srcBits + ((srcOffsetY * srcBitsPerRow + srcOffsetX
+ * srcBitsPerPixel) >> 3));
+ dstBits = (dstByte*)((uint8*)dstBits + ((dstOffsetY * dstBitsPerRow + dstOffsetX
+ * dstBitsPerPixel) >> 3));
// Ensure that the width fits
int32 srcWidth = (srcBitsPerRow - srcOffsetX * srcBitsPerPixel)
From anevilyak at mail.berlios.de Mon Feb 2 02:37:03 2009
From: anevilyak at mail.berlios.de (anevilyak at BerliOS)
Date: Mon, 2 Feb 2009 02:37:03 +0100
Subject: [Haiku-commits] r29126 - in haiku/trunk: headers/private/interface
src/kits/interface
Message-ID: <200902020137.n121b3QP006946@sheep.berlios.de>
Author: anevilyak
Date: 2009-02-02 02:36:54 +0100 (Mon, 02 Feb 2009)
New Revision: 29126
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29126&view=rev
Modified:
haiku/trunk/headers/private/interface/ColumnListView.h
haiku/trunk/src/kits/interface/ColumnListView.cpp
Log:
BColumnListView was hiding BView::ScrollTo(BPoint), due to its own child variant ScrollTo(BRow *). Fixed.
Modified: haiku/trunk/headers/private/interface/ColumnListView.h
===================================================================
--- haiku/trunk/headers/private/interface/ColumnListView.h 2009-02-01 23:47:38 UTC (rev 29125)
+++ haiku/trunk/headers/private/interface/ColumnListView.h 2009-02-02 01:36:54 UTC (rev 29126)
@@ -304,6 +304,7 @@
void AddRow(BRow*, int32 index, BRow *parent = 0);
void ScrollTo(const BRow* Row);
+ void ScrollTo(BPoint point);
// Does not delete row or children at this time.
// todo: Make delete row and children
Modified: haiku/trunk/src/kits/interface/ColumnListView.cpp
===================================================================
--- haiku/trunk/src/kits/interface/ColumnListView.cpp 2009-02-01 23:47:38 UTC (rev 29125)
+++ haiku/trunk/src/kits/interface/ColumnListView.cpp 2009-02-02 01:36:54 UTC (rev 29126)
@@ -1143,6 +1143,11 @@
fOutlineView->ScrollTo(Row);
}
+void BColumnListView::ScrollTo(BPoint point)
+{
+ fOutlineView->ScrollTo(point);
+}
+
void BColumnListView::Clear()
{
fOutlineView->Clear();
From humdingerb at googlemail.com Mon Feb 2 19:03:16 2009
From: humdingerb at googlemail.com (Humdinger)
Date: Mon, 02 Feb 2009 19:03:16 +0100
Subject: [Haiku-commits] r29007 - haiku/trunk/src/apps/terminal
In-Reply-To: <4985B731.50901@googlemail.com>
References: <200901251129.n0PBTeGJ018646@sheep.berlios.de> <49849C94.8010200@googlemail.com> <20090131200655.6400.2@bepc.1233406687.fake> <4984BFA2.9050404@googlemail.com> <1e80d8750901311437r2592faf6x726c857eb85fbdd2@mail.gmail.com> <4984D4A0.20805@googlemail.com> <20090201010404.362.1@knochen-vm.localdomain> <49854BB2.500@googlemail.com>
<20090201115724.350.2@bepc.1233485126.fake>
<4985B731.50901@googlemail.com>
Message-ID: <49873564.4040109@googlemail.com>
Humdinger wrote:
> I made a diff of the InfoWindow.cpp that I've attached.
> Since this is the first patch that I haven't sent privately to you, is
> that the correct way to create a patch: I navigated to
> haiku/trunk/src/kits/tracker and did a "svn diff > file.diff".
I have an updated diff, as "Path" also appears as Attribute column in Tracker windows. I
hope I found all places. One thing that's puzzling me a bit: The OpenWith panel still
starts up the first time with "Path". After removing it I can display "Location" from the
Attribute menu...
Oh, and this time I did the diff from trunk/ with:
svn diff src/kits/tracker/ > Path2Location.diff
If everything's OK I can also commit it myself...
Regards,
Humdinger
--
--=-=--=-=--=-=--=-=--=-=--=-=--=-=--=-=--=-=--=-
Deutsche Haiku News @ http://www.haiku-gazette.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Path2Location.diff
Type: text/x-patch
Size: 2557 bytes
Desc: not available
URL:
From superstippi at gmx.de Mon Feb 2 20:06:03 2009
From: superstippi at gmx.de (=?ISO-8859-1?Q?Stephan_A=DFmus?=)
Date: Mon, 02 Feb 2009 20:06:03 +0100
Subject: [Haiku-commits] r29007 - haiku/trunk/src/apps/terminal
In-Reply-To: <49873564.4040109@googlemail.com>
References: <200901251129.n0PBTeGJ018646@sheep.berlios.de> <49849C94.8010200@googlemail.com> <20090131200655.6400.2@bepc.1233406687.fake> <4984BFA2.9050404@googlemail.com> <1e80d8750901311437r2592faf6x726c857eb85fbdd2@mail.gmail.com> <4984D4A0.20805@googlemail.com> <20090201010404.362.1@knochen-vm.localdomain> <49854BB2.500@googlemail.com> <20090201115724.350.2@bepc.1233485126.fake> <4985B731.50901@googlemail.com>
<49873564.4040109@googlemail.com>
Message-ID: <4987441B.8010302@gmx.de>
Humdinger schrieb:
> Humdinger wrote:
>> I made a diff of the InfoWindow.cpp that I've attached.
>> Since this is the first patch that I haven't sent privately to you, is
>> that the correct way to create a patch: I navigated to
>> haiku/trunk/src/kits/tracker and did a "svn diff > file.diff".
>
> I have an updated diff, as "Path" also appears as Attribute column in
> Tracker windows. I hope I found all places. One thing that's puzzling me
> a bit: The OpenWith panel still starts up the first time with "Path".
> After removing it I can display "Location" from the Attribute menu...
>
> Oh, and this time I did the diff from trunk/ with:
> svn diff src/kits/tracker/ > Path2Location.diff
>
> If everything's OK I can also commit it myself...
Looks good, please go ahead! :-)
Location is much less technical than Path anyways.
Best regards,
-Stephan
From anevilyak at mail.berlios.de Tue Feb 3 00:07:48 2009
From: anevilyak at mail.berlios.de (anevilyak at BerliOS)
Date: Tue, 3 Feb 2009 00:07:48 +0100
Subject: [Haiku-commits] r29127 - haiku/trunk/build/jam
Message-ID: <200902022307.n12N7mPo029663@sheep.berlios.de>
Author: anevilyak
Date: 2009-02-03 00:07:47 +0100 (Tue, 03 Feb 2009)
New Revision: 29127
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29127&view=rev
Modified:
haiku/trunk/build/jam/OptionalPackages
Log:
Forgot to update the symlink path in the Be menu when updating that package.
Modified: haiku/trunk/build/jam/OptionalPackages
===================================================================
--- haiku/trunk/build/jam/OptionalPackages 2009-02-02 01:36:54 UTC (rev 29126)
+++ haiku/trunk/build/jam/OptionalPackages 2009-02-02 23:07:47 UTC (rev 29127)
@@ -471,7 +471,7 @@
: apps
;
AddSymlinkToHaikuImage home config be Applications
- : /boot/apps/Vision-0.9.7-H-21072008/Vision ;
+ : /boot/apps/Vision-0.9.7-H-25012009/Vision ;
} else {
InstallOptionalHaikuImagePackage Vision-0.9.7-H-25012009
: http://vision.sf.net/Vision-0.9.7-H-25012009.zip
From axeld at pinc-software.de Tue Feb 3 00:44:26 2009
From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=)
Date: Tue, 03 Feb 2009 00:44:26 +0100 CET
Subject: [Haiku-commits] r29007 - haiku/trunk/src/apps/terminal
In-Reply-To: <4987441B.8010302@gmx.de>
Message-ID: <50024144324-BeMail@zon>
Stephan A?mus wrote:
> Location is much less technical than Path anyways.
I'm not really sure about that; "path" alone is not really a very
technical term, and it's a pretty good description of the location of a
file (as it indeed is the path to that file) :-)
Bye,
Axel.
From bonefish at mail.berlios.de Tue Feb 3 02:08:41 2009
From: bonefish at mail.berlios.de (bonefish at BerliOS)
Date: Tue, 3 Feb 2009 02:08:41 +0100
Subject: [Haiku-commits] r29128 - haiku/trunk
Message-ID: <200902030108.n1318fLE030418@sheep.berlios.de>
Author: bonefish
Date: 2009-02-03 02:08:40 +0100 (Tue, 03 Feb 2009)
New Revision: 29128
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29128&view=rev
Modified:
haiku/trunk/configure
Log:
Patch by Matt Madia (slightly modified): Extended the usage text by some
info regarding non-default output directories.
Modified: haiku/trunk/configure
===================================================================
--- haiku/trunk/configure 2009-02-02 23:07:47 UTC (rev 29127)
+++ haiku/trunk/configure 2009-02-03 01:08:40 UTC (rev 29128)
@@ -76,6 +76,19 @@
Defaults to "ru".
HAIKU_UNARFLAGS The flags passed to HAIKU_AR for unarchiving.
Defaults to "x".
+
+Non-standard output directories:
+ By default all objects, build configuration, and other related files are
+ stored in /path/to/haiku_source/generated. To store objects in a non-default
+ location, run "../../relative/path/to/haiku_source/configure " from
+ within your non-default location. "jam [ options ] targets" can then be run
+ directly inside your non-default location. Another option is to invoke "jam
+ [ options ] targets" from within haiku_source. This can be accomplished by
+ either "export HAIKU_OUTPUT_DIR=your non-default location" before invoking
+ jam or by creating a symlink of haiku_source/generated pointing to your
+ non-default location and running jam.
+
+
EOF
}
From jackburton at mail.berlios.de Tue Feb 3 15:04:56 2009
From: jackburton at mail.berlios.de (jackburton at mail.berlios.de)
Date: Tue, 3 Feb 2009 15:04:56 +0100
Subject: [Haiku-commits] r29129 - haiku/trunk/src/apps/terminal
Message-ID: <200902031404.n13E4u60009735@sheep.berlios.de>
Author: jackburton
Date: 2009-02-03 15:04:52 +0100 (Tue, 03 Feb 2009)
New Revision: 29129
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29129&view=rev
Modified:
haiku/trunk/src/apps/terminal/AppearPrefView.cpp
haiku/trunk/src/apps/terminal/BasicTerminalBuffer.cpp
haiku/trunk/src/apps/terminal/BasicTerminalBuffer.h
haiku/trunk/src/apps/terminal/CodeConv.cpp
haiku/trunk/src/apps/terminal/Coding.cpp
haiku/trunk/src/apps/terminal/TermParse.cpp
haiku/trunk/src/apps/terminal/TermView.cpp
Log:
Applied patch by h.z. (slightly modified by myself) included in bug #2715. I tested it briefly with Konatu Tohaba font and it seems to work correctly. Please review.
Modified: haiku/trunk/src/apps/terminal/AppearPrefView.cpp
===================================================================
--- haiku/trunk/src/apps/terminal/AppearPrefView.cpp 2009-02-03 01:08:40 UTC (rev 29128)
+++ haiku/trunk/src/apps/terminal/AppearPrefView.cpp 2009-02-03 14:04:52 UTC (rev 29129)
@@ -18,9 +18,34 @@
#include
#include
+#include
#include
+static bool
+IsFontUsable(const BFont &font)
+{
+ // TODO: If BFont::IsFullAndHalfFixed() was implemented, we could
+ // use that. But I don't think it's easily implementable using
+ // Freetype.
+
+ if (font.IsFixed())
+ return true;
+
+ bool widthOk = true;
+ int lastWidth;
+ for (int c = 0x20 ; c <= 0x7e; c++){
+ char buf[4];
+ snprintf(buf, sizeof(buf), "%c", c);
+ int tmpWidth = (int)font.StringWidth(buf);
+ if (c > 0x20 &&(tmpWidth != lastWidth))
+ widthOk = false;
+ lastWidth = tmpWidth;
+ }
+ return widthOk;
+}
+
+
AppearancePrefView::AppearancePrefView(BRect frame, const char *name,
BMessenger messenger)
: PrefView(frame, name),
@@ -170,7 +195,7 @@
if (get_font_family(i, &family, &flags) == B_OK) {
BFont font;
font.SetFamilyAndStyle(family, NULL);
- if (font.IsFixed()) {
+ if (IsFontUsable(font)) {
BMenuItem *item = new BMenuItem(family, new BMessage(command));
menu->AddItem(item);
if (!strcmp(defaultFontName, family))
Modified: haiku/trunk/src/apps/terminal/BasicTerminalBuffer.cpp
===================================================================
--- haiku/trunk/src/apps/terminal/BasicTerminalBuffer.cpp 2009-02-03 01:08:40 UTC (rev 29128)
+++ haiku/trunk/src/apps/terminal/BasicTerminalBuffer.cpp 2009-02-03 14:04:52 UTC (rev 29129)
@@ -537,11 +537,12 @@
void
-BasicTerminalBuffer::InsertChar(UTF8Char c, uint32 attributes)
+BasicTerminalBuffer::InsertChar(UTF8Char c, uint32 width, uint32 attributes)
{
//debug_printf("BasicTerminalBuffer::InsertChar('%.*s' (%d), %#lx)\n",
//(int)c.ByteCount(), c.bytes, c.bytes[0], attributes);
- int width = CodeConv::UTF8GetFontWidth(c.bytes);
+ // TODO: Check if this method can be removed completely
+ //int width = CodeConv::UTF8GetFontWidth(c.bytes);
if (width == FULL_WIDTH)
attributes |= A_WIDTH;
Modified: haiku/trunk/src/apps/terminal/BasicTerminalBuffer.h
===================================================================
--- haiku/trunk/src/apps/terminal/BasicTerminalBuffer.h 2009-02-03 01:08:40 UTC (rev 29128)
+++ haiku/trunk/src/apps/terminal/BasicTerminalBuffer.h 2009-02-03 14:04:52 UTC (rev 29129)
@@ -96,9 +96,14 @@
TermPos& matchEnd) const;
// insert chars/lines
- void InsertChar(UTF8Char c, uint32 attributes);
- inline void InsertChar(const char* c, int32 length,
- uint32 attributes);
+ inline void InsertChar(UTF8Char c, uint32 attributes);
+ void InsertChar(UTF8Char c, uint32 width,
+ uint32 attributes);
+ inline void InsertChar(const char* c, int32 length,
+ uint32 attributes);
+ inline void InsertChar(const char* c, int32 length,
+ uint32 width, uint32 attributes);
+
void InsertCR();
void InsertLF();
void SetInsertMode(int flag);
@@ -210,13 +215,27 @@
void
+BasicTerminalBuffer::InsertChar(UTF8Char c, uint32 attributes)
+{
+ return InsertChar(c, 1, attributes);
+}
+
+
+void
BasicTerminalBuffer::InsertChar(const char* c, int32 length, uint32 attributes)
{
- return InsertChar(UTF8Char(c, length), attributes);
+ return InsertChar(UTF8Char(c, length), 1, attributes);
}
void
+BasicTerminalBuffer::InsertChar(const char* c, int32 length, uint32 width, uint32 attributes)
+{
+ return InsertChar(UTF8Char(c, length), width, attributes);
+}
+
+
+void
BasicTerminalBuffer::SetCursorX(int32 x)
{
SetCursor(x, fCursor.y);
Modified: haiku/trunk/src/apps/terminal/CodeConv.cpp
===================================================================
--- haiku/trunk/src/apps/terminal/CodeConv.cpp 2009-02-03 01:08:40 UTC (rev 29128)
+++ haiku/trunk/src/apps/terminal/CodeConv.cpp 2009-02-03 14:04:52 UTC (rev 29129)
@@ -38,7 +38,6 @@
int32
CodeConv::UTF8GetFontWidth(const char *string)
{
- return 1;
ushort unicode = UTF8toUnicode(string);
uchar width = gUTF8WidthTable[unicode >> 3];
ushort offset = unicode & 0x07;
Modified: haiku/trunk/src/apps/terminal/Coding.cpp
===================================================================
--- haiku/trunk/src/apps/terminal/Coding.cpp 2009-02-03 01:08:40 UTC (rev 29128)
+++ haiku/trunk/src/apps/terminal/Coding.cpp 2009-02-03 14:04:52 UTC (rev 29129)
@@ -30,11 +30,11 @@
{"Shift-JIS", "SJIS", 'S', B_SJIS_CONVERSION},
{"EUC-jp", "EUCJ", 'E', B_EUC_CONVERSION},
{"EUC-kr", "EUCK", 'K', B_EUC_KR_CONVERSION},
+ {"GB18030", "GB18030", 'G', B_GBK_CONVERSION},
+ {"Big5", "Big5", 'B', B_BIG5_CONVERSION},
-
/* Not Implemented.
{"EUC-tw", "EUCT", "T", M_EUC_TW},
- {"Big5", "Big5", 'B', M_BIG5},
{"ISO-2022-cn", "ISOC", 'C', M_ISO_2022_CN},
{"ISO-2022-kr", "ISOK", 'R', M_ISO_2022_KR},
*/
Modified: haiku/trunk/src/apps/terminal/TermParse.cpp
===================================================================
--- haiku/trunk/src/apps/terminal/TermParse.cpp 2009-02-03 01:08:40 UTC (rev 29128)
+++ haiku/trunk/src/apps/terminal/TermParse.cpp 2009-02-03 14:04:52 UTC (rev 29129)
@@ -326,6 +326,7 @@
int *groundtable = gUTF8GroundTable;
int *parsestate = groundtable;
+ int width = 1;
BAutolock locker(fBuffer);
while (!fQuitting) {
@@ -358,6 +359,8 @@
case B_EUC_CONVERSION:
case B_EUC_KR_CONVERSION:
case B_JIS_CONVERSION:
+ case B_GBK_CONVERSION:
+ case B_BIG5_CONVERSION:
groundtable = gISO8859GroundTable;
break;
case M_UTF8:
@@ -378,10 +381,14 @@
case CASE_PRINT_GR:
/* case iso8859 gr character, or euc */
ptr = cbuf;
- if (now_coding == B_EUC_CONVERSION || now_coding == B_EUC_KR_CONVERSION
- || now_coding == B_JIS_CONVERSION) {
+ if (now_coding == B_EUC_CONVERSION
+ || now_coding == B_EUC_KR_CONVERSION
+ || now_coding == B_JIS_CONVERSION
+ || now_coding == B_GBK_CONVERSION
+ || now_coding == B_BIG5_CONVERSION) {
switch (parsestate[curess]) {
case CASE_SS2: /* JIS X 0201 */
+ width = 1;
*ptr++ = curess;
*ptr++ = c;
*ptr = 0;
@@ -389,6 +396,7 @@
break;
case CASE_SS3: /* JIS X 0212 */
+ width = 1;
*ptr++ = curess;
*ptr++ = c;
_NextParseChar(c);
@@ -398,6 +406,7 @@
break;
default: /* JIS X 0208 */
+ width = 2;
*ptr++ = c;
_NextParseChar(c);
*ptr++ = c;
@@ -417,7 +426,7 @@
B_EUC_CONVERSION);
}
- fBuffer->InsertChar(dstbuf, 4, attr);
+ fBuffer->InsertChar(dstbuf, 4, width, attr);
break;
case CASE_PRINT_CS96:
Modified: haiku/trunk/src/apps/terminal/TermView.cpp
===================================================================
--- haiku/trunk/src/apps/terminal/TermView.cpp 2009-02-03 01:08:40 UTC (rev 29128)
+++ haiku/trunk/src/apps/terminal/TermView.cpp 2009-02-03 14:04:52 UTC (rev 29129)
@@ -1025,6 +1025,9 @@
continue;
}
+ if (IS_WIDTH(attr))
+ count = 2;
+
_DrawLinePart(fFontWidth * i, (int32)_LineOffset(j),
attr, buf, count, insideSelection, false, this);
i += count;
From humdingerb at mail.berlios.de Tue Feb 3 17:16:29 2009
From: humdingerb at mail.berlios.de (humdingerb at mail.berlios.de)
Date: Tue, 3 Feb 2009 17:16:29 +0100
Subject: [Haiku-commits] r29130 - haiku/trunk/src/kits/tracker
Message-ID: <200902031616.n13GGT2U025827@sheep.berlios.de>
Author: humdingerb
Date: 2009-02-03 17:16:26 +0100 (Tue, 03 Feb 2009)
New Revision: 29130
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29130&view=rev
Modified:
haiku/trunk/src/kits/tracker/ContainerWindow.cpp
haiku/trunk/src/kits/tracker/InfoWindow.cpp
haiku/trunk/src/kits/tracker/OpenWithWindow.cpp
haiku/trunk/src/kits/tracker/QueryPoseView.cpp
Log:
As discussed here:
https://lists.berlios.de/pipermail/haiku-commits/2009-February/014198.html
We decided on a distinction between path+filename and only the path to a file.
I changed the places a user is exposed to the issue, using the definition:
Path with filename: "Path"
Path without filename: "Location"
Modified: haiku/trunk/src/kits/tracker/ContainerWindow.cpp
===================================================================
--- haiku/trunk/src/kits/tracker/ContainerWindow.cpp 2009-02-03 14:04:52 UTC (rev 29129)
+++ haiku/trunk/src/kits/tracker/ContainerWindow.cpp 2009-02-03 16:16:26 UTC (rev 29130)
@@ -3040,7 +3040,7 @@
menu->AddItem(NewAttributeMenuItem ("Original name", kAttrOriginalPath, B_STRING_TYPE,
225, B_ALIGN_LEFT, false, false));
else
- menu->AddItem(NewAttributeMenuItem ("Path", kAttrPath, B_STRING_TYPE,
+ menu->AddItem(NewAttributeMenuItem ("Location", kAttrPath, B_STRING_TYPE,
225, B_ALIGN_LEFT, false, false));
#ifdef OWNER_GROUP_ATTRIBUTES
Modified: haiku/trunk/src/kits/tracker/InfoWindow.cpp
===================================================================
--- haiku/trunk/src/kits/tracker/InfoWindow.cpp 2009-02-03 14:04:52 UTC (rev 29129)
+++ haiku/trunk/src/kits/tracker/InfoWindow.cpp 2009-02-03 16:16:26 UTC (rev 29130)
@@ -1746,9 +1746,9 @@
GetFont(&normalFont);
// Path
- MovePenTo(BPoint(fDivider - (StringWidth("Path:")), lineBase));
+ MovePenTo(BPoint(fDivider - (StringWidth("Location:")), lineBase));
SetHighColor(kAttrTitleColor);
- DrawString("Path:");
+ DrawString("Location:");
MovePenTo(BPoint(fDivider + kDrawMargin, lineBase));
SetHighColor(kLinkColor);
Modified: haiku/trunk/src/kits/tracker/OpenWithWindow.cpp
===================================================================
--- haiku/trunk/src/kits/tracker/OpenWithWindow.cpp 2009-02-03 14:04:52 UTC (rev 29129)
+++ haiku/trunk/src/kits/tracker/OpenWithWindow.cpp 2009-02-03 16:16:26 UTC (rev 29130)
@@ -761,7 +761,7 @@
BColumn *relationColumn = new BColumn("Relation", 180, 100, B_ALIGN_LEFT,
kAttrOpenWithRelation, B_STRING_TYPE, false, false);
fColumnList->AddItem(relationColumn);
- fColumnList->AddItem(new BColumn("Path", 290, 225, B_ALIGN_LEFT,
+ fColumnList->AddItem(new BColumn("Location", 290, 225, B_ALIGN_LEFT,
kAttrPath, B_STRING_TYPE, true, false));
fColumnList->AddItem(new BColumn("Version", 525, 70, B_ALIGN_LEFT,
kAttrAppVersion, B_STRING_TYPE, false, false));
Modified: haiku/trunk/src/kits/tracker/QueryPoseView.cpp
===================================================================
--- haiku/trunk/src/kits/tracker/QueryPoseView.cpp 2009-02-03 14:04:52 UTC (rev 29129)
+++ haiku/trunk/src/kits/tracker/QueryPoseView.cpp 2009-02-03 16:16:26 UTC (rev 29130)
@@ -115,7 +115,7 @@
fColumnList->AddItem(new BColumn("Name", kColumnStart, 145, B_ALIGN_LEFT,
kAttrStatName, B_STRING_TYPE, true, true));
- fColumnList->AddItem(new BColumn("Path", 200, 225, B_ALIGN_LEFT,
+ fColumnList->AddItem(new BColumn("Location", 200, 225, B_ALIGN_LEFT,
kAttrPath, B_STRING_TYPE, true, false));
fColumnList->AddItem(new BColumn("Size", 440, 80, B_ALIGN_RIGHT,
kAttrStatSize, B_OFF_T_TYPE, true, false));
From superstippi at gmx.de Tue Feb 3 17:18:13 2009
From: superstippi at gmx.de (=?ISO-8859-1?Q?Stephan_A=DFmus?=)
Date: Tue, 03 Feb 2009 17:18:13 +0100
Subject: [Haiku-commits] r29129 - haiku/trunk/src/apps/terminal
In-Reply-To: <200902031404.n13E4u60009735@sheep.berlios.de>
References: <200902031404.n13E4u60009735@sheep.berlios.de>
Message-ID: <49886E45.7000108@gmx.de>
Hi,
jackburton at mail.berlios.de schrieb:
> Author: jackburton
> Date: 2009-02-03 15:04:52 +0100 (Tue, 03 Feb 2009)
> New Revision: 29129
> +static bool
> +IsFontUsable(const BFont &font)
> +{
> + // TODO: If BFont::IsFullAndHalfFixed() was implemented, we could
> + // use that. But I don't think it's easily implementable using
> + // Freetype.
> +
> + if (font.IsFixed())
> + return true;
> +
> + bool widthOk = true;
> + int lastWidth;
> + for (int c = 0x20 ; c <= 0x7e; c++){
> + char buf[4];
> + snprintf(buf, sizeof(buf), "%c", c);
> + int tmpWidth = (int)font.StringWidth(buf);
> + if (c > 0x20 &&(tmpWidth != lastWidth))
> + widthOk = false;
> + lastWidth = tmpWidth;
> + }
> + return widthOk;
it's probably not speed critical at this place, but if you wanted, you
could speed this up a lot by using BFont::GetEscapements() or whatever
it was, using one buffer with all the chars you're interested in and
then iterating over the widths in the returned array.
Best regards,
-Stephan
From leavengood at gmail.com Tue Feb 3 18:46:08 2009
From: leavengood at gmail.com (Ryan Leavengood)
Date: Tue, 3 Feb 2009 12:46:08 -0500
Subject: [Haiku-commits] r29007 - haiku/trunk/src/apps/terminal
In-Reply-To: <50024144324-BeMail@zon>
References: <4987441B.8010302@gmx.de> <50024144324-BeMail@zon>
Message-ID:
On Mon, Feb 2, 2009 at 6:44 PM, Axel D?rfler wrote:
> Stephan A?mus wrote:
>> Location is much less technical than Path anyways.
>
> I'm not really sure about that; "path" alone is not really a very
> technical term, and it's a pretty good description of the location of a
> file (as it indeed is the path to that file) :-)
Indeed this is a good point. In fact a large number of computing terms
in English were just borrowed from other words with a similar concept
and they are not inherently complicated. The idea of a kernel of corn,
or a semaphore at a traffic stop, or the path through a park isn't
really all that more complicated than the location of a store. But
they might seem more complicated to those of us who have learned about
the computer equivalent, like the kernel of an OS, or a semaphore
resource lock.
But in the case of path or location I don't know if path is
automatically more technical. But I do think for this case it makes
more sense so I agree with the change :)
Ryan
From humdingerb at googlemail.com Tue Feb 3 18:59:49 2009
From: humdingerb at googlemail.com (Humdinger)
Date: Tue, 03 Feb 2009 18:59:49 +0100
Subject: [Haiku-commits] r29007 - haiku/trunk/src/apps/terminal
In-Reply-To:
References: <4987441B.8010302@gmx.de> <50024144324-BeMail@zon>
Message-ID: <49888615.8090605@googlemail.com>
Ryan Leavengood wrote:
> But in the case of path or location I don't know if path is
> automatically more technical. But I do think for this case it makes
> more sense so I agree with the change :)
Just to be clear, I don't think introducing "Location" was necessary because "Path" was
too technical. And in most situations "path" and "location" are synonyms. We just needed a
definition to distinguish between path+filename and the sole path without the filename.
At least it's better than to mix these slightly different meanings.
Regards,
Humdinger
--
--=-=--=-=--=-=--=-=--=-=--=-=--=-=--=-=--=-=--=-
Deutsche Haiku News @ http://www.haiku-gazette.de
From leavengood at gmail.com Tue Feb 3 19:18:51 2009
From: leavengood at gmail.com (Ryan Leavengood)
Date: Tue, 3 Feb 2009 13:18:51 -0500
Subject: [Haiku-commits] r29007 - haiku/trunk/src/apps/terminal
In-Reply-To: <49888615.8090605@googlemail.com>
References: <4987441B.8010302@gmx.de> <50024144324-BeMail@zon>
<49888615.8090605@googlemail.com>
Message-ID:
On Tue, Feb 3, 2009 at 12:59 PM, Humdinger wrote:
>
> Just to be clear, I don't think introducing "Location" was necessary because "Path" was
> too technical. And in most situations "path" and "location" are synonyms. We just needed a
> definition to distinguish between path+filename and the sole path without the filename.
> At least it's better than to mix these slightly different meanings.
Yes that is what I meant when I said I thought this made sense in this
case. So I think it is a good change.
Regards,
Ryan
From anevilyak at mail.berlios.de Wed Feb 4 00:08:43 2009
From: anevilyak at mail.berlios.de (anevilyak at BerliOS)
Date: Wed, 4 Feb 2009 00:08:43 +0100
Subject: [Haiku-commits] r29131 - haiku/trunk/build/jam
Message-ID: <200902032308.n13N8hRr022998@sheep.berlios.de>
Author: anevilyak
Date: 2009-02-04 00:08:42 +0100 (Wed, 04 Feb 2009)
New Revision: 29131
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29131&view=rev
Modified:
haiku/trunk/build/jam/OptionalPackages
Log:
Update location of p7zip package. Thanks to Scott McCreary for the patch.
Modified: haiku/trunk/build/jam/OptionalPackages
===================================================================
--- haiku/trunk/build/jam/OptionalPackages 2009-02-03 16:16:26 UTC (rev 29130)
+++ haiku/trunk/build/jam/OptionalPackages 2009-02-03 23:08:42 UTC (rev 29131)
@@ -395,7 +395,7 @@
Echo "No optional package P7zip available for gcc4" ;
} else {
InstallOptionalHaikuImagePackage p7zip-4.61-gcc2-2008-12-03
- : http://ports.haiku-files.org/downloads/82
+ : http://haiku-files.org/files/optional-packages/p7zip-4.61-gcc2-2008-12-03.zip
:
;
From mmu_man at mail.berlios.de Wed Feb 4 13:59:03 2009
From: mmu_man at mail.berlios.de (mmu_man at BerliOS)
Date: Wed, 4 Feb 2009 13:59:03 +0100
Subject: [Haiku-commits] r29132 - haiku/trunk/3rdparty/mmu_man/scripts
Message-ID: <200902041259.n14Cx3bP031351@sheep.berlios.de>
Author: mmu_man
Date: 2009-02-04 13:59:02 +0100 (Wed, 04 Feb 2009)
New Revision: 29132
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29132&view=rev
Modified:
haiku/trunk/3rdparty/mmu_man/scripts/dev-perso
Log:
No line break here.
Modified: haiku/trunk/3rdparty/mmu_man/scripts/dev-perso
===================================================================
--- haiku/trunk/3rdparty/mmu_man/scripts/dev-perso 2009-02-03 23:08:42 UTC (rev 29131)
+++ haiku/trunk/3rdparty/mmu_man/scripts/dev-perso 2009-02-04 12:59:02 UTC (rev 29132)
@@ -101,7 +101,7 @@
#export PS1='\[\033]0;['$1':\W]\a\]\[\033[1m\][\u@\h \w]\[\033[0m\]\$ '
#export PS1='\033]0;['$1':\W]\a\033[1m[\u@\h \w]\033[0m\$ '
export PS1='\[\033[1m\][\u@\h \w]\[\033[0m\]\$ '
- export PROMPT_COMMAND='echo -e "\033]0;['$1':${PWD##*/}]\a"'
+ export PROMPT_COMMAND='echo -en "\033]0;['$1':${PWD##*/}]\a"'
;;
esac
# lower priority so background builds don't slow the GUI too much
From mmu_man at mail.berlios.de Wed Feb 4 13:59:42 2009
From: mmu_man at mail.berlios.de (mmu_man at BerliOS)
Date: Wed, 4 Feb 2009 13:59:42 +0100
Subject: [Haiku-commits] r29133 - in haiku/trunk/src/bin: . bemail_utils
Message-ID: <200902041259.n14CxgS2031420@sheep.berlios.de>
Author: mmu_man
Date: 2009-02-04 13:59:41 +0100 (Wed, 04 Feb 2009)
New Revision: 29133
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29133&view=rev
Modified:
haiku/trunk/src/bin/bemail_utils/spamdbm.cpp
haiku/trunk/src/bin/urlwrapper.cpp
Log:
Return native error codes.
Modified: haiku/trunk/src/bin/bemail_utils/spamdbm.cpp
===================================================================
--- haiku/trunk/src/bin/bemail_utils/spamdbm.cpp 2009-02-04 12:59:02 UTC (rev 29132)
+++ haiku/trunk/src/bin/bemail_utils/spamdbm.cpp 2009-02-04 12:59:41 UTC (rev 29133)
@@ -2612,7 +2612,7 @@
sprintf (ErrorMessage, "The database is full! There are %lu messages in "
"it and we can't add any more without overflowing the maximum integer "
"representation in 32 bits", NewAge);
- return ENOMEM;
+ return B_NO_MEMORY;
}
/* Check that this file hasn't already been added to the database. */
@@ -2724,7 +2724,7 @@
sprintf (ErrorMessage, "Failed to insert new database entry for "
"word \"%s\", while processing file \"%s\"",
WordIter->c_str (), OptionalFileName);
- return ENOMEM;
+ return B_NO_MEMORY;
}
DataIter = InsertResult.first;
m_WordCount++;
Modified: haiku/trunk/src/bin/urlwrapper.cpp
===================================================================
--- haiku/trunk/src/bin/urlwrapper.cpp 2009-02-04 12:59:02 UTC (rev 29132)
+++ haiku/trunk/src/bin/urlwrapper.cpp 2009-02-04 12:59:41 UTC (rev 29133)
@@ -102,7 +102,7 @@
v = FindFirst(":");
if (v < 0)
- return EINVAL;
+ return B_BAD_VALUE;
// TODO: proto and host should be lowercased.
// see http://en.wikipedia.org/wiki/URL_normalization
From korli at mail.berlios.de Thu Feb 5 00:03:40 2009
From: korli at mail.berlios.de (korli at BerliOS)
Date: Thu, 5 Feb 2009 00:03:40 +0100
Subject: [Haiku-commits] r29134 - haiku/trunk/src/kits/interface
Message-ID: <200902042303.n14N3eQL028052@sheep.berlios.de>
Author: korli
Date: 2009-02-05 00:03:40 +0100 (Thu, 05 Feb 2009)
New Revision: 29134
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29134&view=rev
Modified:
haiku/trunk/src/kits/interface/TextControl.cpp
Log:
Should fix Shift+TAB on text controls, as it was broken since r29028. Noticed by Karsten Heimrich.
Modified: haiku/trunk/src/kits/interface/TextControl.cpp
===================================================================
--- haiku/trunk/src/kits/interface/TextControl.cpp 2009-02-04 12:59:41 UTC (rev 29133)
+++ haiku/trunk/src/kits/interface/TextControl.cpp 2009-02-04 23:03:40 UTC (rev 29134)
@@ -451,6 +451,10 @@
if (Window()) {
fText->MakeEditable(enabled);
+ if (enabled)
+ fText->SetFlags(fText->Flags() | B_NAVIGABLE);
+ else
+ fText->SetFlags(fText->Flags() & ~B_NAVIGABLE);
_UpdateTextViewColors(enabled);
@@ -512,6 +516,9 @@
fText->SetFlags(fText->Flags() | B_NAVIGABLE);
}
+ // Don't make this one navigable
+ flags &= ~B_NAVIGABLE;
+
BView::SetFlags(flags);
}
@@ -925,6 +932,8 @@
fDivider = floorf(bounds.Width() / 2.0f);
uint32 navigableFlags = Flags() & B_NAVIGABLE;
+ if (navigableFlags != 0)
+ BView::SetFlags(Flags() & ~B_NAVIGABLE);
if (archive)
fText = static_cast(FindView("_input_"));
From korli at users.berlios.de Thu Feb 5 00:04:40 2009
From: korli at users.berlios.de (=?ISO-8859-1?B?Suly9G1lIER1dmFs?=)
Date: Thu, 5 Feb 2009 00:04:40 +0100
Subject: [Haiku-commits] r29028 - haiku/trunk/src/kits/interface
In-Reply-To: <49844FBF.8070808@gmx.de>
References: <200901252218.n0PMIj60026512@sheep.berlios.de>
<49844FBF.8070808@gmx.de>
Message-ID:
2009/1/31 Karsten Heimrich
>
> This change will break SHIFT+TAB out of a text control. Just check
> FileTypes using backward TAB navigation.
>
In fact. I changed it a bit in r29134. I hope it works better now.
Bye,
J?r?me
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From host.haiku at gmx.de Thu Feb 5 00:09:05 2009
From: host.haiku at gmx.de (Karsten Heimrich)
Date: Thu, 05 Feb 2009 00:09:05 +0100
Subject: [Haiku-commits] r29028 - haiku/trunk/src/kits/interface
In-Reply-To:
References: <200901252218.n0PMIj60026512@sheep.berlios.de> <49844FBF.8070808@gmx.de>
Message-ID: <498A2011.4040404@gmx.de>
J?r?me Duval schrieb:
> 2009/1/31 Karsten Heimrich
>
>> This change will break SHIFT+TAB out of a text control. Just check
>> FileTypes using backward TAB navigation.
>>
>
> In fact. I changed it a bit in r29134. I hope it works better now.
Thanks J?r?me. :)
Best,
Karsten
From axeld at mail.berlios.de Thu Feb 5 00:37:15 2009
From: axeld at mail.berlios.de (axeld at BerliOS)
Date: Thu, 5 Feb 2009 00:37:15 +0100
Subject: [Haiku-commits] r29135 - haiku/trunk/src/servers/input
Message-ID: <200902042337.n14NbFAY005838@sheep.berlios.de>
Author: axeld
Date: 2009-02-05 00:37:10 +0100 (Thu, 05 Feb 2009)
New Revision: 29135
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29135&view=rev
Modified:
haiku/trunk/src/servers/input/InputServer.cpp
haiku/trunk/src/servers/input/InputServer.h
Log:
* The input_server now updates its internal state only from the messages that
actually made it through (ie. after filtering).
* This should fix filters that change the current mouse position to work as
expected.
Modified: haiku/trunk/src/servers/input/InputServer.cpp
===================================================================
--- haiku/trunk/src/servers/input/InputServer.cpp 2009-02-04 23:03:40 UTC (rev 29134)
+++ haiku/trunk/src/servers/input/InputServer.cpp 2009-02-04 23:37:10 UTC (rev 29135)
@@ -729,7 +729,7 @@
InputServer::HandleGetModifierKey(BMessage* message, BMessage* reply)
{
int32 modifier;
-
+
if (message->FindInt32("modifier", &modifier) == B_OK) {
switch (modifier) {
case B_CAPS_LOCK:
@@ -1451,24 +1451,83 @@
if (_SanitizeEvents(events)
&& _MethodizeEvents(events)
- && _FilterEvents(events))
+ && _FilterEvents(events)) {
+ _UpdateMouseAndKeys(events);
_DispatchEvents(events);
+ }
}
}
+/*! Updates the internal mouse position and keyboard info. */
+void
+InputServer::_UpdateMouseAndKeys(EventList& events)
+{
+ for (int32 index = 0;BMessage* event = (BMessage*)events.ItemAt(index);
+ index++) {
+ switch (event->what) {
+ case B_MOUSE_DOWN:
+ case B_MOUSE_UP:
+ case B_MOUSE_MOVED:
+ event->FindPoint("where", &fMousePos);
+ break;
+
+ case B_KEY_DOWN:
+ case B_UNMAPPED_KEY_DOWN:
+ // update modifiers
+ uint32 modifiers;
+ if (event->FindInt32("modifiers", (int32*)&modifiers) == B_OK)
+ fKeyInfo.modifiers = modifiers;
+
+ // update key states
+ const uint8 *data;
+ ssize_t size;
+ if (event->FindData("states", B_UINT8_TYPE,
+ (const void**)&data, &size) == B_OK) {
+ PRINT(("updated keyinfo\n"));
+ if (size == sizeof(fKeyInfo.key_states))
+ memcpy(fKeyInfo.key_states, data, size);
+ }
+
+ if (fActiveMethod == NULL)
+ break;
+
+ // we scan for Alt+Space key down events which means we change
+ // to next input method
+ // (pressing "shift" will let us switch to the previous method)
+
+ PRINT(("SanitizeEvents: %lx, %x\n", fKeyInfo.modifiers,
+ fKeyInfo.key_states[KEY_Spacebar >> 3]));
+
+ uint8 byte;
+ if (event->FindInt8("byte", (int8*)&byte) < B_OK)
+ byte = 0;
+
+ if (((fKeyInfo.modifiers & B_COMMAND_KEY) != 0 && byte == ' ')
+ || byte == B_ZENKAKU_HANKAKU) {
+ SetNextMethod(!(fKeyInfo.modifiers & B_SHIFT_KEY));
+
+ // this event isn't sent to the user
+ events.RemoveItemAt(index);
+ delete event;
+ continue;
+ }
+ break;
+ }
+ }
+}
+
+
/*! Frees events from unwanted fields, adds missing fields, and removes
unwanted events altogether.
- As a side effect, it will also update the internal mouse states.
*/
bool
InputServer::_SanitizeEvents(EventList& events)
{
CALLED();
- int32 index = 0;
- BMessage *event;
- while ((event = (BMessage*)events.ItemAt(index)) != NULL) {
+ for (int32 index = 0; BMessage* event = (BMessage*)events.ItemAt(index);
+ index++) {
switch (event->what) {
#ifndef HAIKU_TARGET_PLATFORM_HAIKU
case IS_SCREEN_BOUNDS_UPDATED:
@@ -1509,39 +1568,37 @@
if (event->FindInt32("x", &x) == B_OK
&& event->FindInt32("y", &y) == B_OK) {
- fMousePos.x += x;
- fMousePos.y -= y;
- fMousePos.ConstrainTo(fFrame);
+ where.x = fMousePos.x + x;
+ where.y = fMousePos.y - y;
+ where.ConstrainTo(fFrame);
event->RemoveName("x");
event->RemoveName("y");
- event->AddPoint("where", fMousePos);
+ event->AddPoint("where", where);
event->AddInt32("be:delta_x", x);
event->AddInt32("be:delta_y", y);
PRINT(("new position: %f, %f, %ld, %ld\n",
- fMousePos.x, fMousePos.y, x, y));
+ where.x, where.y, x, y));
} else if (event->FindFloat("x", &absX) == B_OK
&& event->FindFloat("y", &absY) == B_OK) {
- // device gives us absolute screen coords
- // in range 0..1
- // convert to absolute screen pos
- // (the message is supposed to contain the original
- // absolute coordinates as "be:tablet_x/y")
- fMousePos.x = absX * fFrame.Width();
- fMousePos.y = absY * fFrame.Height();
- fMousePos.ConstrainTo(fFrame);
+ // The device gives us absolute screen coords in range 0..1;
+ // convert them to absolute screen position
+ // (the message is supposed to contain the original
+ // absolute coordinates as "be:tablet_x/y").
+ where.x = absX * fFrame.Width();
+ where.y = absY * fFrame.Height();
+ where.ConstrainTo(fFrame);
event->RemoveName("x");
event->RemoveName("y");
- event->AddPoint("where", fMousePos);
- PRINT(("new position : %f, %f\n", fMousePos.x, fMousePos.y));
+ event->AddPoint("where", where);
+ PRINT(("new position : %f, %f\n", where.x, where.y));
} else if (event->FindPoint("where", &where) == B_OK) {
- fMousePos = where;
- fMousePos.ConstrainTo(fFrame);
+ where.ConstrainTo(fFrame);
- event->ReplacePoint("where", fMousePos);
- PRINT(("new position : %f, %f\n", fMousePos.x, fMousePos.y));
+ event->ReplacePoint("where", where);
+ PRINT(("new position : %f, %f\n", where.x, where.y));
}
if (!event->HasInt64("when"))
@@ -1552,52 +1609,17 @@
}
case B_KEY_DOWN:
case B_UNMAPPED_KEY_DOWN:
- // update or add modifiers
- uint32 modifiers;
- if (event->FindInt32("modifiers", (int32*)&modifiers) == B_OK)
- fKeyInfo.modifiers = modifiers;
- else
+ // add modifiers
+ if (!event->HasInt32("modifiers"))
event->AddInt32("modifiers", fKeyInfo.modifiers);
- // update or add key states
- const uint8 *data;
- ssize_t size;
- if (event->FindData("states", B_UINT8_TYPE,
- (const void**)&data, &size) == B_OK) {
- PRINT(("updated keyinfo\n"));
- if (size == sizeof(fKeyInfo.key_states))
- memcpy(fKeyInfo.key_states, data, size);
- } else {
+ // add key states
+ if (!event->HasData("states", B_UINT8_TYPE)) {
event->AddData("states", B_UINT8_TYPE, fKeyInfo.key_states,
sizeof(fKeyInfo.key_states));
}
- if (fActiveMethod == NULL)
- break;
-
- // we scan for Alt+Space key down events which means we change
- // to next input method
- // (pressing "shift" will let us switch to the previous method)
-
- PRINT(("SanitizeEvents: %lx, %x\n", fKeyInfo.modifiers,
- fKeyInfo.key_states[KEY_Spacebar >> 3]));
-
- uint8 byte;
- if (event->FindInt8("byte", (int8*)&byte) < B_OK)
- byte = 0;
-
- if (((fKeyInfo.modifiers & B_COMMAND_KEY) != 0 && byte == ' ')
- || byte == B_ZENKAKU_HANKAKU) {
- SetNextMethod(!(fKeyInfo.modifiers & B_SHIFT_KEY));
-
- // this event isn't sent to the user
- events.RemoveItemAt(index);
- delete event;
- continue;
- }
break;
}
-
- index++;
}
return true;
Modified: haiku/trunk/src/servers/input/InputServer.h
===================================================================
--- haiku/trunk/src/servers/input/InputServer.h 2009-02-04 23:03:40 UTC (rev 29134)
+++ haiku/trunk/src/servers/input/InputServer.h 2009-02-04 23:37:10 UTC (rev 29135)
@@ -195,6 +195,7 @@
void _EventLoop();
static status_t _EventLooper(void *arg);
+ void _UpdateMouseAndKeys(EventList& events);
bool _SanitizeEvents(EventList& events);
bool _MethodizeEvents(EventList& events);
bool _FilterEvents(EventList& events);
From bonefish at mail.berlios.de Thu Feb 5 12:07:21 2009
From: bonefish at mail.berlios.de (bonefish at BerliOS)
Date: Thu, 5 Feb 2009 12:07:21 +0100
Subject: [Haiku-commits] r29136 - haiku/trunk/headers/posix
Message-ID: <200902051107.n15B7L79014893@sheep.berlios.de>
Author: bonefish
Date: 2009-02-05 12:07:20 +0100 (Thu, 05 Feb 2009)
New Revision: 29136
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29136&view=rev
Modified:
haiku/trunk/headers/posix/fcntl.h
Log:
Added O_NDELAY as synonym of O_NONBLOCK.
Modified: haiku/trunk/headers/posix/fcntl.h
===================================================================
--- haiku/trunk/headers/posix/fcntl.h 2009-02-04 23:37:10 UTC (rev 29135)
+++ haiku/trunk/headers/posix/fcntl.h 2009-02-05 11:07:20 UTC (rev 29136)
@@ -46,6 +46,7 @@
/* flags for open() and fcntl() */
#define O_CLOEXEC 0x00000040 /* close on exec */
#define O_NONBLOCK 0x00000080 /* non blocking io */
+#define O_NDELAY O_NONBLOCK
#define O_APPEND 0x00000800 /* to end of file */
#define O_TEXT 0x00004000 /* CR-LF translation */
#define O_BINARY 0x00008000 /* no translation */
From bonefish at mail.berlios.de Fri Feb 6 13:35:02 2009
From: bonefish at mail.berlios.de (bonefish at BerliOS)
Date: Fri, 6 Feb 2009 13:35:02 +0100
Subject: [Haiku-commits] r29137 - haiku/trunk/headers/posix
Message-ID: <200902061235.n16CZ2QA024289@sheep.berlios.de>
Author: bonefish
Date: 2009-02-06 13:35:01 +0100 (Fri, 06 Feb 2009)
New Revision: 29137
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29137&view=rev
Modified:
haiku/trunk/headers/posix/unistd.h
Log:
Fixed value of _POSIX_VDISABLE. cc_t is unsigned in Haiku. ATM we don't
support _POSIX_VDISABLE at all. It's even questionable whether the value
(unsigned char)-2 is a good choice.
Modified: haiku/trunk/headers/posix/unistd.h
===================================================================
--- haiku/trunk/headers/posix/unistd.h 2009-02-05 11:07:20 UTC (rev 29136)
+++ haiku/trunk/headers/posix/unistd.h 2009-02-06 12:35:01 UTC (rev 29137)
@@ -34,7 +34,8 @@
#define _POSIX_JOB_CONTROL 1
#define _POSIX_NO_TRUNC 0
#define _POSIX_SAVED_IDS 1
-#define _POSIX_VDISABLE ((char) - 2) /* TODO: Check this! */
+#define _POSIX_VDISABLE ((unsigned char)-2)
+ /* TODO: Check this! */
#define _POSIX_SEMAPHORES (200112L)
#define _POSIX_THREADS (200112L)
From mmu_man at mail.berlios.de Fri Feb 6 17:21:18 2009
From: mmu_man at mail.berlios.de (mmu_man at BerliOS)
Date: Fri, 6 Feb 2009 17:21:18 +0100
Subject: [Haiku-commits] r29138 - haiku/trunk/src/apps/login
Message-ID: <200902061621.n16GLImj001570@sheep.berlios.de>
Author: mmu_man
Date: 2009-02-06 17:21:17 +0100 (Fri, 06 Feb 2009)
New Revision: 29138
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29138&view=rev
Modified:
haiku/trunk/src/apps/login/LoginApp.cpp
haiku/trunk/src/apps/login/LoginApp.h
Log:
add a --nonmodal option.
Modified: haiku/trunk/src/apps/login/LoginApp.cpp
===================================================================
--- haiku/trunk/src/apps/login/LoginApp.cpp 2009-02-06 12:35:01 UTC (rev 29137)
+++ haiku/trunk/src/apps/login/LoginApp.cpp 2009-02-06 16:21:17 UTC (rev 29138)
@@ -30,7 +30,8 @@
LoginApp::LoginApp()
: BApplication(kLoginAppSig),
- fEditShelfMode(false)
+ fEditShelfMode(false),
+ fModalMode(true)
{
}
@@ -107,9 +108,22 @@
{
int i;
for (i = 1; i < argc; i++) {
- printf("[%d]: %s\n", i, argv[i]);
- if (argv[i] == BString("--edit"))
+ BString arg(argv[i]);
+ //printf("[%d]: %s\n", i, argv[i]);
+ if (arg == "--edit")
fEditShelfMode = true;
+ else if (arg == "--nonmodal")
+ fModalMode = false;
+ else /*if (arg == "--help")*/ {
+ printf("Login application for Haiku\nUsage:\n");
+ printf("%s [--nonmodal] [--edit]\n", argv[0]);
+ printf("--nonmodal Do not make the window modal\n");
+ printf("--edit Launch in Shelf editting mode to "
+ "allow customizing the desktop.\n");
+ // just return to the shell
+ exit((arg == "--help") ? 0 : 1);
+ return;
+ }
}
}
Modified: haiku/trunk/src/apps/login/LoginApp.h
===================================================================
--- haiku/trunk/src/apps/login/LoginApp.h 2009-02-06 12:35:01 UTC (rev 29137)
+++ haiku/trunk/src/apps/login/LoginApp.h 2009-02-06 16:21:17 UTC (rev 29138)
@@ -35,6 +35,7 @@
DesktopWindow* fDesktopWindow;
LoginWindow* fLoginWindow;
bool fEditShelfMode;
+ bool fModalMode;
};
#endif // _LOGINAPP_H_
From mmu_man at mail.berlios.de Fri Feb 6 17:48:03 2009
From: mmu_man at mail.berlios.de (mmu_man at BerliOS)
Date: Fri, 6 Feb 2009 17:48:03 +0100
Subject: [Haiku-commits] r29139 -
haiku/trunk/src/system/kernel/device_manager
Message-ID: <200902061648.n16Gm3Q5011937@sheep.berlios.de>
Author: mmu_man
Date: 2009-02-06 17:48:03 +0100 (Fri, 06 Feb 2009)
New Revision: 29139
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29139&view=rev
Modified:
haiku/trunk/src/system/kernel/device_manager/legacy_drivers.cpp
Log:
Do proper unlocking of the KPath when find_directory() fails. This should help with CD boot where find_directory() can't create folders on a read-only media.
Modified: haiku/trunk/src/system/kernel/device_manager/legacy_drivers.cpp
===================================================================
--- haiku/trunk/src/system/kernel/device_manager/legacy_drivers.cpp 2009-02-06 16:21:17 UTC (rev 29138)
+++ haiku/trunk/src/system/kernel/device_manager/legacy_drivers.cpp 2009-02-06 16:48:03 UTC (rev 29139)
@@ -837,7 +837,8 @@
pathBuffer.UnlockBuffer();
pathBuffer.Append("kernel");
AddPath(pathBuffer.Path(), subPath);
- }
+ } else
+ pathBuffer.UnlockBuffer();
}
} else
AddPath(path, subPath);
@@ -1359,7 +1360,8 @@
start_watching(path.Path(), "dev");
start_watching(path.Path(), "bin");
- }
+ } else
+ path.UnlockBuffer();
}
sWatching = true;
From stippi at mail.berlios.de Fri Feb 6 19:05:14 2009
From: stippi at mail.berlios.de (stippi at mail.berlios.de)
Date: Fri, 6 Feb 2009 19:05:14 +0100
Subject: [Haiku-commits] r29140 -
haiku/trunk/src/kits/interface/textview_support
Message-ID: <200902061805.n16I5EoF024277@sheep.berlios.de>
Author: stippi
Date: 2009-02-06 19:05:12 +0100 (Fri, 06 Feb 2009)
New Revision: 29140
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29140&view=rev
Modified:
haiku/trunk/src/kits/interface/textview_support/UndoBuffer.cpp
Log:
Tiny style cleanup.
Modified: haiku/trunk/src/kits/interface/textview_support/UndoBuffer.cpp
===================================================================
--- haiku/trunk/src/kits/interface/textview_support/UndoBuffer.cpp 2009-02-06 16:48:03 UTC (rev 29139)
+++ haiku/trunk/src/kits/interface/textview_support/UndoBuffer.cpp 2009-02-06 18:05:12 UTC (rev 29140)
@@ -111,8 +111,8 @@
if ((clip = clipboard->Data())) {
clip->AddData("text/plain", B_MIME_TYPE, fTextData, fTextLength);
if (fRunArray)
- clip->AddData("application/x-vnd.Be-text_run_array", B_MIME_TYPE,
- fRunArray, fRunArrayLength);
+ clip->AddData("application/x-vnd.Be-text_run_array",
+ B_MIME_TYPE, fRunArray, fRunArrayLength);
clipboard->Commit();
}
clipboard->Unlock();
From mmlr at mail.berlios.de Fri Feb 6 23:05:21 2009
From: mmlr at mail.berlios.de (mmlr at mail.berlios.de)
Date: Fri, 6 Feb 2009 23:05:21 +0100
Subject: [Haiku-commits] r29141 - buildtools/trunk/gcc/libgcc
Message-ID: <200902062205.n16M5Lf2014431@sheep.berlios.de>
Author: mmlr
Date: 2009-02-06 23:05:19 +0100 (Fri, 06 Feb 2009)
New Revision: 29141
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29141&view=rev
Modified:
buildtools/trunk/gcc/libgcc/config.host
Log:
Add missing support for ppc and m68k targets.
Modified: buildtools/trunk/gcc/libgcc/config.host
===================================================================
--- buildtools/trunk/gcc/libgcc/config.host 2009-02-06 18:05:12 UTC (rev 29140)
+++ buildtools/trunk/gcc/libgcc/config.host 2009-02-06 22:05:19 UTC (rev 29141)
@@ -313,7 +313,7 @@
;;
x86_64-*-freebsd*)
;;
-i[34567]86-*-haikuelf* | i[34567]86-*-haiku*)
+i[34567]86-*-haiku*)
;;
i[34567]86-*-netbsdelf*)
;;
@@ -417,6 +417,8 @@
;;
m68k-*-coff*)
;;
+m68k-*-haiku*)
+ ;;
m68020-*-elf* | m68k-*-elf*)
;;
m68010-*-netbsdelf* | m68k*-*-netbsdelf*)
@@ -495,6 +497,8 @@
;;
powerpc*-*-freebsd*)
;;
+powerpc-*-haiku*)
+ ;;
powerpc-*-netbsd*)
;;
powerpc-*-chorusos*)
From mmlr at mail.berlios.de Sat Feb 7 00:09:51 2009
From: mmlr at mail.berlios.de (mmlr at mail.berlios.de)
Date: Sat, 7 Feb 2009 00:09:51 +0100
Subject: [Haiku-commits] r29142 - haiku/trunk
Message-ID: <200902062309.n16N9p0d022186@sheep.berlios.de>
Author: mmlr
Date: 2009-02-07 00:09:47 +0100 (Sat, 07 Feb 2009)
New Revision: 29142
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29142&view=rev
Modified:
haiku/trunk/configure
Log:
Add support for the arm target as well. Not that we'd support it in any way yet.
Modified: haiku/trunk/configure
===================================================================
--- haiku/trunk/configure 2009-02-06 22:05:19 UTC (rev 29141)
+++ haiku/trunk/configure 2009-02-06 23:09:47 UTC (rev 29142)
@@ -291,6 +291,7 @@
x86) haikuGCCMachine=i586-pc-haiku;;
ppc) haikuGCCMachine=powerpc-apple-haiku;;
m68k) haikuGCCMachine=m68k-unknown-haiku;;
+ arm) haikuGCCMachine=arm-unknown-haiku;;
*) echo "Unsupported target architecture: $2"
exit 1;;
esac
From mmlr at mail.berlios.de Sat Feb 7 00:10:35 2009
From: mmlr at mail.berlios.de (mmlr at mail.berlios.de)
Date: Sat, 7 Feb 2009 00:10:35 +0100
Subject: [Haiku-commits] r29143 - buildtools/trunk/gcc/libgcc
Message-ID: <200902062310.n16NAZvr022350@sheep.berlios.de>
Author: mmlr
Date: 2009-02-07 00:10:34 +0100 (Sat, 07 Feb 2009)
New Revision: 29143
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29143&view=rev
Modified:
buildtools/trunk/gcc/libgcc/config.host
Log:
Make the arm target valid as well.
Modified: buildtools/trunk/gcc/libgcc/config.host
===================================================================
--- buildtools/trunk/gcc/libgcc/config.host 2009-02-06 23:09:47 UTC (rev 29142)
+++ buildtools/trunk/gcc/libgcc/config.host 2009-02-06 23:10:34 UTC (rev 29143)
@@ -222,6 +222,8 @@
;;
arm*-*-netbsd*)
;;
+arm-*-haiku*)
+ ;;
arm*-*-linux*) # ARM GNU/Linux with ELF
;;
arm*-*-uclinux*) # ARM ucLinux
From mmlr at mail.berlios.de Sat Feb 7 00:47:06 2009
From: mmlr at mail.berlios.de (mmlr at mail.berlios.de)
Date: Sat, 7 Feb 2009 00:47:06 +0100
Subject: [Haiku-commits] r29144 - buildtools/trunk/gcc/gcc
Message-ID: <200902062347.n16Nl65F006677@sheep.berlios.de>
Author: mmlr
Date: 2009-02-07 00:46:58 +0100 (Sat, 07 Feb 2009)
New Revision: 29144
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29144&view=rev
Modified:
buildtools/trunk/gcc/gcc/config.gcc
Log:
Add missing default CPU setting for m68k.
Modified: buildtools/trunk/gcc/gcc/config.gcc
===================================================================
--- buildtools/trunk/gcc/gcc/config.gcc 2009-02-06 23:10:34 UTC (rev 29143)
+++ buildtools/trunk/gcc/gcc/config.gcc 2009-02-06 23:46:58 UTC (rev 29144)
@@ -1645,6 +1645,8 @@
extra_parts="crtbegin.o crtend.o"
;;
m68k-*-haiku*)
+ default_m68k_cpu=68020
+ default_cf_cpu=5206
tmake_file="m68k/t-m68kbare m68k/t-crtstuff t-haiku" #??
tm_file="${tm_file} dbxelf.h elfos.h haiku.h m68k/haiku.h"
tm_defines="MOTOROLA USE_GAS"
From mmu_man at mail.berlios.de Sat Feb 7 00:54:40 2009
From: mmu_man at mail.berlios.de (mmu_man at BerliOS)
Date: Sat, 7 Feb 2009 00:54:40 +0100
Subject: [Haiku-commits] r29145 - haiku/trunk/src/apps/login
Message-ID: <200902062354.n16Nseql015817@sheep.berlios.de>
Author: mmu_man
Date: 2009-02-07 00:54:39 +0100 (Sat, 07 Feb 2009)
New Revision: 29145
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29145&view=rev
Modified:
haiku/trunk/src/apps/login/LoginView.cpp
Log:
Focus the password field on Enter if it's empty and not yet active.
Modified: haiku/trunk/src/apps/login/LoginView.cpp
===================================================================
--- haiku/trunk/src/apps/login/LoginView.cpp 2009-02-06 23:46:58 UTC (rev 29144)
+++ haiku/trunk/src/apps/login/LoginView.cpp 2009-02-06 23:54:39 UTC (rev 29145)
@@ -158,6 +158,14 @@
break;
case kAttemptLogin:
{
+ // if no pass specified and we were selecting the user,
+ // give a chance to enter the password
+ // else we might want to enter an empty password.
+ if (strlen(fPasswordControl->Text()) < 1
+ && (fUserList->IsFocus() || fLoginControl->IsFocus())) {
+ fPasswordControl->MakeFocus();
+ break;
+ }
BMessage *m = new BMessage(kAttemptLogin);
m->AddString("login", fLoginControl->Text());
m->AddString("password", fPasswordControl->Text());
From mmlr at mail.berlios.de Sat Feb 7 01:11:25 2009
From: mmlr at mail.berlios.de (mmlr at mail.berlios.de)
Date: Sat, 7 Feb 2009 01:11:25 +0100
Subject: [Haiku-commits] r29146 - haiku/trunk/src/kits/device
Message-ID: <200902070011.n170BPDM000982@sheep.berlios.de>
Author: mmlr
Date: 2009-02-07 01:11:22 +0100 (Sat, 07 Feb 2009)
New Revision: 29146
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29146&view=rev
Modified:
haiku/trunk/src/kits/device/USBEndpoint.cpp
Log:
Fix wrong usage of endpoint address.
Modified: haiku/trunk/src/kits/device/USBEndpoint.cpp
===================================================================
--- haiku/trunk/src/kits/device/USBEndpoint.cpp 2009-02-06 23:54:39 UTC (rev 29145)
+++ haiku/trunk/src/kits/device/USBEndpoint.cpp 2009-02-07 00:11:22 UTC (rev 29146)
@@ -223,7 +223,7 @@
uint16 status = 0;
Device()->ControlTransfer(USB_REQTYPE_ENDPOINT_IN,
USB_REQUEST_GET_STATUS, USB_FEATURE_ENDPOINT_HALT,
- fDescriptor.endpoint_address & 0x0f, sizeof(status), &status);
+ fDescriptor.endpoint_address, sizeof(status), &status);
return status != 0;
}
@@ -233,5 +233,5 @@
{
return Device()->ControlTransfer(USB_REQTYPE_ENDPOINT_OUT,
USB_REQUEST_CLEAR_FEATURE, USB_FEATURE_ENDPOINT_HALT,
- fDescriptor.endpoint_address & 0x0f, 0, NULL);
+ fDescriptor.endpoint_address, 0, NULL);
}
From humdingerb at mail.berlios.de Sat Feb 7 15:02:19 2009
From: humdingerb at mail.berlios.de (humdingerb at mail.berlios.de)
Date: Sat, 7 Feb 2009 15:02:19 +0100
Subject: [Haiku-commits] r29147 - haiku/trunk/docs/userguide/en/installation
Message-ID: <200902071402.n17E2Juo027034@sheep.berlios.de>
Author: humdingerb
Date: 2009-02-07 15:02:16 +0100 (Sat, 07 Feb 2009)
New Revision: 29147
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29147&view=rev
Modified:
haiku/trunk/docs/userguide/en/installation/install-source-linux.html
Log:
Corrected jamming of images, not unnecessarily create root files by first doing a {jam -q} and then {sudo jam -q}.
Modified: haiku/trunk/docs/userguide/en/installation/install-source-linux.html
===================================================================
--- haiku/trunk/docs/userguide/en/installation/install-source-linux.html 2009-02-07 00:11:22 UTC (rev 29146)
+++ haiku/trunk/docs/userguide/en/installation/install-source-linux.html 2009-02-07 14:02:16 UTC (rev 29147)
@@ -198,8 +198,14 @@
Now the Haiku image is built and installed on the partition:
+
jam -q @disk
+
+
This takes some time and will abort at some point, because some root permissions are needed. That's OK, we'll continue with:
+
sudo jam -q @disk
+
If you do it all in one go by going straight with the sudo-line, some files are created under the "root" user, among them the image itself. This would then have to be rededicate with chown etc., so best to stick with the 2-stage approach as described.
+
Installing to its own partition offers some interesting possibilities:
You'll now have to rededicate the generated image to satisfy the VMPlayer, before you can run it with an associated .vmx file (There's also a .vmx file in haiku/3rdparty/vmware/):
+
The created image can be run in VMPlayer with an associated .vmx file (There's also a .vmx file in haiku/3rdparty/vmware/).
You start by duplicating the UserBuildConfig.sample and the remove the.sample suffix to get your UserBuildConfig. From the .ReadMe you can copy interesting parts into your config and customize them there.
-
First, the line needed for the optional "OpenSSH" package:
+
First, the line is needed for the optional "OpenSSH" package:
HAIKU_IMAGE_HOST_NAME = "TEST" ;
+
There are several optional software packages available, that are dowloaded at build time if they haven't been so already. For a list of all available packages, see haiku/trunk/build/jam/OptionalPackages. Here's an example:
Now the block that sets the defaults for timezone and keymap:
# Add symlink/file (timezone and keymap settings) to the image.
AddSymlinkToHaikuImage home config settings
: /boot/beos/etc/timezones/Europe/Paris : timezone ;
AddFilesToHaikuImage home config settings : German
: Key_map ;
-
The build process can be fine tuned until it fits your needs. You could create your own folder haiku/trunk/user_data/
-and put files there that are then copied or unzipped into the image.
-Zipping is important when dealing with Haiku files with their
-attributes, because zipping them up will preserve them on non-BFS
-partitions.
+
The build process can be fine tuned until it fits your needs. You could create your own folder haiku/trunk/user_data/ and put files there that are then copied or unzipped into the image. Zipping is important when dealing with Haiku files with their attributes, because zipping them up will preserve them on non-BFS partitions.
For example:
# Zip up your emails between each system update and place the archive into the
@@ -108,33 +118,26 @@
The second line is the location of the zip file. $(HAIKU_TOP) is the lowest level of the checked out source tree, normally haiku/trunk/.
In the same way, you use CopyDirectoryToHaikuImage and AddFilesToHaikuImage to copy whole directories or single files into the image.
-
The above commands are executed when building any kind of image.
-"Build Profiles" provide the means to set commands specifically for
-different configurations.
-These are two profiles, one for building and installing an image
-directly onto a partition and the other to generate a VMWare image:
+
The above commands are executed when building any kind of image. "Build Profiles" provide the means to set commands specifically for different configurations.
+These are two profiles, one for building and installing an image directly onto a partition and the other to generate a VMWare image:
The first line is especially important and dangerous: "/dev/sda7" The so defined partition will be irretrievably overwritten!
-
Before you use this profile, you should make sure that it's really
-the correct partition on the right harddisk or USB-stick, for example
-by using Ubuntu's partition editor GParted.
+
Before you use this profile, you should make sure that it's really the correct partition on the right harddisk or USB-stick, for example by using Ubuntu's partition editor GParted.
Note:when building an a USB memory stick, you wouldn't specify the partition number in the disk entry (ex. /dev/sdb instead of /dev/sdb1). This will erase your whole flash drive and it's partitions, so be cautious the drive name is exact.
+
Note:when building an a USB memory stick, you wouldn't specify the partition number in the disk entry (ex. /dev/sdb instead of /dev/sdb1). This will erase your whole flash drive and it's partitions, so be cautious to use the correct drive name!
Besides these user build profiles, there are also official release profiles, see ReleaseBuildProfiles in the same folder. The profiles alpha-raw and alpha-vmware will build all officially planned components for the alpha release. They are invoked just like the user profiles, see Building a VMWare Image a bit further down.
@@ -179,18 +193,14 @@
Installing on a partition/USB-stick
-
To install Haiku directly onto a partition/USB-stick, you have to
-set the according read and write permissions.
+
To install Haiku directly onto a partition/USB-stick, you have to set the according read and write permissions.
When installing to a hard drive partition, replace the drive name and use:
-
-sudo chmod o+r /dev/sda
+
sudo chmod o+r /dev/sda
sudo chmod o+rw /dev/sda7
-
Note that the read permission is set for the whole disk (1st line)
-while the write permission is limited to one specific partition (2nd
-line).
+
Note that the read permission is set for the whole disk (1st line) while the write permission is limited to one specific partition (2nd line).
When installing to a USB flashdrive, replace the drive name, and type:
sudo chmod o+r /dev/sda
@@ -200,40 +210,30 @@
jam -q @disk
-
This takes some time and will abort at some point, because some root permissions are needed. That's OK, we'll continue with:
-
-
sudo jam -q @disk
-
-
If you do it all in one go by going straight with the sudo-line, some files are created under the "root" user, among them the image itself. This would then have to be rededicate with chown etc., so best to stick with the 2-stage approach as described.
-
Installing to its own partition offers some interesting possibilities:
-
sudo jam -q @disk update-all
+
jam -q @disk update-all
-
This updates all of the system, but leaves the home folder untouched, so all your data will still be there.
+
This updates all of the system, but leaves the home folder untouched, so all your data will still be there.
You can also decide to only update certain components:
-
sudo jam -q @disk update {components}
+
jam -q @disk update {components}
-
Just replace the {components} with the program/component to be updated, e.g. kernel, StyledEdit or libmedia.so or more than one, separated with blanks. haiku/build/jam/HaikuImage lists all possible "targets".
+
Just replace the {components} with the program/component to be updated, e.g. kernel, StyledEdit or libmedia.so or more than one, separated with blanks. haiku/build/jam/HaikuImage lists all possible "targets".
The created image can be run in VMPlayer with an associated .vmx file (There's also a .vmx file in haiku/3rdparty/vmware/).
+
The resulting image can be run in VMPlayer with an associated .vmx file (There's also a .vmx file in haiku/3rdparty/vmware/).
Booting with GRUB
-
If you installed Haiku directly onto a USB-stick, you just have to
-make sure the boot order in the BIOS looks first for USB devices to
-have Haiku boot right up from the stick.
+
If you installed Haiku directly onto a USB-stick, you just have to make sure the boot order in the BIOS looks first for USB devices to have Haiku boot right up from the stick.
-
If Haiku was installed on a partition on your hard drive, you have to
-adjust the boot loader accordingly. This is how it's done with GRUB:
+
If Haiku was installed on a partition on your hard drive, you have to adjust the boot loader accordingly. This is how it's done with GRUB:
sudo gedit /boot/grub/menu.lst
@@ -243,7 +243,6 @@
All harddisks start with "hd"
"N" is the hard disk number, starting with "0".
"n is the partition number, also starting with "0".
-
The first logical partition always have the number 4, regardless of the number of primary partitions.
If you're still unsure, check out the GRUB manual.
@@ -264,16 +263,13 @@
Accessing images/partitions
-
Using build profiles has another advantage: You can mount a VMWare
-image or the partition of a Haiku installation to transfer data.
-Navigate to haiku/trunk/ and simply enter:
-
sudo jam @disk mount
+
Using build profiles has another advantage: You can mount a VMWare image or the partition of a Haiku installation to transfer data. Navigate to haiku/trunk/ and simply enter:
+
jam @disk mount
or
-
sudo jam @vmware mount
+
jam @vmware mount
You are now in the bfs_shell. Enter help to get a list of all supported commands:
-
fssh:/> help
-supported commands:
+
fssh:/> help supported commands:
cd - change current directory
chmod - change file permissions
cp - copy files and directories
From mmlr at mail.berlios.de Sun Feb 8 13:40:21 2009
From: mmlr at mail.berlios.de (mmlr at mail.berlios.de)
Date: Sun, 8 Feb 2009 13:40:21 +0100
Subject: [Haiku-commits] r29158 - haiku/trunk/build/jam
Message-ID: <200902081240.n18CeLDQ014549@sheep.berlios.de>
Author: mmlr
Date: 2009-02-08 13:40:16 +0100 (Sun, 08 Feb 2009)
New Revision: 29158
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29158&view=rev
Modified:
haiku/trunk/build/jam/OptionalPackages
Log:
* Always install the "other tools" as part of the development optional package.
These all work on pure GCC4 images as well because they do not use any of our
C++ APIs.
* Remove the GCC4 package from hybrid installs though, as it's not usable
without proper setup. Also the trick with rewriting the symlink obviously
doesn't work because symlinks are done way earlier than unzipping the optional
packages when building the image.
Modified: haiku/trunk/build/jam/OptionalPackages
===================================================================
--- haiku/trunk/build/jam/OptionalPackages 2009-02-08 08:12:26 UTC (rev 29157)
+++ haiku/trunk/build/jam/OptionalPackages 2009-02-08 12:40:16 UTC (rev 29158)
@@ -230,57 +230,49 @@
: $(baseURL)/gcc-2.95.3-haiku-081024.zip
:
;
- # other tools
- InstallOptionalHaikuImagePackage autoconf-2.63-gcc2-2008-11-05
- : $(baseURL)/autoconf-2.63-gcc2-2008-11-05.zip
- :
- ;
- InstallOptionalHaikuImagePackage automake-1.10.1-gcc2-2008-11-06
- : $(baseURL)/automake-1.10.1-gcc2-2008-11-06.zip
- :
- ;
- InstallOptionalHaikuImagePackage bison-2.4-gcc2-2008-11-09
- : $(baseURL)/bison-2.4-gcc2-2008-11-09.zip
- :
- ;
- InstallOptionalHaikuImagePackage flex-2.5.35-gcc2-2008-11-09
- : $(baseURL)/flex-2.5.35-gcc2-2008-11-09.zip
- :
- ;
- InstallOptionalHaikuImagePackage jam-haiku-gcc2-2008-03-27-2
- : $(baseURL)/jam-haiku-gcc2-2008-03-27-2.zip
- :
- ;
- InstallOptionalHaikuImagePackage libtool-2.2.6a-gcc2-2008-11-09
- : $(baseURL)/libtool-2.2.6a-gcc2-2008-11-09.zip
- :
- ;
- InstallOptionalHaikuImagePackage m4-1.4.12-gcc2-2008-11-04
- : $(baseURL)/m4-1.4.12-gcc2-2008-11-04.zip
- :
- ;
- InstallOptionalHaikuImagePackage texinfo-4.13a-gcc2-2008-11-09
- : $(baseURL)/texinfo-4.13a-gcc2-2008-11-09.zip
- :
- ;
}
- if $(HAIKU_GCC_VERSION[1]) = 4 || $(isHybridBuild) = 1 {
+ # other tools
+ InstallOptionalHaikuImagePackage autoconf-2.63-gcc2-2008-11-05
+ : $(baseURL)/autoconf-2.63-gcc2-2008-11-05.zip
+ :
+ ;
+ InstallOptionalHaikuImagePackage automake-1.10.1-gcc2-2008-11-06
+ : $(baseURL)/automake-1.10.1-gcc2-2008-11-06.zip
+ :
+ ;
+ InstallOptionalHaikuImagePackage bison-2.4-gcc2-2008-11-09
+ : $(baseURL)/bison-2.4-gcc2-2008-11-09.zip
+ :
+ ;
+ InstallOptionalHaikuImagePackage flex-2.5.35-gcc2-2008-11-09
+ : $(baseURL)/flex-2.5.35-gcc2-2008-11-09.zip
+ :
+ ;
+ InstallOptionalHaikuImagePackage jam-haiku-gcc2-2008-03-27-2
+ : $(baseURL)/jam-haiku-gcc2-2008-03-27-2.zip
+ :
+ ;
+ InstallOptionalHaikuImagePackage libtool-2.2.6a-gcc2-2008-11-09
+ : $(baseURL)/libtool-2.2.6a-gcc2-2008-11-09.zip
+ :
+ ;
+ InstallOptionalHaikuImagePackage m4-1.4.12-gcc2-2008-11-04
+ : $(baseURL)/m4-1.4.12-gcc2-2008-11-04.zip
+ :
+ ;
+ InstallOptionalHaikuImagePackage texinfo-4.13a-gcc2-2008-11-09
+ : $(baseURL)/texinfo-4.13a-gcc2-2008-11-09.zip
+ :
+ ;
+
+ if $(HAIKU_GCC_VERSION[1]) = 4 {
# gcc and binutils
local baseURL = http://haiku.mlotz.ch ;
InstallOptionalHaikuImagePackage gcc-4.3.3-haiku-090129
: $(baseURL)/gcc-4.3.3-haiku-090129.zip
:
;
-
- # Setup the proper gnupro symlink. Both packages provide one and on
- # a GCC2 based hybrid the GCC4 package will overwrite the one present.
- # Since we want to use GCC2 as the host compiler on a GCC2 base we have
- # to correct this again.
- if $(HAIKU_GCC_VERSION[1]) = 2 {
- AddSymlinkToHaikuImage develop tools
- : /boot/develop/tools/gcc-2.95.3-haiku-081024 : gnupro ;
- }
}
}
From korli at mail.berlios.de Sun Feb 8 13:46:06 2009
From: korli at mail.berlios.de (korli at BerliOS)
Date: Sun, 8 Feb 2009 13:46:06 +0100
Subject: [Haiku-commits] r29159 - haiku/trunk/src/apps/packageinstaller
Message-ID: <200902081246.n18Ck6oj023881@sheep.berlios.de>
Author: korli
Date: 2009-02-08 13:46:05 +0100 (Sun, 08 Feb 2009)
New Revision: 29159
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29159&view=rev
Modified:
haiku/trunk/src/apps/packageinstaller/PackageView.cpp
Log:
* exits on invalid packages
* added messages on errors
Modified: haiku/trunk/src/apps/packageinstaller/PackageView.cpp
===================================================================
--- haiku/trunk/src/apps/packageinstaller/PackageView.cpp 2009-02-08 12:40:16 UTC (rev 29158)
+++ haiku/trunk/src/apps/packageinstaller/PackageView.cpp 2009-02-08 12:46:05 UTC (rev 29159)
@@ -71,19 +71,7 @@
status_t ret = fInfo.InitCheck();
if (ret == B_OK)
_InitProfiles();
- else if (ret != B_NO_INIT) {
- BAlert *warning = new BAlert(T("parsing_failed"),
- T("I was unable to read the given package file.\nOne of the possible "
- "reasons for this might be that the requested file is not a valid "
- "BeOS .pkg package."), T("OK"), NULL, NULL, B_WIDTH_AS_USUAL,
- B_WARNING_ALERT);
- warning->Go();
- BWindow *parent = Window();
- if (parent && parent->Lock())
- parent->Quit();
- }
-
ResizeTo(Bounds().Width(), fInstall->Frame().bottom + 4);
}
@@ -97,6 +85,19 @@
void
PackageView::AttachedToWindow()
{
+ status_t ret = fInfo.InitCheck();
+ if (ret != B_OK && ret != B_NO_INIT) {
+ BAlert *warning = new BAlert(T("parsing_failed"),
+ T("I was unable to read the given package file.\nOne of the possible "
+ "reasons for this might be that the requested file is not a valid "
+ "BeOS .pkg package."), T("OK"), NULL, NULL, B_WIDTH_AS_USUAL,
+ B_WARNING_ALERT);
+ warning->Go();
+
+ Window()->PostMessage(B_QUIT_REQUESTED);
+ return;
+ }
+
// Set the window title
BWindow *parent = Window();
BString title;
@@ -170,12 +171,14 @@
else if (ret == B_FILE_EXISTS)
notify = new BAlert("installation_aborted",
T("The installation of the package has been aborted."), T("OK"));
- else
+ else {
notify = new BAlert("installation_failed", // TODO: Review this
T("The requested package failed to install on your system. This "
"might be a problem with the target package file. Please consult "
"this issue with the package distributor."), T("OK"), NULL,
NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
+ fprintf(stderr, "Error while installing the package : %s\n", strerror(ret));
+ }
notify->Go();
fStatusWindow->Hide();
fInstall->SetEnabled(true);
@@ -267,12 +270,16 @@
if (reinstall->Go() == 0) {
// Uninstall the package
err = packageInfo.Uninstall();
- if (err != B_OK)
+ if (err != B_OK) {
+ fprintf(stderr, "Error on uninstall\n");
return err;
+ }
err = packageInfo.SetTo(fInfo.GetName(), fInfo.GetVersion(), true);
- if (err != B_OK)
+ if (err != B_OK) {
+ fprintf(stderr, "Error on SetTo\n");
return err;
+ }
}
else {
// Abort the installation
@@ -281,13 +288,17 @@
}
else if (err == B_ENTRY_NOT_FOUND) {
err = packageInfo.SetTo(fInfo.GetName(), fInfo.GetVersion(), true);
- if (err != B_OK)
+ if (err != B_OK) {
+ fprintf(stderr, "Error on SetTo\n");
return err;
+ }
}
else if (fStatusWindow->Stopped())
return B_FILE_EXISTS;
- else
+ else {
+ fprintf(stderr, "returning on error\n");
return err;
+ }
fStatusWindow->StageStep(1, "Installing files and directories");
@@ -310,11 +321,13 @@
packageInfo.SetDescription(description.String());
packageInfo.SetSpaceNeeded(type->space_needed);
- for (i = 0;i < n;i++) {
+ for (i = 0; i < n; i++) {
iter = static_cast(type->items.ItemAt(i));
err = iter->WriteToPath(fCurrentPath.Path(), &installedTo);
- if (err != B_OK)
+ if (err != B_OK) {
+ fprintf(stderr, "Error while writing path %s\n", fCurrentPath.Path());
return err;
+ }
if (fStatusWindow->Stopped())
return B_FILE_EXISTS;
label = "";
From mmlr at mail.berlios.de Sun Feb 8 13:47:31 2009
From: mmlr at mail.berlios.de (mmlr at mail.berlios.de)
Date: Sun, 8 Feb 2009 13:47:31 +0100
Subject: [Haiku-commits] r29160 - haiku/trunk/build/jam
Message-ID: <200902081247.n18ClVPM023959@sheep.berlios.de>
Author: mmlr
Date: 2009-02-08 13:47:29 +0100 (Sun, 08 Feb 2009)
New Revision: 29160
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29160&view=rev
Modified:
haiku/trunk/build/jam/OptionalPackages
Log:
* Clean that up a bit and combine the ifs for GCC2/4.
* Also don't install the GCC2 package on a GCC4 based hybrid, as it's again not
usable without proper manual setup.
Modified: haiku/trunk/build/jam/OptionalPackages
===================================================================
--- haiku/trunk/build/jam/OptionalPackages 2009-02-08 12:46:05 UTC (rev 29159)
+++ haiku/trunk/build/jam/OptionalPackages 2009-02-08 12:47:29 UTC (rev 29160)
@@ -211,25 +211,28 @@
AddHeaderDirectoryToHaikuImage libs png : 3rdparty ;
AddHeaderDirectoryToHaikuImage libs zlib : 3rdparty ;
- if $(HAIKU_GCC_VERSION[1]) > 2 {
- # gcc 4
+ if $(HAIKU_GCC_VERSION[1]) = 2 {
+ # gcc and binutils
+ local baseURL = http://haiku-files.org/files/optional-packages ;
+ InstallOptionalHaikuImagePackage gcc-2.95.3-haiku-081024
+ : $(baseURL)/gcc-2.95.3-haiku-081024.zip
+ :
+ ;
- # symlink cpp to g++'s headers
- AddSymlinkToHaikuImage develop headers
- : /boot/develop/tools/gnupro/include/g++ : cpp ;
- } else {
- # gcc 2.95.3
-
AddHeaderDirectoryToHaikuImage cpp ;
}
- if $(HAIKU_GCC_VERSION[1]) = 2 || $(isHybridBuild) = 1 {
+ if $(HAIKU_GCC_VERSION[1]) = 4 {
# gcc and binutils
- local baseURL = http://haiku-files.org/files/optional-packages ;
- InstallOptionalHaikuImagePackage gcc-2.95.3-haiku-081024
- : $(baseURL)/gcc-2.95.3-haiku-081024.zip
+ local baseURL = http://haiku.mlotz.ch ;
+ InstallOptionalHaikuImagePackage gcc-4.3.3-haiku-090129
+ : $(baseURL)/gcc-4.3.3-haiku-090129.zip
:
;
+
+ # symlink cpp to g++'s headers
+ AddSymlinkToHaikuImage develop headers
+ : /boot/develop/tools/gnupro/include/g++ : cpp ;
}
# other tools
@@ -265,15 +268,6 @@
: $(baseURL)/texinfo-4.13a-gcc2-2008-11-09.zip
:
;
-
- if $(HAIKU_GCC_VERSION[1]) = 4 {
- # gcc and binutils
- local baseURL = http://haiku.mlotz.ch ;
- InstallOptionalHaikuImagePackage gcc-4.3.3-haiku-090129
- : $(baseURL)/gcc-4.3.3-haiku-090129.zip
- :
- ;
- }
}
From superstippi at gmx.de Sun Feb 8 14:03:20 2009
From: superstippi at gmx.de (Stephan Assmus)
Date: Sun, 08 Feb 2009 14:03:20 +0100
Subject: [Haiku-commits] r29159 - haiku/trunk/src/apps/packageinstaller
In-Reply-To: <200902081246.n18Ck6oj023881@sheep.berlios.de>
References: <200902081246.n18Ck6oj023881@sheep.berlios.de>
Message-ID: <20090208140320.2893.1@bepc.1234090311.fake>
korli at BerliOS wrote:
> Author: korli
> Date: 2009-02-08 13:46:05 +0100 (Sun, 08 Feb 2009) New Revision: 29159
> ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29159&view=rev
>
> Modified:
> haiku/trunk/src/apps/packageinstaller/PackageView.cpp
> Log:
> * exits on invalid packages
> * added messages on errors
BTW, can we reword the invalid package error message into a passive
statement? Somehow I feel whenever the computer speaks of itself as a
person that it sound less professional.
Best regards,
-Stephan
From mmlr at mail.berlios.de Sun Feb 8 14:20:21 2009
From: mmlr at mail.berlios.de (mmlr at mail.berlios.de)
Date: Sun, 8 Feb 2009 14:20:21 +0100
Subject: [Haiku-commits] r29161 - haiku/trunk
Message-ID: <200902081320.n18DKL7t030164@sheep.berlios.de>
Author: mmlr
Date: 2009-02-08 14:20:19 +0100 (Sun, 08 Feb 2009)
New Revision: 29161
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29161&view=rev
Modified:
haiku/trunk/Jamrules
Log:
Allow for a separate UserBuildConfig directly in the output directory (i.e.
generated). When not using build profiles this allows for separate configuration
per output directory. When using build profiles you could for example have a
different profile per output directory with the same name (so an @disk with
different settings per output dir for example).
Modified: haiku/trunk/Jamrules
===================================================================
--- haiku/trunk/Jamrules 2009-02-08 12:47:29 UTC (rev 29160)
+++ haiku/trunk/Jamrules 2009-02-08 13:20:19 UTC (rev 29161)
@@ -57,6 +57,13 @@
if $(userBuildConfig) {
include $(userBuildConfig) ;
}
+
+ # allow for a separate UserBuildConfig per output directory
+ local userBuildConfig
+ = [ GLOB $(HAIKU_OUTPUT_DIR) : UserBuildConfig ] ;
+ if $(userBuildConfig) {
+ include $(userBuildConfig) ;
+ }
}
include [ FDirName $(HAIKU_BUILD_RULES_DIR) ReleaseBuildProfiles ] ;
From korli at mail.berlios.de Sun Feb 8 15:19:06 2009
From: korli at mail.berlios.de (korli at BerliOS)
Date: Sun, 8 Feb 2009 15:19:06 +0100
Subject: [Haiku-commits] r29162 - haiku/trunk/src/apps/packageinstaller
Message-ID: <200902081419.n18EJ6V0004318@sheep.berlios.de>
Author: korli
Date: 2009-02-08 15:19:06 +0100 (Sun, 08 Feb 2009)
New Revision: 29162
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29162&view=rev
Modified:
haiku/trunk/src/apps/packageinstaller/PackageView.cpp
Log:
Changed the error message for unreadable packages to be a passive one, as suggested by Stephan.
Modified: haiku/trunk/src/apps/packageinstaller/PackageView.cpp
===================================================================
--- haiku/trunk/src/apps/packageinstaller/PackageView.cpp 2009-02-08 13:20:19 UTC (rev 29161)
+++ haiku/trunk/src/apps/packageinstaller/PackageView.cpp 2009-02-08 14:19:06 UTC (rev 29162)
@@ -88,7 +88,7 @@
status_t ret = fInfo.InitCheck();
if (ret != B_OK && ret != B_NO_INIT) {
BAlert *warning = new BAlert(T("parsing_failed"),
- T("I was unable to read the given package file.\nOne of the possible "
+ T("The package file is not readable.\nOne of the possible "
"reasons for this might be that the requested file is not a valid "
"BeOS .pkg package."), T("OK"), NULL, NULL, B_WIDTH_AS_USUAL,
B_WARNING_ALERT);
From korli at users.berlios.de Sun Feb 8 15:19:29 2009
From: korli at users.berlios.de (=?ISO-8859-1?B?Suly9G1lIER1dmFs?=)
Date: Sun, 8 Feb 2009 15:19:29 +0100
Subject: [Haiku-commits] r29159 - haiku/trunk/src/apps/packageinstaller
In-Reply-To: <20090208140320.2893.1@bepc.1234090311.fake>
References: <200902081246.n18Ck6oj023881@sheep.berlios.de>
<20090208140320.2893.1@bepc.1234090311.fake>
Message-ID:
2009/2/8 Stephan Assmus
> BTW, can we reword the invalid package error message into a passive
> statement? Somehow I feel whenever the computer speaks of itself as a
> person that it sound less professional.
>
Done in r29162.
Bye,
J?r?me
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From anevilyak at mail.berlios.de Sun Feb 8 15:33:22 2009
From: anevilyak at mail.berlios.de (anevilyak at BerliOS)
Date: Sun, 8 Feb 2009 15:33:22 +0100
Subject: [Haiku-commits] r29163 - haiku/trunk/src/kits/tracker
Message-ID: <200902081433.n18EXMK3005983@sheep.berlios.de>
Author: anevilyak
Date: 2009-02-08 15:33:22 +0100 (Sun, 08 Feb 2009)
New Revision: 29163
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29163&view=rev
Modified:
haiku/trunk/src/kits/tracker/PoseView.cpp
Log:
Disallow move to trash and/or delete operations from read-only volumes. This fixes ticket #3421.
Modified: haiku/trunk/src/kits/tracker/PoseView.cpp
===================================================================
--- haiku/trunk/src/kits/tracker/PoseView.cpp 2009-02-08 14:19:06 UTC (rev 29162)
+++ haiku/trunk/src/kits/tracker/PoseView.cpp 2009-02-08 14:33:22 UTC (rev 29163)
@@ -5351,6 +5351,22 @@
}
+static bool
+CheckVolumeReadOnly(const entry_ref *ref)
+{
+ BVolume volume (ref->device);
+ if (volume.IsReadOnly()) {
+ BAlert *alert (new BAlert ("", "Files cannot be moved or deleted "
+ "from a read-only volume.", "Cancel", NULL, NULL,
+ B_WIDTH_AS_USUAL, B_STOP_ALERT));
+ alert->Go();
+ return false;
+ }
+
+ return true;
+}
+
+
void
BPoseView::MoveSelectionOrEntryToTrash(const entry_ref *ref, bool selectNext)
{
@@ -5361,9 +5377,13 @@
std::map deviceHasTrash;
if (ref) {
+ if (!CheckVolumeReadOnly(ref))
+ return;
CopyOneTrashedRefAsEntry(ref, entriesToTrash, entriesToDeleteOnTheSpot,
&deviceHasTrash);
} else {
+ if (!CheckVolumeReadOnly(fSelectionList->ItemAt(0)->TargetModel()->EntryRef()))
+ return;
EachListItem(fSelectionList, CopyPoseOneAsEntry, entriesToTrash,
entriesToDeleteOnTheSpot, &deviceHasTrash);
}
@@ -5416,6 +5436,9 @@
if (count <= 0)
return;
+ if (!CheckVolumeReadOnly(fSelectionList->ItemAt(0)->TargetModel()->EntryRef()))
+ return;
+
BObjectList *entriesToDelete = new BObjectList(count, true);
for (int32 index = 0; index < count; index++)
From superstippi at gmx.de Sun Feb 8 15:34:09 2009
From: superstippi at gmx.de (Stephan Assmus)
Date: Sun, 08 Feb 2009 15:34:09 +0100
Subject: [Haiku-commits] r29159 - haiku/trunk/src/apps/packageinstaller
In-Reply-To:
References: <200902081246.n18Ck6oj023881@sheep.berlios.de>
<20090208140320.2893.1@bepc.1234090311.fake>
Message-ID: <20090208153409.3471.3@bepc.1234090311.fake>
J?r?me Duval wrote:
> 2009/2/8 Stephan Assmus
>
> > BTW, can we reword the invalid package error message into a passive
> > statement? Somehow I feel whenever the computer speaks of itself as a
> > person that it sound less professional.
> >
>
> Done in r29162.
Cool, thanks!
Best regards,
-Stephan
From mmlr at mail.berlios.de Sun Feb 8 15:53:54 2009
From: mmlr at mail.berlios.de (mmlr at mail.berlios.de)
Date: Sun, 8 Feb 2009 15:53:54 +0100
Subject: [Haiku-commits] r29164 - haiku/trunk/build/jam
Message-ID: <200902081453.n18Ers4f008099@sheep.berlios.de>
Author: mmlr
Date: 2009-02-08 15:53:53 +0100 (Sun, 08 Feb 2009)
New Revision: 29164
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29164&view=rev
Modified:
haiku/trunk/build/jam/OptionalPackages
Log:
Fix base URL I accidently messed up.
Modified: haiku/trunk/build/jam/OptionalPackages
===================================================================
--- haiku/trunk/build/jam/OptionalPackages 2009-02-08 14:33:22 UTC (rev 29163)
+++ haiku/trunk/build/jam/OptionalPackages 2009-02-08 14:53:53 UTC (rev 29164)
@@ -236,6 +236,7 @@
}
# other tools
+ local baseURL = http://haiku-files.org/files/optional-packages ;
InstallOptionalHaikuImagePackage autoconf-2.63-gcc2-2008-11-05
: $(baseURL)/autoconf-2.63-gcc2-2008-11-05.zip
:
From anevilyak at mail.berlios.de Sun Feb 8 17:00:46 2009
From: anevilyak at mail.berlios.de (anevilyak at BerliOS)
Date: Sun, 8 Feb 2009 17:00:46 +0100
Subject: [Haiku-commits] r29165 - haiku/trunk/src/kits/tracker
Message-ID: <200902081600.n18G0krI019345@sheep.berlios.de>
Author: anevilyak
Date: 2009-02-08 17:00:46 +0100 (Sun, 08 Feb 2009)
New Revision: 29165
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29165&view=rev
Modified:
haiku/trunk/src/kits/tracker/PoseView.cpp
Log:
Don't leak memory when aborting operations due to read-only volume.
Modified: haiku/trunk/src/kits/tracker/PoseView.cpp
===================================================================
--- haiku/trunk/src/kits/tracker/PoseView.cpp 2009-02-08 14:53:53 UTC (rev 29164)
+++ haiku/trunk/src/kits/tracker/PoseView.cpp 2009-02-08 16:00:46 UTC (rev 29165)
@@ -5377,13 +5377,19 @@
std::map deviceHasTrash;
if (ref) {
- if (!CheckVolumeReadOnly(ref))
+ if (!CheckVolumeReadOnly(ref)) {
+ delete entriesToTrash;
+ delete entriesToDeleteOnTheSpot;
return;
+ }
CopyOneTrashedRefAsEntry(ref, entriesToTrash, entriesToDeleteOnTheSpot,
&deviceHasTrash);
} else {
- if (!CheckVolumeReadOnly(fSelectionList->ItemAt(0)->TargetModel()->EntryRef()))
+ if (!CheckVolumeReadOnly(fSelectionList->ItemAt(0)->TargetModel()->EntryRef())) {
+ delete entriesToTrash;
+ delete entriesToDeleteOnTheSpot;
return;
+ }
EachListItem(fSelectionList, CopyPoseOneAsEntry, entriesToTrash,
entriesToDeleteOnTheSpot, &deviceHasTrash);
}
From mmlr at mail.berlios.de Sun Feb 8 17:55:46 2009
From: mmlr at mail.berlios.de (mmlr at mail.berlios.de)
Date: Sun, 8 Feb 2009 17:55:46 +0100
Subject: [Haiku-commits] r29166 -
haiku/trunk/src/add-ons/kernel/file_systems/cdda
Message-ID: <200902081655.n18Gtk3f025143@sheep.berlios.de>
Author: mmlr
Date: 2009-02-08 17:55:45 +0100 (Sun, 08 Feb 2009)
New Revision: 29166
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29166&view=rev
Modified:
haiku/trunk/src/add-ons/kernel/file_systems/cdda/kernel_interface.cpp
Log:
Only try to store attributes on destruction if the required root node is available. Should fix bug #3426 where an incompletely constructed volume object is deleted.
Modified: haiku/trunk/src/add-ons/kernel/file_systems/cdda/kernel_interface.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/file_systems/cdda/kernel_interface.cpp 2009-02-08 16:00:46 UTC (rev 29165)
+++ haiku/trunk/src/add-ons/kernel/file_systems/cdda/kernel_interface.cpp 2009-02-08 16:55:45 UTC (rev 29166)
@@ -508,10 +508,13 @@
Volume::~Volume()
{
- _StoreAttributes();
- _StoreSharedAttributes();
+ if (fRootNode) {
+ _StoreAttributes();
+ _StoreSharedAttributes();
+ }
- close(fDevice);
+ if (fDevice >= 0)
+ close(fDevice);
// put_vnode on the root to release the ref to it
if (fRootNode)
From umccullough at gmail.com Sun Feb 8 17:57:31 2009
From: umccullough at gmail.com (Urias McCullough)
Date: Sun, 8 Feb 2009 08:57:31 -0800
Subject: [Haiku-commits] r29147 -
haiku/trunk/docs/userguide/en/installation
In-Reply-To: <498E8F2F.1090809@googlemail.com>
References: <200902071402.n17E2Juo027034@sheep.berlios.de>
<1e80d8750902070747hfac80ebu6425efcdfe778dd9@mail.gmail.com>
<498DC24E.30002@googlemail.com>
<1e80d8750902070939r5f250b95r25654d6f2c339a77@mail.gmail.com>
<498DDA7A.5070500@googlemail.com>
<1e80d8750902071123oc55fdbbj194d8e61e15df245@mail.gmail.com>
<498E8F2F.1090809@googlemail.com>
Message-ID: <1e80d8750902080857xd949cf3t8467237edeca6585@mail.gmail.com>
On Sat, Feb 7, 2009 at 11:52 PM, Humdinger wrote:
> Urias McCullough wrote:
>> I think my current dislike for the "guides" and "forum posts" is that
>> there's no collaborative location where people can improve on the
>> instructions and add information for other platforms and
>> configurations.
>
> Originally, the user guide was supposed to be created as a wiki. But for some reason it
> never happened on haiku-os.org, so it was started at haikuware.com. Since using and
Goes back to my original point - why is compiling haiku in the user guide?
Anyhow, I guess I'll raise this question again on the haiku doc
list... when it itches me again, otherwise I'm pretty much too lazy
these days.
From anevilyak at mail.berlios.de Sun Feb 8 19:39:41 2009
From: anevilyak at mail.berlios.de (anevilyak at BerliOS)
Date: Sun, 8 Feb 2009 19:39:41 +0100
Subject: [Haiku-commits] r29167 - haiku/trunk/src/kits/tracker
Message-ID: <200902081839.n18Idf8E020969@sheep.berlios.de>
Author: anevilyak
Date: 2009-02-08 19:39:39 +0100 (Sun, 08 Feb 2009)
New Revision: 29167
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29167&view=rev
Modified:
haiku/trunk/src/kits/tracker/PoseView.cpp
Log:
Reset the cursor check state if we drag over a pose that's not a suitable DnD destination for the drag. Otherwise we'll reset the cursor back to the move state and never set to copy again unless we exit/reenter the window. Thanks to luroh for reporting.
Modified: haiku/trunk/src/kits/tracker/PoseView.cpp
===================================================================
--- haiku/trunk/src/kits/tracker/PoseView.cpp 2009-02-08 16:55:45 UTC (rev 29166)
+++ haiku/trunk/src/kits/tracker/PoseView.cpp 2009-02-08 18:39:39 UTC (rev 29167)
@@ -8704,6 +8704,7 @@
// new target is valid, select it
HiliteDropTarget(true);
} else {
+ fCursorCheck = false;
fDropTarget = NULL;
if (targetPose == NULL)
targetModel = TargetModel();
From stippi at mail.berlios.de Sun Feb 8 22:14:15 2009
From: stippi at mail.berlios.de (stippi at BerliOS)
Date: Sun, 8 Feb 2009 22:14:15 +0100
Subject: [Haiku-commits] r29168 - haiku/trunk/src/tests/kits/interface/look
Message-ID: <200902082114.n18LEFrb007980@sheep.berlios.de>
Author: stippi
Date: 2009-02-08 22:14:15 +0100 (Sun, 08 Feb 2009)
New Revision: 29168
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29168&view=rev
Modified:
haiku/trunk/src/tests/kits/interface/look/Look.cpp
Log:
Show more controls.
Modified: haiku/trunk/src/tests/kits/interface/look/Look.cpp
===================================================================
--- haiku/trunk/src/tests/kits/interface/look/Look.cpp 2009-02-08 18:39:39 UTC (rev 29167)
+++ haiku/trunk/src/tests/kits/interface/look/Look.cpp 2009-02-08 21:14:15 UTC (rev 29168)
@@ -38,12 +38,16 @@
ControlType* control1 = new ControlType("Enabled", NULL);
ControlType* control2 = new ControlType("Disabled", NULL);
control2->SetEnabled(false);
- ControlType* control3 = new ControlType("On", NULL);
+ ControlType* control3 = new ControlType("Enabled", NULL);
control3->SetValue(B_CONTROL_ON);
+ ControlType* control4 = new ControlType("Disabled", NULL);
+ control4->SetValue(B_CONTROL_ON);
+ control4->SetEnabled(false);
layout->AddView(control1, 0, row);
layout->AddView(control2, 1, row);
layout->AddView(control3, 2, row);
+ layout->AddView(control4, 3, row);
row++;
}
@@ -58,9 +62,8 @@
BMenuField* control2 = new BMenuField("Disabled", menu2, NULL);
control2->SetEnabled(false);
- layout->AddView(BGroupLayoutBuilder(B_HORIZONTAL, 5)
- .Add(control1)
- .Add(control2), 0, row, 3);
+ layout->AddView(control1, 0, row, 2);
+ layout->AddView(control2, 2, row, 2);
row++;
}
@@ -73,9 +76,8 @@
BTextControl* control2 = new BTextControl("Disabled", "More Text", NULL);
control2->SetEnabled(false);
- layout->AddView(BGroupLayoutBuilder(B_HORIZONTAL, 5)
- .Add(control1)
- .Add(control2), 0, row, 3);
+ layout->AddView(control1, 0, row, 2);
+ layout->AddView(control2, 2, row, 2);
row++;
}
@@ -95,9 +97,8 @@
control2->SetHashMarkCount(10);
control2->SetHashMarks(B_HASH_MARKS_BOTTOM);
- layout->AddView(BGroupLayoutBuilder(B_HORIZONTAL, 5)
- .Add(control1)
- .Add(control2), 0, row, 3);
+ layout->AddView(control1, 0, row, 2);
+ layout->AddView(control2, 2, row, 2);
row++;
@@ -107,17 +108,60 @@
B_HORIZONTAL, B_TRIANGLE_THUMB);
control2->SetEnabled(false);
+ rgb_color fillColor = (rgb_color){ 255, 115, 0, 255 };
+
control1->SetLimitLabels("Min", "Max");
+ control1->UseFillColor(true, &fillColor);
+ control1->SetValue(20);
+
control2->SetLimitLabels("1", "100");
+ control2->UseFillColor(true, &fillColor);
+ control2->SetValue(10);
- layout->AddView(BGroupLayoutBuilder(B_HORIZONTAL, 5)
- .Add(control1)
- .Add(control2), 0, row, 3);
+ layout->AddView(control1, 0, row, 2);
+ layout->AddView(control2, 2, row, 2);
row++;
}
+void
+add_status_bars(BGridLayout* layout, int32& row)
+{
+ BBox* box = new BBox(B_FANCY_BORDER, NULL);
+ box->SetLabel("Info");
+
+ BGroupLayout* boxLayout = new BGroupLayout(B_VERTICAL, 5);
+ boxLayout->SetInsets(8, 8 + box->TopBorderOffset(), 8, 8);
+ box->SetLayout(boxLayout);
+
+ BStatusBar* statusBar = new BStatusBar("status bar", "Status",
+ "Completed");
+ statusBar->SetMaxValue(100);
+ statusBar->SetTo(0);
+ statusBar->SetBarHeight(12);
+ boxLayout->AddView(statusBar);
+
+ statusBar = new BStatusBar("status bar", "Progress",
+ "Completed");
+ statusBar->SetMaxValue(100);
+ statusBar->SetTo(40);
+ statusBar->SetBarHeight(12);
+ boxLayout->AddView(statusBar);
+
+ statusBar = new BStatusBar("status bar", "Lifespan of capitalism",
+ "Completed");
+ statusBar->SetMaxValue(100);
+ statusBar->SetTo(100);
+ statusBar->SetBarHeight(12);
+ boxLayout->AddView(statusBar);
+
+ layout->AddView(box, 0, row, 4);
+
+ row++;
+}
+
+
int
main(int argc, char** argv)
{
@@ -133,11 +177,14 @@
// create some controls
BListView* listView = new BListView();
- listView->AddItem(new BStringItem("List Item 1"));
- listView->AddItem(new BStringItem("List Item 2"));
+ for (int32 i = 0; i < 20; i++) {
+ BString itemLabel("List Item ");
+ itemLabel << i + 1;
+ listView->AddItem(new BStringItem(itemLabel.String()));
+ }
BScrollView* scrollView = new BScrollView("scroller", listView, 0,
true, true);
- scrollView->SetExplicitMinSize(BSize(300, 80));
+ scrollView->SetExplicitMinSize(BSize(300, 140));
BGridView* controls = new BGridView(5.0f, 5.0f);
BGridLayout* layout = controls->GridLayout();
@@ -150,19 +197,11 @@
add_menu_fields(layout, row);
add_text_controls(layout, row);
add_sliders(layout, row);
+ add_status_bars(layout, row);
- BStatusBar* statusBar = new BStatusBar("status bar", "Status",
- "Completed");
- statusBar->SetMaxValue(100);
- statusBar->SetTo(40);
- statusBar->SetBarHeight(12);
- layout->AddView(statusBar, 0, row, 3);
-
- row++;
-
BColorControl* colorControl = new BColorControl(B_ORIGIN, B_CELLS_32x8,
8.0f, "color control");
- layout->AddView(colorControl, 0, row, 3);
+ layout->AddView(colorControl, 0, row, 4);
BTabView* tabView = new BTabView("tab view", B_WIDTH_FROM_WIDEST);
BView* content = BGroupLayoutBuilder(B_VERTICAL, 5)
From mmlr at mail.berlios.de Sun Feb 8 22:38:31 2009
From: mmlr at mail.berlios.de (mmlr at mail.berlios.de)
Date: Sun, 8 Feb 2009 22:38:31 +0100
Subject: [Haiku-commits] r29169 - haiku/trunk/src/system/kernel/debug
Message-ID: <200902082138.n18LcVbi011514@sheep.berlios.de>
Author: mmlr
Date: 2009-02-08 22:38:30 +0100 (Sun, 08 Feb 2009)
New Revision: 29169
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29169&view=rev
Modified:
haiku/trunk/src/system/kernel/debug/blue_screen.cpp
Log:
Allow pressing 'p' to disable paging during boot debug output.
Modified: haiku/trunk/src/system/kernel/debug/blue_screen.cpp
===================================================================
--- haiku/trunk/src/system/kernel/debug/blue_screen.cpp 2009-02-08 21:14:15 UTC (rev 29168)
+++ haiku/trunk/src/system/kernel/debug/blue_screen.cpp 2009-02-08 21:38:30 UTC (rev 29169)
@@ -125,7 +125,7 @@
// output
const char *text = in_command_invocation()
? "Press key to continue, Q to quit, S to skip output"
- : "Press key to continue, Q or S to skip output";
+ : "Press key to continue, S to skip output, P to disable paging";
int32 length = strlen(text);
if (sScreen.x + length > sScreen.columns) {
// make sure we don't overwrite too much
@@ -142,10 +142,11 @@
char c = blue_screen_getchar();
if (c == 's') {
sScreen.ignore_output = true;
- } else if (c == 'q') {
- abortCommand = in_command_invocation();
+ } else if (c == 'q' && in_command_invocation()) {
+ abortCommand = true;
sScreen.ignore_output = true;
- }
+ } else if (c == 'p' && !in_command_invocation())
+ sScreen.paging = false;
// remove on screen text again
sModule->fill_glyph(sScreen.columns - length, sScreen.y, length,
From anevilyak at mail.berlios.de Sun Feb 8 23:59:07 2009
From: anevilyak at mail.berlios.de (anevilyak at BerliOS)
Date: Sun, 8 Feb 2009 23:59:07 +0100
Subject: [Haiku-commits] r29170 - haiku/trunk/src/preferences/touchpad
Message-ID: <200902082259.n18Mx7mB020966@sheep.berlios.de>
Author: anevilyak
Date: 2009-02-08 23:59:06 +0100 (Sun, 08 Feb 2009)
New Revision: 29170
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29170&view=rev
Modified:
haiku/trunk/src/preferences/touchpad/main.cpp
Log:
Minor fix I noticed by accident: touchpad pref's BApplication signature didn't match the one declared in its rdef.
Modified: haiku/trunk/src/preferences/touchpad/main.cpp
===================================================================
--- haiku/trunk/src/preferences/touchpad/main.cpp 2009-02-08 21:38:30 UTC (rev 29169)
+++ haiku/trunk/src/preferences/touchpad/main.cpp 2009-02-08 22:59:06 UTC (rev 29170)
@@ -27,7 +27,7 @@
int
main(int argc, char* argv[])
{
- BApplication *app = new BApplication("application/touchpadpref");
+ BApplication *app = new BApplication("application/x-vnd.Haiku-Touchpad");
TouchpadPrefWindow *window = new TouchpadPrefWindow(BRect(50, 50, 450, 350),"Touchpad", B_TITLED_WINDOW,
B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_AVOID_FRONT | B_ASYNCHRONOUS_CONTROLS);
window->AddChild(new TouchpadPrefView(window->Bounds(), "TouchpadPrefView"));
From anevilyak at mail.berlios.de Mon Feb 9 06:19:52 2009
From: anevilyak at mail.berlios.de (anevilyak at BerliOS)
Date: Mon, 9 Feb 2009 06:19:52 +0100
Subject: [Haiku-commits] r29171 - haiku/trunk/src/kits/tracker
Message-ID: <200902090519.n195JqtM021958@sheep.berlios.de>
Author: anevilyak
Date: 2009-02-09 06:19:50 +0100 (Mon, 09 Feb 2009)
New Revision: 29171
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29171&view=rev
Modified:
haiku/trunk/src/kits/tracker/PoseView.cpp
Log:
Slight logic cleanup that prevents excessively rechecking the drop target in some instances.
Modified: haiku/trunk/src/kits/tracker/PoseView.cpp
===================================================================
--- haiku/trunk/src/kits/tracker/PoseView.cpp 2009-02-08 22:59:06 UTC (rev 29170)
+++ haiku/trunk/src/kits/tracker/PoseView.cpp 2009-02-09 05:19:50 UTC (rev 29171)
@@ -8700,16 +8700,18 @@
targetModel = &tmpTarget;
bool ignoreTypes = (modifiers() & B_CONTROL_KEY) != 0;
- if (targetPose && CanHandleDragSelection(targetModel, dragMessage, ignoreTypes)) {
- // new target is valid, select it
- HiliteDropTarget(true);
- } else {
- fCursorCheck = false;
- fDropTarget = NULL;
- if (targetPose == NULL)
- targetModel = TargetModel();
- }
-
+ if (targetPose) {
+ if (CanHandleDragSelection(targetModel, dragMessage, ignoreTypes)) {
+ // new target is valid, select it
+ HiliteDropTarget(true);
+ } else {
+ fDropTarget = NULL;
+ fCursorCheck = false;
+ }
+ }
+ if (targetModel == NULL)
+ targetModel = TargetModel();
+
entry_ref srcRef;
if (targetModel->IsDirectory() && dragMessage->HasRef("refs")
&& dragMessage->FindRef("refs", &srcRef) == B_OK) {
From colacoder at mail.berlios.de Mon Feb 9 17:42:21 2009
From: colacoder at mail.berlios.de (colacoder at mail.berlios.de)
Date: Mon, 9 Feb 2009 17:42:21 +0100
Subject: [Haiku-commits] r29172 -
haiku/trunk/src/add-ons/kernel/drivers/audio/hda
Message-ID: <200902091642.n19GgLOF004815@sheep.berlios.de>
Author: colacoder
Date: 2009-02-09 17:42:04 +0100 (Mon, 09 Feb 2009)
New Revision: 29172
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29172&view=rev
Modified:
haiku/trunk/src/add-ons/kernel/drivers/audio/hda/hda_controller.cpp
Log:
Do not enable interrupts on codec status change, since we do not handle those. This fixes the lockup on the EeePC, and follows the description in the HDA specs.
Modified: haiku/trunk/src/add-ons/kernel/drivers/audio/hda/hda_controller.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/drivers/audio/hda/hda_controller.cpp 2009-02-09 05:19:50 UTC (rev 29171)
+++ haiku/trunk/src/add-ons/kernel/drivers/audio/hda/hda_controller.cpp 2009-02-09 16:42:04 UTC (rev 29172)
@@ -789,9 +789,15 @@
dprintf("hda: init_corb_rirb_pos failed\n");
goto corb_rirb_failed;
}
-
- controller->Write16(HDAC_WAKE_ENABLE, 0x7fff);
+ /*
+ * Don't enable codec state change interrupts. We don't handle
+ * them, as we want to use the STATE_STATUS register to identify
+ * available codecs. We'd have to clear that register in the interrupt
+ * handler to 'ack' the codec change.
+ */
+ controller->Write16(HDAC_WAKE_ENABLE, 0x0);
+
/* Enable controller interrupts */
controller->Write32(HDAC_INTR_CONTROL, INTR_CONTROL_GLOBAL_ENABLE
| INTR_CONTROL_CONTROLLER_ENABLE);
From anevilyak at gmail.com Mon Feb 9 19:27:05 2009
From: anevilyak at gmail.com (Rene Gollent)
Date: Mon, 9 Feb 2009 12:27:05 -0600
Subject: [Haiku-commits] r29172 -
haiku/trunk/src/add-ons/kernel/drivers/audio/hda
In-Reply-To: <200902091642.n19GgLOF004815@sheep.berlios.de>
References: <200902091642.n19GgLOF004815@sheep.berlios.de>
Message-ID:
On Mon, Feb 9, 2009 at 10:42 AM, wrote:
> Author: colacoder
> Log:
> Do not enable interrupts on codec status change, since we do not handle those. This fixes the lockup on the EeePC, and follows the description in the HDA specs.
Nice! :) Does the driver now work correctly on the Eee as well, or
does it just not lock up any more? :)
Regards,
Rene
From korli at mail.berlios.de Mon Feb 9 20:06:45 2009
From: korli at mail.berlios.de (korli at BerliOS)
Date: Mon, 9 Feb 2009 20:06:45 +0100
Subject: [Haiku-commits] r29173 - haiku/trunk/headers/build
Message-ID: <200902091906.n19J6jLi010007@sheep.berlios.de>
Author: korli
Date: 2009-02-09 20:06:44 +0100 (Mon, 09 Feb 2009)
New Revision: 29173
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29173&view=rev
Modified:
haiku/trunk/headers/build/HaikuBuildCompatibility.h
Log:
add spinlock initializer constant for BeOS
Modified: haiku/trunk/headers/build/HaikuBuildCompatibility.h
===================================================================
--- haiku/trunk/headers/build/HaikuBuildCompatibility.h 2009-02-09 16:42:04 UTC (rev 29172)
+++ haiku/trunk/headers/build/HaikuBuildCompatibility.h 2009-02-09 19:06:44 UTC (rev 29173)
@@ -61,6 +61,10 @@
# define B_FIRST_REAL_TIME_PRIORITY B_REAL_TIME_DISPLAY_PRIORITY
#endif
+#ifndef B_SPINLOCK_INITIALIZER
+# define B_SPINLOCK_INITIALIZER 0
+#endif
+
#if __GNUC__
# define _PRINTFLIKE(_format_, _args_) \
__attribute__((format(__printf__, _format_, _args_)))
From korli at mail.berlios.de Mon Feb 9 22:03:33 2009
From: korli at mail.berlios.de (korli at BerliOS)
Date: Mon, 9 Feb 2009 22:03:33 +0100
Subject: [Haiku-commits] r29174 -
haiku/trunk/src/add-ons/kernel/drivers/audio/ac97/geode
Message-ID: <200902092103.n19L3Xad022325@sheep.berlios.de>
Author: korli
Date: 2009-02-09 22:03:31 +0100 (Mon, 09 Feb 2009)
New Revision: 29174
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29174&view=rev
Modified:
haiku/trunk/src/add-ons/kernel/drivers/audio/ac97/geode/driver.cpp
haiku/trunk/src/add-ons/kernel/drivers/audio/ac97/geode/geode_controller.cpp
Log:
* actually allocates and frees geode_multi struct
* also detect NS version of the chip
Modified: haiku/trunk/src/add-ons/kernel/drivers/audio/ac97/geode/driver.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/drivers/audio/ac97/geode/driver.cpp 2009-02-09 19:06:44 UTC (rev 29173)
+++ haiku/trunk/src/add-ons/kernel/drivers/audio/ac97/geode/driver.cpp 2009-02-09 21:03:31 UTC (rev 29174)
@@ -55,8 +55,10 @@
for (i = 0; gPci->get_nth_pci_info(i, &info) == B_OK
&& gNumCards < MAX_CARDS; i++) {
- if (info.vendor_id == AMD_VENDOR_ID
- && info.device_id == AMD_CS5536_AUDIO_DEVICE_ID) {
+ if ((info.vendor_id == AMD_VENDOR_ID
+ && info.device_id == AMD_CS5536_AUDIO_DEVICE_ID)
+ || (info.vendor_id == NS_VENDOR_ID
+ && info.device_id == NS_CS5535_AUDIO_DEVICE_ID)) {
memset(&gCards[gNumCards], 0, sizeof(geode_controller));
gCards[gNumCards].pci_info = info;
gCards[gNumCards].opened = 0;
Modified: haiku/trunk/src/add-ons/kernel/drivers/audio/ac97/geode/geode_controller.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/drivers/audio/ac97/geode/geode_controller.cpp 2009-02-09 19:06:44 UTC (rev 29173)
+++ haiku/trunk/src/add-ons/kernel/drivers/audio/ac97/geode/geode_controller.cpp 2009-02-09 21:03:31 UTC (rev 29174)
@@ -425,6 +425,10 @@
snooze(1000);
+ controller->multi = (geode_multi*)calloc(1, sizeof(geode_multi));
+ if (controller->multi == NULL)
+ return B_NO_MEMORY;
+
controller->playback_stream = geode_stream_new(controller, STREAM_PLAYBACK);
controller->record_stream = geode_stream_new(controller, STREAM_RECORD);
@@ -482,6 +486,8 @@
controller->regs = NULL;
}
+ free(controller->multi);
+
geode_stream_delete(controller->playback_stream);
geode_stream_delete(controller->record_stream);
From korli at mail.berlios.de Mon Feb 9 23:31:12 2009
From: korli at mail.berlios.de (korli at BerliOS)
Date: Mon, 9 Feb 2009 23:31:12 +0100
Subject: [Haiku-commits] r29175 -
haiku/trunk/src/add-ons/kernel/drivers/audio/hda
Message-ID: <200902092231.n19MVC01000520@sheep.berlios.de>
Author: korli
Date: 2009-02-09 23:31:10 +0100 (Mon, 09 Feb 2009)
New Revision: 29175
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29175&view=rev
Modified:
haiku/trunk/src/add-ons/kernel/drivers/audio/hda/hda_codec.cpp
Log:
fix beeper widget on more codecs
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 2009-02-09 21:03:31 UTC (rev 29174)
+++ haiku/trunk/src/add-ons/kernel/drivers/audio/hda/hda_codec.cpp 2009-02-09 22:31:10 UTC (rev 29175)
@@ -537,8 +537,15 @@
/* Check specific node ids declared as inputs as beepers */
switch ((audioGroup->codec->vendor_id << 16) | audioGroup->codec->product_id) {
+ case 0x11d41882:
+ case 0x11d41883:
+ case 0x11d41884:
+ case 0x11d4194a:
+ case 0x11d4194b:
+ case 0x11d41987:
case 0x11d41988:
case 0x11d4198b:
+ case 0x11d4989b:
if (nodeID == 26)
widget.type = WT_BEEP_GENERATOR;
break;
From korli at mail.berlios.de Mon Feb 9 23:33:02 2009
From: korli at mail.berlios.de (korli at BerliOS)
Date: Mon, 9 Feb 2009 23:33:02 +0100
Subject: [Haiku-commits] r29176 - haiku/trunk/src/preferences/keymap
Message-ID: <200902092233.n19MX26A001090@sheep.berlios.de>
Author: korli
Date: 2009-02-09 23:33:01 +0100 (Mon, 09 Feb 2009)
New Revision: 29176
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29176&view=rev
Modified:
haiku/trunk/src/preferences/keymap/KeymapWindow.cpp
Log:
fix #3414. Quits when the window is active.
Modified: haiku/trunk/src/preferences/keymap/KeymapWindow.cpp
===================================================================
--- haiku/trunk/src/preferences/keymap/KeymapWindow.cpp 2009-02-09 22:31:10 UTC (rev 29175)
+++ haiku/trunk/src/preferences/keymap/KeymapWindow.cpp 2009-02-09 22:33:01 UTC (rev 29176)
@@ -226,6 +226,8 @@
bool
KeymapWindow::QuitRequested()
{
+ if (!IsActive())
+ return false;
be_app->PostMessage(B_QUIT_REQUESTED);
return true;
}
From korli at users.berlios.de Mon Feb 9 23:34:43 2009
From: korli at users.berlios.de (=?ISO-8859-1?B?Suly9G1lIER1dmFs?=)
Date: Mon, 9 Feb 2009 23:34:43 +0100
Subject: [Haiku-commits] r29176 - haiku/trunk/src/preferences/keymap
In-Reply-To: <200902092233.n19MX26A001090@sheep.berlios.de>
References: <200902092233.n19MX26A001090@sheep.berlios.de>
Message-ID:
2009/2/9 korli at BerliOS
> Modified: haiku/trunk/src/preferences/keymap/KeymapWindow.cpp
> ===================================================================
> --- haiku/trunk/src/preferences/keymap/KeymapWindow.cpp 2009-02-09 22:31:10
> UTC (rev 29175)
> +++ haiku/trunk/src/preferences/keymap/KeymapWindow.cpp 2009-02-09 22:33:01
> UTC (rev 29176)
> @@ -226,6 +226,8 @@
> bool
> KeymapWindow::QuitRequested()
> {
> + if (!IsActive())
> + return false;
> be_app->PostMessage(B_QUIT_REQUESTED);
> return true;
> }
>
The shutdown process fails with this. Any ideas ?
Bye,
J?r?me
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From anevilyak at gmail.com Tue Feb 10 00:05:53 2009
From: anevilyak at gmail.com (Rene Gollent)
Date: Mon, 9 Feb 2009 17:05:53 -0600
Subject: [Haiku-commits] r29176 - haiku/trunk/src/preferences/keymap
In-Reply-To:
References: <200902092233.n19MX26A001090@sheep.berlios.de>
Message-ID:
On Mon, Feb 9, 2009 at 4:34 PM, J?r?me Duval wrote:
>
> The shutdown process fails with this. Any ideas ?
>
What you could do instead is override KeymapWindow::DispatchMessage()
and skip handling B_KEY_DOWN if it contains modifier cmd, key 'q', and
the window isn't currently focused. This way you wouldn't need to do
any special casing for B_QUIT_REQUESTED.
Regards,
Rene
From mmlr at mail.berlios.de Tue Feb 10 00:06:49 2009
From: mmlr at mail.berlios.de (mmlr at mail.berlios.de)
Date: Tue, 10 Feb 2009 00:06:49 +0100
Subject: [Haiku-commits] r29177 - in haiku/trunk: headers/os/drivers
headers/private/fs_shell src/add-ons/kernel/file_systems/bfs
src/add-ons/kernel/file_systems/cdda
src/add-ons/kernel/file_systems/ext2
src/add-ons/kernel/file_systems/fat
src/add-ons/kernel/file_systems/iso9660
src/add-ons/kernel/file_systems/nfs
src/add-ons/kernel/file_systems/reiserfs
src/system/kernel/device_manager src/system/kernel/fs
src/tools/fs_shell
Message-ID: <200902092306.n19N6nIn005885@sheep.berlios.de>
Author: mmlr
Date: 2009-02-10 00:06:31 +0100 (Tue, 10 Feb 2009)
New Revision: 29177
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29177&view=rev
Added:
haiku/trunk/src/system/kernel/fs/overlay.cpp
haiku/trunk/src/system/kernel/fs/overlay.h
Modified:
haiku/trunk/headers/os/drivers/fs_interface.h
haiku/trunk/headers/private/fs_shell/fssh_fs_interface.h
haiku/trunk/src/add-ons/kernel/file_systems/bfs/Inode.cpp
haiku/trunk/src/add-ons/kernel/file_systems/bfs/Inode.h
haiku/trunk/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp
haiku/trunk/src/add-ons/kernel/file_systems/cdda/kernel_interface.cpp
haiku/trunk/src/add-ons/kernel/file_systems/ext2/Volume.cpp
haiku/trunk/src/add-ons/kernel/file_systems/ext2/kernel_interface.cpp
haiku/trunk/src/add-ons/kernel/file_systems/fat/dir.c
haiku/trunk/src/add-ons/kernel/file_systems/fat/file.c
haiku/trunk/src/add-ons/kernel/file_systems/iso9660/kernel_interface.cpp
haiku/trunk/src/add-ons/kernel/file_systems/nfs/nfs_add_on.c
haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/Volume.cpp
haiku/trunk/src/system/kernel/device_manager/devfs.cpp
haiku/trunk/src/system/kernel/fs/Jamfile
haiku/trunk/src/system/kernel/fs/rootfs.cpp
haiku/trunk/src/system/kernel/fs/vfs.cpp
haiku/trunk/src/system/kernel/fs/vfs_request_io.cpp
haiku/trunk/src/tools/fs_shell/vfs.cpp
Log:
* Add an additional argument to get_vnode() that gets the fs_vnode_ops of the
node. That is needed for a layered filesystem to be able to construct a full
fs_vnode out of a volume/inode pair.
* Adapt places where get_vnode is used. Sadly this is a C API and we can't just
use a default NULL for that argument.
* Introduce a flag B_VNODE_WANTS_OVERLAY_SUB_NODE that can be returned in the
flags field of a fs get_vnode call. A filesystem can use this flag to indicate
that it doesn't support the full set of fs features (attributes, write support)
and it'd like to have unsupported calls emulated by an overlay sub node.
* Add a perliminary overlay filesystem that emulates file attributes using files
on a filesystem where attributes aren't supported. It does currently only
support reading attributes/attribute directories though. All other calls are
just passed through to the super filesystem.
* Adjust places where a HAS_FS_CALL() is taken as a guarantee that the operation
is supported. For the overlay filesystem we may later return a B_UNSUPPORTED,
so make sure that in that case proper fallback options are taken.
* Make the iso9660 filesystem request overlay sub nodes. This can be fine tuned
later to only trigger where there are features on a CD that need emulation
at all.
If you happened to know the attribute file format and location you could build
an iso with read-only attribute support now. Note that this won't be enough to
get a bootable iso-only image as the query and index support is yet missing.
Modified: haiku/trunk/headers/os/drivers/fs_interface.h
===================================================================
--- haiku/trunk/headers/os/drivers/fs_interface.h 2009-02-09 22:33:01 UTC (rev 29176)
+++ haiku/trunk/headers/os/drivers/fs_interface.h 2009-02-09 23:06:31 UTC (rev 29177)
@@ -43,6 +43,7 @@
// flags for publish_vnode() and fs_volume_ops::get_vnode()
#define B_VNODE_PUBLISH_REMOVED 0x01
#define B_VNODE_DONT_CREATE_SPECIAL_SUB_NODE 0x02
+#define B_VNODE_WANTS_OVERLAY_SUB_NODE 0x04
#ifdef __cplusplus
@@ -307,7 +308,7 @@
void *privateNode, fs_vnode_ops *ops, int type,
uint32 flags);
extern status_t get_vnode(fs_volume *volume, ino_t vnodeID,
- void **_privateNode);
+ void **_privateNode, fs_vnode_ops **_vnodeOps);
extern status_t put_vnode(fs_volume *volume, ino_t vnodeID);
extern status_t acquire_vnode(fs_volume *volume, ino_t vnodeID);
extern status_t remove_vnode(fs_volume *volume, ino_t vnodeID);
Modified: haiku/trunk/headers/private/fs_shell/fssh_fs_interface.h
===================================================================
--- haiku/trunk/headers/private/fs_shell/fssh_fs_interface.h 2009-02-09 22:33:01 UTC (rev 29176)
+++ haiku/trunk/headers/private/fs_shell/fssh_fs_interface.h 2009-02-09 23:06:31 UTC (rev 29177)
@@ -344,7 +344,8 @@
fssh_vnode_id vnodeID, void *privateNode,
fssh_fs_vnode_ops *ops, int type, uint32_t flags);
extern fssh_status_t fssh_get_vnode(fssh_fs_volume *volume,
- fssh_vnode_id vnodeID, void **_privateNode);
+ fssh_vnode_id vnodeID, void **_privateNode,
+ fssh_fs_vnode_ops **_vnodeOps);
extern fssh_status_t fssh_put_vnode(fssh_fs_volume *volume,
fssh_vnode_id vnodeID);
extern fssh_status_t fssh_acquire_vnode(fssh_fs_volume *volume,
Modified: haiku/trunk/src/add-ons/kernel/file_systems/bfs/Inode.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/file_systems/bfs/Inode.cpp 2009-02-09 22:33:01 UTC (rev 29176)
+++ haiku/trunk/src/add-ons/kernel/file_systems/bfs/Inode.cpp 2009-02-09 23:06:31 UTC (rev 29177)
@@ -2701,7 +2701,7 @@
// if you haven't yet access to the attributes directory, get it
if (fAttributes == NULL) {
if (get_vnode(volume->FSVolume(), volume->ToVnode(fInode->Attributes()),
- (void**)&fAttributes) != B_OK) {
+ (void**)&fAttributes, NULL) != B_OK) {
FATAL(("get_vnode() failed in AttributeIterator::GetNext(ino_t"
" = %Ld,name = \"%s\")\n", fInode->ID(), name));
return B_ENTRY_NOT_FOUND;
Modified: haiku/trunk/src/add-ons/kernel/file_systems/bfs/Inode.h
===================================================================
--- haiku/trunk/src/add-ons/kernel/file_systems/bfs/Inode.h 2009-02-09 22:33:01 UTC (rev 29176)
+++ haiku/trunk/src/add-ons/kernel/file_systems/bfs/Inode.h 2009-02-09 23:06:31 UTC (rev 29177)
@@ -354,7 +354,8 @@
{
Unset();
- return fStatus = get_vnode(volume->FSVolume(), id, (void**)&fInode);
+ return fStatus = get_vnode(volume->FSVolume(), id, (void**)&fInode,
+ NULL);
}
status_t SetTo(Volume* volume, block_run run)
Modified: haiku/trunk/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp 2009-02-09 22:33:01 UTC (rev 29176)
+++ haiku/trunk/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp 2009-02-09 23:06:31 UTC (rev 29177)
@@ -556,7 +556,7 @@
locker.Unlock();
Inode* inode;
- status = get_vnode(volume->FSVolume(), *_vnodeID, (void**)&inode);
+ status = get_vnode(volume->FSVolume(), *_vnodeID, (void**)&inode, NULL);
if (status != B_OK) {
REPORT_ERROR(status);
return B_ENTRY_NOT_FOUND;
Modified: haiku/trunk/src/add-ons/kernel/file_systems/cdda/kernel_interface.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/file_systems/cdda/kernel_interface.cpp 2009-02-09 22:33:01 UTC (rev 29176)
+++ haiku/trunk/src/add-ons/kernel/file_systems/cdda/kernel_interface.cpp 2009-02-09 23:06:31 UTC (rev 29177)
@@ -1493,7 +1493,7 @@
if (inode == NULL)
return B_ENTRY_NOT_FOUND;
- status = get_vnode(volume->FSVolume(), inode->ID(), NULL);
+ status = get_vnode(volume->FSVolume(), inode->ID(), NULL, NULL);
if (status < B_OK)
return status;
Modified: haiku/trunk/src/add-ons/kernel/file_systems/ext2/Volume.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/file_systems/ext2/Volume.cpp 2009-02-09 22:33:01 UTC (rev 29176)
+++ haiku/trunk/src/add-ons/kernel/file_systems/ext2/Volume.cpp 2009-02-09 23:06:31 UTC (rev 29177)
@@ -310,7 +310,7 @@
if ((fBlockCache = opener.InitCache(NumBlocks(), fBlockSize)) == NULL)
return B_ERROR;
- status = get_vnode(fFSVolume, EXT2_ROOT_NODE, (void**)&fRootNode);
+ status = get_vnode(fFSVolume, EXT2_ROOT_NODE, (void**)&fRootNode, NULL);
if (status != B_OK) {
TRACE("could not create root node: get_vnode() failed!\n");
return status;
Modified: haiku/trunk/src/add-ons/kernel/file_systems/ext2/kernel_interface.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/file_systems/ext2/kernel_interface.cpp 2009-02-09 22:33:01 UTC (rev 29176)
+++ haiku/trunk/src/add-ons/kernel/file_systems/ext2/kernel_interface.cpp 2009-02-09 23:06:31 UTC (rev 29177)
@@ -319,7 +319,7 @@
break;
}
- return get_vnode(volume->FSVolume(), *_vnodeID, NULL);
+ return get_vnode(volume->FSVolume(), *_vnodeID, NULL, NULL);
}
Modified: haiku/trunk/src/add-ons/kernel/file_systems/fat/dir.c
===================================================================
--- haiku/trunk/src/add-ons/kernel/file_systems/fat/dir.c 2009-02-09 22:33:01 UTC (rev 29176)
+++ haiku/trunk/src/add-ons/kernel/file_systems/fat/dir.c 2009-02-09 23:06:31 UTC (rev 29177)
@@ -433,7 +433,7 @@
if (vnid)
*vnid = found_vnid;
if (node)
- result = get_vnode(vol->volume, found_vnid, (void **)node);
+ result = get_vnode(vol->volume, found_vnid, (void **)node, NULL);
result = B_OK;
} else {
result = ENOENT;
Modified: haiku/trunk/src/add-ons/kernel/file_systems/fat/file.c
===================================================================
--- haiku/trunk/src/add-ons/kernel/file_systems/fat/file.c 2009-02-09 22:33:01 UTC (rev 29176)
+++ haiku/trunk/src/add-ons/kernel/file_systems/fat/file.c 2009-02-09 23:06:31 UTC (rev 29177)
@@ -890,7 +890,7 @@
*vnid = dummy.vnid;
dummy.magic = ~VNODE_MAGIC;
- result = get_vnode(_vol, *vnid, (void **)&file);
+ result = get_vnode(_vol, *vnid, (void **)&file, NULL);
if (result < B_OK) {
if (vol->fs_flags & FS_FLAGS_OP_SYNC)
_dosfs_sync(vol);
@@ -1155,7 +1155,7 @@
if (vnid == vol->root_vnode.vnid)
break;
- result = get_vnode(_vol, vnid, (void **)&dir);
+ result = get_vnode(_vol, vnid, (void **)&dir, NULL);
if (result < B_OK)
goto bi1;
parent = dir->dir_vnid;
Modified: haiku/trunk/src/add-ons/kernel/file_systems/iso9660/kernel_interface.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/file_systems/iso9660/kernel_interface.cpp 2009-02-09 22:33:01 UTC (rev 29176)
+++ haiku/trunk/src/add-ons/kernel/file_systems/iso9660/kernel_interface.cpp 2009-02-09 23:06:31 UTC (rev 29177)
@@ -224,12 +224,12 @@
// base directory
TRACE(("fs_walk - found \".\" file.\n"));
*_vnodeID = baseNode->id;
- return get_vnode(_vol, *_vnodeID, (void **)&newNode);
+ return get_vnode(_vol, *_vnodeID, NULL, NULL);
} else if (strcmp(file, "..") == 0) {
// parent directory
TRACE(("fs_walk - found \"..\" file.\n"));
*_vnodeID = baseNode->parID;
- return get_vnode(_vol, *_vnodeID, (void **)&newNode);
+ return get_vnode(_vol, *_vnodeID, NULL, NULL);
}
// look up file in the directory
@@ -272,7 +272,7 @@
TRACE(("fs_walk - New vnode id is %Ld\n", *_vnodeID));
result = get_vnode(_vol, *_vnodeID,
- (void **)&newNode);
+ (void **)&newNode, NULL);
if (result == B_OK) {
newNode->parID = baseNode->id;
done = true;
@@ -349,7 +349,7 @@
_node->private_node = newNode;
_node->ops = &gISO9660VnodeOps;
*_type = newNode->attr.stat[FS_DATA_FORMAT].st_mode & ~(S_IWUSR | S_IWGRP | S_IWOTH);
- *_flags = 0;
+ *_flags = B_VNODE_WANTS_OVERLAY_SUB_NODE;
if ((newNode->flags & ISO_ISDIR) == 0) {
newNode->cache = file_cache_create(ns->id, vnodeID,
Modified: haiku/trunk/src/add-ons/kernel/file_systems/nfs/nfs_add_on.c
===================================================================
--- haiku/trunk/src/add-ons/kernel/file_systems/nfs/nfs_add_on.c 2009-02-09 22:33:01 UTC (rev 29176)
+++ haiku/trunk/src/add-ons/kernel/file_systems/nfs/nfs_add_on.c 2009-02-09 23:06:31 UTC (rev 29177)
@@ -898,7 +898,7 @@
isLink=S_ISLNK(st.st_mode);
}
- if ((result=get_vnode (_volume,*vnid,(void **)&dummy))volume, device->id, (void**)&partition->raw_device);
+ status = get_vnode(fs->volume, device->id, (void**)&partition->raw_device,
+ NULL);
if (status < B_OK)
goto err1;
@@ -937,7 +938,7 @@
{
struct devfs *fs = (struct devfs *)_volume->private_volume;
struct devfs_vnode *dir = (struct devfs_vnode *)_dir->private_node;
- struct devfs_vnode *vnode, *vdummy;
+ struct devfs_vnode *vnode;
status_t status;
TRACE(("devfs_lookup: entry dir %p, name '%s'\n", dir, name));
@@ -958,7 +959,7 @@
return B_ENTRY_NOT_FOUND;
}
- status = get_vnode(fs->volume, vnode->id, (void**)&vdummy);
+ status = get_vnode(fs->volume, vnode->id, NULL, NULL);
if (status < B_OK)
return status;
@@ -1062,7 +1063,7 @@
if (openMode & O_EXCL)
return B_FILE_EXISTS;
- status = get_vnode(fs->volume, vnode->id, NULL);
+ status = get_vnode(fs->volume, vnode->id, NULL, NULL);
if (status < B_OK)
return status;
@@ -2091,7 +2092,7 @@
{
devfs_vnode* node;
status_t status = get_vnode(sDeviceFileSystem->volume, device->ID(),
- (void**)&node);
+ (void**)&node, NULL);
if (status != B_OK)
return status;
Modified: haiku/trunk/src/system/kernel/fs/Jamfile
===================================================================
--- haiku/trunk/src/system/kernel/fs/Jamfile 2009-02-09 22:33:01 UTC (rev 29176)
+++ haiku/trunk/src/system/kernel/fs/Jamfile 2009-02-09 23:06:31 UTC (rev 29177)
@@ -12,6 +12,7 @@
fifo.cpp
KPath.cpp
node_monitor.cpp
+ overlay.cpp
rootfs.cpp
socket.cpp
vfs.cpp
Added: haiku/trunk/src/system/kernel/fs/overlay.cpp
===================================================================
--- haiku/trunk/src/system/kernel/fs/overlay.cpp 2009-02-09 22:33:01 UTC (rev 29176)
+++ haiku/trunk/src/system/kernel/fs/overlay.cpp 2009-02-09 23:06:31 UTC (rev 29177)
@@ -0,0 +1,1097 @@
+/*
+ * Copyright 2009, Haiku Inc. All rights reserved.
+ * Distributed under the terms of the MIT License.
+ *
+ * Authors:
+ * Michael Lotz
+ */
+
+#include
+#include
+#include
+
+#include
+
+#include
+#include
+#include
+
+#include "overlay.h"
+
+
+//#define TRACE_OVERLAY
+#ifdef TRACE_OVERLAY
+#define TRACE(x...) dprintf("overlay: " x)
+#define TRACE_ALWAYS(x...) dprintf("overlay: " x)
+#else
+#define TRACE(x...) /* nothing */
+#define TRACE_ALWAYS(x...) dprintf("overlay: " x)
+#endif
+
+
+namespace overlay {
+
+class AttributeFile;
+class AttributeEntry;
+
+
+class OverlayInode {
+public:
+ OverlayInode(fs_volume *superVolume,
+ fs_vnode *superVnode);
+ ~OverlayInode();
+
+ status_t InitCheck();
+
+ fs_vnode * SuperVnode() { return &fSuperVnode; }
+
+ AttributeFile * GetAttributeFile();
+
+private:
+ fs_volume fSuperVolume;
+ fs_vnode fSuperVnode;
+ AttributeFile * fAttributeFile;
+};
+
+
+class AttributeFile {
+public:
+ AttributeFile(fs_volume *volume, fs_vnode *vnode);
+ ~AttributeFile();
+
+ status_t InitCheck() { return fStatus; }
+
+ dev_t VolumeID() { return fVolumeID; }
+ ino_t ParentInode() { return fParentInode; }
+
+ uint32 CountAttributes();
+ AttributeEntry * FindAttribute(const char *name);
+
+ status_t ReadAttributeDir(struct dirent *dirent,
+ size_t bufferSize, uint32 *numEntries);
+ status_t RewindAttributeDir()
+ {
+ fAttributeDirIndex = 0;
+ return B_OK;
+ }
+
+private:
+ #define ATTRIBUTE_OVERLAY_FILE_MAGIC 'attr'
+ #define ATTRIBUTE_OVERLAY_ATTRIBUTE_DIR_NAME "_HAIKU"
+
+ struct attribute_file {
+ uint32 magic; // 'attr'
+ uint32 entry_count;
+ uint8 entries[1];
+ } _PACKED;
+
+ status_t fStatus;
+ dev_t fVolumeID;
+ ino_t fParentInode;
+ attribute_file * fFile;
+ uint32 fAttributeDirIndex;
+ AttributeEntry ** fEntries;
+};
+
+
+class AttributeEntry {
+public:
+ AttributeEntry(AttributeFile *parent,
+ uint8 *buffer);
+ ~AttributeEntry();
+
+ size_t EntrySize();
+
+ uint8 NameLength() { return fEntry->name_length; }
+ const char * Name() { return fEntry->name; }
+
+ status_t FillDirent(struct dirent *dirent,
+ size_t bufferSize, uint32 *numEntries);
+
+ status_t Read(off_t position, void *buffer, size_t *length);
+ status_t ReadStat(struct stat *stat);
+
+private:
+ struct attribute_entry {
+ type_code type;
+ uint32 size;
+ uint8 name_length; // including 0 byte
+ char name[1]; // 0 terminated, followed by data
+ } _PACKED;
+
+ AttributeFile * fParent;
+ attribute_entry * fEntry;
+ uint8 * fData;
+};
+
+
+// #pragma mark OverlayInode
+
+
+OverlayInode::OverlayInode(fs_volume *superVolume, fs_vnode *superVnode)
+ : fSuperVolume(*superVolume),
+ fSuperVnode(*superVnode),
+ fAttributeFile(NULL)
+{
+ TRACE("inode created\n");
+}
+
+
+OverlayInode::~OverlayInode()
+{
+ TRACE("inode destroyed\n");
+ delete fAttributeFile;
+}
+
+
+status_t
+OverlayInode::InitCheck()
+{
+ return B_OK;
+}
+
+
+AttributeFile *
+OverlayInode::GetAttributeFile()
+{
+ if (fAttributeFile == NULL) {
+ fAttributeFile = new(std::nothrow) AttributeFile(&fSuperVolume,
+ &fSuperVnode);
+ if (fAttributeFile == NULL) {
+ TRACE_ALWAYS("no memory to allocate attribute file\n");
+ return NULL;
+ }
+ }
+
+ if (fAttributeFile->InitCheck() != B_OK)
+ return NULL;
+
+ return fAttributeFile;
+}
+
+
+// #pragma mark AttributeFile
+
+
+AttributeFile::AttributeFile(fs_volume *volume, fs_vnode *vnode)
+ : fStatus(B_NO_INIT),
+ fVolumeID(volume->id),
+ fParentInode(0),
+ fFile(NULL),
+ fAttributeDirIndex(0),
+ fEntries(NULL)
+{
+ if (vnode->ops->get_vnode_name == NULL) {
+ TRACE_ALWAYS("cannot get vnode name, hook missing\n");
+ fStatus = B_UNSUPPORTED;
+ return;
+ }
+
+ char nameBuffer[B_FILE_NAME_LENGTH];
+ nameBuffer[sizeof(nameBuffer) - 1] = 0;
+ fStatus = vnode->ops->get_vnode_name(volume, vnode, nameBuffer,
+ sizeof(nameBuffer) - 1);
+ if (fStatus != B_OK) {
+ TRACE_ALWAYS("failed to get vnode name: %s\n", strerror(fStatus));
+ return;
+ }
+
+ if (strcmp(nameBuffer, ATTRIBUTE_OVERLAY_ATTRIBUTE_DIR_NAME) == 0) {
+ // we don't want attribute overlays on the attribute dir itself
+ fStatus = B_UNSUPPORTED;
+ return;
+ }
+
+ struct stat stat;
+ if (vnode->ops->read_stat != NULL
+ && vnode->ops->read_stat(volume, vnode, &stat) == B_OK) {
+ fParentInode = stat.st_ino;
+ }
+
+ // TODO: the ".." lookup is not actually valid for non-directory vnodes.
+ // we make use of the fact that a filesystem probably still provides the
+ // lookup hook and has hardcoded ".." to resolve to the parent entry. if we
+ // wanted to do this correctly we need some other way to relate this vnode
+ // to its parent directory vnode.
+ const char *lookup[]
+ = { "..", ATTRIBUTE_OVERLAY_ATTRIBUTE_DIR_NAME, nameBuffer };
+ int32 lookupCount = sizeof(lookup) / sizeof(lookup[0]);
+ fs_vnode currentVnode = *vnode;
+ ino_t lastInodeNumber = 0;
+
+ for (int32 i = 0; i < lookupCount; i++) {
+ if (currentVnode.ops->lookup == NULL) {
+ TRACE_ALWAYS("lookup not possible, lookup hook missing\n");
+ fStatus = B_UNSUPPORTED;
+ if (i > 0)
+ put_vnode(volume, lastInodeNumber);
+ return;
+ }
+
+ ino_t inodeNumber;
+ fStatus = currentVnode.ops->lookup(volume, ¤tVnode, lookup[i],
+ &inodeNumber);
+
+ if (i > 0)
+ put_vnode(volume, lastInodeNumber);
+
+ if (fStatus != B_OK) {
+ if (fStatus != B_ENTRY_NOT_FOUND) {
+ TRACE_ALWAYS("lookup of \"%s\" failed: %s\n", lookup[i],
+ strerror(fStatus));
+ }
+ return;
+ }
+
+ fStatus = get_vnode(volume, inodeNumber, ¤tVnode.private_node,
+ ¤tVnode.ops);
+ if (fStatus != B_OK) {
+ TRACE_ALWAYS("getting vnode failed: %s\n", strerror(fStatus));
+ return;
+ }
+
+ lastInodeNumber = inodeNumber;
+ }
+
+ if (currentVnode.ops->read_stat == NULL || currentVnode.ops->open == NULL
+ || currentVnode.ops->read == NULL) {
+ TRACE_ALWAYS("can't use attribute file, hooks missing\n");
+ put_vnode(volume, lastInodeNumber);
+ fStatus = B_UNSUPPORTED;
+ return;
+ }
+
+ fStatus = currentVnode.ops->read_stat(volume, ¤tVnode, &stat);
+ if (fStatus != B_OK) {
+ TRACE_ALWAYS("failed to stat attribute file: %s\n", strerror(fStatus));
+ put_vnode(volume, lastInodeNumber);
+ return;
+ }
+
+ void *attrFileCookie = NULL;
+ fStatus = currentVnode.ops->open(volume, ¤tVnode, O_RDONLY,
+ &attrFileCookie);
+ if (fStatus != B_OK) {
+ TRACE_ALWAYS("failed to open attribute file: %s\n", strerror(fStatus));
+ put_vnode(volume, lastInodeNumber);
+ return;
+ }
+
+ size_t readLength = stat.st_size;
+ uint8 *buffer = (uint8 *)malloc(readLength);
+ if (buffer == NULL) {
+ TRACE_ALWAYS("cannot allocate memory for read buffer\n");
+ put_vnode(volume, lastInodeNumber);
+ fStatus = B_NO_MEMORY;
+ return;
+ }
+
+ fStatus = currentVnode.ops->read(volume, ¤tVnode, attrFileCookie, 0,
+ buffer, &readLength);
+ if (fStatus != B_OK) {
+ TRACE_ALWAYS("failed to read from file: %s\n", strerror(fStatus));
+ put_vnode(volume, lastInodeNumber);
+ return;
+ }
+
+ if (currentVnode.ops->close != NULL)
+ currentVnode.ops->close(volume, ¤tVnode, attrFileCookie);
+ if (currentVnode.ops->free_cookie != NULL)
+ currentVnode.ops->free_cookie(volume, ¤tVnode, attrFileCookie);
+
+ put_vnode(volume, lastInodeNumber);
+
+ fFile = (attribute_file *)buffer;
+ if (fFile->magic != ATTRIBUTE_OVERLAY_FILE_MAGIC) {
+ TRACE_ALWAYS("attribute file has bad magic\n");
+ fStatus = B_BAD_VALUE;
+ return;
+ }
+
+ fEntries = new(std::nothrow) AttributeEntry *[fFile->entry_count];
+ if (fEntries == NULL) {
+ TRACE_ALWAYS("no memory to allocate entry pointers\n");
+ fStatus = B_NO_MEMORY;
+ return;
+ }
+
+ for (uint32 i = 0; i < fFile->entry_count; i++)
+ fEntries[i] = NULL;
+
+ size_t totalSize = 0;
+ readLength -= sizeof(attribute_file) - 1;
+ for (uint32 i = 0; i < fFile->entry_count; i++) {
+ fEntries[i] = new(std::nothrow) AttributeEntry(this,
+ fFile->entries + totalSize);
+ if (fEntries[i] == NULL) {
+ TRACE_ALWAYS("no memory to allocate attribute entry\n");
+ fStatus = B_NO_MEMORY;
+ return;
+ }
+
+ totalSize += fEntries[i]->EntrySize();
+ if (totalSize > readLength) {
+ TRACE_ALWAYS("attribute entries are too large for buffer\n");
+ fStatus = B_BAD_VALUE;
+ return;
+ }
+ }
+}
+
+
+AttributeFile::~AttributeFile()
+{
+ if (fFile == NULL)
+ return;
+
+ if (fEntries != NULL) {
+ for (uint32 i = 0; i < fFile->entry_count; i++)
+ delete fEntries[i];
+
+ delete [] fEntries;
+ }
+
+ free(fFile);
+}
+
+
+uint32
+AttributeFile::CountAttributes()
+{
+ if (fFile == NULL)
+ return 0;
+
+ return fFile->entry_count;
+}
+
+
+AttributeEntry *
+AttributeFile::FindAttribute(const char *name)
+{
+ if (fFile == NULL)
+ return NULL;
+
+ for (uint32 i = 0; i < fFile->entry_count; i++) {
+ if (strncmp(fEntries[i]->Name(), name, fEntries[i]->NameLength()) == 0)
+ return fEntries[i];
+ }
+
+ return NULL;
+}
+
+
+status_t
+AttributeFile::ReadAttributeDir(struct dirent *dirent, size_t bufferSize,
+ uint32 *numEntries)
+{
+ if (fFile == NULL || fAttributeDirIndex >= fFile->entry_count) {
+ *numEntries = 0;
+ return B_OK;
+ }
+
+ return fEntries[fAttributeDirIndex++]->FillDirent(dirent, bufferSize,
+ numEntries);
+}
+
+
+// #pragma mark AttributeEntry
+
+
+AttributeEntry::AttributeEntry(AttributeFile *parent, uint8 *buffer)
+ : fParent(parent),
+ fEntry(NULL),
+ fData(NULL)
+{
+ fEntry = (attribute_entry *)buffer;
+ fData = (uint8 *)fEntry->name + fEntry->name_length;
+}
+
+
+AttributeEntry::~AttributeEntry()
+{
+}
+
+
+size_t
+AttributeEntry::EntrySize()
+{
+ return sizeof(attribute_entry) - 1 + fEntry->name_length + fEntry->size;
+}
+
+
+status_t
+AttributeEntry::FillDirent(struct dirent *dirent, size_t bufferSize,
+ uint32 *numEntries)
+{
+ dirent->d_dev = dirent->d_pdev = fParent->VolumeID();
+ dirent->d_ino = (ino_t)this;
+ dirent->d_pino = fParent->ParentInode();
+ dirent->d_reclen = sizeof(struct dirent) + fEntry->name_length;
+ if (bufferSize < dirent->d_reclen) {
+ *numEntries = 0;
+ return B_BAD_VALUE;
+ }
+
+ strncpy(dirent->d_name, fEntry->name, fEntry->name_length);
+ dirent->d_name[fEntry->name_length - 1] = 0;
+ *numEntries = 1;
+ return B_OK;
+}
+
+
+status_t
+AttributeEntry::Read(off_t position, void *buffer, size_t *length)
+{
+ *length = min_c(*length, fEntry->size);
+ if (*length <= position) {
+ *length = 0;
+ return B_OK;
+ }
+
+ *length -= position;
+ memcpy(buffer, fData + position, *length);
+ return B_OK;
+}
+
+
+status_t
+AttributeEntry::ReadStat(struct stat *stat)
+{
+ stat->st_dev = fParent->VolumeID();
+ stat->st_ino = (ino_t)this;
+ stat->st_nlink = 1;
+ stat->st_blksize = 512;
+ stat->st_uid = 1;
+ stat->st_gid = 1;
+ stat->st_size = fEntry->size;
+ stat->st_mode = S_ATTR | 0x0777;
+ stat->st_type = fEntry->type;
+ stat->st_atime = stat->st_mtime = stat->st_crtime = time(NULL);
+ stat->st_blocks = (fEntry->size + stat->st_blksize - 1) / stat->st_blksize;
+ return B_OK;
+}
+
+
+// #pragma mark -
+
+
+static status_t
+overlay_put_vnode(fs_volume *volume, fs_vnode *vnode, bool reenter)
+{
+ OverlayInode *node = (OverlayInode *)vnode->private_node;
+ fs_vnode *superVnode = node->SuperVnode();
+
+ status_t result = B_OK;
+ if (superVnode->ops->put_vnode != NULL)
+ result = superVnode->ops->put_vnode(volume, superVnode, reenter);
+
+ delete node;
+ return result;
+}
+
+
+static status_t
+overlay_remove_vnode(fs_volume *volume, fs_vnode *vnode, bool reenter)
+{
+ OverlayInode *node = (OverlayInode *)vnode->private_node;
+ fs_vnode *superVnode = node->SuperVnode();
+
+ status_t result = B_OK;
+ if (superVnode->ops->remove_vnode != NULL)
+ result = superVnode->ops->remove_vnode(volume, superVnode, reenter);
+
+ delete node;
+ return result;
+}
+
+
+static status_t
+overlay_get_super_vnode(fs_volume *volume, fs_vnode *vnode,
+ fs_volume *superVolume, fs_vnode *_superVnode)
+{
+ OverlayInode *node = (OverlayInode *)vnode->private_node;
+ fs_vnode *superVnode = node->SuperVnode();
+
+ if (superVnode->ops->get_super_vnode != NULL) {
+ return superVnode->ops->get_super_vnode(volume, superVnode, superVolume,
+ _superVnode);
+ }
+
+ *_superVnode = *superVnode;
+ return B_OK;
+}
+
+
+// #pragma mark -
+
+
+#define OVERLAY_CALL(op, params...) \
+ TRACE("relaying op: " #op "\n"); \
+ OverlayInode *node = (OverlayInode *)vnode->private_node; \
+ fs_vnode *superVnode = node->SuperVnode(); \
+ if (superVnode->ops->op != NULL) \
+ return superVnode->ops->op(volume, superVnode, params);
+
+
+static status_t
+overlay_lookup(fs_volume *volume, fs_vnode *vnode, const char *name, ino_t *id)
+{
+ OVERLAY_CALL(lookup, name, id)
+ return B_UNSUPPORTED;
+}
+
+
+static status_t
+overlay_get_vnode_name(fs_volume *volume, fs_vnode *vnode, char *buffer,
+ size_t bufferSize)
+{
+ OVERLAY_CALL(get_vnode_name, buffer, bufferSize)
+ return B_UNSUPPORTED;
+}
+
+
+static bool
+overlay_can_page(fs_volume *volume, fs_vnode *vnode, void *cookie)
+{
+ OVERLAY_CALL(can_page, cookie)
+ return false;
+}
+
+
+static status_t
+overlay_read_pages(fs_volume *volume, fs_vnode *vnode, void *cookie, off_t pos,
+ const iovec *vecs, size_t count, size_t *numBytes)
+{
+ OVERLAY_CALL(read_pages, cookie, pos, vecs, count, numBytes)
+ return B_UNSUPPORTED;
+}
+
+
+static status_t
+overlay_write_pages(fs_volume *volume, fs_vnode *vnode, void *cookie, off_t pos,
+ const iovec *vecs, size_t count, size_t *numBytes)
+{
+ OVERLAY_CALL(write_pages, cookie, pos, vecs, count, numBytes)
+ return B_UNSUPPORTED;
+}
+
+
+#if 0
+static status_t
+overlay_io(fs_volume *volume, fs_vnode *vnode, void *cookie,
+ io_request *request)
+{
+ OVERLAY_CALL(io, cookie, request)
+ return B_UNSUPPORTED;
+}
+#endif
+
+
+static status_t
+overlay_cancel_io(fs_volume *volume, fs_vnode *vnode, void *cookie,
+ io_request *request)
+{
+ OVERLAY_CALL(cancel_io, cookie, request)
+ return B_UNSUPPORTED;
+}
+
+
+static status_t
+overlay_get_file_map(fs_volume *volume, fs_vnode *vnode, off_t offset,
+ size_t size, struct file_io_vec *vecs, size_t *count)
+{
+ OVERLAY_CALL(get_file_map, offset, size, vecs, count)
+ return B_UNSUPPORTED;
+}
+
+
+static status_t
+overlay_ioctl(fs_volume *volume, fs_vnode *vnode, void *cookie, ulong op,
+ void *buffer, size_t length)
+{
+ OVERLAY_CALL(ioctl, cookie, op, buffer, length)
+ return B_UNSUPPORTED;
+}
+
+
+static status_t
+overlay_set_flags(fs_volume *volume, fs_vnode *vnode, void *cookie,
+ int flags)
+{
+ OVERLAY_CALL(set_flags, cookie, flags)
+ return B_UNSUPPORTED;
+}
+
+
+static status_t
+overlay_select(fs_volume *volume, fs_vnode *vnode, void *cookie, uint8 event,
+ selectsync *sync)
+{
+ OVERLAY_CALL(select, cookie, event, sync)
+ return B_UNSUPPORTED;
+}
+
+
+static status_t
+overlay_deselect(fs_volume *volume, fs_vnode *vnode, void *cookie, uint8 event,
+ selectsync *sync)
+{
+ OVERLAY_CALL(deselect, cookie, event, sync)
+ return B_UNSUPPORTED;
+}
+
+
+static status_t
+overlay_fsync(fs_volume *volume, fs_vnode *vnode)
+{
+ OverlayInode *node = (OverlayInode *)vnode->private_node;
+ fs_vnode *superVnode = node->SuperVnode();
+
+ if (superVnode->ops->fsync != NULL)
+ return superVnode->ops->fsync(volume, superVnode);
+
+ return B_OK;
+}
+
+
+static status_t
+overlay_read_symlink(fs_volume *volume, fs_vnode *vnode, char *buffer,
+ size_t *bufferSize)
+{
+ OVERLAY_CALL(read_symlink, buffer, bufferSize)
+ return B_UNSUPPORTED;
+}
+
+
+static status_t
+overlay_create_symlink(fs_volume *volume, fs_vnode *vnode, const char *name,
+ const char *path, int mode)
+{
+ OVERLAY_CALL(create_symlink, name, path, mode)
[... truncated: 636 lines follow ...]
From korli at mail.berlios.de Tue Feb 10 00:27:02 2009
From: korli at mail.berlios.de (korli at BerliOS)
Date: Tue, 10 Feb 2009 00:27:02 +0100
Subject: [Haiku-commits] r29178 - haiku/trunk/src/preferences/keymap
Message-ID: <200902092327.n19NR2ZJ008645@sheep.berlios.de>
Author: korli
Date: 2009-02-10 00:27:02 +0100 (Tue, 10 Feb 2009)
New Revision: 29178
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29178&view=rev
Modified:
haiku/trunk/src/preferences/keymap/KeymapWindow.cpp
Log:
reverted r29176. it's not OK with shutdown and it could also be a bug in interface kit.
Modified: haiku/trunk/src/preferences/keymap/KeymapWindow.cpp
===================================================================
--- haiku/trunk/src/preferences/keymap/KeymapWindow.cpp 2009-02-09 23:06:31 UTC (rev 29177)
+++ haiku/trunk/src/preferences/keymap/KeymapWindow.cpp 2009-02-09 23:27:02 UTC (rev 29178)
@@ -226,8 +226,6 @@
bool
KeymapWindow::QuitRequested()
{
- if (!IsActive())
- return false;
be_app->PostMessage(B_QUIT_REQUESTED);
return true;
}
From korli at mail.berlios.de Tue Feb 10 00:48:26 2009
From: korli at mail.berlios.de (korli at BerliOS)
Date: Tue, 10 Feb 2009 00:48:26 +0100
Subject: [Haiku-commits] r29179 - haiku/trunk/src/kits/interface
Message-ID: <200902092348.n19NmQZ6024588@sheep.berlios.de>
Author: korli
Date: 2009-02-10 00:48:25 +0100 (Tue, 10 Feb 2009)
New Revision: 29179
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29179&view=rev
Modified:
haiku/trunk/src/kits/interface/Window.cpp
Log:
* Handles shortcuts only when the window is active. This fixes bug #3414 (and hopefully is the R5 behavior).
Modified: haiku/trunk/src/kits/interface/Window.cpp
===================================================================
--- haiku/trunk/src/kits/interface/Window.cpp 2009-02-09 23:27:02 UTC (rev 29178)
+++ haiku/trunk/src/kits/interface/Window.cpp 2009-02-09 23:48:25 UTC (rev 29179)
@@ -3400,8 +3400,8 @@
}
}
- // Handle shortcuts
- if ((modifiers & B_COMMAND_KEY) != 0) {
+ // Handle shortcuts when window is active
+ if ((modifiers & B_COMMAND_KEY) != 0 && fActive) {
// Command+q has been pressed, so, we will quit
// the shortcut mechanism doesn't allow handlers outside the window
if (!fNoQuitShortcut && (key == 'Q' || key == 'q')) {
From korli at mail.berlios.de Tue Feb 10 00:58:38 2009
From: korli at mail.berlios.de (korli at BerliOS)
Date: Tue, 10 Feb 2009 00:58:38 +0100
Subject: [Haiku-commits] r29180 - haiku/trunk/src/kits/interface
Message-ID: <200902092358.n19Nwchc004002@sheep.berlios.de>
Author: korli
Date: 2009-02-10 00:58:36 +0100 (Tue, 10 Feb 2009)
New Revision: 29180
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29180&view=rev
Modified:
haiku/trunk/src/kits/interface/Window.cpp
Log:
* it seems we can skip _HandleKeyDown() when not active (keyboard navigation, shortcuts and screenshots).
Modified: haiku/trunk/src/kits/interface/Window.cpp
===================================================================
--- haiku/trunk/src/kits/interface/Window.cpp 2009-02-09 23:48:25 UTC (rev 29179)
+++ haiku/trunk/src/kits/interface/Window.cpp 2009-02-09 23:58:36 UTC (rev 29180)
@@ -1028,7 +1028,7 @@
case B_KEY_DOWN:
{
- if (!_HandleKeyDown(msg)) {
+ if (!fActive || !_HandleKeyDown(msg)) {
if (BView* view = dynamic_cast(target)) {
// TODO: cannot use "string" here if we support having different
// font encoding per view (it's supposed to be converted by
@@ -3400,8 +3400,8 @@
}
}
- // Handle shortcuts when window is active
- if ((modifiers & B_COMMAND_KEY) != 0 && fActive) {
+ // Handle shortcuts
+ if ((modifiers & B_COMMAND_KEY) != 0) {
// Command+q has been pressed, so, we will quit
// the shortcut mechanism doesn't allow handlers outside the window
if (!fNoQuitShortcut && (key == 'Q' || key == 'q')) {
From korli at mail.berlios.de Tue Feb 10 23:18:06 2009
From: korli at mail.berlios.de (korli at BerliOS)
Date: Tue, 10 Feb 2009 23:18:06 +0100
Subject: [Haiku-commits] r29181 - haiku/trunk/build/jam
Message-ID: <200902102218.n1AMI6bB017134@sheep.berlios.de>
Author: korli
Date: 2009-02-10 23:18:06 +0100 (Tue, 10 Feb 2009)
New Revision: 29181
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29181&view=rev
Modified:
haiku/trunk/build/jam/OptionalPackages
Log:
added a tar optional package
Modified: haiku/trunk/build/jam/OptionalPackages
===================================================================
--- haiku/trunk/build/jam/OptionalPackages 2009-02-09 23:58:36 UTC (rev 29180)
+++ haiku/trunk/build/jam/OptionalPackages 2009-02-10 22:18:06 UTC (rev 29181)
@@ -31,6 +31,7 @@
# Pe
# Perl
# Subversion
+# Tar
# Vision
# VLC
# Welcome
@@ -448,6 +449,20 @@
}
+# Tar
+if [ IsOptionalHaikuImagePackageAdded Tar ] {
+ if $(TARGET_ARCH) != x86 {
+ Echo "No optional package Tar available for $(TARGET_ARCH)" ;
+ } else {
+ local baseURL = http://haiku-files.org/files/optional-packages ;
+ InstallOptionalHaikuImagePackage tar-1.21-gcc2-2009-02-08
+ : $(baseURL)/tar-1.21-gcc2-2009-02-08.zip
+ :
+ ;
+ }
+}
+
+
# Vision
if [ IsOptionalHaikuImagePackageAdded Vision ] {
if $(TARGET_ARCH) != x86 {
From korli at mail.berlios.de Wed Feb 11 00:36:57 2009
From: korli at mail.berlios.de (korli at BerliOS)
Date: Wed, 11 Feb 2009 00:36:57 +0100
Subject: [Haiku-commits] r29182 - haiku/trunk/src/apps/mail
Message-ID: <200902102336.n1ANava0032001@sheep.berlios.de>
Author: korli
Date: 2009-02-11 00:36:56 +0100 (Wed, 11 Feb 2009)
New Revision: 29182
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29182&view=rev
Modified:
haiku/trunk/src/apps/mail/Header.cpp
Log:
* place the Encoding before the To. this fixes bug #1206
Modified: haiku/trunk/src/apps/mail/Header.cpp
===================================================================
--- haiku/trunk/src/apps/mail/Header.cpp 2009-02-10 22:18:06 UTC (rev 29181)
+++ haiku/trunk/src/apps/mail/Header.cpp 2009-02-10 23:36:56 UTC (rev 29182)
@@ -295,12 +295,12 @@
r.Set(windowRect.Width() - widestCharacterSet -
StringWidth(ENCODING_TEXT) - 2 * SEPARATOR_MARGIN,
y - 2, windowRect.Width() - SEPARATOR_MARGIN, y + menuFieldHeight);
- field = new BMenuField (r, "encoding", ENCODING_TEXT, fEncodingMenu,
+ BMenuField *encodingField = new BMenuField (r, "encoding", ENCODING_TEXT, fEncodingMenu,
true /* fixedSize */,
B_FOLLOW_TOP | B_FOLLOW_RIGHT,
B_WILL_DRAW | B_NAVIGABLE | B_NAVIGABLE_JUMP);
- field->SetDivider(field->StringWidth(ENCODING_TEXT) + 5);
- AddChild(field);
+ encodingField->SetDivider(encodingField->StringWidth(ENCODING_TEXT) + 5);
+ AddChild(encodingField);
// And now the "from account" pop-up menu, on the left side, taking the
// remaining space.
@@ -353,7 +353,7 @@
true /* fixedSize */,
B_FOLLOW_TOP | B_FOLLOW_LEFT_RIGHT,
B_WILL_DRAW | B_NAVIGABLE | B_NAVIGABLE_JUMP);
- AddChild(field);
+ AddChild(field, encodingField);
field->SetDivider(x - 12 - SEPARATOR_MARGIN + kMenuFieldDividerOffset);
field->SetAlignment(B_ALIGN_RIGHT);
#ifndef __HAIKU__
From humdingerb at mail.berlios.de Wed Feb 11 17:29:38 2009
From: humdingerb at mail.berlios.de (humdingerb at mail.berlios.de)
Date: Wed, 11 Feb 2009 17:29:38 +0100
Subject: [Haiku-commits] r29183 - in haiku/trunk/docs: userguide/en
userguide/en/preferences userguide/images/prefs-images welcome
Message-ID: <200902111629.n1BGTcg8014537@sheep.berlios.de>
Author: humdingerb
Date: 2009-02-11 17:29:31 +0100 (Wed, 11 Feb 2009)
New Revision: 29183
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29183&view=rev
Added:
haiku/trunk/docs/userguide/en/preferences/prefs-tracker.html
haiku/trunk/docs/userguide/images/prefs-images/tracker-icon_16.png
haiku/trunk/docs/userguide/images/prefs-images/tracker-icon_32.png
haiku/trunk/docs/userguide/images/prefs-images/tracker-icon_64.png
Modified:
haiku/trunk/docs/userguide/en/contents.html
haiku/trunk/docs/userguide/en/preferences.html
haiku/trunk/docs/userguide/en/preferences/prefs-time.html
haiku/trunk/docs/userguide/en/preferences/prefs-virtualmemory.html
haiku/trunk/docs/userguide/en/tracker.html
haiku/trunk/docs/welcome/welcome.html
Log:
* Added the Tracker preference panel which points to the Tracker chapter,
which in turn mentions the new Tracker preferences. Thanks aldeck for
reminding me.
* Added Tracker icons.
* Added Tracker on the Preferences contents page.
* Small tweaks and corrections here and there.
Modified: haiku/trunk/docs/userguide/en/contents.html
===================================================================
--- haiku/trunk/docs/userguide/en/contents.html 2009-02-10 23:36:56 UTC (rev 29182)
+++ haiku/trunk/docs/userguide/en/contents.html 2009-02-11 16:29:31 UTC (rev 29183)
@@ -94,7 +94,7 @@
The Tracker preference panel is also available from every Tracker window with the menu Window | Preferences....
+It's functions are discussed in the topic on Tracker.
-->
Modified: haiku/trunk/docs/userguide/en/preferences.html
===================================================================
--- haiku/trunk/docs/userguide/en/preferences.html 2009-02-10 23:36:56 UTC (rev 29182)
+++ haiku/trunk/docs/userguide/en/preferences.html 2009-02-11 16:29:31 UTC (rev 29183)
@@ -5,7 +5,7 @@
set %x\n", request.ifr_flags);
if (ioctl(socket, SIOCSIFFLAGS, &request, sizeof(struct ifreq)) < 0) {
fprintf(stderr, "%s: Setting flags failed: %s\n", kProgramName,
strerror(errno));
From mmu_man at mail.berlios.de Sun Feb 15 19:11:57 2009
From: mmu_man at mail.berlios.de (mmu_man at BerliOS)
Date: Sun, 15 Feb 2009 19:11:57 +0100
Subject: [Haiku-commits] r29219 - haiku/trunk/data/boot_cd
Message-ID: <200902151811.n1FIBviL020430@sheep.berlios.de>
Author: mmu_man
Date: 2009-02-15 19:11:56 +0100 (Sun, 15 Feb 2009)
New Revision: 29219
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29219&view=rev
Modified:
haiku/trunk/data/boot_cd/hfs.map
Log:
Partially revert r28610 as this is the correct way. Added a default case.
Modified: haiku/trunk/data/boot_cd/hfs.map
===================================================================
--- haiku/trunk/data/boot_cd/hfs.map 2009-02-15 17:28:49 UTC (rev 29218)
+++ haiku/trunk/data/boot_cd/hfs.map 2009-02-15 18:11:56 UTC (rev 29219)
@@ -2,7 +2,6 @@
# from treating everything like a text file (ugly!)
#
# EXTN XLate CREATOR TYPE Comment
-#.b Raw 'UNIX' 'tbxi' "bootstrap"
-#boot_loader_openfirmware Raw 'UNIX' 'boot' "bootstrap"
-boot_loader_openfirmware Raw 'UNIX' 'tbxi' "bootstrap"
+.b Raw 'UNIX' 'tbxi' "bootstrap"
+boot_loader_openfirmware Raw 'UNIX' 'boot' "bootstrap"
* Raw 'UNIX' 'UNIX' "unix"
From stippi at mail.berlios.de Sun Feb 15 19:14:36 2009
From: stippi at mail.berlios.de (stippi at BerliOS)
Date: Sun, 15 Feb 2009 19:14:36 +0100
Subject: [Haiku-commits] r29220 - haiku/trunk/src/servers/app/drawing/Painter
Message-ID: <200902151814.n1FIEaNZ023329@sheep.berlios.de>
Author: stippi
Date: 2009-02-15 19:14:35 +0100 (Sun, 15 Feb 2009)
New Revision: 29220
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29220&view=rev
Modified:
haiku/trunk/src/servers/app/drawing/Painter/Painter.cpp
haiku/trunk/src/servers/app/drawing/Painter/Painter.h
Log:
Finished the optimization for vertical gradients. This code is about
8.3 times faster than using the AGG pipeline, but about 3 times slower
than drawing a solid color square. It can probably still be improved.
The second version of _MakeGradient() is more powerful than the old one
and should replace it. It handles some corner cases, which the other
one does not.
Modified: haiku/trunk/src/servers/app/drawing/Painter/Painter.cpp
===================================================================
--- haiku/trunk/src/servers/app/drawing/Painter/Painter.cpp 2009-02-15 18:11:56 UTC (rev 29219)
+++ haiku/trunk/src/servers/app/drawing/Painter/Painter.cpp 2009-02-15 18:14:35 UTC (rev 29220)
@@ -864,20 +864,36 @@
BPoint b(max_c(r.left, r.right), max_c(r.top, r.bottom));
_Transform(&a, false);
_Transform(&b, false);
-
+
+ // first, try an optimized version
+ if (gradient.GetType() == BGradient::TYPE_LINEAR
+ && (fDrawingMode == B_OP_COPY || fDrawingMode == B_OP_OVER)) {
+ const BGradientLinear* linearGradient
+ = dynamic_cast(&gradient);
+ if (linearGradient->Start().x == linearGradient->End().x
+ // TODO: Remove this second check once the optimized method
+ // handled "upside down" gradients as well...
+ && linearGradient->Start().y <= linearGradient->End().y) {
+ // a vertical gradient
+ BRect rect(a, b);
+ FillRectVerticalGradient(rect, *linearGradient);
+ return _Clipped(rect);
+ }
+ }
+
// account for stricter interpretation of coordinates in AGG
// the rectangle ranges from the top-left (.0, .0)
// to the bottom-right (.9999, .9999) corner of pixels
b.x += 1.0;
b.y += 1.0;
-
+
fPath.remove_all();
fPath.move_to(a.x, a.y);
fPath.line_to(b.x, a.y);
fPath.line_to(b.x, b.y);
fPath.line_to(a.x, b.y);
fPath.close_polygon();
-
+
return _FillPath(fPath, gradient);
}
@@ -920,32 +936,37 @@
} while (fBaseRenderer.next_clip_box());
}
-#if 0
// FillRectVerticalGradient
void
-Painter::FillRectVerticalGradient(const BRect& r,
+Painter::FillRectVerticalGradient(BRect r,
const BGradientLinear& gradient) const
{
if (!fValidClipping)
return;
+ // Make sure the color array is no larger than the screen height.
+ r = r & fClippingRegion->Frame();
+
int32 gradientArraySize = r.IntegerHeight() + 1;
- rgb_color gradientArray[gradientArraySize];
- for (int32 i = 0; i < gradientArraySize; i++) {
+ uint32 gradientArray[gradientArraySize];
+ int32 gradientTop = gradient.Start().y;
+ int32 gradientBottom = gradient.End().y;
+ int32 colorCount = gradientBottom - gradientTop + 1;
+ if (colorCount < 0) {
+ // Gradient is upside down. That's currently not supported by this
+ // method.
+ return;
}
+ _MakeGradient(gradient, colorCount, gradientArray,
+ gradientTop - (int32)r.top, gradientArraySize);
+
uint8* dst = fBuffer.row_ptr(0);
uint32 bpr = fBuffer.stride();
int32 left = (int32)r.left;
int32 top = (int32)r.top;
int32 right = (int32)r.right;
int32 bottom = (int32)r.bottom;
- // get a 32 bit pixel ready with the color
- pixel32 color;
- color.data8[0] = c.blue;
- color.data8[1] = c.green;
- color.data8[2] = c.red;
- color.data8[3] = c.alpha;
// fill rects, iterate over clipping boxes
fBaseRenderer.first_clip_box();
do {
@@ -958,14 +979,13 @@
for (; y1 <= y2; y1++) {
// uint32* handle = (uint32*)(offset + y1 * bpr);
// for (int32 x = x1; x <= x2; x++) {
-// *handle++ = color.data32;
+// *handle++ = gradientArray[y1 - top];
// }
-gfxset32(offset + y1 * bpr, color.data32, (x2 - x1 + 1) * 4);
+gfxset32(offset + y1 * bpr, gradientArray[y1 - top], (x2 - x1 + 1) * 4);
}
}
} while (fBaseRenderer.next_clip_box());
}
-#endif
// FillRectNoClipping
void
@@ -2609,6 +2629,85 @@
}
// _MakeGradient
+void
+Painter::_MakeGradient(const BGradient& gradient, int32 colorCount,
+ uint32* colors, int32 arrayOffset, int32 arraySize) const
+{
+ BGradient::ColorStop* from = gradient.ColorStopAt(0);
+
+ if (!from)
+ return;
+
+ // current index into "colors" array
+// int32 index = (int32)floorf(colorCount * from->offset + 0.5)
+// + arrayOffset;
+ int32 index = (int32)floorf(colorCount * from->offset / 255 + 0.5)
+ + arrayOffset;
+ if (index > arraySize)
+ index = arraySize;
+ // Make sure we fill the entire array in case the gradient is outside.
+ if (index > 0) {
+ uint8* c = (uint8*)&colors[0];
+ for (int32 i = 0; i < index; i++) {
+ c[0] = from->color.blue;
+ c[1] = from->color.green;
+ c[2] = from->color.red;
+ c[3] = from->color.alpha;
+ c += 4;
+ }
+ }
+
+ // interpolate "from" to "to"
+ int32 stopCount = gradient.CountColorStops();
+ for (int32 i = 1; i < stopCount; i++) {
+ // find the step with the next offset
+ BGradient::ColorStop* to = gradient.ColorStopAtFast(i);
+
+ // interpolate
+// int32 offset = (int32)floorf((colorCount - 1) * to->offset + 0.5);
+ int32 offset = (int32)floorf((colorCount - 1)
+ * to->offset / 255 + 0.5);
+ if (offset > colorCount - 1)
+ offset = colorCount - 1;
+ offset += arrayOffset;
+ int32 dist = offset - index;
+ if (dist >= 0) {
+ int32 startIndex = max_c(index, 0);
+ int32 stopIndex = min_c(offset, arraySize - 1);
+ uint8* c = (uint8*)&colors[startIndex];
+ for (int32 i = startIndex; i <= stopIndex; i++) {
+ float f = (float)(offset - i) / (float)(dist + 1);
+ float t = 1.0 - f;
+ c[0] = (uint8)floorf(from->color.blue * f
+ + to->color.blue * t + 0.5);
+ c[1] = (uint8)floorf(from->color.green * f
+ + to->color.green * t + 0.5);
+ c[2] = (uint8)floorf(from->color.red * f
+ + to->color.red * t + 0.5);
+ c[3] = (uint8)floorf(from->color.alpha * f
+ + to->color.alpha * t + 0.5);
+ c += 4;
+ }
+ }
+ index = offset + 1;
+ // the current "to" will be the "from" in the next interpolation
+ from = to;
+ }
+ // make sure we fill the entire array
+ if (index < arraySize - 1) {
+ int32 startIndex = max_c(index, 0);
+ uint8* c = (uint8*)&colors[startIndex];
+ for (int32 i = startIndex; i < arraySize; i++) {
+ c[0] = from->color.red;
+ c[1] = from->color.green;
+ c[2] = from->color.blue;
+ c[3] = from->color.alpha;
+ c += 4;
+ }
+ }
+}
+
+// _MakeGradient
template
void
Painter::_MakeGradient(Array& array, const BGradient& gradient) const
Modified: haiku/trunk/src/servers/app/drawing/Painter/Painter.h
===================================================================
--- haiku/trunk/src/servers/app/drawing/Painter/Painter.h 2009-02-15 18:11:56 UTC (rev 29219)
+++ haiku/trunk/src/servers/app/drawing/Painter/Painter.h 2009-02-15 18:14:35 UTC (rev 29220)
@@ -144,6 +144,14 @@
// fills a solid rect with color c, no blending
void FillRect(const BRect& r,
const rgb_color& c) const;
+
+ // fills a rect with a linear gradient, the caller should be
+ // sure that the gradient is indeed vertical. The start point of
+ // the gradient should be above the end point, or this function
+ // will not draw anything.
+ void FillRectVerticalGradient(BRect r,
+ const BGradientLinear& gradient) const;
+
// fills a solid rect with color c, no blending, no clipping
void FillRectNoClipping(const clipping_rect& r,
const rgb_color& c) const;
@@ -278,6 +286,11 @@
void _CalcLinearGradientTransform(BPoint startPoint,
BPoint endPoint, agg::trans_affine& mtx,
float gradient_d2 = 100.0f) const;
+
+ void _MakeGradient(const BGradient& gradient,
+ int32 colorCount, uint32* colors,
+ int32 arrayOffset, int32 arraySize) const;
+
template
void _MakeGradient(Array& array,
const BGradient& gradient) const;
From stippi at mail.berlios.de Sun Feb 15 19:23:29 2009
From: stippi at mail.berlios.de (stippi at BerliOS)
Date: Sun, 15 Feb 2009 19:23:29 +0100
Subject: [Haiku-commits] r29221 - in haiku/trunk: headers/os/interface
src/apps/launchbox src/kits/interface src/kits/tracker
Message-ID: <200902151823.n1FINTFg001250@sheep.berlios.de>
Author: stippi
Date: 2009-02-15 19:23:19 +0100 (Sun, 15 Feb 2009)
New Revision: 29221
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29221&view=rev
Added:
haiku/trunk/headers/os/interface/ControlLook.h
haiku/trunk/src/kits/interface/ControlLook.cpp
Modified:
haiku/trunk/headers/os/interface/ChannelSlider.h
haiku/trunk/headers/os/interface/Menu.h
haiku/trunk/headers/os/interface/ScrollBar.h
haiku/trunk/headers/os/interface/Slider.h
haiku/trunk/src/apps/launchbox/IconButton.cpp
haiku/trunk/src/apps/launchbox/LaunchButton.cpp
haiku/trunk/src/kits/interface/BMCPrivate.cpp
haiku/trunk/src/kits/interface/Box.cpp
haiku/trunk/src/kits/interface/Button.cpp
haiku/trunk/src/kits/interface/ChannelSlider.cpp
haiku/trunk/src/kits/interface/CheckBox.cpp
haiku/trunk/src/kits/interface/ColorControl.cpp
haiku/trunk/src/kits/interface/Dragger.cpp
haiku/trunk/src/kits/interface/InterfaceDefs.cpp
haiku/trunk/src/kits/interface/Jamfile
haiku/trunk/src/kits/interface/Menu.cpp
haiku/trunk/src/kits/interface/MenuBar.cpp
haiku/trunk/src/kits/interface/MenuField.cpp
haiku/trunk/src/kits/interface/MenuItem.cpp
haiku/trunk/src/kits/interface/MenuWindow.cpp
haiku/trunk/src/kits/interface/RadioButton.cpp
haiku/trunk/src/kits/interface/ScrollBar.cpp
haiku/trunk/src/kits/interface/ScrollView.cpp
haiku/trunk/src/kits/interface/Slider.cpp
haiku/trunk/src/kits/interface/StatusBar.cpp
haiku/trunk/src/kits/interface/TabView.cpp
haiku/trunk/src/kits/interface/TextControl.cpp
haiku/trunk/src/kits/interface/TextInput.cpp
haiku/trunk/src/kits/interface/TextView.cpp
haiku/trunk/src/kits/tracker/ContainerWindow.cpp
haiku/trunk/src/kits/tracker/CountView.cpp
haiku/trunk/src/kits/tracker/TitleView.cpp
haiku/trunk/src/kits/tracker/TitleView.h
Log:
Implemented a new look for the Haiku interface controls. It was
overheard that they looked too ninety-ish.
TODO: The code behind this is work in progress. The basic idea
is to extract all drawing code into a new class BControlLook,
of which there is a global instance be_control_look, instantiated
in InterfaceDefs.cpp. At the moment, all the old drawing code is
still there, and the usage of be_control_look is inside if-bodies
checking the instance against NULL. In another words, by not
instanitating be_control_look, you can revert back to the old look.
BControlLook's job is to provide reusable methods for drawing
certain types of frames, backgrounds and labels, so that application
developers can make controls that re-use the same drawing code
as built-in controls and adopt to changes made there. I have added
the notion of "borders". Each of the frame drawing methods can be
made to draw certain borders only, which is supposed to help when
controls shall visually attach. This feature is not fully explored
at all ATM.
TODO: Update BColumnListView header view and BStringItem text
spacing. Update other apps where it makes sense to use BControlLook.
For the moment, only Tracker and LaunchBox are updated. More...
NOTE: The new look is not very radically different, so that existing
apps do not immediately look too ugly or out of place.
Modified: haiku/trunk/headers/os/interface/ChannelSlider.h
===================================================================
--- haiku/trunk/headers/os/interface/ChannelSlider.h 2009-02-15 18:14:35 UTC (rev 29220)
+++ haiku/trunk/headers/os/interface/ChannelSlider.h 2009-02-15 18:23:19 UTC (rev 29221)
@@ -17,58 +17,67 @@
#include
-class BChannelSlider : public BChannelControl
-{
+class BChannelSlider : public BChannelControl {
public:
- BChannelSlider(BRect area, const char* name,
- const char* label, BMessage* message,
- int32 channels = 1,
- uint32 resize = B_FOLLOW_LEFT | B_FOLLOW_TOP,
- uint32 flags = B_WILL_DRAW);
- BChannelSlider(BRect area, const char* name,
- const char* label, BMessage* message,
- orientation o, int32 channels = 1,
- uint32 resize = B_FOLLOW_LEFT | B_FOLLOW_TOP,
- uint32 flags = B_WILL_DRAW);
- BChannelSlider(BMessage* archive);
-virtual ~BChannelSlider();
+ BChannelSlider(BRect area, const char* name,
+ const char* label, BMessage* message,
+ int32 channels = 1,
+ uint32 resizeMode
+ = B_FOLLOW_LEFT | B_FOLLOW_TOP,
+ uint32 flags = B_WILL_DRAW);
+ BChannelSlider(BRect area, const char* name,
+ const char* label, BMessage* message,
+ enum orientation orientation,
+ int32 channels = 1,
+ uint32 resizeMode
+ = B_FOLLOW_LEFT | B_FOLLOW_TOP,
+ uint32 flags = B_WILL_DRAW);
+ BChannelSlider(const char* name,
+ const char* label, BMessage* message,
+ enum orientation orientation,
+ int32 channels = 1,
+ uint32 flags = B_WILL_DRAW);
+ BChannelSlider(BMessage* archive);
+ virtual ~BChannelSlider();
-static BArchivable* Instantiate(BMessage* from);
-virtual status_t Archive(BMessage* into, bool deep = true) const;
+ static BArchivable* Instantiate(BMessage* from);
+ virtual status_t Archive(BMessage* into, bool deep = true) const;
-virtual orientation Orientation() const;
- void SetOrientation(orientation o);
+ virtual orientation Orientation() const;
+ void SetOrientation(enum orientation orientation);
-virtual int32 MaxChannelCount() const;
-virtual bool SupportsIndividualLimits() const;
+ virtual int32 MaxChannelCount() const;
+ virtual bool SupportsIndividualLimits() const;
-virtual void AttachedToWindow();
-virtual void AllAttached();
-virtual void DetachedFromWindow();
-virtual void AllDetached();
+ virtual void AttachedToWindow();
+ virtual void AllAttached();
+ virtual void DetachedFromWindow();
+ virtual void AllDetached();
-virtual void MessageReceived(BMessage* msg);
+ virtual void MessageReceived(BMessage* message);
-virtual void Draw(BRect area);
-virtual void MouseDown(BPoint where);
-virtual void MouseUp(BPoint pt);
-virtual void MouseMoved(BPoint pt,uint32 code,
- const BMessage* message);
-virtual void WindowActivated(bool state);
-virtual void KeyDown(const char* bytes, int32 numBytes);
-virtual void KeyUp(const char* bytes, int32 numBytes);
-virtual void FrameResized(float width, float height);
+ virtual void Draw(BRect area);
+ virtual void MouseDown(BPoint where);
+ virtual void MouseUp(BPoint where);
+ virtual void MouseMoved(BPoint where, uint32 transit,
+ const BMessage* dragMessage);
+ virtual void WindowActivated(bool state);
+ virtual void KeyDown(const char* bytes, int32 numBytes);
+ virtual void KeyUp(const char* bytes, int32 numBytes);
+ virtual void FrameResized(float width, float height);
-virtual void SetFont(const BFont* font, uint32 mask = B_FONT_ALL);
-virtual void MakeFocus(bool focusState = true);
+ virtual void SetFont(const BFont* font,
+ uint32 mask = B_FONT_ALL);
+ virtual void MakeFocus(bool focusState = true);
-virtual void SetEnabled(bool on);
+ virtual void SetEnabled(bool on);
-virtual void GetPreferredSize(float* width, float* height);
+ virtual void GetPreferredSize(float* _width, float* _height);
-virtual BHandler* ResolveSpecifier(BMessage* msg, int32 index,
- BMessage* specifier, int32 form, const char* p);
-virtual status_t GetSupportedSuites(BMessage* data);
+ virtual BHandler* ResolveSpecifier(BMessage* message, int32 index,
+ BMessage* specifier, int32 form,
+ const char* p);
+ virtual status_t GetSupportedSuites(BMessage* data);
// Perform rendering for an entire slider channel.
virtual void DrawChannel(BView* into, int32 channel, BRect area,
Added: haiku/trunk/headers/os/interface/ControlLook.h
===================================================================
--- haiku/trunk/headers/os/interface/ControlLook.h 2009-02-15 18:14:35 UTC (rev 29220)
+++ haiku/trunk/headers/os/interface/ControlLook.h 2009-02-15 18:23:19 UTC (rev 29221)
@@ -0,0 +1,297 @@
+/*
+ * Copyright 2009, Stephan A?mus
+ * Distributed under the terms of the MIT License.
+ */
+#ifndef _CONTROL_LOOK_H
+#define _CONTROL_LOOK_H
+
+#include
+#include
+#include
+#include
+
+
+class BControl;
+class BGradientLinear;
+class BView;
+
+
+namespace BPrivate {
+
+
+class BControlLook {
+public:
+ BControlLook();
+ virtual ~BControlLook();
+
+ enum frame_type {
+ B_BUTTON_FRAME,
+ B_MENU_FRAME,
+ B_LISTVIEW_FRAME,
+ B_INPUT_FRAME
+ };
+
+ enum background_type {
+ B_BUTTON_BACKGROUND,
+ B_MENU_BACKGROUND,
+ B_LISTVIEW_BACKGROUND,
+ B_INPUT_BACKGROUND
+ };
+
+ enum {
+ B_LEFT_BORDER = 1 << 0,
+ B_RIGHT_BORDER = 1 << 1,
+ B_TOP_BORDER = 1 << 2,
+ B_BOTTOM_BORDER = 1 << 3,
+
+ B_ALL_BORDERS = B_LEFT_BORDER | B_RIGHT_BORDER
+ | B_TOP_BORDER | B_BOTTOM_BORDER
+ };
+
+ enum {
+ B_FOCUSED = 1 << 0,
+ B_CLICKED = 1 << 1, // some controls activate on mouse up
+ B_ACTIVATED = 1 << 2,
+ B_HOVER = 1 << 3,
+ B_DISABLED = 1 << 4,
+ B_DEFAULT_BUTTON = 1 << 5
+ };
+
+ virtual BAlignment DefaultLabelAlignment() const;
+ virtual float DefaultLabelSpacing() const;
+ uint32 Flags(BControl* control) const;
+
+ virtual void DrawButtonFrame(BView* view, BRect& rect,
+ const BRect& updateRect,
+ const rgb_color& base,
+ uint32 flags = 0,
+ uint32 borders = B_ALL_BORDERS);
+
+ virtual void DrawButtonBackground(BView* view, BRect& rect,
+ const BRect& updateRect,
+ const rgb_color& base,
+ uint32 flags = 0,
+ uint32 borders = B_ALL_BORDERS,
+ enum orientation orientation
+ = B_HORIZONTAL);
+
+ virtual void DrawMenuBarBackground(BView* view, BRect& rect,
+ const BRect& updateRect,
+ const rgb_color& base,
+ uint32 borders = B_ALL_BORDERS);
+
+ virtual void DrawMenuFieldBackground(BView* view,
+ BRect& rect, const BRect& updateRect,
+ const rgb_color& base, bool popupIndicator,
+ uint32 flags = 0);
+
+ virtual void DrawMenuFieldBackground(BView* view,
+ BRect& rect, const BRect& updateRect,
+ const rgb_color& base, uint32 flags = 0,
+ uint32 borders = B_ALL_BORDERS);
+
+ virtual void DrawMenuBackground(BView* view,
+ BRect& rect, const BRect& updateRect,
+ const rgb_color& base, uint32 flags = 0,
+ uint32 borders = B_ALL_BORDERS);
+
+ virtual void DrawMenuItemBackground(BView* view,
+ BRect& rect, const BRect& updateRect,
+ const rgb_color& base, uint32 flags = 0,
+ uint32 borders = B_ALL_BORDERS);
+
+ virtual void DrawStatusBar(BView* view, BRect& rect,
+ const BRect& updateRect,
+ const rgb_color& base,
+ const rgb_color& barColor,
+ float progressPosition);
+
+ virtual void DrawCheckBox(BView* view, BRect& rect,
+ const BRect& updateRect,
+ const rgb_color& base,
+ uint32 flags = 0);
+
+ virtual void DrawRadioButton(BView* view, BRect& rect,
+ const BRect& updateRect,
+ const rgb_color& base,
+ uint32 flags = 0);
+
+ virtual void DrawScrollBarBackground(BView* view,
+ BRect& rect1, BRect& rect2,
+ const BRect& updateRect,
+ const rgb_color& base, uint32 flags,
+ enum orientation orientation);
+
+ virtual void DrawScrollBarBackground(BView* view,
+ BRect& rect, const BRect& updateRect,
+ const rgb_color& base, uint32 flags,
+ enum orientation orientation);
+
+ virtual rgb_color SliderBarColor(const rgb_color& base);
+
+ virtual void DrawSliderBar(BView* view, BRect rect,
+ const BRect& updateRect,
+ const rgb_color& base,
+ rgb_color leftFillColor,
+ rgb_color rightFillColor,
+ float sliderScale, uint32 flags,
+ enum orientation orientation);
+
+ virtual void DrawSliderBar(BView* view, BRect rect,
+ const BRect& updateRect,
+ const rgb_color& base, rgb_color fillColor,
+ uint32 flags, enum orientation orientation);
+
+ virtual void DrawSliderThumb(BView* view, BRect& rect,
+ const BRect& updateRect,
+ const rgb_color& base, uint32 flags,
+ enum orientation orientation);
+
+ virtual void DrawSliderTriangle(BView* view, BRect& rect,
+ const BRect& updateRect,
+ const rgb_color& base, uint32 flags,
+ enum orientation orientation);
+
+ virtual void DrawSliderHashMarks(BView* view, BRect& rect,
+ const BRect& updateRect,
+ const rgb_color& base, int32 count,
+ hash_mark_location location,
+ uint32 flags, enum orientation orientation);
+
+ virtual void DrawActiveTab(BView* view, BRect& rect,
+ const BRect& updateRect,
+ const rgb_color& base, uint32 flags = 0,
+ uint32 borders = B_ALL_BORDERS);
+
+ virtual void DrawInctiveTab(BView* view, BRect& rect,
+ const BRect& updateRect,
+ const rgb_color& base, uint32 flags = 0,
+ uint32 borders = B_ALL_BORDERS);
+
+ // various borders
+
+ virtual void DrawBorder(BView* view, BRect& rect,
+ const BRect& updateRect,
+ const rgb_color& base,
+ border_style border, uint32 flags = 0,
+ uint32 borders = B_ALL_BORDERS);
+
+ virtual void DrawRaisedBorder(BView* view, BRect& rect,
+ const BRect& updateRect,
+ const rgb_color& base, uint32 flags = 0,
+ uint32 borders = B_ALL_BORDERS);
+
+ virtual void DrawGroupFrame(BView* view, BRect& rect,
+ const BRect& updateRect,
+ const rgb_color& base,
+ uint32 borders = B_ALL_BORDERS);
+
+ virtual void DrawTextControlBorder(BView* view, BRect& rect,
+ const BRect& updateRect,
+ const rgb_color& base, uint32 flags = 0,
+ uint32 borders = B_ALL_BORDERS);
+
+ // aligned labels
+
+ void DrawLabel(BView* view, const char* label,
+ BRect rect, const BRect& updateRect,
+ const rgb_color& base, uint32 flags);
+
+ virtual void DrawLabel(BView* view, const char* label,
+ BRect rect, const BRect& updateRect,
+ const rgb_color& base, uint32 flags,
+ const BAlignment& alignment);
+
+protected:
+ void _DrawOuterResessedFrame(BView* view,
+ BRect& rect, const rgb_color& base,
+ float contrast = 1.0f,
+ float brightness = 1.0f,
+ uint32 borders = B_ALL_BORDERS);
+
+ void _DrawFrame(BView* view, BRect& rect,
+ const rgb_color& left,
+ const rgb_color& top,
+ const rgb_color& right,
+ const rgb_color& bottom,
+ uint32 borders = B_ALL_BORDERS);
+
+ void _DrawFrame(BView* view, BRect& rect,
+ const rgb_color& left,
+ const rgb_color& top,
+ const rgb_color& right,
+ const rgb_color& bottom,
+ const rgb_color& rightTop,
+ const rgb_color& leftBottom,
+ uint32 borders = B_ALL_BORDERS);
+
+ void _FillGradient(BView* view, const BRect& rect,
+ const rgb_color& base, float topTint,
+ float bottomTint,
+ enum orientation orientation
+ = B_HORIZONTAL);
+
+ void _FillGlossyGradient(BView* view,
+ const BRect& rect, const rgb_color& base,
+ float topTint, float middle1Tint,
+ float middle2Tint, float bottomTint,
+ enum orientation orientation
+ = B_HORIZONTAL);
+
+ void _MakeGradient(BGradientLinear& gradient,
+ const BRect& rect, const rgb_color& base,
+ float topTint, float bottomTint,
+ enum orientation orientation
+ = B_HORIZONTAL) const;
+
+ void _MakeGlossyGradient(BGradientLinear& gradient,
+ const BRect& rect, const rgb_color& base,
+ float topTint, float middle1Tint,
+ float middle2Tint, float bottomTint,
+ enum orientation orientation
+ = B_HORIZONTAL) const;
+
+ bool _RadioButtonAndCheckBoxMarkColor(
+ const rgb_color& base, rgb_color& color,
+ uint32 flags) const;
+
+ void _DrawRoundBarCorner(BView* view, BRect& rect,
+ const BRect& updateRect,
+ const rgb_color& edgeLightColor,
+ const rgb_color& edgeShadowColor,
+ const rgb_color& frameLightColor,
+ const rgb_color& frameShadowColor,
+ const rgb_color& fillLightColor,
+ const rgb_color& fillShadowColor,
+ float leftInset, float topInset,
+ float rightInset, float bottomInset,
+ enum orientation orientation);
+
+ void _DrawRoundCornerLeftTop(BView* view,
+ BRect& rect, const BRect& updateRect,
+ const rgb_color& base,
+ const rgb_color& edgeColor,
+ const rgb_color& frameColor,
+ const rgb_color& bevelColor,
+ const BGradientLinear& fillGradient);
+ void _DrawRoundCornerRightTop(BView* view,
+ BRect& rect, const BRect& updateRect,
+ const rgb_color& base,
+ const rgb_color& edgeTopColor,
+ const rgb_color& edgeRightColor,
+ const rgb_color& frameTopColor,
+ const rgb_color& frameRightColor,
+ const rgb_color& bevelTopColor,
+ const rgb_color& bevelRightColor,
+ const BGradientLinear& fillGradient);
+};
+
+extern BControlLook* be_control_look;
+
+
+} // namespace BPrivate
+
+using BPrivate::BControlLook;
+using BPrivate::be_control_look;
+
+#endif // _CONTROL_LOOK_H
Modified: haiku/trunk/headers/os/interface/Menu.h
===================================================================
--- haiku/trunk/headers/os/interface/Menu.h 2009-02-15 18:14:35 UTC (rev 29220)
+++ haiku/trunk/headers/os/interface/Menu.h 2009-02-15 18:23:19 UTC (rev 29221)
@@ -206,8 +206,10 @@
BRect _CalcFrame(BPoint where, bool* scrollOn);
+protected:
void _DrawItems(BRect updateRect);
+private:
bool _OverSuper(BPoint loc);
bool _OverSubmenu(BMenuItem* item, BPoint loc);
BPrivate::BMenuWindow* _MenuWindow();
Modified: haiku/trunk/headers/os/interface/ScrollBar.h
===================================================================
--- haiku/trunk/headers/os/interface/ScrollBar.h 2009-02-15 18:14:35 UTC (rev 29220)
+++ haiku/trunk/headers/os/interface/ScrollBar.h 2009-02-15 18:23:19 UTC (rev 29221)
@@ -56,6 +56,13 @@
void SetOrientation(enum orientation orientation);
orientation Orientation() const;
+ // TODO: make this a virtual method, it should be one,
+ // but it's not important right now. This is supposed
+ // to be used in case the BScrollBar should draw part of
+ // the focus indication of the target view for aesthetical
+ // reasons. BScrollView will forward this method.
+ status_t SetBorderHighlighted(bool state);
+
virtual void MessageReceived(BMessage* message);
virtual void MouseDown(BPoint pt);
virtual void MouseUp(BPoint pt);
Modified: haiku/trunk/headers/os/interface/Slider.h
===================================================================
--- haiku/trunk/headers/os/interface/Slider.h 2009-02-15 18:14:35 UTC (rev 29220)
+++ haiku/trunk/headers/os/interface/Slider.h 2009-02-15 18:23:19 UTC (rev 29221)
@@ -177,6 +177,7 @@
BSlider& operator=(const BSlider &);
+ void _InitBarColor();
void _InitObject();
private:
Modified: haiku/trunk/src/apps/launchbox/IconButton.cpp
===================================================================
--- haiku/trunk/src/apps/launchbox/IconButton.cpp 2009-02-15 18:14:35 UTC (rev 29220)
+++ haiku/trunk/src/apps/launchbox/IconButton.cpp 2009-02-15 18:23:19 UTC (rev 29221)
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2008, Haiku.
+ * Copyright 2006-2009, Haiku.
* Distributed under the terms of the MIT License.
*
* Authors:
@@ -17,6 +17,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -80,8 +81,47 @@
rgb_color background = LowColor();
if (BView* parent = Parent())
background = parent->LowColor();
+
+ BRect r(Bounds());
+
+ if (be_control_look != NULL) {
+ uint32 flags = 0;
+ BBitmap* bitmap = fNormalBitmap;
+ if (!IsEnabled()) {
+ flags |= BControlLook::B_DISABLED;
+ bitmap = fDisabledBitmap;
+ }
+ if (_HasFlags(STATE_PRESSED) || _HasFlags(STATE_FORCE_PRESSED))
+ flags |= BControlLook::B_ACTIVATED;
+
+ if (DrawBorder()) {
+ be_control_look->DrawButtonFrame(this, r, area, background, flags);
+ be_control_look->DrawButtonBackground(this, r, area, background,
+ flags);
+ } else {
+ SetHighColor(background);
+ FillRect(r);
+ }
+
+ if (bitmap && bitmap->IsValid()) {
+ float x = r.left + floorf((r.Width()
+ - bitmap->Bounds().Width()) / 2.0 + 0.5);
+ float y = r.top + floorf((r.Height()
+ - bitmap->Bounds().Height()) / 2.0 + 0.5);
+ BPoint point(x, y);
+ if (_HasFlags(STATE_PRESSED) || _HasFlags(STATE_FORCE_PRESSED))
+ point += BPoint(1.0, 1.0);
+ if (bitmap->ColorSpace() == B_RGBA32
+ || bitmap->ColorSpace() == B_RGBA32_BIG) {
+ SetDrawingMode(B_OP_ALPHA);
+ SetBlendingMode(B_PIXEL_ALPHA, B_ALPHA_OVERLAY);
+ }
+ DrawBitmap(bitmap, point);
+ }
+ return;
+ }
+
rgb_color lightShadow, shadow, darkShadow, light;
- BRect r(Bounds());
BBitmap* bitmap = fNormalBitmap;
// adjust colors and bitmap according to flags
if (IsEnabled()) {
@@ -151,7 +191,7 @@
// background
SetDrawingMode(B_OP_COPY);
FillRect(r, B_SOLID_LOW);
- ConstrainClippingRegion(&originalClippingRegion);
+ ConstrainClippingRegion(NULL);
// label
if (fLabel.CountChars() > 0) {
SetDrawingMode(B_OP_COPY);
@@ -243,8 +283,8 @@
if (minHeight < MIN_SPACE)
minHeight = MIN_SPACE;
- float hPadding = max_c(4.0, ceilf(minHeight / 4.0));
- float vPadding = max_c(4.0, ceilf(minWidth / 4.0));
+ float hPadding = max_c(6.0, ceilf(minHeight / 4.0));
+ float vPadding = max_c(6.0, ceilf(minWidth / 4.0));
if (fLabel.CountChars() > 0) {
font_height fh;
Modified: haiku/trunk/src/apps/launchbox/LaunchButton.cpp
===================================================================
--- haiku/trunk/src/apps/launchbox/LaunchButton.cpp 2009-02-15 18:14:35 UTC (rev 29220)
+++ haiku/trunk/src/apps/launchbox/LaunchButton.cpp 2009-02-15 18:23:19 UTC (rev 29221)
@@ -253,8 +253,8 @@
float minWidth = fIconSize;
float minHeight = fIconSize;
- float hPadding = max_c(4.0, ceilf(minHeight / 4.0));
- float vPadding = max_c(4.0, ceilf(minWidth / 4.0));
+ float hPadding = max_c(6.0, ceilf(minHeight / 3.0));
+ float vPadding = max_c(6.0, ceilf(minWidth / 3.0));
if (fLabel.CountChars() > 0) {
font_height fh;
Modified: haiku/trunk/src/kits/interface/BMCPrivate.cpp
===================================================================
--- haiku/trunk/src/kits/interface/BMCPrivate.cpp 2009-02-15 18:14:35 UTC (rev 29220)
+++ haiku/trunk/src/kits/interface/BMCPrivate.cpp 2009-02-15 18:23:19 UTC (rev 29221)
@@ -7,9 +7,11 @@
* Stephan A?mus
*/
+#include
+
#include
-#include
+#include
#include
#include
#include
@@ -122,12 +124,44 @@
if (fFixedSize)
SetResizingMode(B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP);
Window()->SetKeyMenuBar(menuBar);
+
+ float left, top, right, bottom;
+ GetItemMargins(&left, &top, &right, &bottom);
+
+ // TODO: Better fix would be to make BMenuItem draw text properly
+ // centered
+ font_height fontHeight;
+ GetFontHeight(&fontHeight);
+ top = ceilf((Bounds().Height() - ceilf(fontHeight.ascent)
+ - ceilf(fontHeight.descent)) / 2) + 1;
+ bottom = top - 1;
+
+ if (be_control_look)
+ left = right = be_control_look->DefaultLabelSpacing();
+
+ SetItemMargins(left, top, right + fShowPopUpMarker ? 10 : 0, bottom);
}
void
_BMCMenuBar_::Draw(BRect updateRect)
{
+ if (be_control_look != NULL) {
+ BRect rect(Bounds());
+ rgb_color base = ui_color(B_PANEL_BACKGROUND_COLOR);
+ uint32 flags = 0;
+ if (!IsEnabled())
+ flags |= BControlLook::B_DISABLED;
+ if (IsFocus())
+ flags |= BControlLook::B_FOCUSED;
+ be_control_look->DrawMenuFieldBackground(this, rect,
+ updateRect, base, fShowPopUpMarker, flags);
+
+ _DrawItems(updateRect);
+
+ return;
+ }
+
if (!fShowPopUpMarker) {
BMenuBar::Draw(updateRect);
return;
Modified: haiku/trunk/src/kits/interface/Box.cpp
===================================================================
--- haiku/trunk/src/kits/interface/Box.cpp 2009-02-15 18:14:35 UTC (rev 29220)
+++ haiku/trunk/src/kits/interface/Box.cpp 2009-02-15 18:23:19 UTC (rev 29221)
@@ -16,6 +16,7 @@
#include
#include
+#include
#include
#include
#include
@@ -53,8 +54,7 @@
BBox::BBox(const char* name, uint32 flags, border_style border, BView* child)
- : BView(BRect(0, 0, -1, -1), name, B_FOLLOW_NONE,
- flags | B_WILL_DRAW | B_FRAME_EVENTS | B_SUPPORTS_LAYOUT),
+ : BView(name, flags | B_WILL_DRAW | B_FRAME_EVENTS),
fStyle(border)
{
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
@@ -68,8 +68,7 @@
BBox::BBox(border_style border, BView* child)
- : BView(BRect(0, 0, -1, -1), NULL, B_FOLLOW_NONE,
- B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE_JUMP | B_SUPPORTS_LAYOUT),
+ : BView(NULL, B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE_JUMP),
fStyle(border)
{
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
@@ -639,15 +638,27 @@
BRect rect = Bounds();
rect.top += TopBorderOffset();
- rgb_color shadow = tint_color(ViewColor(), B_DARKEN_3_TINT);
+ float lightTint;
+ float shadowTint;
+ if (be_control_look != NULL) {
+ lightTint = B_LIGHTEN_1_TINT;
+ shadowTint = B_DARKEN_1_TINT;
+ } else {
+ lightTint = B_LIGHTEN_MAX_TINT;
+ shadowTint = B_DARKEN_3_TINT;
+ }
if (rect.Height() == 0.0 || rect.Width() == 0.0) {
// used as separator
+ rgb_color shadow = tint_color(ViewColor(), B_DARKEN_2_TINT);
+
SetHighColor(shadow);
StrokeLine(rect.LeftTop(),rect.RightBottom());
} else {
// used as box
- rgb_color light = tint_color(ViewColor(), B_LIGHTEN_MAX_TINT);
+ rgb_color light = tint_color(ViewColor(), lightTint);
+ rgb_color shadow = tint_color(ViewColor(), shadowTint);
+
BeginLineArray(4);
AddLine(BPoint(rect.left, rect.bottom),
BPoint(rect.left, rect.top), light);
@@ -668,6 +679,23 @@
BRect rect = Bounds();
rect.top += TopBorderOffset();
+ if (be_control_look != NULL) {
+ rgb_color base = ViewColor();
+ if (rect.Height() == 1.0) {
+ // used as horizontal separator
+ be_control_look->DrawGroupFrame(this, rect, rect, base,
+ BControlLook::B_TOP_BORDER);
+ } else if (rect.Width() == 1.0) {
+ // used as vertical separator
+ be_control_look->DrawGroupFrame(this, rect, rect, base,
+ BControlLook::B_LEFT_BORDER);
+ } else {
+ // used as box
+ be_control_look->DrawGroupFrame(this, rect, rect, base);
+ }
+ return;
+ }
+
rgb_color light = tint_color(ViewColor(), B_LIGHTEN_MAX_TINT);
rgb_color shadow = tint_color(ViewColor(), B_DARKEN_3_TINT);
Modified: haiku/trunk/src/kits/interface/Button.cpp
===================================================================
--- haiku/trunk/src/kits/interface/Button.cpp 2009-02-15 18:14:35 UTC (rev 29220)
+++ haiku/trunk/src/kits/interface/Button.cpp 2009-02-15 18:23:19 UTC (rev 29221)
@@ -15,6 +15,7 @@
#include
+#include
#include
#include
#include
@@ -102,6 +103,24 @@
void
BButton::Draw(BRect updateRect)
{
+ if (be_control_look != NULL) {
+ BRect rect(Bounds());
+ rgb_color base = LowColor();
+ uint32 flags = be_control_look->Flags(this);
+ if (IsDefault())
+ flags |= BControlLook::B_DEFAULT_BUTTON;
+ be_control_look->DrawButtonFrame(this, rect, updateRect,
+ base, flags);
+ be_control_look->DrawButtonBackground(this, rect, updateRect,
+ base, flags);
+
+ // always leave some room around the label
+ rect.InsetBy(3.0, 3.0);
+ be_control_look->DrawLabel(this, Label(), rect, updateRect,
+ base, flags, BAlignment(B_ALIGN_CENTER, B_ALIGN_MIDDLE));
+ return;
+ }
+
font_height fh;
GetFontHeight(&fh);
Modified: haiku/trunk/src/kits/interface/ChannelSlider.cpp
===================================================================
--- haiku/trunk/src/kits/interface/ChannelSlider.cpp 2009-02-15 18:14:35 UTC (rev 29220)
+++ haiku/trunk/src/kits/interface/ChannelSlider.cpp 2009-02-15 18:23:19 UTC (rev 29221)
@@ -4,8 +4,10 @@
* Distributed under the terms of the MIT License.
*/
+#include
+
#include
-#include
+#include
#include
#include
#include
@@ -79,15 +81,27 @@
BChannelSlider::BChannelSlider(BRect area, const char *name, const char *label,
- BMessage *model, orientation o, int32 channels, uint32 resizeMode, uint32 flags)
+ BMessage *model, enum orientation orientation, int32 channels,
+ uint32 resizeMode, uint32 flags)
: BChannelControl(area, name, label, model, channels, resizeMode, flags)
{
_InitData();
- SetOrientation(o);
+ SetOrientation(orientation);
}
+BChannelSlider::BChannelSlider(const char *name, const char *label,
+ BMessage *model, enum orientation orientation, int32 channels,
+ uint32 flags)
+ : BChannelControl(name, label, model, channels, flags)
+
+{
+ _InitData();
+ SetOrientation(orientation);
+}
+
+
BChannelSlider::BChannelSlider(BMessage *archive)
: BChannelControl(archive)
{
@@ -138,9 +152,9 @@
void
-BChannelSlider::SetOrientation(orientation _orientation)
+BChannelSlider::SetOrientation(enum orientation orientation)
{
- bool isVertical = _orientation == B_VERTICAL;
+ bool isVertical = orientation == B_VERTICAL;
if (isVertical != _Vertical()) {
fVertical = isVertical;
Invalidate(Bounds());
@@ -415,6 +429,10 @@
BChannelSlider::FrameResized(float newWidth, float newHeight)
{
BChannelControl::FrameResized(newWidth, newHeight);
+
+ delete fBacking;
+ fBacking = NULL;
+
Invalidate(Bounds());
}
@@ -533,6 +551,20 @@
ASSERT(into != NULL);
BRect rect(leftTop, bottomRight);
+ if (be_control_look != NULL) {
+ rect.InsetBy(-2.5, -2.5);
+ rect.left = floorf(rect.left);
+ rect.top = floorf(rect.top);
+ rect.right = floorf(rect.right);
+ rect.bottom = floorf(rect.bottom);
+ rgb_color base = ui_color(B_PANEL_BACKGROUND_COLOR);
+ rgb_color barColor = be_control_look->SliderBarColor(base);
+ uint32 flags = 0;
+ be_control_look->DrawSliderBar(into, rect, rect, base,
+ barColor, flags, Orientation());
+ return;
+ }
+
_DrawGrooveFrame(fBackingView, rect.InsetByCopy(-2.5, -2.5));
rect.InsetBy(-0.5, -0.5);
@@ -553,6 +585,22 @@
where.x -= bitmapBounds.right / 2.0;
where.y -= bitmapBounds.bottom / 2.0;
+
+ if (be_control_look != NULL) {
+ BRect rect(bitmapBounds.OffsetToCopy(where));
+ rect.InsetBy(1, 1);
+ rect.left = floorf(rect.left);
+ rect.top = floorf(rect.top);
+ rect.right = ceilf(rect.right + 0.5);
+ rect.bottom = ceilf(rect.bottom + 0.5);
+ rgb_color base = ui_color(B_PANEL_BACKGROUND_COLOR);
+ uint32 flags = 0;
+ be_control_look->DrawSliderThumb(into, rect, rect, base,
+ flags, Orientation());
+ return;
+ }
+
+
into->PushState();
into->SetDrawingMode(B_OP_OVER);
Modified: haiku/trunk/src/kits/interface/CheckBox.cpp
===================================================================
--- haiku/trunk/src/kits/interface/CheckBox.cpp 2009-02-15 18:14:35 UTC (rev 29220)
+++ haiku/trunk/src/kits/interface/CheckBox.cpp 2009-02-15 18:23:19 UTC (rev 29221)
@@ -11,6 +11,7 @@
#include
+#include
#include
#include
@@ -82,6 +83,26 @@
void
BCheckBox::Draw(BRect updateRect)
{
+ if (be_control_look) {
+ rgb_color base = ui_color(B_PANEL_BACKGROUND_COLOR);
+
+ uint32 flags = be_control_look->Flags(this);
+ if (fOutlined)
+ flags |= BControlLook::B_CLICKED;
+
+ BRect checkBoxRect(_CheckBoxFrame());
+ BRect rect(checkBoxRect);
+ be_control_look->DrawCheckBox(this, rect, updateRect,base, flags);
+
+ BRect labelRect(Bounds());
+ labelRect.left = checkBoxRect.right
+ + be_control_look->DefaultLabelSpacing();
+
+ be_control_look->DrawLabel(this, Label(), labelRect, updateRect,
+ base, flags);
+ return;
+ }
+
font_height fontHeight;
GetFontHeight(&fontHeight);
@@ -551,7 +572,7 @@
font_height fontHeight;
GetFontHeight(&fontHeight);
- return BRect(1.0f, 3.0f, ceilf(3.0f + fontHeight.ascent),
+ return BRect(0.0f, 2.0f, ceilf(3.0f + fontHeight.ascent),
ceilf(5.0f + fontHeight.ascent));
}
Modified: haiku/trunk/src/kits/interface/ColorControl.cpp
===================================================================
--- haiku/trunk/src/kits/interface/ColorControl.cpp 2009-02-15 18:14:35 UTC (rev 29220)
+++ haiku/trunk/src/kits/interface/ColorControl.cpp 2009-02-15 18:23:19 UTC (rev 29221)
@@ -11,11 +11,12 @@
/** BColorControl displays a palette of selectable colors. */
+#include
#include
#include
-#include
+#include
#include
#include
#include
@@ -391,16 +392,12 @@
if (!fBitmap->Lock())
return;
- if (fOffscreenView->Bounds().Intersects(updateRect)) {
- BRegion region(updateRect);
- ConstrainClippingRegion(®ion);
+ if (fOffscreenView->Bounds().Intersects(updateRect))
DrawBitmap(fBitmap, B_ORIGIN);
- ConstrainClippingRegion(NULL);
- }
fBitmap->Unlock();
_DrawSelectors(this);
-
+
} else {
_DrawColorArea(this, updateRect);
_DrawSelectors(this);
@@ -413,45 +410,57 @@
{
BRegion region(update);
target->ConstrainClippingRegion(®ion);
-
- rgb_color noTint = ui_color(B_PANEL_BACKGROUND_COLOR);
- rgb_color lighten1 = tint_color(noTint, B_LIGHTEN_1_TINT);
- rgb_color lightenmax = tint_color(noTint, B_LIGHTEN_MAX_TINT);
- rgb_color darken1 = tint_color(noTint, B_DARKEN_1_TINT);
- rgb_color darken2 = tint_color(noTint, B_DARKEN_2_TINT);
- rgb_color darken4 = tint_color(noTint, B_DARKEN_4_TINT);
-
+
BRect bevelRect = fPaletteFrame.InsetByCopy(-2.0,-2.0); //bevel
-
bool enabled = IsEnabled();
-
- // First bevel
- if (enabled)
- target->SetHighColor(darken1);
- else
- target->SetHighColor(noTint);
- target->StrokeLine(bevelRect.LeftBottom(), bevelRect.LeftTop());
- target->StrokeLine(bevelRect.LeftTop(), bevelRect.RightTop());
- if (enabled)
- target->SetHighColor(lightenmax);
- else
- target->SetHighColor(lighten1);
- target->StrokeLine(BPoint(bevelRect.left + 1.0f, bevelRect.bottom), bevelRect.RightBottom());
- target->StrokeLine(bevelRect.RightBottom(), BPoint(bevelRect.right, bevelRect.top + 1.0f));
- bevelRect.InsetBy(1.0f, 1.0f);
+ rgb_color noTint = ui_color(B_PANEL_BACKGROUND_COLOR);
+ rgb_color darken1 = tint_color(noTint, B_DARKEN_1_TINT);
- // Second bevel
- if (enabled)
- target->SetHighColor(darken4);
- else
- target->SetHighColor(darken2);
- target->StrokeLine(bevelRect.LeftBottom(), bevelRect.LeftTop());
- target->StrokeLine(bevelRect.LeftTop(), bevelRect.RightTop());
[... truncated: 4026 lines follow ...]
From phoudoin at mail.berlios.de Sun Feb 15 19:26:44 2009
From: phoudoin at mail.berlios.de (phoudoin at mail.berlios.de)
Date: Sun, 15 Feb 2009 19:26:44 +0100
Subject: [Haiku-commits] r29222 -
haiku/trunk/src/system/boot/platform/bios_ia32
Message-ID: <200902151826.n1FIQhtc004365@sheep.berlios.de>
Author: phoudoin
Date: 2009-02-15 19:26:13 +0100 (Sun, 15 Feb 2009)
New Revision: 29222
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29222&view=rev
Modified:
haiku/trunk/src/system/boot/platform/bios_ia32/smp.cpp
Log:
Applied patch supplied by jkeeping in #3445: smp_do_mp_config wasn't checking
MPS table CPU entries for the enabled flag.
This caused Haiku to fail to boot under KVM on Linux.
Thanks you, jkeeping.
Modified: haiku/trunk/src/system/boot/platform/bios_ia32/smp.cpp
===================================================================
--- haiku/trunk/src/system/boot/platform/bios_ia32/smp.cpp 2009-02-15 18:23:19 UTC (rev 29221)
+++ haiku/trunk/src/system/boot/platform/bios_ia32/smp.cpp 2009-02-15 18:26:13 UTC (rev 29222)
@@ -151,6 +151,10 @@
struct mp_base_processor *processor = (struct mp_base_processor *)pointer;
+ /* skip if the processor is not enabled. */
+ if(!(processor->cpu_flags & 0x1))
+ break;
+
gKernelArgs.arch_args.cpu_apic_id[gKernelArgs.num_cpus] = processor->apic_id;
gKernelArgs.arch_args.cpu_os_id[processor->apic_id] = gKernelArgs.num_cpus;
gKernelArgs.arch_args.cpu_apic_version[gKernelArgs.num_cpus] = processor->apic_version;
From oruizdorantes at mail.berlios.de Sun Feb 15 19:32:23 2009
From: oruizdorantes at mail.berlios.de (oruizdorantes at BerliOS)
Date: Sun, 15 Feb 2009 19:32:23 +0100
Subject: [Haiku-commits] r29223 - haiku/trunk/src/preferences/bluetooth
Message-ID: <200902151832.n1FIWNL9010882@sheep.berlios.de>
Author: oruizdorantes
Date: 2009-02-15 19:32:23 +0100 (Sun, 15 Feb 2009)
New Revision: 29223
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29223&view=rev
Modified:
haiku/trunk/src/preferences/bluetooth/InquiryPanel.cpp
haiku/trunk/src/preferences/bluetooth/InquiryPanel.h
haiku/trunk/src/preferences/bluetooth/RemoteDevicesView.cpp
haiku/trunk/src/preferences/bluetooth/RemoteDevicesView.h
Log:
- Implement ADD button for remote devices list
- Shape a bit more the skeleton panel for scanning devices
Modified: haiku/trunk/src/preferences/bluetooth/InquiryPanel.cpp
===================================================================
--- haiku/trunk/src/preferences/bluetooth/InquiryPanel.cpp 2009-02-15 18:26:13 UTC (rev 29222)
+++ haiku/trunk/src/preferences/bluetooth/InquiryPanel.cpp 2009-02-15 18:32:23 UTC (rev 29223)
@@ -2,22 +2,19 @@
* Copyright 2008-09, Oliver Ruiz Dorantes,
* All rights reserved. Distributed under the terms of the MIT License.
*/
-#include "BluetoothWindow.h"
#include
#include
#include
-#include
+#include
#include
+#include
#include
-
-#include "RemoteDevicesView.h"
-
-//#include "ConnChanView.h"
+#include
#include "defs.h"
-static const uint32 kMsgSetDefaults = 'dflt';
+static const uint32 kMsgUpdate = 'dflt';
static const uint32 kMsgRevert = 'rvrt';
static const uint32 kMsgStartServices = 'SrSR';
@@ -25,61 +22,43 @@
static const uint32 kMsgShowDebug = 'ShDG';
-BluetoothWindow::BluetoothWindow(BRect frame)
+InquiryPanel::InquiryPanel(BRect frame)
: BWindow(frame, "Bluetooth", B_TITLED_WINDOW,
B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS,
B_ALL_WORKSPACES)
{
+ BRect iDontCare(0,0,0,0);
+ BRect iDontCareToo(0,0,5,5);
+
SetLayout(new BGroupLayout(B_HORIZONTAL));
- fDefaultsButton = new BButton("defaults", "Defaults",
- new BMessage(kMsgSetDefaults), B_WILL_DRAW);
+ fScanProgress = new BStatusBar(iDontCare, "status", "Scanning", "Scan time");
+ fScanProgress->SetMaxValue(52);
- fRevertButton = new BButton("revert", "Revert",
+ fMessage = new BTextView(iDontCare, "description",
+ iDontCare2, B_FOLLOW_LEFT_RIGHT,
+ B_WILL_DRAW | B_FRAME_EVENTS);
+ fMessage->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
+ fMessage->SetLowColor(fMessage->ViewColor());
+ fMessage->MakeEditable(false);
+ fMessage->SetText("asdfdasas asdfas asdfasd a dfad asdf dfasdf a");
+
+ fInquiryButton = new BButton("Inquiry", "Inquiry",
new BMessage(kMsgRevert), B_WILL_DRAW);
+
+ fAddButton = new BButton("ad", "Add device to list",
+ new BMessage(kMsgRevert), B_WILL_DRAW);
- // Add the menu bar
- fMenubar = new BMenuBar(Bounds(), "menu_bar");
- // Add File menu to menu bar
- BMenu *menu = new BMenu("Server");
- menu->AddItem(new BMenuItem("Start Bluetooth Services" B_UTF8_ELLIPSIS, new BMessage(kMsgStartServices), 0));
- menu->AddItem(new BMenuItem("Stop Bluetooth Services" B_UTF8_ELLIPSIS, new BMessage(kMsgStopServices), 0));
- menu->AddSeparatorItem();
- menu->AddItem(new BMenuItem("Show Bluetooth console" B_UTF8_ELLIPSIS, new BMessage(kMsgStartServices), 0));
- fMenubar->AddItem(menu);
-
- menu = new BMenu("View");
- menu->AddItem(new BMenuItem("Connections & Channels list" B_UTF8_ELLIPSIS, NULL, 0));
- menu->AddItem(new BMenuItem("Remote Devices List" B_UTF8_ELLIPSIS, NULL, 0));
- fMenubar->AddItem(menu);
-
- menu = new BMenu("Help");
- menu->AddItem(new BMenuItem("About" B_UTF8_ELLIPSIS, new BMessage(B_ABOUT_REQUESTED), 0));
- fMenubar->AddItem(menu);
-
- BTabView* tabView = new BTabView("tabview", B_WIDTH_FROM_LABEL);
-
- fSettingsView = new BluetoothSettingsView("Settings");
-// fConnChan = new ConnChanView("Connections & Channels", B_WILL_DRAW);
- fRemoteDevices = new RemoteDevicesView("Remote Devices", B_WILL_DRAW);
-
- tabView->AddTab(fRemoteDevices);
-// tabView->AddTab(fConnChan);
- tabView->AddTab(fSettingsView);
-
-
- fRevertButton->SetEnabled(false);
-
AddChild(BGroupLayoutBuilder(B_VERTICAL, 0)
- .Add(fMenubar)
+ .Add(fScanProgress)
.Add(BSpaceLayoutItem::CreateVerticalStrut(5))
- .Add(tabView)
+ .Add(fMessage)
.Add(BSpaceLayoutItem::CreateVerticalStrut(5))
.Add(BGroupLayoutBuilder(B_HORIZONTAL, 0)
- .Add(fRevertButton)
+ .Add(fAddButton)
.AddGlue()
- .Add(fDefaultsButton)
+ .Add(fInquiryButton)
)
.SetInsets(5, 5, 5, 5)
);
@@ -87,7 +66,7 @@
void
-BluetoothWindow::MessageReceived(BMessage *message)
+InquiryPanel::MessageReceived(BMessage *message)
{
switch (message->what) {
case kMsgUpdate:
@@ -96,76 +75,30 @@
fRevertButton->SetEnabled(true);*/
break;
- case kMsgSetDefaults:
-/* fColorsView -> MessageReceived(new BMessage(DEFAULT_SETTINGS));
+/* case kMsgSetDefaults:
+ fColorsView -> MessageReceived(new BMessage(DEFAULT_SETTINGS));
fAntialiasingSettings->SetDefaults();
fDefaultsButton->SetEnabled(false);
fRevertButton->SetEnabled(true);
-*/ break;
+ break;
case kMsgRevert:
-/* fColorsView -> MessageReceived(new BMessage(REVERT_SETTINGS));
+ fColorsView -> MessageReceived(new BMessage(REVERT_SETTINGS));
fAntialiasingSettings->Revert();
fDefaultsButton->SetEnabled(fColorsView->IsDefaultable()
|| fAntialiasingSettings->IsDefaultable());
fRevertButton->SetEnabled(false);
-*/ break;
- case B_ABOUT_REQUESTED:
- AboutRequested();
- break;
- default:
+ break;
+*/ default:
BWindow::MessageReceived(message);
break;
}
}
-void
-BluetoothWindow::AboutRequested()
-{
-
- (new BAlert("about", "Haiku Bluetooth System, (ARCE)
-Created by Oliver Ruiz Dorantes
-
-With support of:
- - Mika Lindqvist
- - Maksym Yevmenkin
-
-Thanks to the individuals who helped...
-
-Shipping/donating hardware:
- - Henry Jair Abril Florez(el Colombian)
- & Stefanie Bartolich
- - Dennis d'Entremont
- - Luroh
- - Pieter Panman
-
-Economically:
- - Karl von Dorf, Andrea Bernardi (OSDrawer),
- - Matt M, Doug F, Hubert H,
- - Sebastian B, Andrew M, Jared E,
- - Frederik H, Tom S, Ferry B,
- - Greg G, David F, Richard S, Martin W:
-
-With patches:
- - Fredrik Ekdahl
- - Andreas F?rber
-
-Testing:
- - Petter H. Juliussen
- - Raynald Lesieur
- - Adrien Destugues
- - J?rg Meyer
-
-Who gave me all the knowledge:
- - the yellowTAB team", "OK"))->Go();
-
-}
-
-
bool
-BluetoothWindow::QuitRequested(void)
+InquiryPanel::QuitRequested(void)
{
- be_app->PostMessage(B_QUIT_REQUESTED);
+
return true;
}
Modified: haiku/trunk/src/preferences/bluetooth/InquiryPanel.h
===================================================================
--- haiku/trunk/src/preferences/bluetooth/InquiryPanel.h 2009-02-15 18:26:13 UTC (rev 29222)
+++ haiku/trunk/src/preferences/bluetooth/InquiryPanel.h 2009-02-15 18:32:23 UTC (rev 29223)
@@ -11,28 +11,23 @@
#include
#include
+class BStatusBar;
+class BButton;
+class BTextView;
-#include "InquirySettingsView.h"
-
-class RemoteDevicesView;
-class ConnChanView;
-
-class InquiryWindow : public BWindow
+class InquiryPanel : public BWindow
{
public:
- InquiryWindow(BRect frame);
+ InquiryPanel(BRect frame);
bool QuitRequested(void);
void MessageReceived(BMessage *message);
-private:
- RemoteDevicesView* fRemoteDevices;
- ConnChanView* fConnChan;
- BButton* fDefaultsButton;
- BButton* fRevertButton;
- BMenuBar* fMenubar;
+private:
+ BStatusBar* fScanProgress;
+ BButton* fAddButton;
+ BButton* fInquiryButton;
+ BTextView* fMessage;
};
-
-
#endif
Modified: haiku/trunk/src/preferences/bluetooth/RemoteDevicesView.cpp
===================================================================
--- haiku/trunk/src/preferences/bluetooth/RemoteDevicesView.cpp 2009-02-15 18:26:13 UTC (rev 29222)
+++ haiku/trunk/src/preferences/bluetooth/RemoteDevicesView.cpp 2009-02-15 18:32:23 UTC (rev 29223)
@@ -15,6 +15,7 @@
#include
+#include "InquiryPanel.h"
#include "BluetoothWindow.h"
#include "defs.h"
@@ -28,7 +29,7 @@
{
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
- BButton* addButton = new BButton(BRect(5,5,5,5), "add", "Add" B_UTF8_ELLIPSIS,
+ addButton = new BButton(BRect(5,5,5,5), "add", "Add" B_UTF8_ELLIPSIS,
new BMessage(kMsgAddDevices), B_FOLLOW_RIGHT);
BButton* removeButton = new BButton(BRect(5,5,5,5), "remove", "Remove",
@@ -86,6 +87,7 @@
RemoteDevicesView::AttachedToWindow(void)
{
fAttrList->SetTarget(this);
+ addButton->SetTarget(this);
LoadSettings();
fAttrList->Select(0);
@@ -104,7 +106,12 @@
}
switch(msg->what) {
-
+ case kMsgAddDevices:
+ {
+ InquiryPanel* iPanel = new InquiryPanel(BRect(0,0,50,50));
+ iPanel->Show();
+ }
+ break;
default:
BView::MessageReceived(msg);
break;
Modified: haiku/trunk/src/preferences/bluetooth/RemoteDevicesView.h
===================================================================
--- haiku/trunk/src/preferences/bluetooth/RemoteDevicesView.h 2009-02-15 18:26:13 UTC (rev 29222)
+++ haiku/trunk/src/preferences/bluetooth/RemoteDevicesView.h 2009-02-15 18:32:23 UTC (rev 29223)
@@ -39,8 +39,9 @@
void UpdateControls();
void UpdateAllColors();
- BListView *fAttrList;
- BScrollView *fScrollView;
+ BButton* addButton;
+ BListView* fAttrList;
+ BScrollView* fScrollView;
};
From phoudoin at mail.berlios.de Sun Feb 15 19:43:05 2009
From: phoudoin at mail.berlios.de (phoudoin at mail.berlios.de)
Date: Sun, 15 Feb 2009 19:43:05 +0100
Subject: [Haiku-commits] r29224 -
haiku/trunk/src/system/boot/platform/bios_ia32
Message-ID: <200902151843.n1FIh5iA003050@sheep.berlios.de>
Author: phoudoin
Date: 2009-02-15 19:43:02 +0100 (Sun, 15 Feb 2009)
New Revision: 29224
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29224&view=rev
Modified:
haiku/trunk/src/system/boot/platform/bios_ia32/smp.cpp
Log:
Fixed the patch: on disabled processor entry, next entry pointer wasn't computed,
leading to an infinite loop...
Modified: haiku/trunk/src/system/boot/platform/bios_ia32/smp.cpp
===================================================================
--- haiku/trunk/src/system/boot/platform/bios_ia32/smp.cpp 2009-02-15 18:32:23 UTC (rev 29223)
+++ haiku/trunk/src/system/boot/platform/bios_ia32/smp.cpp 2009-02-15 18:43:02 UTC (rev 29224)
@@ -151,24 +151,25 @@
struct mp_base_processor *processor = (struct mp_base_processor *)pointer;
- /* skip if the processor is not enabled. */
- if(!(processor->cpu_flags & 0x1))
- break;
-
- gKernelArgs.arch_args.cpu_apic_id[gKernelArgs.num_cpus] = processor->apic_id;
- gKernelArgs.arch_args.cpu_os_id[processor->apic_id] = gKernelArgs.num_cpus;
- gKernelArgs.arch_args.cpu_apic_version[gKernelArgs.num_cpus] = processor->apic_version;
+ /* is processor enabled? */
+ if(processor->cpu_flags & 0x1) {
+ gKernelArgs.arch_args.cpu_apic_id[gKernelArgs.num_cpus] = processor->apic_id;
+ gKernelArgs.arch_args.cpu_os_id[processor->apic_id] = gKernelArgs.num_cpus;
+ gKernelArgs.arch_args.cpu_apic_version[gKernelArgs.num_cpus] = processor->apic_version;
+
#ifdef TRACE_SMP
- const char *cpuFamily[] = { "", "", "", "", "Intel 486",
- "Intel Pentium", "Intel Pentium Pro", "Intel Pentium II" };
+ const char *cpuFamily[] = { "", "", "", "", "Intel 486",
+ "Intel Pentium", "Intel Pentium Pro", "Intel Pentium II" };
#endif
- TRACE(("smp: cpu#%ld: %s, apic id %d, version %d%s\n",
- gKernelArgs.num_cpus, cpuFamily[(processor->signature & 0xf00) >> 8],
- processor->apic_id, processor->apic_version, (processor->cpu_flags & 0x2) ?
- ", BSP" : ""));
+ TRACE(("smp: cpu#%ld: %s, apic id %d, version %d%s\n",
+ gKernelArgs.num_cpus, cpuFamily[(processor->signature & 0xf00) >> 8],
+ processor->apic_id, processor->apic_version, (processor->cpu_flags & 0x2) ?
+ ", BSP" : ""));
- gKernelArgs.num_cpus++;
+ gKernelArgs.num_cpus++;
+ }
+
pointer += sizeof(struct mp_base_processor);
break;
}
From korli at users.berlios.de Sun Feb 15 19:48:47 2009
From: korli at users.berlios.de (=?ISO-8859-1?B?Suly9G1lIER1dmFs?=)
Date: Sun, 15 Feb 2009 19:48:47 +0100
Subject: [Haiku-commits] r29224 -
haiku/trunk/src/system/boot/platform/bios_ia32
In-Reply-To: <200902151843.n1FIh5iA003050@sheep.berlios.de>
References: <200902151843.n1FIh5iA003050@sheep.berlios.de>
Message-ID:
2009/2/15
> Modified: haiku/trunk/src/system/boot/platform/bios_ia32/smp.cpp
> ===================================================================
> --- haiku/trunk/src/system/boot/platform/bios_ia32/smp.cpp 2009-02-15
> 18:32:23 UTC (rev 29223)
> +++ haiku/trunk/src/system/boot/platform/bios_ia32/smp.cpp 2009-02-15
> 18:43:02 UTC (rev 29224)
> @@ -151,24 +151,25 @@
>
> struct mp_base_processor *processor =
> (struct mp_base_processor *)pointer;
>
> - /* skip if the processor is not enabled. */
> - if(!(processor->cpu_flags & 0x1))
> - break;
> -
> -
> gKernelArgs.arch_args.cpu_apic_id[gKernelArgs.num_cpus] =
> processor->apic_id;
> -
> gKernelArgs.arch_args.cpu_os_id[processor->apic_id] = gKernelArgs.num_cpus;
> -
> gKernelArgs.arch_args.cpu_apic_version[gKernelArgs.num_cpus] =
> processor->apic_version;
> + /* is processor enabled? */
> + if(processor->cpu_flags & 0x1) {
>
> +
> gKernelArgs.arch_args.cpu_apic_id[gKernelArgs.num_cpus] =
> processor->apic_id;
> +
> gKernelArgs.arch_args.cpu_os_id[processor->apic_id] = gKernelArgs.num_cpus;
> +
> gKernelArgs.arch_args.cpu_apic_version[gKernelArgs.num_cpus] =
> processor->apic_version;
> +
>
Why not a "continue" instead of "break" ? pointer can be augmented before
this test.
Bye,
J?r?me
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From revol at free.fr Sun Feb 15 19:56:51 2009
From: revol at free.fr (=?utf-8?q?Fran=C3=A7ois?= Revol)
Date: Sun, 15 Feb 2009 19:56:51 +0100 CET
Subject: [Haiku-commits]
=?utf-8?q?r29221_-_in_haiku/trunk=3A_headers/os/i?=
=?utf-8?q?nterface_src/apps/launchbox_src/kits/interface_src/kits/tracker?=
In-Reply-To: <200902151823.n1FINTFg001250@sheep.berlios.de>
Message-ID: <12832070685-BeMail@laptop>
> Log:
> Implemented a new look for the Haiku interface controls. It was
> overheard that they looked too ninety-ish.
OH MY GOD WHAT HAVE YOU DONE !!!???!!??
Hmm you're asking for trouble ;)
[19:42] ohhh now, what has stippi done
[19:42] hmm
[19:42] seems like that might be a little dangerous
[19:43] some rabid 90s beos ui fan might come slit your throat
in your sleep
Oh well, let's see...
> Added:
> haiku/trunk/headers/os/interface/ControlLook.h
> haiku/trunk/src/kits/interface/ControlLook.cpp
At least it seems you used a separate skin class.
I should probably port Skin-O-Be to it someday...
http://revolf.free.fr/beos/apps/skinobe/
Oh and add support in Themes as well...
And I thought we couldn't make Haiku even more uglier than possible
with ZETA themes :D
> BControlLook's job is to provide reusable methods for drawing
> certain types of frames, backgrounds and labels, so that application
> developers can make controls that re-use the same drawing code
> as built-in controls and adopt to changes made there. I have added
Actually that might also help with toolkit ports like GTK or Qt, that
usually require going through skin-like crap, but also provides a
"native" skin that uses the system's theme class.
Though I'd rather have real "heavyweight" ports (ie. real BButtons
BCheckbox... behind).
> TODO: Update BColumnListView header view and BStringItem text
> spacing. Update other apps where it makes sense to use BControlLook.
> For the moment, only Tracker and LaunchBox are updated. More...
Are you sure you want apps to depend on that ?
> NOTE: The new look is not very radically different, so that existing
> apps do not immediately look too ugly or out of place.
Well in the other case it means it's not done correctly, it's supposed
to make the look and feel independant from each other, right ?
Fran?ois.
From alex at zappotek.com Sun Feb 15 20:07:36 2009
From: alex at zappotek.com (Alexandre Deckner)
Date: Sun, 15 Feb 2009 20:07:36 +0100
Subject: [Haiku-commits] r29221 - in haiku/trunk: headers/os/interface
src/apps/launchbox src/kits/interface src/kits/tracker
In-Reply-To: <200902151823.n1FINTFg001250@sheep.berlios.de>
References: <200902151823.n1FINTFg001250@sheep.berlios.de>
Message-ID: <499867F8.5090006@zappotek.com>
stippi at BerliOS wrote:
> Author: stippi
> Date: 2009-02-15 19:23:19 +0100 (Sun, 15 Feb 2009)
> New Revision: 29221
> ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29221&view=rev
>
>
[...]
Very nice :) Lots of nice things here, i like what you've done to
tracker (still miss the new buttons in single window mode), tabs are
really going in a nice direction too.
So does this mean the UI will support full theming?
This way mmu_man will be able to develop his citrus theme ;-P
http://revolf.free.fr/beos/shots/shot_haiku_theme_citrus.png
Best regards,
Alex
From phoudoin at mail.berlios.de Sun Feb 15 20:27:40 2009
From: phoudoin at mail.berlios.de (phoudoin at mail.berlios.de)
Date: Sun, 15 Feb 2009 20:27:40 +0100
Subject: [Haiku-commits] r29225 -
haiku/trunk/src/system/boot/platform/bios_ia32
Message-ID: <200902151927.n1FJRejP007707@sheep.berlios.de>
Author: phoudoin
Date: 2009-02-15 20:27:36 +0100 (Sun, 15 Feb 2009)
New Revision: 29225
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29225&view=rev
Modified:
haiku/trunk/src/system/boot/platform/bios_ia32/smp.cpp
Log:
Refactor the code, computing next entry earlier and use continue as suggested by Jerome.
Modified: haiku/trunk/src/system/boot/platform/bios_ia32/smp.cpp
===================================================================
--- haiku/trunk/src/system/boot/platform/bios_ia32/smp.cpp 2009-02-15 18:43:02 UTC (rev 29224)
+++ haiku/trunk/src/system/boot/platform/bios_ia32/smp.cpp 2009-02-15 19:27:36 UTC (rev 29225)
@@ -143,62 +143,64 @@
switch (*pointer) {
case MP_BASE_PROCESSOR:
{
+ struct mp_base_processor *processor = (struct mp_base_processor *)pointer;
+ pointer += sizeof(struct mp_base_processor);
+
if (gKernelArgs.num_cpus == MAX_BOOT_CPUS) {
TRACE(("smp: already reached maximum boot CPUs (%d)\n", MAX_BOOT_CPUS));
- pointer += sizeof(struct mp_base_processor);
- break;
+ continue;
}
- struct mp_base_processor *processor = (struct mp_base_processor *)pointer;
+ /* skip if the processor is not enabled. */
+ if(!(processor->cpu_flags & 0x1)) {
+ TRACE(("smp: skip apic id %d: disabled\n", processor->apic_id));
+ continue;
+ }
- /* is processor enabled? */
- if(processor->cpu_flags & 0x1) {
+ gKernelArgs.arch_args.cpu_apic_id[gKernelArgs.num_cpus] = processor->apic_id;
+ gKernelArgs.arch_args.cpu_os_id[processor->apic_id] = gKernelArgs.num_cpus;
+ gKernelArgs.arch_args.cpu_apic_version[gKernelArgs.num_cpus] = processor->apic_version;
- gKernelArgs.arch_args.cpu_apic_id[gKernelArgs.num_cpus] = processor->apic_id;
- gKernelArgs.arch_args.cpu_os_id[processor->apic_id] = gKernelArgs.num_cpus;
- gKernelArgs.arch_args.cpu_apic_version[gKernelArgs.num_cpus] = processor->apic_version;
-
#ifdef TRACE_SMP
- const char *cpuFamily[] = { "", "", "", "", "Intel 486",
- "Intel Pentium", "Intel Pentium Pro", "Intel Pentium II" };
+ const char *cpuFamily[] = { "", "", "", "", "Intel 486",
+ "Intel Pentium", "Intel Pentium Pro", "Intel Pentium II" };
#endif
- TRACE(("smp: cpu#%ld: %s, apic id %d, version %d%s\n",
- gKernelArgs.num_cpus, cpuFamily[(processor->signature & 0xf00) >> 8],
- processor->apic_id, processor->apic_version, (processor->cpu_flags & 0x2) ?
- ", BSP" : ""));
+ TRACE(("smp: cpu#%ld: %s, apic id %d, version %d%s\n",
+ gKernelArgs.num_cpus, cpuFamily[(processor->signature & 0xf00) >> 8],
+ processor->apic_id, processor->apic_version, (processor->cpu_flags & 0x2) ?
+ ", BSP" : ""));
- gKernelArgs.num_cpus++;
- }
-
- pointer += sizeof(struct mp_base_processor);
+ gKernelArgs.num_cpus++;
break;
}
case MP_BASE_BUS:
{
struct mp_base_bus *bus = (struct mp_base_bus *)pointer;
+ pointer += sizeof(struct mp_base_bus);
TRACE(("smp: bus %d: %c%c%c%c%c%c\n", bus->bus_id,
bus->name[0], bus->name[1], bus->name[2], bus->name[3],
bus->name[4], bus->name[5]));
- pointer += sizeof(struct mp_base_bus);
break;
}
case MP_BASE_IO_APIC:
{
struct mp_base_ioapic *io = (struct mp_base_ioapic *)pointer;
+ pointer += sizeof(struct mp_base_ioapic);
+
gKernelArgs.arch_args.ioapic_phys = (uint32)io->addr;
TRACE(("smp: found io apic with apic id %d, version %d\n",
io->ioapic_id, io->ioapic_version));
- pointer += sizeof(struct mp_base_ioapic);
break;
}
case MP_BASE_IO_INTR:
case MP_BASE_LOCAL_INTR:
{
struct mp_base_interrupt *interrupt = (struct mp_base_interrupt *)pointer;
+ pointer += sizeof(struct mp_base_interrupt);
dprintf("smp: %s int: type %d, source bus %d, irq %3d, dest apic %d, int %3d, polarity %d, trigger mode %d\n",
interrupt->type == MP_BASE_IO_INTR ? "I/O" : "local",
@@ -206,7 +208,6 @@
interrupt->source_bus_irq, interrupt->dest_apic_id,
interrupt->dest_apic_int, interrupt->polarity,
interrupt->trigger_mode);
- pointer += sizeof(struct mp_base_interrupt);
break;
}
}
From korli at mail.berlios.de Sun Feb 15 20:43:38 2009
From: korli at mail.berlios.de (korli at BerliOS)
Date: Sun, 15 Feb 2009 20:43:38 +0100
Subject: [Haiku-commits] r29226 - haiku/trunk/src/apps/soundrecorder
Message-ID: <200902151943.n1FJhcmC009308@sheep.berlios.de>
Author: korli
Date: 2009-02-15 20:43:38 +0100 (Sun, 15 Feb 2009)
New Revision: 29226
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29226&view=rev
Modified:
haiku/trunk/src/apps/soundrecorder/RecorderWindow.cpp
Log:
* fix spacing between scope and vu views
Modified: haiku/trunk/src/apps/soundrecorder/RecorderWindow.cpp
===================================================================
--- haiku/trunk/src/apps/soundrecorder/RecorderWindow.cpp 2009-02-15 19:27:36 UTC (rev 29225)
+++ haiku/trunk/src/apps/soundrecorder/RecorderWindow.cpp 2009-02-15 19:43:38 UTC (rev 29226)
@@ -249,13 +249,13 @@
r = background->Bounds();
r.left = 0;
- r.right = r.left + 35;
+ r.right = r.left + 38;
r.bottom = r.top + 104;
fVUView = new VUView(r, B_FOLLOW_LEFT|B_FOLLOW_TOP);
background->AddChild(fVUView);
r = background->Bounds();
- r.left = r.left + 38;
+ r.left = r.left + 40;
r.bottom = r.top + 104;
fScopeView = new ScopeView(r, B_FOLLOW_LEFT_RIGHT|B_FOLLOW_TOP);
background->AddChild(fScopeView);
From anevilyak at gmail.com Sun Feb 15 21:35:48 2009
From: anevilyak at gmail.com (Rene Gollent)
Date: Sun, 15 Feb 2009 14:35:48 -0600
Subject: [Haiku-commits] r29221 - in haiku/trunk: headers/os/interface
src/apps/launchbox src/kits/interface src/kits/tracker
In-Reply-To: <499867F8.5090006@zappotek.com>
References: <200902151823.n1FINTFg001250@sheep.berlios.de>
<499867F8.5090006@zappotek.com>
Message-ID:
On Sun, Feb 15, 2009 at 1:07 PM, Alexandre Deckner wrote:
> Very nice :) Lots of nice things here, i like what you've done to
+1 :)
My only critique from a quick glance is that the default BMenuField
looks almost like it's in a disabled state, maybe a slightly more
active color for the drop down arrow might be a good idea?
Regards,
Rene
From axeld at pinc-software.de Sun Feb 15 21:52:58 2009
From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=)
Date: Sun, 15 Feb 2009 21:52:58 +0100 CET
Subject: [Haiku-commits]
=?utf-8?q?r29225_-_haiku/trunk/src/system/boot/pl?=
=?utf-8?q?atform/bios=5Fia32?=
In-Reply-To: <200902151927.n1FJRejP007707@sheep.berlios.de>
Message-ID: <36288484558-BeMail@zon>
phoudoin at mail.berlios.de wrote:
> + if(!(processor->cpu_flags & 0x1)) {
> + TRACE(("smp: skip apic id %d: disabled\n",
> processor->apic_id));
> + continue;
> + }
You seem to have messed up indentation here (spaces instead of tabs).
Also, there is a space between "if" and the opening parenthesis.
Bye,
Axel.
From mmlr at mail.berlios.de Sun Feb 15 22:10:03 2009
From: mmlr at mail.berlios.de (mmlr at mail.berlios.de)
Date: Sun, 15 Feb 2009 22:10:03 +0100
Subject: [Haiku-commits] r29227 - haiku/trunk/src/build/libroot
Message-ID: <200902152110.n1FLA3Uu016988@sheep.berlios.de>
Author: mmlr
Date: 2009-02-15 22:10:02 +0100 (Sun, 15 Feb 2009)
New Revision: 29227
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29227&view=rev
Modified:
haiku/trunk/src/build/libroot/fs.cpp
Log:
_kern_open_parent_dir has different semantics for the supplied name argument.
It's supposed to be filled with the entry name of the directory and not as in
all the other cases used as a leaf name to be appended to the dir. This would
lead to some errors with operations based on directory fds in the build libroot
and build libbe and in the end make generate_attribute_stores fail on platforms
that don't have an 0 initialized stack (since the supplied name buffer would
contain garbage later attached to the directory path).
Modified: haiku/trunk/src/build/libroot/fs.cpp
===================================================================
--- haiku/trunk/src/build/libroot/fs.cpp 2009-02-15 19:43:38 UTC (rev 29226)
+++ haiku/trunk/src/build/libroot/fs.cpp 2009-02-15 21:10:02 UTC (rev 29227)
@@ -418,7 +418,7 @@
{
// get a usable path
string realPath;
- status_t error = get_path(fd, name, realPath);
+ status_t error = get_path(fd, NULL, realPath);
if (error != B_OK)
return error;
From stefano.ceccherini at gmail.com Sun Feb 15 22:16:32 2009
From: stefano.ceccherini at gmail.com (Stefano Ceccherini)
Date: Sun, 15 Feb 2009 22:16:32 +0100
Subject: [Haiku-commits] r29221 - in haiku/trunk: headers/os/interface
src/apps/launchbox src/kits/interface src/kits/tracker
In-Reply-To: <200902151823.n1FINTFg001250@sheep.berlios.de>
References: <200902151823.n1FINTFg001250@sheep.berlios.de>
Message-ID: <894b9700902151316w147bda4bv538c857246ba113b@mail.gmail.com>
2009/2/15 stippi at BerliOS :
> Author: stippi
> Date: 2009-02-15 19:23:19 +0100 (Sun, 15 Feb 2009)
> New Revision: 29221
> ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29221&view=rev
>> Log:
> Implemented a new look for the Haiku interface controls. It was
> overheard that they looked too ninety-ish.
Very nice! Both the look and the implementation.
The only thing I'd point out (besides the menufields "problem",
already pointed out by Rene) is you that unselected tabs look like
they are all joint. IOW: You can't immediately tell how many tabs are
there.
Very nice work, though.
From umccullough at gmail.com Sun Feb 15 22:40:53 2009
From: umccullough at gmail.com (Urias McCullough)
Date: Sun, 15 Feb 2009 13:40:53 -0800
Subject: [Haiku-commits] r29221 - in haiku/trunk: headers/os/interface
src/apps/launchbox src/kits/interface src/kits/tracker
In-Reply-To: <894b9700902151316w147bda4bv538c857246ba113b@mail.gmail.com>
References: <200902151823.n1FINTFg001250@sheep.berlios.de>
<894b9700902151316w147bda4bv538c857246ba113b@mail.gmail.com>
Message-ID: <1e80d8750902151340k7aefe82fp7672fffa3955772@mail.gmail.com>
On Sun, Feb 15, 2009 at 1:16 PM, Stefano Ceccherini
wrote:
> 2009/2/15 stippi at BerliOS :
>> Author: stippi
>> Date: 2009-02-15 19:23:19 +0100 (Sun, 15 Feb 2009)
>> New Revision: 29221
>> ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29221&view=rev
>>> Log:
>> Implemented a new look for the Haiku interface controls. It was
>> overheard that they looked too ninety-ish.
>
> Very nice! Both the look and the implementation.
> The only thing I'd point out (besides the menufields "problem",
> already pointed out by Rene) is you that unselected tabs look like
> they are all joint. IOW: You can't immediately tell how many tabs are
> there.
> Very nice work, though.
I agree on the tabs - it seems like there should be some hint of
distinction between the inactive tabs.
Overall, the flatter look with tasteful application of gradients is
nice though :)
- Urias
From phoudoin at mail.berlios.de Sun Feb 15 22:56:29 2009
From: phoudoin at mail.berlios.de (phoudoin at mail.berlios.de)
Date: Sun, 15 Feb 2009 22:56:29 +0100
Subject: [Haiku-commits] r29228 -
haiku/trunk/src/system/boot/platform/bios_ia32
Message-ID: <200902152156.n1FLuTSG020517@sheep.berlios.de>
Author: phoudoin
Date: 2009-02-15 22:56:27 +0100 (Sun, 15 Feb 2009)
New Revision: 29228
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29228&view=rev
Modified:
haiku/trunk/src/system/boot/platform/bios_ia32/smp.cpp
Log:
Fixed broken style I've introduced.
Modified: haiku/trunk/src/system/boot/platform/bios_ia32/smp.cpp
===================================================================
--- haiku/trunk/src/system/boot/platform/bios_ia32/smp.cpp 2009-02-15 21:10:02 UTC (rev 29227)
+++ haiku/trunk/src/system/boot/platform/bios_ia32/smp.cpp 2009-02-15 21:56:27 UTC (rev 29228)
@@ -152,10 +152,10 @@
}
/* skip if the processor is not enabled. */
- if(!(processor->cpu_flags & 0x1)) {
+ if (!(processor->cpu_flags & 0x1)) {
TRACE(("smp: skip apic id %d: disabled\n", processor->apic_id));
continue;
- }
+ }
gKernelArgs.arch_args.cpu_apic_id[gKernelArgs.num_cpus] = processor->apic_id;
gKernelArgs.arch_args.cpu_os_id[processor->apic_id] = gKernelArgs.num_cpus;
From superstippi at gmx.de Sun Feb 15 23:40:53 2009
From: superstippi at gmx.de (Stephan Assmus)
Date: Sun, 15 Feb 2009 23:40:53 +0100
Subject: [Haiku-commits] r29221 - in haiku/trunk: headers/os/interface
src/apps/launchbox src/kits/interface src/kits/tracker
In-Reply-To: <1e80d8750902151340k7aefe82fp7672fffa3955772@mail.gmail.com>
References: <200902151823.n1FINTFg001250@sheep.berlios.de>
<894b9700902151316w147bda4bv538c857246ba113b@mail.gmail.com>
<1e80d8750902151340k7aefe82fp7672fffa3955772@mail.gmail.com>
Message-ID: <20090215234054.501.1@bepc.1234726482.fake>
Urias McCullough wrote:
> On Sun, Feb 15, 2009 at 1:16 PM, Stefano Ceccherini
> wrote:
> > 2009/2/15 stippi at BerliOS :
> >> Author: stippi
> >> Date: 2009-02-15 19:23:19 +0100 (Sun, 15 Feb 2009) New Revision: 29221
> >> ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29221&view=rev
> >>> Log:
> >> Implemented a new look for the Haiku interface controls. It was
> >> overheard that they looked too ninety-ish.
> >
> > Very nice! Both the look and the implementation.
> > The only thing I'd point out (besides the menufields "problem", already
> > pointed out by Rene) is you that unselected tabs look like they are all
> > joint. IOW: You can't immediately tell how many tabs are there.
> > Very nice work, though.
>
> I agree on the tabs - it seems like there should be some hint of
> distinction between the inactive tabs.
>
> Overall, the flatter look with tasteful application of gradients is nice
> though :)
Thanks for all the feedback so far! It's interesting how individual points
of critique are felt by multiple people, as with the inactive tabs
distinction. The higher contrast of the BMenuField popup marker was also
something Axel mentioned to me before. I will try to work on these things
some more. Also, I already mentioned a couple of TODO items in the commit
message with regard to the implementation. The code is really WIP, while I
felt that the look was already enough of an improvement and complete enough
to go ahead and commit the patch. (Besides, it was also getting a bit of a
pain to keep four Haiku trees on two different computers all in sync... ;-)
Best regards,
-Stephan
From aldeck at mail.berlios.de Mon Feb 16 11:39:26 2009
From: aldeck at mail.berlios.de (aldeck at BerliOS)
Date: Mon, 16 Feb 2009 11:39:26 +0100
Subject: [Haiku-commits] r29229 - haiku/trunk/src/kits/tracker
Message-ID: <200902161039.n1GAdQYo003937@sheep.berlios.de>
Author: aldeck
Date: 2009-02-16 11:39:26 +0100 (Mon, 16 Feb 2009)
New Revision: 29229
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29229&view=rev
Modified:
haiku/trunk/src/kits/tracker/PoseView.cpp
Log:
* Revert one the changes done in r29198 has it happen to be wrong. See #3450 and #3011
Modified: haiku/trunk/src/kits/tracker/PoseView.cpp
===================================================================
--- haiku/trunk/src/kits/tracker/PoseView.cpp 2009-02-15 21:56:27 UTC (rev 29228)
+++ haiku/trunk/src/kits/tracker/PoseView.cpp 2009-02-16 10:39:26 UTC (rev 29229)
@@ -1622,8 +1622,8 @@
float listViewScrollBy = 0;
for (int32 modelIndex = 0; modelIndex < count; modelIndex++) {
Model *model = models[modelIndex];
- ASSERT(!FindPose(model));
- if (FindZombie(model->NodeRef())) {
+
+ if (FindPose(model) || FindZombie(model->NodeRef())) {
// we already have this pose, don't add it
watch_node(model->NodeRef(), B_STOP_WATCHING, this);
delete model;
From philippe.houdoin at free.fr Mon Feb 16 11:14:00 2009
From: philippe.houdoin at free.fr (philippe.houdoin at free.fr)
Date: Mon, 16 Feb 2009 11:14:00 +0100 (CET)
Subject: [Haiku-commits] r29221 - in haiku/trunk: headers/os/interface
src/apps/launchbox src/kits/interface src/kits/tracker
In-Reply-To: <740686847.1952271234778981300.JavaMail.root@zimbra20-e3.priv.proxad.net>
Message-ID: <2040477519.1953501234779240390.JavaMail.root@zimbra20-e3.priv.proxad.net>
> Thanks for all the feedback so far! It's interesting how individual
> points of critique are felt by multiple people, as with the inactive
> tabs distinction. The higher contrast of the BMenuField popup marker
> was also something Axel mentioned to me before.
Here mine, many shared by others but, oh well:
1) Inactive tabs are not distinctable, but you know that one, don't you ;-)
2) Inactive tabs extending to a full width dark bar doesn't looks that fine, they're not headers but tabs, and if real world metaphor should applied, tabs don't extend full width. Having full width tabs in a OS cloning the "yellow tabs" BeOS sounds like blasphem, but maybe I'm going religious here :-)
3) Disabled unselected BCheck/RadioButtons looks less disabled than previous look, mostly due to the lighter grey color used to fill box/circle. Could be confusing for visual impaired people.
4) Enabled & selected BRadioButton looks to flat to me. I miss the "ball/LED" R5 effect which was a very distinctive BeOS widget from others GUIs. I hope one could still keep this quite unique visual identity while going to a flatter look...
5) BMenuField looks too much like a BButton, which can be confusing. But everybody told you so already ;-)
6) Drop shadow of the two kind of BSlider's thumbs are not consistent. I like the rectangular one better, but I can't tell from all widgets what's your choice regarding drop shadows, which could be a sign of inconsistency... or that I'm simply too picky/dumb/old/becoming blind.
7) BSlider bars and active BTab are rounded, when everything else moved from the R5 more rounded look to Haiku's sharper one. This seems inconsistent, and rounding looks dated these days.
8) BProgressBar, BGroupBox and BMenuBar are splendids!
I also noticed that some gradients are in fact only composed of two colors. It's very visible on scrollbars, and I'm not sure it's expected.
But, hey, GUI looks are like everything: it take times to get used to it, and then you can't lives without anymore!
Please take no offense with the above remarks, taste are very subjective topic, and everyone think he has good one.
> The code is really WIP, while I
> felt that the look was already enough of an improvement and complete
> enough to go ahead and commit the patch. (Besides, it was also getting
> a bit of a pain to keep four Haiku trees on two different computers
> all in sync... ;-)
Isn't what our subversion branches/... root is for?
;-)
Anyway, Stephan, like always, your graphic "touch" is well appreciated. I bet Haiku will have less audience without it: people loves screenshots, and your touch is on everyone but the oldests. ;-)
Regards,
Philippe, now daddy of 3.
From axeld at mail.berlios.de Mon Feb 16 12:03:16 2009
From: axeld at mail.berlios.de (axeld at mail.berlios.de)
Date: Mon, 16 Feb 2009 12:03:16 +0100
Subject: [Haiku-commits] r29230 - haiku/trunk/src/servers/net
Message-ID: <200902161103.n1GB3G1E006900@sheep.berlios.de>
Author: axeld
Date: 2009-02-16 12:03:13 +0100 (Mon, 16 Feb 2009)
New Revision: 29230
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29230&view=rev
Modified:
haiku/trunk/src/servers/net/AutoconfigLooper.cpp
haiku/trunk/src/servers/net/DHCPClient.cpp
haiku/trunk/src/servers/net/NetServer.cpp
Log:
* The auto-config looper now correctly sets the IFF_CONFIGURING flag - it
cannot be set in the AF_LINK level.
* It now also checks for this flag, so that the fallback configuration won't
overwrite a manually configured interface anymore.
* When an interface is configured, the IFF_CONFIGURING flag is now cleared as
it should.
Modified: haiku/trunk/src/servers/net/AutoconfigLooper.cpp
===================================================================
--- haiku/trunk/src/servers/net/AutoconfigLooper.cpp 2009-02-16 10:39:26 UTC (rev 29229)
+++ haiku/trunk/src/servers/net/AutoconfigLooper.cpp 2009-02-16 11:03:13 UTC (rev 29230)
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2008, Haiku, Inc. All Rights Reserved.
+ * Copyright 2006-2009, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
@@ -63,17 +63,15 @@
// set IFF_CONFIGURING flag on interface
- int socket = ::socket(AF_LINK, SOCK_DGRAM, 0);
+ int socket = ::socket(AF_INET, SOCK_DGRAM, 0);
if (socket < 0)
return;
if (ioctl(socket, SIOCGIFFLAGS, &request, sizeof(struct ifreq)) == 0) {
request.ifr_flags |= IFF_CONFIGURING;
- ioctl(socket, SIOCSIFFLAGS, &request, sizeof(struct ifreq));
+ ioctl(socket, SIOCSIFFLAGS, &request, sizeof(struct ifreq)));
}
- close(socket);
-
// remove current handler
_RemoveClient();
@@ -83,8 +81,10 @@
fCurrentClient = new DHCPClient(fTarget, fDevice.String());
AddHandler(fCurrentClient);
- if (fCurrentClient->Initialize() == B_OK)
+ if (fCurrentClient->Initialize() == B_OK) {
+ close(socket);
return;
+ }
_RemoveClient();
@@ -94,6 +94,15 @@
// TODO: have a look at zeroconf
// TODO: this could also be done add-on based
+ if (ioctl(socket, SIOCGIFFLAGS, &request, sizeof(struct ifreq)) == 0
+ && (request.ifr_flags & IFF_CONFIGURING) == 0) {
+ // Someone else configured the interface in the mean time
+ close(socket);
+ return;
+ }
+
+ close(socket);
+
BMessage interface(kMsgConfigureInterface);
interface.AddString("device", fDevice.String());
interface.AddBool("auto", true);
Modified: haiku/trunk/src/servers/net/DHCPClient.cpp
===================================================================
--- haiku/trunk/src/servers/net/DHCPClient.cpp 2009-02-16 10:39:26 UTC (rev 29229)
+++ haiku/trunk/src/servers/net/DHCPClient.cpp 2009-02-16 11:03:13 UTC (rev 29230)
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2008, Haiku, Inc. All Rights Reserved.
+ * Copyright 2006-2009, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
@@ -788,7 +788,8 @@
status_t
-DHCPClient::_SendMessage(int socket, dhcp_message& message, sockaddr_in& address) const
+DHCPClient::_SendMessage(int socket, dhcp_message& message,
+ sockaddr_in& address) const
{
ssize_t bytesSent = sendto(socket, &message, message.Size(),
address.sin_addr.s_addr == INADDR_BROADCAST ? MSG_BCAST : 0,
Modified: haiku/trunk/src/servers/net/NetServer.cpp
===================================================================
--- haiku/trunk/src/servers/net/NetServer.cpp 2009-02-16 10:39:26 UTC (rev 29229)
+++ haiku/trunk/src/servers/net/NetServer.cpp 2009-02-16 11:03:13 UTC (rev 29230)
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2008, Haiku, Inc. All Rights Reserved.
+ * Copyright 2006-2009, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
@@ -660,7 +660,7 @@
// set flags
if (flags != 0) {
- request.ifr_flags = currentFlags | flags;
+ request.ifr_flags = (currentFlags & ~IFF_CONFIGURING) | flags;
if (ioctl(familySocket, SIOCSIFFLAGS, &request, sizeof(struct ifreq)) < 0)
fprintf(stderr, "%s: Setting flags failed: %s\n", Name(), strerror(errno));
}
From axeld at mail.berlios.de Mon Feb 16 12:05:33 2009
From: axeld at mail.berlios.de (axeld at mail.berlios.de)
Date: Mon, 16 Feb 2009 12:05:33 +0100
Subject: [Haiku-commits] r29231 -
haiku/trunk/src/add-ons/kernel/network/stack
Message-ID: <200902161105.n1GB5X8Q007142@sheep.berlios.de>
Author: axeld
Date: 2009-02-16 12:05:25 +0100 (Mon, 16 Feb 2009)
New Revision: 29231
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29231&view=rev
Modified:
haiku/trunk/src/add-ons/kernel/network/stack/link.cpp
Log:
* You can now use SIOCGIFFLAGS on the AF_LINK level as well.
* Cleanup.
Modified: haiku/trunk/src/add-ons/kernel/network/stack/link.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/network/stack/link.cpp 2009-02-16 11:03:13 UTC (rev 29230)
+++ haiku/trunk/src/add-ons/kernel/network/stack/link.cpp 2009-02-16 11:05:25 UTC (rev 29231)
@@ -1,12 +1,12 @@
/*
- * Copyright 2006-2008, Haiku, Inc. All Rights Reserved.
+ * Copyright 2006-2009, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Axel D?rfler, axeld at pinc-software.de
*/
-//! The net_protocol you talk to when using the AF_LINK protocol
+//! The net_protocol one talks to when using the AF_LINK protocol
#include "datalink.h"
#include "domains.h"
@@ -32,37 +32,37 @@
class LocalStackBundle {
public:
- static net_stack_module_info *Stack() { return &gNetStackModule; }
- static net_buffer_module_info *Buffer() { return &gNetBufferModule; }
+ static net_stack_module_info* Stack() { return &gNetStackModule; }
+ static net_buffer_module_info* Buffer() { return &gNetBufferModule; }
};
typedef DatagramSocket LocalDatagramSocket;
class LinkProtocol : public net_protocol, public LocalDatagramSocket {
public:
- LinkProtocol(net_socket *socket);
+ LinkProtocol(net_socket* socket);
~LinkProtocol();
- status_t StartMonitoring(const char *);
+ status_t StartMonitoring(const char* deviceName);
status_t StopMonitoring();
private:
status_t _SocketStatus() const;
status_t _Unregister();
- net_device_monitor fMonitor;
- net_device_interface *fMonitoredDevice;
+ static status_t _MonitorData(net_device_monitor* monitor,
+ net_buffer* buffer);
+ static void _MonitorEvent(net_device_monitor* monitor, int32 event);
- static status_t _MonitorData(net_device_monitor *monitor,
- net_buffer *buffer);
- static void _MonitorEvent(net_device_monitor *monitor, int32 event);
+ net_device_monitor fMonitor;
+ net_device_interface* fMonitoredDevice;
};
-struct net_domain *sDomain;
+struct net_domain* sDomain;
-LinkProtocol::LinkProtocol(net_socket *socket)
+LinkProtocol::LinkProtocol(net_socket* socket)
: LocalDatagramSocket("packet capture", socket)
{
fMonitor.cookie = this;
@@ -82,14 +82,14 @@
status_t
-LinkProtocol::StartMonitoring(const char *deviceName)
+LinkProtocol::StartMonitoring(const char* deviceName)
{
MutexLocker _(fLock);
if (fMonitoredDevice)
return B_BUSY;
- net_device_interface *interface = get_device_interface(deviceName);
+ net_device_interface* interface = get_device_interface(deviceName);
if (interface == NULL)
return ENODEV;
@@ -138,16 +138,16 @@
status_t
-LinkProtocol::_MonitorData(net_device_monitor *monitor, net_buffer *packet)
+LinkProtocol::_MonitorData(net_device_monitor* monitor, net_buffer* packet)
{
- return ((LinkProtocol *)monitor->cookie)->SocketEnqueue(packet);
+ return ((LinkProtocol*)monitor->cookie)->SocketEnqueue(packet);
}
void
-LinkProtocol::_MonitorEvent(net_device_monitor *monitor, int32 event)
+LinkProtocol::_MonitorEvent(net_device_monitor* monitor, int32 event)
{
- LinkProtocol *protocol = (LinkProtocol *)monitor->cookie;
+ LinkProtocol* protocol = (LinkProtocol*)monitor->cookie;
if (event == B_DEVICE_GOING_DOWN) {
MutexLocker _(protocol->fLock);
@@ -164,11 +164,26 @@
// #pragma mark -
-net_protocol *
-link_init_protocol(net_socket *socket)
+static bool
+user_request_get_device_interface(void* value, struct ifreq& request,
+ net_device_interface*& interface)
{
- LinkProtocol *protocol = new (std::nothrow) LinkProtocol(socket);
- if (protocol && protocol->InitCheck() < B_OK) {
+ if (user_memcpy(&request, value, IF_NAMESIZE) < B_OK)
+ return false;
+
+ interface = get_device_interface(request.ifr_name);
+ return true;
+}
+
+
+// #pragma mark -
+
+
+net_protocol*
+link_init_protocol(net_socket* socket)
+{
+ LinkProtocol* protocol = new (std::nothrow) LinkProtocol(socket);
+ if (protocol != NULL && protocol->InitCheck() < B_OK) {
delete protocol;
return NULL;
}
@@ -178,64 +193,63 @@
status_t
-link_uninit_protocol(net_protocol *protocol)
+link_uninit_protocol(net_protocol* protocol)
{
- delete (LinkProtocol *)protocol;
+ delete (LinkProtocol*)protocol;
return B_OK;
}
status_t
-link_open(net_protocol *protocol)
+link_open(net_protocol* protocol)
{
return B_OK;
}
status_t
-link_close(net_protocol *protocol)
+link_close(net_protocol* protocol)
{
return B_OK;
}
status_t
-link_free(net_protocol *protocol)
+link_free(net_protocol* protocol)
{
return B_OK;
}
status_t
-link_connect(net_protocol *protocol, const struct sockaddr *address)
+link_connect(net_protocol* protocol, const struct sockaddr* address)
{
return EOPNOTSUPP;
}
status_t
-link_accept(net_protocol *protocol, struct net_socket **_acceptedSocket)
+link_accept(net_protocol* protocol, struct net_socket** _acceptedSocket)
{
return EOPNOTSUPP;
}
status_t
-link_control(net_protocol *_protocol, int level, int option, void *value,
- size_t *_length)
+link_control(net_protocol* _protocol, int level, int option, void* value,
+ size_t* _length)
{
- LinkProtocol *protocol = (LinkProtocol *)_protocol;
+ LinkProtocol* protocol = (LinkProtocol*)_protocol;
switch (option) {
case SIOCGIFINDEX:
{
// get index of interface
+ net_device_interface* interface;
struct ifreq request;
- if (user_memcpy(&request, value, IF_NAMESIZE) < B_OK)
+ if (!user_request_get_device_interface(value, request, interface))
return B_BAD_ADDRESS;
- net_device_interface *interface
- = get_device_interface(request.ifr_name);
if (interface != NULL) {
request.ifr_index = interface->device->index;
put_device_interface(interface);
@@ -251,14 +265,14 @@
if (user_memcpy(&request, value, sizeof(struct ifreq)) < B_OK)
return B_BAD_ADDRESS;
- net_device_interface *interface
+ net_device_interface* interface
= get_device_interface(request.ifr_index);
- if (interface != NULL) {
- strlcpy(request.ifr_name, interface->device->name, IF_NAMESIZE);
- put_device_interface(interface);
- } else
+ if (interface == NULL)
return ENODEV;
+ strlcpy(request.ifr_name, interface->device->name, IF_NAMESIZE);
+ put_device_interface(interface);
+
return user_memcpy(value, &request, sizeof(struct ifreq));
}
@@ -279,7 +293,7 @@
return B_BAD_ADDRESS;
status_t result = list_device_interfaces(config.ifc_buf,
- (size_t *)&config.ifc_len);
+ (size_t*)&config.ifc_len);
if (result != B_OK)
return result;
@@ -289,22 +303,39 @@
case SIOCGIFADDR:
{
// get address of interface
+ net_device_interface* interface;
struct ifreq request;
- if (user_memcpy(&request, value, IF_NAMESIZE) < B_OK)
+ if (!user_request_get_device_interface(value, request, interface))
return B_BAD_ADDRESS;
- net_device_interface *interface
- = get_device_interface(request.ifr_name);
- if (interface != NULL) {
- get_device_interface_address(interface, &request.ifr_addr);
- put_device_interface(interface);
- } else
+ if (interface == NULL)
return ENODEV;
- return user_memcpy(&((struct ifreq *)value)->ifr_addr,
+ get_device_interface_address(interface, &request.ifr_addr);
+ put_device_interface(interface);
+
+ return user_memcpy(&((struct ifreq*)value)->ifr_addr,
&request.ifr_addr, request.ifr_addr.sa_len);
}
+ case SIOCGIFFLAGS:
+ {
+ // get flags of interface
+ net_device_interface* interface;
+ struct ifreq request;
+ if (!user_request_get_device_interface(value, request, interface))
+ return B_BAD_ADDRESS;
+
+ if (interface == NULL)
+ return ENODEV;
+
+ request.ifr_flags = interface->device->flags;
+ put_device_interface(interface);
+
+ return user_memcpy(&((struct ifreq*)value)->ifr_flags,
+ &request.ifr_flags, sizeof(request.ifr_flags));
+ }
+
case SIOCSPACKETCAP:
{
struct ifreq request;
@@ -323,8 +354,8 @@
status_t
-link_getsockopt(net_protocol *protocol, int level, int option, void *value,
- int *length)
+link_getsockopt(net_protocol* protocol, int level, int option, void* value,
+ int* length)
{
if (protocol->next != NULL) {
return protocol->next->module->getsockopt(protocol, level, option,
@@ -337,8 +368,8 @@
status_t
-link_setsockopt(net_protocol *protocol, int level, int option,
- const void *value, int length)
+link_setsockopt(net_protocol* protocol, int level, int option,
+ const void* value, int length)
{
if (protocol->next != NULL) {
return protocol->next->module->setsockopt(protocol, level, option,
@@ -351,7 +382,7 @@
status_t
-link_bind(net_protocol *protocol, const struct sockaddr *address)
+link_bind(net_protocol* protocol, const struct sockaddr* address)
{
// TODO: bind to a specific interface and ethernet type
return B_ERROR;
@@ -359,72 +390,72 @@
status_t
-link_unbind(net_protocol *protocol, struct sockaddr *address)
+link_unbind(net_protocol* protocol, struct sockaddr* address)
{
return B_ERROR;
}
status_t
-link_listen(net_protocol *protocol, int count)
+link_listen(net_protocol* protocol, int count)
{
return EOPNOTSUPP;
}
status_t
-link_shutdown(net_protocol *protocol, int direction)
+link_shutdown(net_protocol* protocol, int direction)
{
return EOPNOTSUPP;
}
status_t
-link_send_data(net_protocol *protocol, net_buffer *buffer)
+link_send_data(net_protocol* protocol, net_buffer* buffer)
{
return B_NOT_ALLOWED;
}
status_t
-link_send_routed_data(net_protocol *protocol, struct net_route *route,
- net_buffer *buffer)
+link_send_routed_data(net_protocol* protocol, struct net_route* route,
+ net_buffer* buffer)
{
return B_NOT_ALLOWED;
}
ssize_t
-link_send_avail(net_protocol *protocol)
+link_send_avail(net_protocol* protocol)
{
return B_ERROR;
}
status_t
-link_read_data(net_protocol *protocol, size_t numBytes, uint32 flags,
- net_buffer **_buffer)
+link_read_data(net_protocol* protocol, size_t numBytes, uint32 flags,
+ net_buffer** _buffer)
{
- return ((LinkProtocol *)protocol)->SocketDequeue(flags, _buffer);
+ return ((LinkProtocol*)protocol)->SocketDequeue(flags, _buffer);
}
ssize_t
-link_read_avail(net_protocol *protocol)
+link_read_avail(net_protocol* protocol)
{
- return ((LinkProtocol *)protocol)->AvailableData();
+ return ((LinkProtocol*)protocol)->AvailableData();
}
-struct net_domain *
-link_get_domain(net_protocol *protocol)
+struct net_domain*
+link_get_domain(net_protocol* protocol)
{
return sDomain;
}
size_t
-link_get_mtu(net_protocol *protocol, const struct sockaddr *address)
+link_get_mtu(net_protocol* protocol, const struct sockaddr* address)
{
// TODO: for now
return 0;
@@ -432,22 +463,22 @@
status_t
-link_receive_data(net_buffer *buffer)
+link_receive_data(net_buffer* buffer)
{
return B_ERROR;
}
status_t
-link_error(uint32 code, net_buffer *data)
+link_error(uint32 code, net_buffer* data)
{
return B_ERROR;
}
status_t
-link_error_reply(net_protocol *protocol, net_buffer *causedError, uint32 code,
- void *errorData)
+link_error_reply(net_protocol* protocol, net_buffer* causedError, uint32 code,
+ void* errorData)
{
return B_ERROR;
}
From axeld at mail.berlios.de Mon Feb 16 12:13:30 2009
From: axeld at mail.berlios.de (axeld at mail.berlios.de)
Date: Mon, 16 Feb 2009 12:13:30 +0100
Subject: [Haiku-commits] r29232 -
haiku/trunk/src/add-ons/kernel/network/stack
Message-ID: <200902161113.n1GBDUNF007760@sheep.berlios.de>
Author: axeld
Date: 2009-02-16 12:13:28 +0100 (Mon, 16 Feb 2009)
New Revision: 29232
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29232&view=rev
Modified:
haiku/trunk/src/add-ons/kernel/network/stack/datalink.cpp
haiku/trunk/src/add-ons/kernel/network/stack/domains.cpp
haiku/trunk/src/add-ons/kernel/network/stack/interfaces.cpp
haiku/trunk/src/add-ons/kernel/network/stack/interfaces.h
Log:
* Renamed net_device_interface::rx_lock to receive_lock.
* Cleanup, improved comments, removed useless ones.
Modified: haiku/trunk/src/add-ons/kernel/network/stack/datalink.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/network/stack/datalink.cpp 2009-02-16 11:05:25 UTC (rev 29231)
+++ haiku/trunk/src/add-ons/kernel/network/stack/datalink.cpp 2009-02-16 11:13:28 UTC (rev 29232)
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2008, Haiku, Inc. All Rights Reserved.
+ * Copyright 2006-2009, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
@@ -31,28 +31,28 @@
struct datalink_protocol : net_protocol {
- struct net_domain_private *domain;
+ struct net_domain_private* domain;
};
struct interface_protocol : net_datalink_protocol {
- struct net_device_module_info *device_module;
- struct net_device *device;
+ struct net_device_module_info* device_module;
+ struct net_device* device;
};
static status_t
-device_reader_thread(void *_interface)
+device_reader_thread(void* _interface)
{
- net_device_interface *interface = (net_device_interface *)_interface;
- net_device *device = interface->device;
+ net_device_interface* interface = (net_device_interface*)_interface;
+ net_device* device = interface->device;
status_t status = B_OK;
- RecursiveLocker locker(interface->rx_lock);
+ RecursiveLocker locker(interface->receive_lock);
- while (device->flags & IFF_UP) {
+ while ((device->flags & IFF_UP) != 0) {
locker.Unlock();
- net_buffer *buffer;
+ net_buffer* buffer;
status = device->module->receive_data(device, &buffer);
locker.Lock();
@@ -61,8 +61,7 @@
// feed device monitors
DeviceMonitorList::Iterator iterator =
interface->monitor_funcs.GetIterator();
- while (iterator.HasNext()) {
- net_device_monitor *monitor = iterator.Next();
+ while (net_device_monitor* monitor = iterator.Next()) {
monitor->receive(monitor, buffer);
}
@@ -76,26 +75,17 @@
fifo_enqueue_buffer(&interface->receive_queue, buffer);
} else {
// In case of error, give the other threads some
- // time to run since this is a near real time thread.
- //
- // TODO: can this value be lower? 1000 works fine in
- // my system. 10ms seems a bit too much and adds
- // as latency.
+ // time to run since this is a high priority time thread.
snooze(10000);
}
-
- // if the interface went down IFF_UP was removed
- // and the receive_data() above should have been
- // interrupted. One check should be enough, specially
- // considering the snooze above.
}
return status;
}
-static struct sockaddr **
-interface_address(net_interface *interface, int32 option)
+static struct sockaddr**
+interface_address(net_interface* interface, int32 option)
{
switch (option) {
case SIOCSIFADDR:
@@ -118,8 +108,8 @@
}
-void
-remove_default_routes(net_interface_private *interface, int32 option)
+static void
+remove_default_routes(net_interface_private* interface, int32 option)
{
net_route route;
route.destination = interface->address;
@@ -141,8 +131,8 @@
}
-void
-add_default_routes(net_interface_private *interface, int32 option)
+static void
+add_default_routes(net_interface_private* interface, int32 option)
{
net_route route;
route.destination = interface->address;
@@ -164,16 +154,16 @@
}
-sockaddr *
-reallocate_address(sockaddr **_address, uint32 size)
+static sockaddr*
+reallocate_address(sockaddr** _address, uint32 size)
{
- sockaddr *address = *_address;
+ sockaddr* address = *_address;
size = max_c(size, sizeof(struct sockaddr));
if (address != NULL && address->sa_len >= size)
return address;
- address = (sockaddr *)malloc(size);
+ address = (sockaddr*)malloc(size);
if (address == NULL)
return NULL;
@@ -185,8 +175,8 @@
static status_t
-datalink_control_interface(net_domain_private *domain, int32 option,
- void *value, size_t *_length, size_t expected, bool getByName)
+datalink_control_interface(net_domain_private* domain, int32 option,
+ void* value, size_t* _length, size_t expected, bool getByName)
{
if (*_length < expected)
return B_BAD_VALUE;
@@ -198,14 +188,14 @@
return B_BAD_ADDRESS;
MutexLocker _(domain->lock);
- net_interface *interface = NULL;
+ net_interface* interface = NULL;
if (getByName)
interface = find_interface(domain, request.ifr_name);
else
interface = find_interface(domain, request.ifr_index);
- status_t status = (interface == NULL) ? ENODEV : B_OK;
+ status_t status = interface == NULL ? ENODEV : B_OK;
switch (option) {
case SIOCGIFINDEX:
@@ -234,10 +224,10 @@
status_t
-datalink_control(net_domain *_domain, int32 option, void *value,
- size_t *_length)
+datalink_control(net_domain* _domain, int32 option, void* value,
+ size_t* _length)
{
- net_domain_private *domain = (net_domain_private *)_domain;
+ net_domain_private* domain = (net_domain_private*)_domain;
if (domain == NULL || domain->family == AF_LINK) {
// the AF_LINK family is already handled completely in the link protocol
return B_BAD_VALUE;
@@ -288,7 +278,7 @@
return B_BAD_ADDRESS;
status_t result = list_domain_interfaces(config.ifc_buf,
- (size_t *)&config.ifc_len);
+ (size_t*)&config.ifc_len);
if (result != B_OK)
return result;
@@ -324,7 +314,7 @@
MutexLocker _(domain->lock);
- net_interface *interface = find_interface(domain,
+ net_interface* interface = find_interface(domain,
request.ifr_name);
if (interface == NULL)
return B_BAD_VALUE;
@@ -339,10 +329,10 @@
status_t
-datalink_send_data(struct net_route *route, net_buffer *buffer)
+datalink_send_data(struct net_route* route, net_buffer* buffer)
{
- net_interface_private *interface =
- (net_interface_private *)route->interface;
+ net_interface_private* interface =
+ (net_interface_private*)route->interface;
//dprintf("send buffer (%ld bytes) to interface %s (route flags %lx)\n",
// buffer->size, interface->name, route->flags);
@@ -373,19 +363,19 @@
status_t
-datalink_send_datagram(net_protocol *protocol, net_domain *domain,
- net_buffer *buffer)
+datalink_send_datagram(net_protocol* protocol, net_domain* domain,
+ net_buffer* buffer)
{
if (protocol == NULL && domain == NULL)
return B_BAD_VALUE;
- net_protocol_module_info *module = protocol ? protocol->module
+ net_protocol_module_info* module = protocol ? protocol->module
: domain->module;
if (domain == NULL)
domain = protocol->module->get_domain(protocol);
- net_route *route = NULL;
+ net_route* route = NULL;
status_t status;
if (protocol != NULL && protocol->socket->bound_to_device > 0) {
status = get_device_route(domain, protocol->socket->bound_to_device,
@@ -408,21 +398,21 @@
\param _matchedType will be set to either zero or MSG_BCAST if non-NULL.
*/
bool
-datalink_is_local_address(net_domain *_domain, const struct sockaddr *address,
- net_interface **_interface, uint32 *_matchedType)
+datalink_is_local_address(net_domain* _domain, const struct sockaddr* address,
+ net_interface** _interface, uint32* _matchedType)
{
- net_domain_private *domain = (net_domain_private *)_domain;
+ net_domain_private* domain = (net_domain_private*)_domain;
if (domain == NULL || address == NULL)
return false;
MutexLocker locker(domain->lock);
- net_interface *interface = NULL;
- net_interface *fallback = NULL;
+ net_interface* interface = NULL;
+ net_interface* fallback = NULL;
uint32 matchedType = 0;
while (true) {
- interface = (net_interface *)list_get_next_item(
+ interface = (net_interface*)list_get_next_item(
&domain->interfaces, interface);
if (interface == NULL)
break;
@@ -460,20 +450,20 @@
}
-net_interface *
-datalink_get_interface_with_address(net_domain *_domain,
- const sockaddr *address)
+net_interface*
+datalink_get_interface_with_address(net_domain* _domain,
+ const sockaddr* address)
{
- net_domain_private *domain = (net_domain_private *)_domain;
+ net_domain_private* domain = (net_domain_private*)_domain;
if (domain == NULL)
return NULL;
MutexLocker _(domain->lock);
- net_interface *interface = NULL;
+ net_interface* interface = NULL;
while (true) {
- interface = (net_interface *)list_get_next_item(
+ interface = (net_interface*)list_get_next_item(
&domain->interfaces, interface);
if (interface == NULL)
break;
@@ -490,8 +480,8 @@
}
-net_interface *
-datalink_get_interface(net_domain *domain, uint32 index)
+net_interface*
+datalink_get_interface(net_domain* domain, uint32 index)
{
if (index == 0)
return datalink_get_interface_with_address(domain, NULL);
@@ -518,12 +508,12 @@
status_t
-interface_protocol_init(struct net_interface *_interface,
- net_datalink_protocol **_protocol)
+interface_protocol_init(struct net_interface* _interface,
+ net_datalink_protocol** _protocol)
{
- net_interface_private *interface = (net_interface_private *)_interface;
+ net_interface_private* interface = (net_interface_private*)_interface;
- interface_protocol *protocol = new (std::nothrow) interface_protocol;
+ interface_protocol* protocol = new (std::nothrow) interface_protocol;
if (protocol == NULL)
return B_NO_MEMORY;
@@ -536,7 +526,7 @@
status_t
-interface_protocol_uninit(net_datalink_protocol *protocol)
+interface_protocol_uninit(net_datalink_protocol* protocol)
{
delete protocol;
return B_OK;
@@ -544,12 +534,12 @@
status_t
-interface_protocol_send_data(net_datalink_protocol *_protocol,
- net_buffer *buffer)
+interface_protocol_send_data(net_datalink_protocol* _protocol,
+ net_buffer* buffer)
{
- interface_protocol *protocol = (interface_protocol *)_protocol;
- net_interface_private *interface
- = (net_interface_private *)protocol->interface;
+ interface_protocol* protocol = (interface_protocol*)_protocol;
+ net_interface_private* interface
+ = (net_interface_private*)protocol->interface;
// TODO: Need to think about this locking. We can't obtain the
// RX Lock here (nor would it make sense) as the ARP
@@ -560,7 +550,7 @@
DeviceMonitorList::Iterator iterator =
interface->device_interface->monitor_funcs.GetIterator();
while (iterator.HasNext()) {
- net_device_monitor *monitor = iterator.Next();
+ net_device_monitor* monitor = iterator.Next();
monitor->receive(monitor, buffer);
}
@@ -569,12 +559,12 @@
status_t
-interface_protocol_up(net_datalink_protocol *_protocol)
+interface_protocol_up(net_datalink_protocol* _protocol)
{
- interface_protocol *protocol = (interface_protocol *)_protocol;
- net_device_interface *deviceInterface =
- ((net_interface_private *)protocol->interface)->device_interface;
- net_device *device = protocol->device;
+ interface_protocol* protocol = (interface_protocol*)_protocol;
+ net_device_interface* deviceInterface =
+ ((net_interface_private*)protocol->interface)->device_interface;
+ net_device* device = protocol->device;
// This function is called with the RX lock held.
@@ -610,11 +600,11 @@
void
-interface_protocol_down(net_datalink_protocol *_protocol)
+interface_protocol_down(net_datalink_protocol* _protocol)
{
- interface_protocol *protocol = (interface_protocol *)_protocol;
- net_device_interface *deviceInterface =
- ((net_interface_private *)protocol->interface)->device_interface;
+ interface_protocol* protocol = (interface_protocol*)_protocol;
+ net_device_interface* deviceInterface =
+ ((net_interface_private*)protocol->interface)->device_interface;
// This function is called with the RX lock held.
if (deviceInterface->up_count == 0)
@@ -632,11 +622,12 @@
status_t
-interface_protocol_control(net_datalink_protocol *_protocol,
- int32 option, void *argument, size_t length)
+interface_protocol_control(net_datalink_protocol* _protocol, int32 option,
+ void* argument, size_t length)
{
- interface_protocol *protocol = (interface_protocol *)_protocol;
- net_interface_private *interface = (net_interface_private *)protocol->interface;
+ interface_protocol* protocol = (interface_protocol*)_protocol;
+ net_interface_private* interface
+ = (net_interface_private*)protocol->interface;
switch (option) {
case SIOCSIFADDR:
@@ -649,12 +640,12 @@
if (user_memcpy(&request, argument, sizeof(struct ifreq)) < B_OK)
return B_BAD_ADDRESS;
- sockaddr **_address = interface_address(interface, option);
+ sockaddr** _address = interface_address(interface, option);
if (_address == NULL)
return B_BAD_VALUE;
// allocate new address if needed
- sockaddr *address = reallocate_address(_address,
+ sockaddr* address = reallocate_address(_address,
request.ifr_addr.sa_len);
// copy new address over
@@ -664,15 +655,15 @@
if (option == SIOCSIFADDR || option == SIOCSIFNETMASK) {
// reset netmask and broadcast addresses to defaults
- sockaddr *netmask = NULL;
- sockaddr *oldNetmask = NULL;
+ sockaddr* netmask = NULL;
+ sockaddr* oldNetmask = NULL;
if (option == SIOCSIFADDR) {
netmask = reallocate_address(&interface->mask,
request.ifr_addr.sa_len);
} else
oldNetmask = address;
- sockaddr *broadcast = reallocate_address(
+ sockaddr* broadcast = reallocate_address(
&interface->destination, request.ifr_addr.sa_len);
interface->domain->address_module->set_to_defaults(
@@ -691,13 +682,13 @@
case SIOCGIFDSTADDR:
{
// get logical interface address
- sockaddr **_address = interface_address(interface, option);
+ sockaddr** _address = interface_address(interface, option);
if (_address == NULL)
return B_BAD_VALUE;
struct ifreq request;
- sockaddr *address = *_address;
+ sockaddr* address = *_address;
if (address != NULL)
memcpy(&request.ifr_addr, address, address->sa_len);
else {
@@ -706,7 +697,7 @@
}
// copy address over
- return user_memcpy(&((struct ifreq *)argument)->ifr_addr,
+ return user_memcpy(&((struct ifreq*)argument)->ifr_addr,
&request.ifr_addr, request.ifr_addr.sa_len);
}
@@ -716,7 +707,7 @@
struct ifreq request;
request.ifr_flags = interface->flags | interface->device->flags;
- return user_memcpy(&((struct ifreq *)argument)->ifr_flags,
+ return user_memcpy(&((struct ifreq*)argument)->ifr_flags,
&request.ifr_flags, sizeof(request.ifr_flags));
}
@@ -730,14 +721,14 @@
request.ifr_parameter.sub_type = 0;
// TODO: for now, we ignore the sub type...
- return user_memcpy(&((struct ifreq *)argument)->ifr_parameter,
+ return user_memcpy(&((struct ifreq*)argument)->ifr_parameter,
&request.ifr_parameter, sizeof(request.ifr_parameter));
}
case SIOCGIFSTATS:
{
// get stats
- return user_memcpy(&((struct ifreq *)argument)->ifr_stats,
+ return user_memcpy(&((struct ifreq*)argument)->ifr_stats,
&interface->device_interface->device->stats,
sizeof(struct ifreq_stats));
}
@@ -748,7 +739,7 @@
struct ifreq request;
request.ifr_type = interface->type;
- return user_memcpy(&((struct ifreq *)argument)->ifr_type,
+ return user_memcpy(&((struct ifreq*)argument)->ifr_type,
&request.ifr_type, sizeof(request.ifr_type));
}
@@ -758,7 +749,7 @@
struct ifreq request;
request.ifr_mtu = interface->mtu;
- return user_memcpy(&((struct ifreq *)argument)->ifr_mtu,
+ return user_memcpy(&((struct ifreq*)argument)->ifr_mtu,
&request.ifr_mtu, sizeof(request.ifr_mtu));
}
case SIOCSIFMTU:
@@ -793,7 +784,7 @@
struct ifreq request;
request.ifr_media = interface->device->media;
- return user_memcpy(&((struct ifreq *)argument)->ifr_media,
+ return user_memcpy(&((struct ifreq*)argument)->ifr_media,
&request.ifr_media, sizeof(request.ifr_media));
}
@@ -803,7 +794,7 @@
struct ifreq request;
request.ifr_metric = interface->metric;
- return user_memcpy(&((struct ifreq *)argument)->ifr_metric,
+ return user_memcpy(&((struct ifreq*)argument)->ifr_metric,
&request.ifr_metric, sizeof(request.ifr_metric));
}
case SIOCSIFMETRIC:
@@ -829,20 +820,20 @@
static status_t
-interface_protocol_join_multicast(net_datalink_protocol *_protocol,
- const sockaddr *address)
+interface_protocol_join_multicast(net_datalink_protocol* _protocol,
+ const sockaddr* address)
{
- interface_protocol *protocol = (interface_protocol *)_protocol;
+ interface_protocol* protocol = (interface_protocol*)_protocol;
return protocol->device_module->add_multicast(protocol->device, address);
}
static status_t
-interface_protocol_leave_multicast(net_datalink_protocol *_protocol,
- const sockaddr *address)
+interface_protocol_leave_multicast(net_datalink_protocol* _protocol,
+ const sockaddr* address)
{
- interface_protocol *protocol = (interface_protocol *)_protocol;
+ interface_protocol* protocol = (interface_protocol*)_protocol;
return protocol->device_module->remove_multicast(protocol->device,
address);
Modified: haiku/trunk/src/add-ons/kernel/network/stack/domains.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/network/stack/domains.cpp 2009-02-16 11:05:25 UTC (rev 29231)
+++ haiku/trunk/src/add-ons/kernel/network/stack/domains.cpp 2009-02-16 11:13:28 UTC (rev 29232)
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2008, Haiku, Inc. All Rights Reserved.
+ * Copyright 2006-2009, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
@@ -40,12 +40,12 @@
Scans the domain list for the specified family.
You need to hold the sDomainLock when calling this function.
*/
-static net_domain_private *
+static net_domain_private*
lookup_domain(int family)
{
- net_domain_private *domain = NULL;
+ net_domain_private* domain = NULL;
while (true) {
- domain = (net_domain_private *)list_get_next_item(&sDomains, domain);
+ domain = (net_domain_private*)list_get_next_item(&sDomains, domain);
if (domain == NULL)
break;
@@ -63,7 +63,7 @@
/*!
Gets the domain of the specified family.
*/
-net_domain *
+net_domain*
get_domain(int family)
{
MutexLocker locker(sDomainLock);
@@ -76,17 +76,17 @@
{
MutexLocker locker(sDomainLock);
- net_domain_private *domain = NULL;
+ net_domain_private* domain = NULL;
uint32 count = 0;
while (true) {
- domain = (net_domain_private *)list_get_next_item(&sDomains, domain);
+ domain = (net_domain_private*)list_get_next_item(&sDomains, domain);
if (domain == NULL)
break;
- net_interface *interface = NULL;
+ net_interface* interface = NULL;
while (true) {
- interface = (net_interface *)list_get_next_item(&domain->interfaces,
+ interface = (net_interface*)list_get_next_item(&domain->interfaces,
interface);
if (interface == NULL)
break;
@@ -105,23 +105,23 @@
returned.
*/
status_t
-list_domain_interfaces(void *_buffer, size_t *bufferSize)
+list_domain_interfaces(void* _buffer, size_t* bufferSize)
{
MutexLocker locker(sDomainLock);
UserBuffer buffer(_buffer, *bufferSize);
- net_domain_private *domain = NULL;
+ net_domain_private* domain = NULL;
while (true) {
- domain = (net_domain_private *)list_get_next_item(&sDomains, domain);
+ domain = (net_domain_private*)list_get_next_item(&sDomains, domain);
if (domain == NULL)
break;
MutexLocker locker(domain->lock);
- net_interface *interface = NULL;
+ net_interface* interface = NULL;
while (true) {
- interface = (net_interface *)list_get_next_item(&domain->interfaces,
+ interface = (net_interface*)list_get_next_item(&domain->interfaces,
interface);
if (interface == NULL)
break;
@@ -149,23 +149,23 @@
status_t
-add_interface_to_domain(net_domain *_domain,
+add_interface_to_domain(net_domain* _domain,
struct ifreq& request)
{
- net_domain_private *domain = (net_domain_private *)_domain;
+ net_domain_private* domain = (net_domain_private*)_domain;
- const char *deviceName = request.ifr_parameter.device[0]
+ const char* deviceName = request.ifr_parameter.device[0]
? request.ifr_parameter.device : request.ifr_name;
- const char *baseName = request.ifr_parameter.base_name[0]
+ const char* baseName = request.ifr_parameter.base_name[0]
? request.ifr_parameter.base_name : request.ifr_name;
- net_device_interface *deviceInterface = get_device_interface(deviceName);
+ net_device_interface* deviceInterface = get_device_interface(deviceName);
if (deviceInterface == NULL)
return ENODEV;
MutexLocker locker(domain->lock);
- net_interface_private *interface = NULL;
+ net_interface_private* interface = NULL;
status_t status;
if (find_interface(domain, request.ifr_name) == NULL) {
@@ -200,140 +200,129 @@
You need to hold the domain's lock when calling this function.
*/
status_t
-remove_interface_from_domain(net_interface *interface)
+remove_interface_from_domain(net_interface* interface)
{
- net_domain_private *domain = (net_domain_private *)interface->domain;
+ net_domain_private* domain = (net_domain_private*)interface->domain;
list_remove_item(&domain->interfaces, interface);
notify_interface_removed(interface);
- delete_interface((net_interface_private *)interface);
+ delete_interface((net_interface_private*)interface);
return B_OK;
}
status_t
-domain_interface_control(net_domain_private *domain, int32 option,
- ifreq *request)
+domain_interface_control(net_domain_private* domain, int32 option,
+ ifreq* request)
{
- const char *name = request->ifr_name;
+ const char* name = request->ifr_name;
status_t status = B_OK;
- net_device_interface *device = get_device_interface(name, false);
+ net_device_interface* device = get_device_interface(name, false);
if (device == NULL)
return ENODEV;
- else {
- // The locking protocol dictates that if both the RX lock
- // and domain locks are required, we MUST obtain the RX
- // lock before the domain lock. This order MUST NOT ever
- // be reversed under the penalty of deadlock.
- RecursiveLocker _1(device->rx_lock);
- MutexLocker _2(domain->lock);
- net_interface *interface = find_interface(domain, name);
- if (interface != NULL) {
- switch (option) {
- case SIOCDIFADDR:
- remove_interface_from_domain(interface);
- break;
+ // The locking protocol dictates that if both the receive lock
+ // and domain locks are required, we MUST obtain the receive
+ // lock before the domain lock.
+ RecursiveLocker _1(device->receive_lock);
+ MutexLocker _2(domain->lock);
- case SIOCSIFFLAGS:
- {
- uint32 requestFlags = request->ifr_flags;
- request->ifr_flags &= ~(IFF_UP | IFF_LINK | IFF_BROADCAST);
+ net_interface* interface = find_interface(domain, name);
+ if (interface != NULL) {
+ switch (option) {
+ case SIOCDIFADDR:
+ remove_interface_from_domain(interface);
+ break;
- if ((requestFlags & IFF_UP) != (interface->flags & IFF_UP)) {
- if (requestFlags & IFF_UP) {
- status = interface->first_info->interface_up(
- interface->first_protocol);
- if (status == B_OK)
- interface->flags |= IFF_UP;
- } else {
- interface_set_down(interface);
- }
- }
+ case SIOCSIFFLAGS:
+ {
+ uint32 requestFlags = request->ifr_flags;
+ request->ifr_flags &= ~(IFF_UP | IFF_LINK | IFF_BROADCAST);
- if (status == B_OK) {
- // TODO: why shouldn't we able to delete IFF_BROADCAST?
- interface->flags &= IFF_UP | IFF_LINK | IFF_BROADCAST;
- interface->flags |= request->ifr_flags;
+ if ((requestFlags & IFF_UP) != (interface->flags & IFF_UP)) {
+ if (requestFlags & IFF_UP) {
+ status = interface->first_info->interface_up(
+ interface->first_protocol);
+ if (status == B_OK)
+ interface->flags |= IFF_UP;
+ } else {
+ interface_set_down(interface);
}
- break;
}
+
+ if (status == B_OK) {
+ // TODO: why shouldn't we able to delete IFF_BROADCAST?
+ interface->flags &= IFF_UP | IFF_LINK | IFF_BROADCAST;
+ interface->flags |= request->ifr_flags;
+ }
+ break;
}
}
}
- // If the SIOCDIFADDR call above removed the last interface
- // associated with the device interface, this put_() will
- // effectively remove the interface
+ // If the SIOCDIFADDR call above removed the last interface associated with
+ // the device interface, this will effectively remove the interface
put_device_interface(device);
return status;
}
+/*! You need to hold the domain lock when calling this function. */
void
-domain_interface_went_down(net_interface *interface)
+domain_interface_went_down(net_interface* interface)
{
- // the domain should be locked here. always check
- // all callers to be sure. We get here via
- // interface_set_down().
+ ASSERT_LOCKED_MUTEX(&((net_domain_private*)interface->domain)->lock);
- dprintf("domain_interface_went_down(%i, %s)\n",
- interface->domain->family, interface->name);
+ TRACE(("domain_interface_went_down(%i, %s)\n",
+ interface->domain->family, interface->name));
- // domain might have been locked by:
- // - domain_removed_device_interface() <--- here
- // remove_interface_from_domain()
- // delete_interface()
- // interface_set_down()
- // - datalink_control() <--- here
- // interface_set_down()
invalidate_routes(interface->domain, interface);
}
void
-domain_removed_device_interface(net_device_interface *interface)
+domain_removed_device_interface(net_device_interface* deviceInterface)
{
MutexLocker locker(sDomainLock);
- net_domain_private *domain = NULL;
+ net_domain_private* domain = NULL;
while (true) {
- domain = (net_domain_private *)list_get_next_item(&sDomains, domain);
+ domain = (net_domain_private*)list_get_next_item(&sDomains, domain);
if (domain == NULL)
break;
MutexLocker locker(domain->lock);
- net_interface_private *priv = find_interface(domain,
- interface->device->name);
- if (priv == NULL)
+ net_interface_private* interface = find_interface(domain,
+ deviceInterface->device->name);
+ if (interface == NULL)
continue;
- remove_interface_from_domain(priv);
+ remove_interface_from_domain(interface);
}
}
status_t
-register_domain(int family, const char *name,
- struct net_protocol_module_info *module,
- struct net_address_module_info *addressModule,
- net_domain **_domain)
+register_domain(int family, const char* name,
+ struct net_protocol_module_info* module,
+ struct net_address_module_info* addressModule,
+ net_domain** _domain)
{
TRACE(("register_domain(%d, %s)\n", family, name));
MutexLocker locker(sDomainLock);
- struct net_domain_private *domain = lookup_domain(family);
+ struct net_domain_private* domain = lookup_domain(family);
if (domain != NULL)
return B_NAME_IN_USE;
- domain = new (std::nothrow) net_domain_private;
+ domain = new(std::nothrow) net_domain_private;
if (domain == NULL)
return B_NO_MEMORY;
- mutex_init_etc(&domain->lock, name, MUTEX_FLAG_CLONE_NAME);
+ mutex_init(&domain->lock, name);
domain->family = family;
domain->name = name;
@@ -350,18 +339,20 @@
status_t
-unregister_domain(net_domain *_domain)
+unregister_domain(net_domain* _domain)
{
- TRACE(("unregister_domain(%p, %d, %s)\n", _domain, _domain->family, _domain->name));
+ TRACE(("unregister_domain(%p, %d, %s)\n", _domain, _domain->family,
+ _domain->name));
- net_domain_private *domain = (net_domain_private *)_domain;
+ net_domain_private* domain = (net_domain_private*)_domain;
MutexLocker locker(sDomainLock);
list_remove_item(&sDomains, domain);
- net_interface_private *interface = NULL;
+ net_interface_private* interface = NULL;
while (true) {
- interface = (net_interface_private *)list_remove_head_item(&domain->interfaces);
+ interface = (net_interface_private*)list_remove_head_item(
+ &domain->interfaces);
if (interface == NULL)
break;
Modified: haiku/trunk/src/add-ons/kernel/network/stack/interfaces.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/network/stack/interfaces.cpp 2009-02-16 11:05:25 UTC (rev 29231)
+++ haiku/trunk/src/add-ons/kernel/network/stack/interfaces.cpp 2009-02-16 11:13:28 UTC (rev 29232)
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007, Haiku, Inc. All Rights Reserved.
+ * Copyright 2006-2009, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
@@ -41,11 +41,11 @@
static status_t
-device_consumer_thread(void *_interface)
+device_consumer_thread(void* _interface)
{
- net_device_interface *interface = (net_device_interface *)_interface;
- net_device *device = interface->device;
- net_buffer *buffer;
+ net_device_interface* interface = (net_device_interface*)_interface;
+ net_device* device = interface->device;
+ net_buffer* buffer;
while (true) {
ssize_t status = fifo_dequeue_buffer(&interface->receive_queue, 0,
@@ -56,19 +56,16 @@
break;
if (buffer->interface != NULL) {
- // if the interface is already specified this buffer was
+ // if the interface is already specified, this buffer was
// delivered locally.
-
- net_domain *domain = buffer->interface->domain;
-
- if (domain->module->receive_data(buffer) == B_OK)
+ if (buffer->interface->domain->module->receive_data(buffer) == B_OK)
buffer = NULL;
} else {
// find handler for this packet
- DeviceHandlerList::Iterator it2 =
+ DeviceHandlerList::Iterator iterator =
interface->receive_funcs.GetIterator();
- while (buffer && it2.HasNext()) {
- net_device_handler *handler = it2.Next();
+ while (buffer && iterator.HasNext()) {
+ net_device_handler* handler = iterator.Next();
// if the handler returns B_OK, it consumed the buffer
if (handler->type == buffer->type
@@ -77,7 +74,7 @@
}
}
- if (buffer)
+ if (buffer != NULL)
gNetBufferModule.free(buffer);
}
@@ -85,14 +82,12 @@
}
-static net_device_interface *
-find_device_interface(const char *name)
+static net_device_interface*
+find_device_interface(const char* name)
{
DeviceInterfaceList::Iterator iterator = sInterfaces.GetIterator();
- while (iterator.HasNext()) {
- net_device_interface *interface = iterator.Next();
-
+ while (net_device_interface* interface = iterator.Next()) {
if (!strcmp(interface->device->name, name))
return interface;
}
@@ -101,30 +96,33 @@
}
+/*! The domain's device receive handler - this will inject the net_buffers into
+ the protocol layer (the domain's registered receive handler).
+*/
static status_t
-domain_receive_adapter(void *cookie, net_device *device, net_buffer *buffer)
+domain_receive_adapter(void* cookie, net_device* device, net_buffer* buffer)
{
- net_domain_private *domain = (net_domain_private *)cookie;
+ net_domain_private* domain = (net_domain_private*)cookie;
buffer->interface = find_interface(domain, device->index);
return domain->module->receive_data(buffer);
}
-static net_device_interface *
-allocate_device_interface(net_device *device, net_device_module_info *module)
+static net_device_interface*
+allocate_device_interface(net_device* device, net_device_module_info* module)
{
- net_device_interface *interface = new (std::nothrow) net_device_interface;
+ net_device_interface* interface = new(std::nothrow) net_device_interface;
if (interface == NULL)
- goto error_0;
+ return NULL;
[... truncated: 784 lines follow ...]
From superstippi at gmx.de Mon Feb 16 12:21:16 2009
From: superstippi at gmx.de (=?ISO-8859-1?Q?Stephan_A=DFmus?=)
Date: Mon, 16 Feb 2009 12:21:16 +0100
Subject: [Haiku-commits] r29221 - in haiku/trunk: headers/os/interface
src/apps/launchbox src/kits/interface src/kits/tracker
In-Reply-To: <2040477519.1953501234779240390.JavaMail.root@zimbra20-e3.priv.proxad.net>
References: <2040477519.1953501234779240390.JavaMail.root@zimbra20-e3.priv.proxad.net>
Message-ID: <49994C2C.3060407@gmx.de>
philippe.houdoin at free.fr schrieb:
>> Thanks for all the feedback so far! It's interesting how individual
>> points of critique are felt by multiple people, as with the inactive
>> tabs distinction. The higher contrast of the BMenuField popup marker
>> was also something Axel mentioned to me before.
>
> Here mine, many shared by others but, oh well:
>
> 1) Inactive tabs are not distinctable, but you know that one, don't you ;-)
Yes, going to look into that one.
> 2) Inactive tabs extending to a full width dark bar doesn't looks that fine, they're not headers but tabs, and if real world metaphor should applied, tabs don't extend full width. Having full width tabs in a OS cloning the "yellow tabs" BeOS sounds like blasphem, but maybe I'm going religious here :-)
I intend to keep it this way. I wanted to give the tab view a unique
feature and move away somewhat from the real-world look. My emphasis was
on both an appealing/unique look and a very good distinction of the
active tab. I believe that the look of the active tab helps a lot to
transport the function of the control. Adjusting the inactive tabs to be
more tab-like seems like it wouldn't improve this any further, only make
it less unique.
> 3) Disabled unselected BCheck/RadioButtons looks less disabled than previous look, mostly due to the lighter grey color used to fill box/circle. Could be confusing for visual impaired people.
Ok, I can tweak that.
> 4) Enabled & selected BRadioButton looks to flat to me. I miss the "ball/LED" R5 effect which was a very distinctive BeOS widget from others GUIs. I hope one could still keep this quite unique visual identity while going to a flatter look...
Sorry, but I found the ball quite non-stylish and out of place, even
during the actual BeOS timeframe.
> 5) BMenuField looks too much like a BButton, which can be confusing. But everybody told you so already ;-)
I would like to keep it this way, but I was thinking to reduce the
contrast of the outermost edged-in frame. To me, the re-use of certain
surface looks, like buttons, scrollbars and menufields, help make a
consistent look.
> 6) Drop shadow of the two kind of BSlider's thumbs are not consistent. I like the rectangular one better, but I can't tell from all widgets what's your choice regarding drop shadows, which could be a sign of inconsistency... or that I'm simply too picky/dumb/old/becoming blind.
Yes, the triangle thumb was not done. I forgot about that when I commited.
> 7) BSlider bars and active BTab are rounded, when everything else moved from the R5 more rounded look to Haiku's sharper one. This seems inconsistent, and rounding looks dated these days.
While I was designing, I continually got the feedback that things were
not round enough. I had hoped to integrate some roundness with this,
while not making things too inconsistent. I was thinking to also give
the progress bar round corners like the slider bar to get more consistency.
> 8) BProgressBar, BGroupBox and BMenuBar are splendids!
>
> I also noticed that some gradients are in fact only composed of two colors. It's very visible on scrollbars, and I'm not sure it's expected.
No, that is a gloss effect. These gradients are actually composed of
four colors, but I may have used too little contrast. I have noticed
that the effect is more visible on my very good monitor, and less
visible on my laptop. So I may have to tweak the contrast a bit,
however, I don't like strong glossy effects too much.
> But, hey, GUI looks are like everything: it take times to get used to it, and then you can't lives without anymore!
> Please take no offense with the above remarks, taste are very subjective topic, and everyone think he has good one.
No offense taken! Thanks for the feedback!
>> The code is really WIP, while I
>> felt that the look was already enough of an improvement and complete
>> enough to go ahead and commit the patch. (Besides, it was also getting
>> a bit of a pain to keep four Haiku trees on two different computers
>> all in sync... ;-)
>
> Isn't what our subversion branches/... root is for?
> ;-)
Yeah, probably, but I also didn't want too many people to be able to
look at something half-finished... ;-)
> Anyway, Stephan, like always, your graphic "touch" is well appreciated. I bet Haiku will have less audience without it: people loves screenshots, and your touch is on everyone but the oldests. ;-)
Thanks a lot! I have also tried to incorporate some ideas from the
existing GUI patches, while I wanted to solve some problems that I felt
myself.
> Philippe, now daddy of 3.
Wow! Congratulations!
Best regards,
-Stephan
From host.haiku at gmx.de Mon Feb 16 12:43:54 2009
From: host.haiku at gmx.de (julun)
Date: Mon, 16 Feb 2009 12:43:54 +0100
Subject: [Haiku-commits] r29221 - in haiku/trunk: headers/os/interface
src/apps/launchbox src/kits/interface src/kits/tracker
In-Reply-To: <49994C2C.3060407@gmx.de>
References: <2040477519.1953501234779240390.JavaMail.root@zimbra20-e3.priv.proxad.net>
<49994C2C.3060407@gmx.de>
Message-ID: <4999517A.6020209@gmx.de>
Hi Stephan,
great work so far! :)
Stephan A?mus wrote:
> philippe.houdoin at free.fr schrieb:
>>> Thanks for all the feedback so far! It's interesting how individual
>>> points of critique are felt by multiple people, as with the inactive
>>> tabs distinction. The higher contrast of the BMenuField popup marker
>>> was also something Axel mentioned to me before.
>> Here mine, many shared by others but, oh well:
>>
>> 1) Inactive tabs are not distinctable, but you know that one, don't you ;-)
>
> Yes, going to look into that one.
>
>> 2) Inactive tabs extending to a full width dark bar doesn't looks that fine, they're not headers but tabs, and if real world metaphor should applied, tabs don't extend full width. Having full width tabs in a OS cloning the "yellow tabs" BeOS sounds like blasphem, but maybe I'm going religious here :-)
>
> I intend to keep it this way. I wanted to give the tab view a unique
> feature and move away somewhat from the real-world look. My emphasis was
> on both an appealing/unique look and a very good distinction of the
> active tab. I believe that the look of the active tab helps a lot to
> transport the function of the control. Adjusting the inactive tabs to be
> more tab-like seems like it wouldn't improve this any further, only make
> it less unique.
Please note the one can use BTab without a BTabView, which then will
look wired. See for example some of the Data-Translation settings views.
>> 3) Disabled unselected BCheck/RadioButtons looks less disabled than previous look, mostly due to the lighter grey color used to fill box/circle. Could be confusing for visual impaired people.
>
> Ok, I can tweak that.
>
>> 4) Enabled & selected BRadioButton looks to flat to me. I miss the "ball/LED" R5 effect which was a very distinctive BeOS widget from others GUIs. I hope one could still keep this quite unique visual identity while going to a flatter look...
>
> Sorry, but I found the ball quite non-stylish and out of place, even
> during the actual BeOS timeframe.
I fully agree here :)
>> 5) BMenuField looks too much like a BButton, which can be confusing. But everybody told you so already ;-)
>
> I would like to keep it this way, but I was thinking to reduce the
> contrast of the outermost edged-in frame. To me, the re-use of certain
> surface looks, like buttons, scrollbars and menufields, help make a
> consistent look.
I like the new look very much! But please don't forget about the fact
that a BMenuField can have the fixed length. As you can see in the Mouse
prefs focus follows mouse thing, long text will draw over the menu field
arrow area. Also the menu field in Diskprobe is cut off on the right.
>> 6) Drop shadow of the two kind of BSlider's thumbs are not consistent. I like the rectangular one better, but I can't tell from all widgets what's your choice regarding drop shadows, which could be a sign of inconsistency... or that I'm simply too picky/dumb/old/becoming blind.
>
> Yes, the triangle thumb was not done. I forgot about that when I commited.
>
>> 7) BSlider bars and active BTab are rounded, when everything else moved from the R5 more rounded look to Haiku's sharper one. This seems inconsistent, and rounding looks dated these days.
>
> While I was designing, I continually got the feedback that things were
> not round enough. I had hoped to integrate some roundness with this,
> while not making things too inconsistent. I was thinking to also give
> the progress bar round corners like the slider bar to get more consistency.
I would also vote for less rounded corners, maybe going with 2x2 px edges.
>> 8) BProgressBar, BGroupBox and BMenuBar are splendids!
>>
>> I also noticed that some gradients are in fact only composed of two colors. It's very visible on scrollbars, and I'm not sure it's expected.
>
> No, that is a gloss effect. These gradients are actually composed of
> four colors, but I may have used too little contrast. I have noticed
> that the effect is more visible on my very good monitor, and less
> visible on my laptop. So I may have to tweak the contrast a bit,
> however, I don't like strong glossy effects too much.
If you change the e.g, B_PANEL_BACKGROUND_COLOR in appearance pref to
something like yellow, the BTabView looks totally broken.
Anyway, this was a major step in the right direction! Thanks for the
hard work. :)
Regards,
Karsten
From superstippi at gmx.de Mon Feb 16 12:52:40 2009
From: superstippi at gmx.de (=?ISO-8859-1?Q?Stephan_A=DFmus?=)
Date: Mon, 16 Feb 2009 12:52:40 +0100
Subject: [Haiku-commits] r29221 - in haiku/trunk: headers/os/interface
src/apps/launchbox src/kits/interface src/kits/tracker
In-Reply-To: <4999517A.6020209@gmx.de>
References: <2040477519.1953501234779240390.JavaMail.root@zimbra20-e3.priv.proxad.net> <49994C2C.3060407@gmx.de>
<4999517A.6020209@gmx.de>
Message-ID: <49995388.5000506@gmx.de>
Hi Karsten,
julun schrieb:
> Please note the one can use BTab without a BTabView, which then will
> look wired. See for example some of the Data-Translation settings views.
I saw that and it was on my mental TODO list. :-)
>>> 5) BMenuField looks too much like a BButton, which can be confusing. But everybody told you so already ;-)
>> I would like to keep it this way, but I was thinking to reduce the
>> contrast of the outermost edged-in frame. To me, the re-use of certain
>> surface looks, like buttons, scrollbars and menufields, help make a
>> consistent look.
>
> I like the new look very much! But please don't forget about the fact
> that a BMenuField can have the fixed length. As you can see in the Mouse
> prefs focus follows mouse thing, long text will draw over the menu field
> arrow area. Also the menu field in Diskprobe is cut off on the right.
Yes, thanks for noticing.
>>> 7) BSlider bars and active BTab are rounded, when everything else moved from the R5 more rounded look to Haiku's sharper one. This seems inconsistent, and rounding looks dated these days.
>> While I was designing, I continually got the feedback that things were
>> not round enough. I had hoped to integrate some roundness with this,
>> while not making things too inconsistent. I was thinking to also give
>> the progress bar round corners like the slider bar to get more consistency.
>
> I would also vote for less rounded corners, maybe going with 2x2 px edges.
The BTabView should be the only control with actual round *corners*,
while the sliders use a half circle. I like that very much for it's
simplicity. Actual round corners are a visually more complicated shape,
and therefore I would like to keep the slider look. I particularly like
the slider bar look. Only the triangle thumb is giving me trouble.
>>> 8) BProgressBar, BGroupBox and BMenuBar are splendids!
>>>
>>> I also noticed that some gradients are in fact only composed of two colors. It's very visible on scrollbars, and I'm not sure it's expected.
>> No, that is a gloss effect. These gradients are actually composed of
>> four colors, but I may have used too little contrast. I have noticed
>> that the effect is more visible on my very good monitor, and less
>> visible on my laptop. So I may have to tweak the contrast a bit,
>> however, I don't like strong glossy effects too much.
>
> If you change the e.g, B_PANEL_BACKGROUND_COLOR in appearance pref to
> something like yellow, the BTabView looks totally broken.
I have tested a bit with changing the main panel bg color, but that was
before I got around to the BTabView... :-)
Anyways, I am not happy with how that works yet. The current
implementation uses a lot of tint_color() around a "base" color. But
that is flawed, since the current tints are optimized for the 216 gray.
What would work better is to determine the maximum shine and shadow
color based on the current bg color and then place all other tints
between those. I believe that would give better results to make the
maximum shine/shadow colors a fixed (scaled) brightness away from the
base color, instead of always tinting between black and white extremes.
That will involve some refactoring in BControlLook, but it's something I
wanted to do yet.
Best regards,
-Stephan
From stippi at mail.berlios.de Mon Feb 16 13:19:06 2009
From: stippi at mail.berlios.de (stippi at mail.berlios.de)
Date: Mon, 16 Feb 2009 13:19:06 +0100
Subject: [Haiku-commits] r29233 - haiku/trunk/src/apps/midiplayer
Message-ID: <200902161219.n1GCJ6uZ032654@sheep.berlios.de>
Author: stippi
Date: 2009-02-16 13:19:04 +0100 (Mon, 16 Feb 2009)
New Revision: 29233
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29233&view=rev
Modified:
haiku/trunk/src/apps/midiplayer/MidiPlayerWindow.cpp
Log:
Resolved a couple minor TODOs to use layout friendly constructors, which have
become available meanwhile.
Modified: haiku/trunk/src/apps/midiplayer/MidiPlayerWindow.cpp
===================================================================
--- haiku/trunk/src/apps/midiplayer/MidiPlayerWindow.cpp 2009-02-16 11:13:28 UTC (rev 29232)
+++ haiku/trunk/src/apps/midiplayer/MidiPlayerWindow.cpp 2009-02-16 12:19:04 UTC (rev 29233)
@@ -236,37 +236,30 @@
// Set up needed views
scopeView = new ScopeView;
- showScope = new BCheckBox(
- BRect(0, 0, 1, 1), "showScope", "Scope",
- new BMessage(MSG_SHOW_SCOPE), B_FOLLOW_LEFT);
+ showScope = new BCheckBox("showScope", "Scope",
+ new BMessage(MSG_SHOW_SCOPE));
showScope->SetValue(B_CONTROL_ON);
CreateInputMenu();
CreateReverbMenu();
- volumeSlider = new BSlider(
- BRect(0, 0, 1, 1), "volumeSlider", NULL, NULL,
- 0, 100, B_TRIANGLE_THUMB);
+ volumeSlider = new BSlider("volumeSlider", NULL, NULL, 0, 100,
+ B_HORIZONTAL);
rgb_color col = { 152, 152, 255 };
volumeSlider->UseFillColor(true, &col);
volumeSlider->SetModificationMessage(new BMessage(MSG_VOLUME));
- playButton = new BButton(
- BRect(0, 1, 80, 1), "playButton", "Play", new BMessage(MSG_PLAY_STOP),
- B_FOLLOW_RIGHT);
+ playButton = new BButton("playButton", "Play", new BMessage(MSG_PLAY_STOP));
playButton->SetEnabled(false);
- BBox* divider = new BBox(
- BRect(0, 0, 1, 1), B_EMPTY_STRING, B_FOLLOW_ALL_SIDES,
- B_WILL_DRAW | B_FRAME_EVENTS, B_FANCY_BORDER);
+ BBox* divider = new BBox(B_EMPTY_STRING, B_WILL_DRAW | B_FRAME_EVENTS,
+ B_FANCY_BORDER);
divider->SetExplicitMaxSize(
BSize(B_SIZE_UNLIMITED, 1));
- BStringView* volumeLabel = new BStringView(
- BRect(0, 0, 1, 1), NULL, "Volume:");
+ BStringView* volumeLabel = new BStringView(NULL, "Volume:");
volumeLabel->SetAlignment(B_ALIGN_LEFT);
- volumeLabel->SetExplicitMaxSize(
- BSize(B_SIZE_UNLIMITED, B_SIZE_UNSET));
+ volumeLabel->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNSET));
// Build the layout
SetLayout(new BGroupLayout(B_HORIZONTAL));
From host.haiku at gmx.de Mon Feb 16 13:36:08 2009
From: host.haiku at gmx.de (julun)
Date: Mon, 16 Feb 2009 13:36:08 +0100
Subject: [Haiku-commits] r29221 - in haiku/trunk: headers/os/interface
src/apps/launchbox src/kits/interface src/kits/tracker
In-Reply-To: <49995388.5000506@gmx.de>
References: <2040477519.1953501234779240390.JavaMail.root@zimbra20-e3.priv.proxad.net> <49994C2C.3060407@gmx.de> <4999517A.6020209@gmx.de>
<49995388.5000506@gmx.de>
Message-ID: <49995DB8.5040803@gmx.de>
Hi Stephan,
>> I would also vote for less rounded corners, maybe going with 2x2 px edges.
>
> The BTabView should be the only control with actual round *corners*,
> while the sliders use a half circle. I like that very much for it's
> simplicity. Actual round corners are a visually more complicated shape,
> and therefore I would like to keep the slider look. I particularly like
> the slider bar look. Only the triangle thumb is giving me trouble.
I'm fine with the BTab/View, i more meant the slider bar. Maybe the
edges are to round or the knob is to square. ;) I have no problem with
the triangle at all. Oh and i would prefer if we could have the fill
color enabled be default, at least for Haiku.
>>>> 8) BProgressBar, BGroupBox and BMenuBar are splendids!
>>>>
>>>> I also noticed that some gradients are in fact only composed of two colors. It's very visible on scrollbars, and I'm not sure it's expected.
>>> No, that is a gloss effect. These gradients are actually composed of
>>> four colors, but I may have used too little contrast. I have noticed
>>> that the effect is more visible on my very good monitor, and less
>>> visible on my laptop. So I may have to tweak the contrast a bit,
>>> however, I don't like strong glossy effects too much.
>> If you change the e.g, B_PANEL_BACKGROUND_COLOR in appearance pref to
>> something like yellow, the BTabView looks totally broken.
>
> I have tested a bit with changing the main panel bg color, but that was
> before I got around to the BTabView... :-)
Well no problem, i know its work in progress. :)
> Anyways, I am not happy with how that works yet. The current
> implementation uses a lot of tint_color() around a "base" color. But
> that is flawed, since the current tints are optimized for the 216 gray.
> What would work better is to determine the maximum shine and shadow
> color based on the current bg color and then place all other tints
> between those. I believe that would give better results to make the
> maximum shine/shadow colors a fixed (scaled) brightness away from the
> base color, instead of always tinting between black and white extremes.
> That will involve some refactoring in BControlLook, but it's something I
> wanted to do yet.
Yeah, i wondered anyway why we have to do all this tint stuff. Isn't
there everything in place to have a defined set of colors to draw a control?
Karsten
From alex at zappotek.com Mon Feb 16 13:48:43 2009
From: alex at zappotek.com (Alexandre Deckner)
Date: Mon, 16 Feb 2009 13:48:43 +0100
Subject: [Haiku-commits] r29221 - in haiku/trunk: headers/os/interface
src/apps/launchbox src/kits/interface src/kits/tracker
In-Reply-To: <49995DB8.5040803@gmx.de>
References: <2040477519.1953501234779240390.JavaMail.root@zimbra20-e3.priv.proxad.net> <49994C2C.3060407@gmx.de> <4999517A.6020209@gmx.de> <49995388.5000506@gmx.de>
<49995DB8.5040803@gmx.de>
Message-ID: <499960AB.6090906@zappotek.com>
julun wrote:
> Hi Stephan,
>
>
>
>
>
>>> I would also vote for less rounded corners, maybe going with 2x2 px edges.
>>>
>> The BTabView should be the only control with actual round *corners*,
>> while the sliders use a half circle. I like that very much for it's
>> simplicity. Actual round corners are a visually more complicated shape,
>> and therefore I would like to keep the slider look. I particularly like
>> the slider bar look. Only the triangle thumb is giving me trouble.
>>
>
> I'm fine with the BTab/View, i more meant the slider bar. Maybe the
> edges are to round or the knob is to square. ;) I have no problem with
> the triangle at all. Oh and i would prefer if we could have the fill
> color enabled be default, at least for Haiku.
>
>
Just to balance a bit, i for one really like the new sliders :) I agree
the triangle might need some tweaking maybe.
I also wanted to comment on the new radio buttons and check boxes, i
find them a _lot_ better than before.
Best regards,
Alex
From stippi at mail.berlios.de Mon Feb 16 14:05:33 2009
From: stippi at mail.berlios.de (stippi at mail.berlios.de)
Date: Mon, 16 Feb 2009 14:05:33 +0100
Subject: [Haiku-commits] r29234 - haiku/trunk/src/kits/interface
Message-ID: <200902161305.n1GD5XYc007035@sheep.berlios.de>
Author: stippi
Date: 2009-02-16 14:05:31 +0100 (Mon, 16 Feb 2009)
New Revision: 29234
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29234&view=rev
Modified:
haiku/trunk/src/kits/interface/ControlLook.cpp
Log:
* Give the inactive tabs a slight separation.
* Removed some dead WIP code.
Modified: haiku/trunk/src/kits/interface/ControlLook.cpp
===================================================================
--- haiku/trunk/src/kits/interface/ControlLook.cpp 2009-02-16 12:19:04 UTC (rev 29233)
+++ haiku/trunk/src/kits/interface/ControlLook.cpp 2009-02-16 13:05:31 UTC (rev 29234)
@@ -1216,40 +1216,6 @@
}
-#if 0
-static void
-_MakeTabShape(BShape& shape, const BRect& rect, float cornerRadius,
- float slopeRadius)
-{
- BPoint curve[3];
-
- shape.Clear();
- shape.MoveTo(BPoint(rect.left, rect.bottom));
- shape.LineTo(BPoint(rect.left, rect.top + cornerRadius));
-
- curve[0].x = rect.left;
- curve[0].y = rect.top + 0.56 * cornerRadius;
- curve[1].x = rect.left + 0.56 * cornerRadius;
- curve[1].y = rect.top;
- curve[2].x = rect.left + cornerRadius;
- curve[2].y = rect.top;
-
- shape.BezierTo(curve);
-
- shape.LineTo(BPoint(rect.right - slopeRadius, rect.top));
-
- curve[0].x = rect.right - slopeRadius / 5;
- curve[0].y = rect.top;
- curve[1].x = rect.right;
- curve[1].y = rect.bottom - slopeRadius / 5;
- curve[2].x = rect.right;
- curve[2].y = rect.bottom;
-
- shape.BezierTo(curve);
-}
-#endif
-
-
void
BControlLook::DrawActiveTab(BView* view, BRect& rect, const BRect& updateRect,
const rgb_color& base, uint32 flags, uint32 borders)
@@ -1286,7 +1252,7 @@
fillGradient.AddColor(tint_color(base, 0.75), 0);
fillGradient.AddColor(tint_color(base, 1.03), 255);
}
-#if 1
+
static const float kRoundCornerRadius = 4;
// left/top corner
@@ -1316,7 +1282,6 @@
_DrawFrame(view, rect, edgeShadowColor, edgeShadowColor, edgeLightColor,
edgeLightColor,
borders & (B_LEFT_BORDER | B_TOP_BORDER | B_RIGHT_BORDER));
-// B_LEFT_BORDER | B_TOP_BORDER | B_RIGHT_BORDER);
if ((borders & B_LEFT_BORDER) == 0)
rect.left++;
if ((borders & B_RIGHT_BORDER) == 0)
@@ -1331,42 +1296,6 @@
view->FillRect(rect, fillGradient);
view->ConstrainClippingRegion(NULL);
-#else
-
- view->MovePenTo(B_ORIGIN);
-
- uint32 viewFlags = view->Flags();
- view->SetFlags(viewFlags | B_SUBPIXEL_PRECISE);
-
- rect.InsetBy(0.5, 0.5);
-
- float cornerRadius = 4;
- float slopeRadius = 20;
- BShape shape;
-
- _MakeTabShape(shape, rect, cornerRadius, slopeRadius);
- view->SetHighColor(edgeShadowColor);
- view->StrokeShape(&shape);
-
- rect.left += 1;
- rect.top += 1;
- rect.right -= 1;
- cornerRadius -= 1;
-
- _MakeTabShape(shape, rect, cornerRadius, slopeRadius);
- view->SetHighColor(frameLightColor);
- view->StrokeShape(&shape);
-
- rect.left += 0.5;
- rect.top += 0.5;
- rect.right -= 0.5;
- cornerRadius -= 1;
-
- _MakeTabShape(shape, rect, cornerRadius, slopeRadius);
- view->FillShape(&shape, fillGradient);
-
- view->SetFlags(viewFlags);
-#endif
}
@@ -1401,7 +1330,7 @@
edgeLightColor = tint_color(base, 0.80);
frameShadowColor = tint_color(base, 1.30);
frameLightColor = tint_color(base, 1.30);
- bevelShadowColor = tint_color(base, 1.15);
+ bevelShadowColor = tint_color(base, 1.17);
bevelLightColor = tint_color(base, 1.10);
fillGradient.AddColor(tint_color(base, 1.12), 0);
fillGradient.AddColor(tint_color(base, 1.08), 255);
@@ -1419,13 +1348,10 @@
_DrawFrame(view, rect, frameLightColor, frameLightColor, frameShadowColor,
frameShadowColor,
- //B_LEFT_BORDER | B_TOP_BORDER | B_RIGHT_BORDER);
borders & (B_LEFT_BORDER | B_TOP_BORDER | B_RIGHT_BORDER));
- _DrawFrame(view, rect, bevelLightColor, bevelLightColor, bevelShadowColor,
- bevelShadowColor,
- //B_BOTTOM_BORDER);
- 0);
+ _DrawFrame(view, rect, bevelShadowColor, bevelShadowColor, bevelLightColor,
+ bevelLightColor, B_LEFT_BORDER & ~borders);
view->FillRect(rect, fillGradient);
}
From stippi at mail.berlios.de Mon Feb 16 14:57:34 2009
From: stippi at mail.berlios.de (stippi at mail.berlios.de)
Date: Mon, 16 Feb 2009 14:57:34 +0100
Subject: [Haiku-commits] r29235 - in haiku/trunk: headers/os/interface
src/kits/interface
Message-ID: <200902161357.n1GDvYGt011001@sheep.berlios.de>
Author: stippi
Date: 2009-02-16 14:57:31 +0100 (Mon, 16 Feb 2009)
New Revision: 29235
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29235&view=rev
Modified:
haiku/trunk/headers/os/interface/ControlLook.h
haiku/trunk/src/kits/interface/ControlLook.cpp
haiku/trunk/src/kits/interface/MenuField.cpp
Log:
* Stronger BMenuField popup indicator.
* Softer recessed frame for BMenuField to distinguish more from BButton
and make it slightly more similar to BTextControl.
Modified: haiku/trunk/headers/os/interface/ControlLook.h
===================================================================
--- haiku/trunk/headers/os/interface/ControlLook.h 2009-02-16 13:05:31 UTC (rev 29234)
+++ haiku/trunk/headers/os/interface/ControlLook.h 2009-02-16 13:57:31 UTC (rev 29235)
@@ -61,7 +61,7 @@
virtual float DefaultLabelSpacing() const;
uint32 Flags(BControl* control) const;
- virtual void DrawButtonFrame(BView* view, BRect& rect,
+ virtual void DrawButtonFrame(BView* view, BRect& rect,
const BRect& updateRect,
const rgb_color& base,
uint32 flags = 0,
@@ -80,6 +80,12 @@
const rgb_color& base,
uint32 borders = B_ALL_BORDERS);
+ virtual void DrawMenuFieldFrame(BView* view, BRect& rect,
+ const BRect& updateRect,
+ const rgb_color& base,
+ uint32 flags = 0,
+ uint32 borders = B_ALL_BORDERS);
+
virtual void DrawMenuFieldBackground(BView* view,
BRect& rect, const BRect& updateRect,
const rgb_color& base, bool popupIndicator,
@@ -203,6 +209,13 @@
const BAlignment& alignment);
protected:
+ void _DrawButtonFrame(BView* view, BRect& rect,
+ const BRect& updateRect,
+ const rgb_color& base,
+ float contrast, float brightness = 1.0,
+ uint32 flags = 0,
+ uint32 borders = B_ALL_BORDERS);
+
void _DrawOuterResessedFrame(BView* view,
BRect& rect, const rgb_color& base,
float contrast = 1.0f,
Modified: haiku/trunk/src/kits/interface/ControlLook.cpp
===================================================================
--- haiku/trunk/src/kits/interface/ControlLook.cpp 2009-02-16 13:05:31 UTC (rev 29234)
+++ haiku/trunk/src/kits/interface/ControlLook.cpp 2009-02-16 13:57:31 UTC (rev 29235)
@@ -68,68 +68,7 @@
BControlLook::DrawButtonFrame(BView* view, BRect& rect, const BRect& updateRect,
const rgb_color& base, uint32 flags, uint32 borders)
{
- // colors
- rgb_color dark1BorderColor;
- rgb_color dark2BorderColor;
-
- if ((flags & B_DISABLED) == 0) {
- dark1BorderColor = tint_color(base, 1.33);
- dark2BorderColor = tint_color(base, 1.45);
-
- if (flags & B_DEFAULT_BUTTON) {
- dark2BorderColor = tint_color(dark1BorderColor, 1.5);
- dark1BorderColor = tint_color(dark1BorderColor, 1.35);
- }
- } else {
- dark1BorderColor = tint_color(base, 1.147);
- dark2BorderColor = tint_color(base, 1.24);
-
- if (flags & B_DEFAULT_BUTTON) {
- dark1BorderColor = tint_color(dark1BorderColor, 1.12);
- dark2BorderColor = tint_color(dark1BorderColor, 1.16);
- }
- }
-
- if (flags & B_ACTIVATED) {
- rgb_color temp = dark2BorderColor;
- dark2BorderColor = dark1BorderColor;
- dark1BorderColor = temp;
- }
-
- // indicate focus by changing main button border
- if (flags & B_FOCUSED) {
- dark1BorderColor = ui_color(B_KEYBOARD_NAVIGATION_COLOR);
- dark2BorderColor = dark1BorderColor;
- }
-
- if (flags & B_DEFAULT_BUTTON) {
- float focusTint = 1.2;
- if (flags & B_DISABLED)
- focusTint = (B_NO_TINT + focusTint) / 2;
-
- rgb_color focusColor = tint_color(base, focusTint);
- view->SetHighColor(base);
-
- view->StrokeRect(rect);
- rect.InsetBy(1.0, 1.0);
-
- view->SetHighColor(focusColor);
- view->StrokeRect(rect);
- rect.InsetBy(1.0, 1.0);
- view->StrokeRect(rect);
- rect.InsetBy(1.0, 1.0);
-
- // bevel around external border
- _DrawOuterResessedFrame(view, rect, focusColor,
- (flags & B_DISABLED) ? 0.5 : 0.8, 0.9, borders);
- } else {
- // bevel around external border
- _DrawOuterResessedFrame(view, rect, base,
- (flags & B_DISABLED) ? 0.0 : 1.0, 1.0, borders);
- }
-
- _DrawFrame(view, rect, dark1BorderColor, dark1BorderColor,
- dark2BorderColor, dark2BorderColor, borders);
+ _DrawButtonFrame(view, rect, updateRect, base, 1.0, 1.0, flags, borders);
}
@@ -264,6 +203,14 @@
void
+BControlLook::DrawMenuFieldFrame(BView* view, BRect& rect, const BRect& updateRect,
+ const rgb_color& base, uint32 flags, uint32 borders)
+{
+ _DrawButtonFrame(view, rect, updateRect, base, 0.6, 1.0, flags, borders);
+}
+
+
+void
BControlLook::DrawMenuFieldBackground(BView* view, BRect& rect,
const BRect& updateRect, const rgb_color& base, bool popupIndicator,
uint32 flags)
@@ -282,10 +229,10 @@
rgb_color markColor;
if (flags & B_DISABLED) {
indicatorBase = tint_color(base, 1.05);
- markColor = tint_color(base, B_DARKEN_3_TINT);
+ markColor = tint_color(base, 1.35);
} else {
- indicatorBase = tint_color(base, 1.09);
- markColor = tint_color(base, B_DARKEN_4_TINT);
+ indicatorBase = tint_color(base, 1.12);
+ markColor = tint_color(base, 1.65);
}
DrawMenuFieldBackground(view, rightRect, updateRect, indicatorBase,
@@ -1548,6 +1495,78 @@
void
+BControlLook::_DrawButtonFrame(BView* view, BRect& rect,
+ const BRect& updateRect, const rgb_color& base,
+ float contrast, float brightness, uint32 flags, uint32 borders)
+{
+ // colors
+ rgb_color dark1BorderColor;
+ rgb_color dark2BorderColor;
+
+ if ((flags & B_DISABLED) == 0) {
+ dark1BorderColor = tint_color(base, 1.33);
+ dark2BorderColor = tint_color(base, 1.45);
+
+ if (flags & B_DEFAULT_BUTTON) {
+ dark2BorderColor = tint_color(dark1BorderColor, 1.5);
+ dark1BorderColor = tint_color(dark1BorderColor, 1.35);
+ }
+ } else {
+ dark1BorderColor = tint_color(base, 1.147);
+ dark2BorderColor = tint_color(base, 1.24);
+
+ if (flags & B_DEFAULT_BUTTON) {
+ dark1BorderColor = tint_color(dark1BorderColor, 1.12);
+ dark2BorderColor = tint_color(dark1BorderColor, 1.16);
+ }
+ }
+
+ if (flags & B_ACTIVATED) {
+ rgb_color temp = dark2BorderColor;
+ dark2BorderColor = dark1BorderColor;
+ dark1BorderColor = temp;
+ }
+
+ // indicate focus by changing main button border
+ if (flags & B_FOCUSED) {
+ dark1BorderColor = ui_color(B_KEYBOARD_NAVIGATION_COLOR);
+ dark2BorderColor = dark1BorderColor;
+ }
+
+ if (flags & B_DEFAULT_BUTTON) {
+ float focusTint = 1.2;
+ if (flags & B_DISABLED)
+ focusTint = (B_NO_TINT + focusTint) / 2;
+
+ rgb_color focusColor = tint_color(base, focusTint);
+ view->SetHighColor(base);
+
+ view->StrokeRect(rect);
+ rect.InsetBy(1.0, 1.0);
+
+ view->SetHighColor(focusColor);
+ view->StrokeRect(rect);
+ rect.InsetBy(1.0, 1.0);
+ view->StrokeRect(rect);
+ rect.InsetBy(1.0, 1.0);
+
+ // bevel around external border
+ _DrawOuterResessedFrame(view, rect, focusColor,
+ contrast * (((flags & B_DISABLED) ? 0.5 : 0.8)), brightness * 0.9,
+ borders);
+ } else {
+ // bevel around external border
+ _DrawOuterResessedFrame(view, rect, base,
+ contrast * ((flags & B_DISABLED) ? 0.0 : 1.0), brightness * 1.0,
+ borders);
+ }
+
+ _DrawFrame(view, rect, dark1BorderColor, dark1BorderColor,
+ dark2BorderColor, dark2BorderColor, borders);
+}
+
+
+void
BControlLook::_DrawOuterResessedFrame(BView* view, BRect& rect,
const rgb_color& base, float contrast, float brightness, uint32 borders)
{
Modified: haiku/trunk/src/kits/interface/MenuField.cpp
===================================================================
--- haiku/trunk/src/kits/interface/MenuField.cpp 2009-02-16 13:05:31 UTC (rev 29234)
+++ haiku/trunk/src/kits/interface/MenuField.cpp 2009-02-16 13:57:31 UTC (rev 29235)
@@ -275,7 +275,7 @@
flags |= BControlLook::B_DISABLED;
if (active)
flags |= BControlLook::B_FOCUSED;
- be_control_look->DrawButtonFrame(this, frame, update, base, flags);
+ be_control_look->DrawMenuFieldFrame(this, frame, update, base, flags);
return;
}
From revol at free.fr Mon Feb 16 17:35:42 2009
From: revol at free.fr (=?utf-8?q?Fran=C3=A7ois?= Revol)
Date: Mon, 16 Feb 2009 17:35:42 +0100 CET
Subject: [Haiku-commits] r29221 - in haiku/trunk: headers/os/interface
src/apps/launchbox src/kits/interface src/kits/tracker
In-Reply-To: <49995388.5000506@gmx.de>
Message-ID: <1537712543-BeMail@laptop>
> I have tested a bit with changing the main panel bg color, but that
> was
> before I got around to the BTabView... :-)
Feel free to use Themes :p
> Anyways, I am not happy with how that works yet. The current
> implementation uses a lot of tint_color() around a "base" color. But
> that is flawed, since the current tints are optimized for the 216
> gray.
> What would work better is to determine the maximum shine and shadow
> color based on the current bg color and then place all other tints
> between those. I believe that would give better results to make the
> maximum shine/shadow colors a fixed (scaled) brightness away from the
IIRC ZETA (well, Dano0) uses shine and shadow colors in tints, it's
visible when you set them to red or some other one.
Fran?ois.
From mmlr at mail.berlios.de Mon Feb 16 17:44:53 2009
From: mmlr at mail.berlios.de (mmlr at mail.berlios.de)
Date: Mon, 16 Feb 2009 17:44:53 +0100
Subject: [Haiku-commits] r29236 - haiku/trunk/src/servers/net
Message-ID: <200902161644.n1GGirLG031157@sheep.berlios.de>
Author: mmlr
Date: 2009-02-16 17:44:51 +0100 (Mon, 16 Feb 2009)
New Revision: 29236
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29236&view=rev
Modified:
haiku/trunk/src/servers/net/AutoconfigLooper.cpp
Log:
Fix the build.
Modified: haiku/trunk/src/servers/net/AutoconfigLooper.cpp
===================================================================
--- haiku/trunk/src/servers/net/AutoconfigLooper.cpp 2009-02-16 13:57:31 UTC (rev 29235)
+++ haiku/trunk/src/servers/net/AutoconfigLooper.cpp 2009-02-16 16:44:51 UTC (rev 29236)
@@ -69,7 +69,7 @@
if (ioctl(socket, SIOCGIFFLAGS, &request, sizeof(struct ifreq)) == 0) {
request.ifr_flags |= IFF_CONFIGURING;
- ioctl(socket, SIOCSIFFLAGS, &request, sizeof(struct ifreq)));
+ ioctl(socket, SIOCSIFFLAGS, &request, sizeof(struct ifreq));
}
// remove current handler
From axeld at pinc-software.de Mon Feb 16 17:54:21 2009
From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=)
Date: Mon, 16 Feb 2009 17:54:21 +0100 CET
Subject: [Haiku-commits] r29214 - in haiku/trunk: headers/os/interface
src/apps/gradients src/apps/icon-o-matic/gui
src/apps/icon-o-matic/import_export/flat_icon
src/apps/icon-o-matic/import_export/svg src/kits/app src/kits/interface
src/libs/icon/style src/servers/app src/servers/app/drawing
src/servers/app/drawing/Painter
In-Reply-To: <20090215165509.673.2@bepc.1234711087.fake>
Message-ID: <34660281485-BeMail@zon>
Stephan Assmus wrote:
> Axel D?rfler wrote:
> > Enumerations and dumb classes (like rgb_color) are usually in lower
> > case
> > throughout our current API.
> > Of course we could change this, but until we do so, I wouldn't make
> > those
> > changes.
> I know, but this is an internal type, although public to the outside.
> The
> Be API never did make use of these sub-types AFAIR. So this being a
> new
> class/API, I thought I'd go ahead and stop this ugliness. I don't
> know why
> there needs to be a distinction between structs and classes in the
> naming
> conventions and I have been annoyed more than once by stuff like
> "enum
> orientation orientation" or "orientation o". I hope we will change
> this
> when cleaning the API at some point. I know this day is not today,
> but
> might as well start doing it for new API, no?
Fine by me, I just wanted to mention it for the sake of consistency :-)
Bye,
Axel.
From axeld at pinc-software.de Mon Feb 16 20:00:09 2009
From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=)
Date: Mon, 16 Feb 2009 20:00:09 +0100 CET
Subject: [Haiku-commits] r29236 - haiku/trunk/src/servers/net
In-Reply-To: <200902161644.n1GGirLG031157@sheep.berlios.de>
Message-ID: <42208261353-BeMail@zon>
mmlr at mail.berlios.de wrote:
> Log:
> Fix the build.
Thanks; I removed some debug output, and didn't notice the extra
parenthesis, sorry.
Bye,
Axel.
From korli at mail.berlios.de Mon Feb 16 20:09:34 2009
From: korli at mail.berlios.de (korli at BerliOS)
Date: Mon, 16 Feb 2009 20:09:34 +0100
Subject: [Haiku-commits] r29237 -
haiku/trunk/src/add-ons/kernel/drivers/audio/hda
Message-ID: <200902161909.n1GJ9YXA031400@sheep.berlios.de>
Author: korli
Date: 2009-02-16 20:09:34 +0100 (Mon, 16 Feb 2009)
New Revision: 29237
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29237&view=rev
Modified:
haiku/trunk/src/add-ons/kernel/drivers/audio/hda/hda_multi_audio.cpp
Log:
* fix get_mix()
* style improvements
Modified: haiku/trunk/src/add-ons/kernel/drivers/audio/hda/hda_multi_audio.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/drivers/audio/hda/hda_multi_audio.cpp 2009-02-16 16:44:51 UTC (rev 29236)
+++ haiku/trunk/src/add-ons/kernel/drivers/audio/hda/hda_multi_audio.cpp 2009-02-16 19:09:34 UTC (rev 29237)
@@ -461,16 +461,13 @@
static status_t
list_mix_controls(hda_audio_group* audioGroup, multi_mix_control_info* MMCI)
{
- multi_mix_control *MMC;
- uint32 i;
-
- MMC = MMCI->controls;
+ multi_mix_control *MMC = MMCI->controls;
if (MMCI->control_count < 24)
return B_ERROR;
if (hda_create_controls_list(audioGroup->multi) < B_OK)
return B_ERROR;
- for (i=0; imulti->control_count; i++) {
+ for (uint32 i = 0; imulti->control_count; i++) {
MMC[i] = audioGroup->multi->controls[i].mix_control;
}
@@ -516,10 +513,9 @@
static status_t
get_mix(hda_audio_group* audioGroup, multi_mix_value_info * MMVI)
{
- int32 i;
uint32 id;
hda_multi_mixer_control *control = NULL;
- for (i=0; i < MMVI->item_count; i++) {
+ for (int32 i = 0; i < MMVI->item_count; i++) {
id = MMVI->values[i].id - MULTI_CONTROL_FIRSTID;
if (id < 0 || id >= audioGroup->multi->control_count) {
dprintf("hda: get_mix : invalid control id requested : %li\n", id);
@@ -539,7 +535,7 @@
value = resp[0] & AMP_GAIN_MASK;
else
value = resp[1] & AMP_GAIN_MASK;
- MMVI->values[i].gain = (value - AMP_CAP_OFFSET(control->capabilities))
+ MMVI->values[i].gain = (0.0 + value - AMP_CAP_OFFSET(control->capabilities))
* AMP_CAP_STEP_SIZE(control->capabilities);
TRACE("get_mix: %ld gain: %f (%ld)\n", control->nid, MMVI->values[i].gain, value);
}
@@ -560,10 +556,9 @@
static status_t
set_mix(hda_audio_group* audioGroup, multi_mix_value_info * MMVI)
{
- int32 i;
uint32 id;
hda_multi_mixer_control *control = NULL;
- for (i=0; i < MMVI->item_count; i++) {
+ for (int32 i = 0; i < MMVI->item_count; i++) {
id = MMVI->values[i].id - MULTI_CONTROL_FIRSTID;
if (id < 0 || id >= audioGroup->multi->control_count) {
dprintf("set_mix : invalid control id requested : %li\n", id);
@@ -619,7 +614,7 @@
if (control->mix_control.master == MULTI_CONTROL_MASTERID)
control->gain = (uint32)(MMVI->values[i].gain / AMP_CAP_STEP_SIZE(control->capabilities)
- + AMP_CAP_OFFSET(control->capabilities));
+ + AMP_CAP_OFFSET(control->capabilities));
if (control2 && control2->mix_control.master != MULTI_CONTROL_MASTERID)
control2->gain = (uint32)(MMVI->values[i+1].gain / AMP_CAP_STEP_SIZE(control2->capabilities)
@@ -663,7 +658,7 @@
hda_send_verbs(audioGroup->codec, verb, NULL, control2 ? 2 : 1);
if (control2)
- i++;
+ i++;
}
/*if (control->mix_control.flags & B_MULTI_MIX_MUX && control->set) {
From axeld at pinc-software.de Mon Feb 16 23:09:44 2009
From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=)
Date: Mon, 16 Feb 2009 23:09:44 +0100 CET
Subject: [Haiku-commits]
=?utf-8?q?r29237_-_haiku/trunk/src/add-ons/kernel?=
=?utf-8?q?/drivers/audio/hda?=
In-Reply-To: <200902161909.n1GJ9YXA031400@sheep.berlios.de>
Message-ID: <53583363399-BeMail@zon>
korli at BerliOS wrote:
> + multi_mix_control *MMC = MMCI->controls;
How about lower case variable names? :-)
Bye,
Axel.
From dlmcpaul at gmail.com Mon Feb 16 23:58:40 2009
From: dlmcpaul at gmail.com (David McPaul)
Date: Tue, 17 Feb 2009 09:58:40 +1100
Subject: [Haiku-commits] r29237 -
haiku/trunk/src/add-ons/kernel/drivers/audio/hda
In-Reply-To: <53583363399-BeMail@zon>
References: <200902161909.n1GJ9YXA031400@sheep.berlios.de>
<53583363399-BeMail@zon>
Message-ID:
On 2009-02-17, Axel D?rfler wrote:
> korli at BerliOS wrote:
> > + multi_mix_control *MMC = MMCI->controls;
>
> How about lower case variable names? :-)
WAHHH!!! Leave Korli Alone! He is fixing all my HDA issues :-)
Go Korli Go.
--
Cheers
David
From korli at mail.berlios.de Tue Feb 17 00:05:57 2009
From: korli at mail.berlios.de (korli at BerliOS)
Date: Tue, 17 Feb 2009 00:05:57 +0100
Subject: [Haiku-commits] r29238 - in
haiku/trunk/src/add-ons/kernel/drivers/audio: ac97/auich
ac97/auvia ac97/geode echo emuxki hda
Message-ID: <200902162305.n1GN5vub029252@sheep.berlios.de>
Author: korli
Date: 2009-02-17 00:05:54 +0100 (Tue, 17 Feb 2009)
New Revision: 29238
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29238&view=rev
Modified:
haiku/trunk/src/add-ons/kernel/drivers/audio/ac97/auich/auich.c
haiku/trunk/src/add-ons/kernel/drivers/audio/ac97/auich/multi.c
haiku/trunk/src/add-ons/kernel/drivers/audio/ac97/auvia/auvia.c
haiku/trunk/src/add-ons/kernel/drivers/audio/ac97/auvia/io.c
haiku/trunk/src/add-ons/kernel/drivers/audio/ac97/auvia/multi.c
haiku/trunk/src/add-ons/kernel/drivers/audio/ac97/geode/geode_multi.cpp
haiku/trunk/src/add-ons/kernel/drivers/audio/echo/echo.cpp
haiku/trunk/src/add-ons/kernel/drivers/audio/echo/multi.cpp
haiku/trunk/src/add-ons/kernel/drivers/audio/emuxki/emuxki.c
haiku/trunk/src/add-ons/kernel/drivers/audio/emuxki/multi.c
haiku/trunk/src/add-ons/kernel/drivers/audio/hda/hda_multi_audio.cpp
Log:
* some style improvements again (ie lower case variables as pointed by Axel)
Modified: haiku/trunk/src/add-ons/kernel/drivers/audio/ac97/auich/auich.c
===================================================================
--- haiku/trunk/src/add-ons/kernel/drivers/audio/ac97/auich/auich.c 2009-02-16 19:09:34 UTC (rev 29237)
+++ haiku/trunk/src/add-ons/kernel/drivers/audio/ac97/auich/auich.c 2009-02-16 23:05:54 UTC (rev 29238)
@@ -210,7 +210,7 @@
page = stream->dmaops_log_base;
- for (i=0; i < AUICH_DMALIST_MAX; i++) {
+ for (i = 0; i < AUICH_DMALIST_MAX; i++) {
page[2*i] = ((uint32)stream->buffer->phy_base) +
(i % stream->bufcount) * stream->blksize;
page[2*i + 1] = AUICH_DMAF_IOC | (stream->blksize
Modified: haiku/trunk/src/add-ons/kernel/drivers/audio/ac97/auich/multi.c
===================================================================
--- haiku/trunk/src/add-ons/kernel/drivers/audio/ac97/auich/multi.c 2009-02-16 19:09:34 UTC (rev 29237)
+++ haiku/trunk/src/add-ons/kernel/drivers/audio/ac97/auich/multi.c 2009-02-16 23:05:54 UTC (rev 29238)
@@ -206,7 +206,7 @@
count = source_info_size;
//Note that we ignore first item in source_info
//It's for recording, but do match this with ac97.c's source_info
- for (i=1; i < count ; i++) {
+ for (i = 1; i < count ; i++) {
info = &source_info[i];
PRINT(("name : %s\n", info->name));
@@ -387,12 +387,12 @@
static status_t
-auich_get_mix(auich_dev *card, multi_mix_value_info * MMVI)
+auich_get_mix(auich_dev *card, multi_mix_value_info * mmvi)
{
int32 i, id;
multi_mixer_control *control = NULL;
- for (i=0; iitem_count; i++) {
- id = MMVI->values[i].id - EMU_MULTI_CONTROL_FIRSTID;
+ for (i = 0; i < mmvi->item_count; i++) {
+ id = mmvi->values[i].id - EMU_MULTI_CONTROL_FIRSTID;
if (id < 0 || id >= card->multi.control_count) {
PRINT(("auich_get_mix : invalid control id requested : %li\n", id));
continue;
@@ -404,22 +404,22 @@
float values[2];
control->get(card, control->cookie, control->type, values);
if (control->mix_control.master == EMU_MULTI_CONTROL_MASTERID)
- MMVI->values[i].u.gain = values[0];
+ mmvi->values[i].u.gain = values[0];
else
- MMVI->values[i].u.gain = values[1];
+ mmvi->values[i].u.gain = values[1];
}
}
if (control->mix_control.flags & B_MULTI_MIX_ENABLE && control->get) {
float values[1];
control->get(card, control->cookie, control->type, values);
- MMVI->values[i].u.enable = (values[0] == 1.0);
+ mmvi->values[i].u.enable = (values[0] == 1.0);
}
if (control->mix_control.flags & B_MULTI_MIX_MUX && control->get) {
float values[1];
control->get(card, control->cookie, control->type, values);
- MMVI->values[i].u.mux = (int32)values[0];
+ mmvi->values[i].u.mux = (int32)values[0];
}
}
return B_OK;
@@ -427,12 +427,12 @@
static status_t
-auich_set_mix(auich_dev *card, multi_mix_value_info * MMVI)
+auich_set_mix(auich_dev *card, multi_mix_value_info * mmvi)
{
int32 i, id;
multi_mixer_control *control = NULL;
- for (i=0; iitem_count; i++) {
- id = MMVI->values[i].id - EMU_MULTI_CONTROL_FIRSTID;
+ for (i = 0; i < mmvi->item_count; i++) {
+ id = mmvi->values[i].id - EMU_MULTI_CONTROL_FIRSTID;
if (id < 0 || id >= card->multi.control_count) {
PRINT(("auich_set_mix : invalid control id requested : %li\n", id));
continue;
@@ -441,8 +441,8 @@
if (control->mix_control.flags & B_MULTI_MIX_GAIN) {
multi_mixer_control *control2 = NULL;
- if (i+1item_count) {
- id = MMVI->values[i + 1].id - EMU_MULTI_CONTROL_FIRSTID;
+ if (i+1item_count) {
+ id = mmvi->values[i + 1].id - EMU_MULTI_CONTROL_FIRSTID;
if (id < 0 || id >= card->multi.control_count) {
PRINT(("auich_set_mix : invalid control id requested : %li\n", id));
} else {
@@ -458,12 +458,12 @@
values[1] = 0.0;
if (control->mix_control.master == EMU_MULTI_CONTROL_MASTERID)
- values[0] = MMVI->values[i].u.gain;
+ values[0] = mmvi->values[i].u.gain;
else
- values[1] = MMVI->values[i].u.gain;
+ values[1] = mmvi->values[i].u.gain;
if (control2 && control2->mix_control.master != EMU_MULTI_CONTROL_MASTERID)
- values[1] = MMVI->values[i+1].u.gain;
+ values[1] = mmvi->values[i+1].u.gain;
control->set(card, control->cookie, control->type, values);
}
@@ -475,14 +475,14 @@
if (control->mix_control.flags & B_MULTI_MIX_ENABLE && control->set) {
float values[1];
- values[0] = MMVI->values[i].u.enable ? 1.0 : 0.0;
+ values[0] = mmvi->values[i].u.enable ? 1.0 : 0.0;
control->set(card, control->cookie, control->type, values);
}
if (control->mix_control.flags & B_MULTI_MIX_MUX && control->set) {
float values[1];
- values[0] = (float)MMVI->values[i].u.mux;
+ values[0] = (float)mmvi->values[i].u.mux;
control->set(card, control->cookie, control->type, values);
}
}
@@ -491,22 +491,22 @@
static status_t
-auich_list_mix_controls(auich_dev *card, multi_mix_control_info * MMCI)
+auich_list_mix_controls(auich_dev *card, multi_mix_control_info * mmci)
{
- multi_mix_control *MMC;
+ multi_mix_control *mmc;
int32 i;
- MMC = MMCI->controls;
- if (MMCI->control_count < 24)
+ mmc = mmci->controls;
+ if (mmci->control_count < 24)
return B_ERROR;
if (auich_create_controls_list(&card->multi) < B_OK)
return B_ERROR;
- for (i=0; imulti.control_count; i++) {
- MMC[i] = card->multi.controls[i].mix_control;
+ for (i = 0; i < card->multi.control_count; i++) {
+ mmc[i] = card->multi.controls[i].mix_control;
}
- MMCI->control_count = card->multi.control_count;
+ mmci->control_count = card->multi.control_count;
return B_OK;
}
@@ -586,7 +586,7 @@
else
designations = B_CHANNEL_SURROUND_BUS;
- for (i=0; ichannels; i++) {
+ for (i = 0; i < stream->channels; i++) {
chans[index].channel_id = index;
chans[index].kind = (mode == AUICH_USE_PLAY) ? B_MULTI_OUTPUT_CHANNEL : B_MULTI_INPUT_CHANNEL;
chans[index].designations = designations | chan_designations[i];
@@ -794,7 +794,7 @@
if (bufcount > data->request_playback_buffers)
bufcount = data->request_playback_buffers;
- for (i=0; ipstream, j, i,
&data->playback_buffers[i][j].base,
@@ -808,7 +808,7 @@
if (bufcount > data->request_record_buffers)
bufcount = data->request_record_buffers;
- for (i=0; irstream, j, i,
&data->record_buffers[i][j].base,
Modified: haiku/trunk/src/add-ons/kernel/drivers/audio/ac97/auvia/auvia.c
===================================================================
--- haiku/trunk/src/add-ons/kernel/drivers/audio/ac97/auvia/auvia.c 2009-02-16 19:09:34 UTC (rev 29237)
+++ haiku/trunk/src/add-ons/kernel/drivers/audio/ac97/auvia/auvia.c 2009-02-16 23:05:54 UTC (rev 29238)
@@ -162,7 +162,7 @@
page = stream->dmaops_log_base;
- for(i=0; ibufcount; i++) {
+ for(i = 0; i < stream->bufcount; i++) {
page[2*i] = ((uint32)stream->buffer->phy_base) +
i * stream->blksize;
page[2*i + 1] = AUVIA_DMAOP_FLAG | stream->blksize;
Modified: haiku/trunk/src/add-ons/kernel/drivers/audio/ac97/auvia/io.c
===================================================================
--- haiku/trunk/src/add-ons/kernel/drivers/audio/ac97/auvia/io.c 2009-02-16 19:09:34 UTC (rev 29237)
+++ haiku/trunk/src/add-ons/kernel/drivers/audio/ac97/auvia/io.c 2009-02-16 23:05:54 UTC (rev 29238)
@@ -83,7 +83,7 @@
int i;
/* poll until codec not busy */
- for(i=0; (iread_io_32(config->nabmbar
+ for(i = 0; (i < AUVIA_TIMEOUT) && (pci->read_io_32(config->nabmbar
+ AUVIA_CODEC_CTL) & AUVIA_CODEC_BUSY) ; i++)
spin(1);
if(i>=AUVIA_TIMEOUT) {
@@ -99,7 +99,7 @@
int i;
/* poll until codec valid */
- for(i=0; (iread_io_32(config->nabmbar
+ for(i = 0; (i < AUVIA_TIMEOUT) && !(pci->read_io_32(config->nabmbar
+ AUVIA_CODEC_CTL) & AUVIA_CODEC_PRIVALID) ; i++)
spin(1);
if(i>=AUVIA_TIMEOUT) {
Modified: haiku/trunk/src/add-ons/kernel/drivers/audio/ac97/auvia/multi.c
===================================================================
--- haiku/trunk/src/add-ons/kernel/drivers/audio/ac97/auvia/multi.c 2009-02-16 19:09:34 UTC (rev 29237)
+++ haiku/trunk/src/add-ons/kernel/drivers/audio/ac97/auvia/multi.c 2009-02-16 23:05:54 UTC (rev 29238)
@@ -309,7 +309,7 @@
count = source_info_size;
count--;
- for(i=1; i < count ; i++) {
+ for(i = 1; i < count ; i++) {
info = &source_info[i];
PRINT(("name : %s\n", info->name));
@@ -386,12 +386,12 @@
}
static status_t
-auvia_get_mix(auvia_dev *card, multi_mix_value_info * MMVI)
+auvia_get_mix(auvia_dev *card, multi_mix_value_info * mmvi)
{
int32 i, id;
multi_mixer_control *control = NULL;
- for(i=0; iitem_count; i++) {
- id = MMVI->values[i].id - EMU_MULTI_CONTROL_FIRSTID;
+ for(i = 0; i < mmvi->item_count; i++) {
+ id = mmvi->values[i].id - EMU_MULTI_CONTROL_FIRSTID;
if(id < 0 || id >= card->multi.control_count) {
PRINT(("auvia_get_mix : invalid control id requested : %li\n", id));
continue;
@@ -403,34 +403,34 @@
float values[2];
control->get(card, control->cookie, control->type, values);
if(control->mix_control.master == EMU_MULTI_CONTROL_MASTERID)
- MMVI->values[i].u.gain = values[0];
+ mmvi->values[i].u.gain = values[0];
else
- MMVI->values[i].u.gain = values[1];
+ mmvi->values[i].u.gain = values[1];
}
}
if(control->mix_control.flags & B_MULTI_MIX_ENABLE && control->get) {
float values[1];
control->get(card, control->cookie, control->type, values);
- MMVI->values[i].u.enable = (values[0] == 1.0);
+ mmvi->values[i].u.enable = (values[0] == 1.0);
}
if(control->mix_control.flags & B_MULTI_MIX_MUX && control->get) {
float values[1];
control->get(card, control->cookie, control->type, values);
- MMVI->values[i].u.mux = (int32)values[0];
+ mmvi->values[i].u.mux = (int32)values[0];
}
}
return B_OK;
}
static status_t
-auvia_set_mix(auvia_dev *card, multi_mix_value_info * MMVI)
+auvia_set_mix(auvia_dev *card, multi_mix_value_info * mmvi)
{
int32 i, id;
multi_mixer_control *control = NULL;
- for(i=0; iitem_count; i++) {
- id = MMVI->values[i].id - EMU_MULTI_CONTROL_FIRSTID;
+ for(i = 0; i < mmvi->item_count; i++) {
+ id = mmvi->values[i].id - EMU_MULTI_CONTROL_FIRSTID;
if(id < 0 || id >= card->multi.control_count) {
PRINT(("auvia_set_mix : invalid control id requested : %li\n", id));
continue;
@@ -439,8 +439,8 @@
if(control->mix_control.flags & B_MULTI_MIX_GAIN) {
multi_mixer_control *control2 = NULL;
- if(i+1item_count) {
- id = MMVI->values[i + 1].id - EMU_MULTI_CONTROL_FIRSTID;
+ if(i+1item_count) {
+ id = mmvi->values[i + 1].id - EMU_MULTI_CONTROL_FIRSTID;
if(id < 0 || id >= card->multi.control_count) {
PRINT(("auvia_set_mix : invalid control id requested : %li\n", id));
} else {
@@ -456,12 +456,12 @@
values[1] = 0.0;
if(control->mix_control.master == EMU_MULTI_CONTROL_MASTERID)
- values[0] = MMVI->values[i].u.gain;
+ values[0] = mmvi->values[i].u.gain;
else
- values[1] = MMVI->values[i].u.gain;
+ values[1] = mmvi->values[i].u.gain;
if(control2 && control2->mix_control.master != EMU_MULTI_CONTROL_MASTERID)
- values[1] = MMVI->values[i+1].u.gain;
+ values[1] = mmvi->values[i+1].u.gain;
control->set(card, control->cookie, control->type, values);
}
@@ -473,14 +473,14 @@
if(control->mix_control.flags & B_MULTI_MIX_ENABLE && control->set) {
float values[1];
- values[0] = MMVI->values[i].u.enable ? 1.0 : 0.0;
+ values[0] = mmvi->values[i].u.enable ? 1.0 : 0.0;
control->set(card, control->cookie, control->type, values);
}
if(control->mix_control.flags & B_MULTI_MIX_MUX && control->set) {
float values[1];
- values[0] = (float)MMVI->values[i].u.mux;
+ values[0] = (float)mmvi->values[i].u.mux;
control->set(card, control->cookie, control->type, values);
}
}
@@ -488,22 +488,22 @@
}
static status_t
-auvia_list_mix_controls(auvia_dev *card, multi_mix_control_info * MMCI)
+auvia_list_mix_controls(auvia_dev *card, multi_mix_control_info * mmci)
{
- multi_mix_control *MMC;
+ multi_mix_control *mmc;
int32 i;
- MMC = MMCI->controls;
- if(MMCI->control_count < 24)
+ mmc = mmci->controls;
+ if(mmci->control_count < 24)
return B_ERROR;
if(auvia_create_controls_list(&card->multi) < B_OK)
return B_ERROR;
- for(i=0; imulti.control_count; i++) {
- MMC[i] = card->multi.controls[i].mix_control;
+ for(i = 0; i < card->multi.control_count; i++) {
+ mmc[i] = card->multi.controls[i].mix_control;
}
- MMCI->control_count = card->multi.control_count;
+ mmci->control_count = card->multi.control_count;
return B_OK;
}
@@ -581,7 +581,7 @@
else
designations = B_CHANNEL_SURROUND_BUS;
- for(i=0; ichannels; i++) {
+ for(i = 0; i < stream->channels; i++) {
chans[index].channel_id = index;
chans[index].kind = (mode == AUVIA_USE_PLAY) ? B_MULTI_OUTPUT_CHANNEL : B_MULTI_INPUT_CHANNEL;
chans[index].designations = designations | chan_designations[i];
@@ -794,7 +794,7 @@
data->return_playback_channels = pchannels; /* playback_buffers[][c] */
data->return_playback_buffer_size = BUFFER_FRAMES; /* frames */
- for(i=0; ipstream, j, i,
&data->playback_buffers[i][j].base,
@@ -804,7 +804,7 @@
data->return_record_channels = rchannels;
data->return_record_buffer_size = BUFFER_FRAMES; /* frames */
- for(i=0; irstream, j, i,
&data->record_buffers[i][j].base,
Modified: haiku/trunk/src/add-ons/kernel/drivers/audio/ac97/geode/geode_multi.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/drivers/audio/ac97/geode/geode_multi.cpp 2009-02-16 19:09:34 UTC (rev 29237)
+++ haiku/trunk/src/add-ons/kernel/drivers/audio/ac97/geode/geode_multi.cpp 2009-02-16 23:05:54 UTC (rev 29238)
@@ -344,7 +344,7 @@
count = source_info_size;
//Note that we ignore first item in source_info
//It's for recording, but do match this with ac97.c's source_info
- for (i=1; i < count ; i++) {
+ for (i = 1; i < count ; i++) {
info = &source_info[i];
TRACE("name : %s\n", info->name);
@@ -525,19 +525,19 @@
static status_t
-list_mix_controls(geode_controller* controller, multi_mix_control_info* MMCI)
+list_mix_controls(geode_controller* controller, multi_mix_control_info* mmci)
{
- multi_mix_control* MMC = MMCI->controls;
- if (MMCI->control_count < 24)
+ multi_mix_control* mmc = mmci->controls;
+ if (mmci->control_count < 24)
return B_ERROR;
if (create_controls_list(controller->multi) < B_OK)
return B_ERROR;
for (uint32 i = 0; i < controller->multi->control_count; i++) {
- MMC[i] = controller->multi->controls[i].mix_control;
+ mmc[i] = controller->multi->controls[i].mix_control;
}
- MMCI->control_count = controller->multi->control_count;
+ mmci->control_count = controller->multi->control_count;
return B_OK;
}
@@ -559,10 +559,10 @@
static status_t
-get_mix(geode_controller *controller, multi_mix_value_info * MMVI)
+get_mix(geode_controller *controller, multi_mix_value_info * mmvi)
{
- for (int32 i = 0; i < MMVI->item_count; i++) {
- uint32 id = MMVI->values[i].id - MULTI_CONTROL_FIRSTID;
+ for (int32 i = 0; i < mmvi->item_count; i++) {
+ uint32 id = mmvi->values[i].id - MULTI_CONTROL_FIRSTID;
if (id < 0 || id >= controller->multi->control_count) {
dprintf("geode_get_mix : invalid control id requested : %li\n", id);
continue;
@@ -574,22 +574,22 @@
float values[2];
control->get(controller, control->cookie, control->type, values);
if (control->mix_control.master == MULTI_CONTROL_MASTERID)
- MMVI->values[i].gain = values[0];
+ mmvi->values[i].gain = values[0];
else
- MMVI->values[i].gain = values[1];
+ mmvi->values[i].gain = values[1];
}
}
if (control->mix_control.flags & B_MULTI_MIX_ENABLE && control->get) {
float values[1];
control->get(controller, control->cookie, control->type, values);
- MMVI->values[i].enable = (values[0] == 1.0);
+ mmvi->values[i].enable = (values[0] == 1.0);
}
if (control->mix_control.flags & B_MULTI_MIX_MUX && control->get) {
float values[1];
control->get(controller, control->cookie, control->type, values);
- MMVI->values[i].mux = (int32)values[0];
+ mmvi->values[i].mux = (int32)values[0];
}
}
return B_OK;
@@ -597,11 +597,11 @@
static status_t
-set_mix(geode_controller *controller, multi_mix_value_info * MMVI)
+set_mix(geode_controller *controller, multi_mix_value_info * mmvi)
{
geode_multi *multi = controller->multi;
- for (int32 i = 0; i < MMVI->item_count; i++) {
- uint32 id = MMVI->values[i].id - MULTI_CONTROL_FIRSTID;
+ for (int32 i = 0; i < mmvi->item_count; i++) {
+ uint32 id = mmvi->values[i].id - MULTI_CONTROL_FIRSTID;
if (id < 0 || id >= multi->control_count) {
dprintf("geode_set_mix : invalid control id requested : %li\n", id);
continue;
@@ -610,8 +610,8 @@
if (control->mix_control.flags & B_MULTI_MIX_GAIN) {
multi_mixer_control *control2 = NULL;
- if (i+1item_count) {
- id = MMVI->values[i + 1].id - MULTI_CONTROL_FIRSTID;
+ if (i+1item_count) {
+ id = mmvi->values[i + 1].id - MULTI_CONTROL_FIRSTID;
if (id < 0 || id >= multi->control_count) {
dprintf("geode_set_mix : invalid control id requested : %li\n", id);
} else {
@@ -627,12 +627,12 @@
values[1] = 0.0;
if (control->mix_control.master == MULTI_CONTROL_MASTERID)
- values[0] = MMVI->values[i].gain;
+ values[0] = mmvi->values[i].gain;
else
- values[1] = MMVI->values[i].gain;
+ values[1] = mmvi->values[i].gain;
if (control2 && control2->mix_control.master != MULTI_CONTROL_MASTERID)
- values[1] = MMVI->values[i+1].gain;
+ values[1] = mmvi->values[i+1].gain;
control->set(controller, control->cookie, control->type, values);
}
@@ -644,14 +644,14 @@
if (control->mix_control.flags & B_MULTI_MIX_ENABLE && control->set) {
float values[1];
- values[0] = MMVI->values[i].enable ? 1.0 : 0.0;
+ values[0] = mmvi->values[i].enable ? 1.0 : 0.0;
control->set(controller, control->cookie, control->type, values);
}
if (control->mix_control.flags & B_MULTI_MIX_MUX && control->set) {
float values[1];
- values[0] = (float)MMVI->values[i].mux;
+ values[0] = (float)mmvi->values[i].mux;
control->set(controller, control->cookie, control->type, values);
}
}
Modified: haiku/trunk/src/add-ons/kernel/drivers/audio/echo/echo.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/drivers/audio/echo/echo.cpp 2009-02-16 19:09:34 UTC (rev 29237)
+++ haiku/trunk/src/add-ons/kernel/drivers/audio/echo/echo.cpp 2009-02-16 23:05:54 UTC (rev 29238)
@@ -262,7 +262,7 @@
uint32 dwNumFreeEntries = 0;
- for (i=0; ibufcount; i++) {
+ for (i = 0; i < stream->bufcount; i++) {
duck->AddMapping(((uint32)stream->buffer->phy_base) +
i * stream->blksize, stream->blksize, 0, TRUE, dwNumFreeEntries);
}
Modified: haiku/trunk/src/add-ons/kernel/drivers/audio/echo/multi.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/drivers/audio/echo/multi.cpp 2009-02-16 19:09:34 UTC (rev 29237)
+++ haiku/trunk/src/add-ons/kernel/drivers/audio/echo/multi.cpp 2009-02-16 23:05:54 UTC (rev 29238)
@@ -221,7 +221,7 @@
MIXER_AUDIO_CHANNEL channel;
channel.wCardId = 0;
channel.dwType = ECHO_BUS_OUT;
- for (i=0; i < card->caps.wNumBussesOut / 2; i++) {
+ for (i = 0; i < card->caps.wNumBussesOut / 2; i++) {
channel.wChannel = i * 2;
parent2 = echo_create_group_control(multi, &index, parent, S_null, "Output");
@@ -232,7 +232,7 @@
parent = echo_create_group_control(multi, &index, 0, S_INPUT, NULL);
channel.dwType = ECHO_BUS_IN;
- for (i=0; i < card->caps.wNumBussesIn / 2; i++) {
+ for (i = 0; i < card->caps.wNumBussesIn / 2; i++) {
channel.wChannel = i * 2;
parent2 = echo_create_group_control(multi, &index, parent, S_null, "Input");
@@ -247,13 +247,13 @@
}
static status_t
-echo_get_mix(echo_dev *card, multi_mix_value_info * MMVI)
+echo_get_mix(echo_dev *card, multi_mix_value_info * mmvi)
{
int32 i;
uint32 id;
multi_mixer_control *control = NULL;
- for (i=0; iitem_count; i++) {
- id = MMVI->values[i].id - MULTI_CONTROL_FIRSTID;
+ for (i = 0; i < mmvi->item_count; i++) {
+ id = mmvi->values[i].id - MULTI_CONTROL_FIRSTID;
if (id < 0 || id >= card->multi.control_count) {
PRINT(("echo_get_mix : invalid control id requested : %li\n", id));
continue;
@@ -265,22 +265,22 @@
float values[2];
control->get(card, control->channel, control->type, values);
if (control->mix_control.master == MULTI_CONTROL_MASTERID)
- MMVI->values[i].gain = values[0];
+ mmvi->values[i].gain = values[0];
else
- MMVI->values[i].gain = values[1];
+ mmvi->values[i].gain = values[1];
}
}
if (control->mix_control.flags & B_MULTI_MIX_ENABLE && control->get) {
float values[1];
control->get(card, control->channel, control->type, values);
- MMVI->values[i].enable = (values[0] == 1.0);
+ mmvi->values[i].enable = (values[0] == 1.0);
}
if (control->mix_control.flags & B_MULTI_MIX_MUX && control->get) {
float values[1];
control->get(card, control->channel, control->type, values);
- MMVI->values[i].mux = (int32)values[0];
+ mmvi->values[i].mux = (int32)values[0];
}
}
return B_OK;
@@ -288,13 +288,13 @@
static status_t
-echo_set_mix(echo_dev *card, multi_mix_value_info * MMVI)
+echo_set_mix(echo_dev *card, multi_mix_value_info * mmvi)
{
int32 i;
uint32 id;
multi_mixer_control *control = NULL;
- for (i=0; iitem_count; i++) {
- id = MMVI->values[i].id - MULTI_CONTROL_FIRSTID;
+ for (i = 0; i < mmvi->item_count; i++) {
+ id = mmvi->values[i].id - MULTI_CONTROL_FIRSTID;
if (id < 0 || id >= card->multi.control_count) {
PRINT(("echo_set_mix : invalid control id requested : %li\n", id));
continue;
@@ -303,8 +303,8 @@
if (control->mix_control.flags & B_MULTI_MIX_GAIN) {
multi_mixer_control *control2 = NULL;
- if (i+1item_count) {
- id = MMVI->values[i + 1].id - MULTI_CONTROL_FIRSTID;
+ if (i+1item_count) {
+ id = mmvi->values[i + 1].id - MULTI_CONTROL_FIRSTID;
if (id < 0 || id >= card->multi.control_count) {
PRINT(("echo_set_mix : invalid control id requested : %li\n", id));
} else {
@@ -320,12 +320,12 @@
values[1] = 0.0;
if (control->mix_control.master == MULTI_CONTROL_MASTERID)
- values[0] = MMVI->values[i].gain;
+ values[0] = mmvi->values[i].gain;
else
- values[1] = MMVI->values[i].gain;
+ values[1] = mmvi->values[i].gain;
if (control2 && control2->mix_control.master != MULTI_CONTROL_MASTERID)
- values[1] = MMVI->values[i+1].gain;
+ values[1] = mmvi->values[i+1].gain;
control->set(card, control->channel, control->type, values);
}
@@ -337,14 +337,14 @@
if (control->mix_control.flags & B_MULTI_MIX_ENABLE && control->set) {
float values[1];
- values[0] = MMVI->values[i].enable ? 1.0 : 0.0;
+ values[0] = mmvi->values[i].enable ? 1.0 : 0.0;
control->set(card, control->channel, control->type, values);
}
if (control->mix_control.flags & B_MULTI_MIX_MUX && control->set) {
float values[1];
- values[0] = (float)MMVI->values[i].mux;
+ values[0] = (float)mmvi->values[i].mux;
control->set(card, control->channel, control->type, values);
}
}
@@ -353,22 +353,22 @@
static status_t
-echo_list_mix_controls(echo_dev *card, multi_mix_control_info * MMCI)
+echo_list_mix_controls(echo_dev *card, multi_mix_control_info * mmci)
{
- multi_mix_control *MMC;
+ multi_mix_control *mmc;
uint32 i;
- MMC = MMCI->controls;
- if (MMCI->control_count < 24)
+ mmc = mmci->controls;
+ if (mmci->control_count < 24)
return B_ERROR;
if (echo_create_controls_list(&card->multi) < B_OK)
return B_ERROR;
- for (i=0; imulti.control_count; i++) {
- MMC[i] = card->multi.controls[i].mix_control;
+ for (i = 0; i < card->multi.control_count; i++) {
+ mmc[i] = card->multi.controls[i].mix_control;
}
- MMCI->control_count = card->multi.control_count;
+ mmci->control_count = card->multi.control_count;
return B_OK;
}
@@ -449,7 +449,7 @@
else
designations = B_CHANNEL_SURROUND_BUS;
- for (i=0; ichannels; i++) {
+ for (i = 0; i < stream->channels; i++) {
chans[index].channel_id = index;
chans[index].kind = (mode == ECHO_USE_PLAY) ? B_MULTI_OUTPUT_CHANNEL : B_MULTI_INPUT_CHANNEL;
chans[index].designations = designations | chan_designations[i];
@@ -645,7 +645,7 @@
if (data->request_playback_channels < data->return_playback_channels) {
LOG(("not enough channels\n"));
}
- for (i=0; ichannels; j++)
echo_stream_get_nth_buffer(stream, j, i,
&data->playback_buffers[i][channels+j].base,
@@ -665,7 +665,7 @@
if (data->request_record_channels < data->return_record_channels) {
LOG(("not enough channels\n"));
}
- for (i=0; ichannels; j++)
echo_stream_get_nth_buffer(stream, j, i,
&data->record_buffers[i][channels+j].base,
@@ -926,7 +926,7 @@
}
}
#else
- for (i=0; ib16 + 1;
frame_size = sample_size * (stream->stereo ? 2 : 1);
- for (i=0; iuse, i);
if (voice) {
if (!stream->first_voice)
@@ -1709,15 +1709,15 @@
case EMU_MIX_MUTE:
gpr->mute = (values[0] == 1.0);
if (gpr->mute) {
- for (i=0; iconfig, gpr->gpr + i, 0);
break;
}
- for (i=0; icurrent[i];
}
case EMU_MIX_GAIN:
- for (i=0; igpr->max_gain || values[i]min_gain)
return;
index = (int32)(values[i] / gpr->granularity);
@@ -1746,7 +1746,7 @@
switch(type) {
case EMU_MIX_GAIN:
- for (i=0; icurrent[i];
}
break;
Modified: haiku/trunk/src/add-ons/kernel/drivers/audio/emuxki/multi.c
===================================================================
--- haiku/trunk/src/add-ons/kernel/drivers/audio/emuxki/multi.c 2009-02-16 19:09:34 UTC (rev 29237)
+++ haiku/trunk/src/add-ons/kernel/drivers/audio/emuxki/multi.c 2009-02-16 23:05:54 UTC (rev 29238)
@@ -262,7 +262,7 @@
parent = emuxki_create_group_control(multi, &index, 0, 0, "Playback");
- for (i=EMU_GPR_FIRST_MIX; igpr_count; i++) {
+ for (i = EMU_GPR_FIRST_MIX; i < card->gpr_count; i++) {
const emuxki_gpr *gpr = &card->gpr[i];
if ((gpr->type & EMU_MIX_PLAYBACK) == 0)
continue;
@@ -276,7 +276,7 @@
parent = emuxki_create_group_control(multi, &index, 0, 0, "Record");
- for (i=EMU_GPR_FIRST_MIX; igpr_count; i++) {
+ for (i = EMU_GPR_FIRST_MIX; i < card->gpr_count; i++) {
const emuxki_gpr *gpr = &card->gpr[i];
if ((gpr->type & EMU_MIX_RECORD) == 0)
continue;
@@ -401,7 +401,7 @@
if (!IS_LIVE_5_1(&card->config) && !IS_AUDIGY(&card->config))
count--;
- for (i=1; i < count ; i++) {
+ for (i = 1; i < count ; i++) {
info = &source_info[i];
PRINT(("name : %s\n", info->name));
@@ -520,13 +520,13 @@
}
static status_t
-emuxki_get_mix(emuxki_dev *card, multi_mix_value_info * MMVI)
+emuxki_get_mix(emuxki_dev *card, multi_mix_value_info * mmvi)
{
int32 i;
uint32 id;
multi_mixer_control *control = NULL;
- for (i=0; iitem_count; i++) {
- id = MMVI->values[i].id - EMU_MULTI_CONTROL_FIRSTID;
+ for (i = 0; i < mmvi->item_count; i++) {
+ id = mmvi->values[i].id - EMU_MULTI_CONTROL_FIRSTID;
if (id < 0 || id >= card->multi.control_count) {
PRINT(("emuxki_get_mix : invalid control id requested : %li\n", id));
continue;
@@ -538,35 +538,35 @@
float values[2];
control->get(card, control->cookie, control->type, values);
if (control->mix_control.master == EMU_MULTI_CONTROL_MASTERID)
- MMVI->values[i].u.gain = values[0];
+ mmvi->values[i].u.gain = values[0];
else
- MMVI->values[i].u.gain = values[1];
+ mmvi->values[i].u.gain = values[1];
}
}
if (control->mix_control.flags & B_MULTI_MIX_ENABLE && control->get) {
float values[1];
control->get(card, control->cookie, control->type, values);
- MMVI->values[i].u.enable = (values[0] == 1.0);
+ mmvi->values[i].u.enable = (values[0] == 1.0);
}
if (control->mix_control.flags & B_MULTI_MIX_MUX && control->get) {
float values[1];
control->get(card, control->cookie, control->type, values);
- MMVI->values[i].u.mux = (int32)values[0];
+ mmvi->values[i].u.mux = (int32)values[0];
}
}
return B_OK;
}
static status_t
-emuxki_set_mix(emuxki_dev *card, multi_mix_value_info * MMVI)
+emuxki_set_mix(emuxki_dev *card, multi_mix_value_info * mmvi)
{
int32 i;
uint32 id;
multi_mixer_control *control = NULL;
- for (i=0; iitem_count; i++) {
- id = MMVI->values[i].id - EMU_MULTI_CONTROL_FIRSTID;
+ for (i = 0; i < mmvi->item_count; i++) {
+ id = mmvi->values[i].id - EMU_MULTI_CONTROL_FIRSTID;
if (id < 0 || id >= card->multi.control_count) {
PRINT(("emuxki_set_mix : invalid control id requested : %li\n", id));
continue;
@@ -575,8 +575,8 @@
if (control->mix_control.flags & B_MULTI_MIX_GAIN) {
multi_mixer_control *control2 = NULL;
- if (i+1item_count) {
- id = MMVI->values[i + 1].id - EMU_MULTI_CONTROL_FIRSTID;
+ if (i+1item_count) {
+ id = mmvi->values[i + 1].id - EMU_MULTI_CONTROL_FIRSTID;
if (id < 0 || id >= card->multi.control_count) {
PRINT(("emuxki_set_mix : invalid control id requested : %li\n", id));
} else {
@@ -592,12 +592,12 @@
values[1] = 0.0;
if (control->mix_control.master == EMU_MULTI_CONTROL_MASTERID)
- values[0] = MMVI->values[i].u.gain;
+ values[0] = mmvi->values[i].u.gain;
else
- values[1] = MMVI->values[i].u.gain;
+ values[1] = mmvi->values[i].u.gain;
if (control2 && control2->mix_control.master != EMU_MULTI_CONTROL_MASTERID)
- values[1] = MMVI->values[i+1].u.gain;
+ values[1] = mmvi->values[i+1].u.gain;
control->set(card, control->cookie, control->type, values);
}
@@ -609,14 +609,14 @@
if (control->mix_control.flags & B_MULTI_MIX_ENABLE && control->set) {
float values[1];
- values[0] = MMVI->values[i].u.enable ? 1.0 : 0.0;
+ values[0] = mmvi->values[i].u.enable ? 1.0 : 0.0;
control->set(card, control->cookie, control->type, values);
}
if (control->mix_control.flags & B_MULTI_MIX_MUX && control->set) {
float values[1];
- values[0] = (float)MMVI->values[i].u.mux;
+ values[0] = (float)mmvi->values[i].u.mux;
control->set(card, control->cookie, control->type, values);
}
}
@@ -624,22 +624,22 @@
}
static status_t
-emuxki_list_mix_controls(emuxki_dev *card, multi_mix_control_info * MMCI)
+emuxki_list_mix_controls(emuxki_dev *card, multi_mix_control_info * mmci)
{
- multi_mix_control *MMC;
+ multi_mix_control *mmc;
uint32 i;
- MMC = MMCI->controls;
- if (MMCI->control_count < EMU_MULTICONTROLSNUM)
+ mmc = mmci->controls;
+ if (mmci->control_count < EMU_MULTICONTROLSNUM)
return B_ERROR;
if (emuxki_create_controls_list(&card->multi) < B_OK)
return B_ERROR;
- for (i=0; imulti.control_count; i++) {
- MMC[i] = card->multi.controls[i].mix_control;
+ for (i = 0; i < card->multi.control_count; i++) {
+ mmc[i] = card->multi.controls[i].mix_control;
}
- MMCI->control_count = card->multi.control_count;
+ mmci->control_count = card->multi.control_count;
return B_OK;
}
@@ -719,7 +719,7 @@
else
designations = B_CHANNEL_SURROUND_BUS;
- for (i=0; ireturn_playback_channels = pchannels + pchannels2; /* playback_buffers[][c] */
data->return_playback_buffer_size = current_settings.buffer_frames; /* frames */
- for (i=0; ipstream, j, i,
&data->playback_buffers[i][j].base,
&data->playback_buffers[i][j].stride);
- for (i=0; ipstream2, j, i,
&data->playback_buffers[i][pchannels + j].base,
@@ -937,13 +937,13 @@
data->return_record_channels = rchannels + rchannels2;
data->return_record_buffer_size = current_settings.buffer_frames; /* frames */
- for (i=0; irstream, j, i,
&data->record_buffers[i][j].base,
&data->record_buffers[i][j].stride);
- for (i=0; irstream2, j, i,
&data->record_buffers[i][rchannels + j].base,
Modified: haiku/trunk/src/add-ons/kernel/drivers/audio/hda/hda_multi_audio.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/drivers/audio/hda/hda_multi_audio.cpp 2009-02-16 19:09:34 UTC (rev 29237)
+++ haiku/trunk/src/add-ons/kernel/drivers/audio/hda/hda_multi_audio.cpp 2009-02-16 23:05:54 UTC (rev 29238)
@@ -459,19 +459,19 @@
[... truncated: 131 lines follow ...]
From mmlr at mail.berlios.de Tue Feb 17 03:06:01 2009
From: mmlr at mail.berlios.de (mmlr at mail.berlios.de)
Date: Tue, 17 Feb 2009 03:06:01 +0100
Subject: [Haiku-commits] r29239 -
haiku/trunk/src/add-ons/kernel/file_systems/overlay
Message-ID: <200902170206.n1H261Bx000801@sheep.berlios.de>
Author: mmlr
Date: 2009-02-17 03:05:58 +0100 (Tue, 17 Feb 2009)
New Revision: 29239
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29239&view=rev
Modified:
haiku/trunk/src/add-ons/kernel/file_systems/overlay/overlay.cpp
Log:
* Added create/write/remove/rename support for attributes to the overlay fs.
* Implemented writing attributes back to attribute files. Not tested or enabled.
* Fix reading attribute dirs, they need a separate cookie that links attribute
files to the dir index as multiple read-dirs could happen at the same time.
* Fix some obvious bugs in size calculations.
Modified: haiku/trunk/src/add-ons/kernel/file_systems/overlay/overlay.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/file_systems/overlay/overlay.cpp 2009-02-16 23:05:54 UTC (rev 29238)
+++ haiku/trunk/src/add-ons/kernel/file_systems/overlay/overlay.cpp 2009-02-17 02:05:58 UTC (rev 29239)
@@ -40,6 +40,12 @@
class AttributeEntry;
+struct attribute_dir_cookie {
+ AttributeFile * file;
+ uint32 index;
+};
+
+
class OverlayInode {
public:
OverlayInode(fs_volume *superVolume,
@@ -51,12 +57,14 @@
fs_volume * SuperVolume() { return fSuperVolume; }
fs_vnode * SuperVnode() { return &fSuperVnode; }
- AttributeFile * GetAttributeFile();
+ status_t GetAttributeFile(AttributeFile **attributeFile);
+ status_t WriteAttributeFile();
private:
fs_volume * fSuperVolume;
fs_vnode fSuperVnode;
AttributeFile * fAttributeFile;
+ bool fAttributeFileMissing;
};
@@ -68,19 +76,28 @@
status_t InitCheck() { return fStatus; }
dev_t VolumeID() { return fVolumeID; }
- ino_t ParentInode() { return fParentInode; }
+ ino_t FileInode() { return fFileInode; }
- uint32 CountAttributes();
- AttributeEntry * FindAttribute(const char *name);
+ status_t CreateEmpty();
+ status_t WriteAttributeFile(fs_volume *volume,
+ fs_vnode *vnode);
status_t ReadAttributeDir(struct dirent *dirent,
- size_t bufferSize, uint32 *numEntries);
- status_t RewindAttributeDir()
- {
- fAttributeDirIndex = 0;
- return B_OK;
- }
+ size_t bufferSize, uint32 *numEntries,
+ uint32 *index);
+ uint32 CountAttributes();
+ AttributeEntry * FindAttribute(const char *name,
+ uint32 *index = NULL);
+
+ status_t CreateAttribute(const char *name, type_code type,
+ int openMode, AttributeEntry **entry);
+ status_t OpenAttribute(const char *name, int openMode,
+ AttributeEntry **entry);
+ status_t RemoveAttribute(const char *name,
+ AttributeEntry **entry);
+ status_t AddAttribute(AttributeEntry *entry);
+
private:
#define ATTRIBUTE_OVERLAY_FILE_MAGIC 'attr'
#define ATTRIBUTE_OVERLAY_ATTRIBUTE_DIR_NAME "_HAIKU"
@@ -93,7 +110,10 @@
status_t fStatus;
dev_t fVolumeID;
- ino_t fParentInode;
+ ino_t fFileInode;
+ ino_t fDirectoryInode;
+ ino_t fAttributeDirInode;
+ ino_t fAttributeFileInode;
attribute_file * fFile;
uint32 fAttributeDirIndex;
AttributeEntry ** fEntries;
@@ -104,18 +124,36 @@
public:
AttributeEntry(AttributeFile *parent,
uint8 *buffer);
+ AttributeEntry(AttributeFile *parent,
+ const char *name, type_code type);
~AttributeEntry();
+ status_t InitCheck() { return fStatus; }
+
+ uint8 * Entry() { return (uint8 *)fEntry; }
size_t EntrySize();
+ uint8 * Data() { return fData; }
+ size_t DataSize() { return fEntry->size; }
+ status_t SetType(type_code type);
+ type_code Type() { return fEntry->type; }
+
+ status_t SetSize(size_t size);
+ uint32 Size() { return fEntry->size; }
+
+ status_t SetName(const char *name);
+ const char * Name() { return fEntry->name; }
uint8 NameLength() { return fEntry->name_length; }
- const char * Name() { return fEntry->name; }
status_t FillDirent(struct dirent *dirent,
size_t bufferSize, uint32 *numEntries);
status_t Read(off_t position, void *buffer, size_t *length);
+ status_t Write(off_t position, const void *buffer,
+ size_t *length);
+
status_t ReadStat(struct stat *stat);
+ status_t WriteStat(const struct stat *stat, uint32 statMask);
private:
struct attribute_entry {
@@ -128,6 +166,9 @@
AttributeFile * fParent;
attribute_entry * fEntry;
uint8 * fData;
+ status_t fStatus;
+ bool fAllocatedEntry;
+ bool fAllocatedData;
};
@@ -137,7 +178,8 @@
OverlayInode::OverlayInode(fs_volume *superVolume, fs_vnode *superVnode)
: fSuperVolume(superVolume),
fSuperVnode(*superVnode),
- fAttributeFile(NULL)
+ fAttributeFile(NULL),
+ fAttributeFileMissing(false)
{
TRACE("inode created\n");
}
@@ -157,32 +199,59 @@
}
-AttributeFile *
-OverlayInode::GetAttributeFile()
+status_t
+OverlayInode::GetAttributeFile(AttributeFile **attributeFile)
{
if (fAttributeFile == NULL) {
fAttributeFile = new(std::nothrow) AttributeFile(fSuperVolume,
&fSuperVnode);
if (fAttributeFile == NULL) {
TRACE_ALWAYS("no memory to allocate attribute file\n");
- return NULL;
+ return B_NO_MEMORY;
}
}
- if (fAttributeFile->InitCheck() != B_OK)
- return NULL;
+ status_t result = fAttributeFile->InitCheck();
+ if (result != B_OK) {
+ if (result == B_ENTRY_NOT_FOUND) {
+ // TODO: need to check if we're able to create the file
+ // but at least allow virtual attributes for now
+ }
- return fAttributeFile;
+ result = fAttributeFile->CreateEmpty();
+ if (result != B_OK)
+ return result;
+ }
+
+ *attributeFile = fAttributeFile;
+ return B_OK;
}
+status_t
+OverlayInode::WriteAttributeFile()
+{
+ if (fAttributeFile == NULL)
+ return B_NO_INIT;
+
+ status_t result = fAttributeFile->InitCheck();
+ if (result != B_OK)
+ return result;
+
+ return fAttributeFile->WriteAttributeFile(fSuperVolume, &fSuperVnode);
+}
+
+
// #pragma mark AttributeFile
AttributeFile::AttributeFile(fs_volume *volume, fs_vnode *vnode)
: fStatus(B_NO_INIT),
fVolumeID(volume->id),
- fParentInode(0),
+ fFileInode(0),
+ fDirectoryInode(0),
+ fAttributeDirInode(0),
+ fAttributeFileInode(0),
fFile(NULL),
fAttributeDirIndex(0),
fEntries(NULL)
@@ -211,7 +280,7 @@
struct stat stat;
if (vnode->ops->read_stat != NULL
&& vnode->ops->read_stat(volume, vnode, &stat) == B_OK) {
- fParentInode = stat.st_ino;
+ fFileInode = stat.st_ino;
}
// TODO: the ".." lookup is not actually valid for non-directory vnodes.
@@ -249,6 +318,13 @@
return;
}
+ if (i == 0)
+ fDirectoryInode = inodeNumber;
+ else if (i == 1)
+ fAttributeDirInode = inodeNumber;
+ else if (i == 2)
+ fAttributeFileInode = inodeNumber;
+
fStatus = get_vnode(volume, inodeNumber, ¤tVnode.private_node,
¤tVnode.ops);
if (fStatus != B_OK) {
@@ -314,7 +390,8 @@
return;
}
- fEntries = new(std::nothrow) AttributeEntry *[fFile->entry_count];
+ fEntries = (AttributeEntry **)malloc(fFile->entry_count
+ * sizeof(AttributeEntry *));
if (fEntries == NULL) {
TRACE_ALWAYS("no memory to allocate entry pointers\n");
fStatus = B_NO_MEMORY;
@@ -335,7 +412,7 @@
return;
}
- totalSize += fEntries[i]->EntrySize();
+ totalSize += fEntries[i]->EntrySize() + fEntries[i]->DataSize();
if (totalSize > readLength) {
TRACE_ALWAYS("attribute entries are too large for buffer\n");
fStatus = B_BAD_VALUE;
@@ -354,13 +431,170 @@
for (uint32 i = 0; i < fFile->entry_count; i++)
delete fEntries[i];
- delete [] fEntries;
+ free(fEntries);
}
free(fFile);
}
+status_t
+AttributeFile::CreateEmpty()
+{
+ if (fFile == NULL) {
+ fFile = (attribute_file *)malloc(sizeof(attribute_file) - 1);
+ if (fFile == NULL) {
+ TRACE_ALWAYS("failed to allocate file buffer\n");
+ fStatus = B_NO_MEMORY;
+ return fStatus;
+ }
+
+ fFile->entry_count = 0;
+ fFile->magic = ATTRIBUTE_OVERLAY_FILE_MAGIC;
+ }
+
+ fStatus = B_OK;
+ return B_OK;
+}
+
+
+status_t
+AttributeFile::WriteAttributeFile(fs_volume *volume, fs_vnode *vnode)
+{
+ if (fFile == NULL)
+ return B_NO_INIT;
+
+ if (fDirectoryInode == 0) {
+ TRACE_ALWAYS("directory inode not known\n");
+ return B_NO_INIT;
+ }
+
+ char nameBuffer[B_FILE_NAME_LENGTH];
+ nameBuffer[sizeof(nameBuffer) - 1] = 0;
+ status_t result = vnode->ops->get_vnode_name(volume, vnode, nameBuffer,
+ sizeof(nameBuffer) - 1);
+ if (result != B_OK) {
+ TRACE_ALWAYS("failed to get vnode name: %s\n", strerror(result));
+ return result;
+ }
+
+ fs_vnode currentVnode;
+ if (fAttributeDirInode == 0) {
+ result = get_vnode(volume, fDirectoryInode,
+ ¤tVnode.private_node, ¤tVnode.ops);
+ if (result != B_OK) {
+ TRACE_ALWAYS("failed to get directory vnode: %s\n",
+ strerror(result));
+ return result;
+ }
+
+ // create the attribute directory
+ result = currentVnode.ops->create_dir(volume, ¤tVnode,
+ ATTRIBUTE_OVERLAY_ATTRIBUTE_DIR_NAME, S_IRWXU | S_IRWXG | S_IRWXO,
+ &fAttributeDirInode);
+
+ put_vnode(volume, fDirectoryInode);
+
+ if (result != B_OK) {
+ TRACE_ALWAYS("failed to create attribute directory: %s\n",
+ strerror(result));
+ fAttributeDirInode = 0;
+ return result;
+ }
+ }
+
+ void *attrFileCookie = NULL;
+ if (fAttributeFileInode == 0) {
+ result = get_vnode(volume, fAttributeDirInode,
+ ¤tVnode.private_node, ¤tVnode.ops);
+ if (result != B_OK) {
+ TRACE_ALWAYS("failed to get attribute directory vnode: %s\n",
+ strerror(result));
+ return result;
+ }
+
+ // create the attribute file
+ result = currentVnode.ops->create(volume, ¤tVnode,
+ nameBuffer, O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP
+ | S_IWGRP | S_IROTH | S_IWOTH, &attrFileCookie,
+ &fAttributeFileInode);
+
+ put_vnode(volume, fAttributeDirInode);
+
+ if (result != B_OK) {
+ TRACE_ALWAYS("failed to create attribute file: %s\n",
+ strerror(result));
+ return result;
+ }
+
+ result = get_vnode(volume, fAttributeFileInode,
+ ¤tVnode.private_node, ¤tVnode.ops);
+ if (result != B_OK) {
+ TRACE_ALWAYS("getting attribute file vnode after create failed: %s\n",
+ strerror(result));
+ return result;
+ }
+ } else {
+ result = get_vnode(volume, fAttributeFileInode,
+ ¤tVnode.private_node, ¤tVnode.ops);
+ if (result != B_OK) {
+ TRACE_ALWAYS("getting attribute file vnode failed: %s\n",
+ strerror(result));
+ return result;
+ }
+
+ // open the attribute file
+ result = currentVnode.ops->open(volume, ¤tVnode, O_RDWR | O_TRUNC,
+ &attrFileCookie);
+ if (result != B_OK) {
+ TRACE_ALWAYS("failed to open attribute file for writing: %s\n",
+ strerror(result));
+ put_vnode(volume, fAttributeFileInode);
+ return result;
+ }
+ }
+
+ off_t position = 0;
+ size_t writeLength = sizeof(attribute_file) - 1;
+ result = currentVnode.ops->write(volume, ¤tVnode, attrFileCookie,
+ position, fFile, &writeLength);
+ if (result != B_OK) {
+ TRACE_ALWAYS("failed to write to attribute file: %s\n",
+ strerror(result));
+ goto close_and_put;
+ }
+
+ for (uint32 i = 0; i < fFile->entry_count; i++) {
+ writeLength = fEntries[i]->EntrySize();
+ result = currentVnode.ops->write(volume, ¤tVnode, attrFileCookie,
+ position, fEntries[i]->Entry(), &writeLength);
+ if (result != B_OK) {
+ TRACE_ALWAYS("failed to write to attribute file: %s\n",
+ strerror(result));
+ goto close_and_put;
+ }
+
+ writeLength = fEntries[i]->DataSize();
+ result = currentVnode.ops->write(volume, ¤tVnode, attrFileCookie,
+ position, fEntries[i]->Data(), &writeLength);
+ if (result != B_OK) {
+ TRACE_ALWAYS("failed to write to attribute file: %s\n",
+ strerror(result));
+ goto close_and_put;
+ }
+ }
+
+close_and_put:
+ if (currentVnode.ops->close != NULL)
+ currentVnode.ops->close(volume, ¤tVnode, attrFileCookie);
+ if (currentVnode.ops->free_cookie != NULL)
+ currentVnode.ops->free_cookie(volume, ¤tVnode, attrFileCookie);
+
+ put_vnode(volume, fAttributeFileInode);
+ return B_OK;
+}
+
+
uint32
AttributeFile::CountAttributes()
{
@@ -372,14 +606,15 @@
AttributeEntry *
-AttributeFile::FindAttribute(const char *name)
+AttributeFile::FindAttribute(const char *name, uint32 *index)
{
- if (fFile == NULL)
- return NULL;
+ for (uint32 i = 0; i < fFile->entry_count; i++) {
+ if (strncmp(fEntries[i]->Name(), name, fEntries[i]->NameLength()) == 0) {
+ if (index)
+ *index = i;
- for (uint32 i = 0; i < fFile->entry_count; i++) {
- if (strncmp(fEntries[i]->Name(), name, fEntries[i]->NameLength()) == 0)
return fEntries[i];
+ }
}
return NULL;
@@ -387,16 +622,115 @@
status_t
+AttributeFile::CreateAttribute(const char *name, type_code type, int openMode,
+ AttributeEntry **_entry)
+{
+ AttributeEntry *existing = FindAttribute(name);
+ if (existing != NULL) {
+ if (openMode & O_TRUNC)
+ existing->SetSize(0);
+
+ // attribute already exists, only allow if the attribute type is
+ // compatible or the attribute size is 0
+ if (existing->Type() != type) {
+ if (existing->Size() != 0)
+ return B_FILE_EXISTS;
+ existing->SetType(type);
+ }
+
+ if (existing->InitCheck() == B_OK) {
+ *_entry = existing;
+ return B_OK;
+ }
+
+ // we tried to change the existing item but failed, try to just
+ // remove it instead and creating a new one
+ RemoveAttribute(name, NULL);
+ }
+
+ AttributeEntry *entry = new(std::nothrow) AttributeEntry(this, name, type);
+ if (entry == NULL)
+ return B_NO_MEMORY;
+
+ status_t result = AddAttribute(entry);
+ if (result != B_OK) {
+ delete entry;
+ return result;
+ }
+
+ *_entry = entry;
+ return B_OK;
+}
+
+
+status_t
+AttributeFile::OpenAttribute(const char *name, int openMode,
+ AttributeEntry **_entry)
+{
+ AttributeEntry *entry = FindAttribute(name);
+ if (entry == NULL)
+ return B_ENTRY_NOT_FOUND;
+
+ if (openMode & O_TRUNC)
+ entry->SetSize(0);
+
+ *_entry = entry;
+ return B_OK;
+}
+
+
+status_t
+AttributeFile::RemoveAttribute(const char *name, AttributeEntry **_entry)
+{
+ uint32 index = 0;
+ AttributeEntry *entry = FindAttribute(name, &index);
+ if (entry == NULL)
+ return B_ENTRY_NOT_FOUND;
+
+ for (uint32 i = index + 1; i < fFile->entry_count; i++)
+ fEntries[i - 1] = fEntries[i];
+ fFile->entry_count--;
+
+ if (_entry)
+ *_entry = entry;
+ else
+ delete entry;
+
+ return B_OK;
+}
+
+
+status_t
+AttributeFile::AddAttribute(AttributeEntry *entry)
+{
+ status_t result = entry->InitCheck();
+ if (result != B_OK)
+ return result;
+
+ if (FindAttribute(entry->Name()) != NULL)
+ return B_FILE_EXISTS;
+
+ AttributeEntry **newEntries = (AttributeEntry **)realloc(fEntries,
+ (fFile->entry_count + 1) * sizeof(AttributeEntry *));
+ if (newEntries == NULL)
+ return B_NO_MEMORY;
+
+ fEntries = newEntries;
+ fEntries[fFile->entry_count++] = entry;
+ return B_OK;
+}
+
+
+status_t
AttributeFile::ReadAttributeDir(struct dirent *dirent, size_t bufferSize,
- uint32 *numEntries)
+ uint32 *numEntries, uint32 *index)
{
- if (fFile == NULL || fAttributeDirIndex >= fFile->entry_count) {
+ if (fFile == NULL || *index >= fFile->entry_count) {
*numEntries = 0;
return B_OK;
}
- return fEntries[fAttributeDirIndex++]->FillDirent(dirent, bufferSize,
- numEntries);
+ return fEntries[(*index)++]->FillDirent(dirent, bufferSize, numEntries);
}
@@ -406,32 +740,134 @@
AttributeEntry::AttributeEntry(AttributeFile *parent, uint8 *buffer)
: fParent(parent),
fEntry(NULL),
- fData(NULL)
+ fData(NULL),
+ fStatus(B_NO_INIT),
+ fAllocatedEntry(false),
+ fAllocatedData(false)
{
+ if (buffer == NULL)
+ return;
+
fEntry = (attribute_entry *)buffer;
fData = (uint8 *)fEntry->name + fEntry->name_length;
+ fStatus = B_OK;
}
+AttributeEntry::AttributeEntry(AttributeFile *parent, const char *name,
+ type_code type)
+ : fParent(parent),
+ fEntry(NULL),
+ fData(NULL),
+ fStatus(B_NO_INIT),
+ fAllocatedEntry(false),
+ fAllocatedData(false)
+{
+ fStatus = SetName(name);
+ if (fStatus != B_OK)
+ return;
+
+ fEntry->type = type;
+ fEntry->size = 0;
+}
+
+
AttributeEntry::~AttributeEntry()
{
+ if (fAllocatedEntry)
+ free(fEntry);
+ if (fAllocatedData)
+ free(fData);
}
size_t
AttributeEntry::EntrySize()
{
- return sizeof(attribute_entry) - 1 + fEntry->name_length + fEntry->size;
+ return sizeof(attribute_entry) - 1 + fEntry->name_length;
}
status_t
+AttributeEntry::SetType(type_code type)
+{
+ fEntry->type = type;
+ return B_OK;
+}
+
+
+status_t
+AttributeEntry::SetSize(size_t size)
+{
+ if (size <= fEntry->size) {
+ fEntry->size = size;
+ return B_OK;
+ }
+
+ if (fAllocatedData) {
+ uint8 *newData = (uint8 *)realloc(fData, size);
+ if (newData == NULL) {
+ fStatus = B_NO_MEMORY;
+ return fStatus;
+ }
+
+ fData = newData;
+ fEntry->size = size;
+ return B_OK;
+ }
+
+ uint8 *newData = (uint8 *)malloc(size);
+ if (newData == NULL) {
+ fStatus = B_NO_MEMORY;
+ return fStatus;
+ }
+
+ memcpy(newData, fData, min_c(fEntry->size, size));
+ fAllocatedData = true;
+ fData = newData;
+ return B_OK;
+}
+
+
+status_t
+AttributeEntry::SetName(const char *name)
+{
+ size_t nameLength = strlen(name) + 1;
+ if (nameLength > 255) {
+ fStatus = B_NAME_TOO_LONG;
+ return fStatus;
+ }
+
+ if (!fAllocatedEntry || fEntry->name_length < nameLength) {
+ attribute_entry *newEntry = (attribute_entry *)malloc(
+ sizeof(attribute_entry) - 1 + nameLength);
+ if (newEntry == NULL) {
+ fStatus = B_NO_MEMORY;
+ return fStatus;
+ }
+
+ if (fEntry != NULL)
+ memcpy(newEntry, fEntry, sizeof(attribute_entry) - 1);
+ if (fAllocatedEntry)
+ free(fEntry);
+
+ fAllocatedEntry = true;
+ fEntry = newEntry;
+ }
+
+ fEntry->name_length = nameLength;
+ strlcpy(fEntry->name, name, nameLength);
+ return B_OK;
+}
+
+
+status_t
AttributeEntry::FillDirent(struct dirent *dirent, size_t bufferSize,
uint32 *numEntries)
{
dirent->d_dev = dirent->d_pdev = fParent->VolumeID();
dirent->d_ino = (ino_t)this;
- dirent->d_pino = fParent->ParentInode();
+ dirent->d_pino = fParent->FileInode();
dirent->d_reclen = sizeof(struct dirent) + fEntry->name_length;
if (bufferSize < dirent->d_reclen) {
*numEntries = 0;
@@ -448,14 +884,25 @@
status_t
AttributeEntry::Read(off_t position, void *buffer, size_t *length)
{
- *length = min_c(*length, fEntry->size);
- if (*length <= position) {
- *length = 0;
- return B_OK;
+ *length = min_c(*length, fEntry->size - position);
+ memcpy(buffer, fData + position, *length);
+ return B_OK;
+}
+
+
+status_t
+AttributeEntry::Write(off_t position, const void *buffer, size_t *length)
+{
+ size_t neededSize = position + *length;
+ if (neededSize > fEntry->size) {
+ status_t result = SetSize(neededSize);
+ if (result != B_OK) {
+ *length = 0;
+ return result;
+ }
}
- *length -= position;
- memcpy(buffer, fData + position, *length);
+ memcpy(fData + position, buffer, *length);
return B_OK;
}
@@ -478,6 +925,13 @@
}
+status_t
+AttributeEntry::WriteStat(const struct stat *stat, uint32 statMask)
+{
+ return B_UNSUPPORTED;
+}
+
+
// #pragma mark - vnode ops
@@ -860,11 +1314,20 @@
overlay_open_attr_dir(fs_volume *volume, fs_vnode *vnode, void **cookie)
{
OVERLAY_CALL(open_attr_dir, cookie)
- AttributeFile *attributeFile = node->GetAttributeFile();
- if (attributeFile == NULL)
- return B_UNSUPPORTED;
- *cookie = attributeFile;
+ AttributeFile *attributeFile = NULL;
+ status_t result = node->GetAttributeFile(&attributeFile);
+ if (result != B_OK)
+ return result;
+
+ attribute_dir_cookie *dirCookie = (attribute_dir_cookie *)malloc(
+ sizeof(attribute_dir_cookie));
+ if (dirCookie == NULL)
+ return B_NO_MEMORY;
+
+ dirCookie->file = attributeFile;
+ dirCookie->index = 0;
+ *cookie = dirCookie;
return B_OK;
}
@@ -881,6 +1344,7 @@
overlay_free_attr_dir_cookie(fs_volume *volume, fs_vnode *vnode, void *cookie)
{
OVERLAY_CALL(free_attr_dir_cookie, cookie)
+ free(cookie);
return B_OK;
}
@@ -890,8 +1354,9 @@
struct dirent *buffer, size_t bufferSize, uint32 *num)
{
OVERLAY_CALL(read_attr_dir, cookie, buffer, bufferSize, num)
- AttributeFile *attributeFile = (AttributeFile *)cookie;
- return attributeFile->ReadAttributeDir(buffer, bufferSize, num);
+ attribute_dir_cookie *dirCookie = (attribute_dir_cookie *)cookie;
+ return dirCookie->file->ReadAttributeDir(buffer, bufferSize, num,
+ &dirCookie->index);
}
@@ -899,8 +1364,9 @@
overlay_rewind_attr_dir(fs_volume *volume, fs_vnode *vnode, void *cookie)
{
OVERLAY_CALL(rewind_attr_dir, cookie)
- AttributeFile *attributeFile = (AttributeFile *)cookie;
- return attributeFile->RewindAttributeDir();
+ attribute_dir_cookie *dirCookie = (attribute_dir_cookie *)cookie;
+ dirCookie->index = 0;
+ return B_OK;
}
@@ -909,7 +1375,14 @@
uint32 type, int openMode, void **cookie)
{
OVERLAY_CALL(create_attr, name, type, openMode, cookie)
- return B_UNSUPPORTED;
+
+ AttributeFile *attributeFile = NULL;
+ status_t result = node->GetAttributeFile(&attributeFile);
+ if (result != B_OK)
+ return result;
+
+ return attributeFile->CreateAttribute(name, type, openMode,
+ (AttributeEntry **)cookie);
}
@@ -919,16 +1392,13 @@
{
OVERLAY_CALL(open_attr, name, openMode, cookie)
- AttributeFile *attributeFile = node->GetAttributeFile();
- if (attributeFile == NULL)
- return B_UNSUPPORTED;
+ AttributeFile *attributeFile = NULL;
+ status_t result = node->GetAttributeFile(&attributeFile);
+ if (result != B_OK)
+ return result;
- AttributeEntry *entry = attributeFile->FindAttribute(name);
- if (entry == NULL)
- return B_ENTRY_NOT_FOUND;
-
- *cookie = entry;
- return B_OK;
+ return attributeFile->OpenAttribute(name, openMode,
+ (AttributeEntry **)cookie);
}
@@ -963,7 +1433,8 @@
const void *buffer, size_t *length)
{
OVERLAY_CALL(write_attr, cookie, pos, buffer, length)
- return B_UNSUPPORTED;
+ AttributeEntry *entry = (AttributeEntry *)cookie;
+ return entry->Write(pos, buffer, length);
}
@@ -982,7 +1453,8 @@
const struct stat *stat, int statMask)
{
OVERLAY_CALL(write_attr_stat, cookie, stat, statMask)
- return B_UNSUPPORTED;
+ AttributeEntry *entry = (AttributeEntry *)cookie;
+ return entry->WriteStat(stat, statMask);
}
@@ -991,7 +1463,41 @@
const char *fromName, fs_vnode *toVnode, const char *toName)
{
OVERLAY_CALL(rename_attr, fromName, toVnode, toName)
- return B_UNSUPPORTED;
+
+ AttributeFile *attributeFile = NULL;
+ status_t result = node->GetAttributeFile(&attributeFile);
+ if (result != B_OK)
+ return B_OK;
+
+ AttributeFile *toAttributeFile = attributeFile;
+ if (vnode->private_node != toVnode->private_node) {
+ OverlayInode *toNode = (OverlayInode *)toVnode->private_node;
+ result = toNode->GetAttributeFile(&toAttributeFile);
+ if (result != B_OK)
+ return result;
+ }
+
+ AttributeEntry *entry = NULL;
+ result = attributeFile->RemoveAttribute(fromName, &entry);
+ if (result != B_OK)
+ return result;
+
+ result = entry->SetName(toName);
+ if (result != B_OK) {
+ if (attributeFile->AddAttribute(entry) != B_OK)
+ delete entry;
+ return result;
+ }
+
+ result = toAttributeFile->AddAttribute(entry);
+ if (result != B_OK) {
+ if (entry->SetName(fromName) != B_OK
+ || attributeFile->AddAttribute(entry) != B_OK)
+ delete entry;
+ return result;
+ }
+
+ return B_OK;
}
@@ -999,7 +1505,13 @@
overlay_remove_attr(fs_volume *volume, fs_vnode *vnode, const char *name)
{
OVERLAY_CALL(remove_attr, name)
- return B_UNSUPPORTED;
+
+ AttributeFile *attributeFile = NULL;
+ status_t result = node->GetAttributeFile(&attributeFile);
+ if (result != B_OK)
+ return result;
+
+ return attributeFile->RemoveAttribute(name, NULL);
}
From phoudoin at mail.berlios.de Tue Feb 17 11:37:02 2009
From: phoudoin at mail.berlios.de (phoudoin at mail.berlios.de)
Date: Tue, 17 Feb 2009 11:37:02 +0100
Subject: [Haiku-commits] r29240 - in haiku/trunk: headers/os/interface
src/kits/interface
Message-ID: <200902171037.n1HAb2nT003517@sheep.berlios.de>
Author: phoudoin
Date: 2009-02-17 11:36:58 +0100 (Tue, 17 Feb 2009)
New Revision: 29240
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29240&view=rev
Modified:
haiku/trunk/headers/os/interface/ControlLook.h
haiku/trunk/src/kits/interface/ControlLook.cpp
haiku/trunk/src/kits/interface/TabView.cpp
Log:
Fixed BTabs focus underline offset.
Fixed a typo in method name.
Please forgive me Stephan if I just screw your next commit...
Modified: haiku/trunk/headers/os/interface/ControlLook.h
===================================================================
--- haiku/trunk/headers/os/interface/ControlLook.h 2009-02-17 02:05:58 UTC (rev 29239)
+++ haiku/trunk/headers/os/interface/ControlLook.h 2009-02-17 10:36:58 UTC (rev 29240)
@@ -169,7 +169,7 @@
const rgb_color& base, uint32 flags = 0,
uint32 borders = B_ALL_BORDERS);
- virtual void DrawInctiveTab(BView* view, BRect& rect,
+ virtual void DrawInactiveTab(BView* view, BRect& rect,
const BRect& updateRect,
const rgb_color& base, uint32 flags = 0,
uint32 borders = B_ALL_BORDERS);
Modified: haiku/trunk/src/kits/interface/ControlLook.cpp
===================================================================
--- haiku/trunk/src/kits/interface/ControlLook.cpp 2009-02-17 02:05:58 UTC (rev 29239)
+++ haiku/trunk/src/kits/interface/ControlLook.cpp 2009-02-17 10:36:58 UTC (rev 29240)
@@ -1247,7 +1247,7 @@
void
-BControlLook::DrawInctiveTab(BView* view, BRect& rect, const BRect& updateRect,
+BControlLook::DrawInactiveTab(BView* view, BRect& rect, const BRect& updateRect,
const rgb_color& base, uint32 flags, uint32 borders)
{
if (!rect.IsValid() || !rect.Intersects(updateRect))
Modified: haiku/trunk/src/kits/interface/TabView.cpp
===================================================================
--- haiku/trunk/src/kits/interface/TabView.cpp 2009-02-17 02:05:58 UTC (rev 29239)
+++ haiku/trunk/src/kits/interface/TabView.cpp 2009-02-17 10:36:58 UTC (rev 29240)
@@ -223,12 +223,12 @@
float width = owner->StringWidth(Label());
owner->SetHighColor(ui_color(B_KEYBOARD_NAVIGATION_COLOR));
- // TODO: remove offset
- float offset = frame.Height() / 2.0;
- owner->StrokeLine(BPoint((frame.left + frame.right - width + offset) / 2.0,
- frame.bottom - 3),
- BPoint((frame.left + frame.right + width + offset) / 2.0,
- frame.bottom - 3));
+
+ float offset = IsSelected() ? 3 : 2;
+ owner->StrokeLine(BPoint((frame.left + frame.right - width) / 2.0,
+ frame.bottom - offset),
+ BPoint((frame.left + frame.right + width) / 2.0,
+ frame.bottom - offset));
}
@@ -290,7 +290,7 @@
be_control_look->DrawActiveTab(owner, frame, frame, no_tint, 0,
borders);
} else {
- be_control_look->DrawInctiveTab(owner, frame, frame, no_tint, 0,
+ be_control_look->DrawInactiveTab(owner, frame, frame, no_tint, 0,
borders);
}
@@ -858,7 +858,7 @@
| BControlLook::B_BOTTOM_BORDER | BControlLook::B_RIGHT_BORDER;
if (left == 0)
borders |= BControlLook::B_LEFT_BORDER;
- be_control_look->DrawInctiveTab(this, frame, frame, base, 0, borders);
+ be_control_look->DrawInactiveTab(this, frame, frame, base, 0, borders);
}
if (fSelection < CountTabs())
From mmlr at mail.berlios.de Tue Feb 17 22:43:15 2009
From: mmlr at mail.berlios.de (mmlr at mail.berlios.de)
Date: Tue, 17 Feb 2009 22:43:15 +0100
Subject: [Haiku-commits] r29241 - in haiku/trunk: headers/os/drivers
headers/private/kernel src/system/kernel
src/system/kernel/arch/x86/timers
Message-ID: <200902172143.n1HLhFcv004529@sheep.berlios.de>
Author: mmlr
Date: 2009-02-17 22:41:51 +0100 (Tue, 17 Feb 2009)
New Revision: 29241
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29241&view=rev
Modified:
haiku/trunk/headers/os/drivers/KernelExport.h
haiku/trunk/headers/private/kernel/int.h
haiku/trunk/src/system/kernel/arch/x86/timers/x86_hpet.c
haiku/trunk/src/system/kernel/int.c
Log:
* Introduce a (private) flag B_NO_HANDLED_INFO for install_io_interrupt_handler.
It causes the interrupt handler to be inserted at the very end of the list
instead of at the top. It is intended to be used as a workaround when a
interrupt handler cannot know if it actually handled the interrupt. This
should never be used by native drivers. Also if we know that the result is
not valid because of this flag we won't disable the vector in case we count
many unhandled interrupts as those numbers are then unreliable.
* Moved B_NO_LOCK_VECTOR to be a private flag as well.
* Made the interrupt handler list a simple manually maintaned singly linked list
instead of the doubly linked one used with insque and remque as it greatly
simplifies things for such an easy use case and is more compact.
Modified: haiku/trunk/headers/os/drivers/KernelExport.h
===================================================================
--- haiku/trunk/headers/os/drivers/KernelExport.h 2009-02-17 10:36:58 UTC (rev 29240)
+++ haiku/trunk/headers/os/drivers/KernelExport.h 2009-02-17 21:41:51 UTC (rev 29241)
@@ -51,7 +51,6 @@
/* Flags that can be passed to install_io_interrupt_handler() */
#define B_NO_ENABLE_COUNTER 1
-#define B_NO_LOCK_VECTOR 2
/* timer interrupts services */
Modified: haiku/trunk/headers/private/kernel/int.h
===================================================================
--- haiku/trunk/headers/private/kernel/int.h 2009-02-17 10:36:58 UTC (rev 29240)
+++ haiku/trunk/headers/private/kernel/int.h 2009-02-17 21:41:51 UTC (rev 29241)
@@ -12,6 +12,10 @@
#include
#include
+// private install_io_interrupt_handler() flags
+#define B_NO_LOCK_VECTOR 0x100
+#define B_NO_HANDLED_INFO 0x200
+
struct kernel_args;
Modified: haiku/trunk/src/system/kernel/arch/x86/timers/x86_hpet.c
===================================================================
--- haiku/trunk/src/system/kernel/arch/x86/timers/x86_hpet.c 2009-02-17 10:36:58 UTC (rev 29240)
+++ haiku/trunk/src/system/kernel/arch/x86/timers/x86_hpet.c 2009-02-17 21:41:51 UTC (rev 29241)
@@ -11,6 +11,7 @@
#include
#include
+#include
#include "hpet.h"
Modified: haiku/trunk/src/system/kernel/int.c
===================================================================
--- haiku/trunk/src/system/kernel/int.c 2009-02-17 10:36:58 UTC (rev 29240)
+++ haiku/trunk/src/system/kernel/int.c 2009-02-17 21:41:51 UTC (rev 29241)
@@ -33,14 +33,14 @@
struct io_handler {
struct io_handler *next;
- struct io_handler *prev;
interrupt_handler func;
void *data;
bool use_enable_counter;
+ bool no_handled_info;
};
struct io_vector {
- struct io_handler handler_list;
+ struct io_handler * handler_list;
spinlock vector_lock;
int32 enable_count;
bool no_lock_vector;
@@ -67,18 +67,16 @@
&& sVectors[i].enable_count == 0
&& sVectors[i].handled_count == 0
&& sVectors[i].unhandled_count == 0
- && sVectors[i].handler_list.next == &sVectors[i].handler_list)
+ && sVectors[i].handler_list == NULL)
continue;
kprintf("int %3d, enabled %ld, handled %8lld, unhandled %8lld%s%s\n",
i, sVectors[i].enable_count, sVectors[i].handled_count,
sVectors[i].unhandled_count,
B_SPINLOCK_IS_LOCKED(&sVectors[i].vector_lock) ? ", ACTIVE" : "",
- sVectors[i].handler_list.next == &sVectors[i].handler_list
- ? ", no handler" : "");
+ sVectors[i].handler_list == NULL ? ", no handler" : "");
- for (io = sVectors[i].handler_list.next;
- io != &sVectors[i].handler_list; io = io->next) {
+ for (io = sVectors[i].handler_list; io != NULL; io = io->next) {
const char *symbol, *imageName;
bool exactMatch;
@@ -134,7 +132,7 @@
sVectors[i].trigger_count = 0;
sVectors[i].ignored_count = 0;
#endif
- initque(&sVectors[i].handler_list); /* initialize handler queue */
+ sVectors[i].handler_list = NULL;
}
#if DEBUG_INTERRUPTS
@@ -168,13 +166,15 @@
if (!sVectors[vector].no_lock_vector)
acquire_spinlock(&sVectors[vector].vector_lock);
+#if !DEBUG_INTERRUPTS
// The list can be empty at this place
- if (sVectors[vector].handler_list.next == &sVectors[vector].handler_list) {
+ if (sVectors[vector].handler_list == NULL) {
dprintf("unhandled io interrupt %d\n", vector);
if (!sVectors[vector].no_lock_vector)
release_spinlock(&sVectors[vector].vector_lock);
return B_UNHANDLED_INTERRUPT;
}
+#endif
/* For level-triggered interrupts, we actually handle the return
* value (ie. B_HANDLED_INTERRUPT) to decide wether or not we
@@ -185,9 +185,7 @@
* whatever the driver thought would be useful (ie. B_INVOKE_SCHEDULER)
*/
- for (io = sVectors[vector].handler_list.next;
- io != &sVectors[vector].handler_list;
- io = io->next) {
+ for (io = sVectors[vector].handler_list; io != NULL; io = io->next) {
status = io->func(io->data);
if (levelTriggered && status != B_UNHANDLED_INTERRUPT)
@@ -210,16 +208,27 @@
if (sVectors[vector].trigger_count > 10000) {
if (sVectors[vector].ignored_count > 9900) {
- if (sVectors[vector].handler_list.next == NULL
- || sVectors[vector].handler_list.next->next == NULL) {
- // this interrupt vector is not shared, disable it
- sVectors[vector].enable_count = -100;
- arch_int_disable_io_interrupt(vector);
- dprintf("Disabling unhandled io interrupt %d\n", vector);
+ struct io_handler *last = sVectors[vector].handler_list;
+ while (last && last->next)
+ last = last->next;
+
+ if (last != NULL && last->no_handled_info) {
+ // we have an interrupt handler installed that does not
+ // know whether or not it has actually handled the interrupt,
+ // so this unhandled count is inaccurate and we can't just
+ // disable
} else {
- // this is a shared interrupt vector, we cannot just disable it
- dprintf("More than 99%% interrupts of vector %d are unhandled\n",
- vector);
+ if (sVectors[vector].handler_list == NULL
+ || sVectors[vector].handler_list->next == NULL) {
+ // this interrupt vector is not shared, disable it
+ sVectors[vector].enable_count = -100;
+ arch_int_disable_io_interrupt(vector);
+ dprintf("Disabling unhandled io interrupt %d\n", vector);
+ } else {
+ // this is a shared interrupt vector, we cannot just disable it
+ dprintf("More than 99%% interrupts of vector %d are unhandled\n",
+ vector);
+ }
}
}
@@ -290,14 +299,34 @@
io->func = handler;
io->data = data;
io->use_enable_counter = (flags & B_NO_ENABLE_COUNTER) == 0;
+ io->no_handled_info = (flags & B_NO_HANDLED_INFO) == 0;
// Disable the interrupts, get the spinlock for this irq only
// and then insert the handler
state = disable_interrupts();
acquire_spinlock(&sVectors[vector].vector_lock);
- insque(io, &sVectors[vector].handler_list);
+ if ((flags & B_NO_HANDLED_INFO) != 0
+ && sVectors[vector].handler_list != NULL) {
+ // The driver registering this interrupt handler doesn't know
+ // whether or not it actually handled the interrupt after the
+ // handler returns. This is incompatible with shared interrupts
+ // as we'd potentially steal interrupts from other handlers
+ // resulting in interrupt storms. Therefore we enqueue this interrupt
+ // handler as the very last one, meaning all other handlers will
+ // get their go at any interrupt first.
+ struct io_handler *last = sVectors[vector].handler_list;
+ while (last->next)
+ last = last->next;
+ io->next = NULL;
+ last->next = io;
+ } else {
+ // A normal interrupt handler, just add it to the head of the list.
+ io->next = sVectors[vector].handler_list;
+ sVectors[vector].handler_list = io;
+ }
+
// If B_NO_ENABLE_COUNTER is set, we're being asked to not alter
// whether the interrupt should be enabled or not
if (io->use_enable_counter) {
@@ -328,6 +357,7 @@
{
status_t status = B_BAD_VALUE;
struct io_handler *io = NULL;
+ struct io_handler *last = NULL;
cpu_status state;
if (vector < 0 || vector >= NUM_IO_VECTORS)
@@ -341,12 +371,13 @@
* We go forward through the list but this means we start with the
* most recently added handlers.
*/
- for (io = sVectors[vector].handler_list.next;
- io != &sVectors[vector].handler_list;
- io = io->next) {
+ for (io = sVectors[vector].handler_list; io != NULL; io = io->next) {
/* we have to match both function and data */
if (io->func == handler && io->data == data) {
- remque(io);
+ if (last != NULL)
+ last->next = io->next;
+ else
+ sVectors[vector].handler_list = io->next;
// Check if we need to disable the interrupt
if (io->use_enable_counter && --sVectors[vector].enable_count == 0)
@@ -355,6 +386,8 @@
status = B_OK;
break;
}
+
+ last = io;
}
release_spinlock(&sVectors[vector].vector_lock);
From mmlr at mail.berlios.de Tue Feb 17 22:49:36 2009
From: mmlr at mail.berlios.de (mmlr at mail.berlios.de)
Date: Tue, 17 Feb 2009 22:49:36 +0100
Subject: [Haiku-commits] r29242 - haiku/trunk/src/libs/compat/freebsd_network
Message-ID: <200902172149.n1HLnaRl004922@sheep.berlios.de>
Author: mmlr
Date: 2009-02-17 22:49:34 +0100 (Tue, 17 Feb 2009)
New Revision: 29242
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29242&view=rev
Modified:
haiku/trunk/src/libs/compat/freebsd_network/Jamfile
haiku/trunk/src/libs/compat/freebsd_network/bus.c
Log:
Make use of the new private B_NO_HANDLED_INFO in the FreeBSD compatibility layer
for now. This is a workaround and should be removed once we have proper
interrupt return values from FreeBSD drivers. Should work around interrupt
storms for shared interrupts with some network cards that use a FreeBSD driver.
Modified: haiku/trunk/src/libs/compat/freebsd_network/Jamfile
===================================================================
--- haiku/trunk/src/libs/compat/freebsd_network/Jamfile 2009-02-17 21:41:51 UTC (rev 29241)
+++ haiku/trunk/src/libs/compat/freebsd_network/Jamfile 2009-02-17 21:49:34 UTC (rev 29242)
@@ -4,6 +4,7 @@
UseHeaders [ FDirName $(SUBDIR) ] : true ;
UseHeaders [ FDirName $(SUBDIR) compat ] : true ;
UsePrivateHeaders net ;
+UsePrivateKernelHeaders ;
UseHeaders $(HAIKU_PRIVATE_KERNEL_HEADERS) : true ;
SubDirCcFlags [ FDefines _KERNEL=1 ] ;
Modified: haiku/trunk/src/libs/compat/freebsd_network/bus.c
===================================================================
--- haiku/trunk/src/libs/compat/freebsd_network/bus.c 2009-02-17 21:41:51 UTC (rev 29241)
+++ haiku/trunk/src/libs/compat/freebsd_network/bus.c 2009-02-17 21:49:34 UTC (rev 29242)
@@ -17,6 +17,8 @@
#include
#include
+// private kernel header to get B_NO_HANDLED_INFO
+#include
//#define DEBUG_BUS_SPACE_RW
#ifdef DEBUG_BUS_SPACE_RW
@@ -313,10 +315,10 @@
if (filter != NULL) {
status = install_io_interrupt_handler(intr->irq,
- (interrupt_handler)intr->filter, intr->arg, 0);
+ (interrupt_handler)intr->filter, intr->arg, B_NO_HANDLED_INFO);
} else if (flags & INTR_FAST) {
status = install_io_interrupt_handler(intr->irq,
- intr_fast_wrapper, intr, 0);
+ intr_fast_wrapper, intr, B_NO_HANDLED_INFO);
} else {
snprintf(semName, sizeof(semName), "%s intr", dev->device_name);
@@ -337,7 +339,7 @@
}
status = install_io_interrupt_handler(intr->irq,
- intr_wrapper, intr, 0);
+ intr_wrapper, intr, B_NO_HANDLED_INFO);
}
if (status < B_OK) {
From axeld at pinc-software.de Wed Feb 18 00:14:50 2009
From: axeld at pinc-software.de (=?ISO-8859-1?Q?Axel_D=F6rfler?=)
Date: Wed, 18 Feb 2009 00:14:50 +0100
Subject: [Haiku-commits] r29241 - in haiku/trunk:
headers/os/drivers headers/private/kernel
src/system/kernel src/system/kernel/arch/x86/timers
In-Reply-To: <200902172143.n1HLhFcv004529@sheep.berlios.de>
References: <200902172143.n1HLhFcv004529@sheep.berlios.de>
Message-ID: <499B44EA.6090000@pinc-software.de>
mmlr at mail.berlios.de wrote:
> Modified: haiku/trunk/src/system/kernel/int.c
> ===================================================================
> struct io_vector {
> - struct io_handler handler_list;
> + struct io_handler * handler_list;
Following the '*' style used in that file, the asterisk should directly
prepend "handler_list" :-)
> @@ -290,14 +299,34 @@
> io->func = handler;
> io->data = data;
> io->use_enable_counter = (flags & B_NO_ENABLE_COUNTER) == 0;
> + io->no_handled_info = (flags & B_NO_HANDLED_INFO) == 0;
This probably should have been != 0...
Bye,
Axel.
From korli at users.berlios.de Wed Feb 18 09:37:39 2009
From: korli at users.berlios.de (=?ISO-8859-1?B?Suly9G1lIER1dmFs?=)
Date: Wed, 18 Feb 2009 09:37:39 +0100
Subject: [Haiku-commits] r29180 - haiku/trunk/src/kits/interface
In-Reply-To: <17344772461-BeMail@zon>
References: <200902092358.n19Nwchc004002@sheep.berlios.de>
<17344772461-BeMail@zon>
Message-ID:
Hi Axel,
2009/2/15 Axel D?rfler
> korli at BerliOS wrote:
> > Log:
> > * it seems we can skip _HandleKeyDown() when not active (keyboard
> > navigation,
> > shortcuts and screenshots).
>
> I'm not sure if fActive is the right thing to test for; maybe checking
> if the message was for the preferred handler would be better. At least
> messages that applications get when they use SetEventHandler()
> shouldn't get to the preferred handler, but specifically to the one
> that requests those messages.
You probably mean SetEventMask() ? Do you mean this should be handled at the
task_looper() level instead of DispatchMessage() ?
In the case of B_KEY_DOWN messages, BWindow might want to handle such events
for shortcuts, screenshots, etc.. which we don't want in case of non active
windows.
Bye,
J?r?me
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From axeld at pinc-software.de Wed Feb 18 10:49:02 2009
From: axeld at pinc-software.de (=?ISO-8859-1?Q?Axel_D=F6rfler?=)
Date: Wed, 18 Feb 2009 10:49:02 +0100
Subject: [Haiku-commits] r29180 - haiku/trunk/src/kits/interface
In-Reply-To:
References: <200902092358.n19Nwchc004002@sheep.berlios.de> <17344772461-BeMail@zon>
Message-ID: <499BD98E.7020000@pinc-software.de>
Hi J?r?me,
J?r?me Duval wrote:
> I'm not sure if fActive is the right thing to test for; maybe checking
> if the message was for the preferred handler would be better. At least
> messages that applications get when they use SetEventHandler()
> shouldn't get to the preferred handler, but specifically to the one
> that requests those messages.
> You probably mean SetEventMask() ? Do you mean this should be handled at
> the task_looper() level instead of DispatchMessage() ?
Yes, I guess that's how it should be; the standard window handling
should probably not interfere (much) when direct targets are used.
> In the case of B_KEY_DOWN messages, BWindow might want to handle such
> events for shortcuts, screenshots, etc.. which we don't want in case of
> non active windows.
Exactly; the non-active window should never get any such messages that
go to the preferred handler.
Bye,
Axel.
From nielx at mail.berlios.de Wed Feb 18 12:04:27 2009
From: nielx at mail.berlios.de (nielx at BerliOS)
Date: Wed, 18 Feb 2009 12:04:27 +0100
Subject: [Haiku-commits] r29243 - haiku/trunk/docs/user/drivers
Message-ID: <200902181104.n1IB4RIi018484@sheep.berlios.de>
Author: nielx
Date: 2009-02-18 12:04:27 +0100 (Wed, 18 Feb 2009)
New Revision: 29243
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29243&view=rev
Removed:
haiku/trunk/docs/user/drivers/fs_interface.dox
haiku/trunk/docs/user/drivers/fs_modules.dox
Log:
Removing the file system interface documentation for now. This needs to be replaced with a completely new version that accounts for all the new features (including the overlay modules)
Deleted: haiku/trunk/docs/user/drivers/fs_interface.dox
Deleted: haiku/trunk/docs/user/drivers/fs_modules.dox
From mmlr at mail.berlios.de Wed Feb 18 18:52:57 2009
From: mmlr at mail.berlios.de (mmlr at mail.berlios.de)
Date: Wed, 18 Feb 2009 18:52:57 +0100
Subject: [Haiku-commits] r29244 - haiku/trunk/src/system/kernel
Message-ID: <200902181752.n1IHqvSh003748@sheep.berlios.de>
Author: mmlr
Date: 2009-02-18 18:52:51 +0100 (Wed, 18 Feb 2009)
New Revision: 29244
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29244&view=rev
Modified:
haiku/trunk/src/system/kernel/int.c
Log:
Fix wrong check, thanks Axel :-)
Modified: haiku/trunk/src/system/kernel/int.c
===================================================================
--- haiku/trunk/src/system/kernel/int.c 2009-02-18 11:04:27 UTC (rev 29243)
+++ haiku/trunk/src/system/kernel/int.c 2009-02-18 17:52:51 UTC (rev 29244)
@@ -40,7 +40,7 @@
};
struct io_vector {
- struct io_handler * handler_list;
+ struct io_handler *handler_list;
spinlock vector_lock;
int32 enable_count;
bool no_lock_vector;
@@ -299,7 +299,7 @@
io->func = handler;
io->data = data;
io->use_enable_counter = (flags & B_NO_ENABLE_COUNTER) == 0;
- io->no_handled_info = (flags & B_NO_HANDLED_INFO) == 0;
+ io->no_handled_info = (flags & B_NO_HANDLED_INFO) != 0;
// Disable the interrupts, get the spinlock for this irq only
// and then insert the handler
From mmlr at mlotz.ch Wed Feb 18 21:33:39 2009
From: mmlr at mlotz.ch (Michael Lotz)
Date: Wed, 18 Feb 2009 21:33:39
Subject: [Haiku-commits] r29199 - in haiku/trunk: headers/os/drivers
src/add-ons/kernel/file_systems/iso9660 src/system/kernel/fs
In-Reply-To: <20090215165815.358.1@knochen-vm.localdomain>
Message-ID: <14448352655-BeMail@haiku>
> On 2009-02-15 at 15:06:47 [+0100], Michael Lotz wrote:
> > > On 2009-02-14 at 21:30:53 [+0100], mmlr at mail.berlios.de wrote:
> > > > Author: mmlr
> > > > Date: 2009-02-14 21:30:49 +0100 (Sat, 14 Feb 2009)
> > > > New Revision: 29199
> > > > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29199&view=rev
> > > >
> > > > Modified:
> > > > haiku/trunk/headers/os/drivers/fs_interface.h
> > > > haiku/trunk/src/add-ons/kernel/file_systems/iso9660/kernel_
> > > > interface.cpp
> > > > haiku/trunk/src/system/kernel/fs/vfs.cpp
> > > > Log:
> > > > * Adding volume ops to the overlay filesystem.
> > > > * Remove the previous method of applying the overlay by flags.
> > > > In
> > > > the
> > > > future the
> > > > overlay can just be mounted as a filesystem layer. This is
> > > > probably how
> > > > layers
> > > > were intended to work in the first place.
> > >
> > > Exactly. Also the new get_vnode() parameter should be
> > > superfluous,
> > > since
> > > vnode cookie and operations of the underlying FS layer are passed
> > > to
> > > the
> > > create_sub_vnode() hook of your layer.
> >
> > Actually I need it not only for the sub nodes I create. When
> > resolving
> > the attribute files I need to resolve the parent directory and then
> > the
> > attribute directory. So I use get_vnode() on the parent and
> > attribute
> > directory and need to get the vnode ops of them.
>
> Yep, but those are still nodes of the underlying layer and respective
> subnodes are created for your layer. So you could just get the node's
> cookie for your layer (by passing your layer's fs_volume to get_
> vnode()) --
> which should contain the underlying layer's cookie and ops (stored by
> the
> create_sub_vnode() hook).
I see that now, but what I don't see is how the get_vnode() call would
work. Right now it will always call get_super_vnode() to resolve to the
super vnode and return that. Of course I could supply my own fs_volume
to that call, but how would I know in get_super_vnode() that I should
return my own private node? Because as it is currently, I will always
get my own fs_volume in get_super_vnode() due to FS_CALL() resolving
and passing the sub-most volume (overlay in that case) anyway.
> At least that was how I intended it to work. If you insist on get_
> vnode()
> returning the ops, too, I'd prefer a single fs_vnode* parameter,
> though.
That was my first thought as well and I did make it a fs_vnode. But
when later adjusting the file system modules I quickly realized it was
pretty impractical to use. As most of the time you just use some
pointer, for example residing inside an existing structure, it means
adding a fs_vnode to be filled and then extracting the pointer again.
That's why I then just made it an additional argument.
Regards
Michael
From julun at mail.berlios.de Wed Feb 18 21:40:12 2009
From: julun at mail.berlios.de (julun at BerliOS)
Date: Wed, 18 Feb 2009 21:40:12 +0100
Subject: [Haiku-commits] r29245 - in haiku/vendor/freebsd: . RELENG_7
RELENG_7/dev RELENG_7/dev/e1000
Message-ID: <200902182040.n1IKeCvf015481@sheep.berlios.de>
Author: julun
Date: 2009-02-18 21:40:07 +0100 (Wed, 18 Feb 2009)
New Revision: 29245
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29245&view=rev
Added:
haiku/vendor/freebsd/RELENG_7/
haiku/vendor/freebsd/RELENG_7/dev/
haiku/vendor/freebsd/RELENG_7/dev/e1000/
haiku/vendor/freebsd/RELENG_7/dev/e1000/LICENSE
haiku/vendor/freebsd/RELENG_7/dev/e1000/README
haiku/vendor/freebsd/RELENG_7/dev/e1000/e1000_80003es2lan.c
haiku/vendor/freebsd/RELENG_7/dev/e1000/e1000_80003es2lan.h
haiku/vendor/freebsd/RELENG_7/dev/e1000/e1000_82540.c
haiku/vendor/freebsd/RELENG_7/dev/e1000/e1000_82541.c
haiku/vendor/freebsd/RELENG_7/dev/e1000/e1000_82541.h
haiku/vendor/freebsd/RELENG_7/dev/e1000/e1000_82542.c
haiku/vendor/freebsd/RELENG_7/dev/e1000/e1000_82543.c
haiku/vendor/freebsd/RELENG_7/dev/e1000/e1000_82543.h
haiku/vendor/freebsd/RELENG_7/dev/e1000/e1000_82571.c
haiku/vendor/freebsd/RELENG_7/dev/e1000/e1000_82571.h
haiku/vendor/freebsd/RELENG_7/dev/e1000/e1000_82575.c
haiku/vendor/freebsd/RELENG_7/dev/e1000/e1000_82575.h
haiku/vendor/freebsd/RELENG_7/dev/e1000/e1000_api.c
haiku/vendor/freebsd/RELENG_7/dev/e1000/e1000_api.h
haiku/vendor/freebsd/RELENG_7/dev/e1000/e1000_defines.h
haiku/vendor/freebsd/RELENG_7/dev/e1000/e1000_hw.h
haiku/vendor/freebsd/RELENG_7/dev/e1000/e1000_ich8lan.c
haiku/vendor/freebsd/RELENG_7/dev/e1000/e1000_ich8lan.h
haiku/vendor/freebsd/RELENG_7/dev/e1000/e1000_mac.c
haiku/vendor/freebsd/RELENG_7/dev/e1000/e1000_mac.h
haiku/vendor/freebsd/RELENG_7/dev/e1000/e1000_manage.c
haiku/vendor/freebsd/RELENG_7/dev/e1000/e1000_manage.h
haiku/vendor/freebsd/RELENG_7/dev/e1000/e1000_nvm.c
haiku/vendor/freebsd/RELENG_7/dev/e1000/e1000_nvm.h
haiku/vendor/freebsd/RELENG_7/dev/e1000/e1000_osdep.c
haiku/vendor/freebsd/RELENG_7/dev/e1000/e1000_osdep.h
haiku/vendor/freebsd/RELENG_7/dev/e1000/e1000_phy.c
haiku/vendor/freebsd/RELENG_7/dev/e1000/e1000_phy.h
haiku/vendor/freebsd/RELENG_7/dev/e1000/e1000_regs.h
haiku/vendor/freebsd/RELENG_7/dev/e1000/if_em.c
haiku/vendor/freebsd/RELENG_7/dev/e1000/if_em.h
haiku/vendor/freebsd/RELENG_7/dev/e1000/if_igb.c
haiku/vendor/freebsd/RELENG_7/dev/e1000/if_igb.h
Log:
* e1000 FreeBSD driver (formerly known as separate em and igb drivers)
Added: haiku/vendor/freebsd/RELENG_7/dev/e1000/LICENSE
===================================================================
--- haiku/vendor/freebsd/RELENG_7/dev/e1000/LICENSE 2009-02-18 17:52:51 UTC (rev 29244)
+++ haiku/vendor/freebsd/RELENG_7/dev/e1000/LICENSE 2009-02-18 20:40:07 UTC (rev 29245)
@@ -0,0 +1,31 @@
+$FreeBSD: src/sys/dev/e1000/LICENSE,v 1.1.2.1 2008/08/11 18:33:10 jfv Exp $
+
+ Copyright (c) 2001-2008, Intel Corporation
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ 3. Neither the name of the Intel Corporation nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+
Added: haiku/vendor/freebsd/RELENG_7/dev/e1000/README
===================================================================
--- haiku/vendor/freebsd/RELENG_7/dev/e1000/README 2009-02-18 17:52:51 UTC (rev 29244)
+++ haiku/vendor/freebsd/RELENG_7/dev/e1000/README 2009-02-18 20:40:07 UTC (rev 29245)
@@ -0,0 +1,405 @@
+$FreeBSD: src/sys/dev/e1000/README,v 1.1.2.1 2008/08/11 18:33:10 jfv Exp $
+FreeBSD* Driver for Intel Network Connection
+=============================================
+
+May 30, 2007
+
+
+Contents
+========
+
+- Overview
+- Identifying Your Adapter
+- Building and Installation
+- Speed and Duplex Configuration
+- Additional Configurations
+- Known Limitations
+- Support
+- License
+
+
+Overview
+========
+
+This file describes the FreeBSD* driver for Intel Network Connection.
+This driver has been developed for use with FreeBSD, Release 7.x.
+
+For questions related to hardware requirements, refer to the documentation
+supplied with your Gigabit adapter. All hardware requirements listed
+apply to use with FreeBSD.
+
+
+Identifying Your Adapter
+========================
+
+For information on how to identify your adapter, go to the Adapter &
+Driver ID Guide at:
+
+http://support.intel.com/support/network/sb/cs-012904.htm
+
+
+For the latest Intel network drivers for FreeBSD, see:
+
+http://downloadfinder.intel.com/scripts-df-external/support_intel.aspx
+
+
+NOTE: Mobile adapters are not fully supported.
+NOTE: The Intel(R) 82562v 10/100 Network Connection only provides 10/100
+support.
+
+Building and Installation
+=========================
+
+NOTE: The driver can be installed as a dynamic loadable kernel module or
+ compiled into the kernel. You must have kernel sources installed in
+ order to compile the driver module.
+
+In the instructions below, x.x.x is the driver version as indicated in the
+name of the driver tar file.
+
+1. Move the base driver tar file to the directory of your choice. For
+ example, use /home/username/em or /usr/local/src/em.
+
+2. Untar/unzip the archive:
+
+ tar xzvf em-x.x.x.tar.gz
+
+ This will create an em-x.x.x directory.
+
+3. To create a loadable module, perform the following steps.
+ NOTE: To compile the driver into the kernel, go directly to step 4.
+
+ a. To compile the module
+
+ cd em-x.x.x
+ make
+
+ b. To install the compiled module to the system directory:
+
+ make install
+
+ c. If you want the driver to load automatically when the system is booted:
+
+ 1. Edit /boot/loader.conf, and add the following line:
+
+ if_em_load="YES"
+
+4. To compile the driver into the kernel, enter:
+
+ cd em-x.x.x/src
+ cp *.[ch] /usr/src/sys/dev/em
+
+ Edit the kernel configuration file (i.e., GENERIC or MYKERNEL) in
+ /usr/src/sys/i386/conf, and ensure the following line is present:
+
+ device em
+
+ Compile and install the kernel. The system must be rebooted for the
+ kernel updates to take effect. For additional information on compiling
+ the kernel, consult the FreeBSD operating system documentation.
+
+5. To assign an IP address to the interface, enter the following:
+
+ ifconfig em
+
+6. Verify that the interface works. Enter the following, where
+ is the IP address for another machine on the same subnet as the interface
+ that is being tested:
+
+ ping
+
+7. To configure the IP address to remain after reboot, edit /etc/rc.conf,
+ and create the appropriate ifconfig_ementry:
+
+ ifconfig_em=""
+
+ Example usage:
+
+ ifconfig_em0="inet 192.168.10.1 netmask 255.255.255.0"
+
+ NOTE: For assistance, see the ifconfig man page.
+
+
+Speed and Duplex Configuration
+==============================
+
+By default, the adapter auto-negotiates the speed and duplex of the
+connection. If there is a specific need, the ifconfig utility can be used to
+configure the speed and duplex settings on the adapter. Example usage:
+
+ ifconfig em media 100baseTX mediaopt
+ full-duplex
+
+ NOTE: Only use mediaopt to set the driver to full-duplex. If mediaopt is
+ not specified and you are not running at gigabit speed, the driver
+ defaults to half-duplex.
+
+If the interface is currently forced to 100 full duplex, in order to change
+to half duplex you must use this command:
+
+ ifconfig em media 100baseTX -mediaopt
+ full-duplex
+
+
+This driver supports the following media type options:
+
+ autoselect - Enables auto-negotiation for speed and duplex.
+
+ 10baseT/UTP - Sets speed to 10 Mbps. Use the ifconfig mediaopt
+ option to select full-duplex mode.
+
+ 100baseTX - Sets speed to 100 Mbps. Use the ifconfig mediaopt
+ option to select full-duplex mode.
+
+ 1000baseTX - Sets speed to 1000 Mbps. In this case, the driver
+ supports only full-duplex mode.
+
+ 1000baseSX - Sets speed to 1000 Mbps. In this case, the driver
+ supports only full-duplex mode.
+
+For more information on the ifconfig utility, see the ifconfig man page.
+
+
+Additional Configurations
+=========================
+
+The driver supports Transmit/Receive Checksum Offload and Jumbo Frames on
+all but the 82542-based adapters. For specific adapters, refer to the
+Identifying Your Adapter section.
+
+ Jumbo Frames
+ ------------
+ To enable Jumbo Frames, use the ifconfig utility to set the Maximum
+ Transport Unit (MTU) frame size above its default of 1500 bytes.
+
+ The Jumbo Frames MTU range for Intel Adapters is 1500 to 16110. To modify
+ the setting, enter the following:
+
+ ifconfig em mtu 9000
+
+ To confirm the MTU used between two specific devices, use:
+
+ route get
+
+ Notes:
+
+ - Only enable Jumbo Frames if your network infrastructure supports them.
+
+ - To enable Jumbo Frames, increase the MTU size on the interface beyond
+ 1500.
+
+ - The Jumbo Frames setting on the switch must be set to at least 22 bytes
+ larger than that of the MTU.
+
+ - The maximum MTU setting for Jumbo Frames is 16110. This value coincides
+ with the maximum Jumbo Frames size of 16128.
+
+ - Some Intel gigabit adapters that support Jumbo Frames have a frame size
+ limit of 9238 bytes, with a corresponding MTU size limit of 9216 bytes.
+ The adapters with this limitation are based on the Intel(R) 82571EB,
+ 82572EI, 82573L, 82566, 82562, and 80003ES2LAN controller. These
+ correspond to the following product names:
+ Intel(R) PRO/1000 PT Server Adapter
+ Intel(R) PRO/1000 PT Desktop Adapter
+ Intel(R) PRO/1000 PT Network Connection
+ Intel(R) PRO/1000 PT Dual Port Server Adapter
+ Intel(R) PRO/1000 PT Dual Port Network Connection
+ Intel(R) PRO/1000 PT Quad Port Server Adapter
+ Intel(R) PRO/1000 PF Quad Port Server Adapter
+ Intel(R) PRO/1000 PF Server Adapter
+ Intel(R) PRO/1000 PF Network Connection
+ Intel(R) PRO/1000 PF Dual Port Server Adapter
+ Intel(R) PRO/1000 PB Server Connection
+ Intel(R) PRO/1000 PL Network Connection
+ Intel(R) PRO/1000 EB Network Connection with I/O Acceleration
+ Intel(R) PRO/1000 EB Backplane Connection with I/O Acceleration
+ Intel(R) 82566DM-2 Gigabit Network Connection
+
+ - Adapters based on the Intel(R) 82542 and 82573V/E controller do not
+ support Jumbo Frames. These correspond to the following product names:
+ Intel(R) PRO/1000 Gigabit Server Adapter
+ Intel(R) PRO/1000 PM Network Connection
+
+ - Using Jumbo Frames at 10 or 100 Mbps may result in poor performance or
+ loss of link.
+
+ - The following adapters do not support Jumbo Frames:
+ Intel(R) 82562V 10/100 Network Connection
+ Intel(R) 82566DM Gigabit Network Connection
+ Intel(R) 82566DC Gigabit Network Connection
+ Intel(R) 82566MM Gigabit Network Connection
+ Intel(R) 82566MC Gigabit Network Connection
+ Intel(R) 82562GT 10/100 Network Connection
+ Intel(R) 82562G 10/100 Network Connection
+ Intel(R) 82566DC-2 Gigabit Network Connection
+ Intel(R) 82562V-2 10/100 Network Connection
+ Intel(R) 82562G-2 10/100 Network Connection
+ Intel(R) 82562GT-2 10/100 Network Connection
+
+ VLANs
+ -----
+ To create a new VLAN interface:
+
+ ifconfig create
+
+ To associate the VLAN interface with a physical interface and
+ assign a VLAN ID, IP address, and netmask:
+
+ ifconfig netmask vlan
+ vlandev
+
+ Example:
+
+ ifconfig vlan10 10.0.0.1 netmask 255.255.255.0 vlan 10 vlandev em0
+
+ In this example, all packets will be marked on egress with 802.1Q VLAN
+ tags, specifying a VLAN ID of 10.
+
+ To remove a VLAN interface:
+
+ Intel Network Connection ifconfig destroy
+
+
+ Polling
+ -------
+
+ To enable polling in the driver, add the following options to the kernel
+ configuration, and then recompile the kernel:
+
+ options DEVICE_POLLING
+ options HZ=1000
+
+ At runtime use:
+ ifconfig emX polling (to turn polling on)
+ and:
+ ifconfig emX -polling (to turn it off)
+
+
+ Checksum Offload
+ ----------------
+ Checksum offloading is not supported on 82542 Gigabit adapters.
+
+ Checksum offloading supports both TCP and UDP packets and is
+ supported for both transmit and receive.
+
+ Checksum offloading can be enabled or disabled using ifconfig.
+ Both transmit and receive offloading will be either enabled or
+ disabled together. You cannot enable/disable one without the other.
+
+ To enable checksum offloading:
+
+ ifconfig rxcsum
+
+ To disable checksum offloading:
+
+ ifconfig -rxcsum
+
+ To confirm the current setting:
+
+ ifconfig
+
+ Look for the presence or absence of the following line:
+
+ options=3
+
+ See the ifconfig man page for further information.
+
+
+ TSO
+ ---
+ The FreeBSD driver offers support for TSO (TCP Segmentation Offload).
+
+ You can enable/disable it in two ways/places:
+
+ - sysctl net.inet.tcp.tso=0 (or 1 to enable it)
+
+ Doing this disables TSO in the stack and will affect all adapters.
+
+ - ifconfig emX -tso
+
+ Doing this will disable TSO only for this adapter.
+
+ To enable:
+
+ - ifconfig emX tso
+
+ NOTES: By default only PCI-Express adapters are ENABLED to do TSO. Others
+ can be enabled by the user at their own risk
+ TSO is not supported on 82547 and 82544-based adapters, as well as older adapters.
+
+
+Known Limitations
+=================
+
+ Detected Tx Unit Hang in Quad Port Adapters
+ -------------------------------------------
+
+ In some cases ports 3 and 4 wont pass traffic. Ports 1 and 2 don't show
+ any errors and will pass traffic.
+
+ This issue MAY be resolved by updating to the latest BIOS. You can
+ check your system's BIOS by downloading the Linux Firmware Developer Kit
+ that can be obtained at http://www.linuxfirmwarekit.org/
+
+
+ There are known performance issues with this driver when running UDP traffic
+ with Jumbo Frames.
+ ----------------------------------------------------------------------------
+
+ 82541/82547 can't link or is slow to link with some link partners
+ -----------------------------------------------------------------
+
+ There is a known compatibility issue where time to link is slow or link is not
+ established between 82541/82547 controllers and some switches. Known switches
+ include:
+ Planex FXG-08TE
+ I-O Data ETG-SH8
+
+ The driver can be compiled with the following changes:
+
+ Edit ./em.x.x.x/src/if_em.h to change the #define EM_MASTER_SLAVE
+ For example, change from:
+
+ #define EM_MASTER_SLAVE e1000_ms_hw_default
+ to:
+ #define EM_MASTER_SLAVE 2
+
+ Use one of the following options:
+ 1 = Master mode
+ 2 = Slave mode
+ 3 = Auto master/slave
+ Setting 2 is recommended.
+
+ Recompile the module:
+ a. To compile the module
+ cd em-x.x.x
+ make clean
+ make
+
+ b. To install the compiled module in system directory:
+ make install
+
+
+Support
+=======
+
+For general information and support, go to the Intel support website at:
+
+ http://support.intel.com
+
+If an issue is identified, support is through email only at:
+freebsdnic at mailbox.intel.com
+
+
+License
+=======
+
+This software program is released under the terms of a license agreement
+between you ('Licensee') and Intel. Do not use or load this software or any
+associated materials (collectively, the 'Software') until you have carefully
+read the full terms and conditions of the LICENSE located in this software
+package. By loading or using the Software, you agree to the terms of this
+Agreement. If you do not agree with the terms of this Agreement, do not
+install or use the Software.
+
+* Other names and brands may be claimed as the property of others.
Added: haiku/vendor/freebsd/RELENG_7/dev/e1000/e1000_80003es2lan.c
===================================================================
--- haiku/vendor/freebsd/RELENG_7/dev/e1000/e1000_80003es2lan.c 2009-02-18 17:52:51 UTC (rev 29244)
+++ haiku/vendor/freebsd/RELENG_7/dev/e1000/e1000_80003es2lan.c 2009-02-18 20:40:07 UTC (rev 29245)
@@ -0,0 +1,1533 @@
+/******************************************************************************
+
+ Copyright (c) 2001-2008, Intel Corporation
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ 3. Neither the name of the Intel Corporation nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+
+******************************************************************************/
+/*$FreeBSD: src/sys/dev/e1000/e1000_80003es2lan.c,v 1.1.2.2 2008/12/01 07:13:52 jfv Exp $*/
+
+/*
+ * 80003ES2LAN Gigabit Ethernet Controller (Copper)
+ * 80003ES2LAN Gigabit Ethernet Controller (Serdes)
+ */
+
+#include "e1000_api.h"
+
+static s32 e1000_init_phy_params_80003es2lan(struct e1000_hw *hw);
+static s32 e1000_init_nvm_params_80003es2lan(struct e1000_hw *hw);
+static s32 e1000_init_mac_params_80003es2lan(struct e1000_hw *hw);
+static s32 e1000_acquire_phy_80003es2lan(struct e1000_hw *hw);
+static s32 e1000_acquire_mac_csr_80003es2lan(struct e1000_hw *hw);
+static void e1000_release_phy_80003es2lan(struct e1000_hw *hw);
+static void e1000_release_mac_csr_80003es2lan(struct e1000_hw *hw);
+static s32 e1000_acquire_nvm_80003es2lan(struct e1000_hw *hw);
+static void e1000_release_nvm_80003es2lan(struct e1000_hw *hw);
+static s32 e1000_read_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
+ u32 offset,
+ u16 *data);
+static s32 e1000_write_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
+ u32 offset,
+ u16 data);
+static s32 e1000_write_nvm_80003es2lan(struct e1000_hw *hw, u16 offset,
+ u16 words, u16 *data);
+static s32 e1000_get_cfg_done_80003es2lan(struct e1000_hw *hw);
+static s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw);
+static s32 e1000_get_cable_length_80003es2lan(struct e1000_hw *hw);
+static s32 e1000_get_link_up_info_80003es2lan(struct e1000_hw *hw, u16 *speed,
+ u16 *duplex);
+static s32 e1000_reset_hw_80003es2lan(struct e1000_hw *hw);
+static s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw);
+static s32 e1000_setup_copper_link_80003es2lan(struct e1000_hw *hw);
+static void e1000_clear_hw_cntrs_80003es2lan(struct e1000_hw *hw);
+static s32 e1000_acquire_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask);
+static s32 e1000_cfg_kmrn_10_100_80003es2lan(struct e1000_hw *hw, u16 duplex);
+static s32 e1000_cfg_kmrn_1000_80003es2lan(struct e1000_hw *hw);
+static s32 e1000_cfg_on_link_up_80003es2lan(struct e1000_hw *hw);
+static s32 e1000_read_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,
+ u16 *data);
+static s32 e1000_write_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,
+ u16 data);
+static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw);
+static void e1000_initialize_hw_bits_80003es2lan(struct e1000_hw *hw);
+static void e1000_release_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask);
+static s32 e1000_read_mac_addr_80003es2lan(struct e1000_hw *hw);
+static void e1000_power_down_phy_copper_80003es2lan(struct e1000_hw *hw);
+
+/*
+ * A table for the GG82563 cable length where the range is defined
+ * with a lower bound at "index" and the upper bound at
+ * "index + 5".
+ */
+static const u16 e1000_gg82563_cable_length_table[] =
+ { 0, 60, 115, 150, 150, 60, 115, 150, 180, 180, 0xFF };
+#define GG82563_CABLE_LENGTH_TABLE_SIZE \
+ (sizeof(e1000_gg82563_cable_length_table) / \
+ sizeof(e1000_gg82563_cable_length_table[0]))
+
+/**
+ * e1000_init_phy_params_80003es2lan - Init ESB2 PHY func ptrs.
+ * @hw: pointer to the HW structure
+ **/
+static s32 e1000_init_phy_params_80003es2lan(struct e1000_hw *hw)
+{
+ struct e1000_phy_info *phy = &hw->phy;
+ s32 ret_val = E1000_SUCCESS;
+
+ DEBUGFUNC("e1000_init_phy_params_80003es2lan");
+
+ if (hw->phy.media_type != e1000_media_type_copper) {
+ phy->type = e1000_phy_none;
+ goto out;
+ } else {
+ phy->ops.power_up = e1000_power_up_phy_copper;
+ phy->ops.power_down = e1000_power_down_phy_copper_80003es2lan;
+ }
+
+ phy->addr = 1;
+ phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT;
+ phy->reset_delay_us = 100;
+ phy->type = e1000_phy_gg82563;
+
+ phy->ops.acquire = e1000_acquire_phy_80003es2lan;
+ phy->ops.check_polarity = e1000_check_polarity_m88;
+ phy->ops.check_reset_block = e1000_check_reset_block_generic;
+ phy->ops.commit = e1000_phy_sw_reset_generic;
+ phy->ops.get_cfg_done = e1000_get_cfg_done_80003es2lan;
+ phy->ops.get_info = e1000_get_phy_info_m88;
+ phy->ops.release = e1000_release_phy_80003es2lan;
+ phy->ops.reset = e1000_phy_hw_reset_generic;
+ phy->ops.set_d3_lplu_state = e1000_set_d3_lplu_state_generic;
+
+ phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_80003es2lan;
+ phy->ops.get_cable_length = e1000_get_cable_length_80003es2lan;
+ phy->ops.read_reg = e1000_read_phy_reg_gg82563_80003es2lan;
+ phy->ops.write_reg = e1000_write_phy_reg_gg82563_80003es2lan;
+
+ phy->ops.cfg_on_link_up = e1000_cfg_on_link_up_80003es2lan;
+
+ /* This can only be done after all function pointers are setup. */
+ ret_val = e1000_get_phy_id(hw);
+
+ /* Verify phy id */
+ if (phy->id != GG82563_E_PHY_ID) {
+ ret_val = -E1000_ERR_PHY;
+ goto out;
+ }
+
+out:
+ return ret_val;
+}
+
+/**
+ * e1000_init_nvm_params_80003es2lan - Init ESB2 NVM func ptrs.
+ * @hw: pointer to the HW structure
+ **/
+static s32 e1000_init_nvm_params_80003es2lan(struct e1000_hw *hw)
+{
+ struct e1000_nvm_info *nvm = &hw->nvm;
+ u32 eecd = E1000_READ_REG(hw, E1000_EECD);
+ u16 size;
+
+ DEBUGFUNC("e1000_init_nvm_params_80003es2lan");
+
+ nvm->opcode_bits = 8;
+ nvm->delay_usec = 1;
+ switch (nvm->override) {
+ case e1000_nvm_override_spi_large:
+ nvm->page_size = 32;
+ nvm->address_bits = 16;
+ break;
+ case e1000_nvm_override_spi_small:
+ nvm->page_size = 8;
+ nvm->address_bits = 8;
+ break;
+ default:
+ nvm->page_size = eecd & E1000_EECD_ADDR_BITS ? 32 : 8;
+ nvm->address_bits = eecd & E1000_EECD_ADDR_BITS ? 16 : 8;
+ break;
+ }
+
+ nvm->type = e1000_nvm_eeprom_spi;
+
+ size = (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >>
+ E1000_EECD_SIZE_EX_SHIFT);
+
+ /*
+ * Added to a constant, "size" becomes the left-shift value
+ * for setting word_size.
+ */
+ size += NVM_WORD_SIZE_BASE_SHIFT;
+
+ /* EEPROM access above 16k is unsupported */
+ if (size > 14)
+ size = 14;
+ nvm->word_size = 1 << size;
+
+ /* Function Pointers */
+ nvm->ops.acquire = e1000_acquire_nvm_80003es2lan;
+ nvm->ops.read = e1000_read_nvm_eerd;
+ nvm->ops.release = e1000_release_nvm_80003es2lan;
+ nvm->ops.update = e1000_update_nvm_checksum_generic;
+ nvm->ops.valid_led_default = e1000_valid_led_default_generic;
+ nvm->ops.validate = e1000_validate_nvm_checksum_generic;
+ nvm->ops.write = e1000_write_nvm_80003es2lan;
+
+ return E1000_SUCCESS;
+}
+
+/**
+ * e1000_init_mac_params_80003es2lan - Init ESB2 MAC func ptrs.
+ * @hw: pointer to the HW structure
+ **/
+static s32 e1000_init_mac_params_80003es2lan(struct e1000_hw *hw)
+{
+ struct e1000_mac_info *mac = &hw->mac;
+ s32 ret_val = E1000_SUCCESS;
+
+ DEBUGFUNC("e1000_init_mac_params_80003es2lan");
+
+ /* Set media type */
+ switch (hw->device_id) {
+ case E1000_DEV_ID_80003ES2LAN_SERDES_DPT:
+ hw->phy.media_type = e1000_media_type_internal_serdes;
+ break;
+ default:
+ hw->phy.media_type = e1000_media_type_copper;
+ break;
+ }
+
+ /* Set mta register count */
+ mac->mta_reg_count = 128;
+ /* Set rar entry count */
+ mac->rar_entry_count = E1000_RAR_ENTRIES;
+ /* Set if part includes ASF firmware */
+ mac->asf_firmware_present = TRUE;
+ /* Set if manageability features are enabled. */
+ mac->arc_subsystem_valid =
+ (E1000_READ_REG(hw, E1000_FWSM) & E1000_FWSM_MODE_MASK)
+ ? TRUE : FALSE;
+
+ /* Function pointers */
+
+ /* bus type/speed/width */
+ mac->ops.get_bus_info = e1000_get_bus_info_pcie_generic;
+ /* reset */
+ mac->ops.reset_hw = e1000_reset_hw_80003es2lan;
+ /* hw initialization */
+ mac->ops.init_hw = e1000_init_hw_80003es2lan;
+ /* link setup */
+ mac->ops.setup_link = e1000_setup_link_generic;
+ /* physical interface link setup */
+ mac->ops.setup_physical_interface =
+ (hw->phy.media_type == e1000_media_type_copper)
+ ? e1000_setup_copper_link_80003es2lan
+ : e1000_setup_fiber_serdes_link_generic;
+ /* check for link */
+ switch (hw->phy.media_type) {
+ case e1000_media_type_copper:
+ mac->ops.check_for_link = e1000_check_for_copper_link_generic;
+ break;
+ case e1000_media_type_fiber:
+ mac->ops.check_for_link = e1000_check_for_fiber_link_generic;
+ break;
+ case e1000_media_type_internal_serdes:
+ mac->ops.check_for_link = e1000_check_for_serdes_link_generic;
+ break;
+ default:
+ ret_val = -E1000_ERR_CONFIG;
+ goto out;
+ break;
+ }
+ /* check management mode */
+ mac->ops.check_mng_mode = e1000_check_mng_mode_generic;
+ /* multicast address update */
+ mac->ops.update_mc_addr_list = e1000_update_mc_addr_list_generic;
+ /* writing VFTA */
+ mac->ops.write_vfta = e1000_write_vfta_generic;
+ /* clearing VFTA */
+ mac->ops.clear_vfta = e1000_clear_vfta_generic;
+ /* setting MTA */
+ mac->ops.mta_set = e1000_mta_set_generic;
+ /* read mac address */
+ mac->ops.read_mac_addr = e1000_read_mac_addr_80003es2lan;
+ /* blink LED */
+ mac->ops.blink_led = e1000_blink_led_generic;
+ /* setup LED */
+ mac->ops.setup_led = e1000_setup_led_generic;
+ /* cleanup LED */
+ mac->ops.cleanup_led = e1000_cleanup_led_generic;
+ /* turn on/off LED */
+ mac->ops.led_on = e1000_led_on_generic;
+ mac->ops.led_off = e1000_led_off_generic;
+ /* clear hardware counters */
+ mac->ops.clear_hw_cntrs = e1000_clear_hw_cntrs_80003es2lan;
+ /* link info */
+ mac->ops.get_link_up_info = e1000_get_link_up_info_80003es2lan;
+
+out:
+ return ret_val;
+}
+
+/**
+ * e1000_init_function_pointers_80003es2lan - Init ESB2 func ptrs.
+ * @hw: pointer to the HW structure
+ *
+ * Called to initialize all function pointers and parameters.
+ **/
+void e1000_init_function_pointers_80003es2lan(struct e1000_hw *hw)
+{
+ DEBUGFUNC("e1000_init_function_pointers_80003es2lan");
+
+ hw->mac.ops.init_params = e1000_init_mac_params_80003es2lan;
+ hw->nvm.ops.init_params = e1000_init_nvm_params_80003es2lan;
+ hw->phy.ops.init_params = e1000_init_phy_params_80003es2lan;
+ e1000_get_bus_info_pcie_generic(hw);
+}
+
+/**
+ * e1000_acquire_phy_80003es2lan - Acquire rights to access PHY
+ * @hw: pointer to the HW structure
+ *
+ * A wrapper to acquire access rights to the correct PHY.
+ **/
+static s32 e1000_acquire_phy_80003es2lan(struct e1000_hw *hw)
+{
+ u16 mask;
+
+ DEBUGFUNC("e1000_acquire_phy_80003es2lan");
+
+ mask = hw->bus.func ? E1000_SWFW_PHY1_SM : E1000_SWFW_PHY0_SM;
+ return e1000_acquire_swfw_sync_80003es2lan(hw, mask);
+}
+
+/**
+ * e1000_release_phy_80003es2lan - Release rights to access PHY
+ * @hw: pointer to the HW structure
+ *
+ * A wrapper to release access rights to the correct PHY.
+ **/
+static void e1000_release_phy_80003es2lan(struct e1000_hw *hw)
+{
+ u16 mask;
+
+ DEBUGFUNC("e1000_release_phy_80003es2lan");
+
+ mask = hw->bus.func ? E1000_SWFW_PHY1_SM : E1000_SWFW_PHY0_SM;
+ e1000_release_swfw_sync_80003es2lan(hw, mask);
+}
+
+
+/**
+ * e1000_acquire_mac_csr_80003es2lan - Acquire rights to access Kumeran register
+ * @hw: pointer to the HW structure
+ *
+ * Acquire the semaphore to access the Kumeran interface.
+ *
+ **/
+static s32 e1000_acquire_mac_csr_80003es2lan(struct e1000_hw *hw)
+{
+ u16 mask;
+
+ DEBUGFUNC("e1000_acquire_mac_csr_80003es2lan");
+
+ mask = E1000_SWFW_CSR_SM;
+
+ return e1000_acquire_swfw_sync_80003es2lan(hw, mask);
+}
+
+/**
+ * e1000_release_mac_csr_80003es2lan - Release rights to access Kumeran Register
+ * @hw: pointer to the HW structure
+ *
+ * Release the semaphore used to access the Kumeran interface
+ **/
+static void e1000_release_mac_csr_80003es2lan(struct e1000_hw *hw)
+{
+ u16 mask;
+
+ DEBUGFUNC("e1000_release_mac_csr_80003es2lan");
+
+ mask = E1000_SWFW_CSR_SM;
+
+ e1000_release_swfw_sync_80003es2lan(hw, mask);
+}
+
+/**
+ * e1000_acquire_nvm_80003es2lan - Acquire rights to access NVM
+ * @hw: pointer to the HW structure
+ *
+ * Acquire the semaphore to access the EEPROM.
+ **/
+static s32 e1000_acquire_nvm_80003es2lan(struct e1000_hw *hw)
+{
+ s32 ret_val;
+
+ DEBUGFUNC("e1000_acquire_nvm_80003es2lan");
+
+ ret_val = e1000_acquire_swfw_sync_80003es2lan(hw, E1000_SWFW_EEP_SM);
+ if (ret_val)
+ goto out;
+
+ ret_val = e1000_acquire_nvm_generic(hw);
+
+ if (ret_val)
+ e1000_release_swfw_sync_80003es2lan(hw, E1000_SWFW_EEP_SM);
+
+out:
+ return ret_val;
+}
+
+/**
+ * e1000_release_nvm_80003es2lan - Relinquish rights to access NVM
+ * @hw: pointer to the HW structure
+ *
+ * Release the semaphore used to access the EEPROM.
+ **/
+static void e1000_release_nvm_80003es2lan(struct e1000_hw *hw)
+{
+ DEBUGFUNC("e1000_release_nvm_80003es2lan");
+
+ e1000_release_nvm_generic(hw);
+ e1000_release_swfw_sync_80003es2lan(hw, E1000_SWFW_EEP_SM);
+}
+
+/**
+ * e1000_acquire_swfw_sync_80003es2lan - Acquire SW/FW semaphore
+ * @hw: pointer to the HW structure
+ * @mask: specifies which semaphore to acquire
+ *
+ * Acquire the SW/FW semaphore to access the PHY or NVM. The mask
+ * will also specify which port we're acquiring the lock for.
+ **/
+static s32 e1000_acquire_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask)
+{
+ u32 swfw_sync;
+ u32 swmask = mask;
+ u32 fwmask = mask << 16;
+ s32 ret_val = E1000_SUCCESS;
+ s32 i = 0, timeout = 50;
+
+ DEBUGFUNC("e1000_acquire_swfw_sync_80003es2lan");
+
+ while (i < timeout) {
+ if (e1000_get_hw_semaphore_generic(hw)) {
+ ret_val = -E1000_ERR_SWFW_SYNC;
+ goto out;
+ }
+
+ swfw_sync = E1000_READ_REG(hw, E1000_SW_FW_SYNC);
+ if (!(swfw_sync & (fwmask | swmask)))
+ break;
+
+ /*
+ * Firmware currently using resource (fwmask)
+ * or other software thread using resource (swmask)
+ */
+ e1000_put_hw_semaphore_generic(hw);
+ msec_delay_irq(5);
+ i++;
+ }
+
+ if (i == timeout) {
+ DEBUGOUT("Driver can't access resource, SW_FW_SYNC timeout.\n");
+ ret_val = -E1000_ERR_SWFW_SYNC;
+ goto out;
+ }
+
+ swfw_sync |= swmask;
+ E1000_WRITE_REG(hw, E1000_SW_FW_SYNC, swfw_sync);
+
+ e1000_put_hw_semaphore_generic(hw);
+
+out:
+ return ret_val;
+}
+
+/**
+ * e1000_release_swfw_sync_80003es2lan - Release SW/FW semaphore
+ * @hw: pointer to the HW structure
+ * @mask: specifies which semaphore to acquire
+ *
+ * Release the SW/FW semaphore used to access the PHY or NVM. The mask
+ * will also specify which port we're releasing the lock for.
+ **/
+static void e1000_release_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask)
+{
+ u32 swfw_sync;
+
+ DEBUGFUNC("e1000_release_swfw_sync_80003es2lan");
+
+ while (e1000_get_hw_semaphore_generic(hw) != E1000_SUCCESS)
+ ; /* Empty */
+
+ swfw_sync = E1000_READ_REG(hw, E1000_SW_FW_SYNC);
+ swfw_sync &= ~mask;
+ E1000_WRITE_REG(hw, E1000_SW_FW_SYNC, swfw_sync);
+
+ e1000_put_hw_semaphore_generic(hw);
+}
+
+/**
+ * e1000_read_phy_reg_gg82563_80003es2lan - Read GG82563 PHY register
+ * @hw: pointer to the HW structure
+ * @offset: offset of the register to read
+ * @data: pointer to the data returned from the operation
+ *
+ * Read the GG82563 PHY register.
+ **/
+static s32 e1000_read_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
+ u32 offset, u16 *data)
+{
+ s32 ret_val;
+ u32 page_select;
+ u16 temp;
+
+ DEBUGFUNC("e1000_read_phy_reg_gg82563_80003es2lan");
+
+ ret_val = e1000_acquire_phy_80003es2lan(hw);
+ if (ret_val)
+ goto out;
+
+ /* Select Configuration Page */
+ if ((offset & MAX_PHY_REG_ADDRESS) < GG82563_MIN_ALT_REG) {
+ page_select = GG82563_PHY_PAGE_SELECT;
+ } else {
+ /*
+ * Use Alternative Page Select register to access
+ * registers 30 and 31
+ */
+ page_select = GG82563_PHY_PAGE_SELECT_ALT;
+ }
+
+ temp = (u16)((u16)offset >> GG82563_PAGE_SHIFT);
+ ret_val = e1000_write_phy_reg_mdic(hw, page_select, temp);
+ if (ret_val) {
+ e1000_release_phy_80003es2lan(hw);
+ goto out;
+ }
+
+ /*
+ * The "ready" bit in the MDIC register may be incorrectly set
+ * before the device has completed the "Page Select" MDI
+ * transaction. So we wait 200us after each MDI command...
+ */
+ usec_delay(200);
+
+ /* ...and verify the command was successful. */
+ ret_val = e1000_read_phy_reg_mdic(hw, page_select, &temp);
+
+ if (((u16)offset >> GG82563_PAGE_SHIFT) != temp) {
+ ret_val = -E1000_ERR_PHY;
+ e1000_release_phy_80003es2lan(hw);
[... truncated: 34166 lines follow ...]
From julun at mail.berlios.de Wed Feb 18 21:52:02 2009
From: julun at mail.berlios.de (julun at BerliOS)
Date: Wed, 18 Feb 2009 21:52:02 +0100
Subject: [Haiku-commits] r29246 -
haiku/trunk/src/add-ons/kernel/drivers/network/ipro1000/dev
Message-ID: <200902182052.n1IKq2YE017793@sheep.berlios.de>
Author: julun
Date: 2009-02-18 21:52:02 +0100 (Wed, 18 Feb 2009)
New Revision: 29246
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29246&view=rev
Added:
haiku/trunk/src/add-ons/kernel/drivers/network/ipro1000/dev/e1000/
Log:
* integrate e1000 FreeBSD driver
Copied: haiku/trunk/src/add-ons/kernel/drivers/network/ipro1000/dev/e1000 (from rev 29245, haiku/vendor/freebsd/RELENG_7/dev/e1000)
From ingo_weinhold at gmx.de Wed Feb 18 23:15:58 2009
From: ingo_weinhold at gmx.de (Ingo Weinhold)
Date: Wed, 18 Feb 2009 23:15:58 +0100
Subject: [Haiku-commits] r29199 - in haiku/trunk: headers/os/drivers
src/add-ons/kernel/file_systems/iso9660 src/system/kernel/fs
In-Reply-To: <14448352655-BeMail@haiku>
References: <14448352655-BeMail@haiku>
Message-ID: <20090218231558.350.1@knochen-vm.localdomain>
On 2009-02-18 at 21:33:39 [+0100], Michael Lotz wrote:
> > On 2009-02-15 at 15:06:47 [+0100], Michael Lotz wrote:
> > > > Exactly. Also the new get_vnode() parameter should be
> > > > superfluous,
> > > > since
> > > > vnode cookie and operations of the underlying FS layer are passed
> > > > to
> > > > the
> > > > create_sub_vnode() hook of your layer.
> > >
> > > Actually I need it not only for the sub nodes I create. When
> > > resolving
> > > the attribute files I need to resolve the parent directory and then
> > > the
> > > attribute directory. So I use get_vnode() on the parent and
> > > attribute
> > > directory and need to get the vnode ops of them.
> >
> > Yep, but those are still nodes of the underlying layer and respective
> > subnodes are created for your layer. So you could just get the node's
> > cookie for your layer (by passing your layer's fs_volume to get_
> > vnode()) --
> > which should contain the underlying layer's cookie and ops (stored by
> > the
> > create_sub_vnode() hook).
>
> I see that now, but what I don't see is how the get_vnode() call would
> work. Right now it will always call get_super_vnode() to resolve to the
> super vnode and return that. Of course I could supply my own fs_volume
> to that call, but how would I know in get_super_vnode() that I should
> return my own private node? Because as it is currently, I will always
> get my own fs_volume in get_super_vnode() due to FS_CALL() resolving
> and passing the sub-most volume (overlay in that case) anyway.
get_super_vnode() has two fs_volume* parameters. The first one is the usual
pointer to the struct for your layer. The second one ("superVolume") is the
one specifying the layer for which the fs_vnode is requested. The
get_super_vnode() hook of an FS layer implementation should check whether
superVolume refers to this layer. If so, it would return its own fs_vnode.
If not, if would invoke the get_super_vnode() of the underlying layer, if
that hook exists, or directly return the super node, if it doesn't.
The only previously existing implementation of the hook,
src/system/kernel/fs/fifo.cpp:fifo_get_super_vnode(), does at least the
second part. I doesn't have to check superVolume, since FIFO nodes don't
belong to any FS layer -- they just sit on top of individual nodes.
> > At least that was how I intended it to work. If you insist on get_
> > vnode()
> > returning the ops, too, I'd prefer a single fs_vnode* parameter,
> > though.
>
> That was my first thought as well and I did make it a fs_vnode. But
> when later adjusting the file system modules I quickly realized it was
> pretty impractical to use. As most of the time you just use some
> pointer, for example residing inside an existing structure, it means
> adding a fs_vnode to be filled and then extracting the pointer again.
> That's why I then just made it an additional argument.
Yeah, good point. It's still a bit ugly to have parameter that is almost
always unused.
CU, Ingo
From julun at mail.berlios.de Wed Feb 18 23:34:53 2009
From: julun at mail.berlios.de (julun at BerliOS)
Date: Wed, 18 Feb 2009 23:34:53 +0100
Subject: [Haiku-commits] r29247 - in haiku/trunk/src:
add-ons/kernel/drivers/network/ipro1000/dev
add-ons/kernel/drivers/network/ipro1000/dev/e1000
libs/compat/freebsd_network libs/compat/freebsd_network/compat/net
Message-ID: <200902182234.n1IMYr0s031355@sheep.berlios.de>
Author: julun
Date: 2009-02-18 23:34:52 +0100 (Wed, 18 Feb 2009)
New Revision: 29247
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29247&view=rev
Added:
haiku/trunk/src/add-ons/kernel/drivers/network/ipro1000/dev/e1000/Jamfile
haiku/trunk/src/add-ons/kernel/drivers/network/ipro1000/dev/e1000/glue.c
haiku/trunk/src/libs/compat/freebsd_network/eventhandler.c
Modified:
haiku/trunk/src/add-ons/kernel/drivers/network/ipro1000/dev/Jamfile
haiku/trunk/src/add-ons/kernel/drivers/network/ipro1000/dev/e1000/e1000_osdep.h
haiku/trunk/src/add-ons/kernel/drivers/network/ipro1000/dev/e1000/if_em.c
haiku/trunk/src/libs/compat/freebsd_network/Jamfile
haiku/trunk/src/libs/compat/freebsd_network/compat/net/if.h
haiku/trunk/src/libs/compat/freebsd_network/compat/net/if_var.h
Log:
* update freebsd compat with stubbed eventhandler
* get e1000 to compile
* remove dev/em from the build (might be removed later on)
* tested on VirtualBox (gcc2,gcc4), VMware(gcc4) and natively on
ThinkPad T500 (gcc4)
* courtesy of Michael Weirauch (emwe)
Modified: haiku/trunk/src/add-ons/kernel/drivers/network/ipro1000/dev/Jamfile
===================================================================
--- haiku/trunk/src/add-ons/kernel/drivers/network/ipro1000/dev/Jamfile 2009-02-18 20:52:02 UTC (rev 29246)
+++ haiku/trunk/src/add-ons/kernel/drivers/network/ipro1000/dev/Jamfile 2009-02-18 22:34:52 UTC (rev 29247)
@@ -1,3 +1,3 @@
SubDir HAIKU_TOP src add-ons kernel drivers network ipro1000 dev ;
-SubInclude HAIKU_TOP src add-ons kernel drivers network ipro1000 dev em ;
+SubInclude HAIKU_TOP src add-ons kernel drivers network ipro1000 dev e1000 ;
Added: haiku/trunk/src/add-ons/kernel/drivers/network/ipro1000/dev/e1000/Jamfile
===================================================================
--- haiku/trunk/src/add-ons/kernel/drivers/network/ipro1000/dev/e1000/Jamfile 2009-02-18 20:52:02 UTC (rev 29246)
+++ haiku/trunk/src/add-ons/kernel/drivers/network/ipro1000/dev/e1000/Jamfile 2009-02-18 22:34:52 UTC (rev 29247)
@@ -0,0 +1,30 @@
+SubDir HAIKU_TOP src add-ons kernel drivers network ipro1000 dev e1000 ;
+
+UsePrivateHeaders kernel net ;
+
+UseHeaders [ FDirName $(SUBDIR) .. .. ] : true ;
+UseHeaders [ FDirName $(HAIKU_TOP) src libs compat freebsd_network compat ] : true ;
+
+SubDirCcFlags [ FDefines _KERNEL=1 FBSD_DRIVER=1 EM_FAST_INTR=1 ] ;
+
+KernelAddon ipro1000 :
+ e1000_80003es2lan.c
+ e1000_82540.c
+ e1000_82541.c
+ e1000_82542.c
+ e1000_82543.c
+ e1000_82571.c
+ e1000_82575.c
+ e1000_api.c
+ e1000_ich8lan.c
+ e1000_mac.c
+ e1000_manage.c
+ e1000_nvm.c
+ e1000_osdep.c
+ e1000_phy.c
+ if_em.c
+
+ glue.c
+ : libfreebsd_network.a
+ ;
+
Modified: haiku/trunk/src/add-ons/kernel/drivers/network/ipro1000/dev/e1000/e1000_osdep.h
===================================================================
--- haiku/trunk/src/add-ons/kernel/drivers/network/ipro1000/dev/e1000/e1000_osdep.h 2009-02-18 20:52:02 UTC (rev 29246)
+++ haiku/trunk/src/add-ons/kernel/drivers/network/ipro1000/dev/e1000/e1000_osdep.h 2009-02-18 22:34:52 UTC (rev 29247)
@@ -73,9 +73,9 @@
#define STATIC static
#define FALSE 0
-#define false FALSE /* shared code stupidity */
+//#define false FALSE /* shared code stupidity */
#define TRUE 1
-#define true TRUE
+//#define true TRUE
#define CMD_MEM_WRT_INVALIDATE 0x0010 /* BIT_4 */
#define PCI_COMMAND_REGISTER PCIR_COMMAND
@@ -91,7 +91,7 @@
typedef int32_t s32;
typedef int16_t s16;
typedef int8_t s8;
-typedef boolean_t bool;
+//typedef boolean_t bool;
#define __le16 u16
#define __le32 u32
Added: haiku/trunk/src/add-ons/kernel/drivers/network/ipro1000/dev/e1000/glue.c
===================================================================
--- haiku/trunk/src/add-ons/kernel/drivers/network/ipro1000/dev/e1000/glue.c 2009-02-18 20:52:02 UTC (rev 29246)
+++ haiku/trunk/src/add-ons/kernel/drivers/network/ipro1000/dev/e1000/glue.c 2009-02-18 22:34:52 UTC (rev 29247)
@@ -0,0 +1,13 @@
+#include
+
+HAIKU_FBSD_DRIVER_GLUE(ipro1000, em, pci)
+
+NO_HAIKU_CHECK_DISABLE_INTERRUPTS();
+NO_HAIKU_REENABLE_INTERRUPTS();
+NO_HAIKU_FBSD_MII_DRIVER();
+
+#ifdef EM_FAST_INTR
+ HAIKU_DRIVER_REQUIREMENTS(FBSD_TASKQUEUES | FBSD_FAST_TASKQUEUE);
+#else
+ HAIKU_DRIVER_REQUIREMENTS(0);
+#endif
Modified: haiku/trunk/src/add-ons/kernel/drivers/network/ipro1000/dev/e1000/if_em.c
===================================================================
--- haiku/trunk/src/add-ons/kernel/drivers/network/ipro1000/dev/e1000/if_em.c 2009-02-18 20:52:02 UTC (rev 29246)
+++ haiku/trunk/src/add-ons/kernel/drivers/network/ipro1000/dev/e1000/if_em.c 2009-02-18 22:34:52 UTC (rev 29247)
@@ -2703,7 +2703,7 @@
em_allocate_pci_resources(struct adapter *adapter)
{
device_t dev = adapter->dev;
- int val, rid, error = E1000_SUCCESS;
+ int i, val, rid, error = E1000_SUCCESS;
rid = PCIR_BAR(0);
adapter->memory = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
@@ -2755,7 +2755,7 @@
** Init the resource arrays
** used by MSIX setup
*/
- for (int i = 0; i < 3; i++) {
+ for (i = 0; i < 3; i++) {
adapter->rid[i] = i + 1; /* MSI/X RID starts at 1 */
adapter->tag[i] = NULL;
adapter->res[i] = NULL;
@@ -2853,13 +2853,13 @@
em_allocate_msix(struct adapter *adapter)
{
device_t dev = adapter->dev;
- int error;
+ int error, i;
/* Make sure all interrupts are disabled */
E1000_WRITE_REG(&adapter->hw, E1000_IMC, 0xffffffff);
/* First get the resources */
- for (int i = 0; i < adapter->msi; i++) {
+ for (i = 0; i < adapter->msi; i++) {
adapter->res[i] = bus_alloc_resource_any(dev,
SYS_RES_IRQ, &adapter->rid[i], RF_ACTIVE);
if (adapter->res[i] == NULL) {
@@ -2928,6 +2928,7 @@
em_free_pci_resources(struct adapter *adapter)
{
device_t dev = adapter->dev;
+ int i;
/* Make sure the for loop below runs once */
if (adapter->msi == 0)
@@ -2939,7 +2940,7 @@
* in an array we can do the same logic
* whether its MSIX or just legacy.
*/
- for (int i = 0; i < adapter->msi; i++) {
+ for (i = 0; i < adapter->msi; i++) {
if (adapter->tag[i] != NULL) {
bus_teardown_intr(dev, adapter->res[i],
adapter->tag[i]);
@@ -3357,7 +3358,7 @@
{
device_t dev = adapter->dev;
struct em_buffer *tx_buffer;
- int error;
+ int error, i;
/*
* Create DMA tags for tx descriptors
@@ -3391,7 +3392,7 @@
}
/* Create the descriptor buffer dma maps */
- for (int i = 0; i < adapter->num_tx_desc; i++) {
+ for (i = 0; i < adapter->num_tx_desc; i++) {
tx_buffer = &adapter->tx_buffer_area[i];
error = bus_dmamap_create(adapter->txtag, 0, &tx_buffer->map);
if (error != 0) {
@@ -3416,13 +3417,14 @@
em_setup_transmit_structures(struct adapter *adapter)
{
struct em_buffer *tx_buffer;
+ int i;
/* Clear the old ring contents */
bzero(adapter->tx_desc_base,
(sizeof(struct e1000_tx_desc)) * adapter->num_tx_desc);
/* Free any existing TX buffers */
- for (int i = 0; i < adapter->num_tx_desc; i++, tx_buffer++) {
+ for (i = 0; i < adapter->num_tx_desc; i++, tx_buffer++) {
tx_buffer = &adapter->tx_buffer_area[i];
bus_dmamap_sync(adapter->txtag, tx_buffer->map,
BUS_DMASYNC_POSTWRITE);
@@ -3542,11 +3544,12 @@
em_free_transmit_structures(struct adapter *adapter)
{
struct em_buffer *tx_buffer;
+ int i;
INIT_DEBUGOUT("free_transmit_structures: begin");
if (adapter->tx_buffer_area != NULL) {
- for (int i = 0; i < adapter->num_tx_desc; i++) {
+ for (i = 0; i < adapter->num_tx_desc; i++) {
tx_buffer = &adapter->tx_buffer_area[i];
if (tx_buffer->m_head != NULL) {
bus_dmamap_sync(adapter->txtag, tx_buffer->map,
@@ -4199,6 +4202,7 @@
struct ifnet *ifp = adapter->ifp;
u64 bus_addr;
u32 rctl, rxcsum;
+ int i;
INIT_DEBUGOUT("em_initialize_receive_unit: begin");
@@ -4224,7 +4228,7 @@
** using the EITR register (82574 only)
*/
if (adapter->msix)
- for (int i = 0; i < 4; i++)
+ for (i = 0; i < 4; i++)
E1000_WRITE_REG(&adapter->hw,
E1000_EITR_82574(i), DEFAULT_ITR);
@@ -4375,7 +4379,7 @@
static int
em_rxeof(struct adapter *adapter, int count)
{
- struct ifnet *ifp = adapter->ifp;;
+ struct ifnet *ifp = adapter->ifp;
struct mbuf *mp;
u8 status, accept_frame = 0, eop = 0;
u16 len, desc_len, prev_len_adj;
Modified: haiku/trunk/src/libs/compat/freebsd_network/Jamfile
===================================================================
--- haiku/trunk/src/libs/compat/freebsd_network/Jamfile 2009-02-18 20:52:02 UTC (rev 29246)
+++ haiku/trunk/src/libs/compat/freebsd_network/Jamfile 2009-02-18 22:34:52 UTC (rev 29247)
@@ -15,6 +15,7 @@
compat.c
device.c
driver.c
+ eventhandler.c
fbsd_busdma_x86.c
fbsd_ether.c
fbsd_if_media.c
Modified: haiku/trunk/src/libs/compat/freebsd_network/compat/net/if.h
===================================================================
--- haiku/trunk/src/libs/compat/freebsd_network/compat/net/if.h 2009-02-18 20:52:02 UTC (rev 29246)
+++ haiku/trunk/src/libs/compat/freebsd_network/compat/net/if.h 2009-02-18 22:34:52 UTC (rev 29247)
@@ -26,6 +26,7 @@
#define IFCAP_POLLING 0x0040 /* driver supports polling */
#define IFCAP_VLAN_HWCSUM 0x0080
#define IFCAP_TSO4 0x0100 /* supports TCP segmentation offload */
+#define IFCAP_VLAN_HWFILTER 0x10000 /* interface hw can filter vlan tag */
#define IFCAP_HWCSUM (IFCAP_RXCSUM | IFCAP_TXCSUM)
Modified: haiku/trunk/src/libs/compat/freebsd_network/compat/net/if_var.h
===================================================================
--- haiku/trunk/src/libs/compat/freebsd_network/compat/net/if_var.h 2009-02-18 20:52:02 UTC (rev 29246)
+++ haiku/trunk/src/libs/compat/freebsd_network/compat/net/if_var.h 2009-02-18 22:34:52 UTC (rev 29247)
@@ -137,7 +137,7 @@
struct bpf_if *if_bpf; /* packet filter structure */
u_short if_index; /* numeric abbreviation for this if */
short if_timer; /* time 'til if_watchdog called */
- u_short if_nvlans; /* number of active vlans */
+ struct ifvlantrunk *if_vlantrunk; /* pointer to 802.1q data */
int if_flags; /* up/down, broadcast, etc. */
int if_capabilities; /* interface capabilities */
int if_capenable; /* enabled features */
Added: haiku/trunk/src/libs/compat/freebsd_network/eventhandler.c
===================================================================
--- haiku/trunk/src/libs/compat/freebsd_network/eventhandler.c 2009-02-18 20:52:02 UTC (rev 29246)
+++ haiku/trunk/src/libs/compat/freebsd_network/eventhandler.c 2009-02-18 22:34:52 UTC (rev 29247)
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2009, Haiku, Inc. All Rights Reserved.
+ * Distributed under the terms of the MIT License.
+ *
+ * Authors:
+ * Michael Weirauch, dev at m-phasis.de
+ */
+
+#include
+
+#include
+
+eventhandler_tag
+eventhandler_register(struct eventhandler_list *list,
+ const char *name, void *func, void *arg, int priority)
+{
+ return NULL;
+};
+
+
+void
+eventhandler_deregister(struct eventhandler_list *list,
+ eventhandler_tag tag)
+{
+ //
+};
+
+
+struct eventhandler_list *
+eventhandler_find_list(const char *name)
+{
+ return NULL;
+};
+
+
+void
+eventhandler_prune_list(struct eventhandler_list *list)
+{
+ //
+};
From mmlr at mail.berlios.de Thu Feb 19 02:16:11 2009
From: mmlr at mail.berlios.de (mmlr at mail.berlios.de)
Date: Thu, 19 Feb 2009 02:16:11 +0100
Subject: [Haiku-commits] r29248 - in haiku/trunk: headers/os/drivers
src/system/kernel/fs
Message-ID: <200902190116.n1J1GBTB000729@sheep.berlios.de>
Author: mmlr
Date: 2009-02-19 02:16:07 +0100 (Thu, 19 Feb 2009)
New Revision: 29248
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29248&view=rev
Modified:
haiku/trunk/headers/os/drivers/fs_interface.h
haiku/trunk/src/system/kernel/fs/vfs.cpp
Log:
Add a new fs_volume op all_layers_mounted() that is called when all layers have
been mounted. This is to allow layered filesystems to setup internal data that
requires all the sub/super volumes to be available.
Modified: haiku/trunk/headers/os/drivers/fs_interface.h
===================================================================
--- haiku/trunk/headers/os/drivers/fs_interface.h 2009-02-18 22:34:52 UTC (rev 29247)
+++ haiku/trunk/headers/os/drivers/fs_interface.h 2009-02-19 01:16:07 UTC (rev 29248)
@@ -107,6 +107,7 @@
status_t (*rewind_query)(fs_volume *volume, void *cookie);
/* support for FS layers */
+ status_t (*all_layers_mounted)(fs_volume *volume);
status_t (*create_sub_vnode)(fs_volume *volume, ino_t id, fs_vnode *vnode);
status_t (*delete_sub_vnode)(fs_volume *volume, fs_vnode *vnode);
};
Modified: haiku/trunk/src/system/kernel/fs/vfs.cpp
===================================================================
--- haiku/trunk/src/system/kernel/fs/vfs.cpp 2009-02-18 22:34:52 UTC (rev 29247)
+++ haiku/trunk/src/system/kernel/fs/vfs.cpp 2009-02-19 01:16:07 UTC (rev 29248)
@@ -7023,6 +7023,13 @@
volume = volume->super_volume;
}
+
+ volume = mount->volume;
+ while (volume) {
+ if (volume->ops->all_layers_mounted != NULL)
+ volume->ops->all_layers_mounted(volume);
+ volume = volume->super_volume;
+ }
}
// the root node is supposed to be owned by the file system - it must
From mmlr at mail.berlios.de Thu Feb 19 02:20:12 2009
From: mmlr at mail.berlios.de (mmlr at mail.berlios.de)
Date: Thu, 19 Feb 2009 02:20:12 +0100
Subject: [Haiku-commits] r29249 -
haiku/trunk/src/add-ons/kernel/file_systems/overlay
Message-ID: <200902190120.n1J1KCfL001347@sheep.berlios.de>
Author: mmlr
Date: 2009-02-19 02:20:10 +0100 (Thu, 19 Feb 2009)
New Revision: 29249
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29249&view=rev
Modified:
haiku/trunk/src/add-ons/kernel/file_systems/overlay/overlay.cpp
Log:
* Add preliminary write support to the overlay filesystem when the underlying
fs is read-only. Not yet fully working, also directory operations like file
creation/removal are yet missing.
* Add notifications for stat and attribute changes.
Modified: haiku/trunk/src/add-ons/kernel/file_systems/overlay/overlay.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/file_systems/overlay/overlay.cpp 2009-02-19 01:16:07 UTC (rev 29248)
+++ haiku/trunk/src/add-ons/kernel/file_systems/overlay/overlay.cpp 2009-02-19 01:20:10 UTC (rev 29249)
@@ -40,31 +40,75 @@
class AttributeEntry;
+struct open_cookie {
+ int open_mode;
+ void * super_cookie;
+};
+
+struct write_buffer {
+ write_buffer * next;
+ off_t position;
+ size_t length;
+ uint8 buffer[1];
+};
+
struct attribute_dir_cookie {
AttributeFile * file;
uint32 index;
};
+class OverlayVolume {
+public:
+ OverlayVolume(fs_volume *volume);
+ ~OverlayVolume();
+
+ status_t AllLayersMounted();
+
+ fs_volume * SuperVolume() { return fVolume->super_volume; }
+
+ bool WriteSupport() { return fWriteSupport; }
+
+private:
+ fs_volume * fVolume;
+ bool fWriteSupport;
+};
+
+
class OverlayInode {
public:
- OverlayInode(fs_volume *superVolume,
- fs_vnode *superVnode);
+ OverlayInode(OverlayVolume *volume,
+ fs_vnode *superVnode, ino_t inodeNumber);
~OverlayInode();
status_t InitCheck();
- fs_volume * SuperVolume() { return fSuperVolume; }
+ fs_volume * SuperVolume() { return fVolume->SuperVolume(); }
fs_vnode * SuperVnode() { return &fSuperVnode; }
+ ino_t InodeNumber() { return fInodeNumber; }
status_t GetAttributeFile(AttributeFile **attributeFile);
status_t WriteAttributeFile();
+ status_t ReadStat(struct stat *stat);
+
+ status_t Open(int openMode, void **cookie);
+ status_t Close(void *cookie);
+ status_t FreeCookie(void *cookie);
+ status_t Read(void *cookie, off_t position, void *buffer,
+ size_t *length);
+ status_t Write(void *cookie, off_t position,
+ const void *buffer, size_t *length);
+
private:
- fs_volume * fSuperVolume;
+ OverlayVolume * fVolume;
fs_vnode fSuperVnode;
+ ino_t fInodeNumber;
AttributeFile * fAttributeFile;
- bool fAttributeFileMissing;
+ write_buffer * fWriteBuffers;
+ off_t fOriginalNodeLength;
+ off_t fCurrentNodeLength;
+ time_t fModificationTime;
};
@@ -172,14 +216,46 @@
};
+// #pragma mark OverlayVolume
+
+
+OverlayVolume::OverlayVolume(fs_volume *volume)
+ : fVolume(volume),
+ fWriteSupport(false)
+{
+}
+
+
+OverlayVolume::~OverlayVolume()
+{
+}
+
+
+status_t
+OverlayVolume::AllLayersMounted()
+{
+ fs_info info;
+ fs_volume *superVolume = fVolume->super_volume;
+ if (superVolume->ops->read_fs_info != NULL
+ && superVolume->ops->read_fs_info(superVolume, &info) == B_OK)
+ fWriteSupport = (info.flags & B_FS_IS_READONLY) != 0;
+
+ return B_OK;
+}
+
+
// #pragma mark OverlayInode
-OverlayInode::OverlayInode(fs_volume *superVolume, fs_vnode *superVnode)
- : fSuperVolume(superVolume),
+OverlayInode::OverlayInode(OverlayVolume *volume, fs_vnode *superVnode,
+ ino_t inodeNumber)
+ : fVolume(volume),
fSuperVnode(*superVnode),
+ fInodeNumber(inodeNumber),
fAttributeFile(NULL),
- fAttributeFileMissing(false)
+ fWriteBuffers(NULL),
+ fOriginalNodeLength(-1),
+ fCurrentNodeLength(-1)
{
TRACE("inode created\n");
}
@@ -189,6 +265,13 @@
{
TRACE("inode destroyed\n");
delete fAttributeFile;
+
+ write_buffer *element = fWriteBuffers;
+ while (element) {
+ write_buffer *next = element->next;
+ free(element);
+ element = next;
+ }
}
@@ -203,7 +286,7 @@
OverlayInode::GetAttributeFile(AttributeFile **attributeFile)
{
if (fAttributeFile == NULL) {
- fAttributeFile = new(std::nothrow) AttributeFile(fSuperVolume,
+ fAttributeFile = new(std::nothrow) AttributeFile(SuperVolume(),
&fSuperVnode);
if (fAttributeFile == NULL) {
TRACE_ALWAYS("no memory to allocate attribute file\n");
@@ -238,10 +321,235 @@
if (result != B_OK)
return result;
- return fAttributeFile->WriteAttributeFile(fSuperVolume, &fSuperVnode);
+ return fAttributeFile->WriteAttributeFile(SuperVolume(), &fSuperVnode);
}
+status_t
+OverlayInode::ReadStat(struct stat *stat)
+{
+ if (fSuperVnode.ops->read_stat == NULL)
+ return B_UNSUPPORTED;
+
+ status_t result = fSuperVnode.ops->read_stat(SuperVolume(), &fSuperVnode,
+ stat);
+ if (result != B_OK)
+ return result;
+
+ if (fVolume->WriteSupport() && fCurrentNodeLength >= 0) {
+ stat->st_size = fCurrentNodeLength;
+ stat->st_blocks = (stat->st_size + stat->st_blksize - 1)
+ / stat->st_blksize;
+ stat->st_mtime = fModificationTime;
+ }
+
+ return B_OK;
+}
+
+
+status_t
+OverlayInode::Open(int openMode, void **_cookie)
+{
+ if (fSuperVnode.ops->open == NULL)
+ return B_UNSUPPORTED;
+
+ if (fVolume->WriteSupport()) {
+ open_cookie *cookie = (open_cookie *)malloc(sizeof(open_cookie));
+ if (cookie == NULL)
+ return B_NO_MEMORY;
+
+ if (fOriginalNodeLength < 0) {
+ struct stat stat;
+ status_t result = fSuperVnode.ops->read_stat(SuperVolume(),
+ &fSuperVnode, &stat);
+ if (result != B_OK)
+ return result;
+
+ fOriginalNodeLength = stat.st_size;
+ fCurrentNodeLength = stat.st_size;
+ fModificationTime = stat.st_mtime;
+ }
+
+ cookie->open_mode = openMode;
+ *_cookie = cookie;
+
+ if (openMode & O_TRUNC)
+ fCurrentNodeLength = 0;
+
+ openMode &= ~(O_RDWR | O_WRONLY | O_TRUNC | O_CREAT);
+ return fSuperVnode.ops->open(SuperVolume(), &fSuperVnode, openMode,
+ &cookie->super_cookie);
+ }
+
+ return fSuperVnode.ops->open(SuperVolume(), &fSuperVnode, openMode,
+ _cookie);
+}
+
+
+status_t
+OverlayInode::Close(void *_cookie)
+{
+ if (fVolume->WriteSupport()) {
+ open_cookie *cookie = (open_cookie *)_cookie;
+ return fSuperVnode.ops->close(SuperVolume(), &fSuperVnode,
+ cookie->super_cookie);
+ }
+
+ return fSuperVnode.ops->close(SuperVolume(), &fSuperVnode, _cookie);
+}
+
+
+status_t
+OverlayInode::FreeCookie(void *_cookie)
+{
+ if (fVolume->WriteSupport()) {
+ open_cookie *cookie = (open_cookie *)_cookie;
+ status_t result = fSuperVnode.ops->free_cookie(SuperVolume(),
+ &fSuperVnode, cookie->super_cookie);
+ free(cookie);
+ return result;
+ }
+
+ return fSuperVnode.ops->free_cookie(SuperVolume(), &fSuperVnode, _cookie);
+}
+
+
+status_t
+OverlayInode::Read(void *_cookie, off_t position, void *buffer, size_t *length)
+{
+ if (fVolume->WriteSupport()) {
+ if (position < fOriginalNodeLength) {
+ open_cookie *cookie = (open_cookie *)_cookie;
+ size_t readLength = MIN(fOriginalNodeLength - position, *length);
+ status_t result = fSuperVnode.ops->read(SuperVolume(), &fSuperVnode,
+ cookie->super_cookie, position, buffer, &readLength);
+ if (result != B_OK)
+ return result;
+ }
+
+ // overlay the read with whatever chunks we have written
+ write_buffer *element = fWriteBuffers;
+ *length = MIN(fCurrentNodeLength - position, *length);
+ off_t end = position + *length;
+ while (element) {
+ off_t elementEnd = element->position + element->length;
+ if (elementEnd > position && element->position < end) {
+ off_t copyPosition = MAX(position, element->position);
+ size_t copyLength = MIN(elementEnd - position, *length);
+ memcpy((uint8 *)buffer + (copyPosition - position),
+ element->buffer + (copyPosition - element->position),
+ copyLength);
+ }
+
+ element = element->next;
+ }
+
+ return B_OK;
+ }
+
+ return fSuperVnode.ops->read(SuperVolume(), &fSuperVnode, _cookie,
+ position, buffer, length);
+}
+
+
+status_t
+OverlayInode::Write(void *_cookie, off_t position, const void *buffer,
+ size_t *length)
+{
+ if (fVolume->WriteSupport()) {
+ // find insertion point
+ write_buffer **link = &fWriteBuffers;
+ write_buffer *other = fWriteBuffers;
+ write_buffer *swallow = NULL;
+ off_t newPosition = position;
+ size_t newLength = *length;
+ uint32 swallowCount = 0;
+
+ while (other) {
+ off_t newEnd = newPosition + newLength;
+ off_t otherEnd = other->position + other->length;
+ if (otherEnd < newPosition) {
+ // other completely before us
+ link = &other->next;
+ other = other->next;
+ continue;
+ }
+
+ if (other->position > newEnd) {
+ // other is completely past us
+ break;
+ }
+
+ swallowCount++;
+ if (swallow == NULL)
+ swallow = other;
+
+ if (other->position <= newPosition) {
+ // other chunk overlaps us or is adjacent
+ if (otherEnd < newEnd) {
+ // extend the chunk to completely overlap us
+ newPosition = other->position;
+ newLength = other->length + (newEnd - otherEnd);
+ } else {
+ // other chunk completely overlaps us already
+ }
+
+ other = other->next;
+ continue;
+ }
+
+ // we overlap the other chunk - swallow it
+ if (otherEnd > newEnd)
+ newLength += otherEnd - newEnd;
+
+ other = other->next;
+ }
+
+ write_buffer *element = (write_buffer *)malloc(sizeof(write_buffer) - 1
+ + newLength);
+ if (element == NULL)
+ return B_NO_MEMORY;
+
+ element->next = *link;
+ element->position = newPosition;
+ element->length = newLength;
+ *link = element;
+
+ bool sizeChanged = false;
+ off_t newEnd = newPosition + newLength;
+ if (newEnd > fCurrentNodeLength) {
+ fCurrentNodeLength = newEnd;
+ sizeChanged = true;
+ }
+
+ // populate the buffer with the existing chunks
+ if (swallowCount > 0) {
+ while (swallowCount-- > 0) {
+ off_t swallowEnd = swallow->position + swallow->length;
+ if (swallow->position < position || swallowEnd > newEnd) {
+ memcpy(element->buffer + (swallow->position - newPosition),
+ swallow->buffer, swallow->length);
+ }
+
+ element->next = swallow->next;
+ free(swallow);
+ }
+ }
+
+ memcpy(element->buffer + (position - newPosition), buffer, *length);
+
+ fModificationTime = time(NULL);
+ notify_stat_changed(SuperVolume()->id, fInodeNumber,
+ B_STAT_MODIFICATION_TIME | (sizeChanged ? B_STAT_SIZE : 0));
+
+ return B_OK;
+ }
+
+ return fSuperVnode.ops->write(SuperVolume(), &fSuperVnode, _cookie,
+ position, buffer, length);
+}
+
+
// #pragma mark AttributeFile
@@ -696,6 +1004,7 @@
else
delete entry;
+ notify_attribute_changed(fVolumeID, fFileInode, name, B_ATTR_REMOVED);
return B_OK;
}
@@ -717,6 +1026,10 @@
fEntries = newEntries;
fEntries[fFile->entry_count++] = entry;
+
+ notify_attribute_changed(fVolumeID, fFileInode, entry->Name(),
+ B_ATTR_CREATED);
+
return B_OK;
}
@@ -903,6 +1216,8 @@
}
memcpy(fData + position, buffer, *length);
+ notify_attribute_changed(fParent->VolumeID(), fParent->FileInode(),
+ fEntry->name, B_ATTR_CHANGED);
return B_OK;
}
@@ -1170,8 +1485,7 @@
static status_t
overlay_read_stat(fs_volume *volume, fs_vnode *vnode, struct stat *stat)
{
- OVERLAY_CALL(read_stat, stat)
- return B_UNSUPPORTED;
+ return ((OverlayInode *)vnode->private_node)->ReadStat(stat);
}
@@ -1196,24 +1510,21 @@
static status_t
overlay_open(fs_volume *volume, fs_vnode *vnode, int openMode, void **cookie)
{
- OVERLAY_CALL(open, openMode, cookie)
- return B_UNSUPPORTED;
+ return ((OverlayInode *)vnode->private_node)->Open(openMode, cookie);
}
static status_t
overlay_close(fs_volume *volume, fs_vnode *vnode, void *cookie)
{
- OVERLAY_CALL(close, cookie)
- return B_UNSUPPORTED;
+ return ((OverlayInode *)vnode->private_node)->Close(cookie);
}
static status_t
overlay_free_cookie(fs_volume *volume, fs_vnode *vnode, void *cookie)
{
- OVERLAY_CALL(free_cookie, cookie)
- return B_UNSUPPORTED;
+ return ((OverlayInode *)vnode->private_node)->FreeCookie(cookie);
}
@@ -1221,8 +1532,8 @@
overlay_read(fs_volume *volume, fs_vnode *vnode, void *cookie, off_t pos,
void *buffer, size_t *length)
{
- OVERLAY_CALL(read, cookie, pos, buffer, length)
- return B_UNSUPPORTED;
+ return ((OverlayInode *)vnode->private_node)->Read(cookie, pos, buffer,
+ length);
}
@@ -1230,8 +1541,8 @@
overlay_write(fs_volume *volume, fs_vnode *vnode, void *cookie, off_t pos,
const void *buffer, size_t *length)
{
- OVERLAY_CALL(write, cookie, pos, buffer, length)
- return B_UNSUPPORTED;
+ return ((OverlayInode *)vnode->private_node)->Write(cookie, pos, buffer,
+ length);
}
@@ -1616,9 +1927,13 @@
overlay_unmount(fs_volume *volume)
{
TRACE_VOLUME("relaying volume op: unmount\n");
- if (volume->super_volume->ops->unmount != NULL)
- return volume->super_volume->ops->unmount(volume->super_volume);
- return B_UNSUPPORTED;
+ if (volume->super_volume != NULL
+ && volume->super_volume->ops != NULL
+ && volume->super_volume->ops->unmount != NULL)
+ volume->super_volume->ops->unmount(volume->super_volume);
+
+ delete (OverlayVolume *)volume->private_volume;
+ return B_OK;
}
@@ -1633,7 +1948,10 @@
if (result != B_OK)
return result;
- info->flags |= B_FS_HAS_MIME | B_FS_HAS_ATTR | B_FS_HAS_QUERY;
+ OverlayVolume *overlayVolume = (OverlayVolume *)volume->private_volume;
+ if (overlayVolume->WriteSupport())
+ info->flags &= ~B_FS_IS_READONLY;
+ info->flags |= B_FS_HAS_MIME | B_FS_HAS_ATTR /*| B_FS_HAS_QUERY*/;
return B_OK;
}
@@ -1672,7 +1990,7 @@
return status;
OverlayInode *node = new(std::nothrow) OverlayInode(
- volume->super_volume, vnode);
+ (OverlayVolume *)volume->private_volume, vnode, id);
if (node == NULL) {
vnode->ops->put_vnode(volume->super_volume, vnode, reenter);
return B_NO_MEMORY;
@@ -1802,10 +2120,17 @@
static status_t
+overlay_all_layers_mounted(fs_volume *volume)
+{
+ return ((OverlayVolume *)volume->private_volume)->AllLayersMounted();
+}
+
+
+static status_t
overlay_create_sub_vnode(fs_volume *volume, ino_t id, fs_vnode *vnode)
{
- OverlayInode *node = new(std::nothrow) OverlayInode(volume->super_volume,
- vnode);
+ OverlayInode *node = new(std::nothrow) OverlayInode(
+ (OverlayVolume *)volume->private_volume, vnode, id);
if (node == NULL)
return B_NO_MEMORY;
@@ -1853,6 +2178,7 @@
&overlay_read_query,
&overlay_rewind_query,
+ &overlay_all_layers_mounted,
&overlay_create_sub_vnode,
&overlay_delete_sub_vnode
};
@@ -1866,6 +2192,10 @@
const char *args, ino_t *rootID)
{
TRACE_VOLUME("mounting overlay\n");
+ volume->private_volume = new(std::nothrow) OverlayVolume(volume);
+ if (volume->private_volume == NULL)
+ return B_NO_MEMORY;
+
volume->ops = &sOverlayVolumeOps;
return B_OK;
}
From mmlr at mail.berlios.de Thu Feb 19 19:13:19 2009
From: mmlr at mail.berlios.de (mmlr at mail.berlios.de)
Date: Thu, 19 Feb 2009 19:13:19 +0100
Subject: [Haiku-commits] r29250 - in haiku/trunk: headers/os/drivers
headers/private/fs_shell src/add-ons/kernel/file_systems/bfs
src/add-ons/kernel/file_systems/cdda
src/add-ons/kernel/file_systems/ext2
src/add-ons/kernel/file_systems/fat
src/add-ons/kernel/file_systems/iso9660
src/add-ons/kernel/file_systems/nfs
src/add-ons/kernel/file_systems/overlay
src/add-ons/kernel/file_systems/reiserfs
src/system/kernel/device_manager src/system/kernel/fs
src/tools/fs_shell
Message-ID: <200902191813.n1JIDJCA023012@sheep.berlios.de>
Author: mmlr
Date: 2009-02-19 19:13:01 +0100 (Thu, 19 Feb 2009)
New Revision: 29250
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29250&view=rev
Modified:
haiku/trunk/headers/os/drivers/fs_interface.h
haiku/trunk/headers/private/fs_shell/fssh_fs_interface.h
haiku/trunk/src/add-ons/kernel/file_systems/bfs/Inode.cpp
haiku/trunk/src/add-ons/kernel/file_systems/bfs/Inode.h
haiku/trunk/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp
haiku/trunk/src/add-ons/kernel/file_systems/cdda/kernel_interface.cpp
haiku/trunk/src/add-ons/kernel/file_systems/ext2/Volume.cpp
haiku/trunk/src/add-ons/kernel/file_systems/ext2/kernel_interface.cpp
haiku/trunk/src/add-ons/kernel/file_systems/fat/dir.c
haiku/trunk/src/add-ons/kernel/file_systems/fat/file.c
haiku/trunk/src/add-ons/kernel/file_systems/iso9660/kernel_interface.cpp
haiku/trunk/src/add-ons/kernel/file_systems/nfs/nfs_add_on.c
haiku/trunk/src/add-ons/kernel/file_systems/overlay/overlay.cpp
haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/Volume.cpp
haiku/trunk/src/system/kernel/device_manager/devfs.cpp
haiku/trunk/src/system/kernel/fs/rootfs.cpp
haiku/trunk/src/system/kernel/fs/vfs.cpp
haiku/trunk/src/tools/fs_shell/vfs.cpp
Log:
Remove the additional fs_vnode_ops arugment from get_vnode() again as it's not
needed at all when used as intended. Thanks Ingo for the explanation on how this
is intended to work. Adjusted the overlay fs accordingly and updated/reverted
the changes to the other filesystems.
Modified: haiku/trunk/headers/os/drivers/fs_interface.h
===================================================================
--- haiku/trunk/headers/os/drivers/fs_interface.h 2009-02-19 01:20:10 UTC (rev 29249)
+++ haiku/trunk/headers/os/drivers/fs_interface.h 2009-02-19 18:13:01 UTC (rev 29250)
@@ -310,7 +310,7 @@
void *privateNode, fs_vnode_ops *ops, int type,
uint32 flags);
extern status_t get_vnode(fs_volume *volume, ino_t vnodeID,
- void **_privateNode, fs_vnode_ops **_vnodeOps);
+ void **_privateNode);
extern status_t put_vnode(fs_volume *volume, ino_t vnodeID);
extern status_t acquire_vnode(fs_volume *volume, ino_t vnodeID);
extern status_t remove_vnode(fs_volume *volume, ino_t vnodeID);
Modified: haiku/trunk/headers/private/fs_shell/fssh_fs_interface.h
===================================================================
--- haiku/trunk/headers/private/fs_shell/fssh_fs_interface.h 2009-02-19 01:20:10 UTC (rev 29249)
+++ haiku/trunk/headers/private/fs_shell/fssh_fs_interface.h 2009-02-19 18:13:01 UTC (rev 29250)
@@ -344,8 +344,7 @@
fssh_vnode_id vnodeID, void *privateNode,
fssh_fs_vnode_ops *ops, int type, uint32_t flags);
extern fssh_status_t fssh_get_vnode(fssh_fs_volume *volume,
- fssh_vnode_id vnodeID, void **_privateNode,
- fssh_fs_vnode_ops **_vnodeOps);
+ fssh_vnode_id vnodeID, void **_privateNode);
extern fssh_status_t fssh_put_vnode(fssh_fs_volume *volume,
fssh_vnode_id vnodeID);
extern fssh_status_t fssh_acquire_vnode(fssh_fs_volume *volume,
Modified: haiku/trunk/src/add-ons/kernel/file_systems/bfs/Inode.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/file_systems/bfs/Inode.cpp 2009-02-19 01:20:10 UTC (rev 29249)
+++ haiku/trunk/src/add-ons/kernel/file_systems/bfs/Inode.cpp 2009-02-19 18:13:01 UTC (rev 29250)
@@ -2701,7 +2701,7 @@
// if you haven't yet access to the attributes directory, get it
if (fAttributes == NULL) {
if (get_vnode(volume->FSVolume(), volume->ToVnode(fInode->Attributes()),
- (void**)&fAttributes, NULL) != B_OK) {
+ (void**)&fAttributes) != B_OK) {
FATAL(("get_vnode() failed in AttributeIterator::GetNext(ino_t"
" = %Ld,name = \"%s\")\n", fInode->ID(), name));
return B_ENTRY_NOT_FOUND;
Modified: haiku/trunk/src/add-ons/kernel/file_systems/bfs/Inode.h
===================================================================
--- haiku/trunk/src/add-ons/kernel/file_systems/bfs/Inode.h 2009-02-19 01:20:10 UTC (rev 29249)
+++ haiku/trunk/src/add-ons/kernel/file_systems/bfs/Inode.h 2009-02-19 18:13:01 UTC (rev 29250)
@@ -354,8 +354,7 @@
{
Unset();
- return fStatus = get_vnode(volume->FSVolume(), id, (void**)&fInode,
- NULL);
+ return fStatus = get_vnode(volume->FSVolume(), id, (void**)&fInode);
}
status_t SetTo(Volume* volume, block_run run)
Modified: haiku/trunk/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp 2009-02-19 01:20:10 UTC (rev 29249)
+++ haiku/trunk/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp 2009-02-19 18:13:01 UTC (rev 29250)
@@ -556,7 +556,7 @@
locker.Unlock();
Inode* inode;
- status = get_vnode(volume->FSVolume(), *_vnodeID, (void**)&inode, NULL);
+ status = get_vnode(volume->FSVolume(), *_vnodeID, (void**)&inode);
if (status != B_OK) {
REPORT_ERROR(status);
return B_ENTRY_NOT_FOUND;
Modified: haiku/trunk/src/add-ons/kernel/file_systems/cdda/kernel_interface.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/file_systems/cdda/kernel_interface.cpp 2009-02-19 01:20:10 UTC (rev 29249)
+++ haiku/trunk/src/add-ons/kernel/file_systems/cdda/kernel_interface.cpp 2009-02-19 18:13:01 UTC (rev 29250)
@@ -1493,7 +1493,7 @@
if (inode == NULL)
return B_ENTRY_NOT_FOUND;
- status = get_vnode(volume->FSVolume(), inode->ID(), NULL, NULL);
+ status = get_vnode(volume->FSVolume(), inode->ID(), NULL);
if (status < B_OK)
return status;
Modified: haiku/trunk/src/add-ons/kernel/file_systems/ext2/Volume.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/file_systems/ext2/Volume.cpp 2009-02-19 01:20:10 UTC (rev 29249)
+++ haiku/trunk/src/add-ons/kernel/file_systems/ext2/Volume.cpp 2009-02-19 18:13:01 UTC (rev 29250)
@@ -310,7 +310,7 @@
if ((fBlockCache = opener.InitCache(NumBlocks(), fBlockSize)) == NULL)
return B_ERROR;
- status = get_vnode(fFSVolume, EXT2_ROOT_NODE, (void**)&fRootNode, NULL);
+ status = get_vnode(fFSVolume, EXT2_ROOT_NODE, (void**)&fRootNode);
if (status != B_OK) {
TRACE("could not create root node: get_vnode() failed!\n");
return status;
Modified: haiku/trunk/src/add-ons/kernel/file_systems/ext2/kernel_interface.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/file_systems/ext2/kernel_interface.cpp 2009-02-19 01:20:10 UTC (rev 29249)
+++ haiku/trunk/src/add-ons/kernel/file_systems/ext2/kernel_interface.cpp 2009-02-19 18:13:01 UTC (rev 29250)
@@ -319,7 +319,7 @@
break;
}
- return get_vnode(volume->FSVolume(), *_vnodeID, NULL, NULL);
+ return get_vnode(volume->FSVolume(), *_vnodeID, NULL);
}
Modified: haiku/trunk/src/add-ons/kernel/file_systems/fat/dir.c
===================================================================
--- haiku/trunk/src/add-ons/kernel/file_systems/fat/dir.c 2009-02-19 01:20:10 UTC (rev 29249)
+++ haiku/trunk/src/add-ons/kernel/file_systems/fat/dir.c 2009-02-19 18:13:01 UTC (rev 29250)
@@ -433,7 +433,7 @@
if (vnid)
*vnid = found_vnid;
if (node)
- result = get_vnode(vol->volume, found_vnid, (void **)node, NULL);
+ result = get_vnode(vol->volume, found_vnid, (void **)node);
result = B_OK;
} else {
result = ENOENT;
Modified: haiku/trunk/src/add-ons/kernel/file_systems/fat/file.c
===================================================================
--- haiku/trunk/src/add-ons/kernel/file_systems/fat/file.c 2009-02-19 01:20:10 UTC (rev 29249)
+++ haiku/trunk/src/add-ons/kernel/file_systems/fat/file.c 2009-02-19 18:13:01 UTC (rev 29250)
@@ -890,7 +890,7 @@
*vnid = dummy.vnid;
dummy.magic = ~VNODE_MAGIC;
- result = get_vnode(_vol, *vnid, (void **)&file, NULL);
+ result = get_vnode(_vol, *vnid, (void **)&file);
if (result < B_OK) {
if (vol->fs_flags & FS_FLAGS_OP_SYNC)
_dosfs_sync(vol);
@@ -1155,7 +1155,7 @@
if (vnid == vol->root_vnode.vnid)
break;
- result = get_vnode(_vol, vnid, (void **)&dir, NULL);
+ result = get_vnode(_vol, vnid, (void **)&dir);
if (result < B_OK)
goto bi1;
parent = dir->dir_vnid;
Modified: haiku/trunk/src/add-ons/kernel/file_systems/iso9660/kernel_interface.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/file_systems/iso9660/kernel_interface.cpp 2009-02-19 01:20:10 UTC (rev 29249)
+++ haiku/trunk/src/add-ons/kernel/file_systems/iso9660/kernel_interface.cpp 2009-02-19 18:13:01 UTC (rev 29250)
@@ -225,12 +225,12 @@
// base directory
TRACE(("fs_walk - found \".\" file.\n"));
*_vnodeID = baseNode->id;
- return get_vnode(_vol, *_vnodeID, NULL, NULL);
+ return get_vnode(_vol, *_vnodeID, NULL);
} else if (strcmp(file, "..") == 0) {
// parent directory
TRACE(("fs_walk - found \"..\" file.\n"));
*_vnodeID = baseNode->parID;
- return get_vnode(_vol, *_vnodeID, NULL, NULL);
+ return get_vnode(_vol, *_vnodeID, NULL);
}
// look up file in the directory
@@ -273,7 +273,7 @@
TRACE(("fs_walk - New vnode id is %Ld\n", *_vnodeID));
result = get_vnode(_vol, *_vnodeID,
- (void **)&newNode, NULL);
+ (void **)&newNode);
if (result == B_OK) {
newNode->parID = baseNode->id;
done = true;
Modified: haiku/trunk/src/add-ons/kernel/file_systems/nfs/nfs_add_on.c
===================================================================
--- haiku/trunk/src/add-ons/kernel/file_systems/nfs/nfs_add_on.c 2009-02-19 01:20:10 UTC (rev 29249)
+++ haiku/trunk/src/add-ons/kernel/file_systems/nfs/nfs_add_on.c 2009-02-19 18:13:01 UTC (rev 29250)
@@ -898,7 +898,7 @@
isLink=S_ISLNK(st.st_mode);
}
- if ((result=get_vnode (_volume,*vnid,(void **)&dummy,NULL))super_volume; }
bool WriteSupport() { return fWriteSupport; }
@@ -83,6 +84,7 @@
status_t InitCheck();
+ fs_volume * Volume() { return fVolume->Volume(); }
fs_volume * SuperVolume() { return fVolume->SuperVolume(); }
fs_vnode * SuperVnode() { return &fSuperVnode; }
ino_t InodeNumber() { return fInodeNumber; }
@@ -114,7 +116,8 @@
class AttributeFile {
public:
- AttributeFile(fs_volume *volume, fs_vnode *vnode);
+ AttributeFile(fs_volume *overlay, fs_volume *volume,
+ fs_vnode *vnode);
~AttributeFile();
status_t InitCheck() { return fStatus; }
@@ -123,8 +126,8 @@
ino_t FileInode() { return fFileInode; }
status_t CreateEmpty();
- status_t WriteAttributeFile(fs_volume *volume,
- fs_vnode *vnode);
+ status_t WriteAttributeFile(fs_volume *overlay,
+ fs_volume *volume, fs_vnode *vnode);
status_t ReadAttributeDir(struct dirent *dirent,
size_t bufferSize, uint32 *numEntries,
@@ -286,8 +289,8 @@
OverlayInode::GetAttributeFile(AttributeFile **attributeFile)
{
if (fAttributeFile == NULL) {
- fAttributeFile = new(std::nothrow) AttributeFile(SuperVolume(),
- &fSuperVnode);
+ fAttributeFile = new(std::nothrow) AttributeFile(Volume(),
+ SuperVolume(), &fSuperVnode);
if (fAttributeFile == NULL) {
TRACE_ALWAYS("no memory to allocate attribute file\n");
return B_NO_MEMORY;
@@ -321,7 +324,8 @@
if (result != B_OK)
return result;
- return fAttributeFile->WriteAttributeFile(SuperVolume(), &fSuperVnode);
+ return fAttributeFile->WriteAttributeFile(Volume(), SuperVolume(),
+ &fSuperVnode);
}
@@ -553,7 +557,8 @@
// #pragma mark AttributeFile
-AttributeFile::AttributeFile(fs_volume *volume, fs_vnode *vnode)
+AttributeFile::AttributeFile(fs_volume *overlay, fs_volume *volume,
+ fs_vnode *vnode)
: fStatus(B_NO_INIT),
fVolumeID(volume->id),
fFileInode(0),
@@ -633,13 +638,14 @@
else if (i == 2)
fAttributeFileInode = inodeNumber;
- fStatus = get_vnode(volume, inodeNumber, ¤tVnode.private_node,
- ¤tVnode.ops);
+ OverlayInode *overlayInode = NULL;
+ fStatus = get_vnode(overlay, inodeNumber, (void **)&overlayInode);
if (fStatus != B_OK) {
TRACE_ALWAYS("getting vnode failed: %s\n", strerror(fStatus));
return;
}
+ currentVnode = *overlayInode->SuperVnode();
lastInodeNumber = inodeNumber;
}
@@ -767,7 +773,8 @@
status_t
-AttributeFile::WriteAttributeFile(fs_volume *volume, fs_vnode *vnode)
+AttributeFile::WriteAttributeFile(fs_volume *overlay, fs_volume *volume,
+ fs_vnode *vnode)
{
if (fFile == NULL)
return B_NO_INIT;
@@ -787,15 +794,17 @@
}
fs_vnode currentVnode;
+ OverlayInode *overlayInode = NULL;
if (fAttributeDirInode == 0) {
- result = get_vnode(volume, fDirectoryInode,
- ¤tVnode.private_node, ¤tVnode.ops);
+ result = get_vnode(overlay, fDirectoryInode, (void **)&overlayInode);
if (result != B_OK) {
TRACE_ALWAYS("failed to get directory vnode: %s\n",
strerror(result));
return result;
}
+ currentVnode = *overlayInode->SuperVnode();
+
// create the attribute directory
result = currentVnode.ops->create_dir(volume, ¤tVnode,
ATTRIBUTE_OVERLAY_ATTRIBUTE_DIR_NAME, S_IRWXU | S_IRWXG | S_IRWXO,
@@ -813,14 +822,15 @@
void *attrFileCookie = NULL;
if (fAttributeFileInode == 0) {
- result = get_vnode(volume, fAttributeDirInode,
- ¤tVnode.private_node, ¤tVnode.ops);
+ result = get_vnode(overlay, fAttributeDirInode, (void **)&overlayInode);
if (result != B_OK) {
TRACE_ALWAYS("failed to get attribute directory vnode: %s\n",
strerror(result));
return result;
}
+ currentVnode = *overlayInode->SuperVnode();
+
// create the attribute file
result = currentVnode.ops->create(volume, ¤tVnode,
nameBuffer, O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP
@@ -835,22 +845,24 @@
return result;
}
- result = get_vnode(volume, fAttributeFileInode,
- ¤tVnode.private_node, ¤tVnode.ops);
+ result = get_vnode(overlay, fAttributeFileInode, (void **)&overlayInode);
if (result != B_OK) {
TRACE_ALWAYS("getting attribute file vnode after create failed: %s\n",
strerror(result));
return result;
}
+
+ currentVnode = *overlayInode->SuperVnode();
} else {
- result = get_vnode(volume, fAttributeFileInode,
- ¤tVnode.private_node, ¤tVnode.ops);
+ result = get_vnode(overlay, fAttributeFileInode, (void **)&overlayInode);
if (result != B_OK) {
TRACE_ALWAYS("getting attribute file vnode failed: %s\n",
strerror(result));
return result;
}
+ currentVnode = *overlayInode->SuperVnode();
+
// open the attribute file
result = currentVnode.ops->open(volume, ¤tVnode, O_RDWR | O_TRUNC,
&attrFileCookie);
@@ -1296,6 +1308,11 @@
overlay_get_super_vnode(fs_volume *volume, fs_vnode *vnode,
fs_volume *superVolume, fs_vnode *_superVnode)
{
+ if (volume == superVolume) {
+ *_superVnode = *vnode;
+ return B_OK;
+ }
+
OverlayInode *node = (OverlayInode *)vnode->private_node;
fs_vnode *superVnode = node->SuperVnode();
Modified: haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/Volume.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/Volume.cpp 2009-02-19 01:20:10 UTC (rev 29249)
+++ haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/Volume.cpp 2009-02-19 18:13:01 UTC (rev 29250)
@@ -294,7 +294,7 @@
status_t
Volume::GetVNode(ino_t id, VNode **node)
{
- return get_vnode(GetFSVolume(), id, (void**)node, NULL);
+ return get_vnode(GetFSVolume(), id, (void**)node);
}
// PutVNode
Modified: haiku/trunk/src/system/kernel/device_manager/devfs.cpp
===================================================================
--- haiku/trunk/src/system/kernel/device_manager/devfs.cpp 2009-02-19 01:20:10 UTC (rev 29249)
+++ haiku/trunk/src/system/kernel/device_manager/devfs.cpp 2009-02-19 18:13:01 UTC (rev 29250)
@@ -407,8 +407,7 @@
// increase reference count of raw device -
// the partition device really needs it
- status = get_vnode(fs->volume, device->id, (void**)&partition->raw_device,
- NULL);
+ status = get_vnode(fs->volume, device->id, (void**)&partition->raw_device);
if (status < B_OK)
goto err1;
@@ -959,7 +958,7 @@
return B_ENTRY_NOT_FOUND;
}
- status = get_vnode(fs->volume, vnode->id, NULL, NULL);
+ status = get_vnode(fs->volume, vnode->id, NULL);
if (status < B_OK)
return status;
@@ -1063,7 +1062,7 @@
if (openMode & O_EXCL)
return B_FILE_EXISTS;
- status = get_vnode(fs->volume, vnode->id, NULL, NULL);
+ status = get_vnode(fs->volume, vnode->id, NULL);
if (status < B_OK)
return status;
@@ -2092,7 +2091,7 @@
{
devfs_vnode* node;
status_t status = get_vnode(sDeviceFileSystem->volume, device->ID(),
- (void**)&node, NULL);
+ (void**)&node);
if (status != B_OK)
return status;
Modified: haiku/trunk/src/system/kernel/fs/rootfs.cpp
===================================================================
--- haiku/trunk/src/system/kernel/fs/rootfs.cpp 2009-02-19 01:20:10 UTC (rev 29249)
+++ haiku/trunk/src/system/kernel/fs/rootfs.cpp 2009-02-19 18:13:01 UTC (rev 29250)
@@ -284,7 +284,7 @@
{
// schedule this vnode to be removed when it's ref goes to zero
- bool gotNode = (get_vnode(fs->volume, vnode->id, NULL, NULL) == B_OK);
+ bool gotNode = (get_vnode(fs->volume, vnode->id, NULL) == B_OK);
status_t status = B_OK;
if (gotNode)
@@ -447,7 +447,7 @@
goto err;
}
- status = get_vnode(fs->volume, vnode->id, NULL, NULL);
+ status = get_vnode(fs->volume, vnode->id, NULL);
if (status < B_OK)
goto err;
Modified: haiku/trunk/src/system/kernel/fs/vfs.cpp
===================================================================
--- haiku/trunk/src/system/kernel/fs/vfs.cpp 2009-02-19 01:20:10 UTC (rev 29249)
+++ haiku/trunk/src/system/kernel/fs/vfs.cpp 2009-02-19 18:13:01 UTC (rev 29250)
@@ -3626,8 +3626,7 @@
extern "C" status_t
-get_vnode(fs_volume *volume, ino_t vnodeID, void **_privateNode,
- fs_vnode_ops **_vnodeOps)
+get_vnode(fs_volume *volume, ino_t vnodeID, void **_privateNode)
{
struct vnode *vnode;
@@ -3653,14 +3652,8 @@
if (_privateNode != NULL)
*_privateNode = resolvedNode.private_node;
- if (_vnodeOps != NULL)
- *_vnodeOps = resolvedNode.ops;
- } else {
- if (_privateNode != NULL)
- *_privateNode = vnode->private_node;
- if (_vnodeOps != NULL)
- *_vnodeOps = vnode->ops;
- }
+ } else if (_privateNode != NULL)
+ *_privateNode = vnode->private_node;
return B_OK;
}
@@ -4054,7 +4047,7 @@
}
// Use get_vnode() to resolve the cookie for the right layer.
- status = get_vnode(volume, vnode->id, _node, NULL);
+ status = get_vnode(volume, vnode->id, _node);
put_vnode(vnode);
return status;
Modified: haiku/trunk/src/tools/fs_shell/vfs.cpp
===================================================================
--- haiku/trunk/src/tools/fs_shell/vfs.cpp 2009-02-19 01:20:10 UTC (rev 29249)
+++ haiku/trunk/src/tools/fs_shell/vfs.cpp 2009-02-19 18:13:01 UTC (rev 29250)
@@ -1986,7 +1986,7 @@
extern "C" fssh_status_t
fssh_get_vnode(fssh_fs_volume *volume, fssh_vnode_id vnodeID,
- void **privateNode, fssh_fs_vnode_ops **vnodeOps)
+ void **privateNode)
{
struct vnode *vnode;
@@ -2012,14 +2012,8 @@
if (privateNode != NULL)
*privateNode = resolvedNode.private_node;
- if (vnodeOps != NULL)
- *vnodeOps = resolvedNode.ops;
- } else {
- if (privateNode != NULL)
- *privateNode = vnode->private_node;
- if (vnodeOps != NULL)
- *vnodeOps = vnode->ops;
- }
+ } else if (privateNode != NULL)
+ *privateNode = vnode->private_node;
return FSSH_B_OK;
}
@@ -2451,7 +2445,7 @@
}
// Use get_vnode() to resolve the cookie for the right layer.
- status = ::fssh_get_vnode(volume, vnode->id, _node, NULL);
+ status = ::fssh_get_vnode(volume, vnode->id, _node);
put_vnode(vnode);
return FSSH_B_OK;
From axeld at pinc-software.de Thu Feb 19 20:50:36 2009
From: axeld at pinc-software.de (=?ISO-8859-1?Q?Axel_D=F6rfler?=)
Date: Thu, 19 Feb 2009 20:50:36 +0100
Subject: [Haiku-commits] r29249
- haiku/trunk/src/add-ons/kernel/file_systems/overlay
In-Reply-To: <200902190120.n1J1KCfL001347@sheep.berlios.de>
References: <200902190120.n1J1KCfL001347@sheep.berlios.de>
Message-ID: <499DB80C.6060207@pinc-software.de>
mmlr at mail.berlios.de wrote:
> Log:
> * Add preliminary write support to the overlay filesystem when the underlying
> fs is read-only. Not yet fully working, also directory operations like file
> creation/removal are yet missing.
I don't really like the direction this is taking; the idea of the layers
is that you can have more than just one - ie. there is no need for one
layer to provide all the (eventually) missing functionality.
Rather, I think there should be several layers, each providing just one
kind of functionality.
Bye,
Axel.
From revol at free.fr Thu Feb 19 20:56:48 2009
From: revol at free.fr (=?utf-8?q?Fran=C3=A7ois?= Revol)
Date: Thu, 19 Feb 2009 20:56:48 +0100 CET
Subject: [Haiku-commits]
=?utf-8?q?r29249_-_haiku/trunk/src/add-ons/kernel?=
=?utf-8?q?/file=5Fsystems/overlay?=
In-Reply-To: <499DB80C.6060207@pinc-software.de>
Message-ID: <5405057164-BeMail@laptop>
> mmlr at mail.berlios.de wrote:
> > Log:
> > * Add preliminary write support to the overlay filesystem when the
> > underlying
> > fs is read-only. Not yet fully working, also directory operations
> > like file
> > creation/removal are yet missing.
>
> I don't really like the direction this is taking; the idea of the
> layers
> is that you can have more than just one - ie. there is no need for
> one
> layer to provide all the (eventually) missing functionality.
>
> Rather, I think there should be several layers, each providing just
> one
> kind of functionality.
>
+1
also, this seems to make CDs writable with isvolume I was told...
Fran?ois.
From mmlr at mail.berlios.de Thu Feb 19 21:03:07 2009
From: mmlr at mail.berlios.de (mmlr at mail.berlios.de)
Date: Thu, 19 Feb 2009 21:03:07 +0100
Subject: [Haiku-commits] r29251 -
haiku/trunk/src/add-ons/kernel/file_systems/overlay
Message-ID: <200902192003.n1JK37d8016132@sheep.berlios.de>
Author: mmlr
Date: 2009-02-19 21:03:05 +0100 (Thu, 19 Feb 2009)
New Revision: 29251
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29251&view=rev
Modified:
haiku/trunk/src/add-ons/kernel/file_systems/overlay/overlay.cpp
Log:
* Fix missing initialization of the entry size on SetSize() that'd cause some
attribute writes to not be visible.
* Don't read past the current node size when emulating write support.
* Fix writing calculations so that writing actually works as intended.
* Actually follow the linked list when joining write_buffers instead of using
the same pointer that becomes invalid after the first iteration.
* Small optimizations.
Modified: haiku/trunk/src/add-ons/kernel/file_systems/overlay/overlay.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/file_systems/overlay/overlay.cpp 2009-02-19 18:13:01 UTC (rev 29250)
+++ haiku/trunk/src/add-ons/kernel/file_systems/overlay/overlay.cpp 2009-02-19 20:03:05 UTC (rev 29251)
@@ -422,6 +422,11 @@
OverlayInode::Read(void *_cookie, off_t position, void *buffer, size_t *length)
{
if (fVolume->WriteSupport()) {
+ if (position >= fCurrentNodeLength) {
+ *length = 0;
+ return B_OK;
+ }
+
if (position < fOriginalNodeLength) {
open_cookie *cookie = (open_cookie *)_cookie;
size_t readLength = MIN(fOriginalNodeLength - position, *length);
@@ -436,8 +441,11 @@
*length = MIN(fCurrentNodeLength - position, *length);
off_t end = position + *length;
while (element) {
+ if (element->position > end)
+ break;
+
off_t elementEnd = element->position + element->length;
- if (elementEnd > position && element->position < end) {
+ if (elementEnd > position) {
off_t copyPosition = MAX(position, element->position);
size_t copyLength = MIN(elementEnd - position, *length);
memcpy((uint8 *)buffer + (copyPosition - position),
@@ -473,7 +481,7 @@
off_t newEnd = newPosition + newLength;
off_t otherEnd = other->position + other->length;
if (otherEnd < newPosition) {
- // other completely before us
+ // other is completely before us
link = &other->next;
other = other->next;
continue;
@@ -489,20 +497,21 @@
swallow = other;
if (other->position <= newPosition) {
- // other chunk overlaps us or is adjacent
- if (otherEnd < newEnd) {
- // extend the chunk to completely overlap us
- newPosition = other->position;
- newLength = other->length + (newEnd - otherEnd);
- } else {
- // other chunk completely overlaps us already
+ if (swallowCount == 1 && otherEnd >= newEnd) {
+ // other chunk completely covers us, just copy
+ memcpy(other->buffer + (newPosition - other->position),
+ buffer, *length);
+
+ fModificationTime = time(NULL);
+ notify_stat_changed(SuperVolume()->id, fInodeNumber,
+ B_STAT_MODIFICATION_TIME);
+ return B_OK;
}
- other = other->next;
- continue;
+ newLength += newPosition - other->position;
+ newPosition = other->position;
}
- // we overlap the other chunk - swallow it
if (otherEnd > newEnd)
newLength += otherEnd - newEnd;
@@ -529,14 +538,12 @@
// populate the buffer with the existing chunks
if (swallowCount > 0) {
while (swallowCount-- > 0) {
- off_t swallowEnd = swallow->position + swallow->length;
- if (swallow->position < position || swallowEnd > newEnd) {
- memcpy(element->buffer + (swallow->position - newPosition),
- swallow->buffer, swallow->length);
- }
+ memcpy(element->buffer + (swallow->position - newPosition),
+ swallow->buffer, swallow->length);
element->next = swallow->next;
free(swallow);
+ swallow = element->next;
}
}
@@ -1148,6 +1155,7 @@
}
memcpy(newData, fData, min_c(fEntry->size, size));
+ fEntry->size = size;
fAllocatedData = true;
fData = newData;
return B_OK;
From mmlr at mlotz.ch Thu Feb 19 21:18:54 2009
From: mmlr at mlotz.ch (Michael Lotz)
Date: Thu, 19 Feb 2009 21:18:54
Subject: [Haiku-commits] r29249 -
haiku/trunk/src/add-ons/kernel/file_systems/overlay
In-Reply-To: <5405057164-BeMail@laptop>
Message-ID: <6035180693-BeMail@haiku>
> > mmlr at mail.berlios.de wrote:
> > > Log:
> > > * Add preliminary write support to the overlay filesystem when
> > > the
> > > underlying
> > > fs is read-only. Not yet fully working, also directory
> > > operations
> > > like file
> > > creation/removal are yet missing.
> >
> > I don't really like the direction this is taking; the idea of the
> > layers
> > is that you can have more than just one - ie. there is no need for
> > one
> > layer to provide all the (eventually) missing functionality.
> >
> > Rather, I think there should be several layers, each providing just
> > one
> > kind of functionality.
Please don't worry. I'm currently just prototyping it into this one
layer. I intended to split it up when it was reasonably working and
then also rename/move the layer. But I guess I can do that just as well
now.
> also, this seems to make CDs writable with isvolume I was told...
It obviously does, yes. It's intended for the live CD mode later on.
Determining whether or not to start the installer should later be done
based on the persistance of the storage instead of read-only.
Regards
Michael
From mmu_man at mail.berlios.de Thu Feb 19 21:28:43 2009
From: mmu_man at mail.berlios.de (mmu_man at BerliOS)
Date: Thu, 19 Feb 2009 21:28:43 +0100
Subject: [Haiku-commits] r29252 - in haiku/trunk/docs/welcome: . en
Message-ID: <200902192028.n1JKShxx021160@sheep.berlios.de>
Author: mmu_man
Date: 2009-02-19 21:28:43 +0100 (Thu, 19 Feb 2009)
New Revision: 29252
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29252&view=rev
Modified:
haiku/trunk/docs/welcome/en/bugreports.html
haiku/trunk/docs/welcome/welcome.html
Log:
Test setting mime type property to text/html. It should help previewing the html from trac or at least the normal svnweb as I tested elsewhere.
Property changes on: haiku/trunk/docs/welcome/en/bugreports.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/welcome/welcome.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
From mmlr at mail.berlios.de Thu Feb 19 21:30:53 2009
From: mmlr at mail.berlios.de (mmlr at mail.berlios.de)
Date: Thu, 19 Feb 2009 21:30:53 +0100
Subject: [Haiku-commits] r29253 - in
haiku/trunk/src/add-ons/kernel/file_systems: . layers
layers/attribute_overlay layers/write_overlay
Message-ID: <200902192030.n1JKUr85021740@sheep.berlios.de>
Author: mmlr
Date: 2009-02-19 21:30:51 +0100 (Thu, 19 Feb 2009)
New Revision: 29253
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29253&view=rev
Added:
haiku/trunk/src/add-ons/kernel/file_systems/layers/
haiku/trunk/src/add-ons/kernel/file_systems/layers/Jamfile
haiku/trunk/src/add-ons/kernel/file_systems/layers/attribute_overlay/
haiku/trunk/src/add-ons/kernel/file_systems/layers/attribute_overlay/Jamfile
haiku/trunk/src/add-ons/kernel/file_systems/layers/attribute_overlay/attribute_overlay.cpp
haiku/trunk/src/add-ons/kernel/file_systems/layers/write_overlay/
haiku/trunk/src/add-ons/kernel/file_systems/layers/write_overlay/Jamfile
haiku/trunk/src/add-ons/kernel/file_systems/layers/write_overlay/write_overlay.cpp
Modified:
haiku/trunk/src/add-ons/kernel/file_systems/Jamfile
Log:
Preparing to split the overlay filesystem into an attribute_overlay and write_overlay module.
Modified: haiku/trunk/src/add-ons/kernel/file_systems/Jamfile
===================================================================
--- haiku/trunk/src/add-ons/kernel/file_systems/Jamfile 2009-02-19 20:28:43 UTC (rev 29252)
+++ haiku/trunk/src/add-ons/kernel/file_systems/Jamfile 2009-02-19 20:30:51 UTC (rev 29253)
@@ -7,10 +7,11 @@
SubInclude HAIKU_TOP src add-ons kernel file_systems googlefs ;
SubInclude HAIKU_TOP src add-ons kernel file_systems iso9660 ;
SubInclude HAIKU_TOP src add-ons kernel file_systems nfs ;
-SubInclude HAIKU_TOP src add-ons kernel file_systems overlay ;
SubInclude HAIKU_TOP src add-ons kernel file_systems ramfs ;
SubInclude HAIKU_TOP src add-ons kernel file_systems udf ;
SubInclude HAIKU_TOP src add-ons kernel file_systems userlandfs ;
SubIncludeGPL HAIKU_TOP src add-ons kernel file_systems ntfs ;
SubIncludeGPL HAIKU_TOP src add-ons kernel file_systems reiserfs ;
+
+SubInclude HAIKU_TOP src add-ons kernel file_systems layers ;
Added: haiku/trunk/src/add-ons/kernel/file_systems/layers/Jamfile
===================================================================
--- haiku/trunk/src/add-ons/kernel/file_systems/layers/Jamfile 2009-02-19 20:28:43 UTC (rev 29252)
+++ haiku/trunk/src/add-ons/kernel/file_systems/layers/Jamfile 2009-02-19 20:30:51 UTC (rev 29253)
@@ -0,0 +1,4 @@
+SubDir HAIKU_TOP src add-ons kernel file_systems layers ;
+
+SubInclude HAIKU_TOP src add-ons kernel file_systems layers attribute_overlay ;
+SubInclude HAIKU_TOP src add-ons kernel file_systems layers write_overlay ;
Added: haiku/trunk/src/add-ons/kernel/file_systems/layers/attribute_overlay/Jamfile
===================================================================
--- haiku/trunk/src/add-ons/kernel/file_systems/layers/attribute_overlay/Jamfile 2009-02-19 20:28:43 UTC (rev 29252)
+++ haiku/trunk/src/add-ons/kernel/file_systems/layers/attribute_overlay/Jamfile 2009-02-19 20:30:51 UTC (rev 29253)
@@ -0,0 +1,7 @@
+SubDir HAIKU_TOP src add-ons kernel file_systems layers attribute_overlay ;
+
+UsePrivateKernelHeaders ;
+
+KernelAddon attribute_overlay :
+ attribute_overlay.cpp
+ ;
Copied: haiku/trunk/src/add-ons/kernel/file_systems/layers/attribute_overlay/attribute_overlay.cpp (from rev 29251, haiku/trunk/src/add-ons/kernel/file_systems/overlay/overlay.cpp)
Added: haiku/trunk/src/add-ons/kernel/file_systems/layers/write_overlay/Jamfile
===================================================================
--- haiku/trunk/src/add-ons/kernel/file_systems/layers/write_overlay/Jamfile 2009-02-19 20:28:43 UTC (rev 29252)
+++ haiku/trunk/src/add-ons/kernel/file_systems/layers/write_overlay/Jamfile 2009-02-19 20:30:51 UTC (rev 29253)
@@ -0,0 +1,7 @@
+SubDir HAIKU_TOP src add-ons kernel file_systems layers write_overlay ;
+
+UsePrivateKernelHeaders ;
+
+KernelAddon write_overlay :
+ write_overlay.cpp
+ ;
Copied: haiku/trunk/src/add-ons/kernel/file_systems/layers/write_overlay/write_overlay.cpp (from rev 29251, haiku/trunk/src/add-ons/kernel/file_systems/overlay/overlay.cpp)
From mmu_man at mail.berlios.de Thu Feb 19 22:05:17 2009
From: mmu_man at mail.berlios.de (mmu_man at BerliOS)
Date: Thu, 19 Feb 2009 22:05:17 +0100
Subject: [Haiku-commits] r29254 - haiku/trunk/docs
Message-ID: <200902192105.n1JL5HxE026223@sheep.berlios.de>
Author: mmu_man
Date: 2009-02-19 22:05:17 +0100 (Thu, 19 Feb 2009)
New Revision: 29254
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29254&view=rev
Modified:
haiku/trunk/docs/Haiku-doc.css
Log:
Set mime on the css (hmm not sure it's a good idea to use mixed case to name this!).
The pages are viewable from http://svn.berlios.de/wsvn/haiku/haiku/trunk/docs/welcome/welcome.html for ex. though TracBrowser doesn't seem to care.
Property changes on: haiku/trunk/docs/Haiku-doc.css
___________________________________________________________________
Name: svn:mime-type
+ text/css
From mmlr at mail.berlios.de Thu Feb 19 22:12:01 2009
From: mmlr at mail.berlios.de (mmlr at mail.berlios.de)
Date: Thu, 19 Feb 2009 22:12:01 +0100
Subject: [Haiku-commits] r29255 - in
haiku/trunk/src/add-ons/kernel/file_systems/layers:
attribute_overlay write_overlay
Message-ID: <200902192112.n1JLC1W5027143@sheep.berlios.de>
Author: mmlr
Date: 2009-02-19 22:11:59 +0100 (Thu, 19 Feb 2009)
New Revision: 29255
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29255&view=rev
Modified:
haiku/trunk/src/add-ons/kernel/file_systems/layers/attribute_overlay/attribute_overlay.cpp
haiku/trunk/src/add-ons/kernel/file_systems/layers/write_overlay/write_overlay.cpp
Log:
Split overlay filesystem into attribute_overlay and write_overlay.
Modified: haiku/trunk/src/add-ons/kernel/file_systems/layers/attribute_overlay/attribute_overlay.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/file_systems/layers/attribute_overlay/attribute_overlay.cpp 2009-02-19 21:05:17 UTC (rev 29254)
+++ haiku/trunk/src/add-ons/kernel/file_systems/layers/attribute_overlay/attribute_overlay.cpp 2009-02-19 21:11:59 UTC (rev 29255)
@@ -34,24 +34,12 @@
#endif
-namespace overlay {
+namespace attribute_overlay {
class AttributeFile;
class AttributeEntry;
-struct open_cookie {
- int open_mode;
- void * super_cookie;
-};
-
-struct write_buffer {
- write_buffer * next;
- off_t position;
- size_t length;
- uint8 buffer[1];
-};
-
struct attribute_dir_cookie {
AttributeFile * file;
uint32 index;
@@ -63,16 +51,11 @@
OverlayVolume(fs_volume *volume);
~OverlayVolume();
- status_t AllLayersMounted();
-
fs_volume * Volume() { return fVolume; }
fs_volume * SuperVolume() { return fVolume->super_volume; }
- bool WriteSupport() { return fWriteSupport; }
-
private:
fs_volume * fVolume;
- bool fWriteSupport;
};
@@ -92,25 +75,11 @@
status_t GetAttributeFile(AttributeFile **attributeFile);
status_t WriteAttributeFile();
- status_t ReadStat(struct stat *stat);
-
- status_t Open(int openMode, void **cookie);
- status_t Close(void *cookie);
- status_t FreeCookie(void *cookie);
- status_t Read(void *cookie, off_t position, void *buffer,
- size_t *length);
- status_t Write(void *cookie, off_t position,
- const void *buffer, size_t *length);
-
private:
OverlayVolume * fVolume;
fs_vnode fSuperVnode;
ino_t fInodeNumber;
AttributeFile * fAttributeFile;
- write_buffer * fWriteBuffers;
- off_t fOriginalNodeLength;
- off_t fCurrentNodeLength;
- time_t fModificationTime;
};
@@ -223,8 +192,7 @@
OverlayVolume::OverlayVolume(fs_volume *volume)
- : fVolume(volume),
- fWriteSupport(false)
+ : fVolume(volume)
{
}
@@ -234,19 +202,6 @@
}
-status_t
-OverlayVolume::AllLayersMounted()
-{
- fs_info info;
- fs_volume *superVolume = fVolume->super_volume;
- if (superVolume->ops->read_fs_info != NULL
- && superVolume->ops->read_fs_info(superVolume, &info) == B_OK)
- fWriteSupport = (info.flags & B_FS_IS_READONLY) != 0;
-
- return B_OK;
-}
-
-
// #pragma mark OverlayInode
@@ -255,10 +210,7 @@
: fVolume(volume),
fSuperVnode(*superVnode),
fInodeNumber(inodeNumber),
- fAttributeFile(NULL),
- fWriteBuffers(NULL),
- fOriginalNodeLength(-1),
- fCurrentNodeLength(-1)
+ fAttributeFile(NULL)
{
TRACE("inode created\n");
}
@@ -268,13 +220,6 @@
{
TRACE("inode destroyed\n");
delete fAttributeFile;
-
- write_buffer *element = fWriteBuffers;
- while (element) {
- write_buffer *next = element->next;
- free(element);
- element = next;
- }
}
@@ -329,238 +274,6 @@
}
-status_t
-OverlayInode::ReadStat(struct stat *stat)
-{
- if (fSuperVnode.ops->read_stat == NULL)
- return B_UNSUPPORTED;
-
- status_t result = fSuperVnode.ops->read_stat(SuperVolume(), &fSuperVnode,
- stat);
- if (result != B_OK)
- return result;
-
- if (fVolume->WriteSupport() && fCurrentNodeLength >= 0) {
- stat->st_size = fCurrentNodeLength;
- stat->st_blocks = (stat->st_size + stat->st_blksize - 1)
- / stat->st_blksize;
- stat->st_mtime = fModificationTime;
- }
-
- return B_OK;
-}
-
-
-status_t
-OverlayInode::Open(int openMode, void **_cookie)
-{
- if (fSuperVnode.ops->open == NULL)
- return B_UNSUPPORTED;
-
- if (fVolume->WriteSupport()) {
- open_cookie *cookie = (open_cookie *)malloc(sizeof(open_cookie));
- if (cookie == NULL)
- return B_NO_MEMORY;
-
- if (fOriginalNodeLength < 0) {
- struct stat stat;
- status_t result = fSuperVnode.ops->read_stat(SuperVolume(),
- &fSuperVnode, &stat);
- if (result != B_OK)
- return result;
-
- fOriginalNodeLength = stat.st_size;
- fCurrentNodeLength = stat.st_size;
- fModificationTime = stat.st_mtime;
- }
-
- cookie->open_mode = openMode;
- *_cookie = cookie;
-
- if (openMode & O_TRUNC)
- fCurrentNodeLength = 0;
-
- openMode &= ~(O_RDWR | O_WRONLY | O_TRUNC | O_CREAT);
- return fSuperVnode.ops->open(SuperVolume(), &fSuperVnode, openMode,
- &cookie->super_cookie);
- }
-
- return fSuperVnode.ops->open(SuperVolume(), &fSuperVnode, openMode,
- _cookie);
-}
-
-
-status_t
-OverlayInode::Close(void *_cookie)
-{
- if (fVolume->WriteSupport()) {
- open_cookie *cookie = (open_cookie *)_cookie;
- return fSuperVnode.ops->close(SuperVolume(), &fSuperVnode,
- cookie->super_cookie);
- }
-
- return fSuperVnode.ops->close(SuperVolume(), &fSuperVnode, _cookie);
-}
-
-
-status_t
-OverlayInode::FreeCookie(void *_cookie)
-{
- if (fVolume->WriteSupport()) {
- open_cookie *cookie = (open_cookie *)_cookie;
- status_t result = fSuperVnode.ops->free_cookie(SuperVolume(),
- &fSuperVnode, cookie->super_cookie);
- free(cookie);
- return result;
- }
-
- return fSuperVnode.ops->free_cookie(SuperVolume(), &fSuperVnode, _cookie);
-}
-
-
-status_t
-OverlayInode::Read(void *_cookie, off_t position, void *buffer, size_t *length)
-{
- if (fVolume->WriteSupport()) {
- if (position >= fCurrentNodeLength) {
- *length = 0;
- return B_OK;
- }
-
- if (position < fOriginalNodeLength) {
- open_cookie *cookie = (open_cookie *)_cookie;
- size_t readLength = MIN(fOriginalNodeLength - position, *length);
- status_t result = fSuperVnode.ops->read(SuperVolume(), &fSuperVnode,
- cookie->super_cookie, position, buffer, &readLength);
- if (result != B_OK)
- return result;
- }
-
- // overlay the read with whatever chunks we have written
- write_buffer *element = fWriteBuffers;
- *length = MIN(fCurrentNodeLength - position, *length);
- off_t end = position + *length;
- while (element) {
- if (element->position > end)
- break;
-
- off_t elementEnd = element->position + element->length;
- if (elementEnd > position) {
- off_t copyPosition = MAX(position, element->position);
- size_t copyLength = MIN(elementEnd - position, *length);
- memcpy((uint8 *)buffer + (copyPosition - position),
- element->buffer + (copyPosition - element->position),
- copyLength);
- }
-
- element = element->next;
- }
-
- return B_OK;
- }
-
- return fSuperVnode.ops->read(SuperVolume(), &fSuperVnode, _cookie,
- position, buffer, length);
-}
-
-
-status_t
-OverlayInode::Write(void *_cookie, off_t position, const void *buffer,
- size_t *length)
-{
- if (fVolume->WriteSupport()) {
- // find insertion point
- write_buffer **link = &fWriteBuffers;
- write_buffer *other = fWriteBuffers;
- write_buffer *swallow = NULL;
- off_t newPosition = position;
- size_t newLength = *length;
- uint32 swallowCount = 0;
-
- while (other) {
- off_t newEnd = newPosition + newLength;
- off_t otherEnd = other->position + other->length;
- if (otherEnd < newPosition) {
- // other is completely before us
- link = &other->next;
- other = other->next;
- continue;
- }
-
- if (other->position > newEnd) {
- // other is completely past us
- break;
- }
-
- swallowCount++;
- if (swallow == NULL)
- swallow = other;
-
- if (other->position <= newPosition) {
- if (swallowCount == 1 && otherEnd >= newEnd) {
- // other chunk completely covers us, just copy
- memcpy(other->buffer + (newPosition - other->position),
- buffer, *length);
-
- fModificationTime = time(NULL);
- notify_stat_changed(SuperVolume()->id, fInodeNumber,
- B_STAT_MODIFICATION_TIME);
- return B_OK;
- }
-
- newLength += newPosition - other->position;
- newPosition = other->position;
- }
-
- if (otherEnd > newEnd)
- newLength += otherEnd - newEnd;
-
- other = other->next;
- }
-
- write_buffer *element = (write_buffer *)malloc(sizeof(write_buffer) - 1
- + newLength);
- if (element == NULL)
- return B_NO_MEMORY;
-
- element->next = *link;
- element->position = newPosition;
- element->length = newLength;
- *link = element;
-
- bool sizeChanged = false;
- off_t newEnd = newPosition + newLength;
- if (newEnd > fCurrentNodeLength) {
- fCurrentNodeLength = newEnd;
- sizeChanged = true;
- }
-
- // populate the buffer with the existing chunks
- if (swallowCount > 0) {
- while (swallowCount-- > 0) {
- memcpy(element->buffer + (swallow->position - newPosition),
- swallow->buffer, swallow->length);
-
- element->next = swallow->next;
- free(swallow);
- swallow = element->next;
- }
- }
-
- memcpy(element->buffer + (position - newPosition), buffer, *length);
-
- fModificationTime = time(NULL);
- notify_stat_changed(SuperVolume()->id, fInodeNumber,
- B_STAT_MODIFICATION_TIME | (sizeChanged ? B_STAT_SIZE : 0));
-
- return B_OK;
- }
-
- return fSuperVnode.ops->write(SuperVolume(), &fSuperVnode, _cookie,
- position, buffer, length);
-}
-
-
// #pragma mark AttributeFile
@@ -1510,7 +1223,8 @@
static status_t
overlay_read_stat(fs_volume *volume, fs_vnode *vnode, struct stat *stat)
{
- return ((OverlayInode *)vnode->private_node)->ReadStat(stat);
+ OVERLAY_CALL(read_stat, stat)
+ return B_UNSUPPORTED;
}
@@ -1535,21 +1249,24 @@
static status_t
overlay_open(fs_volume *volume, fs_vnode *vnode, int openMode, void **cookie)
{
- return ((OverlayInode *)vnode->private_node)->Open(openMode, cookie);
+ OVERLAY_CALL(open, openMode, cookie)
+ return B_UNSUPPORTED;
}
static status_t
overlay_close(fs_volume *volume, fs_vnode *vnode, void *cookie)
{
- return ((OverlayInode *)vnode->private_node)->Close(cookie);
+ OVERLAY_CALL(close, cookie)
+ return B_UNSUPPORTED;
}
static status_t
overlay_free_cookie(fs_volume *volume, fs_vnode *vnode, void *cookie)
{
- return ((OverlayInode *)vnode->private_node)->FreeCookie(cookie);
+ OVERLAY_CALL(free_cookie, cookie)
+ return B_UNSUPPORTED;
}
@@ -1557,8 +1274,8 @@
overlay_read(fs_volume *volume, fs_vnode *vnode, void *cookie, off_t pos,
void *buffer, size_t *length)
{
- return ((OverlayInode *)vnode->private_node)->Read(cookie, pos, buffer,
- length);
+ OVERLAY_CALL(read, cookie, pos, buffer, length)
+ return B_UNSUPPORTED;
}
@@ -1566,8 +1283,8 @@
overlay_write(fs_volume *volume, fs_vnode *vnode, void *cookie, off_t pos,
const void *buffer, size_t *length)
{
- return ((OverlayInode *)vnode->private_node)->Write(cookie, pos, buffer,
- length);
+ OVERLAY_CALL(write, cookie, pos, buffer, length)
+ return B_UNSUPPORTED;
}
@@ -1759,8 +1476,7 @@
void *buffer, size_t *length)
{
OVERLAY_CALL(read_attr, cookie, pos, buffer, length)
- AttributeEntry *entry = (AttributeEntry *)cookie;
- return entry->Read(pos, buffer, length);
+ return ((AttributeEntry *)cookie)->Read(pos, buffer, length);
}
@@ -1769,8 +1485,7 @@
const void *buffer, size_t *length)
{
OVERLAY_CALL(write_attr, cookie, pos, buffer, length)
- AttributeEntry *entry = (AttributeEntry *)cookie;
- return entry->Write(pos, buffer, length);
+ return ((AttributeEntry *)cookie)->Write(pos, buffer, length);
}
@@ -1779,8 +1494,7 @@
struct stat *stat)
{
OVERLAY_CALL(read_attr_stat, cookie, stat)
- AttributeEntry *entry = (AttributeEntry *)cookie;
- return entry->ReadStat(stat);
+ return ((AttributeEntry *)cookie)->ReadStat(stat);
}
@@ -1789,8 +1503,7 @@
const struct stat *stat, int statMask)
{
OVERLAY_CALL(write_attr_stat, cookie, stat, statMask)
- AttributeEntry *entry = (AttributeEntry *)cookie;
- return entry->WriteStat(stat, statMask);
+ return ((AttributeEntry *)cookie)->WriteStat(stat, statMask);
}
@@ -1973,9 +1686,6 @@
if (result != B_OK)
return result;
- OverlayVolume *overlayVolume = (OverlayVolume *)volume->private_volume;
- if (overlayVolume->WriteSupport())
- info->flags &= ~B_FS_IS_READONLY;
info->flags |= B_FS_HAS_MIME | B_FS_HAS_ATTR /*| B_FS_HAS_QUERY*/;
return B_OK;
}
@@ -2147,7 +1857,7 @@
static status_t
overlay_all_layers_mounted(fs_volume *volume)
{
- return ((OverlayVolume *)volume->private_volume)->AllLayersMounted();
+ return B_OK;
}
@@ -2241,14 +1951,14 @@
static file_system_module_info sOverlayFileSystem = {
{
- "file_systems/overlay"B_CURRENT_FS_API_VERSION,
+ "file_systems/attribute_overlay"B_CURRENT_FS_API_VERSION,
0,
overlay_std_ops,
},
- "overlay", // short_name
- "Overlay File System", // pretty_name
- 0, // DDM flags
+ "attribute_overlay", // short_name
+ "Attribute Overlay File System", // pretty_name
+ 0, // DDM flags
// scanning
NULL, // identify_partition
@@ -2281,9 +1991,9 @@
NULL // initialize
};
-} // namespace _overlay
+} // namespace attribute_overlay
-using namespace overlay;
+using namespace attribute_overlay;
module_info *modules[] = {
(module_info *)&sOverlayFileSystem,
Modified: haiku/trunk/src/add-ons/kernel/file_systems/layers/write_overlay/write_overlay.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/file_systems/layers/write_overlay/write_overlay.cpp 2009-02-19 21:05:17 UTC (rev 29254)
+++ haiku/trunk/src/add-ons/kernel/file_systems/layers/write_overlay/write_overlay.cpp 2009-02-19 21:11:59 UTC (rev 29255)
@@ -34,12 +34,8 @@
#endif
-namespace overlay {
+namespace write_overlay {
-class AttributeFile;
-class AttributeEntry;
-
-
struct open_cookie {
int open_mode;
void * super_cookie;
@@ -52,27 +48,17 @@
uint8 buffer[1];
};
-struct attribute_dir_cookie {
- AttributeFile * file;
- uint32 index;
-};
-
class OverlayVolume {
public:
OverlayVolume(fs_volume *volume);
~OverlayVolume();
- status_t AllLayersMounted();
-
fs_volume * Volume() { return fVolume; }
fs_volume * SuperVolume() { return fVolume->super_volume; }
- bool WriteSupport() { return fWriteSupport; }
-
private:
fs_volume * fVolume;
- bool fWriteSupport;
};
@@ -89,9 +75,6 @@
fs_vnode * SuperVnode() { return &fSuperVnode; }
ino_t InodeNumber() { return fInodeNumber; }
- status_t GetAttributeFile(AttributeFile **attributeFile);
- status_t WriteAttributeFile();
-
status_t ReadStat(struct stat *stat);
status_t Open(int openMode, void **cookie);
@@ -106,7 +89,6 @@
OverlayVolume * fVolume;
fs_vnode fSuperVnode;
ino_t fInodeNumber;
- AttributeFile * fAttributeFile;
write_buffer * fWriteBuffers;
off_t fOriginalNodeLength;
off_t fCurrentNodeLength;
@@ -114,117 +96,11 @@
};
-class AttributeFile {
-public:
- AttributeFile(fs_volume *overlay, fs_volume *volume,
- fs_vnode *vnode);
- ~AttributeFile();
-
- status_t InitCheck() { return fStatus; }
-
- dev_t VolumeID() { return fVolumeID; }
- ino_t FileInode() { return fFileInode; }
-
- status_t CreateEmpty();
- status_t WriteAttributeFile(fs_volume *overlay,
- fs_volume *volume, fs_vnode *vnode);
-
- status_t ReadAttributeDir(struct dirent *dirent,
- size_t bufferSize, uint32 *numEntries,
- uint32 *index);
-
- uint32 CountAttributes();
- AttributeEntry * FindAttribute(const char *name,
- uint32 *index = NULL);
-
- status_t CreateAttribute(const char *name, type_code type,
- int openMode, AttributeEntry **entry);
- status_t OpenAttribute(const char *name, int openMode,
- AttributeEntry **entry);
- status_t RemoveAttribute(const char *name,
- AttributeEntry **entry);
- status_t AddAttribute(AttributeEntry *entry);
-
-private:
- #define ATTRIBUTE_OVERLAY_FILE_MAGIC 'attr'
- #define ATTRIBUTE_OVERLAY_ATTRIBUTE_DIR_NAME "_HAIKU"
-
- struct attribute_file {
- uint32 magic; // 'attr'
- uint32 entry_count;
- uint8 entries[1];
- } _PACKED;
-
- status_t fStatus;
- dev_t fVolumeID;
- ino_t fFileInode;
- ino_t fDirectoryInode;
- ino_t fAttributeDirInode;
- ino_t fAttributeFileInode;
- attribute_file * fFile;
- uint32 fAttributeDirIndex;
- AttributeEntry ** fEntries;
-};
-
-
-class AttributeEntry {
-public:
- AttributeEntry(AttributeFile *parent,
- uint8 *buffer);
- AttributeEntry(AttributeFile *parent,
- const char *name, type_code type);
- ~AttributeEntry();
-
- status_t InitCheck() { return fStatus; }
-
- uint8 * Entry() { return (uint8 *)fEntry; }
- size_t EntrySize();
- uint8 * Data() { return fData; }
- size_t DataSize() { return fEntry->size; }
-
- status_t SetType(type_code type);
- type_code Type() { return fEntry->type; }
-
- status_t SetSize(size_t size);
- uint32 Size() { return fEntry->size; }
-
- status_t SetName(const char *name);
- const char * Name() { return fEntry->name; }
- uint8 NameLength() { return fEntry->name_length; }
-
- status_t FillDirent(struct dirent *dirent,
- size_t bufferSize, uint32 *numEntries);
-
- status_t Read(off_t position, void *buffer, size_t *length);
- status_t Write(off_t position, const void *buffer,
- size_t *length);
-
- status_t ReadStat(struct stat *stat);
- status_t WriteStat(const struct stat *stat, uint32 statMask);
-
-private:
- struct attribute_entry {
- type_code type;
- uint32 size;
- uint8 name_length; // including 0 byte
- char name[1]; // 0 terminated, followed by data
- } _PACKED;
-
- AttributeFile * fParent;
- attribute_entry * fEntry;
- uint8 * fData;
- status_t fStatus;
- bool fAllocatedEntry;
- bool fAllocatedData;
-};
-
-
// #pragma mark OverlayVolume
OverlayVolume::OverlayVolume(fs_volume *volume)
- : fVolume(volume),
- fWriteSupport(false)
+ : fVolume(volume)
{
}
@@ -234,19 +110,6 @@
}
-status_t
-OverlayVolume::AllLayersMounted()
-{
- fs_info info;
- fs_volume *superVolume = fVolume->super_volume;
- if (superVolume->ops->read_fs_info != NULL
- && superVolume->ops->read_fs_info(superVolume, &info) == B_OK)
- fWriteSupport = (info.flags & B_FS_IS_READONLY) != 0;
-
- return B_OK;
-}
-
-
// #pragma mark OverlayInode
@@ -255,7 +118,6 @@
: fVolume(volume),
fSuperVnode(*superVnode),
fInodeNumber(inodeNumber),
- fAttributeFile(NULL),
fWriteBuffers(NULL),
fOriginalNodeLength(-1),
fCurrentNodeLength(-1)
@@ -267,8 +129,6 @@
OverlayInode::~OverlayInode()
{
TRACE("inode destroyed\n");
- delete fAttributeFile;
-
write_buffer *element = fWriteBuffers;
while (element) {
write_buffer *next = element->next;
@@ -286,50 +146,6 @@
status_t
-OverlayInode::GetAttributeFile(AttributeFile **attributeFile)
-{
- if (fAttributeFile == NULL) {
- fAttributeFile = new(std::nothrow) AttributeFile(Volume(),
- SuperVolume(), &fSuperVnode);
- if (fAttributeFile == NULL) {
- TRACE_ALWAYS("no memory to allocate attribute file\n");
- return B_NO_MEMORY;
- }
- }
-
- status_t result = fAttributeFile->InitCheck();
- if (result != B_OK) {
- if (result == B_ENTRY_NOT_FOUND) {
- // TODO: need to check if we're able to create the file
- // but at least allow virtual attributes for now
- }
-
- result = fAttributeFile->CreateEmpty();
- if (result != B_OK)
- return result;
- }
-
- *attributeFile = fAttributeFile;
- return B_OK;
-}
-
-
-status_t
-OverlayInode::WriteAttributeFile()
-{
- if (fAttributeFile == NULL)
- return B_NO_INIT;
-
- status_t result = fAttributeFile->InitCheck();
- if (result != B_OK)
- return result;
-
- return fAttributeFile->WriteAttributeFile(Volume(), SuperVolume(),
- &fSuperVnode);
-}
-
-
-status_t
OverlayInode::ReadStat(struct stat *stat)
{
if (fSuperVnode.ops->read_stat == NULL)
@@ -340,7 +156,7 @@
if (result != B_OK)
return result;
- if (fVolume->WriteSupport() && fCurrentNodeLength >= 0) {
+ if (fCurrentNodeLength >= 0) {
stat->st_size = fCurrentNodeLength;
stat->st_blocks = (stat->st_size + stat->st_blksize - 1)
/ stat->st_blksize;
@@ -357,110 +173,100 @@
if (fSuperVnode.ops->open == NULL)
return B_UNSUPPORTED;
- if (fVolume->WriteSupport()) {
- open_cookie *cookie = (open_cookie *)malloc(sizeof(open_cookie));
- if (cookie == NULL)
- return B_NO_MEMORY;
+ open_cookie *cookie = (open_cookie *)malloc(sizeof(open_cookie));
+ if (cookie == NULL)
+ return B_NO_MEMORY;
- if (fOriginalNodeLength < 0) {
- struct stat stat;
- status_t result = fSuperVnode.ops->read_stat(SuperVolume(),
- &fSuperVnode, &stat);
- if (result != B_OK)
- return result;
-
- fOriginalNodeLength = stat.st_size;
- fCurrentNodeLength = stat.st_size;
- fModificationTime = stat.st_mtime;
+ if (fOriginalNodeLength < 0) {
+ struct stat stat;
+ status_t result = fSuperVnode.ops->read_stat(SuperVolume(),
+ &fSuperVnode, &stat);
+ if (result != B_OK) {
+ free(cookie);
+ return result;
}
- cookie->open_mode = openMode;
- *_cookie = cookie;
+ fOriginalNodeLength = stat.st_size;
+ fCurrentNodeLength = stat.st_size;
+ fModificationTime = stat.st_mtime;
+ }
- if (openMode & O_TRUNC)
- fCurrentNodeLength = 0;
+ cookie->open_mode = openMode;
+ *_cookie = cookie;
- openMode &= ~(O_RDWR | O_WRONLY | O_TRUNC | O_CREAT);
- return fSuperVnode.ops->open(SuperVolume(), &fSuperVnode, openMode,
- &cookie->super_cookie);
+ if (openMode & O_TRUNC)
+ fCurrentNodeLength = 0;
+
+ openMode &= ~(O_RDWR | O_WRONLY | O_TRUNC | O_CREAT);
+ status_t result = fSuperVnode.ops->open(SuperVolume(), &fSuperVnode,
+ openMode, &cookie->super_cookie);
+ if (result != B_OK) {
+ free(cookie);
+ return result;
}
- return fSuperVnode.ops->open(SuperVolume(), &fSuperVnode, openMode,
- _cookie);
+ return B_OK;
}
status_t
OverlayInode::Close(void *_cookie)
{
- if (fVolume->WriteSupport()) {
- open_cookie *cookie = (open_cookie *)_cookie;
- return fSuperVnode.ops->close(SuperVolume(), &fSuperVnode,
- cookie->super_cookie);
- }
-
- return fSuperVnode.ops->close(SuperVolume(), &fSuperVnode, _cookie);
+ open_cookie *cookie = (open_cookie *)_cookie;
+ return fSuperVnode.ops->close(SuperVolume(), &fSuperVnode,
+ cookie->super_cookie);
}
status_t
OverlayInode::FreeCookie(void *_cookie)
{
- if (fVolume->WriteSupport()) {
- open_cookie *cookie = (open_cookie *)_cookie;
- status_t result = fSuperVnode.ops->free_cookie(SuperVolume(),
- &fSuperVnode, cookie->super_cookie);
- free(cookie);
- return result;
- }
-
- return fSuperVnode.ops->free_cookie(SuperVolume(), &fSuperVnode, _cookie);
+ open_cookie *cookie = (open_cookie *)_cookie;
+ status_t result = fSuperVnode.ops->free_cookie(SuperVolume(),
+ &fSuperVnode, cookie->super_cookie);
+ free(cookie);
+ return result;
}
status_t
OverlayInode::Read(void *_cookie, off_t position, void *buffer, size_t *length)
{
- if (fVolume->WriteSupport()) {
- if (position >= fCurrentNodeLength) {
- *length = 0;
- return B_OK;
- }
+ if (position >= fCurrentNodeLength) {
+ *length = 0;
+ return B_OK;
+ }
- if (position < fOriginalNodeLength) {
- open_cookie *cookie = (open_cookie *)_cookie;
- size_t readLength = MIN(fOriginalNodeLength - position, *length);
- status_t result = fSuperVnode.ops->read(SuperVolume(), &fSuperVnode,
- cookie->super_cookie, position, buffer, &readLength);
- if (result != B_OK)
- return result;
- }
+ if (position < fOriginalNodeLength) {
+ open_cookie *cookie = (open_cookie *)_cookie;
+ size_t readLength = MIN(fOriginalNodeLength - position, *length);
+ status_t result = fSuperVnode.ops->read(SuperVolume(), &fSuperVnode,
+ cookie->super_cookie, position, buffer, &readLength);
+ if (result != B_OK)
+ return result;
+ }
- // overlay the read with whatever chunks we have written
- write_buffer *element = fWriteBuffers;
- *length = MIN(fCurrentNodeLength - position, *length);
- off_t end = position + *length;
- while (element) {
- if (element->position > end)
- break;
+ // overlay the read with whatever chunks we have written
+ write_buffer *element = fWriteBuffers;
+ *length = MIN(fCurrentNodeLength - position, *length);
+ off_t end = position + *length;
+ while (element) {
+ if (element->position > end)
+ break;
- off_t elementEnd = element->position + element->length;
- if (elementEnd > position) {
- off_t copyPosition = MAX(position, element->position);
- size_t copyLength = MIN(elementEnd - position, *length);
- memcpy((uint8 *)buffer + (copyPosition - position),
- element->buffer + (copyPosition - element->position),
- copyLength);
- }
-
- element = element->next;
+ off_t elementEnd = element->position + element->length;
+ if (elementEnd > position) {
+ off_t copyPosition = MAX(position, element->position);
+ size_t copyLength = MIN(elementEnd - position, *length);
+ memcpy((uint8 *)buffer + (copyPosition - position),
+ element->buffer + (copyPosition - element->position),
+ copyLength);
}
- return B_OK;
+ element = element->next;
}
- return fSuperVnode.ops->read(SuperVolume(), &fSuperVnode, _cookie,
- position, buffer, length);
+ return B_OK;
}
@@ -468,805 +274,94 @@
OverlayInode::Write(void *_cookie, off_t position, const void *buffer,
size_t *length)
{
- if (fVolume->WriteSupport()) {
- // find insertion point
- write_buffer **link = &fWriteBuffers;
- write_buffer *other = fWriteBuffers;
- write_buffer *swallow = NULL;
- off_t newPosition = position;
- size_t newLength = *length;
- uint32 swallowCount = 0;
+ // find insertion point
+ write_buffer **link = &fWriteBuffers;
+ write_buffer *other = fWriteBuffers;
+ write_buffer *swallow = NULL;
+ off_t newPosition = position;
+ size_t newLength = *length;
+ uint32 swallowCount = 0;
- while (other) {
- off_t newEnd = newPosition + newLength;
- off_t otherEnd = other->position + other->length;
- if (otherEnd < newPosition) {
- // other is completely before us
- link = &other->next;
- other = other->next;
- continue;
[... truncated: 1136 lines follow ...]
From mmlr at mail.berlios.de Thu Feb 19 22:13:04 2009
From: mmlr at mail.berlios.de (mmlr at mail.berlios.de)
Date: Thu, 19 Feb 2009 22:13:04 +0100
Subject: [Haiku-commits] r29256 - in
haiku/trunk/src/add-ons/kernel/file_systems/layers:
attribute_overlay write_overlay
Message-ID: <200902192113.n1JLD4Pn027416@sheep.berlios.de>
Author: mmlr
Date: 2009-02-19 22:13:02 +0100 (Thu, 19 Feb 2009)
New Revision: 29256
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29256&view=rev
Modified:
haiku/trunk/src/add-ons/kernel/file_systems/layers/attribute_overlay/attribute_overlay.cpp
haiku/trunk/src/add-ons/kernel/file_systems/layers/write_overlay/write_overlay.cpp
Log:
Rename the trace output as well.
Modified: haiku/trunk/src/add-ons/kernel/file_systems/layers/attribute_overlay/attribute_overlay.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/file_systems/layers/attribute_overlay/attribute_overlay.cpp 2009-02-19 21:11:59 UTC (rev 29255)
+++ haiku/trunk/src/add-ons/kernel/file_systems/layers/attribute_overlay/attribute_overlay.cpp 2009-02-19 21:13:02 UTC (rev 29256)
@@ -24,13 +24,13 @@
//#define TRACE_OVERLAY
#ifdef TRACE_OVERLAY
-#define TRACE(x...) dprintf("overlay: " x)
-#define TRACE_VOLUME(x...) dprintf("overlay: " x)
-#define TRACE_ALWAYS(x...) dprintf("overlay: " x)
+#define TRACE(x...) dprintf("attribute_overlay: " x)
+#define TRACE_VOLUME(x...) dprintf("attribute_overlay: " x)
+#define TRACE_ALWAYS(x...) dprintf("attribute_overlay: " x)
#else
#define TRACE(x...) /* nothing */
#define TRACE_VOLUME(x...) /* nothing */
-#define TRACE_ALWAYS(x...) dprintf("overlay: " x)
+#define TRACE_ALWAYS(x...) dprintf("attribute_overlay: " x)
#endif
@@ -1926,7 +1926,7 @@
overlay_mount(fs_volume *volume, const char *device, uint32 flags,
const char *args, ino_t *rootID)
{
- TRACE_VOLUME("mounting overlay\n");
+ TRACE_VOLUME("mounting attribute overlay\n");
volume->private_volume = new(std::nothrow) OverlayVolume(volume);
if (volume->private_volume == NULL)
return B_NO_MEMORY;
Modified: haiku/trunk/src/add-ons/kernel/file_systems/layers/write_overlay/write_overlay.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/file_systems/layers/write_overlay/write_overlay.cpp 2009-02-19 21:11:59 UTC (rev 29255)
+++ haiku/trunk/src/add-ons/kernel/file_systems/layers/write_overlay/write_overlay.cpp 2009-02-19 21:13:02 UTC (rev 29256)
@@ -24,13 +24,13 @@
//#define TRACE_OVERLAY
#ifdef TRACE_OVERLAY
-#define TRACE(x...) dprintf("overlay: " x)
-#define TRACE_VOLUME(x...) dprintf("overlay: " x)
-#define TRACE_ALWAYS(x...) dprintf("overlay: " x)
+#define TRACE(x...) dprintf("write_overlay: " x)
+#define TRACE_VOLUME(x...) dprintf("write_overlay: " x)
+#define TRACE_ALWAYS(x...) dprintf("write_overlay: " x)
#else
#define TRACE(x...) /* nothing */
#define TRACE_VOLUME(x...) /* nothing */
-#define TRACE_ALWAYS(x...) dprintf("overlay: " x)
+#define TRACE_ALWAYS(x...) dprintf("write_overlay: " x)
#endif
From mmu_man at mail.berlios.de Thu Feb 19 22:29:28 2009
From: mmu_man at mail.berlios.de (mmu_man at BerliOS)
Date: Thu, 19 Feb 2009 22:29:28 +0100
Subject: [Haiku-commits] r29257 - in haiku/trunk/docs/userguide: . en
en/applications en/desktop-applets en/installation en/preferences
Message-ID: <200902192129.n1JLTSIf030039@sheep.berlios.de>
Author: mmu_man
Date: 2009-02-19 22:29:27 +0100 (Thu, 19 Feb 2009)
New Revision: 29257
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29257&view=rev
Modified:
haiku/trunk/docs/userguide/en/applications.html
haiku/trunk/docs/userguide/en/applications/apps-activitymonitor.html
haiku/trunk/docs/userguide/en/applications/apps-bepdf.html
haiku/trunk/docs/userguide/en/applications/apps-cdplayer.html
haiku/trunk/docs/userguide/en/applications/apps-codycam.html
haiku/trunk/docs/userguide/en/applications/apps-deskcalc.html
haiku/trunk/docs/userguide/en/applications/apps-diskprobe.html
haiku/trunk/docs/userguide/en/applications/apps-diskusage.html
haiku/trunk/docs/userguide/en/applications/apps-drivesetup.html
haiku/trunk/docs/userguide/en/applications/apps-expander.html
haiku/trunk/docs/userguide/en/applications/apps-firefox.html
haiku/trunk/docs/userguide/en/applications/apps-icon-o-matic.html
haiku/trunk/docs/userguide/en/applications/apps-installer.html
haiku/trunk/docs/userguide/en/applications/apps-magnify.html
haiku/trunk/docs/userguide/en/applications/apps-mail.html
haiku/trunk/docs/userguide/en/applications/apps-mediaplayer.html
haiku/trunk/docs/userguide/en/applications/apps-midiplayer.html
haiku/trunk/docs/userguide/en/applications/apps-packageinstaller.html
haiku/trunk/docs/userguide/en/applications/apps-pe.html
haiku/trunk/docs/userguide/en/applications/apps-people.html
haiku/trunk/docs/userguide/en/applications/apps-screenshot.html
haiku/trunk/docs/userguide/en/applications/apps-showimage.html
haiku/trunk/docs/userguide/en/applications/apps-soundrecorder.html
haiku/trunk/docs/userguide/en/applications/apps-stylededit.html
haiku/trunk/docs/userguide/en/applications/apps-terminal.html
haiku/trunk/docs/userguide/en/applications/apps-textsearch.html
haiku/trunk/docs/userguide/en/applications/apps-tv.html
haiku/trunk/docs/userguide/en/applications/apps-vision.html
haiku/trunk/docs/userguide/en/applications/apps-vlc.html
haiku/trunk/docs/userguide/en/applications/apps-wonderbrush.html
haiku/trunk/docs/userguide/en/attributes.html
haiku/trunk/docs/userguide/en/bash-scripting.html
haiku/trunk/docs/userguide/en/bootloader.html
haiku/trunk/docs/userguide/en/contents.html
haiku/trunk/docs/userguide/en/demos.html
haiku/trunk/docs/userguide/en/deskbar.html
haiku/trunk/docs/userguide/en/desktop-applets.html
haiku/trunk/docs/userguide/en/desktop-applets/desktop-applets-launchbox.html
haiku/trunk/docs/userguide/en/desktop-applets/desktop-applets-networkstatus.html
haiku/trunk/docs/userguide/en/desktop-applets/desktop-applets-processcontroller.html
haiku/trunk/docs/userguide/en/filesystem-layout.html
haiku/trunk/docs/userguide/en/filetypes.html
haiku/trunk/docs/userguide/en/gui.html
haiku/trunk/docs/userguide/en/index.html
haiku/trunk/docs/userguide/en/installation.html
haiku/trunk/docs/userguide/en/installation/install-boot-process.html
haiku/trunk/docs/userguide/en/installation/install-raw.html
haiku/trunk/docs/userguide/en/installation/install-source-beos.html
haiku/trunk/docs/userguide/en/installation/install-source-linux.html
haiku/trunk/docs/userguide/en/installation/install-source-mac.html
haiku/trunk/docs/userguide/en/installation/install-source-windows.html
haiku/trunk/docs/userguide/en/installation/install-usb.html
haiku/trunk/docs/userguide/en/installation/install-vm.html
haiku/trunk/docs/userguide/en/installing.html
haiku/trunk/docs/userguide/en/keyboard-shortcuts.html
haiku/trunk/docs/userguide/en/preferences.html
haiku/trunk/docs/userguide/en/preferences/prefs-appearance.html
haiku/trunk/docs/userguide/en/preferences/prefs-backgrounds.html
haiku/trunk/docs/userguide/en/preferences/prefs-datatranslations.html
haiku/trunk/docs/userguide/en/preferences/prefs-e-mail.html
haiku/trunk/docs/userguide/en/preferences/prefs-filetypes.html
haiku/trunk/docs/userguide/en/preferences/prefs-fonts.html
haiku/trunk/docs/userguide/en/preferences/prefs-keyboard.html
haiku/trunk/docs/userguide/en/preferences/prefs-keymap.html
haiku/trunk/docs/userguide/en/preferences/prefs-media.html
haiku/trunk/docs/userguide/en/preferences/prefs-menu.html
haiku/trunk/docs/userguide/en/preferences/prefs-mouse.html
haiku/trunk/docs/userguide/en/preferences/prefs-network.html
haiku/trunk/docs/userguide/en/preferences/prefs-printers.html
haiku/trunk/docs/userguide/en/preferences/prefs-screen.html
haiku/trunk/docs/userguide/en/preferences/prefs-screensaver.html
haiku/trunk/docs/userguide/en/preferences/prefs-sounds.html
haiku/trunk/docs/userguide/en/preferences/prefs-time.html
haiku/trunk/docs/userguide/en/preferences/prefs-tracker.html
haiku/trunk/docs/userguide/en/preferences/prefs-virtualmemory.html
haiku/trunk/docs/userguide/en/queries.html
haiku/trunk/docs/userguide/en/teammonitor.html
haiku/trunk/docs/userguide/en/tracker-add-ons.html
haiku/trunk/docs/userguide/en/tracker.html
haiku/trunk/docs/userguide/en/twitcher.html
haiku/trunk/docs/userguide/en/workshop-filetypes+attributes.html
haiku/trunk/docs/userguide/en/workspaces.html
haiku/trunk/docs/userguide/languages.html
Log:
Set mimetype to text/html on userguide too, it will be viewable on
http://svn.berlios.de/wsvn/haiku/haiku/trunk/docs/userguide/languages.html
Property changes on: haiku/trunk/docs/userguide/en/applications/apps-activitymonitor.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/applications/apps-bepdf.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/applications/apps-cdplayer.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/applications/apps-codycam.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/applications/apps-deskcalc.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/applications/apps-diskprobe.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/applications/apps-diskusage.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/applications/apps-drivesetup.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/applications/apps-expander.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/applications/apps-firefox.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/applications/apps-icon-o-matic.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/applications/apps-installer.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/applications/apps-magnify.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/applications/apps-mail.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/applications/apps-mediaplayer.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/applications/apps-midiplayer.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/applications/apps-packageinstaller.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/applications/apps-pe.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/applications/apps-people.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/applications/apps-screenshot.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/applications/apps-showimage.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/applications/apps-soundrecorder.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/applications/apps-stylededit.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/applications/apps-terminal.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/applications/apps-textsearch.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/applications/apps-tv.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/applications/apps-vision.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/applications/apps-vlc.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/applications/apps-wonderbrush.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/applications.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/attributes.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/bash-scripting.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/bootloader.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/contents.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/demos.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/deskbar.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/desktop-applets/desktop-applets-launchbox.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/desktop-applets/desktop-applets-networkstatus.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/desktop-applets/desktop-applets-processcontroller.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/desktop-applets.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/filesystem-layout.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/filetypes.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/gui.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/index.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/installation/install-boot-process.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/installation/install-raw.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/installation/install-source-beos.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/installation/install-source-linux.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/installation/install-source-mac.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/installation/install-source-windows.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/installation/install-usb.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/installation/install-vm.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/installation.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/installing.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/keyboard-shortcuts.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/preferences/prefs-appearance.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/preferences/prefs-backgrounds.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/preferences/prefs-datatranslations.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/preferences/prefs-e-mail.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/preferences/prefs-filetypes.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/preferences/prefs-fonts.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/preferences/prefs-keyboard.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/preferences/prefs-keymap.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/preferences/prefs-media.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/preferences/prefs-menu.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/preferences/prefs-mouse.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/preferences/prefs-network.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/preferences/prefs-printers.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/preferences/prefs-screen.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/preferences/prefs-screensaver.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/preferences/prefs-sounds.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/preferences/prefs-time.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/preferences/prefs-tracker.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/preferences/prefs-virtualmemory.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/preferences.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/queries.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/teammonitor.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/tracker-add-ons.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/tracker.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/twitcher.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/workshop-filetypes+attributes.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/en/workspaces.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: haiku/trunk/docs/userguide/languages.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
From mmlr at mail.berlios.de Thu Feb 19 22:45:47 2009
From: mmlr at mail.berlios.de (mmlr at mail.berlios.de)
Date: Thu, 19 Feb 2009 22:45:47 +0100
Subject: [Haiku-commits] r29258 -
haiku/trunk/src/add-ons/kernel/file_systems/layers/attribute_overlay
Message-ID: <200902192145.n1JLjl8Z002419@sheep.berlios.de>
Author: mmlr
Date: 2009-02-19 22:45:46 +0100 (Thu, 19 Feb 2009)
New Revision: 29258
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29258&view=rev
Modified:
haiku/trunk/src/add-ons/kernel/file_systems/layers/attribute_overlay/attribute_overlay.cpp
Log:
No need to relay the attribute calls. Fixes attribute overlays when used with another layer.
Modified: haiku/trunk/src/add-ons/kernel/file_systems/layers/attribute_overlay/attribute_overlay.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/file_systems/layers/attribute_overlay/attribute_overlay.cpp 2009-02-19 21:29:27 UTC (rev 29257)
+++ haiku/trunk/src/add-ons/kernel/file_systems/layers/attribute_overlay/attribute_overlay.cpp 2009-02-19 21:45:46 UTC (rev 29258)
@@ -1366,8 +1366,7 @@
static status_t
overlay_open_attr_dir(fs_volume *volume, fs_vnode *vnode, void **cookie)
{
- OVERLAY_CALL(open_attr_dir, cookie)
-
+ OverlayInode *node = (OverlayInode *)vnode->private_node;
AttributeFile *attributeFile = NULL;
status_t result = node->GetAttributeFile(&attributeFile);
if (result != B_OK)
@@ -1388,7 +1387,6 @@
static status_t
overlay_close_attr_dir(fs_volume *volume, fs_vnode *vnode, void *cookie)
{
- OVERLAY_CALL(close_attr_dir, cookie)
return B_OK;
}
@@ -1396,7 +1394,6 @@
static status_t
overlay_free_attr_dir_cookie(fs_volume *volume, fs_vnode *vnode, void *cookie)
{
- OVERLAY_CALL(free_attr_dir_cookie, cookie)
free(cookie);
return B_OK;
}
@@ -1406,7 +1403,6 @@
overlay_read_attr_dir(fs_volume *volume, fs_vnode *vnode, void *cookie,
struct dirent *buffer, size_t bufferSize, uint32 *num)
{
- OVERLAY_CALL(read_attr_dir, cookie, buffer, bufferSize, num)
attribute_dir_cookie *dirCookie = (attribute_dir_cookie *)cookie;
return dirCookie->file->ReadAttributeDir(buffer, bufferSize, num,
&dirCookie->index);
@@ -1416,7 +1412,6 @@
static status_t
overlay_rewind_attr_dir(fs_volume *volume, fs_vnode *vnode, void *cookie)
{
- OVERLAY_CALL(rewind_attr_dir, cookie)
attribute_dir_cookie *dirCookie = (attribute_dir_cookie *)cookie;
dirCookie->index = 0;
return B_OK;
@@ -1427,8 +1422,7 @@
overlay_create_attr(fs_volume *volume, fs_vnode *vnode, const char *name,
uint32 type, int openMode, void **cookie)
{
- OVERLAY_CALL(create_attr, name, type, openMode, cookie)
-
+ OverlayInode *node = (OverlayInode *)vnode->private_node;
AttributeFile *attributeFile = NULL;
status_t result = node->GetAttributeFile(&attributeFile);
if (result != B_OK)
@@ -1443,8 +1437,7 @@
overlay_open_attr(fs_volume *volume, fs_vnode *vnode, const char *name,
int openMode, void **cookie)
{
- OVERLAY_CALL(open_attr, name, openMode, cookie)
-
+ OverlayInode *node = (OverlayInode *)vnode->private_node;
AttributeFile *attributeFile = NULL;
status_t result = node->GetAttributeFile(&attributeFile);
if (result != B_OK)
@@ -1458,7 +1451,6 @@
static status_t
overlay_close_attr(fs_volume *volume, fs_vnode *vnode, void *cookie)
{
- OVERLAY_CALL(close_attr, cookie)
return B_OK;
}
@@ -1466,7 +1458,6 @@
static status_t
overlay_free_attr_cookie(fs_volume *volume, fs_vnode *vnode, void *cookie)
{
- OVERLAY_CALL(free_attr_cookie, cookie)
return B_OK;
}
@@ -1475,7 +1466,6 @@
overlay_read_attr(fs_volume *volume, fs_vnode *vnode, void *cookie, off_t pos,
void *buffer, size_t *length)
{
- OVERLAY_CALL(read_attr, cookie, pos, buffer, length)
return ((AttributeEntry *)cookie)->Read(pos, buffer, length);
}
@@ -1484,7 +1474,6 @@
overlay_write_attr(fs_volume *volume, fs_vnode *vnode, void *cookie, off_t pos,
const void *buffer, size_t *length)
{
- OVERLAY_CALL(write_attr, cookie, pos, buffer, length)
return ((AttributeEntry *)cookie)->Write(pos, buffer, length);
}
@@ -1493,7 +1482,6 @@
overlay_read_attr_stat(fs_volume *volume, fs_vnode *vnode, void *cookie,
struct stat *stat)
{
- OVERLAY_CALL(read_attr_stat, cookie, stat)
return ((AttributeEntry *)cookie)->ReadStat(stat);
}
@@ -1502,7 +1490,6 @@
overlay_write_attr_stat(fs_volume *volume, fs_vnode *vnode, void *cookie,
const struct stat *stat, int statMask)
{
- OVERLAY_CALL(write_attr_stat, cookie, stat, statMask)
return ((AttributeEntry *)cookie)->WriteStat(stat, statMask);
}
@@ -1511,8 +1498,7 @@
overlay_rename_attr(fs_volume *volume, fs_vnode *vnode,
const char *fromName, fs_vnode *toVnode, const char *toName)
{
- OVERLAY_CALL(rename_attr, fromName, toVnode, toName)
-
+ OverlayInode *node = (OverlayInode *)vnode->private_node;
AttributeFile *attributeFile = NULL;
status_t result = node->GetAttributeFile(&attributeFile);
if (result != B_OK)
@@ -1553,8 +1539,7 @@
static status_t
overlay_remove_attr(fs_volume *volume, fs_vnode *vnode, const char *name)
{
- OVERLAY_CALL(remove_attr, name)
-
+ OverlayInode *node = (OverlayInode *)vnode->private_node;
AttributeFile *attributeFile = NULL;
status_t result = node->GetAttributeFile(&attributeFile);
if (result != B_OK)
From mmlr at mail.berlios.de Thu Feb 19 23:39:54 2009
From: mmlr at mail.berlios.de (mmlr at mail.berlios.de)
Date: Thu, 19 Feb 2009 23:39:54 +0100
Subject: [Haiku-commits] r29259 - haiku/trunk/src/system/kernel/fs
Message-ID: <200902192239.n1JMds6a009472@sheep.berlios.de>
Author: mmlr
Date: 2009-02-19 23:39:52 +0100 (Thu, 19 Feb 2009)
New Revision: 29259
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29259&view=rev
Modified:
haiku/trunk/src/system/kernel/fs/vfs.cpp
Log:
We need a longer filesystem string here to fit in all the possible layers.
Modified: haiku/trunk/src/system/kernel/fs/vfs.cpp
===================================================================
--- haiku/trunk/src/system/kernel/fs/vfs.cpp 2009-02-19 21:45:46 UTC (rev 29258)
+++ haiku/trunk/src/system/kernel/fs/vfs.cpp 2009-02-19 22:39:52 UTC (rev 29259)
@@ -8146,7 +8146,7 @@
_user_mount(const char *userPath, const char *userDevice, const char *userFileSystem,
uint32 flags, const char *userArgs, size_t argsLength)
{
- char fileSystem[B_OS_NAME_LENGTH];
+ char fileSystem[B_FILE_NAME_LENGTH];
KPath path, device;
char *args = NULL;
status_t status;
From mmlr at mail.berlios.de Thu Feb 19 23:40:31 2009
From: mmlr at mail.berlios.de (mmlr at mail.berlios.de)
Date: Thu, 19 Feb 2009 23:40:31 +0100
Subject: [Haiku-commits] r29260 -
haiku/trunk/src/add-ons/kernel/file_systems/layers/write_overlay
Message-ID: <200902192240.n1JMeVOB009664@sheep.berlios.de>
Author: mmlr
Date: 2009-02-19 23:40:30 +0100 (Thu, 19 Feb 2009)
New Revision: 29260
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29260&view=rev
Modified:
haiku/trunk/src/add-ons/kernel/file_systems/layers/write_overlay/write_overlay.cpp
Log:
Implemented write stat.
Modified: haiku/trunk/src/add-ons/kernel/file_systems/layers/write_overlay/write_overlay.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/file_systems/layers/write_overlay/write_overlay.cpp 2009-02-19 22:39:52 UTC (rev 29259)
+++ haiku/trunk/src/add-ons/kernel/file_systems/layers/write_overlay/write_overlay.cpp 2009-02-19 22:40:30 UTC (rev 29260)
@@ -76,6 +76,7 @@
ino_t InodeNumber() { return fInodeNumber; }
status_t ReadStat(struct stat *stat);
+ status_t WriteStat(const struct stat *stat, uint32 statMask);
status_t Open(int openMode, void **cookie);
status_t Close(void *cookie);
@@ -91,8 +92,8 @@
ino_t fInodeNumber;
write_buffer * fWriteBuffers;
off_t fOriginalNodeLength;
- off_t fCurrentNodeLength;
- time_t fModificationTime;
+ struct stat fStat;
+ bool fHasStat;
};
@@ -120,7 +121,7 @@
fInodeNumber(inodeNumber),
fWriteBuffers(NULL),
fOriginalNodeLength(-1),
- fCurrentNodeLength(-1)
+ fHasStat(false)
{
TRACE("inode created\n");
}
@@ -148,26 +149,60 @@
status_t
OverlayInode::ReadStat(struct stat *stat)
{
- if (fSuperVnode.ops->read_stat == NULL)
- return B_UNSUPPORTED;
+ if (!fHasStat) {
+ if (fSuperVnode.ops->read_stat == NULL)
+ return B_UNSUPPORTED;
- status_t result = fSuperVnode.ops->read_stat(SuperVolume(), &fSuperVnode,
- stat);
- if (result != B_OK)
- return result;
+ status_t result = fSuperVnode.ops->read_stat(SuperVolume(),
+ &fSuperVnode, &fStat);
+ if (result != B_OK)
+ return result;
- if (fCurrentNodeLength >= 0) {
- stat->st_size = fCurrentNodeLength;
- stat->st_blocks = (stat->st_size + stat->st_blksize - 1)
- / stat->st_blksize;
- stat->st_mtime = fModificationTime;
+ fHasStat = true;
}
+ if (stat == NULL)
+ return B_OK;
+
+ memcpy(stat, &fStat, sizeof(struct stat));
+ stat->st_blocks = (stat->st_size + stat->st_blksize - 1) / stat->st_blksize;
return B_OK;
}
status_t
+OverlayInode::WriteStat(const struct stat *stat, uint32 statMask)
+{
+ if (!fHasStat)
+ ReadStat(NULL);
+
+ if (statMask & B_STAT_SIZE)
+ fStat.st_size = stat->st_size;
+
+ if (statMask & B_STAT_MODE)
+ fStat.st_mode = stat->st_mode;
+ if (statMask & B_STAT_UID)
+ fStat.st_uid = stat->st_uid;
+ if (statMask & B_STAT_GID)
+ fStat.st_gid = stat->st_gid;
+
+ if (statMask & B_STAT_MODIFICATION_TIME)
+ fStat.st_mtime = stat->st_mtime;
+ if (statMask & B_STAT_CREATION_TIME)
+ fStat.st_crtime = stat->st_crtime;
+
+ if ((statMask & (B_STAT_MODE | B_STAT_UID | B_STAT_GID)) != 0
+ && (statMask & B_STAT_MODIFICATION_TIME) == 0) {
+ fStat.st_mtime = time(NULL);
+ statMask |= B_STAT_MODIFICATION_TIME;
+ }
+
+ notify_stat_changed(SuperVolume()->id, fInodeNumber, statMask);
+ return B_OK;
+}
+
+
+status_t
OverlayInode::Open(int openMode, void **_cookie)
{
if (fSuperVnode.ops->open == NULL)
@@ -181,21 +216,17 @@
struct stat stat;
status_t result = fSuperVnode.ops->read_stat(SuperVolume(),
&fSuperVnode, &stat);
- if (result != B_OK) {
- free(cookie);
+ if (result != B_OK)
return result;
- }
fOriginalNodeLength = stat.st_size;
- fCurrentNodeLength = stat.st_size;
- fModificationTime = stat.st_mtime;
}
cookie->open_mode = openMode;
*_cookie = cookie;
if (openMode & O_TRUNC)
- fCurrentNodeLength = 0;
+ fStat.st_size = 0;
openMode &= ~(O_RDWR | O_WRONLY | O_TRUNC | O_CREAT);
status_t result = fSuperVnode.ops->open(SuperVolume(), &fSuperVnode,
@@ -232,7 +263,7 @@
status_t
OverlayInode::Read(void *_cookie, off_t position, void *buffer, size_t *length)
{
- if (position >= fCurrentNodeLength) {
+ if (position >= fStat.st_size) {
*length = 0;
return B_OK;
}
@@ -244,11 +275,15 @@
cookie->super_cookie, position, buffer, &readLength);
if (result != B_OK)
return result;
- }
+ if (readLength < *length)
+ memset((uint8 *)buffer + readLength, 0, *length - readLength);
+ } else
+ memset(buffer, 0, *length);
+
// overlay the read with whatever chunks we have written
write_buffer *element = fWriteBuffers;
- *length = MIN(fCurrentNodeLength - position, *length);
+ *length = MIN(fStat.st_size - position, *length);
off_t end = position + *length;
while (element) {
if (element->position > end)
@@ -307,7 +342,7 @@
memcpy(other->buffer + (newPosition - other->position),
buffer, *length);
- fModificationTime = time(NULL);
+ fStat.st_mtime = time(NULL);
notify_stat_changed(SuperVolume()->id, fInodeNumber,
B_STAT_MODIFICATION_TIME);
return B_OK;
@@ -335,8 +370,8 @@
bool sizeChanged = false;
off_t newEnd = newPosition + newLength;
- if (newEnd > fCurrentNodeLength) {
- fCurrentNodeLength = newEnd;
+ if (newEnd > fStat.st_size) {
+ fStat.st_size = newEnd;
sizeChanged = true;
}
@@ -354,10 +389,9 @@
memcpy(element->buffer + (position - newPosition), buffer, *length);
- fModificationTime = time(NULL);
+ fStat.st_mtime = time(NULL);
notify_stat_changed(SuperVolume()->id, fInodeNumber,
B_STAT_MODIFICATION_TIME | (sizeChanged ? B_STAT_SIZE : 0));
-
return B_OK;
}
@@ -613,8 +647,7 @@
overlay_write_stat(fs_volume *volume, fs_vnode *vnode, const struct stat *stat,
uint32 statMask)
{
- OVERLAY_CALL(write_stat, stat, statMask)
- return B_UNSUPPORTED;
+ return ((OverlayInode *)vnode->private_node)->WriteStat(stat, statMask);
}
@@ -974,7 +1007,7 @@
if (result != B_OK)
return result;
- info->flags &= ~(B_FS_IS_READONLY | B_FS_IS_PERSISTENT);
+ info->flags &= ~B_FS_IS_READONLY;
return B_OK;
}
From axeld at pinc-software.de Fri Feb 20 00:01:35 2009
From: axeld at pinc-software.de (=?ISO-8859-1?Q?Axel_D=F6rfler?=)
Date: Fri, 20 Feb 2009 00:01:35 +0100
Subject: [Haiku-commits] r29249 -
haiku/trunk/src/add-ons/kernel/file_systems/overlay
In-Reply-To: <6035180693-BeMail@haiku>
References: <6035180693-BeMail@haiku>
Message-ID: <499DE4CF.2060009@pinc-software.de>
Michael Lotz wrote:
>>> Rather, I think there should be several layers, each providing just
>>> one kind of functionality.
> Please don't worry. I'm currently just prototyping it into this one
> layer. I intended to split it up when it was reasonably working and
> then also rename/move the layer. But I guess I can do that just as well
> now.
Ah, great to know :-)
>> also, this seems to make CDs writable with isvolume I was told...
> It obviously does, yes. It's intended for the live CD mode later on.
> Determining whether or not to start the installer should later be done
> based on the persistance of the storage instead of read-only.
Actually, the persistance flag in BeOS is pretty much misused (or
understood in a different way one would, intuitively): IIRC Tracker
ignores all file systems that aren't persistent to hide them from the
user (like /dev, and /pipe).
Also, if there is HD installed, the layer could actually store the data
there (maybe when configured like this).
Not sure if this is a good idea, but the Bootscript could also launch
into a special live/install environment when the boot device is
removable. That would include USB sticks as well.
Bye,
Axel.
From mmlr at mail.berlios.de Fri Feb 20 00:01:45 2009
From: mmlr at mail.berlios.de (mmlr at mail.berlios.de)
Date: Fri, 20 Feb 2009 00:01:45 +0100
Subject: [Haiku-commits] r29261 - in haiku/trunk: build/jam
src/add-ons/kernel/file_systems src/system/kernel/fs
Message-ID: <200902192301.n1JN1jYt011876@sheep.berlios.de>
Author: mmlr
Date: 2009-02-20 00:01:42 +0100 (Fri, 20 Feb 2009)
New Revision: 29261
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29261&view=rev
Removed:
haiku/trunk/src/add-ons/kernel/file_systems/overlay/
Modified:
haiku/trunk/build/jam/FloppyBootImage
haiku/trunk/build/jam/HaikuImage
haiku/trunk/src/system/kernel/fs/vfs_boot.cpp
Log:
* Remove the original overlay filesystem.
* Add attribute_overlay and write_overlay to the image/floppy instead.
* Mount a iso9660 boot volume with both write and attribute overlay for now.
Modified: haiku/trunk/build/jam/FloppyBootImage
===================================================================
--- haiku/trunk/build/jam/FloppyBootImage 2009-02-19 22:40:30 UTC (rev 29260)
+++ haiku/trunk/build/jam/FloppyBootImage 2009-02-19 23:01:42 UTC (rev 29261)
@@ -33,7 +33,7 @@
BEOS_ADD_ONS_BUS_MANAGERS = pci $(X86_ONLY)isa ide scsi
config_manager agp_gart usb
;
-BEOS_ADD_ONS_FILE_SYSTEMS = bfs iso9660 overlay ;
+BEOS_ADD_ONS_FILE_SYSTEMS = bfs iso9660 attribute_overlay write_overlay ;
#cdda fat googlefs nfs ;
Modified: haiku/trunk/build/jam/HaikuImage
===================================================================
--- haiku/trunk/build/jam/HaikuImage 2009-02-19 22:40:30 UTC (rev 29260)
+++ haiku/trunk/build/jam/HaikuImage 2009-02-19 23:01:42 UTC (rev 29261)
@@ -138,7 +138,8 @@
BEOS_ADD_ONS_BUS_MANAGERS = pci $(X86_ONLY)ps2 $(X86_ONLY)isa ide scsi
config_manager agp_gart usb firewire $(X86_ONLY)acpi
;
-BEOS_ADD_ONS_FILE_SYSTEMS = bfs cdda ext2 fat iso9660 nfs overlay $(GPL_ONLY)reiserfs ;
+BEOS_ADD_ONS_FILE_SYSTEMS = bfs cdda ext2 fat iso9660 nfs attribute_overlay
+ write_overlay $(GPL_ONLY)reiserfs ;
#googlefs $(GPL_ONLY)ntfs ;
Modified: haiku/trunk/src/system/kernel/fs/vfs_boot.cpp
===================================================================
--- haiku/trunk/src/system/kernel/fs/vfs_boot.cpp 2009-02-19 22:40:30 UTC (rev 29260)
+++ haiku/trunk/src/system/kernel/fs/vfs_boot.cpp 2009-02-19 23:01:42 UTC (rev 29261)
@@ -444,7 +444,7 @@
const char *fsName = NULL;
if (strcmp(bootPartition->ContentType(), "ISO9660 File System") == 0)
- fsName = "iso9660:overlay";
+ fsName = "iso9660:write_overlay:attribute_overlay";
TRACE(("trying to mount boot partition: %s\n", path.Path()));
gBootDevice = _kern_mount("/boot", path.Path(), fsName, 0, NULL, 0);
From nielx at mail.berlios.de Fri Feb 20 11:20:54 2009
From: nielx at mail.berlios.de (nielx at BerliOS)
Date: Fri, 20 Feb 2009 11:20:54 +0100
Subject: [Haiku-commits] r29262 - haiku/trunk/docs/user/app
Message-ID: <200902201020.n1KAKsNg030253@sheep.berlios.de>
Author: nielx
Date: 2009-02-20 11:20:54 +0100 (Fri, 20 Feb 2009)
New Revision: 29262
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29262&view=rev
Modified:
haiku/trunk/docs/user/app/_app_intro.dox
Log:
Rewording by Tim Howe with some suggestions by Bob Colwell. Thanks guys.
Modified: haiku/trunk/docs/user/app/_app_intro.dox
===================================================================
--- haiku/trunk/docs/user/app/_app_intro.dox 2009-02-19 23:01:42 UTC (rev 29261)
+++ haiku/trunk/docs/user/app/_app_intro.dox 2009-02-20 10:20:54 UTC (rev 29262)
@@ -10,16 +10,17 @@
/*!
\page app_intro Introduction to the Application Kit.
- The Application Kit is a kit you will have to get to know in case you
- want to effectively write Haiku applications with a GUI. The application
- kit does exactly as the name might inform you: it is the basis for Haiku
- applications. It is advised to read through this document, and the
- documents referenced before going to any other part of the API.
+ The Application Kit should be your starting point if you want to write
+ native Haiku applications with a GUI. The application kit does
+ exactly as its name suggests; it is the basis for Haiku applications. You
+ should read through this document and the documents referenced here before
+ moving on to any other part of the API.
- We can divide the classes in the application kit up in two categories. The
- biggest part of the classes are in the 'messaging' classes. Have a look at
- the \link app_messaging Introduction to Messaging \endlink for more
- information. The following classes are part of it:
+ The Application Kit classes can be divided into two groups: the "messaging"
+ classes and the "system interaction" classes. The larger group contains
+ the messaging classes. Have a look at the \link app_messaging
+ Introduction to Messaging \endlink for more information.
+ The following classes are messaging classes:
- BHandler
- BInvoker
- BLooper
@@ -29,13 +30,13 @@
- BMessageRunner
- BMessenger
- The second category is the 'system interaction' category. These classes
- provides hooks for you application to interact with the rest of the system.
+ The second group is the system interaction classes. These classes
+ provide hooks for your application to interact with the rest of the system.
The most important class is BApplication. This is a list of all the
- classes:
+ system interaction classes:
- BApplication
- BClipboard
- BCursor
- BPropertyInfo
- BRoster
-*/
\ No newline at end of file
+*/
From humdingerb at googlemail.com Fri Feb 20 16:27:04 2009
From: humdingerb at googlemail.com (Humdinger)
Date: Fri, 20 Feb 2009 16:27:04 +0100
Subject: [Haiku-commits] r29252 - in haiku/trunk/docs/welcome: . en
In-Reply-To: <200902192028.n1JKShxx021160@sheep.berlios.de>
References: <200902192028.n1JKShxx021160@sheep.berlios.de>
Message-ID: <499ECBC8.2030103@googlemail.com>
mmu_man at BerliOS wrote:
> Log: Test setting mime type property to text/html. It should help previewing the html
> from trac or at least the normal svnweb as I tested elsewhere.
How do you set a mime type (if I add a new page) and will I have to do something special
if I commit an update to an existing page?
I'll soon have to commit an update to every page as I plan to use more CSS styles and the
nearing migration to the (translation) website lends itself to this change. I wouldn't
want to undo your mime setting...
Regards,
Humdinger
--
--=-=--=-=--=-=--=-=--=-=--=-=--=-=--=-=--=-=--=-
Deutsche Haiku News @ http://www.haiku-gazette.de
From mmlr at mlotz.ch Fri Feb 20 17:25:53 2009
From: mmlr at mlotz.ch (Michael Lotz)
Date: Fri, 20 Feb 2009 17:25:53
Subject: [Haiku-commits]
=?windows-1252?q?r29249_-_haiku/trunk/src/add-ons?=
=?windows-1252?q?/kernel/file=5Fsystems/overlay?=
In-Reply-To: <499DE4CF.2060009@pinc-software.de>
Message-ID: <1105911235-BeMail@haiku>
> Michael Lotz wrote:
> > > also, this seems to make CDs writable with isvolume I was told...
> > >
> > It obviously does, yes. It's intended for the live CD mode later on
> > .
> > Determining whether or not to start the installer should later be
> > done
> > based on the persistance of the storage instead of read-only.
>
> Actually, the persistance flag in BeOS is pretty much misused (or
> understood in a different way one would, intuitively): IIRC Tracker
> ignores all file systems that aren't persistent to hide them from the
> user (like /dev, and /pipe).
Yes, I realized that after trying that flag. Though I'd classify that
as fixable and certainly having a non-persistent volume declared as
such is the right thing to do.
> Also, if there is HD installed, the layer could actually store the
> data
> there (maybe when configured like this).
That should be relatively easily doable, yes.
> Not sure if this is a good idea, but the Bootscript could also launch
> into a special live/install environment when the boot device is
> removable. That would include USB sticks as well.
I'd very much like to see this. Because right now (well, when the write
_overlay is finished) you could use a CD as a live CD automatically,
but the user would need to know that he needs to use the ctrl-alt-delete
trick and restart the desktop. This is not very user friendly and could
so easily just be added as a question popup to the boot process where
you could select whether to run the installer or just launch into a
normal desktop.
Regards
Michael
From revol at free.fr Fri Feb 20 17:57:05 2009
From: revol at free.fr (=?utf-8?q?Fran=C3=A7ois?= Revol)
Date: Fri, 20 Feb 2009 17:57:05 +0100 CET
Subject: [Haiku-commits] r29252 - in haiku/trunk/docs/welcome: . en
In-Reply-To: <499ECBC8.2030103@googlemail.com>
Message-ID: <12343323256-BeMail@laptop>
> mmu_man at BerliOS wrote:
> > Log: Test setting mime type property to text/html. It should help
> > previewing the html
> > from trac or at least the normal svnweb as I tested elsewhere.
>
> How do you set a mime type (if I add a new page) and will I have to
> do something special
> if I commit an update to an existing page?
> I'll soon have to commit an update to every page as I plan to use
> more CSS
> styles and the
> nearing migration to the (translation) website lends itself to this
> change.
> I wouldn't
> want to undo your mime setting...
For the CSS something like:
svn propset svn:mime-type text/css docs/Haiku-doc.css
For the html:
svn propset svn:mime-type text/html docs/welcome/welcome.html
You can recurse with
find docs/userguide/ -name '*.htm*' -a -not -path '*.svn*' -exec svn
propset svn:mime-type text/html {} \;
Fran?ois.
From humdingerb at googlemail.com Fri Feb 20 18:19:16 2009
From: humdingerb at googlemail.com (Humdinger)
Date: Fri, 20 Feb 2009 18:19:16 +0100
Subject: [Haiku-commits] r29252 - in haiku/trunk/docs/welcome: . en
In-Reply-To: <12343323256-BeMail@laptop>
References: <12343323256-BeMail@laptop>
Message-ID: <499EE614.8090400@googlemail.com>
Fran?ois Revol wrote:
> You can recurse with
>
> find docs/userguide/ -name '*.htm*' -a -not -path '*.svn*' -exec svn
> propset svn:mime-type text/html {} \;
Easy as that... :)
Thanks Fran?ois.
Regards,
Humdinger
--
--=-=--=-=--=-=--=-=--=-=--=-=--=-=--=-=--=-=--=-
Deutsche Haiku News @ http://www.haiku-gazette.de
From oruizdorantes at mail.berlios.de Fri Feb 20 18:32:49 2009
From: oruizdorantes at mail.berlios.de (oruizdorantes at BerliOS)
Date: Fri, 20 Feb 2009 18:32:49 +0100
Subject: [Haiku-commits] r29263 - haiku/trunk/src/preferences/bluetooth
Message-ID: <200902201732.n1KHWntZ015181@sheep.berlios.de>
Author: oruizdorantes
Date: 2009-02-20 18:32:48 +0100 (Fri, 20 Feb 2009)
New Revision: 29263
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29263&view=rev
Modified:
haiku/trunk/src/preferences/bluetooth/BluetoothMain.cpp
haiku/trunk/src/preferences/bluetooth/BluetoothSettingsView.cpp
haiku/trunk/src/preferences/bluetooth/BluetoothWindow.cpp
haiku/trunk/src/preferences/bluetooth/InquiryPanel.cpp
haiku/trunk/src/preferences/bluetooth/InquiryPanel.h
haiku/trunk/src/preferences/bluetooth/RemoteDevicesView.cpp
haiku/trunk/src/preferences/bluetooth/defs.h
Log:
Implement functionality to the InquiryPanel
Modified: haiku/trunk/src/preferences/bluetooth/BluetoothMain.cpp
===================================================================
--- haiku/trunk/src/preferences/bluetooth/BluetoothMain.cpp 2009-02-20 10:20:54 UTC (rev 29262)
+++ haiku/trunk/src/preferences/bluetooth/BluetoothMain.cpp 2009-02-20 17:32:48 UTC (rev 29263)
@@ -10,6 +10,8 @@
#include "BluetoothWindow.h"
#include "defs.h"
+
+
BluetoothApplication::BluetoothApplication(void)
: BApplication(BLUETOOTH_APP_SIGNATURE)
{
Modified: haiku/trunk/src/preferences/bluetooth/BluetoothSettingsView.cpp
===================================================================
--- haiku/trunk/src/preferences/bluetooth/BluetoothSettingsView.cpp 2009-02-20 10:20:54 UTC (rev 29262)
+++ haiku/trunk/src/preferences/bluetooth/BluetoothSettingsView.cpp 2009-02-20 17:32:48 UTC (rev 29263)
@@ -21,6 +21,7 @@
#include
#include "ExtendedLocalDeviceView.h"
+#include "defs.h"
#include "BluetoothWindow.h"
static const int32 kMsgSetAntialiasing = 'anti';
@@ -119,35 +120,13 @@
BluetoothSettingsView::MessageReceived(BMessage *msg)
{
switch (msg->what) {
- case kMsgSetAntialiasing:
- {
-/* bool subpixelAntialiasing;
- if (msg->FindBool("antialiasing", &subpixelAntialiasing) != B_OK
- || subpixelAntialiasing == fCurrentSubpixelAntialiasing)
- break;
- fCurrentSubpixelAntialiasing = subpixelAntialiasing;
- fAverageWeightControl->SetEnabled(fCurrentSubpixelAntialiasing);
-
- Window()->PostMessage(kMsgUpdate);
-*/ break;
- }
- case kMsgSetHinting:
- {
-/* bool hinting;
- if (msg->FindBool("hinting", &hinting) != B_OK
- || hinting == fCurrentHinting)
- break;
- fCurrentHinting = hinting;
-
- Window()->PostMessage(kMsgUpdate);
-*/ break;
- }
case kMsgLocalSwitched:
{
LocalDevice* lDevice;
if (msg->FindPointer("LocalDevice", (void**) &lDevice) == B_OK) {
// Device integrity should be rechecked
- fExtDeviceView->SetLocalDevice(lDevice);
+ fExtDeviceView->SetLocalDevice(lDevice);
+ ActiveLocalDevice = lDevice;
}
break;
}
Modified: haiku/trunk/src/preferences/bluetooth/BluetoothWindow.cpp
===================================================================
--- haiku/trunk/src/preferences/bluetooth/BluetoothWindow.cpp 2009-02-20 10:20:54 UTC (rev 29262)
+++ haiku/trunk/src/preferences/bluetooth/BluetoothWindow.cpp 2009-02-20 17:32:48 UTC (rev 29263)
@@ -11,10 +11,9 @@
#include
#include
-
+#include
#include "RemoteDevicesView.h"
-//#include "ConnChanView.h"
#include "defs.h"
static const uint32 kMsgSetDefaults = 'dflt';
@@ -24,7 +23,9 @@
static const uint32 kMsgStopServices = 'StST';
static const uint32 kMsgShowDebug = 'ShDG';
+LocalDevice* ActiveLocalDevice = NULL;
+
BluetoothWindow::BluetoothWindow(BRect frame)
: BWindow(frame, "Bluetooth", B_TITLED_WINDOW,
B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS,
Modified: haiku/trunk/src/preferences/bluetooth/InquiryPanel.cpp
===================================================================
--- haiku/trunk/src/preferences/bluetooth/InquiryPanel.cpp 2009-02-20 10:20:54 UTC (rev 29262)
+++ haiku/trunk/src/preferences/bluetooth/InquiryPanel.cpp 2009-02-20 17:32:48 UTC (rev 29263)
@@ -10,57 +10,225 @@
#include
#include
#include
+#include
+#include
+#include
-#include
-#include "defs.h"
+#include
+#include
+#include
+#include
-static const uint32 kMsgUpdate = 'dflt';
-static const uint32 kMsgRevert = 'rvrt';
+#include "InquiryPanel.h"
-static const uint32 kMsgStartServices = 'SrSR';
-static const uint32 kMsgStopServices = 'StST';
+// private funcionaility provided by kit
+extern uint8 GetInquiryTime();
+
+static const uint32 kMsgStart = 'InSt';
+static const uint32 kMsgFinish = 'InFn';
static const uint32 kMsgShowDebug = 'ShDG';
+static const uint32 kMsgInquiry = 'iQbt';
+static const uint32 kMsgAddListDevice = 'aDdv';
-InquiryPanel::InquiryPanel(BRect frame)
- : BWindow(frame, "Bluetooth", B_TITLED_WINDOW,
- B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS,
- B_ALL_WORKSPACES)
+static const uint32 kMsgAddToRemoteList = 'aDdL';
+static const uint32 kMsgSecond = 'sCMs';
+
+// TODO: Implement a BluetoothDeviceListItem class, this one is stolen from somewhere .....
+class RangeItem : public BListItem
{
+ public:
+ RangeItem(uint32 lowAddress, uint32 highAddress, const char* name);
+ ~RangeItem();
+ virtual void DrawItem(BView *, BRect, bool = false);
+ static int Compare(const void *firstArg, const void *secondArg);
+ private:
+ char* fName;
+ uint32 fLowAddress, fHighAddress;
+};
+
+RangeItem::RangeItem(uint32 lowAddress, uint32 highAddress, const char* name)
+ : BListItem(),
+ fLowAddress(lowAddress),
+ fHighAddress(highAddress)
+{
+ fName = strdup(name);
+}
+
+RangeItem::~RangeItem()
+{
+ delete fName;
+}
+
+/***********************************************************
+ * DrawItem
+ ***********************************************************/
+void
+RangeItem::DrawItem(BView *owner, BRect itemRect, bool complete)
+{
+ rgb_color kBlack = { 0,0,0,0 };
+ rgb_color kHighlight = { 156,154,156,0 };
+
+ if (IsSelected() || complete) {
+ rgb_color color;
+ if (IsSelected())
+ color = kHighlight;
+ else
+ color = owner->ViewColor();
+
+ owner->SetHighColor(color);
+ owner->SetLowColor(color);
+ owner->FillRect(itemRect);
+ owner->SetHighColor(kBlack);
+
+ } else {
+ owner->SetLowColor(owner->ViewColor());
+ }
+
+ BFont font = be_plain_font;
+ font_height finfo;
+ font.GetHeight(&finfo);
+
+ BPoint point = BPoint(itemRect.left + 17, itemRect.bottom - finfo.descent + 1);
+ owner->SetFont(be_fixed_font);
+ owner->SetHighColor(kBlack);
+ owner->MovePenTo(point);
+
+/* if (fLowAddress >= 0) {
+ char string[255];
+ sprintf(string, "0x%04lx - 0x%04lx", fLowAddress, fHighAddress);
+ owner->DrawString(string);
+ }
+ point += BPoint(174, 0);*/
+ owner->SetFont(be_plain_font);
+ owner->MovePenTo(point);
+ owner->DrawString(fName);
+}
+
+int
+RangeItem::Compare(const void *firstArg, const void *secondArg)
+{
+ const RangeItem *item1 = *static_cast(firstArg);
+ const RangeItem *item2 = *static_cast(secondArg);
+
+ if (item1->fLowAddress < item2->fLowAddress) {
+ return -1;
+ } else if (item1->fLowAddress > item2->fLowAddress) {
+ return 1;
+ } else
+ return 0;
+
+}
+
+
+
+class PanelDiscoveryListener : public DiscoveryListener {
+
+public:
+
+ PanelDiscoveryListener(InquiryPanel* iPanel) : DiscoveryListener() , fInquiryPanel(iPanel)
+ {
+
+ }
+
+
+ void
+ DeviceDiscovered(RemoteDevice* btDevice, DeviceClass cod)
+ {
+ BMessage* message = new BMessage(kMsgAddListDevice);
+ message->AddPointer("remote", btDevice);
+
+ fInquiryPanel->PostMessage(message);
+ }
+
+
+ void
+ InquiryCompleted(int discType)
+ {
+ BMessage* message = new BMessage(kMsgFinish);
+ fInquiryPanel->PostMessage(message);
+ }
+
+
+ void
+ InquiryStarted(status_t status)
+ {
+ BMessage* message = new BMessage(kMsgStart);
+ fInquiryPanel->PostMessage(message);
+ }
+
+private:
+ InquiryPanel* fInquiryPanel;
+
+};
+
+
+InquiryPanel::InquiryPanel(BRect frame, LocalDevice* lDevice)
+ : BWindow(frame, "Bluetooth", B_FLOATING_WINDOW,
+ B_NOT_ZOOMABLE | B_NOT_RESIZABLE | B_AUTO_UPDATE_SIZE_LIMITS,
+ B_ALL_WORKSPACES ), fScanning(false)
+ , fLocalDevice(lDevice)
+{
BRect iDontCare(0,0,0,0);
- BRect iDontCareToo(0,0,5,5);
SetLayout(new BGroupLayout(B_HORIZONTAL));
- fScanProgress = new BStatusBar(iDontCare, "status", "Scanning", "Scan time");
- fScanProgress->SetMaxValue(52);
+ fScanProgress = new BStatusBar(iDontCare, "status", "Scanning progress", "");
+ activeColor = fScanProgress->BarColor();
+ if (fLocalDevice == NULL)
+ fLocalDevice = LocalDevice::GetLocalDevice();
+
fMessage = new BTextView(iDontCare, "description",
- iDontCare2, B_FOLLOW_LEFT_RIGHT,
- B_WILL_DRAW | B_FRAME_EVENTS);
+ iDontCare, B_FOLLOW_NONE, B_WILL_DRAW | B_SUPPORTS_LAYOUT);
fMessage->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
fMessage->SetLowColor(fMessage->ViewColor());
fMessage->MakeEditable(false);
- fMessage->SetText("asdfdasas asdfas asdfasd a dfad asdf dfasdf a");
-
+ fMessage->MakeSelectable(false);
+
fInquiryButton = new BButton("Inquiry", "Inquiry",
- new BMessage(kMsgRevert), B_WILL_DRAW);
+ new BMessage(kMsgInquiry), B_WILL_DRAW);
- fAddButton = new BButton("ad", "Add device to list",
- new BMessage(kMsgRevert), B_WILL_DRAW);
+ fAddButton = new BButton("add", "Add device to list",
+ new BMessage(kMsgAddToRemoteList), B_WILL_DRAW);
+ fAddButton->SetEnabled(false);
+ fRemoteList = new BListView("AttributeList", B_SINGLE_SELECTION_LIST);
- AddChild(BGroupLayoutBuilder(B_VERTICAL, 0)
+
+ if (fLocalDevice != NULL) {
+ fMessage->SetText("Check that the bluetooth capabilities of your remote device"
+ " are activated. Press Inquiry to start scanning");
+ fInquiryButton->SetEnabled(true);
+ fDiscoveryAgent = fLocalDevice->GetDiscoveryAgent();
+ fDiscoveryListener = new PanelDiscoveryListener(this);
+
+
+ SetTitle((const char*)(fLocalDevice->GetFriendlyName().String()));
+
+
+ } else {
+ fMessage->SetText("There has not been found any bluetooth LocalDevice device registered"
+ " on the system");
+ fInquiryButton->SetEnabled(false);
+ }
+
+ fRunner = new BMessageRunner(BMessenger(this), new BMessage(kMsgSecond), 1000000L, -1);
+
+
+ AddChild(BGroupLayoutBuilder(B_VERTICAL, 10)
+ .Add(fMessage)
+ .Add(BSpaceLayoutItem::CreateVerticalStrut(5))
.Add(fScanProgress)
.Add(BSpaceLayoutItem::CreateVerticalStrut(5))
- .Add(fMessage)
+ .Add(fRemoteList)
.Add(BSpaceLayoutItem::CreateVerticalStrut(5))
- .Add(BGroupLayoutBuilder(B_HORIZONTAL, 0)
+ .Add(BGroupLayoutBuilder(B_HORIZONTAL, 10)
.Add(fAddButton)
.AddGlue()
.Add(fInquiryButton)
)
- .SetInsets(5, 5, 5, 5)
+ .SetInsets(15, 25, 15, 15)
);
}
@@ -68,34 +236,90 @@
void
InquiryPanel::MessageReceived(BMessage *message)
{
+ static float timer = 0; // expected time of the inquiry process
+ static float scanningTime = 0;
+
switch (message->what) {
- case kMsgUpdate:
-/* fDefaultsButton->SetEnabled(fRemoteDevices->IsDefaultable()
- || fAntialiasingSettings->IsDefaultable());
+ case kMsgInquiry:
+
+ fDiscoveryAgent->StartInquiry(BT_GIAC, fDiscoveryListener, GetInquiryTime());
+
+ timer = BT_BASE_INQUIRY_TIME * GetInquiryTime();
+ fScanProgress->SetMaxValue(timer); // does it works as expected?
- fRevertButton->SetEnabled(true);*/
- break;
-/* case kMsgSetDefaults:
- fColorsView -> MessageReceived(new BMessage(DEFAULT_SETTINGS));
- fAntialiasingSettings->SetDefaults();
- fDefaultsButton->SetEnabled(false);
- fRevertButton->SetEnabled(true);
- break;
+ break;
+
+ case kMsgAddListDevice:
+ {
+ RemoteDevice* rDevice;
+
+ message->FindPointer("remote", (void **)&rDevice);
+
+ fRemoteList->AddItem(new RangeItem(0,1,bdaddrUtils::ToString(rDevice->GetBluetoothAddress())));
+ }
+ break;
- case kMsgRevert:
- fColorsView -> MessageReceived(new BMessage(REVERT_SETTINGS));
- fAntialiasingSettings->Revert();
- fDefaultsButton->SetEnabled(fColorsView->IsDefaultable()
- || fAntialiasingSettings->IsDefaultable());
- fRevertButton->SetEnabled(false);
- break;
-*/ default:
+ case kMsgStart:
+ fRemoteList->MakeEmpty();
+ fScanProgress->Reset();
+
+ scanningTime = 0;
+ fScanning = true;
+ UpdateUIStatus();
+
+ break;
+
+ case kMsgFinish:
+
+ fScanning = false;
+ UpdateUIStatus();
+
+ break;
+
+ case kMsgSecond:
+ {
+ if (fScanning) {
+ BString elapsedTime = "Remaining ";
+
+ fScanProgress->SetTo(scanningTime*100/timer); // TODO should not be needed if SetMaxValue works...
+
+ elapsedTime << (int)(timer - scanningTime) << " seconds";
+ fScanProgress->SetTrailingText(elapsedTime.String());
+
+ scanningTime = scanningTime + 1;
+ }
+
+ if (fRemoteList->CurrentSelection() < 0)
+ fAddButton->SetEnabled(false);
+ else
+ fAddButton->SetEnabled(true);
+ }
+ break;
+
+ default:
BWindow::MessageReceived(message);
break;
}
}
+void
+InquiryPanel::UpdateUIStatus(void)
+{
+ if (fScanning) {
+ fAddButton->SetEnabled(false);
+ fInquiryButton->SetEnabled(false);
+ fScanProgress->SetBarColor(activeColor);
+
+ } else {
+ fInquiryButton->SetEnabled(true);
+ fScanProgress->SetBarColor(ui_color(B_PANEL_BACKGROUND_COLOR));
+ fScanProgress->SetTo(100);
+ fScanProgress->SetText("Scan completed");
+ }
+}
+
+
bool
InquiryPanel::QuitRequested(void)
{
Modified: haiku/trunk/src/preferences/bluetooth/InquiryPanel.h
===================================================================
--- haiku/trunk/src/preferences/bluetooth/InquiryPanel.h 2009-02-20 10:20:54 UTC (rev 29262)
+++ haiku/trunk/src/preferences/bluetooth/InquiryPanel.h 2009-02-20 17:32:48 UTC (rev 29263)
@@ -14,20 +14,35 @@
class BStatusBar;
class BButton;
class BTextView;
+class BListView;
+class LocalDevice;
+class DiscoveryAgent;
+class DiscoveryListener;
class InquiryPanel : public BWindow
{
public:
- InquiryPanel(BRect frame);
+ InquiryPanel(BRect frame, LocalDevice* lDevice = NULL);
bool QuitRequested(void);
void MessageReceived(BMessage *message);
private:
- BStatusBar* fScanProgress;
- BButton* fAddButton;
- BButton* fInquiryButton;
- BTextView* fMessage;
+ BStatusBar* fScanProgress;
+ BButton* fAddButton;
+ BButton* fInquiryButton;
+ BTextView* fMessage;
+ BListView* fRemoteList;
+ BMessageRunner* fRunner;
+
+ bool fScanning;
+ LocalDevice* fLocalDevice;
+ DiscoveryAgent* fDiscoveryAgent;
+ DiscoveryListener* fDiscoveryListener;
+
+ void UpdateUIStatus(void);
+
+ rgb_color activeColor;
};
#endif
Modified: haiku/trunk/src/preferences/bluetooth/RemoteDevicesView.cpp
===================================================================
--- haiku/trunk/src/preferences/bluetooth/RemoteDevicesView.cpp 2009-02-20 10:20:54 UTC (rev 29262)
+++ haiku/trunk/src/preferences/bluetooth/RemoteDevicesView.cpp 2009-02-20 17:32:48 UTC (rev 29263)
@@ -2,7 +2,7 @@
* Copyright 2008-09, Oliver Ruiz Dorantes,
* All rights reserved. Distributed under the terms of the MIT License.
*/
-#include "RemoteDevicesView.h"
+#include
#include
#include
@@ -13,17 +13,16 @@
#include
#include
-#include
+#include "defs.h"
#include "InquiryPanel.h"
#include "BluetoothWindow.h"
-#include "defs.h"
+#include "RemoteDevicesView.h"
+
static const uint32 kMsgAddDevices = 'ddDv';
-
-
RemoteDevicesView::RemoteDevicesView(const char *name, uint32 flags)
: BView(name, flags)
{
@@ -75,7 +74,7 @@
.SetInsets(5, 5, 5, 100)
);
- fAttrList->SetSelectionMessage(new BMessage(ATTRIBUTE_CHOSEN));
+ fAttrList->SetSelectionMessage(NULL);
}
RemoteDevicesView::~RemoteDevicesView(void)
@@ -108,7 +107,7 @@
switch(msg->what) {
case kMsgAddDevices:
{
- InquiryPanel* iPanel = new InquiryPanel(BRect(0,0,50,50));
+ InquiryPanel* iPanel = new InquiryPanel(BRect(100,100,400,400), ActiveLocalDevice);
iPanel->Show();
}
break;
Modified: haiku/trunk/src/preferences/bluetooth/defs.h
===================================================================
--- haiku/trunk/src/preferences/bluetooth/defs.h 2009-02-20 10:20:54 UTC (rev 29262)
+++ haiku/trunk/src/preferences/bluetooth/defs.h 2009-02-20 17:32:48 UTC (rev 29263)
@@ -1,14 +1,7 @@
#ifndef DEFS_H_
#define DEFS_H_
-// If these paths are changed, ensure that they all end in a '/' character
-/*
-#define SETTINGS_DIR "/boot/home/config/settings/app_server/"
-#define COLOR_SET_DIR "/boot/home/config/settings/color_sets/"
-#define CURSOR_SET_DIR "/boot/home/config/settings/cursor_sets/"
-#define DECORATORS_DIR "/boot/home/config/add-ons/decorators/"
-#define COLOR_SETTINGS_NAME "system_colors"
-*/
+#include
#define BLUETOOTH_APP_SIGNATURE "application/x-vnd.haiku-BluetoothPrefs"
@@ -33,4 +26,6 @@
const uint32 kBorderSpace = 10;
const uint32 kItemSpace = 7;
+extern LocalDevice* ActiveLocalDevice;
+
#endif
From oruizdorantes at mail.berlios.de Fri Feb 20 19:25:50 2009
From: oruizdorantes at mail.berlios.de (oruizdorantes at BerliOS)
Date: Fri, 20 Feb 2009 19:25:50 +0100
Subject: [Haiku-commits] r29264 - in haiku/trunk: headers/os/bluetooth
src/kits/bluetooth
Message-ID: <200902201825.n1KIPooY001965@sheep.berlios.de>
Author: oruizdorantes
Date: 2009-02-20 19:25:41 +0100 (Fri, 20 Feb 2009)
New Revision: 29264
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29264&view=rev
Modified:
haiku/trunk/headers/os/bluetooth/DiscoveryAgent.h
haiku/trunk/headers/os/bluetooth/DiscoveryListener.h
haiku/trunk/src/kits/bluetooth/DiscoveryAgent.cpp
haiku/trunk/src/kits/bluetooth/KitSupport.cpp
haiku/trunk/src/kits/bluetooth/KitSupport.h
Log:
Add prototypes to keep/use global Inquiry time
Modified: haiku/trunk/headers/os/bluetooth/DiscoveryAgent.h
===================================================================
--- haiku/trunk/headers/os/bluetooth/DiscoveryAgent.h 2009-02-20 17:32:48 UTC (rev 29263)
+++ haiku/trunk/headers/os/bluetooth/DiscoveryAgent.h 2009-02-20 18:25:41 UTC (rev 29264)
@@ -7,6 +7,7 @@
#include
#include
+#include
#define BT_CACHED 0x00
@@ -17,13 +18,15 @@
#define BT_LIAC 0x9E8B00
#define BT_MAX_RESPONSES (32)
+
#define BT_BASE_INQUIRY_TIME (1.28)
-#define BT_DEFAULT_INQUIRY_TIME (0x15*BT_BASE_INQUIRY_TIME) /* TODO: REVIEW SPECS! */
+#define BT_DEFAULT_INQUIRY_TIME (0x0A)
+#define BT_MIN_INQUIRY_TIME (0x01) // 1.18 secs
+#define BT_MAX_INQUIRY_TIME (0x30) // 61.44 secs
namespace Bluetooth {
-class DiscoveryListener;
-class RemoteDevice;
+class LocalDevice;
class DiscoveryAgent {
Modified: haiku/trunk/headers/os/bluetooth/DiscoveryListener.h
===================================================================
--- haiku/trunk/headers/os/bluetooth/DiscoveryListener.h 2009-02-20 17:32:48 UTC (rev 29263)
+++ haiku/trunk/headers/os/bluetooth/DiscoveryListener.h 2009-02-20 18:25:41 UTC (rev 29264)
@@ -8,6 +8,7 @@
#include
#include
+#include
#include
@@ -20,8 +21,6 @@
typedef BObjectList RemoteDevicesList;
-class RemoteDevice;
-class DeviceClass;
class LocalDevice;
class DiscoveryListener : public BLooper {
Modified: haiku/trunk/src/kits/bluetooth/DiscoveryAgent.cpp
===================================================================
--- haiku/trunk/src/kits/bluetooth/DiscoveryAgent.cpp 2009-02-20 17:32:48 UTC (rev 29263)
+++ haiku/trunk/src/kits/bluetooth/DiscoveryAgent.cpp 2009-02-20 18:25:41 UTC (rev 29264)
@@ -36,7 +36,7 @@
status_t
DiscoveryAgent::StartInquiry(int accessCode, DiscoveryListener* listener)
{
- return StartInquiry(accessCode, listener, BT_DEFAULT_INQUIRY_TIME);
+ return StartInquiry(accessCode, listener, GetInquiryTime());
}
Modified: haiku/trunk/src/kits/bluetooth/KitSupport.cpp
===================================================================
--- haiku/trunk/src/kits/bluetooth/KitSupport.cpp 2009-02-20 17:32:48 UTC (rev 29263)
+++ haiku/trunk/src/kits/bluetooth/KitSupport.cpp 2009-02-20 18:25:41 UTC (rev 29264)
@@ -4,16 +4,13 @@
* All rights reserved. Distributed under the terms of the MIT License.
*
*/
+#include
+#include
-
-#include
#include
#include "KitSupport.h"
-
-
-
BMessenger* _RetrieveBluetoothMessenger(void)
{
// Fix/review: leaking memory here
@@ -24,3 +21,16 @@
else
return fMessenger;
}
+
+
+uint8 GetInquiryTime()
+{
+ return BT_DEFAULT_INQUIRY_TIME;
+}
+
+
+void SetInquiryTime(uint8 time)
+{
+ ((void)(time));
+
+}
Modified: haiku/trunk/src/kits/bluetooth/KitSupport.h
===================================================================
--- haiku/trunk/src/kits/bluetooth/KitSupport.h 2009-02-20 17:32:48 UTC (rev 29263)
+++ haiku/trunk/src/kits/bluetooth/KitSupport.h 2009-02-20 18:25:41 UTC (rev 29264)
@@ -5,3 +5,6 @@
#include
BMessenger* _RetrieveBluetoothMessenger(void);
+
+uint8 GetInquiryTime();
+void SetInquiryTime(uint8 time);
From mmu_man at mail.berlios.de Fri Feb 20 22:10:13 2009
From: mmu_man at mail.berlios.de (mmu_man at BerliOS)
Date: Fri, 20 Feb 2009 22:10:13 +0100
Subject: [Haiku-commits] r29265 - haiku/trunk/build/jam
Message-ID: <200902202110.n1KLADMW022127@sheep.berlios.de>
Author: mmu_man
Date: 2009-02-20 22:10:10 +0100 (Fri, 20 Feb 2009)
New Revision: 29265
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29265&view=rev
Modified:
haiku/trunk/build/jam/OptionalPackages
Log:
Update Firefox to a newer build courtesy mmadia. It's actually named BeZilla this time to avoid the usual trademark vs non official problem.
Modified: haiku/trunk/build/jam/OptionalPackages
===================================================================
--- haiku/trunk/build/jam/OptionalPackages 2009-02-20 18:25:41 UTC (rev 29264)
+++ haiku/trunk/build/jam/OptionalPackages 2009-02-20 21:10:10 UTC (rev 29265)
@@ -280,12 +280,12 @@
} else if $(HAIKU_GCC_VERSION[1]) >= 4 && $(isHybridBuild) = 0 {
Echo "No optional package Firefox available for gcc4" ;
} else {
- InstallOptionalHaikuImagePackage Firefox-2.0.0.17
- : http://www.yellowbites.com/downloads/Firefox-2.0.0.17.zip
+ InstallOptionalHaikuImagePackage BeZillaBrowser-gcc2-20090218
+ : http://bezilla.beuser.de/builds/BeZillaBrowser-gcc2-20090218.zip
: apps
;
AddSymlinkToHaikuImage home config be Applications
- : /boot/apps/Firefox/Firefox ;
+ : /boot/apps/BeZillaBrowser/BeZillaBrowser ;
}
}
From axeld at pinc-software.de Fri Feb 20 23:26:52 2009
From: axeld at pinc-software.de (=?ISO-8859-1?Q?Axel_D=F6rfler?=)
Date: Fri, 20 Feb 2009 23:26:52 +0100
Subject: [Haiku-commits] r29252 - in haiku/trunk/docs/welcome: . en
In-Reply-To: <499ECBC8.2030103@googlemail.com>
References: <200902192028.n1JKShxx021160@sheep.berlios.de>
<499ECBC8.2030103@googlemail.com>
Message-ID: <499F2E2C.3040202@pinc-software.de>
Humdinger wrote:
> I'll soon have to commit an update to every page as I plan to use more CSS styles and the
> nearing migration to the (translation) website lends itself to this change. I wouldn't
> want to undo your mime setting...
You don't need to mind about that; unless you replace the file (ie.
delete it, and add a new one), the properties are preserved.
Bye,
Axel.
From mmu_man at mail.berlios.de Sat Feb 21 00:37:44 2009
From: mmu_man at mail.berlios.de (mmu_man at BerliOS)
Date: Sat, 21 Feb 2009 00:37:44 +0100
Subject: [Haiku-commits] r29266 - haiku/trunk/src/bin
Message-ID: <200902202337.n1KNbitR021969@sheep.berlios.de>
Author: mmu_man
Date: 2009-02-21 00:37:43 +0100 (Sat, 21 Feb 2009)
New Revision: 29266
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29266&view=rev
Modified:
haiku/trunk/src/bin/ps.c
Log:
Patch by Bjoern Herzig, adds -a option, some cleanup.
Modified: haiku/trunk/src/bin/ps.c
===================================================================
--- haiku/trunk/src/bin/ps.c 2009-02-20 21:10:10 UTC (rev 29265)
+++ haiku/trunk/src/bin/ps.c 2009-02-20 23:37:43 UTC (rev 29266)
@@ -5,29 +5,102 @@
* Authors:
* Francois Revol (mmu_man)
* Salvatore Benedetto
+ * Bjoern Herzig (xRaich[o]2x)
*/
#include
+#include
#include
#include
#define SNOOZE_TIME 100000
+char *states[] = {"run", "rdy", "msg", "zzz", "sus", "wait" };
-int
-main(int argc, char **argv)
+void printTeamThreads(team_info *teamInfo, bool printSemaphoreInfo);
+void printTeamInfo(team_info *teamInfo, bool printHeader);
+
+void printTeamInfo(team_info *teamInfo, bool printHeader)
{
+ // Print team info
+ if (printHeader)
+ printf("%-49s %5s %8s %4s %4s\n", "Team", "Id", "#Threads", "Gid", "Uid");
+
+ printf("%-49s %5ld %8ld %4d %4d\n", teamInfo->args, teamInfo->team,
+ teamInfo->thread_count, teamInfo->uid, teamInfo->gid);
+}
+
+void printTeamThreads(team_info *teamInfo, bool printSemaphoreInfo) {
+ char *threadState;
+ uint32 threadCookie = 0;
+ sem_info semaphoreInfo;
+ thread_info threadInfo;
+
+ // Print all info about its threads too
+ while (get_next_thread_info(teamInfo->team, &threadCookie, &threadInfo)
+ >= B_OK) {
+ if (threadInfo.state < B_THREAD_RUNNING
+ || threadInfo.state > B_THREAD_WAITING)
+ // This should never happen
+ threadState = "???";
+ else
+ threadState = states[threadInfo.state - 1];
+
+ printf("%-29s %5ld %8s %4ld %8llu %8llu ",
+ threadInfo.name, threadInfo.thread, threadState,
+ threadInfo.priority, (threadInfo.user_time / 1000),
+ (threadInfo.kernel_time / 1000));
+
+ if (printSemaphoreInfo) {
+ if (threadInfo.state == B_THREAD_WAITING && threadInfo.sem != -1) {
+ status_t status = get_sem_info(threadInfo.sem, &semaphoreInfo);
+ if (status == B_OK)
+ printf("%s(%ld)\n", semaphoreInfo.name, semaphoreInfo.sem);
+ else
+ printf("%s(%ld)\n", strerror(status), threadInfo.sem);
+ } else
+ puts("");
+ }
+ else
+ puts("");
+ }
+}
+
+int main(int argc, char **argv)
+{
team_info teamInfo;
- thread_info threadInfo;
uint32 teamCookie = 0;
- uint32 threadCookie = 0;
- sem_info semaphoreInfo;
- char *threadState;
- char *states[] = {"run", "rdy", "msg", "zzz", "sus", "wait" };
system_info systemInfo;
- bool printSystemInfo = true;
+ bool printSystemInfo = false;
+ bool printThreads = false;
+ bool printHeader = true;
+ bool printSemaphoreInfo = false;
// match this in team name
char *string_to_match;
+
+ int c;
+
+ while ((c = getopt(argc, argv,"ihas")) != EOF) {
+ switch(c) {
+ case 'i':
+ printSystemInfo = true;
+ break;
+ case 'h':
+ printf( "usage: ps [-hais] [team]\n"
+ "-h : show help\n"
+ "-i : show system info\n"
+ "-s : show semaphore info\n"
+ "-a : show threads too (by default only teams are displayed)\n");
+ return 0;
+ break;
+ case 'a':
+ printThreads = true;
+ break;
+ case 's':
+ printSemaphoreInfo = true;
+ break;
+ }
+ }
// TODO: parse command line
// Possible command line options:
@@ -38,11 +111,27 @@
// -a show threads too (by default only teams are displayed)
// -s show semaphore info
// -i show system info
- string_to_match = (argc == 2) ? argv[1] : NULL;
-
- printf("%-50s %4s %8s %4s %4s\n", "Team", "Id", "#Threads", "Gid", "Uid");
- while (get_next_team_info(&teamCookie, &teamInfo) >= B_OK) {
- if (string_to_match) {
+
+ if (argc == 2 && (printSystemInfo||printThreads))
+ string_to_match = NULL;
+ else
+ string_to_match = (argc >= 2) ? argv[argc-1] : NULL;
+
+ if (!string_to_match) {
+ while (get_next_team_info(&teamCookie, &teamInfo) >= B_OK) {
+
+ printTeamInfo(&teamInfo,printHeader);
+ printHeader = false;
+ if (printThreads) {
+ printf("\n%-29s %5s %8s %4s %8s %8s\n", "Thread", "Id", "State","Prio", "UTime", "KTime");
+ printTeamThreads(&teamInfo,printSemaphoreInfo);
+ printf("--------------------------------------------------------------------------\n");
+ printHeader = true;
+ }
+ }
+ }
+ else {
+ while (get_next_team_info(&teamCookie, &teamInfo) >= B_OK) {
char *p;
p = teamInfo.args;
if ((p = strchr(p, ' ')))
@@ -52,41 +141,9 @@
p = teamInfo.args;
if (strstr(p, string_to_match) == NULL)
continue;
- // Print team info
- printf("%-50s %4ld %8ld %4d %4d\n\n", teamInfo.args, teamInfo.team,
- teamInfo.thread_count, teamInfo.uid, teamInfo.gid);
-
- printf("%-30s %4s %8s %4s %8s %8s\n", "Thread", "Id", "State",
- "Prio", "UTime", "KTime");
- // Print all info about its threads too
- while (get_next_thread_info(teamInfo.team, &threadCookie, &threadInfo)
- >= B_OK) {
- if (threadInfo.state < B_THREAD_RUNNING
- || threadInfo.state > B_THREAD_WAITING)
- // This should never happen
- threadState = "???";
- else
- threadState = states[threadInfo.state - 1];
-
- printf("%-30s %4ld %8s %4ld %8llu %8llu ",
- threadInfo.name, threadInfo.thread, threadState,
- threadInfo.priority, (threadInfo.user_time / 1000),
- (threadInfo.kernel_time / 1000));
-
- if (threadInfo.state == B_THREAD_WAITING && threadInfo.sem != -1) {
- status_t status = get_sem_info(threadInfo.sem, &semaphoreInfo);
- if (status == B_OK)
- printf("%s(%ld)\n", semaphoreInfo.name, semaphoreInfo.sem);
- else
- printf("%s(%ld)\n", strerror(status), threadInfo.sem);
- } else
- puts("");
- }
- break;
-
- } else {
- printf("%-50s %4ld %8ld %4d %4d\n", teamInfo.args, teamInfo.team,
- teamInfo.thread_count, teamInfo.uid, teamInfo.gid);
+ printTeamInfo(&teamInfo,true);
+ printf("\n%-29s %5s %8s %4s %8s %8s\n", "Thread", "Id", "State","Prio", "UTime", "KTime");
+ printTeamThreads(&teamInfo,printSemaphoreInfo);
}
}
From umccullough at gmail.com Sat Feb 21 00:43:07 2009
From: umccullough at gmail.com (Urias McCullough)
Date: Fri, 20 Feb 2009 15:43:07 -0800
Subject: [Haiku-commits] r29266 - haiku/trunk/src/bin
In-Reply-To: <200902202337.n1KNbitR021969@sheep.berlios.de>
References: <200902202337.n1KNbitR021969@sheep.berlios.de>
Message-ID: <1e80d8750902201543q2d34581du3b85d33b7274f017@mail.gmail.com>
On Fri, Feb 20, 2009 at 3:37 PM, mmu_man at BerliOS
wrote:
> Author: mmu_man
> Date: 2009-02-21 00:37:43 +0100 (Sat, 21 Feb 2009)
> New Revision: 29266
> ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29266&view=rev
>
> Modified:
> haiku/trunk/src/bin/ps.c
> Log:
> Patch by Bjoern Herzig, adds -a option, some cleanup.
>
> + while ((c = getopt(argc, argv,"ihas")) != EOF) {
> + switch(c) {
> + case 'i':
> + printSystemInfo = true;
> + break;
> + case 'h':
> + printf( "usage: ps [-hais] [team]\n"
> + "-h : show help\n"
> + "-i : show system info\n"
> + "-s : show semaphore info\n"
> + "-a : show threads too (by default only teams are displayed)\n");
> + return 0;
> + break;
> + case 'a':
> + printThreads = true;
> + break;
> + case 's':
> + printSemaphoreInfo = true;
> + break;
> + }
> + }
>
> // TODO: parse command line
> // Possible command line options:
> @@ -38,11 +111,27 @@
> // -a show threads too (by default only teams are displayed)
> // -s show semaphore info
> // -i show system info
Does the TODO go away now?
From revol at free.fr Sat Feb 21 00:48:12 2009
From: revol at free.fr (=?utf-8?q?Fran=C3=A7ois?= Revol)
Date: Sat, 21 Feb 2009 00:48:12 +0100 CET
Subject: [Haiku-commits] r29266 - haiku/trunk/src/bin
In-Reply-To: <1e80d8750902201543q2d34581du3b85d33b7274f017@mail.gmail.com>
Message-ID: <37010043410-BeMail@laptop>
>
> Does the TODO go away now?
I'd suppose so.
Fran?ois.
From mmu_man at mail.berlios.de Sat Feb 21 00:48:24 2009
From: mmu_man at mail.berlios.de (mmu_man at BerliOS)
Date: Sat, 21 Feb 2009 00:48:24 +0100
Subject: [Haiku-commits] r29267 - haiku/trunk/src/bin
Message-ID: <200902202348.n1KNmORD030954@sheep.berlios.de>
Author: mmu_man
Date: 2009-02-21 00:48:20 +0100 (Sat, 21 Feb 2009)
New Revision: 29267
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29267&view=rev
Modified:
haiku/trunk/src/bin/ps.c
Log:
Update TODO
Modified: haiku/trunk/src/bin/ps.c
===================================================================
--- haiku/trunk/src/bin/ps.c 2009-02-20 23:37:43 UTC (rev 29266)
+++ haiku/trunk/src/bin/ps.c 2009-02-20 23:48:20 UTC (rev 29267)
@@ -104,13 +104,7 @@
// TODO: parse command line
// Possible command line options:
- // -h show help
- // ps - by default it only shows all team info
- // ps [team] - shows info about this team with all its threads
// -t pstree like output
- // -a show threads too (by default only teams are displayed)
- // -s show semaphore info
- // -i show system info
if (argc == 2 && (printSystemInfo||printThreads))
string_to_match = NULL;
From mmlr at mail.berlios.de Sat Feb 21 03:35:58 2009
From: mmlr at mail.berlios.de (mmlr at mail.berlios.de)
Date: Sat, 21 Feb 2009 03:35:58 +0100
Subject: [Haiku-commits] r29268 -
haiku/trunk/src/add-ons/kernel/file_systems/layers/write_overlay
Message-ID: <200902210235.n1L2ZwQL024224@sheep.berlios.de>
Author: mmlr
Date: 2009-02-21 03:35:55 +0100 (Sat, 21 Feb 2009)
New Revision: 29268
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29268&view=rev
Modified:
haiku/trunk/src/add-ons/kernel/file_systems/layers/write_overlay/write_overlay.cpp
Log:
* Implemented create/create dir/create symlink and remove/remove dir in the
write_overlay and add the necessary infrastructure for it.
* Fix setting permissions through write stat.
Modified: haiku/trunk/src/add-ons/kernel/file_systems/layers/write_overlay/write_overlay.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/file_systems/layers/write_overlay/write_overlay.cpp 2009-02-20 23:48:20 UTC (rev 29267)
+++ haiku/trunk/src/add-ons/kernel/file_systems/layers/write_overlay/write_overlay.cpp 2009-02-21 02:35:55 UTC (rev 29268)
@@ -36,11 +36,28 @@
namespace write_overlay {
+status_t publish_overlay_vnode(fs_volume *volume, ino_t inodeNumber,
+ void *privateNode, int type);
+
+class OverlayInode;
+
struct open_cookie {
int open_mode;
void * super_cookie;
};
+
+struct open_dir_cookie {
+ uint32 index;
+};
+
+
+struct overlay_dirent {
+ ino_t inode_number;
+ char * name;
+};
+
+
struct write_buffer {
write_buffer * next;
off_t position;
@@ -57,27 +74,38 @@
fs_volume * Volume() { return fVolume; }
fs_volume * SuperVolume() { return fVolume->super_volume; }
+ ino_t BuildInodeNumber() { return fCurrentInodeNumber++; }
+
private:
fs_volume * fVolume;
+ ino_t fCurrentInodeNumber;
};
class OverlayInode {
public:
OverlayInode(OverlayVolume *volume,
- fs_vnode *superVnode, ino_t inodeNumber);
+ fs_vnode *superVnode, ino_t inodeNumber,
+ OverlayInode *parentDir = NULL,
+ mode_t mode = 0);
~OverlayInode();
status_t InitCheck();
+ bool IsVirtual() { return fIsVirtual; }
+
fs_volume * Volume() { return fVolume->Volume(); }
fs_volume * SuperVolume() { return fVolume->SuperVolume(); }
fs_vnode * SuperVnode() { return &fSuperVnode; }
ino_t InodeNumber() { return fInodeNumber; }
+ status_t Lookup(const char *name, ino_t *inodeNumber);
+
status_t ReadStat(struct stat *stat);
status_t WriteStat(const struct stat *stat, uint32 statMask);
+ status_t Create(const char *name, int openMode, int perms,
+ void **cookie, ino_t *newInodeNumber);
status_t Open(int openMode, void **cookie);
status_t Close(void *cookie);
status_t FreeCookie(void *cookie);
@@ -86,14 +114,41 @@
status_t Write(void *cookie, off_t position,
const void *buffer, size_t *length);
+ status_t CreateDir(const char *name,
+ int perms, ino_t *newInodeNumber);
+ status_t RemoveDir(const char *name);
+ status_t OpenDir(void **cookie);
+ status_t CloseDir(void *cookie);
+ status_t FreeDirCookie(void *cookie);
+ status_t ReadDir(void *cookie, struct dirent *buffer,
+ size_t bufferSize, uint32 *num);
+ status_t RewindDir(void *cookie);
+
+ status_t CreateSymlink(const char *name, const char *path,
+ int mode);
+ status_t ReadSymlink(char *buffer, size_t *bufferSize);
+
+ status_t AddEntry(overlay_dirent *entry);
+ status_t RemoveEntry(const char *name,
+ overlay_dirent **entry);
+
private:
+ status_t _PopulateDirents();
+ status_t _CreateCommon(const char *name, int type, int perms,
+ ino_t *newInodeNumber, OverlayInode **node);
+
OverlayVolume * fVolume;
+ OverlayInode * fParentDir;
fs_vnode fSuperVnode;
ino_t fInodeNumber;
write_buffer * fWriteBuffers;
off_t fOriginalNodeLength;
+ overlay_dirent ** fDirents;
+ uint32 fDirentCount;
struct stat fStat;
bool fHasStat;
+ bool fHasDirents;
+ bool fIsVirtual;
};
@@ -101,7 +156,8 @@
OverlayVolume::OverlayVolume(fs_volume *volume)
- : fVolume(volume)
+ : fVolume(volume),
+ fCurrentInodeNumber((ino_t)1 << 32)
{
}
@@ -115,27 +171,53 @@
OverlayInode::OverlayInode(OverlayVolume *volume, fs_vnode *superVnode,
- ino_t inodeNumber)
+ ino_t inodeNumber, OverlayInode *parentDir, mode_t mode)
: fVolume(volume),
- fSuperVnode(*superVnode),
+ fParentDir(parentDir),
fInodeNumber(inodeNumber),
fWriteBuffers(NULL),
fOriginalNodeLength(-1),
- fHasStat(false)
+ fDirents(NULL),
+ fDirentCount(0),
+ fHasStat(false),
+ fHasDirents(false),
+ fIsVirtual(superVnode == NULL)
{
- TRACE("inode created\n");
+ TRACE("inode created %lld\n", fInodeNumber);
+
+ if (superVnode != NULL)
+ fSuperVnode = *superVnode;
+ else {
+ fStat.st_dev = SuperVolume()->id;
+ fStat.st_ino = fInodeNumber;
+ fStat.st_mode = mode;
+ fStat.st_nlink = 1;
+ fStat.st_uid = 0;
+ fStat.st_gid = 0;
+ fStat.st_size = 0;
+ fStat.st_rdev = 0;
+ fStat.st_blksize = 1024;
+ fStat.st_atime = fStat.st_mtime = fStat.st_ctime = fStat.st_crtime
+ = time(NULL);
+ fStat.st_type = 0;
+ fHasStat = true;
+ }
}
OverlayInode::~OverlayInode()
{
- TRACE("inode destroyed\n");
+ TRACE("inode destroyed %lld\n", fInodeNumber);
write_buffer *element = fWriteBuffers;
while (element) {
write_buffer *next = element->next;
free(element);
element = next;
}
+
+ for (uint32 i = 0; i < fDirentCount; i++)
+ free(fDirents[i]);
+ free(fDirents);
}
@@ -147,6 +229,35 @@
status_t
+OverlayInode::Lookup(const char *name, ino_t *inodeNumber)
+{
+ if (strcmp(name, ".") == 0) {
+ *inodeNumber = fInodeNumber;
+ return get_vnode(SuperVolume(), *inodeNumber, NULL);
+ }
+
+ if (fIsVirtual && strcmp(name, "..") == 0) {
+ *inodeNumber = fParentDir->InodeNumber();
+ return get_vnode(Volume(), *inodeNumber, NULL);
+ }
+
+ for (uint32 i = 0; i < fDirentCount; i++) {
+ if (strcmp(fDirents[i]->name, name) == 0) {
+ *inodeNumber = fDirents[i]->inode_number;
+ return get_vnode(SuperVolume(), *inodeNumber, NULL);
+ }
+ }
+
+ if (!fHasDirents && !fIsVirtual && fSuperVnode.ops->lookup != NULL) {
+ return fSuperVnode.ops->lookup(SuperVolume(), &fSuperVnode, name,
+ inodeNumber);
+ }
+
+ return B_ENTRY_NOT_FOUND;
+}
+
+
+status_t
OverlayInode::ReadStat(struct stat *stat)
{
if (!fHasStat) {
@@ -180,7 +291,7 @@
fStat.st_size = stat->st_size;
if (statMask & B_STAT_MODE)
- fStat.st_mode = stat->st_mode;
+ fStat.st_mode = (fStat.st_mode & ~S_IUMSK) | (stat->st_mode & S_IUMSK);
if (statMask & B_STAT_UID)
fStat.st_uid = stat->st_uid;
if (statMask & B_STAT_GID)
@@ -203,8 +314,30 @@
status_t
+OverlayInode::Create(const char *name, int openMode, int perms, void **cookie,
+ ino_t *newInodeNumber)
+{
+ OverlayInode *newNode = NULL;
+ status_t result = _CreateCommon(name, S_IFREG, perms, newInodeNumber,
+ &newNode);
+ if (result != B_OK)
+ return result;
+
+ return newNode->Open(openMode, cookie);
+}
+
+
+status_t
OverlayInode::Open(int openMode, void **_cookie)
{
+ if (fIsVirtual) {
+ if (openMode & O_TRUNC)
+ fStat.st_size = 0;
+
+ *_cookie = NULL;
+ return B_OK;
+ }
+
if (fSuperVnode.ops->open == NULL)
return B_UNSUPPORTED;
@@ -243,6 +376,9 @@
status_t
OverlayInode::Close(void *_cookie)
{
+ if (fIsVirtual)
+ return B_OK;
+
open_cookie *cookie = (open_cookie *)_cookie;
return fSuperVnode.ops->close(SuperVolume(), &fSuperVnode,
cookie->super_cookie);
@@ -252,6 +388,9 @@
status_t
OverlayInode::FreeCookie(void *_cookie)
{
+ if (fIsVirtual)
+ return B_OK;
+
open_cookie *cookie = (open_cookie *)_cookie;
status_t result = fSuperVnode.ops->free_cookie(SuperVolume(),
&fSuperVnode, cookie->super_cookie);
@@ -396,12 +535,325 @@
}
+status_t
+OverlayInode::CreateDir(const char *name, int perms, ino_t *newInodeNumber)
+{
+ return _CreateCommon(name, S_IFDIR, perms, newInodeNumber, NULL);
+}
+
+
+status_t
+OverlayInode::RemoveDir(const char *name)
+{
+ return RemoveEntry(name, NULL);
+}
+
+
+status_t
+OverlayInode::OpenDir(void **cookie)
+{
+ if (!fHasDirents)
+ _PopulateDirents();
+
+ open_dir_cookie *dirCookie = (open_dir_cookie *)malloc(
+ sizeof(open_dir_cookie));
+ if (dirCookie == NULL)
+ return B_NO_MEMORY;
+
+ dirCookie->index = 0;
+ *cookie = dirCookie;
+ return B_OK;
+}
+
+
+status_t
+OverlayInode::CloseDir(void *cookie)
+{
+ return B_OK;
+}
+
+
+status_t
+OverlayInode::FreeDirCookie(void *cookie)
+{
+ free(cookie);
+ return B_OK;
+}
+
+
+status_t
+OverlayInode::ReadDir(void *cookie, struct dirent *buffer, size_t bufferSize,
+ uint32 *num)
+{
+ open_dir_cookie *dirCookie = (open_dir_cookie *)cookie;
+ if (dirCookie->index >= fDirentCount) {
+ *num = 0;
+ return B_OK;
+ }
+
+ overlay_dirent *dirent = fDirents[dirCookie->index++];
+ size_t nameLength = MIN(strlen(dirent->name),
+ bufferSize - sizeof(struct dirent)) + 1;
+
+ buffer->d_dev = SuperVolume()->id;
+ buffer->d_pdev = 0;
+ buffer->d_ino = dirent->inode_number;
+ buffer->d_pino = 0;
+ buffer->d_reclen = sizeof(struct dirent) + nameLength;
+ strlcpy(buffer->d_name, dirent->name, nameLength);
+
+ *num = 1;
+ return B_OK;
+}
+
+
+status_t
+OverlayInode::RewindDir(void *cookie)
+{
+ open_dir_cookie *dirCookie = (open_dir_cookie *)cookie;
+ dirCookie->index = 0;
+ return B_OK;
+}
+
+
+status_t
+OverlayInode::CreateSymlink(const char *name, const char *path, int perms)
+{
+ OverlayInode *newNode = NULL;
+ status_t result = _CreateCommon(name, S_IFLNK, perms, NULL, &newNode);
+ if (result != B_OK)
+ return result;
+
+ size_t writeLength = strlen(path);
+ return newNode->Write(NULL, 0, path, &writeLength);
+}
+
+
+status_t
+OverlayInode::ReadSymlink(char *buffer, size_t *bufferSize)
+{
+ if (fIsVirtual) {
+ if (!S_ISLNK(fStat.st_mode))
+ return B_BAD_VALUE;
+
+ return Read(NULL, 0, buffer, bufferSize);
+ }
+
+ if (fSuperVnode.ops->read_symlink == NULL)
+ return B_UNSUPPORTED;
+
+ return fSuperVnode.ops->read_symlink(SuperVolume(), &fSuperVnode, buffer,
+ bufferSize);
+}
+
+
+status_t
+OverlayInode::AddEntry(overlay_dirent *entry)
+{
+ if (!fHasDirents)
+ _PopulateDirents();
+
+ for (uint32 i = 0; i < fDirentCount; i++)
+ if (strcmp(fDirents[i]->name, entry->name) == 0)
+ return B_FILE_EXISTS;
+
+ overlay_dirent **newDirents = (overlay_dirent **)realloc(fDirents,
+ sizeof(overlay_dirent *) * (fDirentCount + 1));
+ if (newDirents == NULL)
+ return B_NO_MEMORY;
+
+ fDirents = newDirents;
+ fDirents[fDirentCount++] = entry;
+
+ notify_entry_created(SuperVolume()->id, fInodeNumber, entry->name,
+ entry->inode_number);
+
+ return B_OK;
+}
+
+
+status_t
+OverlayInode::RemoveEntry(const char *name, overlay_dirent **_entry)
+{
+ if (!fHasDirents)
+ _PopulateDirents();
+
+ for (uint32 i = 0; i < fDirentCount; i++) {
+ overlay_dirent *entry = fDirents[i];
+ if (strcmp(entry->name, name) == 0) {
+ for (uint32 j = i + 1; j < fDirentCount; j++)
+ fDirents[j - 1] = fDirents[j];
+ fDirentCount--;
+
+ notify_entry_removed(SuperVolume()->id, fInodeNumber, entry->name,
+ entry->inode_number);
+
+ if (_entry != NULL)
+ *_entry = entry;
+ else {
+ free(entry->name);
+ free(entry);
+ }
+
+ return B_OK;
+ }
+ }
+
+ return B_ENTRY_NOT_FOUND;
+}
+
+
+status_t
+OverlayInode::_PopulateDirents()
+{
+ if (fHasDirents)
+ return B_OK;
+
+ if (fIsVirtual || fSuperVnode.ops->open_dir == NULL
+ || fSuperVnode.ops->read_dir == NULL) {
+ fDirents = (overlay_dirent **)malloc(sizeof(overlay_dirent *) * 2);
+ if (fDirents == NULL)
+ return B_NO_MEMORY;
+
+ const char *names[] = { ".", ".." };
+ ino_t inodes[] = { fInodeNumber,
+ fParentDir != NULL ? fParentDir->InodeNumber() : 0 };
+ for (uint32 i = 0; i < 2; i++) {
+ fDirents[i] = (overlay_dirent *)malloc(sizeof(overlay_dirent));
+ if (fDirents[i] == NULL)
+ return B_NO_MEMORY;
+
+ fDirents[i]->inode_number = inodes[i];
+ fDirents[i]->name = strdup(names[i]);
+ if (fDirents[i]->name == NULL) {
+ free(fDirents[i]);
+ return B_NO_MEMORY;
+ }
+
+ fDirentCount++;
+ }
+
+ fHasDirents = true;
+ return B_OK;
+ }
+
+ fHasDirents = true;
+ void *superCookie = NULL;
+ status_t result = fSuperVnode.ops->open_dir(SuperVolume(),
+ &fSuperVnode, &superCookie);
+ if (result != B_OK)
+ return result;
+
+ size_t bufferSize = sizeof(struct dirent) + B_FILE_NAME_LENGTH;
+ struct dirent *buffer = (struct dirent *)malloc(bufferSize);
+ if (buffer == NULL)
+ return B_NO_MEMORY;
+
+ while (result == B_OK) {
+ uint32 num = 1;
+ result = fSuperVnode.ops->read_dir(SuperVolume(),
+ &fSuperVnode, superCookie, buffer, bufferSize, &num);
+ if (result != B_OK || num == 0)
+ break;
+
+ overlay_dirent **newDirents = (overlay_dirent **)realloc(fDirents,
+ sizeof(overlay_dirent *) * (fDirentCount + num));
+ if (newDirents == NULL)
+ break;
+
+ fDirents = newDirents;
+ struct dirent *dirent = buffer;
+ for (uint32 i = 0; i < num; i++) {
+ overlay_dirent *entry = (overlay_dirent *)malloc(
+ sizeof(overlay_dirent));
+ if (entry == NULL)
+ break;
+
+ entry->inode_number = dirent->d_ino;
+ entry->name = strdup(dirent->d_name);
+ if (entry->name == NULL) {
+ free(entry);
+ break;
+ }
+
+ fDirents[fDirentCount++] = entry;
+ dirent = (struct dirent *)((uint8 *)dirent + dirent->d_reclen);
+ }
+ }
+
+ if (fSuperVnode.ops->close_dir != NULL)
+ fSuperVnode.ops->close_dir(SuperVolume(), &fSuperVnode, superCookie);
+
+ if (fSuperVnode.ops->free_dir_cookie != NULL)
+ fSuperVnode.ops->free_dir_cookie(SuperVolume(), &fSuperVnode, superCookie);
+
+ free(buffer);
+ return B_OK;
+}
+
+
+status_t
+OverlayInode::_CreateCommon(const char *name, int type, int perms,
+ ino_t *newInodeNumber, OverlayInode **_node)
+{
+ if (!fHasStat)
+ ReadStat(NULL);
+
+ if (!S_ISDIR(fStat.st_mode))
+ return B_NOT_A_DIRECTORY;
+
+ overlay_dirent *entry = (overlay_dirent *)malloc(sizeof(overlay_dirent));
+ if (entry == NULL)
+ return B_NO_MEMORY;
+
+ entry->name = strdup(name);
+ if (entry->name == NULL) {
+ free(entry);
+ return B_NO_MEMORY;
+ }
+
+ entry->inode_number = fVolume->BuildInodeNumber();
+
+ OverlayInode *node = new(std::nothrow) OverlayInode(fVolume, NULL,
+ entry->inode_number, this, perms | type);
+ if (node == NULL) {
+ free(entry->name);
+ free(entry);
+ return B_NO_MEMORY;
+ }
+
+ status_t result = AddEntry(entry);
+ if (result != B_OK) {
+ free(entry->name);
+ free(entry);
+ delete node;
+ }
+
+ result = publish_overlay_vnode(fVolume->Volume(), entry->inode_number,
+ node, type);
+ if (result != B_OK) {
+ RemoveEntry(entry->name, NULL);
+ delete node;
+ return result;
+ }
+
+ if (newInodeNumber != NULL)
+ *newInodeNumber = entry->inode_number;
+ if (_node != NULL)
+ *_node = node;
+
+ return B_OK;
+}
+
+
// #pragma mark - vnode ops
#define OVERLAY_CALL(op, params...) \
TRACE("relaying op: " #op "\n"); \
OverlayInode *node = (OverlayInode *)vnode->private_node; \
+ if (node->IsVirtual()) \
+ return B_UNSUPPORTED; \
fs_vnode *superVnode = node->SuperVnode(); \
if (superVnode->ops->op != NULL) \
return superVnode->ops->op(volume->super_volume, superVnode, params);
@@ -410,10 +862,15 @@
static status_t
overlay_put_vnode(fs_volume *volume, fs_vnode *vnode, bool reenter)
{
+ TRACE("put_vnode\n");
OverlayInode *node = (OverlayInode *)vnode->private_node;
- fs_vnode *superVnode = node->SuperVnode();
+ if (node->IsVirtual()) {
+ delete node;
+ return B_OK;
+ }
status_t result = B_OK;
+ fs_vnode *superVnode = node->SuperVnode();
if (superVnode->ops->put_vnode != NULL) {
result = superVnode->ops->put_vnode(volume->super_volume, superVnode,
reenter);
@@ -427,10 +884,15 @@
static status_t
overlay_remove_vnode(fs_volume *volume, fs_vnode *vnode, bool reenter)
{
+ TRACE("remove_vnode\n");
OverlayInode *node = (OverlayInode *)vnode->private_node;
- fs_vnode *superVnode = node->SuperVnode();
+ if (node->IsVirtual()) {
+ delete node;
+ return B_OK;
+ }
status_t result = B_OK;
+ fs_vnode *superVnode = node->SuperVnode();
if (superVnode->ops->remove_vnode != NULL) {
result = superVnode->ops->remove_vnode(volume->super_volume, superVnode,
reenter);
@@ -451,8 +913,12 @@
}
OverlayInode *node = (OverlayInode *)vnode->private_node;
+ if (node->IsVirtual()) {
+ *_superVnode = *vnode;
+ return B_OK;
+ }
+
fs_vnode *superVnode = node->SuperVnode();
-
if (superVnode->ops->get_super_vnode != NULL) {
return superVnode->ops->get_super_vnode(volume->super_volume,
superVnode, superVolume, _superVnode);
@@ -466,8 +932,8 @@
static status_t
overlay_lookup(fs_volume *volume, fs_vnode *vnode, const char *name, ino_t *id)
{
- OVERLAY_CALL(lookup, name, id)
- return B_UNSUPPORTED;
+ TRACE("lookup: \"%s\"\n", name);
+ return ((OverlayInode *)vnode->private_node)->Lookup(name, id);
}
@@ -574,12 +1040,6 @@
static status_t
overlay_fsync(fs_volume *volume, fs_vnode *vnode)
{
- OverlayInode *node = (OverlayInode *)vnode->private_node;
- fs_vnode *superVnode = node->SuperVnode();
-
- if (superVnode->ops->fsync != NULL)
- return superVnode->ops->fsync(volume->super_volume, superVnode);
-
return B_OK;
}
@@ -588,8 +1048,9 @@
overlay_read_symlink(fs_volume *volume, fs_vnode *vnode, char *buffer,
size_t *bufferSize)
{
- OVERLAY_CALL(read_symlink, buffer, bufferSize)
- return B_UNSUPPORTED;
+ TRACE("read_symlink\n");
+ return ((OverlayInode *)vnode->private_node)->ReadSymlink(buffer,
+ bufferSize);
}
@@ -597,8 +1058,9 @@
overlay_create_symlink(fs_volume *volume, fs_vnode *vnode, const char *name,
const char *path, int mode)
{
- OVERLAY_CALL(create_symlink, name, path, mode)
- return B_UNSUPPORTED;
+ TRACE("create_symlink: \"%s\" -> \"%s\"\n", name, path);
+ return ((OverlayInode *)vnode->private_node)->CreateSymlink(name, path,
+ mode);
}
@@ -606,7 +1068,6 @@
overlay_link(fs_volume *volume, fs_vnode *vnode, const char *name,
fs_vnode *target)
{
- OVERLAY_CALL(link, name, target)
return B_UNSUPPORTED;
}
@@ -614,31 +1075,64 @@
static status_t
overlay_unlink(fs_volume *volume, fs_vnode *vnode, const char *name)
{
- OVERLAY_CALL(unlink, name)
- return B_UNSUPPORTED;
+ TRACE("unlink: \"%s\"\n", name);
+ return ((OverlayInode *)vnode->private_node)->RemoveEntry(name, NULL);
}
static status_t
overlay_rename(fs_volume *volume, fs_vnode *vnode,
- const char *fromName, fs_vnode *toDir, const char *toName)
+ const char *fromName, fs_vnode *toVnode, const char *toName)
{
- OVERLAY_CALL(rename, fromName, toDir, toName)
- return B_UNSUPPORTED;
+ TRACE("rename: \"%s\" -> \"%s\"\n", fromName, toName);
+ OverlayInode *fromNode = (OverlayInode *)vnode->private_node;
+ OverlayInode *toNode = (OverlayInode *)toVnode->private_node;
+ overlay_dirent *entry = NULL;
+
+ status_t result = fromNode->RemoveEntry(fromName, &entry);
+ if (result != B_OK)
+ return result;
+
+ char *oldName = entry->name;
+ entry->name = strdup(toName);
+ if (entry->name == NULL) {
+ entry->name = oldName;
+ if (fromNode->AddEntry(entry) != B_OK) {
+ free(entry->name);
+ free(entry);
+ }
+
+ return B_NO_MEMORY;
+ }
+
+ result = toNode->AddEntry(entry);
+ if (result != B_OK) {
+ free(entry->name);
+ entry->name = oldName;
+ if (fromNode->AddEntry(entry) != B_OK) {
+ free(entry->name);
+ free(entry);
+ }
+
+ return result;
+ }
+
+ return B_OK;
}
static status_t
overlay_access(fs_volume *volume, fs_vnode *vnode, int mode)
{
- OVERLAY_CALL(access, mode)
- return B_UNSUPPORTED;
+ // TODO: implement
+ return B_OK;
}
static status_t
overlay_read_stat(fs_volume *volume, fs_vnode *vnode, struct stat *stat)
{
+ TRACE("read_stat\n");
return ((OverlayInode *)vnode->private_node)->ReadStat(stat);
}
@@ -647,6 +1141,7 @@
overlay_write_stat(fs_volume *volume, fs_vnode *vnode, const struct stat *stat,
uint32 statMask)
{
+ TRACE("write_stat\n");
return ((OverlayInode *)vnode->private_node)->WriteStat(stat, statMask);
}
@@ -655,14 +1150,16 @@
overlay_create(fs_volume *volume, fs_vnode *vnode, const char *name,
int openMode, int perms, void **cookie, ino_t *newVnodeID)
{
- OVERLAY_CALL(create, name, openMode, perms, cookie, newVnodeID)
- return B_UNSUPPORTED;
+ TRACE("create: \"%s\"\n", name);
+ return ((OverlayInode *)vnode->private_node)->Create(name, openMode,
+ perms, cookie, newVnodeID);
}
static status_t
overlay_open(fs_volume *volume, fs_vnode *vnode, int openMode, void **cookie)
{
+ TRACE("open\n");
return ((OverlayInode *)vnode->private_node)->Open(openMode, cookie);
}
@@ -670,6 +1167,7 @@
static status_t
overlay_close(fs_volume *volume, fs_vnode *vnode, void *cookie)
{
+ TRACE("close\n");
return ((OverlayInode *)vnode->private_node)->Close(cookie);
}
@@ -677,6 +1175,7 @@
static status_t
overlay_free_cookie(fs_volume *volume, fs_vnode *vnode, void *cookie)
{
+ TRACE("free_cookie\n");
return ((OverlayInode *)vnode->private_node)->FreeCookie(cookie);
}
@@ -685,6 +1184,7 @@
overlay_read(fs_volume *volume, fs_vnode *vnode, void *cookie, off_t pos,
void *buffer, size_t *length)
{
+ TRACE("read\n");
return ((OverlayInode *)vnode->private_node)->Read(cookie, pos, buffer,
length);
}
@@ -694,6 +1194,7 @@
overlay_write(fs_volume *volume, fs_vnode *vnode, void *cookie, off_t pos,
const void *buffer, size_t *length)
{
+ TRACE("write\n");
return ((OverlayInode *)vnode->private_node)->Write(cookie, pos, buffer,
length);
}
@@ -703,40 +1204,41 @@
overlay_create_dir(fs_volume *volume, fs_vnode *vnode, const char *name,
int perms, ino_t *newVnodeID)
{
- OVERLAY_CALL(create_dir, name, perms, newVnodeID)
- return B_UNSUPPORTED;
+ TRACE("create_dir: \"%s\"\n", name);
+ return ((OverlayInode *)vnode->private_node)->CreateDir(name, perms,
+ newVnodeID);
}
static status_t
overlay_remove_dir(fs_volume *volume, fs_vnode *vnode, const char *name)
{
- OVERLAY_CALL(remove_dir, name)
- return B_UNSUPPORTED;
+ TRACE("remove_dir: \"%s\"\n", name);
+ return ((OverlayInode *)vnode->private_node)->RemoveDir(name);
}
static status_t
overlay_open_dir(fs_volume *volume, fs_vnode *vnode, void **cookie)
{
- OVERLAY_CALL(open_dir, cookie)
- return B_UNSUPPORTED;
+ TRACE("open_dir\n");
+ return ((OverlayInode *)vnode->private_node)->OpenDir(cookie);
}
static status_t
overlay_close_dir(fs_volume *volume, fs_vnode *vnode, void *cookie)
{
- OVERLAY_CALL(close_dir, cookie)
- return B_UNSUPPORTED;
+ TRACE("close_dir\n");
+ return ((OverlayInode *)vnode->private_node)->CloseDir(cookie);
}
static status_t
overlay_free_dir_cookie(fs_volume *volume, fs_vnode *vnode, void *cookie)
{
- OVERLAY_CALL(free_dir_cookie, cookie)
- return B_UNSUPPORTED;
+ TRACE("free_dir_cookie\n");
+ return ((OverlayInode *)vnode->private_node)->FreeDirCookie(cookie);
}
@@ -744,16 +1246,17 @@
overlay_read_dir(fs_volume *volume, fs_vnode *vnode, void *cookie,
struct dirent *buffer, size_t bufferSize, uint32 *num)
{
- OVERLAY_CALL(read_dir, cookie, buffer, bufferSize, num)
- return B_UNSUPPORTED;
+ TRACE("read_dir\n");
+ return ((OverlayInode *)vnode->private_node)->ReadDir(cookie, buffer,
+ bufferSize, num);
}
static status_t
overlay_rewind_dir(fs_volume *volume, fs_vnode *vnode, void *cookie)
{
- OVERLAY_CALL(rewind_dir, cookie)
- return B_UNSUPPORTED;
+ TRACE("rewind_dir\n");
+ return ((OverlayInode *)vnode->private_node)->RewindDir(cookie);
}
@@ -1312,6 +1815,15 @@
NULL // initialize
};
+
+status_t
+publish_overlay_vnode(fs_volume *volume, ino_t inodeNumber, void *privateNode,
+ int type)
+{
+ return publish_vnode(volume, inodeNumber, privateNode, &sOverlayVnodeOps,
+ type, 0);
+}
+
} // namespace write_overlay
using namespace write_overlay;
From humdingerb at googlemail.com Sat Feb 21 07:43:35 2009
From: humdingerb at googlemail.com (Humdinger)
Date: Sat, 21 Feb 2009 07:43:35 +0100
Subject: [Haiku-commits] r29252 - in haiku/trunk/docs/welcome: . en
In-Reply-To: <499F2E2C.3040202@pinc-software.de>
References: <200902192028.n1JKShxx021160@sheep.berlios.de> <499ECBC8.2030103@googlemail.com>
<499F2E2C.3040202@pinc-software.de>
Message-ID: <499FA297.4060602@googlemail.com>
Axel D?rfler wrote:
> Humdinger wrote:
>> I wouldn't
>> want to undo your mime setting...
>
> You don't need to mind about that; unless you replace the file (ie.
> delete it, and add a new one), the properties are preserved.
OK, that's good. Thanks.
Regards,
Humdinger
--
--=-=--=-=--=-=--=-=--=-=--=-=--=-=--=-=--=-=--=-
Deutsche Haiku News @ http://www.haiku-gazette.de
From humdingerb at mail.berlios.de Sat Feb 21 12:41:26 2009
From: humdingerb at mail.berlios.de (humdingerb at mail.berlios.de)
Date: Sat, 21 Feb 2009 12:41:26 +0100
Subject: [Haiku-commits] r29269 - in haiku/trunk/docs: . userguide/en
userguide/en/applications userguide/en/desktop-applets
userguide/en/installation userguide/en/preferences
userguide/images welcome welcome/en
Message-ID: <200902211141.n1LBfQBw024065@sheep.berlios.de>
Author: humdingerb
Date: 2009-02-21 12:40:17 +0100 (Sat, 21 Feb 2009)
New Revision: 29269
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29269&view=rev
Added:
haiku/trunk/docs/userguide/images/alert_info_16.png
haiku/trunk/docs/userguide/images/alert_info_32.png
haiku/trunk/docs/userguide/images/alert_info_64.png
haiku/trunk/docs/userguide/images/alert_stop_16.png
haiku/trunk/docs/userguide/images/alert_stop_32.png
haiku/trunk/docs/userguide/images/alert_stop_64.png
haiku/trunk/docs/userguide/images/alert_warning_16.png
haiku/trunk/docs/userguide/images/alert_warning_32.png
haiku/trunk/docs/userguide/images/alert_warning_64.png
Modified:
haiku/trunk/docs/Haiku-doc.css
haiku/trunk/docs/userguide/en/applications.html
haiku/trunk/docs/userguide/en/applications/apps-activitymonitor.html
haiku/trunk/docs/userguide/en/applications/apps-bepdf.html
haiku/trunk/docs/userguide/en/applications/apps-cdplayer.html
haiku/trunk/docs/userguide/en/applications/apps-codycam.html
haiku/trunk/docs/userguide/en/applications/apps-deskcalc.html
haiku/trunk/docs/userguide/en/applications/apps-diskprobe.html
haiku/trunk/docs/userguide/en/applications/apps-diskusage.html
haiku/trunk/docs/userguide/en/applications/apps-drivesetup.html
haiku/trunk/docs/userguide/en/applications/apps-expander.html
haiku/trunk/docs/userguide/en/applications/apps-firefox.html
haiku/trunk/docs/userguide/en/applications/apps-icon-o-matic.html
haiku/trunk/docs/userguide/en/applications/apps-installer.html
haiku/trunk/docs/userguide/en/applications/apps-magnify.html
haiku/trunk/docs/userguide/en/applications/apps-mail.html
haiku/trunk/docs/userguide/en/applications/apps-mediaplayer.html
haiku/trunk/docs/userguide/en/applications/apps-midiplayer.html
haiku/trunk/docs/userguide/en/applications/apps-packageinstaller.html
haiku/trunk/docs/userguide/en/applications/apps-pe.html
haiku/trunk/docs/userguide/en/applications/apps-people.html
haiku/trunk/docs/userguide/en/applications/apps-screenshot.html
haiku/trunk/docs/userguide/en/applications/apps-showimage.html
haiku/trunk/docs/userguide/en/applications/apps-soundrecorder.html
haiku/trunk/docs/userguide/en/applications/apps-stylededit.html
haiku/trunk/docs/userguide/en/applications/apps-terminal.html
haiku/trunk/docs/userguide/en/applications/apps-textsearch.html
haiku/trunk/docs/userguide/en/applications/apps-tv.html
haiku/trunk/docs/userguide/en/applications/apps-vision.html
haiku/trunk/docs/userguide/en/applications/apps-vlc.html
haiku/trunk/docs/userguide/en/applications/apps-wonderbrush.html
haiku/trunk/docs/userguide/en/attributes.html
haiku/trunk/docs/userguide/en/bash-scripting.html
haiku/trunk/docs/userguide/en/bootloader.html
haiku/trunk/docs/userguide/en/contents.html
haiku/trunk/docs/userguide/en/deskbar.html
haiku/trunk/docs/userguide/en/desktop-applets/desktop-applets-launchbox.html
haiku/trunk/docs/userguide/en/desktop-applets/desktop-applets-networkstatus.html
haiku/trunk/docs/userguide/en/desktop-applets/desktop-applets-processcontroller.html
haiku/trunk/docs/userguide/en/filesystem-layout.html
haiku/trunk/docs/userguide/en/filetypes.html
haiku/trunk/docs/userguide/en/gui.html
haiku/trunk/docs/userguide/en/index.html
haiku/trunk/docs/userguide/en/installation/install-boot-process.html
haiku/trunk/docs/userguide/en/installation/install-raw.html
haiku/trunk/docs/userguide/en/installation/install-source-beos.html
haiku/trunk/docs/userguide/en/installation/install-source-linux.html
haiku/trunk/docs/userguide/en/installation/install-source-mac.html
haiku/trunk/docs/userguide/en/installation/install-usb.html
haiku/trunk/docs/userguide/en/installation/install-vm.html
haiku/trunk/docs/userguide/en/installing.html
haiku/trunk/docs/userguide/en/keyboard-shortcuts.html
haiku/trunk/docs/userguide/en/preferences.html
haiku/trunk/docs/userguide/en/preferences/prefs-appearance.html
haiku/trunk/docs/userguide/en/preferences/prefs-backgrounds.html
haiku/trunk/docs/userguide/en/preferences/prefs-datatranslations.html
haiku/trunk/docs/userguide/en/preferences/prefs-e-mail.html
haiku/trunk/docs/userguide/en/preferences/prefs-filetypes.html
haiku/trunk/docs/userguide/en/preferences/prefs-fonts.html
haiku/trunk/docs/userguide/en/preferences/prefs-keyboard.html
haiku/trunk/docs/userguide/en/preferences/prefs-keymap.html
haiku/trunk/docs/userguide/en/preferences/prefs-media.html
haiku/trunk/docs/userguide/en/preferences/prefs-menu.html
haiku/trunk/docs/userguide/en/preferences/prefs-mouse.html
haiku/trunk/docs/userguide/en/preferences/prefs-network.html
haiku/trunk/docs/userguide/en/preferences/prefs-printers.html
haiku/trunk/docs/userguide/en/preferences/prefs-screen.html
haiku/trunk/docs/userguide/en/preferences/prefs-screensaver.html
haiku/trunk/docs/userguide/en/preferences/prefs-sounds.html
haiku/trunk/docs/userguide/en/preferences/prefs-time.html
haiku/trunk/docs/userguide/en/preferences/prefs-tracker.html
haiku/trunk/docs/userguide/en/preferences/prefs-virtualmemory.html
haiku/trunk/docs/userguide/en/queries.html
haiku/trunk/docs/userguide/en/teammonitor.html
haiku/trunk/docs/userguide/en/tracker-add-ons.html
haiku/trunk/docs/userguide/en/tracker.html
haiku/trunk/docs/userguide/en/twitcher.html
haiku/trunk/docs/userguide/en/workshop-filetypes+attributes.html
haiku/trunk/docs/userguide/en/workspaces.html
haiku/trunk/docs/welcome/en/bugreports.html
haiku/trunk/docs/welcome/welcome.html
Log:
* Added more CSS control for menus, buttons, app names, shell commands, paths.
* Always wanting keyboard graphics for shortcuts, Jorge suggested simple borders
for simplicity. Great idea! Added.
* Added Jorge's rounded boxes for note/warning/stop plus symbols.
* If anyone wants to fine tune esp. colours, go ahead. Jorge and I are both
challenged in that department. :)
* A few small corrections and reformatting here and there.
* Excluded the topic "Installation" from the contents until it's further along.
Modified: haiku/trunk/docs/Haiku-doc.css
===================================================================
--- haiku/trunk/docs/Haiku-doc.css 2009-02-21 02:35:55 UTC (rev 29268)
+++ haiku/trunk/docs/Haiku-doc.css 2009-02-21 11:40:17 UTC (rev 29269)
@@ -15,6 +15,7 @@
}
body {
color: #333333;
+ line-height: 1.5;
margin: 0px;
padding: 0px;
font-family: "DejaVu Sans",Arial,Helvetica,sans-serif;
@@ -56,6 +57,7 @@
color: #0c3762;
}
+
/* basic text elements */
div.content {
@@ -64,46 +66,7 @@
margin-right: 40px;
margin-bottom: 50px;
}
-h1 {
- font-size: 1.3em;
- font-weight: normal;
- color: #0c3762;
- border-bottom: dotted thin #e0e0e0;
- margin-top: 50px;
-}
-h2 {
- font-size: 1.2em;
- font-weight: normal;
- color: #0c3762;
- border-bottom: dotted thin #e0e0e0;
- margin-top: 40px;
-}
-h3 {
- font-size: 1.1em;
- font-weight: normal;
- color: #0c3762;
- margin-top: 30px;
-}
-h4 {
- font-size: 1.0em;
- font-weight: lighter;
- color: #0c3762;
- margin-top: 30px;
-}
-p {
- text-align: justify;
- line-height: 1.3;
-}
-ol {
- padding-left: 20px;
-}
-ul {
- padding-left: 14px;
-}
-li {
- line-height: 1.3;
-}
-
+
/* heading and navigation */
div.logo {
@@ -120,9 +83,11 @@
top: 54px;
right: 40px;
font-size: 1.2em;
+ line-height: 1.0;
}
div.topnav {
background: #e0e0e0;
+ line-height: 1.0;
}
div.topnav p {
margin-left: 40px;
@@ -144,23 +109,143 @@
font-size: 0.8em;
}
-/* layout elements */
-td {
- vertical-align: top;
+/* Haiku User Guide styles and layout */
+
+/* Rounded corner boxes */
+/* Common declarations */
+.box-info, .box-stop, .box-warning {
+ -webkit-border-radius: 10px;
+ -khtml-border-radius: 10px;
+ -moz-border-radius: 10px;
+ border-radius: 10px;
+ border-style: dotted;
+ border-width: thin;
+ border-color: #dcdcdc;
+ padding: 15px 15px 15px 80px;
+ margin-bottom: 15px;
+ margin-top: 15px;
+ min-height: 70px;
+}
+.box-info {
+ background: #e4ffde url(userguide/images/alert_info_32.png) 15px 15px no-repeat;
+}
+.box-warning {
+ background: #fffbc6 url(userguide/images/alert_warning_32.png) 15px 15px no-repeat;
+}
+.box-stop {
+ background: #ffeae6 url(userguide/images/alert_stop_32.png) 15px 15px no-repeat;
+}
+
+/* More layout and styles */
+h1 {
+ font-size: 1.3em;
+ font-weight: normal;
+ color: #0c3762;
+ border-bottom: dotted thin #e0e0e0;
+ margin-top: 50px;
}
-td.onelinetop {
- vertical-align: top;
- white-space: nowrap;
+h2 {
+ font-size: 1.2em;
+ font-weight: normal;
+ color: #0c3762;
+ border-bottom: dotted thin #e0e0e0;
+ margin-top: 40px;
}
-tt {
- background-color: #f0f0f0;
+h3 {
+ font-size: 1.1em;
+ font-weight: normal;
+ color: #0c3762;
+ margin-top: 30px;
}
-pre.terminal {
- border-color: #0c3762;
- border-style: dotted;
- border-width: thin;
- margin: 0em;
- padding: 1.5em;
- background-color: #f0f0f0;
+h4 {
+ font-size: 1.0em;
+ font-weight: normal;
+ color: #0c3762;
+ margin-top: 30px;
}
+p {
+ text-align: justify;
+}
+ol {
+ padding-left: 20px;
+}
+ul {
+ padding-left: 14px;
+}
+li {
+ line-height: 1.3;
+}
+td {
+ vertical-align: top;
+}
+td.onelinetop {
+ vertical-align: top;
+ white-space: nowrap;
+}
+tt {
+ background-color: #e2e2e2;
+ font-size: 1.0em;
+ font-family: monospace;
+}
+pre {
+ border-color: #0c3762;
+ border-style: dotted;
+ border-width: thin;
+ margin: 0em;
+ padding: 1.5em;
+ background-color: #f0f0f0;
+}
+pre.terminal { /* Terminal output*/
+ border-color: #ffb11f;
+ border-style: dotted;
+ border-width: thin;
+ margin: 0em;
+ padding: 1.5em;
+ background-color: #3a3a3a;
+ color: #ffb11f;
+}
+.menu { /* Menu */
+ font-size: 1.0em;
+ font-family: serif;
+ font-style: italic;
+ color: #24225e;
+}
+.button { /* Button */
+ font-size: 1.0em;
+ font-family: serif;
+ font-style: italic;
+ color: #33583c;
+}
+.app { /* GUI Application name */
+ font-size: 1.0em;
+ font-family: serif;
+ font-style: italic;
+/* color: #5e1c1c; */
+ color: #5e1c1c;
+}
+.cli { /* Shell command or file */
+ background-color: #e8e8e8;
+ font-size: 0.9em;
+ font-family: monospace;
+}
+.path { /* File path */
+ background-color: #e8e8e8;
+ font-size: 0.9em;
+ font-family: monospace;
+}
+.key { /* Shortcut (separate with */
+ -webkit-border-radius: 3px;
+ -khtml-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+ border-color: #c7c7c7;
+ border-style: solid;
+ border-width: 1px;
+ padding: 0px 2px 0px 2px;
+ background-color: #e8e8e8;
+ font-family: serif;
+ font-variant: small-caps;
+ font-size: 0.8em;
+}
+
Modified: haiku/trunk/docs/userguide/en/applications/apps-activitymonitor.html
===================================================================
--- haiku/trunk/docs/userguide/en/applications/apps-activitymonitor.html 2009-02-21 02:35:55 UTC (rev 29268)
+++ haiku/trunk/docs/userguide/en/applications/apps-activitymonitor.html 2009-02-21 11:40:17 UTC (rev 29269)
@@ -37,17 +37,17 @@
ActivityMonitor
-
Deskbar:
Applications
-
Location:
/boot/beos/apps/ActivityMonitor
-
Settings:
~/config/settings/ActivityMonitor settings
+
Deskbar:
Applications
+
Location:
/boot/beos/apps/ActivityMonitor
+
Settings:
~/config/settings/ActivityMonitor settings
You can track system resources by launching the ActivityMonitor and activating different items of interest.
By right-clicking into the window, you can toggle the display of all kinds of resources: Used/Cached Memory, Swap Space, CPU Usage, Network Receive/Send, Page faults, Semaphores, Ports, Threads, Teams, Running Applications, Raw/Text Clipboard Size, Media Nodes
-
Below the graphics is a legend (hideable from the context menu). You can change their colors and that of the graph's background via drag&drop from any color picker, e.g. from Icon-O-Matic.
-
You can add more views from the File menu if it gets too crowded.
+
Below the graphics is a legend (hideable from the context menu). You can change their colors and that of the graph's background via drag&drop from any color picker, e.g. from Icon-O-Matic.
+
You can add more views from the File menu if it gets too crowded.
Each view has it's own Replicator handle and can thus be arranged, for example, on the Desktop.
BePDF is Haiku's fast launching PDF viewer. Besides viewing, it supports annotating and user-defined bookmarking for unencrypted PDFs. It's fully localized for 20 languages at the moment with additional languages being easily added via text files.
-
BePDF comes with its own documentation as HTML or as PDF. The later will also open from the menu Help | Show Help...
+
BePDF comes with its own documentation as HTML or as PDF. The later will also open from the menu Help | Show Help...
Usage is pretty much what you'd expect from looking at the control buttons.
-Activate the Repeat button to the left of Shuffle to loop the complete CD.
-
If you need more control like playlists, try MediaPlayer instead.
+Activate the Repeat button to the left of Shuffle to loop the complete CD.
+
If you need more control like playlists, try MediaPlayer instead.
~/config/settings/Terminal_settings
-~/.profile - adds/overrides defaults in /boot/beos/etc/profile
-~/.inputrc - adds/overrides defaults in /boot/beos/etc/inputrc
+
Deskbar:
Applications
+
Location:
/boot/beos/apps/Terminal
+
Settings:
~/config/settings/Terminal_settings
+~/.profile - adds/overrides defaults in /boot/beos/etc/profile
+~/.inputrc - adds/overrides defaults in /boot/beos/etc/inputrc
The Terminal is Haiku's interface to bash, the Bourne Again Shell.
Please refer to the topic on Scripting for a few links to online tutorials on working in the shell. Here, we'll concentrate on the Terminal application itself.
You can open as many Terminals as needed, either each in it's own window by simply launching more Terminals or with ALT+N from an already running Terminal. Or you use Terminal's tabbed view and open another tab with ALT+T.
-
A Terminal window can be resized like any other window or you use the presets from the Ssettings | Window Size menu. ALT+RETURN toggles fullscreen mode.
-
Changed window size and text encoding are only kept choosing Settings | Save as default.
+
You can open as many Terminals as needed, either each in it's own window by simply launching more Terminals or with ALTN from an already running Terminal. Or you use Terminal's tabbed view and open another tab with ALTT.
+
A Terminal window can be resized like any other window or you use the presets from the Settings | Window Size menu. ALTENTER toggles fullscreen mode.
+
Changed window size and text encoding are only kept choosing Settings | Save as default.
-
Settings | Preferences opens a panel where you can set font type, font size and the different text and background colors. You can save different settings as separate profiles, which on double-click open an accordingly configured Terminal.
-Pressing OK will save the current settings as default.
+
Settings | Preferences opens a panel where you can set font type, font size and the different text and background colors. You can save different settings as separate profiles, which on double-click open an accordingly configured Terminal.
+Pressing OK will save the current settings as default.
Coming from Unix, there are countless possibilities to customize the bash itself. There are two files that are especially important to the user: .profile and .inputrc
-Both files can be created in the home/ folder and add or override the system defaults that are defined in /boot/beos/etc/.
+
Coming from Unix, there are countless possibilities to customize the bash itself. There are two files that are especially important to the user: .profile and .inputrc
+Both files can be created in the home/ folder and add or override the system defaults that are defined in /boot/beos/etc/.
.profile
-
The .profile is loaded every time you open a new Terminal. It sets all kinds of aliases and variables that will affect bash's behavior and appearance. You'll find many online resources that will detail all possibilities.
+
The .profile is loaded every time you open a new Terminal. It sets all kinds of aliases and variables that will affect bash's behavior and appearance. You'll find many online resources that will detail all possibilities.
The Haiku/BeOS Tip Server has quite a few tips to get you started, for example:
The .inputrc deals with keybindings. Since Haiku provides useful defaults, you probably don't have to mess with these more involved settings. If you do have special needs here, consult one of the many online resources, e.g. The GNU Readline Library.
+
The .inputrc deals with keybindings. Since Haiku provides useful defaults, you probably don't have to mess with these more involved settings. If you do have special needs here, consult one of the many online resources, e.g. The GNU Readline Library.
Dragging a file or folder from a Tracker window into the Terminal will insert its path at the location of the cursor. Dragging with the right mouse button offers additional actions in a context menu:
-
Insert Path
Inserts the location of the file, same as drag&dropping with the left mouse button.
-
Change Directory
Changes to the folder of the dragged file.
-
Create Link Here
Creates a link to the dragged file in the current working directory of the Terminal.
-
Move Here
Moves the dragged file into the current working directory of the Terminal.
-
Copy Here
Copies the dragged file into the current working directory of the Terminal.
+
Insert Path
Inserts the location of the file, same as drag&dropping with the left mouse button.
+
Change Directory
Changes to the folder of the dragged file.
+
Create Link Here
Creates a link to the dragged file in the current working directory of the Terminal.
+
Move Here
Moves the dragged file into the current working directory of the Terminal.
+
Copy Here
Copies the dragged file into the current working directory of the Terminal.
-
You can open any file with its preferred application with the command open [filename]. This also works with the representation of the current (".") and parent ("..") folder which then open in a Tracker window. So, to open the current working directory, you type:
+
You can open any file with its preferred application with the command open [filename]. This also works with the representation of the current (".") and parent ("..") folder which then open in a Tracker window. So, to open the current working directory, you type:
Haiku software always comes as an archive. Most of the time it's a ZIP, some old BeOS packages come in Software Valet's PKG format. Software Valet was able to automatically execute installation scripts, so after double-clicking you just select a destination folder and everything's taken care of.
-If it's a ZIP archive, double-clicking opens Expander where you also set the destination and unpack it. As explained in the topic Filesystem layout, that destination is either
+If it's a ZIP archive, double-clicking opens Expander where you also set the destination and unpack it. As explained in the topic Filesystem layout, that destination is either
-
/boot/common/apps/
for applications available to every user
-
/boot/home/apps/
for applications only available to yourself
+
/boot/common/apps/
for applications available to every user
+
/boot/home/apps/
for applications only available to yourself
This distinction will only become relevant once Haiku gets multi-user support, of course.
Once the archive is unpacked, you should have a look into the newly created folder. Often you find ReadMe files or other documentation of interest.
-
Some programs need further configurations. For example, Tracker Add-Ons, Translators or other system enhancing components have to be put into the right folders. Either you'll find a little script file (often with the suffix .sh) like install that you simply double click to have all taken care of.
-Sometimes you'll find folders that link to the correct destination named "drag [filename] here...". So, you simply follow that instruction and you're done.
+
Some programs need further configurations. For example, Tracker Add-Ons, Translators or other system enhancing components have to be put into the right folders. Either you'll find a little script file (often with the suffix .sh) like install that you simply double click to have all taken care of.
+Sometimes you'll find folders that link to the correct destination named "drag [filename] here...". So, you simply follow that instruction and you're done.
Most of the time, however, nothing of the sort is necessary and you're done after unpacking.
See topic Deskbar or LaunchBox to see how to add shortcuts to your newly installed application.
If the installation was done with an install script, chances are, there's an uninstall script as well. In that case, double-click it and you're done.
Otherwise, uninstalling is simply done by deleting the application's folder.
-
This, of course, leaves back possible configuration files in your ~/config/settings folder. This may be on purpose, if you want to keep those settings in case you'll install it again in the future. Also, when the installation involved those "drag [filename] here..." folders, those files are also left behind.
+
This, of course, leaves back possible configuration files in your ~/config/settings folder. This may be on purpose, if you want to keep those settings in case you'll install it again in the future. Also, when the installation involved those "drag [filename] here..." folders, those files are also left behind.
One method to quickly get to all the app's files is to do a quick query for a significant part of the application's name. This will reveal the app's binary, its installation folder and its settings as well as possible links in the Deskbar etc. Simply select all relevant files and delete them.
Haiku comes with a set of mostly small but essential applications. You'll find all of them at /boot/beos/apps/ or /boot/common/apps/. Applications that are not usually launched by a double-click on a data file (e.g. ShowImage for image files) can be found in the Applications menu of the Deskbar.
+
Haiku comes with a set of mostly small but essential applications. You'll find all of them at /boot/beos/apps/ or /boot/common/apps/. Applications that are not usually launched by a double-click on a data file (e.g. ShowImage for image files) can be found in the Applications menu of the Deskbar.
Attributes are displayed quite similar to a database or spreadsheet. Using Tracker you can choose which attributes to display (columns) and sort file listings (rows) accordingly.
-
To do this, open a Tracker window, click on the Attributes menu, and select the attributes you want to display. Alternatively, simply right-click onto a column heading and mark the items in the context menu. You can rearrange the columns by a simple drag&drop of the column heading. Moving a column out of a window, is a fast way to get rid of columns you don't need.
+
To do this, open a Tracker window, click on the Attributes menu, and select the attributes you want to display. Alternatively, simply right-click onto a column heading and mark the items in the context menu. You can rearrange the columns by a simple drag&drop of the column heading. Moving a column out of a window, is a fast way to get rid of columns you don't need.
Double-click on the line between two attributes in the heading to automatically resize a column to its optimal width.
-
Click on a column heading to toggle the sorting order from ascending to descending. You can establish a secondary sort order by pressing the SHIFT key while clicking on a column heading. Doing that you can, for example, sort your People files by company and within that order sort by contact name. See the above screenshot as an example. The secondary sort order is marked by a dotted line under the heading.
-
Editing these attributes is as simple as renaming a file: Either click on an entry or press ALT+E and move between the attibutes with TAB and SHIFT+TAB. ESC leaves the editing mode without applying the changes.
+
Click on a column heading to toggle the sorting order from ascending to descending. You can establish a secondary sort order by pressing the SHIFT key while clicking on a column heading. Doing that you can, for example, sort your People files by company and within that order sort by contact name. See the above screenshot as an example. The secondary sort order is marked by a dotted line under the heading.
+
Editing these attributes is as simple as renaming a file: Either click on an entry or press ALTE and move between the attibutes with TAB and SHIFTTAB. ESC leaves the editing mode without applying the changes.