Example #1
0
void close_cmf_external_id_windows(void)
{
  if (ci_idterminate_shell)
    XtPopdown(ci_idterminate_shell);
  if (ci_iddetail_shell)
    hide_window(ci_iddetail_shell, ci_iddetail_form);
  if (ci_idinfo_shell)
    XtPopdown(ci_idinfo_shell);
}
Example #2
0
void close_notes_windows()
{
   if (notesc_poplist_shell != NULL)
      XtPopdown (notesc_poplist_shell);
   if (notes_create_shell != NULL)
      XtPopdown (notes_create_shell);
   if (notes_shell != NULL)
      XtPopdown (notes_shell);

} /* end close_notes_windows */
Example #3
0
static void wxToolButtonPopupCallback(Widget w,
                                      XtPointer client_data,
                                      XEvent *event,
                                      Boolean *WXUNUSED(continue_to_dispatch))
{
    // TODO: retrieve delay before popping up tooltip from wxSystemSettings.
    static const int delayMilli = 800;

    wxToolBar* toolBar = (wxToolBar*) client_data;
    wxToolBarToolBase *tool = toolBar->FindToolByWidget((WXWidget) w);

    if ( !tool )
        return;

    wxString tooltip = tool->GetShortHelp();
    if ( !tooltip )
        return;

    if (!wxTheToolBarTimer)
        wxTheToolBarTimer = new wxToolBarTimer;

    wxToolBarTimer::buttonWidget = w;
    wxToolBarTimer::helpString = tooltip;

    /************************************************************/
    /* Popup help label                                         */
    /************************************************************/
    if (event->type == EnterNotify)
    {
        if (wxToolBarTimer::help_popup != (Widget) 0)
        {
            XtDestroyWidget (wxToolBarTimer::help_popup);
            XtPopdown (wxToolBarTimer::help_popup);
        }
        wxToolBarTimer::help_popup = (Widget) 0;

        // One shot
        wxTheToolBarTimer->Start(delayMilli, true);

    }
    /************************************************************/
    /* Popdown help label                                       */
    /************************************************************/
    else if (event->type == LeaveNotify)
    {
        if (wxTheToolBarTimer)
            wxTheToolBarTimer->Stop();
        if (wxToolBarTimer::help_popup != (Widget) 0)
        {
            XtDestroyWidget (wxToolBarTimer::help_popup);
            XtPopdown (wxToolBarTimer::help_popup);
        }
        wxToolBarTimer::help_popup = (Widget) 0;
    }
}
void close_equipment_windows()
{
  if (emf_shell_up)
  {
    XtUnmanageChild(emf_main_form);
    XtPopdown(emf_shell);
    emf_shell_up = FALSE;
  }
  if (ci_equiplist_shell_up)
  {
    XtUnmanageChild(ci_equiplist_form);
    XtPopdown(ci_equiplist_shell);
    ci_equiplist_shell_up = FALSE;
  }
}
Example #5
0
void 
HidePresenceBox(
        WmScreenData *pSD,
        Boolean userDismissed )

{
    if (pSD->presence.onScreen)
    {
	/* Pop down the shell */
	XtPopdown (pSD->presence.shellW);

	/* 
	 * Do a withdraw to make sure window gets unmanaged
	 * (popdown does nothing if its unmapped)
	 */
	XWithdrawWindow (DISPLAY, XtWindow (pSD->presence.shellW),
			 pSD->screen);
	/* must sync to insure event order */
	XSync (DISPLAY, False);


	pSD->presence.onScreen = False;
	pSD->presence.userDismissed = userDismissed;
    }
} /* END OF FUNCTION   */
Example #6
0
static void DoSave (Widget w)
	{ char *sname;
	  XtPopdown (save_popup);
	  sname = XawDialogGetValueString (save_dialog);
	  save_unparse_buffer (sname);
	  save_cont ();
	};
Example #7
0
static void
printOKXtProc(Widget w, XtPointer client_data, XtPointer callData)
{
  XawPrintDialogCallbackStruct *pdcs = (XawPrintDialogCallbackStruct *)callData;
  Cardinal                      n;
  Arg                           args[2];
  ManpageGlobals               *mg = GetGlobals(w);
  Widget                        topwindow = mg->This_Manpage;
  FILE                         *file;

  Log(("printOKXtProc: OK.\n"));
  
  /* Get file object */
  n = 0;
  XtSetArg(args[n], XtNfile, &file); n++;
  XtGetValues(mg->manpagewidgets.manpage, args, n);
  Assertion(file != NULL, (("printOKXtProc: file == NULL.\n")));
  
  DoPrintManpage("Xman",
                 file, topwindow,
                 pdcs->pdpy, pdcs->pcontext, pdcs->colorspace,
                 printshellDestroyXtProc,
                 mg->manpage_title,
                 pdcs->printToFile?pdcs->printToFileName:NULL);

  XtPopdown(mg->printdialog_shell);
}
Example #8
0
/* file selection button callbacks */
void PosFileOKCB (Widget filebox, XtPointer clientData, XtPointer callData)
/* File selected - process it */
{
  char *filename=NULL, *directory=NULL;
  XmFileSelectionBoxCallbackStruct *cbs;
  ImageDisplay  *IDdata;
  Display *dpy = XtDisplay(filebox);

  cbs = (XmFileSelectionBoxCallbackStruct *) callData;
  IDdata = (ImageDisplay *)clientData;

/* get file name */
 if (!XmStringGetLtoR (cbs->value, XmSTRING_DEFAULT_CHARSET, &filename))
   return; /* error */

/* get directory name */
  if (!XmStringGetLtoR (cbs->dir, XmSTRING_DEFAULT_CHARSET, &directory))
   return; /* error */
  if (!mark_dir) mark_dir = MakeString(" ");
  StringFill (mark_dir, directory);

/* process file marking positions */

  MarkPosFromFile (filename, IDdata);

/*clean up */
  if (filename) XtFree(filename);
  if (directory) XtFree(directory);

/* done - delete file dialog box */
  XtUnmanageChild (filebox); 
  XtPopdown (XtParent (filebox)); 
  XtDestroyWidget(filebox); 
  PositionBoxActive = 0; /* mark as inactive */
} /* end FileButCB */
Example #9
0
static void
popdown_cancel(Widget w, XEvent *event, String *params, Cardinal *num_params)
{
    size_t idx;
    
    UNUSED(w);
    UNUSED(event);
    UNUSED(params);
    UNUSED(num_params);

    ASSERT(*num_params == 1, "Wrong number of parameters in callback");
    idx = strtoul(*params, (char **)NULL, 10);

    /* First call pre_message_cb with window widget ID
     * as additional parameter.
     */
    if (pre_callbacks[idx].callback != NULL) {
	pre_callbacks[idx].callback(popup_window[idx], pre_callbacks[idx].arg);
    }
    
    /* Then pop down window and mark its position as free, then
     * invoke the OK callback.  The reason for this is that the callback
     * may need to wait for open windows.
     */
    XtPopdown(popup_window[idx]);
    XtDestroyWidget(popup_window[idx]);
    g_popup_array[idx] = 0;
    XSync(DISP, True);

    /* invoke the callback if present */
    if (cancel_callbacks[idx].callback != NULL) {
	cancel_callbacks[idx].callback(cancel_callbacks[idx].arg);
    }
}
Example #10
0
File: light.c Project: Thump/sceda
static void
Spotlight_Attributes_Callback(Widget w, XtPointer cl, XtPointer ca)
{
	InstanceList	elmt;
	double	radius;
	double	tightness;
	double	red, green, blue;
	Boolean	invert;
	XtPopdown(spotlight_shell);

	if ( sscanf(intensity_string, "%lf %lf %lf", &red, &green, &blue) < 3 )
		blue = green = red;
	sscanf(radius_string, "%lf", &radius);
	sscanf(tightness_string, "%lf", &tightness);
	XtVaGetValues(invert_toggle, XtNstate, &invert, NULL);

	for ( elmt = instances ; elmt ; elmt = elmt->next )
		if ( elmt->the_instance->o_parent->b_class == spotlight_obj )
			Light_Set((LightInfoPtr)elmt->the_instance->o_attribs,
					  red, green, blue, radius, tightness, invert);

	changed_scene = TRUE;

	if ( arealight_after )
		Set_Arealight_Attributes(instances);
}
Example #11
0
File: light.c Project: Thump/sceda
/*	void
**	Set_Ambient_Callback(Widget w, XtPointer cl, XtPointer ca)
**	Sets the ambient light from the dialog shell.
*/
static void
Set_Ambient_Callback(Widget w, XtPointer cl, XtPointer ca)
{
	String	ambient_text;
	double	r, g, b;
	int		num_args;

	XtPopdown(ambient_light_shell);

	ambient_text = XawDialogGetValueString(ambient_dialog);

	num_args = sscanf(ambient_text, "%lf %lf %lf", &r, &g, &b);
	ambient_light.red = (short)(MAX_UNSIGNED_SHORT * r);
	if ( num_args < 2 )
		ambient_light.green = ambient_light.red;
	else
		ambient_light.green = (short)(MAX_UNSIGNED_SHORT * g);
	if ( num_args < 3 )
		ambient_light.blue = ambient_light.red;
	else
		ambient_light.blue = (short)(MAX_UNSIGNED_SHORT * b);

	changed_scene = TRUE;

}
Example #12
0
/* Callback for "No File" button on trace popup */
static void
no_tracefile_callback(Widget w, XtPointer client_data,
	XtPointer call_data _is_unused)
{
	tracefile_callback((Widget)NULL, "", PN);
	XtPopdown(trace_shell);
}
Example #13
0
File: delete.c Project: Thump/sceda
/*	void
**	Do_Delete(Widget w, XtPointer cl_data, XtPointer ca_data)
**	Actually does the deletion.
*/
static void
Do_Delete(Widget w, XtPointer cl_data, XtPointer ca_data)
{
	InstanceList		elmt;
	InstanceList		victim;
	ObjectInstancePtr	obj;

	XtPopdown(deletion_shell);

	for ( elmt = current_window->selected_instances ; elmt ; elmt = elmt->next )
	{
		victim = Find_Object_In_Instances(elmt->the_instance,
											current_window->all_instances);
		if ( current_window->all_instances == victim )
			current_window->all_instances = victim->next;
		Delete_Element(victim);

		obj = victim->the_instance;
		free(victim);

		/* Check for the victim in the edit lists. */
		if ( ( victim = Find_Object_In_Instances(obj,
											current_window->edit_instances) ) )
			Delete_Edit_Instance(current_window, victim);

		Destroy_Instance(obj);
	}

	Free_Selection_List(current_window->selected_instances);
	current_window->selected_instances = NULL;

	View_Update(current_window, current_window->all_instances, ViewNone);
}
Example #14
0
File: vidmode.c Project: aosm/X11
static void
PopdownAdd(Widget w, XtPointer user_data, XtPointer call_data)
{
    asking_add = 0;
    XtPopdown(addshell);
    do_add = (long)user_data;
}
Example #15
0
File: vidmode.c Project: aosm/X11
static void
PopdownForce(Widget w, XtPointer user_data, XtPointer call_data)
{
    asking_force = 0;
    XtPopdown(forceshell);
    do_force = (long)user_data;
}
Example #16
0
void
EngineOutputPopDown ()
{
    Arg args[16];
    int j;

    if (!engineOutputDialogUp) return;
    DoClearMemo(1);
    j = 0;
    XtSetArg(args[j], XtNx, &engineOutputX); j++;
    XtSetArg(args[j], XtNy, &engineOutputY); j++;
    XtSetArg(args[j], XtNwidth, &engineOutputW); j++;
    XtSetArg(args[j], XtNheight, &engineOutputH); j++;
    XtGetValues(engineOutputShell, args, j);
    wpEngineOutput.x = engineOutputX - 4;
    wpEngineOutput.y = engineOutputY - 23;
    wpEngineOutput.width = engineOutputW;
    wpEngineOutput.height = engineOutputH;
    XtPopdown(engineOutputShell);
    XSync(xDisplay, False);
    j=0;
    XtSetArg(args[j], XtNleftBitmap, None); j++;
    XtSetValues(XtNameToWidget(menuBarWidget, "menuView.Show Engine Output"),
		args, j);

    engineOutputDialogUp = False;
    ShowThinkingEvent(); // [HGM] thinking: might need to shut off thinking output
}
Example #17
0
void popup_time_out_check(int curr_sec) {
    int i;

    // Check only every two minutes or so
    if (popup_time_out_check_last + 120 < curr_sec) {
        popup_time_out_check_last = curr_sec;

        for (i=0;i<MAX_POPUPS;i++) {
            if (pw[i].popup_message_dialog!=NULL) {
                if ((sec_now()-pw[i].sec_opened)>MAX_POPUPS_TIME) {
                    XtPopdown(pw[i].popup_message_dialog);

begin_critical_section(&popup_message_dialog_lock, "popup_gui.c:popup_time_out_check" );

                    XtDestroyWidget(pw[i].popup_message_dialog);
                    pw[i].popup_message_dialog = (Widget)NULL;
                    pw[i].popup_message_data = (Widget)NULL;

end_critical_section(&popup_message_dialog_lock, "popup_gui.c:popup_time_out_check" );

                }

            }
        }
    }
}
Example #18
0
File: em_menu.c Project: Exim/exim
static void dismissAction(Widget w, XtPointer client_data, XtPointer call_data)
{
pipe_item *p = pipe_chain;

w = w;      /* Keep picky compilers happy */
call_data = call_data;

XtPopdown((Widget)client_data);
XtDestroyWidget((Widget)client_data);

/* If this is a text widget for a sub-process, clear it out of
the chain so that subsequent data doesn't try to use it. We have
to search the parents of the saved widget to see if one of them
is what we have just destroyed. */

while (p != NULL)
  {
  Widget pp = p->widget;
  while (pp != NULL)
    {
    if (pp == (Widget)client_data) { p->widget = NULL; return; }
    pp = XtParent(pp);
    }
  p = p->next;
  }
}
Example #19
0
static void
message_over (XtPointer client_data, XtIntervalId *interval_id)
{
  Widget popup = (Widget) client_data;
  
  XtPopdown (popup);
}
Example #20
0
void
close_window (Widget w,
              XtPointer client_data,
              XtPointer call_data)
{
  XtPopdown ( *((Widget *)client_data) );
}
Example #21
0
File: light.c Project: Thump/sceda
static void
Light_Intensity_Callback(Widget w, XtPointer cl, XtPointer ca)
{
	String	int_string;
	double	r = 0.0;
	double	g = 0.0;
	double	b = 0.0;
	int		num_args;
	InstanceList	elmt;

	XtPopdown(light_shell);

	int_string = XawDialogGetValueString(light_dialog);

	num_args = sscanf(int_string, "%lf %lf %lf", &r, &g, &b);
	if ( num_args < 3 )
		g = b = r;

	for ( elmt = instances ; elmt ; elmt = elmt->next )
		if ( elmt->the_instance->o_parent->b_class == light_obj )
		{
			((LightInfoPtr)elmt->the_instance->o_attribs)->red = r;
			((LightInfoPtr)elmt->the_instance->o_attribs)->green = g;
			((LightInfoPtr)elmt->the_instance->o_attribs)->blue = b;
		}

	changed_scene = TRUE;

	if ( spotlight_after )
		Set_Spotlight_Attributes(instances, arealight_after);
	else if ( arealight_after )
		Set_Arealight_Attributes(instances);

}
Example #22
0
static void
ChooseSessionFailSafeXtProc(Widget w, XtPointer client_data, 
			    XtPointer callData)
{
    /*
     * Pop down choice of sessions, and start the fail safe session.
     */

    CheckDeleteCancel ();
    CheckBreakLockCancel ();

    XtPopdown (chooseSessionPopup);

    if (session_name)
	XtFree (session_name);

    session_name = XtNewString (FAILSAFE_SESSION_NAME);

    FreeSessionNames (sessionNameCount,
	sessionNamesShort, sessionNamesLong, sessionsLocked);


    /*
     * We don't need to check return value of StartSession in this case,
     * because we are using the default session, and StartSession will
     * not try to lock the session at this time.  It will try to lock
     * it as soon as the user gives the session a name.
     */

    StartSession (session_name,
	True /* Use ~/.xsmstartup if found, else system.xsm */);
}
Example #23
0
File: UxXt.c Project: nagyistge/ctn
static void
popdown_dialog(Widget wgt)
#endif
{
    if (handle_dialog_child(wgt, XtUnmanageChild) == UX_ERROR)
	XtPopdown(wgt);
}
Example #24
0
static void doSave (Widget w,
	XtPointer client_data,
	XtPointer callData __attribute__((unused)))
{
  String saveName;
  int    err;
  char	 msg[256];
  
  ViewData *view = client_data;

  saveName = XawDialogGetValueString(XtParent(w));
  strcpy(view->fileName, saveName);
  WriteGridToFile((Grid *)view->grid, view->fileName, &err);
  if (err) {
    sprintf(msg, "Unable to save file %s: C error code %d", saveName, err);
    setMessageLine(msg);
    XtWarning(msg);
  } else {
    XtVaSetValues(XtShell(w), XtNtitle, view->fileName, NULL);
    gridHasChanged = False;
    XtPopdown(saveChangesPopup);
    XtDestroyWidget(saveChangesPopup);
    /* MUST do this, otherwise save dialog loops forever */
    saveChangesPopup = NULL;
  }
}
Example #25
0
static void
not_ok_action(Widget w, XtPointer client_data, XtPointer call_data)
{
    /* Note: unmanages the parent of the button */
    XtPointer p;
    ptrdiff_t idx = -1;

    UNUSED(client_data);

    UNUSED(call_data);
    XtVaGetValues(w, XmNuserData, &p, NULL);
    idx = (ptrdiff_t)p;
    ASSERT(idx >= 0, "Couldn't get idx from XmNuserData!");
    ASSERT(idx >= 0 && idx < MAX_POPUPS, "Invalid widget index in ok_action()");

    /* First call pre_message_cb with window widget ID
     * as additional parameter.
     */
    if (pre_callbacks[idx].callback != NULL) {
	pre_callbacks[idx].callback(popup_window[idx], pre_callbacks[idx].arg);
    }
    
    /* Then pop down window and mark its position as free, then
     * invoke the OK callback.  The reason for this is that the callback
     * may need to wait for open windows.
     */
    XtPopdown(popup_window[idx]);
    XtDestroyWidget(popup_window[idx]);
    g_popup_array[idx] = 0;
    XSync(DISP, True);

    if (no_callbacks[idx].callback != NULL) {
	no_callbacks[idx].callback(no_callbacks[idx].arg);
    }
}
Example #26
0
static void
ToolTipUnpost (XtPointer client_data,
               XtIntervalId * id)
{
    XmToolTipConfigTrait ttp;

    ttp = (XmToolTipConfigTrait) client_data;

    if (ttp->duration_timer)
    {
        if (!id || (id && (*id != ttp->duration_timer)))
        {
            XtRemoveTimeOut (ttp->duration_timer);
        }
        ttp->duration_timer = (XtIntervalId) NULL;
    }
    if (ttp->slider)
    {
        XtDestroyWidget (ttp->slider);
        ttp->slider = NULL;
    }

    if (ttp->label != NULL && !XtParent (ttp->label)->core.being_destroyed)
    {
        XtPopdown (XtParent (ttp->label));
    }

}
/*ARGSUSED*/
static void
AcceptSaveFile(Widget w, XEvent *e, String *argv, Cardinal *argc)
{
    char    *filename;
    Boolean success;
    Arg	    args[1];

    filename = XawDialogGetValueString (fileDialog);
    success = XawAsciiSaveAsFile (XawTextGetSource (text), filename);
    XtPopdown (fileDialogShell);
    if (!success)
    {
	char	*failMessage;

	XtAsprintf (&failMessage, "Can't open file \"%s\"", filename);
	XtSetArg (args[0], XtNlabel, failMessage);
	XtSetValues (failDialog, args, 1);
	CenterWidgetOnEvent (failDialogShell, e);
	XtPopup (failDialogShell, XtGrabNone);
	XtFree (failMessage);
    }
    else
    {
	if (currentClip->filename)
	    free (currentClip->filename);
	currentClip->filename = malloc (strlen (filename) + 1);
	if (currentClip->filename)
	    strcpy (currentClip->filename, filename);
    }
}
Example #28
0
void responseCB (Widget w, XtPointer clientData, XmAnyCallbackStruct *cbs) {
    char *theText = NULL;

    XtUnmanageChild (responseForm);
    XtPopdown (responseShell);

    answer = (int) clientData;
    if (theResponse) {
        free (theResponse);
        theResponse = NULL;
    }

    if (answer) {
        if (!(theText = XmTextGetString(responseText)) || !*theText) {
            if (theText)
                XtFree (theText);
            return ;
        } 
    } else 
 	return;

    if (theText) {
        theResponse = strdup(theText);
        XtFree (theText);
    }
}
Example #29
0
/**************************************************************************
   OkWatchCallback
   Description:  This function will reset the watch flags to the new
                 values and remove the watch window from the screen.
   Arguments:    w - widget that event was activated
                 client_data - NULL
                 call_data - Unused
   Return:       None
 **************************************************************************/
void OkWatchCallback(
  Widget w,
  XtPointer client_data,
  XtPointer call_data)
{
   void *theEnv = GetCurrentEnvironment();
   int i,n;
   Boolean OnOff = False;
   
   for(i = 0; i< MAX_WATCH; i++)
    {
       n = 0;
       XtSetArg(TheArgs[n],XtNstate,&OnOff);n++;
       XtGetValues(watch_widgets[i],TheArgs,n);
     /*----------------------------------------------------------------*/
     /* I have to do this because I am not sure if True and False in X */
     /* are defined the same as CLIPS_TRUE and CLIPS_FALSE             */
     /*----------------------------------------------------------------*/
       if((OnOff == True)&&(EnvGetWatchItem(theEnv,WatchName[i])!= CLIPS_TRUE))
        {
          EnvSetWatchItem(theEnv,WatchName[i], ON,NULL);
        }
       else if((OnOff == False) && (EnvGetWatchItem(theEnv,WatchName[i]) == CLIPS_TRUE))
        {
          EnvSetWatchItem(theEnv,WatchName[i], OFF,NULL);
        }
    }
   XtPopdown(XtParent(XtParent(w)));
   quit_get_event = True;
}
Example #30
0
static void
apply_prefs_cb(XtPointer arg)
{
    struct topic_info *info = (struct topic_info *)arg;
    struct prefs_choice *prefs = (struct prefs_choice *)info->data;
    size_t i;
    Widget colorsel;

    if (get_widget_by_name(&colorsel, globals.widgets.top_level, Xdvi_COLOR_DIALOG_NAME, False)) {
	XtPopdown(XtParent(colorsel));
    }

    /* pop down dependent windows */
    TRACE_GUI((stderr, "window count: %lu\n", (unsigned long)prefs->depwin_cnt));
    for (i = 0; i < prefs->depwin_cnt; i++) {
	TRACE_GUI((stderr, "popping down %lu: %p", (unsigned long)i, (void *)(prefs->depwin[i])));
	if (XtIsRealized(prefs->depwin[i])) {
	    XtCallCallbacks(prefs->depwin[i], XmNcancelCallback, NULL);
	    XSync(DISP, True); /* wait for server to catch up */
	    if (XtIsRealized(prefs->depwin[i])) {
		TRACE_GUI((stderr, "calling XmNokCallback of %lu: %p", (unsigned long)i, (void *)(prefs->depwin[i])));
		XtCallCallbacks(prefs->depwin[i], XmNokCallback, NULL);
	    }
	}
    }
    free(prefs->depwin);
    prefs->depwin = NULL;
    prefs->depwin_cnt = 0;

    if (prefs->db == NULL) /* callback invoked multiple times? */
	return;

    merge_into_user_db(prefs->db); /* this destroys prefs->db */
    prefs->db = NULL;

    /* remember some current values */
    free(globals.curr_paper);
    if (resource.paper != NULL)
	globals.curr_paper = xstrdup(resource.paper);
    
    free(globals.curr_editor);
    if (resource.editor != NULL)
	globals.curr_editor = xstrdup(resource.editor);
    
    free(globals.curr_browser);
    if (resource.browser != NULL)
	globals.curr_browser = xstrdup(resource.browser);

    /*     fprintf(stderr, "set curr_browser to: |%s|\n", globals.curr_browser); */
    /*     fprintf(stderr, "set curr_editor to: |%s|\n", globals.curr_editor); */
    
    if (get_xdvi_window_id(False, NULL) && save_user_preferences(False)) {
	/* if other instances of xdvi are running, make them reread the
	   changed preferences by writing them to ~/.xdvirc.tmp and having
	   them read that file; otherwise they would overwrite the file if
	   user quits them after the current instance.
	*/
	get_xdvi_window_id(False, reread_prefs_cb);
    }
}