Changeset 4596 for trunk/src


Ignore:
Timestamp:
Nov 15, 2000, 2:56:46 PM (25 years ago)
Author:
sandervl
Message:

(Ext)SelectClipRgn fixes

Location:
trunk/src/gdi32
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gdi32/makefile

    r4557 r4596  
    1 # $Id: makefile,v 1.29 2000-11-05 18:48:22 sandervl Exp $
     1# $Id: makefile,v 1.30 2000-11-15 13:56:45 sandervl Exp $
    22
    33#
     
    2424#CXXFLAGS = $(CXXFLAGS) -DSTDCALL_ENUMPROCS -DINVERT
    2525
    26 CFLAGS   = $(CFLAGS) -DINVERT
    27 CXXFLAGS = $(CXXFLAGS) -DINVERT
     26CFLAGS   = $(CFLAGS) -DINVERT -DUSING_OPEN32
     27CXXFLAGS = $(CXXFLAGS) -DINVERT -DUSING_OPEN32
    2828
    2929# Object files. All objects should be prefixed with $(OBJDIR)!
  • trunk/src/gdi32/objhandle.cpp

    r4533 r4596  
    1 /* $Id: objhandle.cpp,v 1.5 2000-10-26 17:20:29 sandervl Exp $ */
     1/* $Id: objhandle.cpp,v 1.6 2000-11-15 13:56:45 sandervl Exp $ */
    22/*
    33 * Win32 Handle Management Code for OS/2
     
    1919#include <vmutex.h>
    2020#include <objhandle.h>
     21#include <dcdata.h>
     22#include <winuser32.h>
     23#include "oslibgpi.h"
    2124#include "dibsect.h"
    2225#include "region.h"
     
    217220
    218221    if(ObjGetHandleType(hObj) == GDIOBJ_REGION) {
    219     //Return complexity here; not previously selected clip region
     222        //Return complexity here; not previously selected clip region
    220223        return (HGDIOBJ)SelectClipRgn(hdc, hObj);
    221224    }
     
    246249      }
    247250    }
     251#ifdef USING_OPEN32
     252    if(O32_GetObjectType(hObj) == OBJ_BITMAP)
     253    {
     254        //SvL: Open32 messes up the height of the hdc (for windows)
     255        pDCData  pHps = (pDCData)OSLibGpiQueryDCData((HPS)hdc);
     256        if(pHps && pHps->hwnd) {
     257              dprintf2(("change back origin"));
     258              selectClientArea(pHps);
     259              setPageXForm(pHps);
     260        }
     261    }
     262#endif
     263    dprintf2(("GDI32: SelectObject %x %x returned %x", hdc, hObj, rc));
     264
    248265    return(rc);
    249266}
  • trunk/src/gdi32/oslibgpi.cpp

    r4170 r4596  
    1 /* $Id: oslibgpi.cpp,v 1.7 2000-09-03 09:30:35 sandervl Exp $ */
     1/* $Id: oslibgpi.cpp,v 1.8 2000-11-15 13:56:45 sandervl Exp $ */
    22
    33/*
     
    1919#include <winconst.h>
    2020#include "oslibgpi.h"
    21 #include "dcdata.h"
     21#include <dcdata.h>
     22#include <misc.h>
    2223
    2324#define DBG_LOCALLOG    DBG_oslibgpi
     
    404405
    405406
     407int OSLibGpiQueryFontMaxHeight(HDC hdc)
     408{
     409  FONTMETRICS metrics;
     410  BOOL rc;
     411
     412  rc = GpiQueryFontMetrics(hdc, sizeof(metrics), &metrics);
     413  if(rc) {
     414        return metrics.lMaxAscender;
     415  }
     416  else {
     417        dprintf(("GpiQueryFontMetrics returned FALSE!!"));
     418        return 0;
     419  }
     420}
     421
     422#ifdef DEBUG
     423void dprintfOrigin(HDC hdc)
     424{
     425   POINTL point;
     426
     427    pDCData  pHps = (pDCData)OSLibGpiQueryDCData((HPS)hdc);
     428    if(!pHps)
     429    {
     430        return;
     431    }
     432
     433    GreGetDCOrigin(pHps->hps, &point);
     434    dprintf2(("HDC origin (%d,%d) org (%d,%d)", point.x, point.y, pHps->ptlOrigin.x, pHps->ptlOrigin.y));
     435}
     436#endif
  • trunk/src/gdi32/oslibgpi.h

    r4012 r4596  
    1 /* $Id: oslibgpi.h,v 1.7 2000-08-14 15:51:20 cbratschi Exp $ */
     1/* $Id: oslibgpi.h,v 1.8 2000-11-15 13:56:45 sandervl Exp $ */
    22
    33/*
     
    1111#ifndef __OSLIBGPI_H__
    1212#define __OSLIBGPI_H__
     13
     14
     15#ifdef DEBUG
     16void dprintfOrigin(HDC hdc);
     17#else
     18#define dprintfOrigin(a)
     19#endif
    1320
    1421#define APIENTRYOS2 _System
     
    188195LONG OSLibWinDrawTabbedText(PVOID pHps,LONG cchText,LONG lTabs,LPCSTR lpchText,PVOID prcl,LONG clrFore,LONG clrBack,ULONG flCmd);
    189196
     197int OSLibGpiQueryFontMaxHeight(HDC hdc);
    190198
    191199BOOL OSLibGpiMove(PVOID pHps,PPOINTLOS2 pptlPoint);
  • trunk/src/gdi32/region.cpp

    r4557 r4596  
    1 /* $Id: region.cpp,v 1.16 2000-11-05 18:48:22 sandervl Exp $ */
     1/* $Id: region.cpp,v 1.17 2000-11-15 13:56:46 sandervl Exp $ */
    22
    33/*
     
    374374    }
    375375
     376    dprintf(("SelectClipRgn: %x %x", hdc, hrgn));
     377
    376378    if(hrgn)
    377379    {
     
    404406        if (lComplexity != RGN_ERROR )
    405407        {
    406             dprintf(("SelectClipRgn: %x %x", hdc, hrgn));
    407408            if(hrgnOldClip)
    408409                GpiDestroyRegion(pHps->hps, hrgnOldClip);
     
    410411            //todo: metafile recording
    411412            SetLastError(ERROR_SUCCESS_W);
     413
     414            //SvL: Must check if origin changed here. Sometimes happens when
     415            //     window looses focus. (don't know why....)
     416            if(pHps->isClient)
     417                selectClientArea(pHps);
    412418            return lComplexity;
    413419        }
     
    518524        lComplexity = GpiSetClipRegion(pHps->hps, hrgnCurrent, &hrgnOld);
    519525        SetLastError(ERROR_SUCCESS_W);
     526
     527        //SvL: Must check if origin changed here. Sometimes happens when
     528        //     window looses focus. (don't know why....)
     529        if(pHps->isClient)
     530            selectClientArea(pHps);
     531
    520532        if (lComplexity != RGN_ERROR)
    521533            return lComplexity;
Note: See TracChangeset for help on using the changeset viewer.