ReactOS  0.4.13-dev-687-g023794c
editglyphdlg.c File Reference
#include "precomp.h"
Include dependency graph for editglyphdlg.c:

Go to the source code of this file.

Functions

static VOID AddToolboxButton (IN HWND hToolbar, IN INT iBitmap, IN INT idCommand, IN BYTE fsState)
 
static VOID InitToolbox (IN PEDIT_GLYPH_INFO Info)
 
static VOID GetBitRect (IN PEDIT_GLYPH_INFO Info, IN UINT uRow, IN UINT uColumn, OUT LPRECT BitRect)
 
static VOID SetPixelBit (IN PEDIT_GLYPH_INFO Info, IN UINT uRow, IN UINT uColumn, IN BOOL uBit)
 
static BOOL EditGlyphCommand (IN INT idCommand, IN PEDIT_GLYPH_INFO Info)
 
INT_PTR CALLBACK EditGlyphDlgProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static LRESULT CALLBACK EditGlyphEditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static LRESULT CALLBACK EditGlyphPreviewWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
BOOL InitEditGlyphWndClasses (VOID)
 
VOID UnInitEditGlyphWndClasses (VOID)
 

Function Documentation

◆ AddToolboxButton()

static VOID AddToolboxButton ( IN HWND  hToolbar,
IN INT  iBitmap,
IN INT  idCommand,
IN BYTE  fsState 
)
static

Definition at line 11 of file editglyphdlg.c.

12 {
13  TBBUTTON tbb = {0,};
14 
15  tbb.fsState = fsState;
17  tbb.iBitmap = iBitmap;
18  tbb.idCommand = idCommand;
19 
20  SendMessageW( hToolbar, TB_ADDBUTTONSW, 1, (LPARAM)&tbb );
21 }
BYTE fsStyle
Definition: commctrl.h:924
#define BTNS_CHECKGROUP
Definition: commctrl.h:974
LONG_PTR LPARAM
Definition: windef.h:208
int iBitmap
Definition: commctrl.h:921
int idCommand
Definition: commctrl.h:922
#define TB_ADDBUTTONSW
Definition: commctrl.h:1238
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BYTE fsState
Definition: commctrl.h:923

Referenced by InitToolbox().

◆ EditGlyphCommand()

static BOOL EditGlyphCommand ( IN INT  idCommand,
IN PEDIT_GLYPH_INFO  Info 
)
static

Definition at line 71 of file editglyphdlg.c.

72 {
73  switch(idCommand)
74  {
75  case IDOK:
76  {
77  RECT rect;
78  UINT uColumn;
79  UINT uRow;
80 
81  RtlCopyMemory( Info->FontWndInfo->Font->Bits + Info->uCharacter * 8, Info->CharacterBits, sizeof(Info->CharacterBits) );
82 
83  GetCharacterPosition(Info->uCharacter, &uRow, &uColumn);
84  GetCharacterRect(uRow, uColumn, &rect);
85  InvalidateRect(Info->FontWndInfo->hFontBoxesWnd, &rect, FALSE);
86 
87  Info->FontWndInfo->OpenInfo->bModified = TRUE;
88 
89  // Fall through
90  }
91 
92  // This is the equivalent of WM_DESTROY for dialogs
93  case IDCANCEL:
94  EndDialog(Info->hSelf, 0);
95 
96  // Remove the window from the linked list
97  if(Info->PrevEditGlyphWnd)
98  Info->PrevEditGlyphWnd->NextEditGlyphWnd = Info->NextEditGlyphWnd;
99  else
100  Info->FontWndInfo->FirstEditGlyphWnd = Info->NextEditGlyphWnd;
101 
102  if(Info->NextEditGlyphWnd)
103  Info->NextEditGlyphWnd->PrevEditGlyphWnd = Info->PrevEditGlyphWnd;
104  else
105  Info->FontWndInfo->LastEditGlyphWnd = Info->PrevEditGlyphWnd;
106 
109  SetWindowLongPtrW(Info->hPreview, GWLP_USERDATA, 0 );
110 
112  return TRUE;
113  }
114 
115  return FALSE;
116 }
#define TRUE
Definition: types.h:120
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define IDOK
Definition: winuser.h:824
__inline VOID GetCharacterPosition(IN UINT uCharacter, OUT PUINT uFontRow, OUT PUINT uFontColumn)
Definition: fontboxeswnd.c:34
& rect
Definition: startmenu.cpp:1413
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
struct TraceInfo Info
#define GWLP_USERDATA
Definition: treelist.c:63
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
VOID GetCharacterRect(IN UINT uFontRow, IN UINT uFontColumn, OUT LPRECT CharacterRect)
Definition: fontboxeswnd.c:25
unsigned int UINT
Definition: ndis.h:50
#define SetWindowLongPtrW
Definition: winuser.h:5247
#define IDCANCEL
Definition: winuser.h:825
#define HeapFree(x, y, z)
Definition: compat.h:394
HANDLE hProcessHeap
Definition: kbswitch.c:25

Referenced by EditGlyphDlgProc().

◆ EditGlyphDlgProc()

INT_PTR CALLBACK EditGlyphDlgProc ( HWND  hwnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 119 of file editglyphdlg.c.

120 {
122 
124 
125  if(Info || uMsg == WM_INITDIALOG)
126  {
127  switch(uMsg)
128  {
129  case WM_COMMAND:
130  return EditGlyphCommand( LOWORD(wParam), Info );
131 
132  case WM_INITDIALOG:
134  Info->hSelf = hwnd;
137 
141 
142  InitToolbox(Info);
143 
144  return TRUE;
145  }
146  }
147 
148  return FALSE;
149 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
struct _EDIT_GLYPH_INFO * PEDIT_GLYPH_INFO
Definition: precomp.h:37
#define GetWindowLongPtrW
Definition: winuser.h:4730
WPARAM wParam
Definition: combotst.c:138
struct TraceInfo Info
#define GWLP_USERDATA
Definition: treelist.c:63
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define WM_COMMAND
Definition: winuser.h:1722
#define IDC_EDIT_GLYPH_EDIT
Definition: resource.h:33
static BOOL EditGlyphCommand(IN INT idCommand, IN PEDIT_GLYPH_INFO Info)
Definition: editglyphdlg.c:71
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
static VOID InitToolbox(IN PEDIT_GLYPH_INFO Info)
Definition: editglyphdlg.c:24
#define IDC_EDIT_GLYPH_PREVIEW
Definition: resource.h:34
#define SetWindowLongPtrW
Definition: winuser.h:5247
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82

Referenced by EditCurrentGlyph().

◆ EditGlyphEditWndProc()

static LRESULT CALLBACK EditGlyphEditWndProc ( HWND  hwnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 152 of file editglyphdlg.c.

153 {
155 
157 
158  if(Info)
159  {
160  switch(uMsg)
161  {
162  case WM_CREATE:
163  return 0;
164 
165  case WM_LBUTTONDOWN:
166  SetPixelBit(Info, GET_Y_LPARAM(lParam) / Info->lEditSpacing, GET_X_LPARAM(lParam) / Info->lEditSpacing, 1);
167  return 0;
168 
169  case WM_RBUTTONDOWN:
170  SetPixelBit(Info, GET_Y_LPARAM(lParam) / Info->lEditSpacing, GET_X_LPARAM(lParam) / Info->lEditSpacing, 0);
171  return 0;
172 
173  case WM_PAINT:
174  {
175  BOOL bBit;
176  HPEN hOldPen;
177  HPEN hPen;
178  PAINTSTRUCT ps;
179  RECT rect;
180  UINT i;
181  UINT j;
182 
183  BeginPaint(hwnd, &ps);
184 
185  // Draw the grid
187  Info->lEditSpacing = rect.right / 8;
188 
189  hPen = CreatePen( PS_SOLID, 1, RGB(128, 128, 128) );
190  hOldPen = SelectObject(ps.hdc, hPen);
191 
192  for(i = 1; i < 8; i++)
193  {
194  MoveToEx(ps.hdc, i * Info->lEditSpacing, 0, NULL);
195  LineTo (ps.hdc, i * Info->lEditSpacing, rect.right);
196 
197  MoveToEx(ps.hdc, 0, i * Info->lEditSpacing, NULL);
198  LineTo (ps.hdc, rect.right, i * Info->lEditSpacing);
199  }
200 
201  SelectObject(ps.hdc, hOldPen);
202  DeleteObject(hPen);
203 
204  // Draw all bits
205  for(i = 0; i < 8; i++)
206  {
207  for(j = 0; j < 8; j++)
208  {
209  bBit = (BOOL) (Info->CharacterBits[i] << j & 0x80);
210 
211  GetBitRect(Info, i, j, &rect);
212  FillRect( ps.hdc, &rect, (HBRUSH) GetStockObject(bBit ? BLACK_BRUSH : WHITE_BRUSH) );
213  }
214  }
215 
216  // Draw the bounding rectangle
218  Rectangle(ps.hdc, 0, 0, rect.right, rect.right);
219 
220  EndPaint(hwnd, &ps);
221  return 0;
222  }
223  }
224  }
225 
226  return DefWindowProcW(hwnd, uMsg, wParam, lParam);
227 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
HPEN WINAPI CreatePen(_In_ int, _In_ int, _In_ COLORREF)
#define WM_LBUTTONDOWN
Definition: winuser.h:1758
struct _EDIT_GLYPH_INFO * PEDIT_GLYPH_INFO
Definition: precomp.h:37
BOOL WINAPI Rectangle(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)
#define NULL_BRUSH
Definition: wingdi.h:900
#define GET_X_LPARAM(lp)
Definition: windowsx.h:274
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
BOOL WINAPI LineTo(_In_ HDC, _In_ int, _In_ int)
#define WHITE_BRUSH
Definition: wingdi.h:901
#define GetWindowLongPtrW
Definition: winuser.h:4730
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
#define BOOL
Definition: nt_native.h:43
& rect
Definition: startmenu.cpp:1413
WPARAM wParam
Definition: combotst.c:138
struct TraceInfo Info
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI MoveToEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
#define PS_SOLID
Definition: wingdi.h:585
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static VOID GetBitRect(IN PEDIT_GLYPH_INFO Info, IN UINT uRow, IN UINT uColumn, OUT LPRECT BitRect)
Definition: editglyphdlg.c:48
unsigned int BOOL
Definition: ntddk_ex.h:94
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
#define GWLP_USERDATA
Definition: treelist.c:63
smooth NULL
Definition: ftsmooth.c:416
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
#define WM_RBUTTONDOWN
Definition: winuser.h:1761
#define BLACK_BRUSH
Definition: wingdi.h:895
#define RGB(r, g, b)
Definition: wingdi.h:2918
#define WM_PAINT
Definition: winuser.h:1602
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
unsigned int UINT
Definition: ndis.h:50
#define GET_Y_LPARAM(lp)
Definition: windowsx.h:275
static VOID SetPixelBit(IN PEDIT_GLYPH_INFO Info, IN UINT uRow, IN UINT uColumn, IN BOOL uBit)
Definition: editglyphdlg.c:57
#define WM_CREATE
Definition: winuser.h:1590
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
LPARAM lParam
Definition: combotst.c:139

Referenced by InitEditGlyphWndClasses().

◆ EditGlyphPreviewWndProc()

static LRESULT CALLBACK EditGlyphPreviewWndProc ( HWND  hwnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 230 of file editglyphdlg.c.

231 {
233 
235 
236  if(Info)
237  {
238  switch(uMsg)
239  {
240  case WM_CREATE:
241  return 0;
242 
243  case WM_PAINT:
244  {
245  BOOL bBit;
246  INT iLeft;
247  INT iTop;
248  PAINTSTRUCT ps;
249  RECT rect;
250  UINT i;
251  UINT j;
252 
253  BeginPaint(hwnd, &ps);
254 
255  // Draw the bounding rectangle
257  Rectangle(ps.hdc, 0, 0, rect.right, rect.bottom);
258 
259  // Draw all bits
260  iLeft = rect.right / 2 - 8 / 2;
261  iTop = rect.bottom / 2 - 8 / 2;
262 
263  for(i = 0; i < 8; i++)
264  {
265  for(j = 0; j < 8; j++)
266  {
267  bBit = (BOOL) (Info->CharacterBits[i] << j & 0x80);
268  SetPixel( ps.hdc, j + iLeft, i + iTop, (bBit ? 0 : 0xFFFFFF) );
269  }
270  }
271 
272  EndPaint(hwnd, &ps);
273 
274  return 0;
275  }
276  }
277  }
278 
279  return DefWindowProcW(hwnd, uMsg, wParam, lParam);
280 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
struct _EDIT_GLYPH_INFO * PEDIT_GLYPH_INFO
Definition: precomp.h:37
BOOL WINAPI Rectangle(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)
#define GetWindowLongPtrW
Definition: winuser.h:4730
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
#define BOOL
Definition: nt_native.h:43
int32_t INT
Definition: typedefs.h:56
& rect
Definition: startmenu.cpp:1413
WPARAM wParam
Definition: combotst.c:138
struct TraceInfo Info
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned int BOOL
Definition: ntddk_ex.h:94
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
#define GWLP_USERDATA
Definition: treelist.c:63
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
FORCEINLINE VOID SetPixel(IN ULONG Left, IN ULONG Top, IN UCHAR Color)
Definition: vga.c:93
#define WM_PAINT
Definition: winuser.h:1602
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
unsigned int UINT
Definition: ndis.h:50
#define WM_CREATE
Definition: winuser.h:1590
LPARAM lParam
Definition: combotst.c:139

Referenced by InitEditGlyphWndClasses().

◆ GetBitRect()

static VOID GetBitRect ( IN PEDIT_GLYPH_INFO  Info,
IN UINT  uRow,
IN UINT  uColumn,
OUT LPRECT  BitRect 
)
static

Definition at line 48 of file editglyphdlg.c.

49 {
50  BitRect->left = uColumn * Info->lEditSpacing + 1;
51  BitRect->top = uRow * Info->lEditSpacing + 1;
52  BitRect->right = BitRect->left + Info->lEditSpacing - 1;
53  BitRect->bottom = BitRect->top + Info->lEditSpacing - 1;
54 }
struct TraceInfo Info

Referenced by EditGlyphEditWndProc().

◆ InitEditGlyphWndClasses()

BOOL InitEditGlyphWndClasses ( VOID  )

Definition at line 283 of file editglyphdlg.c.

284 {
285  WNDCLASSW wc = {0,};
286 
288  wc.hInstance = hInstance;
289  wc.hCursor = LoadCursor( NULL, IDC_ARROW );
291 
292  if( !RegisterClassW(&wc) )
293  return FALSE;
294 
297 
298  return RegisterClassW(&wc) != 0;
299 }
static LRESULT CALLBACK EditGlyphEditWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: editglyphdlg.c:152
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
HINSTANCE hInstance
Definition: charmap.c:20
WNDPROC lpfnWndProc
Definition: winuser.h:3151
smooth NULL
Definition: ftsmooth.c:416
LPCWSTR lpszClassName
Definition: winuser.h:3159
#define LoadCursor
Definition: winuser.h:5710
#define EDIT_GLYPH_EDIT_CLASSW
HCURSOR hCursor
Definition: winuser.h:3156
HINSTANCE hInstance
Definition: winuser.h:3154
#define IDC_ARROW
Definition: winuser.h:682
#define EDIT_GLYPH_PREVIEW_CLASSW
static LRESULT CALLBACK EditGlyphPreviewWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: editglyphdlg.c:230

Referenced by wWinMain().

◆ InitToolbox()

static VOID InitToolbox ( IN PEDIT_GLYPH_INFO  Info)
static

Definition at line 24 of file editglyphdlg.c.

25 {
26  HWND hToolbar;
27  INT iBitmap;
28  TBADDBITMAP tbab;
29 
30  hToolbar = GetDlgItem(Info->hSelf, IDC_EDIT_GLYPH_TOOLBOX);
31 
32  // Identify the used Common Controls version
33  SendMessageW(hToolbar, TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0);
34 
35  // Set the button size to 24x24
36  SendMessageW( hToolbar, TB_SETBUTTONSIZE, 0, MAKELONG(24, 24) );
37  SendMessageW( hToolbar, TB_SETBITMAPSIZE, 0, MAKELONG(24, 24) );
38 
39  // Add the Toolbox bitmaps
40  tbab.hInst = hInstance;
42  iBitmap = (INT)SendMessageW(hToolbar, TB_ADDBITMAP, 0, (LPARAM)&tbab);
43 
45 }
#define TB_SETBUTTONSIZE
Definition: commctrl.h:1107
#define TB_BUTTONSTRUCTSIZE
Definition: commctrl.h:1106
#define ID_TOOLBOX_PEN
Definition: resource.h:56
#define INT
Definition: polytest.cpp:20
HINSTANCE hInst
Definition: commctrl.h:1031
int32_t INT
Definition: typedefs.h:56
struct TraceInfo Info
HINSTANCE hInstance
Definition: charmap.c:20
#define MAKELONG(a, b)
Definition: typedefs.h:248
LONG_PTR LPARAM
Definition: windef.h:208
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define TB_ADDBITMAP
Definition: commctrl.h:1028
#define TB_SETBITMAPSIZE
Definition: commctrl.h:1108
#define IDC_EDIT_GLYPH_TOOLBOX
Definition: resource.h:32
#define TBSTATE_CHECKED
Definition: commctrl.h:944
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define TBSTATE_ENABLED
Definition: commctrl.h:946
static VOID AddToolboxButton(IN HWND hToolbar, IN INT iBitmap, IN INT idCommand, IN BYTE fsState)
Definition: editglyphdlg.c:11
#define TOOLBOX_PEN
Definition: precomp.h:119
#define IDB_EDIT_GLYPH_TOOLBOX
Definition: resource.h:25
UINT_PTR nID
Definition: commctrl.h:1032

Referenced by EditGlyphDlgProc().

◆ SetPixelBit()

static VOID SetPixelBit ( IN PEDIT_GLYPH_INFO  Info,
IN UINT  uRow,
IN UINT  uColumn,
IN BOOL  uBit 
)
static

Definition at line 57 of file editglyphdlg.c.

58 {
59  // Set the bit in the bitfield
60  if(uBit)
61  Info->CharacterBits[uRow] |= 1 << (7 - uColumn);
62  else
63  Info->CharacterBits[uRow] &= ~( 1 << (7 - uColumn) );
64 
65  // Redraw everything
66  InvalidateRect(Info->hEdit, NULL, FALSE);
67  InvalidateRect(Info->hPreview, NULL, FALSE);
68 }
struct TraceInfo Info
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)

Referenced by EditGlyphEditWndProc().

◆ UnInitEditGlyphWndClasses()

VOID UnInitEditGlyphWndClasses ( VOID  )

Definition at line 302 of file editglyphdlg.c.

303 {
306 }
BOOL WINAPI UnregisterClassW(_In_ LPCWSTR, HINSTANCE)
HINSTANCE hInstance
Definition: charmap.c:20
#define EDIT_GLYPH_EDIT_CLASSW
#define EDIT_GLYPH_PREVIEW_CLASSW

Referenced by wWinMain().