summaryrefslogtreecommitdiff
path: root/Userland/Demos
AgeCommit message (Collapse)Author
2021-08-03Everywhere: Replace most cases of exit() with Application::quit()Timothy
Application::quit() is nicer for most cases where exit() is used. Cases where exit() is used intentionally for early termination are left intact.
2021-08-01Demos: Remove unused header includesBrian Gianforcaro
2021-07-21Userland: Add GUI::Window::add_menu() and use it everywhereAndreas Kling
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. :^)
2021-07-21LibGfx: Use "try_" prefix for static factory functionsAndreas Kling
Also mark them as [[nodiscard]].
2021-07-19Everywhere: Use AK/Math.h if applicableHendiadyoin1
AK's version should see better inlining behaviors, than the LibM one. We avoid mixed usage for now though. Also clean up some stale math includes and improper floatingpoint usage.
2021-07-17WidgetGallery: Pledge threadMarcus Nilsson
This is needed to use the file picker dialog.
2021-07-17WidgetGallery: Remove unused includeMarcus Nilsson
2021-07-08AK+Userland: Add generic `AK::abs()` function and use itDaniel Bertalan
Previously, in LibGFX's `Point` class, calculated distances were passed to the integer `abs` function, even if the stored type was a float. This caused the value to unexpectedly be truncated. Luckily, this API was not used with floating point types, but that can change in the future, so why not fix it now :^) Since we are in C++, we can use function overloading to make things easy, and to automatically use the right version. This is even better than the LibC/LibM functions, as using a bit of hackery, they are able to be constant-evaluated. They use compiler intrinsics, so they do not depend on external code and the compiler can emit the most optimized code by default. Since we aren't using the C++ standard library's trick of importing everything into the `AK` namespace, this `abs` function cannot be exported to the global namespace, as the names would clash.
2021-07-05Fire: Make the main widget a GUI::FrameAndreas Kling
2021-07-04WindowServer: Make most remaining WindowServer IPC calls asyncAndreas Kling
The only remaining sync call from client to server is now the call that switches a window's backing store. That one actually relies on the synchronization to hand over ownership of the backing stores, so it has to stay synchronous for now.
2021-06-17Everywhere: Add component declarationsGunnar Beutner
This adds component declarations so that users can select to not build certain parts of the OS.
2021-06-07CatDog: Enhance the speech bubble artificial intelligenceBrian Gianforcaro
Enable cat dog to greet you, and help you with yak shave sessions.
2021-06-06AK+Everywhere: Disallow constructing Functions from incompatible typesAli Mohammad Pur
Previously, AK::Function would accept _any_ callable type, and try to call it when called, first with the given set of arguments, then with zero arguments, and if all of those failed, it would simply not call the function and **return a value-constructed Out type**. This lead to many, many, many hard to debug situations when someone forgot a `const` in their lambda argument types, and many cases of people taking zero arguments in their lambdas to ignore them. This commit reworks the Function interface to not include any such surprising behaviour, if your function instance is not callable with the declared argument set of the Function, it can simply not be assigned to that Function instance, end of story.
2021-05-29Everywhere: Use s.unverwerth@serenityos.org :^)Stephan Unverwerth
2021-05-21Revert "Userland: static vs non-static constexpr variables"Linus Groh
This reverts commit 800ea8ea969835297dc7e7da345a45b9dc5e751a. Booting the system no longer worked after these changes.
2021-05-21Userland: static vs non-static constexpr variablesLenny Maiorani
Problem: - `static` variables consume memory and sometimes are less optimizable. - `static const` variables can be `constexpr`, usually. - `static` function-local variables require an initialization check every time the function is run. Solution: - If a global `static` variable is only used in a single function then move it into the function and make it non-`static` and `constexpr`. - Make all global `static` variables `constexpr` instead of `const`. - Change function-local `static const[expr]` variables to be just `constexpr`.
2021-05-21LibGfx: Add missing TextAlignment::BottomLeftLinus Groh
2021-05-20LibGfx: Remove Gfx::FontDatabase::default_bold_fixed_width_font()Andreas Kling
Ask for a bold_variant() of the default_fixed_width_font() instead.
2021-05-20LibGfx: Remove Gfx::FontDatabase::default_bold_font()Andreas Kling
Instead use default_font().bold_variant() in cases where we want a bold variant of the default font. :^)
2021-05-19CatDog: Don't show context menu when clicking outside of widgetMarcus Nilsson
The context menu for CatDog was shown when right clicking anywhere on the screen because of global cursor tracking being enabled. Also fix event not being passed by reference. Fixes #7285
2021-05-193DFileViewer: Move `Demos/GLTeapot` to `Applications/3DFileViewer`Erik Biederstadt
Also changes the category to `Graphics`
2021-05-19GLTeapot: Adds a help menu to the GLTeapot demoErik Biederstadt
Having a help menu maintains better consistency with the other GUI apps on the system.
2021-05-19GLTeapot: Adds additional error checking when loading filesErik Biederstadt
- If the 3D file contains no vertices then an error is raised - If the file is not an OBJ file then an error is raised
2021-05-19GLTeapot: Add the ability to open 3D filesErik Biederstadt
This change makes it possible for the GLTeapot demo to open any OBJ file.
2021-05-18CatDog: Remove global menu and add context menuMarcus Nilsson
There was no way to close catdog since it relied on global menus, this adds a context menu for opening the about dialog and quitting. Fixes #7252
2021-05-18Mandelbrot: Export images in a fixed resolutionGunnar Beutner
This makes the exported image independent from the current window size and just always exports it at 1920x1080.
2021-05-18Mandelbrot: Keep the aspect ratio when (re-)sizing the windowGunnar Beutner
Previously the initial aspect ratio was incorrect and there was nothing to ensure that the aspect ratio is kept when resizing the window.
2021-05-18Mandelbrot: Add support for exporting the current imageGunnar Beutner
Unfortunately this means unveil() won't work - at least until we get something like FilePickerServer.
2021-05-18Mandelbrot: Implement color smoothing with gradientsGunnar Beutner
This removes the color banding that happens for some of the "outer" areas which all have the same iteration count.
2021-05-18Mandelbrot: Maintain aspect ratio when selecting a regionGunnar Beutner
This makes sure the aspect ratio of the widget and the selection match. Otherwise you'd end up with distorted images when zooming in.
2021-05-17Demos: Add Mandelbrot demoGunnar Beutner
This adds a very rudimentary Mandelbrot viewer. It supports zooming and pretty much nothing else. Not even color smoothing or super sampling.
2021-05-16GLTeapot: Add support for loading OBJ files containing extra informationErik Biederstadt
If the OBJ loader encounters a file with vertex normals or texture coordinates then it will no longer crash.
2021-05-13Userland: Tighten a *lot* of pledges! :^)Andreas Kling
Since applications using Core::EventLoop no longer need to create a socket in /tmp/rpc/, and also don't need to listen for incoming connections on this socket, we can remove a whole bunch of pledges!
2021-05-13LibGfx+Demos: Make Matrix4x4 a true alias for Matrix<4,T>Stephan Unverwerth
Matrix4x4 was defined as a derived class of Matrix<N,T> before. Furthermore, some code was duplicated and it was overall just messy. This commit turns Matrix4x4 into a simple alias for Matrix<4,T>.
2021-05-13LibGfx: Make Matrix class consistently row-majorStephan Unverwerth
Matrix elements were interpreted in different ways. This makes it definitely row-major, allowing initialization via initializer list in a standard scientific order. Also matrix multiplication now happens in the correct order and accessing elements happens as m_elements[row][column].
2021-05-12Everywhere: Add Alt shortcuts to remaining top-level menusLinus Groh
Not sure why some menus did have one and others didn't, even in the same application - now they all do. :^) I added character shortcuts to some menu actions as well.
2021-05-12Everywhere: Rename app_menu to file_menu, continuedLinus Groh
These were missed in 4b0098e.
2021-05-12LibCore+Everywhere: Move OpenMode out of IODeviceAli Mohammad Pur
...and make it an enum class so people don't omit "OpenMode".
2021-05-11GLTeapot: Use glGenLists() a bit to demonstrate that it worksAli Mohammad Pur
2021-05-09Demos: Implement basic Lambertian lighting for the GLTeapotMathieu Gaillard
The teapot now looks more realistic
2021-05-09Demos: Add indexed meshes in GLTeapot DemosMathieu Gaillard
Improved the basic Wavefront OBJ loader to index vertices. Uses less memory for the same mesh.
2021-05-09Demos: GLTeapot: Enable depth testing in demoStephan Unverwerth
2021-05-09CatDog: Help the user debug their programsGunnar Beutner
This adds helpful speech bubbles to CatDog. CatDog just wants to help, that's all.
2021-05-09CatDog: Rename root_widget to catdog_widgetGunnar Beutner
2021-05-09CatDog: Move the main widget into its own fileGunnar Beutner
2021-05-09Demos: Fix a bunch of incorrect use of GUI::PaintEvent::rect()Andreas Kling
A bunch of programs were using the paint event rect as the rect to draw into. Since the event rect could be any invalidated part of the widget, we need to be passing the full Widget::rect().
2021-05-08Demos: Add OpenGL teapot demo :^)Jesse Buhagiar
Every GL library needs an implementation of this! Currently drawn with "pixel vomit" colours as we don't yet support lighting via the GL library. This also ships with a super basic Wavefront OBJ loader.
2021-05-07WidgetGallery: Convert StringBuilder::appendf() => AK::FormatAndreas Kling
2021-05-03Userland: Update IPC calls to use proxiesGunnar Beutner
This updates all existing code to use the auto-generated client methods instead of post_message/send_sync.
2021-05-01WindowServer+LibGfx: Automatic "modified" markers in window titlesAndreas Kling
You can now add the string "[*]" to a window title and it will be replaced with " (*)" if the window is modified, and with "" otherwise.