Ejemplo n.º 1
0
void on_Restore_clicked_event		(GtkButton       *button,
                                        gpointer         user_data)
{
	if(TRUE == SigDisable()){
		RestoreDefault();
	}
	SigEnable();
}
Ejemplo n.º 2
0
void ShowDialog(const char *dialog, const int print)
{
	GtkWidget *widget = NULL, *parent = NULL;
	char *str = NULL;
	SpecialInfo* special = NULL;
	char* printer_name = NULL;
	widget = glade_xml_get_widget(g_cngplp_xml, dialog);
	if(NULL == widget){
		return;
	}
	SigDisable();
	if(g_config_file_data != NULL){
		special = g_config_file_data->special_list;
	}
	while(special != NULL){
		if((1 == special->type) && (0 == strcasecmp(special->name, dialog))){
			special->print = print;
			if(special->parent != NULL){
				if(0 == strcasecmp(special->parent, g_main_dlg_name)){
					str = cngplpGetData(g_cngplp_data, ID_PPD_OPTION);
					UpdateAllPPDWidgets(str);
					memFree(str);
					printer_name = GetCurrOpt(g_cngplp_data, ID_PRINTERNAME, NULL);
					gtk_window_set_title(GTK_WINDOW(widget), printer_name);
					memFree(printer_name);
					if(g_main_dlg != NULL){
						gtk_window_set_transient_for(GTK_WINDOW(widget), GTK_WINDOW(g_main_dlg));
					}
					ChangeShowPage(0);
				}else{
					UpdateTopWidget(dialog);
					parent = glade_xml_get_widget(g_cngplp_xml, special->parent);
					if(parent != NULL){
						gtk_window_set_transient_for(GTK_WINDOW(widget), GTK_WINDOW(parent));
					}
					if((NULL == parent) && (g_main_dlg != NULL)){
						gtk_window_set_transient_for(GTK_WINDOW(widget), GTK_WINDOW(g_main_dlg));
					}
				}
			}
			if(!special->print){
				if(special->conflict_list != NULL){
					UpdateFunctionWidget(special->conflict_list);
				}
			}
			SaveTopWidgetData(dialog);
			gtk_widget_show(widget);
			break;
		}
		special = special->next;
	}
	SigEnable();
	gtk_main();
}
Ejemplo n.º 3
0
void on_Cancel_clicked_event		(GtkButton       *button,
                                        gpointer         user_data)
{
	const char *dlg_name = (char *)user_data;

	if(dlg_name != NULL){
		if(TRUE == SigDisable()){
			HideDialog(dlg_name, FALSE);
		}
		SigEnable();
	}
}
void ShowCalibrationSettingsDlg(UIStatusWnd *wnd)
{
	if(wnd != NULL){
		if(GetDefaultCalibrationSettings(wnd) == 0){
			SigDisable();
			InitCalibrationSettingsDlgWidgets(wnd);
			SigEnable();

			ShowDialog((UIDialog *)wnd->calibration_Settings_dlg, NULL);
		}
	}
}
Ejemplo n.º 5
0
void
on_combo_entry_changed     (GtkEditable     *editable,
                            gpointer         user_data)
{
    CombData *data;
    data = (CombData *)user_data;
    if(TRUE == SigDisable()) {
        if((data != NULL) && (FALSE == data->mapped)) {
            UpdateDataCombo(data->id, data->widget_name);
        }
    }
    SigEnable();
}
Ejemplo n.º 6
0
gboolean
on_delete_event                (GtkWidget       *widget,
                                        GdkEvent        *event,
                                        gpointer         user_data)
{
	const char *dlg_name = (char*)user_data;
	if(dlg_name != NULL){
		if(TRUE == SigDisable()){
			HideDialog(dlg_name, FALSE);
		}
		SigEnable();
	}
	return TRUE;
}
Ejemplo n.º 7
0
void ShowResetUnitDlg(UIStatusWnd *wnd)
{
	switch(wnd->nIFVersion){
	case CCPD_IF_VERSION_110:
		{
			if(GetResetUnitDlgData(wnd))
				return;
			SigDisable();
			InitResetUnitDlgWidgets(wnd);
			SigEnable();
		}
		break;
	case CCPD_IF_VERSION_100:
	default:
		break;
	}
	ShowDialog((UIDialog *)wnd->resetunit_dlg, NULL);
}
Ejemplo n.º 8
0
void
on_checkbutton_toggled       (GtkToggleButton *togglebutton,
                                        gpointer         user_data)
{
	const CheckData *data = (CheckData *)user_data;
	if(TRUE == SigDisable()){
		if((data != NULL) && (data->toggle != NULL) && (data->untoggle != NULL)){
			if(TRUE == togglebutton->active){
				UpdateData(data->id, data->toggle);
			}else{
				UpdateData(data->id, data->untoggle);
			}
		}else{
			UpdateDataCheck(data->id, (int)togglebutton->active);
		}
	}
	SigEnable();
}
Ejemplo n.º 9
0
gboolean
on_combo_down_up_event   (GtkWidget     *widget,
                          GdkEvent       *event,
                          gpointer       user_data)
{
    CombData *data;
    data = (CombData *)user_data;
    if((data != NULL) && (event != NULL)) {
        if((GDK_Down == event->key.keyval) || (GDK_KP_Down == event->key.keyval) ||
                (GDK_Up == event->key.keyval) || (GDK_KP_Up == event->key.keyval)) {
            data->mapped = TRUE;
            if(TRUE == SigDisable()) {
                UpdateDataCombo(data->id, data->widget_name);
            }
            SigEnable();
        }
    }
    return FALSE;
}
Ejemplo n.º 10
0
gboolean
on_combo_popwin_event	(GtkWidget     *widget,
                         GdkEvent       *event,
                         gpointer       user_data)
{
    CombData *data;
    data = (CombData *)user_data;
    if((data != NULL) && (event != NULL)) {
        if(GDK_MAP == event->type) {
            data->mapped = TRUE;
        }
        if(GDK_UNMAP == event->type) {
            data->mapped = FALSE;
            if(TRUE == SigDisable()) {
                UpdateDataCombo(data->id, data->widget_name);
            }
            SigEnable();
        }
    }
    return FALSE;
}
Ejemplo n.º 11
0
void ShowMsgDlg(UIStatusWnd *wnd, int type)
{
	wnd->msg_dlg = CreateMsgDlg(UI_DIALOG(wnd));

	SigDisable();
	UpdateMsgDlgWidgets(wnd, type);
	SigEnable();

	gtk_window_set_transient_for(
		GTK_WINDOW(UI_DIALOG(wnd->msg_dlg)->window),
		GTK_WINDOW(UI_DIALOG(wnd->msg_dlg)->parent->window));

	switch(type){
	case MSG_TYPE_PRINT_PPAP:
		gtk_widget_show(UI_DIALOG(wnd->msg_dlg)->window);
		break;
	default:
		ShowDialog((UIDialog *)wnd->msg_dlg, NULL);
		break;
	}
}
Ejemplo n.º 12
0
void ShowSleepSettingDlg(UIStatusWnd *wnd)
{
	unsigned short timer;

	switch(wnd->nIFVersion){
	case CCPD_IF_VERSION_110:
		if(GetSleepTime2(wnd, &timer))
			return;
		break;
	case CCPD_IF_VERSION_100:
	default:
		if(GetSleepTime(wnd, &timer))
			return;
		break;
	}

	SigDisable();
	InitSleepSettingDlgWidgets(wnd, timer);
	SigEnable();

	ShowDialog((UIDialog *)wnd->sleeps_dlg, NULL);
}
Ejemplo n.º 13
0
int StartProcess2(mode)
{
    gint PollingFlag = 0;
    gint RequestFlag = 0;

    SigDisable();
    UpdateWidgets2(g_status_window);
    SigEnable();

    if(mode)
        gtk_widget_show(UI_DIALOG(g_status_window)->window);

    PollingFlag = gtk_timeout_add(POLLING_COUNT, (GtkFunction)DataProcess2, NULL);
    RequestFlag = gtk_timeout_add(REQUEST_COUNT, (GtkFunction)StatusRequest, NULL);
    gtk_main ();

    if(PollingFlag)
        gtk_timeout_remove(PollingFlag);
    if(RequestFlag)
        gtk_timeout_remove(RequestFlag);

    return 0;
}
Ejemplo n.º 14
0
void ShowTonerReplacementDlg(UIStatusWnd *wnd)
{
	pthread_t thread;

	if(wnd != NULL){
		SigDisable();
		InitTonerReplacementDlgWidgets(wnd);
		SigEnable();

		if(GetPossibleChangeValueAtAlertCode(wnd->pAlertCode) == TRUE){
			UpdateJob(REQ_UPDATE_CONSUMABLESINFO_OF_TONERREPLACEMENT);
			ChangeToTonerReplaceMode(wnd, &thread);

			g_timer_tag = gtk_timeout_add(TIMER_INTERVAL, (GtkFunction)UpdateTimerFunc, wnd);
			pthread_join(thread, NULL);
			if(wnd->toner_replacement_dlg->modeChangeRetCode == RET_NORMAL){
				ShowDialog((UIDialog *)wnd->toner_replacement_dlg, NULL);
			}
		}else{
			ShowMsgDlg(wnd, MSG_TYPE_COMMUNICATION_ERR_GET);
		}
	}
}
Ejemplo n.º 15
0
/* Don't static for INLINE */
void
thrSwitch( Thread t )
{
/*	register Thread	run_thread = ThrRunningThread ; */
  volatile Thread run_thread;
  run_thread = ThrRunningThread;

	run_thread->errno = errno ;
	run_thread->debugFlags = OzDebugFlags ;
	if ( SETJMP(run_thread->context) ) {
		while ( thrDefunctThreads ) {
			register Thread defunct ;
			defunct = thrDefunctThreads ;
			thrDefunctThreads = thrDefunctThreads->next ;
			stkFree( defunct->stack, defunct->stack_size ) ;
			defunct->status = FREE ;
			defunct->next = thrFreeThreads ;
			thrFreeThreads = defunct ;
		}
/*		errno = run_thread->errno ;
		OzDebugFlags = run_thread->debugFlags ;
*/
		return ;			/* to signaled pc */
	}

	ThrRunningThread = t ;
	t->status = RUNNING ;
	errno = t->errno ;
	OzDebugFlags = t->debugFlags ;

	run_thread->sigBlocking = sigBlocking ;
	if (run_thread->sigBlocking && !t->sigBlocking)
		SigDisable() ;
	else if (!run_thread->sigBlocking && t->sigBlocking)
		thrAllocSignalStack( &(t->signal_stack) ) ;

	if (!run_thread->sigBlocking || !t->sigBlocking)
		SIGSTACK(&(t->signal_stack), &(run_thread->signal_stack));
	else if ( t != run_thread ) {
		t->signal_stack = run_thread->signal_stack ;
		run_thread->signal_stack.ss_sp = NULL ;
		SIGSTACK_FLAGS(run_thread->signal_stack) = 0 ;
	}

	sigBlocking = t->sigBlocking;
	if (run_thread->sigBlocking && !t->sigBlocking) {
		thrFreeSignalStack( &(run_thread->signal_stack) );
	} else if (!run_thread->sigBlocking && t->sigBlocking) {
		SigEnable() ;
	}

	if ( t->first ) {	/* first dispatch */
		register void	(*pc)() ;
		register void	*sp ;
#if	defined(SVR4)
	sp = (char *)t->context[1] ;
	pc = (void (*))t->context[2] ;
#else	/* SVR4 */
	sp = (char *)t->context[2] ;
	pc = (void (*))t->context[3] ;
#endif	/* SVR4 */
		t->first = 0 ;
		thrJumpThread( thrStart, pc, ThrExit, sp ) ;
		/* NOT REACHED */
	}
	LONGJMP( t->context, 1 ) ;
	/* NOT REACHED */
}