comparison src/video/gem/SDL_gemwm.c @ 1662:782fd950bd46 SDL-1.3

Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API. WARNING: None of the video drivers have been updated for the new API yet! The API is still under design and very fluid. The code is now run through a consistent indent format: indent -i4 -nut -nsc -br -ce The headers are being converted to automatically generate doxygen documentation.
author Sam Lantinga <slouken@libsdl.org>
date Sun, 28 May 2006 13:04:16 +0000
parents d910939febfa
children 4da1ee79c9af
comparison
equal deleted inserted replaced
1661:281d3f4870e5 1662:782fd950bd46
38 #define ICONWIDTH 64 38 #define ICONWIDTH 64
39 #define ICONHEIGHT 64 39 #define ICONHEIGHT 64
40 40
41 /* Functions */ 41 /* Functions */
42 42
43 void GEM_SetCaption(_THIS, const char *title, const char *icon) 43 void
44 GEM_SetCaption (_THIS, const char *title, const char *icon)
44 { 45 {
45 if (title) { 46 if (title) {
46 GEM_title_name = title; 47 GEM_title_name = title;
47 GEM_refresh_name = SDL_TRUE; 48 GEM_refresh_name = SDL_TRUE;
48 } 49 }
49 50
50 if (icon) { 51 if (icon) {
51 GEM_icon_name = icon; 52 GEM_icon_name = icon;
52 GEM_refresh_name = SDL_TRUE; 53 GEM_refresh_name = SDL_TRUE;
53 } 54 }
54 } 55 }
55 56
56 void GEM_SetIcon(_THIS, SDL_Surface *icon, Uint8 *mask) 57 void
58 GEM_SetIcon (_THIS, SDL_Surface * icon, Uint8 * mask)
57 { 59 {
58 SDL_Surface *sicon; 60 SDL_Surface *sicon;
59 SDL_Rect bounds; 61 SDL_Rect bounds;
60 62
61 #if 0 63 #if 0
62 if ((GEM_wfeatures & (1<<WF_ICONIFY))==0) { 64 if ((GEM_wfeatures & (1 << WF_ICONIFY)) == 0) {
63 return; 65 return;
64 } 66 }
65 #endif 67 #endif
66 68
67 if (icon == NULL) { 69 if (icon == NULL) {
68 return; 70 return;
69 } 71 }
70
71 /* Convert icon to the screen format */
72 sicon = SDL_CreateRGBSurface(SDL_SWSURFACE, icon->w, icon->h,
73 VDI_bpp, VDI_redmask, VDI_greenmask, VDI_bluemask, 0);
74 if ( sicon == NULL ) {
75 return;
76 }
77 72
78 bounds.x = 0; 73 /* Convert icon to the screen format */
79 bounds.y = 0; 74 sicon = SDL_CreateRGBSurface (SDL_SWSURFACE, icon->w, icon->h,
80 bounds.w = icon->w; 75 VDI_bpp, VDI_redmask, VDI_greenmask,
81 bounds.h = icon->h; 76 VDI_bluemask, 0);
82 if ( SDL_LowerBlit(icon, &bounds, sicon, &bounds) < 0 ) { 77 if (sicon == NULL) {
83 SDL_FreeSurface(sicon); 78 return;
84 return; 79 }
85 }
86 80
87 GEM_icon = sicon; 81 bounds.x = 0;
82 bounds.y = 0;
83 bounds.w = icon->w;
84 bounds.h = icon->h;
85 if (SDL_LowerBlit (icon, &bounds, sicon, &bounds) < 0) {
86 SDL_FreeSurface (sicon);
87 return;
88 }
89
90 GEM_icon = sicon;
88 } 91 }
89 92
90 int GEM_IconifyWindow(_THIS) 93 int
94 GEM_IconifyWindow (_THIS)
91 { 95 {
92 if ((GEM_wfeatures & (1<<WF_ICONIFY))==0) 96 if ((GEM_wfeatures & (1 << WF_ICONIFY)) == 0)
93 return 0; 97 return 0;
94 98
95 GEM_message[0] = WM_ICONIFY; 99 GEM_message[0] = WM_ICONIFY;
96 GEM_message[1] = gl_apid; 100 GEM_message[1] = gl_apid;
97 GEM_message[2] = 0; 101 GEM_message[2] = 0;
98 GEM_message[3] = GEM_handle; 102 GEM_message[3] = GEM_handle;
99 GEM_message[4] = 0; 103 GEM_message[4] = 0;
100 GEM_message[5] = GEM_desk_h-ICONHEIGHT; 104 GEM_message[5] = GEM_desk_h - ICONHEIGHT;
101 GEM_message[6] = ICONWIDTH; 105 GEM_message[6] = ICONWIDTH;
102 GEM_message[7] = ICONHEIGHT; 106 GEM_message[7] = ICONHEIGHT;
103 107
104 appl_write(gl_apid, sizeof(GEM_message), GEM_message); 108 appl_write (gl_apid, sizeof (GEM_message), GEM_message);
105 109
106 return 1; 110 return 1;
107 } 111 }
108 112
109 SDL_GrabMode GEM_GrabInput(_THIS, SDL_GrabMode mode) 113 SDL_GrabMode
114 GEM_GrabInput (_THIS, SDL_GrabMode mode)
110 { 115 {
111 return SDL_GRAB_OFF; 116 return SDL_GRAB_OFF;
112 } 117 }
118
119 /* vi: set ts=4 sw=4 expandtab: */