bill_klpd
|
2013-08-16
, 20:20
|
Posts: 383 |
Thanked: 344 times |
Joined on Jun 2013
@ Greece, Athens
|
#101
|
|
2013-08-16
, 22:53
|
|
Posts: 381 |
Thanked: 336 times |
Joined on Jan 2011
@ Stockholm, Sweden
|
#102
|
The Following User Says Thank You to electroaudio For This Useful Post: | ||
|
2013-08-17
, 11:53
|
|
Posts: 381 |
Thanked: 336 times |
Joined on Jan 2011
@ Stockholm, Sweden
|
#103
|
confyfile="/home/user/.deskypplet/deskypplet.conf"; get_sizes (confyfile);
if(strstr(readbuf,"title height")) sscanf(readbuf,"title height=%d\n",&(app->title_height));
void get_sizes (gchar *conffile) { /*printf ("get_sizes conffile %s\n",conffile);*/ GIOChannel *f=NULL; GIOStatus st; GdkColormap *colormap; gchar *readbuf=NULL; gchar *fontbuffer=NULL; gchar *red=NULL; gchar *green=NULL; gchar *blue=NULL; /*gdk_color_parse (DEFAULT_COLOR, &(app->color)); gdk_color_parse (DEFAULT_FONT_COLOR, &(app->fontcolor)); app->fontname=g_new0(gchar,strlen(DEFAULT_FONT)+1); strcpy(app->fontname,DEFAULT_FONT); app->bg_alpha=(gfloat)DEFAULT_BG_ALPHA/100;*/ f=g_io_channel_new_file(conffile,"r",NULL); if(f!=NULL) { while((st=g_io_channel_read_line(f,&readbuf,NULL,NULL,NULL) )!=G_IO_STATUS_EOF) { if(strstr(readbuf,"bgcolor=")) { red=strchr(readbuf,'=')+1; green=strchr(red,','); *green=0; green+=1; blue=strchr(green,','); *blue=0; blue+=1; fontbuffer=strchr(blue,'\n'); *fontbuffer=0; (app->color).red=(guint16)atoi(red); (app->color).green=(guint16)atoi(green); (app->color).blue=(guint16)atoi(blue); colormap=gdk_colormap_get_system(); gdk_colormap_alloc_color(colormap,&(app->color),TRUE,TRUE); } if(strstr(readbuf,"bgalpha")) { gint alpha; sscanf(readbuf,"bgalpha=%d\n",&alpha); app->bg_alpha=(gfloat)alpha/100; } if(strstr(readbuf,"autorefresh active")) sscanf(readbuf,"autorefresh active=%d\n",&(autorefresh)); if(strstr(readbuf,"icons size")) { sscanf(readbuf,"icons size=%d\n",&(app->icon_x_size)); app->icon_y_size=app->icon_x_size; } if(strstr(readbuf,"filename textbox height")) sscanf(readbuf,"filename textbox height=%d\n",&(app->icon_label_y_size)); if(strstr(readbuf,"filename textbox width")) sscanf(readbuf,"filename textbox width=%d\n",&(app->icon_label_x_size)); if(strstr(readbuf,"bookmark icons size")) { sscanf(readbuf,"bookmark icons size=%d\n",&(app->bookm_x_size)); app->bookm_y_size=app->bookm_x_size; } if(strstr(readbuf,"bookmark textbox height")) sscanf(readbuf,"bookmark textbox height=%d\n",&(app->bookm_label_y_size)); if(strstr(readbuf,"bookmark textbox width")) sscanf(readbuf,"bookmark textbox width=%d\n",&(app->bookm_label_x_size)); if(strstr(readbuf,"font for filenames=")) { fontbuffer=strchr(readbuf,'\n'); *fontbuffer=0; fontbuffer=strchr(readbuf,'=')+1; app->files_name_size=g_new0(gchar,strlen(fontbuffer)+1); strcpy(app->files_name_size,fontbuffer); } if(strstr(readbuf,"font for bookmarks=")) { fontbuffer=strchr(readbuf,'\n'); *fontbuffer=0; fontbuffer=strchr(readbuf,'=')+1; app->bookmarks_name_size=g_new0(gchar,strlen(fontbuffer)+1); strcpy(app->bookmarks_name_size,fontbuffer); } if(strstr(readbuf,"title buttons size")) sscanf(readbuf,"title buttons size=%d\n",&(app->title_button_size)); if(strstr(readbuf,"title height")) sscanf(readbuf,"title height=%d\n",&(app->title_height)); if(strstr(readbuf,"font for title=")) { fontbuffer=strchr(readbuf,'\n'); *fontbuffer=0; fontbuffer=strchr(readbuf,'=')+1; app->title_font_size=g_new0(gchar,strlen(fontbuffer)+1); strcpy(app->title_font_size,fontbuffer); } if(strstr(readbuf,"fontcolor")) { red=strchr(readbuf,'=')+1; green=strchr(red,','); *green=0; green+=1; blue=strchr(green,','); *blue=0; blue+=1; fontbuffer=strchr(blue,'\n'); *fontbuffer=0; (app->fontcolor).red=(guint16)atoi(red); (app->fontcolor).green=(guint16)atoi(green); (app->fontcolor).blue=(guint16)atoi(blue); colormap=gdk_colormap_get_system(); gdk_colormap_alloc_color(colormap,&(app->fontcolor),TRUE,TRUE); } g_free(readbuf); } g_io_channel_close(f); } if (autorefresh==1) {autorefresh_status="Autorefresh Activated";} else {autorefresh_status="Autorefresh Deactivated";} return;
/*read preferences from config file and load into object*/ void get_sizes (gchar *conffile);
|
2013-11-05
, 20:08
|
Posts: 383 |
Thanked: 344 times |
Joined on Jun 2013
@ Greece, Athens
|
#105
|
I am using that type of theme recently it is more effective and gives you a comfort ....!
|
2013-11-19
, 20:17
|
|
Posts: 1,239 |
Thanked: 1,278 times |
Joined on Aug 2011
@ Balochistan
|
#106
|