/[emacs]/emacs/src/xfns.c
ViewVC logotype

Diff of /emacs/src/xfns.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.521 by gerd, Thu Nov 1 11:11:11 2001 UTC revision 1.522 by pj, Fri Nov 2 20:46:55 2001 UTC
# Line 261  check_x_frame (frame) Line 261  check_x_frame (frame)
261    
262    if (NILP (frame))    if (NILP (frame))
263      frame = selected_frame;      frame = selected_frame;
264    CHECK_LIVE_FRAME (frame, 0);    CHECK_LIVE_FRAME (frame);
265    f = XFRAME (frame);    f = XFRAME (frame);
266    if (! FRAME_X_P (f))    if (! FRAME_X_P (f))
267      error ("Non-X frame used");      error ("Non-X frame used");
# Line 295  check_x_display_info (frame) Line 295  check_x_display_info (frame)
295      {      {
296        FRAME_PTR f;        FRAME_PTR f;
297    
298        CHECK_LIVE_FRAME (frame, 0);        CHECK_LIVE_FRAME (frame);
299        f = XFRAME (frame);        f = XFRAME (frame);
300        if (! FRAME_X_P (f))        if (! FRAME_X_P (f))
301          error ("Non-X frame used");          error ("Non-X frame used");
# Line 1264  x_decode_color (f, color_name, mono_colo Line 1264  x_decode_color (f, color_name, mono_colo
1264  {  {
1265    XColor cdef;    XColor cdef;
1266    
1267    CHECK_STRING (color_name, 0);    CHECK_STRING (color_name);
1268    
1269  #if 0 /* Don't do this.  It's wrong when we're not using the default  #if 0 /* Don't do this.  It's wrong when we're not using the default
1270           colormap, it makes freeing difficult, and it's probably not           colormap, it makes freeing difficult, and it's probably not
# Line 1466  x_set_mouse_color (f, arg, oldval) Line 1466  x_set_mouse_color (f, arg, oldval)
1466    
1467    if (!NILP (Vx_pointer_shape))    if (!NILP (Vx_pointer_shape))
1468      {      {
1469        CHECK_NUMBER (Vx_pointer_shape, 0);        CHECK_NUMBER (Vx_pointer_shape);
1470        cursor = XCreateFontCursor (dpy, XINT (Vx_pointer_shape));        cursor = XCreateFontCursor (dpy, XINT (Vx_pointer_shape));
1471      }      }
1472    else    else
# Line 1475  x_set_mouse_color (f, arg, oldval) Line 1475  x_set_mouse_color (f, arg, oldval)
1475    
1476    if (!NILP (Vx_nontext_pointer_shape))    if (!NILP (Vx_nontext_pointer_shape))
1477      {      {
1478        CHECK_NUMBER (Vx_nontext_pointer_shape, 0);        CHECK_NUMBER (Vx_nontext_pointer_shape);
1479        nontext_cursor        nontext_cursor
1480          = XCreateFontCursor (dpy, XINT (Vx_nontext_pointer_shape));          = XCreateFontCursor (dpy, XINT (Vx_nontext_pointer_shape));
1481      }      }
# Line 1485  x_set_mouse_color (f, arg, oldval) Line 1485  x_set_mouse_color (f, arg, oldval)
1485    
1486    if (!NILP (Vx_hourglass_pointer_shape))    if (!NILP (Vx_hourglass_pointer_shape))
1487      {      {
1488        CHECK_NUMBER (Vx_hourglass_pointer_shape, 0);        CHECK_NUMBER (Vx_hourglass_pointer_shape);
1489        hourglass_cursor        hourglass_cursor
1490          = XCreateFontCursor (dpy, XINT (Vx_hourglass_pointer_shape));          = XCreateFontCursor (dpy, XINT (Vx_hourglass_pointer_shape));
1491      }      }
# Line 1496  x_set_mouse_color (f, arg, oldval) Line 1496  x_set_mouse_color (f, arg, oldval)
1496    x_check_errors (dpy, "bad nontext pointer cursor: %s");    x_check_errors (dpy, "bad nontext pointer cursor: %s");
1497    if (!NILP (Vx_mode_pointer_shape))    if (!NILP (Vx_mode_pointer_shape))
1498      {      {
1499        CHECK_NUMBER (Vx_mode_pointer_shape, 0);        CHECK_NUMBER (Vx_mode_pointer_shape);
1500        mode_cursor = XCreateFontCursor (dpy, XINT (Vx_mode_pointer_shape));        mode_cursor = XCreateFontCursor (dpy, XINT (Vx_mode_pointer_shape));
1501      }      }
1502    else    else
# Line 1505  x_set_mouse_color (f, arg, oldval) Line 1505  x_set_mouse_color (f, arg, oldval)
1505    
1506    if (!NILP (Vx_sensitive_text_pointer_shape))    if (!NILP (Vx_sensitive_text_pointer_shape))
1507      {      {
1508        CHECK_NUMBER (Vx_sensitive_text_pointer_shape, 0);        CHECK_NUMBER (Vx_sensitive_text_pointer_shape);
1509        cross_cursor        cross_cursor
1510          = XCreateFontCursor (dpy, XINT (Vx_sensitive_text_pointer_shape));          = XCreateFontCursor (dpy, XINT (Vx_sensitive_text_pointer_shape));
1511      }      }
# Line 1514  x_set_mouse_color (f, arg, oldval) Line 1514  x_set_mouse_color (f, arg, oldval)
1514    
1515    if (!NILP (Vx_window_horizontal_drag_shape))    if (!NILP (Vx_window_horizontal_drag_shape))
1516      {      {
1517        CHECK_NUMBER (Vx_window_horizontal_drag_shape, 0);        CHECK_NUMBER (Vx_window_horizontal_drag_shape);
1518        horizontal_drag_cursor        horizontal_drag_cursor
1519          = XCreateFontCursor (dpy, XINT (Vx_window_horizontal_drag_shape));          = XCreateFontCursor (dpy, XINT (Vx_window_horizontal_drag_shape));
1520      }      }
# Line 1668  x_set_border_color (f, arg, oldval) Line 1668  x_set_border_color (f, arg, oldval)
1668  {  {
1669    int pix;    int pix;
1670    
1671    CHECK_STRING (arg, 0);    CHECK_STRING (arg);
1672    pix = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f));    pix = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
1673    x_set_border_pixel (f, pix);    x_set_border_pixel (f, pix);
1674    update_face_from_frame_parameter (f, Qborder_color, arg);    update_face_from_frame_parameter (f, Qborder_color, arg);
# Line 1847  x_set_font (f, arg, oldval) Line 1847  x_set_font (f, arg, oldval)
1847    Lisp_Object frame;    Lisp_Object frame;
1848    int old_fontset = f->output_data.x->fontset;    int old_fontset = f->output_data.x->fontset;
1849    
1850    CHECK_STRING (arg, 1);    CHECK_STRING (arg);
1851    
1852    fontset_name = Fquery_fontset (arg, Qnil);    fontset_name = Fquery_fontset (arg, Qnil);
1853    
# Line 1898  x_set_border_width (f, arg, oldval) Line 1898  x_set_border_width (f, arg, oldval)
1898       struct frame *f;       struct frame *f;
1899       Lisp_Object arg, oldval;       Lisp_Object arg, oldval;
1900  {  {
1901    CHECK_NUMBER (arg, 0);    CHECK_NUMBER (arg);
1902    
1903    if (XINT (arg) == f->output_data.x->border_width)    if (XINT (arg) == f->output_data.x->border_width)
1904      return;      return;
# Line 1916  x_set_internal_border_width (f, arg, old Line 1916  x_set_internal_border_width (f, arg, old
1916  {  {
1917    int old = f->output_data.x->internal_border_width;    int old = f->output_data.x->internal_border_width;
1918    
1919    CHECK_NUMBER (arg, 0);    CHECK_NUMBER (arg);
1920    f->output_data.x->internal_border_width = XINT (arg);    f->output_data.x->internal_border_width = XINT (arg);
1921    if (f->output_data.x->internal_border_width < 0)    if (f->output_data.x->internal_border_width < 0)
1922      f->output_data.x->internal_border_width = 0;      f->output_data.x->internal_border_width = 0;
# Line 2291  x_set_name (f, name, explicit) Line 2291  x_set_name (f, name, explicit)
2291        name = build_string (FRAME_X_DISPLAY_INFO (f)->x_id_name);        name = build_string (FRAME_X_DISPLAY_INFO (f)->x_id_name);
2292      }      }
2293    else    else
2294      CHECK_STRING (name, 0);      CHECK_STRING (name);
2295    
2296    /* Don't change the name if it's already NAME.  */    /* Don't change the name if it's already NAME.  */
2297    if (! NILP (Fstring_equal (name, f->name)))    if (! NILP (Fstring_equal (name, f->name)))
# Line 2409  x_set_title (f, name, old_name) Line 2409  x_set_title (f, name, old_name)
2409    if (NILP (name))    if (NILP (name))
2410      name = f->name;      name = f->name;
2411    else    else
2412      CHECK_STRING (name, 0);      CHECK_STRING (name);
2413    
2414    if (FRAME_X_WINDOW (f))    if (FRAME_X_WINDOW (f))
2415      {      {
# Line 2659  and the class is `Emacs.CLASS.SUBCLASS'. Line 2659  and the class is `Emacs.CLASS.SUBCLASS'.
2659    
2660    check_x ();    check_x ();
2661    
2662    CHECK_STRING (attribute, 0);    CHECK_STRING (attribute);
2663    CHECK_STRING (class, 0);    CHECK_STRING (class);
2664    
2665    if (!NILP (component))    if (!NILP (component))
2666      CHECK_STRING (component, 1);      CHECK_STRING (component);
2667    if (!NILP (subclass))    if (!NILP (subclass))
2668      CHECK_STRING (subclass, 2);      CHECK_STRING (subclass);
2669    if (NILP (component) != NILP (subclass))    if (NILP (component) != NILP (subclass))
2670      error ("x-get-resource: must specify both COMPONENT and SUBCLASS or neither");      error ("x-get-resource: must specify both COMPONENT and SUBCLASS or neither");
2671    
# Line 2725  display_x_get_resource (dpyinfo, attribu Line 2725  display_x_get_resource (dpyinfo, attribu
2725    char *name_key;    char *name_key;
2726    char *class_key;    char *class_key;
2727    
2728    CHECK_STRING (attribute, 0);    CHECK_STRING (attribute);
2729    CHECK_STRING (class, 0);    CHECK_STRING (class);
2730    
2731    if (!NILP (component))    if (!NILP (component))
2732      CHECK_STRING (component, 1);      CHECK_STRING (component);
2733    if (!NILP (subclass))    if (!NILP (subclass))
2734      CHECK_STRING (subclass, 2);      CHECK_STRING (subclass);
2735    if (NILP (component) != NILP (subclass))    if (NILP (component) != NILP (subclass))
2736      error ("x-get-resource: must specify both COMPONENT and SUBCLASS or neither");      error ("x-get-resource: must specify both COMPONENT and SUBCLASS or neither");
2737    
# Line 3012  or a list (- N) meaning -N pixels relati Line 3012  or a list (- N) meaning -N pixels relati
3012    unsigned int width, height;    unsigned int width, height;
3013    Lisp_Object result;    Lisp_Object result;
3014    
3015    CHECK_STRING (string, 0);    CHECK_STRING (string);
3016    
3017    geometry = XParseGeometry ((char *) XSTRING (string)->data,    geometry = XParseGeometry ((char *) XSTRING (string)->data,
3018                               &x, &y, &width, &height);                               &x, &y, &width, &height);
# Line 3091  x_figure_window_size (f, parms) Line 3091  x_figure_window_size (f, parms)
3091      {      {
3092        if (!EQ (tem0, Qunbound))        if (!EQ (tem0, Qunbound))
3093          {          {
3094            CHECK_NUMBER (tem0, 0);            CHECK_NUMBER (tem0);
3095            f->height = XINT (tem0);            f->height = XINT (tem0);
3096          }          }
3097        if (!EQ (tem1, Qunbound))        if (!EQ (tem1, Qunbound))
3098          {          {
3099            CHECK_NUMBER (tem1, 0);            CHECK_NUMBER (tem1);
3100            SET_FRAME_WIDTH (f, XINT (tem1));            SET_FRAME_WIDTH (f, XINT (tem1));
3101          }          }
3102        if (!NILP (tem2) && !EQ (tem2, Qunbound))        if (!NILP (tem2) && !EQ (tem2, Qunbound))
# Line 3141  x_figure_window_size (f, parms) Line 3141  x_figure_window_size (f, parms)
3141          f->output_data.x->top_pos = 0;          f->output_data.x->top_pos = 0;
3142        else        else
3143          {          {
3144            CHECK_NUMBER (tem0, 0);            CHECK_NUMBER (tem0);
3145            f->output_data.x->top_pos = XINT (tem0);            f->output_data.x->top_pos = XINT (tem0);
3146            if (f->output_data.x->top_pos < 0)            if (f->output_data.x->top_pos < 0)
3147              window_prompting |= YNegative;              window_prompting |= YNegative;
# Line 3169  x_figure_window_size (f, parms) Line 3169  x_figure_window_size (f, parms)
3169          f->output_data.x->left_pos = 0;          f->output_data.x->left_pos = 0;
3170        else        else
3171          {          {
3172            CHECK_NUMBER (tem1, 0);            CHECK_NUMBER (tem1);
3173            f->output_data.x->left_pos = XINT (tem1);            f->output_data.x->left_pos = XINT (tem1);
3174            if (f->output_data.x->left_pos < 0)            if (f->output_data.x->left_pos < 0)
3175              window_prompting |= XNegative;              window_prompting |= XNegative;
# Line 3922  x_icon (f, parms) Line 3922  x_icon (f, parms)
3922    icon_y = x_get_and_record_arg (f, parms, Qicon_top, 0, 0, RES_TYPE_NUMBER);    icon_y = x_get_and_record_arg (f, parms, Qicon_top, 0, 0, RES_TYPE_NUMBER);
3923    if (!EQ (icon_x, Qunbound) && !EQ (icon_y, Qunbound))    if (!EQ (icon_x, Qunbound) && !EQ (icon_y, Qunbound))
3924      {      {
3925        CHECK_NUMBER (icon_x, 0);        CHECK_NUMBER (icon_x);
3926        CHECK_NUMBER (icon_y, 0);        CHECK_NUMBER (icon_y);
3927      }      }
3928    else if (!EQ (icon_x, Qunbound) || !EQ (icon_y, Qunbound))    else if (!EQ (icon_x, Qunbound) || !EQ (icon_y, Qunbound))
3929      error ("Both left and top icon corners of icon must be specified");      error ("Both left and top icon corners of icon must be specified");
# Line 4147  This function is an internal primitive-- Line 4147  This function is an internal primitive--
4147    if (EQ (parent, Qunbound))    if (EQ (parent, Qunbound))
4148      parent = Qnil;      parent = Qnil;
4149    if (! NILP (parent))    if (! NILP (parent))
4150      CHECK_NUMBER (parent, 0);      CHECK_NUMBER (parent);
4151    
4152    /* make_frame_without_minibuffer can run Lisp code and garbage collect.  */    /* make_frame_without_minibuffer can run Lisp code and garbage collect.  */
4153    /* No need to protect DISPLAY because that's not used after passing    /* No need to protect DISPLAY because that's not used after passing
# Line 4583  DEFUN ("xw-color-defined-p", Fxw_color_d Line 4583  DEFUN ("xw-color-defined-p", Fxw_color_d
4583    XColor foo;    XColor foo;
4584    FRAME_PTR f = check_x_frame (frame);    FRAME_PTR f = check_x_frame (frame);
4585    
4586    CHECK_STRING (color, 1);    CHECK_STRING (color);
4587    
4588    if (x_defined_color (f, XSTRING (color)->data, &foo, 0))    if (x_defined_color (f, XSTRING (color)->data, &foo, 0))
4589      return Qt;      return Qt;
# Line 4599  DEFUN ("xw-color-values", Fxw_color_valu Line 4599  DEFUN ("xw-color-values", Fxw_color_valu
4599    XColor foo;    XColor foo;
4600    FRAME_PTR f = check_x_frame (frame);    FRAME_PTR f = check_x_frame (frame);
4601    
4602    CHECK_STRING (color, 1);    CHECK_STRING (color);
4603    
4604    if (x_defined_color (f, XSTRING (color)->data, &foo, 0))    if (x_defined_color (f, XSTRING (color)->data, &foo, 0))
4605      {      {
# Line 5079  x_display_info_for_name (name) Line 5079  x_display_info_for_name (name)
5079    Lisp_Object names;    Lisp_Object names;
5080    struct x_display_info *dpyinfo;    struct x_display_info *dpyinfo;
5081    
5082    CHECK_STRING (name, 0);    CHECK_STRING (name);
5083    
5084    if (! EQ (Vwindow_system, intern ("x")))    if (! EQ (Vwindow_system, intern ("x")))
5085      error ("Not using X Windows");      error ("Not using X Windows");
# Line 5125  terminate Emacs if we can't open the con Line 5125  terminate Emacs if we can't open the con
5125    unsigned char *xrm_option;    unsigned char *xrm_option;
5126    struct x_display_info *dpyinfo;    struct x_display_info *dpyinfo;
5127    
5128    CHECK_STRING (display, 0);    CHECK_STRING (display);
5129    if (! NILP (xrm_string))    if (! NILP (xrm_string))
5130      CHECK_STRING (xrm_string, 1);      CHECK_STRING (xrm_string);
5131    
5132    if (! EQ (Vwindow_system, intern ("x")))    if (! EQ (Vwindow_system, intern ("x")))
5133      error ("Not using X Windows");      error ("Not using X Windows");
# Line 10409  selected frame.  Value is VALUE.  */) Line 10409  selected frame.  Value is VALUE.  */)
10409    struct frame *f = check_x_frame (frame);    struct frame *f = check_x_frame (frame);
10410    Atom prop_atom;    Atom prop_atom;
10411    
10412    CHECK_STRING (prop, 1);    CHECK_STRING (prop);
10413    CHECK_STRING (value, 2);    CHECK_STRING (value);
10414    
10415    BLOCK_INPUT;    BLOCK_INPUT;
10416    prop_atom = XInternAtom (FRAME_X_DISPLAY (f), XSTRING (prop)->data, False);    prop_atom = XInternAtom (FRAME_X_DISPLAY (f), XSTRING (prop)->data, False);
# Line 10436  FRAME nil or omitted means use the selec Line 10436  FRAME nil or omitted means use the selec
10436    struct frame *f = check_x_frame (frame);    struct frame *f = check_x_frame (frame);
10437    Atom prop_atom;    Atom prop_atom;
10438    
10439    CHECK_STRING (prop, 1);    CHECK_STRING (prop);
10440    BLOCK_INPUT;    BLOCK_INPUT;
10441    prop_atom = XInternAtom (FRAME_X_DISPLAY (f), XSTRING (prop)->data, False);    prop_atom = XInternAtom (FRAME_X_DISPLAY (f), XSTRING (prop)->data, False);
10442    XDeleteProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), prop_atom);    XDeleteProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), prop_atom);
# Line 10467  value.  */) Line 10467  value.  */)
10467    int actual_format;    int actual_format;
10468    unsigned long actual_size, bytes_remaining;    unsigned long actual_size, bytes_remaining;
10469    
10470    CHECK_STRING (prop, 1);    CHECK_STRING (prop);
10471    BLOCK_INPUT;    BLOCK_INPUT;
10472    prop_atom = XInternAtom (FRAME_X_DISPLAY (f), XSTRING (prop)->data, False);    prop_atom = XInternAtom (FRAME_X_DISPLAY (f), XSTRING (prop)->data, False);
10473    rc = XGetWindowProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),    rc = XGetWindowProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
# Line 11132  Text larger than the specified size is c Line 11132  Text larger than the specified size is c
11132    
11133    GCPRO4 (string, parms, frame, timeout);    GCPRO4 (string, parms, frame, timeout);
11134    
11135    CHECK_STRING (string, 0);    CHECK_STRING (string);
11136    f = check_x_frame (frame);    f = check_x_frame (frame);
11137    if (NILP (timeout))    if (NILP (timeout))
11138      timeout = make_number (5);      timeout = make_number (5);
11139    else    else
11140      CHECK_NATNUM (timeout, 2);      CHECK_NATNUM (timeout);
11141        
11142    if (NILP (dx))    if (NILP (dx))
11143      dx = make_number (5);      dx = make_number (5);
11144    else    else
11145      CHECK_NUMBER (dx, 5);      CHECK_NUMBER (dx);
11146        
11147    if (NILP (dy))    if (NILP (dy))
11148      dy = make_number (-10);      dy = make_number (-10);
11149    else    else
11150      CHECK_NUMBER (dy, 6);      CHECK_NUMBER (dy);
11151    
11152    if (NILP (last_show_tip_args))    if (NILP (last_show_tip_args))
11153      last_show_tip_args = Fmake_vector (make_number (3), Qnil);      last_show_tip_args = Fmake_vector (make_number (3), Qnil);
# Line 11412  selection dialog's entry field, if MUSTM Line 11412  selection dialog's entry field, if MUSTM
11412    struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;    struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
11413    
11414    GCPRO5 (prompt, dir, default_filename, mustmatch, file);    GCPRO5 (prompt, dir, default_filename, mustmatch, file);
11415    CHECK_STRING (prompt, 0);    CHECK_STRING (prompt);
11416    CHECK_STRING (dir, 1);    CHECK_STRING (dir);
11417    
11418    /* Prevent redisplay.  */    /* Prevent redisplay.  */
11419    specbind (Qinhibit_redisplay, Qt);    specbind (Qinhibit_redisplay, Qt);

Legend:
Removed from v.1.521  
changed lines
  Added in v.1.522

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26