/*
    ####             #    #     # #
    #   #            #    #       #          The FreeWare C library for
    #   #  ##   ###  #  # #     # ###             RISC OS machines
    #   # #  # #     # #  #     # #  #   ___________________________________
    #   # ####  ###  ##   #     # #  #
    #   # #        # # #  #     # #  #    Please refer to the accompanying
    ####   ### ####  #  # ##### # ###    documentation for conditions of use
    ________________________________________________________________________

    File:    Window.MoveWindow.c
    Author:  Copyright  1995 Sergio Monesi
    Version: 1.00 (26 Jul 1995)
    Purpose: Move window by icon dragging
*/

#include "Desk.Wimp.h"
#include "Desk.Window.h"
#include "Desk.Error.h"

Desk_bool Desk_Window_MoveWindow(Desk_event_pollblock *e, void *reference)
{
 Desk_drag_block block;
 Desk_window_state state;

 Desk_UNUSED( reference);
 
 Desk_Wimp_eGetWindowState(e->data.mouse.window, &state);

 block.window=e->data.mouse.window;
 block.type=Desk_drag_MOVEWINDOW;
 block.screenrect=state.openblock.screenrect;

 Desk_Error_Check(Desk_Wimp_eDragBox(&block));

 return Desk_bool_TRUE;
}
