|
|
| version 1.2, 2004/07/15 14:24:33 | version 1.4, 2007/01/02 16:41:48 |
|---|---|
| Line 10 | Line 10 |
| * 2. Redistributions in binary form must reproduce the above copyright | * 2. Redistributions in binary form must reproduce the above copyright |
| * notice, this list of conditions and the following disclaimer in the | * notice, this list of conditions and the following disclaimer in the |
| * documentation and/or other materials provided with the distribution. | * documentation and/or other materials provided with the distribution. |
| * 3. The name of the author may not be used to endorse or promote products | |
| * derived from this software without specific prior written permission. | |
| * | * |
| * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
| * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
| Line 72 mousemng_initialize(void) | Line 70 mousemng_initialize(void) |
| ms = ms_default; | ms = ms_default; |
| ms.cursor_pixmap = gdk_pixmap_create_from_data(drawarea->window, | ms.cursor_pixmap = gdk_pixmap_create_from_data(main_window->window, |
| hide_cursor, 16, 16, 1, | hide_cursor, 16, 16, 1, |
| &drawarea->style->black, &drawarea->style->black); | &main_window->style->black, &main_window->style->black); |
| ms.cursor = gdk_cursor_new_from_pixmap(ms.cursor_pixmap, | ms.cursor = gdk_cursor_new_from_pixmap(ms.cursor_pixmap, |
| ms.cursor_pixmap, &drawarea->style->black, &drawarea->style->black, | ms.cursor_pixmap, &main_window->style->black, |
| 0, 0); | &main_window->style->black, 0, 0); |
| return SUCCESS; | return SUCCESS; |
| } | } |
| Line 108 mouseonoff(int flag) | Line 106 mouseonoff(int flag) |
| if ((ms.lastmouse ^ flag) & 1) { | if ((ms.lastmouse ^ flag) & 1) { |
| ms.lastmouse = flag & 1; | ms.lastmouse = flag & 1; |
| if (ms.lastmouse) { | if (ms.lastmouse) { |
| gdk_pointer_grab(drawarea->window, TRUE, 0, | gdk_pointer_grab(main_window->window, TRUE, 0, |
| drawarea->window, ms.cursor, 0); | main_window->window, ms.cursor, 0); |
| getmaincenter(drawarea, &curx, &cury); | getmaincenter(main_window, &curx, &cury); |
| gdk_window_set_pointer(drawarea->window, curx, cury); | gdk_window_set_pointer(main_window->window, curx, cury); |
| } else { | } else { |
| gdk_pointer_ungrab(0); | gdk_pointer_ungrab(0); |
| } | } |
| Line 157 mousemng_callback(void) | Line 155 mousemng_callback(void) |
| int cx, cy; | int cx, cy; |
| if (ms.lastmouse & 1) { | if (ms.lastmouse & 1) { |
| gdk_window_get_pointer(drawarea->window, &wx, &wy, NULL); | gdk_window_get_pointer(main_window->window, &wx, &wy, NULL); |
| getmaincenter(drawarea, &cx, &cy); | getmaincenter(main_window, &cx, &cy); |
| ms.mousex += (short)((wx - cx) / 2); | ms.mousex += (short)((wx - cx) / 2); |
| ms.mousey += (short)((wy - cy) / 2); | ms.mousey += (short)((wy - cy) / 2); |
| gdk_window_set_pointer(drawarea->window, cx, cy); | gdk_window_set_pointer(main_window->window, cx, cy); |
| } | } |
| } | } |