ReactOS  0.4.15-dev-3193-g74513a7
CAutoComplete.cpp File Reference
#include "precomp.h"
#include <process.h>
Include dependency graph for CAutoComplete.cpp:

Go to the source code of this file.

Classes

struct  PREFIX_INFO
 
struct  RANGE
 

Macros

#define CX_LIST   30160
 
#define CY_LIST   288
 
#define CY_ITEM   18
 
#define MAX_ITEM_COUNT   1000
 
#define WATCH_TIMER_ID   0xFEEDBEEF
 
#define WATCH_INTERVAL   300
 

Typedefs

typedef CSimpleArray< CStringWlist_t
 

Functions

static BOOL DropPrefix (const CStringW &str, CStringW &strBody)
 
static BOOL DoesMatch (const CStringW &strTarget, const CStringW &strText)
 
static LRESULT CALLBACK MouseProc (INT nCode, WPARAM wParam, LPARAM lParam)
 
static INT compare1 (const CStringW &str1, const CStringW &str2)
 
static INT pivot (list_t &list, INT i, INT j)
 
static INT partition (list_t &list, INT i, INT j, const CStringW &x)
 
static void quicksort (list_t &list, INT i, INT j)
 
static void DoSort (list_t &list)
 
static INT DoUnique (list_t &list)
 
static void DoUniqueAndTrim (list_t &list)
 
static int RangeCompare (const void *x, const void *y)
 
static BOOL IsWordBreak (WCHAR ch)
 
static INT CALLBACK EditWordBreakProcW (LPWSTR lpch, INT index, INT count, INT code)
 
static LRESULT CALLBACK EditSubclassProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uSubclassID, DWORD_PTR dwData)
 
static PAC_THREAD InterlockedExchangeThreadData (volatile PAC_THREAD *Target, PAC_THREAD Value)
 
static unsigned __stdcall AutoCompThreadProc (void *arg)
 

Variables

static HHOOK s_hMouseHook = NULL
 
static HWND s_hWatchWnd = NULL
 
static const PREFIX_INFO s_prefixes []
 

Macro Definition Documentation

◆ CX_LIST

#define CX_LIST   30160

Definition at line 33 of file CAutoComplete.cpp.

◆ CY_ITEM

#define CY_ITEM   18

Definition at line 35 of file CAutoComplete.cpp.

◆ CY_LIST

#define CY_LIST   288

Definition at line 34 of file CAutoComplete.cpp.

◆ MAX_ITEM_COUNT

#define MAX_ITEM_COUNT   1000

Definition at line 36 of file CAutoComplete.cpp.

◆ WATCH_INTERVAL

#define WATCH_INTERVAL   300

Definition at line 38 of file CAutoComplete.cpp.

◆ WATCH_TIMER_ID

#define WATCH_TIMER_ID   0xFEEDBEEF

Definition at line 37 of file CAutoComplete.cpp.

Typedef Documentation

◆ list_t

Definition at line 125 of file CAutoComplete.cpp.

Function Documentation

◆ AutoCompThreadProc()

static unsigned __stdcall AutoCompThreadProc ( void arg)
static

Definition at line 1990 of file CAutoComplete.cpp.

1991 {
1992  CAutoComplete* pThis = reinterpret_cast<CAutoComplete*>(arg);
1993  pThis->AutoCompThreadProc();
1994  return 0;
1995 }
VOID AutoCompThreadProc()

◆ compare1()

static INT compare1 ( const CStringW str1,
const CStringW str2 
)
inlinestatic

Definition at line 127 of file CAutoComplete.cpp.

128 {
129  CStringW s1, s2;
130  DropPrefix(str1, s1);
131  DropPrefix(str2, s2);
132  return s1.CompareNoCase(s2);
133 }
struct S2 s2
struct S1 s1
static BOOL DropPrefix(const CStringW &str, CStringW &strBody)

Referenced by DoUnique(), partition(), and pivot().

◆ DoesMatch()

static BOOL DoesMatch ( const CStringW strTarget,
const CStringW strText 
)
static

Definition at line 72 of file CAutoComplete.cpp.

73 {
74  CStringW strBody;
75  if (DropPrefix(strTarget, strBody))
76  {
77  if (::StrCmpNIW(strBody, strText, strText.GetLength()) == 0)
78  return TRUE;
79  }
80  else if (::StrCmpNIW(strTarget, strText, strText.GetLength()) == 0)
81  {
82  return TRUE;
83  }
84  return FALSE;
85 }
int GetLength() const
Definition: atlsimpstr.h:356
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static BOOL DropPrefix(const CStringW &str, CStringW &strBody)
INT WINAPI StrCmpNIW(LPCWSTR lpszStr, LPCWSTR lpszComp, INT iLen)
Definition: string.c:311

Referenced by CAutoComplete::ExtractInnerList().

◆ DoSort()

static void DoSort ( list_t list)
inlinestatic

Definition at line 181 of file CAutoComplete.cpp.

182 {
183  if (list.GetSize() <= 1) // sanity check
184  return;
185  quicksort(list, 0, list.GetSize() - 1); // quick sort
186 }
static void quicksort(list_t &list, INT i, INT j)
#define list
Definition: rosglue.h:35

Referenced by CAutoComplete::DoThreadWork().

◆ DoUnique()

static INT DoUnique ( list_t list)
static

Definition at line 189 of file CAutoComplete.cpp.

190 {
191  INT first = 0, last = list.GetSize();
192  if (first == last)
193  return last;
194  INT result = first;
195  while (++first != last)
196  {
197  if (compare1(list[result], list[first]) != 0)
198  list[++result] = list[first];
199  }
200  return ++result;
201 }
GLuint64EXT * result
Definition: glext.h:11304
POINT last
Definition: font.c:46
const GLint * first
Definition: glext.h:5794
int32_t INT
Definition: typedefs.h:58
#define list
Definition: rosglue.h:35
static INT compare1(const CStringW &str1, const CStringW &str2)

Referenced by DoUniqueAndTrim().

◆ DoUniqueAndTrim()

static void DoUniqueAndTrim ( list_t list)
inlinestatic

Definition at line 203 of file CAutoComplete.cpp.

204 {
205  INT last = DoUnique(list);
206  while (list.GetSize() > last)
207  {
208  list.RemoveAt(last);
209  }
210 }
POINT last
Definition: font.c:46
int32_t INT
Definition: typedefs.h:58
#define list
Definition: rosglue.h:35
static INT DoUnique(list_t &list)

Referenced by CAutoComplete::DoThreadWork().

◆ DropPrefix()

static BOOL DropPrefix ( const CStringW str,
CStringW strBody 
)
static

Definition at line 56 of file CAutoComplete.cpp.

57 {
58  for (size_t iPrefix = 0; iPrefix < _countof(s_prefixes); ++iPrefix)
59  {
60  LPCWSTR psz = s_prefixes[iPrefix].psz;
61  INT cch = s_prefixes[iPrefix].cch;
62  if (::StrCmpNIW(str, psz, cch) == 0)
63  {
64  strBody = str.Mid(cch);
65  return TRUE;
66  }
67  }
68  strBody = str;
69  return FALSE;
70 }
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define TRUE
Definition: types.h:120
int32_t INT
Definition: typedefs.h:58
#define FALSE
Definition: types.h:117
const WCHAR * str
#define _countof(array)
Definition: sndvol32.h:68
static const PREFIX_INFO s_prefixes[]
IN PCTCH IN DWORD cch
Definition: pager.h:36
INT WINAPI StrCmpNIW(LPCWSTR lpszStr, LPCWSTR lpszComp, INT iLen)
Definition: string.c:311

Referenced by compare1(), CAutoComplete::DoAutoAppend(), and DoesMatch().

◆ EditSubclassProc()

static LRESULT CALLBACK EditSubclassProc ( HWND  hwnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
UINT_PTR  uSubclassID,
DWORD_PTR  dwData 
)
static

Definition at line 292 of file CAutoComplete.cpp.

294 {
295  CAutoComplete *pThis = reinterpret_cast<CAutoComplete *>(dwData);
296  return pThis->EditWndProc(hwnd, uMsg, wParam, lParam);
297 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static HANDLE ULONG_PTR dwData
Definition: file.c:35
WPARAM wParam
Definition: combotst.c:138
LRESULT EditWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
LPARAM lParam
Definition: combotst.c:139

Referenced by CAutoComplete::EditWndProc(), and CAutoComplete::Init().

◆ EditWordBreakProcW()

static INT CALLBACK EditWordBreakProcW ( LPWSTR  lpch,
INT  index,
INT  count,
INT  code 
)
static

Definition at line 265 of file CAutoComplete.cpp.

266 {
267  switch (code)
268  {
269  case WB_ISDELIMITER:
270  return IsWordBreak(lpch[index]);
271  case WB_LEFT:
272  {
273  if (index)
274  --index;
275  while (index && !IsWordBreak(lpch[index]))
276  --index;
277  return index;
278  }
279  case WB_RIGHT:
280  {
281  if (!count)
282  break;
283  while (index < count && lpch[index] && !IsWordBreak(lpch[index]))
284  ++index;
285  return index;
286  }
287  }
288  return 0;
289 }
#define WB_RIGHT
Definition: winuser.h:551
#define WB_ISDELIMITER
Definition: winuser.h:549
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define WB_LEFT
Definition: winuser.h:550
GLuint index
Definition: glext.h:6031
#define index(s, c)
Definition: various.h:29
Definition: inflate.c:139
static BOOL IsWordBreak(WCHAR ch)

Referenced by CAutoComplete::Init().

◆ InterlockedExchangeThreadData()

static PAC_THREAD InterlockedExchangeThreadData ( volatile PAC_THREAD Target,
PAC_THREAD  Value 
)
inlinestatic

Definition at line 1984 of file CAutoComplete.cpp.

1985 {
1986  return reinterpret_cast<PAC_THREAD>(
1987  ::InterlockedExchangePointer(reinterpret_cast<volatile PVOID *>(Target), Value));
1988 }
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:406
#define InterlockedExchangePointer(Target, Value)
Definition: dshow.h:45
_In_ WDFIOTARGET Target
Definition: wdfrequest.h:306

Referenced by CAutoComplete::AutoCompThreadProc(), and CAutoComplete::OnAutoCompStart().

◆ IsWordBreak()

static BOOL IsWordBreak ( WCHAR  ch)
inlinestatic

Definition at line 233 of file CAutoComplete.cpp.

234 {
235  // the ranges of word break characters
236  static const RANGE s_ranges[] =
237  {
238  { 0x0009, 0x0009 }, { 0x0020, 0x002f }, { 0x003a, 0x0040 }, { 0x005b, 0x0060 },
239  { 0x007b, 0x007e }, { 0x00ab, 0x00ab }, { 0x00ad, 0x00ad }, { 0x00bb, 0x00bb },
240  { 0x02c7, 0x02c7 }, { 0x02c9, 0x02c9 }, { 0x055d, 0x055d }, { 0x060c, 0x060c },
241  { 0x2002, 0x200b }, { 0x2013, 0x2014 }, { 0x2016, 0x2016 }, { 0x2018, 0x2018 },
242  { 0x201c, 0x201d }, { 0x2022, 0x2022 }, { 0x2025, 0x2027 }, { 0x2039, 0x203a },
243  { 0x2045, 0x2046 }, { 0x207d, 0x207e }, { 0x208d, 0x208e }, { 0x226a, 0x226b },
244  { 0x2574, 0x2574 }, { 0x3001, 0x3003 }, { 0x3005, 0x3005 }, { 0x3008, 0x3011 },
245  { 0x3014, 0x301b }, { 0x301d, 0x301e }, { 0x3041, 0x3041 }, { 0x3043, 0x3043 },
246  { 0x3045, 0x3045 }, { 0x3047, 0x3047 }, { 0x3049, 0x3049 }, { 0x3063, 0x3063 },
247  { 0x3083, 0x3083 }, { 0x3085, 0x3085 }, { 0x3087, 0x3087 }, { 0x308e, 0x308e },
248  { 0x309b, 0x309e }, { 0x30a1, 0x30a1 }, { 0x30a3, 0x30a3 }, { 0x30a5, 0x30a5 },
249  { 0x30a7, 0x30a7 }, { 0x30a9, 0x30a9 }, { 0x30c3, 0x30c3 }, { 0x30e3, 0x30e3 },
250  { 0x30e5, 0x30e5 }, { 0x30e7, 0x30e7 }, { 0x30ee, 0x30ee }, { 0x30f5, 0x30f6 },
251  { 0x30fc, 0x30fe }, { 0xfd3e, 0xfd3f }, { 0xfe30, 0xfe31 }, { 0xfe33, 0xfe44 },
252  { 0xfe4f, 0xfe51 }, { 0xfe59, 0xfe5e }, { 0xff08, 0xff09 }, { 0xff0c, 0xff0c },
253  { 0xff0e, 0xff0e }, { 0xff1c, 0xff1c }, { 0xff1e, 0xff1e }, { 0xff3b, 0xff3b },
254  { 0xff3d, 0xff3d }, { 0xff40, 0xff40 }, { 0xff5b, 0xff5e }, { 0xff61, 0xff64 },
255  { 0xff67, 0xff70 }, { 0xff9e, 0xff9f }, { 0xffe9, 0xffe9 }, { 0xffeb, 0xffeb },
256  };
257  // binary search
258  RANGE range = { ch, ch };
259  return !!bsearch(&range, s_ranges, _countof(s_ranges), sizeof(RANGE), RangeCompare);
260 }
static int RangeCompare(const void *x, const void *y)
#define _countof(array)
Definition: sndvol32.h:68
GLenum GLint * range
Definition: glext.h:7539
#define bsearch

Referenced by CAutoComplete::DoBackWord(), and EditWordBreakProcW().

◆ MouseProc()

static LRESULT CALLBACK MouseProc ( INT  nCode,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 89 of file CAutoComplete.cpp.

90 {
91  if (s_hMouseHook == NULL)
92  return 0; // do default
93  // if the user clicked the outside of s_hWatchWnd, then hide the drop-down window
94  if (nCode == HC_ACTION && // an action?
95  s_hWatchWnd && ::IsWindow(s_hWatchWnd) && // s_hWatchWnd is valid?
96  ::GetCapture() == NULL) // no capture? (dragging something?)
97  {
98  RECT rc;
99  MOUSEHOOKSTRUCT *pMouseHook = reinterpret_cast<MOUSEHOOKSTRUCT *>(lParam);
100  switch (wParam)
101  {
102  case WM_LBUTTONDOWN: case WM_LBUTTONUP:
103  case WM_RBUTTONDOWN: case WM_RBUTTONUP:
104  case WM_MBUTTONDOWN: case WM_MBUTTONUP:
105  case WM_NCLBUTTONDOWN: case WM_NCLBUTTONUP:
106  case WM_NCRBUTTONDOWN: case WM_NCRBUTTONUP:
107  case WM_NCMBUTTONDOWN: case WM_NCMBUTTONUP:
108  {
110  if (!::PtInRect(&rc, pMouseHook->pt)) // outside of s_hWatchWnd?
111  {
113  }
114  break;
115  }
116  }
117  }
118  return ::CallNextHookEx(s_hMouseHook, nCode, wParam, lParam); // go next hook
119 }
#define WM_MBUTTONUP
Definition: winuser.h:1766
#define WM_NCLBUTTONDOWN
Definition: winuser.h:1675
#define WM_LBUTTONDOWN
Definition: winuser.h:1759
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define SW_HIDE
Definition: winuser.h:762
#define WM_NCRBUTTONDOWN
Definition: winuser.h:1678
static HWND s_hWatchWnd
WPARAM wParam
Definition: combotst.c:138
BOOL WINAPI ShowWindowAsync(_In_ HWND, _In_ int)
#define WM_NCRBUTTONUP
Definition: winuser.h:1679
HWND WINAPI GetCapture(void)
Definition: message.c:2880
#define WM_RBUTTONDOWN
Definition: winuser.h:1762
#define WM_RBUTTONUP
Definition: winuser.h:1763
#define WM_NCMBUTTONUP
Definition: winuser.h:1682
static HHOOK s_hMouseHook
#define WM_NCMBUTTONDOWN
Definition: winuser.h:1681
LRESULT WINAPI CallNextHookEx(_In_opt_ HHOOK, _In_ int, _In_ WPARAM, _In_ LPARAM)
#define HC_ACTION
Definition: winuser.h:48
#define WM_LBUTTONUP
Definition: winuser.h:1760
#define WM_MBUTTONDOWN
Definition: winuser.h:1765
#define NULL
Definition: types.h:112
BOOL WINAPI PtInRect(_In_ LPCRECT, _In_ POINT)
#define WM_NCLBUTTONUP
Definition: winuser.h:1676
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
LPARAM lParam
Definition: combotst.c:139

Referenced by CAutoComplete::OnShowWindow().

◆ partition()

static INT partition ( list_t list,
INT  i,
INT  j,
const CStringW x 
)
inlinestatic

Definition at line 147 of file CAutoComplete.cpp.

148 {
149  INT left = i, right = j;
150  while (left <= right)
151  {
152  while (left <= j && compare1(list[left], x) < 0)
153  left++;
154  while (right >= i && compare1(list[right], x) >= 0)
155  right--;
156  if (left > right)
157  break;
158 
159  CStringW tmp = list[left];
160  list[left] = list[right];
161  list[right] = tmp;
162 
163  left++;
164  right--;
165  }
166  return left;
167 }
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
int32_t INT
Definition: typedefs.h:58
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define list
Definition: rosglue.h:35
static INT compare1(const CStringW &str1, const CStringW &str2)

Referenced by PartitionTest::ptition0(), PartitionTest::ptition1(), and quicksort().

◆ pivot()

static INT pivot ( list_t list,
INT  i,
INT  j 
)
inlinestatic

Definition at line 135 of file CAutoComplete.cpp.

136 {
137  INT k = i + 1;
138  while (k <= j && compare1(list[i], list[k]) == 0)
139  k++;
140  if (k > j)
141  return -1;
142  if (compare1(list[i], list[k]) >= 0)
143  return i;
144  return k;
145 }
int32_t INT
Definition: typedefs.h:58
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define list
Definition: rosglue.h:35
int k
Definition: mpi.c:3369
static INT compare1(const CStringW &str1, const CStringW &str2)

Referenced by get_body(), and quicksort().

◆ quicksort()

static void quicksort ( list_t list,
INT  i,
INT  j 
)
static

Definition at line 169 of file CAutoComplete.cpp.

170 {
171  if (i == j)
172  return;
173  INT p = pivot(list, i, j);
174  if (p == -1)
175  return;
176  INT k = partition(list, i, j, list[p]);
177  quicksort(list, i, k - 1);
178  quicksort(list, k, j);
179 }
static void quicksort(list_t &list, INT i, INT j)
int32_t INT
Definition: typedefs.h:58
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static INT pivot(list_t &list, INT i, INT j)
#define list
Definition: rosglue.h:35
GLfloat GLfloat p
Definition: glext.h:8902
int k
Definition: mpi.c:3369
static INT partition(list_t &list, INT i, INT j, const CStringW &x)

Referenced by DoSort().

◆ RangeCompare()

static int RangeCompare ( const void x,
const void y 
)
inlinestatic

Definition at line 221 of file CAutoComplete.cpp.

222 {
223  const RANGE *a = reinterpret_cast<const RANGE *>(x);
224  const RANGE *b = reinterpret_cast<const RANGE *>(y);
225  if (a->to < b->from)
226  return -1;
227  if (b->to < a->from)
228  return 1;
229  return 0;
230 }
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

Referenced by IsWordBreak().

Variable Documentation

◆ s_hMouseHook

HHOOK s_hMouseHook = NULL
static

Definition at line 40 of file CAutoComplete.cpp.

Referenced by MouseProc(), and CAutoComplete::OnShowWindow().

◆ s_hWatchWnd

HWND s_hWatchWnd = NULL
static

Definition at line 41 of file CAutoComplete.cpp.

Referenced by MouseProc(), and CAutoComplete::OnShowWindow().

◆ s_prefixes

const PREFIX_INFO s_prefixes[]
static
Initial value:
=
{
{ L"https://", 8 },
{ L"http://www.", 11 },
{ L"http://", 7 },
{ L"www.", 4 },
}
static const WCHAR L[]
Definition: oid.c:1250

Definition at line 48 of file CAutoComplete.cpp.

Referenced by DropPrefix().