|
|
|
|
@ -44,7 +44,8 @@ void on_plug_added(GtkSocket* self, actionWidgets *builder){
|
|
|
|
|
gtk_widget_set_vexpand(GTK_WIDGET(builder->socketplace),1);
|
|
|
|
|
gtk_widget_set_vexpand(GTK_WIDGET(self),1);
|
|
|
|
|
gtk_widget_show(builder->socketplace);
|
|
|
|
|
|
|
|
|
|
if (main_config.WindowTheme==0)
|
|
|
|
|
gtk_widget_hide(builder->appSettings);
|
|
|
|
|
if (builder->ButtonBackToMain!=NULL) gtk_widget_set_sensitive(builder->ButtonBackToMain,1);
|
|
|
|
|
gtk_widget_show(GTK_WIDGET(self));
|
|
|
|
|
}
|
|
|
|
|
@ -56,6 +57,7 @@ void on_plug_removed(GtkSocket* self, actionWidgets *widgets){
|
|
|
|
|
//printf("Plug has been removed!\n\n\n");
|
|
|
|
|
gtk_widget_destroy(widgets->socketbutton);
|
|
|
|
|
|
|
|
|
|
gtk_widget_show(widgets->appSettings);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_Item_activated(GtkIconView* self, GtkTreePath* path, actionWidgets *applist){
|
|
|
|
|
@ -118,21 +120,29 @@ void on_gnome_Item_activated(GtkIconView* self, GtkTreePath* path, actionWidgets
|
|
|
|
|
if (tempapp[0].Type==2)
|
|
|
|
|
if (tempapp->Pluggable==1)
|
|
|
|
|
if (tempapp->DualPluggable==1){
|
|
|
|
|
char *dualarg=malloc(strlen("--socket-id= --socket-ext-id=")+30);
|
|
|
|
|
sprintf(dualarg,"--socket-id=%d --socket-ext-id=%d",gtk_socket_get_id(GTK_SOCKET(applist->socket)),gtk_socket_get_id(GTK_SOCKET(applist->socketbutton)));
|
|
|
|
|
char *dualarg=malloc(strlen("--socket-id= --socket-ext-id= --socket-trd-id=")+30);
|
|
|
|
|
sprintf(dualarg,"--socket-id=%d --socket-ext-id=%d --socket-trd-id=%d",gtk_socket_get_id(GTK_SOCKET(applist->socket)),gtk_socket_get_id(GTK_SOCKET(applist->socketbutton)),gtk_socket_get_id(GTK_SOCKET(applist->ThirdSocket)));
|
|
|
|
|
py_launch_app(tempapp[0].Exec,dualarg);
|
|
|
|
|
} else
|
|
|
|
|
gtk_widget_hide(applist->appSettings);
|
|
|
|
|
} else{
|
|
|
|
|
py_launch_app(tempapp[0].Exec,arg);
|
|
|
|
|
gtk_widget_destroy(applist->socketbutton);
|
|
|
|
|
}
|
|
|
|
|
else py_launch_app(tempapp[0].Exec,"");
|
|
|
|
|
else if (tempapp[0].Type==1){
|
|
|
|
|
if (tempapp->Pluggable==1)
|
|
|
|
|
if (tempapp->DualPluggable==1){
|
|
|
|
|
char *dualarg=malloc(strlen("--socket-id= --socket-ext-id=")+30);
|
|
|
|
|
sprintf(dualarg,"--socket-id=%d --socket-ext-id=%d",gtk_socket_get_id(GTK_SOCKET(applist->socket)),gtk_socket_get_id(GTK_SOCKET(applist->socketbutton)));
|
|
|
|
|
sprintf(dualarg,"--socket-id=%d --socket-ext-id=%d --socket-trd-id=%d",gtk_socket_get_id(GTK_SOCKET(applist->socket)),gtk_socket_get_id(GTK_SOCKET(applist->socketbutton)),gtk_socket_get_id(GTK_SOCKET(applist->ThirdSocket)));
|
|
|
|
|
launch_app_with_arguments(tempapp[0].Exec,dualarg);
|
|
|
|
|
} else
|
|
|
|
|
} else{
|
|
|
|
|
launch_app_with_arguments(tempapp[0].Exec,arg);
|
|
|
|
|
else launch_app(tempapp[0].Exec);
|
|
|
|
|
gtk_widget_destroy(applist->socketbutton);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
launch_app(tempapp[0].Exec);
|
|
|
|
|
gtk_widget_destroy(applist->socketbutton);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -243,6 +253,10 @@ int on_settings_accept(GtkWidget *button, dictionary **widgetsDs){
|
|
|
|
|
g_key_file_set_string(gfile,"window","IconSize",fromint);
|
|
|
|
|
sprintf(fromint,"%d",main_config.iconSegmentSize);
|
|
|
|
|
g_key_file_set_string(gfile,"window","IconSegmentSize",fromint);
|
|
|
|
|
sprintf(fromint,"%d",(int)((float)main_config.labelSize/1000));
|
|
|
|
|
g_key_file_set_string(gfile,"window","LabelSize",fromint);
|
|
|
|
|
sprintf(fromint,"%d",(int)((float)main_config.labelDensity/1000));
|
|
|
|
|
g_key_file_set_string(gfile,"window","LabelDensity",fromint);
|
|
|
|
|
for (dictionary *dict=widgets->ICSys->first;dict!=NULL;dict=dict->next){
|
|
|
|
|
IVGraphicals *IV=(IVGraphicals*)dict->data;
|
|
|
|
|
g_key_file_set_string(gfile,"sections",IV->sectionName,IV->categories);
|
|
|
|
|
@ -658,23 +672,22 @@ void launch_app_with_arguments(char *name, char *args){
|
|
|
|
|
path=yon_char_get_augumented(path,args);
|
|
|
|
|
printf("%s\n",path);
|
|
|
|
|
pthread_t thread_id;
|
|
|
|
|
pthread_create(&thread_id, NULL, launch, path);
|
|
|
|
|
pthread_create(&thread_id, NULL, (void*)launch, path);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void launch_app(char *name){
|
|
|
|
|
char *path=name;
|
|
|
|
|
pthread_t thread_id;
|
|
|
|
|
pthread_create(&thread_id, NULL, launch, path);
|
|
|
|
|
pthread_create(&thread_id, NULL, (void*)launch, path);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void py_launch_app(char *name,char *args){
|
|
|
|
|
char *path=malloc(strlen("python ./")+strlen(name)+6+strlen(args));
|
|
|
|
|
sprintf(path,"python ./%s.py %s &",name,args);
|
|
|
|
|
pthread_t thread_id;
|
|
|
|
|
pthread_create(&thread_id, NULL, launch, path);
|
|
|
|
|
pthread_create(&thread_id, NULL, (void*)launch, path);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
apps *get_app_by_name(apps *applist,char *name, int size){
|
|
|
|
|
for (int i=0;i<size;i++){
|
|
|
|
|
if (strcmp(applist[i].Name,name)==0) return &applist[i];
|
|
|
|
|
@ -739,6 +752,7 @@ GtkWidget *create_socket(actionWidgets *builder){
|
|
|
|
|
GtkWidget *socket;
|
|
|
|
|
socket = gtk_socket_new();
|
|
|
|
|
GtkWidget *socketbutton=gtk_socket_new();
|
|
|
|
|
GtkWidget *ThirdSocket=gtk_socket_new();
|
|
|
|
|
g_signal_connect(G_OBJECT(socket),"plug-added",G_CALLBACK(on_plug_added),builder);
|
|
|
|
|
g_signal_connect(G_OBJECT(socket),"plug-removed",G_CALLBACK(on_plug_removed),builder);
|
|
|
|
|
g_signal_connect(G_OBJECT(socket),"destroy",G_CALLBACK(on_plug_removed),builder);
|
|
|
|
|
@ -749,6 +763,9 @@ GtkWidget *create_socket(actionWidgets *builder){
|
|
|
|
|
gtk_box_pack_start(GTK_BOX(builder->socketplace),socket,true,true,0);
|
|
|
|
|
gtk_box_pack_start(GTK_BOX(builder->socketbuttonplace),socketbutton,1,1,0);
|
|
|
|
|
builder->socketbutton=socketbutton;
|
|
|
|
|
|
|
|
|
|
gtk_box_pack_start(GTK_BOX(builder->ThirdSocketPlace),ThirdSocket,1,1,0);
|
|
|
|
|
builder->ThirdSocket=ThirdSocket;
|
|
|
|
|
return socket;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
@ -803,8 +820,8 @@ apps *find_apps(int *sizef){
|
|
|
|
|
tempapp.Icon=g_key_file_get_string(gfile,"Desktop Entry", "Icon",NULL);
|
|
|
|
|
if (tempapp.Icon==NULL) continue;
|
|
|
|
|
tempapp.Pluggable=g_key_file_get_boolean(gfile,"Desktop Entry", "Pluggable",NULL);
|
|
|
|
|
if (tempapp.Pluggable==NULL) tempapp.Pluggable=g_key_file_get_boolean(gfile,"Desktop Entry", "X-XfcePluggable",NULL);
|
|
|
|
|
if (tempapp.Pluggable!=NULL) tempapp.DualPluggable=g_key_file_get_boolean(gfile,"Desktop Entry", "X-UBLPluggable",NULL);
|
|
|
|
|
if (!tempapp.Pluggable) tempapp.Pluggable=g_key_file_get_boolean(gfile,"Desktop Entry", "X-XfcePluggable",NULL);
|
|
|
|
|
if (tempapp.Pluggable) tempapp.DualPluggable=g_key_file_get_boolean(gfile,"Desktop Entry", "X-UBLPluggable",NULL);
|
|
|
|
|
if (size==0){
|
|
|
|
|
applist=(apps*)malloc(size+1*sizeof(apps));
|
|
|
|
|
applist[0].Name=yon_char_new(tempapp.Name);
|
|
|
|
|
@ -831,7 +848,6 @@ apps *find_apps(int *sizef){
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//printf("Closing apps configuration...\n");
|
|
|
|
|
*sizef=size;
|
|
|
|
|
return applist;
|
|
|
|
|
};
|
|
|
|
|
@ -901,6 +917,11 @@ int setup_config(){
|
|
|
|
|
main_config.WindowTheme=g_key_file_get_integer(configfile,"window","WindowTheme",NULL);
|
|
|
|
|
main_config.iconsize=g_key_file_get_integer(configfile,"window","IconSize",NULL);
|
|
|
|
|
main_config.iconSegmentSize=g_key_file_get_integer(configfile,"window","IconSegmentSize",NULL);
|
|
|
|
|
main_config.labelSize=g_key_file_get_integer(configfile,"window","LabelSize",NULL);
|
|
|
|
|
main_config.labelDensity=g_key_file_get_integer(configfile,"window","LabelDensity",NULL);
|
|
|
|
|
if (main_config.labelSize==0) main_config.labelSize=12;
|
|
|
|
|
if (main_config.labelDensity==0) main_config.labelDensity=0;
|
|
|
|
|
main_config.labelSize=main_config.labelSize*1000;
|
|
|
|
|
yon_icon_size_convert(0);
|
|
|
|
|
gsize length=0;
|
|
|
|
|
char **a=g_key_file_get_keys(configfile,"sections",&length,NULL);
|
|
|
|
|
@ -985,6 +1006,9 @@ IVGraphicals *yon_create_single_section_IV(char *name,char *cats){
|
|
|
|
|
GtkWidget *box=gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
|
|
|
|
|
GtkWidget *iv=gtk_icon_view_new();
|
|
|
|
|
GtkWidget *label=gtk_label_new(_(name));
|
|
|
|
|
PangoAttrList *attrs=pango_attr_list_new();
|
|
|
|
|
pango_attr_list_insert(attrs,pango_attr_size_new(main_config.labelSize));
|
|
|
|
|
gtk_label_set_attributes(GTK_LABEL(label),attrs);
|
|
|
|
|
gtk_widget_set_name(label,"iconlabel");
|
|
|
|
|
if (main_config.WindowTheme==1) {
|
|
|
|
|
gtk_icon_view_set_columns(GTK_ICON_VIEW(iv),1);
|
|
|
|
|
@ -1015,7 +1039,6 @@ IVGraphicals *yon_create_single_section_IV(char *name,char *cats){
|
|
|
|
|
IVG->IV=iv;
|
|
|
|
|
IVG->label=label;
|
|
|
|
|
IVG->sep=sep;
|
|
|
|
|
|
|
|
|
|
return IVG;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -1325,6 +1348,7 @@ void yon_segments_hide(actionWidgets *widgets){
|
|
|
|
|
} else return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void yon_dictionary_make_first(dictionary *dict){
|
|
|
|
|
for (dictionary *dct=dict->first;dct!=NULL;dct=dct->next){
|
|
|
|
|
dct->first=dict;
|
|
|
|
|
@ -1332,7 +1356,6 @@ void yon_dictionary_make_first(dictionary *dict){
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void yon_small_window_theme_change(actionWidgets *widgets){
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *theme_id, apps *applist, int appsize){
|
|
|
|
|
@ -1358,7 +1381,10 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them
|
|
|
|
|
curWidgets->GnomeInfoLabel=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,yon_char_get_augumented(theme_id,"InfoLabel")));
|
|
|
|
|
curWidgets->GnomeInfoDetailsLabel=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,yon_char_get_augumented(theme_id,"InfoDetailsLabel")));
|
|
|
|
|
curWidgets->socketbuttonplace=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,yon_char_get_augumented(theme_id,"socketbuttonplace")));
|
|
|
|
|
curWidgets->Overlay=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,yon_char_get_augumented(theme_id,"Overlay")));
|
|
|
|
|
curWidgets->ThirdSocketPlace=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,yon_char_get_augumented(theme_id,"ThirdSocketPlace")));
|
|
|
|
|
curWidgets->SettingsSections=NULL;
|
|
|
|
|
|
|
|
|
|
gtk_style_context_add_class(gtk_widget_get_style_context(curWidgets->icvpack),"iconview");
|
|
|
|
|
curWidgets->socket=GTK_WIDGET(create_socket(curWidgets));
|
|
|
|
|
curWidgets->MenuItemAboutSystem=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"MenuItemAboutSystem"));
|
|
|
|
|
@ -1511,6 +1537,7 @@ int main(int argc, char *argv[]){
|
|
|
|
|
load_apps((IVGraphicals*)cur->data,widg->applist,widg->appssize);
|
|
|
|
|
}
|
|
|
|
|
yon_show_icon_views(widg->ICSys,widg);
|
|
|
|
|
gtk_overlay_add_overlay(GTK_OVERLAY(widg->Overlay),widg->workingwindow);
|
|
|
|
|
theme="Gnome";
|
|
|
|
|
main_config.WindowTheme=1;
|
|
|
|
|
widgets->next=yon_dictionary_create_empty();
|
|
|
|
|
|