forked from dacap/clip
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a new clip::has() function that allows to specify an error handling
function avoiding the use of the default one This is introduced because sometimes the caller might want to handle the locking error that might arise in a different way than the current error handler does. Related to: aseprite/aseprite#4016
- Loading branch information
1 parent
f56e458
commit 28f5c61
Showing
7 changed files
with
100 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,34 @@ | ||
// Clip Library | ||
// Copyright (c) 2015-2018 David Capello | ||
// | ||
// This file is released under the terms of the MIT license. | ||
// Read LICENSE.txt for more information. | ||
|
||
#ifndef CLIP_LOCK_IMPL_H_INCLUDED | ||
#define CLIP_LOCK_IMPL_H_INCLUDED | ||
|
||
namespace clip { | ||
|
||
class lock::impl { | ||
public: | ||
impl(void* native_window_handle); | ||
~impl(); | ||
|
||
bool locked() const { return m_locked; } | ||
bool clear(); | ||
bool is_convertible(format f) const; | ||
bool set_data(format f, const char* buf, size_t len); | ||
bool get_data(format f, char* buf, size_t len) const; | ||
size_t get_data_length(format f) const; | ||
bool set_image(const image& image); | ||
bool get_image(image& image) const; | ||
bool get_image_spec(image_spec& spec) const; | ||
|
||
private: | ||
bool m_locked; | ||
}; | ||
|
||
} // namespace clip | ||
|
||
#endif | ||
// Clip Library | ||
// Copyright (c) 2015-2018 David Capello | ||
// | ||
// This file is released under the terms of the MIT license. | ||
// Read LICENSE.txt for more information. | ||
|
||
#ifndef CLIP_LOCK_IMPL_H_INCLUDED | ||
#define CLIP_LOCK_IMPL_H_INCLUDED | ||
|
||
namespace clip { | ||
|
||
class lock::impl { | ||
public: | ||
impl(void* native_window_handle); | ||
impl(void* native_window_handle, int tries, int sleepms); | ||
~impl(); | ||
|
||
bool locked() const { return m_locked; } | ||
bool clear(); | ||
bool is_convertible(format f) const; | ||
bool set_data(format f, const char* buf, size_t len); | ||
bool get_data(format f, char* buf, size_t len) const; | ||
size_t get_data_length(format f) const; | ||
bool set_image(const image& image); | ||
bool get_image(image& image) const; | ||
bool get_image_spec(image_spec& spec) const; | ||
|
||
private: | ||
bool m_locked; | ||
}; | ||
|
||
} // namespace clip | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters