Commit Graph

152 Commits

Author SHA1 Message Date
Stefano Ceccherini 150ddd17b1 added missing header
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24910 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-11 08:29:54 +00:00
Stefano Ceccherini 10f4d0679a Added a class MenuPrivate to handle access to private BMenu methods.
BMenuItem and BWindow are no longer friends of BMenu, but use this class 
instead.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24909 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-11 08:22:09 +00:00
Axel Dörfler cfc3fa87da * Cleaned up InterfaceDefs.h, added TODO about getting rid of declaring
_init_interface_kit_() in there.
* Moved private get_mode_parameter() into the BPrivate namespace.
* Renamed interface_misc.h to InterfacePrivate.h.
* Minor other cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24869 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-09 10:07:35 +00:00
Axel Dörfler 58c42ec9de No need for the kWorkspacesWindow flag anymore.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24388 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-14 11:19:57 +00:00
Michael Lotz 87df690150 * Replaced the UTF8ToCharCode function with one that handles invalid chars
correctly (or at all...)
* Use the common 0xfffd character as a substitute for invalid characters
* Corrected comment

This function is used by the app_server to convert the UTF8 strings to char
codes to feed FreeType. Using a non space substitute character at least for
now, as it makes it more obvious where invalid characters are present.
I tested this change with some UTF8 test files and it seems to work well.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24175 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-28 23:04:47 +00:00
Axel Dörfler d273d00822 * Fixed previous version of UTF8CountBytes() and put it in again: it was
breaking out of the loop too early, and would therefore miss the last
  character.
* Replaced UTF8CountChars() with a short and safe version as well.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24173 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-28 19:17:33 +00:00
Stephan Aßmus ccf6ad1d8b Reverted to the previous version. Axel, your change completely broke all kinds
of stuff. I think the trouble is that you keep decrementing charCount while
still inside the same UTF8 glyph. I cannot really tell, I am hoping you don't
mind me reverting to the old version, since the new one is only three lines,
so it should be easy to correct and re-commit.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24172 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-28 15:56:31 +00:00
Axel Dörfler 326dce3ae0 * Simplified UTF8CountBytes() a bit, made it faster, and less error-prone
against malformed UTF-8.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24166 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-28 10:45:57 +00:00
Axel Dörfler f9bbab8848 * First steps towards a more flexible workspaces view handling: the
workspaces view can now be any view in the hierarchy.
* Added private view flag kWorkspacesViewFlag that identifies such a
  view - note though, that you must not remove a view before closing or
  hiding its window for now (and that you still need to set the 
  kWorkspacesWindowFlag, too).
* Fixed Workspaces check for valid screen coordinates; after a crash, it
  managed to open its window offscreen for me.
* Added a ViewLayer method FindView() that finds a view with the 
  specified flags set.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24090 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-24 11:18:52 +00:00
Stefano Ceccherini 9e64a7ed1b Fixed problem with some popup menus (check ticket #1679)
Moved GetMouse() calls near the check for exit conditions.
Reorganized a bit the code, and hopefully simplified it in some places.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23229 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-03 07:30:05 +00:00
François Revol 7579aad575 Fix extra token at end of #endif
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22974 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-21 22:57:33 +00:00
Stefano Ceccherini 37b83b1a2d The system palette was defined in two files. Moved to a private header,
included by the two.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22660 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-22 13:44:37 +00:00
Axel Dörfler f6e4cbb952 * Rewrote BeBuild.h which had "a few" consequences (got rid of all those class
definitions).
* Minor cleanup here and there.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22577 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-15 20:13:55 +00:00
Stefano Ceccherini 65e63b987d PaletteConverter now exports a static InitializeDefault() method, which
can be used (and is, by _init_interface_kit()) to initialize the ... 
er... default instance of 
PaletteConverter using the system color map, thus avoid building the 
list of colors, which takes some time. Fixes bug #505.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22508 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-11 13:30:56 +00:00
Stefano Ceccherini b1af0a7a24 Setting the font shear in a BPicture didn't work, because the value was
treated as uint32 in some places, when it's a float.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22214 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-09-10 10:20:26 +00:00
Stephan Aßmus 3a38a48561 * fixed size layout of BMenuBar on BMenuField in fixed size mode
(needs to account for the parts that the BMenuField draws, ie the shadow
  on the right)
* fixed follow mode of BMenuBar in fixed size mode (B_FOLLOW_LEFT_RIGHT)
* don't resize the BMenuField in fixed size mode (endless loop), this should
  be more robust anyways, since this endless loop would be triggered if an
  application tried to manually resize menuField->MenuBar() in auto resizing
  mode
* fixed calculation of the parts that need to be redrawn on resize


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22127 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-08-30 22:36:14 +00:00
Stephan Aßmus f591e3a0f2 * fix weird Shape op/point allocation
* handle out of memory situations
* don't try to copy (and assign op!) in SetData if opCount/ptCount is 0
-> FontDemo doesn't crash anymore eventually when cycling fonts in outline
mode


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22000 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-08-17 11:17:29 +00:00
Stefano Ceccherini 422fadc829 Moved the dummy table local to the PicturePlayer::Play() function since,
as Marcus pointed out, having it outside wasn't thread safe. Moved 
PicturePlayer into the BPrivate namespace.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21982 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-08-16 14:40:03 +00:00
Stefano Ceccherini 46b4e48998 Added some debug output to PicturePlayer. Since checking the table size for every op is very slow, now we do that only at the beginning, and use a custom op table if needed. The best case (which is the one used when drawing a picture with BView::DrawPicture()) is very fast since it only requires one check.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21972 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-08-16 09:14:03 +00:00
Stefano Ceccherini 253d42a602 Implemented SetClipping op, but it's not working yet (looks like it's
never written into the data stream)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21947 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-08-14 15:21:15 +00:00
Stefano Ceccherini feb557a6d1 Implemented WriteSetFontFamily() and WriteSetFontStyle(). Only the
server side functions are missing.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21941 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-08-14 09:17:21 +00:00
Stefano Ceccherini 37033892c5 Implemented SetPattern op. Reduced the buffer size to 4096 again.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21937 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-08-14 06:39:37 +00:00
Stefano Ceccherini 690c7474a4 Implemented BPicture's SetPenLocation() op, also nested
AppendToPicture() (but still doesn't work :( ). Moved some functions 
around in PictureDataWriter.h.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21925 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-08-13 14:07:12 +00:00
Stefano Ceccherini ed5de868df Implemented the following BPicture ops: fill region, stroke/fill arc,
stroke/fill polygon, stroke/fill bezier. some work towards drawing of 
nested pictures.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21918 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-08-13 07:20:43 +00:00
Michael Pfeiffer 3f4090c83d * open 'Add printer dialog' when 'addp' message is sent to Printers preflet
* style changes


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21858 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-08-08 20:32:46 +00:00
Stephan Aßmus 93a30169f3 * fix the build, forgot to commit this...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21667 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-07-19 17:22:53 +00:00
Ingo Weinhold ec592aa9e5 Implement _BMCMenuBar_::MaxSize() to override BMenuBar::MaxSize() and limit
the maximum width. The latter supports unlimited maximum width. The
_BMCMenuBar_ draws fine when resized wider than its min/preferred width, but
not the complete "button" area will cause the menu to open when being pressed.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21465 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-06-19 23:09:01 +00:00
Stefano Ceccherini ffcd67bc82 moved duplicate code to a common location.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21459 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-06-18 14:30:56 +00:00
Stefano Ceccherini 7f0898e76f bye bye ClientFontList.h
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21458 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-06-18 13:45:33 +00:00
Stefano Ceccherini ac2284ed8b Moved ZombieReplicantView.h to src/kits/interface
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21457 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-06-18 13:38:14 +00:00
Stefano Ceccherini 7c42f05d49 moved kZombieColor to ZombieReplicantView.h
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21456 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-06-18 13:37:42 +00:00
Stefano Ceccherini fab61b6237 Moved TextInput.h to src/kits/interface as it's only used there.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21455 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-06-18 13:31:46 +00:00
Ryan Leavengood 5a1210fbef Moved the BAboutWindow implementation to the shared source directory, which
despite being talked about repeatedly, does not currently exist.

Adding this required adding some new Jam rules to deal with this shared source
directory and headers. I had some fun figuring this out. Despite writing
articles about Jam in the Haiku newsletter a few years ago I still find Jam to
be a PITA at times.

But my solution seems to work pretty well. Basically you just call the rule
UseSharedSource and pass the name of the shared source file you want to use.
This rule sets up the header directories and the right Jam variables for the
source file. You then add the source file to the source list in the Application
rule like any other source file.

I also made the authors list sent to the about window constructor null
terminated instead of passing the size of the array, as suggested by Hugo.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21391 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-06-12 03:54:07 +00:00
Ryan Leavengood a8a83855b0 Initial implementation of the common BAboutWindow class. Of course I just
realized that calling it a window may not be strictly correct since it isn't a
decendent of BWindow, but just uses a BAlert. Oh well, it can be changed if
need be.

I'm also checking in the first use of it, in ShowImage. Since ShowImage can
still be compiled for R5 I've added a #ifdef around the new BAboutWindow
related code.

I'm open for suggestions for the interface for this class, well mostly the
constructor. I'm not a big fan of having to specify the number of authors.

For now I'm making the header private, but I don't think it would be a big deal
to expose it publically.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21389 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-06-11 00:14:32 +00:00
Stefano Ceccherini 3616859a05 Changed the interaction between BMenuFrame, BMenuScroller and
BMenuWindow. BMenuScroller now is just the scroller button, and it's a 
child of BMenuWindow. This simplifies attaching/detaching the 
scrollers, and it's also a bit cleaner. 
The lower scroller wasn't shown anymore for some reason, and this commit also fixes this problem.
A drawing bug shows up now, though: when scrolling the menu UP, some 
spurious lines are drawn over the menu. I wonder if this is an 
app_server bug or what.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21326 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-06-05 10:20:06 +00:00
Stefano Ceccherini 140334f858 Added error checking using exceptions
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21112 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-05-12 08:46:56 +00:00
Stefano Ceccherini 4bfa8f22df completes previous commit. Sorry for breaking the build
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20998 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-05-03 16:34:31 +00:00
Jérôme Duval c25f230cb6 added _get_key_map() to get the character map size
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20917 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-30 10:07:34 +00:00
Stefano Ceccherini a3d758e369 Added support for font settings in PictureDataWriter. Not used yet
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20381 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-03-13 11:14:47 +00:00
Marcus Overhagen 0b0ecfab90 Added "const" to many parameters.
Removed most data allocations/copying from PicturePlayer, ServerPicture now has to do this when converting coordinates.
Added additional functions to ViewLayer to copy&convert multiple BPoint, BRect, BRegion to Screen coordinates, those should be further optimized.
Removed some function call overhead.
Note: some functions of PicturePlayer don't appear to be implented by PictureDataWriter,


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20292 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-03-01 23:17:40 +00:00
Marcus Overhagen a20cecff60 removed unnecessary use of const_cast<> and (global) do_playback() function
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20290 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-03-01 18:37:55 +00:00
Axel Dörfler cf2aeb201f * Implemented BDragger::{Show|Hide}AllDraggers() and its backend in the app_server.
This fixes bug #242. The value is currently stored in a separate file.
* Removed some unused codes from ServerProtocol.h.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20188 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-02-21 07:57:21 +00:00
Stefano Ceccherini c733893846 Greatly improved scrolling, and simplified the code too. Now scrolling
is done from inside the BMenu::_track() function, and not inside Pulse() 
anymore. Patch by Lucasz Zemczak


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19653 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-12-29 07:01:08 +00:00
Michael Lotz f3001f6a1d Corrected comments. It's a 0 byte, not a NULL pointer.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19625 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-12-25 22:02:01 +00:00
Michael Lotz 3379428150 * Made UTF8 functions overflow safe
* Unified UTF8CountChars and UTF8ToLength and removed the latter
* Rewrote UTF8CountBytes to use the more safe algorithm from UTF8CountChars
* Removed the unsafe count_utf8_bytes() function

This should fix bug #839. Marcus can you please review?

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19624 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-12-25 21:58:00 +00:00
Stefano Ceccherini 0c48fc7c74 Enable state synching for ServerPictures. Fixes bug 520
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19379 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-11-28 14:52:51 +00:00
Axel Dörfler 2628e60cbc Moved BMenuWindow, BMenuFrame, and BMenuScroller into the BPrivate namespace.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19360 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-11-22 11:52:18 +00:00
Stefano Ceccherini 27cc25083e First try at menu scrolling, courthesy of Łukasz Zemczak. Works more or less, although a bit buggy
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19343 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-11-20 20:19:55 +00:00
Stefano Ceccherini 7022e7903a added license
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19269 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-11-13 07:28:19 +00:00
Jérôme Duval 94acebc5d2 fix the build
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19267 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-11-12 23:25:40 +00:00