1141 Commits

Author SHA1 Message Date
Cameron Cawley
7e0dfe0081 GRAPHICS: Use custom stream callbacks for loading TTF fonts 2024-07-23 15:33:43 +01:00
Cameron Cawley
ff530edcb1 GRAPHICS: Deprecate ManagedSurface methods that implicitly copy pixel data 2024-07-02 13:31:18 +01:00
Scott Percival
e1f2418c17
GRAPHICS: MACGUI: Fix MacMenu to support 32-bit graphics 2024-06-18 18:24:08 +08:00
Krish
1c1ed2e61e GRAPHICS: MACGUI: Fix compilation with DEBUG enabled 2024-06-03 14:01:15 +02:00
Krish
a51e33f1de GRAPHICS: MACGUl: Handle empty text in selection logic
Fixes crash in The Apartment version D4, movie "editableText"
./scummvm --start-movie=editableText theapartment4
2024-06-03 14:01:15 +02:00
Hubert Maier
9139412157 JANITORIAL: Fix refering typo in mactext.cpp 2024-05-18 13:52:31 +02:00
Hubert Maier
a545fa7539 JANITORIAL: Fix extention typos in mactext-canvas.cpp 2024-05-18 13:52:31 +02:00
Eugene Sandulenko
5bd7b57282
GRAPHICS: MACGUI: Switch TTFMap to saner data structure not requiring global constructor 2024-05-12 15:23:30 +02:00
Cameron Cawley
248ab4ca15 GRAPHICS: MACGUI: Improve image quality in markdown documents 2024-05-09 15:19:17 +02:00
InariInDream
cea8312c35 GUI: load ttf from archive in Unicode branch 2024-05-04 00:14:31 +02:00
InariInDream
bd867b109a GUI: Switch HelpDialog to TTF fonts 2024-05-04 00:14:31 +02:00
InariInDream
e70ea93149 GRAPHICS: MACGUI: Add support for TTF font maps 2024-05-04 00:14:31 +02:00
Eugene Sandulenko
2c33cfb478
GRAPHICS: MACGUI: Hid too noisy warning 2024-04-21 22:33:40 +02:00
hecmar007
558167eaa2
MACGUI WAGE: Handle \n in end of string case
Add logic to correctly add new line when a \n is present at the end of a string.
2024-04-01 18:21:24 +02:00
Matthew Jimenez
ee5ebec7ca IMAGE: Remove palette start from image decoder.
The palette start value was always zero, adding complexity without benefit.
2024-03-31 23:16:59 +03:00
D G Turner
3dcd3e6fa6 GRAPHICS: MACGUI: Fix Signed vs. Unsigned Comparison GCC Compiler Warnings 2024-03-30 16:40:22 +00:00
Krish
34ecd753ad GRAPHICS: MACGUI: Implement submenu scrolling 2024-03-27 15:34:34 +01:00
s-m33r
b2851f8128 GRAPHICS: MACGUI: add _draggable property to BaseMacWindow 2024-03-25 21:22:56 +01:00
Nabeel Khan
5b10353a68 GUI: Implement Window border draggability 2024-03-14 18:59:16 +01:00
hecmar007
c6c80b9313
GRAPHICS: MACGUI: Process extra long words (#5703)
GRAPHICS:  MACGUI: Process extra long words

Added functionality to rewrap words that split into different lines.
2024-03-13 17:39:21 +01:00
Matthew Jimenez
5219c99400 GRAPHICS: Move PaletteManager definition to a separate header 2024-03-12 12:24:00 +02:00
Torbjörn Andersson
1bf0dbad75 GRAPHICS: MACGUI: Eliminate timer use
As part of fixing a graphical glitch in Mac Indiana Jones and the Last
Crusade, eliminate the menu timer from the Mac window manager. It's just
too unpredictable and error prone for my taste.
2024-03-10 23:12:25 +01:00
polyesterswing
9626012752 MACGUI: Fill in the upper-left and upper-right corners with black 2024-03-04 19:16:22 +01:00
polyesterswing
a6b0d088c2 Revert "GRAPHICS: MACGUI: Fix green borders in upper right and upper left corners of Mac menu bar"
This reverts commit 49ae002d6b13d97c7a8825a62ff1f8af56150eb8.

The changes in this commit prevents windows in macventure from
displaying
2024-03-04 19:16:22 +01:00
Torbjörn Andersson
5117adc24c GRAPHICS: MACGUI: Give loaded fonts their correct ID
When loading other fonts than the system ones, they would get ID -1, not
the one from their resource ID. Even if you later registered the font
name, the old font entries would still be wrong. Another possibility
would be to update _fontRegistry when registering fonts, but sev was ok
with this way so let's go with it for now.

It does not consider the possibility of ID collisions the way
registerFontName() does, but apparently there shouldn't be much risk of
that.
2024-03-03 19:49:00 +01:00
Torbjörn Andersson
a1c8db3201 JANITORIAL: Clean up some whitespace and double semicolons 2024-01-29 19:32:00 +01:00
Scott Percival
0562ff567c GRAPHICS: MACGUI: Move paragraph end marker when merging rows
Fixes issue where removing an empty line with backspace would remove the
previous empty line also.
2024-01-20 23:14:52 +01:00
Scott Percival
95b47042f0 GRAPHICS: MACGUI: Stop MacTextCanvas::chopChunk from removing last chunk
There needs to be at least one chunk per line of text, or else many
basic text operations will cause a crash.
2024-01-20 23:14:52 +01:00
Scott Percival
b9003c145f GRAPHICS: MACGUI: Fix fgcolor conversion in MacText 2024-01-20 23:14:52 +01:00
Scott Percival
2f16bf2e9f GRAPHICS: MACGUI: Remove pseudotransparency workaround in MacText
Needed in order to e.g. print white text on a black background in
Director.

This reverts 457b09cb4eabab4516230ec4a46d9340bd040bf4
2024-01-20 23:14:52 +01:00
Cameron Cawley
f3fbd2477c GRAPHICS: Allow specifying separate xdpi and ydpi values in loadTTFFont 2024-01-08 23:41:50 +01:00
Eugene Sandulenko
ed4ec96b44
GRAPHICS: MACGUI: Fix links with Unicode characters
If there are unicode characters in the link, it was leading to
wrong length calculation.

Example of such link:

  ![Menü-Symbol](menu.png \"Menü-Symbol\"){w=10em}

The problem is that for simplicity, we are working with UTF8 in
Markdown, but still with U32String in MacTextCanvas. This led to
the string length be calculated for UTF8, which is a multibyte
encoding. As a result, we were overshooting the link parsing
and reading texts as numbers.

This is kind of a hacky solution: we convert text to U32 before
caluclating the string length
2024-01-07 00:39:25 +01:00
Eugene Sandulenko
7361c0f2fa
GRAPHICS: MACGUI: Made readHex() more robust
This fixes crashes in Markdown with malformed translations
2024-01-05 01:04:08 +01:00
Eugene Sandulenko
df3ee65585
GRAPHICS: MACGUI: Added mre debug output 2023-12-30 22:17:18 +01:00
Eugene Sandulenko
3051af3732
GRAPHICS: MACGUI: Switched debug output to 'macgui' debug channel in MacFontManager 2023-12-30 01:05:26 +01:00
Eugene Sandulenko
b0a624df76
GRAPHICS: MACGUI: More debug output to MacFontManager 2023-12-26 21:28:28 +01:00
Cameron Cawley
5b1b14ad80 COMMON: Mark more symbols as const 2023-12-26 20:23:59 +01:00
Le Philousophe
226de788c8 GRAPHICS: Make API use the Path class 2023-12-24 13:19:25 +01:00
Torbjörn Andersson
d4c9c7208f GRAPHICS: MACGUI: Avoid recursion in Mac menu event processing
When moving the mouse through the menu bar, over a part that's not
occupied by menu items, the Mac menu class will start calling
processEvent() recursively. This is bad for two reasons: During the
recursion (which can easily reach a depth of dozens or even hundreds of
calls) there is no delay, so it will use 100% CPU. And once the
recursion unwinds, all the delays will come at once.

This moves the call to eventLoop() to after the first event has been
fully processed. Hopefully that will have approximately the same desired
effect, without any of the bad side effects.
2023-12-16 21:14:59 +01:00
elasota
9e13093610 GRAPHICS: Fix empty controlled statement warning 2023-12-11 23:07:20 +02:00
Matthew Duggan
0f795b481d GRAPHICS: MACGUI: Only set system palette if screen is CLUT8
This is needed to allow use of macgui components while 16-bit graphic games are
running, eg to display help screens.
2023-12-09 13:53:01 +11:00
Scott Percival
2c8d493984 GRAPHICS: MACGUI: Pass through key events even if window not editable
Active MacWindows should always be passed EVENT_KEYDOWN events by MacWindowManager.
Previously it would only do so if the mouse was in the vicinity.

Fixes text input on the savegame screen of Team Xtreme: Operation
Weather Disaster.
2023-12-02 02:47:40 +01:00
Scott Percival
7f5c07a738 MACGUI: Deactivate _lockedWidget when Window is removed
Fixes using the quit widget on the save screen of Team Xtreme: Operation
Weather Disaster.
2023-12-02 02:47:40 +01:00
AndywinXp
49ae002d6b GRAPHICS: MACGUI: Fix green borders in upper right and upper left corners of Mac menu bar
It probably went unnoticed until now because the menu bar is
mostly used for black and white games, and in those instances
the green color is converted to black.

Tested with Indy3, Loom, The Apartment, Spaceship Warlock,
and several WAGE games.
2023-12-01 21:08:04 +01:00
Eugene Sandulenko
63c8367ace
GRAPHICS: MACGUI: Indicate presence of a table in debug output in MacTextCanvas 2023-11-25 19:46:40 -08:00
Eugene Sandulenko
92b03145a2
GRAPHICS: MACGUI: Disable MacText with tables resizing
The problem is more complex than it appears, so, disabling this
before the release, because the current code is removing
tables on resize
2023-11-24 19:48:24 +01:00
Eugene Sandulenko
446908f458
GRAPHICS: MACGUI: Fix crash on reshuffling text after table in Markdown
Array::insert_at() is calling destructor for old data, whuch was freeing
the _table pointer that we are copying to new element which led to
use-after-free.

This moves MacTextLine cleanup to MacTextCanvas.
2023-11-23 00:13:33 +01:00
Torbjörn Andersson
b2568e05ce GRAPHICS: MACGUI: Attempt to fix threading issues
The menuTimerHandler() function is called from a timer, which means that
anything that it touches could potentially cause threading issues. I
suspect this is what's been causing the screen to go black for me a few
times, but it's not something I can reproduce at will. Add a mutex to
try and fix this.
2023-11-18 18:49:55 +01:00
AndywinXp
2efd9ab70a GRAPHICS: MACGUI: Add kWMModeForceMacBorder mode
This allows for having the Mac desktop arc even during Win95 mode.
2023-11-18 18:47:39 +01:00
Torbjörn Andersson
d63ad4c2e3 GRAPHICS: MACGUI: Don't filter keypresses in processMenuShortCut()
This is already done in keyEvent(), which is the only place where
processMenuShortCut() is called. This allows using Alt-<key> as
shortcut, which is consistent with how the Mac emulators I've tried does
it.
2023-11-18 18:47:39 +01:00