From e0e985ffaefd791a8bdb7aa8d4d23cd00c51b3e2 Mon Sep 17 00:00:00 2001 From: Liam Middlebrook Date: Thu, 8 Nov 2018 09:39:12 -0800 Subject: 415.13 --- doc/nvidia-settings.1.m4 | 2 +- doc/nvidia-settings.desktop | 4 + doc/version.mk | 2 +- samples/version.mk | 2 +- src/XF86Config-parser/Device.c | 23 + src/XF86Config-parser/Flags.c | 2 + src/XF86Config-parser/Generate.c | 67 +- src/XF86Config-parser/Layout.c | 1 - src/XF86Config-parser/xf86Parser.h | 16 +- src/gtk+-2.x/ctkappprofile.c | 55 +- src/gtk+-2.x/ctkcolorcorrection.c | 4 +- src/gtk+-2.x/ctkcurve.c | 27 +- src/gtk+-2.x/ctkdisplayconfig.c | 20 +- src/gtk+-2.x/ctkframelock.c | 34 +- src/gtk+-2.x/ctkgauge.c | 40 +- src/gtk+-2.x/ctkglx.c | 12 +- src/gtk+-2.x/ctkgvo-csc.c | 5 +- src/gtk+-2.x/ctkutils.c | 40 ++ src/gtk+-2.x/ctkutils.h | 55 ++ src/gtk+-2.x/ctkvcs.c | 4 +- src/gtk+-2.x/ctkwindow.c | 2 +- src/libXNVCtrl/NVCtrl.h | 4 +- src/libXNVCtrl/version.mk | 2 +- src/libXNVCtrlAttributes/NvCtrlAttributes.c | 16 +- src/nvml.h | 940 +++++++++++++++++++++++++--- src/version.h | 2 +- src/version.mk | 2 +- version.mk | 2 +- 28 files changed, 1118 insertions(+), 267 deletions(-) diff --git a/doc/nvidia-settings.1.m4 b/doc/nvidia-settings.1.m4 index b8c35c9..61e0dc5 100644 --- a/doc/nvidia-settings.1.m4 +++ b/doc/nvidia-settings.1.m4 @@ -501,7 +501,7 @@ is released as GPL. The most recent official version of the source code is available here: .sp .ti +5 -.__URL__ ftp://download.nvidia.com/XFree86/nvidia-settings/ +.__URL__ https://download.nvidia.com/XFree86/nvidia-settings/ .sp Note that .B nvidia\-settings diff --git a/doc/nvidia-settings.desktop b/doc/nvidia-settings.desktop index a879422..c79f88f 100644 --- a/doc/nvidia-settings.desktop +++ b/doc/nvidia-settings.desktop @@ -28,3 +28,7 @@ Comment[pt_BR]=Definir &configurações de gerenciamento de usuário... Comment[zh_CN]=配置 NVIDIA X 服务器设置 Comment[zh_HK]=配置 NVIDIA X 伺服器設定 Comment[zh_TW]=配置 NVIDIA X 伺服器設定 + +# Translation by Marcin Mikołajczak +Name[pl]=Ustawienia serwera X NVIDIA +Comment[pl]=Narzędzie konfiguracyjne dla ustawień serwera X NVIDIA diff --git a/doc/version.mk b/doc/version.mk index 0032b02..da40957 100644 --- a/doc/version.mk +++ b/doc/version.mk @@ -1 +1 @@ -NVIDIA_VERSION = 410.73 +NVIDIA_VERSION = 415.13 diff --git a/samples/version.mk b/samples/version.mk index 0032b02..da40957 100644 --- a/samples/version.mk +++ b/samples/version.mk @@ -1 +1 @@ -NVIDIA_VERSION = 410.73 +NVIDIA_VERSION = 415.13 diff --git a/src/XF86Config-parser/Device.c b/src/XF86Config-parser/Device.c index b730228..c759e64 100644 --- a/src/XF86Config-parser/Device.c +++ b/src/XF86Config-parser/Device.c @@ -514,3 +514,26 @@ void xconfigFormatPciBusString(char *str, int len, } str[len - 1] = '\0'; } + + +/* + * xconfigAddInactiveDevice() - add a device to the inactive section of + * the xconfig layout. + */ +void xconfigAddInactiveDevice(XConfigPtr config, XConfigLayoutPtr layout, + int device_n) +{ + XConfigDevicePtr device; + XConfigInactivePtr inac; + + device = add_device(config, -1, -1, -1, NULL, device_n, + "modesetting", "Unknown"); + + inac = xconfigAlloc(sizeof (XConfigInactiveRec)); + inac->next = NULL; + inac->device = device; + inac->device_name = xconfigStrdup(device->identifier); + xconfigAddListItem((GenericListPtr *)(&layout->inactives), + (GenericListPtr) inac); +} /* xconfigAddInactiveDevice() */ + diff --git a/src/XF86Config-parser/Flags.c b/src/XF86Config-parser/Flags.c index 5d8d324..cfbff5e 100644 --- a/src/XF86Config-parser/Flags.c +++ b/src/XF86Config-parser/Flags.c @@ -107,11 +107,13 @@ xconfigParseFlagsSection (void) */ case DEFAULTLAYOUT: strvalue = TRUE; + /* fall through */ case BLANKTIME: case STANDBYTIME: case SUSPENDTIME: case OFFTIME: hasvalue = TRUE; + /* fall through */ case NOTRAPSIGNALS: case DONTZAP: case DONTZOOM: diff --git a/src/XF86Config-parser/Generate.c b/src/XF86Config-parser/Generate.c index b3b84c7..1f8ffca 100644 --- a/src/XF86Config-parser/Generate.c +++ b/src/XF86Config-parser/Generate.c @@ -46,9 +46,6 @@ static int is_file(const char *filename); static void add_font_path(GenerateOptions *gop, XConfigPtr config); static void add_modules(GenerateOptions *gop, XConfigPtr config); -static XConfigDevicePtr add_device(XConfigPtr config, int bus, int domain, - int slot, char *boardname, int count); - static void add_layout(GenerateOptions *gop, XConfigPtr config); static void add_inputref(XConfigPtr config, XConfigLayoutPtr layout, @@ -95,14 +92,17 @@ XConfigPtr xconfigGenerate(GenerateOptions *gop) XConfigScreenPtr xconfigGenerateAddScreen(XConfigPtr config, int bus, int domain, int slot, - char *boardname, int count) + char *boardname, int count, + const char *driver, + const char *vendor) { XConfigScreenPtr screen, s; XConfigDevicePtr device; XConfigMonitorPtr monitor; monitor = xconfigAddMonitor(config, count); - device = add_device(config, bus, domain, slot, boardname, count); + device = add_device(config, bus, domain, slot, boardname, count, + driver, vendor); screen = xconfigAlloc(sizeof(XConfigScreenRec)); @@ -458,8 +458,9 @@ XConfigMonitorPtr xconfigAddMonitor(XConfigPtr config, int count) * add_device() */ -static XConfigDevicePtr add_device(XConfigPtr config, int bus, int domain, - int slot, char *boardname, int count) +XConfigDevicePtr add_device(XConfigPtr config, int bus, int domain, + int slot, char *boardname, int count, + const char *driver, const char *vendor) { XConfigDevicePtr device, d; @@ -467,8 +468,9 @@ static XConfigDevicePtr add_device(XConfigPtr config, int bus, int domain, device->identifier = xconfigAlloc(32); snprintf(device->identifier, 32, DEVICE_IDENTIFIER, count); - device->driver = xconfigStrdup("nvidia"); - device->vendor = xconfigStrdup("NVIDIA Corporation"); + device->index_id = count; + device->driver = xconfigStrdup(driver); + device->vendor = xconfigStrdup(vendor); if (bus != -1 && domain != -1 && slot != -1) { device->busid = xconfigAlloc(32); @@ -527,7 +529,8 @@ static void add_layout(GenerateOptions *gop, XConfigPtr config) /* assume 1 X screen */ - screen = xconfigGenerateAddScreen(config, -1, -1, -1, NULL, 0); + screen = xconfigGenerateAddScreen(config, -1, -1, -1, NULL, 0, + "nvidia", "NVIDIA Corporation"); /* create layout */ @@ -1240,11 +1243,7 @@ int xconfigAddKeyboard(GenerateOptions *gop, XConfigPtr config) #if defined(NV_SUNOS) || defined(NV_BSD) input->driver = xconfigStrdup("keyboard"); #else - if (gop->xserver == X_IS_XORG) { - input->driver = xconfigStrdup("kbd"); - } else { - input->driver = xconfigStrdup("keyboard"); - } + input->driver = xconfigStrdup("kbd"); #endif } @@ -1316,7 +1315,6 @@ static char *xconfigGetDefaultProjectRoot(void) */ static int get_xserver_information(const char *versionString, - int *isXorg, int *autoloadsGLX, int *supportsExtensionSection, int *xineramaPlusCompositeWorks, @@ -1331,17 +1329,10 @@ static int get_xserver_information(const char *versionString, /* check if this is an XFree86 X server */ if (strstr(versionString, "XFree86 Version")) { - *isXorg = FALSE; - *autoloadsGLX = FALSE; - *supportsExtensionSection = FALSE; - *xineramaPlusCompositeWorks = FALSE; - return TRUE; + xconfigErrorMsg(WarnMsg, "XFree86 is not supported."); + return FALSE; } - /* this must be an X.Org X server */ - - *isXorg = TRUE; - /* attempt to parse the major.minor version out of the string */ found = FALSE; @@ -1439,8 +1430,6 @@ static int get_xserver_information(const char *versionString, void xconfigGetXServerInUse(GenerateOptions *gop) { FILE *stream = NULL; - int xserver = -1; - int isXorg; int len, found; char *cmd, *ptr, *ret; @@ -1474,19 +1463,12 @@ void xconfigGetXServerInUse(GenerateOptions *gop) */ found = get_xserver_information(buf, - &isXorg, &gop->autoloads_glx, &gop->supports_extension_section, &gop->xinerama_plus_composite_works, &gop->compositeExtensionName); - if (found) { - if (isXorg) { - xserver = X_IS_XORG; - } else { - xserver = X_IS_XF86; - } - } else { + if (!found) { xconfigErrorMsg(WarnMsg, "Unable to parse X.Org version string."); } } @@ -1494,20 +1476,6 @@ void xconfigGetXServerInUse(GenerateOptions *gop) pclose(stream); free(cmd); - if (xserver == -1) { - char *xorgpath; - - xorgpath = xconfigStrcat(gop->x_project_root, "/bin/Xorg", NULL); - if (access(xorgpath, F_OK)==0) { - xserver = X_IS_XORG; - } else { - xserver = X_IS_XF86; - } - free(xorgpath); - } - - gop->xserver=xserver; - } /* xconfigGetXServerInUse() */ @@ -1524,7 +1492,6 @@ void xconfigGenerateLoadDefaultOptions(GenerateOptions *gop) gop->x_project_root = xconfigGetDefaultProjectRoot(); /* XXX What to default the following to? - gop->xserver gop->keyboard gop->mouse gop->keyboard_driver diff --git a/src/XF86Config-parser/Layout.c b/src/XF86Config-parser/Layout.c index 9f7c7ca..1565556 100644 --- a/src/XF86Config-parser/Layout.c +++ b/src/XF86Config-parser/Layout.c @@ -474,7 +474,6 @@ xconfigValidateLayout (XConfigPtr p) adj = adj->next; } - /* I not believe the "inactives" list is used for anything */ iptr = layout->inactives; while (iptr) diff --git a/src/XF86Config-parser/xf86Parser.h b/src/XF86Config-parser/xf86Parser.h index 131876e..2c8163b 100644 --- a/src/XF86Config-parser/xf86Parser.h +++ b/src/XF86Config-parser/xf86Parser.h @@ -336,6 +336,7 @@ typedef struct __xconfigconfdevicerec { int chiprev; int irq; int screen; + size_t index_id; XConfigOptionPtr options; char *comment; } XConfigDeviceRec, *XConfigDevicePtr; @@ -612,11 +613,7 @@ typedef struct { * config, and when sanitizing an existing config */ -#define X_IS_XF86 0 -#define X_IS_XORG 1 - typedef struct { - int xserver; char *x_project_root; char *keyboard; char *mouse; @@ -754,7 +751,16 @@ XConfigPtr xconfigGenerate(GenerateOptions *gop); XConfigScreenPtr xconfigGenerateAddScreen(XConfigPtr config, int bus, int domain, int slot, - char *boardname, int count); + char *boardname, int count, + const char *driver, + const char *vendor); + +XConfigDevicePtr add_device(XConfigPtr config, int bus, int domain, + int slot, char *boardname, int count, + const char *driver, const char *vendor); + +void xconfigAddInactiveDevice(XConfigPtr config, XConfigLayoutPtr layout, + int device_n); void xconfigGenerateAssignScreenAdjacencies(XConfigLayoutPtr layout); diff --git a/src/gtk+-2.x/ctkappprofile.c b/src/gtk+-2.x/ctkappprofile.c index 53d5183..b070f02 100644 --- a/src/gtk+-2.x/ctkappprofile.c +++ b/src/gtk+-2.x/ctkappprofile.c @@ -257,7 +257,7 @@ static void app_profile_finalize(GObject *object) static void tool_button_set_label_and_stock_icon(GtkToolButton *button, const gchar *label_text, const gchar *icon_id) { GtkWidget *icon; - icon = gtk_image_new_from_stock(icon_id, GTK_ICON_SIZE_SMALL_TOOLBAR); + icon = ctk_image_new_from_str(icon_id, GTK_ICON_SIZE_SMALL_TOOLBAR); gtk_tool_button_set_icon_widget(button, icon); gtk_tool_button_set_label(button, label_text); gtk_widget_show_all(GTK_WIDGET(button)); @@ -270,7 +270,7 @@ static void button_set_label_and_stock_icon(GtkButton *button, const gchar *labe GtkWidget *label; GtkWidget *button_child; hbox = gtk_hbox_new(FALSE, 0); - icon = gtk_image_new_from_stock(icon_id, GTK_ICON_SIZE_SMALL_TOOLBAR); + icon = ctk_image_new_from_str(icon_id, GTK_ICON_SIZE_SMALL_TOOLBAR); label = gtk_label_new(label_text); gtk_box_pack_start(GTK_BOX(hbox), icon, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 0); @@ -394,7 +394,8 @@ static void populate_toolbar(GtkToolbar *toolbar, while (num_items--) { if (item->icon_id) { - icon = gtk_image_new_from_stock(item->icon_id, GTK_ICON_SIZE_SMALL_TOOLBAR); + icon = ctk_image_new_from_str(item->icon_id, + GTK_ICON_SIZE_SMALL_TOOLBAR); } else { icon = NULL; } @@ -1121,7 +1122,7 @@ static void edit_rule_dialog_load_values(EditRuleDialog *dialog) // add/edit button tool_button_set_label_and_stock_icon( GTK_TOOL_BUTTON(dialog->add_edit_rule_button), "Update Rule", - dialog->new_rule ? GTK_STOCK_ADD : GTK_STOCK_PREFERENCES); + dialog->new_rule ? CTK_STOCK_ADD : CTK_STOCK_PREFERENCES); // source file combo_box_entry = GTK_COMBO_BOX(dialog->source_file_combo); @@ -1439,7 +1440,7 @@ static void config_create_source_file_entry(CtkConfig *ctk_config, browse_button = gtk_button_new(); button_set_label_and_stock_icon(GTK_BUTTON(browse_button), - "Browse...", GTK_STOCK_OPEN); + "Browse...", CTK_STOCK_OPEN); g_string_printf(help_string, "Clicking this button opens a file selection dialog box which allows you to choose an " "appropriate configuration file for the %s.", name); @@ -1934,7 +1935,7 @@ static ToolbarItemTemplate *get_edit_rule_dialog_toolbar_items(EditRuleDialog *d { .text = UPDATE_RULE_LABEL, .help_text = "The Update Rule button allows you to save changes made to the rule definition.", - .icon_id = GTK_STOCK_SAVE, + .icon_id = CTK_STOCK_SAVE, .callback = G_CALLBACK(edit_rule_dialog_save_changes), .user_data = dialog, .flags = 0, @@ -1942,7 +1943,7 @@ static ToolbarItemTemplate *get_edit_rule_dialog_toolbar_items(EditRuleDialog *d { .text = "Cancel", .help_text = "The Cancel button allows you to discard any changes made to the rule definition.", - .icon_id = GTK_STOCK_CANCEL, + .icon_id = CTK_STOCK_CANCEL, .callback = G_CALLBACK(edit_rule_dialog_cancel), .user_data = dialog, .flags = 0, @@ -2555,7 +2556,7 @@ static void get_profile_dialog_toolbar_items(EditProfileDialog *dialog, { .text = "Add Setting", .help_text = "The Add Setting button allows you to create a new setting in the profile.", - .icon_id = GTK_STOCK_ADD, + .icon_id = CTK_STOCK_ADD, .callback = G_CALLBACK(edit_profile_dialog_add_setting), .user_data = dialog, .flags = 0, @@ -2565,7 +2566,7 @@ static void get_profile_dialog_toolbar_items(EditProfileDialog *dialog, .help_text = "The Delete Setting button allows you to delete a highlighted setting from the profile.", .extended_help_text = "A setting can also be deleted from the profile by highlighting it in the list " "and hitting the Delete key.", - .icon_id = GTK_STOCK_REMOVE, + .icon_id = CTK_STOCK_REMOVE, .callback = G_CALLBACK(edit_profile_dialog_delete_setting), .user_data = dialog, .flags = TOOLBAR_ITEM_GHOST_IF_NOTHING_SELECTED @@ -2575,7 +2576,7 @@ static void get_profile_dialog_toolbar_items(EditProfileDialog *dialog, .help_text = "The Edit Setting button allows you to edit a highlighted setting in the profile.", .extended_help_text = "This will activate an entry box in the setting's key column. To modify the setting's " "value, hit the Tab key or Right Arrow key, or double-click on the value.", - .icon_id = GTK_STOCK_PREFERENCES, + .icon_id = CTK_STOCK_PREFERENCES, .callback = G_CALLBACK(edit_profile_dialog_edit_setting), .user_data = dialog, .flags = TOOLBAR_ITEM_GHOST_IF_NOTHING_SELECTED @@ -2590,7 +2591,7 @@ static void get_profile_dialog_toolbar_items(EditProfileDialog *dialog, { .text = UPDATE_PROFILE_LABEL, .help_text = "The Update Profile button allows you to save changes made to the profile definition.", - .icon_id = GTK_STOCK_SAVE, + .icon_id = CTK_STOCK_SAVE, .callback = G_CALLBACK(edit_profile_dialog_save_changes), .user_data = dialog, .flags = 0, @@ -2598,7 +2599,7 @@ static void get_profile_dialog_toolbar_items(EditProfileDialog *dialog, { .text = "Cancel", .help_text = "The Cancel button allows you to discard any changes made to the profile definition.", - .icon_id = GTK_STOCK_CANCEL, + .icon_id = CTK_STOCK_CANCEL, .callback = G_CALLBACK(edit_profile_dialog_cancel), .user_data = dialog, .flags = 0, @@ -3159,7 +3160,7 @@ static GtkWidget* create_rules_page(CtkAppProfile *ctk_app_profile) "to applications which match a given pattern.", .extended_help_text = "See the \"Add/Edit Rule Dialog Box\" help section for more " "information on adding new rules.", - .icon_id = GTK_STOCK_ADD, + .icon_id = CTK_STOCK_ADD, .callback = (GCallback)add_rule_callback, .user_data = ctk_app_profile, .flags = 0, @@ -3167,7 +3168,7 @@ static GtkWidget* create_rules_page(CtkAppProfile *ctk_app_profile) { .text = "Delete Rule", .help_text = "The Delete Rule button allows you to remove a highlighted rule from the list.", - .icon_id = GTK_STOCK_REMOVE, + .icon_id = CTK_STOCK_REMOVE, .callback = (GCallback)delete_rule_callback, .user_data = ctk_app_profile, .flags = TOOLBAR_ITEM_GHOST_IF_NOTHING_SELECTED @@ -3182,7 +3183,7 @@ static GtkWidget* create_rules_page(CtkAppProfile *ctk_app_profile) "on their position along the configuration file search path. Hence, nvidia-settings " "may move the rule to a different source file if it is necessary for the rule to achieve " "a particular priority.", - .icon_id = GTK_STOCK_GO_UP, + .icon_id = CTK_STOCK_GO_UP, .callback = (GCallback)increase_rule_priority_callback, .user_data = ctk_app_profile, .flags = TOOLBAR_ITEM_GHOST_IF_NOTHING_SELECTED @@ -3192,7 +3193,7 @@ static GtkWidget* create_rules_page(CtkAppProfile *ctk_app_profile) .help_text = "This decreases the priority of the highlighted rule in the list. If multiple rules " "with a conflicting driver setting match the same application, the application will " "take on the setting value of the highest-priority rule (lowest number) in the list.", - .icon_id = GTK_STOCK_GO_DOWN, + .icon_id = CTK_STOCK_GO_DOWN, .callback = (GCallback)decrease_rule_priority_callback, .user_data = ctk_app_profile, .flags = TOOLBAR_ITEM_GHOST_IF_NOTHING_SELECTED @@ -3202,9 +3203,7 @@ static GtkWidget* create_rules_page(CtkAppProfile *ctk_app_profile) .help_text = "The Edit Rule button allows you to edit a highlighted rule in the list.", .extended_help_text = "See the \"Add/Edit Rule Dialog Box\" help section for more " "information on editing rules.", - // Would be nice to use GTK_STOCK_EDIT here, but unfortunately only - // available from 2.6 onwards... - .icon_id = GTK_STOCK_PREFERENCES, + .icon_id = CTK_STOCK_PREFERENCES, .callback = (GCallback)edit_rule_callback, .user_data = ctk_app_profile, .flags = TOOLBAR_ITEM_GHOST_IF_NOTHING_SELECTED @@ -3404,7 +3403,7 @@ static void edit_profile_dialog_load_values(EditProfileDialog *dialog) tool_button_set_label_and_stock_icon( GTK_TOOL_BUTTON(dialog->add_edit_profile_button), "Update Profile", - dialog->new_profile ? GTK_STOCK_ADD : GTK_STOCK_PREFERENCES); + dialog->new_profile ? CTK_STOCK_ADD : CTK_STOCK_PREFERENCES); // profile name gtk_entry_set_text(GTK_ENTRY(dialog->name_entry), dialog->name->str); @@ -3550,7 +3549,7 @@ static GtkWidget* create_profiles_page(CtkAppProfile *ctk_app_profile) "to applications which match a given pattern.", .extended_help_text = "See the \"Add/Edit Profile Dialog Box\" help section for more " "information on adding new profiles.", - .icon_id = GTK_STOCK_ADD, + .icon_id = CTK_STOCK_ADD, .callback = (GCallback)add_profile_callback, .user_data = ctk_app_profile, .flags = 0 @@ -3558,7 +3557,7 @@ static GtkWidget* create_profiles_page(CtkAppProfile *ctk_app_profile) { .text = "Delete Profile", .help_text = "The Delete Profile button allows you to remove a highlighted profile from the list.", - .icon_id = GTK_STOCK_REMOVE, + .icon_id = CTK_STOCK_REMOVE, .callback = (GCallback)delete_profile_callback, .user_data = ctk_app_profile, .flags = TOOLBAR_ITEM_GHOST_IF_NOTHING_SELECTED @@ -3568,9 +3567,7 @@ static GtkWidget* create_profiles_page(CtkAppProfile *ctk_app_profile) .help_text = "The Edit Profile button allows you to edit a highlighted profile in the list.", .extended_help_text = "See the \"Add/Edit Profile Dialog Box\" help section for more " "information on editing profiles.", - // Would be nice to use GTK_STOCK_EDIT here, but unfortunately only - // available from 2.6 onwards... - .icon_id = GTK_STOCK_PREFERENCES, + .icon_id = CTK_STOCK_PREFERENCES, .callback = (GCallback)edit_profile_callback, .user_data = ctk_app_profile, .flags = TOOLBAR_ITEM_GHOST_IF_NOTHING_SELECTED @@ -3828,7 +3825,7 @@ static ToolbarItemTemplate *get_save_reload_toolbar_items(CtkAppProfile *ctk_app .extended_help_text = "This button displays a dialog box which allows you to preview the changes " "that will be made to the JSON configuration files, and toggle whether nvidia-settings " "should make backup copies of the original files before overwriting existing files.", - .icon_id = GTK_STOCK_SAVE, + .icon_id = CTK_STOCK_SAVE, .callback = (GCallback)save_changes_callback, .user_data = ctk_app_profile, .flags = 0, @@ -3839,7 +3836,7 @@ static ToolbarItemTemplate *get_save_reload_toolbar_items(CtkAppProfile *ctk_app "disk, reverting any unsaved changes.", .extended_help_text = "If nvidia-settings detects unsaved changes in the configuration, this button will " "display a dialog box to warn you before attempting to reload.", - .icon_id = GTK_STOCK_REFRESH, + .icon_id = CTK_STOCK_REFRESH, .callback = (GCallback)reload_callback, .user_data = ctk_app_profile, .flags = 0, @@ -3950,7 +3947,7 @@ static ToolbarItemTemplate *get_save_app_profile_changes_toolbar_items(SaveAppPr { .text = "Save Changes", .help_text = "Save the changes to disk.", - .icon_id = GTK_STOCK_SAVE, + .icon_id = CTK_STOCK_SAVE, .callback = G_CALLBACK(save_app_profile_changes_dialog_save_changes), .user_data = dialog, .flags = 0, @@ -3958,7 +3955,7 @@ static ToolbarItemTemplate *get_save_app_profile_changes_toolbar_items(SaveAppPr { .text = "Cancel", .help_text = "Cancel the save operation.", - .icon_id = GTK_STOCK_CANCEL, + .icon_id = CTK_STOCK_CANCEL, .callback = G_CALLBACK(save_app_profile_changes_dialog_cancel), .user_data = dialog, .flags = 0, diff --git a/src/gtk+-2.x/ctkcolorcorrection.c b/src/gtk+-2.x/ctkcolorcorrection.c index d94b310..44dc213 100644 --- a/src/gtk+-2.x/ctkcolorcorrection.c +++ b/src/gtk+-2.x/ctkcolorcorrection.c @@ -531,8 +531,8 @@ GtkWidget* ctk_color_correction_new(CtrlTarget *ctrl_target, "values may be incorrect."); gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); - image = gtk_image_new_from_stock(GTK_STOCK_DIALOG_WARNING, - GTK_ICON_SIZE_BUTTON); + image = ctk_image_new_from_str(CTK_STOCK_DIALOG_WARNING, + GTK_ICON_SIZE_BUTTON); gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); diff --git a/src/gtk+-2.x/ctkcurve.c b/src/gtk+-2.x/ctkcurve.c index cac3828..2c68605 100644 --- a/src/gtk+-2.x/ctkcurve.c +++ b/src/gtk+-2.x/ctkcurve.c @@ -159,7 +159,6 @@ static gboolean ctk_curve_expose_event( ) #endif { - gint width, height; CtkCurve *ctk_curve; GtkAllocation allocation; @@ -167,9 +166,6 @@ static gboolean ctk_curve_expose_event( ctk_widget_get_allocation(widget, &allocation); - width = allocation.width - 2 * gtk_widget_get_style(widget)->xthickness; - height = allocation.height - 2 * gtk_widget_get_style(widget)->ythickness; - #ifdef CTK_GTK3 gtk_render_frame(gtk_widget_get_style_context(widget), cr, 0, 0, allocation.width, allocation.height); @@ -178,17 +174,22 @@ static gboolean ctk_curve_expose_event( cairo_set_source_surface(cr, ctk_curve->c_surface, 0, 0); cairo_paint(cr); #else - gtk_paint_shadow(widget->style, widget->window, - GTK_STATE_NORMAL, GTK_SHADOW_IN, - &event->area, widget, "ctk_curve", 0, 0, - allocation.width, allocation.height); + { + gint width = allocation.width - 2 * gtk_widget_get_style(widget)->xthickness; + gint height = allocation.height - 2 * gtk_widget_get_style(widget)->ythickness; - gdk_gc_set_function(ctk_curve->gdk_gc, GDK_COPY); + gtk_paint_shadow(widget->style, widget->window, + GTK_STATE_NORMAL, GTK_SHADOW_IN, + &event->area, widget, "ctk_curve", 0, 0, + allocation.width, allocation.height); - gdk_draw_drawable(widget->window, ctk_curve->gdk_gc, ctk_curve->gdk_pixmap, - 0, 0, widget->style->xthickness, - widget->style->ythickness, - width, height); + gdk_gc_set_function(ctk_curve->gdk_gc, GDK_COPY); + + gdk_draw_drawable(widget->window, ctk_curve->gdk_gc, ctk_curve->gdk_pixmap, + 0, 0, widget->style->xthickness, + widget->style->ythickness, + width, height); + } #endif return FALSE; } diff --git a/src/gtk+-2.x/ctkdisplayconfig.c b/src/gtk+-2.x/ctkdisplayconfig.c index 571574b..87a4983 100644 --- a/src/gtk+-2.x/ctkdisplayconfig.c +++ b/src/gtk+-2.x/ctkdisplayconfig.c @@ -964,8 +964,8 @@ static GtkWidget * create_validation_dialog(CtkDisplayConfig *ctk_object) hbox, TRUE, TRUE, 5); /* Pack the information icon */ - image = gtk_image_new_from_stock(GTK_STOCK_DIALOG_INFO, - GTK_ICON_SIZE_DIALOG); + image = ctk_image_new_from_str(CTK_STOCK_DIALOG_INFO, + GTK_ICON_SIZE_DIALOG); gtk_misc_set_alignment(GTK_MISC(image), 0.0f, 0.0f); gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, 5); @@ -1066,8 +1066,8 @@ static GtkWidget * create_validation_apply_dialog(CtkDisplayConfig *ctk_object) hbox, TRUE, TRUE, 5); /* Pack the information icon */ - image = gtk_image_new_from_stock(GTK_STOCK_DIALOG_INFO, - GTK_ICON_SIZE_DIALOG); + image = ctk_image_new_from_str(CTK_STOCK_DIALOG_INFO, + GTK_ICON_SIZE_DIALOG); gtk_misc_set_alignment(GTK_MISC(image), 0.0f, 0.0f); gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, 5); @@ -9164,10 +9164,8 @@ static Bool add_layout_to_xconfig(nvLayoutPtr layout, XConfigPtr config) static int generateXConfig(CtkDisplayConfig *ctk_object, XConfigPtr *pConfig) { nvLayoutPtr layout = ctk_object->layout; - CtrlTarget *ctrl_target; XConfigPtr config = NULL; GenerateOptions go; - char *server_vendor; int ret; @@ -9178,16 +9176,6 @@ static int generateXConfig(CtkDisplayConfig *ctk_object, XConfigPtr *pConfig) xconfigGenerateLoadDefaultOptions(&go); xconfigGetXServerInUse(&go); - /* Query actual server X.Org/XFree86 */ - ctrl_target = NvCtrlGetDefaultTarget(layout->system); - server_vendor = NvCtrlGetServerVendor(ctrl_target); - if (server_vendor && g_strrstr(server_vendor, "X.Org")) { - go.xserver = X_IS_XORG; - } else { - go.xserver = X_IS_XF86; - } - - /* Generate the basic layout */ config = xconfigGenerate(&go); diff --git a/src/gtk+-2.x/ctkframelock.c b/src/gtk+-2.x/ctkframelock.c index 1679cb4..6f51e23 100644 --- a/src/gtk+-2.x/ctkframelock.c +++ b/src/gtk+-2.x/ctkframelock.c @@ -448,7 +448,7 @@ static GtkWidget *create_error_msg_dialog(CtkFramelock *ctk_framelock) gtk_container_add(GTK_CONTAINER( ctk_dialog_get_content_area(GTK_DIALOG(dialog))), hbox); - pixbuf = gtk_widget_render_icon(dialog, GTK_STOCK_DIALOG_ERROR, + pixbuf = ctk_widget_render_icon(dialog, CTK_STOCK_DIALOG_ERROR, GTK_ICON_SIZE_DIALOG, NULL); image = gtk_image_new_from_pixbuf(pixbuf); g_object_unref(pixbuf); @@ -488,8 +488,8 @@ static GtkWidget *create_sync_state_button(CtkFramelock *ctk_framelock) /* create the enable syncing icon */ - pixbuf = gtk_widget_render_icon(button, - GTK_STOCK_EXECUTE, + pixbuf = ctk_widget_render_icon(button, + CTK_STOCK_EXECUTE, GTK_ICON_SIZE_BUTTON, "enable frame lock"); if (pixbuf) image = gtk_image_new_from_pixbuf(pixbuf); @@ -517,8 +517,8 @@ static GtkWidget *create_sync_state_button(CtkFramelock *ctk_framelock) /* create the disable syncing icon */ - pixbuf = gtk_widget_render_icon(button, - GTK_STOCK_STOP, + pixbuf = ctk_widget_render_icon(button, + CTK_STOCK_STOP, GTK_ICON_SIZE_BUTTON, "disable frame lock"); if (pixbuf) image = gtk_image_new_from_pixbuf(pixbuf); @@ -600,7 +600,7 @@ static GtkWidget *create_add_devices_dialog(CtkFramelock *ctk_framelock) gtk_container_add(GTK_CONTAINER(ctk_dialog_get_content_area(GTK_DIALOG(dialog))), hbox); - pixbuf = gtk_widget_render_icon(dialog, GTK_STOCK_DIALOG_QUESTION, + pixbuf = ctk_widget_render_icon(dialog, CTK_STOCK_DIALOG_QUESTION, GTK_ICON_SIZE_DIALOG, NULL); image = gtk_image_new_from_pixbuf(pixbuf); g_object_unref(pixbuf); @@ -687,7 +687,7 @@ static GtkWidget *create_remove_devices_dialog(CtkFramelock *ctk_framelock) gtk_container_add(GTK_CONTAINER(ctk_dialog_get_content_area(GTK_DIALOG(dialog))), hbox); - pixbuf = gtk_widget_render_icon(dialog, GTK_STOCK_DIALOG_QUESTION, + pixbuf = ctk_widget_render_icon(dialog, CTK_STOCK_DIALOG_QUESTION, GTK_ICON_SIZE_DIALOG, NULL); image = gtk_image_new_from_pixbuf(pixbuf); g_object_unref(pixbuf); @@ -1686,8 +1686,8 @@ static void expander_button_clicked(GtkWidget *widget, gpointer user_data) gtk_container_remove(GTK_CONTAINER(entry->expander_button), entry->expander_button_image); entry->expander_button_image = - gtk_image_new_from_stock(GTK_STOCK_ADD, - GTK_ICON_SIZE_SMALL_TOOLBAR); + ctk_image_new_from_str(CTK_STOCK_ADD, + GTK_ICON_SIZE_SMALL_TOOLBAR); gtk_widget_set_size_request(entry->expander_button, 20, 20); gtk_container_add(GTK_CONTAINER(entry->expander_button), @@ -1700,8 +1700,8 @@ static void expander_button_clicked(GtkWidget *widget, gpointer user_data) gtk_container_remove(GTK_CONTAINER(entry->expander_button), entry->expander_button_image); entry->expander_button_image = - gtk_image_new_from_stock(GTK_STOCK_REMOVE, - GTK_ICON_SIZE_SMALL_TOOLBAR); + ctk_image_new_from_str(CTK_STOCK_REMOVE, + GTK_ICON_SIZE_SMALL_TOOLBAR); gtk_widget_set_size_request(entry->expander_button, 20, 20); gtk_container_add(GTK_CONTAINER(entry->expander_button), @@ -1733,8 +1733,8 @@ static void list_entry_add_expander_button(nvListEntryPtr entry) entry->expander_vbox = gtk_vbox_new(FALSE, 0); entry->expander_button = gtk_button_new(); entry->expander_button_image = - gtk_image_new_from_stock(GTK_STOCK_REMOVE, - GTK_ICON_SIZE_SMALL_TOOLBAR); + ctk_image_new_from_str(CTK_STOCK_REMOVE, + GTK_ICON_SIZE_SMALL_TOOLBAR); gtk_widget_set_size_request(entry->expander_button, 20, 20); entry->expanded = True; @@ -2713,13 +2713,13 @@ static void list_entry_expand_collapse(nvListEntryPtr entry, gboolean expand) if (expand) { /* Expand */ entry->expander_button_image = - gtk_image_new_from_stock(GTK_STOCK_REMOVE, - GTK_ICON_SIZE_SMALL_TOOLBAR); + ctk_image_new_from_str(CTK_STOCK_REMOVE, + GTK_ICON_SIZE_SMALL_TOOLBAR); } else { /* Collapse */ entry->expander_button_image = - gtk_image_new_from_stock(GTK_STOCK_ADD, - GTK_ICON_SIZE_SMALL_TOOLBAR); + ctk_image_new_from_str(CTK_STOCK_ADD, + GTK_ICON_SIZE_SMALL_TOOLBAR); } gtk_widget_set_size_request(entry->expander_button, 20, 20); diff --git a/src/gtk+-2.x/ctkgauge.c b/src/gtk+-2.x/ctkgauge.c index 488056a..369f6f9 100644 --- a/src/gtk+-2.x/ctkgauge.c +++ b/src/gtk+-2.x/ctkgauge.c @@ -160,7 +160,6 @@ static gboolean ctk_gauge_expose_event( ) #endif { - gint width, height; CtkGauge *ctk_gauge; GtkAllocation allocation; @@ -168,9 +167,6 @@ static gboolean ctk_gauge_expose_event( ctk_widget_get_allocation(widget, &allocation); - width = allocation.width - 2 * gtk_widget_get_style(widget)->xthickness; - height = allocation.height - 2 * gtk_widget_get_style(widget)->ythickness; - #ifdef CTK_GTK3 gtk_render_frame(gtk_widget_get_style_context(widget), cr, 0, 0, allocation.width, allocation.height); @@ -180,17 +176,22 @@ static gboolean ctk_gauge_expose_event( cairo_set_source_surface(cr, ctk_gauge->c_surface, 0, 0); cairo_paint(cr); #else - gtk_paint_shadow(widget->style, widget->window, - GTK_STATE_NORMAL, GTK_SHADOW_IN, - &event->area, widget, "ctk_gauge", 0, 0, - widget->allocation.width, widget->allocation.height); + { + gint width = allocation.width - 2 * gtk_widget_get_style(widget)->xthickness; + gint height = allocation.height - 2 * gtk_widget_get_style(widget)->ythickness; + + gtk_paint_shadow(widget->style, widget->window, + GTK_STATE_NORMAL, GTK_SHADOW_IN, + &event->area, widget, "ctk_gauge", 0, 0, + widget->allocation.width, widget->allocation.height); - gdk_gc_set_function(ctk_gauge->gdk_gc, GDK_COPY); + gdk_gc_set_function(ctk_gauge->gdk_gc, GDK_COPY); - gdk_draw_drawable(widget->window, ctk_gauge->gdk_gc, ctk_gauge->gdk_pixmap, - 0, 0, widget->style->xthickness, - widget->style->ythickness, - width, height); + gdk_draw_drawable(widget->window, ctk_gauge->gdk_gc, ctk_gauge->gdk_pixmap, + 0, 0, widget->style->xthickness, + widget->style->ythickness, + width, height); + } #endif return FALSE; } @@ -358,7 +359,6 @@ static GdkColor *get_foreground_color(CtkGauge *ctk_gauge, gint i) static void draw(CtkGauge *ctk_gauge) { - GtkWidget *widget; gint x1, x2, y, width, i, percent, pos; gint upper, lower, range, current; @@ -367,8 +367,6 @@ static void draw(CtkGauge *ctk_gauge) range = upper - lower; current = ctk_gauge->current; - widget = GTK_WIDGET(ctk_gauge); - #ifdef CTK_GTK3 /* Fill Curve surface with black background */ cairo_set_operator(ctk_gauge->c_context, CAIRO_OPERATOR_SOURCE); @@ -378,10 +376,14 @@ static void draw(CtkGauge *ctk_gauge) ctk_gauge->width, ctk_gauge->height); cairo_fill(ctk_gauge->c_context); #else - gdk_gc_set_function(ctk_gauge->gdk_gc, GDK_COPY); + { + GtkWidget *widget = GTK_WIDGET(ctk_gauge);; - gdk_draw_rectangle(ctk_gauge->gdk_pixmap, widget->style->black_gc, - TRUE, 0, 0, ctk_gauge->width, ctk_gauge->height); + gdk_gc_set_function(ctk_gauge->gdk_gc, GDK_COPY); + + gdk_draw_rectangle(ctk_gauge->gdk_pixmap, widget->style->black_gc, + TRUE, 0, 0, ctk_gauge->width, ctk_gauge->height); + } #endif width = ctk_gauge->width / 5; diff --git a/src/gtk+-2.x/ctkglx.c b/src/gtk+-2.x/ctkglx.c index 7f1e4de..05c5612 100644 --- a/src/gtk+-2.x/ctkglx.c +++ b/src/gtk+-2.x/ctkglx.c @@ -1056,7 +1056,7 @@ void ctk_glx_probe_info(GtkWidget *widget) vbox = ctk_glx->glxinfo_vpane; - gtk_widget_set_size_request(notebook, -1, 50); + gtk_widget_set_size_request(notebook, -1, 250); gtk_box_pack_start(GTK_BOX(vbox), notebook, TRUE, TRUE, 0); /* Add (Shared) GLX information to widget */ @@ -1085,7 +1085,7 @@ void ctk_glx_probe_info(GtkWidget *widget) } gtk_box_pack_start(GTK_BOX(vbox2), table, FALSE, FALSE, 0); - gtk_container_add(GTK_CONTAINER(scroll_win), vbox2); + ctk_scrolled_window_add(GTK_SCROLLED_WINDOW(scroll_win), vbox2); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), scroll_win, notebook_label); @@ -1115,7 +1115,7 @@ void ctk_glx_probe_info(GtkWidget *widget) gtk_box_pack_start(GTK_BOX(vbox2), table, FALSE, FALSE, 0); - gtk_container_add(GTK_CONTAINER(scroll_win), vbox2); + ctk_scrolled_window_add(GTK_SCROLLED_WINDOW(scroll_win), vbox2); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), scroll_win, notebook_label); @@ -1143,7 +1143,7 @@ void ctk_glx_probe_info(GtkWidget *widget) gtk_box_pack_start(GTK_BOX(vbox2), table, FALSE, FALSE, 0); - gtk_container_add(GTK_CONTAINER(scroll_win), vbox2); + ctk_scrolled_window_add(GTK_SCROLLED_WINDOW(scroll_win), vbox2); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), scroll_win, notebook_label); @@ -1174,7 +1174,7 @@ void ctk_glx_probe_info(GtkWidget *widget) gtk_box_pack_start(GTK_BOX(vbox2), table, FALSE, FALSE, 0); - gtk_container_add(GTK_CONTAINER(scroll_win), vbox2); + ctk_scrolled_window_add(GTK_SCROLLED_WINDOW(scroll_win), vbox2); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), scroll_win, notebook_label); @@ -1210,7 +1210,7 @@ void ctk_glx_probe_info(GtkWidget *widget) } gtk_box_pack_start(GTK_BOX(vbox2), table, FALSE, FALSE, 0); - gtk_container_add(GTK_CONTAINER(scroll_win), vbox2); + ctk_scrolled_window_add(GTK_SCROLLED_WINDOW(scroll_win), vbox2); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), scroll_win, notebook_label); } diff --git a/src/gtk+-2.x/ctkgvo-csc.c b/src/gtk+-2.x/ctkgvo-csc.c index 1faf68b..73b3e27 100644 --- a/src/gtk+-2.x/ctkgvo-csc.c +++ b/src/gtk+-2.x/ctkgvo-csc.c @@ -26,6 +26,7 @@ #include "ctkconfig.h" #include "ctkhelp.h" #include "ctkdropdownmenu.h" +#include "ctkutils.h" #include "ctkgvo-csc.h" @@ -1155,8 +1156,8 @@ static GtkWidget *build_opengl_only_msg(void) /* create the information icon */ - pixbuf = gtk_widget_render_icon(label, - GTK_STOCK_DIALOG_INFO, + pixbuf = ctk_widget_render_icon(label, + CTK_STOCK_DIALOG_INFO, GTK_ICON_SIZE_DIALOG, "CSC information message"); diff --git a/src/gtk+-2.x/ctkutils.c b/src/gtk+-2.x/ctkutils.c index 65ee75a..cd21ffe 100644 --- a/src/gtk+-2.x/ctkutils.c +++ b/src/gtk+-2.x/ctkutils.c @@ -215,6 +215,15 @@ GtkWidget *ctk_scrolled_window_get_vscrollbar(GtkScrolledWindow *sw) #endif } +void ctk_scrolled_window_add(GtkScrolledWindow *sw, GtkWidget *child) +{ +#ifdef CTK_GTK3 + gtk_container_add(GTK_CONTAINER(sw), child); +#else + gtk_scrolled_window_add_with_viewport(sw, child); +#endif +} + GtkWidget *ctk_statusbar_get_message_area(GtkStatusbar *statusbar) { #ifdef CTK_GTK3 @@ -270,6 +279,37 @@ void ctk_combo_box_text_append_text(GtkWidget *widget, const gchar *text) #endif } +GtkWidget *ctk_image_new_from_str(const gchar *str, GtkIconSize size) +{ + if (!str) { + return NULL; + } + +#ifdef CTK_GTK3 + /* added in 2.6 */ + return gtk_image_new_from_icon_name(str, size); +#else + /* deprecated in 3.10 */ + return gtk_image_new_from_stock(str, size); +#endif +} + +GdkPixbuf *ctk_widget_render_icon(GtkWidget *widget, const gchar *stock_id, + GtkIconSize size, const gchar *detail) +{ + if (!stock_id) { + return NULL; + } + +#ifdef CTK_GTK3 + /* added in 3.0 and deprecated in 3.10 */ + return gtk_widget_render_icon_pixbuf(widget, stock_id, size); +#else + /* deprecated in 3.0 */ + return gtk_widget_render_icon(widget, stock_id, size, detail); +#endif +} + void ctk_cell_renderer_set_alignment(GtkCellRenderer *renderer, gfloat x, gfloat y) { diff --git a/src/gtk+-2.x/ctkutils.h b/src/gtk+-2.x/ctkutils.h index a4d8fb9..92fa64b 100644 --- a/src/gtk+-2.x/ctkutils.h +++ b/src/gtk+-2.x/ctkutils.h @@ -33,6 +33,56 @@ G_BEGIN_DECLS # define G_VALUE_INIT { 0, { { 0 } } } #endif +#ifdef CTK_GTK3 +#define CTK_STOCK_ADD "list-add" +#define CTK_STOCK_APPLY "_Apply" /* No icon recommended */ +#define CTK_STOCK_CANCEL "_Cancel" /* No icon recommended */ +#define CTK_STOCK_CLOSE "window-close" +#define CTK_STOCK_DIALOG_ERROR "dialog-error" +#define CTK_STOCK_DIALOG_INFO "dialog-information" +#define CTK_STOCK_DIALOG_QUESTION "dialog-question" +#define CTK_STOCK_DIALOG_WARNING "dialog-warning" +#define CTK_STOCK_EDIT NULL /* Nothing recommended */ +#define CTK_STOCK_EXECUTE "system-run" +#define CTK_STOCK_GO_DOWN "go-down" +#define CTK_STOCK_GO_UP "go-up" +#define CTK_STOCK_HELP "help-browser" +#define CTK_STOCK_NO NULL /* Nothing recommended */ +#define CTK_STOCK_OK "_OK" /* No icon recommended */ +#define CTK_STOCK_OPEN "document-open" +#define CTK_STOCK_PREFERENCES "preferences-system" +#define CTK_STOCK_QUIT "application-exit" +#define CTK_STOCK_REFRESH "view-refresh" +#define CTK_STOCK_REMOVE "list-remove" +#define CTK_STOCK_SAVE "document-save" +#define CTK_STOCK_STOP "process-stop" +#define CTK_STOCK_YES NULL /* Nothing recommended */ +#else +#define CTK_STOCK_ADD GTK_STOCK_ADD +#define CTK_STOCK_APPLY GTK_STOCK_APPLY +#define CTK_STOCK_CANCEL GTK_STOCK_CANCEL +#define CTK_STOCK_CLOSE GTK_STOCK_CLOSE +#define CTK_STOCK_DIALOG_ERROR GTK_STOCK_DIALOG_ERROR +#define CTK_STOCK_DIALOG_INFO GTK_STOCK_DIALOG_INFO +#define CTK_STOCK_DIALOG_QUESTION GTK_STOCK_DIALOG_QUESTION +#define CTK_STOCK_DIALOG_WARNING GTK_STOCK_DIALOG_WARNING +#define CTK_STOCK_EDIT GTK_STOCK_EDIT +#define CTK_STOCK_EXECUTE GTK_STOCK_EXECUTE +#define CTK_STOCK_GO_DOWN GTK_STOCK_GO_DOWN +#define CTK_STOCK_GO_UP GTK_STOCK_GO_UP +#define CTK_STOCK_HELP GTK_STOCK_HELP +#define CTK_STOCK_NO GTK_STOCK_NO +#define CTK_STOCK_OK GTK_STOCK_OK +#define CTK_STOCK_OPEN GTK_STOCK_OPEN +#define CTK_STOCK_PREFERENCES GTK_STOCK_PREFERENCES +#define CTK_STOCK_QUIT GTK_STOCK_QUIT +#define CTK_STOCK_REFRESH GTK_STOCK_REFRESH +#define CTK_STOCK_REMOVE GTK_STOCK_REMOVE +#define CTK_STOCK_SAVE GTK_STOCK_SAVE +#define CTK_STOCK_STOP GTK_STOCK_STOP +#define CTK_STOCK_YES GTK_STOCK_YES +#endif + /* * GTK 2/3 util functions */ @@ -56,6 +106,7 @@ void ctk_adjustment_set_upper(GtkAdjustment *a, gdouble x); void ctk_adjustment_set_lower(GtkAdjustment *a, gdouble x); GtkWidget *ctk_scrolled_window_get_vscrollbar(GtkScrolledWindow *sw); +void ctk_scrolled_window_add(GtkScrolledWindow *sw, GtkWidget *child); GtkWidget *ctk_statusbar_get_message_area(GtkStatusbar *statusbar); void ctk_cell_renderer_set_alignment(GtkCellRenderer *widget, gfloat x, gfloat y); @@ -72,6 +123,10 @@ void ctk_combo_box_text_append_text(GtkWidget *widget, const gchar *text); void ctk_g_object_ref_sink(gpointer obj); +GtkWidget *ctk_image_new_from_str(const gchar *str, GtkIconSize size); +GdkPixbuf *ctk_widget_render_icon(GtkWidget *widget, const gchar *stock_id, + GtkIconSize size, const gchar *detail); + /* end of GTK 2/3 util functions */ gchar *get_pcie_generation_string(CtrlTarget *ctrl_target); diff --git a/src/gtk+-2.x/ctkvcs.c b/src/gtk+-2.x/ctkvcs.c index c929675..b0b0ca9 100644 --- a/src/gtk+-2.x/ctkvcs.c +++ b/src/gtk+-2.x/ctkvcs.c @@ -246,8 +246,8 @@ static GtkWidget * create_error_dialog(CtkVcs *ctk_object) hbox, TRUE, TRUE, 5); /* Pack the information icon */ - image = gtk_image_new_from_stock(GTK_STOCK_DIALOG_INFO, - GTK_ICON_SIZE_DIALOG); + image = ctk_image_new_from_str(CTK_STOCK_DIALOG_INFO, + GTK_ICON_SIZE_DIALOG); gtk_misc_set_alignment(GTK_MISC(image), 0.0f, 0.0f); gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, 5); diff --git a/src/gtk+-2.x/ctkwindow.c b/src/gtk+-2.x/ctkwindow.c index d7fdaa7..c7cc65e 100644 --- a/src/gtk+-2.x/ctkwindow.c +++ b/src/gtk+-2.x/ctkwindow.c @@ -1314,7 +1314,7 @@ static GtkWidget *create_quit_dialog(CtkWindow *ctk_window) gtk_container_set_border_width(GTK_CONTAINER(hbox), 6); gtk_container_add(GTK_CONTAINER(ctk_dialog_get_content_area(GTK_DIALOG(dialog))), hbox); - pixbuf = gtk_widget_render_icon(dialog, GTK_STOCK_DIALOG_QUESTION, + pixbuf = ctk_widget_render_icon(dialog, CTK_STOCK_DIALOG_QUESTION, GTK_ICON_SIZE_DIALOG, NULL); image = gtk_image_new_from_pixbuf(pixbuf); g_object_unref(pixbuf); diff --git a/src/libXNVCtrl/NVCtrl.h b/src/libXNVCtrl/NVCtrl.h index 3f3e3c6..09e27b8 100644 --- a/src/libXNVCtrl/NVCtrl.h +++ b/src/libXNVCtrl/NVCtrl.h @@ -682,7 +682,7 @@ /* * NV_CTRL_FLIPPING_ALLOWED - when TRUE, OpenGL will swap by flipping - * when possible; when FALSE, OpenGL will alway swap by blitting. + * when possible; when FALSE, OpenGL will always swap by blitting. */ #define NV_CTRL_FLIPPING_ALLOWED 40 /* RW-X */ @@ -4728,7 +4728,7 @@ /* * NV_CTRL_BINARY_DATA_GPU_FLAGS - Returns a list of flags for the * given GPU. A flag can, for instance, be a capability which enables - * of disables some features according to the GPU state. + * or disables some features according to the GPU state. * * The format of the returned data is: * diff --git a/src/libXNVCtrl/version.mk b/src/libXNVCtrl/version.mk index 0032b02..da40957 100644 --- a/src/libXNVCtrl/version.mk +++ b/src/libXNVCtrl/version.mk @@ -1 +1 @@ -NVIDIA_VERSION = 410.73 +NVIDIA_VERSION = 415.13 diff --git a/src/libXNVCtrlAttributes/NvCtrlAttributes.c b/src/libXNVCtrlAttributes/NvCtrlAttributes.c index c3bf158..a60b85b 100644 --- a/src/libXNVCtrlAttributes/NvCtrlAttributes.c +++ b/src/libXNVCtrlAttributes/NvCtrlAttributes.c @@ -623,8 +623,8 @@ ReturnStatus NvCtrlQueryTargetCount(const CtrlTarget *ctrl_target, (ret != NvCtrlNotSupported)) { return ret; } - /* Fall through */ } + /* Fall through */ case DISPLAY_TARGET: case X_SCREEN_TARGET: case FRAMELOCK_TARGET: @@ -785,8 +785,8 @@ ReturnStatus NvCtrlGetDisplayAttribute64(const CtrlTarget *ctrl_target, (ret != NvCtrlNotSupported)) { return ret; } - /* Fall through */ } + /* Fall through */ case DISPLAY_TARGET: case X_SCREEN_TARGET: case FRAMELOCK_TARGET: @@ -848,8 +848,8 @@ ReturnStatus NvCtrlSetDisplayAttribute(CtrlTarget *ctrl_target, (ret != NvCtrlNotSupported)) { return ret; } - /* Fall through */ } + /* Fall through */ case DISPLAY_TARGET: case X_SCREEN_TARGET: case FRAMELOCK_TARGET: @@ -924,8 +924,8 @@ NvCtrlGetValidDisplayAttributeValues(const CtrlTarget *ctrl_target, (ret != NvCtrlNotSupported)) { return ret; } - /* Fall through */ } + /* Fall through */ case DISPLAY_TARGET: case X_SCREEN_TARGET: case FRAMELOCK_TARGET: @@ -999,8 +999,8 @@ NvCtrlGetValidStringDisplayAttributeValues(const CtrlTarget *ctrl_target, (ret != NvCtrlNotSupported)) { return ret; } - /* Fall through */ } + /* Fall through */ case DISPLAY_TARGET: case X_SCREEN_TARGET: case FRAMELOCK_TARGET: @@ -1084,8 +1084,8 @@ ReturnStatus NvCtrlGetStringDisplayAttribute(const CtrlTarget *ctrl_target, (ret != NvCtrlNotSupported)) { return ret; } - /* Fall through */ } + /* Fall through */ case DISPLAY_TARGET: case X_SCREEN_TARGET: case FRAMELOCK_TARGET: @@ -1166,8 +1166,8 @@ ReturnStatus NvCtrlSetStringDisplayAttribute(CtrlTarget *ctrl_target, (ret != NvCtrlNotSupported)) { return ret; } - /* Fall through */ } + /* Fall through */ case DISPLAY_TARGET: case X_SCREEN_TARGET: case FRAMELOCK_TARGET: @@ -1210,8 +1210,8 @@ ReturnStatus NvCtrlGetBinaryAttribute(const CtrlTarget *ctrl_target, (ret != NvCtrlNotSupported)) { return ret; } - /* Fall through */ } + /* Fall through */ case DISPLAY_TARGET: case X_SCREEN_TARGET: case FRAMELOCK_TARGET: diff --git a/src/nvml.h b/src/nvml.h index 9ec7642..ba754fe 100644 --- a/src/nvml.h +++ b/src/nvml.h @@ -1,5 +1,5 @@ /* - * Copyright 1993-2016 NVIDIA Corporation. All rights reserved. + * Copyright 1993-2018 NVIDIA Corporation. All rights reserved. * * NOTICE TO USER: * @@ -95,13 +95,16 @@ extern "C" { /** * NVML API versioning support */ -#define NVML_API_VERSION 8 -#define NVML_API_VERSION_STR "8" +#define NVML_API_VERSION 10 +#define NVML_API_VERSION_STR "10" #define nvmlInit nvmlInit_v2 -#define nvmlDeviceGetPciInfo nvmlDeviceGetPciInfo_v2 +#define nvmlDeviceGetPciInfo nvmlDeviceGetPciInfo_v3 #define nvmlDeviceGetCount nvmlDeviceGetCount_v2 #define nvmlDeviceGetHandleByIndex nvmlDeviceGetHandleByIndex_v2 #define nvmlDeviceGetHandleByPciBusId nvmlDeviceGetHandleByPciBusId_v2 +#define nvmlDeviceGetNvLinkRemotePciInfo nvmlDeviceGetNvLinkRemotePciInfo_v2 +#define nvmlDeviceRemoveGpu nvmlDeviceRemoveGpu_v2 +#define nvmlDeviceGetGridLicensableFeatures nvmlDeviceGetGridLicensableFeatures_v2 /***************************************************************************************************/ /** @defgroup nvmlDeviceStructs Device Structs @@ -122,29 +125,47 @@ typedef struct nvmlDevice_st* nvmlDevice_t; /** * Buffer size guaranteed to be large enough for pci bus id */ -#define NVML_DEVICE_PCI_BUS_ID_BUFFER_SIZE 16 +#define NVML_DEVICE_PCI_BUS_ID_BUFFER_SIZE 32 + +/** + * Buffer size guaranteed to be large enough for pci bus id for ::busIdLegacy + */ +#define NVML_DEVICE_PCI_BUS_ID_BUFFER_V2_SIZE 16 /** * PCI information about a GPU device. */ -typedef struct nvmlPciInfo_st +typedef struct nvmlPciInfo_st { - char busId[NVML_DEVICE_PCI_BUS_ID_BUFFER_SIZE]; //!< The tuple domain:bus:device.function PCI identifier (& NULL terminator) - unsigned int domain; //!< The PCI domain on which the device's bus resides, 0 to 0xffff + char busIdLegacy[NVML_DEVICE_PCI_BUS_ID_BUFFER_V2_SIZE]; //!< The legacy tuple domain:bus:device.function PCI identifier (& NULL terminator) + unsigned int domain; //!< The PCI domain on which the device's bus resides, 0 to 0xffffffff unsigned int bus; //!< The bus on which the device resides, 0 to 0xff unsigned int device; //!< The device's id on the bus, 0 to 31 unsigned int pciDeviceId; //!< The combined 16-bit device id and 16-bit vendor id - + // Added in NVML 2.285 API unsigned int pciSubSystemId; //!< The 32-bit Sub System Device ID - - // NVIDIA reserved for internal use only - unsigned int reserved0; - unsigned int reserved1; - unsigned int reserved2; - unsigned int reserved3; + + char busId[NVML_DEVICE_PCI_BUS_ID_BUFFER_SIZE]; //!< The tuple domain:bus:device.function PCI identifier (& NULL terminator) } nvmlPciInfo_t; +/** + * PCI format string for ::busIdLegacy + */ +#define NVML_DEVICE_PCI_BUS_ID_LEGACY_FMT "%04X:%02X:%02X.0" + +/** + * PCI format string for ::busId + */ +#define NVML_DEVICE_PCI_BUS_ID_FMT "%08X:%02X:%02X.0" + +/** + * Utility macro for filling the pci bus id format from a nvmlPciInfo_t + */ +#define NVML_DEVICE_PCI_BUS_ID_FMT_ARGS(pciInfo) (pciInfo)->domain, \ + (pciInfo)->bus, \ + (pciInfo)->device + /** * Detailed ECC error counts for a device. * @@ -295,12 +316,15 @@ typedef enum nvmlGpuLevel_enum NVML_TOPOLOGY_SINGLE = 10, // all devices that only need traverse a single PCIe switch NVML_TOPOLOGY_MULTIPLE = 20, // all devices that need not traverse a host bridge NVML_TOPOLOGY_HOSTBRIDGE = 30, // all devices that are connected to the same host bridge - NVML_TOPOLOGY_CPU = 40, // all devices that are connected to the same CPU but possibly multiple host bridges + NVML_TOPOLOGY_NODE = 40, // all devices that are connected to the same NUMA node but possibly multiple host bridges NVML_TOPOLOGY_SYSTEM = 50, // all devices in the system // there is purposefully no COUNT here because of the need for spacing above } nvmlGpuTopologyLevel_t; +/* Compatibility for CPU->NODE renaming */ +#define NVML_TOPOLOGY_CPU NVML_TOPOLOGY_NODE + /* P2P Capability Index Status*/ typedef enum nvmlGpuP2PStatus_enum { @@ -476,6 +500,7 @@ typedef enum nvmlBrandType_enum NVML_BRAND_NVS = 3, NVML_BRAND_GRID = 4, NVML_BRAND_GEFORCE = 5, + NVML_BRAND_TITAN = 6, // Keep this last NVML_BRAND_COUNT @@ -488,7 +513,9 @@ typedef enum nvmlTemperatureThresholds_enum { NVML_TEMPERATURE_THRESHOLD_SHUTDOWN = 0, // Temperature at which the GPU will shut down // for HW protection - NVML_TEMPERATURE_THRESHOLD_SLOWDOWN = 1, // Temperature at which the GPU will begin slowdown + NVML_TEMPERATURE_THRESHOLD_SLOWDOWN = 1, // Temperature at which the GPU will begin HW slowdown + NVML_TEMPERATURE_THRESHOLD_MEM_MAX = 2, // Memory Temperature at which the GPU will begin SW slowdown + NVML_TEMPERATURE_THRESHOLD_GPU_MAX = 3, // GPU Temperature at which the GPU can be throttled below base clock // Keep this last NVML_TEMPERATURE_THRESHOLD_COUNT } nvmlTemperatureThresholds_t; @@ -599,7 +626,7 @@ typedef enum nvmlClockType_enum NVML_CLOCK_VIDEO = 3, //!< Video encoder/decoder clock domain // Keep this last - NVML_CLOCK_COUNT //= 0 and < \a deviceCount + * @param info Reference in which to return the device information + * + * @return + * - \ref NVML_SUCCESS if \a device has been set + * - \ref NVML_ERROR_INVALID_ARGUMENT if \a index is invalid or \a info is NULL + * + * @see nvmlGetBlacklistDeviceCount + */ +nvmlReturn_t DECLDIR nvmlGetBlacklistDeviceInfoByIndex(unsigned int index, nvmlBlacklistDeviceInfo_t *info); + /** @} */ /** * NVML API versioning support */ #if defined(__NVML_API_VERSION_INTERNAL) +#undef nvmlDeviceGetGridLicensableFeatures +#undef nvmlDeviceRemoveGpu +#undef nvmlDeviceGetNvLinkRemotePciInfo #undef nvmlDeviceGetPciInfo #undef nvmlDeviceGetCount #undef nvmlDeviceGetHandleByIndex diff --git a/src/version.h b/src/version.h index 7a7d88e..3e3ef01 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define NVIDIA_VERSION "410.73" +#define NVIDIA_VERSION "415.13" diff --git a/src/version.mk b/src/version.mk index 0032b02..da40957 100644 --- a/src/version.mk +++ b/src/version.mk @@ -1 +1 @@ -NVIDIA_VERSION = 410.73 +NVIDIA_VERSION = 415.13 diff --git a/version.mk b/version.mk index 0032b02..da40957 100644 --- a/version.mk +++ b/version.mk @@ -1 +1 @@ -NVIDIA_VERSION = 410.73 +NVIDIA_VERSION = 415.13 -- cgit v1.2.3