mirror of
https://github.com/ruby-opencv/ruby-opencv
synced 2023-03-27 23:22:12 -04:00
fix multiple windows operation bug
When we use Qt and create 2 or more OpenCV::GUI::Window objects, their names become unwanted ones and some unwanted windows are created. This commit fixes the bug.
This commit is contained in:
parent
66636e9734
commit
ca9820ab87
4 changed files with 113 additions and 143 deletions
|
@ -20,27 +20,44 @@
|
|||
|
||||
__NAMESPACE_BEGIN_OPENCV
|
||||
__NAMESPACE_BEGIN_GUI
|
||||
|
||||
typedef struct Window {
|
||||
VALUE name;
|
||||
VALUE image;
|
||||
VALUE trackbars;
|
||||
VALUE blocks;
|
||||
} Window;
|
||||
|
||||
__NAMESPACE_BEGIN_WINDOW
|
||||
|
||||
void define_ruby_class();
|
||||
|
||||
VALUE rb_allocate(VALUE klass);
|
||||
|
||||
void mark(void *ptr);
|
||||
VALUE each_protect(VALUE key, VALUE value);
|
||||
void free(void *ptr);
|
||||
|
||||
VALUE rb_aref(VALUE klass, VALUE name);
|
||||
VALUE rb_initialize(int argc, VALUE *argv, VALUE self);
|
||||
void window_mark(void *ptr);
|
||||
void window_free(void *ptr);
|
||||
VALUE rb_alive_q(VALUE self);
|
||||
VALUE rb_initialize(int argc, VALUE *argv, VALUE self);
|
||||
VALUE rb_destroy(VALUE self);
|
||||
VALUE rb_destroy_all(VALUE klass);
|
||||
VALUE rb_resize(int argc, VALUE *argv, VALUE self);
|
||||
VALUE rb_move(int argc, VALUE *argv, VALUE self);
|
||||
VALUE rb_show_image(int argc, VALUE *argv, VALUE self);
|
||||
VALUE rb_show_image(VALUE self, VALUE img);
|
||||
VALUE rb_set_trackbar(int argc, VALUE *argv, VALUE self);
|
||||
VALUE rb_set_mouse_callback(int argc, VALUE* argv, VALUE self);
|
||||
|
||||
inline Window*
|
||||
WINDOW(VALUE object) {
|
||||
Window *ptr;
|
||||
Data_Get_Struct(object, Window, ptr);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
inline const char*
|
||||
GET_WINDOW_NAME(VALUE object) {
|
||||
return StringValueCStr(WINDOW(object)->name);
|
||||
}
|
||||
|
||||
__NAMESPACE_END_WINDOW
|
||||
__NAMESPACE_END_GUI
|
||||
__NAMESPACE_END_OPENCV
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue