Commit graph

93 commits

Author SHA1 Message Date
pierre 662e47e140 MouseDemo: A more visual approach for MouseEvents :^) 2020-05-07 12:21:52 +02:00
Ben Wiederhake b80ad2d791 MouseDemo: Add menu, using the new icon :^) 2020-05-04 09:58:14 +02:00
Andreas Kling b8f778a430 Demos: Add a little "Mouse" demo for showing mouse button states
This was very helpful when adding support for 5-button mice! :^)
2020-05-02 22:13:54 +02:00
Brendan Coles 548ecceb75 Screensaver: Add app-screensaver.png 16x16 icon 2020-05-02 14:12:45 +02:00
Brendan Coles 905de7df58 Fire: Add app-fire.png 16x16 icon 2020-05-02 11:42:29 +02:00
Brendan Coles 6c1e842a7e Cube: Add app-cube.png 16x16 icon 2020-05-02 11:42:21 +02:00
Brendan Coles 24b9e57b15 Screensaver: Draw screen before first timer iteration and seed srand() 2020-04-28 09:36:28 +02:00
Brendan Coles c4d3723087 Fire: Use LibC srand() 2020-04-28 09:30:01 +02:00
Hüseyin ASLITÜRK 30e95d017e Demos: Add ColorInput, TabWidget and MessageBox demos in WidgetGallery 2020-04-23 11:49:02 +02:00
Brendan Coles 1c44ae6d19 Demos: Add Screensaver demo 2020-04-19 02:09:50 +02:00
Andreas Kling 9a109128f8 Cube: Two small tweaks
I noticed these when playing with the demo locally:

- Use RGB32 instead of RGBA32 for the bitmap buffer. This avoids some
  flickering that would sometimes occur.

- Clip the gradient fill to the widget rect rather than the painter
  clip rect. In practice, the painter was always clipped to the widget
  rect here, but it seems logical to say "fill widget with gradient."
2020-04-18 13:46:55 +02:00
Stephan Unverwerth 1806592d58 Demos: Add 3D Cube Demo
This renders a spinning 3D cube and demonstrates the 3D math classes
from LibGfx.
2020-04-18 12:28:54 +02:00
Itamar 3e9a7175d1 Debugger: Add DebugSession
The DebugSession class wraps the usage of Ptrace.
It is intended to be used by cli & gui debugger programs.

Also, call objdump for disassemly
2020-04-13 00:53:22 +02:00
Itamar 0431712660 ptrace: Stop a traced thread when it exists from execve
This was a missing feature in the PT_TRACEME command.

This feature allows the tracer to interact with the tracee before the
tracee has started executing its program.

It will be useful for automatically inserting a breakpoint at a
debugged program's entry point.
2020-04-13 00:53:22 +02:00
Itamar 77f671b462 CPU: Handle breakpoint trap
Also, start working on the debugger app.
2020-04-13 00:53:22 +02:00
Tibor Nagy 120e8028f6 WidgetGallery: Remove G prefixes from components 2020-03-19 22:52:44 +01:00
Andreas Kling 028c011760 LibCore: Make Core::Object::add<ChildType> return a ChildType&
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-04 21:04:06 +01:00
Andreas Kling 0f3e57a6fb LibGUI: Use GUI::Window::set_main_widget<WidgetType>() in clients 2020-03-04 14:26:16 +01:00
Andreas Kling 4697195645 LibGUI: Use set_layout<LayoutType>() in lots of client code 2020-03-04 13:49:48 +01:00
Andreas Kling 03e0ddce52 LibGUI: Some more convenience functions for constructing widgets
This patch adds two new API's:

- WidgetType& GUI::Window::set_main_widget<WidgetType>();

  This creates a new main widget for a window, assigns it, and returns
  it to you as a WidgetType&.

- LayoutType& GUI::Widget::set_layout<LayoutType>();

  Same basic idea, creates a new layout, assigns it, and returns it to
  you as a LayoutType&.
2020-03-03 22:37:48 +01:00
Andreas Kling a26b63a958 LibGUI: Remove Button& parameter from Button::on_click hook
There was but a single user of this parameter and it's a bit tedious
to write it out every time, so let's get rid of it.
2020-03-03 17:02:38 +01:00
Andrew Kaster c678b35043 LibELF: Use MAP_PRIVATE for file-backed mmaps in ELFDynamicLoader
Clean up some unused code, clean up FIXMEs, and remove premature
--dynamic-loader/-pie from LinkDemo (so it runs again on master)
2020-02-29 10:58:45 +01:00
joshua stein 0d2bfe5c65 Build: Only look at SUBDIRS with Makefiles
If a directory is renamed or deleted before 'make clean', git will
delete the Makefile but leave all of the object and dependency files
around.  When make would try to recurse into that directory from the
wildcard, it would error out since there is no Makefile.
2020-02-25 19:56:48 +01:00
Andreas Kling bbc02af090 Demos: Remove silly HelloWorld2 demo
This was just a tiny test app made with the old VisualBuilder. It's not
really useful for anything.
2020-02-23 12:27:53 +01:00
Andreas Kling 3d20da9ee4 Userspace: Use Core::Object::add() when building interfaces 2020-02-23 11:10:52 +01:00
Andreas Kling e1ff4fa034 LibGUI: Remove more header dependencies from Widget.h 2020-02-15 00:24:14 +01:00
Andreas Kling 3fe2640c8c LibGfx: Add forward declaration header
This patch adds <LibGfx/Forward.h> with forward declarations for Gfx.
2020-02-14 23:31:18 +01:00
Andreas Kling 6cbd72f54f AK: Remove bitrotted Traits::dump() mechanism
This was only used by HashTable::dump() which I used when doing the
first HashTable implementation. Removing this allows us to also remove
most includes of <AK/kstdio.h>.
2020-02-10 11:55:34 +01:00
Andreas Kling 6a9cc66b97 LibGUI: Remove leading G from filenames 2020-02-06 20:33:02 +01:00
Andreas Kling d17e23bd27 LibCore: Remove leading C from filenames 2020-02-06 15:04:03 +01:00
Andreas Kling 799b0a4fa8 LibGUI: Rename {H,V}BoxLayout => {Horizontal,Vertical}BoxLayout 2020-02-06 14:44:13 +01:00
Andreas Kling dccf335d5b LibGUI: Add HorizontalSlider and VerticalSlider convenience classes 2020-02-06 14:43:16 +01:00
Andreas Kling 5c06c32df4 LibGfx: Prefer using Gfx::Bitmap::load_from_file instead of load_png()
Code that just wants to open a Gfx::Bitmap from a file should not be
calling the PNG codec directly.
2020-02-06 13:39:17 +01:00
Andreas Kling c39d44fc2e LibGfx: Rename GraphicsBitmap.{cpp,h} => Bitmap.{cpp,h} 2020-02-06 12:07:05 +01:00
Andreas Kling 9ac94d393e LibGfx: Rename from LibDraw :^) 2020-02-06 12:04:00 +01:00
Andreas Kling 11580babbf LibDraw: Put all classes in the Gfx namespace
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-06 11:56:38 +01:00
Andreas Kling c5bd9d4ed1 LibGUI: Put all classes in the GUI namespace and remove the leading G
This took me a moment. Welcome to the new world of GUI::Widget! :^)
2020-02-02 15:15:33 +01:00
Andreas Kling 2d39da5405 LibCore: Put all classes in the Core namespace and remove the leading C
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-02 15:15:30 +01:00
Andreas Kling d67da8c101 LibGUI: Add GHBoxLayout and GVBoxLayout convenience classes 2020-02-02 15:09:48 +01:00
Andrew Kaster 117820f610 Meta: Claim copyright on files added by me
Demos/DynamicLink, LibC/cxxabi.cpp, and LibELF/ELFDynamic*.[cpp/h]
2020-02-02 02:05:38 +01:00
Andreas Kling 94ca55cefd Meta: Add license header to source files
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-18 09:45:54 +01:00
Emanuel Sprung 542098d90d Build: Fix helloworld2's form compiler dependency 2020-01-15 09:39:44 +01:00
Andrew Kaster c3be3718cf Demos: Compile LinkDemo as a PIE with interpreter /lib/lib-elf.so 2020-01-13 13:03:30 +01:00
Andrew Kaster 5accedfedb Demos: Remove extra methods/globals from DynamicLib 2020-01-13 13:03:30 +01:00
Shannon Booth d4fa8e4b00 AK+Demos+Libraries: Remove executable permissions from {.cpp,.h} files 2020-01-06 10:43:00 +01:00
Andrew Kaster 4698a10dd1 Demos: DynamicLink makefile now respects $(QUIET)
At a later date we'll probably want a template for SHLIB_OBJS and
SHLIB or some such, but for now at least the library demo isn't
printing compile commands all over the user's terminal.
2020-01-02 12:28:29 +01:00
Andrew Kaster a755b80057 Demos: Link our normal startfiles into the dynamic lib demo
Now that gcc knows about crtbeginS and crtendS, and knows not to link
crt0.o into shared objects, we can get rid of the hacks required due to
--nostartfiles.
2020-01-01 23:05:17 +01:00
joshua stein e7de8af379 Build: Demos/DynamicLink: use EXTRA_CLEAN 2020-01-01 22:21:50 +01:00
Andrew Kaster b6590b7f83 Demos: Add a dynamic linking demo to show off dlfcn methods
The LinkDemo program calls dlopen/dlsym/dlclose to try and load
a dyanmic library from /usr/lib. It read a global variable and
calls a global function (extern "C" of course :) ).

There a few hacks left in the LinkLib dynamic library, however.
In order to get the linker to stop complaining, we have to use
-nostartfiles -ffreestanding otherwise it will link crt0.o to our
shared object, which is definitely not right as the _init function
for a main program (that calls main) is not suitable for our lib
2020-01-01 17:48:41 +01:00
joshua stein c127d16326 Build: support library and generator dependencies
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-25 10:11:09 +01:00