示例#1
0
void
_DtInitializeCommandInvoker(
    Display *display,
    char *toolClass,	/* ignored */
    char *appClass,		/* ignored */
    DtSvcMessageProc reloadDBHandler,	/* OBSOLETE -- ignored */
    XtAppContext appContext)
{
    static	int beenCalled = 0;

    _DtSvcAppLock(appContext);

    /*
     * Prevent repeat calls
     */
    _DtSvcProcessLock();
    if ( beenCalled ) {
        _DtSvcProcessUnlock();
        return;
    }

    beenCalled++;

    cmd_Globals.app_context = appContext;

    SbAddInput_hookfn = _DtCmdSPCAddInputHandler;

    SbRemoveInput_hookfn = XtRemoveInput;

    SbAddException_hookfn = _DtCmdSPCAddExceptionHandler;

    SbRemoveException_hookfn = XtRemoveInput;

    _DtCmdBuildPathList ();

    _DtCmdInitializeErrorMessages ();

    /*
     * Must get the name of the invoking host, so that requests
     * can be checked for remote execution.
     */
    if ((DtGetShortHostname(_cmdClientHost, MAXHOSTNAMELEN)) == -1) {
        _DtCmdLogErrorMessage ("Cannot determine the local host name.\n");
    }

    _DtCmdGetResources (display);

    _DtSvcProcessUnlock();
    _DtSvcAppUnlock(appContext);
}
示例#2
0
void
_DtCommandInvokerExecute(
    char *request_name,
    char *context_host,
    char *context_dir,
    char *context_file,
    char *exec_parameters,
    char *exec_host,
    char *exec_string,
    DtCmdInvExecuteProc success_proc,
    void *success_data,
    DtCmdInvExecuteProc failure_proc,
    void *failure_data)

{
    _DtSvcAppLock(cmd_Globals.app_context);

    _DtActionCommandInvoke(_DtAct_NO_STDIO_BIT,context_host,
                           context_dir, exec_string, exec_parameters, exec_host,
                           NULL, NULL,
                           success_proc,success_data, failure_proc,failure_data);
    _DtSvcAppUnlock(cmd_Globals.app_context);

}
示例#3
0
/*************************************<->*************************************
 *
 *  DtWsmRemoveWorkspaceFunctions (display, client)
 *
 *
 *  Description:
 *  -----------
 *  Request the window manager to disallow workspace functions
 *  for this client.
 *
 *
 *  Inputs:
 *  ------
 *  display	- display 
 *  root	- root window of screen 
 *
 *  Returns:
 *  --------
 *  none
 *
 *  
 *  Comments:
 *  ---------
 *  Disables f.workspace_presence, f.remove, f.occupy_all for this
 *  client.
 * 
 *************************************<->***********************************/
void
DtWsmRemoveWorkspaceFunctions (Display *display, Window client)
{
    DtWmHints vHints, *pHints;
    long functions;
    Boolean bSetHints = False;
    _DtSvcDisplayToAppContext(display);

    _DtSvcAppLock(app);

    if (_DtWsmGetDtWmHints (display, client, &pHints) != Success)
    {
	/*
	 * There were no existing workspace hints, so we'll
	 * just use our own variable
	 */
	pHints = &vHints;
	pHints->flags = 0;
    }

    if (pHints->flags & DtWM_HINTS_FUNCTIONS)
    {
	functions = pHints->functions & 
		(DtWM_FUNCTION_OCCUPY_WS | DtWM_FUNCTION_ALL);
	
	if (functions & DtWM_FUNCTION_ALL)
	{
	    /* 
	     * The flags are a list of functions to remove. If 
	     * the workspace functions aren't on this list, make 
	     * sure that it's put there.
	     */
	    if (!(functions & DtWM_FUNCTION_OCCUPY_WS))
	    {
		/* remove workspace functions */
		pHints->functions |=  DtWM_FUNCTION_OCCUPY_WS;
		bSetHints = True;
	    }
	}
	else
	{
	    /*
	     * The flags are a list of functions to add. If
	     * the workspace functions are on the list, make
	     * sure they get removed.
	     */
	    if (functions & DtWM_FUNCTION_OCCUPY_WS)
	    {
		/* remove workspace functions */
		pHints->functions &=  ~DtWM_FUNCTION_OCCUPY_WS;
		bSetHints = True;
	    }
	}
    }
    else
    {
	/*
	 * The hints didn't have workspace functions specified.
	 * Set the flag and remove workspace functions.
	 */
	pHints->flags |= DtWM_HINTS_FUNCTIONS;
	pHints->functions = DtWM_FUNCTION_OCCUPY_WS | DtWM_FUNCTION_ALL;
	bSetHints = True;
    }

    /*
     * If something needs to be changed, then change it.
     */
    if (bSetHints)
	_DtWsmSetDtWmHints (display, client, pHints);

    /*
     * If we read these hints off the window, then be sure to free
     * them.
     */
    if (pHints && (pHints != &vHints))
    {
	XFree ((char *)pHints);
    }

    _DtSvcAppUnlock(app);
} /* END OF FUNCTION DtWsmRemoveWorkspaceFunctions */