Files
ladybird/UI/AppKit/Utilities/Conversions.h
Andreas Kling 1802a05bc2 UI/AppKit: Show rich autocomplete suggestion rows
Render AutocompleteSuggestion rows with section headers, favicons,
titles, and secondary text in the child-window popup instead of just
plain strings.

Move the AppKit popup and inline completion onto the shared suggestion
model, and share the base64 PNG decoding helper with the application
menu icon loading path.
2026-04-16 21:01:28 +02:00

54 lines
1.3 KiB
Objective-C

/*
* Copyright (c) 2023, Tim Flynn <trflynn89@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/ByteString.h>
#include <AK/String.h>
#include <AK/StringView.h>
#include <AK/Utf16String.h>
#include <LibGfx/Bitmap.h>
#include <LibGfx/Color.h>
#include <LibGfx/Point.h>
#include <LibGfx/Rect.h>
#include <LibGfx/Size.h>
#import <Cocoa/Cocoa.h>
namespace Ladybird {
String ns_string_to_string(NSString*);
NSString* string_to_ns_string(StringView);
Utf16String ns_string_to_utf16_string(NSString*);
NSString* utf16_string_to_ns_string(Utf16View const&);
ByteString ns_string_to_byte_string(NSString*);
ByteString ns_data_to_string(NSData*);
NSData* string_to_ns_data(StringView);
NSImage* image_from_base64_png(StringView, NSSize size);
NSDictionary* deserialize_json_to_dictionary(StringView);
Gfx::IntRect ns_rect_to_gfx_rect(NSRect);
NSRect gfx_rect_to_ns_rect(Gfx::IntRect);
Gfx::IntSize ns_size_to_gfx_size(NSSize);
NSSize gfx_size_to_ns_size(Gfx::IntSize);
Gfx::IntPoint ns_point_to_gfx_point(NSPoint);
NSPoint gfx_point_to_ns_point(Gfx::IntPoint);
Gfx::Color ns_color_to_gfx_color(NSColor*);
NSColor* gfx_color_to_ns_color(Gfx::Color);
Gfx::IntPoint compute_origin_relative_to_window(NSWindow*, Gfx::IntPoint);
NSImage* gfx_bitmap_to_ns_image(Gfx::Bitmap const&);
}