ReactOS  0.4.14-dev-368-gfa26425
context.c File Reference
#include "editor.h"
Include dependency graph for context.c:

Go to the source code of this file.

Functions

void ME_InitContext (ME_Context *c, ME_TextEditor *editor, HDC hDC)
 
void ME_DestroyContext (ME_Context *c)
 

Function Documentation

◆ ME_DestroyContext()

void ME_DestroyContext ( ME_Context c)

Definition at line 42 of file context.c.

43 {
44  if (c->hDC) ITextHost_TxReleaseDC(c->editor->texthost, c->hDC);
45 }
#define ITextHost_TxReleaseDC(This, a)
Definition: editor.h:289
const GLubyte * c
Definition: glext.h:8905

Referenced by ME_CharFromPoint(), ME_GetCursorCoordinates(), ME_InvalidateParagraphRange(), ME_MakeFirstParagraph(), ME_PaintContent(), ME_PointFromChar(), ME_WrapMarkedParagraphs(), and stream_out_graphics().

◆ ME_InitContext()

void ME_InitContext ( ME_Context c,
ME_TextEditor editor,
HDC  hDC 
)

Definition at line 23 of file context.c.

24 {
25  c->hDC = hDC;
26  c->editor = editor;
27  c->pt.x = 0;
28  c->pt.y = 0;
29  c->rcView = editor->rcFormat;
30  if (hDC) {
31  c->dpi.cx = GetDeviceCaps(hDC, LOGPIXELSX);
32  c->dpi.cy = GetDeviceCaps(hDC, LOGPIXELSY);
33  } else {
34  c->dpi.cx = c->dpi.cy = 96;
35  }
36  if (editor->nAvailWidth)
37  c->nAvailWidth = ME_twips2pointsX(c, editor->nAvailWidth);
38  else
39  c->nAvailWidth = c->rcView.right - c->rcView.left;
40 }
#define LOGPIXELSX
Definition: wingdi.h:717
const GLubyte * c
Definition: glext.h:8905
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
static HDC hDC
Definition: 3dtext.c:33
#define LOGPIXELSY
Definition: wingdi.h:718
int ME_twips2pointsX(const ME_Context *c, int x) DECLSPEC_HIDDEN
Definition: paint.c:153

Referenced by ME_CharFromPoint(), ME_GetCursorCoordinates(), ME_InvalidateParagraphRange(), ME_MakeFirstParagraph(), ME_PaintContent(), ME_PointFromChar(), ME_WrapMarkedParagraphs(), and stream_out_graphics().