From koki at haikuzone.net Wed Apr 1 00:44:00 2009 From: koki at haikuzone.net (Jorge G. Mare) Date: Tue, 31 Mar 2009 15:44:00 -0700 Subject: [Haiku-commits] r29815 - in haiku/trunk/src/apps: . charactermap In-Reply-To: <52877500018-BeMail@zon> References: <52877500018-BeMail@zon> Message-ID: <49D29CB0.6060207@haikuzone.net> Hi Axel, Axel D?rfler wrote: > "Jorge G. Mare" wrote: > >> This is very nice indeed! It would be nice if double-clicking a >> character would copy it to the clipboard; would be useful to get to >> those special characters that are not accessible from the keyboard. >> ;) >> > > Would Command-C and maybe a right-click menu for that work as well? I'm > not sure if double clicking isn't a bit weird to alter the clipboard. > I thought a double-click would be the fastest way, but you are right that it is a non-standard (and therefore an unintuitive) method of copying to the clipboard. A right-click menu would definitely work; but if you feel like it bloats the app (or you are not convinced about adding it for whatever reason), then Command-C alone should work just fine. Thanks! Jorge From bonefish at mail.berlios.de Wed Apr 1 02:11:35 2009 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Wed, 1 Apr 2009 02:11:35 +0200 Subject: [Haiku-commits] r29844 - haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse Message-ID: <200904010011.n310BZHu015278@sheep.berlios.de> Author: bonefish Date: 2009-04-01 02:11:34 +0200 (Wed, 01 Apr 2009) New Revision: 29844 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29844&view=rev Added: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/fuse_config.c haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/fuse_config.h Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/FUSEFileSystem.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/FUSEFileSystem.h haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/Jamfile haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/fuse_api.h haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/fuse_main.cpp Log: Parse the FUSE library options. They aren't used yet, though. Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/FUSEFileSystem.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/FUSEFileSystem.cpp 2009-03-31 21:48:56 UTC (rev 29843) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/FUSEFileSystem.cpp 2009-04-01 00:11:34 UTC (rev 29844) @@ -237,8 +237,8 @@ status_t -FUSEFileSystem::FinishInitClientFS(const fuse_operations* ops, size_t opSize, - void* userData) +FUSEFileSystem::FinishInitClientFS(fuse_config* config, + const fuse_operations* ops, size_t opSize, void* userData) { PRINT(("FUSEFileSystem::FinishInitClientFS()\n")); fExitStatus = B_ERROR; Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/FUSEFileSystem.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/FUSEFileSystem.h 2009-03-31 21:48:56 UTC (rev 29843) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/FUSEFileSystem.h 2009-04-01 00:11:34 UTC (rev 29844) @@ -10,6 +10,9 @@ #include "fuse_api.h" +struct fuse_config; + + namespace UserlandFS { class FUSEFileSystem : public FileSystem { @@ -38,8 +41,9 @@ status_t InitClientFS(const char* parameters); void ExitClientFS(status_t status); - status_t FinishInitClientFS(const fuse_operations* ops, - size_t opSize, void* userData); + status_t FinishInitClientFS(fuse_config* config, + const fuse_operations* ops, size_t opSize, + void* userData); private: class ArgumentVector; Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/Jamfile =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/Jamfile 2009-03-31 21:48:56 UTC (rev 29843) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/Jamfile 2009-04-01 00:11:34 UTC (rev 29844) @@ -21,6 +21,7 @@ # the library providing the FUSE interface for add-ons SharedLibrary libuserlandfs_fuse.so : + fuse_config.c fuse_fs.cpp fuse_main.cpp fuse_opt.c Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/fuse_api.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/fuse_api.h 2009-03-31 21:48:56 UTC (rev 29843) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/fuse_api.h 2009-04-01 00:11:34 UTC (rev 29844) @@ -9,5 +9,6 @@ #include #include +#include #endif // USERLAND_FS_FUSE_FUSE_API_H Added: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/fuse_config.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/fuse_config.c 2009-03-31 21:48:56 UTC (rev 29843) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/fuse_config.c 2009-04-01 00:11:34 UTC (rev 29844) @@ -0,0 +1,67 @@ +/* + FUSE: Filesystem in Userspace + Copyright (C) 2001-2007 Miklos Szeredi + + This program can be distributed under the terms of the GNU LGPLv2. + See the file COPYING.LIB +*/ + +#include "fuse_config.h" + + +enum { + KEY_HELP, +}; + +#define FUSE_LIB_OPT(t, p, v) { t, offsetof(struct fuse_config, p), v } + +static const struct fuse_opt fuse_lib_opts[] = { + FUSE_OPT_KEY("-h", KEY_HELP), + FUSE_OPT_KEY("--help", KEY_HELP), + FUSE_OPT_KEY("debug", FUSE_OPT_KEY_KEEP), + FUSE_OPT_KEY("-d", FUSE_OPT_KEY_KEEP), + FUSE_LIB_OPT("debug", debug, 1), + FUSE_LIB_OPT("-d", debug, 1), + FUSE_LIB_OPT("hard_remove", hard_remove, 1), + FUSE_LIB_OPT("use_ino", use_ino, 1), + FUSE_LIB_OPT("readdir_ino", readdir_ino, 1), + FUSE_LIB_OPT("direct_io", direct_io, 1), + FUSE_LIB_OPT("kernel_cache", kernel_cache, 1), + FUSE_LIB_OPT("auto_cache", auto_cache, 1), + FUSE_LIB_OPT("noauto_cache", auto_cache, 0), + FUSE_LIB_OPT("umask=", set_mode, 1), + FUSE_LIB_OPT("umask=%o", umask, 0), + FUSE_LIB_OPT("uid=", set_uid, 1), + FUSE_LIB_OPT("uid=%d", uid, 0), + FUSE_LIB_OPT("gid=", set_gid, 1), + FUSE_LIB_OPT("gid=%d", gid, 0), + FUSE_LIB_OPT("entry_timeout=%lf", entry_timeout, 0), + FUSE_LIB_OPT("attr_timeout=%lf", attr_timeout, 0), + FUSE_LIB_OPT("ac_attr_timeout=%lf", ac_attr_timeout, 0), + FUSE_LIB_OPT("ac_attr_timeout=", ac_attr_timeout_set, 1), + FUSE_LIB_OPT("negative_timeout=%lf", negative_timeout, 0), + FUSE_LIB_OPT("intr", intr, 1), + FUSE_LIB_OPT("intr_signal=%d", intr_signal, 0), + FUSE_LIB_OPT("modules=%s", modules, 0), + FUSE_OPT_END +}; + + +static int +fuse_lib_opt_proc(void *data, const char *arg, int key, + struct fuse_args *outargs) +{ + (void)data; + (void)arg; + (void)key; + (void)outargs; + + return 1; +} + + +int +fuse_parse_config_args(struct fuse_args* args, struct fuse_config* config) +{ + return fuse_opt_parse(args, config, fuse_lib_opts, fuse_lib_opt_proc) == 0; +} Added: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/fuse_config.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/fuse_config.h 2009-03-31 21:48:56 UTC (rev 29843) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/fuse_config.h 2009-04-01 00:11:34 UTC (rev 29844) @@ -0,0 +1,51 @@ +/* + FUSE: Filesystem in Userspace + Copyright (C) 2001-2007 Miklos Szeredi + + This program can be distributed under the terms of the GNU LGPLv2. + See the file COPYING.LIB +*/ +#ifndef USERLAND_FS_FUSE_CONFIG_H +#define USERLAND_FS_FUSE_CONFIG_H + +#include "fuse_api.h" + + +struct fuse_config { + unsigned int uid; + unsigned int gid; + unsigned int umask; + double entry_timeout; + double negative_timeout; + double attr_timeout; + double ac_attr_timeout; + int ac_attr_timeout_set; + int debug; + int hard_remove; + int use_ino; + int readdir_ino; + int set_mode; + int set_uid; + int set_gid; + int direct_io; + int kernel_cache; + int auto_cache; + int intr; + int intr_signal; + int help; + char *modules; +}; + + +#ifdef __cplusplus +extern "C" { +#endif + +int fuse_parse_config_args(struct fuse_args* args, struct fuse_config* config); + +#ifdef __cplusplus +} +#endif + + +#endif // USERLAND_FS_FUSE_CONFIG_H Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/fuse_main.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/fuse_main.cpp 2009-03-31 21:48:56 UTC (rev 29843) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/fuse_main.cpp 2009-04-01 00:11:34 UTC (rev 29844) @@ -8,6 +8,7 @@ #include #include "fuse_api.h" +#include "fuse_config.h" #include "FUSEFileSystem.h" @@ -18,10 +19,20 @@ printf("fuse_main_real(%d, %p, %p, %ld, %p)\n", argc, argv, op, opSize, userData); + // parse args + struct fuse_args args = FUSE_ARGS_INIT(argc, argv); + fuse_config config; + bool success = fuse_parse_config_args(&args, &config); + fuse_opt_free_args(&args); + + if (!success) + return 1; + // run the main loop - status_t error = FUSEFileSystem::GetInstance()->FinishInitClientFS(op, - opSize, userData); + status_t error = FUSEFileSystem::GetInstance()->FinishInitClientFS(&config, + op, opSize, userData); + return error == B_OK ? 0 : 1; } From koki at haikuzone.net Wed Apr 1 03:33:15 2009 From: koki at haikuzone.net (Jorge G. Mare) Date: Tue, 31 Mar 2009 18:33:15 -0700 Subject: [Haiku-commits] r29843 - in haiku/trunk/src/data/beos_mime: audio video In-Reply-To: <200903312148.n2VLmuQe027256@sheep.berlios.de> References: <200903312148.n2VLmuQe027256@sheep.berlios.de> Message-ID: <49D2C45B.7000805@haikuzone.net> dlmcpaul at BerliOS wrote: > Author: dlmcpaul > Date: 2009-03-31 23:48:56 +0200 (Tue, 31 Mar 2009) > New Revision: 29843 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29843&view=rev > > Modified: > haiku/trunk/src/data/beos_mime/audio/mp4 > haiku/trunk/src/data/beos_mime/video/mp4 > Log: > mp4 is video not audio, add m4v as a mpeg-4 extension > Nice one! Cheers, Jorge From fekdahl at gmail.com Wed Apr 1 07:00:04 2009 From: fekdahl at gmail.com (Fredrik Ekdahl) Date: Wed, 01 Apr 2009 07:00:04 +0200 Subject: [Haiku-commits] r29843 - in haiku/trunk/src/data/beos_mime: audio video In-Reply-To: <200903312148.n2VLmuQe027256@sheep.berlios.de> References: <200903312148.n2VLmuQe027256@sheep.berlios.de> Message-ID: <49D2F4D4.3080004@gmail.com> dlmcpaul at BerliOS skrev: > Author: dlmcpaul > Date: 2009-03-31 23:48:56 +0200 (Tue, 31 Mar 2009) > New Revision: 29843 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29843&view=rev > > Modified: > haiku/trunk/src/data/beos_mime/audio/mp4 > haiku/trunk/src/data/beos_mime/video/mp4 > Log: > mp4 is video not audio, add m4v as a mpeg-4 extension That's not true. MP4 files can be only audio, audio and video, only video, text etc. In fact it can contain any number of streams. See http://en.wikipedia.org/wiki/Mp4#.MP4_versus_.M4A_file_extensions and http://tools.ietf.org/html/rfc4337 The standard only specifies .mp4 and .mpg4 as extension for MP4 format, though since Apple started using m4a for audio only files this has become common practice. > Modified: haiku/trunk/src/data/beos_mime/audio/mp4 > =================================================================== > --- haiku/trunk/src/data/beos_mime/audio/mp4 2009-03-31 21:35:59 UTC (rev 29842) > +++ haiku/trunk/src/data/beos_mime/audio/mp4 2009-03-31 21:48:56 UTC (rev 29843) > @@ -8,7 +8,6 @@ > resource(3, "META:PREF_APP") #'MSIG' "application/x-vnd.Haiku-MediaPlayer"; > > resource(4, "META:EXTENS") message(234) { > - "extensions" = "mp4", > "extensions" = "m4a", > "type" = "audio/mp4" > }; > > Modified: haiku/trunk/src/data/beos_mime/video/mp4 > =================================================================== > --- haiku/trunk/src/data/beos_mime/video/mp4 2009-03-31 21:35:59 UTC (rev 29842) > +++ haiku/trunk/src/data/beos_mime/video/mp4 2009-03-31 21:48:56 UTC (rev 29843) > @@ -7,6 +7,7 @@ > > resource(3, "META:EXTENS") message(234) { > "extensions" = "mp4", > + "extensions" = "m4v", > "type" = "video/mp4" > }; m4v is a totally different thing than mp4. m4v indicates a raw bitstream, not encapsulated in MP4 format which .mp4 indicates. I think it's wrong to give m4v files the mime type video/mp4 as that mime type means it's the file format MP4. -- /Fredrik Ekdahl From dlmcpaul at gmail.com Wed Apr 1 07:16:12 2009 From: dlmcpaul at gmail.com (David McPaul) Date: Wed, 1 Apr 2009 16:16:12 +1100 Subject: [Haiku-commits] r29843 - in haiku/trunk/src/data/beos_mime: audio video In-Reply-To: <49D2F4D4.3080004@gmail.com> References: <200903312148.n2VLmuQe027256@sheep.berlios.de> <49D2F4D4.3080004@gmail.com> Message-ID: On 2009-04-01, Fredrik Ekdahl wrote: > dlmcpaul at BerliOS skrev: > > Author: dlmcpaul > > Date: 2009-03-31 23:48:56 +0200 (Tue, 31 Mar 2009) > > New Revision: 29843 > > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29843&view=rev > > > > Modified: > > haiku/trunk/src/data/beos_mime/audio/mp4 > > haiku/trunk/src/data/beos_mime/video/mp4 > > Log: > > mp4 is video not audio, add m4v as a mpeg-4 extension > > That's not true. MP4 files can be only audio, audio and video, only > video, text etc. In fact it can contain any number of streams. Yep. > See http://en.wikipedia.org/wiki/Mp4#.MP4_versus_.M4A_file_extensions > and http://tools.ietf.org/html/rfc4337 > The standard only specifies .mp4 and .mpg4 as extension for MP4 format, > though since Apple started using m4a for audio only files this has > become common practice. And this is where the problem begins. A mime type for audio/mp4 was added listing .m4a and .mp4 as valid extensions. So when I copied a .mp4 file onto my haiku partition it would be identified as audio/mp4 and shown the audio icon. The same extension was defined as video/mp4 which was a duplication and did not work. So I have removed .mp4 from audio/mp4 but have left .m4a since the common practice of Apple is to reserve that extension for audio only mp4 files. I have added .m4v to video/mp4 because I am seeing many files with that extension. These files are clearly mp4 files (they contain video and audio) but ultimately they are still video/mp4 and even if they were raw streams they are still raw mp4 video streams. Anyway we can remove the audio/mp4 mime and the extension .m4v from the video/mp4 mime type to conform to the standard but we will need an alternative to handle the non standard extensions .m4a and .m4v > m4v is a totally different thing than mp4. m4v indicates a raw > bitstream, not encapsulated in MP4 format which .mp4 indicates. > I think it's wrong to give m4v files the mime type video/mp4 as that > mime type means it's the file format MP4. Wrong yes. Alternative?? -- Cheers David From axeld at pinc-software.de Wed Apr 1 10:14:47 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Wed, 01 Apr 2009 10:14:47 +0200 CEST Subject: [Haiku-commits] r29841 - haiku/trunk/src/kits/interface In-Reply-To: <200903312135.n2VLZ4l6026392@sheep.berlios.de> Message-ID: <830938429-BeMail@zon> stippi at mail.berlios.de wrote: > Modified: > haiku/trunk/src/kits/interface/ColumnListView.cpp > Log: > Puh... big coding style cleanup. I probably missed a few issues > too... but > should be much better now. There was like three different styles > before. Not to belittle your work, but I really hope to get rid of this class in the future :-) Bye, Axel. From axeld at pinc-software.de Wed Apr 1 10:15:51 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Wed, 01 Apr 2009 10:15:51 +0200 CEST Subject: [Haiku-commits] =?utf-8?q?r29838_-_haiku/trunk/src/add-ons/media/?= =?utf-8?q?plugins/avcodec/libavcodec?= In-Reply-To: Message-ID: <894729303-BeMail@zon> David McPaul wrote: > 2009/4/1 Fran?ois Revol : > >> Log: > >> performance improvements > > Sure this will builds with gcc2 ??? > It should do, thats what I use here under BeOS. > > I also have the MMX stuff building as well but the resulting object > file does not load under haiku :-( You might want to file a bug report for this, along with the binaries to reproduce the problem. Bye, Axel. From fredrik at modeen.se Wed Apr 1 10:16:44 2009 From: fredrik at modeen.se (Fredrik =?utf-8?Q?Mod=C3=A8en?=) Date: Wed, 1 Apr 2009 10:16:44 +0200 (CEST) Subject: [Haiku-commits] r29841 - haiku/trunk/src/kits/interface In-Reply-To: <830938429-BeMail@zon> References: <830938429-BeMail@zon> Message-ID: <1d1ff6e4963ad056f6ee4e41a758e802.squirrel@webmail2.webbhotellsgruppen.se> > stippi at mail.berlios.de wrote: >> Modified: >> haiku/trunk/src/kits/interface/ColumnListView.cpp >> Log: >> Puh... big coding style cleanup. I probably missed a few issues >> too... but >> should be much better now. There was like three different styles >> before. > > Not to belittle your work, but I really hope to get rid of this class > in the future :-) How come? replaced with other class? I'm using it as it has a nicer look than other list classes. > > Bye, > Axel. > > _______________________________________________ > Haiku-commits mailing list > Haiku-commits at lists.berlios.de > https://lists.berlios.de/mailman/listinfo/haiku-commits > -- MVH Fredrik Mod?en From superstippi at gmx.de Wed Apr 1 10:43:18 2009 From: superstippi at gmx.de (Stephan Assmus) Date: Wed, 01 Apr 2009 10:43:18 +0200 Subject: [Haiku-commits] r29841 - haiku/trunk/src/kits/interface In-Reply-To: <1d1ff6e4963ad056f6ee4e41a758e802.squirrel@webmail2.webbhotells gruppen.se> References: <830938429-BeMail@zon> <1d1ff6e4963ad056f6ee4e41a758e802.squirrel@webmail2.webbhotellsgruppen.se> Message-ID: <20090401104318.2447.3@bepc.1238570199.fake> On 2009-04-01 at 10:39:01 [+0200], Fredrik Mod?en wrote: > > > stippi at mail.berlios.de wrote: > >> Modified: > >> haiku/trunk/src/kits/interface/ColumnListView.cpp > >> Log: > >> Puh... big coding style cleanup. I probably missed a few issues too... > >> but > >> should be much better now. There was like three different styles > >> before. > > > > Not to belittle your work, but I really hope to get rid of this class > > in the future :-) > How come? replaced with other class? > I'm using it as it has a nicer look than other list classes. For this more complex Interface Kit class, one should really be able to use the Model-View-Controller pattern. Ingo has written such a tree view implementation a years ago for eXposer, but it's not yet complete. For the time being, I wanted to add layout features to the BColumnListView and improve the look. It's being used in a couple of panels already. Sometimes I enjoy such dull tasks where I don't have to think too much... :-) Best regards, -Stephan From dlmcpaul at gmail.com Wed Apr 1 11:02:46 2009 From: dlmcpaul at gmail.com (David McPaul) Date: Wed, 1 Apr 2009 20:02:46 +1100 Subject: [Haiku-commits] r29838 - haiku/trunk/src/add-ons/media/plugins/avcodec/libavcodec In-Reply-To: <894729303-BeMail@zon> References: <894729303-BeMail@zon> Message-ID: 2009/4/1 Axel D?rfler : > David McPaul wrote: >> 2009/4/1 Fran?ois Revol : >> >> Log: >> >> performance improvements >> > Sure this will builds with gcc2 ??? >> It should do, thats what I use here under BeOS. >> >> I also have the MMX stuff building as well but the resulting object >> file does not load under haiku :-( > > You might want to file a bug report for this, along with the binaries > to reproduce the problem. Once I work out if it is my fault or not. -- Cheers David From axeld at pinc-software.de Wed Apr 1 11:15:34 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Wed, 01 Apr 2009 11:15:34 +0200 CEST Subject: [Haiku-commits] r29841 - haiku/trunk/src/kits/interface In-Reply-To: <1d1ff6e4963ad056f6ee4e41a758e802.squirrel@webmail2.webbhotellsgruppen.se> Message-ID: <4477518225-BeMail@zon> Fredrik Mod?en wrote: > > stippi at mail.berlios.de wrote: > >> Modified: > >> haiku/trunk/src/kits/interface/ColumnListView.cpp > > Not to belittle your work, but I really hope to get rid of this > > class > > in the future :-) > How come? replaced with other class? > I'm using it as it has a nicer look than other list classes. It just has an awful design (not visually, the code is what matters) that does neither match the way one wants to to have, nor the usual Be interface kit style. Bye, Axel. From stippi at mail.berlios.de Wed Apr 1 11:28:35 2009 From: stippi at mail.berlios.de (stippi at mail.berlios.de) Date: Wed, 1 Apr 2009 11:28:35 +0200 Subject: [Haiku-commits] r29845 - haiku/trunk/src/kits/tracker Message-ID: <200904010928.n319SZXl014686@sheep.berlios.de> Author: stippi Date: 2009-04-01 11:28:32 +0200 (Wed, 01 Apr 2009) New Revision: 29845 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29845&view=rev Modified: haiku/trunk/src/kits/tracker/Model.cpp haiku/trunk/src/kits/tracker/Utilities.h haiku/trunk/src/kits/tracker/WidgetAttributeText.cpp Log: Patch by plasm with some modifications by myself: Implement natural sorting in Tracker. Strings are compared in chunks where the type of each chunk can be numer or string. Thanks a lot! Modified: haiku/trunk/src/kits/tracker/Model.cpp =================================================================== --- haiku/trunk/src/kits/tracker/Model.cpp 2009-04-01 00:11:34 UTC (rev 29844) +++ haiku/trunk/src/kits/tracker/Model.cpp 2009-04-01 09:28:32 UTC (rev 29845) @@ -321,7 +321,7 @@ } else if (resolvedCompareModel->IsDirectory()) return 1; - return strcasecmp(Name(), compareModel->Name()); + return NaturalCompare(Name(), compareModel->Name()); } Modified: haiku/trunk/src/kits/tracker/Utilities.h =================================================================== --- haiku/trunk/src/kits/tracker/Utilities.h 2009-04-01 00:11:34 UTC (rev 29844) +++ haiku/trunk/src/kits/tracker/Utilities.h 2009-04-01 09:28:32 UTC (rev 29845) @@ -136,6 +136,7 @@ BPoint fLocation; }; + // extends PoseInfo adding workspace support; used for desktop // poses only class ExtendedPoseInfo { @@ -176,8 +177,144 @@ void DisallowMetaKeys(BTextView *); void DisallowFilenameKeys(BTextView *); + +inline bool +IsDigit(const char c) +{ + if ((c >= 48 && c <= 57) || c == 32) + return true; + else + return false; +} + + +//! Compares two strings naturally, as opposed to lexicographically +inline int +NaturalCompare(const char *s1, const char *s2) +{ + struct Chunk { + int32 type; + char* ascii; + // Type = 0 + int32 num; + // Type = 1 + }; + + Chunk a; + Chunk b; + + size_t len1 = strlen(s1); + size_t len2 = strlen(s2); + + char bufferA[len1 + 1]; + char bufferB[len2 + 1]; + + uint32 i = 0; + uint32 j = 0; + + while (true) { + // determine type of next chunks in each string based on first char + if (i == len1) + a.type = -1; + else if (IsDigit(s1[i])) + a.type = 1; + else + a.type = 0; + + if (j == len2) + b.type = -1; + else if (IsDigit(s2[j])) + b.type = 1; + else + b.type = 0; + + // check if we reached the end of either string + if (a.type == b.type && a.type == -1) + return 0; + if (a.type == -1) + return -1; + if (b.type == -1) + return 1; + + if (a.type != b.type) { + // different chunk types, just compare the remaining strings + return strcasecmp(&s1[i], &s2[j]); + } + + // fetch the next chunk for a + if (a.type == 0) { + // string chunk + int32 k = i; + while (!IsDigit(s1[k]) && s1[k] != 0) { + bufferA[k - i] = s1[k]; + k++; + } + bufferA[k - i] = 0; + a.ascii = bufferA; + i += k - i; + } else { + // number chunk + int32 k = i; + while (IsDigit(s1[k]) && s1[k] != 0) { + bufferA[k - i] = s1[k]; + k++; + } + bufferA[k - i] = 0; + a.ascii = bufferA; + a.num = atoi(bufferA); + i += k - i; + } + + // fetch the next chunk for b + if (b.type == 0) { + // string chunk + int32 k = j; + while (!IsDigit(s2[k]) && s2[k] != 0) { + bufferB[k - j] = s2[k]; + k++; + } + bufferB[k - j] = 0; + b.ascii = bufferB; + j += k - j; + } else { + // number chunk + int32 k = j; + while (IsDigit(s2[k]) && s2[k] != 0) { + bufferB[k - j] = s2[k]; + k++; + } + bufferB[k - j] = 0; + b.ascii = bufferB; + b.num = atoi(bufferB); + j += k - j; + } + + // compare the two chunks based on their type + if (a.type == 0) { + // string chunks + int stringCompareResult = strcasecmp(a.ascii, b.ascii); + // if the chunk strings are the same, keep using natural + // sorting for the next chunks + if (stringCompareResult != 0) + return stringCompareResult; + } else { + // number chunks + if (a.num != b.num) { + if (a.num < b.num) + return -1; + if (a.num > b.num) + return 1; + } + } + } + + return 0; +} + + bool ValidateStream(BMallocIO *, uint32, int32 version); + uint32 HashString(const char *string, uint32 seed); uint32 AttrHashString(const char *string, uint32 type); Modified: haiku/trunk/src/kits/tracker/WidgetAttributeText.cpp =================================================================== --- haiku/trunk/src/kits/tracker/WidgetAttributeText.cpp 2009-04-01 00:11:34 UTC (rev 29844) +++ haiku/trunk/src/kits/tracker/WidgetAttributeText.cpp 2009-04-01 09:28:32 UTC (rev 29845) @@ -63,7 +63,6 @@ const int32 kGenericReadBufferSize = 1024; - template float TruncStringBase(BString *result, const char *str, int32 length, @@ -595,7 +594,7 @@ if (fValueDirty) ReadValue(&fFullValueText); - return strcasecmp(fFullValueText.String(), compareTo->ValueAsText(view)); + return NaturalCompare(fFullValueText.String(), compareTo->ValueAsText(view)); } @@ -782,7 +781,7 @@ if (NameAttributeText::sSortFolderNamesFirst) return fModel->CompareFolderNamesFirst(attr.TargetModel()); - return strcasecmp(fFullValueText.String(), compareTo->ValueAsText(view)); + return NaturalCompare(fFullValueText.String(), compareTo->ValueAsText(view)); } From fekdahl at gmail.com Wed Apr 1 11:43:59 2009 From: fekdahl at gmail.com (Fredrik Ekdahl) Date: Wed, 01 Apr 2009 11:43:59 +0200 Subject: [Haiku-commits] r29843 - in haiku/trunk/src/data/beos_mime: audio video In-Reply-To: References: <200903312148.n2VLmuQe027256@sheep.berlios.de> <49D2F4D4.3080004@gmail.com> Message-ID: <49D3375F.2040102@gmail.com> David McPaul skrev: > On 2009-04-01, Fredrik Ekdahl wrote: >> dlmcpaul at BerliOS skrev: >>> Author: dlmcpaul >>> Date: 2009-03-31 23:48:56 +0200 (Tue, 31 Mar 2009) >>> New Revision: 29843 >>> ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29843&view=rev >>> >>> Modified: >>> haiku/trunk/src/data/beos_mime/audio/mp4 >>> haiku/trunk/src/data/beos_mime/video/mp4 >>> Log: >>> mp4 is video not audio, add m4v as a mpeg-4 extension >> That's not true. MP4 files can be only audio, audio and video, only >> video, text etc. In fact it can contain any number of streams. > > Yep. > >> See http://en.wikipedia.org/wiki/Mp4#.MP4_versus_.M4A_file_extensions >> and http://tools.ietf.org/html/rfc4337 >> The standard only specifies .mp4 and .mpg4 as extension for MP4 format, >> though since Apple started using m4a for audio only files this has >> become common practice. > > And this is where the problem begins. > > A mime type for audio/mp4 was added listing .m4a and .mp4 as valid > extensions. So when I copied a .mp4 file onto my haiku partition it > would be identified as audio/mp4 and shown the audio icon. > > The same extension was defined as video/mp4 which was a duplication > and did not work. > > So I have removed .mp4 from audio/mp4 but have left .m4a since the > common practice of Apple is to reserve that extension for audio only > mp4 files. > > I have added .m4v to video/mp4 because I am seeing many files with > that extension. These files are clearly mp4 files (they contain video > and audio) but ultimately they are still video/mp4 and even if they > were raw streams they are still raw mp4 video streams. > > Anyway we can remove the audio/mp4 mime and the extension .m4v from > the video/mp4 mime type to conform to the standard but we will need an > alternative to handle the non standard extensions .m4a and .m4v > No reason to remove audio/mp4, as that is an IANA standard. After a bit of thought, I think your approach is the most convenient. Files with mp4 extension are most often videos, so having that extension in the video mime type and not in audio sounds like a good compromise. I suppose a sniffer rule which differentiates between the different types would be too complex, right? >> m4v is a totally different thing than mp4. m4v indicates a raw >> bitstream, not encapsulated in MP4 format which .mp4 indicates. >> I think it's wrong to give m4v files the mime type video/mp4 as that >> mime type means it's the file format MP4. > > Wrong yes. Alternative?? Seems Apple started this also. So .m4v can mean both raw video streams and MP4 format files. -- /Fredrik Ekdahl From stippi at mail.berlios.de Wed Apr 1 12:28:36 2009 From: stippi at mail.berlios.de (stippi at mail.berlios.de) Date: Wed, 1 Apr 2009 12:28:36 +0200 Subject: [Haiku-commits] r29846 - haiku/trunk/src/tests/servers/app/playground Message-ID: <200904011028.n31ASaog021045@sheep.berlios.de> Author: stippi Date: 2009-04-01 12:28:34 +0200 (Wed, 01 Apr 2009) New Revision: 29846 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29846&view=rev Modified: haiku/trunk/src/tests/servers/app/playground/ObjectWindow.cpp haiku/trunk/src/tests/servers/app/playground/ObjectWindow.h haiku/trunk/src/tests/servers/app/playground/main.cpp Log: Patch by maxime.simon: Make Playground use a BColorControl instead of those text controls for defining the color. Thanks a lot! (Also took the opportunity to fix some coding style violations which had already been there.) Modified: haiku/trunk/src/tests/servers/app/playground/ObjectWindow.cpp =================================================================== --- haiku/trunk/src/tests/servers/app/playground/ObjectWindow.cpp 2009-04-01 09:28:32 UTC (rev 29845) +++ haiku/trunk/src/tests/servers/app/playground/ObjectWindow.cpp 2009-04-01 10:28:34 UTC (rev 29846) @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -116,18 +117,8 @@ // constructor ObjectWindow::ObjectWindow(BRect frame, const char* name) -// : BWindow(frame, name, B_TITLED_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL, -// B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE) : BWindow(frame, name, B_DOCUMENT_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL, B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE) -// : BWindow(frame, name, B_DOCUMENT_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL, -// B_ASYNCHRONOUS_CONTROLS) -// : BWindow(frame, name, B_FLOATING_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL, -// B_ASYNCHRONOUS_CONTROLS) -// : BWindow(frame, name, B_BORDERED_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL, -// B_ASYNCHRONOUS_CONTROLS) -// : BWindow(frame, name, B_NO_BORDER_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL, -// B_ASYNCHRONOUS_CONTROLS) { BRect b(Bounds()); @@ -147,7 +138,8 @@ b = Bounds(); b.top = menuBar->Bounds().bottom + 1; b.right = ceilf((b.left + b.right) / 2.0); - BBox* bg = new BBox(b, "bg box", B_FOLLOW_TOP_BOTTOM, B_WILL_DRAW, B_PLAIN_BORDER); + BBox* bg = new BBox(b, "bg box", B_FOLLOW_TOP_BOTTOM, B_WILL_DRAW, + B_PLAIN_BORDER); AddChild(bg); bg->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); @@ -160,44 +152,36 @@ B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE); // wrap a scroll view around the object view BScrollView* scrollView = new BScrollView("object scroller", fObjectView, - B_FOLLOW_ALL, 0, true, true, - B_NO_BORDER); + B_FOLLOW_ALL, 0, true, true, B_NO_BORDER); if (BScrollBar* scrollBar = fObjectView->ScrollBar(B_VERTICAL)) { scrollBar->SetRange(0.0, fObjectView->Bounds().Height()); scrollBar->SetProportion(0.5); -// scrollBar->SetRange(0.0, 0.0); } if (BScrollBar* scrollBar = fObjectView->ScrollBar(B_HORIZONTAL)) { scrollBar->SetRange(0.0, fObjectView->Bounds().Width()); scrollBar->SetProportion(0.5); -// scrollBar->SetRange(0.0, 0.0); -// b = scrollBar->Frame(); -// b.right = b.left + 50; -// scrollBar->ResizeBy(-51, 0); -// scrollBar->MoveBy(51, 0); -// StatusView* statusView = new StatusView(b, scrollBar); -// scrollView->AddChild(statusView); } AddChild(scrollView); b = bg->Bounds(); // controls occupy the left side of the window b.InsetBy(5.0, 5.0); - BBox* controlGroup = new BBox(b, "controls box", B_FOLLOW_LEFT | B_FOLLOW_TOP_BOTTOM, - B_WILL_DRAW, B_FANCY_BORDER); + BBox* controlGroup = new BBox(b, "controls box", + B_FOLLOW_LEFT | B_FOLLOW_TOP_BOTTOM, B_WILL_DRAW, B_FANCY_BORDER); controlGroup->SetLabel("Controls"); bg->AddChild(controlGroup); b = controlGroup->Bounds(); - b.top += 10.0; + b.top += controlGroup->InnerFrame().top; b.bottom = b.top + 25.0; - b.InsetBy(5.0, 5.0); - b.right = b.left + b.Width() / 2.0 - 3.0; + b.InsetBy(10.0, 10.0); + b.right = b.left + b.Width() / 2.0 - 5.0; // new button - fNewB = new BButton(b, "new button", "New Object", new BMessage(MSG_NEW_OBJECT)); + fNewB = new BButton(b, "new button", "New Object", + new BMessage(MSG_NEW_OBJECT)); controlGroup->AddChild(fNewB); SetDefaultButton(fNewB); @@ -285,63 +269,46 @@ item->SetMarked(true); popupMenu->AddItem(item); - b.OffsetBy(0, radioButton->Bounds().Height() + 5.0); - fDrawingModeMF = new BMenuField(b, "drawing mode field", "Mode", - popupMenu); + b.OffsetBy(0, radioButton->Bounds().Height() + 10.0); + fDrawingModeMF = new BMenuField(b, "drawing mode field", "Mode:", + popupMenu); controlGroup->AddChild(fDrawingModeMF); - fDrawingModeMF->SetDivider(fDrawingModeMF->StringWidth(fDrawingModeMF->Label()) + 10.0); - - // red text control - b.OffsetBy(0, fDrawingModeMF->Bounds().Height() + 5.0); - fRedTC = new BTextControl(b, "red text control", "Red", "", - new BMessage(MSG_SET_COLOR)); - controlGroup->AddChild(fRedTC); - - // green text control - b.OffsetBy(0, fRedTC->Bounds().Height() + 5.0); - fGreenTC = new BTextControl(b, "green text control", "Green", "", - new BMessage(MSG_SET_COLOR)); - controlGroup->AddChild(fGreenTC); - - // blue text control - b.OffsetBy(0, fGreenTC->Bounds().Height() + 5.0); - fBlueTC = new BTextControl(b, "blue text control", "Blue", "", - new BMessage(MSG_SET_COLOR)); - controlGroup->AddChild(fBlueTC); - + fDrawingModeMF->SetDivider(fDrawingModeMF->StringWidth( + fDrawingModeMF->Label()) + 10.0); + + // color control + b.OffsetBy(0, fDrawingModeMF->Bounds().Height() + 10.0); + fColorControl = new BColorControl(b.LeftTop(), B_CELLS_16x16, 8, + "color control", new BMessage(MSG_SET_COLOR)); + controlGroup->AddChild(fColorControl); + // alpha text control - b.OffsetBy(0, fBlueTC->Bounds().Height() + 5.0); - fAlphaTC = new BTextControl(b, "alpha text control", "Alpha", "", - new BMessage(MSG_SET_COLOR)); + b.OffsetBy(0, fColorControl-> Bounds().Height() + 5.0); + fAlphaTC = new BTextControl(b, "alpha text control", "Alpha:", "", + new BMessage(MSG_SET_COLOR)); controlGroup->AddChild(fAlphaTC); // divide text controls the same - float mWidth = fDrawingModeMF->StringWidth(fDrawingModeMF->Label()); - float rWidth = fRedTC->StringWidth(fRedTC->Label()); - float gWidth = fGreenTC->StringWidth(fGreenTC->Label()); - float bWidth = fBlueTC->StringWidth(fBlueTC->Label()); - float aWidth = fAlphaTC->StringWidth(fAlphaTC->Label()); - - float width = max_c(mWidth, max_c(rWidth, max_c(gWidth, max_c(bWidth, aWidth)))) + 10.0; + float mWidth = fDrawingModeMF->StringWidth(fDrawingModeMF->Label()); + float aWidth = fAlphaTC->StringWidth(fAlphaTC->Label()); + + float width = max_c(mWidth, aWidth) + 20.0; fDrawingModeMF->SetDivider(width); - fRedTC->SetDivider(width); - fGreenTC->SetDivider(width); - fBlueTC->SetDivider(width); fAlphaTC->SetDivider(width); // fill check box b.OffsetBy(0, fAlphaTC->Bounds().Height() + 5.0); fFillCB = new BCheckBox(b, "fill check box", "Fill", - new BMessage(MSG_SET_FILL_OR_STROKE)); + new BMessage(MSG_SET_FILL_OR_STROKE)); controlGroup->AddChild(fFillCB); // pen size text control b.OffsetBy(0, radioButton->Bounds().Height() + 5.0); b.bottom = b.top + 10.0;//35; - fPenSizeS = new BSlider(b, "width slider", "Width", - NULL, 1, 100, B_TRIANGLE_THUMB); + fPenSizeS = new BSlider(b, "width slider", "Width:", NULL, 1, 100, + B_TRIANGLE_THUMB); fPenSizeS->SetLimitLabels("1", "100"); fPenSizeS->SetModificationMessage(new BMessage(MSG_SET_PEN_SIZE)); fPenSizeS->SetHashMarks(B_HASH_MARKS_BOTTOM); @@ -351,42 +318,24 @@ // list view with objects b = controlGroup->Bounds(); - b.top += 10.0; - b.InsetBy(9.0, 7.0); + b.top += controlGroup->InnerFrame().top; + b.InsetBy(10.0, 10.0); b.left = b.left + b.Width() / 2.0 + 6.0; b.right -= B_V_SCROLL_BAR_WIDTH; -b.bottom = fDrawingModeMF->Frame().top - 5.0; + b.bottom = fDrawingModeMF->Frame().top - 10.0; fObjectLV = new ObjectListView(b, "object list", B_SINGLE_SELECTION_LIST); fObjectLV->SetSelectionMessage(new BMessage(MSG_OBJECT_SELECTED)); // wrap a scroll view around the list view scrollView = new BScrollView("list scroller", fObjectLV, - B_FOLLOW_NONE, 0, false, true, - B_FANCY_BORDER); + B_FOLLOW_NONE, 0, false, true, B_FANCY_BORDER); controlGroup->AddChild(scrollView); - // add a dummy tab view - b.top = b.bottom + 10.0; - b.right += B_V_SCROLL_BAR_WIDTH; - b.bottom = controlGroup->Bounds().bottom - 7.0; - BTabView* tabView = new BTabView(b, "tab view", B_WIDTH_FROM_WIDEST, - B_FOLLOW_ALL, B_FULL_UPDATE_ON_RESIZE | - B_WILL_DRAW | B_NAVIGABLE_JUMP | - B_FRAME_EVENTS | B_NAVIGABLE); - - BView* tabChild = new TestView(BRect(0, 0, 40, 40), "T", B_FOLLOW_ALL, 0); - tabView->AddTab(tabChild); - tabChild = new TestView(BRect(0, 0, 40, 40), "T", B_FOLLOW_ALL, 0); - tabView->AddTab(tabChild); - tabChild = new BTextControl(BRect(0, 0, 80, 40), "T", "Test", "Text", NULL); - tabView->AddTab(tabChild); - controlGroup->AddChild(tabView); - // enforce some size limits float minWidth = controlGroup->Frame().Width() + 30.0; - float minHeight = fPenSizeS->Frame().bottom + - menuBar->Bounds().Height() + 15.0; + float minHeight = fPenSizeS->Frame().bottom + + menuBar->Bounds().Height() + 15.0; float maxWidth = minWidth * 4.0; float maxHeight = minHeight + 100; SetSizeLimits(minWidth, maxWidth, minHeight, maxHeight); @@ -520,17 +469,10 @@ rgb_color c = fObjectView->StateColor(); char string[32]; - sprintf(string, "%d", c.red); - fRedTC->SetText(string); - - sprintf(string, "%d", c.green); - fGreenTC->SetText(string); - - sprintf(string, "%d", c.blue); - fBlueTC->SetText(string); - sprintf(string, "%d", c.alpha); fAlphaTC->SetText(string); + + fColorControl->SetValue(c); } // _GetColor @@ -538,11 +480,10 @@ ObjectWindow::_GetColor() const { rgb_color c; - c.red = max_c(0, min_c(255, atoi(fRedTC->Text()))); - c.green = max_c(0, min_c(255, atoi(fGreenTC->Text()))); - c.blue = max_c(0, min_c(255, atoi(fBlueTC->Text()))); - c.alpha = max_c(0, min_c(255, atoi(fAlphaTC->Text()))); - + + c = fColorControl->ValueAsColor(); + c.alpha = max_c(0, min_c(255, atoi(fAlphaTC->Text()))); + return c; } Modified: haiku/trunk/src/tests/servers/app/playground/ObjectWindow.h =================================================================== --- haiku/trunk/src/tests/servers/app/playground/ObjectWindow.h 2009-04-01 09:28:32 UTC (rev 29845) +++ haiku/trunk/src/tests/servers/app/playground/ObjectWindow.h 2009-04-01 10:28:34 UTC (rev 29846) @@ -7,6 +7,7 @@ class BButton; class BCheckBox; +class BColorControl; class BListView; class BMenuField; class BTextControl; @@ -37,9 +38,7 @@ BMenuField* fDrawingModeMF; - BTextControl* fRedTC; - BTextControl* fGreenTC; - BTextControl* fBlueTC; + BColorControl* fColorControl; BTextControl* fAlphaTC; BCheckBox* fFillCB; Modified: haiku/trunk/src/tests/servers/app/playground/main.cpp =================================================================== --- haiku/trunk/src/tests/servers/app/playground/main.cpp 2009-04-01 09:28:32 UTC (rev 29845) +++ haiku/trunk/src/tests/servers/app/playground/main.cpp 2009-04-01 10:28:34 UTC (rev 29846) @@ -10,7 +10,7 @@ int main(int argc, char** argv) { - BApplication* app = new BApplication("application/x.vnd-Haiku.Playground"); + BApplication* app = new BApplication("application/x-vnd.Haiku-Playground"); BRect frame(50.0, 50.0, 600.0, 400.0); BWindow* window = new ObjectWindow(frame, "Playground"); From dlmcpaul at gmail.com Wed Apr 1 13:42:32 2009 From: dlmcpaul at gmail.com (David McPaul) Date: Wed, 1 Apr 2009 22:42:32 +1100 Subject: [Haiku-commits] r29843 - in haiku/trunk/src/data/beos_mime: audio video In-Reply-To: <49D3375F.2040102@gmail.com> References: <200903312148.n2VLmuQe027256@sheep.berlios.de> <49D2F4D4.3080004@gmail.com> <49D3375F.2040102@gmail.com> Message-ID: 2009/4/1 Fredrik Ekdahl : > David McPaul skrev: >> Anyway we can remove the audio/mp4 mime and the extension .m4v from >> the video/mp4 mime type to conform to the standard but we will need an >> alternative to handle the non standard extensions .m4a and .m4v > > No reason to remove audio/mp4, as that is an IANA standard. > After a bit of thought, I think your approach is the most convenient. > Files with mp4 extension are most often videos, so having that extension > in the video mime type and not in audio sounds like a good compromise. > I suppose a sniffer rule which differentiates between the different > types would be too complex, right? Maybe. A raw stream should not have the ftyp atom which appears early in a mp4. But apple decided to put them in MOV files now as well so it is actually difficult figure out mp4 from MOV without parsing the ftyp. But it would help with determining actual container formats from raw just not mp4 from mov. -- Cheers David From stippi at mail.berlios.de Wed Apr 1 14:33:46 2009 From: stippi at mail.berlios.de (stippi at mail.berlios.de) Date: Wed, 1 Apr 2009 14:33:46 +0200 Subject: [Haiku-commits] r29847 - haiku/trunk/src/kits/interface Message-ID: <200904011233.n31CXkS0008335@sheep.berlios.de> Author: stippi Date: 2009-04-01 14:33:45 +0200 (Wed, 01 Apr 2009) New Revision: 29847 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29847&view=rev Modified: haiku/trunk/src/kits/interface/ScrollView.cpp Log: * B_SUPPORTS_LAYOUT is already added by the BView consturctor. * Fixed MaxSize() and PreferredSize() to use the correct explicitly set size. Modified: haiku/trunk/src/kits/interface/ScrollView.cpp =================================================================== --- haiku/trunk/src/kits/interface/ScrollView.cpp 2009-04-01 10:28:34 UTC (rev 29846) +++ haiku/trunk/src/kits/interface/ScrollView.cpp 2009-04-01 12:33:45 UTC (rev 29847) @@ -31,7 +31,7 @@ BScrollView::BScrollView(const char* name, BView* target, uint32 flags, bool horizontal, bool vertical, border_style border) - : BView(name, _ModifyFlags(flags, border) | B_SUPPORTS_LAYOUT), + : BView(name, _ModifyFlags(flags, border)), fTarget(target), fBorder(border) { @@ -753,7 +753,7 @@ BSize size = _ComputeSize(fTarget != NULL ? fTarget->MaxSize() : BSize(B_SIZE_UNLIMITED, B_SIZE_UNLIMITED)); - return BLayoutUtils::ComposeSize(ExplicitMinSize(), size); + return BLayoutUtils::ComposeSize(ExplicitMaxSize(), size); } @@ -763,7 +763,7 @@ BSize size = _ComputeSize(fTarget != NULL ? fTarget->PreferredSize() : BSize(32, 32)); - return BLayoutUtils::ComposeSize(ExplicitMinSize(), size); + return BLayoutUtils::ComposeSize(ExplicitPreferredSize(), size); } From stippi at mail.berlios.de Wed Apr 1 14:35:09 2009 From: stippi at mail.berlios.de (stippi at mail.berlios.de) Date: Wed, 1 Apr 2009 14:35:09 +0200 Subject: [Haiku-commits] r29848 - in haiku/trunk: headers/private/interface src/kits/interface Message-ID: <200904011235.n31CZ9OM008439@sheep.berlios.de> Author: stippi Date: 2009-04-01 14:35:06 +0200 (Wed, 01 Apr 2009) New Revision: 29848 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29848&view=rev Modified: haiku/trunk/headers/private/interface/ColumnListView.h haiku/trunk/src/kits/interface/ColumnListView.cpp Log: Make BColumnListView layout-friendly. Modified: haiku/trunk/headers/private/interface/ColumnListView.h =================================================================== --- haiku/trunk/headers/private/interface/ColumnListView.h 2009-04-01 12:33:45 UTC (rev 29847) +++ haiku/trunk/headers/private/interface/ColumnListView.h 2009-04-01 12:35:06 UTC (rev 29848) @@ -247,6 +247,9 @@ const char* name, uint32 resizingMode, uint32 flags, border_style = B_NO_BORDER, bool showHorizontalScrollbar = true); + BColumnListView(const char* name, + uint32 flags, border_style = B_NO_BORDER, + bool showHorizontalScrollbar = true); virtual ~BColumnListView(); // Interaction @@ -370,8 +373,20 @@ virtual void WindowActivated(bool active); virtual void Draw(BRect updateRect); + virtual BSize MinSize(); + virtual BSize PreferredSize(); + virtual BSize MaxSize(); + + virtual void InvalidateLayout(bool descendants = false); + virtual void DoLayout(); + private: void _Init(bool showHorizontalScrollbar); + void _GetChildViewRects(const BRect& bounds, + bool showHorizontalScrollBar, + BRect& titleRect, BRect& outlineRect, + BRect& vScrollBarRect, + BRect& hScrollBarRect); rgb_color fColorList[B_COLOR_TOTAL]; BPrivate::TitleView* fTitleView; Modified: haiku/trunk/src/kits/interface/ColumnListView.cpp =================================================================== --- haiku/trunk/src/kits/interface/ColumnListView.cpp 2009-04-01 12:33:45 UTC (rev 29847) +++ haiku/trunk/src/kits/interface/ColumnListView.cpp 2009-04-01 12:35:06 UTC (rev 29848) @@ -55,6 +55,7 @@ #include #include #include +#include #include #include #include @@ -767,8 +768,8 @@ : BView(rect, name, resizingMode, flags | B_WILL_DRAW | B_FRAME_EVENTS | B_FULL_UPDATE_ON_RESIZE), - fStatusView(0), - fSelectionMessage(0), + fStatusView(NULL), + fSelectionMessage(NULL), fSortingEnabled(true), fLatchWidth(kLatchWidth), fBorderStyle(border) @@ -777,6 +778,20 @@ } +BColumnListView::BColumnListView(const char* name, uint32 flags, + border_style border, bool showHorizontalScrollbar) + : + BView(name, flags | B_WILL_DRAW | B_FRAME_EVENTS | B_FULL_UPDATE_ON_RESIZE), + fStatusView(NULL), + fSelectionMessage(NULL), + fSortingEnabled(true), + fLatchWidth(kLatchWidth), + fBorderStyle(border) +{ + _Init(showHorizontalScrollbar); +} + + BColumnListView::~BColumnListView() { while (BColumn* column = (BColumn*)fColumns.RemoveItem(0L)) @@ -1772,6 +1787,176 @@ } +BSize +BColumnListView::MinSize() +{ + BSize size; + size.width = 100; + size.height = kTitleHeight + 3 * ceilf(be_plain_font->Size()); + if (!fHorizontalScrollBar->IsHidden()) + size.height += fHorizontalScrollBar->Frame().Height() + 1; + // TODO: Take border size into account + + return BLayoutUtils::ComposeSize(ExplicitMinSize(), size); +} + + +BSize +BColumnListView::PreferredSize() +{ + BSize size = MinSize(); + size.height += ceilf(be_plain_font->Size()) * 20; + // TODO: size.width = entire width of title view (all columns) + + return BLayoutUtils::ComposeSize(ExplicitPreferredSize(), size); +} + + +BSize +BColumnListView::MaxSize() +{ + BSize size(B_SIZE_UNLIMITED, B_SIZE_UNLIMITED); + return BLayoutUtils::ComposeSize(ExplicitMaxSize(), size); +} + + +void +BColumnListView::InvalidateLayout(bool descendants) +{ + BView::InvalidateLayout(descendants); +} + + +void +BColumnListView::DoLayout() +{ + if (!(Flags() & B_SUPPORTS_LAYOUT)) + return; + + BRect titleRect; + BRect outlineRect; + BRect vScrollBarRect; + BRect hScrollBarRect; + _GetChildViewRects(Bounds(), !fHorizontalScrollBar->IsHidden(), + titleRect, outlineRect, vScrollBarRect, hScrollBarRect); + + fTitleView->MoveTo(titleRect.LeftTop()); + fTitleView->ResizeTo(titleRect.Width(), titleRect.Height()); + + fOutlineView->MoveTo(outlineRect.LeftTop()); + fOutlineView->ResizeTo(outlineRect.Width(), outlineRect.Height()); + + fVerticalScrollBar->MoveTo(vScrollBarRect.LeftTop()); + fVerticalScrollBar->ResizeTo(vScrollBarRect.Width(), + vScrollBarRect.Height()); + + fHorizontalScrollBar->MoveTo(hScrollBarRect.LeftTop()); + fHorizontalScrollBar->ResizeTo(hScrollBarRect.Width(), + hScrollBarRect.Height()); + + fOutlineView->FixScrollBar(true); +} + + +void +BColumnListView::_Init(bool showHorizontalScrollbar) +{ + SetViewColor(B_TRANSPARENT_32_BIT); + + BRect bounds(Bounds()); + if (bounds.Width() <= 0) + bounds.right = 100; + if (bounds.Height() <= 0) + bounds.bottom = 100; + + for (int i = 0; i < (int)B_COLOR_TOTAL; i++) + fColorList[i] = kColor[i]; + + BRect titleRect; + BRect outlineRect; + BRect vScrollBarRect; + BRect hScrollBarRect; + _GetChildViewRects(bounds, showHorizontalScrollbar, titleRect, outlineRect, + vScrollBarRect, hScrollBarRect); + + fOutlineView = new OutlineView(outlineRect, &fColumns, &fSortColumns, this); + AddChild(fOutlineView); + + + fTitleView = new TitleView(titleRect, fOutlineView, &fColumns, + &fSortColumns, this, B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP); + AddChild(fTitleView); + + fVerticalScrollBar = new BScrollBar(vScrollBarRect, "vertical_scroll_bar", + fOutlineView, 0.0, bounds.Height(), B_VERTICAL); + AddChild(fVerticalScrollBar); + + fHorizontalScrollBar = new BScrollBar(hScrollBarRect, + "horizontal_scroll_bar", fTitleView, 0.0, bounds.Width(), B_HORIZONTAL); + AddChild(fHorizontalScrollBar); + + if (!showHorizontalScrollbar) + fHorizontalScrollBar->Hide(); + + fOutlineView->FixScrollBar(true); +} + + +void +BColumnListView::_GetChildViewRects(const BRect& bounds, + bool showHorizontalScrollbar, BRect& titleRect, BRect& outlineRect, + BRect& vScrollBarRect, BRect& hScrollBarRect) +{ + titleRect = bounds; + titleRect.bottom = titleRect.top + kTitleHeight; +#if !LOWER_SCROLLBAR + titleRect.right -= B_V_SCROLL_BAR_WIDTH + 1; +#endif + + outlineRect = bounds; + outlineRect.top = titleRect.bottom + 1.0; + outlineRect.right -= B_V_SCROLL_BAR_WIDTH + 1; + if (showHorizontalScrollbar) + outlineRect.bottom -= B_H_SCROLL_BAR_HEIGHT + 1; + + vScrollBarRect = bounds; +#if LOWER_SCROLLBAR + vScrollBarRect.top += kTitleHeight; +#endif + + vScrollBarRect.left = vScrollBarRect.right - B_V_SCROLL_BAR_WIDTH; + if (showHorizontalScrollbar) + vScrollBarRect.bottom -= B_H_SCROLL_BAR_HEIGHT; + + hScrollBarRect = bounds; + hScrollBarRect.top = hScrollBarRect.bottom - B_H_SCROLL_BAR_HEIGHT; + hScrollBarRect.right -= B_V_SCROLL_BAR_WIDTH; + + // Adjust stuff so the border will fit. + if (fBorderStyle == B_PLAIN_BORDER) { + titleRect.InsetBy(1, 0); + titleRect.top++; + outlineRect.InsetBy(1, 0); + outlineRect.bottom--; + + vScrollBarRect.OffsetBy(-1, 0); + vScrollBarRect.InsetBy(0, 1); + hScrollBarRect.OffsetBy(0, -1); + hScrollBarRect.InsetBy(1, 0); + } else if (fBorderStyle == B_FANCY_BORDER) { + titleRect.InsetBy(2, 0); + titleRect.top += 2; + outlineRect.InsetBy(2, 0); + outlineRect.bottom -= 2; + + vScrollBarRect.OffsetBy(-2, 0); + vScrollBarRect.InsetBy(0, 2); + hScrollBarRect.OffsetBy(0, -2); + hScrollBarRect.InsetBy(2, 0); + } +} + + // #pragma mark - @@ -4553,83 +4738,3 @@ } -void -BColumnListView::_Init(bool showHorizontalScrollbar) -{ - SetViewColor(B_TRANSPARENT_32_BIT); - - BRect bounds(Bounds()); - - for (int i = 0; i < (int)B_COLOR_TOTAL; i++) - fColorList[i] = kColor[i]; - - BRect titleRect(bounds); - titleRect.bottom = titleRect.top + kTitleHeight; -#if !LOWER_SCROLLBAR - titleRect.right -= B_V_SCROLL_BAR_WIDTH + 1; -#endif - - BRect outlineRect(bounds); - outlineRect.top = titleRect.bottom + 1.0; - outlineRect.right -= B_V_SCROLL_BAR_WIDTH + 1; - if (showHorizontalScrollbar) - outlineRect.bottom -= B_H_SCROLL_BAR_HEIGHT + 1; - - BRect vScrollBarRect(bounds); -#if LOWER_SCROLLBAR - vScrollBarRect.top += kTitleHeight; -#endif - - vScrollBarRect.left = vScrollBarRect.right - B_V_SCROLL_BAR_WIDTH; - if (showHorizontalScrollbar) - vScrollBarRect.bottom -= B_H_SCROLL_BAR_HEIGHT; - - BRect hScrollBarRect(bounds); - hScrollBarRect.top = hScrollBarRect.bottom - B_H_SCROLL_BAR_HEIGHT; - hScrollBarRect.right -= B_V_SCROLL_BAR_WIDTH; - - // Adjust stuff so the border will fit. - if (fBorderStyle == B_PLAIN_BORDER) { - titleRect.InsetBy(1, 0); - titleRect.top++; - outlineRect.InsetBy(1, 0); - outlineRect.bottom--; - - vScrollBarRect.OffsetBy(-1, 0); - vScrollBarRect.InsetBy(0, 1); - hScrollBarRect.OffsetBy(0, -1); - hScrollBarRect.InsetBy(1, 0); - } else if (fBorderStyle == B_FANCY_BORDER) { - titleRect.InsetBy(2, 0); - titleRect.top += 2; - outlineRect.InsetBy(2, 0); - outlineRect.bottom -= 2; - - vScrollBarRect.OffsetBy(-2, 0); - vScrollBarRect.InsetBy(0, 2); - hScrollBarRect.OffsetBy(0, -2); - hScrollBarRect.InsetBy(2, 0); - } - - fOutlineView = new OutlineView(outlineRect, &fColumns, &fSortColumns, this); - AddChild(fOutlineView); - - - fTitleView = new TitleView(titleRect, fOutlineView, &fColumns, - &fSortColumns, this, B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP); - AddChild(fTitleView); - - fVerticalScrollBar = new BScrollBar(vScrollBarRect, "vertical_scroll_bar", - fOutlineView, 0.0, bounds.Height(), B_VERTICAL); - AddChild(fVerticalScrollBar); - - fHorizontalScrollBar = new BScrollBar(hScrollBarRect, - "horizontal_scroll_bar", fTitleView, 0.0, bounds.Width(), B_HORIZONTAL); - AddChild(fHorizontalScrollBar); - - if (!showHorizontalScrollbar) - fHorizontalScrollBar->Hide(); - - fOutlineView->FixScrollBar(true); -} - From stippi at mail.berlios.de Wed Apr 1 14:39:47 2009 From: stippi at mail.berlios.de (stippi at mail.berlios.de) Date: Wed, 1 Apr 2009 14:39:47 +0200 Subject: [Haiku-commits] r29849 - in haiku/trunk: headers/os/interface src/kits/interface Message-ID: <200904011239.n31CdleX008944@sheep.berlios.de> Author: stippi Date: 2009-04-01 14:39:44 +0200 (Wed, 01 Apr 2009) New Revision: 29849 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29849&view=rev Modified: haiku/trunk/headers/os/interface/Region.h haiku/trunk/src/kits/interface/Region.cpp Log: Patch by Brecht Machiels: Add operator==() to BRegion. Thanks a lot! Also fixed some coding style inconsistency. Modified: haiku/trunk/headers/os/interface/Region.h =================================================================== --- haiku/trunk/headers/os/interface/Region.h 2009-04-01 12:35:06 UTC (rev 29848) +++ haiku/trunk/headers/os/interface/Region.h 2009-04-01 12:39:44 UTC (rev 29849) @@ -31,7 +31,8 @@ BRegion(const BRect rect); virtual ~BRegion(); - BRegion &operator=(const BRegion &from); + BRegion& operator=(const BRegion& from); + bool operator==(const BRegion& other) const; void Set(BRect newBounds); void Set(clipping_rect newBounds); Modified: haiku/trunk/src/kits/interface/Region.cpp =================================================================== --- haiku/trunk/src/kits/interface/Region.cpp 2009-04-01 12:35:06 UTC (rev 29848) +++ haiku/trunk/src/kits/interface/Region.cpp 2009-04-01 12:39:44 UTC (rev 29849) @@ -26,10 +26,11 @@ and its fBounds will be invalid. */ BRegion::BRegion() - : fCount(0) - , fDataSize(0) - , fBounds((clipping_rect){ 0, 0, 0, 0 }) - , fData(NULL) + : + fCount(0), + fDataSize(0), + fBounds((clipping_rect){ 0, 0, 0, 0 }), + fData(NULL) { _SetSize(kDataBlockSize); } @@ -39,10 +40,11 @@ \param region The region to copy. */ BRegion::BRegion(const BRegion& region) - : fCount(0) - , fDataSize(0) - , fBounds((clipping_rect){ 0, 0, 0, 0 }) - , fData(NULL) + : + fCount(0), + fDataSize(0), + fBounds((clipping_rect){ 0, 0, 0, 0 }), + fData(NULL) { *this = region; } @@ -52,10 +54,11 @@ \param rect The BRect to set the region to. */ BRegion::BRegion(const BRect rect) - : fCount(0) - , fDataSize(1) - , fBounds((clipping_rect){ 0, 0, 0, 0 }) - , fData(&fBounds) + : + fCount(0), + fDataSize(1), + fBounds((clipping_rect){ 0, 0, 0, 0 }), + fData(&fBounds) { if (!rect.IsValid()) return; @@ -94,7 +97,7 @@ \param region the BRegion to copy. \return This function always returns \c *this. */ -BRegion & +BRegion& BRegion::operator=(const BRegion ®ion) { if (®ion == this) @@ -112,6 +115,21 @@ return *this; } +/*! \brief Compares this region to another (by value). + \param other the BRegion to compare to. + \return \ctrue if the two regions are the same, \cfalse otherwise. +*/ +bool +BRegion::operator==(const BRegion& other) const +{ + if (&other == this) + return true; + + if (fCount != other.fCount) + return false; + + return memcmp(fData, other.fData, fCount * sizeof(clipping_rect)) == 0; +} /*! \brief Set the region to contain just the given BRect. \param newBounds A BRect. From axeld at pinc-software.de Wed Apr 1 15:33:24 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Wed, 01 Apr 2009 15:33:24 +0200 CEST Subject: [Haiku-commits] =?utf-8?q?r29849_-_in_haiku/trunk=3A_headers/os/i?= =?utf-8?q?nterface_src/kits/interface?= In-Reply-To: <200904011239.n31CdleX008944@sheep.berlios.de> Message-ID: <19947173113-BeMail@zon> stippi at mail.berlios.de wrote: > } > > +/*! \brief Compares this region to another (by value). > + \param other the BRegion to compare to. > + \return \ctrue if the two regions are the same, \cfalse otherwise. > +*/ > +bool > +BRegion::operator==(const BRegion& other) const > +{ > + if (&other == this) > + return true; > + > + if (fCount != other.fCount) > + return false; > + > + return memcmp(fData, other.fData, fCount * sizeof(clipping_rect)) = > = 0; > +} > > /*! \brief Set the region to contain just the given BRect. Two spaces between functions. That was even the example I used when pointing out the coding style violations in the answer to his first patch... :-) Bye, Axel. From axeld at pinc-software.de Wed Apr 1 15:34:06 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Wed, 01 Apr 2009 15:34:06 +0200 CEST Subject: [Haiku-commits] r29847 - haiku/trunk/src/kits/interface In-Reply-To: <200904011233.n31CXkS0008335@sheep.berlios.de> Message-ID: <19989391771-BeMail@zon> stippi at mail.berlios.de wrote: > Log: > * B_SUPPORTS_LAYOUT is already added by the BView consturctor. > * Fixed MaxSize() and PreferredSize() to use the correct explicitly > set size. Oops, thanks! The powers of copy and paste... Bye, Axel. From axeld at mail.berlios.de Wed Apr 1 16:04:41 2009 From: axeld at mail.berlios.de (axeld at mail.berlios.de) Date: Wed, 1 Apr 2009 16:04:41 +0200 Subject: [Haiku-commits] r29850 - haiku/trunk/src/data/etc/keymaps Message-ID: <200904011404.n31E4fli018558@sheep.berlios.de> Author: axeld Date: 2009-04-01 16:04:32 +0200 (Wed, 01 Apr 2009) New Revision: 29850 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29850&view=rev Added: haiku/trunk/src/data/etc/keymaps/Arabic (102).keymap haiku/trunk/src/data/etc/keymaps/Brazilian (ABNT2).keymap haiku/trunk/src/data/etc/keymaps/Bulgarian (Cyrillic).keymap haiku/trunk/src/data/etc/keymaps/French (Mac).keymap haiku/trunk/src/data/etc/keymaps/Lithuanian (Baltic).keymap haiku/trunk/src/data/etc/keymaps/Polish (programmer's).keymap haiku/trunk/src/data/etc/keymaps/Serbian (Cyrillic).keymap haiku/trunk/src/data/etc/keymaps/Serbian (Latin).keymap haiku/trunk/src/data/etc/keymaps/Spanish (Dvorak).keymap haiku/trunk/src/data/etc/keymaps/Turkish (Type-F).keymap haiku/trunk/src/data/etc/keymaps/Turkish (Type-Q).keymap Removed: haiku/trunk/src/data/etc/keymaps/Arabic(102).keymap haiku/trunk/src/data/etc/keymaps/Brazilian(ABNT2).keymap haiku/trunk/src/data/etc/keymaps/Bulgarian(Cyrillic).keymap haiku/trunk/src/data/etc/keymaps/French(Mac).keymap haiku/trunk/src/data/etc/keymaps/Lithuanian(Baltic).keymap haiku/trunk/src/data/etc/keymaps/Polish(programmer's).keymap haiku/trunk/src/data/etc/keymaps/Serbian(Cyrillic).keymap haiku/trunk/src/data/etc/keymaps/Serbian(Latin).keymap haiku/trunk/src/data/etc/keymaps/Spanish(Dvorak).keymap haiku/trunk/src/data/etc/keymaps/Turkish(type-F).keymap haiku/trunk/src/data/etc/keymaps/Turkish(type-Q).keymap Log: * Keymap names can have spaces, and so they do now (a must even, since they are directly presented to the user this way). Copied: haiku/trunk/src/data/etc/keymaps/Arabic (102).keymap (from rev 29849, haiku/trunk/src/data/etc/keymaps/Arabic(102).keymap) Property changes on: haiku/trunk/src/data/etc/keymaps/Arabic (102).keymap ___________________________________________________________________ Name: svn:keywords + author date id revision Name: svn:mergeinfo + Name: svn:eol-style + native Deleted: haiku/trunk/src/data/etc/keymaps/Arabic(102).keymap Copied: haiku/trunk/src/data/etc/keymaps/Brazilian (ABNT2).keymap (from rev 29849, haiku/trunk/src/data/etc/keymaps/Brazilian(ABNT2).keymap) Property changes on: haiku/trunk/src/data/etc/keymaps/Brazilian (ABNT2).keymap ___________________________________________________________________ Name: svn:mergeinfo + Deleted: haiku/trunk/src/data/etc/keymaps/Brazilian(ABNT2).keymap Copied: haiku/trunk/src/data/etc/keymaps/Bulgarian (Cyrillic).keymap (from rev 29849, haiku/trunk/src/data/etc/keymaps/Bulgarian(Cyrillic).keymap) Property changes on: haiku/trunk/src/data/etc/keymaps/Bulgarian (Cyrillic).keymap ___________________________________________________________________ Name: svn:keywords + author date id revision Name: svn:mergeinfo + Name: svn:eol-style + native Deleted: haiku/trunk/src/data/etc/keymaps/Bulgarian(Cyrillic).keymap Copied: haiku/trunk/src/data/etc/keymaps/French (Mac).keymap (from rev 29849, haiku/trunk/src/data/etc/keymaps/French(Mac).keymap) Property changes on: haiku/trunk/src/data/etc/keymaps/French (Mac).keymap ___________________________________________________________________ Name: svn:mergeinfo + Deleted: haiku/trunk/src/data/etc/keymaps/French(Mac).keymap Copied: haiku/trunk/src/data/etc/keymaps/Lithuanian (Baltic).keymap (from rev 29849, haiku/trunk/src/data/etc/keymaps/Lithuanian(Baltic).keymap) Property changes on: haiku/trunk/src/data/etc/keymaps/Lithuanian (Baltic).keymap ___________________________________________________________________ Name: svn:keywords + author date id revision Name: svn:mergeinfo + Name: svn:eol-style + native Deleted: haiku/trunk/src/data/etc/keymaps/Lithuanian(Baltic).keymap Copied: haiku/trunk/src/data/etc/keymaps/Polish (programmer's).keymap (from rev 29849, haiku/trunk/src/data/etc/keymaps/Polish(programmer's).keymap) Property changes on: haiku/trunk/src/data/etc/keymaps/Polish (programmer's).keymap ___________________________________________________________________ Name: svn:mergeinfo + Deleted: haiku/trunk/src/data/etc/keymaps/Polish(programmer's).keymap Copied: haiku/trunk/src/data/etc/keymaps/Serbian (Cyrillic).keymap (from rev 29849, haiku/trunk/src/data/etc/keymaps/Serbian(Cyrillic).keymap) Property changes on: haiku/trunk/src/data/etc/keymaps/Serbian (Cyrillic).keymap ___________________________________________________________________ Name: svn:keywords + author date id revision Name: svn:mergeinfo + Name: svn:eol-style + native Copied: haiku/trunk/src/data/etc/keymaps/Serbian (Latin).keymap (from rev 29849, haiku/trunk/src/data/etc/keymaps/Serbian(Latin).keymap) Property changes on: haiku/trunk/src/data/etc/keymaps/Serbian (Latin).keymap ___________________________________________________________________ Name: svn:keywords + author date id revision Name: svn:mergeinfo + Name: svn:eol-style + native Deleted: haiku/trunk/src/data/etc/keymaps/Serbian(Cyrillic).keymap Deleted: haiku/trunk/src/data/etc/keymaps/Serbian(Latin).keymap Copied: haiku/trunk/src/data/etc/keymaps/Spanish (Dvorak).keymap (from rev 29849, haiku/trunk/src/data/etc/keymaps/Spanish(Dvorak).keymap) Property changes on: haiku/trunk/src/data/etc/keymaps/Spanish (Dvorak).keymap ___________________________________________________________________ Name: svn:mergeinfo + Deleted: haiku/trunk/src/data/etc/keymaps/Spanish(Dvorak).keymap Copied: haiku/trunk/src/data/etc/keymaps/Turkish (Type-F).keymap (from rev 29849, haiku/trunk/src/data/etc/keymaps/Turkish(type-F).keymap) Property changes on: haiku/trunk/src/data/etc/keymaps/Turkish (Type-F).keymap ___________________________________________________________________ Name: svn:keywords + author date id revision Name: svn:mergeinfo + Name: svn:eol-style + native Copied: haiku/trunk/src/data/etc/keymaps/Turkish (Type-Q).keymap (from rev 29849, haiku/trunk/src/data/etc/keymaps/Turkish(type-Q).keymap) Property changes on: haiku/trunk/src/data/etc/keymaps/Turkish (Type-Q).keymap ___________________________________________________________________ Name: svn:keywords + author date id revision Name: svn:mergeinfo + Name: svn:eol-style + native Deleted: haiku/trunk/src/data/etc/keymaps/Turkish(type-F).keymap Deleted: haiku/trunk/src/data/etc/keymaps/Turkish(type-Q).keymap From axeld at mail.berlios.de Wed Apr 1 17:47:31 2009 From: axeld at mail.berlios.de (axeld at mail.berlios.de) Date: Wed, 1 Apr 2009 17:47:31 +0200 Subject: [Haiku-commits] r29851 - haiku/trunk/src/preferences/keymap Message-ID: <200904011547.n31FlVj4029698@sheep.berlios.de> Author: axeld Date: 2009-04-01 17:47:30 +0200 (Wed, 01 Apr 2009) New Revision: 29851 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29851&view=rev Modified: haiku/trunk/src/preferences/keymap/KeyboardLayoutView.cpp haiku/trunk/src/preferences/keymap/KeymapWindow.cpp Log: * Now accepts only the first character that is dropped on a key. * Also, escaped strings (like those from CharacterMap) are now converted automatically. Modified: haiku/trunk/src/preferences/keymap/KeyboardLayoutView.cpp =================================================================== --- haiku/trunk/src/preferences/keymap/KeyboardLayoutView.cpp 2009-04-01 14:04:32 UTC (rev 29850) +++ haiku/trunk/src/preferences/keymap/KeyboardLayoutView.cpp 2009-04-01 15:47:30 UTC (rev 29851) @@ -6,6 +6,7 @@ #include "KeyboardLayoutView.h" +#include #include #include #include @@ -303,10 +304,41 @@ ssize_t size; if (message->FindData("text/plain", B_MIME_DATA, (const void**)&data, &size) == B_OK) { - // ignore trailing null bytes - if (data[size - 1] == '\0') - size--; + // Automatically convert UTF-8 escaped strings (for example from + // CharacterMap) + int32 dataSize = 0; + uint8 buffer[16]; + if (size > 3 && data[0] == '\\' && data[1] == 'x') { + char tempBuffer[16]; + if (size > 15) + size = 15; + memcpy(tempBuffer, data, size); + tempBuffer[size] = '\0'; + data = tempBuffer; + while (size > 3 && data[0] == '\\' && data[1] == 'x') { + buffer[dataSize++] = strtoul(&data[2], NULL, 16); + if ((buffer[dataSize - 1] & 0x80) == 0) + break; + + size -= 4; + data += 4; + } + data = (const char*)buffer; + } else if ((data[0] & 0xc0) != 0x80 && (data[0] & 0x80) != 0) { + // only accept the first character UTF-8 character + while (dataSize < size && (data[dataSize] & 0x80) != 0) { + dataSize++; + } + } else if ((data[0] & 0x80) == 0) { + // an ASCII character + dataSize = 1; + } else { + // no valid character + beep(); + return; + } + int32 buttons; if (!message->IsSourceRemote() && message->FindInt32("buttons", &buttons) == B_OK @@ -325,7 +357,7 @@ if (string != NULL) { // switch keys fKeymap->SetKey(fDropTarget->code, fModifiers, fDeadKey, - (const char*)data, size); + (const char*)data, dataSize); fKeymap->SetKey(key->code, fDragModifiers, fDeadKey, string, numBytes); delete[] string; @@ -334,14 +366,14 @@ fKeymap->SetModifier(key->code, fKeymap->Modifier(fDropTarget->code)); fKeymap->SetKey(fDropTarget->code, fModifiers, fDeadKey, - (const char*)data, size); + (const char*)data, dataSize); } } else { // Send the old key to the target, so it's not lost entirely _SendFakeKeyDown(fDropTarget); fKeymap->SetKey(fDropTarget->code, fModifiers, fDeadKey, - (const char*)data, size); + (const char*)data, dataSize); } } else if (!message->IsSourceRemote() && message->FindInt32("key", &keyCode) == B_OK) { Modified: haiku/trunk/src/preferences/keymap/KeymapWindow.cpp =================================================================== --- haiku/trunk/src/preferences/keymap/KeymapWindow.cpp 2009-04-01 14:04:32 UTC (rev 29850) +++ haiku/trunk/src/preferences/keymap/KeymapWindow.cpp 2009-04-01 15:47:30 UTC (rev 29851) @@ -191,9 +191,6 @@ break; } - case B_MIME_DATA: - break; - case B_SAVE_REQUESTED: { entry_ref ref; From axeld at mail.berlios.de Wed Apr 1 17:53:54 2009 From: axeld at mail.berlios.de (axeld at mail.berlios.de) Date: Wed, 1 Apr 2009 17:53:54 +0200 Subject: [Haiku-commits] r29852 - haiku/trunk/src/apps/charactermap Message-ID: <200904011553.n31FrsKN030026@sheep.berlios.de> Author: axeld Date: 2009-04-01 17:53:53 +0200 (Wed, 01 Apr 2009) New Revision: 29852 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29852&view=rev Modified: haiku/trunk/src/apps/charactermap/CharacterView.cpp haiku/trunk/src/apps/charactermap/CharacterView.h haiku/trunk/src/apps/charactermap/CharacterWindow.cpp Log: * Added support for copying characters into the clipboard via Command-C, and a popup menu. Modified: haiku/trunk/src/apps/charactermap/CharacterView.cpp =================================================================== --- haiku/trunk/src/apps/charactermap/CharacterView.cpp 2009-04-01 15:47:30 UTC (rev 29851) +++ haiku/trunk/src/apps/charactermap/CharacterView.cpp 2009-04-01 15:53:53 UTC (rev 29852) @@ -10,12 +10,19 @@ #include #include +#include #include +#include +#include #include +#include #include "UnicodeBlocks.h" +static const uint32 kMsgCopyAsEscapedString = 'cesc'; + + CharacterView::CharacterView(const char* name) : BView(name, B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE | B_FRAME_EVENTS), fTargetCommand(0), @@ -151,8 +158,42 @@ void +CharacterView::MessageReceived(BMessage* message) +{ + switch (message->what) { + case kMsgCopyAsEscapedString: + case B_COPY: + { + uint32 character; + if (message->FindInt32("character", (int32*)&character) != B_OK) { + if (!fHasCharacter) + break; + + character = fCurrentCharacter; + } + + char text[16]; + if (message->what == kMsgCopyAsEscapedString) + UnicodeToUTF8Hex(character, text, sizeof(text)); + else + UnicodeToUTF8(character, text, sizeof(text)); + + _CopyToClipboard(text); + break; + } + + default: + BView::MessageReceived(message); + break; + } +} + + +void CharacterView::AttachedToWindow() { + Window()->AddShortcut('C', B_SHIFT_KEY, + new BMessage(kMsgCopyAsEscapedString), this); } @@ -180,7 +221,34 @@ void CharacterView::MouseDown(BPoint where) { - fClickPoint = where; + int32 buttons; + if (!fHasCharacter + || Window()->CurrentMessage() == NULL + || Window()->CurrentMessage()->FindInt32("buttons", &buttons) != B_OK + || (buttons & B_SECONDARY_MOUSE_BUTTON) == 0) { + // Memorize click point for dragging + fClickPoint = where; + return; + } + + // Open pop-up menu + + BPopUpMenu *menu = new BPopUpMenu(B_EMPTY_STRING, false, false); + menu->SetFont(be_plain_font); + + BMessage* message = new BMessage(B_COPY); + message->AddInt32("character", fCurrentCharacter); + menu->AddItem(new BMenuItem("Copy Character", message, 'C')); + + message = new BMessage(kMsgCopyAsEscapedString); + message->AddInt32("character", fCurrentCharacter); + menu->AddItem(new BMenuItem("Copy As Escaped Byte String", + message, 'C', B_SHIFT_KEY)); + + menu->SetTargetForItems(this); + + ConvertToScreen(&where); + menu->Go(where, true, true, true); } @@ -404,7 +472,7 @@ font_height fontHeight; GetFontHeight(&fontHeight); fTitleHeight = (int32)ceilf(fontHeight.ascent + fontHeight.descent - + fontHeight.leading); + + fontHeight.leading) + 2; fTitleBase = (int32)ceilf(fontHeight.ascent); // Find widest character @@ -468,3 +536,21 @@ Invalidate(); } + + +void +CharacterView::_CopyToClipboard(const char* text) +{ + if (!be_clipboard->Lock()) + return; + + be_clipboard->Clear(); + + BMessage* clip = be_clipboard->Data(); + if (clip != NULL) { + clip->AddData("text/plain", B_MIME_TYPE, text, strlen(text)); + be_clipboard->Commit(); + } + + be_clipboard->Unlock(); +} Modified: haiku/trunk/src/apps/charactermap/CharacterView.h =================================================================== --- haiku/trunk/src/apps/charactermap/CharacterView.h 2009-04-01 15:47:30 UTC (rev 29851) +++ haiku/trunk/src/apps/charactermap/CharacterView.h 2009-04-01 15:53:53 UTC (rev 29852) @@ -38,6 +38,8 @@ size_t textSize); protected: + virtual void MessageReceived(BMessage* message); + virtual void AttachedToWindow(); virtual void DetachedFromWindow(); @@ -58,6 +60,7 @@ bool _GetCharacterAt(BPoint point, uint32& character, BRect* _frame = NULL); void _UpdateSize(); + void _CopyToClipboard(const char* text); private: BMessenger fTarget; Modified: haiku/trunk/src/apps/charactermap/CharacterWindow.cpp =================================================================== --- haiku/trunk/src/apps/charactermap/CharacterWindow.cpp 2009-04-01 15:47:30 UTC (rev 29851) +++ haiku/trunk/src/apps/charactermap/CharacterWindow.cpp 2009-04-01 15:53:53 UTC (rev 29852) @@ -181,6 +181,10 @@ CharacterWindow::MessageReceived(BMessage* message) { switch (message->what) { + case B_COPY: + PostMessage(message, fCharacterView); + break; + case kMsgUnicodeBlockSelected: { int32 index; From stippi at mail.berlios.de Wed Apr 1 18:02:09 2009 From: stippi at mail.berlios.de (stippi at mail.berlios.de) Date: Wed, 1 Apr 2009 18:02:09 +0200 Subject: [Haiku-commits] r29853 - haiku/trunk/src/kits/interface Message-ID: <200904011602.n31G29Zc031055@sheep.berlios.de> Author: stippi Date: 2009-04-01 18:02:08 +0200 (Wed, 01 Apr 2009) New Revision: 29853 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29853&view=rev Modified: haiku/trunk/src/kits/interface/Region.cpp Log: Fixed a few more coding style issues, thanks Axel! Modified: haiku/trunk/src/kits/interface/Region.cpp =================================================================== --- haiku/trunk/src/kits/interface/Region.cpp 2009-04-01 15:53:53 UTC (rev 29852) +++ haiku/trunk/src/kits/interface/Region.cpp 2009-04-01 16:02:08 UTC (rev 29853) @@ -98,7 +98,7 @@ \return This function always returns \c *this. */ BRegion& -BRegion::operator=(const BRegion ®ion) +BRegion::operator=(const BRegion& region) { if (®ion == this) return *this; @@ -115,6 +115,7 @@ return *this; } + /*! \brief Compares this region to another (by value). \param other the BRegion to compare to. \return \ctrue if the two regions are the same, \cfalse otherwise. @@ -131,6 +132,7 @@ return memcmp(fData, other.fData, fCount * sizeof(clipping_rect)) == 0; } + /*! \brief Set the region to contain just the given BRect. \param newBounds A BRect. */ From stippi at mail.berlios.de Wed Apr 1 19:55:05 2009 From: stippi at mail.berlios.de (stippi at mail.berlios.de) Date: Wed, 1 Apr 2009 19:55:05 +0200 Subject: [Haiku-commits] r29854 - haiku/trunk/src/apps/bootman Message-ID: <200904011755.n31Ht5pm018315@sheep.berlios.de> Author: stippi Date: 2009-04-01 19:55:04 +0200 (Wed, 01 Apr 2009) New Revision: 29854 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29854&view=rev Modified: haiku/trunk/src/apps/bootman/BootManagerWindow.cpp Log: As Michael correctly pointed out, there is no reason for the window to be not resizable, since it will even nicely relayout itself on size changes. Some pages can be resized too small, but anyways, that can be improved. Modified: haiku/trunk/src/apps/bootman/BootManagerWindow.cpp =================================================================== --- haiku/trunk/src/apps/bootman/BootManagerWindow.cpp 2009-04-01 16:02:08 UTC (rev 29853) +++ haiku/trunk/src/apps/bootman/BootManagerWindow.cpp 2009-04-01 17:55:04 UTC (rev 29854) @@ -22,7 +22,7 @@ BootManagerWindow::BootManagerWindow() : BWindow(BRect(100, 100, 500, 400), "Boot Manager", B_TITLED_WINDOW, - B_ASYNCHRONOUS_CONTROLS | B_NOT_RESIZABLE | B_NOT_ZOOMABLE) + B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE) { float minWidth, maxWidth, minHeight, maxHeight; GetSizeLimits(&minWidth, &maxWidth, &minHeight, &maxHeight); From stippi at mail.berlios.de Wed Apr 1 21:53:17 2009 From: stippi at mail.berlios.de (stippi at mail.berlios.de) Date: Wed, 1 Apr 2009 21:53:17 +0200 Subject: [Haiku-commits] r29855 - haiku/trunk/src/tests/kits/interface/look Message-ID: <200904011953.n31JrHqC001345@sheep.berlios.de> Author: stippi Date: 2009-04-01 21:53:14 +0200 (Wed, 01 Apr 2009) New Revision: 29855 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29855&view=rev Modified: haiku/trunk/src/tests/kits/interface/look/Jamfile haiku/trunk/src/tests/kits/interface/look/Look.cpp Log: Integrate a BColumnListView... Modified: haiku/trunk/src/tests/kits/interface/look/Jamfile =================================================================== --- haiku/trunk/src/tests/kits/interface/look/Jamfile 2009-04-01 17:55:04 UTC (rev 29854) +++ haiku/trunk/src/tests/kits/interface/look/Jamfile 2009-04-01 19:53:14 UTC (rev 29855) @@ -1,6 +1,8 @@ SubDir HAIKU_TOP src tests kits interface look ; +UsePrivateHeaders interface ; + SimpleTest LookTest : Look.cpp - : be tracker + : be tracker libcolumnlistview.a ; Modified: haiku/trunk/src/tests/kits/interface/look/Look.cpp =================================================================== --- haiku/trunk/src/tests/kits/interface/look/Look.cpp 2009-04-01 17:55:04 UTC (rev 29854) +++ haiku/trunk/src/tests/kits/interface/look/Look.cpp 2009-04-01 19:53:14 UTC (rev 29855) @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -266,6 +267,7 @@ // create some controls + // BListView BListView* listView = new BListView(); for (int32 i = 0; i < 20; i++) { BString itemLabel("List Item "); @@ -276,6 +278,16 @@ true, true); scrollView->SetExplicitMinSize(BSize(300, 140)); + // BColumnListView + BColumnListView* columnListView = new BColumnListView("clv", 0, + B_FANCY_BORDER); +// for (int32 i = 0; i < 20; i++) { +// BString itemLabel("List Item "); +// itemLabel << i + 1; +// columnListView->AddItem(new BStringItem(itemLabel.String())); +// } + + BGridView* controls = new BGridView(kInset, kInset); BGridLayout* layout = controls->GridLayout(); controls->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNLIMITED)); @@ -296,6 +308,7 @@ BTabView* tabView = new BTabView("tab view", B_WIDTH_FROM_WIDEST); BView* content = BGroupLayoutBuilder(B_VERTICAL, kInset) .Add(scrollView) + .Add(columnListView) .Add(controls) .SetInsets(kInset, kInset, kInset, kInset); From anevilyak at mail.berlios.de Thu Apr 2 05:03:17 2009 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Thu, 2 Apr 2009 05:03:17 +0200 Subject: [Haiku-commits] r29856 - haiku/trunk/src/add-ons/media/plugins/avcodec/libavcodec Message-ID: <200904020303.n3233Hnn025697@sheep.berlios.de> Author: anevilyak Date: 2009-04-02 05:03:16 +0200 (Thu, 02 Apr 2009) New Revision: 29856 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29856&view=rev Modified: haiku/trunk/src/add-ons/media/plugins/avcodec/libavcodec/Jamfile Log: gcc4 build fix - thanks to Artur Wyszynski for submitting. Closes ticket #3652. Modified: haiku/trunk/src/add-ons/media/plugins/avcodec/libavcodec/Jamfile =================================================================== --- haiku/trunk/src/add-ons/media/plugins/avcodec/libavcodec/Jamfile 2009-04-01 19:53:14 UTC (rev 29855) +++ haiku/trunk/src/add-ons/media/plugins/avcodec/libavcodec/Jamfile 2009-04-02 03:03:16 UTC (rev 29856) @@ -10,7 +10,11 @@ TARGET_WARNING_CCFLAGS = [ FFilter $(TARGET_WARNING_CCFLAGS) : -Wall -Wmissing-prototypes -Wsign-compare -Wpointer-arith ] ; -SubDirCcFlags -fomit-frame-pointer -DPIC ; +if $(HAIKU_GCC_VERSION[1]) >= 3 { + SubDirCcFlags -fomit-frame-pointer -fno-pic ; +} else { + SubDirCcFlags -fomit-frame-pointer -DPIC ; +} SubDirCcFlags -DHAVE_AV_CONFIG_H=1 ; StaticLibrary libavcodec.a : From anevilyak at mail.berlios.de Thu Apr 2 05:13:57 2009 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Thu, 2 Apr 2009 05:13:57 +0200 Subject: [Haiku-commits] r29857 - haiku/trunk/src/system/kernel/scheduler Message-ID: <200904020313.n323DvrB026782@sheep.berlios.de> Author: anevilyak Date: 2009-04-02 05:13:55 +0200 (Thu, 02 Apr 2009) New Revision: 29857 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29857&view=rev Modified: haiku/trunk/src/system/kernel/scheduler/scheduler_affine.cpp Log: Various tweaks - 1) while enqueued, keep track of which run queue a thread is in on the scheduler data structure, and use this information so that set_thread_priority doesn't have to search every CPU to find the thread. Also slightly tweak the enqueue and steal operations to take advantage of some of the stats we're now tracking, and experiment with variable quantum sizes for low priority CPU bound threads. Still lots of work to do with respect to balancing and/or affinity though. Modified: haiku/trunk/src/system/kernel/scheduler/scheduler_affine.cpp =================================================================== --- haiku/trunk/src/system/kernel/scheduler/scheduler_affine.cpp 2009-04-02 03:03:16 UTC (rev 29856) +++ haiku/trunk/src/system/kernel/scheduler/scheduler_affine.cpp 2009-04-02 03:13:55 UTC (rev 29857) @@ -36,13 +36,17 @@ // The run queues. Holds the threads ready to run ordered by priority. // One queue per schedulable target (CPU, core, etc.). +// TODO: consolidate this such that HT/SMT entities on the same physical core +// share a queue, once we have the necessary API for retrieving the topology +// information static struct thread* sRunQueue[B_MAX_CPU_COUNT]; static int32 sRunQueueSize[B_MAX_CPU_COUNT]; static struct thread* sIdleThreads; static cpu_mask_t sIdleCPUs = 0; const int32 kMaxTrackingQuantums = 5; -const bigtime_t kMaxThreadQuantum = 3000; +const bigtime_t kMinThreadQuantum = 3000; +const bigtime_t kMaxThreadQuantum = 10000; struct scheduler_thread_data { scheduler_thread_data(void) @@ -55,6 +59,7 @@ { memset(fLastThreadQuantums, 0, sizeof(fLastThreadQuantums)); fLastQuantumSlot = 0; + fLastQueue = -1; } int32 GetAverageQuantumUsage() const @@ -67,6 +72,7 @@ int32 fLastThreadQuantums[kMaxTrackingQuantums]; int16 fLastQuantumSlot; + int32 fLastQueue; }; @@ -117,8 +123,7 @@ for (int32 i = 0; i < smp_get_num_cpus(); i++) { if (gCPU[i].disabled) continue; - if (targetCPU < 0 - || gCPU[i].active_time < gCPU[targetCPU].active_time) + if (targetCPU < 0 || sRunQueueSize[i] < sRunQueueSize[targetCPU]) targetCPU = i; } @@ -176,6 +181,7 @@ prev->queue_next = thread; else sRunQueue[targetCPU] = thread; + thread->scheduler_data->fLastQueue = targetCPU; } thread->next_priority = thread->priority; @@ -207,6 +213,7 @@ sRunQueue[currentCPU] = resultThread->queue_next; } sRunQueueSize[currentCPU]--; + resultThread->scheduler_data->fLastQueue = -1; return resultThread; } @@ -223,9 +230,13 @@ // look through the active CPUs - find the one // that has a) threads available to steal, and // b) out of those, the one that's the most CPU-bound + // TODO: make this more intelligent along with enqueue + // - we need to try and maintain a reasonable balance + // in run queue sizes across CPUs, and also try to maintain + // an even distribution of cpu bound / interactive threads for (int32 i = 0; i < smp_get_num_cpus(); i++) { // skip CPUs that have either no or only one thread - if (sRunQueue[i] == NULL || sRunQueue[i]->queue_next == NULL) + if (sRunQueueSize[i] < 2) continue; if (i == currentCPU) continue; @@ -233,7 +244,7 @@ // pick whichever one is generally the most CPU bound. if (targetCPU < 0) targetCPU = i; - else if (gCPU[i].active_time > gCPU[targetCPU].active_time) + else if (sRunQueueSize[i] > sRunQueueSize[targetCPU]) targetCPU = i; } @@ -289,18 +300,14 @@ // data pointer on the thread struct) so we only have to walk // that exact queue to find it. struct thread *item = NULL, *prev = NULL; - for (int32 i = 0; i < smp_get_num_cpus(); i++) { - for (item = sRunQueue[i], prev = NULL; item && item != thread; - item = item->queue_next) { + targetCPU = thread->scheduler_data->fLastQueue; + + for (item = sRunQueue[targetCPU], prev = NULL; item && item != thread; + item = item->queue_next) { if (prev) prev = prev->queue_next; else - prev = sRunQueue[i]; - } - if (item) { - targetCPU = i; - break; - } + prev = item; } ASSERT(item == thread); @@ -458,7 +465,13 @@ } if (nextThread != oldThread || oldThread->cpu->preempted) { - bigtime_t quantum = kMaxThreadQuantum; // ToDo: calculate quantum! + bigtime_t quantum = kMinThreadQuantum; + // give CPU-bound background threads a larger quantum size + // to minimize unnecessary context switches if the system is idle + if (nextThread->scheduler_data->GetAverageQuantumUsage() + > (kMinThreadQuantum >> 1) + && nextThread->priority < B_NORMAL_PRIORITY) + quantum = kMaxThreadQuantum; timer *quantumTimer = &oldThread->cpu->quantum_timer; if (!oldThread->cpu->preempted) From axeld at mail.berlios.de Thu Apr 2 10:18:07 2009 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Thu, 2 Apr 2009 10:18:07 +0200 Subject: [Haiku-commits] r29858 - haiku/trunk/src/servers/app Message-ID: <200904020818.n328I7Zg031076@sheep.berlios.de> Author: axeld Date: 2009-04-02 10:18:07 +0200 (Thu, 02 Apr 2009) New Revision: 29858 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29858&view=rev Modified: haiku/trunk/src/servers/app/MultiLocker.cpp Log: * Fixed build in DEBUG mode. * Automatic whitespace cleanup. Modified: haiku/trunk/src/servers/app/MultiLocker.cpp =================================================================== --- haiku/trunk/src/servers/app/MultiLocker.cpp 2009-04-02 03:13:55 UTC (rev 29857) +++ haiku/trunk/src/servers/app/MultiLocker.cpp 2009-04-02 08:18:07 UTC (rev 29858) @@ -1,5 +1,5 @@ /* - * Copyright 2005-2007, Haiku, Inc. All Rights Reserved. + * Copyright 2005-2009, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT license. * * Copyright 1999, Be Incorporated. All Rights Reserved. @@ -15,7 +15,9 @@ #define TIMING MULTI_LOCKER_TIMING -#define DEBUG MULTI_LOCKER_DEBUG +#ifndef DEBUG +# define DEBUG MULTI_LOCKER_DEBUG +#endif const int32 LARGE_NUMBER = 100000; @@ -100,7 +102,7 @@ delete_sem(fLock); free(fDebugArray); #endif -#if TIMING +#if TIMING // let's produce some performance numbers printf("MultiLocker Statistics:\n" "Avg ReadLock: %lld\n" @@ -130,7 +132,7 @@ where the thread's stack is located. Each time a new writer acquires the lock, its thread_id and stack_page are recorded. IsWriteLocked gets the stack_page of the current thread and sees if it is a match. If the stack_page matches you are guaranteed - to have the matching thread. If the stack page doesn't match the more traditional + to have the matching thread. If the stack page doesn't match the more traditional find_thread(NULL) method of matching the thread_ids is used. This technique is very useful when dealing with a lock that is acquired in a nested fashion. @@ -160,7 +162,7 @@ // determine which page in memory this stack represents // this is managed by taking the address of the item on the // stack and dividing it by the size of the memory pages - // if it is the same as the cached stack_page, there is a match + // if it is the same as the cached stack_page, there is a match uint32 stackBase = (uint32)&writeLockHolder / B_PAGE_SIZE; thread_id thread = 0; @@ -202,7 +204,7 @@ bigtime_t start = system_time(); #endif - bool locked = false; + bool locked = false; // the lock must be initialized if (fInit == B_OK) { @@ -212,7 +214,7 @@ locked = true; } else { // increment and retrieve the current count of readers - int32 currentCount = atomic_add(&fReadCount, 1); + int32 currentCount = atomic_add(&fReadCount, 1); if (currentCount < 0) { // a writer holds the lock so wait for fReadSem to be released status_t status; @@ -222,7 +224,7 @@ locked = status == B_OK; } else - locked = true; + locked = true; } } @@ -232,7 +234,7 @@ rl_count++; #endif - return locked; + return locked; } @@ -296,7 +298,7 @@ wl_time += (end - start); wl_count++; #endif - + return locked; } @@ -313,7 +315,7 @@ if (IsWriteLocked()) { // writers simply decrement the nesting count fWriterNest--; - unlocked = true; + unlocked = true; } else { // decrement and retrieve the read counter int32 current_count = atomic_add(&fReadCount, -1); @@ -330,7 +332,7 @@ ru_count++; #endif - return unlocked; + return unlocked; } @@ -397,7 +399,7 @@ bool MultiLocker::ReadLock() { - bool locked = false; + bool locked = false; if (fInit != B_OK) debugger("lock not initialized"); @@ -427,7 +429,7 @@ bool MultiLocker::WriteLock() { - bool locked = false; + bool locked = false; if (fInit != B_OK) debugger("lock not initialized"); @@ -476,7 +478,7 @@ if (fWriterNest < 0) debugger("ReadUnlock() - negative writer nest count"); - unlocked = true; + unlocked = true; } else { // decrement and retrieve the read counter unlocked = release_sem_etc(fLock, 1, B_DO_NOT_RESCHEDULE) == B_OK; @@ -484,7 +486,7 @@ _UnregisterThread(); } - return unlocked; + return unlocked; } From axeld at mail.berlios.de Thu Apr 2 10:18:30 2009 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Thu, 2 Apr 2009 10:18:30 +0200 Subject: [Haiku-commits] r29859 - haiku/trunk/src/servers/app/drawing/Painter Message-ID: <200904020818.n328IUFt031142@sheep.berlios.de> Author: axeld Date: 2009-04-02 10:18:29 +0200 (Thu, 02 Apr 2009) New Revision: 29859 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29859&view=rev Modified: haiku/trunk/src/servers/app/drawing/Painter/Painter.cpp Log: * Fixed warnings. * Automatic whitespace cleanup. Modified: haiku/trunk/src/servers/app/drawing/Painter/Painter.cpp =================================================================== --- haiku/trunk/src/servers/app/drawing/Painter/Painter.cpp 2009-04-02 08:18:07 UTC (rev 29858) +++ haiku/trunk/src/servers/app/drawing/Painter/Painter.cpp 2009-04-02 08:18:29 UTC (rev 29859) @@ -459,8 +459,9 @@ } while (fBaseRenderer.next_clip_box()); return true; + } - } else if (a.y == b.y) { + if (a.y == b.y) { // horizontal int32 y = (int32)a.y; uint8* dst = fBuffer.row_ptr(y); @@ -512,19 +513,19 @@ const BGradient& gradient) const { CHECK_CLIPPING - + _Transform(&pt1); _Transform(&pt2); _Transform(&pt3); - + fPath.remove_all(); - + fPath.move_to(pt1.x, pt1.y); fPath.line_to(pt2.x, pt2.y); fPath.line_to(pt3.x, pt3.y); - + fPath.close_polygon(); - + return _FillPath(fPath, gradient); } @@ -565,23 +566,23 @@ const BGradient& gradient, bool closed) const { CHECK_CLIPPING - + if (numPts > 0) { - + fPath.remove_all(); - + _Transform(p); fPath.move_to(p->x, p->y); - + for (int32 i = 1; i < numPts; i++) { p++; _Transform(p); fPath.line_to(p->x, p->y); } - + if (closed) fPath.close_polygon(); - + return _FillPath(fPath, gradient); } return BRect(0.0, 0.0, -1.0, -1.0); @@ -619,20 +620,20 @@ Painter::FillBezier(BPoint* p, const BGradient& gradient) const { CHECK_CLIPPING - + fPath.remove_all(); - + _Transform(&(p[0])); _Transform(&(p[1])); _Transform(&(p[2])); _Transform(&(p[3])); - + fPath.move_to(p[0].x, p[0].y); fPath.curve4(p[1].x, p[1].y, p[2].x, p[2].y, p[3].x, p[3].y); - - + + fPath.close_polygon(); return _FillPath(fCurve, gradient); } @@ -692,7 +693,7 @@ const BGradient& gradient) const { CHECK_CLIPPING - + // TODO: if shapes are ever used more heavily in Haiku, // it would be nice to use BShape data directly (write // an AGG "VertexSource" adaptor) @@ -703,7 +704,7 @@ fPath.move_to(points->x, points->y); points++; } - + if (op & OP_LINETO) { int32 count = opList[i] & 0x00FFFFFF; while (count--) { @@ -711,7 +712,7 @@ points++; } } - + if (op & OP_BEZIERTO) { int32 count = opList[i] & 0x00FFFFFF; while (count) { @@ -722,11 +723,11 @@ count -= 3; } } - + if (op & OP_CLOSE) fPath.close_polygon(); } - + return _FillPath(fCurve, gradient); } @@ -858,7 +859,7 @@ Painter::FillRect(const BRect& r, const BGradient& gradient) const { CHECK_CLIPPING - + // support invalid rects BPoint a(min_c(r.left, r.right), min_c(r.top, r.bottom)); BPoint b(max_c(r.left, r.right), max_c(r.top, r.bottom)); @@ -949,8 +950,8 @@ int32 gradientArraySize = r.IntegerHeight() + 1; uint32 gradientArray[gradientArraySize]; - int32 gradientTop = gradient.Start().y; - int32 gradientBottom = gradient.End().y; + int32 gradientTop = (int32)gradient.Start().y; + int32 gradientBottom = (int32)gradient.End().y; int32 colorCount = gradientBottom - gradientTop + 1; if (colorCount < 0) { // Gradient is upside down. That's currently not supported by this @@ -960,7 +961,7 @@ _MakeGradient(gradient, colorCount, gradientArray, gradientTop - (int32)r.top, gradientArraySize); - + uint8* dst = fBuffer.row_ptr(0); uint32 bpr = fBuffer.stride(); int32 left = (int32)r.left; @@ -1053,7 +1054,7 @@ if (gSubpixelAntialiasing) { fSubpixRasterizer.reset(); fSubpixRasterizer.add_path(outer); - + // don't add an inner hole if the "size is negative", this avoids // some defects that can be observed on R5 and could be regarded // as a bug. @@ -1071,7 +1072,7 @@ fSubpixRasterizer.filling_rule(agg::fill_even_odd); if (fPenSize > 2) - agg::render_scanlines(fSubpixRasterizer, fSubpixPackedScanline, + agg::render_scanlines(fSubpixRasterizer, fSubpixPackedScanline, fSubpixRenderer); else agg::render_scanlines(fSubpixRasterizer, fSubpixUnpackedScanline, @@ -1141,22 +1142,22 @@ const BGradient& gradient) const { CHECK_CLIPPING - + BPoint lt(r.left, r.top); BPoint rb(r.right, r.bottom); _Transform(<, false); _Transform(&rb, false); - + // 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 rb.x += 1.0; rb.y += 1.0; - + agg::rounded_rect rect; rect.rect(lt.x, lt.y, rb.x, rb.y); rect.radius(xRadius, yRadius); - + return _FillPath(rect, gradient); } @@ -1257,21 +1258,21 @@ Painter::FillEllipse(BRect r, const BGradient& gradient) const { CHECK_CLIPPING - + AlignEllipseRect(&r, true); - + float xRadius = r.Width() / 2.0; float yRadius = r.Height() / 2.0; BPoint center(r.left + xRadius, r.top + yRadius); - + int32 divisions = (int32)((xRadius + yRadius + 2 * fPenSize) * PI / 2); if (divisions < 12) divisions = 12; if (divisions > 4096) divisions = 4096; - + agg::ellipse path(center.x, center.y, xRadius, yRadius, divisions); - + return _FillPath(path, gradient); } @@ -1337,22 +1338,22 @@ float span, const BGradient& gradient) const { CHECK_CLIPPING - + _Transform(¢er); - + double angleRad = (angle * PI) / 180.0; double spanRad = (span * PI) / 180.0; agg::bezier_arc arc(center.x, center.y, xRadius, yRadius, -angleRad, -spanRad); - + agg::conv_curve segmentedArc(arc); - + fPath.remove_all(); - + // build a new path by starting at the center point, // then traversing the arc, then going back to the center fPath.move_to(center.x, center.y); - + segmentedArc.rewind(0); double x; double y; @@ -1361,9 +1362,9 @@ fPath.line_to(x, y); cmd = segmentedArc.vertex(&x, &y); } - + fPath.close_polygon(); - + return _FillPath(fPath, gradient); } @@ -1478,7 +1479,7 @@ Painter::FillRegion(const BRegion* region, const BGradient& gradient) const { CHECK_CLIPPING - + BRegion copy(*region); int32 count = copy.CountRects(); BRect touched = FillRect(copy.RectAt(0), gradient); @@ -1805,8 +1806,8 @@ BBitmap* temp = NULL; ObjectDeleter tempDeleter; - + if ((format != B_RGBA32 && format != B_RGB32) || (format == B_RGB32 && fDrawingMode != B_OP_COPY #if 1 @@ -1848,7 +1849,7 @@ srcBuffer.stride(), B_TRANSPARENT_MAGIC_RGBA32, temp); break; - + // TODO: not sure if this applies to B_RGBA15 too. It // should not because B_RGBA15 actually has an alpha // channel itself and it should have been preserved @@ -1860,7 +1861,7 @@ srcBuffer.stride(), B_TRANSPARENT_MAGIC_RGBA15, temp); break; - + default: break; } @@ -1981,9 +1982,9 @@ // Do not calculate more filter weights than necessary and also // keep the stack based allocations reasonably sized - if (fClippingRegion->Frame().IntegerWidth() + 1 < dstWidth) + if (fClippingRegion->Frame().IntegerWidth() + 1 < (int32)dstWidth) dstWidth = fClippingRegion->Frame().IntegerWidth() + 1; - if (fClippingRegion->Frame().IntegerHeight() + 1 < dstHeight) + if (fClippingRegion->Frame().IntegerHeight() + 1 < (int32)dstHeight) dstHeight = fClippingRegion->Frame().IntegerHeight() + 1; // When calculating less filter weights than specified by viewRect, @@ -1991,12 +1992,12 @@ uint32 filterWeightXIndexOffset = 0; uint32 filterWeightYIndexOffset = 0; if (fClippingRegion->Frame().left > viewRect.left) { - filterWeightXIndexOffset = fClippingRegion->Frame().left - - viewRect.left; + filterWeightXIndexOffset = (int32)(fClippingRegion->Frame().left + - viewRect.left); } if (fClippingRegion->Frame().top > viewRect.top) { - filterWeightYIndexOffset = fClippingRegion->Frame().top - - viewRect.top; + filterWeightYIndexOffset = (int32)(fClippingRegion->Frame().top + - viewRect.top); } // should not pose a problem with stack overflows @@ -2102,9 +2103,9 @@ // Do not calculate more filter weights than necessary and also // keep the stack based allocations reasonably sized - if (fClippingRegion->Frame().IntegerWidth() + 1 < dstWidth) + if (fClippingRegion->Frame().IntegerWidth() + 1 < (int32)dstWidth) dstWidth = fClippingRegion->Frame().IntegerWidth() + 1; - if (fClippingRegion->Frame().IntegerHeight() + 1 < dstHeight) + if (fClippingRegion->Frame().IntegerHeight() + 1 < (int32)dstHeight) dstHeight = fClippingRegion->Frame().IntegerHeight() + 1; // When calculating less filter weights than specified by viewRect, @@ -2112,12 +2113,12 @@ uint32 filterWeightXIndexOffset = 0; uint32 filterWeightYIndexOffset = 0; if (fClippingRegion->Frame().left > viewRect.left) { - filterWeightXIndexOffset = fClippingRegion->Frame().left - - viewRect.left; + filterWeightXIndexOffset = (int32)(fClippingRegion->Frame().left + - viewRect.left); } if (fClippingRegion->Frame().top > viewRect.top) { - filterWeightYIndexOffset = fClippingRegion->Frame().top - - viewRect.top; + filterWeightYIndexOffset = (int32)(fClippingRegion->Frame().top + - viewRect.top); } struct FilterInfo { @@ -2280,7 +2281,7 @@ d[1] = (s[1] * wTop + sBottom[1] * wBottom) >> 8; d[2] = (s[2] * wTop + sBottom[2] * wBottom) >> 8; } else { - // calculate the weighted sum of all four + // calculate the weighted sum of all four // interpolated pixels const uint16 wLeft = xWeights[x].weight; const uint16 wRight = 255 - wLeft; @@ -2288,13 +2289,13 @@ uint32 t0 = (s[0] * wLeft + s[4] * wRight) * wTop; uint32 t1 = (s[1] * wLeft + s[5] * wRight) * wTop; uint32 t2 = (s[2] * wLeft + s[6] * wRight) * wTop; - + // left and right of bottom row s += srcBPR; t0 += (s[0] * wLeft + s[4] * wRight) * wBottom; t1 += (s[1] * wLeft + s[5] * wRight) * wBottom; t2 += (s[2] * wLeft + s[6] * wRight) * wBottom; - + d[0] = t0 >> 16; d[1] = t1 >> 16; d[2] = t2 >> 16; @@ -2331,7 +2332,7 @@ for (int32 x = xIndexL; x <= xIndexMax; x++) { const uint8* s = src + xWeights[x].index; - // calculate the weighted sum of all four + // calculate the weighted sum of all four // interpolated pixels const uint16 wLeft = xWeights[x].weight; const uint16 wRight = 255 - wLeft; @@ -2585,11 +2586,11 @@ stroke.miter_limit(fMiterLimit); if (gSubpixelAntialiasing) { - + fSubpixRasterizer.reset(); fSubpixRasterizer.add_path(stroke); - - agg::render_scanlines(fSubpixRasterizer, + + agg::render_scanlines(fSubpixRasterizer, fSubpixPackedScanline, fSubpixRenderer); } else { @@ -2612,7 +2613,7 @@ Painter::_FillPath(VertexSource& path) const { if (gSubpixelAntialiasing) { - + fSubpixRasterizer.reset(); fSubpixRasterizer.add_path(path); agg::render_scanlines(fSubpixRasterizer, @@ -2632,7 +2633,7 @@ Painter::_FillPath(VertexSource& path, const BGradient& gradient) const { GTRACE("Painter::_FillPath\n"); - + switch(gradient.GetType()) { case BGradient::TYPE_LINEAR: { GTRACE(("Painter::_FillPath> type == TYPE_LINEAR\n")); @@ -2802,7 +2803,7 @@ const BGradientLinear& linear) const { GTRACE("Painter::_FillPathGradientLinear\n"); - + BPoint start = linear.Start(); BPoint end = linear.End(); @@ -2814,18 +2815,18 @@ gradient_func_type, color_array_type> span_gradient_type; typedef agg::renderer_scanline_aa renderer_gradient_type; - + gradient_func_type gradientFunc; agg::trans_affine gradientMtx; interpolator_type spanInterpolator(gradientMtx); span_allocator_type spanAllocator; color_array_type colorArray; - + _MakeGradient(colorArray, linear); span_gradient_type spanGradient(spanInterpolator, gradientFunc, colorArray, 0, 100); - + renderer_gradient_type gradientRenderer(fBaseRenderer, spanAllocator, spanGradient); @@ -2843,11 +2844,11 @@ const BGradientRadial& radial) const { GTRACE("Painter::_FillPathGradientRadial\n"); - + BPoint center = radial.Center(); // TODO: finish this // float radius = radial.Radius(); - + typedef agg::span_interpolator_linear<> interpolator_type; typedef agg::pod_auto_array color_array_type; typedef agg::span_allocator span_allocator_type; @@ -2856,18 +2857,18 @@ gradient_func_type, color_array_type> span_gradient_type; typedef agg::renderer_scanline_aa renderer_gradient_type; - + gradient_func_type gradientFunc; agg::trans_affine gradientMtx; interpolator_type spanInterpolator(gradientMtx); span_allocator_type spanAllocator; color_array_type colorArray; - + _MakeGradient(colorArray, radial); - + span_gradient_type spanGradient(spanInterpolator, gradientFunc, colorArray, 0, 100); - + renderer_gradient_type gradientRenderer(fBaseRenderer, spanAllocator, spanGradient); @@ -2876,7 +2877,7 @@ gradientMtx.invert(); // _CalcLinearGradientTransform(start, end, gradientMtx); - + fRasterizer.reset(); fRasterizer.add_path(path); agg::render_scanlines(fRasterizer, fPackedScanline, gradientRenderer); @@ -2889,12 +2890,12 @@ const BGradientRadialFocus& focus) const { GTRACE("Painter::_FillPathGradientRadialFocus\n"); - + BPoint center = focus.Center(); // TODO: finish this. // BPoint focal = focus.Focal(); // float radius = focus.Radius(); - + typedef agg::span_interpolator_linear<> interpolator_type; typedef agg::pod_auto_array color_array_type; typedef agg::span_allocator span_allocator_type; @@ -2903,27 +2904,27 @@ gradient_func_type, color_array_type> span_gradient_type; typedef agg::renderer_scanline_aa renderer_gradient_type; - + gradient_func_type gradientFunc; agg::trans_affine gradientMtx; interpolator_type spanInterpolator(gradientMtx); span_allocator_type spanAllocator; color_array_type colorArray; - + _MakeGradient(colorArray, focus); - + span_gradient_type spanGradient(spanInterpolator, gradientFunc, colorArray, 0, 100); - + renderer_gradient_type gradientRenderer(fBaseRenderer, spanAllocator, spanGradient); - + gradientMtx.reset(); gradientMtx *= agg::trans_affine_translation(center.x, center.y); gradientMtx.invert(); - + // _CalcLinearGradientTransform(start, end, gradientMtx); - + fRasterizer.reset(); fRasterizer.add_path(path); agg::render_scanlines(fRasterizer, fPackedScanline, gradientRenderer); @@ -2936,10 +2937,10 @@ const BGradientDiamond& diamond) const { GTRACE("Painter::_FillPathGradientDiamond\n"); - + BPoint center = diamond.Center(); // float radius = diamond.Radius(); - + typedef agg::span_interpolator_linear<> interpolator_type; typedef agg::pod_auto_array color_array_type; typedef agg::span_allocator span_allocator_type; @@ -2948,27 +2949,27 @@ gradient_func_type, color_array_type> span_gradient_type; typedef agg::renderer_scanline_aa renderer_gradient_type; - + gradient_func_type gradientFunc; agg::trans_affine gradientMtx; interpolator_type spanInterpolator(gradientMtx); span_allocator_type spanAllocator; color_array_type colorArray; - + _MakeGradient(colorArray, diamond); - + span_gradient_type spanGradient(spanInterpolator, gradientFunc, colorArray, 0, 100); - + renderer_gradient_type gradientRenderer(fBaseRenderer, spanAllocator, spanGradient); - + gradientMtx.reset(); gradientMtx *= agg::trans_affine_translation(center.x, center.y); gradientMtx.invert(); - + // _CalcLinearGradientTransform(start, end, gradientMtx); - + fRasterizer.reset(); fRasterizer.add_path(path); agg::render_scanlines(fRasterizer, fPackedScanline, gradientRenderer); @@ -2981,10 +2982,10 @@ const BGradientConic& conic) const { GTRACE("Painter::_FillPathGradientConic\n"); - + BPoint center = conic.Center(); // float radius = conic.Radius(); - + typedef agg::span_interpolator_linear<> interpolator_type; typedef agg::pod_auto_array color_array_type; typedef agg::span_allocator span_allocator_type; @@ -2993,27 +2994,27 @@ gradient_func_type, color_array_type> span_gradient_type; typedef agg::renderer_scanline_aa renderer_gradient_type; - + gradient_func_type gradientFunc; agg::trans_affine gradientMtx; interpolator_type spanInterpolator(gradientMtx); span_allocator_type spanAllocator; color_array_type colorArray; - + _MakeGradient(colorArray, conic); - + span_gradient_type spanGradient(spanInterpolator, gradientFunc, colorArray, 0, 100); - + renderer_gradient_type gradientRenderer(fBaseRenderer, spanAllocator, spanGradient); - + gradientMtx.reset(); gradientMtx *= agg::trans_affine_translation(center.x, center.y); gradientMtx.invert(); - + // _CalcLinearGradientTransform(start, end, gradientMtx); - + fRasterizer.reset(); fRasterizer.add_path(path); agg::render_scanlines(fRasterizer, fPackedScanline, gradientRenderer); From axeld at mail.berlios.de Thu Apr 2 11:04:07 2009 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Thu, 2 Apr 2009 11:04:07 +0200 Subject: [Haiku-commits] r29860 - haiku/trunk/src/servers/app/drawing/Painter Message-ID: <200904020904.n32947uj003358@sheep.berlios.de> Author: axeld Date: 2009-04-02 11:04:00 +0200 (Thu, 02 Apr 2009) New Revision: 29860 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29860&view=rev Modified: haiku/trunk/src/servers/app/drawing/Painter/Painter.cpp Log: * agg::rendering_buffer::row_ptr() crashes when passing an out of bounds index. * This fixes bug #2316. Modified: haiku/trunk/src/servers/app/drawing/Painter/Painter.cpp =================================================================== --- haiku/trunk/src/servers/app/drawing/Painter/Painter.cpp 2009-04-02 08:18:29 UTC (rev 29859) +++ haiku/trunk/src/servers/app/drawing/Painter/Painter.cpp 2009-04-02 09:04:00 UTC (rev 29860) @@ -464,6 +464,9 @@ if (a.y == b.y) { // horizontal int32 y = (int32)a.y; + if (y < 0 || y >= fBuffer.height()) + return true; + uint8* dst = fBuffer.row_ptr(y); int32 x1 = (int32)min_c(a.x, b.x); int32 x2 = (int32)max_c(a.x, b.x); @@ -982,7 +985,8 @@ // for (int32 x = x1; x <= x2; x++) { // *handle++ = gradientArray[y1 - top]; // } -gfxset32(offset + y1 * bpr, gradientArray[y1 - top], (x2 - x1 + 1) * 4); + gfxset32(offset + y1 * bpr, gradientArray[y1 - top], + (x2 - x1 + 1) * 4); } } } while (fBaseRenderer.next_clip_box()); @@ -1010,7 +1014,7 @@ // for (int32 x = left; x <= right; x++) { // *handle++ = color.data32; // } -gfxset32(dst, color.data32, bytes); + gfxset32(dst, color.data32, bytes); dst += bpr; } } From axeld at mail.berlios.de Thu Apr 2 11:05:50 2009 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Thu, 2 Apr 2009 11:05:50 +0200 Subject: [Haiku-commits] r29861 - haiku/trunk/src/servers/app/drawing Message-ID: <200904020905.n3295op6003549@sheep.berlios.de> Author: axeld Date: 2009-04-02 11:05:49 +0200 (Thu, 02 Apr 2009) New Revision: 29861 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29861&view=rev Modified: haiku/trunk/src/servers/app/drawing/DrawingEngine.cpp Log: * Fixed Stippi's favourite typo ("appearantly" does not exist). Modified: haiku/trunk/src/servers/app/drawing/DrawingEngine.cpp =================================================================== --- haiku/trunk/src/servers/app/drawing/DrawingEngine.cpp 2009-04-02 09:04:00 UTC (rev 29860) +++ haiku/trunk/src/servers/app/drawing/DrawingEngine.cpp 2009-04-02 09:05:49 UTC (rev 29861) @@ -861,10 +861,11 @@ // NOTE: region expected to be already clipped correctly!! BRect frame = r.Frame(); if (!fPainter->Bounds().Contains(frame)) { - // NOTE: I am not quite sure yet how this can happen, but appearantly it can (see bug 634) - // This function is used for internal app_server painting, in the case of bug 634, - // the background of views is painted. But the view region should never be outside the - // frame buffer bounds. + // NOTE: I am not quite sure yet how this can happen, but apparantly it + // can (see bug #634). + // This function is used for internal app_server painting, in the case of + // bug #634, the background of views is painted. But the view region + // should never be outside the frame buffer bounds. // char message[1024]; // BRect bounds = fPainter->Bounds(); // sprintf(message, "FillRegion() - painter: (%d, %d)->(%d, %d), region: (%d, %d)->(%d, %d)", From axeld at mail.berlios.de Thu Apr 2 11:09:49 2009 From: axeld at mail.berlios.de (axeld at mail.berlios.de) Date: Thu, 2 Apr 2009 11:09:49 +0200 Subject: [Haiku-commits] r29862 - haiku/trunk/src/servers/app/drawing/Painter Message-ID: <200904020909.n3299nIn003875@sheep.berlios.de> Author: axeld Date: 2009-04-02 11:09:46 +0200 (Thu, 02 Apr 2009) New Revision: 29862 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29862&view=rev Modified: haiku/trunk/src/servers/app/drawing/Painter/Painter.cpp Log: * Fixed warning I just introduced. Modified: haiku/trunk/src/servers/app/drawing/Painter/Painter.cpp =================================================================== --- haiku/trunk/src/servers/app/drawing/Painter/Painter.cpp 2009-04-02 09:05:49 UTC (rev 29861) +++ haiku/trunk/src/servers/app/drawing/Painter/Painter.cpp 2009-04-02 09:09:46 UTC (rev 29862) @@ -464,7 +464,7 @@ if (a.y == b.y) { // horizontal int32 y = (int32)a.y; - if (y < 0 || y >= fBuffer.height()) + if (y < 0 || y >= (int32)fBuffer.height()) return true; uint8* dst = fBuffer.row_ptr(y); From axeld at mail.berlios.de Thu Apr 2 11:46:24 2009 From: axeld at mail.berlios.de (axeld at mail.berlios.de) Date: Thu, 2 Apr 2009 11:46:24 +0200 Subject: [Haiku-commits] r29863 - haiku/trunk/src/apps/charactermap Message-ID: <200904020946.n329kOmj009113@sheep.berlios.de> Author: axeld Date: 2009-04-02 11:46:21 +0200 (Thu, 02 Apr 2009) New Revision: 29863 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29863&view=rev Added: haiku/trunk/src/apps/charactermap/UnicodeBlockView.cpp haiku/trunk/src/apps/charactermap/UnicodeBlockView.h Modified: haiku/trunk/src/apps/charactermap/CharacterWindow.cpp haiku/trunk/src/apps/charactermap/CharacterWindow.h haiku/trunk/src/apps/charactermap/Jamfile haiku/trunk/src/apps/charactermap/UnicodeBlocks.cpp Log: * Added filter control for the Unicode block list. * The status line now contains the character as well, as suggested by humdinger. * Moved the list view into its own class UnicodeBlockView. Modified: haiku/trunk/src/apps/charactermap/CharacterWindow.cpp =================================================================== --- haiku/trunk/src/apps/charactermap/CharacterWindow.cpp 2009-04-02 09:09:46 UTC (rev 29862) +++ haiku/trunk/src/apps/charactermap/CharacterWindow.cpp 2009-04-02 09:46:21 UTC (rev 29863) @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -17,15 +18,17 @@ #include #include #include +#include #include #include #include #include #include #include +#include #include "CharacterView.h" -#include "UnicodeBlocks.h" +#include "UnicodeBlockView.h" static const uint32 kMsgUnicodeBlockSelected = 'unbs'; @@ -34,6 +37,9 @@ static const uint32 kMsgFontSizeChanged = 'fsch'; static const uint32 kMsgPrivateBlocks = 'prbl'; static const uint32 kMsgContainedBlocks = 'cnbl'; +static const uint32 kMsgFilterChanged = 'fltr'; +static const uint32 kMsgFilterEntered = 'flte'; +static const uint32 kMsgClearFilter = 'clrf'; static const int32 kMinFontSize = 10; static const int32 kMaxFontSize = 72; @@ -59,7 +65,56 @@ mutable char fText[32]; }; +class MouseMovedFilter : public BMessageFilter { +public: + MouseMovedFilter() + : BMessageFilter(B_ANY_DELIVERY, B_ANY_SOURCE, B_MOUSE_MOVED) + { + } + int32 ResetMoved() + { + int32 old = fMouseMoved; + fMouseMoved = 0; + + return old; + } + + virtual filter_result Filter(BMessage* message, BHandler** /*_target*/) + { + fMouseMoved++; + return B_DISPATCH_MESSAGE; + } + +private: + int32 fMouseMoved; +}; + +class EscapeMessageFilter : public BMessageFilter { +public: + EscapeMessageFilter(uint32 command) + : BMessageFilter(B_ANY_DELIVERY, B_ANY_SOURCE, B_KEY_DOWN), + fCommand(command) + { + } + + virtual filter_result Filter(BMessage* message, BHandler** /*_target*/) + { + const char* bytes; + if (message->what != B_KEY_DOWN + || message->FindString("bytes", &bytes) != B_OK + || bytes[0] != B_ESCAPE) + return B_DISPATCH_MESSAGE; + + Looper()->PostMessage(fCommand); + return B_SKIP_MESSAGE; + } + +private: + uint32 fCommand; +}; + + CharacterWindow::CharacterWindow() : BWindow(BRect(100, 100, 700, 550), "CharacterMap", B_TITLED_WINDOW, B_ASYNCHRONOUS_CONTROLS | B_QUIT_ON_WINDOW_CLOSE @@ -80,7 +135,13 @@ BMenuBar* menuBar = new BMenuBar("menu"); - fUnicodeBlockView = new BListView("unicodeBlocks"); + fFilterControl = new BTextControl("Filter:", NULL, new BMessage(kMsgFilterEntered)); + fFilterControl->SetModificationMessage(new BMessage(kMsgFilterChanged)); + + BButton* clearButton = new BButton("clear", "Clear", + new BMessage(kMsgClearFilter)); + + fUnicodeBlockView = new UnicodeBlockView("unicodeBlocks"); fUnicodeBlockView->SetSelectionMessage( new BMessage(kMsgUnicodeBlockSelected)); @@ -90,11 +151,16 @@ fCharacterView = new CharacterView("characters"); fCharacterView->SetTarget(this, kMsgCharacterChanged); + // TODO: have a context object shared by CharacterView/UnicodeBlockView bool show; - if (settings.FindBool("show private blocks", &show) == B_OK) + if (settings.FindBool("show private blocks", &show) == B_OK) { fCharacterView->ShowPrivateBlocks(show); - if (settings.FindBool("show contained blocks only", &show) == B_OK) + fUnicodeBlockView->ShowPrivateBlocks(show); + } + if (settings.FindBool("show contained blocks only", &show) == B_OK) { fCharacterView->ShowContainedBlocksOnly(show); + fUnicodeBlockView->ShowPrivateBlocks(show); + } const char* family; const char* style; @@ -130,8 +196,12 @@ AddChild(BGroupLayoutBuilder(B_VERTICAL) .Add(menuBar) .Add(BGroupLayoutBuilder(B_HORIZONTAL, 10)//BSplitLayoutBuilder() - .Add(unicodeScroller) .Add(BGroupLayoutBuilder(B_VERTICAL, 10) + .Add(BGroupLayoutBuilder(B_HORIZONTAL, 10) + .Add(fFilterControl) + .Add(clearButton)) + .Add(unicodeScroller)) + .Add(BGroupLayoutBuilder(B_VERTICAL, 10) .Add(characterScroller) .Add(fFontSizeSlider) .Add(fCodeView)) @@ -167,8 +237,14 @@ menuBar->AddItem(_CreateFontMenu()); - _CreateUnicodeBlocks(); - InvalidateLayout(); + AddCommonFilter(new EscapeMessageFilter(kMsgClearFilter)); + fMouseMovedFilter = new MouseMovedFilter(); + AddCommonFilter(fMouseMovedFilter); + + // TODO: why is this needed? + fUnicodeBlockView->SetTarget(this); + + fFilterControl->MakeFocus(); } @@ -192,7 +268,13 @@ || index < 0) break; - fCharacterView->ScrollTo(index); + BlockListItem* item + = static_cast(fUnicodeBlockView->ItemAt(index)); + fCharacterView->ScrollTo(item->BlockIndex()); + + // Give the filter control focus if we got here by mouse action + if (fMouseMovedFilter->ResetMoved()) + fFilterControl->MakeFocus(); break; } @@ -202,13 +284,16 @@ if (message->FindInt32("character", (int32*)&character) != B_OK) break; + char utf8[16]; + CharacterView::UnicodeToUTF8(character, utf8, sizeof(utf8)); + char utf8Hex[32]; CharacterView::UnicodeToUTF8Hex(character, utf8Hex, sizeof(utf8Hex)); char text[128]; - snprintf(text, sizeof(text), "Code: %#lx (%ld), UTF-8: %s", - character, character, utf8Hex); + snprintf(text, sizeof(text), "'%s' Code: %#lx (%ld), UTF-8: %s", + utf8, character, character, utf8Hex); fCodeView->SetText(text); break; @@ -259,7 +344,7 @@ item->SetMarked(!item->IsMarked()); fCharacterView->ShowPrivateBlocks(item->IsMarked()); - _UpdateUnicodeBlocks(); + fUnicodeBlockView->ShowPrivateBlocks(item->IsMarked()); break; } @@ -273,10 +358,25 @@ item->SetMarked(!item->IsMarked()); fCharacterView->ShowContainedBlocksOnly(item->IsMarked()); - _UpdateUnicodeBlocks(); + fUnicodeBlockView->ShowContainedBlocksOnly(item->IsMarked()); break; } + case kMsgFilterChanged: + fUnicodeBlockView->SetFilter(fFilterControl->Text()); + break; + + case kMsgFilterEntered: + fUnicodeBlockView->MakeFocus(); + fUnicodeBlockView->Select(0); + fMouseMovedFilter->ResetMoved(); + break; + + case kMsgClearFilter: + fFilterControl->SetText(""); + fFilterControl->MakeFocus(); + break; + default: BWindow::MessageReceived(message); break; @@ -412,41 +512,3 @@ return menu; } - - -void -CharacterWindow::_UpdateUnicodeBlocks() -{ - for (int32 i = 0; i < fUnicodeBlockView->CountItems(); i++) { - BStringItem* item - = static_cast(fUnicodeBlockView->ItemAt(i)); - - bool enabled = fCharacterView->IsShowingBlock(i); - - if (item->IsEnabled() != enabled) { - item->SetEnabled(enabled); - fUnicodeBlockView->InvalidateItem(i); - } - } -} - - -void -CharacterWindow::_CreateUnicodeBlocks() -{ - float minWidth = 0; - for (uint32 i = 0; i < kNumUnicodeBlocks; i++) { - BStringItem* item = new BStringItem(kUnicodeBlocks[i].name); - fUnicodeBlockView->AddItem(item); - - float width = fUnicodeBlockView->StringWidth(item->Text()); - if (minWidth < width) - minWidth = width; - } - - fUnicodeBlockView->SetExplicitMinSize(BSize(minWidth / 2, 32)); - fUnicodeBlockView->SetExplicitMaxSize(BSize(minWidth, B_SIZE_UNSET)); - - _UpdateUnicodeBlocks(); -} - Modified: haiku/trunk/src/apps/charactermap/CharacterWindow.h =================================================================== --- haiku/trunk/src/apps/charactermap/CharacterWindow.h 2009-04-02 09:09:46 UTC (rev 29862) +++ haiku/trunk/src/apps/charactermap/CharacterWindow.h 2009-04-02 09:46:21 UTC (rev 29863) @@ -15,7 +15,10 @@ class BMenuItem; class BSlider; class BStringView; +class BTextControl; class CharacterView; +class MouseMovedFilter; +class UnicodeBlockView; class CharacterWindow : public BWindow { @@ -33,15 +36,15 @@ void _SetFont(const char* family, const char* style); BMenu* _CreateFontMenu(); - void _UpdateUnicodeBlocks(); - void _CreateUnicodeBlocks(); private: - BListView* fUnicodeBlockView; + BTextControl* fFilterControl; + UnicodeBlockView* fUnicodeBlockView; CharacterView* fCharacterView; BMenuItem* fSelectedFontItem; BSlider* fFontSizeSlider; BStringView* fCodeView; + MouseMovedFilter* fMouseMovedFilter; }; #endif // CHARACTER_WINDOW_H Modified: haiku/trunk/src/apps/charactermap/Jamfile =================================================================== --- haiku/trunk/src/apps/charactermap/Jamfile 2009-04-02 09:09:46 UTC (rev 29862) +++ haiku/trunk/src/apps/charactermap/Jamfile 2009-04-02 09:46:21 UTC (rev 29863) @@ -9,6 +9,7 @@ CharacterView.cpp CharacterWindow.cpp UnicodeBlocks.cpp + UnicodeBlockView.cpp : be : CharacterMap.rdef Added: haiku/trunk/src/apps/charactermap/UnicodeBlockView.cpp =================================================================== --- haiku/trunk/src/apps/charactermap/UnicodeBlockView.cpp 2009-04-02 09:09:46 UTC (rev 29862) +++ haiku/trunk/src/apps/charactermap/UnicodeBlockView.cpp 2009-04-02 09:46:21 UTC (rev 29863) @@ -0,0 +1,135 @@ +/* + * Copyright 2009, Axel D?rfler, axeld at pinc-software.de. + * Distributed under the terms of the MIT License. + */ + + +#include "UnicodeBlockView.h" + +#include +#include + +#include "UnicodeBlocks.h" + + +BlockListItem::BlockListItem(const char* label, uint32 blockIndex) + : BStringItem(label), + fBlockIndex(blockIndex) +{ +} + + +// #pragma mark - + + +UnicodeBlockView::UnicodeBlockView(const char* name) + : BListView(name), + fBlocks(kNumUnicodeBlocks, true), + fShowPrivateBlocks(false), + fShowContainedBlocksOnly(false) +{ +} + + +UnicodeBlockView::~UnicodeBlockView() +{ +} + + +void +UnicodeBlockView::SetFilter(const char* filter) +{ + fFilter = filter; + _UpdateBlocks(); +} + + +void +UnicodeBlockView::ShowPrivateBlocks(bool show) +{ + if (fShowPrivateBlocks == show) + return; + + fShowPrivateBlocks = show; + _UpdateBlocks(); +} + + +void +UnicodeBlockView::ShowContainedBlocksOnly(bool show) +{ + if (fShowContainedBlocksOnly == show) + return; + + fShowContainedBlocksOnly = show; + _UpdateBlocks(); +} + + +bool +UnicodeBlockView::IsShowingBlock(int32 blockIndex) const +{ + if (blockIndex < 0 || blockIndex >= (int32)kNumUnicodeBlocks) + return false; + + if (!fShowPrivateBlocks && kUnicodeBlocks[blockIndex].private_block) + return false; + + return true; +} + + +void +UnicodeBlockView::AttachedToWindow() +{ + // TODO: if we're calling this in the constructor, strange things happen + _CreateBlocks(); +} + + +void +UnicodeBlockView::DetachedFromWindow() +{ + MakeEmpty(); + fBlocks.MakeEmpty(); +} + + +void +UnicodeBlockView::_UpdateBlocks() +{ + MakeEmpty(); + + for (int32 i = 0; i < fBlocks.CountItems(); i++) { + if (fFilter.Length() != 0) { + if (strcasestr(kUnicodeBlocks[i].name, fFilter.String()) == NULL) + continue; + } + + if (!IsShowingBlock(i)) + continue; + + AddItem(fBlocks.ItemAt(i)); + } +} + + +void +UnicodeBlockView::_CreateBlocks() +{ + float minWidth = 0; + for (uint32 i = 0; i < kNumUnicodeBlocks; i++) { + BlockListItem* item = new BlockListItem(kUnicodeBlocks[i].name, i); + fBlocks.AddItem(item); + + float width = StringWidth(item->Text()); + if (minWidth < width) + minWidth = width; + } + + SetExplicitMinSize(BSize(minWidth / 2, 32)); + SetExplicitMaxSize(BSize(minWidth, B_SIZE_UNSET)); + + _UpdateBlocks(); +} + Added: haiku/trunk/src/apps/charactermap/UnicodeBlockView.h =================================================================== --- haiku/trunk/src/apps/charactermap/UnicodeBlockView.h 2009-04-02 09:09:46 UTC (rev 29862) +++ haiku/trunk/src/apps/charactermap/UnicodeBlockView.h 2009-04-02 09:46:21 UTC (rev 29863) @@ -0,0 +1,59 @@ +/* + * Copyright 2009, Axel D?rfler, axeld at pinc-software.de. + * Distributed under the terms of the MIT License. + */ +#ifndef UNICODE_BLOCK_VIEW_H +#define UNICODE_BLOCK_VIEW_H + + +#include +#include +#include + + +class BlockListItem : public BStringItem { +public: + BlockListItem(const char* label, uint32 blockIndex); + + uint32 BlockIndex() const { return fBlockIndex; } + +private: + uint32 fBlockIndex; +}; + + +class UnicodeBlockView : public BListView { +public: + UnicodeBlockView(const char* name); + virtual ~UnicodeBlockView(); + + void SetFilter(const char* filter); + const char* Filter() const + { return fFilter.String(); } + + void ShowPrivateBlocks(bool show); + bool IsShowingPrivateBlocks() const + { return fShowPrivateBlocks; } + + void ShowContainedBlocksOnly(bool show); + bool IsShowingContainedBlocksOnly() const + { return fShowContainedBlocksOnly; } + + bool IsShowingBlock(int32 blockIndex) const; + +protected: + virtual void AttachedToWindow(); + virtual void DetachedFromWindow(); + +private: + void _UpdateBlocks(); + void _CreateBlocks(); + +private: + BObjectList fBlocks; + BString fFilter; + bool fShowPrivateBlocks; + bool fShowContainedBlocksOnly; +}; + +#endif // UNICODE_BLOCK_VIEW_H Modified: haiku/trunk/src/apps/charactermap/UnicodeBlocks.cpp =================================================================== --- haiku/trunk/src/apps/charactermap/UnicodeBlocks.cpp 2009-04-02 09:09:46 UTC (rev 29862) +++ haiku/trunk/src/apps/charactermap/UnicodeBlocks.cpp 2009-04-02 09:46:21 UTC (rev 29863) @@ -130,7 +130,7 @@ {"Vai", 0xa500, 0xa63f, false, kNoBlock}, {"Cyrillic Extended B", 0xa640, 0xa69f, false, kNoBlock}, {"Modifier Tone Letters", 0xa700, 0xa71f, false, kNoBlock}, - {"Lating Extended D", 0xa720, 0xa7ff, false, kNoBlock}, + {"Latin Extended D", 0xa720, 0xa7ff, false, kNoBlock}, {"Syloti Nagri", 0xa800, 0xa82f, false, kNoBlock}, {"Phags-pa", 0xa840, 0xa87f, false, kNoBlock}, {"Saurashtra", 0xa880, 0xa8df, false, kNoBlock}, From axeld at mail.berlios.de Thu Apr 2 11:51:11 2009 From: axeld at mail.berlios.de (axeld at mail.berlios.de) Date: Thu, 2 Apr 2009 11:51:11 +0200 Subject: [Haiku-commits] r29864 - haiku/trunk/src/apps/charactermap Message-ID: <200904020951.n329pB1b009683@sheep.berlios.de> Author: axeld Date: 2009-04-02 11:51:09 +0200 (Thu, 02 Apr 2009) New Revision: 29864 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29864&view=rev Modified: haiku/trunk/src/apps/charactermap/CharacterWindow.cpp Log: * Improved filter input vs. mouse use behaviour. Modified: haiku/trunk/src/apps/charactermap/CharacterWindow.cpp =================================================================== --- haiku/trunk/src/apps/charactermap/CharacterWindow.cpp 2009-04-02 09:46:21 UTC (rev 29863) +++ haiku/trunk/src/apps/charactermap/CharacterWindow.cpp 2009-04-02 09:51:09 UTC (rev 29864) @@ -72,12 +72,14 @@ { } - int32 ResetMoved() + bool HasMoved() const { - int32 old = fMouseMoved; + return fMouseMoved != 0; + } + + void ResetMoved() + { fMouseMoved = 0; - - return old; } virtual filter_result Filter(BMessage* message, BHandler** /*_target*/) @@ -273,7 +275,7 @@ fCharacterView->ScrollTo(item->BlockIndex()); // Give the filter control focus if we got here by mouse action - if (fMouseMovedFilter->ResetMoved()) + if (fMouseMovedFilter->HasMoved()) fFilterControl->MakeFocus(); break; } @@ -364,12 +366,14 @@ case kMsgFilterChanged: fUnicodeBlockView->SetFilter(fFilterControl->Text()); + fMouseMovedFilter->ResetMoved(); break; case kMsgFilterEntered: - fUnicodeBlockView->MakeFocus(); - fUnicodeBlockView->Select(0); - fMouseMovedFilter->ResetMoved(); + if (!fMouseMovedFilter->HasMoved()) { + fUnicodeBlockView->MakeFocus(); + fUnicodeBlockView->Select(0); + } break; case kMsgClearFilter: From alex at zappotek.com Thu Apr 2 12:00:00 2009 From: alex at zappotek.com (Alexandre Deckner) Date: Thu, 02 Apr 2009 12:00:00 +0200 Subject: [Haiku-commits] r29861 - haiku/trunk/src/servers/app/drawing In-Reply-To: <200904020905.n3295op6003549@sheep.berlios.de> References: <200904020905.n3295op6003549@sheep.berlios.de> Message-ID: <49D48CA0.4030706@zappotek.com> axeld at BerliOS wrote: > + // NOTE: I am not quite sure yet how this can happen, but apparantly it > + // can (see bug #634). > + // This function is used for internal app_server painting, in the case of > + // bug #634, the background of views is painted. But the view region > + // should never be outside the frame buffer bounds. Hehe :) You mean "apparently"? Alex From axeld at mail.berlios.de Thu Apr 2 12:01:08 2009 From: axeld at mail.berlios.de (axeld at mail.berlios.de) Date: Thu, 2 Apr 2009 12:01:08 +0200 Subject: [Haiku-commits] r29865 - haiku/trunk/src/apps/charactermap Message-ID: <200904021001.n32A18S9011174@sheep.berlios.de> Author: axeld Date: 2009-04-02 12:01:05 +0200 (Thu, 02 Apr 2009) New Revision: 29865 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29865&view=rev Modified: haiku/trunk/src/apps/charactermap/CharacterWindow.cpp haiku/trunk/src/apps/charactermap/CharacterWindow.h Log: * Got rid of the mouse move heuristics again, and tried a cleaner approach by redirecting up/down keys to the list view. Modified: haiku/trunk/src/apps/charactermap/CharacterWindow.cpp =================================================================== --- haiku/trunk/src/apps/charactermap/CharacterWindow.cpp 2009-04-02 09:51:09 UTC (rev 29864) +++ haiku/trunk/src/apps/charactermap/CharacterWindow.cpp 2009-04-02 10:01:05 UTC (rev 29865) @@ -38,7 +38,6 @@ static const uint32 kMsgPrivateBlocks = 'prbl'; static const uint32 kMsgContainedBlocks = 'cnbl'; static const uint32 kMsgFilterChanged = 'fltr'; -static const uint32 kMsgFilterEntered = 'flte'; static const uint32 kMsgClearFilter = 'clrf'; static const int32 kMinFontSize = 10; @@ -65,31 +64,29 @@ mutable char fText[32]; }; -class MouseMovedFilter : public BMessageFilter { +class RedirectUpAndDownFilter : public BMessageFilter { public: - MouseMovedFilter() - : BMessageFilter(B_ANY_DELIVERY, B_ANY_SOURCE, B_MOUSE_MOVED) + RedirectUpAndDownFilter(BHandler* target) + : BMessageFilter(B_ANY_DELIVERY, B_ANY_SOURCE, B_KEY_DOWN), + fTarget(target) { } - bool HasMoved() const + virtual filter_result Filter(BMessage* message, BHandler** _target) { - return fMouseMoved != 0; - } + const char* bytes; + if (message->FindString("bytes", &bytes) != B_OK) + return B_DISPATCH_MESSAGE; - void ResetMoved() - { - fMouseMoved = 0; - } + if (bytes[0] == B_UP_ARROW + || bytes[0] == B_DOWN_ARROW) + *_target = fTarget; - virtual filter_result Filter(BMessage* message, BHandler** /*_target*/) - { - fMouseMoved++; return B_DISPATCH_MESSAGE; } private: - int32 fMouseMoved; + BHandler* fTarget; }; class EscapeMessageFilter : public BMessageFilter { @@ -137,7 +134,7 @@ BMenuBar* menuBar = new BMenuBar("menu"); - fFilterControl = new BTextControl("Filter:", NULL, new BMessage(kMsgFilterEntered)); + fFilterControl = new BTextControl("Filter:", NULL, NULL); fFilterControl->SetModificationMessage(new BMessage(kMsgFilterChanged)); BButton* clearButton = new BButton("clear", "Clear", @@ -240,8 +237,7 @@ menuBar->AddItem(_CreateFontMenu()); AddCommonFilter(new EscapeMessageFilter(kMsgClearFilter)); - fMouseMovedFilter = new MouseMovedFilter(); - AddCommonFilter(fMouseMovedFilter); + AddCommonFilter(new RedirectUpAndDownFilter(fUnicodeBlockView)); // TODO: why is this needed? fUnicodeBlockView->SetTarget(this); @@ -274,9 +270,7 @@ = static_cast(fUnicodeBlockView->ItemAt(index)); fCharacterView->ScrollTo(item->BlockIndex()); - // Give the filter control focus if we got here by mouse action - if (fMouseMovedFilter->HasMoved()) - fFilterControl->MakeFocus(); + fFilterControl->MakeFocus(); break; } @@ -366,16 +360,9 @@ case kMsgFilterChanged: fUnicodeBlockView->SetFilter(fFilterControl->Text()); - fMouseMovedFilter->ResetMoved(); + fUnicodeBlockView->Select(0); break; - case kMsgFilterEntered: - if (!fMouseMovedFilter->HasMoved()) { - fUnicodeBlockView->MakeFocus(); - fUnicodeBlockView->Select(0); - } - break; - case kMsgClearFilter: fFilterControl->SetText(""); fFilterControl->MakeFocus(); Modified: haiku/trunk/src/apps/charactermap/CharacterWindow.h =================================================================== --- haiku/trunk/src/apps/charactermap/CharacterWindow.h 2009-04-02 09:51:09 UTC (rev 29864) +++ haiku/trunk/src/apps/charactermap/CharacterWindow.h 2009-04-02 10:01:05 UTC (rev 29865) @@ -17,7 +17,6 @@ class BStringView; class BTextControl; class CharacterView; -class MouseMovedFilter; class UnicodeBlockView; @@ -44,7 +43,6 @@ BMenuItem* fSelectedFontItem; BSlider* fFontSizeSlider; BStringView* fCodeView; - MouseMovedFilter* fMouseMovedFilter; }; #endif // CHARACTER_WINDOW_H From axeld at pinc-software.de Thu Apr 2 12:04:35 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Thu, 02 Apr 2009 12:04:35 +0200 CEST Subject: [Haiku-commits] r29861 - haiku/trunk/src/servers/app/drawing In-Reply-To: <49D48CA0.4030706@zappotek.com> Message-ID: <12258014120-BeMail@zon> Alexandre Deckner wrote: > axeld at BerliOS wrote: > > + // NOTE: I am not quite sure yet how this can happen, but > > apparantly it > > + // can (see bug #634). > > + // This function is used for internal app_server painting, > > in the case of > > + // bug #634, the background of views is painted. But the > > view region > > + // should never be outside the frame buffer bounds. > Hehe :) You mean "apparently"? Damn, missed that character ;-) Bye, Axel. From axeld at mail.berlios.de Thu Apr 2 12:05:14 2009 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Thu, 2 Apr 2009 12:05:14 +0200 Subject: [Haiku-commits] r29866 - haiku/trunk/src/servers/app/drawing Message-ID: <200904021005.n32A5EBS011651@sheep.berlios.de> Author: axeld Date: 2009-04-02 12:05:13 +0200 (Thu, 02 Apr 2009) New Revision: 29866 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29866&view=rev Modified: haiku/trunk/src/servers/app/drawing/DrawingEngine.cpp Log: * This time, I actually got it right, thanks Alexandre... Modified: haiku/trunk/src/servers/app/drawing/DrawingEngine.cpp =================================================================== --- haiku/trunk/src/servers/app/drawing/DrawingEngine.cpp 2009-04-02 10:01:05 UTC (rev 29865) +++ haiku/trunk/src/servers/app/drawing/DrawingEngine.cpp 2009-04-02 10:05:13 UTC (rev 29866) @@ -861,7 +861,7 @@ // NOTE: region expected to be already clipped correctly!! BRect frame = r.Frame(); if (!fPainter->Bounds().Contains(frame)) { - // NOTE: I am not quite sure yet how this can happen, but apparantly it + // NOTE: I am not quite sure yet how this can happen, but apparently it // can (see bug #634). // This function is used for internal app_server painting, in the case of // bug #634, the background of views is painted. But the view region From axeld at mail.berlios.de Thu Apr 2 12:15:14 2009 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Thu, 2 Apr 2009 12:15:14 +0200 Subject: [Haiku-commits] r29867 - haiku/trunk/src/kits/interface Message-ID: <200904021015.n32AFE7J012897@sheep.berlios.de> Author: axeld Date: 2009-04-02 12:15:14 +0200 (Thu, 02 Apr 2009) New Revision: 29867 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29867&view=rev Modified: haiku/trunk/src/kits/interface/Font.cpp Log: * At least pretend to support all unicode blocks, and don't make such obvious lies. Modified: haiku/trunk/src/kits/interface/Font.cpp =================================================================== --- haiku/trunk/src/kits/interface/Font.cpp 2009-04-02 10:05:13 UTC (rev 29866) +++ haiku/trunk/src/kits/interface/Font.cpp 2009-04-02 10:15:14 UTC (rev 29867) @@ -866,7 +866,7 @@ BFont::Blocks() const { // TODO: Add Block support - return unicode_block(); + return unicode_block(~0LL, ~0LL); } From axeld at mail.berlios.de Thu Apr 2 18:07:10 2009 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Thu, 2 Apr 2009 18:07:10 +0200 Subject: [Haiku-commits] r29868 - haiku/trunk/src/system/kernel/disk_device_manager Message-ID: <200904021607.n32G7ARk000228@sheep.berlios.de> Author: axeld Date: 2009-04-02 18:07:09 +0200 (Thu, 02 Apr 2009) New Revision: 29868 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29868&view=rev Modified: haiku/trunk/src/system/kernel/disk_device_manager/ddm_userland_interface.cpp Log: * Minor cleanup. Modified: haiku/trunk/src/system/kernel/disk_device_manager/ddm_userland_interface.cpp =================================================================== --- haiku/trunk/src/system/kernel/disk_device_manager/ddm_userland_interface.cpp 2009-04-02 10:15:14 UTC (rev 29867) +++ haiku/trunk/src/system/kernel/disk_device_manager/ddm_userland_interface.cpp 2009-04-02 16:07:09 UTC (rev 29868) @@ -12,10 +12,11 @@ \brief Interface for userspace calls. */ +#include + #include #include -#include #include #include #include @@ -1282,7 +1283,7 @@ if (!partition->CheckAndMarkBusy(true)) return B_BUSY; -// TODO: We should also check, if any partition is mounted! + // TODO: We should also check, if any partition is mounted! // uninitialize error = partition->UninitializeContents(true); @@ -1306,7 +1307,6 @@ off_t offset, off_t size, const char* _type, const char* _name, const char* _parameters, size_t parametersSize, partition_id* childID, int32* childChangeCounter) - { // copy parameters in UserStringParameter type; @@ -1437,12 +1437,7 @@ return error; // return change counter - if ((error = copy_to_user_value(_changeCounter, partition->ChangeCounter())) - != B_OK) { - return error; - } - - return B_OK; + return copy_to_user_value(_changeCounter, partition->ChangeCounter()); } From axeld at mail.berlios.de Thu Apr 2 18:08:14 2009 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Thu, 2 Apr 2009 18:08:14 +0200 Subject: [Haiku-commits] r29869 - haiku/trunk/headers/private/shared Message-ID: <200904021608.n32G8EJf000361@sheep.berlios.de> Author: axeld Date: 2009-04-02 18:08:13 +0200 (Thu, 02 Apr 2009) New Revision: 29869 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29869&view=rev Modified: haiku/trunk/headers/private/shared/OpenHashTable.h Log: * Fixed build when Debug.h had already been included. * Automatic whitespace cleanup. Modified: haiku/trunk/headers/private/shared/OpenHashTable.h =================================================================== --- haiku/trunk/headers/private/shared/OpenHashTable.h 2009-04-02 16:07:09 UTC (rev 29868) +++ haiku/trunk/headers/private/shared/OpenHashTable.h 2009-04-02 16:08:13 UTC (rev 29869) @@ -49,9 +49,13 @@ #include // don't include -#define ASSERT(E) (void)0 -#define TRESPASS() (void)0 - +#ifndef ASSERT +# define ASSERT(E) (void)0 +#endif +#ifndef TRESPASS +# define TRESPASS() (void)0 +#endif + namespace BPrivate { template @@ -89,17 +93,17 @@ // it is up to the subclass of OpenHashTable to supply // elementVector ~OpenHashTable(); - + bool InitCheck() const; void SetElementVector(ElementVec *elementVector); - + Element *FindFirst(uint32 elementHash) const; Element *Add(uint32 elementHash); - + void Remove(Element *element, bool dontRehash = false); void RemoveAll(); - + // when calling Add, any outstanding element pointer may become // invalid; to deal with this, get the element index and restore // it after the add @@ -116,7 +120,7 @@ private: bool _RehashIfNeeded(); bool _Rehash(); - + int32 fArraySize; int32 fInitialSize; int32 fElementCount; @@ -189,7 +193,7 @@ } template -int32 +int32 OpenHashTable::OptimalSize(int32 minSize) { for (int32 index = 0; ; index++) @@ -207,12 +211,12 @@ hash %= fArraySize; if (fHashArray[hash] < 0) return 0; - + return &fElementVector->At(fHashArray[hash]); } template -int32 +int32 OpenHashTable::ElementIndex(const Element *element) const { return fElementVector->IndexOf(*element); @@ -226,21 +230,21 @@ } template -int32 +int32 OpenHashTable::ArraySize() const { return fArraySize; } template -int32 +int32 OpenHashTable::VectorSize() const { return fElementVector->Size(); } template -int32 +int32 OpenHashTable::CountElements() const { return fElementCount; @@ -264,7 +268,7 @@ } template -void +void OpenHashTable::Remove(Element *element, bool dontRehash) { if (!dontRehash) @@ -287,7 +291,7 @@ TRESPASS(); return; } - + if (&fElementVector->At(next) == element) { fElementVector->At(index).fNext = element->fNext; fElementVector->Remove(next); @@ -299,7 +303,7 @@ } template -void +void OpenHashTable::RemoveAll() { for (int32 i = 0; fElementCount > 0 && i < fArraySize; i++) { @@ -317,7 +321,7 @@ } template -void +void OpenHashTable::SetElementVector(ElementVec *elementVector) { fElementVector = elementVector; @@ -419,18 +423,18 @@ } template -int32 +int32 OpenHashElementArray::IndexOf(const Element &element) const { int32 result = &element - fData; if (result < 0 || result > fSize) return -1; - + return result; } template -int32 +int32 OpenHashElementArray::Size() const { return fSize; @@ -460,7 +464,7 @@ int32 index = fNextFree; if (fNextDeleted >= 0) { index = fNextDeleted; - fNextDeleted = At(index).fNext; + fNextDeleted = At(index).fNext; } else if (fNextFree >= fSize - 1) { int32 newSize = fSize + kGrowChunk; /* @@ -486,11 +490,11 @@ // call placement new to initialize the element properly ASSERT(At(index).fNext == -1); - return &At(index); + return &At(index); } template -void +void OpenHashElementArray::Remove(int32 index) { // delete by chaining empty elements in a single linked From axeld at mail.berlios.de Thu Apr 2 18:54:12 2009 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Thu, 2 Apr 2009 18:54:12 +0200 Subject: [Haiku-commits] r29870 - haiku/trunk/src/add-ons/kernel/network/stack Message-ID: <200904021654.n32GsCEB024107@sheep.berlios.de> Author: axeld Date: 2009-04-02 18:54:11 +0200 (Thu, 02 Apr 2009) New Revision: 29870 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29870&view=rev Modified: haiku/trunk/src/add-ons/kernel/network/stack/net_buffer.cpp Log: * Minor cleanup. Modified: haiku/trunk/src/add-ons/kernel/network/stack/net_buffer.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/network/stack/net_buffer.cpp 2009-04-02 16:08:13 UTC (rev 29869) +++ haiku/trunk/src/add-ons/kernel/network/stack/net_buffer.cpp 2009-04-02 16:54:11 UTC (rev 29870) @@ -1074,7 +1074,7 @@ return NULL; TRACE(("%ld: duplicate: %p)\n", find_thread(NULL), duplicate)); - + // copy the data from the source buffer data_node *node = (data_node *)list_get_first_item(&buffer->buffers); @@ -1310,9 +1310,10 @@ } else { // we need a new place for this node data_node *newNode = add_data_node(buffer, node->header); - if (newNode == NULL) -// TODO: try to revert buffers to their initial state!! + if (newNode == NULL) { + // TODO: try to revert buffers to their initial state!! return ENOBUFS; + } last = node; *newNode = *node; @@ -1502,7 +1503,7 @@ if (_contiguousBuffer) *_contiguousBuffer = node->start; - // adjust offset of following nodes + // adjust offset of following nodes while ((node = (data_node *)list_get_next_item(&buffer->buffers, node)) != NULL) { node->offset += size; } @@ -1701,7 +1702,7 @@ node = (data_node *)list_get_next_item(&buffer->buffers, node); } - // adjust offset of following nodes + // adjust offset of following nodes while (node != NULL) { node->offset -= bytes; node = (data_node *)list_get_next_item(&buffer->buffers, node); From bonefish at mail.berlios.de Thu Apr 2 19:46:10 2009 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Thu, 2 Apr 2009 19:46:10 +0200 Subject: [Haiku-commits] r29871 - haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse Message-ID: <200904021746.n32HkA5n019228@sheep.berlios.de> Author: bonefish Date: 2009-04-02 19:46:09 +0200 (Thu, 02 Apr 2009) New Revision: 29871 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29871&view=rev Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/FUSEFileSystem.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/FUSEFileSystem.h haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/FUSEVolume.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/fuse_config.c haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/fuse_main.cpp Log: * Initialize fuse_config before parsing the arguments. * Implemented fuse_is_lib_option() more correctly. * Actually use the value of the "use_ino" option. Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/FUSEFileSystem.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/FUSEFileSystem.cpp 2009-04-02 16:54:11 UTC (rev 29870) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/FUSEFileSystem.cpp 2009-04-02 17:46:09 UTC (rev 29871) @@ -243,6 +243,8 @@ PRINT(("FUSEFileSystem::FinishInitClientFS()\n")); fExitStatus = B_ERROR; + fFUSEConfig = *config; + // do the initialization status_t error = _InitClientFS(ops, opSize, userData); Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/FUSEFileSystem.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/FUSEFileSystem.h 2009-04-02 16:54:11 UTC (rev 29870) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/FUSEFileSystem.h 2009-04-02 17:46:09 UTC (rev 29871) @@ -8,11 +8,9 @@ #include "../FileSystem.h" #include "fuse_api.h" +#include "fuse_config.h" -struct fuse_config; - - namespace UserlandFS { class FUSEFileSystem : public FileSystem { @@ -35,6 +33,8 @@ fuse_fs* GetFS() const { return fFS; } + const fuse_config& GetFUSEConfig() const { return fFUSEConfig; } + virtual status_t CreateVolume(Volume** _volume, dev_t id); virtual status_t DeleteVolume(Volume* volume); @@ -68,6 +68,7 @@ const char* fInitParameters; fuse_fs* fFS; fuse_conn_info fConnectionInfo; + fuse_config fFUSEConfig; FSVolumeCapabilities fVolumeCapabilities; FSVNodeCapabilities fNodeCapabilities; Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/FUSEVolume.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/FUSEVolume.cpp 2009-04-02 16:54:11 UTC (rev 29870) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/FUSEVolume.cpp 2009-04-02 17:46:09 UTC (rev 29871) @@ -670,6 +670,9 @@ fFS = _FileSystem()->GetFS(); _FileSystem()->GetVolumeCapabilities(fCapabilities); + const fuse_config& config = _FileSystem()->GetFUSEConfig(); + fUseNodeIDs = config.use_ino; + // get the root node struct stat st; int fuseError = fuse_fs_getattr(fFS, "/", &st); Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/fuse_config.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/fuse_config.c 2009-04-02 16:54:11 UTC (rev 29870) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/fuse_config.c 2009-04-02 17:46:09 UTC (rev 29871) @@ -9,7 +9,7 @@ #include "fuse_config.h" -enum { +enum { KEY_HELP, }; @@ -65,3 +65,11 @@ { return fuse_opt_parse(args, config, fuse_lib_opts, fuse_lib_opt_proc) == 0; } + + +int +fuse_is_lib_option(const char* opt) +{ + return /*fuse_lowlevel_is_lib_option(opt) ||*/ + fuse_opt_match(fuse_lib_opts, opt); +} Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/fuse_main.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/fuse_main.cpp 2009-04-02 16:54:11 UTC (rev 29870) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/fuse_main.cpp 2009-04-02 17:46:09 UTC (rev 29871) @@ -3,8 +3,7 @@ * Distributed under the terms of the MIT License. */ -#define FUSE_USE_VERSION FUSE_VERSION - +#include #include #include "fuse_api.h" @@ -21,7 +20,14 @@ // parse args struct fuse_args args = FUSE_ARGS_INIT(argc, argv); + fuse_config config; + memset(&config, 0, sizeof(config)); + config.entry_timeout = 1.0; + config.attr_timeout = 1.0; + config.negative_timeout = 0.0; + config.intr_signal = SIGUSR1; + bool success = fuse_parse_config_args(&args, &config); fuse_opt_free_args(&args); @@ -38,15 +44,6 @@ int -fuse_is_lib_option(const char* opt) -{ -printf("fuse_is_lib_option(\"%s\")\n", opt); - // TODO: Implement! - return 0; -} - - -int fuse_version(void) { return FUSE_VERSION; From bonefish at mail.berlios.de Thu Apr 2 21:41:54 2009 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Thu, 2 Apr 2009 21:41:54 +0200 Subject: [Haiku-commits] r29872 - in haiku/trunk: headers/private/userlandfs/private src/add-ons/kernel/file_systems/userlandfs/kernel_add_on src/add-ons/kernel/file_systems/userlandfs/server src/add-ons/kernel/file_systems/userlandfs/server/fuse Message-ID: <200904021941.n32Jfs5n001654@sheep.berlios.de> Author: bonefish Date: 2009-04-02 21:41:53 +0200 (Thu, 02 Apr 2009) New Revision: 29872 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29872&view=rev Modified: haiku/trunk/headers/private/userlandfs/private/Requests.h haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/FileSystem.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/FileSystem.h haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/RequestThread.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/RequestThread.h haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/UserlandRequestHandler.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/FUSEFileSystem.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/FUSEFileSystem.h haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/FUSEVolume.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/fuse_main.cpp Log: * For every request to userland we also send the team/thread/user/group ID of the current thread, now. Implemented by introducing a new base class KernelRequest which has respective attributes. * Server: RequestThreadContext does now also save the request that is being processed. Furthermore some space has been reserved for file system specific data, which can be initialized by the new FileSystem::InitRequestThreadContext(). * FUSE library: Implemented fuse_get_context() using the new RequestThreadContext feature. Modified: haiku/trunk/headers/private/userlandfs/private/Requests.h =================================================================== --- haiku/trunk/headers/private/userlandfs/private/Requests.h 2009-04-02 17:46:09 UTC (rev 29871) +++ haiku/trunk/headers/private/userlandfs/private/Requests.h 2009-04-02 19:41:53 UTC (rev 29872) @@ -256,10 +256,21 @@ // #pragma mark - kernel requests +// KernelRequest +class KernelRequest : public Request { +public: + KernelRequest(uint32 type) : Request(type) {} + + team_id team; + thread_id thread; + uid_t user; + gid_t group; +}; + // VolumeRequest -class VolumeRequest : public Request { +class VolumeRequest : public KernelRequest { public: - VolumeRequest(uint32 type) : Request(type) {} + VolumeRequest(uint32 type) : KernelRequest(type) {} void* volume; }; @@ -365,9 +376,9 @@ // MountVolumeRequest -class MountVolumeRequest : public Request { +class MountVolumeRequest : public KernelRequest { public: - MountVolumeRequest() : Request(MOUNT_VOLUME_REQUEST) {} + MountVolumeRequest() : KernelRequest(MOUNT_VOLUME_REQUEST) {} status_t GetAddressInfos(AddressInfo* infos, int32* count); dev_t nsid; @@ -2235,6 +2246,7 @@ } // namespace UserlandFSUtil using UserlandFSUtil::ReplyRequest; +using UserlandFSUtil::KernelRequest; using UserlandFSUtil::VolumeRequest; using UserlandFSUtil::NodeRequest; using UserlandFSUtil::FileRequest; Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.cpp 2009-04-02 17:46:09 UTC (rev 29871) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.cpp 2009-04-02 19:41:53 UTC (rev 29872) @@ -18,6 +18,7 @@ #include #include // kernel private +#include #include "IORequest.h" // kernel internal @@ -4327,6 +4328,15 @@ Volume::_SendRequest(RequestPort* port, RequestAllocator* allocator, RequestHandler* handler, Request** reply) { + // fill in the caller info + KernelRequest* request = static_cast( + allocator->GetRequest()); + struct thread* thread = thread_get_current_thread(); + request->team = thread->team->id; + request->thread = thread->id; + request->user = geteuid(); + request->group = getegid(); + if (!fFileSystem->IsUserlandServerThread()) return port->SendRequest(allocator, handler, reply); // Here it gets dangerous: a thread of the userland server team being here Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/FileSystem.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/FileSystem.cpp 2009-04-02 17:46:09 UTC (rev 29871) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/FileSystem.cpp 2009-04-02 19:41:53 UTC (rev 29872) @@ -1,4 +1,7 @@ -// FileSystem.cpp +/* + * Copyright 2001-2009, Ingo Weinhold, ingo_weinhold at gmx.de. + * Distributed under the terms of the MIT License. + */ #include "FileSystem.h" @@ -33,6 +36,12 @@ void +FileSystem::InitRequestThreadContext(RequestThreadContext* context) +{ +} + + +void FileSystem::RegisterVolume(Volume* volume) { AutoLocker _(fLock); Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/FileSystem.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/FileSystem.h 2009-04-02 17:46:09 UTC (rev 29871) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/FileSystem.h 2009-04-02 19:41:53 UTC (rev 29872) @@ -1,5 +1,7 @@ -// FileSystem.h - +/* + * Copyright 2001-2009, Ingo Weinhold, ingo_weinhold at gmx.de. + * Distributed under the terms of the MIT License. + */ #ifndef USERLAND_FS_FILE_SYSTEM_H #define USERLAND_FS_FILE_SYSTEM_H @@ -15,8 +17,10 @@ namespace UserlandFS { +class RequestThreadContext; class Volume; + class FileSystem { public: FileSystem(const char* fsName); @@ -29,6 +33,9 @@ virtual status_t CreateVolume(Volume** volume, dev_t id) = 0; virtual status_t DeleteVolume(Volume* volume) = 0; + virtual void InitRequestThreadContext( + RequestThreadContext* context); + void RegisterVolume(Volume* volume); void UnregisterVolume(Volume* volume); Volume* VolumeWithID(dev_t id); Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/RequestThread.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/RequestThread.cpp 2009-04-02 17:46:09 UTC (rev 29871) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/RequestThread.cpp 2009-04-02 19:41:53 UTC (rev 29872) @@ -1,28 +1,39 @@ -// RequestThread.cpp +/* + * Copyright 2001-2009, Ingo Weinhold, ingo_weinhold at gmx.de. + * Distributed under the terms of the MIT License. + */ +#include "RequestThread.h" + #include #include -#include "RequestThread.h" +#include "FileSystem.h" #include "ServerDefs.h" #include "UserlandRequestHandler.h" +#include "Volume.h" -using std::nothrow; static const int32 sTLSVariable = tls_allocate(); + // constructor -RequestThreadContext::RequestThreadContext(Volume* volume) - : fPreviousContext(NULL), - fThread(NULL), - fVolume(volume) +RequestThreadContext::RequestThreadContext(Volume* volume, + KernelRequest* request) + : + fPreviousContext(NULL), + fThread(NULL), + fVolume(volume), + fRequest(request) { fThread = RequestThread::GetCurrentThread(); if (fThread) { fPreviousContext = fThread->GetContext(); fThread->SetContext(this); } + + volume->GetFileSystem()->InitRequestThreadContext(this); } // destructor @@ -74,7 +85,7 @@ if (!fileSystem) return B_BAD_VALUE; // create the port - fPort = new(nothrow) RequestPort(kRequestPortSize); + fPort = new(std::nothrow) RequestPort(kRequestPortSize); if (!fPort) return B_NO_MEMORY; status_t error = fPort->InitCheck(); Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/RequestThread.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/RequestThread.h 2009-04-02 17:46:09 UTC (rev 29871) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/RequestThread.h 2009-04-02 19:41:53 UTC (rev 29872) @@ -1,5 +1,7 @@ -// RequestThread.h - +/* + * Copyright 2001-2009, Ingo Weinhold, ingo_weinhold at gmx.de. + * Distributed under the terms of the MIT License. + */ #ifndef USERLAND_FS_REQUEST_THREAD_H #define USERLAND_FS_REQUEST_THREAD_H @@ -11,19 +13,26 @@ class RequestThread; class Volume; +#define REQUEST_THREAD_CONTEXT_FS_DATA_SIZE 256 + // RequestThreadContext class RequestThreadContext { public: - RequestThreadContext(Volume* volume); + RequestThreadContext(Volume* volume, + KernelRequest* request); ~RequestThreadContext(); RequestThread* GetThread() const; Volume* GetVolume() const; + KernelRequest* GetRequest() const { return fRequest; } + void* GetFSData() { return fFSData; } private: RequestThreadContext* fPreviousContext; RequestThread* fThread; Volume* fVolume; + KernelRequest* fRequest; + uint8 fFSData[REQUEST_THREAD_CONTEXT_FS_DATA_SIZE]; }; // RequestThread Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/UserlandRequestHandler.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/UserlandRequestHandler.cpp 2009-04-02 17:46:09 UTC (rev 29871) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/UserlandRequestHandler.cpp 2009-04-02 19:41:53 UTC (rev 29872) @@ -51,6 +51,7 @@ fDone = true; return B_OK; } + switch (request->GetType()) { // FS case MOUNT_VOLUME_REQUEST: @@ -253,7 +254,7 @@ // mount it ino_t rootID; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->Mount(device, request->flags, (const char*)request->parameters.GetData(), &rootID); if (result != B_OK) @@ -288,7 +289,7 @@ if (!volume) result = B_BAD_VALUE; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->Unmount(); } @@ -314,7 +315,7 @@ if (!volume) result = B_BAD_VALUE; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->Sync(); } // prepare the reply @@ -340,7 +341,7 @@ result = B_BAD_VALUE; fs_info info; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->ReadFSInfo(&info); } // prepare the reply @@ -366,7 +367,7 @@ if (!volume) result = B_BAD_VALUE; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->WriteFSInfo(&request->info, request->mask); } @@ -398,7 +399,7 @@ ino_t vnid = 0; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->Lookup(request->node, (const char*)request->entryName.GetData(), &vnid); } @@ -444,7 +445,7 @@ // execute the request if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->GetVNodeName(node, buffer, bufferSize); } @@ -471,7 +472,7 @@ uint32 flags; FSVNodeCapabilities capabilities; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->ReadVNode(request->vnid, request->reenter, &node, &type, &flags, &capabilities); } @@ -504,7 +505,7 @@ result = B_BAD_VALUE; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->WriteVNode(request->node, request->reenter); } @@ -532,7 +533,7 @@ result = B_BAD_VALUE; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->RemoveVNode(request->node, request->reenter); } @@ -563,7 +564,7 @@ result = B_BAD_VALUE; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); IORequestInfo requestInfo(request->request, request->isWrite, request->offset, request->length); result = volume->DoIO(request->node, request->fileCookie, requestInfo); @@ -593,7 +594,7 @@ result = B_BAD_VALUE; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->CancelIO(request->node, request->fileCookie, request->request); } @@ -625,7 +626,7 @@ file_io_vec vecs[IterativeIOGetVecsReply::MAX_VECS]; size_t vecCount = IterativeIOGetVecsReply::MAX_VECS; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->IterativeIOGetVecs(request->cookie, request->request, request->offset, request->size, vecs, &vecCount); if (result == B_OK) { @@ -664,7 +665,7 @@ result = B_BAD_VALUE; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->IterativeIOFinished(request->cookie, request->request, request->status, request->partialTransfer, request->bytesTransferred); @@ -729,7 +730,7 @@ // execute the request status_t ioctlError = B_OK; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); ioctlError = volume->IOCtl(request->node, request->fileCookie, request->command, buffer, len); } @@ -754,7 +755,7 @@ result = B_BAD_VALUE; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->SetFlags(request->node, request->fileCookie, request->flags); } @@ -783,7 +784,7 @@ result = B_BAD_VALUE; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->Select(request->node, request->fileCookie, request->event, request->sync); } @@ -812,7 +813,7 @@ result = B_BAD_VALUE; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->Deselect(request->node, request->fileCookie, request->event, request->sync); } @@ -841,7 +842,7 @@ result = B_BAD_VALUE; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->FSync(request->node); } @@ -886,7 +887,7 @@ // execute the request size_t bytesRead; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->ReadSymlink(node, buffer, bufferSize, &bytesRead); } @@ -910,7 +911,7 @@ result = B_BAD_VALUE; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->CreateSymlink(request->node, (const char*)request->name.GetData(), (const char*)request->target.GetData(), request->mode); @@ -940,7 +941,7 @@ result = B_BAD_VALUE; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->Link(request->node, (const char*)request->name.GetData(), request->target); } @@ -969,7 +970,7 @@ result = B_BAD_VALUE; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->Unlink(request->node, (const char*)request->name.GetData()); } @@ -998,7 +999,7 @@ result = B_BAD_VALUE; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->Rename(request->oldDir, (const char*)request->oldName.GetData(), request->newDir, (const char*)request->newName.GetData()); @@ -1028,7 +1029,7 @@ result = B_BAD_VALUE; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->Access(request->node, request->mode); } @@ -1057,7 +1058,7 @@ struct stat st; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->ReadStat(request->node, &st); } @@ -1086,7 +1087,7 @@ result = B_BAD_VALUE; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->WriteStat(request->node, &request->st, request->mask); } @@ -1120,7 +1121,7 @@ ino_t vnid; void* fileCookie; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->Create(request->node, (const char*)request->name.GetData(), request->openMode, request->mode, &fileCookie, &vnid); @@ -1153,7 +1154,7 @@ void* fileCookie; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->Open(request->node, request->openMode, &fileCookie); } @@ -1182,7 +1183,7 @@ result = B_BAD_VALUE; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->Close(request->node, request->fileCookie); } @@ -1210,7 +1211,7 @@ result = B_BAD_VALUE; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->FreeCookie(request->node, request->fileCookie); } @@ -1258,7 +1259,7 @@ // execute the request size_t bytesRead; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->Read(node, fileCookie, pos, buffer, size, &bytesRead); } @@ -1283,7 +1284,7 @@ size_t bytesWritten; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->Write(request->node, request->fileCookie, request->pos, request->buffer.GetData(), request->buffer.GetSize(), &bytesWritten); @@ -1318,7 +1319,7 @@ result = B_BAD_VALUE; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->CreateDir(request->node, (const char*)request->name.GetData(), request->mode); } @@ -1347,7 +1348,7 @@ result = B_BAD_VALUE; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->RemoveDir(request->node, (const char*)request->name.GetData()); } @@ -1377,7 +1378,7 @@ void* dirCookie = NULL; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->OpenDir(request->node, &dirCookie); } @@ -1406,7 +1407,7 @@ result = B_BAD_VALUE; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->CloseDir(request->node, request->dirCookie); } @@ -1434,7 +1435,7 @@ result = B_BAD_VALUE; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->FreeDirCookie(request->node, request->dirCookie); } @@ -1482,7 +1483,7 @@ // execute the request uint32 countRead; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->ReadDir(node, dirCookie, buffer, bufferSize, count, &countRead); } @@ -1517,7 +1518,7 @@ result = B_BAD_VALUE; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->RewindDir(request->node, request->dirCookie); } @@ -1550,7 +1551,7 @@ void* attrDirCookie; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->OpenAttrDir(request->node, &attrDirCookie); } @@ -1579,7 +1580,7 @@ result = B_BAD_VALUE; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->CloseAttrDir(request->node, request->attrDirCookie); } @@ -1607,7 +1608,7 @@ result = B_BAD_VALUE; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->FreeAttrDirCookie(request->node, request->attrDirCookie); } @@ -1656,7 +1657,7 @@ // execute the request uint32 countRead; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->ReadAttrDir(node, attrDirCookie, buffer, bufferSize, count, &countRead); } @@ -1681,7 +1682,7 @@ result = B_BAD_VALUE; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->RewindAttrDir(request->node, request->attrDirCookie); } @@ -1714,7 +1715,7 @@ void* attrCookie; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->CreateAttr(request->node, (const char*)request->name.GetData(), request->type, request->openMode, &attrCookie); @@ -1746,7 +1747,7 @@ void* attrCookie; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->OpenAttr(request->node, (const char*)request->name.GetData(), request->openMode, &attrCookie); @@ -1777,7 +1778,7 @@ result = B_BAD_VALUE; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->CloseAttr(request->node, request->attrCookie); } @@ -1805,7 +1806,7 @@ result = B_BAD_VALUE; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->FreeAttrCookie(request->node, request->attrCookie); } @@ -1853,7 +1854,7 @@ // execute the request size_t bytesRead; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->ReadAttr(node, attrCookie, pos, buffer, size, &bytesRead); } @@ -1879,7 +1880,7 @@ size_t bytesWritten; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->WriteAttr(request->node, request->attrCookie, request->pos, request->buffer.GetData(), request->buffer.GetSize(), &bytesWritten); @@ -1911,7 +1912,7 @@ struct stat st; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->ReadAttrStat(request->node, request->attrCookie, &st); } @@ -1941,7 +1942,7 @@ result = B_BAD_VALUE; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->WriteAttrStat(request->node, request->attrCookie, &request->st, request->mask); } @@ -1970,7 +1971,7 @@ result = B_BAD_VALUE; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->RenameAttr( request->oldNode, (const char*)request->oldName.GetData(), request->newNode, (const char*)request->newName.GetData()); @@ -2000,7 +2001,7 @@ result = B_BAD_VALUE; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->RemoveAttr(request->node, (const char*)request->name.GetData()); } @@ -2034,7 +2035,7 @@ void* indexDirCookie; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->OpenIndexDir(&indexDirCookie); } @@ -2063,7 +2064,7 @@ result = B_BAD_VALUE; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->CloseIndexDir(request->indexDirCookie); } @@ -2091,7 +2092,7 @@ result = B_BAD_VALUE; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->FreeIndexDirCookie(request->indexDirCookie); } @@ -2138,7 +2139,7 @@ // execute the request uint32 countRead; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->ReadIndexDir(indexDirCookie, buffer, bufferSize, count, &countRead); } @@ -2163,7 +2164,7 @@ result = B_BAD_VALUE; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->RewindIndexDir(request->indexDirCookie); } @@ -2191,7 +2192,7 @@ result = B_BAD_VALUE; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->CreateIndex((const char*)request->name.GetData(), request->type, request->flags); } @@ -2220,7 +2221,7 @@ result = B_BAD_VALUE; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->RemoveIndex((const char*)request->name.GetData()); } @@ -2249,7 +2250,7 @@ struct stat st; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->ReadIndexStat((const char*)request->name.GetData(), &st); } @@ -2284,7 +2285,7 @@ void* queryCookie; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->OpenQuery((const char*)request->queryString.GetData(), request->flags, request->port, request->token, &queryCookie); } @@ -2314,7 +2315,7 @@ result = B_BAD_VALUE; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->CloseQuery(request->queryCookie); } @@ -2342,7 +2343,7 @@ result = B_BAD_VALUE; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->FreeQueryCookie(request->queryCookie); } @@ -2389,7 +2390,7 @@ // execute the request uint32 countRead; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->ReadQuery(queryCookie, buffer, bufferSize, count, &countRead); } @@ -2414,7 +2415,7 @@ result = B_BAD_VALUE; if (result == B_OK) { - RequestThreadContext context(volume); + RequestThreadContext context(volume, request); result = volume->RewindQuery(request->queryCookie); } Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/FUSEFileSystem.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/FUSEFileSystem.cpp 2009-04-02 17:46:09 UTC (rev 29871) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/FUSEFileSystem.cpp 2009-04-02 19:41:53 UTC (rev 29872) @@ -13,7 +13,9 @@ #include "fuse_fs.h" #include "FUSEVolume.h" +#include "../RequestThread.h" + class FUSEFileSystem::ArgumentVector { private: enum { MAX_ARGUMENTS = 128 }; @@ -180,6 +182,30 @@ } +void +FUSEFileSystem::InitRequestThreadContext(RequestThreadContext* context) +{ + // Statically assert that fuse_context fits in the RequestThreadContext + // FS data. We can't include as it clashes with our "Debug.h". + do { + static const int staticAssertHolds + = sizeof(fuse_context) <= REQUEST_THREAD_CONTEXT_FS_DATA_SIZE; + struct __staticAssertStruct__ { + char __static_assert_failed__[2 * staticAssertHolds - 1]; + }; + } while (false); + + // init a fuse_context + KernelRequest* request = context->GetRequest(); + fuse_context* fuseContext = (fuse_context*)context->GetFSData(); + fuseContext->fuse = (struct fuse*)this; + fuseContext->uid = request->user; + fuseContext->gid = request->group; + fuseContext->pid = request->team; + fuseContext->private_data = fFS != NULL ? fFS->userData : NULL; +} + + status_t FUSEFileSystem::InitClientFS(const char* parameters) { Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/FUSEFileSystem.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/FUSEFileSystem.h 2009-04-02 17:46:09 UTC (rev 29871) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/FUSEFileSystem.h 2009-04-02 19:41:53 UTC (rev 29872) @@ -38,6 +38,9 @@ virtual status_t CreateVolume(Volume** _volume, dev_t id); virtual status_t DeleteVolume(Volume* volume); + virtual void InitRequestThreadContext( + RequestThreadContext* context); + status_t InitClientFS(const char* parameters); void ExitClientFS(status_t status); Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/FUSEVolume.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/FUSEVolume.cpp 2009-04-02 17:46:09 UTC (rev 29871) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/FUSEVolume.cpp 2009-04-02 19:41:53 UTC (rev 29872) @@ -17,6 +17,7 @@ #include "FUSEFileSystem.h" #include "../kernel_emu.h" +#include "../RequestThread.h" // TODO: For remote/shared file systems (sshfs, nfs, etc.) we need to notice @@ -673,6 +674,11 @@ const fuse_config& config = _FileSystem()->GetFUSEConfig(); fUseNodeIDs = config.use_ino; + // update the fuse_context::private_data field before calling into the FS + fuse_context* context = (fuse_context*)RequestThread::GetCurrentThread() + ->GetContext()->GetFSData(); + context->private_data = fFS->userData; + // get the root node struct stat st; int fuseError = fuse_fs_getattr(fFS, "/", &st); Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/fuse_main.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/fuse_main.cpp 2009-04-02 17:46:09 UTC (rev 29871) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/fuse/fuse_main.cpp 2009-04-02 19:41:53 UTC (rev 29872) @@ -10,7 +10,9 @@ #include "fuse_config.h" #include "FUSEFileSystem.h" +#include "../RequestThread.h" + int fuse_main_real(int argc, char* argv[], const struct fuse_operations* op, size_t opSize, void* userData) @@ -48,3 +50,13 @@ { return FUSE_VERSION; } + + +struct fuse_context* +fuse_get_context(void) +{ + RequestThread* requestThread = RequestThread::GetCurrentThread(); + return requestThread != NULL + ? (fuse_context*)requestThread->GetContext()->GetFSData() + : NULL; +} From mmlr at mail.berlios.de Fri Apr 3 03:31:16 2009 From: mmlr at mail.berlios.de (mmlr at BerliOS) Date: Fri, 3 Apr 2009 03:31:16 +0200 Subject: [Haiku-commits] r29873 - haiku/trunk/docs/userguide/en/installation Message-ID: <200904030131.n331VGof013447@sheep.berlios.de> Author: mmlr Date: 2009-04-03 03:31:15 +0200 (Fri, 03 Apr 2009) New Revision: 29873 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29873&view=rev Modified: haiku/trunk/docs/userguide/en/installation/install-source-beos.html Log: Update the cross-compiler link to the current version. Modified: haiku/trunk/docs/userguide/en/installation/install-source-beos.html =================================================================== --- haiku/trunk/docs/userguide/en/installation/install-source-beos.html 2009-04-02 19:41:53 UTC (rev 29872) +++ haiku/trunk/docs/userguide/en/installation/install-source-beos.html 2009-04-03 01:31:15 UTC (rev 29873) @@ -49,7 +49,7 @@

Installing the cross-compiler

-

Download the Haiku cross-compiler and extract it to /boot (for example by setting the Destination in Expander to just /boot). Then you need to configure your tree to use this cross compiler. Go to the root folder of your checked out Haiku repository and invoke the configure script with the --cross-tools-prefix option like this:

+

Download the Haiku cross-compiler and extract it to /boot (for example by setting the Destination in Expander to just /boot). Then you need to configure your tree to use this cross compiler. Go to the root folder of your checked out Haiku repository and invoke the configure script with the --cross-tools-prefix option like this:

configure --cross-tools-prefix /boot/apps/haiku/cross-tools/bin/i586-pc-haiku-
From umccullough at gmail.com Fri Apr 3 03:33:49 2009 From: umccullough at gmail.com (Urias McCullough) Date: Thu, 2 Apr 2009 18:33:49 -0700 Subject: [Haiku-commits] r29873 - haiku/trunk/docs/userguide/en/installation In-Reply-To: <1e80d8750904021832h4e3c7358gb7591131a4cb46ca@mail.gmail.com> References: <200904030131.n331VGof013447@sheep.berlios.de> <1e80d8750904021832h4e3c7358gb7591131a4cb46ca@mail.gmail.com> Message-ID: <1e80d8750904021833x6e08d0dah8e2dee8ea2c9bfc2@mail.gmail.com> On Thu, Apr 2, 2009 at 6:32 PM, Urias McCullough wrote: >> Log: >> Update the cross-compiler link to the current version. > > Great, I'll update the website instructions. Oh...done already? :) From umccullough at gmail.com Fri Apr 3 03:32:09 2009 From: umccullough at gmail.com (Urias McCullough) Date: Thu, 2 Apr 2009 18:32:09 -0700 Subject: [Haiku-commits] r29873 - haiku/trunk/docs/userguide/en/installation In-Reply-To: <200904030131.n331VGof013447@sheep.berlios.de> References: <200904030131.n331VGof013447@sheep.berlios.de> Message-ID: <1e80d8750904021832h4e3c7358gb7591131a4cb46ca@mail.gmail.com> On Thu, Apr 2, 2009 at 6:31 PM, mmlr at BerliOS wrote: > Author: mmlr > Date: 2009-04-03 03:31:15 +0200 (Fri, 03 Apr 2009) > New Revision: 29873 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29873&view=rev > > Modified: > ? haiku/trunk/docs/userguide/en/installation/install-source-beos.html > Log: > Update the cross-compiler link to the current version. Great, I'll update the website instructions. From axeld at mail.berlios.de Fri Apr 3 09:45:15 2009 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Fri, 3 Apr 2009 09:45:15 +0200 Subject: [Haiku-commits] r29874 - haiku/trunk/src/kits/network Message-ID: <200904030745.n337jFRS015369@sheep.berlios.de> Author: axeld Date: 2009-04-03 09:45:14 +0200 (Fri, 03 Apr 2009) New Revision: 29874 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29874&view=rev Removed: haiku/trunk/src/kits/network/old/ Log: * Removed old network stuff. From axeld at mail.berlios.de Fri Apr 3 10:05:27 2009 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Fri, 3 Apr 2009 10:05:27 +0200 Subject: [Haiku-commits] r29875 - haiku/trunk/src/system/kernel Message-ID: <200904030805.n3385RTY029661@sheep.berlios.de> Author: axeld Date: 2009-04-03 10:05:25 +0200 (Fri, 03 Apr 2009) New Revision: 29875 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29875&view=rev Modified: haiku/trunk/src/system/kernel/real_time_clock.c Log: * Minor cleanup. Modified: haiku/trunk/src/system/kernel/real_time_clock.c =================================================================== --- haiku/trunk/src/system/kernel/real_time_clock.c 2009-04-03 07:45:14 UTC (rev 29874) +++ haiku/trunk/src/system/kernel/real_time_clock.c 2009-04-03 08:05:25 UTC (rev 29875) @@ -1,5 +1,5 @@ /* - * Copyright 2004-2007, Axel D?rfler, axeld at pinc-software.de. All rights reserved. + * Copyright 2004-2009, Axel D?rfler, axeld at pinc-software.de. All rights reserved. * Copyright 2003, Jeff Ward, jeff at r2d2.stcloudstate.edu. All rights reserved. * * Distributed under the terms of the MIT License. @@ -196,7 +196,7 @@ seconds = seconds % RTC_SECONDS_DAY; t->tm_hour = seconds / 3600; - + seconds = seconds % 3600; t->tm_min = seconds / 60; t->tm_sec = seconds % 60; @@ -268,7 +268,7 @@ TRACE(("new system_time_offset %Ld\n", arch_rtc_get_system_time_offset(sRealTimeData))); - + return B_OK; } @@ -305,10 +305,12 @@ sIsGMT = isGMT; - if (wasGMT != sIsGMT) - arch_rtc_set_system_time_offset(sRealTimeData, - arch_rtc_get_system_time_offset(sRealTimeData) + (((sIsGMT) ? 1 : -1) * sTimezoneOffset)); - + if (wasGMT != sIsGMT) { + arch_rtc_set_system_time_offset(sRealTimeData, + arch_rtc_get_system_time_offset(sRealTimeData) + (((sIsGMT) ? 1 : -1) + * sTimezoneOffset)); + } + return B_OK; } From axeld at mail.berlios.de Fri Apr 3 11:02:48 2009 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Fri, 3 Apr 2009 11:02:48 +0200 Subject: [Haiku-commits] r29876 - in haiku/trunk: build/jam build/scripts data/system/boot headers/os/storage src/apps/aboutsystem src/apps/processcontroller src/bin/bash src/bin/gdb/gdb src/bin/grep/src src/bin/make src/bin/vim/src src/kits/tracker src/preferences/joysticks src/preferences/keymap src/preferences/time src/servers/debug src/servers/registrar src/system/boot src/system/boot/loader src/system/boot/platform/atari_m68k src/system/boot/platform/bios_ia32 src/system/boot/platform/generic src/system/kernel/fs src/system/libroot/os src/system/runtime_loader Message-ID: <200904030902.n3392mKv021542@sheep.berlios.de> Author: axeld Date: 2009-04-03 11:02:44 +0200 (Fri, 03 Apr 2009) New Revision: 29876 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=29876&view=rev Modified: haiku/trunk/build/jam/BuildSetup haiku/trunk/build/jam/HaikuImage haiku/trunk/build/jam/ImageRules haiku/trunk/build/jam/OptionalPackages haiku/trunk/build/jam/UserBuildConfig.ReadMe haiku/trunk/build/jam/UserBuildConfig.sample haiku/trunk/build/scripts/build_haiku_cd haiku/trunk/build/scripts/build_haiku_image haiku/trunk/data/system/boot/Bootscript haiku/trunk/data/system/boot/Bootscript.cd haiku/trunk/data/system/boot/SetupEnvironment haiku/trunk/headers/os/storage/FindDirectory.h haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp haiku/trunk/src/apps/processcontroller/PCWorld.cpp haiku/trunk/src/apps/processcontroller/ProcessController.cpp haiku/trunk/src/bin/bash/config-top.h haiku/trunk/src/bin/gdb/gdb/Jamfile haiku/trunk/src/bin/grep/src/Jamfile haiku/trunk/src/bin/make/config.h haiku/trunk/src/bin/vim/src/gui_beos.cc haiku/trunk/src/kits/tracker/FSUtils.cpp haiku/trunk/src/kits/tracker/FSUtils.h haiku/trunk/src/preferences/joysticks/JoyWin.cpp haiku/trunk/src/preferences/keymap/KeymapWindow.cpp haiku/trunk/src/preferences/time/ZoneView.cpp haiku/trunk/src/preferences/time/ZoneView.h haiku/trunk/src/servers/debug/DebugServer.cpp haiku/trunk/src/servers/registrar/TRoster.cpp haiku/trunk/src/system/boot/Jamfile haiku/trunk/src/system/boot/loader/loader.cpp haiku/trunk/src/system/boot/platform/atari_m68k/shell.S haiku/trunk/src/system/boot/platform/atari_m68k/stage1.S haiku/trunk/src/system/boot/platform/bios_ia32/stage1.S haiku/trunk/src/system/boot/platform/bios_ia32/stage1.bin haiku/trunk/src/system/boot/platform/generic/text_menu.cpp haiku/trunk/src/system/kernel/fs/vfs_boot.cpp haiku/trunk/src/system/libroot/os/find_directory.c haiku/trunk/src/system/runtime_loader/runtime_loader.c Log: * Changed directory structure as suggested on the mailing list. * Made the TimeZoneView less error prone, and also actually use Haiku code (the previous check didn't work since it used #if, not #ifdef). * Also took the liberty to rename our boot loader to haiku_loader, since I had to update the nasm binary anyway. Updated the assembly sources to nasm 2.0. * I haven't found where the synth location in the MIDI code is specified, though. * Also, NetBootArchive, and FloppyBootImage haven't been updated yet. Will do so next. * Some optional packages still put their license to beos/etc/licenses. I didn't update them yet, as we'll probably do so anyway at some point. Also, I think we might want to introduce a common/data/licenses instead for those. * If you encounter any problems, please tell! Modified: haiku/trunk/build/jam/BuildSetup =================================================================== --- haiku/trunk/build/jam/BuildSetup 2009-04-03 08:05:25 UTC (rev 29875) +++ haiku/trunk/build/jam/BuildSetup 2009-04-03 09:02:44 UTC (rev 29876) @@ -171,21 +171,21 @@ { HAIKU_DEFINES += __POWERPC__ ; HAIKU_BOOT_PLATFORM = openfirmware ; - # offset in floppy image (>= sizeof(zbeos)) + # offset in floppy image (>= sizeof(haiku_loader)) HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 192 ; # in kB - unused yet } case x86 : { HAIKU_DEFINES += __INTEL__ ; HAIKU_BOOT_PLATFORM = bios_ia32 ; - # offset in floppy image (>= sizeof(zbeos)) + # offset in floppy image (>= sizeof(haiku_loader)) HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 300 ; # in kB } case m68k : { HAIKU_DEFINES += __M68K__ ; HAIKU_BOOT_PLATFORM = atari_m68k ; - # offset in floppy image (>= sizeof(zbeos)) + # offset in floppy image (>= sizeof(haiku_loader)) HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 130 ; # in kB } case * : Modified: haiku/trunk/build/jam/HaikuImage =================================================================== --- haiku/trunk/build/jam/HaikuImage 2009-04-03 08:05:25 UTC (rev 29875) +++ haiku/trunk/build/jam/HaikuImage 2009-04-03 09:02:44 UTC (rev 29876) @@ -18,7 +18,7 @@ GPL_ONLY = "" ; } -BEOS_BIN = "[" addattr alert arp base64 basename bc beep bootman bzip2 +SYSTEM_BIN = "[" addattr alert arp base64 basename bc beep bootman bzip2 cal cat catattr checkfs chgrp chmod chop chown chroot cksum clear clockconfig cmp comm compress copyattr $(X86_ONLY)CortexAddOnHost cp csplit ctags cut date dc dd desklink df diff diff3 dircolors dirname @@ -48,50 +48,51 @@ zdiff zforce zgrep zip zipcloak zipgrep zipnote zipsplit zmore znew ; -BEOS_APPS = AboutSystem ActivityMonitor CharacterMap CodyCam DeskCalc DiskProbe +SYSTEM_APPS = AboutSystem ActivityMonitor CharacterMap CodyCam DeskCalc DiskProbe DiskUsage DriveSetup CDPlayer Expander Icon-O-Matic Installer LaunchBox Magnify Mail MediaPlayer MidiPlayer NetworkStatus PackageInstaller People PowerStatus ProcessController Screenshot ShowImage SoundRecorder StyledEdit Terminal TextSearch TV Workspaces ; -BEOS_PREFERENCES = Appearance Backgrounds DataTranslations E-mail +SYSTEM_PREFERENCES = Appearance Backgrounds DataTranslations E-mail FileTypes Fonts Keyboard Keymap Media Menu Mouse Network Printers Screen ScreenSaver Sounds Time Touchpad Tracker VirtualMemory ; -BEOS_DEMOS = BSnow Chart Clock $(X86_ONLY)Cortex FontDemo +SYSTEM_DEMOS = BSnow Chart Clock $(X86_ONLY)Cortex FontDemo $(X86_ONLY)GLDirectMode $(X86_ONLY)GLTeapot Mandelbrot Pairs Playground Pulse Sudoku Gradients ; -BEOS_SYSTEM_LIBS = libbe.so $(HAIKU_LIBSTDC++) libmedia.so libtracker.so +SYSTEM_LIBS = libbe.so $(HAIKU_LIBSTDC++) libmedia.so libtracker.so libtranslation.so libbnetapi.so libnetwork.so libdebug.so libbsd.so libmail.so libtextencoding.so libz.so libfreetype.so libpng.so libmidi.so libmidi2.so libdevice.so libgame.so libscreensaver.so libroot.so $(X86_ONLY)libGL.so libfluidsynth.so liblpsolve55.so liblinprog.so libalm.so libilmimf.so libiconv.so ; -BEOS_SYSTEM_SERVERS = registrar debug_server syslog_daemon media_server +SYSTEM_SERVERS = registrar debug_server syslog_daemon media_server net_server media_addon_server input_server app_server fake_app_server midi_server print_server mail_daemon ; -BEOS_NETWORK_DEVICES = ethernet loopback ; -BEOS_NETWORK_DATALINK_PROTOCOLS = ethernet_frame arp loopback_frame +SYSTEM_NETWORK_DEVICES = ethernet loopback ; +SYSTEM_NETWORK_DATALINK_PROTOCOLS = ethernet_frame arp loopback_frame ipv4_datagram ; -#BEOS_NETWORK_PPP = ipcp modem pap pppoe ; -BEOS_NETWORK_PROTOCOLS = ipv4 tcp udp icmp unix ; +#SYSTEM_NETWORK_PPP = ipcp modem pap pppoe ; +SYSTEM_NETWORK_PROTOCOLS = ipv4 tcp udp icmp unix ; -BEOS_ADD_ONS_ACCELERANTS = $(X86_ONLY)radeon.accelerant $(X86_ONLY)nvidia.accelerant - $(X86_ONLY)matrox.accelerant $(X86_ONLY)neomagic.accelerant - $(X86_ONLY)intel_extreme.accelerant $(X86_ONLY)s3.accelerant $(X86_ONLY)vesa.accelerant +SYSTEM_ADD_ONS_ACCELERANTS = $(X86_ONLY)radeon.accelerant + $(X86_ONLY)nvidia.accelerant $(X86_ONLY)matrox.accelerant + $(X86_ONLY)neomagic.accelerant $(X86_ONLY)intel_extreme.accelerant + $(X86_ONLY)s3.accelerant $(X86_ONLY)vesa.accelerant #$(X86_ONLY)via.accelerant #$(X86_ONLY)vmware.accelerant ; -BEOS_ADD_ONS_TRANSLATORS = BMPTranslator EXRTranslator GIFTranslator JPEGTranslator - JPEG2000Translator PCXTranslator PNGTranslator PPMTranslator RAWTranslator - RTF-Translator SGITranslator STXTTranslator TGATranslator +SYSTEM_ADD_ONS_TRANSLATORS = BMPTranslator EXRTranslator GIFTranslator + JPEGTranslator JPEG2000Translator PCXTranslator PNGTranslator PPMTranslator + RAWTranslator RTF-Translator SGITranslator STXTTranslator TGATranslator TIFFTranslator WonderBrushTranslator ; -BEOS_ADD_ONS_MEDIA = cortex_audioadapter.media_addon cortex_flanger.media_addon +SYSTEM_ADD_ONS_MEDIA = cortex_audioadapter.media_addon cortex_flanger.media_addon dvb.media_addon hmulti_audio.media_addon mixer.media_addon @@ -103,7 +104,7 @@ firewire_dv.media_addon #legacy.media_addon ; -BEOS_ADD_ONS_MEDIA_PLUGINS = $(GPL_ONLY)ac3_decoder +SYSTEM_ADD_ONS_MEDIA_PLUGINS = $(GPL_ONLY)ac3_decoder aiff_reader au_reader $(X86_ONLY)avcodec avi_reader matroska mov_reader mp3_decoder mp3_reader @@ -112,21 +113,21 @@ # theora vorbis wav_reader ; -BEOS_ADD_ONS_PRINT = Canon\ LIPS3\ Compatible Canon\ LIPS4\ Compatible +SYSTEM_ADD_ONS_PRINT = Canon\ LIPS3\ Compatible Canon\ LIPS4\ Compatible PCL5\ Compatible PCL6\ Compatible PDF\ Writer PS\ Compatible Preview ; -BEOS_ADD_ONS_PRINT_TRANSPORT = HP\ JetDirect IPP LPR Parallel\ Port +SYSTEM_ADD_ONS_PRINT_TRANSPORT = HP\ JetDirect IPP LPR Parallel\ Port Print\ To\ File Serial\ Port USB\ Port ; -BEOS_ADD_ONS_SCREENSAVERS = DebugNow Flurry Haiku IFS Spider Message ; -BEOS_ADD_ONS_DRIVERS_AUDIO = auich auvia echo3g emuxki hda ; -BEOS_ADD_ONS_DRIVERS_AUDIO_OLD = ; #cmedia sis7018 usb_audio ; -BEOS_ADD_ONS_DRIVERS_GRAPHICS = $(X86_ONLY)radeon $(X86_ONLY)nvidia +SYSTEM_ADD_ONS_SCREENSAVERS = DebugNow Flurry Haiku IFS Spider Message ; +SYSTEM_ADD_ONS_DRIVERS_AUDIO = auich auvia echo3g emuxki hda ; +SYSTEM_ADD_ONS_DRIVERS_AUDIO_OLD = ; #cmedia sis7018 usb_audio ; +SYSTEM_ADD_ONS_DRIVERS_GRAPHICS = $(X86_ONLY)radeon $(X86_ONLY)nvidia $(X86_ONLY)neomagic $(X86_ONLY)matrox $(X86_ONLY)intel_extreme $(X86_ONLY)s3 $(X86_ONLY)vesa #$(X86_ONLY)via #$(X86_ONLY)vmware ; -BEOS_ADD_ONS_DRIVERS_MIDI = emuxki ; -BEOS_ADD_ONS_DRIVERS_NET = $(X86_ONLY)3com $(X86_ONLY)broadcom440x +SYSTEM_ADD_ONS_DRIVERS_MIDI = emuxki ; +SYSTEM_ADD_ONS_DRIVERS_NET = $(X86_ONLY)3com $(X86_ONLY)broadcom440x $(X86_ONLY)broadcom570x etherpci $(X86_ONLY)ipro1000 pegasus $(X86_ONLY)rtl8139 rtl8169 $(X86_ONLY)rtl81xx sis900 $(X86_ONLY)via_rhine wb840 $(X86_ONLY)ipro100 $(X86_ONLY)nforce @@ -134,44 +135,44 @@ $(X86_ONLY)marvell_yukon $(X86_ONLY)syskonnect $(X86_ONLY)attansic_l2 $(X86_ONLY)ar81xx usb_ecm ; -#BEOS_ADD_ONS_DRIVERS_ACPI = $(X86_ONLY)acpi_button ; -BEOS_ADD_ONS_BUS_MANAGERS = pci $(X86_ONLY)ps2 $(X86_ONLY)isa ide scsi +#SYSTEM_ADD_ONS_DRIVERS_POWER = $(X86_ONLY)acpi_button ; +SYSTEM_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 attribute_overlay +SYSTEM_ADD_ONS_FILE_SYSTEMS = bfs cdda ext2 fat iso9660 nfs attribute_overlay write_overlay $(GPL_ONLY)reiserfs ; #googlefs $(GPL_ONLY)ntfs ; # modules -AddFilesToHaikuImage beos system add-ons kernel bus_managers - : $(BEOS_ADD_ONS_BUS_MANAGERS) ; -AddFilesToHaikuImage beos system add-ons kernel busses agp_gart +AddFilesToHaikuImage system add-ons kernel bus_managers + : $(SYSTEM_ADD_ONS_BUS_MANAGERS) ; +AddFilesToHaikuImage system add-ons kernel busses agp_gart : $(X86_ONLY)intel ; -AddFilesToHaikuImage beos system add-ons kernel busses ide +AddFilesToHaikuImage system add-ons kernel busses ide : generic_ide_pci it8211 legacy_sata silicon_image_3112 $(X86_ONLY)ide_isa ; -AddFilesToHaikuImage beos system add-ons kernel busses scsi +AddFilesToHaikuImage system add-ons kernel busses scsi : ahci ; -AddFilesToHaikuImage beos system add-ons kernel busses usb +AddFilesToHaikuImage system add-ons kernel busses usb : uhci ohci ehci ; -AddFilesToHaikuImage beos system add-ons kernel console : vga_text ; -AddFilesToHaikuImage beos system add-ons kernel debugger +AddFilesToHaikuImage system add-ons kernel console : vga_text ; +AddFilesToHaikuImage system add-ons kernel debugger : $(X86_ONLY)disasm hangman invalidate_on_exit usb_keyboard ; -AddFilesToHaikuImage beos system add-ons kernel file_systems - : $(BEOS_ADD_ONS_FILE_SYSTEMS) ; -AddFilesToHaikuImage beos system add-ons kernel generic +AddFilesToHaikuImage system add-ons kernel file_systems + : $(SYSTEM_ADD_ONS_FILE_SYSTEMS) ; +AddFilesToHaikuImage system add-ons kernel generic : dpc ide_adapter locked_pool mpu401 scsi_periph ; -AddFilesToHaikuImage beos system add-ons kernel partitioning_systems +AddFilesToHaikuImage system add-ons kernel partitioning_systems : intel session ; -AddFilesToHaikuImage beos system add-ons kernel interrupt_controllers +AddFilesToHaikuImage system add-ons kernel interrupt_controllers : $(PPC_ONLY)openpic ; if $(TARGET_ARCH) = x86 { - AddFilesToHaikuImage beos system add-ons kernel cpu : generic_x86 ; + AddFilesToHaikuImage system add-ons kernel cpu : generic_x86 ; if $(HAIKU_GCC_VERSION[1]) = 2 { - AddFilesToHaikuImage beos system add-ons kernel debugger demangle : + AddFilesToHaikuImage system add-ons kernel debugger demangle : gcc2 ; } } @@ -182,62 +183,62 @@ # legacy drivers AddDriversToHaikuImage : console dprintf $(X86_ONLY)keyboard null random tty zero ; -AddDriversToHaikuImage audio hmulti : $(BEOS_ADD_ONS_DRIVERS_AUDIO) ; -AddDriversToHaikuImage audio old : $(BEOS_ADD_ONS_DRIVERS_AUDIO_OLD) ; -AddDriversToHaikuImage midi : $(BEOS_ADD_ONS_DRIVERS_MIDI) ; +AddDriversToHaikuImage audio hmulti : $(SYSTEM_ADD_ONS_DRIVERS_AUDIO) ; +AddDriversToHaikuImage audio old : $(SYSTEM_ADD_ONS_DRIVERS_AUDIO_OLD) ; +AddDriversToHaikuImage midi : $(SYSTEM_ADD_ONS_DRIVERS_MIDI) ; AddDriversToHaikuImage bus : usb_raw fw_raw ; AddDriversToHaikuImage disk floppy : $(X86_ONLY)pc_floppy ; AddDriversToHaikuImage disk usb : usb_disk ; AddDriversToHaikuImage disk virtual : nbd ; AddDriversToHaikuImage dvb : cx23882 ; -AddDriversToHaikuImage graphics : $(BEOS_ADD_ONS_DRIVERS_GRAPHICS) ; +AddDriversToHaikuImage graphics : $(SYSTEM_ADD_ONS_DRIVERS_GRAPHICS) ; AddDriversToHaikuImage input : ps2_hid usb_hid wacom ; AddDriversToHaikuImage misc : poke test mem ; -AddDriversToHaikuImage net : $(BEOS_ADD_ONS_DRIVERS_NET) ; -#AddDriversToHaikuImage power : $(BEOS_ADD_ONS_DRIVERS_ACPI) ; +AddDriversToHaikuImage net : $(SYSTEM_ADD_ONS_DRIVERS_NET) ; +#AddDriversToHaikuImage power : $(SYSTEM_ADD_ONS_DRIVERS_POWER) ; # kernel -AddFilesToHaikuImage beos system : kernel_$(TARGET_ARCH) ; +AddFilesToHaikuImage system : kernel_$(TARGET_ARCH) ; # libs -AddFilesToHaikuImage beos system lib : $(BEOS_SYSTEM_LIBS) ; +AddFilesToHaikuImage system lib : $(SYSTEM_LIBS) ; # libnetwork.so replaces quite a few libraries -BEOS_SYSTEM_LIBS_LIBNETWORK_ALIASES +SYSTEM_LIBS_LIBNETWORK_ALIASES = libsocket.so libbind.so libnet.so ; local lib ; -for lib in $(BEOS_SYSTEM_LIBS_LIBNETWORK_ALIASES) { - AddSymlinkToHaikuImage beos system lib : libnetwork.so : $(lib) ; +for lib in $(SYSTEM_LIBS_LIBNETWORK_ALIASES) { + AddSymlinkToHaikuImage system lib : libnetwork.so : $(lib) ; } -AddSymlinkToHaikuImage beos system lib : libbnetapi.so : libnetapi.so ; +AddSymlinkToHaikuImage system lib : libbnetapi.so : libnetapi.so ; # libGL.so has GLU (like BeOS) *and* GLUT API built-in -BEOS_SYSTEM_LIBS_LIBGL_ALIASES +SYSTEM_LIBS_LIBGL_ALIASES = libGLU.so libglut.so ; if $(TARGET_ARCH) = x86 { local lib ; -for lib in $(BEOS_SYSTEM_LIBS_LIBGL_ALIASES) { - AddSymlinkToHaikuImage beos system lib : libGL.so : $(lib) ; +for lib in $(SYSTEM_LIBS_LIBGL_ALIASES) { + AddSymlinkToHaikuImage system lib : libGL.so : $(lib) ; } } # servers -AddFilesToHaikuImage beos system servers : $(BEOS_SYSTEM_SERVERS) ; +AddFilesToHaikuImage system servers : $(SYSTEM_SERVERS) ; # apps -AddFilesToHaikuImage beos system : runtime_loader Deskbar Tracker ; -AddFilesToHaikuImage beos bin : $(BEOS_BIN) consoled ; -AddFilesToHaikuImage beos apps : $(BEOS_APPS) ; -AddFilesToHaikuImage beos preferences : $(BEOS_PREFERENCES) ; -AddFilesToHaikuImage beos demos : $(BEOS_DEMOS) ; +AddFilesToHaikuImage system : runtime_loader Deskbar Tracker ; +AddFilesToHaikuImage system bin : $(SYSTEM_BIN) consoled ; +AddFilesToHaikuImage system apps : $(SYSTEM_APPS) ; +AddFilesToHaikuImage system preferences : $(SYSTEM_PREFERENCES) ; +AddFilesToHaikuImage system demos : $(SYSTEM_DEMOS) ; SEARCH on which = [ FDirName $(HAIKU_TOP) data bin ] ; -AddFilesToHaikuImage beos bin : which ; +AddFilesToHaikuImage system bin : which ; -AddSymlinkToHaikuImage beos bin : sh : bash ; +AddSymlinkToHaikuImage system bin : sh : bash ; AddSymlinkToHaikuImage home Desktop : /boot/home : Home ; @@ -250,7 +251,7 @@ local linkTarget ; for linkTarget in $(DESKBAR_APPLICATIONS) { AddSymlinkToHaikuImage home config be Applications - : /boot/beos/apps/$(linkTarget) : $(linkTarget) ; + : /boot/system/apps/$(linkTarget) : $(linkTarget) ; } # Deskbar Desktop Applets links @@ -260,12 +261,12 @@ ; for linkTarget in $(DESKBAR_DESKTOP_APPLETS) { AddSymlinkToHaikuImage home config be Desktop\ Applets - : /boot/beos/apps/$(linkTarget) : $(linkTarget) ; + : /boot/system/apps/$(linkTarget) : $(linkTarget) ; } # Deskbar Preferences links AddDirectoryToHaikuImage home config be Preferences ; -# TODO/NOTE: Cannot use $(BEOS_PREFERENCES) here since there is +# TODO/NOTE: Cannot use $(SYSTEM_PREFERENCES) here since there is # "Tracker"... DESKBAR_PREFERENCES = Appearance Backgrounds DataTranslations E-mail FileTypes Fonts Keyboard Keymap Media Menu Mouse Network Printers Screen @@ -273,34 +274,34 @@ ; for linkTarget in $(DESKBAR_PREFERENCES) { AddSymlinkToHaikuImage home config be Preferences - : /boot/beos/preferences/$(linkTarget) : $(linkTarget) ; + : /boot/system/preferences/$(linkTarget) : $(linkTarget) ; } # Deskbar Demo links AddDirectoryToHaikuImage home config be Demos ; -for linkTarget in $(BEOS_DEMOS) { +for linkTarget in $(SYSTEM_DEMOS) { AddSymlinkToHaikuImage home config be Demos - : /boot/beos/demos/$(linkTarget) : $(linkTarget) ; + : /boot/system/demos/$(linkTarget) : $(linkTarget) ; } -AddSymlinkToHaikuImage beos bin : bzip2 : bunzip2 ; -AddSymlinkToHaikuImage beos bin : less : more ; -AddSymlinkToHaikuImage beos bin : gzip : gunzip ; -AddSymlinkToHaikuImage beos bin : gzip : zcat ; -AddSymlinkToHaikuImage beos bin : zdiff : zcmp ; -AddSymlinkToHaikuImage beos bin : unzip : zipinfo ; -AddSymlinkToHaikuImage beos bin : gawk : awk ; -AddSymlinkToHaikuImage beos bin : grep : egrep ; -AddSymlinkToHaikuImage beos bin : grep : fgrep ; -AddSymlinkToHaikuImage beos bin : vim : vi ; -AddSymlinkToHaikuImage beos bin : vim : view ; +AddSymlinkToHaikuImage system bin : bzip2 : bunzip2 ; +AddSymlinkToHaikuImage system bin : less : more ; +AddSymlinkToHaikuImage system bin : gzip : gunzip ; +AddSymlinkToHaikuImage system bin : gzip : zcat ; +AddSymlinkToHaikuImage system bin : zdiff : zcmp ; +AddSymlinkToHaikuImage system bin : unzip : zipinfo ; +AddSymlinkToHaikuImage system bin : gawk : awk ; +AddSymlinkToHaikuImage system bin : grep : egrep ; +AddSymlinkToHaikuImage system bin : grep : fgrep ; +AddSymlinkToHaikuImage system bin : vim : vi ; +AddSymlinkToHaikuImage system bin : vim : view ; # scripts and data files local bootScripts = Bootscript Bootscript.cd SetupEnvironment Netscript InstallerInitScript InstallerFinishScript ; SEARCH on $(bootScripts) = [ FDirName $(HAIKU_TOP) data system boot ] ; -AddFilesToHaikuImage beos system boot : $(bootScripts) ; +AddFilesToHaikuImage system boot : $(bootScripts) ; local userBootScripts = UserBootscript.sample UserSetupEnvironment.sample ; SEARCH on $(userBootScripts) = [ FDirName $(HAIKU_TOP) data config boot ] ; @@ -309,25 +310,25 @@ local logoArtwork = "HAIKU logo - white on blue - big.png" "HAIKU logo - white on blue - normal.png" ; SEARCH on $(logoArtwork) = [ FDirName $(HAIKU_TOP) data artwork ] ; -AddFilesToHaikuImage beos etc artwork : $(logoArtwork) ; +AddFilesToHaikuImage system data artwork : $(logoArtwork) ; -AddDirectoryToHaikuImage beos etc sounds ; +AddDirectoryToHaikuImage system data sounds ; # Mail spell check dictionaries local spellFiles = words geekspeak ; spellFiles = $(spellFiles:G=spell) ; SEARCH on $(spellFiles) = [ FDirName $(HAIKU_TOP) src apps mail ] ; -AddFilesToHaikuImage beos etc word_dictionary : $(spellFiles) ; +AddFilesToHaikuImage system etc word_dictionary : $(spellFiles) ; local etcFiles = inputrc profile teapot.data ; etcFiles = $(etcFiles:G=etc) ; SEARCH on $(etcFiles) = [ FDirName $(HAIKU_TOP) data etc ] ; etcFiles += termcap sysless sysless.in ; -AddFilesToHaikuImage beos etc : $(etcFiles) ; +AddFilesToHaikuImage system etc : $(etcFiles) ; SEARCH on vimrc = [ FDirName $(HAIKU_TOP) data etc vim ] ; -AddFilesToHaikuImage beos etc vim : vimrc ; +AddFilesToHaikuImage system etc vim : vimrc ; local fortuneFiles = Art Computers Education Food Fortunes Goedel Haiku Humorists Kids Law "Linux cookies" Love Magic Medicine Miscellaneous @@ -335,37 +336,37 @@ Sports "Tech Support Excuses" ; fortuneFiles = $(fortuneFiles:G=etc!fortunes) ; SEARCH on $(fortuneFiles) = [ FDirName $(HAIKU_TOP) data etc fortunes ] ; -AddFilesToHaikuImage beos etc fortunes : $(fortuneFiles) ; +AddFilesToHaikuImage system etc fortunes : $(fortuneFiles) ; local fontDir = [ FDirName $(HAIKU_TOP) data etc fonts ] ; local psFonts = [ Glob $(fontDir)/psfonts : *.afm *.pfb ] ; local ttFonts = [ Glob $(fontDir)/ttfonts : *.ttf ] ; -AddFilesToHaikuImage beos etc fonts psfonts : $(psFonts) ; -AddFilesToHaikuImage beos etc fonts ttfonts : $(ttFonts) ; +AddFilesToHaikuImage system fonts psfonts : $(psFonts) ; +AddFilesToHaikuImage system fonts ttfonts : $(ttFonts) ; local kanbeDir = [ FDirName $(HAIKU_TOP) data etc KanBe ] ; local kanbeDefault = [ Glob $(kanbeDir)/default : *.canna *.gz ] ; local kanbeDic = [ Glob $(kanbeDir)/dic : *.cbp ] ; local kanbeDicCanna = [ Glob $(kanbeDir)/dic/canna : *.cld *.ctd *.cbd *.dir ] ; -AddFilesToHaikuImage beos etc KanBe default : $(kanbeDefault) ; -AddFilesToHaikuImage beos etc KanBe dic : $(kanbeDic) ; -AddFilesToHaikuImage beos etc KanBe dic canna : $(kanbeDicCanna) ; -AddDirectoryToHaikuImage beos etc KanBe dic group ; -AddDirectoryToHaikuImage beos etc KanBe dic user ; +AddFilesToHaikuImage system data KanBe default : $(kanbeDefault) ; +AddFilesToHaikuImage system data KanBe dic : $(kanbeDic) ; +AddFilesToHaikuImage system data KanBe dic canna : $(kanbeDicCanna) ; +AddDirectoryToHaikuImage system data KanBe dic group ; +AddDirectoryToHaikuImage system data KanBe dic user ; local keymapFiles = [ GLOB [ FDirName $(HAIKU_TOP) src data etc keymaps ] : *.keymap ] ; keymapFiles = $(keymapFiles:BG=keymap) ; -AddFilesToHaikuImage beos etc Keymap : $(keymapFiles) ; -AddSymlinkToHaikuImage beos etc Keymap : Swedish : Finnish ; -AddSymlinkToHaikuImage beos etc Keymap : Slovene : Croatian ; -AddSymlinkToHaikuImage beos etc Keymap : US-International : Brazilian ; +AddFilesToHaikuImage system data Keymaps : $(keymapFiles) ; +AddSymlinkToHaikuImage system data Keymaps : Swedish : Finnish ; +AddSymlinkToHaikuImage system data Keymaps : Slovene : Croatian ; +AddSymlinkToHaikuImage system data Keymaps : US-International : Brazilian ; local timezones = [ FTimeZoneBinaries $(HAIKU_TIME_ZONE_SOURCES) : : true ] ; for timezone in $(timezones) { local dir = [ on $(timezone) return $(RELATIVE_TIMEZONE_DIR) ] ; - AddFilesToHaikuImage beos etc timezones $(dir) : $(timezone) ; + AddFilesToHaikuImage system data timezones $(dir) : $(timezone) ; } local driverSettingsFiles = kernel ; @@ -390,7 +391,7 @@ AddFilesToHaikuImage common settings : fresh_install ; # boot loader -AddFilesToHaikuImage beos system : zbeos ; +AddFilesToHaikuImage system : haiku_loader ; # boot module links AddBootModuleSymlinksToHaikuImage @@ -405,48 +406,48 @@ ; # add-ons -AddFilesToHaikuImage beos system add-ons accelerants - : $(BEOS_ADD_ONS_ACCELERANTS) ; -AddFilesToHaikuImage beos system add-ons opengl +AddFilesToHaikuImage system add-ons accelerants + : $(SYSTEM_ADD_ONS_ACCELERANTS) ; +AddFilesToHaikuImage system add-ons opengl : $(X86_ONLY)Mesa\ Software\ Renderer ; -AddFilesToHaikuImage beos system add-ons Translators - : $(BEOS_ADD_ONS_TRANSLATORS) ; -AddFilesToHaikuImage beos system add-ons mail_daemon inbound_protocols : POP3 IMAP ; -AddFilesToHaikuImage beos system add-ons mail_daemon outbound_protocols : SMTP ; -AddFilesToHaikuImage beos system add-ons mail_daemon inbound_filters : Match\ Header Spam\ Filter R5\ Daemon\ Filter ; -AddFilesToHaikuImage beos system add-ons mail_daemon outbound_filters : Fortune ; -AddFilesToHaikuImage beos system add-ons mail_daemon system_filters : Inbox New\ Mail\ Notification Outbox Message\ Parser ; -AddFilesToHaikuImage beos system add-ons media : $(BEOS_ADD_ONS_MEDIA) ; -AddFilesToHaikuImage beos system add-ons media plugins - : $(BEOS_ADD_ONS_MEDIA_PLUGINS) ; -AddFilesToHaikuImage beos system add-ons Tracker +AddFilesToHaikuImage system add-ons Translators + : $(SYSTEM_ADD_ONS_TRANSLATORS) ; +AddFilesToHaikuImage system add-ons mail_daemon inbound_protocols : POP3 IMAP ; +AddFilesToHaikuImage system add-ons mail_daemon outbound_protocols : SMTP ; +AddFilesToHaikuImage system add-ons mail_daemon inbound_filters : Match\ Header Spam\ Filter R5\ Daemon\ Filter ; +AddFilesToHaikuImage system add-ons mail_daemon outbound_filters : Fortune ; +AddFilesToHaikuImage system add-ons mail_daemon system_filters : Inbox New\ Mail\ Notification Outbox Message\ Parser ; +AddFilesToHaikuImage system add-ons media : $(SYSTEM_ADD_ONS_MEDIA) ; +AddFilesToHaikuImage system add-ons media plugins + : $(SYSTEM_ADD_ONS_MEDIA_PLUGINS) ; +AddFilesToHaikuImage system add-ons Tracker : FileType-F ZipOMatic-Z Open\ Target\ Folder-T ; -AddSymlinkToHaikuImage beos system add-ons Tracker - : /boot/beos/preferences/Backgrounds : Background-B ; -AddSymlinkToHaikuImage beos system add-ons Tracker - : /boot/beos/apps/TextSearch : TextSearch-G ; -AddSymlinkToHaikuImage beos system add-ons Tracker - : /boot/beos/apps/DiskUsage : DiskUsage-I ; -AddFilesToHaikuImage beos system add-ons input_server devices +AddSymlinkToHaikuImage system add-ons Tracker + : /boot/system/preferences/Backgrounds : Background-B ; +AddSymlinkToHaikuImage system add-ons Tracker + : /boot/system/apps/TextSearch : TextSearch-G ; +AddSymlinkToHaikuImage system add-ons Tracker + : /boot/system/apps/DiskUsage : DiskUsage-I ; +AddFilesToHaikuImage system add-ons input_server devices : keyboard mouse wacom ; -AddFilesToHaikuImage beos system add-ons input_server filters : screen_saver ; -AddFilesToHaikuImage beos system add-ons kernel network +AddFilesToHaikuImage system add-ons input_server filters : screen_saver ; +AddFilesToHaikuImage system add-ons kernel network : notifications stack ; -AddFilesToHaikuImage beos system add-ons kernel network devices - : $(BEOS_NETWORK_DEVICES) ; -AddFilesToHaikuImage beos system add-ons kernel network datalink_protocols - : $(BEOS_NETWORK_DATALINK_PROTOCOLS) ; -AddFilesToHaikuImage beos system add-ons kernel network ppp - : $(BEOS_NETWORK_PPP) ; -AddFilesToHaikuImage beos system add-ons kernel network protocols - : $(BEOS_NETWORK_PROTOCOLS) ; -AddFilesToHaikuImage beos system add-ons Print : $(BEOS_ADD_ONS_PRINT) ; -AddFilesToHaikuImage beos system add-ons Print transport - : $(BEOS_ADD_ONS_PRINT_TRANSPORT) ; -AddFilesToHaikuImage beos system add-ons Screen\ Savers - : $(BEOS_ADD_ONS_SCREENSAVERS) ; +AddFilesToHaikuImage system add-ons kernel network devices + : $(SYSTEM_NETWORK_DEVICES) ; +AddFilesToHaikuImage system add-ons kernel network datalink_protocols + : $(SYSTEM_NETWORK_DATALINK_PROTOCOLS) ; +AddFilesToHaikuImage system add-ons kernel network ppp + : $(SYSTEM_NETWORK_PPP) ; +AddFilesToHaikuImage system add-ons kernel network protocols + : $(SYSTEM_NETWORK_PROTOCOLS) ; +AddFilesToHaikuImage system add-ons Print : $(SYSTEM_ADD_ONS_PRINT) ; +AddFilesToHaikuImage system add-ons Print transport + : $(SYSTEM_ADD_ONS_PRINT_TRANSPORT) ; +AddFilesToHaikuImage system add-ons Screen\ Savers + : $(SYSTEM_ADD_ONS_SCREENSAVERS) ; -AddFilesToHaikuImage beos system add-ons disk_systems +AddFilesToHaikuImage system add-ons disk_systems : intel bfs ; # create directories that will remain empty @@ -469,11 +470,11 @@ AddDirectoryToHaikuImage home config add-ons Tracker ; AddDirectoryToHaikuImage home config add-ons Screen\ Savers ; AddDirectoryToHaikuImage home config add-ons Translators ; -AddDirectoryToHaikuImage beos etc synth ; -AddDirectoryToHaikuImage beos system add-ons input_server methods ; +AddDirectoryToHaikuImage system data synth ; +AddDirectoryToHaikuImage system add-ons input_server methods ; # optional -AddFilesToHaikuImage optional beos system add-ons input_server methods : canna ; +AddFilesToHaikuImage optional system add-ons input_server methods : canna ; # printers AddDirectoryToHaikuImage home config settings printers Preview @@ -482,7 +483,7 @@ : home-config-settings-printers-save-as-pdf.rdef ; # licenses -CopyDirectoryToHaikuImage beos etc +CopyDirectoryToHaikuImage system data : [ FDirName $(HAIKU_TOP) data etc licenses ] : licenses : -x .svn ; @@ -512,14 +513,14 @@ # collect the targets we would install in the lib directory local alternativeSystemLibs ; -local libTargets = [ FFilesInHaikuImageDirectory beos system lib ] ; +local libTargets = [ FFilesInHaikuImageDirectory system lib ] ; local libTarget ; for libTarget in $(libTargets) { alternativeSystemLibs += [ on $(libTarget) return $(TARGET) ] ; } # collect the symlinks we would install in the lib directory -libTargets = [ FSymlinksInHaikuImageDirectory beos system lib ] ; +libTargets = [ FSymlinksInHaikuImageDirectory system lib ] ; local tmpAlternativeLibDir = [ FDirName $(HAIKU_OUTPUT_DIR) tmp alternativeLibs ] ; for libTarget in $(libTargets) { @@ -567,7 +568,7 @@ } # install the alternative libs in the right directory - UnzipArchiveToHaikuImage beos system lib $(libSubDir) + UnzipArchiveToHaikuImage system lib $(libSubDir) : $(otherAlternativeSystemLibsZip) ; } Modified: haiku/trunk/build/jam/ImageRules =================================================================== --- haiku/trunk/build/jam/ImageRules 2009-04-03 08:05:25 UTC (rev 29875) +++ haiku/trunk/build/jam/ImageRules 2009-04-03 09:02:44 UTC (rev 29876) @@ -288,10 +288,10 @@ { # AddDriversToContainer : : ; # - local directoryTokens = beos system add-ons kernel drivers dev + local directoryTokens = system add-ons kernel drivers dev $(relativeDirectoryTokens) ; - AddFilesToContainer $(container) : beos system add-ons kernel drivers bin + AddFilesToContainer $(container) : system add-ons kernel drivers bin : $(targets) ; # If the image shall only be updated, we don't add any symlinks. @@ -320,7 +320,7 @@ { # AddNewDriversToContainer : : ; # - local directoryTokens = beos system add-ons kernel drivers + local directoryTokens = system add-ons kernel drivers $(relativeDirectoryTokens) ; AddFilesToContainer $(container) : $(directoryTokens) @@ -356,7 +356,7 @@ local name = $(target:BS) ; local linkTarget = [ FDirName /boot $(installDir:G=) $(name) ] ; - AddSymlinkToContainer $(container) : beos system add-ons kernel boot + AddSymlinkToContainer $(container) : system add-ons kernel boot : $(linkTarget) : $(name) ; } } @@ -751,7 +751,7 @@ Always $(file) ; MakeLocate $(file) : $(HAIKU_COMMON_PLATFORM_OBJECT_DIR) ; BuildHaikuImageUserGroupFile $(file) ; - AddFilesToHaikuImage beos etc : $(file) ; + AddFilesToHaikuImage system etc : $(file) ; } HAIKU_IMAGE_USER_GROUP_ENTRIES on $(file) = $(allEntries) ; @@ -805,7 +805,7 @@ name = ; } - AddFilesToHaikuImage beos etc licenses : $(file) : $(name) ; + AddFilesToHaikuImage system data licenses : $(file) : $(name) ; } @@ -1053,9 +1053,9 @@ # warning: that is quite x86 dependant... -rule BuildFloppyBootImage image : zbeos : archive +rule BuildFloppyBootImage image : haikuLoader : archive { - Depends $(image) : $(zbeos) ; + Depends $(image) : $(haikuLoader) ; Depends $(image) : $(archive) ; #MakeLocateDebug $(image) ; ARCHIVE_IMAGE_OFFSET on $(image) = $(HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET) ; @@ -1067,7 +1067,7 @@ FLOPPY_IMAGE_BLOCK_SIZE on $(image) = 2 ; } - BuildFloppyBootImage1 $(image) : $(zbeos) $(archive) ; + BuildFloppyBootImage1 $(image) : $(haikuLoader) $(archive) ; } actions BuildFloppyBootImage1 @@ -1075,11 +1075,9 @@ $(RM) $(<) # make an empty image dd if=/dev/zero of=$(<) bs=$(FLOPPY_IMAGE_BLOCK_SIZE)k count=1440 - # add zbeos + # add haiku_loader dd if=$(>[1]) of=$(<) conv=notrunc # add the boot drivers tgz archive - # keep the offset in sync with - # src/system/boot/loader/file_systems/tarfs/tarfs.cpp:kFloppyArchiveOffset dd if=$(>[2]) of=$(<) bs=$(ARCHIVE_IMAGE_OFFSET)k seek=1 conv=notrunc } Modified: haiku/trunk/build/jam/OptionalPackages =================================================================== --- haiku/trunk/build/jam/OptionalPackages 2009-04-03 08:05:25 UTC (rev 29875) +++ haiku/trunk/build/jam/OptionalPackages 2009-04-03 09:02:44 UTC (rev 29876) @@ -102,10 +102,10 @@ if [ IsOptionalHaikuImagePackageAdded BeBook ] { InstallOptionalHaikuImagePackage bebook_20081026 : http://haiku-files.org/files/optional-packages/bebook_20081026.zip - : beos documentation + : system documentation ; AddSymlinkToHaikuImage home Desktop - : /boot/beos/documentation/bebook/index.html : BeBook ; + : /boot/system/documentation/bebook/index.html : BeBook ; } @@ -147,14 +147,15 @@ if [ IsOptionalHaikuImagePackageAdded Bluetooth ] { local bluetoothDrivers = h2generic ; AddDriversToHaikuImage bluetooth : $(bluetoothDrivers) ; - AddFilesToHaikuImage beos system servers : bluetooth_server ; - AddFilesToHaikuImage beos system lib : libbluetooth.so ; - AddFilesToHaikuImage beos system add-ons kernel network devices : bluetooth ; - AddFilesToHaikuImage beos system add-ons kernel network protocols : l2cap ; - AddFilesToHaikuImage beos system add-ons kernel bluetooth : btCoreData ; - AddFilesToHaikuImage beos preferences : Bluetooth ; - AddFilesToHaikuImage beos bin : bt_dev_info bt_discovery ; - AddSymlinkToHaikuImage home config be Preferences : /boot/beos/preferences/Bluetooth ; + AddFilesToHaikuImage system servers : bluetooth_server ; + AddFilesToHaikuImage system lib : libbluetooth.so ; + AddFilesToHaikuImage system add-ons kernel network devices : bluetooth ; + AddFilesToHaikuImage system add-ons kernel network protocols : l2cap ; + AddFilesToHaikuImage system add-ons kernel bluetooth : btCoreData ; + AddFilesToHaikuImage system preferences : Bluetooth ; + AddFilesToHaikuImage system bin : bt_dev_info bt_discovery ; + AddSymlinkToHaikuImage home config be Preferences + : /boot/system/preferences/Bluetooth ; if [ IsOptionalHaikuImagePackageAdded Development ] { AddSymlinkToHaikuImage develop lib x86 : /system/lib/libbluetooth.so ; } @@ -198,12 +199,12 @@ AddFilesToHaikuImage develop lib x86 : libposix_error_mapper.a ; # cc and c++ wrapper scripts - AddFilesToHaikuImage beos bin : cc c++ ; + AddFilesToHaikuImage system bin : cc c++ ; # mkdepend build tool, which is part of the Haiku source tree # (same as make, but make is already included independent of the # Development package) - AddFilesToHaikuImage beos bin : mkdepend ; + AddFilesToHaikuImage system bin : mkdepend ; # skeleton makefile and makefile-engine local makefileEngineFiles = @@ -520,10 +521,10 @@ # UserlandFS if [ IsOptionalHaikuImagePackageAdded UserlandFS ] { # kernel module - AddFilesToHaikuImage beos system add-ons kernel file_systems : userlandfs ; + AddFilesToHaikuImage system add-ons kernel file_systems : userlandfs ; # server - AddFilesToHaikuImage beos system servers : userlandfs_server ; + AddFilesToHaikuImage system servers : userlandfs_server ; # libs local userlandfsLibs = @@ -531,7 +532,7 @@ libuserlandfs_haiku_kernel.so libuserlandfs_fuse.so ; - AddFilesToHaikuImage beos system lib : $(userlandfsLibs) ; + AddFilesToHaikuImage system lib : $(userlandfsLibs) ; # development goodies if [ IsOptionalHaikuImagePackageAdded Development ] { @@ -602,17 +603,17 @@ # Welcome if [ IsOptionalHaikuImagePackageAdded Welcome ] { - CopyDirectoryToHaikuImage beos documentation + CopyDirectoryToHaikuImage system documentation : [ FDirName $(HAIKU_TOP) docs welcome ] : welcome : -x .svn ; - CopyDirectoryToHaikuImage beos documentation + CopyDirectoryToHaikuImage system documentation : [ FDirName $(HAIKU_TOP) docs userguide ] : userguide : -x .svn ; - AddFilesToHaikuImage beos documentation + AddFilesToHaikuImage system documentation : [ FDirName $(HAIKU_TOP) docs Haiku-doc.css ] : Haiku-doc.css ; AddSymlinkToHaikuImage home Desktop - : /boot/beos/documentation/welcome/welcome.html : Welcome ; + : /boot/system/documentation/welcome/welcome.html : Welcome ; } Modified: haiku/trunk/build/jam/UserBuildConfig.ReadMe =================================================================== --- haiku/trunk/build/jam/UserBuildConfig.ReadMe 2009-04-03 08:05:25 UTC (rev 29875) +++ haiku/trunk/build/jam/UserBuildConfig.ReadMe 2009-04-03 09:02:44 UTC (rev 29876) @@ -83,17 +83,17 @@ # has been added, like for "kernel"). HAIKU_INCLUDE_IN_IMAGE on libbe.so kernel = 1 ; -# Add "crashing_app" to the beos/bin directory of the Haiku image/installation. +# Add "crashing_app" to the system/bin directory of the Haiku image/installation. # Note, that this also makes the image depend on the target, i.e. it is # automatically updated when the image is built. -AddFilesToHaikuImage beos bin : crashing_app ; +AddFilesToHaikuImage system bin : crashing_app ; # Make a symlink to home/config/bin/crash. -AddSymlinkToHaikuImage home config bin : /beos/bin/crashing_app : crash ; +AddSymlinkToHaikuImage home config bin : /bin/crashing_app : crash ; # Add timezone and keymap settings. AddSymlinkToHaikuImage home config settings - : /boot/beos/etc/timezones/Europe/Paris : timezone ; + : /boot/system/data/timezones/Europe/Paris : timezone ; AddFilesToHaikuImage home config settings : US-International : Key_map ; # Adds the source directories src/kits/storage and src/tests/servers/debug Modified: haiku/trunk/build/jam/UserBuildConfig.sample =================================================================== --- haiku/trunk/build/jam/UserBuildConfig.sample 2009-04-03 08:05:25 UTC (rev 29875) +++ haiku/trunk/build/jam/UserBuildConfig.sample 2009-04-03 09:02:44 UTC (rev 29876) @@ -8,7 +8,7 @@ #HAIKU_INSTALL_DIR = /Haiku ; # Install Haiku on device /dev/sda57. Be sure you know what you're doing! -#HAIKU_IMAGE_DIR = /dev ; +#HAIKU_IMAGE_DIR = /dev ; #HAIKU_IMAGE_NAME = sda57 ; #HAIKU_DONT_CLEAR_IMAGE = 1 ; @@ -19,7 +19,7 @@ # Add symlink/file (timezone and keymap settings) to the image. #AddSymlinkToHaikuImage home config settings -# : /boot/beos/etc/timezones/Europe/Paris : timezone ; +# : /boot/system/data/timezones/Europe/Paris : timezone ; #AddFilesToHaikuImage home config settings : US-International # : Key_map ; Modified: haiku/trunk/build/scripts/build_haiku_cd =================================================================== --- haiku/trunk/build/scripts/build_haiku_cd 2009-04-03 08:05:25 UTC (rev 29875) +++ haiku/trunk/build/scripts/build_haiku_cd 2009-04-03 09:02:44 UTC (rev 29876) @@ -135,7 +135,7 @@ $rmAttrs -f $copyrightAttrs touch $copyrightAttrs $addattr -f $copyrightsFile COPYRIGHTS $copyrightAttrs - $copyAttrs $copyrightAttrs ${tPrefix}beos/apps/AboutSystem + $copyAttrs $copyrightAttrs ${tPrefix}system/apps/AboutSystem fi # generate the attribute stores Modified: haiku/trunk/build/scripts/build_haiku_image =================================================================== --- haiku/trunk/build/scripts/build_haiku_image 2009-04-03 08:05:25 UTC (rev 29875) +++ haiku/trunk/build/scripts/build_haiku_image 2009-04-03 09:02:44 UTC (rev 29876) @@ -207,7 +207,7 @@ $rmAttrs -f $copyrightAttrs touch $copyrightAttrs $addattr -f $copyrightsFile COPYRIGHTS $copyrightAttrs - $copyAttrs ${sPrefix}$copyrightAttrs ${tPrefix}beos/apps/AboutSystem + $copyAttrs ${sPrefix}$copyrightAttrs ${tPrefix}system/apps/AboutSystem fi fi Modified: haiku/trunk/data/system/boot/Bootscript =================================================================== --- haiku/trunk/data/system/boot/Bootscript 2009-04-03 08:05:25 UTC (rev 29875) +++ haiku/trunk/data/system/boot/Bootscript 2009-04-03 09:02:44 UTC (rev 29876) @@ -20,7 +20,7 @@ echo There is no "$toLaunch" fi return 0 -} +} # launchscript