Commit graph

1866 commits

Author SHA1 Message Date
asynts
97660ad46c QuickShow: Use new format functions. 2020-10-06 15:28:39 +02:00
asynts
0b29c5e41d PixelPaint: Use new format functions. 2020-10-06 15:28:39 +02:00
asynts
377afff33a Piano: Use new format functions. 2020-10-06 15:28:39 +02:00
asynts
5aadf00463 KeyboardSettings: Use new format functions. 2020-10-06 15:28:39 +02:00
asynts
da9c995a8c IRCClient: Use new format functions. 2020-10-06 15:28:39 +02:00
asynts
7c2cd81edb AK+Format: Exclude prefix from width calculation.
When we write the format specifier '{:#08x}' we are asking for eight
significant digits, zero padding and the prefix '0x'.

However, previously we got only six significant digits because the
prefix counted towards the width. (The number '8' here is the total
width and not the number of significant digits.)

Both fmtlib and printf shared this behaviour. However, I am introducing
a special case here because when we do zero padding we really only care
about the digits and not the width.

Notice that zero padding is a special case anyways, because zero padding
goes after the prefix as opposed to any other padding which goes before
it.
2020-10-06 15:28:39 +02:00
asynts
aea5fff0d1 HexEditor: Use new format functions.
I changed the formatting for some numbers when it made sense, because I
believe '0x00000020' to be more expressive than '      20' for example.
2020-10-06 15:04:37 +02:00
asynts
c776d76b71 Help: Use new format functions. 2020-10-06 15:04:37 +02:00
asynts
30b9dff5aa FontEditor: Use new format functions. 2020-10-06 15:04:37 +02:00
Luke
52c31bb743 LibGfx+FontEditor+Fonts: Add "mean line" value to all fonts
The main inspiration behind this was to have a correct ex CSS unit.
The mean line is based off what it shows in the CSS Values and Units
Level 4 specification, section 6.1.1.

https://www.w3.org/TR/css-values-4/#font-relative-lengths
2020-10-05 20:05:40 +02:00
asynts
ee9c18c118 FileManager: Use new format functions. 2020-10-05 16:25:50 +02:00
asynts
7fd4646acb DisplaySettings: Use format instead of printf. 2020-10-05 14:19:24 +02:00
asynts
9efc69a6e2 Debugger: Use format instead of printf.
There was one bogus printf in a signal handler, I just left it there.
2020-10-05 14:19:24 +02:00
asynts
e1dfeef11f Calendar: Use format instead of printf.
I am not sure what this message is supposed to tell me, but I'll just
keep it around.
2020-10-05 14:19:24 +02:00
asynts
206e48abb5 Calculator: Use format instead of printf.
This also fixes a graphical bug where the decimal point was always
rendered. The number four was represented as '4.' instead of '4'. Now
the decimal point is only shown when there are decimal places.
2020-10-05 14:19:24 +02:00
Andreas Kling
94b95a4924 LibJS: Remove Interpreter::call()
Just use VM::call() directly everywhere.
2020-10-04 23:08:49 +02:00
asynts
59e7ffa86d AK: Make the return type of dbgputstr consistent. 2020-10-04 19:18:32 +02:00
Andreas Kling
4cf3a1eb41 Browser: Remove dbgln() statement that was crashing on startup
Don't have time to dig into this right now, but let's unbreak Browser.
2020-10-04 17:12:11 +02:00
Andreas Kling
6f5322409d Browser: Fix build after dbgf() -> dbgln() rename 2020-10-04 17:09:01 +02:00
asynts
d5ffb51a83 AK: Don't add newline for outf/dbgf/warnf.
In the future all (normal) output should be written by any of the
following functions:

    out    (currently called new_out)
    outln
    dbg    (currently called new_dbg)
    dbgln
    warn   (currently called new_warn)
    warnln

However, there are still a ton of uses of the old out/warn/dbg in the
code base so the new functions are called new_out/new_warn/new_dbg. I am
going to rename them as soon as all the other usages are gone (this
might take a while.)

I also added raw_out/raw_dbg/raw_warn which don't do any escaping,
this should be useful if no formatting is required and if the input
contains tons of curly braces. (I am not entirely sure if this function
will stay, but I am adding it for now.)
2020-10-04 17:04:55 +02:00
asynts
616af36d91 Browser: Use format functions instead of printf. 2020-10-04 14:23:25 +02:00
Linus Groh
bcfc6f0c57 Everywhere: Fix more typos 2020-10-03 12:36:49 +02:00
Andreas Kling
44f9637e20 Browser: Add a special context menu for images
Now, right-clicking on an image allows you to open that image in this
tab or a new tab. You can also copy the image URL, and even copy the
image itself to the clipboard! :^)

Copying to the clipboard will not work in a multi-process context yet,
since we need to send the image bitmap across the IPC boundary and this
patch does not do that.
2020-10-02 19:03:10 +02:00
Andreas Kling
d00bfd0eaa Browser: Move the opening of a download window to its own function
This should probably grow into a proper download manager at some point,
but for now let's at least move it out of the context menu callback.
2020-10-02 19:00:45 +02:00
AnotherTest
c1fc27cab2 HackStudio+TextEditor: Add the Shell syntax highlighter 2020-09-30 20:05:24 +02:00
Andreas Kling
e4bda2e1e7 LibJS: Move Console from Interpreter to GlobalObject
Each JS global object has its own "console", so it makes more sense to
store it in GlobalObject.

We'll need some smartness later to bundle up console messages from all
the different frames that make up a page later, but this works for now.
2020-09-29 21:15:06 +02:00
AnotherTest
f159d161fa Spreadsheet: Let the cells know their own position in the sheet 2020-09-28 17:41:48 +02:00
Andreas Kling
2946a684ef ProtocolServer+LibWeb: Support more detailed HTTP requests
This patch adds the ability for ProtocolServer clients to specify which
HTTP method to use, and also to include an optional HTTP request body.
2020-09-28 11:55:26 +02:00
Benoît Lormeau
f0f6b09acb AK: Remove the ctype adapters and use the actual ctype functions instead
This finally takes care of the kind-of excessive boilerplate code that were the
ctype adapters. On the other hand, I had to link `LibC/ctype.cpp` to the Kernel
(for `AK/JsonParser.cpp` and `AK/Format.cpp`). The previous commit actually makes
sense now: the `string.h` includes in `ctype.{h,cpp}` would require to link more LibC
stuff to the Kernel when it only needs the `_ctype_` array of `ctype.cpp`, and there
wasn't any string stuff used in ctype.
Instead of all this I could have put static derivatives of `is_any_of()` in the
concerned AK files, however that would have meant more boilerplate and workarounds;
so I went for the Kernel approach.
2020-09-27 21:15:25 +02:00
Benoit Lormeau
f158cb27ea LibC: Remove an unneeded string.h include in ctype.h/cpp
And include string.h in the files that actually needed it
2020-09-27 21:15:25 +02:00
Andreas Kling
591b7b7031 LibJS: Remove js_string(Interpreter&, ...) 2020-09-27 20:26:58 +02:00
Andreas Kling
340a115dfe LibJS: Make native function/property callbacks take VM, not Interpreter
More work on decoupling the general runtime from Interpreter. The goal
is becoming clearer. Interpreter should be one possible way to execute
code inside a VM. In the future we might have other ways :^)
2020-09-27 20:26:58 +02:00
Andreas Kling
6861c619c6 LibJS: Move most of Interpreter into VM
This patch moves the exception state, call stack and scope stack from
Interpreter to VM. I'm doing this to help myself discover what the
split between Interpreter and VM should be, by shuffling things around
and seeing what falls where.

With these changes, we no longer have a persistent lexical environment
for the current global object on the Interpreter's call stack. Instead,
we push/pop that environment on Interpreter::run() enter/exit.
Since it should only be used to find the global "this", and not for
variable storage (that goes directly into the global object instead!),
I had to insert some short-circuiting when walking the environment
parent chain during variable lookup.

Note that this is a "stepping stone" commit, not a final design.
2020-09-27 20:26:58 +02:00
Andreas Kling
b245121f13 Spreadsheet: clang-format 2020-09-26 00:10:57 +02:00
Tibor Nagy
59a0e5ba1e Applications: Paint transparency grids through StylePainter 2020-09-26 00:00:08 +02:00
AnotherTest
43b2928688 Spreadsheet: Add the 'Date' cell type
Since `JS::Date::value_of()' returns the timestamp in ms, this new type
assumes that the value given is also in ms.
2020-09-25 23:55:33 +02:00
AnotherTest
a2efff9287 Spreadsheet: Treat an empty format string as "default" 2020-09-25 23:55:33 +02:00
AnotherTest
4748248fef Spreadsheet: Save and load cell types and formatting options 2020-09-25 23:55:33 +02:00
AnotherTest
395df7b27d Spreadsheet: Add conditional formatting
Currently only supports setting the foregound and the background colours.
This patch also unifies `foreground_color' and `background_color' used
throughout to a `Format' struct, in hopes of getting more formatting
options one day :P
2020-09-25 23:55:33 +02:00
Ben Wiederhake
9ef1461ec9 Meta+Applications: Make clang-format-10 clean 2020-09-25 21:18:17 +02:00
Andreas Kling
7d30cf7122 FileManager: Teach DirectoryView subviews to create editing delegates
This enables inline editing of filenames for table views, where this is
already supported. More work in LibGUI will be required to support the
feature in icon and columns views.
2020-09-24 11:36:02 +02:00
asynts
1cb8be9906 Applications+IRCClient: Use new format functions. 2020-09-23 21:45:28 +02:00
Andreas Kling
4a8bfcdd1c LibJS: Move the current exception from Interpreter to VM
This will allow us to throw exceptions even when there is no active
interpreter in the VM.
2020-09-22 20:10:20 +02:00
Tibor Nagy
3bd6142918 SystemMonitor: Wrap file descriptor and unveiled paths model into a SortingProxyModel 2020-09-22 19:05:50 +02:00
Tibor Nagy
f910cdcdb7 SystemMonitor: Fix assert when sorting by the "Page map" column 2020-09-22 19:05:50 +02:00
Tibor Nagy
e596b1da88 SystemMonitor: Wrap adapters and sockets model into a SortingProxyModel 2020-09-22 19:05:50 +02:00
Tibor Nagy
2c1b244889 SystemMonitor: Add sorting key to the devices model 2020-09-22 19:05:50 +02:00
Peter Elliott
7907df7617 Applications: Use placeholders in TextBoxes where applicable 2020-09-21 20:15:10 +02:00
Andreas Kling
df3ff76815 LibJS: Rename InterpreterScope => InterpreterExecutionScope
To make it a little clearer what this is for. (This is an RAII helper
class for adding and removing an Interpreter to a VM's list of the
currently active (executing code) Interpreters.)
2020-09-21 14:35:12 +02:00
AnotherTest
e7f5090808 Spreadsheet: Always keep the workbook interpreter in VM scope
Fixes #3570.
2020-09-21 00:10:19 +02:00