summaryrefslogtreecommitdiff
path: root/Userland/Applications/3DFileViewer/main.cpp
AgeCommit message (Collapse)Author
2023-05-24AK: Rename Time to Durationkleines Filmröllchen
That's what this class really is; in fact that's what the first line of the comment says it is. This commit does not rename the main files, since those will contain other time-related classes in a little bit.
2023-05-05LibGUI: Make `Application`'s construction fallibleLucas CHOLLET
The pattern to construct `Application` was to use the `try_create` method from the `C_OBJECT` macro. While being safe from an OOM perspective, this method doesn't propagate errors from the constructor. This patch make `Application` use the `C_OBJECT_ABSTRACT` and manually define a `create` method that can bubble up errors from the construction stage. This commit also removes the ability to use `argc` and `argv` to create an `Application`, only `Main`'s `Arguments` can be used. From a user point of view, the patch renames `try_create` => `create`, hence the huge number of modified files.
2023-04-30LibGUI+Userland: Port Labels to Stringthankyouverycool
2023-04-19LibGUI+Userland: Make Menu::*add_submmenu take name using new stringKarol Kosek
2023-04-19LibGUI+Userland: Make Window::*add_menu take name using new stringKarol Kosek
2023-04-15AK+Everywhere: Change URL::path() to serialize_path()MacDue
This now defaults to serializing the path with percent decoded segments (which is what all callers expect), but has an option not to. This fixes `file://` URLs with spaces in their paths. The name has been changed to serialize_path() path to make it more clear that this method will generate a new string each call (except for the cannot_be_a_base_url() case). A few callers have then been updated to avoid repeatedly calling this function.
2023-04-113DFileViewer+Tubes: Add `map_fixed` to pledgesJelle Raaijmakers
Both applications eventually reach LibGPU's loading of a dynamic library (e.g. LibSoftGPU) which requires this pledge. The pledge was always required, but went unchecked until 01318d8f9b.
2023-02-163DFileViewer: Don't unveil "/home/anon/Documents/3D Models"Lucas CHOLLET
Usage of models is now done by `LibFileSystemAccessClient`.
2023-02-163DFileViewer: Set the window title name in `load_file()`Lucas CHOLLET
This patch allows two things: - Factorizing code that was in main and the open action - Displaying the full path of non-unveiled paths Indeed, looking for the path of a fd is not allowed if the file isn't unveiled. By setting the title in `load_file()` we are actually relying on the value returned by `LibFSAC` who is actually authorized to retrieve the entire path.
2023-02-163DFileViewer: Don't try to open textures without `LibFSASC`Lucas CHOLLET
2023-02-163DFileViewer: Port to `Core::File`Lucas CHOLLET
2023-02-163DFileViewer: Remove unnecessary tests when loading filesLucas CHOLLET
These tests are already performed by `LibFileSystemAccessClient`.
2023-02-163DFileViewer: Use `LibFSAC` in `GLContextWidget::load_path()`Lucas CHOLLET
It was the only function to not use the `LibFSAC`, it will allow us to: - Not unveil some file - Drop some tests on to-be-read-from file as they are performed in `LibFSAC`.
2023-02-163DFileViewer: Port `MeshLoader` and its child to the new `Core::File`Lucas CHOLLET
As it was using the `lines()` method of `Core::DeprecatedFile`, this patch also introduce the usage of `BufferedFile` to take advantage of its API: `can_read_line()` and `read_line()`.
2023-02-13LibCore: Rename `File` to `DeprecatedFile`Tim Schumacher
As usual, this removes many unused includes and moves used includes further down the chain.
2023-01-26LibGfx: Remove `try_` prefix from bitmap creation functionsTim Schumacher
Those don't have any non-try counterpart, so we might as well just omit it.
2023-01-13Userland: Remove a bunch of unveil calls on /sys/kernel/processesLiav A
These are not needed anymore since the introduction of the new get_root_session_id syscall.
2023-01-073DFileViewer: Use AK::Time to accumulate frame and cycle countsAndrew Kaster
Let's accumulate frame times in AK::Time and only convert to ms for display.
2023-01-07LibFileSystemAccessClient: Rename try_* functions to try_*_deprecatedKarol Kosek
These functions return the deprecated `Core::File` class, so let's mark it as such to avoid possible confusion between future non try_* functions which will use Core::Stream family classes and to possibly grab someone's attention. :^)
2023-01-06LibGUI+Everywhere: Use fallible Window::set_main_widget() everywhere :^)Sam Atkins
Rip that bandaid off! This does the following, in one big, awkward jump: - Replace all uses of `set_main_widget<Foo>()` with the `try` version. - Remove `set_main_widget<Foo>()`. - Rename the `try` version to just be `set_main_widget` because it's now the only one. The majority of places that call `set_main_widget<Foo>()` are inside constructors, so this unfortunately gives us a big batch of new `release_value_but_fixme_should_propagate_errors()` calls.
2022-12-063DFileViewer: Properly propagate errors from WavefrontOBJLoaderMaciej
Fixes 3 FIXMEs.
2022-12-06AK+Everywhere: Rename String to DeprecatedStringLinus Groh
We have a new, improved string type coming up in AK (OOM aware, no null state), and while it's going to use UTF-8, the name UTF8String is a mouthful - so let's free up the String name by renaming the existing class. Making the old one have an annoying name will hopefully also help with quick adoption :^)
2022-11-223DFileViewer: Propagate key events to the windowNames4Noobs
Before this, shortcuts would not work due to key events not being propagated to the window.
2022-11-13Userland: Accept drag_enter events for widgets supporting file dropsKarol Kosek
This patch will switch cursor to DragCopy when a user enters a widget while dragging file(s), giving them a visual clue that it *might* be dropped into this widget. This is a rather naive approach, as the cursor icon will change for any kind of file, as currently programs don't know the drag contents before dropping it. But after all I think it's better than nothing. :^)
2022-10-25Applications: Use new global variables at /sys/kernel/ directoryLiav A
2022-10-25Userland: Let applications make use of make_command_palette_action()demostanis
2022-10-03Userland: Unveil /proc/all in applications which require itTimothy Flynn
These were missed in 7af5eef. It is needed for any application using e.g. FileSystemAccessServer.
2022-10-03Userland: Tighten promises by removing 'proc' where it isn't usedTimothy Flynn
This is a partial revert of commit 7af5eef. After 97d15e9, the 'proc' promise is not needed for operations using getsid(). This also fixes launching several applications in which 7af5eef added the 'proc' promise only in the second call to pledge().
2022-10-03SystemServer+LoginServer+Userland: Switch to sid-based socketsPeter Elliott
This commit does three things atomically: - switch over Core::Account+SystemServer+LoginServer to sid based socket names. - change socket names with %uid to %sid. - add/update necessary pledges and unveils. Userland: Switch over servers to sid based sockets Userland: Properly pledge and unveil for sid based sockets
2022-09-29AK+Everywhere: Replace "protocol" with "scheme" url helpersnetworkException
URL had properly named replacements for protocol(), set_protocol() and create_with_file_protocol() already. This patch removes these function and updates all call sites to use the functions named according to the specification. See https://url.spec.whatwg.org/#concept-url-scheme
2022-09-16LibGL: Make GL::create_context fallibleAndrew Kaster
Propagate errors in places that are already set up to handle them, like WebGLRenderingContext and the Tubes demo, and convert other callers to using MUST.
2022-08-14Base: Launch FileSystemAccessServer at session start-upLucas CHOLLET
2022-07-12Everywhere: Add sv suffix to strings relying on StringView(char const*)sin-ack
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.
2022-04-18Userland: Always construct Application with try_create()Sam Atkins
2022-04-06LibGL+LibGPU+LibSoftGPU: Load SoftGPU driver dynamicallyStephan Unverwerth
This loads libsoftgpu.so during GLContext creation and instantiates the device class which is then passed into the GLContext constructor.
2022-04-023DFileViewer: Allow escape key to exit fullscreen modeAdam Patterson
I went into fullscreen mode, via the View menu, before looking at the associated key (F11). I had to kill Qemu to be able to escape. Escape is an intuitive way to exit most fullscreen modes.
2022-04-013DViewer: Add support for dropping filesJames Mintram
2022-04-013DFileViewer: Do not abort model loading when texture is missingStephan Unverwerth
2022-02-28Applications: Change static constexpr variables to constexprLenny Maiorani
Function-local `static constexpr` variables can be `constexpr`. This can reduce memory consumption, binary size, and offer additional compiler optimizations.
2022-01-203DFileViewer: Use FileSystemAccessClient::try_* APIsMustafa Quraish
This commit also removed the redundant `filename` parameter from `GLContextWidget::load_file`, since the filename is already stored within the file itself.
2022-01-20Userland: Add horizontal mouse scroll supportDmitry Petrov
2022-01-18LibGL+LibSoftGPU+3DFileViewer: Implement Specular highlighting :^)Jesse Buhagiar
2022-01-123DFileViewer: Replace lambertian lighting with GL LightingJesse Buhagiar
2022-01-093DFileViewer: Propagate errors using try_set_main_widget in maincreator1creeper1
2021-12-013DFileViewer: Add checkbox to disable textureJelle Raaijmakers
2021-11-293DFileViewer: Set correct aspect ratio in view frustumJelle Raaijmakers
2021-11-293DFileViewer: Improve FPS displayJelle Raaijmakers
We only showed frame times down to the millisecond. Our FPS counter was based off of that, allowing for a limited set of possible FPS values. Convert these calculations to floating point so we get more useful FPS and frame time values.
2021-11-28Everywhere: Use default execpromises argument for Core::System::pledgeBrian Gianforcaro
2021-11-23LibCore+LibSystem: Move syscall wrappers from LibSystem to LibCoreAndreas Kling
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.
2021-11-22Everywhere: Use Application::construct() with Main::Arguments directlyMustafa Quraish
Use the updated API everywhere we are currently manually passing in `arguments.argc` and `arguments.argv`.