summaryrefslogtreecommitdiff
path: root/Applications/IRCClient
AgeCommit message (Collapse)Author
2020-03-04LibGUI: Don't use Core::Object::add() to instantiate dialogsAndreas Kling
Now that add() returns a WidgetType&, we can't rely on the parent of a GUI::Dialog to still keep it alive after exec() returns. This happens because exec() will call remove_from_parent() on itself before returning. And so we go back to the old idiom for creating a GUI::Dialog centered above a specific window. Just call GUI::Dialog::construct(), passing the "parent" window as the last parameter.
2020-03-04LibCore: Make Core::Object::add<ChildType> return a ChildType&Andreas Kling
Since the returned object is now owned by the callee object, we can simply vend a ChildType&. This allows us to use "." instead of "->" at the call site, which is quite nice. :^)
2020-03-04LibGUI: Use GUI::Window::set_main_widget<WidgetType>() in clientsAndreas Kling
2020-03-04LibGUI: Use set_layout<LayoutType>() in lots of client codeAndreas Kling
2020-03-03AK: Make quick_sort() a little more ergonomicAndreas Kling
Now it actually defaults to "a < b" comparison, instead of forcing you to provide a trivial less-than comparator. Also you can pass in any collection type that has .begin() and .end() and we'll sort it for you.
2020-02-25AK: Make Vector use size_t for its size and capacityAndreas Kling
2020-02-23LibGUI: Remove parent parameter to GUI::Widget constructorAndreas Kling
2020-02-23Userspace: Use Core::Object::add() when building interfacesAndreas Kling
2020-02-23IRCClient: Modernize Core::Object usageAndreas Kling
2020-02-20AK: Use size_t for ByteBuffer sizesAndreas Kling
This matches what we already do for string types.
2020-02-16AK: Add basic Traits for RefPtrAndreas Kling
This allows RefPtr to be stored in a HashTable<RefPtr<T>> :^) It's unfortunate about the const_casts. We'll need to fix HashMap::get to play nice with non-const Traits<T>::PeekType at some point.
2020-02-16LibGUI: Add forwarding headerAndreas Kling
This patch adds <LibGUI/Forward.h> and uses it a bunch. It also dragged various header dependency reduction changes into it.
2020-02-11IRCClient: Use Core::DateTimeAndreas Kling
2020-02-06LibGUI: Remove leading G from filenamesAndreas Kling
2020-02-06LibCore: Remove leading C from filenamesAndreas Kling
2020-02-06LibGUI: Rename {H,V}BoxLayout => {Horizontal,Vertical}BoxLayoutAndreas Kling
2020-02-06LibGUI: Add HorizontalSplitter and VerticalSplitter convenience classesAndreas Kling
2020-02-06LibGfx: Prefer using Gfx::Bitmap::load_from_file instead of load_png()Andreas Kling
Code that just wants to open a Gfx::Bitmap from a file should not be calling the PNG codec directly.
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-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-02-02LibGUI: Add GHBoxLayout and GVBoxLayout convenience classesAndreas Kling
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-11IRCClient: Use pledge()Andreas Kling
2020-01-01Applications: Add new keyboard shortcuts & update few existing onesJami Kettunen
2019-12-25Build: support library and generator dependenciesjoshua stein
Instead of directly manipulating LDFLAGS, set LIB_DEPS in each subdirectory Makefile listing the libraries needed for building/linking such as "LIB_DEPS = Core GUI Draw IPC Core". This adds each library as an -L and -l argument in LDFLAGS, but also adds the library.a file as a link dependency on the current $(PROGRAM). This causes the given library to be (re)built before linking the current $(PROGRAM), but will also re-link any binaries depending on that library when it is modified, when running make from the root directory. Also turn generator tools like IPCCompiler into dependencies on the files they generate, so they are built on-demand when a particular directory needs them. This all allows the root Makefile to just list directories and not care about the order, as all of the dependency tracking will figure it out.
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-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-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-09LibGUI: Make GMenu inherit from CObjectAndreas Kling
This is primarily to make it possible to pass a GMenu* where a CObject* is expected.
2019-12-03IRCClient: Sort the member list ignoring the character cases.Sasan Hezarkhani
I compared a few clients and they do the same sort of sorting.
2019-11-07IRCClient: Escape HTML entities in nicknames, too, just in caseAndreas Kling
2019-11-06LibHTML+IRCClient: Add an escape_html_entities() helperAndreas Kling
This simple helper escapes '<', '>' and '&' so they can be used in HTML text without interfering with the parser. Use this in IRCClient to prevent incoming messages from messing with the DOM :^)
2019-11-06IRCClient: Use parse_html_fragment() to add messages to the HtmlViewAndreas Kling
HTML fragment strings are so much nicer to work with than raw DOM APIs. This makes it feel like we're using innerHTML :^)
2019-11-06Revert "LibHTML: Rename parse_html() => parse_html_document()"Andreas Kling
This reverts commit f6439789db9c02216baabb197017c7a79a63ba04. Oops, I committed unrelated changes here, let me clean that up..
2019-11-06LibHTML: Rename parse_html() => parse_html_document()Andreas Kling
2019-10-28IRCClient: Switch to using an HtmlView for the IRC window contents :^)Andreas Kling
This seemed like a perfect fit for LibHTML. We can now style the IRC channels and queries however we like with the power of HTML and CSS. This patch doesn't do much in the way of styling, it just gets the basic mechanism into place.
2019-09-22LibCore: Remove ObjectPtr in favor of RefPtrAndreas Kling
Now that CObject is fully ref-counted, just use RefPtr everywhere! :^)
2019-09-22LibCore: Make CObject reference-countedAndreas Kling
Okay, I've spent a whole day on this now, and it finally kinda works! With this patch, CObject and all of its derived classes are reference counted instead of tree-owned. The previous, Qt-like model was nice and familiar, but ultimately also outdated and difficult to reason about. CObject-derived types should now be stored in RefPtr/NonnullRefPtr and each class can be constructed using the forwarding construct() helper: auto widget = GWidget::construct(parent_widget); Note that construct() simply forwards all arguments to an existing constructor. It is inserted into each class by the C_OBJECT macro, see CObject.h to understand how that works. CObject::delete_later() disappears in this patch, as there is no longer a single logical owner of a CObject.
2019-09-21LibGUI: Don't create GMessageBox and GInputBox on the stackAndreas Kling
We need to get rid of all instances of widgets-on-the-stack since that will no longer work in the ref-counting world.
2019-09-21LibGUI: Convert remaining random little things to ObjectPtrAndreas Kling
2019-09-21LibGUI: Convert GWidget to ObjectPtrAndreas Kling
2019-09-21LibGUI: Convert GToolBar to ObjectPtrAndreas Kling
2019-09-21LibGUI: Convert GSplitter to ObjectPtrAndreas Kling
2019-09-21LibGUI: Convert GTableView to ObjectPtrAndreas Kling
2019-09-21LibGUI: Convert GTextBox, GTextEditor and GResizeCorner to ObjectPtrAndreas Kling
2019-09-21LibCore: Convert CTCPServer to ObjectPtrAndreas Kling
Also get rid of the custom CNotifier::create() in favor of construct().
2019-09-21LibCore: Convert CTCPSocket to ObjectPtr, add construct() helperAndreas Kling
The C_OBJECT macro now also inserts a static construct(...) helper into the class. Now we can make the constructor(s) private and instead call: auto socket = CTCPSocket::construct(arguments); construct() returns an ObjectPtr<T>, which we'll later switch to being a NonnullRefPtr<T>, once everything else in in place for ref-counting.
2019-09-20LibCore: Convert CNotifier to ObjectPtrAndreas Kling