void TEST_shade_window() { char *routine = "TEST_shade_window"; printf(testing, routine); //First with a valid window Window win = active_window(); assert(shade_window(win, TRUE)); assert(shade_window(win, FALSE)); activate_window(win); //Then with an invalid window assert(shade_window(20, TRUE) == FALSE); assert(shade_window(20, FALSE) == FALSE); printf(done, routine); }
void handle_msg(int *msg) { WINDOWP window; wake_mouse(); window= get_window(msg[3]); /* Zugeh�riges Fenster */ switch (msg[0]) /* Art der Nachricht */ { case MN_SELECTED: if (makro_rec) /* Makro wird Tastendruck vorgegaukelt */ { int kstate, kreturn; char str[50]; get_string(menu, msg[4], str); if (str_to_key(str, &kstate, &kreturn)) { kstate |= (kstate & 3); to_makro(kstate, kreturn); } } handle_menu(msg[3], msg[4], menu_ctrl); menu_ctrl = FALSE; break; case WM_REDRAW : if (msg[3] == akt_handle) redraw_aktion(); else redraw_window (window, (GRECT*)(msg+4)); break; case WM_CLOSED : do_icon(window->handle, DO_DELETE); break; case WM_FULLED : full_window (window); break; case WM_ARROWED : arrow_window (window, msg[4], 1); break; case WM_HSLID : h_slider (window, msg[4]); break; case WM_VSLID : v_slider (window, msg[4]); break; case WM_SIZED : size_window (window, (GRECT*)(msg+4), TRUE); break; case WM_MOVED : move_window (window, (GRECT*)(msg+4)); break; case WM_NEWTOP : /* Fenster von qed ist irgendwie nach oben gekommen */ case WM_ONTOP : ontop_window(window); break; case WM_TOPPED : top_window (window); break; case WM_UNTOPPED: /* qed hat jetzt nicht mehr das Top-Fenster */ untop_window (window); break; case WM_BOTTOMED: /* AES 4.00 MagiC 3 : Fenster nach hinten */ case WM_M_BDROPPED : /* Magic 2 */ bottom_window (window, msg[0]); break; case WM_ICONIFY: iconify_window(window, (GRECT*)(msg+4)); break; case WM_ALLICONIFY: all_iconify(window, (GRECT*)(msg+4)); break; case WM_UNICONIFY: if (all_iconified) all_uniconify(NULL, (GRECT*)(msg+4)); else uniconify_window(window, (GRECT*)(msg+4)); break; case WM_SHADED : case WM_UNSHADED : shade_window(window, msg[0]); break; case AP_TERM: if (all_iconified) all_uniconify(NULL, NULL); quick_close = TRUE; if (prepare_quit()) do_quit(); break; case AP_DRAGDROP : if (all_iconified) Bconout(2, 7); else handle_dd(msg); break; case SC_CHANGED : /* * Ignorieren, da wir vor dem Paste sowieso neu laden. */ break; case VA_START : case VA_PROTOSTATUS : case VA_DRAG_COMPLETE : case VA_DRAGACCWIND : case AV_SENDKEY : handle_av(msg); break; case SE_INIT: case SE_OK: case SE_ACK: case SE_OPEN: case SE_ERROR: case SE_ERRFILE: case SE_PROJECT: case SE_QUIT: case SE_TERMINATE: case SE_CLOSE : case SE_MENU : if (all_iconified) all_uniconify(NULL, NULL); handle_se(msg); break; case OLGA_INIT : case OLE_NEW : case OLGA_ACK : case OLE_EXIT : handle_olga(msg); break; case SH_WDRAW: /* schickt Freedom st�ndig */ case DHST_ACK: /* SMU antwortet */ /* ignore */ break; case FONT_CHANGED : if (msg[4] != 0) font_id = msg[4]; if (msg[5] != 0) font_pts = msg[5]; font_change(); break; default: if (debug_level) { char str[12]; int d, i, id; if ((appl_xgetinfo(4, &d, &d, &i, &d)) && (i == 1)) /* gibts appl_search? */ { i = appl_search(0, str, &d, &id); while (i != 0) { if (id == msg[1]) break; i = appl_search( 1, str, &d, &id); } } else { strcpy(str, ""); id = msg[1]; } debug("Unbekannte Msg %d (0x%X) von %s (%d)\n", msg[0], msg[0], str, id); } break; } }