comparison src/glyphs-x.c @ 4522:fc7067b7f407

Backout last patch; forgot to specify file.
author Stephen J. Turnbull <stephen@xemacs.org>
date Wed, 29 Oct 2008 03:37:16 +0900
parents 383ab474a241
children 726060ee587c
comparison
equal deleted inserted replaced
4521:383ab474a241 4522:fc7067b7f407
2232 2232
2233 /* Adjust offsets within the frame. */ 2233 /* Adjust offsets within the frame. */
2234 if (XFRAME (IMAGE_INSTANCE_FRAME (p))->size_changed) 2234 if (XFRAME (IMAGE_INSTANCE_FRAME (p))->size_changed)
2235 { 2235 {
2236 Arg al[2]; 2236 Arg al[2];
2237 Xt_SET_ARG (al [0], XtNx, &IMAGE_INSTANCE_X_WIDGET_XOFFSET (p)); 2237 XtSetArg (al [0], XtNx, &IMAGE_INSTANCE_X_WIDGET_XOFFSET (p));
2238 Xt_SET_ARG (al [1], XtNy, &IMAGE_INSTANCE_X_WIDGET_YOFFSET (p)); 2238 XtSetArg (al [1], XtNy, &IMAGE_INSTANCE_X_WIDGET_YOFFSET (p));
2239 XtGetValues (FRAME_X_TEXT_WIDGET 2239 XtGetValues (FRAME_X_TEXT_WIDGET
2240 (XFRAME (IMAGE_INSTANCE_FRAME (p))), al, 2); 2240 (XFRAME (IMAGE_INSTANCE_FRAME (p))), al, 2);
2241 } 2241 }
2242 2242
2243 /* now modify the widget */ 2243 /* now modify the widget */
2422 /* Give each child label the correct foreground color. */ 2422 /* Give each child label the correct foreground color. */
2423 Lisp_Object pixel = FACE_FOREGROUND 2423 Lisp_Object pixel = FACE_FOREGROUND
2424 (IMAGE_INSTANCE_WIDGET_FACE (ii), 2424 (IMAGE_INSTANCE_WIDGET_FACE (ii),
2425 domain); 2425 domain);
2426 XColor fcolor = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (pixel)); 2426 XColor fcolor = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (pixel));
2427 lw_add_widget_value_arg (val, (String) XtNtabForeground, fcolor.pixel); 2427 lw_add_widget_value_arg (val, XtNtabForeground, fcolor.pixel);
2428 wv->change = VISIBLE_CHANGE; 2428 wv->change = VISIBLE_CHANGE;
2429 val->change = VISIBLE_CHANGE; 2429 val->change = VISIBLE_CHANGE;
2430 2430
2431 for (cur = val->next; cur; cur = cur->next) 2431 for (cur = val->next; cur; cur = cur->next)
2432 { 2432 {
2537 IMAGE_INSTANCE_X_WIDGET_LWID (ii) = id; 2537 IMAGE_INSTANCE_X_WIDGET_LWID (ii) = id;
2538 /* because the EmacsManager is the widgets parent we have to 2538 /* because the EmacsManager is the widgets parent we have to
2539 offset the redisplay of the widget by the amount the text 2539 offset the redisplay of the widget by the amount the text
2540 widget is inside the manager. */ 2540 widget is inside the manager. */
2541 ac = 0; 2541 ac = 0;
2542 Xt_SET_ARG (al [ac], XtNx, &IMAGE_INSTANCE_X_WIDGET_XOFFSET (ii)); ac++; 2542 XtSetArg (al [ac], XtNx, &IMAGE_INSTANCE_X_WIDGET_XOFFSET (ii)); ac++;
2543 Xt_SET_ARG (al [ac], XtNy, &IMAGE_INSTANCE_X_WIDGET_YOFFSET (ii)); ac++; 2543 XtSetArg (al [ac], XtNy, &IMAGE_INSTANCE_X_WIDGET_YOFFSET (ii)); ac++;
2544 XtGetValues (FRAME_X_TEXT_WIDGET (f), al, ac); 2544 XtGetValues (FRAME_X_TEXT_WIDGET (f), al, ac);
2545 2545
2546 XtSetMappedWhenManaged (wid, TRUE); 2546 XtSetMappedWhenManaged (wid, TRUE);
2547 2547
2548 free_widget_value_tree (wv); 2548 free_widget_value_tree (wv);
2606 && IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (glyph))) 2606 && IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (glyph)))
2607 { 2607 {
2608 Arg al [2]; 2608 Arg al [2];
2609 int ac =0; 2609 int ac =0;
2610 #ifdef LWLIB_WIDGETS_MOTIF 2610 #ifdef LWLIB_WIDGETS_MOTIF
2611 Xt_SET_ARG (al [ac], XmNlabelType, XmPIXMAP); ac++; 2611 XtSetArg (al [ac], XmNlabelType, XmPIXMAP); ac++;
2612 Xt_SET_ARG (al [ac], XmNlabelPixmap, XIMAGE_INSTANCE_X_PIXMAP (glyph)); 2612 XtSetArg (al [ac], XmNlabelPixmap, XIMAGE_INSTANCE_X_PIXMAP (glyph));
2613 ac++; 2613 ac++;
2614 #else 2614 #else
2615 Xt_SET_ARG (al [ac], XtNpixmap, XIMAGE_INSTANCE_X_PIXMAP (glyph)); ac++; 2615 XtSetArg (al [ac], XtNpixmap, XIMAGE_INSTANCE_X_PIXMAP (glyph)); ac++;
2616 #endif 2616 #endif
2617 XtSetValues (IMAGE_INSTANCE_X_WIDGET_ID (ii), al, ac); 2617 XtSetValues (IMAGE_INSTANCE_X_WIDGET_ID (ii), al, ac);
2618 } 2618 }
2619 } 2619 }
2620 2620
2681 { 2681 {
2682 Lisp_Image_Instance *p = XIMAGE_INSTANCE (image_instance); 2682 Lisp_Image_Instance *p = XIMAGE_INSTANCE (image_instance);
2683 2683
2684 if (IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (p)) 2684 if (IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (p))
2685 { 2685 {
2686 Arg al [1];
2686 Lisp_Object val; 2687 Lisp_Object val;
2687 val = XGUI_ITEM (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (p))->value; 2688 val = XGUI_ITEM (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (p))->value;
2688 Xt_SET_VALUE (IMAGE_INSTANCE_X_WIDGET_ID (p), XtNvalue, XINT (val)); 2689 XtSetArg (al[0], XtNvalue, XINT (val));
2690 XtSetValues (IMAGE_INSTANCE_X_WIDGET_ID (p), al, 1);
2689 } 2691 }
2690 } 2692 }
2691 2693
2692 /* instantiate an edit control */ 2694 /* instantiate an edit control */
2693 static void 2695 static void
2769 /* There may be an encapsulated way of doing this, 2771 /* There may be an encapsulated way of doing this,
2770 but I couldn't find it. */ 2772 but I couldn't find it. */
2771 Lisp_Object old_selected = 2773 Lisp_Object old_selected =
2772 gui_item_list_find_selected 2774 gui_item_list_find_selected
2773 (XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii))); 2775 (XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii)));
2776 Arg al [1];
2774 char* name; 2777 char* name;
2775 unsigned int num_children, i; 2778 unsigned int num_children, i;
2776 Widget* children; 2779 Widget* children;
2777 2780
2778 LISP_STRING_TO_EXTERNAL (XGUI_ITEM (XCAR (rest))->name, 2781 LISP_STRING_TO_EXTERNAL (XGUI_ITEM (XCAR (rest))->name,
2784 &num_children); 2787 &num_children);
2785 for (i = 0; i < num_children; i++) 2788 for (i = 0; i < num_children; i++)
2786 { 2789 {
2787 if (!strcmp (XtName (children [i]), name)) 2790 if (!strcmp (XtName (children [i]), name))
2788 { 2791 {
2789 Xt_SET_VALUE (IMAGE_INSTANCE_X_WIDGET_ID (ii), 2792 XtSetArg (al [0], XtNtopWidget, children [i]);
2790 XtNtopWidget, children [i]); 2793 XtSetValues (IMAGE_INSTANCE_X_WIDGET_ID (ii), al, 1);
2791 break; 2794 break;
2792 } 2795 }
2793 } 2796 }
2794 /* Pick up the new selected item. */ 2797 /* Pick up the new selected item. */
2795 XGUI_ITEM (old_selected)->selected = 2798 XGUI_ITEM (old_selected)->selected =