Exemplo n.º 1
0
IdentConfig  *
ParseIdentOptions (const char *filename, char *myname)
{
	ConfigData    cd ;
	ConfigDef    *IdentConfigReader ; 
	IdentConfig  *config = CreateIdentConfig ();
	FreeStorageElem *Storage = NULL;

	cd.filename = filename ;
	IdentConfigReader = InitConfigReader (myname, &IdentSyntax, CDT_Filename, cd, NULL);
	if (!IdentConfigReader)
		return config;

	PrintConfigReader (IdentConfigReader);
	ParseConfig (IdentConfigReader, &Storage);

	/* getting rid of all the crap first */
	StorageCleanUp (&Storage, &(config->more_stuff), CF_DISABLED_OPTION);

	config->style_defs = free_storage2MyStyleDefinitionsList (Storage);

	DestroyConfig (IdentConfigReader);
	DestroyFreeStorage (&Storage);
	return config;

}
Exemplo n.º 2
0
ThemeConfig *
ParseThemeFile (const char *filename, char *myname)
{
	ThemeConfig *config ;
	ConfigData cd ;
    ConfigDef *ConfigReader;
    FreeStorageElem *Storage = NULL, *pCurr;
    ConfigItem item;

	cd.filename = filename ;
	ConfigReader = InitConfigReader (myname, &ThemeSyntax, CDT_Filename, cd, NULL);
	LOCAL_DEBUG_OUT( "ConfigReader is %p", ConfigReader );
    if (!ConfigReader)
        return NULL;

	config = safecalloc( 1, sizeof(ThemeConfig ) );

	PrintConfigReader (ConfigReader);
	ParseConfig (ConfigReader, &Storage);

	/* getting rid of all the crap first */
    StorageCleanUp (&Storage, &(config->more_stuff), CF_DISABLED_OPTION);

	for (pCurr = Storage; pCurr; pCurr = pCurr->next)
  	{
  	    if (pCurr->term == NULL)
			continue;
        if (!ReadConfigItem (&item, pCurr))
			continue;

        switch (pCurr->term->id)
		{
            case FEEL_Function_ID           :
                if( mystrncasecmp( item.data.string, THEME_INSTALL_FUNC_NAME, sizeof(THEME_INSTALL_FUNC_NAME))== 0 )
                {
                    if( config->install )
                        really_destroy_complex_func( config->install );
                     config->install = FreeStorage2ComplexFunction( pCurr, &item, NULL );
                }else if( mystrncasecmp( item.data.string, THEME_APPLY_FUNC_NAME, sizeof(THEME_APPLY_FUNC_NAME) )== 0 )
                {
                    if( config->apply )
                        really_destroy_complex_func( config->apply );
                    config->apply = FreeStorage2ComplexFunction( pCurr, &item, NULL );
                }
                break ;
          default:
				item.ok_to_free = 1;
		}
    }
	ReadConfigItem (&item, NULL);

	DestroyConfig (ConfigReader);
	DestroyFreeStorage (&Storage);

	return config;
}
Exemplo n.º 3
0
ASetRootConfig *ParseASetRootOptions (const char *filename, char *myname)
{
	ConfigData cd;
	ConfigDef *ConfigReader;
	ASetRootConfig *config = CreateASetRootConfig ();
	MyBackgroundConfig **backs_tail = &(config->my_backs);
	DeskBackConfig **desks_tail = &(config->my_desks);
	FreeStorageElem *Storage = NULL, *pCurr;
	ConfigItem item;

	cd.filename = filename;
	ConfigReader =
			InitConfigReader (myname, &ASetRootSyntax, CDT_Filename, cd, NULL);

	if (!ConfigReader)
		return config;

	item.memory = NULL;
	PrintConfigReader (ConfigReader);
	ParseConfig (ConfigReader, &Storage);

	/* getting rid of all the crap first */
	StorageCleanUp (&Storage, &(config->more_stuff), CF_DISABLED_OPTION);

	config->style_defs = free_storage2MyStyleDefinitionsList (Storage);

	for (pCurr = Storage; pCurr; pCurr = pCurr->next) {
		if (pCurr->term == NULL)
			continue;

		if (pCurr->term->id == BGR_MYBACKGROUND) {
			if ((*backs_tail =
					 ParseMyBackgroundOptions (pCurr->sub, myname)) != NULL)
				backs_tail = &((*backs_tail)->next);
			continue;
		}

		if (!ReadConfigItem (&item, pCurr))
			continue;
		switch (pCurr->term->id) {
		case BGR_DESK_BACK:
			if ((*desks_tail = ParseDeskBackOptions (&item, myname)) != NULL)
				desks_tail = &((*desks_tail)->next);
			break;
		default:
			item.ok_to_free = 1;
		}
	}
	ReadConfigItem (&item, NULL);
	FixDeskBacks (config);

	DestroyConfig (ConfigReader);
	DestroyFreeStorage (&Storage);
	return config;
}
Exemplo n.º 4
0
AutoExecConfig *
ParseAutoExecOptions (const char *filename, char *myname)
{
    ConfigData cd ;
	ConfigDef *ConfigReader;
    AutoExecConfig *config = CreateAutoExecConfig ();
	FreeStorageElem *Storage = NULL, *pCurr;
    ConfigItem item;

	cd.filename = filename ;
	ConfigReader = InitConfigReader (myname, &AutoExecSyntax, CDT_Filename, cd, NULL);
	if (!ConfigReader)
  		return config;

    item.memory = NULL;
	PrintConfigReader (ConfigReader);
	ParseConfig (ConfigReader, &Storage);

	/* getting rid of all the crap first */
    StorageCleanUp (&Storage, &(config->more_stuff), CF_DISABLED_OPTION);

    for (pCurr = Storage; pCurr; pCurr = pCurr->next)
  	{
  	    if (pCurr->term == NULL)
			continue;
        if (!ReadConfigItem (&item, pCurr))
			continue;

        switch (pCurr->term->id)
		{
            case FEEL_Function_ID           :
                if( mystrncasecmp( item.data.string, "InitFunction", 12 ) == 0 )
                {
                    if( config->init )
                        really_destroy_complex_func( config->init );
                     config->init = FreeStorage2ComplexFunction( pCurr, &item, NULL );
                }else if( mystrncasecmp( item.data.string, "RestartFunction", 15 ) == 0 )
                {
                    if( config->restart )
                        really_destroy_complex_func( config->restart );
                    config->restart = FreeStorage2ComplexFunction( pCurr, &item, NULL );
                }
                break ;
          default:
				item.ok_to_free = 1;
		}
    }
	ReadConfigItem (&item, NULL);

	DestroyConfig (ConfigReader);
	DestroyFreeStorage (&Storage);
	return config;

}
Exemplo n.º 5
0
void
windowbox_parse (char *tline, FILE * fd, char **unused1, int *unused2)
{
    FilePtrAndData fpd ;
    ConfigDef    *ConfigReader ;
    FreeStorageElem *Storage = NULL, *more_stuff = NULL;
    ASWindowBox **aswbox_list = &(ASDefaultScr->Feel.window_boxes);
	unsigned int *count = &(ASDefaultScr->Feel.window_boxes_num);
    ASWindowBox *new_box ;
	ConfigData cd ;

    fpd.fp = fd ;
    fpd.data = safemalloc( 12+1+strlen(tline)+1+1 ) ;
    sprintf( fpd.data, "WindowBox %s\n", tline );
    LOCAL_DEBUG_OUT( "fd(%p)->tline(\"%s\")->fpd.data(\"%s\")", fd, tline, fpd.data );
	cd.fileptranddata = &fpd ;
    ConfigReader = InitConfigReader ((char*)get_application_name(), &WindowBoxSyntax, CDT_FilePtrAndData, cd, NULL);
    free( fpd.data );

    if (!ConfigReader)
        return ;

	PrintConfigReader (ConfigReader);
	ParseConfig (ConfigReader, &Storage);

	/* getting rid of all the crap first */
    StorageCleanUp (&Storage, &more_stuff, CF_DISABLED_OPTION);
    DestroyFreeStorage (&more_stuff);

    if( (new_box = ProcessWindowBoxOptions (Storage)) != NULL )
    {
        int i = *count ;
        ++(*count) ;
        *aswbox_list = realloc( *aswbox_list, sizeof(ASWindowBox)*(i+1));
        (*aswbox_list)[i] = *new_box ;
        free( new_box );
    }

	DestroyConfig (ConfigReader);
	DestroyFreeStorage (&Storage);
}
Exemplo n.º 6
0
WharfConfig *ParseWharfOptions (const char *filename, char *myname)
{
	ConfigData cd;
	ConfigDef *ConfigReader;
	WharfConfig *config = CreateWharfConfig ();
	FreeStorageElem *Storage = NULL, *pCurr;
	ConfigItem item;
	TermDef *folder_term = func2fterm (F_Folder, False);

	cd.filename = filename;
	ConfigReader =
			InitConfigReader (myname, &WharfSyntax, CDT_Filename, cd,
												NULL /*WharfSpecialFunc */ );
	if (!ConfigReader)
		return config;

	folder_term->sub_syntax = &WharfSyntax;

	item.memory = NULL;
	PrintConfigReader (ConfigReader);
	ParseConfig (ConfigReader, &Storage);

	/* getting rid of all the crap first */
	StorageCleanUp (&Storage, &(config->more_stuff), CF_DISABLED_OPTION);
	config->balloon_conf =
			Process_balloonOptions (Storage, NULL, BALLOON_ID_START);
	config->style_defs = free_storage2MyStyleDefinitionsList (Storage);

	for (pCurr = Storage; pCurr; pCurr = pCurr->next) {
		if (pCurr->term == NULL)
			continue;
		if (ReadFlagItem
				(&(config->set_flags), &(config->flags), pCurr, WharfFlags)) {
			continue;
		}
		if (!ReadConfigItem (&item, pCurr))
			continue;
		switch (pCurr->term->id) {
		case WHARF_Wharf_ID:
			item.ok_to_free = 1;
			ParseWharfFolder (&pCurr, &(config->root_folder));
			break;
		case WHARF_Geometry_ID:
			set_flags (config->set_flags, WHARF_GEOMETRY);
			config->geometry = item.data.geometry;
			break;
		case WHARF_Rows_ID:
			set_flags (config->set_flags, WHARF_ROWS);
			config->rows = item.data.integer;
			break;
		case WHARF_Columns_ID:
			set_flags (config->set_flags, WHARF_COLUMNS);
			clear_flags (config->set_flags, WHARF_ROWS);
			config->columns = item.data.integer;
			break;
		case WHARF_WithdrawStyle_ID:
			set_flags (config->set_flags, WHARF_WITHDRAW_STYLE);
			config->withdraw_style = item.data.integer;
			break;
		case WHARF_ForceSize_ID:
			set_flags (config->set_flags, WHARF_FORCE_SIZE);
			config->force_size = item.data.geometry;
			/* errorneous value check */
			if (!(config->force_size.flags & WidthValue))
				config->force_size.width = 64;
			if (!(config->force_size.flags & HeightValue))
				config->force_size.height = 64;
			config->force_size.flags = WidthValue | HeightValue;
			break;
		case WHARF_TextureType_ID:
			set_flags (config->set_flags, WHARF_TEXTURE_TYPE);
			config->texture_type = item.data.integer;
			break;
		case WHARF_BgColor_ID:
			set_string_value (&(config->bg_color), item.data.string,
												&(config->set_flags), WHARF_BG_COLOR);
			break;
		case WHARF_TextureColor_ID:
			set_string_value (&(config->texture_color), item.data.string,
												&(config->set_flags), WHARF_TEXTURE_COLOR);
			break;
		case WHARF_Pixmap_ID:
			set_string_value (&(config->pixmap), item.data.string,
												&(config->set_flags), WHARF_PIXMAP);
			break;
		case WHARF_AnimateStepsMain_ID:
			set_flags (config->set_flags, WHARF_ANIMATE_STEPS_MAIN);
			config->animate_steps_main = item.data.integer;
			break;
		case WHARF_AnimateSteps_ID:
			set_flags (config->set_flags, WHARF_ANIMATE_STEPS);
			config->animate_steps = item.data.integer;
			break;
		case WHARF_AnimateDelay_ID:
			set_flags (config->set_flags, WHARF_ANIMATE_DELAY);
			config->animate_delay = item.data.integer;
			break;
		case WHARF_Sound_ID:
			if (pCurr->sub == NULL) {
				if (pCurr->argc > 0) {
					register char *sound = mystrdup (pCurr->argv[pCurr->argc - 1]);

					set_string_value (&(config->sounds[WHEV_PUSH]), sound,
														&(config->set_flags), WHARF_SOUND);
				}
			} else if (pCurr->sub->argc > 0) {
				register char *sound = mystrdup (pCurr->sub->argv[0]);

				set_string_value (&
													(config->
													 sounds[WHEV_Id2Code (pCurr->sub->term->id)]),
													sound, &(config->set_flags), WHARF_SOUND);
			}
			item.ok_to_free = 1;
			break;
			ASCF_HANDLE_INTEGER_KEYWORD_CASE (WHARF, config, item,
																				LabelLocation);
			ASCF_HANDLE_ALIGN_KEYWORD_CASE (WHARF, config, pCurr, AlignContents);
			ASCF_HANDLE_BEVEL_KEYWORD_CASE (WHARF, config, pCurr, Bevel);
			ASCF_HANDLE_SUBSYNTAX_KEYWORD_CASE (WHARF, config, pCurr, ShowHints,
																					BalloonContents);
			ASCF_HANDLE_INTEGER_KEYWORD_CASE (WHARF, config, item,
																				CompositionMethod);
			ASCF_HANDLE_INTEGER_KEYWORD_CASE (WHARF, config, item, FolderOffset);
			ASCF_HANDLE_INTEGER_KEYWORD_CASE (WHARF, config, item,
																				OrthogonalFolderOffset);
		default:
			if (pCurr->term->type != TT_FLAG)
				item.ok_to_free = 1;
		}
	}
	if (get_flags (config->set_flags, WHARF_Bevel))
		clear_flags (config->flags, WHARF_NO_BORDER);


	ReadConfigItem (&item, NULL);
	SHOW_CHECKPOINT;
	DestroyConfig (ConfigReader);
	SHOW_CHECKPOINT;
	DestroyFreeStorage (&Storage);
	SHOW_CHECKPOINT;
	return config;
}
Exemplo n.º 7
0
FeelConfig *
ParseFeelOptions (const char *filename, char *myname)
{
    ConfigData cd ; 
	ConfigDef *ConfigReader;
    FeelConfig *config = CreateFeelConfig ();
	FreeStorageElem *Storage = NULL, *pCurr;
    ConfigItem item;

	cd.filename = filename ; 
	ConfigReader = InitConfigReader (myname, &FeelSyntax, CDT_Filename, cd, BindingSpecialFunc);
	if (!ConfigReader)
  		return config;

    item.memory = NULL;
	PrintConfigReader (ConfigReader);
	ParseConfig (ConfigReader, &Storage);

	/* getting rid of all the crap first */
    StorageCleanUp (&Storage, &(config->more_stuff), CF_DISABLED_OPTION);

	for (pCurr = Storage; pCurr; pCurr = pCurr->next)
  	{
  	    if (pCurr->term == NULL)
			continue;
        if (ReadFlagItem (NULL, &(config->feel->flags), pCurr, FeelFlagsXref))
            continue;
        if (!ReadConfigItem (&item, pCurr))
			continue;
        switch (pCurr->term->id)
		{
            case FEEL_ClickTime_ID          :
                config->feel->ClickTime = item.data.integer;
                set_flags (config->feel->set_val_flags, FEEL_ClickTime);
                break ;
            case FEEL_OpaqueMove_ID         :
                config->feel->OpaqueMove = item.data.integer;
                set_flags (config->feel->set_val_flags, FEEL_OpaqueMove);
                break ;
            case FEEL_OpaqueResize_ID       :
                config->feel->OpaqueResize = item.data.integer;
                set_flags (config->feel->set_val_flags, FEEL_OpaqueResize);
                break ;
            case FEEL_AutoRaise_ID          :
                config->feel->AutoRaiseDelay = item.data.integer;
                set_flags (config->feel->set_val_flags, FEEL_AutoRaise);
                break ;
            case FEEL_AutoReverse_ID        :
                config->feel->AutoReverse = item.data.integer;
                set_flags (config->feel->set_val_flags, FEEL_AutoReverse);
                break ;
            case FEEL_ShadeAnimationSteps_ID :
                config->feel->ShadeAnimationSteps = item.data.integer;
                set_flags (config->feel->set_val_flags, FEEL_ShadeAnimationSteps);
                break ;

            case FEEL_XorValue_ID           :
                config->feel->XorValue = item.data.integer;
                set_flags (config->feel->set_val_flags, FEEL_XorValue);
                break ;
            case FEEL_Xzap_ID               :
                config->feel->Xzap = item.data.integer;
                set_flags (config->feel->set_val_flags, FEEL_Xzap);
                break ;
            case FEEL_Yzap_ID               :
                config->feel->Yzap = item.data.integer;
                set_flags (config->feel->set_val_flags, FEEL_Yzap);
                break ;

            case FEEL_Cursor_ID             :                   /* TT_INTEGER */
				/* TODO: backport from as-devel : */
                /*if ( item.index  > 0 && item.index < MAX_CURSORS)
                    config->feel->standard_cursors[item.index] = item.data.integer ;
				 */
                break ;
            case FEEL_CustomCursor_ID       :                   /* TT_BUTTON  */
				/* TODO: backport from as-devel : */
				/*
					if ( item.index  > 0 && item.index < MAX_CURSORS)
                	{
                    	if( config->feel->custom_cursors[item.index] )
                        	destroy_ascursor( &(config->feel->custom_cursors[item.index]));
                    	config->feel->custom_cursors[item.index] = item.data.cursor ;
                	}
				 */
                break ;

            case FEEL_ClickToRaise_ID       :                   /* TT_BITLIST */
                config->feel->RaiseButtons = item.data.integer ;
                set_flags (config->feel->set_val_flags, FEEL_ClickToRaise);
                set_flags (config->feel->set_flags, ClickToRaise);
				set_flags (config->feel->flags, ClickToRaise);
                break ;

            case FEEL_EdgeScroll_ID         :                   /* TT_INTARRAY*/
				item.ok_to_free = 1;
                if( item.data.int_array.size > 0 )
                {
                    config->feel->EdgeScrollX = item.data.int_array.array[0];
                    if( item.data.int_array.size > 1 )
                        config->feel->EdgeScrollY = item.data.int_array.array[1];
                    set_flags (config->feel->set_val_flags, FEEL_EdgeScroll );
                }
                break ;
            case FEEL_EdgeResistance_ID     :                   /* TT_INTARRAY*/
				item.ok_to_free = 1;
                if( item.data.int_array.size > 0 )
                {
                    config->feel->EdgeResistanceScroll = item.data.int_array.array[0];
                    if( item.data.int_array.size > 1 )
                        config->feel->EdgeResistanceMove = item.data.int_array.array[1];
                    set_flags (config->feel->set_val_flags, FEEL_EdgeResistance );
                }
                break ;

            case FEEL_Popup_ID              :
				/* TODO: backport from as-devel : */
                /* FreeStorage2MenuData( pCurr, &item, config->feel->Popups ); */
                break ;
            case FEEL_Function_ID           :
                FreeStorage2ComplexFunction( pCurr, &item, config->feel->ComplexFunctions );
                break ;
            case FEEL_Mouse_ID              :
                if( item.data.binding.sym )
                    if( isdigit( (int)item.data.binding.sym[0] ) && pCurr->sub )
                    {
                        int button_num = item.data.binding.sym[0] - '0' ;
                        if( button_num >= 0 && button_num <= MAX_MOUSE_BUTTONS &&
                            pCurr->sub->term->type == TT_FUNCTION )
                        {
                            ConfigItem func_item ;
                            func_item.memory = NULL ;
                            if( ReadConfigItem( &func_item, pCurr->sub ) )
							{
								MouseButton *tmp = safecalloc( 1, sizeof(MouseButton) );
								tmp->Button = button_num ;
								tmp->Modifier = item.data.binding.mods ;
								tmp->Context = item.data.binding.context ;
								tmp->fdata = func_item.data.function ;
								func_item.data.function = NULL ;
								tmp->NextButton = config->feel->MouseButtonRoot ;
								config->feel->MouseButtonRoot = tmp ;
							}
                            if( func_item.data.function )
                            {
                                func_item.ok_to_free = 1;
                                ReadConfigItem( &func_item, NULL );
                            }
                        }
                    }
                item.ok_to_free = 1;
                break ;
            case FEEL_Key_ID                :
                ParseKeyBinding( &item, pCurr->sub, &(config->feel->FuncKeyRoot) );
                break ;
          default:
				item.ok_to_free = 1;
		}
    }
	ReadConfigItem (&item, NULL);

	DestroyConfig (ConfigReader);
	DestroyFreeStorage (&Storage);
	return config;
}
Exemplo n.º 8
0
SoundConfig  *
ParseSoundOptions (const char *filename, char *myname)
{
	ConfigData cd ;
	ConfigDef    *SoundConfigReader;
	SoundConfig  *config = CreateSoundConfig ();

	FreeStorageElem *Storage = NULL, *pCurr;
	ConfigItem    item;

	cd.filename = filename ;
	SoundConfigReader = InitConfigReader (myname, &SoundSyntax, CDT_Filename, cd, NULL);
	if (!SoundConfigReader)
		return config;

	item.memory = NULL;
	PrintConfigReader (SoundConfigReader);
	ParseConfig (SoundConfigReader, &Storage);

	/* getting rid of all the crap first */
	StorageCleanUp (&Storage, &(config->more_stuff), CF_DISABLED_OPTION);

	for (pCurr = Storage; pCurr; pCurr = pCurr->next)
	{
		if (pCurr->term == NULL)
			continue;

		{
			if (!ReadConfigItem (&item, pCurr))
				continue;

			switch (pCurr->term->id)
			{
			 case SOUND_SOUND_ID:
                 if( pCurr->sub )
                 {
                    if( pCurr->sub->term && pCurr->sub->argv )
                        if( pCurr->sub->term->id >= EVENT_ID_START && pCurr->sub->term->id < EVENT_ID_END )
                            set_string( &(config->sounds[pCurr->sub->term->id-EVENT_ID_START]), mystrdup( pCurr->sub->argv[0] ));
                 }
				 break;
			 case SOUND_PCMDEVICE_ID:
				 //set_string( &(config->pcmdevice), item.data.string );
				 config->pcmdevice = item.data.string;
				 break;
			 case SOUND_PATH_ID:
			 	 config->path = item.data.string;
			 	 break;
			
			 case SOUND_DEBUG_ID:
			 	config->debug = (int)item.data.integer;
			 	break;
/*				 
			 case SOUND_DELAY_ID:
			 	 set_flags( config->set_flags, SOUND_SET_DELAY );
				 config->delay = (int)item.data.integer;
				 break;
	*/
	/*
			 case SOUND_RPLAY_HOST_ID:
			 	 set_string_value( &(config->rplay_host), item.data.string, &(config->set_flags), SOUND_SET_RPLAY_HOST );
				 break;
			 case SOUND_RPLAY_PRI_ID:
				 set_flags( config->set_flags, SOUND_SET_RPLAY_PRIORITY );
				 config->rplay_priority = (int)item.data.integer;
				 break;
			 case SOUND_RPLAY_VOL_ID:
				 set_flags( config->set_flags, SOUND_SET_RPLAY_VOLUME );
				 config->rplay_volume = (int)item.data.integer;
				 break;
	*/
			 default:
				 item.ok_to_free = 1;
			}
		}
	}

	ReadConfigItem (&item, NULL);

	DestroyConfig (SoundConfigReader);
	DestroyFreeStorage (&Storage);
	return config;

}
Exemplo n.º 9
0
void myback_parse (char *tline, FILE * fd, char **myname, int *mylook)
{
	FilePtrAndData fpd;
	ConfigDef *ConfigReader;
	MyBackgroundConfig *back_config = NULL;
	FreeStorageElem *Storage = NULL, *more_stuff = NULL;
	MyLook *look = (MyLook *) mylook;
	MyBackground *myback = NULL;
	ConfigData cd;

	if (look == NULL)
		look = get_screen_look (NULL);

	fpd.fp = fd;
	fpd.data = safemalloc (12 + 1 + strlen (tline) + 1 + 1);
	sprintf (fpd.data, "MyBackground %s\n", tline);
	LOCAL_DEBUG_OUT ("fd(%p)->tline(\"%s\")->fpd.data(\"%s\")", fd, tline,
									 fpd.data);
	cd.fileptranddata = &fpd;
	ConfigReader =
			InitConfigReader ((char *)myname, &MyBackgroundSyntax,
												CDT_FilePtrAndData, cd, NULL);
	free (fpd.data);

	if (!ConfigReader)
		return;

	PrintConfigReader (ConfigReader);
	ParseConfig (ConfigReader, &Storage);

	/* getting rid of all the crap first */
	StorageCleanUp (&Storage, &more_stuff, CF_DISABLED_OPTION);
	DestroyFreeStorage (&more_stuff);

	back_config = ParseMyBackgroundOptions (Storage, (char *)myname);

	DestroyConfig (ConfigReader);
	DestroyFreeStorage (&Storage);

	if (back_config == NULL)
		return;

	/* now we have to turn MyBackgroundConfig into MyBackground structure : */
	myback = create_myback (back_config->name);

	if (get_flags (back_config->flags, BGFLAG_FILE))
		myback->type = MB_BackImage;
	else if (get_flags (back_config->flags, BGFLAG_MYSTYLE))
		myback->type = MB_BackMyStyle;
	else
		myback->type = MB_BackCmd;

	myback->data = back_config->data;
	back_config->data = NULL;
	if (get_flags (back_config->flags, BGFLAG_CUT))
		myback->cut = back_config->cut;
	if (get_flags (back_config->flags, BGFLAG_SCALE)) {
		myback->scale = back_config->scale;
		if (!get_flags (back_config->scale.flags, WidthValue))
			myback->scale.width = get_screen_width (NULL);
		if (!get_flags (back_config->scale.flags, HeightValue))
			myback->scale.height = get_screen_height (NULL);
		set_flags (myback->scale.flags, WidthValue | HeightValue);
	}

	myback->tint = TINT_LEAVE_SAME;
	if (get_flags (back_config->flags, BGFLAG_TINT) && back_config->tint)
		parse_argb_color (back_config->tint, &(myback->tint));
	myback->pad_color = ARGB32_Black;
	if (get_flags (back_config->flags, BGFLAG_PAD) && back_config->pad)
		parse_argb_color (back_config->pad, &(myback->pad_color));

	myback->align_flags = NO_ALIGN;
	if (get_flags (back_config->flags, BGFLAG_PAD_HOR)) {
		if (get_flags (back_config->flags, BGFLAG_ALIGN_RIGHT))
			myback->align_flags = ALIGN_RIGHT;
		else if (get_flags (back_config->flags, BGFLAG_ALIGN_CENTER))
			myback->align_flags = ALIGN_HCENTER;
		else
			myback->align_flags = ALIGN_LEFT;
	}
	if (get_flags (back_config->flags, BGFLAG_PAD_VERT)) {
		if (get_flags (back_config->flags, BGFLAG_ALIGN_BOTTOM))
			myback->align_flags |= ALIGN_BOTTOM;
		else if (get_flags (back_config->flags, BGFLAG_ALIGN_CENTER))
			myback->align_flags |= ALIGN_VCENTER;
		else
			myback->align_flags = ALIGN_TOP;
	}
	LOCAL_DEBUG_OUT ("myback added: name(\"%s\")->type(%d)->data(\"%s\")",
									 myback->name, myback->type, myback->data);
	add_myback (look, myback);

	/* final cleanup : */
	DestroyMyBackgroundConfig (&back_config);
}