comparison src/video/photon/SDL_ph_mouse.c @ 663:8bedd6d61642

Date: Sat, 2 Aug 2003 16:22:51 +0300 From: "Mike Gorchak" Subject: New patches for QNX6 Here my patches for the SDL/QNX: QNXSDL.diff - diff to non-QNX related sources: - updated BUGS file, I think QNX6 is now will be officially supported - configure.in - added shared library support for QNX, and removed dependency between the ALSA and QNX6. - SDL_audio.c - added QNX NTO sound bootstrap insted of ALSA's. - SDL_sysaudio.h - the same. - SDL_nto_audio.c - the same. - SDL_video.c - right now, QNX doesn't offer any method to obtain pointers to the OpenGL functions by function name, so they must be hardcoded in library, otherwise OpenGL will not be supported. - testsprite.c - fixed: do not draw vertical red line if we are in non-double-buffered mode. sdlqnxph.tar.gz - archive of the ./src/video/photon/* . Too many changes in code to make diffs :) : + Added stub for support hide/unhide window event + Added full YUV overlays support. + Added window maximize support. + Added mouse wheel events. + Added support for some specific key codes in Unicode mode (like ESC). + Added more checks to the all memory allocation code. + Added SDL_DOUBLEBUF support in all fullscreen modes. + Added fallback to window mode, if desired fullscreen mode is not supported. + Added stub support for the GL_LoadLibrary and GL_GetProcAddress functions. + Added resizable window support without caption. ! Fixed bug in the Ph_EV_EXPOSE event handler, when rectangles to update is 0 and when width or height of the rectangle is 0. ! Fixed bug in the event handler code. Events has not been passed to the window widget handler. ! Fixed codes for Win keys (Super/Hyper/Menu). ! Fixed memory leak, when deallocation palette. ! Fixed palette emulation code bugs. ! Fixed fullscreen and hwsurface handling. ! Fixed CLOSE button bug. First event was passed to the handler, but second terminated the application. Now all events passed to the application correctly. - Removed all printfs in code, now SDL_SetError used instead of them. - Disabled ToggleFullScreen function. README.QNX - updated README.QNX file. Added much more issues.
author Sam Lantinga <slouken@libsdl.org>
date Mon, 04 Aug 2003 00:52:42 +0000
parents 8e3ce997621c
children aaf3b8af6616
comparison
equal deleted inserted replaced
662:66c02f83f5bf 663:8bedd6d61642
44 { 44 {
45 if (window != NULL) 45 if (window != NULL)
46 { 46 {
47 SDL_Lock_EventThread(); 47 SDL_Lock_EventThread();
48 48
49 if (PtSetResource( window, Pt_ARG_CURSOR_TYPE, Ph_CURSOR_INHERIT, 0) < 0) 49 if (PtSetResource(window, Pt_ARG_CURSOR_TYPE, Ph_CURSOR_INHERIT, 0) < 0)
50 { 50 {
51 /* TODO: output error msg */ 51 /* TODO: output error msg */
52 } 52 }
53 53
54 SDL_Unlock_EventThread(); 54 SDL_Unlock_EventThread();
55 } 55 }
56 /* free(cursor->ph_cursor.images); */ 56
57 free(cursor); 57 free(cursor);
58 } 58 }
59 59
60 WMcursor *ph_CreateWMCursor(_THIS, 60 WMcursor *ph_CreateWMCursor(_THIS, Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y)
61 Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y)
62 { 61 {
63 WMcursor* cursor; 62 WMcursor* cursor;
64 int clen, i; 63 int clen, i;
65 unsigned char bit, databit, maskbit; 64 unsigned char bit, databit, maskbit;
66 65
71 return(NULL); 70 return(NULL);
72 } 71 }
73 memset(cursor,0,sizeof(WMcursor)); 72 memset(cursor,0,sizeof(WMcursor));
74 73
75 cursor->ph_cursor = (PhCursorDef_t *) malloc(sizeof(PhCursorDef_t) + 32*4*2); 74 cursor->ph_cursor = (PhCursorDef_t *) malloc(sizeof(PhCursorDef_t) + 32*4*2);
75
76 if (cursor->ph_cursor == NULL) 76 if (cursor->ph_cursor == NULL)
77 printf("cursor malloc failed\n"); 77 {
78 SDL_SetError("ph_CreateWMCursor(): cursor malloc failed !\n");
79 return NULL;
80 }
78 81
79 memset(cursor->ph_cursor,0,(sizeof(PhCursorDef_t) + 32*4*2)); 82 memset(cursor->ph_cursor,0,(sizeof(PhCursorDef_t) + 32*4*2));
80 83
81 cursor->ph_cursor->hdr.type =Ph_RDATA_CURSOR; 84 cursor->ph_cursor->hdr.type =Ph_RDATA_CURSOR;
82 cursor->ph_cursor->size1.x = (short)w; 85 cursor->ph_cursor->size1.x = (short)w;
135 if ((this->screen->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN) 138 if ((this->screen->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN)
136 { 139 {
137 return (0); 140 return (0);
138 } 141 }
139 142
140 /* Set the photon cursor cursor, or blank if cursor is NULL */ 143 /* Set the photon cursor, or blank if cursor is NULL */
141 if (cursor!=NULL) 144 if (cursor!=NULL)
142 { 145 {
143 PtSetArg(&args[0], Pt_ARG_CURSOR_TYPE, Ph_CURSOR_BITMAP, 0); 146 PtSetArg(&args[0], Pt_ARG_CURSOR_TYPE, Ph_CURSOR_BITMAP, 0);
144 /* Could set next to any PgColor_t value */ 147 /* Could set next to any PgColor_t value */
145 PtSetArg(&args[1], Pt_ARG_CURSOR_COLOR, Ph_CURSOR_DEFAULT_COLOR , 0); 148 PtSetArg(&args[1], Pt_ARG_CURSOR_COLOR, Ph_CURSOR_DEFAULT_COLOR , 0);
146 PtSetArg(&args[2], Pt_ARG_BITMAP_CURSOR, cursor->ph_cursor, (cursor->ph_cursor->hdr.len + sizeof(PhRegionDataHdr_t))); 149 PtSetArg(&args[2], Pt_ARG_BITMAP_CURSOR, cursor->ph_cursor, (cursor->ph_cursor->hdr.len + sizeof(PhRegionDataHdr_t)));
147 nargs = 3; 150 nargs = 3;
148 } 151 }
149 else /* Ph_CURSOR_NONE */ 152 else /* Ph_CURSOR_NONE */
150 { 153 {
151 PtSetArg( &args[0], Pt_ARG_CURSOR_TYPE, Ph_CURSOR_NONE, 0); 154 PtSetArg(&args[0], Pt_ARG_CURSOR_TYPE, Ph_CURSOR_NONE, 0);
152 nargs = 1; 155 nargs = 1;
153 } 156 }
154 157
155 SDL_Lock_EventThread(); 158 SDL_Lock_EventThread();
156 159