View | Details | Raw Unified
Collapse All | Expand All

(-) nvidia-settings-1.0/src/gtk+-2.x/ctkui.c (+5 lines)
 Lines 37-42    Link Here 
    gtk_init(argc, argv);
    gtk_init(argc, argv);
}
}
gboolean ctk_init_check(int *argc, char **argv[])
{
    return gtk_init_check(argc, argv);
}
char *ctk_get_display(void)
char *ctk_get_display(void)
{
{
    return gdk_get_display();
    return gdk_get_display();
(-) nvidia-settings-1.0/src/gtk+-2.x/ctkui.h (+3 lines)
 Lines 28-36    Link Here 
#include "NvCtrlAttributes.h"
#include "NvCtrlAttributes.h"
#include "parse.h"
#include "parse.h"
#include "config-file.h"
#include "config-file.h"
#include <gtk/gtk.h>
void ctk_init(int *argc, char **argv[]);
void ctk_init(int *argc, char **argv[]);
gboolean ctk_init_check(int *argc, char **argv[]);
char *ctk_get_display(void);
char *ctk_get_display(void);
void ctk_main(NvCtrlAttributeHandle **, int, ParsedAttribute*,
void ctk_main(NvCtrlAttributeHandle **, int, ParsedAttribute*,
(-) nvidia-settings-1.0/src/nvidia-settings.c (-3 / +30 lines)
 Lines 22-27    Link Here 
 *
 *
 */
 */
#include <gtk/gtk.h>
#include "NvCtrlAttributes.h"
#include "NvCtrlAttributes.h"
#include "command-line.h"
#include "command-line.h"
 Lines 41-46    Link Here 
    CtrlHandles *h;
    CtrlHandles *h;
    Options *op;
    Options *op;
    int ret;
    int ret;
    char *dpy = NULL;
    int gui = 0;
    
    
    /*
    /*
     * initialize the ui
     * initialize the ui
 Lines 49-62    Link Here 
     * may not even use the gui, but we want the toolkit to have a
     * may not even use the gui, but we want the toolkit to have a
     * chance to parse the commandline before we do... we should
     * chance to parse the commandline before we do... we should
     * investigate gtk_init_check().
     * investigate gtk_init_check().
     *
     * gui flag used to decide if gtk should be used or not, as
     * use might just use control the display from a remote console
     * but for some reason cannot initialize the gtk gui. - TY 2005-05-27
     */
     */
    
    
    ctk_init(&argc, &argv);
    if (ctk_init_check(&argc, &argv) == TRUE) {
        dpy = ctk_get_display();
        gui = 1;
    }
    
    
    /* parse the commandline */
    /* parse the commandline */
    
    
    op = parse_command_line(argc, argv, ctk_get_display());
    op = parse_command_line(argc, argv, dpy);
    /* process any query or assignment commandline options */
    /* process any query or assignment commandline options */
    if (op->num_assignments || op->num_queries) {
    if (op->num_assignments || op->num_queries) {
 Lines 64-69    Link Here 
        return ret ? 0 : 1;
        return ret ? 0 : 1;
    }
    }
    
    
    /* quit here if display is undefineds - TY 2005-05-27 */
    if (op->ctrl_display == NULL) {
        nv_error_msg("Display is undefined, please run `%s --help` "
                     "for usage information.\n", argv[0]);
        return 1;
    }
    
    /* initialize the parsed attribute list */
    /* initialize the parsed attribute list */
    p = nv_parsed_attribute_init();
    p = nv_parsed_attribute_init();
 Lines 90-95    Link Here 
    }
    }
    /* pass control to the gui */
    /* pass control to the gui */
    /*
     * if gtk wasn't initiated, exit here.
     * Using a -c flag without gtk would behave as if using -l - TY 2005-05-27
     */
    if (gui == 0) {
        nv_error_msg("Unable to create gui.\n");
        return 1;
    }
    ctk_main(h->h, h->num_screens, p, &conf);
    ctk_main(h->h, h->num_screens, p, &conf);