* Added a layout friendly constructor - it's not so nice to use, though, since
the original one already doesn't get a BRect (we just don't need the
resizing mode, and have to set the B_SUPPORTS_LAYOUT flag).
* Refactored size/frame computation a bit.
* Cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28258 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Renamed _BDeviceAddOn_ to DeviceAddOn, and put it into the BPrivate namespace.
* Moved the DeviceManager functionality into the AddOnManager - this also
solves a locking issue, as BInputServerDevice::Control() was called in the
context of the DeviceManager before.
* The AddOnManager now uses the BPathMonitor to monitor the devices that
BInputServerDevices ask for - this greatly simplifies the code.
* Got rid of TList.h, and use ObjectList.h instead.
* Added PathList class that has a list of paths with reference count, used by
DeviceAddOn and the AddOnManager.
* DeviceAddOn got an actual implementation that lives in InputServerDevice.cpp.
* Added an experimental BInputServerDevice::AddDevices() that could be used
instead of recursing over devices manually. It replaces the functionality
that was found in the DeviceManager before (this was done implicitely for
all monitored devices).
* Greatly cleaned up and simplified the AddOnManager.
* Also fixed lots of potential errors/leaks when things go wrong.
* Removed the extra locker in AddOnManager - its BLooper lock is now used
instead.
* Replaced PRINT()/PRINTERR() macros in the AddOnManager with TRACE(), and
ERROR(), both now use debug_printf().
* Hopefully this fixes the problem that I don't have keyboard under VirtualBox
from time to time.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28241 a95241bf-73f2-0310-859d-f6bbb57e9c96
* check if locking the offscreen window succeeds before calling delete on it
* don't return offscreen windows in CountWindows and WindowAt (works now as on R5)
fixes ticket 1522, 1591, 1946, 2318 and propably more
While creating an BBitmap in BApplication the bitmaps window looper would
be added to the applications gLooperList, thus calling Quit() on that window
and later delete on a stale window pointer in BBitmaps dtor. The Lock() check
would fix the problem, but tests on R5 have shown that BApplication hides the
offscreen window in CountWindows() and WindowAt().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28236 a95241bf-73f2-0310-859d-f6bbb57e9c96
bool return type. Did I mention this was an unstable Haiku extension?
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28181 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Added a new class BAffineTransform, currently in the BPrivate namespace
and the inofficial "shared kit".
* Extended BPolygon to be transformable by a BAffineTransform.
Thanks a lot!
Minor fixes by myself:
* The class accidentally still derived from agg::trans_affine.
* Added then missing comparator operators.
* Swapped the BPoint* and count arguments of Apply(), since that seems
to be the more common order in the other Be API.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28176 a95241bf-73f2-0310-859d-f6bbb57e9c96
the data of two BMessages and allows recursive comparison (BMessage inside
BMessage). Note that using this API might require you to recompile your app in
the path to R1.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28174 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Fixed a general problem with respect to overriding of the reserved
virtual function slots: instead of statically invoking the method
that corresponds to the reserved slot on the class that contains the
slot, we now invoke the virtual Perform() method. Perform() then dispatches
the method invocation to the "proper" class, i.e. the highest class in the
hierarchy that actually implements the requested method.
This fixes a crash in apps that use liblayout's MSlider class and
should fix one or other spurious bug with old apps or libraries, too.
* added new header folder 'binary_compatibility' that contains files that
define the method codes and data structures required by Perform()
* looked for and implemented all used reserved virtual slot functions to
invoke Perform() where necessary or to pass on the method call statically
(for slots that were already maintained by Be)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28124 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Implemented BGradient, BGradientLinear, BGradientRadial,
BGradientDiamond, BGradientConic and BGradientRadialFocus
new Interface Kit classes.
* Implemented all the (AGG-based) backend necessary in
the app_server to render gradients (Painter, DrawingEngine)
* app_server/View can convert a BGradient layout to screen
coordinates.
* Added BGradient methods of the Fill* methods in BView.
* Implemented a test app and added it to the image as a
demo.
* Adopted Icon-O-Matic and libs/icon in order to avoid
clashing with the new BGradient class. Re-use some
parts where possible.
Awesome work, Artur! Thanks a lot. Now a more modern
looking GUI has just become much easier to implement! :-)
TODO:
* Remove the need to have gradient type twice in the
app_server protocol.
* Refactor some parts of the patch to remove duplicated
code (Painter, DrawingEngine).
* Adopt the BPicture protocol to know about BGradients.
* Review some parts of the BArchivable implementation.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28109 a95241bf-73f2-0310-859d-f6bbb57e9c96
file system can write to files before mounting.
* Set the flag for all file systems that actually can write.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28055 a95241bf-73f2-0310-859d-f6bbb57e9c96
the methods IsFile() and GetFilePath() to BDiskDevice, and
BDiskDeviceRoster::GetFileDeviceForPath().
* Added new syscalls to implement this functionality.
* Added new flag B_DISK_DEVICE_IS_FILE.
* Fixed wrong operator precedence assumption in the BDiskDevice class at
several places.
* Minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28052 a95241bf-73f2-0310-859d-f6bbb57e9c96
* In _StealMouseMessage(), don't maintain fLastMouseMovedView, instead,
prevent B_MOUSE_MOVED message from being stolen that are important for
detecting transit changes. The point is that some apps (like Tracker) are
shooting themselves in the foot because they steal mouse messages via
GetMouse() in one place, but then rely on sane transit values in another
place. The way it works now, the view in question may get notified of the
same mouse moved coordinate twice, once via GetMouse() and once via
MouseMoved().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28002 a95241bf-73f2-0310-859d-f6bbb57e9c96
buffer format, the buffer can now also contain other events than just
stack traces. ATM these are only references to the image events
(created/deleted). Therefore we no longer have to flush the profiling
buffer after such an event, since the debugger can exactly match the
samples. Since we couldn't flush when the profiling timer hit while the
thread was in the kernel, that wasn't working that well anyway.
"profile -f" fails to translate stack trace addresses only very rarely,
now.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27775 a95241bf-73f2-0310-859d-f6bbb57e9c96
enumeration (getting roothubs, enumerating child devices and detecting device
topology) and hub port management (resetting and disabling ports). These were
laying around for quite some time.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27768 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Extended the profiling API by an option to record a variable number of
samples per tick. The stack depth is used as a maximum.
* Added new option "-f" to the "profile" tool. When specified it
increments the hit counts of all symbols in the full available caller
stack. I.e. the resulting hit counts will approximate the total time
spent in each function or any function directly or indirectly called
by it. Thus "_start" and "main" will usually get 100% and leaf
functions only what time has actually been spent in them.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27699 a95241bf-73f2-0310-859d-f6bbb57e9c96
* The class calculates a minimum width now, which is based on the line height,
this may also fix the bug with the small text inputs in the Pe Find window.
* Added TODOs about implementing GetHeightForWidth(), which may be a good idea
when a BTextView is used as non-editable informative text in an interface,
and one wants to make sure that the entire text is shown.
* Replaced the call to _Refresh() in Draw(), which recalculates all the line
breaks for no reason with _DrawLines() again. The TODO mentioned that text
will be drawn without drawing the background first, but maybe this is a
relict from times where Draw() was invoked directly? At least I cannot see
any negative consequences, and this should be much more efficient.
(Other than that, this patch should hopefully have no potential negative
side effects...<crosses fingers>)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27670 a95241bf-73f2-0310-859d-f6bbb57e9c96
into BTextView class as well, hopefully fixing the GCC4 build.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27661 a95241bf-73f2-0310-859d-f6bbb57e9c96
buffer during a timer event that interrupted a kernel function: We do
now flush the buffer as soon as it is 70% full, *if* we didn't interrupt
a kernel function. When the buffer runs full and we still haven't hit a
user function, we drop the tick. The number of dropped ticks is recorded
and sent to the debugger with the next update message.
Reverted the previous partial solution (the temporary disabling of
profiling while in debugger support code).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27658 a95241bf-73f2-0310-859d-f6bbb57e9c96
is created or deleted (or exec*() has been invoked). The counter is
sent with several debugger messages.
* Track the image event counter that is used when samples are added to
the profiling buffer. If the current team counter differs, we flush
the buffer first (sending an update message to the debugger), so that
the debugger has a chance to match the addresses to the correct images.
* Disable profiling for a thread while it runs in the debugger support
code. This fixes potential deadlocks which could occur when a
profiling timer event occurred that would require the buffer to be
flushed while the thread was just sending something to the debugger or
waiting for a command. As it turns out, this is not sufficient either,
since we should never try to flush the buffer when the timer event
occurred in the kernel, since the thread might hold a lock that the
debugger thread could try to acquire. Will implement a more general
solution later.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27656 a95241bf-73f2-0310-859d-f6bbb57e9c96
BTextView classes:
* Declared the directly used BTextView helper classes as private BTextView
classes and changed all affected files.
* Realized that Tracker's BPoseView was (accidentally?) using what used to
be _BWidthBuffer_. It had declared it's own class with the same name and
same members/size in headers/private/tracker/TextViewSupport.h, but the
implementation was nowhere to be found. I can only explain this that
the BTextView implementation was then actually linked and used. But the big
problem was that it was used without locking (unlike in BTextView)! When
many Tracker windows opened during system startup or later and they happened
to each request characters not yet in the cache, I imagine things could have
gone bad and corrupted memory. Anyways, since I can see the usefulness of
the cache, BPoseView uses BTextView::WidthBuffer on purpose now. And I moved
the locking inside BTextView::WidthBuffer::StringWidth().
* Adjusted InterfaceDefs.cpp accordingly.
* TODO: Move subsequent classes into BTextView namespace as well, ie derived
classes that BTextView doesn't directly know about. All stuff in src/kits/
inteface/textview_support/
* Added preliminary and not yet implemented layout friendly BTextView
constructors.
* I will try to handle the insets imposed by BTextView::fTextRect a bit
differently when used inside the new layout management framework. For this,
I added BTextView::SetInsets() and GetInsets(). SetInsets() doesn't do
anything yet.
So far, everything seems to work still... ;-)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27654 a95241bf-73f2-0310-859d-f6bbb57e9c96
be tracked to the kernel, which then counts the hits, an area is
passed to kernel in which the hits are recorded. When the area is
full, the debugger is notified. For some reason that part doesn't work
yet -- the whole system freezes when waiting for a reply.
* Reorganized the profile tool code a bit. For one with respect to the
changed API, but also to prepare tracking of image creation/deletion.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27640 a95241bf-73f2-0310-859d-f6bbb57e9c96
* The layout friendly constructors don't need to mess with the control size.
* The layout friendly constructors can use the respective BControl constructor.
* Refactored some duplicated code.
* Removed duplicated GetFontHeight() calls.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27585 a95241bf-73f2-0310-859d-f6bbb57e9c96
doing a lot of these things the same way as BMenuField are already doing.
Perhaps a private helper class could be refactored from these two controls
to avoid duplicating a lot of this code, although there are a few subtle
differences here and there.
These changes make a BTextControl behave properly in the layout management
frame work, in case CreateLabelLayoutItem() and CreateTextViewLayoutItem()
are _not_ used to layout the BTextControl.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27584 a95241bf-73f2-0310-859d-f6bbb57e9c96
MaxSize(). This makes sure that MaxSize() returns a proper size when the
user "unsets" the explicite max size.
* minimum label height is 0 if there is no label.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27583 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Removed unused fClean member
* Got rid of fSkipSetFlags member by simply calling the BView::SetFlags()
directly where fSkipSetFlags was supposed to prevent the custom
implementation.
* Added some debugging facilities.
* Used the layout friendly constructors of BControl where appropriate.
* Used B_FOLLOW_ALL for the child text input, it should be more correct.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27576 a95241bf-73f2-0310-859d-f6bbb57e9c96
still pretty much work in progress.
* Introduced init_thread_debug_info() which is used instead of
clear_thread_debug_info() when the thread is created. The latter
requires former initialization.
* user_debug_thread_deleted() is now already invoked in thread_exit(),
not in the undertaker.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27531 a95241bf-73f2-0310-859d-f6bbb57e9c96
* The most important fix is that in BMenuField::_ValidateLayoutData(),
divider was calculated, but then never used. If the menu field was not
using the layout management, it should take the existing fDivider into
account, but never did. This caused #2728.
* Added some tracing that helped me debug this.
* Fixed a bunch of layouting inconsistencies. It will also improve some
unnecessary resizing of the menu bar.
Will test all of this some more. But in the test app I do have, the BMenuField
works more like in BeOS now.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27508 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Added BScrollBar::SetOrientation().
* Improved _DrawArrowButton() to have a good visual result even when the
scroll bar does not have the standard width or height.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27494 a95241bf-73f2-0310-859d-f6bbb57e9c96
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
for PPC would give compiler errors if this is not defined (to nothing). For
the MetroWerks compiler, one needed to explicitely import/export classes and
methods, but GCC does not need it.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27405 a95241bf-73f2-0310-859d-f6bbb57e9c96
wake vector (not tested at all).
* Removed disabling interrupts when entering the sleep state - looks like
ACPI still needs memory then.
* Cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27403 a95241bf-73f2-0310-859d-f6bbb57e9c96