/*--------------------------------------*/
void HideColorDialog2(UIColorDialog2* dialog, gboolean apply)
{
	/* Ver.2.80 */
	GtkWidget* window = UI_DIALOG(dialog)->window;

	if( apply )
	{
		/* Ver.2.90 */
		dialog->cyan_balance = (short)atoi( gtk_entry_get_text( GTK_ENTRY( LookupWidget( window , "c_dlg_c_value_spin2") ) ) );
		dialog->magenta_balance = (short)atoi( gtk_entry_get_text( GTK_ENTRY( LookupWidget( window , "c_dlg_m_value_spin2") ) ) );
		dialog->yellow_balance = (short)atoi( gtk_entry_get_text( GTK_ENTRY( LookupWidget( window , "c_dlg_y_value_spin2") ) ) );
		dialog->density_balance = (short)atoi( gtk_entry_get_text( GTK_ENTRY( LookupWidget( window , "c_dlg_density_value_spin2") ) ) );
		dialog->contrast_balance = (short)atoi( gtk_entry_get_text( GTK_ENTRY( LookupWidget( window , "c_dlg_contrast_value_spin2") ) ) );
		/* Ver.3.40 */
		dialog->tone_balance = (short)atoi( gtk_entry_get_text( GTK_ENTRY( LookupWidget( window , "c_dlg_tone_value_spin2") ) ) );

		dialog->vivid
			= GTK_TOGGLE_BUTTON(LookupWidget(UI_DIALOG(dialog)->window,
					"color_dialog_vivid_button2"))->active;

		/* CNCL_INTENT : Set current setting */
		dialog->color_correct = GetCurrentnValue(CNCL_INTENT);
		/* CNCL_INPUT_GAMMA : Set current setting */
		dialog->gamma = GetCurrentnValue(CNCL_INPUT_GAMMA);
	}
	else	
	{	/* "Cancel" -> Recover parameters. */
		UpdateMenuLink(CNCL_INPUT_GAMMA, dialog->gamma);
		UpdateMenuLink(CNCL_INTENT, dialog->color_correct);
	}

	HideDialog((UIDialog*)dialog);
}
static void
update_by_media_type_entry()
{
	GtkWidget* window = UI_DIALOG(g_main_window)->window;
	GtkWidget* entry = LookupWidget(window, "media_type_entry");
	short type_value = NameToValue(CNCL_MEDIATYPE, 
				(char*)gtk_entry_get_text(GTK_ENTRY(entry)));

	// Save current supply value.
	short supply_value = GetCurrentnValue(CNCL_MEDIASUPPLY);

	UpdateMenuLink(CNCL_MEDIATYPE, type_value);


	// If changed the supply value, show the alert.
	if( supply_value != GetCurrentnValue(CNCL_MEDIASUPPLY) )
	{
		confirm_media_supply_change(supply_value);
	}

	UpdateWidgets(window, "media_type_combo");
#ifdef	GUI_WITH_PIXMAPS
	UpdateDrawingArea(window, "basic_draw_area");
#endif
	g_media_type_entry_changed = FALSE;
}
void SetQualityCustomValue(void* param)
{
	UIQualityDialog* dialog = (UIQualityDialog*)param;

	dialog->print_quality = GetCurrentnValue(CNCL_PRINTQUALITY);
	dialog->bin_method = GetCurrentnValue(CNCL_DITHER_PAT);
}
static void
update_by_cartridge_type_entry()
{
	GtkWidget* window = UI_DIALOG(g_main_window)->window;
	GtkWidget* entry = LookupWidget(window, "cartridge_type_entry");
	short new_cartridge_value = NameToValue(CNCL_CARTRIDGE, 
						(char*)gtk_entry_get_text(GTK_ENTRY(entry)));
	short media_type_value = GetCurrentnValue(CNCL_MEDIATYPE);

	if( !IsAvailableMedia(g_mediatype_dialog,
			media_type_value, new_cartridge_value) )
	{
		short new_media_type_value;

		if( (new_media_type_value = ShowMediaTypeDialog(g_mediatype_dialog,
			media_type_value, new_cartridge_value)) != -1 )
		{
			UpdateMenuLink(CNCL_MEDIATYPE, new_media_type_value);
			UpdateMenuLink(CNCL_CARTRIDGE, new_cartridge_value);

#ifdef NEED_TO_SAVE_GRAYSCALE
			if( GetCurrentnValue(CNCL_GRAYSCALE) != CND_BJGRAYSCALE_GRAY )
			{
				short gray_scale_value = IsGrayPrint(g_main_window)?
						CND_BJGRAYSCALE_ON : CND_BJGRAYSCALE_OFF;

				UpdateMenuLink(CNCL_GRAYSCALE, gray_scale_value);
			}
#endif
			UpdateWidgets(window, "cartridge_type_combo");
		}
		else
		{
			UpdateWidgets(window, NULL);
		}
	}
	else
	{
		UpdateMenuLink(CNCL_CARTRIDGE, new_cartridge_value);

#ifdef NEED_TO_SAVE_GRAYSCALE
		if( GetCurrentnValue(CNCL_GRAYSCALE) != CND_BJGRAYSCALE_GRAY )
		{
			short gray_scale_value = IsGrayPrint(g_main_window)?
				CND_BJGRAYSCALE_ON : CND_BJGRAYSCALE_OFF;

			UpdateMenuLink(CNCL_GRAYSCALE, gray_scale_value);
		}
#endif
		UpdateWidgets(window, "cartridge_type_combo");
	}

#ifdef	GUI_WITH_PIXMAPS
	UpdateDrawingArea(window, "basic_draw_area");
#endif
	g_cartridge_type_entry_changed = FALSE;
}
void
on_ok_button_clicked                   (GtkButton       *button,
                                        gpointer         user_data)
{
	BJFLTDEVICE bjdev;
	BJFLTCOLORSYSTEM bjcolor;
	BJFLT_UISETUP uisetup;
	CNCLPAPERSIZE psize;
	IPCU ipc;
	gboolean change_item;
	short thick_value;

	// Get paper margin.
	GetMargin(&psize);

	SetBJFltDevice(&bjdev);

	// Save the thickness value.
	thick_value = GetCurrentnValue(CNCL_MESS_THICK);

	// Check Media type and Media size combination.
	if( CheckMediaSizeCombination(&bjdev, &change_item) != TRUE )
		return;

	if( change_item )
	{
		// If change the thickness, show alert.
		if( thick_value != GetCurrentnValue(CNCL_MESS_THICK) )
			ShowLeverPositionAlert();

		// Get paper margin.
		GetMargin(&psize);

		SetBJFltDevice(&bjdev);
	}

	SetBJFltColorSystem(&bjcolor);

	// Make uisetup data.
	SetUISetup(&uisetup);

	// Then prepare for IPC

	memcpy(&ipc.parm.bjfltdev, &bjdev, sizeof(BJFLTDEVICE));
	memcpy(&ipc.parm.papersize, &psize, sizeof(CNCLPAPERSIZE));
	memcpy(&ipc.parm.bjfltcolor, &bjcolor, sizeof(BJFLTCOLORSYSTEM));
	memcpy(&ipc.parm.bjflt_uisetup, &uisetup, sizeof(BJFLT_UISETUP));

	if( g_socketname != NULL )
	{	// client mode

		PutIPCData(&ipc);
	}
	gtk_main_quit();
}
UIMainDialog* CreateMainWindow()
{
	short supply_value;
	short margin_value;
	UIMainDialog* main_window
		= (UIMainDialog*)CreateDialog(sizeof(UIMainDialog), NULL);

#ifdef	USE_LIB_GLADE
	UI_DIALOG(main_window)->window = LookupWidget(NULL, "ui_window");
#else
	UI_DIALOG(main_window)->window = create_ui_window();
#endif

	// Get initial paper size.
	main_window->init_paper_size = GetCurrentnValue(CNCL_PAPERSIZE);

	// Initialize auto color adjustment.
	main_window->color_auto = TRUE;

	// Initialize printing type, etc.
	main_window->printing_type = g_printing_type_value[0];
	main_window->scaling = 100;
	main_window->centering = LOCATION_UPPERLEFT;
	main_window->ext_border = GetDefaultExtBorder(g_model_id);
	main_window->stapleside = STAPLESIDE_LONG;
	main_window->copies = 1;

	// Save current supply & margin value .
	supply_value = GetCurrentnValue(CNCL_MEDIASUPPLY);
	margin_value = GetCurrentnValue(CNCL_MARGINTYPE);

	// Store ASF supply value.
	UpdateMenuLink(CNCL_MEDIASUPPLY, CND_SUPPLY_ASF);

	// Save list.
	g_paper_size_list = GetComboList(CNCL_PAPERSIZE);

	// Store ASF supply value.
	UpdateMenuLink(CNCL_MARGINTYPE, CND_MARGIN_MINUS);

	// Save list.
	g_paper_size_margin_list = GetComboList(CNCL_PAPERSIZE);

	// Store current supply value.
	UpdateMenuLink(CNCL_MARGINTYPE, margin_value);
	UpdateMenuLink(CNCL_MEDIASUPPLY, supply_value);

	// Save current paper size value.
	g_paper_size_value = GetCurrentnValue(CNCL_PAPERSIZE);

	// Save current duplex printing
	g_duplex_value = GetCurrentnValue(CNCL_DUPLEX_PRINTING);

	return main_window;
}
static void SetBJFltDevice(LPBJFLTDEVICE bjdev)
{
	memset(bjdev, 0, sizeof(BJFLTDEVICE));

	// Prepare for BJFLTDEVICE structure.
	bjdev->bjfltModelID      = g_uidb.ModelID;
	bjdev->bjfltMediaType    = GetCurrentnValue(CNCL_MEDIATYPE);
	bjdev->bjfltPrintQuality = GetCurrentnValue(CNCL_PRINTQUALITY);
	bjdev->bjfltMediaSupply  = GetCurrentnValue(CNCL_MEDIASUPPLY);
	bjdev->bjfltPaperSize    = GetCurrentnValue(CNCL_PAPERSIZE);
	bjdev->bjfltBinMethod    = GetCurrentnValue(CNCL_DITHER_PAT);

	if (bjdev->bjfltBinMethod == CND_UIBIN_PATTERN_HS)
		bjdev->bjfltBinMethod = CND_UIBIN_PATTERN;

	bjdev->bjfltBanner    = GetCurrentnValue(CNCL_BANNER);
	bjdev->bjfltInkType   = GetCurrentnValue(CNCL_CARTRIDGE);
	bjdev->bjfltGrayScale = GetCurrentnValue(CNCL_GRAYSCALE);

	bjdev->bjfltPaperWidth	= GetPaperWidth(bjdev->bjfltPaperSize);
	bjdev->bjfltPaperHeight	= GetPaperHeight(bjdev->bjfltPaperSize);

	if( IsAvailableBorderless() )
		bjdev->bjfltMarginType = GetCurrentnValue(CNCL_MARGINTYPE);
	else
		bjdev->bjfltMarginType = CND_MARGIN_NORMAL;

	bjdev->bjfltPaperGap = GetCurrentPaperGap();
}
static void ShowLeverPositionAlert()
{
	gchar* position_alert_msg;
	gchar* msg_buf;
const static gchar* _alert_str = "_alert";

	gchar* alert_msg = LookupText(g_keytext_list, "move_lever_position_alert");
	gchar* position_key
			 = ValueToKey(CNCL_MESS_THICK, GetCurrentnValue(CNCL_MESS_THICK));

	// Make the key for the position string on the alert.
	gchar* position_alert_key
		 = g_malloc(strlen(position_key) + strlen(_alert_str) + 1);

	strcpy(position_alert_key, position_key);
	strcat(position_alert_key, _alert_str);

	// Get the position string on the alert.
	position_alert_msg = LookupText(g_keytext_list, position_alert_key);

	// If not exist, use the current position string instead.
	if( position_alert_msg == NULL )
		position_alert_msg = GetCurrentString(CNCL_MESS_THICK);

	msg_buf = (gchar*)g_malloc(strlen(alert_msg) + strlen(position_alert_msg));

	sprintf(msg_buf, alert_msg, position_alert_msg);

	UtilMessageBox(msg_buf, g_window_title, MB_OK | MB_ICON_INFORMATION);

	g_free(position_alert_key);
	g_free(msg_buf);
}
void
on_quality_dialog_quality_i_button_toggled
                                        (GtkToggleButton *togglebutton,
                                        gpointer         user_data)
{
	if( DisableSignal() )
	{
		GtkWidget* window = GetTopWidget(GTK_WIDGET(togglebutton));
		int quality = GetActiveButtonIndex(window, print_quality_button_name,0);

		// Save the halftoning value before updating the print quality.
		short bin_method_value = GetCurrentnValue(CNCL_DITHER_PAT);
		short flag;

		UpdateMenuLink(CNCL_PRINTQUALITY, print_quality_button_value[quality]);

		// If can be set previous halftoning value, set it.
		flag = GetAllFlags(CNCL_DITHER_PAT, bin_method_value);
		if( !(flag & DISABLE_FLAG) )
			UpdateMenuLink(CNCL_DITHER_PAT, bin_method_value);

		UpdateQualityDialogWidgets(window, "quality_i_button");
	}
	EnableSignal();
}
Exemple #10
0
UIMainDialog* CreateMainWindow()
{
	UIMainDialog* main_window
		= (UIMainDialog*)CreateDialog(sizeof(UIMainDialog), NULL);

#ifdef	USE_LIB_GLADE
	UI_DIALOG(main_window)->window = LookupWidget(NULL, "ui_window");
#else
	UI_DIALOG(main_window)->window = create_ui_window();
#endif

	// Get initial paper size.
	main_window->init_paper_size = GetCurrentnValue(CNCL_PAPERSIZE);

	// Initialize auto color adjustment.
	main_window->color_auto = TRUE;

	// Initialize printing type, etc.
	main_window->printing_type = g_printing_type_value[0];
	main_window->scaling = 100;
	main_window->centering = LOCATION_UPPERLEFT;
	main_window->ext_border = GetDefaultExtBorder(g_model_id);
	main_window->copies = 1;

	return main_window;
}
Exemple #11
0
static
void ShowPaperGapCombo(main_window)
{
	int show_lever_box = FALSE;

	if( GetCurrentPaperGap() == CND_PGAP_CMD_NA )
	{
		if( GetCurrentnValue(CNCL_MESS_THICK) != CND_TMESSAGE_NA )
		{
			gtk_widget_show(LookupWidget(UI_DIALOG(main_window)->window,
				"lever_pos_hbox"));
			show_lever_box = TRUE;
		}
	}
	else
	{
		gtk_widget_show(LookupWidget(UI_DIALOG(main_window)->window,
			"paper_gap_hbox"));
		show_lever_box = TRUE;
	}

	if( show_lever_box == TRUE )
	{
		gtk_widget_show(LookupWidget(UI_DIALOG(main_window)->window,
			"lever_pos_vbox"));
	}
}
void
on_default_button_clicked              (GtkButton       *button,
                                        gpointer         user_data)
{
	short paper_size_value = GetCurrentnValue(CNCL_PAPERSIZE);
	short margin_type_value = GetCurrentnValue(CNCL_MARGINTYPE);

	FreeDataBase();
	InitDataBase(g_model_name);

	// Initialize the print quality toggle button.
	gtk_toggle_button_set_active(
		GTK_TOGGLE_BUTTON(LookupWidget(UI_DIALOG(g_main_window)->window,
			"quality_standard_button")), TRUE);
	SetQualityCustomValue(g_quality_dialog);



	// Initialize the color adjustment toggle button.
	gtk_toggle_button_set_active(
		GTK_TOGGLE_BUTTON(LookupWidget(UI_DIALOG(g_main_window)->window,
			"color_auto_button")), TRUE);

	// Initialize the print bw toggle button.
	gtk_toggle_button_set_active(
		GTK_TOGGLE_BUTTON(LookupWidget(UI_DIALOG(g_main_window)->window,
			"print_bw_button1")), FALSE);
	gtk_toggle_button_set_active(
		GTK_TOGGLE_BUTTON(LookupWidget(UI_DIALOG(g_main_window)->window,
			"print_bw_button2")), FALSE);

	// Re-create the color adjustment dialog.
	g_color_dialog
		= ReCreateColorDialog( g_color_dialog, UI_DIALOG(g_main_window));

	// Restore paper size and margin type.
	UpdateMenuLink(CNCL_PAPERSIZE, paper_size_value);
	UpdateMenuLink(CNCL_MARGINTYPE, margin_type_value);

	// Update widgets.
	DisableSignal();
	UpdateWidgets(UI_DIALOG(g_main_window)->window, NULL);
	EnableSignal();

	// Update all of window
	UpdateDialog(UI_DIALOG(g_main_window), NULL);
}
Exemple #13
0
void InitUserPaperSize()
{
	// Set the user paper size into globals.
	short size_value = GetCurrentnValue(CNCL_PAPERSIZE);

	g_user_paper_size[YOKO] = GetPaperWidth(size_value);
	g_user_paper_size[TATE] = GetPaperHeight(size_value);
}
Exemple #14
0
short GetCurrentPaperGap()
{
	int value = GetCurrentnValue(CNCL_PAPERGAP_COMMAND);

	if( value == -1 )
		value = CND_PGAP_CMD_NA;

	return value;
}
static short SetGammaCombo(UIColorDialog2* dialog, short gamma)
{
	if( gamma != GetCurrentnValue(CNCL_INPUT_GAMMA) )
		UpdateMenuLink(CNCL_INPUT_GAMMA, gamma);

	/* Ver.2.80 */
	SetItemsToComboBox( UI_DIALOG(dialog)->window, "color_dialog_gamma_combo2", CNCL_INPUT_GAMMA, gamma );

	return gamma;
}
/* for CND_FORMATTYPE_6 or above */
static short SetColorCorrectCombo2(UIColorDialog2* dialog , short intent)
{
	if( intent != GetCurrentnValue(CNCL_INTENT) )
		UpdateMenuLink(CNCL_INTENT, intent);

	/* Ver.2.80 */
	dialog->intent_num = SetItemsToComboBox( UI_DIALOG(dialog)->window, "color_dialog_correct_combo2", CNCL_INTENT, intent );
	
	return intent;
}
Exemple #17
0
static void CompCallbackTableValue(void)
{
	int i;
		
	for(i=0; callback_table[i].func != NULL; i++ ){
		if(callback_table[i].old_value != 
					GetCurrentnValue(callback_table[i].id) ){
			callback_table[i].func(callback_table[i].func_data);
		}
	}
}
static void GetMargin(LPCNCLPAPERSIZE psize)
{
	short size = GetCurrentnValue(CNCL_PAPERSIZE);

	psize->nSelPaperWidth  = GetPaperWidth(size);
	psize->nSelPaperLength = GetPaperHeight(size);

	// Get paper margin.
	CNCL_GetMargin(&g_uidb.nominfo,
		(void*)g_bjlibdir, g_uidb.lpdbTop, psize, g_uidb.dbsize);
}
Exemple #19
0
static void SetCallbackTableOldValue(void)
{
	int i;
	
	for(i=0; callback_table[i].func != NULL; i++ ){
		callback_table[i].old_value = 
			GetCurrentnValue(callback_table[i].id);
	   
	}

}
Exemple #20
0
short GetDefaultExtBorder(int model_id)
{
	int type = CNCL_GetTableFormatType(&g_uidb.nominfo, (void *)g_bjlibdir);
	if( type >= 4 )
	{
		int value = GetCurrentnValue(CNCL_OVERMARGIN_LEVEL);
		if( value >= 0 )
			return value;	// 0 .. 3
	}
	return GetDefaultExtBorderTable(model_id);
}
Exemple #21
0
short GetCurrentInkCartridgeSettings()
{
	int cartridge = GetCurrentnValue(CNCL_INKCARTRIDGESETTINGS);
	int media_type = GetCurrentnValue(CNCL_MEDIATYPE);
	int margin_type = GetCurrentnValue(CNCL_MARGINTYPE);

	/* Ver.2.70 */
	if( cartridge == -1 )
		cartridge = CND_CARTRIDGE_NA;

	if( cartridge != CND_CARTRIDGE_BK )
		return cartridge;

	/* CND_CARTRIDGE_BK */
	if( media_type == CND_MEDIA_PLAIN && margin_type == CND_MARGIN_NORMAL )
		return cartridge;
	
//	return CND_CARTRIDGE_BK_COLOR;
	/* Ver.2.70 : Use default value */
	cartridge = GetDefaultnValue(CNCL_INKCARTRIDGESETTINGS);
	return cartridge;
}
void
on_borderless_button_clicked           (GtkButton       *button,
                                        gpointer         user_data)
{
	if( DisableSignal() )
	{
		GtkWidget* window = GetTopWidget(GTK_WIDGET(button));

		if( GTK_TOGGLE_BUTTON(button)->active )
		{
			short media_type_value = GetCurrentnValue(CNCL_MEDIATYPE);

			if( IsAvailableMediaBorder(g_mediaborder_dialog, media_type_value) )
			{
				gchar* alert_msg
					= LookupText(g_keytext_list, "mediaborder_alert");
				UtilMessageBox(alert_msg, g_window_title,
					MB_OK | MB_ICON_INFORMATION);

				UpdateMenuLink(CNCL_MARGINTYPE, CND_MARGIN_MINUS);
			}
			else
			{
				short new_media_type_value;
				if( (new_media_type_value
						= ShowMediaBorderDialog(g_mediaborder_dialog,
												media_type_value)) != -1 )
				{
					UpdateMenuLink(CNCL_MEDIATYPE, new_media_type_value);
					UpdateMenuLink(CNCL_MARGINTYPE, CND_MARGIN_MINUS);
				}
				else
				{
					gtk_toggle_button_set_active(
						GTK_TOGGLE_BUTTON(button), FALSE);
				}
			}
		}
		else
		{
			UpdateMenuLink(CNCL_MARGINTYPE, CND_MARGIN_NORMAL);
		}

		UpdateWidgets(window, "borderless_button");

#ifdef	GUI_WITH_PIXMAPS
		UpdateDrawingArea(window, "basic_draw_area");
#endif
	}
	EnableSignal();
}
UIQualityDialog* CreateQualityDialog(UIDialog* parent)
{
	GtkWidget* window;
	UIQualityDialog* dialog
		 = (UIQualityDialog*)CreateDialog(sizeof(UIQualityDialog), parent);

#ifdef	USE_LIB_GLADE
	UI_DIALOG(dialog)->window = window = LookupWidget(NULL, "quality_dialog");
#else
	UI_DIALOG(dialog)->window = window = create_quality_dialog();
#endif

	dialog->print_quality = GetCurrentnValue(CNCL_PRINTQUALITY);
	dialog->bin_method = GetCurrentnValue(CNCL_DITHER_PAT);

	SetCallbackTableFunc(CNCL_MEDIATYPE, (void*)SetQualityCustomValue, dialog);


	gtk_widget_realize(window);

	UpdateQualityDialogWidgets(window, NULL);

	return dialog;
}
static void
update_by_media_size_entry()
{
	GtkWidget* window = UI_DIALOG(g_main_window)->window;
	GtkWidget* entry = LookupWidget(window, "media_size_entry");
	short value = NameToValue(CNCL_PAPERSIZE, 
						(char*)gtk_entry_get_text(GTK_ENTRY(entry)));

	UpdateMenuLink(CNCL_PAPERSIZE, value);

	if( CND_SIZE_USER == GetCurrentnValue(CNCL_PAPERSIZE) )
	{
		set_user_paper_size();
	}

	UpdateWidgets(window,  "media_size_combo");
#ifdef	GUI_WITH_PIXMAPS
	UpdateDrawingArea(window, "basic_draw_area");
#endif
	g_media_size_entry_changed = FALSE;
}
static void SetDefaultSetConfigType003( LPSETCONFIGCOMPTYPE003RES lpRes, void *lpGWork )
{
	LPSETCONFIGCOMPTYPE003WORK lpWork = (LPSETCONFIGCOMPTYPE003WORK)lpGWork;
	GtkWidget*	combo;
	GtkWidget*	label;
	gchar* 		msg;
	int index_num = lpWork->lpInkCartridgeMsgInfo->index_num;
	int currentIndex;

	currentIndex= nValueToIndex(lpWork->lpInkCartridgeMsgInfo->nValue, index_num, GetCurrentnValue(CNCL_INKCARTRIDGESETTINGS) );
	combo = LookupWidget( lpWork->dialog, "setconfig_type003_combobox1" );

	if( DisableSignal() )
	{
		SetComboBoxItems(combo, (const char **)lpWork->lpInkCartridgeMsgInfo->type, index_num, currentIndex);
	}
	EnableSignal();

	msg = LookupText(g_keytext_list, lpWork->lpInkCartridgeMsgInfo->info[currentIndex]);
	label = LookupWidget(GTK_WIDGET(lpWork->dialog), "setconfig_type003_label3");
	gtk_label_set_text(GTK_LABEL(label), msg);
}
Exemple #26
0
void HideColorDialog(UIColorDialog* dialog, gboolean apply)
{
	if( apply )
	{
		dialog->cyan_balance    = (int)dialog->cyan_adjust->value; 
		dialog->magenta_balance = (int)dialog->magenta_adjust->value; 
		dialog->yellow_balance  = (int)dialog->yellow_adjust->value; 
		dialog->black_balance   = (int)dialog->black_adjust->value; 
		dialog->density_balance = (int)dialog->density_adjust->value; 

		dialog->vivid
			= GTK_TOGGLE_BUTTON(LookupWidget(UI_DIALOG(dialog)->window,
					"color_dialog_vivid_button"))->active;

		dialog->color_correct = GetColorCorrectCombo(dialog);

		if( dialog->gamma_list == NULL )
		{
			dialog->gamma
				 = GetTextArrayValueFromCombo(UI_DIALOG(dialog)->window,
					 "color_dialog_gamma_combo", gamma_key, gamma_value);
		}
		else
		{
			dialog->gamma = GetCurrentnValue(CNCL_INPUT_GAMMA);
		}
	}
	else
	{
		if( dialog->gamma_list )
		{
			// Recover parameters.
			UpdateMenuLink(CNCL_INPUT_GAMMA, dialog->gamma);
		}
	}

	HideDialog((UIDialog*)dialog);
}
Exemple #27
0
static
void RestoreIDValue(short change_id, short save_id, short save_value)
{
	if( GetIDLevel(change_id) < GetIDLevel(save_id) )
	{
		short current_value = GetCurrentnValue(save_id);

		if( current_value != save_value )
		{
			if( !(GetAllFlags(save_id, save_value) & DISABLE_FLAG) )
			{
				SetTemporaryFlag(save_id, save_value, 1);

				CNCL_GetMenulink(&g_uidb.nominfo,
					(void*)g_bjlibdir, g_uidb.lpdbTop, g_uidb.dbsize);
			}else{
#ifdef _PRINTUI_DEBUG_
				fprintf(stderr,"!!RestoreIDValue disable!! save_id=%d\n",save_id );
#endif
			}
		}
	}
}
Exemple #28
0
static short SetGammaCombo(UIColorDialog* dialog, short gamma)
{
	dialog->gamma_list = GetComboList(CNCL_INPUT_GAMMA);

	if( dialog->gamma_list )
	{
		gchar* name;

		if( gamma != GetCurrentnValue(CNCL_INPUT_GAMMA) )
			UpdateMenuLink(CNCL_INPUT_GAMMA, gamma);

		name = ValueToName(CNCL_INPUT_GAMMA, gamma);

		SetGListToCombo(UI_DIALOG(dialog)->window,
			"color_dialog_gamma_combo", dialog->gamma_list, name);
	}
	else
	{
		SetTextArrayToCombo(UI_DIALOG(dialog)->window,
			"color_dialog_gamma_combo", gamma_key, gamma_value, gamma);
	}

	return gamma;
}
static gchar* GetAvailableMedia(gchar* applied)
{
	short cartridge_type_value = GetCurrentnValue(CNCL_CARTRIDGE);
	gchar* words = applied;
	gchar* word = (gchar*)g_malloc(strlen(words) + 1);
	gchar* result = (gchar*)g_malloc(strlen(words) + 2);
	gchar* next;
	int len;
	short media_type_value;

	result[0] = '\0';

	while( words != NULL )
	{
		next = GetWord(words, &len);
		strncpy(word, words, len);
		word[len] = '\0';

		media_type_value = KeyToValue(CNCL_MEDIATYPE, word);

		if( IsAvailableMedia(g_mediatype_dialog,
				media_type_value, cartridge_type_value) )
		{
			strcat(result, word);
			strcat(result, " ");
		}
		words = next;
	}

	g_free(word);

	if( (len = strlen(result)) > 0 )
		result[len - 1] = '\0';	// Delete last space.

	return result;
}
void
on_quality_button_clicked              (GtkButton       *button,
                                        gpointer         user_data)
{
	if( DisableSignal() )
	{
		GtkWidget* window = GetTopWidget(GTK_WIDGET(button));
		int quality
		 = g_mess_map[GetActiveButtonIndex(window, g_quality_button_name,0)];

		switch( quality )
		{
		case CNCL_MESS_Q_MAP1:
		case CNCL_MESS_Q_MAP2:
		case CNCL_MESS_Q_MAP3:
		{
			UpdateMenuLink(CNCL_PRINTQUALITY, GetCurrentnValue(quality));
			UpdateMenuLink(CNCL_DITHER_PAT, CND_UIBIN_ED);
			break;
		}
		default:
		{
			UpdateMenuLink(CNCL_PRINTQUALITY, g_quality_dialog->print_quality);
			UpdateMenuLink(CNCL_DITHER_PAT, g_quality_dialog->bin_method);
			break;
		}
		}
		

		UpdateWidgets(window, "quality_buttons");
#ifdef	GUI_WITH_PIXMAPS
		UpdateDrawingArea(window, "quality_draw_area");
#endif
	}
	EnableSignal();
}