Mercurial > hg > xemacs-beta
comparison src/frame-x.c @ 4521:383ab474a241
Fix docstring typo.
author | Stephen J. Turnbull <stephen@xemacs.org> |
---|---|
date | Tue, 28 Oct 2008 10:38:26 +0900 |
parents | 229bd619740a |
children | fc7067b7f407 |
comparison
equal
deleted
inserted
replaced
4520:279cadceaa13 | 4521:383ab474a241 |
---|---|
278 if (!XtIsWMShell (wmshell)) | 278 if (!XtIsWMShell (wmshell)) |
279 ABORT (); | 279 ABORT (); |
280 if (cw <= 0 || ch <= 0) | 280 if (cw <= 0 || ch <= 0) |
281 ABORT (); | 281 ABORT (); |
282 | 282 |
283 XtSetArg (al[0], XtNwidthInc, cw); | 283 Xt_SET_ARG (al[0], XtNwidthInc, cw); |
284 XtSetArg (al[1], XtNheightInc, ch); | 284 Xt_SET_ARG (al[1], XtNheightInc, ch); |
285 XtSetValues (wmshell, al, 2); | 285 XtSetValues (wmshell, al, 2); |
286 } | 286 } |
287 | 287 |
288 void | 288 void |
289 x_wm_set_variable_size (Widget wmshell, int width, int height) | 289 x_wm_set_variable_size (Widget wmshell, int width, int height) |
296 /* See comment in EmacsShell.c */ | 296 /* See comment in EmacsShell.c */ |
297 printf ("x_wm_set_variable_size: %d %d\n", width, height); | 297 printf ("x_wm_set_variable_size: %d %d\n", width, height); |
298 fflush (stdout); | 298 fflush (stdout); |
299 #endif | 299 #endif |
300 | 300 |
301 XtSetArg (al[0], XtNwidthCells, width); | 301 Xt_SET_ARG (al[0], XtNwidthCells, width); |
302 XtSetArg (al[1], XtNheightCells, height); | 302 Xt_SET_ARG (al[1], XtNheightCells, height); |
303 XtSetValues (wmshell, al, 2); | 303 XtSetValues (wmshell, al, 2); |
304 } | 304 } |
305 | 305 |
306 /* If the WM_PROTOCOLS property does not already contain WM_TAKE_FOCUS | 306 /* If the WM_PROTOCOLS property does not already contain WM_TAKE_FOCUS |
307 and WM_DELETE_WINDOW, then add them. (They may already be present | 307 and WM_DELETE_WINDOW, then add them. (They may already be present |
666 /* #### Caching is device-independent - belongs in update_frame_title. */ | 666 /* #### Caching is device-independent - belongs in update_frame_title. */ |
667 Xt_GET_VALUE (FRAME_X_SHELL_WIDGET (f), Xt_resource_name, &old_XtValue); | 667 Xt_GET_VALUE (FRAME_X_SHELL_WIDGET (f), Xt_resource_name, &old_XtValue); |
668 if (!old_XtValue || strcmp (new_XtValue, old_XtValue)) | 668 if (!old_XtValue || strcmp (new_XtValue, old_XtValue)) |
669 { | 669 { |
670 Arg al[2]; | 670 Arg al[2]; |
671 XtSetArg (al[0], Xt_resource_name, new_XtValue); | 671 Xt_SET_ARG (al[0], Xt_resource_name, new_XtValue); |
672 XtSetArg (al[1], Xt_resource_encoding_name, encoding); | 672 Xt_SET_ARG (al[1], Xt_resource_encoding_name, encoding); |
673 XtSetValues (FRAME_X_SHELL_WIDGET (f), al, 2); | 673 XtSetValues (FRAME_X_SHELL_WIDGET (f), al, 2); |
674 } | 674 } |
675 } | 675 } |
676 | 676 |
677 static void | 677 static void |
1537 &frame_x, &frame_y, | 1537 &frame_x, &frame_y, |
1538 &frame_w, &frame_h); | 1538 &frame_w, &frame_h); |
1539 if (! (frame_flags & (WidthValue | HeightValue))) | 1539 if (! (frame_flags & (WidthValue | HeightValue))) |
1540 { | 1540 { |
1541 Arg al[2]; | 1541 Arg al[2]; |
1542 XtSetArg (al [0], XtNwidth, &frame_w); | 1542 Xt_SET_ARG (al [0], XtNwidth, &frame_w); |
1543 XtSetArg (al [1], XtNheight, &frame_h); | 1543 Xt_SET_ARG (al [1], XtNheight, &frame_h); |
1544 XtGetValues (ew, al, 2); | 1544 XtGetValues (ew, al, 2); |
1545 if (!frame_w && !frame_h) | 1545 if (!frame_w && !frame_h) |
1546 { | 1546 { |
1547 frame_w = 64; | 1547 frame_w = 64; |
1548 frame_h = 12; | 1548 frame_h = 12; |
1552 if (frame_flags & (WidthValue | HeightValue)) | 1552 if (frame_flags & (WidthValue | HeightValue)) |
1553 EmacsFrameSetCharSize (ew, frame_w, frame_h); | 1553 EmacsFrameSetCharSize (ew, frame_w, frame_h); |
1554 if (frame_flags & (XValue | YValue)) | 1554 if (frame_flags & (XValue | YValue)) |
1555 { | 1555 { |
1556 Arg al[2]; | 1556 Arg al[2]; |
1557 XtSetArg (al [0], XtNwidth, &frame_w); | 1557 Xt_SET_ARG (al [0], XtNwidth, &frame_w); |
1558 XtSetArg (al [1], XtNheight, &frame_h); | 1558 Xt_SET_ARG (al [1], XtNheight, &frame_h); |
1559 XtGetValues (ew, al, 2); | 1559 XtGetValues (ew, al, 2); |
1560 | 1560 |
1561 if (frame_flags & XNegative) | 1561 if (frame_flags & XNegative) |
1562 frame_x += frame_w; | 1562 frame_x += frame_w; |
1563 if (frame_flags & YNegative) | 1563 if (frame_flags & YNegative) |
1564 frame_y += frame_h; | 1564 frame_y += frame_h; |
1565 | 1565 |
1566 XtSetArg (al [0], XtNx, frame_x); | 1566 Xt_SET_ARG (al [0], XtNx, frame_x); |
1567 XtSetArg (al [1], XtNy, frame_y); | 1567 Xt_SET_ARG (al [1], XtNy, frame_y); |
1568 XtSetValues (ew, al, 2); | 1568 XtSetValues (ew, al, 2); |
1569 } | 1569 } |
1570 return; | 1570 return; |
1571 } | 1571 } |
1572 #endif | 1572 #endif |
1867 } else | 1867 } else |
1868 #endif /* EXTERNAL_WIDGET */ | 1868 #endif /* EXTERNAL_WIDGET */ |
1869 FRAME_X_TOP_LEVEL_FRAME_P (f) = 1; | 1869 FRAME_X_TOP_LEVEL_FRAME_P (f) = 1; |
1870 | 1870 |
1871 ac = 0; | 1871 ac = 0; |
1872 XtSetArg (al[ac], XtNallowShellResize, True); ac++; | 1872 Xt_SET_ARG (al[ac], XtNallowShellResize, True); ac++; |
1873 #ifdef LWLIB_USES_MOTIF | 1873 #ifdef LWLIB_USES_MOTIF |
1874 /* Motif sucks beans. Without this in here, it will delete the window | 1874 /* Motif sucks beans. Without this in here, it will delete the window |
1875 out from under us when it receives a WM_DESTROY_WINDOW message | 1875 out from under us when it receives a WM_DESTROY_WINDOW message |
1876 from the WM. */ | 1876 from the WM. */ |
1877 XtSetArg (al[ac], XmNdeleteResponse, XmDO_NOTHING); ac++; | 1877 Xt_SET_ARG (al[ac], XmNdeleteResponse, XmDO_NOTHING); ac++; |
1878 #endif | 1878 #endif |
1879 | 1879 |
1880 #ifdef EXTERNAL_WIDGET | 1880 #ifdef EXTERNAL_WIDGET |
1881 if (window_id) | 1881 if (window_id) |
1882 { | 1882 { |
1883 XtSetArg (al[ac], XtNwindow, window_id); ac++; | 1883 Xt_SET_ARG (al[ac], XtNwindow, window_id); ac++; |
1884 } | 1884 } |
1885 else | 1885 else |
1886 #endif /* EXTERNAL_WIDGET */ | 1886 #endif /* EXTERNAL_WIDGET */ |
1887 { | 1887 { |
1888 XtSetArg (al[ac], XtNinput, True); ac++; | 1888 Xt_SET_ARG (al[ac], XtNinput, True); ac++; |
1889 XtSetArg (al[ac], XtNminWidthCells, 10); ac++; | 1889 Xt_SET_ARG (al[ac], XtNminWidthCells, 10); ac++; |
1890 XtSetArg (al[ac], XtNminHeightCells, 1); ac++; | 1890 Xt_SET_ARG (al[ac], XtNminHeightCells, 1); ac++; |
1891 XtSetArg (al[ac], XtNvisual, visual); ac++; | 1891 Xt_SET_ARG (al[ac], XtNvisual, visual); ac++; |
1892 XtSetArg (al[ac], XtNdepth, depth); ac++; | 1892 Xt_SET_ARG (al[ac], XtNdepth, depth); ac++; |
1893 XtSetArg (al[ac], XtNcolormap, cmap); ac++; | 1893 Xt_SET_ARG (al[ac], XtNcolormap, cmap); ac++; |
1894 } | 1894 } |
1895 | 1895 |
1896 if (!NILP (overridep)) | 1896 if (!NILP (overridep)) |
1897 { | 1897 { |
1898 XtSetArg (al[ac], XtNoverrideRedirect, True); ac++; | 1898 Xt_SET_ARG (al[ac], XtNoverrideRedirect, True); ac++; |
1899 } | 1899 } |
1900 | 1900 |
1901 /* #### maybe we should check for FRAMEP instead? */ | 1901 /* #### maybe we should check for FRAMEP instead? */ |
1902 if (!NILP (parent)) | 1902 if (!NILP (parent)) |
1903 { | 1903 { |
1904 parentwid = FRAME_X_SHELL_WIDGET (XFRAME (parent)); | 1904 parentwid = FRAME_X_SHELL_WIDGET (XFRAME (parent)); |
1905 XtSetArg (al[ac], XtNtransientFor, parentwid); ac++; | 1905 Xt_SET_ARG (al[ac], XtNtransientFor, parentwid); ac++; |
1906 } | 1906 } |
1907 | 1907 |
1908 shell = XtCreatePopupShell ("shell", | 1908 shell = XtCreatePopupShell ("shell", |
1909 ( | 1909 ( |
1910 #ifdef EXTERNAL_WIDGET | 1910 #ifdef EXTERNAL_WIDGET |
1919 FRAME_X_SHELL_WIDGET (f) = shell; | 1919 FRAME_X_SHELL_WIDGET (f) = shell; |
1920 maybe_set_frame_title_format (shell); | 1920 maybe_set_frame_title_format (shell); |
1921 | 1921 |
1922 /* Create the manager widget */ | 1922 /* Create the manager widget */ |
1923 ac = 0; | 1923 ac = 0; |
1924 XtSetArg (al[ac], XtNvisual, visual); ac++; | 1924 Xt_SET_ARG (al[ac], XtNvisual, visual); ac++; |
1925 XtSetArg (al[ac], XtNdepth, depth); ac++; | 1925 Xt_SET_ARG (al[ac], XtNdepth, depth); ac++; |
1926 XtSetArg (al[ac], XtNcolormap, cmap); ac++; | 1926 Xt_SET_ARG (al[ac], XtNcolormap, cmap); ac++; |
1927 | 1927 |
1928 container = XtCreateWidget ("container", | 1928 container = XtCreateWidget ("container", |
1929 emacsManagerWidgetClass, shell, al, ac); | 1929 emacsManagerWidgetClass, shell, al, ac); |
1930 FRAME_X_CONTAINER_WIDGET (f) = container; | 1930 FRAME_X_CONTAINER_WIDGET (f) = container; |
1931 XtAddCallback (container, XtNresizeCallback, x_layout_widgets, | 1931 XtAddCallback (container, XtNresizeCallback, x_layout_widgets, |
1933 XtAddCallback (container, XtNqueryGeometryCallback, x_do_query_geometry, | 1933 XtAddCallback (container, XtNqueryGeometryCallback, x_do_query_geometry, |
1934 (XtPointer) f); | 1934 (XtPointer) f); |
1935 | 1935 |
1936 /* Create the text area */ | 1936 /* Create the text area */ |
1937 ac = 0; | 1937 ac = 0; |
1938 XtSetArg (al[ac], XtNvisual, visual); ac++; | 1938 Xt_SET_ARG (al[ac], XtNvisual, visual); ac++; |
1939 XtSetArg (al[ac], XtNdepth, depth); ac++; | 1939 Xt_SET_ARG (al[ac], XtNdepth, depth); ac++; |
1940 XtSetArg (al[ac], XtNcolormap, cmap); ac++; | 1940 Xt_SET_ARG (al[ac], XtNcolormap, cmap); ac++; |
1941 XtSetArg (al[ac], XtNborderWidth, 0); ac++; /* should this be settable? */ | 1941 Xt_SET_ARG (al[ac], XtNborderWidth, 0); ac++; /* should this be settable? */ |
1942 XtSetArg (al[ac], XtNemacsFrame, f); ac++; | 1942 Xt_SET_ARG (al[ac], XtNemacsFrame, f); ac++; |
1943 text = XtCreateWidget (name, emacsFrameClass, container, al, ac); | 1943 text = XtCreateWidget (name, emacsFrameClass, container, al, ac); |
1944 FRAME_X_TEXT_WIDGET (f) = text; | 1944 FRAME_X_TEXT_WIDGET (f) = text; |
1945 | 1945 |
1946 #ifdef HAVE_MENUBARS | 1946 #ifdef HAVE_MENUBARS |
1947 /* Create the initial menubar widget. */ | 1947 /* Create the initial menubar widget. */ |
2196 } | 2196 } |
2197 | 2197 |
2198 /* Store the X data into the widget. */ | 2198 /* Store the X data into the widget. */ |
2199 { | 2199 { |
2200 Arg al[2]; | 2200 Arg al[2]; |
2201 XtSetArg (al[0], XtNiconPixmap, x_pixmap); | 2201 Xt_SET_ARG (al[0], XtNiconPixmap, x_pixmap); |
2202 XtSetArg (al[1], XtNiconMask, x_mask); | 2202 Xt_SET_ARG (al[1], XtNiconMask, x_mask); |
2203 XtSetValues (FRAME_X_SHELL_WIDGET (f), al, 2); | 2203 XtSetValues (FRAME_X_SHELL_WIDGET (f), al, 2); |
2204 } | 2204 } |
2205 } | 2205 } |
2206 | 2206 |
2207 static void | 2207 static void |
2262 Dimension frame_h = DisplayHeight (dpy, DefaultScreen (dpy)); | 2262 Dimension frame_h = DisplayHeight (dpy, DefaultScreen (dpy)); |
2263 Dimension shell_w, shell_h, shell_bord; | 2263 Dimension shell_w, shell_h, shell_bord; |
2264 int win_gravity; | 2264 int win_gravity; |
2265 Arg al[3]; | 2265 Arg al[3]; |
2266 | 2266 |
2267 XtSetArg (al[0], XtNwidth, &shell_w); | 2267 Xt_SET_ARG (al[0], XtNwidth, &shell_w); |
2268 XtSetArg (al[1], XtNheight, &shell_h); | 2268 Xt_SET_ARG (al[1], XtNheight, &shell_h); |
2269 XtSetArg (al[2], XtNborderWidth, &shell_bord); | 2269 Xt_SET_ARG (al[2], XtNborderWidth, &shell_bord); |
2270 XtGetValues (w, al, 3); | 2270 XtGetValues (w, al, 3); |
2271 | 2271 |
2272 win_gravity = | 2272 win_gravity = |
2273 xoff >= 0 && yoff >= 0 ? NorthWestGravity : | 2273 xoff >= 0 && yoff >= 0 ? NorthWestGravity : |
2274 xoff >= 0 ? SouthWestGravity : | 2274 xoff >= 0 ? SouthWestGravity : |
2281 | 2281 |
2282 /* Update the hints so that, if this window is currently iconified, it will | 2282 /* Update the hints so that, if this window is currently iconified, it will |
2283 come back at the right place. We can't look at s->visible to determine | 2283 come back at the right place. We can't look at s->visible to determine |
2284 whether it is iconified because it might not be up-to-date yet (the queue | 2284 whether it is iconified because it might not be up-to-date yet (the queue |
2285 might not be processed). */ | 2285 might not be processed). */ |
2286 XtSetArg (al[0], XtNwinGravity, win_gravity); | 2286 Xt_SET_ARG (al[0], XtNwinGravity, win_gravity); |
2287 XtSetArg (al[1], XtNx, xoff); | 2287 Xt_SET_ARG (al[1], XtNx, xoff); |
2288 XtSetArg (al[2], XtNy, yoff); | 2288 Xt_SET_ARG (al[2], XtNy, yoff); |
2289 XtSetValues (w, al, 3); | 2289 XtSetValues (w, al, 3); |
2290 | 2290 |
2291 /* Sometimes you will find that | 2291 /* Sometimes you will find that |
2292 | 2292 |
2293 (set-frame-position (selected-frame) -50 -50) | 2293 (set-frame-position (selected-frame) -50 -50) |
2707 XColor fgc; | 2707 XColor fgc; |
2708 | 2708 |
2709 if (!EQ (color, Vthe_null_color_instance)) | 2709 if (!EQ (color, Vthe_null_color_instance)) |
2710 { | 2710 { |
2711 fgc = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (color)); | 2711 fgc = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (color)); |
2712 XtSetArg (al[ac], XtNforeground, (void *) fgc.pixel); ac++; | 2712 Xt_SET_ARG (al[ac], XtNforeground, (void *) fgc.pixel); ac++; |
2713 } | 2713 } |
2714 } | 2714 } |
2715 else if (EQ (name, Qbackground)) | 2715 else if (EQ (name, Qbackground)) |
2716 { | 2716 { |
2717 Lisp_Object color = FACE_BACKGROUND (Vdefault_face, frame); | 2717 Lisp_Object color = FACE_BACKGROUND (Vdefault_face, frame); |
2718 XColor bgc; | 2718 XColor bgc; |
2719 | 2719 |
2720 if (!EQ (color, Vthe_null_color_instance)) | 2720 if (!EQ (color, Vthe_null_color_instance)) |
2721 { | 2721 { |
2722 bgc = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (color)); | 2722 bgc = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (color)); |
2723 XtSetArg (al[ac], XtNbackground, (void *) bgc.pixel); ac++; | 2723 Xt_SET_ARG (al[ac], XtNbackground, (void *) bgc.pixel); ac++; |
2724 } | 2724 } |
2725 | 2725 |
2726 /* Really crappy way to force the modeline shadows to be | 2726 /* Really crappy way to force the modeline shadows to be |
2727 redrawn. But effective. */ | 2727 redrawn. But effective. */ |
2728 MARK_FRAME_WINDOWS_STRUCTURE_CHANGED (frm); | 2728 MARK_FRAME_WINDOWS_STRUCTURE_CHANGED (frm); |
2752 if (0) | 2752 if (0) |
2753 ; | 2753 ; |
2754 #ifdef USE_XFT | 2754 #ifdef USE_XFT |
2755 else if (FONT_INSTANCE_X_XFTFONT (XFONT_INSTANCE (font))) | 2755 else if (FONT_INSTANCE_X_XFTFONT (XFONT_INSTANCE (font))) |
2756 { | 2756 { |
2757 XtSetArg (al[ac], XtNxftFont, | 2757 Xt_SET_ARG (al[ac], XtNxftFont, |
2758 (void *) FONT_INSTANCE_X_XFTFONT (XFONT_INSTANCE (font))); | 2758 (void *) FONT_INSTANCE_X_XFTFONT (XFONT_INSTANCE (font))); |
2759 ac++; | 2759 ac++; |
2760 } | 2760 } |
2761 #endif | 2761 #endif |
2762 else if (FONT_INSTANCE_X_FONT (XFONT_INSTANCE (font))) | 2762 else if (FONT_INSTANCE_X_FONT (XFONT_INSTANCE (font))) |
2763 { | 2763 { |
2764 XtSetArg (al[ac], XtNfont, | 2764 Xt_SET_ARG (al[ac], XtNfont, |
2765 (void *) FONT_INSTANCE_X_FONT (XFONT_INSTANCE (font))); | 2765 (void *) FONT_INSTANCE_X_FONT (XFONT_INSTANCE (font))); |
2766 ac++; | 2766 ac++; |
2767 } | 2767 } |
2768 } | 2768 } |
2769 } | 2769 } |
2770 else | 2770 else |