helpers.cpp revision ccb71e178f4485d3f944134b5d453faada549800
/** @file
* helpers - Guest Additions Service helper functions
*/
/*
* Copyright (C) 2006-2007 Sun Microsystems, Inc.
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
* Clara, CA 95054 USA or visit http://www.sun.com if you need
* additional information or have any questions.
*/
#include <malloc.h>
#include <windows.h>
#include <VBox/VBoxGuestLib.h>
#include <VBoxGuestInternal.h>
#include "helpers.h"
#include "resource.h"
{
unsigned i;
for (i = 0; i < nRects; i++)
{
{
return i;
}
}
return ~0;
}
{
unsigned i;
for (i = 0; i < nRects; i++)
{
{
return i;
}
}
return ~0;
}
{
unsigned i;
for (i = 0; i < nRects; i++)
{
{
return i;
}
}
return ~0;
}
{
unsigned i;
for (i = 0; i < nRects; i++)
{
{
return i;
}
}
return ~0;
}
void resizeRect(RECTL *paRects, unsigned nRects, unsigned iPrimary, unsigned iResized, int NewWidth, int NewHeight)
{
paNewRects[iResized].bottom += NewHeight - (paNewRects[iResized].bottom - paNewRects[iResized].top);
/* Verify all pairs of originally adjacent rectangles for all 4 directions.
* If the pair has a "good" delta (that is the first rectangle intersects the second)
* at a direction and the second rectangle is not primary one (which can not be moved),
* move the second rectangle to make it adjacent to the first one.
*/
/* X positive. */
unsigned iRect;
{
/* Find the next adjacent original rect in x positive direction. */
{
continue;
}
/* Check whether there is an X intesection between these adjacent rects in the new rectangles
* and fix the intersection if delta is "good".
*/
if (delta > 0)
{
DDCLOG(("XP intersection right %d left %d, diff %d\n",
delta));
}
}
/* X negative. */
{
/* Find the next adjacent original rect in x negative direction. */
{
continue;
}
/* Check whether there is an X intesection between these adjacent rects in the new rectangles
* and fix the intersection if delta is "good".
*/
if (delta < 0)
{
DDCLOG(("XN intersection left %d right %d, diff %d\n",
delta));
}
}
/* Y positive (in the computer sence, top->down). */
{
/* Find the next adjacent original rect in y positive direction. */
{
continue;
}
/* Check whether there is an Y intesection between these adjacent rects in the new rectangles
* and fix the intersection if delta is "good".
*/
if (delta > 0)
{
DDCLOG(("YP intersection bottom %d top %d, diff %d\n",
delta));
}
}
/* Y negative (in the computer sence, down->top). */
{
/* Find the next adjacent original rect in x negative direction. */
{
continue;
}
/* Check whether there is an Y intesection between these adjacent rects in the new rectangles
* and fix the intersection if delta is "good".
*/
if (delta < 0)
{
DDCLOG(("YN intersection top %d bottom %d, diff %d\n",
delta));
}
}
return;
}
int showBalloonTip (HINSTANCE hInst, HWND hWnd, UINT uID, const char *pszMsg, const char *pszTitle, UINT uTimeout, DWORD dwInfoFlags)
{
if (dwInfoFlags == 0)
return FALSE;
{
{
//niData.dwInfoFlags = NIIF_USER; /* Use an own icon instead of the default one */
}
{
}
#endif
}
return GetLastError();
return 0;
}