|
|
|
|
@ -8,6 +8,7 @@
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
#include <fcntl.h>
|
|
|
|
|
#include "ubl-utils.h"
|
|
|
|
|
#include "ubl-settings-video-strings.h"
|
|
|
|
|
#ifndef UBL_SETINGS_VIDEO_H
|
|
|
|
|
#define UBL_SETINGS_VIDEO_H
|
|
|
|
|
|
|
|
|
|
@ -29,9 +30,9 @@
|
|
|
|
|
|
|
|
|
|
#define get_resolutions_command "xrandr |grep -noP \"\\d+x+\\d+\""
|
|
|
|
|
|
|
|
|
|
#define get_proprietary_drivers_command "cut -d, -f1- video-drivers.csv | grep -E \"-\""
|
|
|
|
|
#define get_proprietary_drivers_command "cut -d, -f1- /usr/share/ubl-settings-video/csv/video-drivers.csv | grep -E \"-\""
|
|
|
|
|
|
|
|
|
|
#define get_resolutions_supportable_command "cut -d, -f1- Resolutions.csv |sed 's/,/\t/g'"
|
|
|
|
|
#define get_resolutions_supportable_command "cut -d, -f1- /usr/share/ubl-settings-video/csv/resolutions.csv |sed 's/,/\t/g'"
|
|
|
|
|
|
|
|
|
|
#define get_frequences_command "xrandr |grep -v -n \"[a-z][a-z]\" |sed 's/ * / /g' |cut -d' ' -f1,3-"
|
|
|
|
|
|
|
|
|
|
@ -49,6 +50,8 @@
|
|
|
|
|
|
|
|
|
|
#define remove_drivers_local_command "/usr/bin/ubconfig --target global remove video "
|
|
|
|
|
|
|
|
|
|
#define XORG_MONITOR(port) yon_char_get_augumented(" XORG_MONITOR[",yon_char_get_augumented(port,"] "))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
char *local;
|
|
|
|
|
|
|
|
|
|
@ -58,12 +61,25 @@ string version_application = "1.0";
|
|
|
|
|
|
|
|
|
|
#define _(String) gettext(String)
|
|
|
|
|
|
|
|
|
|
typedef dictionary* monitor_config;
|
|
|
|
|
typedef dictionary* proprietary_config;
|
|
|
|
|
typedef dictionary* monitor_view;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
GtkWidget *icon;
|
|
|
|
|
GtkWidget *box;
|
|
|
|
|
GtkWidget *label;
|
|
|
|
|
} render_data;
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
|
{
|
|
|
|
|
config_str loaded_config;
|
|
|
|
|
int configsize;
|
|
|
|
|
int autoChooseDrivers;
|
|
|
|
|
dictionary *videoconfig;
|
|
|
|
|
dictionary *monitors;
|
|
|
|
|
dictionary *proprietary;
|
|
|
|
|
monitor_view monitor_visuals;
|
|
|
|
|
monitor_config monitors;
|
|
|
|
|
proprietary_config proprietary;
|
|
|
|
|
GtkListStore *list;
|
|
|
|
|
char *failsafenVidia;
|
|
|
|
|
char *failsafeATI;
|
|
|
|
|
@ -71,25 +87,30 @@ typedef struct
|
|
|
|
|
char *optirun;
|
|
|
|
|
char *primusrun;
|
|
|
|
|
int gapfix;
|
|
|
|
|
int optiorprimus;
|
|
|
|
|
char **ports;
|
|
|
|
|
config_str ports;
|
|
|
|
|
int portssize;
|
|
|
|
|
char **resolutions;
|
|
|
|
|
config_str resolutions;
|
|
|
|
|
int resolutionssize;
|
|
|
|
|
render_data status_render;
|
|
|
|
|
} config;
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
|
{
|
|
|
|
|
int main;
|
|
|
|
|
int enable;
|
|
|
|
|
char *position;
|
|
|
|
|
int position;
|
|
|
|
|
char *position_port;
|
|
|
|
|
char *port;
|
|
|
|
|
char *resolution;
|
|
|
|
|
char **resolutionCapabilities;
|
|
|
|
|
config_str resolutionCapabilities;
|
|
|
|
|
char *frequency;
|
|
|
|
|
char *rotation;
|
|
|
|
|
int rotation;
|
|
|
|
|
char *stringparameters;
|
|
|
|
|
int dpms;
|
|
|
|
|
int resolution_size;
|
|
|
|
|
int cvt;
|
|
|
|
|
int reduced;
|
|
|
|
|
int gtf;
|
|
|
|
|
} monitorconfig;
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
@ -174,43 +195,46 @@ typedef struct
|
|
|
|
|
typedef struct
|
|
|
|
|
{
|
|
|
|
|
GtkWidget *templateMonitorConfigurationWindow;
|
|
|
|
|
GtkWidget *mainMonitorConfigurationBox;
|
|
|
|
|
GtkWidget *templateMonitorConfigurationBox;
|
|
|
|
|
GtkWidget *templateMonitorConfigurationMonitorLabel;
|
|
|
|
|
GtkWidget *templateMonitorConfigurationEnableCheck;
|
|
|
|
|
GtkWidget *templateMonitorConfigurationPortLabel;
|
|
|
|
|
GtkWidget *templateMonitorConfigurationPortCombo;
|
|
|
|
|
GtkWidget *templateMonitorConfigurationMainCheck;
|
|
|
|
|
GtkWidget *templateMonitorConfigurationResolutionLabel;
|
|
|
|
|
GtkWidget *templateMonitorConfigurationResolutionCombo;
|
|
|
|
|
GtkWidget *templateMonitorConfigurationShowUnsupportedCheck;
|
|
|
|
|
GtkWidget *templateMonitorConfigurationFrequencyLabel;
|
|
|
|
|
GtkWidget *templateMonitorConfigurationFrequencyCombo;
|
|
|
|
|
GtkWidget *templateMonitorConfigurationRotationCombo;
|
|
|
|
|
GtkWidget *templateMonitorConfigurationRotationLabel;
|
|
|
|
|
GtkWidget *templateMonitorConfigurationMainRadio;
|
|
|
|
|
GtkWidget *templateMonitorConfigurationParameterLineCheck;
|
|
|
|
|
GtkWidget *templateMonitorConfigurationParameterLineEntry;
|
|
|
|
|
GtkWidget *templateMonitorConfigurationDoNotSwitchOffLabel;
|
|
|
|
|
GtkWidget *templateMonitorConfigurationDoNotSwitchOffCheck;
|
|
|
|
|
GtkWidget *templateMonitorConfigurationCancelButton;
|
|
|
|
|
GtkWidget *templateMonitorConfigurationSaveButton;
|
|
|
|
|
|
|
|
|
|
GtkWidget *templateMonitorConfigurationEnableCheck;
|
|
|
|
|
GtkWidget *templateMonitorConfigurationPortLabel;
|
|
|
|
|
GtkWidget *templateMonitorConfigurationPortCombo;
|
|
|
|
|
GtkWidget *templateMonitorConfigurationShowUnsupportedCheck;
|
|
|
|
|
GtkWidget *templateMonitorConfigurationRotationCombo;
|
|
|
|
|
GtkWidget *templateMonitorConfigurationPositionLabel;
|
|
|
|
|
GtkWidget *templateMonitorConfigurationPositionPosCombo;
|
|
|
|
|
GtkWidget *templateMonitorConfigurationPositionPortCombo;
|
|
|
|
|
GtkWidget *templateMonitorConfigurationDoNotSwitchOffCheck;
|
|
|
|
|
GtkWidget *templateMonitorConfigurationModelineCVTCheck;
|
|
|
|
|
GtkWidget *templateMonitorConfigurationUseCVTReducedCheck;
|
|
|
|
|
GtkWidget *templateMonitorConfigurationModelineGTFCheck;
|
|
|
|
|
GtkWidget *templateMonitorConfigurationParameterLineCheck;
|
|
|
|
|
GtkWidget *templateMonitorConfigurationParameterLineEntry;
|
|
|
|
|
GtkWidget *templateMonitorConfigurationCancelButton;
|
|
|
|
|
GtkWidget *templateMonitorConfigurationSaveButton;
|
|
|
|
|
|
|
|
|
|
dictionary *config;
|
|
|
|
|
} monitor_edit_window;
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
GtkWidget *templateMonitorscreenOverlay;
|
|
|
|
|
GtkWidget *templateMonitorImage;
|
|
|
|
|
GtkWidget *templateMonitorInfoBox;
|
|
|
|
|
GtkWidget *templateMonitorInfoNameLabel;
|
|
|
|
|
GtkWidget *templateMonitorInfoResolutionLabel;
|
|
|
|
|
GtkWidget *templateMonitorInfoConfigureButton;
|
|
|
|
|
GtkWidget *templateMonitorDeleteButton;
|
|
|
|
|
GtkWidget *templateMonitorSwitchButton;
|
|
|
|
|
dictionary *curconfig;
|
|
|
|
|
} MonitorSettings;
|
|
|
|
|
GtkWidget *templateMonitorInfoConfigureButton;
|
|
|
|
|
GtkWidget *templateMonitorInfoAddButton;
|
|
|
|
|
monitor_config config;
|
|
|
|
|
} monitor_window;
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
|
{
|
|
|
|
|
@ -225,14 +249,10 @@ typedef struct
|
|
|
|
|
GtkWidget *ProprietaryAcceptButton;
|
|
|
|
|
} driver_window;
|
|
|
|
|
|
|
|
|
|
int yon_check_for_monitors();
|
|
|
|
|
MonitorSettings *yon_setup_monitor_settings();
|
|
|
|
|
dictionary *yon_dictionary_pack_monitors(MonitorSettings *monitors, int size);
|
|
|
|
|
dictionary *yon_dictionary_pack_overlays(MonitorSettings *monitors, int size);
|
|
|
|
|
void on_closed_configuration(GtkWidget *self, MonitorSettings *monitors);
|
|
|
|
|
void on_save_configuration(GtkWidget self, MonitorSettings *monitors);
|
|
|
|
|
int yon_config_init(char **parameters, int size);
|
|
|
|
|
void yon_parse_monitor(dictionary *monitor, char *string_of_settings);
|
|
|
|
|
|
|
|
|
|
// void on_closed_configuration(GtkWidget *self, MonitorSettings *monitors);
|
|
|
|
|
// void on_save_configuration(GtkWidget self, MonitorSettings *monitors);
|
|
|
|
|
void yon_parse_monitor();
|
|
|
|
|
void on_config_fill_interface(widgets_dict *widgets);
|
|
|
|
|
void yon_update_config(widgets_dict *widgets);
|
|
|
|
|
void on_configuration_save_global(GtkWidget *self, widgets_dict *widgets);
|
|
|
|
|
@ -241,4 +261,16 @@ void on_configuration_save__local(GtkWidget *self, widgets_dict *widgets);
|
|
|
|
|
void yon_config_monitor_string_parse(char *parameters, int *size);
|
|
|
|
|
int yon_char_get_if_resolution(char *parsed_string);
|
|
|
|
|
void yon_monitor_set_resolutions(dictionary *dict);
|
|
|
|
|
monitor_config yon_monitor_config_new(char *port);
|
|
|
|
|
void yon_monitor_config_update(monitorconfig* monitor, char *port, char *config_string);
|
|
|
|
|
void yon_monitor_view_new(monitor_config monitor);
|
|
|
|
|
// void on_confugure_monitor_settings(GtkWidget *self, MonitorSettings *settings);
|
|
|
|
|
void yon_monitor_view_draw_all(GtkWidget *cnt);
|
|
|
|
|
void on_monitor_configure(GtkWidget *self,monitor_window *window);
|
|
|
|
|
void on_monitor_add(GtkWidget *self,monitor_window *window);
|
|
|
|
|
void on_monitor_switch(GtkWidget *self,monitor_window *window);
|
|
|
|
|
void on_monitor_delete(GtkWidget *self,monitor_view windowd);
|
|
|
|
|
void yon_monitor_view_update();
|
|
|
|
|
void yon_monitor_window_update(monitor_edit_window *window);
|
|
|
|
|
char *yon_monitor_make_string(monitorconfig* config);
|
|
|
|
|
#endif
|