nanogui: Kaffe port to Microwindows


Previous by date: 18 Mar 2000 16:45:06 -0000 Re: What is MPL ?, Richard Tseng
Next by date: 18 Mar 2000 16:45:06 -0000 Re: [FLTK] FLTK on Microwindows, Greg Haerr
Previous in thread:
Next in thread: 18 Mar 2000 16:45:06 -0000 Re: Kaffe port to Microwindows, Greg Haerr

Subject: Kaffe port to Microwindows
From: "Greg Haerr" ####@####.####
Date: 18 Mar 2000 16:45:06 -0000
Message-Id: <05de01bf90f7$c4e7a320$15320cd0@gregh>

Jean-Eric,
    I'm glad to help getting the Kaffe port going.  I agree that it's
probably a good idea to use the java widgets from X11, so that
we only have to implement the drawing backend.  I've attached
your win2mwin.h file, and have comments following:


#ifndef win2mwin_included
#define win2mwin_included


#define WM_DRAWITEM 0x11111
this is for owner-drawn buttons/combos.  Probably not
to be supported asap.



#define WM_CTLCOLOREDIT 0x11112
#define WM_CTLCOLORBTN 0x11113
#define WM_CTLCOLORLISTBOX 0x11114
#define WM_CTLCOLORSCROLLBAR 0x11115
#define WM_CTLCOLORSTATIC 0x11116
not needed now.  these msgs allow win controls to inherit
their color settings





#define WM_SYSKEYDOWN 0x11117
#define WM_KEYDOWN 0x11118
#define WM_SYSKEYUP 0x11119
#define WM_KEYUP 0x11120
these are the kbd messages.  We will need to add them for
kbd support.  I haven't started on this yet, since it requires
scancodes.  We can use the simpler WM_CHAR message
now however.



#define WM_HSCROLL 0x11121
this and VSCROLL are going to be required for
scrollbars in any window.  I plan to support them


#define WM_WINDOWPOSCHANGED 0x11122
This can be supported, I'll add it to the list now



#define WM_ACTIVATE 0x11123
This could be supported now, but may not make sense


#define WM_VSCROLL 0x11124
see above


HWND GetDlgItem(HWND, WORD);
This returns a subwindow id.  I'll add it



BOOL GetUpdateRect( HWND, RECT*, bool);
supported in latest rev, 0.88pre3d


LRESULT CallWindowProc( WNDPROC, HWND, UINT, WORD, DWORD);
We can probably add this, asap



void SetWindowPos(HWND, void*, int x, int y, int width, int height, int);
supported in pre3d, still a little buggy, however.  I plan on fixing it asap

void SetCursor(HCURSOR c);
currently unsupported, will add later

void MapWindowPoints(HWND hwnd, HWND, POINT*, int);
probably a good idea to add this, I will

#define TPM_LEFTALIGN 0
#define TPM_TOPALIGN 1
#define TPM_RETURNCMD 2
int TrackPopupMenuEx(void*, int, int, int, HWND, void*);
this wont come for some time, it's for menu callbacks

#define MK_RBUTTON 0
#define VK_SHIFT 1
#define VK_CONTROL 2
#define VK_MENU 3
#define VK_DELETE 4
#define VK_INSERT 5
#define VK_TAB 6
#define VK_RETURN 7
These need to be defined when the kbd stuff comes in



#define WM_SETFONT 0
This may want to be added, I'll look into it.  Normally
only used in custom controls, which we dont have yet
You really need to check into the calls to CreateWindow,
and see what controls AWT is currently using.  This is
very important.

struct MENUITEMINFO
{
 BYTE cbSize;
 int fMask;
 DWORD dwItemData;
};
#define MIIM_DATA 0
BOOL GetMenuItemInfo( HMENU, int, BOOL, MENUITEMINFO*);
This will come later, when menus are added.


int GetKeyState(int);
void GetKeyboardState(BYTE*);
int ToAscii(int, int, BYTE*, WORD*, int);
added when kbd stuff is added.



UINT GetWindowTextLength(HWND);
void EnableWindow(HWND hwnd, BOOL b);
HWND GetParent(HWND hwnd);
void AdjustWindowRectEx( RECT*, int, BOOL, int);
I can probably added all the above asap


// MENU
void processMenuAction(HMENU, int);
// MENU CE
HMENU CommandBar_GetMenu(HWND, int);
int CommandBar_Height(HWND);
These aren't win32 api call.s

struct TEXTMETRIC
{
 int tmAscent;
 int tmDescent;
 int tmHeight;
 int tmInternalLeading;
 int tmOverhang;
};
void GetTextMetrics(HDC, TEXTMETRIC*);
this is supported in 0.88pre3d.  I'm currently working
on TT and T1 font support as well.



void GetTextExtentExPoint(HDC, TCHAR* cs, int len, int, void*, void*, SIZE*);
This should probably be added asap, it will take a bit of work



#define SWP_NOZORDER 0
#define HWND_BOTTOM 0
#define HWND_TOP 0
#define SWP_NOMOVE 0
#define SWP_NOSIZE 0
these are defined in 0.88pre3d



int GetDeviceCaps(HDC, int);
#define LOGPIXELSX 0
#define SM_CYSCREEN 0
#define SM_CYSCREEN 0
#define SM_CYMENU 0
#define SM_CXVSCROLL 0
int GetSystemMetrics(int);
I've been thinking of adding these babies for a while.
I guess now's the time.


int GetRValue(unsigned long);
int GetGValue(unsigned long);
int GetBValue(unsigned long);
I'll define this asap to REDVALUE, etc


void Polyline(HDC, LPPOINT, int);
HRGN CreateRectRgn( int, int, int, int);
void SelectClipRgn(HDC, HRGN);
void Ellipse( HDC, int, int, int, int);
void Polygon(HDC, POINT*, int);
I just added all these to the prereleased 0.88pre3d



void RoundRect(HDC, int, int, int, int, int, int);
replace with  Rectangle for now, this will come but can wait

void StretchBlt(HDC, int, int, int, int, HDC, int, int, int, int, int /*in fact
a MODE define*/);
void MaskBlt(HDC, int, int, int width, int height, HDC, int srcX, int srcY,
HBITMAP mask, int, int, int);
file://void PatBlt( img->dcMask, 0, 0, img->width, img->height, BLACKNESS); //
???

These above are a lot of work.  They may need to be replaced with the
implemented BitBlt for now, or commented out.  I need to see the code around
them to understand what to implement.  I plan on adding StretchBlt, and MaskBlt
can probably be added.  PatBlt is another issue, and can probably be replaced
with FillRect


unsigned long GetPixel(HDC, int x, int y);
This has been in for a long time, I'm surprised it came up undef'd


 #define MAKEROP4(a, b) max(a,b) // ???
???


#define SRCPAINT 0
This usually goes with PatBlt or MaskBlt, I'd like to see the code here

#define SRCAND 0
#define SRCINVERT 0
These are the AND and XOR blitters.  Currently we have just OR.
Not too hard to add, lots oif typing...  It would be nice to see what
they're used for


#define _tcslen strlen
Make sure that the Kaffe's not using wide characters, and doesn't
define UNICODE.  If UNICODE is defined, we're in for a lot of work


#define __cdecl
#define _cdecl
probably best left in your hdrs

typedef bool boolean;
This isn't a windows define, so ???

struct WINDOWPOS
{
 int x;
 int y;
 int cx;
 int cy;
};
typedef WINDOWPOS* LPWINDOWPOS;
I will add this for the WM_WINDOWPOSCHANGED msg

struct DRAWITEMSTRUCT
{
 // nothing
};
typedef DRAWITEMSTRUCT* LPDRAWITEMSTRUCT;
This is for WM_DRAWITEM, probably not coming soon


Hope this helps...  The first step is to try to get _something_ running.
Let me know your progress.  You definitely need to pull down 0.88pre3d,
which has been heavily moving forward from the FLTK port.

Regards,

Greg



Previous by date: 18 Mar 2000 16:45:06 -0000 Re: What is MPL ?, Richard Tseng
Next by date: 18 Mar 2000 16:45:06 -0000 Re: [FLTK] FLTK on Microwindows, Greg Haerr
Previous in thread:
Next in thread: 18 Mar 2000 16:45:06 -0000 Re: Kaffe port to Microwindows, Greg Haerr


Powered by ezmlm-browse 0.20.