3602{
3604
3606
3629
3630
3631
3637 {
3639
3647 }
3650 return 0;
3652 {
3653
3658 if ((*pfrom|*pto) & 0xFFFF0000)
3659 return -1;
3661 }
3663 {
3667 return 0;
3668 }
3670 {
3673 else
3675
3676
3677
3679 }
3690 {
3691
3695
3697 }
3699 {
3703
3706
3707 cf.cbSize =
sizeof(
cf);
3710 tmp_size = (
cf.yHeight / 20) +
wParam;
3711
3712 if (tmp_size <= 1)
3714 else if (tmp_size > 12 && tmp_size < 28 && tmp_size % 2)
3715 size = tmp_size + (is_increase ? 1 : -1);
3716 else if (tmp_size > 28 && tmp_size < 36)
3717 size = is_increase ? 36 : 28;
3718 else if (tmp_size > 36 && tmp_size < 48)
3719 size = is_increase ? 48 : 36;
3720 else if (tmp_size > 48 && tmp_size < 72)
3721 size = is_increase ? 72 : 48;
3722 else if (tmp_size > 72 && tmp_size < 80)
3723 size = is_increase ? 80 : 72;
3724 else if (tmp_size > 80 && tmp_size < 1638)
3725 size = 10 * (is_increase ? (tmp_size / 10 + 1) : (tmp_size / 10));
3726 else if (tmp_size >= 1638)
3728 else
3730
3736
3738 }
3740 {
3741
3742
3743
3749 DWORD changedSettings;
3750
3752 {
3755 break;
3758 break;
3761 break;
3764 }
3765 changedSettings = oldSettings ^
settings;
3766
3767 if (changedSettings) {
3769
3771 {
3777 } else {
3780 }
3782 }
3783
3786
3788 FIXME(
"ECO_VERTICAL not implemented yet!\n");
3790 FIXME(
"ECO_AUTOHSCROLL not implemented yet!\n");
3792 FIXME(
"ECO_AUTOVSCROLL not implemented yet!\n");
3794 FIXME(
"ECO_WANTRETURN not implemented yet!\n");
3796 FIXME(
"ECO_AUTOWORDSELECTION not implemented yet!\n");
3797 }
3798
3800 }
3802 {
3804 }
3806 {
3809 return 0;
3810 }
3812 {
3814 {
3816 return 0;
3817 }
3819 }
3821 {
3823 }
3825 {
3827
3829 }
3831 {
3833
3835 {
3838 break;
3841 break;
3844 break;
3845 default:
3846 return 0;
3847 }
3848
3857 } else {
3860 }
3861 return 0;
3862 }
3864 {
3869 BOOL bRtf, bUnicode, bSelection, bUTF8;
3871 static const char utf8_bom[] = {0xef, 0xbb, 0xbf};
3872
3873 if (!pStruct) return 0;
3874
3875
3876
3881
3882 TRACE(
"EM_SETTEXTEX - %s, flags %d, cp %d\n",
3885
3887 if (bSelection) {
3891 } else {
3896 }
3897
3898 if (bRtf) {
3900 if (bSelection) {
3901
3902
3904 }
3905 } else {
3906 if (bUTF8 && !bUnicode) {
3910 } else {
3914 }
3915 }
3916
3917 if (bSelection) {
3920 } else {
3925 }
3928 {
3931 }
3934 }
3938 {
3943 }
3945
3947 {
3950 }
3951 else
3952 {
3955 }
3957 return lColor;
3958 }
3962 {
3965 else
3967
3968 return 0;
3969 }
3971 {
3974 else
3976 return 1;
3977 }
3979 {
3981
3983 return nOldMask;
3984 }
3990 {
3996 return 0;
3997 tmp.
cbSize =
sizeof(tmp);
4000 else
4004 }
4006 {
4012 }
4017 {
4020 int ypara = 0;
4022 int ystart, yend;
4026 break;
4028 ypara =
p->member.para.pt.y;
4029 continue;
4030 }
4031 ystart = ypara +
p->member.row.pt.y;
4032 yend = ystart +
p->member.row.nHeight;
4034 break;
4035 }
4037 }
4039 }
4041 {
4044 return 0;
4045 }
4047 {
4052 }
4054 {
4060 return 0;
4061 }
4063 {
4067
4069
4073 }
4076 return 0;
4078 {
4083
4086
4088 return 0;
4089
4097 }
4099
4104 if (bRepaint)
4106 return 0;
4107 }
4109 {
4114 {
4118 {
4119
4121 }
4122 else
4124 }
4125 else
4126 TRACE(
"WM_SETTEXT - NULL\n");
4134 return 1;
4135 }
4142
4145 return 0;
4149 return 0;
4151 {
4153
4154
4158 }
4162 {
4170 }
4174 {
4178 nTo - nFrom, unicode);
4179 }
4181 {
4185
4190 return 1;
4191 }
4193 {
4199
4200 TRACE(
"EM_GETTEXTRANGE min=%d max=%d unicode=%d textlength=%d\n",
4202 if (nStart < 0) return 0;
4203 if ((nStart == 0 && nEnd == -1) || nEnd > textlength)
4204 nEnd = textlength;
4205 if (nStart >= nEnd) return 0;
4206
4209 }
4211 {
4213 const unsigned int nMaxChars = *(
WORD *)
lParam;
4214 unsigned int nCharsLeft = nMaxChars;
4217
4218 TRACE(
"EM_GETLINE: row=%d, nMaxChars=%d (%s)\n", (
int)
wParam, nMaxChars,
4219 unicode ? "Unicode" : "Ansi");
4220
4223 return 0;
4224
4227 {
4229 unsigned int nCopy;
4230
4232
4233 if (unicode)
4235 else
4238 dest += nCopy * (unicode ?
sizeof(
WCHAR) : 1);
4239 nCharsLeft -= nCopy;
4240 }
4241
4242
4243 if (nCharsLeft > 0)
4244 {
4245 if (unicode)
4247 else
4249 nCharsLeft--;
4251 }
4252
4253 TRACE(
"EM_GETLINE: got %u characters\n", nMaxChars - nCharsLeft);
4254 return nMaxChars - nCharsLeft - (wroteNull ? 1 : 0);
4255 }
4257 {
4261
4267 last_para->member.run.nCharOfs == 0 &&
4270 {
4271
4272
4273
4275 }
4276
4277 TRACE(
"EM_GETLINECOUNT: nRows==%d\n",
nRows);
4279 }
4281 {
4284 else
4286 }
4288 {
4291 else
4293 }
4295 {
4297 int nCharOfs;
4298
4301 else
4304 return -1;
4308 TRACE(
"EM_LINEINDEX: nCharOfs==%d\n", nCharOfs);
4309 return nCharOfs;
4310 }
4312 {
4314 int nChars = 0, nThisLineOfs = 0, nNextLineOfs = 0;
4316
4318 return 0;
4320 {
4321 FIXME(
"EM_LINELENGTH: returning number of unselected characters on lines with selection unsupported.\n");
4322 return 0;
4323 }
4330 } else {
4334 }
4335 nChars = nNextLineOfs - nThisLineOfs;
4337 return nChars;
4338 }
4340 {
4342 return 0;
4345 else
4347 return 0;
4348 }
4350 {
4353 else
4355 return 0;
4356 }
4358 {
4360 }
4362 {
4364 if(!unicode){
4368
4373 }else{
4376 }
4378 }
4380 {
4382 if(!unicode){
4386
4391 }else{
4394 }
4396 }
4398 {
4401 }
4403 {
4406 }
4416 {
4421 else
4422 return -1;
4423 }
4425 {
4427 int nCharOfs, nOffset,
nLength;
4429
4431
4436 nCharOfs =
max(nCharOfs, 0);
4437
4444
4447
4450 }
4452 }
4457 return 0;
4459 {
4465 }
4468 {
4472 return 0;
4480 break;
4481 }
4485 return 0;
4488 else
4490
4493 break;
4498 }
4503 return 0;
4504 else
4505 {
4508 }
4509 break;
4516 return 0;
4518 goto do_default;
4521 goto do_default;
4522 break;
4530 return 0;
4540 return 0;
4543 return 0;
4547 return 0;
4548 goto do_default;
4552 return 0;
4554 return 0;
4555 goto do_default;
4559 return 0;
4562 if (unicode)
4563 {
4566 {
4568 {
4572 } else {
4574 }
4575 }
4576 return 0;
4577 }
4578 break;
4581 return 0;
4583 {
4584 const int scrollUnit = 7;
4585
4587 {
4590 break;
4595 break;
4598 break;
4601 break;
4604 break;
4607 break;
4610 {
4615 break;
4616 }
4617 }
4618 break;
4619 }
4622 {
4623 int origNPos;
4625
4627
4629 {
4632 break;
4637 break;
4640 break;
4643 break;
4646 break;
4649 break;
4652 {
4657 break;
4658 }
4659 }
4661 return 0x00010000 | (((editor->
vert_si.
nPos - origNPos)/lineHeight) & 0xffff);
4662 break;
4663 }
4665 {
4666 int delta;
4668
4671 return 0;
4672
4674
4675 delta = GET_WHEEL_DELTA_WPARAM(
wParam);
4676
4677
4678 if ((delta < 0 && editor->wheel_remain < 0) ||
4681 else
4683
4685 {
4686 if (ctrl_is_down) {
4687 int numerator;
4689 {
4690 numerator = 100;
4691 } else {
4693 }
4695 if (numerator >= 10 && numerator <= 500)
4697 } else {
4700
4706 }
4707 }
4708 break;
4709 }
4711 {
4715 return 0;
4716 }
4719 {
4721 {
4725
4729 {
4734 }
else if (
wParam == 1) {
4735
4736
4737
4738
4743 } else {
4744 return 0;
4745 }
4747 }
4748 else
4749 {
4752 }
4758 return 0;
4759 }
4762 return 0;
4764 goto do_default;
4766 {
4769
4774 } else {
4777 }
4780 goto do_default;
4781 }
4782
4787 return 0;
4788 case WM_IME_STARTCOMPOSITION:
4789 {
4794 return 0;
4795 }
4796 case WM_IME_COMPOSITION:
4797 {
4799
4805 {
4809 if (!dwIndex)
4811
4818
4822 }
4826 return 0;
4827 }
4828 case WM_IME_ENDCOMPOSITION:
4829 {
4832 return 0;
4833 }
4835 {
4838 return 0;
4840 return 1;
4841 return 0;
4842 }
4844 {
4846 }
4857 {
4859
4862 }
4864 return editor->
mode;
4866 {
4869
4873
4874
4878
4880 {
4884
4885
4889
4894 }
4895 }
4896
4898 return 0;
4899 }
4901 {
4904 return 0;
4905 }
4908 {
4911 {
4915 }
4916 } else {
4920 {
4924 }
4925 FIXME(
"EM_SETTARGETDEVICE doesn't use non-NULL target devices\n");
4926 }
4928 default:
4929 do_default:
4931 break;
4932 }
4934}
struct mke2fs_defaults settings[]
ACPI_SIZE strlen(const char *String)
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
static int list_empty(struct list_entry *head)
LONG WINAPI ImmGetCompositionStringW(HIMC hIMC, DWORD dwIndex, LPVOID lpBuf, DWORD dwBufLen)
#define HeapFree(x, y, z)
void ME_DeleteSelection(ME_TextEditor *editor)
void ME_LButtonDown(ME_TextEditor *editor, int x, int y, int clickNum)
int ME_GetTextLengthEx(ME_TextEditor *editor, const GETTEXTLENGTHEX *how)
void hide_caret(ME_TextEditor *editor)
void ME_MouseMove(ME_TextEditor *editor, int x, int y)
BOOL ME_CharFromPos(ME_TextEditor *editor, int x, int y, ME_Cursor *cursor, BOOL *isExact)
int set_selection_cursors(ME_TextEditor *editor, int from, int to)
void create_caret(ME_TextEditor *editor)
void update_caret(ME_TextEditor *editor)
ME_Style * ME_GetSelectionInsertStyle(ME_TextEditor *editor)
static void ME_StreamInRTFString(ME_TextEditor *editor, BOOL selection, char *string)
static BOOL paste_special(ME_TextEditor *editor, UINT cf, REPASTESPECIAL *ps, BOOL check_only)
#define UNSUPPORTED_MSG(e)
static int ME_FindText(ME_TextEditor *editor, DWORD flags, const CHARRANGE *chrg, const WCHAR *text, CHARRANGE *chrgText)
static LRESULT ME_StreamIn(ME_TextEditor *editor, DWORD format, EDITSTREAM *stream, BOOL stripLastCR)
static void ME_SetText(ME_TextEditor *editor, void *text, BOOL unicode)
void ME_ReplaceSel(ME_TextEditor *editor, BOOL can_undo, const WCHAR *str, int len)
static LRESULT ME_Char(ME_TextEditor *editor, WPARAM charCode, LPARAM flags, BOOL unicode)
static BOOL ME_SetCursor(ME_TextEditor *editor)
static BOOL ME_ShowContextMenu(ME_TextEditor *editor, int x, int y)
static void ME_SetDefaultFormatRect(ME_TextEditor *editor)
static int ME_GetTextRange(ME_TextEditor *editor, WCHAR *strText, const ME_Cursor *start, int nLen, BOOL unicode)
void ME_SendOldNotify(ME_TextEditor *editor, int nCode)
static LRESULT handle_EM_SETCHARFORMAT(ME_TextEditor *editor, WPARAM flags, const CHARFORMAT2W *fmt_in)
static int ME_GetTextEx(ME_TextEditor *editor, GETTEXTEX *ex, LPARAM pText)
static int calc_wheel_change(int *remain, int amount_per_click)
static BOOL ME_FilterEvent(ME_TextEditor *editor, UINT msg, WPARAM *wParam, LPARAM *lParam)
#define STACK_SIZE_DEFAULT
static BOOL copy_or_cut(ME_TextEditor *editor, BOOL cut)
static int get_default_line_height(ME_TextEditor *editor)
static LONG ME_GetSelectionType(ME_TextEditor *editor)
static LRESULT ME_WmCreate(ME_TextEditor *editor, LPARAM lParam, BOOL unicode)
static void ME_LinkNotify(ME_TextEditor *editor, UINT msg, WPARAM wParam, LPARAM lParam)
static BOOL ME_UpdateLinkAttribute(ME_TextEditor *editor, ME_Cursor *start, int nChars)
void ME_DestroyEditor(ME_TextEditor *editor)
static BOOL ME_KeyDown(ME_TextEditor *editor, WORD nKey)
static int ME_CalculateClickCount(ME_TextEditor *editor, UINT msg, WPARAM wParam, LPARAM lParam)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
#define ITextHost_TxShowScrollBar(This, a, b)
#define ITextHost_TxSetFocus(This)
void ME_AddRefStyle(ME_Style *item) DECLSPEC_HIDDEN
void ME_ScrollRight(ME_TextEditor *editor, int cx) DECLSPEC_HIDDEN
#define ITextHost_TxInvalidateRect(This, a, b)
void ME_ScrollAbs(ME_TextEditor *editor, int x, int y) DECLSPEC_HIDDEN
BOOL ME_SetZoom(ME_TextEditor *editor, int numerator, int denominator) DECLSPEC_HIDDEN
void ME_SendRequestResize(ME_TextEditor *editor, BOOL force) DECLSPEC_HIDDEN
BOOL ME_Redo(ME_TextEditor *editor) DECLSPEC_HIDDEN
void ME_RunOfsFromCharOfs(ME_TextEditor *editor, int nCharOfs, ME_DisplayItem **ppPara, ME_DisplayItem **ppRun, int *pOfs) DECLSPEC_HIDDEN
void ME_GetDefaultCharFormat(ME_TextEditor *editor, CHARFORMAT2W *pFmt) DECLSPEC_HIDDEN
#define ITextHost_TxSetCapture(This, a)
#define ITextHost_TxGetSysColor(This, a)
void ME_CharFormatFromLogFont(HDC hDC, const LOGFONTW *lf, CHARFORMAT2W *fmt) DECLSPEC_HIDDEN
void ME_EndToUnicode(LONG codepage, LPVOID psz) DECLSPEC_HIDDEN
void ME_ScrollLeft(ME_TextEditor *editor, int cx) DECLSPEC_HIDDEN
void ME_EnsureVisible(ME_TextEditor *editor, ME_Cursor *pCursor) DECLSPEC_HIDDEN
ME_DisplayItem * ME_GetParagraph(ME_DisplayItem *run) DECLSPEC_HIDDEN
void ME_VScrollAbs(ME_TextEditor *editor, int y) DECLSPEC_HIDDEN
#define ITextHost_TxGetClientRect(This, a)
#define ITextHost_TxGetDC(This)
void ME_ScrollUp(ME_TextEditor *editor, int cy) DECLSPEC_HIDDEN
void ME_InvalidateSelection(ME_TextEditor *editor) DECLSPEC_HIDDEN
int ME_RowNumberFromCharOfs(ME_TextEditor *editor, int nOfs) DECLSPEC_HIDDEN
void ME_HScrollAbs(ME_TextEditor *editor, int x) DECLSPEC_HIDDEN
int ME_CharOfsFromRunOfs(ME_TextEditor *editor, const ME_DisplayItem *pPara, const ME_DisplayItem *pRun, int nOfs) DECLSPEC_HIDDEN
void ME_GetSelectionCharFormat(ME_TextEditor *editor, CHARFORMAT2W *pFmt) DECLSPEC_HIDDEN
void ME_RewrapRepaint(ME_TextEditor *editor) DECLSPEC_HIDDEN
BOOL ME_SetSelectionParaFormat(ME_TextEditor *editor, const PARAFORMAT2 *pFmt) DECLSPEC_HIDDEN
#define ITextHost_TxReleaseDC(This, a)
ME_DisplayItem * ME_FindRowWithNumber(ME_TextEditor *editor, int nRow) DECLSPEC_HIDDEN
void ME_Repaint(ME_TextEditor *editor) DECLSPEC_HIDDEN
#define ITextHost_TxImmGetContext(This)
ME_DisplayItem * ME_RowStart(ME_DisplayItem *item) DECLSPEC_HIDDEN
void ME_ScrollDown(ME_TextEditor *editor, int cy) DECLSPEC_HIDDEN
void ME_GetSelectionParaFormat(ME_TextEditor *editor, PARAFORMAT2 *pFmt) DECLSPEC_HIDDEN
BOOL cf2w_to_cfany(CHARFORMAT2W *to, const CHARFORMAT2W *from) DECLSPEC_HIDDEN
int ME_PointFromChar(ME_TextEditor *editor, ME_Run *pRun, int nOffset, BOOL visual_order) DECLSPEC_HIDDEN
void ME_MarkAllForWrapping(ME_TextEditor *editor) DECLSPEC_HIDDEN
LPWSTR ME_ToUnicode(LONG codepage, LPVOID psz, INT *len) DECLSPEC_HIDDEN
LRESULT ME_StreamOut(ME_TextEditor *editor, DWORD dwFormat, EDITSTREAM *stream) DECLSPEC_HIDDEN
BOOL ME_Undo(ME_TextEditor *editor) DECLSPEC_HIDDEN
@ diStartRowOrParagraphOrEnd
#define SELECTIONBAR_WIDTH
GLint GLint GLsizei GLsizei GLsizei GLint border
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
GLuint GLuint GLsizei count
GLdouble GLdouble GLdouble r
GLint GLint GLsizei width
JSAMPARRAY JDIMENSION max_lines
#define memcpy(s1, s2, n)
#define set_selection(hctl, start, end)
#define TM_MULTILEVELUNDO
#define EM_GETAUTOURLDETECT
#define EM_SETOLECALLBACK
#define EM_SETBIDIOPTIONS
#define ECO_AUTOWORDSELECTION
#define EM_GETWORDBREAKPROCEX
#define EM_GETBIDIOPTIONS
#define TM_SINGLECODEPAGE
struct _charformatw CHARFORMATW
#define EM_GETLANGOPTIONS
#define EM_SETWORDBREAKPROCEX
#define EM_SETLANGOPTIONS
#define EM_STOPGROUPTYPING
#define EM_SETTYPOGRAPHYOPTIONS
#define EM_GETTEXTLENGTHEX
#define EM_SETTARGETDEVICE
struct _charformat2w CHARFORMAT2W
#define EM_EXLINEFROMCHAR
#define EM_GETIMECOMPMODE
#define EM_GETOLEINTERFACE
#define TM_SINGLELEVELUNDO
#define EM_GETTYPOGRAPHYOPTIONS
EDITWORDBREAKPROCW pfnWordBreak
ME_SelectionType nSelectionType
BOOL AutoURLDetect_bEnable
_In_ HCRYPTHASH _In_ BOOL _In_ DWORD _Inout_ DWORD _In_ DWORD dwBufLen
HGDIOBJ WINAPI GetStockObject(_In_ int)
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
#define EM_GETWORDBREAKPROC
#define EM_GETPASSWORDCHAR
#define EM_SETPASSWORDCHAR
HBRUSH WINAPI GetSysColorBrush(_In_ int)
#define EM_EMPTYUNDOBUFFER
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
#define EM_GETFIRSTVISIBLELINE
#define WM_IME_SETCONTEXT
#define EM_SETWORDBREAKPROC
int(CALLBACK * EDITWORDBREAKPROCW)(LPWSTR, int, int, int)
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)
#define WM_IME_COMPOSITIONFULL
BOOL WINAPI DestroyCaret(void)
#define WM_WINDOWPOSCHANGED
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)