Age | Commit message (Collapse) | Author |
|
Each of these strings would previously rely on StringView's char const*
constructor overload, which would call __builtin_strlen on the string.
Since we now have operator ""sv, we can replace these with much simpler
versions. This opens the door to being able to remove
StringView(char const*).
No functional changes.
|
|
|
|
|
|
|
|
This includes the text box and the page up/down arrows.
|
|
|
|
|
|
This was a bit jarring, and didn't align with the behavior of other PDF
renderers.
|
|
When resizing the application, the pages are expected to grow or shrink
proportionally. This means that after a resize, we need to rerender
every page.
|
|
|
|
|
|
|
|
Security handlers manage encryption and decription of PDF files. The
standard security handler uses RC4/MD5 to perform its crypto (AES as
well, but that is not yet implemented).
|
|
|
|
|
|
Function-local `static constexpr` variables can be `constexpr`. This
can reduce memory consumption, binary size, and offer additional
compiler optimizations.
|
|
|
|
|
|
|
|
This implements the rotate cw/ccw actions in PDFViewer.
Since the rendered pages are stored in a HashMap for caching,
the bitmap is wrapped in a struct with the current rotation.
This way the caching works as expected while zooming, and a new bitmap
is rendered when the page is rotated.
|
|
Enable the use of the middle mouse button for panning in PDFViewer.
|
|
Make PDFViewer::zoom_in() & ::zoom_out() public and add menu and toolbar
actions. Also add an action for zoom reset.
|
|
The open_outline_action logic was backwards resulting in it
being closed on the first click and opened on the second,
and opposite if document->outline() was true.
There was also a collision with the Ctrl+O shortcut for opening a
document, this changes it to Ctrl+S instead.
This commit also changes the wording to 'Toogle' instead of 'Open/Close'
since the text wasn't updated as expected, and lastly, add a View menu
with the action.
|
|
The same idea as 'increase_slider_by()', it helps us to avoid repeating
the pattern 'set_value(value() - delta)'.
|
|
This method help us to avoid repeating the pattern
'set_value(value() + delta)'.
|
|
|
|
With this change, System::foo() becomes Core::System::foo().
Since LibCore builds on other systems than SerenityOS, we now have to
make sure that wrappers work with just a standard C library underneath.
|
|
Use the updated API everywhere we are currently manually passing in
`arguments.argc` and `arguments.argv`.
|
|
|
|
Another one that was used in a fajillion places.
|
|
This was used in a lot of places, so this patch makes liberal use of
ErrorOr<T>::release_value_but_fixme_should_propagate_errors().
|
|
|
|
Derivatives of Core::Object should be constructed through
ClassName::construct(), to avoid handling ref-counted objects with
refcount zero. Fixing the visibility means that misuses like this are
more difficult.
|
|
|
|
Use `request_file_read_only_approved()` for the file (if any) is
specified through a command line argument.
|
|
|
|
This allows for typing [8] instead of [8, 8, 8, 8] to specify the same
margin on all edges, for example. The constructors follow CSS' style of
specifying margins. The added constructors are:
- Margins(int all): Sets the same margin on all edges.
- Margins(int vertical, int horizontal): Sets the first argument to top
and bottom margins, and the second argument to left and right margins.
- Margins(int top, int vertical, int bottom): Sets the first argument to
the top margin, the second argument to the left and right margins,
and the third argument to the bottom margin.
|
|
Most of the models were just calling did_update anyway, which is
pointless since it can be unified to the base Model class. Instead, code
calling update() will now call invalidate(), which functions identically
and is more obvious in what it does.
Additionally, a default implementation is provided, which removes the
need to add empty implementations of update() for each model subclass.
Co-Authored-By: Ali Mohammad Pur <ali.mpfard@gmail.com>
|
|
Applications previously had to create a GUI::Menubar object, add menus
to it, and then call GUI::Window::set_menubar().
This patch introduces GUI::Window::add_menu() which creates the menubar
automatically and adds items to it. Application code becomes slightly
simpler as a result. :^)
|
|
Also mark them as [[nodiscard]].
|
|
|
|
This adds component declarations so that users can select to not build
certain parts of the OS.
|
|
This time I remembered to actually commit the image files, oops :^)
|
|
|
|
|
|
Also use set_current_number() instead of set_text(), so we don't have to
create a string from the number ourselves.
|
|
Instead of having both always enabled once a document is loaded, update
them on each page change and disable if appropriate.
|
|
go-up.png and go-down.png don't exist (and would look silly here, with
the buttons being next to each other horizontally). Use go-back.png and
go-forward.png instead.
|
|
|
|
|