2
* nvidia-settings: A tool for configuring the NVIDIA X driver on Unix
5
* Copyright (C) 2004 NVIDIA Corporation.
7
* This program is free software; you can redistribute it and/or
8
* modify it under the terms of Version 2 of the GNU General Public
9
* License as published by the Free Software Foundation.
11
* This program is distributed in the hope that it will be useful, but
12
* WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2
14
* of the GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the:
19
* Free Software Foundation, Inc.
20
* 59 Temple Place - Suite 330
21
* Boston, MA 02111-1307, USA
25
#include "NvCtrlAttributes.h"
27
#include "command-line.h"
28
#include "config-file.h"
29
#include "query-assign.h"
37
int main(int argc, char **argv)
39
ConfigProperties conf;
48
* XXX it would be nice if we didn't do this up front, since we
49
* may not even use the gui, but we want the toolkit to have a
50
* chance to parse the commandline before we do... we should
51
* investigate gtk_init_check().
54
ctk_init(&argc, &argv);
56
/* parse the commandline */
58
op = parse_command_line(argc, argv, ctk_get_display());
60
/* process any query or assignment commandline options */
62
if (op->num_assignments || op->num_queries) {
63
ret = nv_process_assignments_and_queries(op);
67
/* initialize the parsed attribute list */
69
p = nv_parsed_attribute_init();
71
/* upload the data from the config file */
73
ret = nv_read_config_file(op->config, op->ctrl_display, p, &conf);
76
* if the user requested that we only load the config file, then
84
/* allocate the CtrlHandles for this X screen */
86
h = nv_alloc_ctrl_handles(op->ctrl_display);
92
/* pass control to the gui */
94
ctk_main(h->h, h->num_screens, p, &conf);
96
/* write the configuration file */
98
nv_write_config_file(op->config, h, p, &conf);
102
nv_free_ctrl_handles(h);
103
nv_parsed_attribute_free(p);