mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 10:17:35 +00:00
PixelPaint: Rename Image::create_foo() => Image::try_create_foo()
Factory functions that may fail should be called try_create().
This commit is contained in:
parent
29e80178a8
commit
a9e98bad8a
3 changed files with 22 additions and 23 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2020-2021, Andreas Kling <kling@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -36,9 +36,9 @@ protected:
|
|||
|
||||
class Image : public RefCounted<Image> {
|
||||
public:
|
||||
static RefPtr<Image> create_with_size(Gfx::IntSize const&);
|
||||
static RefPtr<Image> create_from_file(String const& file_path);
|
||||
static RefPtr<Image> create_from_bitmap(RefPtr<Gfx::Bitmap> bitmap);
|
||||
static RefPtr<Image> try_create_with_size(Gfx::IntSize const&);
|
||||
static RefPtr<Image> try_create_from_file(String const& file_path);
|
||||
static RefPtr<Image> try_create_from_bitmap(RefPtr<Gfx::Bitmap> bitmap);
|
||||
|
||||
size_t layer_count() const { return m_layers.size(); }
|
||||
Layer const& layer(size_t index) const { return m_layers.at(index); }
|
||||
|
@ -75,7 +75,7 @@ public:
|
|||
private:
|
||||
explicit Image(Gfx::IntSize const&);
|
||||
|
||||
static RefPtr<Image> create_from_pixel_paint_file(String const& file_path);
|
||||
static RefPtr<Image> try_create_from_pixel_paint_file(String const& file_path);
|
||||
|
||||
void did_change();
|
||||
void did_modify_layer_stack();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue