ReactOS 0.4.15-dev-7906-g1b85a5f
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 44 of file context.c.

45{
47 if (c->hDC) ITextHost_TxReleaseDC( c->editor->texthost, c->hDC );
48}
#define NULL
Definition: types.h:112
void select_style(ME_Context *c, ME_Style *s) DECLSPEC_HIDDEN
Definition: style.c:369
#define ITextHost_TxReleaseDC(This, a)
Definition: editor.h:288
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 c->current_style = NULL;
31 c->orig_font = NULL;
32 if (hDC) {
33 c->dpi.cx = GetDeviceCaps(hDC, LOGPIXELSX);
34 c->dpi.cy = GetDeviceCaps(hDC, LOGPIXELSY);
35 } else {
36 c->dpi.cx = c->dpi.cy = 96;
37 }
38 if (editor->nAvailWidth)
39 c->nAvailWidth = ME_twips2pointsX(c, editor->nAvailWidth);
40 else
41 c->nAvailWidth = c->rcView.right - c->rcView.left;
42}
static HDC hDC
Definition: 3dtext.c:33
int ME_twips2pointsX(const ME_Context *c, int x) DECLSPEC_HIDDEN
Definition: paint.c:153
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define LOGPIXELSY
Definition: wingdi.h:719
#define LOGPIXELSX
Definition: wingdi.h:718

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