Exemple #1
0
/*#
    @method keyboard_ungrab GdkDisplay
    @brief Release any keyboard grab
    @param time a timestap (e.g GDK_CURRENT_TIME).

    Warning: gdk_display_keyboard_ungrab has been deprecated since version 3.0
    and should not be used in newly-written code. Use gdk_device_ungrab(),
    together with gdk_device_grab()  instead.
 */
FALCON_FUNC Display::keyboard_ungrab( VMARG )
{
    Item* i_t = vm->param( 0 );
#ifndef NO_PARAMETER_CHECK
    if ( !i_t || !i_t->isInteger() )
        throw_inv_params( "I" );
#endif
    gdk_display_keyboard_ungrab( GET_DISPLAY( vm->self() ), i_t->asInteger() );
}
Exemple #2
0
/*#
    @method get_screen GdkDisplay
    @brief Returns a screen object for one of the screens of the display.
    @param screen_num the screen number
    @return the GdkScreen object
 */
FALCON_FUNC Display::get_screen( VMARG )
{
    Item* i_n = vm->param( 0 );
#ifndef NO_PARAMETER_CHECK
    if ( !i_n || !i_n->isInteger() )
        throw_inv_params( "I" );
#endif
    vm->retval( new Gdk::Screen( vm->findWKI( "GdkScreen" )->asClass(),
                                 gdk_display_get_screen( GET_DISPLAY( vm->self() ),
                                                         i_n->asInteger() ) ) );
}
Exemple #3
0
/*#
    @method new_for_display GdkCursor
    @brief Creates a new cursor from the set of builtin cursors.
    @param display the GdkDisplay for which the cursor will be created
    @param cursor_type cursor to create (GdkCursorType)
 */
FALCON_FUNC Cursor::new_for_display( VMARG )
{
    Item* i_display = vm->param( 0 );
    Item* i_tp = vm->param( 1 );
#ifndef NO_PARAMETER_CHECK
    if ( !i_display || !i_display->isObject() || !IS_DERIVED( i_display, GdkDisplay )
        || !i_tp || !i_tp->isInteger() )
        throw_inv_params( "GdkDisplay,GdkCursorType" );
#endif
    vm->retval( new Gdk::Cursor( vm->findWKI( "GdkCursor" )->asClass(),
                gdk_cursor_new_for_display( GET_DISPLAY( *i_display ),
                                            (GdkCursorType) i_tp->asInteger() ) ) );
}
Exemple #4
0
/*#
    @method new_from_name GdkCursor
    @brief Creates a new cursor by looking up name in the current cursor theme.
    @param name the name of the cursor
    @return a new GdkCursor, or NULL if there is no cursor with the given name
 */
FALCON_FUNC Cursor::new_from_name( VMARG )
{
    Item* i_name = vm->param( 0 );
#ifndef NO_PARAMETER_CHECK
    if ( !i_name || !i_name->isString() )
        throw_inv_params( "S" );
#endif
    AutoCString name( i_name->asString() );
    GdkCursor* cur = gdk_cursor_new_from_name( GET_DISPLAY( vm->self() ), name.c_str() );
    if ( cur )
        vm->retval( new Gdk::Cursor( vm->findWKI( "GdkCursor" )->asClass(), cur ) );
    else
        vm->retnil();
}
Exemple #5
0
/*#
    @method new_from_pixbuf GdkCursor
    @brief Creates a new cursor from a pixbuf.
    @param display the GdkDisplay for which the cursor will be created
    @param pixbuf the GdkPixbuf containing the cursor image
    @param x the horizontal offset of the 'hotspot' of the cursor.
    @param y the vertical offset of the 'hotspot' of the cursor.
    @return a new GdkCursor.

    Not all GDK backends support RGBA cursors. If they are not supported, a
    monochrome approximation will be displayed. The functions gdk_display_supports_cursor_alpha()
    and gdk_display_supports_cursor_color() can be used to determine whether
    RGBA cursors are supported; gdk_display_get_default_cursor_size() and
    gdk_display_get_maximal_cursor_size() give information about cursor sizes.

    On the X backend, support for RGBA cursors requires a sufficently new
    version of the X Render extension.
 */
FALCON_FUNC Cursor::new_from_pixbuf( VMARG )
{
    Item* i_display = vm->param( 0 );
    Item* i_pix = vm->param( 1 );
    Item* i_x = vm->param( 2 );
    Item* i_y = vm->param( 3 );
#ifndef NO_PARAMETER_CHECK
    if ( !i_display || !i_display->isObject() || !IS_DERIVED( i_display, GdkDisplay )
        || !i_pix || !i_pix->isObject() || !IS_DERIVED( i_pix, GdkPixbuf )
        || !i_x || !i_x->isInteger()
        || !i_y || !i_y->isInteger() )
        throw_inv_params( "GdkDisplay,GdkPixbuf,I,I" );
#endif
    vm->retval( new Gdk::Cursor( vm->findWKI( "GdkCursor" )->asClass(),
                        gdk_cursor_new_from_pixbuf( GET_DISPLAY( *i_display ),
                                                    GET_PIXBUF( *i_pix ),
                                                    i_x->asInteger(),
                                                    i_y->asInteger() ) ) );
}
Exemple #6
0
/*#
    @method close GdkDisplay
    @brief Closes the connection to the windowing system for the given display, and cleans up associated resources.
 */
FALCON_FUNC Display::close( VMARG )
{
    NO_ARGS
    gdk_display_close( GET_DISPLAY( vm->self() ) );
}
Exemple #7
0
/*#
    @method flush GdkDisplay
    @brief Flushes any requests queued for the windowing system.

    This happens automatically when the main loop blocks waiting for new events,
    but if your application is drawing without returning control to the main loop,
    you may need to call this function explicitely. A common case where this
    function needs to be called is when an application is executing drawing
    commands from a thread other than the thread where the main loop is running.

    This is most useful for X11. On windowing systems where requests are handled
    synchronously, this function will do nothing.
 */
FALCON_FUNC Display::flush( VMARG )
{
    NO_ARGS
    gdk_display_flush( GET_DISPLAY( vm->self() ) );
}
Exemple #8
0
/*#
    @method sync GdkDisplay
    @brief Flushes any requests queued for the windowing system and waits until all requests have been handled.

    This is often used for making sure that the display is synchronized with the
    current state of the program. Calling gdk_display_sync() before
    gdk_error_trap_pop() makes sure that any errors generated from earlier
    requests are handled before the error trap is removed.

    This is most useful for X11. On windowing systems where requests are handled
    synchronously, this function will do nothing.
 */
FALCON_FUNC Display::sync( VMARG )
{
    NO_ARGS
    gdk_display_sync( GET_DISPLAY( vm->self() ) );
}
Exemple #9
0
/*#
    @method beep GdkDisplay
    @brief Emits a short beep on display
 */
FALCON_FUNC Display::beep( VMARG )
{
    NO_ARGS
    gdk_display_beep( GET_DISPLAY( vm->self() ) );
}
Exemple #10
0
/*#
    @method pointer_is_grabbed GdkDisplay
    @brief Test if the pointer is grabbed.
    @return TRUE if an active X pointer grab is in effect

    Warning: gdk_display_pointer_is_grabbed has been deprecated since version 3.0
    and should not be used in newly-written code. Use gdk_display_device_is_grabbed()
    instead.
 */
FALCON_FUNC Display::pointer_is_grabbed( VMARG )
{
    NO_ARGS
    vm->retval( (bool) gdk_display_pointer_is_grabbed( GET_DISPLAY( vm->self() ) ) );
}
Exemple #11
0
/*#
    @method get_default_screen GdkDisplay
    @brief Get the default GdkScreen for display.
    @return the default GdkScreen object for display
 */
FALCON_FUNC Display::get_default_screen( VMARG )
{
    NO_ARGS
    vm->retval( new Gdk::Screen( vm->findWKI( "GdkScreen" )->asClass(),
                gdk_display_get_default_screen( GET_DISPLAY( vm->self() ) ) ) );
}
Exemple #12
0
/*#
    @method get_n_screens GdkDisplay
    @brief Gets the number of screen managed by the display.
    @return number of screens.
 */
FALCON_FUNC Display::get_n_screens( VMARG )
{
    NO_ARGS
    vm->retval( gdk_display_get_n_screens( GET_DISPLAY( vm->self() ) ) );
}
Exemple #13
0
/*#
    @method get_name GdkDisplay
    @brief Gets the name of the display.
    @return a string representing the display name.
 */
FALCON_FUNC Display::get_name( VMARG )
{
    NO_ARGS
    vm->retval( UTF8String( gdk_display_get_name( GET_DISPLAY( vm->self() ) ) ) );
}
Exemple #14
0
static Eina_Bool _main_view_init_camera(main_view *main_view_data)
{
	camera_state_e cur_state = CAMERA_STATE_NONE;
    int result = camera_create(CAMERA_DEVICE_CAMERA0, &main_view_data->camera);
    if (CAMERA_ERROR_NONE == result)
    {
        if (main_view_data->preview_canvas)
        {
        	int result = camera_get_state(main_view_data->camera, &cur_state);
        	if(cur_state == CAMERA_STATE_CREATED)
        	{
                result = camera_set_display(main_view_data->camera, CAMERA_DISPLAY_TYPE_EVAS, GET_DISPLAY(main_view_data->preview_canvas));
                if (CAMERA_ERROR_NONE == result)
                {
                	/* Camera Disply Set */
                    camera_set_display_mode(main_view_data->camera, CAMERA_DISPLAY_MODE_LETTER_BOX);
                    //camera_set_display_flip(main_view_data->camera, CAMERA_FLIP_VERTICAL);
                    camera_set_display_visible(main_view_data->camera, true);

                    camera_foreach_supported_capture_format (main_view_data->camera, _camera_supported_capture_format_callback, main_view_data);

            		_get_screen_resolution();


                    camera_foreach_supported_preview_resolution  ( main_view_data->camera, _camera_supported_preview_resolution_callback, main_view_data);
                    camera_foreach_supported_capture_resolution  ( main_view_data->camera, _camera_supported_capture_resolution_callback, main_view_data);

            		result = camera_get_preview_resolution(main_view_data->camera, &height , &width);
            		INF("camera preview resolution width %d, height %d", width, height);

            		result = camera_get_capture_resolution(main_view_data->camera, &height , &width);
            		INF("camera capture resolution width %d, height %d", width, height);

                    return _main_view_start_camera_preview(main_view_data->camera);
                }
        	}

        }
    }
    return !result;
}