├── COPYING ├── Makefile ├── doc ├── FRAMELOCK.txt ├── Makefile ├── NV-CONTROL-API.txt ├── nvidia-settings.1.m4 ├── nvidia-settings.desktop ├── nvidia-settings.png ├── src.mk └── version.mk ├── samples ├── Makefile ├── README ├── nv-control-3dvisionpro.c ├── nv-control-dpy.c ├── nv-control-dvc.c ├── nv-control-events.c ├── nv-control-framelock.c ├── nv-control-info.c ├── nv-control-screen.h ├── nv-control-targets.c ├── nv-control-warpblend.c ├── nv-control-warpblend.h ├── src.mk └── version.mk ├── src ├── Makefile ├── XF86Config-parser │ ├── Configint.h │ ├── DRI.c │ ├── Device.c │ ├── Extensions.c │ ├── Files.c │ ├── Flags.c │ ├── Generate.c │ ├── Input.c │ ├── Keyboard.c │ ├── Layout.c │ ├── Merge.c │ ├── Module.c │ ├── Monitor.c │ ├── Pointer.c │ ├── Read.c │ ├── Scan.c │ ├── Screen.c │ ├── Util.c │ ├── Vendor.c │ ├── Video.c │ ├── Write.c │ ├── configProcs.h │ ├── src.mk │ ├── xf86Parser.h │ └── xf86tokens.h ├── app-profiles.c ├── app-profiles.h ├── command-line.c ├── command-line.h ├── common-unix │ └── virtual-resolutions │ │ ├── nvvr.c │ │ ├── nvvr.h │ │ └── src.mk ├── common-utils │ ├── common-utils.c │ ├── common-utils.h │ ├── gen-manpage-opts-helper.c │ ├── gen-manpage-opts-helper.h │ ├── msg.c │ ├── msg.h │ ├── nvgetopt.c │ ├── nvgetopt.h │ ├── nvpci-utils.c │ ├── nvpci-utils.h │ └── src.mk ├── config-file.c ├── config-file.h ├── gen-manpage-opts.c ├── glxinfo.c ├── glxinfo.h ├── gtk+-2.x │ ├── ctk3dvisionpro.c │ ├── ctk3dvisionpro.h │ ├── ctkapcprofilemodel.c │ ├── ctkapcprofilemodel.h │ ├── ctkapcrulemodel.c │ ├── ctkapcrulemodel.h │ ├── ctkappprofile.c │ ├── ctkappprofile.h │ ├── ctkbanner.c │ ├── ctkbanner.h │ ├── ctkcolorcontrols.c │ ├── ctkcolorcontrols.h │ ├── ctkcolorcorrection.c │ ├── ctkcolorcorrection.h │ ├── ctkcolorcorrectionpage.c │ ├── ctkcolorcorrectionpage.h │ ├── ctkconfig.c │ ├── ctkconfig.h │ ├── ctkconstants.h │ ├── ctkcurve.c │ ├── ctkcurve.h │ ├── ctkdisplayconfig-utils.c │ ├── ctkdisplayconfig-utils.h │ ├── ctkdisplayconfig.c │ ├── ctkdisplayconfig.h │ ├── ctkdisplaydevice.c │ ├── ctkdisplaydevice.h │ ├── ctkdisplaylayout.c │ ├── ctkdisplaylayout.h │ ├── ctkditheringcontrols.c │ ├── ctkditheringcontrols.h │ ├── ctkdropdownmenu.c │ ├── ctkdropdownmenu.h │ ├── ctkecc.c │ ├── ctkecc.h │ ├── ctkedid.c │ ├── ctkedid.h │ ├── ctkevent.c │ ├── ctkevent.h │ ├── ctkframelock.c │ ├── ctkframelock.h │ ├── ctkgauge.c │ ├── ctkgauge.h │ ├── ctkglstereo.c │ ├── ctkglstereo.h │ ├── ctkglwidget.c │ ├── ctkglwidget.h │ ├── ctkglx.c │ ├── ctkglx.h │ ├── ctkgpu.c │ ├── ctkgpu.h │ ├── ctkgridlicense.c │ ├── ctkgridlicense.h │ ├── ctkhelp.c │ ├── ctkhelp.h │ ├── ctkimagesliders.c │ ├── ctkimagesliders.h │ ├── ctkmultisample.c │ ├── ctkmultisample.h │ ├── ctkopengl.c │ ├── ctkopengl.h │ ├── ctkpowermizer.c │ ├── ctkpowermizer.h │ ├── ctkpowermode.c │ ├── ctkpowermode.h │ ├── ctkscale.c │ ├── ctkscale.h │ ├── ctkscreen.c │ ├── ctkscreen.h │ ├── ctkserver.c │ ├── ctkserver.h │ ├── ctkslimm.c │ ├── ctkslimm.h │ ├── ctkthermal.c │ ├── ctkthermal.h │ ├── ctkui.c │ ├── ctkui.h │ ├── ctkutils.c │ ├── ctkutils.h │ ├── ctkvdpau.c │ ├── ctkvdpau.h │ ├── ctkwindow.c │ ├── ctkwindow.h │ ├── ctkxvideo.c │ ├── ctkxvideo.h │ ├── matrix_utils.c │ ├── matrix_utils.h │ ├── opengl_loading.c │ ├── opengl_loading.h │ ├── opengl_wrappers.c │ └── opengl_wrappers.h ├── image_data │ ├── antialias.png │ ├── background.png │ ├── background_tall.png │ ├── bnc_cable.png │ ├── bsd.png │ ├── clock.png │ ├── color.png │ ├── config.png │ ├── crt.png │ ├── dfp.png │ ├── display_config.png │ ├── framelock.png │ ├── gpu.png │ ├── graphics.png │ ├── help.png │ ├── led_green.png │ ├── led_grey.png │ ├── led_red.png │ ├── left.png │ ├── logo.png │ ├── logo_tall.png │ ├── nvidia_icon.png │ ├── nvlogo.png │ ├── opengl.png │ ├── penguin.png │ ├── right.png │ ├── rj45_input.png │ ├── rj45_output.png │ ├── rj45_unused.png │ ├── server_licensing.png │ ├── slimm.png │ ├── solaris.png │ ├── svp_3dvp.png │ ├── thermal.png │ ├── vdpau.png │ ├── x.png │ └── xvideo.png ├── jansson │ ├── dump.c │ ├── error.c │ ├── hashtable.c │ ├── hashtable.h │ ├── hashtable_seed.c │ ├── jansson.h │ ├── jansson_config.h │ ├── jansson_private.h │ ├── jansson_private_config.h │ ├── load.c │ ├── lookup3.h │ ├── memory.c │ ├── pack_unpack.c │ ├── strbuffer.c │ ├── strbuffer.h │ ├── strconv.c │ ├── utf.c │ ├── utf.h │ └── value.c ├── libXNVCtrl │ ├── Makefile │ ├── NVCtrl.c │ ├── NVCtrl.h │ ├── NVCtrlLib.h │ ├── nv_control.h │ ├── utils.mk │ ├── version.mk │ └── xnvctrl.mk ├── libXNVCtrlAttributes │ ├── NvCtrlAttributes.c │ ├── NvCtrlAttributes.h │ ├── NvCtrlAttributesEgl.c │ ├── NvCtrlAttributesGlx.c │ ├── NvCtrlAttributesNvControl.c │ ├── NvCtrlAttributesNvml.c │ ├── NvCtrlAttributesPrivate.h │ ├── NvCtrlAttributesUtils.c │ ├── NvCtrlAttributesVidMode.c │ ├── NvCtrlAttributesVulkan.c │ ├── NvCtrlAttributesXrandr.c │ └── NvCtrlAttributesXv.c ├── lscf.c ├── lscf.h ├── nv_grid_dbus.h ├── nvidia-settings.c ├── nvml.h ├── option-table.h ├── parse.c ├── parse.h ├── query-assign.c ├── query-assign.h ├── src.mk ├── version.mk ├── wayland-connector.c ├── wayland-connector.h └── xpm_data │ ├── blue_xpm.h │ ├── green_xpm.h │ ├── red_xpm.h │ ├── rgb_xpm.h │ ├── svp_add_glasses.h │ ├── svp_autopick_next_channel.h │ ├── svp_battery_0.h │ ├── svp_battery_100.h │ ├── svp_battery_25.h │ ├── svp_battery_50.h │ ├── svp_battery_75.h │ ├── svp_status_excellent.h │ ├── svp_status_good.h │ ├── svp_status_low.h │ ├── svp_status_nosignal.h │ ├── svp_status_verygood.h │ └── svp_status_verylow.h ├── utils.mk └── version.mk /Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | # and Linux systems. 4 | # 5 | # Copyright (C) 2008-2012 NVIDIA Corporation. 6 | # 7 | # This program is free software; you can redistribute it and/or modify it 8 | # under the terms and conditions of the GNU General Public License, 9 | # version 2, as published by the Free Software Foundation. 10 | # 11 | # This program is distributed in the hope that it will be useful, but WITHOUT 12 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | # more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program. If not, see . 18 | # 19 | 20 | .PHONY: all clean clobber install 21 | 22 | all clean clobber install: 23 | @$(MAKE) -C src $@ 24 | @$(MAKE) -C samples $@ 25 | @$(MAKE) -C doc $@ 26 | 27 | -------------------------------------------------------------------------------- /doc/FRAMELOCK.txt: -------------------------------------------------------------------------------- 1 | 2 | This is a (very) brief summary of some of things that need to be 3 | done to write a Frame Lock NV-CONTROL client. 4 | 5 | Please see samples/nv-control-framelock.c for a basic Frame Lock client. See 6 | the file ctkframelock.c for a much more involved example of how the 7 | nvidia-settings utility programs the Frame Lock attributes. 8 | 9 | The constants referenced below are defined in NVCtrl.h. Please see the 10 | comments in that file for an explanation of each attribute. It may 11 | also be instructive to grep ctkframelock.c to see how each attribute 12 | is used. 13 | 14 | Querying frame lock capabilities of a system: 15 | 16 | - Query the number of Quadro Sync devices on the system by passing 17 | NV_CTRL_TARGET_TYPE_FRAMELOCK to XNVCTRLQueryTargetCount() 18 | 19 | - Query the GPUs attached to each Quadro Sync device by querying the 20 | NV_CTRL_BINARY_DATA_GPUS_USING_FRAMELOCK attribute for each Quadro 21 | Sync device. 22 | 23 | - Query the enabled (available) display devices on each GPU through 24 | the NV_CTRL_BINARY_DATA_DISPLAYS_CONNECTED_TO_GPU and 25 | NV_CTRL_DISPLAY_ENABLED attributes. 26 | 27 | - Query whether each display may be configured as Frame Lock server or 28 | client through the NV_CTRL_FRAMELOCK_DISPLAY_CONFIG attribute. 29 | 30 | Configuring the Frame Lock group (This must be done while Frame Lock Sync is 31 | disabled on the GPU/Quadro Sync Device): 32 | 33 | - Set one display device as Frame Lock server through the 34 | NV_CTRL_FRAMELOCK_DISPLAY_CONFIG_SERVER attribute. 35 | 36 | - Set the rest of the display devices as Frame Lock clients through the 37 | NV_CTRL_FRAMELOCK_DISPLAY_CONFIG_CLIENT attribute. 38 | 39 | - Set NV_CTRL_USE_HOUSE_SYNC to NV_CTRL_USE_HOUSE_SYNC_TRUE or 40 | NV_CTRL_USE_HOUSE_SYNC_FALSE on the server Quadro Sync device (this is 41 | the Quadro Sync device that is attached to the GPU that contains the 42 | display device currently set as the Frame Lock server.) Depending on 43 | whether or not you will be using a House Sync signal. 44 | 45 | - Set NV_CTRL_FRAMELOCK_POLARITY for each client Quadro Sync device in the 46 | cluster; most likely you want NV_CTRL_FRAMELOCK_POLARITY_RISING_EDGE. 47 | 48 | - Set NV_CTRL_FRAMELOCK_SYNC_DELAY as appropriate for each Quadro Sync 49 | device. Most likely you want 0. 50 | 51 | - Set NV_CTRL_FRAMELOCK_SYNC_INTERVAL as appropriate if you 52 | are using house sync. Most likely, you just want 0. 53 | 54 | Enabling/Disabling Frame Lock: 55 | 56 | - Enable Frame Lock on each GPU by setting NV_CTRL_FRAMELOCK_SYNC 57 | to NV_CTRL_FRAMELOCK_SYNC_ENABLE. 58 | 59 | - (optional) set NV_CTRL_FRAMELOCK_TEST_SIGNAL to 60 | NV_CTRL_FRAMELOCK_TEST_SIGNAL_ENABLE followed immediately by 61 | NV_CTRL_FRAMELOCK_TEST_SIGNAL_DISABLE (on the GPU that contains the 62 | server Frame Lock display device.) This guarantees accuracy of the 63 | Universal Frame Count (as returned by glXQueryFrameCountNV()). 64 | 65 | - When you are done, set NV_CTRL_FRAMELOCK_SYNC to 66 | NV_CTRL_FRAMELOCK_SYNC_DISABLE on each GPU to disable Frame Lock. 67 | 68 | During operation, you can also query any of these on each GPU or Frame Lock 69 | device: 70 | 71 | NV_CTRL_FRAMELOCK_PORT0_STATUS 72 | NV_CTRL_FRAMELOCK_PORT1_STATUS 73 | NV_CTRL_FRAMELOCK_HOUSE_STATUS 74 | NV_CTRL_FRAMELOCK_SYNC_READY 75 | NV_CTRL_FRAMELOCK_STEREO_SYNC 76 | NV_CTRL_FRAMELOCK_ETHERNET_DETECTED 77 | NV_CTRL_FRAMELOCK_SYNC_RATE 78 | NV_CTRL_FRAMELOCK_TIMING 79 | 80 | (nvidia-settings registers a gtk+ timeout function and queries the 81 | state of these on each X screen every few seconds). 82 | 83 | -------------------------------------------------------------------------------- /doc/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | # and Linux systems. 4 | # 5 | # Copyright (C) 2008-2012 NVIDIA Corporation. 6 | # 7 | # This program is free software; you can redistribute it and/or modify it 8 | # under the terms and conditions of the GNU General Public License, 9 | # version 2, as published by the Free Software Foundation. 10 | # 11 | # This program is distributed in the hope that it will be useful, but WITHOUT 12 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | # more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program. If not, see . 18 | # 19 | 20 | 21 | ############################################################################## 22 | # include common variables and functions 23 | ############################################################################## 24 | 25 | UTILS_MK_DIR ?= .. 26 | 27 | include $(UTILS_MK_DIR)/utils.mk 28 | 29 | 30 | ############################################################################## 31 | # The common-utils directory may be in one of two places: either 32 | # elsewhere in the driver source tree when building nvidia-settings as 33 | # part of the NVIDIA driver build (in which case, COMMON_UTILS_DIR 34 | # should be defined by the calling makefile), or directly in the 35 | # source directory when building from the nvidia-settings source 36 | # tarball (in which case, the below conditional assignments should be 37 | # used) 38 | ############################################################################## 39 | 40 | COMMON_UTILS_DIR ?= ../src/common-utils 41 | 42 | 43 | ############################################################################## 44 | # assign variables 45 | ############################################################################## 46 | 47 | MANPAGE_GZIP ?= 1 48 | 49 | MANPAGE_gzipped = $(OUTPUTDIR)/nvidia-settings.1.gz 50 | MANPAGE_not_gzipped = $(OUTPUTDIR)/nvidia-settings.1 51 | ifeq ($(MANPAGE_GZIP),1) 52 | MANPAGE = $(MANPAGE_gzipped) 53 | else 54 | MANPAGE = $(MANPAGE_not_gzipped) 55 | endif 56 | GEN_MANPAGE_OPTS = $(OUTPUTDIR_ABSOLUTE)/gen-manpage-opts 57 | OPTIONS_1_INC = $(OUTPUTDIR)/options.1.inc 58 | 59 | common_cflags += -I $(COMMON_UTILS_DIR) 60 | common_cflags += -I ../src/libXNVCtrlAttributes 61 | common_cflags += -I $(OUTPUTDIR) 62 | 63 | CFLAGS += $(common_cflags) 64 | HOST_CFLAGS += $(common_cflags) 65 | 66 | ############################################################################## 67 | # build rules 68 | ############################################################################## 69 | 70 | .PHONY: all 71 | all: $(MANPAGE) 72 | 73 | .PHONY: install 74 | install: MANPAGE_install 75 | 76 | .PHONY: MANPAGE_install 77 | MANPAGE_install: $(MANPAGE) 78 | $(MKDIR) $(MANDIR) 79 | $(INSTALL) $(INSTALL_DOC_ARGS) $< $(MANDIR)/$(notdir $<) 80 | 81 | .PHONY: clean clobber 82 | clean clobber: 83 | rm -rf $(MANPAGE) *~ $(OUTPUTDIR)/*.o $(OUTPUTDIR)/*.d \ 84 | $(GEN_MANPAGE_OPTS) $(OPTIONS_1_INC) 85 | 86 | 87 | ############################################################################## 88 | # Documentation 89 | ############################################################################## 90 | 91 | AUTO_TEXT = ".\\\" WARNING: THIS FILE IS AUTO-GENERATED! Edit $< instead." 92 | 93 | .PHONY: doc 94 | doc: $(MANPAGE) 95 | 96 | GEN_MANPAGE_OPTS_SRC = ../src/gen-manpage-opts.c 97 | GEN_MANPAGE_OPTS_SRC += $(COMMON_UTILS_DIR)/gen-manpage-opts-helper.c 98 | 99 | GEN_MANPAGE_OPTS_OBJS = $(call BUILD_OBJECT_LIST,$(GEN_MANPAGE_OPTS_SRC)) 100 | 101 | $(foreach src, $(GEN_MANPAGE_OPTS_SRC), \ 102 | $(eval $(call DEFINE_OBJECT_RULE,HOST,$(src)))) 103 | 104 | $(GEN_MANPAGE_OPTS): $(GEN_MANPAGE_OPTS_OBJS) 105 | $(call quiet_cmd,HOST_LINK) \ 106 | $(HOST_CFLAGS) $(HOST_LDFLAGS) $(HOST_BIN_LDFLAGS) $^ -o $@ 107 | 108 | $(OPTIONS_1_INC): $(GEN_MANPAGE_OPTS) 109 | @$< > $@ 110 | 111 | $(MANPAGE_not_gzipped): nvidia-settings.1.m4 $(OPTIONS_1_INC) $(VERSION_MK) 112 | $(call quiet_cmd,M4) \ 113 | -D__HEADER__=$(AUTO_TEXT) \ 114 | -D__BUILD_OS__=$(TARGET_OS) \ 115 | -D__VERSION__=$(NVIDIA_VERSION) \ 116 | -I $(OUTPUTDIR) \ 117 | $< > $@ 118 | 119 | $(MANPAGE_gzipped): $(MANPAGE_not_gzipped) 120 | $(GZIP_CMD) -9nf < $< > $@ 121 | -------------------------------------------------------------------------------- /doc/nvidia-settings.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Application 3 | Encoding=UTF-8 4 | Name=NVIDIA X Server Settings 5 | Comment=Configure NVIDIA X Server Settings 6 | Exec=__UTILS_PATH__/nvidia-settings 7 | Icon=nvidia-settings 8 | Categories=__NVIDIA_SETTINGS_DESKTOP_CATEGORIES__ 9 | 10 | # Translation by Marcin Mikołajczak 11 | Name[pl]=Ustawienia serwera X NVIDIA 12 | Comment[pl]=Narzędzie konfiguracyjne dla ustawień serwera X NVIDIA 13 | 14 | # Translation by RDL 15 | Name[ru]=Параметры NVIDIA X Server 16 | Comment[ru]=Конфигурирование параметров NVIDIA X Server 17 | 18 | # Translation by Tractix 19 | Name[ro]=Setări NVIDIA X Server 20 | Comment[ro]=Configurează setările NVIDIA X Server 21 | 22 | # Translations provided by Sun Microsystems 23 | Name[de]=NVIDIA X-Server-Einstellungen 24 | Name[es]=Valores de configuración del servidor NVIDIA X 25 | Name[fr]=Paramètres du serveur X NVIDIA 26 | Name[it]=NVIDIA X Server Settings 27 | Name[ja]=NVIDIA X サーバー設定 28 | Name[ko]=NVIDIA X 서버 설정 29 | Name[pt_BR]=Configurações do NVIDIA X Server 30 | Name[zh_CN]=NVIDIA X 服务器设置 31 | Name[zh_HK]=NVIDIA X 伺服器設定 32 | Name[zh_TW]=NVIDIA X 伺服器設定 33 | Comment[de]=Konfigurieren der NVIDIA X-Server-Einstellungen 34 | Comment[es]=Establezca los valores de configuración del servidor NVIDIA X 35 | Comment[fr]=Configurer les paramètres du serveur X NVIDIA 36 | Comment[it]=Configura NVIDIA X Server Settings 37 | Comment[ja]=NVIDIA X サーバー設定を構成します 38 | Comment[ko]=NVIDIA X 서버 설정 구성 39 | Comment[pt_BR]=Definir &configurações de gerenciamento de usuário... 40 | Comment[zh_CN]=配置 NVIDIA X 服务器设置 41 | Comment[zh_HK]=配置 NVIDIA X 伺服器設定 42 | Comment[zh_TW]=配置 NVIDIA X 伺服器設定 43 | -------------------------------------------------------------------------------- /doc/nvidia-settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/nvidia-settings/3dedbdf241e2d2311e1713124e6ed0e8be0c36e0/doc/nvidia-settings.png -------------------------------------------------------------------------------- /doc/src.mk: -------------------------------------------------------------------------------- 1 | # 2 | # files in the doc directory of nvidia-settings 3 | # 4 | 5 | DOC_SRC += 6 | 7 | DOC_EXTRA_DIST += NV-CONTROL-API.txt 8 | DOC_EXTRA_DIST += FRAMELOCK.txt 9 | DOC_EXTRA_DIST += nvidia-settings.1.m4 10 | DOC_EXTRA_DIST += nvidia-settings.desktop 11 | DOC_EXTRA_DIST += nvidia-settings.png 12 | DOC_EXTRA_DIST += src.mk 13 | 14 | DOC_DIST_FILES := $(DOC_SRC) $(DOC_EXTRA_DIST) -------------------------------------------------------------------------------- /doc/version.mk: -------------------------------------------------------------------------------- 1 | NVIDIA_VERSION = 575.57.08 2 | NVIDIA_NVID_VERSION = 575.57.08 3 | NVIDIA_NVID_EXTRA = 4 | 5 | # This file. 6 | VERSION_MK_FILE := $(lastword $(MAKEFILE_LIST)) 7 | $(OUTPUTDIR)/version.h: $(VERSION_MK_FILE) 8 | @$(MKDIR) $(OUTPUTDIR) 9 | @$(ECHO) '#define NVIDIA_VERSION "$(NVIDIA_VERSION)"' > $@ 10 | 11 | NV_GENERATED_HEADERS += $(OUTPUTDIR)/version.h 12 | -------------------------------------------------------------------------------- /samples/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # NV-CONTROL samples: Sample tools for configuring the NVIDIA X driver on Unix 3 | # and Linux systems. 4 | # 5 | # Copyright (c) 2010 NVIDIA, Corporation 6 | # 7 | # Permission is hereby granted, free of charge, to any person obtaining a copy 8 | # of this software and associated documentation files (the "Software"), to deal 9 | # in the Software without restriction, including without limitation the rights 10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | # copies of the Software, and to permit persons to whom the Software is 12 | # furnished to do so, subject to the following conditions: 13 | # 14 | # The above copyright notice and this permission notice (including the next 15 | # paragraph) shall be included in all copies or substantial portions of the 16 | # Software. 17 | # 18 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | # SOFTWARE. 25 | # 26 | 27 | ############################################################################## 28 | # include common variables and functions 29 | ############################################################################## 30 | 31 | UTILS_MK_DIR ?= .. 32 | 33 | include $(UTILS_MK_DIR)/utils.mk 34 | 35 | XNVCTRL_DIR ?= ../src/libXNVCtrl 36 | 37 | include $(XNVCTRL_DIR)/xnvctrl.mk 38 | 39 | 40 | ############################################################################## 41 | # The calling Makefile may export any of the following variables; we 42 | # assign default values if they are not exported by the caller 43 | ############################################################################## 44 | 45 | CFLAGS += $(XNVCTRL_CFLAGS) 46 | CFLAGS += -I $(XNVCTRL_DIR) 47 | CFLAGS += -I $(OUTPUTDIR) 48 | 49 | LDFLAGS += $(XNVCTRL_LDFLAGS) 50 | LIBS += -lXext -lX11 51 | 52 | 53 | ############################################################################## 54 | # samples 55 | ############################################################################## 56 | 57 | SAMPLE_SOURCES += nv-control-info.c 58 | SAMPLE_SOURCES += nv-control-dvc.c 59 | SAMPLE_SOURCES += nv-control-events.c 60 | SAMPLE_SOURCES += nv-control-dpy.c 61 | SAMPLE_SOURCES += nv-control-targets.c 62 | SAMPLE_SOURCES += nv-control-framelock.c 63 | SAMPLE_SOURCES += nv-control-3dvisionpro.c 64 | SAMPLE_SOURCES += nv-control-warpblend.c 65 | 66 | ############################################################################## 67 | # build rules 68 | ############################################################################## 69 | 70 | # define the rule to build each object file 71 | $(foreach src, $(SAMPLE_SOURCES), $(eval $(call DEFINE_OBJECT_RULE,TARGET,$(src)))) 72 | 73 | # define the rule to link each sample app from its corresponding object file 74 | define link_sample_from_object 75 | $$(OUTPUTDIR)/$(1:.c=): $$(call BUILD_OBJECT_LIST,$(1)) $$(LIBXNVCTRL) 76 | $$(call quiet_cmd,LINK) $$(CFLAGS) $$(LDFLAGS) $$(BIN_LDFLAGS) -o $$@ $$< $$(LIBXNVCTRL) $$(LIBS) 77 | 78 | .PHONY: all 79 | all: $$(OUTPUTDIR)/$(1:.c=) 80 | SAMPLES += $$(OUTPUTDIR)/$(1:.c=) 81 | endef 82 | 83 | $(foreach sample,$(SAMPLE_SOURCES),$(eval $(call link_sample_from_object,$(sample)))) 84 | 85 | .PHONY: clean clobber 86 | clean clobber: 87 | rm -rf *~ $(OUTPUTDIR)/*.o $(OUTPUTDIR)/*.d $(SAMPLES) $(LIBXNVCTRL) 88 | 89 | .PHONY: install 90 | install: 91 | @# don't install samples, this is just to satisfy the top-level 92 | @# recursion rule 93 | -------------------------------------------------------------------------------- /samples/README: -------------------------------------------------------------------------------- 1 | NV-CONTROL X Extension Samples 2 | 3 | The `nvidia-settings` application is fairly involved, and is not 4 | the easiest source code to read through for someone interested in 5 | learning how to use the NV-CONTROL X extension. 6 | 7 | The applications in this directory are trivial examples demonstrating 8 | how to use the NV-CONTROL X extension. For more thorough 9 | documentation on the extension, please see the NV-CONTROL-API.txt 10 | document (located in the doc/ directory of the nvidia-settings 11 | source package). 12 | 13 | Sample applications: 14 | 15 | nv-control-info: Demonstrates how to query for extension 16 | presence and basic information. 17 | 18 | nv-control-dvc: Demonstrates how to query and assign an 19 | integer attribute (NV_CTRL_DIGITAL_VIBRANCE); also 20 | shows how to handle multiple display devices. 21 | 22 | nv-control-events: Demonstrates how to register to receive and 23 | interpret NV-CONTROL events. 24 | 25 | nv-control-dpy: Demonstrates how to configure display devices 26 | using the NV-CONTROL X extension. 27 | 28 | nv-control-targets: Demonstrates how to query various attributes 29 | from varying target types (GPUs, X Screens, 30 | Frame Lock Boards) using the XNVCTRL target 31 | functions. 32 | 33 | nv-control-framelock: Demonstrates how to query frame lock related 34 | attributes. Also demonstrates how to enable/ 35 | disable frame lock. 36 | -------------------------------------------------------------------------------- /samples/nv-control-3dvisionpro.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 NVIDIA, Corporation 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice (including the next 12 | * paragraph) shall be included in all copies or substantial portions of the 13 | * Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | * SOFTWARE. 22 | */ 23 | 24 | /* 25 | * nv-control-3dvisionpro.c - Sample application that displays 26 | * the details of the glasses currently attached to the transceiver 27 | */ 28 | 29 | #include 30 | #include 31 | #include 32 | 33 | #include 34 | 35 | #include "NVCtrlLib.h" 36 | 37 | int main(int argc, char* argv[]) 38 | { 39 | Display *dpy; 40 | Bool ret; 41 | int i, target_id = 0, glass_id, num_of_glasses = 0; 42 | unsigned int *ptr; 43 | char *glass_name; 44 | int len; 45 | 46 | if(argc > 2) { 47 | printf("Too many Arguments\n"); 48 | return(0); 49 | } 50 | 51 | if(argc != 1) { 52 | target_id = atoi(argv[1]); 53 | } 54 | 55 | /* 56 | * open a connection to the X server indicated by the DISPLAY 57 | * environment variable 58 | */ 59 | 60 | dpy = XOpenDisplay(NULL); 61 | if (!dpy) { 62 | fprintf(stderr, "Cannot open display '%s'.\n", XDisplayName(NULL)); 63 | return 1; 64 | } 65 | 66 | /* 67 | * query the ids of the glasses connected to the Transceiver 68 | */ 69 | 70 | ret = XNVCTRLQueryTargetBinaryData(dpy, NV_CTRL_TARGET_TYPE_3D_VISION_PRO_TRANSCEIVER, target_id, 71 | 0, NV_CTRL_BINARY_DATA_GLASSES_PAIRED_TO_3D_VISION_PRO_TRANSCEIVER, 72 | (unsigned char**) &ptr, &len); 73 | if (ret) { 74 | num_of_glasses = ptr[0]; 75 | printf("Total no. of glasses paired = %d\n", num_of_glasses); 76 | 77 | if (num_of_glasses > 0) { 78 | printf("\n"); 79 | printf("%-20s", "GlassId"); 80 | printf("%-s\n", "GlassName" ); 81 | } 82 | 83 | for (i = 0; i < num_of_glasses; i++) { 84 | glass_id = ptr[i+1]; 85 | ret = XNVCTRLQueryTargetStringAttribute (dpy, NV_CTRL_TARGET_TYPE_3D_VISION_PRO_TRANSCEIVER, target_id, 86 | glass_id, NV_CTRL_STRING_3D_VISION_PRO_GLASSES_NAME, &glass_name); 87 | if (ret) { 88 | printf("%-20d", glass_id); 89 | printf("%-s\n", glass_name); 90 | } 91 | else { 92 | printf("Error retrieving GlassName for Glassid %d\n", glass_id); 93 | } 94 | XFree(glass_name); 95 | } 96 | XFree(ptr); 97 | } 98 | 99 | /* 100 | * close the display connection 101 | */ 102 | 103 | XCloseDisplay(dpy); 104 | 105 | return 0; 106 | } 107 | -------------------------------------------------------------------------------- /samples/nv-control-screen.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 NVIDIA Corporation 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice (including the next 12 | * paragraph) shall be included in all copies or substantial portions of the 13 | * Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | * SOFTWARE. 22 | */ 23 | 24 | /* 25 | * nv-control-screen.h - trivial helper for NV-CONTROL sample clients: use 26 | * the default screen if it is an NVIDIA X screen. If it isn't, then look 27 | * for the first NVIDIA X screen. Abort if no NVIDIA X screens are found. 28 | */ 29 | 30 | #ifndef __NV_CONTROL_SCREEN_H__ 31 | #define __NV_CONTROL_SCREEN_H__ 32 | 33 | #include 34 | #include 35 | #include 36 | 37 | #include "NVCtrlLib.h" 38 | 39 | static inline int GetNvXScreen(Display *dpy) 40 | { 41 | int defaultScreen, screen; 42 | 43 | defaultScreen = DefaultScreen(dpy); 44 | 45 | if (XNVCTRLIsNvScreen(dpy, defaultScreen)) { 46 | return defaultScreen; 47 | } 48 | 49 | for (screen = 0; screen < ScreenCount(dpy); screen++) { 50 | if (XNVCTRLIsNvScreen(dpy, screen)) { 51 | printf("Default X screen %d is not an NVIDIA X screen. " 52 | "Using X screen %d instead.\n", 53 | defaultScreen, screen); 54 | return screen; 55 | } 56 | } 57 | 58 | fprintf(stderr, "Unable to find any NVIDIA X screens; aborting.\n"); 59 | 60 | exit(1); 61 | } 62 | 63 | #endif /* __NV_CONTROL_SCREEN_H__ */ 64 | -------------------------------------------------------------------------------- /samples/src.mk: -------------------------------------------------------------------------------- 1 | # 2 | # files in the samples directory of nvidia-settings 3 | # 4 | 5 | SAMPLES_SRC += 6 | 7 | SAMPLES_EXTRA_DIST += README 8 | SAMPLES_EXTRA_DIST += nv-control-dvc.c 9 | SAMPLES_EXTRA_DIST += nv-control-3dvisionpro.c 10 | SAMPLES_EXTRA_DIST += nv-control-dpy.c 11 | SAMPLES_EXTRA_DIST += nv-control-info.c 12 | SAMPLES_EXTRA_DIST += nv-control-events.c 13 | SAMPLES_EXTRA_DIST += nv-control-targets.c 14 | SAMPLES_EXTRA_DIST += nv-control-framelock.c 15 | SAMPLES_EXTRA_DIST += nv-control-warpblend.c 16 | SAMPLES_EXTRA_DIST += nv-control-warpblend.h 17 | SAMPLES_EXTRA_DIST += nv-control-screen.h 18 | SAMPLES_EXTRA_DIST += src.mk 19 | 20 | SAMPLES_DIST_FILES := $(SAMPLES_SRC) $(SAMPLES_EXTRA_DIST) 21 | -------------------------------------------------------------------------------- /samples/version.mk: -------------------------------------------------------------------------------- 1 | NVIDIA_VERSION = 575.57.08 2 | NVIDIA_NVID_VERSION = 575.57.08 3 | NVIDIA_NVID_EXTRA = 4 | 5 | # This file. 6 | VERSION_MK_FILE := $(lastword $(MAKEFILE_LIST)) 7 | $(OUTPUTDIR)/version.h: $(VERSION_MK_FILE) 8 | @$(MKDIR) $(OUTPUTDIR) 9 | @$(ECHO) '#define NVIDIA_VERSION "$(NVIDIA_VERSION)"' > $@ 10 | 11 | NV_GENERATED_HEADERS += $(OUTPUTDIR)/version.h 12 | -------------------------------------------------------------------------------- /src/XF86Config-parser/Extensions.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2004 Red Hat Inc., Raleigh, North Carolina. 3 | * 4 | * All Rights Reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining 7 | * a copy of this software and associated documentation files (the 8 | * "Software"), to deal in the Software without restriction, including 9 | * without limitation on the rights to use, copy, modify, merge, 10 | * publish, distribute, sublicense, and/or sell copies of the Software, 11 | * and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice (including the 15 | * next paragraph) shall be included in all copies or substantial 16 | * portions of the Software. 17 | * 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS 22 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 23 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 24 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 25 | * SOFTWARE. 26 | */ 27 | 28 | /* 29 | * Authors: 30 | * Kevin E. Martin 31 | * 32 | */ 33 | 34 | #include "xf86Parser.h" 35 | #include "xf86tokens.h" 36 | #include "Configint.h" 37 | 38 | extern LexRec val; 39 | 40 | static XConfigSymTabRec ExtensionsTab[] = 41 | { 42 | {ENDSECTION, "endsection"}, 43 | {OPTION, "option"}, 44 | {-1, ""}, 45 | }; 46 | 47 | #define CLEANUP xconfigFreeExtensions 48 | 49 | XConfigExtensionsPtr 50 | xconfigParseExtensionsSection (void) 51 | { 52 | int token; 53 | 54 | PARSE_PROLOGUE (XConfigExtensionsPtr, XConfigExtensionsRec); 55 | 56 | while ((token = xconfigGetToken (ExtensionsTab)) != ENDSECTION) { 57 | switch (token) { 58 | case OPTION: 59 | ptr->options = xconfigParseOption(ptr->options); 60 | break; 61 | case EOF_TOKEN: 62 | Error (UNEXPECTED_EOF_MSG, NULL); 63 | break; 64 | case COMMENT: 65 | ptr->comment = xconfigAddComment(ptr->comment, val.str); 66 | break; 67 | default: 68 | Error (INVALID_KEYWORD_MSG, xconfigTokenString ()); 69 | break; 70 | } 71 | } 72 | 73 | return ptr; 74 | } 75 | 76 | #undef CLEANUP 77 | 78 | void 79 | xconfigPrintExtensionsSection (FILE * cf, XConfigExtensionsPtr ptr) 80 | { 81 | XConfigOptionPtr p; 82 | 83 | if (ptr == NULL || ptr->options == NULL) 84 | return; 85 | 86 | p = ptr->options; 87 | fprintf (cf, "Section \"Extensions\"\n"); 88 | if (ptr->comment) fprintf (cf, "%s", ptr->comment); 89 | xconfigPrintOptionList(cf, p, 1); 90 | fprintf (cf, "EndSection\n\n"); 91 | } 92 | 93 | void 94 | xconfigFreeExtensions (XConfigExtensionsPtr *ptr) 95 | { 96 | if (ptr == NULL || *ptr == NULL) 97 | return; 98 | 99 | xconfigFreeOptionList (&((*ptr)->options)); 100 | TEST_FREE ((*ptr)->comment); 101 | free (*ptr); 102 | *ptr = NULL; 103 | } 104 | -------------------------------------------------------------------------------- /src/XF86Config-parser/src.mk: -------------------------------------------------------------------------------- 1 | # makefile fragment included by nvidia-xconfig and nvidia-settings 2 | 3 | XCONFIG_PARSER_SRC += DRI.c 4 | XCONFIG_PARSER_SRC += Device.c 5 | XCONFIG_PARSER_SRC += Extensions.c 6 | XCONFIG_PARSER_SRC += Files.c 7 | XCONFIG_PARSER_SRC += Flags.c 8 | XCONFIG_PARSER_SRC += Generate.c 9 | XCONFIG_PARSER_SRC += Input.c 10 | XCONFIG_PARSER_SRC += Keyboard.c 11 | XCONFIG_PARSER_SRC += Layout.c 12 | XCONFIG_PARSER_SRC += Merge.c 13 | XCONFIG_PARSER_SRC += Module.c 14 | XCONFIG_PARSER_SRC += Monitor.c 15 | XCONFIG_PARSER_SRC += Pointer.c 16 | XCONFIG_PARSER_SRC += Read.c 17 | XCONFIG_PARSER_SRC += Scan.c 18 | XCONFIG_PARSER_SRC += Screen.c 19 | XCONFIG_PARSER_SRC += Util.c 20 | XCONFIG_PARSER_SRC += Vendor.c 21 | XCONFIG_PARSER_SRC += Video.c 22 | XCONFIG_PARSER_SRC += Write.c 23 | 24 | XCONFIG_PARSER_EXTRA_DIST += Configint.h 25 | XCONFIG_PARSER_EXTRA_DIST += configProcs.h 26 | XCONFIG_PARSER_EXTRA_DIST += xf86Parser.h 27 | XCONFIG_PARSER_EXTRA_DIST += xf86tokens.h 28 | XCONFIG_PARSER_EXTRA_DIST += src.mk 29 | 30 | -------------------------------------------------------------------------------- /src/common-unix/virtual-resolutions/nvvr.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012-2013 NVIDIA Corporation 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #include 24 | #include 25 | 26 | #include "nvvr.h" 27 | 28 | /*! 29 | * Compute ViewPortOut, given raster size, ViewPortIn size, and scaling type. 30 | * 31 | * ViewPortOut should fit within the raster size, scaled to the raster 32 | * size in one dimension, and scaled in the other dimension such that 33 | * the aspect ratio of ViewPortIn is preserved. 34 | * 35 | * \param[in] raster raster size 36 | * \param[in] viewPortIn ViewPortIn size 37 | * \param[in] scaled scaling type 38 | * 39 | * \return The ViewPortOut {x,y,w,h} 40 | */ 41 | NVVRBoxRecXYWH NVVRGetScaledViewPortOut(const NVVRSize *raster, 42 | const NVVRSize *viewPortIn, 43 | const NVVRScalingType scaling) 44 | { 45 | NVVRBoxRecXYWH viewPortOut; 46 | float scaleX, scaleY; 47 | 48 | memset(&viewPortOut, 0, sizeof(viewPortOut)); 49 | 50 | switch (scaling) { 51 | default: 52 | /* fall through */ 53 | 54 | case NVVR_SCALING_ASPECT_SCALED: 55 | scaleX = (float) raster->w / (float) viewPortIn->w; 56 | scaleY = (float) raster->h / (float) viewPortIn->h; 57 | 58 | if (scaleX < scaleY) { 59 | viewPortOut.w = raster->w; 60 | viewPortOut.h = viewPortIn->h * scaleX; 61 | viewPortOut.x = 0; 62 | viewPortOut.y = (raster->h - viewPortOut.h) / 2; 63 | } else { 64 | viewPortOut.w = viewPortIn->w * scaleY; 65 | viewPortOut.h = raster->h; 66 | viewPortOut.x = (raster->w - viewPortOut.w) / 2; 67 | viewPortOut.y = 0; 68 | } 69 | break; 70 | 71 | case NVVR_SCALING_SCALED: 72 | viewPortOut.x = 0; 73 | viewPortOut.y = 0; 74 | viewPortOut.w = raster->w; 75 | viewPortOut.h = raster->h; 76 | break; 77 | 78 | case NVVR_SCALING_CENTERED: 79 | /* if raster is smaller than viewPortIn, fall back to scaling */ 80 | if (raster->w >= viewPortIn->w) { 81 | viewPortOut.w = viewPortIn->w; 82 | viewPortOut.x = (raster->w - viewPortIn->w) / 2; 83 | } else { 84 | viewPortOut.w = raster->w; 85 | viewPortOut.x = 0; 86 | } 87 | 88 | if (raster->h >= viewPortIn->h) { 89 | viewPortOut.h = viewPortIn->h; 90 | viewPortOut.y = (raster->h - viewPortIn->h) / 2; 91 | } else { 92 | viewPortOut.h = raster->h; 93 | viewPortOut.y = 0; 94 | } 95 | break; 96 | } 97 | 98 | return viewPortOut; 99 | } 100 | 101 | /*! 102 | * Return a constant array of a (-1, -1) terminated list of common 103 | * resolutions. 104 | * 105 | * \return A constant array of NVVRSize. 106 | */ 107 | const NVVRSize* NVVRGetCommonResolutions() 108 | { 109 | static const NVVRSize commonRes[] = { 110 | { 3840, 2400 }, 111 | { 2560, 1600 }, 112 | { 2560, 1440 }, 113 | { 1920, 1200 }, 114 | { 1920, 1080 }, 115 | { 1680, 1050 }, 116 | { 1600, 1200 }, 117 | { 1440, 900 }, 118 | { 1366, 768 }, 119 | { 1280, 1024 }, 120 | { 1280, 800 }, 121 | { 1280, 720 }, 122 | { 1024, 768 }, 123 | { 800, 600 }, 124 | { 640, 480 }, 125 | { -1, -1 }, 126 | }; 127 | 128 | return commonRes; 129 | } 130 | -------------------------------------------------------------------------------- /src/common-unix/virtual-resolutions/nvvr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012-2013 NVIDIA Corporation 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef NVVR_H 24 | #define NVVR_H 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | typedef struct { int w, h; } NVVRSize; 31 | typedef struct { int x, y, w, h; } NVVRBoxRecXYWH; 32 | 33 | typedef enum NVVRScalingTypeEnum { 34 | NVVR_SCALING_ASPECT_SCALED = 0, 35 | NVVR_SCALING_SCALED, 36 | NVVR_SCALING_CENTERED, 37 | } NVVRScalingType; 38 | 39 | 40 | NVVRBoxRecXYWH NVVRGetScaledViewPortOut(const NVVRSize *raster, 41 | const NVVRSize *viewPortIn, 42 | const NVVRScalingType scaling); 43 | 44 | const NVVRSize* NVVRGetCommonResolutions(void); 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif /* NVVR_H */ 51 | -------------------------------------------------------------------------------- /src/common-unix/virtual-resolutions/src.mk: -------------------------------------------------------------------------------- 1 | # makefile fragment included by nvidia-settings 2 | 3 | VIRTUAL_RESOLUTIONS_SRC += nvvr.c 4 | 5 | VIRTUAL_RESOLUTIONS_EXTRA_DIST += nvvr.h 6 | VIRTUAL_RESOLUTIONS_EXTRA_DIST += src.mk 7 | -------------------------------------------------------------------------------- /src/common-utils/gen-manpage-opts-helper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a 5 | * copy of this software and associated documentation files (the "Software"), 6 | * to deal in the Software without restriction, including without limitation 7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 | * and/or sell copies of the Software, and to permit persons to whom the 9 | * Software is furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20 | * DEALINGS IN THE SOFTWARE. 21 | */ 22 | 23 | #if !defined(__GEN_MANPAGE_OPTS_HELPER_H__) 24 | #define __GEN_MANPAGE_OPTS_HELPER_H__ 25 | 26 | #include "nvgetopt.h" 27 | 28 | void gen_manpage_opts_helper(const NVGetoptOption *options); 29 | 30 | #endif /* __GEN_MANPAGE_OPTS_HELPER_H__ */ 31 | -------------------------------------------------------------------------------- /src/common-utils/nvpci-utils.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 NVIDIA Corporation 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a 5 | * copy of this software and associated documentation files (the "Software"), 6 | * to deal in the Software without restriction, including without limitation 7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 | * and/or sell copies of the Software, and to permit persons to whom the 9 | * Software is furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20 | * DEALINGS IN THE SOFTWARE. 21 | */ 22 | 23 | #include "nvpci-utils.h" 24 | 25 | /* 26 | * libpciaccess stores the device class in bits 16-23, subclass in 8-15, and 27 | * interface in bits 0-7 of dev->device_class. We care only about the class 28 | * and subclass. 29 | */ 30 | const uint32_t PCI_CLASS_DISPLAY_VGA = 0x30000; 31 | const uint32_t PCI_CLASS_SUBCLASS_MASK = 0xffff00; 32 | 33 | /* 34 | * nvpci_find_gpu_by_vendor() - use libpciaccess to find all VGA and 3D PCI 35 | * devices matching the passed-in vendor_id (which may be set to PCI_MATCH_ANY). 36 | * The caller is responsible for calling pci_system_init() before using this 37 | * function, and pci_system_cleanup() when libpciaccess is no longer needed. 38 | */ 39 | struct pci_device_iterator *nvpci_find_gpu_by_vendor(uint32_t vendor_id) 40 | { 41 | const struct pci_id_match match = { 42 | .vendor_id = vendor_id, 43 | .device_id = PCI_MATCH_ANY, 44 | .subvendor_id = PCI_MATCH_ANY, 45 | .subdevice_id = PCI_MATCH_ANY, 46 | .device_class = PCI_CLASS_DISPLAY_VGA, 47 | /* 48 | * Ignore bit 1 of the subclass, to allow both 0x30000 (VGA controller) 49 | * and 0x30200 (3D controller). 50 | */ 51 | .device_class_mask = PCI_CLASS_SUBCLASS_MASK & ~0x200, 52 | }; 53 | 54 | return pci_id_match_iterator_create(&match); 55 | } 56 | 57 | /* 58 | * nvpci_dev_is_vga() - test whether the passed-in struct pci_device* has the 59 | * VGA device class 0x0300 (and not 3D class 0x0302). 60 | */ 61 | int nvpci_dev_is_vga(struct pci_device *dev) 62 | { 63 | return (dev->device_class & PCI_CLASS_SUBCLASS_MASK) == 64 | PCI_CLASS_DISPLAY_VGA; 65 | } 66 | -------------------------------------------------------------------------------- /src/common-utils/nvpci-utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 NVIDIA Corporation 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a 5 | * copy of this software and associated documentation files (the "Software"), 6 | * to deal in the Software without restriction, including without limitation 7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 | * and/or sell copies of the Software, and to permit persons to whom the 9 | * Software is furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20 | * DEALINGS IN THE SOFTWARE. 21 | */ 22 | 23 | #ifndef __NVPCI_UTILS_H__ 24 | #define __NVPCI_UTILS_H__ 25 | 26 | #include 27 | 28 | #define NV_PCI_VENDOR_ID 0x10de 29 | 30 | struct pci_device_iterator *nvpci_find_gpu_by_vendor(uint32_t vendor_id); 31 | int nvpci_dev_is_vga(struct pci_device *dev); 32 | 33 | #endif /* __NVPCI_UTILS_H__ */ 34 | -------------------------------------------------------------------------------- /src/common-utils/src.mk: -------------------------------------------------------------------------------- 1 | # makefile fragment included by nvidia-xconfig, nvidia-settings, and nvidia-installer 2 | 3 | # the including makefile should set this if the relevant program uses pciaccess 4 | COMMON_UTILS_PCIACCESS ?= 5 | 6 | COMMON_UTILS_SRC += nvgetopt.c 7 | COMMON_UTILS_SRC += common-utils.c 8 | COMMON_UTILS_SRC += msg.c 9 | 10 | COMMON_UTILS_EXTRA_DIST += nvgetopt.h 11 | COMMON_UTILS_EXTRA_DIST += common-utils.h 12 | COMMON_UTILS_EXTRA_DIST += msg.h 13 | COMMON_UTILS_EXTRA_DIST += src.mk 14 | 15 | # only build nvpci-utils.c for programs that actually use libpciaccess, to 16 | # prevent other programs from needing to set the right CFLAGS/LDFLAGS for code 17 | # they won't use. Otherwise, just package it in the source tarball. 18 | ifneq ($(COMMON_UTILS_PCIACCESS),) 19 | COMMON_UTILS_SRC += nvpci-utils.c 20 | 21 | ifndef PCIACCESS_CFLAGS 22 | PCIACCESS_CFLAGS := $(shell $(PKG_CONFIG) --cflags pciaccess) 23 | endif 24 | 25 | ifndef PCIACCESS_LDFLAGS 26 | PCIACCESS_LDFLAGS := $(shell $(PKG_CONFIG) --libs pciaccess) 27 | endif 28 | 29 | $(call BUILD_OBJECT_LIST,nvpci-utils.c): CFLAGS += $(PCIACCESS_CFLAGS) 30 | else 31 | COMMON_UTILS_EXTRA_DIST += nvpci-utils.c 32 | endif 33 | COMMON_UTILS_EXTRA_DIST += nvpci-utils.h 34 | 35 | # gen-manpage-opts-helper.c is listed in EXTRA_DIST, rather than SRC, 36 | # because it is not compiled into the utilities themselves, but used 37 | # when building the utility's gen-manpage-opts 38 | COMMON_UTILS_EXTRA_DIST += gen-manpage-opts-helper.c 39 | COMMON_UTILS_EXTRA_DIST += gen-manpage-opts-helper.h 40 | 41 | -------------------------------------------------------------------------------- /src/config-file.h: -------------------------------------------------------------------------------- 1 | /* 2 | * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | * and Linux systems. 4 | * 5 | * Copyright (C) 2004 NVIDIA Corporation. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms and conditions of the GNU General Public License, 9 | * version 2, as published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | * more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef __CONFIG_FILE_H__ 21 | #define __CONFIG_FILE_H__ 22 | 23 | #include "query-assign.h" 24 | 25 | 26 | /* 27 | * The ConfigProperties structure contains additional configuration 28 | * data to be written to the rc file; these are configuration 29 | * properties of the nvidia-settings utilities itself, rather than 30 | * properties of the X screen(s) that nvidia-settings is configuring. 31 | */ 32 | 33 | #define CONFIG_PROPERTIES_TOOLTIPS (1<<0) 34 | #define CONFIG_PROPERTIES_DISPLAY_STATUS_BAR (1<<1) 35 | #define CONFIG_PROPERTIES_SLIDER_TEXT_ENTRIES (1<<2) 36 | #define CONFIG_PROPERTIES_INCLUDE_DISPLAY_NAME_IN_CONFIG_FILE (1<<3) 37 | #define CONFIG_PROPERTIES_UPDATE_RULES_ON_PROFILE_NAME_CHANGE (1<<4) 38 | 39 | typedef struct _TimerConfigProperty { 40 | char *description; 41 | unsigned int user_enabled; 42 | unsigned int interval; 43 | struct _TimerConfigProperty *next; 44 | } TimerConfigProperty; 45 | 46 | typedef struct { 47 | unsigned int booleans; 48 | char *locale; 49 | TimerConfigProperty *timers; 50 | } ConfigProperties; 51 | 52 | 53 | void set_dynamic_verbosity(int dynamic); 54 | 55 | void init_config_properties(ConfigProperties *conf); 56 | 57 | int nv_read_config_file(const Options *, const char *, const char *, 58 | ParsedAttribute *, ConfigProperties *, 59 | CtrlSystemList *); 60 | 61 | int nv_write_config_file(const char *, const CtrlSystem *, 62 | const ParsedAttribute *, const ConfigProperties *); 63 | 64 | #endif /* __CONFIG_FILE_H__ */ 65 | -------------------------------------------------------------------------------- /src/gen-manpage-opts.c: -------------------------------------------------------------------------------- 1 | /* 2 | * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | * and Linux systems. 4 | * 5 | * Copyright (C) 2010 NVIDIA Corporation. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms and conditions of the GNU General Public License, 9 | * version 2, as published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | * more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | #include "nvgetopt.h" 26 | #include "option-table.h" 27 | #include "gen-manpage-opts-helper.h" 28 | 29 | int main(void) 30 | { 31 | gen_manpage_opts_helper(__options); 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /src/glxinfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | * and Linux systems. 4 | * 5 | * Copyright (C) 2004 NVIDIA Corporation. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms and conditions of the GNU General Public License, 9 | * version 2, as published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | * more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef __GLXINFO_H__ 21 | #define __GLXINFO_H__ 22 | 23 | #include 24 | #include 25 | #include "query-assign.h" 26 | 27 | 28 | #ifndef GLX_VERSION_1_3 29 | #warning GLX version 1.3 not defined, will not show FBConfig table! 30 | #else 31 | const char * render_type_abbrev(int rend_type); 32 | const char * transparent_type_abbrev(int trans_type); 33 | const char * x_visual_type_abbrev(int x_visual_type); 34 | const char * caveat_abbrev(int caveat); 35 | #endif 36 | const char * egl_color_buffer_type_abbrev(int type); 37 | const char * egl_config_caveat_abbrev(int type); 38 | const char * egl_transparent_type_abbrev(int type); 39 | 40 | const char *vulkan_get_physical_device_type(VkPhysicalDeviceType type); 41 | char *vulkan_get_version_string(uint32_t); 42 | char *vulkan_get_queue_family_flags(VkQueueFlags flags); 43 | char *vulkan_get_memory_property_flags(VkMemoryPropertyFlagBits flags); 44 | char *vulkan_get_memory_heap_flags(VkMemoryHeapFlags flags); 45 | char *vulkan_get_format_feature_flags(VkFormatFeatureFlags flags); 46 | 47 | void print_glxinfo(const char *display_name, CtrlSystemList *systems); 48 | void print_eglinfo(const char *display_name, CtrlSystemList *systems); 49 | void print_vulkaninfo(const char *display_name, CtrlSystemList *systems); 50 | 51 | 52 | #endif /* __GLXINFO_H__ */ 53 | -------------------------------------------------------------------------------- /src/gtk+-2.x/ctkapcprofilemodel.h: -------------------------------------------------------------------------------- 1 | /* 2 | * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | * and Linux systems. 4 | * 5 | * Copyright (C) 2013 NVIDIA Corporation. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms and conditions of the GNU General Public License, 9 | * version 2, as published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | * more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | // Tree model implementation for operating on profiles in an AppProfileConfig 21 | 22 | #ifndef __CTK_APC_PROFILE_MODEL_H__ 23 | #define __CTK_APC_PROFILE_MODEL_H__ 24 | 25 | #include 26 | #include 27 | #include "app-profiles.h" 28 | 29 | G_BEGIN_DECLS 30 | 31 | #define CTK_TYPE_APC_PROFILE_MODEL (ctk_apc_profile_model_get_type()) 32 | 33 | #define CTK_APC_PROFILE_MODEL(obj) \ 34 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), CTK_TYPE_APC_PROFILE_MODEL, CtkApcProfileModel)) 35 | 36 | #define CTK_APC_PROFILE_MODEL_CLASS(klass) \ 37 | (G_TYPE_CHECK_CLASS_CAST ((klass), CTK_TYPE_APC_PROFILE_MODEL, CtkApcProfileModelClass)) 38 | 39 | #define CTK_IS_APC_PROFILE_MODEL(obj) \ 40 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CTK_TYPE_APC_PROFILE_MODEL)) 41 | 42 | #define CTK_IS_APC_PROFILE_MODEL_CLASS(klass) \ 43 | (G_TYPE_CHECK_CLASS_TYPE ((klass), CTK_TYPE_APC_PROFILE_MODEL)) 44 | 45 | #define CTK_APC_PROFILE_MODEL_GET_CLASS(obj) \ 46 | (G_TYPE_INSTANCE_GET_CLASS ((obj), CTK_TYPE_APC_PROFILE_MODEL, CtkApcProfileModelClass)) 47 | 48 | enum { 49 | CTK_APC_PROFILE_MODEL_COL_NAME = 0, 50 | CTK_APC_PROFILE_MODEL_COL_FILENAME, 51 | CTK_APC_PROFILE_MODEL_COL_SETTINGS, 52 | CTK_APC_PROFILE_MODEL_N_COLUMNS, 53 | CTK_APC_PROFILE_MODEL_DEFAULT_SORT_COL = CTK_APC_PROFILE_MODEL_COL_NAME 54 | }; 55 | 56 | typedef struct _CtkApcProfileModel CtkApcProfileModel; 57 | typedef struct _CtkApcProfileModelClass CtkApcProfileModelClass; 58 | 59 | #define CTK_APC_PROFILE_MODEL_MAX_ITERS 16 60 | 61 | struct _CtkApcProfileModel 62 | { 63 | GObject parent; 64 | gint stamp; 65 | 66 | AppProfileConfig *config; 67 | 68 | // A sortable array of profile names cached from the config, used for 69 | // presentation and iteration. 70 | GArray *profiles; 71 | gint sort_column_id; 72 | GtkSortType order; 73 | 74 | GtkTreeIterCompareFunc sort_funcs[CTK_APC_PROFILE_MODEL_N_COLUMNS]; 75 | gpointer sort_user_data[CTK_APC_PROFILE_MODEL_N_COLUMNS]; 76 | GDestroyNotify sort_destroy_notify[CTK_APC_PROFILE_MODEL_N_COLUMNS]; 77 | }; 78 | 79 | struct _CtkApcProfileModelClass 80 | { 81 | GObjectClass parent_class; 82 | }; 83 | 84 | GType ctk_apc_profile_model_class_get_type (void) G_GNUC_CONST; 85 | GType ctk_apc_profile_model_get_type(void) G_GNUC_CONST; 86 | CtkApcProfileModel *ctk_apc_profile_model_new (AppProfileConfig *config); 87 | 88 | void ctk_apc_profile_model_update_profile(CtkApcProfileModel *prof_model, 89 | const char *filename, 90 | const char *profile_name, 91 | json_t *profile); 92 | 93 | void ctk_apc_profile_model_delete_profile(CtkApcProfileModel *prof_model, 94 | const char *profile_name); 95 | 96 | void ctk_apc_profile_model_attach(CtkApcProfileModel *prof_model, AppProfileConfig *config); 97 | 98 | // Thin wrapper around nv_app_profile_config_get_profile() to promote 99 | // modularity (all requests for config data should go through the models). 100 | static inline const json_t *ctk_apc_profile_model_get_profile(CtkApcProfileModel *prof_model, 101 | const char *profile_name) 102 | { 103 | return nv_app_profile_config_get_profile(prof_model->config, profile_name); 104 | } 105 | 106 | G_END_DECLS 107 | 108 | #endif 109 | -------------------------------------------------------------------------------- /src/gtk+-2.x/ctkapcrulemodel.h: -------------------------------------------------------------------------------- 1 | /* 2 | * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | * and Linux systems. 4 | * 5 | * Copyright (C) 2013 NVIDIA Corporation. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms and conditions of the GNU General Public License, 9 | * version 2, as published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | * more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | // Tree model implementation for operating on rules in an AppProfileConfig 21 | 22 | #ifndef __CTK_APC_RULE_MODEL_H__ 23 | #define __CTK_APC_RULE_MODEL_H__ 24 | 25 | #include 26 | #include 27 | #include "app-profiles.h" 28 | 29 | G_BEGIN_DECLS 30 | 31 | #define CTK_TYPE_APC_RULE_MODEL (ctk_apc_rule_model_get_type()) 32 | 33 | #define CTK_APC_RULE_MODEL(obj) \ 34 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), CTK_TYPE_APC_RULE_MODEL, CtkApcRuleModel)) 35 | 36 | #define CTK_APC_RULE_MODEL_CLASS(klass) \ 37 | (G_TYPE_CHECK_CLASS_CAST ((klass), CTK_TYPE_APC_RULE_MODEL, CtkApcRuleModelClass)) 38 | 39 | #define CTK_IS_APC_RULE_MODEL(obj) \ 40 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CTK_TYPE_APC_RULE_MODEL)) 41 | 42 | #define CTK_IS_APC_RULE_MODEL_CLASS(klass) \ 43 | (G_TYPE_CHECK_CLASS_TYPE ((klass), CTK_TYPE_APC_RULE_MODEL)) 44 | 45 | #define CTK_APC_RULE_MODEL_GET_CLASS(obj) \ 46 | (G_TYPE_INSTANCE_GET_CLASS ((obj), CTK_TYPE_APC_RULE_MODEL, CtkApcRuleModelClass)) 47 | 48 | enum { 49 | CTK_APC_RULE_MODEL_COL_ID = 0, 50 | CTK_APC_RULE_MODEL_COL_FEATURE, 51 | CTK_APC_RULE_MODEL_COL_MATCHES, 52 | CTK_APC_RULE_MODEL_COL_PROFILE_NAME, 53 | CTK_APC_RULE_MODEL_COL_FILENAME, 54 | CTK_APC_RULE_MODEL_N_COLUMNS 55 | }; 56 | 57 | typedef struct _CtkApcRuleModel CtkApcRuleModel; 58 | typedef struct _CtkApcRuleModelClass CtkApcRuleModelClass; 59 | 60 | struct _CtkApcRuleModel 61 | { 62 | GObject parent; 63 | gint stamp; 64 | 65 | AppProfileConfig *config; 66 | 67 | // A sortable array of rule IDs (int) cached from the config, 68 | // used for presentation and iteration. 69 | GArray *rules; 70 | }; 71 | 72 | struct _CtkApcRuleModelClass 73 | { 74 | GObjectClass parent_class; 75 | }; 76 | 77 | GType ctk_apc_rule_model_class_get_type (void) G_GNUC_CONST; 78 | CtkApcRuleModel *ctk_apc_rule_model_new (AppProfileConfig *config); 79 | 80 | int ctk_apc_rule_model_create_rule(CtkApcRuleModel *rule_model, 81 | const char *filename, 82 | json_t *new_rule); 83 | void ctk_apc_rule_model_update_rule(CtkApcRuleModel *rule_model, 84 | const char *filename, 85 | int id, 86 | json_t *rule); 87 | void ctk_apc_rule_model_delete_rule(CtkApcRuleModel *rule_model, int id); 88 | void ctk_apc_rule_model_set_abs_rule_priority(CtkApcRuleModel *rule_model, 89 | int id, size_t pri); 90 | void ctk_apc_rule_model_change_rule_priority(CtkApcRuleModel *rule_model, 91 | int id, int delta); 92 | 93 | void ctk_apc_rule_model_attach(CtkApcRuleModel *rule_model, AppProfileConfig *config); 94 | 95 | G_END_DECLS 96 | 97 | #endif 98 | -------------------------------------------------------------------------------- /src/gtk+-2.x/ctkbanner.h: -------------------------------------------------------------------------------- 1 | /* 2 | * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | * and Linux systems. 4 | * 5 | * Copyright (C) 2006 NVIDIA Corporation. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms and conditions of the GNU General Public License, 9 | * version 2, as published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | * more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef __CTK_BANNER_H__ 21 | #define __CTK_BANNER_H__ 22 | 23 | G_BEGIN_DECLS 24 | 25 | #define CTK_TYPE_BANNER (ctk_banner_get_type()) 26 | 27 | #define CTK_BANNER(obj) \ 28 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), CTK_TYPE_BANNER, CtkBanner)) 29 | 30 | #define CTK_BANNER_CLASS(klass) \ 31 | (G_TYPE_CHECK_CLASS_CAST ((klass), CTK_TYPE_BANNER, CtkBannerClass)) 32 | 33 | #define CTK_IS_BANNER(obj) \ 34 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CTK_TYPE_BANNER)) 35 | 36 | #define CTK_IS_BANNER_CLASS(class) \ 37 | (G_TYPE_CHECK_CLASS_TYPE ((klass), CTK_TYPE_BANNER)) 38 | 39 | #define CTK_BANNER_GET_CLASS(obj) \ 40 | (G_TYPE_INSTANCE_GET_CLASS ((obj), CTK_TYPE_BANNER, CtkBannerClass)) 41 | 42 | /* 43 | * enum for the banner artwork 44 | */ 45 | 46 | typedef enum { 47 | BANNER_ARTWORK_ANTIALIAS, 48 | BANNER_ARTWORK_BSD, 49 | BANNER_ARTWORK_CLOCK, 50 | BANNER_ARTWORK_COLOR, 51 | BANNER_ARTWORK_CONFIG, 52 | BANNER_ARTWORK_CRT, 53 | BANNER_ARTWORK_DFP, 54 | BANNER_ARTWORK_DISPLAY_CONFIG, 55 | BANNER_ARTWORK_FRAMELOCK, 56 | BANNER_ARTWORK_GPU, 57 | BANNER_ARTWORK_GRAPHICS, 58 | BANNER_ARTWORK_HELP, 59 | BANNER_ARTWORK_OPENGL, 60 | BANNER_ARTWORK_PENGUIN, 61 | BANNER_ARTWORK_SERVER_LICENSING, 62 | BANNER_ARTWORK_SLIMM, 63 | BANNER_ARTWORK_SOLARIS, 64 | BANNER_ARTWORK_THERMAL, 65 | BANNER_ARTWORK_VDPAU, 66 | BANNER_ARTWORK_X, 67 | BANNER_ARTWORK_XVIDEO, 68 | BANNER_ARTWORK_SVP, 69 | BANNER_ARTWORK_BLANK 70 | } BannerArtworkType; 71 | 72 | 73 | typedef struct _CtkBanner CtkBanner; 74 | typedef struct _CtkBannerClass CtkBannerClass; 75 | 76 | typedef void (* ctk_banner_composite_callback) (CtkBanner *, void *); 77 | 78 | typedef struct { 79 | int w, h; 80 | GdkPixbuf *pixbuf; 81 | } PBuf; 82 | 83 | struct _CtkBanner 84 | { 85 | GtkDrawingArea parent; 86 | 87 | guint8 *image_data; 88 | 89 | PBuf back; 90 | PBuf artwork; 91 | int artwork_x; /* Position within banner where artwork is drawn */ 92 | int artwork_y; 93 | 94 | ctk_banner_composite_callback callback_func; 95 | void * callback_data; 96 | 97 | PBuf *background; 98 | PBuf *logo; 99 | int logo_x; /* Position within banner where logo is drawn */ 100 | int logo_y; 101 | 102 | int logo_pad_x; 103 | int logo_pad_y; 104 | 105 | int artwork_pad_x; 106 | }; 107 | 108 | struct _CtkBannerClass 109 | { 110 | GtkDrawingAreaClass parent_class; 111 | }; 112 | 113 | GType ctk_banner_get_type (void) G_GNUC_CONST; 114 | GtkWidget* ctk_banner_new (BannerArtworkType); 115 | 116 | void ctk_banner_set_composite_callback (CtkBanner *, 117 | ctk_banner_composite_callback, 118 | void *); 119 | 120 | GtkWidget* ctk_banner_image_new (BannerArtworkType artwork); 121 | 122 | GtkWidget* ctk_banner_image_new_with_callback (BannerArtworkType artwork, 123 | ctk_banner_composite_callback, 124 | void *); 125 | 126 | 127 | G_END_DECLS 128 | 129 | #endif /* __CTK_BANNER_H__ */ 130 | 131 | -------------------------------------------------------------------------------- /src/gtk+-2.x/ctkcolorcontrols.h: -------------------------------------------------------------------------------- 1 | /* 2 | * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | * and Linux systems. 4 | * 5 | * Copyright (C) 2010 NVIDIA Corporation. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms and conditions of the GNU General Public License, 9 | * version 2, as published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | * more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef __CTK_COLOR_CONTROLS_H__ 21 | #define __CTK_COLOR_CONTROLS_H__ 22 | 23 | #include "ctkevent.h" 24 | #include "ctkconfig.h" 25 | 26 | G_BEGIN_DECLS 27 | 28 | #define CTK_TYPE_COLOR_CONTROLS (ctk_color_controls_get_type()) 29 | 30 | #define CTK_COLOR_CONTROLS(obj) \ 31 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), CTK_TYPE_COLOR_CONTROLS, \ 32 | CtkColorControls)) 33 | 34 | #define CTK_COLOR_CONTROLS_CLASS(klass) \ 35 | (G_TYPE_CHECK_CLASS_CAST ((klass), CTK_TYPE_COLOR_CONTROLS, \ 36 | CtkColorControlsClass)) 37 | 38 | #define CTK_IS_COLOR_CONTROLS(obj) \ 39 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CTK_TYPE_COLOR_CONTROLS)) 40 | 41 | #define CTK_IS_COLOR_CONTROLS_CLASS(class) \ 42 | (G_TYPE_CHECK_CLASS_TYPE ((klass), CTK_TYPE_COLOR_CONTROLS)) 43 | 44 | #define CTK_COLOR_CONTROLS_GET_CLASS(obj) \ 45 | (G_TYPE_INSTANCE_GET_CLASS ((obj), CTK_TYPE_COLOR_CONTROLS, \ 46 | CtkCOLORControlsClass)) 47 | 48 | typedef struct _CtkColorControls CtkColorControls; 49 | typedef struct _CtkColorControlsClass CtkColorControlsClass; 50 | 51 | struct _CtkColorControls 52 | { 53 | GtkVBox parent; 54 | 55 | CtrlTarget *ctrl_target; 56 | CtkConfig *ctk_config; 57 | CtkEvent *ctk_event; 58 | GtkWidget *reset_button; 59 | GtkWidget *color_controls_box; 60 | 61 | GtkWidget *color_range_menu; 62 | GtkWidget *current_color_range_txt; 63 | GtkWidget *color_space_menu; 64 | GtkWidget *current_color_space_txt; 65 | 66 | gint *color_space_table; 67 | gint color_space_table_size; 68 | gint default_color_config; 69 | gint default_color_space; 70 | gboolean current_color_attributes_supported; 71 | char *name; 72 | }; 73 | 74 | struct _CtkColorControlsClass 75 | { 76 | GtkVBoxClass parent_class; 77 | }; 78 | 79 | GType ctk_color_controls_get_type (void) G_GNUC_CONST; 80 | GtkWidget* ctk_color_controls_new (CtrlTarget *, 81 | CtkConfig *, CtkEvent *, 82 | GtkWidget *, 83 | char *); 84 | 85 | void ctk_color_controls_reset (CtkColorControls*); 86 | void ctk_color_controls_setup (CtkColorControls*); 87 | void add_color_controls_help (CtkColorControls*, GtkTextBuffer *b, 88 | GtkTextIter *i); 89 | 90 | G_END_DECLS 91 | 92 | #endif /* __CTK_COLOR_CONTROLS_H__ */ 93 | -------------------------------------------------------------------------------- /src/gtk+-2.x/ctkcolorcorrection.h: -------------------------------------------------------------------------------- 1 | /* 2 | * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | * and Linux systems. 4 | * 5 | * Copyright (C) 2004 NVIDIA Corporation. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms and conditions of the GNU General Public License, 9 | * version 2, as published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | * more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef __CTK_COLOR_CORRECTION_H__ 21 | #define __CTK_COLOR_CORRECTION_H__ 22 | 23 | #include "parse.h" 24 | #include "ctkevent.h" 25 | #include "ctkconfig.h" 26 | 27 | G_BEGIN_DECLS 28 | 29 | #define CTK_TYPE_COLOR_CORRECTION (ctk_color_correction_get_type()) 30 | 31 | #define CTK_COLOR_CORRECTION(obj) \ 32 | (G_TYPE_CHECK_INSTANCE_CAST((obj), CTK_TYPE_COLOR_CORRECTION, \ 33 | CtkColorCorrection)) 34 | 35 | #define CTK_COLOR_CORRECTION_CLASS(klass) \ 36 | (G_TYPE_CHECK_CLASS_CAST((klass), CTK_TYPE_COLOR_CORRECTION, \ 37 | CtkColorCorrectionClass)) 38 | 39 | #define CTK_IS_COLOR_CORRECTION(obj) \ 40 | (G_TYPE_CHECK_INSTANCE_TYPE((obj), CTK_TYPE_COLOR_CORRECTION)) 41 | 42 | #define CTK_IS_COLOR_CORRECTION_CLASS(class) \ 43 | (G_TYPE_CHECK_CLASS_TYPE((klass), CTK_TYPE_COLOR_CORRECTION)) 44 | 45 | #define CTK_COLOR_CORRECTION_GET_CLASS(obj) \ 46 | (G_TYPE_INSTANCE_GET_CLASS((obj), CTK_TYPE_COLOR_CORRECTION, \ 47 | CtkColorCorrectionClass)) 48 | 49 | 50 | typedef struct _CtkColorCorrection CtkColorCorrection; 51 | typedef struct _CtkColorCorrectionClass CtkColorCorrectionClass; 52 | 53 | struct _CtkColorCorrection 54 | { 55 | GtkVBox parent; 56 | CtrlTarget *ctrl_target; 57 | CtkConfig *ctk_config; 58 | CtkEvent *ctk_event; 59 | GtkWidget *color_channel; 60 | GtkAdjustment *brightness_adjustment; 61 | GtkAdjustment *contrast_adjustment; 62 | GtkAdjustment *gamma_adjustment; 63 | GtkWidget *curve; 64 | GtkWidget *warning_container; 65 | GtkWidget *reset_button; 66 | GtkWidget *confirm_button; 67 | GtkWidget *confirm_label; 68 | gint confirm_countdown; 69 | guint confirm_timer; 70 | gfloat cur_slider_val[3][4]; // as [attribute][channel] 71 | gfloat prev_slider_val[3][4]; // as [attribute][channel] 72 | guint enabled_display_devices; 73 | int num_expected_updates; 74 | }; 75 | 76 | struct _CtkColorCorrectionClass 77 | { 78 | GtkVBoxClass parent_class; 79 | 80 | void (*changed) (CtkColorCorrection *); 81 | }; 82 | 83 | GType ctk_color_correction_get_type (void) G_GNUC_CONST; 84 | GtkWidget* ctk_color_correction_new (CtrlTarget *, 85 | CtkConfig *, ParsedAttribute *, 86 | CtkEvent *); 87 | GtkTextBuffer *ctk_color_correction_create_help(GtkTextTagTable *); 88 | void ctk_color_correction_tab_help(GtkTextBuffer *b, GtkTextIter *i, 89 | const gchar *title, 90 | gboolean randr); 91 | G_END_DECLS 92 | 93 | #endif /* __CTK_COLOR_CORRECTION_H__ */ 94 | 95 | -------------------------------------------------------------------------------- /src/gtk+-2.x/ctkcolorcorrectionpage.c: -------------------------------------------------------------------------------- 1 | /* 2 | * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | * and Linux systems. 4 | * 5 | * Copyright (C) 2012 NVIDIA Corporation. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms and conditions of the GNU General Public License, 9 | * version 2, as published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | * more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #include 21 | 22 | #include "NvCtrlAttributes.h" 23 | 24 | #include "ctkbanner.h" 25 | 26 | #include "ctkcolorcorrectionpage.h" 27 | #include "ctkcolorcorrection.h" 28 | 29 | #include "ctkconfig.h" 30 | #include "ctkhelp.h" 31 | 32 | #include 33 | #include 34 | 35 | 36 | GType ctk_color_correction_page_get_type( 37 | void 38 | ) 39 | { 40 | static GType ctk_color_correction_page_type = 0; 41 | 42 | if (!ctk_color_correction_page_type) { 43 | static const GTypeInfo ctk_color_correction_page_info = { 44 | sizeof (CtkColorCorrectionPageClass), 45 | NULL, /* base_init */ 46 | NULL, /* base_finalize */ 47 | NULL, /* class_init */ 48 | NULL, /* class_finalize */ 49 | NULL, /* class_data */ 50 | sizeof (CtkColorCorrectionPage), 51 | 0, /* n_preallocs */ 52 | NULL, /* instance_init */ 53 | NULL /* value_table */ 54 | }; 55 | 56 | ctk_color_correction_page_type = 57 | g_type_register_static(GTK_TYPE_VBOX, "CtkColorCorrectionPage", 58 | &ctk_color_correction_page_info, 0); 59 | } 60 | 61 | return ctk_color_correction_page_type; 62 | } 63 | 64 | 65 | GtkWidget* ctk_color_correction_page_new(CtrlTarget *ctrl_target, 66 | CtkConfig *ctk_config, 67 | ParsedAttribute *p, 68 | CtkEvent *ctk_event) 69 | { 70 | CtkColorCorrectionPage *ctk_color_correction_page; 71 | ReturnStatus ret; 72 | GObject *object; 73 | GtkWidget *banner; 74 | GtkWidget *ctk_color_correction; 75 | gint val; 76 | 77 | /* check if the VidMode extension is present */ 78 | 79 | ret = NvCtrlGetAttribute(ctrl_target, NV_CTRL_ATTR_EXT_VM_PRESENT, &val); 80 | if ((ret != NvCtrlSuccess) || (val == FALSE)) { 81 | return NULL; 82 | } 83 | 84 | /* check if the noScanout mode enabled */ 85 | 86 | ret = NvCtrlGetAttribute(ctrl_target, NV_CTRL_NO_SCANOUT, &val); 87 | if ((ret == NvCtrlSuccess) && (val == NV_CTRL_NO_SCANOUT_ENABLED)) { 88 | return NULL; 89 | } 90 | 91 | /* allocate the color correction widget */ 92 | 93 | ctk_color_correction = ctk_color_correction_new(ctrl_target, ctk_config, 94 | p, ctk_event); 95 | 96 | if (ctk_color_correction == NULL) { 97 | return NULL; 98 | } 99 | 100 | /* create the new page */ 101 | 102 | object = g_object_new(CTK_TYPE_COLOR_CORRECTION_PAGE, NULL); 103 | 104 | ctk_color_correction_page = CTK_COLOR_CORRECTION_PAGE(object); 105 | 106 | gtk_box_set_spacing(GTK_BOX(ctk_color_correction_page), 10); 107 | 108 | /* 109 | * pack the banner at the top of the page, followed by the color 110 | * correction widget 111 | */ 112 | 113 | banner = ctk_banner_image_new(BANNER_ARTWORK_COLOR); 114 | gtk_box_pack_start(GTK_BOX(ctk_color_correction_page), 115 | banner, FALSE, FALSE, 0); 116 | 117 | gtk_widget_show_all(GTK_WIDGET(object)); 118 | 119 | gtk_box_pack_start(GTK_BOX(ctk_color_correction_page), 120 | ctk_color_correction, TRUE, TRUE, 0); 121 | 122 | return GTK_WIDGET(object); 123 | } 124 | 125 | 126 | GtkTextBuffer *ctk_color_correction_page_create_help(GtkTextTagTable *table) 127 | { 128 | return ctk_color_correction_create_help(table); 129 | } 130 | -------------------------------------------------------------------------------- /src/gtk+-2.x/ctkcolorcorrectionpage.h: -------------------------------------------------------------------------------- 1 | /* 2 | * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | * and Linux systems. 4 | * 5 | * Copyright (C) 2012 NVIDIA Corporation. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms and conditions of the GNU General Public License, 9 | * version 2, as published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | * more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef __CTK_COLOR_CORRECTION_PAGE_H__ 21 | #define __CTK_COLOR_CORRECTION_PAGE_H__ 22 | 23 | #include "parse.h" 24 | #include "ctkevent.h" 25 | #include "ctkconfig.h" 26 | 27 | G_BEGIN_DECLS 28 | 29 | #define CTK_TYPE_COLOR_CORRECTION_PAGE (ctk_color_correction_page_get_type()) 30 | 31 | #define CTK_COLOR_CORRECTION_PAGE(obj) \ 32 | (G_TYPE_CHECK_INSTANCE_CAST((obj), CTK_TYPE_COLOR_CORRECTION_PAGE, \ 33 | CtkColorCorrectionPage)) 34 | 35 | #define CTK_COLOR_CORRECTION_PAGE_CLASS(klass) \ 36 | (G_TYPE_CHECK_CLASS_CAST((klass), CTK_TYPE_COLOR_CORRECTION_PAGE, \ 37 | CtkColorCorrectionPageClass)) 38 | 39 | #define CTK_IS_COLOR_CORRECTION_PAGE(obj) \ 40 | (G_TYPE_CHECK_INSTANCE_TYPE((obj), CTK_TYPE_COLOR_CORRECTION_PAGE)) 41 | 42 | #define CTK_IS_COLOR_CORRECTION_PAGE_CLASS(class) \ 43 | (G_TYPE_CHECK_CLASS_TYPE((klass), CTK_TYPE_COLOR_CORRECTION_PAGE)) 44 | 45 | #define CTK_COLOR_CORRECTION_PAGE_GET_CLASS(obj) \ 46 | (G_TYPE_INSTANCE_GET_CLASS((obj), CTK_TYPE_COLOR_CORRECTION_PAGE, \ 47 | CtkColorCorrectionPageClass)) 48 | 49 | 50 | typedef struct _CtkColorCorrectionPage CtkColorCorrectionPage; 51 | typedef struct _CtkColorCorrectionPageClass CtkColorCorrectionPageClass; 52 | 53 | struct _CtkColorCorrectionPage 54 | { 55 | GtkVBox parent; 56 | CtkConfig *ctk_config; 57 | GtkWidget *option_menu; 58 | GtkAdjustment *brightness_adjustment; 59 | GtkAdjustment *contrast_adjustment; 60 | GtkAdjustment *gamma_adjustment; 61 | GtkWidget *confirm_button; 62 | GtkWidget *confirm_label; 63 | gint confirm_countdown; 64 | guint confirm_timer; 65 | gfloat cur_slider_val[3][4]; // as [attribute][channel] 66 | gfloat prev_slider_val[3][4]; // as [attribute][channel] 67 | guint enabled_display_devices; 68 | }; 69 | 70 | struct _CtkColorCorrectionPageClass 71 | { 72 | GtkVBoxClass parent_class; 73 | 74 | void (*changed) (CtkColorCorrectionPage *); 75 | }; 76 | 77 | GType ctk_color_correction_page_get_type (void) G_GNUC_CONST; 78 | GtkWidget* ctk_color_correction_page_new (CtrlTarget *, CtkConfig *, 79 | ParsedAttribute *, CtkEvent *); 80 | GtkTextBuffer *ctk_color_correction_page_create_help(GtkTextTagTable *); 81 | 82 | G_END_DECLS 83 | 84 | #endif /* __CTK_COLOR_CORRECTION_PAGE_H__ */ 85 | 86 | -------------------------------------------------------------------------------- /src/gtk+-2.x/ctkconstants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | * and Linux systems. 4 | * 5 | * Copyright (C) 2004 NVIDIA Corporation. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms and conditions of the GNU General Public License, 9 | * version 2, as published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | * more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | /* 21 | * constants used through out the nvidia-settings gtk+ gui 22 | */ 23 | 24 | #ifndef __CTK_CONSTANTS_H__ 25 | #define __CTK_CONSTANTS_H__ 26 | 27 | #define CTK_WINDOW_PAD 7 28 | 29 | #endif /* __CTK_CONSTANTS_H__ */ 30 | -------------------------------------------------------------------------------- /src/gtk+-2.x/ctkcurve.h: -------------------------------------------------------------------------------- 1 | /* 2 | * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | * and Linux systems. 4 | * 5 | * Copyright (C) 2004 NVIDIA Corporation. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms and conditions of the GNU General Public License, 9 | * version 2, as published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | * more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef __CTK_CURVE_H__ 21 | #define __CTK_CURVE_H__ 22 | 23 | #include "ctkutils.h" 24 | 25 | G_BEGIN_DECLS 26 | 27 | #define CTK_TYPE_CURVE (ctk_curve_get_type()) 28 | 29 | #define CTK_CURVE(obj) \ 30 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), CTK_TYPE_CURVE, CtkCurve)) 31 | 32 | #define CTK_CURVE_CLASS(klass) \ 33 | (G_TYPE_CHECK_CLASS_CAST ((klass), CTK_TYPE_CURVE, CtkCurveClass)) 34 | 35 | #define CTK_IS_CURVE(obj) \ 36 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CTK_TYPE_CURVE)) 37 | 38 | #define CTK_IS_CURVE_CLASS(class) \ 39 | (G_TYPE_CHECK_CLASS_TYPE ((klass), CTK_TYPE_CURVE)) 40 | 41 | #define CTK_CURVE_GET_CLASS(obj) \ 42 | (G_TYPE_INSTANCE_GET_CLASS ((obj), CTK_TYPE_CURVE, CtkCurveClass)) 43 | 44 | 45 | typedef struct _CtkCurve CtkCurve; 46 | typedef struct _CtkCurveClass CtkCurveClass; 47 | 48 | struct _CtkCurve 49 | { 50 | GtkDrawingArea parent; 51 | 52 | CtrlTarget *ctrl_target; 53 | GtkWidget *color; 54 | 55 | #ifdef CTK_GTK3 56 | cairo_surface_t *c_surface; 57 | cairo_t *c_context; 58 | #else 59 | GdkColor gdk_color_red; 60 | GdkColor gdk_color_green; 61 | GdkColor gdk_color_blue; 62 | 63 | GdkColormap *gdk_colormap; 64 | 65 | GdkPixmap *gdk_pixmap; 66 | GdkGC *gdk_gc; 67 | #endif 68 | gint width; 69 | gint height; 70 | }; 71 | 72 | struct _CtkCurveClass 73 | { 74 | GtkDrawingAreaClass parent_class; 75 | }; 76 | 77 | GType ctk_curve_get_type (void) G_GNUC_CONST; 78 | GtkWidget* ctk_curve_new (CtrlTarget *, GtkWidget *); 79 | void ctk_curve_color_changed(GtkWidget *); 80 | 81 | G_END_DECLS 82 | 83 | #endif /* __CTK_CURVE_H__ */ 84 | 85 | -------------------------------------------------------------------------------- /src/gtk+-2.x/ctkdisplaydevice.h: -------------------------------------------------------------------------------- 1 | /* 2 | * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | * and Linux systems. 4 | * 5 | * Copyright (C) 2004 NVIDIA Corporation. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms and conditions of the GNU General Public License, 9 | * version 2, as published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | * more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef __CTK_DISPLAYDEVICE_H__ 21 | #define __CTK_DISPLAYDEVICE_H__ 22 | 23 | #include "ctkevent.h" 24 | #include "ctkconfig.h" 25 | 26 | G_BEGIN_DECLS 27 | 28 | #define CTK_TYPE_DISPLAY_DEVICE (ctk_display_device_get_type()) 29 | 30 | #define CTK_DISPLAY_DEVICE(obj) \ 31 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), CTK_TYPE_DISPLAY_DEVICE, \ 32 | CtkDisplayDevice)) 33 | 34 | #define CTK_DISPLAY_DEVICE_CLASS(klass) \ 35 | (G_TYPE_CHECK_CLASS_CAST ((klass), CTK_TYPE_DISPLAY_DEVICE, \ 36 | CtkDisplayDeviceClass)) 37 | 38 | #define CTK_IS_DISPLAY_DEVICE(obj) \ 39 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CTK_TYPE_DISPLAY_DEVICE)) 40 | 41 | #define CTK_IS_DISPLAY_DEVICE_CLASS(class) \ 42 | (G_TYPE_CHECK_CLASS_TYPE ((klass), CTK_TYPE_DISPLAY_DEVICE)) 43 | 44 | #define CTK_DISPLAY_DEVICE_GET_CLASS(obj) \ 45 | (G_TYPE_INSTANCE_GET_CLASS ((obj), CTK_TYPE_DISPLAY_DEVICE, \ 46 | CtkDisplayDeviceClass)) 47 | 48 | 49 | typedef struct _CtkDisplayDevice CtkDisplayDevice; 50 | typedef struct _CtkDisplayDeviceClass CtkDisplayDeviceClass; 51 | 52 | typedef struct InfoEntryRec { 53 | gboolean present; 54 | GtkWidget *hbox; 55 | GtkWidget *label; 56 | GtkWidget *txt; 57 | 58 | struct _CtkDisplayDevice *ctk_object; 59 | 60 | } InfoEntry; 61 | 62 | struct _CtkDisplayDevice 63 | { 64 | GtkVBox parent; 65 | 66 | CtrlTarget *ctrl_target; 67 | CtkConfig *ctk_config; 68 | CtkEvent *ctk_event; 69 | CtkEvent *ctk_event_gpu; 70 | GtkWidget *image_sliders; 71 | GtkWidget *reset_button; 72 | GtkWidget *edid; 73 | GtkWidget *dithering_controls; 74 | GtkWidget *color_controls; 75 | 76 | gboolean color_correction_available; 77 | 78 | InfoEntry *info_entries; 79 | int num_info_entries; 80 | 81 | gboolean display_enabled; 82 | unsigned int active_attributes; 83 | 84 | char *name; 85 | gint signal_type; 86 | }; 87 | 88 | struct _CtkDisplayDeviceClass 89 | { 90 | GtkVBoxClass parent_class; 91 | }; 92 | 93 | GType ctk_display_device_get_type (void) G_GNUC_CONST; 94 | GtkWidget* ctk_display_device_new (CtrlTarget *, CtkConfig *, CtkEvent *, 95 | CtkEvent *, char *, char *, 96 | ParsedAttribute *); 97 | 98 | GtkTextBuffer *ctk_display_device_create_help(GtkTextTagTable *, 99 | CtkDisplayDevice *); 100 | 101 | G_END_DECLS 102 | 103 | #endif /* __CTK_DISPLAYDEVICE_H__ */ 104 | -------------------------------------------------------------------------------- /src/gtk+-2.x/ctkditheringcontrols.h: -------------------------------------------------------------------------------- 1 | /* 2 | * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | * and Linux systems. 4 | * 5 | * Copyright (C) 2010 NVIDIA Corporation. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms and conditions of the GNU General Public License, 9 | * version 2, as published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | * more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef __CTK_DITHERING_CONTROLS_H__ 21 | #define __CTK_DITHERING_CONTROLS_H__ 22 | 23 | #include "ctkevent.h" 24 | #include "ctkconfig.h" 25 | 26 | G_BEGIN_DECLS 27 | 28 | #define CTK_TYPE_DITHERING_CONTROLS (ctk_dithering_controls_get_type()) 29 | 30 | #define CTK_DITHERING_CONTROLS(obj) \ 31 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), CTK_TYPE_DITHERING_CONTROLS, \ 32 | CtkDitheringControls)) 33 | 34 | #define CTK_DITHERING_CONTROLS_CLASS(klass) \ 35 | (G_TYPE_CHECK_CLASS_CAST ((klass), CTK_TYPE_DITHERING_CONTROLS, \ 36 | CtkDitheringControlsClass)) 37 | 38 | #define CTK_IS_DITHERING_CONTROLS(obj) \ 39 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CTK_TYPE_DITHERING_CONTROLS)) 40 | 41 | #define CTK_IS_DITHERING_CONTROLS_CLASS(class) \ 42 | (G_TYPE_CHECK_CLASS_TYPE ((klass), CTK_TYPE_DITHERING_CONTROLS)) 43 | 44 | #define CTK_DITHERING_CONTROLS_GET_CLASS(obj) \ 45 | (G_TYPE_INSTANCE_GET_CLASS ((obj), CTK_TYPE_DITHERING_CONTROLS, \ 46 | CtkDitheringControlsClass)) 47 | 48 | typedef struct _CtkDitheringControls CtkDitheringControls; 49 | typedef struct _CtkDitheringControlsClass CtkDitheringControlsClass; 50 | 51 | struct _CtkDitheringControls 52 | { 53 | GtkVBox parent; 54 | 55 | CtrlTarget *ctrl_target; 56 | CtkConfig *ctk_config; 57 | char *name; 58 | GtkWidget *reset_button; 59 | 60 | CtkEvent *ctk_event; 61 | 62 | GtkWidget *dithering_controls_box; 63 | GtkWidget *dithering_mode_box; 64 | GtkWidget *dithering_depth_box; 65 | 66 | GtkWidget *dithering_config_menu; 67 | GtkWidget *dithering_mode_menu; 68 | GtkWidget *dithering_depth_menu; 69 | 70 | GtkWidget *dithering_config_txt; 71 | GtkWidget *dithering_mode_txt; 72 | GtkWidget *dithering_depth_txt; 73 | 74 | gint *dithering_mode_table; 75 | gint dithering_mode_table_size; 76 | }; 77 | 78 | struct _CtkDitheringControlsClass 79 | { 80 | GtkVBoxClass parent_class; 81 | }; 82 | 83 | GType ctk_dithering_controls_get_type (void) G_GNUC_CONST; 84 | GtkWidget* ctk_dithering_controls_new (CtrlTarget *, 85 | CtkConfig *, CtkEvent *, 86 | GtkWidget *, 87 | char *); 88 | 89 | void ctk_dithering_controls_reset (CtkDitheringControls*); 90 | void ctk_dithering_controls_setup (CtkDitheringControls*); 91 | void add_dithering_controls_help (CtkDitheringControls*, GtkTextBuffer *b, 92 | GtkTextIter *i); 93 | 94 | G_END_DECLS 95 | 96 | #endif /* __CTK_DITHERING_CONTROLS_H__ */ 97 | -------------------------------------------------------------------------------- /src/gtk+-2.x/ctkdropdownmenu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | * and Linux systems. 4 | * 5 | * Copyright (C) 2004 NVIDIA Corporation. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms and conditions of the GNU General Public License, 9 | * version 2, as published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | * more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef __CTK_DROP_DOWN_MENU_H__ 21 | #define __CTK_DROP_DOWN_MENU_H__ 22 | 23 | #include "NvCtrlAttributes.h" 24 | #include "ctkconfig.h" 25 | 26 | G_BEGIN_DECLS 27 | 28 | #define CTK_TYPE_DROP_DOWN_MENU (ctk_drop_down_menu_get_type()) 29 | 30 | #define CTK_DROP_DOWN_MENU(obj) \ 31 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), CTK_TYPE_DROP_DOWN_MENU, \ 32 | CtkDropDownMenu)) 33 | 34 | #define CTK_DROP_DOWN_MENU_CLASS(klass) \ 35 | (G_TYPE_CHECK_CLASS_CAST ((klass), CTK_TYPE_DROP_DOWN_MENU, \ 36 | CtkDropDownMenuClass)) 37 | 38 | #define CTK_IS_DROP_DOWN_MENU(obj) \ 39 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CTK_TYPE_DROP_DOWN_MENU)) 40 | 41 | #define CTK_IS_DROP_DOWN_MENU_CLASS(class) \ 42 | (G_TYPE_CHECK_CLASS_TYPE ((klass), CTK_TYPE_DROP_DOWN_MENU)) 43 | 44 | #define CTK_DROP_DOWN_MENU_GET_CLASS(obj) \ 45 | (G_TYPE_INSTANCE_GET_CLASS ((obj), CTK_TYPE_DROP_DOWN_MENU, \ 46 | CtkDropDownMenuClass)) 47 | 48 | 49 | #define CTK_DROP_DOWN_MENU_FLAG_READONLY 0x0 50 | #define CTK_DROP_DOWN_MENU_FLAG_READWRITE 0x1 51 | 52 | 53 | typedef struct _CtkDropDownMenu CtkDropDownMenu; 54 | typedef struct _CtkDropDownMenuClass CtkDropDownMenuClass; 55 | 56 | typedef struct _CtkDropDownMenuValue CtkDropDownMenuValue; 57 | 58 | struct _CtkDropDownMenuValue { 59 | GtkWidget *menu_item; 60 | gint value; 61 | gchar *glist_item; 62 | }; 63 | 64 | 65 | struct _CtkDropDownMenu 66 | { 67 | GtkVBox parent; 68 | 69 | GtkWidget *combo_box; 70 | 71 | guint flags; 72 | 73 | gint num_entries; 74 | gint current_selected_item; 75 | 76 | CtkDropDownMenuValue *values; 77 | }; 78 | 79 | struct _CtkDropDownMenuClass 80 | { 81 | GtkVBoxClass parent_class; 82 | }; 83 | 84 | GType ctk_drop_down_menu_get_type (void) G_GNUC_CONST; 85 | GtkWidget* ctk_drop_down_menu_new (guint flags); 86 | GtkWidget* ctk_drop_down_menu_append_item (CtkDropDownMenu *d, 87 | const gchar *name, 88 | const gint value); 89 | gint ctk_drop_down_menu_get_current_value (CtkDropDownMenu *d); 90 | const char *ctk_drop_down_menu_get_current_name (CtkDropDownMenu *d); 91 | void ctk_drop_down_menu_set_current_value (CtkDropDownMenu *d, 92 | gint value); 93 | void ctk_drop_down_menu_set_value_sensitive (CtkDropDownMenu *d, 94 | gint value, 95 | gboolean sensitive); 96 | void ctk_drop_down_menu_reset (CtkDropDownMenu *d); 97 | void ctk_drop_down_menu_set_tooltip (CtkConfig *ctk_config, 98 | CtkDropDownMenu *d, 99 | const gchar *text); 100 | 101 | GObject *ctk_drop_down_menu_change_object(GtkWidget* widget); 102 | 103 | G_END_DECLS 104 | 105 | #endif /* __CTK_DROP_DOWN_MENU_H__*/ 106 | -------------------------------------------------------------------------------- /src/gtk+-2.x/ctkecc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | * and Linux systems. 4 | * 5 | * Copyright (C) 2009 NVIDIA Corporation. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms and conditions of the GNU General Public License, 9 | * version 2, as published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | * more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef __CTK_ECC_H__ 21 | #define __CTK_ECC_H__ 22 | 23 | #include "ctkevent.h" 24 | #include "ctkconfig.h" 25 | #include "nvml.h" 26 | 27 | G_BEGIN_DECLS 28 | 29 | #define CTK_TYPE_ECC (ctk_ecc_get_type()) 30 | 31 | #define CTK_ECC(obj) \ 32 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), CTK_TYPE_ECC, CtkEcc)) 33 | 34 | #define CTK_ECC_CLASS(klass) \ 35 | (G_TYPE_CHECK_CLASS_CAST ((klass), CTK_TYPE_ECC, CtkEccClass)) 36 | 37 | #define CTK_IS_ECC(obj) \ 38 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CTK_TYPE_ECC)) 39 | 40 | #define CTK_IS_ECC_CLASS(class) \ 41 | (G_TYPE_CHECK_CLASS_TYPE ((klass), CTK_TYPE_ECC)) 42 | 43 | #define CTK_ECC_GET_CLASS(obj) \ 44 | (G_TYPE_INSTANCE_GET_CLASS ((obj), CTK_TYPE_ECC, CtkEccClass)) 45 | 46 | 47 | typedef struct _CtkEcc CtkEcc; 48 | typedef struct _CtkEccClass CtkEccClass; 49 | 50 | typedef struct _CtkEccDetailedTableRow 51 | { 52 | GtkWidget *err_type; 53 | GtkWidget *mem_type; 54 | GtkWidget *vol_count; 55 | GtkWidget *agg_count; 56 | int vol_count_value; 57 | int agg_count_value; 58 | } CtkEccDetailedTableRow; 59 | 60 | struct _CtkEcc 61 | { 62 | GtkVBox parent; 63 | 64 | CtrlTarget *ctrl_target; 65 | CtkConfig *ctk_config; 66 | 67 | GtkWidget* status; 68 | GtkWidget* sbit_error; 69 | GtkWidget* dbit_error; 70 | GtkWidget* aggregate_sbit_error; 71 | GtkWidget* aggregate_dbit_error; 72 | GtkWidget* clear_button; 73 | GtkWidget* clear_aggregate_button; 74 | GtkWidget* reset_default_config_button; 75 | GtkWidget* configuration_status; 76 | GtkWidget* summary_table; 77 | 78 | gboolean ecc_enabled; 79 | gboolean ecc_configured; 80 | gboolean ecc_toggle_warning_dlg_shown; 81 | gboolean sbit_error_available; 82 | gboolean dbit_error_available; 83 | gboolean aggregate_sbit_error_available; 84 | gboolean aggregate_dbit_error_available; 85 | gboolean ecc_config_supported; 86 | gboolean ecc_default_status; 87 | 88 | GtkWidget* detailed_table; 89 | CtkEccDetailedTableRow single_errors[NVML_MEMORY_LOCATION_COUNT]; 90 | CtkEccDetailedTableRow double_errors[NVML_MEMORY_LOCATION_COUNT]; 91 | }; 92 | 93 | struct _CtkEccClass 94 | { 95 | GtkVBoxClass parent_class; 96 | }; 97 | 98 | GType ctk_ecc_get_type (void) G_GNUC_CONST; 99 | GtkWidget* ctk_ecc_new (CtrlTarget *, CtkConfig *, CtkEvent *); 100 | GtkTextBuffer* ctk_ecc_create_help (GtkTextTagTable *, CtkEcc *); 101 | 102 | void ctk_ecc_start_timer (GtkWidget *); 103 | void ctk_ecc_stop_timer (GtkWidget *); 104 | 105 | G_END_DECLS 106 | 107 | #endif /* __CTK_ECC_H__ */ 108 | -------------------------------------------------------------------------------- /src/gtk+-2.x/ctkedid.h: -------------------------------------------------------------------------------- 1 | /* 2 | * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | * and Linux systems. 4 | * 5 | * Copyright (C) 2004 NVIDIA Corporation. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms and conditions of the GNU General Public License, 9 | * version 2, as published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | * more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef __CTK_EDID_H__ 21 | #define __CTK_EDID_H__ 22 | 23 | #include "ctkevent.h" 24 | #include "ctkconfig.h" 25 | 26 | G_BEGIN_DECLS 27 | 28 | #define CTK_TYPE_EDID (ctk_edid_get_type()) 29 | 30 | #define CTK_EDID(obj) \ 31 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), CTK_TYPE_EDID, \ 32 | CtkEdid)) 33 | 34 | #define CTK_EDID_CLASS(klass) \ 35 | (G_TYPE_CHECK_CLASS_CAST ((klass), CTK_TYPE_EDID, \ 36 | CtkEdidClass)) 37 | 38 | #define CTK_IS_EDID(obj) \ 39 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CTK_TYPE_EDID)) 40 | 41 | #define CTK_IS_EDID_CLASS(class) \ 42 | (G_TYPE_CHECK_CLASS_TYPE ((klass), CTK_TYPE_EDID)) 43 | 44 | #define CTK_EDID_GET_CLASS(obj) \ 45 | (G_TYPE_INSTANCE_GET_CLASS ((obj), CTK_TYPE_EDID, \ 46 | CtkEdidClass)) 47 | 48 | typedef struct _CtkEdid CtkEdid; 49 | typedef struct _CtkEdidClass CtkEdidClass; 50 | 51 | struct _CtkEdid 52 | { 53 | GtkVBox parent; 54 | 55 | CtrlTarget *ctrl_target; 56 | CtkConfig *ctk_config; 57 | GtkWidget *button; 58 | GtkWidget *file_selector; 59 | GtkWidget *file_format_binary_radio_button; 60 | GtkWidget *file_format_ascii_radio_button; 61 | 62 | const gchar *filename; 63 | char *name; 64 | 65 | gint file_format; 66 | }; 67 | 68 | struct _CtkEdidClass 69 | { 70 | GtkVBoxClass parent_class; 71 | }; 72 | 73 | GType ctk_edid_get_type (void) G_GNUC_CONST; 74 | GtkWidget* ctk_edid_new (CtrlTarget *, 75 | CtkConfig *, CtkEvent *, 76 | char *name); 77 | 78 | void ctk_edid_setup(CtkEdid *ctk_object); 79 | 80 | void add_acquire_edid_help(GtkTextBuffer *b, GtkTextIter *i); 81 | 82 | 83 | G_END_DECLS 84 | 85 | #endif /* __CTK_EDID_H__ */ 86 | -------------------------------------------------------------------------------- /src/gtk+-2.x/ctkevent.h: -------------------------------------------------------------------------------- 1 | /* 2 | * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | * and Linux systems. 4 | * 5 | * Copyright (C) 2004 NVIDIA Corporation. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms and conditions of the GNU General Public License, 9 | * version 2, as published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | * more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef __CTK_EVENT_H__ 21 | #define __CTK_EVENT_H__ 22 | 23 | #include 24 | 25 | #include "query-assign.h" 26 | 27 | G_BEGIN_DECLS 28 | 29 | #define CTK_TYPE_EVENT (ctk_event_get_type()) 30 | 31 | #define CTK_EVENT(obj) \ 32 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), CTK_TYPE_EVENT, CtkEvent)) 33 | 34 | #define CTK_EVENT_CLASS(klass) \ 35 | (G_TYPE_CHECK_CLASS_CAST ((klass), CTK_TYPE_EVENT, CtkEventClass)) 36 | 37 | #define CTK_IS_EVENT(obj) \ 38 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CTK_TYPE_EVENT)) 39 | 40 | #define CTK_IS_EVENT_CLASS(class) \ 41 | (G_TYPE_CHECK_CLASS_TYPE ((klass), CTK_TYPE_EVENT)) 42 | 43 | #define CTK_EVENT_GET_CLASS(obj) \ 44 | (G_TYPE_INSTANCE_GET_CLASS ((obj), CTK_TYPE_EVENT, CtkEventClass)) 45 | 46 | 47 | typedef struct _CtkEvent CtkEvent; 48 | typedef struct _CtkEventClass CtkEventClass; 49 | 50 | struct _CtkEvent 51 | { 52 | GObject parent; 53 | CtrlTarget *ctrl_target; 54 | }; 55 | 56 | struct _CtkEventClass 57 | { 58 | GtkWidgetClass parent_class; 59 | }; 60 | 61 | GType ctk_event_get_type (void) G_GNUC_CONST; 62 | GObject* ctk_event_new (CtrlTarget*); 63 | void ctk_event_destroy (GObject*); 64 | 65 | void ctk_event_emit(CtkEvent *ctk_event, 66 | unsigned int mask, int attrib, int value); 67 | void ctk_event_emit_string(CtkEvent *ctk_event, 68 | unsigned int mask, int attrib); 69 | 70 | #define CTK_EVENT_NAME(x) ("CTK_EVENT_" #x) 71 | 72 | 73 | 74 | 75 | 76 | G_END_DECLS 77 | 78 | #endif /* __CTK_EVENT_H__ */ 79 | -------------------------------------------------------------------------------- /src/gtk+-2.x/ctkgauge.h: -------------------------------------------------------------------------------- 1 | /* 2 | * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | * and Linux systems. 4 | * 5 | * Copyright (C) 2004 NVIDIA Corporation. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms and conditions of the GNU General Public License, 9 | * version 2, as published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | * more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef __CTK_GAUGE_H__ 21 | #define __CTK_GAUGE_H__ 22 | 23 | #include "ctkconfig.h" 24 | 25 | G_BEGIN_DECLS 26 | 27 | #define CTK_TYPE_GAUGE (ctk_gauge_get_type()) 28 | 29 | #define CTK_GAUGE(obj) \ 30 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), CTK_TYPE_GAUGE, CtkGauge)) 31 | 32 | #define CTK_GAUGE_CLASS(klass) \ 33 | (G_TYPE_CHECK_CLASS_CAST ((klass), CTK_TYPE_GAUGE, CtkGaugeClass)) 34 | 35 | #define CTK_IS_GAUGE(obj) \ 36 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CTK_TYPE_GAUGE)) 37 | 38 | #define CTK_IS_GAUGE_CLASS(class) \ 39 | (G_TYPE_CHECK_CLASS_TYPE ((klass), CTK_TYPE_GAUGE)) 40 | 41 | #define CTK_GAUGE_GET_CLASS(obj) \ 42 | (G_TYPE_INSTANCE_GET_CLASS ((obj), CTK_TYPE_GAUGE, CtkGaugeClass)) 43 | 44 | 45 | typedef struct _CtkGauge CtkGauge; 46 | typedef struct _CtkGaugeClass CtkGaugeClass; 47 | 48 | struct _CtkGauge 49 | { 50 | GtkDrawingArea parent; 51 | 52 | gint lower, upper; 53 | gint current; 54 | 55 | 56 | GdkColor gdk_color_gray; 57 | GdkColor gdk_color_red; 58 | GdkColor gdk_color_yellow; 59 | GdkColor gdk_color_green; 60 | 61 | #ifdef CTK_GTK3 62 | cairo_surface_t *c_surface; 63 | cairo_t *c_context; 64 | #else 65 | GdkColormap *gdk_colormap; 66 | 67 | GdkPixmap *gdk_pixmap; 68 | GdkGC *gdk_gc; 69 | #endif 70 | 71 | PangoLayout *pango_layout; 72 | 73 | gint width, height; 74 | }; 75 | 76 | struct _CtkGaugeClass 77 | { 78 | GtkDrawingAreaClass parent_class; 79 | }; 80 | 81 | GType ctk_gauge_get_type (void) G_GNUC_CONST; 82 | GtkWidget* ctk_gauge_new (gint, gint); 83 | void ctk_gauge_set_current (CtkGauge *, gint); 84 | void ctk_gauge_draw (CtkGauge *); 85 | 86 | G_END_DECLS 87 | 88 | #endif /* __CTK_GAUGE_H__ */ 89 | 90 | -------------------------------------------------------------------------------- /src/gtk+-2.x/ctkglstereo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | * and Linux systems. 4 | * 5 | * Copyright (C) 2017 NVIDIA Corporation. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms and conditions of the GNU General Public License, 9 | * version 2, as published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | * more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef __CTK_GLSTEREO_H__ 21 | #define __CTK_GLSTEREO_H__ 22 | 23 | #include "ctkutils.h" 24 | 25 | #ifdef CTK_GTK3 26 | #include "opengl_wrappers.h" 27 | #endif 28 | 29 | GtkWidget *ctk_glstereo_new(void); 30 | 31 | 32 | #ifdef CTK_GTK3 33 | typedef struct _StereoAppData StereoAppData; 34 | struct _StereoAppData 35 | { 36 | OpenGLModelData *cube; 37 | OpenGLModelData *labelLeft; 38 | OpenGLModelData *labelRight; 39 | unsigned int animationCounter; 40 | }; 41 | 42 | #endif 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /src/gtk+-2.x/ctkglwidget.h: -------------------------------------------------------------------------------- 1 | /* 2 | * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | * and Linux systems. 4 | * 5 | * Copyright (C) 2017 NVIDIA Corporation. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms and conditions of the GNU General Public License, 9 | * version 2, as published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | * more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef __CTK_GLWIDGET_H__ 21 | #define __CTK_GLWIDGET_H__ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | #include "ctkconfig.h" 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define CTK_TYPE_GLWIDGET (ctk_glwidget_get_type()) 33 | 34 | #define CTK_GLWIDGET(obj) \ 35 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), CTK_TYPE_GLWIDGET, CtkGLWidget)) 36 | 37 | #define CTK_GLWIDGET_CLASS(klass) \ 38 | (G_TYPE_CHECK_CLASS_CAST ((klass), CTK_TYPE_GLWIDGET, CtkGLWidgetClass)) 39 | 40 | #define CTK_IS_GLWIDGET(obj) \ 41 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CTK_TYPE_GLWIDGET)) 42 | 43 | #define CTK_IS_GLWIDGET_CLASS(klass) \ 44 | (G_TYPE_CHECK_CLASS_TYPE ((klass), CTK_TYPE_GLWIDGET)) 45 | 46 | #define CTK_GLWIDGET_GET_CLASS(obj) \ 47 | (G_TYPE_INSTANCE_GET_CLASS ((obj), CTK_TYPE_GLWIDGET, CtkGLWidgetClass)) 48 | 49 | 50 | typedef struct _CtkGLWidget CtkGLWidget; 51 | typedef struct _CtkGLWidgetClass CtkGLWidgetClass; 52 | 53 | struct _CtkGLWidget 54 | { 55 | GtkWidget parent; 56 | 57 | GdkDisplay *gdk_display; 58 | GdkWindow *gdk_window; 59 | Display *display; 60 | Window window; 61 | GLXContext glx_context; 62 | GdkVisual *gdk_visual; 63 | 64 | gboolean is_error; 65 | int timer_interval; 66 | void *app_data; 67 | 68 | int (*app_setup_callback) (void *app_data); 69 | void (*draw_frame_callback) (void *app_data); 70 | }; 71 | 72 | struct _CtkGLWidgetClass 73 | { 74 | GtkWidgetClass parent_class; 75 | }; 76 | 77 | GType ctk_glwidget_get_type (void); 78 | 79 | GtkWidget *ctk_glwidget_new(int glx_attributes[], 80 | void *app_data, 81 | int (*app_setup_callback) (void *app_data), 82 | void (*draw_frame_callback) (void *app_data)); 83 | 84 | #ifdef CTK_GTK3 85 | void ctk_glwidget_make_current(CtkGLWidget *ctk_glwidget); 86 | void ctk_glwidget_swap(CtkGLWidget *ctk_glwidget); 87 | #endif 88 | 89 | G_END_DECLS 90 | 91 | #endif 92 | -------------------------------------------------------------------------------- /src/gtk+-2.x/ctkglx.h: -------------------------------------------------------------------------------- 1 | /* 2 | * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | * and Linux systems. 4 | * 5 | * Copyright (C) 2004 NVIDIA Corporation. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms and conditions of the GNU General Public License, 9 | * version 2, as published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | * more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef __CTK_GLX_H__ 21 | #define __CTK_GLX_H__ 22 | 23 | #include "ctkevent.h" 24 | #include "ctkconfig.h" 25 | 26 | G_BEGIN_DECLS 27 | 28 | #define CTK_TYPE_GLX (ctk_glx_get_type()) 29 | 30 | #define CTK_GLX(obj) \ 31 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), CTK_TYPE_GLX, CtkGLX)) 32 | 33 | #define CTK_GLX_CLASS(klass) \ 34 | (G_TYPE_CHECK_CLASS_CAST ((klass), CTK_TYPE_GLX, CtkGLXClass)) 35 | 36 | #define CTK_IS_GLX(obj) \ 37 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CTK_TYPE_GLX)) 38 | 39 | #define CTK_IS_GLX_CLASS(class) \ 40 | (G_TYPE_CHECK_CLASS_TYPE ((klass), CTK_TYPE_GLX)) 41 | 42 | #define CTK_GLX_GET_CLASS(obj) \ 43 | (G_TYPE_INSTANCE_GET_CLASS ((obj), CTK_TYPE_GLX, CtkGLXClass)) 44 | 45 | 46 | typedef struct _CtkGLX CtkGLX; 47 | typedef struct _CtkGLXClass CtkGLXClass; 48 | 49 | struct _CtkGLX 50 | { 51 | GtkVBox parent; 52 | 53 | CtrlTarget *ctrl_target; 54 | CtkConfig *ctk_config; 55 | 56 | GtkWidget *glxinfo_vpane; 57 | Bool glxinfo_initialized; 58 | GtkWidget *show_fbc_button; 59 | GtkWidget *show_egl_fbc_button; 60 | GtkWidget *fbc_window; 61 | GtkWidget *egl_fbc_window; 62 | 63 | gboolean glx_fbconfigs_available; 64 | gboolean egl_fbconfigs_available; 65 | gboolean glx_available; 66 | gboolean egl_available; 67 | gboolean vulkan_available; 68 | }; 69 | 70 | struct _CtkGLXClass 71 | { 72 | GtkVBoxClass parent_class; 73 | }; 74 | 75 | GType ctk_glx_get_type (void) G_GNUC_CONST; 76 | GtkWidget* ctk_glx_new (CtrlTarget *, CtkConfig *, CtkEvent *); 77 | 78 | GtkTextBuffer *ctk_glx_create_help(GtkTextTagTable *, CtkGLX *); 79 | 80 | void ctk_glx_probe_info(GtkWidget *widget); 81 | 82 | 83 | G_END_DECLS 84 | 85 | #endif /* __CTK_GLX_H__ */ 86 | -------------------------------------------------------------------------------- /src/gtk+-2.x/ctkgpu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | * and Linux systems. 4 | * 5 | * Copyright (C) 2004 NVIDIA Corporation. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms and conditions of the GNU General Public License, 9 | * version 2, as published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | * more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef __CTK_GPU_H__ 21 | #define __CTK_GPU_H__ 22 | 23 | #include 24 | #include 25 | 26 | #include "ctkevent.h" 27 | #include "ctkconfig.h" 28 | 29 | G_BEGIN_DECLS 30 | 31 | #define CTK_TYPE_GPU (ctk_gpu_get_type()) 32 | 33 | #define CTK_GPU(obj) \ 34 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), CTK_TYPE_GPU, CtkGpu)) 35 | 36 | #define CTK_GPU_CLASS(klass) \ 37 | (G_TYPE_CHECK_CLASS_CAST ((klass), CTK_TYPE_GPU, CtkGpuClass)) 38 | 39 | #define CTK_IS_GPU(obj) \ 40 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CTK_TYPE_GPU)) 41 | 42 | #define CTK_IS_GPU_CLASS(class) \ 43 | (G_TYPE_CHECK_CLASS_TYPE ((klass), CTK_TYPE_GPU)) 44 | 45 | #define CTK_GPU_GET_CLASS(obj) \ 46 | (G_TYPE_INSTANCE_GET_CLASS ((obj), CTK_TYPE_GPU, CtkGpuClass)) 47 | 48 | 49 | typedef struct _CtkGpu CtkGpu; 50 | typedef struct _CtkGpuClass CtkGpuClass; 51 | 52 | struct _CtkGpu 53 | { 54 | GtkVBox parent; 55 | 56 | CtrlTarget *ctrl_target; 57 | CtkConfig *ctk_config; 58 | CtkEvent *ctk_event; 59 | 60 | GtkWidget *displays; 61 | GtkWidget *gpu_memory_used_label; 62 | GtkWidget *gpu_utilization_label; 63 | GtkWidget *video_utilization_label; 64 | GtkWidget *pcie_utilization_label; 65 | gint gpu_memory; 66 | gint gpu_utilization; 67 | gint gpu_cores; 68 | gint gpu_uuid; 69 | gint memory_interface; 70 | gboolean resizable_bar; 71 | gboolean pcie_gen_queriable; 72 | 73 | gboolean video_ram_available; 74 | gboolean link_speed_available; 75 | gboolean graphics_util_available; 76 | gboolean video_util_available; 77 | gboolean pcie_util_available; 78 | 79 | gboolean bus_type_available; 80 | gboolean bus_id_available; 81 | gboolean pci_device_id_available; 82 | gboolean pci_vendor_id_available; 83 | gboolean irq_available; 84 | }; 85 | 86 | struct _CtkGpuClass 87 | { 88 | GtkVBoxClass parent_class; 89 | }; 90 | 91 | GType ctk_gpu_get_type (void) G_GNUC_CONST; 92 | GtkWidget* ctk_gpu_new (CtrlTarget *ctrl_target, 93 | CtkEvent *ctk_event, 94 | CtkConfig *ctk_config); 95 | 96 | void get_bus_type_str(CtrlTarget *ctrl_target, gchar **bus); 97 | gchar *get_bus_id_str(CtrlTarget *ctrl_target); 98 | 99 | GtkTextBuffer *ctk_gpu_create_help(GtkTextTagTable *, 100 | CtkGpu *); 101 | 102 | void ctk_gpu_page_select(GtkWidget *); 103 | void ctk_gpu_page_unselect(GtkWidget *); 104 | 105 | G_END_DECLS 106 | 107 | #endif /* __CTK_GPU_H__ */ 108 | 109 | -------------------------------------------------------------------------------- /src/gtk+-2.x/ctkhelp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | * and Linux systems. 4 | * 5 | * Copyright (C) 2004 NVIDIA Corporation. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms and conditions of the GNU General Public License, 9 | * version 2, as published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | * more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef __CTK_HELP_H__ 21 | #define __CTK_HELP_H__ 22 | 23 | #include 24 | 25 | #include "common-utils.h" 26 | 27 | 28 | G_BEGIN_DECLS 29 | 30 | #define CTK_TYPE_HELP (ctk_help_get_type()) 31 | 32 | #define CTK_HELP(obj) \ 33 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), CTK_TYPE_HELP, CtkHelp)) 34 | 35 | #define CTK_HELP_CLASS(klass) \ 36 | (G_TYPE_CHECK_CLASS_CAST ((klass), CTK_TYPE_HELP, CtkHelpClass)) 37 | 38 | #define CTK_IS_HELP(obj) \ 39 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CTK_TYPE_HELP)) 40 | 41 | #define CTK_IS_HELP_CLASS(class) \ 42 | (G_TYPE_CHECK_CLASS_TYPE ((klass), CTK_TYPE_HELP)) 43 | 44 | #define CTK_HELP_GET_CLASS(obj) \ 45 | (G_TYPE_INSTANCE_GET_CLASS ((obj), CTK_TYPE_HELP, CtkHelpClass)) 46 | 47 | 48 | typedef struct _CtkHelp CtkHelp; 49 | typedef struct _CtkHelpClass CtkHelpClass; 50 | typedef struct _CtkHelpDataItem CtkHelpDataItem; 51 | 52 | struct _CtkHelp 53 | { 54 | GtkWindow parent; 55 | 56 | GtkWidget *text_viewer; 57 | GtkTextBuffer *default_help; 58 | GtkTextTagTable *tag_table; 59 | 60 | GtkWidget *toggle_button; 61 | }; 62 | 63 | struct _CtkHelpDataItem 64 | { 65 | // Header for the help section (usually corresponds to a label) 66 | gchar *label; 67 | 68 | // A brief summary of the contents 69 | gchar *help_text; 70 | 71 | // If non-NULL, elaborates on help_text above 72 | gchar *extended_help_text; 73 | }; 74 | 75 | struct _CtkHelpClass 76 | { 77 | GtkWindowClass parent_class; 78 | }; 79 | 80 | GType ctk_help_get_type (void) G_GNUC_CONST; 81 | GtkWidget *ctk_help_new (GtkWidget *, GtkTextTagTable *); 82 | void ctk_help_set_page (CtkHelp *, GtkTextBuffer *); 83 | GtkTextTagTable *ctk_help_create_tag_table (void); 84 | 85 | void ctk_help_title (GtkTextBuffer *, GtkTextIter *, const gchar *, ...) NV_ATTRIBUTE_PRINTF(3, 4); 86 | void ctk_help_para (GtkTextBuffer *, GtkTextIter *, const gchar *, ...) NV_ATTRIBUTE_PRINTF(3, 4); 87 | void ctk_help_heading (GtkTextBuffer *, GtkTextIter *, const gchar *, ...) NV_ATTRIBUTE_PRINTF(3, 4); 88 | void ctk_help_term (GtkTextBuffer *, GtkTextIter *, const gchar *, ...) NV_ATTRIBUTE_PRINTF(3, 4); 89 | void ctk_help_finish (GtkTextBuffer *); 90 | 91 | void ctk_help_reset_hardware_defaults(GtkTextBuffer *, GtkTextIter *, gchar *); 92 | gchar *ctk_help_create_reset_hardware_defaults_text(gchar*, gchar *); 93 | 94 | void ctk_help_data_list_prepend(GList **list, 95 | const gchar *label, 96 | const gchar *help_text, 97 | const gchar *extended_help_text); 98 | void ctk_help_data_list_free_full(GList *list); 99 | void ctk_help_data_list_print_terms(GtkTextBuffer *b, GtkTextIter *i, 100 | GList *help_data_list); 101 | void ctk_help_data_list_print_sections(GtkTextBuffer *b, GtkTextIter *i, 102 | GList *help_data_list); 103 | 104 | 105 | #define CTK_HELP_TITLE_TAG "title" 106 | #define CTK_HELP_HEADING_TAG "heading" 107 | #define CTK_HELP_HEADING_NOT_EDITABLE_TAG "not_editable" 108 | #define CTK_HELP_WORD_WRAP_TAG "word_wrap" 109 | #define CTK_HELP_MARGIN_TAG "margin" 110 | #define CTK_HELP_SINGLE_SPACE_TAG "single-space" 111 | #define CTK_HELP_BOLD_TAG "bold" 112 | 113 | 114 | G_END_DECLS 115 | 116 | #endif /* __CTK_HELP_H__ */ 117 | -------------------------------------------------------------------------------- /src/gtk+-2.x/ctkimagesliders.h: -------------------------------------------------------------------------------- 1 | /* 2 | * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | * and Linux systems. 4 | * 5 | * Copyright (C) 2004 NVIDIA Corporation. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms and conditions of the GNU General Public License, 9 | * version 2, as published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | * more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef __CTK_IMAGE_SLIDERS_H__ 21 | #define __CTK_IMAGE_SLIDERS_H__ 22 | 23 | #include "ctkevent.h" 24 | #include "ctkconfig.h" 25 | 26 | G_BEGIN_DECLS 27 | 28 | #define CTK_TYPE_IMAGE_SLIDERS (ctk_image_sliders_get_type()) 29 | 30 | #define CTK_IMAGE_SLIDERS(obj) \ 31 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), CTK_TYPE_IMAGE_SLIDERS, \ 32 | CtkImageSliders)) 33 | 34 | #define CTK_IMAGE_SLIDERS_CLASS(klass) \ 35 | (G_TYPE_CHECK_CLASS_CAST ((klass), CTK_TYPE_IMAGE_SLIDERS, \ 36 | CtkImageSlidersClass)) 37 | 38 | #define CTK_IS_IMAGE_SLIDERS(obj) \ 39 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CTK_TYPE_IMAGE_SLIDERS)) 40 | 41 | #define CTK_IS_IMAGE_SLIDERS_CLASS(class) \ 42 | (G_TYPE_CHECK_CLASS_TYPE ((klass), CTK_TYPE_IMAGE_SLIDERS)) 43 | 44 | #define CTK_IMAGE_SLIDERS_GET_CLASS(obj) \ 45 | (G_TYPE_INSTANCE_GET_CLASS ((obj), CTK_TYPE_IMAGE_SLIDERS, \ 46 | CtkImageSlidersClass)) 47 | 48 | typedef struct _CtkImageSliders CtkImageSliders; 49 | typedef struct _CtkImageSlidersClass CtkImageSlidersClass; 50 | 51 | struct _CtkImageSliders 52 | { 53 | GtkVBox parent; 54 | 55 | CtrlTarget *ctrl_target; 56 | char *name; 57 | 58 | CtkConfig *ctk_config; 59 | CtkEvent *ctk_event; 60 | GtkWidget *reset_button; 61 | 62 | GtkWidget *frame; 63 | 64 | GtkWidget *digital_vibrance; 65 | GtkWidget *image_sharpening; 66 | }; 67 | 68 | struct _CtkImageSlidersClass 69 | { 70 | GtkVBoxClass parent_class; 71 | }; 72 | 73 | GType ctk_image_sliders_get_type (void) G_GNUC_CONST; 74 | GtkWidget* ctk_image_sliders_new (CtrlTarget *, 75 | CtkConfig *, CtkEvent *, 76 | GtkWidget *reset_button, 77 | char *name); 78 | 79 | void ctk_image_sliders_reset(CtkImageSliders *); 80 | 81 | void ctk_image_sliders_setup(CtkImageSliders *ctk_image_sliders); 82 | 83 | void add_image_sliders_help(CtkImageSliders *ctk_image_sliders, 84 | GtkTextBuffer *b, 85 | GtkTextIter *i); 86 | 87 | G_END_DECLS 88 | 89 | #endif /* __CTK_IMAGE_SLIDERS_H__ */ 90 | -------------------------------------------------------------------------------- /src/gtk+-2.x/ctkmultisample.h: -------------------------------------------------------------------------------- 1 | /* 2 | * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | * and Linux systems. 4 | * 5 | * Copyright (C) 2004 NVIDIA Corporation. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms and conditions of the GNU General Public License, 9 | * version 2, as published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | * more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef __CTK_MULTISAMPLE_H__ 21 | #define __CTK_MULTISAMPLE_H__ 22 | 23 | #include "ctkevent.h" 24 | #include "ctkconfig.h" 25 | #include "ctkdropdownmenu.h" 26 | 27 | G_BEGIN_DECLS 28 | 29 | #define CTK_TYPE_MULTISAMPLE (ctk_multisample_get_type()) 30 | 31 | #define CTK_MULTISAMPLE(obj) \ 32 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), CTK_TYPE_MULTISAMPLE, CtkMultisample)) 33 | 34 | #define CTK_MULTISAMPLE_CLASS(klass) \ 35 | (G_TYPE_CHECK_CLASS_CAST ((klass), CTK_TYPE_MULTISAMPLE, \ 36 | CtkMultisampleClass)) 37 | 38 | #define CTK_IS_MULTISAMPLE(obj) \ 39 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CTK_TYPE_MULTISAMPLE)) 40 | 41 | #define CTK_IS_MULTISAMPLE_CLASS(class) \ 42 | (G_TYPE_CHECK_CLASS_TYPE ((klass), CTK_TYPE_MULTISAMPLE)) 43 | 44 | #define CTK_MULTISAMPLE_GET_CLASS(obj) \ 45 | (G_TYPE_INSTANCE_GET_CLASS ((obj), CTK_TYPE_MULTISAMPLE, \ 46 | CtkMultisampleClass)) 47 | 48 | 49 | typedef struct _CtkMultisample CtkMultisample; 50 | typedef struct _CtkMultisampleClass CtkMultisampleClass; 51 | 52 | struct _CtkMultisample 53 | { 54 | GtkVBox parent; 55 | CtrlTarget *ctrl_target; 56 | CtkConfig *ctk_config; 57 | 58 | GtkWidget *fsaa_app_override_check_button; 59 | GtkWidget *fsaa_menu; 60 | GtkWidget *fsaa_scale; 61 | GtkWidget *fxaa_enable_check_button; 62 | GtkWidget *log_aniso_app_override_check_button; 63 | GtkWidget *log_aniso_scale; 64 | CtkDropDownMenu *d; 65 | 66 | guint active_attributes; 67 | 68 | gint fsaa_translation_table[NV_CTRL_FSAA_MODE_MAX + 1]; 69 | gint fsaa_translation_table_size; 70 | }; 71 | 72 | struct _CtkMultisampleClass 73 | { 74 | GtkVBoxClass parent_class; 75 | }; 76 | 77 | GType ctk_multisample_get_type (void) G_GNUC_CONST; 78 | GtkWidget* ctk_multisample_new (CtrlTarget *, CtkConfig *, CtkEvent *); 79 | 80 | GtkTextBuffer *ctk_multisample_create_help(GtkTextTagTable *, 81 | CtkMultisample *); 82 | G_END_DECLS 83 | 84 | #endif /* __CTK_MULTISAMPLE_H__ */ 85 | 86 | -------------------------------------------------------------------------------- /src/gtk+-2.x/ctkopengl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | * and Linux systems. 4 | * 5 | * Copyright (C) 2004 NVIDIA Corporation. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms and conditions of the GNU General Public License, 9 | * version 2, as published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | * more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef __CTK_OPENGL_H__ 21 | #define __CTK_OPENGL_H__ 22 | 23 | #include "ctkevent.h" 24 | #include "ctkconfig.h" 25 | 26 | G_BEGIN_DECLS 27 | 28 | #define CTK_TYPE_OPENGL (ctk_opengl_get_type()) 29 | 30 | #define CTK_OPENGL(obj) \ 31 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), CTK_TYPE_OPENGL, CtkOpenGL)) 32 | 33 | #define CTK_OPENGL_CLASS(klass) \ 34 | (G_TYPE_CHECK_CLASS_CAST ((klass), CTK_TYPE_OPENGL, CtkOpenGLClass)) 35 | 36 | #define CTK_IS_OPENGL(obj) \ 37 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CTK_TYPE_OPENGL)) 38 | 39 | #define CTK_IS_OPENGL_CLASS(class) \ 40 | (G_TYPE_CHECK_CLASS_TYPE ((klass), CTK_TYPE_OPENGL)) 41 | 42 | #define CTK_OPENGL_GET_CLASS(obj) \ 43 | (G_TYPE_INSTANCE_GET_CLASS ((obj), CTK_TYPE_OPENGL, CtkOpenGLClass)) 44 | 45 | 46 | typedef struct _CtkOpenGL CtkOpenGL; 47 | typedef struct _CtkOpenGLClass CtkOpenGLClass; 48 | 49 | struct _CtkOpenGL 50 | { 51 | GtkVBox parent; 52 | 53 | CtrlTarget *ctrl_target; 54 | CtkConfig *ctk_config; 55 | CtrlEvent *ctk_event; 56 | 57 | GtkWidget *sync_to_vblank_button; 58 | GtkWidget *allow_flipping_button; 59 | GtkWidget *allow_vrr_button; 60 | GtkWidget *show_vrr_visual_indicator_button; 61 | GtkWidget *use_conformant_clamping_button; 62 | GtkWidget *force_stereo_button; 63 | GtkWidget *xinerama_stereo_button; 64 | GtkWidget *stereo_eyes_exchange_button; 65 | GtkWidget *stereo_swap_mode_menu; 66 | GtkWidget *image_settings_dropdown; 67 | GtkWidget *aa_line_gamma_button; 68 | GtkWidget *aa_line_gamma_scale; 69 | GtkWidget *show_sli_visual_indicator_button; 70 | GtkWidget *show_multigpu_visual_indicator_button; 71 | GtkWidget *show_graphics_visual_indicator_button; 72 | 73 | gint *stereo_swap_mode_table; 74 | gint stereo_swap_mode_table_size; 75 | 76 | unsigned int active_attributes; 77 | }; 78 | 79 | struct _CtkOpenGLClass 80 | { 81 | GtkVBoxClass parent_class; 82 | }; 83 | 84 | GType ctk_opengl_get_type (void) G_GNUC_CONST; 85 | GtkWidget* ctk_opengl_new (CtrlTarget *, CtkConfig *, CtkEvent *); 86 | 87 | GtkTextBuffer *ctk_opengl_create_help(GtkTextTagTable *, CtkOpenGL *); 88 | 89 | G_END_DECLS 90 | 91 | #endif /* __CTK_OPENGL_H__ */ 92 | 93 | -------------------------------------------------------------------------------- /src/gtk+-2.x/ctkpowermizer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | * and Linux systems. 4 | * 5 | * Copyright (C) 2004 NVIDIA Corporation. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms and conditions of the GNU General Public License, 9 | * version 2, as published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | * more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef __CTK_POWERMIZER_H__ 21 | #define __CTK_POWERMIZER_H__ 22 | 23 | #include "ctkconfig.h" 24 | #include "ctkevent.h" 25 | 26 | G_BEGIN_DECLS 27 | 28 | #define CTK_TYPE_POWERMIZER (ctk_powermizer_get_type()) 29 | 30 | #define CTK_POWERMIZER(obj) \ 31 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), CTK_TYPE_POWERMIZER, CtkPowermizer)) 32 | 33 | #define CTK_POWERMIZER_CLASS(klass) \ 34 | (G_TYPE_CHECK_CLASS_CAST ((klass), CTK_TYPE_POWERMIZER, CtkPowermizerClass)) 35 | 36 | #define CTK_IS_POWERMIZER(obj) \ 37 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CTK_TYPE_POWERMIZER)) 38 | 39 | #define CTK_IS_POWERMIZER_CLASS(class) \ 40 | (G_TYPE_CHECK_CLASS_TYPE ((klass), CTK_TYPE_POWERMIZER)) 41 | 42 | #define CTK_POWERMIZER_GET_CLASS(obj) \ 43 | (G_TYPE_INSTANCE_GET_CLASS ((obj), CTK_TYPE_POWERMIZER, CtkPowermizerClass)) 44 | 45 | typedef struct _CtkPowermizer CtkPowermizer; 46 | typedef struct _CtkPowermizerClass CtkPowermizerClass; 47 | 48 | struct _CtkPowermizer 49 | { 50 | GtkVBox parent; 51 | 52 | CtrlTarget *ctrl_target; 53 | CtkConfig *ctk_config; 54 | 55 | GtkWidget *adaptive_clock_status; 56 | GtkWidget *gpu_clock; 57 | GtkWidget *memory_transfer_rate; 58 | GtkWidget *power_source; 59 | GtkWidget *performance_level; 60 | GtkWidget *performance_table_hbox; 61 | GtkWidget *performance_table_hbox1; 62 | GtkWidget *powermizer_menu; 63 | GtkWidget *powermizer_txt; 64 | GtkWidget *box_powermizer_menu; 65 | 66 | gchar *powermizer_menu_help; 67 | 68 | gboolean hasDecoupledClock; 69 | gboolean hasEditablePerfLevel; 70 | gboolean editable_performance_levels_unified; 71 | gint nvclock_attribute; 72 | gint mem_transfer_rate_attribute; 73 | gint powermizer_default_mode; 74 | 75 | GtkWidget *editable_perf_level_table; 76 | gint num_perf_levels; 77 | 78 | GtkWidget *link_width; 79 | GtkWidget *link_speed; 80 | GtkWidget *max_tgp; 81 | GtkWidget *default_tgp; 82 | GtkWidget *power_draw; 83 | 84 | gint max_tgp_value; 85 | gint default_tgp_value; 86 | }; 87 | 88 | struct _CtkPowermizerClass 89 | { 90 | GtkVBoxClass parent_class; 91 | }; 92 | 93 | GType ctk_powermizer_get_type (void) G_GNUC_CONST; 94 | GtkWidget* ctk_powermizer_new (CtrlTarget *, CtkConfig *, 95 | CtkEvent *); 96 | GtkTextBuffer* ctk_powermizer_create_help (GtkTextTagTable *, CtkPowermizer *); 97 | 98 | void ctk_powermizer_start_timer (GtkWidget *); 99 | void ctk_powermizer_stop_timer (GtkWidget *); 100 | 101 | G_END_DECLS 102 | 103 | #endif /* __CTK_POWERMIZER_H__ */ 104 | -------------------------------------------------------------------------------- /src/gtk+-2.x/ctkpowermode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | * and Linux systems. 4 | * 5 | * Copyright (C) 2020 NVIDIA Corporation. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms and conditions of the GNU General Public License, 9 | * version 2, as published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | * more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef __CTK_POWERMODE_H__ 21 | #define __CTK_POWERMODE_H__ 22 | 23 | #include "ctkevent.h" 24 | #include "ctkconfig.h" 25 | #include "ctkdropdownmenu.h" 26 | 27 | G_BEGIN_DECLS 28 | 29 | #define CTK_TYPE_POWERMODE (ctk_powermode_get_type()) 30 | 31 | #define CTK_POWERMODE(obj) \ 32 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), CTK_TYPE_POWERMODE, CtkPowermode)) 33 | 34 | #define CTK_POWERMODE_CLASS(klass) \ 35 | (G_TYPE_CHECK_CLASS_CAST ((klass), CTK_TYPE_POWERMODE, CtkPowermodeClass)) 36 | 37 | #define CTK_IS_POWERMODE(obj) \ 38 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CTK_TYPE_POWERMODE)) 39 | 40 | #define CTK_IS_POWERMODE_CLASS(class) \ 41 | (G_TYPE_CHECK_CLASS_TYPE ((klass), CTK_TYPE_POWERMODE)) 42 | 43 | #define CTK_POWERMODE_GET_CLASS(obj) \ 44 | (G_TYPE_INSTANCE_GET_CLASS ((obj), CTK_TYPE_POWERMODE, CtkPowermodeClass)) 45 | 46 | 47 | 48 | typedef struct _CtkPowermode CtkPowermode; 49 | typedef struct _CtkPowermodeClass CtkPowermodeClass; 50 | 51 | struct _CtkPowermode 52 | { 53 | GtkVBox parent; 54 | 55 | CtrlTarget *ctrl_target; 56 | CtkConfig *ctk_config; 57 | 58 | CtkDropDownMenu *powermode_menu; 59 | GtkWidget *current_powermode; 60 | 61 | }; 62 | 63 | struct _CtkPowermodeClass 64 | { 65 | GtkVBoxClass parent_class; 66 | }; 67 | 68 | GType ctk_powermode_get_type (void) G_GNUC_CONST; 69 | GtkWidget* ctk_powermode_new (CtrlTarget *, CtkConfig *, CtkEvent *); 70 | GtkTextBuffer* ctk_powermode_create_help (GtkTextTagTable *, CtkPowermode *); 71 | 72 | void ctk_powermode_start_timer (GtkWidget *); 73 | void ctk_powermode_stop_timer (GtkWidget *); 74 | 75 | 76 | G_END_DECLS 77 | 78 | #endif /* __CTK_POWERMODE_H__ */ 79 | -------------------------------------------------------------------------------- /src/gtk+-2.x/ctkscale.h: -------------------------------------------------------------------------------- 1 | /* 2 | * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | * and Linux systems. 4 | * 5 | * Copyright (C) 2004 NVIDIA Corporation. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms and conditions of the GNU General Public License, 9 | * version 2, as published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | * more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef __CTK_SCALE_H__ 21 | #define __CTK_SCALE_H__ 22 | 23 | #include "ctkconfig.h" 24 | 25 | G_BEGIN_DECLS 26 | 27 | #define CTK_TYPE_SCALE (ctk_scale_get_type()) 28 | 29 | #define CTK_SCALE(obj) \ 30 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), CTK_TYPE_SCALE, CtkScale)) 31 | 32 | #define CTK_SCALE_CLASS(klass) \ 33 | (G_TYPE_CHECK_CLASS_CAST ((klass), CTK_TYPE_SCALE, CtkScaleClass)) 34 | 35 | #define CTK_IS_SCALE(obj) \ 36 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CTK_TYPE_SCALE)) 37 | 38 | #define CTK_IS_SCALE_CLASS(class) \ 39 | (G_TYPE_CHECK_CLASS_TYPE ((klass), CTK_TYPE_SCALE)) 40 | 41 | #define CTK_SCALE_GET_CLASS(obj) \ 42 | (G_TYPE_INSTANCE_GET_CLASS ((obj), CTK_TYPE_SCALE, CtkScaleClass)) 43 | 44 | 45 | /* the widget within the CtkScale that to which tooltips should be attached */ 46 | 47 | #define CTK_SCALE_TOOLTIP_WIDGET(obj) \ 48 | ((CTK_SCALE(obj))->tooltip_widget) 49 | 50 | typedef struct _CtkScale CtkScale; 51 | typedef struct _CtkScaleClass CtkScaleClass; 52 | 53 | struct _CtkScale 54 | { 55 | GtkVBox parent; 56 | 57 | GtkAdjustment *gtk_adjustment; 58 | const gchar *label; 59 | GtkWidget *gtk_scale; 60 | GtkWidget *text_entry; 61 | gboolean text_entry_packed; 62 | GtkWidget *text_entry_container; 63 | GtkWidget *tooltip_widget; 64 | CtkConfig *ctk_config; 65 | gint value_type; 66 | }; 67 | 68 | struct _CtkScaleClass 69 | { 70 | GtkVBoxClass parent_class; 71 | }; 72 | 73 | GType ctk_scale_get_type (void) G_GNUC_CONST; 74 | GtkWidget* ctk_scale_new (GtkAdjustment *, const gchar *, 75 | CtkConfig *, gint); 76 | 77 | G_END_DECLS 78 | 79 | #endif /* __CTK_SCALE_H__ */ 80 | 81 | -------------------------------------------------------------------------------- /src/gtk+-2.x/ctkscreen.h: -------------------------------------------------------------------------------- 1 | /* 2 | * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | * and Linux systems. 4 | * 5 | * Copyright (C) 2004 NVIDIA Corporation. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms and conditions of the GNU General Public License, 9 | * version 2, as published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | * more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef __CTK_SCREEN_H__ 21 | #define __CTK_SCREEN_H__ 22 | 23 | #include 24 | 25 | #include "query-assign.h" 26 | #include "ctkevent.h" 27 | 28 | G_BEGIN_DECLS 29 | 30 | #define CTK_TYPE_SCREEN (ctk_screen_get_type()) 31 | 32 | #define CTK_SCREEN(obj) \ 33 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), CTK_TYPE_SCREEN, CtkScreen)) 34 | 35 | #define CTK_SCREEN_CLASS(klass) \ 36 | (G_TYPE_CHECK_CLASS_CAST ((klass), CTK_TYPE_SCREEN, CtkScreenClass)) 37 | 38 | #define CTK_IS_SCREEN(obj) \ 39 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CTK_TYPE_SCREEN)) 40 | 41 | #define CTK_IS_SCREEN_CLASS(class) \ 42 | (G_TYPE_CHECK_CLASS_TYPE ((klass), CTK_TYPE_SCREEN)) 43 | 44 | #define CTK_SCREEN_GET_CLASS(obj) \ 45 | (G_TYPE_INSTANCE_GET_CLASS ((obj), CTK_TYPE_SCREEN, CtkScreenClass)) 46 | 47 | 48 | typedef struct _CtkScreen CtkScreen; 49 | typedef struct _CtkScreenClass CtkScreenClass; 50 | 51 | struct _CtkScreen 52 | { 53 | GtkVBox parent; 54 | 55 | CtrlTarget *ctrl_target; 56 | 57 | GtkWidget *dimensions; 58 | GtkWidget *displays; 59 | GtkWidget *gpu_errors; 60 | 61 | int stereo_available; 62 | }; 63 | 64 | struct _CtkScreenClass 65 | { 66 | GtkVBoxClass parent_class; 67 | }; 68 | 69 | GType ctk_screen_get_type (void) G_GNUC_CONST; 70 | GtkWidget* ctk_screen_new (CtrlTarget *ctrl_target, CtkEvent *ctk_event); 71 | 72 | GtkTextBuffer *ctk_screen_create_help(GtkTextTagTable *, CtkScreen *, 73 | const gchar *); 74 | 75 | G_END_DECLS 76 | 77 | #endif /* __CTK_SCREEN_H__ */ 78 | 79 | -------------------------------------------------------------------------------- /src/gtk+-2.x/ctkserver.h: -------------------------------------------------------------------------------- 1 | /* 2 | * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | * and Linux systems. 4 | * 5 | * Copyright (C) 2004 NVIDIA Corporation. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms and conditions of the GNU General Public License, 9 | * version 2, as published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | * more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef __CTK_SERVER_H__ 21 | #define __CTK_SERVER_H__ 22 | 23 | #include "ctkevent.h" 24 | #include "ctkconfig.h" 25 | 26 | G_BEGIN_DECLS 27 | 28 | #define CTK_TYPE_SERVER (ctk_server_get_type()) 29 | 30 | #define CTK_SERVER(obj) \ 31 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), CTK_TYPE_SERVER, \ 32 | CtkServer)) 33 | 34 | #define CTK_SERVER_CLASS(klass) \ 35 | (G_TYPE_CHECK_CLASS_CAST ((klass), CTK_TYPE_SERVER, \ 36 | CtkServerClass)) 37 | 38 | #define CTK_IS_SERVER(obj) \ 39 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CTK_TYPE_SERVER)) 40 | 41 | #define CTK_IS_SERVER_CLASS(class) \ 42 | (G_TYPE_CHECK_CLASS_TYPE ((klass), CTK_TYPE_SERVER)) 43 | 44 | #define CTK_SERVER_GET_CLASS(obj) \ 45 | (G_TYPE_INSTANCE_GET_CLASS ((obj), CTK_TYPE_SERVER, \ 46 | CtkServerClass)) 47 | 48 | 49 | typedef struct _CtkServer 50 | { 51 | GtkVBox parent; 52 | 53 | CtkConfig *ctk_config; 54 | 55 | gboolean os_available; 56 | gboolean nvml_available; 57 | gboolean x_available; 58 | gboolean wayland_available; 59 | 60 | } CtkServer; 61 | 62 | typedef struct _CtkServerClass 63 | { 64 | GtkVBoxClass parent_class; 65 | } CtkServerClass; 66 | 67 | 68 | GType ctk_server_get_type (void) G_GNUC_CONST; 69 | GtkWidget* ctk_server_new (CtrlTarget *, CtkConfig *); 70 | 71 | GtkTextBuffer *ctk_server_create_help(GtkTextTagTable *, 72 | CtkServer *); 73 | 74 | G_END_DECLS 75 | 76 | #endif /* __CTK_SERVER_H__ */ 77 | -------------------------------------------------------------------------------- /src/gtk+-2.x/ctkslimm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | * and Linux systems. 4 | * 5 | * Copyright (C) 2004 NVIDIA Corporation. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms and conditions of the GNU General Public License, 9 | * version 2, as published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | * more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef __CTK_SLIMM_H__ 21 | #define __CTK_SLIMM_H__ 22 | 23 | #include 24 | 25 | #include "ctkevent.h" 26 | #include "ctkdisplaylayout.h" 27 | #include "ctkconfig.h" 28 | #include "ctkdisplayconfig-utils.h" 29 | 30 | #include "XF86Config-parser/xf86Parser.h" 31 | 32 | typedef struct GridConfigRec { 33 | int rows; 34 | int columns; 35 | } GridConfig; 36 | 37 | typedef struct nvModeLineItemRec { 38 | nvModeLinePtr modeline; 39 | struct nvModeLineItemRec *next; 40 | } nvModeLineItem, *nvModeLineItemPtr; 41 | 42 | typedef struct _CtkMMDialog 43 | { 44 | GtkWidget *parent; 45 | nvLayoutPtr layout; 46 | 47 | CtrlTarget *ctrl_target; 48 | CtkConfig *ctk_config; 49 | 50 | GtkWidget *dialog; 51 | gboolean is_active; 52 | 53 | GtkWidget *mnu_display_config; 54 | GtkWidget *mnu_display_resolution; 55 | GtkWidget *mnu_display_refresh; 56 | GtkWidget *spbtn_hedge_overlap; 57 | GtkWidget *spbtn_vedge_overlap; 58 | GtkWidget *lbl_total_size; 59 | GtkWidget *box_total_size; 60 | GtkWidget *chk_all_displays; 61 | nvModeLinePtr *resolution_table; 62 | nvModeLinePtr *refresh_table; 63 | int resolution_table_len; 64 | int refresh_table_len; 65 | int cur_resolution_table_idx; 66 | gint h_overlap_parsed, v_overlap_parsed; 67 | gboolean mnu_refresh_disabled; 68 | nvModeLineItemPtr modelines; 69 | nvModeLinePtr cur_modeline; 70 | gint num_modelines; 71 | int num_displays; 72 | int parsed_rows; 73 | int parsed_cols; 74 | 75 | int max_screen_width; 76 | int max_screen_height; 77 | 78 | gint x_displays, y_displays; 79 | gint resolution_idx, refresh_idx; 80 | gint h_overlap, v_overlap; 81 | 82 | /** 83 | * The grid_configs array enumerates the display grid configurations 84 | * that are presently supported. 85 | **/ 86 | GridConfig *grid_configs; 87 | int num_grid_configs; 88 | 89 | } CtkMMDialog; 90 | 91 | CtkMMDialog *create_mosaic_dialog(GtkWidget *parent, CtrlTarget *ctrl_target, 92 | CtkConfig *ctk_config, nvLayoutPtr layout); 93 | int run_mosaic_dialog(CtkMMDialog *dialog, GtkWidget *parent, 94 | nvLayoutPtr layout); 95 | 96 | void ctk_mmdialog_insert_help(GtkTextBuffer *b, GtkTextIter *i); 97 | void update_mosaic_dialog_ui(CtkMMDialog *ctk_mmdialog, nvLayoutPtr layout); 98 | 99 | #endif /* __CTK_SLIMM_H__ */ 100 | 101 | -------------------------------------------------------------------------------- /src/gtk+-2.x/ctkthermal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | * and Linux systems. 4 | * 5 | * Copyright (C) 2004 NVIDIA Corporation. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms and conditions of the GNU General Public License, 9 | * version 2, as published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | * more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef __CTK_THERMAL_H__ 21 | #define __CTK_THERMAL_H__ 22 | 23 | #include "ctkconfig.h" 24 | #include "ctkevent.h" 25 | 26 | G_BEGIN_DECLS 27 | 28 | #define CTK_TYPE_THERMAL (ctk_thermal_get_type()) 29 | 30 | #define CTK_THERMAL(obj) \ 31 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), CTK_TYPE_THERMAL, CtkThermal)) 32 | 33 | #define CTK_THERMAL_CLASS(klass) \ 34 | (G_TYPE_CHECK_CLASS_CAST ((klass), CTK_TYPE_THERMAL, CtkThermalClass)) 35 | 36 | #define CTK_IS_THERMAL(obj) \ 37 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CTK_TYPE_THERMAL)) 38 | 39 | #define CTK_IS_THERMAL_CLASS(class) \ 40 | (G_TYPE_CHECK_CLASS_TYPE ((klass), CTK_TYPE_THERMAL)) 41 | 42 | #define CTK_THERMAL_GET_CLASS(obj) \ 43 | (G_TYPE_INSTANCE_GET_CLASS ((obj), CTK_TYPE_THERMAL, CtkThermalClass)) 44 | 45 | 46 | typedef struct _CtkThermal CtkThermal; 47 | typedef struct _CtkThermalClass CtkThermalClass; 48 | 49 | typedef struct _CoolerControl { 50 | CtrlAttributeValidValues range; 51 | CtrlTarget *ctrl_target; 52 | 53 | int level; 54 | Bool changed; /* Cooler level moved by user */ 55 | GtkWidget *widget; /* Cooler level control widget */ 56 | GtkAdjustment *adjustment; /* Track adjustment */ 57 | CtkEvent *event; /* Receive NV_CONTROL events */ 58 | } CoolerControlRec, *CoolerControlPtr; 59 | 60 | typedef struct { 61 | int format; 62 | const char *name; 63 | } nvctrlFormatName; 64 | 65 | typedef struct _SensorInfo { 66 | CtrlTarget *ctrl_target; 67 | int currentTemp; 68 | int minTemp; 69 | int maxTemp; 70 | 71 | GtkWidget *target_type; 72 | GtkWidget *provider_type; 73 | GtkWidget *temp_label; 74 | GtkWidget *core_gauge; 75 | } SensorInfoRec, *SensorInfoPtr; 76 | 77 | struct _CtkThermal 78 | { 79 | GtkVBox parent; 80 | 81 | CtrlTarget *ctrl_target; 82 | CtkConfig *ctk_config; 83 | 84 | GtkWidget *core_label; 85 | GtkWidget *core_gauge; 86 | GtkWidget *ambient_label; 87 | GtkWidget *apply_button; 88 | GtkWidget *reset_button; 89 | GtkWidget *enable_checkbox; 90 | GtkWidget *fan_control_frame; 91 | GtkWidget *adaptive_clock_status; 92 | GtkWidget *fan_target; 93 | GtkWidget *fan_signal; 94 | GtkWidget *fan_control_policy; 95 | GtkWidget *cooler_table_hbox; 96 | GtkWidget *fan_information_box; 97 | 98 | gboolean cooler_control_enabled; 99 | gboolean settings_changed; 100 | gboolean show_fan_control_frame; 101 | gboolean enable_reset_button; 102 | CoolerControlPtr cooler_control; 103 | SensorInfoPtr sensor_info; 104 | int cooler_count; 105 | int sensor_count; 106 | gboolean thermal_sensor_target_type_supported; 107 | gboolean thermal_cooler_extra_info_supported; 108 | 109 | gboolean any_sensor_target_supported; 110 | gboolean any_sensor_provider_supported; 111 | gboolean any_sensor_slowdown_supported; 112 | gboolean any_sensor_reading_supported; 113 | }; 114 | 115 | struct _CtkThermalClass 116 | { 117 | GtkVBoxClass parent_class; 118 | }; 119 | 120 | GType ctk_thermal_get_type (void) G_GNUC_CONST; 121 | GtkWidget* ctk_thermal_new (CtrlTarget *, CtkConfig *, CtkEvent *); 122 | GtkTextBuffer* ctk_thermal_create_help (GtkTextTagTable *, CtkThermal *); 123 | 124 | void ctk_thermal_start_timer (GtkWidget *); 125 | void ctk_thermal_stop_timer (GtkWidget *); 126 | 127 | G_END_DECLS 128 | 129 | #endif /* __CTK_THERMAL_H__ */ 130 | -------------------------------------------------------------------------------- /src/gtk+-2.x/ctkui.c: -------------------------------------------------------------------------------- 1 | /* 2 | * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | * and Linux systems. 4 | * 5 | * Copyright (C) 2004 NVIDIA Corporation. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms and conditions of the GNU General Public License, 9 | * version 2, as published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | * more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #include 21 | #include "ctkui.h" 22 | #include "ctkwindow.h" 23 | #include "ctkutils.h" 24 | #include "nvidia_icon.png.h" 25 | /* 26 | * This source file provides thin wrappers over the gtk routines, so 27 | * that nvidia-settings.c doesn't need to include gtk+ 28 | */ 29 | 30 | int ctk_init_check(int *argc, char **argv[]) 31 | { 32 | return gtk_init_check(argc, argv); 33 | } 34 | 35 | char *ctk_get_display(void) 36 | { 37 | return gdk_get_display(); 38 | } 39 | 40 | void ctk_main(ParsedAttribute *p, 41 | ConfigProperties *conf, 42 | CtrlSystem *system, 43 | const char *page) 44 | { 45 | GList *list = NULL; 46 | GtkWidget *window; 47 | 48 | list = g_list_append (list, CTK_LOAD_PIXBUF(nvidia_icon)); 49 | gtk_window_set_default_icon_list(list); 50 | window = ctk_window_new(p, conf, system); 51 | 52 | ctk_window_set_active_page(CTK_WINDOW(window), page); 53 | 54 | gtk_main(); 55 | } 56 | -------------------------------------------------------------------------------- /src/gtk+-2.x/ctkui.h: -------------------------------------------------------------------------------- 1 | /* 2 | * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | * and Linux systems. 4 | * 5 | * Copyright (C) 2004 NVIDIA Corporation. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms and conditions of the GNU General Public License, 9 | * version 2, as published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | * more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef __CTK_UI_H__ 21 | #define __CTK_UI_H__ 22 | 23 | #include "NvCtrlAttributes.h" 24 | #include "parse.h" 25 | #include "config-file.h" 26 | 27 | int ctk_init_check(int *argc, char **argv[]); 28 | 29 | char *ctk_get_display(void); 30 | 31 | void ctk_main(ParsedAttribute*, 32 | ConfigProperties*, 33 | CtrlSystem*, 34 | const char *page); 35 | 36 | 37 | #endif /* __CTK_UI_H__ */ 38 | -------------------------------------------------------------------------------- /src/gtk+-2.x/ctkvdpau.h: -------------------------------------------------------------------------------- 1 | /* 2 | * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | * and Linux systems. 4 | * 5 | * Copyright (C) 2012 NVIDIA Corporation. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms and conditions of the GNU General Public License, 9 | * version 2, as published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | * more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef __CTK_VDPAU_H__ 21 | #define __CTK_VDPAU_H__ 22 | 23 | #include "ctkevent.h" 24 | #include "ctkconfig.h" 25 | 26 | #include "vdpau/vdpau.h" 27 | #include "vdpau/vdpau_x11.h" 28 | 29 | G_BEGIN_DECLS 30 | 31 | #define CTK_TYPE_VDPAU (ctk_vdpau_get_type()) 32 | 33 | #define CTK_VDPAU(obj) \ 34 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), CTK_TYPE_VDPAU, CtkVDPAU)) 35 | 36 | #define CTK_VDPAU_CLASS(klass) \ 37 | (G_TYPE_CHECK_CLASS_CAST ((klass), CTK_TYPE_VDPAU, CtkVDPAUClass)) 38 | 39 | #define CTK_IS_VDPAU(obj) \ 40 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CTK_TYPE_VDPAU)) 41 | 42 | #define CTK_IS_VDPAU_CLASS(class) \ 43 | (G_TYPE_CHECK_CLASS_TYPE ((klass), CTK_TYPE_VDPAU)) 44 | 45 | #define CTK_VDPAU_GET_CLASS(obj) \ 46 | (G_TYPE_INSTANCE_GET_CLASS ((obj), CTK_TYPE_VDPAU, CtkVDPAUClass)) 47 | 48 | /* Generic description structure */ 49 | typedef struct 50 | { 51 | const char *name; 52 | uint32_t id; 53 | uint32_t aux; /* optional extra parameter... */ 54 | } Desc; 55 | 56 | typedef struct _CtkVDPAU CtkVDPAU; 57 | typedef struct _CtkVDPAUClass CtkVDPAUClass; 58 | 59 | struct _CtkVDPAU 60 | { 61 | GtkVBox parent; 62 | 63 | CtkConfig *ctk_config; 64 | 65 | GtkWidget* notebook; 66 | GtkWidget* surfaceVbox; 67 | GtkWidget* baseInfoVbox; 68 | }; 69 | 70 | struct _CtkVDPAUClass 71 | { 72 | GtkVBoxClass parent_class; 73 | }; 74 | 75 | GType ctk_vdpau_get_type (void) G_GNUC_CONST; 76 | GtkWidget* ctk_vdpau_new (CtrlTarget *, CtkConfig *, CtkEvent *); 77 | GtkTextBuffer* ctk_vdpau_create_help (GtkTextTagTable *, CtkVDPAU *); 78 | 79 | G_END_DECLS 80 | 81 | #endif /* __CTK_VDPAU_H__ */ 82 | -------------------------------------------------------------------------------- /src/gtk+-2.x/ctkwindow.h: -------------------------------------------------------------------------------- 1 | /* 2 | * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | * and Linux systems. 4 | * 5 | * Copyright (C) 2004 NVIDIA Corporation. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms and conditions of the GNU General Public License, 9 | * version 2, as published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | * more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef __CTK_WINDOW_H__ 21 | #define __CTK_WINDOW_H__ 22 | 23 | #include 24 | 25 | #include "NvCtrlAttributes.h" 26 | 27 | #include "parse.h" 28 | #include "config-file.h" 29 | #include "ctkconfig.h" 30 | 31 | G_BEGIN_DECLS 32 | 33 | #define CTK_TYPE_WINDOW (ctk_window_get_type()) 34 | 35 | #define CTK_WINDOW(obj) \ 36 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), CTK_TYPE_WINDOW, CtkWindow)) 37 | 38 | #define CTK_WINDOW_CLASS(klass) \ 39 | (G_TYPE_CHECK_CLASS_CAST ((klass), CTK_TYPE_WINDOW, CtkWindowClass)) 40 | 41 | #define CTK_IS_WINDOW(obj) \ 42 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CTK_TYPE_WINDOW)) 43 | 44 | #define CTK_IS_WINDOW_CLASS(class) \ 45 | (G_TYPE_CHECK_CLASS_TYPE ((klass), CTK_TYPE_WINDOW)) 46 | 47 | #define CTK_WINDOW_GET_CLASS(obj) \ 48 | (G_TYPE_INSTANCE_GET_CLASS ((obj), CTK_TYPE_WINDOW, CtkWindowClass)) 49 | 50 | 51 | #define CTK_DISPLAY_DEVICE_CRT_MASK 0x000000FF 52 | #define CTK_DISPLAY_DEVICE_TV_MASK 0x0000FF00 53 | #define CTK_DISPLAY_DEVICE_DFP_MASK 0x00FF0000 54 | 55 | 56 | typedef struct _CtkWindow CtkWindow; 57 | typedef struct _CtkWindowClass CtkWindowClass; 58 | 59 | struct _CtkWindow 60 | { 61 | GtkWindow parent; 62 | 63 | GtkTreeStore *tree_store; 64 | GtkTreeView *treeview; 65 | 66 | GtkWidget *page_viewer; 67 | GtkWidget *page; 68 | 69 | CtkConfig *ctk_config; 70 | GtkWidget *ctk_help; 71 | 72 | GtkWidget *quit_dialog; 73 | GtkWidget *quit_dialog_pending_label; 74 | 75 | ParsedAttribute *attribute_list; 76 | 77 | GtkTreeIter iter; 78 | GtkWidget *widget; 79 | 80 | GtkTextTagTable *help_tag_table; 81 | GtkTextBuffer *help_text_buffer; 82 | 83 | GtkWidget *display_config_widget; 84 | }; 85 | 86 | struct _CtkWindowClass 87 | { 88 | GtkWindowClass parent_class; 89 | }; 90 | 91 | GType ctk_window_get_type (void) G_GNUC_CONST; 92 | GtkWidget* ctk_window_new (ParsedAttribute *, ConfigProperties *conf, 93 | CtrlSystem *system); 94 | void ctk_window_set_active_page(CtkWindow *ctk_window, 95 | const gchar *label); 96 | 97 | void add_special_config_file_attributes(CtkWindow *ctk_window); 98 | 99 | G_END_DECLS 100 | 101 | #endif /* __CTK_WINDOW_H__ */ 102 | -------------------------------------------------------------------------------- /src/gtk+-2.x/ctkxvideo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | * and Linux systems. 4 | * 5 | * Copyright (C) 2004 NVIDIA Corporation. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms and conditions of the GNU General Public License, 9 | * version 2, as published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | * more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef __CTK_XVIDEO_H__ 21 | #define __CTK_XVIDEO_H__ 22 | 23 | #include "query-assign.h" 24 | #include "ctkconfig.h" 25 | #include "ctkevent.h" 26 | 27 | G_BEGIN_DECLS 28 | 29 | #define CTK_TYPE_XVIDEO (ctk_xvideo_get_type()) 30 | 31 | #define CTK_XVIDEO(obj) \ 32 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), CTK_TYPE_XVIDEO, CtkXVideo)) 33 | 34 | #define CTK_XVIDEO_CLASS(klass) \ 35 | (G_TYPE_CHECK_CLASS_CAST ((klass), CTK_TYPE_XVIDEO, CtkXVideoClass)) 36 | 37 | #define CTK_IS_XVIDEO(obj) \ 38 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CTK_TYPE_XVIDEO)) 39 | 40 | #define CTK_IS_XVIDEO_CLASS(class) \ 41 | (G_TYPE_CHECK_CLASS_TYPE ((klass), CTK_TYPE_XVIDEO)) 42 | 43 | #define CTK_XVIDEO_GET_CLASS(obj) \ 44 | (G_TYPE_INSTANCE_GET_CLASS ((obj), CTK_TYPE_XVIDEO, CtkXVideoClass)) 45 | 46 | 47 | typedef struct _CtkXVideo CtkXVideo; 48 | typedef struct _CtkXVideoClass CtkXVideoClass; 49 | 50 | struct _CtkXVideo 51 | { 52 | GtkVBox parent; 53 | 54 | CtrlTarget *ctrl_target; 55 | CtkConfig *ctk_config; 56 | 57 | GtkWidget *current_xv_sync_to_display_label; 58 | GtkWidget *xv_sync_to_display_buttons; /* first button in group */ 59 | 60 | GtkWidget *xv_sync_to_display_button_box; 61 | unsigned int active_attributes; 62 | }; 63 | 64 | struct _CtkXVideoClass 65 | { 66 | GtkVBoxClass parent_class; 67 | }; 68 | 69 | GType ctk_xvideo_get_type (void) G_GNUC_CONST; 70 | GtkWidget* ctk_xvideo_new (CtrlTarget *ctrl_target, 71 | CtkConfig *ctk_config, CtkEvent *ctk_event); 72 | 73 | GtkTextBuffer *ctk_xvideo_create_help(GtkTextTagTable *, CtkXVideo *); 74 | 75 | G_END_DECLS 76 | 77 | #endif /* __CTK_XVIDEO_H__ */ 78 | 79 | -------------------------------------------------------------------------------- /src/gtk+-2.x/matrix_utils.c: -------------------------------------------------------------------------------- 1 | /* 2 | * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | * and Linux systems. 4 | * 5 | * Copyright (C) 2017 NVIDIA Corporation. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms and conditions of the GNU General Public License, 9 | * version 2, as published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | * more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | #include "matrix_utils.h" 24 | 25 | void matrixMult(float a[16], const float b[16]) 26 | { 27 | int i, j, k; 28 | float aa[16]; 29 | 30 | memcpy(aa, a, sizeof(aa)); 31 | memset(a, 0, 16 * sizeof(float)); 32 | 33 | for (j = 0; j < 4; j++) { 34 | for (i = 0; i < 4; i++) { 35 | for (k = 0; k < 4; k++) { 36 | a[4 * j + i] += aa[4 * j + k] * b[4 * k + i]; 37 | } 38 | } 39 | } 40 | } 41 | 42 | void matrixTranspose(float m[16]) 43 | { 44 | int i, j; 45 | float tmp; 46 | 47 | for (j = 0; j < 4; ++j) { 48 | for (i = 0; i < j; ++i) { 49 | tmp = m[4 * j + i]; 50 | m[4 * j + i] = m[4 * i + j]; 51 | m[4 * i + j] = tmp; 52 | } 53 | } 54 | } 55 | 56 | void genZeroMatrix(float matrix[16]) 57 | { 58 | memset(matrix, 0, 16 * sizeof(float)); 59 | } 60 | 61 | void genIdentityMatrix(float matrix[16]) 62 | { 63 | genZeroMatrix(matrix); 64 | matrix[0] = 1; 65 | matrix[5] = 1; 66 | matrix[10] = 1; 67 | matrix[15] = 1; 68 | } 69 | 70 | void genTranslateMatrix(float x, float y, float z, float matrix[16]) 71 | { 72 | genIdentityMatrix(matrix); 73 | matrix[12] = x; 74 | matrix[13] = y; 75 | matrix[14] = z; 76 | } 77 | 78 | void genRotateMatrixX(float radians, float matrix[16]) 79 | { 80 | genIdentityMatrix(matrix); 81 | matrix[5] = cosf(radians); 82 | matrix[6] = -1 * sinf(radians); 83 | matrix[9] = sinf(radians); 84 | matrix[10] = cosf(radians); 85 | } 86 | 87 | void genRotateMatrixY(float radians, float matrix[16]) 88 | { 89 | genIdentityMatrix(matrix); 90 | matrix[0] = cosf(radians); 91 | matrix[2] = -1 * sinf(radians); 92 | matrix[8] = sinf(radians); 93 | matrix[10] = cosf(radians); 94 | } 95 | 96 | void genRotateMatrixZ(float radians, float matrix[16]) 97 | { 98 | genIdentityMatrix(matrix); 99 | matrix[0] = cosf(radians); 100 | matrix[1] = sinf(radians); 101 | matrix[4] = -1 * sinf(radians); 102 | matrix[5] = cosf(radians); 103 | } 104 | 105 | void genPerspectiveMatrix(float fovY, 106 | float aspect, 107 | float zNear, 108 | float zFar, 109 | float matrix[16]) 110 | { 111 | float f; 112 | 113 | f = 1 / tanf(fovY / 2); 114 | 115 | genZeroMatrix(matrix); 116 | matrix[0] = f / aspect; 117 | matrix[5] = f; 118 | matrix[10] = (zFar + zNear) / (zNear - zFar); 119 | matrix[11] = 2 * zFar * zNear / (zNear - zFar); 120 | matrix[14] = -1; 121 | } 122 | 123 | -------------------------------------------------------------------------------- /src/gtk+-2.x/matrix_utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | * and Linux systems. 4 | * 5 | * Copyright (C) 2017 NVIDIA Corporation. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms and conditions of the GNU General Public License, 9 | * version 2, as published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | * more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef __MATRIX_UTILS_H__ 21 | #define __MATRIX_UTILS_H__ 22 | 23 | void matrixMult(float a[16], const float b[16]); 24 | void matrixTranspose(float m[16]); 25 | 26 | void genZeroMatrix(float matrix[16]); 27 | void genIdentityMatrix(float matrix[16]); 28 | 29 | void genTranslateMatrix(float x, float y, float z, float matrix[16]); 30 | void genRotateMatrixX(float radians, float matrix[16]); 31 | void genRotateMatrixY(float radians, float matrix[16]); 32 | void genRotateMatrixZ(float radians, float matrix[16]); 33 | void genPerspectiveMatrix(float fovY, 34 | float aspect, 35 | float zNear, 36 | float zFar, 37 | float matrix[16]); 38 | 39 | #endif /*__MATRIX_UTILS_H__*/ 40 | -------------------------------------------------------------------------------- /src/gtk+-2.x/opengl_loading.c: -------------------------------------------------------------------------------- 1 | /* 2 | * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | * and Linux systems. 4 | * 5 | * Copyright (C) 2017 NVIDIA Corporation. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms and conditions of the GNU General Public License, 9 | * version 2, as published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | * more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | #include "opengl_loading.h" 24 | 25 | libGLData dGL; 26 | 27 | #define LOAD_GL_FUNCTION(func) \ 28 | dGL.func = dGL.glXGetProcAddress((const GLubyte *) #func); \ 29 | if (dGL.func == NULL) { \ 30 | fprintf(stderr, "Failed to load " #func "\n"); \ 31 | return GL_FALSE; \ 32 | } 33 | 34 | GLboolean loadGL(void) 35 | { 36 | dGL.handle = dlopen("libGL.so.1", RTLD_LAZY); 37 | if (dGL.handle == NULL) { 38 | return GL_FALSE; 39 | } 40 | 41 | dGL.glXGetProcAddress = dlsym(dGL.handle, "glXGetProcAddress"); 42 | if (dGL.glXGetProcAddress == NULL) { 43 | return GL_FALSE; 44 | } 45 | 46 | LOAD_GL_FUNCTION(glGetString) 47 | LOAD_GL_FUNCTION(glGetIntegerv) 48 | LOAD_GL_FUNCTION(glGetStringi) 49 | 50 | LOAD_GL_FUNCTION(glXCreateNewContext) 51 | LOAD_GL_FUNCTION(glXDestroyContext) 52 | LOAD_GL_FUNCTION(glXMakeContextCurrent) 53 | LOAD_GL_FUNCTION(glXSwapBuffers) 54 | LOAD_GL_FUNCTION(glXChooseFBConfig) 55 | LOAD_GL_FUNCTION(glXGetFBConfigAttrib) 56 | LOAD_GL_FUNCTION(glXGetProcAddress) 57 | LOAD_GL_FUNCTION(glXCreateWindow) 58 | LOAD_GL_FUNCTION(glXGetVisualFromFBConfig) 59 | 60 | LOAD_GL_FUNCTION(glBindTexture) 61 | LOAD_GL_FUNCTION(glBlendFunc) 62 | LOAD_GL_FUNCTION(glClear) 63 | LOAD_GL_FUNCTION(glClearColor) 64 | LOAD_GL_FUNCTION(glClearDepth) 65 | LOAD_GL_FUNCTION(glDepthFunc) 66 | LOAD_GL_FUNCTION(glDepthMask) 67 | LOAD_GL_FUNCTION(glDrawArrays) 68 | LOAD_GL_FUNCTION(glDrawBuffer) 69 | LOAD_GL_FUNCTION(glEnable) 70 | LOAD_GL_FUNCTION(glGenTextures) 71 | LOAD_GL_FUNCTION(glGetError) 72 | LOAD_GL_FUNCTION(glPixelStorei) 73 | LOAD_GL_FUNCTION(glTexImage2D) 74 | LOAD_GL_FUNCTION(glTexParameteri) 75 | LOAD_GL_FUNCTION(glViewport) 76 | LOAD_GL_FUNCTION(glAttachShader) 77 | LOAD_GL_FUNCTION(glBindBuffer) 78 | LOAD_GL_FUNCTION(glBindVertexArray) 79 | LOAD_GL_FUNCTION(glBufferData) 80 | LOAD_GL_FUNCTION(glCompileShader) 81 | LOAD_GL_FUNCTION(glCreateProgram) 82 | LOAD_GL_FUNCTION(glCreateShader) 83 | LOAD_GL_FUNCTION(glDeleteShader) 84 | LOAD_GL_FUNCTION(glEnableVertexAttribArray) 85 | LOAD_GL_FUNCTION(glGenBuffers) 86 | LOAD_GL_FUNCTION(glGenVertexArrays) 87 | LOAD_GL_FUNCTION(glGetProgramiv) 88 | LOAD_GL_FUNCTION(glGetShaderInfoLog) 89 | LOAD_GL_FUNCTION(glGetShaderiv) 90 | LOAD_GL_FUNCTION(glLinkProgram) 91 | LOAD_GL_FUNCTION(glShaderSource) 92 | LOAD_GL_FUNCTION(glUniform4f) 93 | LOAD_GL_FUNCTION(glUniformMatrix4fv) 94 | LOAD_GL_FUNCTION(glUseProgram) 95 | LOAD_GL_FUNCTION(glVertexAttribPointer) 96 | LOAD_GL_FUNCTION(glGetUniformLocation) 97 | 98 | return GL_TRUE; 99 | } 100 | 101 | void closeDynamicGL(void) 102 | { 103 | dlclose(dGL.handle); 104 | } 105 | -------------------------------------------------------------------------------- /src/gtk+-2.x/opengl_wrappers.h: -------------------------------------------------------------------------------- 1 | /* 2 | * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | * and Linux systems. 4 | * 5 | * Copyright (C) 2017 NVIDIA Corporation. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms and conditions of the GNU General Public License, 9 | * version 2, as published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | * more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef __OPENGL_WRAPPERS_H__ 21 | #define __OPENGL_WRAPPERS_H__ 22 | 23 | #include "ctkutils.h" 24 | 25 | #ifdef CTK_GTK3 26 | 27 | #include 28 | #include 29 | 30 | typedef struct _uniformVec4f uniformVec4f; 31 | struct _uniformVec4f 32 | { 33 | GLuint index; 34 | float data[4]; 35 | }; 36 | 37 | typedef struct _OpenGLModelData OpenGLModelData; 38 | struct _OpenGLModelData 39 | { 40 | GLuint vao; 41 | int vboLen; 42 | GLuint tex; 43 | GLuint program; 44 | float *mvp; 45 | uniformVec4f *uniforms; 46 | int uniformCount; 47 | }; 48 | 49 | void freeOglmd(OpenGLModelData *p); 50 | 51 | extern char const * const cubeVertexShaderSource[1]; 52 | extern char const * const cubeFragmentShaderSource[1]; 53 | extern char const * const textVertexShaderSource[1]; 54 | extern char const * const textFragmentShaderSource[1]; 55 | 56 | void drawModel(OpenGLModelData *data); 57 | 58 | OpenGLModelData *cubeSetup(GdkPixbuf *image); 59 | 60 | OpenGLModelData *labelSetup(float x, float y, 61 | float width, float height, 62 | float red, float green, float blue, 63 | GdkPixbuf *image); 64 | 65 | #endif 66 | 67 | #endif /*__OPENGL_WRAPPERS_H__*/ 68 | 69 | -------------------------------------------------------------------------------- /src/image_data/antialias.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/nvidia-settings/3dedbdf241e2d2311e1713124e6ed0e8be0c36e0/src/image_data/antialias.png -------------------------------------------------------------------------------- /src/image_data/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/nvidia-settings/3dedbdf241e2d2311e1713124e6ed0e8be0c36e0/src/image_data/background.png -------------------------------------------------------------------------------- /src/image_data/background_tall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/nvidia-settings/3dedbdf241e2d2311e1713124e6ed0e8be0c36e0/src/image_data/background_tall.png -------------------------------------------------------------------------------- /src/image_data/bnc_cable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/nvidia-settings/3dedbdf241e2d2311e1713124e6ed0e8be0c36e0/src/image_data/bnc_cable.png -------------------------------------------------------------------------------- /src/image_data/bsd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/nvidia-settings/3dedbdf241e2d2311e1713124e6ed0e8be0c36e0/src/image_data/bsd.png -------------------------------------------------------------------------------- /src/image_data/clock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/nvidia-settings/3dedbdf241e2d2311e1713124e6ed0e8be0c36e0/src/image_data/clock.png -------------------------------------------------------------------------------- /src/image_data/color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/nvidia-settings/3dedbdf241e2d2311e1713124e6ed0e8be0c36e0/src/image_data/color.png -------------------------------------------------------------------------------- /src/image_data/config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/nvidia-settings/3dedbdf241e2d2311e1713124e6ed0e8be0c36e0/src/image_data/config.png -------------------------------------------------------------------------------- /src/image_data/crt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/nvidia-settings/3dedbdf241e2d2311e1713124e6ed0e8be0c36e0/src/image_data/crt.png -------------------------------------------------------------------------------- /src/image_data/dfp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/nvidia-settings/3dedbdf241e2d2311e1713124e6ed0e8be0c36e0/src/image_data/dfp.png -------------------------------------------------------------------------------- /src/image_data/display_config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/nvidia-settings/3dedbdf241e2d2311e1713124e6ed0e8be0c36e0/src/image_data/display_config.png -------------------------------------------------------------------------------- /src/image_data/framelock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/nvidia-settings/3dedbdf241e2d2311e1713124e6ed0e8be0c36e0/src/image_data/framelock.png -------------------------------------------------------------------------------- /src/image_data/gpu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/nvidia-settings/3dedbdf241e2d2311e1713124e6ed0e8be0c36e0/src/image_data/gpu.png -------------------------------------------------------------------------------- /src/image_data/graphics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/nvidia-settings/3dedbdf241e2d2311e1713124e6ed0e8be0c36e0/src/image_data/graphics.png -------------------------------------------------------------------------------- /src/image_data/help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/nvidia-settings/3dedbdf241e2d2311e1713124e6ed0e8be0c36e0/src/image_data/help.png -------------------------------------------------------------------------------- /src/image_data/led_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/nvidia-settings/3dedbdf241e2d2311e1713124e6ed0e8be0c36e0/src/image_data/led_green.png -------------------------------------------------------------------------------- /src/image_data/led_grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/nvidia-settings/3dedbdf241e2d2311e1713124e6ed0e8be0c36e0/src/image_data/led_grey.png -------------------------------------------------------------------------------- /src/image_data/led_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/nvidia-settings/3dedbdf241e2d2311e1713124e6ed0e8be0c36e0/src/image_data/led_red.png -------------------------------------------------------------------------------- /src/image_data/left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/nvidia-settings/3dedbdf241e2d2311e1713124e6ed0e8be0c36e0/src/image_data/left.png -------------------------------------------------------------------------------- /src/image_data/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/nvidia-settings/3dedbdf241e2d2311e1713124e6ed0e8be0c36e0/src/image_data/logo.png -------------------------------------------------------------------------------- /src/image_data/logo_tall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/nvidia-settings/3dedbdf241e2d2311e1713124e6ed0e8be0c36e0/src/image_data/logo_tall.png -------------------------------------------------------------------------------- /src/image_data/nvidia_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/nvidia-settings/3dedbdf241e2d2311e1713124e6ed0e8be0c36e0/src/image_data/nvidia_icon.png -------------------------------------------------------------------------------- /src/image_data/nvlogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/nvidia-settings/3dedbdf241e2d2311e1713124e6ed0e8be0c36e0/src/image_data/nvlogo.png -------------------------------------------------------------------------------- /src/image_data/opengl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/nvidia-settings/3dedbdf241e2d2311e1713124e6ed0e8be0c36e0/src/image_data/opengl.png -------------------------------------------------------------------------------- /src/image_data/penguin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/nvidia-settings/3dedbdf241e2d2311e1713124e6ed0e8be0c36e0/src/image_data/penguin.png -------------------------------------------------------------------------------- /src/image_data/right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/nvidia-settings/3dedbdf241e2d2311e1713124e6ed0e8be0c36e0/src/image_data/right.png -------------------------------------------------------------------------------- /src/image_data/rj45_input.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/nvidia-settings/3dedbdf241e2d2311e1713124e6ed0e8be0c36e0/src/image_data/rj45_input.png -------------------------------------------------------------------------------- /src/image_data/rj45_output.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/nvidia-settings/3dedbdf241e2d2311e1713124e6ed0e8be0c36e0/src/image_data/rj45_output.png -------------------------------------------------------------------------------- /src/image_data/rj45_unused.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/nvidia-settings/3dedbdf241e2d2311e1713124e6ed0e8be0c36e0/src/image_data/rj45_unused.png -------------------------------------------------------------------------------- /src/image_data/server_licensing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/nvidia-settings/3dedbdf241e2d2311e1713124e6ed0e8be0c36e0/src/image_data/server_licensing.png -------------------------------------------------------------------------------- /src/image_data/slimm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/nvidia-settings/3dedbdf241e2d2311e1713124e6ed0e8be0c36e0/src/image_data/slimm.png -------------------------------------------------------------------------------- /src/image_data/solaris.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/nvidia-settings/3dedbdf241e2d2311e1713124e6ed0e8be0c36e0/src/image_data/solaris.png -------------------------------------------------------------------------------- /src/image_data/svp_3dvp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/nvidia-settings/3dedbdf241e2d2311e1713124e6ed0e8be0c36e0/src/image_data/svp_3dvp.png -------------------------------------------------------------------------------- /src/image_data/thermal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/nvidia-settings/3dedbdf241e2d2311e1713124e6ed0e8be0c36e0/src/image_data/thermal.png -------------------------------------------------------------------------------- /src/image_data/vdpau.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/nvidia-settings/3dedbdf241e2d2311e1713124e6ed0e8be0c36e0/src/image_data/vdpau.png -------------------------------------------------------------------------------- /src/image_data/x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/nvidia-settings/3dedbdf241e2d2311e1713124e6ed0e8be0c36e0/src/image_data/x.png -------------------------------------------------------------------------------- /src/image_data/xvideo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/nvidia-settings/3dedbdf241e2d2311e1713124e6ed0e8be0c36e0/src/image_data/xvideo.png -------------------------------------------------------------------------------- /src/jansson/error.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "jansson_private.h" 3 | 4 | void jsonp_error_init(json_error_t *error, const char *source) 5 | { 6 | if(error) 7 | { 8 | error->text[0] = '\0'; 9 | error->line = -1; 10 | error->column = -1; 11 | error->position = 0; 12 | if(source) 13 | jsonp_error_set_source(error, source); 14 | else 15 | error->source[0] = '\0'; 16 | } 17 | } 18 | 19 | void jsonp_error_set_source(json_error_t *error, const char *source) 20 | { 21 | size_t length; 22 | 23 | if(!error || !source) 24 | return; 25 | 26 | length = strlen(source); 27 | if(length < JSON_ERROR_SOURCE_LENGTH) 28 | strcpy(error->source, source); 29 | else { 30 | size_t extra = length - JSON_ERROR_SOURCE_LENGTH + 4; 31 | memcpy(error->source, "...", 3); 32 | strncpy(error->source + 3, source + extra, length - extra + 1); 33 | } 34 | } 35 | 36 | void jsonp_error_set(json_error_t *error, int line, int column, 37 | size_t position, enum json_error_code code, 38 | const char *msg, ...) 39 | { 40 | va_list ap; 41 | 42 | va_start(ap, msg); 43 | jsonp_error_vset(error, line, column, position, code, msg, ap); 44 | va_end(ap); 45 | } 46 | 47 | void jsonp_error_vset(json_error_t *error, int line, int column, 48 | size_t position, enum json_error_code code, 49 | const char *msg, va_list ap) 50 | { 51 | if(!error) 52 | return; 53 | 54 | if(error->text[0] != '\0') { 55 | /* error already set */ 56 | return; 57 | } 58 | 59 | error->line = line; 60 | error->column = column; 61 | error->position = (int)position; 62 | 63 | vsnprintf(error->text, JSON_ERROR_TEXT_LENGTH - 1, msg, ap); 64 | error->text[JSON_ERROR_TEXT_LENGTH - 2] = '\0'; 65 | error->text[JSON_ERROR_TEXT_LENGTH - 1] = code; 66 | } 67 | -------------------------------------------------------------------------------- /src/jansson/jansson_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2016 Petri Lehtinen 3 | * 4 | * Jansson is free software; you can redistribute it and/or modify 5 | * it under the terms of the MIT license. See LICENSE for details. 6 | * 7 | * 8 | * This file specifies a part of the site-specific configuration for 9 | * Jansson, namely those things that affect the public API in 10 | * jansson.h. 11 | * 12 | * The CMake system will generate the jansson_config.h file and 13 | * copy it to the build and install directories. 14 | */ 15 | 16 | #ifndef JANSSON_CONFIG_H 17 | #define JANSSON_CONFIG_H 18 | 19 | /* Define this so that we can disable scattered automake configuration in source files */ 20 | #ifndef JANSSON_USING_CMAKE 21 | #define JANSSON_USING_CMAKE 22 | #endif 23 | 24 | /* Note: when using cmake, JSON_INTEGER_IS_LONG_LONG is not defined nor used, 25 | * as we will also check for __int64 etc types. 26 | * (the definition was used in the automake system) */ 27 | 28 | /* Bring in the cmake-detected defines */ 29 | #define HAVE_STDINT_H 1 30 | /* #undef HAVE_INTTYPES_H */ 31 | #define HAVE_SYS_TYPES_H 1 32 | 33 | /* Include our standard type header for the integer typedef */ 34 | 35 | #if defined(HAVE_STDINT_H) 36 | # include 37 | #elif defined(HAVE_INTTYPES_H) 38 | # include 39 | #elif defined(HAVE_SYS_TYPES_H) 40 | # include 41 | #endif 42 | 43 | 44 | /* If your compiler supports the inline keyword in C, JSON_INLINE is 45 | defined to `inline', otherwise empty. In C++, the inline is always 46 | supported. */ 47 | #ifdef __cplusplus 48 | #define JSON_INLINE inline 49 | #else 50 | #define JSON_INLINE inline 51 | #endif 52 | 53 | 54 | #define json_int_t long long 55 | #define json_strtoint strtoll 56 | #define JSON_INTEGER_FORMAT "lld" 57 | 58 | 59 | /* If locale.h and localeconv() are available, define to 1, otherwise to 0. */ 60 | #define JSON_HAVE_LOCALECONV 1 61 | 62 | /* If __atomic builtins are available they will be used to manage 63 | reference counts of json_t. */ 64 | #define JSON_HAVE_ATOMIC_BUILTINS 0 65 | 66 | /* If __atomic builtins are not available we try using __sync builtins 67 | to manage reference counts of json_t. */ 68 | #define JSON_HAVE_SYNC_BUILTINS 0 69 | 70 | /* Maximum recursion depth for parsing JSON input. 71 | This limits the depth of e.g. array-within-array constructions. */ 72 | #define JSON_PARSER_MAX_DEPTH 2048 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /src/jansson/jansson_private.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2016 Petri Lehtinen 3 | * 4 | * Jansson is free software; you can redistribute it and/or modify 5 | * it under the terms of the MIT license. See LICENSE for details. 6 | */ 7 | 8 | #ifndef JANSSON_PRIVATE_H 9 | #define JANSSON_PRIVATE_H 10 | 11 | #include "jansson_private_config.h" 12 | #include 13 | #include "jansson.h" 14 | #include "hashtable.h" 15 | #include "strbuffer.h" 16 | 17 | #define container_of(ptr_, type_, member_) \ 18 | ((type_ *)((char *)ptr_ - offsetof(type_, member_))) 19 | 20 | /* On some platforms, max() may already be defined */ 21 | #ifndef max 22 | #define max(a, b) ((a) > (b) ? (a) : (b)) 23 | #endif 24 | 25 | /* va_copy is a C99 feature. In C89 implementations, it's sometimes 26 | available as __va_copy. If not, memcpy() should do the trick. */ 27 | #ifndef va_copy 28 | #ifdef __va_copy 29 | #define va_copy __va_copy 30 | #else 31 | #define va_copy(a, b) memcpy(&(a), &(b), sizeof(va_list)) 32 | #endif 33 | #endif 34 | 35 | typedef struct { 36 | json_t json; 37 | hashtable_t hashtable; 38 | } json_object_t; 39 | 40 | typedef struct { 41 | json_t json; 42 | size_t size; 43 | size_t entries; 44 | json_t **table; 45 | } json_array_t; 46 | 47 | typedef struct { 48 | json_t json; 49 | char *value; 50 | size_t length; 51 | } json_string_t; 52 | 53 | typedef struct { 54 | json_t json; 55 | double value; 56 | } json_real_t; 57 | 58 | typedef struct { 59 | json_t json; 60 | json_int_t value; 61 | } json_integer_t; 62 | 63 | #define json_to_object(json_) container_of(json_, json_object_t, json) 64 | #define json_to_array(json_) container_of(json_, json_array_t, json) 65 | #define json_to_string(json_) container_of(json_, json_string_t, json) 66 | #define json_to_real(json_) container_of(json_, json_real_t, json) 67 | #define json_to_integer(json_) container_of(json_, json_integer_t, json) 68 | 69 | /* Create a string by taking ownership of an existing buffer */ 70 | json_t *jsonp_stringn_nocheck_own(const char *value, size_t len); 71 | 72 | /* Error message formatting */ 73 | void jsonp_error_init(json_error_t *error, const char *source); 74 | void jsonp_error_set_source(json_error_t *error, const char *source); 75 | void jsonp_error_set(json_error_t *error, int line, int column, 76 | size_t position, enum json_error_code code, 77 | const char *msg, ...); 78 | void jsonp_error_vset(json_error_t *error, int line, int column, 79 | size_t position, enum json_error_code code, 80 | const char *msg, va_list ap); 81 | 82 | /* Locale independent string<->double conversions */ 83 | int jsonp_strtod(strbuffer_t *strbuffer, double *out); 84 | int jsonp_dtostr(char *buffer, size_t size, double value, int prec); 85 | 86 | /* Wrappers for custom memory functions */ 87 | void* jsonp_malloc(size_t size) JANSSON_ATTRS(warn_unused_result); 88 | void jsonp_free(void *ptr); 89 | char *jsonp_strndup(const char *str, size_t length) JANSSON_ATTRS(warn_unused_result); 90 | char *jsonp_strdup(const char *str) JANSSON_ATTRS(warn_unused_result); 91 | char *jsonp_strndup(const char *str, size_t len) JANSSON_ATTRS(warn_unused_result); 92 | 93 | 94 | /* Windows compatibility */ 95 | #if defined(_WIN32) || defined(WIN32) 96 | # if defined(_MSC_VER) /* MS compiller */ 97 | # if (_MSC_VER < 1900) && !defined(snprintf) /* snprintf not defined yet & not introduced */ 98 | # define snprintf _snprintf 99 | # endif 100 | # if (_MSC_VER < 1500) && !defined(vsnprintf) /* vsnprintf not defined yet & not introduced */ 101 | # define vsnprintf(b,c,f,a) _vsnprintf(b,c,f,a) 102 | # endif 103 | # else /* Other Windows compiller, old definition */ 104 | # define snprintf _snprintf 105 | # define vsnprintf _vsnprintf 106 | # endif 107 | #endif 108 | 109 | #endif 110 | -------------------------------------------------------------------------------- /src/jansson/jansson_private_config.h: -------------------------------------------------------------------------------- 1 | #if defined(NV_LINUX) 2 | # define HAVE_ENDIAN_H 1 3 | #endif 4 | 5 | /* Prevent value.c from overriding Solaris's builtin isnan() */ 6 | #if defined(NV_SUNOS) && !defined(isnan) 7 | # define isnan isnan 8 | #endif 9 | 10 | #define HAVE_FCNTL_H 1 11 | #define HAVE_SCHED_H 1 12 | #define HAVE_UNISTD_H 1 13 | #define HAVE_SYS_PARAM_H 1 14 | #define HAVE_SYS_STAT_H 1 15 | #define HAVE_SYS_TIME_H 1 16 | #define HAVE_SYS_TYPES_H 1 17 | #define HAVE_STDINT_H 1 18 | 19 | #define HAVE_CLOSE 1 20 | #define HAVE_GETPID 1 21 | #define HAVE_GETTIMEOFDAY 1 22 | #define HAVE_OPEN 1 23 | #define HAVE_READ 1 24 | #define HAVE_SCHED_YIELD 1 25 | 26 | /* #undef HAVE_SYNC_BUILTINS */ 27 | /* #undef HAVE_ATOMIC_BUILTINS */ 28 | 29 | #define HAVE_LOCALE_H 1 30 | #define HAVE_SETLOCALE 1 31 | 32 | #define HAVE_INT32_T 1 33 | #ifndef HAVE_INT32_T 34 | # define int32_t int32_t 35 | #endif 36 | 37 | #define HAVE_UINT32_T 1 38 | #ifndef HAVE_UINT32_T 39 | # define uint32_t uint32_t 40 | #endif 41 | 42 | #define HAVE_UINT16_T 1 43 | #ifndef HAVE_UINT16_T 44 | # define uint16_t uint16_t 45 | #endif 46 | 47 | #define HAVE_UINT8_T 1 48 | #ifndef HAVE_UINT8_T 49 | # define uint8_t uint8_t 50 | #endif 51 | 52 | #define HAVE_SSIZE_T 1 53 | 54 | #ifndef HAVE_SSIZE_T 55 | # define ssize_t 56 | #endif 57 | 58 | #define USE_URANDOM 1 59 | #define USE_WINDOWS_CRYPTOAPI 1 60 | 61 | #define INITIAL_HASHTABLE_ORDER 3 62 | -------------------------------------------------------------------------------- /src/jansson/memory.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2016 Petri Lehtinen 3 | * Copyright (c) 2011-2012 Basile Starynkevitch 4 | * 5 | * Jansson is free software; you can redistribute it and/or modify it 6 | * under the terms of the MIT license. See LICENSE for details. 7 | */ 8 | 9 | #include 10 | #include 11 | 12 | #include "jansson.h" 13 | #include "jansson_private.h" 14 | 15 | /* C89 allows these to be macros */ 16 | #undef malloc 17 | #undef free 18 | 19 | /* memory function pointers */ 20 | static json_malloc_t do_malloc = malloc; 21 | static json_free_t do_free = free; 22 | 23 | void *jsonp_malloc(size_t size) 24 | { 25 | if(!size) 26 | return NULL; 27 | 28 | return (*do_malloc)(size); 29 | } 30 | 31 | void jsonp_free(void *ptr) 32 | { 33 | if(!ptr) 34 | return; 35 | 36 | (*do_free)(ptr); 37 | } 38 | 39 | char *jsonp_strdup(const char *str) 40 | { 41 | return jsonp_strndup(str, strlen(str)); 42 | } 43 | 44 | char *jsonp_strndup(const char *str, size_t len) 45 | { 46 | char *new_str; 47 | 48 | new_str = jsonp_malloc(len + 1); 49 | if(!new_str) 50 | return NULL; 51 | 52 | memcpy(new_str, str, len); 53 | new_str[len] = '\0'; 54 | return new_str; 55 | } 56 | 57 | void json_set_alloc_funcs(json_malloc_t malloc_fn, json_free_t free_fn) 58 | { 59 | do_malloc = malloc_fn; 60 | do_free = free_fn; 61 | } 62 | 63 | void json_get_alloc_funcs(json_malloc_t *malloc_fn, json_free_t *free_fn) 64 | { 65 | if (malloc_fn) 66 | *malloc_fn = do_malloc; 67 | if (free_fn) 68 | *free_fn = do_free; 69 | } 70 | -------------------------------------------------------------------------------- /src/jansson/strbuffer.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2016 Petri Lehtinen 3 | * 4 | * Jansson is free software; you can redistribute it and/or modify 5 | * it under the terms of the MIT license. See LICENSE for details. 6 | */ 7 | 8 | #ifndef _GNU_SOURCE 9 | #define _GNU_SOURCE 10 | #endif 11 | 12 | #include 13 | #include 14 | #include "jansson_private.h" 15 | #include "strbuffer.h" 16 | 17 | #define STRBUFFER_MIN_SIZE 16 18 | #define STRBUFFER_FACTOR 2 19 | #define STRBUFFER_SIZE_MAX ((size_t)-1) 20 | 21 | int strbuffer_init(strbuffer_t *strbuff) 22 | { 23 | strbuff->size = STRBUFFER_MIN_SIZE; 24 | strbuff->length = 0; 25 | 26 | strbuff->value = jsonp_malloc(strbuff->size); 27 | if(!strbuff->value) 28 | return -1; 29 | 30 | /* initialize to empty */ 31 | strbuff->value[0] = '\0'; 32 | return 0; 33 | } 34 | 35 | void strbuffer_close(strbuffer_t *strbuff) 36 | { 37 | if(strbuff->value) 38 | jsonp_free(strbuff->value); 39 | 40 | strbuff->size = 0; 41 | strbuff->length = 0; 42 | strbuff->value = NULL; 43 | } 44 | 45 | void strbuffer_clear(strbuffer_t *strbuff) 46 | { 47 | strbuff->length = 0; 48 | strbuff->value[0] = '\0'; 49 | } 50 | 51 | const char *strbuffer_value(const strbuffer_t *strbuff) 52 | { 53 | return strbuff->value; 54 | } 55 | 56 | char *strbuffer_steal_value(strbuffer_t *strbuff) 57 | { 58 | char *result = strbuff->value; 59 | strbuff->value = NULL; 60 | return result; 61 | } 62 | 63 | int strbuffer_append_byte(strbuffer_t *strbuff, char byte) 64 | { 65 | return strbuffer_append_bytes(strbuff, &byte, 1); 66 | } 67 | 68 | int strbuffer_append_bytes(strbuffer_t *strbuff, const char *data, size_t size) 69 | { 70 | if(size >= strbuff->size - strbuff->length) 71 | { 72 | size_t new_size; 73 | char *new_value; 74 | 75 | /* avoid integer overflow */ 76 | if (strbuff->size > STRBUFFER_SIZE_MAX / STRBUFFER_FACTOR 77 | || size > STRBUFFER_SIZE_MAX - 1 78 | || strbuff->length > STRBUFFER_SIZE_MAX - 1 - size) 79 | return -1; 80 | 81 | new_size = max(strbuff->size * STRBUFFER_FACTOR, 82 | strbuff->length + size + 1); 83 | 84 | new_value = jsonp_malloc(new_size); 85 | if(!new_value) 86 | return -1; 87 | 88 | memcpy(new_value, strbuff->value, strbuff->length); 89 | 90 | jsonp_free(strbuff->value); 91 | strbuff->value = new_value; 92 | strbuff->size = new_size; 93 | } 94 | 95 | memcpy(strbuff->value + strbuff->length, data, size); 96 | strbuff->length += size; 97 | strbuff->value[strbuff->length] = '\0'; 98 | 99 | return 0; 100 | } 101 | 102 | char strbuffer_pop(strbuffer_t *strbuff) 103 | { 104 | if(strbuff->length > 0) { 105 | char c = strbuff->value[--strbuff->length]; 106 | strbuff->value[strbuff->length] = '\0'; 107 | return c; 108 | } 109 | else 110 | return '\0'; 111 | } 112 | -------------------------------------------------------------------------------- /src/jansson/strbuffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2016 Petri Lehtinen 3 | * 4 | * Jansson is free software; you can redistribute it and/or modify 5 | * it under the terms of the MIT license. See LICENSE for details. 6 | */ 7 | 8 | #ifndef STRBUFFER_H 9 | #define STRBUFFER_H 10 | 11 | #include 12 | 13 | typedef struct { 14 | char *value; 15 | size_t length; /* bytes used */ 16 | size_t size; /* bytes allocated */ 17 | } strbuffer_t; 18 | 19 | int strbuffer_init(strbuffer_t *strbuff) JANSSON_ATTRS(warn_unused_result); 20 | void strbuffer_close(strbuffer_t *strbuff); 21 | 22 | void strbuffer_clear(strbuffer_t *strbuff); 23 | 24 | const char *strbuffer_value(const strbuffer_t *strbuff); 25 | 26 | /* Steal the value and close the strbuffer */ 27 | char *strbuffer_steal_value(strbuffer_t *strbuff); 28 | 29 | int strbuffer_append_byte(strbuffer_t *strbuff, char byte); 30 | int strbuffer_append_bytes(strbuffer_t *strbuff, const char *data, size_t size); 31 | 32 | char strbuffer_pop(strbuffer_t *strbuff); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/jansson/strconv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #ifdef __MINGW32__ 7 | #undef __NO_ISOCEXT /* ensure stdlib.h will declare prototypes for mingw own 'strtod' replacement, called '__strtod' */ 8 | #endif 9 | #include "jansson_private.h" 10 | #include "strbuffer.h" 11 | 12 | /* need jansson_private_config.h to get the correct snprintf */ 13 | #ifdef HAVE_CONFIG_H 14 | #include 15 | #endif 16 | 17 | #ifdef __MINGW32__ 18 | #define strtod __strtod 19 | #endif 20 | 21 | #if JSON_HAVE_LOCALECONV 22 | #include 23 | 24 | /* 25 | - This code assumes that the decimal separator is exactly one 26 | character. 27 | 28 | - If setlocale() is called by another thread between the call to 29 | localeconv() and the call to sprintf() or strtod(), the result may 30 | be wrong. setlocale() is not thread-safe and should not be used 31 | this way. Multi-threaded programs should use uselocale() instead. 32 | */ 33 | 34 | static void to_locale(strbuffer_t *strbuffer) 35 | { 36 | const char *point; 37 | char *pos; 38 | 39 | point = localeconv()->decimal_point; 40 | if(*point == '.') { 41 | /* No conversion needed */ 42 | return; 43 | } 44 | 45 | pos = strchr(strbuffer->value, '.'); 46 | if(pos) 47 | *pos = *point; 48 | } 49 | 50 | static void from_locale(char *buffer) 51 | { 52 | const char *point; 53 | char *pos; 54 | 55 | point = localeconv()->decimal_point; 56 | if(*point == '.') { 57 | /* No conversion needed */ 58 | return; 59 | } 60 | 61 | pos = strchr(buffer, *point); 62 | if(pos) 63 | *pos = '.'; 64 | } 65 | #endif 66 | 67 | int jsonp_strtod(strbuffer_t *strbuffer, double *out) 68 | { 69 | double value; 70 | char *end; 71 | 72 | #if JSON_HAVE_LOCALECONV 73 | to_locale(strbuffer); 74 | #endif 75 | 76 | errno = 0; 77 | value = strtod(strbuffer->value, &end); 78 | assert(end == strbuffer->value + strbuffer->length); 79 | 80 | if((value == __builtin_huge_val() || value == -__builtin_huge_val()) && errno == ERANGE) { 81 | /* Overflow */ 82 | return -1; 83 | } 84 | 85 | *out = value; 86 | return 0; 87 | } 88 | 89 | int jsonp_dtostr(char *buffer, size_t size, double value, int precision) 90 | { 91 | int ret; 92 | char *start, *end; 93 | size_t length; 94 | 95 | if (precision == 0) 96 | precision = 17; 97 | 98 | ret = snprintf(buffer, size, "%.*g", precision, value); 99 | if(ret < 0) 100 | return -1; 101 | 102 | length = (size_t)ret; 103 | if(length >= size) 104 | return -1; 105 | 106 | #if JSON_HAVE_LOCALECONV 107 | from_locale(buffer); 108 | #endif 109 | 110 | /* Make sure there's a dot or 'e' in the output. Otherwise 111 | a real is converted to an integer when decoding */ 112 | if(strchr(buffer, '.') == NULL && 113 | strchr(buffer, 'e') == NULL) 114 | { 115 | if(length + 3 >= size) { 116 | /* No space to append ".0" */ 117 | return -1; 118 | } 119 | buffer[length] = '.'; 120 | buffer[length + 1] = '0'; 121 | buffer[length + 2] = '\0'; 122 | length += 2; 123 | } 124 | 125 | /* Remove leading '+' from positive exponent. Also remove leading 126 | zeros from exponents (added by some printf() implementations) */ 127 | start = strchr(buffer, 'e'); 128 | if(start) { 129 | start++; 130 | end = start + 1; 131 | 132 | if(*start == '-') 133 | start++; 134 | 135 | while(*end == '0') 136 | end++; 137 | 138 | if(end != start) { 139 | memmove(start, end, length - (size_t)(end - buffer)); 140 | length -= (size_t)(end - start); 141 | } 142 | } 143 | 144 | return (int)length; 145 | } 146 | -------------------------------------------------------------------------------- /src/jansson/utf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2016 Petri Lehtinen 3 | * 4 | * Jansson is free software; you can redistribute it and/or modify 5 | * it under the terms of the MIT license. See LICENSE for details. 6 | */ 7 | 8 | #ifndef UTF_H 9 | #define UTF_H 10 | 11 | #ifdef HAVE_CONFIG_H 12 | #include 13 | #endif 14 | 15 | #ifdef HAVE_STDINT_H 16 | #include 17 | #endif 18 | 19 | int utf8_encode(int32_t codepoint, char *buffer, size_t *size); 20 | 21 | size_t utf8_check_first(char byte); 22 | size_t utf8_check_full(const char *buffer, size_t size, int32_t *codepoint); 23 | const char *utf8_iterate(const char *buffer, size_t size, int32_t *codepoint); 24 | 25 | int utf8_check_string(const char *string, size_t length); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /src/libXNVCtrl/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2008 NVIDIA, Corporation 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a copy 4 | # of this software and associated documentation files (the "Software"), to deal 5 | # in the Software without restriction, including without limitation the rights 6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | # copies of the Software, and to permit persons to whom the Software is 8 | # furnished to do so, subject to the following conditions: 9 | # 10 | # The above copyright notice and this permission notice (including the next 11 | # paragraph) shall be included in all copies or substantial portions of the 12 | # Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | # SOFTWARE. 21 | 22 | 23 | ############################################################################## 24 | # include common variables and functions 25 | ############################################################################## 26 | 27 | UTILS_MK_DIR ?= . 28 | 29 | include $(UTILS_MK_DIR)/utils.mk 30 | 31 | XNVCTRL_DIR ?= . 32 | include $(XNVCTRL_DIR)/xnvctrl.mk 33 | 34 | 35 | ############################################################################## 36 | # assign variables 37 | ############################################################################## 38 | 39 | CFLAGS += $(XNVCTRL_CFLAGS) 40 | CFLAGS += -I . 41 | CFLAGS += -fPIC 42 | CFLAGS += -I $(OUTPUTDIR) 43 | CFLAGS += -I $(XNVCTRL_DIR) 44 | 45 | LDFLAGS += $(XNVCTRL_LDFLAGS) 46 | 47 | ############################################################################## 48 | # build rules 49 | ############################################################################## 50 | 51 | .PHONY: all 52 | all: $(LIBXNVCTRL) 53 | 54 | .PHONY: clean 55 | clean: 56 | rm -rf $(LIBXNVCTRL) *~ \ 57 | $(OUTPUTDIR)/*.o $(OUTPUTDIR)/*.d 58 | -------------------------------------------------------------------------------- /src/libXNVCtrl/version.mk: -------------------------------------------------------------------------------- 1 | NVIDIA_VERSION = 575.57.08 2 | NVIDIA_NVID_VERSION = 575.57.08 3 | NVIDIA_NVID_EXTRA = 4 | 5 | # This file. 6 | VERSION_MK_FILE := $(lastword $(MAKEFILE_LIST)) 7 | $(OUTPUTDIR)/version.h: $(VERSION_MK_FILE) 8 | @$(MKDIR) $(OUTPUTDIR) 9 | @$(ECHO) '#define NVIDIA_VERSION "$(NVIDIA_VERSION)"' > $@ 10 | 11 | NV_GENERATED_HEADERS += $(OUTPUTDIR)/version.h 12 | -------------------------------------------------------------------------------- /src/libXNVCtrl/xnvctrl.mk: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2008-2019 NVIDIA, Corporation 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a copy 4 | # of this software and associated documentation files (the "Software"), to deal 5 | # in the Software without restriction, including without limitation the rights 6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | # copies of the Software, and to permit persons to whom the Software is 8 | # furnished to do so, subject to the following conditions: 9 | # 10 | # The above copyright notice and this permission notice (including the next 11 | # paragraph) shall be included in all copies or substantial portions of the 12 | # Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | # SOFTWARE. 21 | 22 | ############################################################################## 23 | # makefile fragment to define how to build LIBXNVCTRL 24 | ############################################################################## 25 | 26 | # The calling Makefile may export any of the following variables; we 27 | # assign default values if they are not exported by the caller 28 | 29 | ifndef XNVCTRL_LDFLAGS 30 | XNVCTRL_LDFLAGS := $(shell $(PKG_CONFIG) --libs x11) 31 | endif 32 | 33 | ifndef XNVCTRL_CFLAGS 34 | XNVCTRL_CFLAGS := $(shell $(PKG_CONFIG) --cflags x11) 35 | endif 36 | 37 | LIBXNVCTRL = $(OUTPUTDIR)/libXNVCtrl.a 38 | 39 | LIBXNVCTRL_SRC = $(XNVCTRL_DIR)/NVCtrl.c 40 | 41 | LIBXNVCTRL_OBJ = $(call BUILD_OBJECT_LIST,$(LIBXNVCTRL_SRC)) 42 | 43 | $(eval $(call DEFINE_OBJECT_RULE,TARGET,$(LIBXNVCTRL_SRC))) 44 | 45 | $(LIBXNVCTRL) : $(LIBXNVCTRL_OBJ) 46 | $(call quiet_cmd,AR) ru $@ $(LIBXNVCTRL_OBJ) 47 | -------------------------------------------------------------------------------- /src/lscf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | * and Linux systems. 4 | * 5 | * Copyright (C) 2004 NVIDIA Corporation. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms and conditions of the GNU General Public License, 9 | * version 2, as published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | * more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef __LSCF_H__ 21 | #define __LSCF_H__ 22 | 23 | /* lscf.c */ 24 | int update_scf_depth(int depth); 25 | 26 | #endif /* __LSCF_H__ */ 27 | -------------------------------------------------------------------------------- /src/nv_grid_dbus.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017-2023 NVIDIA Corporation. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it 5 | * under the terms and conditions of the GNU General Public License, 6 | * version 2, as published by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but WITHOUT 9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 11 | * more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | * 16 | * nv_grid_dbus.h 17 | */ 18 | 19 | #ifndef _NVIDIA_NV_GRID_DBUS_H_ 20 | #define _NVIDIA_NV_GRID_DBUS_H_ 21 | 22 | /* 23 | * Details to communicate with vGPU licensing daemon using dbus mechanism 24 | */ 25 | #define NV_GRID_DBUS_CLIENT "nvidia.grid.client" 26 | #define NV_GRID_DBUS_TARGET "nvidia.grid.server" 27 | #define NV_GRID_DBUS_OBJECT "/nvidia/grid/license" 28 | #define NV_GRID_DBUS_INTERFACE "nvidia.grid.license" 29 | #define NV_GRID_DBUS_METHOD "GridLicenseState" 30 | #define LICENSE_DETAILS_UPDATE_SUCCESS 0 31 | #define LICENSE_STATE_REQUEST 1 32 | #define LICENSE_DETAILS_UPDATE_REQUEST 2 33 | #define LICENSE_FEATURE_TYPE_REQUEST 3 34 | #define LICENSE_SERVER_PORT_REQUEST 4 35 | #define PRIMARY_SERVER_ADDRESS "PrimaryServerAddress" 36 | #define SECONDARY_SERVER_ADDRESS "SecondaryServerAddress" 37 | #define SERVER_DETAILS_NOT_CONFIGURED "Not Configured" 38 | 39 | /* 40 | * vGPU software license states 41 | */ 42 | typedef enum 43 | { 44 | NV_GRID_UNLICENSED = 0, 45 | NV_GRID_LICENSE_REQUESTING, 46 | NV_GRID_LICENSE_FAILED, 47 | NV_GRID_LICENSED, 48 | NV_GRID_LICENSE_RENEWING, 49 | NV_GRID_LICENSE_RENEW_FAILED, 50 | NV_GRID_LICENSE_EXPIRED, 51 | } gridLicenseState; 52 | 53 | /* 54 | * vGPU software license feature types 55 | */ 56 | typedef enum 57 | { 58 | NV_GRID_LICENSE_FEATURE_TYPE_VAPP = 0, 59 | NV_GRID_LICENSE_FEATURE_TYPE_VGPU, 60 | NV_GRID_LICENSE_FEATURE_TYPE_VWS, 61 | NV_GRID_LICENSE_FEATURE_TYPE_VCOMPUTE = 4, 62 | } gridLicenseFeatureType; 63 | 64 | #endif // _NVIDIA_NV_GRID_DBUS_H_ 65 | -------------------------------------------------------------------------------- /src/query-assign.h: -------------------------------------------------------------------------------- 1 | /* 2 | * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix 3 | * and Linux systems. 4 | * 5 | * Copyright (C) 2004 NVIDIA Corporation. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms and conditions of the GNU General Public License, 9 | * version 2, as published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | * more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | /* 21 | * query-assign.h - prototypes for querying and assigning 22 | * attribute values. 23 | */ 24 | 25 | #ifndef __QUERY_ASSIGN_H__ 26 | #define __QUERY_ASSIGN_H__ 27 | 28 | #include "NvCtrlAttributes.h" 29 | 30 | #include "parse.h" 31 | #include "command-line.h" 32 | 33 | 34 | int nv_process_assignments_and_queries(const Options *op, 35 | CtrlSystemList *systems); 36 | 37 | int nv_process_parsed_attribute(const Options *op, 38 | ParsedAttribute*, CtrlSystem *system, 39 | int, int, char*, ...) NV_ATTRIBUTE_PRINTF(6, 7); 40 | 41 | 42 | 43 | #endif /* __QUERY_ASSIGN_H__ */ 44 | -------------------------------------------------------------------------------- /src/version.mk: -------------------------------------------------------------------------------- 1 | NVIDIA_VERSION = 575.57.08 2 | NVIDIA_NVID_VERSION = 575.57.08 3 | NVIDIA_NVID_EXTRA = 4 | 5 | # This file. 6 | VERSION_MK_FILE := $(lastword $(MAKEFILE_LIST)) 7 | $(OUTPUTDIR)/version.h: $(VERSION_MK_FILE) 8 | @$(MKDIR) $(OUTPUTDIR) 9 | @$(ECHO) '#define NVIDIA_VERSION "$(NVIDIA_VERSION)"' > $@ 10 | 11 | NV_GENERATED_HEADERS += $(OUTPUTDIR)/version.h 12 | -------------------------------------------------------------------------------- /src/wayland-connector.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAYLAND_CONNECTOR__ 2 | #define __WAYLAND_CONNECTOR__ 3 | 4 | typedef struct _wayland_output_info { 5 | struct wl_output *output; 6 | struct wl_display *display; 7 | struct _wayland_output_info *next; 8 | 9 | int name, version; 10 | int x, y, pw, ph, subpx, scale; 11 | const char *make, *model, *transform_name; 12 | int mode_width, mode_height, mode_refresh; 13 | unsigned int mode_flags; 14 | int is_current_mode; 15 | } wayland_output_info; 16 | 17 | typedef struct _wayland_data { 18 | struct wl_registry *registry; 19 | wayland_output_info *output; 20 | struct _wayland_lib *wayland_lib_data; 21 | } wayland_data; 22 | 23 | typedef struct _wayland_lib 24 | { 25 | void *lib_handle; 26 | char *error_msg; 27 | 28 | wayland_output_info *(*fn_get_wayland_output_info)(void); 29 | void *(*fn_get_wayland_display)(void); 30 | } wayland_lib; 31 | 32 | wayland_output_info *get_wayland_output_info(void); 33 | void *get_wayland_display(void); 34 | 35 | int wconn_wayland_handle_loaded(void); 36 | void *wconn_get_wayland_display(void); 37 | void *wconn_get_wayland_output_info(void); 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/xpm_data/blue_xpm.h: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * blue_xpm[] = { 3 | "16 16 5 1", 4 | " c black", 5 | ". c navy", 6 | "X c blue", 7 | "o c cyan", 8 | "O c None", 9 | "OOOOOOOOOOOOOOOO", 10 | "OOOOOOO.OOOOOOOO", 11 | "OOOOOO.X OOOOOOO", 12 | "OOOOO.oXX OOOOOO", 13 | "OOOO.ooXXX OOOOO", 14 | "OOO.oooXXXX OOOO", 15 | "OO.ooooXXXXX OOO", 16 | "O.XXXXX...... OO", 17 | "OO.XXXX..... OOO", 18 | "OOO.XXX.... OOOO", 19 | "OOOO.XX... OOOOO", 20 | "OOOOO.X.. OOOOOO", 21 | "OOOOOO.. OOOOOOO", 22 | "OOOOOOO OOOOOOOO", 23 | "OOOOOOOOOOOOOOOO", 24 | "OOOOOOOOOOOOOOOO" 25 | }; 26 | -------------------------------------------------------------------------------- /src/xpm_data/green_xpm.h: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * green_xpm[] = { 3 | "16 16 5 1", 4 | " c black", 5 | ". c #008000", 6 | "X c green", 7 | "o c white", 8 | "O c None", 9 | "OOOOOOOOOOOOOOOO", 10 | "OOOOOOO.OOOOOOOO", 11 | "OOOOOO.X OOOOOOO", 12 | "OOOOO.oXX OOOOOO", 13 | "OOOO.ooXXX OOOOO", 14 | "OOO.oooXXXX OOOO", 15 | "OO.ooooXXXXX OOO", 16 | "O.XXXXXX..... OO", 17 | "OO.XXXX..... OOO", 18 | "OOO.XXX.... OOOO", 19 | "OOOO.XX... OOOOO", 20 | "OOOOO.X.. OOOOOO", 21 | "OOOOOO.. OOOOOOO", 22 | "OOOOOOO OOOOOOOO", 23 | "OOOOOOOOOOOOOOOO", 24 | "OOOOOOOOOOOOOOOO" 25 | }; 26 | -------------------------------------------------------------------------------- /src/xpm_data/red_xpm.h: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * red_xpm[] = { 3 | "16 16 5 1", 4 | " c black", 5 | ". c #800000", 6 | "X c red", 7 | "o c white", 8 | "O c None", 9 | "OOOOOOOOOOOOOOOO", 10 | "OOOOOOO.OOOOOOOO", 11 | "OOOOOO.X OOOOOOO", 12 | "OOOOO.oXX OOOOOO", 13 | "OOOO.ooXXX OOOOO", 14 | "OOO.oooXXXX OOOO", 15 | "OO.ooooXXXXX OOO", 16 | "O.XXXXX...... OO", 17 | "OO.XXXX..... OOO", 18 | "OOO.XXX.... OOOO", 19 | "OOOO.XX... OOOOO", 20 | "OOOOO.X.. OOOOOO", 21 | "OOOOOO.. OOOOOOO", 22 | "OOOOOOO OOOOOOOO", 23 | "OOOOOOOOOOOOOOOO", 24 | "OOOOOOOOOOOOOOOO" 25 | }; 26 | -------------------------------------------------------------------------------- /src/xpm_data/rgb_xpm.h: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char *rgb_xpm[] = { 3 | "16 16 10 1", 4 | " c black", 5 | ". c navy", 6 | "X c blue", 7 | "o c #008000", 8 | "O c green", 9 | "+ c cyan", 10 | "@ c #800000", 11 | "# c red", 12 | "$ c white", 13 | "% c None", 14 | "%%%%%%%%%%%%%%%%", 15 | "%%%@ %%%%%%. %%%", 16 | "%%@$# %%%%.+X %%", 17 | "%@$$## %%.++XX %", 18 | "@$$$### .+++XXX ", 19 | "@###@@@ .XXX... ", 20 | "%@##@@ o .XX.. %", 21 | "%%@#@ o$O .X. %%", 22 | "%%%@ o$$OO . %%%", 23 | "%%%%o$$$OOO %%%%", 24 | "%%%%oOOOooo %%%%", 25 | "%%%%%oOOoo %%%%%", 26 | "%%%%%%oOo %%%%%%", 27 | "%%%%%%%o %%%%%%%", 28 | "%%%%%%%%%%%%%%%%", 29 | "%%%%%%%%%%%%%%%%" 30 | }; 31 | -------------------------------------------------------------------------------- /src/xpm_data/svp_battery_0.h: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * svp_battery_0_xpm[] = { 3 | "16 16 4 1", 4 | " c None", 5 | ". c #73BA00", 6 | "+ c #424542", 7 | "@ c #636163", 8 | " .... ", 9 | " .......... ", 10 | " .++++++++. ", 11 | " .+@@@@@@+. ", 12 | " .+@@@@@@+. ", 13 | " .++++++++. ", 14 | " .+@@@@@@+. ", 15 | " .+@@@@@@+. ", 16 | " .++++++++. ", 17 | " .+@@@@@@+. ", 18 | " .+@@@@@@+. ", 19 | " .++++++++. ", 20 | " .+@@@@@@+. ", 21 | " .+@@@@@@+. ", 22 | " .++++++++. ", 23 | " .......... "}; 24 | -------------------------------------------------------------------------------- /src/xpm_data/svp_battery_100.h: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * svp_battery_100_xpm[] = { 3 | "16 16 3 1", 4 | " c None", 5 | ". c #73BA00", 6 | "+ c #424542", 7 | " .... ", 8 | " .......... ", 9 | " .++++++++. ", 10 | " .+......+. ", 11 | " .+......+. ", 12 | " .++++++++. ", 13 | " .+......+. ", 14 | " .+......+. ", 15 | " .++++++++. ", 16 | " .+......+. ", 17 | " .+......+. ", 18 | " .++++++++. ", 19 | " .+......+. ", 20 | " .+......+. ", 21 | " .++++++++. ", 22 | " .......... "}; 23 | -------------------------------------------------------------------------------- /src/xpm_data/svp_battery_25.h: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * svp_battery_25_xpm[] = { 3 | "16 16 4 1", 4 | " c None", 5 | ". c #73BA00", 6 | "+ c #424542", 7 | "@ c #636163", 8 | " .... ", 9 | " .......... ", 10 | " .++++++++. ", 11 | " .+@@@@@@+. ", 12 | " .+@@@@@@+. ", 13 | " .++++++++. ", 14 | " .+@@@@@@+. ", 15 | " .+@@@@@@+. ", 16 | " .++++++++. ", 17 | " .+@@@@@@+. ", 18 | " .+@@@@@@+. ", 19 | " .++++++++. ", 20 | " .+......+. ", 21 | " .+......+. ", 22 | " .++++++++. ", 23 | " .......... "}; 24 | -------------------------------------------------------------------------------- /src/xpm_data/svp_battery_50.h: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * svp_battery_50_xpm[] = { 3 | "16 16 4 1", 4 | " c None", 5 | ". c #73BA00", 6 | "+ c #424542", 7 | "@ c #636163", 8 | " .... ", 9 | " .......... ", 10 | " .++++++++. ", 11 | " .+@@@@@@+. ", 12 | " .+@@@@@@+. ", 13 | " .++++++++. ", 14 | " .+@@@@@@+. ", 15 | " .+@@@@@@+. ", 16 | " .++++++++. ", 17 | " .+......+. ", 18 | " .+......+. ", 19 | " .++++++++. ", 20 | " .+......+. ", 21 | " .+......+. ", 22 | " .++++++++. ", 23 | " .......... "}; 24 | -------------------------------------------------------------------------------- /src/xpm_data/svp_battery_75.h: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * svp_battery_75_xpm[] = { 3 | "16 16 4 1", 4 | " c None", 5 | ". c #73BA00", 6 | "+ c #424542", 7 | "@ c #636163", 8 | " .... ", 9 | " .......... ", 10 | " .++++++++. ", 11 | " .+@@@@@@+. ", 12 | " .+@@@@@@+. ", 13 | " .++++++++. ", 14 | " .+......+. ", 15 | " .+......+. ", 16 | " .++++++++. ", 17 | " .+......+. ", 18 | " .+......+. ", 19 | " .++++++++. ", 20 | " .+......+. ", 21 | " .+......+. ", 22 | " .++++++++. ", 23 | " .......... "}; 24 | -------------------------------------------------------------------------------- /src/xpm_data/svp_status_excellent.h: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * svp_status_excellent_xpm[] = { 3 | "24 16 18 1", 4 | " c None", 5 | ". c #73BA00", 6 | "+ c #73B600", 7 | "@ c #73B200", 8 | "# c #73AE00", 9 | "$ c #6BAE00", 10 | "% c #6BAA00", 11 | "& c #6BA600", 12 | "* c #6BA200", 13 | "= c #6BB200", 14 | "- c #63A200", 15 | "; c #639E00", 16 | "> c #639A00", 17 | ", c #639600", 18 | "' c #5A9600", 19 | ") c #5A9200", 20 | "! c #5A8E00", 21 | "~ c #5A8A00", 22 | " ..++", 23 | " .++@", 24 | " ++@#", 25 | " ...+ @@$$", 26 | " ..++ @$%%", 27 | " ++@@ %%&*", 28 | " ...+ +@=$ %&-;", 29 | " ..++ @$$% --;>", 30 | " .++@ $%%& ;;>,", 31 | " .... +@@$ %&&- >>')", 32 | " ...+ @@$% &-;; ,))!", 33 | " .++@ $%%& -;>, ))!!", 34 | ".... ++@= %&&- ;>,' !!!~", 35 | "...+ @@$$ &--; ,')) !~~~", 36 | ".+++ @$%% -;;> ')!! ~~~~", 37 | "++@@ %%&* ;>,' )!!~ ~~~~"}; 38 | -------------------------------------------------------------------------------- /src/xpm_data/svp_status_good.h: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * svp_status_good_xpm[] = { 3 | "24 16 15 1", 4 | " c None", 5 | ". c #CECFCE", 6 | "+ c #73BA00", 7 | "@ c #73B600", 8 | "# c #73B200", 9 | "$ c #6BAE00", 10 | "% c #6BAA00", 11 | "& c #6BA600", 12 | "* c #6BB200", 13 | "= c #63A200", 14 | "- c #639E00", 15 | "; c #639A00", 16 | "> c #6BA200", 17 | ", c #639600", 18 | "' c #5A9600", 19 | " ....", 20 | " ....", 21 | " ....", 22 | " .... ....", 23 | " .... ....", 24 | " .... ....", 25 | " +++@ .... ....", 26 | " ++@@ .... ....", 27 | " +@@# .... ....", 28 | " ++++ @##$ .... ....", 29 | " +++@ ##$% .... ....", 30 | " +@@# $%%& .... ....", 31 | "++++ @@#* %&&= .... ....", 32 | "+++@ ##$$ &==- .... ....", 33 | "+@@@ #$%% =--; .... ....", 34 | "@@## %%&> -;,' .... ...."}; 35 | -------------------------------------------------------------------------------- /src/xpm_data/svp_status_low.h: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * svp_status_low_xpm[] = { 3 | "24 16 10 1", 4 | " c None", 5 | ". c #CECFCE", 6 | "+ c #73BA00", 7 | "@ c #73B600", 8 | "# c #73B200", 9 | "$ c #6BB200", 10 | "% c #6BAE00", 11 | "& c #6BAA00", 12 | "* c #6BA600", 13 | "= c #6BA200", 14 | " ....", 15 | " ....", 16 | " ....", 17 | " .... ....", 18 | " .... ....", 19 | " .... ....", 20 | " .... .... ....", 21 | " .... .... ....", 22 | " .... .... ....", 23 | " ++++ .... .... ....", 24 | " +++@ .... .... ....", 25 | " +@@# .... .... ....", 26 | "++++ @@#$ .... .... ....", 27 | "+++@ ##%% .... .... ....", 28 | "+@@@ #%&& .... .... ....", 29 | "@@## &&*= .... .... ...."}; 30 | -------------------------------------------------------------------------------- /src/xpm_data/svp_status_nosignal.h: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * svp_status_nosignal_xpm[] = { 3 | "24 16 2 1", 4 | " c None", 5 | ". c #CECFCE", 6 | " ....", 7 | " ....", 8 | " ....", 9 | " .... ....", 10 | " .... ....", 11 | " .... ....", 12 | " .... .... ....", 13 | " .... .... ....", 14 | " .... .... ....", 15 | " .... .... .... ....", 16 | " .... .... .... ....", 17 | " .... .... .... ....", 18 | ".... .... .... .... ....", 19 | ".... .... .... .... ....", 20 | ".... .... .... .... ....", 21 | ".... .... .... .... ...."}; 22 | -------------------------------------------------------------------------------- /src/xpm_data/svp_status_verygood.h: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * svp_status_verygood_xpm[] = { 3 | "24 16 18 1", 4 | " c None", 5 | ". c #CECFCE", 6 | "+ c #73BA00", 7 | "@ c #73B600", 8 | "# c #73B200", 9 | "$ c #6BB200", 10 | "% c #6BAE00", 11 | "& c #6BAA00", 12 | "* c #6BA600", 13 | "= c #63A200", 14 | "- c #639E00", 15 | "; c #639A00", 16 | "> c #639600", 17 | ", c #5A9600", 18 | "' c #5A9200", 19 | ") c #5A8E00", 20 | "! c #6BA200", 21 | "~ c #5A8A00", 22 | " ....", 23 | " ....", 24 | " ....", 25 | " +++@ ....", 26 | " ++@@ ....", 27 | " @@## ....", 28 | " +++@ @#$% ....", 29 | " ++@@ #%%& ....", 30 | " +@@# %&&* ....", 31 | " ++++ @##% &**= ....", 32 | " +++@ ##%& *=-- ....", 33 | " +@@# %&&* =-;> ....", 34 | "++++ @@#$ &**= -;>, ....", 35 | "+++@ ##%% *==- >,'' ....", 36 | "+@@@ #%&& =--; ,')) ....", 37 | "@@## &&*! -;>, '))~ ...."}; 38 | -------------------------------------------------------------------------------- /src/xpm_data/svp_status_verylow.h: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * svp_status_verylow_xpm[] = { 3 | "24 16 5 1", 4 | " c None", 5 | ". c #CECFCE", 6 | "+ c #73BA00", 7 | "@ c #73B600", 8 | "# c #73B200", 9 | " ....", 10 | " ....", 11 | " ....", 12 | " .... ....", 13 | " .... ....", 14 | " .... ....", 15 | " .... .... ....", 16 | " .... .... ....", 17 | " .... .... ....", 18 | " .... .... .... ....", 19 | " .... .... .... ....", 20 | " .... .... .... ....", 21 | "++++ .... .... .... ....", 22 | "+++@ .... .... .... ....", 23 | "+@@@ .... .... .... ....", 24 | "@@## .... .... .... ...."}; 25 | -------------------------------------------------------------------------------- /version.mk: -------------------------------------------------------------------------------- 1 | NVIDIA_VERSION = 575.57.08 2 | NVIDIA_NVID_VERSION = 575.57.08 3 | NVIDIA_NVID_EXTRA = 4 | 5 | # This file. 6 | VERSION_MK_FILE := $(lastword $(MAKEFILE_LIST)) 7 | $(OUTPUTDIR)/version.h: $(VERSION_MK_FILE) 8 | @$(MKDIR) $(OUTPUTDIR) 9 | @$(ECHO) '#define NVIDIA_VERSION "$(NVIDIA_VERSION)"' > $@ 10 | 11 | NV_GENERATED_HEADERS += $(OUTPUTDIR)/version.h 12 | --------------------------------------------------------------------------------