~ubuntu-branches/ubuntu/quantal/libgc/quantal

« back to all changes in this revision

Viewing changes to cord/de_win.c

  • Committer: Bazaar Package Importer
  • Author(s): Christoph Egger
  • Date: 2011-02-19 12:19:56 UTC
  • mfrom: (1.3.2 upstream) (0.1.5 experimental)
  • mto: This revision was merged to the branch mainline in revision 14.
  • Revision ID: james.westby@ubuntu.com-20110219121956-67rb69xlt5nud3v2
Tags: 1:7.1-5
Upload to unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
   WNDCLASS    wndclass;
52
52
   HANDLE      hAccel;
53
53
 
 
54
#  ifdef THREAD_LOCAL_ALLOC
 
55
     GC_INIT();  /* Required if GC is built with THREAD_LOCAL_ALLOC     */
 
56
                 /* Always safe, but this is used as a GC test.         */
 
57
#  endif
 
58
 
54
59
   if (!hPrevInstance)
55
60
   {
56
61
      wndclass.style          = CS_HREDRAW | CS_VREDRAW;
174
179
 
175
180
void update_cursor(void);
176
181
 
 
182
INT_PTR CALLBACK AboutBoxCallback( HWND hDlg, UINT message,
 
183
                           WPARAM wParam, LPARAM lParam )
 
184
{
 
185
   switch( message )
 
186
   {
 
187
      case WM_INITDIALOG:
 
188
           SetFocus( GetDlgItem( hDlg, IDOK ) );
 
189
           break;
 
190
 
 
191
      case WM_COMMAND:
 
192
           switch( wParam )
 
193
           {
 
194
              case IDOK:
 
195
                   EndDialog( hDlg, TRUE );
 
196
                   break;
 
197
           }
 
198
           break;
 
199
 
 
200
      case WM_CLOSE:
 
201
           EndDialog( hDlg, TRUE );
 
202
           return TRUE;
 
203
 
 
204
   }
 
205
   return FALSE;
 
206
}
 
207
 
177
208
LRESULT CALLBACK WndProc (HWND hwnd, UINT message,
178
209
                          WPARAM wParam, LPARAM lParam)
179
210
{
180
 
   static FARPROC lpfnAboutBox;
181
211
   static HANDLE  hInstance;
182
212
   HDC dc;
183
213
   PAINTSTRUCT ps;
192
222
   {
193
223
      case WM_CREATE:
194
224
           hInstance = ( (LPCREATESTRUCT) lParam)->hInstance;
195
 
           lpfnAboutBox = MakeProcInstance( (FARPROC) AboutBox, hInstance );
196
225
           dc = GetDC(hwnd);
197
226
           SelectObject(dc, GetStockObject(SYSTEM_FIXED_FONT));
198
227
           GetTextMetrics(dc, &tm);
209
238
           if (wParam == QUIT) {
210
239
               SendMessage( hwnd, WM_CLOSE, 0, 0L );
211
240
           } else {
212
 
               do_command(wParam);
 
241
               do_command((int)wParam);
213
242
           }
214
243
           return(0);
215
244
      
249
278
 
250
279
               case IDM_HELPABOUT:
251
280
                  if( DialogBox( hInstance, "ABOUTBOX",
252
 
                                 hwnd, lpfnAboutBox ) )
 
281
                                 hwnd, AboutBoxCallback ) )
253
282
                     InvalidateRect( hwnd, NULL, TRUE );
254
283
                  return( 0 );
255
284
               case IDM_HELPCONTENTS:
294
323
                   SetTextColor(dc, GetSysColor(COLOR_WINDOWTEXT));
295
324
                   
296
325
                   TextOut(dc, this_line.left, this_line.top,
297
 
                           plain, len);
298
 
                   TextOut(dc, this_line.left + len * char_width, this_line.top,
299
 
                           blanks, COLS - len);
 
326
                           plain, (int)len);
 
327
                   TextOut(dc, this_line.left + (int)len * char_width,
 
328
                           this_line.top,
 
329
                           blanks, (int)(COLS - len));
300
330
                   SetBkMode(dc, TRANSPARENT);
301
331
                   SetTextColor(dc, RED);
302
332
                   TextOut(dc, this_line.left, this_line.top,
303
 
                           control, strlen(control));
 
333
                           control, (int)strlen(control));
304
334
               }
305
335
           }
306
336
           EndPaint(hwnd, &ps);
338
368
    InvalidateRect(hwnd, &line, FALSE);
339
369
}
340
370
 
341
 
LRESULT CALLBACK AboutBox( HWND hDlg, UINT message,
342
 
                           WPARAM wParam, LPARAM lParam )
343
 
{
344
 
   switch( message )
345
 
   {
346
 
      case WM_INITDIALOG:
347
 
           SetFocus( GetDlgItem( hDlg, IDOK ) );
348
 
           break;
349
 
 
350
 
      case WM_COMMAND:
351
 
           switch( wParam )
352
 
           {
353
 
              case IDOK:
354
 
                   EndDialog( hDlg, TRUE );
355
 
                   break;
356
 
           }
357
 
           break;
358
 
 
359
 
      case WM_CLOSE:
360
 
           EndDialog( hDlg, TRUE );
361
 
           return TRUE;
362
 
 
363
 
   }
364
 
   return FALSE;
365
 
}
366