int main( int argc, char **argv ) { /* Save our program name - for error messages */ set_DeadPipe_handler(DeadPipe); InitMyApp (CLASS_IDENT, argc, argv, NULL, NULL, 0 ); LinkAfterStepConfig(); set_signal_handler( SIGSEGV ); ConnectX( ASDefaultScr, 0 ); ConnectAfterStep (WINDOW_CONFIG_MASK | WINDOW_NAME_MASK | M_END_WINDOWLIST, 0); Config = CreateIdentConfig (); /* Request a list of all windows, while we load our config */ SendInfo ("Send_WindowList", 0); LoadBaseConfig ( GetBaseOptions); LoadColorScheme(); LoadConfig ("ident", GetOptions); CheckConfigSanity(); ReloadASDatabase(); ReloadCategories(True); if (MyArgs.src_window == 0) MyArgs.src_window = get_target_window(); /* And at long last our main loop : */ HandleEvents(); return 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; }
void CheckConfigSanity() { char buf[256]; if( Config == NULL ) Config = CreateIdentConfig (); if( Config->geometry.width <= 10 ) Config->geometry.width = 512; if( Config->geometry.height <= 10 ) Config->geometry.height = 512; mystyle_get_property (Scr.wmprops); sprintf( buf, "*%sTile", get_application_name() ); LOCAL_DEBUG_OUT("Attempting to use style \"%s\"", buf); Scr.Look.MSWindow[BACK_UNFOCUSED] = mystyle_find_or_default( buf ); LOCAL_DEBUG_OUT("Will use style \"%s\", overlay = %p.", Scr.Look.MSWindow[BACK_UNFOCUSED]->name, Scr.Look.MSWindow[BACK_UNFOCUSED]->overlay ); }