[ros-kernel] about the implementation of ExtCreatePen

M.Taguchi mtg at ce.wakwak.com
Sat Mar 20 14:28:03 CET 2004


Hello, folks.

I tried to fix DrawCheckedRect() which is used for drawing borders of captions on
checkbox, radiobutton, listview-menu, etc... This function should draw a dotted border,
but current ROS-DrawCheckedRect() just draws a solid border. I tracked the problem
down and found the problem is thorough lack of ExtCreatePen() and extended-pen
handling.

The problem is; we don't have extended pen object. PENOBJ, which is used by
IntGdiCreatePenIndirect() is declared as above:
typedef struct
{
   LOGPEN logpen;
   ULONG  iSolidColor;
} PENOBJ, *PPENOBJ;

As you see, we can't use this structure for ExtCreatePen() because of lacking attribute
space, so we'll have to define another one; something like this:
typedef struct
{
   EXTLOGPEN elgpn;
   ULONG  iSolidColor;
} EXTPENOBJ, *PEXTPENOBJ;

However, I'm not sure whether it's a right thing to do or not, and this is the way MS does
or not. If it's right, then we'll also have to modify NtGdiSelectObject() to handle the structure.

...Well, I mean, I've lost the way ;P This problem should be resolved but I even don't know
what is the right way to go. Should we extend the structure and make NtGdiCreatePenIndirect()
to wrap the structure? Or should we make two different structure and handle them separated
ways?

Request For Comments :)


References:
DrawCheckedRect(): /lib/user32/controls/button.c & /lib/user32/windows/draw.c
CreatePen(): /lib/gdi32/objects/pen.c
ExtCreatePen(): /lib/gdi32/objects/pen.c
NtGdiExtCreatePen(): /subsys/win32k/objects/pen.c
NtGdiSelectObject(): /subsys/win32k/objects/dc.c

LOGPEN: /w32api/include/wingdi.h
EXTLOGPEN: /w32api/include/wingdi.h
PENOBJ: /include/win32k/pen.h

Regards, Masahiro.


More information about the Ros-kernel mailing list