Skip to content

Commit

Permalink
Release
Browse files Browse the repository at this point in the history
  • Loading branch information
larryli committed Apr 16, 2023
1 parent f328880 commit a864479
Show file tree
Hide file tree
Showing 56 changed files with 1,790 additions and 1,477 deletions.
24 changes: 12 additions & 12 deletions Neatpad02/Neatpad/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
// Microsoft Developer Studio generated include file.
// Used by resource.rc
//
#define IDR_MENU1 101
#define IDI_ICON1 102
#define IDR_ACCELERATOR1 103
#define IDM_FILE_NEW 40001
#define IDM_FILE_OPEN 40002
#define IDM_FILE_EXIT 40003
#define IDM_HELP_ABOUT 40004
#define IDR_MENU1 101
#define IDI_ICON1 102
#define IDR_ACCELERATOR1 103
#define IDM_FILE_NEW 40001
#define IDM_FILE_OPEN 40002
#define IDM_FILE_EXIT 40003
#define IDM_HELP_ABOUT 40004

// Next default values for new objects
//
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 104
#define _APS_NEXT_COMMAND_VALUE 40005
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 101
#define _APS_NEXT_RESOURCE_VALUE 104
#define _APS_NEXT_COMMAND_VALUE 40005
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
3 changes: 2 additions & 1 deletion Neatpad02/TextView/TextDocument.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ void TextDocument__delete(TEXTDOCUMENT *ptd);
BOOL TextDocument__init(TEXTDOCUMENT *ptd, HANDLE hFile);
BOOL TextDocument__init_filename(TEXTDOCUMENT *ptd, char *filename);
BOOL TextDocument__clear(TEXTDOCUMENT *ptd);
ULONG TextDocument__getline(TEXTDOCUMENT *ptd, ULONG lineno, char *buf, size_t len);
ULONG TextDocument__getline(TEXTDOCUMENT *ptd, ULONG lineno, char *buf,
size_t len);
ULONG TextDocument__linecount(TEXTDOCUMENT *ptd);
ULONG TextDocument__longestline(TEXTDOCUMENT *ptd);
// private
Expand Down
2 changes: 1 addition & 1 deletion Neatpad02/TextView/TextViewInternal.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ LONG TextView__ClearFile(TEXTVIEW *ptv);
// private
void TextView__PaintLine(TEXTVIEW *ptv, HDC hdc, ULONG line);
void TextView__TabbedExtTextOut(TEXTVIEW *ptv, HDC hdc, RECT *rect, TCHAR *buf,
int len);
int len);
COLORREF TextView__GetTextViewColor(TEXTVIEW *ptv, UINT idx);

#endif
2 changes: 1 addition & 1 deletion Neatpad02/TextView/TextViewPaint.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ LONG TextView__OnPaint(TEXTVIEW *ptv)
// Emulates ExtTextOut, but draws text using tabs using TabbedTextOut
//
void TextView__TabbedExtTextOut(TEXTVIEW *ptv, HDC hdc, RECT *rect, TCHAR *buf,
int len)
int len)
{
int tab = 4 * ptv->m_nFontWidth;
int width;
Expand Down
1 change: 0 additions & 1 deletion Neatpad03/TextView/TextView.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <tchar.h>
#include <windows.h>


#include "TextView.h"
#include "TextViewInternal.h"

Expand Down
2 changes: 2 additions & 0 deletions Neatpad06/Neatpad/Neatpad.ppj
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ output\OptionsMisc.obj: \
#
output\resource.res: \
resource.rc \
icon1.ico \
icon2.ico \
resource.h
$(RC) $(RCFLAGS) "$!" -Fo"$@"

Expand Down
2 changes: 1 addition & 1 deletion Neatpad06/TextView/TextViewFont.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ LONG TextView__AddFont(TEXTVIEW *ptv, HFONT hFont)
}

//
// Wptv->m_SETFONT handler: set a new default font
// WM_SETFONT handler: set a new default font
//
LONG TextView__OnSetFont(TEXTVIEW *ptv, HFONT hFont)
{
Expand Down
18 changes: 9 additions & 9 deletions Neatpad06/TextView/TextViewMouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
int ScrollDir(int counter, int dir);

//
// Wptv->m_MOUSEACTIVATE
// WM_MOUSEACTIVATE
//
// Grab the keyboard input focus
//
Expand All @@ -26,7 +26,7 @@ LONG TextView__OnMouseActivate(TEXTVIEW *ptv, HWND hwndTop, UINT nHitTest,
}

//
// Wptv->m_LBUTTONDOWN
// WM_LBUTTONDOWN
//
// Position caret to nearest text character under mouse
//
Expand Down Expand Up @@ -60,7 +60,7 @@ LONG TextView__OnLButtonDown(TEXTVIEW *ptv, UINT nFlags, int mx, int my)
}

//
// Wptv->m_LBUTTONUP
// WM_LBUTTONUP
//
// Release capture and cancel any mouse-scrolling
//
Expand All @@ -81,7 +81,7 @@ LONG TextView__OnLButtonUp(TEXTVIEW *ptv, UINT nFlags, int mx, int my)
}

//
// Wptv->m_MOUSEMOVE
// WM_MOUSEMOVE
//
// Set the selection end-point if we are dragging the mouse
//
Expand Down Expand Up @@ -136,7 +136,7 @@ LONG TextView__OnMouseMove(TEXTVIEW *ptv, UINT nFlags, int mx, int my)
}

//
// Wptv->m_TIMER handler
// WM_TIMER handler
//
// Used to create regular scrolling
//
Expand Down Expand Up @@ -184,13 +184,13 @@ LONG TextView__OnTimer(TEXTVIEW *ptv, UINT nTimerId)
// pointing to the right places and the scroll positions are valid.
//
if (hrgnUpdate != NULL) {
// We perform a "fake" Wptv->m_MOUSEMOVE for two reasons:
// We perform a "fake" WM_MOUSEMOVE for two reasons:
//
// 1. To get the cursor/caret/selection offsets set to the correct place
// *before* we redraw (so everything is synchronized correctly)
//
// 2. To invalidate any areas due to mouse-movement which won't
// get done until the next Wptv->m_MOUSEMOVE - and then it would
// get done until the next WM_MOUSEMOVE - and then it would
// be too late because we need to redraw *now*
//
TextView__OnMouseMove(ptv, 0, pt.x, pt.y);
Expand All @@ -199,12 +199,12 @@ LONG TextView__OnTimer(TEXTVIEW *ptv, UINT nTimerId)
InvalidateRgn(ptv->m_hWnd, hrgnUpdate, FALSE);
DeleteObject(hrgnUpdate);

// the next time we process Wptv->m_PAINT everything
// the next time we process WM_PAINT everything
// should get drawn correctly!!
UpdateWindow(ptv->m_hWnd);
}

// keep track of how many Wptv->m_TIMERs we process because
// keep track of how many WM_TIMERs we process because
// we might want to skip the next one
ptv->m_nScrollCounter++;

Expand Down
3 changes: 3 additions & 0 deletions Neatpad07/Neatpad/Neatpad.ppj
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ output\Printing.obj: \
#
output\resource.res: \
resource.rc \
bitmap1.bmp \
icon1.ico \
icon2.ico \
resource.h
$(RC) $(RCFLAGS) "$!" -Fo"$@"

Expand Down
3 changes: 3 additions & 0 deletions Neatpad07/Neatpad/Neatpad64.ppj
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ output\Printing64.obj: \
#
output\resource64.res: \
resource.rc \
bitmap1.bmp \
icon1.ico \
icon2.ico \
resource.h
$(RC) $(RCFLAGS) "$!" -Fo"$@"

Expand Down
4 changes: 4 additions & 0 deletions Neatpad09/Neatpad/Neatpad.ppj
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ output\Printing.obj: \
#
output\resource.res: \
resource.rc \
bitmap1.bmp \
icon1.ico \
icon2.ico \
Neatpad.exe.manifest \
resource.h
$(RC) $(RCFLAGS) "$!" -Fo"$@"

Expand Down
5 changes: 5 additions & 0 deletions Neatpad15/Neatpad/Neatpad.ppj
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ output\Printing.obj: \
#
output\resource.res: \
resource.rc \
bitmap1.bmp \
icon1.ico \
icon2.ico \
icon3.ico \
Neatpad.exe.manifest \
resource.h
$(RC) $(RCFLAGS) "$!" -Fo"$@"

Expand Down
7 changes: 4 additions & 3 deletions Neatpad15/Neatpad/OptionsMisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@
//
#include <windows.h>

#include "Neatpad.h"
#include "resource.h"
#include <commctrl.h>
#include <shellapi.h>

#include "Neatpad.h"
#include "resource.h"

//
// Dialogbox procedure for the FONT pane
//
INT_PTR CALLBACK MiscOptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam,
LPARAM lParam)
LPARAM lParam)
{
PSHNOTIFY *pshn;

Expand Down
6 changes: 4 additions & 2 deletions Neatpad15/TextView/TextView.ppj
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ output\TextViewFont.obj: \
codepages.h \
TextDocument.h \
TextView.h \
TextViewInternal.h
TextViewInternal.h \
..\UspLib\usplib.h
$(CC) $(CCFLAGS) "$!" -Fo"$@"

#
Expand Down Expand Up @@ -130,7 +131,8 @@ output\TextViewScroll.obj: \
codepages.h \
TextDocument.h \
TextView.h \
TextViewInternal.h
TextViewInternal.h \
..\UspLib\usplib.h
$(CC) $(CCFLAGS) "$!" -Fo"$@"

#
Expand Down
31 changes: 20 additions & 11 deletions Neatpad15/TextView/TextViewInternal.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ typedef struct {
TEXTVIEW *TextView__new(HWND hwnd);
void TextView__delete(TEXTVIEW *ptv);

LONG WINAPI TextView__WndProc(TEXTVIEW *ptv, UINT msg, WPARAM wParam, LPARAM lParam);
LONG WINAPI TextView__WndProc(TEXTVIEW *ptv, UINT msg, WPARAM wParam,
LPARAM lParam);

// private
//
Expand All @@ -151,7 +152,8 @@ LONG TextView__OnHScroll(TEXTVIEW *ptv, UINT nSBCode, UINT nPos);
LONG TextView__OnMouseWheel(TEXTVIEW *ptv, int nDelta);
LONG TextView__OnTimer(TEXTVIEW *ptv, UINT nTimer);

LONG TextView__OnMouseActivate(TEXTVIEW *ptv, HWND hwndTop, UINT nHitTest, UINT nMessage);
LONG TextView__OnMouseActivate(TEXTVIEW *ptv, HWND hwndTop, UINT nHitTest,
UINT nMessage);
LONG TextView__OnLButtonDown(TEXTVIEW *ptv, UINT nFlags, int x, int y);
LONG TextView__OnLButtonUp(TEXTVIEW *ptv, UINT nFlags, int x, int y);
LONG TextView__OnMouseMove(TEXTVIEW *ptv, UINT nFlags, int x, int y);
Expand All @@ -176,17 +178,21 @@ COLORREF TextView__SetColour(TEXTVIEW *ptv, UINT idx, COLORREF rgbColour);
//
// Private Helper functions
//
void TextView__PaintLine(TEXTVIEW *ptv, HDC hdc, ULONG line, int x, int y, HRGN hrgnUpdate);
void TextView__PaintText(TEXTVIEW *ptv, HDC hdc, ULONG nLineNo, int x, int y, RECT *bounds);
void TextView__PaintLine(TEXTVIEW *ptv, HDC hdc, ULONG line, int x, int y,
HRGN hrgnUpdate);
void TextView__PaintText(TEXTVIEW *ptv, HDC hdc, ULONG nLineNo, int x, int y,
RECT *bounds);
int TextView__PaintMargin(TEXTVIEW *ptv, HDC hdc, ULONG line, int x, int y);

int TextView__ApplyTextAttributes(TEXTVIEW *ptv, ULONG nLineNo, ULONG offset, ULONG *nColumn,
TCHAR *szText, int nTextLen, ATTR *attr);
int TextView__ApplyTextAttributes(TEXTVIEW *ptv, ULONG nLineNo, ULONG offset,
ULONG *nColumn, TCHAR *szText, int nTextLen,
ATTR *attr);
void TextView__RefreshWindow(TEXTVIEW *ptv);
LONG TextView__InvalidateRange(TEXTVIEW *ptv, ULONG nStart, ULONG nFinish);
LONG TextView__InvalidateLine(TEXTVIEW *ptv, ULONG nLineNo, BOOL forceAnalysis);
VOID TextView__UpdateLine(TEXTVIEW *ptv, ULONG nLineNo);
int TextView__SyntaxColour(TEXTVIEW *ptv, TCHAR *szText, ULONG nTextLen, ATTR *attr);
int TextView__SyntaxColour(TEXTVIEW *ptv, TCHAR *szText, ULONG nTextLen,
ATTR *attr);

int TextView__NeatTextYOffset(TEXTVIEW *ptv, USPFONT *font);
int TextView__TextWidth(TEXTVIEW *ptv, HDC hdc, TCHAR *buf, int len);
Expand All @@ -196,8 +202,9 @@ void TextView__UpdateMarginWidth(TEXTVIEW *ptv);
int TextView__SetCaretWidth(TEXTVIEW *ptv, int nWidth);
BOOL TextView__SetImageList(TEXTVIEW *ptv, HIMAGELIST hImgList);

BOOL TextView__MouseCoordToFilePos(TEXTVIEW *ptv, int x, int y, ULONG *pnLineNo, ULONG *pnFileOffset,
int *px); //, ULONG *pnLineLen=0);
BOOL TextView__MouseCoordToFilePos(TEXTVIEW *ptv, int x, int y, ULONG *pnLineNo,
ULONG *pnFileOffset,
int *px); //, ULONG *pnLineLen=0);
ULONG TextView__RepositionCaret(TEXTVIEW *ptv);
VOID TextView__MoveCaret(TEXTVIEW *ptv, int x, int y);

Expand All @@ -215,7 +222,8 @@ COLORREF TextView__LongColour(TEXTVIEW *ptv, ULONG nLineNo);

int TextView__SetLineImage(TEXTVIEW *ptv, ULONG nLineNo, ULONG nImageIdx);
LINEINFO *TextView__GetLineInfo(TEXTVIEW *ptv, ULONG nLineNo);
int TextView__StripCRLF(TEXTVIEW *ptv, TCHAR *szText, ATTR *attrList, int nLength, BOOL fAllow);
int TextView__StripCRLF(TEXTVIEW *ptv, TCHAR *szText, ATTR *attrList,
int nLength, BOOL fAllow);

VOID TextView__SetupScrollbars(TEXTVIEW *ptv);
VOID TextView__UpdateMetrics(TEXTVIEW *ptv);
Expand All @@ -228,6 +236,7 @@ HRGN TextView__ScrollRgn(TEXTVIEW *ptv, int dx, int dy, BOOL fReturnUpdateRgn);
void TextView__ResetLineCache(TEXTVIEW *ptv);

USPDATA *TextView__GetUspData(TEXTVIEW *ptv, HDC hdc, ULONG nLineNo);
USPDATA *TextView__GetUspData_offset(TEXTVIEW *ptv, HDC hdc, ULONG nLineNo, ULONG *off_chars);
USPDATA *TextView__GetUspData_offset(TEXTVIEW *ptv, HDC hdc, ULONG nLineNo,
ULONG *off_chars);

#endif
5 changes: 5 additions & 0 deletions Neatpad16/Neatpad/Neatpad.ppj
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ output\Printing.obj: \
#
output\resource.res: \
resource.rc \
bitmap1.bmp \
icon1.ico \
icon2.ico \
icon3.ico \
Neatpad.exe.manifest \
resource.h
$(RC) $(RCFLAGS) "$!" -Fo"$@"

Expand Down
2 changes: 1 addition & 1 deletion Neatpad16/Neatpad/OptionsFont.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ static HFONT g_hBoldFont;
static HFONT g_hNormalFont;
static HICON g_hIcon2; // TrueType icon
static HICON g_hIcon3; // OpenType icon
static int g_nFontHeight;
// static int g_nFontHeight;

static COLORREF g_crPreviewFG;
static COLORREF g_crPreviewBG;
Expand Down
2 changes: 1 addition & 1 deletion Neatpad16/TextView/TextDocument.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ BOOL TextDocument__init_linebuffer(TEXTDOCUMENT *ptd)
ULONG offset_chars = 0;
ULONG linestart_bytes = 0;
ULONG linestart_chars = 0;
ULONG bytes_left = ptd->length_bytes - ptd->headersize;
// ULONG bytes_left = ptd->length_bytes - ptd->headersize;

ULONG buflen = ptd->length_bytes - ptd->headersize;

Expand Down
14 changes: 8 additions & 6 deletions Neatpad16/TextView/TextView.ppj
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@ POC_PROJECT_ZIPEXTRA = #
TextView.lib: \
output\TextDocument.obj \
output\TextView.obj \
output\TextViewClipboard.obj \
output\TextViewFile.obj \
output\TextViewFont.obj \
output\TextViewKeyNav.obj \
output\TextViewMouse.obj \
output\TextViewPaint.obj \
output\TextViewScroll.obj \
output\Unicode.obj \
output\TextViewClipboard.obj \
output\TextViewKeyNav.obj \
output\TextViewParser.obj \
output\TextViewScroll.obj \
output\TextViewSyntax.obj \
output\Unicode.obj \
output\Uniscribe.obj
$(AR) $(ARFLAGS) -out:"$@" $**

Expand Down Expand Up @@ -100,7 +100,8 @@ output\TextViewFont.obj: \
codepages.h \
TextDocument.h \
TextView.h \
TextViewInternal.h
TextViewInternal.h \
..\UspLib\usplib.h
$(CC) $(CCFLAGS) "$!" -Fo"$@"

#
Expand Down Expand Up @@ -135,7 +136,8 @@ output\TextViewScroll.obj: \
codepages.h \
TextDocument.h \
TextView.h \
TextViewInternal.h
TextViewInternal.h \
..\UspLib\usplib.h
$(CC) $(CCFLAGS) "$!" -Fo"$@"

#
Expand Down
Loading

0 comments on commit a864479

Please sign in to comment.