|
|
|
@ -52,14 +52,13 @@ void on_monitor_config_save(GtkWidget *self, monitor_edit_window *window){
|
|
|
|
config->position_port = (char*)gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->templateMonitorConfigurationPositionPortCombo));
|
|
|
|
config->position_port = (char*)gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->templateMonitorConfigurationPositionPortCombo));
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
config->resolution=yon_char_divide_search(gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->templateMonitorConfigurationResolutionCombo))," ",-1);
|
|
|
|
if (gtk_combo_box_get_active(GTK_COMBO_BOX(window->templateMonitorConfigurationResolutionCombo))!=0) {
|
|
|
|
|
|
|
|
config->resolution = (char*)gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->templateMonitorConfigurationResolutionCombo));
|
|
|
|
int rotation = gtk_combo_box_get_active(GTK_COMBO_BOX(window->templateMonitorConfigurationRotationCombo));
|
|
|
|
int rotation = gtk_combo_box_get_active(GTK_COMBO_BOX(window->templateMonitorConfigurationRotationCombo));
|
|
|
|
if (rotation==1) config->rotation=rotation;
|
|
|
|
if (rotation==1) config->rotation=rotation;
|
|
|
|
else if (rotation==2) config->rotation=rotation;
|
|
|
|
else if (rotation==2) config->rotation=rotation;
|
|
|
|
else if (rotation==3) config->rotation=rotation;
|
|
|
|
else if (rotation==3) config->rotation=rotation;
|
|
|
|
else config->rotation=0;
|
|
|
|
else config->rotation=0;
|
|
|
|
if (gtk_combo_box_get_active(GTK_COMBO_BOX(window->templateMonitorConfigurationResolutionCombo))!=0) {
|
|
|
|
|
|
|
|
char *resolution = (char*)gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->templateMonitorConfigurationResolutionCombo));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (gtk_combo_box_get_active(GTK_COMBO_BOX(window->templateMonitorConfigurationResolutionCombo))!=0) {
|
|
|
|
if (gtk_combo_box_get_active(GTK_COMBO_BOX(window->templateMonitorConfigurationResolutionCombo))!=0) {
|
|
|
|
char *frequency = (char*)gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->templateMonitorConfigurationFrequencyCombo));
|
|
|
|
char *frequency = (char*)gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->templateMonitorConfigurationFrequencyCombo));
|
|
|
|
@ -88,6 +87,8 @@ gtk_revealer_set_reveal_child(GTK_REVEALER(widgets->TerminalMoreRevieler),active
|
|
|
|
void on_terminal_destroy(GtkWidget *self, widgets_dict *widgets){
|
|
|
|
void on_terminal_destroy(GtkWidget *self, widgets_dict *widgets){
|
|
|
|
gtk_revealer_set_reveal_child(GTK_REVEALER(widgets->TerminalRevealer),0);
|
|
|
|
gtk_revealer_set_reveal_child(GTK_REVEALER(widgets->TerminalRevealer),0);
|
|
|
|
gtk_widget_destroy(widgets->TerminalRevealer);
|
|
|
|
gtk_widget_destroy(widgets->TerminalRevealer);
|
|
|
|
|
|
|
|
yon_proprieary_get();
|
|
|
|
|
|
|
|
yon_gtk_list_store_fill_with_proprietaries(videoconfig.list);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void child_ready(VteTerminal *terminal, GPid pid, GError *error, gpointer user_data)
|
|
|
|
static void child_ready(VteTerminal *terminal, GPid pid, GError *error, gpointer user_data)
|
|
|
|
@ -270,20 +271,6 @@ void on_port_chosen_changed(GtkWidget *self, monitor_edit_window *window){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_save_driver_configuration(GtkWidget *self,combo_tree *widgets){
|
|
|
|
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
|
|
|
char *name;
|
|
|
|
|
|
|
|
GtkTreeModel *list_s=GTK_TREE_MODEL(videoconfig.list);
|
|
|
|
|
|
|
|
GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->tree));
|
|
|
|
|
|
|
|
gtk_tree_selection_get_selected(selection,&list_s,&iter);
|
|
|
|
|
|
|
|
gtk_tree_model_get(list_s,&iter,0,&name,-1);
|
|
|
|
|
|
|
|
int ret = yon_gtk_combo_box_text_find(widgets->combo,name);
|
|
|
|
|
|
|
|
if (ret!=-1)
|
|
|
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->combo),ret);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
on_subwindow_close(self);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void on_sensitive_change(GtkWidget *self, GtkWidget *toggle)
|
|
|
|
void on_sensitive_change(GtkWidget *self, GtkWidget *toggle)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int state = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(self));
|
|
|
|
int state = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(self));
|
|
|
|
@ -578,7 +565,7 @@ void on_monitor_configure(GtkWidget *self,monitor_window *window){
|
|
|
|
dictionary *dict=NULL;
|
|
|
|
dictionary *dict=NULL;
|
|
|
|
for (int i=0;i<videoconfig.portssize;i++){
|
|
|
|
for (int i=0;i<videoconfig.portssize;i++){
|
|
|
|
dictionary *check_if_exists = yon_dictionary_find(&videoconfig.monitors,videoconfig.ports[i]);
|
|
|
|
dictionary *check_if_exists = yon_dictionary_find(&videoconfig.monitors,videoconfig.ports[i]);
|
|
|
|
if (!yon_dictionary_get_data(check_if_exists,monitorconfig*)->stringparameters&&check_if_exists!=monitors->config)
|
|
|
|
if (!check_if_exists||!yon_dictionary_get_data(check_if_exists,monitorconfig*)->stringparameters||check_if_exists==monitors->config)
|
|
|
|
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(monitors->templateMonitorConfigurationPortCombo),videoconfig.ports[i]);
|
|
|
|
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(monitors->templateMonitorConfigurationPortCombo),videoconfig.ports[i]);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -652,37 +639,6 @@ void yon_monitor_window_update(monitor_edit_window *window){
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void yon_popen(thread_input *input){
|
|
|
|
|
|
|
|
*(FILE**)input->data=popen(input->command,"r");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// void yon_launch_with_output(char *command){
|
|
|
|
|
|
|
|
// pthread_t tid;
|
|
|
|
|
|
|
|
// FILE *output =NULL;
|
|
|
|
|
|
|
|
// FILE **output_file=&output;
|
|
|
|
|
|
|
|
// thread_input input;
|
|
|
|
|
|
|
|
// input.command=command;
|
|
|
|
|
|
|
|
// input.data=output_file;
|
|
|
|
|
|
|
|
// pthread_create(&tid,NULL,(void*)yon_popen,&input);
|
|
|
|
|
|
|
|
// char *output_strings = "";
|
|
|
|
|
|
|
|
// int i = 0;
|
|
|
|
|
|
|
|
// char str[1000];
|
|
|
|
|
|
|
|
// memset(str, 0, 1000);
|
|
|
|
|
|
|
|
// while (1){
|
|
|
|
|
|
|
|
// clock();
|
|
|
|
|
|
|
|
// if (output){
|
|
|
|
|
|
|
|
// if (fgets(str, 1000, output)){
|
|
|
|
|
|
|
|
// output_strings=yon_char_get_augumented(output_strings,str);
|
|
|
|
|
|
|
|
// videoconfig.status_render.text_to_render=output_strings;
|
|
|
|
|
|
|
|
// videoconfig.status_render.type=BACKGROUND_IMAGE_SUCCESS_TYPE;
|
|
|
|
|
|
|
|
// _yon_ubl_status_box_render(&videoconfig.status_render);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// float passed = clock();
|
|
|
|
|
|
|
|
// if ((passed=passed/_SC_CLK_TCK)<0.5)
|
|
|
|
|
|
|
|
// sleep(passed);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**void yon_monitor_view_draw_all(GtkWidget *cnt)
|
|
|
|
/**void yon_monitor_view_draw_all(GtkWidget *cnt)
|
|
|
|
* [EN]
|
|
|
|
* [EN]
|
|
|
|
@ -704,7 +660,9 @@ void yon_monitor_view_draw_all(GtkWidget *cnt){
|
|
|
|
for_dictionaries(dict,videoconfig.monitor_visuals){
|
|
|
|
for_dictionaries(dict,videoconfig.monitor_visuals){
|
|
|
|
monitor_window *window = yon_dictionary_get_data(dict,monitor_window*);
|
|
|
|
monitor_window *window = yon_dictionary_get_data(dict,monitor_window*);
|
|
|
|
if(dict->first==dict) {}
|
|
|
|
if(dict->first==dict) {}
|
|
|
|
else gtk_box_pack_start(GTK_BOX(container),window->templateMonitorscreenOverlay,0,0,0);
|
|
|
|
else {
|
|
|
|
|
|
|
|
gtk_box_pack_start(GTK_BOX(container),window->templateMonitorscreenOverlay,0,0,0);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
monitor_window *window = yon_dictionary_get_data(videoconfig.monitor_visuals->first,monitor_window*);
|
|
|
|
monitor_window *window = yon_dictionary_get_data(videoconfig.monitor_visuals->first,monitor_window*);
|
|
|
|
gtk_box_pack_start(GTK_BOX(container),window->templateMonitorscreenOverlay,0,0,0);
|
|
|
|
gtk_box_pack_start(GTK_BOX(container),window->templateMonitorscreenOverlay,0,0,0);
|
|
|
|
@ -742,8 +700,20 @@ void yon_monitor_view_update(){
|
|
|
|
gtk_label_set_text(GTK_LABEL(monitor->templateMonitorInfoNameLabel),yon_char_get_augumented(MONITOR_LABEL,monitor->config->key));
|
|
|
|
gtk_label_set_text(GTK_LABEL(monitor->templateMonitorInfoNameLabel),yon_char_get_augumented(MONITOR_LABEL,monitor->config->key));
|
|
|
|
else
|
|
|
|
else
|
|
|
|
gtk_label_set_text(GTK_LABEL(monitor->templateMonitorInfoNameLabel),yon_char_get_augumented(MONITOR_LABEL,""));
|
|
|
|
gtk_label_set_text(GTK_LABEL(monitor->templateMonitorInfoNameLabel),yon_char_get_augumented(MONITOR_LABEL,""));
|
|
|
|
|
|
|
|
monitorconfig *params=yon_dictionary_get_data(yon_dictionary_get_data(dict,monitor_window*)->config,monitorconfig*);
|
|
|
|
|
|
|
|
gtk_widget_set_sensitive(yon_dictionary_get_data(dict,monitor_window*)->templateMonitorImage,params->enable);
|
|
|
|
if (config->resolution)
|
|
|
|
if (config->resolution)
|
|
|
|
gtk_label_set_text(GTK_LABEL(monitor->templateMonitorInfoResolutionLabel),config->resolution);
|
|
|
|
gtk_label_set_text(GTK_LABEL(monitor->templateMonitorInfoResolutionLabel),config->resolution);
|
|
|
|
|
|
|
|
else if (params->stringparameters){
|
|
|
|
|
|
|
|
int size=0;
|
|
|
|
|
|
|
|
config_str rtn=yon_char_parse(params->stringparameters,&size,",");
|
|
|
|
|
|
|
|
char *res=yon_char_parsed_get_resolution(rtn,size);
|
|
|
|
|
|
|
|
if (res&&strcmp(res,"")!=0)
|
|
|
|
|
|
|
|
gtk_label_set_text(GTK_LABEL(monitor->templateMonitorInfoResolutionLabel),res);
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
gtk_label_set_text(GTK_LABEL(monitor->templateMonitorInfoResolutionLabel),PARAMETER_DEFAULT_LABEL);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
gtk_label_set_text(GTK_LABEL(monitor->templateMonitorInfoResolutionLabel),PARAMETER_DEFAULT_LABEL);
|
|
|
|
gtk_label_set_text(GTK_LABEL(monitor->templateMonitorInfoResolutionLabel),PARAMETER_DEFAULT_LABEL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -926,8 +896,8 @@ void on_config_fill_interface(widgets_dict *widgets)
|
|
|
|
gtk_combo_box_text_remove_all(GTK_COMBO_BOX_TEXT(widgets->mainDriverFailsafeNvidiaCombo));
|
|
|
|
gtk_combo_box_text_remove_all(GTK_COMBO_BOX_TEXT(widgets->mainDriverFailsafeNvidiaCombo));
|
|
|
|
|
|
|
|
|
|
|
|
str = videoconfig.failsafenVidia;
|
|
|
|
str = videoconfig.failsafenVidia;
|
|
|
|
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widgets->mainDriverFailsafeNvidiaCombo), _("Don't use"));
|
|
|
|
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widgets->mainDriverFailsafeNvidiaCombo), DONT_USE_LABEL);
|
|
|
|
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widgets->mainDriverFailsafeNvidiaCombo), _("fbdev"));
|
|
|
|
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widgets->mainDriverFailsafeNvidiaCombo), FBDEV_LABEL);
|
|
|
|
if (str)
|
|
|
|
if (str)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->mainDriverFailsafeNvidiaCombo), 1);
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->mainDriverFailsafeNvidiaCombo), 1);
|
|
|
|
@ -937,8 +907,8 @@ void on_config_fill_interface(widgets_dict *widgets)
|
|
|
|
gtk_combo_box_text_remove_all(GTK_COMBO_BOX_TEXT(widgets->mainDriverFailsafeAMDCombo));
|
|
|
|
gtk_combo_box_text_remove_all(GTK_COMBO_BOX_TEXT(widgets->mainDriverFailsafeAMDCombo));
|
|
|
|
|
|
|
|
|
|
|
|
str = videoconfig.failsafeATI;
|
|
|
|
str = videoconfig.failsafeATI;
|
|
|
|
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widgets->mainDriverFailsafeAMDCombo), _("Don't use"));
|
|
|
|
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widgets->mainDriverFailsafeAMDCombo), DONT_USE_LABEL);
|
|
|
|
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widgets->mainDriverFailsafeAMDCombo), _("fbdev"));
|
|
|
|
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widgets->mainDriverFailsafeAMDCombo), FBDEV_LABEL);
|
|
|
|
if (str)
|
|
|
|
if (str)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->mainDriverFailsafeAMDCombo), 1);
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->mainDriverFailsafeAMDCombo), 1);
|
|
|
|
@ -952,17 +922,24 @@ void on_config_fill_interface(widgets_dict *widgets)
|
|
|
|
* [EN]
|
|
|
|
* [EN]
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
dictionary *yon_proprieary_get(){
|
|
|
|
dictionary *yon_proprieary_get(){
|
|
|
|
|
|
|
|
videoconfig.proprietary=NULL;
|
|
|
|
|
|
|
|
int drivers_size=0;
|
|
|
|
|
|
|
|
config_str drivers=yon_config_load(get_proprietary_drivers_command,&drivers_size);
|
|
|
|
int size=0;
|
|
|
|
int size=0;
|
|
|
|
char **rtn = yon_config_load(get_proprietary_drivers_command,&size);
|
|
|
|
char **rtn = yon_config_load(get_proprietary_drivers_info_command,&size);
|
|
|
|
|
|
|
|
for (int drivers_found=0;drivers_found<drivers_size;drivers_found++){
|
|
|
|
for (int i=0;i<size;i++){
|
|
|
|
drivers[drivers_found]=yon_char_divide_search(drivers[drivers_found],"\n",-1);
|
|
|
|
rtn[i] = yon_char_divide_search(rtn[i],"\n",-1);
|
|
|
|
for (int i=0;i<size;i++){
|
|
|
|
char *key=yon_char_new(rtn[i]);
|
|
|
|
rtn[i] = yon_char_divide_search(rtn[i],"\n",-1);
|
|
|
|
if (key[0]==':')
|
|
|
|
char *key=yon_char_new(rtn[i]);
|
|
|
|
yon_char_divide_search(key,":",-1);
|
|
|
|
if (key[0]==':')
|
|
|
|
key = yon_char_divide_search(key,":",-1);
|
|
|
|
yon_char_divide_search(key,":",-1);
|
|
|
|
if (i==0) videoconfig.proprietary=yon_dictionary_create_with_data(key,rtn[i]);
|
|
|
|
key = yon_char_divide_search(key,":",-1);
|
|
|
|
else videoconfig.proprietary=yon_dictionary_create_with_data_connected(videoconfig.proprietary,key,rtn[i]);
|
|
|
|
char *driver_name=yon_char_divide_search(yon_char_new(drivers[drivers_found])," ",-1);
|
|
|
|
|
|
|
|
if (strcmp(key,driver_name)==0)
|
|
|
|
|
|
|
|
if (i==0) videoconfig.proprietary=yon_dictionary_create_with_data(drivers[drivers_found],rtn[i]);
|
|
|
|
|
|
|
|
else videoconfig.proprietary=yon_dictionary_create_with_data_connected(videoconfig.proprietary,drivers[drivers_found],rtn[i]);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -971,13 +948,26 @@ dictionary *yon_proprieary_get(){
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void yon_gtk_list_store_fill_with_proprietaries(GtkListStore *list){
|
|
|
|
void yon_gtk_list_store_fill_with_proprietaries(GtkListStore *list){
|
|
|
|
dictionary *dict=NULL;
|
|
|
|
dictionary *dict=NULL;
|
|
|
|
|
|
|
|
gtk_list_store_clear(list);
|
|
|
|
for_dictionaries(dict,videoconfig.proprietary){
|
|
|
|
for_dictionaries(dict,videoconfig.proprietary){
|
|
|
|
GtkTreeIter iter;
|
|
|
|
GtkTreeIter iter;
|
|
|
|
int size=0;
|
|
|
|
int size=0;
|
|
|
|
config_str str = yon_char_parse((char*)dict->data,&size,":");
|
|
|
|
config_str str = yon_char_parse((char*)dict->data,&size,":");
|
|
|
|
gtk_list_store_append(list,&iter);
|
|
|
|
gtk_list_store_append(list,&iter);
|
|
|
|
gtk_list_store_set(list,&iter,1,str[1],2,str[2],3,str[3],4,str[4],-1);
|
|
|
|
gtk_list_store_set(list,&iter,1,str[0],2,str[1],3,str[2],4,str[3],-1);
|
|
|
|
|
|
|
|
if (strstr(dict->key," installed"))
|
|
|
|
|
|
|
|
gtk_list_store_set(list,&iter,0,1,-1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
char *yon_char_remove_brackets(char* source){
|
|
|
|
|
|
|
|
if (source){
|
|
|
|
|
|
|
|
char *src=yon_char_new(source);
|
|
|
|
|
|
|
|
if (src[0]=='\"') yon_char_divide_search(src,"\"",-1);
|
|
|
|
|
|
|
|
if (src[strlen(src)-1]=='\"') src=yon_char_divide_search(src,"\"",-1);
|
|
|
|
|
|
|
|
return src;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**void yon_setup_config(char *configcommand)
|
|
|
|
/**void yon_setup_config(char *configcommand)
|
|
|
|
@ -1014,20 +1004,20 @@ void yon_setup_config(char *configcommand)
|
|
|
|
param=yon_config_get_parameter(videoconfig.loaded_config,videoconfig.configsize,"OPTIRUN");
|
|
|
|
param=yon_config_get_parameter(videoconfig.loaded_config,videoconfig.configsize,"OPTIRUN");
|
|
|
|
if (param){
|
|
|
|
if (param){
|
|
|
|
yon_char_divide_search(param,"=",-1);
|
|
|
|
yon_char_divide_search(param,"=",-1);
|
|
|
|
videoconfig.optirun=yon_char_new(param);
|
|
|
|
videoconfig.optirun=yon_char_remove_brackets(yon_char_new(param));
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
param=yon_config_get_parameter(videoconfig.loaded_config,videoconfig.configsize,"PRIMUSRUN");
|
|
|
|
param=yon_config_get_parameter(videoconfig.loaded_config,videoconfig.configsize,"PRIMUSRUN");
|
|
|
|
if (param){
|
|
|
|
if (param){
|
|
|
|
yon_char_divide_search(param,"=",-1);
|
|
|
|
yon_char_divide_search(param,"=",-1);
|
|
|
|
videoconfig.primusrun=yon_char_new(param);
|
|
|
|
videoconfig.primusrun=yon_char_remove_brackets(yon_char_new(param));
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (int i=0;i<videoconfig.portssize;i++){
|
|
|
|
for (int i=0;i<videoconfig.portssize;i++){
|
|
|
|
videoconfig.ports[i] = yon_char_divide_search(videoconfig.ports[i],"\n",-1);
|
|
|
|
videoconfig.ports[i] = yon_char_divide_search(videoconfig.ports[i],"\n",-1);
|
|
|
|
param=yon_config_get_parameter(videoconfig.loaded_config,videoconfig.configsize,XORG_MONITOR(videoconfig.ports[i]));
|
|
|
|
param=yon_config_get_parameter(videoconfig.loaded_config,videoconfig.configsize,XORG_MONITOR(videoconfig.ports[i]));
|
|
|
|
videoconfig.monitors = yon_monitor_config_new(videoconfig.ports[i]);
|
|
|
|
|
|
|
|
if (param){
|
|
|
|
if (param){
|
|
|
|
|
|
|
|
videoconfig.monitors = yon_monitor_config_new(videoconfig.ports[i]);
|
|
|
|
yon_char_divide_search(param,"=",-1);
|
|
|
|
yon_char_divide_search(param,"=",-1);
|
|
|
|
yon_monitor_config_update(yon_dictionary_get_data(videoconfig.monitors,monitorconfig*),videoconfig.ports[i],param);
|
|
|
|
yon_monitor_config_update(yon_dictionary_get_data(videoconfig.monitors,monitorconfig*),videoconfig.ports[i],param);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -1040,40 +1030,6 @@ void yon_setup_config(char *configcommand)
|
|
|
|
yon_proprieary_get();
|
|
|
|
yon_proprieary_get();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
driver_window *on_driver_window_open(GtkWidget *self, GtkWidget *comboe)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
GtkBuilder *builder = gtk_builder_new_from_file(glade_path);
|
|
|
|
|
|
|
|
driver_window *widgets = NULL;
|
|
|
|
|
|
|
|
widgets = malloc(sizeof(driver_window));
|
|
|
|
|
|
|
|
widgets->window = yon_gtk_builder_get_widget(builder, "ProprietaryDriverChooseWindow");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
widgets->propriearyTreeView = yon_gtk_builder_get_widget(builder, "propriearyTreeView");
|
|
|
|
|
|
|
|
widgets->ProprietaryDriverColumn = GTK_TREE_VIEW_COLUMN(gtk_builder_get_object(builder, "ProprietaryDriverColumn"));
|
|
|
|
|
|
|
|
widgets->ProprietaryDescriptionColumn = GTK_TREE_VIEW_COLUMN(gtk_builder_get_object(builder, "ProprietaryDescriptionColumn"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
widgets->ProprietaryCloseButton = yon_gtk_builder_get_widget(builder, "ProprietaryCloseButton");
|
|
|
|
|
|
|
|
widgets->ProprietaryAcceptButton = yon_gtk_builder_get_widget(builder, "ProprietaryAcceptButton");
|
|
|
|
|
|
|
|
if(!videoconfig.list)
|
|
|
|
|
|
|
|
videoconfig.list = GTK_LIST_STORE(gtk_builder_get_object(builder, "liststore6"));
|
|
|
|
|
|
|
|
gtk_list_store_clear(videoconfig.list);
|
|
|
|
|
|
|
|
yon_gtk_list_store_fill_with_proprietaries(videoconfig.list);
|
|
|
|
|
|
|
|
gtk_button_set_label(GTK_BUTTON(widgets->ProprietaryCloseButton), CANCEL_LABEL);
|
|
|
|
|
|
|
|
gtk_button_set_label(GTK_BUTTON(widgets->ProprietaryAcceptButton), ACCEPT_LABEL);
|
|
|
|
|
|
|
|
gtk_tree_view_set_model(GTK_TREE_VIEW(widgets->propriearyTreeView),GTK_TREE_MODEL(videoconfig.list));
|
|
|
|
|
|
|
|
gtk_tree_view_column_set_title(GTK_TREE_VIEW_COLUMN(widgets->ProprietaryDriverColumn), INSTALLED_LABEL);
|
|
|
|
|
|
|
|
gtk_tree_view_column_set_title(GTK_TREE_VIEW_COLUMN(widgets->ProprietaryDriverColumn), PACKAGE_LABEL);
|
|
|
|
|
|
|
|
gtk_tree_view_column_set_title(GTK_TREE_VIEW_COLUMN(widgets->ProprietaryDriverColumn), SUPPORTED_LABEL);
|
|
|
|
|
|
|
|
gtk_tree_view_column_set_title(GTK_TREE_VIEW_COLUMN(widgets->ProprietaryDriverColumn), DRIVER_LABEL);
|
|
|
|
|
|
|
|
gtk_tree_view_column_set_title(GTK_TREE_VIEW_COLUMN(widgets->ProprietaryDescriptionColumn), DESCRIPTION_LABEL);
|
|
|
|
|
|
|
|
gtk_widget_show(widgets->window);
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->ProprietaryCloseButton), "clicked", G_CALLBACK(on_subwindow_close), NULL);
|
|
|
|
|
|
|
|
combo_tree *trcm=NULL;
|
|
|
|
|
|
|
|
trcm=malloc(sizeof(combo_tree));
|
|
|
|
|
|
|
|
trcm->combo=comboe;
|
|
|
|
|
|
|
|
trcm->tree=widgets->propriearyTreeView;
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->ProprietaryAcceptButton), "clicked", G_CALLBACK(on_save_driver_configuration), trcm);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** monitor_config yon_monitor_config_new(char *port)
|
|
|
|
/** monitor_config yon_monitor_config_new(char *port)
|
|
|
|
* [EN]
|
|
|
|
* [EN]
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@ -1135,8 +1091,12 @@ void yon_monitor_config_update(monitorconfig* monitor, char *port, char *config_
|
|
|
|
monitor->position=3;
|
|
|
|
monitor->position=3;
|
|
|
|
if (yon_char_parsed_check_exist(cnf,size,"ab:")!=-1)
|
|
|
|
if (yon_char_parsed_check_exist(cnf,size,"ab:")!=-1)
|
|
|
|
monitor->position=3;
|
|
|
|
monitor->position=3;
|
|
|
|
if (yon_char_parsed_check_exist(cnf,size,"rotate:")!=-1)
|
|
|
|
if (yon_char_parsed_check_exist(cnf,size,"rotate:left")!=-1)
|
|
|
|
monitor->rotation=0;
|
|
|
|
monitor->rotation=1;
|
|
|
|
|
|
|
|
if (yon_char_parsed_check_exist(cnf,size,"rotate:right")!=-1)
|
|
|
|
|
|
|
|
monitor->rotation=2;
|
|
|
|
|
|
|
|
if (yon_char_parsed_check_exist(cnf,size,"rotate:invert")!=-1)
|
|
|
|
|
|
|
|
monitor->rotation=3;
|
|
|
|
if (yon_char_parsed_check_exist(cnf,size,"dpms")!=-1)
|
|
|
|
if (yon_char_parsed_check_exist(cnf,size,"dpms")!=-1)
|
|
|
|
monitor->dpms=1;
|
|
|
|
monitor->dpms=1;
|
|
|
|
if (yon_char_parsed_check_exist(cnf,size,"nodpms")!=-1)
|
|
|
|
if (yon_char_parsed_check_exist(cnf,size,"nodpms")!=-1)
|
|
|
|
@ -1145,21 +1105,25 @@ void yon_monitor_config_update(monitorconfig* monitor, char *port, char *config_
|
|
|
|
monitor->cvt=1;
|
|
|
|
monitor->cvt=1;
|
|
|
|
if (yon_char_parsed_check_exist(cnf,size,"reduced")!=-1)
|
|
|
|
if (yon_char_parsed_check_exist(cnf,size,"reduced")!=-1)
|
|
|
|
monitor->reduced=1;
|
|
|
|
monitor->reduced=1;
|
|
|
|
if (yon_char_parsed_check_exist(cnf,size,"r")!=-1)
|
|
|
|
if (yon_char_parsed_check_exist(cnf,size,"r,")!=-1)
|
|
|
|
monitor->reduced=1;
|
|
|
|
monitor->reduced=1;
|
|
|
|
if (yon_char_parsed_check_exist(cnf,size,"gtf")!=-1)
|
|
|
|
if (yon_char_parsed_check_exist(cnf,size,"gtf")!=-1)
|
|
|
|
monitor->gtf=1;
|
|
|
|
monitor->gtf=1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int yon_char_get_if_resolution(char *parsed_string){
|
|
|
|
char *yon_char_parsed_get_resolution(config_str parsed_string, int size){
|
|
|
|
char *left=NULL, *right=NULL;
|
|
|
|
char *left=NULL, *right=NULL, *freq=NULL;
|
|
|
|
right=yon_char_new(parsed_string);
|
|
|
|
for (int i=0;i<size;i++){
|
|
|
|
left=yon_char_divide_search(right,"x",1);
|
|
|
|
right=yon_char_new(parsed_string[i]);
|
|
|
|
if (left&&right)
|
|
|
|
left=yon_char_divide_search(right,"x",1);
|
|
|
|
if (atoi(left)&&atoi(right))
|
|
|
|
if (freq=strstr(left,"x"))
|
|
|
|
return 1;
|
|
|
|
left=yon_char_divide_search(left,"x",-1);
|
|
|
|
return 0;
|
|
|
|
if (left&&right)
|
|
|
|
|
|
|
|
if (atoi(left)&&atoi(right))
|
|
|
|
|
|
|
|
return parsed_string[i];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void yon_monitor_view_new(monitor_config monitor){
|
|
|
|
void yon_monitor_view_new(monitor_config monitor){
|
|
|
|
@ -1466,7 +1430,6 @@ void yon_setup_widgets(widgets_dict *widgets)
|
|
|
|
|
|
|
|
|
|
|
|
yon_ubl_header_setup(widgets->mainHeadOverlay, widgets->headBox, widgets->mainHeadBackgroundImage, banner_path);
|
|
|
|
yon_ubl_header_setup(widgets->mainHeadOverlay, widgets->headBox, widgets->mainHeadBackgroundImage, banner_path);
|
|
|
|
yon_monitor_view_setup(widgets->mainMonitorVisualConfigurationBox);
|
|
|
|
yon_monitor_view_setup(widgets->mainMonitorVisualConfigurationBox);
|
|
|
|
yon_monitor_view_update();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
videoconfig.status_render.icon=widgets->mainStatusIcon;
|
|
|
|
videoconfig.status_render.icon=widgets->mainStatusIcon;
|
|
|
|
videoconfig.status_render.label=widgets->mainStatusLabel;
|
|
|
|
videoconfig.status_render.label=widgets->mainStatusLabel;
|
|
|
|
@ -1498,6 +1461,7 @@ int main(int argc, char *argv[])
|
|
|
|
gtk_style_context_add_provider_for_screen(gdk_screen_get_default(),
|
|
|
|
gtk_style_context_add_provider_for_screen(gdk_screen_get_default(),
|
|
|
|
GTK_STYLE_PROVIDER(css),
|
|
|
|
GTK_STYLE_PROVIDER(css),
|
|
|
|
-1);
|
|
|
|
-1);
|
|
|
|
|
|
|
|
yon_monitor_view_update();
|
|
|
|
gtk_main();
|
|
|
|
gtk_main();
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|