summaryrefslogtreecommitdiff
path: root/Libraries/LibDraw
AgeCommit message (Collapse)Author
2020-02-06LibGfx: Rename from LibDraw :^)Andreas Kling
2020-02-06LibDraw: Put all classes in the Gfx namespaceAndreas Kling
I started adding things to a Draw namespace, but it somehow felt really wrong seeing Draw::Rect and Draw::Bitmap, etc. So instead, let's rename the library to LibGfx. :^)
2020-02-05LibDraw: Override set_{non,}volatile in GIFLoaderjoshua stein
2020-02-05LibDraw: Fix building with clangjoshua stein
2020-02-05LibDraw: Make [gs]et_pixel arguments usedjoshua stein
2020-02-05LibDraw: Don't specify LibC/ in standard include pathsjoshua stein
2020-02-02LibGUI: Put all classes in the GUI namespace and remove the leading GAndreas Kling
This took me a moment. Welcome to the new world of GUI::Widget! :^)
2020-02-02LibCore: Put all classes in the Core namespace and remove the leading CAndreas Kling
I've been wanting to do this for a long time. It's time we start being consistent about how this stuff works. The new convention is: - "LibFoo" is a userspace library that provides the "Foo" namespace. That's it :^) This was pretty tedious to convert and I didn't even start on LibGUI yet. But it's coming up next.
2020-01-24Meta: Claim copyright for files created by meSergey Bugaev
This changes copyright holder to myself for the source code files that I've created or have (almost) completely rewritten. Not included are the files that were significantly changed by others even though it was me who originally created them (think HtmlView), or the many other files I've contributed code to.
2020-01-21LibDraw: Remove old PNG_STOPWATCH_DEBUG debug codeAndreas Kling
2020-01-19LibDraw: Add beginnings of a triangle classShannon Booth
Currently the points of a triangle do not need to be initialised in a certain orientation. Currently, the only real method in the class is `contains`. However we can continue extending the class if and when we need more functionality.
2020-01-18Meta: Add license header to source filesAndreas Kling
As suggested by Joshua, this commit adds the 2-clause BSD license as a comment block to the top of every source file. For the first pass, I've just added myself for simplicity. I encourage everyone to add themselves as copyright holders of any file they've added or modified in some significant way. If I've added myself in error somewhere, feel free to replace it with the appropriate copyright holder instead. Going forward, all new source files should include a license header.
2020-01-13LibDraw+LibHTML: Make link colors themeableAndreas Kling
Add "Link", "ActiveLink" and "VisitedLink" colors to the system theme definition, and implement support for them in LibHTML. Note that <body link="foo" alink="bar" vlink="baz"> takes precedence over the system colors. Author style also takes precedence, since we only fetch the system color in case the CSS color is -libhtml-link.
2020-01-12LibDraw: Remove debug spam about loading system themesAndreas Kling
2020-01-08LibDraw+LibGUI: Move radio button painting into StylePainterAndreas Kling
This will allow WindowServer to draw radio buttons :^)
2020-01-07LibDraw: Add support for parsing #RGBA colorsN00byEdge
This was the nicest way of making this happen, I think. Fitting it into the 4 length function ended up becoming too hard to read. Closes #1027
2020-01-07Themes: Support rubberband selection theming0xtechnobabble
2020-01-01AK: Move the userspace SharedBuffer from LibC to AKAndreas Kling
This always felt out-of-place in LibC.
2019-12-30LibDraw: Store glyph spacing information in the fonts headersTibor Nagy
2019-12-29LibDraw: Fix text rendering in progress barsAndreas Kling
2019-12-29LibDraw+LibGUI: Allow changing individual colors in a PaletteAndreas Kling
Palette is now a value wrapper around a NonnullRefPtr<PaletteImpl>. A new function, set_color(ColorRole, Color) implements a simple copy-on-write mechanism so that we're sharing the PaletteImpl in the common case, but allowing you to create custom palettes if you like, by getting a GWidget's palette, modifying it, and then assigning the modified palette to the widget via GWidget::set_palette(). Use this to make PaintBrush show its palette colors once again. Fixes #943.
2019-12-27LibDraw: Remove redundant Rect copy constructorAndreas Kling
2019-12-27LibDraw: Add draw_ellipse_intersecting functionShannon Booth
This functon will draw an ellipse which is intersecting the corners of the rect given. It is a very naive implementation, taking 200 samples of points around the ellipse, and drawing straight lines between each of these points. The ellipses look good enough to me though!
2019-12-26PaintBrush: Add a "rectangle tool"Shannon Booth
Fill, line, and gradient modes initially supported :^)
2019-12-26LibDraw: Add dx/dy_relative_to() helper functions for PointsShannon Booth
2019-12-26LibDraw: Add MenuBaseText and MenuSelectionText color rolesAndreas Kling
This allows the very aesthetic "Hotdog Stand" theme to have quite reasonable looking menus.
2019-12-25LibDraw: Remove bogus LibC/ prefix on SharedBuffer.h includeAndreas Kling
This class really doesn't belong in LibC anyway, does it? Mehh.
2019-12-25LibDraw: Fix 1px wide glitch in progress bar painting at some widthsAndreas Kling
Make sure we always line up the "hole" in the progress bar with the right side of the paint rect. This fixes a 1px wide glitch seen when using a darker system theme.
2019-12-24LibDraw: Teach progress bar painting about palettesAndreas Kling
2019-12-24LibDraw: Add ColorRole::BaseText (to be painted on ColorRole::Base)Andreas Kling
2019-12-24LibGUI+LibDraw: Add "Palette" concept for scoped color themingAndreas Kling
GApplication now has a palette. This palette contains all the system theme colors by default, and is inherited by a new top-level GWidget. New child widgets inherit their parents palette. It is possible to override the GApplication palette, and the palette of any GWidget. The Palette object contains a bunch of colors, each corresponding to a ColorRole. Each role has a convenience getter as well. Each GWidget now has a background_role() and foreground_role(), which are then looked up in their current palette when painting. This means that you no longer alter the background color of a widget by setting it directly, rather you alter either its background role, or the widget's palette.
2019-12-24LibDraw: Add Selection and SelectionText system theme colorsAndreas Kling
2019-12-24LibDraw: Use SystemColor::ThreedHighlight everywhere in StylePainterAndreas Kling
2019-12-24LibDraw: Give Color::lightened() an amount argumentAndreas Kling
2019-12-24LibDraw: Add Button and ButtonText system theme colorsAndreas Kling
These are now separate from the Window and WindowText colors.
2019-12-24LibGUI: Use SystemColor::Text in more placesAndreas Kling
2019-12-23WindowServer+LibGUI: Implement basic color themingAndreas Kling
Color themes are loaded from .ini files in /res/themes/ The theme can be switched from the "Themes" section in the system menu. The basic mechanism is that WindowServer broadcasts a SharedBuffer with all of the color values of the current theme. Clients receive this with the response to their initial WindowServer::Greet handshake. When the theme is changed, WindowServer tells everyone by sending out an UpdateSystemTheme message with a new SharedBuffer to use. This does feel somewhat bloated somehow, but I'm sure we can iterate on it over time and improve things. To get one of the theme colors, use the Color(SystemColor) constructor: painter.fill_rect(rect, SystemColor::HoverHighlight); Some things don't work 100% right without a reboot. Specifically, when constructing a GWidget, it will set its own background and foreground colors based on the current SystemColor::Window and SystemColor::Text. The widget is then stuck with these values, and they don't update on system theme change, only on app restart. All in all though, this is pretty cool. Merry Christmas! :^)
2019-12-23LibDraw: Parse all CSS standardised color keywordsShannon Booth
2019-12-20Build: clean up build system, use one shared Makefilejoshua stein
Allow everything to be built from the top level directory with just 'make', cleaned with 'make clean', and installed with 'make install'. Also support these in any particular subdirectory. Specifying 'make VERBOSE=1' will print each ld/g++/etc. command as it runs. Kernel and early host tools (IPCCompiler, etc.) are built as object.host.o so that they don't conflict with other things built with the cross-compiler.
2019-12-18LibDraw: Create purgeable GraphicsBitmap in the PNG decoderAndreas Kling
Also add ImageDecoder APIs for controlling the volatile flag.
2019-12-18LibDraw: Add GraphicsBitmap::create_purgeable()Andreas Kling
This allows you to create a process-private purgeable GraphicsBitmap. The volatile flag is controlled via set_volatile() / set_nonvolatile().
2019-12-16LibDraw: Parse the color name "pink" to #ffc0cbAndreas Kling
2019-12-13LibDraw: Add a way to check for horizontal/vertical Rect intersectionsAndreas Kling
2019-12-09AK: Use size_t for the length of stringsAndreas Kling
Using int was a mistake. This patch changes String, StringImpl, StringView and StringBuilder to use size_t instead of int for lengths. Obviously a lot of code needs to change as a result of this.
2019-12-08LibDraw: Add GraphicsBitmap::to_shareable_bitmap()Andreas Kling
This function returns the bitmap itself if it's already backed by a SharedBuffer object, otherwise it creates a shareable copy of itself and returns that.
2019-12-02LibDraw: Remove convenience functions for the old WindowServer IPCAndreas Kling
2019-11-29LibDraw: Painter::draw_pixel() with thickness>1 was doubly translatingAndreas Kling
Callers of draw_pixel() are not expecting it to apply translation since they will have already done that themselves. This was causing draw_line() with thickness>1 to have an offset applied in case the painter was already translated.
2019-11-27LibDraw: Support dotted lines in Painter::draw_line()Andreas Kling
Painter::draw_line() now has an optional "bool dotted" parameter that causes it to only render every other pixel. Note that this only works with horizontal and vertical lines at the moment and we'll assert if called with dotted=true for a diagonal line.
2019-11-25LibDraw: Add Painter::clear_rect() for filling a rect without blendingAndreas Kling
Sometimes you want to fill a rect with a specific color without alpha blending it with whatever's already there.
2019-11-23LibCore: Move puff() from LibDraw to LibCoreAndreas Kling
Since it's used both by CGzip and PNGLoader, it seems most appropriate to keep this in LibCore.