Skip to content

Commit

Permalink
Merge pull request #45 from malxau/win64
Browse files Browse the repository at this point in the history
Support for a 64 bit Windows build
  • Loading branch information
mbert authored Jul 5, 2021
2 parents dd6e168 + 32ea960 commit 080c1a4
Show file tree
Hide file tree
Showing 9 changed files with 338 additions and 339 deletions.
3 changes: 1 addition & 2 deletions guiwin32/guiwin.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,6 @@ static int gwinit (int argc, char *argv[])
static void gwloop (void)
{
MSG msg;
GUI_WINDOW *gwp;

/* the default window options aren't editable once we have real windows */
optdelete((OPTVAL *)&gw_def_win.options);
Expand Down Expand Up @@ -562,7 +561,7 @@ static void gwdraw(GUIWIN *gw, long fg, long bg, int bits, Char *text, int len)
register int i;
GUI_WINDOW *gwp = (GUI_WINDOW *)gw;
COLORREF fgc, bgc;
HBRUSH hBrush, hPrevBrush;
HBRUSH hBrush;
HPEN hPen, hPrevPen;
HDC hDC;
HFONT hFont;
Expand Down
2 changes: 1 addition & 1 deletion guiwin32/gwcmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ static void gwcmd_help_options (GUI_WINDOW *gwp)
** gwcmd -- process a menu command.
*/

LONG gwcmd (GUI_WINDOW *gwp, UINT wParam)
LRESULT gwcmd (GUI_WINDOW *gwp, WPARAM wParam)

{
switch (LOWORD (wParam)) {
Expand Down
182 changes: 91 additions & 91 deletions guiwin32/gwdlgs.c

Large diffs are not rendered by default.

54 changes: 27 additions & 27 deletions guiwin32/gwmsg.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ static int mouse_selection = MOUSE_SEL_NONE;
** gwframe_WM_GETMINMAXINFO
*/

LONG gwframe_WM_GETMINMAXINFO (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
LRESULT gwframe_WM_GETMINMAXINFO (GUI_WINDOW *gwp, WPARAM wParam, LPARAM lParam)

{
RECT viewRect;
Expand Down Expand Up @@ -64,7 +64,7 @@ LONG gwframe_WM_GETMINMAXINFO (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
** gwframe_WM_INITMENU
*/

LONG gwframe_WM_INITMENU (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
LRESULT gwframe_WM_INITMENU (GUI_WINDOW *gwp, WPARAM wParam, LPARAM lParam)

{
return 1;
Expand All @@ -75,7 +75,7 @@ LONG gwframe_WM_INITMENU (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
** gwframe_WM_MENUSELECT
*/

LONG gwframe_WM_MENUSELECT (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
LRESULT gwframe_WM_MENUSELECT (GUI_WINDOW *gwp, WPARAM wParam, LPARAM lParam)

{
char str[80];
Expand All @@ -102,7 +102,7 @@ LONG gwframe_WM_MENUSELECT (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
*/

#if _MSC_VER > 900
LONG gwframe_WM_NOTIFY (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
LRESULT gwframe_WM_NOTIFY (GUI_WINDOW *gwp, WPARAM wParam, LPARAM lParam)

{
if (gwp->toolbarHWnd != NULL)
Expand All @@ -117,7 +117,7 @@ LONG gwframe_WM_NOTIFY (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
** gwframe_WM_PAINT
*/

LONG gwframe_WM_PAINT (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
LRESULT gwframe_WM_PAINT (GUI_WINDOW *gwp, WPARAM wParam, LPARAM lParam)

{
PAINTSTRUCT ps;
Expand All @@ -133,7 +133,7 @@ LONG gwframe_WM_PAINT (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
** gframe_WM_SETFOCUS
*/

LONG gwframe_WM_SETFOCUS (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
LRESULT gwframe_WM_SETFOCUS (GUI_WINDOW *gwp, WPARAM wParam, LPARAM lParam)

{
if (gwp->active)
Expand All @@ -147,7 +147,7 @@ LONG gwframe_WM_SETFOCUS (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
** gframe_WM_SIZE
*/

LONG gwframe_WM_SIZE (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
LRESULT gwframe_WM_SIZE (GUI_WINDOW *gwp, WPARAM wParam, LPARAM lParam)

{
RECT rect;
Expand All @@ -169,7 +169,7 @@ LONG gwframe_WM_SIZE (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
** gwclient_WM_CHAR
*/

LONG gwclient_WM_CHAR (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
LRESULT gwclient_WM_CHAR (GUI_WINDOW *gwp, WPARAM wParam, LPARAM lParam)

{
unsigned char chr = (unsigned char)wParam;
Expand All @@ -193,7 +193,7 @@ LONG gwclient_WM_CHAR (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
** gwclient_WM_DROPFILES
*/

LONG gwclient_WM_DROPFILES (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
LRESULT gwclient_WM_DROPFILES (GUI_WINDOW *gwp, WPARAM wParam, LPARAM lParam)

{
char cmd[_MAX_PATH + 4];
Expand Down Expand Up @@ -222,7 +222,7 @@ LONG gwclient_WM_DROPFILES (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
** gwclient_WM_ERASEBKGND
*/

LONG gwclient_WM_ERASEBKGND (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
LRESULT gwclient_WM_ERASEBKGND (GUI_WINDOW *gwp, WPARAM wParam, LPARAM lParam)

{
RECT rect;
Expand Down Expand Up @@ -259,7 +259,7 @@ LONG gwclient_WM_ERASEBKGND (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
** gwclient_WM_KEYDOWN
*/

LONG gwclient_WM_KEYDOWN (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
LRESULT gwclient_WM_KEYDOWN (GUI_WINDOW *gwp, WPARAM wParam, LPARAM lParam)

{
unsigned char chr[3];
Expand Down Expand Up @@ -391,7 +391,7 @@ LONG gwclient_WM_KEYDOWN (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
** gwclient_WM_KEYUP
*/

LONG gwclient_WM_KEYUP (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
LRESULT gwclient_WM_KEYUP (GUI_WINDOW *gwp, WPARAM wParam, LPARAM lParam)

{
if (wParam == VK_SHIFT)
Expand All @@ -410,7 +410,7 @@ LONG gwclient_WM_KEYUP (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
** gwclient_WM_KILLFOCUS
*/

LONG gwclient_WM_KILLFOCUS (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
LRESULT gwclient_WM_KILLFOCUS (GUI_WINDOW *gwp, WPARAM wParam, LPARAM lParam)

{
HideCaret (gwp->clientHWnd);
Expand All @@ -427,7 +427,7 @@ LONG gwclient_WM_KILLFOCUS (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
** gwclient_WM_LBUTTONDBLCLK
*/

LONG gwclient_WM_LBUTTONDBLCLK (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
LRESULT gwclient_WM_LBUTTONDBLCLK (GUI_WINDOW *gwp, WPARAM wParam, LPARAM lParam)

{
int row = HIWORD (lParam) / gwp->ycsize;
Expand All @@ -447,7 +447,7 @@ LONG gwclient_WM_LBUTTONDBLCLK (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
** gwclient_WM_LBUTTONDOWN
*/

LONG gwclient_WM_LBUTTONDOWN (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
LRESULT gwclient_WM_LBUTTONDOWN (GUI_WINDOW *gwp, WPARAM wParam, LPARAM lParam)

{
mouse_down = 1;
Expand Down Expand Up @@ -475,7 +475,7 @@ LONG gwclient_WM_LBUTTONDOWN (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
** gwclient_WM_LBUTTONUP
*/

LONG gwclient_WM_LBUTTONUP (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
LRESULT gwclient_WM_LBUTTONUP (GUI_WINDOW *gwp, WPARAM wParam, LPARAM lParam)

{
mouse_down = 0;
Expand All @@ -497,7 +497,7 @@ LONG gwclient_WM_LBUTTONUP (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
** gwclient_WM_MOUSEMOVE
*/

LONG gwclient_WM_MOUSEMOVE (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
LRESULT gwclient_WM_MOUSEMOVE (GUI_WINDOW *gwp, WPARAM wParam, LPARAM lParam)

{
int row;
Expand Down Expand Up @@ -569,7 +569,7 @@ LONG gwclient_WM_MOUSEMOVE (GUI_WINDOW *gwp, UINT wParam, LONG lParam)

#if defined (WM_MOUSEWHEEL)

LONG gwclient_WM_MOUSEWHEEL (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
LRESULT gwclient_WM_MOUSEWHEEL (GUI_WINDOW *gwp, WPARAM wParam, LPARAM lParam)

{
short delta = HIWORD (wParam);
Expand All @@ -591,11 +591,11 @@ LONG gwclient_WM_MOUSEWHEEL (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
** gwclient_WM_PAINT
*/

LONG gwclient_WM_PAINT (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
LRESULT gwclient_WM_PAINT (GUI_WINDOW *gwp, WPARAM wParam, LPARAM lParam)

{
PAINTSTRUCT ps;
HBRUSH brush, prevbrush;
HBRUSH brush;
int left;
int top;

Expand Down Expand Up @@ -637,7 +637,7 @@ LONG gwclient_WM_PAINT (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
** gwclient_WM_RBUTTONDBLCLK
*/

LONG gwclient_WM_RBUTTONDBLCLK (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
LRESULT gwclient_WM_RBUTTONDBLCLK (GUI_WINDOW *gwp, WPARAM wParam, LPARAM lParam)

{
int row = HIWORD (lParam) / gwp->ycsize;
Expand All @@ -657,7 +657,7 @@ LONG gwclient_WM_RBUTTONDBLCLK (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
** gwclient_WM_RBUTTONDOWN
*/

LONG gwclient_WM_RBUTTONDOWN (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
LRESULT gwclient_WM_RBUTTONDOWN (GUI_WINDOW *gwp, WPARAM wParam, LPARAM lParam)

{
WINDOW pwin = winofgw ((GUIWIN *)gwp);
Expand All @@ -683,7 +683,7 @@ LONG gwclient_WM_RBUTTONDOWN (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
** gwclient_WM_RBUTTONUP
*/

LONG gwclient_WM_RBUTTONUP (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
LRESULT gwclient_WM_RBUTTONUP (GUI_WINDOW *gwp, WPARAM wParam, LPARAM lParam)

{
WINDOW pwin = winofgw ((GUIWIN *)gwp);
Expand Down Expand Up @@ -712,7 +712,7 @@ LONG gwclient_WM_RBUTTONUP (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
** gwclient_WM_SETFOCUS
*/

LONG gwclient_WM_SETFOCUS (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
LRESULT gwclient_WM_SETFOCUS (GUI_WINDOW *gwp, WPARAM wParam, LPARAM lParam)

{
dblclick = 0;
Expand Down Expand Up @@ -743,7 +743,7 @@ LONG gwclient_WM_SETFOCUS (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
** gwclient_WM_SIZE
*/

LONG gwclient_WM_SIZE (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
LRESULT gwclient_WM_SIZE (GUI_WINDOW *gwp, WPARAM wParam, LPARAM lParam)

{
int oldrows;
Expand All @@ -770,7 +770,7 @@ LONG gwclient_WM_SIZE (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
** gwclient_WM_SYSKEYDOWN
*/

LONG gwclient_WM_SYSKEYDOWN (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
LRESULT gwclient_WM_SYSKEYDOWN (GUI_WINDOW *gwp, WPARAM wParam, LPARAM lParam)

{
unsigned char chr[3];
Expand Down Expand Up @@ -806,7 +806,7 @@ LONG gwclient_WM_SYSKEYDOWN (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
** gwclient_WM_VSCROLL
*/

LONG gwclient_WM_VSCROLL (GUI_WINDOW *gwp, UINT wParam, LONG lParam)
LRESULT gwclient_WM_VSCROLL (GUI_WINDOW *gwp, WPARAM wParam, LPARAM lParam)

{
long nPos = HIWORD (wParam);
Expand Down
4 changes: 4 additions & 0 deletions guiwin32/gwopts.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,11 @@ int optisicon (OPTDESC *opt, OPTVAL *val, Char *newval)

/* store it as an icon */
if ((gwp = gw_find_client (GetFocus ())) != NULL)
#if _WIN64
SetClassLongPtr(gwp->frameHWnd, GCLP_HICON, (LONG_PTR)hicon);
#else
SetClassLong(gwp->frameHWnd, GCL_HICON, (long)hicon);
#endif

/* free the old icon, and remember the new one */
if (gwcustomicon)
Expand Down
44 changes: 22 additions & 22 deletions guiwin32/gwtoolb.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,27 @@
#include "elvisres.h"

static TBBUTTON buttons[] = {
{ 0, IDM_FILE_NEW, TBSTATE_ENABLED, TBSTYLE_BUTTON, IDM_FILE_NEW, 0, },
{ 1, IDM_FILE_OPEN, TBSTATE_ENABLED, TBSTYLE_BUTTON, IDM_FILE_OPEN, 0, },
{ 2, IDM_FILE_SAVE, TBSTATE_ENABLED, TBSTYLE_BUTTON, IDM_FILE_SAVE, 0, },
{ 0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, },
{ 3, IDM_EDIT_CUT, TBSTATE_ENABLED, TBSTYLE_BUTTON, IDM_EDIT_CUT, 0, },
{ 4, IDM_EDIT_COPY, TBSTATE_ENABLED, TBSTYLE_BUTTON, IDM_EDIT_COPY, 0, },
{ 5, IDM_EDIT_PASTE, TBSTATE_ENABLED, TBSTYLE_BUTTON, IDM_EDIT_PASTE, 0, },
{ 0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, },
{ 6, IDM_EDIT_UNDO, TBSTATE_ENABLED, TBSTYLE_BUTTON, IDM_EDIT_UNDO, 0, },
{ 7, IDM_EDIT_REDO, TBSTATE_ENABLED, TBSTYLE_BUTTON, IDM_EDIT_REDO, 0, },
{ 0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, },
{ 8, IDM_WINDOW_NFILE, TBSTATE_ENABLED, TBSTYLE_BUTTON, IDM_WINDOW_NFILE, 0, },
{ 9, IDM_WINDOW_PFILE, TBSTATE_ENABLED, TBSTYLE_BUTTON, IDM_WINDOW_PFILE, 0, },
{ 0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, },
{10, IDM_WINDOW_NEW, TBSTATE_ENABLED, TBSTYLE_BUTTON, IDM_WINDOW_NEW, 0, },
{11, IDM_WINDOW_NEXT, TBSTATE_ENABLED, TBSTYLE_BUTTON, IDM_WINDOW_NEXT, 0, },
{12, IDM_WINDOW_PREVIOUS,TBSTATE_ENABLED, TBSTYLE_BUTTON, IDM_WINDOW_PREVIOUS, 0, },
{ 0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, },
{13, IDM_FILE_PRINT, TBSTATE_ENABLED, TBSTYLE_BUTTON, IDM_FILE_PRINT, 0, },
{ 0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, },
{14, IDM_HELP_INDEX, TBSTATE_ENABLED, TBSTYLE_BUTTON, IDM_HELP_INDEX, 0, },
{ 0, IDM_FILE_NEW, TBSTATE_ENABLED, TBSTYLE_BUTTON },
{ 1, IDM_FILE_OPEN, TBSTATE_ENABLED, TBSTYLE_BUTTON },
{ 2, IDM_FILE_SAVE, TBSTATE_ENABLED, TBSTYLE_BUTTON },
{ 0, 0, TBSTATE_ENABLED, TBSTYLE_SEP },
{ 3, IDM_EDIT_CUT, TBSTATE_ENABLED, TBSTYLE_BUTTON },
{ 4, IDM_EDIT_COPY, TBSTATE_ENABLED, TBSTYLE_BUTTON },
{ 5, IDM_EDIT_PASTE, TBSTATE_ENABLED, TBSTYLE_BUTTON },
{ 0, 0, TBSTATE_ENABLED, TBSTYLE_SEP },
{ 6, IDM_EDIT_UNDO, TBSTATE_ENABLED, TBSTYLE_BUTTON },
{ 7, IDM_EDIT_REDO, TBSTATE_ENABLED, TBSTYLE_BUTTON },
{ 0, 0, TBSTATE_ENABLED, TBSTYLE_SEP },
{ 8, IDM_WINDOW_NFILE, TBSTATE_ENABLED, TBSTYLE_BUTTON },
{ 9, IDM_WINDOW_PFILE, TBSTATE_ENABLED, TBSTYLE_BUTTON },
{ 0, 0, TBSTATE_ENABLED, TBSTYLE_SEP },
{10, IDM_WINDOW_NEW, TBSTATE_ENABLED, TBSTYLE_BUTTON },
{11, IDM_WINDOW_NEXT, TBSTATE_ENABLED, TBSTYLE_BUTTON },
{12, IDM_WINDOW_PREVIOUS,TBSTATE_ENABLED, TBSTYLE_BUTTON },
{ 0, 0, TBSTATE_ENABLED, TBSTYLE_SEP },
{13, IDM_FILE_PRINT, TBSTATE_ENABLED, TBSTYLE_BUTTON },
{ 0, 0, TBSTATE_ENABLED, TBSTYLE_SEP },
{14, IDM_HELP_INDEX, TBSTATE_ENABLED, TBSTYLE_BUTTON },
};

static int cxborder;
Expand Down Expand Up @@ -143,7 +143,7 @@ void gw_toolbar_tooltip (GUI_WINDOW *gwp, LPARAM lParam)

lptext = (LPTOOLTIPTEXT)lParam;
if (lptext->hdr.code == TTN_NEEDTEXT) {
LoadString (hInst, lptext->hdr.idFrom, buffer, sizeof (buffer));
LoadString (hInst, (UINT)lptext->hdr.idFrom, buffer, sizeof (buffer));
if ((p = strchr (buffer, '\n')) != NULL)
p++;
lptext->lpszText = p;
Expand Down
Loading

0 comments on commit 080c1a4

Please sign in to comment.