From umccullough at gmail.com Sat Aug 1 00:07:28 2009 From: umccullough at gmail.com (Urias McCullough) Date: Fri, 31 Jul 2009 15:07:28 -0700 Subject: [Haiku-commits] r32036 - haiku/trunk/src/preferences/screen In-Reply-To: <200907312129.n6VLTfrc010768@sheep.berlios.de> References: <200907312129.n6VLTfrc010768@sheep.berlios.de> Message-ID: <1e80d8750907311507g1dcac336sb400192726adcf59@mail.gmail.com> On Fri, Jul 31, 2009 at 2:29 PM, wrote: > Author: axeld > Date: 2009-07-31 23:29:40 +0200 (Fri, 31 Jul 2009) > New Revision: 32036 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32036&view=rev > > Modified: > ? haiku/trunk/src/preferences/screen/ScreenMode.cpp > Log: > * Added some more vendor names, taken from the syslog data in our bug > ?tracker :-) You missed this one I think: http://dev.haiku-os.org/ticket/1732 HWP = "Hewlett Packard" and this perhaps: http://dev.haiku-os.org/ticket/1667 which probably should be: MED = "Medion" (this one is actually a guess, since that's the only LCD display vendor I could find that matched: http://en.wikipedia.org/wiki/Medion ) - Urias From stippi at mail.berlios.de Sat Aug 1 00:12:05 2009 From: stippi at mail.berlios.de (stippi at mail.berlios.de) Date: Sat, 1 Aug 2009 00:12:05 +0200 Subject: [Haiku-commits] r32037 - haiku/trunk/src/add-ons/media/plugins/ffmpeg Message-ID: <200907312212.n6VMC54l018247@sheep.berlios.de> Author: stippi Date: 2009-08-01 00:12:03 +0200 (Sat, 01 Aug 2009) New Revision: 32037 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32037&view=rev Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatWriter.cpp haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatWriter.h Log: This should fix the GCC 4 build. The avformat code expects a non-const buffer for the write() hook. Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatWriter.cpp =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatWriter.cpp 2009-07-31 21:29:40 UTC (rev 32036) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatWriter.cpp 2009-07-31 22:12:03 UTC (rev 32037) @@ -331,7 +331,7 @@ /*static*/ int -AVFormatWriter::_Write(void* cookie, const uint8* buffer, int bufferSize) +AVFormatWriter::_Write(void* cookie, uint8* buffer, int bufferSize) { TRACE_IO("AVFormatWriter::_Write(%p, %p, %d)\n", cookie, buffer, bufferSize); Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatWriter.h =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatWriter.h 2009-07-31 21:29:40 UTC (rev 32036) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatWriter.h 2009-07-31 22:12:03 UTC (rev 32037) @@ -43,7 +43,7 @@ media_encode_info* encodeInfo); private: - static int _Write(void* cookie, const uint8* buffer, + static int _Write(void* cookie, uint8* buffer, int bufferSize); static off_t _Seek(void* cookie, off_t offset, int whence); From anevilyak at mail.berlios.de Sat Aug 1 00:16:58 2009 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Sat, 1 Aug 2009 00:16:58 +0200 Subject: [Haiku-commits] r32038 - haiku/trunk/headers/posix Message-ID: <200907312216.n6VMGwi2018993@sheep.berlios.de> Author: anevilyak Date: 2009-08-01 00:16:58 +0200 (Sat, 01 Aug 2009) New Revision: 32038 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32038&view=rev Modified: haiku/trunk/headers/posix/wchar.h Log: Add missing definition for wcsstr. This was preventing clucene from building with wide chars enabled. Modified: haiku/trunk/headers/posix/wchar.h =================================================================== --- haiku/trunk/headers/posix/wchar.h 2009-07-31 22:12:03 UTC (rev 32037) +++ haiku/trunk/headers/posix/wchar.h 2009-07-31 22:16:58 UTC (rev 32038) @@ -105,6 +105,7 @@ extern size_t wcsrtombs(char *dst, const wchar_t **src, size_t len, mbstate_t *ps); extern size_t wcsspn(const wchar_t *, const wchar_t *); +extern wchar_t *wcsstr(const wchar_t *, const wchar_t *); extern double wcstod(const wchar_t *, wchar_t **); extern float wcstof(const wchar_t *, wchar_t **); extern wchar_t *wcstok(wchar_t *, const wchar_t *, wchar_t **); From mmlr at mail.berlios.de Sat Aug 1 00:19:40 2009 From: mmlr at mail.berlios.de (mmlr at mail.berlios.de) Date: Sat, 1 Aug 2009 00:19:40 +0200 Subject: [Haiku-commits] r32039 - in haiku/trunk: headers/os/app headers/private/app src/kits/app src/kits/interface src/servers/registrar Message-ID: <200907312219.n6VMJeRv019233@sheep.berlios.de> Author: mmlr Date: 2009-08-01 00:19:36 +0200 (Sat, 01 Aug 2009) New Revision: 32039 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32039&view=rev Modified: haiku/trunk/headers/os/app/Message.h haiku/trunk/headers/private/app/MessagePrivate.h haiku/trunk/src/kits/app/Message.cpp haiku/trunk/src/kits/app/MessageAdapter.cpp haiku/trunk/src/kits/app/MessageUtils.cpp haiku/trunk/src/kits/interface/View.cpp haiku/trunk/src/servers/registrar/MessageDeliverer.cpp Log: * Fully switch to the Haiku message format so that it is also used for on-disk storage. * Remove reduntant information from the header (field_count vs. fields_size). * Remove checksums previously used to validate the message passing by area mechanism. * Move variables that are purely used by the instance out of the header and into the BMessage object. * Use more sensible types for the different message fields. * Reduce some field sizes to realistic values. * Make size_t values into uint32 values so the message format will not change when later moving to 64 bits. * Pack the structures used for flat message storage so it doesn't change because of padding. * Fix message passing by area. It never worked because the created area was never actually filled with any data! * Some more allocation checks with graceful fallbacks (should be all now). * Some more checks for negative index values (should also be all now). * Make printing more inline with how the rest of the class works and make some of the output more consistent. * Also add the new unsigned types to PrintToStream() output. * Fix printing of unknown types and invalid BMessages, it would always have printed only the first entry respectively the same error. * Added some clarifying comments. * Cleanup. Modified: haiku/trunk/headers/os/app/Message.h =================================================================== --- haiku/trunk/headers/os/app/Message.h 2009-07-31 22:16:58 UTC (rev 32038) +++ haiku/trunk/headers/os/app/Message.h 2009-07-31 22:19:36 UTC (rev 32039) @@ -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. * * Authors: @@ -291,11 +291,13 @@ status_t _FlattenToArea(message_header **_header) const; status_t _CopyForWrite(); - status_t _Reference(message_header *header); + status_t _Reference(); status_t _Dereference(); - status_t _ResizeData(int32 offset, int32 change); + status_t _ValidateMessage(); + status_t _ResizeData(uint32 offset, int32 change); + uint32 _HashName(const char* name) const; status_t _FindField(const char* name, type_code type, field_header** _result) const; @@ -303,9 +305,6 @@ bool isFixedSize, field_header** _result); status_t _RemoveField(field_header* field); - ssize_t _NativeFlattenedSize() const; - status_t _NativeFlatten(char *buffer, ssize_t size) const; - status_t _NativeFlatten(BDataIO *stream, ssize_t *size = NULL) const; void _PrintToStream(const char* indent) const; private: @@ -313,12 +312,15 @@ field_header* fFields; uint8* fData; + uint32 fFieldsAvailable; + size_t fDataAvailable; + mutable BMessage* fOriginal; BMessage* fQueueLink; // fQueueLink is used by BMessageQueue to build a linked list - uint32 fReserved[11]; + uint32 fReserved[9]; // deprecated BMessage(BMessage *message); Modified: haiku/trunk/headers/private/app/MessagePrivate.h =================================================================== --- haiku/trunk/headers/private/app/MessagePrivate.h 2009-07-31 22:16:58 UTC (rev 32038) +++ haiku/trunk/headers/private/app/MessagePrivate.h 2009-07-31 22:19:36 UTC (rev 32039) @@ -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. * * Authors: @@ -14,10 +14,9 @@ #include -#define MESSAGE_BODY_HASH_TABLE_SIZE 10 +#define MESSAGE_BODY_HASH_TABLE_SIZE 5 #define MAX_DATA_PREALLOCATION B_PAGE_SIZE * 10 #define MAX_FIELD_PREALLOCATION 50 -#define MAX_ITEM_PREALLOCATION B_PAGE_SIZE static const int32 kPortMessageCode = 'pjpp'; @@ -30,8 +29,8 @@ MESSAGE_FLAG_IS_REPLY = 0x0008, MESSAGE_FLAG_WAS_DELIVERED = 0x0010, MESSAGE_FLAG_HAS_SPECIFIERS = 0x0020, - MESSAGE_FLAG_WAS_DROPPED = 0x0080, - MESSAGE_FLAG_PASS_BY_AREA = 0x0100 + MESSAGE_FLAG_WAS_DROPPED = 0x0040, + MESSAGE_FLAG_PASS_BY_AREA = 0x0080 }; @@ -42,15 +41,14 @@ struct BMessage::field_header { - uint32 flags; + uint16 flags; + uint16 name_length; type_code type; - int32 name_length; - int32 count; - ssize_t data_size; - ssize_t allocated; - int32 offset; + uint32 count; + uint32 data_size; + uint32 offset; int32 next_field; -}; +} _PACKED; struct BMessage::message_header { @@ -58,14 +56,6 @@ uint32 what; uint32 flags; - ssize_t fields_size; - ssize_t data_size; - ssize_t fields_available; - ssize_t data_available; - - uint32 fields_checksum; - uint32 data_checksum; - int32 target; int32 current_specifier; area_id message_area; @@ -76,8 +66,9 @@ team_id reply_team; // body info - int32 field_count; - int32 hash_table_size; + uint32 data_size; + uint32 field_count; + uint32 hash_table_size; int32 hash_table[MESSAGE_BODY_HASH_TABLE_SIZE]; /* The hash table does contain indexes into the field list and @@ -86,18 +77,20 @@ The hash table must be reevaluated when we remove a field though. */ -}; +} _PACKED; class BMessage::Private { public: Private(BMessage *msg) - : fMessage(msg) + : + fMessage(msg) { } Private(BMessage &msg) - : fMessage(&msg) + : + fMessage(&msg) { } @@ -175,25 +168,7 @@ return fMessage->fData; } - ssize_t - NativeFlattenedSize() const - { - return fMessage->_NativeFlattenedSize(); - } - status_t - NativeFlatten(char *buffer, ssize_t size) const - { - return fMessage->_NativeFlatten(buffer, size); - } - - status_t - NativeFlatten(BDataIO *stream, ssize_t *size) const - { - return fMessage->_NativeFlatten(stream, size); - } - - status_t FlattenToArea(message_header **header) const { return fMessage->_FlattenToArea(header); Modified: haiku/trunk/src/kits/app/Message.cpp =================================================================== --- haiku/trunk/src/kits/app/Message.cpp 2009-07-31 22:16:58 UTC (rev 32038) +++ haiku/trunk/src/kits/app/Message.cpp 2009-07-31 22:19:36 UTC (rev 32039) @@ -36,9 +36,21 @@ #include "tracing_config.h" // kernel tracing configuration -#define DEBUG_FUNCTION_ENTER //debug_printf("thread: 0x%x; this: 0x%08x; header: 0x%08x; fields: 0x%08x; data: 0x%08x; line: %04ld; func: %s\n", find_thread(NULL), this, fHeader, fFields, fData, __LINE__, __PRETTY_FUNCTION__); -#define DEBUG_FUNCTION_ENTER2 //debug_printf("thread: 0x%x; line: %04ld: func: %s\n", find_thread(NULL), __LINE__, __PRETTY_FUNCTION__); +//#define VERBOSE_DEBUG_OUTPUT +#ifdef VERBOSE_DEBUG_OUTPUT +#define DEBUG_FUNCTION_ENTER \ + debug_printf("msg thread: %ld; this: %p; header: %p; fields: %p;" \ + " data: %p; what: 0x%08lx '%.4s'; line: %d; func: %s\n", \ + find_thread(NULL), this, fHeader, fFields, fData, what, (char *)&what, \ + __LINE__, __PRETTY_FUNCTION__); +#define DEBUG_FUNCTION_ENTER2 \ + debug_printf("msg thread: %ld; line: %d: func: %s\n", find_thread(NULL), \ + __LINE__, __PRETTY_FUNCTION__); +#else +#define DEBUG_FUNCTION_ENTER /* nothing */ +#define DEBUG_FUNCTION_ENTER2 /* nothing */ +#endif #if BMESSAGE_TRACING # define KTRACE(format...) ktrace_printf(format) @@ -67,21 +79,21 @@ long BMessage::sReplyPortInUse[sNumReplyPorts]; -template static uint8 * -print_to_stream_type(uint8* pointer) +template +static void +print_to_stream_type(uint8 *pointer) { Type *item = (Type *)pointer; item->PrintToStream(); - return (uint8 *)(item+1); } -template static uint8 * -print_type(const char* format, uint8* pointer) +template +static void +print_type(const char *format, uint8 *pointer) { Type *item = (Type *)pointer; printf(format, *item, *item); - return (uint8 *)(item+1); } @@ -95,7 +107,7 @@ size = port_buffer_size_etc(replyPort, B_RELATIVE_TIMEOUT, timeout); } while (size == B_INTERRUPTED); - if (size < B_OK) + if (size < 0) return size; status_t result; @@ -107,9 +119,9 @@ result = read_port(replyPort, _code, buffer, size); } while (result == B_INTERRUPTED); - if (result < B_OK || *_code != kPortMessageCode) { + if (result < 0 || *_code != kPortMessageCode) { free(buffer); - return result < B_OK ? result : B_ERROR; + return result < 0 ? result : B_ERROR; } result = reply->Unflatten(buffer); @@ -170,6 +182,9 @@ _Clear(); fHeader = (message_header *)malloc(sizeof(message_header)); + if (fHeader == NULL) + return *this; + memcpy(fHeader, other.fHeader, sizeof(message_header)); // Clear some header flags inherited from the original message that don't @@ -179,20 +194,30 @@ | MESSAGE_FLAG_WAS_DROPPED | MESSAGE_FLAG_PASS_BY_AREA); // Note, that BeOS R5 seems to keep the reply info. - if (fHeader->fields_size > 0) { - fFields = (field_header *)malloc(fHeader->fields_size); - memcpy(fFields, other.fFields, fHeader->fields_size); + if (fHeader->field_count > 0) { + size_t fieldsSize = fHeader->field_count * sizeof(field_header); + fFields = (field_header *)malloc(fieldsSize); + if (fFields == NULL) { + fHeader->field_count = 0; + fHeader->data_size = 0; + } else + memcpy(fFields, other.fFields, fieldsSize); } if (fHeader->data_size > 0) { fData = (uint8 *)malloc(fHeader->data_size); - memcpy(fData, other.fData, fHeader->data_size); + if (fData == NULL) { + fHeader->field_count = 0; + free(fFields); + fFields = NULL; + } else + memcpy(fData, other.fData, fHeader->data_size); } + fHeader->what = what = other.what; fHeader->message_area = -1; - fHeader->fields_available = 0; - fHeader->data_available = 0; - fHeader->what = what = other.what; + fFieldsAvailable = 0; + fDataAvailable = 0; return *this; } @@ -233,7 +258,7 @@ if (fHeader->field_count != other.fHeader->field_count) return false; - for (int32 i = 0; i < fHeader->field_count; i++) { + for (uint32 i = 0; i < fHeader->field_count; i++) { field_header *field = &fFields[i]; field_header *otherField = NULL; @@ -292,6 +317,9 @@ fFields = NULL; fData = NULL; + fFieldsAvailable = 0; + fDataAvailable = 0; + fOriginal = NULL; fQueueLink = NULL; @@ -307,7 +335,12 @@ BMessage::_InitHeader() { DEBUG_FUNCTION_ENTER; - fHeader = (message_header *)malloc(sizeof(message_header)); + if (fHeader == NULL) { + fHeader = (message_header *)malloc(sizeof(message_header)); + if (fHeader == NULL) + return B_NO_MEMORY; + } + memset(fHeader, 0, sizeof(message_header) - sizeof(fHeader->hash_table)); fHeader->format = MESSAGE_FORMAT_HAIKU; @@ -332,7 +365,7 @@ BMessage::_Clear() { DEBUG_FUNCTION_ENTER; - if (fHeader) { + if (fHeader != NULL) { // We're going to destroy all information of this message. If there's // still someone waiting for a reply to this message, we have to send // one now. @@ -351,6 +384,9 @@ free(fData); fData = NULL; + fFieldsAvailable = 0; + fDataAvailable = 0; + delete fOriginal; fOriginal = NULL; @@ -363,10 +399,10 @@ type_code *typeFound, int32 *countFound) const { DEBUG_FUNCTION_ENTER; + if (index < 0 || (uint32)index >= fHeader->field_count) + return B_BAD_INDEX; + if (typeRequested == B_ANY_TYPE) { - if (index >= fHeader->field_count) - return B_BAD_INDEX; - if (nameFound) *nameFound = (char *)fData + fFields[index].offset; if (typeFound) @@ -378,7 +414,7 @@ int32 counter = -1; field_header *field = fFields; - for (int32 i = 0; i < fHeader->field_count; i++, field++) { + for (uint32 i = 0; i < fHeader->field_count; i++, field++) { if (field->type == typeRequested) counter++; @@ -410,7 +446,7 @@ field_header *field = NULL; status_t result = _FindField(name, B_ANY_TYPE, &field); - if (result < B_OK || !field) + if (result < B_OK || field == NULL) return result; if (typeFound) @@ -429,13 +465,13 @@ DEBUG_FUNCTION_ENTER; field_header *field = NULL; status_t result = _FindField(name, B_ANY_TYPE, &field); - if (result < B_OK || !field) + if (result < B_OK || field == NULL) return result; if (typeFound) *typeFound = field->type; if (fixedSize) - *fixedSize = field->flags & FIELD_FLAG_FIXED_SIZE; + *fixedSize = (field->flags & FIELD_FLAG_FIXED_SIZE) != 0; return B_OK; } @@ -450,7 +486,7 @@ int32 count = 0; field_header *field = fFields; - for (int32 i = 0; i < fHeader->field_count; i++, field++) { + for (uint32 i = 0; i < fHeader->field_count; i++, field++) { if (field->type == type) count++; } @@ -493,7 +529,7 @@ BMessage::IsReply() const { DEBUG_FUNCTION_ENTER; - return fHeader->flags & MESSAGE_FLAG_IS_REPLY; + return (fHeader->flags & MESSAGE_FLAG_IS_REPLY) != 0; } @@ -512,21 +548,24 @@ int32 value = B_BENDIAN_TO_HOST_INT32(what); printf("BMessage("); - if (isprint(*(char *)&value)) { + if (isprint(*(char *)&value)) printf("'%.4s'", (char *)&value); - } else + else printf("0x%lx", what); printf(") {\n"); + if (fHeader == NULL || fFields == NULL || fData == NULL) + return; + field_header *field = fFields; - for (int32 i = 0; i < fHeader->field_count; i++, field++) { + for (uint32 i = 0; i < fHeader->field_count; i++, field++) { value = B_BENDIAN_TO_HOST_INT32(field->type); ssize_t size = 0; - if ((field->flags & FIELD_FLAG_FIXED_SIZE) && field->count > 0) + if ((field->flags & FIELD_FLAG_FIXED_SIZE) != 0 && field->count > 0) size = field->data_size / field->count; uint8 *pointer = fData + field->offset + field->name_length; - for (int32 j = 0; j < field->count; j++) { + for (uint32 j = 0; j < field->count; j++) { if (field->count == 1) { printf("%s %s = ", indent, (char *)(fData + field->offset)); @@ -537,62 +576,80 @@ switch (field->type) { case B_RECT_TYPE: - pointer = print_to_stream_type(pointer); + print_to_stream_type(pointer); break; case B_POINT_TYPE: - pointer = print_to_stream_type(pointer); + print_to_stream_type(pointer); break; - case B_STRING_TYPE: { - ssize_t size = *(ssize_t *)pointer; - pointer += sizeof(ssize_t); - printf("string(\"%s\", %ld bytes)\n", (char *)pointer, size); - pointer += size; + case B_STRING_TYPE: + { + size = *(uint32 *)pointer; + pointer += sizeof(uint32); + printf("string(\"%s\", %ld bytes)\n", (char *)pointer, + size); break; } case B_INT8_TYPE: - pointer = print_type("int8(0x%hx or %d or \'%.1s\')\n", pointer); + print_type("int8(0x%hx or %d or '%.1s')\n", pointer); break; + case B_UINT8_TYPE: + print_type("uint8(0x%hx or %u or '%.1s')\n", + pointer); + break; + case B_INT16_TYPE: - pointer = print_type("int16 (0x%x or %d)\n", pointer); + print_type("int16(0x%x or %d)\n", pointer); break; + case B_UINT16_TYPE: + print_type("uint16(0x%x or %u\n", pointer); + break; + case B_INT32_TYPE: - pointer = print_type("int32(0x%lx or %ld)\n", pointer); + print_type("int32(0x%lx or %ld)\n", pointer); break; + case B_UINT32_TYPE: + print_type("uint32(0x%lx or %lu\n", pointer); + break; + case B_INT64_TYPE: - pointer = print_type("int64(0x%Lx or %Ld)\n", pointer); + print_type("int64(0x%Lx or %Ld)\n", pointer); break; + case B_UINT64_TYPE: + print_type("uint64(0x%Lx or %Ld\n", pointer); + break; + case B_BOOL_TYPE: - printf("bool(%s)\n", *((bool *)pointer)!= 0 ? "true" : "false"); - pointer += sizeof(bool); + printf("bool(%s)\n", *((bool *)pointer) != 0 + ? "true" : "false"); break; case B_FLOAT_TYPE: - pointer = print_type("float(%.4f)\n", pointer); + print_type("float(%.4f)\n", pointer); break; case B_DOUBLE_TYPE: - pointer = print_type("double(%.8f)\n", pointer); + print_type("double(%.8f)\n", pointer); break; - case B_REF_TYPE: { - ssize_t size = *(ssize_t *)pointer; - pointer += sizeof(ssize_t); + case B_REF_TYPE: + { + size = *(uint32 *)pointer; + pointer += sizeof(uint32); entry_ref ref; BPrivate::entry_ref_unflatten(&ref, (char *)pointer, size); - printf("entry_ref(device=%ld, directory=%lld, name=\"%s\", ", - ref.device, ref.directory, ref.name); + printf("entry_ref(device=%ld, directory=%lld, + name=\"%s\", ", ref.device, ref.directory, ref.name); BPath path(&ref); printf("path=\"%s\")\n", path.Path()); - pointer += size; break; } @@ -602,22 +659,28 @@ sprintf(buffer, "%s ", indent); BMessage message; - const ssize_t size = *(const ssize_t *)pointer; - pointer += sizeof(ssize_t); - if (message.Unflatten((const char *)pointer)!=B_OK) { - fprintf(stderr, "couldn't unflatten item %ld\n", i); + size = *(uint32 *)pointer; + pointer += sizeof(uint32); + status_t result = message.Unflatten((const char *)pointer); + if (result != B_OK) { + printf("failed unflatten: %s\n", strerror(result)); break; } + message._PrintToStream(buffer); printf("%s }\n", indent); - pointer += size; break; } - default: { - printf("(type = '%.4s')(size = %ld)\n", (char *)&value, size); + default: + { + printf("(type = '%.4s')(size = %ld)\n", (char *)&value, + size); + break; } } + + pointer += size; } } } @@ -627,7 +690,7 @@ BMessage::Rename(const char *oldEntry, const char *newEntry) { DEBUG_FUNCTION_ENTER; - if (!oldEntry || !newEntry) + if (oldEntry == NULL || newEntry == NULL) return B_BAD_VALUE; if (fHeader->message_area >= 0) @@ -674,7 +737,7 @@ BMessage::WasDelivered() const { DEBUG_FUNCTION_ENTER; - return fHeader->flags & MESSAGE_FLAG_WAS_DELIVERED; + return (fHeader->flags & MESSAGE_FLAG_WAS_DELIVERED) != 0; } @@ -682,8 +745,8 @@ BMessage::IsSourceWaiting() const { DEBUG_FUNCTION_ENTER; - return (fHeader->flags & MESSAGE_FLAG_REPLY_REQUIRED) - && !(fHeader->flags & MESSAGE_FLAG_REPLY_DONE); + return (fHeader->flags & MESSAGE_FLAG_REPLY_REQUIRED) != 0 + && (fHeader->flags & MESSAGE_FLAG_REPLY_DONE) == 0; } @@ -691,8 +754,8 @@ BMessage::IsSourceRemote() const { DEBUG_FUNCTION_ENTER; - return (fHeader->flags & MESSAGE_FLAG_WAS_DELIVERED) - && (fHeader->reply_team != BPrivate::current_team()); + return (fHeader->flags & MESSAGE_FLAG_WAS_DELIVERED) != 0 + && fHeader->reply_team != BPrivate::current_team(); } @@ -700,7 +763,7 @@ BMessage::ReturnAddress() const { DEBUG_FUNCTION_ENTER; - if (fHeader->flags & MESSAGE_FLAG_WAS_DELIVERED) { + if ((fHeader->flags & MESSAGE_FLAG_WAS_DELIVERED) != 0) { BMessenger messenger; BMessenger::Private(messenger).SetTo(fHeader->reply_team, fHeader->reply_port, fHeader->reply_target); @@ -716,7 +779,7 @@ { DEBUG_FUNCTION_ENTER; /* ToDo: test if the "_previous_" field is used in R5 */ - if (!fOriginal) { + if (fOriginal == NULL) { fOriginal = new BMessage(); if (FindMessage("_previous_", fOriginal) != B_OK) { @@ -733,7 +796,7 @@ BMessage::WasDropped() const { DEBUG_FUNCTION_ENTER; - return fHeader->flags & MESSAGE_FLAG_WAS_DROPPED; + return (fHeader->flags & MESSAGE_FLAG_WAS_DROPPED) != 0; } @@ -775,8 +838,8 @@ messengerPrivate.SetTo(fHeader->reply_team, fHeader->reply_port, fHeader->reply_target); - if (fHeader->flags & MESSAGE_FLAG_REPLY_REQUIRED) { - if (fHeader->flags & MESSAGE_FLAG_REPLY_DONE) + if ((fHeader->flags & MESSAGE_FLAG_REPLY_REQUIRED) != 0) { + if ((fHeader->flags & MESSAGE_FLAG_REPLY_DONE) != 0) return B_DUPLICATE_REPLY; fHeader->flags |= MESSAGE_FLAG_REPLY_DONE; @@ -795,7 +858,7 @@ } // no reply required - if (!(fHeader->flags & MESSAGE_FLAG_WAS_DELIVERED)) + if ((fHeader->flags & MESSAGE_FLAG_WAS_DELIVERED) == 0) return B_BAD_REPLY; reply->AddMessage("_previous_", this); @@ -826,8 +889,8 @@ messengerPrivate.SetTo(fHeader->reply_team, fHeader->reply_port, fHeader->reply_target); - if (fHeader->flags & MESSAGE_FLAG_REPLY_REQUIRED) { - if (fHeader->flags & MESSAGE_FLAG_REPLY_DONE) + if ((fHeader->flags & MESSAGE_FLAG_REPLY_REQUIRED) != 0) { + if ((fHeader->flags & MESSAGE_FLAG_REPLY_DONE) != 0) return B_DUPLICATE_REPLY; fHeader->flags |= MESSAGE_FLAG_REPLY_DONE; @@ -847,7 +910,7 @@ } // no reply required - if (!(fHeader->flags & MESSAGE_FLAG_WAS_DELIVERED)) + if ((fHeader->flags & MESSAGE_FLAG_WAS_DELIVERED) == 0) return B_BAD_REPLY; reply->AddMessage("_previous_", this); @@ -864,7 +927,8 @@ BMessage::FlattenedSize() const { DEBUG_FUNCTION_ENTER; - return BPrivate::MessageAdapter::FlattenedSize(MESSAGE_FORMAT_R5, this); + return sizeof(message_header) + fHeader->field_count * sizeof(field_header) + + fHeader->data_size; } @@ -872,36 +936,10 @@ BMessage::Flatten(char *buffer, ssize_t size) const { DEBUG_FUNCTION_ENTER; - return BPrivate::MessageAdapter::Flatten(MESSAGE_FORMAT_R5, this, buffer, - &size); -} - - -status_t -BMessage::Flatten(BDataIO *stream, ssize_t *size) const -{ - DEBUG_FUNCTION_ENTER; - return BPrivate::MessageAdapter::Flatten(MESSAGE_FORMAT_R5, this, stream, - size); -} - - -ssize_t -BMessage::_NativeFlattenedSize() const -{ - DEBUG_FUNCTION_ENTER; - return sizeof(message_header) + fHeader->fields_size + fHeader->data_size; -} - - -status_t -BMessage::_NativeFlatten(char *buffer, ssize_t size) const -{ - DEBUG_FUNCTION_ENTER; - if (!buffer) + if (buffer == NULL || size < 0) return B_BAD_VALUE; - if (!fHeader) + if (fHeader == NULL) return B_NO_INIT; /* we have to sync the what code as it is a public member */ @@ -911,26 +949,27 @@ buffer += sizeof(message_header); size -= sizeof(message_header); - memcpy(buffer, fFields, min_c(fHeader->fields_size, size)); - buffer += fHeader->fields_size; - size -= fHeader->fields_size; + size_t fieldsSize = fHeader->field_count * sizeof(field_header); + memcpy(buffer, fFields, min_c(fieldsSize, (size_t)size)); + buffer += fieldsSize; + size -= fieldsSize; - memcpy(buffer, fData, min_c(fHeader->data_size, size)); - if (size >= fHeader->data_size) - return B_OK; + memcpy(buffer, fData, min_c(fHeader->data_size, (size_t)size)); + if ((size_t)size < fHeader->data_size) + return B_BUFFER_OVERFLOW; - return B_NO_MEMORY; + return B_OK; } status_t -BMessage::_NativeFlatten(BDataIO *stream, ssize_t *size) const +BMessage::Flatten(BDataIO *stream, ssize_t *size) const { DEBUG_FUNCTION_ENTER; - if (!stream) + if (stream == NULL) return B_BAD_VALUE; - if (!fHeader) + if (fHeader == NULL) return B_NO_INIT; /* we have to sync the what code as it is a public member */ @@ -941,16 +980,17 @@ return (result1 >= 0 ? B_ERROR : result1); ssize_t result2 = 0; - if (fHeader->fields_size > 0) { - result2 = stream->Write(fFields, fHeader->fields_size); - if (result2 != fHeader->fields_size) + if (fHeader->field_count > 0) { + ssize_t fieldsSize = fHeader->field_count * sizeof(field_header); + result2 = stream->Write(fFields, fieldsSize); + if (result2 != fieldsSize) return (result2 >= 0 ? B_ERROR : result2); } ssize_t result3 = 0; if (fHeader->data_size > 0) { result3 = stream->Write(fData, fHeader->data_size); - if (result3 != fHeader->data_size) + if (result3 != (ssize_t)fHeader->data_size) return (result3 >= 0 ? B_ERROR : result3); } @@ -1001,54 +1041,41 @@ memcpy(header, fHeader, sizeof(message_header)); header->what = what; - header->fields_available = 0; - header->data_available = 0; - header->flags |= MESSAGE_FLAG_PASS_BY_AREA; + header->message_area = -1; *_header = header; - if (header->message_area >= 0) + if (header->field_count == 0 && header->data_size == 0) return B_OK; - if (header->fields_size == 0 && header->data_size == 0) - return B_OK; - - uint8 *address = NULL; - ssize_t size = header->fields_size + header->data_size; + char *address = NULL; + size_t fieldsSize = header->field_count * sizeof(field_header); + size_t size = fieldsSize + header->data_size; size = (size + B_PAGE_SIZE) & ~(B_PAGE_SIZE - 1); area_id area = create_area("BMessage data", (void **)&address, B_ANY_ADDRESS, size, B_NO_LOCK, B_READ_AREA | B_WRITE_AREA); - if (area < B_OK) { + if (area < 0) { free(header); *_header = NULL; return area; } - if (header->fields_size > 0) { - memcpy(address, fFields, header->fields_size); - header->fields_checksum = BPrivate::CalculateChecksum((uint8 *)address, header->fields_size); - address += header->fields_size; - } - - if (header->data_size > 0) { - memcpy(address, fData, header->data_size); - header->data_checksum = BPrivate::CalculateChecksum((uint8 *)address, header->data_size); - } - + memcpy(address, fFields, fieldsSize); + memcpy(address + fieldsSize, fData, fHeader->data_size); + header->flags |= MESSAGE_FLAG_PASS_BY_AREA; header->message_area = area; return B_OK; } status_t -BMessage::_Reference(message_header *header) +BMessage::_Reference() { DEBUG_FUNCTION_ENTER; - fHeader = header; fHeader->flags &= ~MESSAGE_FLAG_PASS_BY_AREA; /* if there is no data at all we don't need the area */ - if (fHeader->fields_size == 0 && header->data_size == 0) + if (fHeader->field_count == 0 && fHeader->data_size == 0) return B_OK; area_info areaInfo; @@ -1075,18 +1102,7 @@ address = (uint8 *)areaInfo.address; fFields = (field_header *)address; - address += fHeader->fields_size; - fData = address; - - // ToDo: once we fully trust this mechanism we might want to remove this - if (fHeader->fields_checksum != BPrivate::CalculateChecksum((uint8 *)fFields, fHeader->fields_size) - || fHeader->data_checksum != BPrivate::CalculateChecksum((uint8 *)fData, fHeader->data_size)) { - debug_printf("BMessage: checksum mismatch in message passed by area!\n"); - _Clear(); - _InitHeader(); - return B_BAD_VALUE; - } - + fData = address + fHeader->field_count * sizeof(field_header); return B_OK; } @@ -1111,12 +1127,13 @@ field_header *newFields = NULL; uint8 *newData = NULL; - if (fHeader->fields_size > 0) { - newFields = (field_header *)malloc(fHeader->fields_size); + if (fHeader->field_count > 0) { + size_t fieldsSize = fHeader->field_count * sizeof(field_header); + newFields = (field_header *)malloc(fieldsSize); if (newFields == NULL) return B_NO_MEMORY; - memcpy(newFields, fFields, fHeader->fields_size); + memcpy(newFields, fFields, fieldsSize); } if (fHeader->data_size > 0) { @@ -1131,8 +1148,8 @@ _Dereference(); - fHeader->fields_available = 0; - fHeader->data_available = 0; + fFieldsAvailable = 0; + fDataAvailable = 0; fFields = newFields; fData = newData; @@ -1141,10 +1158,35 @@ status_t +BMessage::_ValidateMessage() +{ + if (fHeader->field_count == 0) + return B_OK; + + if (fFields == NULL) + return B_NO_INIT; + + for (uint32 i = 0; i < fHeader->field_count; i++) { + field_header *field = &fFields[i]; + if ((field->next_field >= 0 + && (uint32)field->next_field > fHeader->field_count) + || (field->offset + field->name_length + field->data_size + > fHeader->data_size)) { + // the message is corrupt + MakeEmpty(); + return B_BAD_VALUE; + } + } + + return B_OK; +} + + +status_t BMessage::Unflatten(const char *flatBuffer) { DEBUG_FUNCTION_ENTER; - if (!flatBuffer) + if (flatBuffer == NULL) return B_BAD_VALUE; uint32 format = *(uint32 *)flatBuffer; @@ -1156,45 +1198,46 @@ _Clear(); fHeader = (message_header *)malloc(sizeof(message_header)); - if (!fHeader) + if (fHeader == NULL) return B_NO_MEMORY; memcpy(fHeader, flatBuffer, sizeof(message_header)); flatBuffer += sizeof(message_header); if (fHeader->format != MESSAGE_FORMAT_HAIKU - || !(fHeader->flags & MESSAGE_FLAG_VALID)) { - free(fHeader); - fHeader = NULL; + || (fHeader->flags & MESSAGE_FLAG_VALID) == 0) { _InitHeader(); return B_BAD_VALUE; } - fHeader->fields_available = 0; - fHeader->data_available = 0; what = fHeader->what; - if (fHeader->flags & MESSAGE_FLAG_PASS_BY_AREA) { - status_t result = _Reference(fHeader); - if (result < B_OK) + if ((fHeader->flags & MESSAGE_FLAG_PASS_BY_AREA) != 0 + && fHeader->message_area >= 0) { + status_t result = _Reference(); + if (result != B_OK) return result; } else { [... truncated: 797 lines follow ...] From axeld at mail.berlios.de Sat Aug 1 00:22:29 2009 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Sat, 1 Aug 2009 00:22:29 +0200 Subject: [Haiku-commits] r32040 - in haiku/trunk/src: preferences/screen servers/app/drawing Message-ID: <200907312222.n6VMMT25019533@sheep.berlios.de> Author: axeld Date: 2009-08-01 00:22:28 +0200 (Sat, 01 Aug 2009) New Revision: 32040 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32040&view=rev Modified: haiku/trunk/src/preferences/screen/ScreenMode.cpp haiku/trunk/src/servers/app/drawing/AccelerantHWInterface.cpp Log: * Added Eizo, thanks Jonas. * Added comment to monitor_info::name retrieval via EDID1_MONITOR_NAME. Modified: haiku/trunk/src/preferences/screen/ScreenMode.cpp =================================================================== --- haiku/trunk/src/preferences/screen/ScreenMode.cpp 2009-07-31 22:19:36 UTC (rev 32039) +++ haiku/trunk/src/preferences/screen/ScreenMode.cpp 2009-07-31 22:22:28 UTC (rev 32040) @@ -358,6 +358,9 @@ case 'EMA\0': strcpy(info.vendor, "eMachines"); break; + case 'ENC\0': + strcpy(info.vendor, "Eizo"); + break; case 'FUS\0': strcpy(info.vendor, "Fujitsu-Siemens"); break; Modified: haiku/trunk/src/servers/app/drawing/AccelerantHWInterface.cpp =================================================================== --- haiku/trunk/src/servers/app/drawing/AccelerantHWInterface.cpp 2009-07-31 22:19:36 UTC (rev 32039) +++ haiku/trunk/src/servers/app/drawing/AccelerantHWInterface.cpp 2009-07-31 22:22:28 UTC (rev 32040) @@ -944,6 +944,8 @@ break; case EDID1_MONITOR_NAME: + // There can be several of these; in this case we'll just + // overwrite the previous entries strlcpy(info->name, monitor->data.monitor_name, sizeof(info->name)); break; From mattmadia at gmail.com Sat Aug 1 00:49:54 2009 From: mattmadia at gmail.com (Matt Madia) Date: Fri, 31 Jul 2009 22:49:54 +0000 Subject: [Haiku-commits] r32039 - in haiku/trunk: headers/os/app headers/private/app src/kits/app src/kits/interface src/servers/registrar In-Reply-To: <200907312219.n6VMJeRv019233@sheep.berlios.de> References: <200907312219.n6VMJeRv019233@sheep.berlios.de> Message-ID: <1e42d8c50907311549y387b1913v22bff52d3ca43827@mail.gmail.com> On Fri, Jul 31, 2009 at 22:19, wrote: > > Modified: > haiku/trunk/headers/os/app/Message.h > haiku/trunk/headers/private/app/MessagePrivate.h > haiku/trunk/src/kits/app/Message.cpp > haiku/trunk/src/kits/app/MessageAdapter.cpp > haiku/trunk/src/kits/app/MessageUtils.cpp > haiku/trunk/src/kits/interface/View.cpp > haiku/trunk/src/servers/registrar/MessageDeliverer.cpp At least PPC is broken with this: not sure about x86gcc4 though x86gcc2 is ok. C++ /haiku-src/haiku/haiku/generated.ppc/objects/haiku/ppc/release/kits/app/Message.o /haiku-src/haiku/haiku/src/kits/app/Message.cpp:648:13: error: missing terminating " character /haiku-src/haiku/haiku/src/kits/app/Message.cpp:648: error: missing terminating " character /haiku-src/haiku/haiku/src/kits/app/Message.cpp:649: error: stray '\' in program /haiku-src/haiku/haiku/src/kits/app/Message.cpp: In member function 'void BMessage::_PrintToStream(const char*) const': /haiku-src/haiku/haiku/src/kits/app/Message.cpp:649: error: 'name' was not declared in this scope /haiku-src/haiku/haiku/generated.ppc/cross-tools/bin/powerpc-apple-haiku-gcc -c "/haiku-src/haiku/haiku/src/kits/app/Message.cpp" -O -Wall -Wno-trigraphs -Wno-ctor-dtor-privacy -Woverloaded-virtual -Wpointer-arith -Wcast-align -Wsign-compare -Wno-multichar -pipe -fno-strict-aliasing -fno-tree-vrp -nostdinc -Wno-deprecated -D_ZETA_USING_DEPRECATED_API_=1 -D_ZETA_TS_FIND_DIR_=1 -Werror -Wno-error=uninitialized -D__HAIKU__ -DHAIKU_DISTRO_COMPATIBILITY_DEFAULT -D__POWERPC__ -DARCH_ppc -DBOOT_ARCHIVE_IMAGE_OFFSET=192 -DHAIKU_TARGET_PLATFORM_HAIKU -iquote /haiku-src/haiku/haiku/build/user_config_headers -iquote /haiku-src/haiku/haiku/build/config_headers -iquote /haiku-src/haiku/haiku/src/kits/app -iquote /haiku-src/haiku/haiku/generated.ppc/objects/common/kits/app -iquote /haiku-src/haiku/haiku/generated.ppc/objects/freebsd/x86/common/kits/app -iquote /haiku-src/haiku/haiku/generated.ppc/objects/haiku/ppc/common/kits/app -I /haiku-src/haiku/haiku/headers/private/shared -I /haiku-src/haiku/haiku/headers/private/app -I /haiku-src/haiku/haiku/headers/private/interface -I /haiku-src/haiku/haiku/headers/private/kernel -I /haiku-src/haiku/haiku/headers/private/. -I /haiku-src/haiku/haiku/headers/private/system -I /haiku-src/haiku/haiku/headers/private/system/arch/ppc -I /haiku-src/haiku/haiku/generated.ppc/cross-tools/lib/gcc/powerpc-apple-haiku/4.3.3/../../../../powerpc-apple-haiku/include/c++/4.3.3 -I /haiku-src/haiku/haiku/generated.ppc/cross-tools/lib/gcc/powerpc-apple-haiku/4.3.3/../../../../powerpc-apple-haiku/include/c++/4.3.3/powerpc-apple-haiku -I /haiku-src/haiku/haiku/generated.ppc/cross-tools/lib/gcc/powerpc-apple-haiku/4.3.3/../../../../powerpc-apple-haiku/include/c++/4.3.3/backward -I /haiku-src/haiku/haiku/generated.ppc/cross-tools/lib/gcc/powerpc-apple-haiku/4.3.3/../../../../powerpc-apple-haiku/include/c++/4.3.3/ext -I /haiku-src/haiku/haiku/generated.ppc/cross-tools/lib/gcc/powerpc-apple-haiku/4.3.3/include -I /haiku-src/haiku/haiku/generated.ppc/cross-tools/lib/gcc/powerpc-apple-haiku/4.3.3/include-fixed -I /haiku-src/haiku/haiku/headers -I /haiku-src/haiku/haiku/headers/posix -I /haiku-src/haiku/haiku/headers/gnu -I /haiku-src/haiku/haiku/headers/glibc -I /haiku-src/haiku/haiku/headers/os -I /haiku-src/haiku/haiku/headers/os/add-ons -I /haiku-src/haiku/haiku/headers/os/add-ons/file_system -I /haiku-src/haiku/haiku/headers/os/add-ons/graphics -I /haiku-src/haiku/haiku/headers/os/add-ons/input_server -I /haiku-src/haiku/haiku/headers/os/add-ons/registrar -I /haiku-src/haiku/haiku/headers/os/add-ons/screen_saver -I /haiku-src/haiku/haiku/headers/os/add-ons/tracker -I /haiku-src/haiku/haiku/headers/os/app -I /haiku-src/haiku/haiku/headers/os/device -I /haiku-src/haiku/haiku/headers/os/drivers -I /haiku-src/haiku/haiku/headers/os/game -I /haiku-src/haiku/haiku/headers/os/interface -I /haiku-src/haiku/haiku/headers/os/kernel -I /haiku-src/haiku/haiku/headers/os/media -I /haiku-src/haiku/haiku/headers/os/mail -I /haiku-src/haiku/haiku/headers/os/midi -I /haiku-src/haiku/haiku/headers/os/midi2 -I /haiku-src/haiku/haiku/headers/os/net -I /haiku-src/haiku/haiku/headers/os/opengl -I /haiku-src/haiku/haiku/headers/os/storage -I /haiku-src/haiku/haiku/headers/os/support -I /haiku-src/haiku/haiku/headers/os/translation -I /haiku-src/haiku/haiku/headers/private/. -o "/haiku-src/haiku/haiku/generated.ppc/objects/haiku/ppc/release/kits/app/Message.o" ; ...failed C++ /haiku-src/haiku/haiku/generated.ppc/objects/haiku/ppc/release/kits/app/Message.o ... ...skipped app_kit.o for lack of Message.o... From axeld at pinc-software.de Sat Aug 1 01:19:53 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Sat, 01 Aug 2009 01:19:53 +0200 CEST Subject: [Haiku-commits] r32036 - haiku/trunk/src/preferences/screen In-Reply-To: <1e80d8750907311507g1dcac336sb400192726adcf59@mail.gmail.com> Message-ID: <50200107713-BeMail@zon> Urias McCullough wrote: > You missed this one I think: http://dev.haiku-os.org/ticket/1732 > > HWP = "Hewlett Packard" > > and this perhaps: http://dev.haiku-os.org/ticket/1667 which probably > should be: > > MED = "Medion" I might have missed even more, since I only searched for "syslog", and got tired after a few pages, not for "edid vendor"; unfortunately, Trac doesn't search text attachments :-) > (this one is actually a guess, since that's the only LCD display > vendor I could find that matched: http://en.wikipedia.org/wiki/Medion > ) A good guess actually. I usually searched for the model name which then got me the vendor name, although only LG was a bit surprising. Bye, Axel. From axeld at mail.berlios.de Sat Aug 1 01:25:23 2009 From: axeld at mail.berlios.de (axeld at mail.berlios.de) Date: Sat, 1 Aug 2009 01:25:23 +0200 Subject: [Haiku-commits] r32041 - haiku/trunk/src/preferences/screen Message-ID: <200907312325.n6VNPNox019197@sheep.berlios.de> Author: axeld Date: 2009-08-01 01:25:21 +0200 (Sat, 01 Aug 2009) New Revision: 32041 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32041&view=rev Modified: haiku/trunk/src/preferences/screen/ScreenMode.cpp Log: * Added two more vendors found by Urias, thanks! If anyone has a SONY (SNY?), Dell, or Acer monitor, those are still missing as well. Modified: haiku/trunk/src/preferences/screen/ScreenMode.cpp =================================================================== --- haiku/trunk/src/preferences/screen/ScreenMode.cpp 2009-07-31 22:22:28 UTC (rev 32040) +++ haiku/trunk/src/preferences/screen/ScreenMode.cpp 2009-07-31 23:25:21 UTC (rev 32041) @@ -367,9 +367,15 @@ case 'GSM\0': strcpy(info.vendor, "LG"); break; + case 'HWP\0': + strcpy(info.vendor, "Hewlett Packard"); + break; case 'LEN\0': strcpy(info.vendor, "Lenovo"); break; + case 'MED\0': + strcpy(info.vendor, "Medion"); + break; case 'PHL\0': strcpy(info.vendor, "Philips"); break; From umccullough at gmail.com Sat Aug 1 01:40:07 2009 From: umccullough at gmail.com (Urias McCullough) Date: Fri, 31 Jul 2009 16:40:07 -0700 Subject: [Haiku-commits] r32041 - haiku/trunk/src/preferences/screen In-Reply-To: <200907312325.n6VNPNox019197@sheep.berlios.de> References: <200907312325.n6VNPNox019197@sheep.berlios.de> Message-ID: <1e80d8750907311640k423305e9qcdce79a77e637cbb@mail.gmail.com> On Fri, Jul 31, 2009 at 4:25 PM, wrote: > Author: axeld > Date: 2009-08-01 01:25:21 +0200 (Sat, 01 Aug 2009) > New Revision: 32041 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32041&view=rev > > Modified: > ? haiku/trunk/src/preferences/screen/ScreenMode.cpp > Log: > * Added two more vendors found by Urias, thanks! If anyone has a SONY (SNY?), > ?Dell, or Acer monitor, those are still missing as well. I have a Dell 24" here at work, but I don't have a Haiku install handy to check with (will try to get one monday). I don't suppose there are Windows XP programs that pull EDID info? I'll see if I can find one. From umccullough at gmail.com Sat Aug 1 02:01:15 2009 From: umccullough at gmail.com (Urias McCullough) Date: Fri, 31 Jul 2009 17:01:15 -0700 Subject: [Haiku-commits] r32041 - haiku/trunk/src/preferences/screen In-Reply-To: <1e80d8750907311640k423305e9qcdce79a77e637cbb@mail.gmail.com> References: <200907312325.n6VNPNox019197@sheep.berlios.de> <1e80d8750907311640k423305e9qcdce79a77e637cbb@mail.gmail.com> Message-ID: <1e80d8750907311701i6053327bpf2161d4a694f9dd7@mail.gmail.com> On Fri, Jul 31, 2009 at 4:40 PM, Urias McCullough wrote: > On Fri, Jul 31, 2009 at 4:25 PM, wrote: >> Author: axeld >> Date: 2009-08-01 01:25:21 +0200 (Sat, 01 Aug 2009) >> New Revision: 32041 >> ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32041&view=rev >> >> Modified: >> ? haiku/trunk/src/preferences/screen/ScreenMode.cpp >> Log: >> * Added two more vendors found by Urias, thanks! If anyone has a SONY (SNY?), >> ?Dell, or Acer monitor, those are still missing as well. > > I have a Dell 24" here at work, but I don't have a Haiku install handy > to check with (will try to get one monday). > > I don't suppose there are Windows XP programs that pull EDID info? > I'll see if I can find one. I found this: http://www.eldim.fr/products/display-controller/fpdlite/fpdlite-free-tools and it produces this output: EDID ( Extended Display Identification Data) Report Vendor/Product Identification: Monitor Name : DELL 2408WFP Monitor Serial Number : JU4368661CNS Manufacturer Name : Dell Computer Corp. Product Id : A029 Serial Number : 826494547 Week Of Manufacture : 23 Year Of Manufacture : 2008 EDIDVersion : V1.3 Number Of Extension Flag : 0 Display parameters: Video Input Definition : Analog Signal Analog Signal Properties : Composite Sync - Sync on Green - Separate Sync - 0.700V/0.300V (1.000 Vp-p) Max Horizontal Image Size : 520 mm Max Vertical Image Size : 320 mm Max Display Size : 24 Inches Power Management and Features: Standby : Supported Suspend : Supported ActiveOff : Supported Video Input : 1 sRGB Default ColorSpace : False Default GTF : Not Supported Prefered Timing Mode : True Gamma/Color and Etablished Timings: Display Gamma : 2.2 Red : x = 0.674 - y = 0.319 Green : x = 0.187 - y = 0.706 Blue : x = 0.148 - y = 0.064 White : x = 0.313 - y = 0.329 Etablished Timings : 800 x 600 @ 60Hz (VESA) 640 x 480 @ 75Hz (VESA) 640 x 480 @ 60Hz (IBM, VGA) 720 x 400 @ 70Hz (IBM, VGA) 1280 x 1024 @ 75Hz (VESA) 1024 x 768 @ 75Hz (VESA) 1024 x 768 @ 60Hz (VESA) 800 x 600 @ 75Hz (VESA) Display Type : RGB Color Display Standard Timing: Standard Timings n? 1 X Resolution : 1280 Y Resolution : 1024 Vertical Frequency : 60 Standard Timings n? 2 X Resolution : 1600 Y Resolution : 1200 Vertical Frequency : 60 Standard Timings n? 3 X Resolution : 1152 Y Resolution : 864 Vertical Frequency : 75 Preferred Detailed Timing: Pixel Clock : 154 Mhz Horizontal Active : 1920 pixels Horizontal Blanking : 160 pixels Horizontal Sync Offset : 48 pixels Horizontal Sync Pulse Width : 32 pixels Horizontal Border : 0 pixels Horizontal Size : 519 mm Vertical Active : 1200 lines Vertical Blanking : 35 lines Vertical Sync Offset : 3 lines Vertical Sync Pulse Width : 6 lines Vertical Border : 0 lines Vertical Size : 324 mm Input Type : Digital Separate Interlaced : False VerticalPolarity : False HorizontalPolarity : True Monitor Range Limit: Maximum Vertical Frequency : 76 Hz Minimum Vertical Frequency : 56 Hz Maximum Horizontal Frequency : 83 KHz Minimum Horizontal Frequency : 30 KHz Maximum Pixel Clock : 170 MHz Stereo Display: Stereo Display : Normal display (no stereo) RAW Data: 0x00 00 FF FF FF FF FF FF 00 10 AC 29 A0 53 4E 43 31 .??????..?)?SNC1 0x10 17 12 01 03 0E 34 20 78 EA B3 25 AC 51 30 B4 26 .....4 x??%?Q0?& 0x20 10 50 54 A5 4B 00 81 80 A9 40 71 4F 01 01 01 01 .PT?K.???@qO.... 0x30 01 01 01 01 01 01 28 3C 80 A0 70 B0 23 40 30 20 ......( Author: anevilyak Date: 2009-08-01 02:04:05 +0200 (Sat, 01 Aug 2009) New Revision: 32042 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32042&view=rev Modified: haiku/trunk/src/kits/app/Message.cpp haiku/trunk/src/kits/app/MessageAdapter.cpp Log: gcc4 build fix. Modified: haiku/trunk/src/kits/app/Message.cpp =================================================================== --- haiku/trunk/src/kits/app/Message.cpp 2009-07-31 23:25:21 UTC (rev 32041) +++ haiku/trunk/src/kits/app/Message.cpp 2009-08-01 00:04:05 UTC (rev 32042) @@ -645,8 +645,8 @@ entry_ref ref; BPrivate::entry_ref_unflatten(&ref, (char *)pointer, size); - printf("entry_ref(device=%ld, directory=%lld, - name=\"%s\", ", ref.device, ref.directory, ref.name); + printf("entry_ref(device=%ld, directory=%lld," + "name=\"%s\", ", ref.device, ref.directory, ref.name); BPath path(&ref); printf("path=\"%s\")\n", path.Path()); Modified: haiku/trunk/src/kits/app/MessageAdapter.cpp =================================================================== --- haiku/trunk/src/kits/app/MessageAdapter.cpp 2009-07-31 23:25:21 UTC (rev 32041) +++ haiku/trunk/src/kits/app/MessageAdapter.cpp 2009-08-01 00:04:05 UTC (rev 32042) @@ -519,13 +519,13 @@ header->what = into->what = r5header.what; if (r5header.flags & R5_MESSAGE_FLAG_INCLUDE_TARGET) - reader(header->target); + reader(header->target, sizeof(header->target)); if (r5header.flags & R5_MESSAGE_FLAG_INCLUDE_REPLY) { // reply info - reader(header->reply_port); - reader(header->reply_target); - reader(header->reply_team); + reader(header->reply_port, sizeof(header->reply_port)); + reader(header->reply_target, sizeof(header->reply_target)); + reader(header->reply_team, sizeof(header->reply_team)); // big flags uint8 bigFlag; From jonas at kirilla.com Sat Aug 1 02:05:24 2009 From: jonas at kirilla.com (Jonas =?iso-8859-1?q?Sundstr=F6m?=) Date: Sat, 01 Aug 2009 02:05:24 +0200 CEST Subject: [Haiku-commits] r32041 - haiku/trunk/src/preferences/screen In-Reply-To: <200907312325.n6VNPNox019197@sheep.berlios.de> Message-ID: <461265595-BeMail@kirilla> axeld at mail.berlios.de wrote: ... > If anyone has a SONY (SNY?), > Dell, or Acer monitor, those are still missing as well. Confirmed: SNY = Sony Cheers, Jonas. From stippi at mail.berlios.de Sat Aug 1 03:16:17 2009 From: stippi at mail.berlios.de (stippi at mail.berlios.de) Date: Sat, 1 Aug 2009 03:16:17 +0200 Subject: [Haiku-commits] r32043 - in haiku/trunk: headers/private/media src/add-ons/media/plugins/ffmpeg src/add-ons/media/plugins/ffmpeg/libavformat src/add-ons/media/plugins/ffmpeg/libswscale src/kits/media Message-ID: <200908010116.n711GHjw023549@sheep.berlios.de> Author: stippi Date: 2009-08-01 03:16:12 +0200 (Sat, 01 Aug 2009) New Revision: 32043 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32043&view=rev Modified: haiku/trunk/headers/private/media/WriterPlugin.h haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.h haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatReader.cpp haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatWriter.cpp haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatWriter.h haiku/trunk/src/add-ons/media/plugins/ffmpeg/EncoderTable.cpp haiku/trunk/src/add-ons/media/plugins/ffmpeg/MuxerTable.cpp haiku/trunk/src/add-ons/media/plugins/ffmpeg/config.h haiku/trunk/src/add-ons/media/plugins/ffmpeg/libavformat/utils.c haiku/trunk/src/add-ons/media/plugins/ffmpeg/libswscale/swscale.h haiku/trunk/src/kits/media/MediaFile.cpp haiku/trunk/src/kits/media/MediaWriter.cpp Log: * Also pass the media_codec_info to the Writer::AllocateCookie(), since that info is not part of the media_format otherwise. * Finished enough in the AVFormatWriter and AVCodecEncoder that we can now actually create AVIs and MPGs and encode MPEG1, MPEG2 and MPEG4 video. But no audio as of yet. Also, there is no bit-rate/quality setup, so it seems libavformat is using the least possible bit-rate/quality. * Enable some more muxers and encoders in the FFmpeg libs. * Uses pixel format conversion from libswsscale, need to read the documentation again, but I think it makes the plugin GPL. * Fixed includes in libswscale/swscale.h, this is now an unmodified FFmpeg 0.5 header again (AFAICT). Modified: haiku/trunk/headers/private/media/WriterPlugin.h =================================================================== --- haiku/trunk/headers/private/media/WriterPlugin.h 2009-08-01 00:04:05 UTC (rev 32042) +++ haiku/trunk/headers/private/media/WriterPlugin.h 2009-08-01 01:16:12 UTC (rev 32043) @@ -21,7 +21,8 @@ virtual status_t Close() = 0; virtual status_t AllocateCookie(void** cookie, - const media_format* format) = 0; + const media_format* format, + const media_codec_info* codecInfo) = 0; virtual status_t FreeCookie(void* cookie) = 0; virtual status_t SetCopyright(void* cookie, Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp 2009-08-01 00:04:05 UTC (rev 32042) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp 2009-08-01 01:16:12 UTC (rev 32043) @@ -24,7 +24,7 @@ #endif -static const size_t kDefaultChunkBufferSize = FF_MIN_BUFFER_SIZE; +static const size_t kDefaultChunkBufferSize = 2 * 1024 * 1024; AVCodecEncoder::AVCodecEncoder(uint32 codecID) @@ -32,8 +32,8 @@ Encoder(), fCodec(NULL), fContext(avcodec_alloc_context()), - fInputPicture(avcodec_alloc_frame()), -// fOutputPicture(avcodec_alloc_frame()), + fFrame(avcodec_alloc_frame()), + fSwsContext(NULL), fCodecInitDone(false), fChunkBuffer(new(std::nothrow) uint8[kDefaultChunkBufferSize]) { @@ -53,8 +53,25 @@ if (fCodecInitDone) avcodec_close(fContext); -// free(fOutputPicture); - free(fInputPicture); + sws_freeContext(fSwsContext); + + avpicture_free(&fDstFrame); + // NOTE: Do not use avpicture_free() on fSrcFrame!! We fill the picture + // data on the file with the media buffer data passed to Encode(). + + if (fFrame != NULL) { + fFrame->data[0] = NULL; + fFrame->data[1] = NULL; + fFrame->data[2] = NULL; + fFrame->data[3] = NULL; + + fFrame->linesize[0] = 0; + fFrame->linesize[1] = 0; + fFrame->linesize[2] = 0; + fFrame->linesize[3] = 0; + free(fFrame); + } + free(fContext); delete[] fChunkBuffer; @@ -94,10 +111,15 @@ fInputFormat = *inputFormat; if (fInputFormat.type == B_MEDIA_RAW_VIDEO) { + // frame rate + fContext->time_base.den = (int)fInputFormat.u.raw_video.field_rate; + fContext->time_base.num = 1; + // video size fContext->width = fInputFormat.u.raw_video.display.line_width; fContext->height = fInputFormat.u.raw_video.display.line_count; // fContext->gop_size = 12; - fContext->pix_fmt = PIX_FMT_BGR32; + // TODO: Fix pixel format or setup conversion method... + fContext->pix_fmt = PIX_FMT_YUV420P; // fContext->rate_emu = 0; // TODO: Setup rate control: // fContext->rc_eq = NULL; @@ -111,11 +133,38 @@ || fContext->sample_aspect_ratio.den == 0) { av_reduce(&fContext->sample_aspect_ratio.num, &fContext->sample_aspect_ratio.den, fContext->width, - fContext->height, 256); + fContext->height, 255); } // TODO: This should already happen in AcceptFormat() - fInputFormat.u.raw_video.display.bytes_per_row = fContext->width * 4; + if (fInputFormat.u.raw_video.display.bytes_per_row == 0) { + fInputFormat.u.raw_video.display.bytes_per_row + = fContext->width * 4; + } + + fFrame->pts = 0; + + // Allocate space for colorspace converted AVPicture + // TODO: Check allocations... + avpicture_alloc(&fDstFrame, fContext->pix_fmt, fContext->width, + fContext->height); + + // Make the frame point to the data in the converted AVPicture + fFrame->data[0] = fDstFrame.data[0]; + fFrame->data[1] = fDstFrame.data[1]; + fFrame->data[2] = fDstFrame.data[2]; + fFrame->data[3] = fDstFrame.data[3]; + + fFrame->linesize[0] = fDstFrame.linesize[0]; + fFrame->linesize[1] = fDstFrame.linesize[1]; + fFrame->linesize[2] = fDstFrame.linesize[2]; + fFrame->linesize[3] = fDstFrame.linesize[3]; + + // TODO: Use actual pixel format from media_format! + fSwsContext = sws_getContext(fContext->width, fContext->height, + PIX_FMT_RGB32, fContext->width, fContext->height, + fContext->pix_fmt, SWS_BICUBIC, NULL, NULL, NULL); + } else { return B_NOT_SUPPORTED; } @@ -154,6 +203,9 @@ { TRACE("AVCodecEncoder::Encode(%p, %lld, %p)\n", buffer, frameCount, info); + if (!fCodecInitDone) + return B_NO_INIT; + if (fInputFormat.type == B_MEDIA_RAW_AUDIO) return _EncodeAudio(buffer, frameCount, info); else if (fInputFormat.type == B_MEDIA_RAW_VIDEO) @@ -192,12 +244,23 @@ while (frameCount > 0) { size_t bpr = fInputFormat.u.raw_video.display.bytes_per_row; size_t bufferSize = fInputFormat.u.raw_video.display.line_count * bpr; + TRACE(" bytes per row: %ld, buffer size: %ld\n", bpr, bufferSize); - fInputPicture->data[0] = (uint8_t*)buffer; - fInputPicture->linesize[0] = bpr; + // We should always get chunky bitmaps, so this code should be safe. + fSrcFrame.data[0] = (uint8_t*)buffer; + fSrcFrame.linesize[0] = bpr; + // Run the pixel format conversion + sws_scale(fSwsContext, fSrcFrame.data, fSrcFrame.linesize, 0, + fInputFormat.u.raw_video.display.line_count, fDstFrame.data, + fDstFrame.linesize); + + // TODO: Look into this... avcodec.h says we need to set it. + fFrame->pts++; + + // Encode one video chunk/frame. int usedBytes = avcodec_encode_video(fContext, fChunkBuffer, - kDefaultChunkBufferSize, fInputPicture); + kDefaultChunkBufferSize, fFrame); if (usedBytes < 0) { TRACE(" avcodec_encode_video() failed: %d\n", usedBytes); Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.h =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.h 2009-08-01 00:04:05 UTC (rev 32042) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.h 2009-08-01 01:16:12 UTC (rev 32043) @@ -10,6 +10,7 @@ extern "C" { #include "avcodec.h" + #include "swscale.h" } #include "EncoderPlugin.h" @@ -51,8 +52,10 @@ // TODO: Refactor common base class from AVCodec[De|En]Coder! AVCodec* fCodec; AVCodecContext* fContext; - AVFrame* fInputPicture; -// AVFrame* fOutputPicture; + AVPicture fSrcFrame; + AVPicture fDstFrame; + AVFrame* fFrame; + SwsContext* fSwsContext; uint32 fAVCodecID; Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatReader.cpp =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatReader.cpp 2009-08-01 00:04:05 UTC (rev 32042) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatReader.cpp 2009-08-01 01:16:12 UTC (rev 32043) @@ -26,7 +26,7 @@ #include "gfx_util.h" -#define TRACE_AVFORMAT_READER +//#define TRACE_AVFORMAT_READER #ifdef TRACE_AVFORMAT_READER # define TRACE printf # define TRACE_IO(a...) Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatWriter.cpp =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatWriter.cpp 2009-08-01 00:04:05 UTC (rev 32042) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatWriter.cpp 2009-08-01 01:16:12 UTC (rev 32043) @@ -58,7 +58,8 @@ BLocker* streamLock); virtual ~StreamCookie(); - status_t Init(const media_format* format); + status_t Init(const media_format* format, + const media_codec_info* codecInfo); status_t WriteChunk(const void* chunkBuffer, size_t chunkSize, @@ -70,7 +71,8 @@ private: AVFormatContext* fContext; AVStream* fStream; - // Since different threads may read from the source, + AVPacket fPacket; + // Since different threads may write to the target, // we need to protect the file position and I/O by a lock. BLocker* fStreamLock; }; @@ -84,30 +86,65 @@ fStream(NULL), fStreamLock(streamLock) { + av_new_packet(&fPacket, 0); } AVFormatWriter::StreamCookie::~StreamCookie() { + av_free_packet(&fPacket); } status_t -AVFormatWriter::StreamCookie::Init(const media_format* format) +AVFormatWriter::StreamCookie::Init(const media_format* format, + const media_codec_info* codecInfo) { TRACE("AVFormatWriter::StreamCookie::Init()\n"); BAutolock _(fStreamLock); - fStream = av_new_stream(fContext, fContext->nb_streams); + fPacket.stream_index = fContext->nb_streams; + fStream = av_new_stream(fContext, fPacket.stream_index); if (fStream == NULL) { TRACE(" failed to add new stream\n"); return B_ERROR; } - // TODO: Setup the stream according to the media format... + // Setup the stream according to the media format... + if (format->type == B_MEDIA_RAW_VIDEO) { + avcodec_get_context_defaults2(fStream->codec, CODEC_TYPE_VIDEO); + // frame rate + fStream->codec->time_base.den = (int)format->u.raw_video.field_rate; + fStream->codec->time_base.num = 1; + // video size + fStream->codec->width = format->u.raw_video.display.line_width; + fStream->codec->height = format->u.raw_video.display.line_count; + // pixel aspect ratio + fStream->sample_aspect_ratio.num + = format->u.raw_video.pixel_width_aspect; + fStream->sample_aspect_ratio.den + = format->u.raw_video.pixel_height_aspect; + if (fStream->sample_aspect_ratio.num == 0 + || fStream->sample_aspect_ratio.den == 0) { + av_reduce(&fStream->sample_aspect_ratio.num, + &fStream->sample_aspect_ratio.den, fStream->codec->width, + fStream->codec->height, 255); + } + fStream->codec->sample_aspect_ratio = fStream->sample_aspect_ratio; + // TODO: Don't hard code this... + fStream->codec->pix_fmt = PIX_FMT_YUV420P; + } else if (format->type == B_MEDIA_RAW_AUDIO) { + avcodec_get_context_defaults2(fStream->codec, CODEC_TYPE_AUDIO); + // TODO: ... + } + + // TODO: This is a hack for now! Use avcodec_find_encoder_by_name() + // or something similar... + fStream->codec->codec_id = (CodecID)codecInfo->sub_id; + return B_OK; } @@ -116,12 +153,33 @@ AVFormatWriter::StreamCookie::WriteChunk(const void* chunkBuffer, size_t chunkSize, media_encode_info* encodeInfo) { - TRACE("AVFormatWriter::StreamCookie::WriteChunk(%p, %ld)\n", + TRACE_PACKET("AVFormatWriter::StreamCookie::WriteChunk(%p, %ld)\n", chunkBuffer, chunkSize); BAutolock _(fStreamLock); - return B_ERROR; + // TODO: Probably the AVCodecEncoder needs to pass packet data + // in encodeInfo... + + fPacket.data = const_cast((const uint8_t*)chunkBuffer); + fPacket.size = chunkSize; + +#if 0 + // TODO: Eventually, we need to write interleaved packets, but + // maybe we are only supposed to use this if we have actually + // more than one stream. For the moment, this crashes in AVPacket + // shuffling inside libavformat. Maybe if we want to use this, we + // need to allocate a separate AVPacket and copy the chunk buffer. + int result = av_interleaved_write_frame(fContext, &fPacket); + if (result < 0) + TRACE(" av_interleaved_write_frame(): %d\n", result); +#else + int result = av_write_frame(fContext, &fPacket); + if (result < 0) + TRACE(" av_write_frame(): %d\n", result); +#endif + + return result == 0 ? B_OK : B_ERROR; } @@ -183,12 +241,10 @@ return B_ERROR; } - // TODO: Is this how it works? - // TODO: Is the cookie stored in ByteIOContext? Or does it need to be - // stored in fContext->priv_data? + // Setup I/O hooks. This seems to be enough. fContext->pb = &fIOContext; - // TODO: Set the AVOutputFormat according to fileFormat... + // Set the AVOutputFormat according to fileFormat... fContext->oformat = guess_format(fileFormat->short_name, fileFormat->file_extension, fileFormat->mime_type); if (fContext->oformat == NULL) { @@ -263,7 +319,8 @@ status_t -AVFormatWriter::AllocateCookie(void** _cookie, const media_format* format) +AVFormatWriter::AllocateCookie(void** _cookie, const media_format* format, + const media_codec_info* codecInfo) { TRACE("AVFormatWriter::AllocateCookie()\n"); @@ -275,7 +332,14 @@ StreamCookie* cookie = new(std::nothrow) StreamCookie(fContext, &fStreamLock); - return cookie->Init(format); + status_t ret = cookie->Init(format, codecInfo); + if (ret != B_OK) { + delete cookie; + return ret; + } + + *_cookie = cookie; + return B_OK; } @@ -327,7 +391,7 @@ } -// #pragma mark - +// #pragma mark - I/O hooks /*static*/ int Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatWriter.h =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatWriter.h 2009-08-01 00:04:05 UTC (rev 32042) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatWriter.h 2009-08-01 01:16:12 UTC (rev 32043) @@ -28,7 +28,8 @@ virtual status_t Close(); virtual status_t AllocateCookie(void** cookie, - const media_format* format); + const media_format* format, + const media_codec_info* codecInfo); virtual status_t FreeCookie(void* cookie); virtual status_t SetCopyright(void* cookie, Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/EncoderTable.cpp =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/EncoderTable.cpp 2009-08-01 00:04:05 UTC (rev 32042) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/EncoderTable.cpp 2009-08-01 01:16:12 UTC (rev 32043) @@ -20,22 +20,46 @@ CODEC_ID_MPEG4, { 0 } }, - B_ANY_FORMAT_FAMILY, + B_ANY_FORMAT_FAMILY, // TODO: Hm, actually not really /any/ family... B_MEDIA_RAW_VIDEO, B_MEDIA_ENCODED_VIDEO }, { { - "MP3 Audio", - "mp3", + "MPEG1 Video", + "mpeg1video", 0, - CODEC_ID_MP3, + CODEC_ID_MPEG1VIDEO, { 0 } }, - B_ANY_FORMAT_FAMILY, - B_MEDIA_RAW_AUDIO, - B_MEDIA_ENCODED_AUDIO - } + B_MPEG_FORMAT_FAMILY, + B_MEDIA_RAW_VIDEO, + B_MEDIA_ENCODED_VIDEO + }, + { + { + "MPEG2 Video", + "mpeg2video", + 0, + CODEC_ID_MPEG2VIDEO, + { 0 } + }, + B_MPEG_FORMAT_FAMILY, + B_MEDIA_RAW_VIDEO, + B_MEDIA_ENCODED_VIDEO + }, +// { +// { +// "MP3 Audio", +// "mp3", +// 0, +// CODEC_ID_MP3, +// { 0 } +// }, +// B_ANY_FORMAT_FAMILY, +// B_MEDIA_RAW_AUDIO, +// B_MEDIA_ENCODED_AUDIO +// } }; const size_t gEncoderCount = sizeof(gEncoderTable) / sizeof(EncoderDescription); Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/MuxerTable.cpp =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/MuxerTable.cpp 2009-08-01 00:04:05 UTC (rev 32042) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/MuxerTable.cpp 2009-08-01 01:16:12 UTC (rev 32043) @@ -24,6 +24,20 @@ "avi", { 0 } }, + { + media_file_format::B_WRITABLE + | media_file_format::B_KNOWS_ENCODED_VIDEO + | media_file_format::B_KNOWS_ENCODED_AUDIO, + { 0 }, + B_MPEG_FORMAT_FAMILY, + 100, + { 0 }, + "video/mpeg", + "MPEG (Motion Picture Experts Group)", + "mpg", + "mpg", + { 0 } + }, }; const size_t gMuxerCount = sizeof(gMuxerTable) / sizeof(media_file_format); Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/config.h =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/config.h 2009-08-01 00:04:05 UTC (rev 32042) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/config.h 2009-08-01 01:16:12 UTC (rev 32043) @@ -673,14 +673,14 @@ #define CONFIG_MP2_MUXER 0 #define CONFIG_MP3_MUXER 0 #define CONFIG_MP4_MUXER 0 -#define CONFIG_MPEG1SYSTEM_MUXER 0 +#define CONFIG_MPEG1SYSTEM_MUXER 1 #define CONFIG_MPEG1VCD_MUXER 0 -#define CONFIG_MPEG1VIDEO_MUXER 0 +#define CONFIG_MPEG1VIDEO_MUXER 1 #define CONFIG_MPEG2DVD_MUXER 0 #define CONFIG_MPEG2SVCD_MUXER 0 -#define CONFIG_MPEG2VIDEO_MUXER 0 +#define CONFIG_MPEG2VIDEO_MUXER 1 #define CONFIG_MPEG2VOB_MUXER 0 -#define CONFIG_MPEGTS_MUXER 0 +#define CONFIG_MPEGTS_MUXER 1 #define CONFIG_MPJPEG_MUXER 0 #define CONFIG_MXF_MUXER 0 #define CONFIG_MXF_D10_MUXER 0 Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/libavformat/utils.c =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/libavformat/utils.c 2009-08-01 00:04:05 UTC (rev 32042) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/libavformat/utils.c 2009-08-01 01:16:12 UTC (rev 32043) @@ -2723,7 +2723,10 @@ AVPacket opkt; int ret= av_interleave_packet(s, &opkt, pkt, 0); if(ret<=0) //FIXME cleanup needed for ret<0 ? +{ +av_log(NULL, AV_LOG_ERROR, "av_interleaved_write_frame() - av_interleave_packet() failed.\n"); return ret; +} ret= s->oformat->write_packet(s, &opkt); @@ -2731,9 +2734,15 @@ pkt= NULL; if(ret<0) +{ +av_log(NULL, AV_LOG_ERROR, "av_interleaved_write_frame() - write_packet() failed.\n"); return ret; +} if(url_ferror(s->pb)) +{ +av_log(NULL, AV_LOG_ERROR, "av_interleaved_write_frame() - url_ferror() failed.\n"); return url_ferror(s->pb); +} } } Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/libswscale/swscale.h =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/libswscale/swscale.h 2009-08-01 00:04:05 UTC (rev 32042) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/libswscale/swscale.h 2009-08-01 01:16:12 UTC (rev 32043) @@ -28,7 +28,6 @@ */ #include "libavutil/avutil.h" -#include "libavutil/internal.h" #define LIBSWSCALE_VERSION_MAJOR 0 #define LIBSWSCALE_VERSION_MINOR 7 Modified: haiku/trunk/src/kits/media/MediaFile.cpp =================================================================== --- haiku/trunk/src/kits/media/MediaFile.cpp 2009-08-01 00:04:05 UTC (rev 32042) +++ haiku/trunk/src/kits/media/MediaFile.cpp 2009-08-01 01:16:12 UTC (rev 32043) @@ -60,7 +60,8 @@ CALLED(); _Init(); fDeleteSource = true; - _InitWriter(new(std::nothrow) BFile(ref, O_WRONLY), mfi, flags); + _InitWriter(new(std::nothrow) BFile(ref, B_CREATE_FILE | B_ERASE_FILE + | B_WRITE_ONLY), mfi, flags); } Modified: haiku/trunk/src/kits/media/MediaWriter.cpp =================================================================== --- haiku/trunk/src/kits/media/MediaWriter.cpp 2009-08-01 00:04:05 UTC (rev 32042) +++ haiku/trunk/src/kits/media/MediaWriter.cpp 2009-08-01 01:16:12 UTC (rev 32043) @@ -110,7 +110,7 @@ } StreamInfo info; - ret = fWriter->AllocateCookie(&info.cookie, format); + ret = fWriter->AllocateCookie(&info.cookie, format, codecInfo); if (ret != B_OK) { _plugin_manager.DestroyEncoder(encoder); return ret; From bonefish at mail.berlios.de Sat Aug 1 03:18:41 2009 From: bonefish at mail.berlios.de (bonefish at mail.berlios.de) Date: Sat, 1 Aug 2009 03:18:41 +0200 Subject: [Haiku-commits] r32044 - haiku/trunk/src/system/boot/platform/pxe_ia32 Message-ID: <200908010118.n711IfQ4023628@sheep.berlios.de> Author: bonefish Date: 2009-08-01 03:18:39 +0200 (Sat, 01 Aug 2009) New Revision: 32044 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32044&view=rev Modified: haiku/trunk/src/system/boot/platform/pxe_ia32/network.cpp haiku/trunk/src/system/boot/platform/pxe_ia32/pxe_stage1.S haiku/trunk/src/system/boot/platform/pxe_ia32/pxe_stage2.S Log: Automatic whitespace cleanup. Modified: haiku/trunk/src/system/boot/platform/pxe_ia32/network.cpp =================================================================== --- haiku/trunk/src/system/boot/platform/pxe_ia32/network.cpp 2009-08-01 01:16:12 UTC (rev 32043) +++ haiku/trunk/src/system/boot/platform/pxe_ia32/network.cpp 2009-08-01 01:18:39 UTC (rev 32044) @@ -168,7 +168,7 @@ UNDI::Init() { TRACE("UNDI::Init\n"); - + PXENV_UNDI_GET_INFORMATION get_info; PXENV_UNDI_GET_STATE get_state; PXENV_UNDI_OPEN undi_open; @@ -177,8 +177,8 @@ status_t error = PXEService::Init(); if (error != B_OK) return error; - - dprintf("client-ip: %lu.%lu.%lu.%lu, server-ip: %lu.%lu.%lu.%lu\n", + + dprintf("client-ip: %lu.%lu.%lu.%lu, server-ip: %lu.%lu.%lu.%lu\n", (fClientIP >> 24) & 0xff, (fClientIP >> 16) & 0xff, (fClientIP >> 8) & 0xff, fClientIP & 0xff, (fServerIP >> 24) & 0xff, (fServerIP >> 16) & 0xff, (fServerIP >> 8) & 0xff, fServerIP & 0xff); @@ -198,16 +198,16 @@ dprintf("PXENV_UNDI_GET_STATE failed, res %x, status %x, ignoring\n", res, get_state.Status); } else { switch (get_state.UNDIstate) { - case PXE_UNDI_GET_STATE_STARTED: + case PXE_UNDI_GET_STATE_STARTED: TRACE("PXE_UNDI_GET_STATE_STARTED\n"); break; - case PXE_UNDI_GET_STATE_INITIALIZED: + case PXE_UNDI_GET_STATE_INITIALIZED: TRACE("PXE_UNDI_GET_STATE_INITIALIZED\n"); break; - case PXE_UNDI_GET_STATE_OPENED: + case PXE_UNDI_GET_STATE_OPENED: TRACE("PXE_UNDI_GET_STATE_OPENED\n"); break; - default: + default: TRACE("unknown undi state 0x%02x\n", get_state.UNDIstate); break; } @@ -229,7 +229,7 @@ TRACE("TxBufCt = %x\n", get_info.TxBufCt); fMACAddress = get_info.CurrentNodeAddress; - + TRACE("MAC: %02x:%02x:%02x:%02x:%02x:%02x\n", fMACAddress[0], fMACAddress[1], fMACAddress[2], fMACAddress[3], fMACAddress[4], fMACAddress[5]); return B_OK; @@ -313,7 +313,7 @@ fRxFinished = true; return 0; } - + } else { undi_isr.FuncFlag = PXENV_UNDI_ISR_IN_START; @@ -332,7 +332,7 @@ // send EOI to pic ? // TRACE("PXENV_UNDI_ISR_OUT_OURS\n"); - + undi_isr.FuncFlag = PXENV_UNDI_ISR_IN_PROCESS; res = call_pxe_bios(fPxeData, UNDI_ISR, &undi_isr); if (res != 0 || undi_isr.Status != 0) { Modified: haiku/trunk/src/system/boot/platform/pxe_ia32/pxe_stage1.S =================================================================== --- haiku/trunk/src/system/boot/platform/pxe_ia32/pxe_stage1.S 2009-08-01 01:16:12 UTC (rev 32043) +++ haiku/trunk/src/system/boot/platform/pxe_ia32/pxe_stage1.S 2009-08-01 01:18:39 UTC (rev 32044) @@ -60,7 +60,7 @@ cld - // print start banner + // print start banner movw $startmsg, %si call puts @@ -77,7 +77,7 @@ call puts // switch to unreal mode - cli + cli call enable_a20 call go_unreal sti @@ -161,7 +161,7 @@ movw $crlf, %si call puts - // handle DHCP options..... + // handle DHCP options..... movw $PXENV_GET_CACHED_INFO, %bx movw $s_PXENV_GET_CACHED_INFO_2, %di lcall * pxenv_api @@ -198,7 +198,7 @@ call puts movw $crlf, %si call puts - + // get file size movl server_ip, %eax movl %eax, s_PXENV_TFTP_GET_FSIZE_ServerIPAddress @@ -244,7 +244,7 @@ movw s_PXENV_TFTP_OPEN_PacketSize, %ax imull $65535, %eax movl %eax, max_fsize - + // print max TFTP file size movw $maxfsize, %si call puts @@ -382,7 +382,7 @@ movw $sizefailed, %si call puts jmp stop - + err_load: movw $loadfailed, %si call puts @@ -401,7 +401,7 @@ ret putc: movw $0x7, %bx movb $0xe, %ah - int $0x10 + int $0x10 jmp _puts2 puthex32: Modified: haiku/trunk/src/system/boot/platform/pxe_ia32/pxe_stage2.S =================================================================== --- haiku/trunk/src/system/boot/platform/pxe_ia32/pxe_stage2.S 2009-08-01 01:16:12 UTC (rev 32043) +++ haiku/trunk/src/system/boot/platform/pxe_ia32/pxe_stage2.S 2009-08-01 01:18:39 UTC (rev 32044) @@ -39,12 +39,12 @@ cld - // print start banner + // print start banner mov $kStartMessage + INITIAL_LOAD_OFFSET, %esi call puts // switch to unreal mode - cli + cli call enable_a20 call go_unreal sti From umccullough at gmail.com Sat Aug 1 03:22:43 2009 From: umccullough at gmail.com (Urias McCullough) Date: Fri, 31 Jul 2009 18:22:43 -0700 Subject: [Haiku-commits] r32041 - haiku/trunk/src/preferences/screen In-Reply-To: <461265595-BeMail@kirilla> References: <200907312325.n6VNPNox019197@sheep.berlios.de> <461265595-BeMail@kirilla> Message-ID: <1e80d8750907311822n7f14488fo1af58127d760ba90@mail.gmail.com> 2009/7/31 Jonas Sundstr?m : > axeld at mail.berlios.de wrote: > ?... >> If anyone has a SONY (SNY?), >> ? Dell, or Acer monitor, those are still missing as well. > > Confirmed: SNY = Sony I've also checked elsewhere, and DEL = Dell Examples: https://bugzilla.redhat.com/show_bug.cgi?id=494125 http://ubuntuforums.org/archive/index.php/t-1126592.html https://lists.ubuntu.com/archives/universe-bugs/2009-April/071334.html It also seems ACR = Acer http://kernel.org/pub/linux/kernel/people/jbarnes/patches/i915-edid-quirks.patch - Urias From stippi at mail.berlios.de Sat Aug 1 03:33:03 2009 From: stippi at mail.berlios.de (stippi at mail.berlios.de) Date: Sat, 1 Aug 2009 03:33:03 +0200 Subject: [Haiku-commits] r32045 - haiku/trunk/src/apps/mediaconverter Message-ID: <200908010133.n711X3jQ024329@sheep.berlios.de> Author: stippi Date: 2009-08-01 03:33:01 +0200 (Sat, 01 Aug 2009) New Revision: 32045 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32045&view=rev Modified: haiku/trunk/src/apps/mediaconverter/MediaConverterWindow.cpp Log: Fix compilation and small cleanups. Modified: haiku/trunk/src/apps/mediaconverter/MediaConverterWindow.cpp =================================================================== --- haiku/trunk/src/apps/mediaconverter/MediaConverterWindow.cpp 2009-08-01 01:18:39 UTC (rev 32044) +++ haiku/trunk/src/apps/mediaconverter/MediaConverterWindow.cpp 2009-08-01 01:33:01 UTC (rev 32045) @@ -35,16 +35,14 @@ // #pragma mark - DirectoryFilter -class DirectoryFilter : public BRefFilter -{ +class DirectoryFilter : public BRefFilter { public: - DirectoryFilter(){}; - virtual bool Filter(const entry_ref *ref, - BNode *node, struct stat *st, const char *filetype) - { - return node->IsDirectory(); - } -private: + DirectoryFilter() {}; + virtual bool Filter(const entry_ref* ref, + BNode* node, struct stat_beos* st, const char* filetype) + { + return node->IsDirectory(); + } }; @@ -52,9 +50,9 @@ class FileFormatMenuItem : public BMenuItem { - public: - FileFormatMenuItem(media_file_format* format); - virtual ~FileFormatMenuItem(); +public: + FileFormatMenuItem(media_file_format* format); + virtual ~FileFormatMenuItem(); media_file_format fFileFormat; }; From stippi at mail.berlios.de Sat Aug 1 03:33:39 2009 From: stippi at mail.berlios.de (stippi at mail.berlios.de) Date: Sat, 1 Aug 2009 03:33:39 +0200 Subject: [Haiku-commits] r32046 - haiku/trunk/src/apps/mediaconverter Message-ID: <200908010133.n711Xdud024347@sheep.berlios.de> Author: stippi Date: 2009-08-01 03:33:38 +0200 (Sat, 01 Aug 2009) New Revision: 32046 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32046&view=rev Modified: haiku/trunk/src/apps/mediaconverter/MediaConverterApp.cpp Log: * Auto white-space cleanup. * Do not override pixel aspect unnecessarily. Modified: haiku/trunk/src/apps/mediaconverter/MediaConverterApp.cpp =================================================================== --- haiku/trunk/src/apps/mediaconverter/MediaConverterApp.cpp 2009-08-01 01:33:01 UTC (rev 32045) +++ haiku/trunk/src/apps/mediaconverter/MediaConverterApp.cpp 2009-08-01 01:33:38 UTC (rev 32046) @@ -67,7 +67,7 @@ case START_CONVERSION_MESSAGE: if (!fConverting) - StartConverting(); + StartConverting(); break; case CANCEL_CONVERSION_MESSAGE: @@ -80,21 +80,21 @@ DetachCurrentMessage(); BMessenger(fWin).SendMessage(msg); break; - + default: BApplication::MessageReceived(msg); } } -void +void MediaConverterApp::ReadyToRun() { fWin->Show(); fWin->PostMessage(INIT_FORMAT_MENUS); } -void +void MediaConverterApp::RefsReceived(BMessage *msg) { entry_ref ref; @@ -134,14 +134,14 @@ // #pragma mark - -bool +bool MediaConverterApp::IsConverting() const { return fConverting; } -void +void MediaConverterApp::StartConverting() { bool locked = fWin->Lock(); @@ -152,7 +152,7 @@ if (fConvertThreadID >= 0) { fConverting = true; fCancel = false; - resume_thread(fConvertThreadID); + resume_thread(fConvertThreadID); } } @@ -162,7 +162,7 @@ } -void +void MediaConverterApp::SetStatusMessage(const char *message) { if (fWin != NULL && fWin->Lock()) { @@ -186,7 +186,7 @@ name.Truncate(extIndex + 1); else name.Append("."); - + name.Append(outputFormat->file_extension); BEntry inEntry(ref); @@ -298,8 +298,8 @@ } fWin->Unlock(); } - - + + } else { fWin->Unlock(); break; @@ -316,7 +316,7 @@ // #pragma mark - -status_t +status_t MediaConverterApp::_ConvertFile(BMediaFile* inFile, BMediaFile* outFile, media_codec_info* audioCodec, media_codec_info* videoCodec, int32 audioQuality, int32 videoQuality, @@ -359,7 +359,7 @@ outAudFormat.type = B_MEDIA_RAW_AUDIO; raf = &(outAudFormat.u.raw_audio); inTrack->DecodedFormat(&outAudFormat); - + audioBuffer = new uint8[raf->buffer_size]; // audioFrameSize = (raf->format & media_raw_audio_format::B_AUDIO_SIZE_MASK) audioFrameSize = (raf->format & 0xf) * raf->channel_count; @@ -377,15 +377,13 @@ inVidTrack = inTrack; width = (int32)inFormat.Width(); height = (int32)inFormat.Height(); - + // construct desired decoded video format -// memset(&outVidFormat, 0, sizeof(outVidFormat)); + memset(&outVidFormat, 0, sizeof(outVidFormat)); outVidFormat.type = B_MEDIA_RAW_VIDEO; rvf = &(outVidFormat.u.raw_video); rvf->last_active = (uint32)(height - 1); rvf->orientation = B_VIDEO_TOP_LEFT_RIGHT; - rvf->pixel_width_aspect = 1; - rvf->pixel_height_aspect = 1; rvf->display.format = B_RGB32; rvf->display.bytes_per_row = 4 * width; rvf->display.line_width = width; @@ -410,7 +408,7 @@ = new MediaEncoderWindow(BRect(50, 50, 520, 555), encoderView); encoderWin->Go(); // blocks until the window is quit - + // The quality setting is ignored by the 3ivx encoder if the // view was displayed, but this method is the trigger to read // all the parameter settings @@ -594,6 +592,6 @@ { MediaConverterApp app; app.Run(); - + return 0; } From anevilyak at mail.berlios.de Sat Aug 1 03:40:11 2009 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Sat, 1 Aug 2009 03:40:11 +0200 Subject: [Haiku-commits] r32047 - haiku/trunk/src/apps/debugger/gui/team_window Message-ID: <200908010140.n711eB5G025252@sheep.berlios.de> Author: anevilyak Date: 2009-08-01 03:40:11 +0200 (Sat, 01 Aug 2009) New Revision: 32047 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32047&view=rev Modified: haiku/trunk/src/apps/debugger/gui/team_window/SourceView.cpp Log: Implement double click / triple click drag selection as in Pe. Modified: haiku/trunk/src/apps/debugger/gui/team_window/SourceView.cpp =================================================================== --- haiku/trunk/src/apps/debugger/gui/team_window/SourceView.cpp 2009-08-01 01:33:38 UTC (rev 32046) +++ haiku/trunk/src/apps/debugger/gui/team_window/SourceView.cpp 2009-08-01 01:40:11 UTC (rev 32047) @@ -253,14 +253,16 @@ void _FormatLine(const char* line, BString& formattedLine); inline int32 _NextTabStop(int32 column) const; - float _FormattedPosition(int32 line, + float _FormattedPosition(int32 line, int32 offset) const; SelectionPoint _SelectionPointAt(BPoint where) const; void _GetSelectionRegion(BRegion& region) const; void _GetSelectionText(BString& text) const; void _CopySelectionToClipboard() const; - void _SelectWordAt(const SelectionPoint& point); - void _SelectLineAt(const SelectionPoint& point); + void _SelectWordAt(const SelectionPoint& point, + bool extend = false); + void _SelectLineAt(const SelectionPoint& point, + bool extend = false); void _HandleAutoScroll(); void _ScrollHorizontal(int32 charCount); void _ScrollByLines(int32 lineCount); @@ -1051,10 +1053,12 @@ fLastClickTime = clickTime; } - if (fClickCount == 2) + if (fClickCount == 2) { _SelectWordAt(point); - else if (fClickCount == 3) { + fSelectionMode = true; + } else if (fClickCount == 3) { _SelectLineAt(point); + fSelectionMode = true; } else if (!region.Contains(where)) { fSelectionBase = fSelectionStart = fSelectionEnd = point; fSelectionMode = true; @@ -1080,18 +1084,24 @@ switch (transit) { case B_INSIDE_VIEW: case B_OUTSIDE_VIEW: - if (point.line > fSelectionBase.line) { - fSelectionStart = fSelectionBase; - fSelectionEnd = point; - } else if (point.line < fSelectionBase.line) { - fSelectionEnd = fSelectionBase; - fSelectionStart = point; - } else if (point.offset > fSelectionBase.offset) { - fSelectionStart = fSelectionBase; - fSelectionEnd = point; - } else { - fSelectionEnd = fSelectionBase; - fSelectionStart = point; + if (fClickCount == 2) + _SelectWordAt(point, true); + else if (fClickCount == 3) + _SelectLineAt(point, true); + else { + if (point.line > fSelectionBase.line) { + fSelectionStart = fSelectionBase; + fSelectionEnd = point; + } else if (point.line < fSelectionBase.line) { + fSelectionEnd = fSelectionBase; + fSelectionStart = point; + } else if (point.offset > fSelectionBase.offset) { + fSelectionStart = fSelectionBase; + fSelectionEnd = point; + } else { + fSelectionEnd = fSelectionBase; + fSelectionStart = point; + } } break; @@ -1193,7 +1203,7 @@ } -int32 +int32 SourceView::TextView::_NextTabStop(int32 column) const { return (column / kSpacesPerTab + 1) * kSpacesPerTab; @@ -1205,12 +1215,12 @@ { int32 column = 0; for (int32 i = 0; i < offset; i++) { - if (fSourceCode->LineAt(line)[i] == '\t') + if (fSourceCode->LineAt(line)[i] == '\t') column = _NextTabStop(column); else ++column; } - + return column * fCharacterWidth; } @@ -1224,9 +1234,9 @@ int32 column = 0; int32 lineLength = fSourceCode->LineLengthAt(line); const char* sourceLine = fSourceCode->LineAt(line); - + for (int32 i = 0; i < lineLength; i++) { - if (sourceLine[i] == '\t') + if (sourceLine[i] == '\t') column = _NextTabStop(column); else ++column; @@ -1236,8 +1246,8 @@ break; } } - - if (offset < 0) + + if (offset < 0) offset = lineLength; } @@ -1336,41 +1346,76 @@ void -SourceView::TextView::_SelectWordAt(const SelectionPoint& point) +SourceView::TextView::_SelectWordAt(const SelectionPoint& point, bool extend) { const char* line = fSourceCode->LineAt(point.line); - if (isalpha(line[point.offset]) || isdigit(line[point.offset])) { - int32 length = fSourceCode->LineLengthAt(point.line); - int32 start = point.offset - 1; - int32 end = point.offset + 1; - while ((end) < length) { - if (!isalpha(line[end]) && !isdigit(line[end])) - break; - ++end; + int32 length = fSourceCode->LineLengthAt(point.line); + int32 start = point.offset - 1; + int32 end = point.offset + 1; + while ((end) < length) { + if (!isalpha(line[end]) && !isdigit(line[end])) + break; + ++end; + } + while ((start - 1) >= 0) { + if (!isalpha(line[start - 1]) && !isdigit(line[start - 1])) + break; + --start; + } + + if (extend) { + if (point.line >= fSelectionBase.line + || (point.line == fSelectionBase.line + && point.offset > fSelectionBase.offset)) { + fSelectionStart.line = fSelectionBase.line; + fSelectionStart.offset = fSelectionBase.offset; + fSelectionEnd.line = point.line; + fSelectionEnd.offset = end; + } else if (point.line < fSelectionBase.line) { + fSelectionStart.line = point.line; + fSelectionStart.offset = start; + fSelectionEnd.line = fSelectionBase.line; + fSelectionEnd.offset = fSelectionBase.offset; + } else if (point.line == fSelectionBase.line) { + // if we hit here, our offset is before the actual start. + fSelectionStart.line = point.line; + fSelectionStart.offset = start; + fSelectionEnd.line = point.line; + fSelectionEnd.offset = fSelectionBase.offset; } - while ((start - 1) >= 0) { - if (!isalpha(line[start - 1]) && !isdigit(line[start - 1])) - break; - --start; - } - - fSelectionStart.line = point.line; - fSelectionStart.offset = start; + } else { + fSelectionBase.line = fSelectionStart.line = point.line; + fSelectionBase.offset = fSelectionStart.offset = start; fSelectionEnd.line = point.line; fSelectionEnd.offset = end; - BRegion region; - _GetSelectionRegion(region); - Invalidate(®ion); } + BRegion region; + _GetSelectionRegion(region); + Invalidate(®ion); } void -SourceView::TextView::_SelectLineAt(const SelectionPoint& point) +SourceView::TextView::_SelectLineAt(const SelectionPoint& point, bool extend) { - fSelectionStart.line = fSelectionEnd.line = point.line; - fSelectionStart.offset = 0; - fSelectionEnd.offset = fSourceCode->LineLengthAt(point.line); + if (extend) { + if (point.line >= fSelectionBase.line) { + fSelectionStart.line = fSelectionBase.line; + fSelectionStart.offset = 0; + fSelectionEnd.line = point.line; + fSelectionEnd.offset = fSourceCode->LineLengthAt(point.line); + } else { + fSelectionStart.line = point.line; + fSelectionStart.offset = 0; + fSelectionEnd.line = fSelectionBase.line; + fSelectionEnd.offset = fSourceCode->LineLengthAt( + fSelectionBase.line); + } + } else { + fSelectionStart.line = fSelectionEnd.line = point.line; + fSelectionStart.offset = 0; + fSelectionEnd.offset = fSourceCode->LineLengthAt(point.line); + } BRegion region; _GetSelectionRegion(region); Invalidate(®ion); @@ -1403,7 +1448,7 @@ factor = (int)(ceilf(difference / fCharacterWidth)); _ScrollHorizontal(factor); } - + MouseMoved(point, B_OUTSIDE_VIEW, NULL); } From axeld at mail.berlios.de Sat Aug 1 03:46:55 2009 From: axeld at mail.berlios.de (axeld at mail.berlios.de) Date: Sat, 1 Aug 2009 03:46:55 +0200 Subject: [Haiku-commits] r32048 - haiku/trunk/src/preferences/screen Message-ID: <200908010146.n711ktPG026277@sheep.berlios.de> Author: axeld Date: 2009-08-01 03:46:53 +0200 (Sat, 01 Aug 2009) New Revision: 32048 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32048&view=rev Modified: haiku/trunk/src/preferences/screen/ScreenWindow.cpp Log: * Made the refresh slider/menu take the monitor's capabilities into account. Modified: haiku/trunk/src/preferences/screen/ScreenWindow.cpp =================================================================== --- haiku/trunk/src/preferences/screen/ScreenWindow.cpp 2009-08-01 01:40:11 UTC (rev 32047) +++ haiku/trunk/src/preferences/screen/ScreenWindow.cpp 2009-08-01 01:46:53 UTC (rev 32048) @@ -310,7 +310,16 @@ fRefreshMenu->AddItem(item = new BMenuItem(name.String(), message)); item->SetEnabled(false); } else { + monitor_info info; + if (fScreenMode.GetMonitorInfo(info) == B_OK) { + min = max_c(info.min_vertical_frequency, min); + max = min_c(info.max_vertical_frequency, max); + } + for (int32 i = 0; i < kRefreshRateCount; ++i) { + if (kRefreshRates[i] < min || kRefreshRates[i] > max) + continue; + BString name; name << kRefreshRates[i] << " Hz"; @@ -880,8 +889,15 @@ if (max > gMaxRefresh) max = gMaxRefresh; + monitor_info info; + if (fScreenMode.GetMonitorInfo(info) == B_OK) { + min = max_c(info.min_vertical_frequency, min); + max = min_c(info.max_vertical_frequency, max); + } + RefreshWindow *fRefreshWindow = new RefreshWindow( - fRefreshField->ConvertToScreen(B_ORIGIN), fSelected.refresh, min, max); + fRefreshField->ConvertToScreen(B_ORIGIN), fSelected.refresh, + min, max); fRefreshWindow->Show(); break; } From axeld at mail.berlios.de Sat Aug 1 03:47:42 2009 From: axeld at mail.berlios.de (axeld at mail.berlios.de) Date: Sat, 1 Aug 2009 03:47:42 +0200 Subject: [Haiku-commits] r32049 - haiku/trunk/src/preferences/screen Message-ID: <200908010147.n711lgRA026400@sheep.berlios.de> Author: axeld Date: 2009-08-01 03:47:40 +0200 (Sat, 01 Aug 2009) New Revision: 32049 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32049&view=rev Modified: haiku/trunk/src/preferences/screen/ScreenMode.cpp haiku/trunk/src/preferences/screen/ScreenMode.h Log: * Added many many more vendors, thanks to Brecht for digging up a nice web resource that I couldn't find! Also thanks to Jonas and Urias :-) * Header cleanup. Modified: haiku/trunk/src/preferences/screen/ScreenMode.cpp =================================================================== --- haiku/trunk/src/preferences/screen/ScreenMode.cpp 2009-08-01 01:46:53 UTC (rev 32048) +++ haiku/trunk/src/preferences/screen/ScreenMode.cpp 2009-08-01 01:47:40 UTC (rev 32049) @@ -202,7 +202,7 @@ SetTVStandard(&screen, mode.tv_standard); display_mode displayMode; - if (!GetDisplayMode(mode, displayMode)) + if (!_GetDisplayMode(mode, displayMode)) return B_ENTRY_NOT_FOUND; return screen.SetMode(workspace, &displayMode, true); @@ -309,7 +309,7 @@ { uint32 minClock, maxClock; display_mode displayMode; - if (!GetDisplayMode(mode, displayMode)) + if (!_GetDisplayMode(mode, displayMode)) return B_ERROR; BScreen screen(fWindow); @@ -344,20 +344,41 @@ uint32 id = (info.vendor[0] << 24) | (info.vendor[1] << 16) | (info.vendor[2] << 8) | (info.vendor[3]); - // TODO: replace more vendor strings with something readable switch (id) { case 'ADI\0': strcpy(info.vendor, "ADI MicroScan"); break; + case 'API\0': + strcpy(info.vendor, "Acer"); + break; + case 'APP\0': + strcpy(info.vendor, "Apple"); + break; case 'AUO\0': strcpy(info.vendor, "AU Optronics"); break; case 'BNQ\0': strcpy(info.vendor, "BenQ"); break; + case 'CPL\0': + strcpy(info.vendor, "ALFA"); + break; + case 'CPQ\0': + strcpy(info.vendor, "Compaq"); + break; + case 'DEL\0': + strcpy(info.vendor, "Dell"); + break; + case 'DPC\0': + strcpy(info.vendor, "Delta Electronics"); + break; + case 'DWE\0': + strcpy(info.vendor, "Daewoo"); + break; case 'EMA\0': strcpy(info.vendor, "eMachines"); break; + case 'EIZ\0': case 'ENC\0': strcpy(info.vendor, "Eizo"); break; @@ -367,15 +388,52 @@ case 'GSM\0': strcpy(info.vendor, "LG"); break; + case 'HEI\0': + strcpy(info.vendor, "Hyundai"); + break; + case 'HIT\0': + case 'HTC\0': + strcpy(info.vendor, "Hitachi"); + break; + case 'HSL\0': + strcpy(info.vendor, "Hansol"); + break; case 'HWP\0': strcpy(info.vendor, "Hewlett Packard"); break; + case 'ICL\0': + strcpy(info.vendor, "Fujitsu"); + break; + case 'IVM\0': + strcpy(info.vendor, "Iiyama"); + break; case 'LEN\0': strcpy(info.vendor, "Lenovo"); break; + case 'MAX\0': + strcpy(info.vendor, "Maxdata"); + break; case 'MED\0': strcpy(info.vendor, "Medion"); break; + case 'MEI\0': + strcpy(info.vendor, "Panasonic"); + break; + case 'MEL\0': + strcpy(info.vendor, "Mitsubishi"); + break; + case 'MIR\0': + strcpy(info.vendor, "miro"); + break; + case 'MTC\0': + strcpy(info.vendor, "Mitac"); + break; + case 'NAN\0': + strcpy(info.vendor, "Nanao"); + break; + case 'NOK\0': + strcpy(info.vendor, "Nokia"); + break; case 'PHL\0': strcpy(info.vendor, "Philips"); break; @@ -385,9 +443,21 @@ case 'SAM\0': strcpy(info.vendor, "Samsung"); break; + case 'SDI\0': + strcpy(info.vendor, "Samtron"); + break; case 'SHP\0': strcpy(info.vendor, "Sharp"); break; + case 'SNI\0': + strcpy(info.vendor, "Siemens"); + break; + case 'SNY\0': + strcpy(info.vendor, "Sony"); + break; + case 'UNM\0': + strcpy(info.vendor, "Unisys"); + break; case 'VIZ\0': strcpy(info.vendor, "Vizio"); break; @@ -431,7 +501,7 @@ bool -ScreenMode::GetDisplayMode(const screen_mode& mode, display_mode& displayMode) +ScreenMode::_GetDisplayMode(const screen_mode& mode, display_mode& displayMode) { uint16 virtualWidth, virtualHeight; int32 bestIndex = -1; Modified: haiku/trunk/src/preferences/screen/ScreenMode.h =================================================================== --- haiku/trunk/src/preferences/screen/ScreenMode.h 2009-08-01 01:46:53 UTC (rev 32048) +++ haiku/trunk/src/preferences/screen/ScreenMode.h 2009-08-01 01:47:40 UTC (rev 32049) @@ -37,35 +37,39 @@ class ScreenMode { - public: - ScreenMode(BWindow* window); - ~ScreenMode(); +public: + ScreenMode(BWindow* window); + ~ScreenMode(); - status_t Set(const screen_mode& mode, int32 workspace = ~0); - status_t Get(screen_mode& mode, int32 workspace = ~0) const; - status_t GetOriginalMode(screen_mode &mode, int32 workspace = ~0) const; + status_t Set(const screen_mode& mode, int32 workspace = ~0); + status_t Get(screen_mode& mode, int32 workspace = ~0) const; + status_t GetOriginalMode(screen_mode &mode, + int32 workspace = ~0) const; - status_t Revert(); - void UpdateOriginalModes(); + status_t Revert(); + void UpdateOriginalModes(); - bool SupportsColorSpace(const screen_mode& mode, color_space space); - status_t GetRefreshLimits(const screen_mode& mode, float& min, - float& max); - status_t GetMonitorInfo(monitor_info& info, float* _diagonalInches); + bool SupportsColorSpace(const screen_mode& mode, + color_space space); + status_t GetRefreshLimits(const screen_mode& mode, + float& min, float& max); + status_t GetMonitorInfo(monitor_info& info, + float* _diagonalInches = NULL); - screen_mode ModeAt(int32 index); - int32 CountModes(); + screen_mode ModeAt(int32 index); + int32 CountModes(); - private: - bool GetDisplayMode(const screen_mode& mode, display_mode& displayMode); +private: + bool _GetDisplayMode(const screen_mode& mode, + display_mode& displayMode); - BWindow* fWindow; - display_mode* fModeList; - uint32 fModeCount; + BWindow* fWindow; + display_mode* fModeList; + uint32 fModeCount; - bool fUpdatedModes; - display_mode fOriginalDisplayMode[32]; - screen_mode fOriginal[32]; + bool fUpdatedModes; + display_mode fOriginalDisplayMode[32]; + screen_mode fOriginal[32]; }; #endif /* SCREEN_MODE_H */ From bonefish at mail.berlios.de Sat Aug 1 03:54:01 2009 From: bonefish at mail.berlios.de (bonefish at mail.berlios.de) Date: Sat, 1 Aug 2009 03:54:01 +0200 Subject: [Haiku-commits] r32050 - in haiku/trunk: headers/private/kernel headers/private/kernel/arch/x86 src/system/kernel src/system/kernel/arch/x86 src/system/kernel/debug Message-ID: <200908010154.n711s1X0027348@sheep.berlios.de> Author: bonefish Date: 2009-08-01 03:53:54 +0200 (Sat, 01 Aug 2009) New Revision: 32050 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32050&view=rev Added: haiku/trunk/src/system/kernel/arch/x86/arch_int.cpp Removed: haiku/trunk/src/system/kernel/arch/x86/arch_int.c Modified: haiku/trunk/headers/private/kernel/arch/x86/arch_cpu.h haiku/trunk/headers/private/kernel/debug.h haiku/trunk/headers/private/kernel/smp.h haiku/trunk/src/system/kernel/arch/x86/Jamfile haiku/trunk/src/system/kernel/arch/x86/arch_cpu.cpp haiku/trunk/src/system/kernel/arch/x86/arch_interrupts.S haiku/trunk/src/system/kernel/arch/x86/arch_smp.c haiku/trunk/src/system/kernel/debug/debug.cpp haiku/trunk/src/system/kernel/smp.cpp Log: More work towards making our double fault handler less triple fault prone: * SMP: - Added smp_send_broadcast_ici_interrupts_disabled(), which is basically equivalent to smp_send_broadcast_ici(), but is only called with interrupts disabled and gets the CPU index, so it doesn't have to use smp_get_current_cpu() (which dereferences the current thread). - Added cpu index parameter to smp_intercpu_int_handler(). * x86: - arch_int.c -> arch_int.cpp - Set up an IDT per CPU. We were using a single IDT for all CPUs, but that can't work, since we need different tasks for the double fault interrupt vector. - Set the per CPU double fault task gates correctly. - Renamed set_intr_gate() to set_interrupt_gate and set_system_gate() to set_trap_gate() and documented them a bit. - Renamed double_fault_exception() x86_double_fault_exception() and fixed it not to use smp_get_current_cpu(). Instead we have the new x86_double_fault_get_cpu() that deducts the CPU index from the used stack. - Fixed the double_fault interrupt handler: It no longer calls int_bottom to avoid accessing the current thread. * debug.cpp: - Introduced explicit debug_double_fault() to enter the kernel debugger from a double fault handler. - Avoid using smp_get_current_cpu(). - Don't use kprintf() before sDebuggerOnCPU is set. Otherwise acquire_spinlock() is invoked by arch_debug_serial_puts(). Things look a bit better when the current thread pointer is broken -- we run into kernel_debugger_loop() and successfully print the "Welcome to KDL" message -- but we still dereference the thread pointer afterwards, so that we don't get a usable kernel debugger yet. Modified: haiku/trunk/headers/private/kernel/arch/x86/arch_cpu.h =================================================================== --- haiku/trunk/headers/private/kernel/arch/x86/arch_cpu.h 2009-08-01 01:47:40 UTC (rev 32049) +++ haiku/trunk/headers/private/kernel/arch/x86/arch_cpu.h 2009-08-01 01:53:54 UTC (rev 32050) @@ -275,13 +275,15 @@ void x86_write_cr4(uint32 value); uint64 x86_read_msr(uint32 registerNumber); void x86_write_msr(uint32 registerNumber, uint64 value); -void x86_set_task_gate(int32 n, int32 segment); +void x86_set_task_gate(int32 cpu, int32 n, int32 segment); +void* x86_get_idt(int32 cpu); uint32 x86_count_mtrrs(void); void x86_set_mtrr(uint32 index, uint64 base, uint64 length, uint8 type); status_t x86_get_mtrr(uint32 index, uint64 *_base, uint64 *_length, uint8 *_type); bool x86_check_feature(uint32 feature, enum x86_feature_type type); void* x86_get_double_fault_stack(int32 cpu, size_t* _size); -int x86_double_fault_get_cpu(); +int32 x86_double_fault_get_cpu(void); +void x86_double_fault_exception(struct iframe* frame); #define read_cr3(value) \ Modified: haiku/trunk/headers/private/kernel/debug.h =================================================================== --- haiku/trunk/headers/private/kernel/debug.h 2009-08-01 01:47:40 UTC (rev 32049) +++ haiku/trunk/headers/private/kernel/debug.h 2009-08-01 01:53:54 UTC (rev 32050) @@ -120,7 +120,8 @@ extern void debug_set_page_fault_info(addr_t faultAddress, addr_t pc, uint32 flags); extern debug_page_fault_info* debug_get_page_fault_info(); -extern void debug_trap_cpu_in_kdl(bool returnIfHandedOver); +extern void debug_trap_cpu_in_kdl(int32 cpu, bool returnIfHandedOver); +extern void debug_double_fault(int32 cpu); extern bool debug_emergency_key_pressed(char key); extern char kgetc(void); Modified: haiku/trunk/headers/private/kernel/smp.h =================================================================== --- haiku/trunk/headers/private/kernel/smp.h 2009-08-01 01:47:40 UTC (rev 32049) +++ haiku/trunk/headers/private/kernel/smp.h 2009-08-01 01:53:54 UTC (rev 32050) @@ -52,12 +52,14 @@ uint32 data2, uint32 data3, void *data_ptr, uint32 flags); void smp_send_broadcast_ici(int32 message, uint32 data, uint32 data2, uint32 data3, void *data_ptr, uint32 flags); +void smp_send_broadcast_ici_interrupts_disabled(int32 currentCPU, int32 message, + uint32 data, uint32 data2, uint32 data3, void *data_ptr, uint32 flags); int32 smp_get_num_cpus(void); void smp_set_num_cpus(int32 numCPUs); int32 smp_get_current_cpu(void); -int smp_intercpu_int_handler(void); +int smp_intercpu_int_handler(int32 cpu); #ifdef __cplusplus } Modified: haiku/trunk/src/system/kernel/arch/x86/Jamfile =================================================================== --- haiku/trunk/src/system/kernel/arch/x86/Jamfile 2009-08-01 01:47:40 UTC (rev 32049) +++ haiku/trunk/src/system/kernel/arch/x86/Jamfile 2009-08-01 01:53:54 UTC (rev 32050) @@ -16,7 +16,7 @@ arch_debug.cpp arch_debug_console.c arch_elf.c - arch_int.c + arch_int.cpp arch_platform.c # arch_selector.c arch_real_time_clock.c Modified: haiku/trunk/src/system/kernel/arch/x86/arch_cpu.cpp =================================================================== --- haiku/trunk/src/system/kernel/arch/x86/arch_cpu.cpp 2009-08-01 01:47:40 UTC (rev 32049) +++ haiku/trunk/src/system/kernel/arch/x86/arch_cpu.cpp 2009-08-01 01:53:54 UTC (rev 32050) @@ -269,8 +269,11 @@ tss->io_map_base = sizeof(struct tss); // add TSS descriptor for this new TSS - set_tss_descriptor(&gGDT[DOUBLE_FAULT_TSS_BASE_SEGMENT + cpuNum], + uint16 tssSegmentDescriptorIndex = DOUBLE_FAULT_TSS_BASE_SEGMENT + cpuNum; + set_tss_descriptor(&gGDT[tssSegmentDescriptorIndex], (addr_t)tss, sizeof(struct tss)); + + x86_set_task_gate(cpuNum, 8, tssSegmentDescriptorIndex << 3); } @@ -511,8 +514,8 @@ /*! Returns the index of the current CPU. Can only be called from the double fault handler. */ -int -x86_double_fault_get_cpu() +int32 +x86_double_fault_get_cpu(void) { uint32 stack = x86_read_ebp(); return (stack - (uint32)sDoubleFaultStacks) / kDoubleFaultStackSize; @@ -561,9 +564,21 @@ // load the TSS for this cpu // note the main cpu gets initialized in arch_cpu_init_post_vm() - if (cpu != 0) + if (cpu != 0) { load_tss(cpu); + // set the IDT + struct { + uint16 limit; + void* address; + } _PACKED descriptor = { + 256 * 8 - 1, // 256 descriptors, 8 bytes each (-1 for "limit") + x86_get_idt(cpu) + }; + + asm volatile("lidt %0" : : "m"(descriptor)); + } + return 0; } @@ -621,8 +636,6 @@ // set the current hardware task on cpu 0 load_tss(0); - x86_set_task_gate(8, DOUBLE_FAULT_TSS_BASE_SEGMENT << 3); - // setup TLS descriptors (one for every CPU) for (i = 0; i < args->num_cpus; i++) { Deleted: haiku/trunk/src/system/kernel/arch/x86/arch_int.c Copied: haiku/trunk/src/system/kernel/arch/x86/arch_int.cpp (from rev 31963, haiku/trunk/src/system/kernel/arch/x86/arch_int.c) =================================================================== --- haiku/trunk/src/system/kernel/arch/x86/arch_int.c 2009-07-30 10:41:33 UTC (rev 31963) +++ haiku/trunk/src/system/kernel/arch/x86/arch_int.cpp 2009-08-01 01:53:54 UTC (rev 32050) @@ -0,0 +1,1101 @@ +/* + * Copyright 2009, Ingo Weinhold, ingo_weinhold at gmx.de. + * Copyright 2002-2008, Axel D?rfler, axeld at pinc-software.de. + * Distributed under the terms of the MIT License. + * + * Copyright 2001, Travis Geiselbrecht. All rights reserved. + * Distributed under the terms of the NewOS License. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "interrupts.h" + +#include +#include +#include +#include + + +//#define TRACE_ARCH_INT +#ifdef TRACE_ARCH_INT +# define TRACE(x) dprintf x +#else +# define TRACE(x) ; +#endif + +// Definitions for the PIC 8259 controller +// (this is not a complete list, only what we're actually using) + +#define PIC_MASTER_CONTROL 0x20 +#define PIC_MASTER_MASK 0x21 +#define PIC_SLAVE_CONTROL 0xa0 +#define PIC_SLAVE_MASK 0xa1 +#define PIC_MASTER_INIT1 PIC_MASTER_CONTROL +#define PIC_MASTER_INIT2 PIC_MASTER_MASK +#define PIC_MASTER_INIT3 PIC_MASTER_MASK +#define PIC_MASTER_INIT4 PIC_MASTER_MASK +#define PIC_SLAVE_INIT1 PIC_SLAVE_CONTROL +#define PIC_SLAVE_INIT2 PIC_SLAVE_MASK +#define PIC_SLAVE_INIT3 PIC_SLAVE_MASK +#define PIC_SLAVE_INIT4 PIC_SLAVE_MASK + +// the edge/level trigger control registers +#define PIC_MASTER_TRIGGER_MODE 0x4d0 +#define PIC_SLAVE_TRIGGER_MODE 0x4d1 + +#define PIC_INIT1 0x10 +#define PIC_INIT1_SEND_INIT4 0x01 +#define PIC_INIT3_IR2_IS_SLAVE 0x04 +#define PIC_INIT3_SLAVE_ID2 0x02 +#define PIC_INIT4_x86_MODE 0x01 + +#define PIC_CONTROL3 0x08 +#define PIC_CONTROL3_READ_ISR 0x03 +#define PIC_CONTROL3_READ_IRR 0x02 + +#define PIC_NON_SPECIFIC_EOI 0x20 + +#define PIC_SLAVE_INT_BASE 8 +#define PIC_NUM_INTS 0x0f + + +// Definitions for a 82093AA IO APIC controller +#define IO_APIC_IDENTIFICATION 0x00 +#define IO_APIC_VERSION 0x01 +#define IO_APIC_ARBITRATION 0x02 +#define IO_APIC_REDIRECTION_TABLE 0x10 // entry = base + 2 * index + +// Fields for the version register +#define IO_APIC_VERSION_SHIFT 0 +#define IO_APIC_VERSION_MASK 0xff +#define IO_APIC_MAX_REDIRECTION_ENTRY_SHIFT 16 +#define IO_APIC_MAX_REDIRECTION_ENTRY_MASK 0xff + +// Fields of each redirection table entry +#define IO_APIC_DESTINATION_FIELD_SHIFT 56 +#define IO_APIC_DESTINATION_FIELD_MASK 0x0f +#define IO_APIC_INTERRUPT_MASK_SHIFT 16 +#define IO_APIC_INTERRUPT_MASKED 1 +#define IO_APIC_INTERRUPT_UNMASKED 0 +#define IO_APIC_TRIGGER_MODE_SHIFT 15 +#define IO_APIC_TRIGGER_MODE_EDGE 0 +#define IO_APIC_TRIGGER_MODE_LEVEL 1 +#define IO_APIC_REMOTE_IRR_SHIFT 14 +#define IO_APIC_PIN_POLARITY_SHIFT 13 +#define IO_APIC_PIN_POLARITY_HIGH_ACTIVE 0 +#define IO_APIC_PIN_POLARITY_LOW_ACTIVE 1 +#define IO_APIC_DELIVERY_STATUS_SHIFT 12 +#define IO_APIC_DELIVERY_STATUS_IDLE 0 +#define IO_APIC_DELIVERY_STATUS_PENDING 1 +#define IO_APIC_DESTINATION_MODE_SHIFT 11 +#define IO_APIC_DESTINATION_MODE_PHYSICAL 0 +#define IO_APIC_DESTINATION_MODE_LOGICAL 1 +#define IO_APIC_DELIVERY_MODE_SHIFT 8 +#define IO_APIC_DELIVERY_MODE_MASK 0x07 +#define IO_APIC_DELIVERY_MODE_FIXED 0 +#define IO_APIC_DELIVERY_MODE_LOWEST_PRIO 1 +#define IO_APIC_DELIVERY_MODE_SMI 2 +#define IO_APIC_DELIVERY_MODE_NMI 4 +#define IO_APIC_DELIVERY_MODE_INIT 5 +#define IO_APIC_DELIVERY_MODE_EXT_INT 7 +#define IO_APIC_INTERRUPT_VECTOR_SHIFT 0 +#define IO_APIC_INTERRUPT_VECTOR_MASK 0xff + +typedef struct ioapic_s { + volatile uint32 io_register_select; + uint32 reserved[3]; + volatile uint32 io_window_register; +} ioapic; + +static ioapic *sIOAPIC = NULL; +static uint32 sIOAPICMaxRedirectionEntry = 23; +static void *sLocalAPIC = NULL; + +static uint32 sIRQToIOAPICPin[256]; + +bool gUsingIOAPIC = false; + +typedef struct interrupt_controller_s { + const char *name; + void (*enable_io_interrupt)(int32 num); + void (*disable_io_interrupt)(int32 num); + void (*configure_io_interrupt)(int32 num, uint32 config); + bool (*is_spurious_interrupt)(int32 num); + void (*end_of_interrupt)(int32 num); +} interrupt_controller; + +static interrupt_controller *sCurrentPIC = NULL; + + +static const char *kInterruptNames[] = { + /* 0 */ "Divide Error Exception", + /* 1 */ "Debug Exception", + /* 2 */ "NMI Interrupt", + /* 3 */ "Breakpoint Exception", + /* 4 */ "Overflow Exception", + /* 5 */ "BOUND Range Exceeded Exception", + /* 6 */ "Invalid Opcode Exception", + /* 7 */ "Device Not Available Exception", + /* 8 */ "Double Fault Exception", + /* 9 */ "Coprocessor Segment Overrun", + /* 10 */ "Invalid TSS Exception", + /* 11 */ "Segment Not Present", + /* 12 */ "Stack Fault Exception", + /* 13 */ "General Protection Exception", + /* 14 */ "Page-Fault Exception", + /* 15 */ "-", + /* 16 */ "x87 FPU Floating-Point Error", + /* 17 */ "Alignment Check Exception", + /* 18 */ "Machine-Check Exception", + /* 19 */ "SIMD Floating-Point Exception", +}; +static const int kInterruptNameCount = 20; + +#define MAX_ARGS 16 + +typedef struct { + uint32 a, b; +} desc_table; +static desc_table* sIDTs[B_MAX_CPU_COUNT]; + +static uint32 sLevelTriggeredInterrupts = 0; + // binary mask: 1 level, 0 edge + +// table with functions handling respective interrupts +typedef void interrupt_handler_function(struct iframe* frame); +#define INTERRUPT_HANDLER_TABLE_SIZE 256 +interrupt_handler_function* gInterruptHandlerTable[ + INTERRUPT_HANDLER_TABLE_SIZE]; + + +/*! Initializes a descriptor in an IDT. +*/ +static void +set_gate(desc_table *gate_addr, addr_t addr, int type, int dpl) +{ + unsigned int gate1; // first byte of gate desc + unsigned int gate2; // second byte of gate desc + + gate1 = (KERNEL_CODE_SEG << 16) | (0x0000ffff & addr); + gate2 = (0xffff0000 & addr) | 0x8000 | (dpl << 13) | (type << 8); + + gate_addr->a = gate1; + gate_addr->b = gate2; +} + + +/*! Initializes the descriptor for interrupt vector \a n in the IDT of the + boot CPU to an interrupt-gate descriptor with the given procedure address. +*/ +static void +set_interrupt_gate(int n, void (*addr)()) +{ + set_gate(&sIDTs[0][n], (addr_t)addr, 14, DPL_KERNEL); +} + + +/*! Initializes the descriptor for interrupt vector \a n in the IDT of the + boot CPU to an trap-gate descriptor with the given procedure address. +*/ +static void +set_trap_gate(int n, void (*addr)()) +{ + set_gate(&sIDTs[0][n], (unsigned int)addr, 15, DPL_USER); +} + + +/*! Initializes the descriptor for interrupt vector \a n in the IDT of CPU + \a cpu to a task-gate descripter referring to the TSS segment identified + by TSS segment selector \a segment. + For CPUs other than the boot CPU it must not be called before + arch_int_init_post_vm() (arch_cpu_init_post_vm() is fine). +*/ +void +x86_set_task_gate(int32 cpu, int32 n, int32 segment) +{ + sIDTs[cpu][n].a = (segment << 16); + sIDTs[cpu][n].b = 0x8000 | (0 << 13) | (0x5 << 8); // present, dpl 0, type 5 +} + + +/*! Returns the virtual IDT address for CPU \a cpu. */ +void* +x86_get_idt(int32 cpu) +{ + return sIDTs[cpu]; +} + + +/** Tests if the interrupt in-service register of the responsible + * PIC is set for interrupts 7 and 15, and if that's not the case, + * it must assume it's a spurious interrupt. + */ + +static bool +pic_is_spurious_interrupt(int32 num) +{ + int32 isr; + + if (num != 7) + return false; + + // Note, detecting spurious interrupts on line 15 obviously doesn't + // work correctly - and since those are extremely rare, anyway, we + // just ignore them + + out8(PIC_CONTROL3 | PIC_CONTROL3_READ_ISR, PIC_MASTER_CONTROL); + isr = in8(PIC_MASTER_CONTROL); + out8(PIC_CONTROL3 | PIC_CONTROL3_READ_IRR, PIC_MASTER_CONTROL); + + return (isr & 0x80) == 0; +} + + +/** Sends a non-specified EOI (end of interrupt) notice to the PIC in + * question (or both of them). + * This clears the PIC interrupt in-service bit. + */ + +static void +pic_end_of_interrupt(int32 num) +{ + if (num < 0 || num > PIC_NUM_INTS) + return; + + // PIC 8259 controlled interrupt + if (num >= PIC_SLAVE_INT_BASE) + out8(PIC_NON_SPECIFIC_EOI, PIC_SLAVE_CONTROL); + + // we always need to acknowledge the master PIC + out8(PIC_NON_SPECIFIC_EOI, PIC_MASTER_CONTROL); +} + + +static void +pic_enable_io_interrupt(int32 num) +{ + // interrupt is specified "normalized" + if (num < 0 || num > PIC_NUM_INTS) + return; + + // enable PIC 8259 controlled interrupt + + TRACE(("pic_enable_io_interrupt: irq %ld\n", num)); + + if (num < PIC_SLAVE_INT_BASE) + out8(in8(PIC_MASTER_MASK) & ~(1 << num), PIC_MASTER_MASK); + else + out8(in8(PIC_SLAVE_MASK) & ~(1 << (num - PIC_SLAVE_INT_BASE)), PIC_SLAVE_MASK); +} + + +static void +pic_disable_io_interrupt(int32 num) +{ + // interrupt is specified "normalized" + // never disable slave pic line IRQ 2 + if (num < 0 || num > PIC_NUM_INTS || num == 2) + return; + + // disable PIC 8259 controlled interrupt + + TRACE(("pic_disable_io_interrupt: irq %ld\n", num)); + + if (num < PIC_SLAVE_INT_BASE) + out8(in8(PIC_MASTER_MASK) | (1 << num), PIC_MASTER_MASK); + else + out8(in8(PIC_SLAVE_MASK) | (1 << (num - PIC_SLAVE_INT_BASE)), PIC_SLAVE_MASK); +} + + +static void +pic_configure_io_interrupt(int32 num, uint32 config) +{ + uint8 value; + int32 localBit; + if (num < 0 || num > PIC_NUM_INTS || num == 2) + return; + + TRACE(("pic_configure_io_interrupt: irq %ld; config 0x%08lx\n", num, config)); + + if (num < PIC_SLAVE_INT_BASE) { + value = in8(PIC_MASTER_TRIGGER_MODE); + localBit = num; + } else { + value = in8(PIC_SLAVE_TRIGGER_MODE); + localBit = num - PIC_SLAVE_INT_BASE; + } + + if (config & B_LEVEL_TRIGGERED) + value |= 1 << localBit; + else + value &= ~(1 << localBit); + + if (num < PIC_SLAVE_INT_BASE) + out8(value, PIC_MASTER_TRIGGER_MODE); + else + out8(value, PIC_SLAVE_TRIGGER_MODE); + + sLevelTriggeredInterrupts = in8(PIC_MASTER_TRIGGER_MODE) + | (in8(PIC_SLAVE_TRIGGER_MODE) << 8); +} + + +static void +pic_init(void) +{ + static interrupt_controller picController = { + "8259 PIC", + &pic_enable_io_interrupt, + &pic_disable_io_interrupt, + &pic_configure_io_interrupt, + &pic_is_spurious_interrupt, + &pic_end_of_interrupt + }; + + // Start initialization sequence for the master and slave PICs + out8(PIC_INIT1 | PIC_INIT1_SEND_INIT4, PIC_MASTER_INIT1); + out8(PIC_INIT1 | PIC_INIT1_SEND_INIT4, PIC_SLAVE_INIT1); + + // Set start of interrupts to 0x20 for master, 0x28 for slave + out8(ARCH_INTERRUPT_BASE, PIC_MASTER_INIT2); + out8(ARCH_INTERRUPT_BASE + PIC_SLAVE_INT_BASE, PIC_SLAVE_INIT2); + + // Specify cascading through interrupt 2 + out8(PIC_INIT3_IR2_IS_SLAVE, PIC_MASTER_INIT3); + out8(PIC_INIT3_SLAVE_ID2, PIC_SLAVE_INIT3); + + // Set both to operate in 8086 mode + out8(PIC_INIT4_x86_MODE, PIC_MASTER_INIT4); + out8(PIC_INIT4_x86_MODE, PIC_SLAVE_INIT4); + + out8(0xfb, PIC_MASTER_MASK); // Mask off all interrupts (except slave pic line IRQ 2). + out8(0xff, PIC_SLAVE_MASK); // Mask off interrupts on the slave. + + // determine which interrupts are level or edge triggered + +#if 0 + // should set everything possible to level triggered + out8(0xf8, PIC_MASTER_TRIGGER_MODE); + out8(0xde, PIC_SLAVE_TRIGGER_MODE); +#endif + + sLevelTriggeredInterrupts = in8(PIC_MASTER_TRIGGER_MODE) + | (in8(PIC_SLAVE_TRIGGER_MODE) << 8); + + TRACE(("PIC level trigger mode: 0x%08lx\n", sLevelTriggeredInterrupts)); + + // make the pic controller the current one + sCurrentPIC = &picController; + gUsingIOAPIC = false; +} + + +static inline uint32 +ioapic_read_32(uint8 registerSelect) +{ + sIOAPIC->io_register_select = registerSelect; + return sIOAPIC->io_window_register; +} + + +static inline void +ioapic_write_32(uint8 registerSelect, uint32 value) +{ + sIOAPIC->io_register_select = registerSelect; + sIOAPIC->io_window_register = value; +} + + +static inline uint64 +ioapic_read_64(uint8 registerSelect) +{ + uint64 result; + sIOAPIC->io_register_select = registerSelect + 1; + result = sIOAPIC->io_window_register; + result <<= 32; + sIOAPIC->io_register_select = registerSelect; + result |= sIOAPIC->io_window_register; + return result; +} + + +static inline void +ioapic_write_64(uint8 registerSelect, uint64 value) +{ + sIOAPIC->io_register_select = registerSelect; + sIOAPIC->io_window_register = (uint32)value; + sIOAPIC->io_register_select = registerSelect + 1; + sIOAPIC->io_window_register = (uint32)(value >> 32); +} + + +static bool +ioapic_is_spurious_interrupt(int32 num) +{ + // the spurious interrupt vector is initialized to the max value in smp + return num == 0xff - ARCH_INTERRUPT_BASE; +} + + +static void +ioapic_end_of_interrupt(int32 num) +{ + *(volatile uint32 *)((char *)sLocalAPIC + APIC_EOI) = 0; +} + + +static void +ioapic_enable_io_interrupt(int32 num) +{ + uint64 entry; + int32 pin = sIRQToIOAPICPin[num]; + if (pin < 0 || pin > (int32)sIOAPICMaxRedirectionEntry) + return; + + TRACE(("ioapic_enable_io_interrupt: IRQ %ld -> pin %ld\n", num, pin)); + + entry = ioapic_read_64(IO_APIC_REDIRECTION_TABLE + pin * 2); + entry &= ~(1 << IO_APIC_INTERRUPT_MASK_SHIFT); + entry |= IO_APIC_INTERRUPT_UNMASKED << IO_APIC_INTERRUPT_MASK_SHIFT; + ioapic_write_64(IO_APIC_REDIRECTION_TABLE + pin * 2, entry); +} + + +static void +ioapic_disable_io_interrupt(int32 num) +{ + uint64 entry; + int32 pin = sIRQToIOAPICPin[num]; + if (pin < 0 || pin > (int32)sIOAPICMaxRedirectionEntry) + return; + + TRACE(("ioapic_disable_io_interrupt: IRQ %ld -> pin %ld\n", num, pin)); + + entry = ioapic_read_64(IO_APIC_REDIRECTION_TABLE + pin * 2); + entry &= ~(1 << IO_APIC_INTERRUPT_MASK_SHIFT); + entry |= IO_APIC_INTERRUPT_MASKED << IO_APIC_INTERRUPT_MASK_SHIFT; + ioapic_write_64(IO_APIC_REDIRECTION_TABLE + pin * 2, entry); +} + + +static void +ioapic_configure_io_interrupt(int32 num, uint32 config) +{ + uint64 entry; + int32 pin = sIRQToIOAPICPin[num]; + if (pin < 0 || pin > (int32)sIOAPICMaxRedirectionEntry) + return; + + TRACE(("ioapic_configure_io_interrupt: IRQ %ld -> pin %ld; config 0x%08lx\n", + num, pin, config)); + + entry = ioapic_read_64(IO_APIC_REDIRECTION_TABLE + pin * 2); + entry &= ~((1 << IO_APIC_TRIGGER_MODE_SHIFT) + | (1 << IO_APIC_PIN_POLARITY_SHIFT) + | (IO_APIC_INTERRUPT_VECTOR_MASK << IO_APIC_INTERRUPT_VECTOR_SHIFT)); + + if (config & B_LEVEL_TRIGGERED) { + entry |= (IO_APIC_TRIGGER_MODE_LEVEL << IO_APIC_TRIGGER_MODE_SHIFT); + sLevelTriggeredInterrupts |= (1 << num); + } else { + entry |= (IO_APIC_TRIGGER_MODE_EDGE << IO_APIC_TRIGGER_MODE_SHIFT); + sLevelTriggeredInterrupts &= ~(1 << num); + } + + if (config & B_LOW_ACTIVE_POLARITY) + entry |= (IO_APIC_PIN_POLARITY_LOW_ACTIVE << IO_APIC_PIN_POLARITY_SHIFT); + else + entry |= (IO_APIC_PIN_POLARITY_HIGH_ACTIVE << IO_APIC_PIN_POLARITY_SHIFT); + + entry |= (num + ARCH_INTERRUPT_BASE) << IO_APIC_INTERRUPT_VECTOR_SHIFT; + ioapic_write_64(IO_APIC_REDIRECTION_TABLE + pin * 2, entry); +} + + +static void +ioapic_init(kernel_args *args) +{ + uint32 i; + uint32 version; + uint64 targetAPIC; + void *settings; + acpi_module_info *acpi; + + static interrupt_controller ioapicController = { + "82093AA IOAPIC", + &ioapic_enable_io_interrupt, + &ioapic_disable_io_interrupt, + &ioapic_configure_io_interrupt, + &ioapic_is_spurious_interrupt, + &ioapic_end_of_interrupt + }; + + if (args->arch_args.apic == NULL) { + dprintf("no local apic available\n"); + return; + } + + // always map the local apic as it can be used for timers even if we + // don't end up using the io apic + sLocalAPIC = args->arch_args.apic; + if (map_physical_memory("local apic", (void *)args->arch_args.apic_phys, + B_PAGE_SIZE, B_EXACT_ADDRESS, B_KERNEL_READ_AREA + | B_KERNEL_WRITE_AREA, &sLocalAPIC) < B_OK) { + panic("mapping the local apic failed"); + return; + } + + if (args->arch_args.ioapic == NULL) { + dprintf("no ioapic available, not using ioapics for interrupt routing\n"); + return; + } + + settings = load_driver_settings(B_SAFEMODE_DRIVER_SETTINGS); + if (settings != NULL && get_driver_boolean_parameter(settings, + B_SAFEMODE_DISABLE_IOAPIC, false, false)) { + dprintf("ioapic explicitly disabled, not using ioapics for interrupt routing\n"); + unload_driver_settings(settings); + return; + } else if (settings != NULL) + unload_driver_settings(settings); + + // TODO: remove when the PCI IRQ routing through ACPI is available below + return; + if (get_module(B_ACPI_MODULE_NAME, (module_info **)&acpi) != B_OK) { + dprintf("acpi module not available, not configuring ioapic\n"); + return; + } + + // map in the ioapic + sIOAPIC = (ioapic *)args->arch_args.ioapic; + if (map_physical_memory("ioapic", (void *)args->arch_args.ioapic_phys, + B_PAGE_SIZE, B_EXACT_ADDRESS, B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA, + (void **)&sIOAPIC) < B_OK) { + panic("mapping the ioapic failed"); + return; + } + + version = ioapic_read_32(IO_APIC_VERSION); + if (version == 0xffffffff) { + dprintf("ioapic seems inaccessible, not using it\n"); + return; + } + + sLevelTriggeredInterrupts = 0; + sIOAPICMaxRedirectionEntry + = ((version >> IO_APIC_MAX_REDIRECTION_ENTRY_SHIFT) + & IO_APIC_MAX_REDIRECTION_ENTRY_MASK); + + // use the boot CPU as the target for all interrupts + targetAPIC = args->arch_args.cpu_apic_id[0]; + + // program the interrupt vectors of the ioapic + for (i = 0; i <= sIOAPICMaxRedirectionEntry; i++) { + // initialize everything to deliver to the boot CPU in physical mode + // and masked until explicitly enabled through enable_io_interrupt() + uint64 entry = (targetAPIC << IO_APIC_DESTINATION_FIELD_SHIFT) + | (IO_APIC_INTERRUPT_MASKED << IO_APIC_INTERRUPT_MASK_SHIFT) + | (IO_APIC_DESTINATION_MODE_PHYSICAL << IO_APIC_DESTINATION_MODE_SHIFT) + | ((i + ARCH_INTERRUPT_BASE) << IO_APIC_INTERRUPT_VECTOR_SHIFT); + + if (i == 0) { + // make redirection entry 0 into an external interrupt + entry |= (IO_APIC_TRIGGER_MODE_EDGE << IO_APIC_TRIGGER_MODE_SHIFT) + | (IO_APIC_PIN_POLARITY_HIGH_ACTIVE << IO_APIC_PIN_POLARITY_SHIFT) + | (IO_APIC_DELIVERY_MODE_EXT_INT << IO_APIC_DELIVERY_MODE_SHIFT); + } else if (i < 16) { + // make 1-15 ISA interrupts + entry |= (IO_APIC_TRIGGER_MODE_EDGE << IO_APIC_TRIGGER_MODE_SHIFT) + | (IO_APIC_PIN_POLARITY_HIGH_ACTIVE << IO_APIC_PIN_POLARITY_SHIFT) + | (IO_APIC_DELIVERY_MODE_FIXED << IO_APIC_DELIVERY_MODE_SHIFT); + } else { + // and the rest are PCI interrupts + entry |= (IO_APIC_TRIGGER_MODE_LEVEL << IO_APIC_TRIGGER_MODE_SHIFT) + | (IO_APIC_PIN_POLARITY_LOW_ACTIVE << IO_APIC_PIN_POLARITY_SHIFT) + | (IO_APIC_DELIVERY_MODE_FIXED << IO_APIC_DELIVERY_MODE_SHIFT); + sLevelTriggeredInterrupts |= (1 << i); + } + + ioapic_write_64(IO_APIC_REDIRECTION_TABLE + 2 * i, entry); + } + + // setup default 1:1 mapping + for (i = 0; i < 256; i++) + sIRQToIOAPICPin[i] = i; + + // TODO: here ACPI needs to be used to properly set up the PCI IRQ + // routing. + + // prefer the ioapic over the normal pic + put_module(B_ACPI_MODULE_NAME); + dprintf("using ioapic for interrupt routing\n"); + sCurrentPIC = &ioapicController; + gUsingIOAPIC = true; +} + + +void +arch_int_enable_io_interrupt(int irq) +{ + sCurrentPIC->enable_io_interrupt(irq); +} + + +void +arch_int_disable_io_interrupt(int irq) +{ + sCurrentPIC->disable_io_interrupt(irq); +} + + +void +arch_int_configure_io_interrupt(int irq, uint32 config) +{ + sCurrentPIC->configure_io_interrupt(irq, config); +} + + +#undef arch_int_enable_interrupts +#undef arch_int_disable_interrupts +#undef arch_int_restore_interrupts +#undef arch_int_are_interrupts_enabled + + +void +arch_int_enable_interrupts(void) +{ + arch_int_enable_interrupts_inline(); +} + + +int +arch_int_disable_interrupts(void) +{ + return arch_int_disable_interrupts_inline(); +} + + +void +arch_int_restore_interrupts(int oldstate) +{ + arch_int_restore_interrupts_inline(oldstate); +} + + +bool +arch_int_are_interrupts_enabled(void) +{ + return arch_int_are_interrupts_enabled_inline(); +} + + +static const char * +exception_name(int number, char *buffer, int32 bufferSize) +{ + if (number >= 0 && number < kInterruptNameCount) + return kInterruptNames[number]; + + snprintf(buffer, bufferSize, "exception %d", number); + return buffer; +} + + +static void +invalid_exception(struct iframe* frame) +{ + struct thread* thread = thread_get_current_thread(); + char name[32]; + panic("unhandled trap 0x%lx (%s) at ip 0x%lx, thread %ld!\n", + frame->vector, exception_name(frame->vector, name, sizeof(name)), + frame->eip, thread ? thread->id : -1); +} + + +static void +fatal_exception(struct iframe *frame) +{ + char name[32]; + panic("Fatal exception \"%s\" occurred! Error code: 0x%lx\n", + exception_name(frame->vector, name, sizeof(name)), frame->error_code); +} + + +static void +unexpected_exception(struct iframe* frame) +{ + debug_exception_type type; + int signal; + + if (IFRAME_IS_VM86(frame)) { + x86_vm86_return((struct vm86_iframe *)frame, (frame->vector == 13) ? + B_OK : B_ERROR); + // won't get here + } + + switch (frame->vector) { + case 0: // Divide Error Exception (#DE) + type = B_DIVIDE_ERROR; + signal = SIGFPE; + break; + + case 4: // Overflow Exception (#OF) + type = B_OVERFLOW_EXCEPTION; + signal = SIGTRAP; + break; + + case 5: // BOUND Range Exceeded Exception (#BR) + type = B_BOUNDS_CHECK_EXCEPTION; + signal = SIGTRAP; + break; + + case 6: // Invalid Opcode Exception (#UD) + type = B_INVALID_OPCODE_EXCEPTION; + signal = SIGILL; + break; + + case 13: // General Protection Exception (#GP) + type = B_GENERAL_PROTECTION_FAULT; + signal = SIGILL; + break; + + case 16: // x87 FPU Floating-Point Error (#MF) + type = B_FLOATING_POINT_EXCEPTION; + signal = SIGFPE; + break; + + case 17: // Alignment Check Exception (#AC) + type = B_ALIGNMENT_EXCEPTION; + signal = SIGTRAP; + break; + + case 19: // SIMD Floating-Point Exception (#XF) + type = B_FLOATING_POINT_EXCEPTION; + signal = SIGFPE; + break; + + default: + invalid_exception(frame); + return; + } + + if (IFRAME_IS_USER(frame)) { + struct sigaction action; + struct thread* thread = thread_get_current_thread(); + + enable_interrupts(); + + // If the thread has a signal handler for the signal, we simply send it + // the signal. Otherwise we notify the user debugger first. + if (sigaction(signal, NULL, &action) == 0 + && action.sa_handler != SIG_DFL + && action.sa_handler != SIG_IGN) { + send_signal(thread->id, signal); + } else if (user_debug_exception_occurred(type, signal)) + send_signal(team_get_current_team_id(), signal); + } else { + char name[32]; + panic("Unexpected exception \"%s\" occurred in kernel mode! " + "Error code: 0x%lx\n", + exception_name(frame->vector, name, sizeof(name)), + frame->error_code); + } +} + + +void +x86_double_fault_exception(struct iframe* frame) +{ + int cpu = x86_double_fault_get_cpu(); + + // The double fault iframe contains no useful information (as + // per Intel's architecture spec). Thus we simply save the + // information from the (unhandlable) exception which caused the + // double in our iframe. This will result even in useful stack + // traces. Only problem is that we trust that at least the + // TSS is still accessible. + struct tss *tss = &gCPU[cpu].arch.tss; + + frame->cs = tss->cs; + frame->es = tss->es; + frame->ds = tss->ds; + frame->fs = tss->fs; + frame->gs = tss->gs; + frame->eip = tss->eip; + frame->ebp = tss->ebp; + frame->esp = tss->esp; + frame->eax = tss->eax; + frame->ebx = tss->ebx; + frame->ecx = tss->ecx; + frame->edx = tss->edx; + frame->esi = tss->esi; + frame->edi = tss->edi; + frame->flags = tss->eflags; + + debug_double_fault(cpu); +} + + +static void +page_fault_exception(struct iframe* frame) [... truncated: 703 lines follow ...] From stippi at mail.berlios.de Sat Aug 1 03:54:49 2009 From: stippi at mail.berlios.de (stippi at mail.berlios.de) Date: Sat, 1 Aug 2009 03:54:49 +0200 Subject: [Haiku-commits] r32051 - haiku/trunk/src/apps/mediaconverter Message-ID: <200908010154.n711snrk027451@sheep.berlios.de> Author: stippi Date: 2009-08-01 03:54:48 +0200 (Sat, 01 Aug 2009) New Revision: 32051 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32051&view=rev Modified: haiku/trunk/src/apps/mediaconverter/MediaConverterApp.cpp Log: This should transfer the display aspect ratio correctly... Modified: haiku/trunk/src/apps/mediaconverter/MediaConverterApp.cpp =================================================================== --- haiku/trunk/src/apps/mediaconverter/MediaConverterApp.cpp 2009-08-01 01:53:54 UTC (rev 32050) +++ haiku/trunk/src/apps/mediaconverter/MediaConverterApp.cpp 2009-08-01 01:54:48 UTC (rev 32051) @@ -395,6 +395,18 @@ printf("fixing color space (B_RGBA32 -> B_RGB32)"); rvf->display.format = B_RGB32; } + // Transfer the display aspect ratio. + if (inFormat.type == B_MEDIA_ENCODED_VIDEO) { + rvf->pixel_width_aspect + = inFormat.u.encoded_video.output.pixel_width_aspect; + rvf->pixel_height_aspect + = inFormat.u.encoded_video.output.pixel_height_aspect; + } else { + rvf->pixel_width_aspect + = inFormat.u.raw_video.pixel_width_aspect; + rvf->pixel_height_aspect + = inFormat.u.raw_video.pixel_height_aspect; + } videoBuffer = new (nothrow) uint8[height * rvf->display.bytes_per_row]; outVidTrack = outFile->CreateTrack(&outVidFormat, videoCodec); From anevilyak at gmail.com Sat Aug 1 03:58:16 2009 From: anevilyak at gmail.com (Rene Gollent) Date: Fri, 31 Jul 2009 20:58:16 -0500 Subject: [Haiku-commits] r32050 - in haiku/trunk: headers/private/kernel headers/private/kernel/arch/x86 src/system/kernel src/system/kernel/arch/x86 src/system/kernel/debug In-Reply-To: <200908010154.n711s1X0027348@sheep.berlios.de> References: <200908010154.n711s1X0027348@sheep.berlios.de> Message-ID: On Fri, Jul 31, 2009 at 8:54 PM, wrote: > Author: bonefish > Date: 2009-08-01 03:53:54 +0200 (Sat, 01 Aug 2009) > New Revision: 32050 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32050&view=rev > > ? ?disabled and gets the CPU index, so it doesn't have to use > ? ?smp_get_current_cpu() (which dereferences the current thread). Just curious, is there any reason not to use the non-dereferencing version in general? Is it slower, or does it specifically rely on information that only applies on the double fault stack? Nice changes! Regards, Rene From stippi at mail.berlios.de Sat Aug 1 03:59:35 2009 From: stippi at mail.berlios.de (stippi at mail.berlios.de) Date: Sat, 1 Aug 2009 03:59:35 +0200 Subject: [Haiku-commits] r32052 - haiku/trunk/src/add-ons/media/plugins/ffmpeg Message-ID: <200908010159.n711xZ0B028177@sheep.berlios.de> Author: stippi Date: 2009-08-01 03:59:34 +0200 (Sat, 01 Aug 2009) New Revision: 32052 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32052&view=rev Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp Log: Quiet down some debug output. Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp 2009-08-01 01:54:48 UTC (rev 32051) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp 2009-08-01 01:59:34 UTC (rev 32052) @@ -18,9 +18,11 @@ #undef TRACE #define TRACE_AV_CODEC_ENCODER #ifdef TRACE_AV_CODEC_ENCODER -# define TRACE(x...) printf(x) +# define TRACE printf +# define TRACE_IO(a...) #else -# define TRACE(x...) +# define TRACE(a...) +# define TRACE_IO(a...) #endif @@ -233,7 +235,7 @@ AVCodecEncoder::_EncodeVideo(const void* buffer, int64 frameCount, media_encode_info* info) { - TRACE("AVCodecEncoder::_EncodeVideo(%p, %lld, %p)\n", buffer, frameCount, + TRACE_IO("AVCodecEncoder::_EncodeVideo(%p, %lld, %p)\n", buffer, frameCount, info); if (fChunkBuffer == NULL) @@ -244,7 +246,6 @@ while (frameCount > 0) { size_t bpr = fInputFormat.u.raw_video.display.bytes_per_row; size_t bufferSize = fInputFormat.u.raw_video.display.line_count * bpr; - TRACE(" bytes per row: %ld, buffer size: %ld\n", bpr, bufferSize); // We should always get chunky bitmaps, so this code should be safe. fSrcFrame.data[0] = (uint8_t*)buffer; From anevilyak at gmail.com Sat Aug 1 04:24:43 2009 From: anevilyak at gmail.com (Rene Gollent) Date: Fri, 31 Jul 2009 21:24:43 -0500 Subject: [Haiku-commits] r32049 - haiku/trunk/src/preferences/screen In-Reply-To: <200908010147.n711lgRA026400@sheep.berlios.de> References: <200908010147.n711lgRA026400@sheep.berlios.de> Message-ID: On Fri, Jul 31, 2009 at 8:47 PM, wrote: > Author: axeld > Date: 2009-08-01 03:47:40 +0200 (Sat, 01 Aug 2009) > New Revision: 32049 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32049&view=rev > Log: > * Added many many more vendors, thanks to Brecht for digging up a nice web > ?resource that I couldn't find! Also thanks to Jonas and Urias :-) I have some more of these...should I send you a diff or just add them directly? Don't want to step on your toes :) Regards, Rene From anevilyak at mail.berlios.de Sat Aug 1 06:20:57 2009 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Sat, 1 Aug 2009 06:20:57 +0200 Subject: [Haiku-commits] r32053 - haiku/trunk/src/kits/interface Message-ID: <200908010420.n714KvEX021663@sheep.berlios.de> Author: anevilyak Date: 2009-08-01 06:20:56 +0200 (Sat, 01 Aug 2009) New Revision: 32053 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32053&view=rev Modified: haiku/trunk/src/kits/interface/ListView.cpp Log: Fix some regressions in keyboard shift selection behavior introduced by the last set of changes. Modified: haiku/trunk/src/kits/interface/ListView.cpp =================================================================== --- haiku/trunk/src/kits/interface/ListView.cpp 2009-08-01 01:59:34 UTC (rev 32052) +++ haiku/trunk/src/kits/interface/ListView.cpp 2009-08-01 04:20:56 UTC (rev 32053) @@ -414,7 +414,7 @@ bool extend = fListType == B_MULTIPLE_SELECTION_LIST && (modifiers() & B_SHIFT_KEY) != 0; - + switch (bytes[0]) { case B_UP_ARROW: { @@ -424,9 +424,9 @@ } else { if (fAnchorIndex > 0) { if (!extend || fAnchorIndex <= fFirstSelected) - Select(fAnchorIndex - 1, extend); + Select(--fAnchorIndex, extend); else - Deselect(fAnchorIndex); + Deselect(fAnchorIndex--); } } @@ -441,9 +441,9 @@ } else { if (fAnchorIndex < CountItems() - 1) { if (!extend || fAnchorIndex >= fLastSelected) - Select(fAnchorIndex + 1, extend); + Select(++fAnchorIndex, extend); else - Deselect(fAnchorIndex); + Deselect(fAnchorIndex++); } } @@ -456,6 +456,7 @@ Select(0, fAnchorIndex, true); else Select(0, false); + fAnchorIndex = 0; ScrollToSelection(); break; case B_END: @@ -463,6 +464,7 @@ Select(fAnchorIndex, CountItems() - 1, true); else Select(CountItems() - 1, false); + fAnchorIndex = CountItems() - 1; ScrollToSelection(); break; From anevilyak at mail.berlios.de Sat Aug 1 06:21:51 2009 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Sat, 1 Aug 2009 06:21:51 +0200 Subject: [Haiku-commits] r32054 - haiku/trunk/src/preferences/screen Message-ID: <200908010421.n714LpNn021717@sheep.berlios.de> Author: anevilyak Date: 2009-08-01 06:21:50 +0200 (Sat, 01 Aug 2009) New Revision: 32054 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32054&view=rev Modified: haiku/trunk/src/preferences/screen/ScreenMode.cpp Log: Add some more vendor IDs gleaned from some of my monitors here, Urias and one of linux's EDID quirks files. Modified: haiku/trunk/src/preferences/screen/ScreenMode.cpp =================================================================== --- haiku/trunk/src/preferences/screen/ScreenMode.cpp 2009-08-01 04:20:56 UTC (rev 32053) +++ haiku/trunk/src/preferences/screen/ScreenMode.cpp 2009-08-01 04:21:50 UTC (rev 32054) @@ -348,6 +348,7 @@ case 'ADI\0': strcpy(info.vendor, "ADI MicroScan"); break; + case 'ACR\0': case 'API\0': strcpy(info.vendor, "Acer"); break; @@ -382,12 +383,19 @@ case 'ENC\0': strcpy(info.vendor, "Eizo"); break; + case 'EPI\0': + strcpy(info.vendor, "Envision Peripherals"); + break; + case 'FCM\0': + strcpy(info.vendor, "Funai Electronics"); + break; case 'FUS\0': strcpy(info.vendor, "Fujitsu-Siemens"); break; case 'GSM\0': strcpy(info.vendor, "LG"); break; + case 'HIQ\0': case 'HEI\0': strcpy(info.vendor, "Hyundai"); break; @@ -410,6 +418,9 @@ case 'LEN\0': strcpy(info.vendor, "Lenovo"); break; + case 'LPL\0': + strcpy(info.vendor, "LG Phillips"); + break; case 'MAX\0': strcpy(info.vendor, "Maxdata"); break; @@ -437,6 +448,9 @@ case 'PHL\0': strcpy(info.vendor, "Philips"); break; + case 'PTS\0': + strcpy(info.vendor, "Proview"); + break; case 'QDS\0': strcpy(info.vendor, "Quanta Display"); break; From anevilyak at mail.berlios.de Sat Aug 1 06:33:40 2009 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Sat, 1 Aug 2009 06:33:40 +0200 Subject: [Haiku-commits] r32055 - haiku/trunk/src/preferences/screen Message-ID: <200908010433.n714Xedp024675@sheep.berlios.de> Author: anevilyak Date: 2009-08-01 06:33:38 +0200 (Sat, 01 Aug 2009) New Revision: 32055 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32055&view=rev Modified: haiku/trunk/src/preferences/screen/ScreenMode.cpp Log: Added vendor ID for Gateway. Thanks Urias! Modified: haiku/trunk/src/preferences/screen/ScreenMode.cpp =================================================================== --- haiku/trunk/src/preferences/screen/ScreenMode.cpp 2009-08-01 04:21:50 UTC (rev 32054) +++ haiku/trunk/src/preferences/screen/ScreenMode.cpp 2009-08-01 04:33:38 UTC (rev 32055) @@ -395,6 +395,9 @@ case 'GSM\0': strcpy(info.vendor, "LG"); break; + case 'GWY\0': + strcpy(info.vendor, "Gateway"); + break; case 'HIQ\0': case 'HEI\0': strcpy(info.vendor, "Hyundai"); From stefano.ceccherini at gmail.com Sat Aug 1 09:52:08 2009 From: stefano.ceccherini at gmail.com (Stefano Ceccherini) Date: Sat, 1 Aug 2009 09:52:08 +0200 Subject: [Haiku-commits] r32035 - in haiku/trunk: headers/os/support src/kits/support In-Reply-To: <200907312113.n6VLDLEP008679@sheep.berlios.de> References: <200907312113.n6VLDLEP008679@sheep.berlios.de> Message-ID: <894b9700908010052w4fb9b003q395b6c1593c01a01@mail.gmail.com> 2009/7/31 : > Author: axeld > Date: 2009-07-31 23:13:19 +0200 (Fri, 31 Jul 2009) > New Revision: 32035 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32035&view=rev > > Modified: > ? haiku/trunk/headers/os/support/String.h > ? haiku/trunk/src/kits/support/String.cpp > Log: > * Added desperately missing Trim() method. And Trim Left(), and TrimRight() ? :-) From jackburton at mail.berlios.de Sat Aug 1 10:14:20 2009 From: jackburton at mail.berlios.de (jackburton at mail.berlios.de) Date: Sat, 1 Aug 2009 10:14:20 +0200 Subject: [Haiku-commits] r32056 - in haiku/trunk: headers/private/interface src/kits/interface Message-ID: <200908010814.n718EKUG017800@sheep.berlios.de> Author: jackburton Date: 2009-08-01 10:14:18 +0200 (Sat, 01 Aug 2009) New Revision: 32056 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32056&view=rev Modified: haiku/trunk/headers/private/interface/MenuPrivate.h haiku/trunk/src/kits/interface/Menu.cpp haiku/trunk/src/kits/interface/MenuPrivate.cpp Log: Some cleanups: made the bitmaps static, moved variables around. No functional change. Modified: haiku/trunk/headers/private/interface/MenuPrivate.h =================================================================== --- haiku/trunk/headers/private/interface/MenuPrivate.h 2009-08-01 04:33:38 UTC (rev 32055) +++ haiku/trunk/headers/private/interface/MenuPrivate.h 2009-08-01 08:14:18 UTC (rev 32056) @@ -17,11 +17,14 @@ MENU_STATE_CLOSED = 5 }; + class BBitmap; class BMenu; class BWindow; namespace BPrivate { + +extern const char *kEmptyMenuLabel; class MenuPrivate { public: @@ -37,7 +40,8 @@ BRect Padding() const; void GetItemMargins(float *, float *, float *, float *) const; - bool IsAltCommandKey() const; + static bool IsAltCommandKey(); + int State(BMenuItem **item = NULL) const; void Install(BWindow *window); @@ -56,18 +60,18 @@ static const BBitmap *MenuItemShift(); private: BMenu *fMenu; + + static BBitmap *sMenuItemAlt; + static BBitmap *sMenuItemControl; + static BBitmap *sMenuItemOption; + static BBitmap *sMenuItemShift; + }; -extern BBitmap *gMenuItemAlt; -extern BBitmap *gMenuItemControl; -extern BBitmap *gMenuItemOption; -extern BBitmap *gMenuItemShift; }; -extern const char *kEmptyMenuLabel; - // Note: since sqrt is slow, we don't use it and return the square of the distance #define square(x) ((x) * (x)) static inline float Modified: haiku/trunk/src/kits/interface/Menu.cpp =================================================================== --- haiku/trunk/src/kits/interface/Menu.cpp 2009-08-01 04:33:38 UTC (rev 32055) +++ haiku/trunk/src/kits/interface/Menu.cpp 2009-08-01 08:14:18 UTC (rev 32056) @@ -173,7 +173,7 @@ }; -const char *kEmptyMenuLabel = ""; +const char *BPrivate::kEmptyMenuLabel = ""; struct BMenu::LayoutData { @@ -2667,7 +2667,8 @@ } } else { _CacheFontInfo(); - window->ResizeTo(StringWidth(kEmptyMenuLabel) + fPad.left + fPad.right, + window->ResizeTo(StringWidth(BPrivate::kEmptyMenuLabel) + + fPad.left + fPad.right, fFontHeight + fPad.top + fPad.bottom); } Modified: haiku/trunk/src/kits/interface/MenuPrivate.cpp =================================================================== --- haiku/trunk/src/kits/interface/MenuPrivate.cpp 2009-08-01 04:33:38 UTC (rev 32055) +++ haiku/trunk/src/kits/interface/MenuPrivate.cpp 2009-08-01 08:14:18 UTC (rev 32056) @@ -72,11 +72,13 @@ namespace BPrivate { -BBitmap *gMenuItemAlt; -BBitmap *gMenuItemControl; -BBitmap *gMenuItemOption; -BBitmap *gMenuItemShift; +BBitmap* MenuPrivate::sMenuItemAlt; +BBitmap* MenuPrivate::sMenuItemControl; +BBitmap* MenuPrivate::sMenuItemOption; +BBitmap* MenuPrivate::sMenuItemShift; + + MenuPrivate::MenuPrivate(BMenu *menu) : fMenu(menu) @@ -134,10 +136,11 @@ } +/* static */ bool -MenuPrivate::IsAltCommandKey() const +MenuPrivate::IsAltCommandKey() { - return fMenu->sAltAsCommandKey; + return BMenu::sAltAsCommandKey; } @@ -197,21 +200,21 @@ BRect smallRect(0, 0, 16, 10); BRect largeRect(0, 0, 21, 10); try { - gMenuItemAlt = new BBitmap(smallRect, B_CMAP8); - gMenuItemControl = new BBitmap(smallRect, B_CMAP8); - gMenuItemOption = new BBitmap(smallRect, B_CMAP8); - gMenuItemShift = new BBitmap(largeRect, B_CMAP8); + sMenuItemAlt = new BBitmap(smallRect, B_CMAP8); + sMenuItemControl = new BBitmap(smallRect, B_CMAP8); + sMenuItemOption = new BBitmap(smallRect, B_CMAP8); + sMenuItemShift = new BBitmap(largeRect, B_CMAP8); } catch (...) { return B_NO_MEMORY; } - gMenuItemAlt->ImportBits(kAltBits, sizeof(kAltBits), + sMenuItemAlt->ImportBits(kAltBits, sizeof(kAltBits), 17, 0, B_CMAP8); - gMenuItemControl->ImportBits(kCtrlBits, sizeof(kCtrlBits), + sMenuItemControl->ImportBits(kCtrlBits, sizeof(kCtrlBits), 17, 0, B_CMAP8); - gMenuItemOption->ImportBits(kOptBits, sizeof(kOptBits), + sMenuItemOption->ImportBits(kOptBits, sizeof(kOptBits), 17, 0, B_CMAP8); - gMenuItemShift->ImportBits(kShiftBits, sizeof(kShiftBits), + sMenuItemShift->ImportBits(kShiftBits, sizeof(kShiftBits), 22, 0, B_CMAP8); return B_OK; @@ -222,10 +225,10 @@ void MenuPrivate::DeleteBitmaps() { - delete gMenuItemAlt; - delete gMenuItemControl; - delete gMenuItemOption; - delete gMenuItemShift; + delete sMenuItemAlt; + delete sMenuItemControl; + delete sMenuItemOption; + delete sMenuItemShift; } @@ -234,9 +237,9 @@ MenuPrivate::MenuItemCommand() { if (BMenu::sAltAsCommandKey) - return gMenuItemAlt; + return sMenuItemAlt; - return gMenuItemControl; + return sMenuItemControl; } @@ -245,9 +248,9 @@ MenuPrivate::MenuItemControl() { if (BMenu::sAltAsCommandKey) - return gMenuItemControl; + return sMenuItemControl; - return gMenuItemAlt; + return sMenuItemAlt; } @@ -255,7 +258,7 @@ const BBitmap * MenuPrivate::MenuItemOption() { - return gMenuItemOption; + return sMenuItemOption; } @@ -263,7 +266,7 @@ const BBitmap * MenuPrivate::MenuItemShift() { - return gMenuItemShift; + return sMenuItemShift; } From revol at free.fr Sat Aug 1 11:25:46 2009 From: revol at free.fr (=?utf-8?q?Fran=C3=A7ois?= Revol) Date: Sat, 01 Aug 2009 11:25:46 +0200 CEST Subject: [Haiku-commits] r32041 - haiku/trunk/src/preferences/screen In-Reply-To: <200907312325.n6VNPNox019197@sheep.berlios.de> Message-ID: <1978386275-BeMail@laptop> > Author: axeld > Date: 2009-08-01 01:25:21 +0200 (Sat, 01 Aug 2009) > New Revision: 32041 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32041&view=rev > > Modified: > haiku/trunk/src/preferences/screen/ScreenMode.cpp > Log: > * Added two more vendors found by Urias, thanks! If anyone has a SONY > (SNY?), > Dell, or Acer monitor, those are still missing as well. Btw, for those who have GNU/Linux boxen, you can check /var/log/ Xorg.0.log Oddly I do have an EDID for this antique CRT monitor here. Oddly too, IIRC I had to select a "generic monitor" in the X11 config because it was too dumb to use it ;) The EDID seems to be DPC From jackburton at mail.berlios.de Sat Aug 1 11:39:49 2009 From: jackburton at mail.berlios.de (jackburton at mail.berlios.de) Date: Sat, 1 Aug 2009 11:39:49 +0200 Subject: [Haiku-commits] r32057 - haiku/trunk/src/apps/haiku3d Message-ID: <200908010939.n719dnVl024999@sheep.berlios.de> Author: jackburton Date: 2009-08-01 11:39:46 +0200 (Sat, 01 Aug 2009) New Revision: 32057 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32057&view=rev Modified: haiku/trunk/src/apps/haiku3d/Jamfile haiku/trunk/src/apps/haiku3d/MathUtils.cpp haiku/trunk/src/apps/haiku3d/RenderView.cpp Log: Fixed build with gcc4 Modified: haiku/trunk/src/apps/haiku3d/Jamfile =================================================================== --- haiku/trunk/src/apps/haiku3d/Jamfile 2009-08-01 08:14:18 UTC (rev 32056) +++ haiku/trunk/src/apps/haiku3d/Jamfile 2009-08-01 09:39:46 UTC (rev 32057) @@ -22,6 +22,6 @@ BitmapTexture.cpp VideoFileTexture.cpp - : be game GL media translation + : be game GL media translation $(TARGET_LIBSUPC++) : Haiku3d.rdef ; Modified: haiku/trunk/src/apps/haiku3d/MathUtils.cpp =================================================================== --- haiku/trunk/src/apps/haiku3d/MathUtils.cpp 2009-08-01 08:14:18 UTC (rev 32056) +++ haiku/trunk/src/apps/haiku3d/MathUtils.cpp 2009-08-01 09:39:46 UTC (rev 32057) @@ -11,7 +11,9 @@ #include "MathUtils.h" +#include + float MathUtils::EaseInOutCubic(float t /*time*/, float b /*begin*/, float c /*distance*/, float d /*duration*/) { Modified: haiku/trunk/src/apps/haiku3d/RenderView.cpp =================================================================== --- haiku/trunk/src/apps/haiku3d/RenderView.cpp 2009-08-01 08:14:18 UTC (rev 32056) +++ haiku/trunk/src/apps/haiku3d/RenderView.cpp 2009-08-01 09:39:46 UTC (rev 32057) @@ -20,6 +20,8 @@ #include #include +#include + RenderView::RenderView(BRect frame) : BGLView(frame, "renderView", B_FOLLOW_ALL, B_WILL_DRAW, From clemens.zeidler at rwth-aachen.de Sat Aug 1 11:53:02 2009 From: clemens.zeidler at rwth-aachen.de (Clemens zeidler) Date: Sat, 01 Aug 2009 11:53:02 +0200 Subject: [Haiku-commits] r31990 - haiku/trunk/src/apps/powerstatus In-Reply-To: References: <200907301828.n6UISaHg005813@sheep.berlios.de> <37901446270-BeMail@zon> Message-ID: On Thu, 30 Jul 2009 22:49:39 +0200, Ryan Leavengood wrote: >> BTW with support for multiple screens in mind, it's not safe to assume >> that a screen starts at (0, 0). IOW the position should be offset by >> the screen's LeftTop() point. Ok will look into it when I find time. > On that note I wonder if BWindow could get a new non-virtual utility > method CenterOnScreen() to avoid the constant wheel reinvention of > this functionality? Also storing the last window position is a pain. bye, Clemens From cjsthompson at gmail.com Sat Aug 1 12:58:53 2009 From: cjsthompson at gmail.com (Christoph .J Thompson) Date: Sat, 1 Aug 2009 12:58:53 +0200 Subject: [Haiku-commits] r32041 - haiku/trunk/src/preferences/screen In-Reply-To: <1978386275-BeMail@laptop> References: <200907312325.n6VNPNox019197@sheep.berlios.de> <1978386275-BeMail@laptop> Message-ID: <20090801125853.f9875724.cjsthompson@gmail.com> Hi, I checked the X.org log for my monitor whose brand is Sceptre and the model is "X7S-NAGA": (II) RADEON(0): EDID vendor "SPT", prod id 5913 (II) RADEON(0): Monitor name: Sceptre (II) RADEON(0): Monitor name: X7S-NAGA (II) RADEON(0): EDID (in hex): (II) RADEON(0): 00ffffffffffff004e141917b2000000 (II) RADEON(0): 1c0d01036c221b78eac0f5a3574a9c23 (II) RADEON(0): 114f54bfef008180818a714f6146614a (II) RADEON(0): 454c01010101302a009851002a403070 (II) RADEON(0): 1300520e1100001e000000fd00324b18 (II) RADEON(0): 500e000a202020202020000000fc0053 (II) RADEON(0): 636570747265200a00000000000000fc (II) RADEON(0): 005837532d4e4147410a0000000000ec Cheers, -- Christoph .J Thompson From phoudoin at mail.berlios.de Sat Aug 1 13:03:18 2009 From: phoudoin at mail.berlios.de (phoudoin at mail.berlios.de) Date: Sat, 1 Aug 2009 13:03:18 +0200 Subject: [Haiku-commits] r32058 - haiku/trunk/src/servers/app Message-ID: <200908011103.n71B3IGZ031042@sheep.berlios.de> Author: phoudoin Date: 2009-08-01 13:03:15 +0200 (Sat, 01 Aug 2009) New Revision: 32058 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32058&view=rev Modified: haiku/trunk/src/servers/app/FontManager.cpp Log: Fixed warning. Modified: haiku/trunk/src/servers/app/FontManager.cpp =================================================================== --- haiku/trunk/src/servers/app/FontManager.cpp 2009-08-01 09:39:46 UTC (rev 32057) +++ haiku/trunk/src/servers/app/FontManager.cpp 2009-08-01 11:03:15 UTC (rev 32058) @@ -511,7 +511,7 @@ while (true) { // We just want the file in the kernel file cache... ssize_t read = file.Read(buffer, bufferSize); - if (read < bufferSize) + if (read < (ssize_t) bufferSize) break; } From mmu_man at mail.berlios.de Sat Aug 1 14:03:23 2009 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Sat, 1 Aug 2009 14:03:23 +0200 Subject: [Haiku-commits] r32059 - haiku/trunk/src/system/boot/platform/bios_ia32 Message-ID: <200908011203.n71C3NhP022787@sheep.berlios.de> Author: mmu_man Date: 2009-08-01 14:03:22 +0200 (Sat, 01 Aug 2009) New Revision: 32059 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32059&view=rev Modified: haiku/trunk/src/system/boot/platform/bios_ia32/shell.S Log: Add MultiBoot support. Based on a patch from Dustin Howett, reworked, and help from Vladimir 'phcoder' Serbinenko. - used defines for clarity, the rest of teh code could make use of them too... - added a gMultiBootInfo pointer to the passed args, to let C code handle it instead of faking the boot drive ID, - conditionalized the copy back, maybe we can get rid of it when QEMU handles our default load address correctly, - added video mode info to ask for 1024x768 but QEMU ignores it anyway, and we might need to show the menu, so it's disabled. Modified: haiku/trunk/src/system/boot/platform/bios_ia32/shell.S =================================================================== --- haiku/trunk/src/system/boot/platform/bios_ia32/shell.S 2009-08-01 11:03:15 UTC (rev 32058) +++ haiku/trunk/src/system/boot/platform/bios_ia32/shell.S 2009-08-01 12:03:22 UTC (rev 32059) @@ -16,6 +16,32 @@ #define GLOBAL(x) .globl x ; x +// GRUB-compatible MultiBoot info +// we use the official names +#define MULTIBOOT_MAGIC 0x1badb002 +#define MULTIBOOT_MAGIC2 0x2badb002 +// header flags +#define MULTIBOOT_PAGE_ALIGN 0x00000001 +#define MULTIBOOT_MEMORY_INFO 0x00000002 +#define MULTIBOOT_VIDEO_MODE 0x00000004 +#define MULTIBOOT_AOUT_KLUDGE 0x00010000 +// info flags +#define MULTIBOOT_INFO_BOOTDEV 0x00000002 + +#define OUR_MB_FLAGS (MULTIBOOT_PAGE_ALIGN \ + | MULTIBOOT_MEMORY_INFO \ + /*| MULTIBOOT_VIDEO_MODE*/ \ + | MULTIBOOT_AOUT_KLUDGE) + +// load address +#define LOAD_SEGMENT 0x1000 +#define LOAD_ADDRESS 0x10000 + +// MultiBoot load address +#define MB_LOAD_ADDRESS 0x100000 +//#define MB_LOAD_ADDRESS LOAD_ADDRESS +#define MB_LOAD_OFFSET (MB_LOAD_ADDRESS - LOAD_ADDRESS) + // this saves us some trouble with relocation (I didn't manage GAS to // create 32 bit references to labels) #define FAILURE_STRING 0x1d0 @@ -283,6 +309,36 @@ //-------------------------------------------------------------- +/** MultiBoot entry point + */ + +multiboot_start: + //subl $MULTIBOOT_MAGIC2, %eax + //jnz load_failed // rts to grub ? + movl %ebx, gMultiBootInfo + MB_LOAD_OFFSET + // load the GDT + lgdt gdt_descriptor + MB_LOAD_OFFSET + +#if MB_LOAD_ADDRESS != LOAD_ADDRESS + // QEMU does not like the real load address... + // copy ourselves to the expected location + cld + mov $(_end - LOAD_ADDRESS), %ecx + add $3, %ecx + shr $2, %ecx + mov $LOAD_ADDRESS, %edi + mov $MB_LOAD_ADDRESS, %esi + rep movsl + + // reload the GDT just in case + lgdt gdt_descriptor +#endif + +relocated_mb_start: + ljmp $0x8, $_protected_code_segment + +//-------------------------------------------------------------- + /** Enables the a20 gate. It will first try to enable it through * the BIOS, and, if that fails, will use the old style AT mechanism * using the keyboard port. @@ -331,11 +387,28 @@ //-------------------------------------------------------------- -.org 896 +.org 856 // since we don't need the above space when the boot loader is // running, it is used as a real mode scratch buffer (as our // boot loader spans over the whole real mode 0x1000 segment) +.align 4 +multiboot_header: + .long MULTIBOOT_MAGIC + .long OUR_MB_FLAGS + .long (0 - MULTIBOOT_MAGIC - OUR_MB_FLAGS) // checksum (8 bytes) + .long multiboot_header + MB_LOAD_OFFSET + .long .text + MB_LOAD_OFFSET + .long .bss + (MB_LOAD_OFFSET - 24) + .long _end + (MB_LOAD_OFFSET - 24) + .long multiboot_start + MB_LOAD_OFFSET +#if (OUR_MB_FLAGS & MULTIBOOT_VIDEO_MODE) + .long 0 // non text mode + .long 1024 + .long 786 + .long 24 +#endif + /* global data table */ gdt: @@ -373,4 +446,7 @@ GLOBAL(gBootPartitionOffset): .long 0 +GLOBAL(gMultiBootInfo): + .long 0 + .org 1024 From mmu_man at mail.berlios.de Sat Aug 1 14:32:19 2009 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Sat, 1 Aug 2009 14:32:19 +0200 Subject: [Haiku-commits] r32060 - haiku/trunk/src/system/boot/platform/bios_ia32 Message-ID: <200908011232.n71CWJuS025809@sheep.berlios.de> Author: mmu_man Date: 2009-08-01 14:32:18 +0200 (Sat, 01 Aug 2009) New Revision: 32060 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32060&view=rev Added: haiku/trunk/src/system/boot/platform/bios_ia32/multiboot.h Log: Minimal definition of the MultiBoot Info struct, should be enough for now. We use official names for defines & struct members. Added: haiku/trunk/src/system/boot/platform/bios_ia32/multiboot.h =================================================================== --- haiku/trunk/src/system/boot/platform/bios_ia32/multiboot.h 2009-08-01 12:03:22 UTC (rev 32059) +++ haiku/trunk/src/system/boot/platform/bios_ia32/multiboot.h 2009-08-01 12:32:18 UTC (rev 32060) @@ -0,0 +1,52 @@ +/* + * Copyright 2003-2006, Fran?ois Revol, revol at free.fr. + * Distributed under the terms of the MIT License. + */ +#ifndef _MULTIBOOT_H +#define _MULTIBOOT_H + +/* minimal part of the MultiBoot API */ + +/* magics */ +#define MULTIBOOT_MAGIC 0x1badb002 +#define MULTIBOOT_MAGIC2 0x2badb002 + +/* header flags */ +#define MULTIBOOT_PAGE_ALIGN 0x00000001 +#define MULTIBOOT_MEMORY_INFO 0x00000002 +#define MULTIBOOT_VIDEO_MODE 0x00000004 +#define MULTIBOOT_AOUT_KLUDGE 0x00010000 + +/* info flags */ +#define MULTIBOOT_INFO_MEMORY 0x00000001 +#define MULTIBOOT_INFO_BOOTDEV 0x00000002 +#define MULTIBOOT_INFO_CMDLINE 0x00000004 +#define MULTIBOOT_INFO_MODS 0x00000008 +#define MULTIBOOT_INFO_MEM_MAP 0x00000040 + + +/* info struct passed to the loader */ +struct multiboot_info { + uint32 flags; + uint32 mem_lower; + uint32 mem_upper; + uint32 boot_device; + uint32 cmdline; + uint32 mods_count; + uint32 mods_addr; + uint32 syms[4]; + uint32 mmap_length; + uint32 mmap_addr; + uint32 drives_length; + uint32 drives_addr; + uint32 config_table; + uint32 boot_loader_name; + uint32 apm_table; + uint32 vbe_control_info; + uint32 vbe_mode_info; + uint16 vbe_interface_seg; + uint16 vbe_interface_off; + uint16 vbe_interface_len; +}; + +#endif /* _MULTIBOOT_H */ From alex at zappotek.com Sat Aug 1 16:59:30 2009 From: alex at zappotek.com (Alex) Date: Sat, 01 Aug 2009 16:59:30 +0200 Subject: [Haiku-commits] r32057 - haiku/trunk/src/apps/haiku3d In-Reply-To: <200908010939.n719dnVl024999@sheep.berlios.de> Message-ID: <1249138770-998347fa8c89d2dcc88638eba0d8a755@zappotek.com> >Author: jackburton>Date: 2009-08-01 11:39:46 +0200 (Sat, 01 Aug 2009)>New Revision: 32057>ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32057&view=rev>Modified:> haiku/trunk/src/apps/haiku3d/Jamfile> haiku/trunk/src/apps/haiku3d/MathUtils.cpp> haiku/trunk/src/apps/haiku3d/RenderView.cpp>Log:>Fixed build with gcc4Thanks!Btw, just fixed a few style issues, but i'm stuck on Windows dialup for the weekend :)Regards,Alex -------------- next part -------------- An HTML attachment was scrubbed... URL: From anevilyak at mail.berlios.de Sat Aug 1 17:43:55 2009 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Sat, 1 Aug 2009 17:43:55 +0200 Subject: [Haiku-commits] r32061 - haiku/trunk/build/jam Message-ID: <200908011543.n71FhtLX008834@sheep.berlios.de> Author: anevilyak Date: 2009-08-01 17:43:54 +0200 (Sat, 01 Aug 2009) New Revision: 32061 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32061&view=rev Modified: haiku/trunk/build/jam/OptionalPackageDependencies Log: Added LibIconv as dep for Firefox. Fixes ticket #4169. Modified: haiku/trunk/build/jam/OptionalPackageDependencies =================================================================== --- haiku/trunk/build/jam/OptionalPackageDependencies 2009-08-01 12:32:18 UTC (rev 32060) +++ haiku/trunk/build/jam/OptionalPackageDependencies 2009-08-01 15:43:54 UTC (rev 32061) @@ -9,6 +9,7 @@ OptionalPackageDependencies Development : DevelopmentBase Perl ; OptionalPackageDependencies DevelopmentBase : CDRecord DevelopmentMin Yasm ; OptionalPackageDependencies DevelopmentMin : LibIconv ; +OptionalPackageDependencies Firefox : LibIconv ; OptionalPackageDependencies LibLayout : DevelopmentBase ; OptionalPackageDependencies NetSurf : OpenSSL ; OptionalPackageDependencies OpenSSH : OpenSSL ; From jackburton at mail.berlios.de Sat Aug 1 17:57:25 2009 From: jackburton at mail.berlios.de (jackburton at mail.berlios.de) Date: Sat, 1 Aug 2009 17:57:25 +0200 Subject: [Haiku-commits] r32062 - haiku/trunk/src/servers/app Message-ID: <200908011557.n71FvPDw010067@sheep.berlios.de> Author: jackburton Date: 2009-08-01 17:57:22 +0200 (Sat, 01 Aug 2009) New Revision: 32062 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32062&view=rev Modified: haiku/trunk/src/servers/app/ServerWindow.cpp haiku/trunk/src/servers/app/ServerWindow.h Log: Completed the server part of BDirectWindow::SetFullScreen(). The window is now resized and moved correctly. Moved this functionality to its own method. Should fix bug #4168. Modified: haiku/trunk/src/servers/app/ServerWindow.cpp =================================================================== --- haiku/trunk/src/servers/app/ServerWindow.cpp 2009-08-01 15:43:54 UTC (rev 32061) +++ haiku/trunk/src/servers/app/ServerWindow.cpp 2009-08-01 15:57:22 UTC (rev 32062) @@ -126,8 +126,9 @@ sem_id sem; sem_id sem_ack; area_id area; + BRect old_window_frame; + direct_buffer_info *buffer_info; bool started; - direct_buffer_info *buffer_info; }; @@ -136,8 +137,8 @@ sem(-1), sem_ack(-1), area(-1), - started(false), - buffer_info(NULL) + buffer_info(NULL), + started(false) { area = create_area("direct area", (void **)&buffer_info, B_ANY_ADDRESS, B_PAGE_SIZE, B_NO_LOCK, B_READ_WRITE); @@ -1164,19 +1165,13 @@ } case AS_DIRECT_WINDOW_SET_FULLSCREEN: { - // TODO: maybe there is more to do than this? - // (like resizing it to screen size?) bool enable; link.Read(&enable); status_t status = B_OK; if (!fWindow->IsOffscreenWindow()) { //fDesktop->UnlockSingleWindow(); - if (enable) - fDirectWindowFeel = fWindow->Feel(); - - fDesktop->SetWindowFeel(fWindow, - enable ? kWindowScreenFeel : fDirectWindowFeel); + _DirectWindowSetFullScreen(enable); //fDesktop->LockSingleWindow(); } else status = B_BAD_TYPE; @@ -3720,6 +3715,36 @@ } +void +ServerWindow::_DirectWindowSetFullScreen(bool enable) +{ + if (enable) { + fDirectWindowData->old_window_frame = fWindow->Frame(); + BRect screenFrame = + fDesktop->ActiveScreen()->Frame(); + fDirectWindowFeel = fWindow->Feel(); + fDesktop->MoveWindowBy(fWindow, + - fWindow->Frame().left, + - fWindow->Frame().top); + fDesktop->ResizeWindowBy(fWindow, + screenFrame.Width() - fWindow->Frame().Width(), + screenFrame.Height() + - fWindow->Frame().Height()); + } else { + const BRect &oldFrame = fDirectWindowData->old_window_frame; + fDesktop->MoveWindowBy(fWindow, + oldFrame.left - fWindow->Frame().left, + oldFrame.top - fWindow->Frame().top); + fDesktop->ResizeWindowBy(fWindow, + oldFrame.Width() - fWindow->Frame().Width(), + oldFrame.Height() - fWindow->Frame().Height()); + } + + fDesktop->SetWindowFeel(fWindow, + enable ? kWindowScreenFeel : fDirectWindowFeel); +} + + status_t ServerWindow::PictureToRegion(ServerPicture *picture, BRegion ®ion, bool inverse, BPoint where) Modified: haiku/trunk/src/servers/app/ServerWindow.h =================================================================== --- haiku/trunk/src/servers/app/ServerWindow.h 2009-08-01 15:43:54 UTC (rev 32061) +++ haiku/trunk/src/servers/app/ServerWindow.h 2009-08-01 15:57:22 UTC (rev 32062) @@ -131,6 +131,7 @@ bool _MessageNeedsAllWindowsLocked(uint32 code) const; + void _DirectWindowSetFullScreen(bool set); // TODO: Move me elsewhere status_t PictureToRegion(ServerPicture *picture, BRegion& region, bool inverse, From bga at bug-br.org.br Sat Aug 1 16:43:09 2009 From: bga at bug-br.org.br (Bruno Albuquerque) Date: Sat, 01 Aug 2009 16:43:09 Subject: [Haiku-commits] r32062 - haiku/trunk/src/servers/app Message-ID: <229810562-BeMail@Gaspode> On Sat, 1 Aug 2009 17:57:25 +0200, jackburton at mail.berlios.de said: > Author: jackburton > Date: 2009-08-01 17:57:22 +0200 (Sat, 01 Aug 2009) > New Revision: 32062 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32062&view=rev > > Modified: > haiku/trunk/src/servers/app/ServerWindow.cpp > haiku/trunk/src/servers/app/ServerWindow.h > Log: > Completed the server part of BDirectWindow::SetFullScreen(). The > window is > now resized and moved correctly. Moved this functionality to its own > method. > Should fix bug #4168. Thanks for the quick fix. I am just wondering if this is really the expected behavior based on what the BeBook says: "In addition, BDirectWindow lets you switch between full-screen exclusive mode and windowed modes without breaking down and rebuilding the object. A simple call to the SetFullScreen() function does the job. " "Note if you want your direct window to be full-screen but don't want exclusive mode, just resize the window to fill the entire screen; since full-screen exclusive mode (as set by calling SetFullScreen()) won't let other windows draw in front of your direct window, you can't have menus in a full-screen exclusive mode direct window." It looks like all you are doing is resizing the window so it can be fullscreen and the exclusive mode seems to be a bit more than that (or, of course, I may be missing something). -Bruno From stefano.ceccherini at gmail.com Sat Aug 1 18:47:24 2009 From: stefano.ceccherini at gmail.com (Stefano Ceccherini) Date: Sat, 1 Aug 2009 18:47:24 +0200 Subject: [Haiku-commits] r32062 - haiku/trunk/src/servers/app In-Reply-To: <229810562-BeMail@Gaspode> References: <229810562-BeMail@Gaspode> Message-ID: <894b9700908010947k779153ddlfa9225449a56d7b7@mail.gmail.com> 2009/8/1 Bruno Albuquerque : > Thanks for the quick fix. I am just wondering if this is really the > expected behavior based on what the BeBook says: > > "In addition, BDirectWindow lets you switch between full-screen > exclusive mode and windowed modes without breaking down and rebuilding > the object. A simple call to the SetFullScreen() function does the job. > " > > "Note > > if you want your direct window to be full-screen but don't want > exclusive mode, just resize the window to fill the entire screen; since > full-screen exclusive mode (as set by calling SetFullScreen()) won't > let other windows draw in front of your direct window, you can't have > menus in a full-screen exclusive mode direct window." > > It looks like all you are doing is resizing the window so it can be > fullscreen and the exclusive mode seems to be a bit more than that (or, > of course, I may be missing something). > The window feel is also changed to a special feel called kDirectWindowFeel, which prevent other windows to get in front of it. That part had already been implemented (by Axel, IIRC), but the resizing / moving part was missing. From anevilyak at mail.berlios.de Sat Aug 1 19:10:35 2009 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Sat, 1 Aug 2009 19:10:35 +0200 Subject: [Haiku-commits] r32063 - haiku/trunk/build/jam Message-ID: <200908011710.n71HAZEP013736@sheep.berlios.de> Author: anevilyak Date: 2009-08-01 19:10:34 +0200 (Sat, 01 Aug 2009) New Revision: 32063 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32063&view=rev Modified: haiku/trunk/build/jam/OptionalPackages Log: Fix several incorrect gcc4 and/or hybrid build checks. Closes ticket #4036. Modified: haiku/trunk/build/jam/OptionalPackages =================================================================== --- haiku/trunk/build/jam/OptionalPackages 2009-08-01 15:57:22 UTC (rev 32062) +++ haiku/trunk/build/jam/OptionalPackages 2009-08-01 17:10:34 UTC (rev 32063) @@ -375,7 +375,7 @@ if [ IsOptionalHaikuImagePackageAdded Firefox ] { if $(TARGET_ARCH) != x86 { Echo "No optional package Firefox available for $(TARGET_ARCH)" ; - } else if $(HAIKU_GCC_VERSION[1]) >= 4 && ! $(isHybridBuild) { + } else if $(HAIKU_GCC_VERSION[1]) >= 4 { InstallOptionalHaikuImagePackage BeZillaBrowser-2.0.0.21pre-haiku-gcc4-x86-09-03-01 : $(baseURL)/BeZillaBrowser-2.0.0.21pre-haiku-gcc4-x86-09-03-01.zip @@ -400,7 +400,7 @@ if [ IsOptionalHaikuImagePackageAdded KeymapSwitcher ] { if $(TARGET_ARCH) != x86 { Echo "No optional package KeymapSwitcher available for $(TARGET_ARCH)" ; - } else if $(HAIKU_GCC_VERSION[1]) >= 4 && ! $(isHybridBuild) { + } else if $(HAIKU_GCC_VERSION[1]) >= 4 { InstallOptionalHaikuImagePackage KeymapSwitcher-1.2.3-x86-gcc4-2009-05-31 : $(baseURL)/KeymapSwitcher-1.2.3-x86-gcc4-2009-05-31.zip @@ -437,7 +437,7 @@ if [ IsOptionalHaikuImagePackageAdded LibLayout ] { if $(TARGET_ARCH) != x86 { Echo "No optional package LibLayout available for $(TARGET_ARCH)" ; - } else if $(HAIKU_GCC_VERSION[1]) >= 4 { + } else if $(HAIKU_GCC_VERSION[1]) >= 4 && ! $(isHybridBuild) { Echo "No optional package LibLayout available for gcc4" ; } else { InstallOptionalHaikuImagePackage liblayout-1.4.0-gcc2-2009-03-08 @@ -752,7 +752,7 @@ if [ IsOptionalHaikuImagePackageAdded Vim ] { if $(TARGET_ARCH) != x86 { Echo "No optional package Vim available for $(TARGET_ARCH)" ; - } else if $(HAIKU_GCC_VERSION[1]) >= 4 && ! $(isHybridBuild) { + } else if $(HAIKU_GCC_VERSION[1]) >= 4 { InstallOptionalHaikuImagePackage vim-7.2-x86-gcc4-2009-05-31 : $(baseURL)/vim-7.2-x86-gcc4-2009-05-31.zip : From umccullough at gmail.com Sat Aug 1 18:44:40 2009 From: umccullough at gmail.com (Urias McCullough) Date: Sat, 1 Aug 2009 09:44:40 -0700 Subject: [Haiku-commits] r32062 - haiku/trunk/src/servers/app In-Reply-To: <229810562-BeMail@Gaspode> References: <229810562-BeMail@Gaspode> Message-ID: <1e80d8750908010944p1a2a116ei331af9449966b80@mail.gmail.com> On Sat, Aug 1, 2009 at 9:43 AM, Bruno Albuquerque wrote: > On Sat, 1 Aug 2009 17:57:25 +0200, jackburton at mail.berlios.de said: > >> Author: jackburton >> Date: 2009-08-01 17:57:22 +0200 (Sat, 01 Aug 2009) >> New Revision: 32062 >> ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32062&view=rev >> >> Modified: >> ? ?haiku/trunk/src/servers/app/ServerWindow.cpp >> ? ?haiku/trunk/src/servers/app/ServerWindow.h >> Log: >> Completed the server part of BDirectWindow::SetFullScreen(). The >> window is >> now resized and moved correctly. Moved this functionality to its own >> method. >> Should fix bug #4168. > > Thanks for the quick fix. I am just wondering if this is really the > expected behavior based on what the BeBook says: On another note, I saw ScummVM was failing to go "fullscreen" the other day while I was testing it - I wonder if this was related. I'll have to try again. - Urias From bga at bug-br.org.br Sat Aug 1 17:41:08 2009 From: bga at bug-br.org.br (Bruno Albuquerque) Date: Sat, 01 Aug 2009 17:41:08 Subject: [Haiku-commits] r32062 - haiku/trunk/src/servers/app In-Reply-To: <1e80d8750908010944p1a2a116ei331af9449966b80@mail.gmail.com> Message-ID: <412730539-BeMail@Gaspode> On Sat, 1 Aug 2009 09:44:40 -0700, Urias McCullough said: > On another note, I saw ScummVM was failing to go "fullscreen" the > other day while I was testing it - I wonder if this was related. I'll > have to try again. It tries to go fullscreen but then ends up in a messed up state. I am not sure it is using BDirectWindow when in fullscreen mode as it actually changes the screen resolution (but it could also be that it just uses BScreen to do that before changing to fullscreen mode). -Bruno From leavengood at gmail.com Sat Aug 1 19:41:49 2009 From: leavengood at gmail.com (Ryan Leavengood) Date: Sat, 1 Aug 2009 13:41:49 -0400 Subject: [Haiku-commits] r32044 - haiku/trunk/src/system/boot/platform/pxe_ia32 In-Reply-To: <200908010118.n711IfQ4023628@sheep.berlios.de> References: <200908010118.n711IfQ4023628@sheep.berlios.de> Message-ID: On Fri, Jul 31, 2009 at 9:18 PM, wrote: > > Automatic whitespace cleanup. When you guys do this, is there a particular tool you use, or just search and replace in your editor? I know I could do it in VIM, I am just curious... On a similar note, the WebKit project has lately been working on a Python tool for checking and correcting code based on their coding style (which isn't too different than ours) and it might be worth looking at for us too. -- Regards, Ryan From leavengood at gmail.com Sat Aug 1 20:09:52 2009 From: leavengood at gmail.com (Ryan Leavengood) Date: Sat, 1 Aug 2009 14:09:52 -0400 Subject: [Haiku-commits] r32062 - haiku/trunk/src/servers/app In-Reply-To: <894b9700908010947k779153ddlfa9225449a56d7b7@mail.gmail.com> References: <229810562-BeMail@Gaspode> <894b9700908010947k779153ddlfa9225449a56d7b7@mail.gmail.com> Message-ID: On Sat, Aug 1, 2009 at 12:47 PM, Stefano Ceccherini wrote: > > The window feel is also changed to a special feel called > kDirectWindowFeel, which prevent other windows to get in front of it. > That part had already been implemented (by Axel, IIRC), but the > resizing / moving part was missing. I suppose this works as a way of emulating the behavior of BeOS, but isn't the point of BDirectWindow to give the programmer full and speedy access to the frame buffer? Though I haven't looked at the code and if it is already doing that then you can ignore me :) -- Regards, Ryan From leavengood at gmail.com Sat Aug 1 20:37:19 2009 From: leavengood at gmail.com (Ryan Leavengood) Date: Sat, 1 Aug 2009 14:37:19 -0400 Subject: [Haiku-commits] r32062 - haiku/trunk/src/servers/app In-Reply-To: References: <229810562-BeMail@Gaspode> <894b9700908010947k779153ddlfa9225449a56d7b7@mail.gmail.com> Message-ID: On Sat, Aug 1, 2009 at 2:09 PM, Ryan Leavengood wrote: > > I suppose this works as a way of emulating the behavior of BeOS, but > isn't the point of BDirectWindow to give the programmer full and > speedy access to the frame buffer? Though I haven't looked at the code > and if it is already doing that then you can ignore me :) I have since been informed by Rene that this is how the code is supposed to work, so just ignore the above as suggested ;) -- Regards, Ryan From fredrik at modeen.se Sat Aug 1 20:42:23 2009 From: fredrik at modeen.se (Fredrik =?utf-8?Q?Mod=C3=A8en?=) Date: Sat, 1 Aug 2009 20:42:23 +0200 (CEST) Subject: [Haiku-commits] r32062 - haiku/trunk/src/servers/app In-Reply-To: <412730539-BeMail@Gaspode> References: <412730539-BeMail@Gaspode> Message-ID: > On Sat, 1 Aug 2009 09:44:40 -0700, Urias McCullough said: > >> On another note, I saw ScummVM was failing to go "fullscreen" the >> other day while I was testing it - I wonder if this was related. I'll >> have to try again. > > It tries to go fullscreen but then ends up in a messed up state. I am > not sure it is using BDirectWindow when in fullscreen mode as it > actually changes the screen resolution (but it could also be that it > just uses BScreen to do that before changing to fullscreen mode). ScummVM uses SDL right? then the problem should be in more SDL apps. I had a check and SDL are using BDirectWindow > > -Bruno > > _______________________________________________ > Haiku-commits mailing list > Haiku-commits at lists.berlios.de > https://lists.berlios.de/mailman/listinfo/haiku-commits > -- MVH Fredrik Mod?en From bga at bug-br.org.br Sat Aug 1 18:57:07 2009 From: bga at bug-br.org.br (Bruno Albuquerque) Date: Sat, 01 Aug 2009 18:57:07 Subject: [Haiku-commits] r32062 - haiku/trunk/src/servers/app In-Reply-To: Message-ID: <4971264451-BeMail@Gaspode> On Sat, 1 Aug 2009 20:42:23 +0200 (CEST), Fredrik Mod?en said: > >> On another note, I saw ScummVM was failing to go "fullscreen" the > >> other day while I was testing it - I wonder if this was related. > > > I'll > >> have to try again. > > > > It tries to go fullscreen but then ends up in a messed up state. I > > am > > not sure it is using BDirectWindow when in fullscreen mode as it > > actually changes the screen resolution (but it could also be that > > it > > just uses BScreen to do that before changing to fullscreen mode). > > ScummVM uses SDL right? then the problem should be in more SDL apps. > I had a check and SDL are using BDirectWindow Yes. I also took a look at SDl bu the logic is a bit concoluted. For instance, it tries to move and resize the window *AFTER* switching to fullscreen which is either unecessary or plain broken. Unfortunatelly I could not compile it (even with the patch from Haiku Ports) under Haiku so I could not test a possible fix. -Bruno From stefano.ceccherini at gmail.com Sun Aug 2 09:24:15 2009 From: stefano.ceccherini at gmail.com (Stefano Ceccherini) Date: Sun, 2 Aug 2009 09:24:15 +0200 Subject: [Haiku-commits] r32062 - haiku/trunk/src/servers/app In-Reply-To: <4971264451-BeMail@Gaspode> References: <4971264451-BeMail@Gaspode> Message-ID: <894b9700908020024g2f3f654fu7bbfb02e324f33c5@mail.gmail.com> 2009/8/1 Bruno Albuquerque : >> ScummVM uses SDL right? then the problem should be in more SDL apps. >> I had a check and SDL are using BDirectWindow Actually, it's not. Even if it creates a BDirectWindow, it doesn't implement the needed DirectConnected() hook, so it just uses it as a normal BWindow. From superstippi at gmx.de Sun Aug 2 03:36:08 2009 From: superstippi at gmx.de (Stephan Assmus) Date: Sun, 02 Aug 2009 03:36:08 +0200 Subject: [Haiku-commits] r32062 - haiku/trunk/src/servers/app In-Reply-To: References: <229810562-BeMail@Gaspode> <894b9700908010947k779153ddlfa9225449a56d7b7@mail.gmail.com> Message-ID: <20090802033608.604.2@bepc.1249176297.fake> On 2009-08-01 at 20:09:52 [+0200], Ryan Leavengood wrote: > On Sat, Aug 1, 2009 at 12:47 PM, Stefano > Ceccherini wrote: > > > > The window feel is also changed to a special feel called > > kDirectWindowFeel, which prevent other windows to get in front of it. > > That part had already been implemented (by Axel, IIRC), but the > > resizing / moving part was missing. > > I suppose this works as a way of emulating the behavior of BeOS, but > isn't the point of BDirectWindow to give the programmer full and speedy > access to the frame buffer? Though I haven't looked at the code and if it > is already doing that then you can ignore me :) You may feel ignored... ;-) Ciao, -Stephan From ingo_weinhold at gmx.de Sat Aug 1 21:24:12 2009 From: ingo_weinhold at gmx.de (Ingo Weinhold) Date: Sat, 01 Aug 2009 21:24:12 +0200 Subject: [Haiku-commits] r32044 - haiku/trunk/src/system/boot/platform/pxe_ia32 In-Reply-To: References: <200908010118.n711IfQ4023628@sheep.berlios.de> Message-ID: <20090801212412.698.2@knochen-vm.localdomain> On 2009-08-01 at 19:41:49 [+0200], Ryan Leavengood wrote: > On Fri, Jul 31, 2009 at 9:18 PM, wrote: > > > > Automatic whitespace cleanup. > > When you guys do this, is there a particular tool you use, or just > search and replace in your editor? I know I could do it in VIM, I am > just curious... Most editors have a setting that makes them remove whitespace at the end of lines automatically. I have no idea whether this also applies to vim, but it would surprise me, if it didn't. In a current Pe you'll find the option in the preferences under "Files" -> "When saving a file" -> "Discard trailing space". > On a similar note, the WebKit project has lately been working on a > Python tool for checking and correcting code based on their coding > style (which isn't too different than ours) and it might be worth > looking at for us too. That would be interesting indeed. CU, Ingo From superstippi at gmx.de Sun Aug 2 03:35:26 2009 From: superstippi at gmx.de (Stephan Assmus) Date: Sun, 02 Aug 2009 03:35:26 +0200 Subject: [Haiku-commits] r32044 - haiku/trunk/src/system/boot/platform/pxe_ia32 In-Reply-To: References: <200908010118.n711IfQ4023628@sheep.berlios.de> Message-ID: <20090802033526.572.1@bepc.1249176297.fake> Hi, On 2009-08-01 at 19:41:49 [+0200], Ryan Leavengood wrote: > On Fri, Jul 31, 2009 at 9:18 PM, wrote: > > > > Automatic whitespace cleanup. > > When you guys do this, is there a particular tool you use, or just search > and replace in your editor? I know I could do it in VIM, I am just > curious... Ingo added it to Pe a while back, it's already in the version that is the current optional package, but you have to enable it in the Editor part of the settings. Best regards, -Stephan From ingo_weinhold at gmx.de Sat Aug 1 21:20:43 2009 From: ingo_weinhold at gmx.de (Ingo Weinhold) Date: Sat, 01 Aug 2009 21:20:43 +0200 Subject: [Haiku-commits] r32050 - in haiku/trunk: headers/private/kernel headers/private/kernel/arch/x86 src/system/kernel src/system/kernel/arch/x86 src/system/kernel/debug In-Reply-To: References: <200908010154.n711s1X0027348@sheep.berlios.de> Message-ID: <20090801212043.668.1@knochen-vm.localdomain> On 2009-08-01 at 03:58:16 [+0200], Rene Gollent wrote: > On Fri, Jul 31, 2009 at 8:54 PM, wrote: > > Author: bonefish > > Date: 2009-08-01 03:53:54 +0200 (Sat, 01 Aug 2009) > > New Revision: 32050 > > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32050&view=rev > > > > disabled and gets the CPU index, so it doesn't have to use > > smp_get_current_cpu() (which dereferences the current thread). > > Just curious, is there any reason not to use the non-dereferencing > version in general? Is it slower, or does it specifically rely on > information that only applies on the double fault stack? It can only be called with interrupts disabled and has a CPU index parameter. The only way to get the CPU index in architecture independent code is smp_get_current_cpu(). The double fault handler can determine the CPU index, since it uses a separate stack per CPU. CU, Ingo From axeld at pinc-software.de Sun Aug 2 13:54:28 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Sun, 02 Aug 2009 13:54:28 +0200 CEST Subject: [Haiku-commits] =?utf-8?q?r32044_-_haiku/trunk/src/system/boot/pl?= =?utf-8?q?atform/pxe=5Fia32?= In-Reply-To: Message-ID: <2063705672-BeMail@zon> Ryan Leavengood wrote: > On Fri, Jul 31, 2009 at 9:18 PM, wrote: > > Automatic whitespace cleanup. > When you guys do this, is there a particular tool you use, or just > search and replace in your editor? I know I could do it in VIM, I am > just curious... Pe has a setting to discard extraneous whitespace (added by Ingo recently), and most other editors have that, too. Bye, Axel. From axeld at pinc-software.de Sun Aug 2 13:54:59 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Sun, 02 Aug 2009 13:54:59 +0200 CEST Subject: [Haiku-commits] r32049 - haiku/trunk/src/preferences/screen In-Reply-To: Message-ID: <2094546794-BeMail@zon> Rene Gollent wrote: > On Fri, Jul 31, 2009 at 8:47 PM, wrote: > > Log: > > * Added many many more vendors, thanks to Brecht for digging up a > > nice web > > ?resource that I couldn't find! Also thanks to Jonas and Urias :-) > I have some more of these...should I send you a diff or just add them > directly? Don't want to step on your toes :) Please just go ahead! Bye, Axel. From axeld at pinc-software.de Sun Aug 2 14:01:04 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Sun, 02 Aug 2009 14:01:04 +0200 CEST Subject: [Haiku-commits] =?utf-8?q?r32035_-_in_haiku/trunk=3A_headers/os/s?= =?utf-8?q?upport_src/kits/support?= In-Reply-To: <894b9700908010052w4fb9b003q395b6c1593c01a01@mail.gmail.com> Message-ID: <2459384319-BeMail@zon> Stefano Ceccherini wrote: > 2009/7/31 : > > Log: > > * Added desperately missing Trim() method. > And Trim Left(), and TrimRight() ? :-) I thought about those for a short moment, but thought they weren't that useful in comparison to Trim(). I wouldn't mind if you'd add those, though :-) Bye, Axel. From stefano.ceccherini at gmail.com Mon Aug 3 11:09:51 2009 From: stefano.ceccherini at gmail.com (Stefano Ceccherini) Date: Mon, 3 Aug 2009 11:09:51 +0200 Subject: [Haiku-commits] r32035 - in haiku/trunk: headers/os/support src/kits/support In-Reply-To: <2459384319-BeMail@zon> References: <894b9700908010052w4fb9b003q395b6c1593c01a01@mail.gmail.com> <2459384319-BeMail@zon> Message-ID: <894b9700908030209v4569b5cs8c95c66355eb450d@mail.gmail.com> 2009/8/2 Axel D?rfler : > Stefano Ceccherini wrote: >> 2009/7/31 ?: >> > Log: >> > * Added desperately missing Trim() method. >> And Trim Left(), and TrimRight() ? :-) > > I thought about those for a short moment, but thought they weren't that > useful in comparison to Trim(). Indeed, it was a sort of joke. Actually Delphi has them, that's why I asked. > I wouldn't mind if you'd add those, > though :-) > > Bye, > ? Axel. Well, most string implementations have many more methods than ours. So I guess we could add those, and even more (if the need arouses). From stippi at mail.berlios.de Mon Aug 3 11:35:33 2009 From: stippi at mail.berlios.de (stippi at mail.berlios.de) Date: Mon, 3 Aug 2009 11:35:33 +0200 Subject: [Haiku-commits] r32064 - haiku/trunk/src/add-ons/media/plugins/ffmpeg Message-ID: <200908030935.n739ZXqe013308@sheep.berlios.de> Author: stippi Date: 2009-08-03 11:35:30 +0200 (Mon, 03 Aug 2009) New Revision: 32064 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32064&view=rev Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.h haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatReader.cpp haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatWriter.cpp haiku/trunk/src/add-ons/media/plugins/ffmpeg/EncoderTable.cpp Log: Implemented audio track encoding. There is something wrong with the PTS generation for the packets and how I set the time_base in the AVStream and AVStream->codec structures. This results in the audio streams of the written files to report a much too long duration. Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp 2009-08-01 17:10:34 UTC (rev 32063) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp 2009-08-03 09:35:30 UTC (rev 32064) @@ -34,9 +34,13 @@ Encoder(), fCodec(NULL), fContext(avcodec_alloc_context()), + fCodecInitDone(false), + fFrame(avcodec_alloc_frame()), fSwsContext(NULL), - fCodecInitDone(false), + + fFramesWritten(0), + fChunkBuffer(new(std::nothrow) uint8[kDefaultChunkBufferSize]) { TRACE("AVCodecEncoder::AVCodecEncoder()\n"); @@ -110,7 +114,13 @@ if (inputFormat == NULL) return B_BAD_VALUE; + if (fCodecInitDone) { + fCodecInitDone = false; + avcodec_close(fContext); + } + fInputFormat = *inputFormat; + fFramesWritten = 0; if (fInputFormat.type == B_MEDIA_RAW_VIDEO) { // frame rate @@ -167,6 +177,68 @@ PIX_FMT_RGB32, fContext->width, fContext->height, fContext->pix_fmt, SWS_BICUBIC, NULL, NULL, NULL); + } else if (fInputFormat.type == B_MEDIA_RAW_AUDIO) { + // frame rate + fContext->sample_rate = (int)fInputFormat.u.raw_audio.frame_rate; + fContext->time_base.den = (int)fInputFormat.u.raw_audio.frame_rate; + fContext->time_base.num = 1; + // channels + fContext->channels = fInputFormat.u.raw_audio.channel_count; + switch (fInputFormat.u.raw_audio.format) { + case media_raw_audio_format::B_AUDIO_FLOAT: + fContext->sample_fmt = SAMPLE_FMT_FLT; + break; + case media_raw_audio_format::B_AUDIO_DOUBLE: + fContext->sample_fmt = SAMPLE_FMT_DBL; + break; + case media_raw_audio_format::B_AUDIO_INT: + fContext->sample_fmt = SAMPLE_FMT_S32; + break; + case media_raw_audio_format::B_AUDIO_SHORT: + fContext->sample_fmt = SAMPLE_FMT_S16; + break; + case media_raw_audio_format::B_AUDIO_UCHAR: + fContext->sample_fmt = SAMPLE_FMT_U8; + break; + + case media_raw_audio_format::B_AUDIO_CHAR: + default: + return B_MEDIA_BAD_FORMAT; + break; + } + if (fInputFormat.u.raw_audio.channel_mask == 0) { + // guess the channel mask... + switch (fInputFormat.u.raw_audio.channel_count) { + default: + case 2: + fContext->channel_layout = CH_LAYOUT_STEREO; + break; + case 1: + fContext->channel_layout = CH_LAYOUT_MONO; + break; + case 3: + fContext->channel_layout = CH_LAYOUT_SURROUND; + break; + case 4: + fContext->channel_layout = CH_LAYOUT_QUAD; + break; + case 5: + fContext->channel_layout = CH_LAYOUT_5POINT0; + break; + case 6: + fContext->channel_layout = CH_LAYOUT_5POINT1; + break; + case 8: + fContext->channel_layout = CH_LAYOUT_7POINT1; + break; + case 10: + fContext->channel_layout = CH_LAYOUT_7POINT1_WIDE; + break; + } + } else { + // The bits match 1:1 for media_multi_channels and FFmpeg defines. + fContext->channel_layout = fInputFormat.u.raw_audio.channel_mask; + } } else { return B_NOT_SUPPORTED; } @@ -221,13 +293,80 @@ status_t -AVCodecEncoder::_EncodeAudio(const void* buffer, int64 frameCount, +AVCodecEncoder::_EncodeAudio(const void* _buffer, int64 frameCount, media_encode_info* info) { - TRACE("AVCodecEncoder::_EncodeAudio(%p, %lld, %p)\n", buffer, frameCount, + TRACE("AVCodecEncoder::_EncodeAudio(%p, %lld, %p)\n", _buffer, frameCount, info); - return B_NOT_SUPPORTED; + if (fChunkBuffer == NULL) + return B_NO_MEMORY; + + status_t ret = B_OK; + + const uint8* buffer = reinterpret_cast(_buffer); + + size_t inputSampleSize = fInputFormat.u.raw_audio.format + & media_raw_audio_format::B_AUDIO_SIZE_MASK; + size_t inputFrameSize = inputSampleSize + * fInputFormat.u.raw_audio.channel_count; + + size_t outSampleSize = av_get_bits_per_sample_format( + fContext->sample_fmt) / 8; + size_t outSize = outSampleSize * fContext->channels; + TRACE(" sampleSize: %ld/%ld, frameSize: %ld/%ld\n", + inputSampleSize, inputFrameSize, outSampleSize, outSize); + + size_t bufferSize = frameCount * inputFrameSize; + bufferSize = min_c(bufferSize, kDefaultChunkBufferSize); + + while (frameCount > 0) { + if (frameCount < fContext->frame_size) { + TRACE(" ERROR: too few frames left! (left: %lld, needed: %d)\n", + frameCount, fContext->frame_size); + // TODO: Handle this some way. Maybe use an av_fifo to buffer data? + return B_ERROR; + } + + int chunkFrames = fContext->frame_size; + + TRACE(" frames left: %lld, chunk frames: %d\n", + frameCount, chunkFrames); + + // Encode one audio chunk/frame. + int usedBytes = avcodec_encode_audio(fContext, fChunkBuffer, + bufferSize, reinterpret_cast(buffer)); + + if (usedBytes < 0) { + TRACE(" avcodec_encode_video() failed: %d\n", usedBytes); + return B_ERROR; + } + + // Setup media_encode_info, most important is the time stamp. + info->start_time = (bigtime_t)(fFramesWritten * 1000000LL + / fInputFormat.u.raw_audio.frame_rate); + + // Write the chunk + ret = WriteChunk(fChunkBuffer, usedBytes, info); + if (ret != B_OK) + break; + + size_t framesWritten = usedBytes / inputFrameSize; + if (chunkFrames == 1) { + // For PCM data: + framesWritten = usedBytes / inputFrameSize; + } else { + // For encoded audio: + framesWritten = chunkFrames * inputFrameSize; + } + + // Skip to next chunk of buffer. + fFramesWritten += framesWritten; + frameCount -= framesWritten; + buffer += usedBytes; + } + + return ret; } @@ -268,6 +407,10 @@ return B_ERROR; } + // Setup media_encode_info, most important is the time stamp. + info->start_time = (bigtime_t)(fFramesWritten * 1000000LL + / fInputFormat.u.raw_video.field_rate); + // Write the chunk ret = WriteChunk(fChunkBuffer, usedBytes, info); if (ret != B_OK) @@ -276,6 +419,7 @@ // Skip to the next frame (but usually, there is only one to encode // for video). frameCount--; + fFramesWritten++; buffer = (const void*)((const uint8*)buffer + bufferSize); } Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.h =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.h 2009-08-01 17:10:34 UTC (rev 32063) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.h 2009-08-03 09:35:30 UTC (rev 32064) @@ -52,15 +52,15 @@ // TODO: Refactor common base class from AVCodec[De|En]Coder! AVCodec* fCodec; AVCodecContext* fContext; + bool fCodecInitDone; + AVPicture fSrcFrame; AVPicture fDstFrame; AVFrame* fFrame; SwsContext* fSwsContext; - uint32 fAVCodecID; + int64 fFramesWritten; - bool fCodecInitDone; - uint8* fChunkBuffer; }; Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatReader.cpp =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatReader.cpp 2009-08-01 17:10:34 UTC (rev 32063) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatReader.cpp 2009-08-03 09:35:30 UTC (rev 32064) @@ -26,7 +26,7 @@ #include "gfx_util.h" -//#define TRACE_AVFORMAT_READER +#define TRACE_AVFORMAT_READER #ifdef TRACE_AVFORMAT_READER # define TRACE printf # define TRACE_IO(a...) @@ -674,7 +674,7 @@ *duration = (bigtime_t)(1000000LL * fStream->duration * fStream->time_base.num / fStream->time_base.den); TRACE(" stream duration: %lld, time_base %.4f (%d/%d)\n", - *duration, av_q2d(fStream->time_base), + fStream->duration, av_q2d(fStream->time_base), fStream->time_base.num, fStream->time_base.den); } else if ((int64)fContext->duration != kNoPTSValue) { *duration = (bigtime_t)(1000000LL * fContext->duration / AV_TIME_BASE); @@ -844,6 +844,8 @@ mediaHeader->destination = -1; mediaHeader->time_source = -1; mediaHeader->size_used = fPacket.size; +//TRACE(" PTS: %lld (time_base.num: %d, .den: %d)\n", +//fPacket.pts, fStream->time_base.num, fStream->time_base.den); mediaHeader->start_time = (bigtime_t)(1000000.0 * fPacket.pts / av_q2d(fStream->time_base)); mediaHeader->file_pos = fPacket.pos; Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatWriter.cpp =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatWriter.cpp 2009-08-01 17:10:34 UTC (rev 32063) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatWriter.cpp 2009-08-03 09:35:30 UTC (rev 32064) @@ -30,7 +30,7 @@ #ifdef TRACE_AVFORMAT_WRITER # define TRACE printf # define TRACE_IO(a...) -# define TRACE_PACKET(a...) +# define TRACE_PACKET printf #else # define TRACE(a...) # define TRACE_IO(a...) @@ -75,6 +75,7 @@ // Since different threads may write to the target, // we need to protect the file position and I/O by a lock. BLocker* fStreamLock; + int64 fChunksWritten; }; @@ -84,7 +85,8 @@ : fContext(context), fStream(NULL), - fStreamLock(streamLock) + fStreamLock(streamLock), + fChunksWritten(0) { av_new_packet(&fPacket, 0); } @@ -118,6 +120,10 @@ // frame rate fStream->codec->time_base.den = (int)format->u.raw_video.field_rate; fStream->codec->time_base.num = 1; + fStream->r_frame_rate.den = (int)format->u.raw_video.field_rate; + fStream->r_frame_rate.num = 1; + fStream->time_base.den = (int)format->u.raw_video.field_rate; + fStream->time_base.num = 1; // video size fStream->codec->width = format->u.raw_video.display.line_width; fStream->codec->height = format->u.raw_video.display.line_count; @@ -138,9 +144,75 @@ fStream->codec->pix_fmt = PIX_FMT_YUV420P; } else if (format->type == B_MEDIA_RAW_AUDIO) { avcodec_get_context_defaults2(fStream->codec, CODEC_TYPE_AUDIO); - // TODO: ... + // channels + fStream->codec->channels = format->u.raw_audio.channel_count; + switch (format->u.raw_audio.format) { + case media_raw_audio_format::B_AUDIO_FLOAT: + fStream->codec->sample_fmt = SAMPLE_FMT_FLT; + break; + case media_raw_audio_format::B_AUDIO_DOUBLE: + fStream->codec->sample_fmt = SAMPLE_FMT_DBL; + break; + case media_raw_audio_format::B_AUDIO_INT: + fStream->codec->sample_fmt = SAMPLE_FMT_S32; + break; + case media_raw_audio_format::B_AUDIO_SHORT: + fStream->codec->sample_fmt = SAMPLE_FMT_S16; + break; + case media_raw_audio_format::B_AUDIO_UCHAR: + fStream->codec->sample_fmt = SAMPLE_FMT_U8; + break; + + case media_raw_audio_format::B_AUDIO_CHAR: + default: + return B_MEDIA_BAD_FORMAT; + break; + } + if (format->u.raw_audio.channel_mask == 0) { + // guess the channel mask... + switch (format->u.raw_audio.channel_count) { + default: + case 2: + fStream->codec->channel_layout = CH_LAYOUT_STEREO; + break; + case 1: + fStream->codec->channel_layout = CH_LAYOUT_MONO; + break; + case 3: + fStream->codec->channel_layout = CH_LAYOUT_SURROUND; + break; + case 4: + fStream->codec->channel_layout = CH_LAYOUT_QUAD; + break; + case 5: + fStream->codec->channel_layout = CH_LAYOUT_5POINT0; + break; + case 6: + fStream->codec->channel_layout = CH_LAYOUT_5POINT1; + break; + case 8: + fStream->codec->channel_layout = CH_LAYOUT_7POINT1; + break; + case 10: + fStream->codec->channel_layout = CH_LAYOUT_7POINT1_WIDE; + break; + } + } else { + // The bits match 1:1 for media_multi_channels and FFmpeg defines. + fStream->codec->channel_layout = format->u.raw_audio.channel_mask; + } + // frame rate + fStream->codec->sample_rate = (int)format->u.raw_audio.frame_rate; + fStream->codec->time_base.den = (int)format->u.raw_audio.frame_rate; + fStream->codec->time_base.num = 1; + fStream->time_base.den = (int)format->u.raw_audio.frame_rate; + fStream->time_base.num = 1; } + TRACE(" stream->time_base: (%d/%d), codec->time_base: (%d/%d))\n", + fStream->time_base.num, fStream->time_base.den, + fStream->codec->time_base.num, fStream->codec->time_base.den); + // TODO: This is a hack for now! Use avcodec_find_encoder_by_name() // or something similar... fStream->codec->codec_id = (CodecID)codecInfo->sub_id; @@ -153,8 +225,8 @@ AVFormatWriter::StreamCookie::WriteChunk(const void* chunkBuffer, size_t chunkSize, media_encode_info* encodeInfo) { - TRACE_PACKET("AVFormatWriter::StreamCookie::WriteChunk(%p, %ld)\n", - chunkBuffer, chunkSize); + TRACE_PACKET("AVFormatWriter::StreamCookie::WriteChunk(%p, %ld, " + "start_time: %lld)\n", chunkBuffer, chunkSize, encodeInfo->start_time); BAutolock _(fStreamLock); @@ -164,6 +236,19 @@ fPacket.data = const_cast((const uint8_t*)chunkBuffer); fPacket.size = chunkSize; + fPacket.pts = (encodeInfo->start_time + * fStream->time_base.den / fStream->time_base.num) / 1000000; + TRACE_PACKET(" PTS: %lld (stream->time_base: (%d/%d), " + "codec->time_base: (%d/%d))\n", fPacket.pts, + fStream->time_base.num, fStream->time_base.den, + fStream->codec->time_base.num, fStream->codec->time_base.den); + +// From ffmpeg.c::do_audio_out(): +// if (enc->coded_frame && enc->coded_frame->pts != AV_NOPTS_VALUE) +// fPacket.pts = av_rescale_q(enc->coded_frame->pts, +// enc->time_base, ost->st->time_base); + + #if 0 // TODO: Eventually, we need to write interleaved packets, but // maybe we are only supposed to use this if we have actually @@ -280,12 +365,27 @@ if (fHeaderWritten) return B_NOT_ALLOWED; + for (unsigned i = 0; i < fContext->nb_streams; i++) { + AVStream* stream = fContext->streams[i]; + TRACE(" stream[%u] time_base: (%d/%d), codec->time_base: (%d/%d)\n", + i, stream->time_base.num, stream->time_base.den, + stream->codec->time_base.num, stream->codec->time_base.den); + } + int result = av_write_header(fContext); if (result < 0) TRACE(" av_write_header(): %d\n", result); else fHeaderWritten = true; + TRACE(" wrote header\n"); + for (unsigned i = 0; i < fContext->nb_streams; i++) { + AVStream* stream = fContext->streams[i]; + TRACE(" stream[%u] time_base: (%d/%d), codec->time_base: (%d/%d)\n", + i, stream->time_base.num, stream->time_base.den, + stream->codec->time_base.num, stream->codec->time_base.den); + } + return result == 0 ? B_OK : B_ERROR; } @@ -383,8 +483,8 @@ AVFormatWriter::WriteChunk(void* _cookie, const void* chunkBuffer, size_t chunkSize, media_encode_info* encodeInfo) { - TRACE("AVFormatWriter::WriteChunk(%p, %ld, %p)\n", chunkBuffer, chunkSize, - encodeInfo); + TRACE_PACKET("AVFormatWriter::WriteChunk(%p, %ld, %p)\n", chunkBuffer, + chunkSize, encodeInfo); StreamCookie* cookie = reinterpret_cast(_cookie); return cookie->WriteChunk(chunkBuffer, chunkSize, encodeInfo); Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/EncoderTable.cpp =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/EncoderTable.cpp 2009-08-01 17:10:34 UTC (rev 32063) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/EncoderTable.cpp 2009-08-03 09:35:30 UTC (rev 32064) @@ -48,18 +48,18 @@ B_MEDIA_RAW_VIDEO, B_MEDIA_ENCODED_VIDEO }, -// { -// { -// "MP3 Audio", -// "mp3", -// 0, -// CODEC_ID_MP3, -// { 0 } -// }, -// B_ANY_FORMAT_FAMILY, -// B_MEDIA_RAW_AUDIO, -// B_MEDIA_ENCODED_AUDIO -// } + { + { + "Raw Audio", + "pcm", + 0, + CODEC_ID_PCM_S16LE, + { 0 } + }, + B_ANY_FORMAT_FAMILY, + B_MEDIA_RAW_AUDIO, + B_MEDIA_ENCODED_AUDIO + } }; const size_t gEncoderCount = sizeof(gEncoderTable) / sizeof(EncoderDescription); From stippi at mail.berlios.de Mon Aug 3 11:56:19 2009 From: stippi at mail.berlios.de (stippi at mail.berlios.de) Date: Mon, 3 Aug 2009 11:56:19 +0200 Subject: [Haiku-commits] r32065 - haiku/trunk/build/jam Message-ID: <200908030956.n739uJ51016316@sheep.berlios.de> Author: stippi Date: 2009-08-03 11:56:17 +0200 (Mon, 03 Aug 2009) New Revision: 32065 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32065&view=rev Modified: haiku/trunk/build/jam/HaikuImage Log: Added MediaConverter to the build. It still needs a nice new icon though... Modified: haiku/trunk/build/jam/HaikuImage =================================================================== --- haiku/trunk/build/jam/HaikuImage 2009-08-03 09:35:30 UTC (rev 32064) +++ haiku/trunk/build/jam/HaikuImage 2009-08-03 09:56:17 UTC (rev 32065) @@ -66,9 +66,9 @@ SYSTEM_APPS = AboutSystem ActivityMonitor CharacterMap CodyCam DeskCalc DiskProbe DiskUsage DriveSetup CDPlayer Expander Icon-O-Matic Installer LaunchBox - Magnify Mail MediaPlayer MidiPlayer NetworkStatus PackageInstaller People - PoorMan PowerStatus ProcessController Screenshot ShowImage SoundRecorder - StyledEdit Terminal TextSearch TV Workspaces + Magnify Mail MediaConverter MediaPlayer MidiPlayer NetworkStatus + PackageInstaller People PoorMan PowerStatus ProcessController Screenshot + ShowImage SoundRecorder StyledEdit Terminal TextSearch TV Workspaces ; SYSTEM_PREFERENCES = Appearance Backgrounds CPUFrequency DataTranslations E-mail FileTypes Fonts Keyboard Keymap Locale Media Mouse Network Printers @@ -284,8 +284,9 @@ # Deskbar Application links AddDirectoryToHaikuImage home config be Applications ; DESKBAR_APPLICATIONS = ActivityMonitor CharacterMap CodyCam CDPlayer DeskCalc - DiskProbe DriveSetup DiskUsage Expander Icon-O-Matic Magnify Mail MediaPlayer - MidiPlayer People PoorMan Screenshot SoundRecorder StyledEdit Terminal TV + DiskProbe DriveSetup DiskUsage Expander Icon-O-Matic Magnify Mail + MediaConverter MediaPlayer MidiPlayer People PoorMan Screenshot + SoundRecorder StyledEdit Terminal TV ; local linkTarget ; for linkTarget in $(DESKBAR_APPLICATIONS) { From axeld at mail.berlios.de Mon Aug 3 12:04:46 2009 From: axeld at mail.berlios.de (axeld at mail.berlios.de) Date: Mon, 3 Aug 2009 12:04:46 +0200 Subject: [Haiku-commits] r32066 - haiku/trunk/src/servers/app Message-ID: <200908031004.n73A4k4v017976@sheep.berlios.de> Author: axeld Date: 2009-08-03 12:04:43 +0200 (Mon, 03 Aug 2009) New Revision: 32066 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32066&view=rev Modified: haiku/trunk/src/servers/app/FontManager.cpp Log: * Fixed style. Modified: haiku/trunk/src/servers/app/FontManager.cpp =================================================================== --- haiku/trunk/src/servers/app/FontManager.cpp 2009-08-03 09:56:17 UTC (rev 32065) +++ haiku/trunk/src/servers/app/FontManager.cpp 2009-08-03 10:04:43 UTC (rev 32066) @@ -1,5 +1,5 @@ /* - * Copyright 2001-2008, Haiku. + * Copyright 2001-2009, Haiku. * Distributed under the terms of the MIT License. * * Authors: @@ -511,7 +511,7 @@ while (true) { // We just want the file in the kernel file cache... ssize_t read = file.Read(buffer, bufferSize); - if (read < (ssize_t) bufferSize) + if (read < (ssize_t)bufferSize) break; } From mmu_man at mail.berlios.de Mon Aug 3 12:10:51 2009 From: mmu_man at mail.berlios.de (mmu_man at mail.berlios.de) Date: Mon, 3 Aug 2009 12:10:51 +0200 Subject: [Haiku-commits] r32067 - in haiku/trunk: headers/private/kernel src/system/boot/platform/openfirmware/arch/ppc src/system/kernel/arch/ppc Message-ID: <200908031010.n73AAp0F018885@sheep.berlios.de> Author: mmu_man Date: 2009-08-03 12:10:22 +0200 (Mon, 03 Aug 2009) New Revision: 32067 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32067&view=rev Modified: haiku/trunk/headers/private/kernel/user_atomic.h haiku/trunk/src/system/boot/platform/openfirmware/arch/ppc/mmu.cpp haiku/trunk/src/system/kernel/arch/ppc/arch_asm.S haiku/trunk/src/system/kernel/arch/ppc/arch_cpu.cpp haiku/trunk/src/system/kernel/arch/ppc/arch_cpu_asm.S Log: Some ppc fixes for #4115, patch by kallisti5 (without the #ifdef _BOOT_MODE): - stubbed out arch_cpu_init_percpu(), - make atomic ops declarations extern "C", - move calls to [i]sync inside the asm code that needs it. Modified: haiku/trunk/headers/private/kernel/user_atomic.h =================================================================== --- haiku/trunk/headers/private/kernel/user_atomic.h 2009-08-03 10:04:43 UTC (rev 32066) +++ haiku/trunk/headers/private/kernel/user_atomic.h 2009-08-03 10:10:22 UTC (rev 32067) @@ -9,6 +9,10 @@ * in userspace, they are implemented as these syscalls. */ +#ifdef __cplusplus +extern "C" { +#endif + int32 _user_atomic_set(vint32 *value, int32 newValue); int32 _user_atomic_test_and_set(vint32 *value, int32 newValue, int32 testAgainst); int32 _user_atomic_add(vint32 *value, int32 addValue); @@ -23,4 +27,9 @@ int64 _user_atomic_or64(vint64 *value, int64 orValue); int64 _user_atomic_get64(vint64 *value); +#ifdef __cplusplus +} +#endif + + #endif /* _KERNEL_USER_ATOMIC_H */ Modified: haiku/trunk/src/system/boot/platform/openfirmware/arch/ppc/mmu.cpp =================================================================== --- haiku/trunk/src/system/boot/platform/openfirmware/arch/ppc/mmu.cpp 2009-08-03 10:04:43 UTC (rev 32066) +++ haiku/trunk/src/system/boot/platform/openfirmware/arch/ppc/mmu.cpp 2009-08-03 10:10:22 UTC (rev 32067) @@ -991,12 +991,8 @@ // set up new page table and turn on translation again for (int32 i = 0; i < 16; i++) { - isync(); - ppc_set_segment_register((void *)(i * 0x10000000), sSegments[i]); // one segment describes 256 MB of memory - - ppc_sync(); } ppc_set_page_table(physicalTable, tableSize); Modified: haiku/trunk/src/system/kernel/arch/ppc/arch_asm.S =================================================================== --- haiku/trunk/src/system/kernel/arch/ppc/arch_asm.S 2009-08-03 10:04:43 UTC (rev 32066) +++ haiku/trunk/src/system/kernel/arch/ppc/arch_asm.S 2009-08-03 10:10:22 UTC (rev 32067) @@ -26,6 +26,7 @@ // sets bit 15, EE mtmsr %r3 // put it back into the msr + isync blr @@ -40,6 +41,7 @@ // clears bit 15, EE mtmsr %r4 // put it back into the msr + isync blr @@ -53,6 +55,7 @@ // clear or set bit 15, EE to the same state as in r3, oldState mtmsr %r4 + isync blr /* bool arch_int_are_interrupts_enabled(void) */ @@ -175,7 +178,9 @@ // void sethid0(unsigned int val); FUNCTION(sethid0): + isync mtspr 1008, %r3 + isync blr // unsigned int getl2cr(); @@ -185,7 +190,9 @@ // void setl2cr(unsigned int val); FUNCTION(setl2cr): + isync mtspr 1017, %r3 + isync blr Modified: haiku/trunk/src/system/kernel/arch/ppc/arch_cpu.cpp =================================================================== --- haiku/trunk/src/system/kernel/arch/ppc/arch_cpu.cpp 2009-08-03 10:04:43 UTC (rev 32066) +++ haiku/trunk/src/system/kernel/arch/ppc/arch_cpu.cpp 2009-08-03 10:10:22 UTC (rev 32067) @@ -48,6 +48,16 @@ } status_t +arch_cpu_init_percpu(kernel_args *args, int curr_cpu) +{ + //detect_cpu(curr_cpu); + + // we only support one on ppc anyway at the moment... + //XXX: WRITEME + return 0; +} + +status_t arch_cpu_init_post_modules(kernel_args *args) { return B_OK; Modified: haiku/trunk/src/system/kernel/arch/ppc/arch_cpu_asm.S =================================================================== --- haiku/trunk/src/system/kernel/arch/ppc/arch_cpu_asm.S 2009-08-03 10:04:43 UTC (rev 32066) +++ haiku/trunk/src/system/kernel/arch/ppc/arch_cpu_asm.S 2009-08-03 10:10:22 UTC (rev 32067) @@ -31,7 +31,9 @@ * r3 r4 */ FUNCTION(set_sr): + isync mtsrin %r4, %r3 + isync blr /* uint32 get_msr(void); @@ -45,6 +47,7 @@ */ FUNCTION(set_msr): mtmsr %r3 + isync blr /* uint32 get_pvr(void); From stippi at mail.berlios.de Mon Aug 3 12:34:27 2009 From: stippi at mail.berlios.de (stippi at mail.berlios.de) Date: Mon, 3 Aug 2009 12:34:27 +0200 Subject: [Haiku-commits] r32068 - haiku/trunk/src/apps/mediaconverter Message-ID: <200908031034.n73AYRro027961@sheep.berlios.de> Author: stippi Date: 2009-08-03 12:33:52 +0200 (Mon, 03 Aug 2009) New Revision: 32068 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32068&view=rev Modified: haiku/trunk/src/apps/mediaconverter/Jamfile haiku/trunk/src/apps/mediaconverter/MediaConverterApp.cpp haiku/trunk/src/apps/mediaconverter/MediaConverterWindow.cpp haiku/trunk/src/apps/mediaconverter/MediaConverterWindow.h haiku/trunk/src/apps/mediaconverter/MediaFileListView.cpp haiku/trunk/src/apps/mediaconverter/MediaFileListView.h Log: Fixed GCC4 build and added handling of allocation failures in some places. Modified: haiku/trunk/src/apps/mediaconverter/Jamfile =================================================================== --- haiku/trunk/src/apps/mediaconverter/Jamfile 2009-08-03 10:10:22 UTC (rev 32067) +++ haiku/trunk/src/apps/mediaconverter/Jamfile 2009-08-03 10:33:52 UTC (rev 32068) @@ -10,6 +10,6 @@ MediaFileListView.cpp StatusView.cpp - : be media tracker + : be media tracker $(TARGET_LIBSTDC++) : MediaConverter.rdef ; Modified: haiku/trunk/src/apps/mediaconverter/MediaConverterApp.cpp =================================================================== --- haiku/trunk/src/apps/mediaconverter/MediaConverterApp.cpp 2009-08-03 10:10:22 UTC (rev 32067) +++ haiku/trunk/src/apps/mediaconverter/MediaConverterApp.cpp 2009-08-03 10:33:52 UTC (rev 32068) @@ -23,17 +23,16 @@ #include "Strings.h" -using std::nothrow; - const char APP_SIGNATURE[] = "application/x-vnd.Haiku-MediaConverter"; MediaConverterApp::MediaConverterApp() - : BApplication(APP_SIGNATURE) - , fWin(NULL) - , fConvertThreadID(-1) - , fConverting(false) - , fCancel(false) + : + BApplication(APP_SIGNATURE), + fWin(NULL), + fConvertThreadID(-1), + fConverting(false), + fCancel(false) { // TODO: implement settings for window pos fWin = new MediaConverterWindow(BRect(50, 50, 520, 555)); @@ -99,22 +98,23 @@ { entry_ref ref; int32 i = 0; - BMediaFile *f; BString errorFiles; int32 errors = 0; // from Open dialog or drag & drop while (msg->FindRef("refs", i++, &ref) == B_OK) { - f = new BMediaFile(&ref/*, B_MEDIA_FILE_NO_READ_AHEAD*/); - if (f->InitCheck() != B_OK) { + uint32 flags = 0; // B_MEDIA_FILE_NO_READ_AHEAD + BMediaFile* file = new(std::nothrow) BMediaFile(&ref, flags); + if (file == NULL || file->InitCheck() != B_OK) { errorFiles << ref.name << "\n"; errors++; - delete f; + delete file; continue; } if (fWin->Lock()) { - fWin->AddSourceFile(f, ref); + if (!fWin->AddSourceFile(file, ref)) + delete file; fWin->Unlock(); } } @@ -408,7 +408,8 @@ = inFormat.u.raw_video.pixel_height_aspect; } - videoBuffer = new (nothrow) uint8[height * rvf->display.bytes_per_row]; + videoBuffer = new (std::nothrow) uint8[height + * rvf->display.bytes_per_row]; outVidTrack = outFile->CreateTrack(&outVidFormat, videoCodec); if (outVidTrack != NULL) { @@ -417,7 +418,8 @@ BView* encoderView = outVidTrack->GetParameterView(); if (encoderView) { MediaEncoderWindow* encoderWin - = new MediaEncoderWindow(BRect(50, 50, 520, 555), encoderView); + = new MediaEncoderWindow(BRect(50, 50, 520, 555), + encoderView); encoderWin->Go(); // blocks until the window is quit Modified: haiku/trunk/src/apps/mediaconverter/MediaConverterWindow.cpp =================================================================== --- haiku/trunk/src/apps/mediaconverter/MediaConverterWindow.cpp 2009-08-03 10:10:22 UTC (rev 32067) +++ haiku/trunk/src/apps/mediaconverter/MediaConverterWindow.cpp 2009-08-03 10:33:52 UTC (rev 32068) @@ -343,11 +343,12 @@ BString string, string2; - // TODO: for preview, launch the default file app instead of hardcoded MediaPlayer + // TODO: For preview, launch the default file app instead of hardcoded + // MediaPlayer BEntry entry("/boot/system/apps/MediaPlayer", true); char buffer[40]; char buffer2[B_PATH_NAME_LENGTH]; - char *argv[3]; + const char* argv[3]; argv[0] = "-pos"; BMediaFile *inFile(NULL); int32 srcIndex = 0; @@ -501,7 +502,7 @@ string << fStartDurationTC->Text(); string << "000"; - strcpy(buffer,string.String()); + strcpy(buffer, string.String()); argv[1] = buffer; srcIndex = fListView->CurrentSelection(); status = GetSourceFileAt(srcIndex, &inFile, &inRef); @@ -512,7 +513,7 @@ strcpy(buffer, string.String()); strcpy(buffer2, name.Path()); - argv[2]= buffer2; + argv[2] = buffer2; } status = be_roster->Launch(&ref, 3, argv); @@ -752,16 +753,19 @@ // #pragma mark - -void +bool MediaConverterWindow::AddSourceFile(BMediaFile* file, const entry_ref& ref) { - fListView->AddItem(file, ref); + if (!fListView->AddMediaItem(file, ref)) + return false; if (!fOutputDirSpecified) { BEntry entry(&ref); entry.GetParent(&entry); _SetOutputFolder(entry); } + + return true; } Modified: haiku/trunk/src/apps/mediaconverter/MediaConverterWindow.h =================================================================== --- haiku/trunk/src/apps/mediaconverter/MediaConverterWindow.h 2009-08-03 10:10:22 UTC (rev 32067) +++ haiku/trunk/src/apps/mediaconverter/MediaConverterWindow.h 2009-08-03 10:33:52 UTC (rev 32068) @@ -44,11 +44,11 @@ media_file_format** _format, media_codec_info** _audio, media_codec_info** _video); - + void SetStatusMessage(const char *message); void SetFileMessage(const char *message); - - void AddSourceFile(BMediaFile* file, + + bool AddSourceFile(BMediaFile* file, const entry_ref& ref); void RemoveSourceFile(int32 index); int32 CountSourceFiles(); Modified: haiku/trunk/src/apps/mediaconverter/MediaFileListView.cpp =================================================================== --- haiku/trunk/src/apps/mediaconverter/MediaFileListView.cpp 2009-08-03 10:10:22 UTC (rev 32067) +++ haiku/trunk/src/apps/mediaconverter/MediaFileListView.cpp 2009-08-03 10:33:52 UTC (rev 32068) @@ -1,9 +1,13 @@ // Copyright 1999, Be Incorporated. All Rights Reserved. // Copyright 2000-2004, Jun Suzuki. All Rights Reserved. -// Copyright 2007, Stephan A?mus. All Rights Reserved. +// Copyright 2007, 2009 Stephan A?mus. All Rights Reserved. // This file may be used under the terms of the Be Sample Code License. + + #include "MediaFileListView.h" +#include + #include #include #include @@ -16,9 +20,10 @@ MediaFileListItem::MediaFileListItem(BMediaFile* file, const entry_ref& ref) - : BStringItem(ref.name), - fRef(ref), - fMediaFile(file) + : + BStringItem(ref.name), + fRef(ref), + fMediaFile(file) { } @@ -49,7 +54,7 @@ } -void +void MediaFileListView::SetEnabled(bool enabled) { if (enabled == fEnabled) @@ -60,22 +65,27 @@ } -bool +bool MediaFileListView::IsEnabled() const { return fEnabled; } -void -MediaFileListView::AddItem(BMediaFile* file, const entry_ref& ref) +bool +MediaFileListView::AddMediaItem(BMediaFile* file, const entry_ref& ref) { - BListView::AddItem(new MediaFileListItem(file, ref)); + MediaFileListItem* item = new(std::nothrow) MediaFileListItem(file, ref); + if (item == NULL || !AddItem(item)) { + delete item; + return false; + } be_app_messenger.SendMessage(FILE_LIST_CHANGE_MESSAGE); + return true; } -void +void MediaFileListView::KeyDown(const char *bytes, int32 numBytes) { switch (bytes[0]) { @@ -90,7 +100,7 @@ selection = count - 1; Select(selection); be_app_messenger.SendMessage(FILE_LIST_CHANGE_MESSAGE); - } + } } break; default: @@ -99,10 +109,10 @@ } -void +void MediaFileListView::SelectionChanged() { - MediaConverterWindow* win = dynamic_cast(Window()); + MediaConverterWindow* win = dynamic_cast(Window()); if (win != NULL) win->SourceFileSelectionChanged(); } Modified: haiku/trunk/src/apps/mediaconverter/MediaFileListView.h =================================================================== --- haiku/trunk/src/apps/mediaconverter/MediaFileListView.h 2009-08-03 10:10:22 UTC (rev 32067) +++ haiku/trunk/src/apps/mediaconverter/MediaFileListView.h 2009-08-03 10:33:52 UTC (rev 32068) @@ -15,7 +15,7 @@ class MediaFileListItem : public BStringItem { - public: +public: MediaFileListItem(BMediaFile* file, const entry_ref& ref); virtual ~MediaFileListItem(); @@ -25,22 +25,23 @@ class MediaFileListView : public BListView { - public: +public: MediaFileListView(BRect frame, uint32 resizingMode); virtual ~MediaFileListView(); - protected: +protected: virtual void KeyDown(const char *bytes, int32 numBytes); virtual void SelectionChanged(); - public: - void AddItem(BMediaFile* file, const entry_ref& ref); +public: + bool AddMediaItem(BMediaFile* file, + const entry_ref& ref); void SetEnabled(bool enabled); bool IsEnabled() const; - private: +private: bool fEnabled; }; From aldeck at mail.berlios.de Mon Aug 3 12:55:22 2009 From: aldeck at mail.berlios.de (aldeck at mail.berlios.de) Date: Mon, 3 Aug 2009 12:55:22 +0200 Subject: [Haiku-commits] r32069 - haiku/trunk/src/apps/haiku3d Message-ID: <200908031055.n73AtM20020147@sheep.berlios.de> Author: aldeck Date: 2009-08-03 12:55:13 +0200 (Mon, 03 Aug 2009) New Revision: 32069 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32069&view=rev Modified: haiku/trunk/src/apps/haiku3d/Mesh.h haiku/trunk/src/apps/haiku3d/MeshInstance.cpp haiku/trunk/src/apps/haiku3d/RenderView.cpp haiku/trunk/src/apps/haiku3d/Texture.cpp haiku/trunk/src/apps/haiku3d/Texture.h Log: * Style fixes * Moved the wait_for_thread in _StopRenderThread() Modified: haiku/trunk/src/apps/haiku3d/Mesh.h =================================================================== --- haiku/trunk/src/apps/haiku3d/Mesh.h 2009-08-03 10:33:52 UTC (rev 32068) +++ haiku/trunk/src/apps/haiku3d/Mesh.h 2009-08-03 10:55:13 UTC (rev 32069) @@ -29,7 +29,7 @@ class Mesh : public Referenceable { public: - virtual ~Mesh(); + virtual ~Mesh(); virtual Face& GetFace(uint32 index) const = 0; virtual uint32 FaceCount() const = 0; Modified: haiku/trunk/src/apps/haiku3d/MeshInstance.cpp =================================================================== --- haiku/trunk/src/apps/haiku3d/MeshInstance.cpp 2009-08-03 10:33:52 UTC (rev 32068) +++ haiku/trunk/src/apps/haiku3d/MeshInstance.cpp 2009-08-03 10:55:13 UTC (rev 32069) @@ -105,50 +105,50 @@ // draw face glNormal3f(normal.x(), normal.y(), normal.z()); - glTexCoord2f(face.v[0].u, face.v[0].v); - glVertex3f(face.v[0].p.x(), face.v[0].p.y(), face.v[0].p.z()); + glTexCoord2f(face.v[0].u, face.v[0].v); + glVertex3f(face.v[0].p.x(), face.v[0].p.y(), face.v[0].p.z()); - glNormal3f(normal.x(), normal.y(), normal.z()); - glTexCoord2f(face.v[1].u, face.v[1].v); - glVertex3f(face.v[1].p.x(), face.v[1].p.y(), face.v[1].p.z()); + glNormal3f(normal.x(), normal.y(), normal.z()); + glTexCoord2f(face.v[1].u, face.v[1].v); + glVertex3f(face.v[1].p.x(), face.v[1].p.y(), face.v[1].p.z()); - glNormal3f(normal.x(), normal.y(), normal.z()); - glTexCoord2f(face.v[2].u, face.v[2].v); - glVertex3f(face.v[2].p.x(), face.v[2].p.y(), face.v[2].p.z()); + glNormal3f(normal.x(), normal.y(), normal.z()); + glTexCoord2f(face.v[2].u, face.v[2].v); + glVertex3f(face.v[2].p.x(), face.v[2].p.y(), face.v[2].p.z()); - if (face.vertexCount == 4) { - glNormal3f(normal.x(), normal.y(), normal.z()); - glTexCoord2f(face.v[3].u, face.v[3].v); - glVertex3f(face.v[3].p.x(), face.v[3].p.y(), face.v[3].p.z()); - } + if (face.vertexCount == 4) { + glNormal3f(normal.x(), normal.y(), normal.z()); + glTexCoord2f(face.v[3].u, face.v[3].v); + glVertex3f(face.v[3].p.x(), face.v[3].p.y(), face.v[3].p.z()); + } - if (fDoubleSided) { - if (face.vertexCount == 4) { - glNormal3f(-normal.x(), -normal.y(), -normal.z()); - glTexCoord2f(face.v[3].u, face.v[3].v); - glVertex3f(face.v[3].p.x(), face.v[3].p.y(), face.v[3].p.z()); - } + if (fDoubleSided) { + if (face.vertexCount == 4) { + glNormal3f(-normal.x(), -normal.y(), -normal.z()); + glTexCoord2f(face.v[3].u, face.v[3].v); + glVertex3f(face.v[3].p.x(), face.v[3].p.y(), face.v[3].p.z()); + } - glNormal3f(-normal.x(), -normal.y(), -normal.z()); - glTexCoord2f(face.v[2].u, face.v[2].v); - glVertex3f(face.v[2].p.x(), face.v[2].p.y(), face.v[2].p.z()); + glNormal3f(-normal.x(), -normal.y(), -normal.z()); + glTexCoord2f(face.v[2].u, face.v[2].v); + glVertex3f(face.v[2].p.x(), face.v[2].p.y(), face.v[2].p.z()); - glNormal3f(-normal.x(), -normal.y(), -normal.z()); - glTexCoord2f(face.v[1].u, face.v[1].v); - glVertex3f(face.v[1].p.x(), face.v[1].p.y(), face.v[1].p.z()); + glNormal3f(-normal.x(), -normal.y(), -normal.z()); + glTexCoord2f(face.v[1].u, face.v[1].v); + glVertex3f(face.v[1].p.x(), face.v[1].p.y(), face.v[1].p.z()); - glNormal3f(-normal.x(), -normal.y(), -normal.z()); - glTexCoord2f(face.v[0].u, face.v[0].v); - glVertex3f(face.v[0].p.x(), face.v[0].p.y(), face.v[0].p.z()); - } - lastVertexCount = face.vertexCount; + glNormal3f(-normal.x(), -normal.y(), -normal.z()); + glTexCoord2f(face.v[0].u, face.v[0].v); + glVertex3f(face.v[0].p.x(), face.v[0].p.y(), face.v[0].p.z()); + } + lastVertexCount = face.vertexCount; } glEnd(); //printf("batchCount %d\n", batchCount); - if (fDrawNormals) { - glBegin(GL_LINES); - for(uint32 i = 0; i < fMeshReference->FaceCount(); i++) { + if (fDrawNormals) { + glBegin(GL_LINES); + for(uint32 i = 0; i < fMeshReference->FaceCount(); i++) { const Face& face = fMeshReference->GetFace(i); Modified: haiku/trunk/src/apps/haiku3d/RenderView.cpp =================================================================== --- haiku/trunk/src/apps/haiku3d/RenderView.cpp 2009-08-03 10:33:52 UTC (rev 32068) +++ haiku/trunk/src/apps/haiku3d/RenderView.cpp 2009-08-03 10:55:13 UTC (rev 32069) @@ -39,10 +39,6 @@ RenderView::~RenderView() { _StopRenderThread(); - - if (fRenderThread >= 0) - wait_for_thread(fRenderThread, NULL); - _DeleteScene(); } @@ -62,10 +58,9 @@ uint32 RenderView::_CreateRenderThread() { - fRenderThread = spawn_thread(RenderView::_RenderThreadEntry, - "renderThread", - B_NORMAL_PRIORITY, - this); + fRenderThread = spawn_thread(RenderView::_RenderThreadEntry, "renderThread", + B_NORMAL_PRIORITY, this); + if (fRenderThread < 0) return fRenderThread; @@ -79,6 +74,9 @@ LockGL(); fStopRendering = true; UnlockGL(); + + if (fRenderThread >= 0) + wait_for_thread(fRenderThread, NULL); } @@ -178,10 +176,9 @@ Quaternion(0, 0, 0, 1), 4.0f * timeSpacing); fMeshInstances.push_back(instance); mesh->ReleaseReference(); + texture->ReleaseReference(); fMainCamera = new Camera(Vector3(0, 0, 0), Quaternion(0, 0, 0, 1), 50); - - texture->ReleaseReference(); } @@ -200,7 +197,7 @@ RenderView::_UpdateViewport() { if (fNextRes != fRes && fNextRes.x >= 1.0 && fNextRes.y >= 1.0) { - glViewport(0, 0, (GLint)fNextRes.x + 1, (GLint)fNextRes.y + 1); + glViewport(0, 0, (GLint) fNextRes.x + 1, (GLint) fNextRes.y + 1); fRes = fNextRes; _UpdateCamera(); } @@ -227,10 +224,10 @@ _UpdateViewport(); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - glLoadIdentity(); + glLoadIdentity(); - bigtime_t time = system_time(); - float deltaTime = 0.000001 * (float)(time - fLastFrameTime); + bigtime_t time = system_time(); + float deltaTime = 0.000001 * (float)(time - fLastFrameTime); fLastFrameTime = time; MeshInstanceList::iterator it = fMeshInstances.begin(); @@ -243,7 +240,7 @@ UnlockGL(); return false; } - UnlockGL(); + UnlockGL(); SwapBuffers(false); // true = vsync return true; } Modified: haiku/trunk/src/apps/haiku3d/Texture.cpp =================================================================== --- haiku/trunk/src/apps/haiku3d/Texture.cpp 2009-08-03 10:33:52 UTC (rev 32068) +++ haiku/trunk/src/apps/haiku3d/Texture.cpp 2009-08-03 10:55:13 UTC (rev 32069) @@ -32,3 +32,9 @@ { return fId; } + + +void +Texture::Update(float dt) +{ +} Modified: haiku/trunk/src/apps/haiku3d/Texture.h =================================================================== --- haiku/trunk/src/apps/haiku3d/Texture.h 2009-08-03 10:33:52 UTC (rev 32068) +++ haiku/trunk/src/apps/haiku3d/Texture.h 2009-08-03 10:55:13 UTC (rev 32069) @@ -20,7 +20,7 @@ GLuint Id(); - virtual void Update(float dt) {}; + virtual void Update(float dt); protected: GLuint fId; From pulkomandy at mail.berlios.de Mon Aug 3 12:57:05 2009 From: pulkomandy at mail.berlios.de (pulkomandy at BerliOS) Date: Mon, 3 Aug 2009 12:57:05 +0200 Subject: [Haiku-commits] r32070 - in haiku/branches/components/gsoc-locale-kit: headers/private/shared src/kits/locale src/preferences/locale src/tools/locale Message-ID: <200908031057.n73Av5nH023113@sheep.berlios.de> Author: pulkomandy Date: 2009-08-03 12:57:03 +0200 (Mon, 03 Aug 2009) New Revision: 32070 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32070&view=rev Modified: haiku/branches/components/gsoc-locale-kit/headers/private/shared/OpenHashTable.h haiku/branches/components/gsoc-locale-kit/src/kits/locale/LocaleRoster.cpp haiku/branches/components/gsoc-locale-kit/src/preferences/locale/LocaleWindow.cpp haiku/branches/components/gsoc-locale-kit/src/tools/locale/Jamfile Log: More work on the locale preflet. Some code stolen from Icon-O-Matic allow you to drag and drop languages between the two lists. The settings are still not saved properly. This is the next step... Modified: haiku/branches/components/gsoc-locale-kit/headers/private/shared/OpenHashTable.h =================================================================== --- haiku/branches/components/gsoc-locale-kit/headers/private/shared/OpenHashTable.h 2009-08-03 10:55:13 UTC (rev 32069) +++ haiku/branches/components/gsoc-locale-kit/headers/private/shared/OpenHashTable.h 2009-08-03 10:57:03 UTC (rev 32070) @@ -45,7 +45,7 @@ #ifndef __OPEN_HASH_TABLE__ #define __OPEN_HASH_TABLE__ -#include +#include #include // don't include Modified: haiku/branches/components/gsoc-locale-kit/src/kits/locale/LocaleRoster.cpp =================================================================== --- haiku/branches/components/gsoc-locale-kit/src/kits/locale/LocaleRoster.cpp 2009-08-03 10:55:13 UTC (rev 32069) +++ haiku/branches/components/gsoc-locale-kit/src/kits/locale/LocaleRoster.cpp 2009-08-03 10:57:03 UTC (rev 32070) @@ -182,9 +182,9 @@ BString langName; if (find_directory(B_USER_SETTINGS_DIRECTORY, &path) == B_OK) { path.Append("Locale settings"); - if (file.SetTo(path.Path(), B_READ_ONLY) == B_OK && - settingsMessage.Unflatten(&file) == B_OK) { - if (settingsMessage.FindString("language",&langName) == B_OK) { + if (file.SetTo(path.Path(), B_READ_ONLY) == B_OK + && settingsMessage.Unflatten(&file) == B_OK) { + if (settingsMessage.FindString("language", &langName) == B_OK) { fPreferredLanguages.ReplaceString("language", langName); UErrorCode icuError = U_ZERO_ERROR; Locale icuLocale = Locale::createCanonical(langName.String()); Modified: haiku/branches/components/gsoc-locale-kit/src/preferences/locale/LocaleWindow.cpp =================================================================== --- haiku/branches/components/gsoc-locale-kit/src/preferences/locale/LocaleWindow.cpp 2009-08-03 10:55:13 UTC (rev 32069) +++ haiku/branches/components/gsoc-locale-kit/src/preferences/locale/LocaleWindow.cpp 2009-08-03 10:57:03 UTC (rev 32070) @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -29,8 +30,10 @@ #define TR_CONTEXT "Locale Preflet Window" +#define MAX_DRAG_HEIGHT 200.0 +#define ALPHA 170 +#define TEXT_OFFSET 5.0 - // Language lists management @@ -47,23 +50,264 @@ ~LanguageListItem() {}; const inline BString getLanguageCode() { return LanguageCode; } + void Draw(BView *owner, BRect frame); private: const BString LanguageCode; }; +void +LanguageListItem::Draw(BView *owner, BRect frame) +{ + owner->SetLowColor(255, 255, 255, 255); + owner->FillRect(frame, B_SOLID_LOW); + // label + owner->SetHighColor(0, 0, 0, 255); + font_height fh; + owner->GetFontHeight(&fh); + const char* text = Text(); + BString truncatedString(text); + owner->TruncateString(&truncatedString, B_TRUNCATE_MIDDLE, + frame.Width() - TEXT_OFFSET - 4.0); + float height = frame.Height(); + float textHeight = fh.ascent + fh.descent; + BPoint textPoint; + textPoint.x = frame.left + TEXT_OFFSET; + textPoint.y = frame.top + + ceilf(height / 2.0 - textHeight / 2.0 + + fh.ascent); + owner->DrawString(truncatedString.String(), textPoint); +} + + // This is a language list. Basically, a drag-n-drop enabled list. class LanguageListView: public BListView { public: - bool InitiateDrag(BPoint point, int32 index, bool wasSelected) + LanguageListView(const char* name, list_view_type type) + : BListView(name, type) + {} + + bool InitiateDrag(BPoint point, int32 index, bool wasSelected); + void MouseMoved(BPoint where, uint32 transit, const BMessage *msg); + void MoveItems(BList& items, int32 index); + + void MessageReceived (BMessage* message) { - if (!wasSelected) return false; - return true; + if (message->what == 'DRAG') { + LanguageListView *list = NULL; + if (message->FindPointer("list", (void **)&list) == B_OK) { + if (list == this) { + int32 count = CountItems(); + if (fDropIndex < 0 || fDropIndex > count) + fDropIndex = count; + + // gather all the items from the BMessage + BList items; + int32 index; + for (int32 i = 0; message->FindInt32("index", i, &index) == B_OK; i++) + if (BListItem* item = ItemAt(index)) + items.AddItem((void*)item); + + // handle them + if (items.CountItems() > 0) { + MoveItems(items, fDropIndex); + } + fDropIndex = -1; + } else { + int32 count = CountItems(); + if (fDropIndex < 0 || fDropIndex > count) + fDropIndex = count; + + // gather all the items from the BMessage + int32 index; + for (int32 i = 0; message->FindInt32("index", i, &index) == B_OK; i++) + if (BListItem* item = list->RemoveItem(index)) { + AddItem(item,fDropIndex); + fDropIndex++; + } + + fDropIndex = -1; + } + } + } else BListView::MessageReceived(message); } + private: + int32 fDropIndex; }; +void +LanguageListView::MoveItems(BList& items, int32 index) +{ + DeselectAll(); + // we remove the items while we look at them, the insertion index is decreased + // when the items index is lower, so that we insert at the right spot after + // removal + BList removedItems; + int32 count = items.CountItems(); + for (int32 i = 0; i < count; i++) { + BListItem* item = (BListItem*)items.ItemAt(i); + int32 removeIndex = IndexOf(item); + if (RemoveItem(item) && removedItems.AddItem((void*)item)) { + if (removeIndex < index) + index--; + } + // else ??? -> blow up + } + for (int32 i = 0; + BListItem* item = (BListItem*)removedItems.ItemAt(i); i++) { + if (AddItem(item, index)) { + // after we're done, the newly inserted items will be selected + Select(index, true); + // next items will be inserted after this one + index++; + } else + delete item; + } +} + + +bool +LanguageListView::InitiateDrag(BPoint point, int32 index, bool) +{ + bool success = false; + BListItem* item = ItemAt(CurrentSelection(0)); + if (!item) { + // workarround a timing problem + Select(index); + item = ItemAt(index); + } + if (item) { + // create drag message + BMessage msg('DRAG'); + msg.AddPointer("list",(void*)(this)); + int32 index; + for (int32 i = 0; (index = CurrentSelection(i)) >= 0; i++) + msg.AddInt32("index", index); + // figure out drag rect + float width = Bounds().Width(); + BRect dragRect(0.0, 0.0, width, -1.0); + // figure out, how many items fit into our bitmap + int32 numItems; + bool fade = false; + for (numItems = 0; BListItem* item = ItemAt(CurrentSelection(numItems)); numItems++) { + dragRect.bottom += ceilf(item->Height()) + 1.0; + if (dragRect.Height() > MAX_DRAG_HEIGHT) { + fade = true; + dragRect.bottom = MAX_DRAG_HEIGHT; + numItems++; + break; + } + } + BBitmap* dragBitmap = new BBitmap(dragRect, B_RGB32, true); + if (dragBitmap && dragBitmap->IsValid()) { + if (BView *v = new BView(dragBitmap->Bounds(), "helper", + B_FOLLOW_NONE, B_WILL_DRAW)) { + dragBitmap->AddChild(v); + dragBitmap->Lock(); + BRect itemBounds(dragRect) ; + itemBounds.bottom = 0.0; + // let all selected items, that fit into our drag_bitmap, draw + for (int32 i = 0; i < numItems; i++) { + int32 index = CurrentSelection(i); + LanguageListItem* item = static_cast(ItemAt(index)); + itemBounds.bottom = itemBounds.top + ceilf(item->Height()); + if (itemBounds.bottom > dragRect.bottom) + itemBounds.bottom = dragRect.bottom; + item->Draw(v, itemBounds); + itemBounds.top = itemBounds.bottom + 1.0; + } + // make a black frame arround the edge + v->SetHighColor(0, 0, 0, 255); + v->StrokeRect(v->Bounds()); + v->Sync(); + + uint8 *bits = (uint8 *)dragBitmap->Bits(); + int32 height = (int32)dragBitmap->Bounds().Height() + 1; + int32 width = (int32)dragBitmap->Bounds().Width() + 1; + int32 bpr = dragBitmap->BytesPerRow(); + + if (fade) { + for (int32 y = 0; y < height - ALPHA / 2; y++, bits += bpr) { + uint8 *line = bits + 3; + for (uint8 *end = line + 4 * width; line < end; line += 4) + *line = ALPHA; + } + for (int32 y = height - ALPHA / 2; y < height; y++, bits += bpr) { + uint8 *line = bits + 3; + for (uint8 *end = line + 4 * width; line < end; line += 4) + *line = (height - y) << 1; + } + } else { + for (int32 y = 0; y < height; y++, bits += bpr) { + uint8 *line = bits + 3; + for (uint8 *end = line + 4 * width; line < end; line += 4) + *line = ALPHA; + } + } + dragBitmap->Unlock(); + } + } else { + delete dragBitmap; + dragBitmap = NULL; + } + if (dragBitmap) + DragMessage(&msg, dragBitmap, B_OP_ALPHA, BPoint(0.0, 0.0)); + else + DragMessage(&msg, dragRect.OffsetToCopy(point), this); + + success = true; + } + return success; +} + + +void +LanguageListView::MouseMoved(BPoint where, uint32 transit, const BMessage *msg) +{ + if (msg && (msg->what == 'DRAG')) { + switch (transit) { + case B_ENTERED_VIEW: + case B_INSIDE_VIEW: { + // set drop target through virtual function + // offset where by half of item height + BRect r = ItemFrame(0); + where.y += r.Height() / 2.0; + + int32 index = IndexOf(where); + if (index < 0) + index = CountItems(); + if (fDropIndex != index) { + fDropIndex = index; + if (fDropIndex >= 0) { + int32 count = CountItems(); + if (fDropIndex == count) { + BRect r; + if (BListItem* item = ItemAt(count - 1)) { + r = ItemFrame(count - 1); + r.top = r.bottom; + r.bottom = r.top + 1.0; + } else { + r = Bounds(); + r.bottom--; // compensate for scrollbars moved slightly out of window + } + } else { + BRect r = ItemFrame(fDropIndex); + r.top--; + r.bottom = r.top + 1.0; + } + } + } + break; + } + } + } else { + BListView::MouseMoved(where, transit, msg); + } +} + + const static uint32 kMsgSelectLanguage = 'slng'; const static uint32 kMsgDefaults = 'dflt'; const static uint32 kMsgRevert = 'revt'; @@ -94,8 +338,8 @@ { // first list: available languages - BListView *listView = new BListView("available", - B_SINGLE_SELECTION_LIST); + LanguageListView *listView = new LanguageListView("available", + B_MULTIPLE_SELECTION_LIST); listView->SetSelectionMessage(new BMessage(kMsgSelectLanguage)); BScrollView *scrollView = new BScrollView("scroller", listView, 0, false, true, B_FANCY_BORDER); @@ -118,7 +362,7 @@ currentLocale.getDisplayName(languageFullName); languageFullName.toUTF8(bbs); LanguageListItem* si = - new LanguageListItem(str,currentLanguage.String()); + new LanguageListItem(str, currentLanguage.String()); listView->AddItem(si); } @@ -141,8 +385,8 @@ */ // Second list: active languages - listView = new BListView("enabled", - B_SINGLE_SELECTION_LIST); + listView = new LanguageListView("preferred", + B_MULTIPLE_SELECTION_LIST); listView->SetSelectionMessage(new BMessage(kMsgSelectLanguage)); BScrollView *scrollViewEnabled = new BScrollView("scroller", listView, 0, false, true, B_FANCY_BORDER); @@ -244,24 +488,6 @@ // revert to last settings break; - case kMsgSelectLanguage: - { - // select language - void* tmp; - message->FindPointer("source",&tmp); - BListView* languageList = static_cast(tmp); - BMessage preferredLanguages(kMsgSettingsChanged); - preferredLanguages.AddString("language", - static_cast( - languageList->ItemAt(languageList->CurrentSelection())) - ->getLanguageCode()); - be_locale_roster->SetPreferredLanguages(&preferredLanguages); - - be_app_messenger.SendMessage(&preferredLanguages); - - break; - } - default: BWindow::MessageReceived(message); break; Modified: haiku/branches/components/gsoc-locale-kit/src/tools/locale/Jamfile =================================================================== --- haiku/branches/components/gsoc-locale-kit/src/tools/locale/Jamfile 2009-08-03 10:55:13 UTC (rev 32069) +++ haiku/branches/components/gsoc-locale-kit/src/tools/locale/Jamfile 2009-08-03 10:57:03 UTC (rev 32070) @@ -38,7 +38,7 @@ Catalog.cpp RegExp.cpp adler32.c - : $(HOST_LIBBE) ; + : $(HOST_LIBBE) $(HOST_LIBSUPC++) ; BuildPlatformMain linkcatkeys : linkcatkeys.cpp @@ -47,4 +47,4 @@ DefaultCatalog.cpp Catalog.cpp adler32.c - : $(HOST_LIBBE) ; + : $(HOST_LIBBE) $(HOST_LIBSUPC++) ; From bonefish at mail.berlios.de Mon Aug 3 13:32:20 2009 From: bonefish at mail.berlios.de (bonefish at mail.berlios.de) Date: Mon, 3 Aug 2009 13:32:20 +0200 Subject: [Haiku-commits] r32071 - haiku/trunk/src/system/kernel/arch Message-ID: <200908031132.n73BWKPb027249@sheep.berlios.de> Author: bonefish Date: 2009-08-03 13:32:08 +0200 (Mon, 03 Aug 2009) New Revision: 32071 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32071&view=rev Removed: haiku/trunk/src/system/kernel/arch/sh4/ haiku/trunk/src/system/kernel/arch/sparc/ haiku/trunk/src/system/kernel/arch/sparc64/ Log: Removed unsupported architectures. From bonefish at mail.berlios.de Mon Aug 3 13:54:34 2009 From: bonefish at mail.berlios.de (bonefish at mail.berlios.de) Date: Mon, 3 Aug 2009 13:54:34 +0200 Subject: [Haiku-commits] r32072 - haiku/trunk/src/system/kernel/arch/x86 Message-ID: <200908031154.n73BsY1A029187@sheep.berlios.de> Author: bonefish Date: 2009-08-03 13:54:25 +0200 (Mon, 03 Aug 2009) New Revision: 32072 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32072&view=rev Modified: haiku/trunk/src/system/kernel/arch/x86/arch_debug_console.c Log: Don't lock when the debugger is running. Modified: haiku/trunk/src/system/kernel/arch/x86/arch_debug_console.c =================================================================== --- haiku/trunk/src/system/kernel/arch/x86/arch_debug_console.c 2009-08-03 11:32:08 UTC (rev 32071) +++ haiku/trunk/src/system/kernel/arch/x86/arch_debug_console.c 2009-08-03 11:54:25 UTC (rev 32072) @@ -344,13 +344,18 @@ void arch_debug_serial_putchar(const char c) { - cpu_status state = disable_interrupts(); - acquire_spinlock(&sSerialOutputSpinlock); + cpu_status state = 0; + if (!debug_debugger_running()) { + state = disable_interrupts(); + acquire_spinlock(&sSerialOutputSpinlock); + } _arch_debug_serial_putchar(c); - release_spinlock(&sSerialOutputSpinlock); - restore_interrupts(state); + if (!debug_debugger_running()) { + release_spinlock(&sSerialOutputSpinlock); + restore_interrupts(state); + } } From bonefish at mail.berlios.de Mon Aug 3 14:40:29 2009 From: bonefish at mail.berlios.de (bonefish at mail.berlios.de) Date: Mon, 3 Aug 2009 14:40:29 +0200 Subject: [Haiku-commits] r32073 - in haiku/trunk: headers/private/kernel headers/private/kernel/arch headers/private/kernel/arch/x86 src/system/boot/loader src/system/boot/platform/bios_ia32 src/system/boot/platform/openfirmware/arch/ppc src/system/boot/platform/u-boot src/system/kernel src/system/kernel/arch/m68k src/system/kernel/arch/ppc src/system/kernel/arch/x86 src/system/kernel/debug src/system/kernel/slab src/system/kernel/vm Message-ID: <200908031240.n73CeTJL007743@sheep.berlios.de> Author: bonefish Date: 2009-08-03 14:39:56 +0200 (Mon, 03 Aug 2009) New Revision: 32073 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32073&view=rev Modified: haiku/trunk/headers/private/kernel/arch/debug.h haiku/trunk/headers/private/kernel/arch/vm_translation_map.h haiku/trunk/headers/private/kernel/arch/x86/arch_cpu.h haiku/trunk/headers/private/kernel/cpu.h haiku/trunk/headers/private/kernel/debug.h haiku/trunk/headers/private/kernel/kernel.h haiku/trunk/src/system/boot/loader/elf.cpp haiku/trunk/src/system/boot/loader/kernel_args.cpp haiku/trunk/src/system/boot/platform/bios_ia32/mmu.cpp haiku/trunk/src/system/boot/platform/openfirmware/arch/ppc/mmu.cpp haiku/trunk/src/system/boot/platform/u-boot/mmu.cpp haiku/trunk/src/system/kernel/arch/m68k/arch_cpu.cpp haiku/trunk/src/system/kernel/arch/m68k/arch_debug.cpp haiku/trunk/src/system/kernel/arch/m68k/arch_vm_translation_map_impl.cpp haiku/trunk/src/system/kernel/arch/ppc/arch_cpu.cpp haiku/trunk/src/system/kernel/arch/ppc/arch_debug.cpp haiku/trunk/src/system/kernel/arch/ppc/arch_vm_translation_map.cpp haiku/trunk/src/system/kernel/arch/x86/arch_debug.cpp haiku/trunk/src/system/kernel/arch/x86/arch_int.cpp haiku/trunk/src/system/kernel/arch/x86/arch_interrupts.S haiku/trunk/src/system/kernel/arch/x86/arch_vm_translation_map.cpp haiku/trunk/src/system/kernel/arch/x86/arch_x86.S haiku/trunk/src/system/kernel/arch/x86/asm_offsets.cpp haiku/trunk/src/system/kernel/arch/x86/interrupts.h haiku/trunk/src/system/kernel/arch/x86/x86_physical_page_mapper.h haiku/trunk/src/system/kernel/arch/x86/x86_physical_page_mapper_large_memory.cpp haiku/trunk/src/system/kernel/debug/debug.cpp haiku/trunk/src/system/kernel/debug/debug_commands.cpp haiku/trunk/src/system/kernel/debug/debug_parser.cpp haiku/trunk/src/system/kernel/debug/gdb.cpp haiku/trunk/src/system/kernel/elf.cpp haiku/trunk/src/system/kernel/slab/Slab.cpp haiku/trunk/src/system/kernel/vm/vm.cpp Log: * Renamed the ROUNDOWN macro to ROUNDDOWN. Also changed the implementation of ROUNDUP to use '*' and '/' -- the compiler will optimize that for powers of two anyway and this implementation works for other numbers as well. * The thread::fault_handler use in C[++] code was broken with gcc 4. At least when other functions were invoked. Trying to trick the compiler wasn't a particularly good idea anyway, since the next compiler version could break the trick again. So the general policy is to use the fault handlers only in assembly code where we have full control. Changed that for x86 (save for the vm86 mode, which has a similar mechanism), but not for the other architectures. * Introduced fault_handler, fault_handler_stack_pointer, and fault_jump_buffer fields in the cpu_ent structure, which must be used instead of thread::fault_handler in the kernel debugger. Consequently user_memcpy() must not be used in the kernel debugger either. Introduced a debug_memcpy() instead. * Introduced debug_call_with_fault_handler() function which calls a function in a setjmp() and fault handler context. The architecture specific backend arch_debug_call_with_fault_handler() has only been implemented for x86 yet. * Introduced debug_is_kernel_memory_accessible() for use in the kernel debugger. It determines whether a range of memory can be accessed in the way specified. The architecture specific back end arch_vm_translation_map_is_kernel_page_accessible() has only been implemented for x86 yet. * Added arch_debug_unset_current_thread() (only implemented for x86) to unset the current thread pointer in the kernel debugger. When entering the kernel debugger we do some basic sanity checks of the currently set thread structure and unset it, if they fail. This allows certain commands (most importantly the stack trace command) to avoid accessing the thread structure. * x86: When handling a double fault, we do now install a special handler for page faults. This allows us to gracefully catch faulting commands, even if e.g. the thread structure is toast. We are now in much better shape to deal with double faults. Hopefully avoiding the triple faults that some people have been experiencing on their hardware and ideally even allowing to use the kernel debugger normally. Modified: haiku/trunk/headers/private/kernel/arch/debug.h =================================================================== --- haiku/trunk/headers/private/kernel/arch/debug.h 2009-08-03 11:54:25 UTC (rev 32072) +++ haiku/trunk/headers/private/kernel/arch/debug.h 2009-08-03 12:39:56 UTC (rev 32073) @@ -11,6 +11,9 @@ #include +#include + + struct kernel_args; struct thread; @@ -27,6 +30,9 @@ bool arch_debug_contains_call(struct thread *thread, const char *symbol, addr_t start, addr_t end); void arch_debug_save_registers(int *); +void arch_debug_unset_current_thread(void); +void arch_debug_call_with_fault_handler(cpu_ent* cpu, jmp_buf jumpBuffer, + void (*function)(void*), void* parameter); bool arch_is_debug_variable_defined(const char* variableName); status_t arch_set_debug_variable(const char* variableName, uint64 value); Modified: haiku/trunk/headers/private/kernel/arch/vm_translation_map.h =================================================================== --- haiku/trunk/headers/private/kernel/arch/vm_translation_map.h 2009-08-03 11:54:25 UTC (rev 32072) +++ haiku/trunk/headers/private/kernel/arch/vm_translation_map.h 2009-08-03 12:39:56 UTC (rev 32073) @@ -23,11 +23,14 @@ status_t arch_vm_translation_map_init_post_area(struct kernel_args *args); status_t arch_vm_translation_map_init_post_sem(struct kernel_args *args); -// quick function to map a page in regardless of map context. Used in VM initialization, -// before most vm data structures exist +// Quick function to map a page in regardless of map context. Used in VM +// initialization before most vm data structures exist. status_t arch_vm_translation_map_early_map(struct kernel_args *args, addr_t va, addr_t pa, uint8 attributes, addr_t (*get_free_page)(struct kernel_args *)); +bool arch_vm_translation_map_is_kernel_page_accessible(addr_t virtualAddress, + uint32 protection); + #ifdef __cplusplus } #endif Modified: haiku/trunk/headers/private/kernel/arch/x86/arch_cpu.h =================================================================== --- haiku/trunk/headers/private/kernel/arch/x86/arch_cpu.h 2009-08-03 11:54:25 UTC (rev 32072) +++ haiku/trunk/headers/private/kernel/arch/x86/arch_cpu.h 2009-08-03 12:39:56 UTC (rev 32073) @@ -284,6 +284,7 @@ void* x86_get_double_fault_stack(int32 cpu, size_t* _size); int32 x86_double_fault_get_cpu(void); void x86_double_fault_exception(struct iframe* frame); +void x86_page_fault_exception_double_fault(struct iframe* frame); #define read_cr3(value) \ Modified: haiku/trunk/headers/private/kernel/cpu.h =================================================================== --- haiku/trunk/headers/private/kernel/cpu.h 2009-08-03 11:54:25 UTC (rev 32072) +++ haiku/trunk/headers/private/kernel/cpu.h 2009-08-03 12:39:56 UTC (rev 32073) @@ -9,6 +9,8 @@ #define _KERNEL_CPU_H +#include + #include #include #include @@ -24,20 +26,25 @@ /* CPU local data structure */ typedef struct cpu_ent { - int cpu_num; + int cpu_num; // thread.c: used to force a reschedule at quantum expiration time - int preempted; - timer quantum_timer; + int preempted; + timer quantum_timer; // keeping track of CPU activity - bigtime_t active_time; - bigtime_t last_kernel_time; - bigtime_t last_user_time; + bigtime_t active_time; + bigtime_t last_kernel_time; + bigtime_t last_user_time; - bool invoke_scheduler; - bool disabled; + // used in the kernel debugger + addr_t fault_handler; + addr_t fault_handler_stack_pointer; + jmp_buf fault_jump_buffer; + bool invoke_scheduler; + bool disabled; + // arch-specific stuff arch_cpu_info arch; } cpu_ent __attribute__((aligned(64))); Modified: haiku/trunk/headers/private/kernel/debug.h =================================================================== --- haiku/trunk/headers/private/kernel/debug.h 2009-08-03 11:54:25 UTC (rev 32072) +++ haiku/trunk/headers/private/kernel/debug.h 2009-08-03 12:39:56 UTC (rev 32073) @@ -8,12 +8,15 @@ #ifndef _KERNEL_DEBUG_H #define _KERNEL_DEBUG_H -#include "kernel_debug_config.h" +#include + #include #include +#include "kernel_debug_config.h" + /* KDEBUG The kernel debug level. Level 1 is usual asserts, > 1 should be used for very expensive runtime @@ -123,6 +126,11 @@ extern void debug_trap_cpu_in_kdl(int32 cpu, bool returnIfHandedOver); extern void debug_double_fault(int32 cpu); extern bool debug_emergency_key_pressed(char key); +extern bool debug_is_kernel_memory_accessible(addr_t address, size_t size, + uint32 protection); +extern int debug_call_with_fault_handler(jmp_buf jumpBuffer, + void (*function)(void*), void* parameter); +extern status_t debug_memcpy(void* to, const void* from, size_t size); extern char kgetc(void); extern void kputs(const char *string); Modified: haiku/trunk/headers/private/kernel/kernel.h =================================================================== --- haiku/trunk/headers/private/kernel/kernel.h 2009-08-03 11:54:25 UTC (rev 32072) +++ haiku/trunk/headers/private/kernel/kernel.h 2009-08-03 12:39:56 UTC (rev 32073) @@ -39,8 +39,8 @@ #define ENV_SIZE (B_PAGE_SIZE * 8) -#define ROUNDUP(a, b) (((a) + ((b)-1)) & ~((b)-1)) -#define ROUNDOWN(a, b) (((a) / (b)) * (b)) +#define ROUNDDOWN(a, b) (((a) / (b)) * (b)) +#define ROUNDUP(a, b) ROUNDDOWN((a) + (b) - 1, b) #define CHECK_BIT(a, b) ((a) & (1 << (b))) Modified: haiku/trunk/src/system/boot/loader/elf.cpp =================================================================== --- haiku/trunk/src/system/boot/loader/elf.cpp 2009-08-03 11:54:25 UTC (rev 32072) +++ haiku/trunk/src/system/boot/loader/elf.cpp 2009-08-03 12:39:56 UTC (rev 32073) @@ -126,9 +126,9 @@ status = B_ERROR; goto error1; } - + // find symbol table in section headers - + for (int32 i = 0; i < elfHeader.e_shnum; i++) { if (sectionHeaders[i].sh_type == SHT_SYMTAB) { stringHeader = §ionHeaders[sectionHeaders[i].sh_link]; @@ -275,7 +275,7 @@ } else continue; - region->start = ROUNDOWN(header.p_vaddr, B_PAGE_SIZE); + region->start = ROUNDDOWN(header.p_vaddr, B_PAGE_SIZE); region->size = ROUNDUP(header.p_memsz + (header.p_vaddr % B_PAGE_SIZE), B_PAGE_SIZE); region->delta = -region->start; Modified: haiku/trunk/src/system/boot/loader/kernel_args.cpp =================================================================== --- haiku/trunk/src/system/boot/loader/kernel_args.cpp 2009-08-03 11:54:25 UTC (rev 32072) +++ haiku/trunk/src/system/boot/loader/kernel_args.cpp 2009-08-03 12:39:56 UTC (rev 32073) @@ -62,7 +62,7 @@ { uint32 numRanges = *_numRanges; - start = ROUNDOWN(start, B_PAGE_SIZE); + start = ROUNDDOWN(start, B_PAGE_SIZE); size = ROUNDUP(size, B_PAGE_SIZE); addr_t end = start + size; @@ -141,7 +141,7 @@ uint32 numRanges = *_numRanges; addr_t end = ROUNDUP(start + size, B_PAGE_SIZE); - start = ROUNDOWN(start, B_PAGE_SIZE); + start = ROUNDDOWN(start, B_PAGE_SIZE); for (uint32 i = 0; i < numRanges; i++) { addr_t rangeStart = ranges[i].start; Modified: haiku/trunk/src/system/boot/platform/bios_ia32/mmu.cpp =================================================================== --- haiku/trunk/src/system/boot/platform/bios_ia32/mmu.cpp 2009-08-03 11:54:25 UTC (rev 32072) +++ haiku/trunk/src/system/boot/platform/bios_ia32/mmu.cpp 2009-08-03 12:39:56 UTC (rev 32073) @@ -632,7 +632,7 @@ extMemoryBlock[i].base_addr = ROUNDUP(extMemoryBlock[i].base_addr, B_PAGE_SIZE); extMemoryBlock[i].length - = ROUNDOWN(extMemoryBlock[i].length, B_PAGE_SIZE); + = ROUNDDOWN(extMemoryBlock[i].length, B_PAGE_SIZE); // we ignore all memory beyond 4 GB if (extMemoryBlock[i].base_addr > 0xffffffffULL) Modified: haiku/trunk/src/system/boot/platform/openfirmware/arch/ppc/mmu.cpp =================================================================== --- haiku/trunk/src/system/boot/platform/openfirmware/arch/ppc/mmu.cpp 2009-08-03 11:54:25 UTC (rev 32072) +++ haiku/trunk/src/system/boot/platform/openfirmware/arch/ppc/mmu.cpp 2009-08-03 12:39:56 UTC (rev 32073) @@ -57,7 +57,7 @@ insert_memory_range(addr_range *ranges, uint32 &numRanges, uint32 maxRanges, const void *_start, uint32 _size) { - addr_t start = ROUNDOWN(addr_t(_start), B_PAGE_SIZE); + addr_t start = ROUNDDOWN(addr_t(_start), B_PAGE_SIZE); addr_t end = ROUNDUP(addr_t(_start) + _size, B_PAGE_SIZE); addr_t size = end - start; if (size == 0) @@ -133,7 +133,7 @@ remove_memory_range(addr_range *ranges, uint32 &numRanges, uint32 maxRanges, const void *_start, uint32 _size) { - addr_t start = ROUNDOWN(addr_t(_start), B_PAGE_SIZE); + addr_t start = ROUNDDOWN(addr_t(_start), B_PAGE_SIZE); addr_t end = ROUNDUP(addr_t(_start) + _size, B_PAGE_SIZE); for (uint32 i = 0; i < numRanges; i++) { Modified: haiku/trunk/src/system/boot/platform/u-boot/mmu.cpp =================================================================== --- haiku/trunk/src/system/boot/platform/u-boot/mmu.cpp 2009-08-03 11:54:25 UTC (rev 32072) +++ haiku/trunk/src/system/boot/platform/u-boot/mmu.cpp 2009-08-03 12:39:56 UTC (rev 32073) @@ -618,7 +618,7 @@ extMemoryBlock[i].base_addr = ROUNDUP(extMemoryBlock[i].base_addr, B_PAGE_SIZE); extMemoryBlock[i].length - = ROUNDOWN(extMemoryBlock[i].length, B_PAGE_SIZE); + = ROUNDDOWN(extMemoryBlock[i].length, B_PAGE_SIZE); // we ignore all memory beyond 4 GB if (extMemoryBlock[i].base_addr > 0xffffffffULL) Modified: haiku/trunk/src/system/kernel/arch/m68k/arch_cpu.cpp =================================================================== --- haiku/trunk/src/system/kernel/arch/m68k/arch_cpu.cpp 2009-08-03 11:54:25 UTC (rev 32072) +++ haiku/trunk/src/system/kernel/arch/m68k/arch_cpu.cpp 2009-08-03 12:39:56 UTC (rev 32073) @@ -30,7 +30,7 @@ int arch_mmu_type; int arch_platform; -status_t +status_t arch_cpu_preboot_init_percpu(kernel_args *args, int curr_cpu) { // enable FPU @@ -44,7 +44,7 @@ } -status_t +status_t arch_cpu_init_percpu(kernel_args *args, int curr_cpu) { //detect_cpu(curr_cpu); @@ -102,7 +102,7 @@ } -void +void arch_cpu_sync_icache(void *address, size_t len) { cpu_ops.flush_icache((addr_t)address, len); @@ -125,7 +125,7 @@ } -void +void arch_cpu_invalidate_TLB_range(addr_t start, addr_t end) { int32 num_pages = end / B_PAGE_SIZE - start / B_PAGE_SIZE; @@ -139,11 +139,11 @@ } -void +void arch_cpu_invalidate_TLB_list(addr_t pages[], int num_pages) { int i; - + cpu_ops.flush_insn_pipeline(); for (i = 0; i < num_pages; i++) { cpu_ops.flush_atc_addr(pages[i]); @@ -153,7 +153,7 @@ } -void +void arch_cpu_global_TLB_invalidate(void) { cpu_ops.flush_insn_pipeline(); @@ -162,7 +162,7 @@ } -void +void arch_cpu_user_TLB_invalidate(void) { cpu_ops.flush_insn_pipeline(); @@ -179,6 +179,7 @@ char *s = (char *)from; addr_t oldFaultHandler = *faultHandler; +// TODO: This doesn't work correctly with gcc 4 anymore! if (m68k_set_fault_handler(faultHandler, (addr_t)&&error)) goto error; @@ -200,7 +201,7 @@ * \param to Pointer to the destination C-string. * \param from Pointer to the source C-string. * \param size Size in bytes of the string buffer pointed to by \a to. - * + * * \return strlen(\a from). */ @@ -210,12 +211,13 @@ int from_length = 0; addr_t oldFaultHandler = *faultHandler; +// TODO: This doesn't work correctly with gcc 4 anymore! if (m68k_set_fault_handler(faultHandler, (addr_t)&&error)) goto error; if (size > 0) { to[--size] = '\0'; - // copy + // copy for ( ; size; size--, from_length++, to++, from++) { if ((*to = *from) == '\0') break; @@ -240,6 +242,7 @@ char *xs = (char *)s; addr_t oldFaultHandler = *faultHandler; +// TODO: This doesn't work correctly with gcc 4 anymore! if (m68k_set_fault_handler(faultHandler, (addr_t)&&error)) goto error; @@ -289,6 +292,7 @@ bool m68k_set_fault_handler(addr_t *handlerLocation, addr_t handler) { +// TODO: This doesn't work correctly with gcc 4 anymore! *handlerLocation = handler; return false; } Modified: haiku/trunk/src/system/kernel/arch/m68k/arch_debug.cpp =================================================================== --- haiku/trunk/src/system/kernel/arch/m68k/arch_debug.cpp 2009-08-03 11:54:25 UTC (rev 32072) +++ haiku/trunk/src/system/kernel/arch/m68k/arch_debug.cpp 2009-08-03 12:39:56 UTC (rev 32073) @@ -65,25 +65,14 @@ static status_t get_next_frame(addr_t framePointer, addr_t *next, addr_t *ip) { - struct thread *thread = thread_get_current_thread(); - addr_t oldFaultHandler = thread->fault_handler; + stack_frame frame; + if (debug_memcpy(&frame, (void*)framePointer, sizeof(frame)) != B_OK) + return B_BAD_ADDRESS; - // set fault handler, so that we can safely access user stacks - if (thread) { - if (m68k_set_fault_handler(&thread->fault_handler, (addr_t)&&error)) - goto error; - } + *ip = frame.return_address; + *next = (addr_t)frame.previous; - *ip = ((struct stack_frame *)framePointer)->return_address; - *next = (addr_t)((struct stack_frame *)framePointer)->previous; - - if (thread) - thread->fault_handler = oldFaultHandler; return B_OK; - -error: - thread->fault_handler = oldFaultHandler; - return B_BAD_ADDRESS; } @@ -367,6 +356,22 @@ } +void +arch_debug_unset_current_thread(void) +{ + // TODO: Implement! +} + + +void +arch_debug_call_with_fault_handler(cpu_ent* cpu, jmp_buf jumpBuffer, + void (*function)(void*), void* parameter) +{ + // TODO: Implement! Most likely in assembly. + longjmp(jumpBuffer, 1); +} + + bool arch_is_debug_variable_defined(const char* variableName) { Modified: haiku/trunk/src/system/kernel/arch/m68k/arch_vm_translation_map_impl.cpp =================================================================== --- haiku/trunk/src/system/kernel/arch/m68k/arch_vm_translation_map_impl.cpp 2009-08-03 11:54:25 UTC (rev 32072) +++ haiku/trunk/src/system/kernel/arch/m68k/arch_vm_translation_map_impl.cpp 2009-08-03 12:39:56 UTC (rev 32073) @@ -651,7 +651,7 @@ status_t status; int index; - start = ROUNDOWN(start, B_PAGE_SIZE); + start = ROUNDDOWN(start, B_PAGE_SIZE); end = ROUNDUP(end, B_PAGE_SIZE); TRACE(("unmap_tmap: asked to free pages 0x%lx to 0x%lx\n", start, end)); @@ -873,7 +873,7 @@ status_t status; int index; - start = ROUNDOWN(start, B_PAGE_SIZE); + start = ROUNDDOWN(start, B_PAGE_SIZE); end = ROUNDUP(end, B_PAGE_SIZE); TRACE(("protect_tmap: pages 0x%lx to 0x%lx, attributes %lx\n", start, end, attributes)); @@ -1511,3 +1511,11 @@ return B_OK; } + +bool +arch_vm_translation_map_is_kernel_page_accessible(addr_t virtualAddress, + uint32 protection) +{ + // TODO: Implement! + return false; +} Modified: haiku/trunk/src/system/kernel/arch/ppc/arch_cpu.cpp =================================================================== --- haiku/trunk/src/system/kernel/arch/ppc/arch_cpu.cpp 2009-08-03 11:54:25 UTC (rev 32072) +++ haiku/trunk/src/system/kernel/arch/ppc/arch_cpu.cpp 2009-08-03 12:39:56 UTC (rev 32073) @@ -16,7 +16,7 @@ static bool sHasTlbia; -status_t +status_t arch_cpu_preboot_init_percpu(kernel_args *args, int curr_cpu) { // enable FPU @@ -65,7 +65,7 @@ #define CACHELINE 32 -void +void arch_cpu_sync_icache(void *address, size_t len) { int l, off; @@ -109,7 +109,7 @@ } -void +void arch_cpu_invalidate_TLB_range(addr_t start, addr_t end) { asm volatile("sync"); @@ -124,7 +124,7 @@ } -void +void arch_cpu_invalidate_TLB_list(addr_t pages[], int num_pages) { int i; @@ -140,7 +140,7 @@ } -void +void arch_cpu_global_TLB_invalidate(void) { if (sHasTlbia) { @@ -156,7 +156,7 @@ tlbie(address); eieio(); ppc_sync(); - + address += B_PAGE_SIZE; } tlbsync(); @@ -165,7 +165,7 @@ } -void +void arch_cpu_user_TLB_invalidate(void) { arch_cpu_global_TLB_invalidate(); @@ -180,6 +180,7 @@ char *s = (char *)from; addr_t oldFaultHandler = *faultHandler; +// TODO: This doesn't work correctly with gcc 4 anymore! if (ppc_set_fault_handler(faultHandler, (addr_t)&&error)) goto error; @@ -201,7 +202,7 @@ * \param to Pointer to the destination C-string. * \param from Pointer to the source C-string. * \param size Size in bytes of the string buffer pointed to by \a to. - * + * * \return strlen(\a from). */ @@ -211,12 +212,13 @@ int from_length = 0; addr_t oldFaultHandler = *faultHandler; +// TODO: This doesn't work correctly with gcc 4 anymore! if (ppc_set_fault_handler(faultHandler, (addr_t)&&error)) goto error; if (size > 0) { to[--size] = '\0'; - // copy + // copy for ( ; size; size--, from_length++, to++, from++) { if ((*to = *from) == '\0') break; @@ -241,6 +243,7 @@ char *xs = (char *)s; addr_t oldFaultHandler = *faultHandler; +// TODO: This doesn't work correctly with gcc 4 anymore! if (ppc_set_fault_handler(faultHandler, (addr_t)&&error)) goto error; @@ -286,6 +289,7 @@ bool ppc_set_fault_handler(addr_t *handlerLocation, addr_t handler) { +// TODO: This doesn't work correctly with gcc 4 anymore! *handlerLocation = handler; return false; } Modified: haiku/trunk/src/system/kernel/arch/ppc/arch_debug.cpp =================================================================== --- haiku/trunk/src/system/kernel/arch/ppc/arch_debug.cpp 2009-08-03 11:54:25 UTC (rev 32072) +++ haiku/trunk/src/system/kernel/arch/ppc/arch_debug.cpp 2009-08-03 12:39:56 UTC (rev 32073) @@ -64,25 +64,14 @@ static status_t get_next_frame(addr_t framePointer, addr_t *next, addr_t *ip) { - struct thread *thread = thread_get_current_thread(); - addr_t oldFaultHandler = thread->fault_handler; + stack_frame frame; + if (debug_memcpy(&frame, (void*)framePointer, sizeof(frame)) != B_OK) + return B_BAD_ADDRESS; - // set fault handler, so that we can safely access user stacks - if (thread) { - if (ppc_set_fault_handler(&thread->fault_handler, (addr_t)&&error)) - goto error; - } + *ip = frame.return_address; + *next = (addr_t)frame.previous; - *ip = ((struct stack_frame *)framePointer)->return_address; - *next = (addr_t)((struct stack_frame *)framePointer)->previous; - - if (thread) - thread->fault_handler = oldFaultHandler; return B_OK; - -error: - thread->fault_handler = oldFaultHandler; - return B_BAD_ADDRESS; } @@ -303,6 +292,22 @@ } +void +arch_debug_unset_current_thread(void) +{ + // TODO: Implement! +} + + +void +arch_debug_call_with_fault_handler(cpu_ent* cpu, jmp_buf jumpBuffer, + void (*function)(void*), void* parameter) +{ + // TODO: Implement! Most likely in assembly. + longjmp(jumpBuffer, 1); +} + + bool arch_is_debug_variable_defined(const char* variableName) { Modified: haiku/trunk/src/system/kernel/arch/ppc/arch_vm_translation_map.cpp =================================================================== --- haiku/trunk/src/system/kernel/arch/ppc/arch_vm_translation_map.cpp 2009-08-03 11:54:25 UTC (rev 32072) +++ haiku/trunk/src/system/kernel/arch/ppc/arch_vm_translation_map.cpp 2009-08-03 12:39:56 UTC (rev 32073) @@ -330,7 +330,7 @@ { page_table_entry *entry; - start = ROUNDOWN(start, B_PAGE_SIZE); + start = ROUNDDOWN(start, B_PAGE_SIZE); end = ROUNDUP(end, B_PAGE_SIZE); // dprintf("vm_translation_map.unmap_tmap: start 0x%lx, end 0x%lx\n", start, end); @@ -678,8 +678,8 @@ size_t size) { addr_t virtualEnd = ROUNDUP(virtualAddress + size, B_PAGE_SIZE); - virtualAddress = ROUNDOWN(virtualAddress, B_PAGE_SIZE); - physicalAddress = ROUNDOWN(physicalAddress, B_PAGE_SIZE); + virtualAddress = ROUNDDOWN(virtualAddress, B_PAGE_SIZE); + physicalAddress = ROUNDDOWN(physicalAddress, B_PAGE_SIZE); vm_address_space *addressSpace = vm_kernel_address_space(); @@ -701,7 +701,7 @@ ppc_unmap_address_range(addr_t virtualAddress, size_t size) { addr_t virtualEnd = ROUNDUP(virtualAddress + size, B_PAGE_SIZE); - virtualAddress = ROUNDOWN(virtualAddress, B_PAGE_SIZE); + virtualAddress = ROUNDDOWN(virtualAddress, B_PAGE_SIZE); vm_address_space *addressSpace = vm_kernel_address_space(); @@ -713,7 +713,7 @@ status_t ppc_remap_address_range(addr_t *_virtualAddress, size_t size, bool unmap) { - addr_t virtualAddress = ROUNDOWN(*_virtualAddress, B_PAGE_SIZE); + addr_t virtualAddress = ROUNDDOWN(*_virtualAddress, B_PAGE_SIZE); size = ROUNDUP(*_virtualAddress + size - virtualAddress, B_PAGE_SIZE); vm_address_space *addressSpace = vm_kernel_address_space(); @@ -746,3 +746,11 @@ return B_OK; } + +bool +arch_vm_translation_map_is_kernel_page_accessible(addr_t virtualAddress, + uint32 protection) +{ + // TODO: Implement! + return false; +} Modified: haiku/trunk/src/system/kernel/arch/x86/arch_debug.cpp =================================================================== --- haiku/trunk/src/system/kernel/arch/x86/arch_debug.cpp 2009-08-03 11:54:25 UTC (rev 32072) +++ haiku/trunk/src/system/kernel/arch/x86/arch_debug.cpp 2009-08-03 12:39:56 UTC (rev 32073) @@ -56,26 +56,36 @@ } +/*! Safe to be called only from outside the debugger. +*/ static status_t -get_next_frame(addr_t ebp, addr_t *_next, addr_t *_eip) +get_next_frame_no_debugger(addr_t ebp, addr_t *_next, addr_t *_eip) { - // set fault handler, so that we can safely access user stacks - addr_t oldFaultHandler = thread_get_current_thread()->fault_handler; - thread_get_current_thread()->fault_handler = (addr_t)&&error; - // Fake goto to trick the compiler not to optimize the code at the label - // away. - if (ebp == 0) - goto error; + // TODO: Do this more efficiently in assembly. + stack_frame frame; + if (user_memcpy(&frame, (void*)ebp, sizeof(frame)) != B_OK) + return B_BAD_ADDRESS; - *_eip = ((struct stack_frame *)ebp)->return_address; - *_next = (addr_t)((struct stack_frame *)ebp)->previous; + *_eip = frame.return_address; + *_next = (addr_t)frame.previous; - thread_get_current_thread()->fault_handler = oldFaultHandler; return B_OK; +} -error: - thread_get_current_thread()->fault_handler = oldFaultHandler; - return B_BAD_ADDRESS; + +/*! Safe to be called only from inside the debugger. +*/ +static status_t +get_next_frame_debugger(addr_t ebp, addr_t *_next, addr_t *_eip) +{ + stack_frame frame; + if (debug_memcpy(&frame, (void*)ebp, sizeof(frame)) != B_OK) + return B_BAD_ADDRESS; + + *_eip = frame.return_address; + *_next = (addr_t)frame.previous; + + return B_OK; } @@ -285,8 +295,10 @@ kprintf(" + 0x%04lx\n", eip - baseAddress); } else { vm_area *area = NULL; - if (thread->team->address_space != NULL) + if (thread != NULL && thread->team != NULL + && thread->team->address_space != NULL) { area = vm_area_lookup(thread->team->address_space, eip); + } if (area != NULL) { kprintf("%ld:%s@%p + %#lx\n", area->id, area->name, (void*)area->base, eip - area->base); @@ -358,6 +370,7 @@ *_thread = thread; } + static bool is_double_fault_stack_address(int32 cpu, addr_t address) { @@ -564,7 +577,7 @@ } else { addr_t eip, nextEbp; - if (get_next_frame(ebp, &nextEbp, &eip) != B_OK) { + if (get_next_frame_debugger(ebp, &nextEbp, &eip) != B_OK) { kprintf("%08lx -- read fault\n", ebp); break; } @@ -723,7 +736,7 @@ } else { addr_t eip, nextEbp; - if (get_next_frame(ebp, &nextEbp, &eip) != B_OK) { + if (get_next_frame_debugger(ebp, &nextEbp, &eip) != B_OK) { kprintf("%08lx -- read fault\n", ebp); break; } @@ -894,7 +907,7 @@ } else { addr_t eip, nextEbp; - if (get_next_frame(ebp, &nextEbp, &eip) != B_OK + if (get_next_frame_no_debugger(ebp, &nextEbp, &eip) != B_OK || eip == 0 || ebp == 0) break; @@ -964,7 +977,7 @@ skipFrames = 0; } } else { - if (get_next_frame(ebp, &nextEbp, &eip) != B_OK) + if (get_next_frame_no_debugger(ebp, &nextEbp, &eip) != B_OK) break; } @@ -1000,6 +1013,16 @@ } +/*! Sets the current thread to \c NULL. + Invoked in the kernel debugger only. +*/ +void +arch_debug_unset_current_thread(void) +{ + write_dr3(NULL); +} + + bool arch_is_debug_variable_defined(const char* variableName) { Modified: haiku/trunk/src/system/kernel/arch/x86/arch_int.cpp =================================================================== --- haiku/trunk/src/system/kernel/arch/x86/arch_int.cpp 2009-08-03 11:54:25 UTC (rev 32072) +++ haiku/trunk/src/system/kernel/arch/x86/arch_int.cpp 2009-08-03 12:39:56 UTC (rev 32073) @@ -204,22 +204,27 @@ /*! Initializes the descriptor for interrupt vector \a n in the IDT of the - boot CPU to an interrupt-gate descriptor with the given procedure address. + specified CPU to an interrupt-gate descriptor with the given procedure + address. + For CPUs other than the boot CPU it must not be called before + arch_int_init_post_vm(). */ static void -set_interrupt_gate(int n, void (*addr)()) +set_interrupt_gate(int32 cpu, int n, void (*addr)()) { - set_gate(&sIDTs[0][n], (addr_t)addr, 14, DPL_KERNEL); + set_gate(&sIDTs[cpu][n], (addr_t)addr, 14, DPL_KERNEL); } /*! Initializes the descriptor for interrupt vector \a n in the IDT of the - boot CPU to an trap-gate descriptor with the given procedure address. + specified CPU to an trap-gate descriptor with the given procedure address. + For CPUs other than the boot CPU it must not be called before + arch_int_init_post_vm(). */ static void -set_trap_gate(int n, void (*addr)()) +set_trap_gate(int32 cpu, int n, void (*addr)()) { - set_gate(&sIDTs[0][n], (unsigned int)addr, 15, DPL_USER); + set_gate(&sIDTs[cpu][n], (unsigned int)addr, 15, DPL_USER); } @@ -851,27 +856,74 @@ frame->edi = tss->edi; frame->flags = tss->eflags; + // Use a special handler for page faults which avoids the triple fault + // pitfalls. + set_interrupt_gate(cpu, 14, &trap14_double_fault); + debug_double_fault(cpu); } +void +x86_page_fault_exception_double_fault(struct iframe* frame) +{ + uint32 cr2; + asm("movl %%cr2, %0" : "=r" (cr2)); + + // Only if this CPU has a fault handler, we're allowed to be here. + cpu_ent& cpu = gCPU[x86_double_fault_get_cpu()]; + addr_t faultHandler = cpu.fault_handler; + if (faultHandler != 0) { + debug_set_page_fault_info(cr2, frame->eip, + (frame->error_code & 0x2) != 0 ? DEBUG_PAGE_FAULT_WRITE : 0); + frame->eip = faultHandler; + frame->ebp = cpu.fault_handler_stack_pointer; + return; + } + + // No fault handler. This is bad. Since we originally came from a double + // fault, we don't try to reenter the kernel debugger. Instead we just + // print the info we've got and enter an infinite loop. + kprintf("Page fault in double fault debugger without fault handler! " + "Touching address %p from eip %p. Entering infinite loop...\n", + (void*)cr2, (void*)frame->eip); + + while (true); +} + + static void page_fault_exception(struct iframe* frame) { struct thread *thread = thread_get_current_thread(); - bool kernelDebugger = debug_debugger_running(); - unsigned int cr2; + uint32 cr2; addr_t newip; asm("movl %%cr2, %0" : "=r" (cr2)); - if (kernelDebugger) { - // if this thread has a fault handler, we're allowed to be here - if (thread && thread->fault_handler != 0) { - debug_set_page_fault_info(cr2, frame->eip, - (frame->error_code & 0x2) != 0 ? DEBUG_PAGE_FAULT_WRITE : 0); - frame->eip = thread->fault_handler; - return; + if (debug_debugger_running()) { + // If this CPU or this thread has a fault handler, we're allowed to be + // here. + if (thread != NULL) { + cpu_ent* cpu = &gCPU[smp_get_current_cpu()]; + if (cpu->fault_handler != 0) { + debug_set_page_fault_info(cr2, frame->eip, + (frame->error_code & 0x2) != 0 + ? DEBUG_PAGE_FAULT_WRITE : 0); + frame->eip = cpu->fault_handler; + frame->ebp = cpu->fault_handler_stack_pointer; + return; + } + + if (thread->fault_handler != 0) { + kprintf("ERROR: thread::fault_handler used in kernel " + "debugger!\n"); + debug_set_page_fault_info(cr2, frame->eip, + (frame->error_code & 0x2) != 0 + ? DEBUG_PAGE_FAULT_WRITE : 0); + frame->eip = thread->fault_handler; + return; + } } // otherwise, not really @@ -886,8 +938,16 @@ // disabled, which in most cases is a bug. We should add some thread // flag allowing to explicitly indicate that this handling is desired. if (thread && thread->fault_handler != 0) { - frame->eip = thread->fault_handler; - return; + if (frame->eip != thread->fault_handler) { + frame->eip = thread->fault_handler; + return; + } + + // The fault happened at the fault handler address. This is a + // certain infinite loop. + panic("page fault, interrupts disabled, fault handler loop. " + "Touching address %p from eip %p\n", (void*)cr2, + (void*)frame->eip); } // If we are not running the kernel startup the page fault was not @@ -971,60 +1031,60 @@ // setup the standard programmable interrupt controller pic_init(); - set_interrupt_gate(0, &trap0); - set_interrupt_gate(1, &trap1); - set_interrupt_gate(2, &trap2); - set_trap_gate(3, &trap3); - set_interrupt_gate(4, &trap4); - set_interrupt_gate(5, &trap5); - set_interrupt_gate(6, &trap6); - set_interrupt_gate(7, &trap7); + set_interrupt_gate(0, 0, &trap0); + set_interrupt_gate(0, 1, &trap1); + set_interrupt_gate(0, 2, &trap2); + set_trap_gate(0, 3, &trap3); + set_interrupt_gate(0, 4, &trap4); + set_interrupt_gate(0, 5, &trap5); + set_interrupt_gate(0, 6, &trap6); + set_interrupt_gate(0, 7, &trap7); // trap8 (double fault) is set in arch_cpu.c - set_interrupt_gate(9, &trap9); - set_interrupt_gate(10, &trap10); - set_interrupt_gate(11, &trap11); - set_interrupt_gate(12, &trap12); - set_interrupt_gate(13, &trap13); - set_interrupt_gate(14, &trap14); [... truncated: 895 lines follow ...] From axeld at pinc-software.de Sun Aug 2 13:47:35 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Sun, 02 Aug 2009 13:47:35 +0200 CEST Subject: [Haiku-commits] =?utf-8?q?r32059_-_haiku/trunk/src/system/boot/pl?= =?utf-8?q?atform/bios=5Fia32?= In-Reply-To: <200908011203.n71C3NhP022787@sheep.berlios.de> Message-ID: <1650914521-BeMail@zon> mmu_man at BerliOS wrote: > Log: > Add MultiBoot support. I can't imagine a single reason why we would want this in our boot loader. Is there any benefit from using it? Bye, Axel. From pulkomandy at gmail.com Mon Aug 3 15:12:06 2009 From: pulkomandy at gmail.com (PulkoMandy) Date: Mon, 3 Aug 2009 15:12:06 +0200 Subject: [Haiku-commits] r32059 - haiku/trunk/src/system/boot/platform/bios_ia32 In-Reply-To: <1650914521-BeMail@zon> References: <200908011203.n71C3NhP022787@sheep.berlios.de> <1650914521-BeMail@zon> Message-ID: <36ed0c950908030612m6b463b94va88232885ca2bfa7@mail.gmail.com> 2009/8/2 Axel D?rfler : > mmu_man at BerliOS wrote: >> Log: >> Add MultiBoot support. > > I can't imagine a single reason why we would want this in our boot > loader. > Is there any benefit from using it? mainly stnadardization, grub compatibility and simpler porting to other platforms (ARM board use jtag and can make use of it IIRC). Also it allows dorect loading of the kernel in qemu for debugging. > > Bye, > ? Axel. > > _______________________________________________ > Haiku-commits mailing list > Haiku-commits at lists.berlios.de > https://lists.berlios.de/mailman/listinfo/haiku-commits > -- Adrien Destugues / PulkoMandy El?ve ing?nieur ENSSAT EII1- www.enssat.fr GSoC student for Haiku - http://haiku-os.org GrafX2 project team - http://code.google.com/p/grafx2 From mmlr at mail.berlios.de Mon Aug 3 15:59:47 2009 From: mmlr at mail.berlios.de (mmlr at mail.berlios.de) Date: Mon, 3 Aug 2009 15:59:47 +0200 Subject: [Haiku-commits] r32074 - in haiku/trunk: headers/private/kernel src/system/kernel Message-ID: <200908031359.n73Dxlqp030165@sheep.berlios.de> Author: mmlr Date: 2009-08-03 15:59:45 +0200 (Mon, 03 Aug 2009) New Revision: 32074 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32074&view=rev Modified: haiku/trunk/headers/private/kernel/heap.h haiku/trunk/src/system/kernel/heap.cpp Log: * Rework the heap locking strategy. Use a read-write lock for the area lock to allow for more parallelism. Also introduce seperate locks for the bins and for page allocation. This greatly reduces lock contention and reduces the duration the locks are held due to them overall protecting less code. Now only allocations of the same size hitting the same allocator or allocating larger chunks of memory should block. Previously, basically any allocation and also free would be mutually exclusive, making it scale pretty badely. * Added memalign_nogrow(). As it uses heap_memalign() anyway, there's no real reason not to allow for an alignment. * Some cleanup. Modified: haiku/trunk/headers/private/kernel/heap.h =================================================================== --- haiku/trunk/headers/private/kernel/heap.h 2009-08-03 12:39:56 UTC (rev 32073) +++ haiku/trunk/headers/private/kernel/heap.h 2009-08-03 13:59:45 UTC (rev 32074) @@ -41,8 +41,9 @@ extern "C" { #endif -// malloc_nogrow disallows waiting for a grow to happen - only to be used by -// vm functions that may deadlock on a triggered area creation +// malloc- and memalign_nogrow disallow waiting for a grow to happen - only to +// be used by vm functions that may deadlock on a triggered area creation. +void *memalign_nogrow(size_t alignment, size_t size); void *malloc_nogrow(size_t size); void *memalign(size_t alignment, size_t size); Modified: haiku/trunk/src/system/kernel/heap.cpp =================================================================== --- haiku/trunk/src/system/kernel/heap.cpp 2009-08-03 12:39:56 UTC (rev 32073) +++ haiku/trunk/src/system/kernel/heap.cpp 2009-08-03 13:59:45 UTC (rev 32074) @@ -88,13 +88,15 @@ } heap_page; typedef struct heap_bin_s { + mutex lock; uint32 element_size; uint16 max_free_count; heap_page * page_list; // sorted so that the desired page is always first } heap_bin; struct heap_allocator_s { - mutex lock; + rw_lock area_lock; + mutex page_lock; const char *name; uint32 bin_count; @@ -628,7 +630,7 @@ static bool -analyze_allocation_callers(heap_allocator* heap) +analyze_allocation_callers(heap_allocator *heap) { // go through all the pages in all the areas heap_area *area = heap->all_areas; @@ -661,7 +663,7 @@ info = (heap_leak_check_info *)(base + elementSize - sizeof(heap_leak_check_info)); - caller_info* callerInfo = get_caller_info(info->caller); + caller_info *callerInfo = get_caller_info(info->caller); if (callerInfo == NULL) { kprintf("out of space for caller infos\n"); return 0; @@ -685,7 +687,7 @@ info = (heap_leak_check_info *)(base + pageCount * heap->page_size - sizeof(heap_leak_check_info)); - caller_info* callerInfo = get_caller_info(info->caller); + caller_info *callerInfo = get_caller_info(info->caller); if (callerInfo == NULL) { kprintf("out of space for caller infos\n"); return false; @@ -710,7 +712,7 @@ dump_allocations_per_caller(int argc, char **argv) { bool sortBySize = true; - heap_allocator* heap = NULL; + heap_allocator *heap = NULL; for (int32 i = 1; i < argc; i++) { if (strcmp(argv[i], "-c") == 0) { @@ -756,8 +758,8 @@ caller_info& info = sCallerInfoTable[i]; kprintf("%10ld %10ld %#08lx", info.count, info.size, info.caller); - const char* symbol; - const char* imageName; + const char *symbol; + const char *imageName; bool exactMatch; addr_t baseAddress; @@ -780,7 +782,10 @@ static void heap_validate_heap(heap_allocator *heap) { - mutex_lock(&heap->lock); + ReadLocker areaReadLocker(heap->area_lock); + for (uint32 i = 0; i < heap->bin_count; i++) + mutex_lock(&heap->bins[i].lock); + MutexLocker pageLocker(heap->page_lock); uint32 totalPageCount = 0; uint32 totalFreePageCount = 0; @@ -862,7 +867,6 @@ // validate the bins for (uint32 i = 0; i < heap->bin_count; i++) { heap_bin *bin = &heap->bins[i]; - heap_page *lastPage = NULL; heap_page *page = bin->page_list; lastFreeCount = 0; @@ -938,7 +942,10 @@ } } - mutex_unlock(&heap->lock); + pageLocker.Unlock(); + for (uint32 i = 0; i < heap->bin_count; i++) + mutex_unlock(&heap->bins[i].lock); + areaReadLocker.Unlock(); } #endif // PARANOID_HEAP_VALIDATION @@ -949,8 +956,6 @@ static void heap_add_area(heap_allocator *heap, area_id areaID, addr_t base, size_t size) { - mutex_lock(&heap->lock); - heap_area *area = (heap_area *)base; area->area = areaID; @@ -986,8 +991,10 @@ area->free_pages = &area->page_table[0]; area->free_page_count = pageCount; area->page_table[0].prev = NULL; + area->next = NULL; - area->next = NULL; + WriteLocker areaWriteLocker(heap->area_lock); + MutexLocker pageLocker(heap->page_lock); if (heap->areas == NULL) { // it's the only (empty) area in that heap area->prev = NULL; @@ -1018,13 +1025,14 @@ heap->total_pages += area->page_count; heap->total_free_pages += area->free_page_count; - if (areaID >= B_OK) { + if (areaID >= 0) { // this later on deletable area is yet empty - the empty count will be // decremented as soon as this area is used for the first time heap->empty_areas++; } - mutex_unlock(&heap->lock); + pageLocker.Unlock(); + areaWriteLocker.Unlock(); dprintf("heap_add_area: area %ld added to %s heap %p - usable range 0x%08lx " "- 0x%08lx\n", area->area, heap->name, heap, area->base, @@ -1033,11 +1041,8 @@ static status_t -heap_remove_area(heap_allocator *heap, heap_area *area, bool locked) +heap_remove_area(heap_allocator *heap, heap_area *area) { - if (!locked) - mutex_lock(&heap->lock); - if (area->free_page_count != area->page_count) { panic("tried removing heap area that has still pages in use"); return B_ERROR; @@ -1075,12 +1080,10 @@ heap->total_pages -= area->page_count; heap->total_free_pages -= area->free_page_count; - if (!locked) - mutex_unlock(&heap->lock); - dprintf("heap_remove_area: area %ld with range 0x%08lx - 0x%08lx removed " "from %s heap %p\n", area->area, area->base, area->base + area->size, heap->name, heap); + return B_OK; } @@ -1114,6 +1117,7 @@ continue; heap_bin *bin = &heap->bins[heap->bin_count]; + mutex_init(&bin->lock, "heap bin lock"); bin->element_size = binSize; bin->max_free_count = heap->page_size / binSize; bin->page_list = NULL; @@ -1126,14 +1130,15 @@ base += heap->bin_count * sizeof(heap_bin); size -= heap->bin_count * sizeof(heap_bin); - mutex_init(&heap->lock, "heap_mutex"); + rw_lock_init(&heap->area_lock, "heap area rw lock"); + mutex_init(&heap->page_lock, "heap page lock"); heap_add_area(heap, -1, base, size); return heap; } -static inline area_id +static inline void heap_free_pages_added(heap_allocator *heap, heap_area *area, uint32 pageCount) { area->free_page_count += pageCount; @@ -1170,29 +1175,15 @@ } } - // can and should we free this area? - if (area->free_page_count == area->page_count && area->area >= B_OK) { - if (heap->empty_areas > 0) { - // we already have at least another empty area, just free this one - if (heap_remove_area(heap, area, true) == B_OK) { - // we cannot delete the area here, because it would result - // in calls to free, which would necessarily deadlock as we - // are locked at this point - return area->area; - } - } - + if (area->free_page_count == area->page_count && area->area >= 0) heap->empty_areas++; - } - - return -1; } static inline void heap_free_pages_removed(heap_allocator *heap, heap_area *area, uint32 pageCount) { - if (area->free_page_count == area->page_count && area->area >= B_OK) { + if (area->free_page_count == area->page_count && area->area >= 0) { // this area was completely empty heap->empty_areas--; } @@ -1239,6 +1230,7 @@ static heap_page * heap_allocate_contiguous_pages(heap_allocator *heap, uint32 pageCount) { + MutexLocker pageLocker(heap->page_lock); heap_area *area = heap->areas; while (area) { bool found = false; @@ -1286,10 +1278,14 @@ static void * heap_raw_alloc(heap_allocator *heap, size_t size, uint32 binIndex) { + TRACE(("raw_alloc: heap %p; size %lu; bin %lu\n", heap, size, binIndex)); if (binIndex < heap->bin_count) { heap_bin *bin = &heap->bins[binIndex]; + MutexLocker binLocker(bin->lock); + heap_page *page = bin->page_list; if (page == NULL) { + MutexLocker pageLocker(heap->page_lock); heap_area *area = heap->areas; if (area == NULL) { TRACE(("heap %p: no free pages to allocate %lu bytes\n", heap, @@ -1305,7 +1301,13 @@ page->next->prev = NULL; heap_free_pages_removed(heap, area, 1); + + if (page->in_use) + panic("got an in use page from the free pages list\n"); page->in_use = 1; + + pageLocker.Unlock(); + page->bin_index = binIndex; page->free_count = bin->max_free_count; page->empty_index = 0; @@ -1336,6 +1338,8 @@ page->next = page->prev = NULL; } + binLocker.Unlock(); + #if KERNEL_HEAP_LEAK_CHECK heap_leak_check_info *info = (heap_leak_check_info *)((addr_t)address + bin->element_size - sizeof(heap_leak_check_info)); @@ -1396,8 +1400,6 @@ panic("memalign() with an alignment which is not a power of 2\n"); #endif - mutex_lock(&heap->lock); - #if KERNEL_HEAP_LEAK_CHECK size += sizeof(heap_leak_check_info); #endif @@ -1420,15 +1422,14 @@ void *address = heap_raw_alloc(heap, size, binIndex); - TRACE(("memalign(): asked to allocate %lu bytes, returning pointer %p\n", - size, address)); - #if KERNEL_HEAP_LEAK_CHECK size -= sizeof(heap_leak_check_info); #endif + TRACE(("memalign(): asked to allocate %lu bytes, returning pointer %p\n", + size, address)); + T(Allocate((addr_t)address, size)); - mutex_unlock(&heap->lock); if (address == NULL) return address; @@ -1453,8 +1454,7 @@ if (address == NULL) return B_OK; - mutex_lock(&heap->lock); - + ReadLocker areaReadLocker(heap->area_lock); heap_area *area = heap->all_areas; while (area) { // since the all_areas list is ordered by base with the biggest @@ -1476,7 +1476,6 @@ if (area == NULL) { // this address does not belong to us - mutex_unlock(&heap->lock); return B_ENTRY_NOT_FOUND; } @@ -1490,19 +1489,18 @@ if (page->bin_index > heap->bin_count) { panic("free(): page %p: invalid bin_index %d\n", page, page->bin_index); - mutex_unlock(&heap->lock); return B_ERROR; } - area_id areaToDelete = -1; if (page->bin_index < heap->bin_count) { // small allocation heap_bin *bin = &heap->bins[page->bin_index]; + MutexLocker binLocker(bin->lock); + if (((addr_t)address - area->base - page->index * heap->page_size) % bin->element_size != 0) { panic("free(): passed invalid pointer %p supposed to be in bin for " "element size %ld\n", address, bin->element_size); - mutex_unlock(&heap->lock); return B_ERROR; } @@ -1515,7 +1513,6 @@ if (temp == address) { panic("free(): address %p already exists in page free " "list\n", address); - mutex_unlock(&heap->lock); return B_ERROR; } } @@ -1525,7 +1522,6 @@ if (bin->element_size % 4 != 0) { panic("free(): didn't expect a bin element size that is not a " "multiple of 4\n"); - mutex_unlock(&heap->lock); return B_ERROR; } @@ -1542,10 +1538,11 @@ if (page->free_count == bin->max_free_count) { // we are now empty, remove the page from the bin list + MutexLocker pageLocker(heap->page_lock); heap_unlink_page(page, &bin->page_list); page->in_use = 0; heap_link_page(page, &area->free_pages); - areaToDelete = heap_free_pages_added(heap, area, 1); + heap_free_pages_added(heap, area, 1); } else if (page->free_count == 1) { // we need to add ourselfs to the page list of the bin heap_link_page(page, &bin->page_list); @@ -1572,6 +1569,8 @@ uint32 allocationID = page->allocation_id; uint32 maxPages = area->page_count - page->index; uint32 pageCount = 0; + + MutexLocker pageLocker(heap->page_lock); for (uint32 i = 0; i < maxPages; i++) { // loop until we find the end of this allocation if (!page[i].in_use || page[i].bin_index != heap->bin_count @@ -1587,16 +1586,27 @@ pageCount++; } - areaToDelete = heap_free_pages_added(heap, area, pageCount); + heap_free_pages_added(heap, area, pageCount); } T(Free((addr_t)address)); - mutex_unlock(&heap->lock); + areaReadLocker.Unlock(); - if (areaToDelete >= B_OK) { - // adding free pages caused an area to become empty and freeable that - // we can now delete as we don't hold the heap lock anymore - delete_area(areaToDelete); + if (heap->empty_areas > 1) { + WriteLocker areaWriteLocker(heap->area_lock); + MutexLocker pageLocker(heap->page_lock); + + area = heap->areas; + while (area != NULL && heap->empty_areas > 1) { + if (area->area >= 0 + && area->free_page_count == area->page_count + && heap_remove_area(heap, area) == B_OK) { + delete_area(area->area); + heap->empty_areas--; + } + + area = area->next; + } } return B_OK; @@ -1616,19 +1626,29 @@ heap_realloc(heap_allocator *heap, void *address, void **newAddress, size_t newSize) { - mutex_lock(&heap->lock); + ReadLocker heapReadLocker(heap->area_lock); heap_area *area = heap->all_areas; while (area) { - if ((addr_t)address >= area->base - && (addr_t)address < area->base + area->size) + // since the all_areas list is ordered by base with the biggest + // base at the top, we need only find the first area with a base + // smaller than our address to become our only candidate for + // reallocating + if (area->base <= (addr_t)address) { + if ((addr_t)address >= area->base + area->size) { + // the only candidate area doesn't contain the address, + // set it to NULL so we return below (none of the other areas + // can contain the address as the list is ordered) + area = NULL; + } + break; + } area = area->all_next; } if (area == NULL) { // this address does not belong to us - mutex_unlock(&heap->lock); return B_ENTRY_NOT_FOUND; } @@ -1639,7 +1659,6 @@ if (page->bin_index > heap->bin_count) { panic("realloc(): page %p: invalid bin_index %d\n", page, page->bin_index); - mutex_unlock(&heap->lock); return B_ERROR; } @@ -1657,6 +1676,8 @@ uint32 allocationID = page->allocation_id; uint32 maxPages = area->page_count - page->index; maxSize = heap->page_size; + + MutexLocker pageLocker(heap->page_lock); for (uint32 i = 1; i < maxPages; i++) { if (!page[i].in_use || page[i].bin_index != heap->bin_count || page[i].allocation_id != allocationID) @@ -1667,7 +1688,7 @@ } } - mutex_unlock(&heap->lock); + heapReadLocker.Unlock(); #if KERNEL_HEAP_LEAK_CHECK newSize += sizeof(heap_leak_check_info); @@ -2001,11 +2022,11 @@ void * -malloc_nogrow(size_t size) +memalign_nogrow(size_t alignment, size_t size) { // use dedicated memory in the grow thread by default if (thread_get_current_thread_id() == sHeapGrowThread) { - void *result = heap_memalign(sGrowHeap, 0, size); + void *result = heap_memalign(sGrowHeap, alignment, size); if (!sAddGrowHeap && heap_should_grow(sGrowHeap)) { // hopefully the heap grower will manage to create a new heap // before running out of private memory... @@ -2020,7 +2041,7 @@ // try public memory, there might be something available heap_allocator *heap = sHeaps[heap_class_for(size)]; - void *result = heap_memalign(heap, 0, size); + void *result = heap_memalign(heap, alignment, size); if (result != NULL) return result; @@ -2035,6 +2056,13 @@ void * +malloc_nogrow(size_t size) +{ + return memalign_nogrow(0, size); +} + + +void * malloc(size_t size) { return memalign(0, size); @@ -2169,36 +2197,35 @@ void -deferred_free(void* block) +deferred_free(void *block) { if (block == NULL) return; - DeferredFreeListEntry* entry = new(block) DeferredFreeListEntry; + DeferredFreeListEntry *entry = new(block) DeferredFreeListEntry; InterruptsSpinLocker _(sDeferredFreeListLock); sDeferredFreeList.Add(entry); } -void* +void * malloc_referenced(size_t size) { - int32* referencedData = (int32*)malloc(size + 4); + int32 *referencedData = (int32 *)malloc(size + 4); if (referencedData == NULL) return NULL; *referencedData = 1; - return referencedData + 1; } -void* -malloc_referenced_acquire(void* data) +void * +malloc_referenced_acquire(void *data) { if (data != NULL) { - int32* referencedData = (int32*)data - 1; + int32 *referencedData = (int32 *)data - 1; atomic_add(referencedData, 1); } @@ -2207,12 +2234,12 @@ void -malloc_referenced_release(void* data) +malloc_referenced_release(void *data) { if (data == NULL) return; - int32* referencedData = (int32*)data - 1; + int32 *referencedData = (int32 *)data - 1; if (atomic_add(referencedData, -1) < 1) free(referencedData); } @@ -2224,7 +2251,7 @@ void -deferred_delete(DeferredDeletable* deletable) +deferred_delete(DeferredDeletable *deletable) { if (deletable == NULL) return; From axeld at mail.berlios.de Mon Aug 3 16:35:31 2009 From: axeld at mail.berlios.de (axeld at mail.berlios.de) Date: Mon, 3 Aug 2009 16:35:31 +0200 Subject: [Haiku-commits] r32075 - haiku/trunk/src/kits/interface Message-ID: <200908031435.n73EZVJw003506@sheep.berlios.de> Author: axeld Date: 2009-08-03 16:35:27 +0200 (Mon, 03 Aug 2009) New Revision: 32075 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32075&view=rev Modified: haiku/trunk/src/kits/interface/TextView.cpp Log: * The preferred size is now actually the preferred size - the size that is needed to show all of the text view's contents. No idea what the previous solution was about. Modified: haiku/trunk/src/kits/interface/TextView.cpp =================================================================== --- haiku/trunk/src/kits/interface/TextView.cpp 2009-08-03 13:59:45 UTC (rev 32074) +++ haiku/trunk/src/kits/interface/TextView.cpp 2009-08-03 14:35:27 UTC (rev 32075) @@ -2797,10 +2797,20 @@ fLayoutData->min = min; // compute our preferred size - fLayoutData->preferred = min; - fLayoutData->preferred.width += lineHeight * 6; - fLayoutData->preferred.height += lineHeight * 2; + fLayoutData->preferred.height = fTextRect.Height() + + fLayoutData->topInset + fLayoutData->bottomInset; + float maxWidth = 0; + for (int i = 0; i < fLines->NumLines(); i++) { + float width = LineWidth(0); + if (maxWidth < width) + maxWidth = width; + } + if (maxWidth < min.width) + maxWidth = min.width; + fLayoutData->preferred.width + = maxWidth + fLayoutData->leftInset + fLayoutData->rightInset; + fLayoutData->valid = true; TRACE("width: %.2f, height: %.2f\n", min.width, min.height); From mmu_man at mail.berlios.de Mon Aug 3 16:39:47 2009 From: mmu_man at mail.berlios.de (mmu_man at mail.berlios.de) Date: Mon, 3 Aug 2009 16:39:47 +0200 Subject: [Haiku-commits] r32076 - in haiku/trunk: headers/private/kernel/boot src/system/boot/loader src/system/boot/platform/atari_m68k src/system/boot/platform/bios_ia32 src/system/boot/platform/openfirmware Message-ID: <200908031439.n73Edl9Z004092@sheep.berlios.de> Author: mmu_man Date: 2009-08-03 16:39:41 +0200 (Mon, 03 Aug 2009) New Revision: 32076 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32076&view=rev Added: haiku/trunk/src/system/boot/platform/bios_ia32/multiboot.cpp Modified: haiku/trunk/headers/private/kernel/boot/stage2_args.h haiku/trunk/src/system/boot/loader/load_driver_settings.cpp haiku/trunk/src/system/boot/loader/load_driver_settings.h haiku/trunk/src/system/boot/loader/main.cpp haiku/trunk/src/system/boot/platform/atari_m68k/start.c haiku/trunk/src/system/boot/platform/bios_ia32/Jamfile haiku/trunk/src/system/boot/platform/bios_ia32/multiboot.h haiku/trunk/src/system/boot/platform/bios_ia32/start.c haiku/trunk/src/system/boot/platform/openfirmware/start.c Log: - introduced an "argumetns" field in stage2_args to hold command line args from chaining loader, - added some multiboot support code: - dump some of the passed info, - parse command line (skip the 'kernel' name and pass the rest to stage2_args.arguments), - added an add_stage2_driver_settings() function which takes stage2_args.arguments and translates it into safe mode driver settings, a bit dumb for now. This allows using qemu -kernel haiku_loader -append 'debug_screen true' and get debug output without having to enter the menu (once multiboot info is used to determine the boot device too). The idea is to allow passing driver settings and using them to pass extra stuff (like 'force_keymap fr' and other stuff for demo), and to help automate tests ('run_test /bin/sometest'). This should answer Axel's question :) Modified: haiku/trunk/headers/private/kernel/boot/stage2_args.h =================================================================== --- haiku/trunk/headers/private/kernel/boot/stage2_args.h 2009-08-03 14:35:27 UTC (rev 32075) +++ haiku/trunk/headers/private/kernel/boot/stage2_args.h 2009-08-03 14:39:41 UTC (rev 32076) @@ -12,6 +12,7 @@ typedef struct stage2_args { size_t heap_size; + const char **arguments; struct platform_stage2_args platform; } stage2_args ; Modified: haiku/trunk/src/system/boot/loader/load_driver_settings.cpp =================================================================== --- haiku/trunk/src/system/boot/loader/load_driver_settings.cpp 2009-08-03 14:35:27 UTC (rev 32075) +++ haiku/trunk/src/system/boot/loader/load_driver_settings.cpp 2009-08-03 14:39:41 UTC (rev 32076) @@ -135,6 +135,19 @@ status_t +add_stage2_driver_settings(stage2_args *args) +{ + const char **p = args->arguments; + //TODO: split more intelligently + for (; p && *p; p++) { + dprintf("adding args: '%s'\n", *p); + add_safe_mode_settings((char *)*p); + } + return B_OK; +} + + +status_t add_safe_mode_settings(char *settings) { if (settings == NULL || settings[0] == '\0') Modified: haiku/trunk/src/system/boot/loader/load_driver_settings.h =================================================================== --- haiku/trunk/src/system/boot/loader/load_driver_settings.h 2009-08-03 14:35:27 UTC (rev 32075) +++ haiku/trunk/src/system/boot/loader/load_driver_settings.h 2009-08-03 14:39:41 UTC (rev 32076) @@ -10,6 +10,7 @@ extern status_t add_safe_mode_settings(char *buffer); +extern status_t add_stage2_driver_settings(stage2_args *args); extern status_t load_driver_settings(stage2_args *args, Directory *volume); #endif /* LOAD_DRIVER_SETTINGS_H */ Modified: haiku/trunk/src/system/boot/loader/main.cpp =================================================================== --- haiku/trunk/src/system/boot/loader/main.cpp 2009-08-03 14:35:27 UTC (rev 32075) +++ haiku/trunk/src/system/boot/loader/main.cpp 2009-08-03 14:39:41 UTC (rev 32076) @@ -38,6 +38,8 @@ // construct boot_volume KMessage explicitely new(&gKernelArgs.boot_volume) KMessage; + add_stage2_driver_settings(args); + platform_init_video(); // the main platform dependent initialisation Modified: haiku/trunk/src/system/boot/platform/atari_m68k/start.c =================================================================== --- haiku/trunk/src/system/boot/platform/atari_m68k/start.c 2009-08-03 14:35:27 UTC (rev 32075) +++ haiku/trunk/src/system/boot/platform/atari_m68k/start.c 2009-08-03 14:39:41 UTC (rev 32076) @@ -132,6 +132,7 @@ Bconout(DEV_CON, 'I'); args.heap_size = HEAP_SIZE; + args.arguments = NULL; // so we can dprintf init_nat_features(); Modified: haiku/trunk/src/system/boot/platform/bios_ia32/Jamfile =================================================================== --- haiku/trunk/src/system/boot/platform/bios_ia32/Jamfile 2009-08-03 14:35:27 UTC (rev 32075) +++ haiku/trunk/src/system/boot/platform/bios_ia32/Jamfile 2009-08-03 14:39:41 UTC (rev 32076) @@ -28,6 +28,7 @@ keyboard.cpp menu.cpp mmu.cpp + multiboot.cpp cpu.cpp acpi.cpp smp.cpp Added: haiku/trunk/src/system/boot/platform/bios_ia32/multiboot.cpp =================================================================== --- haiku/trunk/src/system/boot/platform/bios_ia32/multiboot.cpp 2009-08-03 14:35:27 UTC (rev 32075) +++ haiku/trunk/src/system/boot/platform/bios_ia32/multiboot.cpp 2009-08-03 14:39:41 UTC (rev 32076) @@ -0,0 +1,51 @@ +/* + * Copyright 2009, Fran?ois Revol, revol at free.fr. + * Distributed under the terms of the MIT License. + */ + +#include "multiboot.h" + +#include +#include +#include + +extern struct multiboot_info *gMultiBootInfo; + +// load_driver_settings.h +extern status_t add_safe_mode_settings(char *buffer); + +void +dump_multiboot_info(void) +{ + if (!gMultiBootInfo) + return; + dprintf("Found MultiBoot Info at %p\n", gMultiBootInfo); + dprintf(" flags: 0x%lx\n", gMultiBootInfo->flags); + if (gMultiBootInfo->flags & MULTIBOOT_INFO_BOOTDEV) + dprintf(" boot_device: 0x%lx\n", gMultiBootInfo->boot_device); + if (gMultiBootInfo->flags & MULTIBOOT_INFO_CMDLINE && gMultiBootInfo->cmdline) + dprintf(" cmdline: '%s'\n", (char *)gMultiBootInfo->cmdline); + if (gMultiBootInfo->boot_loader_name) + dprintf(" boot_loader_name: '%s'\n", (char *)gMultiBootInfo->boot_loader_name); +} + + +status_t +parse_multiboot_commandline(stage2_args *args) +{ + static const char *sArgs[] = { NULL, NULL }; + if (!gMultiBootInfo || !(gMultiBootInfo->flags & MULTIBOOT_INFO_CMDLINE) || !gMultiBootInfo->cmdline) + return B_ENTRY_NOT_FOUND; + + const char *cmdline = (const char *)gMultiBootInfo->cmdline; + // skip kernel (bootloader) name + cmdline = strchr(cmdline, ' '); + if (!cmdline) + return B_ENTRY_NOT_FOUND; + cmdline++; + if (*cmdline == '\0') + return B_ENTRY_NOT_FOUND; + sArgs[0] = cmdline; + args->arguments = sArgs; + return B_OK; +} Modified: haiku/trunk/src/system/boot/platform/bios_ia32/multiboot.h =================================================================== --- haiku/trunk/src/system/boot/platform/bios_ia32/multiboot.h 2009-08-03 14:35:27 UTC (rev 32075) +++ haiku/trunk/src/system/boot/platform/bios_ia32/multiboot.h 2009-08-03 14:39:41 UTC (rev 32076) @@ -1,10 +1,14 @@ /* - * Copyright 2003-2006, Fran?ois Revol, revol at free.fr. + * Copyright 2009, Fran?ois Revol, revol at free.fr. * Distributed under the terms of the MIT License. */ #ifndef _MULTIBOOT_H #define _MULTIBOOT_H + +#include + + /* minimal part of the MultiBoot API */ /* magics */ @@ -49,4 +53,17 @@ uint16 vbe_interface_len; }; + +#ifdef __cplusplus +extern "C" { +#endif + +extern void dump_multiboot_info(void); +extern status_t parse_multiboot_commandline(struct stage2_args *args); + +#ifdef __cplusplus +} +#endif + + #endif /* _MULTIBOOT_H */ Modified: haiku/trunk/src/system/boot/platform/bios_ia32/start.c =================================================================== --- haiku/trunk/src/system/boot/platform/bios_ia32/start.c 2009-08-03 14:35:27 UTC (rev 32075) +++ haiku/trunk/src/system/boot/platform/bios_ia32/start.c 2009-08-03 14:39:41 UTC (rev 32076) @@ -13,6 +13,7 @@ #include "acpi.h" #include "keyboard.h" #include "bios.h" +#include "multiboot.h" #include #include @@ -120,11 +121,13 @@ // call C++ constructors before doing anything else args.heap_size = HEAP_SIZE; + args.arguments = NULL; serial_init(); console_init(); cpu_init(); mmu_init(); + parse_multiboot_commandline(&args); // wait a bit to give the user the opportunity to press a key spin(750000); @@ -139,6 +142,7 @@ acpi_init(); smp_init(); //hpet_init(); // TODO: Not yet + dump_multiboot_info(); main(&args); } Modified: haiku/trunk/src/system/boot/platform/openfirmware/start.c =================================================================== --- haiku/trunk/src/system/boot/platform/openfirmware/start.c 2009-08-03 14:35:27 UTC (rev 32075) +++ haiku/trunk/src/system/boot/platform/openfirmware/start.c 2009-08-03 14:39:41 UTC (rev 32076) @@ -135,6 +135,7 @@ // stage2 args - might be set via the command line one day stage2_args args; args.heap_size = HEAP_SIZE; + args.arguments = NULL; of_init(openFirmwareEntry); From axeld at mail.berlios.de Mon Aug 3 16:41:30 2009 From: axeld at mail.berlios.de (axeld at mail.berlios.de) Date: Mon, 3 Aug 2009 16:41:30 +0200 Subject: [Haiku-commits] r32077 - haiku/trunk/src/kits/interface Message-ID: <200908031441.n73EfUfu004479@sheep.berlios.de> Author: axeld Date: 2009-08-03 16:41:27 +0200 (Mon, 03 Aug 2009) New Revision: 32077 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32077&view=rev Modified: haiku/trunk/src/kits/interface/TextView.cpp Log: * Only use the new preferred computation method if word wrap is disabled, or else this won't work as is (this is something that could be done, better, though). Modified: haiku/trunk/src/kits/interface/TextView.cpp =================================================================== --- haiku/trunk/src/kits/interface/TextView.cpp 2009-08-03 14:39:41 UTC (rev 32076) +++ haiku/trunk/src/kits/interface/TextView.cpp 2009-08-03 14:41:27 UTC (rev 32077) @@ -2799,18 +2799,23 @@ // compute our preferred size fLayoutData->preferred.height = fTextRect.Height() + fLayoutData->topInset + fLayoutData->bottomInset; - float maxWidth = 0; - for (int i = 0; i < fLines->NumLines(); i++) { - float width = LineWidth(0); - if (maxWidth < width) - maxWidth = width; + + if (fWrap) + fLayoutData->preferred.width = min.width + 5 * lineHeight; + else { + float maxWidth = 0; + for (int i = 0; i < fLines->NumLines(); i++) { + float width = LineWidth(0); + if (maxWidth < width) + maxWidth = width; + } + if (maxWidth < min.width) + maxWidth = min.width; + + fLayoutData->preferred.width + = maxWidth + fLayoutData->leftInset + fLayoutData->rightInset; } - if (maxWidth < min.width) - maxWidth = min.width; - fLayoutData->preferred.width - = maxWidth + fLayoutData->leftInset + fLayoutData->rightInset; - fLayoutData->valid = true; TRACE("width: %.2f, height: %.2f\n", min.width, min.height); From axeld at mail.berlios.de Mon Aug 3 16:47:54 2009 From: axeld at mail.berlios.de (axeld at mail.berlios.de) Date: Mon, 3 Aug 2009 16:47:54 +0200 Subject: [Haiku-commits] r32078 - in haiku/trunk: headers/os/app headers/os/interface headers/private/binary_compatibility headers/private/interface src/kits/interface src/tests/kits/interface Message-ID: <200908031447.n73Elscv005496@sheep.berlios.de> Author: axeld Date: 2009-08-03 16:47:41 +0200 (Mon, 03 Aug 2009) New Revision: 32078 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32078&view=rev Added: haiku/trunk/headers/private/interface/ToolTip.h haiku/trunk/headers/private/interface/ToolTipManager.h haiku/trunk/headers/private/interface/ToolTipWindow.h haiku/trunk/src/kits/interface/ToolTip.cpp haiku/trunk/src/kits/interface/ToolTipManager.cpp haiku/trunk/src/tests/kits/interface/ToolTipTest.cpp Modified: haiku/trunk/headers/os/app/AppDefs.h haiku/trunk/headers/os/interface/InterfaceDefs.h haiku/trunk/headers/os/interface/View.h haiku/trunk/headers/os/interface/Window.h haiku/trunk/headers/private/binary_compatibility/Global.h haiku/trunk/headers/private/binary_compatibility/Interface.h haiku/trunk/src/kits/interface/Jamfile haiku/trunk/src/kits/interface/View.cpp haiku/trunk/src/kits/interface/Window.cpp haiku/trunk/src/tests/kits/interface/Jamfile Log: * Added a basic tool tip API, and implementation. * The BView API can probably be regarded as good enough; the implementation might need to be improved over time (also, some things as archivability aren't fully implemented yet). The ToolTip.h header should get public once finalized. * Added new B_MOUSE_IDLE message that is sent to a BView after a certain time has passed (BToolTipManager::ShowDelay()). * Added small test app (ToolTipTest) that shows what is already working. Modified: haiku/trunk/headers/os/app/AppDefs.h =================================================================== --- haiku/trunk/headers/os/app/AppDefs.h 2009-08-03 14:41:27 UTC (rev 32077) +++ haiku/trunk/headers/os/app/AppDefs.h 2009-08-03 14:47:41 UTC (rev 32078) @@ -44,6 +44,7 @@ B_MOUSE_DOWN = '_MDN', B_MOUSE_MOVED = '_MMV', B_MOUSE_ENTER_EXIT = '_MEX', + B_MOUSE_IDLE = '_MSI', B_MOUSE_UP = '_MUP', B_MOUSE_WHEEL_CHANGED = '_MWC', B_OPEN_IN_WORKSPACE = '_OWS', Modified: haiku/trunk/headers/os/interface/InterfaceDefs.h =================================================================== --- haiku/trunk/headers/os/interface/InterfaceDefs.h 2009-08-03 14:41:27 UTC (rev 32077) +++ haiku/trunk/headers/os/interface/InterfaceDefs.h 2009-08-03 14:47:41 UTC (rev 32078) @@ -282,8 +282,8 @@ B_MENU_SELECTED_ITEM_TEXT_COLOR = 8, B_MENU_SELECTED_BORDER_COLOR = 9, - B_TOOLTIP_BACKGROUND_COLOR = 20, - B_TOOLTIP_TEXT_COLOR = 21, + B_TOOL_TIP_BACKGROUND_COLOR = 20, + B_TOOL_TIP_TEXT_COLOR = 21, B_SUCCESS_COLOR = 100, B_FAILURE_COLOR = 101, Modified: haiku/trunk/headers/os/interface/View.h =================================================================== --- haiku/trunk/headers/os/interface/View.h 2009-08-03 14:41:27 UTC (rev 32077) +++ haiku/trunk/headers/os/interface/View.h 2009-08-03 14:47:41 UTC (rev 32078) @@ -124,6 +124,7 @@ class BShape; class BShelf; class BString; +class BToolTip; class BWindow; struct _array_data_; struct _array_hdr_; @@ -503,7 +504,6 @@ virtual void DrawAfterChildren(BRect r); - // layout related virtual BSize MinSize(); @@ -542,6 +542,19 @@ protected: virtual void DoLayout(); +public: + // tool tip support + + void SetToolTip(const char* text); + void SetToolTip(BToolTip* tip); + BToolTip* ToolTip() const; + + void ShowToolTip(BToolTip* tip = NULL); + void HideToolTip(); + +protected: + virtual bool GetToolTipAt(BPoint point, BToolTip** _tip); + private: void _Layout(bool force, BLayoutContext* context); @@ -556,7 +569,6 @@ friend class BTabView; friend class BWindow; - virtual void _ReservedView11(); virtual void _ReservedView12(); virtual void _ReservedView13(); virtual void _ReservedView14(); @@ -653,8 +665,10 @@ uint32 fMouseEventOptions; LayoutData* fLayoutData; + BToolTip* fToolTip; + BToolTip* fVisibleToolTip; - uint32 _reserved[7]; + uint32 _reserved[5]; }; Modified: haiku/trunk/headers/os/interface/Window.h =================================================================== --- haiku/trunk/headers/os/interface/Window.h 2009-08-03 14:41:27 UTC (rev 32077) +++ haiku/trunk/headers/os/interface/Window.h 2009-08-03 14:47:41 UTC (rev 32078) @@ -347,7 +347,7 @@ BView* fTopView; BView* fFocus; BView* fLastMouseMovedView; - uint32 _unused1; + BMessageRunner* fIdleMouseRunner; BMenuBar* fKeyMenuBar; BButton* fDefaultButton; BList fShortcuts; Modified: haiku/trunk/headers/private/binary_compatibility/Global.h =================================================================== --- haiku/trunk/headers/private/binary_compatibility/Global.h 2009-08-03 14:41:27 UTC (rev 32077) +++ haiku/trunk/headers/private/binary_compatibility/Global.h 2009-08-03 14:47:41 UTC (rev 32078) @@ -20,7 +20,8 @@ PERFORM_CODE_GET_HEIGHT_FOR_WIDTH = 1005, PERFORM_CODE_SET_LAYOUT = 1006, PERFORM_CODE_INVALIDATE_LAYOUT = 1007, - PERFORM_CODE_DO_LAYOUT = 1008 + PERFORM_CODE_DO_LAYOUT = 1008, + PERFORM_CODE_GET_TOOL_TIP_AT = 1009 // support kit }; Modified: haiku/trunk/headers/private/binary_compatibility/Interface.h =================================================================== --- haiku/trunk/headers/private/binary_compatibility/Interface.h 2009-08-03 14:41:27 UTC (rev 32077) +++ haiku/trunk/headers/private/binary_compatibility/Interface.h 2009-08-03 14:47:41 UTC (rev 32078) @@ -45,5 +45,10 @@ bool descendants; }; +struct perform_data_get_tool_tip_at { + BPoint point; + BToolTip** tool_tip; + bool return_value; +}; #endif /* _BINARY_COMPATIBILITY_INTERFACE_H_ */ Added: haiku/trunk/headers/private/interface/ToolTip.h =================================================================== --- haiku/trunk/headers/private/interface/ToolTip.h 2009-08-03 14:41:27 UTC (rev 32077) +++ haiku/trunk/headers/private/interface/ToolTip.h 2009-08-03 14:47:41 UTC (rev 32078) @@ -0,0 +1,73 @@ +/* + * Copyright 2009, Haiku, Inc. All Rights Reserved. + * Distributed under the terms of the MIT License. + */ +#ifndef _TOOL_TIP_H +#define _TOOL_TIP_H + + +#include +#include +#include +#include + + +class BView; +class BTextView; + + +class BToolTip : public BArchivable, public BReferenceable { +public: + BToolTip(); + BToolTip(BMessage* archive); + virtual ~BToolTip(); + + virtual status_t Archive(BMessage* archive, + bool deep = true) const; + + virtual BView* View() const = 0; + + virtual void SetSticky(bool enable); + bool IsSticky() const; + virtual void SetMouseRelativeLocation(BPoint location); + BPoint MouseRelativeLocation() const; + virtual void SetAlignment(BAlignment alignment); + BAlignment Alignment() const; + +private: + BToolTip(const BToolTip& other); + BToolTip& operator=(const BToolTip &other); + + void _InitData(); + +private: + bool fIsSticky; + BPoint fRelativeLocation; + BAlignment fAlignment; +}; + + +class BTextToolTip : public BToolTip { +public: + BTextToolTip(const char* text); + BTextToolTip(BMessage* archive); + virtual ~BTextToolTip(); + + static BTextToolTip* Instantiate(BMessage* archive); + virtual status_t Archive(BMessage* archive, + bool deep = true) const; + + virtual BView* View() const; + + const char* Text() const; + void SetText(const char* text); + +private: + void _InitData(const char* text); + +private: + BTextView* fTextView; +}; + + +#endif // _TOOL_TIP_H Added: haiku/trunk/headers/private/interface/ToolTipManager.h =================================================================== --- haiku/trunk/headers/private/interface/ToolTipManager.h 2009-08-03 14:41:27 UTC (rev 32077) +++ haiku/trunk/headers/private/interface/ToolTipManager.h 2009-08-03 14:47:41 UTC (rev 32078) @@ -0,0 +1,41 @@ +/* + * Copyright 2009, Haiku, Inc. All Rights Reserved. + * Distributed under the terms of the MIT License. + */ +#ifndef _TOOL_TIP_MANAGER_H +#define _TOOL_TIP_MANAGER_H + + +#include +#include + + +class BToolTip; + + +class BToolTipManager { +public: + static BToolTipManager* Manager(); + + void ShowTip(BToolTip* tip, BPoint point); + void HideTip(); + + void SetShowDelay(bigtime_t time); + bigtime_t ShowDelay() const; + void SetHideDelay(bigtime_t time); + bigtime_t HideDelay() const; + +private: + BToolTipManager(); + virtual ~BToolTipManager(); + + BMessenger fWindow; + + bigtime_t fShowDelay; + bigtime_t fHideDelay; + + static BToolTipManager* sDefaultInstance; +}; + + +#endif // _TOOL_TIP_MANAGER_H Added: haiku/trunk/headers/private/interface/ToolTipWindow.h =================================================================== --- haiku/trunk/headers/private/interface/ToolTipWindow.h 2009-08-03 14:41:27 UTC (rev 32077) +++ haiku/trunk/headers/private/interface/ToolTipWindow.h 2009-08-03 14:47:41 UTC (rev 32078) @@ -0,0 +1,24 @@ +/* + * Copyright 2009, Haiku, Inc. All Rights Reserved. + * Distributed under the terms of the MIT License. + */ +#ifndef TOOL_TIP_WINDOW_H +#define TOOL_TIP_WINDOW_H + + +#include + + +namespace BPrivate { + +class ToolTipWindow : public BWindow { +public: + ToolTipWindow(BToolTip* tip, BPoint where); + + virtual void MessageReceived(BMessage* message); +}; + +} // namespace BPrivate + + +#endif // TOOL_TIP_WINDOW_H Modified: haiku/trunk/src/kits/interface/Jamfile =================================================================== --- haiku/trunk/src/kits/interface/Jamfile 2009-08-03 14:41:27 UTC (rev 32077) +++ haiku/trunk/src/kits/interface/Jamfile 2009-08-03 14:47:41 UTC (rev 32078) @@ -122,6 +122,8 @@ TextControl.cpp TextInput.cpp TextView.cpp + ToolTip.cpp + ToolTipManager.cpp TwoDimensionalLayout.cpp View.cpp ViewLayoutItem.cpp Added: haiku/trunk/src/kits/interface/ToolTip.cpp =================================================================== --- haiku/trunk/src/kits/interface/ToolTip.cpp 2009-08-03 14:41:27 UTC (rev 32077) +++ haiku/trunk/src/kits/interface/ToolTip.cpp 2009-08-03 14:47:41 UTC (rev 32078) @@ -0,0 +1,175 @@ +/* + * Copyright 2009, Axel D?rfler, axeld at pinc-software.de. + * Distributed under the terms of the MIT License. + */ + + +#include + +#include + +#include +#include + + +BToolTip::BToolTip() +{ + _InitData(); +} + + +BToolTip::BToolTip(BMessage* archive) +{ + _InitData(); + + bool sticky; + if (archive->FindBool("sticky", &sticky) == B_OK) + fIsSticky = sticky; + + // TODO! +} + + +BToolTip::~BToolTip() +{ +} + + +status_t +BToolTip::Archive(BMessage* archive, bool deep) const +{ + status_t status = BArchivable::Archive(archive, deep); + + if (fIsSticky) + status = archive->AddBool("sticky", fIsSticky); + + // TODO! + return status; +} + + +void +BToolTip::SetSticky(bool enable) +{ + fIsSticky = enable; +} + + +bool +BToolTip::IsSticky() const +{ + return fIsSticky; +} + + +void +BToolTip::SetMouseRelativeLocation(BPoint location) +{ + fRelativeLocation = location; +} + + +BPoint +BToolTip::MouseRelativeLocation() const +{ + return fRelativeLocation; +} + + +void +BToolTip::SetAlignment(BAlignment alignment) +{ + fAlignment = alignment; +} + + +BAlignment +BToolTip::Alignment() const +{ + return fAlignment; +} + + +void +BToolTip::_InitData() +{ + fIsSticky = false; + fRelativeLocation = BPoint(20, 20); + fAlignment = BAlignment(B_ALIGN_RIGHT, B_ALIGN_BOTTOM); +} + + +// #pragma mark - + + +BTextToolTip::BTextToolTip(const char* text) +{ + _InitData(text); +} + + +BTextToolTip::BTextToolTip(BMessage* archive) +{ + // TODO! +} + + +BTextToolTip::~BTextToolTip() +{ + delete fTextView; +} + + +/*static*/ BTextToolTip* +BTextToolTip::Instantiate(BMessage* archive) +{ + if (!validate_instantiation(archive, "BTextToolTip")) + return NULL; + + return new(std::nothrow) BTextToolTip(archive); +} + + +status_t +BTextToolTip::Archive(BMessage* archive, bool deep) const +{ + status_t status = BToolTip::Archive(archive, deep); + // TODO! + + return status; +} + + +BView* +BTextToolTip::View() const +{ + return fTextView; +} + + +const char* +BTextToolTip::Text() const +{ + return fTextView->Text(); +} + + +void +BTextToolTip::SetText(const char* text) +{ + fTextView->SetText(text); +} + + +void +BTextToolTip::_InitData(const char* text) +{ + fTextView = new BTextView("tool tip text"); + fTextView->SetText(text); + fTextView->MakeEditable(false); + fTextView->SetViewColor(ui_color(B_TOOL_TIP_BACKGROUND_COLOR)); + rgb_color color = ui_color(B_TOOL_TIP_TEXT_COLOR); + fTextView->SetFontAndColor(NULL, 0, &color); + fTextView->SetWordWrap(false); +} + Added: haiku/trunk/src/kits/interface/ToolTipManager.cpp =================================================================== --- haiku/trunk/src/kits/interface/ToolTipManager.cpp 2009-08-03 14:41:27 UTC (rev 32077) +++ haiku/trunk/src/kits/interface/ToolTipManager.cpp 2009-08-03 14:47:41 UTC (rev 32078) @@ -0,0 +1,264 @@ +/* + * Copyright 2009, Axel D?rfler, axeld at pinc-software.de. + * Distributed under the terms of the MIT License. + */ + + +#include +#include + +#include +#include +#include + +#include + + +BToolTipManager* BToolTipManager::sDefaultInstance; + +static BLocker sLock("tool tip manager"); + +static const uint32 kMsgHideToolTip = 'hide'; +static const uint32 kMsgShowToolTip = 'show'; +static const uint32 kMsgCurrentToolTip = 'curr'; +static const uint32 kMsgCloseToolTip = 'clos'; + + +namespace BPrivate { + +class ToolTipView : public BView { +public: + ToolTipView(BToolTip* tip) + : + BView("tool tip", B_WILL_DRAW), + fToolTip(tip), + fHidden(false) + { + fToolTip->AcquireReference(); + SetViewColor(ui_color(B_TOOL_TIP_BACKGROUND_COLOR)); + + BGroupLayout* layout = new BGroupLayout(B_VERTICAL); + layout->SetInsets(5, 5, 5, 5); + SetLayout(layout); + + AddChild(fToolTip->View()); + } + + virtual ~ToolTipView() + { + fToolTip->ReleaseReference(); + } + + virtual void AttachedToWindow() + { + SetEventMask(B_POINTER_EVENTS, 0); + } + + virtual void DetachedFromWindow() + { + RemoveChild(fToolTip->View()); + // don't delete this one! + } + + virtual void MouseMoved(BPoint where, uint32 transit, + const BMessage* dragMessage) + { + if (fToolTip->IsSticky()) { + // TODO: move window with mouse! + Window()->MoveTo( + ConvertToScreen(where) + fToolTip->MouseRelativeLocation()); + } else if (transit == B_ENTERED_VIEW) { + // close instantly if the user managed to enter + Window()->Quit(); + } else { + // close with the preferred delay in case the mouse just moved + HideTip(); + } + } + + void HideTip() + { + if (fHidden) + return; + + BMessage quit(kMsgCloseToolTip); + BMessageRunner::StartSending(Window(), &quit, + BToolTipManager::Manager()->HideDelay(), 1); + fHidden = true; + } + + void ShowTip() + { + fHidden = false; + } + + BToolTip* Tip() const { return fToolTip; } + bool IsTipHidden() const { return fHidden; } + +private: + BToolTip* fToolTip; + bool fHidden; +}; + + +ToolTipWindow::ToolTipWindow(BToolTip* tip, BPoint where) + : + BWindow(BRect(0, 0, 250, 10), "tool tip", B_BORDERED_WINDOW_LOOK, + B_FLOATING_APP_WINDOW_FEEL, B_NOT_ZOOMABLE | B_NOT_MINIMIZABLE + | B_AUTO_UPDATE_SIZE_LIMITS | B_AVOID_FRONT | B_AVOID_FOCUS) +{ + MoveTo(where + tip->MouseRelativeLocation()); + + // TODO: take alignment into account! + + SetLayout(new BGroupLayout(B_VERTICAL)); + AddChild(new ToolTipView(tip)); + + BSize size = ChildAt(0)->PreferredSize(); + ResizeTo(size.width, size.height); + //AddChild(BLayoutBuilder::Group<>(B_VERTICAL).Add(new ToolTipView(tip))); +} + + +void +ToolTipWindow::MessageReceived(BMessage* message) +{ + ToolTipView* view = static_cast(ChildAt(0)); + + switch (message->what) { + case kMsgHideToolTip: + view->HideTip(); + break; + + case kMsgCurrentToolTip: + { + BToolTip* tip = view->Tip(); + + BMessage reply(B_REPLY); + reply.AddPointer("current", tip); + + if (message->SendReply(&reply) == B_OK) + tip->AcquireReference(); + break; + } + + case kMsgShowToolTip: + view->ShowTip(); + break; + + case kMsgCloseToolTip: + if (view->IsTipHidden()) + Quit(); + break; + + default: + BWindow::MessageReceived(message); + } +} + +} // namespace BPrivate + + +// #pragma mark - + + +/*static*/ BToolTipManager* +BToolTipManager::Manager() +{ + BAutolock _(sLock); + + if (sDefaultInstance == NULL) + sDefaultInstance = new BToolTipManager(); + + return sDefaultInstance; +} + + +void +BToolTipManager::ShowTip(BToolTip* tip, BPoint point) +{ + BToolTip* current = NULL; + BMessage reply; + if (fWindow.SendMessage(kMsgCurrentToolTip, &reply) == B_OK) + reply.FindPointer("current", (void**)¤t); + + if (current != NULL) + current->ReleaseReference(); + + if (current == tip) { + fWindow.SendMessage(kMsgShowToolTip); + return; + } + + fWindow.SendMessage(kMsgHideToolTip); + + if (current != NULL) + current->ReleaseReference(); + + if (tip != NULL) { + BWindow* window = new BPrivate::ToolTipWindow(tip, point); + window->Show(); + + fWindow = BMessenger(window); + } +} + + +void +BToolTipManager::HideTip() +{ + fWindow.SendMessage(kMsgHideToolTip); +} + + +void +BToolTipManager::SetShowDelay(bigtime_t time) +{ + // between 10ms and 3s + if (time < 10000) + time = 10000; + else if (time > 3000000) + time = 3000000; + + fShowDelay = time; +} + + +bigtime_t +BToolTipManager::ShowDelay() const +{ + return fShowDelay; +} + + +void +BToolTipManager::SetHideDelay(bigtime_t time) +{ + // between 0 and 0.5s + if (time < 0) + time = 0; + else if (time > 500000) + time = 500000; + + fHideDelay = time; +} + + +bigtime_t +BToolTipManager::HideDelay() const +{ + return fHideDelay; +} + + +BToolTipManager::BToolTipManager() + : + fShowDelay(750000), + fHideDelay(50000) +{ +} + + +BToolTipManager::~BToolTipManager() +{ +} Modified: haiku/trunk/src/kits/interface/View.cpp =================================================================== --- haiku/trunk/src/kits/interface/View.cpp 2009-08-03 14:41:27 UTC (rev 32077) +++ haiku/trunk/src/kits/interface/View.cpp 2009-08-03 14:47:41 UTC (rev 32078) @@ -54,6 +54,8 @@ #include #include #include +#include +#include #include #include @@ -579,6 +581,9 @@ RemoveSelf(); + if (fToolTip != NULL) + fToolTip->ReleaseReference(); + // TODO: see about BShelf! must I delete it here? is it deleted by // the window? @@ -4171,6 +4176,18 @@ FrameMoved(fParentOffset); break; + case B_MOUSE_IDLE: + { + BPoint where; + if (msg->FindPoint("be:view_where", &where) != B_OK) + break; + + BToolTip* tip; + if (GetToolTipAt(where, &tip)) + ShowToolTip(tip); + break; + } + case B_MOUSE_WHEEL_CHANGED: { BScrollBar* horizontal = ScrollBar(B_HORIZONTAL); @@ -4339,6 +4356,14 @@ BView::DoLayout(); return B_OK; } + case PERFORM_CODE_GET_TOOL_TIP_AT: + { + perform_data_get_tool_tip_at* data + = (perform_data_get_tool_tip_at*)_data; + data->return_value + = BView::GetToolTipAt(data->point, data->tool_tip); + return B_OK; + } } return BHandler::Perform(code, _data); @@ -4613,6 +4638,74 @@ void +BView::SetToolTip(const char* text) +{ + SetToolTip(new BTextToolTip(text)); +} + + +void +BView::SetToolTip(BToolTip* tip) +{ + if (fToolTip == tip) + return; + + if (fToolTip != NULL) + fToolTip->ReleaseReference(); + fToolTip = tip; + if (fToolTip != NULL) + fToolTip->AcquireReference(); +} + + +BToolTip* +BView::ToolTip() const +{ + return fToolTip; +} + + +void +BView::ShowToolTip(BToolTip* tip) +{ + if (tip == NULL) + return; + + fVisibleToolTip = tip; + + BPoint where; + GetMouse(&where, NULL, false); + + BToolTipManager::Manager()->ShowTip(tip, ConvertToScreen(where)); +} + + +void +BView::HideToolTip() +{ + BToolTipManager::Manager()->HideTip(); + fVisibleToolTip = NULL; +} + + +bool +BView::GetToolTipAt(BPoint point, BToolTip** _tip) +{ + if (fVisibleToolTip != NULL) { + *_tip = fVisibleToolTip; + return true; + } + if (fToolTip != NULL) { + *_tip = fToolTip; + return true; + } + + *_tip = NULL; + return false; +} + + +void BView::_Layout(bool force, BLayoutContext* context) { //printf("%p->BView::_Layout(%d, %p)\n", this, force, context); @@ -4715,6 +4808,9 @@ fMouseEventOptions = 0; fLayoutData = new LayoutData; + + fToolTip = NULL; + fVisibleToolTip = NULL; } @@ -5494,14 +5590,25 @@ } -void BView::_ReservedView11(){} -void BView::_ReservedView12(){} -void BView::_ReservedView13(){} -void BView::_ReservedView14(){} -void BView::_ReservedView15(){} -void BView::_ReservedView16(){} +extern "C" bool +_ReservedView11__5BView(BView* view, BPoint point, BToolTip** _toolTip) +{ + // GetToolTipAt() + perform_data_get_tool_tip_at data; + data.point = point; + data.tool_tip = _toolTip; + view->Perform(PERFORM_CODE_GET_TOOL_TIP_AT, &data); + return data.return_value; +} +void BView::_ReservedView12() {} +void BView::_ReservedView13() {} +void BView::_ReservedView14() {} +void BView::_ReservedView15() {} +void BView::_ReservedView16() {} + + BView::BView(const BView& other) : BHandler() Modified: haiku/trunk/src/kits/interface/Window.cpp =================================================================== --- haiku/trunk/src/kits/interface/Window.cpp 2009-08-03 14:41:27 UTC (rev 32077) +++ haiku/trunk/src/kits/interface/Window.cpp 2009-08-03 14:47:41 UTC (rev 32078) @@ -43,6 +43,8 @@ #include #include #include +#include +#include #include #include @@ -1209,6 +1211,21 @@ msg->FindPoint("be:view_where", &where); msg->FindInt32("buttons", (int32*)&buttons); + delete fIdleMouseRunner; + + if (transit != B_EXITED_VIEW && transit != B_OUTSIDE_VIEW) { + // Start new idle runner + BMessage idle(B_MOUSE_IDLE); + idle.AddPoint("be:view_where", where); + fIdleMouseRunner = new BMessageRunner( + BMessenger(NULL, this), &idle, + BToolTipManager::Manager()->ShowDelay(), 1); + } else { + fIdleMouseRunner = NULL; + if (dynamic_cast(this) == NULL) + BToolTipManager::Manager()->HideTip(); + } + BMessage* dragMessage = NULL; if (msg->HasMessage("be:drag_message")) { dragMessage = new BMessage(); @@ -2595,6 +2612,7 @@ fTopView = NULL; fFocus = NULL; fLastMouseMovedView = NULL; + fIdleMouseRunner = NULL; fKeyMenuBar = NULL; fDefaultButton = NULL; @@ -3089,6 +3107,7 @@ case B_MOUSE_UP: case B_MOUSE_MOVED: case B_MOUSE_WHEEL_CHANGED: + case B_MOUSE_IDLE: // is there a token of the view that is currently under the mouse? int32 token; if (message->FindInt32("_view_token", &token) == B_OK) { @@ -3183,7 +3202,8 @@ // message directly (but not to the focus view) for (int32 token; !cookie.tokens_scanned - && cookie.message->FindInt32("_token", cookie.index, &token) == B_OK; + && cookie.message->FindInt32("_token", cookie.index, &token) + == B_OK; cookie.index++) { // focus view is preferred and should get its message directly if (token == cookie.focus_token) { @@ -3294,7 +3314,8 @@ viewUnderMouse = _FindView(token); // add transit information - uint32 transit = _TransitForMouseMoved(view, viewUnderMouse);; + uint32 transit + = _TransitForMouseMoved(view, viewUnderMouse); message->AddInt32("be:transit", transit); [... truncated: 297 lines follow ...] From axeld at mail.berlios.de Mon Aug 3 16:54:25 2009 From: axeld at mail.berlios.de (axeld at mail.berlios.de) Date: Mon, 3 Aug 2009 16:54:25 +0200 Subject: [Haiku-commits] r32079 - haiku/trunk/src/tests/kits/interface Message-ID: <200908031454.n73EsPL8007336@sheep.berlios.de> Author: axeld Date: 2009-08-03 16:54:22 +0200 (Mon, 03 Aug 2009) New Revision: 32079 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32079&view=rev Modified: haiku/trunk/src/tests/kits/interface/ToolTipTest.cpp Log: * Changed text so that it's obvious those are supposed to be sticky. Modified: haiku/trunk/src/tests/kits/interface/ToolTipTest.cpp =================================================================== --- haiku/trunk/src/tests/kits/interface/ToolTipTest.cpp 2009-08-03 14:47:41 UTC (rev 32078) +++ haiku/trunk/src/tests/kits/interface/ToolTipTest.cpp 2009-08-03 14:54:22 UTC (rev 32079) @@ -209,10 +209,10 @@ BView* changing = new BStringView("3", "Changing Tool Tip"); changing->SetToolTip(new ChangingToolTip()); - BView* mouse = new BStringView("3", "Mouse Tool Tip"); + BView* mouse = new BStringView("3", "Mouse Tool Tip (sticky)"); mouse->SetToolTip(new MouseToolTip()); - BView* immediate = new ImmediateView("3", "Immediate Tool Tip"); + BView* immediate = new ImmediateView("3", "Immediate Tool Tip (sticky)"); BLayoutBuilder::Group<>(this, B_VERTICAL) .Add(simple) From dev at m-phasis.de Mon Aug 3 16:59:51 2009 From: dev at m-phasis.de (Michael Weirauch) Date: Mon, 3 Aug 2009 16:59:51 +0200 Subject: [Haiku-commits] r32078 - in haiku/trunk: headers/os/app headers/os/interface headers/private/binary_compatibility headers/private/interface src/kits/interface src/tests/kits/interface In-Reply-To: <200908031447.n73Elscv005496@sheep.berlios.de> References: <200908031447.n73Elscv005496@sheep.berlios.de> Message-ID: 2009/8/3 : > Author: axeld > Date: 2009-08-03 16:47:41 +0200 (Mon, 03 Aug 2009) > New Revision: 32078 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32078&view=rev > > Added: > ? haiku/trunk/headers/private/interface/ToolTip.h > ? haiku/trunk/headers/private/interface/ToolTipManager.h > ? haiku/trunk/headers/private/interface/ToolTipWindow.h > ? haiku/trunk/src/kits/interface/ToolTip.cpp > ? haiku/trunk/src/kits/interface/ToolTipManager.cpp > ? haiku/trunk/src/tests/kits/interface/ToolTipTest.cpp > Modified: > ? haiku/trunk/headers/os/app/AppDefs.h > ? haiku/trunk/headers/os/interface/InterfaceDefs.h > ? haiku/trunk/headers/os/interface/View.h > ? haiku/trunk/headers/os/interface/Window.h > ? haiku/trunk/headers/private/binary_compatibility/Global.h > ? haiku/trunk/headers/private/binary_compatibility/Interface.h > ? haiku/trunk/src/kits/interface/Jamfile > ? haiku/trunk/src/kits/interface/View.cpp > ? haiku/trunk/src/kits/interface/Window.cpp > ? haiku/trunk/src/tests/kits/interface/Jamfile > Log: > * Added a basic tool tip API, and implementation. > * The BView API can probably be regarded as good enough; the implementation > ?might need to be improved over time (also, some things as archivability > ?aren't fully implemented yet). The ToolTip.h header should get public once > ?finalized. > * Added new B_MOUSE_IDLE message that is sent to a BView after a certain > ?time has passed (BToolTipManager::ShowDelay()). > * Added small test app (ToolTipTest) that shows what is already working. > Fix for the renamed constants: Index: src/preferences/appearance/ColorSet.cpp =================================================================== --- src/preferences/appearance/ColorSet.cpp (Revision 32078) +++ src/preferences/appearance/ColorSet.cpp (Arbeitskopie) @@ -37,8 +37,8 @@ { B_MENU_ITEM_TEXT_COLOR, "Menu Item Text" }, { B_MENU_SELECTED_ITEM_TEXT_COLOR, "Selected Menu Item Text" }, { B_MENU_SELECTED_BORDER_COLOR, "Selected Menu Item Border" }, - { B_TOOLTIP_BACKGROUND_COLOR, "Tooltip Background" }, - { B_TOOLTIP_TEXT_COLOR, "Tooltip Text" }, + { B_TOOL_TIP_BACKGROUND_COLOR, "Tooltip Background" }, + { B_TOOL_TIP_TEXT_COLOR, "Tooltip Text" }, { B_SUCCESS_COLOR, "Success" }, { B_FAILURE_COLOR, "Failure" }, { B_WINDOW_TAB_COLOR, "Window Tab" }, @@ -117,8 +117,8 @@ set.fColors[B_MENU_ITEM_TEXT_COLOR] = make_color(0, 0, 0); set.fColors[B_MENU_SELECTED_ITEM_TEXT_COLOR] = make_color(255, 255, 255); set.fColors[B_MENU_SELECTED_BORDER_COLOR] = make_color(0, 0, 0); - set.fColors[B_TOOLTIP_BACKGROUND_COLOR] = make_color(255, 255, 0); - set.fColors[B_TOOLTIP_TEXT_COLOR] = make_color(0, 0, 0); + set.fColors[B_TOOL_TIP_BACKGROUND_COLOR] = make_color(255, 255, 0); + set.fColors[B_TOOL_TIP_TEXT_COLOR] = make_color(0, 0, 0); set.fColors[B_SUCCESS_COLOR] = make_color(0, 255, 0); set.fColors[B_FAILURE_COLOR] = make_color(255, 0, 0); set.fColors[B_WINDOW_TAB_COLOR] = make_color(255, 203, 0); Regards, Michael From axeld at pinc-software.de Mon Aug 3 17:01:09 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Mon, 03 Aug 2009 17:01:09 +0200 CEST Subject: [Haiku-commits] =?utf-8?q?r32059_-_haiku/trunk/src/system/boot/pl?= =?utf-8?q?atform/bios=5Fia32?= In-Reply-To: <36ed0c950908030612m6b463b94va88232885ca2bfa7@mail.gmail.com> Message-ID: <28906793063-BeMail@zon> PulkoMandy wrote: > 2009/8/2 Axel D?rfler : > > mmu_man at BerliOS wrote: > >> Log: > >> Add MultiBoot support. > > I can't imagine a single reason why we would want this in our boot > > loader. > > Is there any benefit from using it? > mainly stnadardization, grub compatibility A standard that is not relevant at all, though. And we are compatible to every x86 boot loader out there, as we allow chainloading. > and simpler porting to > other platforms (ARM board use jtag and can make use of it IIRC). > Also No reason to clobber any other platforms, then. > it allows dorect loading of the kernel in qemu for debugging. Nope, only the boot loader, because that's where the multi-boot support is. I really think it should be removed again; our loader is too large anyway, no need to put more useless stuff in it. Bye, Axel. From pulkomandy at mail.berlios.de Mon Aug 3 17:02:56 2009 From: pulkomandy at mail.berlios.de (pulkomandy at BerliOS) Date: Mon, 3 Aug 2009 17:02:56 +0200 Subject: [Haiku-commits] r32080 - in haiku/branches/components/gsoc-locale-kit: build/jam src/kits/locale src/preferences/locale Message-ID: <200908031502.n73F2urD008731@sheep.berlios.de> Author: pulkomandy Date: 2009-08-03 17:02:55 +0200 (Mon, 03 Aug 2009) New Revision: 32080 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32080&view=rev Added: haiku/branches/components/gsoc-locale-kit/src/preferences/locale/fr.catkeys Removed: haiku/branches/components/gsoc-locale-kit/src/preferences/locale/french.catkeys Modified: haiku/branches/components/gsoc-locale-kit/build/jam/BeOSRules haiku/branches/components/gsoc-locale-kit/src/kits/locale/LocaleRoster.cpp haiku/branches/components/gsoc-locale-kit/src/preferences/locale/Locale.cpp haiku/branches/components/gsoc-locale-kit/src/preferences/locale/LocaleWindow.cpp haiku/branches/components/gsoc-locale-kit/src/preferences/locale/LocaleWindow.h Log: -Language preferences are now saved and loaded properly. So you can now select your favorite language and actually use the locale kit with something else than french :) -Some style fixes for the code I borrowed in Icon-O-Matic, and to some of my code, and other cleanups -Updated the french catkeys to include the new strings from the preflet Now working on the "Country" tab... Modified: haiku/branches/components/gsoc-locale-kit/build/jam/BeOSRules =================================================================== --- haiku/branches/components/gsoc-locale-kit/build/jam/BeOSRules 2009-08-03 14:54:22 UTC (rev 32079) +++ haiku/branches/components/gsoc-locale-kit/build/jam/BeOSRules 2009-08-03 15:02:55 UTC (rev 32080) @@ -370,7 +370,7 @@ ExtractCatalogEntries $(genCat:S=.catkeys) : $(sources) : $(signature) ; LinkApplicationCatalog $(genCat) : $(genCat:S=.catkeys) - : $(signature) : english ; + : $(signature) : $(genCat:B) ; for catalog in $(translatedCatalogs) { Modified: haiku/branches/components/gsoc-locale-kit/src/kits/locale/LocaleRoster.cpp =================================================================== --- haiku/branches/components/gsoc-locale-kit/src/kits/locale/LocaleRoster.cpp 2009-08-03 14:54:22 UTC (rev 32079) +++ haiku/branches/components/gsoc-locale-kit/src/kits/locale/LocaleRoster.cpp 2009-08-03 15:02:55 UTC (rev 32080) @@ -185,7 +185,6 @@ if (file.SetTo(path.Path(), B_READ_ONLY) == B_OK && settingsMessage.Unflatten(&file) == B_OK) { if (settingsMessage.FindString("language", &langName) == B_OK) { - fPreferredLanguages.ReplaceString("language", langName); UErrorCode icuError = U_ZERO_ERROR; Locale icuLocale = Locale::createCanonical(langName.String()); assert(!icuLocale.isBogus()); @@ -194,12 +193,11 @@ BStringByteSink bbs(&bstr); icuLocale.getDisplayName(ustr); ustr.toUTF8(bbs); - log_team(LOG_ERR,"*** READABLE: %s\n",bstr.String()); Locale::setDefault(icuLocale,icuError); assert(icuError == U_ZERO_ERROR); - int i; - for (i=1; settingsMessage.FindString("language", i, &langName) + fPreferredLanguages.RemoveName("language"); + for (int i=0; settingsMessage.FindString("language", i, &langName) == B_OK; i++) { fPreferredLanguages.AddString("language", langName); } Modified: haiku/branches/components/gsoc-locale-kit/src/preferences/locale/Locale.cpp =================================================================== --- haiku/branches/components/gsoc-locale-kit/src/preferences/locale/Locale.cpp 2009-08-03 14:54:22 UTC (rev 32079) +++ haiku/branches/components/gsoc-locale-kit/src/preferences/locale/Locale.cpp 2009-08-03 15:02:55 UTC (rev 32080) @@ -121,8 +121,9 @@ // We make sure there is at least one string before erasing the previous // settings, then we add the remaining ones, if any if (message->FindString("language",&langName) == B_OK) { - fMessage.ReplaceString("language", langName); - for (int i=1; message->FindString("language", i, &langName) == B_OK; i++) + // Remove any old data as we know we have newer one to replace it + fMessage.RemoveName("language"); + for (int i=0; message->FindString("language", i, &langName) == B_OK; i++) fMessage.AddString("language", langName); } Modified: haiku/branches/components/gsoc-locale-kit/src/preferences/locale/LocaleWindow.cpp =================================================================== --- haiku/branches/components/gsoc-locale-kit/src/preferences/locale/LocaleWindow.cpp 2009-08-03 14:54:22 UTC (rev 32079) +++ haiku/branches/components/gsoc-locale-kit/src/preferences/locale/LocaleWindow.cpp 2009-08-03 15:02:55 UTC (rev 32080) @@ -105,7 +105,8 @@ // gather all the items from the BMessage BList items; int32 index; - for (int32 i = 0; message->FindInt32("index", i, &index) == B_OK; i++) + for (int32 i = 0; message->FindInt32("index", i, &index) + == B_OK; i++) if (BListItem* item = ItemAt(index)) items.AddItem((void*)item); @@ -121,7 +122,8 @@ // gather all the items from the BMessage int32 index; - for (int32 i = 0; message->FindInt32("index", i, &index) == B_OK; i++) + for (int32 i = 0; message->FindInt32("index", i, &index) + == B_OK; i++) if (BListItem* item = list->RemoveItem(index)) { AddItem(item,fDropIndex); fDropIndex++; @@ -141,9 +143,9 @@ LanguageListView::MoveItems(BList& items, int32 index) { DeselectAll(); - // we remove the items while we look at them, the insertion index is decreased - // when the items index is lower, so that we insert at the right spot after - // removal + // we remove the items while we look at them, the insertion index is + // decreaded when the items index is lower, so that we insert at the right + // spot after removal BList removedItems; int32 count = items.CountItems(); for (int32 i = 0; i < count; i++) { @@ -191,7 +193,8 @@ // figure out, how many items fit into our bitmap int32 numItems; bool fade = false; - for (numItems = 0; BListItem* item = ItemAt(CurrentSelection(numItems)); numItems++) { + for (numItems = 0; BListItem* item = ItemAt(CurrentSelection(numItems)); + numItems++) { dragRect.bottom += ceilf(item->Height()) + 1.0; if (dragRect.Height() > MAX_DRAG_HEIGHT) { fade = true; @@ -211,7 +214,8 @@ // let all selected items, that fit into our drag_bitmap, draw for (int32 i = 0; i < numItems; i++) { int32 index = CurrentSelection(i); - LanguageListItem* item = static_cast(ItemAt(index)); + LanguageListItem* item = + static_cast(ItemAt(index)); itemBounds.bottom = itemBounds.top + ceilf(item->Height()); if (itemBounds.bottom > dragRect.bottom) itemBounds.bottom = dragRect.bottom; @@ -229,20 +233,25 @@ int32 bpr = dragBitmap->BytesPerRow(); if (fade) { - for (int32 y = 0; y < height - ALPHA / 2; y++, bits += bpr) { + for (int32 y = 0; y < height - ALPHA / 2; + y++, bits += bpr) { uint8 *line = bits + 3; - for (uint8 *end = line + 4 * width; line < end; line += 4) + for (uint8 *end = line + 4 * width; line < end; + line += 4) *line = ALPHA; } - for (int32 y = height - ALPHA / 2; y < height; y++, bits += bpr) { + for (int32 y = height - ALPHA / 2; y < height; + y++, bits += bpr) { uint8 *line = bits + 3; - for (uint8 *end = line + 4 * width; line < end; line += 4) + for (uint8 *end = line + 4 * width; line < end; + line += 4) *line = (height - y) << 1; } } else { for (int32 y = 0; y < height; y++, bits += bpr) { uint8 *line = bits + 3; - for (uint8 *end = line + 4 * width; line < end; line += 4) + for (uint8 *end = line + 4 * width; line < end; + line += 4) *line = ALPHA; } } @@ -290,7 +299,9 @@ r.bottom = r.top + 1.0; } else { r = Bounds(); - r.bottom--; // compensate for scrollbars moved slightly out of window + r.bottom--; + // compensate for scrollbars moved slightly + // out of window } } else { BRect r = ItemFrame(fDropIndex); @@ -340,7 +351,6 @@ // first list: available languages LanguageListView *listView = new LanguageListView("available", B_MULTIPLE_SELECTION_LIST); - listView->SetSelectionMessage(new BMessage(kMsgSelectLanguage)); BScrollView *scrollView = new BScrollView("scroller", listView, 0, false, true, B_FANCY_BORDER); @@ -355,7 +365,8 @@ // Now get an human-readable, loacalized name for each language // TODO: sort them using collators. - Locale currentLocale = Locale::createFromName(currentLanguage.String()); + Locale currentLocale = + Locale::createFromName(currentLanguage.String()); UnicodeString languageFullName; BString str; BStringByteSink bbs(&str); @@ -375,40 +386,36 @@ myAlert->Go(); } - // buttons: Add, Remove, Move up, Move down, (clear) - // Actually I think it's simpler to use drag'n'drop - /* - BButton* addButton = new BButton("Add >"); - BButton* removeButton = new BButton("Remove <"); - BButton* upButton = new BButton("Move up ^"); - BButton* downButton = new BButton("Move down v"); - */ - // Second list: active languages - listView = new LanguageListView("preferred", + fPreferredListView = new LanguageListView("preferred", B_MULTIPLE_SELECTION_LIST); - listView->SetSelectionMessage(new BMessage(kMsgSelectLanguage)); - BScrollView *scrollViewEnabled = new BScrollView("scroller", listView, - 0, false, true, B_FANCY_BORDER); + BScrollView *scrollViewEnabled = new BScrollView("scroller", + fPreferredListView, 0, false, true, B_FANCY_BORDER); + // get the preferred languages from the Settings. Move them here from + // the other list. + BMessage msg; + be_locale_roster->GetPreferredLanguages(&msg); + BString langCode; + for(int index = 0; msg.FindString("language", index, &langCode) == B_OK; + index++) { + for(int listPos = 0; LanguageListItem* lli = + static_cast(listView->ItemAt(listPos)); + listPos++) { + if(langCode == lli->getLanguageCode()) { + fPreferredListView->AddItem(lli); + listView->RemoveItem(lli); + } + } + } + tab->AddChild(BGroupLayoutBuilder(B_HORIZONTAL, 10) .Add(BGroupLayoutBuilder(B_VERTICAL,10) - .Add(new BStringView("", "Available languages")) + .Add(new BStringView("", TR("Available languages"))) .Add(scrollView) ) - /* .Add(BGroupLayoutBuilder(B_VERTICAL,10) - .AddGlue() - .Add(addButton) - .Add(removeButton) - .AddGlue() - .Add(upButton) - .Add(downButton) - .AddGlue() - ) - */ - .Add(BGroupLayoutBuilder(B_VERTICAL,10) - .Add(new BStringView("", "Preferred languages")) + .Add(new BStringView("", TR("Preferred languages"))) .Add(scrollViewEnabled) ) ); @@ -469,6 +476,12 @@ { BMessage update(kMsgSettingsChanged); update.AddRect("window_frame", Frame()); + int index = 0; + while (index < fPreferredListView->CountItems()) { + update.AddString("language",static_cast + (fPreferredListView->ItemAt(index))->getLanguageCode()); + index++; + } be_app_messenger.SendMessage(&update); be_app_messenger.SendMessage(B_QUIT_REQUESTED); Modified: haiku/branches/components/gsoc-locale-kit/src/preferences/locale/LocaleWindow.h =================================================================== --- haiku/branches/components/gsoc-locale-kit/src/preferences/locale/LocaleWindow.h 2009-08-03 14:54:22 UTC (rev 32079) +++ haiku/branches/components/gsoc-locale-kit/src/preferences/locale/LocaleWindow.h 2009-08-03 15:02:55 UTC (rev 32080) @@ -9,6 +9,7 @@ #include class BButton; +class BListView; class LocaleWindow : public BWindow { @@ -20,6 +21,7 @@ private: BButton* fRevertButton; + BListView* fPreferredListView; }; #endif /* LOCALE_WINDOW_H */ Copied: haiku/branches/components/gsoc-locale-kit/src/preferences/locale/fr.catkeys (from rev 32056, haiku/branches/components/gsoc-locale-kit/src/preferences/locale/french.catkeys) =================================================================== --- haiku/branches/components/gsoc-locale-kit/src/preferences/locale/french.catkeys 2009-08-01 08:14:18 UTC (rev 32056) +++ haiku/branches/components/gsoc-locale-kit/src/preferences/locale/fr.catkeys 2009-08-03 15:02:55 UTC (rev 32080) @@ -0,0 +1,11 @@ +1 fr x-vnd.Haiku-Locale 2841580836 +Locale\n\twritten by Axel D?rfler\n\tCopyright 2005, Haiku.\n\n Locale Preflet Locale\n\t?crit par Axel D?rfler\n\tCopyright 2009, Haiku.\n\n +Keyboard Locale Preflet Window Clavier +Defaults Locale Preflet Window D?fauts +Revert Locale Preflet Window D?faire +Country Locale Preflet Window Pays +Language Locale Preflet Window Langage +Unable to find the available languages!You can't use this preflet! Locale Preflet Window La liste des langages disponibles est introuvable, ce preflet est donc inutilisable ! +Ok Locale Preflet Window Ok +Available languages Locale Preflet Window Langues disponibles +Preferred languages Locale Preflet Window Langues pr?f?r?es Deleted: haiku/branches/components/gsoc-locale-kit/src/preferences/locale/french.catkeys From axeld at pinc-software.de Mon Aug 3 17:04:11 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Mon, 03 Aug 2009 17:04:11 +0200 CEST Subject: [Haiku-commits] =?utf-8?q?r32076_-_in_haiku/trunk=3A_headers/priv?= =?utf-8?q?ate/kernel/boot_src/system/boot/loader_src/system/boot/platform?= =?utf-8?q?/atari=5Fm68k_src/system/boot/platform/bios=5Fia32_src/system/b?= =?utf-8?q?oot/platform/openfirmware?= In-Reply-To: <200908031439.n73Edl9Z004092@sheep.berlios.de> Message-ID: <29088419254-BeMail@zon> mmu_man at mail.berlios.de wrote: > This should answer Axel's question :) Yes, but it doesn't change my opinion about that code :-) All settings should be changeable through the kernel settings file, anyway, so if you need sticky options, there is always an interface to be used. Bye, Axel. From revol at free.fr Mon Aug 3 17:07:54 2009 From: revol at free.fr (=?utf-8?q?Fran=C3=A7ois?= Revol) Date: Mon, 03 Aug 2009 17:07:54 +0200 CEST Subject: [Haiku-commits] r32059 - haiku/trunk/src/system/boot/platform/bios_ia32 In-Reply-To: <28906793063-BeMail@zon> Message-ID: <3633690168-BeMail@laptop> > > > I can't imagine a single reason why we would want this in our > > > boot > > > loader. > > > Is there any benefit from using it? In case you didn't see yet, the idea is to use it to pass args to an image from qemu, allowing to set stuff from outside, and for ex. automate tests or demos. Fran?ois. From revol at free.fr Mon Aug 3 17:08:40 2009 From: revol at free.fr (=?utf-8?q?Fran=C3=A7ois?= Revol) Date: Mon, 03 Aug 2009 17:08:40 +0200 CEST Subject: [Haiku-commits] r32076 - in haiku/trunk: headers/private/kernel/boot src/system/boot/loader src/system/boot/platform/atari_m68k src/system/boot/platform/bios_ia32 src/system/boot/platform/openfirmware In-Reply-To: <29088419254-BeMail@zon> Message-ID: <3679162470-BeMail@laptop> > mmu_man at mail.berlios.de wrote: > > This should answer Axel's question :) > > Yes, but it doesn't change my opinion about that code :-) > All settings should be changeable through the kernel settings file, > anyway, so if you need sticky options, there is always an interface > to > be used. This means you must change the image each time... Fran?ois. From mmu_man at mail.berlios.de Mon Aug 3 17:12:25 2009 From: mmu_man at mail.berlios.de (mmu_man at mail.berlios.de) Date: Mon, 3 Aug 2009 17:12:25 +0200 Subject: [Haiku-commits] r32081 - haiku/trunk/src/system/boot/platform/openfirmware Message-ID: <200908031512.n73FCPC1010165@sheep.berlios.de> Author: mmu_man Date: 2009-08-03 17:12:24 +0200 (Mon, 03 Aug 2009) New Revision: 32081 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32081&view=rev Modified: haiku/trunk/src/system/boot/platform/openfirmware/start.c Log: Implemented getting bootargs from OF. Untested. Modified: haiku/trunk/src/system/boot/platform/openfirmware/start.c =================================================================== --- haiku/trunk/src/system/boot/platform/openfirmware/start.c 2009-08-03 15:02:55 UTC (rev 32080) +++ haiku/trunk/src/system/boot/platform/openfirmware/start.c 2009-08-03 15:12:24 UTC (rev 32081) @@ -132,6 +132,8 @@ void start(void *openFirmwareEntry) { + char bootargs[512]; + // stage2 args - might be set via the command line one day stage2_args args; args.heap_size = HEAP_SIZE; @@ -139,6 +141,13 @@ of_init(openFirmwareEntry); + // check for arguments + if (of_getprop(gChosen, "bootargs", bootargs, sizeof(bootargs)) != OF_FAILED) { + static const char *sArgs[] = { NULL, NULL }; + sArgs[0] = (const char *)bootargs; + args.arguments = sArgs; + } + determine_machine(); console_init(); From axeld at mail.berlios.de Mon Aug 3 17:21:25 2009 From: axeld at mail.berlios.de (axeld at mail.berlios.de) Date: Mon, 3 Aug 2009 17:21:25 +0200 Subject: [Haiku-commits] r32082 - haiku/trunk/src/preferences/screen Message-ID: <200908031521.n73FLPkj011420@sheep.berlios.de> Author: axeld Date: 2009-08-03 17:21:24 +0200 (Mon, 03 Aug 2009) New Revision: 32082 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32082&view=rev Modified: haiku/trunk/src/preferences/screen/ScreenWindow.cpp Log: * Added a tool tip for the monitor's capabilities. Modified: haiku/trunk/src/preferences/screen/ScreenWindow.cpp =================================================================== --- haiku/trunk/src/preferences/screen/ScreenWindow.cpp 2009-08-03 15:12:24 UTC (rev 32081) +++ haiku/trunk/src/preferences/screen/ScreenWindow.cpp 2009-08-03 15:21:24 UTC (rev 32082) @@ -1111,6 +1111,17 @@ if (fMonitorInfo->IsHidden()) fMonitorInfo->Show(); + + if (info.min_horizontal_frequency != 0 + && info.min_vertical_frequency != 0 + && info.max_pixel_clock != 0) { + snprintf(text, sizeof(text), "Horizonal Frequency:\t%lu - %lu kHz\n" + "VerticalFrequency:\t%lu - %lu Hz\n\n" + "Maximum Pixel Clock:\t%g MHz", info.min_horizontal_frequency, + info.max_horizontal_frequency, info.min_vertical_frequency, + info.max_vertical_frequency, info.max_pixel_clock / 1000.0); + fMonitorView->SetToolTip(text); + } } From dev at m-phasis.de Mon Aug 3 17:24:58 2009 From: dev at m-phasis.de (Michael Weirauch) Date: Mon, 3 Aug 2009 17:24:58 +0200 Subject: [Haiku-commits] r32078 - in haiku/trunk: headers/os/app headers/os/interface headers/private/binary_compatibility headers/private/interface src/kits/interface src/tests/kits/interface In-Reply-To: References: <200908031447.n73Elscv005496@sheep.berlios.de> Message-ID: Hi again, starting BezillaBrowser or gvim on 32078 (VirtualBox) or 32080 (native) gives missing symbol error: _ZN5BView15_ReservedView11Ev. Seems related to this change. Anybody can confirm? Greetings, Michael From mmu_man at mail.berlios.de Mon Aug 3 18:03:04 2009 From: mmu_man at mail.berlios.de (mmu_man at mail.berlios.de) Date: Mon, 3 Aug 2009 18:03:04 +0200 Subject: [Haiku-commits] r32083 - haiku/trunk/src/kits/interface Message-ID: <200908031603.n73G34HQ019493@sheep.berlios.de> Author: mmu_man Date: 2009-08-03 18:03:03 +0200 (Mon, 03 Aug 2009) New Revision: 32083 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32083&view=rev Modified: haiku/trunk/src/kits/interface/ControlLook.cpp Log: Fix a warning. Modified: haiku/trunk/src/kits/interface/ControlLook.cpp =================================================================== --- haiku/trunk/src/kits/interface/ControlLook.cpp 2009-08-03 15:21:24 UTC (rev 32082) +++ haiku/trunk/src/kits/interface/ControlLook.cpp 2009-08-03 16:03:03 UTC (rev 32083) @@ -1534,6 +1534,7 @@ col2 = background; break; case 3: + default: col1 = background; col2 = light; num = 0; From axeld at mail.berlios.de Mon Aug 3 18:08:37 2009 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Mon, 3 Aug 2009 18:08:37 +0200 Subject: [Haiku-commits] r32084 - haiku/trunk/src/preferences/appearance Message-ID: <200908031608.n73G8bu2020844@sheep.berlios.de> Author: axeld Date: 2009-08-03 18:08:36 +0200 (Mon, 03 Aug 2009) New Revision: 32084 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32084&view=rev Modified: haiku/trunk/src/preferences/appearance/ColorSet.cpp Log: * Build fix. Modified: haiku/trunk/src/preferences/appearance/ColorSet.cpp =================================================================== --- haiku/trunk/src/preferences/appearance/ColorSet.cpp 2009-08-03 16:03:03 UTC (rev 32083) +++ haiku/trunk/src/preferences/appearance/ColorSet.cpp 2009-08-03 16:08:36 UTC (rev 32084) @@ -1,5 +1,5 @@ /* - * Copyright 2001-2008, Haiku. + * Copyright 2001-2009, Haiku. * Distributed under the terms of the MIT License. * * Authors: @@ -18,7 +18,7 @@ #include "ColorSet.h" -static ColorDescription sColorDescriptionTable[] = +static ColorDescription sColorDescriptionTable[] = { { B_PANEL_BACKGROUND_COLOR, "Panel Background" }, { B_PANEL_TEXT_COLOR, "Panel Text" }, @@ -37,8 +37,8 @@ { B_MENU_ITEM_TEXT_COLOR, "Menu Item Text" }, { B_MENU_SELECTED_ITEM_TEXT_COLOR, "Selected Menu Item Text" }, { B_MENU_SELECTED_BORDER_COLOR, "Selected Menu Item Border" }, - { B_TOOLTIP_BACKGROUND_COLOR, "Tooltip Background" }, - { B_TOOLTIP_TEXT_COLOR, "Tooltip Text" }, + { B_TOOL_TIP_BACKGROUND_COLOR, "Tooltip Background" }, + { B_TOOL_TIP_TEXT_COLOR, "Tooltip Text" }, { B_SUCCESS_COLOR, "Success" }, { B_FAILURE_COLOR, "Failure" }, { B_WINDOW_TAB_COLOR, "Window Tab" }, @@ -49,7 +49,7 @@ const int32 sColorDescriptionCount = sizeof(sColorDescriptionTable) / sizeof(ColorDescription); -const ColorDescription* +const ColorDescription* get_color_description(int32 index) { if (index < 0 || index >= sColorDescriptionCount) @@ -117,8 +117,8 @@ set.fColors[B_MENU_ITEM_TEXT_COLOR] = make_color(0, 0, 0); set.fColors[B_MENU_SELECTED_ITEM_TEXT_COLOR] = make_color(255, 255, 255); set.fColors[B_MENU_SELECTED_BORDER_COLOR] = make_color(0, 0, 0); - set.fColors[B_TOOLTIP_BACKGROUND_COLOR] = make_color(255, 255, 0); - set.fColors[B_TOOLTIP_TEXT_COLOR] = make_color(0, 0, 0); + set.fColors[B_TOOL_TIP_BACKGROUND_COLOR] = make_color(255, 255, 0); + set.fColors[B_TOOL_TIP_TEXT_COLOR] = make_color(0, 0, 0); set.fColors[B_SUCCESS_COLOR] = make_color(0, 255, 0); set.fColors[B_FAILURE_COLOR] = make_color(255, 0, 0); set.fColors[B_WINDOW_TAB_COLOR] = make_color(255, 203, 0); @@ -129,7 +129,7 @@ return set; } - + /*! \brief Assigns a value to a named color member \param string name of the color to receive the value From revol at free.fr Mon Aug 3 18:11:06 2009 From: revol at free.fr (=?utf-8?q?Fran=C3=A7ois?= Revol) Date: Mon, 03 Aug 2009 18:11:06 +0200 CEST Subject: [Haiku-commits] =?utf-8?q?r32078_-_in_haiku/trunk=3A_headers/os/a?= =?utf-8?q?pp_headers/os/interface_headers/private/binary=5Fcompatibility_?= =?utf-8?q?headers/private/interface_src/kits/interface_src/tests/kits/int?= =?utf-8?q?erface?= In-Reply-To: Message-ID: <202505291-BeMail@laptop> > > Log: > > * Added a basic tool tip API, and implementation. > > * The BView API can probably be regarded as good enough; the > > implementation > > ?might need to be improved over time (also, some things as > > archivability > > ?aren't fully implemented yet). The ToolTip.h header should get > > public once > > ?finalized. > > * Added new B_MOUSE_IDLE message that is sent to a BView after a > > certain > > ?time has passed (BToolTipManager::ShowDelay()). > > * Added small test app (ToolTipTest) that shows what is already > > working. > > > > Fix for the renamed constants: > > Index: src/preferences/appearance/ColorSet.cpp > =================================================================== > --- src/preferences/appearance/ColorSet.cpp (Revision 32078) > +++ src/preferences/appearance/ColorSet.cpp (Arbeitskopie) > @@ -37,8 +37,8 @@ > { B_MENU_ITEM_TEXT_COLOR, "Menu Item Text" }, > { B_MENU_SELECTED_ITEM_TEXT_COLOR, "Selected Menu Item Text" }, > { B_MENU_SELECTED_BORDER_COLOR, "Selected Menu Item Border" }, > - { B_TOOLTIP_BACKGROUND_COLOR, "Tooltip Background" }, > - { B_TOOLTIP_TEXT_COLOR, "Tooltip Text" }, > + { B_TOOL_TIP_BACKGROUND_COLOR, "Tooltip Background" }, > + { B_TOOL_TIP_TEXT_COLOR, "Tooltip Text" }, > { B_SUCCESS_COLOR, "Success" }, > { B_FAILURE_COLOR, "Failure" }, > { B_WINDOW_TAB_COLOR, "Window Tab" }, > @@ -117,8 +117,8 @@ > set.fColors[B_MENU_ITEM_TEXT_COLOR] = make_color(0, 0, 0); > set.fColors[B_MENU_SELECTED_ITEM_TEXT_COLOR] = make_color(255, 255, > 255); > set.fColors[B_MENU_SELECTED_BORDER_COLOR] = make_color(0, 0, 0); > - set.fColors[B_TOOLTIP_BACKGROUND_COLOR] = make_color(255, 255, 0); > - set.fColors[B_TOOLTIP_TEXT_COLOR] = make_color(0, 0, 0); > + set.fColors[B_TOOL_TIP_BACKGROUND_COLOR] = make_color(255, 255, 0); > + set.fColors[B_TOOL_TIP_TEXT_COLOR] = make_color(0, 0, 0); > set.fColors[B_SUCCESS_COLOR] = make_color(0, 255, 0); > set.fColors[B_FAILURE_COLOR] = make_color(255, 0, 0); > set.fColors[B_WINDOW_TAB_COLOR] = make_color(255, 203, 0); > Why rename them anyway ? This breaks Themes also. Fran?ois. From axeld at pinc-software.de Mon Aug 3 18:12:19 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Mon, 03 Aug 2009 18:12:19 +0200 CEST Subject: [Haiku-commits] =?utf-8?q?r32078_-_in_haiku/trunk=3A_headers/os/a?= =?utf-8?q?pp_headers/os/interface_headers/private/binary=5Fcompatibility_?= =?utf-8?q?headers/private/interface_src/kits/interface_src/tests/kits/int?= =?utf-8?q?erface?= In-Reply-To: Message-ID: <33176923349-BeMail@zon> Michael Weirauch wrote: > Fix for the renamed constants: Thanks, I missed those! Bye, Axel. From axeld at pinc-software.de Mon Aug 3 18:15:11 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Mon, 03 Aug 2009 18:15:11 +0200 CEST Subject: [Haiku-commits] r32076 - in haiku/trunk: headers/private/kernel/boot src/system/boot/loader src/system/boot/platform/atari_m68k src/system/boot/platform/bios_ia32 src/system/boot/platform/openfirmware In-Reply-To: <3679162470-BeMail@laptop> Message-ID: <33348910514-BeMail@zon> "Fran?ois Revol" wrote: > > mmu_man at mail.berlios.de wrote: > > > This should answer Axel's question :) > > Yes, but it doesn't change my opinion about that code :-) > > All settings should be changeable through the kernel settings file, > > anyway, so if you need sticky options, there is always an interface > > to be used. > This means you must change the image each time... So what? kernel settings are nothing you will have to change often or at all. Bye, Axel. From mmu_man at mail.berlios.de Mon Aug 3 18:16:49 2009 From: mmu_man at mail.berlios.de (mmu_man at mail.berlios.de) Date: Mon, 3 Aug 2009 18:16:49 +0200 Subject: [Haiku-commits] r32085 - haiku/trunk/3rdparty/mmu_man/themes Message-ID: <200908031616.n73GGnNk023351@sheep.berlios.de> Author: mmu_man Date: 2009-08-03 18:16:45 +0200 (Mon, 03 Aug 2009) New Revision: 32085 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32085&view=rev Modified: haiku/trunk/3rdparty/mmu_man/themes/UITheme.h Log: Fix Haiku build. WTF rename those anyway ??? Modified: haiku/trunk/3rdparty/mmu_man/themes/UITheme.h =================================================================== --- haiku/trunk/3rdparty/mmu_man/themes/UITheme.h 2009-08-03 16:08:36 UTC (rev 32084) +++ haiku/trunk/3rdparty/mmu_man/themes/UITheme.h 2009-08-03 16:16:45 UTC (rev 32085) @@ -112,5 +112,9 @@ #endif #endif +#ifdef __HAIKU__ +#define B_TOOLTIP_BACKGROUND_COLOR B_TOOL_TIP_BACKGROUND_COLOR +#define B_TOOLTIP_TEXT_COLOR B_TOOL_TIP_TEXT_COLOR +#endif #endif /* _Z_UI_THEME_H */ From revol at free.fr Mon Aug 3 18:20:08 2009 From: revol at free.fr (=?utf-8?q?Fran=C3=A7ois?= Revol) Date: Mon, 03 Aug 2009 18:20:08 +0200 CEST Subject: [Haiku-commits] r32076 - in haiku/trunk: headers/private/kernel/boot src/system/boot/loader src/system/boot/platform/atari_m68k src/system/boot/platform/bios_ia32 src/system/boot/platform/openfirmware In-Reply-To: <33348910514-BeMail@zon> Message-ID: <744391145-BeMail@laptop> > "Fran?ois Revol" wrote: > > > mmu_man at mail.berlios.de wrote: > > > > This should answer Axel's question :) > > > Yes, but it doesn't change my opinion about that code :-) > > > All settings should be changeable through the kernel settings > > > file, > > > anyway, so if you need sticky options, there is always an > > > interface > > > to be used. > > This means you must change the image each time... > > So what? > kernel settings are nothing you will have to change often or at all. It's not so much about kernel settings. More about passing args to the vm at boot time without requiring a change on the image. Fran?ois. From axeld at pinc-software.de Mon Aug 3 18:22:22 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Mon, 03 Aug 2009 18:22:22 +0200 CEST Subject: [Haiku-commits] =?utf-8?q?r32078_-_in_haiku/trunk=3A_headers/os/a?= =?utf-8?q?pp_headers/os/interface_headers/private/binary=5Fcompatibility_?= =?utf-8?q?headers/private/interface_src/kits/interface_src/tests/kits/int?= =?utf-8?q?erface?= In-Reply-To: Message-ID: <33779194933-BeMail@zon> Michael Weirauch wrote: > starting BezillaBrowser or gvim on 32078 (VirtualBox) or 32080 > (native) gives missing symbol error: > _ZN5BView15_ReservedView11Ev. > > Seems related to this change. Anybody can confirm? It is related indeed - GCC4 software using BViews need to be recompiled, only the GCC2 compatibility is retained. Bye, Axel. From mmu_man at mail.berlios.de Mon Aug 3 18:25:43 2009 From: mmu_man at mail.berlios.de (mmu_man at mail.berlios.de) Date: Mon, 3 Aug 2009 18:25:43 +0200 Subject: [Haiku-commits] r32086 - haiku/trunk/src/bin Message-ID: <200908031625.n73GPhWG025662@sheep.berlios.de> Author: mmu_man Date: 2009-08-03 18:25:41 +0200 (Mon, 03 Aug 2009) New Revision: 32086 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32086&view=rev Modified: haiku/trunk/src/bin/safemode.c Log: Allow getting other safe mode settings than the default one, from command line. Added a -s option to get the string value of the setting directly instead of interpreting it as bool. Modified: haiku/trunk/src/bin/safemode.c =================================================================== --- haiku/trunk/src/bin/safemode.c 2009-08-03 16:16:45 UTC (rev 32085) +++ haiku/trunk/src/bin/safemode.c 2009-08-03 16:25:41 UTC (rev 32086) @@ -14,11 +14,25 @@ int main(int argc, char **argv) { + const char *optionName = B_SAFEMODE_SAFE_MODE; + bool realString = false; char buffer[B_FILE_NAME_LENGTH]; size_t size = sizeof(buffer); + int i; - status_t status = _kern_get_safemode_option(B_SAFEMODE_SAFE_MODE, buffer, &size); + for (i = 1; i < argc; i++) { + if (!strcmp(argv[i], "-s")) + realString = true; + else + optionName = argv[i]; + } + + status_t status = _kern_get_safemode_option(optionName, buffer, &size); if (status == B_OK) { + if (realString) { + puts(buffer); + return 0; + } if (!strncasecmp(buffer, "true", size) || !strncasecmp(buffer, "yes", size) || !strncasecmp(buffer, "on", size) From jackburton at mail.berlios.de Mon Aug 3 18:50:05 2009 From: jackburton at mail.berlios.de (jackburton at mail.berlios.de) Date: Mon, 3 Aug 2009 18:50:05 +0200 Subject: [Haiku-commits] r32087 - haiku/trunk/src/servers/app Message-ID: <200908031650.n73Go5ZQ012985@sheep.berlios.de> Author: jackburton Date: 2009-08-03 18:50:01 +0200 (Mon, 03 Aug 2009) New Revision: 32087 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32087&view=rev Modified: haiku/trunk/src/servers/app/ServerPicture.cpp haiku/trunk/src/servers/app/ServerWindow.cpp haiku/trunk/src/servers/app/ServerWindow.h Log: Now also hide/show the cursor when BDirectWindow::SetFullScreen() is called. in the handler, instead of checking if the window is an offscreen one, check if fDirectWindowData is NULL, and do nothing if it's the case. When setting a clip region in ServerPicture, also invalidate the clipping. To do so, I added a public ServerWindoow::UpdateCurrentDrawingRegion() which just calls the private function. Please review and see if it can be done better. This fixes the problem with BPicture and the ConstrainClippingRegion() op (see ticket #1389) Modified: haiku/trunk/src/servers/app/ServerPicture.cpp =================================================================== --- haiku/trunk/src/servers/app/ServerPicture.cpp 2009-08-03 16:25:41 UTC (rev 32086) +++ haiku/trunk/src/servers/app/ServerPicture.cpp 2009-08-03 16:50:01 UTC (rev 32087) @@ -477,6 +477,7 @@ for (uint32 c = 0; c < numRects; c++) region.Include(rects[c]); view->SetUserClipping(®ion); + view->Window()->ServerWindow()->UpdateCurrentDrawingRegion(); } Modified: haiku/trunk/src/servers/app/ServerWindow.cpp =================================================================== --- haiku/trunk/src/servers/app/ServerWindow.cpp 2009-08-03 16:25:41 UTC (rev 32086) +++ haiku/trunk/src/servers/app/ServerWindow.cpp 2009-08-03 16:50:01 UTC (rev 32087) @@ -1169,7 +1169,7 @@ link.Read(&enable); status_t status = B_OK; - if (!fWindow->IsOffscreenWindow()) { + if (fDirectWindowData != NULL) { //fDesktop->UnlockSingleWindow(); _DirectWindowSetFullScreen(enable); //fDesktop->LockSingleWindow(); @@ -3719,6 +3719,8 @@ ServerWindow::_DirectWindowSetFullScreen(bool enable) { if (enable) { + fDesktop->HWInterface()->SetCursorVisible(false); + fDirectWindowData->old_window_frame = fWindow->Frame(); BRect screenFrame = fDesktop->ActiveScreen()->Frame(); @@ -3737,7 +3739,9 @@ oldFrame.top - fWindow->Frame().top); fDesktop->ResizeWindowBy(fWindow, oldFrame.Width() - fWindow->Frame().Width(), - oldFrame.Height() - fWindow->Frame().Height()); + oldFrame.Height() - fWindow->Frame().Height()); + + fDesktop->HWInterface()->SetCursorVisible(true); } fDesktop->SetWindowFeel(fWindow, Modified: haiku/trunk/src/servers/app/ServerWindow.h =================================================================== --- haiku/trunk/src/servers/app/ServerWindow.h 2009-08-03 16:25:41 UTC (rev 32086) +++ haiku/trunk/src/servers/app/ServerWindow.h 2009-08-03 16:50:01 UTC (rev 32087) @@ -104,6 +104,9 @@ void ResyncDrawState(); + // TODO: Change this + inline void UpdateCurrentDrawingRegion() { _UpdateCurrentDrawingRegion(); }; + private: View* _CreateView(BPrivate::LinkReceiver &link, View **_parent); @@ -127,8 +130,9 @@ void _SetCurrentView(View* view); void _UpdateDrawState(View* view); +public: void _UpdateCurrentDrawingRegion(); - +private: bool _MessageNeedsAllWindowsLocked(uint32 code) const; void _DirectWindowSetFullScreen(bool set); From jackburton at mail.berlios.de Mon Aug 3 18:53:13 2009 From: jackburton at mail.berlios.de (jackburton at mail.berlios.de) Date: Mon, 3 Aug 2009 18:53:13 +0200 Subject: [Haiku-commits] r32088 - haiku/trunk/src/tests/kits/game/ParticlesII Message-ID: <200908031653.n73GrDJG016902@sheep.berlios.de> Author: jackburton Date: 2009-08-03 18:53:04 +0200 (Mon, 03 Aug 2009) New Revision: 32088 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32088&view=rev Modified: haiku/trunk/src/tests/kits/game/ParticlesII/Jamfile haiku/trunk/src/tests/kits/game/ParticlesII/particlesII.cpp Log: Gcc4 fixes Modified: haiku/trunk/src/tests/kits/game/ParticlesII/Jamfile =================================================================== --- haiku/trunk/src/tests/kits/game/ParticlesII/Jamfile 2009-08-03 16:50:01 UTC (rev 32087) +++ haiku/trunk/src/tests/kits/game/ParticlesII/Jamfile 2009-08-03 16:53:04 UTC (rev 32088) @@ -2,6 +2,6 @@ SimpleTest ParticlesII : particlesII.cpp - : game be root + : game be root $(TARGET_LIBSUPC++) ; Modified: haiku/trunk/src/tests/kits/game/ParticlesII/particlesII.cpp =================================================================== --- haiku/trunk/src/tests/kits/game/ParticlesII/particlesII.cpp 2009-08-03 16:50:01 UTC (rev 32087) +++ haiku/trunk/src/tests/kits/game/ParticlesII/particlesII.cpp 2009-08-03 16:53:04 UTC (rev 32088) @@ -74,9 +74,11 @@ // app from ScreenConnected() }; +int main() { NApplication app; + return 0; } NApplication::NApplication() @@ -215,7 +217,7 @@ } if((i>=192) && (i<256)) { - c1.red = 0i; // blues + c1.red = 0; // blues c1.green = 0; c1.blue = j*4; c1.alpha = 255; From superstippi at gmx.de Mon Aug 3 21:18:08 2009 From: superstippi at gmx.de (Stephan Assmus) Date: Mon, 03 Aug 2009 21:18:08 +0200 Subject: [Haiku-commits] r32076 - in haiku/trunk: headers/private/kernel/boot src/system/boot/loader src/system/boot/platform/atari_m68k src/system/boot/platform/bios_ia32 src/system/boot/platform/openfirmware In-Reply-To: <744391145-BeMail@laptop> References: <744391145-BeMail@laptop> Message-ID: <20090803211808.11774.7@bepc.1249297773.fake> On 2009-08-03 at 18:20:08 [+0200], Fran?ois Revol wrote: > > "Fran?ois Revol" wrote: > > > > mmu_man at mail.berlios.de wrote: > > > > > This should answer Axel's question :) > > > > Yes, but it doesn't change my opinion about that code :-) All > > > > settings should be changeable through the kernel settings file, > > > > anyway, so if you need sticky options, there is always an interface > > > > to be used. > > > This means you must change the image each time... > > > > So what? > > kernel settings are nothing you will have to change often or at all. > > It's not so much about kernel settings. > More about passing args to the vm at boot time without requiring a change > on the image. For what it's worth, I see your point, Fran?ois. :-) Best regards, -Stephan From leavengood at gmail.com Mon Aug 3 19:25:25 2009 From: leavengood at gmail.com (Ryan Leavengood) Date: Mon, 3 Aug 2009 13:25:25 -0400 Subject: [Haiku-commits] r32078 - in haiku/trunk: headers/os/app headers/os/interface headers/private/binary_compatibility headers/private/interface src/kits/interface src/tests/kits/interface In-Reply-To: <200908031447.n73Elscv005496@sheep.berlios.de> References: <200908031447.n73Elscv005496@sheep.berlios.de> Message-ID: On Mon, Aug 3, 2009 at 10:47 AM, wrote: > > * Added a basic tool tip API, and implementation. Yay! Funny because I was just about to start investigating doing this myself since I really wanted tool tips for the browser project. -- Regards, Ryan From superstippi at gmx.de Mon Aug 3 21:27:59 2009 From: superstippi at gmx.de (Stephan Assmus) Date: Mon, 03 Aug 2009 21:27:59 +0200 Subject: [Haiku-commits] r32078 - in haiku/trunk: headers/os/app headers/os/interface headers/private/binary_compatibility headers/private/interface src/kits/interface src/tests/kits/interface In-Reply-To: References: <200908031447.n73Elscv005496@sheep.berlios.de> Message-ID: <20090803212759.12001.8@bepc.1249297773.fake> On 2009-08-03 at 19:25:25 [+0200], Ryan Leavengood wrote: > On Mon, Aug 3, 2009 at 10:47 AM, wrote: > > > > * Added a basic tool tip API, and implementation. > > Yay! Funny because I was just about to start investigating doing this > myself since I really wanted tool tips for the browser project. Yes, this was desperately missing. Nice work, Axel (and Ingo). Best regards, -Stephan From mmu_man at mail.berlios.de Mon Aug 3 19:30:20 2009 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Mon, 3 Aug 2009 19:30:20 +0200 Subject: [Haiku-commits] r32089 - haiku/trunk/src/add-ons/kernel/drivers/ports Message-ID: <200908031730.n73HUKJj000813@sheep.berlios.de> Author: mmu_man Date: 2009-08-03 19:30:18 +0200 (Mon, 03 Aug 2009) New Revision: 32089 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32089&view=rev Modified: haiku/trunk/src/add-ons/kernel/drivers/ports/Jamfile Log: Add pc_serial to the build. No, it's not yet usable in Haiku. Modified: haiku/trunk/src/add-ons/kernel/drivers/ports/Jamfile =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/ports/Jamfile 2009-08-03 16:53:04 UTC (rev 32088) +++ haiku/trunk/src/add-ons/kernel/drivers/ports/Jamfile 2009-08-03 17:30:18 UTC (rev 32089) @@ -1,3 +1,4 @@ SubDir HAIKU_TOP src add-ons kernel drivers ports ; +SubInclude HAIKU_TOP src add-ons kernel drivers ports pc_serial ; SubInclude HAIKU_TOP src add-ons kernel drivers ports usb_serial ; From revol at free.fr Mon Aug 3 19:31:18 2009 From: revol at free.fr (=?utf-8?q?Fran=C3=A7ois?= Revol) Date: Mon, 03 Aug 2009 19:31:18 +0200 CEST Subject: [Haiku-commits] r32078 - in haiku/trunk: headers/os/app headers/os/interface headers/private/binary_compatibility headers/private/interface src/kits/interface src/tests/kits/interface In-Reply-To: <20090803212759.12001.8@bepc.1249297773.fake> Message-ID: <2284837054-BeMail@laptop> > > On 2009-08-03 at 19:25:25 [+0200], Ryan Leavengood < > leavengood at gmail.com> > wrote: > > On Mon, Aug 3, 2009 at 10:47 AM, wrote: > > > > > > * Added a basic tool tip API, and implementation. > > > > Yay! Funny because I was just about to start investigating doing > > this > > myself since I really wanted tool tips for the browser project. > > Yes, this was desperately missing. Nice work, Axel (and Ingo). Indeed, though I still can't get why he renamed the uicolors :P Fran?ois. From leavengood at gmail.com Mon Aug 3 19:52:16 2009 From: leavengood at gmail.com (Ryan Leavengood) Date: Mon, 3 Aug 2009 13:52:16 -0400 Subject: [Haiku-commits] r32078 - in haiku/trunk: headers/os/app headers/os/interface headers/private/binary_compatibility headers/private/interface src/kits/interface src/tests/kits/interface In-Reply-To: <2284837054-BeMail@laptop> References: <20090803212759.12001.8@bepc.1249297773.fake> <2284837054-BeMail@laptop> Message-ID: On Mon, Aug 3, 2009 at 1:31 PM, Fran?ois Revol wrote: > > Indeed, though I still can't get why he renamed the uicolors :P Consistency I would think: tool tip is two words and all the other constants are split on words. Plus since the API is new, no one should really have been using those constants, at least in Haiku. I don't know if they were carried over from Zeta or something... -- Regards, Ryan From bga at bug-br.org.br Mon Aug 3 19:52:38 2009 From: bga at bug-br.org.br (Bruno Albuquerque) Date: Mon, 03 Aug 2009 14:52:38 -0300 Subject: [Haiku-commits] r32078 - in haiku/trunk: headers/os/app headers/os/interface headers/private/binary_compatibility headers/private/interface src/kits/interface src/tests/kits/interface In-Reply-To: References: <200908031447.n73Elscv005496@sheep.berlios.de> Message-ID: <4A7723E6.1000509@bug-br.org.br> Ryan Leavengood wrote: >> * Added a basic tool tip API, and implementation. > > Yay! Funny because I was just about to start investigating doing this > myself since I really wanted tool tips for the browser project. BTW, Tooltip (without spaces) is a well recognized name (for example: http://en.wikipedia.org/wiki/Tooltip). Changing the name of the contants from *TOOLTIP* to *TOOL_TIP* does not make much sense (and, as Fran?ois pointed out, has the potential to break things). Other than that, tooltips are an welcome addition. In fact, maybe we should automatically add one to text that is automatically truncated and have ellipsis added? The tooltip would have the full text. -Bruno From bga at bug-br.org.br Mon Aug 3 19:56:17 2009 From: bga at bug-br.org.br (Bruno Albuquerque) Date: Mon, 03 Aug 2009 14:56:17 -0300 Subject: [Haiku-commits] r32078 - in haiku/trunk: headers/os/app headers/os/interface headers/private/binary_compatibility headers/private/interface src/kits/interface src/tests/kits/interface In-Reply-To: References: <20090803212759.12001.8@bepc.1249297773.fake> <2284837054-BeMail@laptop> Message-ID: <4A7724C1.1030400@bug-br.org.br> Ryan Leavengood wrote: >> Indeed, though I still can't get why he renamed the uicolors :P > > Consistency I would think: tool tip is two words and all the other > constants are split on words. Plus since the API is new, no one should > really have been using those constants, at least in Haiku. I don't > know if they were carried over from Zeta or something... Actually, tooltip is one word, as I pointed out in the previous email. One must not forget that languages are dynamic. :) -Bruno From zooey at mail.berlios.de Mon Aug 3 19:59:05 2009 From: zooey at mail.berlios.de (zooey at BerliOS) Date: Mon, 3 Aug 2009 19:59:05 +0200 Subject: [Haiku-commits] r32090 - haiku/trunk/src/kits/interface Message-ID: <200908031759.n73Hx5vd032450@sheep.berlios.de> Author: zooey Date: 2009-08-03 19:59:04 +0200 (Mon, 03 Aug 2009) New Revision: 32090 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32090&view=rev Modified: haiku/trunk/src/kits/interface/ListView.cpp Log: small cleanup in ListView: * avoid setting fAnchorIndex multiple times in certain situations Modified: haiku/trunk/src/kits/interface/ListView.cpp =================================================================== --- haiku/trunk/src/kits/interface/ListView.cpp 2009-08-03 17:30:18 UTC (rev 32089) +++ haiku/trunk/src/kits/interface/ListView.cpp 2009-08-03 17:59:04 UTC (rev 32090) @@ -414,7 +414,7 @@ bool extend = fListType == B_MULTIPLE_SELECTION_LIST && (modifiers() & B_SHIFT_KEY) != 0; - + switch (bytes[0]) { case B_UP_ARROW: { @@ -424,7 +424,7 @@ } else { if (fAnchorIndex > 0) { if (!extend || fAnchorIndex <= fFirstSelected) - Select(--fAnchorIndex, extend); + Select(fAnchorIndex - 1, extend); else Deselect(fAnchorIndex--); } @@ -441,7 +441,7 @@ } else { if (fAnchorIndex < CountItems() - 1) { if (!extend || fAnchorIndex >= fLastSelected) - Select(++fAnchorIndex, extend); + Select(fAnchorIndex + 1, extend); else Deselect(fAnchorIndex++); } @@ -452,19 +452,19 @@ } case B_HOME: - if (extend) + if (extend) { Select(0, fAnchorIndex, true); - else + fAnchorIndex = 0; + } else Select(0, false); - fAnchorIndex = 0; ScrollToSelection(); break; case B_END: - if (extend) + if (extend) { Select(fAnchorIndex, CountItems() - 1, true); - else + fAnchorIndex = CountItems() - 1; + } else Select(CountItems() - 1, false); - fAnchorIndex = CountItems() - 1; ScrollToSelection(); break; @@ -1426,12 +1426,11 @@ bool changed = false; - if (!extend) { - fAnchorIndex = index; - if (fFirstSelected != -1) - changed = _DeselectAll(index, index); - } + if (!extend && fFirstSelected != -1) + changed = _DeselectAll(index, index); + fAnchorIndex = index; + BListItem* item = ItemAt(index); if (!item->IsEnabled() || item->IsSelected()) { // if the item is already selected, or can't be selected, From mattmadia at gmail.com Mon Aug 3 20:02:13 2009 From: mattmadia at gmail.com (Matt Madia) Date: Mon, 3 Aug 2009 18:02:13 +0000 Subject: [Haiku-commits] r32086 - haiku/trunk/src/bin In-Reply-To: <200908031625.n73GPhWG025662@sheep.berlios.de> References: <200908031625.n73GPhWG025662@sheep.berlios.de> Message-ID: <1e42d8c50908031102n58b02e83qf544bba340054296@mail.gmail.com> On Mon, Aug 3, 2009 at 16:25, wrote: > Modified: > haiku/trunk/src/bin/safemode.c > Log: > Allow getting other safe mode settings than the default one, from command line. > Added a -s option to get the string value of the setting directly instead of interpreting it as bool. x86gcc2 - broken AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/random /haiku-src/haiku/haiku/src/bin/safemode.c: In function `main': /haiku-src/haiku/haiku/src/bin/safemode.c:30: parse error before `status' /haiku-src/haiku/haiku/src/bin/safemode.c:31: `status' undeclared (first use in this function) /haiku-src/haiku/haiku/src/bin/safemode.c:31: (Each undeclared identifier is reported only once /haiku-src/haiku/haiku/src/bin/safemode.c:31: for each function it appears in.) AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/tty AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/zero AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/audio/hmulti/auich /haiku-src/haiku/haiku/generated.x86gcc2/cross-tools/bin/i586-pc-haiku-gcc -O -Wall -Wno-trigraphs -Wmissing-prototypes -Wpointer-arith -Wcast-align -Wsign-compare -Wno-multichar -pipe -nostdinc -c "/haiku-src/haiku/haiku/src/bin/safemode.c" -D__HAIKU__ -DHAIKU_DISTRO_COMPATIBILITY_DEFAULT -D__INTEL__ -DARCH_x86 -DBOOT_ARCHIVE_IMAGE_OFFSET=300 -D_BEOS_R5_COMPATIBLE_ -DHAIKU_TARGET_PLATFORM_HAIKU -I/haiku-src/haiku/haiku/build/user_config_headers -I/haiku-src/haiku/haiku/build/config_headers -I/haiku-src/haiku/haiku/src/bin -I/haiku-src/haiku/haiku/generated.x86gcc2/objects/common/bin -I/haiku-src/haiku/haiku/generated.x86gcc2/objects/freebsd/x86/common/bin -I/haiku-src/haiku/haiku/generated.x86gcc2/objects/haiku/x86/common/bin -I/haiku-src/haiku/haiku/src/add-ons/kernel/file_cache -I- -I/haiku-src/haiku/haiku/headers/private/app -I/haiku-src/haiku/haiku/headers/private/shared -I/haiku-src/haiku/haiku/headers/private/storage -I/haiku-src/haiku/haiku/headers/private/support -I/haiku-src/haiku/haiku/headers/private/usb -I/haiku-src/haiku/haiku/headers/private/. -I/haiku-src/haiku/haiku/headers/private/system -I/haiku-src/haiku/haiku/headers/private/system/arch/x86 -I/haiku-src/haiku/haiku/headers/libs/ncurses -I/haiku-src/haiku/haiku/headers/cpp -I/haiku-src/haiku/haiku/headers/build/gcc-2.95.3 -I/haiku-src/haiku/haiku/headers -I/haiku-src/haiku/haiku/headers/posix -I/haiku-src/haiku/haiku/headers/gnu -I/haiku-src/haiku/haiku/headers/glibc -I/haiku-src/haiku/haiku/headers/os -I/haiku-src/haiku/haiku/headers/os/add-ons -I/haiku-src/haiku/haiku/headers/os/add-ons/file_system -I/haiku-src/haiku/haiku/headers/os/add-ons/graphics -I/haiku-src/haiku/haiku/headers/os/add-ons/input_server -I/haiku-src/haiku/haiku/headers/os/add-ons/registrar -I/haiku-src/haiku/haiku/headers/os/add-ons/screen_saver -I/haiku-src/haiku/haiku/headers/os/add-ons/tracker -I/haiku-src/haiku/haiku/headers/os/app -I/haiku-src/haiku/haiku/headers/os/device -I/haiku-src/haiku/haiku/headers/os/drivers -I/haiku-src/haiku/haiku/headers/os/game -I/haiku-src/haiku/haiku/headers/os/interface -I/haiku-src/haiku/haiku/headers/os/kernel -I/haiku-src/haiku/haiku/headers/os/media -I/haiku-src/haiku/haiku/headers/os/mail -I/haiku-src/haiku/haiku/headers/os/midi -I/haiku-src/haiku/haiku/headers/os/midi2 -I/haiku-src/haiku/haiku/headers/os/net -I/haiku-src/haiku/haiku/headers/os/opengl -I/haiku-src/haiku/haiku/headers/os/storage -I/haiku-src/haiku/haiku/headers/os/support -I/haiku-src/haiku/haiku/headers/os/translation -I/haiku-src/haiku/haiku/headers/private/. -o "/haiku-src/haiku/haiku/generated.x86gcc2/objects/haiku/x86/release/bin/safemode.o" ; ...failed Cc /haiku-src/haiku/haiku/generated.x86gcc2/objects/haiku/x86/release/bin/safemode.o ... ...skipped safemode for lack of safemode.o... ...skipped haiku.image-copy-files-dummy-system/bin for lack of safemode... AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/audio/hmulti/auvia AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/audio/hmulti/echo3g AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/audio/hmulti/emuxki AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/audio/hmulti/hda AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/midi/emuxki AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/midi/usb_midi AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/bus/usb_raw AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/bus/fw_raw AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/disk/floppy/pc_floppy AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/disk/usb/usb_disk AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/disk/virtual/nbd AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/dvb/cx23882 AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/graphics/radeon AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/graphics/nvidia AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/graphics/neomagic AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/graphics/matrox AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/graphics/intel_extreme AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/graphics/s3 AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/graphics/vesa AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/graphics/ati AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/input/ps2_hid AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/input/usb_hid AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/input/wacom AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/misc/poke AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/misc/test AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/misc/mem AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/net/3com AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/net/broadcom440x AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/net/broadcom570x AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/net/etherpci AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/net/ipro1000 AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/net/pegasus AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/net/rtl8139 AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/net/rtl8169 AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/net/rtl81xx AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/net/sis900 AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/net/via_rhine AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/net/wb840 AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/net/ipro100 AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/net/nforce AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/net/marvell_yukon AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/net/syskonnect AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/net/attansic_l2 AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/net/ar81xx AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/drivers/dev/net/usb_ecm AppendToContainerCopyFilesScript haiku.image-copy-files-dummy-system AppendToContainerCopyFilesScript haiku.image-copy-files-dummy-system/lib AddSymlinkToContainerCopyFilesScript system/lib/libsocket.so AddSymlinkToContainerCopyFilesScript system/lib/libbind.so AddSymlinkToContainerCopyFilesScript system/lib/libnet.so AddSymlinkToContainerCopyFilesScript system/lib/libnetapi.so AddSymlinkToContainerCopyFilesScript system/lib/libGLU.so AddSymlinkToContainerCopyFilesScript system/lib/libglut.so AppendToContainerCopyFilesScript haiku.image-copy-files-dummy-system/servers ...skipped haiku-alpha.image for lack of haiku.image-copy-files... ...failed updating 1 target(s)... ...skipped 3 target(s)... ...updated 86 target(s)... jam -q -j2 @alpha-raw From superstippi at gmx.de Mon Aug 3 22:05:33 2009 From: superstippi at gmx.de (Stephan Assmus) Date: Mon, 03 Aug 2009 22:05:33 +0200 Subject: [Haiku-commits] r32090 - haiku/trunk/src/kits/interface In-Reply-To: <200908031759.n73Hx5vd032450@sheep.berlios.de> References: <200908031759.n73Hx5vd032450@sheep.berlios.de> Message-ID: <20090803220533.15141.10@bepc.1249297773.fake> On 2009-08-03 at 19:59:05 [+0200], zooey at BerliOS wrote: > Author: zooey > Date: 2009-08-03 19:59:04 +0200 (Mon, 03 Aug 2009) New Revision: 32090 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32090&view=rev > > Modified: > haiku/trunk/src/kits/interface/ListView.cpp > Log: > small cleanup in ListView: > * avoid setting fAnchorIndex multiple times in certain situations BTW, I don't know which revision broke this, but when I delete a mail in Beam, the mail below the one I deleted is automatically selected. Then when I want to move up to the next mail, I have to press "up" two times. The first time has no effect. I think it's something recent. Best regards, -Stephan From mmu_man at mail.berlios.de Mon Aug 3 20:10:46 2009 From: mmu_man at mail.berlios.de (mmu_man at mail.berlios.de) Date: Mon, 3 Aug 2009 20:10:46 +0200 Subject: [Haiku-commits] r32091 - haiku/trunk/src/bin Message-ID: <200908031810.n73IAkqW003285@sheep.berlios.de> Author: mmu_man Date: 2009-08-03 20:10:45 +0200 (Mon, 03 Aug 2009) New Revision: 32091 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32091&view=rev Modified: haiku/trunk/src/bin/safemode.c Log: C89, should fix gcc2 build. Modified: haiku/trunk/src/bin/safemode.c =================================================================== --- haiku/trunk/src/bin/safemode.c 2009-08-03 17:59:04 UTC (rev 32090) +++ haiku/trunk/src/bin/safemode.c 2009-08-03 18:10:45 UTC (rev 32091) @@ -18,6 +18,7 @@ bool realString = false; char buffer[B_FILE_NAME_LENGTH]; size_t size = sizeof(buffer); + status_t status; int i; for (i = 1; i < argc; i++) { @@ -27,7 +28,7 @@ optionName = argv[i]; } - status_t status = _kern_get_safemode_option(optionName, buffer, &size); + status = _kern_get_safemode_option(optionName, buffer, &size); if (status == B_OK) { if (realString) { puts(buffer); From kirilla at mail.berlios.de Mon Aug 3 20:17:16 2009 From: kirilla at mail.berlios.de (kirilla at BerliOS) Date: Mon, 3 Aug 2009 20:17:16 +0200 Subject: [Haiku-commits] r32092 - haiku/trunk/src/add-ons/tracker/zipomatic Message-ID: <200908031817.n73IHGYN005001@sheep.berlios.de> Author: kirilla Date: 2009-08-03 20:17:14 +0200 (Mon, 03 Aug 2009) New Revision: 32092 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32092&view=rev Modified: haiku/trunk/src/add-ons/tracker/zipomatic/ZipOMatic.cpp haiku/trunk/src/add-ons/tracker/zipomatic/ZipOMatic.h haiku/trunk/src/add-ons/tracker/zipomatic/ZipOMaticMisc.h haiku/trunk/src/add-ons/tracker/zipomatic/ZipOMaticWindow.cpp haiku/trunk/src/add-ons/tracker/zipomatic/ZipOMaticWindow.h haiku/trunk/src/add-ons/tracker/zipomatic/ZipperThread.cpp haiku/trunk/src/add-ons/tracker/zipomatic/ZipperThread.h Log: Have the application do a single BAlert on a BApplication::QuitRequested()-event in multi-window situations. Move reading/writing of settings from window to application. Cascade-offset the most recent window when they collide. Modified: haiku/trunk/src/add-ons/tracker/zipomatic/ZipOMatic.cpp =================================================================== --- haiku/trunk/src/add-ons/tracker/zipomatic/ZipOMatic.cpp 2009-08-03 18:10:45 UTC (rev 32091) +++ haiku/trunk/src/add-ons/tracker/zipomatic/ZipOMatic.cpp 2009-08-03 18:17:14 UTC (rev 32092) @@ -4,7 +4,9 @@ #include "ZipOMatic.h" +#include #include +#include #include #include "ZipOMaticMisc.h" @@ -39,15 +41,24 @@ ZipOMatic::ZipOMatic() : BApplication(ZIPOMATIC_APP_SIG), - fGotRefs(false) + fSettings(), + fGotRefs(false), + fInvoker(new BInvoker(new BMessage(ZIPPO_QUIT_OR_CONTINUE), NULL, this)), + fWindowFrame(200, 200, 430, 310) { - + status_t status = _ReadSettings(); + + if (status != B_OK) + ErrorMessage("_ReadSettings()", status); } ZipOMatic::~ZipOMatic() { - + status_t status = _WriteSettings(); + + if (status != B_OK) + ErrorMessage("_WriteSettings()", status); } @@ -76,15 +87,32 @@ { switch (message->what) { case ZIPPO_WINDOW_QUIT: + { + BRect frame; + if (message->FindRect("frame", &frame) == B_OK) + fWindowFrame = frame; snooze(200000); if (CountWindows() == 0) Quit(); break; - + } case B_SILENT_RELAUNCH: _SilentRelaunch(); break; + case ZIPPO_QUIT_OR_CONTINUE: + { + int32 button; + if (message->FindInt32("which", &button) == B_OK) + if (button == 0) { + _StopZipping(); + } else { + if (CountWindows() == 0) + Quit(); + } + break; + } + default: BApplication::MessageReceived(message); break; @@ -95,34 +123,74 @@ bool ZipOMatic::QuitRequested (void) { - // Overriding BApplication's default behaviour on purpose - // so we can have multiple zippers pause in unison. - if (CountWindows() <= 0) return true; - BList list(5); BWindow* window; + ZippoWindow* zippo; + ZippoWindow* lastFoundZippo; + int32 zippoCount = 0; for (int32 i = 0;; i++) { - window = WindowAt(i); + window = WindowAt(i); if (window == NULL) break; - - list.AddItem(window); + + zippo = dynamic_cast(window); + if (zippo == NULL) + continue; + + lastFoundZippo = zippo; + + if (zippo->Lock()) { + if (zippo->IsZipping()) + zippoCount++; + else + zippo->PostMessage(B_QUIT_REQUESTED); + + zippo->Unlock(); + } } - while (true) { - window = (BWindow*) list.RemoveItem(int32(0)); - if (window == NULL) - break; - - if (window->Lock()) { - window->PostMessage(B_QUIT_REQUESTED); - window->Unlock(); + if (zippoCount == 1) { + // This is likely the most frequent case - a single zipper. + // We post a message to the window so it can put up its own + // BAlert instead of the app-wide BAlert. This avoids making + // a difference between having pressed Commmand-W or Command-Q. + // Closing or quitting, it doesn't matter for a single window. + + if (lastFoundZippo->Lock()) { + lastFoundZippo->Activate(); + lastFoundZippo->PostMessage(B_QUIT_REQUESTED); + lastFoundZippo->Unlock(); } + return false; } + if (zippoCount > 0) { + // The multi-zipper case differs from the single-zipper case + // in that zippers are not paused while the BAlert is up. + + BString question; + question << "You have " << zippoCount; + question << " Zip-O-Matic running.\n\nDo you want to stop them?"; + + BAlert* alert = new BAlert("Stop or Continue", question.String(), + "Stop them", "Let them continue", NULL, B_WIDTH_AS_USUAL, + B_WARNING_ALERT); + alert->Go(fInvoker); + alert->Activate(); + // BAlert, being modal, does not show on the current workspace + // if the application has no window there. Activate() triggers + // a switch to a workspace where it does have a window. + + // TODO: See if AS_ACTIVATE_WINDOW should be handled differently + // in src/servers/app/Desktop.cpp Desktop::ActivateWindow() + // or if maybe BAlert should (and does not?) activate itself. + + return false; + } + if (CountWindows() <= 0) return true; @@ -154,6 +222,7 @@ foundNonBusyWindow = true; if (message != NULL) window->PostMessage(message); + window->SetWorkspaces(B_CURRENT_WORKSPACE); window->Activate(); window->Unlock(); break; @@ -164,8 +233,143 @@ if (!foundNonBusyWindow) { - ZippoWindow * window = new ZippoWindow(message); + BScreen screen; + fWindowFrame.OffsetBy(screen.Frame().LeftTop()); + + _CascadeOnFrameCollision(&fWindowFrame); + if(!screen.Frame().Contains(fWindowFrame)) { + fWindowFrame.OffsetTo(screen.Frame().LeftTop()); + fWindowFrame.OffsetBy(20,45); + // TODO: replace with CenterOnScreen() + } + + ZippoWindow * window = new ZippoWindow(fWindowFrame, message); window->Show(); } } + +void +ZipOMatic::_StopZipping() +{ + BWindow* window; + ZippoWindow* zippo; + BList list; + + for (int32 i = 0;; i++) { + window = WindowAt(i); + if (window == NULL) + break; + + zippo = dynamic_cast(window); + if (zippo == NULL) + continue; + + list.AddItem(zippo); + } + + for (int32 i = 0;; i++) { + zippo = static_cast(list.ItemAt(i)); + if (zippo == NULL) + break; + + if (zippo->Lock()) { + if (zippo->IsZipping()) + zippo->StopZipping(); + + zippo->PostMessage(B_QUIT_REQUESTED); + zippo->Unlock(); + } + } +} + + +status_t +ZipOMatic::_ReadSettings() +{ + status_t status = B_OK; + + status = fSettings.SetTo("zipomatic.msg"); + if (status != B_OK) + return status; + + status = fSettings.InitCheck(); + if (status != B_OK) + return status; + + status = fSettings.InitCheck(); + if (status != B_OK) + return status; + + status = fSettings.ReadSettings(); + if (status != B_OK) + return status; + + BRect frame; + status = fSettings.FindRect("frame", &frame); + if (status != B_OK) + return status; + + fWindowFrame = frame; + + return B_OK; +} + + +status_t +ZipOMatic::_WriteSettings() +{ + status_t status = B_OK; + + status = fSettings.InitCheck(); + if (status != B_OK) + return status; + + status = fSettings.MakeEmpty(); + if (status != B_OK) + return status; + + status = fSettings.AddRect("frame", fWindowFrame); + if (status != B_OK) + return status; + + status = fSettings.WriteSettings(); + if (status != B_OK) + return status; + + return B_OK; +} + + +void +ZipOMatic::_CascadeOnFrameCollision(BRect* frame) +{ + BWindow* window; + ZippoWindow* zippo; + BList list; + + for (int32 i = 0;; i++) { + window = WindowAt(i); + if (window == NULL) + break; + + zippo = dynamic_cast(window); + if (zippo == NULL) + continue; + + list.AddItem(zippo); + } + + for (int32 i = 0;; i++) { + zippo = static_cast(list.ItemAt(i)); + if (zippo == NULL) + break; + + if (zippo->Lock()) { + if (frame->LeftTop() == zippo->Frame().LeftTop()) + frame->OffsetBy(20, 20); + zippo->Unlock(); + } + } +} + Modified: haiku/trunk/src/add-ons/tracker/zipomatic/ZipOMatic.h =================================================================== --- haiku/trunk/src/add-ons/tracker/zipomatic/ZipOMatic.h 2009-08-03 18:10:45 UTC (rev 32091) +++ haiku/trunk/src/add-ons/tracker/zipomatic/ZipOMatic.h 2009-08-03 18:17:14 UTC (rev 32092) @@ -3,9 +3,13 @@ #include +#include #include +#include +#include "ZipOMaticSettings.h" + class ZipOMatic : public BApplication { public: @@ -18,11 +22,18 @@ virtual bool QuitRequested(); private: + status_t _ReadSettings(); + status_t _WriteSettings(); + void _CascadeOnFrameCollision(BRect* frame); void _SilentRelaunch(); void _UseExistingOrCreateNewWindow(BMessage* message = NULL); + void _StopZipping(); + ZippoSettings fSettings; bool fGotRefs; + BInvoker* fInvoker; + BRect fWindowFrame; }; #endif // _ZIPOMATIC_H_ Modified: haiku/trunk/src/add-ons/tracker/zipomatic/ZipOMaticMisc.h =================================================================== --- haiku/trunk/src/add-ons/tracker/zipomatic/ZipOMaticMisc.h 2009-08-03 18:10:45 UTC (rev 32091) +++ haiku/trunk/src/add-ons/tracker/zipomatic/ZipOMaticMisc.h 2009-08-03 18:17:14 UTC (rev 32092) @@ -18,6 +18,11 @@ #define ZIPOMATIC_APP_SIG "application/x-vnd.haiku.zip-o-matic" #define ZIPPO_WINDOW_QUIT 'winq' +#define ZIPPO_QUIT_OR_CONTINUE 'alrt' +#define ZIPPO_THREAD_EXIT 'exit' +#define ZIPPO_THREAD_EXIT_ERROR 'exrr' +#define ZIPPO_TASK_DESCRIPTION 'strt' +#define ZIPPO_LINE_OF_STDOUT 'outp' status_t FindAndCreateDirectory(directory_which which, BVolume* volume = NULL, const char* relativePath = NULL, Modified: haiku/trunk/src/add-ons/tracker/zipomatic/ZipOMaticWindow.cpp =================================================================== --- haiku/trunk/src/add-ons/tracker/zipomatic/ZipOMaticWindow.cpp 2009-08-03 18:10:45 UTC (rev 32091) +++ haiku/trunk/src/add-ons/tracker/zipomatic/ZipOMaticWindow.cpp 2009-08-03 18:17:14 UTC (rev 32092) @@ -28,39 +28,26 @@ #include "ZipperThread.h" -ZippoWindow::ZippoWindow(BMessage* message) +ZippoWindow::ZippoWindow(BRect frame, BMessage* refs) : - BWindow(BRect(200, 200, 430, 310), "Zip-O-Matic", B_TITLED_WINDOW, - B_NOT_V_RESIZABLE), + BWindow(frame, "Zip-O-Matic", B_TITLED_WINDOW, B_NOT_V_RESIZABLE), fView(NULL), - fSettings(), fThread(NULL), fWindowGotRefs(false), fZippingWasStopped(false), - fWindowInvoker(new BInvoker(new BMessage('alrt'), NULL, this)) + fWindowInvoker(new BInvoker(new BMessage(ZIPPO_QUIT_OR_CONTINUE), NULL, + this)) { - status_t status = B_OK; - - status = fSettings.SetTo("ZipOMatic.msg"); - if (status != B_OK) - ErrorMessage("fSettings.SetTo()", status); - - status = fSettings.InitCheck(); - if (status != B_OK) - ErrorMessage("fSettings.InitCheck()", status); - fView = new ZippoView(Bounds()); AddChild(fView); SetSizeLimits(Bounds().Width(), 15000, Bounds().Height(), Bounds().Height()); - _ReadSettings(); - - if (message != NULL) + if (refs != NULL) { fWindowGotRefs = true; - _StartZipping(message); + _StartZipping(refs); } } @@ -88,8 +75,7 @@ } break; - case 'exit': - // thread has finished - (finished, quit, killed, we don't know) + case ZIPPO_THREAD_EXIT: fThread = NULL; fView->fActivityView->Stop(); fView->fStopButton->SetEnabled(false); @@ -102,7 +88,8 @@ _CloseWindowOrKeepOpen(); break; - case 'exrr': // thread has finished - badly + case ZIPPO_THREAD_EXIT_ERROR: + // TODO: figure out why this case does not happen when it should fThread = NULL; fView->fActivityView->Stop(); fView->fStopButton->SetEnabled(false); @@ -110,7 +97,7 @@ fView->fZipOutputView->SetText("Error creating archive"); break; - case 'strt': + case ZIPPO_TASK_DESCRIPTION: { BString string; if (message->FindString("archive_filename", &string) == B_OK) @@ -118,7 +105,7 @@ break; } - case 'outp': + case ZIPPO_LINE_OF_STDOUT: { BString string; if (message->FindString("zip_output", &string) == B_OK) @@ -126,12 +113,12 @@ break; } - case 'alrt': + case ZIPPO_QUIT_OR_CONTINUE: { int32 which_button = -1; if (message->FindInt32("which", &which_button) == B_OK) { if (which_button == 0) { - _StopZipping(); + StopZipping(); } else { if (fThread != NULL) fThread->ResumeExternalZip(); @@ -152,85 +139,25 @@ bool ZippoWindow::QuitRequested() { - if (fThread == NULL) { - _WriteSettings(); - be_app_messenger.SendMessage(ZIPPO_WINDOW_QUIT); + if (!IsZipping()) { + BMessage message(ZIPPO_WINDOW_QUIT); + message.AddRect("frame", Frame()); + be_app_messenger.SendMessage(&message); return true; } else { - if (fThread != NULL) - fThread->SuspendExternalZip(); - + fThread->SuspendExternalZip(); fView->fActivityView->Pause(); - + BAlert* alert = new BAlert("Stop or Continue", "Are you sure you want to stop creating this archive?", "Stop", "Continue", NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT); alert->Go(fWindowInvoker); + return false; } } -status_t -ZippoWindow::_ReadSettings() -{ - status_t status = B_OK; - - status = fSettings.InitCheck(); - if (status != B_OK) - ErrorMessage("fSettings.InitCheck()", status); - - status = fSettings.ReadSettings(); - if (status != B_OK) - ErrorMessage("fSettings.ReadSettings()", status); - - BRect windowRect; - - status = fSettings.FindRect("windowRect", &windowRect); - if (status != B_OK) - { - ErrorMessage("fSettings.FindRect(windowRect)", status); - return status; - } - - ResizeTo(windowRect.Width(), windowRect.Height()); - MoveTo(windowRect.LeftTop()); - - return B_OK; -} - - -status_t -ZippoWindow::_WriteSettings() -{ - status_t status = B_OK; - - status = fSettings.InitCheck(); - if (status != B_OK) - ErrorMessage("fSettings.InitCheck()", status); - - status = fSettings.MakeEmpty(); - if (status != B_OK) - ErrorMessage("fSettings.MakeEmpty()", status); - - status = fSettings.AddRect("windowRect", Frame()); - if (status != B_OK) - { - ErrorMessage("fSettings.AddRect(windowRect)", status); - return status; - } - - status = fSettings.WriteSettings(); - if (status != B_OK) - { - ErrorMessage("fSettings.WriteSettings()", status); - return status; - } - - return B_OK; -} - - void ZippoWindow::_StartZipping(BMessage* message) { @@ -245,7 +172,7 @@ void -ZippoWindow::_StopZipping() +ZippoWindow::StopZipping() { fZippingWasStopped = true; Modified: haiku/trunk/src/add-ons/tracker/zipomatic/ZipOMaticWindow.h =================================================================== --- haiku/trunk/src/add-ons/tracker/zipomatic/ZipOMaticWindow.h 2009-08-03 18:10:45 UTC (rev 32091) +++ haiku/trunk/src/add-ons/tracker/zipomatic/ZipOMaticWindow.h 2009-08-03 18:17:14 UTC (rev 32092) @@ -8,7 +8,6 @@ #include #include -#include "ZipOMaticSettings.h" #include "ZipOMaticView.h" #include "ZipperThread.h" @@ -16,7 +15,7 @@ class ZippoWindow : public BWindow { public: - ZippoWindow(BMessage* message = NULL); + ZippoWindow(BRect frame, BMessage* refs = NULL); ~ZippoWindow(); virtual void MessageReceived(BMessage* message); @@ -24,18 +23,14 @@ virtual void Zoom(BPoint origin, float width, float height); bool IsZipping(); + void StopZipping(); private: - status_t _ReadSettings(); - status_t _WriteSettings(); void _StartZipping(BMessage* message); - void _StopZipping(); - void _CloseWindowOrKeepOpen(); ZippoView* fView; - ZippoSettings fSettings; ZipperThread* fThread; bool fWindowGotRefs; Modified: haiku/trunk/src/add-ons/tracker/zipomatic/ZipperThread.cpp =================================================================== --- haiku/trunk/src/add-ons/tracker/zipomatic/ZipperThread.cpp 2009-08-03 18:10:45 UTC (rev 32091) +++ haiku/trunk/src/add-ons/tracker/zipomatic/ZipperThread.cpp 2009-08-03 18:17:14 UTC (rev 32092) @@ -140,8 +140,10 @@ archiveName.Prepend("Creating archive: "); - _SendMessageToWindow('strt', "archive_filename", archiveName.String()); - _SendMessageToWindow('outp', "zip_output", "Preparing to archive"); + _SendMessageToWindow(ZIPPO_TASK_DESCRIPTION, "archive_filename", + archiveName.String()); + _SendMessageToWindow(ZIPPO_LINE_OF_STDOUT, "zip_output", + "Preparing to archive"); return B_OK; } @@ -164,12 +166,12 @@ if (!strncmp(" a", output, 3)) { output[2] = 'A'; - _SendMessageToWindow('outp', "zip_output", output + 2); + _SendMessageToWindow(ZIPPO_LINE_OF_STDOUT, "zip_output", output + 2); } else if (!strncmp("up", output, 2)) { output[0] = 'U'; - _SendMessageToWindow('outp', "zip_output", output); + _SendMessageToWindow(ZIPPO_LINE_OF_STDOUT, "zip_output", output); } else { - _SendMessageToWindow('outp', "zip_output", output); + _SendMessageToWindow(ZIPPO_LINE_OF_STDOUT, "zip_output", output); } return B_OK; @@ -202,10 +204,10 @@ if (status == EOF) { // thread has finished, been quit or killed, we don't know - _SendMessageToWindow('exit'); + _SendMessageToWindow(ZIPPO_THREAD_EXIT); } else { // explicit error - communicate error to Window - _SendMessageToWindow('exrr'); + _SendMessageToWindow(ZIPPO_THREAD_EXIT_ERROR); } Quit(); Modified: haiku/trunk/src/add-ons/tracker/zipomatic/ZipperThread.h =================================================================== --- haiku/trunk/src/add-ons/tracker/zipomatic/ZipperThread.h 2009-08-03 18:10:45 UTC (rev 32091) +++ haiku/trunk/src/add-ons/tracker/zipomatic/ZipperThread.h 2009-08-03 18:17:14 UTC (rev 32092) @@ -14,6 +14,7 @@ #include #include +#include #include #include "GenericThread.h" From leavengood at gmail.com Mon Aug 3 20:22:18 2009 From: leavengood at gmail.com (Ryan Leavengood) Date: Mon, 3 Aug 2009 14:22:18 -0400 Subject: [Haiku-commits] r32078 - in haiku/trunk: headers/os/app headers/os/interface headers/private/binary_compatibility headers/private/interface src/kits/interface src/tests/kits/interface In-Reply-To: <4A7724C1.1030400@bug-br.org.br> References: <20090803212759.12001.8@bepc.1249297773.fake> <2284837054-BeMail@laptop> <4A7724C1.1030400@bug-br.org.br> Message-ID: On Mon, Aug 3, 2009 at 1:56 PM, Bruno Albuquerque wrote: > > Actually, tooltip is one word, as I pointed out in the previous email. > One must not forget that languages are dynamic. :) Indeed English is very dynamic, but tool tip as two words is also valid and used in the Java world as well as from Microsoft in .NET (based on the camel-casing of the class name): http://72.5.124.55/docs/books/tutorial/uiswing/components/tooltip.html http://msdn.microsoft.com/en-us/library/system.windows.forms.tooltip.aspx In fact it looks like Axel was inspired by the Java implementation to some extent. Either way he chose to call the class ToolTip and changed the constant to match, which I think makes sense. If the class was Tooltip then the constant would not need to be changed. I personally prefer ToolTip. -- Regards, Ryan From leavengood at gmail.com Mon Aug 3 20:25:06 2009 From: leavengood at gmail.com (Ryan Leavengood) Date: Mon, 3 Aug 2009 14:25:06 -0400 Subject: [Haiku-commits] r32065 - haiku/trunk/build/jam In-Reply-To: <200908030956.n739uJ51016316@sheep.berlios.de> References: <200908030956.n739uJ51016316@sheep.berlios.de> Message-ID: On Mon, Aug 3, 2009 at 5:56 AM, wrote: > > Added MediaConverter to the build. It still needs a nice new icon though... Are you working on the new icon, or would you like some help? -- Regards, Ryan From bga at bug-br.org.br Mon Aug 3 20:36:40 2009 From: bga at bug-br.org.br (Bruno Albuquerque) Date: Mon, 03 Aug 2009 15:36:40 -0300 Subject: [Haiku-commits] r32078 - in haiku/trunk: headers/os/app headers/os/interface headers/private/binary_compatibility headers/private/interface src/kits/interface src/tests/kits/interface In-Reply-To: References: <20090803212759.12001.8@bepc.1249297773.fake> <2284837054-BeMail@laptop> <4A7724C1.1030400@bug-br.org.br> Message-ID: <4A772E38.9080305@bug-br.org.br> Ryan Leavengood wrote: > On Mon, Aug 3, 2009 at 1:56 PM, Bruno Albuquerque wrote: >> Actually, tooltip is one word, as I pointed out in the previous email. >> One must not forget that languages are dynamic. :) > > Indeed English is very dynamic, but tool tip as two words is also > valid and used in the Java world as well as from Microsoft in .NET > (based on the camel-casing of the class name): > > http://72.5.124.55/docs/books/tutorial/uiswing/components/tooltip.html > http://msdn.microsoft.com/en-us/library/system.windows.forms.tooltip.aspx > > In fact it looks like Axel was inspired by the Java implementation to > some extent. > > Either way he chose to call the class ToolTip and changed the constant > to match, which I think makes sense. If the class was Tooltip then the > constant would not need to be changed. I personally prefer ToolTip. If the constants didn't exist yet, I am all for calling it whatever you want (even Walter ;) ). But considering the constants already existed and "tooltip" exists and is a well known term (I would guess the wikipedia entry is more general than the Java use of it), I think the change was a mistake. -Bruno From revol at free.fr Mon Aug 3 20:50:41 2009 From: revol at free.fr (=?utf-8?q?Fran=C3=A7ois?= Revol) Date: Mon, 03 Aug 2009 20:50:41 +0200 CEST Subject: [Haiku-commits] r32086 - haiku/trunk/src/bin In-Reply-To: <1e42d8c50908031102n58b02e83qf544bba340054296@mail.gmail.com> Message-ID: <1115169233-BeMail@laptop> > On Mon, Aug 3, 2009 at 16:25, wrote: > > Modified: > > haiku/trunk/src/bin/safemode.c > > Log: > > Allow getting other safe mode settings than the default one, from > > command line. > > Added a -s option to get the string value of the setting directly > > instead of interpreting it as bool. > > x86gcc2 - broken Fixed in r32091, hopefully. Fran?ois. From superstippi at gmx.de Mon Aug 3 22:54:14 2009 From: superstippi at gmx.de (Stephan Assmus) Date: Mon, 03 Aug 2009 22:54:14 +0200 Subject: [Haiku-commits] r32078 - in haiku/trunk: headers/os/app headers/os/interface headers/private/binary_compatibility headers/private/interface src/kits/interface src/tests/kits/interface In-Reply-To: <4A772E38.9080305@bug-br.org.br> References: <20090803212759.12001.8@bepc.1249297773.fake> <2284837054-BeMail@laptop> <4A7724C1.1030400@bug-br.org.br> <4A772E38.9080305@bug-br.org.br> Message-ID: <20090803225414.1778.1@bepc.1249330610.fake> On 2009-08-03 at 20:36:40 [+0200], Bruno Albuquerque wrote: > Ryan Leavengood wrote: > > On Mon, Aug 3, 2009 at 1:56 PM, Bruno Albuquerque > > wrote: > >> Actually, tooltip is one word, as I pointed out in the previous email. > >> One must not forget that languages are dynamic. :) > > > > Indeed English is very dynamic, but tool tip as two words is also valid > > and used in the Java world as well as from Microsoft in .NET (based on > > the camel-casing of the class name): > > > > http://72.5.124.55/docs/books/tutorial/uiswing/components/tooltip.html > > http://msdn.microsoft.com/en-us/library/system.windows.forms.tooltip.aspx > > > > In fact it looks like Axel was inspired by the Java implementation to > > some extent. > > > > Either way he chose to call the class ToolTip and changed the constant > > to match, which I think makes sense. If the class was Tooltip then the > > constant would not need to be changed. I personally prefer ToolTip. > > If the constants didn't exist yet, I am all for calling it whatever you > want (even Walter ;) ). But considering the constants already existed and > "tooltip" exists and is a well known term (I would guess the wikipedia > entry is more general than the Java use of it), I think the change was a > mistake. Sometimes we non-native English speakers have the wrong feel for something, and Ryan is a native speaker. In any case, the constants did not exist on BeOS R5, which is the API that we want to replicate. Axel didn't copy the Dano tool tip API either, although I know he and Ingo looked at it. You could also ask why the constants were declared in our headers, even if most of them are not actually supported anyways. Best regards, -Stephan From bonefish at mail.berlios.de Mon Aug 3 20:58:22 2009 From: bonefish at mail.berlios.de (bonefish at mail.berlios.de) Date: Mon, 3 Aug 2009 20:58:22 +0200 Subject: [Haiku-commits] r32093 - haiku/trunk/src/add-ons/kernel/partitioning_systems/intel Message-ID: <200908031858.n73IwMip015505@sheep.berlios.de> Author: bonefish Date: 2009-08-03 20:58:21 +0200 (Mon, 03 Aug 2009) New Revision: 32093 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32093&view=rev Modified: haiku/trunk/src/add-ons/kernel/partitioning_systems/intel/PartitionLocker.cpp Log: Patch by Bryce Groff: Style cleanup. Modified: haiku/trunk/src/add-ons/kernel/partitioning_systems/intel/PartitionLocker.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/partitioning_systems/intel/PartitionLocker.cpp 2009-08-03 18:17:14 UTC (rev 32092) +++ haiku/trunk/src/add-ons/kernel/partitioning_systems/intel/PartitionLocker.cpp 2009-08-03 18:58:21 UTC (rev 32093) @@ -12,8 +12,9 @@ // constructor PartitionLocker::PartitionLocker(partition_id partitionID) - : fDevice(NULL), - fPartitionID(partitionID) + : + fDevice(NULL), + fPartitionID(partitionID) { } @@ -42,7 +43,8 @@ // constructor PartitionReadLocker::PartitionReadLocker(partition_id partitionID) - : PartitionLocker(partitionID) + : + PartitionLocker(partitionID) { fDevice = read_lock_disk_device(partitionID); } @@ -60,7 +62,8 @@ // constructor PartitionWriteLocker::PartitionWriteLocker(partition_id partitionID) - : PartitionLocker(partitionID) + : + PartitionLocker(partitionID) { fDevice = write_lock_disk_device(partitionID); } From bonefish at mail.berlios.de Mon Aug 3 21:01:21 2009 From: bonefish at mail.berlios.de (bonefish at mail.berlios.de) Date: Mon, 3 Aug 2009 21:01:21 +0200 Subject: [Haiku-commits] r32094 - haiku/trunk/src/system/kernel/disk_device_manager Message-ID: <200908031901.n73J1Lg3016122@sheep.berlios.de> Author: bonefish Date: 2009-08-03 21:01:20 +0200 (Mon, 03 Aug 2009) New Revision: 32094 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32094&view=rev Modified: haiku/trunk/src/system/kernel/disk_device_manager/disk_device_manager.cpp Log: Patch by Bryce Groff: Allow passing an ID of any partition contained in the disk device to the locking functions, not only the ID of the disk device itself. Modified: haiku/trunk/src/system/kernel/disk_device_manager/disk_device_manager.cpp =================================================================== --- haiku/trunk/src/system/kernel/disk_device_manager/disk_device_manager.cpp 2009-08-03 18:58:21 UTC (rev 32093) +++ haiku/trunk/src/system/kernel/disk_device_manager/disk_device_manager.cpp 2009-08-03 19:01:20 UTC (rev 32094) @@ -22,7 +22,7 @@ write_lock_disk_device(partition_id partitionID) { KDiskDeviceManager *manager = KDiskDeviceManager::Default(); - if (KDiskDevice *device = manager->RegisterDevice(partitionID)) { + if (KDiskDevice *device = manager->RegisterDevice(partitionID, false)) { if (device->WriteLock()) return device->DeviceData(); // Only unregister, when the locking fails. The guarantees, that the @@ -38,7 +38,7 @@ write_unlock_disk_device(partition_id partitionID) { KDiskDeviceManager *manager = KDiskDeviceManager::Default(); - if (KDiskDevice *device = manager->RegisterDevice(partitionID)) { + if (KDiskDevice *device = manager->RegisterDevice(partitionID, false)) { bool isLocked = device->IsWriteLocked(); if (isLocked) { device->WriteUnlock(); @@ -54,7 +54,7 @@ read_lock_disk_device(partition_id partitionID) { KDiskDeviceManager *manager = KDiskDeviceManager::Default(); - if (KDiskDevice *device = manager->RegisterDevice(partitionID)) { + if (KDiskDevice *device = manager->RegisterDevice(partitionID, false)) { if (device->ReadLock()) return device->DeviceData(); // Only unregister, when the locking fails. The guarantees, that the @@ -70,7 +70,7 @@ read_unlock_disk_device(partition_id partitionID) { KDiskDeviceManager *manager = KDiskDeviceManager::Default(); - if (KDiskDevice *device = manager->RegisterDevice(partitionID)) { + if (KDiskDevice *device = manager->RegisterDevice(partitionID, false)) { bool isLocked = device->IsReadLocked(false); if (isLocked) { device->ReadUnlock(); From bonefish at mail.berlios.de Mon Aug 3 21:02:52 2009 From: bonefish at mail.berlios.de (bonefish at mail.berlios.de) Date: Mon, 3 Aug 2009 21:02:52 +0200 Subject: [Haiku-commits] r32095 - haiku/trunk/src/apps/drivesetup Message-ID: <200908031902.n73J2qkF016293@sheep.berlios.de> Author: bonefish Date: 2009-08-03 21:02:51 +0200 (Mon, 03 Aug 2009) New Revision: 32095 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32095&view=rev Modified: haiku/trunk/src/apps/drivesetup/MainWindow.cpp Log: Patch by Bryce Groff: Correctly notify the user when committing the modifications for deleting a partition failed. Modified: haiku/trunk/src/apps/drivesetup/MainWindow.cpp =================================================================== --- haiku/trunk/src/apps/drivesetup/MainWindow.cpp 2009-08-03 19:01:20 UTC (rev 32094) +++ haiku/trunk/src/apps/drivesetup/MainWindow.cpp 2009-08-03 19:02:51 UTC (rev 32095) @@ -1024,8 +1024,14 @@ return; } - modificationPreparer.CommitModifications(); + ret = modificationPreparer.CommitModifications(); + if (ret != B_OK) { + _DisplayPartitionError("Failed to delete the partition. " + "This operation is exiting.\nNo changes have been made!\n"); + return; + } + _ScanDrives(); fDiskView->ForceUpdate(); } From bonefish at mail.berlios.de Mon Aug 3 21:05:39 2009 From: bonefish at mail.berlios.de (bonefish at mail.berlios.de) Date: Mon, 3 Aug 2009 21:05:39 +0200 Subject: [Haiku-commits] r32096 - haiku/trunk/src/apps/drivesetup Message-ID: <200908031905.n73J5dWH016847@sheep.berlios.de> Author: bonefish Date: 2009-08-03 21:05:38 +0200 (Mon, 03 Aug 2009) New Revision: 32096 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32096&view=rev Modified: haiku/trunk/src/apps/drivesetup/CreateParamsPanel.cpp Log: Patch by Bryce Groff: Allow the disk system add-ons to return a NULL parameter editor, when they don't have any additional parameters to edit. Modified: haiku/trunk/src/apps/drivesetup/CreateParamsPanel.cpp =================================================================== --- haiku/trunk/src/apps/drivesetup/CreateParamsPanel.cpp 2009-08-03 19:02:51 UTC (rev 32095) +++ haiku/trunk/src/apps/drivesetup/CreateParamsPanel.cpp 2009-08-03 19:05:38 UTC (rev 32096) @@ -125,9 +125,11 @@ break; case MSG_PARTITION_TYPE: - const char* type; - message->FindString("type", &type); - fEditor->PartitionTypeChanged(type); + if (fEditor != NULL) { + const char* type; + message->FindString("type", &type); + fEditor->PartitionTypeChanged(type); + } break; default: @@ -185,10 +187,12 @@ } // get editors parameters - if (fEditor->FinishedEditing()) { - status_t status = fEditor->GetParameters(¶meters); - if (status != B_OK) - fReturnValue = status; + if (fEditor != NULL) { + if (fEditor->FinishedEditing()) { + status_t status = fEditor->GetParameters(¶meters); + if (status != B_OK) + fReturnValue = status; + } } } @@ -249,33 +253,56 @@ .Add(fTypeMenuField) ; BBox* infoBox = new BBox(B_FANCY_BORDER, infoView); + BView* rootView; parent->GetChildCreationParameterEditor(NULL, &fEditor); - BBox* parameterBox = new BBox(B_FANCY_BORDER, fEditor->View()); + if (fEditor != NULL) { + BBox* parameterBox = new BBox(B_FANCY_BORDER, fEditor->View()); - BView* rootView = BGroupLayoutBuilder(B_VERTICAL, 4) - .Add(BSpaceLayoutItem::CreateVerticalStrut(5)) + rootView = BGroupLayoutBuilder(B_VERTICAL, 4) + .Add(BSpaceLayoutItem::CreateVerticalStrut(5)) - // slider and types - .Add(infoBox) + // slider and types + .Add(infoBox) - .Add(BSpaceLayoutItem::CreateVerticalStrut(10)) + .Add(BSpaceLayoutItem::CreateVerticalStrut(10)) - // editor's view - .Add(parameterBox) + // editor's view + .Add(parameterBox) - // controls - .AddGroup(B_HORIZONTAL, 10) - .Add(BSpaceLayoutItem::CreateHorizontalStrut(5)) - .AddGlue() - .Add(fCancelButton) - .Add(fOKButton) - .Add(BSpaceLayoutItem::CreateHorizontalStrut(5)) - .End() + // controls + .AddGroup(B_HORIZONTAL, 10) + .Add(BSpaceLayoutItem::CreateHorizontalStrut(5)) + .AddGlue() + .Add(fCancelButton) + .Add(fOKButton) + .Add(BSpaceLayoutItem::CreateHorizontalStrut(5)) + .End() - .Add(BSpaceLayoutItem::CreateVerticalStrut(5)) - ; + .Add(BSpaceLayoutItem::CreateVerticalStrut(5)) + ; + } else { + rootView = BGroupLayoutBuilder(B_VERTICAL, 4) + .Add(BSpaceLayoutItem::CreateVerticalStrut(5)) + // slider and types + .Add(infoBox) + + .Add(BSpaceLayoutItem::CreateVerticalStrut(10)) + + // controls + .AddGroup(B_HORIZONTAL, 10) + .Add(BSpaceLayoutItem::CreateHorizontalStrut(5)) + .AddGlue() + .Add(fCancelButton) + .Add(fOKButton) + .Add(BSpaceLayoutItem::CreateHorizontalStrut(5)) + .End() + + .Add(BSpaceLayoutItem::CreateVerticalStrut(5)) + ; + } + SetLayout(new BGroupLayout(B_HORIZONTAL)); AddChild(rootView); SetDefaultButton(fOKButton); From bonefish at mail.berlios.de Mon Aug 3 21:06:23 2009 From: bonefish at mail.berlios.de (bonefish at mail.berlios.de) Date: Mon, 3 Aug 2009 21:06:23 +0200 Subject: [Haiku-commits] r32097 - haiku/trunk/src/apps/drivesetup Message-ID: <200908031906.n73J6NSc016917@sheep.berlios.de> Author: bonefish Date: 2009-08-03 21:06:21 +0200 (Mon, 03 Aug 2009) New Revision: 32097 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32097&view=rev Modified: haiku/trunk/src/apps/drivesetup/InitParamsPanel.cpp Log: Patch by Bryce Groff: don't leak the driver settings handle. Modified: haiku/trunk/src/apps/drivesetup/InitParamsPanel.cpp =================================================================== --- haiku/trunk/src/apps/drivesetup/InitParamsPanel.cpp 2009-08-03 19:05:38 UTC (rev 32096) +++ haiku/trunk/src/apps/drivesetup/InitParamsPanel.cpp 2009-08-03 19:06:21 UTC (rev 32097) @@ -198,6 +198,7 @@ const char* string = get_driver_parameter(handle, "name", NULL, NULL); name.SetTo(string); + delete_driver_settings(handle); } } else fReturnValue = err; From bonefish at mail.berlios.de Mon Aug 3 21:11:14 2009 From: bonefish at mail.berlios.de (bonefish at mail.berlios.de) Date: Mon, 3 Aug 2009 21:11:14 +0200 Subject: [Haiku-commits] r32098 - haiku/trunk/src/add-ons/disk_systems/intel Message-ID: <200908031911.n73JBEok017537@sheep.berlios.de> Author: bonefish Date: 2009-08-03 21:11:14 +0200 (Mon, 03 Aug 2009) New Revision: 32098 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32098&view=rev Modified: haiku/trunk/src/add-ons/disk_systems/intel/PartitionMapAddOn.cpp Log: Patch by Bryce Groff with small change by myself: * Don't leak the driver settings handle. * No need to get the "active" parameter in ValidateCreateChild() -- either way is fine. Modified: haiku/trunk/src/add-ons/disk_systems/intel/PartitionMapAddOn.cpp =================================================================== --- haiku/trunk/src/add-ons/disk_systems/intel/PartitionMapAddOn.cpp 2009-08-03 19:06:21 UTC (rev 32097) +++ haiku/trunk/src/add-ons/disk_systems/intel/PartitionMapAddOn.cpp 2009-08-03 19:11:14 UTC (rev 32098) @@ -349,9 +349,9 @@ void* handle = parse_driver_settings_string(parameters); if (handle == NULL) return B_ERROR; + get_driver_boolean_parameter(handle, "active", false, true); + delete_driver_settings(handle); - bool active = get_driver_boolean_parameter(handle, "active", false, true); - // do we have a spare primary partition? if (fPartitionMap.CountNonEmptyPrimaryPartitions() == 4) return B_BAD_VALUE; @@ -467,6 +467,7 @@ return B_ERROR; bool active = get_driver_boolean_parameter(handle, "active", false, true); + delete_driver_settings(handle); // get a spare primary partition PrimaryPartition* primary = NULL; @@ -507,8 +508,6 @@ if (!foundSpace) return B_BAD_VALUE; - // everything looks good, do it - // create the child // (Note: the primary partition index is indeed the child index, since // we picked the first empty primary partition.) @@ -529,9 +528,6 @@ // init the primary partition primary->SetTo(offset, size, type.Type(), active, partition->BlockSize()); - // TODO: If the child is an extended partition, we should trigger its - // initialization. - *_child = child; return B_OK; } From superstippi at gmx.de Mon Aug 3 23:10:40 2009 From: superstippi at gmx.de (Stephan Assmus) Date: Mon, 03 Aug 2009 23:10:40 +0200 Subject: [Haiku-commits] r32065 - haiku/trunk/build/jam In-Reply-To: References: <200908030956.n739uJ51016316@sheep.berlios.de> Message-ID: <20090803231040.1806.2@bepc.1249330610.fake> On 2009-08-03 at 20:25:06 [+0200], Ryan Leavengood wrote: > On Mon, Aug 3, 2009 at 5:56 AM, wrote: > > > > Added MediaConverter to the build. It still needs a nice new icon > > though... > > Are you working on the new icon, or would you like some help? No, please go ahead! :-) I am still busy with the FFmpeg encoder and writer... Best regards, -Stephan From zooey at mail.berlios.de Mon Aug 3 21:46:00 2009 From: zooey at mail.berlios.de (zooey at BerliOS) Date: Mon, 3 Aug 2009 21:46:00 +0200 Subject: [Haiku-commits] r32099 - haiku/trunk/src/kits/interface Message-ID: <200908031946.n73Jk0vJ022832@sheep.berlios.de> Author: zooey Date: 2009-08-03 21:46:00 +0200 (Mon, 03 Aug 2009) New Revision: 32099 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32099&view=rev Modified: haiku/trunk/src/kits/interface/ListView.cpp Log: Fixed two more peculiarities in ListView: * when items are removed, the anchor may need adjustment (fixes the problem in Beam reported by Stippi) * the check for needed adjustment of fLastSelected in _Select(from, to, extend) was broken, as it needs to be independent of fFirstSelected - this fixes broken navigation after doing a select-all Modified: haiku/trunk/src/kits/interface/ListView.cpp =================================================================== --- haiku/trunk/src/kits/interface/ListView.cpp 2009-08-03 19:11:14 UTC (rev 32098) +++ haiku/trunk/src/kits/interface/ListView.cpp 2009-08-03 19:46:00 UTC (rev 32099) @@ -671,6 +671,9 @@ if (fLastSelected != -1 && index < fLastSelected) fLastSelected--; + if (fAnchorIndex != -1 && index < fAnchorIndex) + fAnchorIndex--; + _RecalcItemTops(index); _InvalidateFrom(index); @@ -696,6 +699,9 @@ if (index < 0) return false; + if (fAnchorIndex != -1 && index < fAnchorIndex) + fAnchorIndex = index; + fList.RemoveItems(index, count); if (index < fList.CountItems()) _RecalcItemTops(index); @@ -1479,10 +1485,12 @@ if (fFirstSelected == -1) { fFirstSelected = from; fLastSelected = to; - } else if (from < fFirstSelected) - fFirstSelected = from; - else if (to > fLastSelected) - fLastSelected = to; + } else { + if (from < fFirstSelected) + fFirstSelected = from; + if (to > fLastSelected) + fLastSelected = to; + } for (int32 i = from; i <= to; ++i) { BListItem *item = ItemAt(i); From mmu_man at mail.berlios.de Mon Aug 3 21:53:18 2009 From: mmu_man at mail.berlios.de (mmu_man at mail.berlios.de) Date: Mon, 3 Aug 2009 21:53:18 +0200 Subject: [Haiku-commits] r32100 - haiku/trunk/src/system/boot/platform/u-boot Message-ID: <200908031953.n73JrIWD023639@sheep.berlios.de> Author: mmu_man Date: 2009-08-03 21:53:17 +0200 (Mon, 03 Aug 2009) New Revision: 32100 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32100&view=rev Modified: haiku/trunk/src/system/boot/platform/u-boot/start2.c Log: Initialize args.arguments on ARM too. Modified: haiku/trunk/src/system/boot/platform/u-boot/start2.c =================================================================== --- haiku/trunk/src/system/boot/platform/u-boot/start2.c 2009-08-03 19:46:00 UTC (rev 32099) +++ haiku/trunk/src/system/boot/platform/u-boot/start2.c 2009-08-03 19:53:17 UTC (rev 32100) @@ -102,6 +102,7 @@ // call C++ constructors before doing anything else call_ctors(); args.heap_size = HEAP_SIZE; + args.arguments = NULL; serial_init(); From ingo_weinhold at gmx.de Mon Aug 3 22:01:15 2009 From: ingo_weinhold at gmx.de (Ingo Weinhold) Date: Mon, 03 Aug 2009 22:01:15 +0200 Subject: [Haiku-commits] r32078 - in haiku/trunk: headers/os/app headers/os/interface headers/private/binary_compatibility headers/private/interface src/kits/interface src/tests/kits/interface In-Reply-To: <33779194933-BeMail@zon> References: <33779194933-BeMail@zon> Message-ID: <20090803220115.959.2@knochen-vm.localdomain> On 2009-08-03 at 18:22:22 [+0200], Axel D?rfler wrote: > Michael Weirauch wrote: > > starting BezillaBrowser or gvim on 32078 (VirtualBox) or 32080 > > (native) gives missing symbol error: > > _ZN5BView15_ReservedView11Ev. > > > > Seems related to this change. Anybody can confirm? > > It is related indeed - GCC4 software using BViews need to be > recompiled, only the GCC2 compatibility is retained. I think in cases like this we should just introduce the gcc 4 compatility symbol for the time being, so that the optional packages don't just break, and remove it again after branching for the release, which would be the point when all optional packages need to be rebuilt anyway. CU, Ingo From anevilyak at gmail.com Mon Aug 3 22:05:13 2009 From: anevilyak at gmail.com (Rene Gollent) Date: Mon, 3 Aug 2009 15:05:13 -0500 Subject: [Haiku-commits] r32078 - in haiku/trunk: headers/os/app headers/os/interface headers/private/binary_compatibility headers/private/interface src/kits/interface src/tests/kits/interface In-Reply-To: <20090803220115.959.2@knochen-vm.localdomain> References: <33779194933-BeMail@zon> <20090803220115.959.2@knochen-vm.localdomain> Message-ID: On Mon, Aug 3, 2009 at 3:01 PM, Ingo Weinhold wrote: > I think in cases like this we should just introduce the gcc 4 compatility > symbol for the time being, so that the optional packages don't just break, > and remove it again after branching for the release, which would be the > point when all optional packages need to be rebuilt anyway. Why is an app even linking to one of the ReservedVirtual symbols? Regards, Rene From superstippi at gmx.de Tue Aug 4 00:13:55 2009 From: superstippi at gmx.de (Stephan Assmus) Date: Tue, 04 Aug 2009 00:13:55 +0200 Subject: [Haiku-commits] r32078 - in haiku/trunk: headers/os/app headers/os/interface headers/private/binary_compatibility headers/private/interface src/kits/interface src/tests/kits/interface In-Reply-To: References: <33779194933-BeMail@zon> <20090803220115.959.2@knochen-vm.localdomain> Message-ID: <20090804001355.3567.5@bepc.1249330610.fake> On 2009-08-03 at 22:05:13 [+0200], Rene Gollent wrote: > On Mon, Aug 3, 2009 at 3:01 PM, Ingo Weinhold wrote: > > I think in cases like this we should just introduce the gcc 4 > > compatility symbol for the time being, so that the optional packages > > don't just break, and remove it again after branching for the release, > > which would be the point when all optional packages need to be rebuilt > > anyway. > > Why is an app even linking to one of the ReservedVirtual symbols? That's what I am thinking, too. I have not yet upgraded to the revision after the BToolTip introduction, but I am wondering if WonderBrush is affected as well (GCC2, but built on Haiku). Best regards, -Stephan From aldeck at mail.berlios.de Mon Aug 3 22:23:01 2009 From: aldeck at mail.berlios.de (aldeck at mail.berlios.de) Date: Mon, 3 Aug 2009 22:23:01 +0200 Subject: [Haiku-commits] r32101 - haiku/branches/developer/aldeck/tracker_refactor/src/kits/tracker Message-ID: <200908032023.n73KN1xx027294@sheep.berlios.de> Author: aldeck Date: 2009-08-03 22:22:56 +0200 (Mon, 03 Aug 2009) New Revision: 32101 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32101&view=rev Added: haiku/branches/developer/aldeck/tracker_refactor/src/kits/tracker/DebugSpatialCache.cpp haiku/branches/developer/aldeck/tracker_refactor/src/kits/tracker/DebugSpatialCache.h haiku/branches/developer/aldeck/tracker_refactor/src/kits/tracker/HashedSpatialCache.cpp haiku/branches/developer/aldeck/tracker_refactor/src/kits/tracker/HashedSpatialCache.h haiku/branches/developer/aldeck/tracker_refactor/src/kits/tracker/LinearSpatialCache.cpp haiku/branches/developer/aldeck/tracker_refactor/src/kits/tracker/LinearSpatialCache.h Modified: haiku/branches/developer/aldeck/tracker_refactor/src/kits/tracker/Jamfile haiku/branches/developer/aldeck/tracker_refactor/src/kits/tracker/PoseSpatialCache.cpp haiku/branches/developer/aldeck/tracker_refactor/src/kits/tracker/PoseSpatialCache.h haiku/branches/developer/aldeck/tracker_refactor/src/kits/tracker/PoseView.cpp haiku/branches/developer/aldeck/tracker_refactor/src/kits/tracker/PoseView.h Log: * Made PoseSpatialCache abstract. Moved current impl in LinearSpatialCache. * Added HashedSpatialCache (the impl is a copy of LinearSpatialCache atm). * Added DebugSpatialCache that helps to compare/validate implementations. Will probably put some time measurement there too. * Renamed PoseSpatialCache::Clear() to RemoveAllPoses() * Automatic whitespace cleanup Added: haiku/branches/developer/aldeck/tracker_refactor/src/kits/tracker/DebugSpatialCache.cpp =================================================================== --- haiku/branches/developer/aldeck/tracker_refactor/src/kits/tracker/DebugSpatialCache.cpp 2009-08-03 19:53:17 UTC (rev 32100) +++ haiku/branches/developer/aldeck/tracker_refactor/src/kits/tracker/DebugSpatialCache.cpp 2009-08-03 20:22:56 UTC (rev 32101) @@ -0,0 +1,99 @@ +/* + * Copyright 2009, Haiku Inc. All rights reserved. + * Distributed under the terms of the MIT License. + * + * Authors: + * Alexandre Deckner + */ + +#include "DebugSpatialCache.h" +#include "LinearSpatialCache.h" +#include "HashedSpatialCache.h" + +#include "Pose.h" +#include "PoseView.h" + + +DebugSpatialCache::DebugSpatialCache(BPoseView *parentPoseView) + : + fSpatialCache1(NULL), + fSpatialCache2(NULL) +{ + fSpatialCache1 = new LinearSpatialCache(parentPoseView); + fSpatialCache2 = new HashedSpatialCache(parentPoseView); +} + + +DebugSpatialCache::~DebugSpatialCache() +{ + delete fSpatialCache1; + delete fSpatialCache2; +} + + +void +DebugSpatialCache::AddPose(BPose* pose) +{ + fSpatialCache1->AddPose(pose); + fSpatialCache2->AddPose(pose); +} + + +void +DebugSpatialCache::RemovePose(BPose* pose) +{ + fSpatialCache1->RemovePose(pose); + fSpatialCache2->RemovePose(pose); +} + + +void +DebugSpatialCache::RemoveAllPoses() +{ + fSpatialCache1->RemoveAllPoses(); + fSpatialCache2->RemoveAllPoses(); +} + + +BPose* +DebugSpatialCache::FindUpperLeftPose() const +{ + BPose* pose1 = fSpatialCache1->FindUpperLeftPose(); + BPose* pose2 = fSpatialCache2->FindUpperLeftPose(); + if (pose1 != pose2) + printf("DebugSpatialCache::FindUpperLeftPose() different results!\n"); + return pose1; +} + + +PoseSet +DebugSpatialCache::FindIntersectingPoses(const BPoint &point) const +{ + PoseSet set1(fSpatialCache1->FindIntersectingPoses(point)); + PoseSet set2(fSpatialCache2->FindIntersectingPoses(point)); + if (set1 != set2) + printf("DebugSpatialCache::FindIntersectingPoses(BPoint) different results!\n"); + return set1; +} + + +PoseSet +DebugSpatialCache::FindIntersectingPoses(const BRect &rect) const +{ + PoseSet set1(fSpatialCache1->FindIntersectingPoses(rect)); + PoseSet set2(fSpatialCache2->FindIntersectingPoses(rect)); + if (set1 != set2) + printf("DebugSpatialCache::FindIntersectingPoses(BRect) different results!\n"); + return set1; +} + + +BRect +DebugSpatialCache::PosesExtent() const +{ + BRect rect1(fSpatialCache1->PosesExtent()); + BRect rect2(fSpatialCache2->PosesExtent()); + if (rect1 != rect1) + printf("DebugSpatialCache::PosesExtent() different results!\n"); + return rect1; +} Added: haiku/branches/developer/aldeck/tracker_refactor/src/kits/tracker/DebugSpatialCache.h =================================================================== --- haiku/branches/developer/aldeck/tracker_refactor/src/kits/tracker/DebugSpatialCache.h 2009-08-03 19:53:17 UTC (rev 32100) +++ haiku/branches/developer/aldeck/tracker_refactor/src/kits/tracker/DebugSpatialCache.h 2009-08-03 20:22:56 UTC (rev 32101) @@ -0,0 +1,46 @@ +/* + * Copyright 2009, Haiku Inc. All rights reserved. + * Distributed under the terms of the MIT License. + * + * Authors: + * Alexandre Deckner + */ +#ifndef _DEBUG_SPATIAL_CACHE_H +#define _DEBUG_SPATIAL_CACHE_H + +#include "PoseSpatialCache.h" + +#include + +//TODO debug + +namespace BPrivate { + +class BPose; +class BPoseView; + +class DebugSpatialCache : public PoseSpatialCache { +public: + DebugSpatialCache(BPoseView *parentPoseView); + virtual ~DebugSpatialCache(); + + virtual void AddPose(BPose* pose); + virtual void RemovePose(BPose* pose); + virtual void RemoveAllPoses(); + + virtual BPose* FindUpperLeftPose() const; + virtual PoseSet FindIntersectingPoses(const BPoint& point) const; + virtual PoseSet FindIntersectingPoses(const BRect& rect) const; + + virtual BRect PosesExtent() const; + +private: + PoseSpatialCache* fSpatialCache1; + PoseSpatialCache* fSpatialCache2; +}; + +} // namespace BPrivate + +using namespace BPrivate; + +#endif // _DEBUG_SPATIAL_CACHE_H Added: haiku/branches/developer/aldeck/tracker_refactor/src/kits/tracker/HashedSpatialCache.cpp =================================================================== --- haiku/branches/developer/aldeck/tracker_refactor/src/kits/tracker/HashedSpatialCache.cpp 2009-08-03 19:53:17 UTC (rev 32100) +++ haiku/branches/developer/aldeck/tracker_refactor/src/kits/tracker/HashedSpatialCache.cpp 2009-08-03 20:22:56 UTC (rev 32101) @@ -0,0 +1,107 @@ +/* + * Copyright 2009, Haiku Inc. All rights reserved. + * Distributed under the terms of the MIT License. + * + * Authors: + * Alexandre Deckner + */ + +#include "HashedSpatialCache.h" + +#include "Pose.h" +#include "PoseView.h" + +HashedSpatialCache::HashedSpatialCache(BPoseView *parentPoseView) + : + fPoseView(parentPoseView) +{ + +} + + +HashedSpatialCache::~HashedSpatialCache() +{ + +} + + +void +HashedSpatialCache::AddPose(BPose* pose) +{ + fPoses.insert(pose); +} + + +void +HashedSpatialCache::RemovePose(BPose* pose) +{ + fPoses.erase(pose); +} + + +void +HashedSpatialCache::RemoveAllPoses() +{ + fPoses.clear(); +} + + +BPose* +HashedSpatialCache::FindUpperLeftPose() const +{ + if (fPoses.empty()) + return NULL; + + + PoseSet::const_iterator it = fPoses.begin(); + BPoint min((*it)->Location(fPoseView)); + BPose* res = (*it); + + for(; it != fPoses.end(); it++) { + BPoint candidateMin((*it)->Location(fPoseView)); + if (candidateMin.x <= min.x && candidateMin.y <= min.y) { + res = (*it); + min = candidateMin; + } + } + return res; +} + + +PoseSet +HashedSpatialCache::FindIntersectingPoses(const BPoint &point) const +{ + PoseSet res; + PoseSet::const_iterator it = fPoses.begin(); + for(; it != fPoses.end(); it++) { + if ((*it)->PointInPose(fPoseView, point)) + res.insert(*it); + } + return res; +} + + +PoseSet +HashedSpatialCache::FindIntersectingPoses(const BRect &rect) const +{ + PoseSet res; + PoseSet::const_iterator it = fPoses.begin(); + for(; it != fPoses.end(); it++) { + BRect poseRect((*it)->CalcRect(fPoseView)); + if (rect.Intersects(poseRect)) + res.insert(*it); + } + return res; +} + + +BRect +HashedSpatialCache::PosesExtent() const +{ + BRect extent(LONG_MAX, LONG_MAX, LONG_MIN, LONG_MIN); + PoseSet::const_iterator it = fPoses.begin(); + for(; it != fPoses.end(); it++) { + extent = extent | (*it)->CalcRect(fPoseView); + } + return extent; +} Added: haiku/branches/developer/aldeck/tracker_refactor/src/kits/tracker/HashedSpatialCache.h =================================================================== --- haiku/branches/developer/aldeck/tracker_refactor/src/kits/tracker/HashedSpatialCache.h 2009-08-03 19:53:17 UTC (rev 32100) +++ haiku/branches/developer/aldeck/tracker_refactor/src/kits/tracker/HashedSpatialCache.h 2009-08-03 20:22:56 UTC (rev 32101) @@ -0,0 +1,46 @@ +/* + * Copyright 2009, Haiku Inc. All rights reserved. + * Distributed under the terms of the MIT License. + * + * Authors: + * Alexandre Deckner + */ +#ifndef _HASHED_SPATIAL_CACHE_H +#define _HASHED_SPATIAL_CACHE_H + +#include "PoseSpatialCache.h" + +#include + + +namespace BPrivate { + +class BPose; +class BPoseView; + + +class HashedSpatialCache : public PoseSpatialCache { +public: + HashedSpatialCache(BPoseView *parentPoseView); + virtual ~HashedSpatialCache(); + + virtual void AddPose(BPose* pose); + virtual void RemovePose(BPose* pose); + virtual void RemoveAllPoses(); + + virtual BPose* FindUpperLeftPose() const; + virtual PoseSet FindIntersectingPoses(const BPoint& point) const; + virtual PoseSet FindIntersectingPoses(const BRect& rect) const; + + virtual BRect PosesExtent() const; + +private: + PoseSet fPoses; + BPoseView* fPoseView; +}; + +} // namespace BPrivate + +using namespace BPrivate; + +#endif // _HASHED_SPATIAL_CACHE_H Modified: haiku/branches/developer/aldeck/tracker_refactor/src/kits/tracker/Jamfile =================================================================== --- haiku/branches/developer/aldeck/tracker_refactor/src/kits/tracker/Jamfile 2009-08-03 19:53:17 UTC (rev 32100) +++ haiku/branches/developer/aldeck/tracker_refactor/src/kits/tracker/Jamfile 2009-08-03 20:22:56 UTC (rev 32101) @@ -9,12 +9,12 @@ AddResources libtracker.so : TrackerIcons.rdef ; -SubDirC++Flags +SubDirC++Flags -D_BUILDING_tracker=1 -DOPEN_TRACKER=1 # -D_INCLUDES_CLASS_DEVICE_MAP=1 -D_SUPPORTS_RESOURCES=1 -D_SUPPORTS_FEATURE_SCRIPTING=1 -# -D_SILENTLY_CORRECT_FILE_NAMES=1 +# -D_SILENTLY_CORRECT_FILE_NAMES=1 ; local vector_icon_libs ; @@ -30,6 +30,7 @@ Bitmaps.cpp ContainerWindow.cpp CountView.cpp + DebugSpatialCache.cpp DeskWindow.cpp DesktopPoseView.cpp DialogPane.cpp @@ -46,9 +47,11 @@ FilePermissionsView.cpp FindPanel.cpp GroupedMenu.cpp + HashedSpatialCache.cpp IconCache.cpp IconMenuItem.cpp InfoWindow.cpp + LinearSpatialCache.cpp MimeTypeList.cpp MiniMenuField.cpp Model.cpp Added: haiku/branches/developer/aldeck/tracker_refactor/src/kits/tracker/LinearSpatialCache.cpp =================================================================== --- haiku/branches/developer/aldeck/tracker_refactor/src/kits/tracker/LinearSpatialCache.cpp 2009-08-03 19:53:17 UTC (rev 32100) +++ haiku/branches/developer/aldeck/tracker_refactor/src/kits/tracker/LinearSpatialCache.cpp 2009-08-03 20:22:56 UTC (rev 32101) @@ -0,0 +1,107 @@ +/* + * Copyright 2009, Haiku Inc. All rights reserved. + * Distributed under the terms of the MIT License. + * + * Authors: + * Alexandre Deckner + */ + +#include "LinearSpatialCache.h" + +#include "Pose.h" +#include "PoseView.h" + +LinearSpatialCache::LinearSpatialCache(BPoseView *parentPoseView) + : + fPoseView(parentPoseView) +{ + +} + + +LinearSpatialCache::~LinearSpatialCache() +{ + +} + + +void +LinearSpatialCache::AddPose(BPose* pose) +{ + fPoses.insert(pose); +} + + +void +LinearSpatialCache::RemovePose(BPose* pose) +{ + fPoses.erase(pose); +} + + +void +LinearSpatialCache::RemoveAllPoses() +{ + fPoses.clear(); +} + + +BPose* +LinearSpatialCache::FindUpperLeftPose() const +{ + if (fPoses.empty()) + return NULL; + + + PoseSet::const_iterator it = fPoses.begin(); + BPoint min((*it)->Location(fPoseView)); + BPose* res = (*it); + + for(; it != fPoses.end(); it++) { + BPoint candidateMin((*it)->Location(fPoseView)); + if (candidateMin.x <= min.x && candidateMin.y <= min.y) { + res = (*it); + min = candidateMin; + } + } + return res; +} + + +PoseSet +LinearSpatialCache::FindIntersectingPoses(const BPoint &point) const +{ + PoseSet res; + PoseSet::const_iterator it = fPoses.begin(); + for(; it != fPoses.end(); it++) { + if ((*it)->PointInPose(fPoseView, point)) + res.insert(*it); + } + return res; +} + + +PoseSet +LinearSpatialCache::FindIntersectingPoses(const BRect &rect) const +{ + PoseSet res; + PoseSet::const_iterator it = fPoses.begin(); + for(; it != fPoses.end(); it++) { + BRect poseRect((*it)->CalcRect(fPoseView)); + if (rect.Intersects(poseRect)) + res.insert(*it); + } + return res; +} + + +BRect +LinearSpatialCache::PosesExtent() const +{ + BRect extent(LONG_MAX, LONG_MAX, LONG_MIN, LONG_MIN); + PoseSet::const_iterator it = fPoses.begin(); + for(; it != fPoses.end(); it++) { + extent = extent | (*it)->CalcRect(fPoseView); + } + return extent; +} Added: haiku/branches/developer/aldeck/tracker_refactor/src/kits/tracker/LinearSpatialCache.h =================================================================== --- haiku/branches/developer/aldeck/tracker_refactor/src/kits/tracker/LinearSpatialCache.h 2009-08-03 19:53:17 UTC (rev 32100) +++ haiku/branches/developer/aldeck/tracker_refactor/src/kits/tracker/LinearSpatialCache.h 2009-08-03 20:22:56 UTC (rev 32101) @@ -0,0 +1,46 @@ +/* + * Copyright 2009, Haiku Inc. All rights reserved. + * Distributed under the terms of the MIT License. + * + * Authors: + * Alexandre Deckner + */ +#ifndef _LINEAR_SPATIAL_CACHE_H +#define _LINEAR_SPATIAL_CACHE_H + +#include "PoseSpatialCache.h" + +#include + + +namespace BPrivate { + +class BPose; +class BPoseView; + + +class LinearSpatialCache : public PoseSpatialCache { +public: + LinearSpatialCache(BPoseView *parentPoseView); + virtual ~LinearSpatialCache(); + + virtual void AddPose(BPose* pose); + virtual void RemovePose(BPose* pose); + virtual void RemoveAllPoses(); + + virtual BPose* FindUpperLeftPose() const; + virtual PoseSet FindIntersectingPoses(const BPoint& point) const; + virtual PoseSet FindIntersectingPoses(const BRect& rect) const; + + virtual BRect PosesExtent() const; + +private: + PoseSet fPoses; + BPoseView* fPoseView; +}; + +} // namespace BPrivate + +using namespace BPrivate; + +#endif // _LINEAR_SPATIAL_CACHE_H Modified: haiku/branches/developer/aldeck/tracker_refactor/src/kits/tracker/PoseSpatialCache.cpp =================================================================== --- haiku/branches/developer/aldeck/tracker_refactor/src/kits/tracker/PoseSpatialCache.cpp 2009-08-03 19:53:17 UTC (rev 32100) +++ haiku/branches/developer/aldeck/tracker_refactor/src/kits/tracker/PoseSpatialCache.cpp 2009-08-03 20:22:56 UTC (rev 32101) @@ -1,4 +1,4 @@ -/* +/* * Copyright 2009, Haiku Inc. All rights reserved. * Distributed under the terms of the MIT License. * @@ -11,104 +11,8 @@ #include "Pose.h" #include "PoseView.h" -PoseSpatialCache::PoseSpatialCache(BPoseView *parentPoseView) - : - fPoseView(parentPoseView) -{ -} - - PoseSpatialCache::~PoseSpatialCache() { } - - -void -PoseSpatialCache::AddPose(BPose* pose) -{ - fPoses.insert(pose); -} - - -void -PoseSpatialCache::RemovePose(BPose* pose) -{ - fPoses.erase(pose); -} - - -void -PoseSpatialCache::Clear() -{ - fPoses.clear(); -} - - -void -PoseSpatialCache::PoseMoved(BPose* pose) -{ - // will be used for better algorithms -} - - -BPose* -PoseSpatialCache::FindUpperLeftPose() const -{ - if (fPoses.empty()) - return NULL; - - - PoseSet::const_iterator it = fPoses.begin(); - BPoint min((*it)->Location(fPoseView)); - BPose* res = (*it); - - for(; it != fPoses.end(); it++) { - BPoint candidateMin((*it)->Location(fPoseView)); - if (candidateMin.x <= min.x && candidateMin.y <= min.y) { - res = (*it); - min = candidateMin; - } - } - return res; -} - - -PoseSet -PoseSpatialCache::FindIntersectingPoses(const BPoint &point) const -{ - PoseSet res; - PoseSet::const_iterator it = fPoses.begin(); - for(; it != fPoses.end(); it++) { - if ((*it)->PointInPose(fPoseView, point)) - res.insert(*it); - } - return res; -} - - -PoseSet -PoseSpatialCache::FindIntersectingPoses(const BRect &rect) const -{ - PoseSet res; - PoseSet::const_iterator it = fPoses.begin(); - for(; it != fPoses.end(); it++) { - BRect poseRect((*it)->CalcRect(fPoseView)); - if (rect.Intersects(poseRect)) - res.insert(*it); - } - return res; -} - - -BRect -PoseSpatialCache::PosesExtent() const -{ - BRect extent(LONG_MAX, LONG_MAX, LONG_MIN, LONG_MIN); - PoseSet::const_iterator it = fPoses.begin(); - for(; it != fPoses.end(); it++) { - extent = extent | (*it)->CalcRect(fPoseView); - } - return extent; -} Modified: haiku/branches/developer/aldeck/tracker_refactor/src/kits/tracker/PoseSpatialCache.h =================================================================== --- haiku/branches/developer/aldeck/tracker_refactor/src/kits/tracker/PoseSpatialCache.h 2009-08-03 19:53:17 UTC (rev 32100) +++ haiku/branches/developer/aldeck/tracker_refactor/src/kits/tracker/PoseSpatialCache.h 2009-08-03 20:22:56 UTC (rev 32101) @@ -1,4 +1,4 @@ -/* +/* * Copyright 2009, Haiku Inc. All rights reserved. * Distributed under the terms of the MIT License. * @@ -17,28 +17,22 @@ class BPose; class BPoseView; - + typedef std::set PoseSet; class PoseSpatialCache { public: - PoseSpatialCache(BPoseView* parentPoseView); - virtual ~PoseSpatialCache(); + virtual ~PoseSpatialCache(); - void AddPose(BPose* pose); - void RemovePose(BPose* pose); - void Clear(); - void PoseMoved(BPose* pose); + virtual void AddPose(BPose* pose) = 0; + virtual void RemovePose(BPose* pose) = 0; + virtual void RemoveAllPoses() = 0; - BPose* FindUpperLeftPose() const; - PoseSet FindIntersectingPoses(const BPoint& point) const; - PoseSet FindIntersectingPoses(const BRect& rect) const; - - BRect PosesExtent() const; + virtual BPose* FindUpperLeftPose() const = 0; + virtual PoseSet FindIntersectingPoses(const BPoint& point) const = 0; + virtual PoseSet FindIntersectingPoses(const BRect& rect) const = 0; -private: - PoseSet fPoses; - BPoseView* fPoseView; + virtual BRect PosesExtent() const = 0; }; } // namespace BPrivate Modified: haiku/branches/developer/aldeck/tracker_refactor/src/kits/tracker/PoseView.cpp =================================================================== --- haiku/branches/developer/aldeck/tracker_refactor/src/kits/tracker/PoseView.cpp 2009-08-03 19:53:17 UTC (rev 32100) +++ haiku/branches/developer/aldeck/tracker_refactor/src/kits/tracker/PoseView.cpp 2009-08-03 20:22:56 UTC (rev 32101) @@ -70,6 +70,7 @@ #include "Commands.h" #include "ContainerWindow.h" #include "CountView.h" +#include "DebugSpatialCache.h" #include "DeskWindow.h" #include "DesktopPoseView.h" #include "DirMenu.h" @@ -198,7 +199,7 @@ fModel(model), fActivePose(NULL), fPoseList(new PoseList(40, true)), - fPoseSpatialCache(this), + fPoseSpatialCache(NULL), fSelectionList(new PoseList()), fMimeTypesInSelectionCache(20, true), fZombieList(new BObjectList(10, true)), @@ -245,6 +246,7 @@ fViewState->SetViewMode(viewMode); fShowSelectionWhenInactive = TrackerSettings().ShowSelectionWhenInactive(); fTransparentSelection = TrackerSettings().TransparentSelection(); + fPoseSpatialCache = new DebugSpatialCache(this); } @@ -258,6 +260,7 @@ delete fViewState; delete fModel; delete fKeyRunner; + delete fPoseSpatialCache; IconCache::sIconCache->Deleting(this); } @@ -1636,7 +1639,7 @@ if (resultingPoses) resultingPoses[modelIndex] = NULL; continue; - } else + } else fInsertedNodes.insert(*(model->NodeRef())); if ((clipboardMode = FSClipboardFindNodeMode(model, false, true)) != 0 @@ -1656,7 +1659,7 @@ if (poseInfo->fInitedDirectory != -1LL) { PinPointToValidRange(poseInfo->fLocation); pose->SetLocation(poseInfo->fLocation, this); - fPoseSpatialCache.AddPose(pose); + fPoseSpatialCache->AddPose(pose); } BRect poseBounds; @@ -1740,7 +1743,7 @@ case kMiniIconMode: if (poseInfo->fInitedDirectory == -1LL || fAlwaysAutoPlace) { if (pose->HasLocation()) - fPoseSpatialCache.RemovePose(pose); + fPoseSpatialCache->RemovePose(pose); PlacePose(pose, viewBounds); @@ -1752,7 +1755,7 @@ if (!fAlwaysAutoPlace) pose->SetAutoPlaced(true); - fPoseSpatialCache.AddPose(pose); + fPoseSpatialCache->AddPose(pose); } // add item to list and draw if necessary @@ -1763,12 +1766,12 @@ if (fEnsurePosesVisible && !viewBounds.Intersects(poseBounds)) { viewBounds.InsetBy(20, 20); - fPoseSpatialCache.RemovePose(pose); + fPoseSpatialCache->RemovePose(pose); BPoint loc(pose->Location(this)); loc.ConstrainTo(viewBounds); pose->SetLocation(loc, this); pose->SetSaveLocation(); - fPoseSpatialCache.AddPose(pose); + fPoseSpatialCache->AddPose(pose); poseBounds = pose->CalcRect(this); viewBounds.InsetBy(-20, -20); } @@ -2840,7 +2843,7 @@ } else if (checkLocations && !IsValidLocation(pose)) { // this icon has a location, but needs to be remapped, because // it is going out of view for example - fPoseSpatialCache.RemovePose(pose); + fPoseSpatialCache->RemovePose(pose); newPoseList.AddItem(pose); } else if (iconSizeChanged) { // The pose location is still changed in view coordinates, @@ -2875,7 +2878,7 @@ for (int32 index = 0; index < count; index++) { BPose *pose = newPoseList.ItemAt(index); PlacePose(pose, bounds); - fPoseSpatialCache.AddPose(pose); + fPoseSpatialCache->AddPose(pose); } // sort poselist if we are switching to list mode @@ -3183,12 +3186,12 @@ BRect viewBounds(Bounds()); // relocate all poses in list (reset spatial cache) - fPoseSpatialCache.Clear(); + fPoseSpatialCache->RemoveAllPoses(); int32 count = fPoseList->CountItems(); for (int32 index = 0; index < count; index++) { BPose *pose = fPoseList->ItemAt(index); PlacePose(pose, viewBounds); - fPoseSpatialCache.AddPose(pose); + fPoseSpatialCache->AddPose(pose); } // scroll icons into view so that leftmost icon is "fOffset" from left @@ -3217,7 +3220,7 @@ // do we need to move pose to a grid location? if (newLocation != location) { // remove pose from VSlist so it doesn't "bump" into itself - fPoseSpatialCache.RemovePose(pose); + fPoseSpatialCache->RemovePose(pose); // try new grid location BRect oldBounds(pose->CalcRect(this)); @@ -3229,7 +3232,7 @@ poseBounds = pose->CalcRect(this); } - fPoseSpatialCache.AddPose(pose); + fPoseSpatialCache->AddPose(pose); if (viewBounds.Intersects(poseBounds)) Invalidate(poseBounds); @@ -3254,12 +3257,12 @@ bool checkValidLocation = IsDesktopWindow(); - // find an empty slot to put pose into + // find an empty slot to put pose into while (SlotOccupied(rect, viewBounds) // check good location on the desktop || (checkValidLocation && !IsValidLocation(rect))) { NextSlot(pose, rect, viewBounds); - } + } rect.InsetBy(3, 0); @@ -3342,13 +3345,13 @@ for (int32 index = 0; index < count; index++) { BPose *pose = fPoseList->ItemAt(index); if (pose->WasAutoPlaced()) { - fPoseSpatialCache.RemovePose(pose); + fPoseSpatialCache->RemovePose(pose); fHintLocation = pose->Location(this); BRect oldBounds(pose->CalcRect(this)); PlacePose(pose, viewBounds); BRect newBounds(pose->CalcRect(this)); - fPoseSpatialCache.AddPose(pose); + fPoseSpatialCache->AddPose(pose); pose->SetAutoPlaced(false); Invalidate(oldBounds); @@ -3393,7 +3396,7 @@ locationNeedsUpdating = true; Invalidate(pose->CalcRect(this)); // make sure the old icon gets erased - fPoseSpatialCache.RemovePose(pose); + fPoseSpatialCache->RemovePose(pose); pose->SetLocation(newLocation, this); // set the new location } @@ -3408,7 +3411,7 @@ if (!locationNeedsUpdating) { // didn't already invalidate and remove in the desktop case Invalidate(rect); - fPoseSpatialCache.RemovePose(pose); + fPoseSpatialCache->RemovePose(pose); } BPoint loc(pose->Location(this)); loc.ConstrainTo(bounds); @@ -3422,7 +3425,7 @@ if (locationNeedsUpdating) { // pose got reposition by one or both of the above pose->SetSaveLocation(); - fPoseSpatialCache.AddPose(pose); + fPoseSpatialCache->AddPose(pose); // add it at the new location Invalidate(pose->CalcRect(this)); // make sure the new pose location updates properly @@ -3434,17 +3437,17 @@ bool BPoseView::SlotOccupied(BRect poseRect, BRect viewBounds) const { - // TODO check that... + // TODO check that... // ## be sure to keep this code in sync with calls to NextSlot - // ## in terms of the comparison of fHintLocation and PinToGrid + // ## in terms of the comparison of fHintLocation and PinToGrid //if (poseRect.right >= viewBounds.right) { // BPoint point(viewBounds.left + fOffset.x, 0); // point = PinToGrid(point, fGrid, fOffset); // if (fHintLocation.x != point.x) // return true; - //} - - return !fPoseSpatialCache.FindIntersectingPoses(poseRect).empty(); + //} + + return !fPoseSpatialCache->FindIntersectingPoses(poseRect).empty(); } @@ -4497,14 +4500,14 @@ int32 count = targetView->fSelectionList->CountItems(); for (int32 index = 0; index < count; index++) { BPose *pose = targetView->fSelectionList->ItemAt(index); - targetView->fPoseSpatialCache.RemovePose(pose); + targetView->fPoseSpatialCache->RemovePose(pose); BPoint location (pose->Location(targetView) + delta); if (dropOnGrid) location = targetView->PinToGrid(location, targetView->fGrid, targetView->fOffset); pose->MoveTo(location, targetView); - targetView->fPoseSpatialCache.AddPose(pose); + targetView->fPoseSpatialCache->AddPose(pose); } return; @@ -5205,7 +5208,7 @@ PRINT(("converting model %s from a zombie\n", zombie->Name())); ConvertZombieToPose(zombie, index); } - } + } } else { zombie->StatChanged(); } @@ -6154,7 +6157,7 @@ // handle case where there is no current selection if (fSelectionList->IsEmpty()) { - return fPoseSpatialCache.FindUpperLeftPose(); + return fPoseSpatialCache->FindUpperLeftPose(); } BRect selectionRect(selectedPose->CalcRect(this)); @@ -6663,13 +6666,13 @@ } } else { BPoint offsetBy(-inner.LeftTop().x, -inner.LeftTop().y); - - PoseSet res = fPoseSpatialCache.FindIntersectingPoses(Bounds()); + + PoseSet res = fPoseSpatialCache->FindIntersectingPoses(Bounds()); PoseSet::iterator it = res.begin(); for (; it != res.end(); it++) { BPose* pose = (*it); BRect poseRect(pose->CalcRect(this)); - if (pose->IsSelected() && poseRect.Intersects(inner)) { + if (pose->IsSelected() && poseRect.Intersects(inner)) { pose->Draw(poseRect, poseRect, this, view, true, offsetBy, false); } @@ -6729,8 +6732,8 @@ } else { // get starting rect of clicked pose result = pose->CalcRect(this); - - PoseSet res = fPoseSpatialCache.FindIntersectingPoses(Bounds()); + + PoseSet res = fPoseSpatialCache->FindIntersectingPoses(Bounds()); PoseSet::iterator it = res.begin(); for (; it != res.end(); it++) { BPose* pose = (*it); @@ -6813,7 +6816,7 @@ // use current selection rectangle to scan poses if (ViewMode() == kListMode) SelectPosesListMode(fSelectionRect, &selectionList); - else { + else { SelectPosesIconMode(fSelectionRect); } @@ -6961,14 +6964,14 @@ BRect bounds(Bounds()); SetDrawingMode(B_OP_COPY); - - PoseSet poses = fPoseSpatialCache.FindIntersectingPoses(selectionRect); + + PoseSet poses = fPoseSpatialCache->FindIntersectingPoses(selectionRect); PoseSet::iterator it = poses.begin(); for (; it != poses.end(); it++) { BPose* pose = (*it); bool selected = pose->IsSelected(); - pose->Select(!fSelectionList->HasItem(pose)); + pose->Select(!fSelectionList->HasItem(pose)); [... truncated: 226 lines follow ...] From axeld at pinc-software.de Mon Aug 3 22:57:02 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Mon, 03 Aug 2009 22:57:02 +0200 CEST Subject: [Haiku-commits] =?utf-8?q?r32078_-_in_haiku/trunk=3A_headers/os/a?= =?utf-8?q?pp_headers/os/interface_headers/private/binary=5Fcompatibility_?= =?utf-8?q?headers/private/interface__src/kits/interface_src/tests/kits/in?= =?utf-8?q?terface?= In-Reply-To: <4A7723E6.1000509@bug-br.org.br> Message-ID: <50259744556-BeMail@zon> "Fran?ois Revol" wrote: > Why rename them anyway ? > This breaks Themes also. Bruno Albuquerque wrote: > BTW, Tooltip (without spaces) is a well recognized name (for example: > http://en.wikipedia.org/wiki/Tooltip). Changing the name of the > contants > from *TOOLTIP* to *TOOL_TIP* does not make much sense (and, as > Fran?ois > pointed out, has the potential to break things). Other than that, > tooltips are an welcome addition. In fact, maybe we should > automatically > add one to text that is automatically truncated and have ellipsis > added? > The tooltip would have the full text. Maybe "tooltip" will be adopted in dictionaries some day, to the best of my knowledge, this hasn't happened yet (and I don't regard Wikipedia as a reliable source for this). Also, it's called ToolTip in every API I looked at (incl. Dano), and it's spelled like this in our API as well. Hence, the TOOLTIP has been renamed as it's otherwise not consistent. The TOOLTIP constants were introduced in Dano, and therefore were never public API in Haiku - if you used them, it is really your own problem - this kind of thing will probably happen some more once we rework parts of our current private API to make it finally public. Bye, Axel. From axeld at pinc-software.de Mon Aug 3 23:01:57 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Mon, 03 Aug 2009 23:01:57 +0200 CEST Subject: [Haiku-commits] r32076 - in haiku/trunk: headers/private/kernel/boot src/system/boot/loader src/system/boot/platform/atari_m68k src/system/boot/platform/bios_ia32 src/system/boot/platform/openfirmware In-Reply-To: <744391145-BeMail@laptop> Message-ID: <50554207892-BeMail@zon> "Fran?ois Revol" wrote: > > So what? > > kernel settings are nothing you will have to change often or at > > all. > It's not so much about kernel settings. > More about passing args to the vm at boot time without requiring a > change on the image. For what? I understand what you can do with this, I just don't see the point. There are no settings besides the kernel settings last time I looked at, also. Bye, Axel. From revol at free.fr Mon Aug 3 23:14:36 2009 From: revol at free.fr (=?utf-8?q?Fran=C3=A7ois?= Revol) Date: Mon, 03 Aug 2009 23:14:36 +0200 CEST Subject: [Haiku-commits] r32076 - in haiku/trunk: headers/private/kernel/boot src/system/boot/loader src/system/boot/platform/atari_m68k src/system/boot/platform/bios_ia32 src/system/boot/platform/openfirmware In-Reply-To: <50554207892-BeMail@zon> Message-ID: <1973760389-BeMail@laptop> > "Fran?ois Revol" wrote: > > > So what? > > > kernel settings are nothing you will have to change often or at > > > all. > > It's not so much about kernel settings. > > More about passing args to the vm at boot time without requiring a > > change on the image. > > For what? I understand what you can do with this, I just don't see > the > point. > There are no settings besides the kernel settings last time I looked > at, also. - vesa default mode, - presetting a network interface, or even a vpn, - forcing keymap to match the one passed to qemu (for vnc), - setting the name of a script/app/test to run at boot... and those using grub could have more than 1 menu entries with different profiles. Like an "autodemo" profile that would start videos & GL demos at boot :D Fran?ois. From mmu_man at mail.berlios.de Mon Aug 3 23:17:06 2009 From: mmu_man at mail.berlios.de (mmu_man at mail.berlios.de) Date: Mon, 3 Aug 2009 23:17:06 +0200 Subject: [Haiku-commits] r32102 - in haiku/trunk: headers/private/kernel/arch/m68k src/system/kernel/arch/m68k Message-ID: <200908032117.n73LH6xj001122@sheep.berlios.de> Author: mmu_man Date: 2009-08-03 23:17:03 +0200 (Mon, 03 Aug 2009) New Revision: 32102 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32102&view=rev Modified: haiku/trunk/headers/private/kernel/arch/m68k/arch_vm.h haiku/trunk/src/system/kernel/arch/m68k/arch_030_mmu.cpp haiku/trunk/src/system/kernel/arch/m68k/arch_040_mmu.cpp haiku/trunk/src/system/kernel/arch/m68k/arch_vm_translation_map.cpp haiku/trunk/src/system/kernel/arch/m68k/arch_vm_translation_map_impl.cpp Log: Fix m68k build, still unimplemented. Modified: haiku/trunk/headers/private/kernel/arch/m68k/arch_vm.h =================================================================== --- haiku/trunk/headers/private/kernel/arch/m68k/arch_vm.h 2009-08-03 20:22:56 UTC (rev 32101) +++ haiku/trunk/headers/private/kernel/arch/m68k/arch_vm.h 2009-08-03 21:17:03 UTC (rev 32102) @@ -32,6 +32,8 @@ void (*m68k_unmap_address_range)(addr_t virtualAddress, size_t size); status_t (*m68k_remap_address_range)(addr_t *_virtualAddress, size_t size, bool unmap); #endif + bool (*arch_vm_translation_map_is_kernel_page_accessible)(addr_t virtualAddress, uint32 protection); + }; #ifdef __cplusplus Modified: haiku/trunk/src/system/kernel/arch/m68k/arch_030_mmu.cpp =================================================================== --- haiku/trunk/src/system/kernel/arch/m68k/arch_030_mmu.cpp 2009-08-03 20:22:56 UTC (rev 32101) +++ haiku/trunk/src/system/kernel/arch/m68k/arch_030_mmu.cpp 2009-08-03 21:17:03 UTC (rev 32102) @@ -45,4 +45,5 @@ m68k_unmap_address_range, m68k_remap_address_range #endif + m68k_vm_translation_map_is_kernel_page_accessible }; Modified: haiku/trunk/src/system/kernel/arch/m68k/arch_040_mmu.cpp =================================================================== --- haiku/trunk/src/system/kernel/arch/m68k/arch_040_mmu.cpp 2009-08-03 20:22:56 UTC (rev 32101) +++ haiku/trunk/src/system/kernel/arch/m68k/arch_040_mmu.cpp 2009-08-03 21:17:03 UTC (rev 32102) @@ -43,4 +43,5 @@ m68k_unmap_address_range, m68k_remap_address_range #endif + m68k_vm_translation_map_is_kernel_page_accessible }; Modified: haiku/trunk/src/system/kernel/arch/m68k/arch_vm_translation_map.cpp =================================================================== --- haiku/trunk/src/system/kernel/arch/m68k/arch_vm_translation_map.cpp 2009-08-03 20:22:56 UTC (rev 32101) +++ haiku/trunk/src/system/kernel/arch/m68k/arch_vm_translation_map.cpp 2009-08-03 21:17:03 UTC (rev 32102) @@ -159,3 +159,13 @@ } #endif + +bool +arch_vm_translation_map_is_kernel_page_accessible(addr_t virtualAddress, + uint32 protection) +{ + return get_vm_ops()-arch_vm_translation_map_is_kernel_page_accessible(virtualAddress, + protection); +} + + Modified: haiku/trunk/src/system/kernel/arch/m68k/arch_vm_translation_map_impl.cpp =================================================================== --- haiku/trunk/src/system/kernel/arch/m68k/arch_vm_translation_map_impl.cpp 2009-08-03 20:22:56 UTC (rev 32101) +++ haiku/trunk/src/system/kernel/arch/m68k/arch_vm_translation_map_impl.cpp 2009-08-03 21:17:03 UTC (rev 32102) @@ -1512,8 +1512,8 @@ } -bool -arch_vm_translation_map_is_kernel_page_accessible(addr_t virtualAddress, +static bool +m68k_vm_translation_map_is_kernel_page_accessible(addr_t virtualAddress, uint32 protection) { // TODO: Implement! From stippi at mail.berlios.de Mon Aug 3 23:32:04 2009 From: stippi at mail.berlios.de (stippi at mail.berlios.de) Date: Mon, 3 Aug 2009 23:32:04 +0200 Subject: [Haiku-commits] r32103 - haiku/trunk/src/add-ons/media/plugins/ffmpeg Message-ID: <200908032132.n73LW4sS003048@sheep.berlios.de> Author: stippi Date: 2009-08-03 23:32:03 +0200 (Mon, 03 Aug 2009) New Revision: 32103 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32103&view=rev Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatWriter.cpp Log: * AVWriter::StreamCookie::~StreamCookie() incorrectly freed packet data that it didn't own. * We are supposed to open the AVCodecContext in the writer, even though we never use it. According to libav-users mailing list, this is necessary, since that will allocate and initialize some structures that are later needed in av_write_header(). How this is supposed to work for encoders that libavcodec does not support, or which we don't know how to map, I do not yet know. For now it doesn't matter and resolves the problem that audio tracks report the wrong stream duration. * Some more improvements with regards to what information we need to fill out and which we don't. * Use more sensible defaults for the stream bitrate, so that we get better quality video by default. This and other parameters can be calculated when we implement setting the quality. Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp 2009-08-03 21:17:03 UTC (rev 32102) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp 2009-08-03 21:32:03 UTC (rev 32103) @@ -132,11 +132,16 @@ // fContext->gop_size = 12; // TODO: Fix pixel format or setup conversion method... fContext->pix_fmt = PIX_FMT_YUV420P; + + // TODO: Setup rate control: // fContext->rate_emu = 0; - // TODO: Setup rate control: // fContext->rc_eq = NULL; // fContext->rc_max_rate = 0; // fContext->rc_min_rate = 0; + // TODO: Try to calculate a good bit rate... + fContext->bit_rate = 800000; + + // Pixel aspect ratio fContext->sample_aspect_ratio.num = fInputFormat.u.raw_video.pixel_width_aspect; fContext->sample_aspect_ratio.den @@ -180,6 +185,8 @@ } else if (fInputFormat.type == B_MEDIA_RAW_AUDIO) { // frame rate fContext->sample_rate = (int)fInputFormat.u.raw_audio.frame_rate; + // NOTE: From the output_example.c, it looks like we are not supposed + // to set this. fContext->time_base.den = (int)fInputFormat.u.raw_audio.frame_rate; fContext->time_base.num = 1; // channels @@ -243,6 +250,17 @@ return B_NOT_SUPPORTED; } + // Add some known fixes from the FFmpeg API example: + if (fContext->codec_id == CODEC_ID_MPEG2VIDEO) { + // Just for testing, we also add B frames */ + fContext->max_b_frames = 2; + } else if (fContext->codec_id == CODEC_ID_MPEG1VIDEO){ + // Needed to avoid using macroblocks in which some coeffs overflow. + // This does not happen with normal video, it just happens here as + // the motion of the chroma plane does not match the luma plane. + fContext->mb_decision = 2; + } + // Open the codec int result = avcodec_open(fContext, fCodec); fCodecInitDone = (result >= 0); @@ -292,6 +310,11 @@ // #pragma mark - +static const int64 kNoPTSValue = 0x8000000000000000LL; + // NOTE: For some reasons, I have trouble with the avcodec.h define: + // #define AV_NOPTS_VALUE INT64_C(0x8000000000000000) + // INT64_C is not defined here. + status_t AVCodecEncoder::_EncodeAudio(const void* _buffer, int64 frameCount, media_encode_info* info) @@ -311,12 +334,6 @@ size_t inputFrameSize = inputSampleSize * fInputFormat.u.raw_audio.channel_count; - size_t outSampleSize = av_get_bits_per_sample_format( - fContext->sample_fmt) / 8; - size_t outSize = outSampleSize * fContext->channels; - TRACE(" sampleSize: %ld/%ld, frameSize: %ld/%ld\n", - inputSampleSize, inputFrameSize, outSampleSize, outSize); - size_t bufferSize = frameCount * inputFrameSize; bufferSize = min_c(bufferSize, kDefaultChunkBufferSize); @@ -342,6 +359,16 @@ return B_ERROR; } + // Maybe we need to use this PTS to calculate start_time: + if (fContext->coded_frame->pts != kNoPTSValue) { + TRACE(" codec frame PTS: %lld (codec time_base: %d/%d)\n", + fContext->coded_frame->pts, fContext->time_base.num, + fContext->time_base.den); + } else { + TRACE(" codec frame PTS: N/A (codec time_base: %d/%d)\n", + fContext->time_base.num, fContext->time_base.den); + } + // Setup media_encode_info, most important is the time stamp. info->start_time = (bigtime_t)(fFramesWritten * 1000000LL / fInputFormat.u.raw_audio.frame_rate); @@ -407,6 +434,16 @@ return B_ERROR; } + // Maybe we need to use this PTS to calculate start_time: + if (fContext->coded_frame->pts != kNoPTSValue) { + TRACE(" codec frame PTS: %lld (codec time_base: %d/%d)\n", + fContext->coded_frame->pts, fContext->time_base.num, + fContext->time_base.den); + } else { + TRACE(" codec frame PTS: N/A (codec time_base: %d/%d)\n", + fContext->time_base.num, fContext->time_base.den); + } + // Setup media_encode_info, most important is the time stamp. info->start_time = (bigtime_t)(fFramesWritten * 1000000LL / fInputFormat.u.raw_video.field_rate); Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatWriter.cpp =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatWriter.cpp 2009-08-03 21:17:03 UTC (rev 32102) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatWriter.cpp 2009-08-03 21:32:03 UTC (rev 32103) @@ -44,11 +44,13 @@ // TODO: This could depend on the BMediaFile creation flags, IIRC, // they allow to specify a buffering mode. +// NOTE: The following works around some weird bug in libavformat. We +// have to open the AVFormatContext->AVStream->AVCodecContext, even though +// we are not interested in donig any encoding here!! +#define OPEN_CODEC_CONTEXT 1 +#define GET_CONTEXT_DEFAULTS 0 -// #pragma mark - URLProtocol -// TODO: Do we need to write an URLProtocol? - // #pragma mark - AVFormatWriter::StreamCookie @@ -72,10 +74,10 @@ AVFormatContext* fContext; AVStream* fStream; AVPacket fPacket; + bool fCalculatePTS; // Since different threads may write to the target, // we need to protect the file position and I/O by a lock. BLocker* fStreamLock; - int64 fChunksWritten; }; @@ -85,16 +87,15 @@ : fContext(context), fStream(NULL), - fStreamLock(streamLock), - fChunksWritten(0) + fCalculatePTS(false), + fStreamLock(streamLock) { - av_new_packet(&fPacket, 0); + av_init_packet(&fPacket); } AVFormatWriter::StreamCookie::~StreamCookie() { - av_free_packet(&fPacket); } @@ -102,7 +103,7 @@ AVFormatWriter::StreamCookie::Init(const media_format* format, const media_codec_info* codecInfo) { - TRACE("AVFormatWriter::StreamCookie::Init()\n"); + TRACE("AVFormatWriter::StreamCookie::Init() (Yes, New)\n"); BAutolock _(fStreamLock); @@ -114,16 +115,26 @@ return B_ERROR; } +// TRACE(" fStream->codec: %p\n", fStream->codec); + // TODO: This is a hack for now! Use avcodec_find_encoder_by_name() + // or something similar... + fStream->codec->codec_id = (CodecID)codecInfo->sub_id; + // Setup the stream according to the media format... if (format->type == B_MEDIA_RAW_VIDEO) { - avcodec_get_context_defaults2(fStream->codec, CODEC_TYPE_VIDEO); + fStream->codec->codec_type = CODEC_TYPE_VIDEO; +#if GET_CONTEXT_DEFAULTS +// NOTE: API example does not do this: + avcodec_get_context_defaults(fStream->codec); +#endif // frame rate fStream->codec->time_base.den = (int)format->u.raw_video.field_rate; fStream->codec->time_base.num = 1; - fStream->r_frame_rate.den = (int)format->u.raw_video.field_rate; - fStream->r_frame_rate.num = 1; - fStream->time_base.den = (int)format->u.raw_video.field_rate; - fStream->time_base.num = 1; +// NOTE: API example does not do this: +// fStream->r_frame_rate.den = (int)format->u.raw_video.field_rate; +// fStream->r_frame_rate.num = 1; +// fStream->time_base.den = (int)format->u.raw_video.field_rate; +// fStream->time_base.num = 1; // video size fStream->codec->width = format->u.raw_video.display.line_width; fStream->codec->height = format->u.raw_video.display.line_count; @@ -142,8 +153,26 @@ fStream->codec->sample_aspect_ratio = fStream->sample_aspect_ratio; // TODO: Don't hard code this... fStream->codec->pix_fmt = PIX_FMT_YUV420P; + + // Some formats want stream headers to be separate + if ((fContext->oformat->flags & AVFMT_GLOBALHEADER) != 0) + fStream->codec->flags |= CODEC_FLAG_GLOBAL_HEADER; + + fCalculatePTS = true; } else if (format->type == B_MEDIA_RAW_AUDIO) { - avcodec_get_context_defaults2(fStream->codec, CODEC_TYPE_AUDIO); + fStream->codec->codec_type = CODEC_TYPE_AUDIO; +#if GET_CONTEXT_DEFAULTS +// NOTE: API example does not do this: + avcodec_get_context_defaults(fStream->codec); +#endif + // frame rate + fStream->codec->sample_rate = (int)format->u.raw_audio.frame_rate; +// NOTE: API example does not do this: +// fStream->codec->time_base.den = (int)format->u.raw_audio.frame_rate; +// fStream->codec->time_base.num = 1; +// fStream->time_base.den = (int)format->u.raw_audio.frame_rate; +// fStream->time_base.num = 1; + // channels fStream->codec->channels = format->u.raw_audio.channel_count; switch (format->u.raw_audio.format) { @@ -201,22 +230,14 @@ // The bits match 1:1 for media_multi_channels and FFmpeg defines. fStream->codec->channel_layout = format->u.raw_audio.channel_mask; } - // frame rate - fStream->codec->sample_rate = (int)format->u.raw_audio.frame_rate; - fStream->codec->time_base.den = (int)format->u.raw_audio.frame_rate; - fStream->codec->time_base.num = 1; - fStream->time_base.den = (int)format->u.raw_audio.frame_rate; - fStream->time_base.num = 1; + + fCalculatePTS = false; } TRACE(" stream->time_base: (%d/%d), codec->time_base: (%d/%d))\n", fStream->time_base.num, fStream->time_base.den, fStream->codec->time_base.num, fStream->codec->time_base.den); - // TODO: This is a hack for now! Use avcodec_find_encoder_by_name() - // or something similar... - fStream->codec->codec_id = (CodecID)codecInfo->sub_id; - return B_OK; } @@ -236,14 +257,17 @@ fPacket.data = const_cast((const uint8_t*)chunkBuffer); fPacket.size = chunkSize; - fPacket.pts = (encodeInfo->start_time - * fStream->time_base.den / fStream->time_base.num) / 1000000; - TRACE_PACKET(" PTS: %lld (stream->time_base: (%d/%d), " - "codec->time_base: (%d/%d))\n", fPacket.pts, - fStream->time_base.num, fStream->time_base.den, - fStream->codec->time_base.num, fStream->codec->time_base.den); + if (fCalculatePTS) { + fPacket.pts = (encodeInfo->start_time + * fStream->time_base.den / fStream->time_base.num) / 1000000; + TRACE_PACKET(" PTS: %lld (stream->time_base: (%d/%d), " + "codec->time_base: (%d/%d))\n", fPacket.pts, + fStream->time_base.num, fStream->time_base.den, + fStream->codec->time_base.num, fStream->codec->time_base.den); + } // From ffmpeg.c::do_audio_out(): +// TODO: // if (enc->coded_frame && enc->coded_frame->pts != AV_NOPTS_VALUE) // fPacket.pts = av_rescale_q(enc->coded_frame->pts, // enc->time_base, ost->st->time_base); @@ -299,6 +323,17 @@ { TRACE("AVFormatWriter::~AVFormatWriter\n"); + // Free the streams and close the AVCodecContexts + for(unsigned i = 0; i < fContext->nb_streams; i++) { +#if OPEN_CODEC_CONTEXT + // We only need to close the AVCodecContext when we opened it. + // This is experimental, see WriteHeader(). + avcodec_close(fContext->streams[i]->codec); +#endif + av_freep(&fContext->streams[i]->codec); + av_freep(&fContext->streams[i]); + } + av_free(fContext); delete[] fIOBuffer; @@ -365,8 +400,24 @@ if (fHeaderWritten) return B_NOT_ALLOWED; + // According to output_example.c, the output parameters must be set even + // if none are specified. In the example, this call is used after the + // streams have been created. + if (av_set_parameters(fContext, NULL) < 0) + return B_ERROR; + for (unsigned i = 0; i < fContext->nb_streams; i++) { AVStream* stream = fContext->streams[i]; +#if OPEN_CODEC_CONTEXT + // NOTE: Experimental, this should not be needed. Especially, since + // we have no idea (in the future) what CodecID some encoder uses, + // it may be an encoder from a different plugin. + AVCodecContext* codecContext = stream->codec; + AVCodec* codec = avcodec_find_encoder(codecContext->codec_id); + if (codec == NULL || avcodec_open(codecContext, codec) < 0) { + TRACE(" stream[%u] - failed to open AVCodecContext\n", i); + } +#endif TRACE(" stream[%u] time_base: (%d/%d), codec->time_base: (%d/%d)\n", i, stream->time_base.num, stream->time_base.den, stream->codec->time_base.num, stream->codec->time_base.den); @@ -424,6 +475,9 @@ { TRACE("AVFormatWriter::AllocateCookie()\n"); + if (fHeaderWritten) + return B_NOT_ALLOWED; + BAutolock _(fStreamLock); if (_cookie == NULL) From axeld at pinc-software.de Mon Aug 3 23:36:24 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Mon, 03 Aug 2009 23:36:24 +0200 CEST Subject: [Haiku-commits] r32078 - in haiku/trunk: headers/os/app headers/os/interface headers/private/binary_compatibility headers/private/interface src/kits/interface src/tests/kits/interface In-Reply-To: <20090803220115.959.2@knochen-vm.localdomain> Message-ID: <52621245669-BeMail@zon> Ingo Weinhold wrote: > On 2009-08-03 at 18:22:22 [+0200], Axel D?rfler > > wrote: > > It is related indeed - GCC4 software using BViews need to be > > recompiled, only the GCC2 compatibility is retained. > I think in cases like this we should just introduce the gcc 4 > compatility > symbol for the time being, so that the optional packages don't just > break, > and remove it again after branching for the release, which would be > the > point when all optional packages need to be rebuilt anyway. Yes, a temporary work-around would be a good solution. I forgot about GCC4 when I did that change, otherwise I would have mentioned it in the commit message at least. Bye, Axel. From axeld at pinc-software.de Mon Aug 3 23:37:34 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Mon, 03 Aug 2009 23:37:34 +0200 CEST Subject: [Haiku-commits] r32078 - in haiku/trunk: headers/os/app headers/os/interface headers/private/binary_compatibility headers/private/interface src/kits/interface src/tests/kits/interface In-Reply-To: <20090804001355.3567.5@bepc.1249330610.fake> Message-ID: <52691451024-BeMail@zon> Stephan Assmus wrote: > On 2009-08-03 at 22:05:13 [+0200], Rene Gollent > wrote: > > On Mon, Aug 3, 2009 at 3:01 PM, Ingo Weinhold > > wrote: > > > I think in cases like this we should just introduce the gcc 4 > > > compatility symbol for the time being, so that the optional > > > packages > > > don't just break, and remove it again after branching for the > > > release, > > > which would be the point when all optional packages need to be > > > rebuilt > > > anyway. > > Why is an app even linking to one of the ReservedVirtual symbols? > That's what I am thinking, too. I have not yet upgraded to the > revision > after the BToolTip introduction, but I am wondering if WonderBrush is > affected as well (GCC2, but built on Haiku). As I said, for GCC2 the compatibility is retained - it doesn't matter where it has been compiled. The virtuals are obviously used to build the vtable of subclasses of BView. Bye, Axel. From axeld at pinc-software.de Mon Aug 3 23:48:44 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Mon, 03 Aug 2009 23:48:44 +0200 CEST Subject: [Haiku-commits] r32076 - in haiku/trunk: headers/private/kernel/boot src/system/boot/loader src/system/boot/platform/atari_m68k src/system/boot/platform/bios_ia32 src/system/boot/platform/openfirmware In-Reply-To: <1973760389-BeMail@laptop> Message-ID: <53361267687-BeMail@zon> "Fran?ois Revol" wrote: > > For what? I understand what you can do with this, I just don't see > > the point. > > There are no settings besides the kernel settings last time I > > looked > > at, also. > - vesa default mode, Which is already part of the current settings. > - presetting a network interface, or even a vpn, > - forcing keymap to match the one passed to qemu (for vnc), > - setting the name of a script/app/test to run at boot... > > and those using grub could have more than 1 menu entries with > different > profiles. > Like an "autodemo" profile that would start videos & GL demos at boot > :D For which they need to change the image anyway, as otherwise that stuff is not supported. Even if it's not completely useless, it has a very limited use, and will probably never be used by more than 3 people. You included ;-) Anyway, I'm mostly worried because our boot loader (incl. the boot modules) is already too fat to fit onto an 1.44 MB boot image, and it seems this prevents the CD from booting on certain hardware. We should really try to restrict it to 1.44 MB if at all possible - multiboot support doesn't take much space, granted, but it doesn't really bring anything valuable either to the table. Either way, that's an issue to be solved. Bye, Axel. From bga at mail.berlios.de Mon Aug 3 23:54:26 2009 From: bga at mail.berlios.de (bga at mail.berlios.de) Date: Mon, 3 Aug 2009 23:54:26 +0200 Subject: [Haiku-commits] r32104 - haiku/trunk/src/preferences/screen Message-ID: <200908032154.n73LsQTr005325@sheep.berlios.de> Author: bga Date: 2009-08-03 23:54:14 +0200 (Mon, 03 Aug 2009) New Revision: 32104 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32104&view=rev Modified: haiku/trunk/src/preferences/screen/ScreenWindow.cpp Log: - Fix small typo. Is it intentional that Horizontal Frequency is reported as being KHz while Vertical Frequency is reported as being Hz? Modified: haiku/trunk/src/preferences/screen/ScreenWindow.cpp =================================================================== --- haiku/trunk/src/preferences/screen/ScreenWindow.cpp 2009-08-03 21:32:03 UTC (rev 32103) +++ haiku/trunk/src/preferences/screen/ScreenWindow.cpp 2009-08-03 21:54:14 UTC (rev 32104) @@ -1116,7 +1116,7 @@ && info.min_vertical_frequency != 0 && info.max_pixel_clock != 0) { snprintf(text, sizeof(text), "Horizonal Frequency:\t%lu - %lu kHz\n" - "VerticalFrequency:\t%lu - %lu Hz\n\n" + "Vertical Frequency:\t%lu - %lu Hz\n\n" "Maximum Pixel Clock:\t%g MHz", info.min_horizontal_frequency, info.max_horizontal_frequency, info.min_vertical_frequency, info.max_vertical_frequency, info.max_pixel_clock / 1000.0); From stippi at mail.berlios.de Tue Aug 4 00:53:55 2009 From: stippi at mail.berlios.de (stippi at mail.berlios.de) Date: Tue, 4 Aug 2009 00:53:55 +0200 Subject: [Haiku-commits] r32105 - in haiku/trunk/src/add-ons/media/plugins/ffmpeg: . libavcodec Message-ID: <200908032253.n73MrtF8028292@sheep.berlios.de> Author: stippi Date: 2009-08-04 00:53:52 +0200 (Tue, 04 Aug 2009) New Revision: 32105 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32105&view=rev Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.h haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatWriter.cpp haiku/trunk/src/add-ons/media/plugins/ffmpeg/EncoderTable.cpp haiku/trunk/src/add-ons/media/plugins/ffmpeg/config.h haiku/trunk/src/add-ons/media/plugins/ffmpeg/libavcodec/Jamfile Log: Now supports encoded audio. Added Dolby Digital (AC-3) encoding to test this. Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp 2009-08-03 21:54:14 UTC (rev 32104) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp 2009-08-03 22:53:52 UTC (rev 32105) @@ -9,6 +9,7 @@ #include #include +#include extern "C" { #include "rational.h" @@ -46,9 +47,11 @@ TRACE("AVCodecEncoder::AVCodecEncoder()\n"); fCodec = avcodec_find_encoder((enum CodecID)codecID); - TRACE(" found AVCodec: %p\n", fCodec); + TRACE(" found AVCodec for %lu: %p\n", codecID, fCodec); memset(&fInputFormat, 0, sizeof(media_format)); + + av_fifo_init(&fAudioFifo, 0); } @@ -337,63 +340,81 @@ size_t bufferSize = frameCount * inputFrameSize; bufferSize = min_c(bufferSize, kDefaultChunkBufferSize); - while (frameCount > 0) { - if (frameCount < fContext->frame_size) { - TRACE(" ERROR: too few frames left! (left: %lld, needed: %d)\n", - frameCount, fContext->frame_size); - // TODO: Handle this some way. Maybe use an av_fifo to buffer data? - return B_ERROR; - } + if (fContext->frame_size > 1) { + // Encoded audio. Things work differently from raw audio. We need + // the fAudioFifo to pipe data. + if (av_fifo_realloc2(&fAudioFifo, + av_fifo_size(&fAudioFifo) + bufferSize) < 0) { + TRACE(" av_fifo_realloc2() failed\n"); + return B_NO_MEMORY; + } + av_fifo_generic_write(&fAudioFifo, const_cast(buffer), + bufferSize, NULL); - int chunkFrames = fContext->frame_size; + int frameBytes = fContext->frame_size * inputFrameSize; + uint8* tempBuffer = new(std::nothrow) uint8[frameBytes]; + if (tempBuffer == NULL) + return B_NO_MEMORY; - TRACE(" frames left: %lld, chunk frames: %d\n", - frameCount, chunkFrames); + // Encode as many chunks as can be read from the FIFO. + while (av_fifo_size(&fAudioFifo) >= frameBytes) { + av_fifo_read(&fAudioFifo, tempBuffer, frameBytes); - // Encode one audio chunk/frame. - int usedBytes = avcodec_encode_audio(fContext, fChunkBuffer, - bufferSize, reinterpret_cast(buffer)); - - if (usedBytes < 0) { - TRACE(" avcodec_encode_video() failed: %d\n", usedBytes); - return B_ERROR; + ret = _EncodeAudio(tempBuffer, frameBytes, fContext->frame_size, + info); + if (ret != B_OK) + break; } + } else { + // Raw audio. The number of bytes returned from avcodec_encode_audio() + // is always the same as the number of input bytes. + return _EncodeAudio(buffer, bufferSize, frameCount, + info); + } - // Maybe we need to use this PTS to calculate start_time: - if (fContext->coded_frame->pts != kNoPTSValue) { - TRACE(" codec frame PTS: %lld (codec time_base: %d/%d)\n", - fContext->coded_frame->pts, fContext->time_base.num, - fContext->time_base.den); - } else { - TRACE(" codec frame PTS: N/A (codec time_base: %d/%d)\n", - fContext->time_base.num, fContext->time_base.den); - } + return ret; +} - // Setup media_encode_info, most important is the time stamp. - info->start_time = (bigtime_t)(fFramesWritten * 1000000LL - / fInputFormat.u.raw_audio.frame_rate); - // Write the chunk - ret = WriteChunk(fChunkBuffer, usedBytes, info); - if (ret != B_OK) - break; +status_t +AVCodecEncoder::_EncodeAudio(const uint8* buffer, size_t bufferSize, + int64 frameCount, media_encode_info* info) +{ + // Encode one audio chunk/frame. The bufferSize has already been adapted + // to the needed size for fContext->frame_size, or we are writing raw + // audio. + int usedBytes = avcodec_encode_audio(fContext, fChunkBuffer, + bufferSize, reinterpret_cast(buffer)); - size_t framesWritten = usedBytes / inputFrameSize; - if (chunkFrames == 1) { - // For PCM data: - framesWritten = usedBytes / inputFrameSize; - } else { - // For encoded audio: - framesWritten = chunkFrames * inputFrameSize; - } + if (usedBytes < 0) { + TRACE(" avcodec_encode_video() failed: %d\n", usedBytes); + return B_ERROR; + } - // Skip to next chunk of buffer. - fFramesWritten += framesWritten; - frameCount -= framesWritten; - buffer += usedBytes; + // Maybe we need to use this PTS to calculate start_time: + if (fContext->coded_frame->pts != kNoPTSValue) { + TRACE(" codec frame PTS: %lld (codec time_base: %d/%d)\n", + fContext->coded_frame->pts, fContext->time_base.num, + fContext->time_base.den); + } else { + TRACE(" codec frame PTS: N/A (codec time_base: %d/%d)\n", + fContext->time_base.num, fContext->time_base.den); } - return ret; + // Setup media_encode_info, most important is the time stamp. + info->start_time = (bigtime_t)(fFramesWritten * 1000000LL + / fInputFormat.u.raw_audio.frame_rate); + + // Write the chunk + status_t ret = WriteChunk(fChunkBuffer, usedBytes, info); + if (ret != B_OK) { + TRACE(" error writing chunk: %s\n", strerror(ret)); + return ret; + } + + fFramesWritten += frameCount; + + return B_OK; } @@ -450,8 +471,10 @@ // Write the chunk ret = WriteChunk(fChunkBuffer, usedBytes, info); - if (ret != B_OK) + if (ret != B_OK) { + TRACE(" error writing chunk: %s\n", strerror(ret)); break; + } // Skip to the next frame (but usually, there is only one to encode // for video). Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.h =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.h 2009-08-03 21:54:14 UTC (rev 32104) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.h 2009-08-03 22:53:52 UTC (rev 32105) @@ -11,6 +11,7 @@ extern "C" { #include "avcodec.h" #include "swscale.h" + #include "libavutil/fifo.h" } #include "EncoderPlugin.h" @@ -36,10 +37,17 @@ virtual status_t Encode(const void* buffer, int64 frameCount, media_encode_info* info); + // TODO: Turns out we need Flush() after all. We buffer encoded audio + // in a FIFO, since the user suggested buffer size may not fit the + // codec buffer size. + private: status_t _EncodeAudio(const void* buffer, int64 frameCount, media_encode_info* info); + status_t _EncodeAudio(const uint8* buffer, + size_t bufferSize, int64 frameCount, + media_encode_info* info); status_t _EncodeVideo(const void* buffer, int64 frameCount, @@ -54,11 +62,15 @@ AVCodecContext* fContext; bool fCodecInitDone; + // For video (color space conversion): AVPicture fSrcFrame; AVPicture fDstFrame; AVFrame* fFrame; SwsContext* fSwsContext; + // For encoded audio: + AVFifoBuffer fAudioFifo; + int64 fFramesWritten; uint8* fChunkBuffer; Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatWriter.cpp =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatWriter.cpp 2009-08-03 21:54:14 UTC (rev 32104) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatWriter.cpp 2009-08-03 22:53:52 UTC (rev 32105) @@ -103,7 +103,7 @@ AVFormatWriter::StreamCookie::Init(const media_format* format, const media_codec_info* codecInfo) { - TRACE("AVFormatWriter::StreamCookie::Init() (Yes, New)\n"); + TRACE("AVFormatWriter::StreamCookie::Init()\n"); BAutolock _(fStreamLock); Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/EncoderTable.cpp =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/EncoderTable.cpp 2009-08-03 21:54:14 UTC (rev 32104) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/EncoderTable.cpp 2009-08-03 22:53:52 UTC (rev 32105) @@ -59,6 +59,18 @@ B_ANY_FORMAT_FAMILY, B_MEDIA_RAW_AUDIO, B_MEDIA_ENCODED_AUDIO + }, + { + { + "Dolby Digital (AC-3)", + "ac3", + 0, + CODEC_ID_AC3, + { 0 } + }, + B_ANY_FORMAT_FAMILY, + B_MEDIA_RAW_AUDIO, + B_MEDIA_ENCODED_AUDIO } }; Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/config.h =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/config.h 2009-08-03 21:54:14 UTC (rev 32104) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/config.h 2009-08-03 22:53:52 UTC (rev 32105) @@ -431,7 +431,7 @@ #define CONFIG_WMV2_ENCODER 0 #define CONFIG_ZLIB_ENCODER 0 #define CONFIG_ZMBV_ENCODER 0 -#define CONFIG_AC3_ENCODER 0 +#define CONFIG_AC3_ENCODER 1 #define CONFIG_ALAC_ENCODER 0 #define CONFIG_FLAC_ENCODER 0 #define CONFIG_MP2_ENCODER 0 Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/libavcodec/Jamfile =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/libavcodec/Jamfile 2009-08-03 21:54:14 UTC (rev 32104) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/libavcodec/Jamfile 2009-08-03 22:53:52 UTC (rev 32105) @@ -29,6 +29,7 @@ ac3_parser.c ac3dec.c ac3dec_data.c + ac3enc.c ac3tab.c acelp_filters.c acelp_pitch_delay.c From stippi at mail.berlios.de Tue Aug 4 00:59:27 2009 From: stippi at mail.berlios.de (stippi at mail.berlios.de) Date: Tue, 4 Aug 2009 00:59:27 +0200 Subject: [Haiku-commits] r32106 - haiku/trunk/src/add-ons/media/plugins/ffmpeg Message-ID: <200908032259.n73MxRN5002028@sheep.berlios.de> Author: stippi Date: 2009-08-04 00:59:23 +0200 (Tue, 04 Aug 2009) New Revision: 32106 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32106&view=rev Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp Log: Free the AVFifoBuffer data in the destructor... Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp 2009-08-03 22:53:52 UTC (rev 32105) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp 2009-08-03 22:59:23 UTC (rev 32106) @@ -64,6 +64,8 @@ sws_freeContext(fSwsContext); + av_fifo_free(&fAudioFifo); + avpicture_free(&fDstFrame); // NOTE: Do not use avpicture_free() on fSrcFrame!! We fill the picture // data on the file with the media buffer data passed to Encode(). From anevilyak at gmail.com Tue Aug 4 01:35:29 2009 From: anevilyak at gmail.com (Rene Gollent) Date: Mon, 3 Aug 2009 18:35:29 -0500 Subject: [Haiku-commits] r32104 - haiku/trunk/src/preferences/screen In-Reply-To: <200908032154.n73LsQTr005325@sheep.berlios.de> References: <200908032154.n73LsQTr005325@sheep.berlios.de> Message-ID: On Mon, Aug 3, 2009 at 4:54 PM, wrote: > > Is it intentional that Horizontal Frequency is reported as being KHz while > Vertical Frequency is reported as being Hz? Yes, the horizontal frequency is in fact a measure of scan frequency, ergo number of pixels scanned per second. (+ roughly 5% for the overhead of moving the beam back to the left side after each line). Another way of looking at it is if you divide the horizontal scan frequency by (1.05 * number of horizontal lines), you will get the corresponding vertical refresh. Regards, Rene From stefano.ceccherini at gmail.com Tue Aug 4 08:25:40 2009 From: stefano.ceccherini at gmail.com (Stefano Ceccherini) Date: Tue, 4 Aug 2009 08:25:40 +0200 Subject: [Haiku-commits] r32087 - haiku/trunk/src/servers/app In-Reply-To: <200908031650.n73Go5ZQ012985@sheep.berlios.de> References: <200908031650.n73Go5ZQ012985@sheep.berlios.de> Message-ID: <894b9700908032325n3ca4c9ebsbeecd114eb1292cf@mail.gmail.com> 2009/8/3 : > +public: > ? ? ? ? ? ? ? ? ? ? ? ?void ? ? ? ? ? ? ? ? ? ? ? ? ? ?_UpdateCurrentDrawingRegion(); > - > +private: Sorry, this was a leftover and wasn't meant to be committed. I'll remove it again later, if no one beats me. From stippi at mail.berlios.de Tue Aug 4 09:21:26 2009 From: stippi at mail.berlios.de (stippi at mail.berlios.de) Date: Tue, 4 Aug 2009 09:21:26 +0200 Subject: [Haiku-commits] r32107 - haiku/trunk/src/add-ons/media/plugins/ffmpeg Message-ID: <200908040721.n747LQLC013616@sheep.berlios.de> Author: stippi Date: 2009-08-04 09:21:22 +0200 (Tue, 04 Aug 2009) New Revision: 32107 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32107&view=rev Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecDecoder.cpp Log: I have no idea how that ended up there... set the decoded audio format correctly again. Should fix playback of any file where the ffmpeg plugin was responsible for sound. (The symptoms were a crash into the debugger because of an unspecified audio format...) Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecDecoder.cpp =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecDecoder.cpp 2009-08-03 22:59:23 UTC (rev 32106) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecDecoder.cpp 2009-08-04 07:21:22 UTC (rev 32107) @@ -334,7 +334,7 @@ = fInputFormat.u.encoded_audio.output.frame_rate; outputAudioFormat.channel_count = fInputFormat.u.encoded_audio.output.channel_count; - outputAudioFormat.format = fInputFormat.u.encoded_audio.output.format; + outputAudioFormat.format = media_raw_audio_format::B_AUDIO_SHORT; outputAudioFormat.buffer_size = 1024 * fInputFormat.u.encoded_audio.output.channel_count; inOutFormat->type = B_MEDIA_RAW_AUDIO; From stippi at mail.berlios.de Tue Aug 4 09:58:37 2009 From: stippi at mail.berlios.de (stippi at mail.berlios.de) Date: Tue, 4 Aug 2009 09:58:37 +0200 Subject: [Haiku-commits] r32108 - haiku/trunk/src/kits/media Message-ID: <200908040758.n747wb8v019180@sheep.berlios.de> Author: stippi Date: 2009-08-04 09:58:32 +0200 (Tue, 04 Aug 2009) New Revision: 32108 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32108&view=rev Modified: haiku/trunk/src/kits/media/MediaFile.cpp Log: Don't leak the MediaWriter instance. Modified: haiku/trunk/src/kits/media/MediaFile.cpp =================================================================== --- haiku/trunk/src/kits/media/MediaFile.cpp 2009-08-04 07:21:22 UTC (rev 32107) +++ haiku/trunk/src/kits/media/MediaFile.cpp 2009-08-04 07:58:32 UTC (rev 32108) @@ -391,14 +391,14 @@ fTrackNum = 0; fTrackList = NULL; fExtractor = NULL; + fWriter = NULL; + fWriterID = 0; fErr = B_OK; fDeleteSource = false; // not used so far: fEncoderMgr = NULL; fWriterMgr = NULL; - fWriter = NULL; - fWriterID = 0; fFileClosed = false; } @@ -412,6 +412,8 @@ fTrackNum = 0; delete fExtractor; fExtractor = NULL; + delete fWriter; + fWriter = NULL; if (fDeleteSource) { delete fSource; fSource = NULL; From pulkomandy at mail.berlios.de Tue Aug 4 10:11:57 2009 From: pulkomandy at mail.berlios.de (pulkomandy at BerliOS) Date: Tue, 4 Aug 2009 10:11:57 +0200 Subject: [Haiku-commits] r32109 - in haiku/branches/components/gsoc-locale-kit: headers/libs/icu/unicode src/libs/icu/source/i18n Message-ID: <200908040811.n748BvSN020308@sheep.berlios.de> Author: pulkomandy Date: 2009-08-04 10:11:54 +0200 (Tue, 04 Aug 2009) New Revision: 32109 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32109&view=rev Added: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/basictz.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/bms.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/bmsearch.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/calendar.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/choicfmt.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/coleitr.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/coll.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/colldata.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/curramt.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/currpinf.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/currunit.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/datefmt.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/dcfmtsym.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/decimfmt.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/dtfmtsym.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/dtitvfmt.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/dtitvinf.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/dtptngen.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/dtrule.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/fieldpos.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/fmtable.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/format.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/gregocal.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/measfmt.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/measunit.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/measure.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/msgfmt.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/numfmt.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/numsys.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/plurfmt.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/plurrule.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/rbnf.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/rbtz.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/regex.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/search.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/simpletz.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/smpdtfmt.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/sortkey.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/stsearch.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/tblcoll.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/timezone.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/tmunit.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/tmutamt.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/tmutfmt.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/translit.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/tzrule.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/tztrans.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/ucal.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/ucol.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/ucoleitr.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/ucsdet.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/ucurr.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/udat.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/udatpg.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/ulocdata.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/umsg.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/unirepl.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/unum.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/uregex.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/usearch.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/uspoof.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/utmscale.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/utrans.h haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/vtzone.h Removed: haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/ Log: Move icu i18n headers to the proper directory. Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/basictz.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/basictz.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/bms.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/bms.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/bmsearch.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/bmsearch.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/calendar.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/calendar.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/choicfmt.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/choicfmt.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/coleitr.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/coleitr.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/coll.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/coll.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/colldata.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/colldata.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/curramt.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/curramt.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/currpinf.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/currpinf.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/currunit.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/currunit.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/datefmt.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/datefmt.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/dcfmtsym.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/dcfmtsym.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/decimfmt.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/decimfmt.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/dtfmtsym.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/dtfmtsym.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/dtitvfmt.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/dtitvfmt.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/dtitvinf.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/dtitvinf.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/dtptngen.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/dtptngen.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/dtrule.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/dtrule.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/fieldpos.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/fieldpos.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/fmtable.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/fmtable.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/format.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/format.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/gregocal.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/gregocal.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/measfmt.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/measfmt.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/measunit.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/measunit.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/measure.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/measure.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/msgfmt.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/msgfmt.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/numfmt.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/numfmt.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/numsys.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/numsys.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/plurfmt.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/plurfmt.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/plurrule.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/plurrule.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/rbnf.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/rbnf.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/rbtz.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/rbtz.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/regex.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/regex.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/search.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/search.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/simpletz.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/simpletz.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/smpdtfmt.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/smpdtfmt.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/sortkey.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/sortkey.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/stsearch.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/stsearch.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/tblcoll.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/tblcoll.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/timezone.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/timezone.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/tmunit.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/tmunit.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/tmutamt.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/tmutamt.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/tmutfmt.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/tmutfmt.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/translit.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/translit.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/tzrule.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/tzrule.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/tztrans.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/tztrans.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/ucal.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/ucal.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/ucol.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/ucol.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/ucoleitr.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/ucoleitr.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/ucsdet.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/ucsdet.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/ucurr.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/ucurr.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/udat.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/udat.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/udatpg.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/udatpg.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/ulocdata.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/ulocdata.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/umsg.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/umsg.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/unirepl.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/unirepl.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/unum.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/unum.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/uregex.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/uregex.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/usearch.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/usearch.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/uspoof.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/uspoof.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/utmscale.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/utmscale.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/utrans.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/utrans.h) Copied: haiku/branches/components/gsoc-locale-kit/headers/libs/icu/unicode/vtzone.h (from rev 32107, haiku/branches/components/gsoc-locale-kit/src/libs/icu/source/i18n/unicode/vtzone.h) From mmu_man at mail.berlios.de Tue Aug 4 11:00:22 2009 From: mmu_man at mail.berlios.de (mmu_man at mail.berlios.de) Date: Tue, 4 Aug 2009 11:00:22 +0200 Subject: [Haiku-commits] r32110 - haiku/trunk/src/system/boot/loader Message-ID: <200908040900.n7490MhG000165@sheep.berlios.de> Author: mmu_man Date: 2009-08-04 11:00:10 +0200 (Tue, 04 Aug 2009) New Revision: 32110 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32110&view=rev Modified: haiku/trunk/src/system/boot/loader/Jamfile haiku/trunk/src/system/boot/loader/partitions.cpp Log: Remove file map disk support by default, it's not used anyway, and we'll use layers for CD anyway. Doesn't spare that many bytes though... Modified: haiku/trunk/src/system/boot/loader/Jamfile =================================================================== --- haiku/trunk/src/system/boot/loader/Jamfile 2009-08-04 08:11:54 UTC (rev 32109) +++ haiku/trunk/src/system/boot/loader/Jamfile 2009-08-04 09:00:10 UTC (rev 32110) @@ -19,6 +19,7 @@ BOOT_SUPPORT_FILE_SYSTEM_BFS BOOT_SUPPORT_FILE_SYSTEM_TARFS + #BOOT_SUPPORT_FILE_MAP_DISK ; # Add architecture specific partition/file system modules @@ -51,7 +52,6 @@ KernelStaticLibrary boot_loader : main.cpp vfs.cpp - FileMapDisk.cpp RootFileSystem.cpp partitions.cpp heap.cpp @@ -77,6 +77,7 @@ # so that only the ones that are used will be included. KernelStaticLibrary boot_partitions : + FileMapDisk.cpp amiga_rdb.cpp apple.cpp efi_gpt.cpp Modified: haiku/trunk/src/system/boot/loader/partitions.cpp =================================================================== --- haiku/trunk/src/system/boot/loader/partitions.cpp 2009-08-04 08:11:54 UTC (rev 32109) +++ haiku/trunk/src/system/boot/loader/partitions.cpp 2009-08-04 09:00:10 UTC (rev 32110) @@ -222,7 +222,6 @@ status_t Partition::_Mount(file_system_module_info *module, Directory **_fileSystem) { - static int fileMapDiskDepth = 0; TRACE(("%p Partition::_Mount check for file_system: %s\n", this, module->pretty_name)); @@ -237,6 +236,8 @@ fIsFileSystem = true; +#ifdef BOOT_SUPPORT_FILE_MAP_DISK + static int fileMapDiskDepth = 0; // if we aren't already mounting an image if (!fileMapDiskDepth++) { // see if it contains an image file we could mount in turn @@ -248,6 +249,7 @@ } } fileMapDiskDepth--; +#endif return B_OK; } From korli at users.berlios.de Tue Aug 4 15:17:07 2009 From: korli at users.berlios.de (=?ISO-8859-1?B?Suly9G1lIER1dmFs?=) Date: Tue, 4 Aug 2009 15:17:07 +0200 Subject: [Haiku-commits] r32107 - haiku/trunk/src/add-ons/media/plugins/ffmpeg In-Reply-To: <200908040721.n747LQLC013616@sheep.berlios.de> References: <200908040721.n747LQLC013616@sheep.berlios.de> Message-ID: Hi Stephan, 2009/8/4 : > Author: stippi > Date: 2009-08-04 09:21:22 +0200 (Tue, 04 Aug 2009) > New Revision: 32107 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32107&view=rev > > Modified: > haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecDecoder.cpp > Log: > I have no idea how that ended up there... set the decoded audio format correctly > again. Should fix playback of any file where the ffmpeg plugin was responsible > for sound. (The symptoms were a crash into the debugger because of an unspecified > audio format...) This is needed to play anything non 16bits (I checked with 24bits flac files). Please revert, the problem might be located elsewhere. Bye, J?r?me From ingo_weinhold at gmx.de Tue Aug 4 15:41:42 2009 From: ingo_weinhold at gmx.de (Ingo Weinhold) Date: Tue, 04 Aug 2009 15:41:42 +0200 Subject: [Haiku-commits] r32078 - in haiku/trunk: headers/os/app headers/os/interface headers/private/binary_compatibility headers/private/interface src/kits/interface src/tests/kits/interface In-Reply-To: References: <33779194933-BeMail@zon> <20090803220115.959.2@knochen-vm.localdomain> Message-ID: <20090804154142.352.1@knochen-vm.localdomain> On 2009-08-03 at 22:05:13 [+0200], Rene Gollent wrote: > On Mon, Aug 3, 2009 at 3:01 PM, Ingo Weinhold wrote: > > I think in cases like this we should just introduce the gcc 4 compatility > > symbol for the time being, so that the optional packages don't just break, > > and remove it again after branching for the release, which would be the > > point when all optional packages need to be rebuilt anyway. > > Why is an app even linking to one of the ReservedVirtual symbols? That happens when you create a subclass. The compiler has to generate a vtable for your class, which contains slots for all virtual functions of the base classes (and those introduced in your class). Unless a virtual function is overridden, the respective slot is filled in with pointer to the function of the closest base class that implements this virtual function. In case of reserved slots, since no-one overrides them, that's always those _Reserve*() functions. CU, Ingo From axeld at mail.berlios.de Tue Aug 4 16:35:11 2009 From: axeld at mail.berlios.de (axeld at mail.berlios.de) Date: Tue, 4 Aug 2009 16:35:11 +0200 Subject: [Haiku-commits] r32111 - haiku/trunk/src/preferences/screen Message-ID: <200908041435.n74EZBiG005997@sheep.berlios.de> Author: axeld Date: 2009-08-04 16:35:10 +0200 (Tue, 04 Aug 2009) New Revision: 32111 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32111&view=rev Modified: haiku/trunk/src/preferences/screen/ScreenMode.cpp Log: * Added more vendor entries, thanks to Brecht again for digging up another resource. Modified: haiku/trunk/src/preferences/screen/ScreenMode.cpp =================================================================== --- haiku/trunk/src/preferences/screen/ScreenMode.cpp 2009-08-04 09:00:10 UTC (rev 32110) +++ haiku/trunk/src/preferences/screen/ScreenMode.cpp 2009-08-04 14:35:10 UTC (rev 32111) @@ -348,10 +348,14 @@ case 'ADI\0': strcpy(info.vendor, "ADI MicroScan"); break; + case 'AAC\0': case 'ACR\0': case 'API\0': strcpy(info.vendor, "Acer"); break; + case 'ACT\0': + strcpy(info.vendor, "Targa"); + break; case 'APP\0': strcpy(info.vendor, "Apple"); break; @@ -376,6 +380,12 @@ case 'DWE\0': strcpy(info.vendor, "Daewoo"); break; + case 'ECS\0': + strcpy(info.vendor, "Elitegroup"); + break; + case 'ELS\0': + strcpy(info.vendor, "ELSA"); + break; case 'EMA\0': strcpy(info.vendor, "eMachines"); break; @@ -384,7 +394,7 @@ strcpy(info.vendor, "Eizo"); break; case 'EPI\0': - strcpy(info.vendor, "Envision Peripherals"); + strcpy(info.vendor, "Envision"); break; case 'FCM\0': strcpy(info.vendor, "Funai Electronics"); @@ -424,6 +434,9 @@ case 'LPL\0': strcpy(info.vendor, "LG Phillips"); break; + case 'LTN\0': + strcpy(info.vendor, "Lite-On"); + break; case 'MAX\0': strcpy(info.vendor, "Maxdata"); break; @@ -448,6 +461,9 @@ case 'NOK\0': strcpy(info.vendor, "Nokia"); break; + case 'OQI\0': + strcpy(info.vendor, "Optiquest"); + break; case 'PHL\0': strcpy(info.vendor, "Philips"); break; @@ -457,6 +473,9 @@ case 'QDS\0': strcpy(info.vendor, "Quanta Display"); break; + case 'REL\0': + strcpy(info.vendor, "Relisys"); + break; case 'SAM\0': strcpy(info.vendor, "Samsung"); break; @@ -472,6 +491,22 @@ case 'SNY\0': strcpy(info.vendor, "Sony"); break; + case 'SPT\0': + strcpy(info.vendor, "Sceptre"); + break; + case 'SRC\0': + strcpy(info.vendor, "Shamrock"); + break; + case 'SUN\0': + strcpy(info.vendor, "Sun Microsystems"); + break; + case 'TAT\0': + strcpy(info.vendor, "Tatung"); + break; + case 'TOS\0': + case 'TSB\0': + strcpy(info.vendor, "Toshiba"); + break; case 'UNM\0': strcpy(info.vendor, "Unisys"); break; @@ -481,6 +516,9 @@ case 'VSC\0': strcpy(info.vendor, "ViewSonic"); break; + case 'ZCM\0': + strcpy(info.vendor, "Zenith"); + break; } // Remove extraneous vendor strings and whitespace From superstippi at gmx.de Tue Aug 4 16:36:11 2009 From: superstippi at gmx.de (Stephan Assmus) Date: Tue, 04 Aug 2009 16:36:11 +0200 Subject: [Haiku-commits] r32107 - haiku/trunk/src/add-ons/media/plugins/ffmpeg In-Reply-To: References: <200908040721.n747LQLC013616@sheep.berlios.de> Message-ID: <20090804163611.40925.6@bepc.1249388284.fake> On 2009-08-04 at 15:17:07 [+0200], J?r?me Duval wrote: > Hi Stephan, > > 2009/8/4 : > > Author: stippi > > Date: 2009-08-04 09:21:22 +0200 (Tue, 04 Aug 2009) New Revision: 32107 > > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32107&view=rev > > > > Modified: > > haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecDecoder.cpp > > Log: > > I have no idea how that ended up there... set the decoded audio format > > correctly again. Should fix playback of any file where the ffmpeg > > plugin was responsible for sound. (The symptoms were a crash into the > > debugger because of an unspecified audio format...) > > This is needed to play anything non 16bits (I checked with 24bits flac > files). Please revert, the problem might be located elsewhere. Oh, so you changed that? I was puzzled why I changed that. The problem is that fInputFormat->u.raw_audio.format is nowhere set. So this would be unspecified. So the fInputFormat should have a wildcard there, and if you are saying that the BMediaTrack user should be able to set that, then the fix could be to check if the ioDecodedFormat has a wildcard, and specify the format only then. Does the rest of AVCodecDecoder actually handle anything other than 16bit audio? Best regards, -Stephan From superstippi at gmx.de Tue Aug 4 16:37:52 2009 From: superstippi at gmx.de (Stephan Assmus) Date: Tue, 04 Aug 2009 16:37:52 +0200 Subject: [Haiku-commits] r32078 - in haiku/trunk: headers/os/app headers/os/interface headers/private/binary_compatibility headers/private/interface src/kits/interface src/tests/kits/interface In-Reply-To: <20090804154142.352.1@knochen-vm.localdomain> References: <33779194933-BeMail@zon> <20090803220115.959.2@knochen-vm.localdomain> <20090804154142.352.1@knochen-vm.localdomain> Message-ID: <20090804163752.40953.7@bepc.1249388284.fake> On 2009-08-04 at 15:41:42 [+0200], Ingo Weinhold wrote: > > On 2009-08-03 at 22:05:13 [+0200], Rene Gollent > wrote: > > On Mon, Aug 3, 2009 at 3:01 PM, Ingo Weinhold > > wrote: > > > I think in cases like this we should just introduce the gcc 4 > > > compatility symbol for the time being, so that the optional packages > > > don't just break, and remove it again after branching for the > > > release, which would be the point when all optional packages need to > > > be rebuilt anyway. > > > > Why is an app even linking to one of the ReservedVirtual symbols? > > That happens when you create a subclass. The compiler has to generate a > vtable for your class, which contains slots for all virtual functions of > the base classes (and those introduced in your class). Unless a virtual > function is overridden, the respective slot is filled in with pointer to > the function of the closest base class that implements this virtual > function. In case of reserved slots, since no-one overrides them, that's > always those _Reserve*() functions. And the actual problem is that we are not generating the code via an __GNU_C_ < 3 check? Best regards, -Stephan From axeld at pinc-software.de Tue Aug 4 16:49:20 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Tue, 04 Aug 2009 16:49:20 +0200 CEST Subject: [Haiku-commits] r32078 - in haiku/trunk: headers/os/app headers/os/interface headers/private/binary_compatibility headers/private/interface src/kits/interface src/tests/kits/interface In-Reply-To: <20090804163752.40953.7@bepc.1249388284.fake> Message-ID: <26820219767-BeMail@zon> Stephan Assmus wrote: > And the actual problem is that we are not generating the code via an > __GNU_C_ < 3 check? Since the code is mangled differently for GCC2 and 4, the replacement functions have a different signature; you would need to copy the Reserved11 from the GCC2 section, find out the mangling in GCC4, and give the function that new signature. Bye, Axel. From superstippi at gmx.de Tue Aug 4 17:13:06 2009 From: superstippi at gmx.de (Stephan Assmus) Date: Tue, 04 Aug 2009 17:13:06 +0200 Subject: [Haiku-commits] r32078 - in haiku/trunk: headers/os/app headers/os/interface headers/private/binary_compatibility headers/private/interface src/kits/interface src/tests/kits/interface In-Reply-To: <26820219767-BeMail@zon> References: <26820219767-BeMail@zon> Message-ID: <20090804171306.1723.1@bepc.1249398692.fake> On 2009-08-04 at 16:49:20 [+0200], Axel D?rfler wrote: > Stephan Assmus wrote: > > And the actual problem is that we are not generating the code via an > > __GNU_C_ < 3 check? > > Since the code is mangled differently for GCC2 and 4, the replacement > functions have a different signature; you would need to copy the > Reserved11 from the GCC2 section, find out the mangling in GCC4, and give > the function that new signature. Ah! That makes sense, sorry for not looking at the code myself. I thought I remembered we do that somewhere, which is probably true, but obviously not always. Best regards, -Stephan From anevilyak at gmail.com Tue Aug 4 17:23:25 2009 From: anevilyak at gmail.com (Rene Gollent) Date: Tue, 4 Aug 2009 10:23:25 -0500 Subject: [Haiku-commits] r32078 - in haiku/trunk: headers/os/app headers/os/interface headers/private/binary_compatibility headers/private/interface src/kits/interface src/tests/kits/interface In-Reply-To: <20090804154142.352.1@knochen-vm.localdomain> References: <33779194933-BeMail@zon> <20090803220115.959.2@knochen-vm.localdomain> <20090804154142.352.1@knochen-vm.localdomain> Message-ID: On Tue, Aug 4, 2009 at 8:41 AM, Ingo Weinhold wrote: > That happens when you create a subclass. The compiler has to generate a > vtable for your class, which contains slots for all virtual functions of the > base classes (and those introduced in your class). Unless a virtual function > is overridden, the respective slot is filled in with pointer to the function > of the closest base class that implements this virtual function. In case of > reserved slots, since no-one overrides them, that's always those _Reserve*() > functions. Aha. Thanks :) Regards, Rene From stippi at mail.berlios.de Tue Aug 4 18:25:26 2009 From: stippi at mail.berlios.de (stippi at mail.berlios.de) Date: Tue, 4 Aug 2009 18:25:26 +0200 Subject: [Haiku-commits] r32112 - haiku/trunk/build/jam Message-ID: <200908041625.n74GPQp6019078@sheep.berlios.de> Author: stippi Date: 2009-08-04 18:25:24 +0200 (Tue, 04 Aug 2009) New Revision: 32112 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32112&view=rev Modified: haiku/trunk/build/jam/OptionalPackages haiku/trunk/build/jam/ReleaseBuildProfiles Log: * Added small description to all OptionalPackages at the top. * Replaced Pe GCC4 package with one that works again after the BToolTip addition. * Disabled Firefox and Vision GCC4 packages for the time being, so that one at least gets a working hybrid installation. * Added Clockwerk GCC2 and GCC4 packages. I also added it to the alpha release build profile, so that people testing the pre-alpha images have more easy access to it. I am not sure if it should stay there, since it may not be polished enough. Feedback welcome! :-) Modified: haiku/trunk/build/jam/OptionalPackages =================================================================== --- haiku/trunk/build/jam/OptionalPackages 2009-08-04 14:35:10 UTC (rev 32111) +++ haiku/trunk/build/jam/OptionalPackages 2009-08-04 16:25:24 UTC (rev 32112) @@ -12,47 +12,48 @@ # Available Optional Packages: -# APR +# APR - support libraries used for example by SVN # APR-util -# Beam -# BeBook -# BeHappy -# BeOSCompatibility -# BePDF -# Bluetooth -# CDRecord -# CLucene -# CVS +# Beam - powerful native e-mail client +# BeBook - the classic BeOS API documentation +# BeHappy - special documentation (i.e. BeBook) browser +# BeOSCompatibility - creates links within the system to support old apps +# BePDF - native PDF reader +# Bluetooth - experimental Haiku components for Bluetooth +# CDRecord - the command line CD writing tools +# Clockwerk - native audio/video compositing +# CLucene - indexed file search +# CVS - the version control system # Development - more complete dev environment (including autotools) # DevelopmentBase - basic development environment (gcc, headers, libs,...) # DevelopmentMin - development headers, libs, tools, from sources only -# Firefox -# KeymapSwitcher -# LibIconv -# LibLayout -# LibXML2 -# Links -# Nano -# Neon -# NetSurf -# OpenSound -# OpenSSH -# OpenSSL -# P7zip -# Pe -# Perl -# Python -# Rsync -# SQLite -# Subversion -# Tar -# UserlandFS -# Vim -# Vision -# VLC -# Welcome -# WonderBrush -# Yasm +# Firefox - the webbrowser +# KeymapSwitcher - Desktop utility +# LibIconv - text encoding conversion library +# LibLayout - GCC2 package needed by some BeOS apps to compile +# LibXML2 - the XML support libary +# Links - the web browser +# Nano - the command line text editor +# Neon - support libraries used for example by SVN +# NetSurf - the web browser +# OpenSound - additional audio driver package +# OpenSSH - the secure shell +# OpenSSL - secure sockets library +# P7zip - file archiving utility +# Pe - the powerful native Programmer's Editor +# Perl - the scripting language +# Python - the scripting language +# Rsync - remote directory synchronization +# SQLite - the database implementation +# Subversion - the version control system +# Tar - archiving utility +# UserlandFS - aids native file system development (like FUSE) +# Vim - the command line text editor +# Vision - powerful native IRC client +# VLC - the multi media player with native interface +# Welcome - introductory documentation to Haiku +# WonderBrush - native graphics application +# Yasm - the assembler utility local baseURL = http://haiku-files.org/files/optional-packages ; @@ -198,6 +199,28 @@ } +# Clockwerk +if [ IsOptionalHaikuImagePackageAdded Clockwerk ] { + if $(TARGET_ARCH) != x86 { + Echo "No optional package Clockwerk available for $(TARGET_ARCH)" ; + } else if $(HAIKU_GCC_VERSION[1]) >= 4 { + InstallOptionalHaikuImagePackage Clockwerk-0.0.1-2009-08-04 + : $(baseURL)/Clockwerk-0.0.1-x86-gcc4-2009-08-04.zip + : + ; + AddSymlinkToHaikuImage home config be Applications + : /boot/apps/Clockwerk/Clockwerk ; + } else { + InstallOptionalHaikuImagePackage Clockwerk-0.0.1-2009-08-04 + : $(baseURL)/Clockwerk-0.0.1-x86-gcc2-2009-08-04.zip + : + ; + AddSymlinkToHaikuImage home config be Applications + : /boot/apps/Clockwerk/Clockwerk ; + } +} + + # CLucene if [ IsOptionalHaikuImagePackageAdded CLucene ] { if $(TARGET_ARCH) != x86 { @@ -205,7 +228,7 @@ } else if $(HAIKU_GCC_VERSION[1]) < 4 && ! $(isHybridBuild) { Echo "No optional package CLucene available for GCC2" ; } else { - InstallOptionalHaikuImagePackage + InstallOptionalHaikuImagePackage clucene-0.9.21svn-x86-gcc4-haiku-2009-06-11 : $(baseURL)/clucene-0.9.21svn-x86-gcc4-haiku-2009-06-11.zip : @@ -375,16 +398,19 @@ if [ IsOptionalHaikuImagePackageAdded Firefox ] { if $(TARGET_ARCH) != x86 { Echo "No optional package Firefox available for $(TARGET_ARCH)" ; - } else if $(HAIKU_GCC_VERSION[1]) >= 4 { - InstallOptionalHaikuImagePackage - BeZillaBrowser-2.0.0.21pre-haiku-gcc4-x86-09-03-01 - : $(baseURL)/BeZillaBrowser-2.0.0.21pre-haiku-gcc4-x86-09-03-01.zip - : apps - ; - AddSymlinkToHaikuImage home config be Applications - : /boot/apps/BeZillaBrowser/BeZillaBrowser ; - - +# TODO: Update BeZilla GCC4 build, this one is currently broken, because of +# the BToolTip addition. At least the GCC2 build will work just fine on hybrid +# installations. +# } else if $(HAIKU_GCC_VERSION[1]) >= 4 { +# InstallOptionalHaikuImagePackage +# BeZillaBrowser-2.0.0.21pre-haiku-gcc4-x86-09-03-01 +# : $(baseURL)/BeZillaBrowser-2.0.0.21pre-haiku-gcc4-x86-09-03-01.zip +# : apps +# ; +# AddSymlinkToHaikuImage home config be Applications +# : /boot/apps/BeZillaBrowser/BeZillaBrowser ; + } else if $(HAIKU_GCC_VERSION[1]) >= 4 && ! $(isHybridBuild) { + Echo "No optional package Firefox available for GCC4" ; } else { InstallOptionalHaikuImagePackage BeZillaBrowser-gcc2-20090218 : http://bezilla.beuser.de/builds/BeZillaBrowser-gcc2-20090218.zip @@ -401,7 +427,7 @@ if $(TARGET_ARCH) != x86 { Echo "No optional package KeymapSwitcher available for $(TARGET_ARCH)" ; } else if $(HAIKU_GCC_VERSION[1]) >= 4 { - InstallOptionalHaikuImagePackage + InstallOptionalHaikuImagePackage KeymapSwitcher-1.2.3-x86-gcc4-2009-05-31 : $(baseURL)/KeymapSwitcher-1.2.3-x86-gcc4-2009-05-31.zip : @@ -409,7 +435,7 @@ AddSymlinkToHaikuImage home config be Desktop\ Applets : /boot/common/bin/KeymapSwitcher ; } else { - InstallOptionalHaikuImagePackage + InstallOptionalHaikuImagePackage KeymapSwitcher-1.2.3-x86-gcc2-2009-05-31 : $(baseURL)/KeymapSwitcher-1.2.3-x86-gcc2-2009-05-31.zip : @@ -600,8 +626,8 @@ Echo "No optional package Pe available for $(TARGET_ARCH)" ; } else { if $(HAIKU_GCC_VERSION[1]) >= 4 { - InstallOptionalHaikuImagePackage Pe-2.4.2-x86-gcc4-2009-07-05 - : $(baseURL)/Pe-2.4.2-x86-gcc4-2009-07-05.zip + InstallOptionalHaikuImagePackage Pe-2.4.2-x86-gcc4-2009-08-04 + : $(baseURL)/Pe-2.4.2-x86-gcc4-2009-08-04.zip ; } else { InstallOptionalHaikuImagePackage Pe-2.4.2-x86-gcc2-2009-07-05 @@ -774,13 +800,18 @@ if [ IsOptionalHaikuImagePackageAdded Vision ] { if $(TARGET_ARCH) != x86 { Echo "No optional package Vision available for $(TARGET_ARCH)" ; - } else if $(HAIKU_GCC_VERSION[1]) >= 4 { - InstallOptionalHaikuImagePackage Vision-0.9.7-H-090423 - : $(baseURL)/Vision-0.9.7-H-x86-gcc4-2009-04-23.zip - : apps - ; - AddSymlinkToHaikuImage home config be Applications - : /boot/apps/Vision-0.9.7-H-090423/Vision ; +# TODO: Update Vision GCC4 build, this one is currently broken, because of +# the BToolTip addition. At least the GCC2 build will work just fine on hybrid +# installations. +# } else if $(HAIKU_GCC_VERSION[1]) >= 4 { +# InstallOptionalHaikuImagePackage Vision-0.9.7-H-090423 +# : $(baseURL)/Vision-0.9.7-H-x86-gcc4-2009-04-23.zip +# : apps +# ; +# AddSymlinkToHaikuImage home config be Applications +# : /boot/apps/Vision-0.9.7-H-090423/Vision ; + } else if $(HAIKU_GCC_VERSION[1]) >= 4 && ! $(isHybridBuild) { + Echo "No optional package Vision available for GCC4" ; } else { InstallOptionalHaikuImagePackage Vision-0.9.7-H-090423 : $(baseURL)/Vision-0.9.7-H-x86-gcc2-2009-04-23.zip Modified: haiku/trunk/build/jam/ReleaseBuildProfiles =================================================================== --- haiku/trunk/build/jam/ReleaseBuildProfiles 2009-08-04 14:35:10 UTC (rev 32111) +++ haiku/trunk/build/jam/ReleaseBuildProfiles 2009-08-04 16:25:24 UTC (rev 32112) @@ -11,7 +11,8 @@ HAIKU_IMAGE_HOST_NAME = shredder ; HAIKU_IMAGE_SIZE = 500 ; - AddOptionalHaikuImagePackages BePDF Firefox Pe Vision VLC WonderBrush ; + AddOptionalHaikuImagePackages BePDF Clockwerk Firefox Pe Vision VLC + WonderBrush ; AddOptionalHaikuImagePackages CVS Development Subversion OpenSSH Yasm ; AddOptionalHaikuImagePackages Welcome BeBook ; } From axeld at mail.berlios.de Tue Aug 4 18:34:44 2009 From: axeld at mail.berlios.de (axeld at mail.berlios.de) Date: Tue, 4 Aug 2009 18:34:44 +0200 Subject: [Haiku-commits] r32113 - haiku/trunk/data/develop Message-ID: <200908041634.n74GYivH023322@sheep.berlios.de> Author: axeld Date: 2009-08-04 18:34:30 +0200 (Tue, 04 Aug 2009) New Revision: 32113 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32113&view=rev Modified: haiku/trunk/data/develop/makefile-engine Log: * Added support for TARGET_DIR. * Now uses g++ instead of gcc for C++ files. * Removed mwcc support. Modified: haiku/trunk/data/develop/makefile-engine =================================================================== --- haiku/trunk/data/develop/makefile-engine 2009-08-04 16:25:24 UTC (rev 32112) +++ haiku/trunk/data/develop/makefile-engine 2009-08-04 16:34:30 UTC (rev 32113) @@ -9,7 +9,7 @@ ifeq ($(MACHINE), BePC) CPU = x86 else - CPU = ppc + CPU = $(MACHINE) endif # set the directory where object files and binaries will be created @@ -28,27 +28,27 @@ DRIVER_PATH = misc endif -# specify that the binary should be created in the object directory +# specify the directory the binary should be created in by default +ifeq ($(TARGET_DIR), ) + TARGET_DIR := $(OBJ_DIR) +endif + # NOTE: make doesn't find the target if its name is enclosed in # quotation marks -# TARGET := "$(OBJ_DIR)/$(NAME)" - TARGET := $(OBJ_DIR)/$(NAME) + TARGET := $(TARGET_DIR)/$(NAME) # specify the mimeset tool MIMESET := mimeset # specify the tools for adding and removing resources - XRES = xres + XRES := xres # specify the tools for compiling resource definition files - RESCOMP = rc + RESCOMP := rc -# platform specific settings - -# x86 Settings -ifeq ($(CPU), x86) # set the compiler and compiler flags - CC = gcc + CC := gcc + C++ := g++ # SETTING: set the CFLAGS for each binary type ifeq ($(TYPE), DRIVER) @@ -73,8 +73,6 @@ endif endif - - # SETTING: set proper debugger flags ifeq ($(DEBUGGER), TRUE) DEBUG += -g @@ -111,93 +109,6 @@ endif -else - -# ppc Settings -ifeq ($(CPU), ppc) -# set the compiler and compiler flags - CC = mwcc - CFLAGS += - -# SETTING: set the proper optimization level - ifeq ($(OPTIMIZE), FULL) - OPTIMIZER = -O7 - else - ifeq ($(OPTIMIZE), SOME) - OPTIMIZER = -O3 - else - ifeq ($(OPTIMIZE), NONE) - OPTIMIZER = -O0 - else -# OPTIMIZE not set so set to full - OPTIMIZER = -O7 - endif - endif - endif - - #set the proper debugger settings - ifeq ($(DEBUGGER), TRUE) - DEBUG += -g - endif - - CFLAGS += $(OPTIMIZER) $(DEBUG) - -# SETTING: set warning level - ifeq ($(WARNINGS), ALL) - CFLAGS += -w on -requireprotos - else - ifeq ($(WARNINGS), NONE) - CFLAGS += -w off - endif - endif - - # clear the standard environment variable - # now there are no standard libraries to link against - BELIBFILES= - -# set the linker and linker flags - LD = mwldppc - -# SETTING: set linker flags for each binary type - ifeq ($(TYPE), APP) - LDFLAGS += - else - ifeq ($(TYPE), SHARED) - LDFLAGS += -xms - endif - endif - - ifeq ($(TYPE), DRIVER) - LDFLAGS += -nodefaults \ - -export all \ - -G \ - /boot/develop/lib/ppc/glue-noinit.a \ - /boot/develop/lib/ppc/_KERNEL_ - else - LDFLAGS += -export pragma \ - -init _init_routine_ \ - -term _term_routine_ \ - -lroot \ - /boot/develop/lib/ppc/glue-noinit.a \ - /boot/develop/lib/ppc/init_term_dyn.o \ - /boot/develop/lib/ppc/start_dyn.o - endif - - -# SETTING: output symbols in an xMAP file - ifeq ($(SYMBOLS), TRUE) - LDFLAGS += -map $(TARGET).xMAP - endif - -# SETTING: output debugging info to a .SYM file - ifeq ($(DEBUGGER), TRUE) - LDFLAGS += -g -osym $(TARGET).SYM - endif - -endif -endif - - # psuedo-function for converting a list of source files in SRCS variable # to a corresponding list of object files in $(OBJ_DIR)/xxx.o # The "function" strips off the src file suffix (.ccp or .c or whatever) @@ -337,17 +248,17 @@ $(OBJ_DIR)/%.o : %.c $(CC) -c $< $(INCLUDES) $(CFLAGS) -o $@ $(OBJ_DIR)/%.o : %.cpp - $(CC) -c $< $(INCLUDES) $(CFLAGS) -o $@ + $(C++) -c $< $(INCLUDES) $(CFLAGS) -o $@ $(OBJ_DIR)/%.o : %.cp $(CC) -c $< $(INCLUDES) $(CFLAGS) -o $@ $(OBJ_DIR)/%.o : %.cc - $(CC) -c $< $(INCLUDES) $(CFLAGS) -o $@ + $(C++) -c $< $(INCLUDES) $(CFLAGS) -o $@ $(OBJ_DIR)/%.o : %.C $(CC) -c $< $(INCLUDES) $(CFLAGS) -o $@ $(OBJ_DIR)/%.o : %.CC - $(CC) -c $< $(INCLUDES) $(CFLAGS) -o $@ + $(C++) -c $< $(INCLUDES) $(CFLAGS) -o $@ $(OBJ_DIR)/%.o : %.CPP - $(CC) -c $< $(INCLUDES) $(CFLAGS) -o $@ + $(C++) -c $< $(INCLUDES) $(CFLAGS) -o $@ # rules to compile resource definition files $(OBJ_DIR)/%.rsrc : %.rdef From axeld at mail.berlios.de Tue Aug 4 18:43:42 2009 From: axeld at mail.berlios.de (axeld at mail.berlios.de) Date: Tue, 4 Aug 2009 18:43:42 +0200 Subject: [Haiku-commits] r32114 - haiku/trunk/src/kits/interface Message-ID: <200908041643.n74GhgND000310@sheep.berlios.de> Author: axeld Date: 2009-08-04 18:43:37 +0200 (Tue, 04 Aug 2009) New Revision: 32114 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32114&view=rev Modified: haiku/trunk/src/kits/interface/InterfaceDefs.cpp Log: * Made the default tool tip color a bit easier on the eye. Modified: haiku/trunk/src/kits/interface/InterfaceDefs.cpp =================================================================== --- haiku/trunk/src/kits/interface/InterfaceDefs.cpp 2009-08-04 16:34:30 UTC (rev 32113) +++ haiku/trunk/src/kits/interface/InterfaceDefs.cpp 2009-08-04 16:43:37 UTC (rev 32114) @@ -1,5 +1,5 @@ /* - * Copyright 2001-2008, Haiku, Inc. + * Copyright 2001-2009, Haiku, Inc. * Distributed under the terms of the MIT License. * * Authors: @@ -79,7 +79,7 @@ {0, 0, 0, 255}, // B_NAVIGATION_PULSE_COLOR {255, 255, 255, 255}, // B_SHINE_COLOR {0, 0, 0, 255}, // B_SHADOW_COLOR - {255, 255, 0, 255}, // B_TOOLTIP_BACKGROUND_COLOR + {255, 255, 216, 255}, // B_TOOLTIP_BACKGROUND_COLOR {0, 0, 0, 255}, // B_TOOLTIP_TEXT_COLOR {0, 0, 0, 255}, // B_WINDOW_TEXT_COLOR {232, 232, 232, 255}, // B_WINDOW_INACTIVE_TAB_COLOR From axeld at mail.berlios.de Tue Aug 4 18:49:11 2009 From: axeld at mail.berlios.de (axeld at mail.berlios.de) Date: Tue, 4 Aug 2009 18:49:11 +0200 Subject: [Haiku-commits] r32115 - haiku/trunk/data/develop Message-ID: <200908041649.n74GnBHn005341@sheep.berlios.de> Author: axeld Date: 2009-08-04 18:49:06 +0200 (Tue, 04 Aug 2009) New Revision: 32115 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32115&view=rev Modified: haiku/trunk/data/develop/makefile-engine Log: * driverinstall now also depends on "default" * Added install target using INSTALL_DIR variable. * Made "clean" and "rmapp" targets whitespace friendly. Modified: haiku/trunk/data/develop/makefile-engine =================================================================== --- haiku/trunk/data/develop/makefile-engine 2009-08-04 16:43:37 UTC (rev 32114) +++ haiku/trunk/data/develop/makefile-engine 2009-08-04 16:49:06 UTC (rev 32115) @@ -91,7 +91,7 @@ endif # set the linker and linker flags - LD = gcc + LD := gcc LDFLAGS += $(DEBUG) # SETTING: set linker flags for each binary type @@ -280,19 +280,27 @@ # The generic clean command. Delete everything in the object folder. clean :: FORCE - -rm -rf $(OBJ_DIR) + -rm -rf "$(OBJ_DIR)" # remove just the application from the object folder rmapp :: - -rm -f $(TARGET) + -rm -f "$(TARGET)" # make it easy to install drivers for testing USER_BIN_PATH = /boot/home/config/add-ons/kernel/drivers/bin USER_DEV_PATH = /boot/home/config/add-ons/kernel/drivers/dev -driverinstall :: +driverinstall :: default ifeq ($(TYPE), DRIVER) copyattr --data $(OBJ_DIR)/$(NAME) $(USER_BIN_PATH)/$(NAME) mkdir -p $(USER_DEV_PATH)/$(DRIVER_PATH) ln -sf $(USER_BIN_PATH)/$(NAME) $(USER_DEV_PATH)/$(DRIVER_PATH)/$(NAME) endif + +install :: default +ifeq ($(INSTALL_DIR), ) + @echo "No install directory specified for \"$(NAME)\" (INSTALL_DIR is empty)" >&2 +else + mkdir -p "$(INSTALL_DIR)" + cp "$(TARGET)" "$(INSTALL_DIR)/$(NAME)" +endif From axeld at pinc-software.de Tue Aug 4 19:57:46 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Tue, 04 Aug 2009 19:57:46 +0200 CEST Subject: [Haiku-commits] r32112 - haiku/trunk/build/jam In-Reply-To: <200908041625.n74GPQp6019078@sheep.berlios.de> Message-ID: <38126805005-BeMail@zon> stippi at mail.berlios.de wrote: > * Added Clockwerk GCC2 and GCC4 packages. I also added it to the > alpha > release build profile, so that people testing the pre-alpha images > have > more easy access to it. I am not sure if it should stay there, > since it may > not be polished enough. Feedback welcome! :-) I am against putting it on the alpha - IMO a program like this doesn't really belong into the base distribution. Optional packages for it are welcome, though. Bye, Axel. From superstippi at gmx.de Tue Aug 4 20:46:41 2009 From: superstippi at gmx.de (Stephan Assmus) Date: Tue, 04 Aug 2009 20:46:41 +0200 Subject: [Haiku-commits] r32112 - haiku/trunk/build/jam In-Reply-To: <38126805005-BeMail@zon> References: <38126805005-BeMail@zon> Message-ID: <20090804204641.390.3@bepc.1249410789.fake> On 2009-08-04 at 19:57:46 [+0200], Axel D?rfler wrote: > stippi at mail.berlios.de wrote: > > * Added Clockwerk GCC2 and GCC4 packages. I also added it to the > > alpha > > release build profile, so that people testing the pre-alpha images > > have > > more easy access to it. I am not sure if it should stay there, > > since it may > > not be polished enough. Feedback welcome! :-) > > I am against putting it on the alpha - IMO a program like this doesn't > really belong into the base distribution. > Optional packages for it are welcome, though. I have no problem agreeing to that. Who put WonderBrush in the alpha profile, was that you or someone else? Based on what criteria is it decided which applications should be on the alpha? For me, it's always been about: 1) What applications do many of us use each day? 2) What applications show the fact that Haiku can be used to get work done? (Like a snapshot of the more powerful Haiku applications across different fields of work.) Best regards, -Stephan From mmu_man at mail.berlios.de Tue Aug 4 20:50:09 2009 From: mmu_man at mail.berlios.de (mmu_man at mail.berlios.de) Date: Tue, 4 Aug 2009 20:50:09 +0200 Subject: [Haiku-commits] r32116 - in haiku/trunk/src/system/boot/platform: bios_ia32 u-boot Message-ID: <200908041850.n74Io9mr025224@sheep.berlios.de> Author: mmu_man Date: 2009-08-04 20:50:08 +0200 (Tue, 04 Aug 2009) New Revision: 32116 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32116&view=rev Removed: haiku/trunk/src/system/boot/platform/bios_ia32/images.h haiku/trunk/src/system/boot/platform/u-boot/images.h Log: Remove those antique misleading leftovers, the good ones are at headers/private/kernel/boot/images.h Deleted: haiku/trunk/src/system/boot/platform/bios_ia32/images.h Deleted: haiku/trunk/src/system/boot/platform/u-boot/images.h From anevilyak at mail.berlios.de Wed Aug 5 00:54:57 2009 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Wed, 5 Aug 2009 00:54:57 +0200 Subject: [Haiku-commits] r32117 - haiku/trunk/build/jam Message-ID: <200908042254.n74MsvLo005252@sheep.berlios.de> Author: anevilyak Date: 2009-08-05 00:54:54 +0200 (Wed, 05 Aug 2009) New Revision: 32117 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32117&view=rev Modified: haiku/trunk/build/jam/OptionalPackages Log: Re-enable Vision gcc4 package (update has been posted to haiku-files). Modified: haiku/trunk/build/jam/OptionalPackages =================================================================== --- haiku/trunk/build/jam/OptionalPackages 2009-08-04 18:50:08 UTC (rev 32116) +++ haiku/trunk/build/jam/OptionalPackages 2009-08-04 22:54:54 UTC (rev 32117) @@ -800,16 +800,13 @@ if [ IsOptionalHaikuImagePackageAdded Vision ] { if $(TARGET_ARCH) != x86 { Echo "No optional package Vision available for $(TARGET_ARCH)" ; -# TODO: Update Vision GCC4 build, this one is currently broken, because of -# the BToolTip addition. At least the GCC2 build will work just fine on hybrid -# installations. -# } else if $(HAIKU_GCC_VERSION[1]) >= 4 { -# InstallOptionalHaikuImagePackage Vision-0.9.7-H-090423 -# : $(baseURL)/Vision-0.9.7-H-x86-gcc4-2009-04-23.zip -# : apps -# ; -# AddSymlinkToHaikuImage home config be Applications -# : /boot/apps/Vision-0.9.7-H-090423/Vision ; + } else if $(HAIKU_GCC_VERSION[1]) >= 4 { + InstallOptionalHaikuImagePackage Vision-0.9.7-H-090423-1 + : $(baseURL)/Vision-0.9.7-H-x86-gcc4-2009-04-23.zip + : apps + ; + AddSymlinkToHaikuImage home config be Applications + : /boot/apps/Vision-0.9.7-H-090423/Vision ; } else if $(HAIKU_GCC_VERSION[1]) >= 4 && ! $(isHybridBuild) { Echo "No optional package Vision available for GCC4" ; } else { From mmlr at mail.berlios.de Wed Aug 5 01:15:11 2009 From: mmlr at mail.berlios.de (mmlr at mail.berlios.de) Date: Wed, 5 Aug 2009 01:15:11 +0200 Subject: [Haiku-commits] r32118 - haiku/trunk/src/system/kernel/arch/x86 Message-ID: <200908042315.n74NFBsc024285@sheep.berlios.de> Author: mmlr Date: 2009-08-05 01:15:05 +0200 (Wed, 05 Aug 2009) New Revision: 32118 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32118&view=rev Modified: haiku/trunk/src/system/kernel/arch/x86/arch_cpu.cpp haiku/trunk/src/system/kernel/arch/x86/arch_vm_translation_map.cpp Log: Prevent the user TLB invalidation function from being preempted by turning off interrupts when invoking it. The user TLB invalidation function essentially only reads and writes back control register 3 (cr3) which holds the physical address of the current page directory. Still a preemption between the read and the write can cause problems when the last thread of a team dies and therefore the team is deleted. The context switch on preemption would decrement the refcount of the object that holds the page directory. Then the team address space is deleted causing the context switch returning to that thread to not re-acquire a reference to the object. At that point the page directory as set in cr3 is the one of the previously run thread (which is fine, as all share the kernel space mappings we need). Now when the preempted thread continues though, it would overwrite cr3 with the physical page directory address from before the context switch still stored in eax, therefore setting the page directory to the one of the dying thread that now doesn't have the corresponding reference. Further progressing the thread would release the last reference causing the deletion of the object and freeing of the, now active again, page directory. The memory getting overwritten (by deadbeef) now completely corrupts the page directory causing basically any memory access to fault, in the end resulting in a triplefault. This should fix bug #3399. Modified: haiku/trunk/src/system/kernel/arch/x86/arch_cpu.cpp =================================================================== --- haiku/trunk/src/system/kernel/arch/x86/arch_cpu.cpp 2009-08-04 22:54:54 UTC (rev 32117) +++ haiku/trunk/src/system/kernel/arch/x86/arch_cpu.cpp 2009-08-04 23:15:05 UTC (rev 32118) @@ -731,8 +731,11 @@ // of the global page bit x86_write_cr4(flags & ~IA32_CR4_GLOBAL_PAGES); x86_write_cr4(flags | IA32_CR4_GLOBAL_PAGES); - } else + } else { + cpu_status state = disable_interrupts(); arch_cpu_user_TLB_invalidate(); + restore_interrupts(state); + } } Modified: haiku/trunk/src/system/kernel/arch/x86/arch_vm_translation_map.cpp =================================================================== --- haiku/trunk/src/system/kernel/arch/x86/arch_vm_translation_map.cpp 2009-08-04 22:54:54 UTC (rev 32117) +++ haiku/trunk/src/system/kernel/arch/x86/arch_vm_translation_map.cpp 2009-08-04 23:15:05 UTC (rev 32118) @@ -632,7 +632,9 @@ smp_send_broadcast_ici(SMP_MSG_GLOBAL_INVALIDATE_PAGES, 0, 0, 0, NULL, SMP_MSG_FLAG_SYNC); } else { + cpu_status state = disable_interrupts(); arch_cpu_user_TLB_invalidate(); + restore_interrupts(state); int cpu = smp_get_current_cpu(); uint32 cpuMask = map->arch_data->active_on_cpus From leavengood at gmail.com Wed Aug 5 02:55:39 2009 From: leavengood at gmail.com (Ryan Leavengood) Date: Tue, 4 Aug 2009 20:55:39 -0400 Subject: [Haiku-commits] r32114 - haiku/trunk/src/kits/interface In-Reply-To: <200908041643.n74GhgND000310@sheep.berlios.de> References: <200908041643.n74GhgND000310@sheep.berlios.de> Message-ID: On Tue, Aug 4, 2009 at 12:43 PM, wrote: > * Made the default tool tip color a bit easier on the eye. Thank goodness, that pure yellow was killing me. I haven't updated my code to see this new choice, but I had an idea to maybe try out some different color ideas for this. Based on the RGB values this looks like a light yellow, which mimics Windows I guess...probably fine for now. -- Regards, Ryan From ingo_weinhold at gmx.de Wed Aug 5 03:26:16 2009 From: ingo_weinhold at gmx.de (Ingo Weinhold) Date: Wed, 05 Aug 2009 03:26:16 +0200 Subject: [Haiku-commits] r32118 - haiku/trunk/src/system/kernel/arch/x86 In-Reply-To: <200908042315.n74NFBsc024285@sheep.berlios.de> References: <200908042315.n74NFBsc024285@sheep.berlios.de> Message-ID: <20090805032616.594.2@knochen-vm.localdomain> On 2009-08-05 at 01:15:11 [+0200], mmlr at mail.berlios.de wrote: > Author: mmlr > Date: 2009-08-05 01:15:05 +0200 (Wed, 05 Aug 2009) > New Revision: 32118 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32118&view=rev > > Modified: > haiku/trunk/src/system/kernel/arch/x86/arch_cpu.cpp > haiku/trunk/src/system/kernel/arch/x86/arch_vm_translation_map.cpp > Log: > Prevent the user TLB invalidation function from being preempted by turning > off > interrupts when invoking it. The user TLB invalidation function essentially > only > reads and writes back control register 3 (cr3) which holds the physical > address > of the current page directory. Still a preemption between the read and the > write > can cause problems when the last thread of a team dies and therefore the > team > is deleted. The context switch on preemption would decrement the refcount > of the > object that holds the page directory. Then the team address space is deleted > causing the context switch returning to that thread to not re-acquire a > reference to the object. At that point the page directory as set in cr3 is > the > one of the previously run thread (which is fine, as all share the kernel > space > mappings we need). Now when the preempted thread continues though, it would > overwrite cr3 with the physical page directory address from before the > context > switch still stored in eax, therefore setting the page directory to the one > of > the dying thread that now doesn't have the corresponding reference. Further > progressing the thread would release the last reference causing the deletion > of the object and freeing of the, now active again, page directory. The > memory > getting overwritten (by deadbeef) now completely corrupts the page directory > causing basically any memory access to fault, in the end resulting in a > triplefault. This should fix bug #3399. Nice one! Funny that -- as so often -- piecing everything together took so long, although we already had all the needed information when the scheduler tracing yielded the exact place of preemption. Anyway, I actually don't quite see why the triple fault happened. I understand the double fault, but our double fault handler uses the kernel page directory (and already did so even before my changes), so it should have safely run into the kernel debugger. CU, Ingo From bonefish at mail.berlios.de Wed Aug 5 04:31:01 2009 From: bonefish at mail.berlios.de (bonefish at mail.berlios.de) Date: Wed, 5 Aug 2009 04:31:01 +0200 Subject: [Haiku-commits] r32119 - haiku/trunk/src/system/kernel/arch/x86 Message-ID: <200908050231.n752V1xj004788@sheep.berlios.de> Author: bonefish Date: 2009-08-05 04:31:00 +0200 (Wed, 05 Aug 2009) New Revision: 32119 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32119&view=rev Modified: haiku/trunk/src/system/kernel/arch/x86/arch_x86.S Log: Added comment. Modified: haiku/trunk/src/system/kernel/arch/x86/arch_x86.S =================================================================== --- haiku/trunk/src/system/kernel/arch/x86/arch_x86.S 2009-08-04 23:15:05 UTC (rev 32118) +++ haiku/trunk/src/system/kernel/arch/x86/arch_x86.S 2009-08-05 02:31:00 UTC (rev 32119) @@ -17,10 +17,12 @@ .text -/* void arch_cpu_user_TLB_invalidate(); */ +/*! \fn void arch_cpu_user_TLB_invalidate() + Invalidates the TLB. Must be called with interrupts disabled. +*/ FUNCTION(arch_cpu_user_TLB_invalidate): - movl %cr3,%eax - movl %eax,%cr3 + movl %cr3, %eax + movl %eax, %cr3 ret FUNCTION_END(arch_cpu_user_TLB_invalidate) From koki at haikuzone.net Wed Aug 5 04:55:31 2009 From: koki at haikuzone.net (Jorge G. Mare) Date: Tue, 04 Aug 2009 19:55:31 -0700 Subject: [Haiku-commits] r32112 - haiku/trunk/build/jam In-Reply-To: <38126805005-BeMail@zon> References: <38126805005-BeMail@zon> Message-ID: <4A78F4A3.6010807@haikuzone.net> Axel D?rfler wrote: > stippi at mail.berlios.de wrote: > >> * Added Clockwerk GCC2 and GCC4 packages. I also added it to the >> alpha >> release build profile, so that people testing the pre-alpha images >> have >> more easy access to it. I am not sure if it should stay there, >> since it may >> not be polished enough. Feedback welcome! :-) >> > > I am against putting it on the alpha - IMO a program like this doesn't > really belong into the base distribution. > Optional packages for it are welcome, though. > Is the final release going to be available in two versions, one being the base (barebone) distro and the other the base + applications (like the nightly builds)? Cheers, Jorge From axeld at pinc-software.de Wed Aug 5 08:09:12 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Wed, 05 Aug 2009 08:09:12 +0200 CEST Subject: [Haiku-commits] r32114 - haiku/trunk/src/kits/interface In-Reply-To: Message-ID: <1790291353-BeMail@zon> Ryan Leavengood wrote: > On Tue, Aug 4, 2009 at 12:43 PM, wrote: > > * Made the default tool tip color a bit easier on the eye. > Thank goodness, that pure yellow was killing me. I haven't updated my > code to see this new choice, but I had an idea to maybe try out some > different color ideas for this. Based on the RGB values this looks > like a light yellow, which mimics Windows I guess...probably fine for > now. I'm definitely open to other ideas, I just wanted the yellow to be gone :-) Bye, Axel. From axeld at pinc-software.de Wed Aug 5 08:23:19 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Wed, 05 Aug 2009 08:23:19 +0200 CEST Subject: [Haiku-commits] r32112 - haiku/trunk/build/jam In-Reply-To: <20090804204641.390.3@bepc.1249410789.fake> Message-ID: <2637826605-BeMail@zon> Stephan Assmus wrote: > On 2009-08-04 at 19:57:46 [+0200], Axel D?rfler > > wrote: > > I am against putting it on the alpha - IMO a program like this > > doesn't > > really belong into the base distribution. > > Optional packages for it are welcome, though. > I have no problem agreeing to that. Who put WonderBrush in the alpha > profile, was that you or someone else? I guess that could have been me, but that doesn't necessarily mean that I have thought about it too much :-) > Based on what criteria is it decided which applications should be on > the alpha? > For me, it's always been about: > 1) What applications do many of us use each day? > 2) What applications show the fact that Haiku can be used to get work > done? > (Like a snapshot of the more powerful Haiku applications across > different > fields of work.) For me it's just 1). If a user never uses a video cut application, why bother to download and install it? It would be quite a big package if it should show that you can get work done with Haiku (ie. include sample videos). It should be part of demoing Haiku, but that doesn't already make it a good part of a release IMO. WonderBrush definitely has a broader use, at least, although I'm not sure there either. In any case, I guess it's time to nail the specifics, anyway. Bye, Axel. From axeld at pinc-software.de Wed Aug 5 08:26:31 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Wed, 05 Aug 2009 08:26:31 +0200 CEST Subject: [Haiku-commits] r32112 - haiku/trunk/build/jam In-Reply-To: <4A78F4A3.6010807@haikuzone.net> Message-ID: <2829311946-BeMail@zon> "Jorge G. Mare" wrote: > Is the final release going to be available in two versions, one being > the base (barebone) distro and the other the base + applications > (like > the nightly builds)? I would guess that has yet to be determined, too. Since we plan to have a package manager with R1, maybe that's not a big issue, though. Bye, Axel. From axeld at pinc-software.de Wed Aug 5 08:45:36 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Wed, 05 Aug 2009 08:45:36 +0200 CEST Subject: [Haiku-commits] r32118 - haiku/trunk/src/system/kernel/arch/x86 In-Reply-To: <20090805032616.594.2@knochen-vm.localdomain> Message-ID: <3974745493-BeMail@zon> Ingo Weinhold wrote: > Anyway, I actually don't quite see why the triple fault happened. I > understand the double fault, but our double fault handler uses the > kernel > page directory (and already did so even before my changes), so it > should have > safely run into the kernel debugger. arch_vm_translation_map_init_map() copies the kernel page directory to the user page directory, if that contains garbage (or 0xdeadbeef), the kernel memory is not available anymore. Bye, Axel. From stippi at mail.berlios.de Wed Aug 5 10:14:24 2009 From: stippi at mail.berlios.de (stippi at mail.berlios.de) Date: Wed, 5 Aug 2009 10:14:24 +0200 Subject: [Haiku-commits] r32120 - haiku/trunk/build/jam Message-ID: <200908050814.n758EO8I021179@sheep.berlios.de> Author: stippi Date: 2009-08-05 10:14:23 +0200 (Wed, 05 Aug 2009) New Revision: 32120 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32120&view=rev Modified: haiku/trunk/build/jam/OptionalPackages Log: Rene missed to remove this part when re-enabling the GCC4 package. Modified: haiku/trunk/build/jam/OptionalPackages =================================================================== --- haiku/trunk/build/jam/OptionalPackages 2009-08-05 02:31:00 UTC (rev 32119) +++ haiku/trunk/build/jam/OptionalPackages 2009-08-05 08:14:23 UTC (rev 32120) @@ -807,8 +807,6 @@ ; AddSymlinkToHaikuImage home config be Applications : /boot/apps/Vision-0.9.7-H-090423/Vision ; - } else if $(HAIKU_GCC_VERSION[1]) >= 4 && ! $(isHybridBuild) { - Echo "No optional package Vision available for GCC4" ; } else { InstallOptionalHaikuImagePackage Vision-0.9.7-H-090423 : $(baseURL)/Vision-0.9.7-H-x86-gcc2-2009-04-23.zip From axeld at mail.berlios.de Wed Aug 5 11:47:22 2009 From: axeld at mail.berlios.de (axeld at mail.berlios.de) Date: Wed, 5 Aug 2009 11:47:22 +0200 Subject: [Haiku-commits] r32121 - haiku/trunk/src/tests/system/libroot/os Message-ID: <200908050947.n759lMNA030474@sheep.berlios.de> Author: axeld Date: 2009-08-05 11:47:20 +0200 (Wed, 05 Aug 2009) New Revision: 32121 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32121&view=rev Modified: haiku/trunk/src/tests/system/libroot/os/ParseDateTest.cpp Log: * Improved the parsedate() test to produce a reliable test case (with a fixed "now", and given expected results). * Now only prints failures, unless you give a command argument (which just enables verbose output). Modified: haiku/trunk/src/tests/system/libroot/os/ParseDateTest.cpp =================================================================== --- haiku/trunk/src/tests/system/libroot/os/ParseDateTest.cpp 2009-08-05 08:14:23 UTC (rev 32120) +++ haiku/trunk/src/tests/system/libroot/os/ParseDateTest.cpp 2009-08-05 09:47:20 UTC (rev 32121) @@ -1,7 +1,7 @@ /* -** Copyright 2003, Axel D?rfler, axeld at pinc-software.de. All rights reserved. -** Distributed under the terms of the OpenBeOS License. -*/ + * Copyright 2003-2009, Axel D?rfler, axeld at pinc-software.de. + * Distributed under the terms of the MIT License. + */ #include @@ -9,24 +9,26 @@ #include -// this file can also be compiled against the R5 parsedate() implementation -#ifndef PARSEDATE_INVALID_DATE -# define PARSEDATE_INVALID_DATE 4 -# define PARSEDATE_MINUTE_RELATIVE_TIME 8 -#endif +#define ABSOLUTE 0 +#define UNKNOWN 0 +#define DAY_RELATIVE PARSEDATE_RELATIVE_TIME +#define MINUTE_RELATIVE (PARSEDATE_RELATIVE_TIME \ + | PARSEDATE_MINUTE_RELATIVE_TIME) +#define INVALID PARSEDATE_INVALID_DATE -char * + +char* parsedate_flags_to_string(time_t result, int flags) { if (result == -1) { - if (flags & PARSEDATE_INVALID_DATE) + if ((flags & PARSEDATE_INVALID_DATE) != 0) return "invalid"; return "unknown"; } - if (flags & PARSEDATE_RELATIVE_TIME) { - if (flags & PARSEDATE_MINUTE_RELATIVE_TIME) + if ((flags & PARSEDATE_RELATIVE_TIME) != 0) { + if ((flags & PARSEDATE_MINUTE_RELATIVE_TIME) != 0) return "minute relative"; return "day relative"; @@ -37,60 +39,78 @@ int -main(int argc, char **argv) +main(int argc, char** argv) { - const char *dates[] = { - "last tuesday", - "today", - "next tuesday", - "tuesday", - "1976-12-15", - "5.8.1976", - "last hour", - "1 hour", - "now", - "12/15/1976", - "Sat, 08/23/2003", - "Sun, 08/23/2003", - "", - "next monday 3:00", - "thursday 4:42", - "thursday +4:42", - "this thursday 4:42", - "42 minutes", - "2 weeks", - "next 5 minutes", - "last 15 minutes", - "-15 minutes", - "3:33pm GMT", - "Mon, June 10th, 1993 10:00:03 am GMT", - "Sat, 16 Aug ?????????? ????? (????)", - "Mon, June 10th, 1993 10:00:03 am UTC", - "Mon, June 10th, 1993 10:00:03 am CEST", - "Mon, June 10th, 1993 10:00:03 am +0000", - "Mon, June 10th, 1993 10:00:03 am 0000", // invalid! - "Mon, June 10th, 1993 10:00:03 am +0100", - "Mon, June 10th, 1993 10:00:03 am -0700", - "Mon, June 10th, 1993 06:00:03 am ACDT", - NULL + time_t now = 1249471430; + // August 5th, 2009, 11:23:50 + + struct test { + time_t result; + const char* date; + int flags; }; + static const test kDates[] = { + {1248739200, "last tuesday", DAY_RELATIVE}, + {1249430400, "today", DAY_RELATIVE}, + {1249948800, "next tuesday", DAY_RELATIVE}, + {1249344000, "tuesday", DAY_RELATIVE}, + {1249467830, "last hour", MINUTE_RELATIVE}, + {1249475030, "1 hour", MINUTE_RELATIVE}, + {now, "now", MINUTE_RELATIVE}, + {219456000, "1976-12-15", ABSOLUTE}, + {219456000, "12/15/1976", ABSOLUTE}, + {219456000, "1976/12/15", ABSOLUTE}, + {219456000, "15.12.1976", ABSOLUTE}, + {208051200, "5.8.1976", ABSOLUTE}, + {1061596800, "Sat, 08/23/2003", ABSOLUTE}, + {1061596800, "Sun, 08/23/2003", ABSOLUTE}, + {-1, "", INVALID}, + {1249873200, "next monday 3:00", DAY_RELATIVE}, + {1249533720, "thursday 4:42", DAY_RELATIVE}, + {1249533740, "thursday +4:42:20", DAY_RELATIVE}, + {1249533720, "this thursday 4:42", DAY_RELATIVE}, + {1249473950, "42 minutes", MINUTE_RELATIVE}, + {1250640000, "2 weeks", DAY_RELATIVE}, + {1249471730, "next 5 minutes", MINUTE_RELATIVE}, + {1249470530, "last 15 minutes", MINUTE_RELATIVE}, + {1249470530, "-15 minutes", MINUTE_RELATIVE}, + {1249486380, "3:33pm GMT", DAY_RELATIVE}, + {739706403, "Mon, June 10th, 1993 10:00:03 am GMT", ABSOLUTE}, + {-1, "Sat, 16 Aug ?????????? ????? (????)", INVALID}, + {739706403, "Mon, June 10th, 1993 10:00:03 am UTC", ABSOLUTE}, + {739699203, "Mon, June 10th, 1993 10:00:03 am CEST", ABSOLUTE}, + {739706403, "Mon, June 10th, 1993 10:00:03 am +0000", ABSOLUTE}, + {-1, "Mon, June 10th, 1993 10:00:03 am 0000", UNKNOWN}, + {739702803, "Mon, June 10th, 1993 10:00:03 am +0100", ABSOLUTE}, + {739731603, "Mon, June 10th, 1993 10:00:03 am -0700", ABSOLUTE}, + {739654203, "Mon, June 10th, 1993 06:00:03 am ACDT", ABSOLUTE}, + {-1, NULL, 0} + }; -#if 0 - time_t now = time(NULL); - for (int i = 0; i < 500000; i++) { + bool verbose = argc > 1; + + if (verbose) + printf("All times relative to: %s (%ld)\n", ctime(&now), now); + + for (int32 i = 0; kDates[i].date; i++) { int flags = 0; - parsedate_etc(dates[0], now, &flags); + time_t result = parsedate_etc(kDates[i].date, now, &flags); + + bool failure = false; + if (flags != kDates[i].flags || result != kDates[i].result) + failure = true; + if (failure) { + printf("FAILURE: parsing time at index %ld (should be %ld, %s)\n", + i, kDates[i].result, + parsedate_flags_to_string(kDates[i].result, flags)); + } + + if (verbose || failure) { + printf("\"%s\" = %ld (%s) -> %s", kDates[i].date, result, + parsedate_flags_to_string(result, flags), result == -1 + ? "-\n" : ctime(&result)); + } } -#else - // this crashes the R5 version but not ours: - // parsedate(NULL, -1); - for (int32 i = 0; dates[i]; i++) { - int flags = 0; - time_t result = parsedate_etc(dates[i], -1, &flags); - printf("\"%s\" = %ld (%s) -> %s", dates[i], result, - parsedate_flags_to_string(result, flags), result == -1 ? "-\n" : ctime(&result)); - } -#endif return 0; } From stippi at mail.berlios.de Wed Aug 5 12:07:44 2009 From: stippi at mail.berlios.de (stippi at mail.berlios.de) Date: Wed, 5 Aug 2009 12:07:44 +0200 Subject: [Haiku-commits] r32122 - haiku/trunk/src/kits/media Message-ID: <200908051007.n75A7i9C032213@sheep.berlios.de> Author: stippi Date: 2009-08-05 12:07:43 +0200 (Wed, 05 Aug 2009) New Revision: 32122 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32122&view=rev Modified: haiku/trunk/src/kits/media/MediaWriter.cpp Log: Do not use fWriter functions, when it has not been instantiated properly. Modified: haiku/trunk/src/kits/media/MediaWriter.cpp =================================================================== --- haiku/trunk/src/kits/media/MediaWriter.cpp 2009-08-05 09:47:20 UTC (rev 32121) +++ haiku/trunk/src/kits/media/MediaWriter.cpp 2009-08-05 10:07:43 UTC (rev 32122) @@ -61,13 +61,15 @@ { CALLED(); - // free all stream cookies - // and chunk caches - StreamInfo* info; - for (fStreamInfos.Rewind(); fStreamInfos.GetNext(&info);) - fWriter->FreeCookie(info->cookie); + if (fWriter != NULL) { + // free all stream cookies + // and chunk caches + StreamInfo* info; + for (fStreamInfos.Rewind(); fStreamInfos.GetNext(&info);) + fWriter->FreeCookie(info->cookie); - _plugin_manager.DestroyWriter(fWriter); + _plugin_manager.DestroyWriter(fWriter); + } // fTarget is owned by the BMediaFile } @@ -99,6 +101,9 @@ { CALLED(); + if (fWriter == NULL) + return B_NO_INIT; + // TODO: Here we should work out a way so that if there is a setup // failure we can try the next encoder. Encoder* encoder; From stippi at mail.berlios.de Wed Aug 5 12:11:07 2009 From: stippi at mail.berlios.de (stippi at mail.berlios.de) Date: Wed, 5 Aug 2009 12:11:07 +0200 Subject: [Haiku-commits] r32123 - haiku/trunk/headers/os/media Message-ID: <200908051011.n75AB7Ti032584@sheep.berlios.de> Author: stippi Date: 2009-08-05 12:11:06 +0200 (Wed, 05 Aug 2009) New Revision: 32123 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32123&view=rev Modified: haiku/trunk/headers/os/media/MediaTrack.h Log: Small cleanups. Modified: haiku/trunk/headers/os/media/MediaTrack.h =================================================================== --- haiku/trunk/headers/os/media/MediaTrack.h 2009-08-05 10:07:43 UTC (rev 32122) +++ haiku/trunk/headers/os/media/MediaTrack.h 2009-08-05 10:11:06 UTC (rev 32123) @@ -53,7 +53,7 @@ // Use BMediaFile::ReleaseTrack() instead -- or it will go away // on its own when the MediaFile is deleted. virtual ~BMediaTrack(); - + public: // for read-only access the BMediaTrack should be instantiated @@ -66,18 +66,18 @@ // Get information about the codec being used. status_t GetCodecInfo(media_codec_info* _codecInfo) const; - - // EncodedFormat returns information about the track's - // "native" encoded format. + // EncodedFormat returns information about the track's + // "native" encoded format. + status_t EncodedFormat(media_format* _format) const; // DecodedFormat is used to negotiate the format that the codec will // use when decoding the track's data. You pass in the format that // that you want; the codec will find and return its "best fit" - // format. (inout_format is used as both the input and the returned - // format.) The format is typically of the B_MEDIA_RAW_AUDIO or + // format. (inout_format is used as both the input and the returned + // format.) The format is typically of the B_MEDIA_RAW_AUDIO or // B_MEDIA_RAW_VIDEO flavor. // The data returned through ReadFrames() will be in the format that's // returned by this function. @@ -103,7 +103,7 @@ // negotiated by DecodedFormat(). However, if it reaches the end of the // file and was not able to fill the whole buffer, it returns a partial // buffer. Upon return, out_frameCount contains the actual number of - // frame/samples returned, and the start time for the frame, expressed + // frame/samples returned, and the start time for the frame, expressed // in microseconds, is in the media_header structure. status_t ReadFrames(void* _buffer, int64* _frameCount, @@ -182,9 +182,9 @@ // These are for controlling the underlying encoder and track parameters // returns a copy of the parameter web status_t GetParameterWeb(BParameterWeb** _web); - status_t GetParameterValue(int32 id, void* _value, + status_t GetParameterValue(int32 id, void* value, size_t* size); - status_t SetParameterValue(int32 id, const void* _value, + status_t SetParameterValue(int32 id, const void* value, size_t size); BView* GetParameterView(); @@ -202,11 +202,11 @@ private: friend class BMediaFile; - + // deprecated, but for BeOS R5 compatibility BParameterWeb* Web(); - // Does nothing, returns B_ERROR, for Zeta compatiblity only + // Does nothing, returns B_ERROR, for Zeta compatiblity only status_t ControlCodec(int32 selector, void* _inOutData, size_t size); From stippi at mail.berlios.de Wed Aug 5 12:21:40 2009 From: stippi at mail.berlios.de (stippi at mail.berlios.de) Date: Wed, 5 Aug 2009 12:21:40 +0200 Subject: [Haiku-commits] r32124 - in haiku/trunk: headers/private/media src/add-ons/media/plugins/ffmpeg src/kits/media Message-ID: <200908051021.n75ALejB000598@sheep.berlios.de> Author: stippi Date: 2009-08-05 12:21:36 +0200 (Wed, 05 Aug 2009) New Revision: 32124 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32124&view=rev Modified: haiku/trunk/headers/private/media/EncoderPlugin.h haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.h haiku/trunk/src/add-ons/media/plugins/ffmpeg/EncoderTable.cpp haiku/trunk/src/add-ons/media/plugins/ffmpeg/EncoderTable.h haiku/trunk/src/add-ons/media/plugins/ffmpeg/FFmpegPlugin.cpp haiku/trunk/src/add-ons/media/plugins/ffmpeg/MuxerTable.cpp haiku/trunk/src/add-ons/media/plugins/ffmpeg/config.h haiku/trunk/src/kits/media/EncoderPlugin.cpp haiku/trunk/src/kits/media/MediaTrack.cpp Log: Encoder: * Fleshed out the Encoder API to support parameter setters/getters and returning a BView for configuration. (Not yet sure if this is a good idea.) BMediaTrack: * Implemented all but one of the unimplemented methods in BMediaTrack. It should be working as far as that class is concerned, unless I missed some of the vision. ReplaceFrames() remains a stub, added a comment on why it probably stays that way. * Release the Encoder reference in the destructor. FFmpeg plugin: * Refactoring to delay opening the AVCodec until encoding the first chunk, so that we can still adjust parameters. * Support adjusting parameters via [Set|Get]EncodeParameters(). Currently, only quality is supported, added TODOs about supporting the bit_rate setup versus the automatically calculated bit_rate. * Extended EncoderDescription by a bit_rate scale. The Encoder calculates the raw bitrate needed by the current media format, and then divides that number by the specific codec's bit_rate_scale, while taking into account the desired quality. This seems to work very well already (tested with MPEG4), although a lot more parameters could be specified for libavcodec, depending on the desired quality. * Enabled the ogg muxer in libavformat, although it is currently still disabled in MuxerTable.cpp, because it rejects unknown codecs. Added TODO to this effect. Modified: haiku/trunk/headers/private/media/EncoderPlugin.h =================================================================== --- haiku/trunk/headers/private/media/EncoderPlugin.h 2009-08-05 10:11:06 UTC (rev 32123) +++ haiku/trunk/headers/private/media/EncoderPlugin.h 2009-08-05 10:21:36 UTC (rev 32124) @@ -8,11 +8,10 @@ #include #include +#include #include "MediaPlugin.h" -class AddOnManager; - namespace BPrivate { namespace media { class PluginManager; @@ -56,10 +55,20 @@ virtual status_t AddTrackInfo(uint32 code, const void* data, size_t size, uint32 flags = 0); + // Ownership of the BView and BParameterWeb remain with the Encoder. + // A window embedding the view must remove it before it is destroyed. + virtual BView* ParameterView(); + + virtual BParameterWeb* ParameterWeb(); + virtual status_t GetParameterValue(int32 id, void* value, + size_t* size) const; + virtual status_t SetParameterValue(int32 id, const void* value, + size_t size); + virtual status_t GetEncodeParameters( encode_parameters* parameters) const; virtual status_t SetEncodeParameters( - encode_parameters* parameters) const; + encode_parameters* parameters); virtual status_t Encode(const void* buffer, int64 frameCount, media_encode_info* info) = 0; @@ -73,19 +82,36 @@ virtual status_t Perform(perform_code code, void* data); private: - virtual void _ReservedEncoder1(); - virtual void _ReservedEncoder2(); - virtual void _ReservedEncoder3(); - virtual void _ReservedEncoder4(); - virtual void _ReservedEncoder5(); - ChunkWriter* fChunkWriter; // needed for plug-in reference count management friend class PluginManager; MediaPlugin* fMediaPlugin; - uint32 fReserved[5]; +private: + // FBC padding + uint32 fReserved[20]; + + virtual void _ReservedEncoder1(); + virtual void _ReservedEncoder2(); + virtual void _ReservedEncoder3(); + virtual void _ReservedEncoder4(); + virtual void _ReservedEncoder5(); + virtual void _ReservedEncoder6(); + virtual void _ReservedEncoder7(); + virtual void _ReservedEncoder8(); + virtual void _ReservedEncoder9(); + virtual void _ReservedEncoder10(); + virtual void _ReservedEncoder11(); + virtual void _ReservedEncoder12(); + virtual void _ReservedEncoder13(); + virtual void _ReservedEncoder14(); + virtual void _ReservedEncoder15(); + virtual void _ReservedEncoder16(); + virtual void _ReservedEncoder17(); + virtual void _ReservedEncoder18(); + virtual void _ReservedEncoder19(); + virtual void _ReservedEncoder20(); }; Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp 2009-08-05 10:11:06 UTC (rev 32123) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp 2009-08-05 10:21:36 UTC (rev 32124) @@ -30,12 +30,13 @@ static const size_t kDefaultChunkBufferSize = 2 * 1024 * 1024; -AVCodecEncoder::AVCodecEncoder(uint32 codecID) +AVCodecEncoder::AVCodecEncoder(uint32 codecID, int bitRateScale) : Encoder(), + fBitRateScale(bitRateScale), fCodec(NULL), fContext(avcodec_alloc_context()), - fCodecInitDone(false), + fCodecInitStatus(CODEC_INIT_NEEDED), fFrame(avcodec_alloc_frame()), fSwsContext(NULL), @@ -52,6 +53,11 @@ memset(&fInputFormat, 0, sizeof(media_format)); av_fifo_init(&fAudioFifo, 0); + + // Initial parameters, so we know if the user changed them + fEncodeParameters.avg_field_size = 0; + fEncodeParameters.max_field_size = 0; + fEncodeParameters.quality = 1.0f; } @@ -59,8 +65,7 @@ { TRACE("AVCodecEncoder::~AVCodecEncoder()\n"); - if (fCodecInitDone) - avcodec_close(fContext); + _CloseCodecIfNeeded(); sws_freeContext(fSwsContext); @@ -119,15 +124,118 @@ if (inputFormat == NULL) return B_BAD_VALUE; - if (fCodecInitDone) { - fCodecInitDone = false; - avcodec_close(fContext); - } + _CloseCodecIfNeeded(); fInputFormat = *inputFormat; fFramesWritten = 0; + return _Setup(); +} + + +status_t +AVCodecEncoder::GetEncodeParameters(encode_parameters* parameters) const +{ + TRACE("AVCodecEncoder::GetEncodeParameters(%p)\n", parameters); + +// TODO: Implement maintaining an automatically calculated bit_rate versus +// a user specified (via SetEncodeParameters()) bit_rate. At this point, the +// fContext->bit_rate may not yet have been specified (_Setup() was never +// called yet). So it cannot work like the code below, but in any case, it's +// showing how to convert between the values (Albeit untested). +// int avgBytesPerSecond = fContext->bit_rate / 8; +// int maxBytesPerSecond = (fContext->bit_rate +// + fContext->bit_rate_tolerance) / 8; +// +// if (fInputFormat.type == B_MEDIA_RAW_AUDIO) { +// fEncodeParameters.avg_field_size = (int32)(avgBytesPerSecond +// / fInputFormat.u.raw_audio.frame_rate); +// fEncodeParameters.max_field_size = (int32)(maxBytesPerSecond +// / fInputFormat.u.raw_audio.frame_rate); +// } else if (fInputFormat.type == B_MEDIA_RAW_VIDEO) { +// fEncodeParameters.avg_field_size = (int32)(avgBytesPerSecond +// / fInputFormat.u.raw_video.field_rate); +// fEncodeParameters.max_field_size = (int32)(maxBytesPerSecond +// / fInputFormat.u.raw_video.field_rate); +// } + + parameters->quality = fEncodeParameters.quality; + + return B_OK; +} + + +status_t +AVCodecEncoder::SetEncodeParameters(encode_parameters* parameters) +{ + TRACE("AVCodecEncoder::SetEncodeParameters(%p)\n", parameters); + + if (fFramesWritten > 0) + return B_NOT_SUPPORTED; + + fEncodeParameters.quality = parameters->quality; + TRACE(" quality: %.1f\n", parameters->quality); + +// TODO: Auto-bit_rate versus user supplied. See above. +// int avgBytesPerSecond = 0; +// int maxBytesPerSecond = 0; +// +// if (fInputFormat.type == B_MEDIA_RAW_AUDIO) { +// avgBytesPerSecond = (int)(parameters->avg_field_size +// * fInputFormat.u.raw_audio.frame_rate); +// maxBytesPerSecond = (int)(parameters->max_field_size +// * fInputFormat.u.raw_audio.frame_rate); +// } else if (fInputFormat.type == B_MEDIA_RAW_VIDEO) { +// avgBytesPerSecond = (int)(parameters->avg_field_size +// * fInputFormat.u.raw_video.field_rate); +// maxBytesPerSecond = (int)(parameters->max_field_size +// * fInputFormat.u.raw_video.field_rate); +// } +// +// if (maxBytesPerSecond < avgBytesPerSecond) +// maxBytesPerSecond = avgBytesPerSecond; +// +// // Reset these, so we can tell the difference between uninitialized +// // and initialized... +// if (avgBytesPerSecond > 0) { +// fContext->bit_rate = avgBytesPerSecond * 8; +// fContext->bit_rate_tolerance = (maxBytesPerSecond +// - avgBytesPerSecond) * 8; +// fBitRateControlledByUser = true; +// } + + return _Setup(); +} + + +status_t +AVCodecEncoder::Encode(const void* buffer, int64 frameCount, + media_encode_info* info) +{ + TRACE("AVCodecEncoder::Encode(%p, %lld, %p)\n", buffer, frameCount, info); + + if (!_OpenCodecIfNeeded()) + return B_NO_INIT; + + if (fInputFormat.type == B_MEDIA_RAW_AUDIO) + return _EncodeAudio(buffer, frameCount, info); + else if (fInputFormat.type == B_MEDIA_RAW_VIDEO) + return _EncodeVideo(buffer, frameCount, info); + else + return B_NO_INIT; +} + + +// #pragma mark - + + +status_t +AVCodecEncoder::_Setup() +{ + TRACE("AVCodecEncoder::_Setup\n"); + if (fInputFormat.type == B_MEDIA_RAW_VIDEO) { + TRACE(" B_MEDIA_RAW_VIDEO\n"); // frame rate fContext->time_base.den = (int)fInputFormat.u.raw_video.field_rate; fContext->time_base.num = 1; @@ -144,7 +252,15 @@ // fContext->rc_max_rate = 0; // fContext->rc_min_rate = 0; // TODO: Try to calculate a good bit rate... - fContext->bit_rate = 800000; + int rawBitRate = (int)(fContext->width * fContext->height * 2 + * fInputFormat.u.raw_video.field_rate) * 8; + int wantedBitRate = (int)(rawBitRate / fBitRateScale + * fEncodeParameters.quality); + TRACE(" rawBitRate: %d, wantedBitRate: %d (%.1f)\n", rawBitRate, + wantedBitRate, fEncodeParameters.quality); + // TODO: Support letting the user overwrite this via + // SetEncodeParameters(). See comments there... + fContext->bit_rate = wantedBitRate; // Pixel aspect ratio fContext->sample_aspect_ratio.num @@ -188,6 +304,7 @@ fContext->pix_fmt, SWS_BICUBIC, NULL, NULL, NULL); } else if (fInputFormat.type == B_MEDIA_RAW_AUDIO) { + TRACE(" B_MEDIA_RAW_AUDIO\n"); // frame rate fContext->sample_rate = (int)fInputFormat.u.raw_audio.frame_rate; // NOTE: From the output_example.c, it looks like we are not supposed @@ -252,6 +369,7 @@ fContext->channel_layout = fInputFormat.u.raw_audio.channel_mask; } } else { + TRACE(" UNSUPPORTED MEDIA TYPE!\n"); return B_NOT_SUPPORTED; } @@ -266,55 +384,46 @@ fContext->mb_decision = 2; } - // Open the codec - int result = avcodec_open(fContext, fCodec); - fCodecInitDone = (result >= 0); - - TRACE(" avcodec_open(): %d\n", result); - - return fCodecInitDone ? B_OK : B_ERROR; + // Unfortunately, we may fail later, when we try to open the codec + // for real... but we need to delay this because we still allow + // parameter/quality changes. + return B_OK; } -status_t -AVCodecEncoder::GetEncodeParameters(encode_parameters* parameters) const +bool +AVCodecEncoder::_OpenCodecIfNeeded() { - TRACE("AVCodecEncoder::GetEncodeParameters(%p)\n", parameters); + if (fCodecInitStatus == CODEC_INIT_DONE) + return true; - return B_NOT_SUPPORTED; -} + if (fCodecInitStatus == CODEC_INIT_FAILED) + return false; + // Open the codec + int result = avcodec_open(fContext, fCodec); + if (result >= 0) + fCodecInitStatus = CODEC_INIT_DONE; + else + fCodecInitStatus = CODEC_INIT_FAILED; -status_t -AVCodecEncoder::SetEncodeParameters(encode_parameters* parameters) const -{ - TRACE("AVCodecEncoder::SetEncodeParameters(%p)\n", parameters); + TRACE(" avcodec_open(): %d\n", result); - return B_NOT_SUPPORTED; + return fCodecInitStatus == CODEC_INIT_DONE; + } -status_t -AVCodecEncoder::Encode(const void* buffer, int64 frameCount, - media_encode_info* info) +void +AVCodecEncoder::_CloseCodecIfNeeded() { - TRACE("AVCodecEncoder::Encode(%p, %lld, %p)\n", buffer, frameCount, info); - - if (!fCodecInitDone) - return B_NO_INIT; - - if (fInputFormat.type == B_MEDIA_RAW_AUDIO) - return _EncodeAudio(buffer, frameCount, info); - else if (fInputFormat.type == B_MEDIA_RAW_VIDEO) - return _EncodeVideo(buffer, frameCount, info); - else - return B_NO_INIT; + if (fCodecInitStatus == CODEC_INIT_DONE) { + avcodec_close(fContext); + fCodecInitStatus = CODEC_INIT_NEEDED; + } } -// #pragma mark - - - static const int64 kNoPTSValue = 0x8000000000000000LL; // NOTE: For some reasons, I have trouble with the avcodec.h define: // #define AV_NOPTS_VALUE INT64_C(0x8000000000000000) Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.h =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.h 2009-08-05 10:11:06 UTC (rev 32123) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.h 2009-08-05 10:21:36 UTC (rev 32124) @@ -19,7 +19,8 @@ class AVCodecEncoder : public Encoder { public: - AVCodecEncoder(uint32 codecID); + AVCodecEncoder(uint32 codecID, + int bitRateScale); virtual ~AVCodecEncoder(); @@ -32,7 +33,7 @@ virtual status_t GetEncodeParameters( encode_parameters* parameters) const; virtual status_t SetEncodeParameters( - encode_parameters* parameters) const; + encode_parameters* parameters); virtual status_t Encode(const void* buffer, int64 frameCount, media_encode_info* info); @@ -42,6 +43,11 @@ // codec buffer size. private: + status_t _Setup(); + + bool _OpenCodecIfNeeded(); + void _CloseCodecIfNeeded(); + status_t _EncodeAudio(const void* buffer, int64 frameCount, media_encode_info* info); @@ -55,13 +61,21 @@ private: media_format fInputFormat; + encode_parameters fEncodeParameters; + int fBitRateScale; // FFmpeg related members // TODO: Refactor common base class from AVCodec[De|En]Coder! AVCodec* fCodec; AVCodecContext* fContext; - bool fCodecInitDone; + enum { + CODEC_INIT_NEEDED = 0, + CODEC_INIT_DONE, + CODEC_INIT_FAILED + }; + uint32 fCodecInitStatus; + // For video (color space conversion): AVPicture fSrcFrame; AVPicture fDstFrame; Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/EncoderTable.cpp =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/EncoderTable.cpp 2009-08-05 10:11:06 UTC (rev 32123) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/EncoderTable.cpp 2009-08-05 10:21:36 UTC (rev 32124) @@ -22,7 +22,8 @@ }, B_ANY_FORMAT_FAMILY, // TODO: Hm, actually not really /any/ family... B_MEDIA_RAW_VIDEO, - B_MEDIA_ENCODED_VIDEO + B_MEDIA_ENCODED_VIDEO, + 23 }, { { @@ -34,7 +35,8 @@ }, B_MPEG_FORMAT_FAMILY, B_MEDIA_RAW_VIDEO, - B_MEDIA_ENCODED_VIDEO + B_MEDIA_ENCODED_VIDEO, + 10 }, { { @@ -46,7 +48,8 @@ }, B_MPEG_FORMAT_FAMILY, B_MEDIA_RAW_VIDEO, - B_MEDIA_ENCODED_VIDEO + B_MEDIA_ENCODED_VIDEO, + 15 }, { { @@ -58,7 +61,8 @@ }, B_ANY_FORMAT_FAMILY, B_MEDIA_RAW_AUDIO, - B_MEDIA_ENCODED_AUDIO + B_MEDIA_ENCODED_AUDIO, + 1 }, { { @@ -70,7 +74,8 @@ }, B_ANY_FORMAT_FAMILY, B_MEDIA_RAW_AUDIO, - B_MEDIA_ENCODED_AUDIO + B_MEDIA_ENCODED_AUDIO, + 10 } }; Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/EncoderTable.h =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/EncoderTable.h 2009-08-05 10:11:06 UTC (rev 32123) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/EncoderTable.h 2009-08-05 10:21:36 UTC (rev 32124) @@ -14,6 +14,7 @@ media_format_family format_family; media_type input_type; media_type output_type; + int bit_rate_scale; }; Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/FFmpegPlugin.cpp =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/FFmpegPlugin.cpp 2009-08-05 10:11:06 UTC (rev 32123) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/FFmpegPlugin.cpp 2009-08-05 10:21:36 UTC (rev 32124) @@ -134,7 +134,13 @@ Encoder* FFmpegPlugin::NewEncoder(const media_codec_info& codecInfo) { - return new(std::nothrow)AVCodecEncoder(codecInfo.sub_id); + for (size_t i = 0; i < gEncoderCount; i++) { + if (codecInfo.sub_id == gEncoderTable[i].codec_info.sub_id) { + return new(std::nothrow)AVCodecEncoder(codecInfo.sub_id, + gEncoderTable[i].bit_rate_scale); + } + } + return NULL; } Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/MuxerTable.cpp =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/MuxerTable.cpp 2009-08-05 10:11:06 UTC (rev 32123) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/MuxerTable.cpp 2009-08-05 10:21:36 UTC (rev 32124) @@ -38,6 +38,23 @@ "mpg", { 0 } }, +// TODO: This one rejects unknown codecs. We probably need to define +// a media_format_family for it so that Encoders can announce their support +// for it specifically. +// { +// media_file_format::B_WRITABLE +// | media_file_format::B_KNOWS_ENCODED_VIDEO +// | media_file_format::B_KNOWS_ENCODED_AUDIO, +// { 0 }, +// B_AVI_FORMAT_FAMILY, +// 100, +// { 0 }, +// "application/ogg", +// "Ogg (Xiph.Org Foundation)", +// "ogg", +// "ogg", +// { 0 } +// }, }; const size_t gMuxerCount = sizeof(gMuxerTable) / sizeof(media_file_format); Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/config.h =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/config.h 2009-08-05 10:11:06 UTC (rev 32123) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/config.h 2009-08-05 10:21:36 UTC (rev 32124) @@ -686,7 +686,7 @@ #define CONFIG_MXF_D10_MUXER 0 #define CONFIG_NULL_MUXER 0 #define CONFIG_NUT_MUXER 0 -#define CONFIG_OGG_MUXER 0 +#define CONFIG_OGG_MUXER 1 #define CONFIG_PCM_ALAW_MUXER 0 #define CONFIG_PCM_MULAW_MUXER 0 #define CONFIG_PCM_F64BE_MUXER 0 Modified: haiku/trunk/src/kits/media/EncoderPlugin.cpp =================================================================== --- haiku/trunk/src/kits/media/EncoderPlugin.cpp 2009-08-05 10:11:06 UTC (rev 32123) +++ haiku/trunk/src/kits/media/EncoderPlugin.cpp 2009-08-05 10:21:36 UTC (rev 32124) @@ -26,6 +26,9 @@ } +// #pragma mark - Convenience stubs + + status_t Encoder::AddTrackInfo(uint32 code, const void* data, size_t size, uint32 flags) { @@ -33,7 +36,35 @@ } +BView* +Encoder::ParameterView() +{ + return NULL; +} + + +BParameterWeb* +Encoder::ParameterWeb() +{ + return NULL; +} + + status_t +Encoder::GetParameterValue(int32 id, void* value, size_t* size) const +{ + return B_NOT_SUPPORTED; +} + + +status_t +Encoder::SetParameterValue(int32 id, const void* value, size_t size) +{ + return B_NOT_SUPPORTED; +} + + +status_t Encoder::GetEncodeParameters(encode_parameters* parameters) const { return B_NOT_SUPPORTED; @@ -41,12 +72,15 @@ status_t -Encoder::SetEncodeParameters(encode_parameters* parameters) const +Encoder::SetEncodeParameters(encode_parameters* parameters) { return B_NOT_SUPPORTED; } +// #pragma mark - + + status_t Encoder::WriteChunk(const void* chunkBuffer, size_t chunkSize, media_encode_info* encodeInfo) @@ -63,6 +97,9 @@ } +// #pragma mark - FBC padding + + status_t Encoder::Perform(perform_code code, void* data) { @@ -75,9 +112,24 @@ void Encoder::_ReservedEncoder3() {} void Encoder::_ReservedEncoder4() {} void Encoder::_ReservedEncoder5() {} +void Encoder::_ReservedEncoder6() {} +void Encoder::_ReservedEncoder7() {} +void Encoder::_ReservedEncoder8() {} +void Encoder::_ReservedEncoder9() {} +void Encoder::_ReservedEncoder10() {} +void Encoder::_ReservedEncoder11() {} +void Encoder::_ReservedEncoder12() {} +void Encoder::_ReservedEncoder13() {} +void Encoder::_ReservedEncoder14() {} +void Encoder::_ReservedEncoder15() {} +void Encoder::_ReservedEncoder16() {} +void Encoder::_ReservedEncoder17() {} +void Encoder::_ReservedEncoder18() {} +void Encoder::_ReservedEncoder19() {} +void Encoder::_ReservedEncoder20() {} -// #pragma mark - +// #pragma mark - EncoderPlugin EncoderPlugin::EncoderPlugin() Modified: haiku/trunk/src/kits/media/MediaTrack.cpp =================================================================== --- haiku/trunk/src/kits/media/MediaTrack.cpp 2009-08-05 10:11:06 UTC (rev 32123) +++ haiku/trunk/src/kits/media/MediaTrack.cpp 2009-08-05 10:21:36 UTC (rev 32124) @@ -76,6 +76,7 @@ CALLED(); _plugin_manager.DestroyDecoder(fRawDecoder); _plugin_manager.DestroyDecoder(fDecoder); + _plugin_manager.DestroyDecoder(fEncoder); } /************************************************************* @@ -321,28 +322,31 @@ status_t -BMediaTrack::ReplaceFrames(const void *in_buffer, - int64 *io_frameCount, - const media_header *mh) +BMediaTrack::ReplaceFrames(const void* inBuffer, int64* inOutFrameCount, + const media_header* mediaHeader) { UNIMPLEMENTED(); - return B_OK; + // TODO: Actually, a file is either open for reading or writing at the + // moment. Since the chunk size of encoded media data will change, + // implementing this call will only be possible for raw media tracks. + + return B_NOT_SUPPORTED; } status_t -BMediaTrack::SeekToTime(bigtime_t *inout_time, int32 flags) +BMediaTrack::SeekToTime(bigtime_t* inOutTime, int32 flags) { CALLED(); if (!fDecoder || !fExtractor) return B_NO_INIT; - if (!inout_time) + if (!inOutTime) return B_BAD_VALUE; uint32 seekTo = (flags & B_MEDIA_SEEK_DIRECTION_MASK) | B_MEDIA_SEEK_TO_TIME; - bigtime_t seekTime = *inout_time; + bigtime_t seekTime = *inOutTime; int64 frame = 0; bigtime_t time = seekTime; @@ -355,7 +359,7 @@ // TODO: Codecs cannot actually "seek" in the stream, all they // can do is "reset" their decoder state, since they are made // aware of the fact that there will be a jump in the data. Maybe - // rename the codec method? + // rename the Decoder method? result = fDecoder->Seek(seekTo, 0, &frame, seekTime, &time); if (result != B_OK) { ERROR("BMediaTrack::SeekToTime: decoder seek failed\n"); @@ -370,11 +374,12 @@ } } - *inout_time = time; + *inOutTime = time; fCurFrame = frame; fCurTime = time; - PRINT(1, "BMediaTrack::SeekToTime finished, requested %.6f, result %.6f\n", seekTime / 1000000.0, *inout_time / 1000000.0); + PRINT(1, "BMediaTrack::SeekToTime finished, requested %.6f, result %.6f\n", + seekTime / 1000000.0, *inOutTime / 1000000.0); return B_OK; } @@ -589,102 +594,142 @@ BParameterWeb* BMediaTrack::Web() { - UNIMPLEMENTED(); + BParameterWeb* web; + if (GetParameterWeb(&web) == B_OK) + return web; return NULL; } -// returns a copy of the parameter web status_t BMediaTrack::GetParameterWeb(BParameterWeb** outWeb) { - UNIMPLEMENTED(); + if (outWeb == NULL) + return B_BAD_VALUE; - return B_OK; + if (fEncoder == NULL) + return B_NO_INIT; + + // TODO: This method is new in Haiku. The header mentions it returns a + // copy. But how could it even do that? How can one clone a web and make + // it point to the same BControllable? + *outWeb = fEncoder->ParameterWeb(); + if (*outWeb != NULL) + return B_OK; + + return B_NOT_SUPPORTED; } status_t -BMediaTrack::GetParameterValue(int32 id, - void *valu, - size_t *size) +BMediaTrack::GetParameterValue(int32 id, void* value, size_t* size) { - UNIMPLEMENTED(); + if (value == NULL || size == NULL) + return B_BAD_VALUE; - return B_ERROR; + if (fEncoder == NULL) + return B_NO_INIT; + + return fEncoder->GetParameterValue(id, value, size); } status_t -BMediaTrack::SetParameterValue(int32 id, - const void *valu, - size_t size) +BMediaTrack::SetParameterValue(int32 id, const void* value, size_t size) { - UNIMPLEMENTED(); + if (value == NULL || size == 0) + return B_BAD_VALUE; - return B_ERROR; + if (fEncoder == NULL) + return B_NO_INIT; + + return fEncoder->SetParameterValue(id, value, size); } -BView * +BView* BMediaTrack::GetParameterView() { - UNIMPLEMENTED(); - return NULL; + if (fEncoder == NULL) + return NULL; + + return fEncoder->ParameterView(); } status_t -BMediaTrack::GetQuality(float *quality) +BMediaTrack::GetQuality(float* quality) { - UNIMPLEMENTED(); + if (quality == NULL) + return B_BAD_VALUE; - return B_ERROR; + encode_parameters parameters; + status_t ret = GetEncodeParameters(¶meters); + if (ret != B_OK) + return ret; + + *quality = parameters.quality; + + return B_OK; } status_t BMediaTrack::SetQuality(float quality) { - UNIMPLEMENTED(); + encode_parameters parameters; + status_t ret = GetEncodeParameters(¶meters); + if (ret != B_OK) + return ret; - return B_ERROR; + if (quality < 0.0f) + quality = 0.0f; + if (quality > 1.0f) + quality = 1.0f; + + parameters.quality = quality; + + return SetEncodeParameters(¶meters); } status_t -BMediaTrack::GetEncodeParameters(encode_parameters *parameters) const +BMediaTrack::GetEncodeParameters(encode_parameters* parameters) const { - UNIMPLEMENTED(); + if (parameters == NULL) + return B_BAD_VALUE; - return B_ERROR; + if (fEncoder == NULL) + return B_NO_INIT; + + return fEncoder->GetEncodeParameters(parameters); } status_t BMediaTrack::SetEncodeParameters(encode_parameters *parameters) { - UNIMPLEMENTED(); + if (parameters == NULL) + return B_BAD_VALUE; - return B_ERROR; + if (fEncoder == NULL) + return B_NO_INIT; + + return fEncoder->SetEncodeParameters(parameters); } status_t -BMediaTrack::Perform(int32 selector, - void *data) +BMediaTrack::Perform(int32 selector, void* data) { - UNIMPLEMENTED(); - - return B_ERROR; + return B_OK; } -/************************************************************* - * private BMediaTrack - *************************************************************/ +// #pragma mark - private -BMediaTrack::BMediaTrack(BPrivate::media::MediaExtractor *extractor, - int32 stream) + +BMediaTrack::BMediaTrack(BPrivate::media::MediaExtractor* extractor, + int32 stream) { CALLED(); fWorkaroundFlags = 0; From stippi at mail.berlios.de Wed Aug 5 12:22:53 2009 From: stippi at mail.berlios.de (stippi at mail.berlios.de) Date: Wed, 5 Aug 2009 12:22:53 +0200 Subject: [Haiku-commits] r32125 - haiku/trunk/src/kits/media Message-ID: <200908051022.n75AMrEt000659@sheep.berlios.de> Author: stippi Date: 2009-08-05 12:22:52 +0200 (Wed, 05 Aug 2009) New Revision: 32125 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32125&view=rev Modified: haiku/trunk/src/kits/media/MediaTrack.cpp Log: Fixed last minute change that I apparently didn't compile. Sorry. Modified: haiku/trunk/src/kits/media/MediaTrack.cpp =================================================================== --- haiku/trunk/src/kits/media/MediaTrack.cpp 2009-08-05 10:21:36 UTC (rev 32124) +++ haiku/trunk/src/kits/media/MediaTrack.cpp 2009-08-05 10:22:52 UTC (rev 32125) @@ -76,7 +76,7 @@ CALLED(); _plugin_manager.DestroyDecoder(fRawDecoder); _plugin_manager.DestroyDecoder(fDecoder); - _plugin_manager.DestroyDecoder(fEncoder); + _plugin_manager.DestroyEncoder(fEncoder); } /************************************************************* From stippi at mail.berlios.de Wed Aug 5 12:40:09 2009 From: stippi at mail.berlios.de (stippi at mail.berlios.de) Date: Wed, 5 Aug 2009 12:40:09 +0200 Subject: [Haiku-commits] r32126 - haiku/trunk/src/add-ons/media/plugins/ffmpeg Message-ID: <200908051040.n75Ae9CZ010188@sheep.berlios.de> Author: stippi Date: 2009-08-05 12:40:06 +0200 (Wed, 05 Aug 2009) New Revision: 32126 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32126&view=rev Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp Log: Fixed bugs when freeing the AVCodecEncoder. Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp 2009-08-05 10:22:52 UTC (rev 32125) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp 2009-08-05 10:40:06 UTC (rev 32126) @@ -54,6 +54,16 @@ av_fifo_init(&fAudioFifo, 0); + fDstFrame.data[0] = NULL; + fDstFrame.data[1] = NULL; + fDstFrame.data[2] = NULL; + fDstFrame.data[3] = NULL; + + fDstFrame.linesize[0] = 0; + fDstFrame.linesize[1] = 0; + fDstFrame.linesize[2] = 0; + fDstFrame.linesize[3] = 0; + // Initial parameters, so we know if the user changed them fEncodeParameters.avg_field_size = 0; fEncodeParameters.max_field_size = 0; @@ -67,7 +77,8 @@ _CloseCodecIfNeeded(); - sws_freeContext(fSwsContext); + if (fSwsContext != NULL) + sws_freeContext(fSwsContext); av_fifo_free(&fAudioFifo); From jackburton at mail.berlios.de Wed Aug 5 13:00:41 2009 From: jackburton at mail.berlios.de (jackburton at mail.berlios.de) Date: Wed, 5 Aug 2009 13:00:41 +0200 Subject: [Haiku-commits] r32127 - haiku/trunk/src/kits/interface Message-ID: <200908051100.n75B0f1p030685@sheep.berlios.de> Author: jackburton Date: 2009-08-05 13:00:35 +0200 (Wed, 05 Aug 2009) New Revision: 32127 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32127&view=rev Modified: haiku/trunk/src/kits/interface/MenuItem.cpp Log: fixed copy/paste error which caused bug #4186. Sorry Modified: haiku/trunk/src/kits/interface/MenuItem.cpp =================================================================== --- haiku/trunk/src/kits/interface/MenuItem.cpp 2009-08-05 10:40:06 UTC (rev 32126) +++ haiku/trunk/src/kits/interface/MenuItem.cpp 2009-08-05 11:00:35 UTC (rev 32127) @@ -754,7 +754,7 @@ } if (fModifiers & B_SHIFT_KEY) { - const BBitmap *shift = MenuPrivate::MenuItemOption(); + const BBitmap *shift = MenuPrivate::MenuItemShift(); const BRect &rect = shift->Bounds(); where.x -= rect.Width() + 1; fSuper->DrawBitmap(shift, where); From axeld at mail.berlios.de Wed Aug 5 13:10:01 2009 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Wed, 5 Aug 2009 13:10:01 +0200 Subject: [Haiku-commits] r32128 - haiku/trunk/src/bin Message-ID: <200908051110.n75BA1PY006418@sheep.berlios.de> Author: axeld Date: 2009-08-05 13:09:59 +0200 (Wed, 05 Aug 2009) New Revision: 32128 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32128&view=rev Modified: haiku/trunk/src/bin/mountvolume.cpp Log: * "mountvolume" now can also mount by device path. Modified: haiku/trunk/src/bin/mountvolume.cpp =================================================================== --- haiku/trunk/src/bin/mountvolume.cpp 2009-08-05 11:00:35 UTC (rev 32127) +++ haiku/trunk/src/bin/mountvolume.cpp 2009-08-05 11:09:59 UTC (rev 32128) @@ -368,16 +368,25 @@ if (entry.GetPath(&path) != B_OK) continue; - // a file with this name exists, so try to mount it - partition_id id = roster.RegisterFileDevice(path.Path()); - if (id < B_OK) - continue; - + partition_id id = -1; BDiskDevice device; BPartition* partition; - if (roster.GetPartitionWithID(id, &device, &partition) != B_OK) { - roster.UnregisterFileDevice(id); - continue; + + if (!strncmp(path.Path(), "/dev/", 5)) { + // seems to be a device path + if (roster.GetPartitionForPath(path.Path(), &device, &partition) + != B_OK) + continue; + } else { + // a file with this name exists, so try to mount it + id = roster.RegisterFileDevice(path.Path()); + if (id < 0) + continue; + + if (roster.GetPartitionWithID(id, &device, &partition) != B_OK) { + roster.UnregisterFileDevice(id); + continue; + } } status_t status = partition->Mount(NULL, @@ -386,14 +395,14 @@ if (status >= B_OK) { BPath mountPoint; partition->GetMountPoint(&mountPoint); - printf("Image \"%s\" mounted successfully at \"%s\".\n", name, - mountPoint.Path()); + printf("%s \"%s\" mounted successfully at \"%s\".\n", + id < 0 ? "Device" : "Image", name, mountPoint.Path()); } } if (status >= B_OK) { // remove from list mountVisitor.toMount.erase(name); - } else + } else if (id >= 0) roster.UnregisterFileDevice(id); } From ingo_weinhold at gmx.de Wed Aug 5 13:46:44 2009 From: ingo_weinhold at gmx.de (Ingo Weinhold) Date: Wed, 05 Aug 2009 13:46:44 +0200 Subject: [Haiku-commits] r32118 - haiku/trunk/src/system/kernel/arch/x86 In-Reply-To: <3974745493-BeMail@zon> References: <3974745493-BeMail@zon> Message-ID: <20090805134644.391.1@knochen-vm.localdomain> On 2009-08-05 at 08:45:36 [+0200], Axel D?rfler wrote: > Ingo Weinhold wrote: > > Anyway, I actually don't quite see why the triple fault happened. I > > understand the double fault, but our double fault handler uses the > > kernel > > page directory (and already did so even before my changes), so it > > should have > > safely run into the kernel debugger. > > arch_vm_translation_map_init_map() copies the kernel page directory to > the user page directory, if that contains garbage (or 0xdeadbeef), the > kernel memory is not available anymore. With user team page directories, yes, but why would that affect the double fault handler, which always uses the kernel page directory? CU, Ingo From axeld at pinc-software.de Wed Aug 5 14:50:28 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Wed, 05 Aug 2009 14:50:28 +0200 CEST Subject: [Haiku-commits] r32118 - haiku/trunk/src/system/kernel/arch/x86 In-Reply-To: <20090805134644.391.1@knochen-vm.localdomain> Message-ID: <25866853455-BeMail@zon> Ingo Weinhold wrote: > On 2009-08-05 at 08:45:36 [+0200], Axel D?rfler > > wrote: > > Ingo Weinhold wrote: > > > Anyway, I actually don't quite see why the triple fault happened. > > > I > > > understand the double fault, but our double fault handler uses > > > the > > > kernel > > > page directory (and already did so even before my changes), so it > > > should have > > > safely run into the kernel debugger. > > arch_vm_translation_map_init_map() copies the kernel page directory > > to > > the user page directory, if that contains garbage (or 0xdeadbeef), > > the > > kernel memory is not available anymore. > With user team page directories, yes, but why would that affect the > double > fault handler, which always uses the kernel page directory? If that's really the case, then you're right indeed :-) And then I have no idea, unfortunately. Bye, Axel. From axeld at mail.berlios.de Wed Aug 5 15:05:58 2009 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Wed, 5 Aug 2009 15:05:58 +0200 Subject: [Haiku-commits] r32129 - haiku/trunk/src/system/kernel/cache Message-ID: <200908051305.n75D5wdq005514@sheep.berlios.de> Author: axeld Date: 2009-08-05 15:05:58 +0200 (Wed, 05 Aug 2009) New Revision: 32129 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32129&view=rev Modified: haiku/trunk/src/system/kernel/cache/file_map.cpp Log: * FileMap::Translate() did not choke on negative offsets, and _Cache() does not necessarily return an error in this case. Modified: haiku/trunk/src/system/kernel/cache/file_map.cpp =================================================================== --- haiku/trunk/src/system/kernel/cache/file_map.cpp 2009-08-05 11:09:59 UTC (rev 32128) +++ haiku/trunk/src/system/kernel/cache/file_map.cpp 2009-08-05 13:05:58 UTC (rev 32129) @@ -393,6 +393,9 @@ FileMap::Translate(off_t offset, size_t size, file_io_vec* vecs, size_t* _count, size_t align) { + if (offset < 0) + return B_BAD_VALUE; + MutexLocker _(fLock); size_t maxVecs = *_count; From pulkomandy at mail.berlios.de Wed Aug 5 15:34:26 2009 From: pulkomandy at mail.berlios.de (pulkomandy at BerliOS) Date: Wed, 5 Aug 2009 15:34:26 +0200 Subject: [Haiku-commits] r32130 - in haiku/branches/components/gsoc-locale-kit: headers/os/locale src/kits/locale src/preferences/locale src/tools/locale Message-ID: <200908051334.n75DYQR4016623@sheep.berlios.de> Author: pulkomandy Date: 2009-08-05 15:34:25 +0200 (Wed, 05 Aug 2009) New Revision: 32130 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32130&view=rev Modified: haiku/branches/components/gsoc-locale-kit/headers/os/locale/Country.h haiku/branches/components/gsoc-locale-kit/headers/os/locale/LocaleRoster.h haiku/branches/components/gsoc-locale-kit/src/kits/locale/Country.cpp haiku/branches/components/gsoc-locale-kit/src/kits/locale/Jamfile haiku/branches/components/gsoc-locale-kit/src/kits/locale/LocaleRoster.cpp haiku/branches/components/gsoc-locale-kit/src/preferences/locale/Jamfile haiku/branches/components/gsoc-locale-kit/src/preferences/locale/Locale.cpp haiku/branches/components/gsoc-locale-kit/src/preferences/locale/LocaleWindow.cpp haiku/branches/components/gsoc-locale-kit/src/preferences/locale/LocaleWindow.h haiku/branches/components/gsoc-locale-kit/src/preferences/locale/TimeFormatSettingsView.cpp haiku/branches/components/gsoc-locale-kit/src/preferences/locale/TimeFormatSettingsView.h haiku/branches/components/gsoc-locale-kit/src/tools/locale/Jamfile Log: - Renamed the locale preflet class from Locale to LocalePreflet to avoid conflict with ICU Locale class - Cleanups - Modified BCountry to use ICU's Locale class - It is now possible to select a country in the Country tab of the preflet; The setting is saved and taken into account by the Locale kit. - The preflet displays an example date with the current settings. It's not yet updated in realtime when you select a new country. Modified: haiku/branches/components/gsoc-locale-kit/headers/os/locale/Country.h =================================================================== --- haiku/branches/components/gsoc-locale-kit/headers/os/locale/Country.h 2009-08-05 13:05:58 UTC (rev 32129) +++ haiku/branches/components/gsoc-locale-kit/headers/os/locale/Country.h 2009-08-05 13:34:25 UTC (rev 32130) @@ -6,6 +6,9 @@ #include #include +#include + + enum { B_METRIC = 0, B_US @@ -14,7 +17,8 @@ class BCountry { public: - BCountry(); + BCountry(const char* languageCode, const char* countryCode); + BCountry(const char* languageAndCountryCode = "en_US"); virtual ~BCountry(); virtual const char *Name() const; @@ -24,9 +28,11 @@ // date & time - virtual void FormatDate(char *string,size_t maxSize,time_t time,bool longFormat); + virtual void FormatDate(char *string,size_t maxSize,time_t time, + bool longFormat); virtual void FormatDate(BString *string,time_t time,bool longFormat); - virtual void FormatTime(char *string,size_t maxSize,time_t time,bool longFormat); + virtual void FormatTime(char *string,size_t maxSize,time_t time, + bool longFormat); virtual void FormatTime(BString *string,time_t time,bool longFormat); const char *DateFormat(bool longFormat) const; @@ -54,7 +60,8 @@ // monetary - virtual ssize_t FormatMonetary(char *string,size_t maxSize,char *format, ...); + virtual ssize_t FormatMonetary(char *string,size_t maxSize,char *format, + ...); virtual ssize_t FormatMonetary(BString *string,char *format, ...); const char *CurrencySymbol() const; @@ -69,6 +76,7 @@ private: const char **fStrings; + Locale fICULocale; }; #endif /* _COUNTRY_H_ */ Modified: haiku/branches/components/gsoc-locale-kit/headers/os/locale/LocaleRoster.h =================================================================== --- haiku/branches/components/gsoc-locale-kit/headers/os/locale/LocaleRoster.h 2009-08-05 13:05:58 UTC (rev 32129) +++ haiku/branches/components/gsoc-locale-kit/headers/os/locale/LocaleRoster.h 2009-08-05 13:34:25 UTC (rev 32130) @@ -1,8 +1,10 @@ #ifndef _LOCALE_ROSTER_H_ #define _LOCALE_ROSTER_H_ + #include + class BLanguage; class BLocale; class BCollator; @@ -10,6 +12,8 @@ class BCatalog; class BCatalogAddOn; +struct entry_ref; + namespace BPrivate { class EditableCatalog; }; @@ -18,6 +22,7 @@ B_LOCALE_CHANGED = '_LCC', }; + class BLocaleRoster { public: @@ -43,33 +48,29 @@ // the message contains one or more 'language'-string-fields // which contain the language-name(s) - status_t GetInstalledCatalogs(BMessage *, - const char* sigPattern = NULL, - const char* langPattern = NULL, - int32 fingerprint = 0) const; + status_t GetInstalledCatalogs(BMessage *, const char* sigPattern = NULL, + const char* langPattern = NULL, int32 fingerprint = 0) const; // the message contains... static const char *kCatLangAttr; static const char *kCatSigAttr; static const char *kCatFingerprintAttr; - // + static const char *kCatManagerMimeType; static const char *kCatEditorMimeType; - // + static const char *kEmbeddedCatAttr; static int32 kEmbeddedCatResId; private: BCatalogAddOn* LoadCatalog(const char *signature, - const char *language = NULL, - int32 fingerprint = 0); + const char *language = NULL, int32 fingerprint = 0); BCatalogAddOn* LoadEmbeddedCatalog(entry_ref *appOrAddOnRef); status_t UnloadCatalog(BCatalogAddOn *addOn); - // + BCatalogAddOn* CreateCatalog(const char *type, - const char *signature, - const char *language); + const char *signature, const char *language); friend class BCatalog; friend class BPrivate::EditableCatalog; Modified: haiku/branches/components/gsoc-locale-kit/src/kits/locale/Country.cpp =================================================================== --- haiku/branches/components/gsoc-locale-kit/src/kits/locale/Country.cpp 2009-08-05 13:05:58 UTC (rev 32129) +++ haiku/branches/components/gsoc-locale-kit/src/kits/locale/Country.cpp 2009-08-05 13:34:25 UTC (rev 32130) @@ -7,6 +7,9 @@ #include #include +#include +#include + #include #include @@ -42,13 +45,20 @@ }; -BCountry::BCountry() - : - fStrings(gStrings) +BCountry::BCountry(const char* languageCode, const char* countryCode) + : fStrings(gStrings) + , fICULocale(languageCode, countryCode) { } +BCountry::BCountry(const char* languageAndCountryCode) + : fStrings(gStrings) + , fICULocale(languageAndCountryCode) +{ +} + + BCountry::BCountry(const char **strings) : fStrings(strings) @@ -88,6 +98,18 @@ void BCountry::FormatDate(BString *string, time_t time, bool longFormat) { + icu_4_2::DateFormat* dateFormatter; + dateFormatter = DateFormat::createDateInstance( + longFormat ? DateFormat::LONG : DateFormat::SHORT, + fICULocale); + //UDate myDate = Calendar::getNow(); + UnicodeString myString; + myString = dateFormatter->format(time, myString); + + string->Truncate(0); + BStringByteSink bbs(string); + + myString.toUTF8(bbs); } Modified: haiku/branches/components/gsoc-locale-kit/src/kits/locale/Jamfile =================================================================== --- haiku/branches/components/gsoc-locale-kit/src/kits/locale/Jamfile 2009-08-05 13:05:58 UTC (rev 32129) +++ haiku/branches/components/gsoc-locale-kit/src/kits/locale/Jamfile 2009-08-05 13:34:25 UTC (rev 32130) @@ -34,5 +34,5 @@ PropertyFile.cpp strfmon.cpp UnicodeChar.cpp - : be $(TARGET_LIBSTDC++) libicu-common.so + : be $(TARGET_LIBSTDC++) libicu-common.so libicu-i18n.so ; Modified: haiku/branches/components/gsoc-locale-kit/src/kits/locale/LocaleRoster.cpp =================================================================== --- haiku/branches/components/gsoc-locale-kit/src/kits/locale/LocaleRoster.cpp 2009-08-05 13:05:58 UTC (rev 32129) +++ haiku/branches/components/gsoc-locale-kit/src/kits/locale/LocaleRoster.cpp 2009-08-05 13:34:25 UTC (rev 32130) @@ -149,6 +149,7 @@ BLocker fLock; BList fCatalogAddOnInfos; BMessage fPreferredLanguages; + BString fCountryCodeName; RosterData(); ~RosterData(); @@ -178,12 +179,12 @@ // Load preferences to get the preffered languages BPath path; BFile file; - BMessage settingsMessage; - BString langName; if (find_directory(B_USER_SETTINGS_DIRECTORY, &path) == B_OK) { path.Append("Locale settings"); + BMessage settingsMessage; if (file.SetTo(path.Path(), B_READ_ONLY) == B_OK && settingsMessage.Unflatten(&file) == B_OK) { + BString langName; if (settingsMessage.FindString("language", &langName) == B_OK) { UErrorCode icuError = U_ZERO_ERROR; Locale icuLocale = Locale::createCanonical(langName.String()); @@ -197,15 +198,23 @@ Locale::setDefault(icuLocale,icuError); assert(icuError == U_ZERO_ERROR); fPreferredLanguages.RemoveName("language"); - for (int i=0; settingsMessage.FindString("language", i, &langName) - == B_OK; i++) { + for (int i = 0; settingsMessage.FindString("language", i, + &langName) == B_OK; i++) { fPreferredLanguages.AddString("language", langName); } - return; - } + } else + fPreferredLanguages.AddString("language", "en"); + + if (settingsMessage.FindString("country", &fCountryCodeName) != B_OK) + fCountryCodeName = "en_US"; + return; } } + + // Something went wrong (no settings file or invalid BMessage + // set everything to default values fPreferredLanguages.AddString("language", "en"); + fCountryCodeName = "en_US"; log_team(LOG_ERR,"*** No language preference found!\n"); } @@ -428,7 +437,11 @@ { if (!country) return B_BAD_VALUE; - *country = new(std::nothrow) BCountry(); + + BAutolock lock(gRosterData.fLock); + assert(lock.IsLocked()); + + *country = new(std::nothrow) BCountry(gRosterData.fCountryCodeName.String()); return B_OK; } Modified: haiku/branches/components/gsoc-locale-kit/src/preferences/locale/Jamfile =================================================================== --- haiku/branches/components/gsoc-locale-kit/src/preferences/locale/Jamfile 2009-08-05 13:05:58 UTC (rev 32129) +++ haiku/branches/components/gsoc-locale-kit/src/preferences/locale/Jamfile 2009-08-05 13:34:25 UTC (rev 32130) @@ -7,7 +7,8 @@ Locale.cpp LocaleWindow.cpp TimeFormatSettingsView.cpp - : be liblocale.so $(TARGET_LIBSUPC++) libicu-common.so + : be liblocale.so $(TARGET_LIBSTDC++) $(TARGET_LIBSUPC++) libicu-common.so + libicu-data.so : Locale.rdef ; Modified: haiku/branches/components/gsoc-locale-kit/src/preferences/locale/Locale.cpp =================================================================== --- haiku/branches/components/gsoc-locale-kit/src/preferences/locale/Locale.cpp 2009-08-05 13:05:58 UTC (rev 32129) +++ haiku/branches/components/gsoc-locale-kit/src/preferences/locale/Locale.cpp 2009-08-05 13:34:25 UTC (rev 32130) @@ -44,10 +44,10 @@ }; -class Locale : public BApplication { +class LocalePreflet : public BApplication { public: - Locale(); - virtual ~Locale(); + LocalePreflet(); + virtual ~LocalePreflet(); virtual void ReadyToRun(); virtual void MessageReceived(BMessage *message); @@ -78,6 +78,7 @@ // set default prefs fMessage.AddRect("window_frame", BRect(50, 50, 550, 500)); fMessage.AddString("language", "en"); + fMessage.AddString("country", "en_US"); return; } } @@ -123,10 +124,15 @@ if (message->FindString("language",&langName) == B_OK) { // Remove any old data as we know we have newer one to replace it fMessage.RemoveName("language"); - for (int i=0; message->FindString("language", i, &langName) == B_OK; i++) + for (int i = 0; message->FindString("language", i, &langName) == B_OK; + i++) fMessage.AddString("language", langName); } + if (message->FindString("country",&langName) == B_OK) + fMessage.ReplaceString("country", langName); + + fUpdated = true; } @@ -134,7 +140,7 @@ // #pragma mark - -Locale::Locale() +LocalePreflet::LocalePreflet() : BApplication(kSignature) { fWindowFrame = fSettings.Message().FindRect("window_frame"); @@ -146,13 +152,13 @@ } -Locale::~Locale() +LocalePreflet::~LocalePreflet() { } void -Locale::ReadyToRun() +LocalePreflet::ReadyToRun() { // are there already windows open? if (CountWindows() != 1) @@ -164,7 +170,7 @@ void -Locale::MessageReceived(BMessage *message) +LocalePreflet::MessageReceived(BMessage *message) { switch (message->what) { case kMsgSettingsChanged: @@ -179,7 +185,7 @@ void -Locale::AboutRequested() +LocalePreflet::AboutRequested() { BAlert *alert = new BAlert("about", TR("Locale\n" "\twritten by Axel D?rfler\n" @@ -199,7 +205,7 @@ bool -Locale::QuitRequested() +LocalePreflet::QuitRequested() { return true; } @@ -211,7 +217,7 @@ int main(int argc, char **argv) { - Locale app; + LocalePreflet app; app.Run(); return 0; Modified: haiku/branches/components/gsoc-locale-kit/src/preferences/locale/LocaleWindow.cpp =================================================================== --- haiku/branches/components/gsoc-locale-kit/src/preferences/locale/LocaleWindow.cpp 2009-08-05 13:05:58 UTC (rev 32129) +++ haiku/branches/components/gsoc-locale-kit/src/preferences/locale/LocaleWindow.cpp 2009-08-05 13:34:25 UTC (rev 32130) @@ -25,6 +25,7 @@ #include #include +#include #include "TimeFormatSettingsView.h" @@ -214,8 +215,8 @@ // let all selected items, that fit into our drag_bitmap, draw for (int32 i = 0; i < numItems; i++) { int32 index = CurrentSelection(i); - LanguageListItem* item = - static_cast(ItemAt(index)); + LanguageListItem* item + = static_cast(ItemAt(index)); itemBounds.bottom = itemBounds.top + ceilf(item->Height()); if (itemBounds.bottom > dragRect.bottom) itemBounds.bottom = dragRect.bottom; @@ -293,7 +294,7 @@ int32 count = CountItems(); if (fDropIndex == count) { BRect r; - if (BListItem* item = ItemAt(count - 1)) { + if (ItemAt(count - 1)) { r = ItemFrame(count - 1); r.top = r.bottom; r.bottom = r.top + 1.0; @@ -365,8 +366,8 @@ // Now get an human-readable, loacalized name for each language // TODO: sort them using collators. - Locale currentLocale = - Locale::createFromName(currentLanguage.String()); + Locale currentLocale + = Locale::createFromName(currentLanguage.String()); UnicodeString languageFullName; BString str; BStringByteSink bbs(&str); @@ -397,10 +398,11 @@ BMessage msg; be_locale_roster->GetPreferredLanguages(&msg); BString langCode; - for(int index = 0; msg.FindString("language", index, &langCode) == B_OK; + for (int index = 0; msg.FindString("language", index, &langCode) + == B_OK; index++) { - for(int listPos = 0; LanguageListItem* lli = - static_cast(listView->ItemAt(listPos)); + for (int listPos = 0; LanguageListItem* lli + = static_cast(listView->ItemAt(listPos)); listPos++) { if(langCode == lli->getLanguageCode()) { fPreferredListView->AddItem(lli); @@ -430,20 +432,41 @@ tabView->AddTab(tab); { - TimeFormatSettingsView* timeFormatSettings = + BListView* listView = new BListView("country", B_SINGLE_SELECTION_LIST); + BScrollView *scrollView = new BScrollView("scroller", + listView, 0, false, true, B_FANCY_BORDER); + + BMessage* msg = new BMessage('csel'); + listView->SetSelectionMessage(msg); + + + // get all available countries from ICU + // Use DateFormat::getAvailableLocale so we get only the one we can + // use. Maybe check the NumberFormat one and see if there is more. + int32_t localeCount; + const Locale* currentLocale + = Locale::getAvailableLocales(localeCount); + for(int index = 0; index < localeCount; index++) + { + UnicodeString countryFullName; + BString str; + BStringByteSink bbs(&str); + currentLocale[index].getDisplayName(countryFullName); + countryFullName.toUTF8(bbs); + LanguageListItem* si = + new LanguageListItem(str, currentLocale[index].getName()); + listView->AddItem(si); + } + + fTimeFormatSettings = new TimeFormatSettingsView(); + tab->AddChild(BGroupLayoutBuilder(B_HORIZONTAL,10) - .Add(timeFormatSettings) - .AddGlue() + .Add(scrollView) + .Add(fTimeFormatSettings) ); } - // Keyboard tab - - tab = new BView(TR("Keyboard"), B_WILL_DRAW); - tab->SetViewColor(tabView->ViewColor()); - tabView->AddTab(tab); - // check if the window is on screen rect = BScreen().Frame(); @@ -478,7 +501,7 @@ update.AddRect("window_frame", Frame()); int index = 0; while (index < fPreferredListView->CountItems()) { - update.AddString("language",static_cast + update.AddString("language", static_cast (fPreferredListView->ItemAt(index))->getLanguageCode()); index++; } @@ -501,6 +524,22 @@ // revert to last settings break; + case 'csel': + { + // Country selection changed. + // Get the new selected country from the ListView and send it to the + // main app event handler. + void* ptr; + message->FindPointer("source", &ptr); + BListView* countryList = static_cast(ptr); + LanguageListItem* lli = static_cast + (countryList->ItemAt(countryList->CurrentSelection())); + BMessage* newMessage = new BMessage(kMsgSettingsChanged); + newMessage->AddString("country",lli->getLanguageCode()); + be_app_messenger.SendMessage(newMessage); + break; + } + default: BWindow::MessageReceived(message); break; Modified: haiku/branches/components/gsoc-locale-kit/src/preferences/locale/LocaleWindow.h =================================================================== --- haiku/branches/components/gsoc-locale-kit/src/preferences/locale/LocaleWindow.h 2009-08-05 13:05:58 UTC (rev 32129) +++ haiku/branches/components/gsoc-locale-kit/src/preferences/locale/LocaleWindow.h 2009-08-05 13:34:25 UTC (rev 32130) @@ -8,6 +8,8 @@ #include +#include "TimeFormatSettingsView.h" + class BButton; class BListView; @@ -22,6 +24,7 @@ private: BButton* fRevertButton; BListView* fPreferredListView; + TimeFormatSettingsView* fTimeFormatSettings; }; #endif /* LOCALE_WINDOW_H */ Modified: haiku/branches/components/gsoc-locale-kit/src/preferences/locale/TimeFormatSettingsView.cpp =================================================================== --- haiku/branches/components/gsoc-locale-kit/src/preferences/locale/TimeFormatSettingsView.cpp 2009-08-05 13:05:58 UTC (rev 32129) +++ haiku/branches/components/gsoc-locale-kit/src/preferences/locale/TimeFormatSettingsView.cpp 2009-08-05 13:34:25 UTC (rev 32130) @@ -1,5 +1,5 @@ /* -** Copyright 2009, Adrien Destugues pulkomandy at gmail.com. All rights reserved. +** Copyright 2009, Adrien Destugues, pulkomandy at gmail.com. All rights reserved. ** Distributed under the terms of the MIT License. */ @@ -7,8 +7,11 @@ #include "TimeFormatSettingsView.h" #include +#include #include #include +#include +#include #include #include #include @@ -25,9 +28,6 @@ { SetLayout(new BGroupLayout(B_VERTICAL)); - font_height fontHeight; - be_bold_font->GetHeight(&fontHeight); - BBox *clockBox = new BBox("Clock"); clockBox->SetLabel("Clock"); clockBox->SetLayout(new BGroupLayout(B_VERTICAL, 10)); @@ -306,39 +306,18 @@ TimeFormatSettingsView::_UpdateExamples() { time_t timeValue = (time_t)time(NULL); - tm timeData; - localtime_r(&timeValue, &timeData); BString timeFormat = "Internal Error!"; - char buffer[256]; - FormatSeparator separator; + BCountry* country; + be_locale_roster->GetDefaultCountry(&country); + country->FormatDate(&timeFormat, timeValue, true); - BMenuItem *item = fSeparatorMenuField->Menu()->FindMarked(); - if (item) { - int32 index = fSeparatorMenuField->Menu()->IndexOf(item); - if (index >= 0) - separator = (FormatSeparator)index; - else - separator = kSlashSeparator; - } else - separator = kSlashSeparator; - - DateOrder order = - fYMDRadioButton->Value() ? kYMDFormat : - (fDMYRadioButton->Value() ? kDMYFormat : kMDYFormat); - - bool clockIs24hr = (f24HrRadioButton->Value() > 0); - - //TimeFormat(timeFormat, 0, separator, order, clockIs24hr); - strftime(buffer, 256, timeFormat.String(), &timeData); - - fLongDateExampleView->SetText(buffer); + fLongDateExampleView->SetText(timeFormat); fLongDateExampleView->ResizeToPreferred(); - //TimeFormat(timeFormat, 4, separator, order, clockIs24hr); - strftime(buffer, 256, timeFormat.String(), &timeData); + country->FormatDate(&timeFormat, timeValue, false); - fShortDateExampleView->SetText(buffer); + fShortDateExampleView->SetText(timeFormat); fShortDateExampleView->ResizeToPreferred(); } Modified: haiku/branches/components/gsoc-locale-kit/src/preferences/locale/TimeFormatSettingsView.h =================================================================== --- haiku/branches/components/gsoc-locale-kit/src/preferences/locale/TimeFormatSettingsView.h 2009-08-05 13:05:58 UTC (rev 32129) +++ haiku/branches/components/gsoc-locale-kit/src/preferences/locale/TimeFormatSettingsView.h 2009-08-05 13:34:25 UTC (rev 32130) @@ -1,5 +1,5 @@ /* -** Copyright 2009, Adrien Destugues pulkomandy at gmail.com. All rights reserved. +** Copyright 2009, Adrien Destugues, pulkomandy at gmail.com. All rights reserved. ** Distributed under the terms of the MIT License. */ Modified: haiku/branches/components/gsoc-locale-kit/src/tools/locale/Jamfile =================================================================== --- haiku/branches/components/gsoc-locale-kit/src/tools/locale/Jamfile 2009-08-05 13:05:58 UTC (rev 32129) +++ haiku/branches/components/gsoc-locale-kit/src/tools/locale/Jamfile 2009-08-05 13:34:25 UTC (rev 32130) @@ -21,6 +21,8 @@ UseHeaders [ FDirName $(HAIKU_TOP) headers build os support ] : true ; } +UseLibraryHeaders icu ; + # TODO: temporary kludge local libHaikuCompat ; if $(HOST_PLATFORM) in r5 bone dano { From ingo_weinhold at gmx.de Wed Aug 5 15:23:07 2009 From: ingo_weinhold at gmx.de (Ingo Weinhold) Date: Wed, 05 Aug 2009 15:23:07 +0200 Subject: [Haiku-commits] r32118 - haiku/trunk/src/system/kernel/arch/x86 In-Reply-To: <25866853455-BeMail@zon> References: <25866853455-BeMail@zon> Message-ID: <20090805152307.504.3@knochen-vm.localdomain> On 2009-08-05 at 14:50:28 [+0200], Axel D?rfler wrote: > Ingo Weinhold wrote: > > On 2009-08-05 at 08:45:36 [+0200], Axel D?rfler > > > wrote: > > > Ingo Weinhold wrote: > > > > Anyway, I actually don't quite see why the triple fault happened. > > > > I > > > > understand the double fault, but our double fault handler uses > > > > the > > > > kernel > > > > page directory (and already did so even before my changes), so it > > > > should have > > > > safely run into the kernel debugger. > > > arch_vm_translation_map_init_map() copies the kernel page directory > > > to > > > the user page directory, if that contains garbage (or 0xdeadbeef), > > > the > > > kernel memory is not available anymore. > > With user team page directories, yes, but why would that affect the > > double > > fault handler, which always uses the kernel page directory? > > If that's really the case, then you're right indeed :-) > And then I have no idea, unfortunately. I've experimented a bit more with these triple faults and checked the architecture specification and it seems, it simply not possible to cache this kind of double fault. We use a task gate for the double fault (interrupt or trap gates would be even more useless), but task switching involves accessing both the current and the next TSS via their linear addresses. Well, I guess the processor doesn't even get that far, since the IDT is in the linear address space, too, so it won't even be able to access the double fault vector descriptor after the page directory is toast. In short, when invalidating the current page directory, the game is over immediately. CU, Ingo From axeld at pinc-software.de Wed Aug 5 15:47:41 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Wed, 05 Aug 2009 15:47:41 +0200 CEST Subject: [Haiku-commits] =?utf-8?q?r32130_-_in_haiku/branches/components/g?= =?utf-8?q?soc-locale-kit=3A_headers/os/locale_src/kits/locale_src/prefere?= =?utf-8?q?nces/locale_src/tools/locale?= In-Reply-To: <200908051334.n75DYQR4016623@sheep.berlios.de> Message-ID: <29299483188-BeMail@zon> pulkomandy at BerliOS wrote: > - Renamed the locale preflet class from Locale to LocalePreflet to > avoid conflict > with ICU Locale class It's probably related to the fact that I don't like the term "preflet", but since it inherits from BApplication, maybe LocaleApplication would have been the better choice? Also, why are any ICU classes visible at this point? The locale preferences should only work with our liblocale.so, not ICU. Bye, Axel. From axeld at pinc-software.de Wed Aug 5 15:49:41 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Wed, 05 Aug 2009 15:49:41 +0200 CEST Subject: [Haiku-commits] r32118 - haiku/trunk/src/system/kernel/arch/x86 In-Reply-To: <20090805152307.504.3@knochen-vm.localdomain> Message-ID: <29419785080-BeMail@zon> Ingo Weinhold wrote: > On 2009-08-05 at 14:50:28 [+0200], Axel D?rfler > > > If that's really the case, then you're right indeed :-) > > And then I have no idea, unfortunately. > I've experimented a bit more with these triple faults and checked the > architecture specification and it seems, it simply not possible to > cache > this kind of double fault. We use a task gate for the double fault > (interrupt or trap gates would be even more useless), but task > switching > involves accessing both the current and the next TSS via their linear > addresses. Well, I guess the processor doesn't even get that far, > since the > IDT is in the linear address space, too, so it won't even be able to > access > the double fault vector descriptor after the page directory is toast. > In > short, when invalidating the current page directory, the game is over > immediately. Now that explains why they actually need a virtual address for the IDT... ;-) Bummer, but at least it seems you have limited the reboots to exactly this cause, which may make debugging of those a bit easier next time. Bye, Axel. From pulkomandy at gmail.com Wed Aug 5 16:02:12 2009 From: pulkomandy at gmail.com (PulkoMandy) Date: Wed, 5 Aug 2009 16:02:12 +0200 Subject: [Haiku-commits] r32130 - in haiku/branches/components/gsoc-locale-kit: headers/os/locale src/kits/locale src/preferences/locale src/tools/locale In-Reply-To: <29299483188-BeMail@zon> References: <200908051334.n75DYQR4016623@sheep.berlios.de> <29299483188-BeMail@zon> Message-ID: <36ed0c950908050702y15dd4c52jab21ebde5851d073@mail.gmail.com> 2009/8/5 Axel D?rfler : > pulkomandy at BerliOS wrote: >> - Renamed the locale preflet class from Locale to LocalePreflet to >> avoid conflict >> with ICU Locale class > > It's probably related to the fact that I don't like the term "preflet", > but since it inherits from BApplication, maybe LocaleApplication would > have been the better choice? Could work too. > Also, why are any ICU classes visible at this point? The locale > preferences should only work with our liblocale.so, not ICU. Because my code for language selection is not really clean and use ICU directly, and so does the country listing. I'm still not sure how to work with BLanguage. These enumarations could migrate inside liblocale.so, but I wanted to get a working preflet to test BCountry before the end of GSoC. I want to get the specified methods working before I add new ones. > > Bye, > ? Axel. > > _______________________________________________ > Haiku-commits mailing list > Haiku-commits at lists.berlios.de > https://lists.berlios.de/mailman/listinfo/haiku-commits > -- Adrien Destugues / PulkoMandy El?ve ing?nieur ENSSAT EII1- www.enssat.fr GSoC student for Haiku - http://haiku-os.org GrafX2 project team - http://code.google.com/p/grafx2 From axeld at mail.berlios.de Wed Aug 5 16:23:13 2009 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Wed, 5 Aug 2009 16:23:13 +0200 Subject: [Haiku-commits] r32131 - haiku/trunk/src/add-ons/kernel/file_systems/ext2 Message-ID: <200908051423.n75ENDX4000064@sheep.berlios.de> Author: axeld Date: 2009-08-05 16:23:13 +0200 (Wed, 05 Aug 2009) New Revision: 32131 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32131&view=rev Modified: haiku/trunk/src/add-ons/kernel/file_systems/ext2/Inode.cpp Log: * Also the indirect array indices can point to a sparse point if they are 0; this fixes problems with large files with sparse ranges (for example, Haiku images). Modified: haiku/trunk/src/add-ons/kernel/file_systems/ext2/Inode.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ext2/Inode.cpp 2009-08-05 13:34:25 UTC (rev 32130) +++ haiku/trunk/src/add-ons/kernel/file_systems/ext2/Inode.cpp 2009-08-05 14:23:13 UTC (rev 32131) @@ -110,6 +110,9 @@ if (offset >= Size()) return B_ENTRY_NOT_FOUND; + // TODO: we could return the size of the sparse range, as this might be more + // than just a block + if (index < EXT2_DIRECT_BLOCKS) { // direct blocks block = B_LENDIAN_TO_HOST_INT32(Node().stream.direct[index]); @@ -130,12 +133,19 @@ if (indirectBlocks == NULL) return B_IO_ERROR; - indirectBlocks = (uint32*)cached.SetTo(B_LENDIAN_TO_HOST_INT32( - indirectBlocks[index / perBlock])); - if (indirectBlocks == NULL) - return B_IO_ERROR; + uint32 indirectIndex + = B_LENDIAN_TO_HOST_INT32(indirectBlocks[index / perBlock]); + if (indirectIndex == 0) { + // a sparse indirect block + block = 0; + } else { + indirectBlocks = (uint32*)cached.SetTo(indirectIndex); + if (indirectBlocks == NULL) + return B_IO_ERROR; - block = B_LENDIAN_TO_HOST_INT32(indirectBlocks[index & (perBlock - 1)]); + block = B_LENDIAN_TO_HOST_INT32( + indirectBlocks[index & (perBlock - 1)]); + } } else if ((index -= perIndirectBlock) / perBlock < perIndirectBlock) { // triple indirect blocks CachedBlock cached(fVolume); @@ -144,17 +154,30 @@ if (indirectBlocks == NULL) return B_IO_ERROR; - indirectBlocks = (uint32*)cached.SetTo(B_LENDIAN_TO_HOST_INT32( - indirectBlocks[index / perIndirectBlock])); - if (indirectBlocks == NULL) - return B_IO_ERROR; + uint32 indirectIndex + = B_LENDIAN_TO_HOST_INT32(indirectBlocks[index / perIndirectBlock]); + if (indirectIndex == 0) { + // a sparse indirect block + block = 0; + } else { + indirectBlocks = (uint32*)cached.SetTo(indirectIndex); + if (indirectBlocks == NULL) + return B_IO_ERROR; - indirectBlocks = (uint32*)cached.SetTo(B_LENDIAN_TO_HOST_INT32( - indirectBlocks[(index / perBlock) & (perBlock - 1)])); - if (indirectBlocks == NULL) - return B_IO_ERROR; + indirectIndex = B_LENDIAN_TO_HOST_INT32( + indirectBlocks[(index / perBlock) & (perBlock - 1)]); + if (indirectIndex == 0) { + // a sparse indirect block + block = 0; + } else { + indirectBlocks = (uint32*)cached.SetTo(indirectIndex); + if (indirectBlocks == NULL) + return B_IO_ERROR; - block = B_LENDIAN_TO_HOST_INT32(indirectBlocks[index & (perBlock - 1)]); + block = B_LENDIAN_TO_HOST_INT32( + indirectBlocks[index & (perBlock - 1)]); + } + } } else { // outside of the possible data stream dprintf("ext2: block outside datastream!\n"); From bonefish at mail.berlios.de Wed Aug 5 16:26:50 2009 From: bonefish at mail.berlios.de (bonefish at mail.berlios.de) Date: Wed, 5 Aug 2009 16:26:50 +0200 Subject: [Haiku-commits] r32132 - haiku/trunk/src/kits/interface Message-ID: <200908051426.n75EQoeB000885@sheep.berlios.de> Author: bonefish Date: 2009-08-05 16:26:47 +0200 (Wed, 05 Aug 2009) New Revision: 32132 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32132&view=rev Modified: haiku/trunk/src/kits/interface/View.cpp Log: * Only build the gcc 2 compatibility symbols with gcc 2. * Added gcc 4 _ReservedView11() compatibility symbol. Modified: haiku/trunk/src/kits/interface/View.cpp =================================================================== --- haiku/trunk/src/kits/interface/View.cpp 2009-08-05 14:23:13 UTC (rev 32131) +++ haiku/trunk/src/kits/interface/View.cpp 2009-08-05 14:26:47 UTC (rev 32132) @@ -5490,6 +5490,9 @@ } +#if __GNUC__ == 2 + + extern "C" void _ReservedView1__5BView(BView* view, BRect rect) { @@ -5602,6 +5605,23 @@ } +#elif __GNUC__ > 2 + + +extern "C" bool +_ZN5BView15_ReservedView11Ev(BView* view, BPoint point, BToolTip** _toolTip) +{ + // GetToolTipAt() + perform_data_get_tool_tip_at data; + data.point = point; + data.tool_tip = _toolTip; + view->Perform(PERFORM_CODE_GET_TOOL_TIP_AT, &data); + return data.return_value; +} + + +#endif // __GNUC__ > 2 + void BView::_ReservedView12() {} void BView::_ReservedView13() {} void BView::_ReservedView14() {} From bonefish at mail.berlios.de Wed Aug 5 16:29:00 2009 From: bonefish at mail.berlios.de (bonefish at mail.berlios.de) Date: Wed, 5 Aug 2009 16:29:00 +0200 Subject: [Haiku-commits] r32133 - haiku/trunk/build/jam Message-ID: <200908051429.n75ET0DB001612@sheep.berlios.de> Author: bonefish Date: 2009-08-05 16:28:58 +0200 (Wed, 05 Aug 2009) New Revision: 32133 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32133&view=rev Modified: haiku/trunk/build/jam/OptionalPackages Log: Reenabled Firefox gcc 4 package. Modified: haiku/trunk/build/jam/OptionalPackages =================================================================== --- haiku/trunk/build/jam/OptionalPackages 2009-08-05 14:26:47 UTC (rev 32132) +++ haiku/trunk/build/jam/OptionalPackages 2009-08-05 14:28:58 UTC (rev 32133) @@ -398,17 +398,14 @@ if [ IsOptionalHaikuImagePackageAdded Firefox ] { if $(TARGET_ARCH) != x86 { Echo "No optional package Firefox available for $(TARGET_ARCH)" ; -# TODO: Update BeZilla GCC4 build, this one is currently broken, because of -# the BToolTip addition. At least the GCC2 build will work just fine on hybrid -# installations. -# } else if $(HAIKU_GCC_VERSION[1]) >= 4 { -# InstallOptionalHaikuImagePackage -# BeZillaBrowser-2.0.0.21pre-haiku-gcc4-x86-09-03-01 -# : $(baseURL)/BeZillaBrowser-2.0.0.21pre-haiku-gcc4-x86-09-03-01.zip -# : apps -# ; -# AddSymlinkToHaikuImage home config be Applications -# : /boot/apps/BeZillaBrowser/BeZillaBrowser ; + } else if $(HAIKU_GCC_VERSION[1]) >= 4 { + InstallOptionalHaikuImagePackage + BeZillaBrowser-2.0.0.21pre-haiku-gcc4-x86-09-03-01 + : $(baseURL)/BeZillaBrowser-2.0.0.21pre-haiku-gcc4-x86-09-03-01.zip + : apps + ; + AddSymlinkToHaikuImage home config be Applications + : /boot/apps/BeZillaBrowser/BeZillaBrowser ; } else if $(HAIKU_GCC_VERSION[1]) >= 4 && ! $(isHybridBuild) { Echo "No optional package Firefox available for GCC4" ; } else { From stippi at mail.berlios.de Wed Aug 5 16:47:34 2009 From: stippi at mail.berlios.de (stippi at mail.berlios.de) Date: Wed, 5 Aug 2009 16:47:34 +0200 Subject: [Haiku-commits] r32134 - haiku/trunk/src/servers/app Message-ID: <200908051447.n75ElXwO008758@sheep.berlios.de> Author: stippi Date: 2009-08-05 16:47:32 +0200 (Wed, 05 Aug 2009) New Revision: 32134 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32134&view=rev Modified: haiku/trunk/src/servers/app/FontManager.cpp Log: Initialize the default fonts to NULL. Modified: haiku/trunk/src/servers/app/FontManager.cpp =================================================================== --- haiku/trunk/src/servers/app/FontManager.cpp 2009-08-05 14:28:58 UTC (rev 32133) +++ haiku/trunk/src/servers/app/FontManager.cpp 2009-08-05 14:47:32 UTC (rev 32134) @@ -103,6 +103,11 @@ fDirectories(10, true), fMappings(10, true), fFamilies(20), + + fDefaultPlainFont(NULL), + fDefaultBoldFont(NULL), + fDefaultFixedFont(NULL), + fScanned(false), fNextID(0) { From axeld at pinc-software.de Wed Aug 5 16:52:06 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Wed, 05 Aug 2009 16:52:06 +0200 CEST Subject: [Haiku-commits] =?utf-8?q?r32130_-_in_haiku/branches/components/g?= =?utf-8?q?soc-locale-kit=3A_headers/os/locale_src/kits/locale_src/prefere?= =?utf-8?q?nces/locale_src/tools/locale?= In-Reply-To: <36ed0c950908050702y15dd4c52jab21ebde5851d073@mail.gmail.com> Message-ID: <33164684702-BeMail@zon> PulkoMandy wrote: > 2009/8/5 Axel D?rfler : > > Also, why are any ICU classes visible at this point? The locale > > preferences should only work with our liblocale.so, not ICU. > Because my code for language selection is not really clean and use > ICU > directly, and so does the country listing. I'm still not sure how to > work with BLanguage. These enumarations could migrate inside > liblocale.so, but I wanted to get a working preflet to test BCountry > before the end of GSoC. I want to get the specified methods working > before I add new ones. Hm, dirty tricks :-) No, understood, as long as that's cleaned up afterwards. That sort of functionality sounds like it should live in the BLocaleRoster. Bye, Axel. From superstippi at gmx.de Wed Aug 5 17:02:05 2009 From: superstippi at gmx.de (Stephan Assmus) Date: Wed, 05 Aug 2009 17:02:05 +0200 Subject: [Haiku-commits] r32133 - haiku/trunk/build/jam In-Reply-To: <200908051429.n75ET0DB001612@sheep.berlios.de> References: <200908051429.n75ET0DB001612@sheep.berlios.de> Message-ID: <20090805170205.533.1@bepc.1249484037.fake> On 2009-08-05 at 16:29:00 [+0200], bonefish at mail.berlios.de wrote: > Author: bonefish > Date: 2009-08-05 16:28:58 +0200 (Wed, 05 Aug 2009) New Revision: 32133 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32133&view=rev > > Modified: > haiku/trunk/build/jam/OptionalPackages > Log: > Reenabled Firefox gcc 4 package. > > > Modified: haiku/trunk/build/jam/OptionalPackages > =================================================================== > --- haiku/trunk/build/jam/OptionalPackages 2009-08-05 14:26:47 UTC > (rev 32132) > +++ haiku/trunk/build/jam/OptionalPackages 2009-08-05 14:28:58 UTC > (rev 32133) > @@ -398,17 +398,14 @@ > if [ IsOptionalHaikuImagePackageAdded Firefox ] { > if $(TARGET_ARCH) != x86 { > Echo "No optional package Firefox available for $(TARGET_ARCH)" ; > -# TODO: Update BeZilla GCC4 build, this one is currently broken, because > of > -# the BToolTip addition. At least the GCC2 build will work just fine on > hybrid > -# installations. > -# } else if $(HAIKU_GCC_VERSION[1]) >= 4 { > -# InstallOptionalHaikuImagePackage > -# BeZillaBrowser-2.0.0.21pre-haiku-gcc4-x86-09-03-01 > -# : > $(baseURL)/BeZillaBrowser-2.0.0.21pre-haiku-gcc4-x86-09-03-01.zip > -# : apps > -# ; > -# AddSymlinkToHaikuImage home config be Applications > -# : /boot/apps/BeZillaBrowser/BeZillaBrowser ; > + } else if $(HAIKU_GCC_VERSION[1]) >= 4 { > + InstallOptionalHaikuImagePackage > + BeZillaBrowser-2.0.0.21pre-haiku-gcc4-x86-09-03-01 > + : > $(baseURL)/BeZillaBrowser-2.0.0.21pre-haiku-gcc4-x86-09-03-01.zip > + : apps > + ; > + AddSymlinkToHaikuImage home config be Applications > + : /boot/apps/BeZillaBrowser/BeZillaBrowser ; > } else if $(HAIKU_GCC_VERSION[1]) >= 4 && ! $(isHybridBuild) { > Echo "No optional package Firefox available for GCC4" ; > } else { You did the same mistake as Rene. The next two lines need to be removed as well. (And thanks for fixing the issue in a much cleaner way!) Best regards, -Stephan From axeld at mail.berlios.de Wed Aug 5 17:04:47 2009 From: axeld at mail.berlios.de (axeld at mail.berlios.de) Date: Wed, 5 Aug 2009 17:04:47 +0200 Subject: [Haiku-commits] r32135 - haiku/trunk/src/system/kernel/vm Message-ID: <200908051504.n75F4lmC015088@sheep.berlios.de> Author: axeld Date: 2009-08-05 17:04:45 +0200 (Wed, 05 Aug 2009) New Revision: 32135 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32135&view=rev Modified: haiku/trunk/src/system/kernel/vm/vm.cpp Log: * area_for() now also returns the area ID for kernel areas if they are accessible to the userland - this fixes #2405 (ie. MediaPlayer overlay now works). Modified: haiku/trunk/src/system/kernel/vm/vm.cpp =================================================================== --- haiku/trunk/src/system/kernel/vm/vm.cpp 2009-08-05 14:47:32 UTC (rev 32134) +++ haiku/trunk/src/system/kernel/vm/vm.cpp 2009-08-05 15:04:45 UTC (rev 32135) @@ -3921,15 +3921,28 @@ static area_id -vm_area_for(team_id team, addr_t address) +vm_area_for(addr_t address, bool kernel) { + team_id team; + if (IS_USER_ADDRESS(address)) { + // we try the user team address space, if any + team = vm_current_user_address_space_id(); + if (team < 0) + return team; + } else + team = vm_kernel_address_space_id(); + AddressSpaceReadLocker locker(team); if (!locker.IsLocked()) return B_BAD_TEAM_ID; vm_area* area = vm_area_lookup(locker.AddressSpace(), address); - if (area != NULL) + if (area != NULL) { + if (!kernel && (area->protection & (B_READ_AREA | B_WRITE_AREA)) == 0) + return B_ERROR; + return area->id; + } return B_ERROR; } @@ -5705,17 +5718,7 @@ area_id area_for(void* address) { - team_id space; - - if (IS_USER_ADDRESS(address)) { - // we try the user team address space, if any - space = vm_current_user_address_space_id(); - if (space < B_OK) - return space; - } else - space = vm_kernel_address_space_id(); - - return vm_area_for(space, (addr_t)address); + return vm_area_for((addr_t)address, true); } @@ -5949,7 +5952,7 @@ area_id _user_area_for(void* address) { - return vm_area_for(vm_current_user_address_space_id(), (addr_t)address); + return vm_area_for((addr_t)address, false); } From axeld at mail.berlios.de Wed Aug 5 17:38:46 2009 From: axeld at mail.berlios.de (axeld at mail.berlios.de) Date: Wed, 5 Aug 2009 17:38:46 +0200 Subject: [Haiku-commits] r32136 - haiku/trunk/src/kits/media Message-ID: <200908051538.n75FckQD028728@sheep.berlios.de> Author: axeld Date: 2009-08-05 17:38:44 +0200 (Wed, 05 Aug 2009) New Revision: 32136 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32136&view=rev Modified: haiku/trunk/src/kits/media/Buffer.cpp Log: * Cleanup, no functional change. Modified: haiku/trunk/src/kits/media/Buffer.cpp =================================================================== --- haiku/trunk/src/kits/media/Buffer.cpp 2009-08-05 15:04:45 UTC (rev 32135) +++ haiku/trunk/src/kits/media/Buffer.cpp 2009-08-05 15:38:44 UTC (rev 32136) @@ -27,21 +27,25 @@ * */ + +#include + #include -#include -#include "SharedBufferList.h" + #include "debug.h" #include "DataExchange.h" +#include "SharedBufferList.h" + namespace BPrivate { namespace media { extern team_id team; -} } // BPrivate::media +} } using namespace BPrivate::media; -/************************************************************* - * public struct buffer_clone_info - *************************************************************/ +// #pragma mark - buffer_clone_info + + buffer_clone_info::buffer_clone_info() { CALLED(); @@ -58,11 +62,11 @@ CALLED(); } -/************************************************************* - * public BBuffer - *************************************************************/ -void * +// #pragma mark - public BBuffer + + +void* BBuffer::Data() { CALLED(); @@ -145,7 +149,7 @@ } -media_header * +media_header* BBuffer::Header() { CALLED(); @@ -153,7 +157,7 @@ } -media_audio_header * +media_audio_header* BBuffer::AudioHeader() { CALLED(); @@ -161,7 +165,7 @@ } -media_video_header * +media_video_header* BBuffer::VideoHeader() { CALLED(); @@ -176,16 +180,18 @@ return SizeAvailable(); } -/************************************************************* - * private BBuffer - *************************************************************/ -/* explicit */ -BBuffer::BBuffer(const buffer_clone_info & info) : - fBufferList(0), // must be 0 if not correct initialized - fData(0), // must be 0 if not correct initialized - fSize(0), // should be 0 if not correct initialized - fBufferID(0) // must be 0 if not registered +// #pragma mark - private BBuffer + + +BBuffer::BBuffer(const buffer_clone_info& info) + : + // must all be NULL/0 if not correct initialized + fBufferList(NULL), + fData(NULL), + fSize(0), + fBufferID(0) + // must be 0 if not registered { CALLED(); @@ -194,16 +200,15 @@ return; // ask media_server to get the area_id of the shared buffer list - server_get_shared_buffer_area_request area_request; - server_get_shared_buffer_area_reply area_reply; - if (QueryServer(SERVER_GET_SHARED_BUFFER_AREA, &area_request, sizeof(area_request), &area_reply, sizeof(area_reply)) != B_OK) { + server_get_shared_buffer_area_request areaRequest; + server_get_shared_buffer_area_reply areaReply; + if (QueryServer(SERVER_GET_SHARED_BUFFER_AREA, &areaRequest, + sizeof(areaRequest), &areaReply, sizeof(areaReply)) != B_OK) { ERROR("BBuffer::BBuffer: SERVER_GET_SHARED_BUFFER_AREA failed\n"); return; } - ASSERT(area_reply.area > 0); - - fBufferList = _shared_buffer_list::Clone(area_reply.area); + fBufferList = _shared_buffer_list::Clone(areaReply.area); if (fBufferList == NULL) { ERROR("BBuffer::BBuffer: _shared_buffer_list::Clone() failed\n"); return; @@ -223,8 +228,10 @@ // until the last buffer has been unregistered // the area_id of the cached area is passed back to us, and we clone it. - if (QueryServer(SERVER_REGISTER_BUFFER, &request, sizeof(request), &reply, sizeof(reply)) != B_OK) { - ERROR("BBuffer::BBuffer: failed to register buffer with media_server\n"); + if (QueryServer(SERVER_REGISTER_BUFFER, &request, sizeof(request), &reply, + sizeof(reply)) != B_OK) { + ERROR("BBuffer::BBuffer: failed to register buffer with " + "media_server\n"); return; } @@ -241,14 +248,14 @@ fArea = clone_area("a cloned BBuffer", &fData, B_ANY_ADDRESS, B_READ_AREA | B_WRITE_AREA, reply.info.area); - if (fArea <= B_OK) { - // XXX should unregister buffer here + if (fArea < 0) { + // TODO: should unregister buffer here ERROR("BBuffer::BBuffer: buffer cloning failed\n"); fData = 0; return; } - fData = (char *)fData + fOffset; + fData = (char*)fData + fOffset; fMediaHeader.size_used = 0; fMediaHeader.buffer = fBufferID; } @@ -258,12 +265,11 @@ { CALLED(); // unmap the BufferList - if (fBufferList != NULL) { + if (fBufferList != NULL) fBufferList->Unmap(); - } + // unmap the Data if (fData != NULL) { - delete_area(fArea); // ask media_server to unregister the buffer @@ -278,23 +284,25 @@ void -BBuffer::SetHeader(const media_header *header) +BBuffer::SetHeader(const media_header* header) { CALLED(); fMediaHeader = *header; -// XXX why can't we do this without crash? what's wrong? +// TODO: why can't we do this without crash? what's wrong? // fMediaHeader.buffer = fBufferID; } -/************************************************************* - * public BSmallBuffer - *************************************************************/ +// #pragma mark - public BSmallBuffer -static const buffer_clone_info info; + +static const buffer_clone_info sSmallBufferInfo; + + BSmallBuffer::BSmallBuffer() - : BBuffer(info) + : + BBuffer(sSmallBufferInfo) { UNIMPLEMENTED(); debugger("BSmallBuffer::BSmallBuffer called\n"); From mmu_man at mail.berlios.de Wed Aug 5 18:00:18 2009 From: mmu_man at mail.berlios.de (mmu_man at mail.berlios.de) Date: Wed, 5 Aug 2009 18:00:18 +0200 Subject: [Haiku-commits] r32137 - in haiku/trunk: build/jam headers/private/system Message-ID: <200908051600.n75G0IES004412@sheep.berlios.de> Author: mmu_man Date: 2009-08-05 18:00:13 +0200 (Wed, 05 Aug 2009) New Revision: 32137 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32137&view=rev Added: haiku/trunk/headers/private/system/board/ Modified: haiku/trunk/build/jam/BuildSetup Log: Introduce a new level of portability: boards. Since we don't support Flattened Device Trees yet (and they don't solve all the issues), we need a place to hole board-specific config, which are different even though we use U-Boot on ARM. Things like cpu & mmu type... U-Boot doesn't really help us there anyway, it only passes a few board infos (RAM banks & the bill), and optionally other stuff if we fake a linux kernel or netbsd loader, but still not enough. FDT support isn't available for ARM in U-Boot yet either. So for now, and likely for stuff we can't get from FDT, we'll put board-specific config there. Unlike desktop machines were we want a single kernel per arch, we'd rather have the kernel built for a single board without having to handle detecting mmu type at boot and switching calls like I did on m68k. Modified: haiku/trunk/build/jam/BuildSetup =================================================================== --- haiku/trunk/build/jam/BuildSetup 2009-08-05 15:38:44 UTC (rev 32136) +++ haiku/trunk/build/jam/BuildSetup 2009-08-05 16:00:13 UTC (rev 32137) @@ -198,6 +198,7 @@ { HAIKU_DEFINES += __ARM__ ; HAIKU_BOOT_PLATFORM = u-boot ; + HAIKU_BOOT_BOARD ?= verdex ; HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 1440 ; # in kB (there is not realy a floppy on the gumstix ;) ) # offset in floppy image (>= sizeof(haiku_loader)) HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 192 ; # in kB - unused yet @@ -850,6 +851,7 @@ TARGET_GCC_LIBGCC_OBJECTS = $(HAIKU_GCC_LIBGCC_OBJECTS) ; TARGET_BOOT_PLATFORM ?= $(HAIKU_BOOT_PLATFORM) ; + TARGET_BOOT_BOARD ?= $(HAIKU_BOOT_BOARD) ; TARGET_LIBRARY_NAME_MAP = HAIKU_LIBRARY_NAME_MAP ; From mmu_man at mail.berlios.de Wed Aug 5 18:01:17 2009 From: mmu_man at mail.berlios.de (mmu_man at mail.berlios.de) Date: Wed, 5 Aug 2009 18:01:17 +0200 Subject: [Haiku-commits] r32138 - haiku/trunk/headers/private/system/board Message-ID: <200908051601.n75G1Hgp004794@sheep.berlios.de> Author: mmu_man Date: 2009-08-05 18:01:17 +0200 (Wed, 05 Aug 2009) New Revision: 32138 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32138&view=rev Added: haiku/trunk/headers/private/system/board/overo/ haiku/trunk/headers/private/system/board/verdex/ Log: Placeholder for current GSoC targets (verdex is QEMU, overo is the real one). From axeld at mail.berlios.de Wed Aug 5 18:08:49 2009 From: axeld at mail.berlios.de (axeld at mail.berlios.de) Date: Wed, 5 Aug 2009 18:08:49 +0200 Subject: [Haiku-commits] r32139 - in haiku/trunk: headers/os/media src/kits/media Message-ID: <200908051608.n75G8neh007373@sheep.berlios.de> Author: axeld Date: 2009-08-05 18:08:47 +0200 (Wed, 05 Aug 2009) New Revision: 32139 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32139&view=rev Modified: haiku/trunk/headers/os/media/BufferGroup.h haiku/trunk/src/kits/media/BufferGroup.cpp Log: * Rewrote BBufferGroup header. * Cleaned up the source file, no functional change (intended). Modified: haiku/trunk/headers/os/media/BufferGroup.h =================================================================== --- haiku/trunk/headers/os/media/BufferGroup.h 2009-08-05 16:01:17 UTC (rev 32138) +++ haiku/trunk/headers/os/media/BufferGroup.h 2009-08-05 16:08:47 UTC (rev 32139) @@ -1,82 +1,68 @@ -/******************************************************************************* -/ -/ File: BufferGroup.h -/ -/ Description: A BBufferGroup organizes sets of BBuffers so that you can request -/ and reclaim them. -/ -/ Copyright 1997-98, Be Incorporated, All Rights Reserved -/ -*******************************************************************************/ - -#if !defined(_BUFFER_GROUP_H) +/* + * Copyright 2009, Haiku Inc. All Rights Reserved. + * Distributed under the terms of the MIT License. + */ +#ifndef _BUFFER_GROUP_H #define _BUFFER_GROUP_H + #include + class BBuffer; struct _shared_buffer_list; -class BBufferGroup -{ + +class BBufferGroup { public: + BBufferGroup(size_t size, int32 count = 3, + uint32 placement = B_ANY_ADDRESS, + uint32 lock = B_FULL_LOCK); + explicit BBufferGroup(); + BBufferGroup(int32 count, + const media_buffer_id* buffers); + ~BBufferGroup(); - BBufferGroup( - size_t size, - int32 count = 3, - uint32 placement = B_ANY_ADDRESS, - uint32 lock = B_FULL_LOCK); -explicit BBufferGroup(); - BBufferGroup( - int32 count, - const media_buffer_id * buffers); - ~BBufferGroup(); /* BBufferGroup is NOT a virtual class!!! */ + status_t InitCheck(); - status_t InitCheck(); + status_t AddBuffer(const buffer_clone_info& info, + BBuffer** _buffer = NULL); - /* use this function to add buffers you created on your own */ - status_t AddBuffer( - const buffer_clone_info & info, - BBuffer ** out_buffer = NULL); + BBuffer* RequestBuffer(size_t size, + bigtime_t timeout = B_INFINITE_TIMEOUT); + status_t RequestBuffer(BBuffer* buffer, + bigtime_t timeout = B_INFINITE_TIMEOUT); - BBuffer * RequestBuffer( - size_t size, - bigtime_t timeout = B_INFINITE_TIMEOUT); - status_t RequestBuffer( - BBuffer * buffer, - bigtime_t timeout = B_INFINITE_TIMEOUT); - status_t RequestError(); /* return last RequestBuffer error, useful if NULL is returned */ + status_t RequestError(); - status_t CountBuffers( - int32 * out_count); - status_t GetBufferList( - int32 buf_count, - BBuffer ** out_buffers); + status_t CountBuffers(int32* _count); + status_t GetBufferList(int32 bufferCount, + BBuffer** _buffers); - status_t WaitForBuffers(); - status_t ReclaimAllBuffers(); + status_t WaitForBuffers(); + status_t ReclaimAllBuffers(); private: - /* in BeOS R5 this is a deprecated api, from BeOS R4 times */ - status_t AddBuffersTo(BMessage * message, const char * name, bool needLock=true); - - status_t InitBufferGroup(); /* used internally */ - BBufferGroup(const BBufferGroup &); /* not implemented */ - BBufferGroup& operator=(const BBufferGroup&); /* not implemented */ + // deprecated BeOS R4 API + status_t AddBuffersTo(BMessage* message, const char* name, + bool needLock); - friend struct _shared_buffer_list; + BBufferGroup(const BBufferGroup& other); + BBufferGroup& operator=(const BBufferGroup& other); - status_t fInitError; - status_t fRequestError; - int32 fBufferCount; - _shared_buffer_list * fBufferList; - - // this is a BBufferGroup specific semaphore used for reclaiming BBuffers of this group - // is also is a system wide unique identifier of this group - sem_id fReclaimSem; + status_t _Init(); - uint32 _reserved_buffer_group_[9]; +private: + friend struct _shared_buffer_list; + + status_t fInitError; + status_t fRequestError; + int32 fBufferCount; + _shared_buffer_list* fBufferList; + sem_id fReclaimSem; + + uint32 _reserved[9]; }; -#endif /* _BUFFER_GROUP_H */ +#endif // _BUFFER_GROUP_H Modified: haiku/trunk/src/kits/media/BufferGroup.cpp =================================================================== --- haiku/trunk/src/kits/media/BufferGroup.cpp 2009-08-05 16:01:17 UTC (rev 32138) +++ haiku/trunk/src/kits/media/BufferGroup.cpp 2009-08-05 16:08:47 UTC (rev 32139) @@ -27,69 +27,21 @@ * */ + #include + #include + #include "debug.h" -#include "SharedBufferList.h" #include "DataExchange.h" +#include "SharedBufferList.h" -/************************************************************* - * private BBufferGroup - *************************************************************/ -status_t -BBufferGroup::InitBufferGroup() +BBufferGroup::BBufferGroup(size_t size, int32 count, uint32 placement, + uint32 lock) { CALLED(); - - // some defaults - fBufferList = 0; - fReclaimSem = B_ERROR; - fInitError = B_ERROR; - fRequestError = B_ERROR; - fBufferCount = 0; - - // create the reclaim semaphore - fReclaimSem = create_sem(0,"buffer reclaim sem"); - if (fReclaimSem < B_OK) { - ERROR("BBufferGroup::InitBufferGroup: couldn't create fReclaimSem\n"); - fInitError = (status_t)fReclaimSem; - return fInitError; - } - - // ask media_server to get the area_id of the shared buffer list - server_get_shared_buffer_area_request area_request; - server_get_shared_buffer_area_reply area_reply; - if (QueryServer(SERVER_GET_SHARED_BUFFER_AREA, &area_request, sizeof(area_request), &area_reply, sizeof(area_reply)) != B_OK) { - ERROR("BBufferGroup::InitBufferGroup: SERVER_GET_SHARED_BUFFER_AREA failed\n"); - fInitError = B_ERROR; - return fInitError; - } - ASSERT(area_reply.area > 0); - - fBufferList = _shared_buffer_list::Clone(area_reply.area); - if (fBufferList == NULL) { - ERROR("BBufferGroup::InitBufferGroup: _shared_buffer_list::Clone failed\n"); - fInitError = B_ERROR; - return fInitError; - } - - fInitError = B_OK; - return fInitError; -} - - -/************************************************************* - * public BBufferGroup - *************************************************************/ - -BBufferGroup::BBufferGroup(size_t size, - int32 count, - uint32 placement, - uint32 lock) -{ - CALLED(); - if (InitBufferGroup() != B_OK) + if (_Init() != B_OK) return; // This one is easy. We need to create "count" BBuffers, @@ -99,99 +51,75 @@ // then we delete our area. This way BBuffers are // independent from the BBufferGroup - void *start_addr; - area_id buffer_area; - size_t area_size; - buffer_clone_info bci; - BBuffer *buffer; - // don't allow all placement parameter values if (placement != B_ANY_ADDRESS && placement != B_ANY_KERNEL_ADDRESS) { - ERROR("BBufferGroup: placement != B_ANY_ADDRESS && placement != B_ANY_KERNEL_ADDRESS (0x%08lx)\n",placement); + ERROR("BBufferGroup: placement != B_ANY_ADDRESS " + "&& placement != B_ANY_KERNEL_ADDRESS (0x%08lx)\n", placement); placement = B_ANY_ADDRESS; } // first we roundup for a better placement in memory - int allocsize = (size + 63) & ~63; + size_t allocSize = (size + 63) & ~63; // now we create the area - area_size = ((allocsize * count) + (B_PAGE_SIZE - 1)) & ~(B_PAGE_SIZE - 1); + size_t areaSize + = ((allocSize * count) + B_PAGE_SIZE - 1) & ~(B_PAGE_SIZE - 1); - buffer_area = create_area("some buffers area", &start_addr,placement,area_size,lock,B_READ_AREA | B_WRITE_AREA); - if (buffer_area < B_OK) { - ERROR("BBufferGroup: failed to allocate %ld bytes area\n",area_size); - fInitError = (status_t)buffer_area; + void* startAddress; + area_id bufferArea = create_area("some buffers area", &startAddress, + placement, areaSize, lock, B_READ_AREA | B_WRITE_AREA); + if (bufferArea < 0) { + ERROR("BBufferGroup: failed to allocate %ld bytes area\n", areaSize); + fInitError = (status_t)bufferArea; return; } - - fBufferCount = count; + buffer_clone_info info; + for (int32 i = 0; i < count; i++) { - bci.area = buffer_area; - bci.offset = i * allocsize; - bci.size = size; - buffer = new BBuffer(bci); - if (0 == buffer->Data()) { - // BBuffer::Data() will return 0 if an error occured - ERROR("BBufferGroup: error while creating buffer\n"); - delete buffer; - fInitError = B_ERROR; + info.area = bufferArea; + info.offset = i * allocSize; + info.size = size; + + fInitError = AddBuffer(info); + if (fInitError != B_OK) break; - } - if (B_OK != fBufferList->AddBuffer(fReclaimSem,buffer)) { - ERROR("BBufferGroup: error when adding buffer\n"); - delete buffer; - fInitError = B_ERROR; - break; - } } - delete_area(buffer_area); + delete_area(bufferArea); } -/* explicit */ + BBufferGroup::BBufferGroup() { CALLED(); - if (InitBufferGroup() != B_OK) + if (_Init() != B_OK) return; // this one simply creates an empty BBufferGroup } -BBufferGroup::BBufferGroup(int32 count, - const media_buffer_id *buffers) +BBufferGroup::BBufferGroup(int32 count, const media_buffer_id* buffers) { CALLED(); - if (InitBufferGroup() != B_OK) + if (_Init() != B_OK) return; - // XXX we need to make sure that a media_buffer_id is only added once to each group + // TODO: we need to make sure that a media_buffer_id is only added + // once to each group // this one creates "BBuffer"s from "media_buffer_id"s passed // by the application. - fBufferCount = count; + buffer_clone_info info; - buffer_clone_info bci; - BBuffer *buffer; for (int32 i = 0; i < count; i++) { - bci.buffer = buffers[i]; - buffer = new BBuffer(bci); - if (0 == buffer->Data()) { - // BBuffer::Data() will return 0 if an error occured - ERROR("BBufferGroup(2): error while creating buffer\n"); - delete buffer; - fInitError = B_ERROR; + info.buffer = buffers[i]; + + fInitError = AddBuffer(info); + if (fInitError != B_OK) break; - } - if (B_OK != fBufferList->AddBuffer(fReclaimSem,buffer)) { - ERROR("BBufferGroup(2): error when adding buffer\n"); - delete buffer; - fInitError = B_ERROR; - break; - } } } @@ -201,8 +129,8 @@ CALLED(); if (fBufferList) fBufferList->Terminate(fReclaimSem); - if (fReclaimSem >= B_OK) - delete_sem(fReclaimSem); + + delete_sem(fReclaimSem); } @@ -215,41 +143,44 @@ status_t -BBufferGroup::AddBuffer(const buffer_clone_info &info, - BBuffer **out_buffer) +BBufferGroup::AddBuffer(const buffer_clone_info& info, BBuffer** _buffer) { CALLED(); if (fInitError != B_OK) return B_NO_INIT; - // XXX we need to make sure that a media_buffer_id is only added once to each group + // TODO: we need to make sure that a media_buffer_id is only added + // once to each group - BBuffer *buffer; - buffer = new BBuffer(info); - if (0 == buffer->Data()) { - // BBuffer::Data() will return 0 if an error occured - ERROR("BBufferGroup::AddBuffer: error while creating buffer\n"); + BBuffer* buffer = new(std::nothrow) BBuffer(info); + if (buffer == NULL) + return B_NO_MEMORY; + + if (buffer->Data() == NULL) { + // BBuffer::Data() will return NULL if an error occured + ERROR("BBufferGroup: error while creating buffer\n"); delete buffer; return B_ERROR; } - if (B_OK != fBufferList->AddBuffer(fReclaimSem,buffer)) { - ERROR("BBufferGroup::AddBuffer: error when adding buffer\n"); + + status_t status = fBufferList->AddBuffer(fReclaimSem, buffer); + if (status != B_OK) { + ERROR("BBufferGroup: error when adding buffer\n"); delete buffer; - fInitError = B_ERROR; - return B_ERROR; + return status; } - atomic_add(&fBufferCount,1); - - if (out_buffer != 0) - *out_buffer = buffer; + atomic_add(&fBufferCount, 1); + + if (_buffer != NULL) + *_buffer = buffer; + return B_OK; } -BBuffer * -BBufferGroup::RequestBuffer(size_t size, - bigtime_t timeout) +BBuffer* +BBufferGroup::RequestBuffer(size_t size, bigtime_t timeout) { CALLED(); if (fInitError != B_OK) @@ -262,16 +193,16 @@ status_t status; buffer = NULL; - status = fBufferList->RequestBuffer(fReclaimSem, fBufferCount, size, 0, &buffer, timeout); + status = fBufferList->RequestBuffer(fReclaimSem, fBufferCount, size, 0, + &buffer, timeout); fRequestError = status; - - return (status == B_OK) ? buffer : NULL; + + return status == B_OK ? buffer : NULL; } status_t -BBufferGroup::RequestBuffer(BBuffer *buffer, - bigtime_t timeout) +BBufferGroup::RequestBuffer(BBuffer* buffer, bigtime_t timeout) { CALLED(); if (fInitError != B_OK) @@ -281,7 +212,8 @@ return B_BAD_VALUE; status_t status; - status = fBufferList->RequestBuffer(fReclaimSem, fBufferCount, 0, 0, &buffer, timeout); + status = fBufferList->RequestBuffer(fReclaimSem, fBufferCount, 0, 0, + &buffer, timeout); fRequestError = status; return status; @@ -300,29 +232,28 @@ status_t -BBufferGroup::CountBuffers(int32 *out_count) +BBufferGroup::CountBuffers(int32* _count) { CALLED(); if (fInitError != B_OK) return B_NO_INIT; - *out_count = fBufferCount; + *_count = fBufferCount; return B_OK; } status_t -BBufferGroup::GetBufferList(int32 buf_count, - BBuffer **out_buffers) +BBufferGroup::GetBufferList(int32 bufferCount, BBuffer** _buffers) { CALLED(); if (fInitError != B_OK) return B_NO_INIT; - if (buf_count <= 0 || buf_count > fBufferCount) + if (bufferCount <= 0 || bufferCount > fBufferCount) return B_BAD_VALUE; - return fBufferList->GetBufferList(fReclaimSem,buf_count,out_buffers); + return fBufferList->GetBufferList(fReclaimSem, bufferCount, _buffers); } @@ -333,25 +264,26 @@ if (fInitError != B_OK) return B_NO_INIT; - // XXX this function is not really useful anyway, and will - // XXX not work exactly as documented, but it is close enough + // TODO: this function is not really useful anyway, and will + // not work exactly as documented, but it is close enough if (fBufferCount < 0) return B_BAD_VALUE; if (fBufferCount == 0) return B_OK; - // we need to wait until at least one buffer belonging to this group is reclaimed. - // this has happened when can aquire "fReclaimSem" + // We need to wait until at least one buffer belonging to this group is + // reclaimed. + // This has happened when can aquire "fReclaimSem" status_t status; - while (B_INTERRUPTED == (status = acquire_sem(fReclaimSem))) + while ((status = acquire_sem(fReclaimSem)) == B_INTERRUPTED) ; - - if (status != B_OK) // some error happened + if (status != B_OK) return status; - // we need to release the "fReclaimSem" now, else we would block requesting of new buffers + // we need to release the "fReclaimSem" now, else we would block + // requesting of new buffers return release_sem(fReclaimSem); } @@ -364,7 +296,8 @@ if (fInitError != B_OK) return B_NO_INIT; - // because additional BBuffers might get added to this group betweeen acquire and release + // because additional BBuffers might get added to this group betweeen + // acquire and release int32 count = fBufferCount; if (count < 0) @@ -373,32 +306,29 @@ return B_OK; // we need to wait until all BBuffers belonging to this group are reclaimed. - // this has happened when the "fReclaimSem" can be aquired "fBufferCount" times + // this has happened when the "fReclaimSem" can be aquired "fBufferCount" + // times status_t status; - while (B_INTERRUPTED == (status = acquire_sem_etc(fReclaimSem, count, 0, 0))) - ; + do { + status = acquire_sem_etc(fReclaimSem, count, 0, 0); + } while (status == B_INTERRUPTED); - if (status != B_OK) // some error happened + if (status != B_OK) return status; - // we need to release the "fReclaimSem" now, else we would block requesting of new buffers + // we need to release the "fReclaimSem" now, else we would block + // requesting of new buffers return release_sem_etc(fReclaimSem, count, 0); } -/************************************************************* - * private BBufferGroup - *************************************************************/ -/* not implemented */ -/* -BBufferGroup::BBufferGroup(const BBufferGroup &) -BBufferGroup & BBufferGroup::operator=(const BBufferGroup &) -*/ +// #pragma mark - deprecated BeOS R4 API + status_t -BBufferGroup::AddBuffersTo(BMessage * message, const char * name, bool needLock) +BBufferGroup::AddBuffersTo(BMessage* message, const char* name, bool needLock) { CALLED(); if (fInitError != B_OK) @@ -413,22 +343,76 @@ if (name == NULL || strlen(name) == 0) return B_BAD_VALUE; - BBuffer ** buffers; - status_t status; + BBuffer** buffers; int32 count; count = fBufferCount; buffers = new BBuffer * [count]; - - if (B_OK != (status = GetBufferList(count,buffers))) + + status_t status = GetBufferList(count, buffers); + if (status != B_OK) goto end; - for (int32 i = 0; i < count; i++) - if (B_OK != (status = message->AddInt32(name,int32(buffers[i]->ID())))) + for (int32 i = 0; i < count; i++) { + status = message->AddInt32(name, int32(buffers[i]->ID())); + if (status != B_OK) goto end; - + } + end: delete [] buffers; return status; } + +// #pragma mark - private methods + + +/* not implemented */ +//BBufferGroup::BBufferGroup(const BBufferGroup &) +//BBufferGroup & BBufferGroup::operator=(const BBufferGroup &) + + +status_t +BBufferGroup::_Init() +{ + CALLED(); + + // some defaults in case we drop out early + fBufferList = 0; + fInitError = B_ERROR; + fRequestError = B_ERROR; + fBufferCount = 0; + + // Create the reclaim semaphore + // This is also used as a system wide unique identifier for this group + fReclaimSem = create_sem(0, "buffer reclaim sem"); + if (fReclaimSem < B_OK) { + ERROR("BBufferGroup::InitBufferGroup: couldn't create fReclaimSem\n"); + fInitError = (status_t)fReclaimSem; + return fInitError; + } + + // ask media_server to get the area_id of the shared buffer list + server_get_shared_buffer_area_request areaRequest; + server_get_shared_buffer_area_reply areaReply; + if (QueryServer(SERVER_GET_SHARED_BUFFER_AREA, &areaRequest, + sizeof(areaRequest), &areaReply, sizeof(areaReply)) != B_OK) { + ERROR("BBufferGroup::InitBufferGroup: SERVER_GET_SHARED_BUFFER_AREA " + "failed\n"); + fInitError = B_ERROR; + return fInitError; + } + + fBufferList = _shared_buffer_list::Clone(areaReply.area); + if (fBufferList == NULL) { + ERROR("BBufferGroup::InitBufferGroup: _shared_buffer_list::Clone " + "failed\n"); + fInitError = B_ERROR; + return fInitError; + } + + fInitError = B_OK; + return fInitError; +} + From axeld at pinc-software.de Wed Aug 5 18:33:49 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Wed, 05 Aug 2009 18:33:49 +0200 CEST Subject: [Haiku-commits] r32138 - haiku/trunk/headers/private/system/board In-Reply-To: <200908051601.n75G1Hgp004794@sheep.berlios.de> Message-ID: <142191487-BeMail@zon> mmu_man at mail.berlios.de wrote: > Added: > haiku/trunk/headers/private/system/board/overo/ > haiku/trunk/headers/private/system/board/verdex/ > Log: > Placeholder for current GSoC targets (verdex is QEMU, overo is the > real one). What is supposed to go in there, and why isn't it in arch/? Bye, Axel. From phoudoin at mail.berlios.de Wed Aug 5 18:54:33 2009 From: phoudoin at mail.berlios.de (phoudoin at mail.berlios.de) Date: Wed, 5 Aug 2009 18:54:33 +0200 Subject: [Haiku-commits] r32140 - haiku/trunk/build/jam Message-ID: <200908051654.n75GsXN2008891@sheep.berlios.de> Author: phoudoin Date: 2009-08-05 18:54:19 +0200 (Wed, 05 Aug 2009) New Revision: 32140 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32140&view=rev Modified: haiku/trunk/build/jam/OptionalPackages Log: Fixed Clockwerk gcc2/gcc4 package filenames. Modified: haiku/trunk/build/jam/OptionalPackages =================================================================== --- haiku/trunk/build/jam/OptionalPackages 2009-08-05 16:08:47 UTC (rev 32139) +++ haiku/trunk/build/jam/OptionalPackages 2009-08-05 16:54:19 UTC (rev 32140) @@ -204,14 +204,14 @@ if $(TARGET_ARCH) != x86 { Echo "No optional package Clockwerk available for $(TARGET_ARCH)" ; } else if $(HAIKU_GCC_VERSION[1]) >= 4 { - InstallOptionalHaikuImagePackage Clockwerk-0.0.1-2009-08-04 + InstallOptionalHaikuImagePackage Clockwerk-0.0.1-x86-gcc4-2009-08-04 : $(baseURL)/Clockwerk-0.0.1-x86-gcc4-2009-08-04.zip : ; AddSymlinkToHaikuImage home config be Applications : /boot/apps/Clockwerk/Clockwerk ; } else { - InstallOptionalHaikuImagePackage Clockwerk-0.0.1-2009-08-04 + InstallOptionalHaikuImagePackage Clockwerk-0.0.1-x86-gcc2-2009-08-04 : $(baseURL)/Clockwerk-0.0.1-x86-gcc2-2009-08-04.zip : ; From revol at free.fr Wed Aug 5 19:01:41 2009 From: revol at free.fr (=?utf-8?q?Fran=C3=A7ois?= Revol) Date: Wed, 05 Aug 2009 19:01:41 +0200 CEST Subject: [Haiku-commits] =?utf-8?q?r32138_-_haiku/trunk/headers/private/sy?= =?utf-8?q?stem/board?= In-Reply-To: <142191487-BeMail@zon> Message-ID: <2498479705-BeMail@laptop> > mmu_man at mail.berlios.de wrote: > > Added: > > haiku/trunk/headers/private/system/board/overo/ > > haiku/trunk/headers/private/system/board/verdex/ > > Log: > > Placeholder for current GSoC targets (verdex is QEMU, overo is the > > real one). > > What is supposed to go in there, and why isn't it in arch/? board_config.h & other stuff telling the cpu is an omap3, ... Right, it could be a subfolder of arch/$arch/ ... I don't know of a board with the same config and a different arch, yet. Ok let's move that here. Fran?ois. From axeld at mail.berlios.de Wed Aug 5 19:24:26 2009 From: axeld at mail.berlios.de (axeld at mail.berlios.de) Date: Wed, 5 Aug 2009 19:24:26 +0200 Subject: [Haiku-commits] r32141 - in haiku/trunk: headers/private/graphics/vesa src/system/boot/platform/bios_ia32 src/system/kernel/debug Message-ID: <200908051724.n75HOQAV023152@sheep.berlios.de> Author: axeld Date: 2009-08-05 19:24:23 +0200 (Wed, 05 Aug 2009) New Revision: 32141 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32141&view=rev Modified: haiku/trunk/headers/private/graphics/vesa/vesa.h haiku/trunk/src/system/boot/platform/bios_ia32/video.cpp haiku/trunk/src/system/kernel/debug/frame_buffer_console.cpp Log: * This fixes VGA mode frame buffer use, no idea when this got broken. It might be broken in the app_server now, but I haven't checked yet. * Fixed typo in vesa.h. Modified: haiku/trunk/headers/private/graphics/vesa/vesa.h =================================================================== --- haiku/trunk/headers/private/graphics/vesa/vesa.h 2009-08-05 16:54:19 UTC (rev 32140) +++ haiku/trunk/headers/private/graphics/vesa/vesa.h 2009-08-05 17:24:23 UTC (rev 32141) @@ -44,7 +44,7 @@ uint16 attributes; uint8 window_a_attributes; uint8 window_b_attributes; - uint16 window_granulatiry; + uint16 window_granularity; uint16 window_size; uint16 window_a_segment; uint16 window_b_segment; Modified: haiku/trunk/src/system/boot/platform/bios_ia32/video.cpp =================================================================== --- haiku/trunk/src/system/boot/platform/bios_ia32/video.cpp 2009-08-05 16:54:19 UTC (rev 32140) +++ haiku/trunk/src/system/boot/platform/bios_ia32/video.cpp 2009-08-05 17:24:23 UTC (rev 32141) @@ -1,5 +1,5 @@ /* - * Copyright 2004-2008, Axel D?rfler, axeld at pinc-software.de. + * Copyright 2004-2009, Axel D?rfler, axeld at pinc-software.de. * Copyright 2008, Stephan A?mus * Copyright 2008, Philippe Saint-Pierre * Distributed under the terms of the MIT License. @@ -1007,7 +1007,7 @@ gKernelArgs.frame_buffer.width = 640; gKernelArgs.frame_buffer.height = 480; - gKernelArgs.frame_buffer.bytes_per_row = 640 / 2; + gKernelArgs.frame_buffer.bytes_per_row = 80; gKernelArgs.frame_buffer.depth = 4; gKernelArgs.frame_buffer.physical_buffer.size = gKernelArgs.frame_buffer.width Modified: haiku/trunk/src/system/kernel/debug/frame_buffer_console.cpp =================================================================== --- haiku/trunk/src/system/kernel/debug/frame_buffer_console.cpp 2009-08-05 16:54:19 UTC (rev 32140) +++ haiku/trunk/src/system/kernel/debug/frame_buffer_console.cpp 2009-08-05 17:24:23 UTC (rev 32141) @@ -1,5 +1,5 @@ /* - * Copyright 2005-2008, Axel D?rfler, axeld at pinc-software.de. + * Copyright 2005-2009, Axel D?rfler, axeld at pinc-software.de. * Distributed under the terms of the MIT License. */ @@ -142,8 +142,8 @@ } else { // monochrome mode - uint8 *base = (uint8 *)(sConsole.frame_buffer + sConsole.bytes_per_row * y * CHAR_HEIGHT - + x * CHAR_WIDTH / 8); + uint8 *base = (uint8 *)(sConsole.frame_buffer + + sConsole.bytes_per_row * y * CHAR_HEIGHT + x * CHAR_WIDTH / 8); uint8 baseOffset = (x * CHAR_WIDTH) & 0x7; for (y = 0; y < CHAR_HEIGHT; y++) { @@ -415,7 +415,8 @@ if (args->frame_buffer.depth == 4) { // VGA mode will be treated as monochrome - args->frame_buffer.bytes_per_row /= 8; + // (ie. only the first plane will be used) + args->frame_buffer.depth = 1; } frame_buffer_update((addr_t)frameBuffer, args->frame_buffer.width, From mmu_man at mail.berlios.de Wed Aug 5 19:30:01 2009 From: mmu_man at mail.berlios.de (mmu_man at mail.berlios.de) Date: Wed, 5 Aug 2009 19:30:01 +0200 Subject: [Haiku-commits] r32142 - in haiku/trunk/headers/private/system: . arch/arm Message-ID: <200908051730.n75HU1o2032578@sheep.berlios.de> Author: mmu_man Date: 2009-08-05 19:29:55 +0200 (Wed, 05 Aug 2009) New Revision: 32142 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32142&view=rev Added: haiku/trunk/headers/private/system/arch/arm/board/ Removed: haiku/trunk/headers/private/system/board/ Log: Move board/ into arch/arm/ since boards likely depend on a cpu anyway. Other archs might want to use the same structure (mipsel ?). Copied: haiku/trunk/headers/private/system/arch/arm/board (from rev 32140, haiku/trunk/headers/private/system/board) From axeld at pinc-software.de Wed Aug 5 20:05:34 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Wed, 05 Aug 2009 20:05:34 +0200 CEST Subject: [Haiku-commits] r32138 - haiku/trunk/headers/private/system/board In-Reply-To: <2498479705-BeMail@laptop> Message-ID: <5647316905-BeMail@zon> "Fran?ois Revol" wrote: > > mmu_man at mail.berlios.de wrote: > > > Added: > > > haiku/trunk/headers/private/system/board/overo/ > > > haiku/trunk/headers/private/system/board/verdex/ > > > Log: > > > Placeholder for current GSoC targets (verdex is QEMU, overo is > > > the > > > real one). > > What is supposed to go in there, and why isn't it in arch/? > board_config.h & other stuff telling the cpu is an omap3, ... > > Right, it could be a subfolder of arch/$arch/ ... > I don't know of a board with the same config and a different arch, > yet. > Ok let's move that here. Also, does that really have to be "board" dependent - shouldn't it rather be CPU dependent? Like a sub-arch folder? And finally, why system/ and not kernel/ - the former are kernel headers interesting for userland. Bye, Axel. From bonefish at mail.berlios.de Wed Aug 5 20:41:23 2009 From: bonefish at mail.berlios.de (bonefish at mail.berlios.de) Date: Wed, 5 Aug 2009 20:41:23 +0200 Subject: [Haiku-commits] r32143 - haiku/trunk/build/jam Message-ID: <200908051841.n75IfNMX001149@sheep.berlios.de> Author: bonefish Date: 2009-08-05 20:41:21 +0200 (Wed, 05 Aug 2009) New Revision: 32143 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32143&view=rev Modified: haiku/trunk/build/jam/OptionalPackages Log: Removed superfluous check. Modified: haiku/trunk/build/jam/OptionalPackages =================================================================== --- haiku/trunk/build/jam/OptionalPackages 2009-08-05 17:29:55 UTC (rev 32142) +++ haiku/trunk/build/jam/OptionalPackages 2009-08-05 18:41:21 UTC (rev 32143) @@ -406,8 +406,6 @@ ; AddSymlinkToHaikuImage home config be Applications : /boot/apps/BeZillaBrowser/BeZillaBrowser ; - } else if $(HAIKU_GCC_VERSION[1]) >= 4 && ! $(isHybridBuild) { - Echo "No optional package Firefox available for GCC4" ; } else { InstallOptionalHaikuImagePackage BeZillaBrowser-gcc2-20090218 : http://bezilla.beuser.de/builds/BeZillaBrowser-gcc2-20090218.zip From ingo_weinhold at gmx.de Wed Aug 5 20:11:13 2009 From: ingo_weinhold at gmx.de (Ingo Weinhold) Date: Wed, 05 Aug 2009 20:11:13 +0200 Subject: [Haiku-commits] r32133 - haiku/trunk/build/jam In-Reply-To: <20090805170205.533.1@bepc.1249484037.fake> References: <200908051429.n75ET0DB001612@sheep.berlios.de> <20090805170205.533.1@bepc.1249484037.fake> Message-ID: <20090805201113.542.2@knochen-vm.localdomain> On 2009-08-05 at 17:02:05 [+0200], Stephan Assmus wrote: > > On 2009-08-05 at 16:29:00 [+0200], bonefish at mail.berlios.de wrote: > > Author: bonefish > > Date: 2009-08-05 16:28:58 +0200 (Wed, 05 Aug 2009) New Revision: 32133 > > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32133&view=rev > > > > Modified: > > haiku/trunk/build/jam/OptionalPackages > > Log: > > Reenabled Firefox gcc 4 package. > > > > > > Modified: haiku/trunk/build/jam/OptionalPackages > > =================================================================== > > --- haiku/trunk/build/jam/OptionalPackages 2009-08-05 14:26:47 UTC > > (rev 32132) > > +++ haiku/trunk/build/jam/OptionalPackages 2009-08-05 14:28:58 UTC > > (rev 32133) > > @@ -398,17 +398,14 @@ > > if [ IsOptionalHaikuImagePackageAdded Firefox ] { > > if $(TARGET_ARCH) != x86 { > > Echo "No optional package Firefox available for $(TARGET_ARCH)" ; > > -# TODO: Update BeZilla GCC4 build, this one is currently broken, because > > of > > -# the BToolTip addition. At least the GCC2 build will work just fine on > > hybrid > > -# installations. > > -# } else if $(HAIKU_GCC_VERSION[1]) >= 4 { > > -# InstallOptionalHaikuImagePackage > > -# BeZillaBrowser-2.0.0.21pre-haiku-gcc4-x86-09-03-01 > > -# : > > $(baseURL)/BeZillaBrowser-2.0.0.21pre-haiku-gcc4-x86-09-03-01.zip > > -# : apps > > -# ; > > -# AddSymlinkToHaikuImage home config be Applications > > -# : /boot/apps/BeZillaBrowser/BeZillaBrowser ; > > + } else if $(HAIKU_GCC_VERSION[1]) >= 4 { > > + InstallOptionalHaikuImagePackage > > + BeZillaBrowser-2.0.0.21pre-haiku-gcc4-x86-09-03-01 > > + : > > $(baseURL)/BeZillaBrowser-2.0.0.21pre-haiku-gcc4-x86-09-03-01.zip > > + : apps > > + ; > > + AddSymlinkToHaikuImage home config be Applications > > + : /boot/apps/BeZillaBrowser/BeZillaBrowser ; > > } else if $(HAIKU_GCC_VERSION[1]) >= 4 && ! $(isHybridBuild) { > > Echo "No optional package Firefox available for GCC4" ; > > } else { > > You did the same mistake as Rene. The next two lines need to be removed as > well. Oh, right. I guess I expected those temporary lines to be unintended or otherwise marked. CU, Ingo From axeld at mail.berlios.de Wed Aug 5 21:08:38 2009 From: axeld at mail.berlios.de (axeld at mail.berlios.de) Date: Wed, 5 Aug 2009 21:08:38 +0200 Subject: [Haiku-commits] r32144 - haiku/trunk/src/preferences/screen Message-ID: <200908051908.n75J8cOG009013@sheep.berlios.de> Author: axeld Date: 2009-08-05 21:08:36 +0200 (Wed, 05 Aug 2009) New Revision: 32144 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32144&view=rev Modified: haiku/trunk/src/preferences/screen/ScreenWindow.cpp Log: * Now also puts the monitor's serial number and production date into the tool tip (if available). Modified: haiku/trunk/src/preferences/screen/ScreenWindow.cpp =================================================================== --- haiku/trunk/src/preferences/screen/ScreenWindow.cpp 2009-08-05 18:41:21 UTC (rev 32143) +++ haiku/trunk/src/preferences/screen/ScreenWindow.cpp 2009-08-05 19:08:36 UTC (rev 32144) @@ -1103,7 +1103,7 @@ return; } - char text[256]; + char text[512]; snprintf(text, sizeof(text), "%s%s%s %g\"", info.vendor, info.name[0] ? " " : "", info.name, diagonalInches); @@ -1112,16 +1112,32 @@ if (fMonitorInfo->IsHidden()) fMonitorInfo->Show(); + size_t length = 0; + text[0] = 0; + if (info.min_horizontal_frequency != 0 && info.min_vertical_frequency != 0 && info.max_pixel_clock != 0) { - snprintf(text, sizeof(text), "Horizonal Frequency:\t%lu - %lu kHz\n" + length = snprintf(text, sizeof(text), + "Horizonal Frequency:\t%lu - %lu kHz\n" "Vertical Frequency:\t%lu - %lu Hz\n\n" - "Maximum Pixel Clock:\t%g MHz", info.min_horizontal_frequency, - info.max_horizontal_frequency, info.min_vertical_frequency, - info.max_vertical_frequency, info.max_pixel_clock / 1000.0); + "Maximum Pixel Clock:\t%g MHz", + info.min_horizontal_frequency, info.max_horizontal_frequency, + info.min_vertical_frequency, info.max_vertical_frequency, + info.max_pixel_clock / 1000.0); + } + if (info.serial_number[0] && length < sizeof(text)) { + length += snprintf(text + length, sizeof(text) - length, + "%sSerial no.: %s", length ? "\n\n" : "", + info.serial_number); + if (info.produced.week != 0 && info.produced.year != 0 + && length < sizeof(text)) { + length += snprintf(text + length, sizeof(text) - length, + "(%u/%u)", info.produced.week, info.produced.year); + } + } + if (text[0]) fMonitorView->SetToolTip(text); - } } From axeld at mail.berlios.de Wed Aug 5 21:10:24 2009 From: axeld at mail.berlios.de (axeld at mail.berlios.de) Date: Wed, 5 Aug 2009 21:10:24 +0200 Subject: [Haiku-commits] r32145 - haiku/trunk/src/servers/app/drawing Message-ID: <200908051910.n75JAOaf009872@sheep.berlios.de> Author: axeld Date: 2009-08-05 21:10:22 +0200 (Wed, 05 Aug 2009) New Revision: 32145 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32145&view=rev Modified: haiku/trunk/src/servers/app/drawing/AccelerantHWInterface.cpp Log: * Also fill out monitor_info production date from EDID info. * Do not set serial_number if there is none. Modified: haiku/trunk/src/servers/app/drawing/AccelerantHWInterface.cpp =================================================================== --- haiku/trunk/src/servers/app/drawing/AccelerantHWInterface.cpp 2009-08-05 19:08:36 UTC (rev 32144) +++ haiku/trunk/src/servers/app/drawing/AccelerantHWInterface.cpp 2009-08-05 19:10:22 UTC (rev 32145) @@ -928,9 +928,13 @@ memset(info, 0, sizeof(monitor_info)); strlcpy(info->vendor, edid.vendor.manufacturer, sizeof(info->vendor)); - snprintf(info->serial_number, sizeof(info->serial_number), "%lu", - edid.vendor.serial); + if (edid.vendor.serial != 0) { + snprintf(info->serial_number, sizeof(info->serial_number), "%lu", + edid.vendor.serial); + } info->product_id = edid.vendor.prod_id; + info->produced.week = edid.vendor.week; + info->produced.year = edid.vendor.year; info->width = edid.display.h_size; info->height = edid.display.v_size; @@ -946,6 +950,7 @@ case EDID1_MONITOR_NAME: // There can be several of these; in this case we'll just // overwrite the previous entries + // TODO: we could append them as well strlcpy(info->name, monitor->data.monitor_name, sizeof(info->name)); break; From mattmadia at gmail.com Wed Aug 5 23:09:50 2009 From: mattmadia at gmail.com (mattmadia at gmail.com) Date: Wed, 05 Aug 2009 14:09:50 -0700 (PDT) Subject: [Haiku-commits] BOM: r32142 - ...failed C++ /objects/haiku/--arch--/release/system/kernel/signal.o ... Message-ID: <4a79f51e.48c3f10a.7b77.ffff8c51@mx.google.com> Host Machine : FreeBSD 7.2-RELEASE i386 Host Machine 32|64bit : 32bit use-xattr : True use-32bit : False Architectures Tested : ppc x86gcc2 x86gcc4 x86gcc2hybrid x86gcc4hybrid Targets Affected : x86gcc4- at alpha-cd x86gcc4- at alpha-raw x86gcc4- at alpha-vmware x86gcc2- at alpha-cd x86gcc2- at alpha-raw x86gcc2- at alpha-vmware x86gcc2hybrid- at alpha-cd x86gcc2hybrid- at alpha-raw x86gcc2hybrid- at alpha-vmware ppc-haiku-image ppc- at alpha-raw x86gcc4hybrid- at alpha-cd x86gcc4hybrid- at alpha-raw x86gcc4hybrid- at alpha-vmware Log Snippet : AddTargetVariableToScript1 /storage/Build-o-Matic/haiku/haiku/generated.x86gcc4/haiku.image-init-vars AddTargetVariableToScript1 /storage/Build-o-Matic/haiku/haiku/generated.x86gcc4/haiku.image-init-vars AddTargetVariableToScript1 /storage/Build-o-Matic/haiku/haiku/generated.x86gcc4/haiku.image-init-vars AddTargetVariableToScript1 /storage/Build-o-Matic/haiku/haiku/generated.x86gcc4/haiku.image-init-vars AddTargetVariableToScript1 /storage/Build-o-Matic/haiku/haiku/generated.x86gcc4/haiku.image-init-vars InitScript1 /storage/Build-o-Matic/haiku/haiku/generated.x86gcc4/haiku.image-make-dirs CreateContainerMakeDirectoriesScript1 /storage/Build-o-Matic/haiku/haiku/generated.x86gcc4/haiku.image-make-dirs AppendToContainerMakeDirectoriesScriptAttributes haiku.image-make-dirs-attributes-dummy-home/config/settings/printers/Preview AppendToContainerMakeDirectoriesScriptAttributes haiku.image-make-dirs-attributes-dummy-home/config/settings/printers/Save as PDF InitScript1 /storage/Build-o-Matic/haiku/haiku/generated.x86gcc4/haiku.image-copy-files BuildHaikuImageUserGroupFile /storage/Build-o-Matic/haiku/haiku/generated.x86gcc4/objects/common/group BuildHaikuImageUserGroupFile /storage/Build-o-Matic/haiku/haiku/generated.x86gcc4/objects/common/passwd AppendToContainerCopyFilesScript haiku.image-copy-files-dummy-system/etc C++ /storage/Build-o-Matic/haiku/haiku/generated.x86gcc4/objects/haiku/x86/release/system/kernel/signal.o /storage/Build-o-Matic/haiku/haiku/src/system/kernel/signal.cpp:60: error: expected constructor, destructor, or type conversion before '--' token /storage/Build-o-Matic/haiku/haiku/src/system/kernel/signal.cpp: In function 'bool handle_signals(thread*)': /storage/Build-o-Matic/haiku/haiku/src/system/kernel/signal.cpp:382: error: 'deliver_signal' was not declared in this scope /storage/Build-o-Matic/haiku/haiku/generated.x86gcc4/cross-tools/bin/i586-pc-haiku-gcc -c "/storage/Build-o-Matic/haiku/haiku/src/system/kernel/signal.cpp" -O -Wall -Wno-trigraphs -Wno-multichar -pipe -fno-strict-aliasing -fno-tree-vrp -nostdinc -Wno-deprecated -DHAIKU_ARCH=\"x86\" -D_ZETA_USING_DEPRECATED_API_=1 -D_ZETA_TS_FIND_DIR_=1 -Werror -Wno-error=uninitialized -pipe -fno-strict-aliasing -fno-tree-vrp -finline -fno-builtin -fno-exceptions -DBOCHS_DEBUG_HACK=0 -fno-use-cxa-atexit -ffreestanding -fno-pic -D_KERNEL_MODE -D__HAIKU__ -DHAIKU_DISTRO_COMPATIBILITY_DEFAULT -D__INTEL__ -DARCH_x86 -DBOOT_ARCHIVE_IMAGE_OFFSET=300 -DHAIKU_TARGET_PLATFORM_HAIKU -iquote /storage/Build-o-Matic/haiku/haiku/build/user_config_headers -iquote /storage/Build-o-Matic/haiku/haiku/build/config_headers -iquote /storage/Build-o-Matic/haiku/haiku/src/system/kernel -iquote /storage/Build-o-Matic/haiku/haiku/generated.x86gcc4/objects/common/system/kernel -iquote /storage/Build-o-Matic/haiku/haiku/generated.x86gcc4/objects/freebsd/x86/common/system/kernel -iquote /storage/Build-o-Matic/haiku/haiku/generated.x86gcc4/objects/haiku/x86/common/system/kernel -iquote /storage/Build-o-Matic/haiku/haiku/src/system/kernel/scheduler -I /storage/Build-o-Matic/haiku/haiku/headers/private/libroot -I /storage/Build-o-Matic/haiku/haiku/headers/private/shared -I /storage/Build-o-Matic/haiku/haiku/headers/private/runtime_loader -I /storage/Build-o-Matic/haiku/haiku/headers/private/. -I /storage/Build-o-Matic/haiku/haiku/headers/private/kernel -I /storage/Build-o-Matic/haiku/haiku/headers/private/libroot -I /storage/Build-o-Matic/haiku/haiku/headers/private/kernel/boot/platform/bios_ia32 -I /storage/Build-o-Matic/haiku/haiku/headers/private/kernel/arch/x86 -I /storage/Build-o-Matic/haiku/haiku/headers/private/. -I /storage/Build-o-Matic/haiku/haiku/headers/private/system -I /storage/Build-o-Matic/haiku/haiku/headers/private/system/arch/x86 -I /storage/Build-o-Matic/haiku/haiku/generated.x86gcc4/cross-tools/lib/gcc/i586-pc-haiku/4.3.3/../../../../i586-pc-haiku/include/c++/4.3.3 -I /storage/Build-o-Matic/haiku/haiku/generated.x86gcc4/cross-tools/lib/gcc/i586-pc-haiku/4.3.3/../../../../i586-pc-haiku/include/c++/4.3.3/i586-pc-haiku -I /storage/Build-o-Matic/haiku/haiku/generated.x86gcc4/cross-tools/lib/gcc/i586-pc-haiku/4.3.3/../../../../i586-pc-haiku/include/c++/4.3.3/backward -I /storage/Build-o-Matic/haiku/haiku/generated.x86gcc4/cross-tools/lib/gcc/i586-pc-haiku/4.3.3/../../../../i586-pc-haiku/include/c++/4.3.3/ext -I /storage/Build-o-Matic/haiku/haiku/generated.x86gcc4/cross-tools/lib/gcc/i586-pc-haiku/4.3.3/include -I /storage/Build-o-Matic/haiku/haiku/generated.x86gcc4/cross-tools/lib/gcc/i586-pc-haiku/4.3.3/include-fixed -I /storage/Build-o-Matic/haiku/haiku/headers -I /storage/Build-o-Matic/haiku/haiku/headers/posix -I /storage/Build-o-Matic/haiku/haiku/headers/gnu -I /storage/Build-o-Matic/haiku/haiku/headers/glibc -I /storage/Build-o-Matic/haiku/haiku/headers/os -I /storage/Build-o-Matic/haiku/haiku/headers/os/add-ons -I /storage/Build-o-Matic/haiku/haiku/headers/os/add-ons/file_system -I /storage/Build-o-Matic/haiku/haiku/headers/os/add-ons/graphics -I /storage/Build-o-Matic/haiku/haiku/headers/os/add-ons/input_server -I /storage/Build-o-Matic/haiku/haiku/headers/os/add-ons/registrar -I /storage/Build-o-Matic/haiku/haiku/headers/os/add-ons/screen_saver -I /storage/Build-o-Matic/haiku/haiku/headers/os/add-ons/tracker -I /storage/Build-o-Matic/haiku/haiku/headers/os/app -I /storage/Build-o-Matic/haiku/haiku/headers/os/device -I /storage/Build-o-Matic/haiku/haiku/headers/os/drivers -I /storage/Build-o-Matic/haiku/haiku/headers/os/game -I /storage/Build-o-Matic/haiku/haiku/headers/os/interface -I /storage/Build-o-Matic/haiku/haiku/headers/os/kernel -I /storage/Build-o-Matic/haiku/haiku/headers/os/media -I /storage/Build-o-Matic/haiku/haiku/headers/os/mail -I /storage/Build-o-Matic/haiku/haiku/headers/os/midi -I /storage/Build-o-Matic/haiku/haiku/headers/os/midi2 -I /storage/Build-o-Matic/haiku/haiku/headers/os/net -I /storage/Build-o-Matic/haiku/haiku/headers/os/opengl -I /storage/Build-o-Matic/haiku/haiku/headers/os/storage -I /storage/Build-o-Matic/haiku/haiku/headers/os/support -I /storage/Build-o-Matic/haiku/haiku/headers/os/translation -I /storage/Build-o-Matic/haiku/haiku/headers/private/. -o "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc4/objects/haiku/x86/release/system/kernel/signal.o" ; ...failed C++ /storage/Build-o-Matic/haiku/haiku/generated.x86gcc4/objects/haiku/x86/release/system/kernel/signal.o ... ...skipped kernel_core.o for lack of signal.o... ...skipped kernel.so for lack of kernel_core.o... ...skipped pci for lack of kernel.so... ...skipped haiku.image-copy-files-dummy-system/add-ons/kernel/bus_managers for lack of pci... ...skipped haiku-alpha.vmdk for lack of haiku.image-copy-files... ...failed updating 1 target(s)... ...skipped 5 target(s)... ...updated 10 target(s)... command: jam -q -j1 @alpha-vmware From mattmadia at gmail.com Wed Aug 5 23:12:07 2009 From: mattmadia at gmail.com (Matt Madia) Date: Wed, 5 Aug 2009 21:12:07 +0000 Subject: [Haiku-commits] BOM: r32142 - ...failed C++ /objects/haiku/--arch--/release/system/kernel/signal.o ... In-Reply-To: <4a79f51e.48c3f10a.7b77.ffff8c51@mx.google.com> References: <4a79f51e.48c3f10a.7b77.ffff8c51@mx.google.com> Message-ID: <1e42d8c50908051412v3a0f63b5odb28f3e75e55f1d9@mail.gmail.com> On Wed, Aug 5, 2009 at 21:09, wrote: > Host Machine : FreeBSD 7.2-RELEASE i386 > Host Machine 32|64bit : 32bit > use-xattr : True > use-32bit : False > Architectures Tested : > ppc This was a forced error to demonstrate functionality. From leavengood at gmail.com Wed Aug 5 23:20:10 2009 From: leavengood at gmail.com (Ryan Leavengood) Date: Wed, 5 Aug 2009 17:20:10 -0400 Subject: [Haiku-commits] BOM: r32142 - ...failed C++ /objects/haiku/--arch--/release/system/kernel/signal.o ... In-Reply-To: <1e42d8c50908051412v3a0f63b5odb28f3e75e55f1d9@mail.gmail.com> References: <4a79f51e.48c3f10a.7b77.ffff8c51@mx.google.com> <1e42d8c50908051412v3a0f63b5odb28f3e75e55f1d9@mail.gmail.com> Message-ID: On Wed, Aug 5, 2009 at 5:12 PM, Matt Madia wrote: > > This was a forced error to demonstrate functionality. > > From this point forward, all emails with a similar subject are to be > actual errors. Looks cool! Now we just need an automatic tally of owed beers, coffees, ice cream sundaes or your refreshment of choice for introduced build errors ;) -- Regards, Ryan From jackburton at mail.berlios.de Wed Aug 5 23:29:24 2009 From: jackburton at mail.berlios.de (jackburton at mail.berlios.de) Date: Wed, 5 Aug 2009 23:29:24 +0200 Subject: [Haiku-commits] r32146 - haiku/trunk/src/tests/kits/game/ParticlesII Message-ID: <200908052129.n75LTOUM028729@sheep.berlios.de> Author: jackburton Date: 2009-08-05 23:29:22 +0200 (Wed, 05 Aug 2009) New Revision: 32146 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32146&view=rev Modified: haiku/trunk/src/tests/kits/game/ParticlesII/particlesII.cpp Log: Reverted r21451, otherwise ParticlesII crashes after a while, if the accelerant doesn't support moving the frame buffer. Modified: haiku/trunk/src/tests/kits/game/ParticlesII/particlesII.cpp =================================================================== --- haiku/trunk/src/tests/kits/game/ParticlesII/particlesII.cpp 2009-08-05 19:10:22 UTC (rev 32145) +++ haiku/trunk/src/tests/kits/game/ParticlesII/particlesII.cpp 2009-08-05 21:29:22 UTC (rev 32146) @@ -95,7 +95,7 @@ NWindowScreen *ws = new NWindowScreen(&ret); PRINT(("WindowScreen ctor returned. ret = %s\n", strerror(ret))); // exit if constructing the WindowScreen failed. - if((ws == NULL) || (ret < B_OK)) + if((ws == NULL) || (ret < B_OK) || !ws->CanControlFrameBuffer()) { //printf("the window screen was NULL, or there was an error\n"); PostMessage(B_QUIT_REQUESTED); From jackburton at mail.berlios.de Wed Aug 5 23:30:42 2009 From: jackburton at mail.berlios.de (jackburton at mail.berlios.de) Date: Wed, 5 Aug 2009 23:30:42 +0200 Subject: [Haiku-commits] r32147 - in haiku/trunk: headers/os/game src/kits/game Message-ID: <200908052130.n75LUgt3029328@sheep.berlios.de> Author: jackburton Date: 2009-08-05 23:30:39 +0200 (Wed, 05 Aug 2009) New Revision: 32147 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32147&view=rev Modified: haiku/trunk/headers/os/game/WindowScreen.h haiku/trunk/src/kits/game/WindowScreen.cpp Log: Some cleanups. Shouldn't include any functional changes, except maybe better cleanup on exiting. Modified: haiku/trunk/headers/os/game/WindowScreen.h =================================================================== --- haiku/trunk/headers/os/game/WindowScreen.h 2009-08-05 21:29:22 UTC (rev 32146) +++ haiku/trunk/headers/os/game/WindowScreen.h 2009-08-05 21:30:39 UTC (rev 32147) @@ -83,7 +83,9 @@ status_t _Activate(); status_t _Deactivate(); - status_t _SetupAccelerantHooks(bool enable); + status_t _SetupAccelerantHooks(); + void _ResetAccelerantHooks(); + status_t _GetCardInfo(); void _Suspend(); void _Resume(); Modified: haiku/trunk/src/kits/game/WindowScreen.cpp =================================================================== --- haiku/trunk/src/kits/game/WindowScreen.cpp 2009-08-05 21:29:22 UTC (rev 32146) +++ haiku/trunk/src/kits/game/WindowScreen.cpp 2009-08-05 21:30:39 UTC (rev 32147) @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008, Haiku. All Rights Reserved. + * Copyright 2002-2009, Haiku. All Rights Reserved. * Copyright 2002-2005, * Marcus Overhagen, * Stefano Ceccherini (stefano.ceccherini at gmail.com), @@ -32,7 +32,7 @@ using BPrivate::AppServerLink; -//#define TRACE_WINDOWSCREEN 1 +#define TRACE_WINDOWSCREEN 1 #if TRACE_WINDOWSCREEN # define CALLED() printf("%s\n", __PRETTY_FUNCTION__); #else @@ -321,44 +321,45 @@ if (firstIndex < 0 || lastIndex > 255 || firstIndex > lastIndex) return; - if (Lock()) { - if (!fActivateState) { - // If we aren't active, we just change our local palette - for (int32 x = firstIndex; x <= lastIndex; x++) { - fPalette[x] = list[x]; - } - } else { - uint8 colors[3 * 256]; - // the color table has 3 bytes per color - int32 j = 0; + if (!Lock()) + return; + + if (!fActivateState) { + // If we aren't active, we just change our local palette + for (int32 x = firstIndex; x <= lastIndex; x++) { + fPalette[x] = list[x]; + } + } else { + uint8 colors[3 * 256]; + // the color table has 3 bytes per color + int32 j = 0; - for (int32 x = firstIndex; x <= lastIndex; x++) { - fPalette[x] = list[x]; - // update our local palette as well + for (int32 x = firstIndex; x <= lastIndex; x++) { + fPalette[x] = list[x]; + // update our local palette as well - colors[j++] = list[x].red; - colors[j++] = list[x].green; - colors[j++] = list[x].blue; - } + colors[j++] = list[x].red; + colors[j++] = list[x].green; + colors[j++] = list[x].blue; + } - if (fAddonImage >= 0) { - set_indexed_colors setIndexedColors = - (set_indexed_colors)fGetAccelerantHook(B_SET_INDEXED_COLORS, - NULL); - if (setIndexedColors != NULL) { - setIndexedColors(lastIndex - firstIndex + 1, firstIndex, - colors, 0); - } + if (fAddonImage >= 0) { + set_indexed_colors setIndexedColors = + (set_indexed_colors)fGetAccelerantHook(B_SET_INDEXED_COLORS, + NULL); + if (setIndexedColors != NULL) { + setIndexedColors(lastIndex - firstIndex + 1, firstIndex, + colors, 0); } - - // TODO: Tell the app_server about our changes - - BScreen screen(this); - screen.WaitForRetrace(); } - Unlock(); + // TODO: Tell the app_server about our changes + + BScreen screen(this); + screen.WaitForRetrace(); } + + Unlock(); } @@ -683,11 +684,12 @@ status_t BWindowScreen::_Activate() { + CALLED(); status_t status = _AssertDisplayMode(fDisplayMode); if (status < B_OK) return status; - status = _SetupAccelerantHooks(true); + status = _SetupAccelerantHooks(); if (status < B_OK) return status; @@ -716,6 +718,7 @@ status_t BWindowScreen::_Deactivate() { + CALLED(); _AssertDisplayMode(fOriginalDisplayMode); if (fDebugState && !fDebugFirst) { @@ -724,76 +727,72 @@ } else ScreenConnected(false); - status_t status = _SetupAccelerantHooks(false); - if (status == B_OK) { - be_app->ShowCursor(); - if (fActivateState) { - // TODO: reset palette - } + _ResetAccelerantHooks(); + + be_app->ShowCursor(); + if (fActivateState) { + BScreen screen(this); + SetColorList((rgb_color *)screen.ColorMap()->color_list); } - return status; + return B_OK; } status_t -BWindowScreen::_SetupAccelerantHooks(bool enable) +BWindowScreen::_SetupAccelerantHooks() { CALLED(); - if (fAddonImage >= 0) { - fWaitEngineIdle(); - sFillRectHook = NULL; - sBlitRectHook = NULL; - sTransparentBlitHook = NULL; - sScaledFilteredBlitHook = NULL; - sWaitIdleHook = NULL; - sEngineToken = NULL; - sAcquireEngineHook = NULL; - sReleaseEngineHook = NULL; - } - - fLockState = enable ? 1 : 0; - + status_t status = B_OK; - if (enable) { - acquire_engine aquireEngine = NULL; - release_engine releaseEngine = NULL; - fill_rectangle fillRectangle = NULL; - screen_to_screen_blit blit = NULL; - screen_to_screen_transparent_blit transparentBlit = NULL; - screen_to_screen_scaled_filtered_blit scaledFilteredBlit = NULL; - - if (fAddonImage < 0) { - status = _InitClone(); - if (status == B_OK) { - fWaitEngineIdle = (wait_engine_idle)fGetAccelerantHook(B_WAIT_ENGINE_IDLE, NULL); - - releaseEngine = (release_engine)fGetAccelerantHook(B_RELEASE_ENGINE, NULL); - aquireEngine = (acquire_engine)fGetAccelerantHook(B_ACQUIRE_ENGINE, NULL); - fillRectangle = (fill_rectangle)fGetAccelerantHook(B_FILL_RECTANGLE, NULL); - blit = (screen_to_screen_blit)fGetAccelerantHook(B_SCREEN_TO_SCREEN_BLIT, NULL); - transparentBlit = (screen_to_screen_transparent_blit)fGetAccelerantHook(B_SCREEN_TO_SCREEN_TRANSPARENT_BLIT, NULL); - scaledFilteredBlit = (screen_to_screen_scaled_filtered_blit)fGetAccelerantHook(B_SCREEN_TO_SCREEN_SCALED_FILTERED_BLIT, NULL); - } - } - - if (status == B_OK) { - sFillRectHook = fillRectangle; - sBlitRectHook = blit; - sTransparentBlitHook = transparentBlit; - sScaledFilteredBlitHook = scaledFilteredBlit; - sWaitIdleHook = fWaitEngineIdle; - sAcquireEngineHook = aquireEngine; - sReleaseEngineHook = releaseEngine; - + if (fAddonImage < 0) + status = _InitClone(); + else { + if (fWaitEngineIdle) fWaitEngineIdle(); - } + + _ResetAccelerantHooks(); } - + + if (status == B_OK) { + sWaitIdleHook = fWaitEngineIdle = (wait_engine_idle)fGetAccelerantHook(B_WAIT_ENGINE_IDLE, NULL); + sReleaseEngineHook = (release_engine)fGetAccelerantHook(B_RELEASE_ENGINE, NULL); + sAcquireEngineHook = (acquire_engine)fGetAccelerantHook(B_ACQUIRE_ENGINE, NULL); + sFillRectHook = (fill_rectangle)fGetAccelerantHook(B_FILL_RECTANGLE, NULL); + sBlitRectHook = (screen_to_screen_blit)fGetAccelerantHook(B_SCREEN_TO_SCREEN_BLIT, NULL); + sTransparentBlitHook = (screen_to_screen_transparent_blit)fGetAccelerantHook(B_SCREEN_TO_SCREEN_TRANSPARENT_BLIT, NULL); + sScaledFilteredBlitHook = (screen_to_screen_scaled_filtered_blit)fGetAccelerantHook(B_SCREEN_TO_SCREEN_SCALED_FILTERED_BLIT, NULL); + + if (fWaitEngineIdle) + fWaitEngineIdle(); + + fLockState = 1; + } + return status; } +void +BWindowScreen::_ResetAccelerantHooks() +{ + CALLED(); + + sFillRectHook = NULL; + sBlitRectHook = NULL; + sTransparentBlitHook = NULL; + sScaledFilteredBlitHook = NULL; + sWaitIdleHook = NULL; + sEngineToken = NULL; + sAcquireEngineHook = NULL; + sReleaseEngineHook = NULL; + + fWaitEngineIdle = NULL; + + fLockState = 0; +} + + status_t BWindowScreen::_GetCardInfo() { From jackburton at mail.berlios.de Wed Aug 5 23:31:19 2009 From: jackburton at mail.berlios.de (jackburton at mail.berlios.de) Date: Wed, 5 Aug 2009 23:31:19 +0200 Subject: [Haiku-commits] r32148 - haiku/trunk/src/kits/game Message-ID: <200908052131.n75LVJWw029584@sheep.berlios.de> Author: jackburton Date: 2009-08-05 23:31:17 +0200 (Wed, 05 Aug 2009) New Revision: 32148 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32148&view=rev Modified: haiku/trunk/src/kits/game/WindowScreen.cpp Log: Accidentally enabled tracing Modified: haiku/trunk/src/kits/game/WindowScreen.cpp =================================================================== --- haiku/trunk/src/kits/game/WindowScreen.cpp 2009-08-05 21:30:39 UTC (rev 32147) +++ haiku/trunk/src/kits/game/WindowScreen.cpp 2009-08-05 21:31:17 UTC (rev 32148) @@ -32,7 +32,7 @@ using BPrivate::AppServerLink; -#define TRACE_WINDOWSCREEN 1 +//#define TRACE_WINDOWSCREEN 1 #if TRACE_WINDOWSCREEN # define CALLED() printf("%s\n", __PRETTY_FUNCTION__); #else From axeld at pinc-software.de Wed Aug 5 23:32:39 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Wed, 05 Aug 2009 23:32:39 +0200 CEST Subject: [Haiku-commits] =?utf-8?q?BOM=3A_r32142_-_=2E=2E=2Efailed_C++_/ob?= =?utf-8?q?jects/haiku/--arch--/release/system/kernel/signal=2Eo_=2E=2E=2E?= In-Reply-To: <1e42d8c50908051412v3a0f63b5odb28f3e75e55f1d9@mail.gmail.com> Message-ID: <18072517850-BeMail@zon> Matt Madia wrote: > On Wed, Aug 5, 2009 at 21:09, wrote: > > Host Machine : FreeBSD 7.2-RELEASE i386 > > Host Machine 32|64bit : 32bit > > use-xattr : True > > use-32bit : False > > Architectures Tested : > > ppc > This was a forced error to demonstrate functionality. > > From this point forward, all emails with a similar subject are to be > actual errors. Nice one! Thanks for doing this! I would guess it would be nice to have those scripts in the repository as well? Bye, Axel. From pulkomandy at mail.berlios.de Wed Aug 5 23:33:32 2009 From: pulkomandy at mail.berlios.de (pulkomandy at BerliOS) Date: Wed, 5 Aug 2009 23:33:32 +0200 Subject: [Haiku-commits] r32149 - in haiku/branches/components/gsoc-locale-kit: headers/os/locale src/kits/locale src/preferences/locale Message-ID: <200908052133.n75LXWjZ030427@sheep.berlios.de> Author: pulkomandy Date: 2009-08-05 23:33:31 +0200 (Wed, 05 Aug 2009) New Revision: 32149 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32149&view=rev Modified: haiku/branches/components/gsoc-locale-kit/headers/os/locale/Country.h haiku/branches/components/gsoc-locale-kit/src/kits/locale/Country.cpp haiku/branches/components/gsoc-locale-kit/src/preferences/locale/LocaleWindow.cpp haiku/branches/components/gsoc-locale-kit/src/preferences/locale/LocaleWindow.h Log: -Completed more methods in BCountry -Select the current country in the preferences window when opening it -Some small cleanups as usual Modified: haiku/branches/components/gsoc-locale-kit/headers/os/locale/Country.h =================================================================== --- haiku/branches/components/gsoc-locale-kit/headers/os/locale/Country.h 2009-08-05 21:31:17 UTC (rev 32148) +++ haiku/branches/components/gsoc-locale-kit/headers/os/locale/Country.h 2009-08-05 21:33:31 UTC (rev 32149) @@ -22,6 +22,7 @@ virtual ~BCountry(); virtual const char *Name() const; + const char* Code() const; // see definitions below const char *GetString(uint32 id) const; Modified: haiku/branches/components/gsoc-locale-kit/src/kits/locale/Country.cpp =================================================================== --- haiku/branches/components/gsoc-locale-kit/src/kits/locale/Country.cpp 2009-08-05 21:31:17 UTC (rev 32148) +++ haiku/branches/components/gsoc-locale-kit/src/kits/locale/Country.cpp 2009-08-05 21:33:31 UTC (rev 32149) @@ -5,9 +5,15 @@ #include + +#include + #include #include +#include +#include +#include #include #include @@ -37,6 +43,7 @@ // positive/negative sign "+", "-", + // currency/monetary "US$" " " @@ -59,6 +66,7 @@ } +// TODO should not exist BCountry::BCountry(const char **strings) : fStrings(strings) @@ -74,11 +82,24 @@ const char * BCountry::Name() const { - return "United States Of America"; + UnicodeString uString; + fICULocale.getDisplayName(uString); + BString str; + BStringByteSink bbs(&str); + uString.toUTF8(bbs); + return str.String(); } const char * +BCountry::Code() const +{ + return fICULocale.getName(); +} + + +// TODO use ICU backend keywords instead +const char * BCountry::GetString(uint32 id) const { if (id < B_COUNTRY_STRINGS_BASE || id >= B_NUM_COUNTRY_STRINGS) @@ -98,11 +119,12 @@ void BCountry::FormatDate(BString *string, time_t time, bool longFormat) { + // TODO: ICU allows for 4 different levels of expansion : + // short, medium, long, and full. Our bool parameter is not enough... icu_4_2::DateFormat* dateFormatter; dateFormatter = DateFormat::createDateInstance( - longFormat ? DateFormat::LONG : DateFormat::SHORT, + longFormat ? DateFormat::FULL : DateFormat::SHORT, fICULocale); - //UDate myDate = Calendar::getNow(); UnicodeString myString; myString = dateFormatter->format(time, myString); @@ -122,6 +144,19 @@ void BCountry::FormatTime(BString *string, time_t time, bool longFormat) { + // TODO: ICU allows for 4 different levels of expansion : + // short, medium, long, and full. Our bool parameter is not enough... + icu_4_2::DateFormat* timeFormatter; + timeFormatter = DateFormat::createTimeInstance( + longFormat ? DateFormat::FULL : DateFormat::SHORT, + fICULocale); + UnicodeString myString; + myString = timeFormatter->format(time, myString); + + string->Truncate(0); + BStringByteSink bbs(string); + + myString.toUTF8(bbs); } @@ -162,6 +197,18 @@ void BCountry::FormatNumber(BString *string, double value) { + UErrorCode err; + NumberFormat* nf = NumberFormat::createInstance(fICULocale, err); + + assert(err == U_ZERO_ERROR); + + UnicodeString myString; + myString = nf->format(value, myString); + + string->Truncate(0); + BStringByteSink bbs(string); + + myString.toUTF8(bbs); } @@ -174,41 +221,141 @@ void BCountry::FormatNumber(BString *string, int32 value) { + UErrorCode err; + NumberFormat* nf = NumberFormat::createInstance(fICULocale, err); + + assert(err == U_ZERO_ERROR); + + UnicodeString myString; + myString = nf->format((int32_t)value, myString); + + string->Truncate(0); + BStringByteSink bbs(string); + + myString.toUTF8(bbs); } +// This will only work for locales using the decimal system... const char * BCountry::DecimalPoint() const { - return fStrings[B_DECIMAL_POINT]; + UErrorCode err; + NumberFormat* nf = NumberFormat::createInstance(fICULocale, err); + + assert(err == U_ZERO_ERROR); + + DecimalFormat* df = dynamic_cast(nf); + + assert(df != NULL); + + const DecimalFormatSymbols* syms = df->getDecimalFormatSymbols(); + + UnicodeString myString; + myString = syms->getSymbol(DecimalFormatSymbols::kDecimalSeparatorSymbol); + + BString string; + BStringByteSink bbs(&string); + + myString.toUTF8(bbs); + + return string.String(); } const char * BCountry::ThousandsSeparator() const { - return fStrings[B_THOUSANDS_SEPARATOR]; + UErrorCode err; + NumberFormat* nf = NumberFormat::createInstance(fICULocale, err); + assert(err == U_ZERO_ERROR); + DecimalFormat* df = dynamic_cast(nf); + + assert(df != NULL); + + const DecimalFormatSymbols* syms = df->getDecimalFormatSymbols(); + + UnicodeString myString; + myString = syms->getSymbol(DecimalFormatSymbols::kPatternSeparatorSymbol); + + BString string; + BStringByteSink bbs(&string); + + myString.toUTF8(bbs); + + return string.String(); } const char * BCountry::Grouping() const { - return fStrings[B_GROUPING]; + UErrorCode err; + NumberFormat* nf = NumberFormat::createInstance(fICULocale, err); + assert(err == U_ZERO_ERROR); + DecimalFormat* df = dynamic_cast(nf); + + assert(df != NULL); + + const DecimalFormatSymbols* syms = df->getDecimalFormatSymbols(); + + UnicodeString myString; + myString = syms->getSymbol(DecimalFormatSymbols::kGroupingSeparatorSymbol); + + BString string; + BStringByteSink bbs(&string); + + myString.toUTF8(bbs); + + return string.String(); } const char * BCountry::PositiveSign() const { - return fStrings[B_POSITIVE_SIGN]; + UErrorCode err; + NumberFormat* nf = NumberFormat::createInstance(fICULocale, err); + assert(err == U_ZERO_ERROR); + DecimalFormat* df = dynamic_cast(nf); + + assert(df != NULL); + + const DecimalFormatSymbols* syms = df->getDecimalFormatSymbols(); + + UnicodeString myString; + myString = syms->getSymbol(DecimalFormatSymbols::kPlusSignSymbol); + + BString string; + BStringByteSink bbs(&string); + + myString.toUTF8(bbs); + + return string.String(); } const char * BCountry::NegativeSign() const { - return fStrings[B_NEGATIVE_SIGN]; + UErrorCode err; + NumberFormat* nf = NumberFormat::createInstance(fICULocale, err); + assert(err == U_ZERO_ERROR); + DecimalFormat* df = dynamic_cast(nf); + + assert(df != NULL); + + const DecimalFormatSymbols* syms = df->getDecimalFormatSymbols(); + + UnicodeString myString; + myString = syms->getSymbol(DecimalFormatSymbols::kMinusSignSymbol); + + BString string; + BStringByteSink bbs(&string); + + myString.toUTF8(bbs); + + return string.String(); } Modified: haiku/branches/components/gsoc-locale-kit/src/preferences/locale/LocaleWindow.cpp =================================================================== --- haiku/branches/components/gsoc-locale-kit/src/preferences/locale/LocaleWindow.cpp 2009-08-05 21:31:17 UTC (rev 32148) +++ haiku/branches/components/gsoc-locale-kit/src/preferences/locale/LocaleWindow.cpp 2009-08-05 21:33:31 UTC (rev 32149) @@ -446,6 +446,9 @@ int32_t localeCount; const Locale* currentLocale = Locale::getAvailableLocales(localeCount); + BCountry* defaultCountry; + be_locale_roster->GetDefaultCountry(&defaultCountry); + for(int index = 0; index < localeCount; index++) { UnicodeString countryFullName; @@ -456,6 +459,9 @@ LanguageListItem* si = new LanguageListItem(str, currentLocale[index].getName()); listView->AddItem(si); + if (strcmp(currentLocale[index].getName(), + defaultCountry->Code()) == 0) + listView->Select(listView->CountItems() - 1); } fTimeFormatSettings = @@ -465,6 +471,8 @@ .Add(scrollView) .Add(fTimeFormatSettings) ); + + listView->ScrollToSelection(); } // check if the window is on screen Modified: haiku/branches/components/gsoc-locale-kit/src/preferences/locale/LocaleWindow.h =================================================================== --- haiku/branches/components/gsoc-locale-kit/src/preferences/locale/LocaleWindow.h 2009-08-05 21:31:17 UTC (rev 32148) +++ haiku/branches/components/gsoc-locale-kit/src/preferences/locale/LocaleWindow.h 2009-08-05 21:33:31 UTC (rev 32149) @@ -8,10 +8,9 @@ #include -#include "TimeFormatSettingsView.h" - class BButton; class BListView; +class TimeFormatSettingsView; class LocaleWindow : public BWindow { From mattmadia at gmail.com Wed Aug 5 23:42:24 2009 From: mattmadia at gmail.com (Matt Madia) Date: Wed, 5 Aug 2009 21:42:24 +0000 Subject: [Haiku-commits] BOM: r32142 - ...failed C++ /objects/haiku/--arch--/release/system/kernel/signal.o ... In-Reply-To: <18072517850-BeMail@zon> References: <1e42d8c50908051412v3a0f63b5odb28f3e75e55f1d9@mail.gmail.com> <18072517850-BeMail@zon> Message-ID: <1e42d8c50908051442rc072486j6f8dbeca70f5df9a@mail.gmail.com> On Wed, Aug 5, 2009 at 21:32, Axel D?rfler wrote: > Nice one! Thanks for doing this! > I would guess it would be nice to have those scripts in the repository > as well? I'm impartial either way. for now, it's hosted at : http://dev.osdrawer.net/projects/show/haikubuildomatic the current code is still on branches/class-rewrite I need to tag trunk and merge/move class-rewrite to trunk. TODO: * File uploading * misc "TODO" * cleanups --mmadia From superstippi at gmx.de Wed Aug 5 23:50:24 2009 From: superstippi at gmx.de (Stephan Assmus) Date: Wed, 05 Aug 2009 23:50:24 +0200 Subject: [Haiku-commits] BOM: r32142 - ...failed C++ /objects/haiku/--arch--/release/system/kernel/signal.o ... In-Reply-To: <1e42d8c50908051412v3a0f63b5odb28f3e75e55f1d9@mail.gmail.com> References: <4a79f51e.48c3f10a.7b77.ffff8c51@mx.google.com> <1e42d8c50908051412v3a0f63b5odb28f3e75e55f1d9@mail.gmail.com> Message-ID: <20090805235024.1108.3@bepc.1249507570.fake> On 2009-08-05 at 23:12:07 [+0200], Matt Madia wrote: > On Wed, Aug 5, 2009 at 21:09, wrote: > > Host Machine : FreeBSD 7.2-RELEASE i386 > > Host Machine 32|64bit : 32bit > > use-xattr : True > > use-32bit : False > > Architectures Tested : > > ppc > > This was a forced error to demonstrate functionality. > > >From this point forward, all emails with a similar subject are to be > actual errors. Looks awesome! Thanks a lot for all the hard work, Matt! And yeah... what Ryan said! :-D Best regards, -Stephan From phoudoin at mail.berlios.de Wed Aug 5 23:55:33 2009 From: phoudoin at mail.berlios.de (phoudoin at mail.berlios.de) Date: Wed, 5 Aug 2009 23:55:33 +0200 Subject: [Haiku-commits] r32150 - haiku/trunk/src/apps/mediaplayer/media_node_framework/audio Message-ID: <200908052155.n75LtXP0005399@sheep.berlios.de> Author: phoudoin Date: 2009-08-05 23:55:22 +0200 (Wed, 05 Aug 2009) New Revision: 32150 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32150&view=rev Modified: haiku/trunk/src/apps/mediaplayer/media_node_framework/audio/AudioProducer.cpp Log: Fixed hardcoded AudioProducer output name. Stephan, Axel, could one of you report this change in clockwerk/src/shared/AudioProducer.cpp too. Clockwerk name his audio output "MediaPlayer Sound Output", which is both confusing and, well, semantically wrong ;-). BTW, for MediaPlayer being able to (re)name his output after the filename playing will be great, no? Modified: haiku/trunk/src/apps/mediaplayer/media_node_framework/audio/AudioProducer.cpp =================================================================== --- haiku/trunk/src/apps/mediaplayer/media_node_framework/audio/AudioProducer.cpp 2009-08-05 21:33:31 UTC (rev 32149) +++ haiku/trunk/src/apps/mediaplayer/media_node_framework/audio/AudioProducer.cpp 2009-08-05 21:55:22 UTC (rev 32150) @@ -595,7 +595,7 @@ fOutput.source.port = ControlPort(); fOutput.source.id = 0; fOutput.node = Node(); - ::strcpy(fOutput.name, "MediaPlayer Sound Output"); + ::strcpy(fOutput.name, Name()); } From revol at free.fr Wed Aug 5 23:59:32 2009 From: revol at free.fr (=?utf-8?q?Fran=C3=A7ois?= Revol) Date: Wed, 05 Aug 2009 23:59:32 +0200 CEST Subject: [Haiku-commits] =?utf-8?q?r32138_-_haiku/trunk/headers/private/sy?= =?utf-8?q?stem/board?= In-Reply-To: <5647316905-BeMail@zon> Message-ID: <490852703-BeMail@laptop> > "Fran?ois Revol" wrote: > > > mmu_man at mail.berlios.de wrote: > > > > Added: > > > > haiku/trunk/headers/private/system/board/overo/ > > > > haiku/trunk/headers/private/system/board/verdex/ > > > > Log: > > > > Placeholder for current GSoC targets (verdex is QEMU, overo is > > > > the > > > > real one). > > > What is supposed to go in there, and why isn't it in arch/? > > board_config.h & other stuff telling the cpu is an omap3, ... > > > > Right, it could be a subfolder of arch/$arch/ ... > > I don't know of a board with the same config and a different arch, > > yet. > > Ok let's move that here. > > Also, does that really have to be "board" dependent - shouldn't it > rather be CPU dependent? > Like a sub-arch folder? It's the usual terminology, besides, usually a single cpu has its on chip peripherals mapped differently for each board... > And finally, why system/ and not kernel/ - the former are kernel > headers interesting for userland. Well it was both for the kernel and loader. Userland shouldn't be impacted but maybe some configurations are interesting there as well (optimization, ..). It can still be moved around, I just didn't want to scatter all the board stuff around too much. Fran?ois. From revol at free.fr Thu Aug 6 00:02:07 2009 From: revol at free.fr (=?utf-8?q?Fran=C3=A7ois?= Revol) Date: Thu, 06 Aug 2009 00:02:07 +0200 CEST Subject: [Haiku-commits] =?utf-8?q?BOM=3A_r32142_-_=2E=2E=2Efailed_C++_/ob?= =?utf-8?q?jects/haiku/--arch--/release/system/kernel/signal=2Eo_=2E=2E=2E?= In-Reply-To: Message-ID: <645981826-BeMail@laptop> > On Wed, Aug 5, 2009 at 5:12 PM, Matt Madia > wrote: > > > > This was a forced error to demonstrate functionality. > > > > From this point forward, all emails with a similar subject are to > > be > > actual errors. Cool now we need a "I broke the build" cap to give away. > > Looks cool! Now we just need an automatic tally of owed beers, > coffees, ice cream sundaes or your refreshment of choice for > introduced build errors ;) > We can probably add support for HTCPCP :p Fran?ois. From phoudoin at mail.berlios.de Thu Aug 6 02:17:41 2009 From: phoudoin at mail.berlios.de (phoudoin at mail.berlios.de) Date: Thu, 6 Aug 2009 02:17:41 +0200 Subject: [Haiku-commits] r32151 - haiku/trunk/src/kits/opengl Message-ID: <200908060017.n760HfIG032153@sheep.berlios.de> Author: phoudoin Date: 2009-08-06 02:17:30 +0200 (Thu, 06 Aug 2009) New Revision: 32151 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32151&view=rev Modified: haiku/trunk/src/kits/opengl/GLView.cpp Log: Fixed a crash when resizing GLInfo window (or any non-BDirectWindow with GLView kid(s), for that matter). Modified: haiku/trunk/src/kits/opengl/GLView.cpp =================================================================== --- haiku/trunk/src/kits/opengl/GLView.cpp 2009-08-05 21:55:22 UTC (rev 32150) +++ haiku/trunk/src/kits/opengl/GLView.cpp 2009-08-06 00:17:30 UTC (rev 32151) @@ -402,6 +402,9 @@ void BGLView::_CallDirectConnected() { + if (!fClipInfo) + return; + glview_direct_info *glviewDirectInfo = (glview_direct_info *)fClipInfo; direct_buffer_info *localInfo = glviewDirectInfo->direct_info; direct_buffer_info *info = (direct_buffer_info *)calloc(1, DIRECT_BUFFER_INFO_AREA_SIZE); From axeld at pinc-software.de Thu Aug 6 09:26:09 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Thu, 06 Aug 2009 09:26:09 +0200 CEST Subject: [Haiku-commits] r32138 - haiku/trunk/headers/private/system/board In-Reply-To: <490852703-BeMail@laptop> Message-ID: <1057768187-BeMail@zon> "Fran?ois Revol" wrote: > > Also, does that really have to be "board" dependent - shouldn't it > > rather be CPU dependent? > > Like a sub-arch folder? > It's the usual terminology, besides, usually a single cpu has its on > chip peripherals mapped differently for each board... Well, maybe I should wait and see what happens with this before complaining :-) > > And finally, why system/ and not kernel/ - the former are kernel > > headers interesting for userland. > Well it was both for the kernel and loader. Userland shouldn't be > impacted but maybe some configurations are interesting there as well > (optimization, ..). Then it shouldn't be in system/ but kernel/, or rather kerne/boot/ - the kernel should be affected by this as little as possible. > It can still be moved around, I just didn't want to scatter all the > board stuff around too much. Okay. Bye, Axel. From axeld at mail.berlios.de Thu Aug 6 10:24:25 2009 From: axeld at mail.berlios.de (axeld at mail.berlios.de) Date: Thu, 6 Aug 2009 10:24:25 +0200 Subject: [Haiku-commits] r32152 - haiku/trunk/src/system/kernel/device_manager Message-ID: <200908060824.n768OPQd007876@sheep.berlios.de> Author: axeld Date: 2009-08-06 10:24:23 +0200 (Thu, 06 Aug 2009) New Revision: 32152 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32152&view=rev Modified: haiku/trunk/src/system/kernel/device_manager/legacy_drivers.cpp Log: * handle_driver_events() kept the sDriversListLock locked over the whole time. But since this is also locked from within the driver/directory watcher (with the node monitor lock held), and handle_driver_events() could cause node monitoring updates, the locking order could be reverted, causing a deadlock (I just ran into). Modified: haiku/trunk/src/system/kernel/device_manager/legacy_drivers.cpp =================================================================== --- haiku/trunk/src/system/kernel/device_manager/legacy_drivers.cpp 2009-08-06 00:17:30 UTC (rev 32151) +++ haiku/trunk/src/system/kernel/device_manager/legacy_drivers.cpp 2009-08-06 08:24:23 UTC (rev 32152) @@ -196,6 +196,7 @@ static EntryList sDriversToAdd; static EntryList sDriversToRemove; static mutex sDriversListLock = MUTEX_INITIALIZER("driversList"); + // inner lock, protects the sDriversToAdd/sDriversToRemove lists only static DirectoryWatcher sDirectoryWatcher; static DirectoryNodeHash sDirectoryNodeHash; static recursive_lock sLock; @@ -641,14 +642,19 @@ // something happened, let's see what it was - RecursiveLocker locker(sLock); - MutexLocker _(sDriversListLock); + RecursiveLocker _(sLock); + // Add new drivers + while (true) { + MutexLocker listLocker(sDriversListLock); + path_entry* path = sDriversToAdd.RemoveHead(); if (path == NULL) break; + listLocker.Unlock(); + legacy_driver* driver = (legacy_driver*)hash_lookup(sDriverHash, get_leaf(path->path)); if (driver == NULL) @@ -657,11 +663,18 @@ driver->binary_updated = true; delete path; } + + // Mark removed drivers as updated + while (true) { + MutexLocker listLocker(sDriversListLock); + path_entry* path = sDriversToRemove.RemoveHead(); if (path == NULL) break; + listLocker.Unlock(); + legacy_driver* driver = (legacy_driver*)hash_lookup(sDriverHash, get_leaf(path->path)); if (driver != NULL && get_priority(path->path) >= driver->priority) @@ -669,6 +682,8 @@ delete path; } + // Reload updated drivers + hash_iterator iterator; hash_open(sDriverHash, &iterator); legacy_driver *driver; From axeld at mail.berlios.de Thu Aug 6 10:55:05 2009 From: axeld at mail.berlios.de (axeld at mail.berlios.de) Date: Thu, 6 Aug 2009 10:55:05 +0200 Subject: [Haiku-commits] r32153 - haiku/trunk/src/servers/media Message-ID: <200908060855.n768t5Pl020786@sheep.berlios.de> Author: axeld Date: 2009-08-06 10:55:02 +0200 (Thu, 06 Aug 2009) New Revision: 32153 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32153&view=rev Modified: haiku/trunk/src/servers/media/BufferManager.cpp haiku/trunk/src/servers/media/BufferManager.h haiku/trunk/src/servers/media/media_server.cpp Log: * Cleanup, BufferManager now aggregates the buffer map as well as its locker instead of allocating them separately, no functional change. Modified: haiku/trunk/src/servers/media/BufferManager.cpp =================================================================== --- haiku/trunk/src/servers/media/BufferManager.cpp 2009-08-06 08:24:23 UTC (rev 32152) +++ haiku/trunk/src/servers/media/BufferManager.cpp 2009-08-06 08:55:02 UTC (rev 32153) @@ -2,167 +2,185 @@ * Copyright 2002, Marcus Overhagen. All rights reserved. * Distributed under the terms of the MIT License. */ -#include + + +#include "BufferManager.h" + #include -#include "BufferManager.h" + +#include "debug.h" #include "SharedBufferList.h" -#include "debug.h" + BufferManager::BufferManager() - : fSharedBufferList(_shared_buffer_list::Clone()), - fNextBufferId(1), - fLocker(new BLocker("buffer manager locker")), - fBufferInfoMap(new Map) + : + fSharedBufferList(_shared_buffer_list::Clone()), + fNextBufferID(1), + fLocker("buffer manager locker") { - fSharedBufferListId = area_for(fSharedBufferList); - ASSERT(fSharedBufferList!=NULL); - ASSERT(fSharedBufferListId > 0); + fSharedBufferListID = area_for(fSharedBufferList); } + BufferManager::~BufferManager() { fSharedBufferList->Unmap(); - delete fLocker; - delete fBufferInfoMap; } + area_id BufferManager::SharedBufferListID() { - return fSharedBufferListId; + return fSharedBufferListID; } status_t -BufferManager::RegisterBuffer(team_id teamid, media_buffer_id bufferid, - size_t *size, int32 *flags, size_t *offset, area_id *area) +BufferManager::RegisterBuffer(team_id team, media_buffer_id bufferID, + size_t* _size, int32* _flags, size_t* _offset, area_id* _area) { BAutolock lock(fLocker); - TRACE("RegisterBuffer team = %ld, bufferid = %ld\n", teamid, bufferid); - - buffer_info *info; - if (!fBufferInfoMap->Get(bufferid, &info)) { - ERROR("failed to register buffer! team = %ld, bufferid = %ld\n", teamid, bufferid); + TRACE("RegisterBuffer team = %ld, bufferid = %ld\n", team, bufferID); + + buffer_info* info; + if (!fBufferInfoMap.Get(bufferID, &info)) { + ERROR("failed to register buffer! team = %ld, bufferid = %ld\n", team, + bufferID); return B_ERROR; } - - info->teams.Insert(teamid); - - *area = info->area; - *offset = info->offset; - *size = info->size, - *flags = info->flags; + + info->teams.Insert(team); + + *_area = info->area; + *_offset = info->offset; + *_size = info->size, + *_flags = info->flags; + return B_OK; } + status_t -BufferManager::RegisterBuffer(team_id teamid, size_t size, int32 flags, size_t offset, area_id area, - media_buffer_id *bufferid) +BufferManager::RegisterBuffer(team_id team, size_t size, int32 flags, + size_t offset, area_id area, media_buffer_id* _bufferID) { BAutolock lock(fLocker); - TRACE("RegisterBuffer team = %ld, areaid = %ld, offset = %ld, size = %ld\n", teamid, area, offset, size); + TRACE("RegisterBuffer team = %ld, area = %ld, offset = %ld, size = %ld\n", + team, area, offset, size); - void *adr; - area_id newarea; - - newarea = clone_area("media_server cloned buffer", &adr, B_ANY_ADDRESS, B_READ_AREA | B_WRITE_AREA, area); - if (newarea <= B_OK) { - ERROR("RegisterBuffer: failed to clone buffer! error = %#lx, team = %ld, areaid = %ld, offset = %ld, size = %ld\n", newarea, teamid, area, offset, size); + void* address; + area_id clonedArea = clone_area("media_server cloned buffer", &address, + B_ANY_ADDRESS, B_READ_AREA | B_WRITE_AREA, area); + if (clonedArea < 0) { + ERROR("RegisterBuffer: failed to clone buffer! error = %#lx, team = " + "%ld, areaid = %ld, offset = %ld, size = %ld\n", clonedArea, team, + area, offset, size); return B_ERROR; } buffer_info info; - - *bufferid = fNextBufferId; - info.id = fNextBufferId; - info.area = newarea; + info.id = fNextBufferID++; + info.area = clonedArea; info.offset = offset; - info.size = size; - info.flags = flags; - info.teams.Insert(teamid); - fBufferInfoMap->Insert(fNextBufferId, info); + info.size = size; + info.flags = flags; + info.teams.Insert(team); - TRACE("RegisterBuffer: done, bufferid = %ld\n", fNextBufferId); + *_bufferID = info.id; - fNextBufferId += 1; - + fBufferInfoMap.Insert(info.id, info); + + TRACE("RegisterBuffer: done, bufferID = %ld\n", info.id); + return B_OK; } + status_t -BufferManager::UnregisterBuffer(team_id teamid, media_buffer_id bufferid) +BufferManager::UnregisterBuffer(team_id team, media_buffer_id bufferID) { BAutolock lock(fLocker); - TRACE("UnregisterBuffer: team = %ld, bufferid = %ld\n", teamid, bufferid); + TRACE("UnregisterBuffer: team = %ld, bufferid = %ld\n", team, bufferID); - buffer_info *info; - int index; - - if (!fBufferInfoMap->Get(bufferid, &info)) { - ERROR("UnregisterBuffer: failed to unregister buffer! team = %ld, bufferid = %ld\n", teamid, bufferid); + buffer_info* info; + if (!fBufferInfoMap.Get(bufferID, &info)) { + ERROR("UnregisterBuffer: failed to unregister buffer! team = %ld, " + "bufferid = %ld\n", team, bufferID); return B_ERROR; } - index = info->teams.Find(teamid); + int index = info->teams.Find(team); if (index < 0) { - ERROR("UnregisterBuffer: failed to find team = %ld belonging to bufferid = %ld\n", teamid, bufferid); + ERROR("UnregisterBuffer: failed to find team = %ld belonging to " + "bufferID = %ld\n", team, bufferID); return B_ERROR; } if (!info->teams.Remove(index)) { - ERROR("UnregisterBuffer: failed to remove team = %ld from bufferid = %ld\n", teamid, bufferid); + ERROR("UnregisterBuffer: failed to remove team = %ld from bufferID " + "= %ld\n", team, bufferID); return B_ERROR; } - TRACE("UnregisterBuffer: team = %ld removed from bufferid = %ld\n", teamid, bufferid); + TRACE("UnregisterBuffer: team = %ld removed from bufferID = %ld\n", team, + bufferID); + if (info->teams.IsEmpty()) { - - if (!fBufferInfoMap->Remove(bufferid)) { - ERROR("UnregisterBuffer: failed to remove bufferid = %ld\n", bufferid); + if (!fBufferInfoMap.Remove(bufferID)) { + ERROR("UnregisterBuffer: failed to remove bufferID = %ld\n", + bufferID); return B_ERROR; } - - TRACE("UnregisterBuffer: bufferid = %ld removed\n", bufferid); + + TRACE("UnregisterBuffer: bufferID = %ld removed\n", bufferID); } return B_OK; } + void BufferManager::CleanupTeam(team_id team) { BAutolock lock(fLocker); - buffer_info *info; - + TRACE("BufferManager::CleanupTeam: team %ld\n", team); - - for (fBufferInfoMap->Rewind(); fBufferInfoMap->GetNext(&info); ) { - team_id *otherteam; - for (info->teams.Rewind(); info->teams.GetNext(&otherteam); ) { - if (team == *otherteam) { - PRINT(1, "BufferManager::CleanupTeam: removing team %ld from buffer id %ld\n", team, info->id); + + buffer_info* info; + for (fBufferInfoMap.Rewind(); fBufferInfoMap.GetNext(&info); ) { + team_id* currentTeam; + for (info->teams.Rewind(); info->teams.GetNext(¤tTeam); ) { + if (team == *currentTeam) { + PRINT(1, "BufferManager::CleanupTeam: removing team %ld from " + "buffer id %ld\n", team, info->id); info->teams.RemoveCurrent(); } } if (info->teams.IsEmpty()) { - PRINT(1, "BufferManager::CleanupTeam: removing buffer id %ld that has no teams\n", info->id); - fBufferInfoMap->RemoveCurrent(); + PRINT(1, "BufferManager::CleanupTeam: removing buffer id %ld that " + "has no teams\n", info->id); + fBufferInfoMap.RemoveCurrent(); } } } + void BufferManager::Dump() { BAutolock lock(fLocker); - buffer_info *info; + printf("\n"); printf("BufferManager: list of buffers follows:\n"); - for (fBufferInfoMap->Rewind(); fBufferInfoMap->GetNext(&info); ) { - printf(" buffer-id %ld, area-id %ld, offset %ld, size %ld, flags %#08lx\n", - info->id, info->area, info->offset, info->size, info->flags); + + buffer_info *info; + for (fBufferInfoMap.Rewind(); fBufferInfoMap.GetNext(&info); ) { + printf(" buffer-id %ld, area-id %ld, offset %ld, size %ld, flags " + "%#08lx\n", info->id, info->area, info->offset, info->size, + info->flags); printf(" assigned teams: "); - team_id *team; + + team_id* team; for (info->teams.Rewind(); info->teams.GetNext(&team); ) { printf("%ld, ", *team); } Modified: haiku/trunk/src/servers/media/BufferManager.h =================================================================== --- haiku/trunk/src/servers/media/BufferManager.h 2009-08-06 08:24:23 UTC (rev 32152) +++ haiku/trunk/src/servers/media/BufferManager.h 2009-08-06 08:55:02 UTC (rev 32153) @@ -2,46 +2,54 @@ * Copyright 2002, Marcus Overhagen. All rights reserved. * Distributed under the terms of the MIT License. */ -struct _shared_buffer_list; + +#include +#include + #include #include -class BufferManager -{ + +struct _shared_buffer_list; + + +class BufferManager { public: - BufferManager(); - ~BufferManager(); + BufferManager(); + ~BufferManager(); - area_id SharedBufferListID(); + area_id SharedBufferListID(); - status_t RegisterBuffer(team_id teamid, media_buffer_id bufferid, - size_t *size, int32 *flags, size_t *offset, area_id *area); + status_t RegisterBuffer(team_id team, + media_buffer_id bufferID, size_t* _size, + int32* _flags, size_t* _offset, area_id* _area); - status_t RegisterBuffer(team_id teamid, size_t size, int32 flags, size_t offset, area_id area, - media_buffer_id *bufferid); + status_t RegisterBuffer(team_id team, size_t size, + int32 flags, size_t offset, area_id area, + media_buffer_id* _bufferID); - status_t UnregisterBuffer(team_id teamid, media_buffer_id bufferid); - - void CleanupTeam(team_id teamid); + status_t UnregisterBuffer(team_id team, + media_buffer_id bufferID); - void Dump(); + void CleanupTeam(team_id team); + void Dump(); + private: - struct buffer_info - { - media_buffer_id id; - area_id area; - size_t offset; - size_t size; - int32 flags; - List teams; + struct buffer_info { + media_buffer_id id; + area_id area; + size_t offset; + size_t size; + int32 flags; + List teams; }; - - _shared_buffer_list * fSharedBufferList; - area_id fSharedBufferListId; - media_buffer_id fNextBufferId; - BLocker * fLocker; - Map *fBufferInfoMap; + + _shared_buffer_list* fSharedBufferList; + area_id fSharedBufferListID; + media_buffer_id fNextBufferID; + BLocker fLocker; + Map fBufferInfoMap; }; Modified: haiku/trunk/src/servers/media/media_server.cpp =================================================================== --- haiku/trunk/src/servers/media/media_server.cpp 2009-08-06 08:24:23 UTC (rev 32152) +++ haiku/trunk/src/servers/media/media_server.cpp 2009-08-06 08:55:02 UTC (rev 32153) @@ -708,7 +708,7 @@ request->info.offset, request->info.area, &reply.info.buffer); } else { - reply.info = request->info; //buffer id is kept + reply.info = request->info; // buffer id is kept status = gBufferManager->RegisterBuffer(request->team, request->info.buffer, &reply.info.size, &reply.info.flags, &reply.info.offset, &reply.info.area); @@ -720,7 +720,7 @@ case SERVER_UNREGISTER_BUFFER: { const server_unregister_buffer_command *cmd = reinterpret_cast< - const server_unregister_buffer_command *>(data); + const server_unregister_buffer_command *>(data); gBufferManager->UnregisterBuffer(cmd->team, cmd->bufferid); break; @@ -736,7 +736,7 @@ rv = gMMediaFilesManager->RewindTypes( &types, &reply.count); - if(reply.count>0) { + if (reply.count > 0) { // we create an area here, and pass it to the library, // where it will be deleted. char *start_addr; @@ -780,7 +780,7 @@ &items, &reply.count); // we create an area here, and pass it to the library, // where it will be deleted. - if(reply.count>0) { + if (reply.count > 0) { char *start_addr; size_t size = ((reply.count * B_MEDIA_NAME_LENGTH) + B_PAGE_SIZE - 1) & ~(B_PAGE_SIZE - 1); From axeld at mail.berlios.de Thu Aug 6 11:42:35 2009 From: axeld at mail.berlios.de (axeld at mail.berlios.de) Date: Thu, 6 Aug 2009 11:42:35 +0200 Subject: [Haiku-commits] r32154 - haiku/trunk/headers/private/shared Message-ID: <200908060942.n769gZH8006994@sheep.berlios.de> Author: axeld Date: 2009-08-06 11:42:34 +0200 (Thu, 06 Aug 2009) New Revision: 32154 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32154&view=rev Modified: haiku/trunk/headers/private/shared/HashMap.h Log: * Added copyless direct value accessors (via Iterator::NextValue(), and Get()). Modified: haiku/trunk/headers/private/shared/HashMap.h =================================================================== --- haiku/trunk/headers/private/shared/HashMap.h 2009-08-06 08:55:02 UTC (rev 32153) +++ haiku/trunk/headers/private/shared/HashMap.h 2009-08-06 09:42:34 UTC (rev 32154) @@ -28,12 +28,13 @@ #ifndef HASH_MAP_H #define HASH_MAP_H -//#include + #include #include "AutoLocker.h" #include "OpenHashTable.h" + namespace BPrivate { // HashMapElement @@ -107,7 +108,17 @@ _FindNext(); return result; } - + + Value* NextValue() + { + if (fElement == NULL) + return NULL; + + Value* value = &fElement->fValue; + _FindNext(); + return value; + } + Entry Remove() { if (!fLastElement) @@ -169,6 +180,7 @@ Value Remove(const Key& key); void Clear(); Value Get(const Key& key) const; + bool Get(const Key& key, Value*& _value) const; bool ContainsKey(const Key& key) const; @@ -404,6 +416,19 @@ return Value(); } +// Get +template +bool +HashMap::Get(const Key& key, Value*& _value) const +{ + if (Element* element = _FindElement(key)) { + _value = &element->fValue; + return true; + } + + return false; +} + // ContainsKey template bool From axeld at mail.berlios.de Thu Aug 6 11:45:05 2009 From: axeld at mail.berlios.de (axeld at mail.berlios.de) Date: Thu, 6 Aug 2009 11:45:05 +0200 Subject: [Haiku-commits] r32155 - haiku/trunk/src/servers/media Message-ID: <200908060945.n769j5EM008076@sheep.berlios.de> Author: axeld Date: 2009-08-06 11:45:04 +0200 (Thu, 06 Aug 2009) New Revision: 32155 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32155&view=rev Modified: haiku/trunk/src/servers/media/BufferManager.cpp haiku/trunk/src/servers/media/BufferManager.h Log: * When a buffer_info is removed, its area is now actually deleted as well. This already fixes bug #4189, although there is another bug that could cause a similar effect (working on that next). * Switched from media_server local TMap to HashMap, although this is probably equally archaic. * Also replaced TList with std::set for the team list. Modified: haiku/trunk/src/servers/media/BufferManager.cpp =================================================================== --- haiku/trunk/src/servers/media/BufferManager.cpp 2009-08-06 09:42:34 UTC (rev 32154) +++ haiku/trunk/src/servers/media/BufferManager.cpp 2009-08-06 09:45:04 UTC (rev 32155) @@ -1,5 +1,6 @@ /* * Copyright 2002, Marcus Overhagen. All rights reserved. + * Copyright 2009, Axel D?rfler, axeld at pinc-software.de. * Distributed under the terms of the MIT License. */ @@ -34,6 +35,7 @@ return fSharedBufferListID; } + status_t BufferManager::RegisterBuffer(team_id team, media_buffer_id bufferID, size_t* _size, int32* _flags, size_t* _offset, area_id* _area) @@ -43,13 +45,13 @@ TRACE("RegisterBuffer team = %ld, bufferid = %ld\n", team, bufferID); buffer_info* info; - if (!fBufferInfoMap.Get(bufferID, &info)) { + if (!fBufferInfoMap.Get(bufferID, info)) { ERROR("failed to register buffer! team = %ld, bufferid = %ld\n", team, bufferID); return B_ERROR; } - info->teams.Insert(team); + info->teams.insert(team); *_area = info->area; *_offset = info->offset; @@ -68,14 +70,12 @@ TRACE("RegisterBuffer team = %ld, area = %ld, offset = %ld, size = %ld\n", team, area, offset, size); - void* address; - area_id clonedArea = clone_area("media_server cloned buffer", &address, - B_ANY_ADDRESS, B_READ_AREA | B_WRITE_AREA, area); + area_id clonedArea = _CloneArea(area); if (clonedArea < 0) { ERROR("RegisterBuffer: failed to clone buffer! error = %#lx, team = " - "%ld, areaid = %ld, offset = %ld, size = %ld\n", clonedArea, team, + "%ld, area = %ld, offset = %ld, size = %ld\n", clonedArea, team, area, offset, size); - return B_ERROR; + return clonedArea; } buffer_info info; @@ -84,11 +84,11 @@ info.offset = offset; info.size = size; info.flags = flags; - info.teams.Insert(team); + info.teams.insert(team); *_bufferID = info.id; - fBufferInfoMap.Insert(info.id, info); + fBufferInfoMap.Put(info.id, info); TRACE("RegisterBuffer: done, bufferID = %ld\n", info.id); @@ -103,34 +103,26 @@ TRACE("UnregisterBuffer: team = %ld, bufferid = %ld\n", team, bufferID); buffer_info* info; - if (!fBufferInfoMap.Get(bufferID, &info)) { + if (!fBufferInfoMap.Get(bufferID, info)) { ERROR("UnregisterBuffer: failed to unregister buffer! team = %ld, " "bufferid = %ld\n", team, bufferID); return B_ERROR; } - int index = info->teams.Find(team); - if (index < 0) { + if (info->teams.find(team) == info->teams.end()) { ERROR("UnregisterBuffer: failed to find team = %ld belonging to " "bufferID = %ld\n", team, bufferID); return B_ERROR; } - if (!info->teams.Remove(index)) { - ERROR("UnregisterBuffer: failed to remove team = %ld from bufferID " - "= %ld\n", team, bufferID); - return B_ERROR; - } + info->teams.erase(team); TRACE("UnregisterBuffer: team = %ld removed from bufferID = %ld\n", team, bufferID); - if (info->teams.IsEmpty()) { - if (!fBufferInfoMap.Remove(bufferID)) { - ERROR("UnregisterBuffer: failed to remove bufferID = %ld\n", - bufferID); - return B_ERROR; - } + if (info->teams.empty()) { + _ReleaseClonedArea(info->area); + fBufferInfoMap.Remove(bufferID); TRACE("UnregisterBuffer: bufferID = %ld removed\n", bufferID); } @@ -146,20 +138,17 @@ TRACE("BufferManager::CleanupTeam: team %ld\n", team); - buffer_info* info; - for (fBufferInfoMap.Rewind(); fBufferInfoMap.GetNext(&info); ) { - team_id* currentTeam; - for (info->teams.Rewind(); info->teams.GetNext(¤tTeam); ) { - if (team == *currentTeam) { - PRINT(1, "BufferManager::CleanupTeam: removing team %ld from " - "buffer id %ld\n", team, info->id); - info->teams.RemoveCurrent(); - } - } - if (info->teams.IsEmpty()) { + BufferInfoMap::Iterator iterator = fBufferInfoMap.GetIterator(); + while (iterator.HasNext()) { + BufferInfoMap::Entry entry = iterator.Next(); + + entry.value.teams.erase(team); + + if (entry.value.teams.empty()) { PRINT(1, "BufferManager::CleanupTeam: removing buffer id %ld that " - "has no teams\n", info->id); - fBufferInfoMap.RemoveCurrent(); + "has no teams\n", entry.key); + _ReleaseClonedArea(entry.value.area); + iterator.Remove(); } } } @@ -173,18 +162,36 @@ printf("\n"); printf("BufferManager: list of buffers follows:\n"); - buffer_info *info; - for (fBufferInfoMap.Rewind(); fBufferInfoMap.GetNext(&info); ) { + BufferInfoMap::Iterator iterator = fBufferInfoMap.GetIterator(); + while (iterator.HasNext()) { + buffer_info& info = *iterator.NextValue(); printf(" buffer-id %ld, area-id %ld, offset %ld, size %ld, flags " - "%#08lx\n", info->id, info->area, info->offset, info->size, - info->flags); + "%#08lx\n", info.id, info.area, info.offset, info.size, info.flags); printf(" assigned teams: "); - team_id* team; - for (info->teams.Rewind(); info->teams.GetNext(&team); ) { - printf("%ld, ", *team); + std::set::iterator teamIterator = info.teams.begin(); + for (; teamIterator != info.teams.end(); teamIterator++) { + printf("%ld, ", *teamIterator); } printf("\n"); } printf("BufferManager: list end\n"); } + + +area_id +BufferManager::_CloneArea(area_id area) +{ + void* address; + area_id clonedArea = clone_area("media_server cloned buffer", &address, + B_ANY_ADDRESS, B_READ_AREA | B_WRITE_AREA, area); + + return clonedArea; +} + + +void +BufferManager::_ReleaseClonedArea(area_id clone) +{ + delete_area(clone); +} Modified: haiku/trunk/src/servers/media/BufferManager.h =================================================================== --- haiku/trunk/src/servers/media/BufferManager.h 2009-08-06 09:42:34 UTC (rev 32154) +++ haiku/trunk/src/servers/media/BufferManager.h 2009-08-06 09:45:04 UTC (rev 32155) @@ -1,14 +1,16 @@ /* * Copyright 2002, Marcus Overhagen. All rights reserved. + * Copyright 2009, Axel D?rfler, axeld at pinc-software.de. * Distributed under the terms of the MIT License. */ +#include + #include #include -#include -#include +#include struct _shared_buffer_list; @@ -37,19 +39,71 @@ void Dump(); private: + area_id _CloneArea(area_id area); + void _ReleaseClonedArea(area_id clone); + +private: + struct clone_info { + area_id source; + area_id clone; + vint32 ref_count; + }; + struct buffer_info { - media_buffer_id id; - area_id area; - size_t offset; - size_t size; - int32 flags; - List teams; + media_buffer_id id; + area_id area; + size_t offset; + size_t size; + int32 flags; + std::set teams; }; + + template struct id_hash { + id_hash() + : + fID(0) + { + } + id_hash(Type id) + : + fID(id) + { + } + + id_hash(const id_hash& other) + { + fID = other.fID; + } + + uint32 GetHashCode() const + { + return fID; + } + + operator Type() const + { + return fID; + } + + id_hash& operator=(const id_hash& other) + { + fID = other.fID; + return *this; + } + + private: + Type fID; + }; + + typedef HashMap, buffer_info> BufferInfoMap; + typedef HashMap, clone_info> CloneInfoMap; + _shared_buffer_list* fSharedBufferList; area_id fSharedBufferListID; media_buffer_id fNextBufferID; BLocker fLocker; - Map fBufferInfoMap; + BufferInfoMap fBufferInfoMap; + CloneInfoMap fCloneInfoMap; }; From axeld at mail.berlios.de Thu Aug 6 12:01:21 2009 From: axeld at mail.berlios.de (axeld at mail.berlios.de) Date: Thu, 6 Aug 2009 12:01:21 +0200 Subject: [Haiku-commits] r32156 - haiku/trunk/src/servers/media Message-ID: <200908061001.n76A1Lp0012707@sheep.berlios.de> Author: axeld Date: 2009-08-06 12:01:20 +0200 (Thu, 06 Aug 2009) New Revision: 32156 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32156&view=rev Modified: haiku/trunk/src/servers/media/BufferManager.cpp haiku/trunk/src/servers/media/BufferManager.h Log: * The media server now clones each buffer area only once - before, you could only add a very limited amount of buffers part of the frame buffer, for example, as that one is usually a very large area. * This could prevent all sorts of media buffers to be cloned on certain conditions (and could also cause a MediaPlayer fallback to bitmap mode for no apparent reason). Modified: haiku/trunk/src/servers/media/BufferManager.cpp =================================================================== --- haiku/trunk/src/servers/media/BufferManager.cpp 2009-08-06 09:45:04 UTC (rev 32155) +++ haiku/trunk/src/servers/media/BufferManager.cpp 2009-08-06 10:01:20 UTC (rev 32156) @@ -182,10 +182,32 @@ area_id BufferManager::_CloneArea(area_id area) { + clone_info* info; + if (fCloneInfoMap.Get(area, info)) { + // we have already cloned this particular area + TRACE("BufferManager::_CloneArea() area %ld has already been cloned " + "(id %ld)\n", area, info->clone); + + info->ref_count++; + return info->clone; + } + void* address; area_id clonedArea = clone_area("media_server cloned buffer", &address, B_ANY_ADDRESS, B_READ_AREA | B_WRITE_AREA, area); - + + TRACE("BufferManager::_CloneArea() cloned area %ld, clone id %ld\n", + area, clonedArea); + + if (clonedArea >= 0) { + clone_info info; + info.clone = clonedArea; + info.ref_count = 1; + + fCloneInfoMap.Put(area, info); + fSourceInfoMap.Put(clonedArea, area); + } + return clonedArea; } @@ -193,5 +215,24 @@ void BufferManager::_ReleaseClonedArea(area_id clone) { - delete_area(clone); + area_id source = fSourceInfoMap.Get(clone); + + clone_info* info; + if (!fCloneInfoMap.Get(source, info)) { + ERROR("BufferManager::_ReleaseClonedArea(): could not find clone info " + "for id %ld (clone %ld)\n", source, clone); + return; + } + + if (--info->ref_count == 0) { + TRACE("BufferManager::_ReleaseClonedArea(): delete cloned area %ld " + "(source %ld)\n", clone, source); + + fSourceInfoMap.Remove(clone); + fCloneInfoMap.Remove(source); + delete_area(clone); + } else { + TRACE("BufferManager::_ReleaseClonedArea(): released cloned area %ld " + "(source %ld)\n", clone, source); + } } Modified: haiku/trunk/src/servers/media/BufferManager.h =================================================================== --- haiku/trunk/src/servers/media/BufferManager.h 2009-08-06 09:45:04 UTC (rev 32155) +++ haiku/trunk/src/servers/media/BufferManager.h 2009-08-06 10:01:20 UTC (rev 32156) @@ -44,7 +44,6 @@ private: struct clone_info { - area_id source; area_id clone; vint32 ref_count; }; @@ -98,6 +97,7 @@ typedef HashMap, buffer_info> BufferInfoMap; typedef HashMap, clone_info> CloneInfoMap; + typedef HashMap, area_id> SourceInfoMap; _shared_buffer_list* fSharedBufferList; area_id fSharedBufferListID; @@ -105,5 +105,6 @@ BLocker fLocker; BufferInfoMap fBufferInfoMap; CloneInfoMap fCloneInfoMap; + SourceInfoMap fSourceInfoMap; }; From axeld at pinc-software.de Thu Aug 6 12:05:08 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Thu, 06 Aug 2009 12:05:08 +0200 CEST Subject: [Haiku-commits] =?utf-8?q?BOM=3A_r32142_-_=2E=2E=2Efailed_C++_/ob?= =?utf-8?q?jects/haiku/--arch--/release/system/kernel/signal=2Eo_=2E=2E=2E?= In-Reply-To: <1e42d8c50908051442rc072486j6f8dbeca70f5df9a@mail.gmail.com> Message-ID: <10596469819-BeMail@zon> Matt Madia wrote: > On Wed, Aug 5, 2009 at 21:32, Axel D?rfler > wrote: > > Nice one! Thanks for doing this! > > I would guess it would be nice to have those scripts in the > > repository > > as well? > I'm impartial either way. > > for now, it's hosted at : http://dev.osdrawer.net/projects/show/haikubuildomatic > That should be good enough, I guess. Bye, Axel. From alex at zappotek.com Thu Aug 6 12:29:38 2009 From: alex at zappotek.com (Alexandre Deckner) Date: Thu, 06 Aug 2009 12:29:38 +0200 Subject: [Haiku-commits] r32027 - in haiku/trunk/src/apps: . haiku3d haiku3d/data haiku3d/mesh haiku3d/texture In-Reply-To: <200907311538.n6VFcQA6010856@sheep.berlios.de> References: <200907311538.n6VFcQA6010856@sheep.berlios.de> Message-ID: <4A7AB092.5030206@zappotek.com> aldeck at mail.berlios.de a ?crit : > Author: aldeck > Date: 2009-07-31 17:38:12 +0200 (Fri, 31 Jul 2009) > New Revision: 32027 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32027&view=rev > > Added: > haiku/trunk/src/apps/haiku3d/ > [...] > Not in the image yet, waiting for the green light. Enjoy! > > > The voting/comment period has expired! You have until midnight before i add this evilware to the image :) Best regards, Alex From axeld at mail.berlios.de Thu Aug 6 13:02:22 2009 From: axeld at mail.berlios.de (axeld at mail.berlios.de) Date: Thu, 6 Aug 2009 13:02:22 +0200 Subject: [Haiku-commits] r32157 - haiku/trunk/src/add-ons/kernel/file_systems/bfs Message-ID: <200908061102.n76B2M5o028211@sheep.berlios.de> Author: axeld Date: 2009-08-06 13:02:08 +0200 (Thu, 06 Aug 2009) New Revision: 32157 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32157&view=rev Modified: haiku/trunk/src/add-ons/kernel/file_systems/bfs/Inode.cpp haiku/trunk/src/add-ons/kernel/file_systems/bfs/Inode.h haiku/trunk/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp Log: * Somehow I forgot to update the parent directory's time stamps on file creation, removal, and name changes... Modified: haiku/trunk/src/add-ons/kernel/file_systems/bfs/Inode.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/bfs/Inode.cpp 2009-08-06 10:01:20 UTC (rev 32156) +++ haiku/trunk/src/add-ons/kernel/file_systems/bfs/Inode.cpp 2009-08-06 11:02:08 UTC (rev 32157) @@ -1311,6 +1311,18 @@ } +status_t +Inode::ContainerContentsChanged(Transaction& transaction) +{ + ASSERT(!InLastModifiedIndex()); + + Node().last_modified_time = Node().status_change_time + = HOST_ENDIAN_TO_BFS_INT64(bfs_inode::ToInode(real_time_clock_usecs())); + + return WriteBack(transaction); +} + + // #pragma mark - data stream @@ -2397,6 +2409,8 @@ } #endif + ContainerContentsChanged(transaction); + // update the inode, so that no one will ever doubt it's deleted :-) inode->Node().flags |= HOST_ENDIAN_TO_BFS_INT32(INODE_DELETED); inode->Node().flags &= ~HOST_ENDIAN_TO_BFS_INT32(INODE_IN_USE); @@ -2447,7 +2461,7 @@ Volume* volume = transaction.GetVolume(); BPlusTree* tree = NULL; - if (parent && (mode & S_ATTR_DIR) == 0 && parent->IsContainer()) { + if (parent != NULL && (mode & S_ATTR_DIR) == 0 && parent->IsContainer()) { // check if the file already exists in the directory if (parent->GetTree(&tree) != B_OK) RETURN_ERROR(B_BAD_VALUE); @@ -2479,7 +2493,7 @@ Vnode vnode(volume, offset); Inode* inode; status_t status = vnode.Get(&inode); - if (status < B_OK) { + if (status != B_OK) { REPORT_ERROR(status); return B_ENTRY_NOT_FOUND; } @@ -2492,7 +2506,7 @@ if (inode->CheckPermissions(open_mode_to_access(openMode)) != B_OK) return B_NOT_ALLOWED; - if (openMode & O_TRUNC) { + if ((openMode & O_TRUNC) != 0) { // we need write access in order to truncate the file status = inode->CheckPermissions(W_OK); if (status != B_OK) @@ -2523,7 +2537,7 @@ return B_OK; } - } else if (parent && (mode & S_ATTR_DIR) == 0) + } else if (parent != NULL && (mode & S_ATTR_DIR) == 0) return B_BAD_VALUE; status_t status; @@ -2567,23 +2581,23 @@ // only add the name to regular files, directories, or symlinks // don't add it to attributes, or indices if (tree && inode->IsRegularNode() - && inode->SetName(transaction, name) < B_OK) + && inode->SetName(transaction, name) != B_OK) return B_ERROR; // Initialize b+tree if it's a directory (and add "." & ".." if it's // a standard directory for files - not for attributes or indices) if (inode->IsContainer()) { status = allocator.CreateTree(); - if (status < B_OK) + if (status != B_OK) return status; } // Add a link to the inode from the parent, depending on its type // (the vnode is not published yet, so it is safe to make the inode // accessable to the file system here) - if (tree) { + if (tree != NULL) { status = tree->Insert(transaction, name, inode->ID()); - } else if (parent && (mode & S_ATTR_DIR) != 0) { + } else if (parent != NULL && (mode & S_ATTR_DIR) != 0) { parent->Attributes() = run; status = parent->WriteBack(transaction); } @@ -2592,7 +2606,7 @@ // two cases above; the root node or the indices root node must // handle this case on their own (or other cases where "parent" is // NULL) - if (status < B_OK) + if (status != B_OK) RETURN_ERROR(status); // Update the main indices (name, size & last_modified) @@ -2603,7 +2617,7 @@ // the name index only contains regular files // (but not the root node where name == NULL) status = index.InsertName(transaction, name, inode); - if (status < B_OK && status != B_BAD_INDEX) { + if (status != B_OK && status != B_BAD_INDEX) { // We have to remove the node from the parent at this point, // because the InodeAllocator destructor can't handle this // case (and if it fails, we can't do anything about it...) @@ -2616,6 +2630,9 @@ } } + if (parent != NULL && parent->IsContainer()) + parent->ContainerContentsChanged(transaction); + inode->UpdateOldLastModified(); // The "size" & "last_modified" indices don't contain directories. @@ -2652,30 +2669,6 @@ } -/*! Checks whether or not this node should be part of the name index */ -bool -Inode::InNameIndex() const -{ - return IsRegularNode(); -} - - -/*! Checks whether or not this node should be part of the size index */ -bool -Inode::InSizeIndex() const -{ - return IsFile(); -} - - -/*! Checks whether or not this node should be part of the last modified index */ -bool -Inode::InLastModifiedIndex() const -{ - return IsFile() || IsSymLink(); -} - - // #pragma mark - AttributeIterator Modified: haiku/trunk/src/add-ons/kernel/file_systems/bfs/Inode.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/bfs/Inode.h 2009-08-06 10:01:20 UTC (rev 32156) +++ haiku/trunk/src/add-ons/kernel/file_systems/bfs/Inode.h 2009-08-06 11:02:08 UTC (rev 32157) @@ -121,6 +121,7 @@ // for directories only: status_t GetTree(BPlusTree** _tree); bool IsEmpty(); + status_t ContainerContentsChanged(Transaction& transaction); // manipulating the data stream status_t FindBlockRun(off_t pos, block_run& run, @@ -241,6 +242,31 @@ SinglyLinkedList fIterators; }; + +/*! Checks whether or not this node should be part of the name index */ +inline bool +Inode::InNameIndex() const +{ + return IsRegularNode(); +} + + +/*! Checks whether or not this node should be part of the size index */ +inline bool +Inode::InSizeIndex() const +{ + return IsFile(); +} + + +/*! Checks whether or not this node should be part of the last modified index */ +inline bool +Inode::InLastModifiedIndex() const +{ + return IsFile() || IsSymLink(); +} + + #if _KERNEL_MODE && KDEBUG # define ASSERT_READ_LOCKED_INODE(inode) inode->AssertReadLocked() # define ASSERT_WRITE_LOCKED_INODE(inode) inode->AssertWriteLocked() @@ -249,6 +275,7 @@ # define ASSERT_WRITE_LOCKED_INODE(inode) #endif + class InodeReadLocker { public: InodeReadLocker(Inode* inode) Modified: haiku/trunk/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp 2009-08-06 10:01:20 UTC (rev 32156) +++ haiku/trunk/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp 2009-08-06 11:02:08 UTC (rev 32157) @@ -1149,7 +1149,7 @@ status = newTree->Insert(transaction, (const uint8*)newName, strlen(newName), id); } - if (status < B_OK) + if (status != B_OK) return status; inode->WriteLockInTransaction(transaction); @@ -1186,6 +1186,12 @@ } } + if (newDirectory != oldDirectory) { + oldDirectory->ContainerContentsChanged(transaction); + newDirectory->ContainerContentsChanged(transaction); + } else + newDirectory->ContainerContentsChanged(transaction); + if (status == B_OK) status = inode->WriteBack(transaction); From superstippi at gmx.de Thu Aug 6 13:07:30 2009 From: superstippi at gmx.de (Stephan Assmus) Date: Thu, 06 Aug 2009 13:07:30 +0200 Subject: [Haiku-commits] r32027 - in haiku/trunk/src/apps: . haiku3d haiku3d/data haiku3d/mesh haiku3d/texture In-Reply-To: <4A7AB092.5030206@zappotek.com> References: <200907311538.n6VFcQA6010856@sheep.berlios.de> <4A7AB092.5030206@zappotek.com> Message-ID: <20090806130730.1798.6@bepc.1249551590.fake> On 2009-08-06 at 12:29:38 [+0200], Alexandre Deckner wrote: > aldeck at mail.berlios.de a ?crit : > > Author: aldeck > > Date: 2009-07-31 17:38:12 +0200 (Fri, 31 Jul 2009) New Revision: 32027 > > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32027&view=rev > > > > Added: > > haiku/trunk/src/apps/haiku3d/ > > > [...] > > Not in the image yet, waiting for the green light. Enjoy! > > The voting/comment period has expired! You have until midnight before i > add this evilware to the image :) Ah, I forgot I meant to reply. I looked at it and I think it's nice! Definitely more interesting than the GLCube, which is really more a programmer's demo, than a demo for Haiku as a system. Best regards, -Stephan From superstippi at gmx.de Thu Aug 6 13:13:22 2009 From: superstippi at gmx.de (Stephan Assmus) Date: Thu, 06 Aug 2009 13:13:22 +0200 Subject: [Haiku-commits] r32156 - haiku/trunk/src/servers/media In-Reply-To: <200908061001.n76A1Lp0012707@sheep.berlios.de> References: <200908061001.n76A1Lp0012707@sheep.berlios.de> Message-ID: <20090806131322.1864.7@bepc.1249551590.fake> On 2009-08-06 at 12:01:21 [+0200], axeld at mail.berlios.de wrote: > Author: axeld > Date: 2009-08-06 12:01:20 +0200 (Thu, 06 Aug 2009) New Revision: 32156 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32156&view=rev > > Modified: > haiku/trunk/src/servers/media/BufferManager.cpp > haiku/trunk/src/servers/media/BufferManager.h > Log: > * The media server now clones each buffer area only once - before, you > could > only add a very limited amount of buffers part of the frame buffer, for > example, as that one is usually a very large area. > * This could prevent all sorts of media buffers to be cloned on certain > conditions (and could also cause a MediaPlayer fallback to bitmap mode > for no apparent reason). From mattmadia at gmail.com Thu Aug 6 13:14:38 2009 From: mattmadia at gmail.com (Matt Madia) Date: Thu, 6 Aug 2009 11:14:38 +0000 Subject: [Haiku-commits] BOM: r32142 - ...failed C++ /objects/haiku/--arch--/release/system/kernel/signal.o ... In-Reply-To: <1e42d8c50908051412v3a0f63b5odb28f3e75e55f1d9@mail.gmail.com> References: <4a79f51e.48c3f10a.7b77.ffff8c51@mx.google.com> <1e42d8c50908051412v3a0f63b5odb28f3e75e55f1d9@mail.gmail.com> Message-ID: <1e42d8c50908060414p237bb8b7p91e5f7059c4a8abd@mail.gmail.com> On Wed, Aug 5, 2009 at 21:12, Matt Madia wrote: > This was a forced error to demonstrate functionality. Just in case anyone's curious, * each unique error is reported only once. * Build-O-Matic will sleep a minimum of 5minutes between build cycles * New build cycles are triggered by polling CIA.vc, so sleeping may be longer. * only commits to haiku/buildtools/trunk and haiku/haiku/trunk will trigger a build cycle. * If multiple commits have been made from the start of the last build cycle, only the newest will be built. To help identify the cause of the failing revision, "Targets Affected:" will be updated to display: :: It's possible, although unlikely, for each of those to have a different last-revision built successfully. Eg, someone commits a change that breaks ppc and then someone else breaks gcc4 before ppc is fixed. --mmadia From superstippi at gmx.de Thu Aug 6 13:16:56 2009 From: superstippi at gmx.de (Stephan Assmus) Date: Thu, 06 Aug 2009 13:16:56 +0200 Subject: [Haiku-commits] r32155 - haiku/trunk/src/servers/media In-Reply-To: <200908060945.n769j5EM008076@sheep.berlios.de> References: <200908060945.n769j5EM008076@sheep.berlios.de> Message-ID: <20090806131656.1892.8@bepc.1249551590.fake> On 2009-08-06 at 11:45:05 [+0200], axeld at mail.berlios.de wrote: > Author: axeld > Date: 2009-08-06 11:45:04 +0200 (Thu, 06 Aug 2009) New Revision: 32155 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32155&view=rev > > Modified: > haiku/trunk/src/servers/media/BufferManager.cpp > haiku/trunk/src/servers/media/BufferManager.h > Log: > * When a buffer_info is removed, its area is now actually deleted as > well. This > already fixes bug #4189, although there is another bug that could cause > a similar effect (working on that next). > * Switched from media_server local TMap to HashMap, although this is > probably > equally archaic. > * Also replaced TList with std::set for the team list. BTW, is it your plan to eventually get rid of TList and TMap? Just thought I'd mention that I've been growing fond of TList at least. The code that uses it ends up being quite compact. Maybe we can keep that as a light-weight supplement to BObjectList, with O(1) Insert()? Some of it's internals could certainly be made more robust, though, IIRC. Best regards, -Stephan From axeld at mail.berlios.de Thu Aug 6 13:18:33 2009 From: axeld at mail.berlios.de (axeld at mail.berlios.de) Date: Thu, 6 Aug 2009 13:18:33 +0200 Subject: [Haiku-commits] r32158 - haiku/trunk/src/add-ons/kernel/file_systems/bfs Message-ID: <200908061118.n76BIXh8020000@sheep.berlios.de> Author: axeld Date: 2009-08-06 13:18:26 +0200 (Thu, 06 Aug 2009) New Revision: 32158 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32158&view=rev Modified: haiku/trunk/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp haiku/trunk/src/add-ons/kernel/file_systems/bfs/Debug.cpp haiku/trunk/src/add-ons/kernel/file_systems/bfs/Index.cpp haiku/trunk/src/add-ons/kernel/file_systems/bfs/Inode.cpp haiku/trunk/src/add-ons/kernel/file_systems/bfs/Inode.h haiku/trunk/src/add-ons/kernel/file_systems/bfs/Query.cpp haiku/trunk/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp Log: * Replaced the Inode::GetTree() method with a simple getter - the tree is always created for directories since quite some time now. Modified: haiku/trunk/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp 2009-08-06 11:02:08 UTC (rev 32157) +++ haiku/trunk/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp 2009-08-06 11:18:26 UTC (rev 32158) @@ -1369,8 +1369,8 @@ // get iterator for the next directory - BPlusTree* tree; - if (inode->GetTree(&tree) != B_OK) { + BPlusTree* tree = inode->Tree(); + if (tree == NULL) { FATAL(("check: could not open b+tree from inode at %Ld\n", fVolume->ToBlock(cookie->current))); continue; Modified: haiku/trunk/src/add-ons/kernel/file_systems/bfs/Debug.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/bfs/Debug.cpp 2009-08-06 11:02:08 UTC (rev 32157) +++ haiku/trunk/src/add-ons/kernel/file_systems/bfs/Debug.cpp 2009-08-06 11:18:26 UTC (rev 32158) @@ -293,9 +293,7 @@ kprintf("INODE %p\n", inode); kprintf(" rw lock: %p\n", &inode->Lock()); - BPlusTree* tree = NULL; - inode->GetTree(&tree); - kprintf(" tree: %p\n", tree); + kprintf(" tree: %p\n", inode->Tree()); kprintf(" file cache: %p\n", inode->FileCache()); kprintf(" file map: %p\n", inode->Map()); kprintf(" old size: %Ld\n", inode->OldSize()); Modified: haiku/trunk/src/add-ons/kernel/file_systems/bfs/Index.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/bfs/Index.cpp 2009-08-06 11:02:08 UTC (rev 32157) +++ haiku/trunk/src/add-ons/kernel/file_systems/bfs/Index.cpp 2009-08-06 11:18:26 UTC (rev 32158) @@ -76,8 +76,8 @@ InodeReadLocker locker(indices); - BPlusTree* tree; - if (indices->GetTree(&tree) != B_OK) + BPlusTree* tree = indices->Tree(); + if (tree == NULL) return B_BAD_VALUE; ino_t id; @@ -261,15 +261,16 @@ newKey, newLength); } - BPlusTree* tree; - status_t status = Node()->GetTree(&tree); - if (status < B_OK) - return status; + BPlusTree* tree = Node()->Tree(); + if (tree == NULL) + return B_BAD_VALUE; // remove the old key from the tree Node()->WriteLockInTransaction(transaction); + status_t status = B_OK; + if (oldKey != NULL) { status = tree->Remove(transaction, (const uint8*)oldKey, oldLength, inode->ID()); Modified: haiku/trunk/src/add-ons/kernel/file_systems/bfs/Inode.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/bfs/Inode.cpp 2009-08-06 11:02:08 UTC (rev 32157) +++ haiku/trunk/src/add-ons/kernel/file_systems/bfs/Inode.cpp 2009-08-06 11:18:26 UTC (rev 32158) @@ -1206,25 +1206,26 @@ return B_ERROR; } - BPlusTree* tree; - status_t status = attributes->GetTree(&tree); - if (status == B_OK) { - InodeReadLocker locker(attributes); + BPlusTree* tree = attributes->Tree(); + if (tree == NULL) + return B_BAD_VALUE; - ino_t id; - status = tree->Find((uint8*)name, (uint16)strlen(name), &id); - if (status == B_OK) { - Vnode vnode(fVolume, id); - Inode* inode; - // Check if the attribute is really an attribute - if (vnode.Get(&inode) < B_OK || !inode->IsAttribute()) - return B_ERROR; + InodeReadLocker locker(attributes); - *_attribute = inode; - vnode.Keep(); - return B_OK; - } + ino_t id; + status_t status = tree->Find((uint8*)name, (uint16)strlen(name), &id); + if (status == B_OK) { + Vnode vnode(fVolume, id); + Inode* inode; + // Check if the attribute is really an attribute + if (vnode.Get(&inode) != B_OK || !inode->IsAttribute()) + return B_ERROR; + + *_attribute = inode; + vnode.Keep(); + return B_OK; } + return status; } @@ -1264,33 +1265,11 @@ // #pragma mark - directory tree -/*! Gives the caller direct access to the b+tree for a given directory. - The tree is no longer created on demand, but when the inode is first - created. That will report any potential errors upfront, saves locking, - and should work as good (though a bit slower). -*/ -status_t -Inode::GetTree(BPlusTree** tree) -{ - if (fTree) { - *tree = fTree; - return B_OK; - } - - RETURN_ERROR(B_BAD_VALUE); -} - - bool Inode::IsEmpty() { - BPlusTree* tree; - status_t status = GetTree(&tree); - if (status < B_OK) - return status; + TreeIterator iterator(fTree); - TreeIterator iterator(tree); - // index and attribute directories are really empty when they are // empty - directories for standard files always contain ".", and // "..", so we need to ignore those two @@ -2354,15 +2333,14 @@ Inode::Remove(Transaction& transaction, const char* name, ino_t* _id, bool isDirectory, bool force) { - BPlusTree* tree; - if (GetTree(&tree) != B_OK) + if (fTree == NULL) RETURN_ERROR(B_BAD_VALUE); WriteLockInTransaction(transaction); // does the file even exist? off_t id; - if (tree->Find((uint8*)name, (uint16)strlen(name), &id) < B_OK) + if (fTree->Find((uint8*)name, (uint16)strlen(name), &id) < B_OK) return B_ENTRY_NOT_FOUND; if (_id) @@ -2398,13 +2376,13 @@ if (status != B_OK) return status; - if (tree->Remove(transaction, name, id) != B_OK && !force) { + if (fTree->Remove(transaction, name, id) != B_OK && !force) { unremove_vnode(fVolume->FSVolume(), id); RETURN_ERROR(B_ERROR); } #ifdef DEBUG - if (tree->Find((uint8*)name, (uint16)strlen(name), &id) == B_OK) { + if (fTree->Find((uint8*)name, (uint16)strlen(name), &id) == B_OK) { DIE(("deleted entry still there")); } #endif @@ -2463,8 +2441,7 @@ if (parent != NULL && (mode & S_ATTR_DIR) == 0 && parent->IsContainer()) { // check if the file already exists in the directory - if (parent->GetTree(&tree) != B_OK) - RETURN_ERROR(B_BAD_VALUE); + tree = parent->Tree(); } if (parent != NULL) { @@ -2759,8 +2736,8 @@ return B_ENTRY_NOT_FOUND; } - BPlusTree* tree; - if (fAttributes->GetTree(&tree) < B_OK + BPlusTree* tree = fAttributes->Tree(); + if (tree == NULL || (fIterator = new TreeIterator(tree)) == NULL) { FATAL(("could not get tree in AttributeIterator::GetNext(ino_t" " = %Ld,name = \"%s\")\n", fInode->ID(), name)); Modified: haiku/trunk/src/add-ons/kernel/file_systems/bfs/Inode.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/bfs/Inode.h 2009-08-06 11:02:08 UTC (rev 32157) +++ haiku/trunk/src/add-ons/kernel/file_systems/bfs/Inode.h 2009-08-06 11:18:26 UTC (rev 32158) @@ -119,7 +119,7 @@ Inode** attribute); // for directories only: - status_t GetTree(BPlusTree** _tree); + BPlusTree* Tree() const { return fTree; } bool IsEmpty(); status_t ContainerContentsChanged(Transaction& transaction); Modified: haiku/trunk/src/add-ons/kernel/file_systems/bfs/Query.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/bfs/Query.cpp 2009-08-06 11:02:08 UTC (rev 32157) +++ haiku/trunk/src/add-ons/kernel/file_systems/bfs/Query.cpp 2009-08-06 11:18:26 UTC (rev 32158) @@ -1,5 +1,5 @@ /* - * Copyright 2001-2008, Axel D?rfler, axeld at pinc-software.de. + * Copyright 2001-2009, Axel D?rfler, axeld at pinc-software.de. * This file may be used under the terms of the MIT License. */ @@ -931,20 +931,20 @@ status_t status = index.SetTo(fAttribute); // if we should query attributes without an index, we can just proceed here - if (status < B_OK && !queryNonIndexed) + if (status != B_OK && !queryNonIndexed) return B_ENTRY_NOT_FOUND; type_code type; // Special case for OP_UNEQUAL - it will always operate through the whole // index but we need the call to the original index to get the correct type - if (status < B_OK || fOp == OP_UNEQUAL) { + if (status != B_OK || fOp == OP_UNEQUAL) { // Try to get an index that holds all files (name) // Also sets the default type for all attributes without index // to string. type = status < B_OK ? B_STRING_TYPE : index.Type(); - if (index.SetTo("name") < B_OK) + if (index.SetTo("name") != B_OK) return B_ENTRY_NOT_FOUND; fHasIndex = false; @@ -956,8 +956,8 @@ if (ConvertValue(type) < B_OK) return B_BAD_VALUE; - BPlusTree* tree; - if (index.Node()->GetTree(&tree) < B_OK) + BPlusTree* tree = index.Node()->Tree(); + if (tree == NULL) return B_ERROR; *iterator = new TreeIterator(tree); @@ -1033,7 +1033,7 @@ status_t status = iterator->GetNextEntry(&indexValue, &keyLength, (uint16)sizeof(indexValue), &offset, &duplicate); - if (status < B_OK) + if (status != B_OK) return status; // only compare against the index entry when this is the correct Modified: haiku/trunk/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp 2009-08-06 11:02:08 UTC (rev 32157) +++ haiku/trunk/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp 2009-08-06 11:18:26 UTC (rev 32158) @@ -571,15 +571,15 @@ // check access permissions status_t status = directory->CheckPermissions(X_OK); - if (status < B_OK) + if (status != B_OK) RETURN_ERROR(status); - BPlusTree* tree; - if (directory->GetTree(&tree) != B_OK) + BPlusTree* tree = directory->Tree(); + if (tree == NULL) RETURN_ERROR(B_BAD_VALUE); status = tree->Find((uint8*)file, (uint16)strlen(file), _vnodeID); - if (status < B_OK) { + if (status != B_OK) { //PRINT(("bfs_walk() could not find %Ld:\"%s\": %s\n", directory->BlockNumber(), file, strerror(status))); return status; } @@ -1059,24 +1059,23 @@ status_t status = oldDirectory->CheckPermissions(W_OK); if (status == B_OK) status = newDirectory->CheckPermissions(W_OK); - if (status < B_OK) + if (status != B_OK) return status; // Get the directory's tree, and a pointer to the inode which should be // changed - BPlusTree* tree; - status = oldDirectory->GetTree(&tree); - if (status < B_OK) - RETURN_ERROR(status); + BPlusTree* tree = oldDirectory->Tree(); + if (tree == NULL) + RETURN_ERROR(B_BAD_VALUE); off_t id; status = tree->Find((const uint8*)oldName, strlen(oldName), &id); - if (status < B_OK) + if (status != B_OK) RETURN_ERROR(status); Vnode vnode(volume, id); Inode* inode; - if (vnode.Get(&inode) < B_OK) + if (vnode.Get(&inode) != B_OK) return B_IO_ERROR; // Don't move a directory into one of its children - we soar up @@ -1096,7 +1095,7 @@ Vnode vnode(volume, parent); Inode* parentNode; - if (vnode.Get(&parentNode) < B_OK) + if (vnode.Get(&parentNode) != B_OK) return B_ERROR; parent = volume->ToVnode(parentNode->Parent()); @@ -1110,9 +1109,9 @@ // failure, we will test this case first BPlusTree* newTree = tree; if (newDirectory != oldDirectory) { - status = newDirectory->GetTree(&newTree); - if (status < B_OK) - RETURN_ERROR(status); + newTree = newDirectory->Tree(); + if (newTree == NULL) + RETURN_ERROR(B_BAD_VALUE); } status = newTree->Insert(transaction, (const uint8*)newName, @@ -1173,10 +1172,10 @@ // if it's a directory, update the parent directory pointer // in its tree if necessary - BPlusTree* movedTree = NULL; + BPlusTree* movedTree = inode->Tree(); if (oldDirectory != newDirectory && inode->IsDirectory() - && (status = inode->GetTree(&movedTree)) == B_OK) { + && movedTree != NULL) { status = movedTree->Replace(transaction, (const uint8*)"..", 2, newDirectory->ID()); @@ -1579,8 +1578,8 @@ if (!inode->IsContainer()) RETURN_ERROR(B_BAD_VALUE); - BPlusTree* tree; - if (inode->GetTree(&tree) != B_OK) + BPlusTree* tree = inode->Tree(); + if (tree == NULL) RETURN_ERROR(B_BAD_VALUE); TreeIterator* iterator = new(std::nothrow) TreeIterator(tree); From pulkomandy at mail.berlios.de Thu Aug 6 13:29:08 2009 From: pulkomandy at mail.berlios.de (pulkomandy at BerliOS) Date: Thu, 6 Aug 2009 13:29:08 +0200 Subject: [Haiku-commits] r32159 - in haiku/branches/components/gsoc-locale-kit: headers/os/locale src/kits/locale Message-ID: <200908061129.n76BT89D005379@sheep.berlios.de> Author: pulkomandy Date: 2009-08-06 13:29:03 +0200 (Thu, 06 Aug 2009) New Revision: 32159 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32159&view=rev Modified: haiku/branches/components/gsoc-locale-kit/headers/os/locale/Country.h haiku/branches/components/gsoc-locale-kit/headers/os/locale/LocaleStrings.h haiku/branches/components/gsoc-locale-kit/src/kits/locale/Country.cpp Log: -Monetary part of BCountry -Removed Strings from LocaleStrings that are not used anymore (they are provided by ICU now) Modified: haiku/branches/components/gsoc-locale-kit/headers/os/locale/Country.h =================================================================== --- haiku/branches/components/gsoc-locale-kit/headers/os/locale/Country.h 2009-08-06 11:18:26 UTC (rev 32158) +++ haiku/branches/components/gsoc-locale-kit/headers/os/locale/Country.h 2009-08-06 11:29:03 UTC (rev 32159) @@ -63,7 +63,7 @@ virtual ssize_t FormatMonetary(char *string,size_t maxSize,char *format, ...); - virtual ssize_t FormatMonetary(BString *string,char *format, ...); + virtual ssize_t FormatMonetary(BString *string, double value); const char *CurrencySymbol() const; const char *InternationalCurrencySymbol() const; Modified: haiku/branches/components/gsoc-locale-kit/headers/os/locale/LocaleStrings.h =================================================================== --- haiku/branches/components/gsoc-locale-kit/headers/os/locale/LocaleStrings.h 2009-08-06 11:18:26 UTC (rev 32158) +++ haiku/branches/components/gsoc-locale-kit/headers/os/locale/LocaleStrings.h 2009-08-06 11:29:03 UTC (rev 32159) @@ -20,18 +20,7 @@ B_DATE_SEPARATOR, B_TIME_SEPARATOR, - B_GROUPING, - B_DECIMAL_POINT, - B_THOUSANDS_SEPARATOR, - B_POSITIVE_SIGN, - B_NEGATIVE_SIGN, - B_CURRENCY_SYMBOL, - B_INT_CURRENCY_SYMBOL, - B_MON_GROUPING, - B_MON_DECIMAL_POINT, - B_MON_THOUSANDS_SEPARATOR, - B_NUM_COUNTRY_STRINGS, }; Modified: haiku/branches/components/gsoc-locale-kit/src/kits/locale/Country.cpp =================================================================== --- haiku/branches/components/gsoc-locale-kit/src/kits/locale/Country.cpp 2009-08-06 11:18:26 UTC (rev 32158) +++ haiku/branches/components/gsoc-locale-kit/src/kits/locale/Country.cpp 2009-08-06 11:29:03 UTC (rev 32159) @@ -37,16 +37,8 @@ // separators ".", ":", - " ", - ".", - ",", - // positive/negative sign - "+", - "-", // currency/monetary - "US$" - " " "." "," }; @@ -381,8 +373,21 @@ ssize_t -BCountry::FormatMonetary(BString *string, char *format, ...) +BCountry::FormatMonetary(BString *string, double value) { + UErrorCode err; + NumberFormat* nf = NumberFormat::createCurrencyInstance(fICULocale, err); + + assert(err == U_ZERO_ERROR); + + UnicodeString myString; + myString = nf->format(value, myString); + + string->Truncate(0); + BStringByteSink bbs(string); + + myString.toUTF8(bbs); + return B_OK; } @@ -390,35 +395,121 @@ const char * BCountry::CurrencySymbol() const { - return fStrings[B_CURRENCY_SYMBOL]; + UErrorCode err; + NumberFormat* nf = NumberFormat::createCurrencyInstance(fICULocale, err); + assert(err == U_ZERO_ERROR); + DecimalFormat* df = dynamic_cast(nf); + + assert(df != NULL); + + const DecimalFormatSymbols* syms = df->getDecimalFormatSymbols(); + + UnicodeString myString; + myString = syms->getSymbol(DecimalFormatSymbols::kCurrencySymbol); + + BString string; + BStringByteSink bbs(&string); + + myString.toUTF8(bbs); + + return string.String(); } const char * BCountry::InternationalCurrencySymbol() const { - return fStrings[B_INT_CURRENCY_SYMBOL]; + UErrorCode err; + NumberFormat* nf = NumberFormat::createCurrencyInstance(fICULocale, err); + assert(err == U_ZERO_ERROR); + DecimalFormat* df = dynamic_cast(nf); + + assert(df != NULL); + + const DecimalFormatSymbols* syms = df->getDecimalFormatSymbols(); + + UnicodeString myString; + myString = syms->getSymbol(DecimalFormatSymbols::kIntlCurrencySymbol); + + BString string; + BStringByteSink bbs(&string); + + myString.toUTF8(bbs); + + return string.String(); } const char * BCountry::MonDecimalPoint() const { - return fStrings[B_MON_DECIMAL_POINT]; + UErrorCode err; + NumberFormat* nf = NumberFormat::createCurrencyInstance(fICULocale, err); + assert(err == U_ZERO_ERROR); + DecimalFormat* df = dynamic_cast(nf); + + assert(df != NULL); + + const DecimalFormatSymbols* syms = df->getDecimalFormatSymbols(); + + UnicodeString myString; + myString = syms->getSymbol(DecimalFormatSymbols::kMonetarySeparatorSymbol); + + BString string; + BStringByteSink bbs(&string); + + myString.toUTF8(bbs); + + return string.String(); } const char * BCountry::MonThousandsSeparator() const { - return fStrings[B_MON_THOUSANDS_SEPARATOR]; + UErrorCode err; + NumberFormat* nf = NumberFormat::createCurrencyInstance(fICULocale, err); + assert(err == U_ZERO_ERROR); + DecimalFormat* df = dynamic_cast(nf); + + assert(df != NULL); + + const DecimalFormatSymbols* syms = df->getDecimalFormatSymbols(); + + UnicodeString myString; + myString = syms->getSymbol(DecimalFormatSymbols::kPatternSeparatorSymbol); + + BString string; + BStringByteSink bbs(&string); + + myString.toUTF8(bbs); + + return string.String(); } const char * BCountry::MonGrouping() const { - return fStrings[B_MON_GROUPING]; + UErrorCode err; + NumberFormat* nf = NumberFormat::createCurrencyInstance(fICULocale, err); + assert(err == U_ZERO_ERROR); + DecimalFormat* df = dynamic_cast(nf); + + assert(df != NULL); + + const DecimalFormatSymbols* syms = df->getDecimalFormatSymbols(); + + UnicodeString myString; + myString = syms->getSymbol( + DecimalFormatSymbols::kMonetaryGroupingSeparatorSymbol); + + BString string; + BStringByteSink bbs(&string); + + myString.toUTF8(bbs); + + return string.String(); } From bga at bug-br.org.br Thu Aug 6 13:32:35 2009 From: bga at bug-br.org.br (Bruno Albuquerque) Date: Thu, 06 Aug 2009 08:32:35 -0300 Subject: [Haiku-commits] r32157 - haiku/trunk/src/add-ons/kernel/file_systems/bfs In-Reply-To: <200908061102.n76B2M5o028211@sheep.berlios.de> References: <200908061102.n76B2M5o028211@sheep.berlios.de> Message-ID: <4A7ABF53.20709@bug-br.org.br> axeld at mail.berlios.de wrote: > Author: axeld > Date: 2009-08-06 13:02:08 +0200 (Thu, 06 Aug 2009) > New Revision: 32157 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32157&view=rev > > Modified: > haiku/trunk/src/add-ons/kernel/file_systems/bfs/Inode.cpp > haiku/trunk/src/add-ons/kernel/file_systems/bfs/Inode.h > haiku/trunk/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp > Log: > * Somehow I forgot to update the parent directory's time stamps on file > creation, removal, and name changes... I wonder if this would explain why svn status, from time to time, shows zillions of files as being modified (when they were not) and svn revert on the files does nothing. -Bruno From axeld at pinc-software.de Thu Aug 6 13:31:59 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Thu, 06 Aug 2009 13:31:59 +0200 CEST Subject: [Haiku-commits] r32155 - haiku/trunk/src/servers/media In-Reply-To: <20090806131656.1892.8@bepc.1249551590.fake> Message-ID: <15807600832-BeMail@zon> Stephan Assmus wrote: > > * Also replaced TList with std::set for the team list. > BTW, is it your plan to eventually get rid of TList and TMap? Just > thought > I'd mention that I've been growing fond of TList at least. The code > that > uses it ends up being quite compact. Maybe we can keep that as a > light-weight supplement to BObjectList, with O(1) Insert()? Some of > it's > internals could certainly be made more robust, though, IIRC. In the long term, I want to get rid of TList and TMap, as well as any other home-brewn/private list/map implementations there are in our tree, and have public Be style classes for this (basically stl containers without their ugliness). The TList iteration API is pretty awkward IMO, but since it works more than std::vector than BList, we don't have a shared replacement in our tree yet. In the case at hand, std::set was just more what you wanted there. Bye, Axel. From axeld at pinc-software.de Thu Aug 6 13:32:52 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Thu, 06 Aug 2009 13:32:52 +0200 CEST Subject: [Haiku-commits] r32156 - haiku/trunk/src/servers/media In-Reply-To: <20090806131322.1864.7@bepc.1249551590.fake> Message-ID: <15860323323-BeMail@zon> Stephan Assmus wrote: > From this commit I don't see why you need two maps. But nice fixes, > thanks! _ReleaseClonedArea() needs the reverse mapping - one could walk through the list of all cloned areas, but using a map is just faster. Bye, Axel. From axeld at pinc-software.de Thu Aug 6 13:36:08 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Thu, 06 Aug 2009 13:36:08 +0200 CEST Subject: [Haiku-commits] =?utf-8?q?r32027_-_in_haiku/trunk/src/apps=3A_=2E?= =?utf-8?q?_haiku3d_haiku3d/data_haiku3d/mesh_haiku3d/texture?= In-Reply-To: <4A7AB092.5030206@zappotek.com> Message-ID: <16056184148-BeMail@zon> Alexandre Deckner wrote: > The voting/comment period has expired! You have until midnight before > i > add this evilware to the image :) I wouldn't mind to have it in demos either, but as stippi said, I would remove the GLCube demo then. Bye, Axel. From axeld at pinc-software.de Thu Aug 6 14:22:15 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Thu, 06 Aug 2009 14:22:15 +0200 CEST Subject: [Haiku-commits] =?utf-8?q?r32159_-_in_haiku/branches/components/g?= =?utf-8?q?soc-locale-kit=3A_headers/os/locale_src/kits/locale?= In-Reply-To: <200908061129.n76BT89D005379@sheep.berlios.de> Message-ID: <18823275828-BeMail@zon> pulkomandy at BerliOS wrote: > + NumberFormat* nf = NumberFormat::createCurrencyInstance(fICULocale, > err); Our coding style asks for descriptive names; "nf" is not one of those. > + UnicodeString myString; > + myString = nf->format(value, myString); The coding style also mentions that you shouldn't use "my" and "the", and "a" as prefix for variable names, as they are most of the time (like here) totally meaningless. Bye, Axel. From axeld at pinc-software.de Thu Aug 6 14:23:11 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Thu, 06 Aug 2009 14:23:11 +0200 CEST Subject: [Haiku-commits] =?utf-8?q?r32157_-_haiku/trunk/src/add-ons/kernel?= =?utf-8?q?/file=5Fsystems/bfs?= In-Reply-To: <4A7ABF53.20709@bug-br.org.br> Message-ID: <18879534820-BeMail@zon> Bruno Albuquerque wrote: > axeld at mail.berlios.de wrote: > > Log: > > * Somehow I forgot to update the parent directory's time stamps on > > file > > creation, removal, and name changes... > I wonder if this would explain why svn status, from time to time, > shows > zillions of files as being modified (when they were not) and svn > revert > on the files does nothing. No, that is an svn bug (it has problems with the $Id strings and similar). Bye, Axel. From pulkomandy at mail.berlios.de Thu Aug 6 15:09:32 2009 From: pulkomandy at mail.berlios.de (pulkomandy at BerliOS) Date: Thu, 6 Aug 2009 15:09:32 +0200 Subject: [Haiku-commits] r32160 - in haiku/branches/components/gsoc-locale-kit/src: kits/locale preferences/locale tests/kits/locale Message-ID: <200908061309.n76D9WLs021608@sheep.berlios.de> Author: pulkomandy Date: 2009-08-06 15:09:30 +0200 (Thu, 06 Aug 2009) New Revision: 32160 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32160&view=rev Modified: haiku/branches/components/gsoc-locale-kit/src/kits/locale/Country.cpp haiku/branches/components/gsoc-locale-kit/src/preferences/locale/LocaleWindow.cpp haiku/branches/components/gsoc-locale-kit/src/preferences/locale/TimeFormatSettingsView.cpp haiku/branches/components/gsoc-locale-kit/src/preferences/locale/TimeFormatSettingsView.h haiku/branches/components/gsoc-locale-kit/src/tests/kits/locale/Jamfile Log: -Fixed FormatDate and FormatTime to display the correct date (ICU is millisecond-precise) -Update the examples dates in the preflet when one select another country -Some variable renaming to better fit the guidelines Modified: haiku/branches/components/gsoc-locale-kit/src/kits/locale/Country.cpp =================================================================== --- haiku/branches/components/gsoc-locale-kit/src/kits/locale/Country.cpp 2009-08-06 11:29:03 UTC (rev 32159) +++ haiku/branches/components/gsoc-locale-kit/src/kits/locale/Country.cpp 2009-08-06 13:09:30 UTC (rev 32160) @@ -117,13 +117,13 @@ dateFormatter = DateFormat::createDateInstance( longFormat ? DateFormat::FULL : DateFormat::SHORT, fICULocale); - UnicodeString myString; - myString = dateFormatter->format(time, myString); + UnicodeString ICUString; + ICUString = dateFormatter->format((UDate)time*1000, ICUString); string->Truncate(0); BStringByteSink bbs(string); - myString.toUTF8(bbs); + ICUString.toUTF8(bbs); } @@ -142,13 +142,13 @@ timeFormatter = DateFormat::createTimeInstance( longFormat ? DateFormat::FULL : DateFormat::SHORT, fICULocale); - UnicodeString myString; - myString = timeFormatter->format(time, myString); + UnicodeString ICUString; + ICUString = timeFormatter->format((UDate)time*1000, ICUString); string->Truncate(0); BStringByteSink bbs(string); - myString.toUTF8(bbs); + ICUString.toUTF8(bbs); } @@ -190,17 +190,18 @@ BCountry::FormatNumber(BString *string, double value) { UErrorCode err; - NumberFormat* nf = NumberFormat::createInstance(fICULocale, err); + NumberFormat* numberFormatter = + NumberFormat::createInstance(fICULocale, err); assert(err == U_ZERO_ERROR); - UnicodeString myString; - myString = nf->format(value, myString); + UnicodeString ICUString; + ICUString = numberFormatter->format(value, ICUString); string->Truncate(0); BStringByteSink bbs(string); - myString.toUTF8(bbs); + ICUString.toUTF8(bbs); } @@ -214,17 +215,18 @@ BCountry::FormatNumber(BString *string, int32 value) { UErrorCode err; - NumberFormat* nf = NumberFormat::createInstance(fICULocale, err); + NumberFormat* numberFormatter = + NumberFormat::createInstance(fICULocale, err); assert(err == U_ZERO_ERROR); - UnicodeString myString; - myString = nf->format((int32_t)value, myString); + UnicodeString ICUString; + ICUString = numberFormatter->format((int32_t)value, ICUString); string->Truncate(0); BStringByteSink bbs(string); - myString.toUTF8(bbs); + ICUString.toUTF8(bbs); } @@ -233,23 +235,26 @@ BCountry::DecimalPoint() const { UErrorCode err; - NumberFormat* nf = NumberFormat::createInstance(fICULocale, err); + NumberFormat* numberFormatter = + NumberFormat::createInstance(fICULocale, err); assert(err == U_ZERO_ERROR); - DecimalFormat* df = dynamic_cast(nf); + DecimalFormat* decimalFormatter + = dynamic_cast(numberFormatter); - assert(df != NULL); + assert(decimalFormatter != NULL); - const DecimalFormatSymbols* syms = df->getDecimalFormatSymbols(); + const DecimalFormatSymbols* syms = + decimalFormatter->getDecimalFormatSymbols(); - UnicodeString myString; - myString = syms->getSymbol(DecimalFormatSymbols::kDecimalSeparatorSymbol); + UnicodeString ICUString; + ICUString = syms->getSymbol(DecimalFormatSymbols::kDecimalSeparatorSymbol); BString string; BStringByteSink bbs(&string); - myString.toUTF8(bbs); + ICUString.toUTF8(bbs); return string.String(); } @@ -259,21 +264,24 @@ BCountry::ThousandsSeparator() const { UErrorCode err; - NumberFormat* nf = NumberFormat::createInstance(fICULocale, err); + NumberFormat* numberFormatter + = NumberFormat::createInstance(fICULocale, err); assert(err == U_ZERO_ERROR); - DecimalFormat* df = dynamic_cast(nf); + DecimalFormat* decimalFormatter + = dynamic_cast(numberFormatter); - assert(df != NULL); + assert(decimalFormatter != NULL); - const DecimalFormatSymbols* syms = df->getDecimalFormatSymbols(); + const DecimalFormatSymbols* syms + = decimalFormatter->getDecimalFormatSymbols(); - UnicodeString myString; - myString = syms->getSymbol(DecimalFormatSymbols::kPatternSeparatorSymbol); + UnicodeString ICUString; + ICUString = syms->getSymbol(DecimalFormatSymbols::kPatternSeparatorSymbol); BString string; BStringByteSink bbs(&string); - myString.toUTF8(bbs); + ICUString.toUTF8(bbs); return string.String(); } @@ -283,21 +291,24 @@ BCountry::Grouping() const { UErrorCode err; - NumberFormat* nf = NumberFormat::createInstance(fICULocale, err); + NumberFormat* numberFormatter = + NumberFormat::createInstance(fICULocale, err); assert(err == U_ZERO_ERROR); - DecimalFormat* df = dynamic_cast(nf); + DecimalFormat* decimalFormatter + = dynamic_cast(numberFormatter); - assert(df != NULL); + assert(decimalFormatter != NULL); - const DecimalFormatSymbols* syms = df->getDecimalFormatSymbols(); + const DecimalFormatSymbols* syms + = decimalFormatter->getDecimalFormatSymbols(); - UnicodeString myString; - myString = syms->getSymbol(DecimalFormatSymbols::kGroupingSeparatorSymbol); + UnicodeString ICUString; + ICUString = syms->getSymbol(DecimalFormatSymbols::kGroupingSeparatorSymbol); BString string; BStringByteSink bbs(&string); - myString.toUTF8(bbs); + ICUString.toUTF8(bbs); return string.String(); } @@ -307,21 +318,24 @@ BCountry::PositiveSign() const { UErrorCode err; - NumberFormat* nf = NumberFormat::createInstance(fICULocale, err); + NumberFormat* numberFormatter + = NumberFormat::createInstance(fICULocale, err); assert(err == U_ZERO_ERROR); - DecimalFormat* df = dynamic_cast(nf); + DecimalFormat* decimalFormatter + = dynamic_cast(numberFormatter); - assert(df != NULL); + assert(decimalFormatter != NULL); - const DecimalFormatSymbols* syms = df->getDecimalFormatSymbols(); + const DecimalFormatSymbols* syms + = decimalFormatter->getDecimalFormatSymbols(); - UnicodeString myString; - myString = syms->getSymbol(DecimalFormatSymbols::kPlusSignSymbol); + UnicodeString ICUString; + ICUString = syms->getSymbol(DecimalFormatSymbols::kPlusSignSymbol); BString string; BStringByteSink bbs(&string); - myString.toUTF8(bbs); + ICUString.toUTF8(bbs); return string.String(); } @@ -331,21 +345,24 @@ BCountry::NegativeSign() const { UErrorCode err; - NumberFormat* nf = NumberFormat::createInstance(fICULocale, err); + NumberFormat* numberFormatter = + NumberFormat::createInstance(fICULocale, err); assert(err == U_ZERO_ERROR); - DecimalFormat* df = dynamic_cast(nf); + DecimalFormat* decimalFormatter + = dynamic_cast(numberFormatter); - assert(df != NULL); + assert(decimalFormatter != NULL); - const DecimalFormatSymbols* syms = df->getDecimalFormatSymbols(); + const DecimalFormatSymbols* syms + = decimalFormatter->getDecimalFormatSymbols(); - UnicodeString myString; - myString = syms->getSymbol(DecimalFormatSymbols::kMinusSignSymbol); + UnicodeString ICUString; + ICUString = syms->getSymbol(DecimalFormatSymbols::kMinusSignSymbol); BString string; BStringByteSink bbs(&string); - myString.toUTF8(bbs); + ICUString.toUTF8(bbs); return string.String(); } @@ -376,17 +393,18 @@ BCountry::FormatMonetary(BString *string, double value) { UErrorCode err; - NumberFormat* nf = NumberFormat::createCurrencyInstance(fICULocale, err); + NumberFormat* numberFormatter = + NumberFormat::createCurrencyInstance(fICULocale, err); assert(err == U_ZERO_ERROR); - UnicodeString myString; - myString = nf->format(value, myString); + UnicodeString ICUString; + ICUString = numberFormatter->format(value, ICUString); string->Truncate(0); BStringByteSink bbs(string); - myString.toUTF8(bbs); + ICUString.toUTF8(bbs); return B_OK; } @@ -396,21 +414,24 @@ BCountry::CurrencySymbol() const { UErrorCode err; - NumberFormat* nf = NumberFormat::createCurrencyInstance(fICULocale, err); + NumberFormat* numberFormatter = + NumberFormat::createCurrencyInstance(fICULocale, err); assert(err == U_ZERO_ERROR); - DecimalFormat* df = dynamic_cast(nf); + DecimalFormat* decimalFormatter + = dynamic_cast(numberFormatter); - assert(df != NULL); + assert(decimalFormatter != NULL); - const DecimalFormatSymbols* syms = df->getDecimalFormatSymbols(); + const DecimalFormatSymbols* syms + = decimalFormatter->getDecimalFormatSymbols(); - UnicodeString myString; - myString = syms->getSymbol(DecimalFormatSymbols::kCurrencySymbol); + UnicodeString ICUString; + ICUString = syms->getSymbol(DecimalFormatSymbols::kCurrencySymbol); BString string; BStringByteSink bbs(&string); - myString.toUTF8(bbs); + ICUString.toUTF8(bbs); return string.String(); } @@ -420,21 +441,24 @@ BCountry::InternationalCurrencySymbol() const { UErrorCode err; - NumberFormat* nf = NumberFormat::createCurrencyInstance(fICULocale, err); + NumberFormat* numberFormatter = + NumberFormat::createCurrencyInstance(fICULocale, err); assert(err == U_ZERO_ERROR); - DecimalFormat* df = dynamic_cast(nf); + DecimalFormat* decimalFormatter + = dynamic_cast(numberFormatter); - assert(df != NULL); + assert(decimalFormatter != NULL); - const DecimalFormatSymbols* syms = df->getDecimalFormatSymbols(); + const DecimalFormatSymbols* syms + = decimalFormatter->getDecimalFormatSymbols(); - UnicodeString myString; - myString = syms->getSymbol(DecimalFormatSymbols::kIntlCurrencySymbol); + UnicodeString ICUString; + ICUString = syms->getSymbol(DecimalFormatSymbols::kIntlCurrencySymbol); BString string; BStringByteSink bbs(&string); - myString.toUTF8(bbs); + ICUString.toUTF8(bbs); return string.String(); } @@ -444,21 +468,24 @@ BCountry::MonDecimalPoint() const { UErrorCode err; - NumberFormat* nf = NumberFormat::createCurrencyInstance(fICULocale, err); + NumberFormat* numberFormatter = + NumberFormat::createCurrencyInstance(fICULocale, err); assert(err == U_ZERO_ERROR); - DecimalFormat* df = dynamic_cast(nf); + DecimalFormat* decimalFormatter + = dynamic_cast(numberFormatter); - assert(df != NULL); + assert(decimalFormatter != NULL); - const DecimalFormatSymbols* syms = df->getDecimalFormatSymbols(); + const DecimalFormatSymbols* syms + = decimalFormatter->getDecimalFormatSymbols(); - UnicodeString myString; - myString = syms->getSymbol(DecimalFormatSymbols::kMonetarySeparatorSymbol); + UnicodeString ICUString; + ICUString = syms->getSymbol(DecimalFormatSymbols::kMonetarySeparatorSymbol); BString string; BStringByteSink bbs(&string); - myString.toUTF8(bbs); + ICUString.toUTF8(bbs); return string.String(); } @@ -468,21 +495,24 @@ BCountry::MonThousandsSeparator() const { UErrorCode err; - NumberFormat* nf = NumberFormat::createCurrencyInstance(fICULocale, err); + NumberFormat* numberFormatter + = NumberFormat::createCurrencyInstance(fICULocale, err); assert(err == U_ZERO_ERROR); - DecimalFormat* df = dynamic_cast(nf); + DecimalFormat* decimalFormatter + = dynamic_cast(numberFormatter); - assert(df != NULL); + assert(decimalFormatter != NULL); - const DecimalFormatSymbols* syms = df->getDecimalFormatSymbols(); + const DecimalFormatSymbols* syms + = decimalFormatter->getDecimalFormatSymbols(); - UnicodeString myString; - myString = syms->getSymbol(DecimalFormatSymbols::kPatternSeparatorSymbol); + UnicodeString ICUString; + ICUString = syms->getSymbol(DecimalFormatSymbols::kPatternSeparatorSymbol); BString string; BStringByteSink bbs(&string); - myString.toUTF8(bbs); + ICUString.toUTF8(bbs); return string.String(); } @@ -492,22 +522,25 @@ BCountry::MonGrouping() const { UErrorCode err; - NumberFormat* nf = NumberFormat::createCurrencyInstance(fICULocale, err); + NumberFormat* numberFormatter = + NumberFormat::createCurrencyInstance(fICULocale, err); assert(err == U_ZERO_ERROR); - DecimalFormat* df = dynamic_cast(nf); + DecimalFormat* decimalFormatter + = dynamic_cast(numberFormatter); - assert(df != NULL); + assert(decimalFormatter != NULL); - const DecimalFormatSymbols* syms = df->getDecimalFormatSymbols(); + const DecimalFormatSymbols* syms + = decimalFormatter->getDecimalFormatSymbols(); - UnicodeString myString; - myString = syms->getSymbol( + UnicodeString ICUString; + ICUString = syms->getSymbol( DecimalFormatSymbols::kMonetaryGroupingSeparatorSymbol); BString string; BStringByteSink bbs(&string); - myString.toUTF8(bbs); + ICUString.toUTF8(bbs); return string.String(); } Modified: haiku/branches/components/gsoc-locale-kit/src/preferences/locale/LocaleWindow.cpp =================================================================== --- haiku/branches/components/gsoc-locale-kit/src/preferences/locale/LocaleWindow.cpp 2009-08-06 11:29:03 UTC (rev 32159) +++ haiku/branches/components/gsoc-locale-kit/src/preferences/locale/LocaleWindow.cpp 2009-08-06 13:09:30 UTC (rev 32160) @@ -465,7 +465,7 @@ } fTimeFormatSettings = - new TimeFormatSettingsView(); + new TimeFormatSettingsView(defaultCountry); tab->AddChild(BGroupLayoutBuilder(B_HORIZONTAL,10) .Add(scrollView) @@ -545,6 +545,9 @@ BMessage* newMessage = new BMessage(kMsgSettingsChanged); newMessage->AddString("country",lli->getLanguageCode()); be_app_messenger.SendMessage(newMessage); + + BCountry* country = new BCountry(lli->getLanguageCode()); + fTimeFormatSettings->SetCountry(country); break; } Modified: haiku/branches/components/gsoc-locale-kit/src/preferences/locale/TimeFormatSettingsView.cpp =================================================================== --- haiku/branches/components/gsoc-locale-kit/src/preferences/locale/TimeFormatSettingsView.cpp 2009-08-06 11:29:03 UTC (rev 32159) +++ haiku/branches/components/gsoc-locale-kit/src/preferences/locale/TimeFormatSettingsView.cpp 2009-08-06 13:09:30 UTC (rev 32160) @@ -23,8 +23,9 @@ #include -TimeFormatSettingsView::TimeFormatSettingsView() +TimeFormatSettingsView::TimeFormatSettingsView(BCountry* country) : BView("WindowsSettingsView", B_WILL_DRAW) + , fCountry(country) { SetLayout(new BGroupLayout(B_VERTICAL)); @@ -186,7 +187,9 @@ settings.SetClockTo24Hr(false); */ - ShowCurrentSettings(); + delete fCountry; + be_locale_roster->GetDefaultCountry(&fCountry); + _UpdateExamples(); _SendNotices(); } @@ -216,7 +219,7 @@ settings.SetClockTo24Hr(f24HrClock); */ - ShowCurrentSettings(); + //ShowCurrentSettings(); _SendNotices(); } @@ -236,8 +239,11 @@ void -TimeFormatSettingsView::ShowCurrentSettings() +TimeFormatSettingsView::SetCountry(BCountry* country) { + delete fCountry; + fCountry = country; + /* f24HrRadioButton->SetValue(settings.ClockIs24Hr()); f12HrRadioButton->SetValue(!settings.ClockIs24Hr()); @@ -308,14 +314,12 @@ time_t timeValue = (time_t)time(NULL); BString timeFormat = "Internal Error!"; - BCountry* country; - be_locale_roster->GetDefaultCountry(&country); - country->FormatDate(&timeFormat, timeValue, true); + fCountry->FormatDate(&timeFormat, timeValue, true); fLongDateExampleView->SetText(timeFormat); fLongDateExampleView->ResizeToPreferred(); - country->FormatDate(&timeFormat, timeValue, false); + fCountry->FormatDate(&timeFormat, timeValue, false); fShortDateExampleView->SetText(timeFormat); fShortDateExampleView->ResizeToPreferred(); Modified: haiku/branches/components/gsoc-locale-kit/src/preferences/locale/TimeFormatSettingsView.h =================================================================== --- haiku/branches/components/gsoc-locale-kit/src/preferences/locale/TimeFormatSettingsView.h 2009-08-06 11:29:03 UTC (rev 32159) +++ haiku/branches/components/gsoc-locale-kit/src/preferences/locale/TimeFormatSettingsView.h 2009-08-06 13:09:30 UTC (rev 32160) @@ -11,10 +11,11 @@ #include +class BCountry; +class BMenuField; +class BMessage; class BRadioButton; -class BMenuField; class BStringView; -class BMessage; enum FormatSeparator { @@ -39,7 +40,7 @@ class TimeFormatSettingsView : public BView { public: - TimeFormatSettingsView(); + TimeFormatSettingsView(BCountry* country); virtual void MessageReceived(BMessage *message); virtual void AttachedToWindow(); @@ -48,7 +49,7 @@ virtual void SetDefaults(); virtual bool IsDefaultable() const; virtual void Revert(); - virtual void ShowCurrentSettings(); + virtual void SetCountry(BCountry* country); virtual void RecordRevertSettings(); virtual bool IsRevertable() const; @@ -73,6 +74,8 @@ FormatSeparator fSeparator; DateOrder fFormat; + BCountry* fCountry; + typedef BView _inherited; }; Modified: haiku/branches/components/gsoc-locale-kit/src/tests/kits/locale/Jamfile =================================================================== --- haiku/branches/components/gsoc-locale-kit/src/tests/kits/locale/Jamfile 2009-08-06 11:29:03 UTC (rev 32159) +++ haiku/branches/components/gsoc-locale-kit/src/tests/kits/locale/Jamfile 2009-08-06 13:09:30 UTC (rev 32160) @@ -35,7 +35,7 @@ Application ICUTest : ICUTest.cpp : - be libicu-common.so $(TARGET_LIBSUPC++) ; + be libicu-common.so libicu-i18n.so libicu-data.so $(TARGET_LIBSUPC++) ; Addon catalogTestAddOn : catalogTestAddOn.cpp From axeld at pinc-software.de Thu Aug 6 15:31:30 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Thu, 06 Aug 2009 15:31:30 +0200 CEST Subject: [Haiku-commits] =?utf-8?q?r32160_-_in_haiku/branches/components/g?= =?utf-8?q?soc-locale-kit/src=3A_kits/locale_preferences/locale_tests/kits?= =?utf-8?q?/locale?= In-Reply-To: <200908061309.n76D9WLs021608@sheep.berlios.de> Message-ID: <22978180901-BeMail@zon> pulkomandy at BerliOS wrote: > dateFormatter = DateFormat::createDateInstance( > longFormat ? DateFormat::FULL : DateFormat::SHORT, Coding style: indentation - we never use space for indenting, btw. > fICULocale); > - UnicodeString myString; > - myString = dateFormatter->format(time, myString); > + UnicodeString ICUString; > + ICUString = dateFormatter->format((UDate)time*1000, ICUString); Coding style: variables always start with lower case. Also time _space_ * _space_ 1000 > string->Truncate(0); > BStringByteSink bbs(string); "bbs" is just like "nf" not a descriptive name, and must not be used. Bye, Axel. From axeld at mail.berlios.de Thu Aug 6 17:00:53 2009 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Thu, 6 Aug 2009 17:00:53 +0200 Subject: [Haiku-commits] r32161 - haiku/trunk/src/apps/packageinstaller Message-ID: <200908061500.n76F0rX4001187@sheep.berlios.de> Author: axeld Date: 2009-08-06 17:00:52 +0200 (Thu, 06 Aug 2009) New Revision: 32161 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32161&view=rev Modified: haiku/trunk/src/apps/packageinstaller/PackageItem.cpp haiku/trunk/src/apps/packageinstaller/PackageItem.h haiku/trunk/src/apps/packageinstaller/PackageView.cpp haiku/trunk/src/apps/packageinstaller/PackageView.h Log: * Applied patch by sil2100 that basically adds a "Yes to all" button, see ticket #4059. I fixed a few style violations, though. Thanks! * Automatic whitespace cleanup. Modified: haiku/trunk/src/apps/packageinstaller/PackageItem.cpp =================================================================== --- haiku/trunk/src/apps/packageinstaller/PackageItem.cpp 2009-08-06 13:09:30 UTC (rev 32160) +++ haiku/trunk/src/apps/packageinstaller/PackageItem.cpp 2009-08-06 15:00:52 UTC (rev 32161) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007-2009, Haiku, Inc. + * Copyright 2007-2009, Haiku, Inc. * Distributed under the terms of the MIT license. * * Author: @@ -9,16 +9,19 @@ #include "PackageItem.h" +#include + #include #include #include +#include #include #include #include -#include #include "zlib.h" + // Macro reserved for later localization #define T(x) x @@ -37,7 +40,7 @@ status_t inflate_data(uint8 *in, uint32 inSize, uint8 *out, uint32 outSize) -{ +{ z_stream stream; stream.zalloc = Z_NULL; stream.zfree = Z_NULL; @@ -146,7 +149,7 @@ void -PackageItem::SetTo(BFile *parent, const BString &path, uint8 type, uint32 ctime, +PackageItem::SetTo(BFile *parent, const BString &path, uint8 type, uint32 ctime, uint32 mtime, uint64 offset, uint64 size) { fPackage = parent; @@ -160,25 +163,6 @@ } -int32 -PackageItem::ItemExists(const char *name) -{ - // TODO: this function doesn't really fit in, the GUI should be separated - // from the package engine completely - - BString alertString = "The "; - - alertString << ItemKind() << " named \'" << name << "\' "; - alertString << T("already exists in the given path. Should I replace " - "the existing file with the one from this package?"); - - BAlert *alert = new BAlert(T("file_exists"), alertString.String(), - T("Yes"), T("No"), T("Abort")); - - return alert->Go(); -} - - status_t PackageItem::InitPath(const char *path, BPath *destination) { @@ -218,7 +202,7 @@ status_t -PackageItem::HandleAttributes(BPath *destination, BNode *node, +PackageItem::HandleAttributes(BPath *destination, BNode *node, const char *header) { status_t ret = B_OK; @@ -256,7 +240,7 @@ continue; ret = ParseAttribute(buffer, node, &attrName, &nameSize, &attrType, - &attrData, &dataSize, &temp, &tempSize, &attrCSize, &attrOSize, + &attrData, &dataSize, &temp, &tempSize, &attrCSize, &attrOSize, &attrStarted, &done); if (ret != B_OK || done) { if (ret != B_OK) { @@ -276,9 +260,9 @@ status_t -PackageItem::ParseAttribute(uint8 *buffer, BNode *node, char **attrName, - uint32 *nameSize, uint32 *attrType, uint8 **attrData, uint64 *dataSize, - uint8 **temp, uint64 *tempSize, uint64 *attrCSize, uint64 *attrOSize, +PackageItem::ParseAttribute(uint8 *buffer, BNode *node, char **attrName, + uint32 *nameSize, uint32 *attrType, uint8 **attrData, uint64 *dataSize, + uint8 **temp, uint64 *tempSize, uint64 *attrCSize, uint64 *attrOSize, bool *attrStarted, bool *done) { status_t ret = B_OK; @@ -320,7 +304,7 @@ parser_debug(" BeAT.\n"); fPackage->Read(attrType, 4); - swap_data(B_UINT32_TYPE, attrType, sizeof(*attrType), + swap_data(B_UINT32_TYPE, attrType, sizeof(*attrType), B_SWAP_BENDIAN_TO_HOST); } else if (!memcmp(buffer, "BeAD", 5)) { if (!*attrStarted) { @@ -330,11 +314,11 @@ parser_debug(" BeAD.\n"); fPackage->Read(attrCSize, 8); - swap_data(B_UINT64_TYPE, attrCSize, sizeof(*attrCSize), + swap_data(B_UINT64_TYPE, attrCSize, sizeof(*attrCSize), B_SWAP_BENDIAN_TO_HOST); fPackage->Read(attrOSize, 8); - swap_data(B_UINT64_TYPE, attrOSize, sizeof(*attrOSize), + swap_data(B_UINT64_TYPE, attrOSize, sizeof(*attrOSize), B_SWAP_BENDIAN_TO_HOST); fPackage->Seek(4, SEEK_CUR); // TODO: Check what this means @@ -350,7 +334,7 @@ *attrData = new uint8[*dataSize]; } - if (fPackage->Read(*temp, *attrCSize) + if (fPackage->Read(*temp, *attrCSize) != static_cast(*attrCSize)) { ret = B_ERROR; return ret; @@ -367,7 +351,7 @@ } parser_debug(" Padding.\n"); - ssize_t wrote = node->WriteAttr(*attrName, *attrType, 0, *attrData, + ssize_t wrote = node->WriteAttr(*attrName, *attrType, 0, *attrData, *attrOSize); if (wrote != static_cast(*attrOSize)) { parser_debug("Failed to write attribute %s %s\n", *attrName, strerror(wrote)); @@ -391,7 +375,7 @@ status_t -PackageItem::ParseData(uint8 *buffer, BFile *file, uint64 originalSize, +PackageItem::ParseData(uint8 *buffer, BFile *file, uint64 originalSize, bool *done) { status_t ret = B_OK; @@ -400,11 +384,11 @@ parser_debug(" Found file data.\n"); uint64 compressed, original; fPackage->Read(&compressed, 8); - swap_data(B_UINT64_TYPE, &compressed, sizeof(uint64), + swap_data(B_UINT64_TYPE, &compressed, sizeof(uint64), B_SWAP_BENDIAN_TO_HOST); fPackage->Read(&original, 8); - swap_data(B_UINT64_TYPE, &original, sizeof(uint64), + swap_data(B_UINT64_TYPE, &original, sizeof(uint64), B_SWAP_BENDIAN_TO_HOST); parser_debug(" Still good... (%llu : %llu)\n", original, originalSize); @@ -446,25 +430,28 @@ PackageDirectory::PackageDirectory(BFile *parent, const BString &path, uint8 type, uint32 ctime, uint32 mtime, uint64 offset, uint64 size) - : PackageItem(parent, path, type, ctime, mtime, offset, size) + : + PackageItem(parent, path, type, ctime, mtime, offset, size) { } status_t -PackageDirectory::WriteToPath(const char *path, BPath *final) +PackageDirectory::WriteToPath(const char *path, ItemState *state) { - BPath destination; + BPath &destination = state->destination; status_t ret; parser_debug("Directory: %s WriteToPath() called!\n", fPath.String()); ret = InitPath(path, &destination); + parser_debug("Ret: %d %s\n", ret, strerror(ret)); if (ret != B_OK) return ret; // Since Haiku is single-user right now, we give the newly // created directory default permissions ret = create_directory(destination.Path(), kDefaultMode); + parser_debug("Create dir ret: %d %s\n", ret, strerror(ret)); if (ret != B_OK) return ret; BDirectory dir(destination.Path()); @@ -472,7 +459,7 @@ if (fCreationTime) dir.SetCreationTime(static_cast(fCreationTime)); - + if (fModificationTime) dir.SetModificationTime(static_cast(fModificationTime)); @@ -480,10 +467,8 @@ // we can check here whether it is necessary to continue if (fOffset) ret = HandleAttributes(&destination, &dir, "FoDa"); - - if (final) - *final = destination; + parser_debug("Ret: %d %s\n", ret, strerror(ret)); return ret; } @@ -502,7 +487,8 @@ uint32 ctime, uint32 mtime, uint64 offset, uint64 size, uint64 originalSize, uint32 platform, const BString &mime, const BString &signature, uint32 mode) - : PackageItem(parent, path, type, ctime, mtime, offset, size), + : + PackageItem(parent, path, type, ctime, mtime, offset, size), fOriginalSize(originalSize), fPlatform(platform), fMode(mode), @@ -513,43 +499,55 @@ status_t -PackageFile::WriteToPath(const char *path, BPath *final) +PackageFile::WriteToPath(const char *path, ItemState *state) { - BPath destination; - status_t ret; + if (state == NULL) + return B_ERROR; + + BPath &destination = state->destination; + status_t ret = B_OK; parser_debug("File: %s WriteToPath() called!\n", fPath.String()); - ret = InitPath(path, &destination); - if (ret != B_OK) - return ret; + BFile file; + if (state->status == B_NO_INIT || destination.InitCheck() != B_OK) { + ret = InitPath(path, &destination); + if (ret != B_OK) + return ret; - BFile file(destination.Path(), - B_WRITE_ONLY | B_CREATE_FILE | B_FAIL_IF_EXISTS); - ret = file.InitCheck(); - if (ret == B_FILE_EXISTS) { - int32 selection = ItemExists(destination.Leaf()); - switch (selection) { - case 0: + ret = file.SetTo(destination.Path(), + B_WRITE_ONLY | B_CREATE_FILE | B_FAIL_IF_EXISTS); + if (ret == B_ENTRY_NOT_FOUND) { + BPath directory; + destination.GetParent(&directory); + if (create_directory(directory.Path(), kDefaultMode) != B_OK) + return B_ERROR; + + ret = file.SetTo(destination.Path(), B_WRITE_ONLY | B_CREATE_FILE); + } else if (ret == B_FILE_EXISTS) + state->status = B_FILE_EXISTS; + + if (ret != B_OK) + return ret; + } + + if (state->status == B_FILE_EXISTS) { + switch (state->policy) { + case P_EXISTS_OVERWRITE: ret = file.SetTo(destination.Path(), B_WRITE_ONLY | B_ERASE_FILE); - if (ret != B_OK) - return ret; break; - case 1: + + case P_EXISTS_NONE: + case P_EXISTS_ASK: + ret = B_FILE_EXISTS; + break; + + case P_EXISTS_SKIP: return B_OK; - default: - return B_FILE_EXISTS; } - } else if (ret == B_ENTRY_NOT_FOUND) { - BPath directory; - destination.GetParent(&directory); - if (create_directory(directory.Path(), kDefaultMode) != B_OK) - return B_ERROR; + } - ret = file.SetTo(destination.Path(), B_WRITE_ONLY | B_CREATE_FILE); - if (ret != B_OK) - return ret; - } else if (ret != B_OK) + if (ret != B_OK) return ret; parser_debug(" File created!\n"); @@ -563,7 +561,7 @@ if (ret != B_OK) return ret; - + // Set the mimetype and application signature if present BNodeInfo info(&file); if (fMimeType.Length() > 0) { @@ -600,7 +598,7 @@ uint64 attrCSize = 0, attrOSize = 0; uint32 attrType = 0; // type_code type bool attrStarted = false, done = false; - + uint8 section = P_ATTRIBUTE; while (fPackage->Read(buffer, 7) == 7) { @@ -637,9 +635,6 @@ delete[] temp; } - if (final) - *final = destination; - return ret; } @@ -657,7 +652,8 @@ PackageLink::PackageLink(BFile *parent, const BString &path, const BString &link, uint8 type, uint32 ctime, uint32 mtime, uint32 mode, uint64 offset, uint64 size) - : PackageItem(parent, path, type, ctime, mtime, offset, size), + : + PackageItem(parent, path, type, ctime, mtime, offset, size), fMode(mode), fLink(link) { @@ -665,73 +661,88 @@ status_t -PackageLink::WriteToPath(const char *path, BPath *final) +PackageLink::WriteToPath(const char *path, ItemState *state) { + if (state == NULL) + return B_ERROR; + + status_t ret = B_OK; + BSymLink symlink; parser_debug("Symlink: %s WriteToPath() called!\n", fPath.String()); - BPath destination; - status_t ret = InitPath(path, &destination); - if (ret != B_OK) - return ret; + BPath &destination = state->destination; + BDirectory *dir = &state->parent; - BString linkName(destination.Leaf()); - parser_debug("%s:%s:%s\n", fPath.String(), destination.Path(), - linkName.String()); + if (state->status == B_NO_INIT || destination.InitCheck() != B_OK + || dir->InitCheck() != B_OK) { + // Not yet initialized + ret = InitPath(path, &destination); + if (ret != B_OK) + return ret; - BPath dirPath; - ret = destination.GetParent(&dirPath); - BDirectory dir(dirPath.Path()); + BString linkName(destination.Leaf()); + parser_debug("%s:%s:%s\n", fPath.String(), destination.Path(), + linkName.String()); - ret = dir.InitCheck(); - if (ret == B_ENTRY_NOT_FOUND) { - if ((ret = create_directory(dirPath.Path(), kDefaultMode)) != B_OK) { - parser_debug("create_directory()) failed\n"); - return B_ERROR; + BPath dirPath; + ret = destination.GetParent(&dirPath); + ret = dir->SetTo(dirPath.Path()); + + if (ret == B_ENTRY_NOT_FOUND) { + ret = create_directory(dirPath.Path(), kDefaultMode); + if (ret != B_OK) { + parser_debug("create_directory()) failed\n"); + return B_ERROR; + } } + if (ret != B_OK) { + parser_debug("destination InitCheck failed %s for %s\n", + strerror(ret), dirPath.Path()); + return ret; + } + + ret = dir->CreateSymLink(destination.Path(), fLink.String(), &symlink); + if (ret == B_FILE_EXISTS) { + // We need to check if the existing symlink is pointing at the same path + // as our new one - if not, let's prompt the user + symlink.SetTo(destination.Path()); + BPath oldLink; + + ret = symlink.MakeLinkedPath(dir, &oldLink); + chdir(dirPath.Path()); + + if (ret == B_BAD_VALUE || oldLink != fLink.String()) + state->status = ret = B_FILE_EXISTS; + else + ret = B_OK; + } } - if (ret != B_OK) { - parser_debug("destination InitCheck failed %s for %s\n", strerror(ret), dirPath.Path()); - return ret; - } - BSymLink symlink; - ret = dir.CreateSymLink(destination.Path(), fLink.String(), &symlink); - if (ret == B_FILE_EXISTS) { - // We need to check if the existing symlink is pointing at the same path - // as our new one - if not, let's prompt the user - symlink.SetTo(destination.Path()); - BPath oldLink; + if (state->status == B_FILE_EXISTS) { + switch (state->policy) { + case P_EXISTS_OVERWRITE: + { + BEntry entry; + ret = entry.SetTo(destination.Path()); + if (ret != B_OK) + return ret; - ret = symlink.MakeLinkedPath(&dir, &oldLink); - chdir(dirPath.Path()); + entry.Remove(); + ret = dir->CreateSymLink(destination.Path(), fLink.String(), + &symlink); + break; + } - if (ret == B_BAD_VALUE || oldLink != fLink.String()) { - // The old symlink is different (or not a symlink) - ask the user - int32 selection = ItemExists(destination.Leaf()); - switch (selection) { - case 0: - { - symlink.Unset(); - BEntry entry; - ret = entry.SetTo(destination.Path()); - if (ret != B_OK) - return ret; + case P_EXISTS_NONE: + case P_EXISTS_ASK: + ret = B_FILE_EXISTS; + break; - entry.Remove(); - ret = dir.CreateSymLink(destination.Path(), fLink.String(), - &symlink); - break; - } - case 1: - parser_debug("Skipping already existent SymLink\n"); - return B_OK; - default: - ret = B_FILE_EXISTS; - } - } else { - ret = B_OK; + case P_EXISTS_SKIP: + return B_OK; } } + if (ret != B_OK) { parser_debug("CreateSymLink failed\n"); return ret; @@ -743,7 +754,7 @@ if (fCreationTime && ret == B_OK) ret = symlink.SetCreationTime(static_cast(fCreationTime)); - + if (fModificationTime && ret == B_OK) { ret = symlink.SetModificationTime(static_cast( fModificationTime)); @@ -759,10 +770,6 @@ ret = HandleAttributes(&destination, &symlink, "LnDa"); } - if (final) { - *final = destination; - } - return ret; } Modified: haiku/trunk/src/apps/packageinstaller/PackageItem.h =================================================================== --- haiku/trunk/src/apps/packageinstaller/PackageItem.h 2009-08-06 13:09:30 UTC (rev 32160) +++ haiku/trunk/src/apps/packageinstaller/PackageItem.h 2009-08-06 15:00:52 UTC (rev 32161) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Haiku, Inc. + * Copyright 2007-2009, Haiku, Inc. * Distributed under the terms of the MIT license. * * Author: @@ -11,6 +11,7 @@ #include +#include #include #include #include @@ -32,10 +33,38 @@ P_USER_PATH }; +// Existing item overwriting policy of a single file +enum { + P_EXISTS_ASK = 0, + P_EXISTS_OVERWRITE, + P_EXISTS_SKIP, + P_EXISTS_ABORT, + P_EXISTS_NONE +}; + extern status_t inflate_data(uint8* in, uint32 inSize, uint8* out, uint32 outSize); +struct ItemState { + ItemState() : policy(P_EXISTS_NONE), status(B_NO_INIT) {} + ~ItemState() {} + + inline void Reset(int32 currentPolicy) + { + destination.Unset(); + parent.Unset(); + status = B_NO_INIT; + policy = currentPolicy; + } + + BPath destination; + BDirectory parent; + uint8 policy; + status_t status; +}; + + class PackageItem { public: PackageItem(BFile* parent, const BString& path, @@ -44,16 +73,15 @@ virtual ~PackageItem(); virtual status_t WriteToPath(const char* path = NULL, - BPath* final = NULL) = 0; + ItemState *state = NULL) = 0; virtual void SetTo(BFile* parent, const BString& path, uint8 type, uint32 ctime, uint32 mtime, uint64 offset = 0, uint64 size = 0); + virtual const char* ItemKind() = 0; protected: - virtual const char* ItemKind() = 0; - int32 ItemExists(const char* name); status_t InitPath(const char* path, BPath* destination); - status_t HandleAttributes(BPath* destination, BNode* node, + status_t HandleAttributes(BPath* destination, BNode* node, const char* header); status_t ParseAttribute(uint8* buffer, BNode* node, @@ -84,9 +112,7 @@ uint64 offset = 0, uint64 size = 0); virtual status_t WriteToPath(const char* path = NULL, - BPath* final = NULL); - -protected: + ItemState *state = NULL); virtual const char* ItemKind(); }; @@ -100,16 +126,14 @@ const BString& signature, uint32 mode); virtual status_t WriteToPath(const char* path = NULL, - BPath* final = NULL); - -protected: + ItemState *state = NULL); virtual const char* ItemKind(); private: uint64 fOriginalSize; uint32 fPlatform; uint32 fMode; - + BString fMimeType; BString fSignature; }; @@ -119,13 +143,11 @@ public: PackageLink(BFile* parent, const BString& path, const BString& link, uint8 type, uint32 ctime, - uint32 mtime, uint32 mode, uint64 offset = 0, + uint32 mtime, uint32 mode, uint64 offset = 0, uint64 size = 0); virtual status_t WriteToPath(const char* path = NULL, - BPath* final = NULL); - -protected: + ItemState *state = NULL); virtual const char* ItemKind(); private: Modified: haiku/trunk/src/apps/packageinstaller/PackageView.cpp =================================================================== --- haiku/trunk/src/apps/packageinstaller/PackageView.cpp 2009-08-06 13:09:30 UTC (rev 32160) +++ haiku/trunk/src/apps/packageinstaller/PackageView.cpp 2009-08-06 15:00:52 UTC (rev 32161) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Haiku, Inc. + * Copyright 2007-2009, Haiku, Inc. * Distributed under the terms of the MIT license. * * Author: @@ -69,7 +69,7 @@ // Check whether the package has been successfuly parsed status_t ret = fInfo.InitCheck(); - if (ret == B_OK) + if (ret == B_OK) _InitProfiles(); ResizeTo(Bounds().Width(), fInstall->Frame().bottom + 4); @@ -129,7 +129,7 @@ PackageImageViewer *imageViewer = new PackageImageViewer(image); imageViewer->Go(); } - + // Show the disclaimer/info text popup, if present BString disclaimer = fInfo.GetDisclaimer(); if (disclaimer.Length() != 0) { @@ -175,14 +175,14 @@ notify = new BAlert("installation_failed", // TODO: Review this T("The requested package failed to install on your system. This " "might be a problem with the target package file. Please consult " - "this issue with the package distributor."), T("OK"), NULL, + "this issue with the package distributor."), T("OK"), NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT); fprintf(stderr, "Error while installing the package : %s\n", strerror(ret)); } notify->Go(); fStatusWindow->Hide(); fInstall->SetEnabled(true); - + break; } case P_MSG_PATH_CHANGED: @@ -196,7 +196,7 @@ case P_MSG_OPEN_PANEL: fOpenPanel->Show(); break; - case P_MSG_GROUP_CHANGED: + case P_MSG_GROUP_CHANGED: { int32 index; if (msg->FindInt32("index", &index) == B_OK) { @@ -267,7 +267,7 @@ T("The given package seems to be already installed on your system. " "Would you like to uninstall the existing one and continue the " "installation?"), T("Yes"), T("No")); - + if (reinstall->Go() == 0) { // Uninstall the package err = packageInfo.Uninstall(); @@ -305,10 +305,11 @@ // Install files and directories PackageItem *iter; - BPath installedTo; + ItemState state; uint32 i; + int32 choice; BString label; - + packageInfo.SetName(fInfo.GetName()); // TODO: Here's a small problem, since right now it's not quite sure // which description is really used as such. The one displayed on @@ -322,20 +323,35 @@ packageInfo.SetDescription(description.String()); packageInfo.SetSpaceNeeded(type->space_needed); + fItemExistsPolicy = P_EXISTS_NONE; + for (i = 0; i < n; i++) { + state.Reset(fItemExistsPolicy); // Reset the current item state iter = static_cast(type->items.ItemAt(i)); - err = iter->WriteToPath(fCurrentPath.Path(), &installedTo); + + err = iter->WriteToPath(fCurrentPath.Path(), &state); + if (err == B_FILE_EXISTS) { + // Writing to path failed because path already exists - ask the user + // what to do and retry the writing process + choice = _ItemExists(*iter, state.destination); + if (choice != P_EXISTS_ABORT) { + state.policy = choice; + err = iter->WriteToPath(fCurrentPath.Path(), &state); + } + } + if (err != B_OK) { fprintf(stderr, "Error while writing path %s\n", fCurrentPath.Path()); return err; } + if (fStatusWindow->Stopped()) return B_FILE_EXISTS; label = ""; label << (uint32)(i + 1) << " of " << (uint32)n; fStatusWindow->StageStep(1, NULL, label.String()); - packageInfo.AddItem(installedTo.Path()); + packageInfo.AddItem(state.destination.Path()); } fStatusWindow->StageStep(1, "Finishing installation", ""); @@ -355,7 +371,7 @@ PackageView::_InitView() { SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); - + BTextView *description = new BTextView(BRect(0, 0, 20, 20), "description", BRect(4, 4, 16, 16), B_FOLLOW_NONE, B_WILL_DRAW); description->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); @@ -370,15 +386,15 @@ installType->SetAlignment(B_ALIGN_RIGHT); installType->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, B_ALIGN_MIDDLE)); - fInstallDesc = new BTextView(BRect(0, 0, 10, 10), "install_desc", + fInstallDesc = new BTextView(BRect(0, 0, 10, 10), "install_desc", BRect(2, 2, 8, 8), B_FOLLOW_NONE, B_WILL_DRAW); fInstallDesc->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); fInstallDesc->MakeEditable(false); fInstallDesc->MakeSelectable(false); fInstallDesc->SetText(T("No installation type selected")); fInstallDesc->TextHeight(0, fInstallDesc->TextLength()); - - fInstall = new BButton("install_button", T("Install"), + + fInstall = new BButton("install_button", T("Install"), new BMessage(P_MSG_INSTALL)); BView *installField = BGroupLayoutBuilder(B_VERTICAL, 5.0f) @@ -400,7 +416,7 @@ .End(); AddChild(root); - + fInstall->MakeDefault(true); }*/ @@ -409,7 +425,7 @@ PackageView::_InitView() { SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); - + BRect rect = Bounds(); BTextView *description = new BTextView(rect, "description", rect.InsetByCopy(5, 5), B_FOLLOW_NONE, B_WILL_DRAW); @@ -424,7 +440,7 @@ description->ResizeTo(rect.Width() - B_V_SCROLL_BAR_WIDTH, kMaxDescHeight); BScrollView *scroller = new BScrollView("desciption_view", description, B_FOLLOW_NONE, B_WILL_DRAW | B_FRAME_EVENTS, false, true, B_NO_BORDER); - + AddChild(scroller); rect = scroller->Frame(); } @@ -433,24 +449,24 @@ AddChild(description); rect = description->Frame(); } - + rect.top = rect.bottom + 2; rect.bottom += 100; BBox *installBox = new BBox(rect.InsetByCopy(2, 2), "install_box"); fInstallTypes = new BPopUpMenu("none"); - + BMenuField *installType = new BMenuField(BRect(2, 2, 100, 50), "install_type", T("Installation type:"), fInstallTypes, false); installType->SetDivider(installType->StringWidth(installType->Label()) + 8); installType->SetAlignment(B_ALIGN_RIGHT); installType->ResizeToPreferred(); - + installBox->AddChild(installType); - + rect = installBox->Bounds().InsetBySelf(4, 4); rect.top = installType->Frame().bottom; - fInstallDesc = new BTextView(rect, "install_desc", + fInstallDesc = new BTextView(rect, "install_desc", BRect(2, 2, rect.Width() - 2, rect.Height() - 2), B_FOLLOW_NONE, B_WILL_DRAW); fInstallDesc->MakeEditable(false); @@ -461,28 +477,28 @@ fInstallDesc->ResizeTo(rect.Width() - B_V_SCROLL_BAR_WIDTH, 60); BScrollView *scroller = new BScrollView("desciption_view", fInstallDesc, B_FOLLOW_NONE, B_WILL_DRAW | B_FRAME_EVENTS, false, true, B_NO_BORDER); - + installBox->ResizeTo(installBox->Bounds().Width(), scroller->Frame().bottom + 10); installBox->AddChild(scroller); - + AddChild(installBox); - + fDestination = new BPopUpMenu("none"); - + rect = installBox->Frame(); rect.top = rect.bottom + 5; rect.bottom += 35; - fDestField = new BMenuField(rect, "install_to", T("Install to:"), + fDestField = new BMenuField(rect, "install_to", T("Install to:"), fDestination, false); fDestField->SetDivider(fDestField->StringWidth(fDestField->Label()) + 8); fDestField->SetAlignment(B_ALIGN_RIGHT); fDestField->ResizeToPreferred(); - + AddChild(fDestField); - - fInstall = new BButton(rect, "install_button", T("Install"), + + fInstall = new BButton(rect, "install_button", T("Install"), new BMessage(P_MSG_INSTALL)); fInstall->ResizeToPreferred(); AddChild(fInstall); @@ -506,7 +522,7 @@ prof = fInfo.GetProfile(0); convert_size(prof->space_needed, sizeString, 32); name << prof->name << " (" << sizeString << ")"; - + message = new BMessage(P_MSG_GROUP_CHANGED); message->AddInt32("index", 0); item = new BMenuItem(name.String(), message); @@ -517,12 +533,12 @@ for (i = 1; i < num; i++) { prof = fInfo.GetProfile(i); - + if (prof) { convert_size(prof->space_needed, sizeString, 32); name = prof->name; name << " (" << sizeString << ")"; - + message = new BMessage(P_MSG_GROUP_CHANGED); message->AddInt32("index", i); item = new BMenuItem(name.String(), message); @@ -534,6 +550,68 @@ } +int32 +PackageView::_ItemExists(PackageItem &item, BPath &path) +{ + int32 choice = P_EXISTS_NONE; + + switch (fItemExistsPolicy) { + case P_EXISTS_OVERWRITE: + choice = P_EXISTS_OVERWRITE; + break; + + case P_EXISTS_SKIP: + choice = P_EXISTS_SKIP; + break; + + case P_EXISTS_ASK: + case P_EXISTS_NONE: + { + BString alertString = T("The "); + + alertString << item.ItemKind() << T(" named \'") << path.Leaf() << "\' "; + alertString << T("already exists in the given path. Should the " + "existing file be replaced with the one from this package?"); + + BAlert *alert = new BAlert(T("file_exists"), alertString.String(), + T("Yes"), T("No"), T("Abort")); + + choice = alert->Go(); + switch (choice) { + case 0: + choice = P_EXISTS_OVERWRITE; + break; + case 1: + choice = P_EXISTS_SKIP; + break; + default: + return P_EXISTS_ABORT; + } + + if (fItemExistsPolicy == P_EXISTS_NONE) { + // TODO: Maybe add 'No, but ask again' type of choice as well? + alertString = T("Should this decision be remembered and all " + "existing files encountered in the future be "); + alertString << ((choice == P_EXISTS_OVERWRITE) + ? T("replaced?") : T("skipped?")); + + alert = new BAlert(T("policy_decision"), alertString.String(), + T("Yes"), T("No")); + + int32 decision = alert->Go(); + if (decision == 0) + fItemExistsPolicy = choice; + else + fItemExistsPolicy = P_EXISTS_ASK; + } + break; + } + } + + return choice; +} + + status_t PackageView::_GroupChanged(int32 index) { @@ -559,7 +637,7 @@ BPath path; BMessage *temp; BVolume volume; - + if (prof->path_type == P_INSTALL_PATH) { dev_t device; BString name; @@ -570,7 +648,7 @@ if (volume.SetTo(device) == B_OK && !volume.IsReadOnly()) { temp = new BMessage(P_MSG_PATH_CHANGED); temp->AddString("path", BString(path.Path())); - + convert_size(volume.FreeBytes(), sizeString, 32); name = path.Path(); name << " (" << sizeString << " free)"; Modified: haiku/trunk/src/apps/packageinstaller/PackageView.h =================================================================== --- haiku/trunk/src/apps/packageinstaller/PackageView.h 2009-08-06 13:09:30 UTC (rev 32160) +++ haiku/trunk/src/apps/packageinstaller/PackageView.h 2009-08-06 15:00:52 UTC (rev 32161) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Haiku, Inc. [... truncated: 28 lines follow ...] From pulkomandy at mail.berlios.de Thu Aug 6 17:18:50 2009 From: pulkomandy at mail.berlios.de (pulkomandy at BerliOS) Date: Thu, 6 Aug 2009 17:18:50 +0200 Subject: [Haiku-commits] r32162 - haiku/branches/components/gsoc-locale-kit/src/kits/locale Message-ID: <200908061518.n76FIoHl007748@sheep.berlios.de> Author: pulkomandy Date: 2009-08-06 17:18:49 +0200 (Thu, 06 Aug 2009) New Revision: 32162 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32162&view=rev Modified: haiku/branches/components/gsoc-locale-kit/src/kits/locale/Country.cpp Log: Some more variable renaming. Modified: haiku/branches/components/gsoc-locale-kit/src/kits/locale/Country.cpp =================================================================== --- haiku/branches/components/gsoc-locale-kit/src/kits/locale/Country.cpp 2009-08-06 15:00:52 UTC (rev 32161) +++ haiku/branches/components/gsoc-locale-kit/src/kits/locale/Country.cpp 2009-08-06 15:18:49 UTC (rev 32162) @@ -77,8 +77,8 @@ UnicodeString uString; fICULocale.getDisplayName(uString); BString str; - BStringByteSink bbs(&str); - uString.toUTF8(bbs); + BStringByteSink stringConverter(&str); + uString.toUTF8(stringConverter); return str.String(); } @@ -118,12 +118,12 @@ longFormat ? DateFormat::FULL : DateFormat::SHORT, fICULocale); UnicodeString ICUString; - ICUString = dateFormatter->format((UDate)time*1000, ICUString); + ICUString = dateFormatter->format((UDate)time * 1000, ICUString); string->Truncate(0); - BStringByteSink bbs(string); + BStringByteSink stringConverter(string); - ICUString.toUTF8(bbs); + ICUString.toUTF8(stringConverter); } @@ -143,12 +143,12 @@ longFormat ? DateFormat::FULL : DateFormat::SHORT, fICULocale); UnicodeString ICUString; - ICUString = timeFormatter->format((UDate)time*1000, ICUString); + ICUString = timeFormatter->format((UDate)time * 1000, ICUString); string->Truncate(0); - BStringByteSink bbs(string); + BStringByteSink stringConverter(string); - ICUString.toUTF8(bbs); + ICUString.toUTF8(stringConverter); } @@ -199,9 +199,9 @@ ICUString = numberFormatter->format(value, ICUString); string->Truncate(0); - BStringByteSink bbs(string); + BStringByteSink stringConverter(string); - ICUString.toUTF8(bbs); + ICUString.toUTF8(stringConverter); } @@ -224,9 +224,9 @@ ICUString = numberFormatter->format((int32_t)value, ICUString); string->Truncate(0); - BStringByteSink bbs(string); + BStringByteSink stringConverter(string); - ICUString.toUTF8(bbs); + ICUString.toUTF8(stringConverter); } @@ -252,9 +252,9 @@ ICUString = syms->getSymbol(DecimalFormatSymbols::kDecimalSeparatorSymbol); BString string; - BStringByteSink bbs(&string); + BStringByteSink stringConverter(&string); - ICUString.toUTF8(bbs); + ICUString.toUTF8(stringConverter); return string.String(); } @@ -279,9 +279,9 @@ ICUString = syms->getSymbol(DecimalFormatSymbols::kPatternSeparatorSymbol); BString string; - BStringByteSink bbs(&string); + BStringByteSink stringConverter(&string); - ICUString.toUTF8(bbs); + ICUString.toUTF8(stringConverter); return string.String(); } @@ -306,9 +306,9 @@ ICUString = syms->getSymbol(DecimalFormatSymbols::kGroupingSeparatorSymbol); BString string; - BStringByteSink bbs(&string); + BStringByteSink stringConverter(&string); - ICUString.toUTF8(bbs); + ICUString.toUTF8(stringConverter); return string.String(); } @@ -333,9 +333,9 @@ ICUString = syms->getSymbol(DecimalFormatSymbols::kPlusSignSymbol); BString string; - BStringByteSink bbs(&string); + BStringByteSink stringConverter(&string); - ICUString.toUTF8(bbs); + ICUString.toUTF8(stringConverter); return string.String(); } @@ -360,9 +360,9 @@ ICUString = syms->getSymbol(DecimalFormatSymbols::kMinusSignSymbol); BString string; - BStringByteSink bbs(&string); + BStringByteSink stringConverter(&string); - ICUString.toUTF8(bbs); + ICUString.toUTF8(stringConverter); return string.String(); } @@ -402,9 +402,9 @@ ICUString = numberFormatter->format(value, ICUString); string->Truncate(0); - BStringByteSink bbs(string); + BStringByteSink stringConverter(string); - ICUString.toUTF8(bbs); + ICUString.toUTF8(stringConverter); return B_OK; } @@ -429,9 +429,9 @@ ICUString = syms->getSymbol(DecimalFormatSymbols::kCurrencySymbol); BString string; - BStringByteSink bbs(&string); + BStringByteSink stringConverter(&string); - ICUString.toUTF8(bbs); + ICUString.toUTF8(stringConverter); return string.String(); } @@ -456,9 +456,9 @@ ICUString = syms->getSymbol(DecimalFormatSymbols::kIntlCurrencySymbol); BString string; - BStringByteSink bbs(&string); + BStringByteSink stringConverter(&string); - ICUString.toUTF8(bbs); + ICUString.toUTF8(stringConverter); return string.String(); } @@ -483,9 +483,9 @@ ICUString = syms->getSymbol(DecimalFormatSymbols::kMonetarySeparatorSymbol); BString string; - BStringByteSink bbs(&string); + BStringByteSink stringConverter(&string); - ICUString.toUTF8(bbs); + ICUString.toUTF8(stringConverter); return string.String(); } @@ -510,9 +510,9 @@ ICUString = syms->getSymbol(DecimalFormatSymbols::kPatternSeparatorSymbol); BString string; - BStringByteSink bbs(&string); + BStringByteSink stringConverter(&string); - ICUString.toUTF8(bbs); + ICUString.toUTF8(stringConverter); return string.String(); } @@ -538,9 +538,9 @@ DecimalFormatSymbols::kMonetaryGroupingSeparatorSymbol); BString string; - BStringByteSink bbs(&string); + BStringByteSink stringConverter(&string); - ICUString.toUTF8(bbs); + ICUString.toUTF8(stringConverter); return string.String(); } From pulkomandy at mail.berlios.de Thu Aug 6 17:56:05 2009 From: pulkomandy at mail.berlios.de (pulkomandy at BerliOS) Date: Thu, 6 Aug 2009 17:56:05 +0200 Subject: [Haiku-commits] r32163 - in haiku/branches/components/gsoc-locale-kit: headers/os/locale src/kits/locale Message-ID: <200908061556.n76Fu5Wg020471@sheep.berlios.de> Author: pulkomandy Date: 2009-08-06 17:56:04 +0200 (Thu, 06 Aug 2009) New Revision: 32163 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32163&view=rev Modified: haiku/branches/components/gsoc-locale-kit/headers/os/locale/Country.h haiku/branches/components/gsoc-locale-kit/headers/os/locale/LocaleStrings.h haiku/branches/components/gsoc-locale-kit/src/kits/locale/Country.cpp Log: Added char* versions of the methods in BCountry and some more things for returning the format string for date & time. Modified: haiku/branches/components/gsoc-locale-kit/headers/os/locale/Country.h =================================================================== --- haiku/branches/components/gsoc-locale-kit/headers/os/locale/Country.h 2009-08-06 15:18:49 UTC (rev 32162) +++ haiku/branches/components/gsoc-locale-kit/headers/os/locale/Country.h 2009-08-06 15:56:04 UTC (rev 32163) @@ -61,8 +61,8 @@ // monetary - virtual ssize_t FormatMonetary(char *string,size_t maxSize,char *format, - ...); + virtual ssize_t FormatMonetary(char *string, size_t maxSize, + double value); virtual ssize_t FormatMonetary(BString *string, double value); const char *CurrencySymbol() const; @@ -72,9 +72,6 @@ const char *MonGrouping() const; virtual int32 MonFracDigits() const; - protected: - BCountry(const char **strings); - private: const char **fStrings; Locale fICULocale; Modified: haiku/branches/components/gsoc-locale-kit/headers/os/locale/LocaleStrings.h =================================================================== --- haiku/branches/components/gsoc-locale-kit/headers/os/locale/LocaleStrings.h 2009-08-06 15:18:49 UTC (rev 32162) +++ haiku/branches/components/gsoc-locale-kit/headers/os/locale/LocaleStrings.h 2009-08-06 15:56:04 UTC (rev 32163) @@ -6,13 +6,9 @@ B_COUNTRY_STRINGS_BASE = 0, B_DATE_TIME_FORMAT = B_COUNTRY_STRINGS_BASE, - B_DATE_FORMAT, - B_TIME_FORMAT, B_TIME_AM_PM_FORMAT, B_SHORT_DATE_TIME_FORMAT, - B_SHORT_DATE_FORMAT, - B_SHORT_TIME_FORMAT, B_SHORT_TIME_AM_PM_FORMAT, B_AM_STRING, Modified: haiku/branches/components/gsoc-locale-kit/src/kits/locale/Country.cpp =================================================================== --- haiku/branches/components/gsoc-locale-kit/src/kits/locale/Country.cpp 2009-08-06 15:18:49 UTC (rev 32162) +++ haiku/branches/components/gsoc-locale-kit/src/kits/locale/Country.cpp 2009-08-06 15:56:04 UTC (rev 32163) @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -24,13 +25,9 @@ // date/time format "", "", - "", - "", // short date/time format "", "", - "", - "", // am/pm string "AM", "PM", @@ -58,14 +55,6 @@ } -// TODO should not exist -BCountry::BCountry(const char **strings) - : - fStrings(strings) -{ -} - - BCountry::~BCountry() { } @@ -104,7 +93,9 @@ void BCountry::FormatDate(char *string, size_t maxSize, time_t time, bool longFormat) { - // ToDo: implement us + BString fullString; + FormatDate(&fullString, time, longFormat); + strncpy(string, fullString.String(), maxSize); } @@ -130,6 +121,9 @@ void BCountry::FormatTime(char *string, size_t maxSize, time_t time, bool longFormat) { + BString fullString; + FormatTime(&fullString, time, longFormat); + strncpy(string, fullString.String(), maxSize); } @@ -155,17 +149,50 @@ const char * BCountry::DateFormat(bool longFormat) const { - return fStrings[longFormat ? B_DATE_FORMAT : B_SHORT_DATE_FORMAT]; + icu_4_2::DateFormat* dateFormatter; + dateFormatter = DateFormat::createDateInstance( + longFormat ? DateFormat::FULL : DateFormat::SHORT, + fICULocale); + SimpleDateFormat* dateFormatterImpl = + static_cast(dateFormatter); + + UnicodeString ICUString; + ICUString = dateFormatterImpl->toPattern(ICUString); + + BString string; + BStringByteSink stringConverter(&string); + + ICUString.toUTF8(stringConverter); + + return string.String(); } const char * BCountry::TimeFormat(bool longFormat) const { - return fStrings[longFormat ? B_TIME_FORMAT : B_SHORT_TIME_FORMAT]; + icu_4_2::DateFormat* dateFormatter; + dateFormatter = DateFormat::createTimeInstance( + longFormat ? DateFormat::FULL : DateFormat::SHORT, + fICULocale); + SimpleDateFormat* dateFormatterImpl = + static_cast(dateFormatter); + + UnicodeString ICUString; + ICUString = dateFormatterImpl->toPattern(ICUString); + + BString string; + BStringByteSink stringConverter(&string); + + ICUString.toUTF8(stringConverter); + + return string.String(); } +// TODO find how to get it from ICU (setting it is ok, we use the pattern-string +// for that) +// Or remove this function ? const char * BCountry::DateSeparator() const { @@ -183,6 +210,9 @@ void BCountry::FormatNumber(char *string, size_t maxSize, double value) { + BString fullString; + FormatNumber(&fullString, value); + strncpy(string, fullString.String(), maxSize); } @@ -208,6 +238,9 @@ void BCountry::FormatNumber(char *string, size_t maxSize, int32 value) { + BString fullString; + FormatNumber(&fullString, value); + strncpy(string, fullString.String(), maxSize); } @@ -368,6 +401,7 @@ } +// TODO does ICU even support this ? Is it in the keywords ? int8 BCountry::Measurement() const { @@ -376,16 +410,11 @@ ssize_t -BCountry::FormatMonetary(char *string, size_t maxSize, char *format, ...) +BCountry::FormatMonetary(char *string, size_t maxSize, double value) { - va_list args; - va_start(args,format); - - ssize_t status = vstrfmon(string, maxSize, format, args); - - va_end(args); - - return status; + BString fullString; + FormatMonetary(&fullString, value); + strncpy(string, fullString.String(), maxSize); } @@ -546,6 +575,7 @@ } +// TODO: is this possible to get from ICU ? int32 BCountry::MonFracDigits() const { From mmu_man at mail.berlios.de Thu Aug 6 18:04:21 2009 From: mmu_man at mail.berlios.de (mmu_man at mail.berlios.de) Date: Thu, 6 Aug 2009 18:04:21 +0200 Subject: [Haiku-commits] r32164 - haiku/trunk/src/bin/network/mount_nfs Message-ID: <200908061604.n76G4L7q023930@sheep.berlios.de> Author: mmu_man Date: 2009-08-06 18:04:20 +0200 (Thu, 06 Aug 2009) New Revision: 32164 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32164&view=rev Modified: haiku/trunk/src/bin/network/mount_nfs/mount_nfs.cpp Log: Better give the good len. Modified: haiku/trunk/src/bin/network/mount_nfs/mount_nfs.cpp =================================================================== --- haiku/trunk/src/bin/network/mount_nfs/mount_nfs.cpp 2009-08-06 15:56:04 UTC (rev 32163) +++ haiku/trunk/src/bin/network/mount_nfs/mount_nfs.cpp 2009-08-06 16:04:20 UTC (rev 32164) @@ -105,7 +105,7 @@ params.gid, params.hostname); - int result=mount ("nfs",argv[2],NULL,0,buf,sizeof(params)); + int result=mount ("nfs",argv[2],NULL,0,buf,strlen(buf)); //int result=mount ("nfs",argv[2],NULL,0,¶ms,sizeof(params)); delete[] server; From mmu_man at mail.berlios.de Thu Aug 6 18:36:42 2009 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Thu, 6 Aug 2009 18:36:42 +0200 Subject: [Haiku-commits] r32165 - haiku/trunk/src/add-ons/media/media-add-ons Message-ID: <200908061636.n76Gag5J008411@sheep.berlios.de> Author: mmu_man Date: 2009-08-06 18:36:32 +0200 (Thu, 06 Aug 2009) New Revision: 32165 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32165&view=rev Modified: haiku/trunk/src/add-ons/media/media-add-ons/Jamfile Log: Alpha sort. Modified: haiku/trunk/src/add-ons/media/media-add-ons/Jamfile =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/Jamfile 2009-08-06 16:04:20 UTC (rev 32164) +++ haiku/trunk/src/add-ons/media/media-add-ons/Jamfile 2009-08-06 16:36:32 UTC (rev 32165) @@ -4,6 +4,7 @@ # SubInclude HAIKU_TOP src add-ons media media-add-ons writer ; SubInclude HAIKU_TOP src add-ons media media-add-ons dvb ; SubInclude HAIKU_TOP src add-ons media media-add-ons esound_sink ; +SubInclude HAIKU_TOP src add-ons media media-add-ons firewire_dv ; SubInclude HAIKU_TOP src add-ons media media-add-ons legacy ; SubInclude HAIKU_TOP src add-ons media media-add-ons mixer ; SubInclude HAIKU_TOP src add-ons media media-add-ons multi_audio ; @@ -15,5 +16,4 @@ SubInclude HAIKU_TOP src add-ons media media-add-ons usb_webcam ; SubInclude HAIKU_TOP src add-ons media media-add-ons video_producer_demo ; SubInclude HAIKU_TOP src add-ons media media-add-ons videowindow ; -SubInclude HAIKU_TOP src add-ons media media-add-ons firewire_dv ; From jackburton at mail.berlios.de Thu Aug 6 19:05:45 2009 From: jackburton at mail.berlios.de (jackburton at mail.berlios.de) Date: Thu, 6 Aug 2009 19:05:45 +0200 Subject: [Haiku-commits] r32166 - haiku/trunk/src/add-ons/translators/jpeg2000 Message-ID: <200908061705.n76H5j3I013759@sheep.berlios.de> Author: jackburton Date: 2009-08-06 19:05:42 +0200 (Thu, 06 Aug 2009) New Revision: 32166 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32166&view=rev Modified: haiku/trunk/src/add-ons/translators/jpeg2000/JPEG2000Translator.cpp haiku/trunk/src/add-ons/translators/jpeg2000/JPEG2000Translator.h Log: Applied the logic in r31871 to jpeg2000 translator too. Fixes bug #4139. Also cleaned up. Modified: haiku/trunk/src/add-ons/translators/jpeg2000/JPEG2000Translator.cpp =================================================================== --- haiku/trunk/src/add-ons/translators/jpeg2000/JPEG2000Translator.cpp 2009-08-06 16:36:32 UTC (rev 32165) +++ haiku/trunk/src/add-ons/translators/jpeg2000/JPEG2000Translator.cpp 2009-08-06 17:05:42 UTC (rev 32166) @@ -81,9 +81,7 @@ {}, }; -bool gAreSettingsRunning = false; - //! Make settings to defaults void LoadDefaultSettings(jpeg_settings *settings) @@ -569,12 +567,9 @@ // #pragma mark - SView -SView::SView(const char *name, float x, float y) - : BView(BRect(x, y, x, y), name, B_FOLLOW_NONE, B_WILL_DRAW) +SView::SView(BRect frame, const char *name) + : BView(frame, name, B_FOLLOW_NONE, B_WILL_DRAW) { - fPreferredWidth = 0; - fPreferredHeight = 0; - SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); SetLowColor(ViewColor()); @@ -583,44 +578,13 @@ void -SView::GetPreferredSize(float* _width, float* _height) +SView::AttachedToWindow() { - if (_width) - *_width = fPreferredWidth; - if (_height) - *_height = fPreferredHeight; + BView::AttachedToWindow(); + ResizeTo(Parent()->Bounds().Width(), Parent()->Bounds().Height()); } -void -SView::ResizeToPreferred() -{ - ResizeTo(fPreferredWidth, fPreferredHeight); -} - - -void -SView::ResizePreferredBy(float width, float height) -{ - fPreferredWidth += width; - fPreferredHeight += height; -} - - -void -SView::AddChild(BView *child, BView *before) -{ - BView::AddChild(child, before); - child->ResizeToPreferred(); - BRect frame = child->Frame(); - - if (frame.right > fPreferredWidth) - fPreferredWidth = frame.right; - if (frame.bottom > fPreferredHeight) - fPreferredHeight = frame.bottom; -} - - // #pragma mark - @@ -662,27 +626,26 @@ // #pragma mark - -TranslatorReadView::TranslatorReadView(const char *name, jpeg_settings *settings, - float x, float y) - : SView(name, x, y), +TranslatorReadView::TranslatorReadView(BRect frame, const char *name, + jpeg_settings *settings) + : SView(frame, name), fSettings(settings) { - fGrayAsRGB32 = new BCheckBox(BRect(10, GetPreferredHeight(), 10, - GetPreferredHeight()), "grayasrgb32", VIEW_LABEL_GRAYASRGB32, - new BMessage(VIEW_MSG_SET_GRAYASRGB32)); + fGrayAsRGB32 = new BCheckBox(BRect(10, 10, 40, 40), "grayasrgb32", + VIEW_LABEL_GRAYASRGB32, new BMessage(VIEW_MSG_SET_GRAYASRGB32)); fGrayAsRGB32->SetFont(be_plain_font); if (fSettings->B_GRAY8_as_B_RGB32) fGrayAsRGB32->SetValue(1); AddChild(fGrayAsRGB32); - - ResizeToPreferred(); + fGrayAsRGB32->ResizeToPreferred(); } void TranslatorReadView::AttachedToWindow() { + SView::AttachedToWindow(); fGrayAsRGB32->SetTarget(this); } @@ -710,46 +673,53 @@ // #pragma mark - TranslatorWriteView -TranslatorWriteView::TranslatorWriteView(const char *name, jpeg_settings *settings, - float x, float y) - : SView(name, x, y), +TranslatorWriteView::TranslatorWriteView(BRect frame, const char *name, + jpeg_settings *settings) + : SView(frame, name), fSettings(settings) { - fQualitySlider = new SSlider(BRect(10, GetPreferredHeight(), 10, - GetPreferredHeight()), "quality", VIEW_LABEL_QUALITY, - new BMessage(VIEW_MSG_SET_QUALITY), 0, 100); + BRect rect(10, 10, 10, 40); + fQualitySlider = new SSlider(rect, "quality", + VIEW_LABEL_QUALITY, new BMessage(VIEW_MSG_SET_QUALITY), 0, 100); fQualitySlider->SetHashMarks(B_HASH_MARKS_BOTTOM); fQualitySlider->SetHashMarkCount(10); fQualitySlider->SetLimitLabels("Low", "High"); fQualitySlider->SetFont(be_plain_font); fQualitySlider->SetValue(fSettings->Quality); AddChild(fQualitySlider); + fQualitySlider->ResizeToPreferred(); - fGrayAsRGB24 = new BCheckBox(BRect(10, GetPreferredHeight() + 5, 25, - GetPreferredHeight() + 5), "gray1asrgb24", VIEW_LABEL_GRAY1ASRGB24, + rect.OffsetBy(0, fQualitySlider->Bounds().Height() + 10); + + fGrayAsRGB24 = new BCheckBox(rect, "gray1asrgb24", + VIEW_LABEL_GRAY1ASRGB24, new BMessage(VIEW_MSG_SET_GRAY1ASRGB24)); fGrayAsRGB24->SetFont(be_plain_font); if (fSettings->B_GRAY1_as_B_RGB24) fGrayAsRGB24->SetValue(1); AddChild(fGrayAsRGB24); + fGrayAsRGB24->ResizeToPreferred(); - fCodeStreamOnly = new BCheckBox(BRect(10, GetPreferredHeight() + 5, 10, - GetPreferredHeight()), "codestreamonly", VIEW_LABEL_JPC, - new BMessage(VIEW_MSG_SET_JPC)); + rect.OffsetBy(0, fGrayAsRGB24->Bounds().Height() + 10); + + fCodeStreamOnly = new BCheckBox(rect, "codestreamonly", + VIEW_LABEL_JPC, new BMessage(VIEW_MSG_SET_JPC)); fCodeStreamOnly->SetFont(be_plain_font); if (fSettings->JPC) fCodeStreamOnly->SetValue(1); AddChild(fCodeStreamOnly); - - ResizeToPreferred(); + + fCodeStreamOnly->ResizeToPreferred(); } void TranslatorWriteView::AttachedToWindow() { + SView::AttachedToWindow(); + fQualitySlider->SetTarget(this); fGrayAsRGB24->SetTarget(this); fCodeStreamOnly->SetTarget(this); @@ -797,14 +767,15 @@ // #pragma mark - -TranslatorAboutView::TranslatorAboutView(const char *name, float x, float y) - : SView(name, x, y) +TranslatorAboutView::TranslatorAboutView(BRect frame, const char *name) + : SView(frame, name) { BStringView *title = new BStringView(BRect(10, 0, 10, 0), "Title", translatorName); title->SetFont(be_bold_font); AddChild(title); + title->ResizeToPreferred(); BRect rect = title->Bounds(); float space = title->StringWidth(" "); @@ -822,7 +793,10 @@ version->MoveBy(0, rect.bottom-version->Frame().bottom); AddChild(version); - + + version->ResizeToPreferred(); + + BRect stringFrame = title->Frame(); // Now for each line in translatorInfo add a BStringView char* current = translatorInfo; int32 index = 1; @@ -837,71 +811,40 @@ newLine + 1 - current)); current = newLine + 1; } - - BStringView* string = new BStringView(BRect(10, GetPreferredHeight(), - 10, GetPreferredHeight()), "copyright", text); + + stringFrame.OffsetBy(0, stringFrame.Height() + 2); + BStringView* string = new BStringView(stringFrame, "copyright", + text); if (index > 3) string->SetFontSize(9); AddChild(string); + string->ResizeToPreferred(); index++; } - - ResizeToPreferred(); } // #pragma mark - -TranslatorView::TranslatorView(const char *name) - : SView(name), - fTabWidth(30), - fActiveChild(0) +TranslatorView::TranslatorView(BRect frame, const char *name) + : BTabView(frame, name) { - // Set global var to true - gAreSettingsRunning = true; - // Load settings to global settings struct LoadSettings(&fSettings); - - font_height fontHeight; - GetFontHeight(&fontHeight); - fTabHeight = (int32)ceilf(fontHeight.ascent + fontHeight.descent - + fontHeight.leading) + 7; - // Add left and top margins - float top = fTabHeight + 20; - float left = 0; - - // This will remember longest string width - int32 nameWidth = 0; - - SView *view = new TranslatorWriteView("Write", &fSettings, left, top); - AddChild(view); - nameWidth = (int32)StringWidth(view->Name()); - fTabs.AddItem(new BTab(view)); - - view = new TranslatorReadView("Read", &fSettings, left, top); - AddChild(view); - if (nameWidth < StringWidth(view->Name())) - nameWidth = (int32)StringWidth(view->Name()); - fTabs.AddItem(new BTab(view)); - - view = new TranslatorAboutView("About", left, top); - AddChild(view); - if (nameWidth < StringWidth(view->Name())) - nameWidth = (int32)StringWidth(view->Name()); - fTabs.AddItem(new BTab(view)); - - fTabWidth += nameWidth; - if (fTabWidth * CountChildren() > GetPreferredWidth()) - ResizePreferredBy((fTabWidth * CountChildren()) - GetPreferredWidth(), 0); - - // Add right and bottom margins - ResizePreferredBy(10, 15); - + + BRect contentSize = ContainerView()->Bounds(); + SView *view = new TranslatorWriteView(contentSize, "Write", + &fSettings); + AddTab(view); + view = new TranslatorReadView(contentSize, "Read", &fSettings); + AddTab(view); + view = new TranslatorAboutView(contentSize, "About"); + AddTab(view); + ResizeToPreferred(); - + // Make TranslatorView resize itself with parent SetFlags(Flags() | B_FOLLOW_ALL); } @@ -909,112 +852,9 @@ TranslatorView::~TranslatorView() { - gAreSettingsRunning = false; - - BTab* tab; - while ((tab = (BTab*)fTabs.RemoveItem((int32)0)) != NULL) { - delete tab; - } } -//! Attached to window - resize parent to preferred -void -TranslatorView::AttachedToWindow() -{ - // Hide all children except first one - BView *child; - int32 index = 1; - while ((child = ChildAt(index++)) != NULL) - child->Hide(); - -} - - -BRect -TranslatorView::_TabFrame(int32 index) const -{ - return BRect(index * fTabWidth, 10, (index + 1) * fTabWidth, 10 + fTabHeight); -} - - -void -TranslatorView::Draw(BRect updateRect) -{ - // This is needed because DataTranslations app hides children - // after user changes translator - if (ChildAt(fActiveChild)->IsHidden()) - ChildAt(fActiveChild)->Show(); - - // Clear - SetHighColor(ViewColor()); - BRect frame = _TabFrame(0); - FillRect(BRect(frame.left, frame.top, Bounds().right, frame.bottom - 1)); - - int32 index = 0; - BTab* tab; - while ((tab = (BTab*)fTabs.ItemAt(index)) != NULL) { - tab_position position; - if (fActiveChild == index) - position = B_TAB_FRONT; - else if (index == 0) - position = B_TAB_FIRST; - else - position = B_TAB_ANY; - - tab->DrawTab(this, _TabFrame(index), position, index + 1 != fActiveChild); - index++; - } - - // Draw bottom edge - SetHighColor(tint_color(ViewColor(), B_LIGHTEN_MAX_TINT)); - - BRect selectedFrame = _TabFrame(fActiveChild); - float offset = ceilf(frame.Height() / 2.0); - - if (selectedFrame.left > frame.left) { - StrokeLine(BPoint(frame.left, frame.bottom), - BPoint(selectedFrame.left, frame.bottom)); - } - if (selectedFrame.right + offset < Bounds().right) { - StrokeLine(BPoint(selectedFrame.right + offset, frame.bottom), - BPoint(Bounds().right, frame.bottom)); - } -} - - -//! MouseDown, check if on tab, if so change tab if needed -void -TranslatorView::MouseDown(BPoint where) -{ - BRect frame = _TabFrame(fTabs.CountItems() - 1); - frame.left = 0; - if (!frame.Contains(where)) - return; - - for (int32 index = fTabs.CountItems(); index-- > 0;) { - if (!_TabFrame(index).Contains(where)) - continue; - - if (fActiveChild != index) { - // Hide current visible child - ChildAt(fActiveChild)->Hide(); - - // This loop is needed because it looks like in DataTranslations - // view gets hidden more than one time when user changes translator - while (ChildAt(index)->IsHidden()) { - ChildAt(index)->Show(); - } - - // Remember which one is currently visible - fActiveChild = index; - Invalidate(frame); - break; - } - } -} - - // #pragma mark - @@ -1042,7 +882,7 @@ status_t MakeConfig(BMessage *ioExtension, BView **outView, BRect *outExtent) { - *outView = new TranslatorView("TranslatorView"); + *outView = new TranslatorView(BRect(0, 0, 300, 250), "TranslatorView"); *outExtent = (*outView)->Frame(); return B_OK; } Modified: haiku/trunk/src/add-ons/translators/jpeg2000/JPEG2000Translator.h =================================================================== --- haiku/trunk/src/add-ons/translators/jpeg2000/JPEG2000Translator.h 2009-08-06 16:36:32 UTC (rev 32165) +++ haiku/trunk/src/add-ons/translators/jpeg2000/JPEG2000Translator.h 2009-08-06 17:05:42 UTC (rev 32166) @@ -40,6 +40,7 @@ #include #include #include +#include #include #include @@ -99,29 +100,14 @@ //! Basic view class with resizing to needed size class SView : public BView { public: - SView(const char* name, float x = 0, float y = 0); - - virtual void GetPreferredSize(float* _width, float* _height); - virtual void ResizeToPreferred(); - - void AddChild(BView* child, BView* before = NULL); - - float GetPreferredWidth() - { return fPreferredWidth; } - float GetPreferredHeight() - { return fPreferredHeight; } - void ResizePreferredBy(float width, float height); - - private: - float fPreferredWidth; - float fPreferredHeight; + SView(BRect rect, const char* name); + virtual void AttachedToWindow(); }; //! Configuration view for reading settings class TranslatorReadView : public SView { public: - TranslatorReadView(const char* name, jpeg_settings* settings, - float x = 0, float y = 0); + TranslatorReadView(BRect rect, const char* name, jpeg_settings* settings); virtual void AttachedToWindow(); virtual void MessageReceived(BMessage* message); @@ -134,8 +120,7 @@ //! Configuration view for writing settings class TranslatorWriteView : public SView { public: - TranslatorWriteView(const char* name, jpeg_settings* settings, - float x = 0, float y = 0); + TranslatorWriteView(BRect rect, const char* name, jpeg_settings* settings); virtual void AttachedToWindow(); virtual void MessageReceived(BMessage* message); @@ -149,27 +134,17 @@ class TranslatorAboutView : public SView { public: - TranslatorAboutView(const char* name, float x = 0, float y = 0); + TranslatorAboutView(BRect rect, const char* name); }; //! Configuration view -class TranslatorView : public SView { +class TranslatorView : public BTabView { public: - TranslatorView(const char *name); + TranslatorView(BRect rect, const char *name); virtual ~TranslatorView(); - virtual void AttachedToWindow(); - virtual void Draw(BRect updateRect); - virtual void MouseDown(BPoint where); - private: - BRect _TabFrame(int32 index) const; - jpeg_settings fSettings; - BList fTabs; - int32 fTabWidth; - int32 fTabHeight; - int32 fActiveChild; }; //! Window used for configuration From jackburton at mail.berlios.de Thu Aug 6 19:06:05 2009 From: jackburton at mail.berlios.de (jackburton at mail.berlios.de) Date: Thu, 6 Aug 2009 19:06:05 +0200 Subject: [Haiku-commits] r32167 - haiku/trunk/src/add-ons/translators/jpeg Message-ID: <200908061706.n76H658l013908@sheep.berlios.de> Author: jackburton Date: 2009-08-06 19:05:57 +0200 (Thu, 06 Aug 2009) New Revision: 32167 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32167&view=rev Modified: haiku/trunk/src/add-ons/translators/jpeg/JPEGTranslator.cpp haiku/trunk/src/add-ons/translators/jpeg/JPEGTranslator.h Log: further cleanup Modified: haiku/trunk/src/add-ons/translators/jpeg/JPEGTranslator.cpp =================================================================== --- haiku/trunk/src/add-ons/translators/jpeg/JPEGTranslator.cpp 2009-08-06 17:05:42 UTC (rev 32166) +++ haiku/trunk/src/add-ons/translators/jpeg/JPEGTranslator.cpp 2009-08-06 17:05:57 UTC (rev 32167) @@ -92,9 +92,7 @@ static status_t Error(j_common_ptr cinfo, status_t error = B_ERROR); -bool gAreSettingsRunning = false; - //! Make settings to defaults void LoadDefaultSettings(jpeg_settings *settings) @@ -805,14 +803,12 @@ TranslatorView::TranslatorView(BRect frame, const char *name) : BTabView(frame, name) { - // Set global var to true - gAreSettingsRunning = true; - // Load settings to global settings struct LoadSettings(&fSettings); BRect contentSize = ContainerView()->Bounds(); - SView *view = new TranslatorWriteView(contentSize, "Write", &fSettings); + SView *view = new TranslatorWriteView(contentSize, "Write", + &fSettings); AddTab(view); view = new TranslatorReadView(contentSize, "Read", &fSettings); AddTab(view); @@ -828,25 +824,9 @@ TranslatorView::~TranslatorView() { - gAreSettingsRunning = false; } -//! Attached to window - resize parent to preferred -void -TranslatorView::AttachedToWindow() -{ - BTabView::AttachedToWindow(); -} - - -void -TranslatorView::Select(int32 index) -{ - BTabView::Select(index); -} - - // #pragma mark - Modified: haiku/trunk/src/add-ons/translators/jpeg/JPEGTranslator.h =================================================================== --- haiku/trunk/src/add-ons/translators/jpeg/JPEGTranslator.h 2009-08-06 17:05:42 UTC (rev 32166) +++ haiku/trunk/src/add-ons/translators/jpeg/JPEGTranslator.h 2009-08-06 17:05:57 UTC (rev 32167) @@ -164,9 +164,6 @@ TranslatorView(BRect frame, const char *name); virtual ~TranslatorView(); - virtual void AttachedToWindow(); - virtual void Select(int32 index); - private: jpeg_settings fSettings; }; From anevilyak at mail.berlios.de Thu Aug 6 19:56:57 2009 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Thu, 6 Aug 2009 19:56:57 +0200 Subject: [Haiku-commits] r32168 - haiku/trunk/src/add-ons/kernel/file_systems/bfs Message-ID: <200908061756.n76Huvfa012282@sheep.berlios.de> Author: anevilyak Date: 2009-08-06 19:56:57 +0200 (Thu, 06 Aug 2009) New Revision: 32168 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32168&view=rev Modified: haiku/trunk/src/add-ons/kernel/file_systems/bfs/Query.cpp Log: Patch by Blub\0: fix bfs build with DEBUG defined on gcc4. Modified: haiku/trunk/src/add-ons/kernel/file_systems/bfs/Query.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/bfs/Query.cpp 2009-08-06 17:05:57 UTC (rev 32167) +++ haiku/trunk/src/add-ons/kernel/file_systems/bfs/Query.cpp 2009-08-06 17:56:57 UTC (rev 32168) @@ -1272,7 +1272,7 @@ if (fLeft != NULL) fLeft->PrintToStream(); - char* op; + const char* op; switch (fOp) { case OP_OR: op = "OR"; break; case OP_AND: op = "AND"; break; @@ -1290,7 +1290,7 @@ void Equation::PrintToStream() { - char* symbol = "???"; + const char* symbol = "???"; switch (fOp) { case OP_EQUAL: symbol = "=="; break; case OP_UNEQUAL: symbol = "!="; break; From oruizdorantes at mail.berlios.de Thu Aug 6 20:28:39 2009 From: oruizdorantes at mail.berlios.de (oruizdorantes at BerliOS) Date: Thu, 6 Aug 2009 20:28:39 +0200 Subject: [Haiku-commits] r32169 - haiku/trunk/src/preferences/bluetooth Message-ID: <200908061828.n76ISd7a014916@sheep.berlios.de> Author: oruizdorantes Date: 2009-08-06 20:28:38 +0200 (Thu, 06 Aug 2009) New Revision: 32169 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32169&view=rev Modified: haiku/trunk/src/preferences/bluetooth/BluetoothSettingsView.cpp Log: Netbook!=Handheld Modified: haiku/trunk/src/preferences/bluetooth/BluetoothSettingsView.cpp =================================================================== --- haiku/trunk/src/preferences/bluetooth/BluetoothSettingsView.cpp 2009-08-06 17:56:57 UTC (rev 32168) +++ haiku/trunk/src/preferences/bluetooth/BluetoothSettingsView.cpp 2009-08-06 18:28:38 UTC (rev 32169) @@ -28,7 +28,7 @@ static const int32 kMsgSetDeviceClassDesktop = 'sDCd'; static const int32 kMsgSetDeviceClassServer = 'sDCs'; static const int32 kMsgSetDeviceClassLaptop = 'sDCl'; -static const int32 kMsgSetDeviceClassNetbook = 'sDCn'; +static const int32 kMsgSetDeviceClassHandheld = 'sDCn'; static const int32 kMsgSetDeviceClassSmartPhone = 'sDCp'; static const int32 kMsgSetAverageWeight = 'afEa'; @@ -41,7 +41,7 @@ static const char* kDesktopLabel = "Desktop"; static const char* kServerLabel = "Server"; static const char* kLaptopLabel = "Laptop"; -static const char* kNetBookLabel = "NetBook"; +static const char* kHandheldLabel = "Handheld"; static const char* kPhoneLabel = "Smart Phone"; @@ -163,7 +163,7 @@ break; } - case kMsgSetDeviceClassNetbook: + case kMsgSetDeviceClassHandheld: { devClass.SetRecord(1, 4, 0x72); ActiveLocalDevice->SetDeviceClass(devClass); @@ -232,8 +232,8 @@ item = new BMenuItem(kLaptopLabel, message); fHintingMenu->AddItem(item); - message = new BMessage(kMsgSetDeviceClassNetbook); - item = new BMenuItem(kNetBookLabel, message); + message = new BMessage(kMsgSetDeviceClassHandheld); + item = new BMenuItem(kHandheldLabel, message); fHintingMenu->AddItem(item); message = new BMessage(kMsgSetDeviceClassSmartPhone); From pulkomandy at mail.berlios.de Fri Aug 7 00:19:18 2009 From: pulkomandy at mail.berlios.de (pulkomandy at BerliOS) Date: Fri, 7 Aug 2009 00:19:18 +0200 Subject: [Haiku-commits] r32170 - haiku/branches/components/gsoc-locale-kit/src/preferences/locale Message-ID: <200908062219.n76MJIVM005512@sheep.berlios.de> Author: pulkomandy Date: 2009-08-07 00:19:18 +0200 (Fri, 07 Aug 2009) New Revision: 32170 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32170&view=rev Modified: haiku/branches/components/gsoc-locale-kit/src/preferences/locale/LocaleWindow.cpp haiku/branches/components/gsoc-locale-kit/src/preferences/locale/TimeFormatSettingsView.cpp haiku/branches/components/gsoc-locale-kit/src/preferences/locale/TimeFormatSettingsView.h Log: Some work on the locale preference panel. Moved things around in the advanced country settings, added time example and some headers, and made the thing scroll as there are more things to add and it will get too big for the window. I find this better than using a second level of tabs or popping up another window as osX and windows seem to do. References : http://www.guidebookgallery.org/screenshots/international The advanced settings will probably look somewhat like GeoWorks Ensemble ones, at least that's my personal favourite and it also matches ICU inner workings quite well while being easily user-editable. Modified: haiku/branches/components/gsoc-locale-kit/src/preferences/locale/LocaleWindow.cpp =================================================================== --- haiku/branches/components/gsoc-locale-kit/src/preferences/locale/LocaleWindow.cpp 2009-08-06 18:28:38 UTC (rev 32169) +++ haiku/branches/components/gsoc-locale-kit/src/preferences/locale/LocaleWindow.cpp 2009-08-06 22:19:18 UTC (rev 32170) @@ -469,7 +469,8 @@ tab->AddChild(BGroupLayoutBuilder(B_HORIZONTAL,10) .Add(scrollView) - .Add(fTimeFormatSettings) + .Add(new BScrollView("advanced", fTimeFormatSettings, 0, + false, true, B_NO_BORDER)) ); listView->ScrollToSelection(); Modified: haiku/branches/components/gsoc-locale-kit/src/preferences/locale/TimeFormatSettingsView.cpp =================================================================== --- haiku/branches/components/gsoc-locale-kit/src/preferences/locale/TimeFormatSettingsView.cpp 2009-08-06 18:28:38 UTC (rev 32169) +++ haiku/branches/components/gsoc-locale-kit/src/preferences/locale/TimeFormatSettingsView.cpp 2009-08-06 22:19:18 UTC (rev 32170) @@ -18,6 +18,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -27,25 +30,11 @@ : BView("WindowsSettingsView", B_WILL_DRAW) , fCountry(country) { - SetLayout(new BGroupLayout(B_VERTICAL)); + SetLayout(new BGroupLayout(B_HORIZONTAL)); - BBox *clockBox = new BBox("Clock"); - clockBox->SetLabel("Clock"); - clockBox->SetLayout(new BGroupLayout(B_VERTICAL, 10)); + // Date + BSeparatorView* dateHeader = new BSeparatorView("Date"); - { - f24HrRadioButton = new BRadioButton("", "24 Hour", - new BMessage(kSettingsContentsModified)); - - f12HrRadioButton = new BRadioButton("", "12 Hour", - new BMessage(kSettingsContentsModified)); - - clockBox->AddChild(BGroupLayoutBuilder(B_VERTICAL,10) - .Add(f24HrRadioButton) - .Add(f12HrRadioButton) - ); - } - BBox *dateFormatBox = new BBox("Date Order"); dateFormatBox->SetLabel("Date Order"); dateFormatBox->SetLayout(new BGroupLayout(B_HORIZONTAL, 10)); @@ -82,46 +71,55 @@ fSeparatorMenuField->StringWidth(fSeparatorMenuField->Label()) + 8.0f); fSeparatorMenuField->SetAlignment(B_ALIGN_LEFT); - BStringView *exampleView = new BStringView("", "Examples:"); - fLongDateExampleView = new BStringView("", ""); - fShortDateExampleView = new BStringView("", ""); + // Time + BSeparatorView* timeHeader = new BSeparatorView("Time"); + + BBox *clockBox = new BBox("Clock"); + clockBox->SetLabel("Clock"); + clockBox->SetLayout(new BGroupLayout(B_VERTICAL, 10)); + + { + f24HrRadioButton = new BRadioButton("", "24 Hour", + new BMessage(kSettingsContentsModified)); + + f12HrRadioButton = new BRadioButton("", "12 Hour", + new BMessage(kSettingsContentsModified)); + + clockBox->AddChild(BGroupLayoutBuilder(B_VERTICAL,10) + .Add(f24HrRadioButton) + .Add(f12HrRadioButton) + ); + } + + fLongTimeExampleView = new BStringView("", ""); + fShortTimeExampleView = new BStringView("", ""); + + // Numbers + // Currency + _UpdateExamples(); AddChild(BGroupLayoutBuilder(B_VERTICAL, 10) - .Add(BGroupLayoutBuilder(B_HORIZONTAL,10) - .Add(clockBox) - .Add(dateFormatBox) - .AddGlue() - ) - .Add(fSeparatorMenuField) - .Add(exampleView) + .Add(dateHeader) .Add(fLongDateExampleView) .Add(fShortDateExampleView) + .Add(dateFormatBox) + .Add(fSeparatorMenuField) + + .Add(timeHeader) + .Add(fLongTimeExampleView) + .Add(fShortTimeExampleView) + .Add(clockBox) .AddGlue() + .SetInsets(5,5,5,5) ); } void -TimeFormatSettingsView::GetPreferredSize(float *_width, float *_height) -{ - if (_width != NULL) { - BView* view = fMDYRadioButton->Parent(); - if (view != NULL) - *_width = view->Frame().right; - else - *_width = Bounds().Width(); - } - - if (_height != NULL) - *_height = fShortDateExampleView->Frame().bottom; -} - - -void TimeFormatSettingsView::AttachedToWindow() { f24HrRadioButton->SetTarget(this); @@ -131,6 +129,11 @@ fMDYRadioButton->SetTarget(this); fSeparatorMenuField->Menu()->SetTargetForItems(this); + + static_cast(Parent())->ScrollBar(B_VERTICAL)->SetRange( + 0, Bounds().Height()); + static_cast(Parent())->ScrollBar(B_VERTICAL)->SetProportion( + Bounds().Height() / Parent()->Bounds().Height()); } @@ -315,14 +318,16 @@ BString timeFormat = "Internal Error!"; fCountry->FormatDate(&timeFormat, timeValue, true); - fLongDateExampleView->SetText(timeFormat); - fLongDateExampleView->ResizeToPreferred(); fCountry->FormatDate(&timeFormat, timeValue, false); - fShortDateExampleView->SetText(timeFormat); - fShortDateExampleView->ResizeToPreferred(); + + fCountry->FormatTime(&timeFormat, timeValue, true); + fLongTimeExampleView->SetText(timeFormat); + + fCountry->FormatTime(&timeFormat, timeValue, false); + fShortTimeExampleView->SetText(timeFormat); } Modified: haiku/branches/components/gsoc-locale-kit/src/preferences/locale/TimeFormatSettingsView.h =================================================================== --- haiku/branches/components/gsoc-locale-kit/src/preferences/locale/TimeFormatSettingsView.h 2009-08-06 18:28:38 UTC (rev 32169) +++ haiku/branches/components/gsoc-locale-kit/src/preferences/locale/TimeFormatSettingsView.h 2009-08-06 22:19:18 UTC (rev 32170) @@ -44,7 +44,6 @@ virtual void MessageReceived(BMessage *message); virtual void AttachedToWindow(); - virtual void GetPreferredSize(float *_width, float *_height); virtual void SetDefaults(); virtual bool IsDefaultable() const; @@ -68,6 +67,8 @@ BStringView *fLongDateExampleView; BStringView *fShortDateExampleView; + BStringView *fLongTimeExampleView; + BStringView *fShortTimeExampleView; bool f24HrClock; From anevilyak at mail.berlios.de Fri Aug 7 01:24:50 2009 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Fri, 7 Aug 2009 01:24:50 +0200 Subject: [Haiku-commits] r32171 - in haiku/trunk: headers/private/interface src/kits/interface Message-ID: <200908062324.n76NOonJ004614@sheep.berlios.de> Author: anevilyak Date: 2009-08-07 01:24:48 +0200 (Fri, 07 Aug 2009) New Revision: 32171 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32171&view=rev Modified: haiku/trunk/headers/private/interface/BMCPrivate.h haiku/trunk/src/kits/interface/BMCPrivate.cpp Log: BMenuField's private menu bar did not take into account the width of the popup indicator when computing its minimum size. Fixes ticket #3635. Modified: haiku/trunk/headers/private/interface/BMCPrivate.h =================================================================== --- haiku/trunk/headers/private/interface/BMCPrivate.h 2009-08-06 22:19:18 UTC (rev 32170) +++ haiku/trunk/headers/private/interface/BMCPrivate.h 2009-08-06 23:24:48 UTC (rev 32171) @@ -54,6 +54,7 @@ bool IsPopUpMarkerShown() const { return fShowPopUpMarker; } + virtual BSize MinSize(); virtual BSize MaxSize(); private: Modified: haiku/trunk/src/kits/interface/BMCPrivate.cpp =================================================================== --- haiku/trunk/src/kits/interface/BMCPrivate.cpp 2009-08-06 22:19:18 UTC (rev 32170) +++ haiku/trunk/src/kits/interface/BMCPrivate.cpp 2009-08-06 23:24:48 UTC (rev 32171) @@ -363,6 +363,16 @@ BSize +_BMCMenuBar_::MinSize() +{ + BSize size; + BMenuBar::GetPreferredSize(&size.width, &size.height); + // account for popup indicator + a few pixels margin + size.width += 13.0; + return BLayoutUtils::ComposeSize(ExplicitMinSize(), size); +} + +BSize _BMCMenuBar_::MaxSize() { // The maximum width of a normal BMenuBar is unlimited, but we want it From anevilyak at mail.berlios.de Fri Aug 7 01:44:39 2009 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Fri, 7 Aug 2009 01:44:39 +0200 Subject: [Haiku-commits] r32172 - haiku/trunk/src/kits/interface Message-ID: <200908062344.n76Nidw6001806@sheep.berlios.de> Author: anevilyak Date: 2009-08-07 01:44:39 +0200 (Fri, 07 Aug 2009) New Revision: 32172 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32172&view=rev Modified: haiku/trunk/src/kits/interface/BMCPrivate.cpp Log: Fix small style violation. Modified: haiku/trunk/src/kits/interface/BMCPrivate.cpp =================================================================== --- haiku/trunk/src/kits/interface/BMCPrivate.cpp 2009-08-06 23:24:48 UTC (rev 32171) +++ haiku/trunk/src/kits/interface/BMCPrivate.cpp 2009-08-06 23:44:39 UTC (rev 32172) @@ -372,6 +372,7 @@ return BLayoutUtils::ComposeSize(ExplicitMinSize(), size); } + BSize _BMCMenuBar_::MaxSize() { From axeld at mail.berlios.de Fri Aug 7 09:22:58 2009 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Fri, 7 Aug 2009 09:22:58 +0200 Subject: [Haiku-commits] r32173 - haiku/trunk/src/kits/interface Message-ID: <200908070722.n777MwMc005658@sheep.berlios.de> Author: axeld Date: 2009-08-07 09:22:56 +0200 (Fri, 07 Aug 2009) New Revision: 32173 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32173&view=rev Modified: haiku/trunk/src/kits/interface/BMCPrivate.cpp Log: * Only take the popup marker into account if fShowPopUpMarker is true. * Automatic whitespace cleanup. Modified: haiku/trunk/src/kits/interface/BMCPrivate.cpp =================================================================== --- haiku/trunk/src/kits/interface/BMCPrivate.cpp 2009-08-06 23:44:39 UTC (rev 32172) +++ haiku/trunk/src/kits/interface/BMCPrivate.cpp 2009-08-07 07:22:56 UTC (rev 32173) @@ -7,6 +7,7 @@ * Stephan A?mus */ + #include #include @@ -151,7 +152,7 @@ be_control_look->DrawMenuFieldBackground(this, rect, updateRect, base, fShowPopUpMarker, flags); - _DrawItems(updateRect); + _DrawItems(updateRect); return; } @@ -203,7 +204,7 @@ } BRect r(bounds); - r.left = r.right - 10.0; + r.left = r.right - 10.0; BeginLineArray(6); // bottom below item text, darker then BMenuBar @@ -272,7 +273,7 @@ dirty.right = Frame().right + 2; dirty.left = dirty.left - diff - 4; fMenuField->Invalidate(dirty); - + // clean up the arrow part dirty = Bounds(); dirty.left = dirty.right - diff - 12; @@ -285,7 +286,7 @@ dirty.left = Frame().right - 2; dirty.right = dirty.left - diff + 4; fMenuField->Invalidate(dirty); - + // clean up the arrow part dirty = Bounds(); dirty.left = dirty.right - 12; @@ -315,16 +316,16 @@ if (item && item->Submenu() && item->Submenu()->Window()) { BMessage message(B_KEY_DOWN); - + message.AddInt8("byte", B_ESCAPE); message.AddInt8("key", B_ESCAPE); message.AddInt32("modifiers", 0); message.AddInt8("raw_char", B_ESCAPE); - + Window()->PostMessage(&message, this, NULL); } } - // fall through + // fall through default: BMenuBar::MessageReceived(msg); break; @@ -367,8 +368,12 @@ { BSize size; BMenuBar::GetPreferredSize(&size.width, &size.height); - // account for popup indicator + a few pixels margin - size.width += 13.0; + + if (fShowPopUpMarker) { + // account for popup indicator + a few pixels margin + size.width += 13.0; + } + return BLayoutUtils::ComposeSize(ExplicitMinSize(), size); } @@ -384,7 +389,7 @@ } -_BMCMenuBar_ +_BMCMenuBar_ &_BMCMenuBar_::operator=(const _BMCMenuBar_ &) { return *this; From axeld at mail.berlios.de Fri Aug 7 10:01:28 2009 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Fri, 7 Aug 2009 10:01:28 +0200 Subject: [Haiku-commits] r32174 - in haiku/trunk: headers/os/interface src/kits/interface Message-ID: <200908070801.n7781SZL010585@sheep.berlios.de> Author: axeld Date: 2009-08-07 10:01:27 +0200 (Fri, 07 Aug 2009) New Revision: 32174 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32174&view=rev Modified: haiku/trunk/headers/os/interface/MenuField.h haiku/trunk/src/kits/interface/BMCPrivate.cpp haiku/trunk/src/kits/interface/Menu.cpp haiku/trunk/src/kits/interface/MenuBar.cpp haiku/trunk/src/kits/interface/MenuField.cpp haiku/trunk/src/kits/interface/MenuWindow.cpp Log: * Cleanup, no functional change. * Remove superfluous operator=() implementations. Modified: haiku/trunk/headers/os/interface/MenuField.h =================================================================== --- haiku/trunk/headers/os/interface/MenuField.h 2009-08-07 07:22:56 UTC (rev 32173) +++ haiku/trunk/headers/os/interface/MenuField.h 2009-08-07 08:01:27 UTC (rev 32174) @@ -1,34 +1,36 @@ /* - * Copyright 2006-2008, Haiku, Inc. All Rights Reserved. + * Copyright 2006-2009, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. */ - #ifndef _MENU_FIELD_H #define _MENU_FIELD_H + #include -#include /* For convenience */ +#include #include + class BMenuBar; + class BMenuField : public BView { - public: +public: BMenuField(BRect frame, const char* name, const char* label, BMenu* menu, uint32 resize = B_FOLLOW_LEFT|B_FOLLOW_TOP, - uint32 flags = B_WILL_DRAW | B_NAVIGABLE); + uint32 flags = B_WILL_DRAW | B_NAVIGABLE); BMenuField(BRect frame, const char* name, const char* label, BMenu* menu, bool fixed_size, uint32 resize = B_FOLLOW_LEFT|B_FOLLOW_TOP, - uint32 flags = B_WILL_DRAW | B_NAVIGABLE); + uint32 flags = B_WILL_DRAW | B_NAVIGABLE); BMenuField(const char* name, const char* label, BMenu* menu, BMessage* message, - uint32 flags = B_WILL_DRAW | B_NAVIGABLE); + uint32 flags = B_WILL_DRAW | B_NAVIGABLE); BMenuField(const char* label, - BMenu* menu, BMessage* message = NULL); + BMenu* menu, BMessage* message = NULL); BMenuField(BMessage* data); virtual ~BMenuField(); @@ -57,7 +59,7 @@ virtual void SetLabel(const char* label); const char* Label() const; - + virtual void SetEnabled(bool on); bool IsEnabled() const; @@ -86,7 +88,7 @@ BLayoutItem* CreateLabelLayoutItem(); BLayoutItem* CreateMenuBarLayoutItem(); - + /*----- Private or reserved -----------------------------------------*/ virtual status_t Perform(perform_code d, void* arg); @@ -107,17 +109,16 @@ virtual void _ReservedMenuField2(); virtual void _ReservedMenuField3(); - BMenuField &operator=(const BMenuField&); + BMenuField& operator=(const BMenuField& other); - void InitObject(const char* label); void InitObject2(); void DrawLabel(BRect bounds, BRect update); static void InitMenu(BMenu* menu); - + int32 _MenuTask(); static int32 _thread_entry(void *arg); - + void _UpdateFrame(); void _InitMenuBar(BMenu* menu, BRect frame, bool fixedSize); Modified: haiku/trunk/src/kits/interface/BMCPrivate.cpp =================================================================== --- haiku/trunk/src/kits/interface/BMCPrivate.cpp 2009-08-07 07:22:56 UTC (rev 32173) +++ haiku/trunk/src/kits/interface/BMCPrivate.cpp 2009-08-07 08:01:27 UTC (rev 32174) @@ -22,7 +22,7 @@ #include -_BMCFilter_::_BMCFilter_(BMenuField *menuField, uint32 what) +_BMCFilter_::_BMCFilter_(BMenuField* menuField, uint32 what) : BMessageFilter(B_ANY_DELIVERY, B_ANY_SOURCE, what), fMenuField(menuField) @@ -36,10 +36,10 @@ filter_result -_BMCFilter_::Filter(BMessage *message, BHandler **handler) +_BMCFilter_::Filter(BMessage* message, BHandler** handler) { if (message->what == B_MOUSE_DOWN) { - if (BView *view = dynamic_cast(*handler)) { + if (BView* view = dynamic_cast(*handler)) { BPoint point; message->FindPoint("be:view_where", &point); view->ConvertToParent(&point); @@ -52,13 +52,6 @@ } -_BMCFilter_ & -_BMCFilter_::operator=(const _BMCFilter_ &) -{ - return *this; -} - - // #pragma mark - @@ -87,7 +80,7 @@ } -_BMCMenuBar_::_BMCMenuBar_(BMessage *data) +_BMCMenuBar_::_BMCMenuBar_(BMessage* data) : BMenuBar(data), fMenuField(NULL), fFixedSize(true), @@ -108,8 +101,8 @@ } -BArchivable * -_BMCMenuBar_::Instantiate(BMessage *data) +BArchivable* +_BMCMenuBar_::Instantiate(BMessage* data) { if (validate_instantiation(data, "_BMCMenuBar_")) return new _BMCMenuBar_(data); @@ -121,10 +114,10 @@ void _BMCMenuBar_::AttachedToWindow() { - fMenuField = static_cast(Parent()); + fMenuField = static_cast(Parent()); // Don't cause the KeyMenuBar to change by being attached - BMenuBar *menuBar = Window()->KeyMenuBar(); + BMenuBar* menuBar = Window()->KeyMenuBar(); BMenuBar::AttachedToWindow(); Window()->SetKeyMenuBar(menuBar); @@ -307,12 +300,12 @@ void -_BMCMenuBar_::MessageReceived(BMessage *msg) +_BMCMenuBar_::MessageReceived(BMessage* msg) { switch (msg->what) { case 'TICK': { - BMenuItem *item = ItemAt(0); + BMenuItem* item = ItemAt(0); if (item && item->Submenu() && item->Submenu()->Window()) { BMessage message(B_KEY_DOWN); @@ -389,13 +382,6 @@ } -_BMCMenuBar_ -&_BMCMenuBar_::operator=(const _BMCMenuBar_ &) -{ - return *this; -} - - void _BMCMenuBar_::_Init(bool setMaxContentWidth) { Modified: haiku/trunk/src/kits/interface/Menu.cpp =================================================================== --- haiku/trunk/src/kits/interface/Menu.cpp 2009-08-07 07:22:56 UTC (rev 32173) +++ haiku/trunk/src/kits/interface/Menu.cpp 2009-08-07 08:01:27 UTC (rev 32174) @@ -8,6 +8,7 @@ * Rene Gollent (anevilyak at gmail.com) */ + #include #include @@ -65,10 +66,10 @@ class ExtraMenuData { public: - menu_tracking_hook trackingHook; - void *trackingState; + menu_tracking_hook trackingHook; + void* trackingState; - ExtraMenuData(menu_tracking_hook func, void *state) + ExtraMenuData(menu_tracking_hook func, void* state) { trackingHook = func; trackingState = state; @@ -173,7 +174,7 @@ }; -const char *BPrivate::kEmptyMenuLabel = ""; +const char* BPrivate::kEmptyMenuLabel = ""; struct BMenu::LayoutData { @@ -182,7 +183,7 @@ }; -BMenu::BMenu(const char *name, menu_layout layout) +BMenu::BMenu(const char* name, menu_layout layout) : BView(BRect(0, 0, 0, 0), name, 0, B_WILL_DRAW), fChosenItem(NULL), fPad(14.0f, 2.0f, 20.0f, 0.0f), @@ -216,7 +217,7 @@ } -BMenu::BMenu(const char *name, float width, float height) +BMenu::BMenu(const char* name, float width, float height) : BView(BRect(0.0f, width, 0.0f, height), name, 0, B_WILL_DRAW), fChosenItem(NULL), fSelected(NULL), @@ -261,7 +262,7 @@ } -BMenu::BMenu(BMessage *archive) +BMenu::BMenu(BMessage* archive) : BView(archive), fChosenItem(NULL), fPad(14.0f, 2.0f, 20.0f, 0.0f), @@ -306,7 +307,7 @@ status_t -BMenu::Archive(BMessage *data, bool deep) const +BMenu::Archive(BMessage* data, bool deep) const { status_t err = BView::Archive(data, deep); @@ -325,7 +326,7 @@ if (err == B_OK) err = data->AddFloat("_maxwidth", fMaxContentWidth); if (err == B_OK && deep) { - BMenuItem *item = NULL; + BMenuItem* item = NULL; int32 index = 0; while ((item = ItemAt(index++)) != NULL) { BMessage itemData; @@ -353,17 +354,17 @@ // when called there. Probably because the BApplication isn't yet // initialized, or running. BMenu::sAltAsCommandKey = true; - key_map *keys = NULL; - char *chars = NULL; + key_map* keys = NULL; + char* chars = NULL; get_key_map(&keys, &chars); if (keys == NULL || keys->left_command_key != 0x5d || keys->left_control_key != 0x5c) BMenu::sAltAsCommandKey = false; free(chars); free(keys); - - BMenuItem *superItem = Superitem(); - BMenu *superMenu = Supermenu(); + + BMenuItem* superItem = Superitem(); + BMenu* superMenu = Supermenu(); if (AddDynamicItem(B_INITIAL_ADD)) { do { if (superMenu != NULL && !superMenu->_OkToProceed(superItem)) { @@ -390,18 +391,19 @@ bool -BMenu::AddItem(BMenuItem *item) +BMenu::AddItem(BMenuItem* item) { return AddItem(item, CountItems()); } bool -BMenu::AddItem(BMenuItem *item, int32 index) +BMenu::AddItem(BMenuItem* item, int32 index) { - if (fLayout == B_ITEMS_IN_MATRIX) - debugger("BMenu::AddItem(BMenuItem *, int32) this method can only " - "be called if the menu layout is not B_ITEMS_IN_MATRIX"); + if (fLayout == B_ITEMS_IN_MATRIX) { + debugger("BMenu::AddItem(BMenuItem*, int32) this method can only " + "be called if the menu layout is not B_ITEMS_IN_MATRIX"); + } if (!item || !_AddItem(item, index)) return false; @@ -420,11 +422,12 @@ bool -BMenu::AddItem(BMenuItem *item, BRect frame) +BMenu::AddItem(BMenuItem* item, BRect frame) { - if (fLayout != B_ITEMS_IN_MATRIX) - debugger("BMenu::AddItem(BMenuItem *, BRect) this method can only " + if (fLayout != B_ITEMS_IN_MATRIX) { + debugger("BMenu::AddItem(BMenuItem*, BRect) this method can only " "be called if the menu layout is B_ITEMS_IN_MATRIX"); + } if (!item) return false; @@ -449,9 +452,9 @@ bool -BMenu::AddItem(BMenu *submenu) +BMenu::AddItem(BMenu* submenu) { - BMenuItem *item = new (nothrow) BMenuItem(submenu); + BMenuItem* item = new (nothrow) BMenuItem(submenu); if (!item) return false; @@ -466,13 +469,14 @@ bool -BMenu::AddItem(BMenu *submenu, int32 index) +BMenu::AddItem(BMenu* submenu, int32 index) { - if (fLayout == B_ITEMS_IN_MATRIX) - debugger("BMenu::AddItem(BMenuItem *, int32) this method can only " - "be called if the menu layout is not B_ITEMS_IN_MATRIX"); + if (fLayout == B_ITEMS_IN_MATRIX) { + debugger("BMenu::AddItem(BMenuItem*, int32) this method can only " + "be called if the menu layout is not B_ITEMS_IN_MATRIX"); + } - BMenuItem *item = new (nothrow) BMenuItem(submenu); + BMenuItem* item = new (nothrow) BMenuItem(submenu); if (!item) return false; @@ -487,13 +491,14 @@ bool -BMenu::AddItem(BMenu *submenu, BRect frame) +BMenu::AddItem(BMenu* submenu, BRect frame) { - if (fLayout != B_ITEMS_IN_MATRIX) - debugger("BMenu::AddItem(BMenu *, BRect) this method can only " + if (fLayout != B_ITEMS_IN_MATRIX) { + debugger("BMenu::AddItem(BMenu*, BRect) this method can only " "be called if the menu layout is B_ITEMS_IN_MATRIX"); + } - BMenuItem *item = new (nothrow) BMenuItem(submenu); + BMenuItem* item = new (nothrow) BMenuItem(submenu); if (!item) return false; @@ -508,7 +513,7 @@ bool -BMenu::AddList(BList *list, int32 index) +BMenu::AddList(BList* list, int32 index) { // TODO: test this function, it's not documented in the bebook. if (list == NULL) @@ -518,7 +523,7 @@ int32 numItems = list->CountItems(); for (int32 i = 0; i < numItems; i++) { - BMenuItem *item = static_cast(list->ItemAt(i)); + BMenuItem* item = static_cast(list->ItemAt(i)); if (item != NULL) { if (!_AddItem(item, index + i)) break; @@ -543,7 +548,7 @@ bool BMenu::AddSeparatorItem() { - BMenuItem *item = new (nothrow) BSeparatorItem(); + BMenuItem* item = new (nothrow) BSeparatorItem(); if (!item || !AddItem(item, CountItems())) { delete item; return false; @@ -554,16 +559,16 @@ bool -BMenu::RemoveItem(BMenuItem *item) +BMenu::RemoveItem(BMenuItem* item) { return _RemoveItems(0, 0, item, false); } -BMenuItem * +BMenuItem* BMenu::RemoveItem(int32 index) { - BMenuItem *item = ItemAt(index); + BMenuItem* item = ItemAt(index); if (item != NULL) _RemoveItems(0, 0, item, false); return item; @@ -578,10 +583,10 @@ bool -BMenu::RemoveItem(BMenu *submenu) +BMenu::RemoveItem(BMenu* submenu) { for (int32 i = 0; i < fItems.CountItems(); i++) { - if (static_cast(fItems.ItemAtFast(i))->Submenu() == submenu) + if (static_cast(fItems.ItemAtFast(i))->Submenu() == submenu) return _RemoveItems(i, 1, NULL, false); } @@ -596,30 +601,30 @@ } -BMenuItem * +BMenuItem* BMenu::ItemAt(int32 index) const { - return static_cast(fItems.ItemAt(index)); + return static_cast(fItems.ItemAt(index)); } -BMenu * +BMenu* BMenu::SubmenuAt(int32 index) const { - BMenuItem *item = static_cast(fItems.ItemAt(index)); - return (item != NULL) ? item->Submenu() : NULL; + BMenuItem* item = static_cast(fItems.ItemAt(index)); + return item != NULL ? item->Submenu() : NULL; } int32 -BMenu::IndexOf(BMenuItem *item) const +BMenu::IndexOf(BMenuItem* item) const { return fItems.IndexOf(item); } int32 -BMenu::IndexOf(BMenu *submenu) const +BMenu::IndexOf(BMenu* submenu) const { for (int32 i = 0; i < fItems.CountItems(); i++) { if (ItemAt(i)->Submenu() == submenu) @@ -630,10 +635,10 @@ } -BMenuItem * -BMenu::FindItem(const char *label) const +BMenuItem* +BMenu::FindItem(const char* label) const { - BMenuItem *item = NULL; + BMenuItem* item = NULL; for (int32 i = 0; i < CountItems(); i++) { item = ItemAt(i); @@ -652,10 +657,10 @@ } -BMenuItem * +BMenuItem* BMenu::FindItem(uint32 command) const { - BMenuItem *item = NULL; + BMenuItem* item = NULL; for (int32 i = 0; i < CountItems(); i++) { item = ItemAt(i); @@ -675,7 +680,7 @@ status_t -BMenu::SetTargetForItems(BHandler *handler) +BMenu::SetTargetForItems(BHandler* handler) { status_t status = B_OK; for (int32 i = 0; i < fItems.CountItems(); i++) { @@ -792,11 +797,11 @@ } -BMenuItem * +BMenuItem* BMenu::FindMarked() { for (int32 i = 0; i < fItems.CountItems(); i++) { - BMenuItem *item = ItemAt(i); + BMenuItem* item = ItemAt(i); if (item->IsMarked()) return item; } @@ -805,14 +810,14 @@ } -BMenu * +BMenu* BMenu::Supermenu() const { return fSuper; } -BMenuItem * +BMenuItem* BMenu::Superitem() const { return fSuperitem; @@ -820,7 +825,7 @@ void -BMenu::MessageReceived(BMessage *msg) +BMenu::MessageReceived(BMessage* msg) { switch (msg->what) { case B_MOUSE_WHEEL_CHANGED: @@ -830,7 +835,7 @@ if (deltaY == 0) return; - BMenuWindow *window = dynamic_cast(Window()); + BMenuWindow* window = dynamic_cast(Window()); if (window == NULL) return; @@ -847,7 +852,7 @@ void -BMenu::KeyDown(const char *bytes, int32 numBytes) +BMenu::KeyDown(const char* bytes, int32 numBytes) { // TODO: Test how it works on beos and implement it correctly switch (bytes[0]) { @@ -866,9 +871,9 @@ _SelectNextItem(fSelected, false); else { // this case has to be handled a bit specially. - BMenuItem *item = Superitem(); + BMenuItem* item = Superitem(); if (item) { - if (dynamic_cast(Supermenu())) { + if (dynamic_cast(Supermenu())) { // if we're at the top menu below the menu bar, pass the keypress to // the menu bar so we can move to another top level menu BMessenger msgr(Supermenu()); @@ -885,7 +890,7 @@ else { if (fSelected && fSelected->Submenu()) { _SelectItem(fSelected, true, true); - } else if (dynamic_cast(Supermenu())) { + } else if (dynamic_cast(Supermenu())) { // if we have no submenu and we're an // item in the top menu below the menubar, // pass the keypress to the menubar @@ -899,7 +904,7 @@ case B_PAGE_UP: case B_PAGE_DOWN: { - BMenuWindow *window = dynamic_cast(Window()); + BMenuWindow* window = dynamic_cast(Window()); if (window == NULL || !window->HasScrollers()) break; @@ -988,7 +993,7 @@ void -BMenu::GetPreferredSize(float *_width, float *_height) +BMenu::GetPreferredSize(float* _width, float* _height) { _ValidatePreferredSize(); @@ -1052,12 +1057,12 @@ } -BHandler * -BMenu::ResolveSpecifier(BMessage *msg, int32 index, BMessage *specifier, - int32 form, const char *property) +BHandler* +BMenu::ResolveSpecifier(BMessage* msg, int32 index, BMessage* specifier, + int32 form, const char* property) { BPropertyInfo propInfo(sPropList); - BHandler *target = NULL; + BHandler* target = NULL; switch (propInfo.FindMatch(msg, 0, specifier, form, property)) { case B_ERROR: @@ -1098,7 +1103,7 @@ status_t -BMenu::GetSupportedSuites(BMessage *data) +BMenu::GetSupportedSuites(BMessage* data) { if (data == NULL) return B_BAD_VALUE; @@ -1195,7 +1200,7 @@ } -BMenu::BMenu(BRect frame, const char *name, uint32 resizingMode, uint32 flags, +BMenu::BMenu(BRect frame, const char* name, uint32 resizingMode, uint32 flags, menu_layout layout, bool resizeToFit) : BView(frame, name, resizingMode, flags), fChosenItem(NULL), @@ -1237,8 +1242,8 @@ void -BMenu::GetItemMargins(float *left, float *top, float *right, - float *bottom) const +BMenu::GetItemMargins(float* left, float* top, float* right, + float* bottom) const { if (left != NULL) *left = fPad.left; @@ -1281,8 +1286,8 @@ } -BMenuItem * -BMenu::Track(bool sticky, BRect *clickToOpenRect) +BMenuItem* +BMenu::Track(bool sticky, BRect* clickToOpenRect) { if (sticky && LockLooper()) { //RedrawAfterSticky(Bounds()); @@ -1299,7 +1304,7 @@ _SetStickyMode(sticky); int action; - BMenuItem *menuItem = _Track(&action); + BMenuItem* menuItem = _Track(&action); fExtraRect = NULL; @@ -1351,7 +1356,7 @@ void -BMenu::SetTrackingHook(menu_tracking_hook func, void *state) +BMenu::SetTrackingHook(menu_tracking_hook func, void* state) { delete fExtraMenuData; fExtraMenuData = new (nothrow) BPrivate::ExtraMenuData(func, state); @@ -1364,13 +1369,6 @@ void BMenu::_ReservedMenu6() {} -BMenu & -BMenu::operator=(const BMenu &) -{ - return *this; -} - - void BMenu::_InitData(BMessage* archive) { @@ -1389,7 +1387,7 @@ fTriggerEnabled = sMenuInfo.triggers_always_shown; if (archive != NULL) { - archive->FindInt32("_layout", (int32 *)&fLayout); + archive->FindInt32("_layout", (int32*)&fLayout); archive->FindBool("_rsize_to_fit", &fResizeToFit); bool disabled; if (archive->FindBool("_disable", &disabled) == B_OK) @@ -1405,8 +1403,8 @@ BMessage msg; for (int32 i = 0; archive->FindMessage("_items", i, &msg) == B_OK; i++) { - BArchivable *object = instantiate_object(&msg); - if (BMenuItem *item = dynamic_cast(object)) { + BArchivable* object = instantiate_object(&msg); + if (BMenuItem* item = dynamic_cast(object)) { BRect bounds; if (fLayout == B_ITEMS_IN_MATRIX && archive->FindRect("_i_frames", i, &bounds) == B_OK) @@ -1424,7 +1422,7 @@ { // See if the supermenu has a cached menuwindow, // and use that one if possible. - BMenuWindow *window = NULL; + BMenuWindow* window = NULL; bool ourWindow = false; if (fSuper != NULL) { fSuperbounds = fSuper->ConvertToScreen(fSuper->Bounds()); @@ -1481,7 +1479,7 @@ void BMenu::_Hide() { - BMenuWindow *window = dynamic_cast(Window()); + BMenuWindow* window = dynamic_cast(Window()); if (window == NULL || !window->Lock()) return; @@ -1513,11 +1511,11 @@ // TODO: Same as above. Actually, we could get rid of the kHysteresis -BMenuItem * -BMenu::_Track(int *action, long start) +BMenuItem* +BMenu::_Track(int* action, long start) { // TODO: cleanup - BMenuItem *item = NULL; + BMenuItem* item = NULL; BRect navAreaRectAbove, navAreaRectBelow; bigtime_t selectedTime = system_time(); bigtime_t navigationAreaTime = 0; @@ -1543,7 +1541,7 @@ if (!LockLooper()) break; - BMenuWindow *window = static_cast(Window()); + BMenuWindow* window = static_cast(Window()); BPoint screenLocation = ConvertToScreen(location); if (window->CheckForScrolling(screenLocation)) { UnlockLooper(); @@ -1567,14 +1565,14 @@ // redraw itself UnlockLooper(); int submenuAction = MENU_STATE_TRACKING; - BMenu *submenu = fSelected->Submenu(); + BMenu* submenu = fSelected->Submenu(); submenu->_SetStickyMode(_IsStickyMode()); // The following call blocks until the submenu // gives control back to us, either because the mouse // pointer goes out of the submenu's bounds, or because // the user closes the menu - BMenuItem *submenuItem = submenu->_Track(&submenuAction); + BMenuItem* submenuItem = submenu->_Track(&submenuAction); if (submenuAction == MENU_STATE_CLOSED) { item = submenuItem; fState = MENU_STATE_CLOSED; @@ -1627,7 +1625,8 @@ // mouseSpeed in px per ms // (actually point_distance returns the square of the distance, // so it's more px^2 per ms) - mouseSpeed = (int32)(point_distance(newLocation, location) * 1000 / (newPollTime - pollTime)); + mouseSpeed = (int32)(point_distance(newLocation, location) * 1000 + / (newPollTime - pollTime)); pollTime = newPollTime; if (newLocation != location || newButtons != buttons) { @@ -1698,7 +1697,7 @@ if (fSelected == NULL) return; - BMenu *submenu = fSelected->Submenu(); + BMenu* submenu = fSelected->Submenu(); if (submenu != NULL) { BRect menuBounds = ConvertToScreen(Bounds()); @@ -1857,7 +1856,7 @@ bool -BMenu::_AddItem(BMenuItem *item, int32 index) +BMenu::_AddItem(BMenuItem* item, int32 index) { ASSERT(item != NULL); if (index < 0 || index > fItems.CountItems()) @@ -1885,13 +1884,13 @@ bool -BMenu::_RemoveItems(int32 index, int32 count, BMenuItem *item, bool deleteItems) +BMenu::_RemoveItems(int32 index, int32 count, BMenuItem* item, bool deleteItems) { bool success = false; bool invalidateLayout = false; bool locked = LockLooper(); - BWindow *window = Window(); + BWindow* window = Window(); // The plan is simple: If we're given a BMenuItem directly, we use it // and ignore index and count. Otherwise, we use them instead. @@ -2060,7 +2059,7 @@ frame.Set(0, 0, 0, -1); for (; index < fItems.CountItems(); index++) { - BMenuItem *item = ItemAt(index); + BMenuItem* item = ItemAt(index); float width, height; item->GetContentSize(&width, &height); @@ -2121,7 +2120,7 @@ + fPad.bottom)); for (int32 i = 0; i < fItems.CountItems(); i++) { - BMenuItem *item = ItemAt(i); + BMenuItem* item = ItemAt(i); float width, height; item->GetContentSize(&width, &height); @@ -2152,7 +2151,7 @@ { frame.Set(0, 0, 0, 0); for (int32 i = 0; i < CountItems(); i++) { - BMenuItem *item = ItemAt(i); + BMenuItem* item = ItemAt(i); if (item != NULL) { frame.left = min_c(frame.left, item->Frame().left); frame.right = max_c(frame.right, item->Frame().right); @@ -2167,8 +2166,8 @@ BPoint BMenu::ScreenLocation() { - BMenu *superMenu = Supermenu(); - BMenuItem *superItem = Superitem(); + BMenu* superMenu = Supermenu(); + BMenuItem* superItem = Superitem(); if (superMenu == NULL || superItem == NULL) { debugger("BMenu can't determine where to draw." @@ -2188,7 +2187,7 @@ BRect -BMenu::_CalcFrame(BPoint where, bool *scrollOn) +BMenu::_CalcFrame(BPoint where, bool* scrollOn) { // TODO: Improve me BRect bounds = Bounds(); @@ -2197,15 +2196,15 @@ BScreen screen(Window()); BRect screenFrame = screen.Frame(); - BMenu *superMenu = Supermenu(); - BMenuItem *superItem = Superitem(); + BMenu* superMenu = Supermenu(); + BMenuItem* superItem = Superitem(); bool scroll = false; // TODO: Horrible hack: // When added to a BMenuField, a BPopUpMenu is the child of // a _BMCMenuBar_ to "fake" the menu hierarchy if (superMenu == NULL || superItem == NULL - || dynamic_cast<_BMCMenuBar_ *>(superMenu) != NULL) { + || dynamic_cast<_BMCMenuBar_*>(superMenu) != NULL) { // just move the window on screen if (frame.bottom > screenFrame.bottom) @@ -2217,7 +2216,6 @@ frame.OffsetBy(screenFrame.right - frame.right, 0); else if (frame.left < screenFrame.left) frame.OffsetBy(-frame.left, 0); - } else if (superMenu->Layout() == B_ITEMS_IN_COLUMN) { if (frame.right > screenFrame.right) frame.OffsetBy(-superItem->Frame().Width() - frame.Width() - 2, 0); @@ -2230,7 +2228,7 @@ } else { if (frame.bottom > screenFrame.bottom) { if (scrollOn != NULL && superMenu != NULL - && dynamic_cast(superMenu) != NULL + && dynamic_cast(superMenu) != NULL && frame.top < (screenFrame.bottom - 80)) { scroll = true; } else { @@ -2262,7 +2260,7 @@ { int32 itemCount = fItems.CountItems(); for (int32 i = 0; i < itemCount; i++) { - BMenuItem *item = ItemAt(i); + BMenuItem* item = ItemAt(i); if (item->Frame().Intersects(updateRect)) item->Draw(); } @@ -2270,7 +2268,7 @@ int -BMenu::_State(BMenuItem **item) const +BMenu::_State(BMenuItem** item) const { if (fState == MENU_STATE_TRACKING || fState == MENU_STATE_CLOSED) return fState; @@ -2283,7 +2281,7 @@ void -BMenu::_InvokeItem(BMenuItem *item, bool now) +BMenu::_InvokeItem(BMenuItem* item, bool now) { if (!item->IsEnabled()) return; @@ -2308,8 +2306,8 @@ } // Lock the root menu window before calling BMenuItem::Invoke() - BMenu *parent = this; - BMenu *rootMenu = NULL; + BMenu* parent = this; + BMenu* rootMenu = NULL; do { rootMenu = parent; parent = rootMenu->Supermenu(); @@ -2333,12 +2331,12 @@ bool -BMenu::_OverSubmenu(BMenuItem *item, BPoint loc) +BMenu::_OverSubmenu(BMenuItem* item, BPoint loc) { if (item == NULL) return false; - BMenu *subMenu = item->Submenu(); + BMenu* subMenu = item->Submenu(); if (subMenu == NULL || subMenu->Window() == NULL) return false; @@ -2350,7 +2348,7 @@ } -BMenuWindow * +BMenuWindow* BMenu::_MenuWindow() { #if USE_CACHED_MENUWINDOW @@ -2375,7 +2373,7 @@ } -BMenuItem * +BMenuItem* BMenu::_HitTestItems(BPoint where, BPoint slop) const { // TODO: Take "slop" into account ? @@ -2387,7 +2385,7 @@ int32 itemCount = CountItems(); for (int32 i = 0; i < itemCount; i++) { - BMenuItem *item = ItemAt(i); + BMenuItem* item = ItemAt(i); if (item->Frame().Contains(where)) return item; } @@ -2415,7 +2413,7 @@ void -BMenu::_ItemMarked(BMenuItem *item) +BMenu::_ItemMarked(BMenuItem* item) { [... truncated: 974 lines follow ...] From axeld at mail.berlios.de Fri Aug 7 10:36:13 2009 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Fri, 7 Aug 2009 10:36:13 +0200 Subject: [Haiku-commits] r32175 - haiku/trunk/src/preferences/joysticks Message-ID: <200908070836.n778aDfP015691@sheep.berlios.de> Author: axeld Date: 2009-08-07 10:36:13 +0200 (Fri, 07 Aug 2009) New Revision: 32175 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32175&view=rev Modified: haiku/trunk/src/preferences/joysticks/Jamfile Log: * Fixed build. Modified: haiku/trunk/src/preferences/joysticks/Jamfile =================================================================== --- haiku/trunk/src/preferences/joysticks/Jamfile 2009-08-07 08:01:27 UTC (rev 32174) +++ haiku/trunk/src/preferences/joysticks/Jamfile 2009-08-07 08:36:13 UTC (rev 32175) @@ -8,7 +8,7 @@ Joysticks.cpp MessageWin.cpp PortItem.cpp - : be device + : be libdevice.so : Joysticks.rdef ; From axeld at mail.berlios.de Fri Aug 7 10:41:17 2009 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Fri, 7 Aug 2009 10:41:17 +0200 Subject: [Haiku-commits] r32176 - haiku/trunk/src/preferences/screen Message-ID: <200908070841.n778fH7e016598@sheep.berlios.de> Author: axeld Date: 2009-08-07 10:41:17 +0200 (Fri, 07 Aug 2009) New Revision: 32176 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32176&view=rev Modified: haiku/trunk/src/preferences/screen/ScreenWindow.cpp Log: * The colors menu had "label from marked" activated, but then replaced its label, causing bug #4193. Modified: haiku/trunk/src/preferences/screen/ScreenWindow.cpp =================================================================== --- haiku/trunk/src/preferences/screen/ScreenWindow.cpp 2009-08-07 08:36:13 UTC (rev 32175) +++ haiku/trunk/src/preferences/screen/ScreenWindow.cpp 2009-08-07 08:41:17 UTC (rev 32176) @@ -279,7 +279,7 @@ fResolutionField = new BMenuField("ResolutionMenu", "Resolution:", fResolutionMenu, NULL); - fColorsMenu = new BPopUpMenu("colors", true, true); + fColorsMenu = new BPopUpMenu("colors", true, false); for (int32 i = 0; i < kColorSpaceCount; i++) { BMessage *message = new BMessage(POP_COLORS_MSG); @@ -1121,7 +1121,7 @@ length = snprintf(text, sizeof(text), "Horizonal Frequency:\t%lu - %lu kHz\n" "Vertical Frequency:\t%lu - %lu Hz\n\n" - "Maximum Pixel Clock:\t%g MHz", + "Maximum Pixel Clock:\t%g MHz", info.min_horizontal_frequency, info.max_horizontal_frequency, info.min_vertical_frequency, info.max_vertical_frequency, info.max_pixel_clock / 1000.0); @@ -1130,7 +1130,7 @@ length += snprintf(text + length, sizeof(text) - length, "%sSerial no.: %s", length ? "\n\n" : "", info.serial_number); - if (info.produced.week != 0 && info.produced.year != 0 + if (info.produced.week != 0 && info.produced.year != 0 && length < sizeof(text)) { length += snprintf(text + length, sizeof(text) - length, "(%u/%u)", info.produced.week, info.produced.year); From axeld at mail.berlios.de Fri Aug 7 10:52:33 2009 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Fri, 7 Aug 2009 10:52:33 +0200 Subject: [Haiku-commits] r32177 - in haiku/trunk: headers/os/interface src/kits/interface Message-ID: <200908070852.n778qX0M019648@sheep.berlios.de> Author: axeld Date: 2009-08-07 10:52:32 +0200 (Fri, 07 Aug 2009) New Revision: 32177 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32177&view=rev Modified: haiku/trunk/headers/os/interface/MenuField.h haiku/trunk/src/kits/interface/Menu.cpp haiku/trunk/src/kits/interface/MenuField.cpp Log: * Added missing default initializer for the message. * Changed BMenuField::MenuBarLayoutItem::BasePreferredSize() to return the min size as well, instead of a fixed 100 pixels for the width... * More minor cleanup. Modified: haiku/trunk/headers/os/interface/MenuField.h =================================================================== --- haiku/trunk/headers/os/interface/MenuField.h 2009-08-07 08:41:17 UTC (rev 32176) +++ haiku/trunk/headers/os/interface/MenuField.h 2009-08-07 08:52:32 UTC (rev 32177) @@ -27,7 +27,7 @@ uint32 flags = B_WILL_DRAW | B_NAVIGABLE); BMenuField(const char* name, const char* label, BMenu* menu, - BMessage* message, + BMessage* message = NULL, uint32 flags = B_WILL_DRAW | B_NAVIGABLE); BMenuField(const char* label, BMenu* menu, BMessage* message = NULL); Modified: haiku/trunk/src/kits/interface/Menu.cpp =================================================================== --- haiku/trunk/src/kits/interface/Menu.cpp 2009-08-07 08:41:17 UTC (rev 32176) +++ haiku/trunk/src/kits/interface/Menu.cpp 2009-08-07 08:52:32 UTC (rev 32177) @@ -184,7 +184,8 @@ BMenu::BMenu(const char* name, menu_layout layout) - : BView(BRect(0, 0, 0, 0), name, 0, B_WILL_DRAW), + : + BView(BRect(0, 0, 0, 0), name, 0, B_WILL_DRAW), fChosenItem(NULL), fPad(14.0f, 2.0f, 20.0f, 0.0f), fSelected(NULL), @@ -218,7 +219,8 @@ BMenu::BMenu(const char* name, float width, float height) - : BView(BRect(0.0f, width, 0.0f, height), name, 0, B_WILL_DRAW), + : + BView(BRect(0.0f, width, 0.0f, height), name, 0, B_WILL_DRAW), fChosenItem(NULL), fSelected(NULL), fCachedMenuWindow(NULL), @@ -263,7 +265,8 @@ BMenu::BMenu(BMessage* archive) - : BView(archive), + : + BView(archive), fChosenItem(NULL), fPad(14.0f, 2.0f, 20.0f, 0.0f), fSelected(NULL), Modified: haiku/trunk/src/kits/interface/MenuField.cpp =================================================================== --- haiku/trunk/src/kits/interface/MenuField.cpp 2009-08-07 08:41:17 UTC (rev 32176) +++ haiku/trunk/src/kits/interface/MenuField.cpp 2009-08-07 08:52:32 UTC (rev 32177) @@ -1136,8 +1136,9 @@ BMenuField::LabelLayoutItem::LabelLayoutItem(BMenuField* parent) - : fParent(parent), - fFrame() + : + fParent(parent), + fFrame() { } @@ -1216,8 +1217,9 @@ BMenuField::MenuBarLayoutItem::MenuBarLayoutItem(BMenuField* parent) - : fParent(parent), - fFrame() + : + fParent(parent), + fFrame() { // by default the part right of the divider shall have an unlimited maximum // width @@ -1286,10 +1288,7 @@ BSize BMenuField::MenuBarLayoutItem::BasePreferredSize() { - BSize size(BaseMinSize()); - // puh, no idea... - size.width = 100; - return size; + return BaseMinSize(); } From zooey at mail.berlios.de Fri Aug 7 12:11:39 2009 From: zooey at mail.berlios.de (zooey at BerliOS) Date: Fri, 7 Aug 2009 12:11:39 +0200 Subject: [Haiku-commits] r32178 - in haiku/branches/components/gsoc-locale-kit: 3rdparty/mmu_man/themes build/jam data/develop headers/os/app headers/os/game headers/os/interface headers/os/media headers/os/support headers/posix headers/private/app headers/private/binary_compatibility headers/private/graphics/common headers/private/graphics/vesa headers/private/interface headers/private/kernel headers/private/kernel/arch headers/private/kernel/arch/m68k headers/private/kernel/arch/x86 headers/private/kernel/boot headers/private/media headers/private/shared headers/private/system/arch/arm src/add-ons/accelerants/common src/add-ons/accelerants/vesa src/add-ons/disk_systems/intel src/add-ons/kernel/drivers/ports src/add-ons/kernel/drivers/power/acpi_battery src/add-ons/kernel/file_systems/bfs src/add-ons/kernel/file_systems/ext2 src/add-ons/kernel/partitioning_systems/intel src/add-ons/media/media-add-ons src/add-ons/media/plugins/ffmpeg src/add-ons/media/plugins/ffmpeg/libavcodec src/add-ons/! media/plugins/ffmpeg/libavcodec/x86 src/add-ons/media/plugins/ffmpeg/libavformat src/add-ons/media/plugins/ffmpeg/libswscale src/add-ons/tracker/zipomatic src/add-ons/translators/jpeg src/add-ons/translators/jpeg2000 src/apps src/apps/debuganalyzer/gui src/apps/debugger/gui/team_window src/apps/drivesetup src/apps/mediaconverter src/apps/mediaplayer/media_node_framework/audio src/apps/packageinstaller src/apps/powerstatus src/bin src/bin/makebootable/platform/bios_ia32 src/bin/network/mount_nfs src/kits/app src/kits/game src/kits/interface src/kits/media src/kits/opengl src/kits/support src/kits/tracker src/preferences/appearance src/preferences/bluetooth src/preferences/joysticks src/preferences/screen src/servers/app src/servers/app/drawing src/servers/media src/servers/registrar src/system/boot/loader src/system/boot/platform/atari_m68k src/system/boot/platform/bios_ia32 src/system/boot/platform/openfirmware src/system/boot/platform/openfirmware/arch/ppc src/system/boot/! platform/pxe_ia32 src/system/boot/platform/u-boot src/system/k! ernel sr Message-ID: <200908071011.n77ABdJX006073@sheep.berlios.de> Author: zooey Date: 2009-08-07 12:11:16 +0200 (Fri, 07 Aug 2009) New Revision: 32178 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32178&view=rev Added: haiku/branches/components/gsoc-locale-kit/headers/private/interface/ToolTip.h haiku/branches/components/gsoc-locale-kit/headers/private/interface/ToolTipManager.h haiku/branches/components/gsoc-locale-kit/headers/private/interface/ToolTipWindow.h haiku/branches/components/gsoc-locale-kit/headers/private/media/MediaWriter.h haiku/branches/components/gsoc-locale-kit/headers/private/system/arch/arm/board/ haiku/branches/components/gsoc-locale-kit/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp haiku/branches/components/gsoc-locale-kit/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.h haiku/branches/components/gsoc-locale-kit/src/add-ons/media/plugins/ffmpeg/EncoderTable.cpp haiku/branches/components/gsoc-locale-kit/src/add-ons/media/plugins/ffmpeg/EncoderTable.h haiku/branches/components/gsoc-locale-kit/src/apps/haiku3d/ haiku/branches/components/gsoc-locale-kit/src/kits/interface/ToolTip.cpp haiku/branches/components/gsoc-locale-kit/src/kits/interface/ToolTipManager.cpp haiku/branches/components/gsoc-locale-kit/src/kits/media/MediaWriter.cpp haiku/branches/components/gsoc-locale-kit/src/system/boot/platform/bios_ia32/multiboot.cpp haiku/branches/components/gsoc-locale-kit/src/system/boot/platform/bios_ia32/multiboot.h haiku/branches/components/gsoc-locale-kit/src/system/kernel/arch/x86/arch_int.cpp haiku/branches/components/gsoc-locale-kit/src/tests/kits/interface/ToolTipTest.cpp Removed: haiku/branches/components/gsoc-locale-kit/src/system/boot/platform/bios_ia32/images.h haiku/branches/components/gsoc-locale-kit/src/system/boot/platform/u-boot/images.h haiku/branches/components/gsoc-locale-kit/src/system/kernel/arch/sh4/ haiku/branches/components/gsoc-locale-kit/src/system/kernel/arch/sparc/ haiku/branches/components/gsoc-locale-kit/src/system/kernel/arch/sparc64/ haiku/branches/components/gsoc-locale-kit/src/system/kernel/arch/x86/arch_int.c Modified: haiku/branches/components/gsoc-locale-kit/3rdparty/mmu_man/themes/UITheme.h haiku/branches/components/gsoc-locale-kit/build/jam/BuildSetup haiku/branches/components/gsoc-locale-kit/build/jam/HaikuImage haiku/branches/components/gsoc-locale-kit/build/jam/OptionalPackageDependencies haiku/branches/components/gsoc-locale-kit/build/jam/OptionalPackages haiku/branches/components/gsoc-locale-kit/build/jam/ReleaseBuildProfiles haiku/branches/components/gsoc-locale-kit/data/develop/makefile-engine haiku/branches/components/gsoc-locale-kit/headers/os/app/AppDefs.h haiku/branches/components/gsoc-locale-kit/headers/os/app/Message.h haiku/branches/components/gsoc-locale-kit/headers/os/game/WindowScreen.h haiku/branches/components/gsoc-locale-kit/headers/os/interface/InterfaceDefs.h haiku/branches/components/gsoc-locale-kit/headers/os/interface/MenuField.h haiku/branches/components/gsoc-locale-kit/headers/os/interface/View.h haiku/branches/components/gsoc-locale-kit/headers/os/interface/Window.h haiku/branches/components/gsoc-locale-kit/headers/os/media/BufferGroup.h haiku/branches/components/gsoc-locale-kit/headers/os/media/MediaFile.h haiku/branches/components/gsoc-locale-kit/headers/os/media/MediaFormats.h haiku/branches/components/gsoc-locale-kit/headers/os/media/MediaTrack.h haiku/branches/components/gsoc-locale-kit/headers/os/support/String.h haiku/branches/components/gsoc-locale-kit/headers/posix/wchar.h haiku/branches/components/gsoc-locale-kit/headers/private/app/MessagePrivate.h haiku/branches/components/gsoc-locale-kit/headers/private/binary_compatibility/Global.h haiku/branches/components/gsoc-locale-kit/headers/private/binary_compatibility/Interface.h haiku/branches/components/gsoc-locale-kit/headers/private/graphics/common/create_display_modes.h haiku/branches/components/gsoc-locale-kit/headers/private/graphics/vesa/vesa.h haiku/branches/components/gsoc-locale-kit/headers/private/interface/BMCPrivate.h haiku/branches/components/gsoc-locale-kit/headers/private/interface/MenuPrivate.h haiku/branches/components/gsoc-locale-kit/headers/private/kernel/arch/debug.h haiku/branches/components/gsoc-locale-kit/headers/private/kernel/arch/m68k/arch_vm.h haiku/branches/components/gsoc-locale-kit/headers/private/kernel/arch/vm_translation_map.h haiku/branches/components/gsoc-locale-kit/headers/private/kernel/arch/x86/arch_cpu.h haiku/branches/components/gsoc-locale-kit/headers/private/kernel/boot/stage2_args.h haiku/branches/components/gsoc-locale-kit/headers/private/kernel/cpu.h haiku/branches/components/gsoc-locale-kit/headers/private/kernel/debug.h haiku/branches/components/gsoc-locale-kit/headers/private/kernel/heap.h haiku/branches/components/gsoc-locale-kit/headers/private/kernel/kernel.h haiku/branches/components/gsoc-locale-kit/headers/private/kernel/smp.h haiku/branches/components/gsoc-locale-kit/headers/private/kernel/tracing.h haiku/branches/components/gsoc-locale-kit/headers/private/kernel/user_atomic.h haiku/branches/components/gsoc-locale-kit/headers/private/media/DataExchange.h haiku/branches/components/gsoc-locale-kit/headers/private/media/EncoderPlugin.h haiku/branches/components/gsoc-locale-kit/headers/private/media/PluginManager.h haiku/branches/components/gsoc-locale-kit/headers/private/media/WriterPlugin.h haiku/branches/components/gsoc-locale-kit/headers/private/shared/HashMap.h haiku/branches/components/gsoc-locale-kit/src/add-ons/accelerants/common/create_display_modes.cpp haiku/branches/components/gsoc-locale-kit/src/add-ons/accelerants/vesa/mode.cpp haiku/branches/components/gsoc-locale-kit/src/add-ons/disk_systems/intel/PartitionMapAddOn.cpp haiku/branches/components/gsoc-locale-kit/src/add-ons/kernel/drivers/ports/Jamfile haiku/branches/components/gsoc-locale-kit/src/add-ons/kernel/drivers/power/acpi_battery/acpi_battery.cpp haiku/branches/components/gsoc-locale-kit/src/add-ons/kernel/drivers/power/acpi_battery/acpi_battery.h haiku/branches/components/gsoc-locale-kit/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp haiku/branches/components/gsoc-locale-kit/src/add-ons/kernel/file_systems/bfs/Debug.cpp haiku/branches/components/gsoc-locale-kit/src/add-ons/kernel/file_systems/bfs/Index.cpp haiku/branches/components/gsoc-locale-kit/src/add-ons/kernel/file_systems/bfs/Inode.cpp haiku/branches/components/gsoc-locale-kit/src/add-ons/kernel/file_systems/bfs/Inode.h haiku/branches/components/gsoc-locale-kit/src/add-ons/kernel/file_systems/bfs/Query.cpp haiku/branches/components/gsoc-locale-kit/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp haiku/branches/components/gsoc-locale-kit/src/add-ons/kernel/file_systems/ext2/Inode.cpp haiku/branches/components/gsoc-locale-kit/src/add-ons/kernel/partitioning_systems/intel/PartitionLocker.cpp haiku/branches/components/gsoc-locale-kit/src/add-ons/media/media-add-ons/Jamfile haiku/branches/components/gsoc-locale-kit/src/add-ons/media/plugins/ffmpeg/AVCodecDecoder.cpp haiku/branches/components/gsoc-locale-kit/src/add-ons/media/plugins/ffmpeg/AVCodecDecoder.h haiku/branches/components/gsoc-locale-kit/src/add-ons/media/plugins/ffmpeg/AVFormatReader.cpp haiku/branches/components/gsoc-locale-kit/src/add-ons/media/plugins/ffmpeg/AVFormatWriter.cpp haiku/branches/components/gsoc-locale-kit/src/add-ons/media/plugins/ffmpeg/AVFormatWriter.h haiku/branches/components/gsoc-locale-kit/src/add-ons/media/plugins/ffmpeg/FFmpegPlugin.cpp haiku/branches/components/gsoc-locale-kit/src/add-ons/media/plugins/ffmpeg/FFmpegPlugin.h haiku/branches/components/gsoc-locale-kit/src/add-ons/media/plugins/ffmpeg/Jamfile haiku/branches/components/gsoc-locale-kit/src/add-ons/media/plugins/ffmpeg/MuxerTable.cpp haiku/branches/components/gsoc-locale-kit/src/add-ons/media/plugins/ffmpeg/config.h haiku/branches/components/gsoc-locale-kit/src/add-ons/media/plugins/ffmpeg/libavcodec/Jamfile haiku/branches/components/gsoc-locale-kit/src/add-ons/media/plugins/ffmpeg/libavcodec/x86/Jamfile haiku/branches/components/gsoc-locale-kit/src/add-ons/media/plugins/ffmpeg/libavformat/utils.c haiku/branches/components/gsoc-locale-kit/src/add-ons/media/plugins/ffmpeg/libswscale/swscale.h haiku/branches/components/gsoc-locale-kit/src/add-ons/tracker/zipomatic/ZipOMatic.cpp haiku/branches/components/gsoc-locale-kit/src/add-ons/tracker/zipomatic/ZipOMatic.h haiku/branches/components/gsoc-locale-kit/src/add-ons/tracker/zipomatic/ZipOMaticMisc.h haiku/branches/components/gsoc-locale-kit/src/add-ons/tracker/zipomatic/ZipOMaticWindow.cpp haiku/branches/components/gsoc-locale-kit/src/add-ons/tracker/zipomatic/ZipOMaticWindow.h haiku/branches/components/gsoc-locale-kit/src/add-ons/tracker/zipomatic/ZipperThread.cpp haiku/branches/components/gsoc-locale-kit/src/add-ons/tracker/zipomatic/ZipperThread.h haiku/branches/components/gsoc-locale-kit/src/add-ons/translators/jpeg/JPEGTranslator.cpp haiku/branches/components/gsoc-locale-kit/src/add-ons/translators/jpeg/JPEGTranslator.h haiku/branches/components/gsoc-locale-kit/src/add-ons/translators/jpeg2000/JPEG2000Translator.cpp haiku/branches/components/gsoc-locale-kit/src/add-ons/translators/jpeg2000/JPEG2000Translator.h haiku/branches/components/gsoc-locale-kit/src/apps/Jamfile haiku/branches/components/gsoc-locale-kit/src/apps/debuganalyzer/gui/HeaderView.cpp haiku/branches/components/gsoc-locale-kit/src/apps/debugger/gui/team_window/SourceView.cpp haiku/branches/components/gsoc-locale-kit/src/apps/drivesetup/CreateParamsPanel.cpp haiku/branches/components/gsoc-locale-kit/src/apps/drivesetup/InitParamsPanel.cpp haiku/branches/components/gsoc-locale-kit/src/apps/drivesetup/MainWindow.cpp haiku/branches/components/gsoc-locale-kit/src/apps/mediaconverter/Jamfile haiku/branches/components/gsoc-locale-kit/src/apps/mediaconverter/MediaConverterApp.cpp haiku/branches/components/gsoc-locale-kit/src/apps/mediaconverter/MediaConverterWindow.cpp haiku/branches/components/gsoc-locale-kit/src/apps/mediaconverter/MediaConverterWindow.h haiku/branches/components/gsoc-locale-kit/src/apps/mediaconverter/MediaFileListView.cpp haiku/branches/components/gsoc-locale-kit/src/apps/mediaconverter/MediaFileListView.h haiku/branches/components/gsoc-locale-kit/src/apps/mediaplayer/media_node_framework/audio/AudioProducer.cpp haiku/branches/components/gsoc-locale-kit/src/apps/packageinstaller/PackageItem.cpp haiku/branches/components/gsoc-locale-kit/src/apps/packageinstaller/PackageItem.h haiku/branches/components/gsoc-locale-kit/src/apps/packageinstaller/PackageView.cpp haiku/branches/components/gsoc-locale-kit/src/apps/packageinstaller/PackageView.h haiku/branches/components/gsoc-locale-kit/src/apps/powerstatus/DriverInterface.cpp haiku/branches/components/gsoc-locale-kit/src/apps/powerstatus/DriverInterface.h haiku/branches/components/gsoc-locale-kit/src/apps/powerstatus/ExtendedInfoWindow.cpp haiku/branches/components/gsoc-locale-kit/src/apps/powerstatus/ExtendedInfoWindow.h haiku/branches/components/gsoc-locale-kit/src/apps/powerstatus/PowerStatusView.cpp haiku/branches/components/gsoc-locale-kit/src/apps/powerstatus/PowerStatusView.h haiku/branches/components/gsoc-locale-kit/src/bin/makebootable/platform/bios_ia32/makebootable.cpp haiku/branches/components/gsoc-locale-kit/src/bin/mountvolume.cpp haiku/branches/components/gsoc-locale-kit/src/bin/network/mount_nfs/mount_nfs.cpp haiku/branches/components/gsoc-locale-kit/src/bin/safemode.c haiku/branches/components/gsoc-locale-kit/src/kits/app/Message.cpp haiku/branches/components/gsoc-locale-kit/src/kits/app/MessageAdapter.cpp haiku/branches/components/gsoc-locale-kit/src/kits/app/MessageUtils.cpp haiku/branches/components/gsoc-locale-kit/src/kits/game/WindowScreen.cpp haiku/branches/components/gsoc-locale-kit/src/kits/interface/BMCPrivate.cpp haiku/branches/components/gsoc-locale-kit/src/kits/interface/ControlLook.cpp haiku/branches/components/gsoc-locale-kit/src/kits/interface/InterfaceDefs.cpp haiku/branches/components/gsoc-locale-kit/src/kits/interface/Jamfile haiku/branches/components/gsoc-locale-kit/src/kits/interface/ListView.cpp haiku/branches/components/gsoc-locale-kit/src/kits/interface/Menu.cpp haiku/branches/components/gsoc-locale-kit/src/kits/interface/MenuBar.cpp haiku/branches/components/gsoc-locale-kit/src/kits/interface/MenuField.cpp haiku/branches/components/gsoc-locale-kit/src/kits/interface/MenuItem.cpp haiku/branches/components/gsoc-locale-kit/src/kits/interface/MenuPrivate.cpp haiku/branches/components/gsoc-locale-kit/src/kits/interface/MenuWindow.cpp haiku/branches/components/gsoc-locale-kit/src/kits/interface/TabView.cpp haiku/branches/components/gsoc-locale-kit/src/kits/interface/TextView.cpp haiku/branches/components/gsoc-locale-kit/src/kits/interface/View.cpp haiku/branches/components/gsoc-locale-kit/src/kits/interface/Window.cpp haiku/branches/components/gsoc-locale-kit/src/kits/media/Buffer.cpp haiku/branches/components/gsoc-locale-kit/src/kits/media/BufferGroup.cpp haiku/branches/components/gsoc-locale-kit/src/kits/media/EncoderPlugin.cpp haiku/branches/components/gsoc-locale-kit/src/kits/media/Jamfile haiku/branches/components/gsoc-locale-kit/src/kits/media/MediaExtractor.cpp haiku/branches/components/gsoc-locale-kit/src/kits/media/MediaFile.cpp haiku/branches/components/gsoc-locale-kit/src/kits/media/MediaFormats.cpp haiku/branches/components/gsoc-locale-kit/src/kits/media/MediaTrack.cpp haiku/branches/components/gsoc-locale-kit/src/kits/media/PluginManager.cpp haiku/branches/components/gsoc-locale-kit/src/kits/opengl/GLView.cpp haiku/branches/components/gsoc-locale-kit/src/kits/support/String.cpp haiku/branches/components/gsoc-locale-kit/src/kits/tracker/FindPanel.cpp haiku/branches/components/gsoc-locale-kit/src/preferences/appearance/ColorSet.cpp haiku/branches/components/gsoc-locale-kit/src/preferences/bluetooth/BluetoothSettingsView.cpp haiku/branches/components/gsoc-locale-kit/src/preferences/joysticks/Jamfile haiku/branches/components/gsoc-locale-kit/src/preferences/screen/MonitorView.cpp haiku/branches/components/gsoc-locale-kit/src/preferences/screen/MonitorView.h haiku/branches/components/gsoc-locale-kit/src/preferences/screen/ScreenMode.cpp haiku/branches/components/gsoc-locale-kit/src/preferences/screen/ScreenMode.h haiku/branches/components/gsoc-locale-kit/src/preferences/screen/ScreenSettings.cpp haiku/branches/components/gsoc-locale-kit/src/preferences/screen/ScreenWindow.cpp haiku/branches/components/gsoc-locale-kit/src/preferences/screen/ScreenWindow.h haiku/branches/components/gsoc-locale-kit/src/preferences/screen/gtf.cpp haiku/branches/components/gsoc-locale-kit/src/servers/app/Desktop.cpp haiku/branches/components/gsoc-locale-kit/src/servers/app/FontManager.cpp haiku/branches/components/gsoc-locale-kit/src/servers/app/ServerPicture.cpp haiku/branches/components/gsoc-locale-kit/src/servers/app/ServerWindow.cpp haiku/branches/components/gsoc-locale-kit/src/servers/app/ServerWindow.h haiku/branches/components/gsoc-locale-kit/src/servers/app/Window.cpp haiku/branches/components/gsoc-locale-kit/src/servers/app/Window.h haiku/branches/components/gsoc-locale-kit/src/servers/app/drawing/AccelerantHWInterface.cpp haiku/branches/components/gsoc-locale-kit/src/servers/media/AddOnManager.cpp haiku/branches/components/gsoc-locale-kit/src/servers/media/AddOnManager.h haiku/branches/components/gsoc-locale-kit/src/servers/media/BufferManager.cpp haiku/branches/components/gsoc-locale-kit/src/servers/media/BufferManager.h haiku/branches/components/gsoc-locale-kit/src/servers/media/FormatManager.cpp haiku/branches/components/gsoc-locale-kit/src/servers/media/FormatManager.h haiku/branches/components/gsoc-locale-kit/src/servers/media/media_server.cpp haiku/branches/components/gsoc-locale-kit/src/servers/registrar/MessageDeliverer.cpp haiku/branches/components/gsoc-locale-kit/src/system/boot/loader/Jamfile haiku/branches/components/gsoc-locale-kit/src/system/boot/loader/elf.cpp haiku/branches/components/gsoc-locale-kit/src/system/boot/loader/kernel_args.cpp haiku/branches/components/gsoc-locale-kit/src/system/boot/loader/load_driver_settings.cpp haiku/branches/components/gsoc-locale-kit/src/system/boot/loader/load_driver_settings.h haiku/branches/components/gsoc-locale-kit/src/system/boot/loader/main.cpp haiku/branches/components/gsoc-locale-kit/src/system/boot/loader/partitions.cpp haiku/branches/components/gsoc-locale-kit/src/system/boot/platform/atari_m68k/start.c haiku/branches/components/gsoc-locale-kit/src/system/boot/platform/bios_ia32/Jamfile haiku/branches/components/gsoc-locale-kit/src/system/boot/platform/bios_ia32/mmu.cpp haiku/branches/components/gsoc-locale-kit/src/system/boot/platform/bios_ia32/shell.S haiku/branches/components/gsoc-locale-kit/src/system/boot/platform/bios_ia32/start.c haiku/branches/components/gsoc-locale-kit/src/system/boot/platform/bios_ia32/video.cpp haiku/branches/components/gsoc-locale-kit/src/system/boot/platform/openfirmware/arch/ppc/mmu.cpp haiku/branches/components/gsoc-locale-kit/src/system/boot/platform/openfirmware/start.c haiku/branches/components/gsoc-locale-kit/src/system/boot/platform/pxe_ia32/network.cpp haiku/branches/components/gsoc-locale-kit/src/system/boot/platform/pxe_ia32/pxe_stage1.S haiku/branches/components/gsoc-locale-kit/src/system/boot/platform/pxe_ia32/pxe_stage2.S haiku/branches/components/gsoc-locale-kit/src/system/boot/platform/u-boot/mmu.cpp haiku/branches/components/gsoc-locale-kit/src/system/boot/platform/u-boot/start2.c haiku/branches/components/gsoc-locale-kit/src/system/kernel/arch/m68k/arch_030_mmu.cpp haiku/branches/components/gsoc-locale-kit/src/system/kernel/arch/m68k/arch_040_mmu.cpp haiku/branches/components/gsoc-locale-kit/src/system/kernel/arch/m68k/arch_cpu.cpp haiku/branches/components/gsoc-locale-kit/src/system/kernel/arch/m68k/arch_debug.cpp haiku/branches/components/gsoc-locale-kit/src/system/kernel/arch/m68k/arch_vm_translation_map.cpp haiku/branches/components/gsoc-locale-kit/src/system/kernel/arch/m68k/arch_vm_translation_map_impl.cpp haiku/branches/components/gsoc-locale-kit/src/system/kernel/arch/ppc/arch_asm.S haiku/branches/components/gsoc-locale-kit/src/system/kernel/arch/ppc/arch_cpu.cpp haiku/branches/components/gsoc-locale-kit/src/system/kernel/arch/ppc/arch_cpu_asm.S haiku/branches/components/gsoc-locale-kit/src/system/kernel/arch/ppc/arch_debug.cpp haiku/branches/components/gsoc-locale-kit/src/system/kernel/arch/ppc/arch_vm_translation_map.cpp haiku/branches/components/gsoc-locale-kit/src/system/kernel/arch/x86/Jamfile haiku/branches/components/gsoc-locale-kit/src/system/kernel/arch/x86/arch_cpu.cpp haiku/branches/components/gsoc-locale-kit/src/system/kernel/arch/x86/arch_debug.cpp haiku/branches/components/gsoc-locale-kit/src/system/kernel/arch/x86/arch_debug_console.c haiku/branches/components/gsoc-locale-kit/src/system/kernel/arch/x86/arch_interrupts.S haiku/branches/components/gsoc-locale-kit/src/system/kernel/arch/x86/arch_smp.c haiku/branches/components/gsoc-locale-kit/src/system/kernel/arch/x86/arch_vm_translation_map.cpp haiku/branches/components/gsoc-locale-kit/src/system/kernel/arch/x86/arch_x86.S haiku/branches/components/gsoc-locale-kit/src/system/kernel/arch/x86/asm_offsets.cpp haiku/branches/components/gsoc-locale-kit/src/system/kernel/arch/x86/interrupts.h haiku/branches/components/gsoc-locale-kit/src/system/kernel/arch/x86/x86_physical_page_mapper.h haiku/branches/components/gsoc-locale-kit/src/system/kernel/arch/x86/x86_physical_page_mapper_large_memory.cpp haiku/branches/components/gsoc-locale-kit/src/system/kernel/cache/file_cache.cpp haiku/branches/components/gsoc-locale-kit/src/system/kernel/cache/file_map.cpp haiku/branches/components/gsoc-locale-kit/src/system/kernel/cache/vnode_store.cpp haiku/branches/components/gsoc-locale-kit/src/system/kernel/debug/debug.cpp haiku/branches/components/gsoc-locale-kit/src/system/kernel/debug/debug_commands.cpp haiku/branches/components/gsoc-locale-kit/src/system/kernel/debug/debug_parser.cpp haiku/branches/components/gsoc-locale-kit/src/system/kernel/debug/frame_buffer_console.cpp haiku/branches/components/gsoc-locale-kit/src/system/kernel/debug/gdb.cpp haiku/branches/components/gsoc-locale-kit/src/system/kernel/debug/tracing.cpp haiku/branches/components/gsoc-locale-kit/src/system/kernel/device_manager/legacy_drivers.cpp haiku/branches/components/gsoc-locale-kit/src/system/kernel/disk_device_manager/disk_device_manager.cpp haiku/branches/components/gsoc-locale-kit/src/system/kernel/elf.cpp haiku/branches/components/gsoc-locale-kit/src/system/kernel/fs/vfs.cpp haiku/branches/components/gsoc-locale-kit/src/system/kernel/heap.cpp haiku/branches/components/gsoc-locale-kit/src/system/kernel/slab/Slab.cpp haiku/branches/components/gsoc-locale-kit/src/system/kernel/smp.cpp haiku/branches/components/gsoc-locale-kit/src/system/kernel/vm/vm.cpp haiku/branches/components/gsoc-locale-kit/src/tests/kits/game/ParticlesII/Jamfile haiku/branches/components/gsoc-locale-kit/src/tests/kits/game/ParticlesII/particlesII.cpp haiku/branches/components/gsoc-locale-kit/src/tests/kits/interface/Jamfile haiku/branches/components/gsoc-locale-kit/src/tests/system/libroot/os/ParseDateTest.cpp Log: * merged changes from trunk up to r32177 Modified: haiku/branches/components/gsoc-locale-kit/3rdparty/mmu_man/themes/UITheme.h =================================================================== --- haiku/branches/components/gsoc-locale-kit/3rdparty/mmu_man/themes/UITheme.h 2009-08-07 08:52:32 UTC (rev 32177) +++ haiku/branches/components/gsoc-locale-kit/3rdparty/mmu_man/themes/UITheme.h 2009-08-07 10:11:16 UTC (rev 32178) @@ -112,5 +112,9 @@ #endif #endif +#ifdef __HAIKU__ +#define B_TOOLTIP_BACKGROUND_COLOR B_TOOL_TIP_BACKGROUND_COLOR +#define B_TOOLTIP_TEXT_COLOR B_TOOL_TIP_TEXT_COLOR +#endif #endif /* _Z_UI_THEME_H */ Modified: haiku/branches/components/gsoc-locale-kit/build/jam/BuildSetup =================================================================== --- haiku/branches/components/gsoc-locale-kit/build/jam/BuildSetup 2009-08-07 08:52:32 UTC (rev 32177) +++ haiku/branches/components/gsoc-locale-kit/build/jam/BuildSetup 2009-08-07 10:11:16 UTC (rev 32178) @@ -198,6 +198,7 @@ { HAIKU_DEFINES += __ARM__ ; HAIKU_BOOT_PLATFORM = u-boot ; + HAIKU_BOOT_BOARD ?= verdex ; HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 1440 ; # in kB (there is not realy a floppy on the gumstix ;) ) # offset in floppy image (>= sizeof(haiku_loader)) HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 192 ; # in kB - unused yet @@ -850,6 +851,7 @@ TARGET_GCC_LIBGCC_OBJECTS = $(HAIKU_GCC_LIBGCC_OBJECTS) ; TARGET_BOOT_PLATFORM ?= $(HAIKU_BOOT_PLATFORM) ; + TARGET_BOOT_BOARD ?= $(HAIKU_BOOT_BOARD) ; TARGET_LIBRARY_NAME_MAP = HAIKU_LIBRARY_NAME_MAP ; Modified: haiku/branches/components/gsoc-locale-kit/build/jam/HaikuImage =================================================================== --- haiku/branches/components/gsoc-locale-kit/build/jam/HaikuImage 2009-08-07 08:52:32 UTC (rev 32177) +++ haiku/branches/components/gsoc-locale-kit/build/jam/HaikuImage 2009-08-07 10:11:16 UTC (rev 32178) @@ -64,9 +64,9 @@ SYSTEM_APPS = AboutSystem ActivityMonitor CharacterMap CodyCam DeskCalc DiskProbe DiskUsage DriveSetup CDPlayer Expander Icon-O-Matic Installer LaunchBox - Magnify Mail MediaPlayer MidiPlayer NetworkStatus PackageInstaller People - PoorMan PowerStatus ProcessController Screenshot ShowImage SoundRecorder - StyledEdit Terminal TextSearch TV Workspaces + Magnify Mail MediaConverter MediaPlayer MidiPlayer NetworkStatus + PackageInstaller People PoorMan PowerStatus ProcessController Screenshot + ShowImage SoundRecorder StyledEdit Terminal TextSearch TV Workspaces ; SYSTEM_PREFERENCES = Appearance Backgrounds CPUFrequency DataTranslations E-mail FileTypes Fonts Keyboard Keymap Locale Media Mouse Network Printers @@ -285,8 +285,9 @@ # Deskbar Application links AddDirectoryToHaikuImage home config be Applications ; DESKBAR_APPLICATIONS = ActivityMonitor CharacterMap CodyCam CDPlayer DeskCalc - DiskProbe DriveSetup DiskUsage Expander Icon-O-Matic Magnify Mail MediaPlayer - MidiPlayer People PoorMan Screenshot SoundRecorder StyledEdit Terminal TV + DiskProbe DriveSetup DiskUsage Expander Icon-O-Matic Magnify Mail + MediaConverter MediaPlayer MidiPlayer People PoorMan Screenshot + SoundRecorder StyledEdit Terminal TV ; local linkTarget ; for linkTarget in $(DESKBAR_APPLICATIONS) { Modified: haiku/branches/components/gsoc-locale-kit/build/jam/OptionalPackageDependencies =================================================================== --- haiku/branches/components/gsoc-locale-kit/build/jam/OptionalPackageDependencies 2009-08-07 08:52:32 UTC (rev 32177) +++ haiku/branches/components/gsoc-locale-kit/build/jam/OptionalPackageDependencies 2009-08-07 10:11:16 UTC (rev 32178) @@ -9,6 +9,7 @@ OptionalPackageDependencies Development : DevelopmentBase Perl ; OptionalPackageDependencies DevelopmentBase : CDRecord DevelopmentMin Yasm ; OptionalPackageDependencies DevelopmentMin : LibIconv ; +OptionalPackageDependencies Firefox : LibIconv ; OptionalPackageDependencies LibLayout : DevelopmentBase ; OptionalPackageDependencies NetSurf : OpenSSL ; OptionalPackageDependencies OpenSSH : OpenSSL ; Modified: haiku/branches/components/gsoc-locale-kit/build/jam/OptionalPackages =================================================================== --- haiku/branches/components/gsoc-locale-kit/build/jam/OptionalPackages 2009-08-07 08:52:32 UTC (rev 32177) +++ haiku/branches/components/gsoc-locale-kit/build/jam/OptionalPackages 2009-08-07 10:11:16 UTC (rev 32178) @@ -12,47 +12,48 @@ # Available Optional Packages: -# APR +# APR - support libraries used for example by SVN # APR-util -# Beam -# BeBook -# BeHappy -# BeOSCompatibility -# BePDF -# Bluetooth -# CDRecord -# CLucene -# CVS +# Beam - powerful native e-mail client +# BeBook - the classic BeOS API documentation +# BeHappy - special documentation (i.e. BeBook) browser +# BeOSCompatibility - creates links within the system to support old apps +# BePDF - native PDF reader +# Bluetooth - experimental Haiku components for Bluetooth +# CDRecord - the command line CD writing tools +# Clockwerk - native audio/video compositing +# CLucene - indexed file search +# CVS - the version control system # Development - more complete dev environment (including autotools) # DevelopmentBase - basic development environment (gcc, headers, libs,...) # DevelopmentMin - development headers, libs, tools, from sources only -# Firefox -# KeymapSwitcher -# LibIconv -# LibLayout -# LibXML2 -# Links -# Nano -# Neon -# NetSurf -# OpenSound -# OpenSSH -# OpenSSL -# P7zip -# Pe -# Perl -# Python -# Rsync -# SQLite -# Subversion -# Tar -# UserlandFS -# Vim -# Vision -# VLC -# Welcome -# WonderBrush -# Yasm +# Firefox - the webbrowser +# KeymapSwitcher - Desktop utility +# LibIconv - text encoding conversion library +# LibLayout - GCC2 package needed by some BeOS apps to compile +# LibXML2 - the XML support libary +# Links - the web browser +# Nano - the command line text editor +# Neon - support libraries used for example by SVN +# NetSurf - the web browser +# OpenSound - additional audio driver package +# OpenSSH - the secure shell +# OpenSSL - secure sockets library +# P7zip - file archiving utility +# Pe - the powerful native Programmer's Editor +# Perl - the scripting language +# Python - the scripting language +# Rsync - remote directory synchronization +# SQLite - the database implementation +# Subversion - the version control system +# Tar - archiving utility +# UserlandFS - aids native file system development (like FUSE) +# Vim - the command line text editor +# Vision - powerful native IRC client +# VLC - the multi media player with native interface +# Welcome - introductory documentation to Haiku +# WonderBrush - native graphics application +# Yasm - the assembler utility local baseURL = http://haiku-files.org/files/optional-packages ; @@ -198,6 +199,28 @@ } +# Clockwerk +if [ IsOptionalHaikuImagePackageAdded Clockwerk ] { + if $(TARGET_ARCH) != x86 { + Echo "No optional package Clockwerk available for $(TARGET_ARCH)" ; + } else if $(HAIKU_GCC_VERSION[1]) >= 4 { + InstallOptionalHaikuImagePackage Clockwerk-0.0.1-x86-gcc4-2009-08-04 + : $(baseURL)/Clockwerk-0.0.1-x86-gcc4-2009-08-04.zip + : + ; + AddSymlinkToHaikuImage home config be Applications + : /boot/apps/Clockwerk/Clockwerk ; + } else { + InstallOptionalHaikuImagePackage Clockwerk-0.0.1-x86-gcc2-2009-08-04 + : $(baseURL)/Clockwerk-0.0.1-x86-gcc2-2009-08-04.zip + : + ; + AddSymlinkToHaikuImage home config be Applications + : /boot/apps/Clockwerk/Clockwerk ; + } +} + + # CLucene if [ IsOptionalHaikuImagePackageAdded CLucene ] { if $(TARGET_ARCH) != x86 { @@ -205,7 +228,7 @@ } else if $(HAIKU_GCC_VERSION[1]) < 4 && ! $(isHybridBuild) { Echo "No optional package CLucene available for GCC2" ; } else { - InstallOptionalHaikuImagePackage + InstallOptionalHaikuImagePackage clucene-0.9.21svn-x86-gcc4-haiku-2009-06-11 : $(baseURL)/clucene-0.9.21svn-x86-gcc4-haiku-2009-06-11.zip : @@ -375,16 +398,14 @@ if [ IsOptionalHaikuImagePackageAdded Firefox ] { if $(TARGET_ARCH) != x86 { Echo "No optional package Firefox available for $(TARGET_ARCH)" ; - } else if $(HAIKU_GCC_VERSION[1]) >= 4 && ! $(isHybridBuild) { - InstallOptionalHaikuImagePackage + } else if $(HAIKU_GCC_VERSION[1]) >= 4 { + InstallOptionalHaikuImagePackage BeZillaBrowser-2.0.0.21pre-haiku-gcc4-x86-09-03-01 : $(baseURL)/BeZillaBrowser-2.0.0.21pre-haiku-gcc4-x86-09-03-01.zip : apps ; AddSymlinkToHaikuImage home config be Applications : /boot/apps/BeZillaBrowser/BeZillaBrowser ; - - } else { InstallOptionalHaikuImagePackage BeZillaBrowser-gcc2-20090218 : http://bezilla.beuser.de/builds/BeZillaBrowser-gcc2-20090218.zip @@ -400,8 +421,8 @@ if [ IsOptionalHaikuImagePackageAdded KeymapSwitcher ] { if $(TARGET_ARCH) != x86 { Echo "No optional package KeymapSwitcher available for $(TARGET_ARCH)" ; - } else if $(HAIKU_GCC_VERSION[1]) >= 4 && ! $(isHybridBuild) { - InstallOptionalHaikuImagePackage + } else if $(HAIKU_GCC_VERSION[1]) >= 4 { + InstallOptionalHaikuImagePackage KeymapSwitcher-1.2.3-x86-gcc4-2009-05-31 : $(baseURL)/KeymapSwitcher-1.2.3-x86-gcc4-2009-05-31.zip : @@ -409,7 +430,7 @@ AddSymlinkToHaikuImage home config be Desktop\ Applets : /boot/common/bin/KeymapSwitcher ; } else { - InstallOptionalHaikuImagePackage + InstallOptionalHaikuImagePackage KeymapSwitcher-1.2.3-x86-gcc2-2009-05-31 : $(baseURL)/KeymapSwitcher-1.2.3-x86-gcc2-2009-05-31.zip : @@ -437,7 +458,7 @@ if [ IsOptionalHaikuImagePackageAdded LibLayout ] { if $(TARGET_ARCH) != x86 { Echo "No optional package LibLayout available for $(TARGET_ARCH)" ; - } else if $(HAIKU_GCC_VERSION[1]) >= 4 { + } else if $(HAIKU_GCC_VERSION[1]) >= 4 && ! $(isHybridBuild) { Echo "No optional package LibLayout available for gcc4" ; } else { InstallOptionalHaikuImagePackage liblayout-1.4.0-gcc2-2009-03-08 @@ -600,8 +621,8 @@ Echo "No optional package Pe available for $(TARGET_ARCH)" ; } else { if $(HAIKU_GCC_VERSION[1]) >= 4 { - InstallOptionalHaikuImagePackage Pe-2.4.2-x86-gcc4-2009-07-05 - : $(baseURL)/Pe-2.4.2-x86-gcc4-2009-07-05.zip + InstallOptionalHaikuImagePackage Pe-2.4.2-x86-gcc4-2009-08-04 + : $(baseURL)/Pe-2.4.2-x86-gcc4-2009-08-04.zip ; } else { InstallOptionalHaikuImagePackage Pe-2.4.2-x86-gcc2-2009-07-05 @@ -752,7 +773,7 @@ if [ IsOptionalHaikuImagePackageAdded Vim ] { if $(TARGET_ARCH) != x86 { Echo "No optional package Vim available for $(TARGET_ARCH)" ; - } else if $(HAIKU_GCC_VERSION[1]) >= 4 && ! $(isHybridBuild) { + } else if $(HAIKU_GCC_VERSION[1]) >= 4 { InstallOptionalHaikuImagePackage vim-7.2-x86-gcc4-2009-05-31 : $(baseURL)/vim-7.2-x86-gcc4-2009-05-31.zip : @@ -775,7 +796,7 @@ if $(TARGET_ARCH) != x86 { Echo "No optional package Vision available for $(TARGET_ARCH)" ; } else if $(HAIKU_GCC_VERSION[1]) >= 4 { - InstallOptionalHaikuImagePackage Vision-0.9.7-H-090423 + InstallOptionalHaikuImagePackage Vision-0.9.7-H-090423-1 : $(baseURL)/Vision-0.9.7-H-x86-gcc4-2009-04-23.zip : apps ; Modified: haiku/branches/components/gsoc-locale-kit/build/jam/ReleaseBuildProfiles =================================================================== --- haiku/branches/components/gsoc-locale-kit/build/jam/ReleaseBuildProfiles 2009-08-07 08:52:32 UTC (rev 32177) +++ haiku/branches/components/gsoc-locale-kit/build/jam/ReleaseBuildProfiles 2009-08-07 10:11:16 UTC (rev 32178) @@ -11,7 +11,8 @@ HAIKU_IMAGE_HOST_NAME = shredder ; HAIKU_IMAGE_SIZE = 500 ; - AddOptionalHaikuImagePackages BePDF Firefox Pe Vision VLC WonderBrush ; + AddOptionalHaikuImagePackages BePDF Clockwerk Firefox Pe Vision VLC + WonderBrush ; AddOptionalHaikuImagePackages CVS Development Subversion OpenSSH Yasm ; AddOptionalHaikuImagePackages Welcome BeBook ; } Modified: haiku/branches/components/gsoc-locale-kit/data/develop/makefile-engine =================================================================== --- haiku/branches/components/gsoc-locale-kit/data/develop/makefile-engine 2009-08-07 08:52:32 UTC (rev 32177) +++ haiku/branches/components/gsoc-locale-kit/data/develop/makefile-engine 2009-08-07 10:11:16 UTC (rev 32178) @@ -9,7 +9,7 @@ ifeq ($(MACHINE), BePC) CPU = x86 else - CPU = ppc + CPU = $(MACHINE) endif # set the directory where object files and binaries will be created @@ -28,27 +28,27 @@ DRIVER_PATH = misc endif -# specify that the binary should be created in the object directory +# specify the directory the binary should be created in by default +ifeq ($(TARGET_DIR), ) + TARGET_DIR := $(OBJ_DIR) +endif + # NOTE: make doesn't find the target if its name is enclosed in # quotation marks -# TARGET := "$(OBJ_DIR)/$(NAME)" - TARGET := $(OBJ_DIR)/$(NAME) + TARGET := $(TARGET_DIR)/$(NAME) # specify the mimeset tool MIMESET := mimeset # specify the tools for adding and removing resources - XRES = xres + XRES := xres # specify the tools for compiling resource definition files - RESCOMP = rc + RESCOMP := rc -# platform specific settings - -# x86 Settings -ifeq ($(CPU), x86) # set the compiler and compiler flags - CC = gcc + CC := gcc + C++ := g++ # SETTING: set the CFLAGS for each binary type ifeq ($(TYPE), DRIVER) @@ -73,8 +73,6 @@ endif endif - - # SETTING: set proper debugger flags ifeq ($(DEBUGGER), TRUE) DEBUG += -g @@ -93,7 +91,7 @@ endif # set the linker and linker flags - LD = gcc + LD := gcc LDFLAGS += $(DEBUG) # SETTING: set linker flags for each binary type @@ -111,93 +109,6 @@ endif -else - -# ppc Settings -ifeq ($(CPU), ppc) -# set the compiler and compiler flags - CC = mwcc - CFLAGS += - -# SETTING: set the proper optimization level - ifeq ($(OPTIMIZE), FULL) - OPTIMIZER = -O7 - else - ifeq ($(OPTIMIZE), SOME) - OPTIMIZER = -O3 - else - ifeq ($(OPTIMIZE), NONE) - OPTIMIZER = -O0 - else -# OPTIMIZE not set so set to full - OPTIMIZER = -O7 - endif - endif - endif - - #set the proper debugger settings - ifeq ($(DEBUGGER), TRUE) - DEBUG += -g - endif - - CFLAGS += $(OPTIMIZER) $(DEBUG) - -# SETTING: set warning level - ifeq ($(WARNINGS), ALL) - CFLAGS += -w on -requireprotos - else - ifeq ($(WARNINGS), NONE) - CFLAGS += -w off - endif - endif - - # clear the standard environment variable - # now there are no standard libraries to link against - BELIBFILES= - -# set the linker and linker flags - LD = mwldppc - -# SETTING: set linker flags for each binary type - ifeq ($(TYPE), APP) - LDFLAGS += - else - ifeq ($(TYPE), SHARED) - LDFLAGS += -xms - endif - endif - - ifeq ($(TYPE), DRIVER) - LDFLAGS += -nodefaults \ - -export all \ - -G \ - /boot/develop/lib/ppc/glue-noinit.a \ - /boot/develop/lib/ppc/_KERNEL_ - else - LDFLAGS += -export pragma \ - -init _init_routine_ \ - -term _term_routine_ \ - -lroot \ - /boot/develop/lib/ppc/glue-noinit.a \ - /boot/develop/lib/ppc/init_term_dyn.o \ - /boot/develop/lib/ppc/start_dyn.o - endif - - -# SETTING: output symbols in an xMAP file - ifeq ($(SYMBOLS), TRUE) - LDFLAGS += -map $(TARGET).xMAP - endif - -# SETTING: output debugging info to a .SYM file - ifeq ($(DEBUGGER), TRUE) - LDFLAGS += -g -osym $(TARGET).SYM - endif - -endif -endif - - # psuedo-function for converting a list of source files in SRCS variable # to a corresponding list of object files in $(OBJ_DIR)/xxx.o # The "function" strips off the src file suffix (.ccp or .c or whatever) @@ -337,17 +248,17 @@ $(OBJ_DIR)/%.o : %.c $(CC) -c $< $(INCLUDES) $(CFLAGS) -o $@ $(OBJ_DIR)/%.o : %.cpp - $(CC) -c $< $(INCLUDES) $(CFLAGS) -o $@ + $(C++) -c $< $(INCLUDES) $(CFLAGS) -o $@ $(OBJ_DIR)/%.o : %.cp $(CC) -c $< $(INCLUDES) $(CFLAGS) -o $@ $(OBJ_DIR)/%.o : %.cc - $(CC) -c $< $(INCLUDES) $(CFLAGS) -o $@ + $(C++) -c $< $(INCLUDES) $(CFLAGS) -o $@ $(OBJ_DIR)/%.o : %.C $(CC) -c $< $(INCLUDES) $(CFLAGS) -o $@ $(OBJ_DIR)/%.o : %.CC - $(CC) -c $< $(INCLUDES) $(CFLAGS) -o $@ + $(C++) -c $< $(INCLUDES) $(CFLAGS) -o $@ $(OBJ_DIR)/%.o : %.CPP - $(CC) -c $< $(INCLUDES) $(CFLAGS) -o $@ + $(C++) -c $< $(INCLUDES) $(CFLAGS) -o $@ # rules to compile resource definition files $(OBJ_DIR)/%.rsrc : %.rdef @@ -369,19 +280,27 @@ # The generic clean command. Delete everything in the object folder. clean :: FORCE - -rm -rf $(OBJ_DIR) + -rm -rf "$(OBJ_DIR)" # remove just the application from the object folder rmapp :: - -rm -f $(TARGET) + -rm -f "$(TARGET)" # make it easy to install drivers for testing USER_BIN_PATH = /boot/home/config/add-ons/kernel/drivers/bin USER_DEV_PATH = /boot/home/config/add-ons/kernel/drivers/dev -driverinstall :: +driverinstall :: default ifeq ($(TYPE), DRIVER) copyattr --data $(OBJ_DIR)/$(NAME) $(USER_BIN_PATH)/$(NAME) mkdir -p $(USER_DEV_PATH)/$(DRIVER_PATH) ln -sf $(USER_BIN_PATH)/$(NAME) $(USER_DEV_PATH)/$(DRIVER_PATH)/$(NAME) endif + +install :: default +ifeq ($(INSTALL_DIR), ) + @echo "No install directory specified for \"$(NAME)\" (INSTALL_DIR is empty)" >&2 +else + mkdir -p "$(INSTALL_DIR)" + cp "$(TARGET)" "$(INSTALL_DIR)/$(NAME)" +endif Modified: haiku/branches/components/gsoc-locale-kit/headers/os/app/AppDefs.h =================================================================== --- haiku/branches/components/gsoc-locale-kit/headers/os/app/AppDefs.h 2009-08-07 08:52:32 UTC (rev 32177) +++ haiku/branches/components/gsoc-locale-kit/headers/os/app/AppDefs.h 2009-08-07 10:11:16 UTC (rev 32178) @@ -44,6 +44,7 @@ B_MOUSE_DOWN = '_MDN', B_MOUSE_MOVED = '_MMV', B_MOUSE_ENTER_EXIT = '_MEX', + B_MOUSE_IDLE = '_MSI', B_MOUSE_UP = '_MUP', B_MOUSE_WHEEL_CHANGED = '_MWC', B_OPEN_IN_WORKSPACE = '_OWS', Modified: haiku/branches/components/gsoc-locale-kit/headers/os/app/Message.h =================================================================== --- haiku/branches/components/gsoc-locale-kit/headers/os/app/Message.h 2009-08-07 08:52:32 UTC (rev 32177) +++ haiku/branches/components/gsoc-locale-kit/headers/os/app/Message.h 2009-08-07 10:11:16 UTC (rev 32178) @@ -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. * * Authors: @@ -291,11 +291,13 @@ status_t _FlattenToArea(message_header **_header) const; status_t _CopyForWrite(); - status_t _Reference(message_header *header); + status_t _Reference(); status_t _Dereference(); - status_t _ResizeData(int32 offset, int32 change); + status_t _ValidateMessage(); + status_t _ResizeData(uint32 offset, int32 change); + uint32 _HashName(const char* name) const; status_t _FindField(const char* name, type_code type, field_header** _result) const; @@ -303,9 +305,6 @@ bool isFixedSize, field_header** _result); status_t _RemoveField(field_header* field); - ssize_t _NativeFlattenedSize() const; - status_t _NativeFlatten(char *buffer, ssize_t size) const; - status_t _NativeFlatten(BDataIO *stream, ssize_t *size = NULL) const; void _PrintToStream(const char* indent) const; private: @@ -313,12 +312,15 @@ field_header* fFields; uint8* fData; + uint32 fFieldsAvailable; + size_t fDataAvailable; + mutable BMessage* fOriginal; BMessage* fQueueLink; // fQueueLink is used by BMessageQueue to build a linked list - uint32 fReserved[11]; + uint32 fReserved[9]; // deprecated BMessage(BMessage *message); Modified: haiku/branches/components/gsoc-locale-kit/headers/os/game/WindowScreen.h =================================================================== --- haiku/branches/components/gsoc-locale-kit/headers/os/game/WindowScreen.h 2009-08-07 08:52:32 UTC (rev 32177) +++ haiku/branches/components/gsoc-locale-kit/headers/os/game/WindowScreen.h 2009-08-07 10:11:16 UTC (rev 32178) @@ -83,7 +83,9 @@ status_t _Activate(); status_t _Deactivate(); - status_t _SetupAccelerantHooks(bool enable); + status_t _SetupAccelerantHooks(); + void _ResetAccelerantHooks(); + status_t _GetCardInfo(); void _Suspend(); void _Resume(); Modified: haiku/branches/components/gsoc-locale-kit/headers/os/interface/InterfaceDefs.h =================================================================== --- haiku/branches/components/gsoc-locale-kit/headers/os/interface/InterfaceDefs.h 2009-08-07 08:52:32 UTC (rev 32177) +++ haiku/branches/components/gsoc-locale-kit/headers/os/interface/InterfaceDefs.h 2009-08-07 10:11:16 UTC (rev 32178) @@ -282,8 +282,8 @@ B_MENU_SELECTED_ITEM_TEXT_COLOR = 8, B_MENU_SELECTED_BORDER_COLOR = 9, - B_TOOLTIP_BACKGROUND_COLOR = 20, - B_TOOLTIP_TEXT_COLOR = 21, + B_TOOL_TIP_BACKGROUND_COLOR = 20, + B_TOOL_TIP_TEXT_COLOR = 21, B_SUCCESS_COLOR = 100, B_FAILURE_COLOR = 101, Modified: haiku/branches/components/gsoc-locale-kit/headers/os/interface/MenuField.h =================================================================== --- haiku/branches/components/gsoc-locale-kit/headers/os/interface/MenuField.h 2009-08-07 08:52:32 UTC (rev 32177) +++ haiku/branches/components/gsoc-locale-kit/headers/os/interface/MenuField.h 2009-08-07 10:11:16 UTC (rev 32178) @@ -1,34 +1,36 @@ /* - * Copyright 2006-2008, Haiku, Inc. All Rights Reserved. + * Copyright 2006-2009, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. */ - #ifndef _MENU_FIELD_H #define _MENU_FIELD_H + #include -#include /* For convenience */ +#include #include + class BMenuBar; + class BMenuField : public BView { - public: +public: BMenuField(BRect frame, const char* name, const char* label, BMenu* menu, uint32 resize = B_FOLLOW_LEFT|B_FOLLOW_TOP, - uint32 flags = B_WILL_DRAW | B_NAVIGABLE); + uint32 flags = B_WILL_DRAW | B_NAVIGABLE); BMenuField(BRect frame, const char* name, const char* label, BMenu* menu, bool fixed_size, uint32 resize = B_FOLLOW_LEFT|B_FOLLOW_TOP, - uint32 flags = B_WILL_DRAW | B_NAVIGABLE); + uint32 flags = B_WILL_DRAW | B_NAVIGABLE); BMenuField(const char* name, const char* label, BMenu* menu, - BMessage* message, - uint32 flags = B_WILL_DRAW | B_NAVIGABLE); + BMessage* message = NULL, + uint32 flags = B_WILL_DRAW | B_NAVIGABLE); BMenuField(const char* label, - BMenu* menu, BMessage* message = NULL); + BMenu* menu, BMessage* message = NULL); BMenuField(BMessage* data); virtual ~BMenuField(); @@ -57,7 +59,7 @@ virtual void SetLabel(const char* label); const char* Label() const; - + virtual void SetEnabled(bool on); bool IsEnabled() const; @@ -86,7 +88,7 @@ BLayoutItem* CreateLabelLayoutItem(); BLayoutItem* CreateMenuBarLayoutItem(); - + /*----- Private or reserved -----------------------------------------*/ virtual status_t Perform(perform_code d, void* arg); @@ -107,17 +109,16 @@ virtual void _ReservedMenuField2(); virtual void _ReservedMenuField3(); - BMenuField &operator=(const BMenuField&); + BMenuField& operator=(const BMenuField& other); - void InitObject(const char* label); void InitObject2(); void DrawLabel(BRect bounds, BRect update); static void InitMenu(BMenu* menu); - + int32 _MenuTask(); static int32 _thread_entry(void *arg); - + void _UpdateFrame(); void _InitMenuBar(BMenu* menu, BRect frame, bool fixedSize); Modified: haiku/branches/components/gsoc-locale-kit/headers/os/interface/View.h =================================================================== --- haiku/branches/components/gsoc-locale-kit/headers/os/interface/View.h 2009-08-07 08:52:32 UTC (rev 32177) +++ haiku/branches/components/gsoc-locale-kit/headers/os/interface/View.h 2009-08-07 10:11:16 UTC (rev 32178) @@ -124,6 +124,7 @@ class BShape; class BShelf; class BString; +class BToolTip; class BWindow; struct _array_data_; struct _array_hdr_; @@ -503,7 +504,6 @@ virtual void DrawAfterChildren(BRect r); - // layout related virtual BSize MinSize(); @@ -542,6 +542,19 @@ protected: virtual void DoLayout(); +public: + // tool tip support + + void SetToolTip(const char* text); + void SetToolTip(BToolTip* tip); + BToolTip* ToolTip() const; + + void ShowToolTip(BToolTip* tip = NULL); + void HideToolTip(); + +protected: + virtual bool GetToolTipAt(BPoint point, BToolTip** _tip); + private: void _Layout(bool force, BLayoutContext* context); @@ -556,7 +569,6 @@ friend class BTabView; friend class BWindow; - virtual void _ReservedView11(); virtual void _ReservedView12(); virtual void _ReservedView13(); virtual void _ReservedView14(); @@ -653,8 +665,10 @@ uint32 fMouseEventOptions; LayoutData* fLayoutData; + BToolTip* fToolTip; + BToolTip* fVisibleToolTip; - uint32 _reserved[7]; + uint32 _reserved[5]; }; Modified: haiku/branches/components/gsoc-locale-kit/headers/os/interface/Window.h =================================================================== --- haiku/branches/components/gsoc-locale-kit/headers/os/interface/Window.h 2009-08-07 08:52:32 UTC (rev 32177) +++ haiku/branches/components/gsoc-locale-kit/headers/os/interface/Window.h 2009-08-07 10:11:16 UTC (rev 32178) @@ -347,7 +347,7 @@ BView* fTopView; BView* fFocus; BView* fLastMouseMovedView; - uint32 _unused1; + BMessageRunner* fIdleMouseRunner; BMenuBar* fKeyMenuBar; BButton* fDefaultButton; BList fShortcuts; Modified: haiku/branches/components/gsoc-locale-kit/headers/os/media/BufferGroup.h =================================================================== --- haiku/branches/components/gsoc-locale-kit/headers/os/media/BufferGroup.h 2009-08-07 08:52:32 UTC (rev 32177) +++ haiku/branches/components/gsoc-locale-kit/headers/os/media/BufferGroup.h 2009-08-07 10:11:16 UTC (rev 32178) @@ -1,82 +1,68 @@ -/******************************************************************************* -/ -/ File: BufferGroup.h -/ -/ Description: A BBufferGroup organizes sets of BBuffers so that you can request -/ and reclaim them. -/ -/ Copyright 1997-98, Be Incorporated, All Rights Reserved -/ -*******************************************************************************/ - -#if !defined(_BUFFER_GROUP_H) +/* + * Copyright 2009, Haiku Inc. All Rights Reserved. + * Distributed under the terms of the MIT License. + */ +#ifndef _BUFFER_GROUP_H #define _BUFFER_GROUP_H + #include + class BBuffer; struct _shared_buffer_list; -class BBufferGroup -{ + +class BBufferGroup { public: + BBufferGroup(size_t size, int32 count = 3, + uint32 placement = B_ANY_ADDRESS, + uint32 lock = B_FULL_LOCK); + explicit BBufferGroup(); + BBufferGroup(int32 count, + const media_buffer_id* buffers); + ~BBufferGroup(); - BBufferGroup( - size_t size, - int32 count = 3, - uint32 placement = B_ANY_ADDRESS, - uint32 lock = B_FULL_LOCK); -explicit BBufferGroup(); - BBufferGroup( - int32 count, - const media_buffer_id * buffers); - ~BBufferGroup(); /* BBufferGroup is NOT a virtual class!!! */ + status_t InitCheck(); - status_t InitCheck(); + status_t AddBuffer(const buffer_clone_info& info, + BBuffer** _buffer = NULL); - /* use this function to add buffers you created on your own */ - status_t AddBuffer( - const buffer_clone_info & info, - BBuffer ** out_buffer = NULL); + BBuffer* RequestBuffer(size_t size, + bigtime_t timeout = B_INFINITE_TIMEOUT); + status_t RequestBuffer(BBuffer* buffer, + bigtime_t timeout = B_INFINITE_TIMEOUT); - BBuffer * RequestBuffer( - size_t size, - bigtime_t timeout = B_INFINITE_TIMEOUT); - status_t RequestBuffer( - BBuffer * buffer, - bigtime_t timeout = B_INFINITE_TIMEOUT); - status_t RequestError(); /* return last RequestBuffer error, useful if NULL is returned */ + status_t RequestError(); - status_t CountBuffers( - int32 * out_count); - status_t GetBufferList( - int32 buf_count, - BBuffer ** out_buffers); + status_t CountBuffers(int32* _count); + status_t GetBufferList(int32 bufferCount, + BBuffer** _buffers); - status_t WaitForBuffers(); - status_t ReclaimAllBuffers(); + status_t WaitForBuffers(); + status_t ReclaimAllBuffers(); private: - /* in BeOS R5 this is a deprecated api, from BeOS R4 times */ - status_t AddBuffersTo(BMessage * message, const char * name, bool needLock=true); - - status_t InitBufferGroup(); /* used internally */ - BBufferGroup(const BBufferGroup &); /* not implemented */ - BBufferGroup& operator=(const BBufferGroup&); /* not implemented */ + // deprecated BeOS R4 API + status_t AddBuffersTo(BMessage* message, const char* name, + bool needLock); - friend struct _shared_buffer_list; + BBufferGroup(const BBufferGroup& other); + BBufferGroup& operator=(const BBufferGroup& other); - status_t fInitError; - status_t fRequestError; - int32 fBufferCount; - _shared_buffer_list * fBufferList; - - // this is a BBufferGroup specific semaphore used for reclaiming BBuffers of this group - // is also is a system wide unique identifier of this group - sem_id fReclaimSem; + status_t _Init(); - uint32 _reserved_buffer_group_[9]; +private: + friend struct _shared_buffer_list; + + status_t fInitError; + status_t fRequestError; + int32 fBufferCount; + _shared_buffer_list* fBufferList; + sem_id fReclaimSem; + + uint32 _reserved[9]; }; -#endif /* _BUFFER_GROUP_H */ +#endif // _BUFFER_GROUP_H Modified: haiku/branches/components/gsoc-locale-kit/headers/os/media/MediaFile.h =================================================================== --- haiku/branches/components/gsoc-locale-kit/headers/os/media/MediaFile.h 2009-08-07 08:52:32 UTC (rev 32177) +++ haiku/branches/components/gsoc-locale-kit/headers/os/media/MediaFile.h 2009-08-07 10:11:16 UTC (rev 32178) @@ -1,10 +1,11 @@ /* * Copyright 2002-2009, Haiku, Inc. All rights reserved. - * Distributed under the terms of the MIT License. + * Distributed under the terms of the MIT license. */ #ifndef _MEDIA_FILE_H #define _MEDIA_FILE_H + #include #include #include @@ -15,13 +16,13 @@ namespace BPrivate { namespace media { class MediaExtractor; + class MediaWriter; } - class MediaWriter; class _AddonManager; } -// forward declarations +// forward declarations class BMediaTrack; class BParameterWeb; class BView; @@ -50,7 +51,7 @@ class BMediaFile { public: // these four constructors are used for read-only access - BMediaFile(const entry_ref* ref); + BMediaFile(const entry_ref* ref); BMediaFile(BDataIO* source); // BFile is a BDataIO BMediaFile(const entry_ref* ref, int32 flags); @@ -71,14 +72,14 @@ status_t SetTo(const entry_ref* ref); status_t SetTo(BDataIO* destination); - + status_t InitCheck() const; // Get info about the underlying file format. status_t GetFileFormatInfo(media_file_format* mfi) const; // - // These functions are for read-only access to a media file. + // These functions are for read-only access to a media file. // The data is read using the BMediaTrack object. // const char* Copyright() const; @@ -136,7 +137,7 @@ // deprecated, but for R5 compatibility BParameterWeb* Web(); - // Does nothing, returns B_ERROR, for Zeta compatiblity only + // Does nothing, returns B_ERROR, for Zeta compatiblity only status_t ControlFile(int32 selector, void* ioData, size_t size); @@ -147,7 +148,7 @@ BPrivate::_AddonManager* fEncoderMgr; BPrivate::_AddonManager* fWriterMgr; - BPrivate::MediaWriter* fWriter; + BPrivate::media::MediaWriter* fWriter; int32 fWriterID; media_file_format fMFI; @@ -159,8 +160,9 @@ void _Init(); void _UnInit(); void _InitReader(BDataIO* source, int32 flags = 0); - void _InitWriter(BDataIO* source, - const media_file_format* mfi, int32 flags); + void _InitWriter(BDataIO* target, [... truncated: 22596 lines follow ...] From axeld at mail.berlios.de Fri Aug 7 12:22:22 2009 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Fri, 7 Aug 2009 12:22:22 +0200 Subject: [Haiku-commits] r32179 - haiku/trunk/src/preferences/screen Message-ID: <200908071022.n77AMMgv008501@sheep.berlios.de> Author: axeld Date: 2009-08-07 12:22:22 +0200 (Fri, 07 Aug 2009) New Revision: 32179 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32179&view=rev Modified: haiku/trunk/src/preferences/screen/ScreenMode.cpp haiku/trunk/src/preferences/screen/ScreenWindow.cpp haiku/trunk/src/preferences/screen/ScreenWindow.h Log: * If the user selected color space is not available for the selected resolution, _CheckColorMenu() now selects the closest item available - if you switch back the resolution to one that supports the original color space, it will be restored. This fixes bug #2995. * I also reverted r24674 as I remembered why I did that in the first place (advertizing 24 bit modes as 32 bit), and it was a pretty stupid idea to solve it like this, I must admit. * Instead, the color space menu now only shows spaces that are actually supported by the card at all. One could think about hiding 24 bit in case both 24 bit, and 32 bit are available, but I didn't do that yet. Modified: haiku/trunk/src/preferences/screen/ScreenMode.cpp =================================================================== --- haiku/trunk/src/preferences/screen/ScreenMode.cpp 2009-08-07 10:11:16 UTC (rev 32178) +++ haiku/trunk/src/preferences/screen/ScreenMode.cpp 2009-08-07 10:22:22 UTC (rev 32179) @@ -121,17 +121,8 @@ bool screen_mode::operator!=(const screen_mode &other) const { - // make no difference between 24 and 32 bit modes - color_space thisSpace = space; - if (thisSpace == B_RGB24) - thisSpace = B_RGB32; - - color_space otherSpace = other.space; - if (otherSpace == B_RGB24) - otherSpace = B_RGB32; - return width != other.width || height != other.height - || thisSpace != otherSpace || refresh != other.refresh + || space != other.space || refresh != other.refresh || combine != other.combine || swap_displays != other.swap_displays || use_laptop_panel != other.use_laptop_panel Modified: haiku/trunk/src/preferences/screen/ScreenWindow.cpp =================================================================== --- haiku/trunk/src/preferences/screen/ScreenWindow.cpp 2009-08-07 10:11:16 UTC (rev 32178) +++ haiku/trunk/src/preferences/screen/ScreenWindow.cpp 2009-08-07 10:22:22 UTC (rev 32179) @@ -72,6 +72,7 @@ { B_CMAP8, 8, "8 Bits/Pixel, 256 Colors" }, { B_RGB15, 15, "15 Bits/Pixel, 32768 Colors" }, { B_RGB16, 16, "16 Bits/Pixel, 65536 Colors" }, + { B_RGB24, 24, "24 Bits/Pixel, 16 Million Colors" }, { B_RGB32, 32, "32 Bits/Pixel, 16 Million Colors" } }; static const int32 kColorSpaceCount @@ -175,6 +176,7 @@ fIsVesa = true; _UpdateOriginal(); + _BuildSupportedColorSpaces(); fActive = fSelected = fOriginal; fSettings = settings; @@ -282,11 +284,18 @@ fColorsMenu = new BPopUpMenu("colors", true, false); for (int32 i = 0; i < kColorSpaceCount; i++) { + if ((fSupportedColorSpaces & (1 << i)) == 0) + continue; + BMessage *message = new BMessage(POP_COLORS_MSG); message->AddInt32("bits_per_pixel", kColorSpaces[i].bits_per_pixel); message->AddInt32("space", kColorSpaces[i].space); - fColorsMenu->AddItem(new BMenuItem(kColorSpaces[i].label, message)); + BMenuItem* item = new BMenuItem(kColorSpaces[i].label, message); + if (kColorSpaces[i].space == screen.ColorSpace()) + fUserSelectedColorSpace = item; + + fColorsMenu->AddItem(item); } rect.OffsetTo(B_ORIGIN); @@ -511,7 +520,7 @@ /*! Update resolution list according to combine mode - (some resolution may not be combinable due to memory restrictions) + (some resolutions may not be combinable due to memory restrictions). */ void ScreenWindow::_CheckResolutionMenu() @@ -542,7 +551,13 @@ void ScreenWindow::_CheckColorMenu() { + int32 supportsAnything = false; + int32 index = 0; + for (int32 i = 0; i < kColorSpaceCount; i++) { + if ((fSupportedColorSpaces & (1 << i)) == 0) + continue; + bool supported = false; for (int32 j = 0; j < fScreenMode.CountModes(); j++) { @@ -550,20 +565,72 @@ if (fSelected.width == mode.width && fSelected.height == mode.height - && (kColorSpaces[i].space == mode.space - // advertize 24 bit mode as 32 bit to avoid confusion - || (kColorSpaces[i].space == B_RGB32 - && mode.space == B_RGB24)) + && kColorSpaces[i].space == mode.space && fSelected.combine == mode.combine) { + supportsAnything = true; supported = true; break; } } - BMenuItem* item = fColorsMenu->ItemAt(i); + BMenuItem* item = fColorsMenu->ItemAt(index++); if (item) item->SetEnabled(supported); } + + fColorsField->SetEnabled(supportsAnything); + + if (!supportsAnything) + return; + + // Make sure a valid item is selected + + BMenuItem* item = fColorsMenu->FindMarked(); + bool changed = false; + + if (item != fUserSelectedColorSpace) { + if (fUserSelectedColorSpace != NULL + && fUserSelectedColorSpace->IsEnabled()) { + fUserSelectedColorSpace->SetMarked(true); + item = fUserSelectedColorSpace; + changed = true; + } + } + if (item != NULL && !item->IsEnabled()) { + // find the next best item + int32 index = fColorsMenu->IndexOf(item); + bool found = false; + + for (int32 i = index + 1; i < fColorsMenu->CountItems(); i++) { + item = fColorsMenu->ItemAt(i); + if (item->IsEnabled()) { + found = true; + break; + } + } + if (!found) { + // search backwards as well + for (int32 i = index - 1; i >= 0; i--) { + item = fColorsMenu->ItemAt(i); + if (item->IsEnabled()) + break; + } + } + + item->SetMarked(true); + changed = true; + } + + if (changed) { + // Update selected space + + BMessage* message = item->Message(); + int32 space; + if (message->FindInt32("space", &space) == B_OK) { + fSelected.space = (color_space)space; + _UpdateColorLabel(); + } + } } @@ -694,28 +761,22 @@ item = fColorsMenu->ItemAt(0); - for (int32 i = kColorSpaceCount; i-- > 0;) { - if (kColorSpaces[i].space == fSelected.space - || (kColorSpaces[i].space == B_RGB32 - && fSelected.space == B_RGB24)) { - item = fColorsMenu->ItemAt(i); + for (int32 i = 0, index = 0; i < kColorSpaceCount; i++) { + if ((fSupportedColorSpaces & (1 << i)) == 0) + continue; + + if (kColorSpaces[i].space == fSelected.space) { + item = fColorsMenu->ItemAt(index); break; } + + index++; } if (item && !item->IsMarked()) item->SetMarked(true); - string.Truncate(0); - uint32 bitsPerPixel = fSelected.BitsPerPixel(); - // advertize 24 bit mode as 32 bit to avoid confusion - if (bitsPerPixel == 24) - bitsPerPixel = 32; - - string << bitsPerPixel << " Bits/Pixel"; - if (string != fColorsMenu->Superitem()->Label()) - fColorsMenu->Superitem()->SetLabel(string.String()); - + _UpdateColorLabel(); _UpdateMonitorView(); _UpdateRefreshControl(); @@ -857,12 +918,18 @@ case POP_COLORS_MSG: { - message->FindInt32("space", (int32 *)&fSelected.space); + int32 space; + if (message->FindInt32("space", &space) != B_OK) + break; - BString string; - string << fSelected.BitsPerPixel() << " Bits/Pixel"; - fColorsMenu->Superitem()->SetLabel(string.String()); + int32 index; + if (message->FindInt32("index", &index) == B_OK + && fColorsMenu->ItemAt(index) != NULL) + fUserSelectedColorSpace = fColorsMenu->ItemAt(index); + fSelected.space = (color_space)space; + _UpdateColorLabel(); + _CheckApplyEnabled(); break; } @@ -871,7 +938,7 @@ { message->FindFloat("refresh", &fSelected.refresh); fOtherRefresh->SetLabel("Other" B_UTF8_ELLIPSIS); - // revert "Other?" label - it might have had a refresh rate prefix + // revert "Other?" label - it might have a refresh rate prefix _CheckApplyEnabled(); break; @@ -1064,6 +1131,22 @@ void +ScreenWindow::_BuildSupportedColorSpaces() +{ + fSupportedColorSpaces = 0; + + for (int32 i = 0; i < kColorSpaceCount; i++) { + for (int32 j = 0; j < fScreenMode.CountModes(); j++) { + if (fScreenMode.ModeAt(j).space == kColorSpaces[i].space) { + fSupportedColorSpaces |= 1 << i; + break; + } + } + } +} + + +void ScreenWindow::_CheckApplyEnabled() { fApplyButton->SetEnabled(fSelected != fActive @@ -1142,6 +1225,15 @@ void +ScreenWindow::_UpdateColorLabel() +{ + BString string; + string << fSelected.BitsPerPixel() << " Bits/Pixel"; + fColorsMenu->Superitem()->SetLabel(string.String()); +} + + +void ScreenWindow::_Apply() { // make checkpoint, so we can undo these changes Modified: haiku/trunk/src/preferences/screen/ScreenWindow.h =================================================================== --- haiku/trunk/src/preferences/screen/ScreenWindow.h 2009-08-07 10:11:16 UTC (rev 32178) +++ haiku/trunk/src/preferences/screen/ScreenWindow.h 2009-08-07 10:22:22 UTC (rev 32179) @@ -29,79 +29,86 @@ class ScreenWindow : public BWindow { - public: - ScreenWindow(ScreenSettings *settings); - virtual ~ScreenWindow(); +public: + ScreenWindow(ScreenSettings *settings); + virtual ~ScreenWindow(); - virtual bool QuitRequested(); - virtual void MessageReceived(BMessage *message); - virtual void WorkspaceActivated(int32 ws, bool state); - virtual void ScreenChanged(BRect frame, color_space mode); + virtual bool QuitRequested(); + virtual void MessageReceived(BMessage *message); + virtual void WorkspaceActivated(int32 ws, bool state); + virtual void ScreenChanged(BRect frame, color_space mode); - private: - BButton* _CreateColumnRowButton(bool columns, bool plus); - BButton* _GetColumnRowButton(bool columns, bool plus); +private: + BButton* _CreateColumnRowButton(bool columns, bool plus); + BButton* _GetColumnRowButton(bool columns, bool plus); - void _CheckApplyEnabled(); - void _CheckResolutionMenu(); - void _CheckColorMenu(); - void _CheckRefreshMenu(); + void _BuildSupportedColorSpaces(); - void _UpdateActiveMode(); - void _UpdateWorkspaceButtons(); - void _UpdateRefreshControl(); - void _UpdateMonitorView(); - void _UpdateControls(); - void _UpdateOriginal(); - void _UpdateMonitor(); + void _CheckApplyEnabled(); + void _CheckResolutionMenu(); + void _CheckColorMenu(); + void _CheckRefreshMenu(); - void _Apply(); + void _UpdateActiveMode(); + void _UpdateWorkspaceButtons(); + void _UpdateRefreshControl(); + void _UpdateMonitorView(); + void _UpdateControls(); + void _UpdateOriginal(); + void _UpdateMonitor(); + void _UpdateColorLabel(); - status_t _WriteVesaModeFile(const screen_mode& mode) const; - bool _IsVesa() const { return fIsVesa; } + void _Apply(); - ScreenSettings* fSettings; - bool fIsVesa; - bool fBootWorkspaceApplied; + status_t _WriteVesaModeFile(const screen_mode& mode) const; + bool _IsVesa() const { return fIsVesa; } - BStringView* fMonitorInfo; - MonitorView* fMonitorView; - BMenuItem* fAllWorkspacesItem; +private: + ScreenSettings* fSettings; + bool fIsVesa; + bool fBootWorkspaceApplied; - BTextControl* fColumnsControl; - BTextControl* fRowsControl; - BButton* fWorkspacesButtons[4]; + BStringView* fMonitorInfo; + MonitorView* fMonitorView; + BMenuItem* fAllWorkspacesItem; - BPopUpMenu* fResolutionMenu; - BMenuField* fResolutionField; - BPopUpMenu* fColorsMenu; - BMenuField* fColorsField; - BPopUpMenu* fRefreshMenu; - BMenuField* fRefreshField; - BMenuItem* fOtherRefresh; + BTextControl* fColumnsControl; + BTextControl* fRowsControl; + BButton* fWorkspacesButtons[4]; - BPopUpMenu* fCombineMenu; - BMenuField* fCombineField; - BPopUpMenu* fSwapDisplaysMenu; - BMenuField* fSwapDisplaysField; - BPopUpMenu* fUseLaptopPanelMenu; - BMenuField* fUseLaptopPanelField; - BPopUpMenu* fTVStandardMenu; - BMenuField* fTVStandardField; + uint32 fSupportedColorSpaces; + BMenuItem* fUserSelectedColorSpace; - BButton* fDefaultsButton; - BButton* fApplyButton; - BButton* fRevertButton; + BPopUpMenu* fResolutionMenu; + BMenuField* fResolutionField; + BPopUpMenu* fColorsMenu; + BMenuField* fColorsField; + BPopUpMenu* fRefreshMenu; + BMenuField* fRefreshField; + BMenuItem* fOtherRefresh; - BButton* fBackgroundsButton; + BPopUpMenu* fCombineMenu; + BMenuField* fCombineField; + BPopUpMenu* fSwapDisplaysMenu; + BMenuField* fSwapDisplaysField; + BPopUpMenu* fUseLaptopPanelMenu; + BMenuField* fUseLaptopPanelField; + BPopUpMenu* fTVStandardMenu; + BMenuField* fTVStandardField; - ScreenMode fScreenMode, fTempScreenMode; - // screen modes for all workspaces - uint32 fOriginalWorkspacesColumns; - uint32 fOriginalWorkspacesRows; - screen_mode fActive, fSelected, fOriginal; - // screen modes for the current workspace - bool fModified; + BButton* fDefaultsButton; + BButton* fApplyButton; + BButton* fRevertButton; + + BButton* fBackgroundsButton; + + ScreenMode fScreenMode, fTempScreenMode; + // screen modes for all workspaces + uint32 fOriginalWorkspacesColumns; + uint32 fOriginalWorkspacesRows; + screen_mode fActive, fSelected, fOriginal; + // screen modes for the current workspace + bool fModified; }; #endif /* SCREEN_WINDOW_H */ From aldeck at mail.berlios.de Fri Aug 7 12:49:27 2009 From: aldeck at mail.berlios.de (aldeck at mail.berlios.de) Date: Fri, 7 Aug 2009 12:49:27 +0200 Subject: [Haiku-commits] r32180 - haiku/trunk/build/jam Message-ID: <200908071049.n77AnRhM029546@sheep.berlios.de> Author: aldeck Date: 2009-08-07 12:49:09 +0200 (Fri, 07 Aug 2009) New Revision: 32180 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32180&view=rev Modified: haiku/trunk/build/jam/HaikuImage Log: * Added Haiku3d demo to the image. Removed GLDirectMode demo as discussed. Modified: haiku/trunk/build/jam/HaikuImage =================================================================== --- haiku/trunk/build/jam/HaikuImage 2009-08-07 10:22:22 UTC (rev 32179) +++ haiku/trunk/build/jam/HaikuImage 2009-08-07 10:49:09 UTC (rev 32180) @@ -75,8 +75,7 @@ Screen ScreenSaver Sounds Time Touchpad Tracker VirtualMemory ; SYSTEM_DEMOS = BSnow Chart Clock Cortex FontDemo - GLDirectMode GLTeapot Mandelbrot Pairs - Playground Pulse Sudoku Gradients + GLTeapot Haiku3d Mandelbrot Pairs Playground Pulse Sudoku Gradients ; SYSTEM_LIBS = libbe.so $(HAIKU_SHARED_LIBSTDC++) libmedia.so libtracker.so libtranslation.so libbnetapi.so libnetwork.so libdebug.so libbsd.so From alex at zappotek.com Fri Aug 7 12:53:27 2009 From: alex at zappotek.com (Alexandre Deckner) Date: Fri, 07 Aug 2009 12:53:27 +0200 Subject: [Haiku-commits] r32180 - haiku/trunk/build/jam In-Reply-To: <200908071049.n77AnRhM029546@sheep.berlios.de> References: <200908071049.n77AnRhM029546@sheep.berlios.de> Message-ID: <4A7C07A7.3080606@zappotek.com> aldeck at mail.berlios.de a ?crit : > Author: aldeck > Date: 2009-08-07 12:49:09 +0200 (Fri, 07 Aug 2009) > New Revision: 32180 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32180&view=rev > > Modified: > haiku/trunk/build/jam/HaikuImage > Log: > * Added Haiku3d demo to the image. Removed GLDirectMode demo as discussed. BTW, it still needs an icon. If someone's motivated go ahead. I'll give it a try otherwise. Alex From axeld at mail.berlios.de Fri Aug 7 13:07:20 2009 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Fri, 7 Aug 2009 13:07:20 +0200 Subject: [Haiku-commits] r32181 - in haiku/trunk/src: add-ons/kernel/drivers/graphics/vesa system/kernel/debug Message-ID: <200908071107.n77B7KcD018663@sheep.berlios.de> Author: axeld Date: 2009-08-07 13:07:14 +0200 (Fri, 07 Aug 2009) New Revision: 32181 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32181&view=rev Modified: haiku/trunk/src/add-ons/kernel/drivers/graphics/vesa/vesa.cpp haiku/trunk/src/system/kernel/debug/frame_buffer_console.cpp Log: * Setting the depth to 1 for VGA mode in frame_buffer_console_init() was not a good idea; it didn't have any consequences in there, but actually broke the app_server's support for the VGA mode. * Cleanup. Modified: haiku/trunk/src/add-ons/kernel/drivers/graphics/vesa/vesa.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/graphics/vesa/vesa.cpp 2009-08-07 10:49:09 UTC (rev 32180) +++ haiku/trunk/src/add-ons/kernel/drivers/graphics/vesa/vesa.cpp 2009-08-07 11:07:14 UTC (rev 32181) @@ -24,6 +24,8 @@ get_color_space_for_depth(uint32 depth) { switch (depth) { + case 1: + return B_GRAY1; case 4: return B_GRAY8; // the app_server is smart enough to translate this to VGA mode Modified: haiku/trunk/src/system/kernel/debug/frame_buffer_console.cpp =================================================================== --- haiku/trunk/src/system/kernel/debug/frame_buffer_console.cpp 2009-08-07 10:49:09 UTC (rev 32180) +++ haiku/trunk/src/system/kernel/debug/frame_buffer_console.cpp 2009-08-07 11:07:14 UTC (rev 32181) @@ -51,7 +51,8 @@ }; // Palette is (white and black are exchanged): -// 0 - white, 1 - blue, 2 - green, 3 - cyan, 4 - red, 5 - magenta, 6 - yellow, 7 - black +// 0 - white, 1 - blue, 2 - green, 3 - cyan, 4 - red, 5 - magenta, 6 - yellow, +// 7 - black // 8-15 - same but bright (we're ignoring those) static uint8 sPalette8[] = { @@ -79,7 +80,7 @@ static struct console_info sConsole; static struct frame_buffer_boot_info sBootInfo; -static struct vesa_mode *sVesaModes; +static struct vesa_mode* sVesaModes; static inline uint8 @@ -96,18 +97,18 @@ } -static uint8 * +static uint8* get_palette_entry(uint8 index) { switch (sConsole.depth) { case 8: return &sPalette8[index]; case 15: - return (uint8 *)&sPalette15[index]; + return (uint8*)&sPalette15[index]; case 16: - return (uint8 *)&sPalette16[index]; + return (uint8*)&sPalette16[index]; default: - return (uint8 *)&sPalette32[index]; + return (uint8*)&sPalette32[index]; } } @@ -120,10 +121,11 @@ glyph = 127; if (sConsole.depth >= 8) { - uint8 *base = (uint8 *)(sConsole.frame_buffer + sConsole.bytes_per_row * y * CHAR_HEIGHT + uint8* base = (uint8*)(sConsole.frame_buffer + + sConsole.bytes_per_row * y * CHAR_HEIGHT + x * CHAR_WIDTH * sConsole.bytes_per_pixel); - uint8 *color = get_palette_entry(foreground_color(attr)); - uint8 *backgroundColor = get_palette_entry(background_color(attr)); + uint8* color = get_palette_entry(foreground_color(attr)); + uint8* backgroundColor = get_palette_entry(background_color(attr)); for (y = 0; y < CHAR_HEIGHT; y++) { uint8 bits = FONT[CHAR_HEIGHT * glyph + y]; @@ -131,8 +133,10 @@ for (int32 i = 0; i < sConsole.bytes_per_pixel; i++) { if (bits & 1) base[x * sConsole.bytes_per_pixel + i] = color[i]; - else - base[x * sConsole.bytes_per_pixel + i] = backgroundColor[i]; + else { + base[x * sConsole.bytes_per_pixel + i] + = backgroundColor[i]; + } } bits >>= 1; } @@ -140,9 +144,10 @@ base += sConsole.bytes_per_row; } } else { - // monochrome mode + // VGA mode will be treated as monochrome + // (ie. only the first plane will be used) - uint8 *base = (uint8 *)(sConsole.frame_buffer + uint8* base = (uint8*)(sConsole.frame_buffer + sConsole.bytes_per_row * y * CHAR_HEIGHT + x * CHAR_WIDTH / 8); uint8 baseOffset = (x * CHAR_WIDTH) & 0x7; @@ -182,7 +187,7 @@ y *= CHAR_HEIGHT; int32 endX = x + CHAR_WIDTH * sConsole.bytes_per_pixel; int32 endY = y + CHAR_HEIGHT; - uint8 *base = (uint8 *)(sConsole.frame_buffer + y * sConsole.bytes_per_row); + uint8* base = (uint8*)(sConsole.frame_buffer + y * sConsole.bytes_per_row); if (sConsole.depth < 8) { x /= 8; @@ -199,7 +204,7 @@ static status_t -console_get_size(int32 *_width, int32 *_height) +console_get_size(int32* _width, int32* _height) { *_width = sConsole.columns; *_height = sConsole.rows; @@ -280,9 +285,9 @@ } for (int32 y = 0; y < height; y++) { - memmove((void *)(sConsole.frame_buffer + (desty + y) + memmove((void*)(sConsole.frame_buffer + (desty + y) * sConsole.bytes_per_row + destx), - (void *)(sConsole.frame_buffer + (srcy + y) * sConsole.bytes_per_row + (void*)(sConsole.frame_buffer + (srcy + y) * sConsole.bytes_per_row + srcx), width); } } @@ -297,19 +302,19 @@ switch (sConsole.bytes_per_pixel) { case 1: if (sConsole.depth >= 8) { - memset((void *)sConsole.frame_buffer, + memset((void*)sConsole.frame_buffer, sPalette8[background_color(attr)], sConsole.height * sConsole.bytes_per_row); } else { // special case for VGA mode - memset((void *)sConsole.frame_buffer, 0xff, + memset((void*)sConsole.frame_buffer, 0xff, sConsole.height * sConsole.bytes_per_row); } break; default: { - uint8 *base = (uint8 *)sConsole.frame_buffer; - uint8 *color = get_palette_entry(background_color(attr)); + uint8* base = (uint8*)sConsole.frame_buffer; + uint8* color = get_palette_entry(background_color(attr)); for (int32 y = 0; y < sConsole.height; y++) { for (int32 x = 0; x < sConsole.width; x++) { @@ -359,10 +364,12 @@ static status_t -frame_buffer_update(addr_t baseAddress, int32 width, int32 height, int32 depth, int32 bytesPerRow) +frame_buffer_update(addr_t baseAddress, int32 width, int32 height, int32 depth, + int32 bytesPerRow) { - TRACE(("frame_buffer_update(buffer = %p, width = %ld, height = %ld, depth = %ld, bytesPerRow = %ld)\n", - (void *)baseAddress, width, height, depth, bytesPerRow)); + TRACE(("frame_buffer_update(buffer = %p, width = %ld, height = %ld, " + "depth = %ld, bytesPerRow = %ld)\n", (void*)baseAddress, width, height, + depth, bytesPerRow)); mutex_lock(&sConsole.lock); @@ -380,7 +387,7 @@ sConsole.cursor_y = -1; TRACE(("framebuffer mapped at %p, %ld columns, %ld rows\n", - (void *)sConsole.frame_buffer, sConsole.columns, sConsole.rows)); + (void*)sConsole.frame_buffer, sConsole.columns, sConsole.rows)); mutex_unlock(&sConsole.lock); return B_OK; @@ -398,27 +405,21 @@ status_t -frame_buffer_console_init(kernel_args *args) +frame_buffer_console_init(kernel_args* args) { if (!args->frame_buffer.enabled) return B_OK; mutex_init(&sConsole.lock, "console_lock"); - void *frameBuffer; + void* frameBuffer; sConsole.area = map_physical_memory("vesa_fb", - (void *)args->frame_buffer.physical_buffer.start, + (void*)args->frame_buffer.physical_buffer.start, args->frame_buffer.physical_buffer.size, B_ANY_KERNEL_ADDRESS, B_READ_AREA | B_WRITE_AREA | B_USER_CLONEABLE_AREA, &frameBuffer); if (sConsole.area < B_OK) return sConsole.area; - if (args->frame_buffer.depth == 4) { - // VGA mode will be treated as monochrome - // (ie. only the first plane will be used) - args->frame_buffer.depth = 1; - } - frame_buffer_update((addr_t)frameBuffer, args->frame_buffer.width, args->frame_buffer.height, args->frame_buffer.depth, args->frame_buffer.bytes_per_row); @@ -432,14 +433,14 @@ add_boot_item(FRAME_BUFFER_BOOT_INFO, &sBootInfo, sizeof(frame_buffer_boot_info)); - sVesaModes = (vesa_mode *)malloc(args->vesa_modes_size); + sVesaModes = (vesa_mode*)malloc(args->vesa_modes_size); if (sVesaModes != NULL) { memcpy(sVesaModes, args->vesa_modes, args->vesa_modes_size); add_boot_item(VESA_MODES_BOOT_INFO, sVesaModes, args->vesa_modes_size); } if (args->edid_info != NULL) { - edid1_info *info = (edid1_info *)malloc(sizeof(edid1_info)); + edid1_info* info = (edid1_info*)malloc(sizeof(edid1_info)); if (info != NULL) { memcpy(info, args->edid_info, sizeof(edid1_info)); add_boot_item(VESA_EDID_BOOT_INFO, info, sizeof(edid1_info)); @@ -451,7 +452,7 @@ status_t -frame_buffer_console_init_post_modules(kernel_args *args) +frame_buffer_console_init_post_modules(kernel_args* args) { if (sConsole.frame_buffer == 0) return B_OK; From axeld at mail.berlios.de Fri Aug 7 13:08:32 2009 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Fri, 7 Aug 2009 13:08:32 +0200 Subject: [Haiku-commits] r32182 - haiku/trunk/src/servers/app/drawing Message-ID: <200908071108.n77B8WEd019866@sheep.berlios.de> Author: axeld Date: 2009-08-07 13:08:31 +0200 (Fri, 07 Aug 2009) New Revision: 32182 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32182&view=rev Modified: haiku/trunk/src/servers/app/drawing/AccelerantHWInterface.cpp Log: * This lets the app_server respect the boot loader's fail-safe video mode setting again. It still allows you to change the mode afterwards, though. * This fixes bug #3419. Modified: haiku/trunk/src/servers/app/drawing/AccelerantHWInterface.cpp =================================================================== --- haiku/trunk/src/servers/app/drawing/AccelerantHWInterface.cpp 2009-08-07 11:07:14 UTC (rev 32181) +++ haiku/trunk/src/servers/app/drawing/AccelerantHWInterface.cpp 2009-08-07 11:08:31 UTC (rev 32182) @@ -96,7 +96,8 @@ AccelerantHWInterface::AccelerantHWInterface() - : HWInterface(), + : + HWInterface(), fCardFD(-1), fAccelerantImage(-1), fAccelerantHook(NULL), @@ -220,15 +221,14 @@ int device = -1; int count = 0; if (!use_fail_safe_video_mode()) { - // ToDo: the former R5 "stub" driver is called "vesa" under Haiku; however, - // we do not need to avoid this driver this way when is has been ported - // to the new driver architecture - the special case here can then be - // removed. + // TODO: We do not need to avoid the "vesa" driver this way once it has + // been ported to the new driver architecture - the special case here + // can then be removed. struct dirent *entry; char path[PATH_MAX]; while (count < deviceNumber && (entry = readdir(directory)) != NULL) { - if (!strcmp(entry->d_name, ".") || !strcmp(entry->d_name, "..") || - !strcmp(entry->d_name, "stub") || !strcmp(entry->d_name, "vesa")) + if (!strcmp(entry->d_name, ".") || !strcmp(entry->d_name, "..") + || !strcmp(entry->d_name, "vesa")) continue; if (device >= 0) { @@ -518,7 +518,9 @@ } #endif - status_t status = fAccSetDisplayMode(&newMode); + status_t status = B_ERROR; + if (!use_fail_safe_video_mode() || !fInitialModeSwitch) + status = fAccSetDisplayMode(&newMode); if (status != B_OK) { ATRACE(("setting display mode failed\n")); if (!fInitialModeSwitch) @@ -534,14 +536,15 @@ if (fModeList == NULL) { status = _UpdateModeList(); - if (status < B_OK) + if (status != B_OK) return status; } // If this is the initial mode switch, we try a number of fallback // modes first, before we have to fail - status = _SetFallbackMode(newMode); + status = use_fail_safe_video_mode() + ? B_ERROR : _SetFallbackMode(newMode); if (status != B_OK) { // The driver doesn't allow us the mode switch - this usually // means we have a driver that doesn't allow mode switches at From axeld at mail.berlios.de Fri Aug 7 13:27:30 2009 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Fri, 7 Aug 2009 13:27:30 +0200 Subject: [Haiku-commits] r32183 - haiku/trunk/src/servers/app/drawing Message-ID: <200908071127.n77BRUUs018678@sheep.berlios.de> Author: axeld Date: 2009-08-07 13:27:30 +0200 (Fri, 07 Aug 2009) New Revision: 32183 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32183&view=rev Modified: haiku/trunk/src/servers/app/drawing/AccelerantHWInterface.cpp Log: * Made the changes in r30278 depending on the USE_ACCELERATION define, ie. you can now easily turn it on again (see #2769). * Also added OFFSCREEN_BACK_BUFFER define to enable the offscreen back buffer trick. Modified: haiku/trunk/src/servers/app/drawing/AccelerantHWInterface.cpp =================================================================== --- haiku/trunk/src/servers/app/drawing/AccelerantHWInterface.cpp 2009-08-07 11:08:31 UTC (rev 32182) +++ haiku/trunk/src/servers/app/drawing/AccelerantHWInterface.cpp 2009-08-07 11:27:30 UTC (rev 32183) @@ -52,7 +52,10 @@ # define ATRACE(x) ; #endif +#define USE_ACCELERATION 0 +#define OFFSCREEN_BACK_BUFFER 0 + // This call updates the frame buffer used by the on-screen KDL extern "C" status_t _kern_frame_buffer_update(void *baseAddress, int32 width, int32 height, int32 depth, int32 bytesPerRow); @@ -508,7 +511,7 @@ bool tryOffscreenBackBuffer = false; fOffscreenBackBuffer = false; -#if 0 +#if USE_ACCELERATION && OFFSCREEN_BACK_BUFFER if (fVGADevice < 0 && (color_space)newMode.space == B_RGB32) { // we should have an accelerated graphics driver, try // to allocate a frame buffer large enough to contain @@ -597,7 +600,7 @@ #endif // update acceleration hooks -#if 0 +#if USE_ACCELERATION fAccFillRect = (fill_rectangle)fAccelerantHook(B_FILL_RECTANGLE, (void *)&fDisplayMode); fAccInvertRect = (invert_rectangle)fAccelerantHook(B_INVERT_RECTANGLE, @@ -636,7 +639,7 @@ && fFrontBuffer->ColorSpace() != B_RGBA32) || fVGADevice >= 0 || fOffscreenBackBuffer) doubleBuffered = true; -#if 1 +#if !USE_ACCELERATION doubleBuffered = true; #endif From bga at bug-br.org.br Fri Aug 7 13:45:17 2009 From: bga at bug-br.org.br (Bruno Albuquerque) Date: Fri, 07 Aug 2009 08:45:17 -0300 Subject: [Haiku-commits] r32183 - haiku/trunk/src/servers/app/drawing In-Reply-To: <200908071127.n77BRUUs018678@sheep.berlios.de> References: <200908071127.n77BRUUs018678@sheep.berlios.de> Message-ID: <4A7C13CD.9070207@bug-br.org.br> axeld at BerliOS wrote: > Author: axeld > Date: 2009-08-07 13:27:30 +0200 (Fri, 07 Aug 2009) > New Revision: 32183 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32183&view=rev > > Modified: > haiku/trunk/src/servers/app/drawing/AccelerantHWInterface.cpp > Log: > * Made the changes in r30278 depending on the USE_ACCELERATION define, ie. you > can now easily turn it on again (see #2769). > * Also added OFFSCREEN_BACK_BUFFER define to enable the offscreen back buffer > trick. Shouldn't the default be acceleration enabled? Also, maybe being able to set it externally (like USE_SSL) would make this even easier to test. -Bruno From axeld at pinc-software.de Fri Aug 7 13:51:26 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Fri, 07 Aug 2009 13:51:26 +0200 CEST Subject: [Haiku-commits] r32183 - haiku/trunk/src/servers/app/drawing In-Reply-To: <4A7C13CD.9070207@bug-br.org.br> Message-ID: <18563125327-BeMail@zon> Bruno Albuquerque wrote: > axeld at BerliOS wrote: > > Modified: > > haiku/trunk/src/servers/app/drawing/AccelerantHWInterface.cpp > > Log: > > * Made the changes in r30278 depending on the USE_ACCELERATION > > define, ie. you > > can now easily turn it on again (see #2769). > > * Also added OFFSCREEN_BACK_BUFFER define to enable the offscreen > > back buffer > > trick. > Shouldn't the default be acceleration enabled? As Stephan pointed out acceleration is actually counter productive on newer machines (mostly because how our acceleration stuff works), so no. > Also, maybe being able to > set it externally (like USE_SSL) would make this even easier to test. It's supposed to be a temporary solution only, see #2769. Bye, Axel. From axeld at mail.berlios.de Fri Aug 7 14:29:18 2009 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Fri, 7 Aug 2009 14:29:18 +0200 Subject: [Haiku-commits] r32184 - haiku/trunk/src/system/kernel/fs Message-ID: <200908071229.n77CTIQI022641@sheep.berlios.de> Author: axeld Date: 2009-08-07 14:29:17 +0200 (Fri, 07 Aug 2009) New Revision: 32184 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32184&view=rev Modified: haiku/trunk/src/system/kernel/fs/fd.cpp haiku/trunk/src/system/kernel/fs/vfs.cpp Log: * Replaced all "status < B_OK" with != B_OK - this should make the VFS layer more robust against broken (userland) file systems. * 80 character column cleanup. Modified: haiku/trunk/src/system/kernel/fs/fd.cpp =================================================================== --- haiku/trunk/src/system/kernel/fs/fd.cpp 2009-08-07 11:27:30 UTC (rev 32183) +++ haiku/trunk/src/system/kernel/fs/fd.cpp 2009-08-07 12:29:17 UTC (rev 32184) @@ -1,10 +1,12 @@ /* - * Copyright 2002-2008, Axel D?rfler, axeld at pinc-software.de. + * Copyright 2002-2009, Axel D?rfler, axeld at pinc-software.de. * Distributed under the terms of the MIT License. */ + //! Operations on file descriptors + #include #include @@ -31,7 +33,7 @@ static struct file_descriptor* get_fd_locked(struct io_context* context, int fd); -static struct file_descriptor *remove_fd(struct io_context *context, int fd); +static struct file_descriptor* remove_fd(struct io_context* context, int fd); static void deselect_select_infos(file_descriptor* descriptor, select_info* infos); @@ -83,28 +85,30 @@ }; -/*** General fd routines ***/ +// #pragma mark - General fd routines #ifdef DEBUG -void dump_fd(int fd, struct file_descriptor *descriptor); +void dump_fd(int fd, struct file_descriptor* descriptor); void -dump_fd(int fd,struct file_descriptor *descriptor) +dump_fd(int fd,struct file_descriptor* descriptor) { - dprintf("fd[%d] = %p: type = %ld, ref_count = %ld, ops = %p, u.vnode = %p, u.mount = %p, cookie = %p, open_mode = %lx, pos = %Ld\n", - fd, descriptor, descriptor->type, descriptor->ref_count, descriptor->ops, - descriptor->u.vnode, descriptor->u.mount, descriptor->cookie, descriptor->open_mode, descriptor->pos); + dprintf("fd[%d] = %p: type = %ld, ref_count = %ld, ops = %p, u.vnode = %p, " + "u.mount = %p, cookie = %p, open_mode = %lx, pos = %Ld\n", + fd, descriptor, descriptor->type, descriptor->ref_count, + descriptor->ops, descriptor->u.vnode, descriptor->u.mount, + descriptor->cookie, descriptor->open_mode, descriptor->pos); } #endif -/** Allocates and initializes a new file_descriptor */ - -struct file_descriptor * +/*! Allocates and initializes a new file_descriptor. +*/ +struct file_descriptor* alloc_fd(void) { - file_descriptor *descriptor + file_descriptor* descriptor = (file_descriptor*)malloc(sizeof(struct file_descriptor)); if (descriptor == NULL) return NULL; @@ -121,14 +125,14 @@ bool -fd_close_on_exec(struct io_context *context, int fd) +fd_close_on_exec(struct io_context* context, int fd) { return CHECK_BIT(context->fds_close_on_exec[fd / 8], fd & 7) ? true : false; } void -fd_set_close_on_exec(struct io_context *context, int fd, bool closeFD) +fd_set_close_on_exec(struct io_context* context, int fd, bool closeFD) { if (closeFD) context->fds_close_on_exec[fd / 8] |= (1 << (fd & 7)); @@ -137,12 +141,12 @@ } -/** Searches a free slot in the FD table of the provided I/O context, and inserts - * the specified descriptor into it. - */ - +/*! Searches a free slot in the FD table of the provided I/O context, and + inserts the specified descriptor into it. +*/ int -new_fd_etc(struct io_context *context, struct file_descriptor *descriptor, int firstIndex) +new_fd_etc(struct io_context* context, struct file_descriptor* descriptor, + int firstIndex) { int fd = -1; uint32 i; @@ -172,18 +176,17 @@ int -new_fd(struct io_context *context, struct file_descriptor *descriptor) +new_fd(struct io_context* context, struct file_descriptor* descriptor) { return new_fd_etc(context, descriptor, 0); } -/** Reduces the descriptor's reference counter, and frees all resources - * when it's no longer used. - */ - +/*! Reduces the descriptor's reference counter, and frees all resources + when it's no longer used. +*/ void -put_fd(struct file_descriptor *descriptor) +put_fd(struct file_descriptor* descriptor) { int32 previous = atomic_add(&descriptor->ref_count, -1); @@ -221,12 +224,11 @@ } -/** Decrements the open counter of the file descriptor and invokes - * its close hook when appropriate. - */ - +/*! Decrements the open counter of the file descriptor and invokes + its close hook when appropriate. +*/ void -close_fd(struct file_descriptor *descriptor) +close_fd(struct file_descriptor* descriptor) { if (atomic_add(&descriptor->open_count, -1) == 1) { vfs_unlock_vnode_if_locked(descriptor); @@ -238,9 +240,9 @@ status_t -close_fd_index(struct io_context *context, int fd) +close_fd_index(struct io_context* context, int fd) { - struct file_descriptor *descriptor = remove_fd(context, fd); + struct file_descriptor* descriptor = remove_fd(context, fd); if (descriptor == NULL) return B_FILE_ERROR; @@ -253,34 +255,33 @@ } -/** This descriptor's underlying object will be closed and freed - * as soon as possible (in one of the next calls to put_fd() - - * get_fd() will no longer succeed on this descriptor). - * This is useful if the underlying object is gone, for instance - * when a (mounted) volume got removed unexpectedly. - */ - +/*! This descriptor's underlying object will be closed and freed as soon as + possible (in one of the next calls to put_fd() - get_fd() will no longer + succeed on this descriptor). + This is useful if the underlying object is gone, for instance when a + (mounted) volume got removed unexpectedly. +*/ void -disconnect_fd(struct file_descriptor *descriptor) +disconnect_fd(struct file_descriptor* descriptor) { descriptor->open_mode |= O_DISCONNECTED; } void -inc_fd_ref_count(struct file_descriptor *descriptor) +inc_fd_ref_count(struct file_descriptor* descriptor) { atomic_add(&descriptor->ref_count, 1); } -static struct file_descriptor * -get_fd_locked(struct io_context *context, int fd) +static struct file_descriptor* +get_fd_locked(struct io_context* context, int fd) { if (fd < 0 || (uint32)fd >= context->table_size) return NULL; - struct file_descriptor *descriptor = context->fds[fd]; + struct file_descriptor* descriptor = context->fds[fd]; if (descriptor != NULL) { // Disconnected descriptors cannot be accessed anymore @@ -294,8 +295,8 @@ } -struct file_descriptor * -get_fd(struct io_context *context, int fd) +struct file_descriptor* +get_fd(struct io_context* context, int fd) { MutexLocker _(context->io_mutex); @@ -303,12 +304,12 @@ } -struct file_descriptor * -get_open_fd(struct io_context *context, int fd) +struct file_descriptor* +get_open_fd(struct io_context* context, int fd) { MutexLocker _(context->io_mutex); - file_descriptor *descriptor = get_fd_locked(context, fd); + file_descriptor* descriptor = get_fd_locked(context, fd); if (descriptor == NULL) return NULL; @@ -318,13 +319,12 @@ } -/** Removes the file descriptor from the specified slot. - */ - -static struct file_descriptor * -remove_fd(struct io_context *context, int fd) +/*! Removes the file descriptor from the specified slot. +*/ +static struct file_descriptor* +remove_fd(struct io_context* context, int fd) { - struct file_descriptor *descriptor = NULL; + struct file_descriptor* descriptor = NULL; if (fd < 0) return NULL; @@ -361,8 +361,8 @@ static int dup_fd(int fd, bool kernel) { - struct io_context *context = get_current_io_context(kernel); - struct file_descriptor *descriptor; + struct io_context* context = get_current_io_context(kernel); + struct file_descriptor* descriptor; int status; TRACE(("dup_fd: fd = %d\n", fd)); @@ -395,8 +395,8 @@ static int dup2_fd(int oldfd, int newfd, bool kernel) { - struct file_descriptor *evicted = NULL; - struct io_context *context; + struct file_descriptor* evicted = NULL; + struct io_context* context; TRACE(("dup2_fd: ofd = %d, nfd = %d\n", oldfd, newfd)); @@ -490,9 +490,9 @@ static status_t -fd_ioctl(bool kernelFD, int fd, ulong op, void *buffer, size_t length) +fd_ioctl(bool kernelFD, int fd, ulong op, void* buffer, size_t length) { - struct file_descriptor *descriptor; + struct file_descriptor* descriptor; int status; descriptor = get_fd(get_current_io_context(kernelFD), fd); @@ -663,15 +663,15 @@ } -/** This function checks if the specified fd is valid in the current - * context. It can be used for a quick check; the fd is not locked - * so it could become invalid immediately after this check. - */ - +/*! This function checks if the specified fd is valid in the current + context. It can be used for a quick check; the fd is not locked + so it could become invalid immediately after this check. +*/ bool fd_is_valid(int fd, bool kernel) { - struct file_descriptor *descriptor = get_fd(get_current_io_context(kernel), fd); + struct file_descriptor* descriptor + = get_fd(get_current_io_context(kernel), fd); if (descriptor == NULL) return false; @@ -680,8 +680,8 @@ } -struct vnode * -fd_vnode(struct file_descriptor *descriptor) +struct vnode* +fd_vnode(struct file_descriptor* descriptor) { switch (descriptor->type) { case FDTYPE_FILE: @@ -703,7 +703,7 @@ static ssize_t -common_user_io(int fd, off_t pos, void *buffer, size_t length, bool write) +common_user_io(int fd, off_t pos, void* buffer, size_t length, bool write) { if (!IS_USER_ADDRESS(buffer)) return B_BAD_ADDRESS; @@ -739,7 +739,7 @@ else status = descriptor->ops->fd_read(descriptor, pos, buffer, &length); - if (status < B_OK) + if (status != B_OK) return status; if (movePosition) @@ -750,7 +750,7 @@ static ssize_t -common_user_vector_io(int fd, off_t pos, const iovec *userVecs, size_t count, +common_user_vector_io(int fd, off_t pos, const iovec* userVecs, size_t count, bool write) { if (!IS_USER_ADDRESS(userVecs)) @@ -759,7 +759,7 @@ if (pos < -1) return B_BAD_VALUE; - /* prevent integer overflow exploit in malloc() */ + // prevent integer overflow exploit in malloc() if (count > IOV_MAX) return B_BAD_VALUE; @@ -778,7 +778,7 @@ return B_NO_MEMORY; MemoryDeleter _(vecs); - if (user_memcpy(vecs, userVecs, sizeof(iovec) * count) < B_OK) + if (user_memcpy(vecs, userVecs, sizeof(iovec) * count) != B_OK) return B_BAD_ADDRESS; bool movePosition = false; @@ -805,7 +805,7 @@ &length); } - if (status < B_OK) { + if (status != B_OK) { if (bytesTransferred == 0) return status; status = B_OK; @@ -831,7 +831,7 @@ status_t -user_fd_kernel_ioctl(int fd, ulong op, void *buffer, size_t length) +user_fd_kernel_ioctl(int fd, ulong op, void* buffer, size_t length) { TRACE(("user_fd_kernel_ioctl: fd %d\n", fd)); @@ -843,28 +843,28 @@ ssize_t -_user_read(int fd, off_t pos, void *buffer, size_t length) +_user_read(int fd, off_t pos, void* buffer, size_t length) { return common_user_io(fd, pos, buffer, length, false); } ssize_t -_user_readv(int fd, off_t pos, const iovec *userVecs, size_t count) +_user_readv(int fd, off_t pos, const iovec* userVecs, size_t count) { return common_user_vector_io(fd, pos, userVecs, count, false); } ssize_t -_user_write(int fd, off_t pos, const void *buffer, size_t length) +_user_write(int fd, off_t pos, const void* buffer, size_t length) { return common_user_io(fd, pos, (void*)buffer, length, true); } ssize_t -_user_writev(int fd, off_t pos, const iovec *userVecs, size_t count) +_user_writev(int fd, off_t pos, const iovec* userVecs, size_t count) { return common_user_vector_io(fd, pos, userVecs, count, true); } @@ -875,7 +875,7 @@ { syscall_64_bit_return_value(); - struct file_descriptor *descriptor; + struct file_descriptor* descriptor; descriptor = get_fd(get_current_io_context(false), fd); if (!descriptor) @@ -894,7 +894,7 @@ status_t -_user_ioctl(int fd, ulong op, void *buffer, size_t length) +_user_ioctl(int fd, ulong op, void* buffer, size_t length) { if (!IS_USER_ADDRESS(buffer)) return B_BAD_ADDRESS; @@ -908,15 +908,17 @@ ssize_t -_user_read_dir(int fd, struct dirent *buffer, size_t bufferSize, uint32 maxCount) +_user_read_dir(int fd, struct dirent* buffer, size_t bufferSize, + uint32 maxCount) { - struct file_descriptor *descriptor; + struct file_descriptor* descriptor; ssize_t retval; if (!IS_USER_ADDRESS(buffer)) return B_BAD_ADDRESS; - TRACE(("user_read_dir(fd = %d, buffer = %p, bufferSize = %ld, count = %lu)\n", fd, buffer, bufferSize, maxCount)); + TRACE(("user_read_dir(fd = %d, buffer = %p, bufferSize = %ld, count = " + "%lu)\n", fd, buffer, bufferSize, maxCount)); struct io_context* ioContext = get_current_io_context(false); descriptor = get_fd(ioContext, fd); @@ -940,7 +942,7 @@ status_t _user_rewind_dir(int fd) { - struct file_descriptor *descriptor; + struct file_descriptor* descriptor; status_t status; TRACE(("user_rewind_dir(fd = %d)\n", fd)); @@ -984,13 +986,13 @@ ssize_t -_kern_read(int fd, off_t pos, void *buffer, size_t length) +_kern_read(int fd, off_t pos, void* buffer, size_t length) { if (pos < -1) return B_BAD_VALUE; FDGetter fdGetter; - struct file_descriptor *descriptor = fdGetter.SetTo(fd, true); + struct file_descriptor* descriptor = fdGetter.SetTo(fd, true); if (!descriptor) return B_FILE_ERROR; @@ -1025,7 +1027,7 @@ ssize_t -_kern_readv(int fd, off_t pos, const iovec *vecs, size_t count) +_kern_readv(int fd, off_t pos, const iovec* vecs, size_t count) { bool movePosition = false; status_t status; @@ -1035,7 +1037,7 @@ return B_BAD_VALUE; FDGetter fdGetter; - struct file_descriptor *descriptor = fdGetter.SetTo(fd, true); + struct file_descriptor* descriptor = fdGetter.SetTo(fd, true); if (!descriptor) return B_FILE_ERROR; @@ -1058,7 +1060,7 @@ size_t length = vecs[i].iov_len; status = descriptor->ops->fd_read(descriptor, pos, vecs[i].iov_base, &length); - if (status < B_OK) { + if (status != B_OK) { bytesRead = status; break; } @@ -1079,13 +1081,13 @@ ssize_t -_kern_write(int fd, off_t pos, const void *buffer, size_t length) +_kern_write(int fd, off_t pos, const void* buffer, size_t length) { if (pos < -1) return B_BAD_VALUE; FDGetter fdGetter; - struct file_descriptor *descriptor = fdGetter.SetTo(fd, true); + struct file_descriptor* descriptor = fdGetter.SetTo(fd, true); if (descriptor == NULL) return B_FILE_ERROR; @@ -1120,7 +1122,7 @@ ssize_t -_kern_writev(int fd, off_t pos, const iovec *vecs, size_t count) +_kern_writev(int fd, off_t pos, const iovec* vecs, size_t count) { bool movePosition = false; status_t status; @@ -1130,7 +1132,7 @@ return B_BAD_VALUE; FDGetter fdGetter; - struct file_descriptor *descriptor = fdGetter.SetTo(fd, true); + struct file_descriptor* descriptor = fdGetter.SetTo(fd, true); if (!descriptor) return B_FILE_ERROR; @@ -1153,7 +1155,7 @@ size_t length = vecs[i].iov_len; status = descriptor->ops->fd_write(descriptor, pos, vecs[i].iov_base, &length); - if (status < B_OK) { + if (status != B_OK) { bytesWritten = status; break; } @@ -1176,7 +1178,7 @@ off_t _kern_seek(int fd, off_t pos, int seekType) { - struct file_descriptor *descriptor; + struct file_descriptor* descriptor; descriptor = get_fd(get_current_io_context(true), fd); if (!descriptor) @@ -1193,7 +1195,7 @@ status_t -_kern_ioctl(int fd, ulong op, void *buffer, size_t length) +_kern_ioctl(int fd, ulong op, void* buffer, size_t length) { TRACE(("kern_ioctl: fd %d\n", fd)); @@ -1204,12 +1206,14 @@ ssize_t -_kern_read_dir(int fd, struct dirent *buffer, size_t bufferSize, uint32 maxCount) +_kern_read_dir(int fd, struct dirent* buffer, size_t bufferSize, + uint32 maxCount) { - struct file_descriptor *descriptor; + struct file_descriptor* descriptor; ssize_t retval; - TRACE(("sys_read_dir(fd = %d, buffer = %p, bufferSize = %ld, count = %lu)\n",fd, buffer, bufferSize, maxCount)); + TRACE(("sys_read_dir(fd = %d, buffer = %p, bufferSize = %ld, count = " + "%lu)\n",fd, buffer, bufferSize, maxCount)); struct io_context* ioContext = get_current_io_context(true); descriptor = get_fd(ioContext, fd); @@ -1233,7 +1237,7 @@ status_t _kern_rewind_dir(int fd) { - struct file_descriptor *descriptor; + struct file_descriptor* descriptor; status_t status; TRACE(("sys_rewind_dir(fd = %d)\n",fd)); Modified: haiku/trunk/src/system/kernel/fs/vfs.cpp =================================================================== --- haiku/trunk/src/system/kernel/fs/vfs.cpp 2009-08-07 11:27:30 UTC (rev 32183) +++ haiku/trunk/src/system/kernel/fs/vfs.cpp 2009-08-07 12:29:17 UTC (rev 32184) @@ -7,6 +7,7 @@ * Distributed under the terms of the NewOS License. */ + /*! Virtual File System and File System Interface Layer */ @@ -457,16 +458,16 @@ static status_t file_deselect(struct file_descriptor* descriptor, uint8 event, struct selectsync* sync); static status_t dir_read(struct io_context* context, - struct file_descriptor* descriptor, struct dirent* buffer, size_t bufferSize, - uint32* _count); + struct file_descriptor* descriptor, struct dirent* buffer, + size_t bufferSize, uint32* _count); static status_t dir_read(struct io_context* ioContext, struct vnode* vnode, void* cookie, struct dirent* buffer, size_t bufferSize, uint32* _count); static status_t dir_rewind(struct file_descriptor* descriptor); static void dir_free_fd(struct file_descriptor* descriptor); static status_t dir_close(struct file_descriptor* descriptor); static status_t attr_dir_read(struct io_context* context, - struct file_descriptor* descriptor, struct dirent* buffer, size_t bufferSize, - uint32* _count); + struct file_descriptor* descriptor, struct dirent* buffer, + size_t bufferSize, uint32* _count); static status_t attr_dir_rewind(struct file_descriptor* descriptor); static void attr_dir_free_fd(struct file_descriptor* descriptor); static status_t attr_dir_close(struct file_descriptor* descriptor); @@ -483,14 +484,14 @@ static status_t attr_write_stat(struct file_descriptor* descriptor, const struct stat* stat, int statMask); static status_t index_dir_read(struct io_context* context, - struct file_descriptor* descriptor, struct dirent* buffer, size_t bufferSize, - uint32* _count); + struct file_descriptor* descriptor, struct dirent* buffer, + size_t bufferSize, uint32* _count); static status_t index_dir_rewind(struct file_descriptor* descriptor); static void index_dir_free_fd(struct file_descriptor* descriptor); static status_t index_dir_close(struct file_descriptor* descriptor); static status_t query_read(struct io_context* context, - struct file_descriptor* descriptor, struct dirent* buffer, size_t bufferSize, - uint32* _count); + struct file_descriptor* descriptor, struct dirent* buffer, + size_t bufferSize, uint32* _count); static status_t query_rewind(struct file_descriptor* descriptor); static void query_free_fd(struct file_descriptor* descriptor); static status_t query_close(struct file_descriptor* descriptor); @@ -995,7 +996,8 @@ struct vnode* vnode = (struct vnode*)_vnode; const struct vnode_hash_key* key = (vnode_hash_key*)_key; -#define VHASH(mountid, vnodeid) (((uint32)((vnodeid) >> 32) + (uint32)(vnodeid)) ^ (uint32)(mountid)) +#define VHASH(mountid, vnodeid) \ + (((uint32)((vnodeid) >> 32) + (uint32)(vnodeid)) ^ (uint32)(mountid)) if (vnode != NULL) return VHASH(vnode->device, vnode->id) % range; @@ -1190,7 +1192,8 @@ inc_vnode_ref_count(struct vnode* vnode) { atomic_add(&vnode->ref_count, 1); - TRACE(("inc_vnode_ref_count: vnode %p, ref now %ld\n", vnode, vnode->ref_count)); + TRACE(("inc_vnode_ref_count: vnode %p, ref now %ld\n", vnode, + vnode->ref_count)); } @@ -1288,7 +1291,7 @@ } else { // we need to create a new vnode and read it in status = create_new_vnode(&vnode, mountID, vnodeID); - if (status < B_OK) + if (status != B_OK) goto err; vnode->busy = true; @@ -1314,7 +1317,7 @@ mutex_lock(&sVnodeMutex); - if (status < B_OK) { + if (status != B_OK) { if (gotNode) FS_CALL(vnode, put_vnode, reenter); @@ -1432,9 +1435,9 @@ mutex_unlock(&sVnodeMutex); - if (lock >= B_OK) + if (lock >= 0) lock = acquire_sem(lock); - if (lock < B_OK) { + if (lock < 0) { // This means the locking has been deleted in the mean time // or had never existed in the first place - otherwise, we // would get the lock at some point. @@ -1469,11 +1472,11 @@ lockingDeleter.SetTo(locking); locking->wait_sem = create_sem(0, "advisory lock"); - if (locking->wait_sem < B_OK) + if (locking->wait_sem < 0) return locking->wait_sem; locking->lock = create_sem(0, "advisory locking"); - if (locking->lock < B_OK) + if (locking->lock < 0) return locking->lock; } @@ -1760,7 +1763,7 @@ return EOPNOTSUPP; status = FS_CALL(vnode, read_stat, &stat); - if (status < B_OK) + if (status != B_OK) return status; flock->l_start += stat.st_size; @@ -2144,7 +2147,7 @@ return get_vnode(dir->device, id, _vnode, true, false); status_t status = FS_CALL(dir, lookup, name, &id); - if (status < B_OK) + if (status != B_OK) return status; mutex_lock(&sVnodeMutex); @@ -2197,7 +2200,8 @@ struct vnode* nextVnode; char* nextPath; - TRACE(("vnode_path_to_vnode: top of loop. p = %p, p = '%s'\n", path, path)); + TRACE(("vnode_path_to_vnode: top of loop. p = %p, p = '%s'\n", path, + path)); // done? if (path[0] == '\0') @@ -2242,12 +2246,12 @@ if (status == B_OK && HAS_FS_CALL(vnode, access)) status = FS_CALL(vnode, access, X_OK); - // Tell the filesystem to get the vnode of this path component (if we got the - // permission from the call above) - if (status >= B_OK) + // Tell the filesystem to get the vnode of this path component (if we + // got the permission from the call above) + if (status == B_OK) status = lookup_dir_entry(vnode, path, &nextVnode); - if (status < B_OK) { + if (status != B_OK) { put_vnode(vnode); return status; } @@ -2261,7 +2265,8 @@ TRACE(("traverse link\n")); - // it's not exactly nice style using goto in this way, but hey, it works :-/ + // it's not exactly nice style using goto in this way, but hey, + // it works :-/ if (count + 1 > B_MAX_SYMLINKS) { status = B_LINK_LIMIT; goto resolve_link_error; @@ -2282,7 +2287,7 @@ } else status = B_BAD_VALUE; - if (status < B_OK) { + if (status != B_OK) { free(buffer); resolve_link_error: @@ -2327,7 +2332,7 @@ free(buffer); - if (status < B_OK) { + if (status != B_OK) { put_vnode(vnode); return status; } @@ -2418,7 +2423,8 @@ The path buffer must be able to store at least one additional character. */ static status_t -path_to_dir_vnode(char* path, struct vnode** _vnode, char* filename, bool kernel) +path_to_dir_vnode(char* path, struct vnode** _vnode, char* filename, + bool kernel) { status_t status = get_dir_path_and_leaf(path, filename); if (status != B_OK) @@ -2529,7 +2535,8 @@ // See if vnode is the root of a mount and move to the covered // vnode so we get the underlying file system VNodePutter vnodePutter; - if (vnode->mount->root_vnode == vnode && vnode->mount->covers_vnode != NULL) { + if (vnode->mount->root_vnode == vnode + && vnode->mount->covers_vnode != NULL) { vnode = vnode->mount->covers_vnode; inc_vnode_ref_count(vnode); vnodePutter.SetTo(vnode); @@ -2556,7 +2563,7 @@ uint32 num = 1; status = dir_read(ioContext, parent, cookie, buffer, bufferSize, &num); - if (status < B_OK) + if (status != B_OK) break; if (num == 0) { status = B_ENTRY_NOT_FOUND; @@ -2662,7 +2669,7 @@ inc_vnode_ref_count(vnode); } else { status = lookup_dir_entry(vnode, "..", &parentVnode); - if (status < B_OK) + if (status != B_OK) goto out; } @@ -2684,7 +2691,7 @@ put_vnode(vnode); vnode = parentVnode; - if (status < B_OK) + if (status != B_OK) goto out; if (hitRoot) { @@ -2778,7 +2785,8 @@ static struct file_descriptor* get_fd_and_vnode(int fd, struct vnode** _vnode, bool kernel) { - struct file_descriptor* descriptor = get_fd(get_current_io_context(kernel), fd); + struct file_descriptor* descriptor + = get_fd(get_current_io_context(kernel), fd); if (descriptor == NULL) return NULL; @@ -3122,7 +3130,8 @@ struct fs_mount* mount; hash_open(sMountsTable, &iterator); - while ((mount = (struct fs_mount*)hash_next(sMountsTable, &iterator)) != NULL) { + while ((mount = (struct fs_mount*)hash_next(sMountsTable, &iterator)) + != NULL) { kprintf("%p%4ld %p %p %p %s\n", mount, mount->id, mount->root_vnode, mount->covers_vnode, mount->volume->private_volume, mount->volume->file_system_name); @@ -3285,9 +3294,10 @@ if (fd == NULL) continue; - kprintf(" %3lu: %ld %p %3ld %4ld %4lx %10Ld %p %s %p\n", i, fd->type, fd->ops, - fd->ref_count, fd->open_count, fd->open_mode, fd->pos, fd->cookie, - fd->type >= FDTYPE_INDEX && fd->type <= FDTYPE_QUERY ? "mount" : "vnode", + kprintf(" %3lu: %ld %p %3ld %4ld %4lx %10Ld %p %s %p\n", i, fd->type, + fd->ops, fd->ref_count, fd->open_count, fd->open_mode, fd->pos, + fd->cookie, fd->type >= FDTYPE_INDEX && fd->type <= FDTYPE_QUERY + ? "mount" : "vnode", fd->u.vnode); } @@ -3392,7 +3402,7 @@ // sparse read status = zero_pages(&vecs[vecIndex], vecCount - vecIndex, &size); } - if (status < B_OK) + if (status != B_OK) return status; // TODO: this is a work-around for buggy device drivers! @@ -3401,7 +3411,8 @@ // overwrite precious data) // b) panic if the term below is true (at least for writes) if (size > fileVecs[0].length) { - //dprintf("warning: device driver %p doesn't respect total length in read_pages() call!\n", ref->device); + //dprintf("warning: device driver %p doesn't respect total length " + // "in read_pages() call!\n", ref->device); size = fileVecs[0].length; } @@ -3500,7 +3511,7 @@ status = FS_CALL(vnode, read_pages, cookie, fileOffset, tempVecs, tempCount, &bytes); } - if (status < B_OK) + if (status != B_OK) return status; totalSize += bytes; @@ -3960,7 +3971,7 @@ struct vnode* vnode; status_t status = path_to_vnode(buffer, true, &vnode, NULL, kernel); - if (status < B_OK) + if (status != B_OK) return status; *_vnode = vnode; @@ -3974,7 +3985,7 @@ struct vnode* vnode; status_t status = get_vnode(mountID, vnodeID, &vnode, canWait, false); - if (status < B_OK) + if (status != B_OK) return status; *_vnode = vnode; @@ -4031,7 +4042,7 @@ fs_mount* mount; status_t status = get_mount(volume->id, &mount); - if (status < B_OK) + if (status != B_OK) return status; char* buffer = pathBuffer.LockBuffer(); @@ -4050,7 +4061,7 @@ put_mount(mount); - if (status < B_OK) + if (status != B_OK) return status; if (vnode->device != volume->id) { @@ -4123,7 +4134,7 @@ return B_BUFFER_OVERFLOW; status = path_to_vnode(pathBuffer, true, &dir, NULL, true); - if (status < B_OK) + if (status != B_OK) return status; // the path buffer had been clobbered by the above call @@ -4153,7 +4164,7 @@ moduleName = nextPath; status = vnode_path_to_vnode(dir, path, true, 0, true, &file, NULL); - if (status < B_OK) { + if (status != B_OK) { // vnode_path_to_vnode() has already released the reference to dir return status; } @@ -4172,8 +4183,8 @@ return B_OK; } else { - TRACE(("vfs_get_module_path(): something is strange here: 0x%08lx...\n", - file->type)); + TRACE(("vfs_get_module_path(): something is strange here: " + "0x%08lx...\n", file->type)); status = B_ERROR; dir = file; goto err; @@ -4351,7 +4362,7 @@ struct vnode* vnode; status_t status = get_vnode(mountID, vnodeID, &vnode, true, true); - if (status < B_OK) + if (status != B_OK) return status; disconnect_mount_or_vnode_fds(vnode->mount, vnode); @@ -4483,7 +4494,8 @@ vfs_get_file_map(struct vnode* vnode, off_t offset, size_t size, file_io_vec* vecs, size_t* _count) { - FUNCTION(("vfs_get_file_map: vnode %p, vecs %p, offset %Ld, size = %lu\n", vnode, vecs, offset, size)); + FUNCTION(("vfs_get_file_map: vnode %p, vecs %p, offset %Ld, size = %lu\n", + vnode, vecs, offset, size)); return FS_CALL(vnode, get_file_map, offset, size, vecs, _count); } @@ -4510,7 +4522,7 @@ { struct vnode* vnode; status_t status = get_vnode(device, inode, &vnode, true, false); - if (status < B_OK) + if (status != B_OK) return status; status = FS_CALL(vnode, read_stat, stat); @@ -4553,14 +4565,14 @@ leaf = NULL; } else status = get_vnode(device, inode, &vnode, true, false); - if (status < B_OK) + if (status != B_OK) return status; // get the directory path status = dir_vnode_to_path(vnode, path, pathLength, true); put_vnode(vnode); // we don't need the vnode anymore - if (status < B_OK) + if (status != B_OK) return status; // append the leaf name @@ -4931,13 +4943,19 @@ [... truncated: 890 lines follow ...] From axeld at pinc-software.de Fri Aug 7 14:31:53 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Fri, 07 Aug 2009 14:31:53 +0200 CEST Subject: [Haiku-commits] r32180 - haiku/trunk/build/jam In-Reply-To: <4A7C07A7.3080606@zappotek.com> Message-ID: <20990469902-BeMail@zon> Alexandre Deckner wrote: > > Log: > > * Added Haiku3d demo to the image. Removed GLDirectMode demo as > > discussed. > BTW, it still needs an icon. If someone's motivated go ahead. I'll > give > it a try otherwise. Don't you want to add mouse control of the viewport, similar to what GLTeapot is doing? :-) Bye, Axel. From anevilyak at gmail.com Fri Aug 7 14:36:53 2009 From: anevilyak at gmail.com (Rene Gollent) Date: Fri, 7 Aug 2009 07:36:53 -0500 Subject: [Haiku-commits] r32173 - haiku/trunk/src/kits/interface In-Reply-To: <200908070722.n777MwMc005658@sheep.berlios.de> References: <200908070722.n777MwMc005658@sheep.berlios.de> Message-ID: On Fri, Aug 7, 2009 at 2:22 AM, axeld at BerliOS wrote: > Author: axeld > Date: 2009-08-07 09:22:56 +0200 (Fri, 07 Aug 2009) > New Revision: 32173 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32173&view=rev > > Modified: > ? haiku/trunk/src/kits/interface/BMCPrivate.cpp > Log: > * Only take the popup marker into account if fShowPopUpMarker is true. > * Automatic whitespace cleanup. Thanks! I didn't realize it was possible for BMenuField to not show that marker. Regards, Rene From alex at zappotek.com Fri Aug 7 15:06:07 2009 From: alex at zappotek.com (Alexandre Deckner) Date: Fri, 07 Aug 2009 15:06:07 +0200 Subject: [Haiku-commits] r32180 - haiku/trunk/build/jam In-Reply-To: <20990469902-BeMail@zon> References: <20990469902-BeMail@zon> Message-ID: <4A7C26BF.5030402@zappotek.com> Axel D?rfler a ?crit : > Alexandre Deckner wrote: > >>> Log: >>> * Added Haiku3d demo to the image. Removed GLDirectMode demo as >>> discussed. >>> >> BTW, it still needs an icon. If someone's motivated go ahead. I'll >> give >> it a try otherwise. >> > > Don't you want to add mouse control of the viewport, similar to what > GLTeapot is doing? :-) > > Well, i've done it locally for another demo based on the same code (a google earth like demo), but couldn't find a use for the haiku logo demo really :) Maybe just some variations on the animation via a menu, but mouse movement, i'm not sure. I've other ideas though (with some working code already): video texures, for dropping videos on an object, and an audio-in media node to do animation from audio. The way i designed the code, it is meant to be reusable from several demos, it's a minimalist 3d engine. I haven't decided if several demos would be accessible from a menu on the same app, or if separate apps should be done, and thus i'd have to make a library of it. Both should be doable. It's always hard to restrain oneself, but i really didn't want to bloat the code to early while the core has yet to mature a bit :) For now, i wanted to let it mature a bit in the image while my head is stuck in Tracker's PoseView 8-) Best regards, Alex From stippi at mail.berlios.de Fri Aug 7 15:18:27 2009 From: stippi at mail.berlios.de (stippi at mail.berlios.de) Date: Fri, 7 Aug 2009 15:18:27 +0200 Subject: [Haiku-commits] r32185 - haiku/trunk/src/add-ons/media/plugins/ffmpeg Message-ID: <200908071318.n77DIR3Q031719@sheep.berlios.de> Author: stippi Date: 2009-08-07 15:18:26 +0200 (Fri, 07 Aug 2009) New Revision: 32185 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32185&view=rev Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecDecoder.cpp haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatReader.cpp Log: * In the AVCodecDecoder, use the audio format of the original input format, but specify it to 16bits/sample if it's still a wildcard. Make sure to allocate the scrub buffer with the correct sample size (was hardcoded to 2 bytes per sample). * In the AVFormatReader, specify the sample format for B_MEDIA_ENCODED_AUDIO. Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecDecoder.cpp =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecDecoder.cpp 2009-08-07 12:29:17 UTC (rev 32184) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecDecoder.cpp 2009-08-07 13:18:26 UTC (rev 32185) @@ -334,7 +334,11 @@ = fInputFormat.u.encoded_audio.output.frame_rate; outputAudioFormat.channel_count = fInputFormat.u.encoded_audio.output.channel_count; - outputAudioFormat.format = media_raw_audio_format::B_AUDIO_SHORT; + outputAudioFormat.format = fInputFormat.u.encoded_audio.output.format; + // Check that format is not still a wild card! + if (outputAudioFormat.format == 0) + outputAudioFormat.format = media_raw_audio_format::B_AUDIO_SHORT; + outputAudioFormat.buffer_size = 1024 * fInputFormat.u.encoded_audio.output.channel_count; inOutFormat->type = B_MEDIA_RAW_AUDIO; @@ -367,7 +371,9 @@ result); fStartTime = 0; - fOutputFrameSize = 2 * outputAudioFormat.channel_count; + size_t sampleSize = outputAudioFormat.format + & media_raw_audio_format::B_AUDIO_SIZE_MASK; + fOutputFrameSize = sampleSize * outputAudioFormat.channel_count; fOutputFrameCount = outputAudioFormat.buffer_size / fOutputFrameSize; fOutputFrameRate = outputAudioFormat.frame_rate; fChunkBuffer = 0; Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatReader.cpp =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatReader.cpp 2009-08-07 12:29:17 UTC (rev 32184) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatReader.cpp 2009-08-07 13:18:26 UTC (rev 32185) @@ -479,7 +479,7 @@ format->u.encoded_audio.frame_size = codecContext->frame_size; // Fill in some info about possible output format format->u.encoded_audio.output - = media_multi_audio_format::wildcard; + = avformat_to_beos_format(codecContext->sample_fmt); format->u.encoded_audio.output.frame_rate = (float)codecContext->sample_rate; format->u.encoded_audio.output.channel_count From mattmadia at gmail.com Fri Aug 7 15:27:11 2009 From: mattmadia at gmail.com (mattmadia at gmail.com) Date: Fri, 07 Aug 2009 06:27:11 -0700 (PDT) Subject: [Haiku-commits] BOM: r32185 - ...failed C++ /objects/haiku/--arch--/release/add-ons/media/plugins/ffmpeg/AVFormatReader.o ... Message-ID: <4a7c2baf.1d045a0a.09a2.ffffb98b@mx.google.com> Host Machine : FreeBSD 7.2-RELEASE i386 Host Machine 32|64bit : 32bit use-xattr : True use-32bit : False Architectures Tested : ppc x86gcc2 x86gcc4 x86gcc2hybrid x86gcc4hybrid Targets Affected : x86gcc4- at alpha-cd x86gcc4- at alpha-raw x86gcc4- at alpha-vmware x86gcc2- at alpha-cd x86gcc2- at alpha-raw x86gcc2- at alpha-vmware x86gcc2hybrid- at alpha-cd x86gcc2hybrid- at alpha-raw x86gcc2hybrid- at alpha-vmware x86gcc4hybrid- at alpha-cd x86gcc4hybrid- at alpha-raw x86gcc4hybrid- at alpha-vmware Log Snippet : AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/boot/scsi_disk AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/boot/usb_disk AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/boot/intel AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/boot/bfs AppendToContainerCopyFilesScript haiku.image-copy-files-dummy-system/add-ons/accelerants AppendToContainerCopyFilesScript haiku.image-copy-files-dummy-system/add-ons/opengl AppendToContainerCopyFilesScript haiku.image-copy-files-dummy-system/add-ons/Translators AppendToContainerCopyFilesScript haiku.image-copy-files-dummy-system/add-ons/mail_daemon/inbound_protocols AppendToContainerCopyFilesScript haiku.image-copy-files-dummy-system/add-ons/mail_daemon/outbound_protocols AppendToContainerCopyFilesScript haiku.image-copy-files-dummy-system/add-ons/mail_daemon/inbound_filters AppendToContainerCopyFilesScript haiku.image-copy-files-dummy-system/add-ons/mail_daemon/outbound_filters AppendToContainerCopyFilesScript haiku.image-copy-files-dummy-system/add-ons/mail_daemon/system_filters AppendToContainerCopyFilesScript haiku.image-copy-files-dummy-system/add-ons/media C++ /storage/Build-o-Matic/haiku/haiku/generated.x86gcc4/objects/haiku/x86/release/add-ons/media/plugins/ffmpeg/AVFormatReader.o /storage/Build-o-Matic/haiku/haiku/src/add-ons/media/plugins/ffmpeg/AVFormatReader.cpp: In member function 'status_t AVFormatReader::StreamCookie::Init(int32)': /storage/Build-o-Matic/haiku/haiku/src/add-ons/media/plugins/ffmpeg/AVFormatReader.cpp:482: error: no match for 'operator=' in 'format->media_format::u.media_format::::encoded_audio.media_encoded_audio_format::output = avformat_to_beos_format(codecContext->AVCodecContext::sample_fmt)' /storage/Build-o-Matic/haiku/haiku/headers/os/media/MediaDefs.h:242: note: candidates are: media_raw_audio_format& media_raw_audio_format::operator=(const media_raw_audio_format&) /storage/Build-o-Matic/haiku/haiku/generated.x86gcc4/cross-tools/bin/i586-pc-haiku-gcc -c "/storage/Build-o-Matic/haiku/haiku/src/add-ons/media/plugins/ffmpeg/AVFormatReader.cpp" -O -Wall -Wno-trigraphs -Wno-ctor-dtor-privacy -Woverloaded-virtual -Wpointer-arith -Wcast-align -Wsign-compare -Wno-multichar -pipe -fno-strict-aliasing -fno-tree-vrp -nostdinc -Wno-deprecated -D_ZETA_USING_DEPRECATED_API_=1 -D_ZETA_TS_FIND_DIR_=1 -D__HAIKU__ -DHAIKU_DISTRO_COMPATIBILITY_DEFAULT -D__INTEL__ -DARCH_x86 -DBOOT_ARCHIVE_IMAGE_OFFSET=300 -DHAIKU_TARGET_PLATFORM_HAIKU -iquote /storage/Build-o-Matic/haiku/haiku/build/user_config_headers -iquote /storage/Build-o-Matic/haiku/haiku/build/config_headers -iquote /storage/Build-o-Matic/haiku/haiku/src/add-ons/media/plugins/ffmpeg -iquote /storage/Build-o-Matic/haiku/haiku/generated.x86gcc4/objects/common/add-ons/media/plugins/ffmpeg -iquote /storage/Build-o-Matic/haiku/haiku/generated.x86gcc4/objects/freebsd/x86/common/add-ons/media/plugins/ffmpeg -iquote /storage/Build-o-Matic/haiku/haiku/generated.x86gcc4/objects/haiku/x86/common/add-ons/media/plugins/ffmpeg -iquote /storage/Build-o-Matic/haiku/haiku/src/add-ons/media/plugins/ffmpeg/libavcodec -iquote /storage/Build-o-Matic/haiku/haiku/src/add-ons/media/plugins/ffmpeg/libavformat -iquote /storage/Build-o-Matic/haiku/haiku/src/add-ons/media/plugins/ffmpeg/libavutil -iquote /storage/Build-o-Matic/haiku/haiku/src/add-ons/media/plugins/ffmpeg/libswscale -I /storage/Build-o-Matic/haiku/haiku/headers/private/media -I /storage/Build-o-Matic/haiku/haiku/headers/private/shared -I /storage/Build-o-Matic/haiku/haiku/generated.x86gcc4/cross-tools/lib/gcc/i586-pc-haiku/4.3.3/../../../../i586-pc-haiku/include/c++/4.3.3 -I /storage/Build-o-Matic/haiku/haiku/generated.x86gcc4/cross-tools/lib/gcc/i586-pc-haiku/4.3.3/../../../../i586-pc-haiku/include/c++/4.3.3/i586-pc-haiku -I /storage/Build-o-Matic/haiku/haiku/generated.x86gcc4/cross-tools/lib/gcc/i586-pc-haiku/4.3.3/../../../../i586-pc-haiku/include/c++/4.3.3/backward -I /storage/Build-o-Matic/haiku/haiku/generated.x86gcc4/cross-tools/lib/gcc/i586-pc-haiku/4.3.3/../../../../i586-pc-haiku/include/c++/4.3.3/ext -I /storage/Build-o-Matic/haiku/haiku/generated.x86gcc4/cross-tools/lib/gcc/i586-pc-haiku/4.3.3/include -I /storage/Build-o-Matic/haiku/haiku/generated.x86gcc4/cross-tools/lib/gcc/i586-pc-haiku/4.3.3/include-fixed -I /storage/Build-o-Matic/haiku/haiku/headers -I /storage/Build-o-Matic/haiku/haiku/headers/posix -I /storage/Build-o-Matic/haiku/haiku/headers/gnu -I /storage/Build-o-Matic/haiku/haiku/headers/glibc -I /storage/Build-o-Matic/haiku/haiku/headers/os -I /storage/Build-o-Matic/haiku/haiku/headers/os/add-ons -I /storage/Build-o-Matic/haiku/haiku/headers/os/add-ons/file_system -I /storage/Build-o-Matic/haiku/haiku/headers/os/add-ons/graphics -I /storage/Build-o-Matic/haiku/haiku/headers/os/add-ons/input_server -I /storage/Build-o-Matic/haiku/haiku/headers/os/add-ons/registrar -I /storage/Build-o-Matic/haiku/haiku/headers/os/add-ons/screen_saver -I /storage/Build-o-Matic/haiku/haiku/headers/os/add-ons/tracker -I /storage/Build-o-Matic/haiku/haiku/headers/os/app -I /storage/Build-o-Matic/haiku/haiku/headers/os/device -I /storage/Build-o-Matic/haiku/haiku/headers/os/drivers -I /storage/Build-o-Matic/haiku/haiku/headers/os/game -I /storage/Build-o-Matic/haiku/haiku/headers/os/interface -I /storage/Build-o-Matic/haiku/haiku/headers/os/kernel -I /storage/Build-o-Matic/haiku/haiku/headers/os/media -I /storage/Build-o-Matic/haiku/haiku/headers/os/mail -I /storage/Build-o-Matic/haiku/haiku/headers/os/midi -I /storage/Build-o-Matic/haiku/haiku/headers/os/midi2 -I /storage/Build-o-Matic/haiku/haiku/headers/os/net -I /storage/Build-o-Matic/haiku/haiku/headers/os/opengl -I /storage/Build-o-Matic/haiku/haiku/headers/os/storage -I /storage/Build-o-Matic/haiku/haiku/headers/os/support -I /storage/Build-o-Matic/haiku/haiku/headers/os/translation -I /storage/Build-o-Matic/haiku/haiku/headers/private/. -o "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc4/objects/haiku/x86/release/add-ons/media/plugins/ffmpeg/AVFormatReader.o" ; ...failed C++ /storage/Build-o-Matic/haiku/haiku/generated.x86gcc4/objects/haiku/x86/release/add-ons/media/plugins/ffmpeg/AVFormatReader.o ... ...skipped ffmpeg for lack of AVFormatReader.o... ...skipped haiku.image-copy-files-dummy-system/add-ons/media/plugins for lack of ffmpeg... ...skipped haiku-alpha.vmdk for lack of haiku.image-copy-files... ...failed updating 1 target(s)... ...skipped 3 target(s)... ...updated 255 target(s)... command: jam -q -j1 @alpha-vmware From stippi at mail.berlios.de Fri Aug 7 15:54:20 2009 From: stippi at mail.berlios.de (stippi at mail.berlios.de) Date: Fri, 7 Aug 2009 15:54:20 +0200 Subject: [Haiku-commits] r32186 - haiku/trunk/src/add-ons/media/plugins/ffmpeg Message-ID: <200908071354.n77DsKog006418@sheep.berlios.de> Author: stippi Date: 2009-08-07 15:54:18 +0200 (Fri, 07 Aug 2009) New Revision: 32186 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32186&view=rev Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatReader.cpp Log: Sorry, reverted r32185, as it was complete bogus and didn't even compile (got confused about what I already compiled here). The sample format was already specified. Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatReader.cpp =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatReader.cpp 2009-08-07 13:18:26 UTC (rev 32185) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatReader.cpp 2009-08-07 13:54:18 UTC (rev 32186) @@ -479,7 +479,7 @@ format->u.encoded_audio.frame_size = codecContext->frame_size; // Fill in some info about possible output format format->u.encoded_audio.output - = avformat_to_beos_format(codecContext->sample_fmt); + = media_multi_audio_format::wildcard; format->u.encoded_audio.output.frame_rate = (float)codecContext->sample_rate; format->u.encoded_audio.output.channel_count From axeld at pinc-software.de Fri Aug 7 16:19:46 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Fri, 07 Aug 2009 16:19:46 +0200 CEST Subject: [Haiku-commits] r32180 - haiku/trunk/build/jam In-Reply-To: <4A7C26BF.5030402@zappotek.com> Message-ID: <27463526220-BeMail@zon> Alexandre Deckner wrote: > Axel D?rfler a ?crit : > > Don't you want to add mouse control of the viewport, similar to > > what > > GLTeapot is doing? :-) > Well, i've done it locally for another demo based on the same code (a > google earth like demo), > but couldn't find a use for the haiku logo demo really :) Maybe just > some variations on the animation via a menu, but mouse movement, i'm > not > sure. Maybe I expressed myself incorrectly: I meant only changing the rotation of the logo, not its position; just so that you have something to say about what it does, too :-) [...] > It's always hard to restrain oneself, but i really didn't want to > bloat > the code to early while the core has yet to mature a bit :) > For now, i wanted to let it mature a bit in the image while my head > is > stuck in Tracker's PoseView 8-) Hopefully not too long :-) Bye, Axel. From mmlr at mail.berlios.de Fri Aug 7 16:39:17 2009 From: mmlr at mail.berlios.de (mmlr at mail.berlios.de) Date: Fri, 7 Aug 2009 16:39:17 +0200 Subject: [Haiku-commits] r32187 - haiku/trunk/src/kits/app Message-ID: <200908071439.n77EdHue012855@sheep.berlios.de> Author: mmlr Date: 2009-08-07 16:39:15 +0200 (Fri, 07 Aug 2009) New Revision: 32187 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32187&view=rev Modified: haiku/trunk/src/kits/app/Message.cpp Log: Minor cleanup. Modified: haiku/trunk/src/kits/app/Message.cpp =================================================================== --- haiku/trunk/src/kits/app/Message.cpp 2009-08-07 13:54:18 UTC (rev 32186) +++ haiku/trunk/src/kits/app/Message.cpp 2009-08-07 14:39:15 UTC (rev 32187) @@ -977,21 +977,21 @@ ssize_t result1 = stream->Write(fHeader, sizeof(message_header)); if (result1 != sizeof(message_header)) - return (result1 >= 0 ? B_ERROR : result1); + return result1 < 0 ? result1 : B_ERROR; ssize_t result2 = 0; if (fHeader->field_count > 0) { ssize_t fieldsSize = fHeader->field_count * sizeof(field_header); result2 = stream->Write(fFields, fieldsSize); if (result2 != fieldsSize) - return (result2 >= 0 ? B_ERROR : result2); + return result2 < 0 ? result2 : B_ERROR; } ssize_t result3 = 0; if (fHeader->data_size > 0) { result3 = stream->Write(fData, fHeader->data_size); if (result3 != (ssize_t)fHeader->data_size) - return (result3 >= 0 ? B_ERROR : result3); + return result3 < 0 ? result3 : B_ERROR; } if (size) @@ -1273,12 +1273,10 @@ uint8 *header = (uint8 *)fHeader; ssize_t result = stream->Read(header + sizeof(uint32), sizeof(message_header) - sizeof(uint32)); - result -= sizeof(message_header) - sizeof(uint32); - - if (result != B_OK || fHeader->format != MESSAGE_FORMAT_HAIKU + if (result != sizeof(message_header) - sizeof(uint32) || (fHeader->flags & MESSAGE_FLAG_VALID) == 0) { _InitHeader(); - return B_BAD_VALUE; + return result < 0 ? result : B_BAD_VALUE; } what = fHeader->what; From stippi at mail.berlios.de Fri Aug 7 16:54:19 2009 From: stippi at mail.berlios.de (stippi at mail.berlios.de) Date: Fri, 7 Aug 2009 16:54:19 +0200 Subject: [Haiku-commits] r32188 - in haiku/trunk/src/add-ons/media/plugins/ffmpeg: . libavcodec/x86 Message-ID: <200908071454.n77EsJsc014517@sheep.berlios.de> Author: stippi Date: 2009-08-07 16:54:17 +0200 (Fri, 07 Aug 2009) New Revision: 32188 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32188&view=rev Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/MuxerTable.cpp haiku/trunk/src/add-ons/media/plugins/ffmpeg/config.h haiku/trunk/src/add-ons/media/plugins/ffmpeg/libavcodec/x86/Jamfile Log: * Disabled GPL H.264 ASM code * Enabled WAV muxer. * Updated configure line in config.h to be closer to what it could have been to produce the current config.h, but a lot of encoders and muxers are enabled manually at the moment, so this line wouldn't produce the config.h as is. Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/MuxerTable.cpp =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/MuxerTable.cpp 2009-08-07 14:39:15 UTC (rev 32187) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/MuxerTable.cpp 2009-08-07 14:54:17 UTC (rev 32188) @@ -55,6 +55,19 @@ // "ogg", // { 0 } // }, + { + media_file_format::B_WRITABLE + | media_file_format::B_KNOWS_ENCODED_AUDIO, + { 0 }, + B_WAV_FORMAT_FAMILY, + 100, + { 0 }, + "audio/x-wav", + "WAV Format", + "wav", + "wav", + { 0 } + }, }; const size_t gMuxerCount = sizeof(gMuxerTable) / sizeof(media_file_format); Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/config.h =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/config.h 2009-08-07 14:39:15 UTC (rev 32187) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/config.h 2009-08-07 14:54:17 UTC (rev 32188) @@ -1,7 +1,7 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -#define FFMPEG_CONFIGURATION "--prefix=/boot/common/ --enable-shared --enable-gpl --disable-debug --disable-mmx --disable-demuxer=audio-beos --disable-muxer=audio-beos --disable-encoders --disable-parsers --disable-demuxers --disable-muxers" +#define FFMPEG_CONFIGURATION "--prefix=/boot/common/ --enable-shared --disable-debug --disable-mmx --disable-demuxer=audio-beos --disable-muxer=audio-beos" #define FFMPEG_DATADIR "/boot/common//share/ffmpeg" #define ARCH_ALPHA 0 #define ARCH_ARM 0 @@ -717,7 +717,7 @@ #define CONFIG_TGP_MUXER 0 #define CONFIG_VC1T_MUXER 0 #define CONFIG_VOC_MUXER 0 -#define CONFIG_WAV_MUXER 0 +#define CONFIG_WAV_MUXER 1 #define CONFIG_YUV4MPEGPIPE_MUXER 0 #define CONFIG_LIBNUT_MUXER 0 #define CONFIG_CROP_FILTER 1 Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/libavcodec/x86/Jamfile =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/libavcodec/x86/Jamfile 2009-08-07 14:39:15 UTC (rev 32187) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/libavcodec/x86/Jamfile 2009-08-07 14:54:17 UTC (rev 32188) @@ -44,8 +44,8 @@ idct_sse2_xvid.c vp3dsp_sse2.c vp6dsp_sse2.c - h264_idct_sse2.nasm - h264_deblock_sse2.nasm +# h264_idct_sse2.nasm # GPL +# h264_deblock_sse2.nasm # GPL ; } From stippi at mail.berlios.de Fri Aug 7 17:21:38 2009 From: stippi at mail.berlios.de (stippi at mail.berlios.de) Date: Fri, 7 Aug 2009 17:21:38 +0200 Subject: [Haiku-commits] r32189 - in haiku/trunk/src/add-ons/media/plugins/ffmpeg: . libavcodec Message-ID: <200908071521.n77FLcBG018959@sheep.berlios.de> Author: stippi Date: 2009-08-07 17:21:37 +0200 (Fri, 07 Aug 2009) New Revision: 32189 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32189&view=rev Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/config.h haiku/trunk/src/add-ons/media/plugins/ffmpeg/libavcodec/Jamfile Log: Disabled the rest of the GPL code as per the FFmpeg 0.5 README. Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/config.h =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/config.h 2009-08-07 14:54:17 UTC (rev 32188) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/config.h 2009-08-07 15:21:37 UTC (rev 32189) @@ -284,14 +284,14 @@ #define CONFIG_ZLIB_DECODER 1 #define CONFIG_ZMBV_DECODER 1 #define CONFIG_AAC_DECODER 1 -#define CONFIG_AC3_DECODER 1 +#define CONFIG_AC3_DECODER 0 #define CONFIG_ALAC_DECODER 1 #define CONFIG_APE_DECODER 1 #define CONFIG_ATRAC3_DECODER 1 #define CONFIG_COOK_DECODER 1 #define CONFIG_DCA_DECODER 1 #define CONFIG_DSICINAUDIO_DECODER 1 -#define CONFIG_EAC3_DECODER 1 +#define CONFIG_EAC3_DECODER 0 #define CONFIG_FLAC_DECODER 1 #define CONFIG_IMC_DECODER 1 #define CONFIG_MACE3_DECODER 1 Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/libavcodec/Jamfile =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/libavcodec/Jamfile 2009-08-07 14:54:17 UTC (rev 32188) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/libavcodec/Jamfile 2009-08-07 15:21:37 UTC (rev 32189) @@ -27,8 +27,8 @@ aasc.c ac3.c ac3_parser.c - ac3dec.c - ac3dec_data.c +# ac3dec.c # GPL +# ac3dec_data.c # GPL ac3enc.c ac3tab.c acelp_filters.c @@ -92,7 +92,7 @@ faandct.c faanidct.c faxcompr.c -# fdctref.c +# fdctref.c # GPL, only used for DCT test program fft.c ffv1.c flacdec.c From jonas at kirilla.com Fri Aug 7 19:08:53 2009 From: jonas at kirilla.com (Jonas =?iso-8859-1?q?Sundstr=F6m?=) Date: Fri, 07 Aug 2009 19:08:53 +0200 CEST Subject: [Haiku-commits] r32180 - haiku/trunk/build/jam In-Reply-To: <4A7C26BF.5030402@zappotek.com> Message-ID: <8008305023-BeMail@kirilla> Alexandre Deckner wrote: ... > while my head is stuck in Tracker's PoseView 8-) Could I persuade you to have a look at http://dev.haiku-os.org/ticket/4191#comment:1 /Jonas. From stippi at mail.berlios.de Fri Aug 7 19:14:43 2009 From: stippi at mail.berlios.de (stippi at mail.berlios.de) Date: Fri, 7 Aug 2009 19:14:43 +0200 Subject: [Haiku-commits] r32190 - haiku/trunk/build/jam Message-ID: <200908071714.n77HEhTa018399@sheep.berlios.de> Author: stippi Date: 2009-08-07 19:14:33 +0200 (Fri, 07 Aug 2009) New Revision: 32190 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32190&view=rev Modified: haiku/trunk/build/jam/OptionalPackages Log: Updated the Clockwerk package to a version that has persistent options in the render settings window. Modified: haiku/trunk/build/jam/OptionalPackages =================================================================== --- haiku/trunk/build/jam/OptionalPackages 2009-08-07 15:21:37 UTC (rev 32189) +++ haiku/trunk/build/jam/OptionalPackages 2009-08-07 17:14:33 UTC (rev 32190) @@ -204,15 +204,15 @@ if $(TARGET_ARCH) != x86 { Echo "No optional package Clockwerk available for $(TARGET_ARCH)" ; } else if $(HAIKU_GCC_VERSION[1]) >= 4 { - InstallOptionalHaikuImagePackage Clockwerk-0.0.1-x86-gcc4-2009-08-04 - : $(baseURL)/Clockwerk-0.0.1-x86-gcc4-2009-08-04.zip + InstallOptionalHaikuImagePackage Clockwerk-0.0.1-x86-gcc4-2009-08-06 + : $(baseURL)/Clockwerk-0.0.1-x86-gcc4-2009-08-06.zip : ; AddSymlinkToHaikuImage home config be Applications : /boot/apps/Clockwerk/Clockwerk ; } else { - InstallOptionalHaikuImagePackage Clockwerk-0.0.1-x86-gcc2-2009-08-04 - : $(baseURL)/Clockwerk-0.0.1-x86-gcc2-2009-08-04.zip + InstallOptionalHaikuImagePackage Clockwerk-0.0.1-x86-gcc2-2009-08-06 + : $(baseURL)/Clockwerk-0.0.1-x86-gcc2-2009-08-06.zip : ; AddSymlinkToHaikuImage home config be Applications From stippi at mail.berlios.de Fri Aug 7 19:19:35 2009 From: stippi at mail.berlios.de (stippi at mail.berlios.de) Date: Fri, 7 Aug 2009 19:19:35 +0200 Subject: [Haiku-commits] r32191 - in haiku/trunk/src/add-ons/media/plugins/ffmpeg: . libavcodec/x86 Message-ID: <200908071719.n77HJZrb025581@sheep.berlios.de> Author: stippi Date: 2009-08-07 19:19:32 +0200 (Fri, 07 Aug 2009) New Revision: 32191 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32191&view=rev Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/Jamfile haiku/trunk/src/add-ons/media/plugins/ffmpeg/config.h haiku/trunk/src/add-ons/media/plugins/ffmpeg/libavcodec/x86/Jamfile Log: Include GPL code in the FFmpeg plugin during compilation, if the Haiku build system has been configured to include GPL add-ons. This cannot be switched on the fly without rebuilding all of the FFmpeg plugin, since the change in the Jamfile defines will not automatically trigger a rebuild. So if you change your configuration with regards to --include-gpl-addons, you have to touch config.h (this commit touches it anyway). Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/Jamfile =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/Jamfile 2009-08-07 17:14:33 UTC (rev 32190) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/Jamfile 2009-08-07 17:19:32 UTC (rev 32191) @@ -24,7 +24,7 @@ gfx_conv_c_lookup.cpp # gfx_conv_mmx.cpp gfx_util.cpp - : + : libavformat.a libavcodec.a libavcodec_$(TARGET_ARCH).a @@ -72,7 +72,7 @@ HAIKU_FFMPEG_DEFINES += ARCH_PPC=1 ; HAIKU_FFMPEG_DEFINES += ARCH_SPARC=0 ; HAIKU_FFMPEG_DEFINES += HAVE_AMD3DNOW=0 HAVE_AMD3DNOWEXT=0 ; - HAIKU_FFMPEG_DEFINES += HAVE_MMX=0 HAVE_MMX2=0 HAVE_SSE=0 HAVE_SSSE3=0 ; + HAIKU_FFMPEG_DEFINES += HAVE_MMX=0 HAVE_MMX2=0 HAVE_SSE=0 HAVE_SSSE3=0 ; HAIKU_FFMPEG_DEFINES += HAVE_ALTIVEC=1 ; HAIKU_FFMPEG_DEFINES += HAVE_VIS=0 ; } else if $(TARGET_ARCH) = sparc { @@ -80,11 +80,18 @@ HAIKU_FFMPEG_DEFINES += ARCH_PPC=0 ; HAIKU_FFMPEG_DEFINES += ARCH_SPARC=1 ; HAIKU_FFMPEG_DEFINES += HAVE_AMD3DNOW=0 HAVE_AMD3DNOWEXT=0 ; - HAIKU_FFMPEG_DEFINES += HAVE_MMX=0 HAVE_MMX2=0 HAVE_SSE=0 HAVE_SSSE3=0 ; + HAIKU_FFMPEG_DEFINES += HAVE_MMX=0 HAVE_MMX2=0 HAVE_SSE=0 HAVE_SSSE3=0 ; HAIKU_FFMPEG_DEFINES += HAVE_ALTIVEC=0 ; HAIKU_FFMPEG_DEFINES += HAVE_VIS=1 ; } +if $(INCLUDE_GPL_ADDONS) = 1 { + HAIKU_FFMPEG_DEFINES += CONFIG_GPL=1 ; +} else { + HAIKU_FFMPEG_DEFINES += CONFIG_GPL=0 ; +} + + HAIKU_FFMPEG_DEFINES = [ FDefines $(HAIKU_FFMPEG_DEFINES) ] ; SubInclude HAIKU_TOP src add-ons media plugins ffmpeg libavcodec ; Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/config.h =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/config.h 2009-08-07 17:14:33 UTC (rev 32190) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/config.h 2009-08-07 17:19:32 UTC (rev 32191) @@ -123,7 +123,7 @@ #define CONFIG_FFSERVER 0 #define CONFIG_FFT 1 #define CONFIG_GOLOMB 1 -#define CONFIG_GPL 0 +//#define CONFIG_GPL 0 // defined in Jamfile depending on build config #define CONFIG_GPROF 0 #define CONFIG_GRAY 0 #define CONFIG_HARDCODED_TABLES 1 Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/libavcodec/x86/Jamfile =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/libavcodec/x86/Jamfile 2009-08-07 17:14:33 UTC (rev 32190) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/libavcodec/x86/Jamfile 2009-08-07 17:19:32 UTC (rev 32191) @@ -21,7 +21,6 @@ dsputil_mmx.c dsputilenc_mmx.c fdct_mmx.c -# idct_mmx.c # GPL idct_mmx_xvid.c motion_est_mmx.c mpegvideo_mmx.c @@ -34,6 +33,11 @@ fft_mmx.nasm dsputil_yasm.nasm ; + if $(INCLUDE_GPL_ADDONS) = 1 { + mmxSources += + idct_mmx.c + ; + } } local sseSources = ; @@ -44,9 +48,13 @@ idct_sse2_xvid.c vp3dsp_sse2.c vp6dsp_sse2.c -# h264_idct_sse2.nasm # GPL -# h264_deblock_sse2.nasm # GPL ; + if $(INCLUDE_GPL_ADDONS) = 1 { + sseSources += + h264_idct_sse2.nasm + h264_deblock_sse2.nasm + ; + } } local amdSources = ; From alex at zappotek.com Fri Aug 7 19:34:13 2009 From: alex at zappotek.com (Alexandre Deckner) Date: Fri, 07 Aug 2009 19:34:13 +0200 Subject: [Haiku-commits] r32180 - haiku/trunk/build/jam In-Reply-To: <8008305023-BeMail@kirilla> References: <8008305023-BeMail@kirilla> Message-ID: <4A7C6595.3030506@zappotek.com> Jonas Sundstr?m a ?crit : > Alexandre Deckner wrote: > ... > >> while my head is stuck in Tracker's PoseView 8-) >> > > Could I persuade you to have a look at > http://dev.haiku-os.org/ticket/4191#comment:1 If only i had time for enhancements :D Have you seen the bug list? Best regards, Alex From jonas at kirilla.com Fri Aug 7 19:59:55 2009 From: jonas at kirilla.com (Jonas =?iso-8859-1?q?Sundstr=F6m?=) Date: Fri, 07 Aug 2009 19:59:55 +0200 CEST Subject: [Haiku-commits] r32180 - haiku/trunk/build/jam In-Reply-To: <4A7C6595.3030506@zappotek.com> Message-ID: <11070895063-BeMail@kirilla> Alexandre Deckner wrote: > Jonas Sundstr?m a ?crit : > > Alexandre Deckner wrote: > > ... > > > >> while my head is stuck in Tracker's PoseView 8-) > >> > > > > Could I persuade you to have a look at > > http://dev.haiku-os.org/ticket/4191#comment:1 > > If only i had time for enhancements :D Have you seen the bug list? I can imagine. But I actually do consider what I'm describing in the comment a bug. I would like to be able to pop in a CD, press Alt-A, Alt-O and have it play in a single MediaPlayer (playlist) rather than in 10 concurrent MediaPlayer. /Jonas. From mattmadia at gmail.com Fri Aug 7 21:22:38 2009 From: mattmadia at gmail.com (mattmadia at gmail.com) Date: Fri, 07 Aug 2009 12:22:38 -0700 (PDT) Subject: [Haiku-commits] BOM: r32191 - ...failed Link /objects/haiku/--arch--/release/add-ons/media/plugins/ffmpeg/ffmpeg ... Message-ID: <4a7c7efe.07035a0a.124d.42f3@mx.google.com> Host Machine : FreeBSD 7.2-RELEASE i386 Host Machine 32|64bit : 32bit use-xattr : True use-32bit : False Architectures Tested : ppc x86gcc2 x86gcc4 x86gcc2hybrid x86gcc4hybrid Targets Affected : x86gcc2hybrid- at alpha-cd x86gcc2hybrid- at alpha-raw x86gcc2hybrid- at alpha-vmware x86gcc2- at alpha-cd x86gcc2- at alpha-raw x86gcc2- at alpha-vmware Log Snippet : AddSymlinkToContainerCopyFilesScript system/add-ons/kernel/boot/bfs AppendToContainerCopyFilesScript haiku.image-copy-files-dummy-system/add-ons/accelerants AppendToContainerCopyFilesScript haiku.image-copy-files-dummy-system/add-ons/opengl AppendToContainerCopyFilesScript haiku.image-copy-files-dummy-system/add-ons/Translators AppendToContainerCopyFilesScript haiku.image-copy-files-dummy-system/add-ons/mail_daemon/inbound_protocols AppendToContainerCopyFilesScript haiku.image-copy-files-dummy-system/add-ons/mail_daemon/outbound_protocols AppendToContainerCopyFilesScript haiku.image-copy-files-dummy-system/add-ons/mail_daemon/inbound_filters AppendToContainerCopyFilesScript haiku.image-copy-files-dummy-system/add-ons/mail_daemon/outbound_filters AppendToContainerCopyFilesScript haiku.image-copy-files-dummy-system/add-ons/mail_daemon/system_filters AppendToContainerCopyFilesScript haiku.image-copy-files-dummy-system/add-ons/media Link /storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/x86/release/add-ons/media/plugins/ffmpeg/ffmpeg /storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/x86/release/add-ons/media/plugins/ffmpeg/libavcodec/x86/libavcodec_x86.a(dsputil_mmx.o): In function `ff_x264_deblock_v_luma_intra_mmxext': dsputil_mmx.c:(.text+0x1f5a4): undefined reference to `ff_x264_deblock_v8_luma_intra_mmxext' dsputil_mmx.c:(.text+0x1f5b4): undefined reference to `ff_x264_deblock_v8_luma_intra_mmxext' collect2: ld returned 1 exit status /storage/Build-o-Matic/haiku/haiku/generated.x86gcc2/cross-tools/bin/i586-pc-haiku-gcc -pipe -nostart -Xlinker -soname="ffmpeg" -nostdlib -Xlinker --no-undefined -o "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/x86/release/add-ons/media/plugins/ffmpeg/ffmpeg" "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/x86/release/system/glue/arch/x86/crti.o" "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2/cross-tools/lib/gcc-lib/i586-pc-haiku/2.95.3-haiku-090629/crtbegin.o" "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/x86/release/system/glue/init_term_dyn.o" "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/x86/release/add-ons/media/plugins/ffmpeg/AVCodecDecoder.o" "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/x86/release/add-ons/media/plugins/ffmpeg/AVCodecEncoder.o" "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/x86/release/add-ons/media/plugins/ffmpeg/AVFormatReader.o" "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/x86/release/add-ons/media/plugins/ffmpeg/AVFormatWriter.o" "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/x86/release/add-ons/media/plugins/ffmpeg/CodecTable.o" "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/x86/release/add-ons/media/plugins/ffmpeg/DemuxerTable.o" "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/x86/release/add-ons/media/plugins/ffmpeg/EncoderTable.o" "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/x86/release/add-ons/media/plugins/ffmpeg/FFmpegPlugin.o" "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/x86/release/add-ons/media/plugins/ffmpeg/MuxerTable.o" "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/x86/release/add-ons/media/plugins/ffmpeg/gfx_conv_c.o" "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/x86/release/add-ons/media/plugins/ffmpeg/gfx_conv_c_lookup.o" "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/x86/release/add-ons/media/plugins/ffmpeg/gfx_util.o" \ "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/x86/release/add-ons/media/plugins/ffmpeg/libavformat/libavformat.a" "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/x86/release/add-ons/media/plugins/ffmpeg/libavcodec/libavcodec.a" "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/x86/release/add-ons/media/plugins/ffmpeg/libavcodec/x86/libavcodec_x86.a" "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/x86/release/add-ons/media/plugins/ffmpeg/libavutil/libavutil.a" "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/x86/release/add-ons/media/plugins/ffmpeg/libswscale/libswscale.a" "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/x86/release/kits/libbe.so" "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/x86/release/kits/media/libmedia.so" "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/x86/release/libs/zlib/libz.a" "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/x86/release/system/libroot/libroot.so" "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2/cross-tools/lib/gcc-lib/i586-pc-haiku/2.95.3-haiku-090629/crtend.o" "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/x86/release/system/glue/arch/x86/crtn.o" \ ...failed Link /storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/x86/release/add-ons/media/plugins/ffmpeg/ffmpeg ... ...skipped haiku.image-copy-files-dummy-system/add-ons/media/plugins for lack of ffmpeg... ...skipped haiku-alpha.vmdk for lack of haiku.image-copy-files... ...failed updating 1 target(s)... ...skipped 2 target(s)... ...updated 261 target(s)... command: jam -q -j1 @alpha-vmware From superstippi at gmx.de Fri Aug 7 22:21:27 2009 From: superstippi at gmx.de (Stephan Assmus) Date: Fri, 07 Aug 2009 22:21:27 +0200 Subject: [Haiku-commits] BOM: r32191 - ...failed Link /objects/haiku/--arch--/release/add-ons/media/plugins/ffmpeg/ffmpeg .. . In-Reply-To: <4a7c7efe.07035a0a.124d.42f3@mx.google.com> References: <4a7c7efe.07035a0a.124d.42f3@mx.google.com> Message-ID: <20090807222127.57948.19@bepc.1249651110.fake> On 2009-08-07 at 21:22:38 [+0200], mattmadia at gmail.com wrote: > Host Machine : FreeBSD 7.2-RELEASE i386 > Host Machine 32|64bit : 32bit > use-xattr : True > use-32bit : False > Architectures Tested : > ppc > x86gcc2 > x86gcc4 > x86gcc2hybrid > x86gcc4hybrid > Targets Affected : > > x86gcc2hybrid- at alpha-cd > x86gcc2hybrid- at alpha-raw > x86gcc2hybrid- at alpha-vmware > x86gcc2- at alpha-cd > x86gcc2- at alpha-raw > x86gcc2- at alpha-vmware > Log Snippet : > > AddSymlinkToContainerCopyFilesScript > system/add-ons/kernel/boot/bfs > AppendToContainerCopyFilesScript > haiku.image-copy-files-dummy-system/add-ons/accelerants > AppendToContainerCopyFilesScript > haiku.image-copy-files-dummy-system/add-ons/opengl > AppendToContainerCopyFilesScript > haiku.image-copy-files-dummy-system/add-ons/Translators > AppendToContainerCopyFilesScript > haiku.image-copy-files-dummy-system/add-ons/mail_daemon/inboun > d_protocols AppendToContainerCopyFilesScript > haiku.image-copy-files-dummy-system/add-ons/mail_daemon/outbou > nd_protocols AppendToContainerCopyFilesScript > haiku.image-copy-files-dummy-system/add-ons/mail_daemon/inboun > d_filters AppendToContainerCopyFilesScript > haiku.image-copy-files-dummy-system/add-ons/mail_daemon/outbou > nd_filters AppendToContainerCopyFilesScript > haiku.image-copy-files-dummy-system/add-ons/mail_daemon/system > _filters AppendToContainerCopyFilesScript > haiku.image-copy-files-dummy-system/add-ons/media Link > /storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/x > 86/release/add-ons/media/plugins/ffmpeg/ffmpeg > /storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/x > 86/release/add-ons/media/plugins/ffmpeg/libavcodec/x86/libavcodec_x86.a(ds > putil_mmx.o): In function `ff_x264_deblock_v_luma_intra_mmxext': > dsputil_mmx.c:(.text+0x1f5a4): undefined reference to > `ff_x264_deblock_v8_luma_intra_mmxext' dsputil_mmx.c:(.text+0x1f5b4): > undefined reference to `ff_x264_deblock_v8_luma_intra_mmxext' collect2: > ld returned 1 exit status > > /storage/Build-o-Matic/haiku/haiku/generated.x86gcc2/cross-tools/bin/i586- > pc-haiku-gcc -pipe -nostart -Xlinker -soname="ffmpeg" -nostdlib -Xlinker > --no-undefined -o > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/ > x86/release/add-ons/media/plugins/ffmpeg/ffmpeg" > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/ > x86/release/system/glue/arch/x86/crti.o" > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2/cross-tools/lib/gcc- > lib/i586-pc-haiku/2.95.3-haiku-090629/crtbegin.o" > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/ > x86/release/system/glue/init_term_dyn.o" > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/ > x86/release/add-ons/media/plugins/ffmpeg/AVCodecDecoder.o" > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/ > x86/release/add-ons/media/plugins/ffmpeg/AVCodecEncoder.o" > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/ > x86/rel > ease/add-ons/media/plugins/ffmpeg/AVFormatReader.o" > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku > /x86/release/add-ons/media/plugins/ffmpeg/AVFormatWriter.o" > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku > /x86/release/add-ons/media/plugins/ffmpeg/CodecTable.o" > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku > /x86/release/add-ons/media/plugins/ffmpeg/DemuxerTable.o" > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku > /x86/release/add-ons/media/plugins/ffmpeg/EncoderTable.o" > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku > /x86/release/add-ons/media/plugins/ffmpeg/FFmpegPlugin.o" > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku > /x86/release/add-ons/media/plugins/ffmpeg/MuxerTable.o" > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku > /x86/release/add-ons/media/plugins/ffmpeg/gfx_conv_c.o" > "/storage/Build-o-Matic/ > haiku/haiku/generated.x86gcc2hybrid/objects/haiku/x86/release/add-ons/med > ia/plugins/ffmpeg/gfx_conv_c_lookup.o" > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku > /x86/release/add-ons/media/plugins/ffmpeg/gfx_util.o" \ > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/ > x86/release/add-ons/media/plugins/ffmpeg/libavformat/libavformat.a" > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/ > x86/release/add-ons/media/plugins/ffmpeg/libavcodec/libavcodec.a" > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/ > x86/release/add-ons/media/plugins/ffmpeg/libavcodec/x86/libavcodec_x86.a" > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/ > x86/release/add-ons/media/plugins/ffmpeg/libavutil/libavutil.a" > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/ > x86/release/add-ons/media/plugins/ffmpeg/libswscale/libswscale.a" > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/ > x86/release/kits/libbe.so" > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/ > x86/release/kits/media/libmedia.so" > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/hai > ku/x86/release/libs/zlib/libz.a" > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku > /x86/release/system/libroot/libroot.so" > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2/cross-tools/lib/gcc > -lib/i586-pc-haiku/2.95.3-haiku-090629/crtend.o" > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku > /x86/release/system/glue/arch/x86/crtn.o" \ > > > ...failed Link > /storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/x > 86/release/add-ons/media/plugins/ffmpeg/ffmpeg ... ...skipped > haiku.image-copy-files-dummy-system/add-ons/media/plugins for > lack of ffmpeg... ...skipped haiku-alpha.vmdk for lack of > haiku.image-copy-files... ...failed updating 1 target(s)... > ...skipped 2 target(s)... > ...updated 261 target(s)... > command: jam -q -j1 @alpha-vmware I cannot reproduce this build problem. I cleaned out the ffmpeg object folder each time and built with --include-gpl-addons and without. Best regards, -Stephan From stpere at gmail.com Fri Aug 7 22:22:50 2009 From: stpere at gmail.com (Philippe Saint-Pierre) Date: Fri, 7 Aug 2009 16:22:50 -0400 Subject: [Haiku-commits] BOM: r32191 - ...failed Link /objects/haiku/--arch--/release/add-ons/media/plugins/ffmpeg/ffmpeg .. . In-Reply-To: <20090807222127.57948.19@bepc.1249651110.fake> References: <4a7c7efe.07035a0a.124d.42f3@mx.google.com> <20090807222127.57948.19@bepc.1249651110.fake> Message-ID: Hi, 2009/8/7 Stephan Assmus > > On 2009-08-07 at 21:22:38 [+0200], mattmadia at gmail.com wrote: > > Host Machine : FreeBSD 7.2-RELEASE i386 > > Host Machine 32|64bit : 32bit > > use-xattr : True > > use-32bit : False > > Architectures Tested : > > ppc > > x86gcc2 > > x86gcc4 > > x86gcc2hybrid > > x86gcc4hybrid > > Targets Affected : > > > > x86gcc2hybrid- at alpha-cd > > x86gcc2hybrid- at alpha-raw > > x86gcc2hybrid- at alpha-vmware > > x86gcc2- at alpha-cd > > x86gcc2- at alpha-raw > > x86gcc2- at alpha-vmware > > Log Snippet : > > > > AddSymlinkToContainerCopyFilesScript > > system/add-ons/kernel/boot/bfs > > AppendToContainerCopyFilesScript > > haiku.image-copy-files-dummy-system/add-ons/accelerants > > AppendToContainerCopyFilesScript > > haiku.image-copy-files-dummy-system/add-ons/opengl > > AppendToContainerCopyFilesScript > > haiku.image-copy-files-dummy-system/add-ons/Translators > > AppendToContainerCopyFilesScript > > > haiku.image-copy-files-dummy-system/add-ons/mail_daemon/inboun > > d_protocols AppendToContainerCopyFilesScript > > > haiku.image-copy-files-dummy-system/add-ons/mail_daemon/outbou > > nd_protocols AppendToContainerCopyFilesScript > > > haiku.image-copy-files-dummy-system/add-ons/mail_daemon/inboun > > d_filters AppendToContainerCopyFilesScript > > > haiku.image-copy-files-dummy-system/add-ons/mail_daemon/outbou > > nd_filters AppendToContainerCopyFilesScript > > > haiku.image-copy-files-dummy-system/add-ons/mail_daemon/system > > _filters AppendToContainerCopyFilesScript > > haiku.image-copy-files-dummy-system/add-ons/media Link > > > /storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/x > > 86/release/add-ons/media/plugins/ffmpeg/ffmpeg > > > /storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/x > > > 86/release/add-ons/media/plugins/ffmpeg/libavcodec/x86/libavcodec_x86.a(ds > > putil_mmx.o): In function `ff_x264_deblock_v_luma_intra_mmxext': > > dsputil_mmx.c:(.text+0x1f5a4): undefined reference to > > `ff_x264_deblock_v8_luma_intra_mmxext' dsputil_mmx.c:(.text+0x1f5b4): > > undefined reference to `ff_x264_deblock_v8_luma_intra_mmxext' collect2: > > ld returned 1 exit status > > > > > /storage/Build-o-Matic/haiku/haiku/generated.x86gcc2/cross-tools/bin/i586- > > pc-haiku-gcc -pipe -nostart -Xlinker -soname="ffmpeg" -nostdlib -Xlinker > > --no-undefined -o > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/ > > x86/release/add-ons/media/plugins/ffmpeg/ffmpeg" > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/ > > x86/release/system/glue/arch/x86/crti.o" > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2/cross-tools/lib/gcc- > > lib/i586-pc-haiku/2.95.3-haiku-090629/crtbegin.o" > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/ > > x86/release/system/glue/init_term_dyn.o" > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/ > > x86/release/add-ons/media/plugins/ffmpeg/AVCodecDecoder.o" > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/ > > x86/release/add-ons/media/plugins/ffmpeg/AVCodecEncoder.o" > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/ > > x86/rel > > ease/add-ons/media/plugins/ffmpeg/AVFormatReader.o" > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku > > /x86/release/add-ons/media/plugins/ffmpeg/AVFormatWriter.o" > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku > > /x86/release/add-ons/media/plugins/ffmpeg/CodecTable.o" > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku > > /x86/release/add-ons/media/plugins/ffmpeg/DemuxerTable.o" > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku > > /x86/release/add-ons/media/plugins/ffmpeg/EncoderTable.o" > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku > > /x86/release/add-ons/media/plugins/ffmpeg/FFmpegPlugin.o" > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku > > /x86/release/add-ons/media/plugins/ffmpeg/MuxerTable.o" > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku > > /x86/release/add-ons/media/plugins/ffmpeg/gfx_conv_c.o" > > "/storage/Build-o-Matic/ > > > haiku/haiku/generated.x86gcc2hybrid/objects/haiku/x86/release/add-ons/med > > ia/plugins/ffmpeg/gfx_conv_c_lookup.o" > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku > > /x86/release/add-ons/media/plugins/ffmpeg/gfx_util.o" \ > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/ > > x86/release/add-ons/media/plugins/ffmpeg/libavformat/libavformat.a" > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/ > > x86/release/add-ons/media/plugins/ffmpeg/libavcodec/libavcodec.a" > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/ > > x86/release/add-ons/media/plugins/ffmpeg/libavcodec/x86/libavcodec_x86.a" > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/ > > x86/release/add-ons/media/plugins/ffmpeg/libavutil/libavutil.a" > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/ > > x86/release/add-ons/media/plugins/ffmpeg/libswscale/libswscale.a" > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/ > > x86/release/kits/libbe.so" > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/ > > x86/release/kits/media/libmedia.so" > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/hai > > ku/x86/release/libs/zlib/libz.a" > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku > > /x86/release/system/libroot/libroot.so" > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2/cross-tools/lib/gcc > > -lib/i586-pc-haiku/2.95.3-haiku-090629/crtend.o" > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku > > /x86/release/system/glue/arch/x86/crtn.o" \ > > > > > > ...failed Link > > > /storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku/x > > 86/release/add-ons/media/plugins/ffmpeg/ffmpeg ... ...skipped > > haiku.image-copy-files-dummy-system/add-ons/media/plugins for > > lack of ffmpeg... ...skipped haiku-alpha.vmdk for lack of > > haiku.image-copy-files... ...failed updating 1 target(s)... > > ...skipped 2 target(s)... > > ...updated 261 target(s)... > > command: jam -q -j1 @alpha-vmware > > I cannot reproduce this build problem. I cleaned out the ffmpeg object > folder each time and built with --include-gpl-addons and without. > > Best regards, > -Stephan It affects (only) gcc2 it seems.. would that be why your configuration isn't affected? Philippe -------------- next part -------------- An HTML attachment was scrubbed... URL: From mattmadia at gmail.com Fri Aug 7 22:27:04 2009 From: mattmadia at gmail.com (Matt Madia) Date: Fri, 7 Aug 2009 20:27:04 +0000 Subject: [Haiku-commits] BOM: r32191 - ...failed Link /objects/haiku/--arch--/release/add-ons/media/plugins/ffmpeg/ffmpeg .. . In-Reply-To: <20090807222127.57948.19@bepc.1249651110.fake> References: <4a7c7efe.07035a0a.124d.42f3@mx.google.com> <20090807222127.57948.19@bepc.1249651110.fake> Message-ID: <1e42d8c50908071327k2d875a89h704007e6a00bc5c6@mail.gmail.com> On Fri, Aug 7, 2009 at 20:21, Stephan Assmus wrote: > I cannot reproduce this build problem. I cleaned out the ffmpeg object > folder each time and built with --include-gpl-addons and without. > I could try clobbering my generated directory. Would it be worthwhile to modify BOM to: report build error delete the objects/ (and/or cross-tools/) directories for affected targets rebuild w/o checking out report whether or not the error persists? From stippi at mail.berlios.de Fri Aug 7 22:27:24 2009 From: stippi at mail.berlios.de (stippi at mail.berlios.de) Date: Fri, 7 Aug 2009 22:27:24 +0200 Subject: [Haiku-commits] r32192 - haiku/trunk/src/apps/aboutsystem Message-ID: <200908072027.n77KROSW015323@sheep.berlios.de> Author: stippi Date: 2009-08-07 22:27:22 +0200 (Fri, 07 Aug 2009) New Revision: 32192 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32192&view=rev Modified: haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp Log: Another update to the credits: * Moved a couple people up from Contributors to Maintainers, since they gained commit acces. * Shock! Matt Madia and Humdinger were missing! * Added Koki back to Website team (after consulting him first). * Added some more well deserved special thanks! As always, please bring anyone I missed to my attention, I don't leave anyone out intentionally! Modified: haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp =================================================================== --- haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp 2009-08-07 17:19:32 UTC (rev 32191) +++ haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp 2009-08-07 20:27:22 UTC (rev 32192) @@ -713,6 +713,7 @@ "Axel D?rfler\n" "J?r?me Duval\n" "Ren? Gollent\n" + "Bryce Groff\n" "Karsten Heimrich\n" "Philippe Houdoin\n" "Maurice Kalinowski\n" @@ -724,10 +725,14 @@ "Marcus Overhagen\n" "Michael Pfeiffer\n" "Fran?ois Revol\n" + "Philippe Saint-Pierre\n" "Andrej Spielmann\n" + "Jonas Sundstr?m\n" "Oliver Tappe\n" "Gerasim Troeglazov\n" "Ingo Weinhold\n" + "Artur Wyszynski\n" + "Clemens Zeidler\n" "Siarzhuk Zharski\n" "\n"); @@ -751,7 +756,6 @@ "David Reid\n" "Hugo Santos\n" "Alexander G. M. Smith\n" - "Jonas Sundstr?m\n" "Bryan Varner\n" "Nathan Whitehorn\n" "Michael Wilber\n" @@ -766,8 +770,11 @@ fCreditsView->Insert( "Phil Greenway\n" "Gavin James\n" + "Matt Madia\n" + "Jorge G. Mare (aka Koki)\n" "Urias McCullough\n" "Niels Sascha Reedijk\n" + "Joachim Seemer (Humdinger)\n" "Jonathan Yoder\n" "\n"); @@ -788,7 +795,6 @@ "Andreas F?rber\n" "Marc Flerackers\n" "Michele Frau (zuMi)\n" - "Bryce Groff\n" "Matthijs Hollemans\n" "Mathew Hounsell\n" "Morgan Howe\n" @@ -809,6 +815,7 @@ "Jerome Leveque\n" "Christof Lutteroth\n" "Graham MacDonald\n" + "Brecht Machiels\n" "Jan Mat?jek\n" "Brian Matzon\n" "Christopher ML Zumwalt May\n" @@ -832,7 +839,6 @@ "Samuel Rodriguez Perez\n" "Thomas Roell\n" "Rafael Romo\n" - "Philippe Saint-Pierre\n" "Ralf Sch?lke\n" "Reznikov Sergei\n" "Zousar Shaker\n" @@ -845,9 +851,7 @@ "Ulrich Wimboeck\n" "Johannes Wischert\n" "James Woodcock\n" - "Artur Wyszynski\n" "Gerald Zajac\n" - "Clemens Zeidler\n" "?ukasz Zemczak\n" "JiSheng Zhang\n" "Zhao Shuai\n" @@ -861,6 +865,11 @@ fCreditsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &kDarkGrey); fCreditsView->Insert("Travis Geiselbrecht (and his NewOS kernel)\n"); fCreditsView->Insert("Michael Phipps (project founder)\n\n"); + fCreditsView->Insert("The Haiku-Ports Team\n"); + fCreditsView->Insert("The Haikuware Team and their Bounty Program\n"); + fCreditsView->Insert("The BeGeistert Team\n\n"); + fCreditsView->Insert("... and the many community members making " + "donations!\n\n"); // copyrights for various projects we use From superstippi at gmx.de Fri Aug 7 23:33:27 2009 From: superstippi at gmx.de (Stephan Assmus) Date: Fri, 07 Aug 2009 23:33:27 +0200 Subject: [Haiku-commits] BOM: r32191 - ...failed Link /objects/haiku/--arch--/release/add-ons/media/plugins/ffmpeg/ffmpeg .. . In-Reply-To: References: <4a7c7efe.07035a0a.124d.42f3@mx.google.com> <20090807222127.57948.19@bepc.1249651110.fake> Message-ID: <20090807233327.58543.21@bepc.1249651110.fake> On 2009-08-07 at 22:22:50 [+0200], Philippe Saint-Pierre wrote: > Hi, > > 2009/8/7 Stephan Assmus > > > > > On 2009-08-07 at 21:22:38 [+0200], mattmadia at gmail.com wrote: > > > Host Machine : FreeBSD 7.2-RELEASE i386 > > > Host Machine 32|64bit : 32bit > > > use-xattr : True > > > use-32bit : False > > > Architectures Tested : > > > ppc > > > x86gcc2 > > > x86gcc4 > > > x86gcc2hybrid > > > x86gcc4hybrid > > > Targets Affected : > > > > > > x86gcc2hybrid- at alpha-cd > > > x86gcc2hybrid- at alpha-raw > > > x86gcc2hybrid- at alpha-vmware > > > x86gcc2- at alpha-cd > > > x86gcc2- at alpha-raw > > > x86gcc2- at alpha-vmware > > > Log Snippet : > > > > > > AddSymlinkToContainerCopyFilesScript > > > system/add-ons/kernel/boot/bfs > > > AppendToContainerCopyFilesScript > > > haiku.image-copy-files-dummy-system/add-ons/accelerants > > > AppendToContainerCopyFilesScript > > > haiku.image-copy-files-dummy-system/add-ons/opengl > > > AppendToContainerCopyFilesScript > > > haiku.image-copy-files-dummy-system/add-ons/Translators > > > AppendToContainerCopyFilesScript > > > > > haiku.image-copy-files-dummy-system/add-ons/mail_daemon/inbo > > un > > > d_protocols AppendToContainerCopyFilesScript > > > > > haiku.image-copy-files-dummy-system/add-ons/mail_daemon/outb > > ou > > > nd_protocols AppendToContainerCopyFilesScript > > > > > haiku.image-copy-files-dummy-system/add-ons/mail_daemon/inbo > > un > > > d_filters AppendToContainerCopyFilesScript > > > > > haiku.image-copy-files-dummy-system/add-ons/mail_daemon/outb > > ou > > > nd_filters AppendToContainerCopyFilesScript > > > > > haiku.image-copy-files-dummy-system/add-ons/mail_daemon/syst > > em > > > _filters AppendToContainerCopyFilesScript > > > haiku.image-copy-files-dummy-system/add-ons/media Link > > > > > /storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku > > /x > > > 86/release/add-ons/media/plugins/ffmpeg/ffmpeg > > > > > /storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku > > /x > > > > > 86/release/add-ons/media/plugins/ffmpeg/libavcodec/x86/libavcodec_x86.a( > > ds > > > putil_mmx.o): In function `ff_x264_deblock_v_luma_intra_mmxext': > > > dsputil_mmx.c:(.text+0x1f5a4): undefined reference to > > > `ff_x264_deblock_v8_luma_intra_mmxext' dsputil_mmx.c:(.text+0x1f5b4): > > > undefined reference to `ff_x264_deblock_v8_luma_intra_mmxext' > > > collect2: ld returned 1 exit status > > > > > > > > /storage/Build-o-Matic/haiku/haiku/generated.x86gcc2/cross-tools/bin/i58 > > 6- > > > pc-haiku-gcc -pipe -nostart -Xlinker -soname="ffmpeg" -nostdlib > > > -Xlinker > > > --no-undefined -o > > > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haik > > u/ > > > x86/release/add-ons/media/plugins/ffmpeg/ffmpeg" > > > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haik > > u/ > > > x86/release/system/glue/arch/x86/crti.o" > > > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2/cross-tools/lib/gc > > c- > > > lib/i586-pc-haiku/2.95.3-haiku-090629/crtbegin.o" > > > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haik > > u/ > > > x86/release/system/glue/init_term_dyn.o" > > > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haik > > u/ > > > x86/release/add-ons/media/plugins/ffmpeg/AVCodecDecoder.o" > > > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haik > > u/ > > > x86/release/add-ons/media/plugins/ffmpeg/AVCodecEncoder.o" > > > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haik > > u/ > > > x86/rel > > > ease/add-ons/media/plugins/ffmpeg/AVFormatReader.o" > > > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/hai > > ku > > > /x86/release/add-ons/media/plugins/ffmpeg/AVFormatWriter.o" > > > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/hai > > ku > > > /x86/release/add-ons/media/plugins/ffmpeg/CodecTable.o" > > > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/hai > > ku > > > /x86/release/add-ons/media/plugins/ffmpeg/DemuxerTable.o" > > > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/hai > > ku > > > /x86/release/add-ons/media/plugins/ffmpeg/EncoderTable.o" > > > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/hai > > ku > > > /x86/release/add-ons/media/plugins/ffmpeg/FFmpegPlugin.o" > > > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/hai > > ku > > > /x86/release/add-ons/media/plugins/ffmpeg/MuxerTable.o" > > > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/hai > > ku > > > /x86/release/add-ons/media/plugins/ffmpeg/gfx_conv_c.o" > > > "/storage/Build-o-Matic/ > > > > > haiku/haiku/generated.x86gcc2hybrid/objects/haiku/x86/release/add-ons/m > > ed > > > ia/plugins/ffmpeg/gfx_conv_c_lookup.o" > > > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/hai > > ku > > > /x86/release/add-ons/media/plugins/ffmpeg/gfx_util.o" \ > > > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haik > > u/ > > > x86/release/add-ons/media/plugins/ffmpeg/libavformat/libavformat.a" > > > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haik > > u/ > > > x86/release/add-ons/media/plugins/ffmpeg/libavcodec/libavcodec.a" > > > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haik > > u/ > > > x86/release/add-ons/media/plugins/ffmpeg/libavcodec/x86/libavcodec_x86 > > > .a" > > > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haik > > u/ > > > x86/release/add-ons/media/plugins/ffmpeg/libavutil/libavutil.a" > > > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haik > > u/ > > > x86/release/add-ons/media/plugins/ffmpeg/libswscale/libswscale.a" > > > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haik > > u/ > > > x86/release/kits/libbe.so" > > > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haik > > u/ > > > x86/release/kits/media/libmedia.so" > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/ha > > > i > > > ku/x86/release/libs/zlib/libz.a" > > > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/hai > > ku > > > /x86/release/system/libroot/libroot.so" > > > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2/cross-tools/lib/g > > cc > > > -lib/i586-pc-haiku/2.95.3-haiku-090629/crtend.o" > > > > > "/storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/hai > > ku > > > /x86/release/system/glue/arch/x86/crtn.o" \ > > > > > > > > > ...failed Link > > > > > /storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku > > /x > > > 86/release/add-ons/media/plugins/ffmpeg/ffmpeg ... ...skipped > > > haiku.image-copy-files-dummy-system/add-ons/media/plugins > > > for lack of ffmpeg... ...skipped haiku-alpha.vmdk for lack of > > > haiku.image-copy-files... ...failed updating 1 > > > target(s)... ...skipped 2 target(s)... > > > ...updated 261 target(s)... > > > command: jam -q -j1 @alpha-vmware > > > > I cannot reproduce this build problem. I cleaned out the ffmpeg object > > folder each time and built with --include-gpl-addons and without. > > > > Best regards, > > -Stephan > > > It affects (only) gcc2 it seems.. would that be why your configuration > isn't affected? It could be the reason... let me check. Maybe GCC2 chokes on some ASM that is now enabled, if you have --include-gpl-addons configured. If the build servers have --include-gpl-addons enabled, is it intentional? Best regards, -Stephan From korli at users.berlios.de Fri Aug 7 23:32:07 2009 From: korli at users.berlios.de (=?ISO-8859-1?B?Suly9G1lIER1dmFs?=) Date: Fri, 7 Aug 2009 23:32:07 +0200 Subject: [Haiku-commits] r32169 - haiku/trunk/src/preferences/bluetooth In-Reply-To: <200908061828.n76ISd7a014916@sheep.berlios.de> References: <200908061828.n76ISd7a014916@sheep.berlios.de> Message-ID: 2009/8/6 oruizdorantes at BerliOS : > -static const int32 kMsgSetDeviceClassNetbook = 'sDCn'; > +static const int32 kMsgSetDeviceClassHandheld = 'sDCn'; Not very important, but maybe you should consider using sDCh then.. Bye, Jerome From stippi at mail.berlios.de Fri Aug 7 23:55:17 2009 From: stippi at mail.berlios.de (stippi at mail.berlios.de) Date: Fri, 7 Aug 2009 23:55:17 +0200 Subject: [Haiku-commits] r32193 - haiku/trunk/src/add-ons/media/plugins/ffmpeg/libavcodec/x86 Message-ID: <200908072155.n77LtHFP025782@sheep.berlios.de> Author: stippi Date: 2009-08-07 23:55:15 +0200 (Fri, 07 Aug 2009) New Revision: 32193 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32193&view=rev Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/libavcodec/x86/dsputil_mmx.c Log: Fixed error in FFmpeg code that defined a function which is only enabled in GPL mode. Later in the code, the function would only be used in GPL compile mode, but this fixes the linking in non-GPL mode. Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/libavcodec/x86/dsputil_mmx.c =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/libavcodec/x86/dsputil_mmx.c 2009-08-07 20:27:22 UTC (rev 32192) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/libavcodec/x86/dsputil_mmx.c 2009-08-07 21:55:15 UTC (rev 32193) @@ -2372,7 +2372,7 @@ void ff_x264_deblock_h_luma_sse2(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0); void ff_x264_deblock_v8_luma_intra_mmxext(uint8_t *pix, int stride, int alpha, int beta); void ff_x264_deblock_h_luma_intra_mmxext(uint8_t *pix, int stride, int alpha, int beta); -#if ARCH_X86_32 +#if CONFIG_GPL && ARCH_X86_32 static void ff_x264_deblock_v_luma_intra_mmxext(uint8_t *pix, int stride, int alpha, int beta) { ff_x264_deblock_v8_luma_intra_mmxext(pix+0, stride, alpha, beta); From superstippi at gmx.de Fri Aug 7 23:56:24 2009 From: superstippi at gmx.de (Stephan Assmus) Date: Fri, 07 Aug 2009 23:56:24 +0200 Subject: [Haiku-commits] BOM: r32191 - ...failed Link /objects/haiku/--arch--/release/add-ons/media/plugins/ffmpeg/ffmpeg .. . In-Reply-To: References: <4a7c7efe.07035a0a.124d.42f3@mx.google.com> <20090807222127.57948.19@bepc.1249651110.fake> Message-ID: <20090807235624.69763.22@bepc.1249651110.fake> Hi, On 2009-08-07 at 22:22:50 [+0200], Philippe Saint-Pierre wrote: > 2009/8/7 Stephan Assmus > > On 2009-08-07 at 21:22:38 [+0200], mattmadia at gmail.com wrote: > > > ...failed Link > > > > > /storage/Build-o-Matic/haiku/haiku/generated.x86gcc2hybrid/objects/haiku > > /x > > > 86/release/add-ons/media/plugins/ffmpeg/ffmpeg ... ...skipped > > > haiku.image-copy-files-dummy-system/add-ons/media/plugins > > > for lack of ffmpeg... ...skipped haiku-alpha.vmdk for lack of > > > haiku.image-copy-files... ...failed updating 1 > > > target(s)... ...skipped 2 target(s)... > > > ...updated 261 target(s)... > > > command: jam -q -j1 @alpha-vmware > > > > I cannot reproduce this build problem. I cleaned out the ffmpeg object > > folder each time and built with --include-gpl-addons and without. > > It affects (only) gcc2 it seems.. would that be why your configuration > isn't affected? Should be fixed now. Best regards, -Stephan From kirilla at mail.berlios.de Sat Aug 8 01:23:52 2009 From: kirilla at mail.berlios.de (kirilla at BerliOS) Date: Sat, 8 Aug 2009 01:23:52 +0200 Subject: [Haiku-commits] r32194 - haiku/trunk/src/add-ons/kernel/file_systems/cdda Message-ID: <200908072323.n77NNp3j028368@sheep.berlios.de> Author: kirilla Date: 2009-08-08 01:23:45 +0200 (Sat, 08 Aug 2009) New Revision: 32194 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32194&view=rev Modified: haiku/trunk/src/add-ons/kernel/file_systems/cdda/cdda.cpp Log: As cdtext extraction preempts a cddb lookup, make sure we got useful data from cdtext. Out of the 30 CDs I've tried all get reported as having cdtext but only one renders any useful data. This should at least give cddb a shot. Modified: haiku/trunk/src/add-ons/kernel/file_systems/cdda/cdda.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/cdda/cdda.cpp 2009-08-07 21:55:15 UTC (rev 32193) +++ haiku/trunk/src/add-ons/kernel/file_systems/cdda/cdda.cpp 2009-08-07 23:23:45 UTC (rev 32194) @@ -562,6 +562,14 @@ free(buffer); + if (cdtext.artist == NULL || cdtext.album == NULL) + return B_ERROR; + + for (int i = 0; i < cdtext.track_count; i++) { + if (cdtext.titles[i] == NULL) + return B_ERROR; + } + sanitize_string(cdtext.artist); sanitize_album(cdtext); sanitize_titles(cdtext); From pulkomandy at mail.berlios.de Sat Aug 8 01:31:36 2009 From: pulkomandy at mail.berlios.de (pulkomandy at BerliOS) Date: Sat, 8 Aug 2009 01:31:36 +0200 Subject: [Haiku-commits] r32195 - haiku/branches/components/gsoc-locale-kit/src/preferences/locale Message-ID: <200908072331.n77NVadR013869@sheep.berlios.de> Author: pulkomandy Date: 2009-08-08 01:31:31 +0200 (Sat, 08 Aug 2009) New Revision: 32195 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32195&view=rev Modified: haiku/branches/components/gsoc-locale-kit/src/preferences/locale/TimeFormatSettingsView.cpp haiku/branches/components/gsoc-locale-kit/src/preferences/locale/TimeFormatSettingsView.h Log: More work on the Country custom settings in the preference panel. The popup menus will be used to select defined fields, while there will be textfields between them to add dcustom strings (but most probably some special chars). The short date will still allow only one separator. The popup menus will display real things instead of the placeholder letters but I have to write some more ICU communication layer for that. There will be a description and a sample at each entry. Modified: haiku/branches/components/gsoc-locale-kit/src/preferences/locale/TimeFormatSettingsView.cpp =================================================================== --- haiku/branches/components/gsoc-locale-kit/src/preferences/locale/TimeFormatSettingsView.cpp 2009-08-07 23:23:45 UTC (rev 32194) +++ haiku/branches/components/gsoc-locale-kit/src/preferences/locale/TimeFormatSettingsView.cpp 2009-08-07 23:31:31 UTC (rev 32195) @@ -6,6 +6,7 @@ #include "TimeFormatSettingsView.h" +#include #include #include #include @@ -26,6 +27,34 @@ #include +void CreateDateMenu(BMenuField** field) +{ + BMenu *menu = new BMenu(""); + *field = new BMenuField("", menu); + BMessage* msg = new BMessage('FRMT'); + msg->AddPointer("dest",*field); + + BMenu* dayMenu = new BMenu("Day"); + menu->AddItem(dayMenu); + dayMenu -> AddItem(new BMenuItem("d", msg)); + dayMenu -> AddItem(new BMenuItem("D", msg)); + dayMenu -> AddItem(new BMenuItem("e", msg)); + dayMenu -> AddItem(new BMenuItem("E", msg)); + dayMenu -> AddItem(new BMenuItem("F", msg)); + dayMenu -> AddItem(new BMenuItem("g", msg)); + dayMenu -> AddItem(new BMenuItem("c", msg)); + BMenu* monthMenu = new BMenu("Month"); + menu->AddItem(monthMenu); + monthMenu -> AddItem(new BMenuItem("M", msg)); + monthMenu -> AddItem(new BMenuItem("L", msg)); + BMenu* yearMenu = new BMenu("Year"); + menu->AddItem(yearMenu); + yearMenu -> AddItem(new BMenuItem("y", msg)); + yearMenu -> AddItem(new BMenuItem("Y", msg)); + yearMenu -> AddItem(new BMenuItem("u", msg)); +} + + TimeFormatSettingsView::TimeFormatSettingsView(BCountry* country) : BView("WindowsSettingsView", B_WILL_DRAW) , fCountry(country) @@ -35,28 +64,45 @@ // Date BSeparatorView* dateHeader = new BSeparatorView("Date"); - BBox *dateFormatBox = new BBox("Date Order"); - dateFormatBox->SetLabel("Date Order"); - dateFormatBox->SetLayout(new BGroupLayout(B_HORIZONTAL, 10)); + // Long format + fLongDateExampleView = new BStringView("", ""); - { - fYMDRadioButton = new BRadioButton("", "Year-Month-Day", - new BMessage(kSettingsContentsModified)); + CreateDateMenu(&fLongDateMenu[0]); + CreateDateMenu(&fLongDateMenu[1]); + CreateDateMenu(&fLongDateMenu[2]); + CreateDateMenu(&fLongDateMenu[3]); - fDMYRadioButton = new BRadioButton("", "Day-Month-Year", - new BMessage(kSettingsContentsModified)); + // Short format + fShortDateExampleView = new BStringView("", ""); - fMDYRadioButton = new BRadioButton("", "Month-Day-Year", - new BMessage(kSettingsContentsModified)); + BMenu* menu = new BPopUpMenu(""); + menu->AddItem(new BMenuItem("Day", + new BMessage(kSettingsContentsModified))); + menu->AddItem(new BMenuItem("Month", + new BMessage(kSettingsContentsModified))); + menu->AddItem(new BMenuItem("Year", + new BMessage(kSettingsContentsModified))); + fDateMenu[0] = new BMenuField("", menu); - dateFormatBox->AddChild(BGroupLayoutBuilder(B_VERTICAL,10) - .Add(fYMDRadioButton) - .Add(fDMYRadioButton) - .Add(fMDYRadioButton) - ); - } + menu = new BPopUpMenu(""); + menu->AddItem(new BMenuItem("Day", + new BMessage(kSettingsContentsModified))); + menu->AddItem(new BMenuItem("Month", + new BMessage(kSettingsContentsModified))); + menu->AddItem(new BMenuItem("Year", + new BMessage(kSettingsContentsModified))); + fDateMenu[1] = new BMenuField("", menu); - BPopUpMenu *menu = new BPopUpMenu("Separator"); + menu = new BPopUpMenu(""); + menu->AddItem(new BMenuItem("Day", + new BMessage(kSettingsContentsModified))); + menu->AddItem(new BMenuItem("Month", + new BMessage(kSettingsContentsModified))); + menu->AddItem(new BMenuItem("Year", + new BMessage(kSettingsContentsModified))); + fDateMenu[2] = new BMenuField("", menu); + + menu = new BPopUpMenu("Separator"); menu->AddItem(new BMenuItem("None", new BMessage(kSettingsContentsModified))); menu->AddItem(new BMenuItem("Space", @@ -71,9 +117,6 @@ fSeparatorMenuField->StringWidth(fSeparatorMenuField->Label()) + 8.0f); fSeparatorMenuField->SetAlignment(B_ALIGN_LEFT); - fLongDateExampleView = new BStringView("", ""); - fShortDateExampleView = new BStringView("", ""); - // Time BSeparatorView* timeHeader = new BSeparatorView("Time"); @@ -104,9 +147,27 @@ AddChild(BGroupLayoutBuilder(B_VERTICAL, 10) .Add(dateHeader) - .Add(fLongDateExampleView) - .Add(fShortDateExampleView) - .Add(dateFormatBox) + .Add(BGroupLayoutBuilder(B_HORIZONTAL, 10) + .Add(new BStringView("","Long format:")) + .Add(fLongDateExampleView) + .AddGlue() + ) + .Add(BGroupLayoutBuilder(B_HORIZONTAL, 10) + .Add(fLongDateMenu[0]) + .Add(fLongDateMenu[1]) + .Add(fLongDateMenu[2]) + .Add(fLongDateMenu[3]) + ) + .Add(BGroupLayoutBuilder(B_HORIZONTAL, 10) + .Add(new BStringView("","Short format:")) + .Add(fShortDateExampleView) + .AddGlue() + ) + .Add(BGroupLayoutBuilder(B_HORIZONTAL, 10) + .Add(fDateMenu[0]) + .Add(fDateMenu[1]) + .Add(fDateMenu[2]) + ) .Add(fSeparatorMenuField) .Add(timeHeader) @@ -124,10 +185,11 @@ { f24HrRadioButton->SetTarget(this); f12HrRadioButton->SetTarget(this); - fYMDRadioButton->SetTarget(this); - fDMYRadioButton->SetTarget(this); - fMDYRadioButton->SetTarget(this); + // TODO do the same for the short date + for(int j = 0; j < 4; j++) + for(int i = 0; i < fLongDateMenu[3]->Menu()->CountItems(); i++) + fLongDateMenu[j]->Menu()->SubmenuAt(i)->SetTargetForItems(this); fSeparatorMenuField->Menu()->SetTargetForItems(this); static_cast(Parent())->ScrollBar(B_VERTICAL)->SetRange( @@ -141,6 +203,20 @@ TimeFormatSettingsView::MessageReceived(BMessage *message) { switch (message->what) { + case 'FRMT': + { + // Update one of the dropdown menus + void* pointerFromMessage; + message->FindPointer("source",&pointerFromMessage); + BMenuItem* selectedItem = + static_cast(pointerFromMessage); + message->FindPointer("dest",&pointerFromMessage); + BMenuField* menuField = + static_cast(pointerFromMessage); + + menuField->MenuItem()->SetLabel(selectedItem->Label()); + } + // pass trough case kSettingsContentsModified: { int32 separator = 0; @@ -152,17 +228,17 @@ ; } - DateOrder format = - fYMDRadioButton->Value() ? kYMDFormat : - fDMYRadioButton->Value() ? kDMYFormat : kMDYFormat; + // TODO add the other fields and generate the ICU string + BString dateFormat; + // TODO send that to our Settings class // settings.SetDateOrderFormat(format); // settings.SetClockTo24Hr(f24HrRadioButton->Value() == 1); // Make the notification message and send it to the tracker: BMessage notificationMessage; notificationMessage.AddInt32("TimeFormatSeparator", separator); - notificationMessage.AddInt32("DateOrderFormat", format); + notificationMessage.AddString("DateOrderFormat", dateFormat); notificationMessage.AddBool("24HrClock", f24HrRadioButton->Value() == 1); // tracker->SendNotices(kDateFormatChanged, ¬ificationMessage); @@ -286,6 +362,8 @@ } +// Return true if the Revert button should be enabled (ie some setting was +// changed) bool TimeFormatSettingsView::IsRevertable() const { @@ -301,13 +379,14 @@ } else return true; - DateOrder format = - fYMDRadioButton->Value() ? kYMDFormat : - (fDMYRadioButton->Value() ? kDMYFormat : kMDYFormat); + // TODO generate ICU string and compare to the initial one + BString dateFormat ; + //fYMDRadioButton->Value() ? kYMDFormat : + //(fDMYRadioButton->Value() ? kDMYFormat : kMDYFormat); return f24HrClock != (f24HrRadioButton->Value() > 0) || separator != fSeparator - || format != fFormat; + || dateFormat != fDateFormat; } Modified: haiku/branches/components/gsoc-locale-kit/src/preferences/locale/TimeFormatSettingsView.h =================================================================== --- haiku/branches/components/gsoc-locale-kit/src/preferences/locale/TimeFormatSettingsView.h 2009-08-07 23:23:45 UTC (rev 32194) +++ haiku/branches/components/gsoc-locale-kit/src/preferences/locale/TimeFormatSettingsView.h 2009-08-07 23:31:31 UTC (rev 32195) @@ -8,6 +8,7 @@ #define __TIMEFORMATSETTINGS_H__ +#include #include @@ -27,13 +28,6 @@ kDotSeparator, kSeparatorsEnd }; - -enum DateOrder { - kYMDFormat, - kDMYFormat, - kMDYFormat, - kDateFormatEnd -}; const uint32 kSettingsContentsModified = 'Scmo'; @@ -59,9 +53,8 @@ BRadioButton *f24HrRadioButton; BRadioButton *f12HrRadioButton; - BRadioButton *fYMDRadioButton; - BRadioButton *fDMYRadioButton; - BRadioButton *fMDYRadioButton; + BMenuField *fLongDateMenu[4]; + BMenuField *fDateMenu[3]; BMenuField *fSeparatorMenuField; @@ -73,7 +66,7 @@ bool f24HrClock; FormatSeparator fSeparator; - DateOrder fFormat; + BString fDateFormat; BCountry* fCountry; From mmu_man at mail.berlios.de Sat Aug 8 02:19:01 2009 From: mmu_man at mail.berlios.de (mmu_man at mail.berlios.de) Date: Sat, 8 Aug 2009 02:19:01 +0200 Subject: [Haiku-commits] r32196 - haiku/trunk/src/system/libroot/posix/stdlib Message-ID: <200908080019.n780J1U6025692@sheep.berlios.de> Author: mmu_man Date: 2009-08-08 02:18:59 +0200 (Sat, 08 Aug 2009) New Revision: 32196 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32196&view=rev Modified: haiku/trunk/src/system/libroot/posix/stdlib/strtod.c Log: Seems r31815 got MIA due to r31919+r31925... Modified: haiku/trunk/src/system/libroot/posix/stdlib/strtod.c =================================================================== --- haiku/trunk/src/system/libroot/posix/stdlib/strtod.c 2009-08-07 23:31:31 UTC (rev 32195) +++ haiku/trunk/src/system/libroot/posix/stdlib/strtod.c 2009-08-08 00:18:59 UTC (rev 32196) @@ -125,7 +125,7 @@ #if defined(__i386__) || defined(__ia64__) || defined(__alpha__) || \ defined(__sparc64__) || defined(__powerpc__) || defined(__POWERPC__) || \ - defined(__m68k__) || defined(__M68K__) + defined(__m68k__) || defined(__M68K__) || defined(__arm__) || defined(__ARM__) # include # if BYTE_ORDER == BIG_ENDIAN # define IEEE_BIG_ENDIAN From mmu_man at mail.berlios.de Sat Aug 8 02:35:51 2009 From: mmu_man at mail.berlios.de (mmu_man at mail.berlios.de) Date: Sat, 8 Aug 2009 02:35:51 +0200 Subject: [Haiku-commits] r32197 - in haiku/trunk/headers/private: kernel/arch/arm kernel/arch/arm/board kernel/arch/arm/board/overo kernel/arch/arm/board/verdex system/arch/arm Message-ID: <200908080035.n780ZpU7027704@sheep.berlios.de> Author: mmu_man Date: 2009-08-08 02:35:48 +0200 (Sat, 08 Aug 2009) New Revision: 32197 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32197&view=rev Added: haiku/trunk/headers/private/kernel/arch/arm/board/ haiku/trunk/headers/private/kernel/arch/arm/board/overo/board_config.h haiku/trunk/headers/private/kernel/arch/arm/board/verdex/board_config.h Removed: haiku/trunk/headers/private/system/arch/arm/board/ Log: [ARM] - moved board/ folder around again, it probably belongs only to kernel stuff, - added board_config.h templates for gumstix boards. Copied: haiku/trunk/headers/private/kernel/arch/arm/board (from rev 32191, haiku/trunk/headers/private/system/arch/arm/board) Property changes on: haiku/trunk/headers/private/kernel/arch/arm/board ___________________________________________________________________ Name: svn:mergeinfo + Added: haiku/trunk/headers/private/kernel/arch/arm/board/overo/board_config.h =================================================================== --- haiku/trunk/headers/private/system/arch/arm/board/overo/board_config.h 2009-08-07 17:19:32 UTC (rev 32191) +++ haiku/trunk/headers/private/kernel/arch/arm/board/overo/board_config.h 2009-08-08 00:35:48 UTC (rev 32197) @@ -0,0 +1,12 @@ +/* + * Copyright 2009 + * Distributed under the terms of the MIT License. + */ +#ifndef _BOARD_OVERO_BOARD_CONFIG_H +#define _BOARD_OVERO_BOARD_CONFIG_H + +#define BOARD_NAME_PRETTY "Gumstix Overo" + +#include + +#endif /* _BOARD_OVERO_BOARD_CONFIG_H */ Added: haiku/trunk/headers/private/kernel/arch/arm/board/verdex/board_config.h =================================================================== --- haiku/trunk/headers/private/system/arch/arm/board/verdex/board_config.h 2009-08-07 17:19:32 UTC (rev 32191) +++ haiku/trunk/headers/private/kernel/arch/arm/board/verdex/board_config.h 2009-08-08 00:35:48 UTC (rev 32197) @@ -0,0 +1,12 @@ +/* + * Copyright 2009 + * Distributed under the terms of the MIT License. + */ +#ifndef _BOARD_VERDEX_BOARD_CONFIG_H +#define _BOARD_VERDEX_BOARD_CONFIG_H + +#define BOARD_NAME_PRETTY "Gumstix Verdex" + +#include + +#endif /* _BOARD_VERDEX_BOARD_CONFIG_H */ From mmu_man at mail.berlios.de Sat Aug 8 03:05:51 2009 From: mmu_man at mail.berlios.de (mmu_man at mail.berlios.de) Date: Sat, 8 Aug 2009 03:05:51 +0200 Subject: [Haiku-commits] r32198 - in haiku/trunk/headers/private/kernel/arch/arm/board: overo verdex Message-ID: <200908080105.n7815pet031985@sheep.berlios.de> Author: mmu_man Date: 2009-08-08 03:05:49 +0200 (Sat, 08 Aug 2009) New Revision: 32198 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32198&view=rev Modified: haiku/trunk/headers/private/kernel/arch/arm/board/overo/board_config.h haiku/trunk/headers/private/kernel/arch/arm/board/verdex/board_config.h Log: [ARM] Map UARTs to the cpu specific addresses. Modified: haiku/trunk/headers/private/kernel/arch/arm/board/overo/board_config.h =================================================================== --- haiku/trunk/headers/private/kernel/arch/arm/board/overo/board_config.h 2009-08-08 00:35:48 UTC (rev 32197) +++ haiku/trunk/headers/private/kernel/arch/arm/board/overo/board_config.h 2009-08-08 01:05:49 UTC (rev 32198) @@ -9,4 +9,10 @@ #include +#define BOARD_UART1_BASE OMAP_UART1_BASE +#define BOARD_UART2_BASE OMAP_UART2_BASE +#define BOARD_UART3_BASE OMAP_UART3_BASE + +#define BOARD_DEBUG_UART 2 + #endif /* _BOARD_OVERO_BOARD_CONFIG_H */ Modified: haiku/trunk/headers/private/kernel/arch/arm/board/verdex/board_config.h =================================================================== --- haiku/trunk/headers/private/kernel/arch/arm/board/verdex/board_config.h 2009-08-08 00:35:48 UTC (rev 32197) +++ haiku/trunk/headers/private/kernel/arch/arm/board/verdex/board_config.h 2009-08-08 01:05:49 UTC (rev 32198) @@ -9,4 +9,10 @@ #include +#define BOARD_UART1_BASE FFUART_BASE +#define BOARD_UART2_BASE BTUART_BASE +#define BOARD_UART3_BASE STUART_BASE + +#define BOARD_DEBUG_UART 2 + #endif /* _BOARD_VERDEX_BOARD_CONFIG_H */ From mmu_man at mail.berlios.de Sat Aug 8 04:02:05 2009 From: mmu_man at mail.berlios.de (mmu_man at mail.berlios.de) Date: Sat, 8 Aug 2009 04:02:05 +0200 Subject: [Haiku-commits] r32199 - haiku/trunk/src/system/boot/platform/u-boot Message-ID: <200908080202.n782259r003258@sheep.berlios.de> Author: mmu_man Date: 2009-08-08 04:01:59 +0200 (Sat, 08 Aug 2009) New Revision: 32199 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32199&view=rev Modified: haiku/trunk/src/system/boot/platform/u-boot/Jamfile Log: [ARM] - add board specific headers to includes, - some unused flash image targets. Modified: haiku/trunk/src/system/boot/platform/u-boot/Jamfile =================================================================== --- haiku/trunk/src/system/boot/platform/u-boot/Jamfile 2009-08-08 01:05:49 UTC (rev 32198) +++ haiku/trunk/src/system/boot/platform/u-boot/Jamfile 2009-08-08 02:01:59 UTC (rev 32199) @@ -2,6 +2,8 @@ SubDirHdrs $(HAIKU_TOP) headers private kernel boot platform $(TARGET_BOOT_PLATFORM) ; +#XXX:move to arch/arm +UsePrivateHeaders [ FDirName kernel arch $(TARGET_ARCH) board $(TARGET_BOOT_BOARD) ] ; UsePrivateHeaders [ FDirName kernel disk_device_manager ] ; UsePrivateHeaders [ FDirName graphics common ] ; UsePrivateHeaders [ FDirName graphics vesa ] ; @@ -12,7 +14,7 @@ defines = [ FDefines $(defines) ] ; SubDirCcFlags $(defines) -Wall -Wno-multichar -g3 ; - SubDirC++Flags $(defines) -Wall -Wno-multichar -fno-rtti ; + SubDirC++Flags $(defines) -Wall -Wno-multichar -fno-rtti -g3 ; } SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src add-ons accelerants common ] ; @@ -59,11 +61,15 @@ dd if=/dev/zero of=$(<) bs=$(FLASH_IMAGE_BLOCK_SIZE) count=$(FLASH_IMAGE_BLOCK_COUNT) # add u-boot dd if=$(>[2]) of=$(<) bs=$(FLASH_IMAGE_BLOCK_SIZE) conv=notrunc - # add haiku_loader + # add root fs + #dd if=$(>[3]) of=$(<) bs=$(FLASH_IMAGE_BLOCK_SIZE) conv=notrunc seek=$(FLASH_IMAGE_ROOTFS_OFFSET) + # add haiku_loader (raw, elf or uimage) dd if=$(>[1]) of=$(<) bs=$(FLASH_IMAGE_BLOCK_SIZE) conv=notrunc seek=$(FLASH_IMAGE_LOADER_OFFSET) } -BuildUBootFlashImage haiku_flash_image.bin : haiku_loader : $(UBOOT_IMAGE) ; +BuildUBootFlashImage haiku_flash_image_raw.img : haiku_loader : $(UBOOT_IMAGE) ; +#BuildUBootFlashImage haiku_flash_image_elf.img : boot_loader_u-boot : $(UBOOT_IMAGE) ; +#BuildUBootFlashImage haiku_flash_image_uimage.img : boot_loader_u-boot_uimage : $(UBOOT_IMAGE) ; SEARCH on [ FGristFiles text_menu.cpp ] = [ FDirName $(HAIKU_TOP) src system boot platform generic ] ; From mmu_man at mail.berlios.de Sat Aug 8 04:18:30 2009 From: mmu_man at mail.berlios.de (mmu_man at mail.berlios.de) Date: Sat, 8 Aug 2009 04:18:30 +0200 Subject: [Haiku-commits] r32200 - haiku/trunk/headers/private/kernel/arch/arm/board/verdex Message-ID: <200908080218.n782IUhQ004549@sheep.berlios.de> Author: mmu_man Date: 2009-08-08 04:18:29 +0200 (Sat, 08 Aug 2009) New Revision: 32200 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32200&view=rev Modified: haiku/trunk/headers/private/kernel/arch/arm/board/verdex/board_config.h Log: [ARM] debug UART is [0] on Verdex. Modified: haiku/trunk/headers/private/kernel/arch/arm/board/verdex/board_config.h =================================================================== --- haiku/trunk/headers/private/kernel/arch/arm/board/verdex/board_config.h 2009-08-08 02:01:59 UTC (rev 32199) +++ haiku/trunk/headers/private/kernel/arch/arm/board/verdex/board_config.h 2009-08-08 02:18:29 UTC (rev 32200) @@ -13,6 +13,6 @@ #define BOARD_UART2_BASE BTUART_BASE #define BOARD_UART3_BASE STUART_BASE -#define BOARD_DEBUG_UART 2 +#define BOARD_DEBUG_UART 0 #endif /* _BOARD_VERDEX_BOARD_CONFIG_H */ From mmu_man at mail.berlios.de Sat Aug 8 04:23:28 2009 From: mmu_man at mail.berlios.de (mmu_man at mail.berlios.de) Date: Sat, 8 Aug 2009 04:23:28 +0200 Subject: [Haiku-commits] r32201 - haiku/trunk/src/system/boot/platform/u-boot Message-ID: <200908080223.n782NSUJ004813@sheep.berlios.de> Author: mmu_man Date: 2009-08-08 04:23:22 +0200 (Sat, 08 Aug 2009) New Revision: 32201 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32201&view=rev Modified: haiku/trunk/src/system/boot/platform/u-boot/serial.cpp haiku/trunk/src/system/boot/platform/u-boot/uart.c haiku/trunk/src/system/boot/platform/u-boot/uart.h Log: [ARM] - cleanup, - add an uart_debug_port() to avoid using the #define in serial.cpp, - use board_config defines in uart.c. Modified: haiku/trunk/src/system/boot/platform/u-boot/serial.cpp =================================================================== --- haiku/trunk/src/system/boot/platform/u-boot/serial.cpp 2009-08-08 02:18:29 UTC (rev 32200) +++ haiku/trunk/src/system/boot/platform/u-boot/serial.cpp 2009-08-08 02:23:22 UTC (rev 32201) @@ -25,7 +25,7 @@ static void serial_putc(char c) { - uart_putc(0,c); + uart_putc(uart_debug_port(),c); } @@ -68,12 +68,12 @@ extern "C" void serial_enable(void) { + /* should already be initialized by U-Boot */ + /* uart_init_early(); uart_init();//todo - uart_init_port(0,9600); - //uart_init_port(1,9600); - //uart_init_port(2,9600); - + uart_init_port(uart_debug_port(),9600); + */ sSerialEnabled++; } Modified: haiku/trunk/src/system/boot/platform/u-boot/uart.c =================================================================== --- haiku/trunk/src/system/boot/platform/u-boot/uart.c 2009-08-08 02:18:29 UTC (rev 32200) +++ haiku/trunk/src/system/boot/platform/u-boot/uart.c 2009-08-08 02:23:22 UTC (rev 32201) @@ -23,23 +23,20 @@ #include #include #include -#include +#include //#include -//TODO: beaglespecific ?... -#define DEBUG_UART 2 +#define DEBUG_UART BOARD_DEBUG_UART - - struct uart_stat { addr_t base; uint shift; }; static struct uart_stat uart[3] = { - { FFUART_BASE, 2 }, - { BTUART_BASE, 2 }, - { STUART_BASE, 2 }, + { BOARD_UART1_BASE, 2 }, + { BOARD_UART2_BASE, 2 }, + { BOARD_UART3_BASE, 2 }, }; static inline void write_uart_reg(int port, uint reg, unsigned char data) @@ -90,6 +87,11 @@ #define V_NS16550_CLK (48000000) /* 48MHz (APLL96/2) */ +int uart_debug_port(void) +{ + return DEBUG_UART; +} + void uart_init_port(int port, uint baud) { /* clear the tx & rx fifo and disable */ Modified: haiku/trunk/src/system/boot/platform/u-boot/uart.h =================================================================== --- haiku/trunk/src/system/boot/platform/u-boot/uart.h 2009-08-08 02:18:29 UTC (rev 32200) +++ haiku/trunk/src/system/boot/platform/u-boot/uart.h 2009-08-08 02:23:22 UTC (rev 32201) @@ -31,6 +31,7 @@ void uart_init(void); void uart_init_early(void); +int uart_debug_port(void); int uart_putc(int port, char c); int uart_getc(int port, bool wait); From mmu_man at mail.berlios.de Sat Aug 8 04:26:04 2009 From: mmu_man at mail.berlios.de (mmu_man at mail.berlios.de) Date: Sat, 8 Aug 2009 04:26:04 +0200 Subject: [Haiku-commits] r32202 - in haiku/trunk: headers/private/kernel/arch/arm src/system/boot/platform/u-boot Message-ID: <200908080226.n782Q4fL004947@sheep.berlios.de> Author: mmu_man Date: 2009-08-08 04:26:01 +0200 (Sat, 08 Aug 2009) New Revision: 32202 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32202&view=rev Removed: haiku/trunk/src/system/boot/platform/u-boot/uart.h Modified: haiku/trunk/headers/private/kernel/arch/arm/uart.h Log: [ARM] Remove duplicate header. Modified: haiku/trunk/headers/private/kernel/arch/arm/uart.h =================================================================== --- haiku/trunk/headers/private/kernel/arch/arm/uart.h 2009-08-08 02:23:22 UTC (rev 32201) +++ haiku/trunk/headers/private/kernel/arch/arm/uart.h 2009-08-08 02:26:01 UTC (rev 32202) @@ -31,6 +31,7 @@ void uart_init(void); void uart_init_early(void); +int uart_debug_port(void); int uart_putc(int port, char c); int uart_getc(int port, bool wait); Deleted: haiku/trunk/src/system/boot/platform/u-boot/uart.h From mmu_man at mail.berlios.de Sat Aug 8 04:38:46 2009 From: mmu_man at mail.berlios.de (mmu_man at mail.berlios.de) Date: Sat, 8 Aug 2009 04:38:46 +0200 Subject: [Haiku-commits] r32203 - in haiku/trunk/src/system/boot: arch/arm platform/u-boot Message-ID: <200908080238.n782ckvm006318@sheep.berlios.de> Author: mmu_man Date: 2009-08-08 04:38:44 +0200 (Sat, 08 Aug 2009) New Revision: 32203 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32203&view=rev Added: haiku/trunk/src/system/boot/arch/arm/uart.c Removed: haiku/trunk/src/system/boot/platform/u-boot/uart.c Modified: haiku/trunk/src/system/boot/arch/arm/Jamfile haiku/trunk/src/system/boot/platform/u-boot/Jamfile Log: [ARM] Move uart.c to arch/arm/ where it belongs, it has nothing u-boot specific. Modified: haiku/trunk/src/system/boot/arch/arm/Jamfile =================================================================== --- haiku/trunk/src/system/boot/arch/arm/Jamfile 2009-08-08 02:26:01 UTC (rev 32202) +++ haiku/trunk/src/system/boot/arch/arm/Jamfile 2009-08-08 02:38:44 UTC (rev 32203) @@ -2,6 +2,8 @@ DEFINES += _BOOT_MODE ; +UsePrivateHeaders [ FDirName kernel arch $(TARGET_ARCH) board $(TARGET_BOOT_BOARD) ] ; + # TODO: Is there any reason to recompile arch_string.S here? local librootArchObjects = # arch_string.o @@ -14,6 +16,7 @@ ; KernelMergeObject boot_arch_$(TARGET_ARCH).o : + uart.c arch_elf.cpp $(librootArchObjects) : -fno-pic Copied: haiku/trunk/src/system/boot/arch/arm/uart.c (from rev 32201, haiku/trunk/src/system/boot/platform/u-boot/uart.c) Property changes on: haiku/trunk/src/system/boot/arch/arm/uart.c ___________________________________________________________________ Name: svn:mergeinfo + Modified: haiku/trunk/src/system/boot/platform/u-boot/Jamfile =================================================================== --- haiku/trunk/src/system/boot/platform/u-boot/Jamfile 2009-08-08 02:26:01 UTC (rev 32202) +++ haiku/trunk/src/system/boot/platform/u-boot/Jamfile 2009-08-08 02:38:44 UTC (rev 32203) @@ -2,8 +2,6 @@ SubDirHdrs $(HAIKU_TOP) headers private kernel boot platform $(TARGET_BOOT_PLATFORM) ; -#XXX:move to arch/arm -UsePrivateHeaders [ FDirName kernel arch $(TARGET_ARCH) board $(TARGET_BOOT_BOARD) ] ; UsePrivateHeaders [ FDirName kernel disk_device_manager ] ; UsePrivateHeaders [ FDirName graphics common ] ; UsePrivateHeaders [ FDirName graphics vesa ] ; @@ -31,7 +29,6 @@ cpu.cpp video.cpp mmu.cpp - uart.c # generic text_menu.cpp Deleted: haiku/trunk/src/system/boot/platform/u-boot/uart.c From leavengood at gmail.com Sat Aug 8 07:34:06 2009 From: leavengood at gmail.com (Ryan Leavengood) Date: Sat, 8 Aug 2009 01:34:06 -0400 Subject: [Haiku-commits] r32180 - haiku/trunk/build/jam In-Reply-To: <4A7C07A7.3080606@zappotek.com> References: <200908071049.n77AnRhM029546@sheep.berlios.de> <4A7C07A7.3080606@zappotek.com> Message-ID: On Fri, Aug 7, 2009 at 6:53 AM, Alexandre Deckner wrote: > > BTW, it still needs an icon. If someone's motivated go ahead. I'll give > it a try otherwise. I'm sort of in icon making mode at the moment so I could work on it. But at the same time I have plenty of needed icons to occupy me for a while. So if you want to give it a go we could always use more icon artists. Just be sure to check the icon guidelines and follow them. In addition I've learned that all the other great icons from stippi, zuMi and others are wonderful to learn from. -- Regards, Ryan From fekdahl at gmail.com Sat Aug 8 08:16:04 2009 From: fekdahl at gmail.com (Fredrik Ekdahl) Date: Sat, 08 Aug 2009 08:16:04 +0200 Subject: [Haiku-commits] r32189 - in haiku/trunk/src/add-ons/media/plugins/ffmpeg: . libavcodec In-Reply-To: <200908071521.n77FLcBG018959@sheep.berlios.de> References: <200908071521.n77FLcBG018959@sheep.berlios.de> Message-ID: <4A7D1824.7000500@gmail.com> stippi at mail.berlios.de skrev: > Author: stippi > Date: 2009-08-07 17:21:37 +0200 (Fri, 07 Aug 2009) > New Revision: 32189 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32189&view=rev > > Modified: > haiku/trunk/src/add-ons/media/plugins/ffmpeg/config.h > haiku/trunk/src/add-ons/media/plugins/ffmpeg/libavcodec/Jamfile > Log: > Disabled the rest of the GPL code as per the FFmpeg 0.5 README. > Could all this GPL code disabling be made using the configure option instead, instead of hardcoding? Btw, as a sidenote I may add that the AC-3 support in ffmpeg is superior to liba52, which we have a decoder for i our repository. Quoting the news item about the 0.5 release: "AC-3 that is faster than liba52 in 5.1, up to 2x faster in stereo and also supports E-AC-3! Hence liba52 is now obsolete." Thanks for doing all this work on the ffmpeg plugin! -- /Fredrik Ekdahl From humdingerb at mail.berlios.de Sat Aug 8 08:59:03 2009 From: humdingerb at mail.berlios.de (humdingerb at mail.berlios.de) Date: Sat, 8 Aug 2009 08:59:03 +0200 Subject: [Haiku-commits] r32204 - haiku/trunk/src/apps/workspaces Message-ID: <200908080659.n786x3fr009539@sheep.berlios.de> Author: humdingerb Date: 2009-08-08 08:59:00 +0200 (Sat, 08 Aug 2009) New Revision: 32204 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32204&view=rev Modified: haiku/trunk/src/apps/workspaces/Workspaces.cpp Log: This doesn't solve #4185 (I'm too dumb, I've tried...). Just changed some strings to mesh with e.g. LaunchBox Modified: haiku/trunk/src/apps/workspaces/Workspaces.cpp =================================================================== --- haiku/trunk/src/apps/workspaces/Workspaces.cpp 2009-08-08 02:38:44 UTC (rev 32203) +++ haiku/trunk/src/apps/workspaces/Workspaces.cpp 2009-08-08 06:59:00 UTC (rev 32204) @@ -521,11 +521,11 @@ BMenuItem* item; menu->AddSeparatorItem(); - menu->AddItem(item = new BMenuItem("No title", + menu->AddItem(item = new BMenuItem("No Window Title", new BMessage(kMsgToggleTitle))); if (window->Look() == B_MODAL_WINDOW_LOOK) item->SetMarked(true); - menu->AddItem(item = new BMenuItem("No Border", + menu->AddItem(item = new BMenuItem("No Window Border", new BMessage(kMsgToggleBorder))); if (window->Look() == B_NO_BORDER_WINDOW_LOOK) item->SetMarked(true); @@ -535,7 +535,7 @@ new BMessage(kMsgToggleAlwaysOnTop))); if (window->Feel() == B_FLOATING_ALL_WINDOW_FEEL) item->SetMarked(true); - menu->AddItem(item = new BMenuItem("Auto-Raise", + menu->AddItem(item = new BMenuItem("Auto Raise", new BMessage(kMsgToggleAutoRaise))); if (window->IsAutoRaising()) item->SetMarked(true); From humdingerb at mail.berlios.de Sat Aug 8 09:45:09 2009 From: humdingerb at mail.berlios.de (humdingerb at mail.berlios.de) Date: Sat, 8 Aug 2009 09:45:09 +0200 Subject: [Haiku-commits] r32205 - haiku/trunk/src/apps/terminal Message-ID: <200908080745.n787j9pS024354@sheep.berlios.de> Author: humdingerb Date: 2009-08-08 09:45:06 +0200 (Sat, 08 Aug 2009) New Revision: 32205 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32205&view=rev Modified: haiku/trunk/src/apps/terminal/AppearPrefView.cpp haiku/trunk/src/apps/terminal/PrefWindow.cpp haiku/trunk/src/apps/terminal/TermConst.h Log: Applied old patch by Urias (see #3209) improving strings in Terminal's preferences. Added a few more tidbits. Modified: haiku/trunk/src/apps/terminal/AppearPrefView.cpp =================================================================== --- haiku/trunk/src/apps/terminal/AppearPrefView.cpp 2009-08-08 06:59:00 UTC (rev 32204) +++ haiku/trunk/src/apps/terminal/AppearPrefView.cpp 2009-08-08 07:45:06 UTC (rev 32205) @@ -98,7 +98,7 @@ AddChild(fFontSize); r.OffsetBy(-r.Width() - 10,r.Height() + 25); - fColorField = new BMenuField(r, "color", "Change:", + fColorField = new BMenuField(r, "color", "Color:", MakeMenu(MSG_COLOR_FIELD_CHANGED, color_tbl, color_tbl[0])); fColorField->SetDivider(StringWidth(fColorField->Label()) + 8.0); AddChild(fColorField); Modified: haiku/trunk/src/apps/terminal/PrefWindow.cpp =================================================================== --- haiku/trunk/src/apps/terminal/PrefWindow.cpp 2009-08-08 06:59:00 UTC (rev 32204) +++ haiku/trunk/src/apps/terminal/PrefWindow.cpp 2009-08-08 07:45:06 UTC (rev 32205) @@ -23,7 +23,7 @@ PrefWindow::PrefWindow(BMessenger messenger) - : BWindow(_CenteredRect(BRect(0, 0, 350, 215)), "Terminal Settings", + : BWindow(_CenteredRect(BRect(0, 0, 350, 215)), "Terminal Preferences", B_TITLED_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL, B_NOT_RESIZABLE|B_NOT_ZOOMABLE), fPreviousPref(new PrefHandler(PrefHandler::Default())), Modified: haiku/trunk/src/apps/terminal/TermConst.h =================================================================== --- haiku/trunk/src/apps/terminal/TermConst.h 2009-08-08 06:59:00 UTC (rev 32204) +++ haiku/trunk/src/apps/terminal/TermConst.h 2009-08-08 07:45:06 UTC (rev 32205) @@ -1,5 +1,5 @@ /* - * Copyright 2001-2008, Haiku. + * Copyright 2001-2009, Haiku. * Copyright (c) 2003-4 Kian Duffy * Copyright (C) 1998,99 Kazuho Okui and Takashi Murai. * @@ -98,12 +98,12 @@ const char* const PREF_HALF_FONT_STYLE = "Half Font Style"; const char* const PREF_HALF_FONT_SIZE = "Half Font Size"; -const char* const PREF_TEXT_FORE_COLOR = "Text Foreground Color"; -const char* const PREF_TEXT_BACK_COLOR = "Text Background Color"; -const char* const PREF_SELECT_FORE_COLOR = "Selection Foreground Color"; -const char* const PREF_SELECT_BACK_COLOR = "Selection Background Color"; -const char* const PREF_CURSOR_FORE_COLOR = "Cursor Foreground Color"; -const char* const PREF_CURSOR_BACK_COLOR = "Cursor Background Color"; +const char* const PREF_TEXT_FORE_COLOR = "Text"; +const char* const PREF_TEXT_BACK_COLOR = "Background"; +const char* const PREF_SELECT_FORE_COLOR = "Selected Text"; +const char* const PREF_SELECT_BACK_COLOR = "Selected Background"; +const char* const PREF_CURSOR_FORE_COLOR = "Cursor Text"; +const char* const PREF_CURSOR_BACK_COLOR = "Cursor Background"; const char* const PREF_IM_FORE_COLOR = "IM Foreground Color"; const char* const PREF_IM_BACK_COLOR = "IM Background Color"; @@ -119,7 +119,7 @@ const char* const PREF_ANSI_WHITE_COLOR = "ANSI White Color"; const char* const PREF_HISTORY_SIZE = "History Size"; -const char* const PREF_CURSOR_BLINKING = "Cursor Blinking rate"; +const char* const PREF_CURSOR_BLINKING = "Cursor Blinking Rate"; const char* const PREF_IM_AWARE = "Input Method Aware"; @@ -127,7 +127,7 @@ const char* const PREF_ROWS = "Rows"; const char* const PREF_SHELL = "Shell"; -const char* const PREF_TEXT_ENCODING = "Text encoding"; +const char* const PREF_TEXT_ENCODING = "Text Encoding"; const char* const PREF_GUI_LANGUAGE = "Language"; // Color type From superstippi at gmx.de Sat Aug 8 10:30:32 2009 From: superstippi at gmx.de (Stephan Assmus) Date: Sat, 08 Aug 2009 10:30:32 +0200 Subject: [Haiku-commits] r32189 - in haiku/trunk/src/add-ons/media/plugins/ffmpeg: . libavcodec In-Reply-To: <4A7D1824.7000500@gmail.com> References: <200908071521.n77FLcBG018959@sheep.berlios.de> <4A7D1824.7000500@gmail.com> Message-ID: <20090808103032.338.1@bepc.1249719982.fake> On 2009-08-08 at 08:16:04 [+0200], Fredrik Ekdahl wrote: > stippi at mail.berlios.de skrev: > > Author: stippi > > Date: 2009-08-07 17:21:37 +0200 (Fri, 07 Aug 2009) New Revision: 32189 > > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32189&view=rev > > > > Modified: > > haiku/trunk/src/add-ons/media/plugins/ffmpeg/config.h > > haiku/trunk/src/add-ons/media/plugins/ffmpeg/libavcodec/Jamfile > > Log: > > Disabled the rest of the GPL code as per the FFmpeg 0.5 README. > > > > Could all this GPL code disabling be made using the configure option > instead, instead of hardcoding? You missed a commit, I already did just that. It depends on --include-gpl-addons now. :-) > Btw, as a sidenote I may add that the AC-3 support in ffmpeg is superior > to liba52, which we have a decoder for i our repository. Quoting the news > item about the 0.5 release: "AC-3 that is faster than liba52 in > 5.1, up to 2x faster in stereo and also supports E-AC-3! Hence liba52 is > now obsolete." AC-3 in FFmpeg 0.5 does not support everything that our existing Decoder supports. We would have to upgrade to a newer revision from the FFmpeg repo, but I want to do that carefully only, when I have more time. I care a lot about the AVC-HD clips from my video camera, and those have AC-3 sound that FFmpeg does not support in 0.5. Best regards, -Stephan From stippi at mail.berlios.de Sat Aug 8 10:53:38 2009 From: stippi at mail.berlios.de (stippi at mail.berlios.de) Date: Sat, 8 Aug 2009 10:53:38 +0200 Subject: [Haiku-commits] r32206 - haiku/trunk/src/apps/diskusage Message-ID: <200908080853.n788rcPq000156@sheep.berlios.de> Author: stippi Date: 2009-08-08 10:53:33 +0200 (Sat, 08 Aug 2009) New Revision: 32206 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32206&view=rev Modified: haiku/trunk/src/apps/diskusage/DiskUsage.rdef Log: Replaced duplicated DriveSetup icon with zuMi's DiskUsage icon. According to a Trac comment, Ryan prefers it. Another argument pro zuMi's version is that it is a bit more neutral, since DiskUsage can be invoked on folders, not just entire disks. Modified: haiku/trunk/src/apps/diskusage/DiskUsage.rdef =================================================================== --- haiku/trunk/src/apps/diskusage/DiskUsage.rdef 2009-08-08 07:45:06 UTC (rev 32205) +++ haiku/trunk/src/apps/diskusage/DiskUsage.rdef 2009-08-08 08:53:33 UTC (rev 32206) @@ -20,30 +20,32 @@ }; resource vector_icon { - $"6E6369660F03010000020016023AF81C3830AFBB29EB3E24FE4903D742949400" - $"8EFF47020016023AFDE4B927BB3BBB443D89C84A587E467D6A007DFFB0020016" - $"023BFC1538B2EABB58DE3E788D4A21874591FF0096FFB0020006023C96323A4D" - $"3FBAFC013D5A974B57A549844D00474747FFA5A0A002001602BC592FBB29A73C" - $"0CE4BD0B7C4892C04B7966007DFFD40200060238DBB4399733BC4A333BA54248" - $"6E6649EE7B00596756FFEBB2B203A7FF0003FF0000040180020306033E800000" - $"00000000003DC00049E00049200000007F7F7EB1EAEAFF4F9DA4020306033E80" - $"000000000000003DC00049E00049200000E3B78D86F4F8C9F4888C9802030603" - $"3E80000000000000003DC00049E00049200000A9525286F5C0D3F4B05A660203" - $"06033E80000000000000003DC00049E00049200000888C9886EBEDF2F4888C98" - $"020016033D400000000000000040000048800000000000FF9BD3FFCD0F0A0622" - $"3C2249445B5A3E5A3139250A05223C2246B54AC1D7393239250A055A31392539" - $"32C7D0BE1E5A3C0A043932B4CBC2564458C921BE980A04444B445B5A3E5A310A" - $"04223C2249445B444B08022743B814C1F10802264329440A05445D495D603E5A" - $"3B5B3F02043F2EC3882EBB2B2E2C3A2CBAB82CBFFF3F46BB2B46C38846523A52" - $"BFFF52BAB80604BF3E2E3E2EBAF2B8B32C3A2CBACC2CBDF9B84CBF1AB7F7BE90" - $"B84CBF1A3E3906033E4039C6D5BCA1C6D5BCA1C651BA7FC024B89AC392B8D4C0" - $"24B89A0604FE3F3AB915C00AB915C00ABA72C14E3F46BCBE46C33846C6DDBDF1" - $"C668C04FC6DDBDF10204423942BCBD42BD2E3F3AC0023ABEB13A3C393CBD2E3C" - $"BCBD3F38BEB138C002380A04233C444B59323926110A090108000A0001001001" - $"178400040A010101000A020102000A030103000A00030A0B0C1001178402040A" - $"0A010A000A0B010B000A0C010C000A00010D1001178400040A0D010D000A0401" - $"04000A050105000A0601061001178520040A0801073024B39901178200040A07" - $"01073020B2E601178200040A0E010E1815FF0117812204" + $"6E6369660B040066050003FF8080038000000300BF00020006023CE000000000" + $"00000040000049200000000000FF0606FFCC00000373E573037397E502000602" + $"3C000000000000000040000049800040000000FDFF75FFFFAA0002000602BB40" + $"000000000000004000004AD00000000000FF8000FF802B0002000602380CC03A" + $"07DEBF922B3D9AC24BBB89C509E500FFFFFFFFFFFF800F040AEBBA0C3E5D3E5D" + $"545D575953575954585659545250544F5C4F5C4F5C4D5B4C5E58475C48584706" + $"041F583A583AC8C8BC6A5034C7C7BB9850344C5806047F553A5438553A583A58" + $"3AC8C8BC6A5034C7C7BB9850343606031B553A553A543850363A0A04503A504C" + $"584C583A020A4A424A42C274C1053E44434434442C3D2C412C3D2C342C34B589" + $"BBD2223D22BD2D223D2250225022C7412757B484C80CB7C7CA433E5DBB485DC1" + $"D05D5059C42BCA965059504650465046020427442744B4A9C0A9223D2240223D" + $"2250225022C7412757B484C80C2757020650465046C42DC2E43E49C1C349BB48" + $"492744B7C7C289274427572757B7C7CA433E5DBB485DC1D05D5059C42BCA9650" + $"5902064A424A42C294C0F03E443E44BC8F442F41BA4DC0EA2F4127442744B7C5" + $"C28B3E49BB4249C1C3495046C42DC2E4504602042744B4A9C0A927442F412F41" + $"B835BFB52C3D2C3F2C3D223D223D224006030F2C342C34B589BBD2223D22BD2D" + $"223D2C0607FF3B3E23C2F423BAF4232C2A2CB5822C2A2C3D2C3D2C413E443444" + $"43444A42C274C1054A425046502A502A50B5820607FF2F4D2E4D2EC39FB94C3E" + $"31C17731BAF4312C2A2CB8742C2A2C3D2C3D2C413E44344443444A4247434A42" + $"4D440A053E2A4D2E4D445046502A0606FF0E3E23C2E923BAFE232C2A2CB5712C" + $"B8863E31BAFE31C16F314D2EC3A4B9524D2E3E2A502A502A50B571120A000100" + $"1001158400040A01010118001501178600040A0101011001178400040A020102" + $"000A030103000A030104000A01010518001501178600040A0101051815FF0117" + $"8400040A040106000A050107000A060109000A020108000A07010A000A01010B" + $"18001501178600040A01010B1815FF01178400040A08010C000A09010D000A0A" + $"010E00" }; resource(101, "RGB_WIN") rgb_color { 0xDE, 0xDB, 0xDE, 0xFF }; From mattmadia at gmail.com Sat Aug 8 14:27:56 2009 From: mattmadia at gmail.com (Matt Madia) Date: Sat, 8 Aug 2009 12:27:56 +0000 Subject: [Haiku-commits] r32205 - haiku/trunk/src/apps/terminal In-Reply-To: <200908080745.n787j9pS024354@sheep.berlios.de> References: <200908080745.n787j9pS024354@sheep.berlios.de> Message-ID: <1e42d8c50908080527g156d06b5uf20049a72efe811f@mail.gmail.com> On Sat, Aug 8, 2009 at 07:45, wrote: > Applied old patch by Urias (see #3209) improving strings in Terminal's preferences. Added a few more tidbits. this was my patch. urias offered to upload to Trac, as my pc had trouble creating tickets at that time. either way, thanks for committing it! :) --mmadia From humdingerb at googlemail.com Sat Aug 8 14:36:16 2009 From: humdingerb at googlemail.com (Humdinger) Date: Sat, 08 Aug 2009 14:36:16 +0200 Subject: [Haiku-commits] r32205 - haiku/trunk/src/apps/terminal In-Reply-To: <1e42d8c50908080527g156d06b5uf20049a72efe811f@mail.gmail.com> References: <200908080745.n787j9pS024354@sheep.berlios.de> <1e42d8c50908080527g156d06b5uf20049a72efe811f@mail.gmail.com> Message-ID: <4A7D7140.5000202@googlemail.com> Matt Madia wrote: > either way, thanks for committing it! :) And it took just a bit longer than half a year... :) I'm in the process of re-shooting screenshots for the user guide and stumble over these things from time to time. Regards, Humdinger -- --=-=--=-=--=-=--=-=--=-=--=-=--=-=--=-=--=-=--=- Deutsche Haiku News @ http://www.haiku-gazette.de From leavengood at gmail.com Sat Aug 8 17:09:14 2009 From: leavengood at gmail.com (Ryan Leavengood) Date: Sat, 8 Aug 2009 11:09:14 -0400 Subject: [Haiku-commits] r32204 - haiku/trunk/src/apps/workspaces In-Reply-To: <200908080659.n786x3fr009539@sheep.berlios.de> References: <200908080659.n786x3fr009539@sheep.berlios.de> Message-ID: On Sat, Aug 8, 2009 at 2:59 AM, wrote: > > This doesn't solve #4185 (I'm too dumb, I've tried...). Just changed some > strings to mesh with e.g. LaunchBox I definitely agree with using the positive verb form, and I once had similar plans for MediaPlayer which also had some options like this (I don't think it does anymore.) It can be tricky to reverse the logic. Unless someone beats me to it I'll take a look at this to try to fix #4185. -- Regards, Ryan From leavengood at gmail.com Sat Aug 8 17:11:37 2009 From: leavengood at gmail.com (Ryan Leavengood) Date: Sat, 8 Aug 2009 11:11:37 -0400 Subject: [Haiku-commits] r32206 - haiku/trunk/src/apps/diskusage In-Reply-To: <200908080853.n788rcPq000156@sheep.berlios.de> References: <200908080853.n788rcPq000156@sheep.berlios.de> Message-ID: On Sat, Aug 8, 2009 at 4:53 AM, wrote: > Replaced duplicated DriveSetup icon with zuMi's DiskUsage icon. According to > a Trac comment, Ryan prefers it. Another argument pro zuMi's version is that > it is a bit more neutral, since DiskUsage can be invoked on folders, not just > entire disks. That is a good point, thanks for committing it. -- Regards, Ryan From mmu_man at mail.berlios.de Sat Aug 8 18:02:36 2009 From: mmu_man at mail.berlios.de (mmu_man at mail.berlios.de) Date: Sat, 8 Aug 2009 18:02:36 +0200 Subject: [Haiku-commits] r32207 - in haiku/trunk/src/system: boot ldscripts/arm ldscripts/arm/board ldscripts/arm/board/overo ldscripts/arm/board/verdex Message-ID: <200908081602.n78G2awj003432@sheep.berlios.de> Author: mmu_man Date: 2009-08-08 18:02:34 +0200 (Sat, 08 Aug 2009) New Revision: 32207 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32207&view=rev Added: haiku/trunk/src/system/ldscripts/arm/board/ haiku/trunk/src/system/ldscripts/arm/board/overo/ haiku/trunk/src/system/ldscripts/arm/board/overo/board.ld haiku/trunk/src/system/ldscripts/arm/board/verdex/ haiku/trunk/src/system/ldscripts/arm/board/verdex/board.ld Modified: haiku/trunk/src/system/boot/Jamfile haiku/trunk/src/system/ldscripts/arm/boot_loader_u-boot.ld Log: [ARM] Include board-specific file from the u-boot ldscript, to allow linking to different load addresses. Modified: haiku/trunk/src/system/boot/Jamfile =================================================================== --- haiku/trunk/src/system/boot/Jamfile 2009-08-08 08:53:33 UTC (rev 32206) +++ haiku/trunk/src/system/boot/Jamfile 2009-08-08 16:02:34 UTC (rev 32207) @@ -22,6 +22,11 @@ strtol.o ; +local extraLinkerArgs = ; +if $(TARGET_BOOT_BOARD) { + extraLinkerArgs += -L$(HAIKU_TOP)/src/system/ldscripts/$(TARGET_ARCH)/board/$(TARGET_BOOT_BOARD) ; +} + AddResources haiku_loader : boot_loader.rdef ; KernelLd boot_loader_$(TARGET_BOOT_PLATFORM) : @@ -45,7 +50,7 @@ $(librootFunctions:G=src!system!kernel!lib) : $(HAIKU_TOP)/src/system/ldscripts/$(TARGET_ARCH)/boot_loader_$(TARGET_BOOT_PLATFORM).ld - : -Bstatic + : -Bstatic $(extraLinkerArgs) ; rule BuildCoffLoader { Added: haiku/trunk/src/system/ldscripts/arm/board/overo/board.ld =================================================================== --- haiku/trunk/src/system/ldscripts/arm/board/overo/board.ld 2009-08-08 08:53:33 UTC (rev 32206) +++ haiku/trunk/src/system/ldscripts/arm/board/overo/board.ld 2009-08-08 16:02:34 UTC (rev 32207) @@ -0,0 +1,6 @@ +/* + * Gumstix Overo ld definitions + */ + +BOARD_LOADER_BASE = 0x80008000 ; +#error Added: haiku/trunk/src/system/ldscripts/arm/board/verdex/board.ld =================================================================== --- haiku/trunk/src/system/ldscripts/arm/board/verdex/board.ld 2009-08-08 08:53:33 UTC (rev 32206) +++ haiku/trunk/src/system/ldscripts/arm/board/verdex/board.ld 2009-08-08 16:02:34 UTC (rev 32207) @@ -0,0 +1,6 @@ +/* + * Gumstix Verdex ld definitions + */ + +BOARD_LOADER_BASE = 0xa2000000 ; + Modified: haiku/trunk/src/system/ldscripts/arm/boot_loader_u-boot.ld =================================================================== --- haiku/trunk/src/system/ldscripts/arm/boot_loader_u-boot.ld 2009-08-08 08:53:33 UTC (rev 32206) +++ haiku/trunk/src/system/ldscripts/arm/boot_loader_u-boot.ld 2009-08-08 16:02:34 UTC (rev 32207) @@ -1,11 +1,13 @@ OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") OUTPUT_ARCH(arm) +/* include board-specific definitions */ +INCLUDE board.ld + ENTRY(_start) SECTIONS { -/* . = 0x80008000; */ - . = 0xa2000000; + . = BOARD_LOADER_BASE; /* text/read-only data */ .text : { *(.text .gnu.linkonce.t.*) } From mmu_man at mail.berlios.de Sat Aug 8 18:12:03 2009 From: mmu_man at mail.berlios.de (mmu_man at mail.berlios.de) Date: Sat, 8 Aug 2009 18:12:03 +0200 Subject: [Haiku-commits] r32208 - haiku/trunk/src/system/ldscripts/arm/board/overo Message-ID: <200908081612.n78GC3bo004645@sheep.berlios.de> Author: mmu_man Date: 2009-08-08 18:12:02 +0200 (Sat, 08 Aug 2009) New Revision: 32208 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32208&view=rev Modified: haiku/trunk/src/system/ldscripts/arm/board/overo/board.ld Log: [ARM] Remove debug leftover. Modified: haiku/trunk/src/system/ldscripts/arm/board/overo/board.ld =================================================================== --- haiku/trunk/src/system/ldscripts/arm/board/overo/board.ld 2009-08-08 16:02:34 UTC (rev 32207) +++ haiku/trunk/src/system/ldscripts/arm/board/overo/board.ld 2009-08-08 16:12:02 UTC (rev 32208) @@ -3,4 +3,4 @@ */ BOARD_LOADER_BASE = 0x80008000 ; -#error + From anevilyak at mail.berlios.de Sat Aug 8 20:08:09 2009 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Sat, 8 Aug 2009 20:08:09 +0200 Subject: [Haiku-commits] r32209 - haiku/trunk/src/kits/tracker Message-ID: <200908081808.n78I89QY002885@sheep.berlios.de> Author: anevilyak Date: 2009-08-08 20:08:07 +0200 (Sat, 08 Aug 2009) New Revision: 32209 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32209&view=rev Modified: haiku/trunk/src/kits/tracker/PoseView.cpp Log: An Open With window has no target model. PoseView's drop target handling code didn't take this into account, causing a crash. Fixes ticket #4200. Modified: haiku/trunk/src/kits/tracker/PoseView.cpp =================================================================== --- haiku/trunk/src/kits/tracker/PoseView.cpp 2009-08-08 16:12:02 UTC (rev 32208) +++ haiku/trunk/src/kits/tracker/PoseView.cpp 2009-08-08 18:08:07 UTC (rev 32209) @@ -8926,6 +8926,10 @@ if (targetModel == NULL) targetModel = TargetModel(); + // if this is an OpenWith window, we'll have no target model + if (targetModel == NULL) + return false; + entry_ref srcRef; if (targetModel->IsDirectory() && dragMessage->HasRef("refs") && dragMessage->FindRef("refs", &srcRef) == B_OK) { From humdingerb at googlemail.com Sat Aug 8 20:13:33 2009 From: humdingerb at googlemail.com (Humdinger) Date: Sat, 08 Aug 2009 20:13:33 +0200 Subject: [Haiku-commits] r32209 - haiku/trunk/src/kits/tracker In-Reply-To: <200908081808.n78I89QY002885@sheep.berlios.de> References: <200908081808.n78I89QY002885@sheep.berlios.de> Message-ID: <4A7DC04D.5090809@googlemail.com> anevilyak at BerliOS wrote: > Author: anevilyak > Modified: haiku/trunk/src/kits/tracker/PoseView.cpp Log: > An Open With window has no > target model. PoseView's drop target handling code didn't take this into account, > causing a crash. Fixes ticket #4200. Thanks! You're a quick yak, you are. :) Regards, Humdinger -- --=-=--=-=--=-=--=-=--=-=--=-=--=-=--=-=--=-=--=- Deutsche Haiku News @ http://www.haiku-gazette.de From anevilyak at mail.berlios.de Sat Aug 8 21:36:28 2009 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Sat, 8 Aug 2009 21:36:28 +0200 Subject: [Haiku-commits] r32210 - haiku/trunk/src/kits/tracker Message-ID: <200908081936.n78JaSVb012688@sheep.berlios.de> Author: anevilyak Date: 2009-08-08 21:36:27 +0200 (Sat, 08 Aug 2009) New Revision: 32210 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32210&view=rev Modified: haiku/trunk/src/kits/tracker/ContainerWindow.cpp Log: When picking file destinations via the slow context popup, also do the copy vs move check based on device. Fixes ticket 4202. Modified: haiku/trunk/src/kits/tracker/ContainerWindow.cpp =================================================================== --- haiku/trunk/src/kits/tracker/ContainerWindow.cpp 2009-08-08 18:08:07 UTC (rev 32209) +++ haiku/trunk/src/kits/tracker/ContainerWindow.cpp 2009-08-08 19:36:27 UTC (rev 32210) @@ -1587,9 +1587,20 @@ entry.GetRef(&targetref); // if they don't match, move/copy - if (targetref != parentref) + if (targetref != parentref) { + uint32 moveMode = kMoveSelectionTo; + node_ref targetNode; + node_ref parentNode; + if (entry.GetNodeRef(&targetNode) == B_OK + && itemparent.GetNodeRef(&parentNode) + == B_OK) { + if (targetNode.device == parentNode.device) + moveMode = kCopySelectionTo; + } // copy drag contents to target ref in message - FSMoveToFolder(list, new BEntry(entry), kMoveSelectionTo); + FSMoveToFolder(list, new BEntry(entry), + moveMode); + } } else { // current message sent to apps is only B_REFS_RECEIVED From anevilyak at mail.berlios.de Sat Aug 8 21:39:34 2009 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Sat, 8 Aug 2009 21:39:34 +0200 Subject: [Haiku-commits] r32211 - haiku/trunk/src/kits/tracker Message-ID: <200908081939.n78JdYwf013111@sheep.berlios.de> Author: anevilyak Date: 2009-08-08 21:39:33 +0200 (Sat, 08 Aug 2009) New Revision: 32211 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32211&view=rev Modified: haiku/trunk/src/kits/tracker/ContainerWindow.cpp Log: Oops, check was reversed. Modified: haiku/trunk/src/kits/tracker/ContainerWindow.cpp =================================================================== --- haiku/trunk/src/kits/tracker/ContainerWindow.cpp 2009-08-08 19:36:27 UTC (rev 32210) +++ haiku/trunk/src/kits/tracker/ContainerWindow.cpp 2009-08-08 19:39:33 UTC (rev 32211) @@ -1594,7 +1594,7 @@ if (entry.GetNodeRef(&targetNode) == B_OK && itemparent.GetNodeRef(&parentNode) == B_OK) { - if (targetNode.device == parentNode.device) + if (targetNode.device != parentNode.device) moveMode = kCopySelectionTo; } // copy drag contents to target ref in message From rudolfc at mail.berlios.de Sun Aug 9 17:26:47 2009 From: rudolfc at mail.berlios.de (rudolfc at mail.berlios.de) Date: Sun, 9 Aug 2009 17:26:47 +0200 Subject: [Haiku-commits] r32212 - haiku/trunk/src/servers/app Message-ID: <200908091526.n79FQlwP024385@sheep.berlios.de> Author: rudolfc Date: 2009-08-09 17:26:19 +0200 (Sun, 09 Aug 2009) New Revision: 32212 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32212&view=rev Modified: haiku/trunk/src/servers/app/Screen.cpp haiku/trunk/src/servers/app/VirtualScreen.cpp Log: fixed BScreen mode.flags handling. This is now compatible with BeOS, and fixes for instance the use of Dualhead Setup for the Matrox and nVidia driver which make use of 'free' flags. A modeset command should be relayed to the accelerant even if it differs by just a single bit: the accelerant best knows how to handle this. Remark: Haiku's screen preflet refuses to set modes once a virtual screen is set since it doesn't recognize the currently set mode. I guess that could be fixed. Modified: haiku/trunk/src/servers/app/Screen.cpp =================================================================== --- haiku/trunk/src/servers/app/Screen.cpp 2009-08-08 19:39:33 UTC (rev 32211) +++ haiku/trunk/src/servers/app/Screen.cpp 2009-08-09 15:26:19 UTC (rev 32212) @@ -93,19 +93,6 @@ { display_mode current; GetMode(¤t); - // TODO: decide how best to handle the flags here - things like - // the screen preflet will generally always set the flags to 0, - // while it seems asking the accelerant to automatically pick the - // best mode might not necessarily. For the time being, match the - // flags before doing the mode comparison in order to prevent - // mode switches for otherwise identical modes (this was relatively - // easily observed on at least the radeon accelerant - on first boot - // the best mode picked included a flag mask of 0xffffffff ; - // if you switched the resolution of one workspace to something else - // and then back to the resolution it started with, you would observe - // a mode switch when jumping between that workspace and the others - // that were still using the automatically set default mode) - current.flags = mode.flags; if (!memcmp(&mode, ¤t, sizeof(display_mode))) return B_OK; Modified: haiku/trunk/src/servers/app/VirtualScreen.cpp =================================================================== --- haiku/trunk/src/servers/app/VirtualScreen.cpp 2009-08-08 19:39:33 UTC (rev 32211) +++ haiku/trunk/src/servers/app/VirtualScreen.cpp 2009-08-09 15:26:19 UTC (rev 32212) @@ -108,11 +108,8 @@ display_mode mode; screen->GetMode(&mode); - screenSettings.AddInt32("width", mode.virtual_width); - screenSettings.AddInt32("height", mode.virtual_height); - screenSettings.AddInt32("color space", mode.space); - screenSettings.AddData("timing", B_RAW_TYPE, &mode.timing, - sizeof(display_timing)); + screenSettings.AddData("mode", B_RAW_TYPE, &mode, + sizeof(display_mode)); settings.AddMessage("screen", &screenSettings); } @@ -142,16 +139,12 @@ BMessage settings; if (_GetConfiguration(screen, settings) == B_OK) { // we found settings for this screen, and try to apply them now - int32 width, height, colorSpace; - const display_timing* timing; + const display_mode* mode; ssize_t size; - if (settings.FindInt32("width", &width) == B_OK - && settings.FindInt32("height", &height) == B_OK - && settings.FindInt32("color space", &colorSpace) == B_OK - && settings.FindData("timing", B_RAW_TYPE, (const void**)&timing, + if (settings.FindData("mode", B_RAW_TYPE, (const void**)&mode, &size) == B_OK - && size == sizeof(display_timing)) - status = screen->SetMode(width, height, colorSpace, *timing, true); + && size == sizeof(display_mode)) + status = screen->SetMode(*mode, true); // TODO: named settings will get lost if setting the mode failed! } if (status < B_OK) { From mmu_man at mail.berlios.de Sun Aug 9 17:38:42 2009 From: mmu_man at mail.berlios.de (mmu_man at mail.berlios.de) Date: Sun, 9 Aug 2009 17:38:42 +0200 Subject: [Haiku-commits] r32213 - haiku/trunk/build/scripts Message-ID: <200908091538.n79Fcgx9025466@sheep.berlios.de> Author: mmu_man Date: 2009-08-09 17:38:41 +0200 (Sun, 09 Aug 2009) New Revision: 32213 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32213&view=rev Modified: haiku/trunk/build/scripts/build_cross_tools_gcc4 Log: Don't know why multilib was disabled in r29035, but we'll likely need it for arm, and m68k as well... Make it depend on haikuMachine. Modified: haiku/trunk/build/scripts/build_cross_tools_gcc4 =================================================================== --- haiku/trunk/build/scripts/build_cross_tools_gcc4 2009-08-09 15:26:19 UTC (rev 32212) +++ haiku/trunk/build/scripts/build_cross_tools_gcc4 2009-08-09 15:38:41 UTC (rev 32213) @@ -22,6 +22,21 @@ esac export MAKE +case $haikuMachine in +m68k-*) + binutilsConfigureArgs="--enable-multilib" + gccConfigureArgs="--enable-multilib" + ;; +arm-*) + binutilsConfigureArgs="--enable-multilib" + gccConfigureArgs="--enable-multilib" + ;; +*) + binutilsConfigureArgs="--disable-multilib" + gccConfigureArgs="--disable-multilib" + ;; +esac + if [ $# -lt 4 ]; then haikuOutputDir=$haikuSourceDir/generated else @@ -89,7 +104,7 @@ cd $binutilsObjDir CFLAGS="-O2" CXXFLAGS="-O2" $binutilsSourceDir/configure \ --prefix=$installDir --target=$haikuMachine --disable-nls \ - --disable-shared --disable-multilib --disable-werror || exit 1 + --disable-shared --disable-werror $binutilsConfigureArgs || exit 1 $MAKE || exit 1 $MAKE install || exit 1 @@ -120,8 +135,9 @@ cd $gccObjDir CFLAGS="-O2" CXXFLAGS="-O2" $gccSourceDir/configure --prefix=$installDir \ --target=$haikuMachine --disable-nls --disable-shared \ - --disable-multilib --enable-languages=c,c++ \ - --with-headers=$tmpIncludeDir --with-libs=$tmpLibDir || exit 1 + --enable-languages=c,c++ \ + --with-headers=$tmpIncludeDir --with-libs=$tmpLibDir \ + $gccConfigureArgs || exit 1 # make gcc $MAKE || { From mmu_man at mail.berlios.de Sun Aug 9 18:40:20 2009 From: mmu_man at mail.berlios.de (mmu_man at mail.berlios.de) Date: Sun, 9 Aug 2009 18:40:20 +0200 Subject: [Haiku-commits] r32214 - in haiku/trunk/src/system/boot/platform/u-boot: . board board/overo board/verdex Message-ID: <200908091640.n79GeKZ7007112@sheep.berlios.de> Author: mmu_man Date: 2009-08-09 18:40:17 +0200 (Sun, 09 Aug 2009) New Revision: 32214 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32214&view=rev Added: haiku/trunk/src/system/boot/platform/u-boot/board/ haiku/trunk/src/system/boot/platform/u-boot/board/Jamfile haiku/trunk/src/system/boot/platform/u-boot/board/overo/ haiku/trunk/src/system/boot/platform/u-boot/board/overo/Jamfile haiku/trunk/src/system/boot/platform/u-boot/board/verdex/ haiku/trunk/src/system/boot/platform/u-boot/board/verdex/Jamfile Modified: haiku/trunk/src/system/boot/platform/u-boot/Jamfile Log: [ARM] Add rule to handle uimage, and board-specific stuff to handle load addresses. Need to fix them, u-boot doesn't like loading the file with the header where the header says it should go, must copy to a different address. Modified: haiku/trunk/src/system/boot/platform/u-boot/Jamfile =================================================================== --- haiku/trunk/src/system/boot/platform/u-boot/Jamfile 2009-08-09 15:38:41 UTC (rev 32213) +++ haiku/trunk/src/system/boot/platform/u-boot/Jamfile 2009-08-09 16:40:17 UTC (rev 32214) @@ -36,6 +36,11 @@ : -fno-pic ; +# include board-specific defs +SubInclude HAIKU_TOP src system boot platform $(TARGET_BOOT_PLATFORM) board ; +# reset SubDir +SubDir HAIKU_TOP src system boot platform u-boot ; + # bootable flash image rule BuildUBootFlashImage image : haikuLoader : uboot_image { Depends $(image) : $(haikuLoader) ; @@ -51,8 +56,6 @@ actions BuildUBootFlashImage1 { - echo "$(1)" - echo "$(2)" $(RM) $(<) # make an empty image dd if=/dev/zero of=$(<) bs=$(FLASH_IMAGE_BLOCK_SIZE) count=$(FLASH_IMAGE_BLOCK_COUNT) @@ -64,9 +67,23 @@ dd if=$(>[1]) of=$(<) bs=$(FLASH_IMAGE_BLOCK_SIZE) conv=notrunc seek=$(FLASH_IMAGE_LOADER_OFFSET) } +# uImage +rule BuildUImage image : data : args { + Depends $(image) : $(data) ; + LocalClean clean : $(image) ; + MKIMAGE_ARGS on $(image) = $(args) ; + BuildUImage1 $(image) : $(data) ; +} + +actions BuildUImage1 { + mkimage $(MKIMAGE_ARGS) -d $(>) $(<) +} + +BuildUImage haiku_loader.ub : haiku_loader : "-A arm -O netbsd -T kernel -C none -a $(BOARD_UBOOT_LOADER_ADDRESS) -e $(BOARD_UBOOT_LOADER_ADDRESS) -n 'haiku_loader'" ; + BuildUBootFlashImage haiku_flash_image_raw.img : haiku_loader : $(UBOOT_IMAGE) ; #BuildUBootFlashImage haiku_flash_image_elf.img : boot_loader_u-boot : $(UBOOT_IMAGE) ; -#BuildUBootFlashImage haiku_flash_image_uimage.img : boot_loader_u-boot_uimage : $(UBOOT_IMAGE) ; +BuildUBootFlashImage haiku_flash_image_uimage.img : haiku_loader.ub : $(UBOOT_IMAGE) ; SEARCH on [ FGristFiles text_menu.cpp ] = [ FDirName $(HAIKU_TOP) src system boot platform generic ] ; Added: haiku/trunk/src/system/boot/platform/u-boot/board/Jamfile =================================================================== --- haiku/trunk/src/system/boot/platform/u-boot/board/Jamfile 2009-08-09 15:38:41 UTC (rev 32213) +++ haiku/trunk/src/system/boot/platform/u-boot/board/Jamfile 2009-08-09 16:40:17 UTC (rev 32214) @@ -0,0 +1,6 @@ +SubDir HAIKU_TOP src system boot platform u-boot board ; + +if $(TARGET_BOOT_BOARD) { + SubInclude HAIKU_TOP src system boot platform $(TARGET_BOOT_PLATFORM) board $(TARGET_BOOT_BOARD) ; +} + Added: haiku/trunk/src/system/boot/platform/u-boot/board/overo/Jamfile =================================================================== --- haiku/trunk/src/system/boot/platform/u-boot/board/overo/Jamfile 2009-08-09 15:38:41 UTC (rev 32213) +++ haiku/trunk/src/system/boot/platform/u-boot/board/overo/Jamfile 2009-08-09 16:40:17 UTC (rev 32214) @@ -0,0 +1,4 @@ +SubDir HAIKU_TOP src system boot platform u-boot board $(TARGET_BOOT_BOARD) ; + +BOARD_UBOOT_LOADER_ADDRESS = 0x80008000 ; + Added: haiku/trunk/src/system/boot/platform/u-boot/board/verdex/Jamfile =================================================================== --- haiku/trunk/src/system/boot/platform/u-boot/board/verdex/Jamfile 2009-08-09 15:38:41 UTC (rev 32213) +++ haiku/trunk/src/system/boot/platform/u-boot/board/verdex/Jamfile 2009-08-09 16:40:17 UTC (rev 32214) @@ -0,0 +1,4 @@ +SubDir HAIKU_TOP src system boot platform u-boot board $(TARGET_BOOT_BOARD) ; + +BOARD_UBOOT_LOADER_ADDRESS = 0xa2000000 ; + From anevilyak at mail.berlios.de Sun Aug 9 19:04:27 2009 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Sun, 9 Aug 2009 19:04:27 +0200 Subject: [Haiku-commits] r32215 - haiku/trunk/src/apps/debugger/gui/team_window Message-ID: <200908091704.n79H4RpX032144@sheep.berlios.de> Author: anevilyak Date: 2009-08-09 19:04:17 +0200 (Sun, 09 Aug 2009) New Revision: 32215 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32215&view=rev Modified: haiku/trunk/src/apps/debugger/gui/team_window/SourceView.cpp haiku/trunk/src/apps/debugger/gui/team_window/SourceView.h Log: Factor out marker management into its own class and share an instance between the MarkerView and TextView. This allows the textview to also track all markers, and in turn make use of this information to highlight lines corresponding to breakpoints and/or the current instruction pointer. Modified: haiku/trunk/src/apps/debugger/gui/team_window/SourceView.cpp =================================================================== --- haiku/trunk/src/apps/debugger/gui/team_window/SourceView.cpp 2009-08-09 16:40:17 UTC (rev 32214) +++ haiku/trunk/src/apps/debugger/gui/team_window/SourceView.cpp 2009-08-09 17:04:17 UTC (rev 32215) @@ -71,27 +71,18 @@ }; -class SourceView::MarkerView : public BaseView { +class SourceView::MarkerManager { public: - MarkerView(SourceView* sourceView, Team* team, - Listener* listener, FontInfo* fontInfo); - ~MarkerView(); + MarkerManager(SourceView* sourceView, + Team* team, Listener* listener); - virtual void SetSourceCode(SourceCode* sourceCode); + void SetSourceCode(SourceCode* sourceCode); void SetStackTrace(StackTrace* stackTrace); void SetStackFrame(StackFrame* stackFrame); void UserBreakpointChanged(target_addr_t address); - virtual BSize MinSize(); - virtual BSize MaxSize(); - - virtual void Draw(BRect updateRect); - - virtual void MouseDown(BPoint where); - -private: struct Marker; struct InstructionPointerMarker; struct BreakpointMarker; @@ -101,14 +92,15 @@ typedef BObjectList MarkerList; typedef BObjectList BreakpointMarkerList; + void GetMarkers(uint32 minLine, uint32 maxLine, + MarkerList& markers); + BreakpointMarker* BreakpointMarkerAtLine(uint32 line); + private: void _InvalidateIPMarkers(); void _InvalidateBreakpointMarkers(); void _UpdateIPMarkers(); void _UpdateBreakpointMarkers(); - void _GetMarkers(uint32 minLine, uint32 maxLine, - MarkerList& markers); - BreakpointMarker* _BreakpointMarkerAtLine(uint32 line); // TODO: "public" to workaround a GCC2 problem: public: @@ -130,34 +122,67 @@ private: Team* fTeam; Listener* fListener; + SourceCode* fSourceCode; StackTrace* fStackTrace; StackFrame* fStackFrame; MarkerList fIPMarkers; BreakpointMarkerList fBreakpointMarkers; bool fIPMarkersValid; bool fBreakpointMarkersValid; + +}; + + +class SourceView::MarkerView : public BaseView { +public: + MarkerView(SourceView* sourceView, Team* team, + Listener* listener, MarkerManager *manager, + FontInfo* fontInfo); + ~MarkerView(); + + virtual void SetSourceCode(SourceCode* sourceCode); + + void SetStackTrace(StackTrace* stackTrace); + void SetStackFrame(StackFrame* stackFrame); + + void UserBreakpointChanged(target_addr_t address); + + virtual BSize MinSize(); + virtual BSize MaxSize(); + + virtual void Draw(BRect updateRect); + + virtual void MouseDown(BPoint where); + + +private: + Team* fTeam; + Listener* fListener; + MarkerManager* fMarkerManager; + StackTrace* fStackTrace; + StackFrame* fStackFrame; rgb_color fBreakpointOptionMarker; }; -struct SourceView::MarkerView::Marker { +struct SourceView::MarkerManager::Marker { Marker(uint32 line); virtual ~Marker(); inline uint32 Line() const; - virtual void Draw(MarkerView* view, BRect rect) = 0; + virtual void Draw(BView* view, BRect rect) = 0; private: uint32 fLine; }; -struct SourceView::MarkerView::InstructionPointerMarker : Marker { +struct SourceView::MarkerManager::InstructionPointerMarker : Marker { InstructionPointerMarker(uint32 line, bool topIP, bool currentIP); - virtual void Draw(MarkerView* view, BRect rect); + virtual void Draw(BView* view, BRect rect); private: void _DrawArrow(BView* view, BPoint tip, BSize size, @@ -170,14 +195,14 @@ }; -struct SourceView::MarkerView::BreakpointMarker : Marker { +struct SourceView::MarkerManager::BreakpointMarker : Marker { BreakpointMarker(uint32 line, target_addr_t address, bool enabled); target_addr_t Address() const { return fAddress; } bool IsEnabled() const { return fEnabled; } - virtual void Draw(MarkerView* view, BRect rect); + virtual void Draw(BView* view, BRect rect); private: target_addr_t fAddress; @@ -186,7 +211,7 @@ template -struct SourceView::MarkerView::MarkerByLinePredicate +struct SourceView::MarkerManager::MarkerByLinePredicate : UnaryPredicate { MarkerByLinePredicate(uint32 line) : @@ -207,9 +232,11 @@ class SourceView::TextView : public BaseView { public: TextView(SourceView* sourceView, + MarkerManager* manager, FontInfo* fontInfo); virtual void SetSourceCode(SourceCode* sourceCode); + void UserBreakpointChanged(target_addr_t address); virtual BSize MinSize(); virtual BSize MaxSize(); @@ -284,6 +311,7 @@ bool fSelectionMode; TrackingState fTrackState; BMessageRunner* fScrollRunner; + MarkerManager* fMarkerManager; }; @@ -300,6 +328,7 @@ { } + void SourceView::BaseView::SetSourceCode(SourceCode* sourceCode) { @@ -367,29 +396,29 @@ // #pragma mark - MarkerView::Marker -SourceView::MarkerView::Marker::Marker(uint32 line) +SourceView::MarkerManager::Marker::Marker(uint32 line) : fLine(line) { } -SourceView::MarkerView::Marker::~Marker() +SourceView::MarkerManager::Marker::~Marker() { } uint32 -SourceView::MarkerView::Marker::Line() const +SourceView::MarkerManager::Marker::Line() const { return fLine; } -// #pragma mark - MarkerView::InstructionPointerMarker +// #pragma mark - MarkerManager::InstructionPointerMarker -SourceView::MarkerView::InstructionPointerMarker::InstructionPointerMarker( +SourceView::MarkerManager::InstructionPointerMarker::InstructionPointerMarker( uint32 line, bool topIP, bool currentIP) : Marker(line), @@ -400,7 +429,7 @@ void -SourceView::MarkerView::InstructionPointerMarker::Draw(MarkerView* view, +SourceView::MarkerManager::InstructionPointerMarker::Draw(BView* view, BRect rect) { // Get the arrow color -- for the top IP, if current, we use blue, @@ -426,7 +455,7 @@ void -SourceView::MarkerView::InstructionPointerMarker::_DrawArrow(BView* view, +SourceView::MarkerManager::InstructionPointerMarker::_DrawArrow(BView* view, BPoint tip, BSize size, BSize base, const rgb_color& color, bool fill) { view->SetHighColor(color); @@ -454,10 +483,10 @@ } -// #pragma mark - MarkerView::BreakpointMarker +// #pragma mark - MarkerManager::BreakpointMarker -SourceView::MarkerView::BreakpointMarker::BreakpointMarker(uint32 line, +SourceView::MarkerManager::BreakpointMarker::BreakpointMarker(uint32 line, target_addr_t address, bool enabled) : Marker(line), @@ -468,7 +497,7 @@ void -SourceView::MarkerView::BreakpointMarker::Draw(MarkerView* view, BRect rect) +SourceView::MarkerManager::BreakpointMarker::Draw(BView* view, BRect rect) { float y = (rect.top + rect.bottom) / 2; view->SetHighColor((rgb_color){255, 0, 0, 255}); @@ -479,13 +508,12 @@ } -// #pragma mark - MarkerView +// #pragma mark - MarkerManager -SourceView::MarkerView::MarkerView(SourceView* sourceView, Team* team, - Listener* listener, FontInfo* fontInfo) +SourceView::MarkerManager::MarkerManager(SourceView* sourceView, Team* team, + Listener* listener) : - BaseView("source marker view", sourceView, fontInfo), fTeam(team), fListener(listener), fStackTrace(NULL), @@ -494,169 +522,50 @@ fBreakpointMarkers(20, true), fIPMarkersValid(false), fBreakpointMarkersValid(false) - { - rgb_color background = ui_color(B_PANEL_BACKGROUND_COLOR); - fBreakpointOptionMarker = tint_color(ui_color(B_PANEL_BACKGROUND_COLOR), - B_DARKEN_1_TINT); - SetViewColor(background); } -SourceView::MarkerView::~MarkerView() -{ -} - - void -SourceView::MarkerView::SetSourceCode(SourceCode* sourceCode) +SourceView::MarkerManager::SetSourceCode(SourceCode* sourceCode) { - _InvalidateIPMarkers(); - _InvalidateBreakpointMarkers(); - BaseView::SetSourceCode(sourceCode); + fSourceCode = sourceCode; } void -SourceView::MarkerView::SetStackTrace(StackTrace* stackTrace) +SourceView::MarkerManager::SetStackTrace(StackTrace* stackTrace) { fStackTrace = stackTrace; _InvalidateIPMarkers(); - Invalidate(); } void -SourceView::MarkerView::SetStackFrame(StackFrame* stackFrame) +SourceView::MarkerManager::SetStackFrame(StackFrame* stackFrame) { fStackFrame = stackFrame; _InvalidateIPMarkers(); - Invalidate(); } void -SourceView::MarkerView::UserBreakpointChanged(target_addr_t address) +SourceView::MarkerManager::UserBreakpointChanged(target_addr_t address) { _InvalidateBreakpointMarkers(); - Invalidate(); } -BSize -SourceView::MarkerView::MinSize() -{ - return BSize(40, TotalHeight()); -} - - -BSize -SourceView::MarkerView::MaxSize() -{ - return BSize(MinSize().width, B_SIZE_UNLIMITED); -} - void -SourceView::MarkerView::Draw(BRect updateRect) +SourceView::MarkerManager::_InvalidateIPMarkers() { - if (fSourceCode == NULL) - return; - - // get the lines intersecting with the update rect - int32 minLine, maxLine; - GetLineRange(updateRect, minLine, maxLine); - if (minLine > maxLine) - return; - - // get the markers in that range - MarkerList markers; - _GetMarkers(minLine, maxLine, markers); - - float width = Bounds().Width(); - - AutoLocker sourceLocker(fSourceCode); - - int32 markerIndex = 0; - for (int32 line = minLine; line <= maxLine; line++) { - bool drawBreakpointOptionMarker = true; - - Marker* marker; - while ((marker = markers.ItemAt(markerIndex)) != NULL - && marker->Line() == (uint32)line) { - marker->Draw(this, LineRect(line)); - drawBreakpointOptionMarker = false; - markerIndex++; - } - - if (!drawBreakpointOptionMarker) - continue; - - SourceLocation statementStart, statementEnd; - if (!fSourceCode->GetStatementLocationRange(SourceLocation(line), - statementStart, statementEnd) - || statementStart.Line() != line) { - continue; - } - - float y = ((float)line + 0.5f) * fFontInfo->lineHeight; - SetHighColor(fBreakpointOptionMarker); - FillEllipse(BPoint(width - 8, y), 2, 2); - } -} - - -void -SourceView::MarkerView::MouseDown(BPoint where) -{ - if (fSourceCode == NULL) - return; - - int32 line = LineAtOffset(where.y); - if (line < 0) - return; - - AutoLocker locker(fTeam); - Statement* statement; - if (fTeam->GetStatementAtSourceLocation(fSourceCode, - SourceLocation(line), statement) != B_OK) { - return; - } - Reference statementReference(statement, true); - if (statement->StartSourceLocation().Line() != line) - return; - - int32 modifiers; - if (Looper()->CurrentMessage()->FindInt32("modifiers", &modifiers) != B_OK) - modifiers = 0; - - BreakpointMarker* marker = _BreakpointMarkerAtLine(line); - target_addr_t address = marker != NULL - ? marker->Address() : statement->CoveringAddressRange().Start(); - - if ((modifiers & B_SHIFT_KEY) != 0) { - if (marker != NULL && !marker->IsEnabled()) - fListener->ClearBreakpointRequested(address); - else - fListener->SetBreakpointRequested(address, false); - } else { - if (marker != NULL && marker->IsEnabled()) - fListener->ClearBreakpointRequested(address); - else - fListener->SetBreakpointRequested(address, true); - } -} - - -void -SourceView::MarkerView::_InvalidateIPMarkers() -{ fIPMarkersValid = false; fIPMarkers.MakeEmpty(); } void -SourceView::MarkerView::_InvalidateBreakpointMarkers() +SourceView::MarkerManager::_InvalidateBreakpointMarkers() { fBreakpointMarkersValid = false; fBreakpointMarkers.MakeEmpty(); @@ -664,7 +573,7 @@ void -SourceView::MarkerView::_UpdateIPMarkers() +SourceView::MarkerManager::_UpdateIPMarkers() { if (fIPMarkersValid) return; @@ -688,7 +597,7 @@ Reference statementReference(statement, true); int32 line = statement->StartSourceLocation().Line(); - if (line < 0 || line >= LineCount()) + if (line < 0 || line >= fSourceCode->CountLines()) continue; if (sourceFile != NULL) { @@ -721,7 +630,7 @@ void -SourceView::MarkerView::_UpdateBreakpointMarkers() +SourceView::MarkerManager::_UpdateBreakpointMarkers() { if (fBreakpointMarkersValid) return; @@ -751,7 +660,7 @@ Reference statementReference(statement, true); int32 line = statement->StartSourceLocation().Line(); - if (line < 0 || line >= LineCount()) + if (line < 0 || line >= fSourceCode->CountLines()) continue; if (sourceFile != NULL) { @@ -779,7 +688,7 @@ void -SourceView::MarkerView::_GetMarkers(uint32 minLine, uint32 maxLine, +SourceView::MarkerManager::GetMarkers(uint32 minLine, uint32 maxLine, MarkerList& markers) { _UpdateIPMarkers(); @@ -816,8 +725,8 @@ } -SourceView::MarkerView::BreakpointMarker* -SourceView::MarkerView::_BreakpointMarkerAtLine(uint32 line) +SourceView::MarkerManager::BreakpointMarker* +SourceView::MarkerManager::BreakpointMarkerAtLine(uint32 line) { return fBreakpointMarkers.BinarySearchByKey(line, &_CompareLineBreakpointMarker); @@ -825,7 +734,7 @@ /*static*/ int -SourceView::MarkerView::_CompareMarkers(const Marker* a, +SourceView::MarkerManager::_CompareMarkers(const Marker* a, const Marker* b) { if (a->Line() < b->Line()) @@ -835,7 +744,7 @@ /*static*/ int -SourceView::MarkerView::_CompareBreakpointMarkers(const BreakpointMarker* a, +SourceView::MarkerManager::_CompareBreakpointMarkers(const BreakpointMarker* a, const BreakpointMarker* b) { if (a->Line() < b->Line()) @@ -846,7 +755,7 @@ template /*static*/ int -SourceView::MarkerView::_CompareLineMarkerTemplate(const uint32* line, +SourceView::MarkerManager::_CompareLineMarkerTemplate(const uint32* line, const MarkerType* marker) { if (*line < marker->Line()) @@ -856,7 +765,7 @@ /*static*/ int -SourceView::MarkerView::_CompareLineMarker(const uint32* line, +SourceView::MarkerManager::_CompareLineMarker(const uint32* line, const Marker* marker) { return _CompareLineMarkerTemplate(line, marker); @@ -864,17 +773,176 @@ /*static*/ int -SourceView::MarkerView::_CompareLineBreakpointMarker(const uint32* line, +SourceView::MarkerManager::_CompareLineBreakpointMarker(const uint32* line, const BreakpointMarker* marker) { return _CompareLineMarkerTemplate(line, marker); } +// #pragma mark - MarkerView + + +SourceView::MarkerView::MarkerView(SourceView* sourceView, Team* team, + Listener* listener, MarkerManager* manager, FontInfo* fontInfo) + : + BaseView("source marker view", sourceView, fontInfo), + fTeam(team), + fListener(listener), + fMarkerManager(manager), + fStackTrace(NULL), + fStackFrame(NULL) +{ + rgb_color background = ui_color(B_PANEL_BACKGROUND_COLOR); + fBreakpointOptionMarker = tint_color(ui_color(B_PANEL_BACKGROUND_COLOR), + B_DARKEN_1_TINT); + SetViewColor(background); +} + + +SourceView::MarkerView::~MarkerView() +{ +} + + +void +SourceView::MarkerView::SetSourceCode(SourceCode* sourceCode) +{ + BaseView::SetSourceCode(sourceCode); +} + + +void +SourceView::MarkerView::SetStackTrace(StackTrace* stackTrace) +{ + Invalidate(); +} + + +void +SourceView::MarkerView::SetStackFrame(StackFrame* stackFrame) +{ + Invalidate(); +} + + +void +SourceView::MarkerView::UserBreakpointChanged(target_addr_t address) +{ + Invalidate(); +} + + +BSize +SourceView::MarkerView::MinSize() +{ + return BSize(40, TotalHeight()); +} + + +BSize +SourceView::MarkerView::MaxSize() +{ + return BSize(MinSize().width, B_SIZE_UNLIMITED); +} + +void +SourceView::MarkerView::Draw(BRect updateRect) +{ + if (fSourceCode == NULL) + return; + + // get the lines intersecting with the update rect + int32 minLine, maxLine; + GetLineRange(updateRect, minLine, maxLine); + if (minLine > maxLine) + return; + + // get the markers in that range + SourceView::MarkerManager::MarkerList markers; + fMarkerManager->GetMarkers(minLine, maxLine, markers); + + float width = Bounds().Width(); + + AutoLocker sourceLocker(fSourceCode); + + int32 markerIndex = 0; + for (int32 line = minLine; line <= maxLine; line++) { + bool drawBreakpointOptionMarker = true; + + SourceView::MarkerManager::Marker* marker; + while ((marker = markers.ItemAt(markerIndex)) != NULL + && marker->Line() == (uint32)line) { + marker->Draw(this, LineRect(line)); + drawBreakpointOptionMarker = false; + markerIndex++; + } + + if (!drawBreakpointOptionMarker) + continue; + + SourceLocation statementStart, statementEnd; + if (!fSourceCode->GetStatementLocationRange(SourceLocation(line), + statementStart, statementEnd) + || statementStart.Line() != line) { + continue; + } + + float y = ((float)line + 0.5f) * fFontInfo->lineHeight; + SetHighColor(fBreakpointOptionMarker); + FillEllipse(BPoint(width - 8, y), 2, 2); + } +} + + +void +SourceView::MarkerView::MouseDown(BPoint where) +{ + if (fSourceCode == NULL) + return; + + int32 line = LineAtOffset(where.y); + if (line < 0) + return; + + AutoLocker locker(fTeam); + Statement* statement; + if (fTeam->GetStatementAtSourceLocation(fSourceCode, + SourceLocation(line), statement) != B_OK) { + return; + } + Reference statementReference(statement, true); + if (statement->StartSourceLocation().Line() != line) + return; + + int32 modifiers; + if (Looper()->CurrentMessage()->FindInt32("modifiers", &modifiers) != B_OK) + modifiers = 0; + + SourceView::MarkerManager::BreakpointMarker* marker = + fMarkerManager->BreakpointMarkerAtLine(line); + target_addr_t address = marker != NULL + ? marker->Address() : statement->CoveringAddressRange().Start(); + + if ((modifiers & B_SHIFT_KEY) != 0) { + if (marker != NULL && !marker->IsEnabled()) + fListener->ClearBreakpointRequested(address); + else + fListener->SetBreakpointRequested(address, false); + } else { + if (marker != NULL && marker->IsEnabled()) + fListener->ClearBreakpointRequested(address); + else + fListener->SetBreakpointRequested(address, true); + } +} + + // #pragma mark - TextView -SourceView::TextView::TextView(SourceView* sourceView, FontInfo* fontInfo) +SourceView::TextView::TextView(SourceView* sourceView, MarkerManager* manager, + FontInfo* fontInfo) : BaseView("source text view", sourceView, fontInfo), fMaxLineWidth(-1), @@ -887,7 +955,8 @@ fClickCount(0), fSelectionMode(false), fTrackState(kNotTracking), - fScrollRunner(NULL) + fScrollRunner(NULL), + fMarkerManager(manager) { SetViewColor(ui_color(B_DOCUMENT_BACKGROUND_COLOR)); fTextColor = ui_color(B_DOCUMENT_TEXT_COLOR); @@ -905,6 +974,13 @@ } +void +SourceView::TextView::UserBreakpointChanged(target_addr_t) +{ + Invalidate(); +} + + BSize SourceView::TextView::MinSize() { @@ -928,15 +1004,39 @@ // get the lines intersecting with the update rect int32 minLine, maxLine; GetLineRange(updateRect, minLine, maxLine); + SourceView::MarkerManager::MarkerList markers; + fMarkerManager->GetMarkers(minLine, maxLine, markers); // draw the affected lines SetHighColor(fTextColor); SetFont(&fFontInfo->font); + SourceView::MarkerManager::Marker* marker; + int32 markerIndex = 0; for (int32 i = minLine; i <= maxLine; i++) { + SetLowColor(ViewColor()); float y = (float)(i + 1) * fFontInfo->lineHeight - fFontInfo->fontHeight.descent; BString lineString; _FormatLine(fSourceCode->LineAt(i), lineString); + + for (int32 j = markerIndex; j < markers.CountItems(); j++) { + marker = markers.ItemAt(j); + if (marker->Line() < (uint32)i) { + ++markerIndex; + continue; + } else if (marker->Line() == (uint32)i) { + ++markerIndex; + if (dynamic_cast(marker) != NULL) + SetLowColor(96, 216, 216, 255); + else + SetLowColor(255, 255, 0, 255); + FillRect(BRect(kLeftTextMargin, y - fFontInfo->lineHeight, + Bounds().right, y), B_SOLID_LOW); + break; + } else + break; + } DrawString(lineString, BPoint(kLeftTextMargin, y)); } @@ -1575,6 +1675,7 @@ return; if (fStackTrace != NULL) { + fMarkerManager->SetStackTrace(NULL); fMarkerView->SetStackTrace(NULL); fStackTrace->RemoveReference(); } @@ -1584,7 +1685,9 @@ if (fStackTrace != NULL) fStackTrace->AddReference(); + fMarkerManager->SetStackTrace(fStackTrace); fMarkerView->SetStackTrace(fStackTrace); + fTextView->Invalidate(); } @@ -1595,6 +1698,7 @@ return; if (fStackFrame != NULL) { + fMarkerManager->SetStackFrame(NULL); fMarkerView->SetStackFrame(NULL); fStackFrame->RemoveReference(); } @@ -1604,7 +1708,9 @@ if (fStackFrame != NULL) fStackFrame->AddReference(); + fMarkerManager->SetStackFrame(fStackFrame); fMarkerView->SetStackFrame(fStackFrame); + fTextView->Invalidate(); if (fStackFrame != NULL) ScrollToAddress(fStackFrame->InstructionPointer()); @@ -1619,6 +1725,7 @@ return; if (fSourceCode != NULL) { + fMarkerManager->SetSourceCode(NULL); fTextView->SetSourceCode(NULL); fMarkerView->SetSourceCode(NULL); fSourceCode->RemoveReference(); @@ -1629,6 +1736,7 @@ if (fSourceCode != NULL) fSourceCode->AddReference(); + fMarkerManager->SetSourceCode(fSourceCode); fTextView->SetSourceCode(fSourceCode); fMarkerView->SetSourceCode(fSourceCode); _UpdateScrollBars(); @@ -1641,7 +1749,9 @@ void SourceView::UserBreakpointChanged(target_addr_t address) { + fMarkerManager->UserBreakpointChanged(address); fMarkerView->UserBreakpointChanged(address); + fTextView->UserBreakpointChanged(address); } @@ -1764,8 +1874,10 @@ void SourceView::_Init() { - AddChild(fMarkerView = new MarkerView(this, fTeam, fListener, &fFontInfo)); - AddChild(fTextView = new TextView(this, &fFontInfo)); + fMarkerManager = new MarkerManager(this, fTeam, fListener); + AddChild(fMarkerView = new MarkerView(this, fTeam, fListener, + fMarkerManager, &fFontInfo)); + AddChild(fTextView = new TextView(this, fMarkerManager, &fFontInfo)); } Modified: haiku/trunk/src/apps/debugger/gui/team_window/SourceView.h =================================================================== --- haiku/trunk/src/apps/debugger/gui/team_window/SourceView.h 2009-08-09 16:40:17 UTC (rev 32214) +++ haiku/trunk/src/apps/debugger/gui/team_window/SourceView.h 2009-08-09 17:04:17 UTC (rev 32215) @@ -53,6 +53,7 @@ private: class BaseView; + class MarkerManager; class MarkerView; class TextView; @@ -72,6 +73,7 @@ StackTrace* fStackTrace; StackFrame* fStackFrame; SourceCode* fSourceCode; + MarkerManager* fMarkerManager; MarkerView* fMarkerView; TextView* fTextView; FontInfo fFontInfo; From mmlr at mail.berlios.de Sun Aug 9 19:39:07 2009 From: mmlr at mail.berlios.de (mmlr at mail.berlios.de) Date: Sun, 9 Aug 2009 19:39:07 +0200 Subject: [Haiku-commits] r32216 - haiku/trunk/src/system/kernel/arch/x86 Message-ID: <200908091739.n79Hd7hW022776@sheep.berlios.de> Author: mmlr Date: 2009-08-09 19:39:05 +0200 (Sun, 09 Aug 2009) New Revision: 32216 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32216&view=rev Modified: haiku/trunk/src/system/kernel/arch/x86/arch_thread.cpp Log: The reference of the currently active translation map shouldn't be released until the data it protects isn't in active use anymore. Previously it would release the translation map and therefore the page directory reference while the page dir was still set on the CPU, as only the actual call to i386_context_switch() will replace the page directory in the control register. This didn't cause any harm though, as during the context switch interrupts are disabled and therefore the page directory would only be deferred_delete()ed and not directly freed/overwritten. Still this is logically more correct. Modified: haiku/trunk/src/system/kernel/arch/x86/arch_thread.cpp =================================================================== --- haiku/trunk/src/system/kernel/arch/x86/arch_thread.cpp 2009-08-09 17:04:17 UTC (rev 32215) +++ haiku/trunk/src/system/kernel/arch/x86/arch_thread.cpp 2009-08-09 17:39:05 UTC (rev 32216) @@ -384,17 +384,21 @@ atomic_or(&toMap->active_on_cpus, (uint32)1 << cpu); // assign the new map to the CPU - activeMap->RemoveReference(); toMap->AddReference(); cpuData->arch.active_translation_map = toMap; // get the new page directory newPageDirectory = (addr_t)toMap->pgdir_phys; - } else + } else { + activeMap = NULL; newPageDirectory = 0; + } gX86SwapFPUFunc(from->arch_info.fpu_state, to->arch_info.fpu_state); i386_context_switch(&from->arch_info, &to->arch_info, newPageDirectory); + + if (activeMap != NULL) + activeMap->RemoveReference(); } From axeld at pinc-software.de Sun Aug 9 20:32:04 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Sun, 09 Aug 2009 20:32:04 +0200 CEST Subject: [Haiku-commits] r32212 - haiku/trunk/src/servers/app In-Reply-To: <200908091526.n79FQlwP024385@sheep.berlios.de> Message-ID: <1387161399-BeMail@zon> rudolfc at mail.berlios.de wrote: > Remark: Haiku's screen preflet refuses to set modes once a virtual > screen is set > since it doesn't recognize the currently set mode. I guess that could > be fixed. How do I play with the virtual screen things? I wanted to have another look at the intel_extreme driver with this in mind, so I could then also fix any ill-doings in Screen. BTW, your changes look just fine :-) Bye, Axel. From axeld at pinc-software.de Sun Aug 9 20:54:47 2009 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Sun, 09 Aug 2009 20:54:47 +0200 CEST Subject: [Haiku-commits] r32206 - haiku/trunk/src/apps/diskusage In-Reply-To: <200908080853.n788rcPq000156@sheep.berlios.de> Message-ID: <2750380945-BeMail@zon> stippi at mail.berlios.de wrote: > Log: > Replaced duplicated DriveSetup icon with zuMi's DiskUsage icon. > According to > a Trac comment, Ryan prefers it. Another argument pro zuMi's version > is that > it is a bit more neutral, since DiskUsage can be invoked on folders, > not just > entire disks. Maybe a balance ("weighing machine"?) would also server as a good base for DiskUsage - I haven't looked at this one, yet, though, just as a general idea. Bye, Axel. From rudolf.cornelissen at gmail.com Sun Aug 9 21:33:59 2009 From: rudolf.cornelissen at gmail.com (Rudolf Cornelissen) Date: Sun, 9 Aug 2009 19:33:59 +0000 Subject: [Haiku-commits] r32212 - haiku/trunk/src/servers/app In-Reply-To: <1387161399-BeMail@zon> References: <200908091526.n79FQlwP024385@sheep.berlios.de> <1387161399-BeMail@zon> Message-ID: Hi Axel, Playing with a virtual mode (workspace resolution > screen resolution works very nice if there's hardware cursor support: if that's used the driver will automatically pan and scroll around the workspace following the mouse. Of course that could also be done with a soft cursor but then the app_Server would need to call the accelerant giving it the new coordinates via some (new?) hook. I just tested with a (nvidia/matrox) card and dualhead setup: if you set a dualhead (not clone) mode the workspace is twice as wide as the screen: the Haiku preflet then does nolonger work (all modes greyed out). The cursor doesn't have to be followed by the driver in such a mode since it's always visible (left or right screen). Unless of course you'd set a mode that has a virtual resolution above twice the screen: in that case (with a hardcursor) the driver lets both screens follow the mousecursor. I always tested this using a small command line tool I 'wrote' called virtualscreen (wich btw works on haiku now). I could very nicely find out the hardware granularity and max sizes for setting (virtual) screens with that. It was kind of cool having a workspace of above 10.000 by 10.000 pixels ;-) Good to know you're OK with the changes. Thanks! Rudolf. On Sun, Aug 9, 2009 at 6:32 PM, Axel D?rfler wrote: > rudolfc at mail.berlios.de wrote: > > Remark: Haiku's screen preflet refuses to set modes once a virtual > > screen is set > > since it doesn't recognize the currently set mode. I guess that could > > be fixed. > > How do I play with the virtual screen things? I wanted to have another > look at the intel_extreme driver with this in mind, so I could then > also fix any ill-doings in Screen. > > BTW, your changes look just fine :-) > > Bye, > Axel. > > _______________________________________________ > Haiku-commits mailing list > Haiku-commits at lists.berlios.de > https://lists.berlios.de/mailman/listinfo/haiku-commits > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mmlr at mail.berlios.de Sun Aug 9 21:54:47 2009 From: mmlr at mail.berlios.de (mmlr at mail.berlios.de) Date: Sun, 9 Aug 2009 21:54:47 +0200 Subject: [Haiku-commits] r32217 - haiku/trunk/src/system/kernel/arch/x86 Message-ID: <200908091954.n79JslQC010913@sheep.berlios.de> Author: mmlr Date: 2009-08-09 21:54:41 +0200 (Sun, 09 Aug 2009) New Revision: 32217 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32217&view=rev Modified: haiku/trunk/src/system/kernel/arch/x86/arch_vm_translation_map.cpp Log: Adding a disabled debug helper. Modified: haiku/trunk/src/system/kernel/arch/x86/arch_vm_translation_map.cpp =================================================================== --- haiku/trunk/src/system/kernel/arch/x86/arch_vm_translation_map.cpp 2009-08-09 17:39:05 UTC (rev 32216) +++ haiku/trunk/src/system/kernel/arch/x86/arch_vm_translation_map.cpp 2009-08-09 19:54:41 UTC (rev 32217) @@ -192,6 +192,15 @@ sTMapList.Remove(this); locker.Unlock(); +#if 0 + // this sanity check can be enabled when corruption due to + // overwriting an active page directory is suspected + addr_t activePageDirectory; + read_cr3(activePageDirectory); + if (activePageDirectory == (addr_t)pgdir_phys) + panic("deleting a still active page directory\n"); +#endif + if (are_interrupts_enabled()) delete this; else From kirilla at mail.berlios.de Mon Aug 10 02:31:35 2009 From: kirilla at mail.berlios.de (kirilla at BerliOS) Date: Mon, 10 Aug 2009 02:31:35 +0200 Subject: [Haiku-commits] r32218 - haiku/trunk/src/apps/screenshot Message-ID: <200908100031.n7A0VZ03004478@sheep.berlios.de> Author: kirilla Date: 2009-08-10 02:31:34 +0200 (Mon, 10 Aug 2009) New Revision: 32218 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32218&view=rev Modified: haiku/trunk/src/apps/screenshot/ScreenshotWindow.cpp haiku/trunk/src/apps/screenshot/ScreenshotWindow.h Log: Working but somewhat dodgy tab space transparency - for humdinger as per request #3813. Enjoy! Modified: haiku/trunk/src/apps/screenshot/ScreenshotWindow.cpp =================================================================== --- haiku/trunk/src/apps/screenshot/ScreenshotWindow.cpp 2009-08-09 19:54:41 UTC (rev 32217) +++ haiku/trunk/src/apps/screenshot/ScreenshotWindow.cpp 2009-08-10 00:31:34 UTC (rev 32218) @@ -88,6 +88,7 @@ fOutputPathPanel(NULL), fLastSelectedPath(NULL), fDelay(delay), + fTabHeight(0), fIncludeBorder(includeBorder), fIncludeMouse(includeMouse), fGrabActiveWindow(grabActiveWindow), @@ -639,8 +640,10 @@ BRect frame; delete fScreenshot; if (_GetActiveWindowFrame(&frame) == B_OK) { - fScreenshot = new BBitmap(frame.OffsetToCopy(B_ORIGIN), B_RGBA32); + fScreenshot = new BBitmap(frame.OffsetToCopy(B_ORIGIN), B_RGBA32, true); BScreen(this).ReadBitmap(fScreenshot, fIncludeMouse, &frame); + if (fIncludeBorder) + _MakeTabSpaceTransparent(); } else { BScreen(this).GetBitmap(&fScreenshot, fIncludeMouse); } @@ -674,6 +677,7 @@ float border = (windowInfo->border_size); frame->InsetBy(-(border), -(border)); frame->top -= windowInfo->tab_height; + fTabHeight = windowInfo->tab_height; } free(windowInfo); @@ -784,3 +788,102 @@ fScreenshot->Bits(), fScreenshot->BitsLength(), fScreenshot->BytesPerRow()); } + + +void +ScreenshotWindow::_MakeTabSpaceTransparent() +{ + if (fScreenshot->ColorSpace() != B_RGBA32) + return; + + if (fTabHeight == 0) + return; + + // This method is fragile since it relies on the color scheme of the current + // window decorator. The code could be simplified a lot if there was a way + // to ask for, or to easily compute, the tab width of the target window. + + uint8* component = static_cast(fScreenshot->Bits()); + int32 bytesPerRow = fScreenshot->BytesPerRow(); + int32 pixelsPerRow = bytesPerRow / 4; + + int32 tabHeight = static_cast(fTabHeight); + int32 tabStart = 0; + int32 tabEnd = 0; + bool foundTabStart = false; + bool foundTabEnd = false; + + // Find the top-left corner of the window tab, by color, and support + // this guess by following a one tab high column of pixels downwards. + for (int32 x = 0; x < pixelsPerRow; x++) { + if (component[0] == 152 && component[1] == 152 && component[2] == 152) { + foundTabStart = true; + + for (int32 y = 0; y < tabHeight; y++) { + component += bytesPerRow; + + if (!(component[0] == 152 && component[1] == 152 + && component[2] == 152)) { + foundTabStart = false; + } + } + component -= bytesPerRow * tabHeight; + + if (foundTabStart) { + tabStart = x; + break; + } + } + component += 4; + } + + component = static_cast(fScreenshot->Bits()); + + // Find the top-right corner of the window tab. + for (int32 x = 0; x < pixelsPerRow; x++) { + if (component[0] == 108 && component[1] == 108 && component[2] == 108) { + foundTabEnd = true; + + for (int32 y = 0; y < tabHeight; y++) { + component += bytesPerRow; + + if (!(component[0] == 108 && component[1] == 108 + && component[2] == 108)) { + foundTabEnd = false; + } + } + component -= bytesPerRow * tabHeight; + + if (foundTabEnd) { + tabEnd = x; + break; + } + } + component += 4; + } + + if (!foundTabEnd || !foundTabStart) + return; + + if (tabStart > tabEnd) + return; + + BView view(fScreenshot->Bounds(), "bitmapView", B_FOLLOW_ALL_SIDES, 0); + fScreenshot->AddChild(&view); + if(view.Looper() && view.Looper()->Lock()) { + view.SetDrawingMode(B_OP_COPY); + view.SetHighColor(B_TRANSPARENT_32_BIT); + + if (tabStart > 0) + view.FillRect(BRect(0, 0, tabStart - 1, tabHeight - 1)); + + if (tabEnd < pixelsPerRow - 1) { + view.FillRect(BRect(tabEnd + 1, 0, pixelsPerRow - 1, + tabHeight - 1)); + } + view.Sync(); + view.Looper()->Unlock(); + } + fScreenshot->RemoveChild(&view); +} + Modified: haiku/trunk/src/apps/screenshot/ScreenshotWindow.h =================================================================== --- haiku/trunk/src/apps/screenshot/ScreenshotWindow.h 2009-08-09 19:54:41 UTC (rev 32217) +++ haiku/trunk/src/apps/screenshot/ScreenshotWindow.h 2009-08-10 00:31:34 UTC (rev 32218) @@ -53,6 +53,7 @@ void _TakeScreenshot(); status_t _GetActiveWindowFrame(BRect* frame); + void _MakeTabSpaceTransparent(); status_t _SaveScreenshot(); void _SaveScreenshotSilent() const; @@ -74,6 +75,7 @@ BMenuItem* fLastSelectedPath; bigtime_t fDelay; + float fTabHeight; bool fIncludeBorder; bool fIncludeMouse; From kirilla at mail.berlios.de Mon Aug 10 03:26:15 2009 From: kirilla at mail.berlios.de (kirilla at BerliOS) Date: Mon, 10 Aug 2009 03:26:15 +0200 Subject: [Haiku-commits] r32219 - haiku/trunk/src/servers/cddb_daemon Message-ID: <200908100126.n7A1QFdZ015564@sheep.berlios.de> Author: kirilla Date: 2009-08-10 03:26:14 +0200 (Mon, 10 Aug 2009) New Revision: 32219 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32219&view=rev Modified: haiku/trunk/src/servers/cddb_daemon/cddb_daemon.cpp Log: Strip slash character from cddb data before attempting to rename volume and files. Continue in spite of file errors. Modified: haiku/trunk/src/servers/cddb_daemon/cddb_daemon.cpp =================================================================== --- haiku/trunk/src/servers/cddb_daemon/cddb_daemon.cpp 2009-08-10 00:31:34 UTC (rev 32218) +++ haiku/trunk/src/servers/cddb_daemon/cddb_daemon.cpp 2009-08-10 01:26:14 UTC (rev 32219) @@ -214,7 +214,11 @@ BVolume volume(device); status_t result; + status_t error = B_OK; + BString name = diskData->artist << " - " << diskData->title; + name.ReplaceSet("/", " "); + if ((result = volume.SetName(name.String())) != B_OK) { printf("Can't set volume name.\n"); return result; @@ -225,15 +229,20 @@ volume.GetRootDirectory(&cddaRoot); BEntry entry; - int cnt = 0; + int index = 0; while (cddaRoot.GetNextEntry(&entry) == B_OK) { - TrackData* data = (TrackData*)((readResponse->tracks).ItemAt(cnt)); + TrackData* data = (TrackData*)((readResponse->tracks).ItemAt(index)); // Update name. - if ((result = entry.Rename((data->title).String())) != B_OK) { - // Failed renaming one entry. Abort processing. - printf("Failed renaming entry at index %d. Aborting.\n", cnt); - return result; + name = data->title; + name.ReplaceSet("/", " "); + + if ((result = entry.Rename(name.String())) != B_OK) { + printf("Failed renaming entry at index %d to \"%s\".\n", index, + name.String()); + error = result; + // User can benefit from continuing through all tracks. + // Report error later. } // Add relevant attributes. We consider an error here as non-fatal. @@ -258,10 +267,10 @@ (data->artist).String(), (data->artist).Length()); } - cnt++; + index++; } - return B_OK; + return error; } From leavengood at gmail.com Mon Aug 10 07:44:22 2009 From: leavengood at gmail.com (Ryan Leavengood) Date: Mon, 10 Aug 2009 01:44:22 -0400 Subject: [Haiku-commits] r32218 - haiku/trunk/src/apps/screenshot In-Reply-To: <200908100031.n7A0VZ03004478@sheep.berlios.de> References: <200908100031.n7A0VZ03004478@sheep.berlios.de> Message-ID: On Sun, Aug 9, 2009 at 8:31 PM, kirilla at BerliOS wrote: > > Working but somewhat dodgy tab space transparency - for humdinger as per request #3813. Enjoy! :) This is definitely just asking to be broken, though it is something I've wanted too. There is in fact now a GetDecoratorSettings() method in BWindow which returns a BMessage which contains a BRect called "tab frame" which you might find useful. Of course this may all be moot since you cannot really get that remotely at the moment. But maybe "Tab Frame" could be added as a specifier to BWindow (only a GET property since only the tab location in decorator settings is settable.) -- Regards, Ryan From humdingerb at googlemail.com Mon Aug 10 07:49:14 2009 From: humdingerb at googlemail.com (Humdinger) Date: Mon, 10 Aug 2009 07:49:14 +0200 Subject: [Haiku-commits] r32218 - haiku/trunk/src/apps/screenshot In-Reply-To: <200908100031.n7A0VZ03004478@sheep.berlios.de> References: <200908100031.n7A0VZ03004478@sheep.berlios.de> Message-ID: <4A7FB4DA.3020302@googlemail.com> kirilla at BerliOS wrote: > Modified: > haiku/trunk/src/apps/screenshot/ScreenshotWindow.cpp > haiku/trunk/src/apps/screenshot/ScreenshotWindow.h > Log: > Working but somewhat dodgy tab space transparency - for humdinger as per request #3813. Enjoy! Wow! Thanks, that's a really nice feature! I only wish I had mentioned that a few days earlier, before doing all cut-outs of dozens of screenshots by hand... :) If I could lure you to BeGeistert, you'd have a beer on me. :) Regards, Humdinger -- --=-=--=-=--=-=--=-=--=-=--=-=--=-=--=-=--=-=--=- Deutsche Haiku News @ http://www.haiku-gazette.de From humdingerb at mail.berlios.de Mon Aug 10 10:07:49 2009 From: humdingerb at mail.berlios.de (humdingerb at mail.berlios.de) Date: Mon, 10 Aug 2009 10:07:49 +0200 Subject: [Haiku-commits] r32220 - haiku/trunk/src/apps/deskbar Message-ID: <200908100807.n7A87n50005783@sheep.berlios.de> Author: humdingerb Date: 2009-08-10 10:07:47 +0200 (Mon, 10 Aug 2009) New Revision: 32220 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32220&view=rev Modified: haiku/trunk/src/apps/deskbar/BarApp.cpp haiku/trunk/src/apps/deskbar/BeMenu.cpp Log: Renamed 'Configure Leaf Menu...' to 'Configure Deskbar Menu...' Modified: haiku/trunk/src/apps/deskbar/BarApp.cpp =================================================================== --- haiku/trunk/src/apps/deskbar/BarApp.cpp 2009-08-10 01:26:14 UTC (rev 32219) +++ haiku/trunk/src/apps/deskbar/BarApp.cpp 2009-08-10 08:07:47 UTC (rev 32220) @@ -705,7 +705,7 @@ fConfigWindow = new TFavoritesConfigWindow(BRect(0, 0, 320, 240), #ifdef __HAIKU__ - "Configure Leaf Menu", false, B_ANY_NODE, + "Configure Deskbar Menu", false, B_ANY_NODE, #else "Configure Be Menu", false, B_ANY_NODE, #endif Modified: haiku/trunk/src/apps/deskbar/BeMenu.cpp =================================================================== --- haiku/trunk/src/apps/deskbar/BeMenu.cpp 2009-08-10 01:26:14 UTC (rev 32219) +++ haiku/trunk/src/apps/deskbar/BeMenu.cpp 2009-08-10 08:07:47 UTC (rev 32220) @@ -260,7 +260,7 @@ subMenu->SetEnabled(!dragging); #ifdef __HAIKU__ - item = new BMenuItem("Configure Leaf Menu"B_UTF8_ELLIPSIS, new BMessage(msg_config_db)); + item = new BMenuItem("Configure Deskbar Menu"B_UTF8_ELLIPSIS, new BMessage(msg_config_db)); #else item = new BMenuItem("Configure Be Menu"B_UTF8_ELLIPSIS, new BMessage(msg_config_db)); #endif From humdingerb at mail.berlios.de Mon Aug 10 10:20:20 2009 From: humdingerb at mail.berlios.de (humdingerb at mail.berlios.de) Date: Mon, 10 Aug 2009 10:20:20 +0200 Subject: [Haiku-commits] r32221 - in haiku/trunk/docs: . userguide/en userguide/en/applications userguide/en/desktop-applets userguide/en/images userguide/en/images/apps-images userguide/en/images/attributes-images userguide/en/images/deskbar-images userguide/en/images/desktop-applets-images userguide/en/images/filesystem-layout-images userguide/en/images/filetypes-images userguide/en/images/gui-images userguide/en/images/installation-images userguide/en/images/prefs-images userguide/en/images/queries-images userguide/en/images/teammonitor-images userguide/en/images/tracker-images userguide/en/images/workshop-filetypes+attributes-images userguide/en/images/workspaces-images userguide/en/preferences userguide/images userguide/images/apps-images userguide/images/bootloader-images userguide/images/deskbar-images userguide/images/desktop-applets-images userguide/images/prefs-images userguide/images/twitcher-images welcome/images Message-ID: <200908100820.n7A8KK9K006774@sheep.berlios.de> Author: humdingerb Date: 2009-08-10 10:18:39 +0200 (Mon, 10 Aug 2009) New Revision: 32221 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=32221&view=rev Removed: haiku/trunk/docs/userguide/en/images/twitcher-images/ Modified: haiku/trunk/docs/Haiku-doc.css haiku/trunk/docs/userguide/en/applications/apps-icon-o-matic.html haiku/trunk/docs/userguide/en/applications/apps-terminal.html haiku/trunk/docs/userguide/en/attributes.html haiku/trunk/docs/userguide/en/desktop-applets/desktop-applets-launchbox.html haiku/trunk/docs/userguide/en/gui.html haiku/trunk/docs/userguide/en/images/apps-images/activitymonitor.png haiku/trunk/docs/userguide/en/images/apps-images/cdplayer.png haiku/trunk/docs/userguide/en/images/apps-images/charactermap.png haiku/trunk/docs/userguide/en/images/apps-images/codycam.png haiku/trunk/docs/userguide/en/images/apps-images/diskprobe-about-attr.png haiku/trunk/docs/userguide/en/images/apps-images/diskprobe.png haiku/trunk/docs/userguide/en/images/apps-images/diskusage.png haiku/trunk/docs/userguide/en/images/apps-images/expander-preferences.png haiku/trunk/docs/userguide/en/images/apps-images/expander.png haiku/trunk/docs/userguide/en/images/apps-images/i-o-m-gradients.png haiku/trunk/docs/userguide/en/images/apps-images/i-o-m-overview.png haiku/trunk/docs/userguide/en/images/apps-images/people-files.png haiku/trunk/docs/userguide/en/images/apps-images/people.png haiku/trunk/docs/userguide/en/images/apps-images/poorman.png haiku/trunk/docs/userguide/en/images/apps-images/screenshot-options.png haiku/trunk/docs/userguide/en/images/apps-images/screenshot.png haiku/trunk/docs/userguide/en/images/apps-images/stylededit.png haiku/trunk/docs/userguide/en/images/apps-images/terminal.png haiku/trunk/docs/userguide/en/images/attributes-images/people.png haiku/trunk/docs/userguide/en/images/deskbar-images/calendar.png haiku/trunk/docs/userguide/en/images/deskbar-images/configure.png haiku/trunk/docs/userguide/en/images/deskbar-images/list-of-apps.png haiku/trunk/docs/userguide/en/images/deskbar-images/settings.png haiku/trunk/docs/userguide/en/images/desktop-applets-images/launchbox.png haiku/trunk/docs/userguide/en/images/filesystem-layout-images/achtung-system.png haiku/trunk/docs/userguide/en/images/filesystem-layout-images/achtung-user.png haiku/trunk/docs/userguide/en/images/filetypes-images/filetype-addon-stylededit.png haiku/trunk/docs/userguide/en/images/filetypes-images/filetype-addon.png haiku/trunk/docs/userguide/en/images/gui-images/favorites.png haiku/trunk/docs/userguide/en/images/gui-images/gui.png haiku/trunk/docs/userguide/en/images/gui-images/open-save.png haiku/trunk/docs/userguide/en/images/installation-images/macosx.png haiku/trunk/docs/userguide/en/images/prefs-images/appearance-antialiasing.png haiku/trunk/docs/userguide/en/images/prefs-images/appearance-colors.png haiku/trunk/docs/userguide/en/images/prefs-images/datatranslations.png haiku/trunk/docs/userguide/en/images/prefs-images/e-mail-filter-header.png haiku/trunk/docs/userguide/en/images/prefs-images/e-mail-filter-spam.png haiku/trunk/docs/userguide/en/images/prefs-images/e-mail-in.png haiku/trunk/docs/userguide/en/images/prefs-images/e-mail-mailbox.png haiku/trunk/docs/userguide/en/images/prefs-images/e-mail-new-account.png haiku/trunk/docs/userguide/en/images/prefs-images/e-mail-out.png haiku/trunk/docs/userguide/en/images/prefs-images/e-mail-settings.png haiku/trunk/docs/userguide/en/images/prefs-images/fonts.png haiku/trunk/docs/userguide/en/images/prefs-images/keyboard.png haiku/trunk/docs/userguide/en/images/prefs-images/keymap.png haiku/trunk/docs/userguide/en/images/prefs-images/menu.png haiku/trunk/docs/userguide/en/images/prefs-images/mouse.png haiku/trunk/docs/userguide/en/images/prefs-images/network.png haiku/trunk/docs/userguide/en/images/prefs-images/screen.png haiku/trunk/docs/userguide/en/images/prefs-images/screensaver-fade.png haiku/trunk/docs/userguide/en/images/prefs-images/screensaver-modules.png haiku/trunk/docs/userguide/en/images/prefs-images/sounds.png haiku/trunk/docs/userguide/en/images/prefs-images/time-time.png haiku/trunk/docs/userguide/en/images/prefs-images/time-timezone.png haiku/trunk/docs/userguide/en/images/prefs-images/virtualmemory.png haiku/trunk/docs/userguide/en/images/queries-images/basic-query.png haiku/trunk/docs/userguide/en/images/queries-images/formula-query.png haiku/trunk/docs/userguide/en/images/queries-images/query-window-filled.png haiku/trunk/docs/userguide/en/images/queries-images/query-window.png haiku/trunk/docs/userguide/en/images/queries-images/result-window.png haiku/trunk/docs/userguide/en/images/teammonitor-images/teammonitor.png haiku/trunk/docs/userguide/en/images/tracker-images/drill-down.png haiku/trunk/docs/userguide/en/images/tracker-images/get-info.png haiku/trunk/docs/userguide/en/images/tracker-images/mount-settings.png haiku/trunk/docs/userguide/en/images/tracker-images/new-menu.png haiku/trunk/docs/userguide/en/images/tracker-images/open-with-preferred.png haiku/trunk/docs/userguide/en/images/tracker-images/open-with.png haiku/trunk/docs/userguide/en/images/tracker-images/tracker-preferences-navigator.png haiku/trunk/docs/userguide/en/images/tracker-images/transaction-status.png haiku/trunk/docs/userguide/en/images/tracker-images/window-drill-down.png haiku/trunk/docs/userguide/en/images/tracker-images/window-menu.png haiku/trunk/docs/userguide/en/images/tracker-images/window-type-ahead.png haiku/trunk/docs/userguide/en/images/workshop-filetypes+attributes-images/filetype-extra-attribute.png haiku/trunk/docs/userguide/en/images/workshop-filetypes+attributes-images/filetypes-dvddb-empty.png haiku/trunk/docs/userguide/en/images/workshop-filetypes+attributes-images/filetypes-dvddb.png haiku/trunk/docs/userguide/en/images/workshop-filetypes+attributes-images/filetypes-new-file-type.png haiku/trunk/docs/userguide/en/images/workshop-filetypes+attributes-images/query-dvddb.png haiku/trunk/docs/userguide/en/images/workspaces-images/workspaces.png haiku/trunk/docs/userguide/en/keyboard-shortcuts.html haiku/trunk/docs/userguide/en/preferences/prefs-screen.html haiku/trunk/docs/userguide/en/tracker.html haiku/trunk/docs/userguide/en/workspaces.html haiku/trunk/docs/userguide/images/alert_info_32.png haiku/trunk/docs/userguide/images/alert_info_64.png haiku/trunk/docs/userguide/images/alert_stop_32.png haiku/trunk/docs/userguide/images/alert_stop_64.png haiku/trunk/docs/userguide/images/alert_warning_64.png haiku/trunk/docs/userguide/images/apps-images/activitymonitor-icon_32.png haiku/trunk/docs/userguide/images/apps-images/activitymonitor-icon_64.png haiku/trunk/docs/userguide/images/apps-images/bepdf-icon_32.png haiku/trunk/docs/userguide/images/apps-images/bepdf-icon_64.png haiku/trunk/docs/userguide/images/apps-images/bezillabrowser-icon_32.png haiku/trunk/docs/userguide/images/apps-images/bezillabrowser-icon_64.png haiku/trunk/docs/userguide/images/apps-images/cdplayer-icon_32.png haiku/trunk/docs/userguide/images/apps-images/cdplayer-icon_64.png haiku/trunk/docs/userguide/images/apps-images/charactermap-icon_32.png haiku/trunk/docs/userguide/images/apps-images/charactermap-icon_64.png haiku/trunk/docs/userguide/images/apps-images/codycam-icon_32.png haiku/trunk/docs/userguide/images/apps-images/codycam-icon_64.png haiku/trunk/docs/userguide/images/apps-images/deskcalc-icon_16.png haiku/trunk/docs/userguide/images/apps-images/deskcalc-icon_32.png haiku/trunk/docs/userguide/images/apps-images/deskcalc-icon_64.png haiku/trunk/docs/userguide/images/apps-images/deskcalc.png haiku/trunk/docs/userguide/images/apps-images/diskprobe-icon_32.png haiku/trunk/docs/userguide/images/apps-images/diskprobe-icon_64.png haiku/trunk/docs/userguide/images/apps-images/diskusage-icon_32.png haiku/trunk/docs/userguide/images/apps-images/diskusage-icon_64.png haiku/trunk/docs/userguide/images/apps-images/drivesetup-icon_32.png haiku/trunk/docs/userguide/images/apps-images/drivesetup-icon_64.png haiku/trunk/docs/userguide/images/apps-images/expander-icon_32.png haiku/trunk/docs/userguide/images/apps-images/expander-icon_64.png haiku/trunk/docs/userguide/images/apps-images/i-o-m-bitmap128.png haiku/trunk/docs/userguide/images/apps-images/i-o-m-bitmap16.png haiku/trunk/docs/userguide/images/apps-images/i-o-m-bitmap32.png haiku/trunk/docs/userguide/images/apps-images/i-o-m-bitmap64.png haiku/trunk/docs/userguide/images/apps-images/i-o-m-lod-icon_32.png haiku/trunk/docs/userguide/images/apps-images/i-o-m-lod-icon_64.png haiku/trunk/docs/userguide/images/apps-images/i-o-m-path-ab.png haiku/trunk/docs/userguide/images/apps-images/i-o-m-pointer-add.png haiku/trunk/docs/userguide/images/apps-images/i-o-m-pointer-bezier.png haiku/trunk/docs/userguide/images/apps-images/i-o-m-pointer-delete.png haiku/trunk/docs/userguide/images/apps-images/i-o-m-pointer-insert.png haiku/trunk/docs/userguide/images/apps-images/i-o-m-pointer-move-path.png haiku/trunk/docs/userguide/images/apps-images/i-o-m-pointer-move-shape.png haiku/trunk/docs/userguide/images/apps-images/i-o-m-pointer-resize.png haiku/trunk/docs/userguide/images/apps-images/i-o-m-pointer-rotate.png haiku/trunk/docs/userguide/images/apps-images/i-o-m-pointer-select.png haiku/trunk/docs/userguide/images/apps-images/i-o-m-shape.png haiku/trunk/docs/userguide/images/apps-images/i-o-m-terminal-bitmap16.png haiku/trunk/docs/userguide/images/apps-images/i-o-m-terminal-bitmap32.png haiku/trunk/docs/userguide/images/apps-images/i-o-m-vector128.png haiku/trunk/docs/userguide/images/apps-images/i-o-m-vector32.png haiku/trunk/docs/userguide/images/apps-images/i-o-m-vector64.png haiku/trunk/docs/userguide/images/apps-images/icon-o-matic-icon_32.png haiku/trunk/docs/userguide/images/apps-images/icon-o-matic-icon_64.png haiku/trunk/docs/userguide/images/apps-images/installer-icon_32.png haiku/trunk/docs/userguide/images/apps-images/installer-icon_64.png haiku/trunk/docs/userguide/images/apps-images/magnify-icon_32.png haiku/trunk/docs/userguide/images/apps-images/magnify-icon_64.png haiku/trunk/docs/userguide/images/apps-images/magnify.png haiku/trunk/docs/userguide/images/apps-images/mail-icon_32.png haiku/trunk/docs/userguide/images/apps-images/mail-icon_64.png haiku/trunk/docs/userguide/images/apps-images/mediaplayer-icon_32.png haiku/trunk/docs/userguide/images/apps-images/mediaplayer-icon_64.png haiku/trunk/docs/userguide/images/apps-images/midiplayer-icon_32.png haiku/trunk/docs/userguide/images/apps-images/midiplayer-icon_64.png haiku/trunk/docs/userguide/images/apps-images/packageinstaller-icon_32.png haiku/trunk/docs/userguide/images/apps-images/packageinstaller-icon_64.png haiku/trunk/docs/userguide/images/apps-images/pe-icon_32.png haiku/trunk/docs/userguide/images/apps-images/pe-icon_64.png haiku/trunk/docs/userguide/images/apps-images/people-icon_32.png haiku/trunk/docs/userguide/images/apps-images/people-icon_64.png haiku/trunk/docs/userguide/images/apps-images/poorman-icon_32.png haiku/trunk/docs/userguide/images/apps-images/poorman-icon_64.png haiku/trunk/docs/userguide/images/apps-images/screenshot-icon_32.png haiku/trunk/docs/userguide/images/apps-images/screenshot-icon_64.png haiku/trunk/docs/userguide/images/apps-images/showimage-icon_32.png haiku/trunk/docs/userguide/images/apps-images/showimage-icon_64.png haiku/trunk/docs/userguide/images/apps-images/soundrecorder-icon_32.png haiku/trunk/docs/userguide/images/apps-images/soundrecorder-icon_64.png haiku/trunk/docs/userguide/images/apps-images/stylededit-icon_32.png haiku/trunk/docs/userguide/images/apps-images/stylededit-icon_64.png haiku/trunk/docs/userguide/images/apps-images/terminal-icon_32.png haiku/trunk/docs/userguide/images/apps-images/terminal-icon_64.png haiku/trunk/docs/userguide/images/apps-images/textsearch-icon_32.png haiku/trunk/docs/userguide/images/apps-images/textsearch-icon_64.png haiku/trunk/docs/userguide/images/apps-images/tv-icon_32.png haiku/trunk/docs/userguide/images/apps-images/tv-icon_64.png haiku/trunk/docs/userguide/images/apps-images/vision-icon_32.png haiku/trunk/docs/userguide/images/apps-images/vision-icon_64.png haiku/trunk/docs/userguide/images/apps-images/vlc-icon_32.png haiku/trunk/docs/userguide/images/apps-images/vlc-icon_64.png haiku/trunk/docs/userguide/images/apps-images/wonderbrush-icon_32.png haiku/trunk/docs/userguide/images/apps-images/wonderbrush-icon_64.png haiku/trunk/docs/userguide/images/bootloader-images/boot-screen.png haiku/trunk/docs/userguide/images/deskbar-images/positions.png haiku/trunk/docs/userguide/images/desktop-applets-images/launchbox-icon_32.png haiku/trunk/docs/userguide/images/desktop-applets-images/launchbox-icon_64.png haiku/trunk/docs/userguide/images/desktop-applets-images/networkstatus-icon_32.png haiku/trunk/docs/userguide/images/desktop-applets-images/networkstatus-icon_64.png haiku/trunk/docs/userguide/images/desktop-applets-images/powerstatus-icon_64.png haiku/trunk/docs/userguide/images/desktop-applets-images/processcontroller-icon_32.png haiku/trunk/docs/userguide/images/desktop-applets-images/processcontroller-icon_64.png haiku/trunk/docs/userguide/images/desktop-applets-images/workspaces-icon_32.png haiku/trunk/docs/userguide/images/desktop-applets-images/workspaces-icon_64.png haiku/trunk/docs/userguide/images/logo.png haiku/trunk/docs/userguide/images/prefs-images/appearance-glyph-off.png haiku/trunk/docs/userguide/images/prefs-images/appearance-glyph-on-subpixel.png haiku/trunk/docs/userguide/images/prefs-images/appearance-glyph-on.png haiku/trunk/docs/userguide/images/prefs-images/appearance-icon_32.png haiku/trunk/docs/userguide/images/prefs-images/appearance-icon_64.png haiku/trunk/docs/userguide/images/prefs-images/appearance-subpixel.png haiku/trunk/docs/userguide/images/prefs-images/backgrounds-icon_32.png haiku/trunk/docs/userguide/images/prefs-images/backgrounds-icon_64.png haiku/trunk/docs/userguide/images/prefs-images/datatranslations-icon_32.png haiku/trunk/docs/userguide/images/prefs-images/datatranslations-icon_64.png haiku/trunk/docs/userguide/images/prefs-images/e-mail-icon_32.png haiku/trunk/docs/userguide/images/prefs-images/e-mail-icon_64.png haiku/trunk/docs/userguide/images/prefs-images/filetypes-icon_32.png haiku/trunk/docs/userguide/images/prefs-images/filetypes-icon_64.png haiku/trunk/docs/userguide/images/prefs-images/fonts-icon_32.png haiku/trunk/docs/userguide/images/prefs-images/fonts-icon_64.png haiku/trunk/docs/userguide/images/prefs-images/keyboard-icon_16.png haiku/trunk/docs/userguide/images/prefs-images/keyboard-icon_32.png haiku/trunk/docs/userguide/images/prefs-images/keyboard-icon_64.png haiku/trunk/docs/userguide/images/prefs-images/keymap-icon_16.png haiku/trunk/docs/userguide/images/prefs-images/keymap-icon_32.png haiku/trunk/docs/userguide/images/prefs-images/keymap-icon_64.png haiku/trunk/docs/userguide/images/prefs-images/media-icon_32.png haiku/trunk/docs/userguide/images/prefs-images/media-icon_64.png haiku/trunk/docs/userguide/images/prefs-images/menu-icon_32.png haiku/trunk/docs/userguide/images/prefs-images/menu-icon_64.png haiku/trunk/docs/userguide/images/prefs-images/mouse-icon_64.png haiku/trunk/docs/userguide/images/prefs-images/network-icon_32.png haiku/trunk/docs/userguide/images/prefs-images/network-icon_64.png haiku/trunk/docs/userguide/images/prefs-images/printers-icon_16.png haiku/trunk/docs/userguide/images/prefs-images/printers-icon_32.png haiku/trunk/docs/userguide/images/prefs-images/printers-icon_64.png haiku/trunk/docs/userguide/images/prefs-images/screen-icon_32.png haiku/trunk/docs/userguide/images/prefs-images/screen-icon_64.png haiku/trunk/docs/userguide/images/prefs-images/screensaver-icon_32.png haiku/trunk/docs/userguide/images/prefs-images/screensaver-icon_64.png haiku/trunk/docs/userguide/images/prefs-images/sounds-icon_32.png haiku/trunk/docs/userguide/images/prefs-images/sounds-icon_64.png haiku/trunk/docs/userguide/images/prefs-images/time-icon_32.png haiku/trunk/docs/userguide/images/prefs-images/time-icon_64.png haiku/trunk/docs/userguide/images/prefs-images/tracker-icon_32.png haiku/trunk/docs/userguide/images/prefs-images/tracker-icon_64.png haiku/trunk/docs/userguide/images/prefs-images/virtualmemory-icon_32.png haiku/trunk/docs/userguide/images/prefs-images/virtualmemory-icon_64.png haiku/trunk/docs/userguide/images/twitcher-images/twitcher.png haiku/trunk/docs/userguide/images/up.png haiku/trunk/docs/welcome/images/logo.png Log: * Added workspace navigation with CTRL+ALT+Cursor in workspaces.html and keyboard-shortcuts.html. * Added workspace arrangement in Screen preferences. Updated screenshot. * Added newly learned shortcuts: CTRL+ALT+Z to maximize a window and CTRL+ALT+M for minimizing and CTRL+ALT+H to hide all windows of an app. * I-O-M: Removed "Transformation" and "Perspective" from the available transformers until those are implemented. Same for the Shape property "Rounding". Added description of Path|Rotate Vertices Right/Left. Thanks Stippi for working on these I-O-M tickets! * Corrected bottom nav-bar of apps-terminal.html. * Added black-on-white output for pre.terminal when printing to Haiku-docs.css. (Thought I did that already, but apparently not...) * Added "Ignore Double-click" to launchbox.html. * Updated all screenshots to show the new decorator design. * Ran all images thru OptiPNG which losslessly made them on avg. 11% smaller. * Updated sort order indicator in attributes.html * Added how to use pop-up navigating for moving files in tracker.html Modified: haiku/trunk/docs/Haiku-doc.css =================================================================== --- haiku/trunk/docs/Haiku-doc.css 2009-08-10 08:07:47 UTC (rev 32220) +++ haiku/trunk/docs/Haiku-doc.css 2009-08-10 08:18:39 UTC (rev 32221) @@ -248,7 +248,6 @@ font-size: 1.0em; font-family: serif; font-style: italic; -/* color: #5e1c1c; */ color: #5e1c1c; } .cli { /* Shell command or file */ @@ -303,4 +302,8 @@ acronym { border: none; } + pre.terminal { /* Terminal output black on white*/ + background-color: #ffffff; + color: #000000; + } } Modified: haiku/trunk/docs/userguide/en/applications/apps-icon-o-matic.html =================================================================== --- haiku/trunk/docs/userguide/en/applications/apps-icon-o-matic.html 2009-08-10 08:07:47 UTC (rev 32220) +++ haiku/trunk/docs/userguide/en/applications/apps-icon-o-matic.html 2009-08-10 08:18:39 UTC (rev 32221) @@ -76,7 +76,7 @@ width="32" height="32" /> 1,024 byte
+ 256 byte 7,192 byte 768 byte -

Note that the BeOS used two versions of an icon, one 16x16 and 32x32, to achieve good visuals in List and Icon View mode.

+

Note that the BeOS used two versions of an icon, one 16x16 and one 32x32, to achieve good visuals in List and Icon View mode.

This trick isn't needed with vector icons. Besides only taking up a few hundred bytes in a file, vector icons also scale much better than bitmaps. (Note: BeOS offered only a 16x16 and 32x32 display.)

@@ -117,7 +117,7 @@

Here's a quick overview of Icon-O-Matic's window:

i-o-m-overview.png -

To create any visible object on the canvas, you need a shape with a path and a style. Conveniently, you can create one, two or all three of those together from the Shape menu. Every kind of object (Paths, Shapes, Transformers, and Styles) has a menu above its list of elements, offering various commands. Every element has certain options that are set in the Property view.

+

To create any visible object on the canvas, you need a shape with a path and a style. Conveniently, you can create one, two or all three of those together from the Shape menu. Every kind of object (Paths, Shapes, Transformers, and Styles) has a menu above its list of elements, offering various commands. Every element has certain options that are set in the Properties view.

@@ -176,11 +176,12 @@

16x1632x3264x64128x128
- + +
ReverseIf your path isn't "closed" (see Path Properties below), a click into the canvas always creates a new point, connecting it with the last one. "Reverse" will reverse this order and your new point will connect to original start point instead.
Clean UpMost useful with imported SVGs, this function will remove redundant points.
Rotate Indicesnot yet implemented.
Rotate Indices RightALT RPractically, this rotates the opening of a path. It's best seen when using a not-closed path with a style and a shape with a stroke transformer. Now, if your path looks like a ⊂ it will rotate like this: ⊂ ∩ ⊃ ∪.
Rotate Indices LeftALT SHIFT RDoes the same in the other direction.

Path Properties

-

The Property at the bottom left of the window offers all available settings of the currently selected object. A path only has two: a Name and if it's Closed or not.

+

Properties at the bottom left of the window offers all available settings of the currently selected object. A path only has two: a Name and if it's Closed or not.

@@ -222,10 +223,9 @@

Shape Properties

-

Besides a Name, the Property view for a shape has these options:

+

Besides a Name, the Properties view for a shape has these options:

-
RoundingUnfinished feature. Once working correctly, it will do a kind of "hinting" for vector paths, rounding their coordinates to the next full pixel, giving it a crisper look.
Min LODMinimum Level of Detail
Max LODMaximum Level of Detail
@@ -273,7 +273,7 @@

The Style menu offers the usual entries to Add, Duplicate or Remove a style and to Reset Transformation.

Style Properties

-

The Name is the only Property of a style.

+

The Name is the only Properties of a style.

@@ -283,8 +283,6 @@

Transformer Add Menu

- -
TransformationOffers the same move/resize/rotate options you have by manipulating a shape with your mouse directly.
Perspectivenot yet implemented
ContourAdds an outline to a shape.
StrokeStrokes the path of a shape instead of filling it with a style.
@@ -292,7 +290,7 @@

Depending on the kind of Transformer, you'll get a different set of properties.

Transformer Properties

-

Besides a Name and the actual Width for the transformer, the Property view has these (depending on its type slightly differing) options:

+

Besides a Name and the actual Width for the transformer, the Properties view has these (depending on its type slightly differing) options:

Modified: haiku/trunk/docs/userguide/en/applications/apps-terminal.html =================================================================== --- haiku/trunk/docs/userguide/en/applications/apps-terminal.html 2009-08-10 08:07:47 UTC (rev 32220) +++ haiku/trunk/docs/userguide/en/applications/apps-terminal.html 2009-08-10 08:18:39 UTC (rev 32221) @@ -97,9 +97,9 @@

Applications     - Previous: Icon-O-Matic + Previous: StyledEdit     - Next: Mail + Next: TextSearch

Modified: haiku/trunk/docs/userguide/en/attributes.html =================================================================== --- haiku/trunk/docs/userguide/en/attributes.html 2009-08-10 08:07:47 UTC (rev 32220) +++ haiku/trunk/docs/userguide/en/attributes.html 2009-08-10 08:18:39 UTC (rev 32221) @@ -48,7 +48,7 @@

Attributes are displayed quite similar to a database or spreadsheet. Using Tracker you can choose which attributes to display (columns) and sort file listings (rows) accordingly.

To do this, open a Tracker window, click on the Attributes menu, and select the attributes you want to display. Alternatively, simply right-click onto a column heading and mark the items in the context menu. You can rearrange the columns by a simple drag&drop of the column heading. Moving a column out of a window, is a fast way to get rid of columns you don't need.

Double-click on the line between two attributes in the heading to automatically resize a column to its optimal width.

-

Click on a column heading to toggle the sorting order from ascending to descending. You can establish a secondary sort order by pressing the SHIFT key while clicking on a column heading. Doing that you can, for example, sort your People files by company and within that order sort by contact name. See the above screenshot as an example. The secondary sort order is marked by a dotted line under the heading.

+

Click on a column heading to toggle the sorting order from ascending to descending. You can establish a secondary sort order by pressing the SHIFT key while clicking on a column heading. Doing that you can, for example, sort your People files by company and within that order sort by contact name. See the above screenshot as an example. The secondary sort order is marked by a lighter colored indicator beside the heading.

Editing these attributes is as simple as renaming a file: Either click on an entry or press ALT E and move between the attributes with TAB and SHIFT TAB. ESC leaves the editing mode without applying the changes.

Attributes in Terminal

Modified: haiku/trunk/docs/userguide/en/desktop-applets/desktop-applets-launchbox.html =================================================================== --- haiku/trunk/docs/userguide/en/desktop-applets/desktop-applets-launchbox.html 2009-08-10 08:07:47 UTC (rev 32220) +++ haiku/trunk/docs/userguide/en/desktop-applets/desktop-applets-launchbox.html 2009-08-10 08:18:39 UTC (rev 32221) @@ -5,7 +5,7 @@ + Modified: haiku/trunk/docs/userguide/en/tracker.html =================================================================== --- haiku/trunk/docs/userguide/en/tracker.html 2009-08-10 08:07:47 UTC (rev 32220) +++ haiku/trunk/docs/userguide/en/tracker.html 2009-08-10 08:18:39 UTC (rev 32221) @@ -73,7 +73,8 @@

Instead of double-clicking your way down folder after folder, there's a better way to drill down:

drill-down.png -

Right-click onto a folder, and at the top of the usual context menu you'll find a submenu of the current folder that let's you navigate down a level. Just move down the hierarchy until you find the file or folder you're looking for and click on it to open it. The above shows the contents of the folder /boot/system/documentation/.

+

Right-click onto a folder, and at the top of the usual context menu you'll find a submenu of the current folder that let's you navigate down a level. Just move down the hierarchy until you find the file or folder you're looking for and click on it to open it. The above shows the contents of the folder /boot/system/documentation/.
+If you do the above while dragging a file with you, it will be moved to where you eventually drop it.

A similar method can be used from any Tracker window:

window-drill-down.png

Click on the area in the lower left, where the number of items is listed, and you'll get submenus for every level above your current location. From there you can drill down through the folders as usual.

Modified: haiku/trunk/docs/userguide/en/workspaces.html =================================================================== --- haiku/trunk/docs/userguide/en/workspaces.html 2009-08-10 08:07:47 UTC (rev 32220) +++ haiku/trunk/docs/userguide/en/workspaces.html 2009-08-10 08:18:39 UTC (rev 32221) @@ -5,7 +5,7 @@
CapsStroke only. Defines the end caps of a line: Butt, Square or Round.
Detect Orient.Contour only. Makes sure the contour always extends outwards when you have self-intersecting paths.