mirror of
https://github.com/ruby-opencv/ruby-opencv
synced 2023-03-27 23:22:12 -04:00
tested MouseEvent
This commit is contained in:
parent
4813ec29bc
commit
6be99de63c
3 changed files with 21 additions and 4 deletions
|
@ -56,7 +56,7 @@ VALUE
|
||||||
rb_allocate(VALUE klass)
|
rb_allocate(VALUE klass)
|
||||||
{
|
{
|
||||||
MouseEvent *ptr;
|
MouseEvent *ptr;
|
||||||
return Data_Make_Struct(klass, MouseEvent, 0, -1, ptr);
|
return Data_Make_Struct(klass, MouseEvent, 0, 0, ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -21,11 +21,11 @@ __NAMESPACE_BEGIN_OPENCV
|
||||||
__NAMESPACE_BEGIN_GUI
|
__NAMESPACE_BEGIN_GUI
|
||||||
__NAMESPACE_BEGIN_MOUSEEVENT
|
__NAMESPACE_BEGIN_MOUSEEVENT
|
||||||
|
|
||||||
typedef struct MouseEvent{
|
typedef struct MouseEvent {
|
||||||
CvPoint point;
|
CvPoint point;
|
||||||
int event;
|
int event;
|
||||||
int flag;
|
int flag;
|
||||||
}MouseEvent;
|
} MouseEvent;
|
||||||
|
|
||||||
VALUE rb_class();
|
VALUE rb_class();
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ VALUE rb_alt_key_q(VALUE self);
|
||||||
|
|
||||||
VALUE new_object(int event, int x, int y, int flag);
|
VALUE new_object(int event, int x, int y, int flag);
|
||||||
|
|
||||||
inline MouseEvent *MOUSEEVENT(VALUE object){
|
inline MouseEvent *MOUSEEVENT(VALUE object) {
|
||||||
MouseEvent *ptr;
|
MouseEvent *ptr;
|
||||||
Data_Get_Struct(object, MouseEvent, ptr);
|
Data_Get_Struct(object, MouseEvent, ptr);
|
||||||
return ptr;
|
return ptr;
|
||||||
|
|
17
test/test_mouseevent.rb
Executable file
17
test/test_mouseevent.rb
Executable file
|
@ -0,0 +1,17 @@
|
||||||
|
#!/usr/bin/env ruby
|
||||||
|
# -*- mode: ruby; coding: utf-8-unix -*-
|
||||||
|
require 'test/unit'
|
||||||
|
require 'opencv'
|
||||||
|
require File.expand_path(File.dirname(__FILE__)) + '/helper'
|
||||||
|
|
||||||
|
include OpenCV
|
||||||
|
include GUI
|
||||||
|
|
||||||
|
# Tests for OpenCV::MouseEvent
|
||||||
|
class TestMouseEvent < OpenCVTestCase
|
||||||
|
def test_initialize
|
||||||
|
assert_not_nil(MouseEvent.new)
|
||||||
|
assert_equal(MouseEvent, MouseEvent.new.class)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue