static void msf_sas_create_progressbar (msf_sas_handle_t* handle, msf_sas_op_t *op) { msf_sas_window_t *bar_window = get_new_window (handle, op); msf_sas_action_t *action_cancel = get_new_action(handle, bar_window); extern kal_bool widget_allow_create_new_MMI_screen(void); ctk_screen_handle screen_id; MsfPosition pos = {0, 0}; if (widget_allow_create_new_MMI_screen() == KAL_FALSE) { ASSERT(0); return; } bar_window->handle = HDIa_widgetExtCreateProgressView(handle->modid, MSF_STR_ID_SAS_BAR_TITLE, WAP_IMAGE_WAP_LOGO, KAL_TRUE); msf_sas_update_progressbar(handle, op); /* Create a Cancel action. */ action_cancel->handle = MSF_WIDGET_ACTION_CREATE (handle->modid, MSF_WIDGET_STRING_GET_PREDEFINED(MSF_STR_ID_SAS_ACTION_CANCEL), MsfCancel, 3, MSF_ACTION_PROPERTY_ENABLED); /* MSF_WIDGET_ADD_ACTION (bar_window->handle, action_cancel->handle); */ HDIa_widgetScreenAddWindow(op->screen, bar_window->handle, &pos, 0, 0); screen_id = HDIa_widgetCtkGetScreenHandle(bar_window->handle); ctk_screen_addRSK_UA(screen_id, STR_GLOBAL_CANCEL, 0, NULL, msf_sas_progressbar_cancel_hdlr, KAL_TRUE); HDIa_widgetSetInFocus(op->screen, TRUE); HDIa_widgetSetInFocus(bar_window->handle, TRUE); HDIa_widgetExtPaintDirectly(); return; }
static void msf_sas_create_error_dialog (msf_sas_handle_t* handle, msf_sas_op_t *op, MsfStringHandle message) { MsfPosition null_pos = {0, 0}; msf_sas_window_t *message_window = get_new_window (handle, op); msf_sas_action_t *action_ok = get_new_action(handle, message_window); message_window->handle = MSF_WIDGET_DIALOG_CREATE (handle->modid, message, MsfError, 0, 0, 0); MSF_WIDGET_SET_TITLE (message_window->handle, MSF_WIDGET_STRING_GET_PREDEFINED(MSF_STR_ID_SAS_ERROR_TITLE)); MSF_WIDGET_WINDOW_SET_PROPERTIES (message_window->handle,MSF_WINDOW_PROPERTY_TITLE); /* Create an Ok action. */ action_ok->handle = MSF_WIDGET_ACTION_CREATE (handle->modid, MSF_WIDGET_STRING_GET_PREDEFINED(MSF_STR_ID_DLG_ACTION_OK), MsfOk, 3, MSF_ACTION_PROPERTY_ENABLED); MSF_WIDGET_ADD_ACTION (message_window->handle, action_ok->handle); MSF_WIDGET_SCREEN_ADD_WINDOW (op->screen, message_window->handle, &null_pos, 0, 0); MSF_WIDGET_SET_IN_FOCUS (op->screen, 1); MSF_WIDGET_SET_IN_FOCUS (message_window->handle, 1); HDIa_widgetExtPaintDirectly(); }
void mainEventLoop() { XEvent event; int Xcon; fd_set rd, dum1, dum2; motion = 0; gActiveWindow = -1; set_error_handlers(); Xcon = ConnectionNumber(gXDisplay); while (1) { /* fprintf(stderr,"event:mainEventLoop: loop top\n");*/ while (gSessionHashTable.num_entries == 0) pause(); /* XFlush(gXDisplay); */ if (!motion) init_cursor_states(); motion = 0; if (!spad_socket == 0) { FD_ZERO(&rd); FD_ZERO(&dum1); FD_ZERO(&dum2); FD_CLR(0, &dum1); FD_CLR(0, &dum2); FD_CLR(0, &rd); FD_SET(spad_socket->socket, &rd); FD_SET(Xcon, &rd); if (!session_server == 0) { FD_SET(session_server->socket, &rd); } if (XEventsQueued(gXDisplay, QueuedAlready)) { XNextEvent(gXDisplay, &event); handle_event(&event); } else { select(FD_SETSIZE, &rd, &dum1, &dum2, NULL); if (FD_ISSET(Xcon, &rd) || XEventsQueued(gXDisplay, QueuedAfterFlush)) { XNextEvent(gXDisplay, &event); handle_event(&event); } else if (FD_ISSET(spad_socket->socket, &rd)) /* * Axiom Socket do what handle_event does The 100 is * $SpadStuff in hypertex.boot */ { if (100 == get_int(spad_socket)) { set_window(gParentWindow->fMainWindow); make_busy_cursors(); get_new_window(); } } /* * Session Socket Telling us about the death of a spadbuf * (plus maybe more later) service_session_socket in * spadint.c */ else if (session_server && FD_ISSET(session_server->socket, &rd)) { service_session_socket(); } } } else { XNextEvent(gXDisplay, &event); handle_event(&event); } } }