As usual we ask ICU to do the actual work. The TextEncoding constructor
is fed with a sample of the text to identify (ICU docs recommend a few
hundred bytes). The text is analyzed in various ways (bytes patterns
such as UTF-8 escaping schemes, common letter sequences from known
languages, byte order marks) and an encoding is determined.
Replace code in StyledEdit by this new implementation.
Note that ICU seems to always return some valid encoding, even with fed
with obviously non-text data. This makes StyledEdit open the files no
matter what, where it would error out before.
Fixes#9395.
BeOS had a feature where you could click on a list and while holding
down the mouse button scroll through the list items selecting them
as you went. I implemented the same feature on Haiku.
Did the work in separate thread which makes sure that the mouse
is held down the whole time even if you leave the view.
Thanks Diver for bringing this feature to my attention.
* Rename kDoubleClickTresh to kDoubleClickThreshold
and use floating point in rval
* Pointer (*) goes with type for property var
* Use {}'s for multi-line if conditional
* rename point to where (consistent with header and rest of IK)
* Explicitly compare with 0 for bitwise operator statements
* Rename InitiateDrag() params
- This is how it is named in other versions of elf.h (Linux, glibc, possibly more)
- ELF_MAGIC is used by libelf for the same thing, and the defines conflicts,
breaking libelf build on Haiku.
http://insightfactory.tumblr.com/image/142366356207
* Make the color box a rectangle with proportions of golden ratio.
* Override GetContentSize() to make menu item area larger.
* Label should never truncate since I make sure there is enough room.
* Draw the label using BMenuItem parent class
* Carefully adjust the spacing so that there is an attractive amount of
padding between the checkmark and color box and the color box and label.
Add _AddMenu method to BMenuField that adds BColorMenuItem as its
base menu item. This shows the BColorMenuItem in the closed state.
Create BPrivate::MenuItemPrivate
Add a SetSubmenu() method to MenuItemPrivate that gives you
the ability to add a submenu after creating the object. This
method should be public
Skip disabled items
Color gets updated even if you select an item in a submenu
The only file in here was Deskbar.h, which just included the "real"
Deskbar.h. Considering nothing in-tree cares about this, and only
a small number of applications at HaikuArchives do, and that Haiku already
broke BeOS source compatibility in lots of other ways, let's just remove
this deprecated cruft.
Fixes#12710.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
I fixed the modifications to the Jamfiles in src/bin, they were all wrong
in the patch.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
Fixes#12575. I checked with PulkoMandy on IRC before merging this,
and fixed some whitespace violations of the coding style.
border vs. borders is confusing.
BTabView: Rename border param to borderStyle
BTabView docs: rename border param to borderStyle
enumerate border styles in docs
B{Abstract,Datagram,Secure}Socket:
- Add functionality to listen for and accept new connections, thus allowing
one to use the socket classes for server functionality as well.
BSecureSocket:
- Adjust to take into account differences between how SSL needs to be called
when accepting an incoming connection vs initiating an outbound one.
The handshake on the accepted connection stills fails for unknown reasons
at the moment though.
Note that these changes break the ABI, and thus any packages making use of
them directly will need a rebuild.
* The Haiku specific notes contain a structure size field, now.
* Change the type of the count and size fields in the Haiku specific
notes to uint32 also for 64 bit ELF. The size field for a note is a
uint32 anyway.
* Add function core_dump_write_core_file(). It writes a core file for
the current thread's team. The file format is similar to that of
other OSs (i.e. ELF with PT_LOAD segments and a PT_NOTE segment), but
most of the notes are Haiku specific (infos for team, areas, images,
threads). More data will probably need to be added.
* Add team flag TEAM_FLAG_DUMP_CORE, thread flag
THREAD_FLAGS_TRAP_FOR_CORE_DUMP, and Team property coreDumpCondition,
a condition variable available while a core dump is progress. A
thread that finds its flag THREAD_FLAGS_TRAP_FOR_CORE_DUMP set before
exiting the kernel to userland calls core_dump_trap_thread(), which
blocks on the condition variable until the core dump has finished. We
need the team's threads to stop so we can get their CPU state (and
have a generally unchanging team state while writing the core file).
* Add user debugger message B_DEBUG_WRITE_CORE_FILE. It causes
core_dump_write_core_file() to be called for the team.
* Dumping core as an immediate effect of a terminal signal has not been
implemented yet, but that should be fairly straight forward.
* When the user isn't requesting a custom notification, it will
be a BMediaRoster job to do it.
* Reintroduce BMediaRoster::SyncToServices, this time based on local
message passing rather than a global semaphore.
* SyncToServices is used in launch_media_server to make the process
more launch_daemon safe and faster in the average case.
* It was an error to add notifications in the media_server.
* Fixes#12717.
* Remove SyncToServices, I will probably readd it in future
but this time using a local synchronization service more than
relying on the media_server to release the semaphore.
* Due to some discussions today in mailing list I decided
to step back and retry the initial way to notify media rosters
about media services status. It is woking by using two different
notifications for reconnecting to the media_server and notifying
the local subscribers.
* This speed up the media services restart.
* Sorry for the noise and very thanks for reviewing my code to
everyone.
* The global synchro semaphore is provided with the purpose of
being used to avoid threads lock up when the media_server is in
an undefined state. There's still room for improvements.
* BMediaRoster::SyncToServices lock up on a semaphore until
the multi_audio correctly connected to the mixer.
* Added a directory argument for notify_{stat/attribute}_changed().
* This allows to watch only a directory, and get the notifications for
all of its files, not just add/remove entry notifications.
...and rename fBitmap to fOffscreenBitmap to make it more clear what it is.
We don't need to save a pointer to both the offscreen bitmap and
the offscreen view, just the bitmap. We can access the view by calling
fOffscreenBitmap->ChildAt((int32)0). This gives us back a _reserved private
variable slot.
In the (unlikely) case that _InitData() is called with offscreen = false but
the fOffscreenBitmap is not NULL, delete fOffscreenBitmap before
setting it to NULL so that memory is not leaked.
* This is the only solution that allowed to use the best
of both ways to do this calculus. I've also tested it
with a modified sound player that snoozed every time
the buffer should be handled, and found that neither
of the lateness calculus I tested (including enqueue_time)
really solve all problems. That's why I've tried to find
an average solution. There's still room for improvements
eventually.
* The direct methods in BMailProtocol now forward the request to the
looper; it's no longer the mail_daemon's responsibility to know
anything about that protocol.
* It's in desperate need of refactoring, but it doesn't hurt to add
it to the repository as is.
The inseparable changes necessary to support live color updating across the
system in a sane, safe, and performant manner.
BView gains:
HasSystemColors()
HasDefaultColors()
AdoptSystemColors()
AdoptParentColors()
AdoptViewColor(BView*)
SetViewUIColor(color_which, float tint)
SetHighUIColor(...
SetLowUIColor(...
ViewUIColor(float* tint)
HighUIColor(...
LowUIColor(...
DelayedInvalidate()
BWindow gains a simple helper method:
IsOffscreenWindow()
BMessage gains:
AddColor()
FindColor()
GetColor()
HasColor() * allegedly this API is deprecated, but I implemented it anyway
ReplaceColor()
SetColor()
Previous private ColorTools methods are made public and moved into GraphicsDefs:
mix_color, blend_color, disable_color
These are fully compatible with BeOS dan0 R5.1 methods and are just code cleanup
of BeOS example code under the OpenTracker license.
In addition, four new colors are created:
B_LINK_TEXT_COLOR
B_LINK_HOVER_COLOR
B_LINK_ACTIVE_COLOR
B_LINK_VISITED_COLOR
These changes are documented in their proper user documentation files.
In addition, due to a history rewrite, B_FOLLOW_LEFT_TOP has been defined and
used in lieu of B_FOLLOW_TOP | B_FOLLOW_LEFT and is included in this commit.
On the app_server side, the following has changed:
Add DelayedMessage - a system by which messages can be sent at a scheduled time,
and can also be merged according to set rules. A single thread is used to service the
message queue and multiple recipients can be set for each message.
Desktop gains the ability to add message ports to a DelayedMessage so that
said messages can target either all applications or all windows, as needed.
Desktop maintains a BMessage which is used to queue up all pending color changes
and the delayed messaging system is used to enact these changes after a short
period of time has passed. This prevents abuse and allows the system to merge
repeated set_ui_color events into one event for client applications, improving
performance drastically.
In addition, B_COLORS_UPDATED is sent to the BApplication, which forwards the message
to each BWindow. This is done to improve performance over having the app_server
independently informing each window.
Decorator changes are live now, which required some reworking.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>