Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygencontext.c
Go to the documentation of this file.
00001 /* 00002 * RichEdit - Operation context functions 00003 * 00004 * Copyright 2004 by Krzysztof Foltman 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Lesser General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2.1 of the License, or (at your option) any later version. 00010 * 00011 * This library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Lesser General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Lesser General Public 00017 * License along with this library; if not, write to the Free Software 00018 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 00019 */ 00020 00021 #include "editor.h" 00022 00023 void ME_InitContext(ME_Context *c, ME_TextEditor *editor, HDC hDC) 00024 { 00025 c->nSequence = editor->nSequence++; 00026 c->hDC = hDC; 00027 c->editor = editor; 00028 c->pt.x = 0; 00029 c->pt.y = 0; 00030 c->hbrMargin = CreateSolidBrush(RGB(224,224,224)); 00031 c->rcView = editor->rcFormat; 00032 if (hDC) { 00033 c->dpi.cx = GetDeviceCaps(hDC, LOGPIXELSX); 00034 c->dpi.cy = GetDeviceCaps(hDC, LOGPIXELSY); 00035 } else { 00036 c->dpi.cx = c->dpi.cy = 96; 00037 } 00038 if (editor->nAvailWidth) 00039 c->nAvailWidth = ME_twips2pointsX(c, editor->nAvailWidth); 00040 else 00041 c->nAvailWidth = c->rcView.right - c->rcView.left; 00042 } 00043 00044 void ME_DestroyContext(ME_Context *c) 00045 { 00046 if (c->hDC) ITextHost_TxReleaseDC(c->editor->texthost, c->hDC); 00047 DeleteObject(c->hbrMargin); 00048 } Generated on Sun May 27 2012 04:20:11 for ReactOS by
1.7.6.1
|