"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "swindow/swin32/SWin32.cpp" between
yudit-3.0.5.tar.gz and yudit-3.0.7.tar.gz

About: yudit is an Unicode plain-text editor that can do True Type font rendering, printing, transliterated keyboard input and handwriting recognition with no dependencies on external engines.

SWin32.cpp  (yudit-3.0.5):SWin32.cpp  (yudit-3.0.7)
skipping to change at line 718 skipping to change at line 718
LRESULT CALLBACK _eventHandler(HWND hwnd, UINT message, WPARAM wParam, LPARAM lP aram); LRESULT CALLBACK _eventHandler(HWND hwnd, UINT message, WPARAM wParam, LPARAM lP aram);
SWHandler* handler=0; SWHandler* handler=0;
static void buttonEnter (long hwnd); static void buttonEnter (long hwnd);
static void buttonPressed (long wid, int button, int x, int y); static void buttonPressed (long wid, int button, int x, int y);
static void buttonDragged (long wid, int button, int x, int y); static void buttonDragged (long wid, int button, int x, int y);
static void buttonReleased (long wid, int button, int x, int y); static void buttonReleased (long wid, int button, int x, int y);
static void lostCapture (long wid); static void lostCapture (long wid);
static void processMouseWheel (long hwnd, int increment);
/** /**
* This is wher ewe start off * This is wher ewe start off
*/ */
int APIENTRY int APIENTRY
WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nC mdShow) WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nC mdShow)
{ {
buttonFlags[0] = 0; buttonFlags[0] = 0;
buttonFlags[1] = 0; buttonFlags[1] = 0;
buttonFlags[2] = 0; buttonFlags[2] = 0;
skipping to change at line 909 skipping to change at line 910
engine = 0; engine = 0;
cdc = 0; cdc = 0;
imname = ""; imname = "";
impl = i; impl = i;
id = _id; id = _id;
modalID = 0; modalID = 0;
clipChained = false; clipChained = false;
clipChain = 0; clipChain = 0;
dbufferOn = 0; dbufferOn = 0;
dbuffer = 0; dbuffer = 0;
currentScroll = 0;
windowHashtable.put (id, this); windowHashtable.put (id, this);
} }
SW32Window::~SW32Window() SW32Window::~SW32Window()
{ {
if (dbuffer) delete (SDoubleBuffer*) dbuffer; if (dbuffer) delete (SDoubleBuffer*) dbuffer;
if (engine) delete engine; if (engine) delete engine;
windowHashtable.remove (id); windowHashtable.remove (id);
listenerHashtable.remove (id); listenerHashtable.remove (id);
} }
skipping to change at line 1452 skipping to change at line 1454
buttonPressed ((long) hwnd, 0, xPos, yPos); buttonPressed ((long) hwnd, 0, xPos, yPos);
} }
break; break;
case WM_LBUTTONUP: case WM_LBUTTONUP:
{ {
short xPos = LOWORD (lParam); short xPos = LOWORD (lParam);
short yPos = HIWORD (lParam); short yPos = HIWORD (lParam);
buttonReleased ((long)hwnd, 0, xPos, yPos); buttonReleased ((long)hwnd, 0, xPos, yPos);
} }
break; break;
case WM_MOUSEWHEEL:
//case MSH_MOUSEWHEEL:
{
// WM_MOUSEWHEEL is only delivered to focus window.
POINT point;
point.x = LOWORD(lParam);
point.y = HIWORD(lParam);
HWND hwndReal = WindowFromPoint (point);
// filter out middle button down.
short butt = LOWORD (wParam);
if (butt & MK_MBUTTON) break;
processMouseWheel ((long)hwndReal, (int) GET_WHEEL_DELTA_WPARAM(wParam))
;
}
return 0;
case WM_IME_CHAR: case WM_IME_CHAR:
//fprintf (stderr, "WM_IME_COMPOSITION\n"); //fprintf (stderr, "WM_IME_COMPOSITION\n");
{ {
} }
break; break;
case WM_IME_COMPOSITION: case WM_IME_COMPOSITION:
w = windowHashtable.get ((long)hwnd); w = windowHashtable.get ((long)hwnd);
l = listenerHashtable.get ((long)hwnd); l = listenerHashtable.get ((long)hwnd);
//fprintf (stderr, "WM_IME_CHAR\n"); //fprintf (stderr, "WM_IME_CHAR\n");
if (w && (lParam & GCS_RESULTSTR)) if (w && (lParam & GCS_RESULTSTR))
skipping to change at line 2507 skipping to change at line 2523
buttonFlags[button] = hwnd; buttonFlags[button] = hwnd;
buttonLastX[button] = x; buttonLastX[button] = x;
buttonLastY[button] = y; buttonLastY[button] = y;
SW32Window* w = windowHashtable.get ((long)hwnd); SW32Window* w = windowHashtable.get ((long)hwnd);
SWindowListener* l = listenerHashtable.get ((long)hwnd); SWindowListener* l = listenerHashtable.get ((long)hwnd);
if (w == 0 || l==0) return; if (w == 0 || l==0) return;
l->buttonPressed (w, button, x, y); l->buttonPressed (w, button, x, y);
} }
static void static void
processMouseWheel (long hwnd, int increment) {
SW32Window* w = windowHashtable.get ((long)hwnd);
SWindowListener* l = listenerHashtable.get ((long)hwnd);
if (w == 0 || l==0) return;
w->currentScroll += increment;
if (w->currentScroll > WHEEL_DELTA * 20) {
w->currentScroll = WHEEL_DELTA * 20;
}
if (w->currentScroll < WHEEL_DELTA * -20) {
w->currentScroll = WHEEL_DELTA * -20;
}
if (w->currentScroll < 0) {
while (w->currentScroll < WHEEL_DELTA) {
// caretDown
l->buttonPressed (w, 4, (int)0, (int)0);
w->currentScroll += WHEEL_DELTA*2;
}
} else {
while (w->currentScroll > WHEEL_DELTA) {
// caretUp
l->buttonPressed (w, 3, (int)0, (int)0);
w->currentScroll -= WHEEL_DELTA*2;
}
}
}
static void
buttonDragged (long nwnd, int button, int x, int y) buttonDragged (long nwnd, int button, int x, int y)
{ {
buttonEnter (nwnd); buttonEnter (nwnd);
if (buttonFlags[button] != nwnd) return; if (buttonFlags[button] != nwnd) return;
buttonLastX[button] = x; buttonLastX[button] = x;
buttonLastY[button] = y; buttonLastY[button] = y;
long hwnd = buttonFlags[button]; long hwnd = buttonFlags[button];
SW32Window* w = windowHashtable.get ((long)hwnd); SW32Window* w = windowHashtable.get ((long)hwnd);
SWindowListener* l = listenerHashtable.get ((long)hwnd); SWindowListener* l = listenerHashtable.get ((long)hwnd);
if (w == 0 || l==0) return; if (w == 0 || l==0) return;
 End of changes. 4 change blocks. 
0 lines changed or deleted 45 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)