aboutsummaryrefslogtreecommitdiffhomepage
path: root/win32/PlatWin.cxx
diff options
context:
space:
mode:
authornyamatongwe <unknown>2009-05-06 11:00:26 +0000
committernyamatongwe <unknown>2009-05-06 11:00:26 +0000
commit55d4a1dcbbe2f7b5f4651808825f40bd16c78b66 (patch)
tree2bd35ffd1403abdc76a0575740266be72dd6731d /win32/PlatWin.cxx
parentd5903ff90d8aad528c5f47f549563f3730d65d0c (diff)
downloadscintilla-mirror-55d4a1dcbbe2f7b5f4651808825f40bd16c78b66.tar.gz
First stage of Cocoa platform addition.
Changed identifier id since this is a reserved word in Objective C. SCI_LEXER and SCI_NAMESPACE turned on automatically for OS X native compilation.
Diffstat (limited to 'win32/PlatWin.cxx')
-rw-r--r--win32/PlatWin.cxx76
1 files changed, 38 insertions, 38 deletions
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx
index 012d8a9af..54eb5e3cc 100644
--- a/win32/PlatWin.cxx
+++ b/win32/PlatWin.cxx
@@ -216,7 +216,7 @@ class FontCached : Font {
static FontCached *first;
public:
static FontID FindOrCreate(const char *faceName_, int characterSet_, int size_, bool bold_, bool italic_);
- static void ReleaseId(FontID id_);
+ static void ReleaseId(FontID fid_);
};
FontCached *FontCached::first = 0;
@@ -225,7 +225,7 @@ FontCached::FontCached(const char *faceName_, int characterSet_, int size_, bool
next(0), usage(0), hash(0) {
SetLogFont(lf, faceName_, characterSet_, size_, bold_, italic_);
hash = HashFont(faceName_, characterSet_, size_, bold_, italic_);
- id = ::CreateFontIndirectA(&lf);
+ fid = ::CreateFontIndirectA(&lf);
usage = 1;
}
@@ -239,9 +239,9 @@ bool FontCached::SameAs(const char *faceName_, int characterSet_, int size_, boo
}
void FontCached::Release() {
- if (id)
- ::DeleteObject(id);
- id = 0;
+ if (fid)
+ ::DeleteObject(fid);
+ fid = 0;
}
FontID FontCached::FindOrCreate(const char *faceName_, int characterSet_, int size_, bool bold_, bool italic_) {
@@ -252,7 +252,7 @@ FontID FontCached::FindOrCreate(const char *faceName_, int characterSet_, int si
if ((cur->hash == hashFind) &&
cur->SameAs(faceName_, characterSet_, size_, bold_, italic_)) {
cur->usage++;
- ret = cur->id;
+ ret = cur->fid;
}
}
if (ret == 0) {
@@ -260,18 +260,18 @@ FontID FontCached::FindOrCreate(const char *faceName_, int characterSet_, int si
if (fc) {
fc->next = first;
first = fc;
- ret = fc->id;
+ ret = fc->fid;
}
}
::LeaveCriticalSection(&crPlatformLock);
return ret;
}
-void FontCached::ReleaseId(FontID id_) {
+void FontCached::ReleaseId(FontID fid_) {
::EnterCriticalSection(&crPlatformLock);
FontCached **pcur=&first;
for (FontCached *cur=first; cur; cur=cur->next) {
- if (cur->id == id_) {
+ if (cur->fid == fid_) {
cur->usage--;
if (cur->usage == 0) {
*pcur = cur->next;
@@ -287,7 +287,7 @@ void FontCached::ReleaseId(FontID id_) {
}
Font::Font() {
- id = 0;
+ fid = 0;
}
Font::~Font() {
@@ -301,21 +301,21 @@ void Font::Create(const char *faceName, int characterSet, int size,
#ifndef FONTS_CACHED
LOGFONT lf;
SetLogFont(lf, faceName, characterSet, size, bold, italic);
- id = ::CreateFontIndirect(&lf);
+ fid = ::CreateFontIndirect(&lf);
#else
- id = FontCached::FindOrCreate(faceName, characterSet, size, bold, italic);
+ fid = FontCached::FindOrCreate(faceName, characterSet, size, bold, italic);
#endif
}
void Font::Release() {
#ifndef FONTS_CACHED
- if (id)
- ::DeleteObject(id);
+ if (fid)
+ ::DeleteObject(fid);
#else
- if (id)
- FontCached::ReleaseId(id);
+ if (fid)
+ FontCached::ReleaseId(fid);
#endif
- id = 0;
+ fid = 0;
}
#ifdef SCI_NAMESPACE
@@ -969,28 +969,28 @@ Window::~Window() {
}
void Window::Destroy() {
- if (id)
- ::DestroyWindow(reinterpret_cast<HWND>(id));
- id = 0;
+ if (wid)
+ ::DestroyWindow(reinterpret_cast<HWND>(wid));
+ wid = 0;
}
bool Window::HasFocus() {
- return ::GetFocus() == id;
+ return ::GetFocus() == wid;
}
PRectangle Window::GetPosition() {
RECT rc;
- ::GetWindowRect(reinterpret_cast<HWND>(id), &rc);
+ ::GetWindowRect(reinterpret_cast<HWND>(wid), &rc);
return PRectangle(rc.left, rc.top, rc.right, rc.bottom);
}
void Window::SetPosition(PRectangle rc) {
- ::SetWindowPos(reinterpret_cast<HWND>(id),
+ ::SetWindowPos(reinterpret_cast<HWND>(wid),
0, rc.left, rc.top, rc.Width(), rc.Height(), SWP_NOZORDER|SWP_NOACTIVATE);
}
void Window::SetPositionRelative(PRectangle rc, Window w) {
- LONG style = ::GetWindowLong(reinterpret_cast<HWND>(id), GWL_STYLE);
+ LONG style = ::GetWindowLong(reinterpret_cast<HWND>(wid), GWL_STYLE);
if (style & WS_POPUP) {
RECT rcOther;
::GetWindowRect(reinterpret_cast<HWND>(w.GetID()), &rcOther);
@@ -1017,25 +1017,25 @@ void Window::SetPositionRelative(PRectangle rc, Window w) {
PRectangle Window::GetClientPosition() {
RECT rc={0,0,0,0};
- if (id)
- ::GetClientRect(reinterpret_cast<HWND>(id), &rc);
+ if (wid)
+ ::GetClientRect(reinterpret_cast<HWND>(wid), &rc);
return PRectangle(rc.left, rc.top, rc.right, rc.bottom);
}
void Window::Show(bool show) {
if (show)
- ::ShowWindow(reinterpret_cast<HWND>(id), SW_SHOWNOACTIVATE);
+ ::ShowWindow(reinterpret_cast<HWND>(wid), SW_SHOWNOACTIVATE);
else
- ::ShowWindow(reinterpret_cast<HWND>(id), SW_HIDE);
+ ::ShowWindow(reinterpret_cast<HWND>(wid), SW_HIDE);
}
void Window::InvalidateAll() {
- ::InvalidateRect(reinterpret_cast<HWND>(id), NULL, FALSE);
+ ::InvalidateRect(reinterpret_cast<HWND>(wid), NULL, FALSE);
}
void Window::InvalidateRectangle(PRectangle rc) {
RECT rcw = RectFromPRectangle(rc);
- ::InvalidateRect(reinterpret_cast<HWND>(id), &rcw, FALSE);
+ ::InvalidateRect(reinterpret_cast<HWND>(wid), &rcw, FALSE);
}
static LRESULT Window_SendMessage(Window *w, UINT msg, WPARAM wParam=0, LPARAM lParam=0) {
@@ -1089,7 +1089,7 @@ void Window::SetCursor(Cursor curs) {
}
void Window::SetTitle(const char *s) {
- ::SetWindowTextA(reinterpret_cast<HWND>(id), s);
+ ::SetWindowTextA(reinterpret_cast<HWND>(wid), s);
}
/* Returns rectangle of monitor pt is on, both rect and pt are in Window's
@@ -1329,7 +1329,7 @@ void ListBoxX::Create(Window &parent_, int ctrlID_, Point location_, int lineHei
HWND hwndParent = reinterpret_cast<HWND>(parent->GetID());
HINSTANCE hinstanceParent = GetWindowInstance(hwndParent);
// Window created as popup so not clipped within parent client area
- id = ::CreateWindowEx(
+ wid = ::CreateWindowEx(
WS_EX_WINDOWEDGE, ListBoxX_ClassName, TEXT(""),
WS_POPUP | WS_THICKFRAME,
100,100, 150,80, hwndParent,
@@ -2007,22 +2007,22 @@ bool ListBoxX_Unregister() {
return ::UnregisterClass(ListBoxX_ClassName, hinstPlatformRes) != 0;
}
-Menu::Menu() : id(0) {
+Menu::Menu() : mid(0) {
}
void Menu::CreatePopUp() {
Destroy();
- id = ::CreatePopupMenu();
+ mid = ::CreatePopupMenu();
}
void Menu::Destroy() {
- if (id)
- ::DestroyMenu(reinterpret_cast<HMENU>(id));
- id = 0;
+ if (mid)
+ ::DestroyMenu(reinterpret_cast<HMENU>(mid));
+ mid = 0;
}
void Menu::Show(Point pt, Window &w) {
- ::TrackPopupMenu(reinterpret_cast<HMENU>(id),
+ ::TrackPopupMenu(reinterpret_cast<HMENU>(mid),
0, pt.x - 4, pt.y, 0,
reinterpret_cast<HWND>(w.GetID()), NULL);
Destroy();