Lines Matching full:context
27 struct Context
34 typedef struct Context Context;
51 void InitParagraph(HWND hwnd, Context *context)
55 if (context->paragraph != NULL) {
58 if (context->width > 0 && context->height > 0) {
59 pf_breakLines(context->paragraph, context->width, context->height);
65 si.nMax = pf_getLineCount(context->paragraph) - 1;
66 si.nPage = context->height / pf_getLineHeight(context->paragraph);
121 Context *context;
145 context = NEW_ARRAY(Context, 1);
147 context->width = 600;
148 context->height = 400;
150 context->paragraph = pf_factory("Sample.txt", font, guiSupport);
151 SetWindowLongPtr(hwnd, 0, (LONG_PTR) context);
162 context = (Context *) GetWindowLongPtr(hwnd, 0);
163 context->width = LOWORD(lParam);
164 context->height = HIWORD(lParam);
166 InitParagraph(hwnd, context);
219 context = (Context *) GetWindowLongPtr(hwnd, 0);
221 if (context->paragraph != NULL && si.nPos != vertPos) {
222 ScrollWindow(hwnd, 0, pf_getLineHeight(context->paragraph) * (vertPos - si.nPos), NULL, NULL);
244 context = (Context *) GetWindowLongPtr(hwnd, 0);
246 if (context->paragraph != NULL) {
252 lastLine = min (si.nPos + (le_int32) si.nPage, pf_getLineCount(context->paragraph) - 1);
254 pf_draw(context->paragraph, surface, firstLine, lastLine);
302 context = (Context *) GetWindowLongPtr(hwnd, 0);
304 if (context->paragraph != NULL) {
305 pf_close(context->paragraph);
308 context->paragraph = newParagraph;
309 InitParagraph(hwnd, context);
339 context = (Context *) GetWindowLongPtr(hwnd, 0);
341 if (context != NULL && context->paragraph != NULL) {
342 pf_close(context->paragraph);
345 DELETE_ARRAY(context);