Ejemplo n.º 1
0
void DebugDisable(cngplpData *data, int id)
{
	PPDOptions *ppd_opt = data->ppd_opt;
	int i = 0;
	UIItemsList *list;
	UIOptionList *opt;
	char *except = IDtoPPDOption(id - 1);
if(except == NULL)
return;
UI_DEBUG("[%s]:%d\n", except, id);
	list = ppd_opt->items_list;
	while(1){
		opt = list->opt_lists;
		while(1){
			i++;
if(except != NULL && strcmp(except, list->name) == 0)
UI_DEBUG("[%3d] item:[%18s] opt:[%10s] disable[%d] def:[%3s]\n", i, except, opt->name, opt->disable, (strcmp(list->current_option->name, opt->name) == 0) ? "Yes" : "NO");
			if(opt->next == NULL)
				break;
			opt = opt->next;
		}

		if(list->next == NULL)
			break;
		list = list->next;
	}
UI_DEBUG("\n");
}
Ejemplo n.º 2
0
char* cngplpSetData(cngplpData *data, int id, char *value)
{
UI_DEBUG("-----------------------------------------------------\n");
UI_DEBUG("<-cngplpSetData id=[%d] value=[%s]\n", id, value);
	InitUpdateOption(data);
	if(id < ID_COMMON_OPTION){
		SetDataPPD(data, id, value);
	}else if(id < ID_IMAGE_OPTION){
		SetDataCommon(data, id, value);
	}else if(id < ID_TEXT_OPTION){
		SetDataImage(data, id, value);
	}else if(id < ID_HPGL_OPTION){
		SetDataText(data, id, value);
	}else if(id < ID_BOTTON_EVENT){
		SetDataHPGL(data, id, value);
	}else{
		BottomEvent(data, id, value);
	}
	return ExitUpdateOption(data);
}
Ejemplo n.º 3
0
void PrintTime()
{
	int i = 0;
	struct timeval tms;
	time_t t;
	struct tm *tmm;
	t = time(NULL);
	tmm = localtime(&t);
	gettimeofday(&tms,NULL);
	if(tmm != NULL){
		UI_DEBUG("%d:%d:%d.%d\n",tmm->tm_hour,tmm->tm_min,tmm->tm_sec,tms.tv_usec/1000);
	}
}
Ejemplo n.º 4
0
int InitAllFiles()
{
	char config_file[MAX_PATH];
	char res_path[MAX_PATH];
	xmlKeepBlanksDefault(0);
	memset(config_file, 0, sizeof(config_file));
	memset(glade_file, 0, sizeof(glade_file));
	memset(res_path, 0, sizeof(res_path));
	strcat(config_file, PACKAGE_CONFIG_DIR);
	strcat(config_file, CONFIG_FILE_NAME);
	strcat(glade_file, PACKAGE_CONFIG_DIR);
	strcat(glade_file, GLADE_FILE_NAME);
	strcat(res_path, PACKAGE_CONFIG_DIR);
	g_config_file_data = NULL;
	g_cngplp_xml = NULL;
	if(g_cngplp_data != NULL){
		InitKeyTextList(res_path, g_cngplp_data->ppd_opt->pcfile_name);
	}
	if(-1 == access(config_file, F_OK)){
		UI_DEBUG("The configure file doesn't exist! \n");
	}
	g_config_file_data = ParseConfigureFile(config_file);
	if(NULL == g_config_file_data){
		UI_DEBUG("The configure file is wrong!\n");
		return -1;
	}
	bindtextdomain(GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
	bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
	textdomain(GETTEXT_PACKAGE);
	gtk_set_locale();
	g_cngplp_xml = glade_xml_new(glade_file, NULL, GETTEXT_PACKAGE);
       	if(NULL == g_cngplp_xml){
		g_warning("the glade file is wrong\n");
		return -1;
	}
	return 0;
}
Ejemplo n.º 5
0
int
main (int argc, char *argv[])
{
    char printer_name[128];
    int mode = 0;

#ifdef ENABLE_NLS
    bindtextdomain(PACKAGE, PACKAGE_LOCALE_DIR);
#ifndef OLD_GTK
    /* changes for GTK2 */
    bind_textdomain_codeset(PACKAGE, "UTF-8");
#endif
    textdomain(PACKAGE);
#endif
    gtk_set_locale ();
    gtk_init (&argc, &argv);

    add_pixmap_directory (PACKAGE_DATA_DIR "/pixmaps");
#ifdef OLD_GTK
    /* changes for GTK2 */
    /* If it is necessary, "PACKAGE_SOURCE_DIR" is defined. */
    /* Example: add to configure.in                                */
    /*  dnl Set PACKAGE_SOURCE_DIR in config.h.                    */
    /*  packagesrcdir=`cd $srcdir && pwd`                          */
    /*  AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}") */
    add_pixmap_directory (PACKAGE_SOURCE_DIR "/pixmaps");
#endif

    /*
     * The following code was added by Glade to create one of each component
     * (except popup menus), just so that you see something after building
     * the project. Delete any components that you don't want shown initially.
     */
    memset(printer_name, 0, sizeof(printer_name));
    mode = LaunchOption(argc, argv, printer_name);
    if(mode != -1) {
        UI_DEBUG("[%s]\n", printer_name);
        SigInit();
        g_status_window = CreateStatusWnd(printer_name, mode);
        if(g_status_window == NULL) {
            UI_DEBUG("Window Create Error\n");
            return -1;
        }
        gtk_widget_realize(UI_DIALOG(g_status_window)->window);

        switch(g_status_window->nIFVersion) {
        case CCPD_IF_VERSION_110:
            StartProcess2(mode);
            break;
        case CCPD_IF_VERSION_100:
            StartProcess(mode);
            break;
        default:
            break;
        }

        DisposeDialog(UI_DIALOG(g_status_window));
    }
    UI_DEBUG("Finish\n");

    return 0;
}