Ignore:
Timestamp:
Dec 28, 1999, 6:04:24 PM (26 years ago)
Author:
cbratschi
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/oslibgdi.cpp

    r2221 r2228  
    1 /* $Id: oslibgdi.cpp,v 1.5 1999-12-27 22:53:52 cbratschi Exp $ */
     1/* $Id: oslibgdi.cpp,v 1.6 1999-12-28 17:04:23 cbratschi Exp $ */
    22/*
    33 * Window GDI wrapper functions for OS/2
     
    1919#include <oslibgdi.h>
    2020#include <oslibwin.h>
     21#include "win32wbase.h"
    2122
    2223//CB: new mapping infrastructure to avoid transformation bugs -> available soon
    2324
    2425/*
    25 All functions can be used to transform from Win32 to OS/2 and vice versa
     26All mapScreen/Window can be used to transform from Win32 to OS/2 and vice versa
    2627First letter is lower case to avoid conflicts with Win32 API names
    2728
    2829Single y mapping:
    2930 mapScreenY()
    30  mapWindowY()
     31 mapClientY()
     32 mapChildY()
    3133
    3234Single point mapping:
    3335 mapScreenPoint()
    34  mapWindowPoint()
     36 mapClientPoint()
     37 mapChildPoint()
    3538
    3639Single rect mapping:
    3740 mapScreenRect()
    38  mapWindowRect()
     41 mapClientRect()
    3942
    4043Rect transformation:
     
    4346*/
    4447
    45 INT mapScreenY(INT y)
    46 {
    47   return WinQuerySysValue(HWND_DESKTOP,SV_CYSCREEN)-1-y;
    48 }
    49 //******************************************************************************
    50 //******************************************************************************
    51 INT mapScreenY(INT screenH,INT y)
    52 {
    53   return screenH-1-y;
    54 }
    55 
     48INT mapScreenY(INT screenPosY)
     49{
     50  return WinQuerySysValue(HWND_DESKTOP,SV_CYSCREEN)-1-screenPosY;
     51}
     52//******************************************************************************
     53//******************************************************************************
     54INT mapScreenY(INT screenH,INT screenPosY)
     55{
     56  return screenH-1-screenPosY;
     57}
     58//******************************************************************************
     59//******************************************************************************
     60INT mapClientY(INT clientH,INT clientPosY)
     61{
     62  return clientH-1-clientPosY;
     63}
     64//******************************************************************************
     65//******************************************************************************
     66INT mapClientY(HWND os2Client,INT clientPosY)
     67{
     68  RECTL rect;
     69
     70  if (os2Client == OSLIB_HWND_DESKTOP) os2Client = HWND_DESKTOP; //client shouldn't be desktop
     71  if (!WinQueryWindowRect(os2Client,&rect)) return 0;
     72  return rect.yTop-1-clientPosY;
     73}
     74//******************************************************************************
     75//******************************************************************************
     76INT mapClientY(Win32BaseWindow *win32wnd,INT clientPosY)
     77{
     78  return win32wnd->getWindowHeight()-1-clientPosY;
     79}
     80//******************************************************************************
     81//******************************************************************************
     82INT mapChildY(INT parentH,INT childY,INT childPosY)
     83{
     84  return parentH-1-childY-childPosY;
     85}
     86//******************************************************************************
     87//******************************************************************************
     88INT mapChildY(HWND os2Parent,INT childY,INT childPosY)
     89{
     90  RECTL rect;
     91
     92  if (os2Parent == OSLIB_HWND_DESKTOP) os2Parent = HWND_DESKTOP;
     93  if (!WinQueryWindowRect(os2Parent,&rect)) return 0;
     94  return rect.yTop-1-childY-childPosY;
     95}
     96//******************************************************************************
     97//******************************************************************************
     98INT mapChildY(HWND os2Parent,HWND os2Child,INT childPosY)
     99{
     100  RECTL rect;
     101  SWP swp;
     102
     103  if (os2Parent == OSLIB_HWND_DESKTOP) os2Parent = HWND_DESKTOP;
     104  if (!WinQueryWindowRect(os2Parent,&rect)) return 0;
     105  if (!WinQueryWindowPos(os2Child,&swp)) return 0;
     106  return rect.yTop-1-swp.y-childPosY;
     107}
     108//******************************************************************************
     109//******************************************************************************
     110BOOL mapScreenPoint(OSLIBPOINT *screenPt)
     111{
     112  if(!screenPt) return FALSE;
     113  screenPt->y = WinQuerySysValue(HWND_DESKTOP,SV_CYSCREEN)-1-screenPt->y;
     114  return TRUE;
     115}
     116//******************************************************************************
     117//******************************************************************************
     118INT mapScreenY(INT screenH,OSLIBPOINT *screenPt)
     119{
     120  if (!screenPt) return FALSE;
     121  screenPt->y = screenH-1-screenPt->y;
     122  return TRUE;
     123}
     124
     125//old mapping functions
    56126
    57127//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.