Commit Graph

3981 Commits

Author SHA1 Message Date
Fredrik Modeen
327a88fbc1 fixes pointed out by Axel, and style changes.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27463 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-12 18:29:16 +00:00
Fredrik Modeen
ee652e3aab reverted to 11769 and added (std::nothrow)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27452 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-12 14:06:56 +00:00
Stefano Ceccherini
1e8da5fd15 fAppName was leaked (CID 6). Also moved the initialization of fText to the end of the function, so that we avoid a BString::Adopt() call
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27447 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-12 10:26:05 +00:00
Stefano Ceccherini
746cac055a fixed buffer overrun, CID 649
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27446 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-12 10:10:13 +00:00
Stefano Ceccherini
2e2bff94a9 buttons could be used initialized if locking the looper failed (CID 1134)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27440 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-12 08:09:13 +00:00
Stefano Ceccherini
fc16834e55 buffer is an array, so use delete[]. CID 130
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27439 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-12 07:34:37 +00:00
Fredrik Modeen
c1d9a877a4 Fixed CID 1031: removed check _fDevice for NULL as we do new BList in constructor also removed temp var count as _fDevice->CountItems() should return 0 if empty
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27438 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-12 07:07:00 +00:00
Ryan Leavengood
4239ee5d66 Fixed CID 1290 and 1291: the temp BString is initialized with a new BString and then immediately replaced. A later null check ensures it is OK to initialize it to NULL.
Also fixed a GCC warning about comparison between signed and unsigned.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27434 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-12 06:21:34 +00:00
Axel Dörfler
43209917de * BDirectory::CreateDirectory() and CreateSymlink() now both use __gUmask to
correct the permission mask. This fixes bug #2670.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27414 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-11 12:25:05 +00:00
Stefano Ceccherini
c4f7df69a5 be_app could be NULL in BApplication's destructor, if the BApplication didn't initialize itself fully on construction. This fixes a crash when launching some already running application (i.e. print_server)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27413 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-11 12:02:33 +00:00
Michael Lotz
89dda28052 * Extend the usb_raw interface by alternate interface aware getters for
interfaces, endpoints and generic descriptors.
* Add getter for active interface index and simplify the count operation as
  it isn't misused to also get interface descriptors anymore.
* Refactor out some common code into helper functions.
* Adapt the USBKit to the changed/new interface.
* Change how alternate interfaces are exposed by USBKit by providing normal
  BUSBInterface objects for alternate interfaces that can easily be examined
  and used.
* Make BUSBInterface class aware of its alternate index and use the alternate
  aware usb_raw functionallity to build the endpoint and descriptor lists.
* Add ActiveAlternateIndex() to find out what alternate is currently active.
* Style cleanup of the USBKit classes, use std::nothrow everywhere and check
  all allocations. Simplify some code by removing optimization where the benefit
  is questionable.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27409 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-10 21:52:32 +00:00
Stephan Aßmus
1b0471487a Added layout friendly constructor (untested).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27407 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-10 21:07:32 +00:00
Stephan Aßmus
7bf5abf425 Implemented BSize returning layout methods.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27406 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-10 20:34:10 +00:00
Stefano Ceccherini
40b71c1667 Use dynamic_cast before calling DeleteReplicant. This fixes bug #2712. I'm not sure why, though. Also call unload_add_on() as last operation (and yes, doing just that was not sufficient to fix the bug)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27400 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-10 11:34:56 +00:00
Stefano Ceccherini
f8a63d3a0b non 32 bit offscreen bitmaps were never cleared to white, due to the way they currently work: when the offscreen window is created, the current content of the bitmap is copied to the back buffer, and since the clearing came later, it was never copied to it. This fixes the problem with FlattenPictureTest not working correctly for colorspace different than RGB(A)32.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27389 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-09 13:28:30 +00:00
Stefano Ceccherini
6ee56a00e5 added a comment explaining why the implementation should be moved to the server
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27383 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-08 14:42:38 +00:00
Stephan Aßmus
19a1d666b3 Improve the Read-Only mounting suggestion for additional volumes.
* Following a suggestion by BGA, even non-boot Haiku volumes will get the
  read-only popup, although with less emphasis in the wording.
* BPartition does inherit the read-only flag from it's parent device when
  not yet mounted. This is now checked and at least prevents the read-only
  popup for volumes on read-only media. If I understood everything correctly,
  there is no easy way to tell if a file system supports writing.
* Updated indentation style in the header.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27343 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-06 08:02:59 +00:00
Michael Pfeiffer
e53fa536eb Obviously the else block was missing.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27342 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-06 07:37:12 +00:00
Rene Gollent
0f1d1fbe30 Temporarily disable this check in Invalidate() as requested by Stephan. This fixes the problem with redraws seen in FlattenPictureTest and a few other places.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27337 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-05 17:07:36 +00:00
Karsten Heimrich
b257bb85e7 * partly revert, we need to keep the initial width
dont overwrite with preferred, it needs to called explicit



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27332 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-04 23:44:04 +00:00
Karsten Heimrich
1bdc2a5203 * ResizeToPreferred und GetPreferredSize now behave more closely to R5
this fixes mostly all windows containing TextControls in ArtPaint and
  should fix also ticket #2543

  ArtPaint was calling the BTextControl ctor with an empty rect, followed
  by ResizeToPreferred, which made in the best case the TextInput visible
  but it did not take the label into account. Should help more R5 apps.

  Some more tests on R5 have shown that even if you pass an extra large
  width, a call to ResizeToPreferred will not respect the passed width.
  Also the _BTextInput_ seems to grow with the length of the passed label.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27330 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-04 22:05:40 +00:00
Michael Pfeiffer
20ab5edbe9 * In BeOS R5 BListItem::DrawItem frame.left is always 0 regardless of BListView origin or update rectangle. This fixes the horizontal scrolling bug in FlattenPictureTest application.
* When the list is scrolled horizontally ScrollToSelection() resets the origin x-coordinate to 0. When using the keyboard to move to the next or previous item this is not desired. Now the x-coordinate is not changed from its old value anymore.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27328 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-04 19:57:31 +00:00
Stefano Ceccherini
3d2516cb5f implemented a client side (and very slow) version of BView::ClipToPicture. See bug #1397
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27321 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-04 13:59:41 +00:00
Stefano Ceccherini
b2bc136efc Changed spacing parameter type from int32 to float.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27319 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-04 11:58:01 +00:00
Stefano Ceccherini
c8ffdabb35 Fixed memcpy in case a smaller function table is provided. Improved readability of the SET_CLIPPING_RECT op block.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27315 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-04 08:22:00 +00:00
Karsten Heimrich
c9503698ae * take the precision into account while trying to add an optional character
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27298 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-03 12:53:01 +00:00
Stefano Ceccherini
9fb13d5822 the virtual version is const
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27297 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-03 11:23:15 +00:00
Karsten Heimrich
84d0e984f3 * of by one, while left points behind the chars to copy
right points to the first charater to start copy with



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27294 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-03 02:15:30 +00:00
Karsten Heimrich
9bee8e939b * use the new get function
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27292 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-03 00:33:41 +00:00
Karsten Heimrich
9b56aad8a0 * rewrote truncate_middle partly, it failed while trying to add an optional character
this was most noticable in Deskbar when opening DataTranslations in Expand App Mode



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27291 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-03 00:26:25 +00:00
Rene Gollent
7fb33cd07d I hate to add another special case, but with the way the BMenu* classes are designed, I see little in the way of alternatives. If we're a BMenuField's menu bar, then we should invoke the menu item regardless of where in the bar we click. This problem was visible in ticket #1877, where basically you could click only on the portion with text, because that was the size of the menu item, where the rest of the contained menu bar was considered dead space. Thus we now check if we're an instance of BMenuField's special menubar class, and if so we unconditionally select the item instead of a hit test. Fixes the aforementioned bug. If someone has a better approach, I'm all ears.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27271 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-01 19:33:50 +00:00
Karsten Heimrich
014016620f * Month and Day should be used from the passed date
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27266 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-01 13:16:14 +00:00
Karsten Heimrich
de13e4c0bd * implement julian day handling
* more get/ set functions, operators
* date until 1582 are handled in julian calendar
* date above 1582 are handled in gregorian calendar



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27264 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-01 13:11:29 +00:00
Karsten Heimrich
870f6b196f * implement AddMonths(...) and AddYears(...) functions
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27255 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-31 15:37:37 +00:00
Michael Pfeiffer
4352fc9187 Bug fix: The calculated day of week is based on a week that starts on Sunday, in a calendar with Monday as week start this number has to be adjusted in case of a Sunday. It would be 0 but should be 7.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27244 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-30 18:15:44 +00:00
Michael Pfeiffer
f0932941dd Simplified initialization of week days for a month.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27243 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-30 16:13:05 +00:00
Karsten Heimrich
ee24e75d62 * man, i managed to mess up an one liner...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27240 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-30 13:06:52 +00:00
Karsten Heimrich
b1287e5da5 * the condition should not have change, thanks Stephan for pointing this out :)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27239 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-30 13:03:58 +00:00
Karsten Heimrich
c1ed5d75d7 * special case only the end of the year
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27238 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-29 22:53:15 +00:00
Karsten Heimrich
b5e8c1341a * hrmm, March 2009 was week 0 ...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27237 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-29 19:46:02 +00:00
Karsten Heimrich
78092ae789 * move DateTime and CalendarView into shared
* adjust Time preflet to take that into account



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27235 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-29 19:26:58 +00:00
Karsten Heimrich
70bf426b8c * gcc4 build fix
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27227 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-28 19:32:18 +00:00
Karsten Heimrich
1678a1dd2c * if the given buffer size is to big, we will know we handle it in Attach
this should fix LinkSender usage like as in Stroke/ FillPolygon in BView



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27226 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-28 18:43:33 +00:00
Bruno G. Albuquerque
837057611d - Better be safe than sorry. Check MIME type and super type after
constructiuon. Thanks Rene for reminding me that BMimeType actually has a
  InitCheck() method. :)




git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27224 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-28 17:38:52 +00:00
Stephan Aßmus
e2bc27448f Could have been part of r27221. Added BColorQuantizer to libshared.so. Should
be useful for the GIF Translator for example, maybe even for PNG.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27222 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-28 16:38:27 +00:00
Stephan Aßmus
740fe892ac Added a BColorQuantizer class to the "shared kit" based on a patch by David
Powel. The functionality was written by Jeff Prosise and Davide Pizzolato and
has been cleaned up and adopted to the Haiku coding style by David Powell and
myself. The class can perform a color quantization for generating the optimal
color index palette (with given maximum size) from a given RGBA image.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27221 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-28 16:33:12 +00:00
Stefano Ceccherini
910c4a0106 the Link* api supports sending large messages through areas, thanks to Julun, and this TODO can be removed.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27220 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-28 15:32:26 +00:00
Stephan Aßmus
3f2dd98c88 This fixes a bad feeling in my stomache:
* When mounting a non-BFS volume, suggest to the user to mount it read-only.
* Store the mount flags with each volume in the automounter settings, restore
  mount settings on next boot.
The second part is probably nice to have anyways und should prevent bad surprises,
the first part should be removed again when we have absolute confidence in all
our file system implementations as well as the kernel itself.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27219 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-28 13:26:45 +00:00
Karsten Heimrich
4e61552ecd * first implementation of passing data via area to app_server
this makes printing of large images work, fixes task #1067



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27214 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-27 13:39:16 +00:00
Stephan Aßmus
0cafe2dfb9 * Fixed a race condition in BWindow::Show(). If it was the first time Show()
was called, the calling thread could be preempted, or simply be blocked on
  calling Lock() after running the window thread. The window thread in turn
  could be processing messages. In that case, fShowLevel would still have the
  wrong value. For example, MediaPlayer would call IsHidden() on one of it's
  views, which would then return true for this case. The result was that the
  video view was not hidden and a black rectangle was showing on top of the
  controls. This may also have caused other similar problems of course.
* fRunCalled was accessed without holding the lock.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27209 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-26 18:30:47 +00:00